Skip to content

Commit

Permalink
Merge pull request #133 from TheOnlyZac/theonlyzac
Browse files Browse the repository at this point in the history
Split po.c and suv.c
  • Loading branch information
TheOnlyZac authored Nov 25, 2024
2 parents 05acf09 + f487baa commit 3cd25fa
Show file tree
Hide file tree
Showing 10 changed files with 284 additions and 79 deletions.
67 changes: 11 additions & 56 deletions config/sly1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,14 @@ segments:
#--------------------------------------------------------
- [0x1dbb8, asm, P2/989snd] #MARK: P2
- [0x1f560, c, P2/brx]

- [0x1fe70, asm, P2/ac]
#- [0x, asm, P2/act]
#- [0x, asm, P2/actseg]

- [0x243c0, asm, P2/alarm]

- [0x24dc0, asm, P2/alo]
#- [0x, asm, P2/aseg]
#- [0x, asm, P2/asega]
#- [0x, asm, P2/barrier]

- [0x30cf0, asm, P2/bas]
- [0x310e8, asm, P2/basic]
- [0x31168, asm, P2/bez]
Expand All @@ -96,18 +92,14 @@ segments:
- [0x395a0, asm, P2/bbmark]
- [0x39ff0, asm, P2/blend]
- [0x3ab70, asm, P2/blip]

- [0x3c4c0, asm, P2/bomb]
#- [0x, asm, P2/bone]
#- [0x, asm, P2/bq]

- [0x3dcf8, asm, P2/break]

- [0x3efd8, asm, P2/bsp]
#- [0x, asm, P2/button]
#- [0x, asm, P2/cat] (might not be in release)
#- [0x, asm, P2/cat] # (might not be in release)
#- [0x, asm, P2/can]

- [0x417a8, asm, P2/cd]
- [0x41d90, c, P2/chkpnt]
- [0x429e8, asm, P2/clip]
Expand All @@ -119,72 +111,57 @@ segments:
- [0x4bbd0, c, P2/credit]
- [0x4c0c0, c, P2/crout]
- [0x4c550, asm, P2/crusher]

- [0x4e0a8, asm, P2/crv]

- [0x4fe40, asm, P2/dart]
#- [0x, asm, P2/dartgun]
#- [0x, asm, P2/dialog]

- [0x529e0, c, P2/difficulty]
- [0x53438, c, P2/dl]
- [0x5380C, asm, P2/dl_padding] # Needed to align dmas
- [0x5380C, asm, P2/dl_padding] # 4 bytes padding to align dmas
- [0x53810, c, P2/dmas]
- [0x53E28, asm, P2/dsp]
#- [0x, asm, P2/dysh]
#- [0x, asm, P2/dzg]

- [0x559c8, asm, P2/emitter]
- [0x5a6e0, asm, P2/eyes]
- [0x5aad0, asm, P2/fader]

- [0x5aca0, asm, P2/unk_f] # unknown file, falls alphabetically between fader and find

- [0x5af20, c, P2/find]
- [0x5b8ac, asm, P2/find_padding] # Needed to align P2/find
- [0x5b8ac, asm, P2/find_padding] # 4 bytes padding to align P2/find
- [0x5b8b0, c, P2/flash]
- [0x5bae0, asm, P2/fly]
- [0x5d188, asm, P2/font]
- [0x5f810, c, P2/frm]
- [0x60678, asm, P2/freeze]
- [0x60f88, asm, P2/frzg]
- [0x61070, c, P2/game]

- [0x61e80, asm, P2/geom]
#- [0x, asm, P2/gifs]
#- [0x, asm, P2/glbs]
#- [0x, asm, P2/glob]
#- [0x, asm, P2/gomer]

- [0x69130, c, P2/gs]

- [0x6ac58, asm, P2/hide]
#- [0x, asm, P2/hnd]
#- [0x, asm, P2/ik]
#- [0x, asm, P2/jack]
#- [0x, asm, P2/jlo]

- [0x6f0b8, c, P2/joy]

- [0x70608, c, P2/jt1]
- [0x74888, asm, P2/jt_UpdateJtActive] # should be in P2/jt but doesn't match when split
- [0x74888, asm, P2/jt_UpdateJtActive] # Should be in P2/jt but doesn't match when linked with INCLUDE_ASM
- [0x75808, c, P2/jt2]

- [0x79008, asm, P2/jp]
#- [0x, asm, P2/jsg]

- [0x7e248, asm, P2/jump]
#- [0x, asm, P2/keyhole]
#- [0x, asm, P2/landing]
#- [0x, asm, P2/lgn]

- [0x83c18, asm, P2/lo]
- [0x84cc8, asm, P2/light]
- [0x86358, asm, P2/lookat]
- [0x86758, c, P2/main]
- [0x86c18, asm, P2/mark]
- [0x894c0, asm, P2/mat]

- [0x8b388, asm, P2/mecha]
#- [0x, asm, P2/mb]
#- [0x, asm, P2/memcard]
Expand All @@ -196,63 +173,47 @@ segments:
#- [0x, asm, P2/mrkv]
#- [0x, asm, P2/ms]
#- [0x, asm, P2/murray]

- [0x917e0, asm, P2/path]
- [0x92e70, asm, P2/phasemem]
- [0x92ec0, asm, P2/pipe]

- [0x93068, asm, P2/pnt]
#- [0x, asm, P2/po]

- [0x931a8, c, P2/po]
- [0x94210, c, P2/prog]

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

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

- [0x9f040, asm, P2/rip]
#- [0x, asm, P2/rog]
#- [0x, asm, P2/rope]

- [0xa8b20, asm, P2/rumble]

- [0xa8fe8, asm, P2/rwm]
#- [0x, asm, P2/sampler] (might not be in release)
#- [0x, asm, P2/sampler] # (might not be in release)
#- [0x, asm, P2/sc]

- [0xaac68, c, P2/screen]
- [0xaf510, asm, P2/sensor]

- [0xb2ac8, asm, P2/shadow]
#- [0x, asm, P2/shape]

- [0xb3988, asm, P2/shd]

- [0xb5920, asm, P2/shdanim]
#- [0x, asm, P2/sky]
#- [0x, asm, P2/slotheap]

- [0xb6f50, asm, P2/sm]
#- [0x, asm, P2/smartguard]

- [0xb8968, asm, P2/so]
- [0xbd760, asm, P2/solve]
- [0xbf068, asm, P2/sort]
- [0xbf1e8, asm, P2/sound]
- [0xc1f30, asm, P2/speaker]
- [0xc2190, asm, P2/splicemap]
- [0xc24c0, asm, P2/spliceobj]

- [0xc3430, asm, P2/sprbuf]
#- [0x, asm, P2/sqtr]
#- [0x, asm, P2/squish]

- [0xc5458, asm, P2/step]
- [0xc6f18, asm, P2/stepact]
- [0xc71e0, asm, P2/stepcane]
Expand All @@ -261,25 +222,21 @@ segments:
- [0xcefb8, asm, P2/stephide]
- [0xd24f0, asm, P2/steppipe]
- [0xd39c8, c, P2/steppower]
- [0xd41cc, asm, P2/steppower_padding] # Needed to align steprail
- [0xd41d0, asm, P2/steprail] #? unconfirmed name
- [0xd41cc, asm, P2/steppower_padding] # 4 bytes padding to align steprail
- [0xd41d0, asm, P2/steprail]
- [0xd46f0, asm, P2/steprun]
- [0xd5148, asm, P2/stepside]
- [0xd5848, asm, P2/stepzap]

- [0xd8120, asm, P2/stream]
#- [0x, asm, P2/suv]

- [0xd83a8, c, P2/suv]
- [0xdc480, asm, P2/sw]
- [0xdeb20, asm, P2/unk_st] # unknown file, falls alphabetically between sw and tail
- [0xdece0, c, P2/tail]
- [0xdf798, asm, P2/tank]
#- [0x, asm, P2/target]

- [0xe18f8, asm, P2/text]
- [0xe3268, c, P2/thread]
- [0xe3420, asm, P2/tn]

- [0xe5e38, c, P2/transition]
- [0xe6378, asm, P2/turret]
- [0xe6e70, asm, P2/tv]
Expand All @@ -295,11 +252,9 @@ segments:
- [0xf0838, asm, P2/waypoint]
- [0xf0ce8, asm, P2/wipe]
- [0xf1758, asm, P2/wm] # not confident

- [0xf49f8, c, P2/xform1]
- [0xf4c38, asm, P2/xform_PwarpFromOid]
- [0xf4c38, asm, P2/xform_PwarpFromOid] # Should be in P2/xform but doesn't match when linked with INCLUDE_ASM
- [0xf4d80, c, P2/xform2]

- [0xf5f20, asm, P2/zap]

## Source files in May proto that aren't in release:
Expand Down Expand Up @@ -524,7 +479,7 @@ segments:
#- [0x, data, P2/ui]
#- [0x, data, P2/update]
#- [0x, data, P2/util]
#- [0x, data, P2/uv_unk] #? unknown file
#- [0x, data, P2/unk_uv] #? unknown file
#- [0x, data, P2/vec]
#- [0x, data, P2/vifs]
#- [0x, data, P2/vis]
Expand Down
71 changes: 69 additions & 2 deletions config/symbol_addrs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ PprocPop__3CGc = 0x11A7D8; // type:func
UpdateRecyclable__3CGc = 0x11A800; // type:func
MarkLiveObjects__3CGc = 0x11A850; // type:func
Collect__3CGc = 0x11AB58; // type:func
__static_initialization_and_destruction_0 = 0x11ADF8; // type:func
gc__static_initialization_and_destruction_0 = 0x11ADF8; // type:func
_GLOBAL_$I$g_gc = 0x11AE38; // type:func
_GLOBAL_$D$g_gc = 0x11AE58; // type:func

Expand Down Expand Up @@ -1014,7 +1014,33 @@ g_phase = 0x269ba4; // size:0x4
////////////////////////////////////////////////////////////////
// P2/po.c
////////////////////////////////////////////////////////////////
PpoCur__Fv = 0x1925f0; // type:func
InitPo__FP2PO = 0x1921A8; // type:func
ClonePo__FP2POT0 = 0x1921E8; // type:func
HandlePoMessage__FP2PO5MSGIDPv = 0x192230; // type:func
OnPoActive__FP2POiT0 = 0x1922E8; // type:func
GetPoCpdefi__FP2POfP6CPDEFI = 0x192380; // type:func
MakePoActive__FP2PO = 0x192418; // type:func
FUN_00192450 = 0x192450; // type:func
FUN_00192498 = 0x192498; // type:func
CollectPoPrize__FP2PO3PCKP3ALO = 0x1924C8; // type:func
PpoCur__Fv = 0x1925F0; // type:func
PpoStart__Fv = 0x192620; // type:func
_IppoFindPo__FP2PO = 0x192688; // type:func
AddPoToList__FP2PO = 0x1926D0; // type:func
RemovePoFromList__FP2PO = 0x192780; // type:func
OnPoAdd__FP2PO = 0x192820; // type:func
OnPoRemove__FP2PO = 0x192850; // type:func
SwitchToIppo__Fi = 0x192880; // type:func
SetPoPlayable__FP2POi = 0x192990; // type:func
SwitchToPo__FP2PO = 0x1929D0; // type:func
PpziCur__Fv = 0x1929F8; // type:func
PlayPoDialog__FP2POP6DIALOG = 0x192A38; // type:func
FUN_00192a70 = 0x192A70; // type:func
UpdatePo__FP2POf = 0x192B58; // type:func
UsePoCharm__FP2PO = 0x192C58; // type:func
FUN_00192dd0 = 0x192DD0; // type:func
po__static_initialization_and_destruction_04 = 0x1930B8; // type:func
_GLOBAL_$I$InitPo__FP2PO = 0x1931F0; // type:func


////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1173,6 +1199,47 @@ func_001D32D8__FiP2JTl = 0x1D32D8; // type:func
func_001D31D0__FP2LOi = 0x1D31D0; // type:func


////////////////////////////////////////////////////////////////
// P2/suv.c
////////////////////////////////////////////////////////////////
InitSuv__FP3SUV = 0x1D73A8; // type:func
PostSuvLoad__FP3SUV = 0x1D7440; // type:func
PresetSuvAccel__FP3SUVf = 0x1D7778; // type:func
GExcludeAlm__FiP2LMf = 0x1D8470; // type:func
UpdateSuvBalance__FP3SUV = 0x1D8578; // type:func
DsGetTrackRelative__Ffff = 0x1D86F8; // type:func
FIsSuvAheadOf__FP3SUVT0 = 0x1D8740; // type:func
UpdateSuvLine__FP3SUVPi = 0x1D87C8; // type:func
UpdateSuvHeading__FP3SUV = 0x1D8BD0; // type:func
UpdateSuvWheels__FP3SUV = 0x1D8D90; // type:func
UpdateSuvExpls__FP3SUV = 0x1D8E40; // type:func
BoostSuv__FP3SUV = 0x1D92F0; // type:func
FUN_001d9338 = 0x1D9338; // type:func
UpdateSuvVolumes__FP3SUVi = 0x1D9488; // type:func
UpdateSuvSounds__FP3SUVf = 0x1D9678; // type:func
UpdateSuvPuncher__FP3SUV = 0x1D9AC8; // type:func
UpdateSuv__FP3SUVf = 0x1D9C98; // type:func
UpdateSuvActive__FP3SUVP3JOYf = 0x1D9D78; // type:func
FUN_001da170 = 0x1DA170; // type:func
AddSuvCustomXps__FP3SUVP2SOiP3BSPT3PP2XP = 0x1DA320; // type:func
UpdateSuvInfluences__FP3SUVP2RO = 0x1DA7E0; // type:func
RenderSuvSelf__FP3SUVP2CMP2RO = 0x1DAA18; // type:func
UpdateSuvBounds__FP3SUV = 0x1DAC20; // type:func
CollectSuvPrize__FP3SUV3PCKP3ALO = 0x1DACB0; // type:func
UpdateSuvShapes__FP3SUV = 0x1DAD28; // type:func
UpdateSuvXfWorld__FP3SUV = 0x1DAE18; // type:func
GetSuvCpdefi__FP3SUVfP6CPDEFI = 0x1DAE48; // type:func
OnSuvActive__FP3SUViP2PO = 0x1DAE68; // type:func
HandleSuvMessage__FP3SUV5MSGIDPv = 0x1DAF08; // type:func
SetSuvTrack__FP3SUVP5SHAPE = 0x1DAFB8; // type:func
SetSuvLine__FP3SUVP5SHAPE = 0x1DB0C8; // type:func
AddSuvCheckPoint__FP3SUVP3VOL = 0x1DB110; // type:func
AddSuvFeature__FP3SUVP3VOLffP4EXPLT4 = 0x1DB1E8; // type:func
SetSuvSuvs__FP3SUV4SUVS = 0x1DB238; // type:func
ResetSuv__FP3SUV = 0x1DB290; // type:func
VecCombo__FG8VU_FLOATG9VU_VECTORT0T1 = 0x1DB460; // type:func


////////////////////////////////////////////////////////////////
// P2/sw.c
////////////////////////////////////////////////////////////////
Expand Down
18 changes: 9 additions & 9 deletions include/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ struct LS
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;
int unk_field_0x6c; // Unknown
int unk_field_0x70; // Unknown
char *unk_field_0x74; // Unknown
};

/**
Expand Down Expand Up @@ -218,7 +218,7 @@ enum WID

struct GAME
{
undefined4 field_0x0; // vtgame pointer?
VTGAME *pvtgame;
int cAlarmsTriggered;
int fTimedChallenge;
float dtChallenge;
Expand Down Expand Up @@ -262,12 +262,12 @@ uint get_level_completion_by_id(int level_id);
/**
* @brief Tally the completion of a world.
*
* @param world_id World ID.
* @param qty_keys Result of the tally of keys.
* @param qty_vaults Result of the tally of vaults.
* @param qty_mts Result of the tally of Master Thief Sprints
* @param wid World ID.
* @param ckey Result of the tally of keys.
* @param cvault Result of the tally of vaults.
* @param cmts Result of the tally of Master Thief Sprints
*/
void tally_world_completion(int world_id, int *qty_keys, int *qty_vaults, int *qty_mts);
void tally_world_completion(int wid, int *ckey, int *cvault, int *cmts);

/**
* @brief Get the game completion flags based on the current game state.
Expand Down
14 changes: 12 additions & 2 deletions include/jt.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ enum JTBS
JTBS_Zap_Water = 36
};

/**
* JT cane state.
*
* @note Copied from May proto, may be outdated/out of order.
*/
enum JTCS
{
// ...
};

/**
* @brief Sly entity.
*
Expand Down Expand Up @@ -115,8 +125,8 @@ void SetJtJts(JT *pjt, JTS jts, JTBS jtbs);
*
* @deprecated
*/
void ProfileJt(JT* pjt, int fProfile);
void ProfileJt(JT *pjt, int fProfile);

extern JT* g_pjt;
extern JT *g_pjt;

#endif // JT_H
Loading

0 comments on commit 3cd25fa

Please sign in to comment.