# gpSP game settings database
# This file is meant to be edited in plain text, with a normal editor.
# game_name, game_code, and vender_code can be found in the game's header.
# All three must match for the game to be used, and those setting must be in
# that order. Be sure to use [!] ROMs (verified by GoodGBA) when building
# this list. Right now I don't know how much overlap there is between
# different region games.

# Find the game identification values by opening the ROM in a hex editor
# and looking at the following locations:

# 0xA0: name, 12 characters
# 0xAC: code, 4 characters
# 0xB0: vender, 2 characters

# Many games should run okay with nothing here, but those that have idle
# loops will run very slowly. To eliminate idle loops you must find a
# branch instruction that will result in a loop until something in the
# hardware changes, like vsync flagging or an interrupt going off. Then
# set "idle_loop_eliminate_target" to the location of that branch
# instruction.

# By default "iwram_stack_optimize" is set to yes, but this breaks some
# games (like Kirby: Nightmare in Dreamland). If a game doesn't work you
# can try setting it to no.

# Everything here is case sensitive. Don't mess with this file unless
# you know what you're doing - if in doubt sooner ask someone who does.

# I mainly focus on USA versions, so try those first. And, just because
# a game is on here doesn't mean the game actually works in the current
# version. :/

# If a game uses 128KB flash ROMs set the option flash_rom_type = 128KB
# for it.

# Castlevania: Circle of the Moon (U)
game_name = DRACULA AGB1
game_code = AAME
vender_code = A4
idle_loop_eliminate_target = 080003d2

# Megaman Battle Network (U)
game_name = MEGAMAN_BN
game_code = AREE
vender_code = 08
idle_loop_eliminate_target = 08000338

# Megaman Battle Network 2 (U)
game_name = MEGAMAN_EXE2
game_code = AE2E
vender_code = 08
idle_loop_eliminate_target = 08000358

# Megaman Battle Network 3 White (U)
game_name = MEGA_EXE3_WH
game_code = A6BE
vender_code = 08
idle_loop_eliminate_target = 0800036c

# Megaman Battle Network 3 Blue (U)
game_name = MEGA_EXE3_BL
game_code = A3XE
vender_code = 08
idle_loop_eliminate_target = 0800036c

# Megaman Battle Network 4 Red Sun (U)
game_name = MEGAMANBN4RS
game_code = B4WE
vender_code = 08
idle_loop_eliminate_target = 080003a6

# Megaman Battle Network 4 Blue Moon (U)
game_name = MEGAMANBN4BM
game_code = B4BE
vender_code = 08
idle_loop_eliminate_target = 080003a6

# Megaman Battle Network 5 Team Protoman (U)
game_name = MEGAMAN5_TP_
game_code = BRBE
vender_code = 08
idle_loop_eliminate_target = 080003ca

# Megaman Battle Network 5 Team Colonel (U)
game_name = MEGAMAN5_TC_
game_code = BRKE
vender_code = 08
idle_loop_eliminate_target = 080003ca

# Megaman Battle Network 6 Cybeast Gregar (U)
game_name = MEGAMAN6_GXX
game_code = BR5E
vender_code = 08
idle_loop_eliminate_target = 080003da

# Megaman Zero (U/E)
game_name = MEGAMAN ZERO
game_code = AZCE
vender_code = 08
idle_loop_eliminate_target = 080004ee

# Megaman Zero 2 (U)
game_name = MEGAMANZERO2
game_code = A62E
vender_code = 08
idle_loop_eliminate_target = 08000664

# Megaman Zero 3 (U)
game_name = MEGAMANZERO3
game_code = BZ3E
vender_code = 08
idle_loop_eliminate_target = 08001a08

# Megaman Zero 4 (U)
game_name = MEGAMANZERO4
game_code = B4ZP
vender_code = 08
idle_loop_eliminate_target = 0800090c

# Kirby: Nightmare in Dreamland (U)
game_name = AGB KIRBY DX
game_code = A7KE
vender_code = 01
idle_loop_eliminate_target = 08000fae
iwram_stack_optimize = no

# Super Mario Advance (U)
game_name = SUPER MARIOA
game_code = AMZE
vender_code = 01
idle_loop_eliminate_target = 08001cf2

# Super Mario Advance 2 (U)
game_name = SUPER MARIOB
game_code = AA2E
vender_code = 01
idle_loop_eliminate_target = 08000534

# Super Mario Advance 3 (U)
game_name = SUPER MARIOC
game_code = A3AE
vender_code = 01
idle_loop_eliminate_target = 08002ba4

# Super Mario Advance 4 (U)
game_name = SUPER MARIOD
game_code = AX4E
vender_code = 01
idle_loop_eliminate_target = 08000732
flash_rom_type = 128KB

# Super Mario Advance 4 (J)
game_name = SUPER MARIOD
game_code = AX4J
vender_code = 01
idle_loop_eliminate_target = 08000732
flash_rom_type = 128KB

# Super Mario Advance 4 (E)
game_name = SUPER MARIOD
game_code = AX4P
vender_code = 01
idle_loop_eliminate_target = 08000732
flash_rom_type = 128KB

# Advance Wars (U)
# This one was really annoying to find, I hope it's okay.. there
# might be a better one somewhere.
game_name = ADVANCEWARS
game_code = AWRE
vender_code = 01
idle_loop_eliminate_target = 0803880a

# Pokemon Emerald (E/U)
# I don't know why this has an idle loop when Ruby doesn't....
game_name = POKEMON EMER
game_code = BPEE
vender_code = 01
idle_loop_eliminate_target = 080008ce
flash_rom_type = 128KB

# Pokemon Emerald (J)
game_name = POKEMON EMER
game_code = BPEJ
vender_code = 01
idle_loop_eliminate_target = 080008ce
flash_rom_type = 128KB

# Pokemon Emerald (G)
game_name = POKEMON EMER
game_code = BPED
vender_code = 01
idle_loop_eliminate_target = 080008ce
flash_rom_type = 128KB

# Pokemon Emerald (F)
game_name = POKEMON EMER
game_code = BPEF
vender_code = 01
idle_loop_eliminate_target = 080008ce
flash_rom_type = 128KB

# Pokemon Emerald (S)
game_name = POKEMON EMER
game_code = BPES
vender_code = 01
idle_loop_eliminate_target = 080008ce
flash_rom_type = 128KB

# Pokemon Emerald (I)
game_name = POKEMON EMER
game_code = BPEI
vender_code = 01
idle_loop_eliminate_target = 080008ce
flash_rom_type = 128KB

# Pokemon Sapphire (U)
game_name = POKEMON SAPP
game_code = AXPE
vender_code = 01
flash_rom_type = 128KB

# Pokemon Sapphire (J)
game_name = POKEMON SAPP
game_code = AXPJ
vender_code = 01
flash_rom_type = 128KB

# Pokemon Sapphire (G)
game_name = POKEMON SAPP
game_code = AXPD
vender_code = 01
flash_rom_type = 128KB

# Pokemon Sapphire (I)
game_name = POKEMON SAPP
game_code = AXPI
vender_code = 01
flash_rom_type = 128KB

# Pokemon Sapphire (S)
game_name = POKEMON SAPP
game_code = AXPS
vender_code = 01
flash_rom_type = 128KB

# Pokemon Sapphire (F)
game_name = POKEMON SAPP
game_code = AXPF
vender_code = 01
flash_rom_type = 128KB

# Pokemon Ruby (U)
game_name = POKEMON RUBY
game_code = AXVE
vender_code = 01
flash_rom_type = 128KB

# Pokemon Ruby (J)
game_name = POKEMON RUBY
game_code = AXVJ
vender_code = 01
flash_rom_type = 128KB

# Pokemon Ruby (G)
game_name = POKEMON RUBY
game_code = AXVD
vender_code = 01
flash_rom_type = 128KB

# Pokemon Ruby (I)
game_name = POKEMON RUBY
game_code = AXVI
vender_code = 01
flash_rom_type = 128KB

# Pokemon Ruby (S)
game_name = POKEMON RUBY
game_code = AXVS
vender_code = 01
flash_rom_type = 128KB

# Pokemon Ruby (F)
game_name = POKEMON RUBY
game_code = AXVF
vender_code = 01
flash_rom_type = 128KB

# V-Rally 3 (E)
game_name = V-RALLY 3
game_code = AVRP
vender_code = 70
idle_loop_eliminate_target = 080aa920

# Mario Vs Donkey Kong (U)
game_name = MARIOVSDK
game_code = BM5E
vender_code = 01
idle_loop_eliminate_target = 08033eec

# Pokemon: Sapphire (U)
game_name = POKEMON SAPP
game_code = AXPE
vender_code = 01
flash_rom_type = 128KB

# Pokemon: Sapphire (G)
game_name = POKEMON SAPP
game_code = AXPD
vender_code = 01
flash_rom_type = 128KB

# Pokemon: Fire Red (J)
game_name = POKEMON FIRE
game_code = BPRJ
vender_code = 01
idle_loop_eliminate_target = 080008b2
# If you have the European version try this instead.
#idle_loop_eliminate_target = 080008c6
flash_rom_type = 128KB

# Pokemon: Fire Red (E/U)
game_name = POKEMON FIRE
game_code = BPRE
vender_code = 01
idle_loop_eliminate_target = 080008c6
flash_rom_type = 128KB

# Pokemon: Fire Red (S)
game_name = POKEMON FIRE
game_code = BPRS
vender_code = 01
idle_loop_eliminate_target = 080008c6
flash_rom_type = 128KB

# Pokemon: Fire Red (G)
game_name = POKEMON FIRE
game_code = BPRD
vender_code = 01
idle_loop_eliminate_target = 080008c6
flash_rom_type = 128KB

# Pokemon: Fire Red (I)
game_name = POKEMON FIRE
game_code = BPRI
vender_code = 01
idle_loop_eliminate_target = 080008c6
flash_rom_type = 128KB

# Pokemon: Fire Red (F)
game_name = POKEMON FIRE
game_code = BPRE
vender_code = 01
idle_loop_eliminate_target = 080008c6
flash_rom_type = 128KB

# Pokemon: Leaf Green (E/U)
# Hey, this one is the same as Fire Red, who'd have thought? :B
game_name = POKEMON LEAF
game_code = BPGE
vender_code = 01
idle_loop_eliminate_target = 080008b2
flash_rom_type = 128KB

# Pokemon: Leaf Green (S)
game_name = POKEMON LEAF
game_code = BPGS
vender_code = 01
idle_loop_eliminate_target = 080008b6
flash_rom_type = 128KB

# Pokemon: Leaf Green (G)
game_name = POKEMON LEAF
game_code = BPGD
vender_code = 01
idle_loop_eliminate_target = 080008b6
flash_rom_type = 128KB

# Pokemon: Leaf Green (I)
game_name = POKEMON LEAF
game_code = BPGI
vender_code = 01
idle_loop_eliminate_target = 080008b6
flash_rom_type = 128KB

# Pokemon: Leaf Green (F)
game_name = POKEMON LEAF
game_code = BPGF
vender_code = 01
idle_loop_eliminate_target = 080008b6
flash_rom_type = 128KB

# Pokemon: Fushigi no Dungeon Aka no Kyuujotai (J)
game_name = POKE DUNGEON
game_code = B24J
vender_code = 01
flash_rom_type = 128KB

# Pokemon: Red Rescue Team (E/U)
game_name = POKE DUNGEON
game_code = B24E
vender_code = 01
flash_rom_type = 128KB

# F-Zero: Climax (J)
game_name = F-ZEROCLIMAX
game_code = BFTJ
vender_code = 01
flash_rom_type = 128KB

# Final Fantasy Tactics Advance (U)
game_name = FFTA_USVER.
game_code = AFXE
vender_code = 01
idle_loop_eliminate_target = 0800041e

# Gradius Galaxies (U)
# Badly coded game with several idle loops. This one works for level
# one at least.
game_name = GRADIUSGALAX
game_code = AGAE
vender_code = A4
idle_loop_eliminate_target = 08013844

# Rebelstar: Tactical Command (U)
# Badly coded game with several idle loops. I don't think any are
# even close to dominant, and it jumps around too much when things
# matter....
game_name = REBELSTAR
game_code = BRLE
vender_code = AF
idle_loop_eliminate_target = 0800041a

# Golden Sun
game_name = Golden_Sun_A
game_code = AGSE
vender_code = 01
translation_gate_target = 03000820
translation_gate_target = 030009ac

# Golden Sun: The Lost Age (U)
# Probably the most horrifically coded GBA game in existence.
game_name = GOLDEN_SUN_B
game_code = AGFE
vender_code = 01
idle_loop_eliminate_target = 08013542
translation_gate_target = 030009ac
translation_gate_target = 03007d70

# Mario & Luigi: Superstar Saga (U)
# Attempted fix. Works on x86 version, not on PSP one (but gets a
# little further...)
game_name = MARIO&LUIGIU
game_code = A88E
vender_code = 01
#idle_loop_eliminate_target = 0801da90
#0801db42

# Mario Party Advance (U)
game_name = MARIOPARTYUS
game_code = B8ME
vender_code = 01
iwram_stack_optimize = no

# Mario Golf: Advance Tour (U)
game_name = MARIOGOLFGBA
game_code = BMGE
vender_code = 01
iwram_stack_optimize = no
idle_loop_eliminate_target = 08014e0a
translation_gate_target = 03000d00
translation_gate_target = 03000a30

# Tales of Phantasia (U)
game_name = PHANTASIA
game_code = AN8E
vender_code = 01
iwram_stack_optimize = no

# Advance Wars 2: Black Hole Rising (U)
game_name = ADVANCEWARS2
game_code = AW2E
vender_code = 01
idle_loop_eliminate_target = 08036e2a

# Bomberman Tournament (U)
game_name = BOMSTORYUSA
game_code = ABSE
vender_code = 52
idle_loop_eliminate_target = 08000526

# Broken Sword - The Shadow of the Templars (U)
game_name = BROKENSWORD
game_code = ABJE
vender_code = 6L
idle_loop_eliminate_target = 08000a26

# Defender of The Crown (U)
game_name = DOTC
game_code = ADHE
vender_code = 5N
idle_loop_eliminate_target = 080007ec

# Drill Dozer (U)
game_name = DRILL DOZER
game_code = V49E
vender_code = 01
idle_loop_eliminate_target = 080006c2

# F-Zero - Maximum Velocity (U)
game_name = F-ZERO ADVAN
game_code = AFZE
vender_code = 01
idle_loop_eliminate_target = 08000c2e

# Megaman Zero 2 (U)
game_name = MEGAMANZERO2
game_code = A62E
vender_code = 08
idle_loop_eliminate_target = 08000664

# Megaman Zero 3 (U)
game_name = MEGAMANZERO3
game_code = BZ3E
vender_code = 08
idle_loop_eliminate_target = 08001a08

# Megaman Zero 4 (U)
game_name = MEGAMANZERO4
game_code = B4ZE
vender_code = 08
idle_loop_eliminate_target = 0800090c

# Metal Slug Advance (U)
game_name = METAL SLUG
game_code = BSME
vender_code = B7
idle_loop_eliminate_target = 08000298

# Magical Quest 2 Starring Mickey & Minnie (U)
game_name = M&M MAGICAL2
game_code = AQME
vender_code = 08
idle_loop_eliminate_target = 0801d340

# Magical Quest 3 Starring Mickey & Donald (U)
game_name = M&D MAGICAL3
game_code = BMQE
vender_code = 08
idle_loop_eliminate_target = 08016064

# Pinball Challenge Deluxe (E)
game_name = PINBALL CHAL
game_code = APLP
vender_code = 41
idle_loop_eliminate_target = 080075a6

# Prince of Persia - The Sands of Time (U)
game_name = PRINCEPERSIA
game_code = BPYE
vender_code = 41
idle_loop_eliminate_target = 0808ff3a

# Rhythm Tengoku (J)
game_name = RHYTHMTENGOK
game_code = BRIJ
vender_code = 01
idle_loop_eliminate_target = 080013d4

# River City Ransom EX (U)
game_name = RIVERCRANSOM
game_code = BDTE
vender_code = EB
idle_loop_eliminate_target = 0800065a

# Super Puzzle Fighter II Turbo (U)
game_name = PUZZLEFIGHT2
game_code = AZ8E
vender_code = 08
idle_loop_eliminate_target = 08002b5e

# Yu-Gi-Oh! - Dungeon Dice Monsters (U)
game_name = YU-GI-OH DDM
game_code = AYDE
vender_code = A4
idle_loop_eliminate_target = 0802cc6a

# Yu-Gi-Oh! - The Eternal Duelist Soul (U)
game_name = YU-GI-OH!EDS
game_code = AY5E
vender_code = A4
idle_loop_eliminate_target = 08075d96

# Yu-Gi-Oh! - The Sacred Cards (U)
game_name = YUGIOH DM7
game_code = AY7E
vender_code = A4
idle_loop_eliminate_target = 08003bd6

# Yu-Gi-Oh! - World Championship Tournament 2004 (U)
game_name = YWCT2004USA
game_code = BYWE
vender_code = A4
idle_loop_eliminate_target = 080831da

# Yu-Gi-Oh! - Worldwide Edition - Stairway to the Destined Duel (U)
game_name = YUGIOHWWE
game_code = AYWE
vender_code = A4
idle_loop_eliminate_target = 08089792

# Wario Ware, Inc. Mega Microgames (U)
game_name = WARIOWAREINC
game_code = AZWE
vender_code = 01
idle_loop_eliminate_target = 08000f66

# Tom Clancy's Splinter Cell (U)
game_name = SPLINTERCELL
game_code = AO4E
vender_code = 41
idle_loop_eliminate_target = 0807a0c4

# Tom Clancy's Splinter Cell - Pandora Tomorrow (U)
game_name = TOM CLANCY'S
game_code = BSLE
vender_code = 41
idle_loop_eliminate_target = 0807785e

# Final Fantasy IV Advance (U)
game_name = FF4ADVANCE
game_code = BZ4E
vender_code = 01
idle_loop_eliminate_target = 0800fabe
# or try 00000430

# Digimon Battle Spirit (U)
game_name = DIGIMON BTSP
game_code = A8SE
vender_code = B2
idle_loop_eliminate_target = 08011208

# Digimon Battle Spirit 2 (U)
game_name = DIGIMON BS2
game_code = BDSE
vender_code = B2
idle_loop_eliminate_target = 08010eb0

# Donald Duck Advance (U)
game_name = DISNEY'S DON
game_code = ADKE
vender_code = 41
idle_loop_eliminate_target = 08002f30

# Final Fight One (U)
game_name = FINAL FIGHT
game_code = AFFE
vender_code = 08
idle_loop_eliminate_target = 0800b428

# Megaman Battle Chip Challenge (U)
game_name = BATTLECHIPGP
game_code = A89E
vender_code = 08
idle_loop_eliminate_target = 08000544

# Monster Force (U)
game_name = MONSTERFORCE
game_code = AM8E
vender_code = 7D
idle_loop_eliminate_target = 08000b00

# Monster Rancher Advance (U)
game_name = MONSRANCHERA
game_code = AMFE
vender_code = 9B
idle_loop_eliminate_target = 0809f394

# Monster Rancher Advance 2 (U)
game_name = MONSTERRANC2
game_code = A2QE
vender_code = 9B
idle_loop_eliminate_target = 081c7290

# The Pinball of The Dead
game_name = PINBALL DEAD
game_code = APDE
vender_code = 78
idle_loop_eliminate_target = 08000300

# Tringo (U)
game_name = TRINGO
game_code = BTJE
vender_code = 4Z
idle_loop_eliminate_target = 080009a4

# Virtual Kasparov (U)
game_name = VIRTKASPAROV
game_code = AVKE
vender_code = 60
idle_loop_eliminate_target = 0800093a

# Advance Wars 2 - Black Hole Rising (E)
game_name = ADVANCEWARS2
game_code = AW2P
vender_code = 01
idle_loop_eliminate_target = 080371be

# Bookworm (U)
game_name = BOOKWORM
game_code = BKWE
vender_code = 5G
idle_loop_eliminate_target = 0800397c

# 007 - Nightfire (U)
game_name = NIGHTFIRE
game_code = A7OE
vender_code = 69
idle_loop_eliminate_target = 080031d6
