From 832be348989967b15ae813180b22640d7da732ab Mon Sep 17 00:00:00 2001 From: tustin2121 Date: Sun, 20 Sep 2020 01:50:54 -0400 Subject: More documenting trainer hill - Renamed members and added comments in the TrHillDisplay struct. - Formatted the trainer hill data to better match the metatile layout its representing. - Documented the function which uses this data. --- include/trainer_hill.h | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'include/trainer_hill.h') diff --git a/include/trainer_hill.h b/include/trainer_hill.h index 3f0644248..94d29a7ca 100644 --- a/include/trainer_hill.h +++ b/include/trainer_hill.h @@ -8,10 +8,10 @@ struct TrainerHillTrainer u8 name[HILL_TRAINER_NAME_LENGTH]; u8 facilityClass; u32 unused; - u16 speechBefore[6]; - u16 speechWin[6]; - u16 speechLose[6]; - u16 speechAfter[6]; + u16 speechBefore[EASY_CHAT_BATTLE_WORDS_COUNT]; + u16 speechWin[EASY_CHAT_BATTLE_WORDS_COUNT]; + u16 speechLose[EASY_CHAT_BATTLE_WORDS_COUNT]; + u16 speechAfter[EASY_CHAT_BATTLE_WORDS_COUNT]; struct BattleTowerPokemon mons[PARTY_SIZE]; }; @@ -23,11 +23,19 @@ struct TrHillRoomTrainers struct TrHillDisplay { - u8 data[0x100]; - u16 unk3A0[16]; - u8 coords[2]; // x first 4 bits, y last 4 bits - u8 direction; // array of 4 bits for each trainer - u8 range; // array of 4 bits for each trainer + // Metatile data. Add 0x200 to the values in this array to get metatiles. + // This data then overwrites the metatiles in the map starting at (0,5) + u8 metatileData[0x100]; + // Collision data. One bit for each tile in column-major order, + // so every array entry is one row. 1 = impassable, 0 = passable + u16 collisionData[16]; + // Trainer coordinates, starting at (0,6). Format is 0bYYYYXXXX. + u8 coords[2]; + // Trainer facing directions. Same as (DIR_* - 1). + // Effectively an array of nibbles, one for each trainer. + u8 direction; + // Trainer sight ranges. Effectively an array of nibbles, one for each trainer. + u8 range; }; struct TrHillFloor -- cgit v1.2.3