GBA BIOS

From PHWiki

Jump to: navigation, search

The GBA BIOS is a set of low-level subroutines used by GBA games to perform such operations as square roots, trigonometry, data decompression, and the like. These subroutines are stored on a 16 kilobyte mask ROM inside the GBA CPU.

Contents

Dumping the GBA BIOS

In GBA emulation, a "BIOS file" is a copy of the GBA BIOS in a computer file. Without a BIOS file, an emulator needs to use a high-level emulation of the functionality in the BIOS file. This emulation is often inaccurate, and some GBA emulators (notably VisualBoyAdvance) will work better with a real GBA BIOS image available.

Instructions

For traditional (NOR) cards

You'll need

  • A GBA Flash Card with working save memory, and the software to read the card's save memory on a PC
  • DumpRom by DarkFader

Procedure:

  1. Warning: This procedure will wipe out at least the first bank of saved data. So link your flash card to the PC and back up all saves presently on your flash card's battery-backed SRAM save area.
  2. Download DumpRom and flash the dumprom.mb.gba file onto your flash card.
  3. Put the flash card in your GBA, boot up, and run DumpRom. Wait until the screen flashes green.
  4. Turn off the GBA and link your flash card to the PC, and dump the SRAM to a file. If you are using a Supercard, the file may be named dumprom.sav. You will have to use the QPC method to save the sram!
  5. Use your favourite hex editor (frhed is a good one) to verify that the ROM looks intact. The first 32 bytes (first two lines) should exactly match the excerpt shown below, and there should be a block of zeroes that starts shortly before 0x4000.
  6. If it is intact, use the hex editor to trim the file to the first 16KB (up to 0x4000), and save as gba_bios.bin
  7. Copy gba_bios.bin to wherever your emulator expects it, or tell your emulator where the BIOS file is. (In VisualBoyAdvance, do Options > Emulator > Select BIOS file...)
  8. Restore the saves that you backed up earlier.

For GBA Movie Player and other cards that support libfat

You'll need

Procedure:

  1. Download the dumper and put gbamp_bios_dumper.gba on your CF or SD card.
  2. If necessary, patch the dumper with DLDI.
  3. Put the CF or SD card in your adapter, put the adapter in your GBA, boot up, and run the dumper. Wait until the screen flashes green. If it turns a solid color, see the README.txt file included with the program. Specifically, blue means you need a DLDI, and red means you're using a read-only DLDI and will not be able to write the BIOS file to the card.
  4. Turn off the GBA, put the card in your PC's card reader, and copy GBA_BIOS.bin from the root of the card to your PC.
  5. The file should already be the correct size (16384 bytes). Verify its contents as above.
  6. Copy GBA_BIOS.bin as above.

Verifying

Because the GBA BIOS is a copyrighted work, it cannot be distributed along with emulators, and it is not distributed through Pocket Heaven. However, if you want to verify that your BIOS dump is accurate, the first 32 bytes should match the following:

00000000: 18 00 00 EA 04 00 00 EA 4C 00 00 EA 02 00 00 EA
00000010: 01 00 00 EA 00 00 00 EA 42 00 00 EA A0 D1 9F E5

If the first byte is 00 or FF but the rest of the first 32 bytes are correct, the first byte may have been corrupted during a power cycle. In this case, changing it to 18 might make it work.

Additionally, here are some hash values to be absolutely sure the dumped BIOS is correct:

Hash function GBA, GBA SP, Game Boy Player, Game Boy micro Nintendo DS, DS Lite
Built-in BIOSChecksum Unknown Unknown
CRC32 81977335 a6473709
MD5 a860e8c0b6d573d191e4ec7db1b1e4f6 1c0d67db9e1208b95a1506b1688a0ad6
SHA-1 300c20df6731a33952ded8c436f7f186d25d3492 c11531d5261006810cdc954bd4bec0afe3187b35
SHA-256 fd2547724b505f487e6dcb29ec2ecff3af35a841a77ab2e85fd87350abd36570 782eb3894237ec6aa411b78ffee19078bacf10413856d33cda10b44fd9c2856b

References

Personal tools