diff options
Diffstat (limited to 'asm')
48 files changed, 1281 insertions, 945 deletions
diff --git a/asm/battle_frontier_1.s b/asm/battle_frontier_1.s index 978dd30fa..e52ed0c3d 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_Result 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_Result ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r3, =0x00000cdc @@ -170,7 +170,7 @@ _0818EB14: b _0818ED10 .pool _0818EB48: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -180,7 +180,7 @@ _0818EB48: b _0818ECBE .pool _0818EB64: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 @@ -190,7 +190,7 @@ _0818EB64: b _0818ECBE .pool _0818EB80: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -198,7 +198,7 @@ _0818EB80: b _0818ECBA .pool _0818EB98: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -226,7 +226,7 @@ _0818EBB4: b _0818ECBE .pool _0818EBE8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -248,7 +248,7 @@ _0818EC04: b _0818ECBE .pool _0818EC24: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -277,7 +277,7 @@ _0818EC40: b _0818ED10 .pool _0818EC74: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -299,7 +299,7 @@ _0818EC90: b _0818ECBE .pool _0818ECB0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 @@ -328,7 +328,7 @@ _0818ECD0: b _0818ED10 .pool _0818ECF4: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_Result 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_Result movs r0, 0x1 b _08194EEC .pool _08194EE8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x2 _08194EEC: strh r0, [r1] @@ -13130,7 +13130,7 @@ _08195A74: beq _08195AB0 b _08195AD0 _08195A7A: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result ldr r1, [r5] ldr r2, =0x00000dc6 adds r1, r2 @@ -13139,7 +13139,7 @@ _08195A7A: b _08195AD0 .pool _08195A90: - ldr r3, =gScriptResult + ldr r3, =gSpecialVar_Result 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_Result 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_Result 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_Result movs r0, 0x3 b _08195C14 .pool _08195C10: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result strh r5, [r0] b _08195E06 .pool _08195E00: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0 strh r0, [r1] _08195E06: diff --git a/asm/battle_frontier_2.s b/asm/battle_frontier_2.s index 074e81a5b..f92f964bb 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_Result strh r1, [r0] b _0819CAFE .pool _0819CA68: movs r0, 0x2 strh r0, [r4, 0x8] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result movs r0, 0x7F strh r0, [r1] b _081A0768 .pool _081A0764: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result 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_Result strh r1, [r0] b _081A095A .pool _081A0954: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result 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_Result movs r0, 0 strh r0, [r1] b _081A0A1C .pool _081A09F4: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_Result 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_Result movs r0, 0x2 b _081A0D34 .pool @@ -12431,22 +12431,22 @@ _081A0D08: beq _081A0D24 b _081A0D30 _081A0D0E: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x4 b _081A0D34 .pool _081A0D18: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x3 b _081A0D34 .pool _081A0D24: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x1 b _081A0D34 .pool _081A0D30: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result mov r8, r1 cmp r0, 0 beq _081A127C @@ -13855,7 +13855,7 @@ _081A186C: .4byte _081A1918 .4byte _081A1938 _081A188C: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca8 @@ -13865,7 +13865,7 @@ _081A188C: b _081A1956 .pool _081A18A8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca9 @@ -13877,7 +13877,7 @@ _081A18A8: b _081A1956 .pool _081A18C8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000cb2 @@ -13887,7 +13887,7 @@ _081A18C8: b _081A1956 .pool _081A18E4: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca9 @@ -13897,7 +13897,7 @@ _081A18E4: b _081A1926 .pool _081A1900: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_Result ldr r1, =gBattleOutcome ldrb r0, [r1] strh r0, [r2] @@ -13906,7 +13906,7 @@ _081A1900: b _081A1956 .pool _081A1918: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca9 @@ -13919,7 +13919,7 @@ _081A1926: b _081A1956 .pool _081A1938: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_Result 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_Result 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_Result movs r0, 0x1 b _081A3B24 .pool _081A3B20: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result 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_Result movs r0, 0x1 strh r0, [r1] b _081A3DC8 .pool _081A3DC4: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result strh r2, [r0] _081A3DC8: pop {r0} @@ -18390,7 +18390,7 @@ _081A404E: bne _081A40C8 cmp r7, 0 bne _081A40E4 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result 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_Result 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_Result 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_Result bl MoveRecordedBattleToSaveData strh r0, [r4] ldr r0, =gSaveBlock2Ptr @@ -21309,7 +21309,7 @@ _081A5994: beq _081A59C8 b _081A59EE _081A599A: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result 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_Result 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_Result 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_Result 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_Result strh r5, [r0] b _081A5BD6 .pool _081A5BD0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0 strh r0, [r1] _081A5BD6: @@ -22026,7 +22026,7 @@ _081A5FE4: beq _081A6030 b _081A6044 _081A5FEA: - ldr r3, =gScriptResult + ldr r3, =gSpecialVar_Result 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_Result ldr r2, [r7] ldr r0, =0x00000cdc adds r2, r0 @@ -22054,7 +22054,7 @@ _081A6000: b _081A6044 .pool _081A6030: - ldr r3, =gScriptResult + ldr r3, =gSpecialVar_Result 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_Result 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_Result 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_Result ldr r1, [r3] ldr r3, =0x00000e02 adds r1, r3 @@ -24189,7 +24189,7 @@ _081A7188: b _081A723A .pool _081A71A0: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_Result 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_Result 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_Result 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_Result ldr r0, [r3] ldr r1, =0x00000cdc adds r0, r1 @@ -24243,7 +24243,7 @@ _081A720C: b _081A7236 .pool _081A7228: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_Result 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_Result movs r0, 0x1 b _081A73E0 .pool _081A73DC: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result 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_Result movs r0, 0 b _081A74C0 .pool _081A7498: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x1 b _081A74C0 .pool _081A74A4: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x2 b _081A74C0 .pool _081A74B0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x3 b _081A74C0 .pool _081A74BC: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result movs r0, 0 strh r0, [r1] b _081A8786 @@ -27919,13 +27919,13 @@ _081A8F70: .4byte _081A9010 .4byte _081A9028 _081A8F8C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result ldr r1, [r3] ldr r3, =0x00000e18 b _081A8FFE .pool _081A8F9C: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_Result 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_Result ldr r0, [r3] ldr r1, =0x00000cdc adds r0, r1 b _081A9030 .pool _081A8FCC: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_Result ldr r0, [r3] ldr r3, =0x00000cdc adds r0, r3 @@ -27954,14 +27954,14 @@ _081A8FCC: b _081A9036 .pool _081A8FE4: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result ldr r1, [r3] ldr r2, =0x00000e1a adds r1, r2 b _081A9000 .pool _081A8FF8: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result ldr r1, [r3] ldr r3, =0x00000e1c _081A8FFE: @@ -27972,7 +27972,7 @@ _081A9000: b _081A903A .pool _081A9010: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_Result ldr r0, [r3] ldr r1, =0x00000cdc adds r0, r1 @@ -27982,7 +27982,7 @@ _081A9010: b _081A9036 .pool _081A9028: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_Result 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_Result strh r5, [r0] b _081A924A .pool _081A9244: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_LastTalked 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_LastTalked 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_Result bl InBattlePyramid lsls r0, 24 lsrs r0, 24 @@ -28745,7 +28745,7 @@ _081A9698: b _081A9754 .pool _081A96B4: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_Result 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_Result 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_LastTalked ldrh r1, [r0] subs r1, 0x1 lsls r0, r1, 1 @@ -29815,7 +29815,7 @@ _081A9F7A: thumb_func_start sub_81A9F80 sub_81A9F80: @ 81A9F80 push {lr} - ldr r0, =gUnknown_08252C88 + ldr r0, =BattleFrontier_BattlePyramidEmptySquare_EventScript_252C88 bl ScriptContext1_SetupScript pop {r0} bx r0 @@ -29962,7 +29962,7 @@ _081AA0A6: ldr r2, =0x00000169 adds r0, r2 lsls r0, 2 - ldr r1, =gUnknown_08481DD4 + ldr r1, =gMapAttributes adds r0, r1 ldr r6, [r0] ldr r2, [r6, 0xC] @@ -30241,8 +30241,8 @@ sub_81AA2F8: @ 81AA2F8 push {r4,r5,lr} ldr r0, =gSaveBlock1Ptr ldr r0, [r0] - ldr r5, =gUnknown_08252C4F - ldr r4, =gUnknown_08252C6A + ldr r5, =BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F + ldr r4, =BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A movs r2, 0xC8 lsls r2, 4 adds r1, r0, r2 diff --git a/asm/battle_setup.s b/asm/battle_setup.s index 2e3f5ab92..621749734 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_Result 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_LastTalked strh r1, [r0] lsls r0, r1, 24 lsrs r0, 24 @@ -1728,7 +1728,7 @@ _080B1494: ldr r0, =gUnknown_0854FF84 adds r1, r5, 0 bl TrainerBattleLoadArgs - ldr r0, =gUnknown_082713C2 + ldr r0, =EventScript_2713C2 b _080B161E .pool _080B14A8: @@ -1757,7 +1757,7 @@ _080B14D6: adds r1, r5, 0 bl TrainerBattleLoadArgs bl battle_80801F0 - ldr r0, =gUnknown_0827138A + ldr r0, =EventScript_27138A b _080B161E .pool _080B14EC: @@ -1769,7 +1769,7 @@ _080B14EC: ldrh r0, [r4] bl sub_80B2234 strh r0, [r4] - ldr r0, =gUnknown_082713F8 + ldr r0, =EventScript_2713F8 b _080B161E .pool _080B1514: @@ -1781,7 +1781,7 @@ _080B1514: ldrh r0, [r4] bl sub_80B2234 strh r0, [r4] - ldr r0, =gUnknown_082713D1 + ldr r0, =EventScript_2713D1 b _080B161E .pool _080B153C: @@ -1793,7 +1793,7 @@ _080B153C: adds r1, r5, 0 bl TrainerBattleLoadArgs bl battle_80801F0 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_LastTalked 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_LastTalked 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_LastTalked 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_LastTalked ldrb r0, [r0] bl battle_init b _080B157C @@ -1866,7 +1866,7 @@ _080B1616: adds r1, r5, 0 bl TrainerBattleLoadArgs _080B161C: - ldr r0, =gUnknown_08271362 + ldr r0, =EventScript_271362 _080B161E: pop {r4,r5} pop {r1} @@ -1882,7 +1882,7 @@ SingleTrainerWantsBattle: @ 80B162C lsrs r0, 24 ldr r2, =gSelectedMapObject strb r0, [r2] - ldr r4, =gScriptLastTalked + ldr r4, =gSpecialVar_LastTalked ldr r3, =gMapObjects lsls r2, r0, 3 adds r2, r0 @@ -1893,7 +1893,7 @@ SingleTrainerWantsBattle: @ 80B162C adds r1, 0x1 adds r0, r1, 0 bl BattleSetup_ConfigureTrainerBattle - ldr r0, =gUnknown_08271354 + ldr r0, =EventScript_271354 bl ScriptContext1_SetupScript bl ScriptContext2_Enable pop {r4} @@ -1910,7 +1910,7 @@ TwoTrainersWantBattle: @ 80B1670 lsrs r0, 24 ldr r2, =gSelectedMapObject strb r0, [r2] - ldr r4, =gScriptLastTalked + ldr r4, =gSpecialVar_LastTalked ldr r3, =gMapObjects lsls r2, r0, 3 adds r2, r0 @@ -1931,7 +1931,7 @@ TwoTrainersWantBattle: @ 80B1670 @ void TwoTrainersWantBattleExecuteScript() TwoTrainersWantBattleExecuteScript: @ 80B16A4 push {lr} - ldr r0, =gUnknown_08271354 + ldr r0, =EventScript_271354 bl ScriptContext1_SetupScript bl ScriptContext2_Enable pop {r0} @@ -2332,7 +2332,7 @@ sub_80B1A14: @ 80B1A14 ldrb r0, [r0] cmp r0, 0x1 bhi _080B1A44 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_LastTalked 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_LastTalked ldrb r0, [r0] bl battle_init adds r1, r0, 0 @@ -2420,7 +2420,7 @@ BattleSetup_GetScriptAddrAfterBattle: @ 80B1AF8 ldr r0, [r0] cmp r0, 0 bne _080B1B04 - ldr r0, =gUnknown_082C8436 + ldr r0, =EventScript_2C8436 _080B1B04: pop {r1} bx r1 @@ -2457,7 +2457,7 @@ _080B1B3C: b _080B1B56 .pool _080B1B54: - ldr r0, =gUnknown_082742E6 + ldr r0, =LavaridgeTown_Gym_1F_EventScript_2742E6 _080B1B56: pop {r1} bx r1 @@ -3484,7 +3484,7 @@ CheckIfMultipleTrainersWantBattle: @ 80B22D8 ldr r1, =gUnknown_02038BF8 movs r0, 0x1 strb r0, [r1] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result movs r0, 0 _080B230A: strh r0, [r1] diff --git a/asm/battle_tent.s b/asm/battle_tent.s index 5cb92dbed..8253d4f98 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_Result 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_Result strh r5, [r0] b _081B9B76 .pool _081B9B70: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result 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_Result strh r5, [r0] b _081B9CE6 .pool _081B9CE0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result 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_Result strh r5, [r0] b _081B9E6E .pool _081B9E68: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0 strh r0, [r1] _081B9E6E: diff --git a/asm/battle_tower.s b/asm/battle_tower.s index 122d9d27c..42dcb431a 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_Result strh r0, [r1] b _081620E8 .pool _081620A8: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_Result 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_Result ldr r0, [r5] adds r0, r4 ldrh r0, [r0] @@ -3547,11 +3547,11 @@ _08163E2C: ldr r4, =gUnknown_02038BFC movs r0, 0 strb r0, [r4] - ldr r0, =gUnknown_08224158 + ldr r0, =MossdeepCity_SpaceCenter_2F_EventScript_224157 + 1 bl BattleSetup_ConfigureTrainerBattle movs r0, 0x1 strb r0, [r4] - ldr r0, =gUnknown_08224167 + ldr r0, =MossdeepCity_SpaceCenter_2F_EventScript_224166 + 1 bl BattleSetup_ConfigureTrainerBattle ldr r0, =gPartnerTrainerId strh r5, [r0] @@ -4714,7 +4714,7 @@ sub_8164828: @ 8164828 lsls r0, 16 lsrs r0, 16 mov r8, r0 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_LastTalked 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_Result 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_Result 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_Result 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_Result 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_Result movs r0, 0x4 b _08164DB4 .pool _08164D98: bl sub_800AC34 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x5 b _08164DB4 .pool @@ -5284,7 +5284,7 @@ _08164DA8: cmp r0, 0 bne _08164DB6 _08164DB0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result 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_Result 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_Result 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_Result movs r0, 0x1 strh r0, [r1] _08165316: diff --git a/asm/berry_blender.s b/asm/berry_blender.s index 69c561beb..f0d1b48d7 100644 --- a/asm/berry_blender.s +++ b/asm/berry_blender.s @@ -1190,7 +1190,7 @@ _080801F8: movs r5, 0xAC lsls r5, 1 adds r0, r5 - ldr r1, =gScriptItemId + ldr r1, =gSpecialVar_ItemId ldrh r1, [r1] bl sub_807FE14 ldr r0, =gUnknown_020228C4 @@ -2043,7 +2043,7 @@ _080808F8: _08080950: bl sub_800B4C0 bl sub_8080588 - ldr r4, =gScriptItemId + ldr r4, =gSpecialVar_ItemId ldrh r1, [r4] movs r0, 0 bl sub_8082FDC @@ -7619,7 +7619,7 @@ _080837EA: movs r1, 0x6 bl CreateTask bl sub_80EECEC - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem diff --git a/asm/berry_tag_screen.s b/asm/berry_tag_screen.s index 9622f0508..422f5f3d6 100644 --- a/asm/berry_tag_screen.s +++ b/asm/berry_tag_screen.s @@ -12,7 +12,7 @@ sub_8177C14: @ 8177C14 ldr r0, =0x0000180c bl AllocZeroed str r0, [r4] - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl ItemIdToBerryType ldr r1, [r4] diff --git a/asm/cable_club.s b/asm/cable_club.s index 15ba76e9c..2ce8bb0b1 100644 --- a/asm/cable_club.s +++ b/asm/cable_club.s @@ -433,7 +433,7 @@ sub_80B2688: @ 80B2688 bne _080B26EC movs r0, 0x15 bl PlaySE - ldr r0, =gUnknown_082780B3 + ldr r0, =OldaleTown_PokemonCenter_2F_Text_2780B3 bl ShowFieldAutoScrollMessage ldr r0, =sub_80B270C b _080B26FA @@ -441,7 +441,7 @@ sub_80B2688: @ 80B2688 _080B26EC: movs r0, 0x16 bl PlaySE - ldr r0, =gUnknown_08278131 + ldr r0, =OldaleTown_PokemonCenter_2F_Text_278131 bl ShowFieldAutoScrollMessage ldr r0, =sub_80B2918 _080B26FA: @@ -544,7 +544,7 @@ sub_80B275C: @ 80B275C movs r2, 0 movs r3, 0x1 bl ConvertIntToDecimalStringN - ldr r0, =gUnknown_082780F2 + ldr r0, =OldaleTown_PokemonCenter_2F_Text_2780F2 bl ShowFieldAutoScrollMessage mov r0, r9 subs r0, 0x8 @@ -597,7 +597,7 @@ sub_80B2804: @ 80B2804 cmp r0, 0 beq _080B2878 _080B2852: - ldr r0, =gUnknown_082780B3 + ldr r0, =OldaleTown_PokemonCenter_2F_Text_2780B3 bl ShowFieldAutoScrollMessage ldr r1, =gTasks lsls r0, r5, 2 @@ -663,7 +663,7 @@ sub_80B28A8: @ 80B28A8 b _080B2908 .pool _080B28F4: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result movs r0, 0xC strh r0, [r1] bl sub_800AD10 @@ -2296,7 +2296,7 @@ _080B3750: beq _080B37B8 b _080B37CC _080B375A: - ldr r0, =gUnknown_08278091 + ldr r0, =OldaleTown_PokemonCenter_2F_Text_278091 bl ShowFieldMessage movs r0, 0x1 strh r0, [r5, 0x8] diff --git a/asm/contest.s b/asm/contest.s index 4852a548f..50398c518 100644 --- a/asm/contest.s +++ b/asm/contest.s @@ -6313,7 +6313,7 @@ _080DAE1E: movs r0, 0x4 b _080DAE9A _080DAE2E: - ldr r0, =gScriptContestCategory + ldr r0, =gSpecialVar_ContestCategory ldrh r0, [r0] cmp r0, 0x4 bhi _080DAE82 @@ -6358,7 +6358,7 @@ _080DAE82: movs r0, 0 b _080DAE9A _080DAE86: - ldr r0, =gUnknown_02039F2E + ldr r0, =gSpecialVar_ContestRank adds r2, r1, 0 ldrh r1, [r0] movs r0, 0x2 @@ -8456,7 +8456,7 @@ sub_80DBED4: @ 80DBED4 adds r0, r1 ldrb r1, [r0] lsls r1, 1 - ldr r0, =gScriptContestCategory + ldr r0, =gSpecialVar_ContestCategory ldrh r0, [r0] lsls r0, 3 adds r1, r0 @@ -11805,7 +11805,7 @@ sub_80DD9F0: @ 80DD9F0 ldrb r1, [r0, 0x1] lsls r1, 29 lsrs r1, 29 - ldr r0, =gScriptContestCategory + ldr r0, =gSpecialVar_ContestCategory ldrh r2, [r0] lsls r0, r2, 2 adds r0, r2 @@ -14260,7 +14260,7 @@ _080DEDE6: b _080DEF90 .pool _080DEE00: - ldr r0, =gScriptContestCategory + ldr r0, =gSpecialVar_ContestCategory ldrh r0, [r0] cmp r0, 0x4 bhi _080DEE4C @@ -14369,7 +14369,7 @@ _080DEEF4: mov r2, r10 ldr r0, [r2] adds r0, r7 - ldr r1, =gUnknown_02039F2E + ldr r1, =gSpecialVar_ContestRank ldrh r1, [r1] ldr r3, =0x00002eae adds r0, r3 @@ -14383,7 +14383,7 @@ _080DEF02: mov r2, r9 lsls r1, r2, 5 adds r0, r1 - ldr r1, =gScriptContestCategory + ldr r1, =gSpecialVar_ContestCategory ldrh r1, [r1] ldr r3, =0x00002e9a adds r0, r3 @@ -14485,7 +14485,7 @@ _080DEFE6: b _080DF03A .pool _080DEFF8: - ldr r0, =gScriptContestCategory + ldr r0, =gSpecialVar_ContestCategory ldrh r0, [r0] cmp r0, 0x4 bhi _080DF038 diff --git a/asm/contest_ai.s b/asm/contest_ai.s index a213c393c..3438107eb 100644 --- a/asm/contest_ai.s +++ b/asm/contest_ai.s @@ -1352,7 +1352,7 @@ sub_8156CF4: @ 8156CF4 ldr r0, =gContestResources ldr r0, [r0] ldr r1, [r0, 0xC] - ldr r0, =gScriptContestCategory + ldr r0, =gSpecialVar_ContestCategory ldrh r0, [r0] strh r0, [r1, 0x18] ldr r1, =gAIScriptPtr diff --git a/asm/contest_effect.s b/asm/contest_effect.s index f3c234503..65a720a65 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -2590,7 +2590,7 @@ ContestEffectFunc_080E6778: @ 80E6778 adds r0, r3 ldrb r0, [r0, 0x1] lsls r0, 29 - ldr r1, =gScriptContestCategory + ldr r1, =gSpecialVar_ContestCategory lsrs r0, 29 ldrh r1, [r1] cmp r0, r1 diff --git a/asm/contest_link_80F57C4.s b/asm/contest_link_80F57C4.s index e6d30b7cb..7f32c880c 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_Result ldrh r0, [r0] cmp r0, 0x1 beq _080F5D58 @@ -556,7 +556,7 @@ _080F5D2A: _080F5D58: movs r0, 0x2 bl sub_813BADC - ldr r0, =gUnknown_02039F2E + ldr r0, =gSpecialVar_ContestRank ldrb r0, [r0] bl sub_80DEDA8 movs r0, 0xFE @@ -673,7 +673,7 @@ _080F5E78: movs r0, 0x25 bl IncrementGameStat _080F5E92: - ldr r0, =gUnknown_02039F2E + ldr r0, =gSpecialVar_ContestRank ldrb r0, [r0] bl sub_80DEDA8 movs r0, 0xFE @@ -2972,7 +2972,7 @@ sub_80F71C8: @ 80F71C8 b _080F7240 .pool _080F71F8: - ldr r0, =gUnknown_02039F2E + ldr r0, =gSpecialVar_ContestRank ldrh r2, [r0] cmp r2, 0 bne _080F720C @@ -3008,7 +3008,7 @@ _080F7236: bl CopyToBgTilemapBufferRect movs r5, 0xF _080F7240: - ldr r0, =gScriptContestCategory + ldr r0, =gSpecialVar_ContestCategory ldrh r0, [r0] cmp r0, 0 bne _080F725C @@ -4640,15 +4640,15 @@ sub_80F7F30: @ 80F7F30 adds r5, r0, 0 cmp r5, 0 beq _080F7F5E - ldr r4, =gScriptContestCategory + ldr r4, =gSpecialVar_ContestCategory ldrb r0, [r4] - ldr r1, =gUnknown_02039F2E + ldr r1, =gSpecialVar_ContestRank ldrb r1, [r1] bl sub_80DAB8C ldrb r0, [r4] bl sub_80DB09C _080F7F5E: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result strh r5, [r0] pop {r4,r5} pop {r0} @@ -4666,7 +4666,7 @@ sub_80F7F7C: @ 80F7F7C muls r1, r0 ldr r0, =gPlayerParty adds r2, r1, r0 - ldr r0, =gScriptContestCategory + ldr r0, =gSpecialVar_ContestCategory ldrh r0, [r0] cmp r0, 0x4 bhi _080F7FEE @@ -4704,7 +4704,7 @@ _080F7FDC: movs r1, 0x36 _080F7FE0: bl GetMonData - ldr r1, =gUnknown_02039F2E + ldr r1, =gSpecialVar_ContestRank ldrh r1, [r1] cmp r0, r1 bls _080F7FEE @@ -4730,7 +4730,7 @@ sub_80F7FFC: @ 80F7FFC beq _080F8010 b _080F8250 _080F8010: - ldr r0, =gScriptContestCategory + ldr r0, =gSpecialVar_ContestCategory ldrh r0, [r0] cmp r0, 0x4 bls _080F801A @@ -4762,7 +4762,7 @@ _080F8048: lsrs r1, r0, 24 mov r0, sp strb r1, [r0] - ldr r0, =gUnknown_02039F2E + ldr r0, =gSpecialVar_ContestRank ldrh r0, [r0] cmp r1, r0 bls _080F806C @@ -4812,7 +4812,7 @@ _080F80B8: strb r0, [r4] mov r0, sp ldrb r2, [r0] - ldr r0, =gUnknown_02039F2E + ldr r0, =gSpecialVar_ContestRank ldrh r0, [r0] cmp r2, r0 bls _080F80DC @@ -4861,7 +4861,7 @@ _080F8124: strb r0, [r4] mov r0, sp ldrb r2, [r0] - ldr r0, =gUnknown_02039F2E + ldr r0, =gSpecialVar_ContestRank ldrh r0, [r0] cmp r2, r0 bls _080F8148 @@ -4908,7 +4908,7 @@ _080F8190: strb r0, [r4] mov r0, sp ldrb r2, [r0] - ldr r0, =gUnknown_02039F2E + ldr r0, =gSpecialVar_ContestRank ldrh r0, [r0] cmp r2, r0 bhi _080F8250 @@ -4951,7 +4951,7 @@ _080F81F8: strb r0, [r4] mov r0, sp ldrb r2, [r0] - ldr r0, =gUnknown_02039F2E + ldr r0, =gSpecialVar_ContestRank ldrh r0, [r0] cmp r2, r0 bhi _080F8250 @@ -5488,7 +5488,7 @@ _080F8678: bl sub_80F86E0 ldr r1, =gUnknown_02039F2B strb r0, [r1] - ldr r0, =gScriptContestCategory + ldr r0, =gSpecialVar_ContestCategory ldrb r0, [r0] bl sub_80DB09C ldr r1, =sub_80FCF40 diff --git a/asm/contest_link_81D9DE4.s b/asm/contest_link_81D9DE4.s index 5f9c25d7c..12eb159f7 100755 --- a/asm/contest_link_81D9DE4.s +++ b/asm/contest_link_81D9DE4.s @@ -370,7 +370,7 @@ sub_81DA10C: @ 81DA10C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gScriptContestCategory + ldr r0, =gSpecialVar_ContestCategory ldrb r0, [r0] bl sub_80DB09C ldr r1, =sub_80FCF40 diff --git a/asm/daycare.s b/asm/daycare.s index 065911df8..a25f2a40c 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_Result strh r1, [r0] b _0807124E .pool _08071248: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result strh r1, [r0] ldrb r0, [r4, 0x8] movs r1, 0 diff --git a/asm/dewford_trend.s b/asm/dewford_trend.s index 40df2d6a0..89f89c4e0 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_Result 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_Result ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00002e6c diff --git a/asm/easy_chat.s b/asm/easy_chat.s index e9565dfa9..eb20e68fa 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_Result 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_Result bl sub_811B4EC strh r0, [r4] bl sub_811B3E4 @@ -1860,7 +1860,7 @@ _0811B118: b _0811B14A .pool _0811B134: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_Result 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..7ce989d94 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_LastTalked movs r1, 0 strh r1, [r0] ldr r0, =gSelectedMapObject @@ -443,13 +443,13 @@ _0809C214: ldr r0, =gUnknown_0823B589 cmp r4, r0 beq _0809C244 - ldr r0, =gUnknown_082766A2 + ldr r0, =EventScript_2766A2 cmp r4, r0 beq _0809C244 - ldr r0, =gUnknown_082766A6 + ldr r0, =EventScript_2766A6 cmp r4, r0 beq _0809C244 - ldr r0, =gUnknown_08271D92 + ldr r0, =EventScript_271D92 cmp r4, r0 beq _0809C244 movs r0, 0x5 @@ -582,13 +582,13 @@ _0809C34C: ble _0809C340 ldr r0, =gSelectedMapObject strb r3, [r0] - ldr r1, =gScriptLastTalked + ldr r1, =gSpecialVar_LastTalked adds r0, r2, r3 lsls r0, 2 adds r0, r5 ldrb r0, [r0, 0x8] strh r0, [r1] - ldr r0, =gScriptFacing + ldr r0, =gSpecialVar_Facing 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_LastTalked adds r0, r2, r4 lsls r0, 2 adds r0, r3 ldrb r0, [r0, 0x8] strh r0, [r1] - ldr r0, =gScriptFacing + ldr r0, =gSpecialVar_Facing 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_LastTalked ldrb r0, [r0] bl GetRamScript adds r1, r0, 0 @@ -721,7 +721,7 @@ TryGetInvisibleMapObjectScript: @ 809C458 ldr r2, [r0, 0x8] cmp r2, 0 bne _0809C490 - ldr r0, =gUnknown_082C8436 + ldr r0, =EventScript_2C8436 b _0809C532 .pool _0809C490: @@ -778,7 +778,7 @@ _0809C4E2: lsrs r0, 24 cmp r0, 0x1 beq _0809C4CC - ldr r0, =gUnknown_08271CB7 + ldr r0, =EventScript_271CB7 b _0809C532 .pool _0809C510: @@ -790,7 +790,7 @@ _0809C510: lsls r0, 24 cmp r0, 0 beq _0809C4CC - ldr r0, =gUnknown_082759F1 + ldr r0, =EventScript_2759F1 b _0809C532 .pool _0809C530: @@ -816,7 +816,7 @@ TryGetMetatileBehaviorScript: @ 809C538 lsrs r0, 24 cmp r0, 0x1 bne _0809C55C - ldr r0, =gUnknown_0827EE0B + ldr r0, =EventScript_27EE0B b _0809C7E4 .pool _0809C55C: @@ -826,7 +826,7 @@ _0809C55C: lsrs r0, 24 cmp r0, 0x1 bne _0809C574 - ldr r0, =gUnknown_08271D92 + ldr r0, =EventScript_271D92 b _0809C7E4 .pool _0809C574: @@ -836,7 +836,7 @@ _0809C574: lsrs r0, 24 cmp r0, 0x1 bne _0809C58C - ldr r0, =gUnknown_081E615D + ldr r0, =SootopolisCity_EventScript_1E615D b _0809C7E4 .pool _0809C58C: @@ -846,7 +846,7 @@ _0809C58C: lsrs r0, 24 cmp r0, 0x1 bne _0809C5A4 - ldr r0, =gUnknown_082393F9 + ldr r0, =SkyPillar_Outside_EventScript_2393F9 b _0809C7E4 .pool _0809C5A4: @@ -864,7 +864,7 @@ _0809C5B4: lsrs r0, 24 cmp r0, 0x1 bne _0809C5CC - ldr r0, =gUnknown_082A4BAC + ldr r0, =EventScript_2A4BAC b _0809C7E4 .pool _0809C5CC: @@ -874,7 +874,7 @@ _0809C5CC: lsrs r0, 24 cmp r0, 0x1 bne _0809C5E4 - ldr r0, =gUnknown_0826A22A + ldr r0, =Route110_TrickHouseEntrance_EventScript_26A22A b _0809C7E4 .pool _0809C5E4: @@ -884,7 +884,7 @@ _0809C5E4: lsrs r0, 24 cmp r0, 0x1 bne _0809C5FC - ldr r0, =gUnknown_0827208F + ldr r0, =EventScript_27208F b _0809C7E4 .pool _0809C5FC: @@ -894,7 +894,7 @@ _0809C5FC: lsrs r0, 24 cmp r0, 0x1 bne _0809C614 - ldr r0, =gUnknown_08292DE5 + ldr r0, =EventScript_292DE5 b _0809C7E4 .pool _0809C614: @@ -904,7 +904,7 @@ _0809C614: lsrs r0, 24 cmp r0, 0x1 bne _0809C62C - ldr r0, =gUnknown_082725CE + ldr r0, =EventScript_2725CE b _0809C7E4 .pool _0809C62C: @@ -914,7 +914,7 @@ _0809C62C: lsrs r0, 24 cmp r0, 0x1 bne _0809C644 - ldr r0, =gUnknown_082725D7 + ldr r0, =EventScript_2725D7 b _0809C7E4 .pool _0809C644: @@ -924,7 +924,7 @@ _0809C644: lsrs r0, 24 cmp r0, 0x1 bne _0809C65C - ldr r0, =gUnknown_082725E0 + ldr r0, =EventScript_2725E0 b _0809C7E4 .pool _0809C65C: @@ -934,7 +934,7 @@ _0809C65C: lsrs r0, 24 cmp r0, 0x1 bne _0809C674 - ldr r0, =gUnknown_082725E9 + ldr r0, =EventScript_2725E9 b _0809C7E4 .pool _0809C674: @@ -944,7 +944,7 @@ _0809C674: lsrs r0, 24 cmp r0, 0x1 bne _0809C68C - ldr r0, =gUnknown_082725F2 + ldr r0, =EventScript_2725F2 b _0809C7E4 .pool _0809C68C: @@ -954,7 +954,7 @@ _0809C68C: lsrs r0, 24 cmp r0, 0x1 bne _0809C6A4 - ldr r0, =gUnknown_082725FB + ldr r0, =EventScript_2725FB b _0809C7E4 .pool _0809C6A4: @@ -964,7 +964,7 @@ _0809C6A4: lsrs r0, 24 cmp r0, 0x1 bne _0809C6BC - ldr r0, =gUnknown_08272604 + ldr r0, =EventScript_272604 b _0809C7E4 .pool _0809C6BC: @@ -975,7 +975,7 @@ _0809C6BC: lsrs r0, 24 cmp r0, 0x1 bne _0809C6D4 - ldr r0, =gUnknown_08277B8A + ldr r0, =OldaleTown_PokemonCenter_2F_EventScript_277B8A b _0809C7E4 .pool _0809C6D4: @@ -997,7 +997,7 @@ _0809C6EC: lsrs r0, 24 cmp r0, 0x1 bne _0809C704 - ldr r0, =gUnknown_0827381B + ldr r0, =EventScript_27381B b _0809C7E4 .pool _0809C704: @@ -1007,7 +1007,7 @@ _0809C704: lsrs r0, 24 cmp r0, 0x1 bne _0809C71C - ldr r0, =gUnknown_082C8393 + ldr r0, =TrainerHill_1F_EventScript_2C8393 b _0809C7E4 .pool _0809C71C: @@ -1125,7 +1125,7 @@ TryGetFieldMoveScript: @ 809C7EC lsrs r0, 24 cmp r0, 0x1 bne _0809C824 - ldr r0, =gUnknown_08271EA0 + ldr r0, =EventScript_271EA0 b _0809C862 .pool _0809C824: @@ -1146,11 +1146,11 @@ _0809C824: lsrs r0, 24 cmp r0, 0x1 bne _0809C858 - ldr r0, =gUnknown_08290A49 + ldr r0, =EventScript_290A49 b _0809C862 .pool _0809C858: - ldr r0, =gUnknown_08290A83 + ldr r0, =EventScript_290A83 b _0809C862 .pool _0809C860: @@ -1174,7 +1174,7 @@ sub_809C868: @ 809C868 lsrs r0, 24 cmp r0, 0x2 bne _0809C894 - ldr r0, =gUnknown_08290B0F + ldr r0, =EventScript_290B0F bl ScriptContext1_SetupScript movs r0, 0x1 b _0809C896 @@ -1203,7 +1203,7 @@ sub_809C89C: @ 809C89C lsrs r0, 24 cmp r0, 0x1 bne _0809C8D4 - ldr r0, =gUnknown_08290B5A + ldr r0, =EventScript_290B5A bl ScriptContext1_SetupScript movs r0, 0x1 b _0809C8D6 @@ -1310,7 +1310,7 @@ _0809C988: lsls r0, 24 cmp r0, 0 beq _0809C9A4 - ldr r0, =gUnknown_08252BE8 + ldr r0, =BattleFrontier_BattlePyramidEmptySquare_EventScript_252BE8 _0809C996: bl ScriptContext1_SetupScript movs r0, 0x1 @@ -1385,7 +1385,7 @@ _0809CA04: lsrs r0, 24 cmp r0, 0x1 bne _0809CA48 - ldr r0, =gUnknown_082736BC + ldr r0, =EventScript_2736BC bl ScriptContext1_SetupScript b _0809CB28 .pool @@ -1396,7 +1396,7 @@ _0809CA48: beq _0809CA64 movs r0, 0xD bl IncrementGameStat - ldr r0, =gUnknown_08291FC0 + ldr r0, =Route117_PokemonDayCare_EventScript_291FC0 bl ScriptContext1_SetupScript b _0809CB28 .pool @@ -1416,7 +1416,7 @@ _0809CA7C: lsrs r0, 24 cmp r0, 0x1 bne _0809CA94 - ldr r0, =gUnknown_08238EAF + ldr r0, =IslandCave_EventScript_238EAF bl ScriptContext1_SetupScript b _0809CB28 .pool @@ -1424,7 +1424,7 @@ _0809CA94: bl is_tile_that_overrides_player_control cmp r0, 0x1 bne _0809CAA8 - ldr r0, =gUnknown_081DF7BA + ldr r0, =MauvilleCity_EventScript_1DF7BA bl ScriptContext1_SetupScript b _0809CB28 .pool @@ -1432,7 +1432,7 @@ _0809CAA8: bl sub_8138120 cmp r0, 0x1 bne _0809CABC - ldr r0, =gUnknown_081F49EC + ldr r0, =Route119_EventScript_1F49EC bl ScriptContext1_SetupScript b _0809CB28 .pool @@ -1440,7 +1440,7 @@ _0809CABC: bl sub_8138168 cmp r0, 0x1 bne _0809CAD0 - ldr r0, =gUnknown_081FA4D6 + ldr r0, =LittlerootTown_ProfessorBirchsLab_EventScript_1FA4D6 bl ScriptContext1_SetupScript b _0809CB28 .pool @@ -1448,7 +1448,7 @@ _0809CAD0: bl sub_81381B0 cmp r0, 0x1 bne _0809CAE4 - ldr r0, =gUnknown_0821307B + ldr r0, =RustboroCity_Gym_EventScript_21307B bl ScriptContext1_SetupScript b _0809CB28 .pool @@ -1456,7 +1456,7 @@ _0809CAE4: bl sub_81381F8 cmp r0, 0x1 bne _0809CAF8 - ldr r0, =gUnknown_08224175 + ldr r0, =MossdeepCity_SpaceCenter_2F_EventScript_224175 bl ScriptContext1_SetupScript b _0809CB28 .pool @@ -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..83262a1a5 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_Result strh r5, [r0] b _080F9718 .pool _080F96F0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x1 strh r0, [r1] b _080F9718 @@ -224,7 +224,7 @@ _080F96FC: b _080F9722 .pool _080F9714: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result strh r1, [r0] _080F9718: bl EnableBothScriptContexts diff --git a/asm/field_screen.s b/asm/field_screen.s index 4ab8a5a53..497346f8a 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_Result ldrh r0, [r0] cmp r0, 0 bne _080B0568 diff --git a/asm/fldeff_80F9BCC.s b/asm/fldeff_80F9BCC.s index 63acc9982..7ebf0bfa8 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_Result ldrh r0, [r0] cmp r0, 0x1 beq _080FA0AE @@ -647,7 +647,7 @@ sub_80FA0DC: @ 80FA0DC lsls r0, 24 lsrs r0, 24 str r0, [r1] - ldr r0, =gUnknown_08275A86 + ldr r0, =EventScript_275A86 bl ScriptContext1_SetupScript pop {r0} bx r0 @@ -782,7 +782,7 @@ sub_80FA1E8: @ 80FA1E8 lsls r0, 24 lsrs r0, 24 str r0, [r1] - ldr r0, =gUnknown_08275ADF + ldr r0, =EventScript_275ADF bl ScriptContext1_SetupScript pop {r0} bx r0 @@ -955,7 +955,7 @@ sub_80FA34C: @ 80FA34C lsls r0, 24 lsrs r0, 24 str r0, [r1] - ldr r0, =gUnknown_08275B38 + ldr r0, =EventScript_275B38 bl ScriptContext1_SetupScript pop {r0} bx r0 @@ -2063,7 +2063,7 @@ _080FACC2: ldr r0, =gStringVar2 ldr r1, =gText_Gold bl StringCopy - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result movs r0, 0 strh r0, [r1] ldr r0, =0x00004054 @@ -2103,12 +2103,12 @@ _080FAD14: b _080FAD8A .pool _080FAD60: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x1 b _080FAD70 .pool _080FAD6C: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x2 _080FAD70: strh r0, [r1] @@ -2131,7 +2131,7 @@ _080FAD8A: b _080FADCE .pool _080FADA4: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x3 strh r0, [r1] ldr r0, =0x00004054 diff --git a/asm/fldeff_cut.s b/asm/fldeff_cut.s index e31bf22e2..5e2a99d18 100755 --- a/asm/fldeff_cut.s +++ b/asm/fldeff_cut.s @@ -425,7 +425,7 @@ sub_80D3A9C: @ 80D3A9C lsls r0, 24 lsrs r0, 24 str r0, [r1] - ldr r0, =gUnknown_08290705 + ldr r0, =Route103_EventScript_290705 bl ScriptContext1_SetupScript pop {r0} bx r0 @@ -1323,7 +1323,7 @@ _080D41D4: lsrs r0, 24 cmp r0, 0x1 bne _080D422A - ldr r0, =gUnknown_08267EDB + ldr r0, =FarawayIsland_Interior_EventScript_267EDB bl ScriptContext1_SetupScript _080D422A: pop {r4-r6} diff --git a/asm/fldeff_strength.s b/asm/fldeff_strength.s index 947517ed5..3001ca259 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_Result bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 @@ -44,7 +44,7 @@ sub_8145E0C: @ 8145E0C lsls r0, 24 lsrs r0, 24 str r0, [r1] - ldr r0, =gUnknown_082908FD + ldr r0, =FieryPath_EventScript_2908FD bl ScriptContext1_SetupScript pop {r0} bx r0 diff --git a/asm/fldeff_sweetscent.s b/asm/fldeff_sweetscent.s index ea7b2653a..9510ca4a0 100644 --- a/asm/fldeff_sweetscent.s +++ b/asm/fldeff_sweetscent.s @@ -205,7 +205,7 @@ sub_815A090: @ 815A090 lsls r2, 1 bl CpuFastSet bl sub_80AC3E4 - ldr r0, =gUnknown_08290CAE + ldr r0, =EventScript_290CAE bl ScriptContext1_SetupScript adds r0, r4, 0 bl DestroyTask diff --git a/asm/item_menu.s b/asm/item_menu.s index 06c0a86ed..a868b2672 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_Result 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_Result 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_Result movs r0, 0 strh r0, [r1] pop {r0} @@ -2181,7 +2181,7 @@ _081ABE32: _081ABE40: movs r0, 0x5 bl PlaySE - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId mov r1, r10 strh r1, [r0] ldr r0, =gTasks + 0x8 @@ -2215,7 +2215,7 @@ _081ABE68: lsrs r0, 24 adds r1, r4, 0 bl BagGetItemIdByPocketPosition - ldr r1, =gScriptItemId + ldr r1, =gSpecialVar_ItemId strh r0, [r1] ldr r1, =gUnknown_08614054 ldrb r0, [r5, 0x4] @@ -3125,7 +3125,7 @@ _081AC668: .4byte _081AC70C .4byte _081AC690 _081AC690: - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl ItemId_GetBattleUsage lsls r0, 24 @@ -3170,7 +3170,7 @@ _081AC6E8: b _081ACA10 .pool _081AC70C: - ldr r4, =gScriptItemId + ldr r4, =gSpecialVar_ItemId ldrh r0, [r4] bl itemid_is_unique lsls r0, 24 @@ -3205,7 +3205,7 @@ _081AC748: b _081ACA10 .pool _081AC76C: - ldr r4, =gScriptItemId + ldr r4, =gSpecialVar_ItemId ldrh r0, [r4] bl itemid_is_unique lsls r0, 24 @@ -3240,7 +3240,7 @@ _081AC7A8: b _081ACA10 .pool _081AC7CC: - ldr r4, =gScriptItemId + ldr r4, =gSpecialVar_ItemId ldrh r0, [r4] bl itemid_is_unique lsls r0, 24 @@ -3288,7 +3288,7 @@ _081AC840: ldrb r0, [r0, 0x5] cmp r0, 0x4 beq _081AC856 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl sub_8122148 lsls r0, 24 @@ -3358,7 +3358,7 @@ _081AC8D4: ldr r1, =gUnknown_0861402C movs r2, 0x4 bl memcpy - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl itemid_is_mail lsls r0, 24 @@ -3396,7 +3396,7 @@ _081AC92C: ldr r0, [r0] ldr r1, =0x00000496 adds r0, r1 - ldr r2, =gScriptItemId + ldr r2, =gSpecialVar_ItemId ldrh r0, [r0] ldrh r1, [r2] cmp r0, r1 @@ -3472,7 +3472,7 @@ _081ACA12: bne _081ACA50 movs r0, 0x1 bl ClearWindowTilemap - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl PrintTMHMMoveData movs r0, 0x3 @@ -3484,7 +3484,7 @@ _081ACA12: b _081ACA86 .pool _081ACA50: - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -3985,7 +3985,7 @@ ItemMenu_UseOutOfBattle: @ 81ACE7C push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r5, =gScriptItemId + ldr r5, =gSpecialVar_ItemId ldrh r0, [r5] bl ItemId_GetFieldFunc cmp r0, 0 @@ -4015,7 +4015,7 @@ _081ACEB8: ldrb r0, [r0, 0x5] cmp r0, 0x3 beq _081ACEE8 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl ItemId_GetFieldFunc adds r1, r0, 0 @@ -4055,7 +4055,7 @@ ItemMenu_Toss: @ 81ACEF4 b _081ACF6A .pool _081ACF24: - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -4105,7 +4105,7 @@ BagMenuConfirmToss: @ 81ACF88 lsls r4, 3 ldr r0, =gTasks + 0x8 adds r4, r0 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -4242,7 +4242,7 @@ BagMenuActuallyToss: @ 81AD0CC lsls r4, 3 ldr r5, =gTasks + 0x8 adds r6, r4, r5 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -4312,7 +4312,7 @@ Task_ActuallyToss: @ 81AD150 beq _081AD1CE movs r0, 0x5 bl PlaySE - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] ldrh r1, [r5, 0x10] bl RemoveBagItem @@ -4369,7 +4369,7 @@ ItemMenu_Register: @ 81AD1EC ldr r0, [r0] ldr r2, =0x00000496 adds r1, r0, r2 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r2, [r0] ldrh r0, [r1] cmp r0, r2 @@ -4412,7 +4412,7 @@ ItemMenu_Give: @ 81AD278 lsrs r4, r0, 24 adds r6, r4, 0 bl bag_menu_remove_some_window - ldr r5, =gScriptItemId + ldr r5, =gSpecialVar_ItemId ldrh r0, [r5] bl itemid_80BF6D8_mail_related lsls r0, 24 @@ -4476,7 +4476,7 @@ bag_menu_print_cant_be_held_msg: @ 81AD30C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -4567,7 +4567,7 @@ ItemMenu_UseInBattle: @ 81AD3DC push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gScriptItemId + ldr r4, =gSpecialVar_ItemId ldrh r0, [r4] bl ItemId_GetBattleFunc cmp r0, 0 @@ -4601,7 +4601,7 @@ item_menu_type_2: @ 81AD41C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gScriptItemId + ldr r4, =gSpecialVar_ItemId ldrh r0, [r4] bl itemid_80BF6D8_mail_related lsls r0, 24 @@ -4662,7 +4662,7 @@ item_menu_type_b: @ 81AD4B4 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r5, =gScriptItemId + ldr r5, =gSpecialVar_ItemId ldrh r0, [r5] bl itemid_is_mail lsls r0, 24 @@ -4751,7 +4751,7 @@ _081AD550: bl player_bitmagic bl sub_808B864 bl sub_808BCF4 - ldr r2, =gScriptItemId + ldr r2, =gSpecialVar_ItemId ldr r0, [r4] adds r0, r5 ldrh r1, [r0] @@ -4775,7 +4775,7 @@ _081AD5C4: adds r0, r5 strh r7, [r0] _081AD5CA: - ldr r0, =gUnknown_082736B3 + ldr r0, =EventScript_2736B3 bl ScriptContext1_SetupScript _081AD5D0: movs r0, 0x1 @@ -4798,7 +4798,7 @@ display_sell_item_ask_str: @ 81AD5DC lsls r0, 3 ldr r1, =gTasks + 0x8 adds r4, r0, r1 - ldr r6, =gScriptItemId + ldr r6, =gSpecialVar_ItemId ldrh r0, [r6] bl itemid_get_market_price lsls r0, 16 @@ -4861,7 +4861,7 @@ sub_81AD680: @ 81AD680 ldr r0, =gTasks + 0x8 adds r4, r0 ldr r6, =gStringVar1 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl itemid_get_market_price lsls r0, 16 @@ -4944,7 +4944,7 @@ sub_81AD730: @ 81AD730 adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl itemid_get_market_price lsls r0, 16 @@ -4996,7 +4996,7 @@ sub_81AD794: @ 81AD794 ldrb r4, [r0] movs r2, 0x10 ldrsh r5, [r6, r2] - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl itemid_get_market_price lsls r0, 16 @@ -5061,7 +5061,7 @@ sub_81AD84C: @ 81AD84C lsls r4, 3 ldr r0, =gTasks + 0x8 adds r4, r0 - ldr r6, =gScriptItemId + ldr r6, =gSpecialVar_ItemId ldrh r0, [r6] ldr r1, =gStringVar2 bl CopyItemName @@ -5122,7 +5122,7 @@ sub_81AD8C8: @ 81AD8C8 adds r5, r0 movs r0, 0x5F bl PlaySE - ldr r2, =gScriptItemId + ldr r2, =gSpecialVar_ItemId mov r8, r2 ldrh r0, [r2] mov r3, r10 @@ -5241,7 +5241,7 @@ display_deposit_item_ask_str: @ 81AD9EC b _081ADA5E .pool _081ADA18: - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -5366,7 +5366,7 @@ sub_81ADB14: @ 81ADB14 movs r0, 0x1 movs r1, 0 bl FillWindowPixelBuffer - ldr r4, =gScriptItemId + ldr r4, =gSpecialVar_ItemId ldrh r0, [r4] bl itemid_is_unique lsls r0, 24 @@ -5690,7 +5690,7 @@ _081ADDEC: ldrb r0, [r4] movs r1, 0x2 bl bag_menu_print_cursor_ - ldr r1, =gScriptItemId + ldr r1, =gSpecialVar_ItemId movs r0, 0x4 strh r0, [r1] adds r0, r5, 0 @@ -5726,10 +5726,10 @@ unknown_ItemMenu_Show: @ 81ADE38 lsls r4, 24 lsrs r4, 24 ldr r1, =gSpecialVar_0x8005 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] strh r0, [r1] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x1 strh r0, [r1] bl bag_menu_remove_some_window @@ -5760,11 +5760,11 @@ unknown_ItemMenu_Give2: @ 81ADE8C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result movs r0, 0x1 strh r0, [r1] bl bag_menu_remove_some_window diff --git a/asm/item_use.s b/asm/item_use.s index d3c724166..172080b16 100644 --- a/asm/item_use.s +++ b/asm/item_use.s @@ -11,7 +11,7 @@ SetUpItemUseCallback: @ 80FD060 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r1, =gScriptItemId + ldr r1, =gSpecialVar_ItemId ldrh r0, [r1] cmp r0, 0xAF bne _080FD084 @@ -260,7 +260,7 @@ sub_80FD254: @ 80FD254 push {lr} sub sp, 0x24 mov r1, sp - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] strh r0, [r1, 0x20] ldr r1, =bag_menu_mail_related @@ -381,7 +381,7 @@ ItemUseOnFieldCB_Bike: @ 80FD358 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl ItemId_GetSecondaryId lsls r0, 24 @@ -515,7 +515,7 @@ ItemUseOnFieldCB_Rod: @ 80FD468 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl ItemId_GetSecondaryId lsls r0, 24 @@ -1642,7 +1642,7 @@ sub_80FDD10: @ 80FDD10 b _080FDD68 .pool _080FDD58: - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl ItemId_GetFieldFunc adds r1, r0, 0 @@ -1661,12 +1661,12 @@ sub_80FDD74: @ 80FDD74 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem bl ScriptContext2_Enable - ldr r0, =gUnknown_08274482 + ldr r0, =Route102_EventScript_274482 bl ScriptContext1_SetupScript adds r0, r4, 0 bl DestroyTask @@ -1728,7 +1728,7 @@ sub_80FDE08: @ 80FDE08 lsls r4, 24 lsrs r4, 24 bl ScriptContext2_Enable - ldr r0, =gUnknown_082744C0 + ldr r0, =Route102_EventScript_2744C0 bl ScriptContext1_SetupScript adds r0, r4, 0 bl DestroyTask @@ -1787,7 +1787,7 @@ sub_80FDE7C: @ 80FDE7C lsls r4, 24 lsrs r4, 24 bl ScriptContext2_Enable - ldr r0, =gUnknown_08242CFC + ldr r0, =BattleFrontier_OutsideEast_EventScript_242CFC bl ScriptContext1_SetupScript adds r0, r4, 0 bl DestroyTask @@ -1886,7 +1886,7 @@ ItemUseOutOfBattle_TMHM: @ 80FDF48 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r1, [r0] movs r0, 0xA9 lsls r0, 1 @@ -1945,7 +1945,7 @@ task08_0809AD8C: @ 80FDFBC cmp r0, 0 beq _080FE000 ldr r4, =gStringVar1 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl ItemIdToBattleMoveId lsls r0, 16 @@ -2002,7 +2002,7 @@ sub_80FE03C: @ 80FE03C thumb_func_start sub_80FE058 sub_80FE058: @ 80FE058 push {r4,lr} - ldr r4, =gScriptItemId + ldr r4, =gSpecialVar_ItemId ldrh r0, [r4] movs r1, 0x1 bl RemoveBagItem @@ -2125,7 +2125,7 @@ sub_80FE164: @ 80FE164 cmp r0, 0 bne _080FE1C2 ldr r4, =0x00004021 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl ItemId_GetHoldEffectParam adds r1, r0, 0 @@ -2205,7 +2205,7 @@ ItemUseOutOfBattle_BlackWhiteFlute: @ 80FE234 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gScriptItemId + ldr r4, =gSpecialVar_ItemId ldrh r0, [r4] ldr r1, =gStringVar2 bl CopyItemName @@ -2361,7 +2361,7 @@ ItemUseInBattle_PokeBall: @ 80FE394 lsls r0, 24 cmp r0, 0 bne _080FE3D0 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem @@ -2450,7 +2450,7 @@ sub_80FE440: @ 80FE440 ble _080FE4AC movs r0, 0x1 bl PlaySE - ldr r4, =gScriptItemId + ldr r4, =gSpecialVar_ItemId ldrh r0, [r4] movs r1, 0x1 bl RemoveBagItem @@ -2496,7 +2496,7 @@ ItemUseInBattle_StatIncrease: @ 80FE4B8 muls r0, r2 ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gScriptItemId + ldr r1, =gSpecialVar_ItemId ldrh r1, [r1] lsls r2, 24 lsrs r2, 24 @@ -2664,7 +2664,7 @@ ItemUseOutOfBattle_EnigmaBerry: @ 80FE650 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl GetItemEffectType lsls r0, 24 @@ -2785,7 +2785,7 @@ ItemUseInBattle_EnigmaBerry: @ 80FE77C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl GetItemEffectType lsls r0, 24 diff --git a/asm/link.s b/asm/link.s index da4bfbfd1..c1ab6c434 100644 --- a/asm/link.s +++ b/asm/link.s @@ -1232,7 +1232,7 @@ _08009E8C: _08009EA8: ldr r0, =gUnknown_03003110 strh r2, [r0] - ldr r1, =gScriptItemId + ldr r1, =gSpecialVar_ItemId ldrh r1, [r1] b _08009F04 .pool @@ -18044,7 +18044,7 @@ BerryBlenderLinkBecomeLeader: @ 801273C movs r0, 0 strb r0, [r1, 0xC] strb r0, [r1, 0xD] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result 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_Result 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_Result 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_Result movs r1, 0x6 b _08013B58 .pool _08013B14: bl sub_800E084 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result movs r0, 0xB strh r0, [r1] _08016894: @@ -30491,7 +30491,7 @@ _0801940C: b _08019922 .pool _0801942C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result ldrh r0, [r0] cmp r0, 0x5 beq _08019436 @@ -30992,7 +30992,7 @@ _080197F8: b _08019922 .pool _08019810: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result 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_Result bl sub_801B044 adds r4, r0, 0 bl IsMysteryEventEnabled @@ -45605,7 +45605,7 @@ _08020D74: sub_8020D8C: @ 8020D8C push {r4,lr} sub sp, 0xC - ldr r1, =gScriptItemId + ldr r1, =gSpecialVar_ItemId ldrh r0, [r1] subs r0, 0x85 lsls r0, 16 @@ -45626,7 +45626,7 @@ _08020DB0: ldrb r0, [r2, 0x8] lsls r0, 5 adds r0, r2, r0 - ldr r1, =gScriptItemId + ldr r1, =gSpecialVar_ItemId ldrh r1, [r1] subs r1, 0x85 adds r0, 0xA4 @@ -59190,7 +59190,7 @@ sub_8027A48: @ 8027A48 sub_8027A5C: @ 8027A5C push {r4-r6,lr} movs r5, 0 - ldr r6, =gScriptResult + ldr r6, =gSpecialVar_Result _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_Result 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_Result 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_Result 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..69cdb38e5 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,181 @@ .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 + .elseif \type == 10 + .4byte \pointer1 @ text + .4byte \pointer2 @ text + .elseif \type == 11 + .4byte \pointer1 @ text + .4byte \pointer2 @ text + .elseif \type == 12 + .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 +677,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 +718,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 +798,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 +807,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 +843,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 +929,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 +989,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 +1003,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 +1114,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 +1228,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 +1239,7 @@ .2byte \word .endm - .macro vjump pointer + .macro vgoto pointer .byte 0xb9 .4byte \pointer .endm @@ -1178,19 +1249,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 +1271,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 +1338,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 +1359,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 +1442,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 +1464,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..5a810c497 --- /dev/null +++ b/asm/macros/movement.inc @@ -0,0 +1,123 @@ + .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 + create_movement step_93 + create_movement step_94 + create_movement step_95 + create_movement step_96 + create_movement step_97 + create_movement step_98 + create_movement step_99 + create_movement step_9A + + enum_start 0xfe + create_movement step_end diff --git a/asm/map_obj_lock.s b/asm/map_obj_lock.s index ee60814f5..2270051c2 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_Facing ldrb r1, [r1] bl FieldObjectFaceOppositeDirection pop {r0} diff --git a/asm/mauville_old_man.s b/asm/mauville_old_man.s index bfcf8742a..8c7037ca7 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_Result 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_Result 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_Result 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_Result movs r0, 0 b _081203B6 .pool _081203AC: ldr r0, =gStringVar1 bl CopyEasyChatWord - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result movs r0, 0 strh r0, [r1] strb r0, [r2, 0x1] b _081203F2 .pool _081203EC: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result 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_Result movs r0, 0 strh r0, [r1] b _08121364 .pool _0812135C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result strh r5, [r0] ldr r0, =gUnknown_03001178 strb r4, [r0] diff --git a/asm/party_menu.s b/asm/party_menu.s index 47868dee8..4c8d90530 100755 --- a/asm/party_menu.s +++ b/asm/party_menu.s @@ -1213,13 +1213,13 @@ sub_81B0BFC: @ 81B0BFC muls r1, r0 ldr r0, =gPlayerParty adds r6, r1, r0 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r4, [r0] ldr r0, =gUnknown_0203CEC8 ldrb r0, [r0, 0xB] cmp r0, 0xC bne _081B0C40 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0 strh r0, [r1] ldr r0, =gSpecialVar_0x8005 @@ -7739,7 +7739,7 @@ c2_8123744: @ 81B41F0 mov r7, r8 push {r7} sub sp, 0xC - ldr r6, =gScriptItemId + ldr r6, =gSpecialVar_ItemId ldrh r0, [r6] cmp r0, 0 bne _081B4224 @@ -7845,7 +7845,7 @@ sub_81B42D0: @ 81B42D0 ands r0, r1 cmp r0, 0 bne _081B432C - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r4, [r0] ldr r0, =gUnknown_0203CEC8 mov r8, r0 @@ -7969,7 +7969,7 @@ _081B43FC: beq _081B44DE b _081B44EC _081B4402: - ldr r5, =gScriptItemId + ldr r5, =gSpecialVar_ItemId ldrh r0, [r5] movs r1, 0x1 bl RemoveBagItem @@ -8135,7 +8135,7 @@ sub_81B4578: @ 81B4578 lsls r0, 16 lsrs r0, 16 mov r8, r0 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result ldrh r7, [r0] cmp r7, 0 bne _081B45F8 @@ -8212,7 +8212,7 @@ sub_81B4624: @ 81B4624 muls r0, r1 ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gScriptItemId + ldr r1, =gSpecialVar_ItemId ldrh r1, [r1] movs r2, 0 movs r3, 0 @@ -8220,7 +8220,7 @@ sub_81B4624: @ 81B4624 b _081B467C .pool _081B4670: - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] ldrh r1, [r1] movs r2, 0 @@ -11359,7 +11359,7 @@ _081B61BC: movs r7, 0 movs r6, 0 _081B61C0: - ldr r4, =gScriptItemId + ldr r4, =gSpecialVar_ItemId ldrh r0, [r4] bl GetItemEffectType lsls r0, 24 @@ -11787,7 +11787,7 @@ ItemUseCB_Medicine: @ 81B6588 muls r1, r0 ldr r0, =gPlayerParty adds r5, r1, r0 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r6, [r0] adds r0, r5, 0 adds r1, r6, 0 @@ -12032,7 +12032,7 @@ sub_81B67C8: @ 81B67C8 muls r1, r0 ldr r0, =gPlayerParty adds r5, r1, r0 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r6, [r0] adds r0, r6, 0 bl GetItemEffectType @@ -12391,7 +12391,7 @@ dp05_ether: @ 81B6AFC push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] cmp r0, 0xAF bne _081B6B20 @@ -12500,7 +12500,7 @@ ether_effect_related: @ 81B6BEC lsrs r6, r0, 24 movs r4, 0 ldr r7, =gUnknown_0203CED6 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r5, [r0] movs r0, 0xE negs r0, r0 @@ -12729,7 +12729,7 @@ sub_81B6DC4: @ 81B6DC4 movs r0, 0xE adds r0, r7 mov r8, r0 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r4, [r0] ldr r1, =gStringVar1 adds r0, r5, 0 @@ -12818,7 +12818,7 @@ sub_81B6EB4: @ 81B6EB4 adds r5, r1, r0 adds r6, r2, 0 adds r6, 0xE - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r4, [r0] movs r1, 0x2 ldrsh r0, [r6, r1] @@ -12928,7 +12928,7 @@ _081B6FC0: _081B6FDC: cmp r0, 0x2 bne _081B6FE4 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result 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_Result strh r5, [r0] _081B7370: ldr r0, =gTasks @@ -13409,7 +13409,7 @@ dp05_rare_candy: @ 81B7404 movs r1, 0x86 lsls r1, 2 adds r4, r6, r1 - ldr r2, =gScriptItemId + ldr r2, =gSpecialVar_ItemId mov r8, r2 adds r0, r5, 0 movs r1, 0x38 @@ -13467,7 +13467,7 @@ _081B74B4: ldrb r0, [r0, 0x9] adds r1, r5, 0 bl sub_81B754C - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem @@ -14084,7 +14084,7 @@ sub_81B7A28: @ 81B7A28 lsls r0, 16 lsrs r7, r0, 16 ldrb r0, [r6, 0x9] - ldr r1, =gScriptItemId + ldr r1, =gSpecialVar_ItemId ldrh r1, [r1] movs r2, 0 bl ExecuteTableBasedItemEffect__ @@ -14236,7 +14236,7 @@ _081B7BC8: ldr r1, =gUnknown_0203CEE8 movs r0, 0x1 strb r0, [r1] - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem @@ -14312,7 +14312,7 @@ sub_81B7C74: @ 81B7C74 ldr r0, [r1] str r0, [r2] ldrb r0, [r1, 0x9] - ldr r4, =gScriptItemId + ldr r4, =gSpecialVar_ItemId ldrh r1, [r4] movs r2, 0 bl ExecuteTableBasedItemEffect__ @@ -14685,7 +14685,7 @@ _081B7F72: movs r3, 0 bl sub_81B0038 ldr r1, =gUnknown_0203CEC8 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] strh r0, [r1, 0xC] add sp, 0xC @@ -14933,7 +14933,7 @@ sub_81B81A8: @ 81B81A8 bl GetMonData lsls r0, 16 lsrs r7, r0, 16 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result 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_Result 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_Result 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_Result movs r0, 0x1 strh r0, [r1] b _081B9910 .pool _081B990C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result 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_Result 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_Result movs r0, 0x1 strh r0, [r1] _081B999C: diff --git a/asm/player_pc.s b/asm/player_pc.s index cd91ed3e1..592cc0fe0 100644 --- a/asm/player_pc.s +++ b/asm/player_pc.s @@ -379,12 +379,12 @@ sub_816B148: @ 816B148 ldrb r0, [r0, 0x8] cmp r0, 0 bne _0816B174 - ldr r0, =gUnknown_081F863F + ldr r0, =LittlerootTown_BrendansHouse_2F_EventScript_1F863F bl ScriptContext1_SetupScript b _0816B184 .pool _0816B174: - ldr r0, =gUnknown_081F958F + ldr r0, =LittlerootTown_MaysHouse_2F_EventScript_1F958F bl ScriptContext1_SetupScript b _0816B184 .pool diff --git a/asm/pokeblock_feed.s b/asm/pokeblock_feed.s index a3047e225..9830db888 100644 --- a/asm/pokeblock_feed.s +++ b/asm/pokeblock_feed.s @@ -380,7 +380,7 @@ _08179EEC: b _08179F5E .pool _08179F00: - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrb r0, [r0] bl sub_8179FEC ldr r0, =gUnknown_0203BD1C @@ -692,7 +692,7 @@ sub_817A1C4: @ 817A1C4 ldr r0, =gPlayerParty adds r5, r0 ldr r1, =gSaveBlock1Ptr - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] lsls r0, 3 ldr r2, =0x00000848 diff --git a/asm/pokemon_storage_system.s b/asm/pokemon_storage_system.s index a8365ba18..4d7fe3d62 100755 --- a/asm/pokemon_storage_system.s +++ b/asm/pokemon_storage_system.s @@ -2252,7 +2252,7 @@ _080C8230: ldrb r0, [r0] cmp r0, 0x2 bne _080C825C - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] cmp r0, 0 beq _080C825C @@ -5458,7 +5458,7 @@ _080C9F56: sub_80C9F6C: @ 80C9F6C push {lr} sub sp, 0x4 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r1, [r0] mov r0, sp strh r1, [r0] diff --git a/asm/pokemon_summary_screen.s b/asm/pokemon_summary_screen.s index db11f6865..d30c6b4ee 100755 --- a/asm/pokemon_summary_screen.s +++ b/asm/pokemon_summary_screen.s @@ -3585,7 +3585,7 @@ _081C5C5C: _081C5C88: movs r0, 0x5 bl PlaySE - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId strh r4, [r0] adds r0, r5, 0 bl sub_81C5B14 @@ -3594,7 +3594,7 @@ _081C5C88: _081C5CA0: movs r0, 0x5 bl PlaySE - ldr r2, =gScriptItemId + ldr r2, =gSpecialVar_ItemId mov r12, r2 ldr r0, =gSaveBlock2Ptr ldr r2, [r0] @@ -3681,7 +3681,7 @@ sub_81C5D20: @ 81C5D20 b _081C5DD8 .pool _081C5D74: - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] bl ItemId_GetBattleUsage lsls r0, 24 @@ -3722,7 +3722,7 @@ _081C5DCE: _081C5DD8: strb r0, [r1] _081C5DDA: - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -4195,7 +4195,7 @@ sub_81C61E0: @ 81C61E0 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gScriptItemId + ldr r4, =gSpecialVar_ItemId ldrh r0, [r4] bl ItemId_GetPocket lsls r0, 24 @@ -4315,7 +4315,7 @@ sub_81C62C4: @ 81C62C4 b _081C6334 .pool _081C62F4: - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -4362,7 +4362,7 @@ sub_81C6350: @ 81C6350 lsls r4, 3 ldr r0, =gTasks + 0x8 adds r4, r0 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -4577,7 +4577,7 @@ sub_81C654C: @ 81C654C lsls r4, 3 ldr r5, =gTasks + 0x8 adds r6, r4, r5 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -4635,7 +4635,7 @@ sub_81C65CC: @ 81C65CC beq _081C662E movs r0, 0x5 bl PlaySE - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] ldrh r1, [r4, 0x10] bl RemovePyramidBagItem @@ -4671,7 +4671,7 @@ sub_81C6648: @ 81C6648 lsrs r4, r0, 24 adds r6, r4, 0 bl sub_81C61A8 - ldr r5, =gScriptItemId + ldr r5, =gSpecialVar_ItemId ldrh r0, [r5] bl itemid_is_mail lsls r0, 24 @@ -4713,7 +4713,7 @@ sub_81C66AC: @ 81C66AC adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -4785,7 +4785,7 @@ sub_81C674C: @ 81C674C lsls r0, 24 lsrs r4, r0, 24 adds r6, r4, 0 - ldr r5, =gScriptItemId + ldr r5, =gSpecialVar_ItemId ldrh r0, [r5] bl itemid_80BF6D8_mail_related lsls r0, 24 @@ -4820,7 +4820,7 @@ sub_81C679C: @ 81C679C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gScriptItemId + ldr r4, =gSpecialVar_ItemId ldrh r0, [r4] bl ItemId_GetBattleFunc cmp r0, 0 @@ -5238,7 +5238,7 @@ _081C6AF8: bl Free adds r0, r5, 0 bl Free - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result movs r0, 0 strh r0, [r1] adds r0, r7, 0 diff --git a/asm/pokenav.s b/asm/pokenav.s index ba6d4fca0..c6e058955 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_Facing 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_Result 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_Result 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_Result strh r4, [r0] b _081D59C0 .pool _081D59BC: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result 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_Result 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_Result strh r5, [r0] b _081D5A4E .pool _081D5A48: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result 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_Result movs r0, 0x1 b _081D5B20 .pool _081D5B1C: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result movs r0, 0 b _081D5BF0 .pool _081D5BEC: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result 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_Result strh r1, [r0] b _081D5C7A .pool _081D5C74: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x1 strh r0, [r1] _081D5C7A: @@ -30022,7 +30022,7 @@ _081D5E64: movs r1, 0xF ands r0, r1 strh r0, [r5, 0xE] - ldr r0, =gUnknown_082C83F0 + ldr r0, =EventScript_2C83F0 str r0, [r5, 0x10] ldr r0, =gSaveBlock2Ptr ldr r0, [r0] @@ -30487,7 +30487,7 @@ _081D62A2: thumb_func_start sub_81D62AC sub_81D62AC: @ 81D62AC - ldr r0, =gUnknown_082C83F0 + ldr r0, =EventScript_2C83F0 bx lr .pool thumb_func_end sub_81D62AC @@ -30495,7 +30495,7 @@ sub_81D62AC: @ 81D62AC thumb_func_start sub_81D62B4 sub_81D62B4: @ 81D62B4 push {lr} - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_LastTalked 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_Result 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_Result 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_Result movs r0, 0 b _081D6594 .pool _081D6590: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x1 _081D6594: strh r0, [r1] diff --git a/asm/recorded_battle.s b/asm/recorded_battle.s index 55cfdf6ef..2545e478d 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_Result ldr r1, =gBattleOutcome movs r0, 0x5 strb r0, [r1] diff --git a/asm/rom4.s b/asm/rom4.s index bf682fc51..3b6f87d84 100644 --- a/asm/rom4.s +++ b/asm/rom4.s @@ -8,7 +8,7 @@ thumb_func_start sub_8084620 sub_8084620: @ 8084620 push {r4,lr} - ldr r0, =gUnknown_08271857 + ldr r0, =EverGrandeCity_HallOfFame_EventScript_271857 bl ScriptContext2_RunNewScript ldr r0, =gSaveBlock1Ptr ldr r4, [r0] @@ -64,7 +64,7 @@ sub_808469C: @ 808469C bl FlagClear ldr r0, =0x00000888 bl FlagClear - ldr r0, =gUnknown_08271862 + ldr r0, =EverGrandeCity_HallOfFame_EventScript_271862 bl ScriptContext2_RunNewScript pop {r0} bx r0 @@ -419,7 +419,7 @@ get_mapdata_header: @ 80849A8 b _080849C6 .pool _080849BC: - ldr r0, =gUnknown_08481DD4 + ldr r0, =gMapAttributes subs r1, 0x1 lsls r1, 2 adds r1, r0 @@ -535,7 +535,7 @@ _08084A8A: get_mapheader_by_bank_and_number: @ 8084A90 lsls r0, 16 lsls r1, 16 - ldr r2, =gUnknown_08486578 + ldr r2, =gMapGroups lsrs r0, 14 adds r0, r2 ldr r0, [r0] diff --git a/asm/rom6.s b/asm/rom6.s index d5924da3f..15c7acb95 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_LastTalked 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_Result bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 @@ -307,7 +307,7 @@ sub_81356C4: @ 81356C4 lsls r0, 24 lsrs r0, 24 str r0, [r1] - ldr r0, =gUnknown_082907F0 + ldr r0, =Route111_EventScript_2907F0 bl ScriptContext1_SetupScript pop {r0} bx r0 @@ -2136,11 +2136,11 @@ _081366B6: _081366D0: movs r0, 0x5 bl PlaySE - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result ldr r2, =0x0000ffff adds r1, r2, 0 strh r1, [r0] - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId mov r1, r9 strh r1, [r0] adds r0, r7, 0 @@ -2150,7 +2150,7 @@ _081366D0: _081366F8: movs r0, 0x5 bl PlaySE - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId strh r4, [r0] adds r0, r7, 0 bl sub_8136938 @@ -2541,7 +2541,7 @@ sub_8136A50: @ 8136A50 sub_8136A74: @ 8136A74 push {lr} ldr r2, =gSaveBlock1Ptr - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrh r1, [r0] lsls r1, 3 ldr r0, =0x00000848 @@ -2586,7 +2586,7 @@ sub_8136AB4: @ 8136AB4 ldr r3, =gPokeblockNames ldr r1, =gSaveBlock1Ptr ldr r2, [r1] - ldr r1, =gScriptItemId + ldr r1, =gSpecialVar_ItemId ldrh r1, [r1] lsls r1, 3 adds r2, r1 @@ -2689,7 +2689,7 @@ sub_8136BC0: @ 8136BC0 ands r0, r1 cmp r0, 0 beq _08136C36 - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrb r0, [r0] bl sub_8136F68 movs r0, 0x5 @@ -2772,7 +2772,7 @@ sub_8136C8C: @ 8136C8C lsls r0, 24 lsrs r0, 24 ldr r5, =gSaveBlock1Ptr - ldr r7, =gScriptItemId + ldr r7, =gSpecialVar_ItemId ldrh r2, [r7] lsls r2, 3 ldr r6, =0x00000848 @@ -2836,7 +2836,7 @@ sub_8136D2C: @ 8136D2C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r5, =gScriptItemId + ldr r5, =gSpecialVar_ItemId ldrb r0, [r5] bl SafariZoneActivatePokeblockFeeder ldr r0, =gStringVar1 @@ -2853,7 +2853,7 @@ sub_8136D2C: @ 8136D2C adds r1, r3 ldr r1, [r1] bl StringCopy - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result ldrh r0, [r5] strh r0, [r1] lsls r0, 24 @@ -2877,7 +2877,7 @@ sub_8136D90: @ 8136D90 lsrs r4, 24 ldr r6, =gSpecialVar_0x8004 ldr r0, =gSaveBlock1Ptr - ldr r5, =gScriptItemId + ldr r5, =gSpecialVar_ItemId ldrh r1, [r5] lsls r1, 3 ldr r2, =0x00000848 @@ -2888,7 +2888,7 @@ sub_8136D90: @ 8136D90 lsls r0, 24 lsrs r0, 24 strh r0, [r6] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 @@ -3407,7 +3407,7 @@ sub_81371B4: @ 81371B4 bl PlaySE ldr r0, =0x00000888 bl FlagSet - ldr r0, =gUnknown_082926F8 + ldr r0, =EventScript_2926F8 bl ScriptContext1_SetupScript pop {r0} bx r0 @@ -4899,7 +4899,7 @@ _08137E58: lsls r0, 24 lsrs r4, r0, 24 _08137E5C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result movs r0, 0x7F strh r0, [r1] movs r0, 0x5 @@ -9657,7 +9657,7 @@ _0813A51C: b _0813A54C .pool _0813A530: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result 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_Result movs r0, 0x3 b _0813B6AC .pool _0813B6A8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result 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_Result ldr r0, =gBlockRecvBuffer ldrh r0, [r0] strh r0, [r1] @@ -11773,20 +11773,20 @@ _0813B728: lsls r0, 24 cmp r0, 0 bne _0813B74C - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result ldrh r0, [r0] cmp r0, 0x2 bne _0813B790 - ldr r0, =gUnknown_0824979B + ldr r0, =gText_YourPartnerHasRetired bl ShowFieldAutoScrollMessage b _0813B790 .pool _0813B74C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result ldrh r0, [r0] cmp r0, 0x3 bne _0813B790 - ldr r0, =gUnknown_0824979B + ldr r0, =gText_YourPartnerHasRetired bl ShowFieldAutoScrollMessage b _0813B790 .pool @@ -12041,7 +12041,7 @@ _0813B94E: thumb_func_start sub_813B968 sub_813B968: @ 813B968 push {r4,r5,lr} - ldr r5, =gScriptResult + ldr r5, =gSpecialVar_Result ldr r0, =gSpecialVar_0x8004 ldrh r0, [r0] movs r1, 0x7 diff --git a/asm/script_menu.s b/asm/script_menu.s index 55ce5736a..be7cbfbc7 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_Result 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_Result 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_Result movs r0, 0x7F strh r0, [r1] b _080E20EC .pool _080E20E8: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result 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_Result 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_Result 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_Result movs r0, 0 b _080E21B8 .pool _080E21B4: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x1 _080E21B8: strh r0, [r1] @@ -517,7 +517,7 @@ ScriptMenu_MultichoiceGrid: @ 80E21D0 b _080E22E8 .pool _080E2210: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result 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_Result movs r0, 0x7F strh r0, [r1] b _080E2350 .pool _080E234C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result 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_Result 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_Result 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_Result 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_Result 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..0e002d19a 100644 --- a/asm/script_pokemon_util_80F87D8.s +++ b/asm/script_pokemon_util_80F87D8.s @@ -83,7 +83,7 @@ sub_80F8850: @ 80F8850 thumb_func_start sub_80F8864 sub_80F8864: @ 80F8864 push {lr} - ldr r0, =gScriptContestCategory + ldr r0, =gSpecialVar_ContestCategory ldrh r0, [r0] cmp r0, 0x4 bhi _080F88A4 @@ -157,7 +157,7 @@ sub_80F88E8: @ 80F88E8 ldrb r0, [r0] cmp r0, 0 bne _080F8930 - ldr r0, =gUnknown_02039F2E + ldr r0, =gSpecialVar_ContestRank ldrh r0, [r0] cmp r0, 0x3 bne _080F8930 @@ -601,7 +601,7 @@ sub_80F8C7C: @ 80F8C7C ldrb r0, [r0] cmp r0, 0 bne _080F8D18 - ldr r0, =gUnknown_02039F2E + ldr r0, =gSpecialVar_ContestRank ldrh r0, [r0] cmp r0, 0x3 bne _080F8D18 @@ -952,7 +952,7 @@ sub_80F8FA0: @ 80F8FA0 ands r0, r1 cmp r0, 0 bne _080F8FD8 - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_Result 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_Result 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_Result b _080F902A .pool _080F9020: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_Result 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_Result 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_Result strh r1, [r0] b _080F947E .pool _080F9478: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result 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_Result strh r1, [r0] b _080F94D6 .pool _080F94D0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0x1 strh r0, [r1] _080F94D6: diff --git a/asm/start_menu.s b/asm/start_menu.s index e5e91bac8..634425f80 100644 --- a/asm/start_menu.s +++ b/asm/start_menu.s @@ -868,7 +868,7 @@ _0809FF00: bl sub_8197DF8 bl sub_80984F4 bl ScriptContext2_Disable - ldr r0, =gUnknown_08252C88 + ldr r0, =BattleFrontier_BattlePyramidEmptySquare_EventScript_252C88 bl ScriptContext1_SetupScript movs r0, 0x1 b _0809FF22 @@ -974,13 +974,13 @@ task50_save_game: @ 809FFD0 _0809FFEC: cmp r1, 0x3 bgt _080A0000 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0 strh r0, [r1] b _080A0000 .pool _0809FFFC: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_Result strh r1, [r0] _080A0000: adds r0, r4, 0 @@ -1089,7 +1089,7 @@ sub_80A00A0: @ 80A00A0 lsls r0, 24 cmp r0, 0 beq _080A00D4 - ldr r0, =gUnknown_08252CA7 + ldr r0, =BattleFrontier_BattlePyramidEmptySquare_Text_252CA7 ldr r1, =sub_80A00EC bl sub_809FF98 b _080A00DC @@ -1415,7 +1415,7 @@ sub_80A035C: @ 80A035C movs r1, 0 bl sub_819746C bl remove_start_menu_window_maybe - ldr r0, =gUnknown_08252CFB + ldr r0, =BattleFrontier_BattlePyramidEmptySquare_Text_252CFB ldr r1, =sub_80A0388 bl sub_809FF98 movs r0, 0 diff --git a/asm/trader.s b/asm/trader.s index 8e0b17905..a43f59402 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_Result 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_Result _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_Result 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_Result movs r0, 0 strh r0, [r6] ldr r4, =gDecorations diff --git a/asm/trainer_see.s b/asm/trainer_see.s index 59dd9f74b..ad6cc370e 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_Result 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_Result movs r0, 0 strh r0, [r1] _080B4616: diff --git a/asm/use_pokeblock.s b/asm/use_pokeblock.s index 20d23a878..3a8b76ab1 100755 --- a/asm/use_pokeblock.s +++ b/asm/use_pokeblock.s @@ -1016,7 +1016,7 @@ _08166BB6: lsls r0, 24 cmp r0, 0 bne _08166BDA - ldr r0, =gScriptItemId + ldr r0, =gSpecialVar_ItemId ldrb r0, [r0] bl sub_8136F68 ldr r0, =sub_8166BEC diff --git a/asm/wild_encounter.s b/asm/wild_encounter.s index 9b6c901f6..70346e4d7 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_Result strh r4, [r0] b _080B556E .pool _080B5568: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_Result movs r0, 0 strh r0, [r1] _080B556E: @@ -2026,7 +2026,7 @@ sub_80B5870: @ 80B5870 bl VarSet cmp r4, 0 bne _080B58C4 - ldr r0, =gUnknown_082A4B2A + ldr r0, =EventScript_RepelWoreOff bl ScriptContext1_SetupScript movs r0, 0x1 b _080B58C6 |