Refresh 15

This commit is contained in:
n64 2021-10-14 15:25:30 -04:00
parent f9982e0ef5
commit 1372ae1bb7
383 changed files with 7001 additions and 5730 deletions

10
CHANGES
View file

@ -1,3 +1,13 @@
Refresh 15 (mostly a hotfix for RSP microcode selection)
1.) Renamed frame_buffer funcs and _ZBUFFER (#1184)
2.) RSP Microcode Hotfix (#1183)
3.) Label osSetTimer.c (#1182)
4.) Fix styling (#1177)
5.) Rename all `FrameBuffer` variants to `Framebuffer` (#1176)
6.) Remove (WIP) from sh.
7.) Allow both archives and ELF objects to be patched (#1127)
Refresh 14 Refresh 14
1.) Label whomp and some object fields (#1174) 1.) Label whomp and some object fields (#1174)

View file

@ -17,7 +17,7 @@ A prior copy of the game is required to extract the assets.
1. Install prerequisites: `sudo apt install -y build-essential git binutils-mips-linux-gnu python3` 1. Install prerequisites: `sudo apt install -y build-essential git binutils-mips-linux-gnu python3`
2. Clone the repo from within Linux: `git clone https://github.com/n64decomp/sm64.git` 2. Clone the repo from within Linux: `git clone https://github.com/n64decomp/sm64.git`
3. Place a Super Mario 64 ROM called `baserom.<VERSION>.z64` into the project folder for asset extraction, where `VERSION` can be `us`, `jp`, or `eu`. 3. Place a Super Mario 64 ROM called `baserom.<VERSION>.z64` into the project folder for asset extraction, where `VERSION` can be `us`, `jp`, `eu`, or `sh`.
4. Run `make` to build. Qualify the version through `make VERSION=<VERSION>`. Add `-j4` to improve build speed (hardware dependent). 4. Run `make` to build. Qualify the version through `make VERSION=<VERSION>`. Add `-j4` to improve build speed (hardware dependent).
Ensure the repo path length does not exceed 255 characters. Long path names result in build errors. Ensure the repo path length does not exceed 255 characters. Long path names result in build errors.
@ -79,7 +79,7 @@ You may also use [Docker](#docker-installation) to handle installing an image wi
#### Step 2: Copy baserom(s) for asset extraction #### Step 2: Copy baserom(s) for asset extraction
For each version (jp/us/eu) for which you want to build a ROM, put an existing ROM at For each version (jp/us/eu/sh) for which you want to build a ROM, put an existing ROM at
`./baserom.<VERSION>.z64` for asset extraction. `./baserom.<VERSION>.z64` for asset extraction.
##### Step 3: Build the ROM ##### Step 3: Build the ROM
@ -116,7 +116,7 @@ brew install capstone coreutils make pkg-config tehzz/n64-dev/mips64-elf-binutil
#### Step 2: Copy baserom(s) for asset extraction #### Step 2: Copy baserom(s) for asset extraction
For each version (jp/us/eu) for which you want to build a ROM, put an existing ROM at For each version (jp/us/eu/sh) for which you want to build a ROM, put an existing ROM at
`./baserom.<VERSION>.z64` for asset extraction. `./baserom.<VERSION>.z64` for asset extraction.
##### Step 3: Build the ROM ##### Step 3: Build the ROM

View file

@ -236,7 +236,7 @@ extern const Gfx mario_right_hand_cap_bottom_dl[];
extern const Gfx mario_right_hand_cap_dl[]; extern const Gfx mario_right_hand_cap_dl[];
extern const Gfx mario_right_hand_cap_wings_half_1_dl[]; extern const Gfx mario_right_hand_cap_wings_half_1_dl[];
extern const Gfx mario_right_hand_cap_wings_half_2_dl[]; extern const Gfx mario_right_hand_cap_wings_half_2_dl[];
extern const Gfx mario_right_hand_cap_wings_intial_dl[]; extern const Gfx mario_right_hand_cap_wings_initial_dl[];
extern const Gfx mario_right_hand_cap_wings_end_dl[]; extern const Gfx mario_right_hand_cap_wings_end_dl[];
extern const Gfx mario_right_hand_cap[]; extern const Gfx mario_right_hand_cap[];
extern const Gfx mario_right_hand_cap_wings[]; extern const Gfx mario_right_hand_cap_wings[];
@ -250,7 +250,7 @@ extern const Gfx mario_cap_unused_base_bottom_dl[];
extern const Gfx mario_cap_unused_base_dl[]; extern const Gfx mario_cap_unused_base_dl[];
extern const Gfx mario_wings_half_1_unused_dl[]; extern const Gfx mario_wings_half_1_unused_dl[];
extern const Gfx mario_wings_half_2_unused_dl[]; extern const Gfx mario_wings_half_2_unused_dl[];
extern const Gfx mario_cap_wings_unused_intial_dl[]; extern const Gfx mario_cap_wings_unused_initial_dl[];
extern const Gfx mario_cap_wings_unused_end_dl[]; extern const Gfx mario_cap_wings_unused_end_dl[];
extern const Gfx mario_cap_unused_dl[]; extern const Gfx mario_cap_unused_dl[];
extern const Gfx mario_metal_cap_unused_dl[]; extern const Gfx mario_metal_cap_unused_dl[];

View file

@ -6060,7 +6060,7 @@ const Gfx mario_right_hand_cap_wings_half_2_dl[] = {
}; };
// 0x0401B0E0 - 0x0401B138 // 0x0401B0E0 - 0x0401B138
const Gfx mario_right_hand_cap_wings_intial_dl[] = { const Gfx mario_right_hand_cap_wings_initial_dl[] = {
gsDPPipeSync(), gsDPPipeSync(),
gsDPSetCombineMode(G_CC_MODULATERGBFADEA, G_CC_MODULATERGBFADEA), gsDPSetCombineMode(G_CC_MODULATERGBFADEA, G_CC_MODULATERGBFADEA),
gsSPClearGeometryMode(G_CULL_BACK | G_SHADING_SMOOTH), gsSPClearGeometryMode(G_CULL_BACK | G_SHADING_SMOOTH),
@ -6104,7 +6104,7 @@ const Gfx mario_right_hand_cap[] = {
// 0x0401B1D8 - 0x0401B230 // 0x0401B1D8 - 0x0401B230
const Gfx mario_right_hand_cap_wings[] = { const Gfx mario_right_hand_cap_wings[] = {
gsSPDisplayList(mario_right_hand_cap_wings_intial_dl), gsSPDisplayList(mario_right_hand_cap_wings_initial_dl),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, mario_texture_wings_half_1), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, mario_texture_wings_half_1),
gsDPLoadSync(), gsDPLoadSync(),
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
@ -6132,7 +6132,7 @@ const Gfx mario_metal_right_hand_cap_shared_dl[] = {
// 0x0401B278 - 0x0401B2D0 // 0x0401B278 - 0x0401B2D0
const Gfx mario_metal_right_hand_cap_shared_dl_wings[] = { const Gfx mario_metal_right_hand_cap_shared_dl_wings[] = {
gsSPDisplayList(mario_right_hand_cap_wings_intial_dl), gsSPDisplayList(mario_right_hand_cap_wings_initial_dl),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, mario_texture_metal_wings_half_1), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, mario_texture_metal_wings_half_1),
gsDPLoadSync(), gsDPLoadSync(),
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
@ -6590,7 +6590,7 @@ const Gfx mario_wings_half_2_unused_dl[] = {
}; };
// 0x0401C6D8 - 0x0401C730 // 0x0401C6D8 - 0x0401C730
const Gfx mario_cap_wings_unused_intial_dl[] = { const Gfx mario_cap_wings_unused_initial_dl[] = {
gsDPPipeSync(), gsDPPipeSync(),
gsDPSetCombineMode(G_CC_MODULATERGBA, G_CC_MODULATERGBA), gsDPSetCombineMode(G_CC_MODULATERGBA, G_CC_MODULATERGBA),
gsSPClearGeometryMode(G_CULL_BACK | G_SHADING_SMOOTH), gsSPClearGeometryMode(G_CULL_BACK | G_SHADING_SMOOTH),
@ -6656,7 +6656,7 @@ const Gfx mario_metal_cap_unused_dl[] = {
// 0x0401C890 - 0x0401C8E8 # Unreferenced, unused like the duplicated cap, same case // 0x0401C890 - 0x0401C8E8 # Unreferenced, unused like the duplicated cap, same case
const Gfx mario_cap_wings_unused[] = { const Gfx mario_cap_wings_unused[] = {
gsSPDisplayList(mario_cap_wings_unused_intial_dl), gsSPDisplayList(mario_cap_wings_unused_initial_dl),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, mario_texture_wings_half_1), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, mario_texture_wings_half_1),
gsDPLoadSync(), gsDPLoadSync(),
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
@ -6671,7 +6671,7 @@ const Gfx mario_cap_wings_unused[] = {
// 0x0401C8E8 - 0x0401C940 # Unreferenced, unused like the duplicated cap, same case // 0x0401C8E8 - 0x0401C940 # Unreferenced, unused like the duplicated cap, same case
const Gfx mario_metal_cap_wings_unused[] = { const Gfx mario_metal_cap_wings_unused[] = {
gsSPDisplayList(mario_cap_wings_unused_intial_dl), gsSPDisplayList(mario_cap_wings_unused_initial_dl),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, mario_texture_metal_wings_half_1), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, mario_texture_metal_wings_half_1),
gsDPLoadSync(), gsDPLoadSync(),
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),

View file

@ -2097,13 +2097,13 @@ const Gfx dl_hud_img_begin[] = {
gsDPSetTexturePersp(G_TP_NONE), gsDPSetTexturePersp(G_TP_NONE),
gsDPSetAlphaCompare(G_AC_THRESHOLD), gsDPSetAlphaCompare(G_AC_THRESHOLD),
gsDPSetBlendColor(255, 255, 255, 255), gsDPSetBlendColor(255, 255, 255, 255),
#if defined(VERSION_EU) || defined(VERSION_SH) #if defined(VERSION_JP) || defined(VERSION_US)
gsDPSetRenderMode(G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2),
#else
gsDPSetRenderMode(G_RM_NOOP, G_RM_NOOP2), gsDPSetRenderMode(G_RM_NOOP, G_RM_NOOP2),
#endif #endif
#ifdef VERSION_EU #ifdef VERSION_EU
gsDPSetTextureFilter(G_TF_POINT), gsDPSetTextureFilter(G_TF_POINT),
#elif defined(VERSION_JP) || defined(VERSION_US)
gsDPSetRenderMode(G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2),
#endif #endif
gsSPEndDisplayList(), gsSPEndDisplayList(),
}; };

View file

@ -874,7 +874,7 @@ const BehaviorScript bhvMrIBlueCoin[] = {
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE), OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
BILLBOARD(), BILLBOARD(),
SET_INT(oIntangibleTimer, 0), SET_INT(oIntangibleTimer, 0),
SET_FLOAT(oMrIUnk110, 20), SET_FLOAT(oCoinUnk110, 20),
SET_INT(oAnimState, -1), SET_INT(oAnimState, -1),
SET_OBJ_PHYSICS(/*Wall hitbox radius*/ 30, /*Gravity*/ -400, /*Bounciness*/ -70, /*Drag strength*/ 1000, /*Friction*/ 1000, /*Buoyancy*/ 200, /*Unused*/ 0, 0), SET_OBJ_PHYSICS(/*Wall hitbox radius*/ 30, /*Gravity*/ -400, /*Bounciness*/ -70, /*Drag strength*/ 1000, /*Friction*/ 1000, /*Buoyancy*/ 200, /*Unused*/ 0, 0),
CALL_NATIVE(bhv_coin_init), CALL_NATIVE(bhv_coin_init),

View file

@ -24,7 +24,7 @@
#define BUGFIX_STAR_BOWSER_KEY (0 || VERSION_US || VERSION_EU || VERSION_SH) #define BUGFIX_STAR_BOWSER_KEY (0 || VERSION_US || VERSION_EU || VERSION_SH)
/// Fixes bug that enables Mario in time stop even if is not ready to speak /// Fixes bug that enables Mario in time stop even if is not ready to speak
#define BUGFIX_DIALOG_TIME_STOP (0 || VERSION_US || VERSION_EU || VERSION_SH) #define BUGFIX_DIALOG_TIME_STOP (0 || VERSION_US || VERSION_EU || VERSION_SH)
/// Fixes bug that causes Mario to still collide with Bowser in BITS after his defeat /// Fixes bug that causes Mario to still collide with Bowser in BitS after his defeat
#define BUGFIX_BOWSER_COLLIDE_BITS_DEAD (0 || VERSION_US || VERSION_EU || VERSION_SH) #define BUGFIX_BOWSER_COLLIDE_BITS_DEAD (0 || VERSION_US || VERSION_EU || VERSION_SH)
/// Fixes bug where Bowser wouldn't reset his speed when fallen off (and adds missing checks) /// Fixes bug where Bowser wouldn't reset his speed when fallen off (and adds missing checks)
#define BUGFIX_BOWSER_FALLEN_OFF_STAGE (0 || VERSION_US || VERSION_EU || VERSION_SH) #define BUGFIX_BOWSER_FALLEN_OFF_STAGE (0 || VERSION_US || VERSION_EU || VERSION_SH)

View file

@ -12,8 +12,7 @@
#define DEFINE_BONUS_COURSE(courseenum, _1) courseenum, #define DEFINE_BONUS_COURSE(courseenum, _1) courseenum,
enum CourseNum enum CourseNum {
{
#include "levels/course_defines.h" #include "levels/course_defines.h"
COURSE_END, // To mark end + 1 for marking max and count. COURSE_END, // To mark end + 1 for marking max and count.
// TODO: clean this up. This is still bad. Which // TODO: clean this up. This is still bad. Which
@ -27,6 +26,7 @@ enum CourseNum
#undef DEFINE_COURSES_END #undef DEFINE_COURSES_END
#undef DEFINE_BONUS_COURSE #undef DEFINE_BONUS_COURSE
#define COURSE_IS_MAIN_COURSE(cmd) (cmd >= COURSE_MIN && cmd <= COURSE_STAGES_MAX) #define COURSE_IS_MAIN_COURSE(cmd) ((cmd) >= COURSE_MIN && (cmd) <= COURSE_STAGES_MAX)
#define COURSE_NUM_TO_INDEX(cmd) ((cmd) - 1)
#endif // COURSE_TABLE_H #endif // COURSE_TABLE_H

View file

@ -7,8 +7,7 @@
#define STUB_LEVEL(_0, levelenum, _2, _3, _4, _5, _6, _7, _8) levelenum, #define STUB_LEVEL(_0, levelenum, _2, _3, _4, _5, _6, _7, _8) levelenum,
#define DEFINE_LEVEL(_0, levelenum, _2, _3, _4, _5, _6, _7, _8, _9, _10) levelenum, #define DEFINE_LEVEL(_0, levelenum, _2, _3, _4, _5, _6, _7, _8, _9, _10) levelenum,
enum LevelNum enum LevelNum {
{
LEVEL_NONE, LEVEL_NONE,
#include "levels/level_defines.h" #include "levels/level_defines.h"
LEVEL_COUNT, LEVEL_COUNT,

View file

@ -5,8 +5,7 @@
#include "behavior_data.h" #include "behavior_data.h"
#include "model_ids.h" #include "model_ids.h"
struct MacroPreset struct MacroPreset {
{
/*0x00*/ const BehaviorScript *behavior; /*0x00*/ const BehaviorScript *behavior;
/*0x04*/ s16 model; /*0x04*/ s16 model;
/*0x06*/ s16 param; /*0x06*/ s16 param;

View file

@ -3,8 +3,7 @@
/* Mario Animation IDs */ /* Mario Animation IDs */
enum MarioAnimID enum MarioAnimID {
{
/* 0x00 */ MARIO_ANIM_SLOW_LEDGE_GRAB, /* 0x00 */ MARIO_ANIM_SLOW_LEDGE_GRAB,
/* 0x01 */ MARIO_ANIM_FALL_OVER_BACKWARDS, /* 0x01 */ MARIO_ANIM_FALL_OVER_BACKWARDS,
/* 0x02 */ MARIO_ANIM_BACKWARD_AIR_KB, /* 0x02 */ MARIO_ANIM_BACKWARD_AIR_KB,
@ -196,7 +195,7 @@ enum MarioAnimID
/* 0xBC */ MARIO_ANIM_TURNING_PART1, /* 0xBC */ MARIO_ANIM_TURNING_PART1,
/* 0xBD */ MARIO_ANIM_TURNING_PART2, /* 0xBD */ MARIO_ANIM_TURNING_PART2,
/* 0xBE */ MARIO_ANIM_SLIDEFLIP_LAND, /* 0xBE */ MARIO_ANIM_SLIDEFLIP_LAND,
/* 0XBF */ MARIO_ANIM_SLIDEFLIP, /* 0xBF */ MARIO_ANIM_SLIDEFLIP,
/* 0xC0 */ MARIO_ANIM_TRIPLE_JUMP_LAND, /* 0xC0 */ MARIO_ANIM_TRIPLE_JUMP_LAND,
/* 0xC1 */ MARIO_ANIM_TRIPLE_JUMP, /* 0xC1 */ MARIO_ANIM_TRIPLE_JUMP,
/* 0xC2 */ MARIO_ANIM_FIRST_PERSON, /* 0xC2 */ MARIO_ANIM_FIRST_PERSON,

View file

@ -3,8 +3,7 @@
/* Mario Geo-Switch-Case IDs */ /* Mario Geo-Switch-Case IDs */
enum MarioEyesGSCId enum MarioEyesGSCId {
{
/*0x00*/ MARIO_EYES_BLINK, /*0x00*/ MARIO_EYES_BLINK,
/*0x01*/ MARIO_EYES_OPEN, /*0x01*/ MARIO_EYES_OPEN,
/*0x02*/ MARIO_EYES_HALF_CLOSED, /*0x02*/ MARIO_EYES_HALF_CLOSED,
@ -16,8 +15,7 @@ enum MarioEyesGSCId
/*0x08*/ MARIO_EYES_DEAD /*0x08*/ MARIO_EYES_DEAD
}; };
enum MarioHandGSCId enum MarioHandGSCId {
{
/*0x00*/ MARIO_HAND_FISTS, /*0x00*/ MARIO_HAND_FISTS,
/*0x01*/ MARIO_HAND_OPEN, /*0x01*/ MARIO_HAND_OPEN,
/*0x02*/ MARIO_HAND_PEACE_SIGN, /*0x02*/ MARIO_HAND_PEACE_SIGN,
@ -26,16 +24,14 @@ enum MarioHandGSCId
/*0x05*/ MARIO_HAND_RIGHT_OPEN /*0x05*/ MARIO_HAND_RIGHT_OPEN
}; };
enum MarioCapGSCId enum MarioCapGSCId {
{
/*0x00*/ MARIO_HAS_DEFAULT_CAP_ON, /*0x00*/ MARIO_HAS_DEFAULT_CAP_ON,
/*0x01*/ MARIO_HAS_DEFAULT_CAP_OFF, /*0x01*/ MARIO_HAS_DEFAULT_CAP_OFF,
/*0x02*/ MARIO_HAS_WING_CAP_ON, /*0x02*/ MARIO_HAS_WING_CAP_ON,
/*0x03*/ MARIO_HAS_WING_CAP_OFF // unused /*0x03*/ MARIO_HAS_WING_CAP_OFF // unused
}; };
enum MarioGrabPosGSCId enum MarioGrabPosGSCId {
{
/*0x00*/ GRAB_POS_NULL, /*0x00*/ GRAB_POS_NULL,
/*0x01*/ GRAB_POS_LIGHT_OBJ, /*0x01*/ GRAB_POS_LIGHT_OBJ,
/*0x02*/ GRAB_POS_HEAVY_OBJ, /*0x02*/ GRAB_POS_HEAVY_OBJ,

View file

@ -132,6 +132,7 @@
/* oBehParams2ndByte */ /* oBehParams2ndByte */
#define BOBOMB_BP_STYPE_GENERIC 0 #define BOBOMB_BP_STYPE_GENERIC 0
#define BOBOMB_BP_STYPE_STATIONARY 1 #define BOBOMB_BP_STYPE_STATIONARY 1
/* oAction */ /* oAction */
#define BOBOMB_ACT_PATROL 0 #define BOBOMB_ACT_PATROL 0
#define BOBOMB_ACT_LAUNCHED 1 #define BOBOMB_ACT_LAUNCHED 1
@ -170,18 +171,22 @@
#define BOBOMB_BUDDY_BP_STYPE_BOB_GRASS_KBB 1 #define BOBOMB_BUDDY_BP_STYPE_BOB_GRASS_KBB 1
#define BOBOMB_BUDDY_BP_STYPE_BOB_CANNON_KBB 2 #define BOBOMB_BUDDY_BP_STYPE_BOB_CANNON_KBB 2
#define BOBOMB_BUDDY_BP_STYPE_BOB_GRASS 3 #define BOBOMB_BUDDY_BP_STYPE_BOB_GRASS 3
/* oAction */ /* oAction */
#define BOBOMB_BUDDY_ACT_IDLE 0 #define BOBOMB_BUDDY_ACT_IDLE 0
#define BOBOMB_BUDDY_ACT_TURN_TO_TALK 2 #define BOBOMB_BUDDY_ACT_TURN_TO_TALK 2
#define BOBOMB_BUDDY_ACT_TALK 3 #define BOBOMB_BUDDY_ACT_TALK 3
/* oBobombBuddyRole */ /* oBobombBuddyRole */
#define BOBOMB_BUDDY_ROLE_ADVICE 0 #define BOBOMB_BUDDY_ROLE_ADVICE 0
#define BOBOMB_BUDDY_ROLE_CANNON 1 #define BOBOMB_BUDDY_ROLE_CANNON 1
/* oBobombBuddyCannonStatus */ /* oBobombBuddyCannonStatus */
#define BOBOMB_BUDDY_CANNON_UNOPENED 0 #define BOBOMB_BUDDY_CANNON_UNOPENED 0
#define BOBOMB_BUDDY_CANNON_OPENING 1 #define BOBOMB_BUDDY_CANNON_OPENING 1
#define BOBOMB_BUDDY_CANNON_OPENED 2 #define BOBOMB_BUDDY_CANNON_OPENED 2
#define BOBOMB_BUDDY_CANNON_STOP_TALKING 3 #define BOBOMB_BUDDY_CANNON_STOP_TALKING 3
/* oBobombBuddyHasTalkedToMario */ /* oBobombBuddyHasTalkedToMario */
#define BOBOMB_BUDDY_HAS_NOT_TALKED 0 #define BOBOMB_BUDDY_HAS_NOT_TALKED 0
#define BOBOMB_BUDDY_HAS_TALKED 2 #define BOBOMB_BUDDY_HAS_TALKED 2
@ -191,6 +196,7 @@
#define BOWSER_ACT_TAIL_DEFAULT 0 #define BOWSER_ACT_TAIL_DEFAULT 0
#define BOWSER_ACT_TAIL_THROWN 1 #define BOWSER_ACT_TAIL_THROWN 1
#define BOWSER_ACT_TAIL_TOUCHED_MARIO 2 #define BOWSER_ACT_TAIL_TOUCHED_MARIO 2
/* oAction */ /* oAction */
#define BOWSER_ACT_DEFAULT 0 #define BOWSER_ACT_DEFAULT 0
#define BOWSER_ACT_THROWN 1 #define BOWSER_ACT_THROWN 1
@ -212,6 +218,7 @@
#define BOWSER_ACT_QUICK_JUMP 17 #define BOWSER_ACT_QUICK_JUMP 17
#define BOWSER_ACT_UNUSED_SLOW_WALK 18 #define BOWSER_ACT_UNUSED_SLOW_WALK 18
#define BOWSER_ACT_TILT_LAVA_PLATFORM 19 #define BOWSER_ACT_TILT_LAVA_PLATFORM 19
/* Animations */ /* Animations */
#define BOWSER_ANIM_STAND_UP 0 #define BOWSER_ANIM_STAND_UP 0
#define BOWSER_ANIM_STAND_UP_UNUSED 1 // slightly different #define BOWSER_ANIM_STAND_UP_UNUSED 1 // slightly different
@ -240,25 +247,30 @@
#define BOWSER_ANIM_EDGE_STOP 24 #define BOWSER_ANIM_EDGE_STOP 24
#define BOWSER_ANIM_FLIP 25 #define BOWSER_ANIM_FLIP 25
#define BOWSER_ANIM_STAND_UP_FROM_FLIP 26 #define BOWSER_ANIM_STAND_UP_FROM_FLIP 26
/* oBehParams2ndByte */ /* oBehParams2ndByte */
#define BOWSER_BP_BITDW 0 #define BOWSER_BP_BITDW 0
#define BOWSER_BP_BITFS 1 #define BOWSER_BP_BITFS 1
#define BOWSER_BP_BITS 2 #define BOWSER_BP_BITS 2
/* oBowserCamAct */ /* oBowserCamAct */
#define BOWSER_CAM_ACT_IDLE 0 #define BOWSER_CAM_ACT_IDLE 0
#define BOWSER_CAM_ACT_WALK 1 #define BOWSER_CAM_ACT_WALK 1
#define BOWSER_CAM_ACT_END 2 #define BOWSER_CAM_ACT_END 2
/* oBowserStatus */ /* oBowserStatus */
#define BOWSER_STATUS_ANGLE_MARIO (1 << 1) // 0x00000002 #define BOWSER_STATUS_ANGLE_MARIO (1 << 1) // 0x00000002
#define BOWSER_STATUS_ANGLE_CENTRE (1 << 2) // 0x00000004 #define BOWSER_STATUS_ANGLE_CENTER (1 << 2) // 0x00000004
#define BOWSER_STATUS_DIST_MARIO (1 << 3) // 0x00000008 #define BOWSER_STATUS_DIST_MARIO (1 << 3) // 0x00000008
#define BOWSER_STATUS_DIST_CENTRE (1 << 4) // 0x00000010 #define BOWSER_STATUS_DIST_CENTER (1 << 4) // 0x00000010
#define BOWSER_STATUS_BIG_JUMP (1 << 16) // 0x00010000 #define BOWSER_STATUS_BIG_JUMP (1 << 16) // 0x00010000
#define BOWSER_STATUS_FIRE_SKY (1 << 17) // 0x00020000 #define BOWSER_STATUS_FIRE_SKY (1 << 17) // 0x00020000
/* oBowserGrabbedStatus */ /* oBowserGrabbedStatus */
#define BOWSER_GRAB_STATUS_NONE 0 #define BOWSER_GRAB_STATUS_NONE 0
#define BOWSER_GRAB_STATUS_GRABBED 1 #define BOWSER_GRAB_STATUS_GRABBED 1
#define BOWSER_GRAB_STATUS_HOLDING 2 #define BOWSER_GRAB_STATUS_HOLDING 2
/* oSubAction */ /* oSubAction */
#define BOWSER_SUB_ACT_DEAD_FLY_BACK 0 #define BOWSER_SUB_ACT_DEAD_FLY_BACK 0
#define BOWSER_SUB_ACT_DEAD_BOUNCE 1 #define BOWSER_SUB_ACT_DEAD_BOUNCE 1
@ -297,6 +309,7 @@
#define FISH_SPAWNER_ACT_SPAWN 0 #define FISH_SPAWNER_ACT_SPAWN 0
#define FISH_SPAWNER_ACT_IDLE 1 #define FISH_SPAWNER_ACT_IDLE 1
#define FISH_SPAWNER_ACT_RESPAWN 2 #define FISH_SPAWNER_ACT_RESPAWN 2
/* oBehParams2ndByte */ /* oBehParams2ndByte */
#define FISH_SPAWNER_BP_MANY_BLUE 0 #define FISH_SPAWNER_BP_MANY_BLUE 0
#define FISH_SPAWNER_BP_FEW_BLUE 1 #define FISH_SPAWNER_BP_FEW_BLUE 1
@ -358,6 +371,7 @@
#define HOOT_AVAIL_ASLEEP_IN_TREE 0 #define HOOT_AVAIL_ASLEEP_IN_TREE 0
#define HOOT_AVAIL_WANTS_TO_TALK 1 #define HOOT_AVAIL_WANTS_TO_TALK 1
#define HOOT_AVAIL_READY_TO_FLY 2 #define HOOT_AVAIL_READY_TO_FLY 2
/* oAction */ /* oAction */
#define HOOT_ACT_ASCENT 0 #define HOOT_ACT_ASCENT 0
#define HOOT_ACT_CARRY 1 #define HOOT_ACT_CARRY 1
@ -367,6 +381,7 @@
/* oBehParams2ndByte */ /* oBehParams2ndByte */
#define BULLY_BP_SIZE_SMALL 0 #define BULLY_BP_SIZE_SMALL 0
#define BULLY_BP_SIZE_BIG 1 #define BULLY_BP_SIZE_BIG 1
/* oAction */ /* oAction */
#define BULLY_ACT_PATROL 0 #define BULLY_ACT_PATROL 0
#define BULLY_ACT_CHASE_MARIO 1 #define BULLY_ACT_CHASE_MARIO 1
@ -376,6 +391,7 @@
#define BULLY_ACT_ACTIVATE_AND_FALL 5 #define BULLY_ACT_ACTIVATE_AND_FALL 5
#define BULLY_ACT_LAVA_DEATH 100 #define BULLY_ACT_LAVA_DEATH 100
#define BULLY_ACT_DEATH_PLANE_DEATH 101 #define BULLY_ACT_DEATH_PLANE_DEATH 101
/* oBullySubtype */ /* oBullySubtype */
#define BULLY_STYPE_GENERIC 0 #define BULLY_STYPE_GENERIC 0
#define BULLY_STYPE_MINION 1 #define BULLY_STYPE_MINION 1
@ -413,6 +429,7 @@
#define WF_SLID_BRICK_PTFM_BP_MOV_VEL_10 1 #define WF_SLID_BRICK_PTFM_BP_MOV_VEL_10 1
#define WF_SLID_BRICK_PTFM_BP_MOV_VEL_15 2 #define WF_SLID_BRICK_PTFM_BP_MOV_VEL_15 2
#define WF_SLID_BRICK_PTFM_BP_MOV_VEL_20 3 #define WF_SLID_BRICK_PTFM_BP_MOV_VEL_20 3
/* oAction */ /* oAction */
#define WF_SLID_BRICK_PTFM_ACT_WAIT 0 #define WF_SLID_BRICK_PTFM_ACT_WAIT 0
#define WF_SLID_BRICK_PTFM_ACT_EXTEND 1 #define WF_SLID_BRICK_PTFM_ACT_EXTEND 1
@ -431,6 +448,7 @@
#define MONEYBAG_ACT_RETURN_HOME 3 #define MONEYBAG_ACT_RETURN_HOME 3
#define MONEYBAG_ACT_DISAPPEAR 4 #define MONEYBAG_ACT_DISAPPEAR 4
#define MONEYBAG_ACT_DEATH 5 #define MONEYBAG_ACT_DEATH 5
/* oMoneybagJumpState */ /* oMoneybagJumpState */
#define MONEYBAG_JUMP_LANDING 0 #define MONEYBAG_JUMP_LANDING 0
#define MONEYBAG_JUMP_PREPARE 1 #define MONEYBAG_JUMP_PREPARE 1
@ -602,6 +620,7 @@
/* oBehParams2ndByte */ /* oBehParams2ndByte */
#define GOOMBA_TRIPLET_SPAWNER_BP_SIZE_MASK 0x00000003 #define GOOMBA_TRIPLET_SPAWNER_BP_SIZE_MASK 0x00000003
#define GOOMBA_TRIPLET_SPAWNER_BP_EXTRA_GOOMBAS_MASK 0x000000FC #define GOOMBA_TRIPLET_SPAWNER_BP_EXTRA_GOOMBAS_MASK 0x000000FC
/* oAction */ /* oAction */
#define GOOMBA_TRIPLET_SPAWNER_ACT_UNLOADED 0 #define GOOMBA_TRIPLET_SPAWNER_ACT_UNLOADED 0
#define GOOMBA_TRIPLET_SPAWNER_ACT_LOADED 1 #define GOOMBA_TRIPLET_SPAWNER_ACT_LOADED 1
@ -808,6 +827,9 @@
#define PIRANHA_PLANT_ACT_WAIT_TO_RESPAWN 7 #define PIRANHA_PLANT_ACT_WAIT_TO_RESPAWN 7
#define PIRANHA_PLANT_ACT_RESPAWN 8 #define PIRANHA_PLANT_ACT_RESPAWN 8
/* oPiranhaPlantSleepMusicState */
#define PIRANHA_PLANT_SLEEP_MUSIC_PLAYING 0
/* Piranha Plant bubble */ /* Piranha Plant bubble */
#define PIRANHA_PLANT_BUBBLE_ACT_IDLE 0 #define PIRANHA_PLANT_BUBBLE_ACT_IDLE 0
#define PIRANHA_PLANT_BUBBLE_ACT_GROW_SHRINK_LOOP 1 #define PIRANHA_PLANT_BUBBLE_ACT_GROW_SHRINK_LOOP 1
@ -893,7 +915,6 @@
#define SL_SNOWMAN_WIND_ACT_TALKING 1 #define SL_SNOWMAN_WIND_ACT_TALKING 1
#define SL_SNOWMAN_WIND_ACT_BLOWING 2 #define SL_SNOWMAN_WIND_ACT_BLOWING 2
/* Water bomb */ /* Water bomb */
/* oAction */ /* oAction */
#define WATER_BOMB_ACT_SHOT_FROM_CANNON 0 #define WATER_BOMB_ACT_SHOT_FROM_CANNON 0
@ -1090,6 +1111,7 @@
#define MR_BLIZZARD_ACT_BURROW 5 #define MR_BLIZZARD_ACT_BURROW 5
#define MR_BLIZZARD_ACT_DEATH 6 #define MR_BLIZZARD_ACT_DEATH 6
#define MR_BLIZZARD_ACT_JUMP 7 #define MR_BLIZZARD_ACT_JUMP 7
/* oBehParams2ndByte */ /* oBehParams2ndByte */
#define MR_BLIZZARD_STYPE_NO_CAP 0 #define MR_BLIZZARD_STYPE_NO_CAP 0
#define MR_BLIZZARD_STYPE_JUMPING 1 #define MR_BLIZZARD_STYPE_JUMPING 1

View file

@ -277,14 +277,14 @@
#define /*0x088*/ oBowserCamAct OBJECT_FIELD_S32(0x00) #define /*0x088*/ oBowserCamAct OBJECT_FIELD_S32(0x00)
#define /*0x0F4*/ oBowserStatus OBJECT_FIELD_S32(0x1B) #define /*0x0F4*/ oBowserStatus OBJECT_FIELD_S32(0x1B)
#define /*0x0F8*/ oBowserTimer OBJECT_FIELD_S32(0x1C) #define /*0x0F8*/ oBowserTimer OBJECT_FIELD_S32(0x1C)
#define /*0x0FC*/ oBowserDistToCentre OBJECT_FIELD_F32(0x1D) #define /*0x0FC*/ oBowserDistToCenter OBJECT_FIELD_F32(0x1D)
#define /*0x106*/ oBowserBitsJustJump OBJECT_FIELD_S16(0x1F, 1) #define /*0x106*/ oBowserBitsJustJump OBJECT_FIELD_S16(0x1F, 1)
#define /*0x108*/ oBowserRandSplitFloor OBJECT_FIELD_S16(0x20, 0) #define /*0x108*/ oBowserRandSplitFloor OBJECT_FIELD_S16(0x20, 0)
#define /*0x10A*/ oBowserHeldAnglePitch OBJECT_FIELD_S16(0x20, 1) #define /*0x10A*/ oBowserHeldAnglePitch OBJECT_FIELD_S16(0x20, 1)
#define /*0x10D*/ oBowserHeldAngleVelYaw OBJECT_FIELD_S16(0x21, 0) #define /*0x10D*/ oBowserHeldAngleVelYaw OBJECT_FIELD_S16(0x21, 0)
#define /*0x10E*/ oBowserGrabbedStatus OBJECT_FIELD_S16(0x21, 1) #define /*0x10E*/ oBowserGrabbedStatus OBJECT_FIELD_S16(0x21, 1)
#define /*0x110*/ oBowserIsReacting OBJECT_FIELD_S16(0x22, 0) #define /*0x110*/ oBowserIsReacting OBJECT_FIELD_S16(0x22, 0)
#define /*0x112*/ oBowserAngleToCentre OBJECT_FIELD_S16(0x22, 1) #define /*0x112*/ oBowserAngleToCenter OBJECT_FIELD_S16(0x22, 1)
#define /*0x1AC*/ oBowserTargetOpacity OBJECT_FIELD_S16(0x49, 0) #define /*0x1AC*/ oBowserTargetOpacity OBJECT_FIELD_S16(0x49, 0)
#define /*0x1AE*/ oBowserEyesTimer OBJECT_FIELD_S16(0x49, 1) #define /*0x1AE*/ oBowserEyesTimer OBJECT_FIELD_S16(0x49, 1)
#define /*0x1B0*/ oBowserEyesShut OBJECT_FIELD_S16(0x4A, 0) #define /*0x1B0*/ oBowserEyesShut OBJECT_FIELD_S16(0x4A, 0)
@ -319,9 +319,9 @@
#define /*0x108*/ oBubbaUnk108 OBJECT_FIELD_F32(0x20) #define /*0x108*/ oBubbaUnk108 OBJECT_FIELD_F32(0x20)
#define /*0x10C*/ oBubbaUnk10C OBJECT_FIELD_F32(0x21) #define /*0x10C*/ oBubbaUnk10C OBJECT_FIELD_F32(0x21)
#define /*0x1AC*/ oBubbaUnk1AC OBJECT_FIELD_S16(0x49, 0) #define /*0x1AC*/ oBubbaUnk1AC OBJECT_FIELD_S16(0x49, 0)
#define /*0x1AE*/ oBubbaUnk1AE OBJECT_FIELD_S16(0x49, + 1) #define /*0x1AE*/ oBubbaUnk1AE OBJECT_FIELD_S16(0x49, 1)
#define /*0x1B0*/ oBubbaUnk1B0 OBJECT_FIELD_S16(0x4A, 0) #define /*0x1B0*/ oBubbaUnk1B0 OBJECT_FIELD_S16(0x4A, 0)
#define /*0x1B2*/ oBubbaUnk1B2 OBJECT_FIELD_S16(0x4A, + 1) #define /*0x1B2*/ oBubbaUnk1B2 OBJECT_FIELD_S16(0x4A, 1)
/* Bullet Bill */ /* Bullet Bill */
#define /*0x0F8*/ oBulletBillInitialMoveYaw OBJECT_FIELD_S32(0x1C) #define /*0x0F8*/ oBulletBillInitialMoveYaw OBJECT_FIELD_S32(0x1C)
@ -442,9 +442,9 @@
#define /*0x104*/ oDorrieYawVel OBJECT_FIELD_S32(0x1F) #define /*0x104*/ oDorrieYawVel OBJECT_FIELD_S32(0x1F)
#define /*0x10C*/ oDorrieLiftingMario OBJECT_FIELD_S32(0x21) #define /*0x10C*/ oDorrieLiftingMario OBJECT_FIELD_S32(0x21)
#define /*0x1AC*/ oDorrieGroundPounded OBJECT_FIELD_S16(0x49, 0) #define /*0x1AC*/ oDorrieGroundPounded OBJECT_FIELD_S16(0x49, 0)
#define /*0x1AE*/ oDorrieAngleToHome OBJECT_FIELD_S16(0x49, + 1) #define /*0x1AE*/ oDorrieAngleToHome OBJECT_FIELD_S16(0x49, 1)
#define /*0x1B0*/ oDorrieNeckAngle OBJECT_FIELD_S16(0x4A, 0) #define /*0x1B0*/ oDorrieNeckAngle OBJECT_FIELD_S16(0x4A, 0)
#define /*0x1B2*/ oDorrieHeadRaiseSpeed OBJECT_FIELD_S16(0x4A, + 1) #define /*0x1B2*/ oDorrieHeadRaiseSpeed OBJECT_FIELD_S16(0x4A, 1)
/* Elevator */ /* Elevator */
#define /*0x0F4*/ oElevatorUnkF4 OBJECT_FIELD_F32(0x1B) #define /*0x0F4*/ oElevatorUnkF4 OBJECT_FIELD_F32(0x1B)
@ -604,9 +604,9 @@
#define /*0x10C*/ oKleptoStartPosZ OBJECT_FIELD_F32(0x21) #define /*0x10C*/ oKleptoStartPosZ OBJECT_FIELD_F32(0x21)
#define /*0x110*/ oKleptoTimeUntilTargetChange OBJECT_FIELD_S32(0x22) #define /*0x110*/ oKleptoTimeUntilTargetChange OBJECT_FIELD_S32(0x22)
#define /*0x1AC*/ oKleptoTargetNumber OBJECT_FIELD_S16(0x49, 0) #define /*0x1AC*/ oKleptoTargetNumber OBJECT_FIELD_S16(0x49, 0)
#define /*0x1AE*/ oKleptoUnk1AE OBJECT_FIELD_S16(0x49, + 1) #define /*0x1AE*/ oKleptoUnk1AE OBJECT_FIELD_S16(0x49, 1)
#define /*0x1B0*/ oKleptoUnk1B0 OBJECT_FIELD_S16(0x4A, 0) #define /*0x1B0*/ oKleptoUnk1B0 OBJECT_FIELD_S16(0x4A, 0)
#define /*0x1B2*/ oKleptoYawToTarget OBJECT_FIELD_S16(0x4A, + 1) #define /*0x1B2*/ oKleptoYawToTarget OBJECT_FIELD_S16(0x4A, 1)
/* Koopa */ /* Koopa */
#define /*0x0F4*/ oKoopaAgility OBJECT_FIELD_F32(0x1B) #define /*0x0F4*/ oKoopaAgility OBJECT_FIELD_F32(0x1B)
@ -631,7 +631,7 @@
/* Koopa Shell Flame */ /* Koopa Shell Flame */
#define /*0x0F4*/ oKoopaShellFlameUnkF4 OBJECT_FIELD_F32(0x1B) #define /*0x0F4*/ oKoopaShellFlameUnkF4 OBJECT_FIELD_F32(0x1B)
#define /*0x0F8*/ oKoopaShellFlameUnkF8 OBJECT_FIELD_F32(0x1C) #define /*0x0F8*/ oKoopaShellFlameScale OBJECT_FIELD_F32(0x1C)
/* Camera Lakitu */ /* Camera Lakitu */
#define /*0x0F4*/ oCameraLakituBlinkTimer OBJECT_FIELD_S32(0x1B) #define /*0x0F4*/ oCameraLakituBlinkTimer OBJECT_FIELD_S32(0x1B)
@ -642,7 +642,7 @@
#define /*0x104*/ oCameraLakituUnk104 OBJECT_FIELD_S32(0x1F) #define /*0x104*/ oCameraLakituUnk104 OBJECT_FIELD_S32(0x1F)
#endif #endif
#define /*0x1AC*/ oCameraLakituPitchVel OBJECT_FIELD_S16(0x49, 0) #define /*0x1AC*/ oCameraLakituPitchVel OBJECT_FIELD_S16(0x49, 0)
#define /*0x1AE*/ oCameraLakituYawVel OBJECT_FIELD_S16(0x49, + 1) #define /*0x1AE*/ oCameraLakituYawVel OBJECT_FIELD_S16(0x49, 1)
/* Evil Lakitu */ /* Evil Lakitu */
#define /*0x0F4*/ oEnemyLakituNumSpinies OBJECT_FIELD_S32(0x1B) #define /*0x0F4*/ oEnemyLakituNumSpinies OBJECT_FIELD_S32(0x1B)
@ -715,7 +715,7 @@
#define /*0x100*/ oMrIUnk100 OBJECT_FIELD_S32(0x1E) #define /*0x100*/ oMrIUnk100 OBJECT_FIELD_S32(0x1E)
#define /*0x104*/ oMrIUnk104 OBJECT_FIELD_S32(0x1F) #define /*0x104*/ oMrIUnk104 OBJECT_FIELD_S32(0x1F)
#define /*0x108*/ oMrIUnk108 OBJECT_FIELD_S32(0x20) #define /*0x108*/ oMrIUnk108 OBJECT_FIELD_S32(0x20)
#define /*0x10C*/ oMrISize OBJECT_FIELD_F32(0x21) #define /*0x10C*/ oMrIScale OBJECT_FIELD_F32(0x21)
#define /*0x110*/ oMrIUnk110 OBJECT_FIELD_S32(0x22) #define /*0x110*/ oMrIUnk110 OBJECT_FIELD_S32(0x22)
/* Object Respawner */ /* Object Respawner */
@ -737,9 +737,9 @@
// 0x1D-0x21 reserved for pathing // 0x1D-0x21 reserved for pathing
#define /*0x110*/ oRacingPenguinWeightedNewTargetSpeed OBJECT_FIELD_F32(0x22) #define /*0x110*/ oRacingPenguinWeightedNewTargetSpeed OBJECT_FIELD_F32(0x22)
#define /*0x1AC*/ oRacingPenguinFinalTextbox OBJECT_FIELD_S16(0x49, 0) #define /*0x1AC*/ oRacingPenguinFinalTextbox OBJECT_FIELD_S16(0x49, 0)
#define /*0x1AE*/ oRacingPenguinMarioWon OBJECT_FIELD_S16(0x49, + 1) #define /*0x1AE*/ oRacingPenguinMarioWon OBJECT_FIELD_S16(0x49, 1)
#define /*0x1B0*/ oRacingPenguinReachedBottom OBJECT_FIELD_S16(0x4A, 0) #define /*0x1B0*/ oRacingPenguinReachedBottom OBJECT_FIELD_S16(0x4A, 0)
#define /*0x1B2*/ oRacingPenguinMarioCheated OBJECT_FIELD_S16(0x4A, + 1) #define /*0x1B2*/ oRacingPenguinMarioCheated OBJECT_FIELD_S16(0x4A, 1)
/* Small Penguin */ /* Small Penguin */
#define /*0x088*/ oSmallPenguinUnk88 OBJECT_FIELD_S32(0x00) #define /*0x088*/ oSmallPenguinUnk88 OBJECT_FIELD_S32(0x00)
@ -760,7 +760,7 @@
/* Fire Piranha Plant */ /* Fire Piranha Plant */
#define /*0x0F4*/ oFirePiranhaPlantNeutralScale OBJECT_FIELD_F32(0x1B) #define /*0x0F4*/ oFirePiranhaPlantNeutralScale OBJECT_FIELD_F32(0x1B)
#define /*0x0F8*/ oFirePiranhaPlantScale OBJECT_FIELD_F32(0x1C) //Shared with above obj? Coincidence? #define /*0x0F8*/ oFirePiranhaPlantScale OBJECT_FIELD_F32(0x1C) // Shared with above obj? Coincidence?
#define /*0x0FC*/ oFirePiranhaPlantActive OBJECT_FIELD_S32(0x1D) #define /*0x0FC*/ oFirePiranhaPlantActive OBJECT_FIELD_S32(0x1D)
#define /*0x100*/ oFirePiranhaPlantDeathSpinTimer OBJECT_FIELD_S32(0x1E) #define /*0x100*/ oFirePiranhaPlantDeathSpinTimer OBJECT_FIELD_S32(0x1E)
#define /*0x104*/ oFirePiranhaPlantDeathSpinVel OBJECT_FIELD_F32(0x1F) #define /*0x104*/ oFirePiranhaPlantDeathSpinVel OBJECT_FIELD_F32(0x1F)
@ -792,9 +792,9 @@
#define /*0x10C*/ oPlatformOnTrackYaw OBJECT_FIELD_S32(0x21) #define /*0x10C*/ oPlatformOnTrackYaw OBJECT_FIELD_S32(0x21)
#define /*0x110*/ oPlatformOnTrackOffsetY OBJECT_FIELD_F32(0x22) #define /*0x110*/ oPlatformOnTrackOffsetY OBJECT_FIELD_F32(0x22)
#define /*0x1AC*/ oPlatformOnTrackIsNotSkiLift OBJECT_FIELD_S16(0x49, 0) #define /*0x1AC*/ oPlatformOnTrackIsNotSkiLift OBJECT_FIELD_S16(0x49, 0)
#define /*0x1AE*/ oPlatformOnTrackIsNotHMC OBJECT_FIELD_S16(0x49, + 1) #define /*0x1AE*/ oPlatformOnTrackIsNotHMC OBJECT_FIELD_S16(0x49, 1)
#define /*0x1B0*/ oPlatformOnTrackType OBJECT_FIELD_S16(0x4A, 0) #define /*0x1B0*/ oPlatformOnTrackType OBJECT_FIELD_S16(0x4A, 0)
#define /*0x1B2*/ oPlatformOnTrackWasStoodOn OBJECT_FIELD_S16(0x4A, + 1) #define /*0x1B2*/ oPlatformOnTrackWasStoodOn OBJECT_FIELD_S16(0x4A, 1)
/* Platform Spawner */ /* Platform Spawner */
#define /*0x0F4*/ oPlatformSpawnerUnkF4 OBJECT_FIELD_S32(0x1B) #define /*0x0F4*/ oPlatformSpawnerUnkF4 OBJECT_FIELD_S32(0x1B)
@ -858,7 +858,7 @@
/* Skeeter */ /* Skeeter */
#define /*0x0F4*/ oSkeeterTargetAngle OBJECT_FIELD_S32(0x1B) #define /*0x0F4*/ oSkeeterTargetAngle OBJECT_FIELD_S32(0x1B)
#define /*0x0F8*/ oSkeeterUnkF8 OBJECT_FIELD_S32(0x1C) #define /*0x0F8*/ oSkeeterTurningAwayFromWall OBJECT_FIELD_S32(0x1C)
#define /*0x0FC*/ oSkeeterUnkFC OBJECT_FIELD_F32(0x1D) #define /*0x0FC*/ oSkeeterUnkFC OBJECT_FIELD_F32(0x1D)
#define /*0x100*/ oSkeeterWaitTime OBJECT_FIELD_S32(0x1E) #define /*0x100*/ oSkeeterWaitTime OBJECT_FIELD_S32(0x1E)
#define /*0x1AC*/ oSkeeterUnk1AC OBJECT_FIELD_S16(0x49, 0) #define /*0x1AC*/ oSkeeterUnk1AC OBJECT_FIELD_S16(0x49, 0)
@ -875,7 +875,7 @@
#define /*0x0F4*/ oSmokeTimer OBJECT_FIELD_S32(0x1B) #define /*0x0F4*/ oSmokeTimer OBJECT_FIELD_S32(0x1B)
/* Snowman's Bottom */ /* Snowman's Bottom */
#define /*0x0F4*/ oSnowmansBottomUnkF4 OBJECT_FIELD_F32(0x1B) #define /*0x0F4*/ oSnowmansBottomScale OBJECT_FIELD_F32(0x1B)
#define /*0x0F8*/ oSnowmansBottomUnkF8 OBJECT_FIELD_S32(0x1C) #define /*0x0F8*/ oSnowmansBottomUnkF8 OBJECT_FIELD_S32(0x1C)
#define /*0x1AC*/ oSnowmansBottomUnk1AC OBJECT_FIELD_S32(0x49) #define /*0x1AC*/ oSnowmansBottomUnk1AC OBJECT_FIELD_S32(0x49)
// 0x1D-0x21 reserved for pathing // 0x1D-0x21 reserved for pathing
@ -894,9 +894,9 @@
#define /*0x108*/ oSnufitBodyBaseScale OBJECT_FIELD_S32(0x20) #define /*0x108*/ oSnufitBodyBaseScale OBJECT_FIELD_S32(0x20)
#define /*0x10C*/ oSnufitBullets OBJECT_FIELD_S32(0x21) #define /*0x10C*/ oSnufitBullets OBJECT_FIELD_S32(0x21)
#define /*0x1AC*/ oSnufitXOffset OBJECT_FIELD_S16(0x49, 0) #define /*0x1AC*/ oSnufitXOffset OBJECT_FIELD_S16(0x49, 0)
#define /*0x1AE*/ oSnufitYOffset OBJECT_FIELD_S16(0x49, + 1) #define /*0x1AE*/ oSnufitYOffset OBJECT_FIELD_S16(0x49, 1)
#define /*0x1B0*/ oSnufitZOffset OBJECT_FIELD_S16(0x4A, 0) #define /*0x1B0*/ oSnufitZOffset OBJECT_FIELD_S16(0x4A, 0)
#define /*0x1B2*/ oSnufitBodyScale OBJECT_FIELD_S16(0x4A, + 1) #define /*0x1B2*/ oSnufitBodyScale OBJECT_FIELD_S16(0x4A, 1)
/* Spindel */ /* Spindel */
#define /*0x0F4*/ oSpindelUnkF4 OBJECT_FIELD_S32(0x1B) #define /*0x0F4*/ oSpindelUnkF4 OBJECT_FIELD_S32(0x1B)
@ -1065,7 +1065,7 @@
#define /*0x110*/ oUnagiUnk110 OBJECT_FIELD_F32(0x22) #define /*0x110*/ oUnagiUnk110 OBJECT_FIELD_F32(0x22)
#define /*0x1AC*/ oUnagiUnk1AC OBJECT_FIELD_F32(0x49) #define /*0x1AC*/ oUnagiUnk1AC OBJECT_FIELD_F32(0x49)
#define /*0x1B0*/ oUnagiUnk1B0 OBJECT_FIELD_S16(0x4A, 0) #define /*0x1B0*/ oUnagiUnk1B0 OBJECT_FIELD_S16(0x4A, 0)
#define /*0x1B2*/ oUnagiUnk1B2 OBJECT_FIELD_S16(0x4A, + 1) #define /*0x1B2*/ oUnagiUnk1B2 OBJECT_FIELD_S16(0x4A, 1)
/* Water Bomb */ /* Water Bomb */
#define /*0x0F8*/ oWaterBombVerticalStretch OBJECT_FIELD_F32(0x1C) #define /*0x0F8*/ oWaterBombVerticalStretch OBJECT_FIELD_F32(0x1C)
@ -1144,7 +1144,7 @@
#define /*0x10C*/ oWigglerTargetYaw OBJECT_FIELD_S32(0x21) #define /*0x10C*/ oWigglerTargetYaw OBJECT_FIELD_S32(0x21)
#define /*0x110*/ oWigglerWalkAwayFromWallTimer OBJECT_FIELD_S32(0x22) #define /*0x110*/ oWigglerWalkAwayFromWallTimer OBJECT_FIELD_S32(0x22)
#define /*0x1AC*/ oWigglerUnused OBJECT_FIELD_S16(0x49, 0) #define /*0x1AC*/ oWigglerUnused OBJECT_FIELD_S16(0x49, 0)
#define /*0x1AE*/ oWigglerTextStatus OBJECT_FIELD_S16(0x49, + 1) #define /*0x1AE*/ oWigglerTextStatus OBJECT_FIELD_S16(0x49, 1)
/* Lll Wood Piece */ /* Lll Wood Piece */
#define /*0x0F4*/ oLllWoodPieceOscillationTimer OBJECT_FIELD_S32(0x1B) #define /*0x0F4*/ oLllWoodPieceOscillationTimer OBJECT_FIELD_S32(0x1B)

View file

@ -291,18 +291,23 @@
#define SOUND_GENERAL_PLATFORM /* 0x302D8080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x2D, 0x80, SOUND_DISCRETE) // unverified #define SOUND_GENERAL_PLATFORM /* 0x302D8080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x2D, 0x80, SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_DONUT_PLATFORM_EXPLOSION /* 0x302E2080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x2E, 0x20, SOUND_DISCRETE) #define SOUND_GENERAL_DONUT_PLATFORM_EXPLOSION /* 0x302E2080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x2E, 0x20, SOUND_DISCRETE)
#define SOUND_GENERAL_BOWSER_BOMB_EXPLOSION /* 0x312F0080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x2F, 0x00, SOUND_NO_VOLUME_LOSS | SOUND_DISCRETE) #define SOUND_GENERAL_BOWSER_BOMB_EXPLOSION /* 0x312F0080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x2F, 0x00, SOUND_NO_VOLUME_LOSS | SOUND_DISCRETE)
#if defined(VERSION_JP)
#define SOUND_GENERAL_COIN_SPURT /* 0x30300080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x30, 0x00, SOUND_DISCRETE) // unverified #define SOUND_GENERAL_COIN_SPURT /* 0x30300080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x30, 0x00, SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_COIN_SPURT_2 /* 0x38300080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x30, 0x00, SOUND_CONSTANT_FREQUENCY | SOUND_DISCRETE) // unverified #elif defined(VERSION_US)
#define SOUND_GENERAL_COIN_SPURT_EU /* 0x38302080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x30, 0x20, SOUND_CONSTANT_FREQUENCY | SOUND_DISCRETE) // unverified #define SOUND_GENERAL_COIN_SPURT /* 0x38300080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x30, 0x00, SOUND_CONSTANT_FREQUENCY | SOUND_DISCRETE) // unverified
#else
#define SOUND_GENERAL_COIN_SPURT /* 0x38302080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x30, 0x20, SOUND_CONSTANT_FREQUENCY | SOUND_DISCRETE) // unverified
#endif
#define SOUND_GENERAL_EXPLOSION6 /* 0x30310000 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x31, 0x00, 0) // unverified, unused #define SOUND_GENERAL_EXPLOSION6 /* 0x30310000 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x31, 0x00, 0) // unverified, unused
#define SOUND_GENERAL_UNK32 /* 0x30320000 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x32, 0x00, 0) // unverified, unused #define SOUND_GENERAL_UNK32 /* 0x30320000 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x32, 0x00, 0) // unverified, unused
#define SOUND_GENERAL_BOAT_TILT1 /* 0x30344080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x34, 0x40, SOUND_DISCRETE) // unverified #define SOUND_GENERAL_BOAT_TILT1 /* 0x30344080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x34, 0x40, SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_BOAT_TILT2 /* 0x30354080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x35, 0x40, SOUND_DISCRETE) // unverified #define SOUND_GENERAL_BOAT_TILT2 /* 0x30354080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x35, 0x40, SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_COIN_DROP /* 0x30364080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x36, 0x40, SOUND_DISCRETE) // unverified #define SOUND_GENERAL_COIN_DROP /* 0x30364080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x36, 0x40, SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_UNKNOWN3_LOWPRIO /* 0x30370080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x37, 0x00, SOUND_DISCRETE) // unverified #ifdef VERSION_JP
#define SOUND_GENERAL_UNKNOWN3 /* 0x30378080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x37, 0x80, SOUND_DISCRETE) // unverified #define SOUND_GENERAL_UNKNOWN3 /* 0x30370080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x37, 0x00, SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_UNKNOWN3_2 /* 0x38378080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x37, 0x80, SOUND_CONSTANT_FREQUENCY | SOUND_DISCRETE) // unverified #else
#define SOUND_GENERAL_UNKNOWN3 /* 0x38378080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x37, 0x80, SOUND_CONSTANT_FREQUENCY | SOUND_DISCRETE) // unverified
#endif
#define SOUND_GENERAL_PENDULUM_SWING /* 0x30380080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x38, 0x00, SOUND_DISCRETE) #define SOUND_GENERAL_PENDULUM_SWING /* 0x30380080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x38, 0x00, SOUND_DISCRETE)
#define SOUND_GENERAL_CHAIN_CHOMP1 /* 0x30390080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x39, 0x00, SOUND_DISCRETE) // unverified #define SOUND_GENERAL_CHAIN_CHOMP1 /* 0x30390080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x39, 0x00, SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_CHAIN_CHOMP2 /* 0x303A0080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x3A, 0x00, SOUND_DISCRETE) // unverified #define SOUND_GENERAL_CHAIN_CHOMP2 /* 0x303A0080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x3A, 0x00, SOUND_DISCRETE) // unverified
@ -319,8 +324,11 @@
#define SOUND_GENERAL_QUIET_POUND2 /* 0x30430080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x43, 0x00, SOUND_DISCRETE) // unverified #define SOUND_GENERAL_QUIET_POUND2 /* 0x30430080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x43, 0x00, SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_BIG_POUND /* 0x30440080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x44, 0x00, SOUND_DISCRETE) // unverified #define SOUND_GENERAL_BIG_POUND /* 0x30440080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x44, 0x00, SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_UNK45 /* 0x30450080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x45, 0x00, SOUND_DISCRETE) // unverified #define SOUND_GENERAL_UNK45 /* 0x30450080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x45, 0x00, SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_UNK46_LOWPRIO /* 0x30460080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x46, 0x00, SOUND_DISCRETE) // unverified #ifdef VERSION_JP
#define SOUND_GENERAL_UNK46 /* 0x30460080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x46, 0x00, SOUND_DISCRETE) // unverified
#else
#define SOUND_GENERAL_UNK46 /* 0x30468080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x46, 0x80, SOUND_DISCRETE) // unverified #define SOUND_GENERAL_UNK46 /* 0x30468080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x46, 0x80, SOUND_DISCRETE) // unverified
#endif
#define SOUND_GENERAL_CANNON_UP /* 0x30478080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x47, 0x80, SOUND_DISCRETE) // unverified #define SOUND_GENERAL_CANNON_UP /* 0x30478080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x47, 0x80, SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_GRINDEL_ROLL /* 0x30480080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x48, 0x00, SOUND_DISCRETE) // unverified #define SOUND_GENERAL_GRINDEL_ROLL /* 0x30480080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x48, 0x00, SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_EXPLOSION7 /* 0x30490000 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x49, 0x00, 0) // unverified, unused #define SOUND_GENERAL_EXPLOSION7 /* 0x30490000 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x49, 0x00, 0) // unverified, unused
@ -412,7 +420,7 @@
#define SOUND_OBJ_MRI_DEATH /* 0x50140080 */ SOUND_ARG_LOAD(SOUND_BANK_OBJ, 0x14, 0x00, SOUND_DISCRETE) #define SOUND_OBJ_MRI_DEATH /* 0x50140080 */ SOUND_ARG_LOAD(SOUND_BANK_OBJ, 0x14, 0x00, SOUND_DISCRETE)
#define SOUND_OBJ_POUNDING1 /* 0x50155080 */ SOUND_ARG_LOAD(SOUND_BANK_OBJ, 0x15, 0x50, SOUND_DISCRETE) // unverified #define SOUND_OBJ_POUNDING1 /* 0x50155080 */ SOUND_ARG_LOAD(SOUND_BANK_OBJ, 0x15, 0x50, SOUND_DISCRETE) // unverified
#define SOUND_OBJ_POUNDING1_HIGHPRIO /* 0x50158080 */ SOUND_ARG_LOAD(SOUND_BANK_OBJ, 0x15, 0x80, SOUND_DISCRETE) // unverified #define SOUND_OBJ_POUNDING1_HIGHPRIO /* 0x50158080 */ SOUND_ARG_LOAD(SOUND_BANK_OBJ, 0x15, 0x80, SOUND_DISCRETE) // unverified
#define SOUND_OBJ_WHOMP_LOWPRIO /* 0x50166080 */ SOUND_ARG_LOAD(SOUND_BANK_OBJ, 0x16, 0x60, SOUND_DISCRETE) #define SOUND_OBJ_WHOMP /* 0x50166080 */ SOUND_ARG_LOAD(SOUND_BANK_OBJ, 0x16, 0x60, SOUND_DISCRETE)
#define SOUND_OBJ_KING_BOBOMB /* 0x50168080 */ SOUND_ARG_LOAD(SOUND_BANK_OBJ, 0x16, 0x80, SOUND_DISCRETE) #define SOUND_OBJ_KING_BOBOMB /* 0x50168080 */ SOUND_ARG_LOAD(SOUND_BANK_OBJ, 0x16, 0x80, SOUND_DISCRETE)
#define SOUND_OBJ_BULLY_METAL /* 0x50178080 */ SOUND_ARG_LOAD(SOUND_BANK_OBJ, 0x17, 0x80, SOUND_DISCRETE) // unverified #define SOUND_OBJ_BULLY_METAL /* 0x50178080 */ SOUND_ARG_LOAD(SOUND_BANK_OBJ, 0x17, 0x80, SOUND_DISCRETE) // unverified
#define SOUND_OBJ_BULLY_EXPLODE /* 0x5018A080 */ SOUND_ARG_LOAD(SOUND_BANK_OBJ, 0x18, 0xA0, SOUND_DISCRETE) // unverified #define SOUND_OBJ_BULLY_EXPLODE /* 0x5018A080 */ SOUND_ARG_LOAD(SOUND_BANK_OBJ, 0x18, 0xA0, SOUND_DISCRETE) // unverified
@ -516,8 +524,11 @@
/* Menu Sound Effects */ /* Menu Sound Effects */
#define SOUND_MENU_CHANGE_SELECT /* 0x7000F880 */ SOUND_ARG_LOAD(SOUND_BANK_MENU, 0x00, 0xF8, SOUND_DISCRETE) #define SOUND_MENU_CHANGE_SELECT /* 0x7000F880 */ SOUND_ARG_LOAD(SOUND_BANK_MENU, 0x00, 0xF8, SOUND_DISCRETE)
#define SOUND_MENU_REVERSE_PAUSE /* 0x70010000 */ SOUND_ARG_LOAD(SOUND_BANK_MENU, 0x01, 0x00, 0) // unverified, unused #define SOUND_MENU_REVERSE_PAUSE /* 0x70010000 */ SOUND_ARG_LOAD(SOUND_BANK_MENU, 0x01, 0x00, 0) // unverified, unused
#ifdef VERSION_JP
#define SOUND_MENU_PAUSE /* 0x7002F080 */ SOUND_ARG_LOAD(SOUND_BANK_MENU, 0x02, 0xF0, SOUND_DISCRETE) #define SOUND_MENU_PAUSE /* 0x7002F080 */ SOUND_ARG_LOAD(SOUND_BANK_MENU, 0x02, 0xF0, SOUND_DISCRETE)
#define SOUND_MENU_PAUSE_HIGHPRIO /* 0x7002FF80 */ SOUND_ARG_LOAD(SOUND_BANK_MENU, 0x02, 0xFF, SOUND_DISCRETE) #else
#define SOUND_MENU_PAUSE /* 0x7002FF80 */ SOUND_ARG_LOAD(SOUND_BANK_MENU, 0x02, 0xFF, SOUND_DISCRETE)
#endif
#define SOUND_MENU_PAUSE_2 /* 0x7003FF80 */ SOUND_ARG_LOAD(SOUND_BANK_MENU, 0x03, 0xFF, SOUND_DISCRETE) #define SOUND_MENU_PAUSE_2 /* 0x7003FF80 */ SOUND_ARG_LOAD(SOUND_BANK_MENU, 0x03, 0xFF, SOUND_DISCRETE)
#define SOUND_MENU_MESSAGE_APPEAR /* 0x70040080 */ SOUND_ARG_LOAD(SOUND_BANK_MENU, 0x04, 0x00, SOUND_DISCRETE) #define SOUND_MENU_MESSAGE_APPEAR /* 0x70040080 */ SOUND_ARG_LOAD(SOUND_BANK_MENU, 0x04, 0x00, SOUND_DISCRETE)
#define SOUND_MENU_MESSAGE_DISAPPEAR /* 0x70050080 */ SOUND_ARG_LOAD(SOUND_BANK_MENU, 0x05, 0x00, SOUND_DISCRETE) #define SOUND_MENU_MESSAGE_DISAPPEAR /* 0x70050080 */ SOUND_ARG_LOAD(SOUND_BANK_MENU, 0x05, 0x00, SOUND_DISCRETE)

View file

@ -12,8 +12,7 @@
#define SPTYPE_UNKNOWN 3 // object is 14-bytes long, has 3 extra shorts that get converted to floats. #define SPTYPE_UNKNOWN 3 // object is 14-bytes long, has 3 extra shorts that get converted to floats.
#define SPTYPE_DEF_PARAM_AND_YROT 4 // object is 10-bytes long, has y-rotation and uses the default param #define SPTYPE_DEF_PARAM_AND_YROT 4 // object is 10-bytes long, has y-rotation and uses the default param
struct SpecialPreset struct SpecialPreset {
{
/*00*/ u8 preset_id; /*00*/ u8 preset_id;
/*01*/ u8 type; // Determines whether object is 8, 10, 12 or 14 bytes long. /*01*/ u8 type; // Determines whether object is 8, 10, 12 or 14 bytes long.
/*02*/ u8 defParam; // Default parameter, only used when type is SPTYPE_DEF_PARAM_AND_YROT /*02*/ u8 defParam; // Default parameter, only used when type is SPTYPE_DEF_PARAM_AND_YROT
@ -23,8 +22,7 @@ struct SpecialPreset
// Some Models ID's are missing their names because they are probably unused // Some Models ID's are missing their names because they are probably unused
static struct SpecialPreset SpecialObjectPresets[] = static struct SpecialPreset SpecialObjectPresets[] = {
{
{0x00, SPTYPE_YROT_NO_PARAMS , 0x00, MODEL_NONE, NULL}, {0x00, SPTYPE_YROT_NO_PARAMS , 0x00, MODEL_NONE, NULL},
{0x01, SPTYPE_NO_YROT_OR_PARAMS , 0x00, MODEL_YELLOW_COIN, bhvYellowCoin}, {0x01, SPTYPE_NO_YROT_OR_PARAMS , 0x00, MODEL_YELLOW_COIN, bhvYellowCoin},
{0x02, SPTYPE_NO_YROT_OR_PARAMS , 0x00, MODEL_YELLOW_COIN, bhvYellowCoin}, {0x02, SPTYPE_NO_YROT_OR_PARAMS , 0x00, MODEL_YELLOW_COIN, bhvYellowCoin},

View file

@ -43,13 +43,13 @@
#define SURFACE_HARD_VERY_SLIPPERY 0x0036 // Hard and very slippery (Always has fall damage) #define SURFACE_HARD_VERY_SLIPPERY 0x0036 // Hard and very slippery (Always has fall damage)
#define SURFACE_HARD_NOT_SLIPPERY 0x0037 // Hard and Non-slippery (Always has fall damage) #define SURFACE_HARD_NOT_SLIPPERY 0x0037 // Hard and Non-slippery (Always has fall damage)
#define SURFACE_VERTICAL_WIND 0x0038 // Death at bottom with vertical wind #define SURFACE_VERTICAL_WIND 0x0038 // Death at bottom with vertical wind
#define SURFACE_BOSS_FIGHT_CAMERA 0x0065 // Wide camera for BOB and WF bosses #define SURFACE_BOSS_FIGHT_CAMERA 0x0065 // Wide camera for BoB and WF bosses
#define SURFACE_CAMERA_FREE_ROAM 0x0066 // Free roam camera for THI and TTC #define SURFACE_CAMERA_FREE_ROAM 0x0066 // Free roam camera for THI and TTC
#define SURFACE_THI3_WALLKICK 0x0068 // Surface where there's a wall kick section in THI 3rd area, has no action defined #define SURFACE_THI3_WALLKICK 0x0068 // Surface where there's a wall kick section in THI 3rd area, has no action defined
#define SURFACE_CAMERA_8_DIR 0x0069 // Surface that enables far camera for platforms, used in THI #define SURFACE_CAMERA_8_DIR 0x0069 // Surface that enables far camera for platforms, used in THI
#define SURFACE_CAMERA_MIDDLE 0x006E // Surface camera that returns to the middle, used on the 4 pillars of SSL #define SURFACE_CAMERA_MIDDLE 0x006E // Surface camera that returns to the middle, used on the 4 pillars of SSL
#define SURFACE_CAMERA_ROTATE_RIGHT 0x006F // Surface camera that rotates to the right (Bowser 1 & THI) #define SURFACE_CAMERA_ROTATE_RIGHT 0x006F // Surface camera that rotates to the right (Bowser 1 & THI)
#define SURFACE_CAMERA_ROTATE_LEFT 0x0070 // Surface camera that rotates to the left (BOB & TTM) #define SURFACE_CAMERA_ROTATE_LEFT 0x0070 // Surface camera that rotates to the left (BoB & TTM)
#define SURFACE_CAMERA_BOUNDARY 0x0072 // Intangible Area, only used to restrict camera movement #define SURFACE_CAMERA_BOUNDARY 0x0072 // Intangible Area, only used to restrict camera movement
#define SURFACE_NOISE_VERY_SLIPPERY_73 0x0073 // Very slippery floor with noise, unused #define SURFACE_NOISE_VERY_SLIPPERY_73 0x0073 // Very slippery floor with noise, unused
#define SURFACE_NOISE_VERY_SLIPPERY_74 0x0074 // Very slippery floor with noise, unused #define SURFACE_NOISE_VERY_SLIPPERY_74 0x0074 // Very slippery floor with noise, unused
@ -60,9 +60,9 @@
#define SURFACE_NO_CAM_COL_SLIPPERY 0x0079 // Surface with no cam collision flag, slippery with noise (CCM, PSS and TTM slides) #define SURFACE_NO_CAM_COL_SLIPPERY 0x0079 // Surface with no cam collision flag, slippery with noise (CCM, PSS and TTM slides)
#define SURFACE_SWITCH 0x007A // Surface with no cam collision flag, non-slippery with noise, used by switches and Dorrie #define SURFACE_SWITCH 0x007A // Surface with no cam collision flag, non-slippery with noise, used by switches and Dorrie
#define SURFACE_VANISH_CAP_WALLS 0x007B // Vanish cap walls, pass through them with Vanish Cap #define SURFACE_VANISH_CAP_WALLS 0x007B // Vanish cap walls, pass through them with Vanish Cap
#define SURFACE_PAINTING_WOBBLE_A6 0x00A6 // Painting wobble (BOB Left) #define SURFACE_PAINTING_WOBBLE_A6 0x00A6 // Painting wobble (BoB Left)
#define SURFACE_PAINTING_WOBBLE_A7 0x00A7 // Painting wobble (BOB Middle) #define SURFACE_PAINTING_WOBBLE_A7 0x00A7 // Painting wobble (BoB Middle)
#define SURFACE_PAINTING_WOBBLE_A8 0x00A8 // Painting wobble (BOB Right) #define SURFACE_PAINTING_WOBBLE_A8 0x00A8 // Painting wobble (BoB Right)
#define SURFACE_PAINTING_WOBBLE_A9 0x00A9 // Painting wobble (CCM Left) #define SURFACE_PAINTING_WOBBLE_A9 0x00A9 // Painting wobble (CCM Left)
#define SURFACE_PAINTING_WOBBLE_AA 0x00AA // Painting wobble (CCM Middle) #define SURFACE_PAINTING_WOBBLE_AA 0x00AA // Painting wobble (CCM Middle)
#define SURFACE_PAINTING_WOBBLE_AB 0x00AB // Painting wobble (CCM Right) #define SURFACE_PAINTING_WOBBLE_AB 0x00AB // Painting wobble (CCM Right)
@ -105,9 +105,9 @@
#define SURFACE_PAINTING_WOBBLE_D0 0x00D0 // Painting wobble (HMC & COTMC - Left), makes the painting wobble if touched #define SURFACE_PAINTING_WOBBLE_D0 0x00D0 // Painting wobble (HMC & COTMC - Left), makes the painting wobble if touched
#define SURFACE_PAINTING_WOBBLE_D1 0x00D1 // Painting wobble (Unused, HMC & COTMC - Middle) #define SURFACE_PAINTING_WOBBLE_D1 0x00D1 // Painting wobble (Unused, HMC & COTMC - Middle)
#define SURFACE_PAINTING_WOBBLE_D2 0x00D2 // Painting wobble (Unused, HMC & COTMC - Right) #define SURFACE_PAINTING_WOBBLE_D2 0x00D2 // Painting wobble (Unused, HMC & COTMC - Right)
#define SURFACE_PAINTING_WARP_D3 0x00D3 // Painting warp (BOB Left) #define SURFACE_PAINTING_WARP_D3 0x00D3 // Painting warp (BoB Left)
#define SURFACE_PAINTING_WARP_D4 0x00D4 // Painting warp (BOB Middle) #define SURFACE_PAINTING_WARP_D4 0x00D4 // Painting warp (BoB Middle)
#define SURFACE_PAINTING_WARP_D5 0x00D5 // Painting warp (BOB Right) #define SURFACE_PAINTING_WARP_D5 0x00D5 // Painting warp (BoB Right)
#define SURFACE_PAINTING_WARP_D6 0x00D6 // Painting warp (CCM Left) #define SURFACE_PAINTING_WARP_D6 0x00D6 // Painting warp (CCM Left)
#define SURFACE_PAINTING_WARP_D7 0x00D7 // Painting warp (CCM Middle) #define SURFACE_PAINTING_WARP_D7 0x00D7 // Painting warp (CCM Middle)
#define SURFACE_PAINTING_WARP_D8 0x00D8 // Painting warp (CCM Right) #define SURFACE_PAINTING_WARP_D8 0x00D8 // Painting warp (CCM Right)

View file

@ -20,8 +20,7 @@
#endif #endif
struct Controller struct Controller {
{
/*0x00*/ s16 rawStickX; // /*0x00*/ s16 rawStickX; //
/*0x02*/ s16 rawStickY; // /*0x02*/ s16 rawStickY; //
/*0x04*/ float stickX; // [-64, 64] positive is right /*0x04*/ float stickX; // [-64, 64] positive is right
@ -63,16 +62,14 @@ enum SpTaskState {
SPTASK_STATE_FINISHED_DP SPTASK_STATE_FINISHED_DP
}; };
struct SPTask struct SPTask {
{
/*0x00*/ OSTask task; /*0x00*/ OSTask task;
/*0x40*/ OSMesgQueue *msgqueue; /*0x40*/ OSMesgQueue *msgqueue;
/*0x44*/ OSMesg msg; /*0x44*/ OSMesg msg;
/*0x48*/ enum SpTaskState state; /*0x48*/ enum SpTaskState state;
}; // size = 0x4C, align = 0x8 }; // size = 0x4C, align = 0x8
struct VblankHandler struct VblankHandler {
{
OSMesgQueue *queue; OSMesgQueue *queue;
OSMesg msg; OSMesg msg;
}; };
@ -100,8 +97,7 @@ struct Animation {
#define ANIMINDEX_NUMPARTS(animindex) (sizeof(animindex) / sizeof(u16) / 6 - 1) #define ANIMINDEX_NUMPARTS(animindex) (sizeof(animindex) / sizeof(u16) / 6 - 1)
struct GraphNode struct GraphNode {
{
/*0x00*/ s16 type; // structure type /*0x00*/ s16 type; // structure type
/*0x02*/ s16 flags; // hi = drawing layer, lo = rendering modes /*0x02*/ s16 flags; // hi = drawing layer, lo = rendering modes
/*0x04*/ struct GraphNode *prev; /*0x04*/ struct GraphNode *prev;
@ -110,8 +106,7 @@ struct GraphNode
/*0x10*/ struct GraphNode *children; /*0x10*/ struct GraphNode *children;
}; };
struct AnimInfo struct AnimInfo {
{
/*0x00 0x38*/ s16 animID; /*0x00 0x38*/ s16 animID;
/*0x02 0x3A*/ s16 animYTrans; /*0x02 0x3A*/ s16 animYTrans;
/*0x04 0x3C*/ struct Animation *curAnim; /*0x04 0x3C*/ struct Animation *curAnim;
@ -121,8 +116,7 @@ struct AnimInfo
/*0x10 0x48*/ s32 animAccel; /*0x10 0x48*/ s32 animAccel;
}; };
struct GraphNodeObject struct GraphNodeObject {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ struct GraphNode *sharedChild; /*0x14*/ struct GraphNode *sharedChild;
/*0x18*/ s8 areaIndex; /*0x18*/ s8 areaIndex;
@ -136,8 +130,7 @@ struct GraphNodeObject
/*0x54*/ Vec3f cameraToObject; /*0x54*/ Vec3f cameraToObject;
}; };
struct ObjectNode struct ObjectNode {
{
struct GraphNodeObject gfx; struct GraphNodeObject gfx;
struct ObjectNode *next; struct ObjectNode *next;
struct ObjectNode *prev; struct ObjectNode *prev;
@ -146,8 +139,7 @@ struct ObjectNode
// NOTE: Since ObjectNode is the first member of Object, it is difficult to determine // NOTE: Since ObjectNode is the first member of Object, it is difficult to determine
// whether some of these pointers point to ObjectNode or Object. // whether some of these pointers point to ObjectNode or Object.
struct Object struct Object {
{
/*0x000*/ struct ObjectNode header; /*0x000*/ struct ObjectNode header;
/*0x068*/ struct Object *parentObj; /*0x068*/ struct Object *parentObj;
/*0x06C*/ struct Object *prevObj; /*0x06C*/ struct Object *prevObj;
@ -156,8 +148,7 @@ struct Object
/*0x076*/ s16 numCollidedObjs; /*0x076*/ s16 numCollidedObjs;
/*0x078*/ struct Object *collidedObjs[4]; /*0x078*/ struct Object *collidedObjs[4];
/*0x088*/ /*0x088*/
union union {
{
// Object fields. See object_fields.h. // Object fields. See object_fields.h.
u32 asU32[0x50]; u32 asU32[0x50];
s32 asS32[0x50]; s32 asS32[0x50];
@ -207,8 +198,7 @@ struct Object
/*0x25C*/ void *respawnInfo; /*0x25C*/ void *respawnInfo;
}; };
struct ObjectHitbox struct ObjectHitbox {
{
/*0x00*/ u32 interactType; /*0x00*/ u32 interactType;
/*0x04*/ u8 downOffset; /*0x04*/ u8 downOffset;
/*0x05*/ s8 damageOrCoinValue; /*0x05*/ s8 damageOrCoinValue;
@ -220,14 +210,12 @@ struct ObjectHitbox
/*0x0E*/ s16 hurtboxHeight; /*0x0E*/ s16 hurtboxHeight;
}; };
struct Waypoint struct Waypoint {
{
s16 flags; s16 flags;
Vec3s pos; Vec3s pos;
}; };
struct Surface struct Surface {
{
/*0x00*/ s16 type; /*0x00*/ s16 type;
/*0x02*/ s16 force; /*0x02*/ s16 force;
/*0x04*/ s8 flags; /*0x04*/ s8 flags;
@ -246,8 +234,7 @@ struct Surface
/*0x2C*/ struct Object *object; /*0x2C*/ struct Object *object;
}; };
struct MarioBodyState struct MarioBodyState {
{
/*0x00*/ u32 action; /*0x00*/ u32 action;
/*0x04*/ s8 capState; /// see MarioCapGSCId /*0x04*/ s8 capState; /// see MarioCapGSCId
/*0x05*/ s8 eyeState; /*0x05*/ s8 eyeState;
@ -259,11 +246,10 @@ struct MarioBodyState
/*0x0C*/ Vec3s torsoAngle; /*0x0C*/ Vec3s torsoAngle;
/*0x12*/ Vec3s headAngle; /*0x12*/ Vec3s headAngle;
/*0x18*/ Vec3f heldObjLastPosition; /// also known as HOLP /*0x18*/ Vec3f heldObjLastPosition; /// also known as HOLP
u8 padding[4]; u8 filler[4];
}; };
struct MarioState struct MarioState {
{
/*0x00*/ u16 unk00; /*0x00*/ u16 unk00;
/*0x02*/ u16 input; /*0x02*/ u16 input;
/*0x04*/ u32 flags; /*0x04*/ u32 flags;

View file

@ -3742,7 +3742,7 @@ const Collision bbh_seg7_collision_level[] = {
COL_TRI(12, 14, 15), COL_TRI(12, 14, 15),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(26), COL_SPECIAL_INIT(26),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 1434, -204, 4710, /*yaw*/ 128), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 1434, -204, 4710, /*yaw*/ 128), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_haunted_door, /*pos*/ 0, -2457, 2099, /*yaw*/ 128), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_haunted_door, /*pos*/ 0, -2457, 2099, /*yaw*/ 128),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_haunted_door, /*pos*/ -1996, -2457, 205, /*yaw*/ 192), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_haunted_door, /*pos*/ -1996, -2457, 205, /*yaw*/ 192),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_haunted_door, /*pos*/ 1587, -2457, 205, /*yaw*/ 64), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_haunted_door, /*pos*/ 1587, -2457, 205, /*yaw*/ 64),

View file

@ -1324,7 +1324,7 @@ const Collision bitdw_seg7_collision_level[] = {
COL_TRI(485, 486, 489), COL_TRI(485, 486, 489),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(23), COL_SPECIAL_INIT(23),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -7443, -3153, 3886, /*yaw*/ 64), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -7443, -3153, 3886, /*yaw*/ 64), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -6368, -3972, 3883, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -6368, -3972, 3883, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ -3245, -3358, 3893, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ -3245, -3358, 3893, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_05, /*pos*/ -2405, -1228, 1740, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_05, /*pos*/ -2405, -1228, 1740, /*yaw*/ 0),

View file

@ -2053,7 +2053,7 @@ const Collision bitfs_seg7_collision_level[] = {
COL_TRI(801, 802, 509), COL_TRI(801, 802, 509),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(24), COL_SPECIAL_INIT(24),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -7577, -2764, 0, /*yaw*/ 64), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -7577, -2764, 0, /*yaw*/ 64), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -5938, -3071, 0, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -5938, -3071, 0, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ -5488, -1535, 41, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ -5488, -1535, 41, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ 4342, 1741, 41, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ 4342, 1741, 41, /*yaw*/ 0),

View file

@ -2400,7 +2400,7 @@ const Collision bits_seg7_collision_level[] = {
COL_TRI(135, 216, 214), COL_TRI(135, 216, 214),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(22), COL_SPECIAL_INIT(22),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -7039, -4812, 4, /*yaw*/ 64), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -7039, -4812, 4, /*yaw*/ 64), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -4505, -5119, 0, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -4505, -5119, 0, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ -2291, -2073, -762, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ -2291, -2073, -762, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_05, /*pos*/ 3891, -3276, -705, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_05, /*pos*/ 3891, -3276, -705, /*yaw*/ 0),

View file

@ -77,7 +77,7 @@ const Collision bowser_1_seg7_collision_level[] = {
COL_TRI(25, 27, 28), COL_TRI(25, 27, 28),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(22), COL_SPECIAL_INIT(22),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 0, 1843, 0, /*yaw*/ 1423), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 0, 1843, 0, /*yaw*/ 1423), // unused, probably an early way to set initial position
SPECIAL_OBJECT(/*preset*/ special_mine, /*pos*/ 2949, 589, 0), SPECIAL_OBJECT(/*preset*/ special_mine, /*pos*/ 2949, 589, 0),
SPECIAL_OBJECT(/*preset*/ special_mine, /*pos*/ 0, 589, -2949), SPECIAL_OBJECT(/*preset*/ special_mine, /*pos*/ 0, 589, -2949),
SPECIAL_OBJECT(/*preset*/ special_mine, /*pos*/ 0, 589, 2949), SPECIAL_OBJECT(/*preset*/ special_mine, /*pos*/ 0, 589, 2949),

View file

@ -19,7 +19,7 @@ const Collision bowser_2_seg7_collision_lava[] = {
COL_TRI(0, 5, 7), COL_TRI(0, 5, 7),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(2), COL_SPECIAL_INIT(2),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 0, 1229, 0, /*yaw*/ 128), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 0, 1229, 0, /*yaw*/ 128), // unused, probably an early way to set initial position
SPECIAL_OBJECT(/*preset*/ special_bowser, /*pos*/ -8, 1229, -1418), SPECIAL_OBJECT(/*preset*/ special_bowser, /*pos*/ -8, 1229, -1418),
COL_END(), COL_END(),
}; };

View file

@ -68,7 +68,7 @@ const Collision bowser_3_seg7_collision_level[] = {
COL_TRI(0, 2, 3), COL_TRI(0, 2, 3),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(7), COL_SPECIAL_INIT(7),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 0, 307, 0, /*yaw*/ 128), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 0, 307, 0, /*yaw*/ 128), // unused, probably an early way to set initial position
SPECIAL_OBJECT(/*preset*/ special_bowser, /*pos*/ 13, 307, -1024), SPECIAL_OBJECT(/*preset*/ special_bowser, /*pos*/ 13, 307, -1024),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -3362, -204, 1121, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -3362, -204, 1121, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 0, -204, 3584, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 0, -204, 3584, /*yaw*/ 0),

View file

@ -847,7 +847,7 @@ const Collision castle_courtyard_seg7_collision[] = {
COL_TRI(136, 45, 133), COL_TRI(136, 45, 133),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(19), COL_SPECIAL_INIT(19),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 15, 0, 202, /*yaw*/ 128), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 15, 0, 202, /*yaw*/ 128), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 0, 2048, 2662, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 0, 2048, 2662, /*yaw*/ 0),
SPECIAL_OBJECT(/*preset*/ special_spiky_tree, /*pos*/ 2272, -214, -1432), SPECIAL_OBJECT(/*preset*/ special_spiky_tree, /*pos*/ 2272, -214, -1432),
SPECIAL_OBJECT(/*preset*/ special_spiky_tree, /*pos*/ 818, 10, 203), SPECIAL_OBJECT(/*preset*/ special_spiky_tree, /*pos*/ 818, 10, 203),

View file

@ -3741,7 +3741,7 @@ const Collision inside_castle_seg7_area_1_collision[] = {
COL_TRI(77, 79, 80), COL_TRI(77, 79, 80),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(11), COL_SPECIAL_INIT(11),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -1023, 0, 1152, /*yaw*/ 128), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -1023, 0, 1152, /*yaw*/ 128), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_wooden_door, /*pos*/ -271, 0, -824, /*yaw*/ 32), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_wooden_door, /*pos*/ -271, 0, -824, /*yaw*/ 32),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_wooden_door, /*pos*/ -1775, 0, -824, /*yaw*/ 224), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_wooden_door, /*pos*/ -1775, 0, -824, /*yaw*/ 224),
SPECIAL_OBJECT_WITH_YAW_AND_PARAM(/*preset*/ special_castle_door_warp, /*pos*/ -1100, 0, 2202, /*yaw*/ 0, /*behParam2*/ 0), SPECIAL_OBJECT_WITH_YAW_AND_PARAM(/*preset*/ special_castle_door_warp, /*pos*/ -1100, 0, 2202, /*yaw*/ 0, /*behParam2*/ 0),

View file

@ -1747,7 +1747,7 @@ const Collision ccm_seg7_area_1_collision[] = {
COL_TRI(336, 609, 616), COL_TRI(336, 609, 616),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(21), COL_SPECIAL_INIT(21),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -1512, 2560, -2305, /*yaw*/ 100), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -1512, 2560, -2305, /*yaw*/ 100), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -409, 2765, -1637, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -409, 2765, -1637, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ 2355, -4095, 4096, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ 2355, -4095, 4096, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_05, /*pos*/ -4210, -1446, 1874, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_05, /*pos*/ -4210, -1446, 1874, /*yaw*/ 0),

View file

@ -1873,7 +1873,7 @@ const Collision ccm_seg7_area_2_collision[] = {
COL_TRI(19, 23, 24), COL_TRI(19, 23, 24),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(2), COL_SPECIAL_INIT(2),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -5836, 7465, -6143, /*yaw*/ 64), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -5836, 7465, -6143, /*yaw*/ 64), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW_AND_PARAM(/*preset*/ special_wooden_door_warp, /*pos*/ -7628, -5836, -6988, /*yaw*/ 64, /*behParam2*/ 20), SPECIAL_OBJECT_WITH_YAW_AND_PARAM(/*preset*/ special_wooden_door_warp, /*pos*/ -7628, -5836, -6988, /*yaw*/ 64, /*behParam2*/ 20),
COL_END(), COL_END(),
}; };

View file

@ -990,7 +990,7 @@ const Collision cotmc_seg7_collision_level[] = {
COL_TRI(208, 206, 207), COL_TRI(208, 206, 207),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(1), COL_SPECIAL_INIT(1),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -4185, 20, -47, /*yaw*/ 64), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -4185, 20, -47, /*yaw*/ 64), // unused, probably an early way to set initial position
COL_WATER_BOX_INIT(1), COL_WATER_BOX_INIT(1),
COL_WATER_BOX(0, -1535, -7679, 1536, 3389, 0), COL_WATER_BOX(0, -1535, -7679, 1536, 3389, 0),
COL_END(), COL_END(),

View file

@ -3599,7 +3599,7 @@ const Collision hmc_seg7_collision_level[] = {
COL_TRI(55, 58, 56), COL_TRI(55, 58, 56),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(13), COL_SPECIAL_INIT(13),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -7601, 2253, 7630, /*yaw*/ 96), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -7601, 2253, 7630, /*yaw*/ 96), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_wooden_door, /*pos*/ 922, -4689, 2330, /*yaw*/ 192), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_wooden_door, /*pos*/ 922, -4689, 2330, /*yaw*/ 192),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_wooden_door, /*pos*/ -3586, 1536, 647, /*yaw*/ 19), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_wooden_door, /*pos*/ -3586, 1536, 647, /*yaw*/ 19),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_wooden_door, /*pos*/ 5911, -204, 870, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_wooden_door, /*pos*/ 5911, -204, 870, /*yaw*/ 0),

View file

@ -872,7 +872,7 @@ const Collision jrb_seg7_area_1_collision[] = {
COL_TRI(7, 5, 0), COL_TRI(7, 5, 0),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(1), COL_SPECIAL_INIT(1),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -6750, 1126, 1482, /*yaw*/ 64), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -6750, 1126, 1482, /*yaw*/ 64), // unused, probably an early way to set initial position
COL_WATER_BOX_INIT(3), COL_WATER_BOX_INIT(3),
COL_WATER_BOX(0, -6304, -669, 7992, 7814, 1024), COL_WATER_BOX(0, -6304, -669, 7992, 7814, 1024),
COL_WATER_BOX(1, 4433, -4253, 5969, -669, -3016), COL_WATER_BOX(1, 4433, -4253, 5969, -669, -3016),

View file

@ -35,8 +35,8 @@ const struct MovtexQuadCollection jrb_movtex_water[] = {
{-1, NULL}, {-1, NULL},
}; };
// 0x0700D2E4, appears if you enter the course the first time, then it disappears when you grab the first star // 0x0700D2E4, appears if you enter the course the first time, then it disappears when you collect the "Plunder in the Sunken Ship" star
static Movtex jrb_movtex_intial_mist_data[] = { static Movtex jrb_movtex_initial_mist_data[] = {
MOV_TEX_INIT_LOAD( 1), MOV_TEX_INIT_LOAD( 1),
MOV_TEX_ROT_SPEED( 20), MOV_TEX_ROT_SPEED( 20),
MOV_TEX_ROT_SCALE( 10), MOV_TEX_ROT_SCALE( 10),
@ -51,7 +51,7 @@ static Movtex jrb_movtex_intial_mist_data[] = {
}; };
// 0x0700D304 // 0x0700D304
const struct MovtexQuadCollection jrb_movtex_intial_mist[] = { const struct MovtexQuadCollection jrb_movtex_initial_mist[] = {
{51, jrb_movtex_intial_mist_data}, {51, jrb_movtex_initial_mist_data},
{-1, NULL}, {-1, NULL},
}; };

View file

@ -584,7 +584,7 @@ const Collision jrb_seg7_area_2_collision[] = {
COL_TRI(29, 79, 80), COL_TRI(29, 79, 80),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(1), COL_SPECIAL_INIT(1),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 866, 798, -1248, /*yaw*/ 128), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 866, 798, -1248, /*yaw*/ 128), // unused, probably an early way to set initial position
COL_WATER_BOX_INIT(1), COL_WATER_BOX_INIT(1),
COL_WATER_BOX(0, -4095, -4095, 4096, 4096, 2765), COL_WATER_BOX(0, -4095, -4095, 4096, 4096, 2765),
COL_END(), COL_END(),

View file

@ -1,5 +1,5 @@
// 0x0701137C // 0x0701137C
static Movtex jrb_movtex_sinked_boat_water_data[] = { static Movtex jrb_movtex_sunken_ship_water_data[] = {
MOV_TEX_INIT_LOAD( 1), MOV_TEX_INIT_LOAD( 1),
MOV_TEX_ROT_SPEED( 20), MOV_TEX_ROT_SPEED( 20),
MOV_TEX_ROT_SCALE( 6), MOV_TEX_ROT_SCALE( 6),
@ -14,7 +14,7 @@ static Movtex jrb_movtex_sinked_boat_water_data[] = {
}; };
// 0x0701139C // 0x0701139C
const struct MovtexQuadCollection jrb_movtex_sinked_boat_water[] = { const struct MovtexQuadCollection jrb_movtex_sunken_ship_water[] = {
{0, jrb_movtex_sinked_boat_water_data}, {0, jrb_movtex_sunken_ship_water_data},
{-1, NULL}, {-1, NULL},
}; };

View file

@ -52,13 +52,13 @@ extern const Collision jrb_seg7_collision_0700D1DC[];
extern const Trajectory jrb_seg7_trajectory_unagi_1[]; extern const Trajectory jrb_seg7_trajectory_unagi_1[];
extern const Trajectory jrb_seg7_trajectory_unagi_2[]; extern const Trajectory jrb_seg7_trajectory_unagi_2[];
extern const struct MovtexQuadCollection jrb_movtex_water[]; extern const struct MovtexQuadCollection jrb_movtex_water[];
extern const struct MovtexQuadCollection jrb_movtex_intial_mist[]; extern const struct MovtexQuadCollection jrb_movtex_initial_mist[];
extern const Gfx jrb_seg7_dl_0700EF00[]; extern const Gfx jrb_seg7_dl_0700EF00[];
extern const Gfx jrb_seg7_dl_0700FE48[]; extern const Gfx jrb_seg7_dl_0700FE48[];
extern const Gfx jrb_seg7_dl_07010548[]; extern const Gfx jrb_seg7_dl_07010548[];
extern const Collision jrb_seg7_area_2_collision[]; extern const Collision jrb_seg7_area_2_collision[];
extern const MacroObject jrb_seg7_area_2_macro_objs[]; extern const MacroObject jrb_seg7_area_2_macro_objs[];
extern const struct MovtexQuadCollection jrb_movtex_sinked_boat_water[]; extern const struct MovtexQuadCollection jrb_movtex_sunken_ship_water[];
// script // script
extern const LevelScript level_jrb_entry[]; extern const LevelScript level_jrb_entry[];

View file

@ -1376,7 +1376,7 @@ const Collision lll_seg7_area_1_collision[] = {
COL_TRI(10, 52, 3), COL_TRI(10, 52, 3),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(1), COL_SPECIAL_INIT(1),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -3839, 154, 6272, /*yaw*/ 64), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -3839, 154, 6272, /*yaw*/ 64), // unused, probably an early way to set initial position
COL_END(), COL_END(),
#else #else
COL_INIT(), COL_INIT(),
@ -2730,7 +2730,7 @@ const Collision lll_seg7_area_1_collision[] = {
COL_TRI(3, 52, 71), COL_TRI(3, 52, 71),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(1), COL_SPECIAL_INIT(1),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -3839, 154, 6272, /*yaw*/ 64), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -3839, 154, 6272, /*yaw*/ 64), // unused, probably an early way to set initial position
COL_END(), COL_END(),
#endif #endif
}; };

View file

@ -1549,7 +1549,7 @@ const Collision lll_seg7_area_2_collision[] = {
COL_TRI(324, 451, 450), COL_TRI(324, 451, 450),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(1), COL_SPECIAL_INIT(1),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -955, 103, -1029, /*yaw*/ 84), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -955, 103, -1029, /*yaw*/ 84), // unused, probably an early way to set initial position
COL_WATER_BOX_INIT(1), COL_WATER_BOX_INIT(1),
COL_WATER_BOX(10, -3071, -3071, 3072, 3072, 20), COL_WATER_BOX(10, -3071, -3071, 3072, 3072, 20),
COL_END(), COL_END(),

View file

@ -2694,7 +2694,7 @@ const Collision rr_seg7_collision_level[] = {
COL_TRI_SPECIAL(31, 46, 45, 0x140), COL_TRI_SPECIAL(31, 46, 45, 0x140),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(23), COL_SPECIAL_INIT(23),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 2599, -1833, 2071, /*yaw*/ 64), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 2599, -1833, 2071, /*yaw*/ 64), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 1902, -1833, 1063, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 1902, -1833, 1063, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ 3803, -1833, 2036, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ 3803, -1833, 2036, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_05, /*pos*/ -4888, -2550, 5847, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_05, /*pos*/ -4888, -2550, 5847, /*yaw*/ 0),
@ -5419,7 +5419,7 @@ const Collision rr_seg7_collision_level[] = {
COL_TRI_SPECIAL(35, 46, 47, 0x100), COL_TRI_SPECIAL(35, 46, 47, 0x100),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(23), COL_SPECIAL_INIT(23),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 2599, -1833, 2071, /*yaw*/ 64), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 2599, -1833, 2071, /*yaw*/ 64), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 1902, -1833, 1063, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 1902, -1833, 1063, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ 3803, -1833, 2036, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ 3803, -1833, 2036, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_05, /*pos*/ -4888, -2550, 5847, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_05, /*pos*/ -4888, -2550, 5847, /*yaw*/ 0),

View file

@ -105,7 +105,7 @@ const Collision sa_seg7_collision[] = {
COL_TRI(30, 47, 12), COL_TRI(30, 47, 12),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(1), COL_SPECIAL_INIT(1),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 0, -1535, 0, /*yaw*/ 64), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 0, -1535, 0, /*yaw*/ 64), // unused, probably an early way to set initial position
COL_WATER_BOX_INIT(1), COL_WATER_BOX_INIT(1),
COL_WATER_BOX(0, -3173, -3173, 3174, 3174, 102), COL_WATER_BOX(0, -3173, -3173, 3174, 3174, 102),
COL_END(), COL_END(),

View file

@ -1423,7 +1423,7 @@ const Collision sl_seg7_area_1_collision[] = {
COL_TRI(510, 327, 321), COL_TRI(510, 327, 321),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(10), COL_SPECIAL_INIT(10),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 5541, 1024, 443, /*yaw*/ 192), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 5541, 1024, 443, /*yaw*/ 192), // unused, probably an early way to set initial position
SPECIAL_OBJECT(/*preset*/ special_snow_tree, /*pos*/ 5395, 1054, -5443), SPECIAL_OBJECT(/*preset*/ special_snow_tree, /*pos*/ 5395, 1054, -5443),
SPECIAL_OBJECT(/*preset*/ special_snow_tree, /*pos*/ 0, 4864, 0), SPECIAL_OBJECT(/*preset*/ special_snow_tree, /*pos*/ 0, 4864, 0),
SPECIAL_OBJECT(/*preset*/ special_snow_tree, /*pos*/ 5666, 1024, -3341), SPECIAL_OBJECT(/*preset*/ special_snow_tree, /*pos*/ 5666, 1024, -3341),

View file

@ -407,7 +407,7 @@ const Collision sl_seg7_area_2_collision[] = {
COL_TRI(146, 187, 145), COL_TRI(146, 187, 145),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(1), COL_SPECIAL_INIT(1),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 0, 0, 2867, /*yaw*/ 128), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 0, 0, 2867, /*yaw*/ 128), // unused, probably an early way to set initial position
COL_END(), COL_END(),
}; };

View file

@ -1554,7 +1554,7 @@ const Collision ssl_seg7_area_1_collision[] = {
COL_TRI(482, 483, 484), COL_TRI(482, 483, 484),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(7), COL_SPECIAL_INIT(7),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 653, 38, 6566, /*yaw*/ 64), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 653, 38, 6566, /*yaw*/ 64), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 5760, 0, 5751, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 5760, 0, 5751, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -3583, 0, 2935, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -3583, 0, 2935, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -511, 0, 2935, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -511, 0, 2935, /*yaw*/ 0),

View file

@ -2655,7 +2655,7 @@ const Collision ssl_seg7_area_2_collision[] = {
COL_TRI(359, 420, 419), COL_TRI(359, 420, 419),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(4), COL_SPECIAL_INIT(4),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 0, 0, 6451, /*yaw*/ 128), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 0, 0, 6451, /*yaw*/ 128), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ 1741, -101, 1843, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ 1741, -101, 1843, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ 0, -101, 528, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ 0, -101, 528, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ -1740, -101, 1843, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_04, /*pos*/ -1740, -101, 1843, /*yaw*/ 0),

View file

@ -1256,7 +1256,7 @@ const Collision thi_seg7_area_1_collision[] = {
COL_TRI(412, 320, 319), COL_TRI(412, 320, 319),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(2), COL_SPECIAL_INIT(2),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -7372, -2969, 7373, /*yaw*/ 106), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -7372, -2969, 7373, /*yaw*/ 106), // unused, probably an early way to set initial position
SPECIAL_OBJECT(/*preset*/ special_bubble_tree, /*pos*/ 4813, -511, 2254), SPECIAL_OBJECT(/*preset*/ special_bubble_tree, /*pos*/ 4813, -511, 2254),
COL_WATER_BOX_INIT(3), COL_WATER_BOX_INIT(3),
COL_WATER_BOX(0, -8191, -8191, -5119, 6246, -3071), COL_WATER_BOX(0, -8191, -8191, -5119, 6246, -3071),

View file

@ -970,7 +970,7 @@ const Collision thi_seg7_area_2_collision[] = {
COL_TRI(244, 25, 148), COL_TRI(244, 25, 148),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(3), COL_SPECIAL_INIT(3),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -2211, -890, 2212, /*yaw*/ 106), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -2211, -890, 2212, /*yaw*/ 106), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -40, -767, -4494, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -40, -767, -4494, /*yaw*/ 0),
SPECIAL_OBJECT(/*preset*/ special_bubble_tree, /*pos*/ 1444, -153, 676), SPECIAL_OBJECT(/*preset*/ special_bubble_tree, /*pos*/ 1444, -153, 676),
COL_WATER_BOX_INIT(3), COL_WATER_BOX_INIT(3),

View file

@ -587,7 +587,7 @@ const Collision totwc_seg7_collision[] = {
COL_TRI(81, 97, 67), COL_TRI(81, 97, 67),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(23), COL_SPECIAL_INIT(23),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -4095, 2935, 0, /*yaw*/ 64), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -4095, 2935, 0, /*yaw*/ 64), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 4608, -357, -511, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 4608, -357, -511, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -4095, 666, 512, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -4095, 666, 512, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -5631, -1893, 6144, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -5631, -1893, 6144, /*yaw*/ 0),

View file

@ -1890,6 +1890,6 @@ const Collision ttc_seg7_collision_level[] = {
COL_TRI(526, 625, 624), COL_TRI(526, 625, 624),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(1), COL_SPECIAL_INIT(1),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 1046, -4822, -266, /*yaw*/ 192), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 1046, -4822, -266, /*yaw*/ 192), // unused, probably an early way to set initial position
COL_END(), COL_END(),
}; };

View file

@ -2293,7 +2293,7 @@ const Collision ttm_seg7_area_1_collision[] = {
COL_TRI(516, 430, 819), COL_TRI(516, 430, 819),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(29), COL_SPECIAL_INIT(29),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 102, -4332, 5734, /*yaw*/ 32), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 102, -4332, 5734, /*yaw*/ 32), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -3276, -4423, -3685, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ -3276, -4423, -3685, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 7293, -5056, 1429, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 7293, -5056, 1429, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 4938, -5568, 5115, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_03, /*pos*/ 4938, -5568, 5115, /*yaw*/ 0),

View file

@ -844,6 +844,6 @@ const Collision vcutm_seg7_collision[] = {
COL_TRI(40, 27, 30), COL_TRI(40, 27, 30),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(1), COL_SPECIAL_INIT(1),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -6143, 5734, -6143, /*yaw*/ 0), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -6143, 5734, -6143, /*yaw*/ 0), // unused, probably an early way to set initial position
COL_END(), COL_END(),
}; };

View file

@ -1345,7 +1345,7 @@ const Collision wdw_seg7_area_1_collision[] = {
COL_TRI(85, 159, 157), COL_TRI(85, 159, 157),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(1), COL_SPECIAL_INIT(1),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 3395, 1280, 384, /*yaw*/ 128), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 3395, 1280, 384, /*yaw*/ 128), // unused, probably an early way to set initial position
COL_WATER_BOX_INIT(1), COL_WATER_BOX_INIT(1),
COL_WATER_BOX(0, -3839, -3839, 4608, 4608, 31), COL_WATER_BOX(0, -3839, -3839, 4608, 4608, 31),
COL_END(), COL_END(),

View file

@ -1075,7 +1075,7 @@ const Collision wf_seg7_collision_070102D8[] = {
COL_TRI(4, 7, 5), COL_TRI(4, 7, 5),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(6), COL_SPECIAL_INIT(6),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 2560, 256, 5120, /*yaw*/ 64), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ 2560, 256, 5120, /*yaw*/ 64), // unused, probably an early way to set initial position
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_0E, /*pos*/ 3584, 154, 4864, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_0E, /*pos*/ 3584, 154, 4864, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_0F, /*pos*/ 4608, 256, 1792, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_0F, /*pos*/ 4608, 256, 1792, /*yaw*/ 0),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_11, /*pos*/ -2499, 1792, -261, /*yaw*/ 0), SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_level_geo_11, /*pos*/ -2499, 1792, -261, /*yaw*/ 0),

View file

@ -2055,6 +2055,6 @@ const Collision wmotr_seg7_collision[] = {
COL_TRI(288, 286, 289), COL_TRI(288, 286, 289),
COL_TRI_STOP(), COL_TRI_STOP(),
COL_SPECIAL_INIT(1), COL_SPECIAL_INIT(1),
SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -67, 1669, -16, /*yaw*/ 192), // unused, probably an early way to set intial position SPECIAL_OBJECT_WITH_YAW(/*preset*/ special_null_start, /*pos*/ -67, 1669, -16, /*yaw*/ 192), // unused, probably an early way to set initial position
COL_END(), COL_END(),
}; };

View file

@ -134,9 +134,9 @@ glabel rspF3DDataEnd
glabel rspF3DDataStart glabel rspF3DDataStart
#ifdef F3DZEX_GBI_2 #ifdef F3DZEX_GBI_2
.incbin "lib/PR/f3dex2/F3DZEX_NoN_data.bin" .incbin "lib/PR/f3dex2/F3DZEX_NoN_data.bin"
#elseif F3DEX_GBI #elif defined(F3DEX_GBI)
.incbin "lib/PR/f3dex/F3DEX_data.bin" .incbin "lib/PR/f3dex/F3DEX_data.bin"
#elseif F3DEX_GBI_2 #elif defined(F3DEX_GBI_2)
.incbin "lib/PR/f3dex2/F3DEX2_data.bin" .incbin "lib/PR/f3dex2/F3DEX2_data.bin"
#endif #endif
glabel rspF3DDataEnd glabel rspF3DDataEnd

View file

@ -57,7 +57,7 @@ u32 D_802F4380() {
return 1; return 1;
} }
sp2c->dramAddr = (void *) ((u32) sp2c->dramAddr + sp2c->sectorSize); sp2c->dramAddr = (void *) ((u32) sp2c->dramAddr + sp2c->sectorSize);
sp30->sectorNum += 1; sp30->sectorNum++;
osEPiRawStartDma(__osDiskHandle, 1, 0x05000400, sp2c->dramAddr, sp2c->sectorSize); osEPiRawStartDma(__osDiskHandle, 1, 0x05000400, sp2c->dramAddr, sp2c->sectorSize);
return 1; return 1;
} }
@ -77,8 +77,7 @@ u32 D_802F4380() {
sp2c->dramAddr = (void *) ((u32) sp2c->dramAddr + sp2c->sectorSize); sp2c->dramAddr = (void *) ((u32) sp2c->dramAddr + sp2c->sectorSize);
} }
sp34 = HW_REG(ASIC_BM_STATUS, u32); sp34 = HW_REG(ASIC_BM_STATUS, u32);
if (((C1_SINGLE & sp34) && (C1_DOUBLE & sp34)) || (sp34 & MICRO_STATUS)) if (((C1_SINGLE & sp34) && (C1_DOUBLE & sp34)) || (sp34 & MICRO_STATUS)) {
{
if (sp2c->C1ErrNum > 3) { if (sp2c->C1ErrNum > 3) {
if (sp30->transferMode != 3 || sp30->sectorNum > 0x52) { if (sp30->transferMode != 3 || sp30->sectorNum > 0x52) {
sp30->errStatus = 17; sp30->errStatus = 17;
@ -89,7 +88,7 @@ u32 D_802F4380() {
sp28 = sp2c->C1ErrNum; sp28 = sp2c->C1ErrNum;
sp2c->C1ErrSector[sp28] = sp30->sectorNum + 1; sp2c->C1ErrSector[sp28] = sp30->sectorNum + 1;
} }
sp2c->C1ErrNum += 1; sp2c->C1ErrNum++;
} }
if (sp3c & C2_TRANSFER) { if (sp3c & C2_TRANSFER) {
if (sp30->sectorNum != 87) { if (sp30->sectorNum != 87) {
@ -123,7 +122,7 @@ u32 D_802F4380() {
sp30->errStatus = 0; sp30->errStatus = 0;
func_802F4B08(); func_802F4B08();
} }
sp30->sectorNum += 1; sp30->sectorNum++;
if (sp3c & DATA_REQUEST) { if (sp3c & DATA_REQUEST) {
if (sp30->sectorNum > 0x54) { if (sp30->sectorNum > 0x54) {
sp30->errStatus = 6; sp30->errStatus = 6;

View file

@ -1,14 +1,6 @@
#include "libultra_internal.h" #include "libultra_internal.h"
#include "hardware.h" #include "hardware.h"
#ifdef VERSION_SH
extern s32 D_SH_80000300; // Potentially a TV type
#endif
#ifndef VERSION_JP
extern u32 osTvType;
#endif
OSViContext sViContexts[2] = { 0 }; OSViContext sViContexts[2] = { 0 };
OSViContext *__osViCurr = &sViContexts[0]; OSViContext *__osViCurr = &sViContexts[0];
OSViContext *__osViNext = &sViContexts[1]; OSViContext *__osViNext = &sViContexts[1];
@ -80,6 +72,7 @@ void __osViInit(void) {
osViClock = 0x02E6025C; osViClock = 0x02E6025C;
#endif #endif
} }
#endif #endif
__osViNext->unk00 = 0x20; __osViNext->unk00 = 0x20;

View file

@ -32,7 +32,7 @@ void func_802F4B08(void) {
} }
sp24 = (sp28->first + sp28->validCount) % sp28->msgCount; sp24 = (sp28->first + sp28->validCount) % sp28->msgCount;
sp28->msg[sp24] = sp2c->msg; sp28->msg[sp24] = sp2c->msg;
sp28->validCount += 1; sp28->validCount++;
if (sp28->mtqueue->next != NULL) { if (sp28->mtqueue->next != NULL) {
s0 = __osPopThread(&sp28->mtqueue); s0 = __osPopThread(&sp28->mtqueue);
__osEnqueueThread(&D_80334898, s0); __osEnqueueThread(&D_80334898, s0);

View file

@ -93,7 +93,7 @@ s32 __osLeoInterrupt() {
int errNum = blockInfo->C1ErrNum; int errNum = blockInfo->C1ErrNum;
blockInfo->C1ErrSector[errNum] = info->sectorNum + 1; blockInfo->C1ErrSector[errNum] = info->sectorNum + 1;
} }
blockInfo->C1ErrNum += 1; blockInfo->C1ErrNum++;
} }
if (stat & LEO_STATUS_C2_TRANSFER) { if (stat & LEO_STATUS_C2_TRANSFER) {
if (info->sectorNum != 87) { if (info->sectorNum != 87) {

View file

@ -13,8 +13,8 @@ static OSIoMesg viEventCounterMesg;
extern void __osTimerServicesInit(void); extern void __osTimerServicesInit(void);
extern void __osTimerInterrupt(void); extern void __osTimerInterrupt(void);
extern OSTime _osCurrentTime; extern OSTime __osCurrentTime;
extern u32 D_80365DA8; extern u32 __osBaseCounter;
extern u32 __osViIntrCount; extern u32 __osViIntrCount;
void viMgrMain(void *); void viMgrMain(void *);
@ -92,13 +92,13 @@ void viMgrMain(void *vargs) {
__osViIntrCount++; __osViIntrCount++;
if (sp28) { if (sp28) {
sp24 = osGetCount(); sp24 = osGetCount();
_osCurrentTime = sp24; __osCurrentTime = sp24;
sp28 = 0; sp28 = 0;
} }
sp24 = D_80365DA8; sp24 = __osBaseCounter;
D_80365DA8 = osGetCount(); __osBaseCounter = osGetCount();
sp24 = D_80365DA8 - sp24; sp24 = __osBaseCounter - sp24;
_osCurrentTime = _osCurrentTime + sp24; __osCurrentTime = __osCurrentTime + sp24;
break; break;
case 14: case 14:

View file

@ -20,7 +20,7 @@ s32 osEepromLongRead(OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes) {
} }
nbytes -= 8; nbytes -= 8;
address += 1; address++;
buffer += 8; buffer += 8;
osSetTimer(&D_80365D28, 12000 * osClockRate / 1000000, 0, &_osContMesgQueue, _osContMesgBuff); osSetTimer(&D_80365D28, 12000 * osClockRate / 1000000, 0, &_osContMesgQueue, _osContMesgBuff);
osRecvMesg(&_osContMesgQueue, NULL, OS_MESG_BLOCK); osRecvMesg(&_osContMesgQueue, NULL, OS_MESG_BLOCK);

View file

@ -21,7 +21,7 @@ s32 osEepromLongWrite(OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes) {
} }
nbytes -= 8; nbytes -= 8;
address += 1; address++;
buffer += 8; buffer += 8;
osSetTimer(&D_80365D28, 12000 * osClockRate / 1000000, 0, &_osContMesgQueue, _osContMesgBuff); osSetTimer(&D_80365D28, 12000 * osClockRate / 1000000, 0, &_osContMesgQueue, _osContMesgBuff);
osRecvMesg(&_osContMesgQueue, NULL, OS_MESG_BLOCK); osRecvMesg(&_osContMesgQueue, NULL, OS_MESG_BLOCK);

View file

@ -1,17 +1,18 @@
#include "libultra_internal.h" #include "libultra_internal.h"
extern OSTime _osCurrentTime; extern OSTime __osCurrentTime;
extern u32 D_80365DA8; extern u32 __osBaseCounter;
OSTime osGetTime() { OSTime osGetTime() {
u32 sp34; u32 tmpTime;
u32 sp30; u32 elapseCount;
OSTime sp28; OSTime currentCount;
register u32 int_disabled; register u32 saveMask;
int_disabled = __osDisableInt();
sp34 = osGetCount(); saveMask = __osDisableInt();
sp30 = sp34 - D_80365DA8; tmpTime = osGetCount();
sp28 = _osCurrentTime; elapseCount = tmpTime - __osBaseCounter;
__osRestoreInt(int_disabled); currentCount = __osCurrentTime;
return sp28 + sp30; __osRestoreInt(saveMask);
return currentCount + elapseCount;
} }

View file

@ -1,7 +1,7 @@
#include "libultra_internal.h" #include "libultra_internal.h"
extern OSTime _osCurrentTime; extern OSTime __osCurrentTime;
void osSetTime(OSTime time) { void osSetTime(OSTime time) {
_osCurrentTime = time; __osCurrentTime = time;
} }

View file

@ -1,23 +1,23 @@
#include "libultra_internal.h" #include "libultra_internal.h"
extern OSTimer *D_80334830; extern OSTimer *__osTimerList;
extern u64 __osInsertTimer(OSTimer *); extern u64 __osInsertTimer(OSTimer *);
u32 osSetTimer(OSTimer *a0, OSTime a1, u64 a2, OSMesgQueue *a3, OSMesg a4) { u32 osSetTimer(OSTimer *t, OSTime countdown, OSTime interval, OSMesgQueue *mq, OSMesg msg) {
u64 sp18; OSTime time;
a0->next = NULL; t->next = NULL;
a0->prev = NULL; t->prev = NULL;
a0->interval = a2; t->interval = interval;
if (a1 != 0) { if (countdown != 0) {
a0->remaining = a1; t->remaining = countdown;
} else { } else {
a0->remaining = a2; t->remaining = interval;
} }
a0->mq = a3; t->mq = mq;
a0->msg = a4; t->msg = msg;
sp18 = __osInsertTimer(a0); time = __osInsertTimer(t);
if (D_80334830->next == a0) { if (__osTimerList->next == t) {
__osSetTimerIntr(sp18); __osSetTimerIntr(time);
} }
return 0; return 0;
} }

View file

@ -1,88 +1,90 @@
#include "libultra_internal.h" #include "libultra_internal.h"
// TODO: document OSTimer __osBaseTimer;
OSTimer D_80365D80; OSTimer *__osTimerList = &__osBaseTimer;
OSTimer *D_80334830 = &D_80365D80; OSTime __osCurrentTime;
OSTime _osCurrentTime; u32 __osBaseCounter;
u32 D_80365DA8;
u32 __osViIntrCount; u32 __osViIntrCount;
u32 D_80365DB0; u32 __osTimerCounter;
void __osTimerServicesInit(void) { void __osTimerServicesInit(void) {
_osCurrentTime = 0; __osCurrentTime = 0;
D_80365DA8 = 0; __osBaseCounter = 0;
__osViIntrCount = 0; __osViIntrCount = 0;
D_80334830->prev = D_80334830; __osTimerList->prev = __osTimerList;
D_80334830->next = D_80334830->prev; __osTimerList->next = __osTimerList->prev;
D_80334830->remaining = 0; __osTimerList->remaining = 0;
D_80334830->interval = D_80334830->remaining; __osTimerList->interval = __osTimerList->remaining;
D_80334830->mq = NULL; __osTimerList->mq = NULL;
D_80334830->msg = NULL; __osTimerList->msg = NULL;
} }
void __osTimerInterrupt(void) { void __osTimerInterrupt(void) {
OSTimer *sp24; OSTimer *t;
u32 sp20; u32 count;
u32 sp1c; u32 elapsedCycles;
if (D_80334830->next == D_80334830) {
if (__osTimerList->next == __osTimerList) {
return; return;
} }
while (TRUE) { while (TRUE) {
sp24 = D_80334830->next; t = __osTimerList->next;
if (sp24 == D_80334830) { if (t == __osTimerList) {
__osSetCompare(0); __osSetCompare(0);
D_80365DB0 = 0; __osTimerCounter = 0;
break; break;
} }
sp20 = osGetCount(); count = osGetCount();
sp1c = sp20 - D_80365DB0; elapsedCycles = count - __osTimerCounter;
D_80365DB0 = sp20; __osTimerCounter = count;
if (sp1c < sp24->remaining) { if (elapsedCycles < t->remaining) {
sp24->remaining -= sp1c; t->remaining -= elapsedCycles;
__osSetTimerIntr(sp24->remaining); __osSetTimerIntr(t->remaining);
return; return;
} else { } else {
sp24->prev->next = sp24->next; t->prev->next = t->next;
sp24->next->prev = sp24->prev; t->next->prev = t->prev;
sp24->next = NULL; t->next = NULL;
sp24->prev = NULL; t->prev = NULL;
if (sp24->mq != NULL) { if (t->mq != NULL) {
osSendMesg(sp24->mq, sp24->msg, OS_MESG_NOBLOCK); osSendMesg(t->mq, t->msg, OS_MESG_NOBLOCK);
} }
if (sp24->interval != 0) { if (t->interval != 0) {
sp24->remaining = sp24->interval; t->remaining = t->interval;
__osInsertTimer(sp24); __osInsertTimer(t);
} }
} }
} }
} }
void __osSetTimerIntr(u64 a0) { void __osSetTimerIntr(OSTime time) {
u64 tmp; OSTime newTime;
s32 intDisabled = __osDisableInt(); s32 savedMask = __osDisableInt();
D_80365DB0 = osGetCount(); __osTimerCounter = osGetCount();
tmp = a0 + D_80365DB0; newTime = time + __osTimerCounter;
__osSetCompare(tmp); __osSetCompare(newTime);
__osRestoreInt(intDisabled); __osRestoreInt(savedMask);
} }
u64 __osInsertTimer(OSTimer *a0) { OSTime __osInsertTimer(OSTimer *t) {
OSTimer *sp34; OSTimer *timep;
u64 sp28; OSTime time;
s32 intDisabled; s32 savedMask;
intDisabled = __osDisableInt();
for (sp34 = D_80334830->next, sp28 = a0->remaining; sp34 != D_80334830 && sp28 > sp34->remaining; savedMask = __osDisableInt();
sp28 -= sp34->remaining, sp34 = sp34->next) { for (timep = __osTimerList->next, time = t->remaining; timep != __osTimerList && time > timep->remaining;
time -= timep->remaining, timep = timep->next) {
; ;
} }
a0->remaining = sp28; t->remaining = time;
if (sp34 != D_80334830) { if (timep != __osTimerList) {
sp34->remaining -= sp28; timep->remaining -= time;
} }
a0->next = sp34; t->next = timep;
a0->prev = sp34->prev; t->prev = timep->prev;
sp34->prev->next = a0; timep->prev->next = t;
sp34->prev = a0; timep->prev = t;
__osRestoreInt(intDisabled); __osRestoreInt(savedMask);
return sp28; return time;
} }

View file

@ -2110,10 +2110,11 @@ void set_audio_muted(u8 muted) {
for (i = 0; i < SEQUENCE_PLAYERS; i++) { for (i = 0; i < SEQUENCE_PLAYERS; i++) {
#if defined(VERSION_EU) || defined(VERSION_SH) #if defined(VERSION_EU) || defined(VERSION_SH)
if (muted) if (muted) {
func_802ad74c(0xf1000000, 0); func_802ad74c(0xf1000000, 0);
else } else {
func_802ad74c(0xf2000000, 0); func_802ad74c(0xf2000000, 0);
}
#else #else
gSequencePlayers[i].muted = muted; gSequencePlayers[i].muted = muted;
#endif #endif

View file

@ -82,8 +82,7 @@ void unk_pools_init(u32 size1, u32 size2);
* Assuming 'k' in [9, 24], * Assuming 'k' in [9, 24],
* Computes a newton's method step for f(x) = x^k - d * Computes a newton's method step for f(x) = x^k - d
*/ */
f64 root_newton_step(f64 x, s32 k, f64 d) f64 root_newton_step(f64 x, s32 k, f64 d) {
{
f64 deg2 = x * x; f64 deg2 = x * x;
f64 deg4 = deg2 * deg2; f64 deg4 = deg2 * deg2;
f64 deg8 = deg4 * deg4; f64 deg8 = deg4 * deg4;

View file

@ -15,8 +15,7 @@
#define IS_BANK_LOAD_COMPLETE(bankId) (gBankLoadStatus[bankId] >= SOUND_LOAD_STATUS_COMPLETE) #define IS_BANK_LOAD_COMPLETE(bankId) (gBankLoadStatus[bankId] >= SOUND_LOAD_STATUS_COMPLETE)
#define IS_SEQ_LOAD_COMPLETE(seqId) (gSeqLoadStatus[seqId] >= SOUND_LOAD_STATUS_COMPLETE) #define IS_SEQ_LOAD_COMPLETE(seqId) (gSeqLoadStatus[seqId] >= SOUND_LOAD_STATUS_COMPLETE)
struct SoundAllocPool struct SoundAllocPool {
{
u8 *start; u8 *start;
u8 *cur; u8 *cur;
u32 size; u32 size;
@ -34,15 +33,13 @@ struct SeqOrBankEntry {
#endif #endif
}; // size = 0xC }; // size = 0xC
struct PersistentPool struct PersistentPool {
{
/*0x00*/ u32 numEntries; /*0x00*/ u32 numEntries;
/*0x04*/ struct SoundAllocPool pool; /*0x04*/ struct SoundAllocPool pool;
/*0x14*/ struct SeqOrBankEntry entries[32]; /*0x14*/ struct SeqOrBankEntry entries[32];
}; // size = 0x194 }; // size = 0x194
struct TemporaryPool struct TemporaryPool {
{
/*EU, SH*/ /*EU, SH*/
/*0x00, 0x00*/ u32 nextSide; /*0x00, 0x00*/ u32 nextSide;
/*0x04, */ struct SoundAllocPool pool; /*0x04, */ struct SoundAllocPool pool;
@ -59,21 +56,18 @@ struct TemporaryPool
/*0x28, 0x2A entries[1].id */ /*0x28, 0x2A entries[1].id */
}; // size = 0x2C }; // size = 0x2C
struct SoundMultiPool struct SoundMultiPool {
{
/*0x000*/ struct PersistentPool persistent; /*0x000*/ struct PersistentPool persistent;
/*0x194*/ struct TemporaryPool temporary; /*0x194*/ struct TemporaryPool temporary;
/* */ u32 pad2[4]; /* */ u32 pad2[4];
}; // size = 0x1D0 }; // size = 0x1D0
struct Unk1Pool struct Unk1Pool {
{
struct SoundAllocPool pool; struct SoundAllocPool pool;
struct SeqOrBankEntry entries[32]; struct SeqOrBankEntry entries[32];
}; };
struct UnkEntry struct UnkEntry {
{
s8 used; s8 used;
s8 medium; s8 medium;
s8 bankId; s8 bankId;
@ -83,8 +77,7 @@ struct UnkEntry
u32 size; u32 size;
}; };
struct UnkPool struct UnkPool {
{
/*0x00*/ struct SoundAllocPool pool; /*0x00*/ struct SoundAllocPool pool;
/*0x10*/ struct UnkEntry entries[64]; /*0x10*/ struct UnkEntry entries[64];
/*0x510*/ s32 numEntries; /*0x510*/ s32 numEntries;

View file

@ -93,8 +93,7 @@
struct NotePool; struct NotePool;
struct AudioListItem struct AudioListItem {
{
// A node in a circularly linked list. Each node is either a head or an item: // A node in a circularly linked list. Each node is either a head or an item:
// - Items can be either detached (prev = NULL), or attached to a list. // - Items can be either detached (prev = NULL), or attached to a list.
// 'value' points to something of interest. // 'value' points to something of interest.
@ -111,8 +110,7 @@ struct AudioListItem
struct NotePool *pool; struct NotePool *pool;
}; // size = 0x10 }; // size = 0x10
struct NotePool struct NotePool {
{
struct AudioListItem disabled; struct AudioListItem disabled;
struct AudioListItem decaying; struct AudioListItem decaying;
struct AudioListItem releasing; struct AudioListItem releasing;
@ -154,8 +152,7 @@ struct AdsrEnvelope {
s16 arg; s16 arg;
}; // size = 0x4 }; // size = 0x4
struct AdpcmLoop struct AdpcmLoop {
{
u32 start; u32 start;
u32 end; u32 end;
u32 count; u32 count;
@ -163,15 +160,13 @@ struct AdpcmLoop
s16 state[16]; // only exists if count != 0. 8-byte aligned s16 state[16]; // only exists if count != 0. 8-byte aligned
}; };
struct AdpcmBook struct AdpcmBook {
{
s32 order; s32 order;
s32 npredictors; s32 npredictors;
s16 book[1]; // size 8 * order * npredictors. 8-byte aligned s16 book[1]; // size 8 * order * npredictors. 8-byte aligned
}; };
struct AudioBankSample struct AudioBankSample {
{
#ifdef VERSION_SH #ifdef VERSION_SH
/* 0x00 */ u32 codec : 4; /* 0x00 */ u32 codec : 4;
/* 0x00 */ u32 medium : 2; /* 0x00 */ u32 medium : 2;
@ -190,14 +185,12 @@ struct AudioBankSample
#endif #endif
}; };
struct AudioBankSound struct AudioBankSound {
{
struct AudioBankSample *sample; struct AudioBankSample *sample;
f32 tuning; // frequency scale factor f32 tuning; // frequency scale factor
}; // size = 0x8 }; // size = 0x8
struct Instrument struct Instrument {
{
/*0x00*/ u8 loaded; /*0x00*/ u8 loaded;
/*0x01*/ u8 normalRangeLo; /*0x01*/ u8 normalRangeLo;
/*0x02*/ u8 normalRangeHi; /*0x02*/ u8 normalRangeHi;
@ -208,8 +201,7 @@ struct Instrument
/*0x18*/ struct AudioBankSound highNotesSound; /*0x18*/ struct AudioBankSound highNotesSound;
}; // size = 0x20 }; // size = 0x20
struct Drum struct Drum {
{
u8 releaseRate; u8 releaseRate;
u8 pan; u8 pan;
u8 loaded; u8 loaded;
@ -217,14 +209,12 @@ struct Drum
struct AdsrEnvelope *envelope; struct AdsrEnvelope *envelope;
}; };
struct AudioBank struct AudioBank {
{
struct Drum **drums; struct Drum **drums;
struct Instrument *instruments[1]; struct Instrument *instruments[1];
}; // dynamic size }; // dynamic size
struct CtlEntry struct CtlEntry {
{
#ifndef VERSION_SH #ifndef VERSION_SH
u8 unused; u8 unused;
#endif #endif
@ -246,8 +236,7 @@ struct M64ScriptState {
}; // size = 0x1C }; // size = 0x1C
// Also known as a Group, according to debug strings. // Also known as a Group, according to debug strings.
struct SequencePlayer struct SequencePlayer {
{
/*US/JP, EU, SH */ /*US/JP, EU, SH */
#if defined(VERSION_EU) || defined(VERSION_SH) #if defined(VERSION_EU) || defined(VERSION_SH)
/*0x000, 0x000, 0x000*/ u8 enabled : 1; /*0x000, 0x000, 0x000*/ u8 enabled : 1;
@ -325,8 +314,7 @@ struct SequencePlayer
/*0x13C, 0x144*/ ssize_t bankDmaRemaining; /*0x13C, 0x144*/ ssize_t bankDmaRemaining;
}; // size = 0x140, 0x148 on EU, 0x14C on SH }; // size = 0x140, 0x148 on EU, 0x14C on SH
struct AdsrSettings struct AdsrSettings {
{
u8 releaseRate; u8 releaseRate;
#if defined(VERSION_EU) || defined(VERSION_SH) #if defined(VERSION_EU) || defined(VERSION_SH)
u8 sustain; u8 sustain;
@ -388,8 +376,7 @@ struct ReverbInfo {
s16 *filter; s16 *filter;
}; };
struct NoteAttributes struct NoteAttributes {
{
u8 reverbVol; u8 reverbVol;
#ifdef VERSION_SH #ifdef VERSION_SH
u8 synthesisVolume; // UQ4.4, although 0 <= x < 1 is rounded up to 1 u8 synthesisVolume; // UQ4.4, although 0 <= x < 1 is rounded up to 1
@ -412,8 +399,7 @@ struct NoteAttributes
// Also known as a SubTrack, according to debug strings. // Also known as a SubTrack, according to debug strings.
// Confusingly, a SubTrack is a container of Tracks. // Confusingly, a SubTrack is a container of Tracks.
struct SequenceChannel struct SequenceChannel {
{
/* U/J, EU, SH */ /* U/J, EU, SH */
/*0x00, 0x00*/ u8 enabled : 1; /*0x00, 0x00*/ u8 enabled : 1;
/*0x00, 0x00*/ u8 finished : 1; /*0x00, 0x00*/ u8 finished : 1;
@ -495,8 +481,7 @@ struct SequenceChannel
}; // size = 0xC0, 0xC4 in EU, 0xD0 in SH }; // size = 0xC0, 0xC4 in EU, 0xD0 in SH
// Also known as a Track, according to debug strings. // Also known as a Track, according to debug strings.
struct SequenceChannelLayer struct SequenceChannelLayer {
{
/* U/J, EU, SH */ /* U/J, EU, SH */
/*0x00, 0x00*/ u8 enabled : 1; /*0x00, 0x00*/ u8 enabled : 1;
/*0x00, 0x00*/ u8 finished : 1; /*0x00, 0x00*/ u8 finished : 1;
@ -554,8 +539,7 @@ struct SequenceChannelLayer
}; // size = 0x80 }; // size = 0x80
#if defined(VERSION_EU) || defined(VERSION_SH) #if defined(VERSION_EU) || defined(VERSION_SH)
struct NoteSynthesisState struct NoteSynthesisState {
{
/*0x00*/ u8 restart; /*0x00*/ u8 restart;
/*0x01*/ u8 sampleDmaIndex; /*0x01*/ u8 sampleDmaIndex;
/*0x02*/ u8 prevHeadsetPanRight; /*0x02*/ u8 prevHeadsetPanRight;
@ -570,8 +554,7 @@ struct NoteSynthesisState
/*0x10*/ s16 curVolLeft; // UQ0.16 (EU Q1.15) /*0x10*/ s16 curVolLeft; // UQ0.16 (EU Q1.15)
/*0x12*/ s16 curVolRight; // UQ0.16 (EU Q1.15) /*0x12*/ s16 curVolRight; // UQ0.16 (EU Q1.15)
}; };
struct NotePlaybackState struct NotePlaybackState {
{
/* U/J, EU, SH */ /* U/J, EU, SH */
/*0x04, 0x00, 0x00*/ u8 priority; /*0x04, 0x00, 0x00*/ u8 priority;
/* 0x01, 0x01*/ u8 waveId; /* 0x01, 0x01*/ u8 waveId;
@ -591,8 +574,7 @@ struct NotePlaybackState
/*0x74, 0x4C, */ struct Portamento portamento; /*0x74, 0x4C, */ struct Portamento portamento;
/*0x84, 0x5C, */ struct VibratoState vibratoState; /*0x84, 0x5C, */ struct VibratoState vibratoState;
}; };
struct NoteSubEu struct NoteSubEu {
{
/*0x00*/ volatile u8 enabled : 1; /*0x00*/ volatile u8 enabled : 1;
/*0x00*/ u8 needsInit : 1; /*0x00*/ u8 needsInit : 1;
/*0x00*/ u8 finished : 1; /*0x00*/ u8 finished : 1;
@ -624,8 +606,7 @@ struct NoteSubEu
/*0x10*/ s16 *filter; /*0x10*/ s16 *filter;
#endif #endif
}; };
struct Note struct Note {
{
/* U/J, EU, SH */ /* U/J, EU, SH */
/*0xA4, 0x00, 0x00*/ struct AudioListItem listItem; /*0xA4, 0x00, 0x00*/ struct AudioListItem listItem;
/* 0x10, 0x10*/ struct NoteSynthesisState synthesisState; /* 0x10, 0x10*/ struct NoteSynthesisState synthesisState;
@ -660,14 +641,12 @@ struct Note
}; // size = 0xC0, known to be 0xC8 on SH }; // size = 0xC0, known to be 0xC8 on SH
#else #else
// volatile Note, needed in synthesis_process_notes // volatile Note, needed in synthesis_process_notes
struct vNote struct vNote {
{
/* U/J, EU */ /* U/J, EU */
/*0x00*/ volatile u8 enabled : 1; /*0x00*/ volatile u8 enabled : 1;
long long int force_structure_alignment; long long int force_structure_alignment;
}; // size = 0xC0 }; // size = 0xC0
struct Note struct Note {
{
/* U/J, EU */ /* U/J, EU */
/*0x00*/ u8 enabled : 1; /*0x00*/ u8 enabled : 1;
/*0x00*/ u8 needsInit : 1; /*0x00*/ u8 needsInit : 1;
@ -717,8 +696,7 @@ struct Note
}; // size = 0xC0 }; // size = 0xC0
#endif #endif
struct NoteSynthesisBuffers struct NoteSynthesisBuffers {
{
s16 adpcmdecState[0x10]; s16 adpcmdecState[0x10];
s16 finalResampleState[0x10]; s16 finalResampleState[0x10];
#ifdef VERSION_SH #ifdef VERSION_SH
@ -737,15 +715,13 @@ struct NoteSynthesisBuffers
}; };
#ifdef VERSION_EU #ifdef VERSION_EU
struct ReverbSettingsEU struct ReverbSettingsEU {
{
u8 downsampleRate; u8 downsampleRate;
u8 windowSize; // To be multiplied by 64 u8 windowSize; // To be multiplied by 64
u16 gain; u16 gain;
}; };
#else #else
struct ReverbSettingsEU struct ReverbSettingsEU {
{
u8 downsampleRate; // always 1 u8 downsampleRate; // always 1
u8 windowSize; // To be multiplied by 16 u8 windowSize; // To be multiplied by 16
u16 gain; u16 gain;
@ -758,8 +734,7 @@ struct ReverbSettingsEU
}; };
#endif #endif
struct AudioSessionSettingsEU struct AudioSessionSettingsEU {
{
/* 0x00 */ u32 frequency; /* 0x00 */ u32 frequency;
/* 0x04 */ u8 unk1; // always 1 /* 0x04 */ u8 unk1; // always 1
/* 0x05 */ u8 maxSimultaneousNotes; /* 0x05 */ u8 maxSimultaneousNotes;
@ -782,8 +757,7 @@ struct AudioSessionSettingsEU
#endif #endif
}; // 0x30 on shindou }; // 0x30 on shindou
struct AudioSessionSettings struct AudioSessionSettings {
{
/*0x00*/ u32 frequency; /*0x00*/ u32 frequency;
/*0x04*/ u8 maxSimultaneousNotes; /*0x04*/ u8 maxSimultaneousNotes;
/*0x05*/ u8 reverbDownsampleRate; // always 1 /*0x05*/ u8 reverbDownsampleRate; // always 1

View file

@ -974,7 +974,8 @@ void audio_init() {
#endif #endif
#ifdef TARGET_N64 #ifdef TARGET_N64
eu_stubbed_printf_3("Clear Workarea %x -%x size %x \n", eu_stubbed_printf_3(
"Clear Workarea %x -%x size %x \n",
(uintptr_t) &gAudioGlobalsStartMarker, (uintptr_t) &gAudioGlobalsStartMarker,
(uintptr_t) &gAudioGlobalsEndMarker, (uintptr_t) &gAudioGlobalsEndMarker,
(uintptr_t) &gAudioGlobalsEndMarker - (uintptr_t) &gAudioGlobalsStartMarker (uintptr_t) &gAudioGlobalsEndMarker - (uintptr_t) &gAudioGlobalsStartMarker

View file

@ -254,8 +254,7 @@ void init_sample_dma_buffers(UNUSED s32 arg0) {
sSampleDmas = sound_alloc_uninitialized(&gNotesAndBuffersPool, sSampleDmas = sound_alloc_uninitialized(&gNotesAndBuffersPool,
gMaxSimultaneousNotes * 4 * sizeof(struct SharedDma) * gAudioBufferParameters.presetUnk4); gMaxSimultaneousNotes * 4 * sizeof(struct SharedDma) * gAudioBufferParameters.presetUnk4);
for (i = 0; i < gMaxSimultaneousNotes * 3 * gAudioBufferParameters.presetUnk4; i++) for (i = 0; i < gMaxSimultaneousNotes * 3 * gAudioBufferParameters.presetUnk4; i++) {
{
if ((sSampleDmas[gSampleDmaNumListItems].buffer = sound_alloc_uninitialized(&gNotesAndBuffersPool, sDmaBufSize)) == NULL) { if ((sSampleDmas[gSampleDmaNumListItems].buffer = sound_alloc_uninitialized(&gNotesAndBuffersPool, sDmaBufSize)) == NULL) {
break; break;
} }
@ -622,8 +621,7 @@ void *func_sh_802f3764(s32 poolIdx, s32 idx, s32 *arg2) {
devAddr = f->seqArray[idx].offset; devAddr = f->seqArray[idx].offset;
switch (sp18) switch (sp18) {
{
case 0: case 0:
vAddr = unk_pool1_alloc(poolIdx, idx, size); vAddr = unk_pool1_alloc(poolIdx, idx, size);
if (vAddr == NULL) { if (vAddr == NULL) {
@ -1033,7 +1031,8 @@ void audio_init() {
port_eu_init(); port_eu_init();
#ifdef TARGET_N64 #ifdef TARGET_N64
eu_stubbed_printf_3("Clear Workarea %x -%x size %x \n", eu_stubbed_printf_3(
"Clear Workarea %x -%x size %x \n",
(uintptr_t) &gAudioGlobalsStartMarker, (uintptr_t) &gAudioGlobalsStartMarker,
(uintptr_t) &gAudioGlobalsEndMarker, (uintptr_t) &gAudioGlobalsEndMarker,
(uintptr_t) &gAudioGlobalsEndMarker - (uintptr_t) &gAudioGlobalsStartMarker (uintptr_t) &gAudioGlobalsEndMarker - (uintptr_t) &gAudioGlobalsStartMarker
@ -1544,7 +1543,7 @@ s32 func_sh_802f573c(s32 audioResetStatus) {
if (D_SH_8034F68C > 0) { if (D_SH_8034F68C > 0) {
if (audioResetStatus != 0) { if (audioResetStatus != 0) {
if (osRecvMesg(&gUnkQueue2, (OSMesg *) &idx, OS_MESG_NOBLOCK)){ if (osRecvMesg(&gUnkQueue2, (OSMesg *) &idx, OS_MESG_NOBLOCK)) {
} }
D_SH_8034F68C = 0; D_SH_8034F68C = 0;
return 0; return 0;

View file

@ -279,8 +279,7 @@ void func_802ad7ec(u32 arg0) {
} }
else if (seqPlayer->enabled != FALSE && cmd->u.s.arg2 < 0x10) { else if (seqPlayer->enabled != FALSE && cmd->u.s.arg2 < 0x10) {
chan = seqPlayer->channels[cmd->u.s.arg2]; chan = seqPlayer->channels[cmd->u.s.arg2];
if (IS_SEQUENCE_CHANNEL_VALID(chan)) if (IS_SEQUENCE_CHANNEL_VALID(chan)) {
{
switch (cmd->u.s.op) { switch (cmd->u.s.op) {
case 1: case 1:
chan->volumeScale = cmd->u2.as_f32; chan->volumeScale = cmd->u2.as_f32;

View file

@ -370,8 +370,7 @@ void func_802ad7ec(u32 arg0) {
} }
else if (seqPlayer->enabled != FALSE && cmd->u.s.arg2 < 0x10) { else if (seqPlayer->enabled != FALSE && cmd->u.s.arg2 < 0x10) {
chan = seqPlayer->channels[cmd->u.s.arg2]; chan = seqPlayer->channels[cmd->u.s.arg2];
if (IS_SEQUENCE_CHANNEL_VALID(chan)) if (IS_SEQUENCE_CHANNEL_VALID(chan)) {
{
switch (cmd->u.s.op) { switch (cmd->u.s.op) {
case 1: case 1:
if (chan->volumeScale != cmd->u2.as_f32) { if (chan->volumeScale != cmd->u2.as_f32) {

View file

@ -1390,8 +1390,7 @@ s32 seq_channel_layer_process_script_part3(struct SequenceChannelLayer *layer, s
layer->delay = sp3A; layer->delay = sp3A;
layer->duration = layer->noteDuration * sp3A >> 8; layer->duration = layer->noteDuration * sp3A >> 8;
if ((seqPlayer->muted && (seqChannel->muteBehavior & 0x50) != 0) if ((seqPlayer->muted && (seqChannel->muteBehavior & 0x50) != 0)
|| seqChannel->stopSomething2) || seqChannel->stopSomething2) {
{
layer->stopSomething = TRUE; layer->stopSomething = TRUE;
return -1; return -1;
} }
@ -1404,8 +1403,7 @@ u8 get_instrument(struct SequenceChannel *seqChannel, u8 instId, struct Instrume
struct Instrument *inst; struct Instrument *inst;
#if defined(VERSION_EU) || defined(VERSION_SH) #if defined(VERSION_EU) || defined(VERSION_SH)
inst = get_instrument_inner(seqChannel->bankId, instId); inst = get_instrument_inner(seqChannel->bankId, instId);
if (inst == NULL) if (inst == NULL) {
{
*instOut = NULL; *instOut = NULL;
return 0; return 0;
} }
@ -1524,25 +1522,21 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) {
for (;;) { for (;;) {
cmd = m64_read_u8(state); cmd = m64_read_u8(state);
#if !defined(VERSION_EU) && !defined(VERSION_SH) #if !defined(VERSION_EU) && !defined(VERSION_SH)
if (cmd == 0xff) // chan_end if (cmd == 0xff) { // chan_end
{
if (state->depth == 0) { if (state->depth == 0) {
sequence_channel_disable(seqChannel); sequence_channel_disable(seqChannel);
break; break;
} }
state->depth--, state->pc = state->stack[state->depth]; state->depth--, state->pc = state->stack[state->depth];
} }
if (cmd == 0xfe) // chan_delay1 if (cmd == 0xfe) { // chan_delay1
{
break; break;
} }
if (cmd == 0xfd) // chan_delay if (cmd == 0xfd) { // chan_delay
{
seqChannel->delay = m64_read_compressed_u16(state); seqChannel->delay = m64_read_compressed_u16(state);
break; break;
} }
if (cmd == 0xf3) // chan_hang if (cmd == 0xf3) { // chan_hang
{
seqChannel->stopScript = TRUE; seqChannel->stopScript = TRUE;
break; break;
} }
@ -2362,8 +2356,7 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
#endif #endif
for (;;) { for (;;) {
cmd = m64_read_u8(state); cmd = m64_read_u8(state);
if (cmd == 0xff) // seq_end if (cmd == 0xff) { // seq_end
{
if (state->depth == 0) { if (state->depth == 0) {
sequence_player_disable(seqPlayer); sequence_player_disable(seqPlayer);
break; break;
@ -2375,14 +2368,12 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
#endif #endif
} }
if (cmd == 0xfd) // seq_delay if (cmd == 0xfd) { // seq_delay
{
seqPlayer->delay = m64_read_compressed_u16(state); seqPlayer->delay = m64_read_compressed_u16(state);
break; break;
} }
if (cmd == 0xfe) // seq_delay1 if (cmd == 0xfe) { // seq_delay1
{
seqPlayer->delay = 1; seqPlayer->delay = 1;
break; break;
} }
@ -2502,7 +2493,7 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
seqPlayer->tempo = gTempoInternalToExternal; seqPlayer->tempo = gTempoInternalToExternal;
} }
//if (cmd){} //if (cmd) {}
if ((s16) seqPlayer->tempo <= 0) { if ((s16) seqPlayer->tempo <= 0) {
seqPlayer->tempo = 1; seqPlayer->tempo = 1;

View file

@ -17,8 +17,7 @@
#define MAX_UPDATES_PER_FRAME 4 #define MAX_UPDATES_PER_FRAME 4
#endif #endif
struct ReverbRingBufferItem struct ReverbRingBufferItem {
{
s16 numSamplesAfterDownsampling; s16 numSamplesAfterDownsampling;
s16 chunkLen; // never read s16 chunkLen; // never read
s16 *toDownsampleLeft; s16 *toDownsampleLeft;
@ -28,8 +27,7 @@ struct ReverbRingBufferItem
s16 lengthB; // second length in ring buffer (from pos 0) s16 lengthB; // second length in ring buffer (from pos 0)
}; // size = 0x14 }; // size = 0x14
struct SynthesisReverb struct SynthesisReverb {
{
/*0x00, 0x00, 0x00*/ u8 resampleFlags; /*0x00, 0x00, 0x00*/ u8 resampleFlags;
/*0x01, 0x01, 0x01*/ u8 useReverb; /*0x01, 0x01, 0x01*/ u8 useReverb;
/*0x02, 0x02, 0x02*/ u8 framesLeftToIgnore; /*0x02, 0x02, 0x02*/ u8 framesLeftToIgnore;
@ -53,8 +51,7 @@ struct SynthesisReverb
/*0x08, 0x0C, 0x14*/ s32 nextRingBufferPos; /*0x08, 0x0C, 0x14*/ s32 nextRingBufferPos;
/*0x0C, 0x10, 0x18*/ s32 unkC; // never read /*0x0C, 0x10, 0x18*/ s32 unkC; // never read
/*0x10, 0x14, 0x1C*/ s32 bufSizePerChannel; /*0x10, 0x14, 0x1C*/ s32 bufSizePerChannel;
struct struct {
{
s16 *left; s16 *left;
s16 *right; s16 *right;
} ringBuffer; } ringBuffer;

View file

@ -40,8 +40,3 @@ ALIGNED8 u8 gAudioSPTaskYieldBuffer[OS_YIELD_AUDIO_SIZE];
#if !defined(F3DEX_GBI_SHARED) && !defined(VERSION_EU) #if !defined(F3DEX_GBI_SHARED) && !defined(VERSION_EU)
ALIGNED8 u8 gUnusedThread2Stack[0x1400]; ALIGNED8 u8 gUnusedThread2Stack[0x1400];
#endif #endif

View file

@ -4,9 +4,9 @@
// 0x70800 bytes // 0x70800 bytes
#ifdef AVOID_UB #ifdef AVOID_UB
u16 gFrameBuffers[3][SCREEN_WIDTH * SCREEN_HEIGHT]; u16 gFramebuffers[3][SCREEN_WIDTH * SCREEN_HEIGHT];
#else #else
u16 gFrameBuffer0[SCREEN_WIDTH * SCREEN_HEIGHT]; u16 gFramebuffer0[SCREEN_WIDTH * SCREEN_HEIGHT];
u16 gFrameBuffer1[SCREEN_WIDTH * SCREEN_HEIGHT]; u16 gFramebuffer1[SCREEN_WIDTH * SCREEN_HEIGHT];
u16 gFrameBuffer2[SCREEN_WIDTH * SCREEN_HEIGHT]; u16 gFramebuffer2[SCREEN_WIDTH * SCREEN_HEIGHT];
#endif #endif

View file

@ -9,14 +9,14 @@
// -g codegen implies that they are separate variables. This is impossible to // -g codegen implies that they are separate variables. This is impossible to
// reconcile without undefined behavior. Avoid that when possible. // reconcile without undefined behavior. Avoid that when possible.
#ifdef AVOID_UB #ifdef AVOID_UB
extern u16 gFrameBuffers[3][SCREEN_WIDTH * SCREEN_HEIGHT]; extern u16 gFramebuffers[3][SCREEN_WIDTH * SCREEN_HEIGHT];
#define gFrameBuffer0 gFrameBuffers[0] #define gFramebuffer0 gFramebuffers[0]
#define gFrameBuffer1 gFrameBuffers[1] #define gFramebuffer1 gFramebuffers[1]
#define gFrameBuffer2 gFrameBuffers[2] #define gFramebuffer2 gFramebuffers[2]
#else #else
extern u16 gFrameBuffer0[SCREEN_WIDTH * SCREEN_HEIGHT]; extern u16 gFramebuffer0[SCREEN_WIDTH * SCREEN_HEIGHT];
extern u16 gFrameBuffer1[SCREEN_WIDTH * SCREEN_HEIGHT]; extern u16 gFramebuffer1[SCREEN_WIDTH * SCREEN_HEIGHT];
extern u16 gFrameBuffer2[SCREEN_WIDTH * SCREEN_HEIGHT]; extern u16 gFramebuffer2[SCREEN_WIDTH * SCREEN_HEIGHT];
#endif #endif
#endif // FRAMEBUFFERS_H #endif // FRAMEBUFFERS_H

View file

@ -904,7 +904,7 @@ static BhvCommandProc BehaviorCmdTable[] = {
// Execute the behavior script of the current object, process the object flags, and other miscellaneous code for updating objects. // Execute the behavior script of the current object, process the object flags, and other miscellaneous code for updating objects.
void cur_obj_update(void) { void cur_obj_update(void) {
UNUSED u32 unused; UNUSED u8 filler[4];
s16 objFlags = gCurrentObject->oFlags; s16 objFlags = gCurrentObject->oFlags;
f32 distanceFromMario; f32 distanceFromMario;

View file

@ -293,7 +293,7 @@ void geo_layout_cmd_nop3(void) {
} }
/* /*
0x0C: Create zbuffer-toggling scene graph node 0x0C: Create z-buffer-toggling scene graph node
cmd+0x01: u8 enableZBuffer (1 = on, 0 = off) cmd+0x01: u8 enableZBuffer (1 = on, 0 = off)
*/ */
void geo_layout_cmd_node_master_list(void) { void geo_layout_cmd_node_master_list(void) {

View file

@ -719,7 +719,7 @@ void geo_obj_init_spawninfo(struct GraphNodeObject *graphNode, struct SpawnInfo
graphNode->areaIndex = spawn->areaIndex; graphNode->areaIndex = spawn->areaIndex;
graphNode->activeAreaIndex = spawn->activeAreaIndex; graphNode->activeAreaIndex = spawn->activeAreaIndex;
graphNode->sharedChild = spawn->unk18; graphNode->sharedChild = spawn->model;
graphNode->unk4C = spawn; graphNode->unk4C = spawn;
graphNode->throwMatrix = NULL; graphNode->throwMatrix = NULL;
graphNode->animInfo.curAnim = 0; graphNode->animInfo.curAnim = 0;
@ -791,9 +791,7 @@ s32 retrieve_animation_index(s32 frame, u16 **attributes) {
*/ */
s16 geo_update_animation_frame(struct AnimInfo *obj, s32 *accelAssist) { s16 geo_update_animation_frame(struct AnimInfo *obj, s32 *accelAssist) {
s32 result; s32 result;
struct Animation *anim; struct Animation *anim = obj->curAnim;
anim = obj->curAnim;
if (obj->animTimer == gAreaUpdateCounter || anim->flags & ANIM_FLAG_2) { if (obj->animTimer == gAreaUpdateCounter || anim->flags & ANIM_FLAG_2) {
if (accelAssist != NULL) { if (accelAssist != NULL) {
@ -804,7 +802,7 @@ s16 geo_update_animation_frame(struct AnimInfo *obj, s32 *accelAssist) {
} }
if (anim->flags & ANIM_FLAG_FORWARD) { if (anim->flags & ANIM_FLAG_FORWARD) {
if (obj->animAccel) { if (obj->animAccel != 0) {
result = obj->animFrameAccelAssist - obj->animAccel; result = obj->animFrameAccelAssist - obj->animAccel;
} else { } else {
result = (obj->animFrame - 1) << 16; result = (obj->animFrame - 1) << 16;

View file

@ -68,16 +68,14 @@ typedef Gfx *(*GraphNodeFunc)(s32 callContext, struct GraphNode *node, void *con
* Many graph node types have an update function that gets called * Many graph node types have an update function that gets called
* when they are processed. * when they are processed.
*/ */
struct FnGraphNode struct FnGraphNode {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ GraphNodeFunc func; /*0x14*/ GraphNodeFunc func;
}; };
/** The very root of the geo tree. Specifies the viewport. /** The very root of the geo tree. Specifies the viewport.
*/ */
struct GraphNodeRoot struct GraphNodeRoot {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ u8 areaIndex; /*0x14*/ u8 areaIndex;
/*0x15*/ s8 unk15; // ? /*0x15*/ s8 unk15; // ?
@ -92,8 +90,7 @@ struct GraphNodeRoot
/** A node that sets up an orthographic projection based on the global /** A node that sets up an orthographic projection based on the global
* root node. Used to draw the skybox image. * root node. Used to draw the skybox image.
*/ */
struct GraphNodeOrthoProjection struct GraphNodeOrthoProjection {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ f32 scale; /*0x14*/ f32 scale;
}; };
@ -102,8 +99,7 @@ struct GraphNodeOrthoProjection
* game world. It does not set up the camera position, that is done by * game world. It does not set up the camera position, that is done by
* the child of this node, which has type GraphNodeCamera. * the child of this node, which has type GraphNodeCamera.
*/ */
struct GraphNodePerspective struct GraphNodePerspective {
{
/*0x00*/ struct FnGraphNode fnNode; /*0x00*/ struct FnGraphNode fnNode;
/*0x18*/ s32 unused; /*0x18*/ s32 unused;
/*0x1C*/ f32 fov; // horizontal field of view in degrees /*0x1C*/ f32 fov; // horizontal field of view in degrees
@ -114,8 +110,7 @@ struct GraphNodePerspective
/** An entry in the master list. It is a linked list of display lists /** An entry in the master list. It is a linked list of display lists
* carrying a transformation matrix. * carrying a transformation matrix.
*/ */
struct DisplayListNode struct DisplayListNode {
{
Mtx *transform; Mtx *transform;
void *displayList; void *displayList;
struct DisplayListNode *next; struct DisplayListNode *next;
@ -126,8 +121,7 @@ struct DisplayListNode
* different master list than opaque objects. * different master list than opaque objects.
* It also sets the z-buffer on before rendering and off after. * It also sets the z-buffer on before rendering and off after.
*/ */
struct GraphNodeMasterList struct GraphNodeMasterList {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ struct DisplayListNode *listHeads[GFX_NUM_MASTER_LISTS]; /*0x14*/ struct DisplayListNode *listHeads[GFX_NUM_MASTER_LISTS];
/*0x34*/ struct DisplayListNode *listTails[GFX_NUM_MASTER_LISTS]; /*0x34*/ struct DisplayListNode *listTails[GFX_NUM_MASTER_LISTS];
@ -136,8 +130,7 @@ struct GraphNodeMasterList
/** Simply used as a parent to group multiple children. /** Simply used as a parent to group multiple children.
* Does not have any additional functionality. * Does not have any additional functionality.
*/ */
struct GraphNodeStart struct GraphNodeStart {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
}; };
@ -147,8 +140,7 @@ struct GraphNodeStart
* Usage examples: Mario has three level's of detail: Normal, low-poly arms only, and fully low-poly * Usage examples: Mario has three level's of detail: Normal, low-poly arms only, and fully low-poly
* The tower in Whomp's fortress has two levels of detail. * The tower in Whomp's fortress has two levels of detail.
*/ */
struct GraphNodeLevelOfDetail struct GraphNodeLevelOfDetail {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ s16 minDistance; /*0x14*/ s16 minDistance;
/*0x16*/ s16 maxDistance; /*0x16*/ s16 maxDistance;
@ -159,8 +151,7 @@ struct GraphNodeLevelOfDetail
* which is set in the node's function. * which is set in the node's function.
* Usage examples: room visibility, coin animation, blinking, Mario's power-up / hand pose / cap * Usage examples: room visibility, coin animation, blinking, Mario's power-up / hand pose / cap
*/ */
struct GraphNodeSwitchCase struct GraphNodeSwitchCase {
{
/*0x00*/ struct FnGraphNode fnNode; /*0x00*/ struct FnGraphNode fnNode;
/*0x18*/ s32 unused; /*0x18*/ s32 unused;
/*0x1C*/ s16 numCases; /*0x1C*/ s16 numCases;
@ -171,8 +162,7 @@ struct GraphNodeSwitchCase
* GraphNode that specifies the location and aim of the camera. * GraphNode that specifies the location and aim of the camera.
* When the roll is 0, the up vector is (0, 1, 0). * When the roll is 0, the up vector is (0, 1, 0).
*/ */
struct GraphNodeCamera struct GraphNodeCamera {
{
/*0x00*/ struct FnGraphNode fnNode; /*0x00*/ struct FnGraphNode fnNode;
/*0x18*/ union { /*0x18*/ union {
// When the node is created, a mode is assigned to the node. // When the node is created, a mode is assigned to the node.
@ -195,8 +185,7 @@ struct GraphNodeCamera
* based on the ENEMYINFO array. * based on the ENEMYINFO array.
* The display list can be null, in which case it won't draw anything itself. * The display list can be null, in which case it won't draw anything itself.
*/ */
struct GraphNodeTranslationRotation struct GraphNodeTranslationRotation {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ void *displayList; /*0x14*/ void *displayList;
/*0x18*/ Vec3s translation; /*0x18*/ Vec3s translation;
@ -207,12 +196,11 @@ struct GraphNodeTranslationRotation
* Usage example: SUPER MARIO logo letters in debug level select. * Usage example: SUPER MARIO logo letters in debug level select.
* The display list can be null, in which case it won't draw anything itself. * The display list can be null, in which case it won't draw anything itself.
*/ */
struct GraphNodeTranslation struct GraphNodeTranslation {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ void *displayList; /*0x14*/ void *displayList;
/*0x18*/ Vec3s translation; /*0x18*/ Vec3s translation;
u8 pad1E[2]; u8 filler[2];
}; };
/** GraphNode that rotates itself and its children. /** GraphNode that rotates itself and its children.
@ -220,12 +208,11 @@ struct GraphNodeTranslation
* set by a parent script node in that case. * set by a parent script node in that case.
* The display list can be null, in which case it won't draw anything itself. * The display list can be null, in which case it won't draw anything itself.
*/ */
struct GraphNodeRotation struct GraphNodeRotation {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ void *displayList; /*0x14*/ void *displayList;
/*0x18*/ Vec3s rotation; /*0x18*/ Vec3s rotation;
u8 pad1E[2]; u8 filler[2];
}; };
/** GraphNode part that transforms itself and its children based on animation /** GraphNode part that transforms itself and its children based on animation
@ -235,8 +222,7 @@ struct GraphNodeRotation
* Used for Mario, enemies and anything else with animation data. * Used for Mario, enemies and anything else with animation data.
* The display list can be null, in which case it won't draw anything itself. * The display list can be null, in which case it won't draw anything itself.
*/ */
struct GraphNodeAnimatedPart struct GraphNodeAnimatedPart {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ void *displayList; /*0x14*/ void *displayList;
/*0x18*/ Vec3s translation; /*0x18*/ Vec3s translation;
@ -247,8 +233,7 @@ struct GraphNodeAnimatedPart
* then it simply sets the billboard flag for the entire object, this node is * then it simply sets the billboard flag for the entire object, this node is
* used for billboard parts (like a chuckya or goomba body). * used for billboard parts (like a chuckya or goomba body).
*/ */
struct GraphNodeBillboard struct GraphNodeBillboard {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ void *displayList; /*0x14*/ void *displayList;
/*0x18*/ Vec3s translation; /*0x18*/ Vec3s translation;
@ -257,8 +242,7 @@ struct GraphNodeBillboard
/** A GraphNode that simply draws a display list without doing any /** A GraphNode that simply draws a display list without doing any
* transformation beforehand. It does inherit the parent's transformation. * transformation beforehand. It does inherit the parent's transformation.
*/ */
struct GraphNodeDisplayList struct GraphNodeDisplayList {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ void *displayList; /*0x14*/ void *displayList;
}; };
@ -271,8 +255,7 @@ struct GraphNodeDisplayList
* There is also a level command that scales the entire level, used for THI. * There is also a level command that scales the entire level, used for THI.
* The display list can be null, in which case it won't draw anything itself. * The display list can be null, in which case it won't draw anything itself.
*/ */
struct GraphNodeScale struct GraphNodeScale {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ void *displayList; /*0x14*/ void *displayList;
/*0x18*/ f32 scale; /*0x18*/ f32 scale;
@ -283,8 +266,7 @@ struct GraphNodeScale
* The shadow type determines the shape (round or rectangular), vertices (4 or 9) * The shadow type determines the shape (round or rectangular), vertices (4 or 9)
* and other features. * and other features.
*/ */
struct GraphNodeShadow struct GraphNodeShadow {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ s16 shadowScale; // diameter (when a circle) or side (when a square) of shadow /*0x14*/ s16 shadowScale; // diameter (when a circle) or side (when a square) of shadow
/*0x16*/ u8 shadowSolidity; // opacity of shadow, 255 = opaque /*0x16*/ u8 shadowSolidity; // opacity of shadow, 255 = opaque
@ -294,8 +276,7 @@ struct GraphNodeShadow
/** GraphNode that contains as its sharedChild a group node containing all /** GraphNode that contains as its sharedChild a group node containing all
* object nodes. * object nodes.
*/ */
struct GraphNodeObjectParent struct GraphNodeObjectParent {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ struct GraphNode *sharedChild; /*0x14*/ struct GraphNode *sharedChild;
}; };
@ -308,8 +289,7 @@ struct GraphNodeObjectParent
* The parameter field gives extra context info. For shifting sand or paintings, * The parameter field gives extra context info. For shifting sand or paintings,
* it can determine which texture to use. * it can determine which texture to use.
*/ */
struct GraphNodeGenerated struct GraphNodeGenerated {
{
/*0x00*/ struct FnGraphNode fnNode; /*0x00*/ struct FnGraphNode fnNode;
/*0x18*/ u32 parameter; // extra context for the function /*0x18*/ u32 parameter; // extra context for the function
}; };
@ -317,8 +297,7 @@ struct GraphNodeGenerated
/** GraphNode that draws a background image or a rectangle of a color. /** GraphNode that draws a background image or a rectangle of a color.
* Drawn in an orthographic projection, used for skyboxes. * Drawn in an orthographic projection, used for skyboxes.
*/ */
struct GraphNodeBackground struct GraphNodeBackground {
{
/*0x00*/ struct FnGraphNode fnNode; /*0x00*/ struct FnGraphNode fnNode;
/*0x18*/ s32 unused; /*0x18*/ s32 unused;
/*0x1C*/ s32 background; // background ID, or rgba5551 color if fnNode.func is null /*0x1C*/ s32 background; // background ID, or rgba5551 color if fnNode.func is null
@ -326,8 +305,7 @@ struct GraphNodeBackground
/** Renders the object that Mario is holding. /** Renders the object that Mario is holding.
*/ */
struct GraphNodeHeldObject struct GraphNodeHeldObject {
{
/*0x00*/ struct FnGraphNode fnNode; /*0x00*/ struct FnGraphNode fnNode;
/*0x18*/ s32 playerIndex; /*0x18*/ s32 playerIndex;
/*0x1C*/ struct Object *objNode; /*0x1C*/ struct Object *objNode;
@ -339,11 +317,10 @@ struct GraphNodeHeldObject
* object node. Used for very large objects, such as shock wave rings that Bowser * object node. Used for very large objects, such as shock wave rings that Bowser
* creates, tornadoes, the big eel. * creates, tornadoes, the big eel.
*/ */
struct GraphNodeCullingRadius struct GraphNodeCullingRadius {
{
/*0x00*/ struct GraphNode node; /*0x00*/ struct GraphNode node;
/*0x14*/ s16 cullingRadius; // specifies the 'sphere radius' for purposes of frustum culling /*0x14*/ s16 cullingRadius; // specifies the 'sphere radius' for purposes of frustum culling
u8 pad1E[2]; u8 filler[2];
}; };
extern struct GraphNodeMasterList *gCurGraphNodeMasterList; extern struct GraphNodeMasterList *gCurGraphNodeMasterList;

View file

@ -286,7 +286,7 @@ static void level_cmd_load_mario_head(void) {
if (addr != NULL) { if (addr != NULL) {
gdm_init(addr, DOUBLE_SIZE_ON_64_BIT(0xE1000)); gdm_init(addr, DOUBLE_SIZE_ON_64_BIT(0xE1000));
gd_add_to_heap(gZBuffer, sizeof(gZBuffer)); // 0x25800 gd_add_to_heap(gZBuffer, sizeof(gZBuffer)); // 0x25800
gd_add_to_heap(gFrameBuffer0, 3 * sizeof(gFrameBuffer0)); // 0x70800 gd_add_to_heap(gFramebuffer0, 3 * sizeof(gFramebuffer0)); // 0x70800
gdm_setup(); gdm_setup();
gdm_maketestdl(CMD_GET(s16, 2)); gdm_maketestdl(CMD_GET(s16, 2));
} else { } else {
@ -425,7 +425,7 @@ static void level_cmd_init_mario(void) {
gMarioSpawnInfo->areaIndex = 0; gMarioSpawnInfo->areaIndex = 0;
gMarioSpawnInfo->behaviorArg = CMD_GET(u32, 4); gMarioSpawnInfo->behaviorArg = CMD_GET(u32, 4);
gMarioSpawnInfo->behaviorScript = CMD_GET(void *, 8); gMarioSpawnInfo->behaviorScript = CMD_GET(void *, 8);
gMarioSpawnInfo->unk18 = gLoadedGraphNodes[CMD_GET(u8, 3)]; gMarioSpawnInfo->model = gLoadedGraphNodes[CMD_GET(u8, 3)];
gMarioSpawnInfo->next = NULL; gMarioSpawnInfo->next = NULL;
sCurrentCmd = CMD_NEXT; sCurrentCmd = CMD_NEXT;
@ -453,7 +453,7 @@ static void level_cmd_place_object(void) {
spawnInfo->behaviorArg = CMD_GET(u32, 16); spawnInfo->behaviorArg = CMD_GET(u32, 16);
spawnInfo->behaviorScript = CMD_GET(void *, 20); spawnInfo->behaviorScript = CMD_GET(void *, 20);
spawnInfo->unk18 = gLoadedGraphNodes[model]; spawnInfo->model = gLoadedGraphNodes[model];
spawnInfo->next = gAreas[sCurrAreaIndex].objectSpawnInfos; spawnInfo->next = gAreas[sCurrAreaIndex].objectSpawnInfos;
gAreas[sCurrAreaIndex].objectSpawnInfos = spawnInfo; gAreas[sCurrAreaIndex].objectSpawnInfos = spawnInfo;
@ -545,8 +545,8 @@ static void level_cmd_3A(void) {
struct UnusedArea28 *val4; struct UnusedArea28 *val4;
if (sCurrAreaIndex != -1) { if (sCurrAreaIndex != -1) {
if ((val4 = gAreas[sCurrAreaIndex].unused28) == NULL) { if ((val4 = gAreas[sCurrAreaIndex].unused) == NULL) {
val4 = gAreas[sCurrAreaIndex].unused28 = val4 = gAreas[sCurrAreaIndex].unused =
alloc_only_pool_alloc(sLevelPool, sizeof(struct UnusedArea28)); alloc_only_pool_alloc(sLevelPool, sizeof(struct UnusedArea28));
} }

View file

@ -211,7 +211,7 @@ s32 find_wall_collisions(struct WallCollisionData *colData) {
numCollisions += find_wall_collisions_from_list(node, colData); numCollisions += find_wall_collisions_from_list(node, colData);
// Increment the debug tracker. // Increment the debug tracker.
gNumCalls.wall += 1; gNumCalls.wall++;
return numCollisions; return numCollisions;
} }
@ -305,18 +305,20 @@ static struct Surface *find_ceil_from_list(struct SurfaceNode *surfaceNode, s32
*/ */
f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil) { f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil) {
s16 cellZ, cellX; s16 cellZ, cellX;
struct Surface *ceil, *dynamicCeil; struct Surface *ceil, *dynamicCeil;
struct SurfaceNode *surfaceList; struct SurfaceNode *surfaceList;
f32 height = CELL_HEIGHT_LIMIT; f32 height = CELL_HEIGHT_LIMIT;
f32 dynamicHeight = CELL_HEIGHT_LIMIT; f32 dynamicHeight = CELL_HEIGHT_LIMIT;
s16 x, y, z;
//! (Parallel Universes) Because position is casted to an s16, reaching higher //! (Parallel Universes) Because position is casted to an s16, reaching higher
// float locations can return ceilings despite them not existing there. // float locations can return ceilings despite them not existing there.
//(Dynamic ceilings will unload due to the range.) // (Dynamic ceilings will unload due to the range.)
x = (s16) posX; s16 x = (s16) posX;
y = (s16) posY; s16 y = (s16) posY;
z = (s16) posZ; s16 z = (s16) posZ;
*pceil = NULL; *pceil = NULL;
if (x <= -LEVEL_BOUNDARY_MAX || x >= LEVEL_BOUNDARY_MAX) { if (x <= -LEVEL_BOUNDARY_MAX || x >= LEVEL_BOUNDARY_MAX) {
@ -346,7 +348,7 @@ f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil) {
*pceil = ceil; *pceil = ceil;
// Increment the debug tracker. // Increment the debug tracker.
gNumCalls.ceil += 1; gNumCalls.ceil++;
return height; return height;
} }
@ -519,7 +521,7 @@ f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
//! (Parallel Universes) Because position is casted to an s16, reaching higher //! (Parallel Universes) Because position is casted to an s16, reaching higher
// float locations can return floors despite them not existing there. // float locations can return floors despite them not existing there.
//(Dynamic floors will unload due to the range.) // (Dynamic floors will unload due to the range.)
s16 x = (s16) xPos; s16 x = (s16) xPos;
s16 y = (s16) yPos; s16 y = (s16) yPos;
s16 z = (s16) zPos; s16 z = (s16) zPos;
@ -563,7 +565,7 @@ f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
// If a floor was missed, increment the debug counter. // If a floor was missed, increment the debug counter.
if (floor == NULL) { if (floor == NULL) {
gNumFindFloorMisses += 1; gNumFindFloorMisses++;
} }
if (dynamicHeight > height) { if (dynamicHeight > height) {
@ -574,7 +576,7 @@ f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
*pfloor = floor; *pfloor = floor;
// Increment the debug tracker. // Increment the debug tracker.
gNumCalls.floor += 1; gNumCalls.floor++;
return height; return height;
} }
@ -624,7 +626,7 @@ f32 find_water_level(f32 x, f32 z) {
f32 find_poison_gas_level(f32 x, f32 z) { f32 find_poison_gas_level(f32 x, f32 z) {
s32 i; s32 i;
s32 numRegions; s32 numRegions;
UNUSED s32 unused; UNUSED u8 filler[4];
s16 val; s16 val;
f32 loX, hiX, loZ, hiZ; f32 loX, hiX, loZ, hiZ;
f32 gasLevel = FLOOR_LOWER_LIMIT; f32 gasLevel = FLOOR_LOWER_LIMIT;

View file

@ -17,19 +17,17 @@
// It doesn't match if ".0" is removed or ".f" is added // It doesn't match if ".0" is removed or ".f" is added
#define FLOOR_LOWER_LIMIT_SHADOW (FLOOR_LOWER_LIMIT + 1000.0) #define FLOOR_LOWER_LIMIT_SHADOW (FLOOR_LOWER_LIMIT + 1000.0)
struct WallCollisionData struct WallCollisionData {
{
/*0x00*/ f32 x, y, z; /*0x00*/ f32 x, y, z;
/*0x0C*/ f32 offsetY; /*0x0C*/ f32 offsetY;
/*0x10*/ f32 radius; /*0x10*/ f32 radius;
/*0x14*/ s16 unused; /*0x14*/ u8 filler[2];
/*0x16*/ s16 numWalls; /*0x16*/ s16 numWalls;
/*0x18*/ struct Surface *walls[4]; /*0x18*/ struct Surface *walls[4];
}; };
struct FloorGeometry struct FloorGeometry {
{ u8 filler[16]; // possibly position data?
f32 unused[4]; // possibly position data?
f32 normalX; f32 normalX;
f32 normalY; f32 normalY;
f32 normalZ; f32 normalZ;

View file

@ -1,7 +1,5 @@
#include <PR/ultratypes.h> #include <PR/ultratypes.h>
#include "prevent_bss_reordering.h"
#include "sm64.h" #include "sm64.h"
#include "game/ingame_menu.h" #include "game/ingame_menu.h"
#include "graph_node.h" #include "graph_node.h"
@ -213,7 +211,7 @@ static s16 lower_cell_index(s16 coord) {
//! Some wall checks are larger than the buffer, meaning wall checks can //! Some wall checks are larger than the buffer, meaning wall checks can
// miss walls that are near a cell border. // miss walls that are near a cell border.
if (coord % CELL_SIZE < 50) { if (coord % CELL_SIZE < 50) {
index -= 1; index--;
} }
if (index < 0) { if (index < 0) {
@ -245,7 +243,7 @@ static s16 upper_cell_index(s16 coord) {
//! Some wall checks are larger than the buffer, meaning wall checks can //! Some wall checks are larger than the buffer, meaning wall checks can
// miss walls that are near a cell border. // miss walls that are near a cell border.
if (coord % CELL_SIZE > CELL_SIZE - 50) { if (coord % CELL_SIZE > CELL_SIZE - 50) {
index += 1; index++;
} }
if (index > NUM_CELLS_INDEX) { if (index > NUM_CELLS_INDEX) {
@ -442,12 +440,12 @@ static void load_static_surfaces(s16 **data, s16 *vertexData, s16 surfaceType, s
s16 flags = surf_has_no_cam_collision(surfaceType); s16 flags = surf_has_no_cam_collision(surfaceType);
numSurfaces = *(*data); numSurfaces = *(*data);
*data += 1; (*data)++;
for (i = 0; i < numSurfaces; i++) { for (i = 0; i < numSurfaces; i++) {
if (*surfaceRooms != NULL) { if (*surfaceRooms != NULL) {
room = *(*surfaceRooms); room = *(*surfaceRooms);
*surfaceRooms += 1; (*surfaceRooms)++;
} }
surface = read_surface_data(vertexData, data); surface = read_surface_data(vertexData, data);
@ -467,7 +465,7 @@ static void load_static_surfaces(s16 **data, s16 *vertexData, s16 surfaceType, s
*data += 3; *data += 3;
if (hasForce) { if (hasForce) {
*data += 1; (*data)++;
} }
} }
} }
@ -477,8 +475,7 @@ static void load_static_surfaces(s16 **data, s16 *vertexData, s16 surfaceType, s
*/ */
static s16 *read_vertex_data(s16 **data) { static s16 *read_vertex_data(s16 **data) {
s32 numVertices; s32 numVertices;
UNUSED s16 unused1[3]; UNUSED u8 filler[16];
UNUSED s16 unused2[3];
s16 *vertexData; s16 *vertexData;
numVertices = *(*data); numVertices = *(*data);
@ -590,7 +587,7 @@ u32 get_area_terrain_size(s16 *data) {
void load_area_terrain(s16 index, s16 *data, s8 *surfaceRooms, s16 *macroObjects) { void load_area_terrain(s16 index, s16 *data, s8 *surfaceRooms, s16 *macroObjects) {
s16 terrainLoadType; s16 terrainLoadType;
s16 *vertexData; s16 *vertexData;
UNUSED s32 unused; UNUSED u8 filler[4];
// Initialize the data for this. // Initialize the data for this.
gEnvironmentRegions = NULL; gEnvironmentRegions = NULL;
@ -756,7 +753,7 @@ void load_object_surfaces(s16 **data, s16 *vertexData) {
* Transform an object's vertices, reload them, and render the object. * Transform an object's vertices, reload them, and render the object.
*/ */
void load_object_collision_model(void) { void load_object_collision_model(void) {
UNUSED s32 unused; UNUSED u8 filler[4];
s16 vertexData[600]; s16 vertexData[600];
s16 *collisionData = gCurrentObject->collisionData; s16 *collisionData = gCurrentObject->collisionData;

View file

@ -9,14 +9,12 @@
#define NUM_CELLS (2 * LEVEL_BOUNDARY_MAX / CELL_SIZE) #define NUM_CELLS (2 * LEVEL_BOUNDARY_MAX / CELL_SIZE)
#define NUM_CELLS_INDEX (NUM_CELLS - 1) #define NUM_CELLS_INDEX (NUM_CELLS - 1)
struct SurfaceNode struct SurfaceNode {
{
struct SurfaceNode *next; struct SurfaceNode *next;
struct Surface *surface; struct Surface *surface;
}; };
enum enum {
{
SPATIAL_PARTITION_FLOORS, SPATIAL_PARTITION_FLOORS,
SPATIAL_PARTITION_CEILS, SPATIAL_PARTITION_CEILS,
SPATIAL_PARTITION_WALLS SPATIAL_PARTITION_WALLS

View file

@ -109,7 +109,7 @@ void print_intro_text(void) {
#ifdef VERSION_EU #ifdef VERSION_EU
s32 language = eu_get_language(); s32 language = eu_get_language();
#endif #endif
if ((gGlobalTimer & 0x1F) < 20) { if ((gGlobalTimer & 31) < 20) {
if (gControllerBits == 0) { if (gControllerBits == 0) {
#ifdef VERSION_EU #ifdef VERSION_EU
print_text_centered(SCREEN_WIDTH / 2, 20, gNoControllerMsg[language]); print_text_centered(SCREEN_WIDTH / 2, 20, gNoControllerMsg[language]);
@ -194,7 +194,7 @@ void clear_areas(void) {
gAreaData[i].instantWarps = NULL; gAreaData[i].instantWarps = NULL;
gAreaData[i].objectSpawnInfos = NULL; gAreaData[i].objectSpawnInfos = NULL;
gAreaData[i].camera = NULL; gAreaData[i].camera = NULL;
gAreaData[i].unused28 = NULL; gAreaData[i].unused = NULL;
gAreaData[i].whirlpools[0] = NULL; gAreaData[i].whirlpools[0] = NULL;
gAreaData[i].whirlpools[1] = NULL; gAreaData[i].whirlpools[1] = NULL;
gAreaData[i].dialog[0] = DIALOG_NONE; gAreaData[i].dialog[0] = DIALOG_NONE;
@ -330,16 +330,14 @@ void play_transition(s16 transType, s16 time, u8 red, u8 green, u8 blue) {
gWarpTransition.data.texTimer = 0; gWarpTransition.data.texTimer = 0;
if (transType & 1) // Is the image fading in? if (transType & 1) { // Is the image fading in?
{
gWarpTransition.data.startTexRadius = GFX_DIMENSIONS_FULL_RADIUS; gWarpTransition.data.startTexRadius = GFX_DIMENSIONS_FULL_RADIUS;
if (transType >= 0x0F) { if (transType >= 0x0F) {
gWarpTransition.data.endTexRadius = 16; gWarpTransition.data.endTexRadius = 16;
} else { } else {
gWarpTransition.data.endTexRadius = 0; gWarpTransition.data.endTexRadius = 0;
} }
} else // The image is fading out. (Reverses start & end circles) } else { // The image is fading out. (Reverses start & end circles)
{
if (transType >= 0x0E) { if (transType >= 0x0E) {
gWarpTransition.data.startTexRadius = 16; gWarpTransition.data.startTexRadius = 16;
} else { } else {
@ -409,7 +407,7 @@ void render_game(void) {
if (D_8032CE78 != NULL) { if (D_8032CE78 != NULL) {
clear_viewport(D_8032CE78, gWarpTransFBSetColor); clear_viewport(D_8032CE78, gWarpTransFBSetColor);
} else { } else {
clear_frame_buffer(gWarpTransFBSetColor); clear_framebuffer(gWarpTransFBSetColor);
} }
} }

View file

@ -7,16 +7,14 @@
#include "camera.h" #include "camera.h"
#include "engine/graph_node.h" #include "engine/graph_node.h"
struct WarpNode struct WarpNode {
{
/*00*/ u8 id; /*00*/ u8 id;
/*01*/ u8 destLevel; /*01*/ u8 destLevel;
/*02*/ u8 destArea; /*02*/ u8 destArea;
/*03*/ u8 destNode; /*03*/ u8 destNode;
}; };
struct ObjectWarpNode struct ObjectWarpNode {
{
/*0x00*/ struct WarpNode node; /*0x00*/ struct WarpNode node;
/*0x04*/ struct Object *object; /*0x04*/ struct Object *object;
/*0x08*/ struct ObjectWarpNode *next; /*0x08*/ struct ObjectWarpNode *next;
@ -26,27 +24,24 @@ struct ObjectWarpNode
#define INSTANT_WARP_INDEX_START 0x00 // Equal and greater than Surface 0x1B #define INSTANT_WARP_INDEX_START 0x00 // Equal and greater than Surface 0x1B
#define INSTANT_WARP_INDEX_STOP 0x04 // Less than Surface 0x1F #define INSTANT_WARP_INDEX_STOP 0x04 // Less than Surface 0x1F
struct InstantWarp struct InstantWarp {
{
/*0x00*/ u8 id; // 0 = 0x1B / 1 = 0x1C / 2 = 0x1D / 3 = 0x1E /*0x00*/ u8 id; // 0 = 0x1B / 1 = 0x1C / 2 = 0x1D / 3 = 0x1E
/*0x01*/ u8 area; /*0x01*/ u8 area;
/*0x02*/ Vec3s displacement; /*0x02*/ Vec3s displacement;
}; };
struct SpawnInfo struct SpawnInfo {
{
/*0x00*/ Vec3s startPos; /*0x00*/ Vec3s startPos;
/*0x06*/ Vec3s startAngle; /*0x06*/ Vec3s startAngle;
/*0x0C*/ s8 areaIndex; /*0x0C*/ s8 areaIndex;
/*0x0D*/ s8 activeAreaIndex; /*0x0D*/ s8 activeAreaIndex;
/*0x10*/ u32 behaviorArg; /*0x10*/ u32 behaviorArg;
/*0x14*/ void *behaviorScript; /*0x14*/ void *behaviorScript;
/*0x18*/ struct GraphNode *unk18; /*0x18*/ struct GraphNode *model;
/*0x1C*/ struct SpawnInfo *next; /*0x1C*/ struct SpawnInfo *next;
}; };
struct UnusedArea28 struct UnusedArea28 {
{
/*0x00*/ s16 unk00; /*0x00*/ s16 unk00;
/*0x02*/ s16 unk02; /*0x02*/ s16 unk02;
/*0x04*/ s16 unk04; /*0x04*/ s16 unk04;
@ -54,14 +49,12 @@ struct UnusedArea28
/*0x08*/ s16 unk08; /*0x08*/ s16 unk08;
}; };
struct Whirlpool struct Whirlpool {
{
/*0x00*/ Vec3s pos; /*0x00*/ Vec3s pos;
/*0x03*/ s16 strength; /*0x03*/ s16 strength;
}; };
struct Area struct Area {
{
/*0x00*/ s8 index; /*0x00*/ s8 index;
/*0x01*/ s8 flags; // Only has 1 flag: 0x01 = Is this the active area? /*0x01*/ s8 flags; // Only has 1 flag: 0x01 = Is this the active area?
/*0x02*/ u16 terrainType; // default terrain of the level (set from level script cmd 0x31) /*0x02*/ u16 terrainType; // default terrain of the level (set from level script cmd 0x31)
@ -74,7 +67,7 @@ struct Area
/*0x1C*/ struct InstantWarp *instantWarps; /*0x1C*/ struct InstantWarp *instantWarps;
/*0x20*/ struct SpawnInfo *objectSpawnInfos; /*0x20*/ struct SpawnInfo *objectSpawnInfos;
/*0x24*/ struct Camera *camera; /*0x24*/ struct Camera *camera;
/*0x28*/ struct UnusedArea28 *unused28; // Filled by level script 0x3A, but is unused. /*0x28*/ struct UnusedArea28 *unused; // Filled by level script 0x3A, but is unused.
/*0x2C*/ struct Whirlpool *whirlpools[2]; /*0x2C*/ struct Whirlpool *whirlpools[2];
/*0x34*/ u8 dialog[2]; // Level start dialog number (set by level script cmd 0x30) /*0x34*/ u8 dialog[2]; // Level start dialog number (set by level script cmd 0x30)
/*0x36*/ u16 musicParam; /*0x36*/ u16 musicParam;
@ -82,8 +75,7 @@ struct Area
}; };
// All the transition data to be used in screen_transition.c // All the transition data to be used in screen_transition.c
struct WarpTransitionData struct WarpTransitionData {
{
/*0x00*/ u8 red; /*0x00*/ u8 red;
/*0x01*/ u8 green; /*0x01*/ u8 green;
/*0x02*/ u8 blue; /*0x02*/ u8 blue;
@ -109,8 +101,7 @@ struct WarpTransitionData
#define WARP_TRANSITION_FADE_FROM_BOWSER 0x12 #define WARP_TRANSITION_FADE_FROM_BOWSER 0x12
#define WARP_TRANSITION_FADE_INTO_BOWSER 0x13 #define WARP_TRANSITION_FADE_INTO_BOWSER 0x13
struct WarpTransition struct WarpTransition {
{
/*0x00*/ u8 isActive; // Is the transition active. (either TRUE or FALSE) /*0x00*/ u8 isActive; // Is the transition active. (either TRUE or FALSE)
/*0x01*/ u8 type; // Determines the type of transition to use (circle, star, etc.) /*0x01*/ u8 type; // Determines the type of transition to use (circle, star, etc.)
/*0x02*/ u8 time; // Amount of time to complete the transition (in frames) /*0x02*/ u8 time; // Amount of time to complete the transition (in frames)

View file

@ -47,47 +47,18 @@
#define o gCurrentObject #define o gCurrentObject
struct WFRotatingPlatformData { static s32 sCapSaveFlags[] = {
s16 pad; SAVE_FLAG_HAVE_WING_CAP,
s16 scale; SAVE_FLAG_HAVE_METAL_CAP,
const Collision *collisionData; SAVE_FLAG_HAVE_VANISH_CAP,
s16 collisionDistance;
}; };
struct Struct8032F34C {
s16 numBridgeSections;
s16 bridgeRelativeStartingXorZ;
s16 platformWidth;
s16 model;
const void *segAddr;
};
struct Struct802C0DF0 {
u8 unk0;
u8 unk1;
u8 unk2;
u8 model;
const BehaviorScript *behavior;
};
struct Struct8032F754 {
s32 unk0;
Vec3f unk1;
f32 unk2;
};
struct OpenableGrill {
s16 halfWidth;
s16 modelID;
const Collision *collision;
};
static s32 sCapSaveFlags[] = { SAVE_FLAG_HAVE_WING_CAP, SAVE_FLAG_HAVE_METAL_CAP, SAVE_FLAG_HAVE_VANISH_CAP };
// Boo Roll // Boo Roll
static s16 sBooHitRotations[] = { 6047, 5664, 5292, 4934, 4587, 4254, 3933, 3624, 3329, 3046, 2775, static s16 sBooHitRotations[] = {
6047, 5664, 5292, 4934, 4587, 4254, 3933, 3624, 3329, 3046, 2775,
2517, 2271, 2039, 1818, 1611, 1416, 1233, 1063, 906, 761, 629, 2517, 2271, 2039, 1818, 1611, 1416, 1233, 1063, 906, 761, 629,
509, 402, 308, 226, 157, 100, 56, 25, 4, 0 }; 509, 402, 308, 226, 157, 100, 56, 25, 4, 0,
};
#include "behaviors/star_door.inc.c" #include "behaviors/star_door.inc.c"
#include "behaviors/mr_i.inc.c" #include "behaviors/mr_i.inc.c"
@ -108,13 +79,27 @@ static s16 sBooHitRotations[] = { 6047, 5664, 5292, 4934, 4587, 4254, 3933, 3624
#include "behaviors/white_puff_explode.inc.c" #include "behaviors/white_puff_explode.inc.c"
// not in behavior file // not in behavior file
struct SpawnParticlesInfo sMistParticles = { 2, 20, MODEL_MIST, 0, 40, 5, 30, 20, 252, 30, 330.0f, 10.0f }; static struct SpawnParticlesInfo sMistParticles = {
/* behParam: */ 2,
/* count: */ 20,
/* model: */ MODEL_MIST,
/* offsetY: */ 0,
/* forwardVelBase: */ 40,
/* forwardVelRange: */ 5,
/* velYBase: */ 30,
/* velYRange: */ 20,
/* gravity: */ 252,
/* dragStrength: */ 30,
/* sizeBase: */ 330.0f,
/* sizeRange: */ 10.0f,
};
// generate_wind_puffs/dust (something like that) // generate_wind_puffs/dust (something like that)
void spawn_mist_particles_variable(s32 count, s32 offsetY, f32 size) { void spawn_mist_particles_variable(s32 count, s32 offsetY, f32 size) {
sMistParticles.sizeBase = size; sMistParticles.sizeBase = size;
sMistParticles.sizeRange = size / 20.0; sMistParticles.sizeRange = size / 20.0;
sMistParticles.offsetY = offsetY; sMistParticles.offsetY = offsetY;
if (count == 0) { if (count == 0) {
sMistParticles.count = 20; sMistParticles.count = 20;
} else if (count > 20) { } else if (count > 20) {
@ -122,6 +107,7 @@ void spawn_mist_particles_variable(s32 count, s32 offsetY, f32 size) {
} else { } else {
sMistParticles.count = 4; sMistParticles.count = 4;
} }
cur_obj_spawn_particles(&sMistParticles); cur_obj_spawn_particles(&sMistParticles);
} }
@ -159,16 +145,16 @@ void spawn_mist_particles_variable(s32 count, s32 offsetY, f32 size) {
// not sure what this is doing here. not in a behavior file. // not sure what this is doing here. not in a behavior file.
Gfx *geo_move_mario_part_from_parent(s32 run, UNUSED struct GraphNode *node, Mat4 mtx) { Gfx *geo_move_mario_part_from_parent(s32 run, UNUSED struct GraphNode *node, Mat4 mtx) {
Mat4 sp20; Mat4 sp20;
struct Object *sp1C;
if (run == TRUE) { if (run == TRUE) {
sp1C = (struct Object *) gCurGraphNodeObject; struct Object *sp1C = (struct Object *) gCurGraphNodeObject;
if (sp1C == gMarioObject && sp1C->prevObj != NULL) { if (sp1C == gMarioObject && sp1C->prevObj != NULL) {
create_transformation_from_matrices(sp20, mtx, *gCurGraphNodeCamera->matrixPtr); create_transformation_from_matrices(sp20, mtx, *gCurGraphNodeCamera->matrixPtr);
obj_update_pos_from_parent_transformation(sp20, sp1C->prevObj); obj_update_pos_from_parent_transformation(sp20, sp1C->prevObj);
obj_set_gfx_pos_from_pos(sp1C->prevObj); obj_set_gfx_pos_from_pos(sp1C->prevObj);
} }
} }
return NULL; return NULL;
} }
@ -185,6 +171,7 @@ void spawn_sparkle_particles(s32 n, s32 a1, s32 a2, s32 r) {
static s16 D_8035FF10; static s16 D_8035FF10;
s32 i; s32 i;
s16 separation = 0x10000 / n; // Evenly spread around a circle s16 separation = 0x10000 / n; // Evenly spread around a circle
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
spawn_object_relative(0, sins(D_8035FF10 + i * separation) * a1, (i + 1) * a2, spawn_object_relative(0, sins(D_8035FF10 + i * separation) * a1, (i + 1) * a2,
coss(D_8035FF10 + i * separation) * a1, o, MODEL_NONE, bhvSparkleSpawn); coss(D_8035FF10 + i * separation) * a1, o, MODEL_NONE, bhvSparkleSpawn);
@ -233,13 +220,17 @@ void vec3f_copy_2(Vec3f dest, Vec3f src) {
s32 set_obj_anim_with_accel_and_sound(s16 a0, s16 a1, s32 a2) { s32 set_obj_anim_with_accel_and_sound(s16 a0, s16 a1, s32 a2) {
f32 sp1C; f32 sp1C;
if ((sp1C = o->header.gfx.animInfo.animAccel / (f32) 0x10000) == 0)
if ((sp1C = o->header.gfx.animInfo.animAccel / (f32) 0x10000) == 0) {
sp1C = 1.0f; sp1C = 1.0f;
}
if (cur_obj_check_anim_frame_in_range(a0, sp1C) || cur_obj_check_anim_frame_in_range(a1, sp1C)) { if (cur_obj_check_anim_frame_in_range(a0, sp1C) || cur_obj_check_anim_frame_in_range(a1, sp1C)) {
cur_obj_play_sound_2(a2); cur_obj_play_sound_2(a2);
return 1; return TRUE;
} }
return 0;
return FALSE;
} }
#include "behaviors/tuxie.inc.c" #include "behaviors/tuxie.inc.c"

View file

@ -1,3 +1,4 @@
/** /**
* Behavior for bhvActivatedBackAndForthPlatform. * Behavior for bhvActivatedBackAndForthPlatform.
* There are only 2 of these in the game; the BitFS gray elevator * There are only 2 of these in the game; the BitFS gray elevator
@ -16,7 +17,7 @@
* move off of it. To do this, they changed it to a bhvPlatformOnTrack, but * move off of it. To do this, they changed it to a bhvPlatformOnTrack, but
* forgot to remove its entry in this table. * forgot to remove its entry in this table.
*/ */
static void const *sActivatedBackAndForthPlatformCollisionModels[] = { static Collision const *sActivatedBackAndForthPlatformCollisionModels[] = {
/* ACTIVATED_BF_PLAT_TYPE_BITS_ARROW_PLAT */ bits_seg7_collision_0701AD54, /* ACTIVATED_BF_PLAT_TYPE_BITS_ARROW_PLAT */ bits_seg7_collision_0701AD54,
/* ACTIVATED_BF_PLAT_TYPE_BITFS_MESH_PLAT */ bitfs_seg7_collision_070157E0, /* ACTIVATED_BF_PLAT_TYPE_BITFS_MESH_PLAT */ bitfs_seg7_collision_070157E0,
/* ACTIVATED_BF_PLAT_TYPE_BITFS_ELEVATOR */ bitfs_seg7_collision_07015124 /* ACTIVATED_BF_PLAT_TYPE_BITFS_ELEVATOR */ bitfs_seg7_collision_07015124
@ -61,7 +62,7 @@ void bhv_activated_back_and_forth_platform_init(void) {
* Activated back-and-forth platform update function. * Activated back-and-forth platform update function.
*/ */
void bhv_activated_back_and_forth_platform_update(void) { void bhv_activated_back_and_forth_platform_update(void) {
UNUSED s32 unused[3]; UNUSED u8 filler[12];
// oVelY is used for vertical platforms' movement and also for // oVelY is used for vertical platforms' movement and also for
// horizontal platforms' dipping up/down when Mario gets on/off them // horizontal platforms' dipping up/down when Mario gets on/off them
@ -78,7 +79,7 @@ void bhv_activated_back_and_forth_platform_update(void) {
// and one more frame of "lag" after it finally reaches 0 here, // and one more frame of "lag" after it finally reaches 0 here,
// Mario actually has to wait 22 frames before the platform starts moving. // Mario actually has to wait 22 frames before the platform starts moving.
if (o->oActivatedBackAndForthPlatformCountdown != 0) { if (o->oActivatedBackAndForthPlatformCountdown != 0) {
o->oActivatedBackAndForthPlatformCountdown -= 1; o->oActivatedBackAndForthPlatformCountdown--;
} else { } else {
// After the wait period is over, we start moving, by adding the velocity // After the wait period is over, we start moving, by adding the velocity
// to the positional offset. // to the positional offset.

View file

@ -1,3 +1,4 @@
/** /**
* Behavior for bhvHomingAmp and bhvCirclingAmp. * Behavior for bhvHomingAmp and bhvCirclingAmp.
* These are distinct objects; one chases (homes in on) Mario, * These are distinct objects; one chases (homes in on) Mario,
@ -24,9 +25,9 @@ void bhv_homing_amp_init(void) {
o->oHomeX = o->oPosX; o->oHomeX = o->oPosX;
o->oHomeY = o->oPosY; o->oHomeY = o->oPosY;
o->oHomeZ = o->oPosZ; o->oHomeZ = o->oPosZ;
o->oGravity = 0; o->oGravity = 0.0f;
o->oFriction = 1.0; o->oFriction = 1.0f;
o->oBuoyancy = 1.0; o->oBuoyancy = 1.0f;
o->oHomingAmpAvgY = o->oHomeY; o->oHomingAmpAvgY = o->oHomeY;
// Homing amps start at 1/10th their normal size. // Homing amps start at 1/10th their normal size.
@ -48,8 +49,9 @@ static void check_amp_attack(void) {
if (o->oInteractStatus & INT_STATUS_INTERACTED) { if (o->oInteractStatus & INT_STATUS_INTERACTED) {
// Unnecessary if statement, maybe caused by a macro for // Unnecessary if statement, maybe caused by a macro for
// if (o->oInteractStatus & INT_STATUS_INTERACTED) // if (o->oInteractStatus & INT_STATUS_INTERACTED) {
// o->oAction = X; // o->oAction = X;
// }
// ? // ?
if (o->oInteractStatus & INT_STATUS_INTERACTED) { if (o->oInteractStatus & INT_STATUS_INTERACTED) {
// This function is used for both normal amps and homing amps, // This function is used for both normal amps and homing amps,
@ -88,7 +90,7 @@ static void homing_amp_appear_loop(void) {
// Once the timer becomes greater than 90, i.e. 91 frames have passed, // Once the timer becomes greater than 90, i.e. 91 frames have passed,
// reset the amp's size and start chasing Mario. // reset the amp's size and start chasing Mario.
if (o->oTimer >= 91) { if (o->oTimer > 90) {
cur_obj_scale(1.0f); cur_obj_scale(1.0f);
o->oAction = HOMING_AMP_ACT_CHASE; o->oAction = HOMING_AMP_ACT_CHASE;
o->oAmpYPhase = 0; o->oAmpYPhase = 0;
@ -121,7 +123,7 @@ static void homing_amp_chase_loop(void) {
o->oHomingAmpAvgY = gMarioObject->header.gfx.pos[1] + 150.0f; o->oHomingAmpAvgY = gMarioObject->header.gfx.pos[1] + 150.0f;
} }
if (o->oTimer >= 31) { if (o->oTimer > 30) {
o->oHomingAmpLockedOn = FALSE; o->oHomingAmpLockedOn = FALSE;
} }
} else { } else {
@ -160,7 +162,7 @@ static void homing_amp_give_up_loop(void) {
// Move forward for 152 frames // Move forward for 152 frames
o->oForwardVel = 15.0f; o->oForwardVel = 15.0f;
if (o->oTimer >= 151) { if (o->oTimer > 150) {
// Hide the amp and reset it back to its inactive state // Hide the amp and reset it back to its inactive state
o->oPosX = o->oHomeX; o->oPosX = o->oHomeX;
o->oPosY = o->oHomeY; o->oPosY = o->oHomeY;
@ -168,7 +170,7 @@ static void homing_amp_give_up_loop(void) {
o->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE; o->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE;
o->oAction = HOMING_AMP_ACT_INACTIVE; o->oAction = HOMING_AMP_ACT_INACTIVE;
o->oAnimState = 0; o->oAnimState = 0;
o->oForwardVel = 0; o->oForwardVel = 0.0f;
o->oHomingAmpAvgY = o->oHomeY; o->oHomingAmpAvgY = o->oHomeY;
} }
} }
@ -179,15 +181,15 @@ static void homing_amp_give_up_loop(void) {
static void amp_attack_cooldown_loop(void) { static void amp_attack_cooldown_loop(void) {
// Turn intangible and wait for 90 frames before chasing Mario again after hitting him. // Turn intangible and wait for 90 frames before chasing Mario again after hitting him.
o->header.gfx.animInfo.animFrame += 2; o->header.gfx.animInfo.animFrame += 2;
o->oForwardVel = 0; o->oForwardVel = 0.0f;
cur_obj_become_intangible(); cur_obj_become_intangible();
if (o->oTimer >= 31) { if (o->oTimer > 30) {
o->oAnimState = 0; o->oAnimState = 0;
} }
if (o->oTimer >= 91) { if (o->oTimer > 90) {
o->oAnimState = 1; o->oAnimState = 1;
cur_obj_become_tangible(); cur_obj_become_tangible();
o->oAction = HOMING_AMP_ACT_CHASE; o->oAction = HOMING_AMP_ACT_CHASE;
@ -334,7 +336,6 @@ void bhv_circling_amp_loop(void) {
} else { } else {
circling_amp_idle_loop(); circling_amp_idle_loop();
} }
break; break;
case AMP_ACT_ATTACK_COOLDOWN: case AMP_ACT_ATTACK_COOLDOWN:

View file

@ -1,8 +1,8 @@
// animated_floor_switch.inc.c // animated_floor_switch.inc.c
struct Struct80331A54 { struct Struct80331A54 {
const void *unk00; const Collision *collision;
s16 unk04; s16 model;
}; };
struct Struct80331A54 D_80331A54[][5] = { struct Struct80331A54 D_80331A54[][5] = {
@ -63,7 +63,7 @@ void bhv_animates_on_floor_switch_press_loop(void) {
} }
if (o->oFloorSwitchPressAnimationUnkF8 < 9) { if (o->oFloorSwitchPressAnimationUnkF8 < 9) {
o->oFloorSwitchPressAnimationUnkF8 += 1; o->oFloorSwitchPressAnimationUnkF8++;
} }
} else if ((o->oFloorSwitchPressAnimationUnkF8 -= 2) < 0) { } else if ((o->oFloorSwitchPressAnimationUnkF8 -= 2) < 0) {
o->oFloorSwitchPressAnimationUnkF8 = 0; o->oFloorSwitchPressAnimationUnkF8 = 0;
@ -71,7 +71,7 @@ void bhv_animates_on_floor_switch_press_loop(void) {
} }
o->collisionData = segmented_to_virtual( o->collisionData = segmented_to_virtual(
D_80331A54[o->oBehParams2ndByte][o->oFloorSwitchPressAnimationUnkF8 / 2].unk00); D_80331A54[o->oBehParams2ndByte][o->oFloorSwitchPressAnimationUnkF8 / 2].collision);
cur_obj_set_model(D_80331A54[o->oBehParams2ndByte][o->oFloorSwitchPressAnimationUnkF8 / 2].unk04); cur_obj_set_model(D_80331A54[o->oBehParams2ndByte][o->oFloorSwitchPressAnimationUnkF8 / 2].model);
} }

View file

@ -1,3 +1,4 @@
/** /**
* Behavior for WDW arrow lifts. * Behavior for WDW arrow lifts.
* When a player stands on an arrow lift, it starts moving between * When a player stands on an arrow lift, it starts moving between

View file

@ -1,3 +1,4 @@
/** /**
* Behavior for bhvHauntedBookshelf. * Behavior for bhvHauntedBookshelf.
* This is the bookshelf that recedes after solving the puzzle of the haunted books. * This is the bookshelf that recedes after solving the puzzle of the haunted books.
@ -29,6 +30,7 @@ void bhv_haunted_bookshelf_loop(void) {
} }
break; break;
case HAUNTED_BOOKSHELF_ACT_RECEDE: case HAUNTED_BOOKSHELF_ACT_RECEDE:
// Move the bookshelf and play the sound // Move the bookshelf and play the sound
o->oPosX += 5.0f; o->oPosX += 5.0f;
@ -40,6 +42,7 @@ void bhv_haunted_bookshelf_loop(void) {
} }
break; break;
default: default:
break; break;
} }

View file

@ -1,3 +1,4 @@
/** /**
* Behavior for bhvMerryGoRound. * Behavior for bhvMerryGoRound.
* This is the merry-go-round in BBH. * This is the merry-go-round in BBH.

View file

@ -1,3 +1,4 @@
/** /**
* Behavior for bhvBbhTiltingTrapPlatform. * Behavior for bhvBbhTiltingTrapPlatform.
* This is the tilting platform trap in the upper floor of BBH * This is the tilting platform trap in the upper floor of BBH
@ -8,9 +9,9 @@
* Update function for bhvBbhTiltingTrapPlatform. * Update function for bhvBbhTiltingTrapPlatform.
*/ */
void bhv_bbh_tilting_trap_platform_loop(void) { void bhv_bbh_tilting_trap_platform_loop(void) {
UNUSED s32 unused; UNUSED u8 filler[4];
// US (and probably later) versions use oAction for the // Post-JP versions use oAction for the
// if statement, while immediately setting it over here. // if statement, while immediately setting it over here.
// This was done so that Mario leaving or getting on the platform // This was done so that Mario leaving or getting on the platform
// resets oTimer to 0. // resets oTimer to 0.
@ -29,14 +30,14 @@ void bhv_bbh_tilting_trap_platform_loop(void) {
o->oFaceAnglePitch += o->oAngleVelPitch; o->oFaceAnglePitch += o->oAngleVelPitch;
} else } else
#ifndef VERSION_JP #ifndef VERSION_JP
// In the US version, if the platform has tilted more than 3000 angle units // In the post-JP versions, if the platform has tilted more than 3000 angle units
// in less than 16 frames since Mario got on it, and he has stepped off, // in less than 16 frames since Mario got on it, and he has stepped off,
// this code will not run, so it will continue to rotate with the same // this code will not run, so it will continue to rotate with the same
// angular velocity for 16 more frames. This was probably done to make // angular velocity for 16 more frames. This was probably done to make
// the platform more dangerous. This code will not work correctly // the platform more dangerous. This code will not work correctly
// without the oAction changes above, since oTimer will not ever // without the oAction changes above, since oTimer will not ever
// reset to 0 without them. // reset to 0 without them.
if ((absi(o->oFaceAnglePitch) < 3000) || (o->oTimer >= 16)) if ((absi(o->oFaceAnglePitch) < 3000) || (o->oTimer > 15))
#endif #endif
{ {
// Make the platform return to the horizontal at a speed of // Make the platform return to the horizontal at a speed of

View file

@ -1,3 +1,4 @@
/** /**
* Behavior for bhvAlphaBooKey and bhvBetaBooKey. * Behavior for bhvAlphaBooKey and bhvBetaBooKey.
* They were apparently intended to be a key that would be contained in boos * They were apparently intended to be a key that would be contained in boos
@ -163,8 +164,11 @@ static void beta_boo_key_inside_boo_loop(void) {
o->oFaceAngleYaw += 0x200; o->oFaceAngleYaw += 0x200;
} }
static void (*sBetaBooKeyActions[])(void) = { beta_boo_key_inside_boo_loop, beta_boo_key_drop, static void (*sBetaBooKeyActions[])(void) = {
beta_boo_key_dropped_loop }; beta_boo_key_inside_boo_loop,
beta_boo_key_drop,
beta_boo_key_dropped_loop,
};
/** /**
* Update function for bhvBetaBooKey. * Update function for bhvBetaBooKey.

View file

@ -1,3 +1,4 @@
/** /**
* Behavior for bhvBetaBowserAnchor. * Behavior for bhvBetaBowserAnchor.
* This seems to be a beta bowser anchor object. It continuously updates to be * This seems to be a beta bowser anchor object. It continuously updates to be
@ -9,15 +10,15 @@
* It continuously updates to be in front of Mario, * It continuously updates to be in front of Mario,
* and attacks all non-Mario objects it touches. * and attacks all non-Mario objects it touches.
* It continuously sets its hitbox radius/height * It continuously sets its hitbox radius/height
* based on gDebugInfo[4]. * based on gDebugInfo[DEBUG_PAGE_EFFECTINFO].
*/ */
void bhv_beta_bowser_anchor_loop(void) { void bhv_beta_bowser_anchor_loop(void) {
// Set the object's position to be 30 units above Mario's feet, // Set the object's position to be 30 units above Mario's feet,
// and 300 units in front of him. // and 300 units in front of him.
cur_obj_set_pos_relative(gMarioObject, 0, 30.0f, 300.0f); cur_obj_set_pos_relative(gMarioObject, 0, 30.0f, 300.0f);
o->hitboxRadius = gDebugInfo[4][0] + 100; o->hitboxRadius = gDebugInfo[DEBUG_PAGE_EFFECTINFO][0] + 100;
o->hitboxHeight = gDebugInfo[4][1] + 300; o->hitboxHeight = gDebugInfo[DEBUG_PAGE_EFFECTINFO][1] + 300;
obj_attack_collided_from_other_object(o); obj_attack_collided_from_other_object(o);
} }

View file

@ -1,3 +1,4 @@
/** /**
* Behavior for bhvBetaChestBottom and bhvBetaChestLid. * Behavior for bhvBetaChestBottom and bhvBetaChestLid.
* These are apparently the beta versions of chests. * These are apparently the beta versions of chests.
@ -49,6 +50,7 @@ void bhv_beta_chest_lid_loop(void) {
} }
break; break;
case BETA_CHEST_ACT_OPENING: case BETA_CHEST_ACT_OPENING:
if (o->oTimer == 0) { if (o->oTimer == 0) {
// Spawn the bubble 80 units in the -Y direction and 120 units in the +Z direction. // Spawn the bubble 80 units in the -Y direction and 120 units in the +Z direction.
@ -63,7 +65,7 @@ void bhv_beta_chest_lid_loop(void) {
o->oAction++; // Set to BETA_CHEST_ACT_IDLE_OPEN o->oAction++; // Set to BETA_CHEST_ACT_IDLE_OPEN
} }
// Fall-through // fallthrough
case BETA_CHEST_ACT_IDLE_OPEN: case BETA_CHEST_ACT_IDLE_OPEN:
break; break;
} }

Some files were not shown because too many files have changed in this diff Show more