diff options
author | PikalaxALT <PikalaxALT@users.noreply.github.com> | 2020-03-06 09:59:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-06 09:59:23 -0500 |
commit | f483a93beaaeff82ad0a6b8b6e67a5a1b25ec989 (patch) | |
tree | 16e060c6cda0d9c5565b2400f5048f70170e014f | |
parent | ed647322294b5c04d80f02aa05d7db08b49c0646 (diff) | |
parent | fef3383c6cab5172f29c677caa606234f986fad6 (diff) |
Merge pull request #290 from PikalaxALT/field_message_box
Decompile field_message_box
-rw-r--r-- | asm/field_message_box.s | 306 | ||||
-rw-r--r-- | include/new_menu_helpers.h | 2 | ||||
-rw-r--r-- | ld_script.txt | 2 | ||||
-rw-r--r-- | src/field_message_box.c | 140 | ||||
-rw-r--r-- | src/new_menu_helpers.c | 2 | ||||
-rw-r--r-- | src/scrcmd.c | 432 | ||||
-rw-r--r-- | sym_ewram.txt | 5 |
7 files changed, 361 insertions, 528 deletions
diff --git a/asm/field_message_box.s b/asm/field_message_box.s deleted file mode 100644 index b823956b7..000000000 --- a/asm/field_message_box.s +++ /dev/null @@ -1,306 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_8069348 -sub_8069348: @ 8069348 - ldr r1, _08069368 @ =gUnknown_203709C - movs r0, 0 - strb r0, [r1] - ldr r2, _0806936C @ =gTextFlags - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - movs r1, 0x3 - negs r1, r1 - ands r0, r1 - subs r1, 0x2 - ands r0, r1 - strb r0, [r2] - bx lr - .align 2, 0 -_08069368: .4byte gUnknown_203709C -_0806936C: .4byte gTextFlags - thumb_func_end sub_8069348 - - thumb_func_start sub_8069370 -sub_8069370: @ 8069370 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, _08069394 @ =gTasks - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _080693DA - cmp r0, 0x1 - bgt _08069398 - cmp r0, 0 - beq _0806939E - b _08069402 - .align 2, 0 -_08069394: .4byte gTasks -_08069398: - cmp r0, 0x2 - beq _080693EA - b _08069402 -_0806939E: - ldr r0, _080693BC @ =gQuestLogState - ldrb r0, [r0] - cmp r0, 0x2 - bne _080693C4 - ldr r2, _080693C0 @ =gTextFlags - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r1, 0x80 - lsls r1, 2 - movs r0, 0 - bl TextWindow_LoadTilesStdFrame1 - b _080693E2 - .align 2, 0 -_080693BC: .4byte gQuestLogState -_080693C0: .4byte gTextFlags -_080693C4: - bl IsMsgSignPost - lsls r0, 24 - cmp r0, 0 - bne _080693D4 - bl LoadStdWindowFrameGfx - b _080693E2 -_080693D4: - bl sub_80F79A4 - b _080693E2 -_080693DA: - movs r0, 0 - movs r1, 0x1 - bl DrawDialogueFrame -_080693E2: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _08069402 -_080693EA: - bl RunTextPrinters_CheckPrinter0Active - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - beq _08069402 - ldr r1, _08069408 @ =gUnknown_203709C - movs r0, 0 - strb r0, [r1] - adds r0, r4, 0 - bl DestroyTask -_08069402: - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_08069408: .4byte gUnknown_203709C - thumb_func_end sub_8069370 - - thumb_func_start task_add_textbox -task_add_textbox: @ 806940C - push {lr} - ldr r0, _0806941C @ =sub_8069370 - movs r1, 0x50 - bl CreateTask - pop {r0} - bx r0 - .align 2, 0 -_0806941C: .4byte sub_8069370 - thumb_func_end task_add_textbox - - thumb_func_start task_del_textbox -task_del_textbox: @ 8069420 - push {lr} - ldr r0, _08069438 @ =sub_8069370 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _08069434 - bl DestroyTask -_08069434: - pop {r0} - bx r0 - .align 2, 0 -_08069438: .4byte sub_8069370 - thumb_func_end task_del_textbox - - thumb_func_start ShowFieldMessage -ShowFieldMessage: @ 806943C - push {r4,lr} - adds r1, r0, 0 - ldr r4, _08069458 @ =gUnknown_203709C - ldrb r0, [r4] - cmp r0, 0 - bne _0806945C - adds r0, r1, 0 - bl textbox_fdecode_auto_and_task_add - movs r0, 0x2 - strb r0, [r4] - movs r0, 0x1 - b _0806945E - .align 2, 0 -_08069458: .4byte gUnknown_203709C -_0806945C: - movs r0, 0 -_0806945E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end ShowFieldMessage - - thumb_func_start ShowFieldAutoScrollMessage -ShowFieldAutoScrollMessage: @ 8069464 - push {lr} - adds r1, r0, 0 - ldr r2, _08069480 @ =gUnknown_203709C - ldrb r0, [r2] - cmp r0, 0 - bne _08069484 - movs r0, 0x3 - strb r0, [r2] - adds r0, r1, 0 - bl textbox_fdecode_auto_and_task_add - movs r0, 0x1 - b _08069486 - .align 2, 0 -_08069480: .4byte gUnknown_203709C -_08069484: - movs r0, 0 -_08069486: - pop {r1} - bx r1 - thumb_func_end ShowFieldAutoScrollMessage - - thumb_func_start sub_806948C -sub_806948C: @ 806948C - push {lr} - ldr r2, _080694A0 @ =gUnknown_203709C - movs r1, 0x3 - strb r1, [r2] - bl textbox_fdecode_auto_and_task_add - movs r0, 0x1 - pop {r1} - bx r1 - .align 2, 0 -_080694A0: .4byte gUnknown_203709C - thumb_func_end sub_806948C - - thumb_func_start sub_80694A4 -sub_80694A4: @ 80694A4 - push {lr} - ldr r1, _080694BC @ =gUnknown_203709C - ldrb r0, [r1] - cmp r0, 0 - bne _080694C0 - movs r0, 0x2 - strb r0, [r1] - bl textbox_auto_and_task_add - movs r0, 0x1 - b _080694C2 - .align 2, 0 -_080694BC: .4byte gUnknown_203709C -_080694C0: - movs r0, 0 -_080694C2: - pop {r1} - bx r1 - thumb_func_end sub_80694A4 - - thumb_func_start textbox_fdecode_auto_and_task_add -textbox_fdecode_auto_and_task_add: @ 80694C8 - push {lr} - adds r1, r0, 0 - ldr r0, _080694E0 @ =gStringVar4 - bl StringExpandPlaceholders - movs r0, 0x1 - bl AddTextPrinterDiffStyle - bl task_add_textbox - pop {r0} - bx r0 - .align 2, 0 -_080694E0: .4byte gStringVar4 - thumb_func_end textbox_fdecode_auto_and_task_add - - thumb_func_start textbox_auto_and_task_add -textbox_auto_and_task_add: @ 80694E4 - push {lr} - movs r0, 0x1 - bl AddTextPrinterDiffStyle - bl task_add_textbox - pop {r0} - bx r0 - thumb_func_end textbox_auto_and_task_add - - thumb_func_start HideFieldMessageBox -HideFieldMessageBox: @ 80694F4 - push {lr} - bl task_del_textbox - movs r0, 0 - movs r1, 0x1 - bl ClearDialogWindowAndFrame - ldr r1, _0806950C @ =gUnknown_203709C - movs r0, 0 - strb r0, [r1] - pop {r0} - bx r0 - .align 2, 0 -_0806950C: .4byte gUnknown_203709C - thumb_func_end HideFieldMessageBox - - thumb_func_start textbox_any_visible -textbox_any_visible: @ 8069510 - ldr r0, _08069518 @ =gUnknown_203709C - ldrb r0, [r0] - bx lr - .align 2, 0 -_08069518: .4byte gUnknown_203709C - thumb_func_end textbox_any_visible - - thumb_func_start IsFieldMessageBoxHidden -IsFieldMessageBoxHidden: @ 806951C - push {lr} - ldr r0, _0806952C @ =gUnknown_203709C - ldrb r0, [r0] - cmp r0, 0 - beq _08069530 - movs r0, 0 - b _08069532 - .align 2, 0 -_0806952C: .4byte gUnknown_203709C -_08069530: - movs r0, 0x1 -_08069532: - pop {r1} - bx r1 - thumb_func_end IsFieldMessageBoxHidden - - thumb_func_start sub_8069538 -sub_8069538: @ 8069538 - push {lr} - bl task_del_textbox - movs r0, 0 - movs r1, 0x1 - bl DrawStdWindowFrame - ldr r1, _08069550 @ =gUnknown_203709C - movs r0, 0 - strb r0, [r1] - pop {r0} - bx r0 - .align 2, 0 -_08069550: .4byte gUnknown_203709C - thumb_func_end sub_8069538 - - .align 2, 0 @ Don't pad with nop. diff --git a/include/new_menu_helpers.h b/include/new_menu_helpers.h index f20375675..8e05f247f 100644 --- a/include/new_menu_helpers.h +++ b/include/new_menu_helpers.h @@ -47,7 +47,7 @@ void RemoveStartMenuWindow(void); u16 GetStdWindowBaseTileNum(void); void DrawHelpMessageWindowWithText(const u8 * text); void DestroyHelpMessageWindow_(void); -void sub_80F79A4(void); +void LoadSignPostWindowFrameGfx(void); void SetDefaultFontsPointer(void); #endif // GUARD_NEW_MENU_HELPERS_H diff --git a/ld_script.txt b/ld_script.txt index 858627a34..5c908a5f8 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -95,7 +95,7 @@ SECTIONS { asm/field_player_avatar.o(.text); asm/event_object_movement.o(.text); src/event_object_80688E4.o(.text); /* event_object_movement */ - asm/field_message_box.o(.text); + src/field_message_box.o(.text); src/event_object_lock.o(.text); src/text_window_graphics.o(.text); src/script.o(.text); diff --git a/src/field_message_box.c b/src/field_message_box.c new file mode 100644 index 000000000..1909fd398 --- /dev/null +++ b/src/field_message_box.c @@ -0,0 +1,140 @@ +#include "global.h" +#include "gflib.h" +#include "new_menu_helpers.h" +#include "quest_log.h" +#include "script.h" +#include "text_window.h" + +static EWRAM_DATA u8 sMessageBoxType = 0; + +static void textbox_fdecode_auto_and_task_add(const u8 *str); +static void textbox_auto_and_task_add(void); + +void sub_8069348(void) +{ + sMessageBoxType = 0; + gTextFlags.canABSpeedUpPrint = FALSE; + gTextFlags.useAlternateDownArrow = FALSE; + gTextFlags.autoScroll = FALSE; +} + +static void Task_RunFieldMessageBoxPrinter(u8 taskId) +{ + struct Task * task = &gTasks[taskId]; + switch (task->data[0]) + { + case 0: + if (gQuestLogState == QL_STATE_2) + { + gTextFlags.autoScroll = TRUE; + TextWindow_LoadTilesStdFrame1(0, 0x200); + } + else if (!IsMsgSignPost()) + { + LoadStdWindowFrameGfx(); + } + else + { + LoadSignPostWindowFrameGfx(); + } + task->data[0]++; + break; + case 1: + DrawDialogueFrame(0, TRUE); + task->data[0]++; + break; + case 2: + if (RunTextPrinters_CheckPrinter0Active() != TRUE) + { + sMessageBoxType = 0; + DestroyTask(taskId); + } + break; + } +} + +static void task_add_textbox(void) +{ + CreateTask(Task_RunFieldMessageBoxPrinter, 80); +} + +static void task_del_textbox(void) +{ + u8 taskId = FindTaskIdByFunc(Task_RunFieldMessageBoxPrinter); + if (taskId != 0xFF) + DestroyTask(taskId); +} + +bool8 ShowFieldMessage(const u8 *str) +{ + if (sMessageBoxType != 0) + return FALSE; + textbox_fdecode_auto_and_task_add(str); + sMessageBoxType = 2; + return TRUE; +} + +bool8 ShowFieldAutoScrollMessage(const u8 *str) +{ + if (sMessageBoxType != 0) + return FALSE; + sMessageBoxType = 3; + textbox_fdecode_auto_and_task_add(str); + return TRUE; +} + +bool8 sub_806948C(const u8 *str) +{ + sMessageBoxType = 3; + textbox_fdecode_auto_and_task_add(str); + return TRUE; +} + +bool8 sub_80694A4(const u8 *str) +{ + if (sMessageBoxType != 0) + return FALSE; + sMessageBoxType = 2; + textbox_auto_and_task_add(); + return TRUE; +} + +static void textbox_fdecode_auto_and_task_add(const u8 *str) +{ + StringExpandPlaceholders(gStringVar4, str); + AddTextPrinterDiffStyle(TRUE); + task_add_textbox(); +} + +static void textbox_auto_and_task_add(void) +{ + AddTextPrinterDiffStyle(TRUE); + task_add_textbox(); +} + +void HideFieldMessageBox(void) +{ + task_del_textbox(); + ClearDialogWindowAndFrame(0, TRUE); + sMessageBoxType = 0; +} + +u8 textbox_any_visible(void) +{ + return sMessageBoxType; +} + +bool8 IsFieldMessageBoxHidden(void) +{ + if (sMessageBoxType == 0) + return TRUE; + else + return FALSE; +} + +void sub_8069538(void) +{ + task_del_textbox(); + DrawStdWindowFrame(0, TRUE); + sMessageBoxType = 0; +} diff --git a/src/new_menu_helpers.c b/src/new_menu_helpers.c index 11b353b8c..959370398 100644 --- a/src/new_menu_helpers.c +++ b/src/new_menu_helpers.c @@ -716,7 +716,7 @@ void DestroyHelpMessageWindow_(void) DestroyHelpMessageWindow(2); } -void sub_80F79A4(void) +void LoadSignPostWindowFrameGfx(void) { Menu_LoadStdPal(); sub_814FEEC(0, DLG_WINDOW_BASE_TILE_NUM, 0x10 * DLG_WINDOW_PALETTE_NUM); diff --git a/src/scrcmd.c b/src/scrcmd.c index 3f1927cbf..b4605e9d5 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -60,7 +60,7 @@ extern u8 gSelectedObjectEvent; // This is defined in here so the optimizer can't see its value when compiling // script.c. -void * const gNullScriptPtr = NULL; +void *const gNullScriptPtr = NULL; static const u8 sScriptConditionTable[6][3] = { @@ -73,30 +73,30 @@ static const u8 sScriptConditionTable[6][3] = 1, 0, 1, // != }; -bool8 ScrCmd_nop(struct ScriptContext *ctx) +bool8 ScrCmd_nop(struct ScriptContext * ctx) { return FALSE; } -bool8 ScrCmd_nop1(struct ScriptContext *ctx) +bool8 ScrCmd_nop1(struct ScriptContext * ctx) { return FALSE; } -bool8 ScrCmd_end(struct ScriptContext *ctx) +bool8 ScrCmd_end(struct ScriptContext * ctx) { StopScript(ctx); return FALSE; } -bool8 ScrCmd_gotonative(struct ScriptContext *ctx) +bool8 ScrCmd_gotonative(struct ScriptContext * ctx) { bool8 (*func)(void) = (bool8 (*)(void))ScriptReadWord(ctx); SetupNativeScript(ctx, func); return TRUE; } -bool8 ScrCmd_special(struct ScriptContext *ctx) +bool8 ScrCmd_special(struct ScriptContext * ctx) { u16 (*const *specialPtr)(void) = gSpecials + ScriptReadHalfword(ctx); if (specialPtr < gSpecialsEnd) @@ -106,7 +106,7 @@ bool8 ScrCmd_special(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_specialvar(struct ScriptContext *ctx) +bool8 ScrCmd_specialvar(struct ScriptContext * ctx) { u16 * varPtr = GetVarPointer(ScriptReadHalfword(ctx)); u16 (*const *specialPtr)(void) = gSpecials + ScriptReadHalfword(ctx); @@ -117,40 +117,40 @@ bool8 ScrCmd_specialvar(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_callnative(struct ScriptContext *ctx) +bool8 ScrCmd_callnative(struct ScriptContext * ctx) { void (*func )(void) = ((void (*)(void))ScriptReadWord(ctx)); func(); return FALSE; } -bool8 ScrCmd_waitstate(struct ScriptContext *ctx) +bool8 ScrCmd_waitstate(struct ScriptContext * ctx) { ScriptContext1_Stop(); return TRUE; } -bool8 ScrCmd_goto(struct ScriptContext *ctx) +bool8 ScrCmd_goto(struct ScriptContext * ctx) { const u8 * scrptr = (const u8 *)ScriptReadWord(ctx); ScriptJump(ctx, scrptr); return FALSE; } -bool8 ScrCmd_return(struct ScriptContext *ctx) +bool8 ScrCmd_return(struct ScriptContext * ctx) { ScriptReturn(ctx); return FALSE; } -bool8 ScrCmd_call(struct ScriptContext *ctx) +bool8 ScrCmd_call(struct ScriptContext * ctx) { const u8 * scrptr = (const u8 *)ScriptReadWord(ctx); ScriptCall(ctx, scrptr); return FALSE; } -bool8 ScrCmd_goto_if(struct ScriptContext *ctx) +bool8 ScrCmd_goto_if(struct ScriptContext * ctx) { u8 condition = ScriptReadByte(ctx); const u8 * scrptr = (const u8 *)ScriptReadWord(ctx); @@ -159,7 +159,7 @@ bool8 ScrCmd_goto_if(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_call_if(struct ScriptContext *ctx) +bool8 ScrCmd_call_if(struct ScriptContext * ctx) { u8 condition = ScriptReadByte(ctx); const u8 * scrptr = (const u8 *)ScriptReadWord(ctx); @@ -168,7 +168,7 @@ bool8 ScrCmd_call_if(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setvaddress(struct ScriptContext *ctx) +bool8 ScrCmd_setvaddress(struct ScriptContext * ctx) { u32 addr1 = (u32)ctx->scriptPtr - 1; u32 addr2 = ScriptReadWord(ctx); @@ -177,21 +177,21 @@ bool8 ScrCmd_setvaddress(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_vgoto(struct ScriptContext *ctx) +bool8 ScrCmd_vgoto(struct ScriptContext * ctx) { const u8 * scrptr = (const u8 *)ScriptReadWord(ctx); ScriptJump(ctx, scrptr - gVScriptOffset); return FALSE; } -bool8 ScrCmd_vcall(struct ScriptContext *ctx) +bool8 ScrCmd_vcall(struct ScriptContext * ctx) { const u8 * scrptr = (const u8 *)ScriptReadWord(ctx); ScriptCall(ctx, scrptr - gVScriptOffset); return FALSE; } -bool8 ScrCmd_vgoto_if(struct ScriptContext *ctx) +bool8 ScrCmd_vgoto_if(struct ScriptContext * ctx) { u8 condition = ScriptReadByte(ctx); const u8 * scrptr = (const u8 *)ScriptReadWord(ctx) - gVScriptOffset; @@ -200,7 +200,7 @@ bool8 ScrCmd_vgoto_if(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_vcall_if(struct ScriptContext *ctx) +bool8 ScrCmd_vcall_if(struct ScriptContext * ctx) { u8 condition = ScriptReadByte(ctx); const u8 * scrptr = (const u8 *)ScriptReadWord(ctx) - gVScriptOffset; @@ -209,7 +209,7 @@ bool8 ScrCmd_vcall_if(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_gotostd(struct ScriptContext *ctx) +bool8 ScrCmd_gotostd(struct ScriptContext * ctx) { u8 stdIdx = ScriptReadByte(ctx); const u8 *const * script = gStdScripts + stdIdx; @@ -218,7 +218,7 @@ bool8 ScrCmd_gotostd(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_callstd(struct ScriptContext *ctx) +bool8 ScrCmd_callstd(struct ScriptContext * ctx) { u8 stdIdx = ScriptReadByte(ctx); const u8 *const * script = gStdScripts + stdIdx; @@ -227,7 +227,7 @@ bool8 ScrCmd_callstd(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_gotostd_if(struct ScriptContext *ctx) +bool8 ScrCmd_gotostd_if(struct ScriptContext * ctx) { u8 condition = ScriptReadByte(ctx); u8 stdIdx = ScriptReadByte(ctx); @@ -240,7 +240,7 @@ bool8 ScrCmd_gotostd_if(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_callstd_if(struct ScriptContext *ctx) +bool8 ScrCmd_callstd_if(struct ScriptContext * ctx) { u8 condition = ScriptReadByte(ctx); u8 stdIdx = ScriptReadByte(ctx); @@ -253,26 +253,26 @@ bool8 ScrCmd_callstd_if(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_gotoram(struct ScriptContext *ctx) +bool8 ScrCmd_gotoram(struct ScriptContext * ctx) { ScriptJump(ctx, gRAMScriptPtr); return FALSE; } -bool8 ScrCmd_killscript(struct ScriptContext *ctx) +bool8 ScrCmd_killscript(struct ScriptContext * ctx) { ClearRamScript(); StopScript(ctx); return TRUE; } -bool8 ScrCmd_setmysteryeventstatus(struct ScriptContext *ctx) +bool8 ScrCmd_setmysteryeventstatus(struct ScriptContext * ctx) { SetMysteryEventScriptStatus(ScriptReadByte(ctx)); return FALSE; } -bool8 ScrCmd_execram(struct ScriptContext *ctx) +bool8 ScrCmd_execram(struct ScriptContext * ctx) { const u8 * script = sub_8069E48(); if (script != NULL) @@ -283,42 +283,42 @@ bool8 ScrCmd_execram(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_loadword(struct ScriptContext *ctx) +bool8 ScrCmd_loadword(struct ScriptContext * ctx) { u8 which = ScriptReadByte(ctx); ctx->data[which] = ScriptReadWord(ctx); return FALSE; } -bool8 ScrCmd_loadbytefromaddr(struct ScriptContext *ctx) +bool8 ScrCmd_loadbytefromaddr(struct ScriptContext * ctx) { u8 which = ScriptReadByte(ctx); ctx->data[which] = *(const u8 *)ScriptReadWord(ctx); return FALSE; } -bool8 ScrCmd_writebytetoaddr(struct ScriptContext *ctx) +bool8 ScrCmd_writebytetoaddr(struct ScriptContext * ctx) { u8 value = ScriptReadByte(ctx); *(u8 *)ScriptReadWord(ctx) = value; return FALSE; } -bool8 ScrCmd_loadbyte(struct ScriptContext *ctx) +bool8 ScrCmd_loadbyte(struct ScriptContext * ctx) { u8 which = ScriptReadByte(ctx); ctx->data[which] = ScriptReadByte(ctx); return FALSE; } -bool8 ScrCmd_setptrbyte(struct ScriptContext *ctx) +bool8 ScrCmd_setptrbyte(struct ScriptContext * ctx) { u8 which = ScriptReadByte(ctx); *(u8 *)ScriptReadWord(ctx) = ctx->data[which]; return FALSE; } -bool8 ScrCmd_copylocal(struct ScriptContext *ctx) +bool8 ScrCmd_copylocal(struct ScriptContext * ctx) { u8 whichDst = ScriptReadByte(ctx); u8 whichSrc = ScriptReadByte(ctx); @@ -326,21 +326,21 @@ bool8 ScrCmd_copylocal(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_copybyte(struct ScriptContext *ctx) +bool8 ScrCmd_copybyte(struct ScriptContext * ctx) { u8 * dest = (u8 *)ScriptReadWord(ctx); *dest = *(const u8 *)ScriptReadWord(ctx); return FALSE; } -bool8 ScrCmd_setvar(struct ScriptContext *ctx) +bool8 ScrCmd_setvar(struct ScriptContext * ctx) { u16 * varPtr = GetVarPointer(ScriptReadHalfword(ctx)); *varPtr = ScriptReadHalfword(ctx); return FALSE; } -bool8 ScrCmd_copyvar(struct ScriptContext *ctx) +bool8 ScrCmd_copyvar(struct ScriptContext * ctx) { u16 * destPtr = GetVarPointer(ScriptReadHalfword(ctx)); u16 * srcPtr = GetVarPointer(ScriptReadHalfword(ctx)); @@ -348,7 +348,7 @@ bool8 ScrCmd_copyvar(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setorcopyvar(struct ScriptContext *ctx) +bool8 ScrCmd_setorcopyvar(struct ScriptContext * ctx) { u16 * destPtr = GetVarPointer(ScriptReadHalfword(ctx)); *destPtr = VarGet(ScriptReadHalfword(ctx)); @@ -366,7 +366,7 @@ u8 compare_012(u16 left, u16 right) } // comparelocaltolocal -bool8 ScrCmd_compare_local_to_local(struct ScriptContext *ctx) +bool8 ScrCmd_compare_local_to_local(struct ScriptContext * ctx) { const u8 value1 = ctx->data[ScriptReadByte(ctx)]; const u8 value2 = ctx->data[ScriptReadByte(ctx)]; @@ -376,7 +376,7 @@ bool8 ScrCmd_compare_local_to_local(struct ScriptContext *ctx) } // comparelocaltoimm -bool8 ScrCmd_compare_local_to_value(struct ScriptContext *ctx) +bool8 ScrCmd_compare_local_to_value(struct ScriptContext * ctx) { const u8 value1 = ctx->data[ScriptReadByte(ctx)]; const u8 value2 = ScriptReadByte(ctx); @@ -385,7 +385,7 @@ bool8 ScrCmd_compare_local_to_value(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_compare_local_to_addr(struct ScriptContext *ctx) +bool8 ScrCmd_compare_local_to_addr(struct ScriptContext * ctx) { const u8 value1 = ctx->data[ScriptReadByte(ctx)]; const u8 value2 = *(const u8 *)ScriptReadWord(ctx); @@ -394,7 +394,7 @@ bool8 ScrCmd_compare_local_to_addr(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_compare_addr_to_local(struct ScriptContext *ctx) +bool8 ScrCmd_compare_addr_to_local(struct ScriptContext * ctx) { const u8 value1 = *(const u8 *)ScriptReadWord(ctx); const u8 value2 = ctx->data[ScriptReadByte(ctx)]; @@ -403,7 +403,7 @@ bool8 ScrCmd_compare_addr_to_local(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_compare_addr_to_value(struct ScriptContext *ctx) +bool8 ScrCmd_compare_addr_to_value(struct ScriptContext * ctx) { const u8 value1 = *(const u8 *)ScriptReadWord(ctx); const u8 value2 = ScriptReadByte(ctx); @@ -412,7 +412,7 @@ bool8 ScrCmd_compare_addr_to_value(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_compare_addr_to_addr(struct ScriptContext *ctx) +bool8 ScrCmd_compare_addr_to_addr(struct ScriptContext * ctx) { const u8 value1 = *(const u8 *)ScriptReadWord(ctx); const u8 value2 = *(const u8 *)ScriptReadWord(ctx); @@ -421,7 +421,7 @@ bool8 ScrCmd_compare_addr_to_addr(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_compare_var_to_value(struct ScriptContext *ctx) +bool8 ScrCmd_compare_var_to_value(struct ScriptContext * ctx) { const u16 value1 = *GetVarPointer(ScriptReadHalfword(ctx)); const u16 value2 = ScriptReadHalfword(ctx); @@ -430,7 +430,7 @@ bool8 ScrCmd_compare_var_to_value(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_compare_var_to_var(struct ScriptContext *ctx) +bool8 ScrCmd_compare_var_to_var(struct ScriptContext * ctx) { const u16 *ptr1 = GetVarPointer(ScriptReadHalfword(ctx)); const u16 *ptr2 = GetVarPointer(ScriptReadHalfword(ctx)); @@ -439,21 +439,21 @@ bool8 ScrCmd_compare_var_to_var(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_addvar(struct ScriptContext *ctx) +bool8 ScrCmd_addvar(struct ScriptContext * ctx) { u16 *ptr = GetVarPointer(ScriptReadHalfword(ctx)); *ptr += ScriptReadHalfword(ctx); return FALSE; } -bool8 ScrCmd_subvar(struct ScriptContext *ctx) +bool8 ScrCmd_subvar(struct ScriptContext * ctx) { u16 *ptr = GetVarPointer(ScriptReadHalfword(ctx)); *ptr -= VarGet(ScriptReadHalfword(ctx)); return FALSE; } -bool8 ScrCmd_random(struct ScriptContext *ctx) +bool8 ScrCmd_random(struct ScriptContext * ctx) { u16 max = VarGet(ScriptReadHalfword(ctx)); @@ -461,7 +461,7 @@ bool8 ScrCmd_random(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_additem(struct ScriptContext *ctx) +bool8 ScrCmd_additem(struct ScriptContext * ctx) { u16 itemId = VarGet(ScriptReadHalfword(ctx)); u32 quantity = VarGet(ScriptReadHalfword(ctx)); @@ -471,7 +471,7 @@ bool8 ScrCmd_additem(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_removeitem(struct ScriptContext *ctx) +bool8 ScrCmd_removeitem(struct ScriptContext * ctx) { u16 itemId = VarGet(ScriptReadHalfword(ctx)); u32 quantity = VarGet(ScriptReadHalfword(ctx)); @@ -480,7 +480,7 @@ bool8 ScrCmd_removeitem(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_checkitemspace(struct ScriptContext *ctx) +bool8 ScrCmd_checkitemspace(struct ScriptContext * ctx) { u16 itemId = VarGet(ScriptReadHalfword(ctx)); u32 quantity = VarGet(ScriptReadHalfword(ctx)); @@ -489,7 +489,7 @@ bool8 ScrCmd_checkitemspace(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_checkitem(struct ScriptContext *ctx) +bool8 ScrCmd_checkitem(struct ScriptContext * ctx) { u16 itemId = VarGet(ScriptReadHalfword(ctx)); u32 quantity = VarGet(ScriptReadHalfword(ctx)); @@ -498,7 +498,7 @@ bool8 ScrCmd_checkitem(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_checkitemtype(struct ScriptContext *ctx) +bool8 ScrCmd_checkitemtype(struct ScriptContext * ctx) { u16 itemId = VarGet(ScriptReadHalfword(ctx)); @@ -506,7 +506,7 @@ bool8 ScrCmd_checkitemtype(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_addpcitem(struct ScriptContext *ctx) +bool8 ScrCmd_addpcitem(struct ScriptContext * ctx) { u16 itemId = VarGet(ScriptReadHalfword(ctx)); u16 quantity = VarGet(ScriptReadHalfword(ctx)); @@ -515,7 +515,7 @@ bool8 ScrCmd_addpcitem(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_checkpcitem(struct ScriptContext *ctx) +bool8 ScrCmd_checkpcitem(struct ScriptContext * ctx) { u16 itemId = VarGet(ScriptReadHalfword(ctx)); u16 quantity = VarGet(ScriptReadHalfword(ctx)); @@ -524,7 +524,7 @@ bool8 ScrCmd_checkpcitem(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_givedecoration(struct ScriptContext *ctx) +bool8 ScrCmd_givedecoration(struct ScriptContext * ctx) { u32 decorId = VarGet(ScriptReadHalfword(ctx)); @@ -532,7 +532,7 @@ bool8 ScrCmd_givedecoration(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_takedecoration(struct ScriptContext *ctx) +bool8 ScrCmd_takedecoration(struct ScriptContext * ctx) { u32 decorId = VarGet(ScriptReadHalfword(ctx)); @@ -540,7 +540,7 @@ bool8 ScrCmd_takedecoration(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_checkdecorspace(struct ScriptContext *ctx) +bool8 ScrCmd_checkdecorspace(struct ScriptContext * ctx) { u32 decorId = VarGet(ScriptReadHalfword(ctx)); @@ -548,7 +548,7 @@ bool8 ScrCmd_checkdecorspace(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_checkdecor(struct ScriptContext *ctx) +bool8 ScrCmd_checkdecor(struct ScriptContext * ctx) { u32 decorId = VarGet(ScriptReadHalfword(ctx)); @@ -556,31 +556,31 @@ bool8 ScrCmd_checkdecor(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setflag(struct ScriptContext *ctx) +bool8 ScrCmd_setflag(struct ScriptContext * ctx) { FlagSet(ScriptReadHalfword(ctx)); return FALSE; } -bool8 ScrCmd_clearflag(struct ScriptContext *ctx) +bool8 ScrCmd_clearflag(struct ScriptContext * ctx) { FlagClear(ScriptReadHalfword(ctx)); return FALSE; } -bool8 ScrCmd_checkflag(struct ScriptContext *ctx) +bool8 ScrCmd_checkflag(struct ScriptContext * ctx) { ctx->comparisonResult = FlagGet(ScriptReadHalfword(ctx)); return FALSE; } -bool8 ScrCmd_incrementgamestat(struct ScriptContext *ctx) +bool8 ScrCmd_incrementgamestat(struct ScriptContext * ctx) { IncrementGameStat(ScriptReadByte(ctx)); return FALSE; } -bool8 ScrCmd_comparestattoword(struct ScriptContext *ctx) +bool8 ScrCmd_comparestattoword(struct ScriptContext * ctx) { u8 statIdx = ScriptReadByte(ctx); u32 value = ScriptReadWord(ctx); @@ -595,7 +595,7 @@ bool8 ScrCmd_comparestattoword(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setworldmapflag(struct ScriptContext *ctx) +bool8 ScrCmd_setworldmapflag(struct ScriptContext * ctx) { u16 value = ScriptReadHalfword(ctx); sub_8115748(value); @@ -603,14 +603,14 @@ bool8 ScrCmd_setworldmapflag(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_animateflash(struct ScriptContext *ctx) +bool8 ScrCmd_animateflash(struct ScriptContext * ctx) { AnimateFlash(ScriptReadByte(ctx)); ScriptContext1_Stop(); return TRUE; } -bool8 ScrCmd_setflashradius(struct ScriptContext *ctx) +bool8 ScrCmd_setflashradius(struct ScriptContext * ctx) { u16 flashLevel = VarGet(ScriptReadHalfword(ctx)); @@ -626,14 +626,14 @@ static bool8 IsPaletteNotActive(void) return FALSE; } -bool8 ScrCmd_fadescreen(struct ScriptContext *ctx) +bool8 ScrCmd_fadescreen(struct ScriptContext * ctx) { FadeScreen(ScriptReadByte(ctx), 0); SetupNativeScript(ctx, IsPaletteNotActive); return TRUE; } -bool8 ScrCmd_fadescreenspeed(struct ScriptContext *ctx) +bool8 ScrCmd_fadescreenspeed(struct ScriptContext * ctx) { u8 mode = ScriptReadByte(ctx); u8 speed = ScriptReadByte(ctx); @@ -653,14 +653,14 @@ static bool8 RunPauseTimer(void) return FALSE; } -bool8 ScrCmd_delay(struct ScriptContext *ctx) +bool8 ScrCmd_delay(struct ScriptContext * ctx) { sPauseCounter = ScriptReadHalfword(ctx); SetupNativeScript(ctx, RunPauseTimer); return TRUE; } -bool8 ScrCmd_initclock(struct ScriptContext *ctx) +bool8 ScrCmd_initclock(struct ScriptContext * ctx) { // u8 hour = VarGet(ScriptReadHalfword(ctx)); // u8 minute = VarGet(ScriptReadHalfword(ctx)); @@ -669,13 +669,13 @@ bool8 ScrCmd_initclock(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_dodailyevents(struct ScriptContext *ctx) +bool8 ScrCmd_dodailyevents(struct ScriptContext * ctx) { // DoTimeBasedEvents(); return FALSE; } -bool8 ScrCmd_gettime(struct ScriptContext *ctx) +bool8 ScrCmd_gettime(struct ScriptContext * ctx) { // RtcCalcLocalTime(); // gSpecialVar_0x8000 = gLocalTime.hours; @@ -687,7 +687,7 @@ bool8 ScrCmd_gettime(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setweather(struct ScriptContext *ctx) +bool8 ScrCmd_setweather(struct ScriptContext * ctx) { u16 weather = VarGet(ScriptReadHalfword(ctx)); @@ -695,25 +695,25 @@ bool8 ScrCmd_setweather(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_resetweather(struct ScriptContext *ctx) +bool8 ScrCmd_resetweather(struct ScriptContext * ctx) { SetSav1WeatherFromCurrMapHeader(); return FALSE; } -bool8 ScrCmd_doweather(struct ScriptContext *ctx) +bool8 ScrCmd_doweather(struct ScriptContext * ctx) { DoCurrentWeather(); return FALSE; } -bool8 ScrCmd_setstepcallback(struct ScriptContext *ctx) +bool8 ScrCmd_setstepcallback(struct ScriptContext * ctx) { ActivatePerStepCallback(ScriptReadByte(ctx)); return FALSE; } -bool8 ScrCmd_setmaplayoutindex(struct ScriptContext *ctx) +bool8 ScrCmd_setmaplayoutindex(struct ScriptContext * ctx) { u16 value = VarGet(ScriptReadHalfword(ctx)); @@ -721,7 +721,7 @@ bool8 ScrCmd_setmaplayoutindex(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_warp(struct ScriptContext *ctx) +bool8 ScrCmd_warp(struct ScriptContext * ctx) { u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); @@ -735,7 +735,7 @@ bool8 ScrCmd_warp(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_warpsilent(struct ScriptContext *ctx) +bool8 ScrCmd_warpsilent(struct ScriptContext * ctx) { u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); @@ -749,7 +749,7 @@ bool8 ScrCmd_warpsilent(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_warpdoor(struct ScriptContext *ctx) +bool8 ScrCmd_warpdoor(struct ScriptContext * ctx) { u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); @@ -763,7 +763,7 @@ bool8 ScrCmd_warpdoor(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_warphole(struct ScriptContext *ctx) +bool8 ScrCmd_warphole(struct ScriptContext * ctx) { u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); @@ -780,7 +780,7 @@ bool8 ScrCmd_warphole(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_warpteleport(struct ScriptContext *ctx) +bool8 ScrCmd_warpteleport(struct ScriptContext * ctx) { u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); @@ -794,7 +794,7 @@ bool8 ScrCmd_warpteleport(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_warpteleport2(struct ScriptContext *ctx) +bool8 ScrCmd_warpteleport2(struct ScriptContext * ctx) { u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); @@ -809,7 +809,7 @@ bool8 ScrCmd_warpteleport2(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_setwarp(struct ScriptContext *ctx) +bool8 ScrCmd_setwarp(struct ScriptContext * ctx) { u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); @@ -821,7 +821,7 @@ bool8 ScrCmd_setwarp(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setdynamicwarp(struct ScriptContext *ctx) +bool8 ScrCmd_setdynamicwarp(struct ScriptContext * ctx) { u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); @@ -833,7 +833,7 @@ bool8 ScrCmd_setdynamicwarp(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setdivewarp(struct ScriptContext *ctx) +bool8 ScrCmd_setdivewarp(struct ScriptContext * ctx) { u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); @@ -845,7 +845,7 @@ bool8 ScrCmd_setdivewarp(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setholewarp(struct ScriptContext *ctx) +bool8 ScrCmd_setholewarp(struct ScriptContext * ctx) { u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); @@ -857,7 +857,7 @@ bool8 ScrCmd_setholewarp(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setescapewarp(struct ScriptContext *ctx) +bool8 ScrCmd_setescapewarp(struct ScriptContext * ctx) { u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); @@ -869,7 +869,7 @@ bool8 ScrCmd_setescapewarp(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_getplayerxy(struct ScriptContext *ctx) +bool8 ScrCmd_getplayerxy(struct ScriptContext * ctx) { u16 *pX = GetVarPointer(ScriptReadHalfword(ctx)); u16 *pY = GetVarPointer(ScriptReadHalfword(ctx)); @@ -879,13 +879,13 @@ bool8 ScrCmd_getplayerxy(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_getpartysize(struct ScriptContext *ctx) +bool8 ScrCmd_getpartysize(struct ScriptContext * ctx) { gSpecialVar_Result = CalculatePlayerPartyCount(); return FALSE; } -bool8 ScrCmd_playse(struct ScriptContext *ctx) +bool8 ScrCmd_playse(struct ScriptContext * ctx) { PlaySE(ScriptReadHalfword(ctx)); return FALSE; @@ -899,13 +899,13 @@ static bool8 WaitForSoundEffectFinish(void) return FALSE; } -bool8 ScrCmd_waitse(struct ScriptContext *ctx) +bool8 ScrCmd_waitse(struct ScriptContext * ctx) { SetupNativeScript(ctx, WaitForSoundEffectFinish); return TRUE; } -bool8 ScrCmd_playfanfare(struct ScriptContext *ctx) +bool8 ScrCmd_playfanfare(struct ScriptContext * ctx) { PlayFanfare(ScriptReadHalfword(ctx)); return FALSE; @@ -916,13 +916,13 @@ static bool8 WaitForFanfareFinish(void) return IsFanfareTaskInactive(); } -bool8 ScrCmd_waitfanfare(struct ScriptContext *ctx) +bool8 ScrCmd_waitfanfare(struct ScriptContext * ctx) { SetupNativeScript(ctx, WaitForFanfareFinish); return TRUE; } -bool8 ScrCmd_playbgm(struct ScriptContext *ctx) +bool8 ScrCmd_playbgm(struct ScriptContext * ctx) { u16 songId = ScriptReadHalfword(ctx); bool8 val = ScriptReadByte(ctx); @@ -935,13 +935,13 @@ bool8 ScrCmd_playbgm(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_savebgm(struct ScriptContext *ctx) +bool8 ScrCmd_savebgm(struct ScriptContext * ctx) { Overworld_SetSavedMusic(ScriptReadHalfword(ctx)); return FALSE; } -bool8 ScrCmd_fadedefaultbgm(struct ScriptContext *ctx) +bool8 ScrCmd_fadedefaultbgm(struct ScriptContext * ctx) { if (gQuestLogState == 2 || gQuestLogState == 3) return FALSE; @@ -949,7 +949,7 @@ bool8 ScrCmd_fadedefaultbgm(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_fadenewbgm(struct ScriptContext *ctx) +bool8 ScrCmd_fadenewbgm(struct ScriptContext * ctx) { u16 music = ScriptReadHalfword(ctx); if (gQuestLogState == 2 || gQuestLogState == 3) @@ -958,7 +958,7 @@ bool8 ScrCmd_fadenewbgm(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_fadeoutbgm(struct ScriptContext *ctx) +bool8 ScrCmd_fadeoutbgm(struct ScriptContext * ctx) { u8 speed = ScriptReadByte(ctx); @@ -972,7 +972,7 @@ bool8 ScrCmd_fadeoutbgm(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_fadeinbgm(struct ScriptContext *ctx) +bool8 ScrCmd_fadeinbgm(struct ScriptContext * ctx) { u8 speed = ScriptReadByte(ctx); @@ -985,7 +985,7 @@ bool8 ScrCmd_fadeinbgm(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_applymovement(struct ScriptContext *ctx) +bool8 ScrCmd_applymovement(struct ScriptContext * ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); const void *movementScript = (const void *)ScriptReadWord(ctx); @@ -995,7 +995,7 @@ bool8 ScrCmd_applymovement(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_applymovement_at(struct ScriptContext *ctx) +bool8 ScrCmd_applymovement_at(struct ScriptContext * ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); const void *movementScript = (const void *)ScriptReadWord(ctx); @@ -1012,7 +1012,7 @@ static bool8 WaitForMovementFinish(void) return ScriptMovement_IsObjectMovementFinished(sMovingNpcId, sMovingNpcMapId, sMovingNpcMapBank); } -bool8 ScrCmd_waitmovement(struct ScriptContext *ctx) +bool8 ScrCmd_waitmovement(struct ScriptContext * ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); @@ -1024,7 +1024,7 @@ bool8 ScrCmd_waitmovement(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_waitmovement_at(struct ScriptContext *ctx) +bool8 ScrCmd_waitmovement_at(struct ScriptContext * ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); u8 mapBank; @@ -1040,7 +1040,7 @@ bool8 ScrCmd_waitmovement_at(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_removeobject(struct ScriptContext *ctx) +bool8 ScrCmd_removeobject(struct ScriptContext * ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); @@ -1048,7 +1048,7 @@ bool8 ScrCmd_removeobject(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_removeobject_at(struct ScriptContext *ctx) +bool8 ScrCmd_removeobject_at(struct ScriptContext * ctx) { u16 objectId = VarGet(ScriptReadHalfword(ctx)); u8 mapGroup = ScriptReadByte(ctx); @@ -1058,7 +1058,7 @@ bool8 ScrCmd_removeobject_at(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_addobject(struct ScriptContext *ctx) +bool8 ScrCmd_addobject(struct ScriptContext * ctx) { u16 objectId = VarGet(ScriptReadHalfword(ctx)); @@ -1066,7 +1066,7 @@ bool8 ScrCmd_addobject(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_addobject_at(struct ScriptContext *ctx) +bool8 ScrCmd_addobject_at(struct ScriptContext * ctx) { u16 objectId = VarGet(ScriptReadHalfword(ctx)); u8 mapGroup = ScriptReadByte(ctx); @@ -1076,7 +1076,7 @@ bool8 ScrCmd_addobject_at(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setobjectxy(struct ScriptContext *ctx) +bool8 ScrCmd_setobjectxy(struct ScriptContext * ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); u16 x = VarGet(ScriptReadHalfword(ctx)); @@ -1086,7 +1086,7 @@ bool8 ScrCmd_setobjectxy(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setobjectxyperm(struct ScriptContext *ctx) +bool8 ScrCmd_setobjectxyperm(struct ScriptContext * ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); u16 x = VarGet(ScriptReadHalfword(ctx)); @@ -1096,7 +1096,7 @@ bool8 ScrCmd_setobjectxyperm(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_moveobjectoffscreen(struct ScriptContext *ctx) +bool8 ScrCmd_moveobjectoffscreen(struct ScriptContext * ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); @@ -1104,7 +1104,7 @@ bool8 ScrCmd_moveobjectoffscreen(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_showobject_at(struct ScriptContext *ctx) +bool8 ScrCmd_showobject_at(struct ScriptContext * ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); u8 mapGroup = ScriptReadByte(ctx); @@ -1114,7 +1114,7 @@ bool8 ScrCmd_showobject_at(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_hideobject_at(struct ScriptContext *ctx) +bool8 ScrCmd_hideobject_at(struct ScriptContext * ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); u8 mapGroup = ScriptReadByte(ctx); @@ -1124,7 +1124,7 @@ bool8 ScrCmd_hideobject_at(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setobjectpriority(struct ScriptContext *ctx) +bool8 ScrCmd_setobjectpriority(struct ScriptContext * ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); u8 mapGroup = ScriptReadByte(ctx); @@ -1135,7 +1135,7 @@ bool8 ScrCmd_setobjectpriority(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_resetobjectpriority(struct ScriptContext *ctx) +bool8 ScrCmd_resetobjectpriority(struct ScriptContext * ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); u8 mapGroup = ScriptReadByte(ctx); @@ -1145,7 +1145,7 @@ bool8 ScrCmd_resetobjectpriority(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_faceplayer(struct ScriptContext *ctx) +bool8 ScrCmd_faceplayer(struct ScriptContext * ctx) { if (gObjectEvents[gSelectedObjectEvent].active) { @@ -1155,7 +1155,7 @@ bool8 ScrCmd_faceplayer(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_turnobject(struct ScriptContext *ctx) +bool8 ScrCmd_turnobject(struct ScriptContext * ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); u8 direction = ScriptReadByte(ctx); @@ -1164,7 +1164,7 @@ bool8 ScrCmd_turnobject(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setobjectmovementtype(struct ScriptContext *ctx) +bool8 ScrCmd_setobjectmovementtype(struct ScriptContext * ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); u8 movementType = ScriptReadByte(ctx); @@ -1173,7 +1173,7 @@ bool8 ScrCmd_setobjectmovementtype(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_createvobject(struct ScriptContext *ctx) +bool8 ScrCmd_createvobject(struct ScriptContext * ctx) { u8 graphicsId = ScriptReadByte(ctx); u8 v2 = ScriptReadByte(ctx); @@ -1186,7 +1186,7 @@ bool8 ScrCmd_createvobject(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_turnvobject(struct ScriptContext *ctx) +bool8 ScrCmd_turnvobject(struct ScriptContext * ctx) { u8 v1 = ScriptReadByte(ctx); u8 direction = ScriptReadByte(ctx); @@ -1195,7 +1195,7 @@ bool8 ScrCmd_turnvobject(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_lockall(struct ScriptContext *ctx) +bool8 ScrCmd_lockall(struct ScriptContext * ctx) { if (IsUpdateLinkStateCBActive()) { @@ -1209,7 +1209,7 @@ bool8 ScrCmd_lockall(struct ScriptContext *ctx) } } -bool8 ScrCmd_lock(struct ScriptContext *ctx) +bool8 ScrCmd_lock(struct ScriptContext * ctx) { if (IsUpdateLinkStateCBActive()) { @@ -1231,7 +1231,7 @@ bool8 ScrCmd_lock(struct ScriptContext *ctx) } } -bool8 ScrCmd_releaseall(struct ScriptContext *ctx) +bool8 ScrCmd_releaseall(struct ScriptContext * ctx) { u8 playerObjectId; @@ -1243,7 +1243,7 @@ bool8 ScrCmd_releaseall(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_release(struct ScriptContext *ctx) +bool8 ScrCmd_release(struct ScriptContext * ctx) { u8 playerObjectId; @@ -1257,14 +1257,14 @@ bool8 ScrCmd_release(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_textcolor(struct ScriptContext *ctx) +bool8 ScrCmd_textcolor(struct ScriptContext * ctx) { gSpecialVar_PrevTextColor = gSpecialVar_TextColor; gSpecialVar_TextColor = ScriptReadByte(ctx); return FALSE; } -bool8 ScrCmd_message(struct ScriptContext *ctx) +bool8 ScrCmd_message(struct ScriptContext * ctx) { const u8 *msg = (const u8 *)ScriptReadWord(ctx); @@ -1274,7 +1274,7 @@ bool8 ScrCmd_message(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_loadhelp(struct ScriptContext *ctx) +bool8 ScrCmd_loadhelp(struct ScriptContext * ctx) { const u8 *msg = (const u8 *)ScriptReadWord(ctx); @@ -1285,13 +1285,13 @@ bool8 ScrCmd_loadhelp(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_unloadhelp(struct ScriptContext *ctx) +bool8 ScrCmd_unloadhelp(struct ScriptContext * ctx) { DestroyHelpMessageWindow_(); return FALSE; } -bool8 ScrCmd_messageautoscroll(struct ScriptContext *ctx) +bool8 ScrCmd_messageautoscroll(struct ScriptContext * ctx) { const u8 *msg = (const u8 *)ScriptReadWord(ctx); @@ -1301,13 +1301,13 @@ bool8 ScrCmd_messageautoscroll(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_waitmessage(struct ScriptContext *ctx) +bool8 ScrCmd_waitmessage(struct ScriptContext * ctx) { SetupNativeScript(ctx, IsFieldMessageBoxHidden); return TRUE; } -bool8 ScrCmd_closemessage(struct ScriptContext *ctx) +bool8 ScrCmd_closemessage(struct ScriptContext * ctx) { HideFieldMessageBox(); return FALSE; @@ -1401,7 +1401,7 @@ static u8 sub_806B96C(struct ScriptContext * ctx) return 0; } -bool8 ScrCmd_waitbuttonpress(struct ScriptContext *ctx) +bool8 ScrCmd_waitbuttonpress(struct ScriptContext * ctx) { gUnknown_3005070 = ctx; @@ -1411,7 +1411,7 @@ bool8 ScrCmd_waitbuttonpress(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_yesnobox(struct ScriptContext *ctx) +bool8 ScrCmd_yesnobox(struct ScriptContext * ctx) { u8 left = ScriptReadByte(ctx); u8 top = ScriptReadByte(ctx); @@ -1427,7 +1427,7 @@ bool8 ScrCmd_yesnobox(struct ScriptContext *ctx) } } -bool8 ScrCmd_multichoice(struct ScriptContext *ctx) +bool8 ScrCmd_multichoice(struct ScriptContext * ctx) { u8 left = ScriptReadByte(ctx); u8 top = ScriptReadByte(ctx); @@ -1445,7 +1445,7 @@ bool8 ScrCmd_multichoice(struct ScriptContext *ctx) } } -bool8 ScrCmd_multichoicedefault(struct ScriptContext *ctx) +bool8 ScrCmd_multichoicedefault(struct ScriptContext * ctx) { u8 left = ScriptReadByte(ctx); u8 top = ScriptReadByte(ctx); @@ -1464,7 +1464,7 @@ bool8 ScrCmd_multichoicedefault(struct ScriptContext *ctx) } } -bool8 ScrCmd_drawbox(struct ScriptContext *ctx) +bool8 ScrCmd_drawbox(struct ScriptContext * ctx) { /*u8 left = ScriptReadByte(ctx); u8 top = ScriptReadByte(ctx); @@ -1475,7 +1475,7 @@ bool8 ScrCmd_drawbox(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_multichoicegrid(struct ScriptContext *ctx) +bool8 ScrCmd_multichoicegrid(struct ScriptContext * ctx) { u8 left = ScriptReadByte(ctx); u8 top = ScriptReadByte(ctx); @@ -1494,7 +1494,7 @@ bool8 ScrCmd_multichoicegrid(struct ScriptContext *ctx) } } -bool8 ScrCmd_erasebox(struct ScriptContext *ctx) +bool8 ScrCmd_erasebox(struct ScriptContext * ctx) { u8 left = ScriptReadByte(ctx); u8 top = ScriptReadByte(ctx); @@ -1505,7 +1505,7 @@ bool8 ScrCmd_erasebox(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_drawboxtext(struct ScriptContext *ctx) +bool8 ScrCmd_drawboxtext(struct ScriptContext * ctx) { // u8 left = ScriptReadByte(ctx); // u8 top = ScriptReadByte(ctx); @@ -1520,7 +1520,7 @@ bool8 ScrCmd_drawboxtext(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_showmonpic(struct ScriptContext *ctx) +bool8 ScrCmd_showmonpic(struct ScriptContext * ctx) { u16 species = VarGet(ScriptReadHalfword(ctx)); u8 x = ScriptReadByte(ctx); @@ -1531,7 +1531,7 @@ bool8 ScrCmd_showmonpic(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_hidemonpic(struct ScriptContext *ctx) +bool8 ScrCmd_hidemonpic(struct ScriptContext * ctx) { bool8 (*func)(void) = ScriptMenu_GetPicboxWaitFunc(); @@ -1541,7 +1541,7 @@ bool8 ScrCmd_hidemonpic(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_showcontestwinner(struct ScriptContext *ctx) +bool8 ScrCmd_showcontestwinner(struct ScriptContext * ctx) { u8 v1 = ScriptReadByte(ctx); @@ -1556,7 +1556,7 @@ bool8 ScrCmd_showcontestwinner(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_braillemessage(struct ScriptContext *ctx) +bool8 ScrCmd_braillemessage(struct ScriptContext * ctx) { u8 *ptr = (u8 *)ScriptReadWord(ctx); if (ptr == NULL) @@ -1568,7 +1568,7 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_getbraillestringwidth(struct ScriptContext *ctx) +bool8 ScrCmd_getbraillestringwidth(struct ScriptContext * ctx) { u8 *ptr = (u8 *)ScriptReadWord(ctx); if (ptr == NULL) @@ -1578,7 +1578,7 @@ bool8 ScrCmd_getbraillestringwidth(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_vmessage(struct ScriptContext *ctx) +bool8 ScrCmd_vmessage(struct ScriptContext * ctx) { u32 v1 = ScriptReadWord(ctx); @@ -1586,14 +1586,14 @@ bool8 ScrCmd_vmessage(struct ScriptContext *ctx) return FALSE; } -u8 * const sScriptStringVars[] = +u8 *const sScriptStringVars[] = { gStringVar1, gStringVar2, gStringVar3, }; -bool8 ScrCmd_bufferspeciesname(struct ScriptContext *ctx) +bool8 ScrCmd_bufferspeciesname(struct ScriptContext * ctx) { u8 stringVarIndex = ScriptReadByte(ctx); u16 species = VarGet(ScriptReadHalfword(ctx)); @@ -1602,7 +1602,7 @@ bool8 ScrCmd_bufferspeciesname(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_bufferleadmonspeciesname(struct ScriptContext *ctx) +bool8 ScrCmd_bufferleadmonspeciesname(struct ScriptContext * ctx) { u8 stringVarIndex = ScriptReadByte(ctx); @@ -1613,7 +1613,7 @@ bool8 ScrCmd_bufferleadmonspeciesname(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_bufferpartymonnick(struct ScriptContext *ctx) +bool8 ScrCmd_bufferpartymonnick(struct ScriptContext * ctx) { u8 stringVarIndex = ScriptReadByte(ctx); u16 partyIndex = VarGet(ScriptReadHalfword(ctx)); @@ -1623,7 +1623,7 @@ bool8 ScrCmd_bufferpartymonnick(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_bufferitemname(struct ScriptContext *ctx) +bool8 ScrCmd_bufferitemname(struct ScriptContext * ctx) { u8 stringVarIndex = ScriptReadByte(ctx); u16 itemId = VarGet(ScriptReadHalfword(ctx)); @@ -1635,7 +1635,7 @@ bool8 ScrCmd_bufferitemname(struct ScriptContext *ctx) const u8 gUnknown_83A72A0[] = _("S"); const u8 gUnknown_83A72A2[] = _("IES"); -bool8 ScrCmd_bufferitemnameplural(struct ScriptContext *ctx) +bool8 ScrCmd_bufferitemnameplural(struct ScriptContext * ctx) { u8 stringVarIndex = ScriptReadByte(ctx); u16 itemId = VarGet(ScriptReadHalfword(ctx)); @@ -1658,7 +1658,7 @@ bool8 ScrCmd_bufferitemnameplural(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_bufferdecorationname(struct ScriptContext *ctx) +bool8 ScrCmd_bufferdecorationname(struct ScriptContext * ctx) { u8 stringVarIndex = ScriptReadByte(ctx); u16 decorId = VarGet(ScriptReadHalfword(ctx)); @@ -1667,7 +1667,7 @@ bool8 ScrCmd_bufferdecorationname(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_buffermovename(struct ScriptContext *ctx) +bool8 ScrCmd_buffermovename(struct ScriptContext * ctx) { u8 stringVarIndex = ScriptReadByte(ctx); u16 moveId = VarGet(ScriptReadHalfword(ctx)); @@ -1676,7 +1676,7 @@ bool8 ScrCmd_buffermovename(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_buffernumberstring(struct ScriptContext *ctx) +bool8 ScrCmd_buffernumberstring(struct ScriptContext * ctx) { u8 stringVarIndex = ScriptReadByte(ctx); u16 v1 = VarGet(ScriptReadHalfword(ctx)); @@ -1686,7 +1686,7 @@ bool8 ScrCmd_buffernumberstring(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_bufferstdstring(struct ScriptContext *ctx) +bool8 ScrCmd_bufferstdstring(struct ScriptContext * ctx) { u8 stringVarIndex = ScriptReadByte(ctx); u16 index = VarGet(ScriptReadHalfword(ctx)); @@ -1696,7 +1696,7 @@ bool8 ScrCmd_bufferstdstring(struct ScriptContext *ctx) } /* -bool8 ScrCmd_buffercontesttype(struct ScriptContext *ctx) +bool8 ScrCmd_buffercontesttype(struct ScriptContext * ctx) { u8 stringVarIndex = ScriptReadByte(ctx); u16 index = VarGet(ScriptReadHalfword(ctx)); @@ -1706,7 +1706,7 @@ bool8 ScrCmd_buffercontesttype(struct ScriptContext *ctx) } */ -bool8 ScrCmd_bufferstring(struct ScriptContext *ctx) +bool8 ScrCmd_bufferstring(struct ScriptContext * ctx) { u8 stringVarIndex = ScriptReadByte(ctx); const u8 *text = (u8 *)ScriptReadWord(ctx); @@ -1715,7 +1715,7 @@ bool8 ScrCmd_bufferstring(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_vloadword(struct ScriptContext *ctx) +bool8 ScrCmd_vloadword(struct ScriptContext * ctx) { const u8 *ptr = (u8 *)(ScriptReadWord(ctx) - gVScriptOffset); @@ -1723,7 +1723,7 @@ bool8 ScrCmd_vloadword(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_vbufferstring(struct ScriptContext *ctx) +bool8 ScrCmd_vbufferstring(struct ScriptContext * ctx) { u8 stringVarIndex = ScriptReadByte(ctx); u32 addr = ScriptReadWord(ctx); @@ -1734,7 +1734,7 @@ bool8 ScrCmd_vbufferstring(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_bufferboxname(struct ScriptContext *ctx) +bool8 ScrCmd_bufferboxname(struct ScriptContext * ctx) { u8 stringVarIndex = ScriptReadByte(ctx); u16 boxId = VarGet(ScriptReadHalfword(ctx)); @@ -1743,7 +1743,7 @@ bool8 ScrCmd_bufferboxname(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_givemon(struct ScriptContext *ctx) +bool8 ScrCmd_givemon(struct ScriptContext * ctx) { u16 species = VarGet(ScriptReadHalfword(ctx)); u8 level = ScriptReadByte(ctx); @@ -1756,7 +1756,7 @@ bool8 ScrCmd_givemon(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_giveegg(struct ScriptContext *ctx) +bool8 ScrCmd_giveegg(struct ScriptContext * ctx) { u16 species = VarGet(ScriptReadHalfword(ctx)); @@ -1764,7 +1764,7 @@ bool8 ScrCmd_giveegg(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setmonmove(struct ScriptContext *ctx) +bool8 ScrCmd_setmonmove(struct ScriptContext * ctx) { u8 partyIndex = ScriptReadByte(ctx); u8 slot = ScriptReadByte(ctx); @@ -1774,7 +1774,7 @@ bool8 ScrCmd_setmonmove(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_checkpartymove(struct ScriptContext *ctx) +bool8 ScrCmd_checkpartymove(struct ScriptContext * ctx) { u8 i; u16 moveId = ScriptReadHalfword(ctx); @@ -1795,7 +1795,7 @@ bool8 ScrCmd_checkpartymove(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_addmoney(struct ScriptContext *ctx) +bool8 ScrCmd_addmoney(struct ScriptContext * ctx) { u32 amount = ScriptReadWord(ctx); u8 ignore = ScriptReadByte(ctx); @@ -1805,7 +1805,7 @@ bool8 ScrCmd_addmoney(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_removemoney(struct ScriptContext *ctx) +bool8 ScrCmd_removemoney(struct ScriptContext * ctx) { u32 amount = ScriptReadWord(ctx); u8 ignore = ScriptReadByte(ctx); @@ -1815,7 +1815,7 @@ bool8 ScrCmd_removemoney(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_checkmoney(struct ScriptContext *ctx) +bool8 ScrCmd_checkmoney(struct ScriptContext * ctx) { u32 amount = ScriptReadWord(ctx); u8 ignore = ScriptReadByte(ctx); @@ -1825,7 +1825,7 @@ bool8 ScrCmd_checkmoney(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_showmoneybox(struct ScriptContext *ctx) +bool8 ScrCmd_showmoneybox(struct ScriptContext * ctx) { u8 x = ScriptReadByte(ctx); u8 y = ScriptReadByte(ctx); @@ -1836,7 +1836,7 @@ bool8 ScrCmd_showmoneybox(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_hidemoneybox(struct ScriptContext *ctx) +bool8 ScrCmd_hidemoneybox(struct ScriptContext * ctx) { /*u8 x = ScriptReadByte(ctx); u8 y = ScriptReadByte(ctx);*/ @@ -1845,7 +1845,7 @@ bool8 ScrCmd_hidemoneybox(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_updatemoneybox(struct ScriptContext *ctx) +bool8 ScrCmd_updatemoneybox(struct ScriptContext * ctx) { u8 x = ScriptReadByte(ctx); u8 y = ScriptReadByte(ctx); @@ -1856,7 +1856,7 @@ bool8 ScrCmd_updatemoneybox(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_showcoinsbox(struct ScriptContext *ctx) +bool8 ScrCmd_showcoinsbox(struct ScriptContext * ctx) { u8 x = ScriptReadByte(ctx); u8 y = ScriptReadByte(ctx); @@ -1866,7 +1866,7 @@ bool8 ScrCmd_showcoinsbox(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_hidecoinsbox(struct ScriptContext *ctx) +bool8 ScrCmd_hidecoinsbox(struct ScriptContext * ctx) { u8 x = ScriptReadByte(ctx); u8 y = ScriptReadByte(ctx); @@ -1875,7 +1875,7 @@ bool8 ScrCmd_hidecoinsbox(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_updatecoinsbox(struct ScriptContext *ctx) +bool8 ScrCmd_updatecoinsbox(struct ScriptContext * ctx) { u8 x = ScriptReadByte(ctx); u8 y = ScriptReadByte(ctx); @@ -1884,31 +1884,31 @@ bool8 ScrCmd_updatecoinsbox(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_trainerbattle(struct ScriptContext *ctx) +bool8 ScrCmd_trainerbattle(struct ScriptContext * ctx) { ctx->scriptPtr = BattleSetup_ConfigureTrainerBattle(ctx->scriptPtr); return FALSE; } -bool8 ScrCmd_dotrainerbattle(struct ScriptContext *ctx) +bool8 ScrCmd_dotrainerbattle(struct ScriptContext * ctx) { StartTrainerBattle(); return TRUE; } -bool8 ScrCmd_gotopostbattlescript(struct ScriptContext *ctx) +bool8 ScrCmd_gotopostbattlescript(struct ScriptContext * ctx) { ctx->scriptPtr = BattleSetup_GetScriptAddrAfterBattle(); return FALSE; } -bool8 ScrCmd_gotobeatenscript(struct ScriptContext *ctx) +bool8 ScrCmd_gotobeatenscript(struct ScriptContext * ctx) { ctx->scriptPtr = BattleSetup_GetTrainerPostBattleScript(); return FALSE; } -bool8 ScrCmd_checktrainerflag(struct ScriptContext *ctx) +bool8 ScrCmd_checktrainerflag(struct ScriptContext * ctx) { u16 index = VarGet(ScriptReadHalfword(ctx)); @@ -1916,7 +1916,7 @@ bool8 ScrCmd_checktrainerflag(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_settrainerflag(struct ScriptContext *ctx) +bool8 ScrCmd_settrainerflag(struct ScriptContext * ctx) { u16 index = VarGet(ScriptReadHalfword(ctx)); @@ -1924,7 +1924,7 @@ bool8 ScrCmd_settrainerflag(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_cleartrainerflag(struct ScriptContext *ctx) +bool8 ScrCmd_cleartrainerflag(struct ScriptContext * ctx) { u16 index = VarGet(ScriptReadHalfword(ctx)); @@ -1932,7 +1932,7 @@ bool8 ScrCmd_cleartrainerflag(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setwildbattle(struct ScriptContext *ctx) +bool8 ScrCmd_setwildbattle(struct ScriptContext * ctx) { u16 species = ScriptReadHalfword(ctx); u8 level = ScriptReadByte(ctx); @@ -1942,14 +1942,14 @@ bool8 ScrCmd_setwildbattle(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_dowildbattle(struct ScriptContext *ctx) +bool8 ScrCmd_dowildbattle(struct ScriptContext * ctx) { StartScriptedWildBattle(); ScriptContext1_Stop(); return TRUE; } -bool8 ScrCmd_pokemart(struct ScriptContext *ctx) +bool8 ScrCmd_pokemart(struct ScriptContext * ctx) { const void *ptr = (void *)ScriptReadWord(ctx); @@ -1958,7 +1958,7 @@ bool8 ScrCmd_pokemart(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_pokemartdecoration(struct ScriptContext *ctx) +bool8 ScrCmd_pokemartdecoration(struct ScriptContext * ctx) { const void *ptr = (void *)ScriptReadWord(ctx); @@ -1967,7 +1967,7 @@ bool8 ScrCmd_pokemartdecoration(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_pokemartdecoration2(struct ScriptContext *ctx) +bool8 ScrCmd_pokemartdecoration2(struct ScriptContext * ctx) { const void *ptr = (void *)ScriptReadWord(ctx); @@ -1976,7 +1976,7 @@ bool8 ScrCmd_pokemartdecoration2(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_playslotmachine(struct ScriptContext *ctx) +bool8 ScrCmd_playslotmachine(struct ScriptContext * ctx) { u8 slotMachineIndex = VarGet(ScriptReadHalfword(ctx)); @@ -1985,7 +1985,7 @@ bool8 ScrCmd_playslotmachine(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_setberrytree(struct ScriptContext *ctx) +bool8 ScrCmd_setberrytree(struct ScriptContext * ctx) { // u8 treeId = ScriptReadByte(ctx); // u8 berry = ScriptReadByte(ctx); @@ -1998,7 +1998,7 @@ bool8 ScrCmd_setberrytree(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_getpricereduction(struct ScriptContext *ctx) +bool8 ScrCmd_getpricereduction(struct ScriptContext * ctx) { // u16 value = VarGet(ScriptReadHalfword(ctx)); // @@ -2006,7 +2006,7 @@ bool8 ScrCmd_getpricereduction(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_choosecontestmon(struct ScriptContext *ctx) +bool8 ScrCmd_choosecontestmon(struct ScriptContext * ctx) { // sub_81B9404(); ScriptContext1_Stop(); @@ -2014,7 +2014,7 @@ bool8 ScrCmd_choosecontestmon(struct ScriptContext *ctx) } -bool8 ScrCmd_startcontest(struct ScriptContext *ctx) +bool8 ScrCmd_startcontest(struct ScriptContext * ctx) { // sub_80F840C(); // ScriptContext1_Stop(); @@ -2022,7 +2022,7 @@ bool8 ScrCmd_startcontest(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_showcontestresults(struct ScriptContext *ctx) +bool8 ScrCmd_showcontestresults(struct ScriptContext * ctx) { // sub_80F8484(); // ScriptContext1_Stop(); @@ -2030,7 +2030,7 @@ bool8 ScrCmd_showcontestresults(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_contestlinktransfer(struct ScriptContext *ctx) +bool8 ScrCmd_contestlinktransfer(struct ScriptContext * ctx) { // sub_80F84C4(gSpecialVar_ContestCategory); // ScriptContext1_Stop(); @@ -2038,7 +2038,7 @@ bool8 ScrCmd_contestlinktransfer(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_dofieldeffect(struct ScriptContext *ctx) +bool8 ScrCmd_dofieldeffect(struct ScriptContext * ctx) { u16 effectId = VarGet(ScriptReadHalfword(ctx)); @@ -2047,7 +2047,7 @@ bool8 ScrCmd_dofieldeffect(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setfieldeffectarg(struct ScriptContext *ctx) +bool8 ScrCmd_setfieldeffectarg(struct ScriptContext * ctx) { u8 argNum = ScriptReadByte(ctx); @@ -2063,14 +2063,14 @@ static bool8 WaitForFieldEffectFinish(void) return FALSE; } -bool8 ScrCmd_waitfieldeffect(struct ScriptContext *ctx) +bool8 ScrCmd_waitfieldeffect(struct ScriptContext * ctx) { sFieldEffectScriptId = VarGet(ScriptReadHalfword(ctx)); SetupNativeScript(ctx, WaitForFieldEffectFinish); return TRUE; } -bool8 ScrCmd_setrespawn(struct ScriptContext *ctx) +bool8 ScrCmd_setrespawn(struct ScriptContext * ctx) { u16 healLocationId = VarGet(ScriptReadHalfword(ctx)); @@ -2078,13 +2078,13 @@ bool8 ScrCmd_setrespawn(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_checkplayergender(struct ScriptContext *ctx) +bool8 ScrCmd_checkplayergender(struct ScriptContext * ctx) { gSpecialVar_Result = gSaveBlock2Ptr->playerGender; return FALSE; } -bool8 ScrCmd_playmoncry(struct ScriptContext *ctx) +bool8 ScrCmd_playmoncry(struct ScriptContext * ctx) { u16 species = VarGet(ScriptReadHalfword(ctx)); u16 mode = VarGet(ScriptReadHalfword(ctx)); @@ -2093,13 +2093,13 @@ bool8 ScrCmd_playmoncry(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_waitmoncry(struct ScriptContext *ctx) +bool8 ScrCmd_waitmoncry(struct ScriptContext * ctx) { SetupNativeScript(ctx, IsCryFinished); return TRUE; } -bool8 ScrCmd_setmetatile(struct ScriptContext *ctx) +bool8 ScrCmd_setmetatile(struct ScriptContext * ctx) { u16 x = VarGet(ScriptReadHalfword(ctx)); u16 y = VarGet(ScriptReadHalfword(ctx)); @@ -2115,7 +2115,7 @@ bool8 ScrCmd_setmetatile(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_opendoor(struct ScriptContext *ctx) +bool8 ScrCmd_opendoor(struct ScriptContext * ctx) { u16 x = VarGet(ScriptReadHalfword(ctx)); u16 y = VarGet(ScriptReadHalfword(ctx)); @@ -2127,7 +2127,7 @@ bool8 ScrCmd_opendoor(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_closedoor(struct ScriptContext *ctx) +bool8 ScrCmd_closedoor(struct ScriptContext * ctx) { u16 x = VarGet(ScriptReadHalfword(ctx)); u16 y = VarGet(ScriptReadHalfword(ctx)); @@ -2146,13 +2146,13 @@ static bool8 IsDoorAnimationStopped(void) return FALSE; } -bool8 ScrCmd_waitdooranim(struct ScriptContext *ctx) +bool8 ScrCmd_waitdooranim(struct ScriptContext * ctx) { SetupNativeScript(ctx, IsDoorAnimationStopped); return TRUE; } -bool8 ScrCmd_setdooropen(struct ScriptContext *ctx) +bool8 ScrCmd_setdooropen(struct ScriptContext * ctx) { u16 x = VarGet(ScriptReadHalfword(ctx)); u16 y = VarGet(ScriptReadHalfword(ctx)); @@ -2163,7 +2163,7 @@ bool8 ScrCmd_setdooropen(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setdoorclosed(struct ScriptContext *ctx) +bool8 ScrCmd_setdoorclosed(struct ScriptContext * ctx) { u16 x = VarGet(ScriptReadHalfword(ctx)); u16 y = VarGet(ScriptReadHalfword(ctx)); @@ -2174,7 +2174,7 @@ bool8 ScrCmd_setdoorclosed(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_addelevmenuitem(struct ScriptContext *ctx) +bool8 ScrCmd_addelevmenuitem(struct ScriptContext * ctx) { // u8 v3 = ScriptReadByte(ctx); // u16 v5 = VarGet(ScriptReadHalfword(ctx)); @@ -2185,7 +2185,7 @@ bool8 ScrCmd_addelevmenuitem(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_showelevmenu(struct ScriptContext *ctx) +bool8 ScrCmd_showelevmenu(struct ScriptContext * ctx) { /*ScriptShowElevatorMenu(); ScriptContext1_Stop(); @@ -2193,14 +2193,14 @@ bool8 ScrCmd_showelevmenu(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_checkcoins(struct ScriptContext *ctx) +bool8 ScrCmd_checkcoins(struct ScriptContext * ctx) { u16 *ptr = GetVarPointer(ScriptReadHalfword(ctx)); *ptr = GetCoins(); return FALSE; } -bool8 ScrCmd_addcoins(struct ScriptContext *ctx) +bool8 ScrCmd_addcoins(struct ScriptContext * ctx) { u16 coins = VarGet(ScriptReadHalfword(ctx)); @@ -2211,7 +2211,7 @@ bool8 ScrCmd_addcoins(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_removecoins(struct ScriptContext *ctx) +bool8 ScrCmd_removecoins(struct ScriptContext * ctx) { u16 coins = VarGet(ScriptReadHalfword(ctx)); @@ -2222,20 +2222,20 @@ bool8 ScrCmd_removecoins(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_signmsg(struct ScriptContext *ctx) +bool8 ScrCmd_signmsg(struct ScriptContext * ctx) { sub_8069A20(); return FALSE; } -bool8 ScrCmd_normalmsg(struct ScriptContext *ctx) +bool8 ScrCmd_normalmsg(struct ScriptContext * ctx) { sub_8069A2C(); return FALSE; } // This command will force the Pokémon to be obedient, you don't get to make it disobedient. -bool8 ScrCmd_setmonobedient(struct ScriptContext *ctx) +bool8 ScrCmd_setmonobedient(struct ScriptContext * ctx) { bool8 obedient = TRUE; u16 partyIndex = VarGet(ScriptReadHalfword(ctx)); @@ -2244,7 +2244,7 @@ bool8 ScrCmd_setmonobedient(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_checkmonobedience(struct ScriptContext *ctx) +bool8 ScrCmd_checkmonobedience(struct ScriptContext * ctx) { u16 partyIndex = VarGet(ScriptReadHalfword(ctx)); @@ -2252,7 +2252,7 @@ bool8 ScrCmd_checkmonobedience(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setmonmetlocation(struct ScriptContext *ctx) +bool8 ScrCmd_setmonmetlocation(struct ScriptContext * ctx) { u16 partyIndex = VarGet(ScriptReadHalfword(ctx)); u8 location = ScriptReadByte(ctx); diff --git a/sym_ewram.txt b/sym_ewram.txt index 8481032c3..2510d6649 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -100,9 +100,8 @@ gUnknown_2037098: @ 2037098 gUnknown_203709A: @ 203709A .space 0x2 -gUnknown_203709C: @ 203709C - .space 0x4 - + .align 2 + .include "src/field_message_box.o" .align 2 .include "src/script.o" .align 2 |