Revert Time Trials 2.1

The new speedrun button on the file select screen breaks the copy and erase save functions
This commit is contained in:
$4Y$ 2020-09-19 01:06:12 -05:00
parent 0f2d1051f1
commit bdf9043419
16 changed files with 6 additions and 3652 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

View file

@ -194,10 +194,6 @@ ALIGNED8 static const u8 texture_hud_char_ampersand[] = {
ALIGNED8 static const u8 texture_hud_char_percent[] = {
#include "textures/segment2/segment2.05400.rgba16.inc.c"// JP %
};
#elif defined(VERSION_US)
ALIGNED8 static const u8 texture_hud_char_dot[] = {
#include "textures/segment2/segment2.custom.rgba16.inc.c"
};
#endif
ALIGNED8 static const u8 texture_hud_char_multiply[] = {
@ -1836,7 +1832,7 @@ const u8 *const main_hud_lut[] = {
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, texture_hud_char_multiply, texture_hud_char_coin,
texture_hud_char_mario_head, texture_hud_char_star, 0x0, texture_hud_char_dot,
texture_hud_char_mario_head, texture_hud_char_star, 0x0, 0x0,
texture_hud_char_apostrophe, texture_hud_char_double_quote,
#else
texture_hud_char_0, texture_hud_char_1, texture_hud_char_2, texture_hud_char_3,

View file

@ -1,34 +0,0 @@
# Dynamic Options System aka DynOS v0.2
# By PeachyPeach
#
# This is a comment
# Here are the available commands:
# ID [Id] - Mandatory, must be placed in first
# TITLE [Name] - Mandatory
# TOGGLE [Name] [InitialValue]
# SCROLL [Name] [InitialValue] [Min] [Max] [Step]
# CHOICE [Name] [InitialValue] [ChoiceStrings...]
# BUTTON [Name] [FuncName]
# BIND [Name] [Key] [Mask] [DefaultValues]
#
# Valid characters:
# 0-9 A-Z a-z
# '".:,-?!/
# ^ | < > [A] [B] [C] [Z] [R] for buttons
# * for the x (multiply) glyph
# @ for coin glyph
# + for filled star glyph
# _ for empty star glyph
#
ID "TimeTrials"
TITLE "TIME TRIALS"
TOGGLE "Time Trials" 1
CHOICE "Time Trial Ghost" 1 "Hide" "Show"
CHOICE "Main Courses Ghost" 0 "Selected Act Star" "100 Coins Star"
CHOICE "Bowser Courses Ghost" 0 "Bowser Fight" "Red Coins Star"
CHOICE "PSS Ghost" 0 "Star 1" "Star 2"
TOGGLE "100 Coins Star Exit" 0
TOGGLE "Time Trials with Cheats" 0
BUTTON "Restart Level" "time_trials_restart_level"

View file

@ -155,7 +155,4 @@ void play_transition(s16 transType, s16 time, u8 red, u8 green, u8 blue);
void play_transition_after_delay(s16 transType, s16 time, u8 red, u8 green, u8 blue, s16 delay);
void render_game(void);
/* Time Trials */
#include "time_trials.h"
#endif // AREA_H

View file

@ -2728,13 +2728,9 @@ s16 render_pause_courses_and_castle(void) {
break;
case DIALOG_STATE_HORIZONTAL:
shade_screen();
if (TIME_TRIALS == 1) {
time_trials_render_pause_castle_main_strings(gCurrSaveFileNum - 1, &gDialogLineNum);
} else {
print_hud_pause_colorful_str();
render_pause_castle_menu_box(160, 143);
render_pause_castle_main_strings(104, 60);
}
print_hud_pause_colorful_str();
render_pause_castle_menu_box(160, 143);
render_pause_castle_main_strings(104, 60);
#ifdef VERSION_EU
if (gPlayer3Controller->buttonPressed & (A_BUTTON | Z_TRIG | START_BUTTON))
@ -2937,11 +2933,7 @@ void render_course_complete_lvl_info_and_hud_str(void) {
play_star_fanfare_and_flash_hud(1, 1 << (gLastCompletedStarNum - 1));
if (gLastCompletedStarNum == 7) {
if (TIME_TRIALS_100_COINS_STAR_EXIT == 1) {
name = gTimeTrialsText100CoinsStar;
} else {
name = segmented_to_virtual(actNameTbl[COURSE_STAGES_MAX * 6 + 1]);
}
name = segmented_to_virtual(actNameTbl[COURSE_STAGES_MAX * 6 + 1]);
} else {
name = segmented_to_virtual(actNameTbl[(gLastCompletedCourseNum - 1) * 6 + gLastCompletedStarNum - 1]);
}
@ -3144,7 +3136,6 @@ s16 render_menus_and_dialogs() {
s16 mode = 0;
create_dl_ortho_matrix();
time_trials_render_hud_timer();
if (gMenuMode != -1) {
switch (gMenuMode) {

View file

@ -116,8 +116,6 @@ extern s8 gRedCoinsCollected;
void create_dl_identity_matrix(void);
void create_dl_translation_matrix(s8 pushOp, f32 x, f32 y, f32 z);
void create_dl_rotation_matrix(s8 pushOp, f32 a, f32 x, f32 y, f32 z);
void create_dl_scale_matrix(s8 pushOp, f32 x, f32 y, f32 z);
void create_dl_ortho_matrix(void);
void print_generic_string(s16 x, s16 y, const u8 *str);
void print_hud_lut_string(s8 hudLUT, s16 x, s16 y, const u8 *str);

View file

@ -822,19 +822,7 @@ u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct O
// func_802521A0
#endif
// Time Trials
if (TIME_TRIALS_100_COINS_STAR_EXIT == 1 && starIndex == 6) {
drop_queued_background_music();
fadeout_level_music(126);
noExit = FALSE;
}
time_trials_save_time(gCurrSaveFileNum - 1, gCurrCourseNum, gCurrLevelNum, starIndex, noExit);
if (!noExit || grandStar) {
time_trials_stop_timer();
}
if (grandStar) {
time_trials_speedrun_end();
return set_mario_action(m, ACT_JUMBO_STAR_CUTSCENE, 0);
}

View file

@ -981,7 +981,6 @@ s32 play_mode_normal(void) {
}
area_update_objects();
time_trials_update_timer(gMarioState); // Mario is updated, we can safely record his position for TT ghost data
update_hud_values();
if (gCurrentArea != NULL) {
@ -1223,7 +1222,6 @@ s32 init_level(void) {
sound_banks_disable(2, 0x0330);
}
time_trials_start_timer(gMarioState, gCurrSaveFileNum - 1, gCurrCourseNum, gCurrActNum - 1, FALSE);
return 1;
}

View file

@ -404,7 +404,6 @@ void save_file_load_all(void) {
bzero(&gSaveBuffer, sizeof(gSaveBuffer));
time_trials_init_times();
#ifdef TEXTSAVES
for (file = 0; file < NUM_SAVE_FILES; file++) {
read_text_save(file);
@ -468,7 +467,6 @@ void save_file_reload(void) {
gMainMenuDataModified = FALSE;
gSaveFileModified = FALSE;
time_trials_speedrun_deinit();
}
/**

File diff suppressed because it is too large Load diff

View file

@ -1,59 +0,0 @@
#ifndef TIME_TRIALS_H
#define TIME_TRIALS_H
#include "types.h"
s16 time_trials_get_time(s32 fileIndex, s32 course, s32 star);
s32 time_trials_get_course_time(s32 fileIndex, s32 course);
s32 time_trials_get_bowser_time(s32 fileIndex);
s32 time_trials_get_secret_time(s32 fileIndex);
s32 time_trials_get_total_time(s32 fileIndex);
void time_trials_init_times();
void time_trials_save_time(s32 fileIndex, s32 course, s32 level, s32 star, s32 noExit);
void time_trials_start_timer(struct MarioState *m, s32 fileIndex, s32 course, s32 star, s32 forceRestart);
void time_trials_update_timer(struct MarioState *m);
void time_trials_stop_timer();
void time_trials_speedrun_init();
void time_trials_speedrun_end();
void time_trials_speedrun_deinit();
s32 time_trials_speedrun_is_started();
void time_trials_render_pause_castle_main_strings(s32 fileIndex, s8 *index);
void time_trials_render_hud_timer();
void time_trials_render_star_select_time(s32 fileIndex, s32 course, s32 star);
/* Constants */
extern const u8 gTimeTrialsText100CoinsStar[];
extern const u8 gTimeTrialsTextSpeedrun[];
#define TIME_TRIALS_MAX_ALLOWED_TIME 17999 // 9'59"99
#define TIME_TRIALS_UNDEFINED_TIME -1
#define TIME_TRIALS_SPEEDRUN_TIMER_START 180 // 6 seconds, average time between power on and file selection
#define TIME_TRIALS_SPEEDRUN_MAX_TIME 1079999 // 9:59:59.99
#define TIME_TRIALS_SPEEDRUN time_trials_speedrun_is_started()
#define MODEL_COSMIC_MARIO 0xFF
/* Options */
#ifdef DYNOS
#include "pc/dynamic_options.h"
#define TIME_TRIALS_ID "TimeTrials"
#define TIME_TRIALS (TIME_TRIALS_SPEEDRUN ? 0 : dynos_get_value(TIME_TRIALS_ID, 0))
#define TIME_TRIALS_GHOST (TIME_TRIALS_SPEEDRUN ? 0 : dynos_get_value(TIME_TRIALS_ID, 1))
#define TIME_TRIALS_MAIN_COURSE_STAR (TIME_TRIALS_SPEEDRUN ? 0 : dynos_get_value(TIME_TRIALS_ID, 2))
#define TIME_TRIALS_BOWSER_STAR (TIME_TRIALS_SPEEDRUN ? 0 : dynos_get_value(TIME_TRIALS_ID, 3))
#define TIME_TRIALS_PSS_STAR (TIME_TRIALS_SPEEDRUN ? 0 : dynos_get_value(TIME_TRIALS_ID, 4))
#define TIME_TRIALS_100_COINS_STAR_EXIT (TIME_TRIALS_SPEEDRUN ? 0 : dynos_get_value(TIME_TRIALS_ID, 5))
#define TIME_TRIALS_CHEATS_ENABLED (TIME_TRIALS_SPEEDRUN ? 0 : dynos_get_value(TIME_TRIALS_ID, 6))
#else
#define TIME_TRIALS (TIME_TRIALS_SPEEDRUN ? 0 : 1)
#define TIME_TRIALS_GHOST (TIME_TRIALS_SPEEDRUN ? 0 : 1)
#define TIME_TRIALS_MAIN_COURSE_STAR 0
#define TIME_TRIALS_BOWSER_STAR 0
#define TIME_TRIALS_PSS_STAR 0
#define TIME_TRIALS_100_COINS_STAR_EXIT 0
#define TIME_TRIALS_CHEATS_ENABLED 0
#endif
#endif // TIME_TRIALS_H

View file

@ -1,118 +0,0 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "time_trials.h"
#include "sm64.h"
#include "ingame_menu.h"
#include "level_update.h"
#include "object_list_processor.h"
#include "options_menu.h"
#include "engine/level_script.h"
#include "audio/external.h"
#include "sound_init.h"
#include "levels/bob/header.h"
#include "levels/wf/header.h"
#include "levels/jrb/header.h"
#include "levels/ccm/header.h"
#include "levels/bbh/header.h"
#include "levels/hmc/header.h"
#include "levels/lll/header.h"
#include "levels/ssl/header.h"
#include "levels/ddd/header.h"
#include "levels/sl/header.h"
#include "levels/wdw/header.h"
#include "levels/ttm/header.h"
#include "levels/thi/header.h"
#include "levels/ttc/header.h"
#include "levels/rr/header.h"
#include "levels/bitdw/header.h"
#include "levels/bitfs/header.h"
#include "levels/bits/header.h"
#include "levels/totwc/header.h"
#include "levels/vcutm/header.h"
#include "levels/cotmc/header.h"
#include "levels/pss/header.h"
#include "levels/sa/header.h"
#include "levels/wmotr/header.h"
#ifdef __cplusplus
}
#endif
#ifdef DYNOS
static const LevelScript *get_level_script(s16 *level) {
const LevelScript *levelScript = NULL;
switch (*level) {
case LEVEL_BOB: levelScript = level_bob_entry; *level = LEVEL_BOB; break;
case LEVEL_WF: levelScript = level_wf_entry; *level = LEVEL_WF; break;
case LEVEL_JRB: levelScript = level_jrb_entry; *level = LEVEL_JRB; break;
case LEVEL_CCM: levelScript = level_ccm_entry; *level = LEVEL_CCM; break;
case LEVEL_BBH: levelScript = level_bbh_entry; *level = LEVEL_BBH; break;
case LEVEL_HMC: levelScript = level_hmc_entry; *level = LEVEL_HMC; break;
case LEVEL_LLL: levelScript = level_lll_entry; *level = LEVEL_LLL; break;
case LEVEL_SSL: levelScript = level_ssl_entry; *level = LEVEL_SSL; break;
case LEVEL_DDD: levelScript = level_ddd_entry; *level = LEVEL_DDD; break;
case LEVEL_SL: levelScript = level_sl_entry; *level = LEVEL_SL; break;
case LEVEL_WDW: levelScript = level_wdw_entry; *level = LEVEL_WDW; break;
case LEVEL_TTM: levelScript = level_ttm_entry; *level = LEVEL_TTM; break;
case LEVEL_THI: levelScript = level_thi_entry; *level = LEVEL_THI; break;
case LEVEL_TTC: levelScript = level_ttc_entry; *level = LEVEL_TTC; break;
case LEVEL_RR: levelScript = level_rr_entry; *level = LEVEL_RR; break;
case LEVEL_BITDW: levelScript = level_bitdw_entry; *level = LEVEL_BITDW; break;
case LEVEL_BOWSER_1: levelScript = level_bitdw_entry; *level = LEVEL_BITDW; break;
case LEVEL_BITFS: levelScript = level_bitfs_entry; *level = LEVEL_BITFS; break;
case LEVEL_BOWSER_2: levelScript = level_bitfs_entry; *level = LEVEL_BITFS; break;
case LEVEL_BITS: levelScript = level_bits_entry; *level = LEVEL_BITS; break;
case LEVEL_BOWSER_3: levelScript = level_bits_entry; *level = LEVEL_BITS; break;
case LEVEL_TOTWC: levelScript = level_totwc_entry; *level = LEVEL_TOTWC; break;
case LEVEL_VCUTM: levelScript = level_vcutm_entry; *level = LEVEL_VCUTM; break;
case LEVEL_COTMC: levelScript = level_cotmc_entry; *level = LEVEL_COTMC; break;
case LEVEL_PSS: levelScript = level_pss_entry; *level = LEVEL_PSS; break;
case LEVEL_SA: levelScript = level_sa_entry; *level = LEVEL_SA; break;
case LEVEL_WMOTR: levelScript = level_wmotr_entry; *level = LEVEL_WMOTR; break;
}
return levelScript;
}
static void time_trials_restart_level(UNUSED struct Option *opt, s32 arg) {
if (!arg) {
const LevelScript *levelScript = get_level_script(&gCurrLevelNum);
if (levelScript == NULL) {
return;
}
// Free everything from the level
time_trials_stop_timer();
optmenu_toggle();
unpause_game();
set_sound_disabled(FALSE);
play_shell_music();
stop_shell_music();
stop_cap_music();
clear_objects();
clear_area_graph_nodes();
clear_areas();
main_pool_pop_state();
// Reload the level
level_script_execute((LevelCommand *) levelScript);
sWarpDest.type = 2;
sWarpDest.levelNum = gCurrLevelNum;
sWarpDest.areaIdx = 1;
sWarpDest.arg = 0;
gSavedCourseNum = gCurrLevelNum;
time_trials_start_timer(gMarioState, gCurrSaveFileNum - 1, gCurrCourseNum, gCurrActNum - 1, TRUE);
// Reset Mario's state
gMarioState->healCounter = 0;
gMarioState->hurtCounter = 0;
gMarioState->numCoins = 0;
gHudDisplay.coins = 0;
}
}
DYNOS_DEFINE_ACTION(time_trials_restart_level);
#endif

File diff suppressed because it is too large Load diff

View file

@ -739,11 +739,9 @@ void render_copy_menu_buttons(struct Object *copyButton) {
copyButton, MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, bhvMenuButton, 711, -388, -100, 0, -0x8000, 0);
sMainMenuButtons[MENU_BUTTON_COPY_RETURN]->oMenuButtonScale = 0.11111111f;
// Switch to scire menu button
/*
sMainMenuButtons[MENU_BUTTON_COPY_CHECK_SCORE] = spawn_object_rel_with_rot(
copyButton, MODEL_MAIN_MENU_GREEN_SCORE_BUTTON, bhvMenuButton, 0, -388, -100, 0, -0x8000, 0);
sMainMenuButtons[MENU_BUTTON_COPY_CHECK_SCORE]->oMenuButtonScale = 0.11111111f;
*/
// Switch to erase menu button
sMainMenuButtons[MENU_BUTTON_COPY_ERASE_FILE] = spawn_object_rel_with_rot(
copyButton, MODEL_MAIN_MENU_RED_ERASE_BUTTON, bhvMenuButton, -711, -388, -100, 0, -0x8000, 0);
@ -917,11 +915,9 @@ void render_erase_menu_buttons(struct Object *eraseButton) {
eraseButton, MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, bhvMenuButton, 711, -388, -100, 0, -0x8000, 0);
sMainMenuButtons[MENU_BUTTON_ERASE_RETURN]->oMenuButtonScale = 0.11111111f;
// Switch to score menu button
/*
sMainMenuButtons[MENU_BUTTON_ERASE_CHECK_SCORE] = spawn_object_rel_with_rot(
eraseButton, MODEL_MAIN_MENU_GREEN_SCORE_BUTTON, bhvMenuButton, 0, -388, -100, 0, -0x8000, 0);
sMainMenuButtons[MENU_BUTTON_ERASE_CHECK_SCORE]->oMenuButtonScale = 0.11111111f;
*/
// Switch to copy menu button
sMainMenuButtons[MENU_BUTTON_ERASE_COPY_FILE] = spawn_object_rel_with_rot(
eraseButton, MODEL_MAIN_MENU_BLUE_COPY_BUTTON, bhvMenuButton, -711, -388, -100, 0, -0x8000, 0);
@ -1418,8 +1414,6 @@ void check_main_menu_clicked_buttons(void) {
break;
// Play sound of the button clicked and render buttons of that menu.
case MENU_BUTTON_SCORE:
play_sound(SAVE_FILE_SOUND, gDefaultSoundArgs);
break;
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
render_score_menu_buttons(sMainMenuButtons[MENU_BUTTON_SCORE]);
break;
@ -1466,9 +1460,6 @@ void bhv_menu_button_manager_loop(void) {
load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_D], 4);
break;
case MENU_BUTTON_SCORE:
load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_SCORE], 4);
time_trials_speedrun_init();
break;
check_score_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_SCORE]);
break;
case MENU_BUTTON_COPY:
@ -1791,7 +1782,7 @@ void print_main_menu_strings(void) {
// Print menu names
gSPDisplayList(gDisplayListHead++, dl_ia_text_begin);
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha);
print_generic_string(43, 39, gTimeTrialsTextSpeedrun);
print_generic_string(SCORE_X, 39, textScore);
print_generic_string(COPY_X, 39, textCopy);
print_generic_string(ERASE_X, 39, textErase);
#if !defined(VERSION_JP) && !defined(VERSION_SH)
@ -2734,7 +2725,6 @@ static void print_file_select_strings(void) {
#endif
break;
case MENU_BUTTON_SCORE:
break;
print_score_menu_strings();
sScoreFileCoinScoreMode = 0;
break;

View file

@ -379,7 +379,6 @@ Gfx *geo_act_selector_strings(s16 callContext, UNUSED struct GraphNode *node) {
#endif
if (callContext == GEO_CONTEXT_RENDER) {
print_act_selector_strings();
time_trials_render_star_select_time(gCurrSaveFileNum - 1, gCurrCourseNum, sSelectedActIndex);
}
return NULL;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 B