Merging video output?

If you want to ask questions about how the machine works, peculiar details, the differences between models, here it is !
How to program the oric hardware (VIA, FDC, ...) is also welcome.
sam
1st Star Corporal
Posts: 8
Joined: Sun Jul 09, 2017 3:28 pm
Location: France, Brest
Contact:

Re: Merging video output?

Post by sam » Fri Dec 15, 2017 10:06 pm

(thanks for the pointer, oric display is definitely trickier than I thought. And sorry for interrupting the thread. Now I'll figure out how to tune my tools for better conformance.)

User avatar
iss
Squad Leader
Posts: 613
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Merging video output?

Post by iss » Fri Dec 15, 2017 11:21 pm

20171216_000215.jpg
... and here is the short clip: https://youtu.be/W6KxqdzQLX8
What is new: I connected the SYNC output to the TAPE input (i.e. the famous VSYNC hack ;)) to filtrate H-sync pulses and left only V-sync to be used for synchronization. In the video I manually connect and disconnect the feedback wire as result pulses are dropped from time to time...
Now I need to make this to happen somehow automatically and to properly detect when both signals are exactly aligned. I want to stay with 80's design, but if an arduino solves the issue - I think it's worth, right?

User avatar
Dbug
Site Admin
Posts: 2600
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Merging video output?

Post by Dbug » Sat Dec 16, 2017 10:53 am

@iss: Well, no matter what we do, it's not going to be an "out of the box" Oric, that will require additional components to connect the machines, sync them, and merge the output.

Imo, we should just go for what is the simpler/more reliable solution, the one that gives the more benefits relative to the cost, and which does not require any incredible to source elements :)

If an arduino solves this issue, sure, go for it. Now my question is: If you go with an Arduino based solution, do we also get some more additional free ports and whatnots that can be used for helping communication between the machines, or maybe implement some of the video merging logic as well?

@sam: Enjoy! I'm really looking forward to some alternative converter (that's why I integrated the libpipi method into PictConv). Maybe you can even come up with the ultimate converter for whatever format we came up with for the "MultiOric" (patent non pending)

User avatar
Dbug
Site Admin
Posts: 2600
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Merging video output?

Post by Dbug » Tue Dec 19, 2017 7:36 pm

So, I played a little bit more with Oricutron, wasted some time trying to have it use SDL 2 - it's totally broken, broken sound, broken window management... - ended up having to recompile my own version of SDL 1, ... anyway.

I added a keyboard selection to ACTIVATE a specific machine, and then an additional renderer that merges the result of the multiple outputs.

Right now it's just a good old OR between all the values, so you definitely don't want to have any screen displaying WHITE, but it looks like that:
OR_Result.png
OR Composite
Now I need to see if I can get the various Oric to load programs and run something so I can test in better conditions, and also experiment with various merging algorithms :)

User avatar
Chema
Game master
Posts: 2240
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Merging video output?

Post by Chema » Tue Dec 19, 2017 9:22 pm

Nice!

It looks a bit like a Camputer Lynx, with bitplanes...

You can certainly get a good number of colors with little attribute clash.

User avatar
Dbug
Site Admin
Posts: 2600
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Merging video output?

Post by Dbug » Tue Dec 19, 2017 9:31 pm

I added another output, this time to test color shades:
4bit_clut_Result.png
As before the top right one is the result of ORING the values, but now we also have another one under that simulates 4 bits per component.

Code: Select all

    for (x = 240; x != 0; --x)
    {
      Uint32 c, c0, c1, c2, c3;
      Uint32 r, g, b;

      c0 = *(src_pixel0++);
      c1 = *(src_pixel1++);
      c2 = *(src_pixel2++);
      c3 = *(src_pixel3++);

      c = pal[c0|c1|c2|c3];

      *(dst_even_pixel0++) = c;
      *(dst_even_pixel0++) = c;
      *(dst_odd_pixel0++) = c;
      *(dst_odd_pixel0++) = c;


      r = (((c0 & 1) << 3) | ((c1 & 1) << 2) | ((c2 & 1) <<1 ) | ((c3 & 1) << 0)) << 4;  // 0000xxxx
      g = (((c0 & 2) << 3) | ((c1 & 2) << 2) | ((c2 & 2) << 1) | ((c3 & 2) << 0)) << 3;  // 000xxxx0
      b = (((c0 & 4) << 3) | ((c1 & 4) << 2) | ((c2 & 4) << 1) | ((c3 & 4) << 0)) << 2;  // 00xxxx00

      c=SDL_MapRGB( screen->format, r, g, b);

      *(dst_even_pixel1++) = c;
      *(dst_even_pixel1++) = c;
      *(dst_odd_pixel1++) = c;
      *(dst_odd_pixel1++) = c;
    }

User avatar
Chema
Game master
Posts: 2240
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Merging video output?

Post by Chema » Tue Dec 19, 2017 11:06 pm

Looks smart!

I thought about something much simpler, three Orics, each connected to an RGB component. Displaying b/w pics which is very easy, you can have 8 colors with no color clash at all. The fourth one could serve to produce two levels of brightness, so 16 colors and very easy to manage. Even with animations.

Then, if instead of b/w colors are used, I wonder if it could be used to tweak the brightness of each channel, so 8 possible levels of Red, Green and Blue.

Maybe this is nonsense... :)

User avatar
Dbug
Site Admin
Posts: 2600
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Merging video output?

Post by Dbug » Wed Dec 20, 2017 9:45 am

Chema wrote:
Tue Dec 19, 2017 11:06 pm
I thought about something much simpler, three Orics, each connected to an RGB component. Displaying b/w pics which is very easy, you can have 8 colors with no color clash at all.
You mean: http://forum.defence-force.org/viewtopi ... =30#p16669 ?

;)

User avatar
ibisum
Squad Leader
Posts: 977
Joined: Fri Apr 03, 2009 8:56 am

Re: Merging video output?

Post by ibisum » Wed Dec 20, 2017 9:55 am

As someone with a small fleet of Atmos' sitting in their boxes, I'd personally love it if the result of this project would be some sort of PCB that could be used to connect real machines into a "Mega-Oric" .. taking into account that it would also be great to have an onboard mixer for the synth engines too .. maybe even put MIDI in the mix somewhere .. so that the Mega-Oric is not just for great and crazy graphics schemes, but sound as well. Does this sound feasible? I know this is all very hacky/experimental, but just thought I'd put it out there - imagine we can plug in 4 Atmos and together get merged sound and video .. that would be a composition system worth serious attention, at least from me personally anyway. ;)

User avatar
Dbug
Site Admin
Posts: 2600
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Merging video output?

Post by Dbug » Wed Dec 20, 2017 10:08 am

Merged audio is a given, it's just trivial to do.
My idea was relatively basic, you can mix together all the audio outputs to just get more channels, but you could also easily use the additional machines to do some stereo (like for example center + left + right).
Adding MIDI inputs has already been done, it's not very complicated.

Ultimately it all depends on how easy and fast we can communicate between the various machines.

User avatar
Chema
Game master
Posts: 2240
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Merging video output?

Post by Chema » Wed Dec 20, 2017 11:25 am

Dbug wrote:
Wed Dec 20, 2017 9:45 am
Chema wrote:
Tue Dec 19, 2017 11:06 pm
I thought about something much simpler, three Orics, each connected to an RGB component. Displaying b/w pics which is very easy, you can have 8 colors with no color clash at all.
You mean: http://forum.defence-force.org/viewtopi ... =30#p16669 ?

;)
Yes, of course. I guess I read it, forgot about it, and then it came popping in my mind as an idea of my own :lol:

With 4 Orics you can also have 2 levels of brightness, so 16 colors in bitplanes, and many mad things can be easily done this way. I guess all the tricks done in other computers which supported bitplanes, like scrolling bitplanes (or parts of them) individually, or using one channel to draw sprites without the need of updating the background.

But alas, this is a kind of experiment, not something that could be use in general for Oric users. Probably for a good demo :)

User avatar
Dbug
Site Admin
Posts: 2600
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Merging video output?

Post by Dbug » Sun Jan 07, 2018 2:01 pm

So, I was doing some computations.

The HIRES memory on the Oric is 8000 bytes large, and the very fastest code you can use to copy stuff is a giant unrolled loop of these:

Code: Select all

lda source,x          ; 4 cycles, 3 bytes
sta destination,x     ; 5 cycles, 3 bytes
That's 9 cycles per byte, so for 8000 bytes it's a total of 72000 cycles.

Unfortunately our poor 1mhz 6502 can only achieve about 20000 cycles per frame, which means it takes 3.6 frames at 50hz to fully copy the HIRES screen.

As you may have noticed, 3.6 is smaller than 4, which means that technically if you have four orics, each one treating one quarter of the screen, you can achieve this mythical 50fps smooth HIRES scrolling on the machine.

I did a concept test on my hacked Oricutron, it looks like crap because the machines and the refreshes are not really synced, but that should give you an idea:
FastScroller.png
Four band scroller
So the problem I have at the moment, is that for some effects we absolutely want the ability to have each machine display a fully complete Oric bitmap graphics so we can speedup things by parallelizing, but in some other cases, you want them to cooperate by overlaying the various bit patterns to get more colors.

I'm not quite sure how to achieve that :)

User avatar
iss
Squad Leader
Posts: 613
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Merging video output?

Post by iss » Fri Feb 02, 2018 5:14 pm

After many tries with different feedback circuits I was unable to achieve something really working. :?
Now I think to try something else - to create a circuit which can drop exactly one pulse from the 12MHz clock. Below is the picture and HERE you can try it in simulator - click and hold the switch on left with your mouse :).
I'll build it asap and will post the result.
Attachments
sch1.jpg

User avatar
Dbug
Site Admin
Posts: 2600
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Merging video output?

Post by Dbug » Fri Feb 02, 2018 7:39 pm

What are these DR/Q_Q boxes?

The more I'm thinking about it, the more it seems similar to what is called "wake-up" state on the Atari ST:
http://atari-forum.com/viewtopic.php?f=68&t=9056
GLUE has internally a 2Mhz clock (period equivalent to one NOP) for the video state machine. Plus another 4Mhz clock to round robin grant bus access to the CPU or to the SHIFTER.

The two clocks are in perfect phase. This means that the active edge of the 2Mhz clock coincides with the 4Mhz one. The 2Mhz clock toggles an internal flip-flop. But the initial state of the flip-flop is not deterministic at power up.

Then, in one wakeup mode, the CPU is granted access concurrently with the 2Mhz period. In the other, it is the SHIFTER.
Sounds similar, no?

User avatar
iss
Squad Leader
Posts: 613
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Merging video output?

Post by iss » Fri Feb 02, 2018 8:00 pm

Dbug wrote:
Fri Feb 02, 2018 7:39 pm
What are these DR/Q_Q boxes?
This are D-type flip-flops, R is asynchronous reset in real world they are TTL 7474 chips.
The idea here is to drop pulses util both pictures are perfect aligned. There will be one button for every slave Oric.
And 6 presses on the button should move the slave picture with one visual pixel :). Yes, I imagine how many presses will be needed in the worst case...but if it works I can add 6x button or 'whole-line' adjustment.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests