harbaum / NanoMig

Amiga Minimig ported to the Tang Nano 20k FPGA
82 stars 5 forks source link

VATestprogram: Screen (including NanoMig menu) rolls vertically #9

Closed darius600 closed 2 weeks ago

darius600 commented 1 month ago

Steps to reproduce:

harbaum commented 1 month ago

Sounds like the Amiga can change its fundamental video timing. I'll look at that once the Nanomig runs stable

harbaum commented 3 weeks ago

I see a similar scrolling in one of the intro screens of pinball fantasies.

This means that there's a video mode being used on Amiga side that does not have the number of lines expected by the HDMI encoding of NanoMig. The image is slowly scrolling up which means that HDMI draws probably one line more than the Amiga is sending. So the Amiga for some reason decided to send less lines per screen than usually.

Currently I only differentiate between PAL and NTSC and both work fine with e.g. the Amiga test kit. So there is a video mode being used my HDMI encoder is not aware of. I wonder if it's an interlaced mode. I need to find some test program that allows me to switch all kinds of video modes. Preferably something that can auto start without interaction as I could then run this in the verilator simulation and have a closer look there.

harbaum commented 2 weeks ago

It's indeed the interlacing that's causing this issue. The double scanned image has one line less in this case and the HDMI encoder needs to take that into account.

xolod79 commented 2 weeks ago

I have a similar problem on the demo "15 Years of Fame" https://www.pouet.net/prod.php?which=61034

harbaum commented 2 weeks ago

In order to debug it you might run it in simulation and watch the output of the frame capturing. It may report unexpected frame sizes.

retrofun commented 1 week ago

Also affected by this: Great Giana Sisters, Jinxter

I had a look at it with GAO: the interesting thing is when switching back from an interlaced screen mode to non-interlaced. Either there are 625 lines or 623 lines then (for PAL).

I have adapted the video_analyzer to handle this, PR is here.

Successfully tested with Great Giana Sisters, Jinxter, VATestdisk6.28b, 15 Years Of Fame.

harbaum commented 1 week ago

I actually wonder if this is a bug in the minimig. I don't think it should do this and I doubt a real amiga does this.

It may be worth trying to figure out why exactly this happens.

retrofun commented 1 week ago

The Amiga is able to output long frames (313 lines) and short frames (312 lines), selectable in VPOS.

Non-interlaced modes usually use long frames but it's also possible to select short frames.

In interlaced modes long frames and short frames are alternated (auto toggle control bit in BPLCON0.

A detailed explanation can be found here at EAB.

derschrei commented 3 days ago

Same issue on Spaceballs' nine fingers demo (it happens with last release also). It can be downloaded here:

http://spaceballs.untergrund.net/files/spb-9fingersa.adf http://spaceballs.untergrund.net/files/spb-9fingersb.adf

retrofun commented 1 day ago

I can confirm that the screen rolls vertically for Spaceballs Nine Fingers Demo with nanomig.fs v0.3. With nanomig.fs v0.4 it works for me.