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
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`
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).
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
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.
##### 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
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.
##### 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_wings_half_1_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[];
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_wings_half_1_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_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
const Gfx mario_right_hand_cap_wings_intial_dl[] = {
const Gfx mario_right_hand_cap_wings_initial_dl[] = {
gsDPPipeSync(),
gsDPSetCombineMode(G_CC_MODULATERGBFADEA, G_CC_MODULATERGBFADEA),
gsSPClearGeometryMode(G_CULL_BACK | G_SHADING_SMOOTH),
@ -6104,7 +6104,7 @@ const Gfx mario_right_hand_cap[] = {
// 0x0401B1D8 - 0x0401B230
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),
gsDPLoadSync(),
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
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),
gsDPLoadSync(),
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
const Gfx mario_cap_wings_unused_intial_dl[] = {
const Gfx mario_cap_wings_unused_initial_dl[] = {
gsDPPipeSync(),
gsDPSetCombineMode(G_CC_MODULATERGBA, G_CC_MODULATERGBA),
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
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),
gsDPLoadSync(),
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
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),
gsDPLoadSync(),
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),
gsDPSetAlphaCompare(G_AC_THRESHOLD),
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),
#endif
#ifdef VERSION_EU
gsDPSetTextureFilter(G_TF_POINT),
#elif defined(VERSION_JP) || defined(VERSION_US)
gsDPSetRenderMode(G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2),
#endif
gsSPEndDisplayList(),
};

View File

@ -874,7 +874,7 @@ const BehaviorScript bhvMrIBlueCoin[] = {
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
BILLBOARD(),
SET_INT(oIntangibleTimer, 0),
SET_FLOAT(oMrIUnk110, 20),
SET_FLOAT(oCoinUnk110, 20),
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),
CALL_NATIVE(bhv_coin_init),

View File

@ -24,7 +24,7 @@
#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
#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)
/// 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)

View File

@ -12,8 +12,7 @@
#define DEFINE_BONUS_COURSE(courseenum, _1) courseenum,
enum CourseNum
{
enum CourseNum {
#include "levels/course_defines.h"
COURSE_END, // To mark end + 1 for marking max and count.
// TODO: clean this up. This is still bad. Which
@ -27,6 +26,7 @@ enum CourseNum
#undef DEFINE_COURSES_END
#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

View File

@ -7,8 +7,7 @@
#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,
enum LevelNum
{
enum LevelNum {
LEVEL_NONE,
#include "levels/level_defines.h"
LEVEL_COUNT,

View File

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

View File

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

View File

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

View File

@ -385,7 +385,7 @@
// group 9
#define MODEL_BOO 0x54 // boo_geo
#define MODEL_BETA_BOO_KEY 0x55 // small_key_geo
#define MODEL_BETA_BOO_KEY 0x55 // small_key_geo
#define MODEL_HAUNTED_CHAIR 0x56 // haunted_chair_geo
#define MODEL_MAD_PIANO 0x57 // mad_piano_geo
#define MODEL_BOOKEND_PART 0x58 // bookend_part_geo
@ -562,7 +562,7 @@
#define MODEL_PEACH 0xDE // peach_geo
#define MODEL_CHUCKYA 0xDF // chuckya_geo
#define MODEL_WHITE_PUFF 0xE0 // white_puff_geo
#define MODEL_TRAJECTORY_MARKER_BALL 0xE1 // bowling_ball_track_geo - duplicate used in SSL Pyramid small sized and as a track ball
#define MODEL_TRAJECTORY_MARKER_BALL 0xE1 // bowling_ball_track_geo - duplicate used in SSL Pyramid small sized and as a track ball
// Menu Models (overwrites Level Geometry IDs)
#define MODEL_MAIN_MENU_MARIO_SAVE_BUTTON MODEL_LEVEL_GEOMETRY_03 // main_menu_geo_0001D0

File diff suppressed because it is too large Load Diff

View File

@ -186,8 +186,8 @@
#define /*0x0FC*/ oHomingAmpAvgY OBJECT_FIELD_F32(0x1D)
/* Arrow Lift */
#define /*0x0F4*/ oArrowLiftDisplacement OBJECT_FIELD_F32(0x1B)
#define /*0x100*/ oArrowLiftUnk100 OBJECT_FIELD_S32(0x1E)
#define /*0x0F4*/ oArrowLiftDisplacement OBJECT_FIELD_F32(0x1B)
#define /*0x100*/ oArrowLiftUnk100 OBJECT_FIELD_S32(0x1E)
/* Back-and-Forth Platform */
#define /*0x0F4*/ oBackAndForthPlatformDirection OBJECT_FIELD_F32(0x1B)
@ -277,14 +277,14 @@
#define /*0x088*/ oBowserCamAct OBJECT_FIELD_S32(0x00)
#define /*0x0F4*/ oBowserStatus OBJECT_FIELD_S32(0x1B)
#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 /*0x108*/ oBowserRandSplitFloor OBJECT_FIELD_S16(0x20, 0)
#define /*0x10A*/ oBowserHeldAnglePitch OBJECT_FIELD_S16(0x20, 1)
#define /*0x10D*/ oBowserHeldAngleVelYaw OBJECT_FIELD_S16(0x21, 0)
#define /*0x10E*/ oBowserGrabbedStatus OBJECT_FIELD_S16(0x21, 1)
#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 /*0x1AE*/ oBowserEyesTimer OBJECT_FIELD_S16(0x49, 1)
#define /*0x1B0*/ oBowserEyesShut OBJECT_FIELD_S16(0x4A, 0)
@ -319,9 +319,9 @@
#define /*0x108*/ oBubbaUnk108 OBJECT_FIELD_F32(0x20)
#define /*0x10C*/ oBubbaUnk10C OBJECT_FIELD_F32(0x21)
#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 /*0x1B2*/ oBubbaUnk1B2 OBJECT_FIELD_S16(0x4A, + 1)
#define /*0x1B2*/ oBubbaUnk1B2 OBJECT_FIELD_S16(0x4A, 1)
/* Bullet Bill */
#define /*0x0F8*/ oBulletBillInitialMoveYaw OBJECT_FIELD_S32(0x1C)
@ -406,7 +406,7 @@
#endif
/* Collision Particle */
#define /*0x0F4*/ oCollisionParticleUnkF4 OBJECT_FIELD_F32(0x1B)
#define /*0x0F4*/ oCollisionParticleUnkF4 OBJECT_FIELD_F32(0x1B)
/* Controllable Platform */
#define /*0x0F8*/ oControllablePlatformUnkF8 OBJECT_FIELD_S32(0x1C)
@ -442,9 +442,9 @@
#define /*0x104*/ oDorrieYawVel OBJECT_FIELD_S32(0x1F)
#define /*0x10C*/ oDorrieLiftingMario OBJECT_FIELD_S32(0x21)
#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 /*0x1B2*/ oDorrieHeadRaiseSpeed OBJECT_FIELD_S16(0x4A, + 1)
#define /*0x1B2*/ oDorrieHeadRaiseSpeed OBJECT_FIELD_S16(0x4A, 1)
/* Elevator */
#define /*0x0F4*/ oElevatorUnkF4 OBJECT_FIELD_F32(0x1B)
@ -523,7 +523,7 @@
#define /*0x0F4*/ oFloatingPlatformUnkF4 OBJECT_FIELD_S32(0x1B)
#define /*0x0F8*/ oFloatingPlatformUnkF8 OBJECT_FIELD_F32(0x1C)
#define /*0x0FC*/ oFloatingPlatformUnkFC OBJECT_FIELD_F32(0x1D)
#define /*0x100*/ oFloatingPlatformUnk100 OBJECT_FIELD_S32(0x1E)
#define /*0x100*/ oFloatingPlatformUnk100 OBJECT_FIELD_S32(0x1E)
/* Floor Switch Press Animation */
#define /*0x0F4*/ oFloorSwitchPressAnimationUnkF4 OBJECT_FIELD_S32(0x1B)
@ -604,9 +604,9 @@
#define /*0x10C*/ oKleptoStartPosZ OBJECT_FIELD_F32(0x21)
#define /*0x110*/ oKleptoTimeUntilTargetChange OBJECT_FIELD_S32(0x22)
#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 /*0x1B2*/ oKleptoYawToTarget OBJECT_FIELD_S16(0x4A, + 1)
#define /*0x1B2*/ oKleptoYawToTarget OBJECT_FIELD_S16(0x4A, 1)
/* Koopa */
#define /*0x0F4*/ oKoopaAgility OBJECT_FIELD_F32(0x1B)
@ -631,7 +631,7 @@
/* Koopa Shell Flame */
#define /*0x0F4*/ oKoopaShellFlameUnkF4 OBJECT_FIELD_F32(0x1B)
#define /*0x0F8*/ oKoopaShellFlameUnkF8 OBJECT_FIELD_F32(0x1C)
#define /*0x0F8*/ oKoopaShellFlameScale OBJECT_FIELD_F32(0x1C)
/* Camera Lakitu */
#define /*0x0F4*/ oCameraLakituBlinkTimer OBJECT_FIELD_S32(0x1B)
@ -642,7 +642,7 @@
#define /*0x104*/ oCameraLakituUnk104 OBJECT_FIELD_S32(0x1F)
#endif
#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 */
#define /*0x0F4*/ oEnemyLakituNumSpinies OBJECT_FIELD_S32(0x1B)
@ -651,14 +651,14 @@
#define /*0x100*/ oEnemyLakituFaceForwardCountdown OBJECT_FIELD_S32(0x1E)
/* Intro Cutscene Lakitu */
#define /*0x0F8*/ oIntroLakituSplineSegmentProgress OBJECT_FIELD_F32(0x1C)
#define /*0x0FC*/ oIntroLakituSplineSegment OBJECT_FIELD_F32(0x1D)
#define /*0x100*/ oIntroLakituUnk100 OBJECT_FIELD_F32(0x1E)
#define /*0x104*/ oIntroLakituUnk104 OBJECT_FIELD_F32(0x1F)
#define /*0x108*/ oIntroLakituUnk108 OBJECT_FIELD_F32(0x20)
#define /*0x10C*/ oIntroLakituUnk10C OBJECT_FIELD_F32(0x21)
#define /*0x110*/ oIntroLakituUnk110 OBJECT_FIELD_F32(0x22)
#define /*0x1AC*/ oIntroLakituCloud OBJECT_FIELD_OBJ(0x49)
#define /*0x0F8*/ oIntroLakituSplineSegmentProgress OBJECT_FIELD_F32(0x1C)
#define /*0x0FC*/ oIntroLakituSplineSegment OBJECT_FIELD_F32(0x1D)
#define /*0x100*/ oIntroLakituUnk100 OBJECT_FIELD_F32(0x1E)
#define /*0x104*/ oIntroLakituUnk104 OBJECT_FIELD_F32(0x1F)
#define /*0x108*/ oIntroLakituUnk108 OBJECT_FIELD_F32(0x20)
#define /*0x10C*/ oIntroLakituUnk10C OBJECT_FIELD_F32(0x21)
#define /*0x110*/ oIntroLakituUnk110 OBJECT_FIELD_F32(0x22)
#define /*0x1AC*/ oIntroLakituCloud OBJECT_FIELD_OBJ(0x49)
/* Main Menu Button */
#define /*0x0F4*/ oMenuButtonState OBJECT_FIELD_S32(0x1B)
@ -715,7 +715,7 @@
#define /*0x100*/ oMrIUnk100 OBJECT_FIELD_S32(0x1E)
#define /*0x104*/ oMrIUnk104 OBJECT_FIELD_S32(0x1F)
#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)
/* Object Respawner */
@ -737,9 +737,9 @@
// 0x1D-0x21 reserved for pathing
#define /*0x110*/ oRacingPenguinWeightedNewTargetSpeed OBJECT_FIELD_F32(0x22)
#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 /*0x1B2*/ oRacingPenguinMarioCheated OBJECT_FIELD_S16(0x4A, + 1)
#define /*0x1B2*/ oRacingPenguinMarioCheated OBJECT_FIELD_S16(0x4A, 1)
/* Small Penguin */
#define /*0x088*/ oSmallPenguinUnk88 OBJECT_FIELD_S32(0x00)
@ -760,7 +760,7 @@
/* Fire Piranha Plant */
#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 /*0x100*/ oFirePiranhaPlantDeathSpinTimer OBJECT_FIELD_S32(0x1E)
#define /*0x104*/ oFirePiranhaPlantDeathSpinVel OBJECT_FIELD_F32(0x1F)
@ -792,9 +792,9 @@
#define /*0x10C*/ oPlatformOnTrackYaw OBJECT_FIELD_S32(0x21)
#define /*0x110*/ oPlatformOnTrackOffsetY OBJECT_FIELD_F32(0x22)
#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 /*0x1B2*/ oPlatformOnTrackWasStoodOn OBJECT_FIELD_S16(0x4A, + 1)
#define /*0x1B2*/ oPlatformOnTrackWasStoodOn OBJECT_FIELD_S16(0x4A, 1)
/* Platform Spawner */
#define /*0x0F4*/ oPlatformSpawnerUnkF4 OBJECT_FIELD_S32(0x1B)
@ -857,11 +857,11 @@
#define /*0x108*/ oSinkWhenSteppedOnUnk108 OBJECT_FIELD_F32(0x20)
/* Skeeter */
#define /*0x0F4*/ oSkeeterTargetAngle OBJECT_FIELD_S32(0x1B)
#define /*0x0F8*/ oSkeeterUnkF8 OBJECT_FIELD_S32(0x1C)
#define /*0x0FC*/ oSkeeterUnkFC OBJECT_FIELD_F32(0x1D)
#define /*0x100*/ oSkeeterWaitTime OBJECT_FIELD_S32(0x1E)
#define /*0x1AC*/ oSkeeterUnk1AC OBJECT_FIELD_S16(0x49, 0)
#define /*0x0F4*/ oSkeeterTargetAngle OBJECT_FIELD_S32(0x1B)
#define /*0x0F8*/ oSkeeterTurningAwayFromWall OBJECT_FIELD_S32(0x1C)
#define /*0x0FC*/ oSkeeterUnkFC OBJECT_FIELD_F32(0x1D)
#define /*0x100*/ oSkeeterWaitTime OBJECT_FIELD_S32(0x1E)
#define /*0x1AC*/ oSkeeterUnk1AC OBJECT_FIELD_S16(0x49, 0)
/* Jrb Sliding Box */
#define /*0x0F4*/ oJrbSlidingBoxUnkF4 OBJECT_FIELD_OBJ(0x1B)
@ -875,7 +875,7 @@
#define /*0x0F4*/ oSmokeTimer OBJECT_FIELD_S32(0x1B)
/* 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 /*0x1AC*/ oSnowmansBottomUnk1AC OBJECT_FIELD_S32(0x49)
// 0x1D-0x21 reserved for pathing
@ -894,9 +894,9 @@
#define /*0x108*/ oSnufitBodyBaseScale OBJECT_FIELD_S32(0x20)
#define /*0x10C*/ oSnufitBullets OBJECT_FIELD_S32(0x21)
#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 /*0x1B2*/ oSnufitBodyScale OBJECT_FIELD_S16(0x4A, + 1)
#define /*0x1B2*/ oSnufitBodyScale OBJECT_FIELD_S16(0x4A, 1)
/* Spindel */
#define /*0x0F4*/ oSpindelUnkF4 OBJECT_FIELD_S32(0x1B)
@ -1065,7 +1065,7 @@
#define /*0x110*/ oUnagiUnk110 OBJECT_FIELD_F32(0x22)
#define /*0x1AC*/ oUnagiUnk1AC OBJECT_FIELD_F32(0x49)
#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 */
#define /*0x0F8*/ oWaterBombVerticalStretch OBJECT_FIELD_F32(0x1C)
@ -1144,7 +1144,7 @@
#define /*0x10C*/ oWigglerTargetYaw OBJECT_FIELD_S32(0x21)
#define /*0x110*/ oWigglerWalkAwayFromWallTimer OBJECT_FIELD_S32(0x22)
#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 */
#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_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)
#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_2 /* 0x38300080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x30, 0x00, SOUND_CONSTANT_FREQUENCY | SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_COIN_SPURT_EU /* 0x38302080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x30, 0x20, SOUND_CONSTANT_FREQUENCY | SOUND_DISCRETE) // unverified
#elif defined(VERSION_US)
#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_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_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_UNKNOWN3_LOWPRIO /* 0x30370080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x37, 0x00, SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_UNKNOWN3 /* 0x30378080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x37, 0x80, SOUND_DISCRETE) // unverified
#define SOUND_GENERAL_UNKNOWN3_2 /* 0x38378080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x37, 0x80, SOUND_CONSTANT_FREQUENCY | SOUND_DISCRETE) // unverified
#ifdef VERSION_JP
#define SOUND_GENERAL_UNKNOWN3 /* 0x30370080 */ SOUND_ARG_LOAD(SOUND_BANK_GENERAL, 0x37, 0x00, 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_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
@ -319,8 +324,11 @@
#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_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
#endif
#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_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_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_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_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
@ -516,8 +524,11 @@
/* Menu Sound Effects */
#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
#ifdef VERSION_JP
#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_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)

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_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;
/*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
@ -23,8 +22,7 @@ struct SpecialPreset
// 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},
{0x01, 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_NOT_SLIPPERY 0x0037 // Hard and Non-slippery (Always has fall damage)
#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_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_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_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_NOISE_VERY_SLIPPERY_73 0x0073 // 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_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_PAINTING_WOBBLE_A6 0x00A6 // Painting wobble (BOB Left)
#define SURFACE_PAINTING_WOBBLE_A7 0x00A7 // Painting wobble (BOB Middle)
#define SURFACE_PAINTING_WOBBLE_A8 0x00A8 // Painting wobble (BOB Right)
#define SURFACE_PAINTING_WOBBLE_A6 0x00A6 // Painting wobble (BoB Left)
#define SURFACE_PAINTING_WOBBLE_A7 0x00A7 // Painting wobble (BoB Middle)
#define SURFACE_PAINTING_WOBBLE_A8 0x00A8 // Painting wobble (BoB Right)
#define SURFACE_PAINTING_WOBBLE_A9 0x00A9 // Painting wobble (CCM Left)
#define SURFACE_PAINTING_WOBBLE_AA 0x00AA // Painting wobble (CCM Middle)
#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_D1 0x00D1 // Painting wobble (Unused, HMC & COTMC - Middle)
#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_D4 0x00D4 // Painting warp (BOB Middle)
#define SURFACE_PAINTING_WARP_D5 0x00D5 // Painting warp (BOB Right)
#define SURFACE_PAINTING_WARP_D3 0x00D3 // Painting warp (BoB Left)
#define SURFACE_PAINTING_WARP_D4 0x00D4 // Painting warp (BoB Middle)
#define SURFACE_PAINTING_WARP_D5 0x00D5 // Painting warp (BoB Right)
#define SURFACE_PAINTING_WARP_D6 0x00D6 // Painting warp (CCM Left)
#define SURFACE_PAINTING_WARP_D7 0x00D7 // Painting warp (CCM Middle)
#define SURFACE_PAINTING_WARP_D8 0x00D8 // Painting warp (CCM Right)

View File

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

View File

@ -3742,7 +3742,7 @@ const Collision bbh_seg7_collision_level[] = {
COL_TRI(12, 14, 15),
COL_TRI_STOP(),
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*/ -1996, -2457, 205, /*yaw*/ 192),
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_STOP(),
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_04, /*pos*/ -3245, -3358, 3893, /*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_STOP(),
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_04, /*pos*/ -5488, -1535, 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_STOP(),
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_04, /*pos*/ -2291, -2073, -762, /*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_STOP(),
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*/ 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_STOP(),
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),
COL_END(),
};

View File

@ -68,7 +68,7 @@ const Collision bowser_3_seg7_collision_level[] = {
COL_TRI(0, 2, 3),
COL_TRI_STOP(),
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_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),

View File

@ -847,7 +847,7 @@ const Collision castle_courtyard_seg7_collision[] = {
COL_TRI(136, 45, 133),
COL_TRI_STOP(),
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(/*preset*/ special_spiky_tree, /*pos*/ 2272, -214, -1432),
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_STOP(),
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*/ -1775, 0, -824, /*yaw*/ 224),
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_STOP(),
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_04, /*pos*/ 2355, -4095, 4096, /*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_STOP(),
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),
COL_END(),
};

View File

@ -990,7 +990,7 @@ const Collision cotmc_seg7_collision_level[] = {
COL_TRI(208, 206, 207),
COL_TRI_STOP(),
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(0, -1535, -7679, 1536, 3389, 0),
COL_END(),

View File

@ -3599,7 +3599,7 @@ const Collision hmc_seg7_collision_level[] = {
COL_TRI(55, 58, 56),
COL_TRI_STOP(),
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*/ -3586, 1536, 647, /*yaw*/ 19),
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_STOP(),
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(0, -6304, -669, 7992, 7814, 1024),
COL_WATER_BOX(1, 4433, -4253, 5969, -669, -3016),

View File

@ -35,8 +35,8 @@ const struct MovtexQuadCollection jrb_movtex_water[] = {
{-1, NULL},
};
// 0x0700D2E4, appears if you enter the course the first time, then it disappears when you grab the first star
static Movtex jrb_movtex_intial_mist_data[] = {
// 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_initial_mist_data[] = {
MOV_TEX_INIT_LOAD( 1),
MOV_TEX_ROT_SPEED( 20),
MOV_TEX_ROT_SCALE( 10),
@ -51,7 +51,7 @@ static Movtex jrb_movtex_intial_mist_data[] = {
};
// 0x0700D304
const struct MovtexQuadCollection jrb_movtex_intial_mist[] = {
{51, jrb_movtex_intial_mist_data},
const struct MovtexQuadCollection jrb_movtex_initial_mist[] = {
{51, jrb_movtex_initial_mist_data},
{-1, NULL},
};

View File

@ -584,7 +584,7 @@ const Collision jrb_seg7_area_2_collision[] = {
COL_TRI(29, 79, 80),
COL_TRI_STOP(),
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(0, -4095, -4095, 4096, 4096, 2765),
COL_END(),

View File

@ -1,5 +1,5 @@
// 0x0701137C
static Movtex jrb_movtex_sinked_boat_water_data[] = {
static Movtex jrb_movtex_sunken_ship_water_data[] = {
MOV_TEX_INIT_LOAD( 1),
MOV_TEX_ROT_SPEED( 20),
MOV_TEX_ROT_SCALE( 6),
@ -14,7 +14,7 @@ static Movtex jrb_movtex_sinked_boat_water_data[] = {
};
// 0x0701139C
const struct MovtexQuadCollection jrb_movtex_sinked_boat_water[] = {
{0, jrb_movtex_sinked_boat_water_data},
const struct MovtexQuadCollection jrb_movtex_sunken_ship_water[] = {
{0, jrb_movtex_sunken_ship_water_data},
{-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_2[];
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_0700FE48[];
extern const Gfx jrb_seg7_dl_07010548[];
extern const Collision jrb_seg7_area_2_collision[];
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
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_STOP(),
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(),
#else
COL_INIT(),
@ -2730,7 +2730,7 @@ const Collision lll_seg7_area_1_collision[] = {
COL_TRI(3, 52, 71),
COL_TRI_STOP(),
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(),
#endif
};

View File

@ -1549,7 +1549,7 @@ const Collision lll_seg7_area_2_collision[] = {
COL_TRI(324, 451, 450),
COL_TRI_STOP(),
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(10, -3071, -3071, 3072, 3072, 20),
COL_END(),

View File

@ -2694,7 +2694,7 @@ const Collision rr_seg7_collision_level[] = {
COL_TRI_SPECIAL(31, 46, 45, 0x140),
COL_TRI_STOP(),
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_04, /*pos*/ 3803, -1833, 2036, /*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_STOP(),
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_04, /*pos*/ 3803, -1833, 2036, /*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_STOP(),
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(0, -3173, -3173, 3174, 3174, 102),
COL_END(),

View File

@ -1423,7 +1423,7 @@ const Collision sl_seg7_area_1_collision[] = {
COL_TRI(510, 327, 321),
COL_TRI_STOP(),
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*/ 0, 4864, 0),
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_STOP(),
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(),
};

View File

@ -1554,7 +1554,7 @@ const Collision ssl_seg7_area_1_collision[] = {
COL_TRI(482, 483, 484),
COL_TRI_STOP(),
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*/ -3583, 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_STOP(),
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*/ 0, -101, 528, /*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_STOP(),
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),
COL_WATER_BOX_INIT(3),
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_STOP(),
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(/*preset*/ special_bubble_tree, /*pos*/ 1444, -153, 676),
COL_WATER_BOX_INIT(3),

View File

@ -587,7 +587,7 @@ const Collision totwc_seg7_collision[] = {
COL_TRI(81, 97, 67),
COL_TRI_STOP(),
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*/ -4095, 666, 512, /*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_STOP(),
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(),
};

View File

@ -2293,7 +2293,7 @@ const Collision ttm_seg7_area_1_collision[] = {
COL_TRI(516, 430, 819),
COL_TRI_STOP(),
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*/ 7293, -5056, 1429, /*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_STOP(),
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(),
};

View File

@ -1345,7 +1345,7 @@ const Collision wdw_seg7_area_1_collision[] = {
COL_TRI(85, 159, 157),
COL_TRI_STOP(),
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(0, -3839, -3839, 4608, 4608, 31),
COL_END(),

View File

@ -1075,7 +1075,7 @@ const Collision wf_seg7_collision_070102D8[] = {
COL_TRI(4, 7, 5),
COL_TRI_STOP(),
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_0F, /*pos*/ 4608, 256, 1792, /*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_STOP(),
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(),
};

View File

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

View File

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

View File

@ -1,14 +1,6 @@
#include "libultra_internal.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 *__osViCurr = &sViContexts[0];
OSViContext *__osViNext = &sViContexts[1];
@ -80,6 +72,7 @@ void __osViInit(void) {
osViClock = 0x02E6025C;
#endif
}
#endif
__osViNext->unk00 = 0x20;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -82,8 +82,7 @@ void unk_pools_init(u32 size1, u32 size2);
* Assuming 'k' in [9, 24],
* 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 deg4 = deg2 * deg2;
f64 deg8 = deg4 * deg4;

View File

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

View File

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

View File

@ -974,7 +974,8 @@ void audio_init() {
#endif
#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) &gAudioGlobalsEndMarker,
(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,
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) {
break;
}
@ -622,8 +621,7 @@ void *func_sh_802f3764(s32 poolIdx, s32 idx, s32 *arg2) {
devAddr = f->seqArray[idx].offset;
switch (sp18)
{
switch (sp18) {
case 0:
vAddr = unk_pool1_alloc(poolIdx, idx, size);
if (vAddr == NULL) {
@ -1033,7 +1031,8 @@ void audio_init() {
port_eu_init();
#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) &gAudioGlobalsEndMarker,
(uintptr_t) &gAudioGlobalsEndMarker - (uintptr_t) &gAudioGlobalsStartMarker
@ -1544,7 +1543,7 @@ s32 func_sh_802f573c(s32 audioResetStatus) {
if (D_SH_8034F68C > 0) {
if (audioResetStatus != 0) {
if (osRecvMesg(&gUnkQueue2, (OSMesg *) &idx, OS_MESG_NOBLOCK)){
if (osRecvMesg(&gUnkQueue2, (OSMesg *) &idx, OS_MESG_NOBLOCK)) {
}
D_SH_8034F68C = 0;
return 0;

View File

@ -134,44 +134,44 @@ void eu_process_audio_cmd(struct EuAudioCmd *cmd) {
s32 i;
switch (cmd->u.s.op) {
case 0x81:
preload_sequence(cmd->u.s.arg2, 3);
break;
case 0x81:
preload_sequence(cmd->u.s.arg2, 3);
break;
case 0x82:
case 0x88:
load_sequence(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3);
func_8031D690(cmd->u.s.arg1, cmd->u2.as_s32);
break;
case 0x82:
case 0x88:
load_sequence(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3);
func_8031D690(cmd->u.s.arg1, cmd->u2.as_s32);
break;
case 0x83:
if (gSequencePlayers[cmd->u.s.arg1].enabled != FALSE) {
if (cmd->u2.as_s32 == 0) {
sequence_player_disable(&gSequencePlayers[cmd->u.s.arg1]);
case 0x83:
if (gSequencePlayers[cmd->u.s.arg1].enabled != FALSE) {
if (cmd->u2.as_s32 == 0) {
sequence_player_disable(&gSequencePlayers[cmd->u.s.arg1]);
}
else {
seq_player_fade_to_zero_volume(cmd->u.s.arg1, cmd->u2.as_s32);
}
}
else {
seq_player_fade_to_zero_volume(cmd->u.s.arg1, cmd->u2.as_s32);
break;
case 0xf0:
gSoundMode = cmd->u2.as_s32;
break;
case 0xf1:
for (i = 0; i < 4; i++) {
gSequencePlayers[i].muted = TRUE;
gSequencePlayers[i].recalculateVolume = TRUE;
}
}
break;
break;
case 0xf0:
gSoundMode = cmd->u2.as_s32;
break;
case 0xf1:
for (i = 0; i < 4; i++) {
gSequencePlayers[i].muted = TRUE;
gSequencePlayers[i].recalculateVolume = TRUE;
}
break;
case 0xf2:
for (i = 0; i < 4; i++) {
gSequencePlayers[i].muted = FALSE;
gSequencePlayers[i].recalculateVolume = TRUE;
}
break;
case 0xf2:
for (i = 0; i < 4; i++) {
gSequencePlayers[i].muted = FALSE;
gSequencePlayers[i].recalculateVolume = TRUE;
}
break;
}
}
@ -259,55 +259,54 @@ void func_802ad7ec(u32 arg0) {
}
else if ((cmd->u.s.op & 0x40) != 0) {
switch (cmd->u.s.op) {
case 0x41:
seqPlayer->fadeVolumeScale = cmd->u2.as_f32;
seqPlayer->recalculateVolume = TRUE;
break;
case 0x41:
seqPlayer->fadeVolumeScale = cmd->u2.as_f32;
seqPlayer->recalculateVolume = TRUE;
break;
case 0x47:
seqPlayer->tempo = cmd->u2.as_s32 * TATUMS_PER_BEAT;
break;
case 0x47:
seqPlayer->tempo = cmd->u2.as_s32 * TATUMS_PER_BEAT;
break;
case 0x48:
seqPlayer->transposition = cmd->u2.as_s8;
break;
case 0x48:
seqPlayer->transposition = cmd->u2.as_s8;
break;
case 0x46:
seqPlayer->seqVariationEu[cmd->u.s.arg3] = cmd->u2.as_s8;
break;
case 0x46:
seqPlayer->seqVariationEu[cmd->u.s.arg3] = cmd->u2.as_s8;
break;
}
}
else if (seqPlayer->enabled != FALSE && cmd->u.s.arg2 < 0x10) {
chan = seqPlayer->channels[cmd->u.s.arg2];
if (IS_SEQUENCE_CHANNEL_VALID(chan))
{
if (IS_SEQUENCE_CHANNEL_VALID(chan)) {
switch (cmd->u.s.op) {
case 1:
chan->volumeScale = cmd->u2.as_f32;
chan->changes.as_bitfields.volume = TRUE;
break;
case 2:
chan->volume = cmd->u2.as_f32;
chan->changes.as_bitfields.volume = TRUE;
break;
case 3:
chan->newPan = cmd->u2.as_s8;
chan->changes.as_bitfields.pan = TRUE;
break;
case 4:
chan->freqScale = cmd->u2.as_f32;
chan->changes.as_bitfields.freqScale = TRUE;
break;
case 5:
chan->reverbVol = cmd->u2.as_s8;
break;
case 6:
if (cmd->u.s.arg3 < 8) {
chan->soundScriptIO[cmd->u.s.arg3] = cmd->u2.as_s8;
}
break;
case 8:
chan->stopSomething2 = cmd->u2.as_s8;
case 1:
chan->volumeScale = cmd->u2.as_f32;
chan->changes.as_bitfields.volume = TRUE;
break;
case 2:
chan->volume = cmd->u2.as_f32;
chan->changes.as_bitfields.volume = TRUE;
break;
case 3:
chan->newPan = cmd->u2.as_s8;
chan->changes.as_bitfields.pan = TRUE;
break;
case 4:
chan->freqScale = cmd->u2.as_f32;
chan->changes.as_bitfields.freqScale = TRUE;
break;
case 5:
chan->reverbVol = cmd->u2.as_s8;
break;
case 6:
if (cmd->u.s.arg3 < 8) {
chan->soundScriptIO[cmd->u.s.arg3] = cmd->u2.as_s8;
}
break;
case 8:
chan->stopSomething2 = cmd->u2.as_s8;
}
}
}

View File

@ -152,74 +152,74 @@ void eu_process_audio_cmd(struct EuAudioCmd *cmd) {
struct NoteSubEu *sub;
switch (cmd->u.s.op) {
case 0x81:
preload_sequence(cmd->u.s.arg2, 3);
break;
case 0x81:
preload_sequence(cmd->u.s.arg2, 3);
break;
case 0x82:
case 0x88:
load_sequence(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3);
func_8031D690(cmd->u.s.arg1, cmd->u2.as_s32);
break;
case 0x82:
case 0x88:
load_sequence(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3);
func_8031D690(cmd->u.s.arg1, cmd->u2.as_s32);
break;
case 0x83:
if (gSequencePlayers[cmd->u.s.arg1].enabled != FALSE) {
if (cmd->u2.as_s32 == 0) {
sequence_player_disable(&gSequencePlayers[cmd->u.s.arg1]);
case 0x83:
if (gSequencePlayers[cmd->u.s.arg1].enabled != FALSE) {
if (cmd->u2.as_s32 == 0) {
sequence_player_disable(&gSequencePlayers[cmd->u.s.arg1]);
}
else {
seq_player_fade_to_zero_volume(cmd->u.s.arg1, cmd->u2.as_s32);
}
}
else {
seq_player_fade_to_zero_volume(cmd->u.s.arg1, cmd->u2.as_s32);
break;
case 0x84:
break;
case 0xf0:
gSoundMode = cmd->u2.as_s32;
break;
case 0xf1:
for (i = 0; i < 4; i++) {
gSequencePlayers[i].muted = TRUE;
gSequencePlayers[i].recalculateVolume = TRUE;
}
}
break;
break;
case 0x84:
break;
case 0xf0:
gSoundMode = cmd->u2.as_s32;
break;
case 0xf1:
for (i = 0; i < 4; i++) {
gSequencePlayers[i].muted = TRUE;
gSequencePlayers[i].recalculateVolume = TRUE;
}
break;
case 0xf2:
if (cmd->u2.as_s32 == 1) {
for (i = 0; i < gMaxSimultaneousNotes; i++) {
note = &gNotes[i];
sub = &note->noteSubEu;
if (note->noteSubEu.enabled && note->unkSH34 == 0) {
if ((note->parentLayer->seqChannel->muteBehavior & 8) != 0) {
sub->finished = TRUE;
case 0xf2:
if (cmd->u2.as_s32 == 1) {
for (i = 0; i < gMaxSimultaneousNotes; i++) {
note = &gNotes[i];
sub = &note->noteSubEu;
if (note->noteSubEu.enabled && note->unkSH34 == 0) {
if ((note->parentLayer->seqChannel->muteBehavior & 8) != 0) {
sub->finished = TRUE;
}
}
}
}
}
for (i = 0; i < 4; i++) {
gSequencePlayers[i].muted = FALSE;
gSequencePlayers[i].recalculateVolume = TRUE;
}
break;
for (i = 0; i < 4; i++) {
gSequencePlayers[i].muted = FALSE;
gSequencePlayers[i].recalculateVolume = TRUE;
}
break;
case 0xf3:
func_sh_802f3024(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3);
break;
case 0xf3:
func_sh_802f3024(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3);
break;
case 0xf4:
func_sh_802f30f4(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3, &gUnkQueue1);
break;
case 0xf4:
func_sh_802f30f4(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3, &gUnkQueue1);
break;
case 0xf5:
func_sh_802f3158(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3, &gUnkQueue1);
break;
case 0xf5:
func_sh_802f3158(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3, &gUnkQueue1);
break;
case 0xf6:
func_sh_802f3288(cmd->u.s.arg2);
break;
case 0xf6:
func_sh_802f3288(cmd->u.s.arg2);
break;
}
}
@ -344,75 +344,74 @@ void func_802ad7ec(u32 arg0) {
}
else if ((cmd->u.s.op & 0x40) != 0) {
switch (cmd->u.s.op) {
case 0x41:
if (seqPlayer->fadeVolumeScale != cmd->u2.as_f32) {
seqPlayer->fadeVolumeScale = cmd->u2.as_f32;
seqPlayer->recalculateVolume = TRUE;
}
break;
case 0x41:
if (seqPlayer->fadeVolumeScale != cmd->u2.as_f32) {
seqPlayer->fadeVolumeScale = cmd->u2.as_f32;
seqPlayer->recalculateVolume = TRUE;
}
break;
case 0x47:
seqPlayer->tempo = cmd->u2.as_s32 * TATUMS_PER_BEAT;
break;
case 0x47:
seqPlayer->tempo = cmd->u2.as_s32 * TATUMS_PER_BEAT;
break;
case 0x49:
seqPlayer->tempoAdd = cmd->u2.as_s32 * TEMPO_SCALE;
break;
case 0x49:
seqPlayer->tempoAdd = cmd->u2.as_s32 * TEMPO_SCALE;
break;
case 0x48:
seqPlayer->transposition = cmd->u2.as_s8;
break;
case 0x48:
seqPlayer->transposition = cmd->u2.as_s8;
break;
case 0x46:
seqPlayer->seqVariationEu[cmd->u.s.arg3] = cmd->u2.as_s8;
break;
case 0x46:
seqPlayer->seqVariationEu[cmd->u.s.arg3] = cmd->u2.as_s8;
break;
}
}
else if (seqPlayer->enabled != FALSE && cmd->u.s.arg2 < 0x10) {
chan = seqPlayer->channels[cmd->u.s.arg2];
if (IS_SEQUENCE_CHANNEL_VALID(chan))
{
if (IS_SEQUENCE_CHANNEL_VALID(chan)) {
switch (cmd->u.s.op) {
case 1:
if (chan->volumeScale != cmd->u2.as_f32) {
chan->volumeScale = cmd->u2.as_f32;
chan->changes.as_bitfields.volume = TRUE;
}
break;
case 2:
if (chan->volume != cmd->u2.as_f32) {
chan->volume = cmd->u2.as_f32;
chan->changes.as_bitfields.volume = TRUE;
}
break;
case 3:
if (chan->newPan != cmd->u2.as_s8) {
chan->newPan = cmd->u2.as_s8;
chan->changes.as_bitfields.pan = TRUE;
}
break;
case 4:
if (chan->freqScale != cmd->u2.as_f32) {
chan->freqScale = cmd->u2.as_f32;
chan->changes.as_bitfields.freqScale = TRUE;
}
break;
case 5:
//! @bug u8 s8 comparison (but harmless)
if (chan->reverbVol != cmd->u2.as_s8) {
chan->reverbVol = cmd->u2.as_s8;
}
break;
case 6:
if (cmd->u.s.arg3 < 8) {
chan->soundScriptIO[cmd->u.s.arg3] = cmd->u2.as_s8;
}
break;
case 8:
chan->stopSomething2 = cmd->u2.as_s8;
break;
case 9:
chan->muteBehavior = cmd->u2.as_s8;
case 1:
if (chan->volumeScale != cmd->u2.as_f32) {
chan->volumeScale = cmd->u2.as_f32;
chan->changes.as_bitfields.volume = TRUE;
}
break;
case 2:
if (chan->volume != cmd->u2.as_f32) {
chan->volume = cmd->u2.as_f32;
chan->changes.as_bitfields.volume = TRUE;
}
break;
case 3:
if (chan->newPan != cmd->u2.as_s8) {
chan->newPan = cmd->u2.as_s8;
chan->changes.as_bitfields.pan = TRUE;
}
break;
case 4:
if (chan->freqScale != cmd->u2.as_f32) {
chan->freqScale = cmd->u2.as_f32;
chan->changes.as_bitfields.freqScale = TRUE;
}
break;
case 5:
//! @bug u8 s8 comparison (but harmless)
if (chan->reverbVol != cmd->u2.as_s8) {
chan->reverbVol = cmd->u2.as_s8;
}
break;
case 6:
if (cmd->u.s.arg3 < 8) {
chan->soundScriptIO[cmd->u.s.arg3] = cmd->u2.as_s8;
}
break;
case 8:
chan->stopSomething2 = cmd->u2.as_s8;
break;
case 9:
chan->muteBehavior = cmd->u2.as_s8;
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -9,14 +9,14 @@
// -g codegen implies that they are separate variables. This is impossible to
// reconcile without undefined behavior. Avoid that when possible.
#ifdef AVOID_UB
extern u16 gFrameBuffers[3][SCREEN_WIDTH * SCREEN_HEIGHT];
#define gFrameBuffer0 gFrameBuffers[0]
#define gFrameBuffer1 gFrameBuffers[1]
#define gFrameBuffer2 gFrameBuffers[2]
extern u16 gFramebuffers[3][SCREEN_WIDTH * SCREEN_HEIGHT];
#define gFramebuffer0 gFramebuffers[0]
#define gFramebuffer1 gFramebuffers[1]
#define gFramebuffer2 gFramebuffers[2]
#else
extern u16 gFrameBuffer0[SCREEN_WIDTH * SCREEN_HEIGHT];
extern u16 gFrameBuffer1[SCREEN_WIDTH * SCREEN_HEIGHT];
extern u16 gFrameBuffer2[SCREEN_WIDTH * SCREEN_HEIGHT];
extern u16 gFramebuffer0[SCREEN_WIDTH * SCREEN_HEIGHT];
extern u16 gFramebuffer1[SCREEN_WIDTH * SCREEN_HEIGHT];
extern u16 gFramebuffer2[SCREEN_WIDTH * SCREEN_HEIGHT];
#endif
#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.
void cur_obj_update(void) {
UNUSED u32 unused;
UNUSED u8 filler[4];
s16 objFlags = gCurrentObject->oFlags;
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)
*/
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->activeAreaIndex = spawn->activeAreaIndex;
graphNode->sharedChild = spawn->unk18;
graphNode->sharedChild = spawn->model;
graphNode->unk4C = spawn;
graphNode->throwMatrix = NULL;
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) {
s32 result;
struct Animation *anim;
anim = obj->curAnim;
struct Animation *anim = obj->curAnim;
if (obj->animTimer == gAreaUpdateCounter || anim->flags & ANIM_FLAG_2) {
if (accelAssist != NULL) {
@ -804,7 +802,7 @@ s16 geo_update_animation_frame(struct AnimInfo *obj, s32 *accelAssist) {
}
if (anim->flags & ANIM_FLAG_FORWARD) {
if (obj->animAccel) {
if (obj->animAccel != 0) {
result = obj->animFrameAccelAssist - obj->animAccel;
} else {
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
* when they are processed.
*/
struct FnGraphNode
{
struct FnGraphNode {
/*0x00*/ struct GraphNode node;
/*0x14*/ GraphNodeFunc func;
};
/** The very root of the geo tree. Specifies the viewport.
*/
struct GraphNodeRoot
{
struct GraphNodeRoot {
/*0x00*/ struct GraphNode node;
/*0x14*/ u8 areaIndex;
/*0x15*/ s8 unk15; // ?
@ -92,8 +90,7 @@ struct GraphNodeRoot
/** A node that sets up an orthographic projection based on the global
* root node. Used to draw the skybox image.
*/
struct GraphNodeOrthoProjection
{
struct GraphNodeOrthoProjection {
/*0x00*/ struct GraphNode node;
/*0x14*/ f32 scale;
};
@ -102,8 +99,7 @@ struct GraphNodeOrthoProjection
* game world. It does not set up the camera position, that is done by
* the child of this node, which has type GraphNodeCamera.
*/
struct GraphNodePerspective
{
struct GraphNodePerspective {
/*0x00*/ struct FnGraphNode fnNode;
/*0x18*/ s32 unused;
/*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
* carrying a transformation matrix.
*/
struct DisplayListNode
{
struct DisplayListNode {
Mtx *transform;
void *displayList;
struct DisplayListNode *next;
@ -126,8 +121,7 @@ struct DisplayListNode
* different master list than opaque objects.
* It also sets the z-buffer on before rendering and off after.
*/
struct GraphNodeMasterList
{
struct GraphNodeMasterList {
/*0x00*/ struct GraphNode node;
/*0x14*/ struct DisplayListNode *listHeads[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.
* Does not have any additional functionality.
*/
struct GraphNodeStart
{
struct GraphNodeStart {
/*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
* The tower in Whomp's fortress has two levels of detail.
*/
struct GraphNodeLevelOfDetail
{
struct GraphNodeLevelOfDetail {
/*0x00*/ struct GraphNode node;
/*0x14*/ s16 minDistance;
/*0x16*/ s16 maxDistance;
@ -159,8 +151,7 @@ struct GraphNodeLevelOfDetail
* which is set in the node's function.
* Usage examples: room visibility, coin animation, blinking, Mario's power-up / hand pose / cap
*/
struct GraphNodeSwitchCase
{
struct GraphNodeSwitchCase {
/*0x00*/ struct FnGraphNode fnNode;
/*0x18*/ s32 unused;
/*0x1C*/ s16 numCases;
@ -171,8 +162,7 @@ struct GraphNodeSwitchCase
* GraphNode that specifies the location and aim of the camera.
* When the roll is 0, the up vector is (0, 1, 0).
*/
struct GraphNodeCamera
{
struct GraphNodeCamera {
/*0x00*/ struct FnGraphNode fnNode;
/*0x18*/ union {
// When the node is created, a mode is assigned to the node.
@ -195,8 +185,7 @@ struct GraphNodeCamera
* based on the ENEMYINFO array.
* The display list can be null, in which case it won't draw anything itself.
*/
struct GraphNodeTranslationRotation
{
struct GraphNodeTranslationRotation {
/*0x00*/ struct GraphNode node;
/*0x14*/ void *displayList;
/*0x18*/ Vec3s translation;
@ -207,12 +196,11 @@ struct GraphNodeTranslationRotation
* 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.
*/
struct GraphNodeTranslation
{
struct GraphNodeTranslation {
/*0x00*/ struct GraphNode node;
/*0x14*/ void *displayList;
/*0x18*/ Vec3s translation;
u8 pad1E[2];
u8 filler[2];
};
/** GraphNode that rotates itself and its children.
@ -220,12 +208,11 @@ struct GraphNodeTranslation
* set by a parent script node in that case.
* The display list can be null, in which case it won't draw anything itself.
*/
struct GraphNodeRotation
{
struct GraphNodeRotation {
/*0x00*/ struct GraphNode node;
/*0x14*/ void *displayList;
/*0x18*/ Vec3s rotation;
u8 pad1E[2];
u8 filler[2];
};
/** 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.
* The display list can be null, in which case it won't draw anything itself.
*/
struct GraphNodeAnimatedPart
{
struct GraphNodeAnimatedPart {
/*0x00*/ struct GraphNode node;
/*0x14*/ void *displayList;
/*0x18*/ Vec3s translation;
@ -247,8 +233,7 @@ struct GraphNodeAnimatedPart
* then it simply sets the billboard flag for the entire object, this node is
* used for billboard parts (like a chuckya or goomba body).
*/
struct GraphNodeBillboard
{
struct GraphNodeBillboard {
/*0x00*/ struct GraphNode node;
/*0x14*/ void *displayList;
/*0x18*/ Vec3s translation;
@ -257,8 +242,7 @@ struct GraphNodeBillboard
/** A GraphNode that simply draws a display list without doing any
* transformation beforehand. It does inherit the parent's transformation.
*/
struct GraphNodeDisplayList
{
struct GraphNodeDisplayList {
/*0x00*/ struct GraphNode node;
/*0x14*/ void *displayList;
};
@ -271,8 +255,7 @@ struct GraphNodeDisplayList
* 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.
*/
struct GraphNodeScale
{
struct GraphNodeScale {
/*0x00*/ struct GraphNode node;
/*0x14*/ void *displayList;
/*0x18*/ f32 scale;
@ -283,8 +266,7 @@ struct GraphNodeScale
* The shadow type determines the shape (round or rectangular), vertices (4 or 9)
* and other features.
*/
struct GraphNodeShadow
{
struct GraphNodeShadow {
/*0x00*/ struct GraphNode node;
/*0x14*/ s16 shadowScale; // diameter (when a circle) or side (when a square) of shadow
/*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
* object nodes.
*/
struct GraphNodeObjectParent
{
struct GraphNodeObjectParent {
/*0x00*/ struct GraphNode node;
/*0x14*/ struct GraphNode *sharedChild;
};
@ -308,8 +289,7 @@ struct GraphNodeObjectParent
* The parameter field gives extra context info. For shifting sand or paintings,
* it can determine which texture to use.
*/
struct GraphNodeGenerated
{
struct GraphNodeGenerated {
/*0x00*/ struct FnGraphNode fnNode;
/*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.
* Drawn in an orthographic projection, used for skyboxes.
*/
struct GraphNodeBackground
{
struct GraphNodeBackground {
/*0x00*/ struct FnGraphNode fnNode;
/*0x18*/ s32 unused;
/*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.
*/
struct GraphNodeHeldObject
{
struct GraphNodeHeldObject {
/*0x00*/ struct FnGraphNode fnNode;
/*0x18*/ s32 playerIndex;
/*0x1C*/ struct Object *objNode;
@ -339,11 +317,10 @@ struct GraphNodeHeldObject
* object node. Used for very large objects, such as shock wave rings that Bowser
* creates, tornadoes, the big eel.
*/
struct GraphNodeCullingRadius
{
struct GraphNodeCullingRadius {
/*0x00*/ struct GraphNode node;
/*0x14*/ s16 cullingRadius; // specifies the 'sphere radius' for purposes of frustum culling
u8 pad1E[2];
u8 filler[2];
};
extern struct GraphNodeMasterList *gCurGraphNodeMasterList;

View File

@ -286,7 +286,7 @@ static void level_cmd_load_mario_head(void) {
if (addr != NULL) {
gdm_init(addr, DOUBLE_SIZE_ON_64_BIT(0xE1000));
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_maketestdl(CMD_GET(s16, 2));
} else {
@ -425,7 +425,7 @@ static void level_cmd_init_mario(void) {
gMarioSpawnInfo->areaIndex = 0;
gMarioSpawnInfo->behaviorArg = CMD_GET(u32, 4);
gMarioSpawnInfo->behaviorScript = CMD_GET(void *, 8);
gMarioSpawnInfo->unk18 = gLoadedGraphNodes[CMD_GET(u8, 3)];
gMarioSpawnInfo->model = gLoadedGraphNodes[CMD_GET(u8, 3)];
gMarioSpawnInfo->next = NULL;
sCurrentCmd = CMD_NEXT;
@ -453,7 +453,7 @@ static void level_cmd_place_object(void) {
spawnInfo->behaviorArg = CMD_GET(u32, 16);
spawnInfo->behaviorScript = CMD_GET(void *, 20);
spawnInfo->unk18 = gLoadedGraphNodes[model];
spawnInfo->model = gLoadedGraphNodes[model];
spawnInfo->next = gAreas[sCurrAreaIndex].objectSpawnInfos;
gAreas[sCurrAreaIndex].objectSpawnInfos = spawnInfo;
@ -545,8 +545,8 @@ static void level_cmd_3A(void) {
struct UnusedArea28 *val4;
if (sCurrAreaIndex != -1) {
if ((val4 = gAreas[sCurrAreaIndex].unused28) == NULL) {
val4 = gAreas[sCurrAreaIndex].unused28 =
if ((val4 = gAreas[sCurrAreaIndex].unused) == NULL) {
val4 = gAreas[sCurrAreaIndex].unused =
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);
// Increment the debug tracker.
gNumCalls.wall += 1;
gNumCalls.wall++;
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) {
s16 cellZ, cellX;
struct Surface *ceil, *dynamicCeil;
struct SurfaceNode *surfaceList;
f32 height = CELL_HEIGHT_LIMIT;
f32 dynamicHeight = CELL_HEIGHT_LIMIT;
s16 x, y, z;
//! (Parallel Universes) Because position is casted to an s16, reaching higher
// float locations can return ceilings despite them not existing there.
//(Dynamic ceilings will unload due to the range.)
x = (s16) posX;
y = (s16) posY;
z = (s16) posZ;
// float locations can return ceilings despite them not existing there.
// (Dynamic ceilings will unload due to the range.)
s16 x = (s16) posX;
s16 y = (s16) posY;
s16 z = (s16) posZ;
*pceil = NULL;
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;
// Increment the debug tracker.
gNumCalls.ceil += 1;
gNumCalls.ceil++;
return height;
}
@ -518,8 +520,8 @@ f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
f32 dynamicHeight = FLOOR_LOWER_LIMIT;
//! (Parallel Universes) Because position is casted to an s16, reaching higher
// float locations can return floors despite them not existing there.
//(Dynamic floors will unload due to the range.)
// float locations can return floors despite them not existing there.
// (Dynamic floors will unload due to the range.)
s16 x = (s16) xPos;
s16 y = (s16) yPos;
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 (floor == NULL) {
gNumFindFloorMisses += 1;
gNumFindFloorMisses++;
}
if (dynamicHeight > height) {
@ -574,7 +576,7 @@ f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
*pfloor = floor;
// Increment the debug tracker.
gNumCalls.floor += 1;
gNumCalls.floor++;
return height;
}
@ -624,7 +626,7 @@ f32 find_water_level(f32 x, f32 z) {
f32 find_poison_gas_level(f32 x, f32 z) {
s32 i;
s32 numRegions;
UNUSED s32 unused;
UNUSED u8 filler[4];
s16 val;
f32 loX, hiX, loZ, hiZ;
f32 gasLevel = FLOOR_LOWER_LIMIT;

View File

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

View File

@ -1,7 +1,5 @@
#include <PR/ultratypes.h>
#include "prevent_bss_reordering.h"
#include "sm64.h"
#include "game/ingame_menu.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
// miss walls that are near a cell border.
if (coord % CELL_SIZE < 50) {
index -= 1;
index--;
}
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
// miss walls that are near a cell border.
if (coord % CELL_SIZE > CELL_SIZE - 50) {
index += 1;
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);
numSurfaces = *(*data);
*data += 1;
(*data)++;
for (i = 0; i < numSurfaces; i++) {
if (*surfaceRooms != NULL) {
room = *(*surfaceRooms);
*surfaceRooms += 1;
(*surfaceRooms)++;
}
surface = read_surface_data(vertexData, data);
@ -467,7 +465,7 @@ static void load_static_surfaces(s16 **data, s16 *vertexData, s16 surfaceType, s
*data += 3;
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) {
s32 numVertices;
UNUSED s16 unused1[3];
UNUSED s16 unused2[3];
UNUSED u8 filler[16];
s16 *vertexData;
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) {
s16 terrainLoadType;
s16 *vertexData;
UNUSED s32 unused;
UNUSED u8 filler[4];
// Initialize the data for this.
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.
*/
void load_object_collision_model(void) {
UNUSED s32 unused;
UNUSED u8 filler[4];
s16 vertexData[600];
s16 *collisionData = gCurrentObject->collisionData;

View File

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

View File

@ -109,7 +109,7 @@ void print_intro_text(void) {
#ifdef VERSION_EU
s32 language = eu_get_language();
#endif
if ((gGlobalTimer & 0x1F) < 20) {
if ((gGlobalTimer & 31) < 20) {
if (gControllerBits == 0) {
#ifdef VERSION_EU
print_text_centered(SCREEN_WIDTH / 2, 20, gNoControllerMsg[language]);
@ -194,7 +194,7 @@ void clear_areas(void) {
gAreaData[i].instantWarps = NULL;
gAreaData[i].objectSpawnInfos = NULL;
gAreaData[i].camera = NULL;
gAreaData[i].unused28 = NULL;
gAreaData[i].unused = NULL;
gAreaData[i].whirlpools[0] = NULL;
gAreaData[i].whirlpools[1] = NULL;
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;
if (transType & 1) // Is the image fading in?
{
if (transType & 1) { // Is the image fading in?
gWarpTransition.data.startTexRadius = GFX_DIMENSIONS_FULL_RADIUS;
if (transType >= 0x0F) {
gWarpTransition.data.endTexRadius = 16;
} else {
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) {
gWarpTransition.data.startTexRadius = 16;
} else {
@ -409,7 +407,7 @@ void render_game(void) {
if (D_8032CE78 != NULL) {
clear_viewport(D_8032CE78, gWarpTransFBSetColor);
} else {
clear_frame_buffer(gWarpTransFBSetColor);
clear_framebuffer(gWarpTransFBSetColor);
}
}

View File

@ -7,16 +7,14 @@
#include "camera.h"
#include "engine/graph_node.h"
struct WarpNode
{
struct WarpNode {
/*00*/ u8 id;
/*01*/ u8 destLevel;
/*02*/ u8 destArea;
/*03*/ u8 destNode;
};
struct ObjectWarpNode
{
struct ObjectWarpNode {
/*0x00*/ struct WarpNode node;
/*0x04*/ struct Object *object;
/*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_STOP 0x04 // Less than Surface 0x1F
struct InstantWarp
{
struct InstantWarp {
/*0x00*/ u8 id; // 0 = 0x1B / 1 = 0x1C / 2 = 0x1D / 3 = 0x1E
/*0x01*/ u8 area;
/*0x02*/ Vec3s displacement;
};
struct SpawnInfo
{
struct SpawnInfo {
/*0x00*/ Vec3s startPos;
/*0x06*/ Vec3s startAngle;
/*0x0C*/ s8 areaIndex;
/*0x0D*/ s8 activeAreaIndex;
/*0x10*/ u32 behaviorArg;
/*0x14*/ void *behaviorScript;
/*0x18*/ struct GraphNode *unk18;
/*0x18*/ struct GraphNode *model;
/*0x1C*/ struct SpawnInfo *next;
};
struct UnusedArea28
{
struct UnusedArea28 {
/*0x00*/ s16 unk00;
/*0x02*/ s16 unk02;
/*0x04*/ s16 unk04;
@ -54,14 +49,12 @@ struct UnusedArea28
/*0x08*/ s16 unk08;
};
struct Whirlpool
{
struct Whirlpool {
/*0x00*/ Vec3s pos;
/*0x03*/ s16 strength;
};
struct Area
{
struct Area {
/*0x00*/ s8 index;
/*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)
@ -74,7 +67,7 @@ struct Area
/*0x1C*/ struct InstantWarp *instantWarps;
/*0x20*/ struct SpawnInfo *objectSpawnInfos;
/*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];
/*0x34*/ u8 dialog[2]; // Level start dialog number (set by level script cmd 0x30)
/*0x36*/ u16 musicParam;
@ -82,8 +75,7 @@ struct Area
};
// All the transition data to be used in screen_transition.c
struct WarpTransitionData
{
struct WarpTransitionData {
/*0x00*/ u8 red;
/*0x01*/ u8 green;
/*0x02*/ u8 blue;
@ -109,8 +101,7 @@ struct WarpTransitionData
#define WARP_TRANSITION_FADE_FROM_BOWSER 0x12
#define WARP_TRANSITION_FADE_INTO_BOWSER 0x13
struct WarpTransition
{
struct WarpTransition {
/*0x00*/ u8 isActive; // Is the transition active. (either TRUE or FALSE)
/*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)

View File

@ -47,47 +47,18 @@
#define o gCurrentObject
struct WFRotatingPlatformData {
s16 pad;
s16 scale;
const Collision *collisionData;
s16 collisionDistance;
static s32 sCapSaveFlags[] = {
SAVE_FLAG_HAVE_WING_CAP,
SAVE_FLAG_HAVE_METAL_CAP,
SAVE_FLAG_HAVE_VANISH_CAP,
};
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
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,
509, 402, 308, 226, 157, 100, 56, 25, 4, 0 };
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,
509, 402, 308, 226, 157, 100, 56, 25, 4, 0,
};
#include "behaviors/star_door.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"
// 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)
void spawn_mist_particles_variable(s32 count, s32 offsetY, f32 size) {
sMistParticles.sizeBase = size;
sMistParticles.sizeRange = size / 20.0;
sMistParticles.offsetY = offsetY;
if (count == 0) {
sMistParticles.count = 20;
} else if (count > 20) {
@ -122,6 +107,7 @@ void spawn_mist_particles_variable(s32 count, s32 offsetY, f32 size) {
} else {
sMistParticles.count = 4;
}
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.
Gfx *geo_move_mario_part_from_parent(s32 run, UNUSED struct GraphNode *node, Mat4 mtx) {
Mat4 sp20;
struct Object *sp1C;
if (run == TRUE) {
sp1C = (struct Object *) gCurGraphNodeObject;
struct Object *sp1C = (struct Object *) gCurGraphNodeObject;
if (sp1C == gMarioObject && sp1C->prevObj != NULL) {
create_transformation_from_matrices(sp20, mtx, *gCurGraphNodeCamera->matrixPtr);
obj_update_pos_from_parent_transformation(sp20, sp1C->prevObj);
obj_set_gfx_pos_from_pos(sp1C->prevObj);
}
}
return NULL;
}
@ -185,6 +171,7 @@ void spawn_sparkle_particles(s32 n, s32 a1, s32 a2, s32 r) {
static s16 D_8035FF10;
s32 i;
s16 separation = 0x10000 / n; // Evenly spread around a circle
for (i = 0; i < n; i++) {
spawn_object_relative(0, sins(D_8035FF10 + i * separation) * a1, (i + 1) * a2,
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) {
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;
}
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);
return 1;
return TRUE;
}
return 0;
return FALSE;
}
#include "behaviors/tuxie.inc.c"

View File

@ -1,3 +1,4 @@
/**
* Behavior for bhvActivatedBackAndForthPlatform.
* 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
* 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_BITFS_MESH_PLAT */ bitfs_seg7_collision_070157E0,
/* 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.
*/
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
// 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,
// Mario actually has to wait 22 frames before the platform starts moving.
if (o->oActivatedBackAndForthPlatformCountdown != 0) {
o->oActivatedBackAndForthPlatformCountdown -= 1;
o->oActivatedBackAndForthPlatformCountdown--;
} else {
// After the wait period is over, we start moving, by adding the velocity
// to the positional offset.

View File

@ -1,3 +1,4 @@
/**
* Behavior for bhvHomingAmp and bhvCirclingAmp.
* 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->oHomeY = o->oPosY;
o->oHomeZ = o->oPosZ;
o->oGravity = 0;
o->oFriction = 1.0;
o->oBuoyancy = 1.0;
o->oGravity = 0.0f;
o->oFriction = 1.0f;
o->oBuoyancy = 1.0f;
o->oHomingAmpAvgY = o->oHomeY;
// 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) {
// Unnecessary if statement, maybe caused by a macro for
// if (o->oInteractStatus & INT_STATUS_INTERACTED)
// if (o->oInteractStatus & INT_STATUS_INTERACTED) {
// o->oAction = X;
// }
// ?
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
// 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,
// reset the amp's size and start chasing Mario.
if (o->oTimer >= 91) {
if (o->oTimer > 90) {
cur_obj_scale(1.0f);
o->oAction = HOMING_AMP_ACT_CHASE;
o->oAmpYPhase = 0;
@ -121,7 +123,7 @@ static void homing_amp_chase_loop(void) {
o->oHomingAmpAvgY = gMarioObject->header.gfx.pos[1] + 150.0f;
}
if (o->oTimer >= 31) {
if (o->oTimer > 30) {
o->oHomingAmpLockedOn = FALSE;
}
} else {
@ -160,7 +162,7 @@ static void homing_amp_give_up_loop(void) {
// Move forward for 152 frames
o->oForwardVel = 15.0f;
if (o->oTimer >= 151) {
if (o->oTimer > 150) {
// Hide the amp and reset it back to its inactive state
o->oPosX = o->oHomeX;
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->oAction = HOMING_AMP_ACT_INACTIVE;
o->oAnimState = 0;
o->oForwardVel = 0;
o->oForwardVel = 0.0f;
o->oHomingAmpAvgY = o->oHomeY;
}
}
@ -179,15 +181,15 @@ static void homing_amp_give_up_loop(void) {
static void amp_attack_cooldown_loop(void) {
// Turn intangible and wait for 90 frames before chasing Mario again after hitting him.
o->header.gfx.animInfo.animFrame += 2;
o->oForwardVel = 0;
o->oForwardVel = 0.0f;
cur_obj_become_intangible();
if (o->oTimer >= 31) {
if (o->oTimer > 30) {
o->oAnimState = 0;
}
if (o->oTimer >= 91) {
if (o->oTimer > 90) {
o->oAnimState = 1;
cur_obj_become_tangible();
o->oAction = HOMING_AMP_ACT_CHASE;
@ -334,7 +336,6 @@ void bhv_circling_amp_loop(void) {
} else {
circling_amp_idle_loop();
}
break;
case AMP_ACT_ATTACK_COOLDOWN:

View File

@ -1,8 +1,8 @@
// animated_floor_switch.inc.c
struct Struct80331A54 {
const void *unk00;
s16 unk04;
const Collision *collision;
s16 model;
};
struct Struct80331A54 D_80331A54[][5] = {
@ -63,7 +63,7 @@ void bhv_animates_on_floor_switch_press_loop(void) {
}
if (o->oFloorSwitchPressAnimationUnkF8 < 9) {
o->oFloorSwitchPressAnimationUnkF8 += 1;
o->oFloorSwitchPressAnimationUnkF8++;
}
} else if ((o->oFloorSwitchPressAnimationUnkF8 -= 2) < 0) {
o->oFloorSwitchPressAnimationUnkF8 = 0;
@ -71,7 +71,7 @@ void bhv_animates_on_floor_switch_press_loop(void) {
}
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.
* When a player stands on an arrow lift, it starts moving between

View File

@ -1,3 +1,4 @@
/**
* Behavior for bhvHauntedBookshelf.
* 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;
case HAUNTED_BOOKSHELF_ACT_RECEDE:
// Move the bookshelf and play the sound
o->oPosX += 5.0f;
@ -40,6 +42,7 @@ void bhv_haunted_bookshelf_loop(void) {
}
break;
default:
break;
}

View File

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

View File

@ -1,3 +1,4 @@
/**
* Behavior for bhvBbhTiltingTrapPlatform.
* This is the tilting platform trap in the upper floor of BBH
@ -8,9 +9,9 @@
* Update function for bhvBbhTiltingTrapPlatform.
*/
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.
// This was done so that Mario leaving or getting on the platform
// resets oTimer to 0.
@ -29,14 +30,14 @@ void bhv_bbh_tilting_trap_platform_loop(void) {
o->oFaceAnglePitch += o->oAngleVelPitch;
} else
#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,
// 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
// the platform more dangerous. This code will not work correctly
// without the oAction changes above, since oTimer will not ever
// reset to 0 without them.
if ((absi(o->oFaceAnglePitch) < 3000) || (o->oTimer >= 16))
if ((absi(o->oFaceAnglePitch) < 3000) || (o->oTimer > 15))
#endif
{
// Make the platform return to the horizontal at a speed of

View File

@ -1,3 +1,4 @@
/**
* Behavior for bhvAlphaBooKey and bhvBetaBooKey.
* 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;
}
static void (*sBetaBooKeyActions[])(void) = { beta_boo_key_inside_boo_loop, beta_boo_key_drop,
beta_boo_key_dropped_loop };
static void (*sBetaBooKeyActions[])(void) = {
beta_boo_key_inside_boo_loop,
beta_boo_key_drop,
beta_boo_key_dropped_loop,
};
/**
* Update function for bhvBetaBooKey.

View File

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

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