Skip to content

Commit

Permalink
Merge branch 'main' into temp
Browse files Browse the repository at this point in the history
  • Loading branch information
HailSanta authored and HailSanta committed Sep 23, 2023
2 parents f95f25b + bde8f70 commit 80cdf12
Show file tree
Hide file tree
Showing 39 changed files with 418 additions and 207 deletions.
9 changes: 0 additions & 9 deletions include/common_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2478,15 +2478,6 @@ typedef struct CreditsPairOffset {
/* 0x02 */ s16 offset;
} CreditsPairOffset; // size = 0x4

typedef struct GameMode {
/* 0x00 */ u16 flags;
/* 0x04 */ void (*init)(void);
/* 0x08 */ void (*step)(void);
/* 0x0C */ UNK_FUN_PTR(unk_0C);
/* 0x10 */ void (*render)(void);
/* 0x14 */ void (*renderAux)(void); ///< @see state_render_frontUI
} GameMode; // size = 0x18

typedef struct PartnerDMAData {
/* 0x00 */ u32 dmaStart;
/* 0x04 */ u32 dmaEnd;
Expand Down
21 changes: 0 additions & 21 deletions include/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -3491,27 +3491,6 @@ enum EffectGfxDataFlags {

#include "move_enum.h"

enum GameModeIDs {
GAME_MODE_STARTUP = 0x00000000,
GAME_MODE_LOGOS = 0x00000001,
GAME_MODE_TITLE_SCREEN = 0x00000002,
GAME_MODE_ENTER_DEMO_WORLD = 0x00000003,
GAME_MODE_CHANGE_MAP = 0x00000004,
GAME_MODE_UNUSED = 0x00000005,
GAME_MODE_ENTER_WORLD = 0x00000006,
GAME_MODE_WORLD = 0x00000007,
GAME_MODE_BATTLE = 0x00000008,
GAME_MODE_END_BATTLE = 0x00000009,
GAME_MODE_PAUSE = 0x0000000A,
GAME_MODE_UNPAUSE = 0x0000000B,
GAME_MODE_LANGUAGE_SELECT = 0x0000000C,
GAME_MODE_END_LANGUAGE_SELECT = 0x0000000D,
GAME_MODE_FILE_SELECT = 0x0000000E,
GAME_MODE_END_FILE_SELECT = 0x0000000F,
GAME_MODE_INTRO = 0x00000010,
GAME_MODE_DEMO = 0x00000011,
};

enum DemoState {
DEMO_STATE_NONE = 0,
DEMO_STATE_ACTIVE = 1,
Expand Down
13 changes: 3 additions & 10 deletions include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,6 @@ void mem_clear(void* data, s32 numBytes);
void intro_logos_set_fade_color(s16 color);
void intro_logos_set_fade_alpha(s16 alpha);

void set_game_mode(s16 idx);

f32 get_xz_dist_to_player(f32, f32);
void func_800E06C0(s32);
void close_status_bar(void);
Expand Down Expand Up @@ -584,7 +582,6 @@ void update_workers(void);
void update_triggers(void);
void update_scripts(void);
void update_messages(void);
void step_current_game_mode(void);
void update_entities(void);
void func_80138198(void);
void bgm_update_music_settings(void);
Expand All @@ -596,13 +593,11 @@ void func_802C3EE4(void);
void render_screen_overlay_backUI(void);
void render_workers_backUI(void);
void render_effects_UI(void);
void state_render_backUI(void);
void render_window_root(void);
void render_messages(void);
void render_workers_frontUI(void);
void render_screen_overlay_frontUI(void);
void render_curtains(void);
void state_render_frontUI(void);
void fio_init_flash(void);
void func_80028838(void);
void clear_screen_overlays(void);
Expand Down Expand Up @@ -704,9 +699,9 @@ void state_step_enter_world(void);
void state_init_change_map(void);
void state_step_change_map(void);
void state_drawUI_change_map(void);
void func_80036430(void);
void func_8003646C(void);
void func_80036640(void);
void state_init_game_over(void);
void state_step_game_over(void);
void state_drawUI_game_over(void);
void state_init_enter_world(void);
void state_drawUI_enter_world(void);
void state_init_world(void);
Expand Down Expand Up @@ -742,7 +737,6 @@ void state_drawUI_intro(void);
void state_init_demo(void);
void state_step_demo(void);
void state_drawUI_demo(void);
void game_mode_set_fpDrawAuxUI(s32 i, void (*fn)(void));

void btl_set_player_idle_anims(void);

Expand Down Expand Up @@ -1073,7 +1067,6 @@ void clear_model_data(void);
void init_sprite_shading_data(void);
void clear_sprite_shading_data(void);
void clear_character_set(void);
void clear_game_modes(void);
void clear_trigger_data(void);
void clear_script_list(void);
void clear_entity_data(s32);
Expand Down
2 changes: 0 additions & 2 deletions include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#define UNK_FUN_PTR(name) void(*name)(void)
#define UNK_ARGS

typedef void (*StateFunc)(void);

typedef char* (*PrintCallback)(void*, const char*, u32);

/// Linker symbol address, as in `ld_addrs.h`.
Expand Down
13 changes: 7 additions & 6 deletions src/111f0_len_860.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "common.h"
#include "nu/nusys.h"
#include "game_modes.h"

SHIFT_BSS s16 gMapTransitionAlpha;
SHIFT_BSS s16 gMapTransitionFadeRate;
Expand Down Expand Up @@ -85,7 +86,7 @@ void state_step_enter_world(void) {
enable_player_input();
}
set_screen_overlay_params_front(OVERLAY_NONE, -1.0f);
set_game_mode(GAME_MODE_CHANGE_MAP);
set_game_mode(GAME_MODE_WORLD);
}
break;
}
Expand Down Expand Up @@ -173,7 +174,7 @@ void state_step_change_map(void) {
enable_player_input();
}
set_screen_overlay_params_front(OVERLAY_NONE, -1.0f);
set_game_mode(GAME_MODE_CHANGE_MAP);
set_game_mode(GAME_MODE_WORLD);
}
break;
}
Expand All @@ -185,14 +186,14 @@ void state_drawUI_change_map(void) {
}
}

void func_80036430(void) {
void state_init_game_over(void) {
gMapTransitionAlpha = 255;
gMapTransitionFadeRate = 20;
gMapTransitionState = 0x01;
gPlayerStatus.flags |= PS_FLAG_NO_STATIC_COLLISION;
}

void func_8003646C(void) {
void state_step_game_over(void) {
switch (gMapTransitionState) {
case 1:
gOverrideFlags |= GLOBAL_OVERRIDES_8;
Expand Down Expand Up @@ -226,7 +227,7 @@ void func_8003646C(void) {
gMapTransitionAlpha = 0;
gMapTransitionState++;
set_screen_overlay_params_front(OVERLAY_NONE, -1.0f);
set_game_mode(GAME_MODE_CHANGE_MAP);
set_game_mode(GAME_MODE_WORLD);
}
update_npcs();
update_player();
Expand All @@ -238,5 +239,5 @@ void func_8003646C(void) {
set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, gMapTransitionAlpha);
}

void func_80036640(void) {
void state_drawUI_game_over(void) {
}
3 changes: 2 additions & 1 deletion src/16F740.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "hud_element.h"
#include "battle/battle.h"
#include "model.h"
#include "game_modes.h"

extern StageListRow* gCurrentStagePtr;

Expand Down Expand Up @@ -2144,7 +2145,7 @@ void btl_state_update_end_battle(void) {
gGameStatusPtr->areaID = areaID;
gGameStatusPtr->mapID = mapID;
gGameStatusPtr->entryID = gv_01_ENTRY_0;
set_game_mode(GAME_MODE_ENTER_WORLD);
set_game_mode(GAME_MODE_GAME_OVER);
} else {
btl_set_state(BATTLE_STATE_0);
gLastDrawBattleState = gBattleState;
Expand Down
1 change: 1 addition & 0 deletions src/7fd10_len_b40.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "macros.h"
#include "common.h"
#include "sprite.h"
#include "game_modes.h"
#include "pause/pause_common.h"
#include "world/partners.h"
#include "world/partner/lakilester.h"
Expand Down
1 change: 1 addition & 0 deletions src/battle/battle.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "battle_tables.h"
#include "hud_element.h"
#include "sprite.h"
#include "game_modes.h"

SHIFT_BSS s32 D_800DC060;
SHIFT_BSS StageListRow* gCurrentStagePtr;
Expand Down
1 change: 1 addition & 0 deletions src/curtains.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "ui/no_controller.png.h"
#include "ld_addrs.h"
#include "nu/nusys.h"
#include "game_modes.h"

#include "theater/walls.png.inc.c"

Expand Down
1 change: 1 addition & 0 deletions src/evt/f8f60_len_1560.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "common.h"
#include "game_modes.h"

// args: start, end, duration, EasingType
ApiStatus MakeLerp(Evt* script, s32 isInitialCall) {
Expand Down
3 changes: 2 additions & 1 deletion src/evt/map_api.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "common.h"
#include "model.h"
#include "evt.h"
#include "game_modes.h"

extern LavaReset* gLavaResetList;
extern s32 LastSafeFloor;
Expand Down Expand Up @@ -721,7 +722,7 @@ void goto_map(Evt* script, s32 mode) {
}

set_map_transition_effect(mapTransitionEffect);
set_game_mode(GAME_MODE_UNUSED);
set_game_mode(GAME_MODE_CHANGE_MAP);
}

ApiStatus GotoMap(Evt* script, s32 isInitialCall) {
Expand Down
1 change: 1 addition & 0 deletions src/filemenu/filemenu_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "hud_element.h"
#include "fio.h"
#include "ld_addrs.h"
#include "game_modes.h"

extern HudScript HES_AnimatedCursorHand;

Expand Down
1 change: 1 addition & 0 deletions src/filemenu/filemenu_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "hud_element.h"
#include "audio/public.h"
#include "fio.h"
#include "game_modes.h"

extern HudScript HES_Spirit1;
extern HudScript HES_Spirit2;
Expand Down
1 change: 1 addition & 0 deletions src/filemenu/filemenu_selectlanguage.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "message_ids.h"
#include "hud_element.h"
#include "ld_addrs.h"
#include "game_modes.h"

extern HudScript HES_Spirit1;

Expand Down
1 change: 1 addition & 0 deletions src/filemenu/filemenu_yesno.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "common.h"
#include "filemenu.h"
#include "fio.h"
#include "game_modes.h"

#if VERSION_IQUE
#define DELETE_FILE_DELETE_X 20
Expand Down
Loading

0 comments on commit 80cdf12

Please sign in to comment.