diff --git a/include/functions.h b/include/functions.h index 27066008cd..006179be6d 100644 --- a/include/functions.h +++ b/include/functions.h @@ -139,22 +139,22 @@ void StackCheck_Cleanup(StackEntry* entry); StackStatus StackCheck_GetState(StackEntry* entry); u32 StackCheck_CheckAll(void); u32 StackCheck_Check(StackEntry* entry); -void GfxPrint_InitDlist(GfxPrint*); -void GfxPrint_SetColor(GfxPrint*, u32, u32, u32, u32); -void GfxPrint_SetPosPx(GfxPrint*, s32, s32); -void GfxPrint_SetPos(GfxPrint*, s32, s32); -void GfxPrint_SetBasePosPx(GfxPrint* this, s32 param_2, s32 param_3); -void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c); -void GfxPrint_PrintChar(GfxPrint* this, u8 c); -void GfxPrint_PrintStringWithSize(GfxPrint*, const void*, size_t, size_t); -void GfxPrint_PrintString(GfxPrint*, const char*); -GfxPrint* GfxPrint_Callback(GfxPrint*, const char*, size_t); -void GfxPrint_Init(GfxPrint*); -void GfxPrint_Destroy(GfxPrint*); -void GfxPrint_Open(GfxPrint*, Gfx*); -Gfx* GfxPrint_Close(GfxPrint*); -void GfxPrint_VPrintf(GfxPrint*, const char*, va_list); -void GfxPrint_Printf(GfxPrint*, const char*, ...); +void GfxPrint_InitDlist(GfxPrint* printer); +void GfxPrint_SetColor(GfxPrint* printer, u32 r, u32 g, u32 b, u32 a); +void GfxPrint_SetPosPx(GfxPrint* printer, s32 x, s32 y); +void GfxPrint_SetPos(GfxPrint* printer, s32 x, s32 y); +void GfxPrint_SetBasePosPx(GfxPrint* printer, s32 x, s32 y); +void GfxPrint_PrintCharImpl(GfxPrint* printer, u8 c); +void GfxPrint_PrintChar(GfxPrint* printer, u8 c); +void GfxPrint_PrintStringWithSize(GfxPrint* printer, const void* buffer, size_t charSize, size_t charCount); +void GfxPrint_PrintString(GfxPrint* printer, const char* str); +GfxPrint* GfxPrint_Callback(GfxPrint* printer, const char* str, size_t size); +void GfxPrint_Init(GfxPrint* printer); +void GfxPrint_Destroy(GfxPrint* printer); +void GfxPrint_Open(GfxPrint* printer, Gfx* dList); +Gfx* GfxPrint_Close(GfxPrint* printer); +s32 GfxPrint_VPrintf(GfxPrint* printer, const char* fmt, va_list args); +s32 GfxPrint_Printf(GfxPrint* printer, const char* fmt, ...); // void MtxConv_F2L(void); // void MtxConv_L2F(void); void __assert(const char* file, u32 lineNum); @@ -236,8 +236,8 @@ u32 __osCheckArena(Arena* heap); void* proutSprintf(void* s, const char* buf, size_t n); s32 vsprintf(char* dst, char* fmt, va_list args); s32 sprintf(char* s, char* fmt, ...); -void PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args); -void PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...); +s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args); +s32 PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...); void Sleep_Cycles(OSTime time); // void Sleep_Nsec(void); void Sleep_Usec(s32); @@ -681,8 +681,8 @@ void func_800B3030(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* // void func_800B31BC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE4 param_6); void EffectSsIceSmoke_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale); // void EffectSsIceBlock_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, UNK_TYPE2 param_5); -void func_800B32D0(GameState* gamestate); -// void func_800B3644(void); +void FlagSet_Update(GameState* gamestate); +void FlagSet_Draw(GameState* gameState); void DLF_LoadGameState(GameStateOverlay* gameState); void DLF_FreeGameState(GameStateOverlay* gameState); void Actor_PrintLists(ActorContext* actorCtx); diff --git a/include/variables.h b/include/variables.h index b3aa0a6021..eddb73875d 100644 --- a/include/variables.h +++ b/include/variables.h @@ -418,10 +418,10 @@ extern EffectSsInfo EffectSS2Info; // extern UNK_TYPE1 D_801AE48C; // extern UNK_TYPE1 D_801AE490; extern EffectSsOverlay particleOverlayTable[39]; -extern UNK_PTR D_801AE8F0; -// extern UNK_TYPE4 D_801AEC70; -// extern UNK_TYPE4 D_801AEC74; -// extern UNK_TYPE4 D_801AEC78; +// extern FlagSetEntry sFlagEntries[]; +// extern s32 sEntryIndex; +// extern u32 sCurrentBit; +// extern s32 sTimer; extern Color_RGBA8 D_801AEC80; extern s801AEC84 D_801AEC84[13]; extern f32 actorMovementScale; diff --git a/include/z64.h b/include/z64.h index 3d61fe5ea4..2b1badfd49 100644 --- a/include/z64.h +++ b/include/z64.h @@ -1777,4 +1777,9 @@ typedef struct { /* 0x20 */ u16 fracPart[4][4]; } MatrixInternal; // size = 0x40 +typedef struct { + /* 0x00 */ u8* value; + /* 0x04 */ const char* name; +} FlagSetEntry; // size = 0x08 + #endif diff --git a/include/z64save.h b/include/z64save.h index d701d0a42c..a1ec72ab96 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -175,8 +175,9 @@ typedef struct { /* 0x3F60 */ u8 unk_3F60; // "framescale_flag" /* 0x3F64 */ f32 unk_3F64; // "framescale_scale" /* 0x3F68 */ u32 unk_3F68[5][120]; - /* 0x48C8 */ u16 unk_48C8; // "scene_id_mix" - /* 0x48CA */ u8 unk_48CA[27]; + /* 0x48C8 */ u16 unk_48C8; // "scene_id_mix" + /* 0x48CA */ u8 maskMaskBit[3]; // masks given away on the Moon + /* 0x48CD */ char unk_48CD[24]; } SaveContext; // size = 0x48C8 typedef enum { diff --git a/spec b/spec index 158cca3711..9412e3b28c 100644 --- a/spec +++ b/spec @@ -448,9 +448,8 @@ beginseg include "build/data/code/z_effect_soft_sprite.data.o" include "build/src/code/z_effect_soft_sprite_old_init.o" include "build/data/code/z_effect_soft_sprite_old_init.data.o" - include "build/data/code/flg_set_table.data.o" include "build/src/code/flg_set.o" - include "build/data/code/flg_set.data.o" + include "build/src/code/pad_801DC9C0.o" include "build/src/code/z_DLF.o" include "build/src/code/z_actor.o" include "build/data/code/z_actor.data.o" diff --git a/src/boot_O2/gfxprint.c b/src/boot_O2/gfxprint.c index f65d882003..a6f84a7a4e 100644 --- a/src/boot_O2/gfxprint.c +++ b/src/boot_O2/gfxprint.c @@ -171,15 +171,18 @@ Gfx* GfxPrint_Close(GfxPrint* this) { return ret; } -void GfxPrint_VPrintf(GfxPrint* this, const char* fmt, va_list args) { - PrintUtils_VPrintf((PrintCallback*)&this->callback, fmt, args); +s32 GfxPrint_VPrintf(GfxPrint* this, const char* fmt, va_list args) { + return PrintUtils_VPrintf((PrintCallback*)&this->callback, fmt, args); } -void GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) { +s32 GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) { + s32 ret; va_list args; va_start(args, fmt); - GfxPrint_VPrintf(this, fmt, args); + ret = GfxPrint_VPrintf(this, fmt, args); va_end(args); + + return ret; } diff --git a/src/boot_O2/printutils.c b/src/boot_O2/printutils.c index ca62b91b7f..3fb8cf3672 100644 --- a/src/boot_O2/printutils.c +++ b/src/boot_O2/printutils.c @@ -1,14 +1,17 @@ #include "global.h" -void PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args) { - _Printf(*pfn, pfn, fmt, args); +s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args) { + return _Printf(*pfn, pfn, fmt, args); } -void PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...) { +s32 PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...) { + s32 ret; va_list args; va_start(args, fmt); - PrintUtils_VPrintf(pfn, fmt, args); + ret = PrintUtils_VPrintf(pfn, fmt, args); va_end(args); + + return ret; } diff --git a/src/boot_O2_g3/idle.c b/src/boot_O2_g3/idle.c index 4be8a1094f..f2cded98c2 100644 --- a/src/boot_O2_g3/idle.c +++ b/src/boot_O2_g3/idle.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" u8 D_80096B20 = 1; diff --git a/src/code/flg_set.c b/src/code/flg_set.c index b46433a708..490472d205 100644 --- a/src/code/flg_set.c +++ b/src/code/flg_set.c @@ -1,9 +1,314 @@ +/** + * File: flg_set.c + * Description: Event Editor, used to view and edit weekEventReg, eventInf and maskMaskBit flags. + * Controls: + * + Left and Right: select different flags/bits in array element + * + Up and Down: select array element (byte) 1 up/down + * C Up and Down: select array element (byte) 10 up/down + * A: toggle flag + * B: exit + * Hold Start and press B: clear all weekEventReg and eventInf flags + */ #include "global.h" -#pragma GLOBAL_ASM("asm/non_matchings/code/flg_set/func_800B32D0.s") +static FlagSetEntry sFlagEntries[] = { + { &gSaveContext.weekEventReg[0], "week_event_reg[0]" }, + { &gSaveContext.weekEventReg[1], "week_event_reg[1]" }, + { &gSaveContext.weekEventReg[2], "week_event_reg[2]" }, + { &gSaveContext.weekEventReg[3], "week_event_reg[3]" }, + { &gSaveContext.weekEventReg[4], "week_event_reg[4]" }, + { &gSaveContext.weekEventReg[5], "week_event_reg[5]" }, + { &gSaveContext.weekEventReg[6], "week_event_reg[6]" }, + { &gSaveContext.weekEventReg[7], "week_event_reg[7]" }, + { &gSaveContext.weekEventReg[8], "week_event_reg[8]" }, + { &gSaveContext.weekEventReg[9], "week_event_reg[9]" }, + { &gSaveContext.weekEventReg[10], "week_event_reg[10]" }, + { &gSaveContext.weekEventReg[11], "week_event_reg[11]" }, + { &gSaveContext.weekEventReg[12], "week_event_reg[12]" }, + { &gSaveContext.weekEventReg[13], "week_event_reg[13]" }, + { &gSaveContext.weekEventReg[14], "week_event_reg[14]" }, + { &gSaveContext.weekEventReg[15], "week_event_reg[15]" }, + { &gSaveContext.weekEventReg[16], "week_event_reg[16]" }, + { &gSaveContext.weekEventReg[17], "week_event_reg[17]" }, + { &gSaveContext.weekEventReg[18], "week_event_reg[18]" }, + { &gSaveContext.weekEventReg[19], "week_event_reg[19]" }, + { &gSaveContext.weekEventReg[20], "week_event_reg[20]" }, + { &gSaveContext.weekEventReg[21], "week_event_reg[21]" }, + { &gSaveContext.weekEventReg[22], "week_event_reg[22]" }, + { &gSaveContext.weekEventReg[23], "week_event_reg[23]" }, + { &gSaveContext.weekEventReg[24], "week_event_reg[24]" }, + { &gSaveContext.weekEventReg[25], "week_event_reg[25]" }, + { &gSaveContext.weekEventReg[26], "week_event_reg[26]" }, + { &gSaveContext.weekEventReg[27], "week_event_reg[27]" }, + { &gSaveContext.weekEventReg[28], "week_event_reg[28]" }, + { &gSaveContext.weekEventReg[29], "week_event_reg[29]" }, + { &gSaveContext.weekEventReg[30], "week_event_reg[30]" }, + { &gSaveContext.weekEventReg[31], "week_event_reg[31]" }, + { &gSaveContext.weekEventReg[32], "week_event_reg[32]" }, + { &gSaveContext.weekEventReg[33], "week_event_reg[33]" }, + { &gSaveContext.weekEventReg[34], "week_event_reg[34]" }, + { &gSaveContext.weekEventReg[35], "week_event_reg[35]" }, + { &gSaveContext.weekEventReg[36], "week_event_reg[36]" }, + { &gSaveContext.weekEventReg[37], "week_event_reg[37]" }, + { &gSaveContext.weekEventReg[38], "week_event_reg[38]" }, + { &gSaveContext.weekEventReg[39], "week_event_reg[39]" }, + { &gSaveContext.weekEventReg[40], "week_event_reg[40]" }, + { &gSaveContext.weekEventReg[41], "week_event_reg[41]" }, + { &gSaveContext.weekEventReg[42], "week_event_reg[42]" }, + { &gSaveContext.weekEventReg[43], "week_event_reg[43]" }, + { &gSaveContext.weekEventReg[44], "week_event_reg[44]" }, + { &gSaveContext.weekEventReg[45], "week_event_reg[45]" }, + { &gSaveContext.weekEventReg[46], "week_event_reg[46]" }, + { &gSaveContext.weekEventReg[47], "week_event_reg[47]" }, + { &gSaveContext.weekEventReg[48], "week_event_reg[48]" }, + { &gSaveContext.weekEventReg[49], "week_event_reg[49]" }, + { &gSaveContext.weekEventReg[50], "week_event_reg[50]" }, + { &gSaveContext.weekEventReg[51], "week_event_reg[51]" }, + { &gSaveContext.weekEventReg[52], "week_event_reg[52]" }, + { &gSaveContext.weekEventReg[53], "week_event_reg[53]" }, + { &gSaveContext.weekEventReg[54], "week_event_reg[54]" }, + { &gSaveContext.weekEventReg[55], "week_event_reg[55]" }, + { &gSaveContext.weekEventReg[56], "week_event_reg[56]" }, + { &gSaveContext.weekEventReg[57], "week_event_reg[57]" }, + { &gSaveContext.weekEventReg[58], "week_event_reg[58]" }, + { &gSaveContext.weekEventReg[59], "week_event_reg[59]" }, + { &gSaveContext.weekEventReg[60], "week_event_reg[60]" }, + { &gSaveContext.weekEventReg[61], "week_event_reg[61]" }, + { &gSaveContext.weekEventReg[62], "week_event_reg[62]" }, + { &gSaveContext.weekEventReg[63], "week_event_reg[63]" }, + { &gSaveContext.weekEventReg[64], "week_event_reg[64]" }, + { &gSaveContext.weekEventReg[65], "week_event_reg[65]" }, + { &gSaveContext.weekEventReg[66], "week_event_reg[66]" }, + { &gSaveContext.weekEventReg[67], "week_event_reg[67]" }, + { &gSaveContext.weekEventReg[68], "week_event_reg[68]" }, + { &gSaveContext.weekEventReg[69], "week_event_reg[69]" }, + { &gSaveContext.weekEventReg[70], "week_event_reg[70]" }, + { &gSaveContext.weekEventReg[71], "week_event_reg[71]" }, + { &gSaveContext.weekEventReg[72], "week_event_reg[72]" }, + { &gSaveContext.weekEventReg[73], "week_event_reg[73]" }, + { &gSaveContext.weekEventReg[74], "week_event_reg[74]" }, + { &gSaveContext.weekEventReg[75], "week_event_reg[75]" }, + { &gSaveContext.weekEventReg[76], "week_event_reg[76]" }, + { &gSaveContext.weekEventReg[77], "week_event_reg[77]" }, + { &gSaveContext.weekEventReg[78], "week_event_reg[78]" }, + { &gSaveContext.weekEventReg[79], "week_event_reg[79]" }, + { &gSaveContext.weekEventReg[80], "week_event_reg[80]" }, + { &gSaveContext.weekEventReg[81], "week_event_reg[81]" }, + { &gSaveContext.weekEventReg[82], "week_event_reg[82]" }, + { &gSaveContext.weekEventReg[83], "week_event_reg[83]" }, + { &gSaveContext.weekEventReg[84], "week_event_reg[84]" }, + { &gSaveContext.weekEventReg[85], "week_event_reg[85]" }, + { &gSaveContext.weekEventReg[86], "week_event_reg[86]" }, + { &gSaveContext.weekEventReg[87], "week_event_reg[87]" }, + { &gSaveContext.weekEventReg[88], "week_event_reg[88]" }, + { &gSaveContext.weekEventReg[89], "week_event_reg[89]" }, + { &gSaveContext.weekEventReg[90], "week_event_reg[90]" }, + { &gSaveContext.weekEventReg[91], "week_event_reg[91]" }, + { &gSaveContext.weekEventReg[92], "week_event_reg[92]" }, + { &gSaveContext.weekEventReg[93], "week_event_reg[93]" }, + { &gSaveContext.weekEventReg[94], "week_event_reg[94]" }, + { &gSaveContext.weekEventReg[95], "week_event_reg[95]" }, + { &gSaveContext.weekEventReg[96], "week_event_reg[96]" }, + { &gSaveContext.weekEventReg[97], "week_event_reg[97]" }, + { &gSaveContext.weekEventReg[98], "week_event_reg[98]" }, + { &gSaveContext.weekEventReg[99], "week_event_reg[99]" }, -#pragma GLOBAL_ASM("asm/non_matchings/code/flg_set/D_801DC120.s") + { &gSaveContext.eventInf[0], "event_inf[0]" }, + { &gSaveContext.eventInf[1], "event_inf[1]" }, + { &gSaveContext.eventInf[2], "event_inf[2]" }, + { &gSaveContext.eventInf[3], "event_inf[3]" }, + { &gSaveContext.eventInf[4], "event_inf[4]" }, + { &gSaveContext.eventInf[5], "event_inf[5]" }, + { &gSaveContext.eventInf[6], "event_inf[6]" }, + { &gSaveContext.eventInf[7], "event_inf[7]" }, -#pragma GLOBAL_ASM("asm/non_matchings/code/flg_set/func_800B3644.s") + { &gSaveContext.maskMaskBit[0], "mask_mask_bit[0]" }, + { &gSaveContext.maskMaskBit[1], "mask_mask_bit[1]" }, + { &gSaveContext.maskMaskBit[2], "mask_mask_bit[2]" }, -#pragma GLOBAL_ASM("asm/non_matchings/code/flg_set/D_801DC9B8.s") + { NULL, NULL }, // used in the code to detect array end +}; + +static s32 sEntryIndex = 0; +static u32 sCurrentBit = 0; +static s32 sTimer = 0; + +void FlagSet_Update(GameState* gameState) { + GlobalContext* globalCtx = (GlobalContext*)gameState; + Input* input = CONTROLLER1(globalCtx); + + /* Intra-byte navigation */ + + if (CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { + sCurrentBit++; + sTimer = 10; + } + + if (CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { + sCurrentBit--; + sTimer = 10; + } + + if (sTimer == 0) { + if (CHECK_BTN_ALL(input->cur.button, BTN_DLEFT)) { + sCurrentBit++; + sTimer = 2; + } + if (CHECK_BTN_ALL(input->cur.button, BTN_DRIGHT)) { + sCurrentBit--; + sTimer = 2; + } + } + + // Wrap cursor position at beginning/end of line + sCurrentBit %= 8; + + /* Navigation between bytes */ + + // + Up/Down scroll 1 at a time + if (CHECK_BTN_ALL(input->press.button, BTN_DUP)) { + sEntryIndex--; + if (sEntryIndex < 0) { + sEntryIndex = 0; + } + sTimer = 10; + } + + if (CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) { + sEntryIndex++; + if (sFlagEntries[sEntryIndex].value == NULL) { // End of array + sEntryIndex--; + } + sTimer = 10; + } + + // C Up/Down scroll 10 at a time + if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) { + sEntryIndex -= 10; + if (sEntryIndex < 0) { + sEntryIndex = 0; + } + sTimer = 10; + } + + if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN)) { + sEntryIndex += 10; + if (sEntryIndex > 100) { + sEntryIndex = 100; + } + sTimer = 10; + } + + if (sTimer == 0) { + if (CHECK_BTN_ALL(input->cur.button, BTN_DUP)) { + sEntryIndex--; + if (sEntryIndex < 0) { + sEntryIndex = 0; + } + sTimer = 2; + + } else if (CHECK_BTN_ALL(input->cur.button, BTN_DDOWN)) { + sEntryIndex++; + if (sFlagEntries[sEntryIndex].value == NULL) { // End of array + sEntryIndex--; + } + sTimer = 2; + + } else if (CHECK_BTN_ALL(input->cur.button, BTN_CUP)) { + sEntryIndex -= 10; + if (sEntryIndex < 0) { + sEntryIndex = 0; + } + sTimer = 2; + + } else if (CHECK_BTN_ALL(input->cur.button, BTN_CDOWN)) { + sEntryIndex += 10; + if (sEntryIndex > 100) { + sEntryIndex = 100; + } + sTimer = 2; + } + } + + /* Other controls */ + + // A toggles the selected flag + if (CHECK_BTN_ALL(input->press.button, BTN_A)) { + *sFlagEntries[sEntryIndex].value ^= (1 << sCurrentBit); + } + + if (sTimer != 0) { + sTimer--; + } + + // Hold Start and press B will reset the first two flag arrays + if (CHECK_BTN_ALL(input->cur.button, BTN_START)) { + if (CHECK_BTN_ALL(input->press.button, BTN_B)) { + s16 i; + for (i = 0; i < ARRAY_COUNT(gSaveContext.weekEventReg); i++) { + gSaveContext.weekEventReg[i] = 0; + } + for (i = 0; i < ARRAY_COUNT(gSaveContext.eventInf); i++) { + gSaveContext.eventInf[i] = 0; + } + } + + // Pressing B will exit + } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { + globalCtx->pauseCtx.debugState = 0; + } +} + +extern s32 D_801ED890; + +void FlagSet_Draw(GameState* gameState) { + GraphicsContext* gfxCtx = gameState->gfxCtx; + Gfx* gfx; + Gfx* polyOpa; + + OPEN_DISPS(gfxCtx); + GfxPrint printer; + s32 pad; + + polyOpa = POLY_OPA_DISP; + gfx = Graph_GfxPlusOne(polyOpa); + gSPDisplayList(OVERLAY_DISP++, gfx); + + GfxPrint_Init(&printer); + GfxPrint_Open(&printer, gfx); + GfxPrint_SetColor(&printer, 250, 50, 50, 255); + GfxPrint_SetPos(&printer, 8, 13); + GfxPrint_Printf(&printer, sFlagEntries[sEntryIndex].name); + GfxPrint_SetPos(&printer, 12, 15); + + // Print the flag bits in the current byte, largest to smallest + for (D_801ED890 = 7; D_801ED890 >= 0; D_801ED890--) { + // Highlight current flag bit in white, rest in grey + if ((u32)D_801ED890 == sCurrentBit) { + GfxPrint_SetColor(&printer, 200, 200, 200, 255); + } else { + GfxPrint_SetColor(&printer, 100, 100, 100, 255); + } + + // Display 1 if flag set and 0 if not + if (*sFlagEntries[sEntryIndex].value & (1 << D_801ED890)) { + GfxPrint_Printf(&printer, "1"); + } else { + GfxPrint_Printf(&printer, "0"); + } + + // Add a space after each group of 4 + if ((D_801ED890 % 4) == 0) { + GfxPrint_Printf(&printer, " "); + } + } + + gfx = GfxPrint_Close(&printer); + GfxPrint_Destroy(&printer); + + gSPEndDisplayList(gfx++); + Graph_BranchDlist(polyOpa, gfx); + POLY_OPA_DISP = gfx; + + CLOSE_DISPS(gfxCtx); +} diff --git a/src/code/pad_801DC9C0.c b/src/code/pad_801DC9C0.c new file mode 100644 index 0000000000..f386919dee --- /dev/null +++ b/src/code/pad_801DC9C0.c @@ -0,0 +1 @@ +static const char pad_801DC9C0[] = { 0 }; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 11ec5164b4..99a4343a43 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -652,8 +652,8 @@ 0x800B31BC:("func_800B31BC",), 0x800B320C:("EffectSsIceSmoke_Spawn",), 0x800B326C:("EffectSsIceBlock_Spawn",), - 0x800B32D0:("func_800B32D0",), - 0x800B3644:("func_800B3644",), + 0x800B32D0:("FlagSet_Update",), + 0x800B3644:("FlagSet_Draw",), 0x800B3880:("DLF_LoadGameState",), 0x800B39A4:("DLF_FreeGameState",), 0x800B3AD0:("Actor_PrintLists",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 4f5da48f71..d6ae0cfab0 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -424,10 +424,10 @@ 0x801AE48C:("D_801AE48C","Color_RGBA8","",0x4), 0x801AE490:("D_801AE490","Color_RGBA8","[4]",0x10), 0x801AE4A0:("particleOverlayTable","EffectSsOverlay","[39]",0x444), - 0x801AE8F0:("D_801AE8F0","UNK_PTR","",0x4), - 0x801AEC70:("D_801AEC70","UNK_TYPE4","",0x4), - 0x801AEC74:("D_801AEC74","UNK_TYPE4","",0x4), - 0x801AEC78:("D_801AEC78","UNK_TYPE4","",0x4), + 0x801AE8F0:("sFlagEntries","FlagSetEntry","[112]",0x8), + 0x801AEC70:("sEntryIndex","s32","",0x4), + 0x801AEC74:("sCurrentBit","u32","",0x4), + 0x801AEC78:("sTimer","s32","",0x4), 0x801AEC80:("D_801AEC80","Color_RGBA8","",0x4), 0x801AEC84:("D_801AEC84","s801AEC84","[13]",0x68), 0x801AECEC:("actorMovementScale","f32","",0x4), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index e8f66fc016..0fdfe7519a 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -166,8 +166,8 @@ asm/non_matchings/code/z_effect_soft_sprite_old_init/EffectSsDeadDs_Spawn.s,Effe asm/non_matchings/code/z_effect_soft_sprite_old_init/func_800B31BC.s,func_800B31BC,0x800B31BC,0x14 asm/non_matchings/code/z_effect_soft_sprite_old_init/EffectSsIceSmoke_Spawn.s,EffectSsIceSmoke_Spawn,0x800B320C,0x18 asm/non_matchings/code/z_effect_soft_sprite_old_init/EffectSsIceBlock_Spawn.s,EffectSsIceBlock_Spawn,0x800B326C,0x19 -asm/non_matchings/code/flg_set/func_800B32D0.s,func_800B32D0,0x800B32D0,0xDD -asm/non_matchings/code/flg_set/func_800B3644.s,func_800B3644,0x800B3644,0x8F +asm/non_matchings/code/flg_set/FlagSet_Update.s,FlagSet_Update,0x800B32D0,0xDD +asm/non_matchings/code/flg_set/FlagSet_Draw.s,FlagSet_Draw,0x800B3644,0x8F asm/non_matchings/code/z_DLF/DLF_LoadGameState.s,DLF_LoadGameState,0x800B3880,0x49 asm/non_matchings/code/z_DLF/DLF_FreeGameState.s,DLF_FreeGameState,0x800B39A4,0x4B asm/non_matchings/code/z_actor/Actor_PrintLists.s,Actor_PrintLists,0x800B3AD0,0x35