You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Object constants and new typedefs
This commit is contained in:
@@ -415,7 +415,7 @@ static void level_cmd_end_area(void) {
|
||||
}
|
||||
|
||||
static void level_cmd_load_model_from_dl(void) {
|
||||
ModelID model = CMD_GET(ModelID, 0xA);
|
||||
ModelID16 model = CMD_GET(ModelID16, 0xA);
|
||||
s16 layer = CMD_GET(u16, 0x8);
|
||||
void *dl_ptr = CMD_GET(void *, 4);
|
||||
|
||||
@@ -428,7 +428,7 @@ static void level_cmd_load_model_from_dl(void) {
|
||||
}
|
||||
|
||||
static void level_cmd_load_model_from_geo(void) {
|
||||
ModelID model = CMD_GET(ModelID, 2);
|
||||
ModelID16 model = CMD_GET(ModelID16, 2);
|
||||
void *geo = CMD_GET(void *, 4);
|
||||
|
||||
if (model < MODEL_ID_COUNT) {
|
||||
@@ -444,7 +444,7 @@ static void level_cmd_23(void) {
|
||||
f32 f;
|
||||
} arg2;
|
||||
|
||||
ModelID model = CMD_GET(s16, 2) & 0x0FFF;
|
||||
ModelID16 model = CMD_GET(s16, 2) & 0x0FFF;
|
||||
s16 arg0H = ((u16)CMD_GET(s16, 2)) >> 12;
|
||||
void *arg1 = CMD_GET(void *, 4);
|
||||
// load an f32, but using an integer load instruction for some reason (hence the union)
|
||||
@@ -468,7 +468,7 @@ static void level_cmd_init_mario(void) {
|
||||
gMarioSpawnInfo->areaIndex = 0;
|
||||
gMarioSpawnInfo->behaviorArg = CMD_GET(u32, 4);
|
||||
gMarioSpawnInfo->behaviorScript = CMD_GET(void *, 8);
|
||||
gMarioSpawnInfo->modelNode = gLoadedGraphNodes[CMD_GET(ModelID, 0x2)];
|
||||
gMarioSpawnInfo->modelNode = gLoadedGraphNodes[CMD_GET(ModelID16, 0x2)];
|
||||
gMarioSpawnInfo->next = NULL;
|
||||
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
|
||||
@@ -118,6 +118,13 @@ struct WarpTransition
|
||||
/*0x04*/ struct WarpTransitionData data;
|
||||
};
|
||||
|
||||
enum CurrSaveFileNum {
|
||||
SAVE_FILE_NUM_A = 0x1,
|
||||
SAVE_FILE_NUM_B,
|
||||
SAVE_FILE_NUM_C,
|
||||
SAVE_FILE_NUM_D,
|
||||
};
|
||||
|
||||
enum MenuOption {
|
||||
MENU_OPT_NONE,
|
||||
MENU_OPT_1,
|
||||
|
||||
@@ -59,7 +59,7 @@ struct TumblingBridgeParams {
|
||||
s16 numBridgeSections;
|
||||
s16 bridgeRelativeStartingXorZ;
|
||||
s16 platformWidth;
|
||||
ModelID model;
|
||||
ModelID16 model;
|
||||
const void *segAddr;
|
||||
};
|
||||
|
||||
@@ -67,7 +67,7 @@ struct ExclamationBoxContents {
|
||||
u8 id;
|
||||
u8 unk1;
|
||||
u8 behParams;
|
||||
ModelID model;
|
||||
ModelID16 model;
|
||||
const BehaviorScript *behavior;
|
||||
};
|
||||
|
||||
@@ -79,7 +79,7 @@ struct CheckerBoardPlatformInitPosition {
|
||||
|
||||
struct OpenableGrill {
|
||||
s16 halfWidth;
|
||||
ModelID modelID;
|
||||
ModelID16 modelID;
|
||||
const Collision *collision;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
struct FloorSwitchTriggeredAnimationFrame {
|
||||
const void *collisionDataPtr;
|
||||
ModelID model;
|
||||
ModelID16 model;
|
||||
};
|
||||
|
||||
struct FloorSwitchTriggeredAnimationFrame sFloorSwitchTriggeredAnimationFrames[][5] = {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* Move the arrow lift away from its original position.
|
||||
*/
|
||||
static s32 arrow_lift_move_away(void) {
|
||||
s8 status = ARROW_LIFT_NOT_DONE_MOVING;
|
||||
s8 doneMoving = FALSE;
|
||||
|
||||
o->oMoveAngleYaw = o->oFaceAngleYaw - 0x4000;
|
||||
o->oVelY = 0;
|
||||
@@ -26,18 +26,18 @@ static s32 arrow_lift_move_away(void) {
|
||||
if (o->oArrowLiftDisplacement > 384) {
|
||||
o->oForwardVel = 0;
|
||||
o->oArrowLiftDisplacement = 384;
|
||||
status = ARROW_LIFT_DONE_MOVING;
|
||||
doneMoving = TRUE;
|
||||
}
|
||||
|
||||
obj_move_xyz_using_fvel_and_yaw(o);
|
||||
return status;
|
||||
return doneMoving;
|
||||
}
|
||||
|
||||
/**
|
||||
* Move the arrow lift back to its original position.
|
||||
*/
|
||||
static s8 arrow_lift_move_back(void) {
|
||||
s8 status = ARROW_LIFT_NOT_DONE_MOVING;
|
||||
s8 doneMoving = FALSE;
|
||||
|
||||
o->oMoveAngleYaw = o->oFaceAngleYaw + 0x4000;
|
||||
o->oVelY = 0;
|
||||
@@ -48,11 +48,11 @@ static s8 arrow_lift_move_back(void) {
|
||||
if (o->oArrowLiftDisplacement < 0) {
|
||||
o->oForwardVel = 0;
|
||||
o->oArrowLiftDisplacement = 0;
|
||||
status = ARROW_LIFT_DONE_MOVING;
|
||||
doneMoving = TRUE;
|
||||
}
|
||||
|
||||
obj_move_xyz_using_fvel_and_yaw(o);
|
||||
return status;
|
||||
return doneMoving;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,7 +71,7 @@ void bhv_arrow_lift_loop(void) {
|
||||
break;
|
||||
|
||||
case ARROW_LIFT_ACT_MOVING_AWAY:
|
||||
if (arrow_lift_move_away() == ARROW_LIFT_DONE_MOVING) {
|
||||
if (arrow_lift_move_away()) {
|
||||
o->oAction = ARROW_LIFT_ACT_MOVING_BACK;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ void bhv_arrow_lift_loop(void) {
|
||||
case ARROW_LIFT_ACT_MOVING_BACK:
|
||||
// Wait 61 frames before moving (after stopping after moving forwards).
|
||||
if (o->oTimer > 60) {
|
||||
if (arrow_lift_move_back() == ARROW_LIFT_DONE_MOVING) {
|
||||
if (arrow_lift_move_back()) {
|
||||
o->oAction = ARROW_LIFT_ACT_IDLE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
// value. The later action functions seem to check Y distance to Mario and proceed
|
||||
// to do nothing, which indicates this behavior set is incomplete.
|
||||
|
||||
// TODO: Rename these. These have nothing to do with birds.
|
||||
void bub_spawner_act_0(void) {
|
||||
s32 i;
|
||||
s32 amt = o->oCheepCheepSpawnerSpawnAmount;
|
||||
if (o->oDistanceToMario < 1500.0f) {
|
||||
for (i = 0; i < amt; i++)
|
||||
for (i = 0; i < amt; i++) {
|
||||
spawn_object(o, MODEL_BUB, bhvBub);
|
||||
}
|
||||
o->oAction = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ static void camera_lakitu_intro_act_trigger_cutscene(void) {
|
||||
*/
|
||||
static void camera_lakitu_intro_act_spawn_cloud(void) {
|
||||
if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_SPEAK) {
|
||||
o->oAction = CAMERA_LAKITU_INTRO_ACT_UNK2;
|
||||
o->oAction = CAMERA_LAKITU_INTRO_ACT_SHOW_DIALOG;
|
||||
|
||||
o->oPosX = 1800.0f;
|
||||
o->oPosY = 2400.0f;
|
||||
@@ -145,7 +145,7 @@ void bhv_camera_lakitu_update(void) {
|
||||
case CAMERA_LAKITU_INTRO_ACT_SPAWN_CLOUD:
|
||||
camera_lakitu_intro_act_spawn_cloud();
|
||||
break;
|
||||
case CAMERA_LAKITU_INTRO_ACT_UNK2:
|
||||
case CAMERA_LAKITU_INTRO_ACT_SHOW_DIALOG:
|
||||
camera_lakitu_intro_act_show_dialog();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -57,19 +57,17 @@ void bhv_coffin_spawner_loop(void) {
|
||||
}
|
||||
|
||||
/**
|
||||
* The main action for the coffins. Coffins with COFFIN_BP_STATIC skip the behavior, while
|
||||
* The main action for the coffins. Coffins with COFFIN_BP_STATIONARY skip the behavior, while
|
||||
* the other coffins will enter a standing action when Mario is near.
|
||||
* Also controls laying the coffin down after it has stood up.
|
||||
*/
|
||||
void coffin_act_idle(void) {
|
||||
f32 yawCos;
|
||||
f32 yawSin;
|
||||
f32 dx;
|
||||
f32 dz;
|
||||
f32 distForwards;
|
||||
f32 distSideways;
|
||||
// f32 yawSin;
|
||||
f32 dx, dz;
|
||||
f32 distForwards, distSideways;
|
||||
|
||||
if (o->oBehParams2ndByte != COFFIN_BP_STATIC) {
|
||||
if (o->oBehParams2ndByte != COFFIN_BP_STATIONARY) {
|
||||
// Lay down if standing
|
||||
if (o->oFaceAnglePitch != 0) {
|
||||
o->oAngleVelPitch = approach_s16_symmetric(o->oAngleVelPitch, -2000, 200);
|
||||
@@ -91,13 +89,13 @@ void coffin_act_idle(void) {
|
||||
} else {
|
||||
// Yaw never changes and is aligned, so yawCos = 1 or -1, yawSin = 0
|
||||
yawCos = coss(o->oFaceAngleYaw);
|
||||
yawSin = sins(o->oFaceAngleYaw);
|
||||
// yawSin = sins(o->oFaceAngleYaw);
|
||||
|
||||
dx = gMarioObject->oPosX - o->oPosX;
|
||||
dz = gMarioObject->oPosZ - o->oPosZ;
|
||||
|
||||
distForwards = dx * yawCos + dz * yawSin;
|
||||
distSideways = dz * yawCos - dx * yawSin;
|
||||
distForwards = dx * yawCos; // + dz * yawSin;
|
||||
distSideways = dz * yawCos; // - dx * yawSin;
|
||||
|
||||
// This checks a box around the coffin and if it has been a bit since it stood up.
|
||||
// It also checks in the case Mario is squished, so he doesn't get permanently squished.
|
||||
|
||||
@@ -433,13 +433,6 @@ static void koopa_unshelled_act_dive(void) {
|
||||
end:;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused action function.
|
||||
*/
|
||||
static void koopa_unshelled_act_unused3(void) {
|
||||
cur_obj_init_anim_extend(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update function for koopa after losing his shell.
|
||||
*/
|
||||
@@ -455,9 +448,9 @@ static void koopa_unshelled_update(void) {
|
||||
case KOOPA_UNSHELLED_ACT_LYING:
|
||||
koopa_unshelled_act_dive();
|
||||
break;
|
||||
case KOOPA_UNSHELLED_ACT_UNUSED3:
|
||||
koopa_unshelled_act_unused3();
|
||||
break;
|
||||
// case KOOPA_UNSHELLED_ACT_UNUSED3:
|
||||
// cur_obj_init_anim_extend(KOOPA_ANIM_SHELLED_UNUSED3);
|
||||
// break;
|
||||
}
|
||||
|
||||
obj_handle_attacks(&sKoopaHitbox, o->oAction, sKoopaUnshelledAttackHandlers);
|
||||
|
||||
@@ -12,12 +12,12 @@ void bhv_purple_switch_loop(void) {
|
||||
* Set the switch's model and scale. If Mario is standing near the
|
||||
* switch's middle section, transition to the pressed state.
|
||||
*/
|
||||
case PURPLE_SWITCH_IDLE:
|
||||
case PURPLE_SWITCH_ACT_IDLE:
|
||||
cur_obj_set_model(MODEL_PURPLE_SWITCH);
|
||||
cur_obj_scale(1.5f);
|
||||
if (gMarioObject->platform == o && !(gMarioStates[0].action & MARIO_NO_PURPLE_SWITCH)) {
|
||||
if (lateral_dist_between_objects(o, gMarioObject) < 127.5f) {
|
||||
o->oAction = PURPLE_SWITCH_PRESSED;
|
||||
o->oAction = PURPLE_SWITCH_ACT_PRESSED;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -25,11 +25,11 @@ void bhv_purple_switch_loop(void) {
|
||||
* Collapse the switch downward, play a sound, and shake the screen.
|
||||
* Immediately transition to the ticking state.
|
||||
*/
|
||||
case PURPLE_SWITCH_PRESSED:
|
||||
case PURPLE_SWITCH_ACT_PRESSED:
|
||||
cur_obj_scale_over_time(2, 3, 1.5f, 0.2f);
|
||||
if (o->oTimer == 3) {
|
||||
cur_obj_play_sound_2(SOUND_GENERAL2_PURPLE_SWITCH);
|
||||
o->oAction = PURPLE_SWITCH_TICKING;
|
||||
o->oAction = PURPLE_SWITCH_ACT_TICKING;
|
||||
cur_obj_shake_screen(SHAKE_POS_SMALL);
|
||||
#if ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
@@ -40,7 +40,7 @@ void bhv_purple_switch_loop(void) {
|
||||
* Play a continuous ticking sound that gets faster when time is almost
|
||||
* up. When time is up, move to a waiting-while-pressed state.
|
||||
*/
|
||||
case PURPLE_SWITCH_TICKING:
|
||||
case PURPLE_SWITCH_ACT_TICKING:
|
||||
if (o->oBehParams2ndByte != 0) {
|
||||
if (o->oBehParams2ndByte == 1 && gMarioObject->platform != o) {
|
||||
o->oAction++;
|
||||
@@ -51,7 +51,7 @@ void bhv_purple_switch_loop(void) {
|
||||
play_sound(SOUND_GENERAL2_SWITCH_TICK_SLOW, gGlobalSoundSource);
|
||||
}
|
||||
if (o->oTimer > 400) {
|
||||
o->oAction = PURPLE_SWITCH_WAIT_FOR_MARIO_TO_GET_OFF;
|
||||
o->oAction = PURPLE_SWITCH_ACT_WAIT_FOR_MARIO_TO_GET_OFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,10 +60,10 @@ void bhv_purple_switch_loop(void) {
|
||||
* Make the switch look unpressed again, and transition back to the
|
||||
* idle state.
|
||||
*/
|
||||
case PURPLE_SWITCH_UNPRESSED:
|
||||
case PURPLE_SWITCH_ACT_UNPRESSED:
|
||||
cur_obj_scale_over_time(2, 3, 0.2f, 1.5f);
|
||||
if (o->oTimer == 3) {
|
||||
o->oAction = PURPLE_SWITCH_IDLE;
|
||||
o->oAction = PURPLE_SWITCH_ACT_IDLE;
|
||||
}
|
||||
break;
|
||||
/**
|
||||
@@ -71,9 +71,9 @@ void bhv_purple_switch_loop(void) {
|
||||
* him to get off the switch, and when he does so, transition to the
|
||||
* unpressed state.
|
||||
*/
|
||||
case PURPLE_SWITCH_WAIT_FOR_MARIO_TO_GET_OFF:
|
||||
case PURPLE_SWITCH_ACT_WAIT_FOR_MARIO_TO_GET_OFF:
|
||||
if (!cur_obj_is_mario_on_platform()) {
|
||||
o->oAction = PURPLE_SWITCH_UNPRESSED;
|
||||
o->oAction = PURPLE_SWITCH_ACT_UNPRESSED;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ void bhv_sl_walking_penguin_loop(void) {
|
||||
|
||||
cur_obj_move_standard(-78);
|
||||
if (!cur_obj_hide_if_mario_far_away_y(1000.0f))
|
||||
play_penguin_walking_sound(PENGUIN_WALK_BIG);
|
||||
play_penguin_walking_sound(PENGUIN_SOUND_WALK_BIG);
|
||||
|
||||
// Adjust the position to get a point better lined up with the visual model, for stopping the wind.
|
||||
// The new point is 60 units behind the penguin and 100 units perpedicularly, away from the snowman.
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
void play_penguin_walking_sound(s32 walk) {
|
||||
s32 sound;
|
||||
if (o->oSoundStateID == 0) {
|
||||
if (walk == PENGUIN_WALK_BABY)
|
||||
if (walk == PENGUIN_SOUND_WALK_BABY) {
|
||||
sound = SOUND_OBJ_BABY_PENGUIN_WALK;
|
||||
else // PENGUIN_WALK_BIG
|
||||
} else { // PENGUIN_SOUND_WALK_BIG
|
||||
sound = SOUND_OBJ_BIG_PENGUIN_WALK;
|
||||
}
|
||||
set_obj_anim_with_accel_and_sound(1, 11, sound);
|
||||
}
|
||||
}
|
||||
@@ -133,7 +134,7 @@ void bhv_tuxies_mother_loop(void) {
|
||||
cur_obj_update_floor_and_walls();
|
||||
cur_obj_call_action_function(sTuxiesMotherActions);
|
||||
cur_obj_move_standard(-78);
|
||||
play_penguin_walking_sound(PENGUIN_WALK_BIG);
|
||||
play_penguin_walking_sound(PENGUIN_SOUND_WALK_BIG);
|
||||
o->oInteractStatus = 0;
|
||||
}
|
||||
|
||||
@@ -244,7 +245,7 @@ void small_penguin_free_actions(void) {
|
||||
cur_obj_update_floor_and_walls();
|
||||
cur_obj_call_action_function(sSmallPenguinActions);
|
||||
cur_obj_move_standard(-78);
|
||||
play_penguin_walking_sound(PENGUIN_WALK_BABY);
|
||||
play_penguin_walking_sound(PENGUIN_SOUND_WALK_BABY);
|
||||
}
|
||||
|
||||
void bhv_small_penguin_loop(void) {
|
||||
|
||||
@@ -72,7 +72,7 @@ void tweester_act_chase(void) {
|
||||
cur_obj_play_sound_1(SOUND_ENV_WIND1);
|
||||
|
||||
if (cur_obj_lateral_dist_from_mario_to_home() < activationRadius
|
||||
&& o->oSubAction == TWEESTER_SUB_ACT_CHASE) {
|
||||
&& o->oSubAction == TWEESTER_SUB_ACT_CHASE_MARIO) {
|
||||
|
||||
o->oForwardVel = 20.0f;
|
||||
cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x200);
|
||||
|
||||
@@ -80,7 +80,7 @@ void spawn_macro_abs_special(s32 model, const BehaviorScript *behavior, s16 x, s
|
||||
|
||||
UNUSED static void spawn_macro_coin_unknown(const BehaviorScript *behavior, s16 a1[]) {
|
||||
struct Object *obj;
|
||||
ModelID model = bhvYellowCoin == behavior ? MODEL_YELLOW_COIN : MODEL_NONE;
|
||||
ModelID16 model = bhvYellowCoin == behavior ? MODEL_YELLOW_COIN : MODEL_NONE;
|
||||
|
||||
obj = spawn_object_abs_with_rot(&gMacroObjectDefaultParent, 0, model, behavior,
|
||||
a1[1], a1[2], a1[3], 0, convert_rotation(a1[0]), 0);
|
||||
@@ -92,7 +92,7 @@ UNUSED static void spawn_macro_coin_unknown(const BehaviorScript *behavior, s16
|
||||
struct LoadedPreset {
|
||||
/*0x00*/ const BehaviorScript *behavior;
|
||||
/*0x04*/ s16 param; // huh? why does the below function swap these.. just use the struct..
|
||||
/*0x06*/ ModelID model;
|
||||
/*0x06*/ ModelID16 model;
|
||||
};
|
||||
|
||||
#define MACRO_OBJ_Y_ROT 0
|
||||
@@ -237,7 +237,7 @@ void spawn_special_objects(s32 areaIndex, TerrainData **specialObjList) {
|
||||
s16 y;
|
||||
s16 z;
|
||||
s16 extraParams[4];
|
||||
ModelID model;
|
||||
ModelID16 model;
|
||||
u8 type;
|
||||
u8 presetID;
|
||||
u8 defaultParam;
|
||||
|
||||
@@ -46,7 +46,7 @@ struct SpawnParticlesInfo
|
||||
{
|
||||
/*0x00*/ s8 behParam;
|
||||
/*0x01*/ s8 count;
|
||||
/*0x02*/ ModelID model;
|
||||
/*0x02*/ ModelID16 model;
|
||||
/*0x03*/ s8 offsetY;
|
||||
/*0x04*/ s8 forwardVelBase;
|
||||
/*0x05*/ s8 forwardVelRange;
|
||||
|
||||
@@ -188,7 +188,7 @@ s8 sObjectListUpdateOrder[] = { OBJ_LIST_SPAWNER,
|
||||
struct ParticleProperties {
|
||||
u32 particleFlag;
|
||||
u32 activeParticleFlag;
|
||||
ModelID model;
|
||||
ModelID16 model;
|
||||
const BehaviorScript *behavior;
|
||||
};
|
||||
|
||||
|
||||
@@ -1069,8 +1069,7 @@ void load_score_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceBut
|
||||
// If the previous button is in default state
|
||||
if (sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT) {
|
||||
// Hide buttons of corresponding button menu groups
|
||||
if (prevMenuButtonID == MENU_BUTTON_SCORE) //! Not possible, this is checking if the score menu was opened from the score menu!
|
||||
{
|
||||
if (prevMenuButtonID == MENU_BUTTON_SCORE) { //! Not possible, this is checking if the score menu was opened from the score menu!
|
||||
for (buttonID = MENU_BUTTON_SCORE_MIN; buttonID < MENU_BUTTON_SCORE_MAX; buttonID++) {
|
||||
obj_mark_for_deletion(sMainMenuButtons[buttonID]);
|
||||
}
|
||||
@@ -1114,8 +1113,7 @@ void load_copy_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceButt
|
||||
obj_mark_for_deletion(sMainMenuButtons[buttonID]);
|
||||
}
|
||||
}
|
||||
if (prevMenuButtonID == MENU_BUTTON_COPY) //! Not possible, this is checking if the copy menu was opened from the copy menu!
|
||||
{
|
||||
if (prevMenuButtonID == MENU_BUTTON_COPY) { //! Not possible, this is checking if the copy menu was opened from the copy menu!
|
||||
for (buttonID = MENU_BUTTON_COPY_MIN; buttonID < MENU_BUTTON_COPY_MAX; buttonID++) {
|
||||
obj_mark_for_deletion(sMainMenuButtons[buttonID]);
|
||||
}
|
||||
@@ -1159,8 +1157,7 @@ void load_erase_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceBut
|
||||
obj_mark_for_deletion(sMainMenuButtons[buttonID]);
|
||||
}
|
||||
}
|
||||
if (prevMenuButtonID == MENU_BUTTON_ERASE) //! Not possible, this is checking if the erase menu was opened from the erase menu!
|
||||
{
|
||||
if (prevMenuButtonID == MENU_BUTTON_ERASE) { //! Not possible, this is checking if the erase menu was opened from the erase menu!
|
||||
for (buttonID = MENU_BUTTON_ERASE_MIN; buttonID < MENU_BUTTON_ERASE_MAX; buttonID++) {
|
||||
obj_mark_for_deletion(sMainMenuButtons[buttonID]);
|
||||
}
|
||||
@@ -1343,115 +1340,54 @@ void check_main_menu_clicked_buttons(void) {
|
||||
*/
|
||||
void bhv_menu_button_manager_loop(void) {
|
||||
switch (sSelectedButtonID) {
|
||||
case MENU_BUTTON_NONE:
|
||||
check_main_menu_clicked_buttons();
|
||||
break;
|
||||
case MENU_BUTTON_PLAY_FILE_A:
|
||||
load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A], 1);
|
||||
break;
|
||||
case MENU_BUTTON_PLAY_FILE_B:
|
||||
load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B], 2);
|
||||
break;
|
||||
case MENU_BUTTON_PLAY_FILE_C:
|
||||
load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_C], 3);
|
||||
break;
|
||||
case MENU_BUTTON_PLAY_FILE_D:
|
||||
load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_D], 4);
|
||||
break;
|
||||
case MENU_BUTTON_SCORE:
|
||||
check_score_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_SCORE]);
|
||||
break;
|
||||
case MENU_BUTTON_COPY:
|
||||
check_copy_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_COPY]);
|
||||
break;
|
||||
case MENU_BUTTON_ERASE:
|
||||
check_erase_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_ERASE]);
|
||||
break;
|
||||
case MENU_BUTTON_NONE: check_main_menu_clicked_buttons(); break;
|
||||
|
||||
case MENU_BUTTON_SCORE_FILE_A:
|
||||
exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A], MENU_BUTTON_SCORE);
|
||||
break;
|
||||
case MENU_BUTTON_SCORE_FILE_B:
|
||||
exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B], MENU_BUTTON_SCORE);
|
||||
break;
|
||||
case MENU_BUTTON_SCORE_FILE_C:
|
||||
exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_C], MENU_BUTTON_SCORE);
|
||||
break;
|
||||
case MENU_BUTTON_SCORE_FILE_D:
|
||||
exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D], MENU_BUTTON_SCORE);
|
||||
break;
|
||||
case MENU_BUTTON_SCORE_RETURN:
|
||||
return_to_main_menu(MENU_BUTTON_SCORE, sMainMenuButtons[MENU_BUTTON_SCORE_RETURN]);
|
||||
break;
|
||||
case MENU_BUTTON_SCORE_COPY_FILE:
|
||||
load_copy_menu_from_submenu(MENU_BUTTON_SCORE,
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_COPY_FILE]);
|
||||
break;
|
||||
case MENU_BUTTON_SCORE_ERASE_FILE:
|
||||
load_erase_menu_from_submenu(MENU_BUTTON_SCORE,
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_ERASE_FILE]);
|
||||
break;
|
||||
case MENU_BUTTON_PLAY_FILE_A: load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A], 1); break;
|
||||
case MENU_BUTTON_PLAY_FILE_B: load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B], 2); break;
|
||||
case MENU_BUTTON_PLAY_FILE_C: load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_C], 3); break;
|
||||
case MENU_BUTTON_PLAY_FILE_D: load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_D], 4); break;
|
||||
|
||||
case MENU_BUTTON_COPY_FILE_A:
|
||||
break;
|
||||
case MENU_BUTTON_COPY_FILE_B:
|
||||
break;
|
||||
case MENU_BUTTON_COPY_FILE_C:
|
||||
break;
|
||||
case MENU_BUTTON_COPY_FILE_D:
|
||||
break;
|
||||
case MENU_BUTTON_COPY_RETURN:
|
||||
return_to_main_menu(MENU_BUTTON_COPY, sMainMenuButtons[MENU_BUTTON_COPY_RETURN]);
|
||||
break;
|
||||
case MENU_BUTTON_COPY_CHECK_SCORE:
|
||||
load_score_menu_from_submenu(MENU_BUTTON_COPY,
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_CHECK_SCORE]);
|
||||
break;
|
||||
case MENU_BUTTON_COPY_ERASE_FILE:
|
||||
load_erase_menu_from_submenu(MENU_BUTTON_COPY,
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_ERASE_FILE]);
|
||||
break;
|
||||
case MENU_BUTTON_SCORE: check_score_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_SCORE]); break;
|
||||
case MENU_BUTTON_COPY: check_copy_menu_clicked_buttons (sMainMenuButtons[MENU_BUTTON_COPY ]); break;
|
||||
case MENU_BUTTON_ERASE: check_erase_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_ERASE]); break;
|
||||
|
||||
case MENU_BUTTON_ERASE_FILE_A:
|
||||
break;
|
||||
case MENU_BUTTON_ERASE_FILE_B:
|
||||
break;
|
||||
case MENU_BUTTON_ERASE_FILE_C:
|
||||
break;
|
||||
case MENU_BUTTON_ERASE_FILE_D:
|
||||
break;
|
||||
case MENU_BUTTON_ERASE_RETURN:
|
||||
return_to_main_menu(MENU_BUTTON_ERASE, sMainMenuButtons[MENU_BUTTON_ERASE_RETURN]);
|
||||
break;
|
||||
case MENU_BUTTON_ERASE_CHECK_SCORE:
|
||||
load_score_menu_from_submenu(MENU_BUTTON_ERASE,
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_CHECK_SCORE]);
|
||||
break;
|
||||
case MENU_BUTTON_ERASE_COPY_FILE:
|
||||
load_copy_menu_from_submenu(MENU_BUTTON_ERASE,
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_COPY_FILE]);
|
||||
break;
|
||||
case MENU_BUTTON_SCORE_FILE_A: exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A], MENU_BUTTON_SCORE); break;
|
||||
case MENU_BUTTON_SCORE_FILE_B: exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B], MENU_BUTTON_SCORE); break;
|
||||
case MENU_BUTTON_SCORE_FILE_C: exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_C], MENU_BUTTON_SCORE); break;
|
||||
case MENU_BUTTON_SCORE_FILE_D: exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D], MENU_BUTTON_SCORE); break;
|
||||
|
||||
case MENU_BUTTON_SOUND_MODE:
|
||||
check_sound_mode_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]);
|
||||
break;
|
||||
case MENU_BUTTON_SCORE_RETURN: return_to_main_menu (MENU_BUTTON_SCORE, sMainMenuButtons[MENU_BUTTON_SCORE_RETURN ]); break;
|
||||
case MENU_BUTTON_SCORE_COPY_FILE: load_copy_menu_from_submenu (MENU_BUTTON_SCORE, sMainMenuButtons[MENU_BUTTON_SCORE_COPY_FILE ]); break;
|
||||
case MENU_BUTTON_SCORE_ERASE_FILE: load_erase_menu_from_submenu(MENU_BUTTON_SCORE, sMainMenuButtons[MENU_BUTTON_SCORE_ERASE_FILE]); break;
|
||||
|
||||
#if MULTILANG
|
||||
case MENU_BUTTON_LANGUAGE_RETURN:
|
||||
return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_LANGUAGE_RETURN]);
|
||||
break;
|
||||
#endif
|
||||
case MENU_BUTTON_COPY_FILE_A: break;
|
||||
case MENU_BUTTON_COPY_FILE_B: break;
|
||||
case MENU_BUTTON_COPY_FILE_C: break;
|
||||
case MENU_BUTTON_COPY_FILE_D: break;
|
||||
|
||||
case MENU_BUTTON_COPY_RETURN: return_to_main_menu (MENU_BUTTON_COPY, sMainMenuButtons[MENU_BUTTON_COPY_RETURN ]); break;
|
||||
case MENU_BUTTON_COPY_CHECK_SCORE: load_score_menu_from_submenu(MENU_BUTTON_COPY, sMainMenuButtons[MENU_BUTTON_COPY_CHECK_SCORE]); break;
|
||||
case MENU_BUTTON_COPY_ERASE_FILE: load_erase_menu_from_submenu(MENU_BUTTON_COPY, sMainMenuButtons[MENU_BUTTON_COPY_ERASE_FILE ]); break;
|
||||
|
||||
case MENU_BUTTON_ERASE_FILE_A: break;
|
||||
case MENU_BUTTON_ERASE_FILE_B: break;
|
||||
case MENU_BUTTON_ERASE_FILE_C: break;
|
||||
case MENU_BUTTON_ERASE_FILE_D: break;
|
||||
|
||||
case MENU_BUTTON_ERASE_RETURN: return_to_main_menu (MENU_BUTTON_ERASE, sMainMenuButtons[MENU_BUTTON_ERASE_RETURN ]); break;
|
||||
case MENU_BUTTON_ERASE_CHECK_SCORE: load_score_menu_from_submenu(MENU_BUTTON_ERASE, sMainMenuButtons[MENU_BUTTON_ERASE_CHECK_SCORE]); break;
|
||||
case MENU_BUTTON_ERASE_COPY_FILE: load_copy_menu_from_submenu (MENU_BUTTON_ERASE, sMainMenuButtons[MENU_BUTTON_ERASE_COPY_FILE ]); break;
|
||||
|
||||
case MENU_BUTTON_SOUND_MODE: check_sound_mode_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]); break;
|
||||
|
||||
#if MULTILANG
|
||||
case MENU_BUTTON_LANGUAGE_RETURN: return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_LANGUAGE_RETURN]); break;
|
||||
#endif
|
||||
// STEREO, MONO and HEADSET buttons are undefined so they can be selected without
|
||||
// exiting the Options menu, as a result they added a return button
|
||||
case MENU_BUTTON_STEREO:
|
||||
return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_STEREO]);
|
||||
break;
|
||||
case MENU_BUTTON_MONO:
|
||||
return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_MONO]);
|
||||
break;
|
||||
case MENU_BUTTON_HEADSET:
|
||||
return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_HEADSET]);
|
||||
break;
|
||||
case MENU_BUTTON_STEREO: return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_STEREO ]); break;
|
||||
case MENU_BUTTON_MONO: return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_MONO ]); break;
|
||||
case MENU_BUTTON_HEADSET: return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_HEADSET]); break;
|
||||
}
|
||||
|
||||
sClickPos[0] = -10000;
|
||||
@@ -1494,12 +1430,8 @@ void handle_controller_cursor_input(void) {
|
||||
s16 rawStickY = gPlayer3Controller->rawStickY;
|
||||
|
||||
// Handle deadzone
|
||||
if (rawStickY > -2 && rawStickY < 2) {
|
||||
rawStickY = 0;
|
||||
}
|
||||
if (rawStickX > -2 && rawStickX < 2) {
|
||||
rawStickX = 0;
|
||||
}
|
||||
if (rawStickY > -2 && rawStickY < 2) rawStickY = 0;
|
||||
if (rawStickX > -2 && rawStickX < 2) rawStickX = 0;
|
||||
|
||||
// Move cursor
|
||||
sCursorPos[0] += rawStickX / 8;
|
||||
@@ -1595,10 +1527,9 @@ s32 update_text_fade_out(void) {
|
||||
void print_save_file_star_count(s8 fileIndex, s16 x, s16 y) {
|
||||
u8 starCountText[4];
|
||||
s8 offset = 0;
|
||||
s16 starCount;
|
||||
|
||||
if (save_file_exists(fileIndex) == TRUE) {
|
||||
starCount = save_file_get_total_star_count(fileIndex, COURSE_MIN - 1, COURSE_MAX - 1);
|
||||
s16 starCount = save_file_get_total_star_count(fileIndex, COURSE_MIN - 1, COURSE_MAX - 1);
|
||||
// Print star icon
|
||||
print_hud_lut_string(HUD_LUT_GLOBAL, x, y, starIcon);
|
||||
// If star count is less than 100, print x icon and move
|
||||
@@ -1617,13 +1548,13 @@ void print_save_file_star_count(s8 fileIndex, s16 x, s16 y) {
|
||||
}
|
||||
|
||||
#define SELECT_FILE_X 93
|
||||
#define SCORE_X 52
|
||||
#define COPY_X 117
|
||||
#define ERASE_X 177
|
||||
#define SCORE_X 52
|
||||
#define COPY_X 117
|
||||
#define ERASE_X 177
|
||||
#define SOUNDMODE_X1 sSoundTextX
|
||||
#define SAVEFILE_X1 92
|
||||
#define SAVEFILE_X2 209
|
||||
#define MARIOTEXT_X1 92
|
||||
#define SAVEFILE_X1 92
|
||||
#define SAVEFILE_X2 209
|
||||
#define MARIOTEXT_X1 92
|
||||
#define MARIOTEXT_X2 207
|
||||
|
||||
/**
|
||||
@@ -2096,7 +2027,7 @@ void print_sound_mode_menu_strings(void) {
|
||||
SOUND_HUD_Y, LANGUAGE_ARRAY(textSoundModes[mode]));
|
||||
}
|
||||
|
||||
#if MULTILANG
|
||||
#if MULTILANG
|
||||
// In EU, print language mode names
|
||||
for (mode = 0, textX = 90; mode < 3; textX += 70, mode++) {
|
||||
if (mode == LANGUAGE_FUNCTION) {
|
||||
@@ -2111,7 +2042,7 @@ void print_sound_mode_menu_strings(void) {
|
||||
|
||||
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha);
|
||||
print_generic_string(182, 29, LANGUAGE_ARRAY(textReturn));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, dl_ia_text_end);
|
||||
}
|
||||
@@ -2126,8 +2057,7 @@ void print_score_file_castle_secret_stars(s8 fileIndex, s16 x, s16 y) {
|
||||
// Print "[star] x"
|
||||
print_menu_generic_string(x, y, textStarX);
|
||||
// Print number of castle secret stars
|
||||
int_to_str(save_file_get_total_star_count(fileIndex, COURSE_BONUS_STAGES - 1, COURSE_MAX - 1),
|
||||
secretStarsText);
|
||||
int_to_str(save_file_get_total_star_count(fileIndex, COURSE_BONUS_STAGES - 1, COURSE_MAX - 1), secretStarsText);
|
||||
print_menu_generic_string(x + 16, y, secretStarsText);
|
||||
}
|
||||
|
||||
@@ -2195,24 +2125,25 @@ void print_score_file_star_score(s8 fileIndex, s16 courseIndex, s16 x, s16 y) {
|
||||
print_menu_generic_string(x, y, starScoreText);
|
||||
}
|
||||
|
||||
#define MARIO_X 25
|
||||
#define FILE_LETTER_X 95
|
||||
#define LEVEL_NUM_PAD 3
|
||||
#define MARIO_X 25
|
||||
#define FILE_LETTER_X 95
|
||||
#define LEVEL_NUM_PAD 3
|
||||
#define SECRET_STARS_PAD 6
|
||||
#define LEVEL_NAME_X 23
|
||||
#define STAR_SCORE_X 171
|
||||
#define MYSCORE_X 238
|
||||
#define HISCORE_X 231
|
||||
#define LEVEL_NAME_X 23
|
||||
#define STAR_SCORE_X 171
|
||||
#define MYSCORE_X 238
|
||||
#define HISCORE_X 231
|
||||
|
||||
|
||||
/**
|
||||
* Prints save file score strings that shows when a save file is chosen inside the score menu.
|
||||
*/
|
||||
void print_save_file_scores(s8 fileIndex) {
|
||||
unsigned char textMario[] = { TEXT_MARIO };
|
||||
unsigned char textHiScore[] = { TEXT_HI_SCORE };
|
||||
unsigned char textMyScore[] = { TEXT_MY_SCORE };
|
||||
unsigned char textFileLetter[] = { TEXT_ZERO };
|
||||
u32 i;
|
||||
unsigned char textMario[] = { TEXT_MARIO };
|
||||
unsigned char textHiScore[] = { TEXT_HI_SCORE };
|
||||
unsigned char textMyScore[] = { TEXT_MY_SCORE };
|
||||
unsigned char textFileLetter[] = { TEXT_ZERO };
|
||||
void **levelNameTable = segmented_to_virtual(languageTable[gInGameLanguage][1]);
|
||||
|
||||
textFileLetter[0] = fileIndex + ASCII_TO_DIALOG('A'); // get letter of file selected
|
||||
@@ -2230,31 +2161,11 @@ void print_save_file_scores(s8 fileIndex) {
|
||||
gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_begin);
|
||||
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha);
|
||||
|
||||
//! Huge print list, for loops exist for a reason!
|
||||
#define PRINT_COURSE_SCORES(courseIndex, pad) \
|
||||
print_menu_generic_string(LEVEL_NAME_X + (pad * LEVEL_NUM_PAD), 23 + 12 * courseIndex, \
|
||||
segmented_to_virtual(levelNameTable[courseIndex - 1])); \
|
||||
print_score_file_star_score(fileIndex, courseIndex - 1, STAR_SCORE_X, 23 + 12 * courseIndex); \
|
||||
print_score_file_course_coin_score(fileIndex, courseIndex - 1, 213, 23 + 12 * courseIndex);
|
||||
|
||||
// Course values are indexed, from Bob-omb Battlefield to Rainbow Ride
|
||||
PRINT_COURSE_SCORES(COURSE_BOB, 1)
|
||||
PRINT_COURSE_SCORES(COURSE_WF, 1)
|
||||
PRINT_COURSE_SCORES(COURSE_JRB, 1)
|
||||
PRINT_COURSE_SCORES(COURSE_CCM, 1)
|
||||
PRINT_COURSE_SCORES(COURSE_BBH, 1)
|
||||
PRINT_COURSE_SCORES(COURSE_HMC, 1)
|
||||
PRINT_COURSE_SCORES(COURSE_LLL, 1)
|
||||
PRINT_COURSE_SCORES(COURSE_SSL, 1)
|
||||
PRINT_COURSE_SCORES(COURSE_DDD, 1)
|
||||
PRINT_COURSE_SCORES(COURSE_SL, 0)
|
||||
PRINT_COURSE_SCORES(COURSE_WDW, 0)
|
||||
PRINT_COURSE_SCORES(COURSE_TTM, 0)
|
||||
PRINT_COURSE_SCORES(COURSE_THI, 0)
|
||||
PRINT_COURSE_SCORES(COURSE_TTC, 0)
|
||||
PRINT_COURSE_SCORES(COURSE_RR, 0)
|
||||
|
||||
#undef PRINT_COURSE_SCORES
|
||||
for ((i = 0); (i < COURSE_STAGES_MAX); (i++)) {
|
||||
print_menu_generic_string((LEVEL_NAME_X + ((i < 9) * LEVEL_NUM_PAD)), (23 + (12 * (i + 1))), segmented_to_virtual(levelNameTable[i]));
|
||||
print_score_file_star_score( fileIndex, i, STAR_SCORE_X, (23 + (12 * (i + 1))));
|
||||
print_score_file_course_coin_score( fileIndex, i, 213, (23 + (12 * (i + 1))));
|
||||
}
|
||||
|
||||
// Print castle secret stars text
|
||||
print_menu_generic_string(LEVEL_NAME_X + SECRET_STARS_PAD, 23 + 12 * 16,
|
||||
@@ -2278,38 +2189,19 @@ void print_save_file_scores(s8 fileIndex) {
|
||||
void print_file_select_strings(void) {
|
||||
create_dl_ortho_matrix();
|
||||
switch (sSelectedButtonID) {
|
||||
case MENU_BUTTON_NONE:
|
||||
print_main_menu_strings();
|
||||
break;
|
||||
case MENU_BUTTON_SCORE:
|
||||
print_score_menu_strings();
|
||||
sScoreFileCoinScoreMode = 0;
|
||||
break;
|
||||
case MENU_BUTTON_COPY:
|
||||
print_copy_menu_strings();
|
||||
break;
|
||||
case MENU_BUTTON_ERASE:
|
||||
print_erase_menu_strings();
|
||||
break;
|
||||
case MENU_BUTTON_SCORE_FILE_A:
|
||||
print_save_file_scores(SAVE_FILE_A);
|
||||
break;
|
||||
case MENU_BUTTON_SCORE_FILE_B:
|
||||
print_save_file_scores(SAVE_FILE_B);
|
||||
break;
|
||||
case MENU_BUTTON_SCORE_FILE_C:
|
||||
print_save_file_scores(SAVE_FILE_C);
|
||||
break;
|
||||
case MENU_BUTTON_SCORE_FILE_D:
|
||||
print_save_file_scores(SAVE_FILE_D);
|
||||
break;
|
||||
case MENU_BUTTON_SOUND_MODE:
|
||||
print_sound_mode_menu_strings();
|
||||
break;
|
||||
case MENU_BUTTON_NONE: print_main_menu_strings(); break;
|
||||
case MENU_BUTTON_SCORE: print_score_menu_strings(); sScoreFileCoinScoreMode = 0; break;
|
||||
case MENU_BUTTON_COPY: print_copy_menu_strings(); break;
|
||||
case MENU_BUTTON_ERASE: print_erase_menu_strings(); break;
|
||||
case MENU_BUTTON_SCORE_FILE_A: print_save_file_scores(SAVE_FILE_A); break;
|
||||
case MENU_BUTTON_SCORE_FILE_B: print_save_file_scores(SAVE_FILE_B); break;
|
||||
case MENU_BUTTON_SCORE_FILE_C: print_save_file_scores(SAVE_FILE_C); break;
|
||||
case MENU_BUTTON_SCORE_FILE_D: print_save_file_scores(SAVE_FILE_D); break;
|
||||
case MENU_BUTTON_SOUND_MODE: print_sound_mode_menu_strings(); break;
|
||||
}
|
||||
// If all 4 save file exists, define true to sAllFilesExist to prevent more copies in copy menu
|
||||
if (save_file_exists(SAVE_FILE_A) == TRUE && save_file_exists(SAVE_FILE_B) == TRUE &&
|
||||
save_file_exists(SAVE_FILE_C) == TRUE && save_file_exists(SAVE_FILE_D) == TRUE) {
|
||||
if (save_file_exists(SAVE_FILE_A) && save_file_exists(SAVE_FILE_B) &&
|
||||
save_file_exists(SAVE_FILE_C) && save_file_exists(SAVE_FILE_D)) {
|
||||
sAllFilesExist = TRUE;
|
||||
} else {
|
||||
sAllFilesExist = FALSE;
|
||||
@@ -2342,39 +2234,27 @@ Gfx *geo_file_select_strings_and_menu_cursor(s32 callContext, UNUSED struct Grap
|
||||
s32 lvl_init_menu_values_and_cursor_pos(UNUSED s32 arg, UNUSED s32 unused) {
|
||||
sSelectedButtonID = MENU_BUTTON_NONE;
|
||||
sCurrentMenuLevel = MENU_LAYER_MAIN;
|
||||
sTextBaseAlpha = 0;
|
||||
sTextBaseAlpha = 0;
|
||||
// Place the cursor over the save file that was being played.
|
||||
// gCurrSaveFileNum is 1 by default when the game boots, as such
|
||||
// the cursor will point on Mario A save file.
|
||||
switch (gCurrSaveFileNum) {
|
||||
case 1: // File A
|
||||
sCursorPos[0] = -94.0f;
|
||||
sCursorPos[1] = 46.0f;
|
||||
break;
|
||||
case 2: // File B
|
||||
sCursorPos[0] = 24.0f;
|
||||
sCursorPos[1] = 46.0f;
|
||||
break;
|
||||
case 3: // File C
|
||||
sCursorPos[0] = -94.0f;
|
||||
sCursorPos[1] = 5.0f;
|
||||
break;
|
||||
case 4: // File D
|
||||
sCursorPos[0] = 24.0f;
|
||||
sCursorPos[1] = 5.0f;
|
||||
break;
|
||||
case SAVE_FILE_NUM_A: sCursorPos[0] = -94.0f; sCursorPos[1] = 46.0f; break;
|
||||
case SAVE_FILE_NUM_B: sCursorPos[0] = 24.0f; sCursorPos[1] = 46.0f; break;
|
||||
case SAVE_FILE_NUM_C: sCursorPos[0] = -94.0f; sCursorPos[1] = 5.0f; break;
|
||||
case SAVE_FILE_NUM_D: sCursorPos[0] = 24.0f; sCursorPos[1] = 5.0f; break;
|
||||
}
|
||||
sClickPos[0] = -10000;
|
||||
sClickPos[1] = -10000;
|
||||
sCursorClickingTimer = 0;
|
||||
sSelectedFileNum = 0;
|
||||
sSelectedFileIndex = MENU_BUTTON_NONE;
|
||||
sFadeOutText = FALSE;
|
||||
sStatusMessageID = 0;
|
||||
sTextFadeAlpha = 0;
|
||||
sMainMenuTimer = 0;
|
||||
sClickPos[0] = -10000;
|
||||
sClickPos[1] = -10000;
|
||||
sCursorClickingTimer = 0;
|
||||
sSelectedFileNum = 0;
|
||||
sSelectedFileIndex = MENU_BUTTON_NONE;
|
||||
sFadeOutText = FALSE;
|
||||
sStatusMessageID = 0;
|
||||
sTextFadeAlpha = 0;
|
||||
sMainMenuTimer = 0;
|
||||
sEraseYesNoHoverState = MENU_ERASE_HOVER_NONE;
|
||||
sSoundMode = save_file_get_sound_mode();
|
||||
sSoundMode = save_file_get_sound_mode();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user