Mario Kart 64
Loading...
Searching...
No Matches
mk64.h
Go to the documentation of this file.
1#ifndef MK64_H
2#define MK64_H
3
9/*=======================
10 Configuration
11=======================*/
12
13#define AUDIO_HEAP_SIZE 0x48C00
14#define AUDIO_HEAP_INIT_SIZE 0x2600
15
16#define DOUBLE_SIZE_ON_64_BIT(size) ((size) * (sizeof(void*) / 4))
17
18#define SCREEN_WIDTH 320
19#define SCREEN_HEIGHT 240
20
21#define STACKSIZE 0x2000
22
23// Border Height Define for NTSC Versions
24#define BORDER_HEIGHT 1
25
50
51#define COURSE_NULL 0xFF
52
72
77 /* -0x1 */ SURFACE_DEFAULT = -1,
78 /* 0x00 */ AIRBORNE,
79 /* 0x01 */ ASPHALT, // Luigi's Raceway, Toad's Turnpike, Koopa Troop beach shortcut tunnel, Mario Raceway, Royal
80 // Raceway, Rainbow Road, Block Fort, Double Deck, Skyscraper
81 /* 0x02 */ DIRT, // Luigi's Raceway, Moo Moo Farm, Kalimiari Desert on course, Choco Mountain, Wario Stadium, DK
82 // Jungle on course, Yoshi Valley
83 /* 0x03 */ SAND, // Koopa Troopa Beach light color, Royal Raceway
84 /* 0x04 */ STONE, // Royal Raceway castle entrance, Bowser's Castle
85 /* 0x05 */ SNOW, // Frappe Snowland on course, Sherber Land tunnel
86 /* 0x06 */ BRIDGE, // Royal Raceway castle bridges (even the wooden one), Banshee's Boardwalk, Big Donut
87 /* 0x07 */ SAND_OFFROAD, // Mario Raceway
88 /* 0x08 */ GRASS, // Luigi's Raceway, Mario Raceway, Royal Raceway, Bowser's Castle, DK Jungle, Yoshi Valley
89 /* 0x09 */ ICE, // Sherbert Land
90 /* 0x0A */ WET_SAND, // Koop Troopa Beach dark color
91 /* 0x0B */ SNOW_OFFROAD, // Frappe Snowland off course
92 /* 0x0C */ CLIFF, // Koopa Troopa Beach, Choco Mountain
93 /* 0x0D */ DIRT_OFFROAD, // Kalimari Desert off course
94 /* 0x0E */ TRAIN_TRACK, // Kalimari Desert
95 /* 0x0F */ CAVE, // DK Jungle cave
96 /* 0x10 */ ROPE_BRIDGE, // Bowser's Castle bridge 2, DK Jungle bridge
97 /* 0x11 */ WOOD_BRIDGE, // Frappe Snowland bridge, Bowser's Castle bridge 1,3, Yoshi Valley bridge 2
98 /* 0xFC */ BOOST_RAMP_WOOD = 0xFC, // DK Jungle
99 /* 0xFD */ OUT_OF_BOUNDS, // DK Jungle river island
100 /* 0xFE */ BOOST_RAMP_ASPHALT, // Royal Raceway
101 /* 0xFF */ RAMP // Koopa Troopa beach
103
104#define GFX_GET_OPCODE(var) ((s32) ((var) & 0xFF000000))
105
106// Pointer casting is technically UB, and avoiding it gets rid of endian issues
107// as well as a nice side effect.
108#ifdef AVOID_UB
109#define GET_HIGH_U16_OF_32(var) ((u16) ((var) >> 16))
110#define GET_HIGH_S16_OF_32(var) ((s16) ((var) >> 16))
111#define GET_LOW_U16_OF_32(var) ((u16) ((var) & 0xFFFF))
112#define GET_LOW_S16_OF_32(var) ((s16) ((var) & 0xFFFF))
113#define SET_HIGH_U16_OF_32(var, x) ((var) = ((var) & 0xFFFF) | ((x) << 16))
114#define SET_HIGH_S16_OF_32(var, x) ((var) = ((var) & 0xFFFF) | ((x) << 16))
115#else
116#define GET_HIGH_U16_OF_32(var) (((u16*) &(var))[0])
117#define GET_HIGH_S16_OF_32(var) (((s16*) &(var))[0])
118#define GET_LOW_U16_OF_32(var) (((u16*) &(var))[1])
119#define GET_LOW_S16_OF_32(var) (((s16*) &(var))[1])
120#define SET_HIGH_U16_OF_32(var, x) ((((u16*) &(var))[0]) = (x))
121#define SET_HIGH_S16_OF_32(var, x) ((((s16*) &(var))[0]) = (x))
122#endif
123
124#define MACRO_COLOR_FLAG(r, g, b, flag) (r & ~0x3) | (flag & 0x3), (g & ~0x3) | ((flag >> 2) & 0x3), b
125
126#endif // MK64_H
SURFACE_TYPE
The different types of surface in the game.
Definition mk64.h:76
@ STONE
Definition mk64.h:84
@ RAMP
Definition mk64.h:101
@ WOOD_BRIDGE
Definition mk64.h:97
@ WET_SAND
Definition mk64.h:90
@ BRIDGE
Definition mk64.h:86
@ ICE
Definition mk64.h:89
@ ASPHALT
Definition mk64.h:79
@ ROPE_BRIDGE
Definition mk64.h:96
@ SAND_OFFROAD
Definition mk64.h:87
@ BOOST_RAMP_WOOD
Definition mk64.h:98
@ DIRT_OFFROAD
Definition mk64.h:93
@ CAVE
Definition mk64.h:95
@ SNOW
Definition mk64.h:85
@ SNOW_OFFROAD
Definition mk64.h:91
@ BOOST_RAMP_ASPHALT
Definition mk64.h:100
@ OUT_OF_BOUNDS
Definition mk64.h:99
@ SAND
Definition mk64.h:83
@ SURFACE_DEFAULT
Definition mk64.h:77
@ AIRBORNE
Definition mk64.h:78
@ TRAIN_TRACK
Definition mk64.h:94
@ CLIFF
Definition mk64.h:92
@ DIRT
Definition mk64.h:81
@ GRASS
Definition mk64.h:88
COURSES
Definition mk64.h:26
@ COURSE_WARIO_STADIUM
Definition mk64.h:41
@ COURSE_MARIO_RACEWAY
Definition mk64.h:27
@ COURSE_BANSHEE_BOARDWALK
Definition mk64.h:30
@ COURSE_KALAMARI_DESERT
Definition mk64.h:38
@ COURSE_BIG_DONUT
Definition mk64.h:46
@ COURSE_ROYAL_RACEWAY
Definition mk64.h:34
@ COURSE_BLOCK_FORT
Definition mk64.h:42
@ COURSE_FRAPPE_SNOWLAND
Definition mk64.h:32
@ COURSE_LUIGI_RACEWAY
Definition mk64.h:35
@ COURSE_RAINBOW_ROAD
Definition mk64.h:40
@ COURSE_YOSHI_VALLEY
Definition mk64.h:31
@ COURSE_CHOCO_MOUNTAIN
Definition mk64.h:28
@ COURSE_TOADS_TURNPIKE
Definition mk64.h:37
@ COURSE_SKYSCRAPER
Definition mk64.h:43
@ COURSE_DOUBLE_DECK
Definition mk64.h:44
@ COURSE_BOWSER_CASTLE
Definition mk64.h:29
@ COURSE_KOOPA_BEACH
Definition mk64.h:33
@ NUM_COURSES
Definition mk64.h:48
@ COURSE_MOO_MOO_FARM
Definition mk64.h:36
@ COURSE_DK_JUNGLE
Definition mk64.h:45
@ COURSE_SHERBET_LAND
Definition mk64.h:39
@ COURSE_AWARD_CEREMONY
Definition mk64.h:47
TIME_TRIAL_DATA_INDEX
Definition mk64.h:53
@ TIME_TRIAL_DATA_BANSHEE_BOARDWALK
Definition mk64.h:68
@ TIME_TRIAL_DATA_ROYAL_RACEWAY
Definition mk64.h:64
@ TIME_TRIAL_DATA_SHERBET_LAND
Definition mk64.h:63
@ TIME_TRIAL_DATA_KOOPA_BEACH
Definition mk64.h:56
@ TIME_TRIAL_DATA_YOSHI_VALLEY
Definition mk64.h:67
@ TIME_TRIAL_DATA_KALAMARI_DESERT
Definition mk64.h:57
@ TIME_TRIAL_DATA_WARIO_STADIUM
Definition mk64.h:62
@ TIME_TRIAL_DATA_BOWSER_CASTLE
Definition mk64.h:65
@ TIME_TRIAL_DATA_CHOCO_MOUNTAIN
Definition mk64.h:60
@ TIME_TRIAL_DATA_FRAPPE_SNOWLAND
Definition mk64.h:59
@ NUM_TIME_TRIAL_DATA
Definition mk64.h:70
@ TIME_TRIAL_DATA_RAINBOW_ROAD
Definition mk64.h:69
@ TIME_TRIAL_DATA_TOADS_TURNPIKE
Definition mk64.h:58
@ TIME_TRIAL_DATA_MARIO_RACEWAY
Definition mk64.h:61
@ TIME_TRIAL_DATA_LUIGI_RACEWAY
Definition mk64.h:54
@ TIME_TRIAL_DATA_DK_JUNGLE
Definition mk64.h:66
@ TIME_TRIAL_DATA_MOO_MOO_FARM
Definition mk64.h:55