Merge remote-tracking branch 'upstream/master' into 3d-objects

This commit is contained in:
coco875
2024-08-17 20:23:44 +02:00
339 changed files with 9935 additions and 13554 deletions
+1
View File
@@ -3,6 +3,7 @@
#include <PR/mbi.h>
#include <PR/ultratypes.h>
#include <common_structs.h>
#define GU_PI 3.1415926
/* Functions */
+3 -3
View File
@@ -36,7 +36,7 @@ extern "C" {
#endif
#include <PR/ultratypes.h>
#include "PR/os_message.h"
#include <PR/os_message.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
@@ -730,8 +730,8 @@ extern s32 osPfsNumFiles(OSPfs *, s32 *, s32 *);
extern s32 osEepromProbe(OSMesgQueue *);
extern s32 osEepromRead(OSMesgQueue *, u8, u8 *);
extern s32 osEepromWrite(OSMesgQueue *, u8, u8 *);
extern s32 osEepromLongRead(OSMesgQueue *, u8, u8 *, int);
extern s32 osEepromLongWrite(OSMesgQueue *, u8, u8 *, int);
extern s32 osEepromLongRead(OSMesgQueue *, u8, u8 *, s32);
extern s32 osEepromLongWrite(OSMesgQueue *, u8, u8 *, s32);
/* MOTOR interface */
+1 -1
View File
@@ -53,7 +53,7 @@ extern "C" {
typedef struct {
u16 type; /* Controller Type */
u8 status; /* Controller status */
u8 errno;
u8 errnum;
}OSContStatus;
typedef struct {
+5 -3
View File
@@ -5,8 +5,8 @@
#define NULL (void *)0
#endif
#define TRUE 1
#define FALSE 0
#define true 1
#define false 0
typedef signed char s8;
typedef unsigned char u8;
@@ -17,7 +17,8 @@ typedef unsigned int u32;
typedef signed long long int s64;
typedef unsigned long long int u64;
typedef signed int bool;
#define bool signed int
typedef signed char bool8;
typedef unsigned char ubool8;
@@ -37,6 +38,7 @@ typedef double f64;
typedef u32 size_t;
typedef s32 ssize_t;
typedef u32 uintptr_t;
typedef u8 uint8_t;
typedef s32 intptr_t;
typedef s32 ptrdiff_t;
#else
+2 -1
View File
@@ -1,7 +1,8 @@
#ifndef BOMB_KART_H
#define BOMB_KART_H
#include "common_structs.h"
#include <common_structs.h>
#include <mk64.h>
#define NUM_BOMB_KARTS_MAX 7
#define NUM_BOMB_KARTS_VERSUS 7
+131 -124
View File
@@ -1,7 +1,7 @@
#ifndef _COMMON_STRUCTS_H_
#define _COMMON_STRUCTS_H_
#include "ultra64.h"
#include <ultra64.h>
typedef f32 Vec3f[3];
typedef f32 Vec4f[4];
@@ -21,82 +21,6 @@ typedef struct
f32 x, y, z;
} Vec3fs;
#define COURSE_NULL 0xFF
typedef enum {
/* 0x00 */ COURSE_MARIO_RACEWAY = 0,
/* 0x01 */ COURSE_CHOCO_MOUNTAIN,
/* 0x02 */ COURSE_BOWSER_CASTLE,
/* 0x03 */ COURSE_BANSHEE_BOARDWALK,
/* 0x04 */ COURSE_YOSHI_VALLEY,
/* 0x05 */ COURSE_FRAPPE_SNOWLAND,
/* 0x06 */ COURSE_KOOPA_BEACH,
/* 0x07 */ COURSE_ROYAL_RACEWAY,
/* 0x08 */ COURSE_LUIGI_RACEWAY,
/* 0x09 */ COURSE_MOO_MOO_FARM,
/* 0x0A */ COURSE_TOADS_TURNPIKE,
/* 0x0B */ COURSE_KALAMARI_DESERT,
/* 0x0C */ COURSE_SHERBET_LAND,
/* 0x0D */ COURSE_RAINBOW_ROAD,
/* 0x0E */ COURSE_WARIO_STADIUM,
/* 0x0F */ COURSE_BLOCK_FORT,
/* 0x10 */ COURSE_SKYSCRAPER,
/* 0x11 */ COURSE_DOUBLE_DECK,
/* 0x12 */ COURSE_DK_JUNGLE,
/* 0x13 */ COURSE_BIG_DONUT,
/* 0x14 */ COURSE_AWARD_CEREMONY,
/* 0x15 */ NUM_COURSES
} COURSES;
typedef enum {
/* 0x00 */ TIME_TRIAL_DATA_LUIGI_RACEWAY,
/* 0x01 */ TIME_TRIAL_DATA_MOO_MOO_FARM,
/* 0x02 */ TIME_TRIAL_DATA_KOOPA_BEACH,
/* 0x03 */ TIME_TRIAL_DATA_KALAMARI_DESERT,
/* 0x04 */ TIME_TRIAL_DATA_TOADS_TURNPIKE,
/* 0x05 */ TIME_TRIAL_DATA_FRAPPE_SNOWLAND,
/* 0x06 */ TIME_TRIAL_DATA_CHOCO_MOUNTAIN,
/* 0x07 */ TIME_TRIAL_DATA_MARIO_RACEWAY,
/* 0x08 */ TIME_TRIAL_DATA_WARIO_STADIUM,
/* 0x09 */ TIME_TRIAL_DATA_SHERBET_LAND,
/* 0x0A */ TIME_TRIAL_DATA_ROYAL_RACEWAY,
/* 0x0B */ TIME_TRIAL_DATA_BOWSER_CASTLE,
/* 0x0C */ TIME_TRIAL_DATA_DK_JUNGLE,
/* 0x0D */ TIME_TRIAL_DATA_YOSHI_VALLEY,
/* 0x0E */ TIME_TRIAL_DATA_BANSHEE_BOARDWALK,
/* 0x0F */ TIME_TRIAL_DATA_RAINBOW_ROAD,
/* 0x10 */ NUM_TIME_TRIAL_DATA
} TIME_TRIAL_DATA_INDEX;
/**
* @brief The different types of surface in the game.
*/
enum SURFACE_TYPE {
/* -0x1 */ SURFACE_DEFAULT = -1,
/* 0x00 */ AIRBORNE,
/* 0x01 */ ASPHALT, // Luigi's Raceway, Toad's Turnpike, Koopa Troop beach shortcut tunnel, Mario Raceway, Royal Raceway, Rainbow Road, Block Fort, Double Deck, Skyscraper
/* 0x02 */ DIRT, // Luigi's Raceway, Moo Moo Farm, Kalimiari Desert on course, Choco Mountain, Wario Stadium, DK Jungle on course, Yoshi Valley
/* 0x03 */ SAND, // Koopa Troopa Beach light color, Royal Raceway
/* 0x04 */ STONE, // Royal Raceway castle entrance, Bowser's Castle
/* 0x05 */ SNOW, // Frappe Snowland on course, Sherber Land tunnel
/* 0x06 */ BRIDGE, // Royal Raceway castle bridges (even the wooden one), Banshee's Boardwalk, Big Donut
/* 0x07 */ SAND_OFFROAD, // Mario Raceway
/* 0x08 */ GRASS, // Luigi's Raceway, Mario Raceway, Royal Raceway, Bowser's Castle, DK Jungle, Yoshi Valley
/* 0x09 */ ICE, // Sherbert Land
/* 0x0A */ WET_SAND, // Koop Troopa Beach dark color
/* 0x0B */ SNOW_OFFROAD, // Frappe Snowland off course
/* 0x0C */ CLIFF, // Koopa Troopa Beach, Choco Mountain
/* 0x0D */ DIRT_OFFROAD, // Kalimari Desert off course
/* 0x0E */ TRAIN_TRACK, // Kalimari Desert
/* 0x0F */ CAVE, // DK Jungle cave
/* 0x10 */ ROPE_BRIDGE, // Bowser's Castle bridge 2, DK Jungle bridge
/* 0x11 */ WOOD_BRIDGE, // Frappe Snowland bridge, Bowser's Castle bridge 1,3, Yoshi Valley bridge 2
/* 0xFC */ BOOST_RAMP_WOOD = 0xFC, // DK Jungle
/* 0xFD */ OUT_OF_BOUNDS, // DK Jungle river island
/* 0xFE */ BOOST_RAMP_ASPHALT, // Royal Raceway
/* 0xFF */ RAMP // Koopa Troopa beach
};
// This was added as a silly idea:
// In the data to use "A, B, Z, R" instead of hex numbers.
typedef enum {
@@ -106,6 +30,103 @@ typedef enum {
R = 0x10
} GhostController;
/*** types.h ***/
typedef struct {
/* 0x0 */ s16 waypointStart;
/* 0x2 */ s16 waypointEnd;
/* 0x4 */ s32 type;
} KartAIBehaviour; // size = 0x8
enum SpTaskState {
SPTASK_STATE_NOT_STARTED,
SPTASK_STATE_RUNNING,
SPTASK_STATE_INTERRUPTED,
SPTASK_STATE_FINISHED,
SPTASK_STATE_FINISHED_DP
};
struct SPTask
{
/*0x00*/ OSTask task;
/*0x40*/ OSMesgQueue *msgqueue;
/*0x44*/ OSMesg msg;
/*0x48*/ enum SpTaskState state;
}; // size = 0x4C, align = 0x8
struct VblankHandler
{
OSMesgQueue *queue;
OSMesg msg;
};
struct D_80150158 {
s16 unk0;
s32 unk4;
s32 unk8;
s32 unkC;
};
struct Controller {
s16 rawStickX;
s16 rawStickY;
u16 button; // HeldButton
u16 buttonPressed; // OnTriggered
u16 buttonDepressed; // OffTriggered
u16 stickDirection;
u16 stickPressed; // OffTriggered
u16 stickDepressed; // OnTriggered
};
// Camera path struct? Or something like that. For GP race won scene?
struct UnkStruct_80287500 {
Vec3f unk0; // xyz coordinates?
f32 unkC;
f32 unk10;
f32 unk14; // rotation?
s32 unk18;
s32 unk1C;
f32 unk20;
f32 unk24;
f32 unk28;
f32 unk2C;
f32 unk30;
f32 unk34;
s32 unk38;
};
struct UnkStruct_800DDB40 {
u32 unk0;
u32 unk4;
u32 unk8;
u32 unkC;
u32 unk10;
u32 unk14;
u32 unk18;
u32 unk1C;
u32 unk20;
u16 unk24;
u16 unk26;
};
struct UnkStruct_802B53C8 {
f32 unk0;
f32 unk4;
f32 unk8;
f32 unkC;
};
// end math util structs
struct UnkStruct_800DDB68 {
s32 *D_800ED600; s32 *D_800ED608; s32 *D_800ED610; s32 *D_800ED618;
s32 *D_800ED620; s32 *D_800ED628; s32 *D_800ED630; s32 *D_800ED638;
};
/*** Types.h end ***/
typedef struct {
u8 button;
s8 frameDuration;
@@ -118,11 +139,11 @@ typedef struct {
/* 0x00 */ u16 unk30;
/* 0x02 */ u16 unk32;
/* 0x04 */ u16 unk34;
/* 0x06 */ u16 unk36;
/* 0x08 */ u16 unk38;
/* 0x06 */ u16 meshIndexYX;
/* 0x08 */ u16 meshIndexZY;
// This may be an index to the tilemap?
/* 0x0A */ u16 unk3A;
/* 0x0C */ Vec3f unk3C;
/* 0x0A */ u16 meshIndexZX;
/* 0x0C */ Vec3f surfaceDistance; // Appears to be distance from actor to surface for zx, yx, and zy planes.
/* 0x18 */ Vec3f unk48;
/* 0x24 */ Vec3f unk54;
/* 0x30 */ Vec3f orientationVector;
@@ -164,7 +185,6 @@ typedef struct {
s16 ob[3]; /* x, y, z */
s16 tc[2]; /* texture coord */
s8 ca[4]; /* color & alpha */
} CourseVtx;
/*
@@ -182,53 +202,40 @@ typedef struct {
//bit 4: 1 = out of bounds
//bit 3: 1 = player tumbles upon contact (may fall right through)
/* 0x02 */ u16 surfaceType;
/* 0x04 */ s16 vtx31;
s16 vtx32;
s16 vtx33; //X, Y, Z of poly's third vertex
s16 vtx21;
s16 vtx22;
/* 0x0A */ s16 vtx23; //X, Y, Z of poly's second vertex
/* 0x10 */ Vtx *vtxPoly1; //pointer to the 3 vertices of this poly
Vtx *vtxPoly2;
Vtx *vtxPoly3;
//unsure why this exists along with a copy of two of the vertices.
//both are involved in hit detection.
/* 0x1C */ f32 height;
//normally 0; read at 0x802AB1A4. this value is added to the height Lakitu
//drops you at. changing it seems to make the surface intangible.
/* 0x20 */ f32 gravity;
//normally 1. The height Lakitu drops you off at is divided by this value
//(before adding the value at 0x1C), although if set to zero, he just tries
//to drop you at about the height of the finish line banner. Changing it
//has various unusual effects, making the polygon intangible or
//significantly reducing the gravity above it, probably depending on its Y
//position.
/* 0x24 */ f32 rotation; //normally about -0.001. no idea what this actually is.
/* 0x28 */ f32 height2; //changes Y position of all vertices (but not graphics or
//Lakitu drop position). Normally set to (track_height * -1) + about 6.
} mk64_surface_map_ram; // size = 0x2C
// For AABB bounding-box style collision. Box style collision is cheaper than checking each vtx.
/* 0x04 */ s16 minX; // Minimum x coordinate
s16 minY; // Minimum y coordinate
s16 minZ; // Minimum z coordinate
s16 maxX; // Maximum x coordinate
s16 maxY; // Maximum y coordinate
/* 0x0A */ s16 maxZ; // Maximum z coordinate
/* 0x10 */ Vtx *vtx1; //pointer to the 3 vertices of this poly
Vtx *vtx2;
Vtx *vtx3;
// Face normal. Should really be Vec3f normal
/* 0x1C */ f32 normalX;
/* 0x20 */ f32 normalY;
/* 0x24 */ f32 normalZ;
/* 0x28 */ f32 distance;
} CollisionTriangle; // size = 0x2C
typedef struct {
/* 0x00 */ Vec3f cornerPos;
// Type of surface the corner is above
/* 0x0C */ u8 surfaceType;
// Close to being a copy of the top byte of the surface_map "flag" member
/* 0x00 */ Vec3f pos;
/* 0x0C */ u8 surfaceType; // Surface type that the tyre is touching.
/* 0x0D */ u8 surfaceFlags;
// Don't know if "tile" is right the right term
// gSurfaceMap is a pointer to an array of "tile" structs. This is an index to that array
/* 0x0E */ u16 surfaceMapIndex;
// cornerPos places the corner "in the air" as it were, this member indicates the Y position of the corner's "on the ground" sibling
// On flat ground this value should be cornerY - gKartBoundingBoxTable[characterId]
/* 0x10 */ f32 cornerGroundY;
/* 0x0E */ u16 collisionMeshIndex; // Index into gCollisionMesh
// Height of tyre attached to ground. When flying it floats with the kart.
/* 0x10 */ f32 baseHeight;
// Something lighting related. 1 when in a shaded region, 2 when in a tree's shadow
// 3 when getting crushed by a whomp, but curiously only the front left tyre will ever have this value
/* 0x14 */ s32 unk_14;
} KartBoundingBoxCorner; // size = 0x18
} KartTyre; // size = 0x18
#define FRONT_LEFT_TYRE 0
#define FRONT_RIGHT_TYRE 1
#define BACK_LEFT_TYRE 2
#define BACK_RIGHT_TYRE 3
#define FRONT_LEFT 0
#define FRONT_RIGHT 1
#define BACK_LEFT 2
#define BACK_RIGHT 3
struct UnkPlayerInner {
/* 0xDB4 */ s16 unk0;
@@ -322,10 +329,10 @@ typedef struct {
/* 0x0108 */ f32 unk_108;
/* 0x010C */ s16 unk_10C;
/* 0x010E */ char unk_10E[0x2];
/* 0x0110 */ Collision unk_110;
/* 0x0110 */ Collision collision;
/* 0x0150 */ Mat3 unk_150;
/* 0x0174 */ Mat3 orientationMatrix;
/* 0x0198 */ KartBoundingBoxCorner boundingBoxCorners[4];
/* 0x0198 */ KartTyre tyres[4];
/* 0x01F8 */ f32 unk_1F8;
/* 0x01FC */ f32 unk_1FC;
/* 0x0200 */ u32 unk_200; // May be s32. but less casting required if u32
-18
View File
@@ -1,18 +0,0 @@
#ifndef CONFIG_H
#define CONFIG_H
/**
* @file config.h
* A catch-all file for configuring various bugfixes and other settings in MK64
*/
// Screen Size Defines
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
#define STACKSIZE 0x2000
// Border Height Define for NTSC Versions
#define BORDER_HEIGHT 1
#endif
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef _FUNCTIONS_H_
#define _FUNCTIONS_H_
#include "common_structs.h"
#include <common_structs.h>
void mio0decode(u8* arg0, u8* arg1);
+36 -8
View File
@@ -38,8 +38,14 @@
* D-pad DOWN = MARIO
*
*/
#define DEBUG_MODE 0
#define DEBUG_MENU 1
#if defined(GCC) || defined(DEBUG)
#define DEBUG_MODE 1
#define DEBUG_MENU 2
#else
#define DEBUG_MODE 0
#define DEBUG_MENU 1
#endif
#define HOLD_ALL_DPAD_AND_C_BUTTONS (U_JPAD | L_JPAD | R_JPAD | D_JPAD | U_CBUTTONS | L_CBUTTONS | R_CBUTTONS | D_CBUTTONS)
/**
@@ -70,8 +76,10 @@
#ifdef VERSION_EU
#define COURSE_TIMER_ITER 0.020041665999999999 // 1 / 50
#define COURSE_TIMER_ITER_f 0.020041665999999999f // 1 / 50
#else
#define COURSE_TIMER_ITER 0.01666666 // 1 / 60
#define COURSE_TIMER_ITER_f 0.01666666f // 1 / 60
#endif
#define V_BlANK_TIMER_ITER 0.01666666
@@ -103,10 +111,17 @@
#define FOUR_PLAYERS_SELECTED 4
#define SELECTED_PLAYER_DEFINES_TOTAL 5
#define PLAYER_ONE 0
#define PLAYER_TWO 1
#define PLAYER_THREE 2
#define PLAYER_FOUR 3
enum PlayerId {
PLAYER_NONE = -1,
PLAYER_ONE = 0,
PLAYER_TWO = 1,
PLAYER_THREE = 2,
PLAYER_FOUR = 3,
PLAYER_FIVE = 4,
PLAYER_SIX = 5,
PLAYER_SEVEN = 6,
PLAYER_EIGHT = 7
};
#define NUM_PLAYERS 8
@@ -290,7 +305,7 @@
/**
* @brief Item IDs
*/
typedef enum ITEMS {
enum ITEMS {
/* 0x00 */ ITEM_NONE = 0,
/* 0x01 */ ITEM_BANANA,
/* 0x02 */ ITEM_BANANA_BUNCH,
@@ -309,7 +324,7 @@ typedef enum ITEMS {
/* 0x0F */ ITEM_SUPER_MUSHROOM
};
typedef enum KART_AI_BEHAVIOURS {
enum KART_AI_BEHAVIOURS {
BEHAVIOUR_NONE = 0,
BEHAVIOUR_1,
BEHAVIOUR_HOP,
@@ -385,3 +400,16 @@ enum DIRECTION {
#define COLOR_BLACK GPACK_RGB888(0, 0, 0)
#endif // DEFINES_H
/**
*
* Collision mesh flags
*
*/
#define GRID_SIZE 32
#define FACING_Y_AXIS 0x4000
#define FACING_X_AXIS 0x8000
#define FACING_Z_AXIS 0x2000
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef STDDEF_H
#define STDDEF_H
#include "PR/ultratypes.h"
#include <PR/ultratypes.h>
#ifndef offsetof
#define offsetof(st, m) ((size_t)&(((st *)0)->m))
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef STRING_H
#define STRING_H
#include "PR/ultratypes.h"
#include <PR/ultratypes.h>
void *memcpy(void *dst, const void *src, size_t size);
size_t strlen(const char *str);
+1 -1
View File
@@ -87,6 +87,6 @@
* - sizeof(dl[0]) : walk back 1 Gfx macro
* - 0x07000000 : get just the offset
**/
#define GET_PACKED_END(dl) (((u8*) dl) + sizeof(dl) - sizeof(dl[0]) - 0x07000000)
#define GET_PACKED_END(dl) (((u8 *) dl) + sizeof(dl) - sizeof(dl[0]) - 0x07000000)
#endif
+93 -3
View File
@@ -1,10 +1,98 @@
#ifndef MK64_H
#define MK64_H
// Global header for Mario Kart 64
/**
* @file mk64.h
* Global header for mk64
*/
#include <types.h>
#include "config.h"
/*=======================
Configuration
=======================*/
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
#define STACKSIZE 0x2000
// Border Height Define for NTSC Versions
#define BORDER_HEIGHT 1
typedef enum {
/* 0x00 */ COURSE_MARIO_RACEWAY = 0,
/* 0x01 */ COURSE_CHOCO_MOUNTAIN,
/* 0x02 */ COURSE_BOWSER_CASTLE,
/* 0x03 */ COURSE_BANSHEE_BOARDWALK,
/* 0x04 */ COURSE_YOSHI_VALLEY,
/* 0x05 */ COURSE_FRAPPE_SNOWLAND,
/* 0x06 */ COURSE_KOOPA_BEACH,
/* 0x07 */ COURSE_ROYAL_RACEWAY,
/* 0x08 */ COURSE_LUIGI_RACEWAY,
/* 0x09 */ COURSE_MOO_MOO_FARM,
/* 0x0A */ COURSE_TOADS_TURNPIKE,
/* 0x0B */ COURSE_KALAMARI_DESERT,
/* 0x0C */ COURSE_SHERBET_LAND,
/* 0x0D */ COURSE_RAINBOW_ROAD,
/* 0x0E */ COURSE_WARIO_STADIUM,
/* 0x0F */ COURSE_BLOCK_FORT,
/* 0x10 */ COURSE_SKYSCRAPER,
/* 0x11 */ COURSE_DOUBLE_DECK,
/* 0x12 */ COURSE_DK_JUNGLE,
/* 0x13 */ COURSE_BIG_DONUT,
/* 0x14 */ COURSE_AWARD_CEREMONY,
/* 0x15 */ NUM_COURSES
} COURSES;
#define COURSE_NULL 0xFF
typedef enum {
/* 0x00 */ TIME_TRIAL_DATA_LUIGI_RACEWAY,
/* 0x01 */ TIME_TRIAL_DATA_MOO_MOO_FARM,
/* 0x02 */ TIME_TRIAL_DATA_KOOPA_BEACH,
/* 0x03 */ TIME_TRIAL_DATA_KALAMARI_DESERT,
/* 0x04 */ TIME_TRIAL_DATA_TOADS_TURNPIKE,
/* 0x05 */ TIME_TRIAL_DATA_FRAPPE_SNOWLAND,
/* 0x06 */ TIME_TRIAL_DATA_CHOCO_MOUNTAIN,
/* 0x07 */ TIME_TRIAL_DATA_MARIO_RACEWAY,
/* 0x08 */ TIME_TRIAL_DATA_WARIO_STADIUM,
/* 0x09 */ TIME_TRIAL_DATA_SHERBET_LAND,
/* 0x0A */ TIME_TRIAL_DATA_ROYAL_RACEWAY,
/* 0x0B */ TIME_TRIAL_DATA_BOWSER_CASTLE,
/* 0x0C */ TIME_TRIAL_DATA_DK_JUNGLE,
/* 0x0D */ TIME_TRIAL_DATA_YOSHI_VALLEY,
/* 0x0E */ TIME_TRIAL_DATA_BANSHEE_BOARDWALK,
/* 0x0F */ TIME_TRIAL_DATA_RAINBOW_ROAD,
/* 0x10 */ NUM_TIME_TRIAL_DATA
} TIME_TRIAL_DATA_INDEX;
/**
* @brief The different types of surface in the game.
*/
enum SURFACE_TYPE {
/* -0x1 */ SURFACE_DEFAULT = -1,
/* 0x00 */ AIRBORNE,
/* 0x01 */ ASPHALT, // Luigi's Raceway, Toad's Turnpike, Koopa Troop beach shortcut tunnel, Mario Raceway, Royal Raceway, Rainbow Road, Block Fort, Double Deck, Skyscraper
/* 0x02 */ DIRT, // Luigi's Raceway, Moo Moo Farm, Kalimiari Desert on course, Choco Mountain, Wario Stadium, DK Jungle on course, Yoshi Valley
/* 0x03 */ SAND, // Koopa Troopa Beach light color, Royal Raceway
/* 0x04 */ STONE, // Royal Raceway castle entrance, Bowser's Castle
/* 0x05 */ SNOW, // Frappe Snowland on course, Sherber Land tunnel
/* 0x06 */ BRIDGE, // Royal Raceway castle bridges (even the wooden one), Banshee's Boardwalk, Big Donut
/* 0x07 */ SAND_OFFROAD, // Mario Raceway
/* 0x08 */ GRASS, // Luigi's Raceway, Mario Raceway, Royal Raceway, Bowser's Castle, DK Jungle, Yoshi Valley
/* 0x09 */ ICE, // Sherbert Land
/* 0x0A */ WET_SAND, // Koop Troopa Beach dark color
/* 0x0B */ SNOW_OFFROAD, // Frappe Snowland off course
/* 0x0C */ CLIFF, // Koopa Troopa Beach, Choco Mountain
/* 0x0D */ DIRT_OFFROAD, // Kalimari Desert off course
/* 0x0E */ TRAIN_TRACK, // Kalimari Desert
/* 0x0F */ CAVE, // DK Jungle cave
/* 0x10 */ ROPE_BRIDGE, // Bowser's Castle bridge 2, DK Jungle bridge
/* 0x11 */ WOOD_BRIDGE, // Frappe Snowland bridge, Bowser's Castle bridge 1,3, Yoshi Valley bridge 2
/* 0xFC */ BOOST_RAMP_WOOD = 0xFC, // DK Jungle
/* 0xFD */ OUT_OF_BOUNDS, // DK Jungle river island
/* 0xFE */ BOOST_RAMP_ASPHALT, // Royal Raceway
/* 0xFF */ RAMP // Koopa Troopa beach
};
#define GFX_GET_OPCODE(var) ((s32)((var) & 0xFF000000))
@@ -26,4 +114,6 @@
#define SET_HIGH_S16_OF_32(var, x) ((((s16 *)&(var))[0]) = (x))
#endif
#define MACRO_COLOR_FLAG(r, g, b, flag) (r&~0x3) | (flag & 0x3), (g&~0x3) | ((flag>>2) & 0x3), b
#endif // MK64_H
+4 -4
View File
@@ -2,7 +2,7 @@
#define OBJECTS_H
#include "spline.h"
#include "common_structs.h"
#include <common_structs.h>
#define OBJECT_LIST_SIZE 0x226
#define SOME_OBJECT_INDEX_LIST_SIZE 32
@@ -16,7 +16,7 @@ typedef struct
/* 0x28 */ Vec3f offset;
/* 0x34 */ f32 unk_034;
/* 0x38 */ Vec3f velocity; // acceleration
/* 0x44 */ f32 unk_044;
/* 0x44 */ f32 surfaceHeight;
/* 0x48 */ s32 unk_048;
/* 0x4C */ s32 unk_04C;
/* 0x50 */ s32 unk_050;
@@ -79,9 +79,9 @@ typedef struct
/* 0xDD */ u8 unk_0DD;
/* 0xDE */ s8 unk_0DE;
/* 0xDF */ u8 unk_0DF;
} Objects; // size = 0xE0
} Object; // size = 0xE0
extern Objects gObjectList[];
extern Object gObjectList[];
typedef struct
{
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef SAVE_DATA_H
#define SAVE_DATA_H
#include "common_structs.h"
#include <common_structs.h>
typedef struct {
// 6 little endian 3-byte records.
@@ -65,4 +65,4 @@ typedef struct {
extern SaveData gSaveData;
#endif
#endif
+11 -38
View File
@@ -1,7 +1,7 @@
#ifndef SPLINE_H
#define SPLINE_H
#include "common_structs.h"
#include <common_structs.h>
/*
These are some very good videos about splines/Bezier curves in general
@@ -33,7 +33,7 @@ typedef struct {
// The control point arrays have more control points in them than this number indicates. Not sure why though.
s16 numControlPoints;
// This has to be an array for this to work, so just make it size 1
SplineControlPoint controlPoints[1];
SplineControlPoint controlPoints[];
} SplineData;
// All other SplineDataXX types are for use as data only. The size of the array in them matters a lot.
@@ -42,60 +42,33 @@ typedef struct {
// Ghosts in BansheeBoardwalk x 2
// Seagulls in KoopaTroopaBeach x 2
// Penguins in Sherbet Land x 1
typedef struct {
s16 numControlPoints;
SplineControlPoint controlPoints[23];
} SplineData23;
// length of 23
// Ghosts in BansheeBoardwalk x 2
// Seagulls in KoopaTroopaBeach x 1
typedef struct {
s16 numControlPoints;
SplineControlPoint controlPoints[24];
} SplineData24;
// length of 24
// Ghosts in BansheeBoardwalk x 1
// Seagulls in KoopaTroopaBeach x 1
// Penguins in Sherbet Land x 1
typedef struct {
s16 numControlPoints;
SplineControlPoint controlPoints[25];
} SplineData25;
// length of 25
// Data of this type is unreferenced or only referenced in an unused function
typedef struct {
s16 numControlPoints;
SplineControlPoint controlPoints[4];
} SplineDataUnused4;
// lenght of 4
// Lakitu Countdown
typedef struct {
s16 numControlPoints;
SplineControlPoint controlPoints[15];
} SplineData15;
// length of 15
// Lakitu Checkered Flag
typedef struct {
s16 numControlPoints;
SplineControlPoint controlPoints[21];
} SplineData21;
// length of 21
typedef struct {
s16 numControlPoints;
SplineControlPoint controlPoints[13];
} SplineDataUnused13;
// length of 13
// Lakitu Second/Final Lap
typedef struct {
s16 numControlPoints;
SplineControlPoint controlPoints[12];
} SplineData12;
// length of 12
// Lakitu Reverse
typedef struct {
s16 numControlPoints;
SplineControlPoint controlPoints[8];
} SplineData8;
// length of 8
#endif
-118
View File
@@ -1,118 +0,0 @@
#ifndef TYPES_H
#define TYPES_H
#include <ultra64.h>
#include <common_structs.h>
#include "camera.h"
typedef struct {
/* 0x0 */ s16 waypointStart;
/* 0x2 */ s16 waypointEnd;
/* 0x4 */ s32 type;
} KartAIBehaviour; // size = 0x8
enum SpTaskState {
SPTASK_STATE_NOT_STARTED,
SPTASK_STATE_RUNNING,
SPTASK_STATE_INTERRUPTED,
SPTASK_STATE_FINISHED,
SPTASK_STATE_FINISHED_DP
};
struct SPTask
{
/*0x00*/ OSTask task;
/*0x40*/ OSMesgQueue *msgqueue;
/*0x44*/ OSMesg msg;
/*0x48*/ enum SpTaskState state;
}; // size = 0x4C, align = 0x8
struct VblankHandler
{
OSMesgQueue *queue;
OSMesg msg;
};
struct D_80150158 {
s16 unk0;
s32 unk4;
s32 unk8;
s32 unkC;
};
struct Controller {
s16 rawStickX;
s16 rawStickY;
u16 button; // HeldButton
u16 buttonPressed; // OnTriggered
u16 buttonDepressed; // OffTriggered
u16 stickDirection;
u16 stickPressed; // OffTriggered
u16 stickDepressed; // OnTriggered
};
struct UnkStruct_800DC5EC {
/* 0x00 */ struct Controller *controllers; // gControllers ptr 800F6910
/* 0x04 */ Camera *camera; // Player camera ptr
/* 0x08 */ Player *player; // Player ptr 800F6990
/* 0x0C */ s32 *unkC; // unk struct?
/* 0x10 */ Vp viewport;
/* 0x20 */ s32 pad[2];
/* 0x28 */ s16 cameraHeight;
/* 0x2A */ s16 unk;
/* 0x2C */ s16 screenWidth;
/* 0x2E */ s16 screenHeight;
/* 0x30 */ s16 screenStartX;
/* 0x32 */ s16 screenStartY;
/* 0x34 */ s16 unk3C;
/* 0x36 */ s16 playerDirection;
/* 0x38 */ s16 pathCounter;
/* 0x3A */ s16 unk42;
/* 0x3C */ s32 pad2;
}; // size = 0x40
// Camera path struct? Or something like that. For GP race won scene?
struct UnkStruct_80287500 {
Vec3f unk0; // xyz coordinates?
f32 unkC;
f32 unk10;
f32 unk14; // rotation?
s32 unk18;
s32 unk1C;
f32 unk20;
f32 unk24;
f32 unk28;
f32 unk2C;
f32 unk30;
f32 unk34;
s32 unk38;
};
struct UnkStruct_800DDB40 {
u32 unk0;
u32 unk4;
u32 unk8;
u32 unkC;
u32 unk10;
u32 unk14;
u32 unk18;
u32 unk1C;
u32 unk20;
u16 unk24;
u16 unk26;
};
struct UnkStruct_802B53C8 {
f32 unk0;
f32 unk4;
f32 unk8;
f32 unkC;
};
// end math util structs
struct UnkStruct_800DDB68 {
s32 *D_800ED600; s32 *D_800ED608; s32 *D_800ED610; s32 *D_800ED618;
s32 *D_800ED620; s32 *D_800ED628; s32 *D_800ED630; s32 *D_800ED638;
};
#endif /* TYPES_H */
+12 -1
View File
@@ -1,7 +1,7 @@
#ifndef VEHICLES_H
#define VEHICLES_H
#include "common_structs.h"
#include <common_structs.h>
#define NUM_1P_PASSENGER_CARS 4
#define NUM_2P_PASSENGER_CARS 1
@@ -10,6 +10,11 @@
#define NUM_TRAINS 2
#define LOCOMOTIVE_ONLY 0
#define NUM_CROSSINGS 2
// This allows karts to jump the train despite the crossing being activated.
// but still stop for the train once it's close
#define FRAMES_SINCE_CROSSING_ACTIVATED 240
// It seems like there's room for 2 Ferries, but only 1 is ever active
#define NUM_ACTIVE_PADDLE_BOATS 1
#define NUM_PADDLE_BOATS 2
@@ -24,6 +29,12 @@
#define NUM_TIME_TRIAL_TANKER_TRUCKS (NUM_RACE_TANKER_TRUCKS + 1)
#define NUM_TIME_TRIAL_CARS (NUM_RACE_CARS + 1)
#define TRAIN_SMOKE_RENDER_DISTANCE 2000.0f
#define TRAIN_CROSSING_AI_DISTANCE 1000.0f
#define BOAT_SMOKE_RENDER_DISTANCE 2000.0f
#define RENDER_VEHICLE 1
typedef struct {
/* 0x00 */ s16 isActive; // Only used for Tender and Passenger Cars, unused for Locomotives
/* 0x02 */ s16 compilerPadding;
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef WAYPOINTS_H
#define WAYPOINTS_H
#include "common_structs.h"
#include <common_structs.h>
typedef struct {
/* 0x00 */ s16 posX;
@@ -38,7 +38,7 @@ extern s16 *D_801645A0[];
* a given player is on, the specific value may change
**/
// Shadows values from gNearestWaypointByPlayerId
extern s16 D_80162FCE;
extern s16 sSomeNearestWaypoint;
// Shadows values from gPathIndexByPlayerId
extern s32 D_80163448;
// Shadows values from D_80164560