diff --git a/patches/debug.c b/patches/debug.c new file mode 100644 index 0000000..eea0ec8 --- /dev/null +++ b/patches/debug.c @@ -0,0 +1,642 @@ +#include "patches.h" + +#if DEBUG_MENU == 1 +RECOMP_PATCH +void debugMenu(void) { + char buffer[16]; + + AlphaPalette* palette; + Cloud* cloud; + u8 i; + u32 j; + + if (D_8012C470 == 4) + return; + + if ((!gDebugMenu) && (gCheatWeatherConfig == 0)) + return; + + // _debugPlayerNum = (((D_8012C470) > 3) ? 3 : D_8012C470); + // @recomp + _debugPlayerNum = 0; + + if (gButton[_debugPlayerNum] & 0x1000) { + if (!_screenSelectButtonPressed_000E0589) { + _screenSelectButtonPressed_000E0589 = 1; + _debugScreen_000E0588++; + } + } else { + _screenSelectButtonPressed_000E0589 = 0; + } + + if (gCheatWeatherConfig == 0) { + _debugScreen_000E0588 &= 0xF; + } else { + if (_debugScreen_000E0588 == 9) + _debugScreen_000E0588 = 0; + + if (_debugScreen_000E0588 != 0xFF) { + _debugScreen_000E0588 %= 6; + if (_debugScreen_000E0588 == 5) + _debugScreen_000E0588 = 0xFF; + } + } + switch (_debugScreen_000E0588) { + case 0: + if (gButton[_debugPlayerNum] & 0x8000) + gFog[0].color[0].r = (((gFog[0].color[0].r + 1) > 255) ? 255 : gFog[0].color[0].r + 1); + if (gButton[_debugPlayerNum] & 0x0004) + gFog[0].color[0].g = (((gFog[0].color[0].g + 1) > 255) ? 255 : gFog[0].color[0].g + 1); + if (gButton[_debugPlayerNum] & 0x0001) + gFog[0].color[0].b = (((gFog[0].color[0].b + 1) > 255) ? 255 : gFog[0].color[0].b + 1); + if (gButton[_debugPlayerNum] & 0x4000) + gFog[0].color[0].r = (((gFog[0].color[0].r - 1) < 0) ? 0 : gFog[0].color[0].r - 1); + if (gButton[_debugPlayerNum] & 0x0002) + gFog[0].color[0].g = (((gFog[0].color[0].g - 1) < 0) ? 0 : gFog[0].color[0].g - 1); + if (gButton[_debugPlayerNum] & 0x0008) + gFog[0].color[0].b = (((gFog[0].color[0].b - 1) < 0) ? 0 : gFog[0].color[0].b - 1); + if (gButton[_debugPlayerNum] & 0x0010) + gFog[0].scale[0].fr = (((gFog[0].scale[0].fr + 1) > 3000) ? 3000 : gFog[0].scale[0].fr + 1); + if (gButton[_debugPlayerNum] & 0x0100) + gFog[0].scale[0].nr = (((gFog[0].scale[0].nr + 1) > 3000) ? 3000 : gFog[0].scale[0].nr + 1); + if (gButton[_debugPlayerNum] & 0x0020) + gFog[0].scale[0].fr = (((gFog[0].scale[0].fr - 1) < 0) ? 0 : gFog[0].scale[0].fr - 1); + if (gButton[_debugPlayerNum] & 0x0200) + gFog[0].scale[0].nr = (((gFog[0].scale[0].nr - 1) < 0) ? 0 : gFog[0].scale[0].nr - 1); + + gFog[0].scale[0].fr = + ((gFog[0].scale[0].fr) > (gFog[0].scale[0].nr + 3) ? (gFog[0].scale[0].fr) : (gFog[0].scale[0].nr + 3)); + gFog[0].scale[1].nr = gFog[0].scale[0].nr; + gFog[0].scale[1].fr = gFog[0].scale[0].fr; + gFog[0].unk1E = 0; + gFog[0].color[1].r = gFog[0].color[0].r; + gFog[0].color[1].g = gFog[0].color[0].g; + gFog[0].color[1].b = gFog[0].color[0].b; + + drawDebugString(25, 20, "FOG"); + sprintf(buffer, "R %d", gFog[0].color[0].r); + drawDebugString(25, 30, buffer); + sprintf(buffer, "G %d", gFog[0].color[0].g); + drawDebugString(25, 40, buffer); + sprintf(buffer, "B %d", gFog[0].color[0].b); + drawDebugString(25, 50, buffer); + sprintf(buffer, "NR %d", gFog[0].scale[0].nr); + drawDebugString(25, 60, buffer); + sprintf(buffer, "FR %d", gFog[0].scale[0].fr); + drawDebugString(25, 70, buffer); + break; + case 1: + if (gButton[_debugPlayerNum] & 0x8000) + gSkyTopR = (((gSkyTopR + 1) > 255) ? 255 : gSkyTopR + 1); + if (gButton[_debugPlayerNum] & 0x0004) + gSkyTopG = (((gSkyTopG + 1) > 255) ? 255 : gSkyTopG + 1); + if (gButton[_debugPlayerNum] & 0x0001) + gSkyTopB = (((gSkyTopB + 1) > 255) ? 255 : gSkyTopB + 1); + if (gButton[_debugPlayerNum] & 0x4000) + gSkyTopR = (((gSkyTopR - 1) < 0) ? 0 : gSkyTopR - 1); + if (gButton[_debugPlayerNum] & 0x0002) + gSkyTopG = (((gSkyTopG - 1) < 0) ? 0 : gSkyTopG - 1); + if (gButton[_debugPlayerNum] & 0x0008) + gSkyTopB = (((gSkyTopB - 1) < 0) ? 0 : gSkyTopB - 1); + + drawDebugString(25, 20, "SKY TOP"); + sprintf(buffer, "R %d", gSkyTopR); + drawDebugString(25, 30, buffer); + sprintf(buffer, "G %d", gSkyTopG); + drawDebugString(25, 40, buffer); + sprintf(buffer, "B %d", gSkyTopB); + drawDebugString(25, 50, buffer); + break; + case 2: + if (gButton[_debugPlayerNum] & 0x8000) + gSkyBottomR = (((gSkyBottomR + 1) > 255) ? 255 : gSkyBottomR + 1); + if (gButton[_debugPlayerNum] & 0x0004) + gSkyBottomG = (((gSkyBottomG + 1) > 255) ? 255 : gSkyBottomG + 1); + if (gButton[_debugPlayerNum] & 0x0001) + gSkyBottomB = (((gSkyBottomB + 1) > 255) ? 255 : gSkyBottomB + 1); + if (gButton[_debugPlayerNum] & 0x4000) + gSkyBottomR = (((gSkyBottomR - 1) < 0) ? 0 : gSkyBottomR - 1); + if (gButton[_debugPlayerNum] & 0x0002) + gSkyBottomG = (((gSkyBottomG - 1) < 0) ? 0 : gSkyBottomG - 1); + if (gButton[_debugPlayerNum] & 0x0008) + gSkyBottomB = (((gSkyBottomB - 1) < 0) ? 0 : gSkyBottomB - 1); + + drawDebugString(25, 20, "SKY BOTTOM"); + sprintf(buffer, "R %d", gSkyBottomR); + drawDebugString(25, 30, buffer); + sprintf(buffer, "G %d", gSkyBottomG); + drawDebugString(25, 40, buffer); + sprintf(buffer, "B %d", gSkyBottomB); + drawDebugString(25, 50, buffer); + break; + case 3: + case 4: + i = _debugScreen_000E0588 - 3; + cloud = &gCloud[i]; + if (gButton[_debugPlayerNum] & 0x8000) + cloud->fog.r = (((cloud->fog.r + 1) > 255) ? 255 : cloud->fog.r + 1); + if (gButton[_debugPlayerNum] & 0x0004) + cloud->fog.g = (((cloud->fog.g + 1) > 255) ? 255 : cloud->fog.g + 1); + if (gButton[_debugPlayerNum] & 0x0001) + cloud->fog.b = (((cloud->fog.b + 1) > 255) ? 255 : cloud->fog.b + 1); + if (gButton[_debugPlayerNum] & 0x4000) + cloud->fog.r = (((cloud->fog.r - 1) < 0) ? 0 : cloud->fog.r - 1); + if (gButton[_debugPlayerNum] & 0x0002) + cloud->fog.g = (((cloud->fog.g - 1) < 0) ? 0 : cloud->fog.g - 1); + if (gButton[_debugPlayerNum] & 0x0008) + cloud->fog.b = (((cloud->fog.b - 1) < 0) ? 0 : cloud->fog.b - 1); + if (gButton[_debugPlayerNum] & 0x0010) + cloud->height += 300; + if (gButton[_debugPlayerNum] & 0x0020) + cloud->height -= 300; + if (gButton[_debugPlayerNum] & 0x0100) + gCloudSpeed[i] = (((gCloudSpeed[i] + 1) > 1023) ? 1023 : gCloudSpeed[i] + 1); + if (gButton[_debugPlayerNum] & 0x0200) + gCloudSpeed[i] = (((gCloudSpeed[i] - 1) < 0) ? 0 : gCloudSpeed[i] - 1); + if (gButton[_debugPlayerNum] & 0x0800) + gCloudAng[i] = (gCloudAng[i] + 4) & 0x7FF; + if (gButton[_debugPlayerNum] & 0x0400) + gCloudAng[i] = (gCloudAng[i] - 4) & 0x7FF; + + cloud->unk8 = (-cosf((gCloudAng[i] * (3.14159265359 / 1024))) * gCloudSpeed[i]) / 50.0f; + cloud->unkC = (-sinf((gCloudAng[i] * (3.14159265359 / 1024))) * gCloudSpeed[i]) / 50.0f; + + sprintf(buffer, "CLOUDS %d", i + 1); + drawDebugString(25, 20, buffer); + sprintf(buffer, "R %d", cloud->fog.r); + drawDebugString(25, 30, buffer); + sprintf(buffer, "G %d", cloud->fog.g); + drawDebugString(25, 40, buffer); + sprintf(buffer, "B %d", cloud->fog.b); + drawDebugString(25, 50, buffer); + sprintf(buffer, "HT %d", cloud->height / 10); + drawDebugString(25, 60, buffer); + sprintf(buffer, "AN %d", gCloudAng[i]); + drawDebugString(25, 70, buffer); + sprintf(buffer, "SP %d", gCloudSpeed[i]); + drawDebugString(25, 80, buffer); + break; + case 5: + drawDebugString(25, 20, "PLAYER"); + sprintf(buffer, "XV %d", gPlayer[0].xvect); + drawDebugString(25, 30, buffer); + sprintf(buffer, "YV %d", gPlayer[0].yvect); + drawDebugString(25, 40, buffer); + sprintf(buffer, "ZV %d", gPlayer[0].zvect); + drawDebugString(25, 50, buffer); + sprintf(buffer, "OF %d", gPlayer[0].unk59); + drawDebugString(25, 60, buffer); + sprintf(buffer, "OW %d", gPlayer[0].unk56); + drawDebugString(25, 70, buffer); + sprintf(buffer, "JF %d", gPlayer[0].unk44); + drawDebugString(25, 80, buffer); + sprintf(buffer, "DN %d", gPlayer[0].skin); + drawDebugString(25, 90, buffer); + + if (!_cmdButtonPressed_000E058A) { + if (gButton[_debugPlayerNum] & 0x0020) { + gPlayer[0].skin--; + if (gPlayer[0].skin < 0) + gPlayer[0].skin = D_80138780 - 1; + _cmdButtonPressed_000E058A = 1; + gpSprite[gPlayer[0].unk4A].picnum = D_8012F6E4[gPlayer[0].skin].picnum; + } + if (gButton[_debugPlayerNum] & 0x0010) { + gPlayer[0].skin++; + if (gPlayer[0].skin >= D_80138780) + gPlayer[0].skin = 0; + _cmdButtonPressed_000E058A = 1; + gpSprite[gPlayer[0].unk4A].picnum = D_8012F6E4[gPlayer[0].skin].picnum; + } + } else if ((gButton[_debugPlayerNum] & (0x0020 | 0x0010)) == 0) { + _cmdButtonPressed_000E058A = 0; + } + + break; + case 6: + drawDebugString(25, 20, "GFX"); + sprintf(buffer, "GLIST %d - %d", gDisplayListSize, gDisplayListMaxSize); + drawDebugString(25, 30, buffer); + sprintf(buffer, "VLIST %d - %d", gVertexN64Size, gVertexN64MaxSize); + drawDebugString(25, 40, buffer); + sprintf(buffer, "GFX TIME %d", gGfxTime); + drawDebugString(25, 50, buffer); + j = func_80040C08(3); + sprintf(buffer, "DRAW TIME %d", j); + drawDebugString(25, 60, buffer); + j = func_80040C08(1); + sprintf(buffer, "MOVE1 TIME %d", j); + drawDebugString(25, 70, buffer); + j = func_80040C08(2); + sprintf(buffer, "MOVE2 TIME %d", j); + drawDebugString(25, 80, buffer); + sprintf(buffer, "CACHE %d/%d", getRemainingCacheSize(), gCacheNum); + drawDebugString(25, 0x5A, buffer); + sprintf(buffer, "LIST %d%%", getDisplayListVertexUsagePercentage()); + drawDebugString(25, 0x64, buffer); + break; + case 7: + drawDebugString(25, 20, "AI"); + sprintf(buffer, "Ai: %d", gDisableAI); + drawDebugString(25, 30, buffer); + sprintf(buffer, "Alert Aliens: %d", gAlertAliens); + drawDebugString(25, 40, buffer); + sprintf(buffer, "Snoozing Aliens: %d", gSnoozingAliens); + drawDebugString(25, 50, buffer); + sprintf(buffer, "AutoAim: %d", gAutoAim); + drawDebugString(25, 60, buffer); + sprintf(buffer, "Difficulty (0=E, 1=M, 2=H) : %d", gConfig.difficulty); + drawDebugString(25, 70, buffer); + sprintf(buffer, "Invul: %d", gInvulnerability); + drawDebugString(25, 80, buffer); + + if ((!_cmdButtonPressed_000E058A)) { + if (gButton[_debugPlayerNum] & 0x8000) { + _cmdButtonPressed_000E058A = 1; + gDisableAI ^= 1; + } + } + if ((!_cmdButtonPressed_000E058A)) { + if (gButton[_debugPlayerNum] & 0x0020) { + gConfig.difficulty++; + if (gConfig.difficulty >= 3) + gConfig.difficulty = 0; + func_80050408(); + _cmdButtonPressed_000E058A = 1; + } + } + if ((!_cmdButtonPressed_000E058A)) { + if (gButton[_debugPlayerNum] & 0x0010) { + _cmdButtonPressed_000E058A = 1; + gAutoAim ^= 1; + } + break; + } else if ((gButton[_debugPlayerNum] & (0x8000 | 0x4000 | 0x0020 | 0x0010)) == 0) { + _cmdButtonPressed_000E058A = 0; + } + break; + case 8: + palette = gpAlphaPalette; + if (gButton[_debugPlayerNum] & 0x8000) + palette->primary.r = (((palette->primary.r + 1) > 255) ? 255 : palette->primary.r + 1); + if (gButton[_debugPlayerNum] & 0x0004) + palette->primary.g = (((palette->primary.g + 1) > 255) ? 255 : palette->primary.g + 1); + if (gButton[_debugPlayerNum] & 0x0001) + palette->primary.b = (((palette->primary.b + 1) > 255) ? 255 : palette->primary.b + 1); + if (gButton[_debugPlayerNum] & 0x4000) + palette->primary.r = (((palette->primary.r - 1) < 0) ? 0 : palette->primary.r - 1); + if (gButton[_debugPlayerNum] & 0x0002) + palette->primary.g = (((palette->primary.g - 1) < 0) ? 0 : palette->primary.g - 1); + if (gButton[_debugPlayerNum] & 0x0008) + palette->primary.b = (((palette->primary.b - 1) < 0) ? 0 : palette->primary.b - 1); + if (gButton[_debugPlayerNum] & 0x0010) + palette->env.r = (((palette->env.r + 1) > 255) ? 255 : palette->env.r + 1); + if (gButton[_debugPlayerNum] & 0x0100) + palette->env.g = (((palette->env.g + 1) > 255) ? 255 : palette->env.g + 1); + if (gButton[_debugPlayerNum] & 0x0800) + palette->env.b = (((palette->env.b + 1) > 255) ? 255 : palette->env.b + 1); + if (gButton[_debugPlayerNum] & 0x0020) + palette->env.r = (((palette->env.r - 1) < 0) ? 0 : palette->env.r - 1); + if (gButton[_debugPlayerNum] & 0x0200) + palette->env.g = (((palette->env.g - 1) < 0) ? 0 : palette->env.g - 1); + if (gButton[_debugPlayerNum] & 0x0400) + palette->env.b = (((palette->env.b - 1) < 0) ? 0 : palette->env.b - 1); + + drawDebugString(25, 20, "ALPHA PALETTE"); + sprintf(buffer, "R0 %d", palette->primary.r); + drawDebugString(25, 30, buffer); + sprintf(buffer, "G0 %d", palette->primary.g); + drawDebugString(25, 40, buffer); + sprintf(buffer, "B0 %d", palette->primary.b); + drawDebugString(25, 50, buffer); + sprintf(buffer, "R1 %d", palette->env.r); + drawDebugString(25, 60, buffer); + sprintf(buffer, "G1 %d", palette->env.g); + drawDebugString(25, 70, buffer); + sprintf(buffer, "B1 %d", palette->env.b); + drawDebugString(25, 80, buffer); + break; + case 9: + drawDebugString(25, 20, "SFX"); + sprintf(buffer, "FX %d", _sfxnum_000E0556); + drawDebugString(25, 30, buffer); + sprintf(buffer, "KILLS %d:%d", D_801A1958.enemies_killed, D_801A1958.enemies_total); + drawDebugString(25, 40, buffer); + + if (!_cmdButtonPressed_000E058A) { + if (gButton[_debugPlayerNum] & 0x8000) { + _cmdButtonPressed_000E058A = 1; + gPlayer[0].third_person = 1; + gPlayer[0].unk64 = 0; + } + if (gButton[_debugPlayerNum] & 0x4000) { + _cmdButtonPressed_000E058A = 1; + gPlayer[0].third_person = 0; + gPlayer[0].unk64 = 0; + } + if (gButton[_debugPlayerNum] & 0x0010) { + _cmdButtonPressed_000E058A = 1; + _sfxnum_000E0556 = (((_sfxnum_000E0556 + 1) > 2000) ? 2000 : _sfxnum_000E0556 + 1); + } + if (gButton[_debugPlayerNum] & 0x0020) { + _cmdButtonPressed_000E058A = 1; + _sfxnum_000E0556 = (((_sfxnum_000E0556 - 1) < 1) ? 1 : _sfxnum_000E0556 - 1); + } + if (gButton[_debugPlayerNum] & 0x0100) { + _cmdButtonPressed_000E058A = 1; + _sfxnum_000E0556 = (((_sfxnum_000E0556 + 10) > 2000) ? 2000 : _sfxnum_000E0556 + 10); + } + if (gButton[_debugPlayerNum] & 0x0200) { + _cmdButtonPressed_000E058A = 1; + _sfxnum_000E0556 = (((_sfxnum_000E0556 - 10) < 1) ? 1 : _sfxnum_000E0556 - 10); + } + if (gButton[_debugPlayerNum] & 0x2000) { + _cmdButtonPressed_000E058A = 1; + MusHandleStop(_mushandle_000E0558, 0); + _mushandle_000E0558 = MusStartEffect(_sfxnum_000E0556); + } + } else if ((gButton[_debugPlayerNum] & (0x8000 | 0x4000 | 0x2000 | 0x0020 | 0x0010)) == 0) { + _cmdButtonPressed_000E058A = 0; + } + break; + case 10: + drawDebugString(25, 20, "LEVEL WARP"); + j = gMapChapter[gLoadMapNum].chapter; + drawDebugString(25, 30, _chapterName_000E055C[j]); + drawDebugString(25, 40, gMapChapter[gLoadMapNum].mapname); + + if (!_cmdButtonPressed_000E058A) { + if (gButton[_debugPlayerNum] & 0x4000) { + func_8008E01C(30, 1); + break; + } + if (gButton[_debugPlayerNum] & 0x0020) { + _cmdButtonPressed_000E058A = 1; + gLoadMapNum--; + if (gLoadMapNum < 0) + for (gLoadMapNum = 0; gMapChapter[gLoadMapNum + 1].chapter != 99; gLoadMapNum++) + ; + } + if (gButton[_debugPlayerNum] & 0x0010) { + _cmdButtonPressed_000E058A = 1; + gLoadMapNum++; + if (gMapChapter[gLoadMapNum].chapter == 99) + gLoadMapNum = 0; + } + if (gButton[_debugPlayerNum] & 0x2000) { + _cmdButtonPressed_000E058A = 1; + func_8008E01C(30, 2); + break; + } + } else if ((gButton[_debugPlayerNum] & (0x8000 | 0x2000 | 0x0020 | 0x0010)) == 0) { + _cmdButtonPressed_000E058A = 0; + } + break; + case 11: + drawDebugString(25, 20, "MIDI"); + + if (!_playAmbient_000E0554) + sprintf(buffer, "TUNE %d", _musicnum_000E0552); + else + sprintf(buffer, "AMBIENT %d", _musicnum_000E0552); + + drawDebugString(25, 30, buffer); + sprintf(buffer, "CHANNELS %d", MusAsk(3)); + drawDebugString(25, 40, buffer); + + if (!_cmdButtonPressed_000E058A) { + if (gButton[_debugPlayerNum] & 0x8000) { + _cmdButtonPressed_000E058A = 1; + if (!_playAmbient_000E0554) + playMusic(_musicnum_000E0552); + else + playAmbient(_musicnum_000E0552); + } + if (gButton[_debugPlayerNum] & 0x4000) { + _cmdButtonPressed_000E058A = 1; + MusStop(2, 0); + } + if (gButton[_debugPlayerNum] & 0x0010) { + _cmdButtonPressed_000E058A = 1; + if (!_playAmbient_000E0554) + _musicnum_000E0552 = (((_musicnum_000E0552 + 1) > 12 - 1) ? 12 - 1 : _musicnum_000E0552 + 1); + else + _musicnum_000E0552 = (((_musicnum_000E0552 + 1) > 9 - 1) ? 9 - 1 : _musicnum_000E0552 + 1); + } + if (gButton[_debugPlayerNum] & 0x0020) { + _cmdButtonPressed_000E058A = 1; + _musicnum_000E0552 = (((_musicnum_000E0552 - 1) < 0) ? 0 : _musicnum_000E0552 - 1); + } + if (gButton[_debugPlayerNum] & 0x2000) { + _cmdButtonPressed_000E058A = 1; + _playAmbient_000E0554 = !_playAmbient_000E0554; + } + } else if ((gButton[_debugPlayerNum] & (0x8000 | 0x4000 | 0x2000 | 0x0020 | 0x0010)) == 0) { + _cmdButtonPressed_000E058A = 0; + } + break; + case 12: + if (gButton[_debugPlayerNum] & 0x8000) + gpGlobalPalette->r = (((gpGlobalPalette->r + 1) > 256) ? 256 : gpGlobalPalette->r + 1); + if (gButton[_debugPlayerNum] & 0x0004) + gpGlobalPalette->g = (((gpGlobalPalette->g + 1) > 256) ? 256 : gpGlobalPalette->g + 1); + if (gButton[_debugPlayerNum] & 0x0001) + gpGlobalPalette->b = (((gpGlobalPalette->b + 1) > 256) ? 256 : gpGlobalPalette->b + 1); + if (gButton[_debugPlayerNum] & 0x4000) + gpGlobalPalette->r = (((gpGlobalPalette->r - 1) < 0) ? 0 : gpGlobalPalette->r - 1); + if (gButton[_debugPlayerNum] & 0x0002) + gpGlobalPalette->g = (((gpGlobalPalette->g - 1) < 0) ? 0 : gpGlobalPalette->g - 1); + if (gButton[_debugPlayerNum] & 0x0008) + gpGlobalPalette->b = (((gpGlobalPalette->b - 1) < 0) ? 0 : gpGlobalPalette->b - 1); + + drawDebugString(25, 20, "GLOBAL PALETTE"); + sprintf(buffer, "R %d", gpGlobalPalette->r); + drawDebugString(25, 30, buffer); + sprintf(buffer, "G %d", gpGlobalPalette->g); + drawDebugString(25, 40, buffer); + sprintf(buffer, "B %d", gpGlobalPalette->b); + drawDebugString(25, 50, buffer); + break; + case 13: + drawDebugString(25, 20, "CHEAT"); + drawDebugString(25, 30, "Z FOR ALL WEAPONS"); + drawDebugString(25, 40, "L FOR ALL ITEMS"); + drawDebugString(25, 50, "R FOR ALL KEYS"); + drawDebugString(25, 60, "A FOR INVUL"); + + if (gButton[_debugPlayerNum] & 0x2000) { + for (j = 0; j < 50; j++) { + if (j - 31 < 2 || j == 30) + continue; + else if (j == 33 || j == 0) + continue; + else if (j == 0 || j == 19) + continue; + else if (j == 22 || j == 1) + continue; + else if (j < (s32) (sizeof(D_8011A680[0]) / sizeof(D_8011A680[0][0]))) { + D_8011A680[0][j][0] |= 1; + D_8011A680[0][j][1] = 999; + } + } + } + + if (gButton[_debugPlayerNum] & 0x0020) { + gActor[gActorSpriteMap[gPlayer[0].unk4A]].unk7E = 100; + for (j = 0; j < (s32) (sizeof(D_8010A940[0].unkA) / sizeof(D_8010A940[0].unkA[0])); j++) + D_8010A940[0].unkA[j] = D_800E17E0[j]; + } + if (gButton[_debugPlayerNum] & 0x0010) { + for (j = 1; j < (s32) (sizeof(gPlayer[0].keys) / sizeof(gPlayer[0].keys[0])); j++) + gPlayer[0].keys[j] = 1; + } + if (gButton[_debugPlayerNum] & 0x8000) { + if (!_cmdButtonPressed_000E058A) { + audio_80008574(0, 945); + gInvulnerability ^= 1; + if (gInvulnerability != 0) + gActor[gActorSpriteMap[gPlayer[0].unk4A]].unk8 = 999; + else + gActor[gActorSpriteMap[gPlayer[0].unk4A]].unk8 = gPlayer[0].unk48; + _cmdButtonPressed_000E058A = 1; + } + } else { + _cmdButtonPressed_000E058A = 0; + } + break; + case 14: + drawDebugString(25, 20, "AI Debug values"); + sprintf(buffer, "Gvar 1 %d", gAiDebugGvar1); + drawDebugString(25, 30, buffer); + sprintf(buffer, "Gvar 2 %d", gAiDebugGvar2); + drawDebugString(25, 40, buffer); + sprintf(buffer, "Gvar 3 %d", gAiDebugGvar3); + drawDebugString(25, 50, buffer); + + if (!_cmdButtonPressed_000E058A) { + if (gButton[_debugPlayerNum] & 0x8000) { + _cmdButtonPressed_000E058A = 1; + if (gButton[_debugPlayerNum] & 0x0020) + gAiDebugGvar1 += 10; + else + gAiDebugGvar1++; + } + if (gButton[_debugPlayerNum] & 0x0004) { + _cmdButtonPressed_000E058A = 1; + if (gButton[_debugPlayerNum] & 0x0020) + gAiDebugGvar2 += 10; + else + gAiDebugGvar2++; + } + if (gButton[_debugPlayerNum] & 0x0001) { + _cmdButtonPressed_000E058A = 1; + if (gButton[_debugPlayerNum] & 0x0020) + gAiDebugGvar3 += 10; + else + gAiDebugGvar3++; + } + if (gButton[_debugPlayerNum] & 0x4000) { + _cmdButtonPressed_000E058A = 1; + if (gButton[_debugPlayerNum] & 0x0020) + gAiDebugGvar1 -= 10; + else + gAiDebugGvar1--; + } + if (gButton[_debugPlayerNum] & 0x0002) { + _cmdButtonPressed_000E058A = 1; + if (gButton[_debugPlayerNum] & 0x0020) + gAiDebugGvar2 -= 10; + else + gAiDebugGvar2--; + } + if (gButton[_debugPlayerNum] & 0x0008) { + _cmdButtonPressed_000E058A = 1; + if (gButton[_debugPlayerNum] & 0x0020) + gAiDebugGvar3 -= 10; + else + gAiDebugGvar3--; + } + } else if ((gButton[_debugPlayerNum] & (0x8000 | 0x4000 | 0x0008 | 0x0002 | 0x0001 | 0x0004)) == 0) { + _cmdButtonPressed_000E058A = 0; + } + break; + } +} +#endif + + +#if DEBUG_SKIP_INTRO == 1 +RECOMP_PATCH void func_800006B4(void) { + s32 i; + if (controller_8008AEF0()) { + for (i = 0; i < ARRAY_COUNT(D_8016D174); i++) { + if (D_8016D174[i] == 0) + break; + } + + D_801CC8CA = i; + // @recomp + // main_80000624(&func_801C6560); + } +} +#endif + +#if DEBUG_SKIP_INTRO == 1 +RECOMP_PATCH +void func_801C15CC(void) { + s32 i; + + // @recomp + D_800BD3F8 = 1; + + D_801CE5D8 = 0x25252525; + allocMemory(320, 240 * 2, 0x1400 * 2, 0); + setCameraPosition(0.0f, 0.0f, -500.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + func_801C10C8(); + func_8007FD8C(&D_800DFA40[0], 0); + D_801CDA94 = D_8010A938; + func_8007FD8C(&D_800DFB08[0], 11); + func_8007FD8C(&D_800E0778[0], 5); + D_801CDA20 = func_8007FC08(&D_800DFA40[0], 0, 0, 0, 500); + edl_80081688(&D_801CF638, 16); + edl_80081688(&D_801CC91C, 17); + edl_80081688(&D_801CC920, 19); + edl_80081688(&D_801CDB1C, 18); + D_801CF70C = func_8008372C(0, &D_801CA310_000F4890[1], 0x9080, &D_801CA3B8_000F4938, 0); + D_801CF62C = D_801ACBD4; + gSPTexture(D_801ACBD4, 0x05BC, 0x05BC, 0, G_TX_RENDERTILE, G_ON); + D_801CC890 = func_8008372C(0, &D_801CA310_000F4890[2], 0, &D_801CA3B8_000F4938, 0); + D_801CC890->unk64 -= 30.0f; + func_801C14B4(D_801CC890, 0, 0, 0xFF); + D_801CF70C->unk3C = -1920.0f; + D_801CDBFC = func_8008372C(0, &D_801CA310_000F4890[3], 0x9080, &D_801CA3B8_000F4938, 0); + D_801CDBFC->unk12 = 80; + D_801CDBFC->unk3C = 400.0f; + func_801C14B4(D_801CDBFC, 0, 0, 0xFF); + D_801CDB04 = 0; + D_801CF630 = 0xFF; + + for (i = 0; i < (s32) (sizeof(D_801CA360_000F48E0) / sizeof(D_801CA360_000F48E0[0])); i++) + func_80083700(0, &D_801CA360_000F48E0[i], 0, 0); + + for (i = 0; i < (s32) (sizeof(D_801CA388_000F4908) / sizeof(D_801CA388_000F4908[0])); i++) + func_80083700(0, &D_801CA388_000F4908[i], 0x1000, 0); + + func_80083700(0, &D_801CA310_000F4890[0], 128, 0); + main_80002390(); + main_80000610(); + func_801C1114(); + func_801C1158(0, 0, 0, 0xFF); + D_801CC88C = -1; + func_801C73A0(); + D_801CF640 = 0; + D_801CC918 = 0; + playSfx(1059); + + if ((gMusicHandle == 0) || (MusHandleAsk(gMusicHandle) == 0) || (gMusicNum != 2)) + playMusic(2); + + D_800BD3F9 = 1; + D_801CD974 = 0; +} +#endif \ No newline at end of file diff --git a/patches/debug.h b/patches/debug.h index c7418dc..3d6b34e 100644 --- a/patches/debug.h +++ b/patches/debug.h @@ -1,4 +1,9 @@ #ifndef DNZHRECOMP_DEBUG #define DNZHRECOMP_DEBUG +#define DEBUG_MENU 0 + +// Not working +#define DEBUG_SKIP_INTRO 0 + #endif \ No newline at end of file diff --git a/patches/externs.h b/patches/externs.h index 3abaee0..807e873 100644 --- a/patches/externs.h +++ b/patches/externs.h @@ -1779,13 +1779,189 @@ extern f32 gMapYpos; extern f32 gMapZpos; extern Matrix4f D_80197DF0; +extern s16 D_8012C470; +extern u16 gCheatWeatherConfig; +extern volatile u16 gButton[4]; +extern u8 _screenSelectButtonPressed_000E0589; +extern u8 _debugScreen_000E0588; +extern Fog gFog[4]; +extern s16 gSkyTopR; +extern s16 gSkyTopG; +extern s16 gSkyTopB; +extern s16 gSkyBottomR; +extern s16 gSkyBottomG; +extern s16 gSkyBottomB; +extern Cloud gCloud[2]; +extern s32 gCloudSpeed[2]; +extern s32 gCloudAng[2]; +extern Player gPlayer[4]; +extern u8 _cmdButtonPressed_000E058A; +extern _11B300UnkStruct1 *D_8012F6E4; +extern s16 D_80138780; +extern SpriteType *gpSprite; +extern u32 gDisplayListSize; +extern s32 gDisplayListMaxSize; +extern u32 gVertexN64Size; +extern s32 gVertexN64MaxSize; +extern s32 gGfxTime; +extern s32 gCacheNum; +extern s32 gDisableAI; +extern s32 gAlertAliens; +extern s32 gSnoozingAliens; +extern s32 gAutoAim; +extern Config gConfig; +extern s32 gInvulnerability; +extern AlphaPalette *gpAlphaPalette; +extern s16 _sfxnum_000E0556; +extern code0UnkStruct4 D_801A1958; +extern musHandle _mushandle_000E0558; +extern MapChapter gMapChapter[39]; +extern s16 gLoadMapNum; +extern char *_chapterName_000E055C[11]; +extern u8 _playAmbient_000E0554; +extern s16 _musicnum_000E0552; +extern GlobalPalette *gpGlobalPalette; +extern Actor gActor[150]; +extern s16 gActorSpriteMap[1500]; +extern code0UnkStruct2 D_8010A940[4]; +extern s16 D_800E17E0[8]; +extern s32 gAiDebugGvar1; +extern s32 gAiDebugGvar2; +extern s32 gAiDebugGvar3; +extern s16 D_8011A680[4][24][10] __attribute__((aligned(16))); +extern u8 D_8016D174[4]; +extern u16 D_801CC8CA; +extern s32 D_801CE5D8; +extern _E0640UnkStruct D_800DFA40[2]; +extern u8 *D_801CDA94; +extern u8 *D_8010A938; +extern _E0640UnkStruct D_800DFB08[0x3D]; +extern _E0640UnkStruct D_800E0778[3]; +extern code0UnkStruct16 *D_801CDA20; +extern u8 *D_801CF638; +extern u8 *D_801CC91C; +extern u8 *D_801CC920; +extern u8 *D_801CDB1C; +extern code0UnkStruct16 *D_801CF70C; +extern _119280UnkStruct1 D_801CA310_000F4890[8]; +extern s32 D_801CF630;extern s32 D_801CDB04; +extern Lights1 D_801CA3B8_000F4938; +extern Gfx *D_801CF62C; +extern Gfx *D_801ACBD4; +extern code0UnkStruct16 *D_801CC890; +extern code0UnkStruct16 *D_801CDBFC; +extern _119280UnkStruct1 D_801CA360_000F48E0[4]; +extern _119280UnkStruct1 D_801CA388_000F4908[3]; +extern s32 D_801CC88C; +extern s16 D_801CF640; +extern u16 D_801CC918; +extern musHandle gMusicHandle; +extern s16 gMusicNum; +extern s8 D_800BD3F9; extern s32 D_801CD974; +extern u8 D_800BD3F8; +extern u8 _debugPlayerNum; +extern u8 gDebugMenu; + float sinf(float angle); float cosf(float angle); +void main_80002390(void); +void main_80000610(void); +void func_801C1114(void); +void func_80083700(s32, _119280UnkStruct1 *, s32, s32); +void func_801C14B4(code0UnkStruct16 *arg0, u8 r, u8 g, u8 b); +void func_801C1158(u8 r, u8 g, u8 b, u8 a); +void func_801C73A0(void); +code0UnkStruct16 *func_8008372C(s32, _119280UnkStruct1 *, s32, Lights1 *, s32); +code0UnkStruct16 *func_8007FC08(_E0640UnkStruct *arg0, void *arg1, s32 arg2, s32 arg3, s32 arg4); +void allocMemory(s32 width, s32 height, s32 dlist_size, s32 vertex_size); +void setCameraPosition(f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp); +void func_801C10C8(void); +void func_8007FD8C(_E0640UnkStruct *arg0, s32 arg1); +void main_80000624(ProcPointer proc); +void func_801C6560(void); +void edl_80081688(void *handle, s32 id); +u8 controller_8008AEF0(void); f32 angleModF(f32 a); void Bmemset(void *dst, u8 value, u32 size); void scanSector(f32 lx, f32 rx, s32 sectnum); f32 func_80011410(ModelInfo *model); void grMtxL2F(f32 (*mf)[4], Mtx *m); f32 _dotProduct(f32 *vec1, f32 *vec2); - +void audio_80008574(s16 playernum, u16 sfxnum);; +void drawDebugString(s16 x, s16 y, char *string); +f32 func_80040C08(s32); +void func_80050408(void); +void func_8008E01C(s16, s32); +s32 getDisplayListVertexUsagePercentage(void);; +void initCache(u8 *dacachestart, s32 dacachesize); +void suckCache(void *suckptr); +void cache1d_8002AAC0(void); +void ageCache(void); +void alloCache(void *newhandle, u32 newbytes, u8 *newlockptr); +void cache1d_8002AAEC(void); +s32 getRemainingCacheSize(void); +void func_80019BC0(void); +void func_8001A1A4(void); +void func_8001B2D0(void); +void drawSky(void); +void drawClouds(void); +void drawDebugString(s16 x, s16 y, char *string); +void drawNumberString(s16 x, s16 y, char *string); +void drawString(s16 x, s16 y, char *string); +void drawString2(s16 x, s16 y, char *string); +void func_8001D238(s32 x, s32 y, u16 tilenum); +void func_8001D128(s32 *x, s32 *y); +int MusAsk(unsigned long flags); +extern void MusSetMasterVolume (unsigned long flags, int volume); +extern musHandle MusStartSong (void *addr); +extern musHandle MusStartSongFromMarker (void *addr, int marker); +extern musHandle MusStartEffect (int number); +extern musHandle MusStartEffect2 (int number, int volume, int pan , int restartflag, int priority); +extern void MusStop (unsigned long flags, int speed); +extern int MusAsk (unsigned long flags); +extern int MusHandleAsk (musHandle handle); +extern int MusHandleStop (musHandle handle, int speed); +extern int MusHandleSetVolume (musHandle handle, int volume); +extern int MusHandleSetPan (musHandle handle, int pan); +extern int MusHandleSetFreqOffset (musHandle handle, float offset); +extern int MusHandleSetTempo (musHandle handle, int tempo); +extern int MusHandleSetReverb (musHandle handle, int reverb); +extern int MusHandlePause (musHandle handle); +extern int MusHandleUnPause (musHandle handle); +extern void *MusHandleGetPtrBank (musHandle handle); +extern void MusPtrBankInitialize (void *pbank, void *wbank); +extern void *MusPtrBankSetSingle (void *ipbank); +extern void MusPtrBankSetCurrent (void *ipbank); +extern void *MusPtrBankGetCurrent (void); +extern void MusFxBankInitialize (void *fxbank); +extern void MusFxBankSetSingle (void *ifxbank); +extern void MusFxBankSetCurrent (void *ifxbank); +extern void *MusFxBankGetCurrent (void); +extern int MusFxBankNumberOfEffects (void *ifxbank); +extern void MusFxBankSetPtrBank (void *ifxbank, void *ipbank); +extern void *MusFxBankGetPtrBank (void *ifxbank); +extern void MusFxBankSetSingle (void *ifxbank); +extern void MusSetMarkerCallback (void *callback); +extern int MusHandleWaveCount (musHandle handle); +extern unsigned short *MusHandleWaveAddress(musHandle handle); +void dmaRomToRam(u8 *rom, u8 *ram, s32 size); +void initAudio(void); +void setVolume(u32 musicvol, u32 mastervol); +void playMusic(s32 musicnum); +void playAmbient(s32 ambientnum); +musHandle playSfx(u16 sfxnum); +musHandle playSfx2(u16 sfxnum, s16 volume, s16 pan, u8 restartflag, s16 priority); +void audio_80006CC0(void); +u8 audio_80007510(s32 x, s32 y); +musHandle audio_800077F4(u16 sfxnum, s16 spritenum); +musHandle audio_80007820(u16 sfxnum, s16 spritenum); +musHandle audio_8000784C(musHandle handle, s16); +musHandle audio_80007A44(u16 sfxnum, s16 spritenum, s32); +musHandle audio_80007A80(musHandle handle, s16, s32); +void audio_80007AB8(void); +void audio_800080E0(s16 playernum, u16); +void audio_80008574(s16 playernum, u16 sfxnum); +musHandle audio_80008604(void); +void audio_800086B0(u16); +void audio_80008710(s16); #endif diff --git a/patches/test.c b/patches/gfx_patches.c similarity index 96% rename from patches/test.c rename to patches/gfx_patches.c index de91b77..6c60464 100644 --- a/patches/test.c +++ b/patches/gfx_patches.c @@ -20,6 +20,11 @@ RECOMP_PATCH void main_80000C74(void) RECOMP_PATCH void func_80000DDC(void) { // recomp_printf("FramebufferIndex: %d\n", _framebufferIndex_000BE020); gGraphicsOption = 1; // force graphics to be Medium + +#if DEBUG_MENU == 1 + gDebugMenu = 1; +#endif + gEXEnable(gpDisplayList++); // @recomp gEXSetRDRAMExtended(gpDisplayList++, 1); // @recomp gEXSetRefreshRate(gpDisplayList++, 60 / 1); @@ -32,4 +37,4 @@ RECOMP_PATCH void func_80000DDC(void) { gDPFillRectangle(gpDisplayList++, 0, 0, gScreenWidth - 1, gScreenHeight - 1); } } -#endif \ No newline at end of file +#endif diff --git a/patches/patches.h b/patches/patches.h index b88aa2e..e7cf06e 100644 --- a/patches/patches.h +++ b/patches/patches.h @@ -25,6 +25,7 @@ #define sinf __sinf_recomp #define cosf __cosf_recomp +#define sprintf sprintf_recomp // #define sqrtf sqrtf_recomp #define bzero bzero_recomp #define gRandFloat sRandFloat @@ -36,22 +37,9 @@ #include "PR/mbi.h" // #include "PR/os_thread.h" // #include "PR/os_message.h" -// #include "common_structs.h" #include "structs.h" #include "externs.h" -// #include "misc_funcs.h" -// #include "defines.h" -// #include "macros.h" -// #include "course.h" -// #include "objects.h" -// #include "render_objects.h" -// #include "actor_types.h" -// #include "misc_funcs.h" -// #include "menu_items.h" -// #include "menus.h" -// #include "sounds.h" -// #include "objects.h" -// #include "debug.h" +#include "debug.h" #define MAKE_RGB(r, g, b) (((r) << 0x10) | ((g) << 0x08) | (b << 0x00)) diff --git a/patches/structs.h b/patches/structs.h index d0bf534..ae09e73 100644 --- a/patches/structs.h +++ b/patches/structs.h @@ -27,6 +27,8 @@ typedef f32 Matrix4f[4][4]; typedef f32 Vec4f[4]; +typedef void (*ProcPointer)(void); + typedef struct { /*0x00*/ s16 dimx; @@ -116,4 +118,372 @@ typedef struct /*0x4DC0*/ Mtx mtx5[128]; /*?*/ } Dynamic; +typedef struct { + u8 r, g, b; +} Color; + +typedef struct +{ + Color primary; + Color env; +} AlphaPalette; + +typedef struct +{ + u16 r; + u16 g; + u16 b; +} GlobalPalette; + +typedef struct { + s16 r; + s16 g; + s16 b; +} FogColor; + +typedef struct { + s16 nr; + s16 fr; +} FogScale; + +typedef struct +{ + FogColor color[3]; + FogScale scale[3]; + s16 unk1E; + u8 unk20; + u8 pad; +} Fog; + +typedef struct +{ + s32 unk0; + s32 unk4; + s32 unk8; + s32 unkC; + s32 unk10; + s32 unk14; + s16 picnum; + s32 height; + Color fog; +} Cloud; + +typedef struct +{ + s32 xpos; + s32 ypos; + s32 zpos; + s32 xvect; + s32 yvect; + s32 zvect; + s32 unk18; + s32 unk1C; + s32 unk20; + s32 unk24; + s32 unk28; + s32 unk2C; + s32 unk30; + s16 cursectnum; + s16 unk36; + s16 ang; + s16 unk3A; + s16 unk3C; + s16 unk3E; + s32 unk40; + u8 unk44; + u8 unk45; + s16 unk46; + s16 unk48; + s16 unk4A; + s16 skin; + s16 unk4E; + s16 unk50; + s16 unk52; + u8 unk54; + u8 unk55; + u8 unk56; + u8 unk57; + u8 unk58; + u8 unk59; + u8 unk5A; + u8 unk5B; + u8 unk5C; + s16 unk5E; + u8 third_person; + u8 unk61; + f32 unk64; + s16 unk68; + s16 unk6A; + u8 unk6C; + s16 unk6E; + s16 unk70; + s16 unk72; + s16 unk74; + s16 unk76; + f32 unk78; + f32 unk7C; + u8 unk80; + s16 unk82; + s16 unk84; + s16 unk86; + u8 keys[17]; + u8 pad[2]; +} Player; + +typedef struct +{ + s16 picnum; + s16 sfxnum; + char *actor; + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; +} _11B300UnkStruct1; + +typedef struct +{ + s32 x; + s32 y; + s32 z; + s16 cstat; + s16 picnum; + s16 sectnum; + s16 statnum; + s16 ang; + s16 unk16; + s16 unk18; + s16 unk1A; + s16 unk1C; + s16 lotag; + s16 hitag; + s16 unk22; + u8 unk24; + u8 unk25; + u8 clipdist; + u8 xrepeat; + u8 yrepeat; + u8 unk29; + u8 unk2A; + u8 unk2B; +} SpriteType; + +typedef struct +{ + struct { + u8 main; + u8 options_2P; + u8 select_single_multi_player; + u8 multiplayer_options; + u8 unk4; + u8 unk5; + u8 controller_config; + u8 options_1P; + u8 select_difficulty; + u8 select_multiplayer_gametype; + u8 unkA; + u8 unkB; + u8 unkC; + u8 unkD; + u8 select_player; + u8 unkF; + u8 player_setup; + u8 unk11; + u8 cheats; + u8 cheats_others; + u8 cheats_game_type; + u8 cheats_weapons; + } menuIndex; + + u16 sound; + u16 mastervol; + u16 musicvol; + u16 rumblepak; + + struct { + u16 radar; + u16 time_limit; + u16 frag_count; + u16 split_2P; + u16 split_3P; + u16 friendly_fire; + u16 players; + } multiplayer; + + u16 unused; + u16 controller_preset[4]; + u16 crosshair[4]; + u16 autoaim[4]; + u16 autocenter[4]; + u16 difficulty; + u8 unk50; +} Config; + +typedef struct +{ + u16 enemies_killed; + u16 enemies_total; + u16 babes_saved; + u16 babes_total; + u16 secrets_found; + u16 secrets_total; + s32 unkC; + u8 unk10; +} code0UnkStruct4; + +typedef unsigned long musHandle; + +typedef struct { + u16 chapter; + char *mapname; +} MapChapter; + +typedef struct +{ + s32 flag; + s32 unk4; + s16 unk8; + u16 unkA; + s32 *exec_ptr; + s32 *unk10; + s32 *unk14; + s32 *unk18; + s32 *unk1C; + s32 *unk20; + s32 *unk24; + s16 unk28; + s16 unk2A; + s16 unk2C; + s16 unk2E; + s16 unk30; + s16 unk32; + s16 unk34; + s16 unk36; + s32 unk38; + s32 unk3C; + s32 unk40; + s32 unk44; + s32 unk48; + s32 unk4C; + s32 unk50; + s32 unk54; + s32 unk58; + s32 unk5C; + s32 unk60; + s32 unk64; + s32 unk68; + musHandle unk6C; + musHandle unk70; + s32 unk74; + s32 unk78; + s16 unk7C; + s16 unk7E; + s16 unk80; + s16 unk82; + s16 unk84; + s16 unk86; + s16 unk88; + s16 unk8A; + s16 unk8C; + s16 unk8E; + s16 unk90; + u8 unk92; + u8 unk93; + u8 unk94; + u8 unk95; + u8 unk96; + u8 unk97; + u8 unk98; + u8 unk99; + u8 unk9A; + u8 unk9B; + u8 unk9C; + u8 unk9D; + u8 unk9E; + u8 unk9F; + u8 unkA0; + u8 unkA1; + u8 unkA2; + u8 unkA3; +} Actor; + +typedef struct +{ + s16 unk0; + u8 unk2[8]; + s16 unkA[8]; +} code0UnkStruct2; + +typedef struct +{ + u8 *texture; + u8 *palette; + s32 texoff; + s32 paloff; + s16 width; + s16 height; +} _E0640UnkStruct; + +typedef struct +{ + s16 x; + s16 y; + s16 z; +} code0UnkStruct18; + +typedef struct +{ + s8 unk0; + s32 unk4; + u32 unk8; + s32 unkC; + u8 unk10; + u8 unk11; + u8 unk12; + u8 pad2[1]; + s32 unk14; + u8 pad3[28]; + f32 unk34; + f32 unk38; + f32 unk3C; + f32 unk40; + f32 unk44; + f32 unk48; + f32 unk4C; + f32 unk50; + f32 unk54; + f32 unk58; + f32 unk5C; + f32 unk60; + f32 unk64; + Color unk68; + Color unk6B; + u8 pad7[2]; + void *unk70; + s32 unk74; + s32 unk78; + void *unk7C; + void *unk80; + code0UnkStruct18 *unk84; + s32 unk88; + u8 *unk8C; + s32 unk90; + s32 unk94; + s32 unk98; + s32 unk9C; + s32 unkA0; + Gfx *unkA4; + u8 pad9[4]; + Lights1 *unkAC; +} code0UnkStruct16; + +typedef struct +{ + u16 unk0; + u16 id; + u16 offset; + u16 vtx_count; + u16 dlist_count; +} _119280UnkStruct1; + #endif \ No newline at end of file diff --git a/patches/syms.ld b/patches/syms.ld index c7f7f9b..bbabef2 100644 --- a/patches/syms.ld +++ b/patches/syms.ld @@ -71,4 +71,5 @@ recomp_set_bgm_volume_59 = 0x8F0000EC; recomp_set_bgm_volume_0 = 0x8F0000F0; osPfsFindFile_recomp = 0x8F0000F4; osPfsReadWriteFile_recomp = 0x8F0000F8; -osPfsDeleteFile_recomp = 0x8F0000FC; \ No newline at end of file +osPfsDeleteFile_recomp = 0x8F0000FC; +sprintf_recomp = 0x8F000100; \ No newline at end of file diff --git a/src/game/recomp_api.cpp b/src/game/recomp_api.cpp index 28788d1..6517f4b 100644 --- a/src/game/recomp_api.cpp +++ b/src/game/recomp_api.cpp @@ -23,15 +23,6 @@ extern "C" void recomp_sleep_miliseconds(uint8_t* rdram, recomp_context* ctx) { ultramodern::sleep_milliseconds(time); } -extern "C" void toupper_recomp(uint8_t* rdram, recomp_context* ctx) { - // Empty - s32 c = _arg<0, s32>(rdram, ctx); - - if (c >= 'a' && c <= 'z') - ctx->r2 = c - ('a' - 'A'); - ctx->r2 = c; -} - extern "C" void rmonPrintf_recomp(uint8_t* rdram, recomp_context* ctx) { // Empty }