gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Hardware > Flashing .sav files to Original carts

#20143 - zazery - Mon May 03, 2004 2:31 am

Ok I lost my Final Fantasy Tactics game. After searching my house for a few times in the last few months I determined I can't find it. I decided to play it on the ROM I dumped on my computer before I lost the original. (wanted to see how to do some effects) Now after over 3 months I decided to get a new copy of it. I went to my Electronics botique and picked up a used copy of it.

Now I've got a saved file on my computer and I want to continue my game where I left off. I've got the EZF Advance with the cable that connects to the GBA ext. port.

I've done a forum search and found some useful information but I don't want to completely mess it up so if someone could give me a fool proof way to write a .sav file to an original cart without messing it up, it would be really appreciated. Currently my software just allows me to back up .sav files. (EZF Advance Client v0.99b)

Any help would be greatly appreciated.
Eric

#20145 - dagamer34 - Mon May 03, 2004 2:53 am

So far, I don't know of any way to flash a .sav file to an original cart.

By the way, the EZFA client software is at version 1.01 now.
_________________
Little kids and Playstation 2's don't mix. :(

#20146 - MumblyJoe - Mon May 03, 2004 3:02 am

The only way I know of is to flash a flash card (with only one rom on it - I did this with an ezfa so it may be different with other things) and your save, then use an action replay to pull the save off in action replay format then put it onto your original card with the action replay.
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!

#20149 - sgeos - Mon May 03, 2004 4:50 am

I use an old visoly cart and flash linker. Dropping .sav files back on a cart is a snap as long as the cart uses SRAM.

-Brendan

#20151 - zazery - Mon May 03, 2004 6:06 am

When I plug in my FFTA cart it says 128M for the ROM and 0k for the RAM. What about that SMS stick, maybe that would work?

It's really confusing, what is the official website for my cart. So many carts have EZ something or other in their name. Where can I get v1.01?

Ok I've got the 128M version of the EZFA and because of the menu I can't put the ROM it. Plus I don't have Action Reply. There isn't a point to keep it on my EZFA since I test my demos frequently.

sgeos, are you refering to droping it on the orignal cart using the flash linker? Thanks for the tip unfortunatly I don't have the flash linker.

tepples wrote:
To overwrite the SRAM in a Game Pak or flash cart, just wrap the .sav file in a multiboot program (with something like GBFS, that's relatively easy) and send it over the MBV2 or XBOO cable. The multiboot program should copy the bytes from RAM to the cartridge, in descending order (0xffff in .sav -> 0xffff in SRAM, 0xfffe->0xfffe, ..., 0x0001->0x0001, 0x0000->0x0000).

Why descending order? Your typical .sav file is 64 KB, but real SRAM is often 32 KB or smaller, and if you copy in forward order, you may overwrite bytes that you had written previously.


Like I said I did some searching and came across old posts. I didn't want to bring it back up so I started my own. (lots of forums don't like old posts brought up, I don't know if this one does) Ok anyways I understand what tepples is saying however I'm not sure how FFTA saves.

Sorry it's really confusing, thanks for the help so far,
Eric

#20154 - sgeos - Mon May 03, 2004 7:43 am

zazery wrote:
sgeos, are you refering to droping it on the orignal cart using the flash linker?


Yes.

zazery wrote:
Thanks for the tip unfortunatly I don't have the flash linker.


That problem could be solved. I'm not sure how much flash linkers run, but they are far cheaper than flash carts.

-Brendan

#20166 - ficedula - Mon May 03, 2004 3:54 pm

I did this for Golden Sun - had to copy my savegame back from a F2A cart to the original to carry on playing. The F2A software will write sram saves, but not flash saves, so I had to do it myself there too, based on the info I'd found on the forums...

The way I ended up doing it was writing a multiboot program (with the new savegame file stuck inside it) that I downloaded to the GBA and ran while the Golden Sun cart was in it, the program just wrote the savegame to the flash and halted. It took a couple of attempts to get it to work, but it wasn't TOO hard. Basically exactly what tepples suggested ;)

If you can't execute multiboot programs over a cable you could do something similar - you'd have to write a program which did the same, but ran from IWRAM/EWRAM rather than ROM. Write that program to a flash cart, boot the GBA off that - once the program's been copied into RAM and started running from there it waits for a keypress, the flash cart isn't needed any more, put your FFTA cart in and start writing... the only issue is that testing would be really long winded ;) I could post the code I ended up using if it'd help?

#20170 - torne - Mon May 03, 2004 4:07 pm

I was writing a program to copy saves to/from original carts via multiboot or very careful cart swapping, but have been unable to find the time to get it going. Hopefully in a few weeks once my exams are over I'll be able to put more time into my projects again. =(

#20181 - dagamer34 - Mon May 03, 2004 11:59 pm

Umm... FFTA uses a 512Kb Flash ROM save by the way, not SRAM. As such, you might want to test the multiboot writing method with a cheap game that uses Flash ROM (like Mario Kart) so you don't screw up your FFTA to the point that it can't be played at all.

The official site of the EZFA: www.gba-toys.com It might be down at the moment so wait a while.
_________________
Little kids and Playstation 2's don't mix. :(

#20184 - zazery - Tue May 04, 2004 1:04 am

It's very useful to know it's flash memory and not SRAM. I did manage to get the save file from the cart using my EZFA client. If there is a way to determine where the save would be, that would be great.

If possible ficedula, could you post your code?

Thanks guys for the help, I think I might end up just leaving it how it is and starting a new game. But I actually want to be able to send the save to the computer, play a bit on there, and put it back if I want.

#20192 - sgeos - Tue May 04, 2004 9:04 am

zazery wrote:
I actually want to be able to send the save to the computer, play a bit on there, and put it back if I want.


I do that a lot with my SRAM games.

ficedula wrote:
Write that program to a flash cart, boot the GBA off that - once the program's been copied into RAM and started running from there it waits for a keypress, the flash cart isn't needed any more, put your FFTA cart in and start writing... the only issue is that testing would be really long winded ;)


To speed up testing, would it be possible to do something like this?
Boot save data loader program.
Wait for keypress.
Copy save game.
Issue bios reset.
Game boots with modified save data.

-Brendan

#20205 - ficedula - Tue May 04, 2004 7:43 pm

The code for my program (hastily written, so it's not that good ;) is:

Code:

#include "gba.h"
#include "typedef.h"

int __gba_multiboot;

IN_EWRAM u8 foo [] = {
......
};

int main() {
   REG_DISPCNT = 0x1463; //vid mode 3, background on, 1-d sprite map, h-blank interval free, obj on

   volatile u16 *buffer = VideoBuffer;
   int k;
   for (k=0; k < (240*160); k++) buffer[k] = 0xF000;

   volatile u8 *fctrl0 = (u8*)0xE005555;
   volatile u8 *fctrl1 = (u8*)0xE002AAA;
   volatile u8 *fctrl2 = (u8*)0xE000000;

   //init flash
   *fctrl0 = 0xAA;
   *fctrl1 = 0x55;
   *fctrl0 = 0x90;
   *fctrl2 = 0xF0;

   *buffer++ = 0x3E0;

   //erase chip
   *fctrl0 = 0xAA;
   *fctrl1 = 0x55;
   *fctrl0 = 0x80;
   *fctrl0 = 0xAA;
   *fctrl1 = 0x55;
   *fctrl0 = 0x10;

   *buffer++ = 0x3E0;
   
   //wait for erase done
   u8 val1, val2;
   val1 = *fctrl2;   val2 = *fctrl2;
   while (val1 != val2) { val1 = *fctrl2;   val2 = *fctrl2; }
   val1 = *fctrl2;   val2 = *fctrl2;
   while (val1 != val2) { val1 = *fctrl2;   val2 = *fctrl2; }

   *buffer++ = 0x3E0;

   volatile u8 *data = fctrl2;
   int i;
   //write data
   for (i=0; i<65536; i++) {
      *fctrl0 = 0xAA;
      *fctrl1 = 0x55;
      *fctrl0 = 0xA0;
      data[i-64] = foo[i];
      val1 = data[i]; val2 = data[i];
      while (val1 != val2) { val1 = data[i]; val2 = data[i]; }
      val1 = data[i]; val2 = data[i];
      while (val1 != val2) { val1 = data[i]; val2 = data[i]; }
      val1 = data[i]; val2 = data[i];
      while (val1 != val2) { val1 = data[i]; val2 = data[i]; }
      *buffer++ = 0x3E0;
   }

   for (k=0; k < (240*160); k++) buffer[k] = 0x00FF;
   while (1) { }
   return 0;
}


The video buffer stuff was just in there to give me a really simple idea of whether it'd crashed, etc. The only REALLY strange thing is the way I had to write to data[i-64] rather than data[i] to get the expected results. I've no idea why that is, but the savegame would only transfer fine if I did that, sooo...

#20224 - zazery - Tue May 04, 2004 11:50 pm

Wow that is really helpful. I'll test out your code and fix it up once I get it working. I don't know if I can write it but I'll try to write a program that will create a rom, to send to your GBA to download the .sav file to.

I'll let you know how I make out. Hopefully in the next few days because I'm pretty busy with my exams.

#20234 - phonymike - Wed May 05, 2004 2:51 am

As a side note, the actual data itself may be byteswapped depending on what type of hardware save was used. Let's say you were able to dump your FF save to your harddrive from the cart and save it to a file. Then let's say you had it flashed to a flash cart, and dumped the save to file. The two may not be identical, even though they're identical to the game. Like the original data might be 0x01 0x02 0x03 0x04, but the flash cart's save file would have 0x04 0x03 0x02 0x01. This usually happens if the flash software patches the game. Or even an emulator's save file could do this. So if you do run into problems, writing the save file to the cart may work, but the data isn't in the correct way. You may need to run through the entire save file and swap 8 bytes at a time to be backwards.

Also I heard that at least the visoly flash linker only reads/writes 16 bits at a time or something like that, so there'd be no software that could read flash or eeprom saves due to this. So your best bet is using a gba program to read/write the cart.

#26029 - emumanXM - Sat Sep 04, 2004 5:37 am

I'm curious about going the other way. How can I dump the save flash of the Super Mario Advance 4 original nintendo cart? I also want to dump the e-reader flash so I can pull off the scanned card game from the flash save. I know people did this because there are e-reader dumps avialable, but how does one dump flash rom?

Thanks.

#26842 - caitsith2 - Mon Sep 27, 2004 8:28 am

For a 1MBit flash chip, there is one more important sequence of writes to know. The chips are banked 64K at a time, and the sequence is used to select which bank to use. Theoritically, nintendo could make a flash chip up to 128Mbits in size, with the bank switching sequence involvled. However, 1Mbit is the biggest flash chip ever seen on the gba for saves.

The sequence is

E005555 = AA
E002AAA = 55
E005555 = B0
E000000 = [Bank Number]

where [bank number] = 0 or 1.

This is how the upper 64K of the flash is read from or written to.

BTW, I was the individual that scanned and dumped the 10 nes classic e-reader saves that are available, out of the 13 games that exist.

#28504 - Imoto-e - Mon Nov 01, 2004 9:04 pm

Sorry for Bumping this thread:

The SMA4 Save can easely dumped with a FA" USB Linker (Did so) but can't be written back.

I'd like to write my Save back, 'cause it contains some selfmade Levels I want to play on the go.

My Flashcard is a F2A 256 Pro (And can't use SRAM there, it's defective).

caitsith2: did you write a programm that can dump 1M Flash saves back on cart?

#118808 - Goloki - Fri Feb 16, 2007 11:33 pm

Sorry to bump a topic this old, I found it searching the forums, I hope you don't mind if I use it again... I didn't want to create more threads if there was one that could be used.
I want to flash/inject a save file from VBA into my original GBA Pok?mon Emerald cart. I've found two "options" to do it, but none of them seems to work:

1. Getting a EFA Linker. I won't, because they're are overpriced right now. Besides, I just want this for a single game.

2. Using this tool, "mp_save.gba". I was able to excute it... although... It does recognize the game in "extracting mode" (L), when I put my slot-2 flashcart (SC miniSD) and hit the A button, it tells me to "insert the Movie Player cart". When I try to load and write a saved file into a game (R), I cannot navigate through the contents of my miniSD card. It doesn't even show me the .sav I have in it.
I guess all these problems are due to the fact that this program was written to work in CF cards, and it has a poor compatibility with SD based cards.

So, my question is: is there any way to make this work? If not, at least, with another method... or hope that there's a person wise and good enough to rewrite the program in order to make it work with SD based cards :roll:

Thanks in advance...

#118815 - tepples - Sat Feb 17, 2007 1:08 am

Goloki wrote:
Sorry to bump a topic this old, I found it searching the forums, I hope you don't mind if I use it again... I didn't want to create more threads if there was one that could be used.
I want to flash/inject a save file from VBA into my original GBA Pok?mon Emerald cart.

How did you use VBA to create a Pok?mon save file in the first place?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#118852 - Goloki - Sat Feb 17, 2007 2:53 pm

tepples wrote:
Goloki wrote:
Sorry to bump a topic this old, I found it searching the forums, I hope you don't mind if I use it again... I didn't want to create more threads if there was one that could be used.
I want to flash/inject a save file from VBA into my original GBA Pok?mon Emerald cart.

How did you use VBA to create a Pok?mon save file in the first place?


Well... I opened up the ROM. Used Ciro's Pok?mon Maker to recreate my pok?mons. Saved the game. Exported it using the "Export .sav..." function, in Flash 128KB.
Dunno what's so weird about that.

#118857 - tepples - Sat Feb 17, 2007 4:32 pm

EDIT: I hereby apologize for and rescind this post.

The former content of this post was as follows:

tepples wrote:
Goloki wrote:
Well... I opened up the ROM

O RLY?

_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.


Last edited by tepples on Sun Feb 18, 2007 12:55 am; edited 2 times in total

#118873 - Goloki - Sat Feb 17, 2007 7:05 pm

tepples wrote:
Goloki wrote:
Well... I opened up the ROM

O RLY?


I don't think you get it. I want to inject a save file from a Pok?mon Emerald ROM into my ORIGINAL Pok?mon Emerald cart... AFAIK, there's nothing ilegal involved in it, as far as I have my original cart, as I do. Do you want a video or some kind of proof that I have my original copy of the game along with the backup?

I already stated it, it's an original game I want to flash. This is what this thread is all about, let me remind you. Read the first post, the user had the same question as I, only 3 years ago. Why on Earth would I be asking for help in this thread if I hadn't a physical, legal copy of the game?
But if you insist on treating new members like you do, thank you very much.

#118876 - tepples - Sat Feb 17, 2007 7:23 pm

Managing save files for Pok?mon games on Game Boy Advance is complicated by the fact that Pok?mon games use a 1 Mbit flash chip (unlike the 512 Kbit flash chip in most other GBA games that use flash save) and an RTC (clock chip).

There exist forums for support of your VBA backups. As I interpret the rules, gbadev.org happens not to be one of them.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#118881 - Goloki - Sat Feb 17, 2007 7:49 pm

tepples wrote:
Managing save files for Pok?mon games on Game Boy Advance is complicated by the fact that Pok?mon games use a 1 Mbit flash chip (unlike the 512 Kbit flash chip in most other GBA games that use flash save) and an RTC (clock chip).

There exist forums for support of your VBA backups. As I interpret the rules, gbadev.org happens not to be one of them.


Well, you see, I don't want support for a ROM, not even for an emulator. I'm asking how to transfer a saved game from my computer to a real cart. A legal game I bought with my money, from a dump of the exact same cart a friend of my did with an EZFA a while ago. Unluckily, we both parted ways when we started going to the university, so I find myself in this problem of mine. All that I can think of is that you didn't even bother to read my whole post. You just saw ".sav" and "ILEGAL ROM USER" popped in your mind.

You could have told me in the first place that Pok?mon games use RTC (I knew it BTW), or even telling me that the rules don't allow "this kind of discussion" instead of trying to make me look like a pirate/idiot.

zazery wrote:
Ok I lost my Final Fantasy Tactics game. After searching my house for a few times in the last few months I determined I can't find it. I decided to play it on the ROM I dumped on my computer before I lost the original. (wanted to see how to do some effects) Now after over 3 months I decided to get a new copy of it. I went to my Electronics botique and picked up a used copy of it.

Now I've got a saved file on my computer and I want to continue my game where I left off.


The topic creator said it, he is using a backup he made by himself. From a game he bought by himself. And I'm a pirate for doing the exact same thing.

Rules wrote:
First and foremost; This is a development forum. Even though we have a section about flash equipment does not mean that you should ask about how to get X game running on your gba flash setup. We do not care if you own the games and just want to keep them on a single cart. It's not what this forum is about.


If you bring up the Rules, which I read before asking this, just to make sure I wasn't breaking any, please, do tell me where my question is in fault with them, and why the exact same question wasn't 3 years ago.
You don't allow discussions such as where getting a ROM, how to making it work on X flashcart, etc. But I didn't ask anything related to that. I just wanted to know how could I exchange a saved game file within an original cart.
Also, please tell me why, if you don't allow original carts discussion in these forums, you didn't close/delete this thread before.
I'd love to know why you have the right to bash me if I didn't do anything wrong. Or, at least, tell me exactly what I've done wrong, because I don't seem to notice it.

Either way, thank you very much. I was expecting at least a good treatment, because I think that I asked nicely, following the rules and in a correct way... but then again, thank you very much. I came to these forums, did my homework researching in your archive, made sure you had a thread asking what I wanted to know before creating a new one... I even apologized for bumping a thread so old. But still, you treat me like if I was asking for a ROM site in my first post.
I was hoping GBADev was as good as people say it is, but I was pretty much mistaken. Nevermind my question, as you say, I'll go somewhere else to ask. Some place where manipulating a real cart doesn't translate into "he's using a ROM, call the police". BTW, I've raisen a complaint about you to SimonB, the Admin. I still think you don't have the right to treat anyone like you did, but I'll let him decide wheter you should think about it or not. It's not that I'm interested, though, because I'm pretty much out of these forums forever :)

#118895 - dantheman - Sun Feb 18, 2007 12:24 am

I know that the shareware FlashManager program can interface with a variety of linkers and allows you to read/write to/from original carts. I know you said you don't want to buy a cable, but it's an option. It works with my F2A cable and a variety of games (though EEPROM saves have every 8 bits reversed, which can be fixed with a simple Python script). However, I have not tested it with the Pokemon games, as I don't own any of them. I'm not sure FlashManager will know how to write to them.

Sorry to be of such little help. =/

#118898 - tepples - Sun Feb 18, 2007 12:45 am

Goloki wrote:
If you bring up the Rules, which I read before asking this, just to make sure I wasn't breaking any, please, do tell me where my question is in fault with them, and why the exact same question wasn't 3 years ago.

The written rules have been amended since then. Please compare the date the original question was posted to the date the rules were posted.

Quote:
You don't allow discussions such as where getting a ROM, how to making it work on X flashcart, etc. But I didn't ask anything related to that. I just wanted to know how could I exchange a saved game file within an original cart.

I apologize for having jumped to conclusions. I apologize for not keeping my impulses under control.

Quote:
Also, please tell me why, if you don't allow original carts discussion in these forums, you didn't close/delete this thread before.

Because the written rules in effect on May 03, 2004, were not identical to the written rules in effect as of today. There was a big flamewar between myself and wintermute that resulted in the adoption of the rules currently in effect.

Quote:
Either way, thank you very much. I was expecting at least a good treatment, because I think that I asked nicely, following the rules and in a correct way... but then again, thank you very much. I came to these forums, did my homework researching in your archive, made sure you had a thread asking what I wanted to know before creating a new one... I even apologized for bumping a thread so old. But still, you treat me like if I was asking for a ROM site in my first post.

I acted that way in error.

Quote:
I was hoping GBADev was as good as people say it is, but I was pretty much mistaken.

I always thought the "dev" referred to development of original freeware games, not troubleshooting of commercial games.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#118904 - chishm - Sun Feb 18, 2007 3:58 am

I'm not sure if this is still allowed (I couldn't find the new rules), so sorry if it isn't. I updated the mp_save utility to work with any GBA cart supported by DLDI and use the much more stable libfat rather than gba_nds_fat. The file is on my SendSave page.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#118927 - dantheman - Sun Feb 18, 2007 7:59 am

Interesting program Chishm. Now I really wish the Supercard didn't reboot the DS upon insertion. As it reboots my GBA as well, I no longer believe it to be a FlashMe issue.

I was able to insert it without rebooting once, and your program appeared to work correctly. However, as I fear my method of doing so (pushing the right side in first) is causing damage to my GBA slot, I will probably refrain from using the program in the future. Hm, would it be hard to modify it to save to the SRAM of a GBA flash cart? I can reinsert my Flash2Advance Ultra cart without any issues, so perhaps that could be the destination cart instead of the Supercard. It's not a big deal for me though, as I already can accomplish the same task with FlashManager.

#119021 - HyperHacker - Mon Feb 19, 2007 3:48 am

Seems there must be some hardware weirdness with the Supercard that's causing this. Does the battery light ever change when you reinsert it?
_________________
I'm a PSP hacker now, but I still <3 DS.

#119030 - dantheman - Mon Feb 19, 2007 5:08 am

Nope, the battery stays the same, both with the DS plugged in and unplugged.

On my GBA that has low batteries, the light changes from red to green when running a multiboot program and ejecting the Supercard, though I'm pretty sure this is simply because of the loss of 5V going through the power and ground pins. Same concept as the DS battery lasting longer when the passthrough device is ejected after the slot-2 device has been loaded

Interestingly, when running a multiboot GBA application on my GBA, inserting my Metroid Fusion cartridge does not reboot it, which I expected anyway, but inserting either the Supercard or my Flash2Advance Ultra cart does reboot it. It's the F2AU that's surprising, since when I launched the same GBA multiboot program on my DS and inserted the F2AU, it remained the same. Wonder why it reboots the GBA but not the DS in GBA mode.

#119035 - chishm - Mon Feb 19, 2007 5:37 am

My DS Lite rebooted when I reinserted my SC Lite. The strange thing is, it rebooted from GBA mode to NDS mode, which means it's related to the hardware, not the interrupts.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#121033 - Imoto-e - Thu Mar 08, 2007 8:52 am

I have an old program laying around on a disk, which is able to write saves of all kinds back to your original cart (incl. 1M Flash, like SMA4 or PKMN), it worked with my F2A USB cable on Windows 98, I can upload or supply a Link as soon as I found it and determined the site it's hosted on as rules comparable.

#121067 - dantheman - Thu Mar 08, 2007 5:11 pm

My guess is that you are referring to FlashManager, but if another application exists I'd be interested in what it is.

#121070 - Diddl - Thu Mar 08, 2007 5:23 pm

with f2a original software you can upload and download .sav to original cartridge up to 1M.

I think with powerwriter it was possible to work with .sav larger than 1M

#121147 - Imoto-e - Fri Mar 09, 2007 2:59 pm

Diddl wrote:
with f2a original software you can upload and download .sav to original cartridge up to 1M.

I think with powerwriter it was possible to work with .sav larger than 1M


f2a's software only works for SRAM, and even some EPROM, but no FLASH.

dantheman wrote:
My guess is that you are referring to FlashManager, but if another application exists I'd be interested in what it is.


Yeah, I think it was FlashManager. A Little Program that supported different kinds of Flash-Hardware, right?