Vertical pixel scrolling on Pac-Man hardware

Hurray Banana

Moderator
Staff member
vacBacker
Feedback
8 (100%)
Credits
2,725CR
Had a little bit of time this morning to work on vertical scrolling, which is more realistic at 60fps than horizontal (because of the layout of VRAM).

Here's a wip video

[tube]vtxl8B3adyw[/tube]

First part of vertical scrolling routine written for pac-man hardware. Jerkyness and flicker due to OBS. This is running at 60fps. The rendering is happening every frame, I'm only adjusting the scroll position every 8.

This video shows just the scroll renderer working, it moves one pixel every 8 frames and loops back.

Still need to write code for displaying the buffer from any point with correct wrapping. That part though is very hard compared to the scroll rendering shown here, it's bending my head a lot so I will walk away from this for a bit.

This takes advantage of VRAM layout favouring vertical drawing, which allows stack pushes to write 2 bytes at once. For every pairs of tiles I need to draw I need to examine 3 bits of my bitmap and use a lookup/offset table to let me know which pair of tiles to push onto stack (which is set to point at VRAM).

I need to build in a mechanism that allows me to render from any starting point in the offscreen bitmap buffer, I've played with a few ideas today but it's a real head thumper and I need to step back and let my brain digest the 6 or 7 ways I could implement this.

Anyhow once the buffer reading is working properly I should be able to get proper scrolling tilemap running.
 
Top