Copy Link
Add to Bookmark
Report

GP32 and Pseudo Two Layers Screen Mode

sang's profile picture
Published in 
GP32
 · 4 Mar 2024

It is possible to create 50Hz screen mode that actually has two independent layers.. with minimal CPU involvement. I call this a Dual Playfield screen mode. You can also scroll both playfields (layers) independently using those hardware scrolling techniques and even split screen effects can be applied. The Dual Playfield screen mode works on 4, 8, and 16 bits color depths. The following text is from #gp32dev irc channel (that I wrote in a frustration and rage at 02:38am):

[2:38] spiv|ZzZz well doods.. to enable pseudo usefull for nothind 
mr.spiv (tm) two layer screen mode with annoying
transparency just pump the frame refresh rate over
100Hz and flip two framebuffers every 0.01sec.. to
get the other layer to appear to "foregroung" layer set
intensity bit to 1 for those colors it uses.. by
copying palette on every frame buffer flip you get
easily 32 colors 4bits screen mode
[2:39] spiv|ZzZz worx on 4,8 & 16 bits modes


As you can see the basic principle of the Dual Playfield mode is really simple. Interlacing two frame buffers at a great refresh rate. There are few things though. The frame rate can be adjusted by changing the values in LCDCON1, LCDCON2, and LCDCON3 registers. The most important variable there is the LCDCON1.CLKVAL. See some of my example source codes how LCD registers form the frame refresh rate. The other tricky thing is the frame buffer synchronization especially when double buffering is needed. As you know already the frame buffer must be flipped every 0.01sec (100Hz refresh rate). You might end up adding an interrupt that takes care of frame buffer flipping so that you can do your rendering and double buffering regardless the ongoing constant frame buffer flipping the Dual Playfield trick requires.

About palettes and stuff.. Interlacing causes transparency between those two playfields (or layers). It's sort of alphablending effect and also makes colors less bright. It is possible to change the palette contents on every frame buffer flip giving double the amount of colors as the bit depth could actually support e.g. 32 colors on 4bits mode. It is recommended that you set the intensity bit to 1 on those colors on that playfield that you want to appear as a "foreground" playfield.. although there still will be certain amount of transparency.

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT