MiSTer-devel / BBCMicro_MiSTer

BBC Micro B and Master 128K for MiSTer
25 stars 16 forks source link

Support for "split mode" video #4

Open sharpie7 opened 3 years ago

sharpie7 commented 3 years ago

This seems to be a known fact, but as there is no issue for it I thought I would add one.

Currently, the simulation doesn't support "split video" modes (e.g. in Elite and Revs) where the video registers are changed during each screen scan to put different video modes at the top and bottom of the screen.

I am testing on HDMI. I haven't tested VGA.

This is an advanced technique which wasn't used on early BBC Micro games, but it is a nice-to-have feature because some of the later "big titles" like Elite used it.

sorgelig commented 3 years ago

no problem, you are welcome to add support of it. It will be very tricky (if ever possible) to handle variable resolutions on the same frame.

sharpie7 commented 3 years ago

I thought you might say something like that!

I haven't had a chance to look at the existing code to understand how it works. Anything I should know that isn't obvious?

sorgelig commented 3 years ago

Both scandoubler and scaler need to know exact visible resolution at beginning of frame. If resolution has been changed in the middle, then it will definitely break the video. So before pass the video to scaler/scandoubler there must be some module which will cut/add pixels to new resolution to keep the whole resolution unchanged.

sharpie7 commented 3 years ago

Thanks

If in vidproc.vhd (about line 290) you change CE_PIX <= clken_pixel to CE_PIX <= CLKEN then the normal modes still work, but all have a constant pixel rate in all modes as seen by the API. It also seems to make the split modes in Elite and Revs closer to right, but they are still not correct. I wonder if they use different vertical spacings as well as different pixel dividers in their splitsn (which really would be hard to correct for).

sorgelig commented 3 years ago

Pixel rate from teletext video is different than pixel rate from crtc.

sharpie7 commented 3 years ago

For sure. As far as I know all the split modes use the CRTC for the whole screen. I don't think anybody combined Mode 7 (teletext) with CRTC.

Looking at the Elite code and this explation it seems that the only parameters that Elite changes to get the split screen is the pixel rate (r0_pixel_rate) and the pallette in the Video ULA. The screen is based on Mode 4, but with some modified settings in the CRTC.

sorgelig commented 3 years ago

The only game i know with this issue is Elite. I think it doesn't worth hassle just for a single game (or may be couple more).

sharpie7 commented 3 years ago

no problem, you are welcome to add support of it.

It turns out that getting Elite working was fairly simple - see #5

Left-Empty commented 1 year ago

Just to let know that the issue is still present with Revs.