profi200 / open_agb_firm

open_agb_firm is a bare metal app for running GBA homebrew/games using the 3DS builtin GBA hardware.
GNU General Public License v3.0
922 stars 45 forks source link

Save detection #1

Closed ghost closed 4 years ago

ghost commented 4 years ago

Save type hardcoded to 32 KiB (256k) SRAM. Unknown how save type detection will be done.

Why not use a native_firm application to select a rom and write the path (to rom and save) and the save type to "open_agb_firm.ini"? Then trigger a reboot to open_agb_firm and it loads the ini file. I figure in native_firm there's more room to work with. You might even be able to write the config to ram since it isn't cleared on a reboot.

profi200 commented 4 years ago

Unless that data is not needed i'm afraid no. You could ask the autor of the ROM hack to try and cut the size down.

Games >32 MiB use a special mapper that is not supported by the cart emu: https://mgba.io/2015/10/20/dumping-the-undumped/

profi200 commented 4 years ago

The BIOS animation and save type settings have been moved here: https://github.com/profi200/open_agb_firm/blob/master/source/arm11/main.c#L40

Save size is now automatically calculated based on save type.

Dartz150 commented 4 years ago

Mmm.. I'm trying to build the latest comit but I'm getting this error, it didn't happen before:

make[2]: dma330as: No such file or directory make[2]: *** [/c/open_agb_firm/arm11/Makefile:178: lgyfb_dma330.h] Error 127 make[1]: *** [Makefile:117: all] Error 2 make: *** [Makefile:60: release] Error 2

profi200 commented 4 years ago

I didn't change anything related to makefiles. This tool must be somewhere in your path. Recommended way is to create some folder where you throw in all unofficial tools and add that to your path environment variable.

profi200 commented 4 years ago

Filesystem access has been reimplemented for ARM11 which i wanted to get done before i implement save type detection.

I will see if i can get the later working in the next days (it will be the inaccurate save type detection for now).

Kirit29 commented 4 years ago

Do you mind sending me a build @profi200 with bios enabled to test

profi200 commented 4 years ago

Thought you can build this yourself now? Anyway.

[removed build]

profi200 commented 4 years ago

I need testers. The EEPROM save types are still mostly untested. Everything without the "Confirmed" comment needs testing. Unfortunately i don't know which games use these types:

https://github.com/profi200/open_agb_firm/blob/master/source/arm11/hardware/lgy.c#L104-L110

A test build from latest commit without BIOS animation to speed up testing: [removed build]

Dartz150 commented 4 years ago

Great, I'll update this post with the tested save types, addind a "Working" comment at the end and the games tested with them, I will make a new post when finished.

{"EEPROM_V111", SAVE_TYPE_EEPROM_8k}, // Working
// -Super Mario Advance (Japan)

{"EEPROM_V120", SAVE_TYPE_EEPROM_64k}, // Not Working
// -Super Mario Advance / "The saved data is corrupt" message
// -Doom / Game can't save
// -Doom II / Game can't save

{"EEPROM_V121", SAVE_TYPE_EEPROM_64k}, // Working
// -Street Fighter II Revival (Europe)
// -Bomberman Max 2 - Blue Advance

{"EEPROM_V122", SAVE_TYPE_EEPROM_64k}, // Working?
// -Dexter's Laboratory - Deesaster Strikes! / Can't save
// -Medabots AX - Metabee Version / Can't save
// -Super Mario Advance 2 : Super Mario World + Mario Brothers (Japan) / Works

{"EEPROM_V124", SAVE_TYPE_EEPROM_64k}, // Working
// -Famicom Collection - Super Mario Bros 2 (JAPAN)
// -Classic Nes Series - Castlevania (Europe)

{"EEPROM_V125", SAVE_TYPE_EEPROM_64k}, // Not working
// -2 Games in 1 - Spider-Man + Spider-Man 2 / Detected correctly, white screen 
//  at startup. Note: This is the only single game in the entire GBA library that uses this save type ID.

{"EEPROM_V126", SAVE_TYPE_EEPROM_64k}, // Not Working
// - Harry Potter and the Goblet of Fire (USA) / Detected correctly, black screen.
// - Yggdra Union : We'll Never Fight Alone (USA) / Detected correctly, Half of the screen and 
// some scenes are black, crashes with screech sounds after some intro music.

// FLASH
// Assume they all have RTC.
{"FLASH_V120",    SAVE_TYPE_FLASH_512k_PSC_RTC}, // Working
// -Yu-Gi-Oh! Dungeon Dice Monsters (Japan)

{"FLASH_V121",    SAVE_TYPE_FLASH_512k_PSC_RTC}, // Working
// - Advance Wars (USA)
// - Chu Chu Rocket! (USA)
// - Dragon Quest Characters (Japan)

{"FLASH_V123",    SAVE_TYPE_FLASH_512k_PSC_RTC}, // Working
// - Golden Sun (USA)
// - Golden Sun: The Lost Age (USA)

{"FLASH_V124",    SAVE_TYPE_FLASH_512k_PSC_RTC}, // Working
// - Mario Kart: Super Circuit (USA)
// - Guilty Gear X - Advance Edition (Japan)

{"FLASH_V125",    SAVE_TYPE_FLASH_512k_PSC_RTC}, // Working
// - Super Robot Taisen A (Japan)
// - Nobunaga no Yabou (Japan)

{"FLASH_V126",    SAVE_TYPE_FLASH_512k_PSC_RTC}, // Working
// - Magical Vacation (Japan)
// - Sonic Advance (Japan)

{"FLASH512_V130", SAVE_TYPE_FLASH_512k_PSC_RTC}, // Working
// - Sonic Advance 2 (USA)
// - Shining Soul (Europe)
// - Final Fantasy Tactics Advance (USA)

{"FLASH512_V131", SAVE_TYPE_FLASH_512k_PSC_RTC}, // Working
// - Sword of Mana
// - Shining Soul (USA)
// - Sonic Pinball Party (USA)

{"FLASH512_V133", SAVE_TYPE_FLASH_512k_PSC_RTC}, // Working
// - 2 Games in 1 : Sonic Advance + Sonic Pinball Party (Europe)

{"FLASH1M_V102",  SAVE_TYPE_FLASH_1m_MRX_RTC}, // Working
// - Super Mario Advance 4 - Super Mario Bros. 3
// - Pokemon Mystery Dungeon - Red Rescue Team

{"FLASH1M_V103",  SAVE_TYPE_FLASH_1m_MRX_RTC}, // Working
// - Pokemon - Edicion Esmeralda (Spanish)
// - Pokemon - Edicion Zafiro (Spanish)
// - Pokemon - Edicion Ruby (Spanish)
// - Pokemon - Rojo Fuego (Spanish)
// - Pokemon - Emerald Version (USA)
// - Pokemon - Sapphire Version (USA)
// - Pokemon - Ruby Version (USA)
// - Pokemon - Fire Red Version (USA)

// FRAM & SRAM
{"SRAM_F_V100", SAVE_TYPE_SRAM_256k}, // Working
// - Mr. Driller 2 (Japan)
// - Tanbi Musou - Meine Liebe (Japan)

{"SRAM_F_V102", SAVE_TYPE_SRAM_256k}, // Working
// - Castlevania - Aria of Sorrow (Europe)
// - Castlevania - Harmony of Dissonance (Europe)

{"SRAM_F_V103", SAVE_TYPE_SRAM_256k}, // Working
// - Hamtaro : Ham-Ham Heartbreak (USA)
// - Shin Megami Tensei Devil Children - Koori no Sho (Japan)

{"SRAM_V110",   SAVE_TYPE_SRAM_256k}, // Working
// - F-Zero (Japan)
// - Akumajou Dracula - Circle of the Moon (Japan)
// - Castlevania - Circle of the Moon (Europe)
// - Jisu F-Zero Weilai Saiche (iQUE)(CHN)

{"SRAM_V111",   SAVE_TYPE_SRAM_256k}, // Working
// - F-Zero - Maximum Velocity (USA)
// - Kurukuru Kururin (Europe)
// - Breath of Fire (Europe)

{"SRAM_V112",   SAVE_TYPE_SRAM_256k}, // Working
// - Megaman Zero (USA)
// - Metroid Fusion (USA)
// - Kirby - Nightmare in Dream Land (USA)
// - WarioWare, Inc. - Mega Microgame$! (USA)

{"SRAM_V113",   SAVE_TYPE_SRAM_256k} // Working
// - Metroid Zero Mission (USA)
// - Megaman Zero 2 (USA)
// - Yu-Gi-Oh! World Championship Tournament 2004 (USA)
// - Megaman - Battle Chip Challenge (USA)
Dartz150 commented 4 years ago

@profi200 I just have completed several tests with every save type, and so far it seems that the only conflicting save types are:

{"EEPROM_V120", SAVE_TYPE_EEPROM_64k}, // Not Working
// -Super Mario Advance / "The saved data is corrupt" message
// -Doom / Game can't save
// -Doom II / Game can't save

{"EEPROM_V122", SAVE_TYPE_EEPROM_64k}, // Working?
// -Dexter's Laboratory - Deesaster Strikes! / Can't save
// -Medabots AX - Metabee Version / Can't save
// -Super Mario Advance 2 : Super Mario World + Mario Brothers (Japan) / Works

{"EEPROM_V125", SAVE_TYPE_EEPROM_64k}, // Not working
// -2 Games in 1 - Spider-Man + Spider-Man 2 / Detected correctly, white screen 
//  at startup. Note: This is the only single game in the entire GBA library that uses this save type ID.

{"EEPROM_V126", SAVE_TYPE_EEPROM_64k}, // Not Working
// - Harry Potter and the Goblet of Fire (USA) / Detected correctly, black screen.
// - Yggdra Union : We'll Never Fight Alone (USA) / Detected correctly, Half of the screen and 
// some scenes are black, crashes with screech sounds after some intro music.

"EEPROM_V122" needs to be tested further with other roms just to confirm, I only have the ones I tested currently available. With the last two types, it seems to be a rom problem rather than a save problem, as their size is the biggest found in the GBA library (32 MB)

The source I used to confirm and track the save types is: http://offlinelistgba.free.fr/index.php, I recommend to set the search parameters to "From the rom: 1, display: 2900 roms." so the entire library can be searched with Ctrl+F.

Of course a second testing view should be made to cross-confirm that nearly every save type is working correctly, let me know if you have questions about my tests.

profi200 commented 4 years ago

What about latest commit?

[removed build]

profi200 commented 4 years ago

Closing due to a lack of feedback. If there is still a game that doesn't save correctly (and i'm sure there is) open a new issue for collecting all the problematic games in one place.

Next is probably a very basic file browser.

Dartz150 commented 4 years ago

Hello! Sorry for not reponding before, I was somewhat busy. I have tested with the build you comented above and can conmfirm that EEPROM_V120 and EEPROM_V122 are now working fine. The other two save types with issues remain still unfunctional.

profi200 commented 4 years ago

Can't reproduce. V125 and V126 are working here. Did you delete the old (and likely broken) save file?

New test build with the file browser i added (yes, it's a pretty crappy file browser but good enough for now): open_agb_firm.zip

subad31155 commented 2 years ago

add support for epprom v122 save type????????