Skip to content

Commit

Permalink
common.h split
Browse files Browse the repository at this point in the history
  • Loading branch information
Niko committed Mar 25, 2023
1 parent b4da860 commit f41b3bc
Show file tree
Hide file tree
Showing 30 changed files with 11,097 additions and 11,063 deletions.
11,101 changes: 41 additions & 11,060 deletions psx-modding-toolchain/games/CrashTeamRacing/include/common.h

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions psx-modding-toolchain/games/CrashTeamRacing/include/gccHeaders.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <psn00bsdk/include/sys/types.h>
#include <psn00bsdk/include/psxetc.h>
#include <psn00bsdk/include/psxgte.h>
#include <psn00bsdk/include/psxgpu.h>
#include <psn00bsdk/include/psxspu.h>
#include <psn00bsdk/include/psxcd.h>
#include <psn00bsdk/include/psxapi.h>
#include <psn00bsdk/include/stdio.h>
#include <psn00bsdk/include/string.h>
#include <psn00bsdk/include/inline_c.h>

19 changes: 19 additions & 0 deletions psx-modding-toolchain/games/CrashTeamRacing/include/macros.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Version = MDD of release, all 1999
// For example, May 7 would be 507

#define AugReview 805
#define SepReview 903
#define UsaRetail 926
#define JpnTrial 1006
#define EurRetail 1020
#define JpnRetail 1111

#if BUILD == EurRetail
#define FPS 25
#define ELAPSED_MS 40
#else
#define FPS 30
#define ELAPSED_MS 32
#endif
#define SECOND (FPS * ELAPSED_MS)
#define MINUTE (SECOND * 60)
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
struct NavFrame
{
// 0
short pos[3];

// 6
short rotX;

// 8
short rotZ;

// 0xA
char data[0xA];
};

struct NavHeader
{
// 0
short magicNumber;
short numPoints;

// 4
int unk_off4;

// 8
struct NavFrame* last;

// 0xC
char data[0x40];

// 0x4C
struct NavFrame frame[1];
};
211 changes: 211 additions & 0 deletions psx-modding-toolchain/games/CrashTeamRacing/include/namespace_Camera.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
struct ZoomData
{
// get distance by mapping camera speeed from:
// [speedMin, speedMax] to [distMin, distMax]

// 0x0
short distMin;
short distMax;

// 0x4
short speedMin;
short speedMax;

// 0x8
unsigned char percentage1;
unsigned char percentage2;

// 0xA
short angle[3];

// 0x10
short vertDistance;
};

struct CameraDC
{
// 0x0
int cameraID;

// 0x4
// action,
// 0x20000 constantly swaps L2 zoom
int action;

// 0x08
// camera mode, zoom out and such
int mode;

// 0xC
int unk0xC;

// 0x10
// desired rotation
short desiredRot[4];

// 0x18
int unk0x18;

// 0x1c - ptrQuadBlock
// similar to driver +a0,
// quadblock camera is currently above
struct Quadblock* ptrQuadBlock;

// 0x20
// VisMem->0x40[player], quadblock->0x44->0x0
int* visLeafSrc;

// 0x24
// VisMem->0x50[player], quadblock->0x44->0x4
int* visFaceSrc;

// 0x28
// quadblock->0x44->0x8
// which instances are visible from quadblock
struct Instance** visInstSrc;

// 0x2c
// VisMem->0x60[player]
int* visOVertSrc;

// 0x30
// VisMem->0x70[player],
int* visSCVertSrc;

// 0x34
char unk30fill[0xC];

// 96b20+14c0

// 0x40
int cameraMoveSpeed;

// 0x44
struct Driver* driverToFollow;

// 0x48
struct TileView* tileView;

// 0x4C
int unkTriplet1[3];

// 0x58
int unkTriplet2[3];

// 0x64
int unkTriplet3[3];

// 0x70 - flags
// & 1 - search "+ 0x1508) | 1;", resets RainBuffer cameraPos
// & 4 - battle end-of-race
// & 8 - just changed direction (forward or backward) this frame
// & 0x10 - mask grab
// & 0x20 - arcade end-of-race
// & 0x100 - changes TrackPath from point->0x4 to point->0x9
// & 0x200 - (aku hints + save/load) transitioning away from player
// & 0x400 - (aku hints + save/load) snap to player, or transition to player if 0x600
// & 0x800 - (aku hints + save/load) stationary away from player
// & 0x8000 - frozen camera (disables thread, for character select)
// & 0x10000 - reverse camera
int flags;

// 0x74 (cam->0x9a is 8 or 0xe)
short driverOffset_CamEyePos[3];
short unk7A;

// 0x7c (cam->0x9a is 8 or 0xe)
short driverOffset_CamLookAtPos[3];
short unk82;

// 0x84
int driver5B0_prevFrame;

// 0x88 - used in CAM_FollowDriver_TrackPath
void* unk88;

// 0x8C - Interpolate from fly-in
// camera to driver, 0x0000 is fly-in,
// 0x1000 is driver, and between is interpolation
short unk8C;

// 0x8E - timer for fly-in camera
// animation at beginning of 1P Arcade,
// search "+ 0x1526" for more details
short unk8E;

// 0x90 - used in Spin360
short unk90;

// zoom variable
short unk92;

// 0x94
int unk94;

// 0x98
short unk98;

// 0x9a - semi-unused camera mode swap
short cameraMode; // Curr

// 0x9C
short cameraModePrev; // previous frame

// 0x9e - frame counter for transition
short frameCounterTransition;

// 0xa0
int unk_DC2;
// difference between 8e and 9e?

// 0xa4
struct
{
short pos[3];
short rot[3];
} transitionTo;

// 0xb0 - next byte
// 0xb0 - 2 byte short, speed of camera on track path
char unk_b0[8];

// X axis (0xb8)
char unk_b8[8];

// 0xb8 - ms countdown timer
// 0xbc - ms countdown timer

// Y axis (0xc0)
int unk_c0;

// 0xc0 - distance per frame

// 0xc2 - frameCountdown

// 0xc4
short framesZoomingOut;

// 0xc6
short unk_c6;

// 0xC8
#if BUILD >= UsaRetail
char data14[0x14];

// extra transition effect added

// This zooms in X and Z
// to get to player, then zooms
// Y in the end

// 0xd4 - distX per frame
// 0xd6 - distY per frame
// 0xd8 - distZ per frame
// 0xda - frameCountdown

// 0xdc - end of struct
#endif

// 0xC8 bytes large in sep3
// 0xDC bytes large in usaRetail
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
enum XA_TYPE
{
CDSYS_XA_TYPE_MUSIC,
CDSYS_XA_TYPE_EXTRA,
CDSYS_XA_TYPE_GAME,

#if BUILD <= SepReview
CDSYS_XA_TYPE_WARP,
#endif

CDSYS_XA_NUM_TYPES
};

struct XNF
{
// 0x0
int magic;

// 0x4
int version;

// 0x8
int numTypes;


// 0xC
int numXAs_total;

// 0x10
int numAudioTracks_total;


// 0x14
int numXA[CDSYS_XA_NUM_TYPES];

// 0x24
int firstXaIndex[CDSYS_XA_NUM_TYPES];

// 0x34
int numSongs[CDSYS_XA_NUM_TYPES];

// 0x44
int firstSongIndex[CDSYS_XA_NUM_TYPES];

// The number '1' is the
// total number of XA files
// all entries are 0002xxxx
// 0x54
int XaCdPos[1];
};

struct AudioMeta
{
// for inserting "Sxx.XA" string numbers
char stringIndex_char1;
char stringIndex_char2;

// filler
char junk1;
char junk2;

// \XA\MUSIC\S01.XA;1
// \XA\ENG\EXTRA\S05.XA;1
// \XA\ENG\GAME\S20.XA;1
char* name;

};
Loading

0 comments on commit f41b3bc

Please sign in to comment.