two screens for graphics, is that possible?

All aspects of programming on the Commander X16.
Post Reply
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

two screens for graphics, is that possible?

Post by funkheld »

Hi good afternoon.
two screens for graphics, is that possible?

I would like to draw graphics on the rear invisible screen and then copy them to the visible screen using move.

Thanks.
greeting
TomXP411
Posts: 1785
Joined: Tue May 19, 2020 8:49 pm

Re: two screens for graphics, is that possible?

Post by TomXP411 »

This is called "double buffering", and it's only available on tile modes or screen modes with less than 256 colors.

The issue with doing this at 320x240 is that a single screen uses up 76KB of VRAM, which means there's not enough room in VERA (128K) to page flip. You can probably page flip at something like 320x180, if you mask the bottom of the screen, or you can use a 16-color mode or any tiled mode.

Check out the VERA Programmer's Reference at https://github.com/X16Community/x16-doc ... ference.md

The TILE_BASE registers are what you'd need to modify; pointing TILE_BASE to two different locations in memory will allow you to modify the back buffer, then swap it out to the front buffer. There's no need to "move" data; instead you just change which part of VRAM is visible on screen at any given time.
User avatar
ahenry3068
Posts: 1151
Joined: Tue Apr 04, 2023 9:57 pm

Re: two screens for graphics, is that possible?

Post by ahenry3068 »

There is also the Rom routine graph_draw_image that will take image data stored in regular or banked memory and copy it to the screen in 256 color mode. But you couldn't use Graphics commands on the off screen buffer (unless you wrote your own routines to do this). But it can move rectangles to the screen pretty quickly.
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: two screens for graphics, is that possible?

Post by funkheld »

Hello, thanks for the help with the 2 screens.
I'm very happy that you answered my beginner questions
answered.

Thanks.
greeting
Post Reply