CMM2 graphics questions


Author Message
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 582
Posted: 04:02am 07 May 2026      

Yes
You can draw the elements on a memory page and blit them to page 0 or 1 depending on the screen mode you are using. This technique removes the flickering

From my game Knightmare:


page write 0
blit 0,TILE_SIZEx2, SCREEN_OFFSET,0, SCREEN_WIDTH,SCREEN_HEIGHT, SCREEN_BUFFER
page write 1
blit 0,TILE_SIZEx2, SCREEN_OFFSET,0, SCREEN_WIDTH,SCREEN_HEIGHT, SPRITES_BUFFER


In my case, it's a little more complex because I have a ton of sprites moving, and they were creating a lot of artifacts. I decided to use the two visible pages (zero and one) to render the screen elements and the sprites. I compose the frame in memory, by using two non visible pages, and I blit these two memory pages to the page 0 and 1, that are visible.