Ecube Save Fix

 Added:02.10.05 - Updated:08.10.05

I recently (at the time of writing this) bought an Ecube GBA Flash cartridge. I did this for two main reasons:
a) I study Computer Games Technology and wanted some way to test GBA code properly (GBA coding hasn't been taught in my course yet... I've been learning this on my own as I go along.)
b) I want to minimise the number of original Games I carry around with me... Those things are expensive and easily lost!
Anyway... back to the point:- I wanted to try out PocketNES (hmmm I wonder if I should one day make a NES Emulator called PokéNES ;) ) And unfortunately the Ecube client doesn't detect or let you set the save type of a ROM image... it only permits you to change the save size! This didn't sit right with me... I was not going to accept that I could only play NES games on my GBA without the ability to save!
I immediately got to work... my primary thought was "What the hell does the client look for to get the save type... and why is it missing from homebrew...?"

STEP1 - Searching for the word "SAVE"
I opened up a commercial game in a HexEd (I use HHD Hex Editor... It's FREEWARE and only has a minor gripe of a static banner in the top right corner.) E.G. Wario Ware Inc. (It shows SRAM in save type in Ecube client...)
HexEd1
Do: Edit>Find as in the picture above and type in "SAVE" on the ASCII field. This is shown below:
HexEd2
Press OK and you'll see that nothing really useful comes of this... you find text strings with the word "SAVE" but nothing that looks like it will help Ecube to detect save type...

STEP2 - Line Scouring
This is and was, for me, a very tedious process... basically I looked through the entire file in the HexEd until I found something 'interesting' If you have no idea what I mean by that... well I'll try to explain; Interesting basically means: Something that looks like it might do the job I want it to.
Scrolling down you come accross a lot of things but remember only things that look 'interesting' is what we want! Such as this I eventually came accross:
HexEd3

STEP3 - Test1
Well upon finding something 'interesting' it was necessary to try out a few things... I put together a small selection of games in PocketNES and then loaded this compiled ROM into the HexEd. I didn't have a clue where I should put the text SRAM so I just added 12 bytes to the end of the file (Scroll to the very bottom of the file, right-click and choose "Insert" then type 12 and hit return. In this new area of space you created you can type in (or copy paste) the word 'SRAM' and then do File>Save As and call it rompatched.gba...
After doing all that...<phew> you can add the ROM in the Ecube client... to find it doesn't work! DOH!

STEP4 - Test2
The problem is.... the text string we actually need is not just 'SRAM' but 'SRAM_V112' Just look in the last picture and you'll see what I mean (If you have any sort of thought process...)
Ok so as before prepare your PocketNES ROM and add 12 bytes to the end and in this 12 bytes of space put the text 'SRAM_V112'
Put the ROM on your Ecube with the client and... Guess what!? It detects the save type SRAM! The detected size is not important since the Ecube client WILL let you change that!

STEP5 - Other Save Types?
After sucessfully finding a solution to get Homebrew software saving on Ecube, I decided to look for other save types. It is actually really easy after doing all that hard work... If you know a ROM saves in 1Mb Flash... you just search for the text string 'FLASH' until you see something 'interesting' EEPROM? search for 'EEPROM'! Just put the correct string at the end of a ROM file and you're set!

SAVE TYPE STRINGS
I will list all save strings I have come accross myself here.

EEPROM_V120 - 64kb EEPROM
EEPROM_V124 - 128kb EEPROM
FLASH1M_V103 - 1Mb Flash
FLASH_V123 - 512kb Flash
SRAM_F_V103 - 256kb SRAM
SRAM_V113 - 512kb SRAM <-- This seems to be the most common for Homebrew.

I have put together utils to patch your ROM without having to use a HexEd.


Note: To contact me please use this address: pokeparadox (AT) gmail (DOT) com .
398 are still scared of hex editors.