Remove debug

This commit is contained in:
Ryan Dwyer
2022-11-10 21:36:05 +10:00
parent 44aedd817d
commit 3b0066b74e
25 changed files with 19 additions and 2133 deletions
-2
View File
@@ -146,8 +146,6 @@
build/ROMID/game/padhalllv.o (section); \
build/ROMID/game/pad.o (section); \
build/ROMID/game/pak.o (section); \
build/ROMID/game/debug.o (section); \
build/ROMID/game/debug3.o (section); \
build/ROMID/game/stubs/game_11eff0.o (section); \
build/ROMID/ailists/gailistsasm.o (section); \
build/ROMID/game/modeldata/general.o (section); \
+6 -44
View File
@@ -1,6 +1,5 @@
#include <ultra64.h>
#include "constants.h"
#include "game/debug.h"
#include "game/dlights.h"
#include "game/game_006900.h"
#include "game/portal.h"
@@ -1373,7 +1372,7 @@ Gfx *bgRenderSceneInXray(Gfx *gdl)
gSPMatrix(gdl++, osVirtualToPhysical(camGetPerspectiveMtxL()), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
if (debugIsPropRenderingEnabled() && getVar80084040()) {
if (getVar80084040()) {
if (thing->roomnum == -1) {
gdl = propsRender(gdl, 0, RENDERPASS_XLU, roomnumsbyprop);
}
@@ -1551,7 +1550,7 @@ Gfx *bgRenderScene(Gfx *gdl)
gSPMatrix(gdl++, osVirtualToPhysical(camGetPerspectiveMtxL()), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
gdl = envStopFog(gdl);
if (debugIsPropRenderingEnabled() && getVar80084040()) {
if (getVar80084040()) {
if (firstroomnum == thing->roomnum) {
gdl = propsRender(gdl, 0, RENDERPASS_OPA_PREBG, roomnumsbyprop);
}
@@ -1565,7 +1564,7 @@ Gfx *bgRenderScene(Gfx *gdl)
gdl = currentPlayerScissorWithinViewportF(gdl, thing->box.xmin, thing->box.ymin, thing->box.xmax, thing->box.ymax);
gdl = envStartFog(gdl, false);
if (debugIsBgRenderingEnabled() && getVar80084040()) {
if (getVar80084040()) {
if (g_StageIndex != STAGEINDEX_TEST_OLD) {
gdl = bgRenderRoomOpaque(gdl, thing->roomnum);
}
@@ -1576,7 +1575,7 @@ Gfx *bgRenderScene(Gfx *gdl)
gdl = envStopFog(gdl);
if (debugIsPropRenderingEnabled() && getVar80084040()) {
if (getVar80084040()) {
if (firstroomnum == thing->roomnum) {
gdl = propsRender(gdl, 0, RENDERPASS_OPA_POSTBG, roomnumsbyprop);
}
@@ -1616,7 +1615,7 @@ Gfx *bgRenderScene(Gfx *gdl)
gdl = currentPlayerScissorWithinViewportF(gdl, thing->box.xmin, thing->box.ymin, thing->box.xmax, thing->box.ymax);
gdl = envStartFog(gdl, true);
if (debugIsBgRenderingEnabled() && getVar80084040()) {
if (getVar80084040()) {
gdl = bgRenderRoomXlu(gdl, thing->roomnum);
}
@@ -1625,7 +1624,7 @@ Gfx *bgRenderScene(Gfx *gdl)
gdl = envStopFog(gdl);
// Render prop translucent components
if (debugIsPropRenderingEnabled() && getVar80084040()) {
if (getVar80084040()) {
if (firstroomnum == thing->roomnum) {
gdl = propsRender(gdl, 0, RENDERPASS_XLU, roomnumsbyprop);
}
@@ -3865,43 +3864,6 @@ s32 portalFindNumByVertices(struct portalvertices *arg0)
return 0;
}
/**
* Build a string showing the state of all rooms in the stage.
*
* The string contains "L" if a room is loaded, "." if not, and has line breaks
* every 40 characters.
*
* Nothing is done with the string though. It's likely that debug versions of
* the game would send the string to the host computer or display it on the HUD.
*/
void roomsHandleStateDebugging(void)
{
if (debugIsRoomStateDebugEnabled()) {
u8 string[704];
s32 len = 0;
s32 i;
for (i = 1; i < g_Vars.roomcount; i++) {
if ((i - 1) % 40 == 0) {
if (i != 1) {
string[len] = '\n';
len++;
}
}
if (g_Rooms[i].loaded240) {
string[len] = 'L';
} else {
string[len] = '.';
}
len++;
}
string[len] = '\0';
}
}
u32 bgInflate(u8 *src, u8 *dst, u32 len)
{
u32 result;
-6
View File
@@ -4,7 +4,6 @@
#include "game/bondmove.h"
#include "game/cheats.h"
#include "game/chraction.h"
#include "game/debug.h"
#include "game/prop.h"
#include "game/objectives.h"
#include "game/bondgun.h"
@@ -1080,11 +1079,6 @@ void bgrab0f0ce924(void)
bmoveUpdateMoveInitSpeed(&sp74);
if (debugIsTurboModeEnabled()) {
sp74.x += (g_Vars.currentplayer->bond2.unk00.f[0] * g_Vars.currentplayer->speedforwards - (g_Vars.currentplayer->bond2.unk00.f[2] * g_Vars.currentplayer->speedsideways)) * g_Vars.lvupdate60freal * 10.0f;
sp74.z += (g_Vars.currentplayer->bond2.unk00.f[2] * g_Vars.currentplayer->speedforwards + (g_Vars.currentplayer->bond2.unk00.f[0] * g_Vars.currentplayer->speedsideways)) * g_Vars.lvupdate60freal * 10.0f;
}
bgrab0f0ce0bc(&sp74);
xdelta = g_Vars.currentplayer->prop->pos.f[0] - g_Vars.currentplayer->bondprevpos.f[0];
+1 -13
View File
@@ -4,7 +4,6 @@
#include "game/bondwalk.h"
#include "game/cheats.h"
#include "game/chraction.h"
#include "game/debug.h"
#include "game/footstep.h"
#include "game/game_006900.h"
#include "game/chr.h"
@@ -912,13 +911,7 @@ void bwalkUpdateVertical(void)
fallspeed = g_Vars.currentplayer->bdeltapos.y;
newmanground = g_Vars.currentplayer->vv_manground;
if (debugIsTurboModeEnabled()
&& g_Vars.currentplayer->bondforcespeed.x == 0
&& g_Vars.currentplayer->bondforcespeed.z == 0) {
multiplier = 0.277777777f * 5;
} else {
multiplier = 0.277777777f;
}
multiplier = 0.277777777f;
newfallspeed = fallspeed - g_Vars.lvupdate60freal * multiplier;
newmanground += g_Vars.lvupdate60freal * (fallspeed + newfallspeed) * 0.5f;
@@ -1558,11 +1551,6 @@ void bwalk0f0c69b8(void)
bmoveUpdateMoveInitSpeed(&spcc);
if (debugIsTurboModeEnabled()) {
spcc.f[0] += (g_Vars.currentplayer->bond2.unk00.f[0] * g_Vars.currentplayer->speedforwards - g_Vars.currentplayer->bond2.unk00.f[2] * g_Vars.currentplayer->speedsideways) * g_Vars.lvupdate60freal * 10.0f;
spcc.f[2] += (g_Vars.currentplayer->bond2.unk00.f[2] * g_Vars.currentplayer->speedforwards + g_Vars.currentplayer->bond2.unk00.f[0] * g_Vars.currentplayer->speedsideways) * g_Vars.lvupdate60freal * 10.0f;
}
if (g_Vars.currentplayer->bondforcespeed.f[0] != 0.0f || g_Vars.currentplayer->bondforcespeed.f[2] != 0.0f) {
spcc.f[0] += g_Vars.currentplayer->bondforcespeed.f[0] * g_Vars.lvupdate60freal;
spcc.f[2] += g_Vars.currentplayer->bondforcespeed.f[2] * g_Vars.lvupdate60freal;
-32
View File
@@ -1,7 +1,6 @@
#include <ultra64.h>
#include "constants.h"
#include "game/chraction.h"
#include "game/debug.h"
#include "game/chr.h"
#include "game/prop.h"
#include "game/propsnd.h"
@@ -278,8 +277,6 @@ u32 botPickupProp(struct prop *prop, struct chrdata *chr)
return 0;
}
dprint();
if (1);
obj->flags3 &= ~OBJFLAG3_ISFETCHTARGET;
@@ -294,7 +291,6 @@ u32 botPickupProp(struct prop *prop, struct chrdata *chr)
if (1);
qty = ammocrateGetPickupAmmoQty(crate);
dprint();
if (qty) {
botactGiveAmmoByType(chr->aibot, crate->ammotype, qty);
@@ -305,10 +301,6 @@ u32 botPickupProp(struct prop *prop, struct chrdata *chr)
-1, 1024, 0, 0, 0, -1, 0, -1, -1, -1, -1);
objFree(obj, false, obj->hidden2 & OBJH2FLAG_CANREGEN);
if (qty) {
dprint();
}
}
return 2;
case OBJTYPE_MULTIAMMOCRATE:
@@ -337,15 +329,10 @@ u32 botPickupProp(struct prop *prop, struct chrdata *chr)
}
}
#endif
dprint();
for (i = 0; i != 19; i++) {
qty = crate->slots[i].quantity;
if (qty) {
dprint();
}
if (qty) {
botactGiveAmmoByType(chr->aibot, i + 1, qty);
}
@@ -456,8 +443,6 @@ bool botTestPropForPickup(struct prop *prop, struct chrdata *chr)
return false;
}
dprint();
if (prop->timetoregen != 0) {
return false;
}
@@ -472,8 +457,6 @@ bool botTestPropForPickup(struct prop *prop, struct chrdata *chr)
}
}
dprint();
if (1);
#if VERSION >= VERSION_NTSC_1_0
@@ -486,8 +469,6 @@ bool botTestPropForPickup(struct prop *prop, struct chrdata *chr)
}
#endif
dprint();
if ((obj->hidden & OBJHFLAG_PROJECTILE)
&& obj->projectile
&& obj->projectile->pickuptimer240 > 0
@@ -495,10 +476,6 @@ bool botTestPropForPickup(struct prop *prop, struct chrdata *chr)
return false;
}
dprint();
dprint();
if (1);
if (obj->type == OBJTYPE_WEAPON) {
@@ -534,7 +511,6 @@ bool botTestPropForPickup(struct prop *prop, struct chrdata *chr)
ignore1 = true;
if (objGetDestroyedLevel(obj)) {
dprint();
return false;
}
@@ -546,7 +522,6 @@ bool botTestPropForPickup(struct prop *prop, struct chrdata *chr)
ignore1 = false;
if (weaponnum && !botinvGetItemType(chr, weaponnum)) {
dprint();
botinvGiveProp(chr, prop);
}
@@ -579,8 +554,6 @@ bool botTestPropForPickup(struct prop *prop, struct chrdata *chr)
ydist = prop->pos.y - chrprop->pos.y;
zdist = prop->pos.z - chrprop->pos.z;
dprint();
if (chr->aibot->cheap) {
if (1);
if (1);
@@ -595,8 +568,6 @@ bool botTestPropForPickup(struct prop *prop, struct chrdata *chr)
sp3c = xdist * xdist + zdist * zdist <= sqrange && ydist >= -200 && ydist <= 200;
if (sp3c) {
dprint();
if ((obj->flags2 & OBJFLAG2_PICKUPWITHOUTLOS) == 0
&& !cdTestLos06(&chrprop->pos, chrprop->rooms, &prop->pos, prop->rooms, CDTYPE_DOORS | CDTYPE_BG)) {
sp3c = false;
@@ -604,7 +575,6 @@ bool botTestPropForPickup(struct prop *prop, struct chrdata *chr)
}
if (sp3c) {
dprint();
return botPickupProp(prop, chr);
}
@@ -682,8 +652,6 @@ void botCheckPickups(struct chrdata *chr)
if (botIsObjCollectable(obj)) {
if (botTestPropForPickup(prop, chr)) {
propExecuteTickOperation(prop, TICKOP_FREE);
} else {
dprint();
}
}
}
-14
View File
@@ -1,7 +1,6 @@
#include <ultra64.h>
#include "constants.h"
#include "game/chraction.h"
#include "game/debug.h"
#include "game/chr.h"
#include "game/propsnd.h"
#include "game/bondgun.h"
@@ -144,19 +143,13 @@ s32 botactTryRemoveAmmoFromReserve(struct aibot *aibot, s32 weaponnum, s32 funcn
return tryqty;
}
dprint();
*ammoheld -= tryqty;
if (*ammoheld < 0) {
amountremoved = tryqty + *ammoheld;
*ammoheld = 0;
if (dprint()) {
return amountremoved;
}
} else {
amountremoved = tryqty;
dprint();
}
return amountremoved;
@@ -168,7 +161,6 @@ void botactGiveAmmoByWeapon(struct aibot *aibot, s32 weaponnum, s32 funcnum, s32
s32 *heldquantity = &aibot->ammoheld[botactGetAmmoTypeByFunction(weaponnum, funcnum)];
if (aibot && (aibot->unk064 & 1) == 0 && qty > 0) {
dprint();
*heldquantity += qty;
if (heldquantity);
@@ -178,8 +170,6 @@ void botactGiveAmmoByWeapon(struct aibot *aibot, s32 weaponnum, s32 funcnum, s32
if (*heldquantity > max) {
*heldquantity = max;
}
dprint();
}
}
@@ -192,8 +182,6 @@ void botactGiveAmmoByType(struct aibot *aibot, u32 ammotype, s32 quantity)
return;
}
dprint();
*heldquantity += quantity;
if (heldquantity);
@@ -203,8 +191,6 @@ void botactGiveAmmoByType(struct aibot *aibot, u32 ammotype, s32 quantity)
if (*heldquantity > max) {
*heldquantity = max;
}
dprint();
}
bool botactShootFarsight(struct chrdata *chr, s32 arg1, struct coord *vector, struct coord *arg3)
-1
View File
@@ -2,7 +2,6 @@
#include "constants.h"
#include "game/activemenu.h"
#include "game/chraction.h"
#include "game/debug.h"
#include "game/chr.h"
#include "game/ceil.h"
#include "game/game_0b0fd0.h"
-5
View File
@@ -1,7 +1,6 @@
#include <ultra64.h>
#include "constants.h"
#include "game/chraction.h"
#include "game/debug.h"
#include "game/chr.h"
#include "game/ceil.h"
#include "game/game_0b0fd0.h"
@@ -147,8 +146,6 @@ void botinvClear(struct chrdata *chr)
for (i = 0; i < chr->aibot->maxitems; i++) {
chr->aibot->items[i].type = -1;
}
dprint();
}
}
@@ -173,8 +170,6 @@ struct invitem *botinvGetFreeSlot(struct chrdata *chr)
}
}
dprint();
return NULL;
}
+1 -6
View File
@@ -4,7 +4,6 @@
#include "game/bondmove.h"
#include "game/cheats.h"
#include "game/chraction.h"
#include "game/debug.h"
#include "game/chr.h"
#include "game/chrmgr.h"
#include "game/env.h"
@@ -2648,11 +2647,7 @@ s32 chrTick(struct prop *prop)
limit = 700 * 700;
}
} else {
if (debugGetSlowMotion() != SLOWMOTION_OFF) {
limit = 2000 * 2000;
} else {
limit = 700 * 700;
}
limit = 700 * 700;
}
anim = model->anim;
-29
View File
@@ -2,7 +2,6 @@
#include "constants.h"
#include "game/chraction.h"
#include "game/chrai.h"
#include "game/debug.h"
#include "game/dlights.h"
#include "game/footstep.h"
#include "game/game_006900.h"
@@ -11157,29 +11156,6 @@ void chrTickAttackRoll(struct chrdata *chr)
chrTickFire(chr);
}
void propPrintDangerous(void)
{
u8 i;
osSyncPrintf("Current dangerous items:");
for (i = 0; i < MAX_DANGEROUSPROPS; i++) {
struct prop *prop = g_DangerousProps[i];
if (prop) {
if (prop->weapon
&& prop->weapon->weaponnum == WEAPON_GRENADE
&& prop->type == PROPTYPE_WEAPON) {
osSyncPrintf(" Grenade %x", prop);
} else if (prop->type == PROPTYPE_EXPLOSION) {
osSyncPrintf(" Explosion %x", prop);
} else {
osSyncPrintf("misc dangerous prop");
}
}
}
}
void propUnsetDangerous(struct prop *prop)
{
s32 i;
@@ -13349,11 +13325,6 @@ void chraTickBg(void)
}
#endif
// If enabled, print a list of dangerous props to the developer's console
if (debugDangerousProps()) {
propPrintDangerous();
}
// Handle switching to a new cutscene when using "Play All" from the menu
if (g_Vars.autocutnum >= 0) {
cutsceneStart(g_Vars.autocutnum + 0xc00);
-1
View File
@@ -12,7 +12,6 @@
#include "game/chraction.h"
#include "game/chrai.h"
#include "game/chraicommands.h"
#include "game/debug.h"
#include "game/dlights.h"
#include "game/env.h"
#include "game/explosions.h"
-463
View File
@@ -1,463 +0,0 @@
#include <ultra64.h>
#include "constants.h"
#include "game/debug.h"
#include "bss.h"
#include "data.h"
#include "types.h"
/**
* This file is used by ntsc-1.0 and above which has the debug functions
* ifdeffed out.
*
* ntsc-beta's debug implementations are in debug1.c and debug2.c.
* Those files are only linked into ntsc-beta.
*
* Splitting it like this is temporary due to it being difficult to identify
* which functions are the same between beta and 1.0.
*/
s32 var80075d60 = 2;
s32 var80075d64 = 2;
s32 var80075d68 = 2;
u32 var80075d6c = 0x00000002;
u32 var80075d70 = 0x00000000;
bool g_DebugTurboMode = false;
s32 g_DebugScreenshotRgb = 0;
u32 var80075d7c = 0x00000000;
u32 var80075d80 = 0x00000000;
u32 var80075d84 = 0x00000000;
u32 var80075d88 = 0x00000000;
u32 var80075d8c = 0x00000000;
u32 var80075d90 = 0x00000000;
u32 var80075d94 = 0xbf800000;
u32 var80075d98 = 0x00000000;
u32 var80075d9c = 0x3f800000;
u32 var80075da0 = 0x00000000;
u32 var80075da4 = 0x00000000;
u32 var80075da8 = 0x3f800000;
u32 var80075dac = 0x00000000;
u32 var80075db0 = 0x00000000;
u32 var80075db4 = 0x3f800000;
u32 var80075db8 = 0x00000000;
u32 var80075dbc = 0x00000000;
u32 var80075dc0 = 0x00000000;
u32 var80075dc4 = 0x00000000;
u32 var80075dc8 = 0x00000000;
u32 var80075dcc = 0x00000000;
u32 var80075dd0 = 0x00000000;
u32 var80075dd4 = 0x00000000;
u32 var80075dd8 = 0x3f800000;
u32 var80075ddc = 0x00000000;
void debug0f11ecf0(s32 arg0) // not called
{
// empty
}
void debug0f11ecf8(s32 arg0, s32 arg1, s32 arg2) // not called
{
// empty
}
s32 debug0f11ed08(s32 arg0) // not called
{
return arg0;
}
void debug0f11ed10(s32 arg0, s32 arg1, s32 arg2) // not called
{
// empty
}
bool debug0f11ed20(void) // not called
{
return false;
}
void debug0f11ed28(s32 arg0) // not called
{
// empty
}
void debug0f11ed30(void) // not called
{
// empty
}
void debug0f11ed38(void) // not called
{
// empty
}
void debug0f11ed40(void) // not called
{
// empty
}
void debug0f11ed48(void) // not called
{
// empty
}
void debug0f11ed50(void) // not called
{
// empty
}
bool debug0f11ed58(s32 arg0, s32 arg1, s32 arg2, s32 arg3) // not called
{
return false;
}
/**
* If 1, would render something but the render function is stubbed.
*/
s32 debug0f11ed70(void)
{
return 0;
}
bool debugIsBgRenderingEnabled(void)
{
return true;
}
bool debugIsPropRenderingEnabled(void)
{
return true;
}
bool debug0f11ed88(void) // not called
{
return false;
}
bool debug0f11ed90(void) // not called
{
return false;
}
void debug0f11ed98(s32 arg0) // not called
{
// empty
}
bool debug0f11eda0(void) // not called
{
return false;
}
bool debug0f11eda8(void) // not called
{
return false;
}
bool debug0f11edb0(void)
{
return false;
}
bool debugIsObjDeformDebugEnabled(void)
{
return false;
}
bool debugIsRoomStateDebugEnabled(void)
{
return false;
}
s32 debug0f11edc8(void) // not called
{
return var80075d70;
}
void debug0f11edd4(s32 arg0) // not called
{
var80075d70 = arg0;
}
bool debug0f11ede0(void) // not called
{
return false;
}
bool debug0f11ede8(void) // not called
{
return false;
}
bool debug0f11edf0(void) // not called
{
return false;
}
void debug0f11edf8(void) // not called
{
// empty
}
void debug0f11ee00(void) // not called
{
// empty
}
s32 debugIsTurboModeEnabled(void)
{
return g_DebugTurboMode;
}
void debugSetTurboMode(bool enabled) // not called
{
g_DebugTurboMode = enabled;
}
bool debugForceAllObjectivesComplete(void)
{
return false;
}
bool debugIsZBufferDisabled(void)
{
return false;
}
bool debug0f11ee30(void) // not called
{
return false;
}
bool debug0f11ee38(void) // not called
{
return false;
}
bool debug0f11ee40(void)
{
return false;
}
bool debug0f11ee48(void) // not called
{
return false;
}
bool debug0f11ee50(void) // not called
{
return false;
}
bool debug0f11ee58(void) // not called
{
return false;
}
bool debug0f11ee60(void) // not called
{
return false;
}
bool debug0f11ee68(void) // not called
{
return false;
}
s32 debugGetSlowMotion(void)
{
return SLOWMOTION_OFF;
}
bool debug0f11ee78(void) // not called
{
return false;
}
bool debug0f11ee80(void) // not called
{
return false;
}
bool debugGetTilesDebugMode(void)
{
return false;
}
bool debugGetPadsDebugMode(void)
{
return false;
}
bool debug0f11ee98(void) // not called
{
return false;
}
bool debug0f11eea0(void) // not called
{
return false;
}
bool debug0f11eea8(void)
{
return false;
}
bool debugDangerousProps(void)
{
return false;
}
bool debug0f11eeb8(void) // not called
{
return false;
}
bool debug0f11eec0(void) // not called
{
return false;
}
bool debug0f11eec8(void) // not called
{
return false;
}
bool debug0f11eed0(void) // not called
{
return false;
}
s32 debugGetMotionBlur(void)
{
return 0;
}
bool debug0f11eee0(void) // not called
{
return false;
}
u32 dprint()
{
return 0;
}
bool debug0f11eef0(void) // not called
{
return false;
}
bool debugIsFootstepsEnabled(void)
{
return true;
}
bool debug0f11ef00(void) // not called
{
return false;
}
bool debug0f11ef08(void) // not called
{
return false;
}
bool debug0f11ef10(void) // not called
{
return false;
}
bool debug0f11ef18(void) // not called
{
return false;
}
bool debug0f11ef20(void) // not called
{
return false;
}
bool debug0f11ef28(void) // not called
{
return false;
}
bool debug0f11ef30(void) // not called
{
return false;
}
bool debug0f11ef38(void) // not called
{
return false;
}
bool debug0f11ef40(void) // not called
{
return false;
}
bool debugAllowEndLevel(void)
{
return true;
}
bool debug0f11ef50(void) // not called
{
return false;
}
bool debug0f11ef58(void) // not called
{
return false;
}
bool debug0f11ef60(void) // not called
{
return false;
}
bool debug0f11ef68(void) // not called
{
return false;
}
bool debug0f11ef70(void) // not called
{
return false;
}
bool debugIsChrStatsEnabled(void)
{
return false;
}
bool debug0f11ef80(void)
{
return false;
}
bool debug0f11ef88(void) // not called
{
return false;
}
bool debug0f11ef90(void) // not called
{
return false;
}
void debug0f11ef98(s32 arg0) // not called
{
// empty
}
void debug0f11efa0(void) // not called
{
// empty
}
void debug0f11efa8(void) // not called
{
// empty
}
-199
View File
@@ -1,199 +0,0 @@
#include <ultra64.h>
#include "constants.h"
#include "game/debug.h"
#include "lib/debughud.h"
#include "bss.h"
#include "data.h"
#include "types.h"
s32 g_DMenuSelectedOption = 0;
s32 g_DMenuNumOptions = 0;
char **g_DMenuCurLabels = NULL;
s32 (*g_DMenuCurPositions)[2] = NULL;
s32 g_DMenuNumGroups = 0;
s32 *g_DMenuCurOffsets = NULL;
u32 g_DMenuScaleIndex = 2;
u8 g_DMenuXScales[] = { 4, 4, 4 };
u8 g_DMenuYScales[] = { 7, 7, 7 };
void dmenu0f118c80nb(void)
{
// empty
}
void dmenuSetScaleIndex(s32 index)
{
g_DMenuScaleIndex = index;
}
void dmenuSetMenu(char **labels, s32 (*positions)[2], s32 *offsets)
{
s32 numgroups;
g_DMenuCurLabels = labels;
g_DMenuCurPositions = positions;
g_DMenuCurOffsets = offsets;
for (numgroups = 0; offsets[numgroups] >= 0; numgroups++);
g_DMenuNumOptions = offsets[numgroups - 1];
g_DMenuNumGroups = numgroups;
}
Gfx *dmenuRender(Gfx *gdl)
{
s32 xscale = g_DMenuXScales[g_DMenuScaleIndex];
s32 yscale = g_DMenuYScales[g_DMenuScaleIndex];
s32 i;
gDPSetTextureLUT(gdl++, G_TT_NONE);
// Render unselected/gray options
for (i = 0; i < g_DMenuNumOptions; i++) {
dmenu0f118c80nb();
if (i != g_DMenuSelectedOption) {
dhudSetFgColour(0xc0, 0xc0, 0xc0, 0xc0);
dhudSetPos((g_DMenuCurPositions[i][0] * xscale - 20) / 4, (g_DMenuCurPositions[i][1] * yscale - 8) / 7);
dhudPrintString(g_DMenuCurLabels[i]);
}
}
// Render selected/red option
for (i = 0; i < g_DMenuNumOptions; i++) {
dmenu0f118c80nb();
if (i == g_DMenuSelectedOption) {
dhudSetFgColour(0xc0, 0, 0, 0xc0);
dhudSetPos((g_DMenuCurPositions[i][0] * xscale - 20) / 4, (g_DMenuCurPositions[i][1] * yscale - 8) / 7);
dhudPrintString(g_DMenuCurLabels[i]);
}
}
return gdl;
}
s32 dmenuGetSelectedOption(void)
{
return g_DMenuSelectedOption;
}
void dmenuSetSelectedOption(s32 option)
{
g_DMenuSelectedOption = option;
}
void dmenuNavigateUp(void)
{
s32 i;
g_DMenuSelectedOption--;
// If at the top of the first group, wrap to the bottom of the group.
// This must be treated differently to the other groups because the first
// group's offset is omitted from the offsets array.
if (g_DMenuSelectedOption < 0) {
g_DMenuSelectedOption = g_DMenuCurOffsets[0] - 1;
return;
}
// If at the top of any other group, wrap to the bottom of that group.
for (i = 0; i < g_DMenuNumGroups; i++) {
if (g_DMenuSelectedOption == g_DMenuCurOffsets[i] - 1) {
g_DMenuSelectedOption = g_DMenuCurOffsets[i + 1] - 1;
return;
}
}
}
void dmenuNavigateDown(void)
{
s32 i;
g_DMenuSelectedOption++;
// If at the bottom of the first group, wrap to the top of the group.
// This must be treated differently to the other groups because the first
// group's offset is omitted from the offsets array.
if (g_DMenuSelectedOption == g_DMenuCurOffsets[0]) {
g_DMenuSelectedOption = 0;
return;
}
// If at the bottom of any other group, wrap to the top of that group.
for (i = 0; i < g_DMenuNumGroups; i++) {
if (g_DMenuSelectedOption == g_DMenuCurOffsets[i]) {
g_DMenuSelectedOption = g_DMenuCurOffsets[i - 1];
return;
}
}
}
void dmenuNavigateRight(void)
{
s32 i;
if (g_DMenuSelectedOption < g_DMenuCurOffsets[0]) {
if (g_DMenuNumGroups >= 2) {
g_DMenuSelectedOption += g_DMenuCurOffsets[0];
if (g_DMenuSelectedOption >= g_DMenuCurOffsets[1]) {
g_DMenuSelectedOption = g_DMenuCurOffsets[1] - 1;
}
}
return;
}
for (i = 0; i < g_DMenuNumGroups; i++) {
if (g_DMenuSelectedOption < g_DMenuCurOffsets[i]) {
g_DMenuSelectedOption = g_DMenuSelectedOption + g_DMenuCurOffsets[i] - g_DMenuCurOffsets[i - 1];
if (g_DMenuCurOffsets[i + 1] < 0) {
g_DMenuSelectedOption -= g_DMenuCurOffsets[i];
if (g_DMenuSelectedOption >= g_DMenuCurOffsets[0]) {
g_DMenuSelectedOption = g_DMenuCurOffsets[0] - 1;
}
} else {
if (g_DMenuSelectedOption >= g_DMenuCurOffsets[i + 1]) {
g_DMenuSelectedOption = g_DMenuCurOffsets[i + 1] - 1;
}
}
return;
}
}
}
void dmenuNavigateLeft(void)
{
s32 i;
// First group
if (g_DMenuSelectedOption < g_DMenuCurOffsets[0]) {
s32 i;
for (i = 0; i < g_DMenuNumGroups - 1; i++);
if (i > 0) {
g_DMenuSelectedOption += g_DMenuCurOffsets[i - 1];
if (g_DMenuSelectedOption >= g_DMenuCurOffsets[i]) {
g_DMenuSelectedOption = g_DMenuCurOffsets[i] - 1;
}
}
return;
}
// Any other group
for (i = 0; g_DMenuSelectedOption >= g_DMenuCurOffsets[i]; i++);
g_DMenuSelectedOption -= g_DMenuCurOffsets[i - 1];
if (i - 2 >= 0) {
g_DMenuSelectedOption += g_DMenuCurOffsets[i - 2];
}
if (g_DMenuSelectedOption >= g_DMenuCurOffsets[i - 1]) {
g_DMenuSelectedOption = g_DMenuCurOffsets[i - 1] - 1;
}
}
-1038
View File
File diff suppressed because it is too large Load Diff
-36
View File
@@ -1,36 +0,0 @@
#include <ultra64.h>
#include "constants.h"
#include "game/debug.h"
#include "bss.h"
#include "data.h"
#include "types.h"
void debug0f11efb0(s32 arg0, s32 arg1)
{
// empty
}
void debug0f11efbc(s32 arg0)
{
// empty
}
s32 debug0f11efc4(s32 arg0)
{
return arg0;
}
void debug0f11efcc(void)
{
// empty
}
void debug0f11efd4(void)
{
// empty
}
void debug0f11efdc(s32 arg0)
{
// empty
}
+2 -3
View File
@@ -1,6 +1,5 @@
#include <ultra64.h>
#include "constants.h"
#include "game/debug.h"
#include "game/game_006900.h"
#include "game/propsnd.h"
#include "game/bg.h"
@@ -154,7 +153,7 @@ s32 footstepChooseSound(struct chrdata *chr, s32 footstepindex)
*/
void footstepCheckDefault(struct chrdata *chr)
{
if (debugIsFootstepsEnabled() && PLAYERCOUNT() == 1 && chr) {
if (PLAYERCOUNT() == 1 && chr) {
chr->footstep = 0;
chr->magicanim = -1;
chr->magicframe = 0;
@@ -224,7 +223,7 @@ void footstepCheckMagic(struct chrdata *chr)
f32 zdiff;
s32 soundnum;
if (debugIsFootstepsEnabled() && PLAYERCOUNT() == 1 && chr->magicanim >= 0) {
if (PLAYERCOUNT() == 1 && chr->magicanim >= 0) {
#if VERSION >= VERSION_PAL_BETA
chr->magicframe += g_Vars.lvupdate60freal * chr->magicspeed;
#else
-1
View File
@@ -1,6 +1,5 @@
#include <ultra64.h>
#include "constants.h"
#include "game/debug.h"
#include "game/game_006900.h"
#include "game/propsnd.h"
#include "game/bg.h"
+1 -6
View File
@@ -85,11 +85,7 @@ u8 hudmsgsAreActive(void)
s32 hudmsgIsZoomRangeVisible(void)
{
return optionsGetShowZoomRange(g_Vars.currentplayerstats->mpindex)
&& (PLAYERCOUNT() == 1
|| !g_Vars.mplayerisrunning
|| g_Vars.coopplayernum >= 0
|| g_Vars.antiplayernum >= 0)
&& var80075d60 == 2
&& (PLAYERCOUNT() == 1 || !g_Vars.mplayerisrunning || g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0)
&& currentPlayerGetSight() == SIGHT_ZOOM
&& g_Vars.currentplayer->cameramode != CAMERAMODE_EYESPY
&& g_Vars.currentplayer->cameramode != CAMERAMODE_THIRDPERSON;
@@ -1715,7 +1711,6 @@ Gfx *hudmsgsRender(Gfx *gdl)
if (timerthing) {
if (optionsGetShowMissionTime(g_Vars.currentplayerstats->mpindex)
&& var80075d60 == 2
&& g_Vars.normmplayerisrunning == false
&& g_Vars.stagenum != STAGE_CITRAINING
&& g_Vars.currentplayer->cameramode != CAMERAMODE_EYESPY
+7 -169
View File
@@ -16,7 +16,6 @@
#include "game/chr.h"
#include "game/chraction.h"
#include "game/credits.h"
#include "game/debug.h"
#include "game/dlights.h"
#include "game/explosions.h"
#include "game/filemgr.h"
@@ -646,69 +645,6 @@ bool lvUpdateTrackedProp(struct trackedprop *trackedprop, s32 index)
return true;
}
#if VERSION == VERSION_NTSC_BETA || VERSION == VERSION_PAL_BETA
Gfx *lvRenderManPosIfEnabled(Gfx *gdl)
{
char bufroom[16];
char bufx[16];
char bufy[16];
char bufz[16];
char bufdir[16];
s32 x;
s32 y;
s32 y2;
if (debugIsManPosEnabled()) {
f32 xfrac = g_Vars.currentplayer->bond2.unk00.x;
f32 zfrac = g_Vars.currentplayer->bond2.unk00.z;
char directions[][3] = {
{'n', '\0', '\0'},
{'n', 'e', '\0'},
{'e', '\0', '\0'},
{'s', 'e', '\0'},
{'s', '\0', '\0'},
{'s', 'w', '\0'},
{'w', '\0', '\0'},
{'n', 'w', '\0'},
{'n', '\0', '\0'},
};
s32 degrees = atan2f(-xfrac, zfrac) * 180.0f / M_PI;
sprintf(bufroom, "R=%d(%d)", g_Vars.currentplayer->prop->rooms[0], g_Vars.currentplayer->cam_room);
sprintf(bufx, "%s%sx %4.0f", "", "", g_Vars.currentplayer->prop->pos.x);
sprintf(bufy, "%s%sy %4.0f", "", "", g_Vars.currentplayer->prop->pos.y);
sprintf(bufz, "%s%sz %4.0f", "", "", g_Vars.currentplayer->prop->pos.z);
sprintf(bufdir, "%s %3d", &directions[(degrees + 22) / 45], degrees);
x = viGetViewLeft() + 17;
y = viGetViewTop() + 17;
y2 = y + 10;
gdl = text0f153628(gdl);
gdl = text0f153a34(gdl, 0, y - 1, viGetWidth(), y2 + 1, 0x00000064);
gdl = textRenderProjected(gdl, &x, &y, bufroom, g_CharsHandelGothicSm, g_FontHandelGothicSm, 0xffffffff, viGetWidth(), viGetHeight(), 0, 0);
x = viGetViewLeft() + 87;
gdl = textRenderProjected(gdl, &x, &y, bufx, g_CharsHandelGothicSm, g_FontHandelGothicSm, 0xffffffff, viGetWidth(), viGetHeight(), 0, 0);
x = viGetViewLeft() + 141;
gdl = textRenderProjected(gdl, &x, &y, bufy, g_CharsHandelGothicSm, g_FontHandelGothicSm, 0xffffffff, viGetWidth(), viGetHeight(), 0, 0);
x = viGetViewLeft() + 195;
gdl = textRenderProjected(gdl, &x, &y, bufz, g_CharsHandelGothicSm, g_FontHandelGothicSm, 0xffffffff, viGetWidth(), viGetHeight(), 0, 0);
x = viGetViewLeft() + 249;
gdl = textRenderProjected(gdl, &x, &y, bufdir, g_CharsHandelGothicSm, g_FontHandelGothicSm, 0xffffffff, viGetWidth(), viGetHeight(), 0, 0);
gdl = text0f153780(gdl);
}
return gdl;
}
#endif
void lvFindThreatsForProp(struct prop *prop, bool inchild, struct coord *playerpos, bool *activeslots, f32 *distances)
{
bool condition = true;
@@ -1139,12 +1075,7 @@ Gfx *lvRender(Gfx *gdl)
if (g_Vars.stagenum == STAGE_TITLE) {
gSPDisplayList(gdl++, &var800613a0);
if (debugIsZBufferDisabled()) {
gSPDisplayList(gdl++, &var80061360);
} else {
gSPDisplayList(gdl++, &var80061380);
}
gSPDisplayList(gdl++, &var80061380);
gdl = vi0000b280(gdl);
gdl = vi0000b1d0(gdl);
@@ -1280,12 +1211,7 @@ Gfx *lvRender(Gfx *gdl)
bviewSetMotionBlur(bluramount);
gSPDisplayList(gdl++, &var800613a0);
if (debugIsZBufferDisabled()) {
gSPDisplayList(gdl++, &var80061360);
} else {
gSPDisplayList(gdl++, &var80061380);
}
gSPDisplayList(gdl++, &var80061380);
profileStart(PROFILEMARKER_LVR_PREPARE);
viSetViewPosition(g_Vars.currentplayer->viewleft, g_Vars.currentplayer->viewtop);
@@ -1311,7 +1237,6 @@ Gfx *lvRender(Gfx *gdl)
var80084050++;
} else if (g_Vars.currentplayer->gunctrl.unk1583_06
&& var80075d60 == 2
&& g_Vars.currentplayer->cameramode != CAMERAMODE_THIRDPERSON
&& g_Vars.currentplayer->cameramode != CAMERAMODE_EYESPY
&& var8009dfc0 == 0) {
@@ -1331,9 +1256,7 @@ Gfx *lvRender(Gfx *gdl)
PROFILE(PROFILEMARKER_LVR_MENU, gdl = menuRender(gdl));
}
} else {
if (var80075d60 == 2) {
gdl = playerUpdateShootRot(gdl);
}
gdl = playerUpdateShootRot(gdl);
gdl = viRenderViewportEdges(gdl);
PROFILE(PROFILEMARKER_LVR_SKY1, gdl = skyRender(gdl));
@@ -1458,7 +1381,7 @@ Gfx *lvRender(Gfx *gdl)
PROFILE(PROFILEMARKER_LVR_PICKUP, propsTestForPickup());
PROFILE(PROFILEMARKER_LVR_BG, gdl = bgRender(gdl));
chr0f028498(var80075d68 == 15 || g_AnimHostEnabled);
chr0f028498(false);
PROFILE(PROFILEMARKER_LVR_BEAMS, gdl = propsRenderBeams(gdl));
PROFILE(PROFILEMARKER_LVR_SHARDS, gdl = shardsRender(gdl));
PROFILE(PROFILEMARKER_LVR_SPARKS, gdl = sparksRender(gdl));
@@ -1468,21 +1391,9 @@ Gfx *lvRender(Gfx *gdl)
PROFILE(PROFILEMARKER_LVR_NBOMBS, gdl = nbombsRender(gdl));
}
if (var80075d60 == 2) {
PROFILE(PROFILEMARKER_LVR_HUD, gdl = playerRenderHud(gdl));
PROFILE(PROFILEMARKER_LVR_HUD, gdl = playerRenderHud(gdl));
#if VERSION == VERSION_NTSC_BETA || VERSION == VERSION_PAL_BETA
gdl = lvRenderManPosIfEnabled(gdl);
#endif
} else {
gdl = boltbeamsRender(gdl);
if (g_Vars.currentplayer->visionmode != VISIONMODE_XRAY) {
gdl = bgRenderArtifacts(gdl);
}
}
if (g_DebugScreenshotRgb <= 0) {
{
static struct sndstate *g_CutsceneStaticAudioHandle = NULL;
static s32 g_CutsceneStaticTimer = 100;
static u8 g_CutsceneStaticActive = false;
@@ -1640,34 +1551,10 @@ Gfx *lvRender(Gfx *gdl)
f32 cutsceneblurfrac = playerGetCutsceneBlurFrac();
if (cutsceneblurfrac > 0) {
#if VERSION < VERSION_PAL_BETA
u32 stack;
#endif
gdl = bviewDrawMotionBlur(gdl, 0xffffff00, cutsceneblurfrac * 255);
}
}
#if VERSION >= VERSION_PAL_FINAL
if (bluramount);
if (bluramount);
if (bluramount);
#elif VERSION >= VERSION_NTSC_1_0
if (bluramount);
if (bluramount);
#else
if (bluramount);
if (bluramount);
if (bluramount);
#endif
if (debugGetMotionBlur() == 1) {
gdl = bviewDrawMotionBlur(gdl, 0xffffff00, 128);
} else if (debugGetMotionBlur() == 2) {
gdl = bviewDrawMotionBlur(gdl, 0xffffff00, 192);
} else if (debugGetMotionBlur() == 3) {
gdl = bviewDrawMotionBlur(gdl, 0xffffff00, 230);
}
// Render white when teleporting
if (g_Vars.currentplayer->teleportstate > TELEPORTSTATE_INACTIVE) {
alpha = 0;
@@ -1702,50 +1589,13 @@ Gfx *lvRender(Gfx *gdl)
}
}
#if VERSION >= VERSION_NTSC_1_0
PROFILE(PROFILEMARKER_LVR_SCENARIO, gdl = scenarioRenderHud(gdl));
PROFILE(PROFILEMARKER_LVR_FADE, gdl = lvRenderFade(gdl));
#else
gdl = lvRenderFade(gdl);
gdl = scenarioRenderHud(gdl);
#endif
if (g_FrIsValidWeapon) {
gdl = frRenderHud(gdl);
}
if (debugGetTilesDebugMode() != 0
|| debugGetPadsDebugMode() != 0
|| debug0f11eea8()
|| debug0f11ef80()
|| debugIsChrStatsEnabled()
|| debug0f11ee40()) {
#if VERSION < VERSION_NTSC_1_0
s16 spc8[21];
s16 spb0[11];
s16 sp9c[10];
s32 j;
sp9c[0] = g_Vars.currentplayer->memcamroom;
sp9c[1] = -1;
for (j = 0; sp9c[j] != -1; j++) {
spc8[j] = sp9c[j];
}
spc8[j] = -1;
for (j = 0; sp9c[j] != -1; j++) {
roomGetNeighbours(sp9c[j], spb0, 10);
roomsAppend(spb0, spc8, 20);
}
if (debugIsChrStatsEnabled()) {
gdl = chrsRenderChrStats(gdl, spc8);
}
#endif
}
PROFILE(PROFILEMARKER_LVR_SKY2, gdl = sky0f1274d8(gdl));
PROFILE(PROFILEMARKER_LVR_ACTIVEMENU, gdl = amRender(gdl));
mtx00016748(1);
@@ -2074,12 +1924,6 @@ s32 lvGetSlowMotionType(void)
if (cheatIsActive(CHEAT_SLOMO)) {
return SLOWMOTION_ON;
}
if (debugGetSlowMotion() == SLOWMOTION_ON) {
return SLOWMOTION_ON;
}
if (debugGetSlowMotion() == SLOWMOTION_SMART) {
return SLOWMOTION_SMART;
}
}
return SLOWMOTION_OFF;
@@ -2424,13 +2268,7 @@ void lvTickPlayer(void)
f32 xdiff;
f32 zdiff;
if (var80075d64 == 2) {
if (var80075d68 == 2) {
playerTick(true);
} else {
playerTick(false);
}
}
playerTick(true);
xdiff = g_Vars.currentplayer->prop->pos.x - g_Vars.currentplayer->bondprevpos.x;
zdiff = g_Vars.currentplayer->prop->pos.z - g_Vars.currentplayer->bondprevpos.z;
-5
View File
@@ -1,7 +1,6 @@
#include <ultra64.h>
#include "constants.h"
#include "game/chraction.h"
#include "game/debug.h"
#include "game/prop.h"
#include "game/setuputils.h"
#include "game/objectives.h"
@@ -332,10 +331,6 @@ s32 objectiveCheck(s32 index)
}
}
if (debugForceAllObjectivesComplete()) {
objstatus = OBJECTIVE_COMPLETE;
}
return objstatus;
}
+1 -3
View File
@@ -5558,9 +5558,7 @@ s32 playerTickThirdPerson(struct prop *prop)
}
if (player->haschrbody && player->model00d4) {
if (var80075d60 == 0
|| var80075d60 == 1
|| (player->cameramode == CAMERAMODE_THIRDPERSON && player->visionmode != VISIONMODE_SLAYERROCKET)) {
if (player->cameramode == CAMERAMODE_THIRDPERSON && player->visionmode != VISIONMODE_SLAYERROCKET) {
chr->chrflags |= CHRCFLAG_00000001;
player->bondperimenabled = false;
-8
View File
@@ -5,7 +5,6 @@
#include "game/cheats.h"
#include "game/chraction.h"
#include "game/chrai.h"
#include "game/debug.h"
#include "game/dlights.h"
#include "game/nbomb.h"
#include "game/playerreset.h"
@@ -14223,15 +14222,8 @@ void objDeform(struct defaultobj *obj, s32 level)
salt = 0;
if (debugIsObjDeformDebugEnabled());
if (debugIsObjDeformDebugEnabled());
salt = random();
if (debugIsObjDeformDebugEnabled()) {
salt &= 0xffff;
}
wallhitsFreeByProp(obj->prop, 1);
swap = false;
-1
View File
@@ -4,7 +4,6 @@
#include "game/bondmove.h"
#include "game/cheats.h"
#include "game/chraction.h"
#include "game/debug.h"
#include "game/chr.h"
#include "game/prop.h"
#include "game/propsnd.h"
-47
View File
@@ -1,47 +0,0 @@
#ifndef IN_GAME_DEBUG_H
#define IN_GAME_DEBUG_H
#include <ultra64.h>
#include "data.h"
#include "types.h"
void debug0f119a80nb(void);
u32 dprint();
s32 debug0f11ed70(void);
bool debugIsBgRenderingEnabled(void);
bool debugIsPropRenderingEnabled(void);
bool debug0f11edb0(void);
bool debugIsObjDeformDebugEnabled(void);
bool debugIsRoomStateDebugEnabled(void);
s32 debugIsTurboModeEnabled(void);
bool debugForceAllObjectivesComplete(void);
bool debugIsZBufferDisabled(void);
bool debug0f11ee40(void);
s32 debugGetSlowMotion(void);
s32 debugGetTilesDebugMode(void);
s32 debugGetPadsDebugMode(void);
bool debug0f11eea8(void);
bool debugDangerousProps(void);
s32 debugGetMotionBlur(void);
bool debugIsFootstepsEnabled(void);
bool debugAllowEndLevel(void);
bool debugIsChrStatsEnabled(void);
bool debug0f11ef80(void);
s32 dmenuGetSelectedOption(void);
void dmenuSetSelectedOption(s32 option);
void dmenuSetMenu(char **labels, s32 (*positions)[2], s32 *offsets);
void dmenuNavigateRight(void);
void dmenuNavigateLeft(void);
void dmenuNavigateUp(void);
void dmenuNavigateDown(void);
Gfx *dmenuRender(Gfx *gdl);
void debugUpdateMenu(void);
bool debugProcessInput(s8 stickx, s8 sticky, u16 buttons, u16 buttonsthisframe);
bool debugIsLineModeEnabled(void);
extern s32 var800786f4nb;
extern s32 g_DebugMenuPositions[][2];
extern char *g_DebugMenuLabels[];
#endif
-1
View File
@@ -6,7 +6,6 @@
#include "constants.h"
#include "game/camdraw.h"
#include "game/cheats.h"
#include "game/debug.h"
#include "game/file.h"
#include "game/lang.h"
#include "game/race.h"