From 926677aa6c6cfb3b633a64c772d264e1946cc79c Mon Sep 17 00:00:00 2001 From: petrie911 <69443847+petrie911@users.noreply.github.com> Date: Wed, 1 May 2024 19:57:50 -0500 Subject: [PATCH] In-game ram watch mod + upgraded jukebox (#225) * new mods * Torch --- include/mods.h | 16 ++ include/variables.h | 3 + src/engine/fox_display.c | 6 + src/mods/object_ram.c | 317 +++++++++++++++++++++++++++++ src/mods/sfxjukebox2.c | 220 ++++++++++++++++++++ src/overlays/ovl_menu/fox_option.c | 38 +++- tools/Torch | 2 +- 7 files changed, 591 insertions(+), 11 deletions(-) create mode 100644 src/mods/object_ram.c create mode 100644 src/mods/sfxjukebox2.c diff --git a/include/mods.h b/include/mods.h index fd93b357..9419d8e4 100644 --- a/include/mods.h +++ b/include/mods.h @@ -11,6 +11,9 @@ /** * Sound Effects Jukebox: * Ability to play sound effects inside the expert sound menu + * Use L to switch between jukebox and soundtrack + * Use D-PAD to move the cursor + * Use C buttons to edit values */ #define MODS_SFX_JUKEBOX 0 @@ -20,6 +23,15 @@ */ #define MODS_FPS_COUNTER 0 +/** + * Object Ram Watch: + * Watch up to seven addresses from the player and object arrays + * Press C> while paused to enable/disable + * Use D-PAD to move the cursor and change values + * Press L to edit the highlighted value +*/ + +#define MODS_OBJECT_RAM 0 /* ************************* */ @@ -31,4 +43,8 @@ void Map_LevelSelect(void); static void Play_RenderFps(void); #endif +#if MODS_OBJECT_RAM == 1 +void ObjectRam_Update(void); +#endif + #endif diff --git a/include/variables.h b/include/variables.h index da10d9ad..e9dbf839 100644 --- a/include/variables.h +++ b/include/variables.h @@ -162,6 +162,9 @@ extern s32 gDisplayedHitCount; extern s32 D_hud_80161730; extern s32 gShowBossHealth; // 0x80161734 +// fox_std_lib +extern char D_801619A0[]; + // fox_play extern u8 gSavedZoSearchlightStatus; extern f32 gArwingSpeed; diff --git a/src/engine/fox_display.c b/src/engine/fox_display.c index cd7a5406..dfa8e507 100644 --- a/src/engine/fox_display.c +++ b/src/engine/fox_display.c @@ -1726,8 +1726,14 @@ void Play_Draw(void) { #if MODS_FPS_COUNTER == 1 Play_RenderFps(); #endif +#if MODS_OBJECT_RAM == 1 + ObjectRam_Update(); +#endif } #if MODS_FPS_COUNTER == 1 #include "../mods/fpscounter.c" #endif +#if MODS_OBJECT_RAM == 1 +#include "../mods/object_ram.c" +#endif diff --git a/src/mods/object_ram.c b/src/mods/object_ram.c new file mode 100644 index 00000000..fca77f6d --- /dev/null +++ b/src/mods/object_ram.c @@ -0,0 +1,317 @@ +#include "global.h" + +typedef struct RamEntry { + u8 type; + u8 index; + s16 offset; + u8 width; + u8 fmt; + u16 x; + u16 y; +} RamEntry; + +static RamEntry oRamEntries[8] = { + { 1, 0, offsetof(Player, pos.x), 2, 3, 0, 0 }, { 1, 0, offsetof(Player, pos.y), 2, 3, 0, 0 }, + { 1, 0, offsetof(Player, pos.z), 2, 3, 0, 0 }, { 0, 0, offsetof(Player, unk_144), 2, 3, 0, 0 }, + { 0, 0, offsetof(Player, vel.x), 2, 3, 0, 0 }, { 0, 0, offsetof(Player, vel.y), 2, 3, 0, 0 }, + { 0, 0, offsetof(Player, vel.z), 2, 3, 0, 0 }, +}; + +static u32 selectIndex = 0; +static s32 oRamActive = 0; +static u32 editMode = 0; +static s32 editing = 0; +static OSContPad* contPress; + +typedef enum ObjectRamType { + ORAM_NONE, + ORAM_PLAYER, + ORAM_SCENE360, + ORAM_SCENERY, + ORAM_SPRITE, + ORAM_ACTOR, + ORAM_BOSS, + ORAM_ITEM, + ORAM_EFFECT, + ORAM_SHOT, + ORAM_MAX, +} ObjectRamType; + +typedef enum EditMode { + EDM_TYPE, + EDM_OFFSET, + EDM_FORMAT, + EDM_POS, + EDM_MAX, +} EditMode; + +typedef enum FormatType { + FMT_HEX, + FMT_SIGN, + FMT_UNSIGN, + FMT_FLOAT, + FMT_MAX, +} FormatType; + +#define WRAP_MODE(val, max) ((u8) ((val) + (max)) % max) + +static void* objPointers[] = { NULL, NULL, NULL, gScenery, gSprites, gActors, gBosses, gItems, gEffects, gPlayerShots }; +static size_t objSizes[] = { 0, + sizeof(Player), + sizeof(Scenery360), + sizeof(Scenery), + sizeof(Sprite), + sizeof(Actor), + sizeof(Boss), + sizeof(Item), + sizeof(Effect), + sizeof(PlayerShot) }; +static s32 objCounts[] = { 1, + 1, + 200, + ARRAY_COUNT(gScenery), + ARRAY_COUNT(gSprites), + ARRAY_COUNT(gActors), + ARRAY_COUNT(gBosses), + ARRAY_COUNT(gItems), + ARRAY_COUNT(gEffects), + ARRAY_COUNT(gPlayerShots) }; + +void ObjectRam_EditPosition(RamEntry* entry) { + if ((contPress->button & U_JPAD) && (entry->y > 0)) { + entry->y--; + } else if ((contPress->button & D_JPAD) && (entry->y < SCREEN_HEIGHT)) { + entry->y++; + } else if ((contPress->button & L_JPAD) && (entry->x > 0)) { + entry->x--; + } else if ((contPress->button & R_JPAD) && (entry->x < SCREEN_WIDTH / 2)) { + entry->x++; + } +} + +void ObjectRam_EditObject(RamEntry* entry) { + if (contPress->button & U_JPAD) { + entry->type++; + if ((entry->type == ORAM_SCENE360) && (gLevelMode != LEVELMODE_ALL_RANGE)) { + entry->type = ORAM_SCENERY; + } else if ((entry->type == ORAM_SCENERY) && (gLevelClearScreenTimer == LEVELMODE_ALL_RANGE)) { + entry->type = ORAM_SPRITE; + } + } else if (contPress->button & D_JPAD) { + entry->type--; + if ((entry->type == ORAM_SCENE360) && (gLevelMode != LEVELMODE_ALL_RANGE)) { + entry->type = ORAM_PLAYER; + } else if ((entry->type == ORAM_SCENERY) && (gLevelClearScreenTimer == LEVELMODE_ALL_RANGE)) { + entry->type = ORAM_SCENE360; + } + } + entry->type = WRAP_MODE(entry->type, ORAM_MAX); + if (entry->type == 0) { + return; + } + if (entry->index >= objCounts[entry->type]) { + entry->index = objCounts[entry->type] - 1; + } + if (entry->offset >= objSizes[entry->type]) { + entry->offset = objSizes[entry->type] - (1 << entry->width); + } + if (contPress->button & L_JPAD) { + entry->index--; + } else if (contPress->button & R_JPAD) { + entry->index++; + } + + entry->index = WRAP_MODE(entry->index, objCounts[entry->type]); +} + +void ObjectRam_EditFormat(RamEntry* entry) { + if ((contPress->button & U_JPAD) && (entry->width < 2)) { + entry->width++; + } else if ((contPress->button & D_JPAD) && (entry->width > 0)) { + entry->width--; + } else if (contPress->button & L_JPAD) { + entry->fmt--; + } else if (contPress->button & R_JPAD) { + entry->fmt++; + } + entry->fmt = WRAP_MODE(entry->fmt, FMT_MAX); + if (entry->fmt == FMT_FLOAT) { + entry->width = 2; + } + entry->offset &= ~((1 << entry->width) - 1); +} + +void ObjectRam_EditAddress(RamEntry* entry) { + if (contPress->button & U_JPAD) { + entry->offset += 0x10; + } else if (contPress->button & D_JPAD) { + entry->offset -= 0x10; + } else if (contPress->button & L_JPAD) { + entry->offset -= 1 << entry->width; + } else if (contPress->button & R_JPAD) { + entry->offset += 1 << entry->width; + } else if (contPress->button & R_TRIG) { + entry->offset += 0x100; + } else if (contPress->button & Z_TRIG) { + entry->offset -= 0x100; + } + if (entry->offset < 0) { + entry->offset = 0; + } else if (entry->offset >= objSizes[entry->type]) { + entry->offset = objSizes[entry->type] - (1 << entry->width); + } +} + +void ObjectRam_Select(void) { + if (contPress->button & U_JPAD) { + selectIndex--; + } else if (contPress->button & D_JPAD) { + selectIndex++; + } else if (contPress->button & L_JPAD) { + editMode--; + } else if (contPress->button & R_JPAD) { + editMode++; + ; + } + selectIndex = WRAP_MODE(selectIndex, ARRAY_COUNT(oRamEntries)); + editMode = WRAP_MODE(editMode, EDM_MAX); + if (oRamEntries[selectIndex].type == ORAM_NONE) { + editMode = EDM_TYPE; + } +} + +u32 ObjectRam_GetData(RamEntry* entry) { + fu data; + uintptr_t ptr; + + if ((entry->type <= ORAM_NONE) || (entry->type >= ORAM_MAX)) { + return 0; + } + ptr = (uintptr_t) objPointers[entry->type] + entry->index * objSizes[entry->type]; + + switch (entry->width) { + case 0: + data.i = *((u8*) (ptr + entry->offset)); + if ((entry->fmt == FMT_SIGN) && (data.i >= 0x80)) { + data.i -= 0x80; + } + break; + case 1: + data.i = *((u16*) (ptr + entry->offset)); + if ((entry->fmt == FMT_SIGN) && (data.i >= 0x8000)) { + data.i -= 0x8000; + } + break; + case 2: + if (entry->fmt == FMT_FLOAT) { + data.f = *((f32*) (ptr + entry->offset)); + } else { + data.i = *((u32*) (ptr + entry->offset)); + } + break; + } + return data.i; +} + +static char* objTypes[] = { "NONE", "PLYR", "S360", "SCEN", "SPRT", "ACTR", "BOSS", "ITEM", "EFCT", "SHOT" }; +static char* fmtTypes[] = { "X", "S", "U", "F" }; + +#define SET_DRAW_COLOR(mode) \ + if ((index == selectIndex) && (editMode == mode)) { \ + if (editing) { \ + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 0, 0, 255); \ + } else { \ + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 128, 0, 255); \ + } \ + } else { \ + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); \ + } + +void ObjectRam_DrawEntry(RamEntry* entry, s32 index) { + fu data; + s32 y = entry->y + 50 + 27 * index; + + SET_DRAW_COLOR(EDM_TYPE) + Graphics_DisplaySmallText(entry->x + 10, y, 1.0f, 1.0f, objTypes[entry->type]); + + if (entry->type == 0) { + return; + } + + Graphics_Printf("%2d", entry->index); + Graphics_DisplaySmallText(entry->x + 45, y, 1.0f, 1.0f, D_801619A0); + SET_DRAW_COLOR(EDM_OFFSET) + Graphics_Printf("%03X", entry->offset); + Graphics_DisplaySmallText(entry->x + 70, y, 1.0f, 1.0f, D_801619A0); + SET_DRAW_COLOR(EDM_FORMAT) + Graphics_DisplaySmallText(entry->x + 10, y + 10, 1.0f, 1.0f, fmtTypes[entry->fmt]); + Graphics_Printf("%-2d", 1 << (entry->width + 3)); + Graphics_DisplaySmallText(entry->x + 20, y + 10, 1.0f, 1.0f, D_801619A0); + + if (index == selectIndex) { + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 192, 0, 255); + } else { + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); + } + + data.i = ObjectRam_GetData(entry); + switch (entry->fmt) { + case FMT_HEX: + Graphics_Printf("%0*X", 1 << (entry->width + 1), data.i); + break; + case FMT_SIGN: + Graphics_Printf("%d", data.i); + break; + case FMT_UNSIGN: + Graphics_Printf("%u", data.i); + break; + case FMT_FLOAT: + Graphics_Printf("%10.2f", data.f); + break; + } + Graphics_DisplaySmallText(entry->x + 40, y + 10, 1.0f, 1.0f, D_801619A0); +} + +static char* omStr[] = { "OBJECT", "OFFSET", "FORMAT", "POSITION" }; + +void ObjectRam_Update(void) { + s32 i; + objPointers[ORAM_PLAYER] = gPlayer; + objPointers[ORAM_SCENE360] = gScenery360; + objCounts[ORAM_PLAYER] = gCamCount; + contPress = &gControllerPress[gMainController]; + + if ((gPlayState == PLAY_PAUSE) && (contPress->button & R_CBUTTONS)) { + oRamActive = 1 - oRamActive; + } + if (!oRamActive || (gPlayState <= PLAY_INIT)) { + return; + } + if (contPress->button & L_TRIG) { + editing ^= 1; + } + if (!editing) { + ObjectRam_Select(); + } else { + switch (editMode) { + case 0: + ObjectRam_EditObject(&oRamEntries[selectIndex]); + break; + case 1: + ObjectRam_EditAddress(&oRamEntries[selectIndex]); + break; + case 2: + ObjectRam_EditFormat(&oRamEntries[selectIndex]); + break; + case 3: + ObjectRam_EditPosition(&oRamEntries[selectIndex]); + break; + } + } + RCP_SetupDL(&gMasterDisp, 0x4C); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); + // Graphics_DisplaySmallText(20, 50, 1.0f, 1.0f, omStr[editMode]); + for (i = 0; i < ARRAY_COUNT(oRamEntries); i++) { + ObjectRam_DrawEntry(&oRamEntries[i], i); + } +} diff --git a/src/mods/sfxjukebox2.c b/src/mods/sfxjukebox2.c new file mode 100644 index 00000000..553a09f0 --- /dev/null +++ b/src/mods/sfxjukebox2.c @@ -0,0 +1,220 @@ +#include "global.h" +#include "fox_map.h" +#include "fox_option.h" +#include "sf64audio_provisional.h" + +extern s32 spectrumAnalyzerMode; +extern bool D_menu_801B9320; +extern s32 D_menu_801B9244; +extern OptionId D_menu_801B9124; +extern s32 D_menu_801B912C; + +static s32 showJukebox = 0; +static u32 prevSfx = 0; +static u32 sfx = 0; +static s32 sfxId = 0; +static u32 sfxBank = 0; +static u32 sfxRange = 0; +static s32 sfxImport = 0; +static int holdTimer = 0; +static u8 sfxFlag = 0; +static u8 sfxFlags[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +static char* flagNames[] = { "F18", "F19", "F20", "F21", "F22", "F23", "STT", "F25", "F26", "SFX" }; +static u8 bankSizes[] = { 0x33, 0x85, 0x9B, 0x9C, 0x37 }; +static u32 sfxEditMode = 9; +static u32 srcEditMode = 0; +static u32 editMode = 0; +static s32 srcVec[3] = { 0, 0, 0 }; +static f32 sfxSource[3] = { 0.0f, 0.0f, 0.0f }; + +void Jukebox_SelectFlag(u8* flag) { + if (gControllerPress[gMainController].button & (U_CBUTTONS | D_CBUTTONS)) { + *flag ^= 1; + } +} + +void Jukebox_SelectWrap(u32* option, s32 range) { + if (gControllerPress[gMainController].button & U_CBUTTONS) { + (*option)++; + } else if (gControllerPress[gMainController].button & D_CBUTTONS) { + (*option)--; + } + *option = (*option + range) % range; +} + +Jukebox_SelectClamp(s32* option, s32 range, s32 skip) { + OSContPad* contPress = &gControllerPress[gMainController]; + OSContPad* contHold = &gControllerHold[gMainController]; + + if (contHold->button & (U_CBUTTONS | D_CBUTTONS)) { + holdTimer++; + } else { + holdTimer = 0; + } + + if (((contHold->button & U_CBUTTONS) && (holdTimer > 15)) || (contPress->button & U_CBUTTONS)) { + (*option)++; + } else if (((contHold->button & D_CBUTTONS) && (holdTimer > 15)) || (contPress->button & D_CBUTTONS)) { + (*option)--; + } else if (contPress->button & L_CBUTTONS) { + *option -= skip; + } else if (contPress->button & R_CBUTTONS) { + *option += skip; + } + if (*option < 0) { + *option = 0; + } else if (*option >= range) { + *option = range - 1; + } +} + +void Jukebox_UpdateSource(void) { + OSContPad* contPress = &gControllerPress[gMainController]; + OSContPad* contHold = &gControllerHold[gMainController]; + + if (contPress->button & L_JPAD) { + srcEditMode--; + } else if (contPress->button & R_JPAD) { + srcEditMode++; + } + srcEditMode = (srcEditMode + 3) % 3; + + if (contHold->button & (U_CBUTTONS | D_CBUTTONS | L_CBUTTONS | R_CBUTTONS)) { + holdTimer++; + } else { + holdTimer = 0; + } + + if (((contHold->button & U_CBUTTONS) && (holdTimer > 15)) || (contPress->button & U_CBUTTONS)) { + sfxSource[srcEditMode] += 100.0f; + } else if (((contHold->button & D_CBUTTONS) && (holdTimer > 15)) || (contPress->button & D_CBUTTONS)) { + sfxSource[srcEditMode] -= 100.0f; + } else if (((contHold->button & R_CBUTTONS) && (holdTimer > 15)) || (contPress->button & R_CBUTTONS)) { + sfxSource[srcEditMode] += 10.0f; + } else if (((contHold->button & L_CBUTTONS) && (holdTimer > 15)) || (contPress->button & L_CBUTTONS)) { + sfxSource[srcEditMode] -= 10.0f; + } +} + +void Jukebox_UpdateSfx(void) { + if (gControllerPress[gMainController].button & L_JPAD) { + sfxEditMode--; + } else if (gControllerPress[gMainController].button & R_JPAD) { + sfxEditMode++; + } + sfxEditMode = (sfxEditMode + 13) % 13; + switch (sfxEditMode) { + case 9: + Jukebox_SelectWrap(&sfxBank, 5); + break; + case 10: + Jukebox_SelectClamp(&sfxId, bankSizes[sfxBank], 0x10); + break; + case 11: + Jukebox_SelectFlag(&sfxFlag); + break; + case 12: + Jukebox_SelectWrap(&sfxRange, 4); + break; + case 8: + Jukebox_SelectClamp(&sfxImport, 0x100, 0x10); + break; + default: + if ((sfxEditMode >= 0) && (sfxEditMode < 8)) { + Jukebox_SelectFlag(&sfxFlags[sfxEditMode]); + } + break; + } + sfx = SFX_PACK(sfxBank, sfxRange, sfxImport, sfxId, 1, sfxFlag, sfxFlags[7], sfxFlags[6], sfxFlags[5], sfxFlags[4], + sfxFlags[3], sfxFlags[2], sfxFlags[1], sfxFlags[0]); +} + +s32 sfxModeX[] = { 95, 104, 113, 122, 131, 140, 149, 158, 180, 0, 22, 43, 60 }; +s32 srcModeX[] = { 45, 135, 225 }; +void Jukebox_Update(void) { + s32 i; + OSContPad* contPress = &gControllerPress[gMainController]; + OSContPad* contHold = &gControllerHold[gMainController]; + + if (contPress->button & U_JPAD) { + editMode--; + } else if (contPress->button & D_JPAD) { + editMode++; + } + editMode %= 2; + switch (editMode) { + case 0: + Jukebox_UpdateSfx(); + break; + case 1: + Jukebox_UpdateSource(); + break; + } + + if (prevSfx != sfx) { + AUDIO_PLAY_SFX(0x49000002, gDefaultSfxSource, 4); + prevSfx = sfx; + } + + if (contPress->button & A_BUTTON) { + SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); + SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); + AUDIO_PLAY_SFX(sfx, sfxSource, 4); + D_menu_801B9320 = true; + } + + if (contPress->button & B_BUTTON) { + if (!D_menu_801B9320) { + AUDIO_PLAY_BGM(SEQ_ID_MENU); + gDrawMode = DRAW_NONE; + D_menu_801B9124 = 1000; + D_menu_801B912C = 0; + D_menu_801B9244 = 1; + return; + } else { + AUDIO_PLAY_SFX(0x4900101D, gDefaultSfxSource, 4); + Audio_KillSfxBySource(sfxSource); + SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); + SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); + D_menu_801B9320 = false; + } + } + + // Spectrum Analyzer mode selector + if (contPress->button & Z_TRIG) { + spectrumAnalyzerMode++; + if (spectrumAnalyzerMode > 2) { + spectrumAnalyzerMode = 0; + } + } + + /* Draw */ + + RCP_SetupDL(&gMasterDisp, 0x53); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); + + Graphics_Printf("SFX ID: %08X", sfx); + Graphics_DisplaySmallText(20, 50, 1.0f, 1.0f, D_801619A0); + Graphics_DisplaySmallText(20, 80, 1.0f, 1.0f, "B ID X R S FLAG IMP"); + Graphics_Printf("%d %02X %d %d %d %d%d%d%d%d%d%d%d %02X", sfxBank, sfxId, sfxFlag, sfxRange, 1, sfxFlags[0], + sfxFlags[1], sfxFlags[2], sfxFlags[3], sfxFlags[4], sfxFlags[5], sfxFlags[6], sfxFlags[7], + sfxImport); + Graphics_DisplaySmallText(20, 70, 1.0f, 1.0f, D_801619A0); + + // Graphics_DisplaySmallText(80, 50, 1.0f, 1.0f, hexString); + for (i = 0; i < 3; i++) { + Graphics_Printf("%5.0f", sfxSource[i]); + Graphics_DisplaySmallText(20 + 90 * i, 100, 1.0f, 1.0f, D_801619A0); + } + Graphics_DisplaySmallText(45, 110, 1.0f, 1.0f, "X"); + Graphics_DisplaySmallText(135, 110, 1.0f, 1.0f, "Y"); + Graphics_DisplaySmallText(225, 110, 1.0f, 1.0f, "Z"); + switch (editMode) { + case 0: + Graphics_DisplaySmallText(20 + sfxModeX[sfxEditMode], 60, 1.0f, 1.0f, "V"); + break; + case 1: + Graphics_DisplaySmallText(45 + 90 * srcEditMode, 90, 1.0f, 1.0f, "V"); + break; + } +} diff --git a/src/overlays/ovl_menu/fox_option.c b/src/overlays/ovl_menu/fox_option.c index 5f82b0ef..9bbc8ea3 100644 --- a/src/overlays/ovl_menu/fox_option.c +++ b/src/overlays/ovl_menu/fox_option.c @@ -1653,14 +1653,25 @@ void Option_ExpertSoundInit(void) { // clang-format on } -// Expert Sound Options #if MODS_SFX_JUKEBOX == 1 -#include "../../mods/sfxjukebox.c" -#else +#include "../../mods/sfxjukebox2.c" +#endif + +// Expert Sound Options void Option_ExpertSoundUpdate(void) { s32 pad; f32 sp28 = D_menu_801B931C; +#if MODS_SFX_JUKEBOX == 1 + if (gControllerPress[gMainController].button & L_TRIG) { + showJukebox ^= 1; + } + if (showJukebox) { + Jukebox_Update(); + return; + } +#endif + if (Option_8019C66C(&sp28, 0.0f, 49.0f, &D_menu_801B9290) != 0) { AUDIO_PLAY_SFX(0x49000002, gDefaultSfxSource, 4); D_menu_801B931C = sp28; @@ -1695,7 +1706,6 @@ void Option_ExpertSoundUpdate(void) { } } } -#endif void Option_ExpertSoundDraw(void) { u8* temp_v0_4; @@ -1728,16 +1738,24 @@ void Option_ExpertSoundDraw(void) { Option_DrawMenuLabel(); - RCP_SetupDL(&gMasterDisp, 0x53); +#if MODS_SFX_JUKEBOX == 1 + if (!showJukebox) { +#endif - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); + RCP_SetupDL(&gMasterDisp, 0x53); - TextureRect_8bIA(&gMasterDisp, D_OPT_80079F0, 128, 14, 49.0f, 81.0f, 1.0f, 1.0f); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - TextureRect_8bIA(&gMasterDisp, D_menu_801AECF8[D_menu_801B931C / 10], 16, 15, 230.0f, 82.0f, 1.0f, 1.0f); + TextureRect_8bIA(&gMasterDisp, D_OPT_80079F0, 128, 14, 49.0f, 81.0f, 1.0f, 1.0f); - TextureRect_8bIA(&gMasterDisp, D_menu_801AECF8[D_menu_801B931C % 10], 16, 15, 244.0f, 82.0f, 1.0f, 1.0f); + TextureRect_8bIA(&gMasterDisp, D_menu_801AECF8[D_menu_801B931C / 10], 16, 15, 230.0f, 82.0f, 1.0f, 1.0f); + + TextureRect_8bIA(&gMasterDisp, D_menu_801AECF8[D_menu_801B931C % 10], 16, 15, 244.0f, 82.0f, 1.0f, 1.0f); + +#if MODS_SFX_JUKEBOX == 1 + } +#endif Option_8019B7D4(); diff --git a/tools/Torch b/tools/Torch index 4d6744dc..e6de3268 160000 --- a/tools/Torch +++ b/tools/Torch @@ -1 +1 @@ -Subproject commit 4d6744dcaca3bb1902a74e823353d7d79c6d3d39 +Subproject commit e6de326810c4f56810e98d4e2812995df29bfbb9