Author Topic: How does the Everdrive GBA autodetect save types?  (Read 1348 times)

0 Members and 1 Guest are viewing this topic.

Offline rodri042

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
How does the Everdrive GBA autodetect save types?
« on: July 27, 2020, 07:18 AM »
Hi there!

I'm developing a GBA game and I'm testing it with my Everdrive GBA X5. When I added save functionality it didn't work straight, I had to manually go to ROM settings and select SRAM as save type.

Is that info that the flashcart reads directly from the ROM or is there a hardcoded list with all the save types of every game?

Thanks!
« Last Edit: July 27, 2020, 07:20 AM by rodri042 »

Offline Localhorst86

  • Full Member
  • ***
  • Posts: 191
  • Karma: +14/-0
    • View Profile
Re: How does the Everdrive GBA autodetect save types?
« Reply #1 on: July 27, 2020, 10:40 AM »
I am not sure if the everdrive does it the same as emulators, but you could try putting the save ID string into your ROM image:

Quote
Nintendo didn't include a backup-type entry in the ROM header, however, the required type can be detected by ID strings in the ROM-image. Nintendo's tools are automatically inserting these strings (as part of their library headers). When using other tools, you may insert ID strings by hand.
The ID string must be located at a word-aligned memory location, the string length should be a multiple of 4 bytes (padded with zero's).
  EEPROM_Vnnn    EEPROM 512 bytes or 8 Kbytes (4Kbit or 64Kbit)
  SRAM_Vnnn      SRAM 32 Kbytes (256Kbit)
  FLASH_Vnnn     FLASH 64 Kbytes (512Kbit) (ID used in older files)
  FLASH512_Vnnn  FLASH 64 Kbytes (512Kbit) (ID used in newer files)
  FLASH1M_Vnnn   FLASH 128 Kbytes (1Mbit)
For Nintendo's tools, "nnn" is a 3-digit library version number. When using other tools, best keep it set to "nnn" rather than inserting numeric digits.
[..]Ideally, for faster detection, the ID should be put into the first some bytes of the ROM-image (ie. somewhere right after the ROM header).

https://problemkaputt.de/gbatek.htm#gbacartridges
« Last Edit: July 27, 2020, 10:44 AM by Localhorst86 »

Offline Richardragon87

  • SNESAdvance Revival Coder
  • Hero Member
  • *****
  • Posts: 511
  • Karma: +10/-0
    • View Profile
Re: How does the Everdrive GBA autodetect save types?
« Reply #2 on: July 27, 2020, 01:20 PM »
The GBA X5 Everdrive has two different settings when a rom is clicked on they are select and start or select only, I presume select and start is the equivalent of how the GB Everdrive would write a save file to the device when clicked on while start just does it without writing anything to the device. The same thing applies to the emulators it also seems to automatically make a backup of every rom you played on and can reach a good 1000 before needing the SRAM files removed in order to get the device to work again.
[quote Random dating spambotJ

Quote
Post changed:

Great, the photo didn't load! Does anyone know how to fix this?
In any case, my other photos can be viewed here, I will be glad to meet you, I love flirt))

P.S Richardragon87! Don't write me again, dude! You're in ignore list!

Offline coolbho3k

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: How does the Everdrive GBA autodetect save types?
« Reply #3 on: July 29, 2020, 07:20 AM »
I found that this happens with other homebrews too. I imagine there's also an internal database of problematic retail games as well as heuristics, as there's games that lie about their save type to fool emulators and flash carts.

Offline Richardragon87

  • SNESAdvance Revival Coder
  • Hero Member
  • *****
  • Posts: 511
  • Karma: +10/-0
    • View Profile
Re: How does the Everdrive GBA autodetect save types?
« Reply #4 on: July 29, 2020, 02:58 PM »
I found that this happens with other homebrews too. I imagine there's also an internal database of problematic retail games as well as heuristics, as there's games that lie about their save type to fool emulators and flash carts.

All emulators do that on the everdrives this is because the device has that last played function. The reason why you can press select on the GBA ones to see a list of your preveous games is because the device always makes a back up of the game even if you don't think it is saving it, every rom loaded will always create a SRAM file. I noticed this when I went through every NES game eventually the screen blacked out and said a error message when everytime any rom was loaded up be it an emulator one or a GBA one. It was only after I removed all the backed up save files the device made that it ran and worked again.
[quote Random dating spambotJ

Quote
Post changed:

Great, the photo didn't load! Does anyone know how to fix this?
In any case, my other photos can be viewed here, I will be glad to meet you, I love flirt))

P.S Richardragon87! Don't write me again, dude! You're in ignore list!

Offline nuu

  • Hero Member
  • *****
  • Posts: 1736
  • Karma: +79/-2
    • View Profile
Re: How does the Everdrive GBA autodetect save types?
« Reply #5 on: July 29, 2020, 10:57 PM »
Richardragon you are rambling too much off-topic. This thread is about how the Everdrive detects the save type used by a game, not about play lists.

Offline James Cree

  • Full Member
  • ***
  • Posts: 186
  • Karma: +7/-0
    • View Profile
Re: How does the Everdrive GBA autodetect save types?
« Reply #6 on: July 29, 2020, 11:56 PM »
And not about damned emulators (again...)

Offline KRIKzz

  • Administrator
  • Hero Member
  • *****
  • Posts: 3379
  • Karma: +510/-2
    • View Profile
Re: How does the Everdrive GBA autodetect save types?
« Reply #7 on: August 04, 2020, 04:50 PM »
Hi there!

I'm developing a GBA game and I'm testing it with my Everdrive GBA X5. When I added save functionality it didn't work straight, I had to manually go to ROM settings and select SRAM as save type.

Is that info that the flashcart reads directly from the ROM or is there a hardcoded list with all the save types of every game?

Thanks!

Cart uses Game ID to determinate save type. So you can use Game ID from some known game which has required save type

Offline nuu

  • Hero Member
  • *****
  • Posts: 1736
  • Karma: +79/-2
    • View Profile
Re: How does the Everdrive GBA autodetect save types?
« Reply #8 on: August 10, 2020, 12:13 PM »
Is "Game ID" the middle two characters of the game code like how the Everdrive 64 works, or is it the whole 4 character game code?
Example: Super Mario Advance has "AMAJ" as game code, is the ID used by the Everdrive just the 2 characters "MA" or all 4 characters "AMAJ"?

Offline rodri042

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: How does the Everdrive GBA autodetect save types?
« Reply #9 on: August 16, 2020, 07:28 AM »
Thanks for the replies!

I've added the string "SRAM_Vnnn" to my game's code and that fixed autodetection in emulators. For the Everdrive, I changed the game's code to AZCE (Megaman Zero) and it worked.