• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

Research: Memory allocation system

knizz

  • 192
    Posts
    17
    Years
    • Seen Oct 28, 2020
    Game Freak removed all debug-strings from the final game except those for malloc/free. I found out that allocated blocks have this format:

    0x00 / Halfword / Flag / 01 00 = used, 00 00 = unused
    0x02 / Halfword / Magic-number / Always A3 A3
    0x04 / Word / Idk but not a pointer, probably the size of the data
    0x08 / Word / Pointer to the previous block
    0x0C / Word / Pointer to the next block
    0x10 / Depends / Data
     
    Last edited:
    [jq]"malloc_and_clear"[/jq]
    so, this would be...
    free(ptr);
    ptr = malloc(nSize);
    ??
     
    Back
    Top