Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I want to replace the last parameter of this multistruct with a macro.
- const struct SaveSectionLocation gSaveSectionLocations[] =
- {
- {((u8 *) &gSaveBlock2), 0x890},
- {((u8 *) &gSaveBlock1) + 0xF80 * 0, 0xF80},
- {((u8 *) &gSaveBlock1) + 0xF80 * 1, 0xF80},
- {((u8 *) &gSaveBlock1) + 0xF80 * 2, 0xF80},
- {((u8 *) &gSaveBlock1) + 0xF80 * 3, 0xC40},
- {((u8 *) &gPokemonStorage) + 0xF80 * 0, 0xF80},
- {((u8 *) &gPokemonStorage) + 0xF80 * 1, 0xF80},
- {((u8 *) &gPokemonStorage) + 0xF80 * 2, 0xF80},
- {((u8 *) &gPokemonStorage) + 0xF80 * 3, 0xF80},
- {((u8 *) &gPokemonStorage) + 0xF80 * 4, 0xF80},
- {((u8 *) &gPokemonStorage) + 0xF80 * 5, 0xF80},
- {((u8 *) &gPokemonStorage) + 0xF80 * 6, 0xF80},
- {((u8 *) &gPokemonStorage) + 0xF80 * 7, 0xF80},
- {((u8 *) &gPokemonStorage) + 0xF80 * 8, 0x7D0}
- };
- For the intended macro being GETCHUNKSIZE(chunk, n), The formula to figure out the constant is:
- if (sizeof(chunk) - (0xF80 * (n - 1))) >= 0xF80
- return 0xF80
- else
- sizeof(chunk) // can optimize
- Can I define this using a macro? the check itself isn't in the compiled ROM, these are hardcoded attributes. However, I would like to calculate them on the fly using a macro/define. Any way to do this?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement