Page 1 of 1

Writing multiple VSRAM values per scanline

Posted: Sat Jan 23, 2021 11:58 pm
by Joe Musashi
I've been experimenting with writing multiple values to VSRAM in the HInt routine each line in order to set vertical scroll values for a number of two-tile columns.

In the example shown here, this is used to generate a fake transparent highlight bar by setting the vertical scroll value to select a specific brightness level per line. (In the Gens VDP Plane Explorer you can see the different versions of the SEGA logo.) If we are in two-tile scrolling mode, we can exploit this to tilt the highlight bar a little.

This example looks OK in emulators, I have also tested it on real hardware on a PAL MegaDrive 1. It would be great if other could try it on different machines and let me know it works or if it flickers ;) Binary and source can be found in the attached ZIP file.

Thanks!

SEGA.png
SEGA.png (3.14 KiB) Viewed 7509 times
PlaneExplorer.png
PlaneExplorer.png (15.75 KiB) Viewed 7509 times

Re: Writing multiple VSRAM values per scanline

Posted: Mon Jan 25, 2021 8:00 am
by ob1
I'm not sure that I understood everything,
but I have played a few times with HInt, and I must say this rock stable image is great.
Bravo for this piece of work.

Re: Writing multiple VSRAM values per scanline

Posted: Mon Jan 25, 2021 1:12 pm
by Stef
Well done, very nice trick to do animated reflection :)
How much of the VSRAM table you transfer per line ? here you don't need to transfer the whole table (and i guess that's not possible) ?

Re: Writing multiple VSRAM values per scanline

Posted: Tue Jan 26, 2021 7:51 pm
by Joe Musashi
Thanks ob1 and Stef!

Yes, the transfer is limited to 6 values (the logo is 96 pixels wide). I had to use some inline assembly and a lot of trial and error to get there. I haven't done any cycle counting, but I don't think it can be much more.

One could try to move the HInt code to Sega.s, or maybe use an exactly timed loop instead of an interrupt (like on an Atari 2600).