• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

[ASM & Hex] Is there anything more to finding free space?

  • 19
    Posts
    8
    Years
    • Seen Sep 9, 2020
    Hi, I'm recently new here and was having a doubt regarding free space in roms.

    I have used HackMew's FSF, which seem to be very common, it is a simple and nice tool and one that I have always opened. My doubt though is regarding to how it works. Is it just finding the first x number of FF bytes together?

    I ran the tool looking from the start of the rom, at 0x0000D0 there are 0x30 FF bytes there, however, when I ask FF to get 25 bytes it send me a good way down from there.

    Why is this happening? Is this expected? Is it a safe mechanism to discourage writing in the first part of the rom? Or are free bytes counted differently? I am asking this mostly because I am planning on writing some code that does this and wanted to know all the rules about free space finding in roms.
     
    Yes, FSF just finds the first X number of FF bytes together, just like you said.

    The ROMs use most of the space up to 0x800000, with little pockets of free space bytes sprinkled throughout. Mostly these are just like any other free space, but I believe some of them are actually not safe to use as they terminate tables (but don't quote me on that).

    For simplicity, it's usually encouraged to start using free space at 0x800000. That way, you can easily separate the vanilla ROM's code from your own, and there's plenty of space that you should never have to worry.
     
    Sounds like the tool has a bug *not suprised*
    You could just bust out the ROM in a hex editor and find the free space yourself.

    I suspect there is an invisible minimum amount of bytes (say 50 or so) that it will look for to avoid accidentally reading data as free space.
     
    I suspect there is an invisible minimum amount of bytes (say 50 or so) that it will look for to avoid accidentally reading data as free space.

    That would impose the rule for both cases though. It sounds like a bug in which it started looking for free space without seeking back to the start of the ROM for repeated searches.
     
    Back
    Top