diff options
Diffstat (limited to 'asm')
35 files changed, 1051 insertions, 729 deletions
diff --git a/asm/battle_frontier_1.s b/asm/battle_frontier_1.s index 978dd30fa..986d04a05 100755 --- a/asm/battle_frontier_1.s +++ b/asm/battle_frontier_1.s @@ -136,7 +136,7 @@ _0818EAC8: .4byte _0818ECD0 .4byte _0818ECF4 _0818EAF0: - ldr r3, =gScriptResult + ldr r3, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r5, 1 @@ -150,7 +150,7 @@ _0818EAF0: b _0818ED10 .pool _0818EB14: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r3, =0x00000cdc @@ -170,7 +170,7 @@ _0818EB14: b _0818ED10 .pool _0818EB48: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -180,7 +180,7 @@ _0818EB48: b _0818ECBE .pool _0818EB64: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 @@ -190,7 +190,7 @@ _0818EB64: b _0818ECBE .pool _0818EB80: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -198,7 +198,7 @@ _0818EB80: b _0818ECBA .pool _0818EB98: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 @@ -216,7 +216,7 @@ _0818EBB4: bne _0818EC04 cmp r5, 0 beq _0818EBE8 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -226,7 +226,7 @@ _0818EBB4: b _0818ECBE .pool _0818EBE8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 @@ -238,7 +238,7 @@ _0818EBE8: _0818EC04: cmp r5, 0 beq _0818EC24 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -248,7 +248,7 @@ _0818EC04: b _0818ECBE .pool _0818EC24: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 @@ -266,7 +266,7 @@ _0818EC40: bne _0818EC90 cmp r5, 0 beq _0818EC74 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -277,7 +277,7 @@ _0818EC40: b _0818ED10 .pool _0818EC74: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 @@ -289,7 +289,7 @@ _0818EC74: _0818EC90: cmp r5, 0 beq _0818ECB0 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -299,7 +299,7 @@ _0818EC90: b _0818ECBE .pool _0818ECB0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 @@ -328,7 +328,7 @@ _0818ECD0: b _0818ED10 .pool _0818ECF4: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r3, =0x00000d0a @@ -11707,12 +11707,12 @@ sub_8194EC0: @ 8194EC0 bl sub_8195358 cmp r4, r0 ble _08194EE8 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _08194EEC .pool _08194EE8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 _08194EEC: strh r0, [r1] @@ -13130,7 +13130,7 @@ _08195A74: beq _08195AB0 b _08195AD0 _08195A7A: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r1, [r5] ldr r2, =0x00000dc6 adds r1, r2 @@ -13139,7 +13139,7 @@ _08195A7A: b _08195AD0 .pool _08195A90: - ldr r3, =gScriptResult + ldr r3, =gSpecialVar_ScriptResult ldr r0, [r5] lsls r1, r7, 1 lsls r2, r6, 2 @@ -13152,7 +13152,7 @@ _08195A90: b _08195AD0 .pool _08195AB0: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult ldr r2, [r5] ldr r0, =0x00000cdc adds r2, r0 @@ -13285,7 +13285,7 @@ sub_8195BB0: @ 8195BB0 ldrh r0, [r2] cmp r0, 0x31 bhi _08195C00 - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl Random lsls r0, 16 lsrs r0, 16 @@ -13297,12 +13297,12 @@ sub_8195BB0: @ 8195BB0 _08195C00: cmp r0, 0x62 bhi _08195C10 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x3 b _08195C14 .pool _08195C10: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x4 _08195C14: strh r0, [r1] @@ -13517,12 +13517,12 @@ sub_8195DB8: @ 8195DB8 adds r0, r1 movs r1, 0 strh r1, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _08195E06 .pool _08195E00: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _08195E06: diff --git a/asm/battle_frontier_2.s b/asm/battle_frontier_2.s index ac92b3c2a..b3dd9b522 100755 --- a/asm/battle_frontier_2.s +++ b/asm/battle_frontier_2.s @@ -4361,14 +4361,14 @@ _0819CA4E: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _0819CAFE .pool _0819CA68: movs r0, 0x2 strh r0, [r4, 0x8] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] b _0819CAFE @@ -11730,13 +11730,13 @@ _081A0734: bne _081A0778 movs r0, 0x5 bl PlaySE - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x7F strh r0, [r1] b _081A0768 .pool _081A0764: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _081A0768: ldrb r0, [r4, 0xC] @@ -11982,12 +11982,12 @@ sub_81A093C: @ 81A093C lsrs r1, r0, 24 cmp r1, 0 bne _081A0954 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _081A095A .pool _081A0954: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _081A095A: @@ -12046,7 +12046,7 @@ sub_81A0990: @ 81A0990 thumb_func_start sub_81A09B4 sub_81A09B4: @ 81A09B4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB1 @@ -12070,13 +12070,13 @@ sub_81A09D0: @ 81A09D0 subs r1, r0, 0x3 cmp r1, 0 bge _081A09F4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] b _081A0A1C .pool _081A09F4: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult cmp r1, 0x8 ble _081A09FE movs r0, 0x1 @@ -12403,7 +12403,7 @@ sub_81A0CC0: @ 81A0CC0 lsrs r0, r1, 28 cmp r0, 0x2 bhi _081A0CE4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 b _081A0D34 .pool @@ -12431,22 +12431,22 @@ _081A0D08: beq _081A0D24 b _081A0D30 _081A0D0E: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x4 b _081A0D34 .pool _081A0D18: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x3 b _081A0D34 .pool _081A0D24: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _081A0D34 .pool _081A0D30: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x5 _081A0D34: strh r0, [r1] @@ -13078,7 +13078,7 @@ _081A1242: lsls r0, 30 ldr r1, =gSpecialVar_0x8005 mov r12, r1 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult mov r8, r1 cmp r0, 0 beq _081A127C @@ -13855,7 +13855,7 @@ _081A186C: .4byte _081A1918 .4byte _081A1938 _081A188C: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca8 @@ -13865,7 +13865,7 @@ _081A188C: b _081A1956 .pool _081A18A8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca9 @@ -13877,7 +13877,7 @@ _081A18A8: b _081A1956 .pool _081A18C8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000cb2 @@ -13887,7 +13887,7 @@ _081A18C8: b _081A1956 .pool _081A18E4: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca9 @@ -13897,7 +13897,7 @@ _081A18E4: b _081A1926 .pool _081A1900: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, =gBattleOutcome ldrb r0, [r1] strh r0, [r2] @@ -13906,7 +13906,7 @@ _081A1900: b _081A1956 .pool _081A1918: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca9 @@ -13919,7 +13919,7 @@ _081A1926: b _081A1956 .pool _081A1938: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r2, [r0] movs r0, 0xD0 @@ -17183,7 +17183,7 @@ sub_81A35EC: @ 81A35EC push {r4,lr} ldr r0, =0x000040cf bl VarGet - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl sub_81A3610 lsls r0, 24 lsrs r0, 24 @@ -17755,12 +17755,12 @@ sub_81A3B00: @ 81A3B00 ldr r0, =0x000003fe cmp r1, r0 bne _081A3B20 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _081A3B24 .pool _081A3B20: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 _081A3B24: strh r0, [r1] @@ -17988,7 +17988,7 @@ sub_81A3D30: @ 81A3D30 push {r4,lr} ldr r0, =0x000040cf bl VarGet - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult lsls r0, 24 lsrs r0, 24 bl sub_81A3B30 @@ -18044,13 +18044,13 @@ sub_81A3DA0: @ 81A3DA0 ands r2, r1 cmp r2, 0 beq _081A3DC4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] b _081A3DC8 .pool _081A3DC4: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r2, [r0] _081A3DC8: pop {r0} @@ -18390,7 +18390,7 @@ _081A404E: bne _081A40C8 cmp r7, 0 bne _081A40E4 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrb r3, [r0] str r6, [sp] add r1, sp, 0x10 @@ -18406,7 +18406,7 @@ _081A404E: b _081A40E4 .pool _081A40C8: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrb r3, [r0] str r6, [sp] add r1, sp, 0x10 @@ -18529,7 +18529,7 @@ _081A41E0: strh r0, [r1] ldr r0, =gSaveBlock2Ptr ldr r2, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrb r0, [r0] ldr r1, =0x00000ca9 adds r2, r1 @@ -18767,7 +18767,7 @@ _081A43EE: thumb_func_start sub_81A4410 sub_81A4410: @ 81A4410 push {r4,lr} - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl MoveRecordedBattleToSaveData strh r0, [r4] ldr r0, =gSaveBlock2Ptr @@ -21309,7 +21309,7 @@ _081A5994: beq _081A59C8 b _081A59EE _081A599A: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r2, =0x00000dd8 adds r1, r3, r2 ldrh r1, [r1] @@ -21317,7 +21317,7 @@ _081A599A: b _081A59EE .pool _081A59B0: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult lsls r1, 1 ldr r4, =0x00000dda adds r0, r3, r4 @@ -21328,7 +21328,7 @@ _081A59B0: _081A59C8: cmp r1, 0 beq _081A59E0 - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, =0x00000cdc adds r0, r3, r1 ldr r0, [r0] @@ -21336,7 +21336,7 @@ _081A59C8: b _081A59EA .pool _081A59E0: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r4, =0x00000cdc adds r0, r3, r4 ldr r0, [r0] @@ -21550,12 +21550,12 @@ sub_81A5B88: @ 81A5B88 adds r0, r1 movs r1, 0 strh r1, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _081A5BD6 .pool _081A5BD0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _081A5BD6: @@ -22026,7 +22026,7 @@ _081A5FE4: beq _081A6030 b _081A6044 _081A5FEA: - ldr r3, =gScriptResult + ldr r3, =gSpecialVar_ScriptResult ldr r0, [r7] lsls r1, r6, 1 lsls r2, r5, 2 @@ -22035,7 +22035,7 @@ _081A5FEA: b _081A603C .pool _081A6000: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult ldr r2, [r7] ldr r0, =0x00000cdc adds r2, r0 @@ -22054,7 +22054,7 @@ _081A6000: b _081A6044 .pool _081A6030: - ldr r3, =gScriptResult + ldr r3, =gSpecialVar_ScriptResult ldr r0, [r7] lsls r1, r6, 1 lsls r2, r5, 2 @@ -23248,7 +23248,7 @@ sub_81A6A08: @ 81A6A08 str r0, [r1] movs r4, 0 add r5, sp, 0x14 - ldr r7, =gScriptResult + ldr r7, =gSpecialVar_ScriptResult movs r1, 0 _081A6A1E: mov r2, sp @@ -23407,7 +23407,7 @@ _081A6B18: lsrs r4, r0, 24 cmp r4, 0x2 bls _081A6B0E - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] movs r4, 0x1 @@ -24180,7 +24180,7 @@ _081A7174: .4byte _081A71E8 .4byte _081A720C _081A7188: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r1, [r3] ldr r3, =0x00000e02 adds r1, r3 @@ -24189,7 +24189,7 @@ _081A7188: b _081A723A .pool _081A71A0: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, [r3] ldr r3, =0x00000ca9 adds r0, r1, r3 @@ -24203,7 +24203,7 @@ _081A71A0: b _081A7238 .pool _081A71C4: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, [r3] ldr r3, =0x00000ca9 adds r0, r1, r3 @@ -24217,7 +24217,7 @@ _081A71C4: b _081A7238 .pool _081A71E8: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, [r3] ldr r3, =0x00000ca9 adds r0, r1, r3 @@ -24233,7 +24233,7 @@ _081A71E8: _081A720C: cmp r2, 0 beq _081A7228 - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, [r3] ldr r1, =0x00000cdc adds r0, r1 @@ -24243,7 +24243,7 @@ _081A720C: b _081A7236 .pool _081A7228: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, [r3] ldr r3, =0x00000cdc adds r0, r3 @@ -24424,12 +24424,12 @@ sub_81A73B8: @ 81A73B8 ldrh r0, [r0] cmp r0, 0xE bls _081A73DC - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _081A73E0 .pool _081A73DC: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 _081A73E0: strh r0, [r1] @@ -24440,7 +24440,7 @@ _081A73E0: thumb_func_start sub_81A73EC sub_81A73EC: @ 81A73EC - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r1, =gUnknown_0300128C ldrb r1, [r1] strh r1, [r0] @@ -24528,27 +24528,27 @@ _081A7484: beq _081A74A4 b _081A74C2 _081A748E: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 b _081A74C0 .pool _081A7498: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _081A74C0 .pool _081A74A4: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 b _081A74C0 .pool _081A74B0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x3 b _081A74C0 .pool _081A74BC: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x4 _081A74C0: strh r0, [r1] @@ -24560,7 +24560,7 @@ _081A74C2: thumb_func_start sub_81A74CC sub_81A74CC: @ 81A74CC - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r1, =gUnknown_0300128D ldrb r1, [r1] strh r1, [r0] @@ -24580,7 +24580,7 @@ sub_81A74E0: @ 81A74E0 adds r4, 0x1 adds r0, r4, 0 bl sub_81A7F38 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r4, [r0] pop {r4} pop {r0} @@ -26066,7 +26066,7 @@ _081A807A: thumb_func_start sub_81A8090 sub_81A8090: @ 81A8090 push {r4,lr} - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl InBattlePike lsls r0, 24 lsrs r0, 24 @@ -26110,7 +26110,7 @@ sub_81A80DC: @ 81A80DC push {r4-r7,lr} mov r7, r8 push {r7} - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r4] movs r0, 0x1 @@ -26295,7 +26295,7 @@ _081A824C: thumb_func_start sub_81A825C sub_81A825C: @ 81A825C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r2, 0xE1 @@ -26311,7 +26311,7 @@ sub_81A825C: @ 81A825C thumb_func_start sub_81A827C sub_81A827C: @ 81A827C - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, =gUnknown_0861266C ldr r0, =gSaveBlock2Ptr ldr r0, [r0] @@ -26754,7 +26754,7 @@ _081A8634: thumb_func_start sub_81A863C sub_81A863C: @ 81A863C push {r4,lr} - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult movs r0, 0 bl sub_81A8590 lsls r0, 24 @@ -26787,7 +26787,7 @@ sub_81A8658: @ 81A8658 ldrb r4, [r0] adds r0, r4, 0 bl sub_81A7F38 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r4, [r0] pop {r4} pop {r0} @@ -26821,7 +26821,7 @@ sub_81A86C0: @ 81A86C0 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] movs r0, 0 @@ -26895,7 +26895,7 @@ _081A8766: mov r0, r9 cmp r0, 0x1 bne _081A8778 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] b _081A8786 @@ -27919,13 +27919,13 @@ _081A8F70: .4byte _081A9010 .4byte _081A9028 _081A8F8C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r1, [r3] ldr r3, =0x00000e18 b _081A8FFE .pool _081A8F9C: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, [r3] lsls r1, r4, 1 ldr r3, =0x00000e1a @@ -27937,14 +27937,14 @@ _081A8F9C: _081A8FB4: cmp r4, 0 beq _081A8FCC - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, [r3] ldr r1, =0x00000cdc adds r0, r1 b _081A9030 .pool _081A8FCC: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, [r3] ldr r3, =0x00000cdc adds r0, r3 @@ -27954,14 +27954,14 @@ _081A8FCC: b _081A9036 .pool _081A8FE4: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r1, [r3] ldr r2, =0x00000e1a adds r1, r2 b _081A9000 .pool _081A8FF8: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r1, [r3] ldr r3, =0x00000e1c _081A8FFE: @@ -27972,7 +27972,7 @@ _081A9000: b _081A903A .pool _081A9010: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, [r3] ldr r1, =0x00000cdc adds r0, r1 @@ -27982,7 +27982,7 @@ _081A9010: b _081A9036 .pool _081A9028: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, [r3] ldr r3, =0x00000cdc adds r0, r3 @@ -28211,12 +28211,12 @@ sub_81A91FC: @ 81A91FC adds r0, r1 movs r1, 0 strh r1, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _081A924A .pool _081A9244: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _081A924A: @@ -28296,7 +28296,7 @@ CalculateBattlePyramidItemBallItemId: @ 81A9290 _081A92DE: bl sub_81AA9E4 lsls r0, 24 - ldr r1, =gScriptLastTalked + ldr r1, =gSpecialVar_ScriptLastTalked ldrh r4, [r1] ldr r1, =gUnknown_08613650 lsrs r0, 20 @@ -28401,7 +28401,7 @@ sub_81A93C8: @ 81A93C8 lsls r1, 4 adds r3, r0, r1 movs r2, 0 - ldr r4, =gScriptLastTalked + ldr r4, =gSpecialVar_ScriptLastTalked b _081A93F4 .pool _081A93E4: @@ -28712,7 +28712,7 @@ _081A9650: thumb_func_start sub_81A966C sub_81A966C: @ 81A966C push {r4,lr} - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl InBattlePyramid lsls r0, 24 lsrs r0, 24 @@ -28745,7 +28745,7 @@ _081A9698: b _081A9754 .pool _081A96B4: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult ldrh r0, [r4] cmp r0, 0x1 beq _081A9710 @@ -28775,7 +28775,7 @@ _081A96F4: ldrh r0, [r0] bl PlaySE _081A96FC: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @@ -29352,7 +29352,7 @@ _081A9B86: strb r3, [r0, 0x6] mov r7, r10 ldr r2, [r7] - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrh r1, [r0] subs r1, 0x1 lsls r0, r1, 1 diff --git a/asm/battle_setup.s b/asm/battle_setup.s index 5c7196579..a6075da3f 100644 --- a/asm/battle_setup.s +++ b/asm/battle_setup.s @@ -1344,7 +1344,7 @@ sub_80B1158: @ 80B1158 sub sp, 0x8 ldr r0, =0x00004023 bl GetVarPointer - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldrh r1, [r2] strh r1, [r0] ldrh r0, [r2] @@ -1669,7 +1669,7 @@ battle_80801F0: @ 80B13F8 ldrh r1, [r0] cmp r1, 0 beq _080B141A - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked strh r1, [r0] lsls r0, r1, 24 lsrs r0, 24 @@ -1793,7 +1793,7 @@ _080B153C: adds r1, r5, 0 bl TrainerBattleLoadArgs bl battle_80801F0 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrb r0, [r0] bl sub_81A9AA8 ldr r1, =gTrainerBattleOpponent_A @@ -1803,7 +1803,7 @@ _080B156C: ldr r0, =gUnknown_08550014 adds r1, r5, 0 bl TrainerBattleLoadArgs - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrb r0, [r0] bl sub_81A9AA8 _080B157C: @@ -1833,7 +1833,7 @@ _080B15A8: adds r1, r5, 0 bl TrainerBattleLoadArgs bl battle_80801F0 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrb r0, [r0] bl battle_init ldr r1, =gTrainerBattleOpponent_A @@ -1843,7 +1843,7 @@ _080B15D8: ldr r0, =gUnknown_08550014 adds r1, r5, 0 bl TrainerBattleLoadArgs - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrb r0, [r0] bl battle_init b _080B157C @@ -1882,7 +1882,7 @@ SingleTrainerWantsBattle: @ 80B162C lsrs r0, 24 ldr r2, =gSelectedMapObject strb r0, [r2] - ldr r4, =gScriptLastTalked + ldr r4, =gSpecialVar_ScriptLastTalked ldr r3, =gMapObjects lsls r2, r0, 3 adds r2, r0 @@ -1910,7 +1910,7 @@ TwoTrainersWantBattle: @ 80B1670 lsrs r0, 24 ldr r2, =gSelectedMapObject strb r0, [r2] - ldr r4, =gScriptLastTalked + ldr r4, =gSpecialVar_ScriptLastTalked ldr r3, =gMapObjects lsls r2, r0, 3 adds r2, r0 @@ -2332,7 +2332,7 @@ sub_80B1A14: @ 80B1A14 ldrb r0, [r0] cmp r0, 0x1 bhi _080B1A44 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrb r0, [r0] bl sub_81A9AA8 lsls r0, 16 @@ -2370,7 +2370,7 @@ _080B1A7C: ldrb r0, [r0] cmp r0, 0x1 bhi _080B1AAC - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrb r0, [r0] bl battle_init adds r1, r0, 0 @@ -3484,7 +3484,7 @@ CheckIfMultipleTrainersWantBattle: @ 80B22D8 ldr r1, =gUnknown_02038BF8 movs r0, 0x1 strb r0, [r1] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _080B230A .pool @@ -3492,7 +3492,7 @@ _080B2300: ldr r1, =gUnknown_02038BF8 movs r0, 0 strb r0, [r1] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 _080B230A: strh r0, [r1] diff --git a/asm/battle_tent.s b/asm/battle_tent.s index 5cb92dbed..1fa985d1b 100755 --- a/asm/battle_tent.s +++ b/asm/battle_tent.s @@ -57,7 +57,7 @@ sub_81B99D4: @ 81B99D4 thumb_func_start sub_81B9A28 sub_81B9A28: @ 81B9A28 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000e6a @@ -196,12 +196,12 @@ sub_81B9B28: @ 81B9B28 adds r0, r1 movs r1, 0 strh r1, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _081B9B76 .pool _081B9B70: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _081B9B76: @@ -263,7 +263,7 @@ sub_81B9BA0: @ 81B9BA0 thumb_func_start sub_81B9BF4 sub_81B9BF4: @ 81B9BF4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000e6c @@ -357,12 +357,12 @@ sub_81B9C98: @ 81B9C98 adds r0, r1 movs r1, 0 strh r1, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _081B9CE6 .pool _081B9CE0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _081B9CE6: @@ -436,7 +436,7 @@ sub_81B9D28: @ 81B9D28 thumb_func_start sub_81B9D7C sub_81B9D7C: @ 81B9D7C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000e6e @@ -530,12 +530,12 @@ sub_81B9E20: @ 81B9E20 adds r0, r1 movs r1, 0 strh r1, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _081B9E6E .pool _081B9E68: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _081B9E6E: diff --git a/asm/battle_tower.s b/asm/battle_tower.s index 122d9d27c..ec59fab9a 100755 --- a/asm/battle_tower.s +++ b/asm/battle_tower.s @@ -132,12 +132,12 @@ _08162094: lsls r1, 24 lsrs r1, 24 bl sub_8164FCC - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult strh r0, [r1] b _081620E8 .pool _081620A8: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult ldr r2, [r5] ldr r0, =0x00000cdc adds r2, r0 @@ -294,7 +294,7 @@ _081621EE: adds r0, 0x1 strh r0, [r1] bl sub_8163E90 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, [r5] adds r0, r4 ldrh r0, [r0] @@ -4714,7 +4714,7 @@ sub_8164828: @ 8164828 lsls r0, 16 lsrs r0, 16 mov r8, r0 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrh r0, [r0] subs r5, r0, 0x2 ldr r0, =gSaveBlock2Ptr @@ -5076,7 +5076,7 @@ sub_8164B74: @ 8164B74 adds r0, r2 ldrh r6, [r0] bl GetMultiplayerId - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x6 bls _08164BAC @@ -5126,7 +5126,7 @@ _08164C18: mov r1, sp movs r2, 0x4 bl SendBlock - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _08164DB4 .pool @@ -5204,7 +5204,7 @@ _08164CB0: mov r4, r8 cmp r4, 0xD ble _08164C68 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 b _08164DB4 .pool @@ -5222,7 +5222,7 @@ _08164CE0: adds r1, r3 movs r2, 0x28 bl SendBlock - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x3 b _08164DB4 .pool @@ -5268,13 +5268,13 @@ _08164D14: ldrb r0, [r0] cmp r0, 0 bne _08164DB0 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x4 b _08164DB4 .pool _08164D98: bl sub_800AC34 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x5 b _08164DB4 .pool @@ -5284,7 +5284,7 @@ _08164DA8: cmp r0, 0 bne _08164DB6 _08164DB0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x6 _08164DB4: strh r0, [r1] @@ -5625,7 +5625,7 @@ sub_816502C: @ 816502C movs r0, 0x45 mov r10, r0 _0816506A: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult mov r9, r1 movs r0, 0 strh r0, [r1] @@ -5681,7 +5681,7 @@ _081650D4: cmp r6, r8 blt _0816508C _081650DC: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0 beq _08165132 @@ -5901,7 +5901,7 @@ _08165294: thumb_func_start sub_81652B4 sub_81652B4: @ 81652B4 push {r4-r6,lr} - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r2] ldr r1, =gSaveBlock2Ptr @@ -5943,7 +5943,7 @@ _081652F2: ldr r3, =0x00000bec adds r0, r1, r3 bl sub_816534C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _08165316: diff --git a/asm/cable_club.s b/asm/cable_club.s index 15ba76e9c..0fd919872 100644 --- a/asm/cable_club.s +++ b/asm/cable_club.s @@ -663,7 +663,7 @@ sub_80B28A8: @ 80B28A8 b _080B2908 .pool _080B28F4: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult adds r0, r7, 0 adds r1, r6, 0 bl sub_80B2478 @@ -703,7 +703,7 @@ sub_80B2918: @ 80B2918 bl sub_80B24F8 cmp r0, 0x1 beq _080B29E6 - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult adds r0, r6, 0 adds r1, r5, 0 bl sub_80B2478 @@ -791,7 +791,7 @@ sub_80B2A08: @ 80B2A08 bl sub_80B24F8 cmp r0, 0x1 beq _080B2ACE - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x4 bne _080B2A38 @@ -1067,7 +1067,7 @@ _080B2C7E: movs r0, 0 bl sub_800B330 bl ResetBlockReceivedFlags - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult adds r1, r5, 0 bl task_map_chg_seq_0807EC34 _080B2C9C: @@ -1111,7 +1111,7 @@ sub_80B2CEC: @ 80B2CEC adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x5 strh r0, [r1] ldr r0, =gTasks @@ -1139,7 +1139,7 @@ sub_80B2D2C: @ 80B2D2C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x6 strh r0, [r1] ldr r0, =gTasks @@ -1284,7 +1284,7 @@ sub_80B2E4C: @ 80B2E4C thumb_func_start sub_80B2E74 sub_80B2E74: @ 80B2E74 push {lr} - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] ldr r1, =gUnknown_020229C6 @@ -1353,7 +1353,7 @@ sub_80B2EE4: @ 80B2EE4 b _080B2FC6 .pool _080B2F0C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x1 bne _080B2FA8 @@ -1415,7 +1415,7 @@ _080B2F74: _080B2F82: cmp r7, 0 beq _080B2FA8 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0xC strh r0, [r1] bl sub_800AD10 diff --git a/asm/contest_link_80F57C4.s b/asm/contest_link_80F57C4.s index e6d30b7cb..2fc714f77 100644 --- a/asm/contest_link_80F57C4.s +++ b/asm/contest_link_80F57C4.s @@ -548,7 +548,7 @@ _080F5D2A: movs r0, 0x8 strh r0, [r1] bl InterviewBefore - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x1 beq _080F5D58 @@ -4648,7 +4648,7 @@ sub_80F7F30: @ 80F7F30 ldrb r0, [r4] bl sub_80DB09C _080F7F5E: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] pop {r4,r5} pop {r0} diff --git a/asm/daycare.s b/asm/daycare.s index 065911df8..79a0c7636 100644 --- a/asm/daycare.s +++ b/asm/daycare.s @@ -3075,12 +3075,12 @@ c3_080469FC: @ 8071204 b _0807124E .pool _0807123C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _0807124E .pool _08071248: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 strh r0, [r1] _0807124E: @@ -3109,7 +3109,7 @@ _08071284: ands r0, r2 cmp r0, 0 beq _080712B4 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] ldrb r0, [r4, 0x8] movs r1, 0 diff --git a/asm/dewford_trend.s b/asm/dewford_trend.s index 40df2d6a0..be3d0367c 100644 --- a/asm/dewford_trend.s +++ b/asm/dewford_trend.s @@ -667,7 +667,7 @@ sub_81229C8: @ 81229C8 negs r0, r0 lsrs r4, r0, 31 _08122A0C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r4, [r0] pop {r4} pop {r0} @@ -677,7 +677,7 @@ _08122A0C: thumb_func_start sub_8122A30 sub_8122A30: @ 8122A30 - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00002e6c diff --git a/asm/easy_chat.s b/asm/easy_chat.s index e9565dfa9..013afa739 100644 --- a/asm/easy_chat.s +++ b/asm/easy_chat.s @@ -1659,7 +1659,7 @@ _0811AFAC: b _0811AFE6 .pool _0811AFC0: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] ldr r0, =gUnknown_0203A118 ldr r0, [r0] @@ -1709,7 +1709,7 @@ _0811B00C: .pool _0811B020: bl sub_811BE9C - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl sub_811B4EC strh r0, [r4] bl sub_811B3E4 @@ -1860,7 +1860,7 @@ _0811B118: b _0811B14A .pool _0811B134: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl sub_811B4EC strh r0, [r4] bl sub_811B3E4 diff --git a/asm/field_control_avatar.s b/asm/field_control_avatar.s index fa923d94b..33216d82d 100644 --- a/asm/field_control_avatar.s +++ b/asm/field_control_avatar.s @@ -184,7 +184,7 @@ sub_809C014: @ 809C014 push {r4-r6,lr} sub sp, 0x8 adds r5, r0, 0 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked movs r1, 0 strh r1, [r0] ldr r0, =gSelectedMapObject @@ -582,13 +582,13 @@ _0809C34C: ble _0809C340 ldr r0, =gSelectedMapObject strb r3, [r0] - ldr r1, =gScriptLastTalked + ldr r1, =gSpecialVar_ScriptLastTalked adds r0, r2, r3 lsls r0, 2 adds r0, r5 ldrb r0, [r0, 0x8] strh r0, [r1] - ldr r0, =gScriptFacing + ldr r0, =gSpecialVar_ScriptFacing strh r6, [r0] adds r0, r3, 0 bl GetFieldObjectScriptPointerByFieldObjectId @@ -668,13 +668,13 @@ _0809C400: _0809C40C: ldr r0, =gSelectedMapObject strb r4, [r0] - ldr r1, =gScriptLastTalked + ldr r1, =gSpecialVar_ScriptLastTalked adds r0, r2, r4 lsls r0, 2 adds r0, r3 ldrb r0, [r0, 0x8] strh r0, [r1] - ldr r0, =gScriptFacing + ldr r0, =gSpecialVar_ScriptFacing strh r7, [r0] bl InTrainerHill cmp r0, 0x1 @@ -687,7 +687,7 @@ _0809C43C: bl GetFieldObjectScriptPointerByFieldObjectId _0809C442: adds r1, r0, 0 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrb r0, [r0] bl GetRamScript adds r1, r0, 0 @@ -1470,7 +1470,7 @@ _0809CAF8: bl CountSSTidalStep cmp r0, 0x1 bne _0809CB1C - ldr r0, =gUnknown_0823C050 + ldr r0, =SSTidalCorridor_EventScript_23C050 bl ScriptContext1_SetupScript b _0809CB28 .pool diff --git a/asm/field_poison.s b/asm/field_poison.s index 652026523..ec9976361 100644 --- a/asm/field_poison.s +++ b/asm/field_poison.s @@ -203,12 +203,12 @@ _080F96C0: cmp r0, 0 beq _080F96F0 _080F96E6: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _080F9718 .pool _080F96F0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] b _080F9718 @@ -224,7 +224,7 @@ _080F96FC: b _080F9722 .pool _080F9714: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _080F9718: bl EnableBothScriptContexts diff --git a/asm/field_screen.s b/asm/field_screen.s index 4ab8a5a53..beea78db0 100644 --- a/asm/field_screen.s +++ b/asm/field_screen.s @@ -10424,7 +10424,7 @@ sub_80B0534: @ 80B0534 lsls r1, 3 ldr r0, =gTasks + 0x8 adds r1, r0 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0 bne _080B0568 diff --git a/asm/fldeff_80F9BCC.s b/asm/fldeff_80F9BCC.s index 63acc9982..77faa0f81 100644 --- a/asm/fldeff_80F9BCC.s +++ b/asm/fldeff_80F9BCC.s @@ -563,7 +563,7 @@ _080F9FFE: sub_80FA004: @ 80FA004 push {r4,lr} bl sub_80E8BC8 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x1 beq _080FA0AE @@ -2063,7 +2063,7 @@ _080FACC2: ldr r0, =gStringVar2 ldr r1, =gText_Gold bl StringCopy - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] ldr r0, =0x00004054 @@ -2087,7 +2087,7 @@ _080FAD14: ldr r0, =gStringVar2 ldr r1, =gText_Silver bl StringCopy - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] ldr r0, =0x00004054 @@ -2103,12 +2103,12 @@ _080FAD14: b _080FAD8A .pool _080FAD60: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _080FAD70 .pool _080FAD6C: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 _080FAD70: strh r0, [r1] @@ -2131,7 +2131,7 @@ _080FAD8A: b _080FADCE .pool _080FADA4: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x3 strh r0, [r1] ldr r0, =0x00004054 diff --git a/asm/fldeff_strength.s b/asm/fldeff_strength.s index 947517ed5..2918be52d 100644 --- a/asm/fldeff_strength.s +++ b/asm/fldeff_strength.s @@ -17,7 +17,7 @@ hm_prepare_rocksmash: @ 8145DC4 movs r0, 0 b _08145DF2 _08145DD8: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 diff --git a/asm/item_menu.s b/asm/item_menu.s index 06c0a86ed..77183d435 100755 --- a/asm/item_menu.s +++ b/asm/item_menu.s @@ -121,7 +121,7 @@ sub_81AAC28: @ 81AAC28 ldr r0, =gSpecialVar_0x8005 movs r1, 0 strh r1, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] pop {r0} bx r0 @@ -135,7 +135,7 @@ sub_81AAC50: @ 81AAC50 movs r0, 0x7 movs r1, 0x5 bl GoToBagMenu - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] pop {r0} @@ -150,7 +150,7 @@ sub_81AAC70: @ 81AAC70 movs r0, 0x8 movs r1, 0x5 bl GoToBagMenu - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] pop {r0} @@ -5729,7 +5729,7 @@ unknown_ItemMenu_Show: @ 81ADE38 ldr r0, =gScriptItemId ldrh r0, [r0] strh r0, [r1] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] bl bag_menu_remove_some_window @@ -5764,7 +5764,7 @@ unknown_ItemMenu_Give2: @ 81ADE8C ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] bl bag_menu_remove_some_window @@ -5795,7 +5795,7 @@ unknown_ItemMenu_Confirm2: @ 81ADEDC adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] bl bag_menu_remove_some_window diff --git a/asm/link.s b/asm/link.s index 291f71a57..d702ad957 100644 --- a/asm/link.s +++ b/asm/link.s @@ -18044,7 +18044,7 @@ BerryBlenderLinkBecomeLeader: @ 801273C movs r0, 0 strb r0, [r1, 0xC] strb r0, [r1, 0xD] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult strh r0, [r1] pop {r0} bx r0 @@ -18891,7 +18891,7 @@ _08012EE6: bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x5 strh r0, [r1] b _08012F50 @@ -18900,7 +18900,7 @@ _08012EFC: bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x8 strh r0, [r1] b _08012F50 @@ -19569,7 +19569,7 @@ BerryBlenderLinkJoinGroup: @ 80134A4 movs r0, 0 strb r0, [r1, 0x8] strb r0, [r1, 0x9] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult strh r0, [r1] pop {r0} bx r0 @@ -20194,13 +20194,13 @@ _08013AE4: lsls r0, 24 cmp r0, 0 beq _08013B82 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult movs r1, 0x6 b _08013B58 .pool _08013B14: bl sub_800E084 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult movs r1, 0x5 b _08013B58 .pool @@ -20226,7 +20226,7 @@ _08013B4A: lsls r0, 24 cmp r0, 0 beq _08013B82 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult movs r1, 0x8 _08013B58: strh r1, [r0] @@ -21544,7 +21544,7 @@ _0801474C: _08014764: adds r0, r4, 0 bl DestroyTask - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] ldr r0, =gUnknown_02022C2C @@ -21600,7 +21600,7 @@ _080147CC: .4byte _08014992 .4byte _0801499C _080147F0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] ldr r0, =gUnknown_02022C2C @@ -21744,7 +21744,7 @@ _0801494A: bl sub_80B2AF4 cmp r0, 0 beq _08014980 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult movs r1, 0xB strh r1, [r0] movs r0, 0x7 @@ -21835,7 +21835,7 @@ sub_8014A00: @ 8014A00 strb r2, [r1, 0xC] strb r2, [r1, 0xD] strb r4, [r1, 0x18] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r2, [r0] pop {r4} pop {r0} @@ -22295,7 +22295,7 @@ _08014E4E: beq _08014EF2 adds r0, r4, 0 bl DestroyTask - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x5 strh r0, [r1] b _08014EF2 @@ -22384,7 +22384,7 @@ sub_8014EFC: @ 8014EFC strb r2, [r1, 0x9] subs r4, 0x15 strb r4, [r1, 0x12] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r2, [r0] pop {r4} pop {r0} @@ -22725,7 +22725,7 @@ _0801526A: adds r0, r6, 0 bl DestroyTask bl sub_800EDD4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x5 strh r0, [r1] b _080152A0 @@ -22773,7 +22773,7 @@ sub_80152A8: @ 80152A8 strb r2, [r1, 0x9] subs r4, 0x15 strb r4, [r1, 0x12] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r2, [r0] pop {r4} pop {r0} @@ -23097,7 +23097,7 @@ _080155C2: adds r0, r4, 0 bl DestroyTask bl sub_800EDD4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x5 strh r0, [r1] b _08015604 @@ -23141,7 +23141,7 @@ UnionRoomSpecial: @ 801560C strb r1, [r0, 0x16] strh r1, [r0, 0x10] strh r1, [r0, 0x12] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] movs r0, 0xD0 movs r1, 0x1 @@ -23384,7 +23384,7 @@ _08015878: ldr r0, [r6, 0xC] movs r1, 0x4 bl sub_80175EC - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] movs r0, 0x3 @@ -23486,7 +23486,7 @@ _080159A0: movs r0, 0x4 bl _08016876 _080159A6: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult ldrh r0, [r4] cmp r0, 0 beq _08015A0A @@ -25069,7 +25069,7 @@ var_800D_set_xB: @ 8016884 bl InUnionRoom cmp r0, 0x1 bne _08016894 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0xB strh r0, [r1] _08016894: @@ -30491,7 +30491,7 @@ _0801940C: b _08019922 .pool _0801942C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x5 beq _08019436 @@ -30992,7 +30992,7 @@ _080197F8: b _08019922 .pool _08019810: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x5 beq _0801981A @@ -39452,7 +39452,7 @@ _0801DC10: thumb_func_start sub_801DC20 sub_801DC20: @ 801DC20 push {r4-r6,lr} - ldr r6, =gScriptResult + ldr r6, =gSpecialVar_ScriptResult bl sub_801B044 adds r4, r0, 0 bl IsMysteryEventEnabled @@ -59190,7 +59190,7 @@ sub_8027A48: @ 8027A48 sub_8027A5C: @ 8027A5C push {r4-r6,lr} movs r5, 0 - ldr r6, =gScriptResult + ldr r6, =gSpecialVar_ScriptResult _08027A62: movs r0, 0x64 adds r1, r5, 0 @@ -59215,7 +59215,7 @@ _08027A94: adds r5, 0x1 cmp r5, 0x5 ble _08027A62 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _08027AA0: @@ -68862,7 +68862,7 @@ _0802C924: bl sub_802C908 cmp r0, 0 beq _0802C95C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _0802C966 .pool @@ -68870,7 +68870,7 @@ _0802C95C: adds r5, 0x1 cmp r5, 0x5 ble _0802C924 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 _0802C966: strh r0, [r1] diff --git a/asm/macros.inc b/asm/macros.inc index 135cfac61..0c6644002 100644 --- a/asm/macros.inc +++ b/asm/macros.inc @@ -1,5 +1,6 @@ .include "asm/macros/asm.inc" .include "asm/macros/function.inc" + .include "asm/macros/movement.inc" .include "asm/macros/window.inc" .include "asm/macros/pokemon_data.inc" .include "asm/macros/ec.inc" diff --git a/asm/macros/event.s b/asm/macros/event.inc index b5fefb925..f0577f777 100644 --- a/asm/macros/event.s +++ b/asm/macros/event.inc @@ -1,20 +1,20 @@ @ Does nothing. - .macro snop + .macro nop .byte 0x00 .endm @ Does nothing. - .macro snop1 + .macro nop1 .byte 0x01 .endm @ Terminates script execution. - .macro end + .macro end .byte 0x02 .endm @ Jumps back to after the last-executed call statement, and continues script execution from there. - .macro return + .macro return .byte 0x03 .endm @@ -25,27 +25,27 @@ .endm @ Jumps to destination and continues script execution from there. - .macro jump destination + .macro goto destination .byte 0x05 .4byte \destination .endm @ If the result of the last comparison matches condition (see Comparison operators), jumps to destination and continues script execution from there. - .macro jumpif condition, destination + .macro goto_if condition, destination .byte 0x06 .byte \condition .4byte \destination .endm @ If the result of the last comparison matches condition (see Comparison operators), calls destination. - .macro callif condition, destination + .macro call_if condition, destination .byte 0x07 .byte \condition .4byte \destination .endm @ Jumps to the standard function at index function. - .macro jumpstd function + .macro gotostd function .byte 0x08 .byte \function .endm @@ -57,58 +57,58 @@ .endm @ If the result of the last comparison matches condition (see Comparison operators), jumps to the standard function at index function. - .macro jumpstdif condition, function + .macro gotostd_if condition, function .byte 0x0a .byte \condition .byte \function .endm @ If the result of the last comparison matches condition (see Comparison operators), calls the standard function at index function. - .macro callstdif condition, function + .macro callstd_if condition, function .byte 0x0b .byte \condition .byte \function .endm @ Executes a script stored in a default RAM location. - .macro jumpram + .macro gotoram .byte 0x0c .endm @ Terminates script execution and "resets the script RAM". - .macro die + .macro killscript .byte 0x0d .endm - @ Pads the specified value to a dword, and then writes that dword to a predefined address (0x0203AAA8). - .macro setbyte value + @ Sets some status related to Mystery Event. + .macro setmysteryeventstatus value .byte 0x0e .byte \value .endm @ Sets the specified script bank to value. - .macro loadptr destination, value + .macro loadword destination, value .byte 0x0f .byte \destination .4byte \value .endm @ Sets the specified script bank to value. - .macro setbufferbyte destination, value + .macro loadbyte destination, value .byte 0x10 .byte \destination .byte \value .endm @ Sets the byte at offset to value. - .macro writebytetooffset value, offset + .macro writebytetoaddr value, offset .byte 0x11 .byte \value .4byte \offset .endm @ Copies the byte value at source into the specified script bank. - .macro loadbytefrompointer destination, source + .macro loadbytefromaddr destination, source .byte 0x12 .byte \destination .4byte \source @@ -122,7 +122,7 @@ .endm @ Copies the contents of bank source into bank destination. - .macro copybuffers destination, source + .macro copylocal destination, source .byte 0x14 .byte \destination .byte \source @@ -171,93 +171,93 @@ .endm @ Compares the values of script banks a and b, after forcing the values to bytes. - .macro comparebuffers byte1, byte2 + .macro compare_local_to_local byte1, byte2 .byte 0x1b .byte \byte1 .byte \byte2 .endm @ Compares the least-significant byte of the value of script bank a to a fixed byte value (b). - .macro comparebuffertobyte a, b + .macro compare_local_to_value a, b .byte 0x1c .byte \a .byte \b .endm @ Compares the least-significant byte of the value of script bank a to the byte located at offset b. - .macro comparebuffertoptrbyte a, b + .macro compare_local_to_addr a, b .byte 0x1d .byte \a .4byte \b .endm @ Compares the byte located at offset a to the least-significant byte of the value of script bank b. - .macro compareptrbytetobuffer a, b + .macro compare_addr_to_local a, b .byte 0x1e .4byte \a .byte \b .endm @ Compares the byte located at offset a to a fixed byte value (b). - .macro compareptrbytetobyte a, b + .macro compare_addr_to_value a, b .byte 0x1f .4byte \a .byte \b .endm @ Compares the byte located at offset a to the byte located at offset b. - .macro compareptrbytes a, b + .macro compare_addr_to_addr a, b .byte 0x20 .4byte \a .4byte \b .endm - @ Compares the value of a to a fixed word value (b). - .macro compare a, b + @ Compares the value of `var` to a fixed word value (b). + .macro compare_var_to_value var, value .byte 0x21 - .2byte \a - .2byte \b + .2byte \var + .2byte \value .endm - @ Compares the value of a to the value of b. - .macro comparevars a, b + @ Compares the value of `var1` to the value of `var2`. + .macro compare_var_to_var var1, var2 .byte 0x22 - .2byte \a - .2byte \b + .2byte \var1 + .2byte \var2 .endm - @ Calls the ASM routine stored at code. Script execution is blocked until the ASM returns (bx lr, mov pc, lr, etc.). Remember to add 1 to the offset when calling THUMB code. - .macro callasm code + @ Calls the native C function stored at `func`. + .macro callnative func .byte 0x23 - .4byte \code + .4byte \func .endm - @ Replaces a pointer in the script engine RAM with asm_pointer. - .macro jumpasm asm_pointer + @ Replaces the script with the function stored at `func`. Execution returns to the bytecode script when func returns TRUE. + .macro gotonative func .byte 0x24 - .4byte \asm_pointer + .4byte \func .endm - @ Calls a special function; that is, a piece of ASM code designed for use by scripts and listed in a table of pointers. + @ Calls a special function; that is, a function designed for use by scripts and listed in a table of pointers. .macro special function .byte 0x25 .2byte SPECIAL_\function .endm @ Calls a special function. That function's output (if any) will be written to the variable you specify. - .macro specialval output, function + .macro specialvar output, function .byte 0x26 .2byte \output .2byte SPECIAL_\function .endm @ Blocks script execution until a command or ASM code manually unblocks it. Generally used with specific commands and specials. If this command runs, and a subsequent command or piece of ASM does not unblock state, the script will remain blocked indefinitely (essentially a hang). - .macro waitstate + .macro waitstate .byte 0x27 .endm @ Blocks script execution for time (frames? milliseconds?). - .macro pause time + .macro delay time .byte 0x28 .2byte \time .endm @@ -280,134 +280,157 @@ .2byte \a .endm - @ In FireRed, this command is a nop. - .macro compareflags + @ Initializes the RTC`s local time offset to the given hour and minute. In FireRed, this command is a nop. + .macro initclock hour, minute .byte 0x2c + .2byte \hour + .2byte \minute .endm - @ In FireRed, this command is a nop. - .macro checkdailyflags + @ Runs time based events. In FireRed, this command is a nop. + .macro dodailyevents .byte 0x2d .endm - @ Resets the values of variables 0x8000, 0x8001, and 0x8002. Related to RTC in RSE? - .macro resetvars + @ Sets the values of variables 0x8000, 0x8001, and 0x8002 to the current hour, minute, and second. In FRLG, this command sets those variables to zero. + .macro gettime .byte 0x2e .endm @ Plays the specified (sound_number) sound. Only one sound may play at a time, with newer ones interrupting older ones. - .macro playsfx sound_number + .macro playse sound_number .byte 0x2f .2byte \sound_number .endm - @ Blocks script execution until the currently-playing sound (triggered by sound) finishes playing. - .macro checksound + @ Blocks script execution until the currently-playing sound (triggered by playse) finishes playing. + .macro waitse .byte 0x30 .endm @ Plays the specified (fanfare_number) fanfare. - .macro fanfare fanfare_number + .macro playfanfare fanfare_number .byte 0x31 .2byte \fanfare_number .endm @ Blocks script execution until all currently-playing fanfares finish. - .macro waitfanfare + .macro waitfanfare .byte 0x32 .endm @ Plays the specified (song_number) song. The byte is apparently supposed to be 0x00. - .macro playmusic song_number, unknown + .macro playbgm song_number, unknown .byte 0x33 .2byte \song_number .byte \unknown .endm - @ Plays the specified (song_number) song. - .macro playmusicbattle song_number + @ Saves the specified (song_number) song to be played later. + .macro savebgm song_number .byte 0x34 .2byte \song_number .endm @ Crossfades the currently-playing song into the map's default song. - .macro fadedefault + .macro fadedefaultbgm .byte 0x35 .endm @ Crossfades the currently-playng song into the specified (song_number) song. - .macro fademusic song_number + .macro fadenewbgm song_number .byte 0x36 .2byte \song_number .endm @ Fades out the currently-playing song. - .macro fadeout speed + .macro fadeoutbgm speed .byte 0x37 .byte \speed .endm - @ Fades the currently-playing song back in. - .macro fadein speed + @ Fades the previously-playing song back in. + .macro fadeinbgm speed .byte 0x38 .byte \speed .endm @ Sends the player to Warp warp on Map bank.map. If the specified warp is 0xFF, then the player will instead be sent to (X, Y) on the map. - .macro warp bank, map, warp, X, Y + .macro warp map, warp, X, Y .byte 0x39 - .byte \bank - .byte \map + map \map .byte \warp .2byte \X .2byte \Y .endm @ Clone of warp that does not play a sound effect. - .macro warpmuted + .macro warpsilent map, warp, X, Y .byte 0x3a + map \map + .byte \warp + .2byte \X + .2byte \Y .endm - @ Clone of warp that uses "a walking effect". - .macro warpwalk + @ Clone of warp that plays a door opening animation before stepping upwards into it. + .macro warpdoor map, warp, X, Y .byte 0x3b + map \map + .byte \warp + .2byte \X + .2byte \Y .endm @ Warps the player to another map using a hole animation. - .macro warphole bank, map + .macro warphole map .byte 0x3c - .byte \bank - .byte \map + map \map .endm - @ Clone of warp that uses a teleport effect. It is apparently only used in R/S/E.[source] - .macro warpteleport + @ Clone of warp that uses a teleport effect. It is apparently only used in R/S/E. + .macro warpteleport map, warp, X, Y .byte 0x3d + map \map + .byte \warp + .2byte \X + .2byte \Y .endm - @ Clone of warp. Used by an (unused?) Safari Zone script to return the player to the gatehouse and end the Safari Game. - .macro warp3 + @ Sets the warp destination to be used later. + .macro setwarp map, warp, X, Y .byte 0x3e + map \map + .byte \warp + .2byte \X + .2byte \Y .endm - @ Sets a default warp place. If a warp tries to send the player to Warp 127 on Map 127.127, they will instead be sent here. Useful when a map has warps that need to go to script-controlled locations (i.e. elevators). - .macro warpplace bank, map, warp, X, Y + @ Sets the warp destination that a warp to Warp 127 on Map 127.127 will connect to. Useful when a map has warps that need to go to script-controlled locations (i.e. elevators). + .macro setdynamicwarp map, warp, X, Y .byte 0x3f - .byte \bank - .byte \map + map \map .byte \warp .2byte \X .2byte \Y .endm - @ Clone of warp3, except that this writes data to different offsets... - .macro warp4 + @ Sets the destination that diving or emerging from a dive will take the player to. + .macro setdivewarp map, warp, X, Y .byte 0x40 + map \map + .byte \warp + .2byte \X + .2byte \Y .endm - @ Clone of warp3, except that this writes data to different offsets... - .macro warp5 + @ Sets the destination that falling into a hole will take the player to. + .macro setholewarp map, warp, X, Y .byte 0x41 + map \map + .byte \warp + .2byte \X + .2byte \Y .endm @ Retrieves the player's zero-indexed X- and Y-coordinates in the map, and stores them in the specified variables. @@ -417,20 +440,20 @@ .2byte \Y .endm - @ Retrieves the number of Pokmon in the player's party, and stores that number in variable 0x800D (LASTRESULT). - .macro countpokemon + @ Retrieves the number of Pokemon in the player's party, and stores that number in variable 0x800D (LASTRESULT). + .macro getpartysize .byte 0x43 .endm @ Attempts to add quantity of item index to the player's Bag. If the player has enough room, the item will be added and variable 0x800D (LASTRESULT) will be set to 0x0001; otherwise, LASTRESULT is set to 0x0000. - .macro additem index, quantity + .macro giveitem index, quantity .byte 0x44 .2byte \index .2byte \quantity .endm @ Removes quantity of item index from the player's Bag. - .macro removeitem index, quantity + .macro takeitem index, quantity .byte 0x45 .2byte \index .2byte \quantity @@ -457,7 +480,7 @@ .endm @ Adds a quantity amount of item index to the player's PC. Both arguments can be variables. - .macro addpcitem index, quantity + .macro givepcitem index, quantity .byte 0x49 .2byte \index .2byte \quantity @@ -470,139 +493,172 @@ .2byte \quantity .endm - @ In FireRed, this command is a nop. (The argument is read, but not used for anything.) - .macro adddecor a + @ Adds decoration to the player's PC. In FireRed, this command is a nop. (The argument is read, but not used for anything.) + .macro givedecoration decoration .byte 0x4b - .2byte \a + .2byte \decoration .endm - @ In FireRed, this command is a nop. (The argument is read, but not used for anything.) - .macro removedecor a + @ Removes a decoration from the player's PC. In FireRed, this command is a nop. (The argument is read, but not used for anything.) + .macro takedecoration decoration .byte 0x4c - .2byte \a + .2byte \decoration .endm - @ In FireRed, this command is a nop. (The argument is read, but not used for anything.) - .macro testdecor a + @ Checks for decoration in the player's PC. In FireRed, this command is a nop. (The argument is read, but not used for anything.) + .macro checkdecor decoration .byte 0x4d - .2byte \a + .2byte \decoration .endm - @ In FireRed, this command is a nop. (The argument is read, but not used for anything.) - .macro checkdecor a + @ Checks if the player has enough space in their PC to hold decoration. Sets variable 0x800D (LASTRESULT) to 0x0001 if there is room, or 0x0000 is there is no room. In FireRed, this command is a nop. (The argument is read, but not used for anything.) + .macro checkdecorspace decoration .byte 0x4e - .2byte \a + .2byte \decoration .endm - @ Applies the movement data at movements to the specified (index) Person event. Also closes any standard message boxes that are still open. - .macro move index, movements + @ Applies the movement data at movements to the specified (index) Object. Also closes any standard message boxes that are still open. + .macro applymovement index, movements .byte 0x4f .2byte \index .4byte \movements .endm - @ Apparent clone of applymovement. Oddly, it doesn't seem to work at all if applied to any Person other than the player (0xFF), and the X and Y arguments don't seem to do anything. - @ This command in fact uses variables to access the Person event ID. So, for example, if you setvar 0x8000 to 0x3, and then use applymovementpos 0x8000 @move1, Person event 3 will have the movements at @move1 applied to them. Thank you Shiny Quagsire for bringing this to my attention. - .macro movecoords variable, movements + @ Applies the movement data at movements to the specified (index) Object on the specified (map_group, map_num) map. Really only useful if the object has followed from one map to another (e.g. Wally during the catching event). + .macro applymovementat variable, movements, map .byte 0x50 .2byte \variable .4byte \movements + map \map .endm - @ Blocks script execution until the movements being applied to the specified (index) Person event finish. If the specified Person event is 0x0000, then the command will block script execution until all Person events affected by applymovement finish their movements. If the specified Person event is not currently being manipulated with applymovement, then this command does nothing. - .macro waitmove index + @ Blocks script execution until the movements being applied to the specified (index) Object finish. If the specified Object is 0x0000, then the command will block script execution until all Objects affected by applymovement finish their movements. If the specified Object is not currently being manipulated with applymovement, then this command does nothing. + .macro waitmovement index .byte 0x51 .2byte \index .endm - @ Apparent clone of waitmovement. Oddly, it doesn't seem to work at all if applied to any Person other than the player (0xFF), and the X and Y arguments don't seem to do anything. - .macro waitmovexy index, X, Y + @ Blocks script execution until the movements being applied to the specified (index) Object on the specified (map) map finish. + .macro waitmovementat index, map .byte 0x52 .2byte \index - .byte \X - .byte \Y + map \map .endm - @ Attempts to hide the specified (local_ID, a local ID) Person event on the current map, by setting its visibility flag if it has a valid one. If the Person does not have a valid visibility flag, this command does nothing. - .macro disappear local_ID + @ Attempts to hide the specified (index) Object on the current map, by setting its visibility flag if it has a valid one. If the Object does not have a valid visibility flag, this command does nothing. + .macro removeobject index .byte 0x53 - .2byte \local_ID + .2byte \index .endm - @ Clone of hidesprite that also moves the Person? Test it! - .macro disappearxy index, X, Y + @ Attempts to hide the specified (index) Object on the specified (map_group, map_num) map, by setting its visibility flag if it has a valid one. If the Object does not have a valid visibility flag, this command does nothing. + .macro removeobjectat index, map .byte 0x54 .2byte \index - .byte \X - .byte \Y + map \map .endm - .macro reappear word + @ Unsets the specified (index) Object's visibility flag on the current map if it has a valid one. If the Object does not have a valid visibility flag, this command does nothing. + .macro addobject index .byte 0x55 - .2byte \word + .2byte \index .endm - .macro reappearxy word, byte1, byte2 + @ Unsets the specified (index) Object's visibility flag on the specified (map_group, map_num) map if it has a valid one. If the Object does not have a valid visibility flag, this command does nothing. + .macro addobjectat index, map .byte 0x56 - .2byte \word - .byte \byte1 - .byte \byte2 + .2byte \index + map \map .endm - .macro movesprite word1, word2, word3 + @ Sets the specified (index) Object's position on the current map. + .macro setobjectxy index, x, y .byte 0x57 - .2byte \word1 - .2byte \word2 - .2byte \word3 + .2byte \index + .2byte \x + .2byte \y .endm - .macro spritevisible word, byte1, byte2 + .macro showobjectat index, map .byte 0x58 - .2byte \word - .byte \byte1 - .byte \byte2 + .2byte \index + map \map .endm - .macro spriteinvisible word, byte1, byte2 + .macro hideobjectat index, map .byte 0x59 - .2byte \word - .byte \byte1 - .byte \byte2 + .2byte \index + map \map .endm - @ If the script was called by a Person event, then that Person will turn to face toward the tile that the player is stepping off of. - .macro faceplayer + @ If the script was called by an Object, then that Object will turn to face toward the metatile that the player is standing on. + .macro faceplayer .byte 0x5a .endm - .macro spriteface word, byte + .macro turnobject index, direction .byte 0x5b - .2byte \word - .byte \byte + .2byte \index + .byte \direction .endm @ If the Trainer flag for Trainer index is not set, this command does absolutely nothing. - .macro trainerbattle byte, word1, word2, pointer1, pointer2, pointer3, pointer4 + .macro trainerbattle type, trainer, word, pointer1, pointer2, pointer3, pointer4 .byte 0x5c - .byte \byte - .2byte \word1 - .2byte \word2 - .4byte \pointer1 - .4byte \pointer2 - .4byte \pointer3 - .4byte \pointer4 + .byte \type + .2byte \trainer + .2byte \word + .if \type == 0 + .4byte \pointer1 @ text + .4byte \pointer2 @ text + .elseif \type == 1 + .4byte \pointer1 @ text + .4byte \pointer2 @ text + .4byte \pointer3 @ event script + .elseif \type == 2 + .4byte \pointer1 @ text + .4byte \pointer2 @ text + .4byte \pointer3 @ event script + .elseif \type == 3 + .4byte \pointer1 @ text + .elseif \type == 4 + .4byte \pointer1 @ text + .4byte \pointer2 @ text + .4byte \pointer3 @ text + .elseif \type == 5 + .4byte \pointer1 @ text + .4byte \pointer2 @ text + .elseif \type == 6 + .4byte \pointer1 @ text + .4byte \pointer2 @ text + .4byte \pointer3 @ text + .4byte \pointer4 @ event script + .elseif \type == 7 + .4byte \pointer1 @ text + .4byte \pointer2 @ text + .4byte \pointer3 @ text + .elseif \type == 8 + .4byte \pointer1 @ text + .4byte \pointer2 @ text + .4byte \pointer3 @ text + .4byte \pointer4 @ event script + .elseif \type == 9 + .4byte \pointer1 @ text + .4byte \pointer2 @ text + .endif .endm + @ Starts a trainer battle using the battle information stored in RAM (usually by trainerbattle, which actually calls this command behind-the-scenes), and blocks script execution until the battle finishes. - .macro reptrainerbattle + .macro trainerbattlebegin .byte 0x5d .endm - .macro endtrainerbattle + .macro ontrainerbattleend .byte 0x5e .endm - .macro endtrainerbattle2 + .macro ontrainerbattleendgoto .byte 0x5f .endm @@ -612,38 +668,38 @@ .2byte \trainer .endm - @ Sets Flag (trainer + 0x500). (I didn't make a mistake. The command names actually are backwards.) - .macro cleartrainerflag trainer + @ Sets Flag (trainer + 0x500). + .macro settrainerflag trainer .byte 0x61 .2byte \trainer .endm - @ Clears Flag (trainer + 0x500). (I didn't make a mistake. The command names actually are backwards.) - .macro settrainerflag trainer + @ Clears Flag (trainer + 0x500). + .macro cleartrainerflag trainer .byte 0x62 .2byte \trainer .endm - .macro movespriteperm word1, word2, word3 + .macro setobjectxyperm index, x, y .byte 0x63 - .2byte \word1 - .2byte \word2 - .2byte \word3 + .2byte \index + .2byte \x + .2byte \y .endm - .macro moveoffscreen word + .macro moveobjectoffscreen index .byte 0x64 - .2byte \word + .2byte \index .endm - .macro spritebehave word, byte + .macro setobjectmovementtype word, byte .byte 0x65 .2byte \word .byte \byte .endm @ If a standard message box (or its text) is being drawn on-screen, this command blocks script execution until the box and its text have been fully drawn. - .macro waittext + .macro waitmessage .byte 0x66 .endm @@ -653,81 +709,79 @@ .4byte \text .endm - @ Holds the current message box open until the player presses a key. The message box is then closed. - .macro closebutton + @ Closes the current message box. + .macro closemessage .byte 0x68 .endm - @ Ceases movement for all OWs on-screen. - .macro lockall + @ Ceases movement for all Objects on-screen. + .macro lockall .byte 0x69 .endm - @ If the script was called by a Person event, then that Person's movement will cease. - .macro lock + @ If the script was called by an Object, then that Object's movement will cease. + .macro lock .byte 0x6a .endm - @ Resumes normal movement for all OWs on-screen, and closes any standard message boxes that are still open. - .macro releaseall + @ Resumes normal movement for all Objects on-screen, and closes any standard message boxes that are still open. + .macro releaseall .byte 0x6b .endm - @ If the script was called by a Person event, then that Person's movement will resume. This command also closes any standard message boxes that are still open. - .macro release + @ If the script was called by an Object, then that Object's movement will resume. This command also closes any standard message boxes that are still open. + .macro release .byte 0x6c .endm @ Blocks script execution until the player presses any key. - .macro waitbutton + .macro waitbuttonpress .byte 0x6d .endm @ Displays a YES/NO multichoice box at the specified coordinates, and blocks script execution until the user makes a selection. Their selection is stored in variable 0x800D (LASTRESULT); 0x0000 for "NO" or if the user pressed B, and 0x0001 for "YES". - .macro yesnobox X, Y + .macro yesnobox x, y .byte 0x6e - .byte \X - .byte \Y + .byte \x + .byte \y .endm - @ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made. Lists of options are predefined and the one to be used is specified with list. If B is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button. - .macro multichoice X, Y, list, B + @ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made. Lists of options are predefined and the one to be used is specified with list. If b is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button. + .macro multichoice x, y, list, b .byte 0x6f - .byte \X - .byte \Y + .byte \x + .byte \y .byte \list - .byte \B + .byte \b .endm - @ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made. Lists of options are predefined and the one to be used is specified with list. The default argument determines the initial position of the cursor when the box is first opened; it is zero-indexed, and if it is too large, it is treated as 0x00. If B is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button. - .macro multichoicedef X, Y, list, default, B + @ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made. Lists of options are predefined and the one to be used is specified with list. The default argument determines the initial position of the cursor when the box is first opened; it is zero-indexed, and if it is too large, it is treated as 0x00. If b is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button. + .macro multichoicedefault x, y, list, default, b .byte 0x70 - .byte \X - .byte \Y + .byte \x + .byte \y .byte \list .byte \default - .byte \B + .byte \b .endm @ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made. Lists of options are predefined and the one to be used is specified with list. The per_row argument determines how many list items will be shown on a single row of the box. - .macro multichoicerow X, Y, list, per_row, B + .macro multichoicegrid x, y, list, per_row, B .byte 0x71 - .byte \X - .byte \Y + .byte \x + .byte \y .byte \list .byte \per_row .byte \B .endm - .macro showbox byte1, byte2, byte3, byte4 + @ Nopped in Emerald. + .macro drawbox .byte 0x72 - .byte \byte1 - .byte \byte2 - .byte \byte3 - .byte \byte4 .endm - .macro hidebox byte1, byte2, byte3, byte4 + @ Nopped in Emerald, but still consumes parameters. + .macro erasebox byte1, byte2, byte3, byte4 .byte 0x73 .byte \byte1 .byte \byte2 @@ -735,7 +789,8 @@ .byte \byte4 .endm - .macro clearbox byte1, byte2, byte3, byte4 + @ Nopped in Emerald, but still consumes parameters. + .macro drawboxtext byte1, byte2, byte3, byte4 .byte 0x74 .byte \byte1 .byte \byte2 @@ -743,33 +798,33 @@ .byte \byte4 .endm - @ Displays a box containing the front sprite for the specified (species) Pokmon species. - .macro showpokepic species, X, Y + @ Displays a box containing the front sprite for the specified (species) Pokemon species. + .macro drawmonpic species, x, y .byte 0x75 .2byte \species - .byte \X - .byte \Y + .byte \x + .byte \y .endm - @ Hides all boxes displayed with showpokepic. - .macro hidepokepic + @ Hides all boxes displayed with drawmonpic. + .macro erasemonpic .byte 0x76 .endm - @ In FireRed, this command is a nop. (The argument is discarded.) - .macro showcontestwinner a + @ Draws an image of the winner of the contest. In FireRed, this command is a nop. (The argument is discarded.) + .macro drawcontestwinner a .byte 0x77 .byte \a .endm - @ Displays the string at pointer as braille text in a standard message box. The string must be formatted to use braille characters. - .macro braille text + @ Displays the string at pointer as braille text in a standard message box. The string must be formatted to use braille characters and needs to provide six extra starting characters that are skipped (in RS, these characters determined the box's size and position, but in Emerald these are calculated automatically). + .macro braillemessage text .byte 0x78 .4byte \text .endm - @ Gives the player one of the specified (species) Pokmon at level level holding item. The unknown arguments should all be zeroes. - .macro givepokemon species, level, item, unknown1, unknown2, unknown3 + @ Gives the player one of the specified (species) Pokemon at level level holding item. The unknown arguments should all be zeroes. + .macro givemon species, level, item, unknown1, unknown2, unknown3 .byte 0x79 .2byte \species .byte \level @@ -779,81 +834,81 @@ .byte \unknown3 .endm - .macro giveegg word + .macro giveegg species .byte 0x7a - .2byte \word + .2byte \species .endm - .macro setpokemove byte1, byte2, word + .macro setmonmove byte1, byte2, word .byte 0x7b .byte \byte1 .byte \byte2 .2byte \word .endm - @ Checks if at least one Pokmon in the player's party knows the specified (index) attack. If so, variable 0x800D (LASTRESULT) is set to the (zero-indexed) slot number of the Pokmon that knows the move. If not, LASTRESULT is set to 0x0006. - .macro checkattack index + @ Checks if at least one Pokemon in the player's party knows the specified (index) attack. If so, variable 0x800D (LASTRESULT) is set to the (zero-indexed) slot number of the first Pokemon that knows the move. If not, LASTRESULT is set to 0x0006. Variable 0x8004 is also set to this Pokemon's species. + .macro checkpartymove index .byte 0x7c .2byte \index .endm - @ Writes the name of the Pokmon at index species to the specified buffer. - .macro bufferpoke out, species + @ Writes the name of the Pokemon at index species to the specified buffer. + .macro bufferspeciesname out, species .byte 0x7d .byte \out .2byte \species .endm - @ Writes the name of the first Pokmon in the player's party to the specified buffer. - .macro bufferfirstpoke out + @ Writes the name of the species of the first Pokemon in the player's party to the specified buffer. + .macro bufferleadmonspeciesname out .byte 0x7e .byte \out .endm - @ Writes the name of the Pokmon in slot slot (zero-indexed) of the player's party to the specified buffer. If an empty or invalid slot is specified, ten spaces ("") are written to the buffer. - .macro bufferpartypoke out, slot + @ Writes the nickname of the Pokemon in slot slot (zero-indexed) of the player's party to the specified buffer. If an empty or invalid slot is specified, ten spaces ("") are written to the buffer. + .macro bufferpartymonnick out, slot .byte 0x7f .byte \out .2byte \slot .endm @ Writes the name of the item at index item to the specified buffer. If the specified index is larger than the number of items in the game (0x176), the name of item 0 ("????????") is buffered instead. - .macro bufferitem out, item + .macro bufferitemname out, item .byte 0x80 .byte \out .2byte \item .endm - @ In FireRed, this command is a nop. (The first argument is discarded immediately. The second argument is read, but not used for anything.) - .macro bufferdecor a, b + @ Writes the name of the decoration at index decoration to the specified buffer. In FireRed, this command is a nop. + .macro bufferdecorationname out, decoration .byte 0x81 - .byte \a - .2byte \b + .byte \out + .2byte \decoration .endm - @ Writes the name of the attack at index attack to the specified buffer. - .macro bufferattack out, attack + @ Writes the name of the move at index move to the specified buffer. + .macro buffermovename out, move .byte 0x82 .byte \out - .2byte \attack + .2byte \move .endm @ Converts the value of input to a decimal string, and writes that string to the specified buffer. - .macro buffernum out, input + .macro buffernumberstring out, input .byte 0x83 .byte \out .2byte \input .endm - @ Writes the standard string identified by index to the specified buffer. Specifying an invalid standard string (e.x. 0x2B) can and usually will cause data corruption (I've observed destruction of the stored player name and crashes when entering/exiting certain menu screens). - .macro bufferstd out, index + @ Writes the standard string identified by index to the specified buffer. This command has no protections in place at all, so specifying an invalid standard string (e.x. 0x2B) can and usually will cause data corruption. + .macro bufferstdstring out, index .byte 0x84 .byte \out .2byte \index .endm @ Copies the string at offset to the specified buffer. - .macro buffertext out, offset + .macro bufferstring out, offset .byte 0x85 .byte \out .4byte \offset @@ -865,45 +920,49 @@ .4byte \products .endm - @ Apparent clone of pokemart. - .macro pokemartdecor products + @ Opens the Pokemart system and treats the list of items as decorations. + .macro pokemartdecoration products .byte 0x87 .4byte \products .endm - @ Apparent clone of pokemart. - .macro pokemartbp products + @ Apparent clone of pokemartdecoration. + .macro pokemartdecoration2 products .byte 0x88 .4byte \products .endm - .macro pokecasino word + @ Starts up the slot machine minigame. + .macro playslotmachine word .byte 0x89 .2byte \word .endm - @ In FireRed, this command is a nop. - .macro event_8a + @ Sets a berry tree's specific berry and growth stage. In FireRed, this command is a nop. + .macro setberrytree tree_id, berry, growth_stage .byte 0x8a + .byte \tree_id + .byte \berry + .byte \growth_stage .endm - @ In FireRed, this command sets the byte at 0x03000EA8 to 0x01. I do not know what that means. - .macro choosecontestpkmn + @ This allows you to choose a Pokemon to use in a contest. In FireRed, this command sets the byte at 0x03000EA8 to 0x01. + .macro choosecontestpkmn .byte 0x8b .endm - @ In FireRed, this command is a nop. - .macro startcontest + @ Starts a contest. In FireRed, this command is a nop. + .macro startcontest .byte 0x8c .endm - @ In FireRed, this command is a nop. - .macro showcontestresults + @ Shows the results of a contest. In FireRed, this command is a nop. + .macro showcontestresults .byte 0x8d .endm - @ In FireRed, this command is a nop. - .macro contestlinktransfer + @ Starts a contest over a link connection. In FireRed, this command is a nop. + .macro contestlinktransfer .byte 0x8e .endm @@ -921,7 +980,7 @@ .endm @ If check is 0x00, this command subtracts value from the player's money. - .macro paymoney value, check + .macro takemoney value, check .byte 0x91 .4byte \value .byte \check @@ -935,106 +994,107 @@ .endm @ Spawns a secondary box showing how much money the player has. - .macro showmoney X, Y + .macro showmoneybox x, y, check .byte 0x93 - .byte \X - .byte \Y + .byte \x + .byte \y + .byte \check .endm @ Hides the secondary box spawned by showmoney. - .macro hidemoney X, Y + .macro hidemoneybox .byte 0x94 - .byte \X - .byte \Y .endm - @ Updates the secondary box spawned by showmoney. (What does it do with its arguments?) - .macro updatemoney X, Y + @ Updates the secondary box spawned by showmoney. Consumes but does not use arguments. + .macro updatemoneybox x, y .byte 0x95 - .byte \X - .byte \Y + .byte \x + .byte \y .endm - @ In FireRed, this command is a nop. - .macro event_96 + @ Gets the price reduction for the index (word) given. In FireRed, this command is a nop. + .macro getpricereduction word .byte 0x96 + .2byte \word .endm - @ Fades the screen to black or back, using the specified effect. Effect 0x00 fades in, and effect 0x01 fades out. I don't know if other effects exist. + @ Fades the screen to and from black and white. Mode 0x00 fades from black, mode 0x01 fades out to black, mode 0x2 fades in from white, and mode 0x3 fades out to white. .macro fadescreen effect .byte 0x97 .byte \effect .endm - .macro fadescreendelay byte1, byte2 + @ Fades the screen to and from black and white. Mode 0x00 fades from black, mode 0x01 fades out to black, mode 0x2 fades in from white, and mode 0x3 fades out to white. Other modes may exist. + .macro fadescreenspeed effect, speed .byte 0x98 - .byte \byte1 - .byte \byte2 + .byte \effect + .byte \speed .endm - .macro darken word + .macro setflashradius word .byte 0x99 .2byte \word .endm - .macro lighten byte + .macro animateflash byte .byte 0x9a .byte \byte .endm - .macro message2 pointer + .macro messageautoscroll pointer .byte 0x9b .4byte \pointer .endm @ Executes the specified field move animation. - .macro doanimation animation + .macro dofieldeffect animation .byte 0x9c .2byte \animation .endm - @ Tells the game which party Pokmon to use for the next field move animation. - .macro setanimation animation, slot + @ Sets up the field effect argument argument with the value value. + .macro setfieldeffectargument argument, param .byte 0x9d - .byte \animation - .2byte \slot + .byte \argument + .2byte \param .endm @ Blocks script execution until all playing field move animations complete. - .macro checkanimation animation + .macro waitfieldeffect animation .byte 0x9e .2byte \animation .endm - @ Sets which healing place the player will return to if all of the Pokmon in their party faint. A list of available healing places can be found on PokeCommunity. - .macro sethealplace flightspot + @ Sets which healing place the player will return to if all of the Pokemon in their party faint. + .macro setrespawn flightspot .byte 0x9f .2byte \flightspot .endm @ Checks the player's gender. If male, then 0x0000 is stored in variable 0x800D (LASTRESULT). If female, then 0x0001 is stored in LASTRESULT. - .macro checkgender + .macro checkplayergender .byte 0xa0 .endm - @ Plays the specified (species) Pokmon's cry. You can use waitcry to block script execution until the sound finishes. - .macro pokecry species, effect + @ Plays the specified (species) Pokemon's cry. You can use waitcry to block script execution until the sound finishes. + .macro playmoncry species, effect .byte 0xa1 .2byte \species .2byte \effect .endm - @ Changes the tile at (X, Y) on the current map. - .macro setmaptile X, Y, tile_number, tile_attrib + @ Changes the metatile at (x, y) on the current map. + .macro setmetatile x, y, metatile_number, tile_attrib .byte 0xa2 - .2byte \X - .2byte \Y - .2byte \tile_number + .2byte \x + .2byte \y + .2byte \metatile_number .2byte \tile_attrib .endm @ Queues a weather change to the default weather for the map. - .macro resetweather + .macro resetweather .byte 0xa3 .endm @@ -1045,106 +1105,108 @@ .endm @ Executes the weather change queued with resetweather or setweather. The current weather will smoothly fade into the queued weather. - .macro doweather + .macro doweather .byte 0xa5 .endm @ This command manages cases in which maps have tiles that change state when stepped on (specifically, cracked/breakable floors). - .macro tileeffect subroutine + .macro setstepcallback subroutine .byte 0xa6 .byte \subroutine .endm - .macro setmapfooter word + .macro setmaplayoutindex index .byte 0xa7 - .2byte \word + .2byte \index .endm - .macro spritelevelup word, byte1, byte2, byte3 + .macro setobjectpriority index, map, priority .byte 0xa8 - .2byte \word - .byte \byte1 - .byte \byte2 - .byte \byte3 + .2byte \index + map \map + .byte \priority .endm - .macro restorespritelevel word, byte1, byte2 + .macro resetobjectpriority index, map .byte 0xa9 - .2byte \word - .byte \byte1 - .byte \byte2 + .2byte \index + map \map .endm - .macro createvsprite byte1, byte2, word1, word2, byte3, byte4 + .macro createvobject sprite, byte2, x, y, elevation, direction .byte 0xaa - .byte \byte1 + .byte \sprite .byte \byte2 - .2byte \word1 - .2byte \word2 - .byte \byte3 - .byte \byte4 + .2byte \x + .2byte \y + .byte \elevation + .byte \direction .endm - .macro vspriteface byte1, byte2 + .macro turnvobject index, direction .byte 0xab - .byte \byte1 - .byte \byte2 + .byte \index + .byte \direction .endm - @ Queues the opening of the door tile at (X, Y) with an animation. - .macro setdooropened X, Y + @ Opens the door metatile at (X, Y) with an animation. + .macro opendoor x, y .byte 0xac - .2byte \X - .2byte \Y + .2byte \x + .2byte \y .endm - @ Queues the closing of the door tile at (X, Y) with an animation. - .macro setdoorclosed X, Y + @ Closes the door metatile at (X, Y) with an animation. + .macro closedoor x, y .byte 0xad - .2byte \X - .2byte \Y + .2byte \x + .2byte \y .endm - @ Executes the state changes queued with setdooropened, setdoorclosed, setdooropened2, and setdoorclosed2. - .macro doorchange + @ Waits for the door animation started with opendoor or closedoor to finish. + .macro waitdooranim .byte 0xae .endm - @ Queues the opening of the door tile at (X, Y) without an animation. - .macro setdooropened2 X, Y + @ Sets the door tile at (x, y) to be open without an animation. + .macro setdooropen x, y .byte 0xaf - .2byte \X - .2byte \Y + .2byte \x + .2byte \y .endm - @ Queues the closing of the door tile at (X, Y) without an animation. - .macro setdoorclosed2 X, Y + @ Sets the door tile at (x, y) to be closed without an animation. + .macro setdoorclosed2 x, y .byte 0xb0 - .2byte \X - .2byte \Y + .2byte \x + .2byte \y .endm - @ In FireRed, this command is a nop. - .macro event_b1 + @ In Emerald, this command consumes its parameters and does nothing. In FireRed, this command is a nop. + .macro addelevmenuitem a, b, c, d .byte 0xb1 + .byte \a + .2byte \b + .2byte \c + .2byte \d .endm - @ In FireRed, this command is a nop. - .macro event_b2 + @ In FireRed and Emerald, this command is a nop. + .macro showelevmenu .byte 0xb2 .endm - .macro checkcoins word + .macro checkcoins out .byte 0xb3 - .2byte \word + .2byte \out .endm - .macro givecoins word + .macro givecoins count .byte 0xb4 - .2byte \word + .2byte \count .endm - .macro removecoins word + .macro takecoins word .byte 0xb5 .2byte \word .endm @@ -1157,8 +1219,8 @@ .2byte \item .endm - @ Starts a wild battle against the Pokmon generated by setwildbattle. Blocks script execution until the battle finishes. - .macro dowildbattle + @ Starts a wild battle against the Pokemon generated by setwildbattle. Blocks script execution until the battle finishes. + .macro dowildbattle .byte 0xb7 .endm @@ -1168,7 +1230,7 @@ .2byte \word .endm - .macro vjump pointer + .macro vgoto pointer .byte 0xb9 .4byte \pointer .endm @@ -1178,19 +1240,19 @@ .4byte \pointer .endm - .macro if5 byte, pointer + .macro vgoto_if byte, pointer .byte 0xbb .byte \byte .4byte \pointer .endm - .macro if6 byte, pointer + .macro vcall_if byte, pointer .byte 0xbc .byte \byte .4byte \pointer .endm - .macro vtext pointer + .macro vmessage pointer .byte 0xbd .4byte \pointer .endm @@ -1200,46 +1262,50 @@ .4byte \pointer .endm - .macro vbuffer byte, pointer + .macro vbufferstring byte, pointer .byte 0xbf .byte \byte .4byte \pointer .endm @ Spawns a secondary box showing how many Coins the player has. - .macro showcoins X, Y + .macro showcoinsbox x, y .byte 0xc0 - .byte \X - .byte \Y + .byte \x + .byte \y .endm - @ Hides the secondary box spawned by showcoins. It doesn't appear to use its arguments, but they are still required. - .macro hidecoins X, Y + @ Hides the secondary box spawned by showcoins. It consumes its arguments but doesn't use them. + .macro hidecoinsbox x, y .byte 0xc1 - .byte \X - .byte \Y + .byte \x + .byte \y .endm - @ Updates the secondary box spawned by showcoins. (What does it do with its arguments?) - .macro updatecoins X, Y + @ Updates the secondary box spawned by showcoins. It consumes its arguments but doesn't use them. + .macro updatecoinsbox x, y .byte 0xc2 - .byte \X - .byte \Y + .byte \x + .byte \y .endm - @ Increases the value of the specified hidden variable by 1. The hidden variable's value will not be allowed to exceed 0x00FFFFFF. - .macro inccounter a + @ Increases the value of the specified game stat by 1. The stat's value will not be allowed to exceed 0x00FFFFFF. + .macro incrementgamestat stat .byte 0xc3 - .byte \a + .byte \stat .endm - @ Clone of warp... Except that it doesn't appear to have any effect when used in some of FireRed's default level scripts. (If it did, Berry Forest would be impossible to enter...) - .macro warp6 + @ Sets the destination that using an Escape Rope or Dig will take the player to. + .macro setescapewarp map, warp, x, y .byte 0xc4 + map \map + .byte \warp + .2byte \x + .2byte \y .endm @ Blocks script execution until cry finishes. - .macro waitpokecry + .macro waitmoncry .byte 0xc5 .endm @@ -1263,17 +1329,17 @@ .endm @ The exact purpose of this command is unknown, but it is related to the blue help-text box that appears on the bottom of the screen when the Main Menu is opened. - .macro unloadhelp + .macro unloadhelp .byte 0xc9 .endm @ After using this command, all standard message boxes will use the signpost frame. - .macro signmsg + .macro signmsg .byte 0xca .endm @ Ends the effects of signmsg, returning message box frames to normal. - .macro normalmsg + .macro normalmsg .byte 0xcb .endm @@ -1284,82 +1350,81 @@ .4byte \value .endm - @ Makes the Pokmon in the specified slot of the player's party obedient. It will not randomly disobey orders in battle. - .macro setobedience slot + @ Makes the Pokemon in the specified slot of the player's party obedient. It will not randomly disobey orders in battle. + .macro setmonobedient slot .byte 0xcd .2byte \slot .endm - @ Checks if the Pokmon in the specified slot of the player's party is obedient. If the Pokmon is disobedient, 0x0001 is written to script variable 0x800D (LASTRESULT). If the Pokmon is obedient (or if the specified slot is empty or invalid), 0x0000 is written. - .macro checkobedience slot + @ Checks if the Pokemon in the specified slot of the player's party is obedient. If the Pokemon is disobedient, 0x0001 is written to script variable 0x800D (LASTRESULT). If the Pokemon is obedient (or if the specified slot is empty or invalid), 0x0000 is written. + .macro checkmonobedience slot .byte 0xce .2byte \slot .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 0x020370A4. - .macro execram + @ 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 .byte 0xcf .endm @ Sets worldmapflag to 1. This allows the player to Fly to the corresponding map, if that map has a flightspot. - .macro setworldflag worldmapflag + .macro setworldmapflag worldmapflag .byte 0xd0 .2byte \worldmapflag .endm @ Clone of warpteleport? It is apparently only used in FR/LG, and only with specials.[source] - .macro warpteleport2 + .macro warpteleport2 map, warp, x, y .byte 0xd1 + map \map + .byte \warp + .2byte \x + .2byte \y .endm - @ Changes the location where the player caught the Pokmon in the specified slot of their party. A list of valid catch locations can be found on PokeCommunity. - .macro setcatchlocale slot, location + @ Changes the location where the player caught the Pokemon in the specified slot of their party. + .macro setmonmetlocation slot, location .byte 0xd2 .2byte \slot .byte \location .endm - @ Sets variable 0x8004 to a value based on the width of the braille string at text. - .macro braille2 text + .macro mossdeepgym1 unknown .byte 0xd3 - .4byte \text + .2byte \unknown .endm - @ Writes the name of the specified (item) item to the specified buffer. If the specified item is a Berry (0x85 - 0xAE) or Poke Ball (0x4) and if the quantity is 2 or more, the buffered string will be pluralized ("IES" or "S" appended). If the specified item is the Enigma Berry, I have no idea what this command does (but testing showed no pluralization). If the specified index is larger than the number of items in the game (0x176), the name of item 0 ("????????") is buffered instead. - .macro storeitems out, item, quantity + .macro mossdeepgym2 .byte 0xd4 - .byte \out - .2byte \item - .2byte \quantity .endm @ In FireRed, this command is a nop. - .macro event_d5 + .macro mossdeepgym3 var .byte 0xd5 + .2byte \var .endm - .macro event_d6 + .macro mossdeepgym4 .byte 0xd6 .endm - .macro warp7 byte1, byte2, byte3, word1, word2 + .macro warp7 map, byte, word1, word2 .byte 0xd7 - .byte \byte1 - .byte \byte2 - .byte \byte3 + map \map + .byte \byte .2byte \word1 .2byte \word2 .endm - .macro event_d8 + .macro cmdD8 .byte 0xd8 .endm - .macro event_d9 + .macro cmdD9 .byte 0xd9 .endm - .macro hidebox2 + .macro hidebox2 .byte 0xda .endm @@ -1368,21 +1433,21 @@ .4byte \pointer .endm - .macro fadescreen3 byte + .macro fadescreenswapbuffers byte .byte 0xdc .byte \byte .endm - .macro buffertrainerclass byte, word + .macro buffertrainerclassname out, class .byte 0xdd - .byte \byte - .2byte \word + .byte \out + .2byte \class .endm - .macro buffertrainername byte, word + .macro buffertrainername out, trainer .byte 0xde - .byte \byte - .2byte \word + .byte \out + .2byte \trainer .endm .macro pokenavcall pointer @@ -1390,24 +1455,62 @@ .4byte \pointer .endm - .macro warp8 byte1, byte2, byte3, word1, word2 + .macro warp8 map, byte, word1, word2 .byte 0xe0 - .byte \byte1 - .byte \byte2 - .byte \byte3 + map \map + .byte \byte .2byte \word1 .2byte \word2 .endm - .macro buffercontesttype byte, word + .macro buffercontesttypestring out, word .byte 0xe1 - .byte \byte + .byte \out .2byte \word .endm - .macro storeitems2 byte, word1, word2 + @ Writes the name of the specified (item) item to the specified buffer. If the specified item is a Berry (0x85 - 0xAE) or Poke Ball (0x4) and if the quantity is 2 or more, the buffered string will be pluralized ("IES" or "S" appended). If the specified item is the Enigma Berry, I have no idea what this command does (but testing showed no pluralization). If the specified index is larger than the number of items in the game (0x176), the name of item 0 ("????????") is buffered instead. + .macro bufferitemnameplural out, item, quantity .byte 0xe2 - .byte \byte - .2byte \word1 - .2byte \word2 + .byte \out + .2byte \item + .2byte \quantity + .endm + + +@ Supplementary + + .macro goto_eq dest + goto_if 1, \dest + .endm + + .macro switch var + copyvar 0x8000, \var + .endm + + .macro case condition, dest + compare_var_to_value 0x8000, \condition + goto_eq \dest + .endm + + .macro msgbox text, type=4 + loadword 0, \text + callstd \type + .endm + + @ Message box types + MSGBOX_YESNO = 5 + + YES = 1 + NO = 0 + + .macro giveitem_std item, amount=1, function=0 + setorcopyvar 0x8000, \item + setorcopyvar 0x8001, \amount + callstd \function + .endm + + .macro givedecoration_std decoration + setorcopyvar 0x8000, \decoration + callstd 7 .endm diff --git a/asm/macros/map.inc b/asm/macros/map.inc index 452f9b714..5367ad712 100644 --- a/asm/macros/map.inc +++ b/asm/macros/map.inc @@ -1,15 +1,115 @@ .macro new_map_group - .set cur_map_group, cur_map_group + 1 + inc cur_map_group .set cur_map_num, 0 .endm .macro map_group map_name .set GROUP_\map_name, cur_map_group .set MAP_\map_name, cur_map_num - .set cur_map_num, cur_map_num + 1 + inc cur_map_num .endm .macro map map_name .byte GROUP_\map_name .byte MAP_\map_name .endm + + .macro warp_map map_name + .byte MAP_\map_name + .byte GROUP_\map_name + .endm + + .macro heal_location map_name, x, y + .byte GROUP_\map_name + .byte MAP_\map_name + .2byte \x + .2byte \y + .space 2 + .endm + + .equiv GROUP_NONE, 0x7f + .equiv MAP_NONE, 0x7f + + .equiv GROUP_UNDEFINED, 0xff + .equiv MAP_UNDEFINED, 0xff + + .macro map_script type, address + .byte \type + .4byte \address + .endm + + .macro map_script_2 word1, word2, address + .2byte \word1 + .2byte \word2 + .4byte \address + .endm + + .macro object_event index, gfx, replacement, filler1, x, y, elevation, movement_type, radius, filler2, trainer_type, sight_radius_tree_etc, script, event_flag, filler3, filler4 + .byte \index, \gfx, \replacement, \filler1 + .2byte \x + .2byte \y + .byte \elevation, \movement_type, \radius, \filler2 + .2byte \trainer_type, \sight_radius_tree_etc + .4byte \script + .2byte \event_flag + .byte \filler3, \filler4 + inc _num_npcs + .endm + + .macro warp_def x, y, byte, warp, map + .2byte \x, \y + .byte \byte, \warp + warp_map \map + inc _num_warps + .endm + + .macro coord_event x, y, byte1, byte2, word1, word2, word3, script + .2byte \x, \y + .byte \byte1, \byte2 + .2byte \word1, \word2, \word3 + .4byte \script + inc _num_traps + .endm + + .macro bg_event x, y, byte, kind, word, arg6, arg7, arg8 + .2byte \x, \y + .byte \byte, \kind + .2byte \word + .if \kind < 5 + .4byte \arg6 + .else + .2byte \arg6 + .byte \arg7, \arg8 + .endif + inc _num_signs + .endm + + .macro map_events npcs, warps, traps, signs + .byte _num_npcs, _num_warps, _num_traps, _num_signs + .4byte \npcs, \warps, \traps, \signs + reset_map_events + .endm + + .macro reset_map_events + .set _num_npcs, 0 + .set _num_warps, 0 + .set _num_traps, 0 + .set _num_signs, 0 + .endm + + reset_map_events + + + .equiv connection_down, 1 + .equiv connection_up, 2 + .equiv connection_left, 3 + .equiv connection_right, 4 + .equiv connection_dive, 5 + .equiv connection_emerge, 6 + + .macro connection direction, offset, map, filler + .4byte connection_\direction + .4byte \offset + map \map + .space 2 + .endm diff --git a/asm/macros/movement.inc b/asm/macros/movement.inc new file mode 100644 index 000000000..40fb3ca4e --- /dev/null +++ b/asm/macros/movement.inc @@ -0,0 +1,118 @@ + .macro create_movement name + enum _\name + .macro \name + .byte _\name + .endm + .endm + + enum_start + create_movement step_00 + create_movement step_01 + create_movement step_02 + create_movement step_03 + create_movement slow_step_down + create_movement slow_step_up + create_movement slow_step_left + create_movement slow_step_right + create_movement step_down + create_movement step_up + create_movement step_left + create_movement step_right + create_movement fast_step_down + create_movement fast_step_up + create_movement fast_step_left + create_movement fast_step_right + create_movement step_10 + create_movement step_11 + create_movement step_12 + create_movement step_13 + create_movement step_14 + create_movement step_15 + create_movement step_16 + create_movement step_17 + create_movement step_18 + create_movement step_19 + create_movement step_1a + create_movement step_1b + create_movement step_1c + create_movement step_1d + create_movement step_1e + create_movement step_1f + create_movement step_20 + create_movement step_21 + create_movement step_22 + create_movement step_23 + create_movement step_24 + create_movement step_25 + create_movement step_26 + create_movement step_27 + create_movement step_28 + create_movement step_29 + create_movement step_2a + create_movement step_2b + create_movement step_2c + create_movement step_2d + create_movement step_2e + create_movement step_2f + create_movement step_30 + create_movement step_31 + create_movement step_32 + create_movement step_33 + create_movement step_34 + create_movement step_35 + create_movement step_36 + create_movement step_37 + create_movement step_38 + create_movement step_39 + create_movement step_3a + create_movement step_3b + create_movement step_3c + create_movement step_3d + create_movement step_3e + create_movement step_3f + create_movement step_40 + create_movement step_41 + create_movement step_42 + create_movement step_43 + create_movement step_44 + create_movement step_45 + create_movement step_46 + create_movement step_47 + create_movement step_48 + create_movement step_49 + create_movement step_4a + create_movement step_4b + create_movement step_4c + create_movement step_4d + create_movement step_4e + create_movement step_4f + create_movement step_50 + create_movement step_51 + create_movement step_52 + create_movement step_53 + create_movement step_54 + create_movement step_55 + create_movement step_56 + create_movement step_57 + create_movement step_58 + create_movement step_59 + create_movement step_5a + create_movement step_5b + create_movement step_5c + create_movement step_5d + create_movement step_5e + create_movement step_5f + create_movement step_60 + create_movement step_61 + create_movement step_62 + create_movement step_63 + + enum_start 0x91 + create_movement step_91 + create_movement step_92 + + enum_start 0x96 + create_movement step_96 + + enum_start 0xfe + create_movement step_end diff --git a/asm/map_obj_lock.s b/asm/map_obj_lock.s index ee60814f5..79823d8eb 100644 --- a/asm/map_obj_lock.s +++ b/asm/map_obj_lock.s @@ -256,7 +256,7 @@ sub_8098574: @ 8098574 lsls r0, 2 ldr r1, =gMapObjects adds r0, r1 - ldr r1, =gScriptFacing + ldr r1, =gSpecialVar_ScriptFacing ldrb r1, [r1] bl FieldObjectFaceOppositeDirection pop {r0} diff --git a/asm/mauville_old_man.s b/asm/mauville_old_man.s index bfcf8742a..5723f5637 100644 --- a/asm/mauville_old_man.s +++ b/asm/mauville_old_man.s @@ -157,7 +157,7 @@ sub_81201C8: @ 81201C8 thumb_func_start sub_81201DC sub_81201DC: @ 81201DC push {r4,lr} - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl sub_81201C8 lsls r0, 24 lsrs r0, 24 @@ -170,7 +170,7 @@ sub_81201DC: @ 81201DC thumb_func_start sub_81201F4 sub_81201F4: @ 81201F4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00002e51 @@ -347,7 +347,7 @@ sub_8120340: @ 8120340 thumb_func_start sub_8120358 sub_8120358: @ 8120358 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00002e28 @@ -379,14 +379,14 @@ sub_812038C: @ 812038C ldr r0, =0x0000ffff cmp r1, r0 bne _081203AC - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 b _081203B6 .pool _081203AC: ldr r0, =gStringVar1 bl CopyEasyChatWord - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 _081203B6: strh r0, [r1] @@ -405,14 +405,14 @@ sub_81203C4: @ 81203C4 ldrb r0, [r2, 0x1] cmp r0, 0xA bne _081203EC - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] strb r0, [r2, 0x1] b _081203F2 .pool _081203EC: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _081203F2: @@ -503,7 +503,7 @@ _081204C4: adds r0, 0x1 _081204C8: strb r0, [r5, 0x1] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] pop {r4-r6} @@ -2382,13 +2382,13 @@ _0812132C: cmp r4, r0 bne _0812135C _0812134E: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] b _08121364 .pool _0812135C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] ldr r0, =gUnknown_03001178 strb r4, [r0] diff --git a/asm/party_menu.s b/asm/party_menu.s index 3d2af7e7d..f5dfdb92a 100755 --- a/asm/party_menu.s +++ b/asm/party_menu.s @@ -1219,7 +1219,7 @@ sub_81B0BFC: @ 81B0BFC ldrb r0, [r0, 0xB] cmp r0, 0xC bne _081B0C40 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] ldr r0, =gSpecialVar_0x8005 @@ -8135,7 +8135,7 @@ sub_81B4578: @ 81B4578 lsls r0, 16 lsrs r0, 16 mov r8, r0 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r7, [r0] cmp r7, 0 bne _081B45F8 @@ -12928,7 +12928,7 @@ _081B6FC0: _081B6FDC: cmp r0, 0x2 bne _081B6FE4 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r2, [r0] _081B6FE4: adds r0, r5, 0 @@ -13324,7 +13324,7 @@ _081B7306: _081B7368: cmp r0, 0x2 bne _081B7370 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] _081B7370: ldr r0, =gTasks @@ -14933,7 +14933,7 @@ sub_81B81A8: @ 81B81A8 bl GetMonData lsls r0, 16 lsrs r7, r0, 16 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0 bne _081B8208 @@ -17381,7 +17381,7 @@ _081B95BA: thumb_func_start sub_81B95E0 sub_81B95E0: @ 81B95E0 push {r4,r5,lr} - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] movs r4, 0 @@ -17490,7 +17490,7 @@ sub_81B968C: @ 81B968C thumb_func_start sub_81B96D0 sub_81B96D0: @ 81B96D0 push {r4,r5,lr} - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] movs r4, 0 @@ -17741,13 +17741,13 @@ sub_81B98DC: @ 81B98DC adds r1, r0, 0 cmp r1, 0 beq _081B990C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] b _081B9910 .pool _081B990C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _081B9910: pop {r0} @@ -17760,7 +17760,7 @@ sub_81B9918: @ 81B9918 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] ldr r0, =gSpecialVar_0x8004 @@ -17813,7 +17813,7 @@ _081B9980: bl sub_80D23A8 cmp r0, 0x1 beq _081B999C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _081B999C: diff --git a/asm/pokemon_summary_screen.s b/asm/pokemon_summary_screen.s index a89c54304..448e7c7a8 100755 --- a/asm/pokemon_summary_screen.s +++ b/asm/pokemon_summary_screen.s @@ -5238,7 +5238,7 @@ _081C6AF8: bl Free adds r0, r5, 0 bl Free - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] b _081C6BC6 @@ -5266,7 +5266,7 @@ _081C6B9C: lsrs r6, r0, 24 cmp r6, 0x2 bls _081C6B9C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] adds r0, r7, 0 diff --git a/asm/pokenav.s b/asm/pokenav.s index 0c7a80742..926e8979a 100755 --- a/asm/pokenav.s +++ b/asm/pokenav.s @@ -27683,7 +27683,7 @@ _081D4AF8: movs r2, 0x80 orrs r1, r2 strb r1, [r0] - ldr r0, =gScriptFacing + ldr r0, =gSpecialVar_ScriptFacing ldrh r0, [r0] cmp r0, 0x2 beq _081D4B3A @@ -29323,7 +29323,7 @@ _081D5854: sub_81D58D8: @ 81D58D8 push {lr} bl sub_80008E8 - ldr r3, =gScriptResult + ldr r3, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r3] ldr r0, =gSaveBlock1Ptr @@ -29381,7 +29381,7 @@ sub_81D5924: @ 81D5924 cmp r4, 0 beq _081D596C _081D5952: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 strh r0, [r1] b _081D59C0 @@ -29413,12 +29413,12 @@ _081D596C: negs r0, r0 ands r0, r2 strb r0, [r1] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r4, [r0] b _081D59C0 .pool _081D59BC: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r6, [r0] _081D59C0: pop {r3} @@ -29444,7 +29444,7 @@ sub_81D59D0: @ 81D59D0 lsrs r5, r0, 24 cmp r5, 0 beq _081D59FC - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r3, [r0] b _081D5A4E .pool @@ -29473,12 +29473,12 @@ _081D59FC: adds r2, r0 ldr r0, [r2] str r0, [r1] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _081D5A4E .pool _081D5A48: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _081D5A4E: @@ -29556,7 +29556,7 @@ sub_81D5AD0: @ 81D5AD0 negs r0, r0 ands r0, r1 strb r0, [r2] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 b _081D5B20 .pool @@ -29569,12 +29569,12 @@ _081D5B00: negs r0, r0 ands r0, r1 strb r0, [r2] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _081D5B20 .pool _081D5B1C: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 _081D5B20: strh r0, [r1] @@ -29653,12 +29653,12 @@ sub_81D5BBC: @ 81D5BBC movs r2, 0 movs r3, 0x1 bl ConvertIntToDecimalStringN - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 b _081D5BF0 .pool _081D5BEC: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 _081D5BF0: strh r0, [r1] @@ -29672,7 +29672,7 @@ _081D5BF0: sub_81D5C00: @ 81D5C00 push {lr} bl sub_81D56B0 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] bl sub_81D5710 @@ -29721,12 +29721,12 @@ sub_81D5C5C: @ 81D5C5C lsrs r1, r0, 24 cmp r1, 0 bne _081D5C74 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _081D5C7A .pool _081D5C74: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _081D5C7A: @@ -30495,7 +30495,7 @@ sub_81D62AC: @ 81D62AC thumb_func_start sub_81D62B4 sub_81D62B4: @ 81D62B4 push {lr} - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrh r1, [r0] movs r0, 0x5 bl sub_81D572C @@ -30772,7 +30772,7 @@ _081D64D4: thumb_func_start sub_81D64DC sub_81D64DC: @ 81D64DC - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ef9 @@ -30825,7 +30825,7 @@ sub_81D6534: @ 81D6534 cmp r0, 0x6 beq _081D6560 bl sub_81D5C00 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0 beq _081D6560 @@ -30851,12 +30851,12 @@ sub_81D6568: @ 81D6568 ands r0, r1 cmp r0, 0 beq _081D6590 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 b _081D6594 .pool _081D6590: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 _081D6594: strh r0, [r1] diff --git a/asm/recorded_battle.s b/asm/recorded_battle.s index 55cfdf6ef..bef4f863f 100644 --- a/asm/recorded_battle.s +++ b/asm/recorded_battle.s @@ -334,7 +334,7 @@ RecordedBattle_ReadBankAction: @ 8185054 cmp r0, 0xFF bne _081850BC _0818507A: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, =gBattleOutcome movs r0, 0x5 strb r0, [r1] diff --git a/asm/rom6.s b/asm/rom6.s index 87b780ba5..83fbece49 100644 --- a/asm/rom6.s +++ b/asm/rom6.s @@ -31,7 +31,7 @@ npc_before_player_of_type: @ 8135424 ldrb r0, [r2, 0x5] cmp r0, r5 bne _08135470 - ldr r1, =gScriptLastTalked + ldr r1, =gSpecialVar_ScriptLastTalked ldrb r0, [r2, 0x8] strh r0, [r1] movs r0, 0x1 @@ -262,7 +262,7 @@ sub_8135654: @ 8135654 lsls r0, 24 cmp r0, 0 beq _0813568C - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 @@ -2136,7 +2136,7 @@ _081366B6: _081366D0: movs r0, 0x5 bl PlaySE - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r2, =0x0000ffff adds r1, r2, 0 strh r1, [r0] @@ -2853,7 +2853,7 @@ sub_8136D2C: @ 8136D2C adds r1, r3 ldr r1, [r1] bl StringCopy - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldrh r0, [r5] strh r0, [r1] lsls r0, 24 @@ -2888,7 +2888,7 @@ sub_8136D90: @ 8136D90 lsls r0, 24 lsrs r0, 24 strh r0, [r6] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldrh r0, [r5] strh r0, [r1] lsls r0, 24 @@ -3333,7 +3333,7 @@ sub_81370FC: @ 81370FC lsls r0, 24 cmp r0, 0 beq _08137134 - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 @@ -4899,7 +4899,7 @@ _08137E58: lsls r0, 24 lsrs r4, r0, 24 _08137E5C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r4, [r0] pop {r4-r7} pop {r0} @@ -7214,7 +7214,7 @@ _081390E6: cmp r0, 0xC bne _0813913C _08139128: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _0813914A .pool @@ -7224,7 +7224,7 @@ _0813913C: lsrs r5, r0, 24 cmp r5, 0x5 bls _081390E6 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 _0813914A: strh r0, [r1] @@ -8044,7 +8044,7 @@ _081397BE: thumb_func_start sub_81397C4 sub_81397C4: @ 81397C4 push {r4,r5,lr} - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldrh r1, [r2] ldr r0, =0x0000270f cmp r1, r0 @@ -8123,7 +8123,7 @@ _08139862: thumb_func_start sub_813986C sub_813986C: @ 813986C push {lr} - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x4 bhi _081398B8 @@ -9381,7 +9381,7 @@ _0813A2BE: strh r4, [r3, 0x26] b _0813A2D2 _0813A2C6: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x7F strh r0, [r1] adds r0, r4, 0 @@ -9649,7 +9649,7 @@ sub_813A4EC: @ 813A4EC b _0813A566 .pool _0813A51C: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x7F strh r0, [r1] movs r0, 0x5 @@ -9657,7 +9657,7 @@ _0813A51C: b _0813A54C .pool _0813A530: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r4, [r0] movs r0, 0x5 bl PlaySE @@ -10930,7 +10930,7 @@ task_deoxys_sound: @ 813AFDC lsrs r0, 24 cmp r0, 0x1 bne _0813B004 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x3 b _0813B06A .pool @@ -10961,7 +10961,7 @@ _0813B004: mov r0, r8 movs r1, 0 bl VarSet - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] b _0813B070 @@ -10971,7 +10971,7 @@ _0813B05C: bne _0813B080 ldr r0, =0x000008d4 bl FlagSet - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 _0813B06A: strh r0, [r1] @@ -10991,7 +10991,7 @@ _0813B080: ldr r0, =0x00004035 adds r1, r5, 0 bl VarSet - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] adds r0, r7, 0 @@ -11684,7 +11684,7 @@ _0813B62E: ldrh r1, [r5] cmp r1, 0x1 bne _0813B668 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _0813B790 .pool @@ -11698,7 +11698,7 @@ _0813B668: ldrh r0, [r0] cmp r0, 0x1 bne _0813B68C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 b _0813B6AC .pool @@ -11710,12 +11710,12 @@ _0813B68C: ldrh r0, [r0] cmp r0, 0 bne _0813B6A8 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x3 b _0813B6AC .pool _0813B6A8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 _0813B6AC: strh r0, [r1] @@ -11736,7 +11736,7 @@ _0813B6C2: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r2, 0x2 bl SendBlock b _0813B708 @@ -11751,7 +11751,7 @@ _0813B6E4: lsls r0, 24 cmp r0, 0 beq _0813B790 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gBlockRecvBuffer ldrh r0, [r0] strh r0, [r1] @@ -11773,7 +11773,7 @@ _0813B728: lsls r0, 24 cmp r0, 0 bne _0813B74C - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x2 bne _0813B790 @@ -11782,7 +11782,7 @@ _0813B728: b _0813B790 .pool _0813B74C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x3 bne _0813B790 @@ -12041,7 +12041,7 @@ _0813B94E: thumb_func_start sub_813B968 sub_813B968: @ 813B968 push {r4,r5,lr} - ldr r5, =gScriptResult + ldr r5, =gSpecialVar_ScriptResult ldr r0, =gSpecialVar_0x8004 ldrh r0, [r0] movs r1, 0x7 diff --git a/asm/script_menu.s b/asm/script_menu.s index 55ce5736a..889a0c10c 100644 --- a/asm/script_menu.s +++ b/asm/script_menu.s @@ -24,7 +24,7 @@ ScriptMenu_Multichoice: @ 80E1E08 lsrs r0, 24 cmp r0, 0x1 beq _080E1E4C - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult movs r1, 0xFF strh r1, [r0] movs r0, 0 @@ -70,7 +70,7 @@ ScriptMenu_MultichoiceWithDefault: @ 80E1E58 lsrs r0, 24 cmp r0, 0x1 beq _080E1EA8 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0xFF strh r0, [r1] str r4, [sp] @@ -358,13 +358,13 @@ _080E20B8: bne _080E20FC movs r0, 0x5 bl PlaySE - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x7F strh r0, [r1] b _080E20EC .pool _080E20E8: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _080E20EC: ldrb r0, [r5, 0xC] @@ -389,7 +389,7 @@ ScriptMenu_YesNo: @ 80E2108 lsrs r0, 24 cmp r0, 0x1 beq _080E2138 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0xFF strh r0, [r1] bl sub_8197930 @@ -410,7 +410,7 @@ _080E213A: thumb_func_start sub_80E2140 sub_80E2140: @ 80E2140 push {lr} - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0xFF beq _080E2154 @@ -465,12 +465,12 @@ _080E219C: _080E21A4: movs r0, 0x5 bl PlaySE - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 b _080E21B8 .pool _080E21B4: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 _080E21B8: strh r0, [r1] @@ -517,7 +517,7 @@ ScriptMenu_MultichoiceGrid: @ 80E21D0 b _080E22E8 .pool _080E2210: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult movs r1, 0xFF strh r1, [r0] movs r2, 0 @@ -655,13 +655,13 @@ sub_80E2308: @ 80E2308 bne _080E2360 movs r0, 0x5 bl PlaySE - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x7F strh r0, [r1] b _080E2350 .pool _080E234C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _080E2350: ldrb r0, [r5, 0xC] @@ -686,7 +686,7 @@ sp109_CreatePCMenu: @ 80E236C lsrs r0, 24 cmp r0, 0x1 beq _080E2394 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0xFF strh r0, [r1] bl CreatePCMenu @@ -893,7 +893,7 @@ sub_80E2548: @ 80E2548 lsrs r0, 24 cmp r0, 0x1 beq _080E2570 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0xFF strh r0, [r1] bl sub_80E2578 @@ -1266,7 +1266,7 @@ _080E2860: thumb_func_start sub_80E2878 sub_80E2878: @ 80E2878 push {lr} - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldrh r0, [r2] cmp r0, 0x7F beq _080E288C @@ -1648,7 +1648,7 @@ sp106_CreateStartMenu: @ 80E2B7C lsrs r0, 24 cmp r0, 0x1 beq _080E2BA4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0xFF strh r0, [r1] bl CreateStartMenu diff --git a/asm/script_pokemon_util_80F87D8.s b/asm/script_pokemon_util_80F87D8.s index 98510dd9e..40c9ae718 100644 --- a/asm/script_pokemon_util_80F87D8.s +++ b/asm/script_pokemon_util_80F87D8.s @@ -952,7 +952,7 @@ sub_80F8FA0: @ 80F8FA0 ands r0, r1 cmp r0, 0 bne _080F8FD8 - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 @@ -960,7 +960,7 @@ sub_80F8FA0: @ 80F8FA0 b _080F8FDE .pool _080F8FD8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x4 strh r0, [r1] _080F8FDE: @@ -987,11 +987,11 @@ sub_80F8FE8: @ 80F8FE8 adds r0, r1 str r0, [r2] lsrs r0, 16 - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult b _080F902A .pool _080F9020: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl Random lsls r0, 16 lsrs r0, 16 @@ -1376,7 +1376,7 @@ _080F9310: cmp r1, 0x2 bne _080F9318 _080F9314: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _080F9318: pop {r0} @@ -1550,12 +1550,12 @@ sub_80F9460: @ 80F9460 ldrb r1, [r0] cmp r1, 0 bne _080F9478 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _080F947E .pool _080F9478: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _080F947E: @@ -1590,12 +1590,12 @@ sub_80F94B8: @ 80F94B8 ldrb r1, [r0] cmp r1, 0 bne _080F94D0 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _080F94D6 .pool _080F94D0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _080F94D6: diff --git a/asm/start_menu.s b/asm/start_menu.s index 4f8544eea..752f2c810 100644 --- a/asm/start_menu.s +++ b/asm/start_menu.s @@ -974,13 +974,13 @@ task50_save_game: @ 809FFD0 _0809FFEC: cmp r1, 0x3 bgt _080A0000 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] b _080A0000 .pool _0809FFFC: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _080A0000: adds r0, r4, 0 diff --git a/asm/starter_choose.s b/asm/starter_choose.s index da42959ea..a90302941 100644 --- a/asm/starter_choose.s +++ b/asm/starter_choose.s @@ -555,7 +555,7 @@ _08134420: beq _08134450 b _0813449A _08134426: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 diff --git a/asm/trader.s b/asm/trader.s index 8e0b17905..3d594fd2e 100644 --- a/asm/trader.s +++ b/asm/trader.s @@ -335,7 +335,7 @@ _08133CCA: sub_8133CD8: @ 8133CD8 ldr r0, =gSaveBlock1Ptr ldr r0, [r0] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r2, =0x00002e59 adds r0, r2 ldrb r0, [r0] @@ -348,7 +348,7 @@ sub_8133CD8: @ 8133CD8 sub_8133CF4: @ 8133CF4 push {r4,r5,lr} movs r4, 0 - ldr r5, =gScriptResult + ldr r5, =gSpecialVar_ScriptResult _08133CFA: adds r0, r4, 0 bl CountDecorationCategoryN @@ -365,7 +365,7 @@ _08133D10: lsrs r4, r0, 24 cmp r4, 0x7 bls _08133CFA - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _08133D20: @@ -378,7 +378,7 @@ _08133D20: thumb_func_start sub_8133D2C sub_8133D2C: @ 8133D2C push {r4-r6,lr} - ldr r6, =gScriptResult + ldr r6, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r6] ldr r4, =gDecorations diff --git a/asm/trainer_see.s b/asm/trainer_see.s index 59dd9f74b..ebea70d6c 100644 --- a/asm/trainer_see.s +++ b/asm/trainer_see.s @@ -1300,7 +1300,7 @@ sub_80B45D0: @ 80B45D0 bne _080B460C adds r0, 0x1 strb r0, [r1] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] bl UnfreezeMapObjects @@ -1313,7 +1313,7 @@ _080B460C: movs r0, 0 strb r0, [r1] _080B4610: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _080B4616: diff --git a/asm/wild_encounter.s b/asm/wild_encounter.s index 9b6c901f6..c10b8f389 100644 --- a/asm/wild_encounter.s +++ b/asm/wild_encounter.s @@ -1628,12 +1628,12 @@ rock_smash_wild_pokemon_encounter: @ 80B550C bne _080B5568 bl sub_80B0698 _080B5554: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r4, [r0] b _080B556E .pool _080B5568: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _080B556E: |