Things to consider changing
DizzyEggg opened this issue · comments
- Move #define HEAP_SIZE 0x1C000 from global.h to malloc.h, ✅
- Rename malloc.h to alloc.h.✅
- Create a define for number of moves a pokemon can have at once. So far, we've just been using a raw number 4.
- There is BATTLE_STATS_NO and NUM_STATS, these should be standardized, I think. ✅
- Move struct Bitmap defnition from global.h to blit.h. ✅
- Rename struct Window's field from priority to bg. ✅
- Change all const Window Templates to show struct fields instead of raw bytes(applies to other structs too). ✅
- Use EOS in string_util.c, text.c and other early decompiled files. ✅
- Fix gpu regs arguments from raw values to defines. in early decompiled files.
- Gamefreak likes to use 0xFF, 0xFFFF and -1 for values that are invalid/wrong/out of bounds. I've been thinking of creating a series of macros such as INVALID_U16, INVALID_S16, INVALID_U8, etc. as I think they're betten than just a raw 0xFF. ❌ Scrapped, it is a bad idea, makes the code less readable.
- Use MAX_SPRITES macro instead of raw 64 ✅
I made this issue, because I sometimes think of things to improve but forget them afterwards. I may come up with other ideas, so I'll just add another id. Please tell me what you think about these changes.
As for 3, we actually do have a define for that, MAX_MON_MOVES in battle.h. If it's not being used then that needs to be fixed.