VisalBoyAdvance is a Gameboy/GBA emulator for Windows

HomeScreenshotsDownloadsFAQLinksSupport us

<< Frequently Asked Questions >>
Questions
General
  1. What are the features of VBA?
  2. Can you make a DOS version?
  3. Where are the settings stored in the Windows version?
  4. When will the new version come out?
  5. You have to fix it because "XXX" doesn't work?
  6. How can I backup my settings on Windows?
  7. Is there any tutorial on how to use VBA?
  8. Can you port VBA to XXX?
  9. I have a problem with VBA for XXX!!!
  10. Can you email when VBA is released?
Errors starting the emulator
  1. I get a message about DDRAW.DLL, DINPUT.DLL or DirectDrawCreateEx. What's this?
  2. The emulator starts and closes right away
Crashes (emulator dies while emulating)
  1. How do I report a crash?
Cheating or Hacking
  1. How can I use the cheat search function?
  2. Where do I enter cheat codes?
  3. Why some cheats never work?
  4. What are the different add cheat options?
  5. CodeBreaker codes don't work!
  6. What about Xploder or Action Replay codes?
  7. Is there any tutorial or text on how to hack?
  8. What about GSA V3 codes or AR V3 codes?
Graphics problems
  1. Sometimes I get a black screen. What's wrong?
  2. The bullets, missiles or sprite blinks or disappears. Can you fix it?
  3. Why if I select a graphic filter, the emulation speed decreases?
  4. I get a blurred screen on 2x or bigger sizes.
Sound problems
  1. My sound is terrible. What can I do?
  2. Why some games have no sound? (message about BIOS function)
Performance
  1. Why is the emulator running too fast?
  2. Why doesn't vsync work to synchronize the emulator?
  3. How can I make it run faster?
  4. Why does the speed varies so much from game to game?
Graphical User Interface
  1. Why can't I change the filter anymore?
  2. What does the percentage on the top mean?
  3. How do I install/load a translation?
  4. How do I make a new translation?
  5. I downloaded the translation but the game is still in Japanese?
Joystick support
  1. You don't support joystick xxxx!
  2. When I try to configure the joypad VBA fills all entries with the same value!
Linux or Debian
  1. I have problems running under Debian (or other Linux distribution)
  2. Debian solution
SDL
  1. What is SDL?
  2. Where can I find more about SDL?
  3. How do I configure the keys?
  4. What are the special keys?
Link
  1. Why don't you add link?
  2. Will link ever be supported?
  3. Why don't you use Kaillera or look at TGB Dual?
Insight GDB
  1. How do I use VBA with GDB/Insight?
  2. GDB support
  3. Using the TCP transport
  4. Using the PIPE transport
  5. Debugging with GDB
  6. Console output
BIOS Calls
  1. What's the list of BIOS calls?


Answers
General
  1. What are the features of VBA?
    • save game state at any point
    • graphic filters to enhance display: 2xSaI, Super 2xSaI, Super Eagle, Pixelate and Motion Blur
    • full screen support
    • screen capture (through menu or configured key)
    • joystick support
    • speed up button
    • Gameboy Printer emulation
    • Gameboy GB, SGB, GBC and GBC on GBA emulation types
    • SGB border support
    • auto-fire support
    • translation enabled (for emulator only)
    • hacking capabilities, including search engine, Gameboy Gameshark and GameGenie support and GamesharkAdvance and CodeBreakerAdvance support
    • GBA debugger in the SDL version Linux, Windows and BeOS (SDL version)
    • import Gameshark Game Saves, codes, etc...
    • import battery files from other emulators
    • export battery files to other emulators
    • sound recording

    [Back to top]

  2. Can you make a DOS version?
    Sorry, I can't produce a DOS version. If you want something similar to a DOS version, try the SDL version which can be faster depending on the machine and hardware.
    [Back to top]

  3. Where are the settings stored in the Windows version?
    For version 1.6 and up:

    The settings are stored in the vba.ini in the same directory as the emulator executable.

    For older versions:

    All settings in the Windows version are stored in the registry under:

    HKEY_CURRENT_USERSoftwareEmulatorsVisualBoyAdvance
    [Back to top]

  4. When will the new version come out?
    When I release it. Don't bother emailing about it as will no longer reply to those emails.

    When I decide that the new version is ready, it will be made available. Not before. Not because of 100 emails asking me to release it.
    [Back to top]

  5. You have to fix it because "XXX" doesn't work?
    If you really want to play "XXX", buy yourself a GBA and "XXX" and play it. The emulator may never emulate the GBA perfectly, so some stuff may never work.
    [Back to top]

  6. How can I backup my settings on Windows?
    For version 1.6 and up:

    Just make a copy of the vba.ini file.

    For older versions:

    You can use regedit.exe (either with user interface or command line) to export the settings.

    From the command line:

    regedit /e mysettings.reg HKEY_CURRENT_USERSoftwareEmulatorsVisualBoyAdvance

    You can then double-click the file to import the settings again.

    If you are using the GUI version of regedit, just find the VisualBoyAdvance node HKEY_CURRENT_USERSoftwareEmulatorsVisualBoyAdvance, select it and choose Export from the menu.

    On newer versions, you can also export your settings to an INI file and use it instead of the registry. Just look at the File->Export menu and Options->Emulator menu.
    [Back to top]

  7. Is there any tutorial on how to use VBA?
    You can try the one at Easy Emu
    [Back to top]

  8. Can you port VBA to XXX?
    No. I am not responsible for ports. The source is available, so anyone can try to port it. The SDL version should compile on most computers and run.
    [Back to top]

  9. I have a problem with VBA for XXX!!!
    I only answer problems on the Windows and Linux version.

    For BeOS, click here

    For Mac OS X, click here
    [Back to top]

  10. Can you email when VBA is released?
    I do not send emails invididually, but I email the vba-announce list.

    If you want to subscribe, visit this link.
    [Back to top]

Errors starting the emulator
  1. I get a message about DDRAW.DLL, DINPUT.DLL or DirectDrawCreateEx. What's this?
    This means you don't have Microsoft DirectX installed.

    Please go to http://www.microsoft.com/directx and install it or you cannot use VisualBoyAdvance.

    As an option, you can use the SDL version which doesn't require DirectX.
    [Back to top]

  2. The emulator starts and closes right away
    If you are using the SDL version, it requires you to pass the ROM file to be emulated. You may also want to use a frontend, which you can find links to in the Links section of the website.

    If you are using the Windows version, it is possible that your computer is infected by a virus.
    [Back to top]

Crashes (emulator dies while emulating)
  1. How do I report a crash?
    Note: by crash I mean the program closes itself and a operating system message is shown saying that the program performed some illegal operation.

    This information is available on the readme. Please note that this is a crash of the emulator program and not the emulated ROM!

    If VisualBoyAdvance crashes, please do the following:

    • Win 95/98/ME: start DrWatson (drwatson.exe) and reproduce the crash. DrWatson will capture the crash information in a log file (.wlg) file that needs to be sent to me.
    • Win NT/2000/XP: make sure DrWatson is the default debugger by executing drwtsn32.exe -i and then recreate the crash. DrWatson will generate a log file that needs to be sent to me (usually in c:Documents and SettingsAll Users DocumentsDrWatson). Depending on your system configuration, you may be asked if you want to generate a log file. If so, please click on yes.
    • Linux and BeOS: if you get a core file, please compress it and send it to me for investigation.

    [Back to top]

Cheating or Hacking
  1. How can I use the cheat search function?
    The cheat search can only be used to search and modify values in the RAM areas, i.e., you can change your number of lives, money and life bar and you can freeze the value to get "infinite" result.

    To use it, enter the cheat search dialog and start a new search (or reset any previous search). If you have 5 lives, select equal on the comparison type, make sure Specific value is selected, click on entered value, type 5 on the value to search and then click search. This will find all locations where the number 5 is present.

    Return to the game and lose a life. Once you lost a life, go back to the search dialog, click on less than compare type, select old value and click on search. This will search the previous found locations for values less then the previous value. You should now be able to identify the location that contains the number of lives. You can write it down and change its value by selecting it and clicking on add cheat button. If there are still too many options, continue loosing a life and refining the search.

    Some cheats will require you to use a different size for the data. For example, life bars are usually represented in 16 bits. Number of lifes is usually 8-bits. Score is usually represented in 32 bits.

    Depending on the game, it is possible that values are kept in BCD format (Binary Coded Decimal), so you may need to do all the searches in hex instead of decimal format.

    Cheats are saved with the emulator save states and can also be disabled.
    [Back to top]

  2. Where do I enter cheat codes?
    Under the Cheats menu, go to the Cheat List... option. This will bring up the list of cheats and it will let you add new codes, remove and disable codes.
    [Back to top]

  3. Why some cheats never work?
    Cheats are very dependant on the game where they were hacked. For example, a Japanese version will most likely have a different address for the number of lives than the English version.

    If you are using the import Code file function, it will try to make sure that the codes are for the correct game and warn you if not. This is only true for GameboyAdvance code files.

    Also, GamesharkAdvance (and CodeBreaker) Must be On codes enable the emulator to tell if the game being emulated is the same as the game used to hack the codes and it will warn the user if not.

    NOTE: not all codes supported by the cheat devices are supported by the emulator.
    [Back to top]

  4. What are the different add cheat options?
    For Gameboy:
    • Gameshark: adds a Gameshark code. Format is XXYYAAAA
    • GameGenie: adds a GameGenie code. Format is XXX-XXX, XXX-XXX-XX
    For Gameboy Advance:
    • cheat: adds a cheat described by address, value and size
    • cheat code: a string version of a cheat in the format XXXXXXXX:YYYYYYYY where XXXXXXXX is the address and YYYYYYYY is the value (length of YYYYYYYY determines the length of the write - YY means 8 bit, YYYY means 16-bit and YYYYYYYY means 32-bit)
    • Gameshark: adds a Gameshark Advance code. Format is XXXXXXXXYYYYYYYY
    • CodeBreaker: adds a CodeBreaker Advance code. Format is XXXXXXXX YYYY

    [Back to top]

  5. CodeBreaker codes don't work!
    CodeBreaker codes have a separate encryption for every game, so you need to input the Must Be On codes in order to have them properly decoded by the emulator.
    [Back to top]

  6. What about Xploder or Action Replay codes?
    Xploder is the European version of CodeBreaker. Just enter the codes as CodeBreaker codes and it will work.

    Action Replay is the European version of the Gameshark. Codes are usually listed in 8 character pieces. Just enter every two codes together as a Gameshark code.
    [Back to top]

  7. Is there any tutorial or text on how to hack?
    Try the following found at www.gscentral.com:

    http://www.gscentral.com/HackingText/index.shtml
    [Back to top]

  8. What about GSA V3 codes or AR V3 codes?
    GSA V3 codes are just like Codebreaker codes and can be entered as either Gameshark or Codebreaker codes.

    AR V3 can be entered in 8 character blocks with a space or newline separating them.

    AR V1/V2 should be entered in 16 character blocks, so just join every two 8 character blocks.


    [Back to top]

Graphics problems
  1. Sometimes I get a black screen. What's wrong?
    Black screens on some ROMs only may indicate that there is a problem with the emulation of that ROM or that you have an old version of the emulator. Please verify if a newer version exists and, if not, please contact the author.
    [Back to top]

  2. The bullets, missiles or sprite blinks or disappears. Can you fix it?
    Some games will blink the sprites in order to obtain some effects that are only possible on the actual hardware display. On the emulator, change the frameskip setting to the next or previous value and verify if the problem disappears. If not, try setting it to 0. If it still persists, please contact the author.
    [Back to top]

  3. Why if I select a graphic filter, the emulation speed decreases?
    The graphic filters modify the image that will be displayed after the emulator has completely drawn it. Depending on the filter, it can a CPU intensive process which will reduce performance. There is nothing that can be done other than disable the filter if you want faster performance.
    [Back to top]

  4. I get a blurred screen on 2x or bigger sizes.
    This is an artifact of DirectX. The emulator doesn't have control over it and it depends on the video card.

    One way to avoid the problem is to use one of the graphic filters.

    Another option is to set the DDraw Emulation only mode in the Video options. This will make DirectX emulate some hardware features and the blurring will disappear.
    [Back to top]

Sound problems
  1. My sound is terrible. What can I do?
    Sound quality cannot be guaranteed if the emulation speed is not at full speed (99% or 100% on the title bar). If you own a SBLive card, make sure you have updated drivers as they are really buggy. Also, if the emulator is not running at 99% or 100%, sound may not be perfect. Also, you may want to experiment with different settings like frame skip, vsync, synchronize, sound quality and priority to find the settings that work best on your computer.
    [Back to top]

  2. Why some games have no sound? (message about BIOS function)
    Some games use the BIOS sound driver instead of placing it on their cartridge. VisualBoyAdvance does not emulate those BIOS functions, so no sound will be produced in those cases.

    The solution is to use a BIOS image.
    [Back to top]

Performance
  1. Why is the emulator running too fast?
    If the emulator is running too fast, make sure that the Synchronize... option is checked on the Options->Emulator menu and that Sound is on. If sound is off, there will be no synchronization and the emulator will run at maximum speed. This should change in the future.

    If you want no sound, mute the sound instead of turning it off.
    [Back to top]

  2. Why doesn't vsync work to synchronize the emulator?
    Vsync is implemented by calling DirectDraw and asking it to wait for the next vertical blank interval before drawing the next frame. Unfortunately, this doesn't always work depending on the video card.
    [Back to top]

  3. How can I make it run faster?
    Try the following in order to improve emulation speed:
    • increase frame skip
    • increase the emulator priority
    • use a lower sound quality
    • don't user filters
    • use 1x mode or full screen mode
    • disable SFX
    • enable the Use Video Memory setting
    • try the SDL version

    [Back to top]

  4. Why does the speed varies so much from game to game?
    Unfortunately, emulating every possible instruction for every frame is a very expensive operation and requires a fast machine.

    These are the different kind of game loops that may be used:

    • CPU Loop: usually keeps checking on a flag in a loop until it changes (usually changes in an interrupt) - this makes emulation slow and it could have been acomplished with the Halt/IntrWait/VBlankWait BIOS calls before checking the flag each time
    • Halt/IntrWait/VBlankWait BIOS calls - these BIOS calls put the CPU in a HALT state where the emulator will speed up as there are no instructions to emulate. Usually a flag will be checked once the call returns from the BIOS in order to continue the game loop
    The difference between the fist and second approach are enourmous when emulating. Unless a program needs all the cycles on a frame, it should always try to use the BIOS calls which put the CPU in the HALT state.
    [Back to top]

Graphical User Interface
  1. Why can't I change the filter anymore?
    The filters only work in 16-bit modes (full screen mode is always in 16-bit mode). In any other mode (24 or 32 bits), the filters are disabled by default. The menu will reflect this by graying out the filter choices if the emulator is running in 16-bit mode.
    [Back to top]

  2. What does the percentage on the top mean?
    The percentage on the title bar measures the speed of the emulator when compared to what should be normal. For example, 99% or 100% mean emulation at normal speed. 50% means you are running 50% slower than normal. 150% means you are running 50% faster than normal.

    Other emulators prefer to show FPS (frames per second) instead. That works ok as long as there is no frame skipping. When frame skipping is in use, normal speed can be achieved with less frames. For example, with a frame skip setting of 1, normal speed will be achieved if you are getting 30 FPS (compared to 60 FPS with no frame skipping).

    For this reason, VisualBoyAdvance sticks with the speed percentage instead of showing frames per second.
    [Back to top]

  3. How do I install/load a translation?
    Translations are decoupled from VisualBoyAdvance so that the emulator doesn't need to be changed in order to add a new translation.

    Translation files are Windows DLLs with the name convention: vba_XXX.dll where XXX is the language name abbreviation as defined by Windows (refer to the how to translation question if you want to make a translation).

    To load a translation, there are two possible ways, from the Options->Language menu:

    • select System to have the emulator try to use the system language
    • if the previous option does not work or if your system is running on a language other than the one you want to use, select the Other... option. On the dialog that appears, type XXX (from the translation file name as described above) and click Ok
    Please be aware that the author is not responsible for the translations (other than Brazilian Portuguese) and will not understand emails in another language. The English (default) language is always the most up to date and has all features enabled. Report any translation problems to the respective translators as found in the Help->About menu when using the translation.
    [Back to top]

  4. How do I make a new translation?
    To make a translation, you will need Microsoft Visual C++ 6 (or Studio).

    Download the translation package and follow the instructions there contained.
    [Back to top]

  5. I downloaded the translation but the game is still in Japanese?
    The translation packages are for the emulator menus and dialogs only. The emulator cannot translate text from the rom being emulated!
    [Back to top]

Joystick support
  1. You don't support joystick xxxx!
    All joysticks supported by DirectInput are supported by VisualBoyAdvance. Some joysticks may behave badly under CPU intense operations, so you may need to change the emulator priority on the menu.

    The Windows version (as of version 0.9) supports 8 axis, 32 buttons and POV/HAT controllers.

    The SDL version supports up to 8 axis, all buttons (as understood by SDL) and HAT/POV.


    [Back to top]

  2. When I try to configure the joypad VBA fills all entries with the same value!
    On version 0.9a, VBA for Windows now supports more axis and HAT controllers. On some joysticks, there is throttle or wheel button which works like an axis. If the button is not centered, VBA will think it is moving and it will use it for the current input being configured.

    Center the wheel or throttle button and the problem should disappear. It only happens when configuring the joypad and has no influence during emuation.

    This will be solved in a future version.
    [Back to top]

Linux or Debian
  1. I have problems running under Debian (or other Linux distribution)
    Unfortunatelly, the SDL libraries for Debian are not correctly built. You are probably getting the message about missing XF86VidModeQueryExtension symbol.

    Here are the options to fix:

    • remove your SDL library from your system, download the sources from www.libsdl.org, compile it correctly and install it
    • try using the SDL_VIDEODRIVER environment variable and choose one of the following options until it works:
      • x11 (this is the default which fails)
      • dga
      • nanox
      • fbcon
      • directfb
      • svgalib
      The complete list can be found at ftp://ptah.lnf.kth.se/pub/misc/sdl-env-vars
    • build a private SDL library and work with LD flags in order to get it working.
    Please note that VisualBoyAdvance only uses the SDL library. If the SDL library is not correctly built for your system, it is not VisualBoyAdvance's fault that it doesn't run.
    [Back to top]

  2. Debian solution
    Get SDL version 1.2.4-1 to have VBA work correctly on Debian systems.
    [Back to top]

SDL
  1. What is SDL?
    SDL stands for Simple DirectMedia Layer. It is a cross platform library for graphics, input, audio, threading, etc... that can be used for games, emulators, etc.

    VisualBoyAdvance has a special version that uses the SDL library and that provides the same behaviour on the different systems it as been ported to.

    To some people, the SDL version on Windows may be faster than the DirectX version.

    The main difference with the Windows version is that it is command line driven, meaning you have to type arguments at the command line in order to run. Configuration is archieved by editing a text file.

    Another big difference is that the SDL version has built-in debugging features (ARM/THUMB debugger, multiple breakpoints, RAM write breakpoints, etc...)

    More debugging features will be available on upcoming versions.


    [Back to top]

  2. Where can I find more about SDL?
    You can visit the official SDL website at www.libsdl.org
    [Back to top]

  3. How do I configure the keys?
    Use the SDL Configurator program that can be found on the downloads page. It will give you the code you need to enter in the configuration file for the pressed key or the joystick button/axis being used.
    [Back to top]

  4. What are the special keys?
    Described in the read me (other than the configurable keys):
    • F1...F10: load save state 1...10
    • Shift+F1...F10: save state 1...10
    • Alt+1...4: auto-fire A,B,L,R
    • Ctrl+R: reset
    • Ctrl+P: pause
    • F11: enter built-in debugger
    • ESC: exit emulator

    [Back to top]

Link
  1. Why don't you add link?
    Link sounds great but it is far more difficult than most people think.

    Often users will mention that Snes9x (or other emulators) have link support, so it shouldn't be hard to add it to the emulator.

    Truth is that SNES (and any other console) are completely different than handhelds. Let's compare:

    • console - a console normally supports multiplayer by nature: you can plug multiple controllers and have several people share the same console and play together. One console, one cartridge, multiple players.
    • handheld - handhelds are designed for single player on a single unit. To achieve multiplayer, a link cable is needed. This allows the different units to communicate and achieve the multiplayer effect. Multiple units linked together, multiple players.
    On the console case, it is easier to add multiplayer because you can just link two instances of the emulator and only send the keys of each player. They don't have any communications feature by nature.

    Handhelds on the other hand have built-in communication features which allow full speed communication between units. This is a lot harder to emulate: it requires a full connection between two emulators which need to be correctly synchronized or nothing works. It is a lot harder to achieve.
    [Back to top]

  2. Will link ever be supported?
    For the time being, I've decided not to add link support. The reason is that link would increase the interest in the emulator by users using illegal copies of software.
    [Back to top]

  3. Why don't you use Kaillera or look at TGB Dual?
    Kaillera is used for machines that support multiple players in one machine, for example normal consoles like Playstation, N64, GameCube, Genesis, etc... It works by connecting the players through the Internet and only exchanging their joypad movements. That makes your computer think there is another person playing with you locally.

    TGB Dual emulates two CPUs to get linking working: one where you actually see the screen and a hidden one used to communicate with the remote player. The data transmitted is in the same way as in Kaillera. Some other steps are taken to transfer save states, etc but it is not a true GB Link cable emulation.

    The GBA Link cable can send data up to 2Mb/s which is really a lot of data and considering how the GBA emulation requires a fast computer, it would require a really fast computer to achieve a decent emulation. It would be possible to take the TGB Dual approach but that would require a really fast computer. For the time being, I will not add link as mentioned a million times.
    [Back to top]

Insight GDB
  1. How do I use VBA with GDB/Insight?
    • Start VisualBoyAdvance with -G in the command line. If you want VBA to load the program, you can pass the file name.
    • Start GDB with the ELF file to be debugged.
    • set breakpoints on functions
    • type command on console: target remote 127.0.0.1:55555 (or another port it was in use)
    • load (if file name not passed to VBA before)
    • start debugging
    • you can break into GDB by pressing F11. It will also break into GDB if an illegal instruction is found
    • you can detach once you are done debugging and the emulator will continue to run and the internal debugger will be activated

    [Back to top]

  2. GDB support
    VisualBoyAdvance now provides GDB remote debugging support. This gives developers the full power of GDB to debug GBA applications.
    In order to use this, you will need a cross-compiled GDB for either the arm-elf or arm-thumb-elf target (used for the --target= option of GDB configure script).
    You can also use GDB frontends like DDD, CodeMedic, etc... or even GDB/Insight for GUI debugger (if using anything other than GDB/Insight, please make sure to point to the right GDB executable).
    The emulator provides two transport protocols for remote debugging:
    • TCP: allows debugging through TCP using port 55555 (or any specified) port. The advantage of using TCP is that it allows true remote debugging but it is slower compared to the pipe method (pipe method does not work on Windows - probably a restriction imposed by the CYGWIN port of GDB).
    • PIPE: allows debugging through a PIPE between the emulator and GDB. This is a lot faster than TCP and recommened on Unix systems.

    [Back to top]

  3. Using the TCP transport
    To use the TCP transport, use the flag -Gtcp[:portnum] where portnum is an optional port number to be used instead of 55555. VBA will wait for a GDB connection on the specified port (printed on screen). Start GDB by passing the .elf file, then connect to the emulator by using the command:
    target remote <hostname>:<port number>
    where hostname is the host where the emulator is running and port number is the printed port number.
    [Back to top]

  4. Using the PIPE transport
    To use the PIPE transport, start GDB with the .elf file to be debugged. Connect to the emulator by using the command:
    target remote |<full path to VBA>/VisualBoyAdvance -Gpipe

    [Back to top]

  5. Debugging with GDB
    Once you connected to the emulator, you can set breakpoints and debug the application. But before doing that, you will need to issue the loda command on GDB to load the code into the emulator. Optionally, you can pass the ELF file on the emulator's command line (along with the -N option to not parse the debug information in the emulator) instead of issuing the load command.

    After connecting and optionally loading the file into the debugger, you can start debugging: add breakpoints, step, etc...

    While using GDB, any console output will show up in GDB's console.

    If you want to break into the GDB, press F11 and it will give you full command in GDB again. Pressing ESC will terminate emulation.

    You can also detach GDB from the emulator and the emulator will continue to run with the internal debugger enabled.

    Note: pressing Run on Insight/GDB will cause GDB to send a kill command to VBA, which will stop emulation. Use the continue button instead after connecting.
    [Back to top]

  6. Console output
    There are three forms of console output in this version:
    • AGBPrint functions: only available for official developers using the Nintendo libraries
    • Mappy style dprint: see Mappy's documentation on how to use
    • VBA style: use the following code to get output:
       // THUMB code
       void print(char *s)
       {
         asm volatile("mov r0, %0;"
                      "swi 0xff;"
                      : // no ouput
                      : "r" (s)
                      : "r0");
       }
       // ARM code
       void print(char *s)
       {
         asm volatile("mov r0, %0;"
                      "swi 0xff0000;"
                      : // no ouput
                      : "r" (s)
                      : "r0");
       }
     
    When using GDB, the output will show up in GDB's console. When using the built-in debugger, output will go to standard out.
    [Back to top]

BIOS Calls
  1. What's the list of BIOS calls?
    SWINameDescription
    0x00SoftResetResets the GBA and runs the code at address 0x2000000 or 0x8000000 depending on the contents of 0x3007ffa (0 means 0x8000000 and anything else means 0x2000000).
    0x01RegisterRamResetPerforms a selective reset of memory and I/O registers.

    Input: R0=reset flags

    0x02HaltHalts CPU execution until an interrupt occurs.
    0x03StopStops the CPU and LCD until the enabled interrupt (keypad, cartridge or serial) occurs.
    0x04IntrWaitWaits for the given interrupt to happen.

    Input: R0=initial flag clear, R1=interrupt to wait

    0x05VBlankIntrWaitWaits for the VBLANK interrupt. Equivalent of calling IntrWait with R0=1 and R1=1.
    0x06DivCalculates the division of R0/R1.

    Input: R0=dividend, R1=divisor

    Result: R0=n/d,R1=n%d,R3=|n/d|

    0x07DivARMSame as Div but with arguments reversed.
    0x08SqrtCalculates the square root of R0.

    Input: R0=number

    Result: R0=sqrt(number)

    0x09ArcTanCalculates the arctangent of R0.

    Input: R0=number (signed 16-bit)

    Result: R0=arctan(number)

    0x0AArcTan2Calculates the arctangent of the given point.

    Input: R0=X (signed 16-bit), R1=Y (signed 16-bit)

    Result: R0=arctan

    0x0BCpuSetCopies memory from source to destination (like DMA).

    Input: R0=source, R1=dest, R2=count and flags

    0x0CCpuFastSetCopies memory from source to destination (like DMA) in 32-bit blocks.

    Input: R0=source, R1=dest, R2=count and flags

    0x0DBiosChecksumCalculates the checksum of the whole BIOS by adding every 32-bit word from the BIOS.

    Result: R0=BIOS checksum

    NOTE: this seems to only be present in the release version of the BIOS

    0x0EBgAffineSetCalculates the affine parameters for the BG.

    Input: R0=source, R1=dest, R2=number of calculations

    0x0FObjAffineSetCalculates the affine parameters for sprites (rotation and scaling).

    Input: R0=source, R1=dest, R2=number of calculations, R3=offset between calculations

    0x10BitUnPackUnpacks bit packed data.

    Input: R0=source, R1=dest, R2=unpack parameters

    0x11LZ77UnCompWramUnpacks data compressed with LZ77 and writes it 8-bits at a time suitable for WRAM decompression.

    Input: R0=source, R1=dest

    0x12LZ77UnCompVramUnpacks data compressed with LZ77 and writes it 16-bits at a time suitable for VRAM decompression.

    Input: R0=source, R1=dest

    0x13HuffUnCompUnpacks data compressed with Huffman and writes it 32-bits at a time.

    Input: R0=source, R1=dest

    0x14RLUnCompWramUnpacks data compressed with RLE and writes it 8-bits at a time suitable for WRAM decompression.

    Input: R0=source, R1=dest

    0x15RLUnCompVramUnpacks data compressed with RLE and writes it 16-bits at a time suitable for VRAM decompression.

    Input: R0=source, R1=dest

    0x16Diff8bitUnFilterWramUnpacks data filtered with 8-bit difference and writes it 8-bits at a time suitable for WRAM decompression.

    Input: R0=source, R1=dest

    0x17Diff8bitUnFilterVramUnpacks data filtered with 8-bit difference and writes it 16-bits at a time suitable for VRAM decompression.

    Input: R0=source, R1=dest

    0x18Diff16bitUnFilterUnpacks data filtered with 16-bit difference and writes it 16-bits at a time.

    Input: R0=source, R1=dest

    0x19SoundBiasSetSets the sound bias from 0 to 0x200 or from 0x200 to 0 depending on the value of R0.

    Input: R0=0 to set it to 0, other values to set it to 0x200

    0x1ASoundDriverInitInitializes the built in sound driver.

    Input: R0=SoundArea

    0x1BSoundDriveModeSets the operation of the built in sound driver.

    Input: R0=operation mode

    0x1CSoundDriveMainMain function of the built in sound driver that is called by applications every VBLANK period to render the sound.

    [Back to top]


Got Top