Added tool for detecting save type

aceloop
Junior Member
Posts: 35
Joined: Tue May 27, 2008 8:39 am

Added tool for detecting save type

Post by aceloop »

spacy i tested all the popular games, and checked GBAtemp release list with the save types. All the save types where correct. ill test more later.

 

Code: Select all

 \Advance Wars 2 - Black Hole Rising (U).gba
Result: This cartridge uses FLASH (64 KiB).

\Advance Wars (U) (v1.1).gba
Result: This cartridge uses FLASH (64 KiB).

\Astro Boy - Omega Factor (U).gba
Result: This cartridge uses EEPROM.

\Castlevania - Aria of Sorrow (E) .gba
Result: This cartridge uses SRAM.

\Castlevania - Circle of the Moon (U).gba
Result: This cartridge uses SRAM.

\Castlevania - Harmony of Dissonance (E).gba
Result: This cartridge uses SRAM.

\Final Fantasy I & II - Dawn of Souls (E) .gba
Result: This cartridge uses SRAM.

\Final Fantasy IV Advance (E) .gba
Result: This cartridge uses SRAM.

\Final Fantasy Tactics Advance (E).gba
Result: This cartridge uses FLASH (64 KiB).

\Final Fantasy V (E).gba
Result: This cartridge uses SRAM.

\Final Fantasy VI Advance (U).gba
Result: This cartridge uses SRAM.

\Fire Emblem - The Sacred Stones (U).gba
Result: This cartridge uses SRAM.

\Fire Emblem (U).gba
Result: This cartridge uses SRAM.

\F-Zero - Maximum Velocity (UE).gba
Result: This cartridge uses SRAM.

\Golden Sun - The Lost Age (UE).gba
Result: This cartridge uses FLASH (64 KiB).

\Golden Sun (UE).gba
Result: This cartridge uses FLASH (64 KiB).

\Gunstar Super Heroes.gba
Result: This cartridge uses EEPROM.

\Harvest Moon - Friends of Mineral Town (U).gba
Result: This cartridge uses SRAM.

\Harvest Moon - More Friends of Mineral Town (U).gba
Result: This cartridge uses SRAM.

\Kingdom Hearts - Chain of Memories (U).gba
Result: This cartridge uses SRAM.

\Legend of Zelda, The - A Link to the Past & Four Swords (U).gba
Result: This cartridge uses EEPROM.

\Mario & Luigi - Superstar Saga (E).gba
Result: This cartridge uses EEPROM.

\Mario Golf - Advance Tour (U).gba
Result: This cartridge uses SRAM.

\Mario Kart - Super Circuit (U).gba
Result: This cartridge uses FLASH (64 KiB).

\Mario Tennis Power Tour (U).gba
Result: This cartridge uses SRAM.

\Metroid - Zero Mission (E).gba
Result: This cartridge uses SRAM.

\Metroid Fusion (E) .gba
Result: This cartridge uses SRAM.

\Mortal Kombat - Deadly Alliance (UE).gba
Result: This cartridge uses EEPROM.

\Mother 3 (J).gba
Result: This cartridge uses FLASH (64 KiB).

\Pokemon Emerald (U).gba
Result: This cartridge uses FLASH (128 KiB).

\Pokemon Fire Red.gba
Result: This cartridge uses FLASH (128 KiB).

\Pokemon Mystery Dungeon - Red Rescue Team.gba
Result: This cartridge uses FLASH (128 KiB).

\Pokemon Video Volume 1.gba
Result: This cartridge has probably no backup media.

\Riviera - The Promised Land (U).gba
Result: This cartridge uses SRAM.

\Sonic Advance 2 (E) .gba
Result: This cartridge uses FLASH (64 KiB).

\Sonic Advance 3 (E).gba
Result: This cartridge uses FLASH (64 KiB).

\Sonic Advance (E).gba
Result: This cartridge uses FLASH (64 KiB).

\Super Mario Advance 3 - Yoshi's Island (U).gba
Result: This cartridge uses EEPROM.

\Super Mario Advance 4 - Super Mario Bros. 3 (E) (v1.1).gba
Result: This cartridge uses FLASH (128 KiB).

\Super Mario Advance (UE).gba
Result: This cartridge uses EEPROM.

\Super Street Fighter II Turbo - Revival (E).gba
Result: This cartridge uses EEPROM.

\Tactics Ogre - The Knight of Lodis (U).gba
Result: This cartridge uses FLASH (64 KiB).

\The Legend of Zelda - The Minish Cap.gba
Result: This cartridge uses EEPROM.

\Wario Land 4 (UE).gba
Result: This cartridge uses SRAM.

\WarioWare - Twisted! (U).gba
Result: This cartridge uses SRAM.

\WarioWare, Inc. - Mega Microgames! (U).gba
Result: This cartridge uses SRAM.

\Street Fighter Alpha 3 Upper (E).gba
Result: This cartridge uses EEPROM.

\Super Mario Advance 2 - Super Mario World (U).gba
Result: This cartridge uses EEPROM.

i think, i found a little bug with svn896. when you have no game loaded its says "This cartridge has probably no backup media.". shouldnt it be like some like "no cartridge loaded"??

Last edited by aceloop on Sun Aug 23, 2009 12:49 pm, edited 1 time in total.
spacy51
Senior Member
Posts: 371
Joined: Tue Mar 18, 2008 4:59 pm

Added tool for detecting save type

Post by spacy51 »

I am interested if there are mroe games that use strings I do not know of yet. These will get falsely be detected as no backup media present.

aceloop
Junior Member
Posts: 35
Joined: Tue May 27, 2008 8:39 am

Added tool for detecting save type

Post by aceloop »

im not too sure but wouldn't the vba-over.ini floating about the net be a help? wasnt the vba-over.ini file the way of fixing save problems?

spacy51
Senior Member
Posts: 371
Joined: Tue Mar 18, 2008 4:59 pm

Added tool for detecting save type

Post by spacy51 »

vba-over.ini is more like a work-around if you ask me.

 

We wouldn#t need that if we had a better auto-detection mechanism.

 

 

vba-ove.rini might still be useful for homebrew that can not be detected right with this code.

Squall Leonhart
Posting Freak
Posts: 1223
Joined: Tue Mar 18, 2008 9:21 am

Added tool for detecting save type

Post by Squall Leonhart »

vba-over is for more then save types, its also for bios per rom, rtc, and mirroring to fix nes classics.

spacy51
Senior Member
Posts: 371
Joined: Tue Mar 18, 2008 4:59 pm

Added tool for detecting save type

Post by spacy51 »

Lol, I just found out VBA already has that kind of code in Util.cpp.

It also looks like a real time clock can be identified by the string: "SIIRTC_V"

 

However, this code is not used anywhere in VBA.

 

void utilGBAFindSave(const u8 *data, const int size)
{

u32 *p = (u32 *)data;

u32 *end = (u32 *)(data + size);

int saveType = 0;

int flashSize = 0x10000;

bool rtcFound = false;

 

while(p < end) {

Code: Select all

u32 d = READ32LE(p);

 

Code: Select all

if(d == 0x52504545) {


  if(memcmp(p, "EEPROM_", 7) == 0) {


    if(saveType == 0)


      saveType = 3;


  }


} else if (d == 0x4D415253) {


  if(memcmp(p, "SRAM_", 5) == 0) {


    if(saveType == 0)


      saveType = 1;


  }


} else if (d == 0x53414C46) {


  if(memcmp(p, "FLASH1M_", 8) == 0) {


    if(saveType == 0) {


      saveType = 2;


      flashSize = 0x20000;


    }


  } else if(memcmp(p, "FLASH", 5) == 0) {


    if(saveType == 0) {


      saveType = 2;


      flashSize = 0x10000;


    }


  }


} else if (d == 0x52494953) {


  if(memcmp(p, "SIIRTC_V", 8) == 0)


    rtcFound = true;


}


p++;

}

// if no matches found, then set it to NONE

if(saveType == 0) {

Code: Select all

saveType = 5;

}

rtcEnable(rtcFound);

cpuSaveType = saveType;

flashSetSize(flashSize);

}

Last edited by spacy51 on Fri Sep 04, 2009 2:41 pm, edited 1 time in total.
Squall Leonhart
Posting Freak
Posts: 1223
Joined: Tue Mar 18, 2008 9:21 am

Added tool for detecting save type

Post by Squall Leonhart »

It probably corresponded with the enhanced detection function, that apparently didn't work right......

bobthetaru
Junior Member
Posts: 2
Joined: Mon Mar 08, 2010 6:36 pm

Added tool for detecting save type

Post by bobthetaru »

i dont know how to add that code to vba, but the list says tactics advance uses 64k flash, i set it to that and it still says error in backup memory when i try to save. I'll try starting a new game.. again..

Otherwise, can anyone help me get my tactics advanced roms to save?

spacy51
Senior Member
Posts: 371
Joined: Tue Mar 18, 2008 4:59 pm

Added tool for detecting save type

Post by spacy51 »

Is your save path correct?

 

Try to move your current save file out of it and start VBA-M without a save file.

Post Reply