GP32's journal picture

GP32

followFollow
🤴
Administrator: sang
🕒
Created 14 Aug 2021
📄
34 Articles

Documents about how to program the GP32 console

GP32 Executable format

sang's profile picture
Published in 
 · 14 Mar 2024
Executeables, "Program Files": ------------------------------ GXB*,AXF,BIN Arm eXecutable Format: binary executable which starts with a branch and 6 address fields This is placed in gp32 ram starting at location 0xc000000. The entry point is the starting location and the entry is performed in ARM (not thumb) mode. Here is the header format: b SkipHeader DCD Start Of Rom Code @ (?) DCD End Of Rom Code @ (?) DCD Start Of BSS Section @ (?) DCD End Of RAM Sections @ (?) DCD Start Of DATA Section @ (?) DCD End Of RAM Sections @ (?) DCD 0x44450011 @ ... sometimes more info here... SkipHeader: b EntryPoint GXE Gamepark eXecutable Encryption inf...

GP32 MemoryMap

sang's profile picture
Published in 
 · 14 Mar 2024
GP32 MemoryMap v0.0.1 02.03.2002 ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- 0x00000000 - 0x0003ffff 512kb system rom (BOOT_ROM) Exception Vectors 0x00000000 Reset Supervisor 0x00000004 Undefined instruction Undefined 0x00000008 Software Interrupt Supervisor 0x0000000C Abort (prefetch) Abort 0x00000010 Abort (data) Abort 0x00000014 Reserved Reserved 0x00000018 IRQ IRQ 0x0000001C FIQ FIQ ------------------------------------------------------------------------------- 0x0c000000 - 0x0c7fffff 8mb workram (WORK_RAM) 0x0c780000 -...

GP32 demo code (VBlank)

sang's profile picture
Published in 
 · 4 Mar 2024
This simple source (in C and for GCC) shows how to emulate VBlank interrupt on GP32. Because of my own reasons the code is not 100% SDK "pure". vblank.c // // VBlank interrupt emulation example using timer4 interrupt // and line synchronization. // Version 0.1 // // (c) 2002 Jouni 'Mr.Spiv' korhonen // // Tested on Firmware 1.5.7e and compiled with gcc 3.0.4 // // Use at own risk!!! The code uses timer4 interrupt although // everything could be done using SDK's timer interrupts (i.e. // using GpTimerOptSet() ) // // ...

GP32 demo code (mummu)

sang's profile picture
Published in 
 · 4 Mar 2024
Yet another stuuuupid demo.. featuring slightly modified crossfade (tm) routine by Costis (tm).. I was just experimenting some DMA and MMU stuff. Btw the screen is 640x480x16bits and won't fit into BIOS provided memory area. Blah blah blah blah.. mummu.c // DMA & MMU demo (c) 2002 Jouni 'Mr.Spiv' korhonen // Really simple & stuuuupid // // The 'crossfade' routine originally (c) Costis // from his Crossfade-demo #include "gpdef.h" #include "gpstdlib.h" #include "gpgraphic.h" #include "gpmain.h" #include "gpfont.h" #include "gpmem.h" #include <stdlib.h> #include <s...

GP32 demo code (offscr)

sang's profile picture
Published in 
 · 4 Mar 2024
This simple demo demonstrates vertical scrolling using virtual screens and changing frame buffer pointers. This demo bangs the hardware bypassing the BIOS (tested with 157e FW). offscr.c // (c) 13-Jul-2002 Jouni 'Mr.Spiv' Korhonen // #include "gpdef.h" #include "gpstdlib.h" #include "gpgraphic.h" #include "gpmain.h" #include "gpfont.h" #include <stdlib.h> #include <string.h> // strcoll, ptrdiff_t, memcmp, strspn strerror GPDRAWSURFACE gpDraw; GPDRAWTAG gpDrawTag; volatile long* tpal = (long*)0x14a00050; volatile long* lcdcon1 = (long*)0x14a00000; volatile long* lcdcon2 = (long*)0x14a00004; volat...

Screen mode 14

sang's profile picture
Published in 
 · 4 Mar 2024
What? Didn't the screen mode 12 i.e. 16 bits screen mode be the last available?! Yes.. but there is an undocumented screen mode available in GP32 LCD hardware. If you set the screen mode to 14 you will get a fancy 16 bits screen mode, which seems to cause LCD DMA to skip every second half word in memory. So the visible effect is that instead of 1 picture you will see 4 small shrinked pictures. So is this useful for anything? I really don't know yet :) Thanks must go to ZardozJones for finding this effect for the first time!

GP32 and HBLANK Emulation

sang's profile picture
Published in 
 · 4 Mar 2024
Following text describes basic principles for CPU friendly HBLANK emulation. Basically HBLANK allows you to do raster effects on each raster line without busy-wait polling/waiting for certain raster line position. There are actually two different approaches how to achieve one raster line granularity on GP32 LCD manipulation. Either you use Timer Interrupts or Timer Synchronized DMA. The DMA is very clever and elegant as a solution and works on background without any "maintenance". Interrupts allow more flexibility but on the other hand have larger CPU cycle penalty due interrupt latencies and mandatory interrupt handling code. Remembe...

1 Bits Per Pixel Screen Mode

sang's profile picture
Published in 
 · 4 Mar 2024
Anyone wondered why the 1bpp screen mode does not work? The answer is simple: GP32 BIOS GpGraphicModeSet() call does it wrong and the Samsung data sheet tells incorrect information. That is indeed a good start. The trick in order to get the 1bpp mode set up correctly is to poke some "not that obvious" values into LCDSADDR3 register. 240 pixels requires 15 half words (15 * 2 * 8 = 240). One might think that LCDSADDR3.OFFSIZE=0 and LCDSADDR3.PAGEWIDTH=15 would produce a 240 pixels high screen without offscreen area. Well no.. The screen starts wandering around. In order to get a stable screen you need to define LCDSADDR3.OFFSIZE=1 and LCDSA...

GP32 and Pseudo Two Layers Screen Mode

sang's profile picture
Published in 
 · 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 10...

GP32 and LCD DMA

sang's profile picture
Published in 
 · 4 Mar 2024
Those who has taken a closer look at GP32's LCD hardware know that the GP32 really does not have any special LCD features you would expect from a handheld games machine. The virtual screen feature is almost the only positive exception. There are no VBlank interrupt, no HBlank interrupt, no LCD controlled DMA triggering, no sprites, no multiple playfields, no tiled modes (well some think this is just a positive thing) and so on. Also the LCD is somewhat *hard* to set up due its support for varying frame rates and screen sizes. But the GP32 LCD has linear frame buffer albeit it is rotated 90 degrees counter-clockwise. So the GP32 somewh...
loading
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