Video output considerations

Open source STF clone project.
User avatar
IngoQ
Posts: 634
Joined: Tue Aug 22, 2017 8:38 am
Location: Germany

Re: Video output considerations

Post by IngoQ » Wed Dec 27, 2017 1:07 pm

Yes, I get that frame buffer part. What I don't understand is, how you prevent writing to the screen buffer whilst a screen refresh is taking place? This is what lead to tearing in PC games, the screen buffer changed while it was displayed. Syncing the writes to HSync and VSync helped, as it allowed changing the image when it was not displayed.

Or is this no issue here, since the screen writes are either not fast enough or synced by the shifter?
Ingo :geek:

“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” - Antoine de Saint-Exupéry

Petari
Posts: 536
Joined: Tue Nov 28, 2017 1:32 pm

Re: Video output considerations

Post by Petari » Wed Dec 27, 2017 1:26 pm

You simply read what shifter outputs, like TV displays it on CRT. So, V-sync starts it, then you wait DE for actual work. You get clock from shifter clock input - this is why it is much better as internal than external variant. So, it can be perfectly synced.
To prevent tearing need to use 2 buffers - while reading one by VGA, shifter writes in other. Usual double buffering, or may be triple by need. Need to care about border color too, for complete faithfulness, so may be needing more SRAM - in any case 1MB SRAM will be enough for every perverted demo :lol:
You don't care about preventing write to screen buffer - ST screen buffer. Atari SW is what must take care - like in my example - Flight Simulator 2 .
The point is that VGA displaying will be always in some delay - roughly about 40-80mS .
Out converter needs to care that read shifter output synced, so every pixel will be at right place in SRAM. And of course, then needs to read it synced to VGA frames, lines ... No H-sync in usual SW, as said. Converter may need to use H-sync too, but that has nothing with how ST (and not only ST SW works) . The main goal here is compatibility without need to patch SW. As much possible - and at 8 MHz, cycle accurate it will work like charm .
P.S. - preventing write to VGA buffer is not really possible - it must be done exactly as is described - synced as on TV it is 'written' to phosphor of CRT.
There is 2 kind of people: one thinking about moving to Mars after here becomes too bad, the others thinking about how to keep this planet habitable.

User avatar
exxos
Site Admin
Posts: 3566
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Video output considerations

Post by exxos » Wed Dec 27, 2017 2:11 pm

I remember I talked a lot about this topic in the past.

Firstly there are projects like this one..

viewtopic.php?f=29&t=330


But first we must re-create the shifter 100% before looking to improve it with other features..

which is aim of this project.

viewtopic.php?f=29&t=296

But really need next step to re-create MMU next and maybe GLUE logic 100%.

Also, I have little time for new hardware development in recent times , so all my work on somewhat 20 projects is boiling down to maybe a few days each year that I can spend on each. Also my fingers are much in pain lately, so it is also limiting what I can do.

Main problem is lack of skilled developers in community, I can't create whole new ST machine on my own, I think I will not live enough years, :lol:

So sure, if someone create 100% compatible ST chips with extra features, then I will use them in ST-REMAKE.
4MB STFM 1.44 FD- VELOCE+ 020 STE - 4MB STE 32MHz - STFM 16MHz - STM - MEGA ST - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - HxC - CosmosEx - Ultrasatan - various clutter

https://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.

Petari
Posts: 536
Joined: Tue Nov 28, 2017 1:32 pm

Re: Video output considerations

Post by Petari » Wed Dec 27, 2017 2:19 pm

Idea here is to use original ST or STE shifter, and adding on board (so not external) ST RGB to VGA conversion. In way as is described. Of course, some details need to be refines, this was just rough concept.
Recreation of some ST chips is just another, much larger topic - starting with basic question: how compatible it should be.
That's really too big task. While conversion, as is described is something what can probably be done in 1 month.
I can go with that. First question is availability and price of SRAM chips.
There is 2 kind of people: one thinking about moving to Mars after here becomes too bad, the others thinking about how to keep this planet habitable.

Petari
Posts: 536
Joined: Tue Nov 28, 2017 1:32 pm

Re: Video output considerations

Post by Petari » Wed Dec 27, 2017 5:01 pm

Actually. the whole concept can be tried pretty much faithful in emulator on PC. Steem has syncronisation in full screen mode. So, is easy to make it work at 60 Hz - as most of monitors work at it at full HD for instance (by need should set to 60 Hz in video card setting).
Then, using some scrolling SW what works at 25 fps, with special change - syncing it not to Vbl, but using some free timer to get 50 Hz interrupt, while Atari is set to 60 Hz. And not writing to screen buffer directly, but to immediate buffer, what simulates on VGA not visible ST RGB outputs. There will be 2 of such buffers - as is case with most of SW. Then need to copy those 2 buffers alternating to VGA buffers - which can be real screen buffers of emulated ST - and they cycle at rate pattern 1,1,2,2,3,3,3,4,4,5,5,5 , triggered by Vblank at 60 Hz . Or repeat counts: 1,1,2,1,2 (after last repeat it just switches to other buffer, what is already filled with last output.
So, juddering should be well visible. Question is, will be 2 buffers at VGA enough, or need 3.
And emulator can be set to high CPU speed - will need it probably to do all work in time - scrolling and video buffer copy.
There is 2 kind of people: one thinking about moving to Mars after here becomes too bad, the others thinking about how to keep this planet habitable.

User avatar
exxos
Site Admin
Posts: 3566
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Video output considerations

Post by exxos » Wed Dec 27, 2017 8:49 pm

Might be worth looking at scan doubler chips ? I think I was looking at some on linear technology site some weeks ago (not 100%) but they just take RGB binary inputs and can output to HDMI or whatever. Only issue from what I remember was I think they was 12bit inputs, and we only have 3bits on STF. STE 4 bits is better to scale into 12bits.

In terms of SRAM, I would suggest something like Altera cyclone like I plan to use for shifter design. Can fit huge circuit in there, plus have sram internally. There are low cost development boards and programmers are not expensive, and software is free.
4MB STFM 1.44 FD- VELOCE+ 020 STE - 4MB STE 32MHz - STFM 16MHz - STM - MEGA ST - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - HxC - CosmosEx - Ultrasatan - various clutter

https://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.

Petari
Posts: 536
Joined: Tue Nov 28, 2017 1:32 pm

Re: Video output considerations

Post by Petari » Fri Dec 29, 2017 7:15 am

For now, this is only thinking about concept of solution. Probably, all it is discovered by some other people already. But it's not bad to do it self. All it is not so complicated. I'm in process of doing special test SW, where can see how it will look in practice. Without Atari, only emulator in Win + 60 Hz monitor.
Considering 1MB SRAM in some FPGA ? That seems not realistic. And will cost more that 2 SRAM chips, probably. Scan doubler is not good enough - that's indeed simple solution, but will not work with 50 Hz input on most of monitors.
We have 9 bits on ST shifter. You must not use all inputs on scan doubler. This concept calculates with 16 bit SRAM. so almost half will be unused with ST. Just ignore low significant bits, that's all.
There is 2 kind of people: one thinking about moving to Mars after here becomes too bad, the others thinking about how to keep this planet habitable.

Petari
Posts: 536
Joined: Tue Nov 28, 2017 1:32 pm

Re: Video output considerations

Post by Petari » Sat Dec 30, 2017 1:29 pm

I did SW for testing 50-60 Hz conversion concept:
viewtopic.php?f=39&t=488

Some other methods seem not offering better quality. Only thing what could be better is complex motion analysis and new frame generating SW, what exists for some years. Myself did some conversions with it - for instance I converted some videos from 15 to 25 fps with freeware SW, and it is mentioned here: http://atari.8bitchip.info/movpst.php for instance. But that advanced framerate conversion is not for 'on fly' conversion. Not even with lower resolutions - motion analysis needs to go often back several frames, in multiple passes ... Even with enough processing power it could work well only with delayed displaying - about 20-30 secs, so no way.
This is what I see as possible, should not cost much. Please don't come with some commercial, available devices, unless there is some really good video, with good material where quality is really well visible.
There is 2 kind of people: one thinking about moving to Mars after here becomes too bad, the others thinking about how to keep this planet habitable.

Petari
Posts: 536
Joined: Tue Nov 28, 2017 1:32 pm

Re: Video output considerations

Post by Petari » Tue Jan 02, 2018 3:00 pm

I looked what TVs with Scart input are available at moment in EU.
Here is what is not expensive: Philips 22PFS4031/12 FHD - it has Scart input + HDMI, DVI, all new DVB standards supported ...
About 110-120 Euros . Of course, can serve as PC monitor too. USB connector for media playback, speakers. So, basically has everything.
Would be nice, if someone could test it with Atari RGB output.
There is 2 kind of people: one thinking about moving to Mars after here becomes too bad, the others thinking about how to keep this planet habitable.

User avatar
exxos
Site Admin
Posts: 3566
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Video output considerations

Post by exxos » Tue Jan 02, 2018 10:39 pm

Probably one method is to copy the video data from shifter (binary outputs) and use a PLD (assuming enough RAM) for frame buffer. Then the frame/ram buffer would be dual channel, so any refresh rate could be used, and is read from the buffer. Buffer could output at 100hz then for example.
4MB STFM 1.44 FD- VELOCE+ 020 STE - 4MB STE 32MHz - STFM 16MHz - STM - MEGA ST - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - HxC - CosmosEx - Ultrasatan - various clutter

https://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.

Post Reply