From c9f4fef2d67087285eae25c7722d26bb0b2add7d Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 22 Oct 2022 20:26:12 +1000 Subject: [PATCH] Remove camdraw code --- ld/gamefiles.ntsc-final.inc | 1 - src/game/cheats.c | 4 --- src/game/filelist.c | 51 +------------------------------------ src/game/lv.c | 4 --- src/game/menu.c | 4 --- src/game/menuitem.c | 16 +----------- src/game/mplayer/mplayer.c | 6 +---- src/game/mplayer/setup.c | 6 ----- src/game/pak.c | 18 +------------ src/lib/main.c | 2 -- 10 files changed, 4 insertions(+), 108 deletions(-) diff --git a/ld/gamefiles.ntsc-final.inc b/ld/gamefiles.ntsc-final.inc index a962b0d64..f12c9e003 100644 --- a/ld/gamefiles.ntsc-final.inc +++ b/ld/gamefiles.ntsc-final.inc @@ -181,7 +181,6 @@ build/ROMID/game/wallhit.o (section); \ build/ROMID/game/bondview.o (section); \ build/ROMID/game/splat.o (section); \ - build/ROMID/game/camdraw.o (section); \ build/ROMID/game/shards.o (section); \ build/ROMID/game/options.o (section); \ build/ROMID/game/game_152fa0.o (section); \ diff --git a/src/game/cheats.c b/src/game/cheats.c index 613173646..d02dd1439 100644 --- a/src/game/cheats.c +++ b/src/game/cheats.c @@ -397,8 +397,6 @@ char *cheatGetNameIfUnlocked(struct menuitem *item) s32 cheatMenuHandleDialog(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { if (operation == MENUOP_OPEN) { - func0f14a52c(); - if (gbpakIsAnyPerfectDark()) { gamefileSetFlag(GAMEFILEFLAG_USED_TRANSFERPAK); } @@ -432,8 +430,6 @@ s32 cheatMenuHandleDialog(s32 operation, struct menudialogdef *dialogdef, union if (gbpakIsAnyPerfectDark()) { gamefileSetFlag(GAMEFILEFLAG_USED_TRANSFERPAK); } - - func0f14a560(); } return 0; diff --git a/src/game/filelist.c b/src/game/filelist.c index fef5f2a4d..a7f5088a9 100644 --- a/src/game/filelist.c +++ b/src/game/filelist.c @@ -334,54 +334,5 @@ void pheadFreeTextures(s32 playernum) struct textureconfig *pheadGetTexture(s32 playernum, s32 fileid, u16 deviceserial) { - s32 i; - s32 freeslot = -1; - s32 indextouse = -1; - - for (i = 0; i < 16; i++) { - if (g_Menus[playernum].fm.headtextures->fileguids[i].fileid == fileid - && g_Menus[playernum].fm.headtextures->fileguids[i].deviceserial == deviceserial) { - indextouse = i; - break; - } - - if (g_Menus[playernum].fm.headtextures->fileguids[i].fileid == 0) { - if (g_Menus[playernum].fm.headtextures->fileguids[i].deviceserial == 0) { - freeslot = i; - } - } - } - - if (indextouse == -1) { - s8 device = pakFindBySerial(deviceserial); - - if (device < 0) { - return NULL; - } - - if (freeslot == -1) { - return NULL; - } - - if (g_Vars.thisframestart240 - g_Menus[playernum].fm.headtextures->lastupdated240 < 20) { - return NULL; - } - - g_Menus[playernum].fm.headtextures->lastupdated240 = g_Vars.thisframestart240; - - func0f15015c(device, fileid, g_Menus[playernum].fm.headtextures->unk000[freeslot]); - - g_Menus[playernum].fm.headtextures->fileguids[freeslot].fileid = fileid; - g_Menus[playernum].fm.headtextures->fileguids[freeslot].deviceserial = deviceserial; - - indextouse = freeslot; - } - - if (indextouse == -1) { - return NULL; - } - - g_Menus[playernum].fm.headtextures->selectedtexture.textureptr = g_Menus[playernum].fm.headtextures->unk000[indextouse]; - - return &g_Menus[playernum].fm.headtextures->selectedtexture; + return NULL; } diff --git a/src/game/lv.c b/src/game/lv.c index f06397e94..100eec9ff 100644 --- a/src/game/lv.c +++ b/src/game/lv.c @@ -457,10 +457,6 @@ void lvReset(s32 stagenum) fmbReset(); } - if (IS8MB()) { - pheadReset(); - } - modelmgrSetLvResetting(false); var80084018 = 1; schedResetArtifacts(); diff --git a/src/game/menu.c b/src/game/menu.c index ecf6c3fb1..85196239f 100644 --- a/src/game/menu.c +++ b/src/game/menu.c @@ -1785,10 +1785,6 @@ Gfx *menuRenderModels(Gfx *gdl, struct menu840 *thing, s32 arg2) if (mpheadnum < mpGetNumHeads2()) { headnum = mpGetHeadId(mpheadnum); - } else { - headnum = func0f14a9f8(mpheadnum - mpGetNumHeads2()); - headnum = mpGetBeauHeadId(headnum); - thing->unk5b0 = (mpheadnum - mpGetNumHeads2()) & 0xff; } } diff --git a/src/game/menuitem.c b/src/game/menuitem.c index a9a173269..1f6762399 100644 --- a/src/game/menuitem.c +++ b/src/game/menuitem.c @@ -3138,21 +3138,7 @@ Gfx *menuitemCarouselRender(Gfx *gdl, struct menurendercontext *context) // Right arrow gdl = menugfxDrawCarouselChevron(gdl, context->x + context->width, context->y + context->height / 2, 8, 3, -1, colour); - // This part of the function is unused because param2 is always zero. - // Setting it to 0x7b causes a crash. - // 0x7c and 0x7d don't do anything with the option value, so it's probable - // that the original source has a commented function call in that block. - if (context->item->param2 == 0x7b && context->item->handler) { - union handlerdata data; - s32 headorbodynum = 0; - - context->item->handler(MENUOP_GETSELECTEDINDEX, context->item, &data); - headorbodynum += data.carousel.value; - - gdl = func0f14f07c(gdl, headorbodynum, - context->x + context->width / 2 - 32, context->y, - context->x + context->width / 2 + 32, context->y + 64); - } else if ((context->item->param2 == 0x7c || context->item->param2 == 0x7d) && context->item->handler) { + if ((context->item->param2 == 0x7c || context->item->param2 == 0x7d) && context->item->handler) { union handlerdata data; context->item->handler(MENUOP_GETSELECTEDINDEX, context->item, &data); } diff --git a/src/game/mplayer/mplayer.c b/src/game/mplayer/mplayer.c index 803b088a7..f73ef0ec6 100644 --- a/src/game/mplayer/mplayer.c +++ b/src/game/mplayer/mplayer.c @@ -4979,11 +4979,7 @@ void mpplayerfileSaveWad(s32 playernum, struct savebuffer *buffer) savebufferOr(buffer, g_PlayerConfigsArray[playernum].base.mpheadnum, 7); savebufferOr(buffer, g_PlayerConfigsArray[playernum].base.mpbodynum, 7); - if (g_PlayerConfigsArray[playernum].base.mpheadnum >= mpGetNumHeads2()) { - struct fileguid guid; - phGetGuid(g_PlayerConfigsArray[playernum].base.mpheadnum - mpGetNumHeads2(), &guid); - savebufferWriteGuid(buffer, &guid); - } else { + { struct fileguid guid; guid.deviceserial = 0; guid.fileid = 0; diff --git a/src/game/mplayer/setup.c b/src/game/mplayer/setup.c index be23492fb..eed5728b4 100644 --- a/src/game/mplayer/setup.c +++ b/src/game/mplayer/setup.c @@ -1892,12 +1892,6 @@ s32 mpCharacterHeadMenuHandler(s32 operation, struct menuitem *item, union handl g_Menus[g_MpPlayerNum].unk840.unk00c = g_HeadsAndBodies[headnum].filenum; g_Menus[g_MpPlayerNum].unk840.unk5b1_01 = false; - } else { - headnum = mpGetBeauHeadId(func0f14a9f8(mpheadnum - mpGetNumHeads2())); - - g_Menus[g_MpPlayerNum].unk840.unk00c = g_HeadsAndBodies[headnum].filenum; - g_Menus[g_MpPlayerNum].unk840.unk5b1_01 = true; - g_Menus[g_MpPlayerNum].unk840.unk5b0 = mpheadnum - mpGetNumHeads2(); } g_Menus[g_MpPlayerNum].unk840.unk574 = 0; diff --git a/src/game/pak.c b/src/game/pak.c index 055fe5f60..7c3b6ebd1 100644 --- a/src/game/pak.c +++ b/src/game/pak.c @@ -5118,7 +5118,7 @@ bool gbpak0f11cef8(s8 device) if (pak->unk2b9); - pak0f11d118(sp2c, pak->unk2b9, func0f14aa70()); + pak0f11d118(sp2c, pak->unk2b9, 0); pak0f11d174(device, sp2c); sp2c[0] |= 1; @@ -5177,17 +5177,6 @@ void pak0f11d118(u8 *arg0, u8 arg1, u32 arg2) void pak0f11d174(s8 device, u8 *arg1) { - u8 tmp1; - s32 tmp2; - - pak0f11d118(arg1, g_Paks[device].unk2b9, func0f14aa70()); - - tmp1 = func0f14ad38(device); - tmp2 = func0f14ad14(device); - - arg1[1] = (arg1[1] & 0xe0) + tmp1; - arg1[2] = (tmp2 >> 8) & 0xff; - arg1[3] = tmp2; } void pak0f11d214(u8 *arg0, u32 arg1) @@ -5718,7 +5707,6 @@ void pak0f11df94(s8 device) menuSetBanner(-1, true); #endif - func0f14aed0(device); break; case PAK010_02: #if VERSION >= VERSION_NTSC_1_0 @@ -5730,7 +5718,6 @@ void pak0f11df94(s8 device) #else pak0f114dd4nb(device); #endif - func0f14aed0(device); break; case PAK010_03: #if VERSION >= VERSION_NTSC_1_0 @@ -5794,9 +5781,6 @@ void pak0f11df94(s8 device) g_Paks[device].unk010 = PAK010_11; break; case PAK010_08: - if (func0f14aea0(device)) { - g_Paks[device].unk010 = PAK010_09; - } break; case PAK010_09: #if VERSION >= VERSION_NTSC_1_0 diff --git a/src/lib/main.c b/src/lib/main.c index 068a9c802..dd9721e44 100644 --- a/src/lib/main.c +++ b/src/lib/main.c @@ -557,9 +557,7 @@ void mainInit(void) stub0f000910(); stub0f000840(); mpInit(); - pheadInit(); paksInit(); - pheadInit2(); animsInit(); racesInit(); bodiesInit();