From 80985df175f67ea1b90772d2d82c5f97bda44106 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 14 Oct 2017 22:16:21 -0400 Subject: sub_8123244 --- include/cable_car_util.h | 12 ++++++++++ include/field_weather.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ include/gba/macro.h | 30 ++++++++++++++++++++++++ include/global.h | 1 + 4 files changed, 103 insertions(+) create mode 100644 include/cable_car_util.h (limited to 'include') diff --git a/include/cable_car_util.h b/include/cable_car_util.h new file mode 100644 index 000000000..0f50914c8 --- /dev/null +++ b/include/cable_car_util.h @@ -0,0 +1,12 @@ +#ifndef GUARD_CABLE_CAR_UTIL_H +#define GUARD_CABLE_CAR_UTIL_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations + +void sub_8124F08(u16 *dest, const u16 *src, u8 x, u8 y, u8 width, u8 height); + +#endif //GUARD_CABLE_CAR_UTIL_H diff --git a/include/field_weather.h b/include/field_weather.h index 409f76028..790fadaea 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -47,4 +47,64 @@ bool8 sub_807DDFC(void); void SetWeather(u32); void UpdateWeatherPerDay(u16); +struct WeatherSubstruct { + u8 filler_0[5]; + u8 unk_5_0:2; + u8 unk_5_2:2; + u8 unk_5_4:4; +}; + +struct Weather +{ + u8 filler_000[0xf0]; + struct WeatherSubstruct *unk_0f0[20]; + u8 filler_140[0xc0]; + u8 unknown_200[2][32]; + u8 filler_240[0x480]; + s8 unknown_6C0; + s8 unknown_6C1; + u8 unknown_6C2; + u8 unknown_6C3; + u16 unknown_6C4; + u8 unknown_6C6; + u8 unknown_6C7; + u8 unknown_6C8; + u8 unknown_6C9; + u8 unknown_6CA; + u8 unknown_6CB; + u8 filler_6CC[2]; + u16 unknown_6CE; + u8 unknown_6D0; + u8 unknown_6D1; + u8 filler_6D2[1]; + u8 unknown_6D3; + u8 unknown_6D4; + u8 unknown_6D5; + u8 filler_6D6[2]; + u8 unknown_6D8; + u8 filler_6D9[1]; + u8 unknown_6DA; + u8 filler_6DB[3]; + u8 unknown_6DE; + u8 filler_6DF[5]; + u8 unknown_6E4; + u8 filler_6E5[0x15]; + u8 unknown_6FA; + u8 unknown_6FB; + u8 filler_6FC[4]; + u8 unknown_700; + u8 filler_701[0x15]; + u8 unknown_716; + u8 unknown_717; + u8 filler_718[0xc]; + u8 unknown_724; + u8 filler_725[9]; + u8 unknown_72E; +}; + +#define gWeather gUnknown_0202F7E8 +extern struct Weather gWeather; + +extern struct Weather *const gUnknown_08396FC4; + #endif // GUARD_WEATHER_H diff --git a/include/gba/macro.h b/include/gba/macro.h index 1e0254806..71ff15590 100644 --- a/include/gba/macro.h +++ b/include/gba/macro.h @@ -118,4 +118,34 @@ #define DmaCopy16Defvars(dmaNum, src, dest, size) DmaCopyDefvars(dmaNum, src, dest, size, 16) #define DmaCopy32Defvars(dmaNum, src, dest, size) DmaCopyDefvars(dmaNum, src, dest, size, 32) +#define DmaFillLarge(dmaNum, fillval, dest, size, block, bit) \ +{ \ + void *_dest = dest; \ + u32 _size = (u32)(size); \ + while (1) \ + { \ + DmaFill##bit(dmaNum, fillval, _dest, (block)); \ + _dest += (block); \ + _size -= (block); \ + if (_size <= (block)) \ + { \ + DmaFill##bit(dmaNum, fillval, _dest, _size); \ + break; \ + } \ + } \ +} + +#define DmaFill16Large(dmaNum, fillval, dest, size, block) DmaFillLarge(dmaNum, fillval, dest, size, block, 16) +#define DmaFill32Large(dmaNum, fillval, dest, size, block) DmaFillLarge(dmaNum, fillval, dest, size, block, 32) + +#define DmaFillDefvars(dmaNum, fillval, dest, size, bit) \ +{ \ + void *_dest = dest; \ + u32 _size = (u##bit)(size); \ + DmaFill##bit(dmaNum, fillval, _dest, _size); \ +} + +#define DmaFill16Defvars(dmaNum, fillval, dest, size) DmaFillDefvars(dmaNum, fillval, dest, size, 16) +#define DmaFill32Defvars(dmaNum, fillval, dest, size) DmaFillDefvars(dmaNum, fillval, dest, size, 32) + #endif // GUARD_GBA_MACRO_H diff --git a/include/global.h b/include/global.h index f0eb7401f..4604c8cbb 100644 --- a/include/global.h +++ b/include/global.h @@ -799,5 +799,6 @@ struct HallOfFame extern struct HallOfFame gHallOfFame; extern struct SaveBlock2 gSaveBlock2; +extern u8 ewram[]; #endif // GUARD_GLOBAL_H -- cgit v1.2.3 From b833bf304963f92de2670529d1d9083180ade9ba Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 14 Oct 2017 22:34:01 -0400 Subject: sub_8123740 --- include/gba/macro.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/gba/macro.h b/include/gba/macro.h index 71ff15590..a183a44fc 100644 --- a/include/gba/macro.h +++ b/include/gba/macro.h @@ -87,7 +87,7 @@ #define DmaCopyLarge(dmaNum, src, dest, size, block, bit) \ { \ const void *_src = src; \ - void *_dest = dest; \ + void *_dest = (void *)(dest); \ u32 _size = size; \ while (1) \ { \ @@ -110,7 +110,7 @@ #define DmaCopyDefvars(dmaNum, src, dest, size, bit) \ { \ const void *_src = src; \ - void *_dest = dest; \ + void *_dest = (void *)(dest); \ u32 _size = size; \ DmaCopy##bit(dmaNum, _src, _dest, _size); \ } @@ -120,8 +120,8 @@ #define DmaFillLarge(dmaNum, fillval, dest, size, block, bit) \ { \ - void *_dest = dest; \ - u32 _size = (u32)(size); \ + void *_dest = (void *)(dest); \ + u32 _size = (u32)(size); \ while (1) \ { \ DmaFill##bit(dmaNum, fillval, _dest, (block)); \ @@ -140,7 +140,7 @@ #define DmaFillDefvars(dmaNum, fillval, dest, size, bit) \ { \ - void *_dest = dest; \ + void *_dest = (void *)(dest); \ u32 _size = (u##bit)(size); \ DmaFill##bit(dmaNum, fillval, _dest, _size); \ } -- cgit v1.2.3 From 89904a0f2492e9e579b7478c4a66cc547027cf48 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 14 Oct 2017 23:07:27 -0400 Subject: sub_8123878 --- include/field_weather.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'include') diff --git a/include/field_weather.h b/include/field_weather.h index 790fadaea..b51c47de7 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -47,17 +47,10 @@ bool8 sub_807DDFC(void); void SetWeather(u32); void UpdateWeatherPerDay(u16); -struct WeatherSubstruct { - u8 filler_0[5]; - u8 unk_5_0:2; - u8 unk_5_2:2; - u8 unk_5_4:4; -}; - struct Weather { u8 filler_000[0xf0]; - struct WeatherSubstruct *unk_0f0[20]; + struct Sprite *unk_0f0[20]; u8 filler_140[0xc0]; u8 unknown_200[2][32]; u8 filler_240[0x480]; -- cgit v1.2.3 From 91a171ff93f10ba185a826257c5b1f2564e59a22 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 14 Oct 2017 23:40:20 -0400 Subject: sub_81239E4 --- include/cable_car_util.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/cable_car_util.h b/include/cable_car_util.h index 0f50914c8..76198af02 100644 --- a/include/cable_car_util.h +++ b/include/cable_car_util.h @@ -8,5 +8,6 @@ // Exported ROM declarations void sub_8124F08(u16 *dest, const u16 *src, u8 x, u8 y, u8 width, u8 height); +void sub_8124E7C(u16 *dest, u16 a1, u8 a2, u8 a3, u8 a4, u8 a5); #endif //GUARD_CABLE_CAR_UTIL_H -- cgit v1.2.3 From acf2820efce9893e71700c8892b00f9acceb9477 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 15 Oct 2017 10:18:11 -0400 Subject: sub_8123AF8 --- include/field_weather.h | 3 ++- include/global.h | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/field_weather.h b/include/field_weather.h index b51c47de7..d3b1f4ffd 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -84,7 +84,8 @@ struct Weather u8 filler_6E5[0x15]; u8 unknown_6FA; u8 unknown_6FB; - u8 filler_6FC[4]; + u16 unknown_6FC; + u8 filler_6FE[2]; u8 unknown_700; u8 filler_701[0x15]; u8 unknown_716; diff --git a/include/global.h b/include/global.h index 4604c8cbb..a22f0d817 100644 --- a/include/global.h +++ b/include/global.h @@ -14,9 +14,9 @@ #define INCBIN_S8 {0} #define INCBIN_S16 {0} #define INCBIN_S32 {0} -void * memcpy (void *, const void *, size_t); -void * memset (void *, int, size_t); -int strcmp (const char *, const char *); +void *memcpy (void *, const void *, size_t); +void *memset (void *, int, size_t); +int strcmp (const char *, const char *); #endif // Prevent cross-jump optimization. -- cgit v1.2.3 From 259d0cfc75f03da9b2e9f02d45810bb4eb7de12a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 15 Oct 2017 11:00:34 -0400 Subject: sub_8123CB8 --- include/sprite.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include') diff --git a/include/sprite.h b/include/sprite.h index 769e1584d..68bb0b0e1 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -120,10 +120,6 @@ union AffineAnimCmd {.jump = {.type = AFFINEANIMCMDTYPE_JUMP, .target = _target}} #define AFFINEANIMCMD_END \ {.type = AFFINEANIMCMDTYPE_END} -#define AFFINEANIMCMD_LOOP(_count) \ - {.loop = {.type = AFFINEANIMCMDTYPE_LOOP, .count = _count}} -#define AFFINEANIMCMD_JUMP(_target) \ - {.jump = {.type = AFFINEANIMCMDTYPE_JUMP, .target = _target}} struct AffineAnimState { -- cgit v1.2.3 From 319eb710ed84f816b7c8194b35c53a8d32e916c5 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 5 Jan 2018 21:13:50 -0500 Subject: through sub_81245F4 --- include/cable_car_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/cable_car_util.h b/include/cable_car_util.h index 76198af02..d109190b0 100644 --- a/include/cable_car_util.h +++ b/include/cable_car_util.h @@ -7,7 +7,7 @@ // Exported ROM declarations -void sub_8124F08(u16 *dest, const u16 *src, u8 x, u8 y, u8 width, u8 height); -void sub_8124E7C(u16 *dest, u16 a1, u8 a2, u8 a3, u8 a4, u8 a5); +void sub_8124F08(void *dest, const u16 *src, u8 x, u8 y, u8 width, u8 height); +void sub_8124E7C(void *dest, u16 a1, u8 a2, u8 a3, u8 a4, u8 a5); #endif //GUARD_CABLE_CAR_UTIL_H -- cgit v1.2.3 From fe7e54d6d8d158409316af91ca4e119a6af73faf Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 5 Jan 2018 21:37:20 -0500 Subject: Make static what can be made static --- include/graphics.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index 17abb840e..32f3a1c1f 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2703,4 +2703,11 @@ extern const u16 gUnknown_08E95A18[]; extern const u16 gUnknown_08E95AB8[]; extern const u16 gUnknown_08E95FB8[]; +extern const u8 gCableCar_Gfx[]; +extern const u8 gCableCarDoor_Gfx[]; +extern const u8 gCableCarCord_Gfx[]; +extern const u16 gCableCar_Pal[]; +extern const u16 gCableCarBG_Pal[]; +extern const u8 gCableCarBG_Gfx[]; + #endif // GUARD_GRAPHICS_H -- cgit v1.2.3 From e28c11ef9518c80e23ce0076b8ba9be4cb140015 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 5 Jan 2018 23:07:57 -0500 Subject: Update delcarations of cable car util funtions --- include/cable_car_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/cable_car_util.h b/include/cable_car_util.h index d109190b0..f1f52bb3c 100644 --- a/include/cable_car_util.h +++ b/include/cable_car_util.h @@ -7,7 +7,7 @@ // Exported ROM declarations -void sub_8124F08(void *dest, const u16 *src, u8 x, u8 y, u8 width, u8 height); -void sub_8124E7C(void *dest, u16 a1, u8 a2, u8 a3, u8 a4, u8 a5); +void sub_8124F08(u16 dest[][32], const u16 *src, u8 x, u8 y, u8 width, u8 height); +void sub_8124E7C(u16 dest[][32], u16 a1, u8 a2, u8 a3, u8 a4, u8 a5); #endif //GUARD_CABLE_CAR_UTIL_H -- cgit v1.2.3 From 8d035c81528d172570338ec82c07770e7ebcfe50 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 5 Jan 2018 22:15:05 -0700 Subject: cable car util --- include/cable_car_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/cable_car_util.h b/include/cable_car_util.h index f1f52bb3c..7126331a1 100644 --- a/include/cable_car_util.h +++ b/include/cable_car_util.h @@ -7,7 +7,7 @@ // Exported ROM declarations -void sub_8124F08(u16 dest[][32], const u16 *src, u8 x, u8 y, u8 width, u8 height); -void sub_8124E7C(u16 dest[][32], u16 a1, u8 a2, u8 a3, u8 a4, u8 a5); +void CableCarUtil_FillWrapped(void *dest, u16 value, u8 x, u8 y, u8 width, u8 height); +void CableCarUtil_CopyWrapped(void *dest, const u16 *src, u8 x, u8 y, u8 width, u8 height); #endif //GUARD_CABLE_CAR_UTIL_H -- cgit v1.2.3 From b3551bc2f328c286c6ecc45ea288665d46b44260 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 6 Jan 2018 12:27:27 -0600 Subject: fix some code and formatting anomalies --- include/battle.h | 10 ---- include/contest.h | 167 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ include/ewram.h | 1 - 3 files changed, 167 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 0881cf82c..0824fc46c 100644 --- a/include/battle.h +++ b/include/battle.h @@ -368,16 +368,6 @@ struct Struct2017100 u32 arr[4]; }; -struct Struct2019348 -{ - u16 unk0; - u16 unk2; - u8 unk4; - u32 unk8; - u32 unkC; - u32 unk10; -}; - struct Struct2017800 { u8 invisible:1; diff --git a/include/contest.h b/include/contest.h index 10392c00e..6e71358a2 100644 --- a/include/contest.h +++ b/include/contest.h @@ -87,4 +87,171 @@ bool8 Contest_SaveWinner(u8); u8 sub_80B2C4C(u8, u8); void Contest_ResetWinners(void); +// Contest Shared EWRAM + +struct Shared18000 +{ + /*0x18000*/ u8 unk18000; + /*0x18001*/ u8 filler18001[3]; + /*0x18004*/ u16 unk18004[16][16]; + /*0x18204*/ u16 unk18204[0x200]; + /*0x18604*/ u16 unk18604[0x200]; + /*0x18A04*/ u8 unk18A04[0x800]; +}; + +struct Contest +{ + /*0x19204*/ u8 playerMoveChoice; + /*0x19205*/ u8 turnNumber; + /*0x19206*/ u8 unk19206[4]; // seems to only be used by an unref function + /*0x1920A*/ u16 unk1920A_0:1; // Task active flags? + u16 unk1920A_1:1; + u16 unk1920A_2:1; + u16 unk1920A_3:1; + u16 unk1920A_4:1; + u16 unk1920A_5:1; + u16 unk1920A_6:1; + u16 unk1920A_7:1; + /*0x1920B*/ u16 unk1920B_0:1; + u16 unk1920B_1:1; + u16 unk1920B_2:1; + /*0x1920C*/ u8 mainTaskId; + /*0x1920D*/ u8 unk1920D[4]; + /*0x19211*/ u8 unk19211; + /*0x19212*/ u8 unk19212; + /*0x19213*/ u8 filler19213; + /*0x19214*/ u8 unk19214; + /*0x19215*/ u8 unk19215; + /*0x19216*/ u8 unk19216; // sprite ID + /*0x19217*/ s8 applauseLevel; + /*0x19218*/ u8 unk19218[4]; + /*0x1921C*/ u32 unk1921C; // saved RNG value? + u16 unk19220[5][4]; // move history? + u8 unk19248[5][4]; // excitement history + u8 applauseMeterSpriteId; // sprite ID + /*0x1925D*/ u8 unk1925D; + /*0x1925E*/ u8 unk1925E; +}; + +struct ContestantStatus +{ + s16 appeal1; // move appeal? + s16 appeal2; // final appeal after end of turn, maybe? + s16 unk4; + u16 currMove; + u16 prevMove; + u8 moveCategory; + u8 unkB_0:2; + u8 unkB_2:2; + u8 moveRepeatCount:3; + u8 unkB_7:1; // used a one-time move? + u8 unkC_0:1; + u8 unkC_1:2; + s8 unkD; + u8 unkE; + u8 unkF; + u8 unk10_0:1; + u8 unk10_1:1; + u8 unk10_2:1; + u8 unk10_3:1; + u8 unk10_4:2; + u8 unk10_6:2; + u8 unk11_0:2; + u8 unk11_2:1; + u8 unk11_3:1; + u8 unk11_4:1; + u8 unk11_5:1; + u8 unk12; + u8 unk13; // status action? + u8 unk14; + u8 disappointedRepeat:1; + u8 unk15_1:1; + u8 unk15_2:1; + u8 unk15_3:1; + u8 unk15_4:1; + u8 unk15_5:1; + u8 unk15_6:1; + u8 unk16; + u8 unk17; + u8 unk18; + u8 unk19; // turn position + u8 attentionLevel; // How much the Pokemon "stood out" + u8 unk1B; +}; + +struct UnknownContestStruct3 +{ + u8 unk0; + u8 unk1; + //u8 unk2_0:1; + //u8 unk2_1:1; + u8 unk2; // maybe a bitfield + u8 filler3; +}; + +// possibly the same as UnknownContestStruct3? +struct UnknownContestStruct4 +{ + u8 unk0; // sprite ID + u8 unk1; // sprite ID + u8 unk2_0:1; + u8 unk2_1:1; + u8 unk2_2:1; + u8 filler3; +}; + +struct UnknownContestStruct5 +{ + s8 bits_0; // current move excitement? + u8 bits_8:1; + u8 bits_9:3; + u8 bits_C:4; + s8 unk2; + u8 filler3; +}; + +struct UnknownContestStruct7 +{ + u8 unk0[4]; + u16 unk4; + u16 unk6; + u8 filler8[0xD-8]; + u8 unkD[4]; + u8 unk11; + u8 filler12[2]; +}; + +struct UnknownContestStruct8 +{ + u16 unk0; + u16 unk2; + u8 unk4_0:1; + u8 unk5; + u8 filler6[2]; + u32 unk8; + u32 unkC; + u32 unk10; +}; + +struct UnknownContestStruct6 +{ + s32 unk0; + s32 unk4; + s32 unk8; + s32 unkC; +}; + +#define shared15800 (gSharedMem + 0x15800) +#define shared15DE0 (*(struct ContestWinner *)(gSharedMem + 0x15DE0)) +#define shared16800 (gSharedMem + 0x16800) +#define shared18000 (*(struct Shared18000 *)(gSharedMem + 0x18000)) +#define shared18004 ((u16 *)(gSharedMem + 0x18004)) +#define sContest (*(struct Contest *)(gSharedMem + 0x19204)) +#define sContestantStatus ((struct ContestantStatus *)(gSharedMem + 0x19260)) +#define shared192D0 (*(struct UnknownContestStruct7 *)(gSharedMem + 0x192D0)) +#define shared192E4 (gSharedMem + 0x192E4) +#define shared19328 (*(struct UnknownContestStruct5 *)(gSharedMem + 0x19328)) +#define shared19338 ((struct UnknownContestStruct4 *)(gSharedMem + 0x19338)) +#define shared19348 (*(struct UnknownContestStruct8 *)(gSharedMem + 0x19348)) + #endif // GUARD_CONTEST_H diff --git a/include/ewram.h b/include/ewram.h index 5a350840a..60fa43b41 100755 --- a/include/ewram.h +++ b/include/ewram.h @@ -215,7 +215,6 @@ extern u8 gSharedMem[]; #define ewram19000 (&gSharedMem[0x19000]) #define ePokedexView3 (struct PokedexView *)(gSharedMem + 0x19000) #define EWRAM_19348 (*(u16 *)(gSharedMem + 0x19348)) -#define ewram19348 (*(struct Struct2019348 *)(gSharedMem + 0x19348)) #define ewram19800 (&gSharedMem[0x19800]) #define ePokedexView4 (struct PokedexView *)(gSharedMem + 0x19800) #define ewram1A000 (&gSharedMem[0x1A000]) -- cgit v1.2.3