From 4fadbaf16153c0160f6ad38dc0053e7ff6db7472 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 3 Apr 2019 09:55:17 -0400 Subject: [PATCH] Minor fixes gotoram --> returnram cmdCF/execram --> gotoram fix indentation in sym_ewram.txt fix mevent_client.h guard name --- asm/macros/event.inc | 4 ++-- data/mystery_event_msg.s | 2 +- data/script_cmd_table.inc | 4 ++-- data/scripts/cable_club.inc | 2 +- include/link_rfu.h | 2 +- include/mevent_client.h | 6 +++--- src/link_rfu.c | 2 +- src/mevent_server_helpers.c | 8 ++++---- src/overworld.c | 2 +- src/scrcmd.c | 4 ++-- sym_ewram.txt | 14 +++++++------- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 8b3466fe74..e00bdb6005 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -77,7 +77,7 @@ .endm @ Executes a script stored in a default RAM location. - .macro gotoram + .macro returnram .byte 0x0c .endm @@ -1440,7 +1440,7 @@ .endm @ Depending on factors I haven't managed to understand yet, this command may cause script execution to jump to the offset specified by the pointer at 0x020375C0. - .macro execram + .macro gotoram .byte 0xcf .endm diff --git a/data/mystery_event_msg.s b/data/mystery_event_msg.s index 24a075181f..dd1f8e6818 100644 --- a/data/mystery_event_msg.s +++ b/data/mystery_event_msg.s @@ -36,7 +36,7 @@ MysteryEventScript_SurfPichu:: @ 8674D3D setvaddress MysteryEventScript_SurfPichu checkflag FLAG_MYSTERY_EVENT_DONE vgoto_if 0, SurfPichu_GiveIfPossible - gotoram + returnram SurfPichu_GiveIfPossible: @ 8674D4C specialvar VAR_EVENT_PICHU_SLOT, CalculatePlayerPartyCount diff --git a/data/script_cmd_table.inc b/data/script_cmd_table.inc index 39864b2a85..e9a14437a7 100644 --- a/data/script_cmd_table.inc +++ b/data/script_cmd_table.inc @@ -12,7 +12,7 @@ gScriptCmdTable:: @ 81DB67C .4byte ScrCmd_callstd .4byte ScrCmd_gotostd_if .4byte ScrCmd_callstd_if - .4byte ScrCmd_gotoram + .4byte ScrCmd_returnram .4byte ScrCmd_killscript .4byte ScrCmd_setmysteryeventstatus .4byte ScrCmd_loadword @@ -207,7 +207,7 @@ gScriptCmdTable:: @ 81DB67C .4byte ScrCmd_nop1 .4byte ScrCmd_setmonobedient .4byte ScrCmd_checkmonobedience - .4byte ScrCmd_cmdCF + .4byte ScrCmd_gotoram .4byte ScrCmd_nop1 .4byte ScrCmd_warpD1 .4byte ScrCmd_setmonmetlocation diff --git a/data/scripts/cable_club.inc b/data/scripts/cable_club.inc index e0b2898995..c755493dcf 100644 --- a/data/scripts/cable_club.inc +++ b/data/scripts/cable_club.inc @@ -60,7 +60,7 @@ VerdanturfTown_PokemonCenter_2F_EventScript_276B03:: @ 8276B03 end OldaleTown_PokemonCenter_2F_EventScript_276B19:: @ 8276B19 - execram + gotoram OldaleTown_PokemonCenter_2F_EventScript_276B1A:: @ 8276B1A msgbox gUnknown_08273178, MSGBOX_NPC diff --git a/include/link_rfu.h b/include/link_rfu.h index b8ba1a9275..edfd0ed208 100644 --- a/include/link_rfu.h +++ b/include/link_rfu.h @@ -284,7 +284,7 @@ bool8 sub_800DE7C(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx); bool8 sub_800DF34(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx); s32 sub_800E87C(u8 idx); void sub_8011BA4(void); -void sub_8010198(void); +void LinkRfu_FatalError(void); bool32 sub_8011A9C(void); void sub_80104B0(void); void sub_8011A50(void); diff --git a/include/mevent_client.h b/include/mevent_client.h index 58893794e5..c32d14d7aa 100644 --- a/include/mevent_client.h +++ b/include/mevent_client.h @@ -1,5 +1,5 @@ -#ifndef GUARD_MEVENT_SERVER_ISH_H -#define GUARD_MEVENT_SERVER_ISH_H +#ifndef GUARD_MEVENT_CLIENT_H +#define GUARD_MEVENT_CLIENT_H #include "mevent_server_helpers.h" @@ -30,4 +30,4 @@ void mevent_client_inc_flag(void); void * mevent_client_get_buffer(void); void mevent_client_set_param(u32 a0); -#endif //GUARD_MEVENT_SERVER_ISH_H +#endif //GUARD_MEVENT_CLIENT_H diff --git a/src/link_rfu.c b/src/link_rfu.c index 1e4c9c7e63..7c55df7839 100644 --- a/src/link_rfu.c +++ b/src/link_rfu.c @@ -3674,7 +3674,7 @@ void sub_8010168(void) gUnknown_03005000.unk_00 = sub_8010148; } -void sub_8010198(void) +void LinkRfu_FatalError(void) { sub_800D630(); gUnknown_03005000.unk_ce4 = 1; diff --git a/src/mevent_server_helpers.c b/src/mevent_server_helpers.c index af14b514cf..9d47ba7459 100644 --- a/src/mevent_server_helpers.c +++ b/src/mevent_server_helpers.c @@ -96,12 +96,12 @@ static bool32 mevent_receive_func(struct mevent_srv_sub * svr) svr->recvCRC = header.crc; if (svr->recvSize > ME_SEND_BUF_SIZE) { - sub_8010198(); + LinkRfu_FatalError(); return FALSE; } else if (svr->recvIdent != header.ident) { - sub_8010198(); + LinkRfu_FatalError(); return FALSE; } else @@ -133,7 +133,7 @@ static bool32 mevent_receive_func(struct mevent_srv_sub * svr) case 2: if (CalcCRC16WithTable(svr->recvBfr, svr->recvSize) != svr->recvCRC) { - sub_8010198(); + LinkRfu_FatalError(); return FALSE; } else @@ -192,7 +192,7 @@ static bool32 mevent_send_func(struct mevent_srv_sub * svr) if (IsLinkTaskFinished()) { if (CalcCRC16WithTable(svr->sendBfr, svr->sendSize) != svr->sendCRC) - sub_8010198(); + LinkRfu_FatalError(); else ++svr->seqno; } diff --git a/src/overworld.c b/src/overworld.c index ae6efefd7c..9ed147c0ab 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -2287,7 +2287,7 @@ static void SetKeyInterceptCallback(u16 (*func)(u32)) static void CheckRfuKeepAliveTimer(void) { if (gWirelessCommType != 0 && ++sRfuKeepAliveTimer > 60) - sub_8010198(); + LinkRfu_FatalError(); } static void ResetAllTradingStates(void) diff --git a/src/scrcmd.c b/src/scrcmd.c index 0b1006cef3..125a57c011 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -281,7 +281,7 @@ bool8 ScrCmd_callstd_if(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_gotoram(struct ScriptContext *ctx) +bool8 ScrCmd_returnram(struct ScriptContext *ctx) { ScriptJump(ctx, gUnknown_020375C0); return FALSE; @@ -2215,7 +2215,7 @@ bool8 ScrCmd_checkmonobedience(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_cmdCF(struct ScriptContext *ctx) +bool8 ScrCmd_gotoram(struct ScriptContext *ctx) { const u8* v1 = GetSavedRamScriptIfValid(); diff --git a/sym_ewram.txt b/sym_ewram.txt index 25cf13069d..ff27b4cfb9 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -7,16 +7,16 @@ .include "src/link.o" .include "src/link_rfu.o" .include "src/union_room.o" - .include "src/mystery_gift.o" - .include "src/union_room_player_avatar.o" - .include "src/union_room_battle.o" + .include "src/mystery_gift.o" + .include "src/union_room_player_avatar.o" + .include "src/union_room_battle.o" .include "src/mevent2.o" .include "src/mevent_801BAAC.o" - .include "src/mevent_server.o" - .include "src/mevent_client.o" + .include "src/mevent_server.o" + .include "src/mevent_client.o" - @ union_room_chat - .align 2 + @ union_room_chat + .align 2 gUnknown_02022C84: @ 2022C84 .space 0x4