diff --git a/data/data.s b/data/data.s index a097dbae4..22d2638ad 100644 --- a/data/data.s +++ b/data/data.s @@ -2,9 +2,6 @@ .align 2, 0 -@ ??? -.string "pksdir0\0" - @ ??? .string "pksdir0\0" .fill 28, 1, 0 diff --git a/include/code_8002774.h b/include/code_8002774.h index 0a47a6be3..69e492d90 100644 --- a/include/code_8002774.h +++ b/include/code_8002774.h @@ -3,18 +3,6 @@ #include "structs/str_position.h" -#define UNK_STRUCT_ARR_COUNT 4 - -struct S_sub -{ - u8 x0[UNK_STRUCT_ARR_COUNT]; -}; - -struct S -{ - struct S_sub x0; -}; - void sub_800290C(PixelPos *param_1, s32 param_2); void sub_8002934(PixelPos *param_1, PixelPos *param_2, PixelPos *param_3, s32 param_4, s32 param_5); s32 sub_8002A70(s32 a0, s32 a1, s32 a2); @@ -22,7 +10,5 @@ s32 sub_8002B04(s32, s32); s32 VecDirection8Radial(PixelPos *param_1); s8 SizedDeltaDirection4(const PixelPos *r0, const PixelPos *r1, const PixelPos *r2, const PixelPos *r3); s8 SizedDeltaDirection8(const PixelPos *r0, const PixelPos *r1, const PixelPos *r2, const PixelPos *r3); -struct S sub_80027A0(u16 a0); -u16 sub_8002774(struct S_sub s); #endif // GUARD_CODE_8002774_H diff --git a/include/code_8099360.h b/include/code_8099360.h index 7a02d7385..6c6c46187 100644 --- a/include/code_8099360.h +++ b/include/code_8099360.h @@ -15,12 +15,12 @@ extern void sub_8099690(u32); // code_8099360.s -#include "structs/str_3000400.h" +#include "structs/rgb.h" void sub_8099744(void); void sub_8099750(void); -void sub_8099A5C(s32 a0, s32 a1, struct S_sub a2); -void sub_8099AFC(s32 a0, s32 a1, struct S_sub a2); +void sub_8099A5C(s32 a0, s32 a1, RGB_Array a2); +void sub_8099AFC(s32 a0, s32 a1, RGB_Array a2); bool8 sub_8099B94(void); #endif //GUARD_CODE_8099360_H diff --git a/include/gba_color_util.h b/include/gba_color_util.h new file mode 100644 index 000000000..421145f2f --- /dev/null +++ b/include/gba_color_util.h @@ -0,0 +1,9 @@ +#ifndef GUARD_GBA_COLOR_UTIL_H +#define GUARD_GBA_COLOR_UTIL_H + +#include "structs/rgb.h" + +u16 RGBToGbaColor(RGB_Array s); +RGB_Array GbaColorToRGB(u16 color); + +#endif // GUARD_GBA_COLOR_UTIL_H diff --git a/include/palette_util.h b/include/palette_util.h index d64365f43..031a2feba 100644 --- a/include/palette_util.h +++ b/include/palette_util.h @@ -1,7 +1,7 @@ #ifndef GUARD_PALETTE_UTIL_H #define GUARD_PALETTE_UTIL_H -#include "structs/str_3000400.h" +#include "structs/rgb.h" void sub_8099744(void); void sub_8099750(void); @@ -15,8 +15,8 @@ void sub_80999FC(s32 a0); void sub_8099A10(s32 a1, u16 a2, u16 a3); void sub_8099A34(s32 a0); void sub_8099A48(s32 a0); -void sub_8099A5C(s32 a0, s32 a1, struct S_sub a2); -void sub_8099AFC(s32 a0, s32 a1, struct S_sub a2); +void sub_8099A5C(s32 a0, s32 a1, RGB_Array a2); +void sub_8099AFC(s32 a0, s32 a1, RGB_Array a2); bool8 sub_8099B94(void); void sub_8099BE4(void); diff --git a/include/structs/rgb.h b/include/structs/rgb.h index 7fee2c50c..14438a8df 100644 --- a/include/structs/rgb.h +++ b/include/structs/rgb.h @@ -9,4 +9,21 @@ typedef struct RGB u8 unk4; // Never read, always 0x80. Unused transparency/alpha flag? } RGB; +#define RGB_R 0 +#define RGB_G 1 +#define RGB_B 2 +#define RGB_UNK 3 +#define RGB_FIELDS_COUNT 4 + +typedef struct RGB_Array +{ + u8 c[RGB_FIELDS_COUNT]; +} RGB_Array; + +typedef union RGB_Union +{ + RGB_Array asArr; + RGB separate; +} RGB_Union; + #endif // GUARD_RGB_H diff --git a/include/structs/str_3000400.h b/include/structs/str_3000400.h deleted file mode 100644 index 3912eb523..000000000 --- a/include/structs/str_3000400.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef GUARD_STR_3000400_H -#define GUARD_STR_3000400_H - -#include "code_8002774.h" - -#endif // GUARD_STR_3000400_H diff --git a/ld_script.ld b/ld_script.ld index bd77ada06..91b1ae509 100755 --- a/ld_script.ld +++ b/ld_script.ld @@ -50,6 +50,7 @@ SECTIONS { src/arm_funcs.o(.text); src/main_loops.o(.text); src/event_flag.o(.text); + src/gba_color_util.o(.text); src/code_8002774.o(.text); src/memory.o(.text); src/code_80035F0.o(.text); @@ -430,6 +431,7 @@ SECTIONS { src/main_loops.o(.rodata); src/event_flag.o(.rodata); src/script_vars_info.o(.rodata); + src/gba_color_util.o(.rodata); data/data.o(.rodata); src/code_8002774.o(.rodata); data/pksdir_5.o(.rodata); diff --git a/src/code_8002774.c b/src/code_8002774.c index a94f5dfa0..4c0175283 100644 --- a/src/code_8002774.c +++ b/src/code_8002774.c @@ -20,59 +20,6 @@ const PixelPos gVectorDirections[NUM_DIRECTIONS] = { static s8 VecDirection4Radial(PixelPos *pixelPos); -u16 sub_8002774(struct S_sub s) -{ - return ((s.x0[2] & 0xF8) << 7) | ((s.x0[1] & 0xF8) << 2) | ((s.x0[0] & 0xF8) >> 3); -} - -struct S sub_80027A0(u16 a0) -{ - struct S ret; - - ret.x0.x0[0] = (a0 & 0x1F) << 3 | ((a0 & 1) ? 7 : 0); - ret.x0.x0[1] = (a0 & 0x3E0) >> 2 | ((a0 & 0x20) ? 7 : 0); - ret.x0.x0[2] = (a0 & 0x7C00) >> 7 | ((a0 & 0x400) ? 7 : 0); - ret.x0.x0[3] = 0; - return ret; -} - -UNUSED static void sub_8002804(struct S *r0, s32 r1, struct S *r2) -{ - s32 i; - - for (i = 0; i < UNK_STRUCT_ARR_COUNT; i++) { - r0->x0.x0[i] = (r1 * r2->x0.x0[i]) / 256; - } -} - -UNUSED static void sub_800282C(struct S *dst, s32 a1, struct S *a2, struct S *a3) -{ - s32 i, j; - float spFloats[4]; - float floatsMul[4]; - float f0 = 1.0f / a1; - - for (i = 0; i < 4; i++) { - s8 asSigned = (s8) a2->x0.x0[i]; - float f = (float)(asSigned); - if (asSigned < 0) { - f += 256.0f; - } - spFloats[i] = f; - floatsMul[i] = (float)(a3->x0.x0[i] - a2->x0.x0[i]) * f0; - } - - *dst++ = *a2; - for (i = 1; i < a1 - 1; dst++, i++) { - for (j = 0; j < 4; j++) { - dst->x0.x0[j] = (unsigned int)((spFloats[j] += floatsMul[j])); - } - } - - *dst = *a3; -} - - // TODO: File split here diff --git a/src/code_80035F0.c b/src/code_80035F0.c index eb4a7d427..463c94ff7 100644 --- a/src/code_80035F0.c +++ b/src/code_80035F0.c @@ -1,7 +1,7 @@ #include "global.h" #include "globaldata.h" #include "bg_palette_buffer.h" -#include "code_8002774.h" +#include "gba_color_util.h" IWRAM_INIT bool8 gUnknown_3001B58 = FALSE; IWRAM_INIT u16 gUnknown_3001B5A = 0; @@ -25,7 +25,7 @@ typedef struct unkStruct_3000C00 // TODO: make static once whole file is decompiled #define UNK_3000400_ARR_COUNT 0x200 #define UNK_3000C00_ARR_COUNT 0x21 -IWRAM_DATA struct S gUnknown_3000400[UNK_3000400_ARR_COUNT] = {0}; +IWRAM_DATA RGB_Union gUnknown_3000400[UNK_3000400_ARR_COUNT] = {0}; IWRAM_DATA unkStruct_3000C00 gUnknown_3000C00[UNK_3000C00_ARR_COUNT] = {0}; void sub_8003A34(u32, u32); @@ -55,7 +55,7 @@ UNUSED static void sub_80035F8(void) void sub_8003600(void) { unkStruct_3000C00 *it1; - struct S *it2; + RGB_Union *it2; bool8 *r6; s32 i; s32 zero; @@ -67,10 +67,10 @@ void sub_8003600(void) for (i = 0; i < UNK_3000400_ARR_COUNT; it2++, i++) { - it2->x0.x0[0] = zero; - it2->x0.x0[1] = zero; - it2->x0.x0[2] = zero; - it2->x0.x0[3] = zero; + it2->asArr.c[0] = zero; + it2->asArr.c[1] = zero; + it2->asArr.c[2] = zero; + it2->asArr.c[3] = zero; } for (i = 0; i < UNK_3000C00_ARR_COUNT; i++, it1++) @@ -197,7 +197,7 @@ void sub_80037C8(s32 param_1, s16 param_2, unkStruct_3000C00_sub param_3) gUnknown_3001B58 = TRUE; } -void sub_8003810(u32 param_1, struct S param_2) +void sub_8003810(u32 param_1, RGB_Union param_2) { u16 idx; unkStruct_3000C00 *a; @@ -209,27 +209,22 @@ void sub_8003810(u32 param_1, struct S param_2) gUnknown_3001B58 = TRUE; } -static UNUSED void sub_8003844(u32 param_1, u32 param_2) +static UNUSED void sub_8003844(u16 idx1, u16 idx2) { - u16 idx1; - u16 idx2; - unkStruct_3000C00 *a; - idx1 = param_1; - idx2 = param_2; - a = &gUnknown_3000C00[idx1 / 16]; + unkStruct_3000C00 *a = &gUnknown_3000C00[idx1 / 16]; a->unk0 = TRUE; - gUnknown_3000400[idx1] = sub_80027A0(idx2); + gUnknown_3000400[idx1].asArr = GbaColorToRGB(idx2); gUnknown_3001B58 = TRUE; } -void sub_800388C(u32 param_1, struct S *param_2, s32 param_3) +void sub_800388C(u32 param_1, RGB_Union *param_2, s32 param_3) { u16 idx1; u16 idx2; s32 sVar1; u16 sVar2; - struct S *ptr1; + RGB_Union *ptr1; unkStruct_3000C00 *ptr3; s32 i; @@ -265,7 +260,7 @@ static UNUSED void sub_80038F0(u32 param_1, s16 *param_2, s32 param_3) u16 idx1; u16 idx2; u16 uVar; - struct S *ptr1; + RGB_Union *ptr1; unkStruct_3000C00 *ptr2; s32 i; @@ -276,7 +271,7 @@ static UNUSED void sub_80038F0(u32 param_1, s16 *param_2, s32 param_3) for (i = 0; i < param_3; i++) { - *ptr1 = sub_80027A0(*param_2++); + ptr1->asArr = GbaColorToRGB(*param_2++); ptr1++; } @@ -290,24 +285,18 @@ static UNUSED void sub_80038F0(u32 param_1, s16 *param_2, s32 param_3) gUnknown_3001B58 = TRUE; } -static UNUSED struct S_sub sub_8003978(u32 param_1) +static UNUSED RGB_Array sub_8003978(u16 idx) { - u16 idx; - idx = param_1; - return gUnknown_3000400[idx].x0; + return gUnknown_3000400[idx].asArr; } -static UNUSED u16 sub_8003988(u32 param_1) +static UNUSED u16 sub_8003988(u16 idx) { - u16 idx; - idx = param_1; - return sub_8002774(gUnknown_3000400[idx].x0); + return RGBToGbaColor(gUnknown_3000400[idx].asArr); } -static UNUSED void sub_80039A4(u32 param_1) +static UNUSED void sub_80039A4(u16 idx) { - u16 idx; - idx = param_1; gUnknown_3001B5A |= idx; } @@ -350,7 +339,7 @@ void sub_80039B8(void) void sub_8003A34(u32 param_1, u32 param_2) { u16 idx; - struct S *ptr1; + RGB_Union *ptr1; u32 blue; u32 green; u32 red; @@ -358,10 +347,10 @@ void sub_8003A34(u32 param_1, u32 param_2) idx = param_2; ptr1 = &gUnknown_3000400[idx]; - blue = (ptr1->x0.x0[2] & 0xf8) << 7; - green = (ptr1->x0.x0[1] & 0xf8) << 2; + blue = (ptr1->asArr.c[2] & 0xf8) << 7; + green = (ptr1->asArr.c[1] & 0xf8) << 2; blue |= green; - red = (ptr1->x0.x0[0] & 0xf8) >> 3; + red = (ptr1->asArr.c[0] & 0xf8) >> 3; color = red | blue; SetBGPaletteBufferColor(idx, &color); } @@ -369,7 +358,7 @@ void sub_8003A34(u32 param_1, u32 param_2) void sub_8003A74(u32 param_1) { u16 idx; - struct S *ptr1; + RGB_Union *ptr1; u32 red; u32 green; u32 blue; @@ -381,10 +370,10 @@ void sub_8003A74(u32 param_1) for (i = 0; i < 16; ptr1++, i++) { - blue = (ptr1->x0.x0[2] & 0xf8) << 7; - green = (ptr1->x0.x0[1] & 0xf8) << 2; + blue = (ptr1->asArr.c[2] & 0xf8) << 7; + green = (ptr1->asArr.c[1] & 0xf8) << 2; blue |= green; - red = (ptr1->x0.x0[0] & 0xf8) >> 3; + red = (ptr1->asArr.c[0] & 0xf8) >> 3; color = red | blue; SetBGPaletteBufferColor(idx + i, &color); } diff --git a/src/code_8099360.c b/src/code_8099360.c index 6739e3dbe..4a9ec37af 100644 --- a/src/code_8099360.c +++ b/src/code_8099360.c @@ -7,13 +7,12 @@ #include "def_filearchives.h" #include "event_flag.h" #include "file_system.h" -#include "structs/str_3000400.h" extern u8 gUnknown_20398B8; extern void sub_8003600(void); extern s32 sub_800388C(u16, const u8 *, u8); -extern void sub_8003810(u16 idx, struct S_sub param_2); +extern void sub_8003810(u16 idx, RGB_Array param_2); void sub_8099648(void) { @@ -72,12 +71,12 @@ void sub_8099690(u32 param_1) CloseFile(temp); } -UNUSED static void sub_8099708(u16 a0, struct S_sub a1) +UNUSED static void sub_8099708(u16 a0, RGB_Array a1) { sub_8003810(a0, a1); } -void sub_809971C(u16 idx, struct S_sub *strPtrs, s32 n) +void sub_809971C(u16 idx, RGB_Array *strPtrs, s32 n) { s32 i; diff --git a/src/credits1.c b/src/credits1.c index c7775d48b..12b8fdf90 100644 --- a/src/credits1.c +++ b/src/credits1.c @@ -22,7 +22,7 @@ static const WindowTemplate gUnknown_80E4A28 = { .header = NULL, }; -static const struct S_sub gUnknown_80E4A40 = {{0x18, 0x18, 0x38, 0}}; +static const RGB_Array gUnknown_80E4A40 = {{0x18, 0x18, 0x38, 0}}; UNUSED static const u8 sUnknownUnusedData[][2] = { {0x21, 0xff}, diff --git a/src/gba_color_util.c b/src/gba_color_util.c new file mode 100644 index 000000000..d47aeee51 --- /dev/null +++ b/src/gba_color_util.c @@ -0,0 +1,57 @@ +#include "global.h" +#include "globaldata.h" +#include "gba_color_util.h" + +// Note: All of these functions are unused, because RGBToGbaColor and GbaColorToRGB are only called by unused functions. Could've been used for testing only? + +u16 RGBToGbaColor(RGB_Array s) +{ + return ((s.c[RGB_B] & 0xF8) << 7) | ((s.c[RGB_G] & 0xF8) << 2) | ((s.c[RGB_R] & 0xF8) >> 3); +} + +RGB_Array GbaColorToRGB(u16 color) +{ + RGB_Array ret; + + ret.c[RGB_R] = (color & 0x1F) << 3 | ((color & 1) ? 7 : 0); + ret.c[RGB_G] = (color & 0x3E0) >> 2 | ((color & 0x20) ? 7 : 0); + ret.c[RGB_B] = (color & 0x7C00) >> 7 | ((color & 0x400) ? 7 : 0); + ret.c[RGB_UNK] = 0; + return ret; +} + +UNUSED static void ScaleRGBColor(RGB_Array *dst, s32 factor, RGB_Array *src) +{ + s32 i; + + for (i = 0; i < RGB_FIELDS_COUNT; i++) { + dst->c[i] = (factor * src->c[i]) / 256; + } +} + +UNUSED static void InterpolateRGBColorGradient(RGB_Array *dst, s32 steps, RGB_Array *start, RGB_Array *end) +{ + s32 i, j; + float spFloats[4]; + float floatsMul[4]; + float f0 = 1.0f / steps; + + for (i = 0; i < RGB_FIELDS_COUNT; i++) { + s8 asSigned = (s8) start->c[i]; + float f = (float)(asSigned); + if (asSigned < 0) { + f += 256.0f; + } + spFloats[i] = f; + floatsMul[i] = (float)(end->c[i] - start->c[i]) * f0; + } + + *dst++ = *start; + for (i = 1; i < steps - 1; dst++, i++) { + for (j = 0; j < RGB_FIELDS_COUNT; j++) { + dst->c[j] = (unsigned int)((spFloats[j] += floatsMul[j])); + } + } + + *dst = *end; +} diff --git a/src/ground_bg.c b/src/ground_bg.c index f83808960..96f35db67 100644 --- a/src/ground_bg.c +++ b/src/ground_bg.c @@ -35,7 +35,7 @@ static void sub_80A3ED4(SubStruct_488 *map488); static void sub_80A3F94(SubStruct_488 *map488); static void sub_80A4358(SubStruct_488 *map488); -extern void sub_8003810(u16 param_1, struct S param_2); +extern void sub_8003810(u16 param_1, RGB_Union param_2); extern void sub_809971C(u16 a0, const void *a1, int a2); static const PixelPos sPositionZero = {0, 0}; @@ -202,8 +202,8 @@ void sub_80A2E64(GroundBg *groundBg) r6 = groundBg->unk52C.unk0 * 16; for (i = 0; i < groundBg->unk52C.unk2; i++) { - struct S str1 = {0}; - struct S str2 = {0xFF, 0xFF, 0xFF, 0}; + RGB_Union str1 = {0}; + RGB_Union str2 = {0xFF, 0xFF, 0xFF, 0}; sub_8003810(r6++, str1); for (j = 0; j < 15; j++) { @@ -228,8 +228,8 @@ void sub_80A2FBC(GroundBg *groundBg, s32 mapFileId_) const void *file_438; const void *file_430; SubStruct_448 *mapPtr_448; - struct S str2; - struct S str1; + RGB_Union str2; + RGB_Union str1; const void *r7; s32 unk0Id; s32 id; @@ -281,11 +281,11 @@ void sub_80A2FBC(GroundBg *groundBg, s32 mapFileId_) r7 = file_430; r5 = groundBg->unk52C.unk0 * 16; - str2 = (struct S) {0}; - str1.x0.x0[0] = 0xff; - str1.x0.x0[1] = 0xff; - str1.x0.x0[2] = 0xff; - str1.x0.x0[3] = 0; + str2 = (RGB_Union) {0}; + str1.asArr.c[0] = 0xff; + str1.asArr.c[1] = 0xff; + str1.asArr.c[2] = 0xff; + str1.asArr.c[3] = 0; for (i = 0; i < mapPtr_464[0] && i < groundBg->unk52C.unk2; i++) { sub_8003810(r5++, str2); sub_809971C(r5, r7, 15); @@ -478,21 +478,21 @@ void sub_80A3440(GroundBg *groundBg, s32 mapFileId_, DungeonLocation *dungLoc, s groundBg->unk464[1] = 0; if (groundBg->unk43C != NULL) { s32 i, j; - const struct S *strPtr = groundBg->unk43C->data; + const RGB_Union *strPtr = groundBg->unk43C->data; u16 r7 = 0; - struct S str0 = {0}; - struct S str1; + RGB_Union str0 = {0}; + RGB_Union str1; - str1.x0.x0[0] = 0xff; - str1.x0.x0[1] = 0xff; - str1.x0.x0[2] = 0xff; - str1.x0.x0[3] = 0; + str1.asArr.c[0] = 0xff; + str1.asArr.c[1] = 0xff; + str1.asArr.c[2] = 0xff; + str1.asArr.c[3] = 0; for (i = 0; i < 12 && i < groundBg->unk52C.unk2; i++) { sub_8003810(r7++, str0); strPtr++; for (j = 0; j < 15; j++) { - struct S str2 = {strPtr->x0.x0[0], strPtr->x0.x0[1], strPtr->x0.x0[2], strPtr->x0.x0[3]}; + RGB_Union str2 = {strPtr->asArr.c[0], strPtr->asArr.c[1], strPtr->asArr.c[2], strPtr->asArr.c[3]}; sub_8003810(r7++, str2); strPtr++; } @@ -1363,7 +1363,7 @@ void sub_80A4764(GroundBg *groundBg) } if (sub0Ptr->unk8 != NULL) { - struct S empty = {0}; + RGB_Union empty = {0}; sub_8003810(r6, empty); sub_809971C(r6 + 1, sub0Ptr->unk8, 15); sub0Ptr->unk8 += 60; @@ -1379,7 +1379,7 @@ void sub_80A4764(GroundBg *groundBg) s32 r6 = 160; for (i = 0; i < 32; i++, unkE0Ptr++, r6++) { - struct S color; + RGB_Union color; if (sub_8004D14(unkE0Ptr, 1) && !sub_8004D40(unkE0Ptr, 1) && --unkE0Ptr->unk6 <= 0) { unkE0Ptr->unk6 = unkE0Ptr->unk4; @@ -1387,7 +1387,7 @@ void sub_80A4764(GroundBg *groundBg) unkE0Ptr->unkC = unkE0Ptr->unk8; } unkE0Ptr->unk14 = *unkE0Ptr->unkC++; - color = (struct S) {unkE0Ptr->unk14.r, unkE0Ptr->unk14.g, unkE0Ptr->unk14.b, unkE0Ptr->unk14.unk4}; + color = (RGB_Union) {unkE0Ptr->unk14.r, unkE0Ptr->unk14.g, unkE0Ptr->unk14.b, unkE0Ptr->unk14.unk4}; sub_8003810(r6, color); } } diff --git a/src/ground_script.c b/src/ground_script.c index 805f8d955..13c50f1b7 100644 --- a/src/ground_script.c +++ b/src/ground_script.c @@ -1818,7 +1818,7 @@ s32 ExecuteScriptCommand(Action *action) break; } case 0x27: case 0x28: { - struct S_sub color = { curCmd.arg2 >> 16, curCmd.arg2 >> 8, curCmd.arg2, 0 }; + RGB_Array color = { curCmd.arg2 >> 16, curCmd.arg2 >> 8, curCmd.arg2, 0 }; switch (curCmd.op) { case 0x27: sub_8099A5C(curCmd.argShort, curCmd.arg1, color); diff --git a/src/palette_util.c b/src/palette_util.c index 76bf5f51f..4289448e9 100644 --- a/src/palette_util.c +++ b/src/palette_util.c @@ -5,11 +5,11 @@ extern void sub_80039B8(void); extern void TransferBGPaletteBuffer(void); -extern void sub_80037C8(u16, u32, struct S_sub); +extern void sub_80037C8(u16, u32, RGB_Array); extern void sub_8003664(u16 param_1, u16 param_2); -extern void sub_80036AC(u16, u32, struct S_sub); -extern void sub_80036F4(u16, u32, struct S_sub); -extern void sub_8003780(u16, u32, struct S_sub); +extern void sub_80036AC(u16, u32, RGB_Array); +extern void sub_80036F4(u16, u32, RGB_Array); +extern void sub_8003780(u16, u32, RGB_Array); struct UnkStruct_2039958 { @@ -24,7 +24,7 @@ struct UnkStruct_2039958 struct UnkStruct_2039978 { u32 unk0; - struct S_sub unk4; + RGB_Array unk4; struct UnkStruct_2039958 unk8; }; @@ -41,7 +41,7 @@ static void sub_8099838(struct UnkStruct_2039958 *a0); static void sub_8099848(struct UnkStruct_2039958 *a0); static void sub_8099DD0(u16 a0); static void sub_8099E58(u16 a0); -static void sub_8099E80(u16 a0, struct S_sub a1); +static void sub_8099E80(u16 a0, RGB_Array a1); void sub_8099744(void) { @@ -262,7 +262,7 @@ void sub_8099A48(s32 a0) sub_8099880(&gUnknown_2039968, a0); } -void sub_8099A5C(s32 a0, s32 a1, struct S_sub a2) +void sub_8099A5C(s32 a0, s32 a1, RGB_Array a2) { gUnknown_2039978.unk0 = a0; gUnknown_2039978.unk4 = a2; @@ -288,7 +288,7 @@ void sub_8099A5C(s32 a0, s32 a1, struct S_sub a2) } } -void sub_8099AFC(s32 a0, s32 a1, struct S_sub a2) +void sub_8099AFC(s32 a0, s32 a1, RGB_Array a2) { gUnknown_2039978.unk0 = a0; gUnknown_2039978.unk4 = a2; @@ -445,7 +445,7 @@ static void sub_8099E58(u16 a0) sub_8003664(31, a0); } -static void sub_8099E80(u16 param_1,struct S_sub param_2) +static void sub_8099E80(u16 param_1,RGB_Array param_2) { s32 i; @@ -677,16 +677,16 @@ static void sub_8099E80(u16 param_1,struct S_sub param_2) case 14: switch (gUnknown_2039978.unk0) { case 13: - param_2.x0[0] = 0x90; - param_2.x0[1] = 0x90; - param_2.x0[2] = 0xFF; - param_2.x0[3] = 0xFF; + param_2.c[0] = 0x90; + param_2.c[1] = 0x90; + param_2.c[2] = 0xFF; + param_2.c[3] = 0xFF; break; case 14: - param_2.x0[0] = 0xFF; - param_2.x0[1] = 0xC0; - param_2.x0[2] = 0x80; - param_2.x0[3] = 0xFF; + param_2.c[0] = 0xFF; + param_2.c[1] = 0xC0; + param_2.c[2] = 0x80; + param_2.c[3] = 0xFF; break; } // NOTE: fallthrough needed here diff --git a/src/wigglytuff_shop3.c b/src/wigglytuff_shop3.c index 7ffce6c7e..37ef5acde 100644 --- a/src/wigglytuff_shop3.c +++ b/src/wigglytuff_shop3.c @@ -557,7 +557,7 @@ static void WigglytuffShop_GoToFallbackState(void) static void sub_80226F0(void) { - struct S_sub unkStr = {0x80, 0x80, 0x10, 0}; + RGB_Array unkStr = {0x80, 0x80, 0x10, 0}; if (sub_8099B94()) return;