Skip to content
28 changes: 24 additions & 4 deletions src/SB/Core/gc/iSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,27 @@ extern void* MemoryFunctions[4];
extern U16 last_error;
extern OSContext* last_context;

extern char stringBase0[];
// Taken from iSystem.s
// Defining these here makes the stringBase0 offsets match in the later functions.
char* str1 = "Level %d, Warning $03d: %s\n";
char* str2 = "FPE: Invalid operation: ";
char* str3 = "SNaN\n";
char* str4 = "Infinity - Infinity\n";
char* str5 = "Infinity / Infinity\n";
char* str6 = "0 / 0\n";
char* str7 = "Infinity * 0\n";
char* str8 = "Invalid compare\n";
char* str9 = "Software request\n";
char* str10 = "Invalid square root\n";
char* str11 = "Invalid integer convert\n";
char* str12 = "FPE: Overflow\n";
char* str13 = "FPE: Underflow\n";
char* str14 = "FPE: Zero division\n";
char* str15 = "FPE: Inexact result\n";
char* str16 = "iSystem.cpp";
char* str17 = "Unable to initialize memory system.\n";
char* str18 = "(With apologies to Jim Morrison) This the end, my only friend, The End.";
char* str19 = "%s.rw3";

void** psGetMemoryFunctions()
{
Expand Down Expand Up @@ -87,9 +107,9 @@ void iSystemExit()
xMemExit();
OSPanic
(
stringBase0 + 0x113, // "iSystem.cpp"
0x21d,
stringBase0 + 0x144 // "(With apologies to Jim Morrison) This the end, my only friend, The End."
"iSystem.cpp",
'!',
"(With apologies to Jim Morrison) This the end, my only friend, The End."
);
}

Expand Down
363 changes: 121 additions & 242 deletions src/SB/Game/zEntCruiseBubble.cpp

Large diffs are not rendered by default.

166 changes: 159 additions & 7 deletions src/SB/Game/zGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,159 @@ extern F32 lbl_803CF5AC; // A
extern F32 lbl_803CDA54;
extern F32 lbl_803CDA58;

extern char stringBase0[];
// Taken from zGame.s
// Defining these here makes the stringBase0 offsets match in the later functions.
char* str1 = "HB02";
char* str2 = "HB01";
char* str3 = "HB03";
char* str4 = "HB04";
char* str5 = "JF01";
char* str6 = "JF02";
char* str7 = "JF03";
char* str8 = "JF04";
char* str9 = "BB01";
char* str10 = "BB02";
char* str11 = "BB03";
char* str12 = "BB04";
char* str13 = "GL01";
char* str14 = "GL02";
char* str15 = "GL03";
char* str16 = "B101";
char* str17 = "HB05";
char* str18 = "HB06";
char* str19 = "HB09";
char* str20 = "BC01";
char* str21 = "BC02";
char* str22 = "BC03";
char* str23 = "BC04";
char* str24 = "BC05";
char* str25 = "RB01";
char* str26 = "RB02";
char* str27 = "RB03";
char* str28 = "SM01";
char* str29 = "SM02";
char* str30 = "SM03";
char* str31 = "SM04";
char* str32 = "B201";
char* str33 = "DB01";
char* str34 = "DB02";
char* str35 = "DB03";
char* str36 = "DB04";
char* str37 = "DB06";
char* str38 = "KF01";
char* str39 = "KF02";
char* str40 = "KF04";
char* str41 = "KF05";
char* str42 = "GY01";
char* str43 = "GY02";
char* str44 = "GY03";
char* str45 = "GY04";
char* str46 = "HB07";
char* str47 = "HB08";
char* str48 = "B302";
char* str49 = "B303";
char* str50 = "HB10";
char* str51 = "PG12";
char* str52 = "techbutton6_click";
char* str53 = "SAVING GAME ICON UI";
char* str54 = "MNU4 AUTO SAVE FAILED";
char* str55 = "MNU4 SAVE COMPLETED";
char* str56 = "{font=0}{i:MNU4 AUTO SAVE TXT}";
char* str57 = "fx_boomball_smoke.RW3";
char* str58 = "ui_savinggame";
char* str59 = "ui_savinggame.RW3";
char* str60 = "GAME OVER (%f secs)\n";
char* str61 = "Loading... %3.2f\n";
char* str62 = " ";
char* str63 = ". ";
char* str64 = ".. ";
char* str65 = "...";
char* str66 = "loading screen bg";
char* str67 = "eGameWhere_NA";
char* str68 = "eGameWhere_InitStart";
char* str69 = "eGameWhere_InitScene";
char* str70 = "eGameWhere_InitCamera";
char* str71 = "eGameWhere_InitMusic";
char* str72 = "eGameWhere_InitOther";
char* str73 = "eGameWhere_InitEnd";
char* str74 = "eGameWhere_ExitStart";
char* str75 = "eGameWhere_ExitRumble";
char* str76 = "eGameWhere_ExitHUD";
char* str77 = "eGameWhere_ExitSound";
char* str78 = "eGameWhere_ExitCamera";
char* str79 = "eGameWhere_ExitScene";
char* str80 = "eGameWhere_ExitEnd";
char* str81 = "eGameWhere_SetupScene";
char* str82 = "eGameWhere_SetupZFX";
char* str83 = "eGameWhere_SetupPlayer";
char* str84 = "eGameWhere_SetupCamera";
char* str85 = "eGameWhere_SetupScrFX";
char* str86 = "eGameWhere_SetupSceneLoad";
char* str87 = "eGameWhere_SetupMusicNotify";
char* str88 = "eGameWhere_SetupHudSetup";
char* str89 = "eGameWhere_SetupSkydome";
char* str90 = "eGameWhere_SetupSceneEvents";
char* str91 = "eGameWhere_SetupUpdateCull";
char* str92 = "eGameWhere_SetupLOD";
char* str93 = "eGameWhere_SetupExtras";
char* str94 = "eGameWhere_SetupEnd";
char* str95 = "eGameWhere_LoopStart";
char* str96 = "eGameWhere_CutsceneFinish";
char* str97 = "eGameWhere_LoopDo";
char* str98 = "eGameWhere_LoopCalcTime";
char* str99 = "eGameWhere_LoopPadUpdate";
char* str100 = "eGameWhere_LoopTRCCheck";
char* str101 = "eGameWhere_LoopCheats";
char* str102 = "eGameWhere_LoopSceneUpdate";
char* str103 = "eGameWhere_LoopPlayerUpdate";
char* str104 = "eGameWhere_LoopSoundUpdate";
char* str105 = "eGameWhere_LoopSFXWidgets";
char* str106 = "eGameWhere_LoopHUDUpdate";
char* str107 = "eGameWhere_LoopCameraUpdate";
char* str108 = "eGameWhere_LoopCameraFXUpdate";
char* str109 = "eGameWhere_LoopFlyToInterface";
char* str110 = "eGameWhere_LoopCameraBegin";
char* str111 = "eGameWhere_LoopSceneRender";
char* str112 = "eGameWhere_LoopCameraEnd";
char* str113 = "eGameWhere_LoopCameraShowRaster";
char* str114 = "eGameWhere_LoopCameraFXEnd";
char* str115 = "eGameWhere_LoopMusicUpdate";
char* str116 = "eGameWhere_LoopUpdateMode";
char* str117 = "eGameWhere_LoopContinue";
char* str118 = "eGameWhere_LoopEndGameLoop";
char* str119 = "eGameWhere_SaveLoop";
char* str120 = "eGameWhere_ModeSceneSwitch";
char* str121 = "eGameWhere_ModeCutsceneFinish";
char* str122 = "eGameWhere_ModeGameExit";
char* str123 = "eGameWhere_ModeGameInit";
char* str124 = "eGameWhere_ModeGameSetup";
char* str125 = "eGameWhere_ModeSwitchAutoSave";
char* str126 = "eGameWhere_ModeSwitchCutsceneFinish";
char* str127 = "eGameWhere_ModeStoreCheckpoint";
char* str128 = "eGameWhere_LoseChanceReset";
char* str129 = "eGameWhere_LoseChanceResetDone";
char* str130 = "eGameWhere_TransitionBubbles";
char* str131 = "eGameWhere_TransitionBegin";
char* str132 = "eGameWhere_TransitionSnapShot";
char* str133 = "eGameWhere_TransitionUpdate";
char* str134 = "eGameWhere_TransitionPadUpdate";
char* str135 = "eGameWhere_TransitionTRCCheck";
char* str136 = "eGameWhere_TransitionCameraClear";
char* str137 = "eGameWhere_TransitionCameraBegin";
char* str138 = "eGameWhere_TransitionRenderBackground";
char* str139 = "eGameWhere_TransitionSpawnBubbles";
char* str140 = "eGameWhere_TransitionDrawEnd";
char* str141 = "eGameWhere_TransitionUpdateBubbles";
char* str142 = "eGameWhere_TransitionCameraEnd";
char* str143 = "eGameWhere_TransitionCameraShowRaster";
char* str144 = "eGameWhere_TransitionUpdateEnd";
char* str145 = "eGameWhere_TransitionUIRender";
char* str146 = "eGameWhere_TransitionUIRenderEnd";
char* str147 = "eGameWhere_TransitionEnd";
char* str148 = "eGameWhere_TransitionEnded";
char* str149 = "eGameWhere_SetupPlayerInit";
char* str150 = "eGameWhere_SetupPlayerCamera";
char* str151 = "eGameWhere_SetupPlayerEnd";

#ifdef NON_MATCHING
// Scheduling, I guess
Expand Down Expand Up @@ -197,7 +349,7 @@ S32 zGameOkToPause()
{
return 0;
}
if ((globals.sceneCur)->sceneID == 0x50473132)
if ((globals.sceneCur)->sceneID == 'PG12')
{
return 0;
}
Expand Down Expand Up @@ -226,10 +378,10 @@ void zGamePause()
}
else
{
zEntEvent(stringBase0 + 0xff, 24); // "techbutton6_click"
zEntEvent(stringBase0 + 0x111, 4); // "SAVING GAME ICON UI"
zEntEvent(stringBase0 + 0x125, 4); // "MNU4 AUTO SAVE FAILED"
zEntEvent(stringBase0 + 0x13b, 4); // "MNU4 SAVE COMPLETED"
zEntEvent("techbutton6_click", 24);
zEntEvent("SAVING GAME ICON UI", 4);
zEntEvent("MNU4 AUTO SAVE FAILED", 4);
zEntEvent("MNU4 SAVE COMPLETED", 4);
iPadStopRumble(globals.pad0);
zGameModeSwitch(eGameMode_Pause);
zGameStateSwitch(0);
Expand All @@ -244,7 +396,7 @@ void zGameStall()
zGameModeSwitch(eGameMode_Stall);
xSndPauseAll(1, 1);
iPadStopRumble(globals.pad0);
zEntEvent(stringBase0 + 0xff, 24); // "techbutton6_click"
zEntEvent("techbutton6_click", 24);
}
}

Expand Down
57 changes: 56 additions & 1 deletion src/SB/Game/zLightning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,62 @@ extern RwRaster* sLightningRaster;
extern xVec3 sTweakStart;
extern xVec3 sTweakEnd;

char* _ = "Line";
// Taken from zLightning.s
// Defining these here makes the stringBase0 offsets match in the later functions.
char* str1 = "Line";
char* str2 = "Rotating";
char* str3 = "Zeus";
char* str4 = "Func";
char* str5 = "Lightning|\x01Type Info";
char* str6 = "Lightning|\x01Type Info|Setup Degrees";
char* str7 = "Lightning|\x01Type Info|Move Degrees";
char* str8 = "Lightning|\x01Type Info|Normal Offset";
char* str9 = "Lightning|\x01Type Info|Back Offset";
char* str10 = "Lightning|\x01Type Info|Side Offset";
char* str11 = "PAREMIT_EG_SPARK";
char* str12 = "LIGHTNING";
char* str13 = "Lightning|\x01\x01Go";
char* str14 = "Start Lightning";
char* str15 = "Lightning|\x01Globals|\x01\x01JerkFrequency";
char* str16 = "Lightning|\x01Globals|\x01\x02ShiftSpeed";
char* str17 = "Lightning|\x01Globals|\x01\x03MinPStep";
char* str18 = "Lightning|\x01Globals|\x01\x03MaxPStep";
char* str19 = "Lightning|\x01Globals|\x02\x01MinScale";
char* str20 = "Lightning|\x01Globals|\x02\x01MaxScale";
char* str21 = "Lightning|\x01Globals|\x02\x01ScalePerLength";
char* str22 = "Lightning|\x01Globals|\x02\x02MinSpan";
char* str23 = "Lightning|\x01Globals|\x02\x02SpanPerLength";
char* str24 = "Lightning|\x01Globals|\x02\x03SlopeRange";
char* str25 = "Lightning|\x01Globals|\x02\x03UVSpeed";
char* str26 = "Lightning|\x01Time";
char* str27 = "Lightning|\x01Total Points";
char* str28 = "Lightning|\x01Type";
char* str29 = "Lightning|\x02Flag|Rot Scalar";
char* str30 = "Lightning|\x02Flag|No Fade Out";
char* str31 = "Lightning|\x02Flag|Arc";
char* str32 = "Lightning|\x02Flag|Vertical Orientation";
char* str33 = "Lightning|\x02Flag|Taper Thickness At End";
char* str34 = "Lightning|\x02Flag|Taper Thickness At Start";
char* str35 = "Lightning|\x02Start|x";
char* str36 = "Lightning|\x02Start|y";
char* str37 = "Lightning|\x02Start|z";
char* str38 = "Lightning|\x03End|x";
char* str39 = "Lightning|\x03End|y";
char* str40 = "Lightning|\x03End|z";
char* str41 = "Lightning|\x04Color|\x01R";
char* str42 = "Lightning|\x04Color|\x02G";
char* str43 = "Lightning|\x04Color|\x03B";
char* str44 = "Lightning|\x04Color|\x04A";
char* str45 = "Lightning|Lengths|Rot Radius";
char* str46 = "Lightning|Lengths|Arc Height";
char* str47 = "Lightning|Lengths|Thickness";
char* str48 = "Lightning|Randomness|Rand Radius";
char* str49 = "X to test lightning\n";
char* str50 = " ";
char* str51 = "1";
char* str52 = "0";
char* str53 = "-";
char* str54 = "\n";

void xDebugAddTweak(const char*, F32*, F32, F32, const tweak_callback*, void*, U32)
{
Expand Down
21 changes: 19 additions & 2 deletions src/SB/Game/zNPCTypeAmbient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,27 @@ extern F32 zNPCTypeAmbientx405f66f3;
extern F32 zNPCTypeAmbientx3f400000;
extern F32 zNPCTypeAmbientx3edf66f3;
extern NPCSndTrax g_sndTrax_Neptune;
extern char zNPCTypeAmbient_stringBase0[];
extern F32 _882;
extern F32 _883;

// Taken from zNPCTypeAmbient.s.
// Defining these here makes the stringBase0 offsets match in the later functions.
char* str1 = "Unknown";
char* str2 = "Idle01";
char* str3 = "Idle02";
char* str4 = "Idle03";
char* str5 = "Fidget01";
char* str6 = "Fidget02";
char* str7 = "Fidget03";
char* str8 = "Move01";
char* str9 = "Bumped01";
char* str10 = "Dance01";
char* str11 = "Pray01";
char* str12 = "Attack01";
char* str13 = "zNPCAmbient";
char* str14 = "zNPCJelly";
char* str15 = "zNPCNeptune";

void ZNPC_Ambient_Startup()
{
S32 i = 0;
Expand Down Expand Up @@ -84,7 +101,7 @@ void ZNPC_Destroy_Ambient(xFactoryInst* inst)

xAnimTable* ZNPC_AnimTable_Ambient()
{
xAnimTable* table = (xAnimTable*)xAnimTableNew(zNPCTypeAmbient_stringBase0 + 0x60, NULL, 0);
xAnimTable* table = (xAnimTable*)xAnimTableNew("zNPCAmbient", NULL, 0);
xAnimTableNewState(table, g_strz_ambianim[1], 0x110, 1, _882, NULL, NULL, _883, NULL, NULL,
xAnimDefaultBeforeEnter, NULL, NULL);
return table;
Expand Down
16 changes: 13 additions & 3 deletions src/SB/Game/zNPCTypeTiki.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,24 @@ extern const char* g_strz_tikianim[ANIM_COUNT];
extern U32 g_hash_tikianim[ANIM_COUNT];
extern zParEmitter* cloudEmitter;
extern xParEmitterCustomSettings thunderEmitterInfo;
extern char zNPCTypeTiki_stringBase0[];
extern F32 _862;
extern F32 _858_2;
extern F32 _1084;
extern F32 _867;
extern NPCSndTrax g_sndTrax_TikiShared[3];
extern NPCSndTrax g_sndTrax_TikiThunder[2];

// Taken from zNPCTypeTiki.s
// Defining these here makes the stringBase0 offsets match in the later functions.
char* str1 = "Unknown";
char* str2 = "Idle01";
char* str3 = "PAREMIT_THUNDER_CLOUD";
char* str4 = "PAREMIT_CLOUD";
char* str5 = "target";
char* str6 = "zNPCTiki";
char* str7 = "what the ...\n";
char* str8 = "Idle";

void ZNPC_Tiki_Startup()
{
for (S32 i = 0; i < ANIM_COUNT; i++)
Expand Down Expand Up @@ -112,7 +122,7 @@ xAnimTable* ZNPC_AnimTable_Tiki()
{
xAnimTable* table;

table = xAnimTableNew(zNPCTypeTiki_stringBase0 + 0x3a, NULL, 0);
table = xAnimTableNew("zNPCTiki", NULL, 0);
xAnimTableNewState(table, g_strz_tikianim[1], 0x110, 1, _862, NULL, NULL, _858_2, NULL, NULL,
xAnimDefaultBeforeEnter, NULL, NULL);
return table;
Expand Down Expand Up @@ -237,7 +247,7 @@ S32 zNPCTiki::CanRope()

void AnimPick()
{
xStrHash(zNPCTypeTiki_stringBase0 + 0x51);
xStrHash("Idle");
}

void zNPCTiki::Move(xScene* xscn, F32 dt, xEntFrame*)
Expand Down
Loading