Big tilemap vertical scroll with CPCTelera

Started by amkam, 18:44, 14 March 23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

amkam

Hi everyone! I'm quite new into CPC programming (just did BASIC stuff when I was a kid) and recently, to scratch an itch, I started drafting this diagonally scrolling game concept based on CPCtelera's tilemap hardware scroll example. Targeting the raw 464 hardware and the tilemap is "big": 120x120 tiles.

The pristine CPCtelera's example scrolls horizontally and I made it also scroll vertically by the usual trick of adding 40 bytes to the video memory offset. That works until the video offset overflows and starts at a misaligned position (offset + 40 > 0xFF). I was thinking on ways to overcome or solve this issue without resorting to software scrolling (double buffering), and losing either lots precious FPS or memory space.

So before running into more dead ends because of not knowing for better solutions and deeper knowledge of CPC hard, I'm asking if someone has overcome this limitation somehow, and has a shareable example of the solution. Or any other idea on how to tackle this problem (even changing the perspective as a whole). Not looking for cpctelera based solutions only, although those would be ideal.

Thanks!!!

PD: I was thinking on perhaps using the video page offset too to allow fitting the whole tilemap, but got into unknown crashes before being able to figure out the math adjustments.

andycadley

The trick is to draw into the now off-screen part of the video memory before scrolling it into view. There is almost always not nearly enough video memory to hold the entire level as a screen (and the way the display addresses wrap essentially precludes it anyway) so you're always going to be generating the display partially on the fly 

Powered by SMFPacks Menu Editor Mod