• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Improved Save space in FireRed

Blah

Free supporter
1,924
Posts
11
Years
  • Expanded Save block


    Hello, hopefully everyone is doing well. Lately I released a Dexnav implementation that required you to have a saveblock hack installed. It came to my attention that JPAN's hack was the only real one, and the source code seems to be lost. Additionally if you have 800+ Pokemon in your game, extended flags +vars, bags, and whatever other features that relied on save RAM, then this save ram isn't enough!

    The old saveblock hack by JPAN reserved 3780 bytes of save RAM by compressing the game saveblocks closer together and using the space at the end of the block. The idea was really well thought out, and JPAN has my respect for implementing it during the older days of ROM Hacking. I've taken this great idea and added on another 8160 bytes to use, for a total of 11940 bytes. This still leaves about 3200 bytes of FireRed's help menu VRAM buffer still free incase you used it as disposable RAM. The hack is done by scrapping two sectors reserved for E-Reader and Mystery Gift/Trainer tower.

    The Ereader feature isn't present in EM, and I don't think anyone will really miss the Mystery Gift/Trainer tower features as I haven't seen any hacks making use of it. I've attached a patch to this post and the source code is available here: https://github.com/EternalCode/Save_Expansion


    Notes


    - The saveblock starts from 0x0203B174 and ends at 0x0203E018, for 11940 bytes.

    - This hack is compatible with JPAN's saveblock hack. He hooked into functions, I rewrote them so there should be nothing to remove. My hack will just replace his. As always make a back up.

    - Compatibility with Jambo51's vars and flags expansion https://www.pokecommunity.com/showpost.php?p=9971546&postcount=2

    - This hack takes up 0x6D4 bytes currently. The patch will insert it at 09700000. Compile from source to freely change insertion location.

    Credits

    - Please include JPAN in your credits for his idea
    - Pret team for their research
     
    Last edited:

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Hey, bumping this to say that Jambo's expansion (https://www.pokecommunity.com/showthread.php?t=302476) is compatible with this hack. I do recommend a couple of tweaks, they're not mandatory, but definitely recommended.
    .align
    memoryblock: .word 0x0203C000
    This is in the flags routine. You probably don't want to do this, as that is somewhere near the middle of the save area. Instead change this address in his hack to 0x0203B174 so it reflects the start of the save area.

    Similarly:
    .align
    memoryblock: .word 0x0203C200
    You probably want this changed to be "0x0203B174 + 0x200". You can leave it there as an expression.
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • JPAN's saveblock patch breaks flashcart capability. You can disable the Previously On Your Quest system and free up enough free ram for the bag, and since that ram gets saved by the game you can keep your items after turning the power off.

    I haven't tested mine on hardware because well I don't own a GBA. However, I did test on a few emulators, namely VBA-M and mGBA. It seems to retain the save fine.

    Would be nice if you can test it on hardware/phone :)
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Hi, sorry for the bump. My friend Jiang found a bug with this a few months ago which resulted in a clean Fire Red ROM not being able to load the save properly. The issue was that I was testing on my own ROM, and the sector checksum there was non-zero for each sector. On a clean ROM this wasn't the case. The bug resulted due to a "typo" which coincidentally worked for most ROMs that weren't fresh. You can find the most recent commit changes here: https://github.com/EternalCode/Dark-Wish/commit/1329ddaeb16e98c5fbabd30da0462d5f221d21b9

    I've updated the repository, but I haven't the time to update the patches to incorporate this fix. Anyone who is able to post a patch for others, I encourage to do so. Important: It's my understanding that a major project by Skeli and Ghoulslash borrows this work (CFRU), so if you're using their work you'll need to update once they've made the updates themselves.

    Thanks and sorry for the inconvenience.
     

    Skeli

    Lord of the Rings
    300
    Posts
    10
    Years
  • I've updated the repository, but I haven't the time to update the patches to incorporate this fix. Anyone who is able to post a patch for others, I encourage to do so. Important: It's my understanding that a major project by Skeli and Ghoulslash borrows this work (CFRU), so if you're using their work you'll need to update once they've made the updates themselves.
    To anyone who uses the CFRU, this bug was fixed months ago. It is no longer present in the current build.
     
    Back
    Top