diff --git a/CMakeLists.txt b/CMakeLists.txt index bda10120..32714587 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -372,6 +372,7 @@ IF( ENABLE_GTK ) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/gtk/gvbam.desktop DESTINATION share/applications) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/gtk/icons/ DESTINATION share/icons/hicolor PATTERN ".svn" EXCLUDE) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/gtk/ui DESTINATION ${DATA_INSTALL_DIR} PATTERN ".svn" EXCLUDE) + INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/vba-over.ini DESTINATION ${DATA_INSTALL_DIR}) # Native Language Support if( ENABLE_NLS ) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index c83f12dd..04abfc8e 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -898,6 +899,51 @@ void Window::vApplyConfigShowSpeed() vSetDefaultTitle(); } +void Window::vApplyPerGameConfig() +{ + std::string sRDBFile = PKGDATADIR "/vba-over.ini"; + if (!Glib::file_test(sRDBFile, Glib::FILE_TEST_EXISTS)) + return; + + char csGameID[5]; + csGameID[0] = rom[0xac]; + csGameID[1] = rom[0xad]; + csGameID[2] = rom[0xae]; + csGameID[3] = rom[0xaf]; + csGameID[4] = '\0'; + + Glib::KeyFile oKeyFile; + oKeyFile.load_from_file(sRDBFile); + + if (!oKeyFile.has_group(csGameID)) + return; + + if (oKeyFile.has_key(csGameID, "rtcEnabled")) + { + bool bRTCEnabled = oKeyFile.get_boolean(csGameID, "rtcEnabled"); + rtcEnable(bRTCEnabled); + } + + if (oKeyFile.has_key(csGameID, "flashSize")) + { + int iFlashSize = oKeyFile.get_integer(csGameID, "flashSize"); + if (iFlashSize == 0x10000 || iFlashSize == 0x20000) + flashSetSize(iFlashSize); + } + + if (oKeyFile.has_key(csGameID, "saveType")) + { + int iSaveType = oKeyFile.get_integer(csGameID, "saveType"); + if(iSaveType >= 0 && iSaveType <= 5) + cpuSaveType = iSaveType; + } + + if (oKeyFile.has_key(csGameID, "mirroringEnabled")) + { + mirroringEnable = oKeyFile.get_boolean(csGameID, "mirroringEnabled"); + } +} + void Window::vSaveJoypadsToConfig() { for (int i = m_iJoypadMin; i <= m_iJoypadMax; i++) @@ -1011,6 +1057,8 @@ bool Window::bLoadROM(const std::string & _rsFile) m_eCartridge = CartridgeGBA; m_stEmulator = GBASystem; + vApplyPerGameConfig(); + useBios = m_poCoreConfig->oGetKey("use_bios_file"); CPUInit(m_poCoreConfig->sGetKey("bios_file").c_str(), useBios); CPUReset(); @@ -1020,8 +1068,6 @@ bool Window::bLoadROM(const std::string & _rsFile) { m_poCoreConfig->vSetKey("bios_file", ""); } - - rtcEnable(m_poCoreConfig->oGetKey("enable_rtc")); } } diff --git a/src/gtk/window.h b/src/gtk/window.h index c6a7d4c8..09f83d7c 100644 --- a/src/gtk/window.h +++ b/src/gtk/window.h @@ -109,6 +109,7 @@ public: void vApplyConfigGBARTC(); void vApplyConfigFrameskip(); void vApplyConfigShowSpeed(); + void vApplyPerGameConfig(); void vUpdateScreen(); inline ECartridge eGetCartridge() const { return m_eCartridge; } diff --git a/src/vba-over.ini b/src/vba-over.ini new file mode 100644 index 00000000..0af368fa --- /dev/null +++ b/src/vba-over.ini @@ -0,0 +1,499 @@ +# http://ngemu.com/ +# July 2008 + +# ------------------- +# (Int) International / MultiLingual +# ------------------- + + +# Dragon Ball Z - The Legacy of Goku II (Europe)(En,Fr,De,Es,It) +[ALFP] +saveType=1 + +# Dragon Ball Z - The Legacy of Goku (Europe)(En,Fr,De,Es,It) +[ALGP] +saveType=1 + +# Rocky (Europe)(En,Fr,De,Es,It) +[AROP] +saveType=1 + +# Rocky (USA)(En,Fr,De,Es,It) +[AR8e] +saveType=1 + +# Pokemon - Ruby Version (USA, Europe) +[AXVE] +rtcEnabled=1 +flashSize=131072 + +# Pokemon - Sapphire Version (USA, Europe) +[AXPE] +rtcEnabled=1 +flashSize=131072 + +# Super Mario Advance 4 - Super Mario Bros. 3 (Europe)(En,Fr,De,Es,It) +[AX4P] +flashSize=131072 + +# Top Gun - Combat Zones (USA)(En,Fr,De,Es,It) +[A2YE] +saveType=5 + +# Dragon Ball Z - Taiketsu (Europe)(En,Fr,De,Es,It) +[BDBP] +saveType=1 + +# Mario vs. Donkey Kong (Europe) +[BM5P] +saveType=3 + +# Pokemon - Emerald Version (USA, Europe) +[BPEE] +rtcEnabled=1 + +# Yu-Gi-Oh! - Ultimate Masters - World Championship Tournament 2006 (Europe)(En,Jp,Fr,De,Es,It) +[BY6P] +saveType=2 + +# Pokemon Mystery Dungeon - Red Rescue Team (USA, Australia) +[B24E] +flashSize=131072 + +# Classic NES Series - Castlevania (USA, Europe) +[FADE] +saveType=1 +mirroringEnabled=1 + +# Classic NES Series - Bomberman (USA, Europe) +[FBME] +saveType=1 +mirroringEnabled=1 + +# Classic NES Series - Donkey Kong (USA, Europe) +[FDKE] +saveType=1 +mirroringEnabled=1 + +# Classic NES Series - Dr. Mario (USA, Europe) +[FDME] +saveType=1 +mirroringEnabled=1 + +# Classic NES Series - Excitebike (USA, Europe) +[FEBE] +saveType=1 +mirroringEnabled=1 + +# Classic NES Series - Ice Climber (USA, Europe) +[FICE] +saveType=1 +mirroringEnabled=1 + +# Classic NES Series - Zelda II - The Adventure of Link (USA, Europe) +[FLBE] +saveType=1 +mirroringEnabled=1 + +# Classic NES Series - Metroid (USA, Europe) +[FMRE] +saveType=1 +mirroringEnabled=1 + +# Classic NES Series - Pac-Man (USA, Europe) +[FP7E] +saveType=1 +mirroringEnabled=1 + +# Classic NES Series - Super Mario Bros. (USA, Europe) +[FSME] +saveType=1 +mirroringEnabled=1 + +# Classic NES Series - Xevious (USA, Europe) +[FXVE] +saveType=1 +mirroringEnabled=1 + +# Classic NES Series - Legend of Zelda (USA, Europe) +[FZLE] +saveType=1 +mirroringEnabled=1 + +# Yoshi's Universal Gravitation (Europe)(En,Fr,De,Es,It) +[KYGP] +saveType=4 + +# Boktai - The Sun Is in Your Hand (Europe)(En,Fr,De,Es,It) +[U3IP] +rtcEnabled=1 + +# Boktai 2 - Solar Boy Django (Europe)(En,Fr,De,Es,It) +[U32P] +rtcEnabled=1 + + +# -------------------- +# (U) USA +# -------------------- + +# Golden Sun - The Lost Age (USA) +[AGFE] +rtcEnabled=1 +flashSize=0x10000 + +# Golden Sun (USA) +[AGSE] +rtcEnabled=1 +flashSize=0x10000 + +# Dragon Ball Z - The Legacy of Goku II (USA) +[ALFE] +saveType=1 + +# Dragon Ball Z - The Legacy of Goku (USA) +[ALGE] +saveType=1 +flashSize=131072 + +# Super Mario Advance 4 - Super Mario Bros 3 - Super Mario Advance 4 v1.1 (USA) +[AX4E] +flashSize=131072 + +# Dragon Ball Z - Taiketsu (USA) +[BDBE] +saveType=1 + +# Dragon Ball Z - Buu's Fury (USA) +[BG3E] +saveType=1 + +# 2 Games in 1 - Dragon Ball Z - The Legacy of Goku I & II (USA) +[BLFE] +saveType=1 + +# Pokemon - Fire Red Version (USA, Europe) +[BPRE] +flashSize=131072 + +# Pokemon - Leaf Green Version (USA, Europe) +[BPGE] +flashSize=131072 + +# Dragon Ball GT - Transformation (USA) +[BT4E] +saveType=1 + +# 2 Games in 1 - Dragon Ball Z - Buu's Fury + Dragon Ball GT - Transformation (USA) +[BUFE] +saveType=1 + +# Yu-Gi-Oh! GX - Duel Academy (USA) +[BYGE] +saveType=2 +useBios=1 + +# Yoshi - Topsy-Turvy (USA) +[KYGE] +saveType=1 + +# e-Reader (USA) +[PSAE] +flashSize=131072 + +# Boktai - The Sun Is in Your Hand (USA) +[U3IE] +rtcEnabled=1 + +# Boktai 2 - Solar Boy Django (USA) +[U32E] +rtcEnabled=1 + +# -------------------- +# (J) Japan +# -------------------- + +# Dragon Ball Z - The Legacy of Goku II International (Japan) +[ALFJ] +saveType=1 + +# Pocket Monsters - Sapphire (Japan) +[AXPJ] +rtcEnabled=1 +flashSize=131072 + +# Pocket Monsters - Ruby (Japan) +[AXVJ] +rtcEnabled=1 +flashSize=131072 + +# Super Mario Advance 4 (Japan) +[AX4J] +flashSize=131072 + +# F-Zero - Climax (Japan) +[BFTJ] +flashSize=131072 + +# Game Boy Wars Advance 1+2 (Japan) +[BGWJ] +flashSize=131072 + +# Sennen Kazoku (Japan) +[BKAJ] +rtcEnabled=1 +flashSize=131072 + +# Pocket Monsters - Emerald (Japan) +[BPEJ] +rtcEnabled=1 +flashSize=131072 + +# Pocket Monsters - Leaf Green (Japan) +[BPGJ] +flashSize=131072 + +# Pocket Monsters - Fire Red (Japan) +[BPRJ] +flashSize=131072 + +# Digi Communication 2 - Datou! Black Gemagema Dan (Japan) +[BDKJ] +saveType=1 + +# Rockman EXE 4.5 - Real Operation (Japan) +[BR4J] +rtcEnabled=1 + +# Famicom Mini Vol. 01 - Super Mario Bros. (Japan) +[FMBJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 12 - Clu Clu Land (Japan) +[FCLJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 13 - Balloon Fight (Japan) +[FBFJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 14 - Wrecking Crew (Japan) +[FWCJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 15 - Dr. Mario (Japan) +[FDMJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 16 - Dig Dug (Japan) +[FDDJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 17 - Takahashi Meijin no Boukenjima (Japan) +[FTBJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 18 - Makaimura (Japan) +[FMKJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 19 - Twin Bee (Japan) +[FTWJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 20 - Ganbare Goemon! Karakuri Douchuu (Japan) +[FGGJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 21 - Super Mario Bros. 2 (Japan) +[FM2J] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 22 - Nazo no Murasame Jou (Japan) +[FNMJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 23 - Metroid (Japan) +[FMRJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 24 - Hikari Shinwa - Palthena no Kagami (Japan) +[FPTJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 25 - The Legend of Zelda 2 - Link no Bouken (Japan) +[FLBJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 26 - Famicom Mukashi Banashi - Shin Onigashima - Zen Kou Hen (Japan) +[FFMJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 27 - Famicom Tantei Club - Kieta Koukeisha - Zen Kou Hen (Japan) +[FTKJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 28 - Famicom Tantei Club Part II - Ushiro ni Tatsu Shoujo - Zen Kou Hen (Japan) +[FTUJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 29 - Akumajou Dracula (Japan) +[FADJ] +saveType=1 +mirroringEnabled=1 + +# Famicom Mini Vol. 30 - SD Gundam World - Gachapon Senshi Scramble Wars (Japan) +[FSDJ] +saveType=1 +mirroringEnabled=1 + +# Koro Koro Puzzle - Happy Panechu! (Japan) +[KHPJ] +saveType=4 + +# Yoshi no Banyuuinryoku (Japan) +[KYGJ] +saveType=4 + +# Card e-Reader+ (Japan) +[PSAJ] +flashSize=131072 + +# Bokura no Taiyou - Taiyou Action RPG (Japan) +[U3IJ] +rtcEnabled=1 + +# Zoku Bokura no Taiyou - Taiyou Shounen Django (Japan) +[U32J] +rtcEnabled=1 + +# Shin Bokura no Taiyou - Gyakushuu no Sabata (Japan) +[U33J] +rtcEnabled=1 + +# -------------------- +# (F) France +# -------------------- + +# Pokemon - Version Saphir (France) +[AXPF] +rtcEnabled=1 +flashSize=131072 + +# Pokemon - Version Rubis (France) +[AXVF] +rtcEnabled=1 +flashSize=131072 + +# Pokemon - Version Emeraude (France) +[BPEF] +rtcEnabled=1 +flashSize=131072 + +# Pokemon - Version Vert Feuille (France) +[BPGF] +flashSize=131072 + +# Pokemon - Version Rouge Feu (France) +[BPRF] +flashSize=131072 + +# -------------------- +# (I) Italy +# -------------------- + +# Pokemon - Versione Zaffiro (Italy) +[AXPI] +rtcEnabled=1 +flashSize=131072 + +# Pokemon - Versione Rubino (Italy) +[AXVI] +rtcEnabled=1 +flashSize=131072 + +# Pokemon - Versione Smeraldo (Italy) +[BPEI] +rtcEnabled=1 +flashSize=131072 + +# Pokemon - Versione Verde Foglia (Italy) +[BPGI] +flashSize=131072 + +# Pokemon - Versione Rosso Fuoco (Italy) +[BPRI] +flashSize=131072 + +# -------------------- +# (G) Germany +# -------------------- + +# Pokemon - Saphir-Edition (Germany) +[AXPD] +rtcEnabled=1 +flashSize=131072 + +# Pokemon - Rubin-Edition (Germany) +[AXVD] +rtcEnabled=1 +flashSize=131072 + +# Pokemon - Smaragd-Edition (Germany) +[BPED] +rtcEnabled=1 +flashSize=131072 + +# Pokemon - Blattgruene Edition (Germany) +[BPGD] +flashSize=131072 + +# Pokemon - Feuerrote Edition (Germany) +[BPRD] +flashSize=131072 + +# -------------------- +# (S) Spain +# -------------------- + +# Pokemon - Edicion Zafiro (Spain) +[AXPS] +rtcEnabled=1 +flashSize=131072 + +# Pokemon - Edicion Rubi (Spain) +[AXVS] +rtcEnabled=1 +flashSize=131072 + +# Pokemon - Edicion Esmeralda (Spain) +[BPES] +rtcEnabled=1 +flashSize=131072 + +# Pokemon - Edicion Verde Hoja (Spain) +[BPGS] +flashSize=131072 + +# Pokemon - Edicion Rojo Fuego (Spain) +[BPRS] +flashSize=131072 +saveType=1