Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 07:51 20 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: Framebuffer commands

Author Message
electrotrains
Newbie

Joined: 29/07/2020
Location: United Kingdom
Posts: 13
Posted: 09:37am 03 Aug 2020
Copy link to clipboard 
Print this post

Hi,

I'm trying to work out if the FRAMEBUFFER commands will help me in my attempt to write a scrolling, tile-based game in MODE 3,16 (320x200 16-bit).

Is the framebuffer really just like a PAGE, and differs only in that it can be bigger than the selected MODE resolution?
PAGE 0 is still what is visible on screen?

So I could do something like:
MODE 3,16
FRAMEBUFFER CREATE 640,480
FRAMEBUFFER WRITE
DO
' drawing to a 640x400 framebuffer goes here
' now we copy a 320x200 'window' to page 0
FRAMEBUFFER WINDOW x,y,0,B
LOOP

and I could have a 640x400 map, with a scrolling 320x200 region visible on screen?

Is using a FRAMEBUFFER to do this faster than just PAGE SCROLLing an offscreen page,  BLIT new tiles into the gaps, then doing a PAGE COPY to 0 to finally display?

Robin
https://github.com/robinhedwards
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8567
Posted: 10:41am 03 Aug 2020
Copy link to clipboard 
Print this post

  Quote  Is the framebuffer really just like a PAGE, and differs only in that it can be bigger than the selected MODE resolution?
PAGE 0 is still what is visible on screen?


Yes and Yes

  Quote  Is using a FRAMEBUFFER to do this faster than just PAGE SCROLLing an offscreen page


Probably slightly but should be conceptually simpler
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024