|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Prex Home > Document Index > Game Boy Advance | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Prex/Game Boy Advance - DocumentationVersion 0.2 (draft), 2005/06/29Table of ContentsHOWTO
How to run Prex on the Game Boy Advance?
There exist some hardware to run Prex on the Game Boy Advance.
Currently, I am using "Boot Cable USB" which is sold by
Optimize.
And, its control software is available for download from this
page.
Unfortunately, these are only japanese page... :-(
How to run Prex with the VisualBoy Advance?VBA - VisualBoy Advance is most popular GBA emulator. You can find the latest release at http://www.vba.ngemu.com. To run Prex with VBA, simply select file->open and open the prex image. There is no need to prepare the original GBA BIOS. The default keyboard setting of VBA is as follow: Table 1. VBA Key Assign
How to compile Prex for Game Boy Advance?At first, you have to prepare the toolchain for cross compiling ARM code. And then, the shell variables must be set for the arm-gba target.Step 1. Unpack ArchivesYou have to download and unpack the following files.$ cd /usr/src $ tar zxvf binitils-2.15.tar.gz $ tar zxvf gcc-core-3.4.3.tar.gz $ tar zxvf newlib-1.13.0.tar.gz Step 2. Build BinutilsConfigure and build binutils. $ mkdir binutils-2.15-arm-elf $ cd binutils-2.15-arm-elf $ ../binutils-2.15/configure --prefix=/usr/local/arm --target=arm-elf --disable-nls \ --with-cpu=arm7tdmi $ make $ make install You must set the path to this binutils. $ export PATH=/usr/local/arm/bin:$PATH $ cd /usr/src Step 3. Build gcc$ mkdir gcc-3.4.3-arm-elf $ cd gcc-3.4.3-arm-elf $ ../gcc-3.4.3/configure --prefix=/usr/local/arm --target=arm-elf --with-gnu-as \ --with-gnu-ld --with-cpu=arm7tdmi --disable-nls --enable-languages=c --with-newlib \ --enable-interwork --with-headers=../newlib-1.13.0/newlib/libc/include/ $ make LANGUAGES="c" $ make LANGUAGES="c" install $ cd /usr/src Step 4. Unpack SourcesUnpack the sources and move to top level directory of the source tree.$ cd /usr/src $ tar zxvf prex-X.X.X.tar.gz $ cd prex-X.X.X Step 5. ConfigureSetup target architecture and platform.$ ./configure --target=arm-gba --cross-compile=arm-elf- Step 6. MakeRun make.$ make Note: There is a cross-compiling kit for GBA named DevKit Advance. It may be usable for compiling Prex. How to use On-Screen Keyboard?Figure 2. On-Screen KeyboardThe driver for on-screen keyboard is provided to emulate a generic keyboard by using the GBA keypad. You can input any key by moving the cursor on the on-screen keyboard. The user can show/hide the on-screen keyboard on the GBA screen by pressing select button. The key assign is different for each case. Table 2. Key for On-screen Keyboard
Table 3. Default Key (No On-screen Keyboard)
Memory MapGeneral Memory Usage
VRAM Usage
System CallSince the GBA BIOS does not allow to handle the SWI event by the program, we need some trick to handle the system call. The system call will be handled by the following steps.
#define SYSCALL0(name) \ .global name; .align; \ name##: \ stmfd sp!, {r4, r5, lr}; \ mov r4, #SYS_##name; \ ldr r5, =0x202007c; \ add lr, pc, #2; \ mov pc, r5; \ ldmfd sp!, {r4, r5, pc};
ENTRY(syscall_entry) mov r5, lr mrs ip, cpsr bic ip, ip, #PSR_MODE orr ip, ip, #PSR_SVC_MODE msr cpsr_c, ip mov lr, r5Since a program can not change the ARM processor mode during the USR mode, all applications are always executed in SYS mode in Prex arm-gba port. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright© 2005-2007 Kohsuke Ohtani |