Page 1 of 1

two screens for graphics, is that possible?

Posted: Mon Feb 26, 2024 9:42 pm
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

Re: two screens for graphics, is that possible?

Posted: Tue Feb 27, 2024 2:39 am
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.

Re: two screens for graphics, is that possible?

Posted: Tue Feb 27, 2024 3:13 am
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.

Re: two screens for graphics, is that possible?

Posted: Tue Feb 27, 2024 7:44 am
by funkheld
Hello, thanks for the help with the 2 screens.
I'm very happy that you answered my beginner questions
answered.

Thanks.
greeting