Mario Kart 64
Loading...
Searching...
No Matches
vehicles.h
Go to the documentation of this file.
1#ifndef VEHICLES_H
2#define VEHICLES_H
3
4#include <common_structs.h>
5
6#define NUM_1P_PASSENGER_CARS 4
7#define NUM_2P_PASSENGER_CARS 1
8#define NUM_PASSENGER_CAR_ENTRIES 5 // Max 16
9#define NUM_TENDERS 1
10#define NUM_TRAINS 2
11#define LOCOMOTIVE_ONLY 0
12
13#define NUM_CROSSINGS 2
14// This allows karts to jump the train despite the crossing being activated.
15// but still stop for the train once it's close
16#define FRAMES_SINCE_CROSSING_ACTIVATED 240
17
18// It seems like there's room for 2 Ferries, but only 1 is ever active
19#define NUM_ACTIVE_PADDLE_BOATS 1
20#define NUM_PADDLE_BOATS 2
21
22#define NUM_RACE_BOX_TRUCKS 7
23#define NUM_RACE_SCHOOL_BUSES 7
24#define NUM_RACE_TANKER_TRUCKS 7
25#define NUM_RACE_CARS 7
26
27#define NUM_TIME_TRIAL_BOX_TRUCKS (NUM_RACE_BOX_TRUCKS + 1)
28#define NUM_TIME_TRIAL_SCHOOL_BUSES (NUM_RACE_SCHOOL_BUSES + 1)
29#define NUM_TIME_TRIAL_TANKER_TRUCKS (NUM_RACE_TANKER_TRUCKS + 1)
30#define NUM_TIME_TRIAL_CARS (NUM_RACE_CARS + 1)
31
32#define TRAIN_SMOKE_RENDER_DISTANCE 2000.0f
33#define TRAIN_CROSSING_AI_DISTANCE 1000.0f
34#define BOAT_SMOKE_RENDER_DISTANCE 2000.0f
35
36#define RENDER_VEHICLE 1
37
38typedef struct {
39 /* 0x00 */ s16 isActive; // Only used for Tender and Passenger Cars, unused for Locomotives
40 /* 0x02 */ s16 compilerPadding;
41 /* 0x04 */ Vec3f position;
42 /* 0x10 */ Vec3f velocity;
43 /* 0x1C */ u16 waypointIndex;
44 /* 0x1E */ s16 actorIndex;
45 /* 0x20 */ s32 unused; // Not read or written. Could be padding?
46} TrainCarStuff; // size = 0x24;
47
48typedef struct {
50 /* 0x024 */ TrainCarStuff tender;
51 /* 0x048 */ TrainCarStuff passengerCars[NUM_PASSENGER_CAR_ENTRIES];
52 /* 0x0FC */ f32 speed;
53 /* 0x100 */ s32 someFlags;
54 /* 0x104 */ s32 numCars; // Non-locomotive car count?
55 /* 0x108 */ s32 unused; // Not read or written. Could be padding?
56} TrainStuff; // size = 0x10C
57
58typedef struct {
59 /* 0x00 */ s16 isActive; // The paddle wheel boat only shows up if the number of players is < 3
60 /* 0x02 */ // s16 compilerPadding;
61 /* 0x04 */ Vec3f position; //
62 /* 0x10 */ Vec3f velocity; //
63 /* 0x1C */ u16 waypointIndex; //
64 /* 0x1E */ s16 actorIndex; //
65 /* 0x20 */ f32 speed; //
66 /* 0x24 */ s16 rotY; // Only Y rotation is tracked in this struct
67 /* 0x26 */ // s16 compilerPadding2;
72 /* 0x28 */ s32 someFlags;
73} PaddleBoatStuff; // size = 0x2C
74
75typedef struct {
76 /* 0x00 */ s16 unused; // Gets set to 0, but doesn't seem to have any purpose
77 /* 0x02 */ // s16 compilerPadding;
78 /* 0x04 */ Vec3f position;
79 /* 0x10 */ Vec3f velocity;
80 /* 0x1C */ u16 waypointIndex;
81 /* 0x1E */ s16 actorIndex;
82 /* 0x20 */ f32 speed; //
84 /* 0x28 */ Vec3s rotation;
85 /* 0x2E */ s16 someType; //
91 /* 0x30 */ s8 someFlags; //
92 /* 0x31 */ s8 someFlagsTheSequel; //
93 /* 0x32 */ // s16 compilerPadding2;
94} VehicleStuff; // size = 0x34
95
96extern TrainStuff gTrainList[];
97
98// This is an array, maybe they intended to have multiple boats at some point in development?
100
101// Lists for different vehicles in Toad's Turnpike
105extern VehicleStuff gCarList[];
106
107#endif
f32 Vec3f[3]
Definition common_structs.h:6
s16 Vec3s[3]
Definition common_structs.h:11
Definition vehicles.h:58
s32 someFlags
Definition vehicles.h:72
Vec3f velocity
Definition vehicles.h:62
s16 isActive
Definition vehicles.h:59
f32 speed
Definition vehicles.h:65
s16 rotY
Definition vehicles.h:66
s16 actorIndex
Definition vehicles.h:64
Vec3f position
Definition vehicles.h:61
u16 waypointIndex
Definition vehicles.h:63
Definition vehicles.h:38
Vec3f position
Definition vehicles.h:41
Vec3f velocity
Definition vehicles.h:42
s16 actorIndex
Definition vehicles.h:44
s32 unused
Definition vehicles.h:45
s16 isActive
Definition vehicles.h:39
u16 waypointIndex
Definition vehicles.h:43
s16 compilerPadding
Definition vehicles.h:40
Definition vehicles.h:48
s32 someFlags
Definition vehicles.h:53
TrainCarStuff locomotive
Definition vehicles.h:49
f32 speed
Definition vehicles.h:52
s32 numCars
Definition vehicles.h:54
TrainCarStuff tender
Definition vehicles.h:50
s32 unused
Definition vehicles.h:55
Definition vehicles.h:75
s16 someType
Definition vehicles.h:85
Vec3f velocity
Definition vehicles.h:79
s16 unused
Definition vehicles.h:76
Vec3f position
Definition vehicles.h:78
Vec3s rotation
Definition vehicles.h:84
s16 actorIndex
Definition vehicles.h:81
s8 someFlags
Definition vehicles.h:91
f32 speed
Definition vehicles.h:82
u16 waypointIndex
Definition vehicles.h:80
f32 someMultiplierTheSequel
Definition vehicles.h:83
s8 someFlagsTheSequel
Definition vehicles.h:92
signed int s32
Definition ultratypes.h:15
signed char s8
Definition ultratypes.h:11
signed short int s16
Definition ultratypes.h:13
float f32
Definition ultratypes.h:34
unsigned short int u16
Definition ultratypes.h:14
VehicleStuff gSchoolBusList[]
Definition code_80005FD0.c:144
PaddleBoatStuff gPaddleBoats[]
Definition code_80005FD0.c:142
VehicleStuff gTankerTruckList[]
Definition code_80005FD0.c:145
VehicleStuff gCarList[]
Definition code_80005FD0.c:146
TrainStuff gTrainList[]
Definition code_80005FD0.c:139
VehicleStuff gBoxTruckList[]
Definition code_80005FD0.c:143
#define NUM_PASSENGER_CAR_ENTRIES
Definition vehicles.h:8