This is a demo to try out how far VERA can be pushed: it is quite hard to have vertically (independently) scolling bars using VERA.
What this demonstrates is that it is in possible. But only just.
It turns out I had to use 80 sprites in combination with a lot of LINE-interrupts.
Here is what I did:
- Create a 64 pixel by 5*64 pixel colored data rectangle (in this example filled with 4x4 pixel squares)
- Place 80 sprites (of 64x64 pixels) from left to right, overlapping mostly, but showing the 4 left pixels of each sprite
- These sprites are (vertically) grouped in pairs, so that each pair is placed one pixel lower than the pair next to it on the right
- The data address of each sprite (where they get their colored pixels from) are initially set to the same point (they all start with an vertical offset of 0)
- For each low-res LINE-interrupt (that is: 240 times per frame) we do the following:
- move one pair of sprites (that are *just* out of view) 64 pixels down
- change the data address so that it matches it individual vertical-offset
- At the end of all the LINE-interrups (after the 240 lines) we do the following:
- Adjust the vertical offsets with the individual change-per-frame numbers
- Move all sprites back to the top, with negative y-coordinates (according to their offsets)
It runs a maximum fps: every frame there is an update.
Warning: this demo contains (what amounts to) flashing / strobing effects.
# Known issues
- There are small horizontal lines visible at certain places. This is probably because the LINE-interrupt code is not fast enough
# Comparing hardware with emulator
I think this demo will probably not work (exactly) the same on real hardware. It's probably a good way to check whether the emulator is accurate (for certain aspects of the VERA board).
# To Compile:
cl65 -t cx16 -o VBS.PRG -l vbs.list vbs.asm
# To Run:
x16emu.exe -prg VBS.PRG -run