Skip to content

Commit

Permalink
Cleanup and add more splits
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOnlyZac authored Jul 3, 2024
1 parent 783781b commit 31d5f7e
Show file tree
Hide file tree
Showing 12 changed files with 341 additions and 327 deletions.
27 changes: 15 additions & 12 deletions config/sly1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ segments:
- [0x1c008, asm, P2/splice/ref]
- [0x1ca28, asm, P2/splice/serialize]
- [0x1cd28, asm, P2/splice/sidebag]
- [0x1cf70, asm, P2/splice/spliceutils]
- [0x1cf70, cpp, P2/splice/spliceutils]
- [0x1d128, asm, P2/splice/splotheap]
- [0x1d508, asm, P2/splice/vecmat]

Expand Down Expand Up @@ -146,7 +146,7 @@ segments:
- [0x5b8b0, asm, P2/flash]
- [0x5bae0, asm, P2/fly]
- [0x5d188, asm, P2/font]
- [0x5f810, asm, P2/frm]
- [0x5f810, c, P2/frm]
- [0x60678, asm, P2/freeze]
- [0x60f88, asm, P2/frzg]
- [0x61070, c, P2/game]
Expand Down Expand Up @@ -203,17 +203,17 @@ segments:
- [0x93068, asm, P2/pnt]
#- [0x, asm, P2/po]

- [0x94210, asm, P2/prog]
- [0x94210, c, P2/prog]

- [0x94598, asm] # TODO
#- [0x, asm, P2/prompt]
#- [0x, asm, P2/proxy]
#- [0x, asm, P2/puffer]
#- [0x, asm, P2/pzo]
#- [0x, asm, P2/rail]
#- [0x, asm, P2/rat]
#- [0x, asm, P2/rchm]

- [0x9c038, asm, P2/rat]
- [0x9d440, asm, P2/rchm]
- [0x9e410, asm, P2/render]

- [0x9f040, asm, P2/rip]
Expand Down Expand Up @@ -260,9 +260,9 @@ segments:
- [0xcd410, asm, P2/stephang]
- [0xcefb8, asm, P2/stephide]
- [0xd24f0, asm, P2/steppipe]
- [0xd39c8, asm, P2/steppower]
- [0xd39c8, c, P2/steppower]

- [0xd41d0, asm] #? unknown file
- [0xd41d0, asm, P2/step_pqr_unk] #? unknown file

- [0xd46f0, asm, P2/steprun]
- [0xd5148, asm, P2/stepside]
Expand Down Expand Up @@ -290,7 +290,7 @@ segments:
- [0xeac78, asm, P2/update]
- [0xeb408, c, P2/util]

- [0xec518, asm] #? unknown file
- [0xec518, asm, P2/uv_unk] #? unknown file

- [0xee650, c, P2/vec]
- [0xef318, asm, P2/vifs]
Expand Down Expand Up @@ -440,8 +440,11 @@ segments:
#- [0x, data,, P2/ms]
#- [0x, data,, P2/murray]
#- [0x, data, P2/path]
#- [0x, data, P2/phasemem]
#- [0x, data, P2/pipe]

- [0x16aba4, data, P2/phasemem]
- [0x16aba8, data, P2/pipe]
- [0x16abac, data]

#- [0x, data, P2/pnt]
#- [0x, data,, P2/po]
#- [0x, data, P2/prog]
Expand Down Expand Up @@ -489,7 +492,7 @@ segments:
#- [0x, data, P2/stephide]
#- [0x, data, P2/steppipe]
#- [0x, data, P2/steppower]
#- [0x, data] #? unknown file
#- [0x, data, P2/step_pqr_unk] #? unknown file
#- [0x, data, P2/steprun]
#- [0x, data, P2/stepside]
#- [0x, data, P2/stepzap]
Expand All @@ -509,7 +512,7 @@ segments:
#- [0x, data,, P2/ui]
#- [0x, data, P2/update]
#- [0x, data, P2/util]
#- [0x, data] #? unknown file
#- [0x, data, P2/uv_unk] #? unknown file
#- [0x, data, P2/vec]
#- [0x, data, P2/vifs]
#- [0x, data, P2/vis]
Expand Down
57 changes: 53 additions & 4 deletions config/symbol_addrs.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
_start = 0x100008; // type:func
_exit = 0x1000B8; // type:func


// P2/splice/spliceutils.cpp
StartupSplice__Fv = 0x11BF70; // type:func
ShutdownSplice__Fv = 0x11C040; // type:func
spliceutils__static_initialization_and_destruction_0 = 0x11C0A8; // type:func
_GLOBAL_$I$g_splotheapPair = 0x11C0E8; // type:func
_GLOBAL_$D$g_splotheapPair = 0x11C108; // type:func


// P2/binoc.c
InitBei = 0x130F48; // type:func
GEvaluateBei = 0x131000; // type:func
Expand Down Expand Up @@ -34,7 +43,7 @@ DrawBinoc = 0x1366A0; // type:func
GetBinocReticleFocus = 0x136EC8; // type:func
FUN_00136ef8 = 0x136EF8; // type:func
FUN_00136fa8 = 0x136FA8; // type:func
__static_initialization_and_destruction_0 = 0x136FE8; // type:func
binoc__static_initialization_and_destruction_0 = 0x136FE8; // type:func
SetPos__8CTextBoxff = 0x137228; // type:func
SetSize__8CTextBoxff = 0x137238; // type:func
SetTextColor__8CTextBoxG4RGBA = 0x137248; // type:func
Expand Down Expand Up @@ -96,6 +105,22 @@ g_difficultyEasy = 0x261e90; // size:0x5c
g_difficulty = 0x261ef0; // size:0x20


// P2/frm.c
StartupFrame__Fv = 0x15E810; // type:func
OpenFrame__Fv = 0x15E9F0; // type:func
EnsureVu1Code__FP4VIFSPvT1 = 0x15EAE0; // type:func
FinalizeFrameGifs__FP4GIFSPiPP2QW = 0x15EB20; // type:func
FUN_0015ebf0 = 0x15EBF0; // type:func
CloseFrame__Fv = 0x15EC68; // type:func
PrepareGsForFrameRender__FP3FRM = 0x15ED50; // type:func
check_anticrack_antigrab__Fv = 0x15EDB8; // type:func
FrameRenderLoop__FPv = 0x15EE80; // type:func
RenderFrame__FP3FRMi = 0x15EF88; // type:func
ClearPendingFrame__FP3FRM = 0x15EFE8; // type:func
FlushFrames__Fi = 0x15F210; // type:func
BlendPrevFrame__Fv = 0x15F320; // type:func


// P2/game.c
StartupGame__Fv = 0x160070; // type:func

Expand Down Expand Up @@ -171,9 +196,29 @@ StartupCodes__Fv = 0x16F588; // type:func

// P2/main.c
main = 0x185758; // type:func
StartupVU0 = 0x185A58; // type:func
StartupVU1 = 0x185AC8; // type:func
Startup = 0x185B38; // type:func
StartupVU0__Fv = 0x185A58; // type:func
StartupVU1__Fv = 0x185AC8; // type:func
Startup__Fv = 0x185B38; // type:func

// P2/phasemem.c
SetPhase__F5PHASE = 0x191E70; // type:func
ClearPhase__Fv = 0x191EB0; // type:func

g_phase = 0x269ba4; // size:0x4


// P2/prog.c
__5CProgG4RGBAN31 = 0x193210; // type:func
Begin__5CProg = 0x193270; // type:func
SetRemain__5CProgi = 0x193288; // type:func
End__5CProg = 0x193300; // type:func
Draw__5CProg = 0x193318; // type:func


// P2/steppower.c
SetFsp__F3FSP = 0x1D29C8; // type:func
UpdateJtActivePowerUp__FP2JTP3JOY = 0x1d2bb8; // type:func
IRotatePowerUp__FP3JOYiiPi = 0x1d3100; // type:func


// P2/util.c
Expand Down Expand Up @@ -221,6 +266,10 @@ FCalculateMuzzleVelocityAngle = 0x1EE290; // type:func
LimitVectorLength = 0x1EE2B0; // type:func


// sce/ee/gcc/src/gcc/libgcc2.c
__main = 0x1fae18; // type:func


// sce/rand.c
srand = 0x1F66F8; // type:func
rand = 0x1F6708; // type:func
Expand Down
135 changes: 133 additions & 2 deletions include/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,144 @@
#define GAME_H

#include "common.h"
#include <gs.h>

/**
* @brief Level state flags integer type
* @brief World ID.
*/
enum GAMEWORLD
{
GAMEWORLD_Intro = 0,
GAMEWORLD_Underwater = 1,
GAMEWORLD_Muggshot = 2,
GAMEWORLD_Voodoo = 3,
GAMEWORLD_Snow = 4,
GAMEWORLD_Clockwerk = 5,
GAMEWORLD_Max = 6
};

/**
* @brief Level ID.
*/
enum WORLDLEVEL
{
WORLDLEVEL_Approach = 0,
WORLDLEVEL_Hub = 1,
WORLDLEVEL_Level1 = 2,
WORLDLEVEL_Level2 = 3,
WORLDLEVEL_Level3 = 4,
WORLDLEVEL_Level4 = 5,
WORLDLEVEL_Level5 = 6,
WORLDLEVEL_Level6 = 7,
WORLDLEVEL_Boss = 8,
WORLDLEVEL_Max = 9
};

/**
* @brief Game state flags.
*/
enum FGS
{
FGS_FirstClue = 0x1,
FGS_HalfClues = 0x2,
FGS_AllClues = 0x4,
FGS_FirstVault = 0x8,
FGS_SecondVault = 0x10
};

/**
* @brief Game state flags integer type.
*/
typedef int GRFGS;

/**
* @brief World state flags.
*/
enum FWS
{
FWS_Visited = 0x1,
FWS_Lock_0 = 0x2,
FWS_Lock_1 = 0x4,
FWS_Lock_2 = 0x8,
FWS_Lock_3 = 0x10,
FWS_Lock_All = 0x1e
};
/**
* @brief World state flags integer type.
*/
typedef int GRFWS;

/**
* @brief Level state flags.
*/
enum FLS
{
FLS_Visited = 0x1,
FLS_KeyCollected = 0x2,
FLS_Secondary = 0x4,
FLS_Tertiary = 0x8,
FLS_BossDefeated = 0x10
};

/**
* @brief Level state flags integer type.
*/
typedef int GRFLS;

/**
* @brief Level State
*/
struct LS
{
FLS fls; // Level state flags
float dt; // Time spent in level (secs)
float dtTimedBest; // Best MTS time for level (secs)
float uSuck; // Current player suck for this level
float unk_suck_0x10; // unknown, seems suck related
int afDialogPlayed[12]; // Dialog played flags
int sceneVars[2][4]; // Scene variables
int cclue; // Count of clues collected
unsigned int fclue; // Clue collected flags
int unk_field_0x6c;
int unk_field_0x70;
char *unk_field_0x74;
};

/**
* @brief World State
*/
struct WS
{
LS als[9]; // Level states array
int ckey; // Count of keys collected in world
int cvault; // Count of vaults opened on worls
int ctimed; // Count of MTSs completed in world
float dt; // Time spent in world (secs)
FWS fws; // World state flags
};

/**
* @brief Game State
*/
typedef int GRFVAULT;
struct GS
{
int gsv; // not sure why this isn't caled fgs
int cbThis; // Struct size (bytes)
int nChecksum; // Expected size (bytes)
float dt; // Time spent in game (secs)
WS aws[6]; // World states array
GAMEWORLD gameworldCur; // Current world
WORLDLEVEL worldlevelCur; // Current level
int clife; // Lives count
int ccharm; // Charm count
int ccoin; // Coin count
GRFGS grfgs; // Game settings flags(?)
GRFVAULT grfvault; // Unlocked powerup flags
unsigned int unlocked_cutscenes;
unsigned int fgs;
int nPowerupLast; // Last selected powerup
};

/**
* @brief Collision ID?
*
Expand Down
Loading

0 comments on commit 31d5f7e

Please sign in to comment.