rednuht wrote:
>
> There is plenty of example code of copying an image to the lcd screen.
>
> What i want to know is can we write to an image in memory and use this
> as a buffer for screen updates.
It is possible, but it would take 192 bytes of memory. I think using the
work memory area would be fine for this, because the auto incrementation
of the pointer would save a few cycles when copying it in the vram.
>
> So the game loop would call a sub that clears the lcd screen, then the
> buffer image is copied to the lcd screen.
Clearing the screen wouldn't be neccessary, because it would be
overwritten by the new image. In fact, clearing the screen would
probably make a lot of flickering.
>
> meaning any events in the game that require a change in the display
> could just write to the buffer and wait for the main loop to call the
> clear screen and buffer to screen.
>
> and could a copy (buffer) image be stored in the data part of memory.
> ?
Yes, but it would take 192 bytes... The advantage is it would be linear
(unlike the vram), and thus simpler to access to. Also, when doing
intensive graphic operations, it would prevent flickering.
--
Antoine 'MORB' Chavasse / CdBS software