8bitkick / BBCMicroBot

Runs your toot on an 8-bit computer emulator
GNU General Public License v3.0
110 stars 8 forks source link

Handling of MODE7 colour blending #37

Closed ojwb closed 3 years ago

ojwb commented 3 years ago

The MODE7 interlace colour blending trick gives a very flickery video now:

0A%=19:B=&3C00:C=1205449:D=1459417:E=H.:F.S=1TO7:G=32:F.Y=0TO2:!E=&1D00OR7A.C:!B=&1D00OR7A.D:E=E+40:B=B+40:N.:C=C/8:D=D/8:N.:F.L=2TO3:$E=CHR$L+"MODE 7 rainbow using interlaced colours":E=B:N.:!-512=&B3402
1V.23;12,G;0;0;USR-12:G=72-G:G.1

If I revert to jsbeeb locally the bot produces a static image (which is what it produced before). I don't have real hardware to hand to test on, but I'd expect that it would look like the static image (but slightly blurrier, so the colour blending would if anything actually be more effective).

I suspect this is due to when the screen gets snapshotted no longer being directly linked to vsync.

ojwb commented 3 years ago

The new beebjit option -opt video:no-deinterlace-teletext helps - I still get a video rather than an image, but it looks much better.

Most of the video has the interlaced colours, but there's a brief flicker as it repeats. Looking at the raw bgra frames from beebjit, it's the first two frames - we get a frame with just one interlace, then a frame with just the other interlace, then the rest of the frames have both interlaces combined.

The same effect can be obtained just by looking at the start screen - patch the bot to pass the new option and then:

echo 'V.279;0;0;0;0;'|node client try

I'll open an issue with beebjit.

8bitkick commented 3 years ago

Looks this is now good enough / remaining issue is with beebjit so I'll close this

ojwb commented 3 years ago

We don't yet actually use video:no-deinterlace-teletext (I just patched it locally for testing) but I'll sort that out.

ojwb commented 3 years ago

And FYI, https://github.com/scarybeasts/beebjit/issues/24