Questions tagged [game-boy-advance]

Questions relating to the Nintendo Game Boy Advance console.

This tag is for questions relating to the Game Boy Advance only. For questions relating to the original DMG model, please use .


The Nintendo Game Boy Advance (GBA) is a 6th generation handheld video game console initially released in 2001. There were a few iterations of the GBA including the original model (no light), GBA SP front-lit screen model, GBA SP back-lit screen (brighter) model, and the Game Boy Micro. Each Game Boy Advance except for the Game Boy Micro includes backwards compatibility for Game Boy and Game Boy Color game cartridges. Due to the size of the Game Boy Micro, it lacks the required hardware for Game Boy and Game Boy Color software.

The GBA sports a 16.8 MHz 32-bit ARM7TDMI processor and an 8 or 4 MHz 8-bit Z80 coprocessor for Game Boy games. The GBA has 32 kilobyte + 96 kilobyte VRAM (internal to the CPU) and 256 kilobyte WRAM (outside the CPU). The screen resolution is 240x160 and the screen supports 15-bit RGB capable of displaying 512 simultaneous colors in "character mode" and 32,768 simultaneous colors in "bitmap mode". Stereo sound is handled by dual 8-bit DAC and all legacy channels from Game Boy are supported. The new DACs can be used to play streams of wave data or output multiple wave samples processed/mixed in software from the CPU.

Homebrew for the GBA is available through devkitARM from the devkitPro toolchain and also through libHAM (now discontinued). Homebrew software/games can be run in emulators on development machines or played on hardware with development flash cartridges.

The most popular game sold for the GBA was Pokemon Ruby and Sapphire at 13 million total as of November 25, 2004.

46 questions
5
votes
2 answers

Help with GBA ARM assembly program

I tried to modify this ARM assembly program (see bottom of the page) to use subroutines. It should display a red screen on the GBA (and compiling the example program it actually does, so it's not a toolchain use problem), but, when I run it, the…
Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
5
votes
1 answer

Using two Arrays in C/Gameboy programming

For a game in Gameboy programming, I am using four arrays called top, oldTop, bottom and oldBottom: struct Point { int x, y; }; struct Rect { struct Point xx, yy; }; Rect top[size], oldTop[size]; Rect bottom[size], oldBottom[i]; where Rect is a…
sparkonhdfs
  • 1,313
  • 2
  • 17
  • 31
3
votes
2 answers

Unexpected outcome of writing single byte to VRAM in GBA tile mode, value also written in next or previous byte

I'm trying to display a single tile with a single colored pixel using GBA tile mode, starting from scratch. It mostly work, but instead of setting a single pixel, it set the same color to the two bytes at the 16bits aligned location where I intend…
Globoplox
  • 55
  • 6
3
votes
1 answer

(Game Boy Advance) Program begins at 0x00000000 instead of 0x08000000. How to tell gcc to compile to a specific address?

I've got DevKitPro working on Game Boy Advance, but I've run into a few problems. The biggest one I see is that my code is assembled at 0x00000000 instead of the normal 0x08000000 for ROM cartridges. My understanding is that C compilers don't use an…
puppydrum64
  • 1,598
  • 2
  • 15
3
votes
1 answer

Can you store the memory location of a function into RAM using C?

I've been playing with Game Boy Advance coding in C. For interrupts to work, the address of your interrupt handler routine must be manually copied to RAM location 0x03007FFC. I know how to do this in ARM Assembly but not in C. I was trying something…
puppydrum64
  • 1,598
  • 2
  • 15
3
votes
1 answer

GBA C programming compiler gcc

I am trying to get started in programming for the GBA in Windows. Could somebody point me to a a good reference where they have been able to follow a complete set of directions? I want the directions to include the following: 1) downloading the…
CodeKingPlusPlus
  • 15,383
  • 51
  • 135
  • 216
3
votes
1 answer

OS-related operations and modes on ARM7TDMI(GameBoy Advance)

I would like to know whether the CPU of the GBA can use any features usually reserved for OSes, and how one can do this. For instance, I would like to have access to the privileged modes which the cpu apparently supports, but I can not understand…
byrondrossos
  • 2,107
  • 1
  • 15
  • 19
2
votes
0 answers

GBA: Issue drawing sprite object over background

I'm trying to write a very basic GBA game - I'm coming from years of C# coding, but new to C and GBA programming. I have been reading the tonc examples and am using the tonc lib. I have something that builds and runs, but I am failing to get a…
CatBusStop
  • 3,347
  • 7
  • 42
  • 54
2
votes
0 answers

Trying to animate a sprite using a simple timer and bitwise & checks

I'm attempting to make a simple Game Boy Advance game that has a sprite with four frames of animation. I'm new to C programming (I'm an assembly hobbyist, ARM assembly makes more sense to me but I gave up because of its limited ability to read and…
puppydrum64
  • 1,598
  • 2
  • 15
2
votes
1 answer

How To Debug With GDB

I'm newbie to emulator. Nowadays I try to view src code of mgba(GBA Emulator). https://github.com/mgba-emu/mgba I built and found option -g. -g option means Start GDB session (default port 2345) from help. Is it able to be debugged with GDB? How can…
Kyuvie
  • 23
  • 5
2
votes
1 answer

ARM Assembly - Adding two Registers

I'm trying to add two registers together in ARM Assembly, by dereferencing the first two registers, and then storing the result in the third register. At the moment I have 3 variables & a function, which are as follows; extern void my_function(int*…
George_H
  • 93
  • 2
  • 14
2
votes
1 answer

Game Boy Advanced Home brew image issue in C

I am making a home brew gba game just for fun and I have run into a little problem, i can draw a image on the screen fine, and i can read key input, expect when i try to display a different image when the user presses ENTER which is mapped to the…
user3349095
  • 59
  • 2
  • 10
2
votes
1 answer

GameBoy Advance objects not being displayed in correct place when player is moving

This might take a while to explain - go grab a snack while you're reading this. I am developing a 2D puzzle platforming game for the Gameboy Advance in C++ (I'm a fairly new programmer). Up until last night, I have been making a phyics engine (just…
2
votes
1 answer

Using DMA in mode 4 GBA Linux

I am programming a game in GBA for fun and want to use mode 4. I have recently created a game in mode 3 and the dma for it was quite simple. Would the dma structure be same if I wanted to draw an image onto the screen? Here is what I have: /* * A…
James Carter
  • 387
  • 2
  • 6
  • 18
1
vote
1 answer

Writing PSRAM in EZ Flash 3 in 1

I am trying to figure out how to program the PSRAM in the GBA sized EZ Flash 3 in 1 card. Basically repeat what GBA Exploader and other programs do. If I select a block and program it then read it back the first halfword is always 0x1500 or…
old_timer
  • 69,149
  • 8
  • 89
  • 168
1
2 3 4