diff --git a/asm/battle_frontier_1.s b/asm/battle_frontier_1.s index 7ac60f1be..6d80cdec4 100755 --- a/asm/battle_frontier_1.s +++ b/asm/battle_frontier_1.s @@ -136,7 +136,7 @@ _0818EAC8: .4byte _0818ECD0 .4byte _0818ECF4 _0818EAF0: - ldr r3, =gScriptResult + ldr r3, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r5, 1 @@ -150,7 +150,7 @@ _0818EAF0: b _0818ED10 .pool _0818EB14: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r3, =0x00000cdc @@ -170,7 +170,7 @@ _0818EB14: b _0818ED10 .pool _0818EB48: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -180,7 +180,7 @@ _0818EB48: b _0818ECBE .pool _0818EB64: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 @@ -190,7 +190,7 @@ _0818EB64: b _0818ECBE .pool _0818EB80: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -198,7 +198,7 @@ _0818EB80: b _0818ECBA .pool _0818EB98: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 @@ -216,7 +216,7 @@ _0818EBB4: bne _0818EC04 cmp r5, 0 beq _0818EBE8 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -226,7 +226,7 @@ _0818EBB4: b _0818ECBE .pool _0818EBE8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 @@ -238,7 +238,7 @@ _0818EBE8: _0818EC04: cmp r5, 0 beq _0818EC24 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -248,7 +248,7 @@ _0818EC04: b _0818ECBE .pool _0818EC24: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 @@ -266,7 +266,7 @@ _0818EC40: bne _0818EC90 cmp r5, 0 beq _0818EC74 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -277,7 +277,7 @@ _0818EC40: b _0818ED10 .pool _0818EC74: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 @@ -289,7 +289,7 @@ _0818EC74: _0818EC90: cmp r5, 0 beq _0818ECB0 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 @@ -299,7 +299,7 @@ _0818EC90: b _0818ECBE .pool _0818ECB0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 @@ -328,7 +328,7 @@ _0818ECD0: b _0818ED10 .pool _0818ECF4: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r3, =0x00000d0a @@ -11707,12 +11707,12 @@ sub_8194EC0: @ 8194EC0 bl sub_8195358 cmp r4, r0 ble _08194EE8 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _08194EEC .pool _08194EE8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 _08194EEC: strh r0, [r1] @@ -13130,7 +13130,7 @@ _08195A74: beq _08195AB0 b _08195AD0 _08195A7A: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r1, [r5] ldr r2, =0x00000dc6 adds r1, r2 @@ -13139,7 +13139,7 @@ _08195A7A: b _08195AD0 .pool _08195A90: - ldr r3, =gScriptResult + ldr r3, =gSpecialVar_ScriptResult ldr r0, [r5] lsls r1, r7, 1 lsls r2, r6, 2 @@ -13152,7 +13152,7 @@ _08195A90: b _08195AD0 .pool _08195AB0: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult ldr r2, [r5] ldr r0, =0x00000cdc adds r2, r0 @@ -13285,7 +13285,7 @@ sub_8195BB0: @ 8195BB0 ldrh r0, [r2] cmp r0, 0x31 bhi _08195C00 - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl Random lsls r0, 16 lsrs r0, 16 @@ -13297,12 +13297,12 @@ sub_8195BB0: @ 8195BB0 _08195C00: cmp r0, 0x62 bhi _08195C10 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x3 b _08195C14 .pool _08195C10: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x4 _08195C14: strh r0, [r1] @@ -13517,12 +13517,12 @@ sub_8195DB8: @ 8195DB8 adds r0, r1 movs r1, 0 strh r1, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _08195E06 .pool _08195E00: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _08195E06: diff --git a/asm/battle_frontier_2.s b/asm/battle_frontier_2.s index 37ddc7ac6..999fc56cb 100755 --- a/asm/battle_frontier_2.s +++ b/asm/battle_frontier_2.s @@ -4361,14 +4361,14 @@ _0819CA4E: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _0819CAFE .pool _0819CA68: movs r0, 0x2 strh r0, [r4, 0x8] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] b _0819CAFE @@ -11730,13 +11730,13 @@ _081A0734: bne _081A0778 movs r0, 0x5 bl PlaySE - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x7F strh r0, [r1] b _081A0768 .pool _081A0764: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _081A0768: ldrb r0, [r4, 0xC] @@ -11982,12 +11982,12 @@ sub_81A093C: @ 81A093C lsrs r1, r0, 24 cmp r1, 0 bne _081A0954 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _081A095A .pool _081A0954: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _081A095A: @@ -12046,7 +12046,7 @@ sub_81A0990: @ 81A0990 thumb_func_start sub_81A09B4 sub_81A09B4: @ 81A09B4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB1 @@ -12070,13 +12070,13 @@ sub_81A09D0: @ 81A09D0 subs r1, r0, 0x3 cmp r1, 0 bge _081A09F4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] b _081A0A1C .pool _081A09F4: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult cmp r1, 0x8 ble _081A09FE movs r0, 0x1 @@ -12403,7 +12403,7 @@ sub_81A0CC0: @ 81A0CC0 lsrs r0, r1, 28 cmp r0, 0x2 bhi _081A0CE4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 b _081A0D34 .pool @@ -12431,22 +12431,22 @@ _081A0D08: beq _081A0D24 b _081A0D30 _081A0D0E: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x4 b _081A0D34 .pool _081A0D18: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x3 b _081A0D34 .pool _081A0D24: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _081A0D34 .pool _081A0D30: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x5 _081A0D34: strh r0, [r1] @@ -13078,7 +13078,7 @@ _081A1242: lsls r0, 30 ldr r1, =gSpecialVar_0x8005 mov r12, r1 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult mov r8, r1 cmp r0, 0 beq _081A127C @@ -13855,7 +13855,7 @@ _081A186C: .4byte _081A1918 .4byte _081A1938 _081A188C: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca8 @@ -13865,7 +13865,7 @@ _081A188C: b _081A1956 .pool _081A18A8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca9 @@ -13877,7 +13877,7 @@ _081A18A8: b _081A1956 .pool _081A18C8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000cb2 @@ -13887,7 +13887,7 @@ _081A18C8: b _081A1956 .pool _081A18E4: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca9 @@ -13897,7 +13897,7 @@ _081A18E4: b _081A1926 .pool _081A1900: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, =gBattleOutcome ldrb r0, [r1] strh r0, [r2] @@ -13906,7 +13906,7 @@ _081A1900: b _081A1956 .pool _081A1918: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca9 @@ -13919,7 +13919,7 @@ _081A1926: b _081A1956 .pool _081A1938: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r2, [r0] movs r0, 0xD0 @@ -17183,7 +17183,7 @@ sub_81A35EC: @ 81A35EC push {r4,lr} ldr r0, =0x000040cf bl VarGet - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl sub_81A3610 lsls r0, 24 lsrs r0, 24 @@ -17755,12 +17755,12 @@ sub_81A3B00: @ 81A3B00 ldr r0, =0x000003fe cmp r1, r0 bne _081A3B20 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _081A3B24 .pool _081A3B20: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 _081A3B24: strh r0, [r1] @@ -17988,7 +17988,7 @@ sub_81A3D30: @ 81A3D30 push {r4,lr} ldr r0, =0x000040cf bl VarGet - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult lsls r0, 24 lsrs r0, 24 bl sub_81A3B30 @@ -18044,13 +18044,13 @@ sub_81A3DA0: @ 81A3DA0 ands r2, r1 cmp r2, 0 beq _081A3DC4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] b _081A3DC8 .pool _081A3DC4: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r2, [r0] _081A3DC8: pop {r0} @@ -18390,7 +18390,7 @@ _081A404E: bne _081A40C8 cmp r7, 0 bne _081A40E4 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrb r3, [r0] str r6, [sp] add r1, sp, 0x10 @@ -18406,7 +18406,7 @@ _081A404E: b _081A40E4 .pool _081A40C8: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrb r3, [r0] str r6, [sp] add r1, sp, 0x10 @@ -18529,7 +18529,7 @@ _081A41E0: strh r0, [r1] ldr r0, =gSaveBlock2Ptr ldr r2, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrb r0, [r0] ldr r1, =0x00000ca9 adds r2, r1 @@ -18767,7 +18767,7 @@ _081A43EE: thumb_func_start sub_81A4410 sub_81A4410: @ 81A4410 push {r4,lr} - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl MoveRecordedBattleToSaveData strh r0, [r4] ldr r0, =gSaveBlock2Ptr @@ -21309,7 +21309,7 @@ _081A5994: beq _081A59C8 b _081A59EE _081A599A: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r2, =0x00000dd8 adds r1, r3, r2 ldrh r1, [r1] @@ -21317,7 +21317,7 @@ _081A599A: b _081A59EE .pool _081A59B0: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult lsls r1, 1 ldr r4, =0x00000dda adds r0, r3, r4 @@ -21328,7 +21328,7 @@ _081A59B0: _081A59C8: cmp r1, 0 beq _081A59E0 - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, =0x00000cdc adds r0, r3, r1 ldr r0, [r0] @@ -21336,7 +21336,7 @@ _081A59C8: b _081A59EA .pool _081A59E0: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r4, =0x00000cdc adds r0, r3, r4 ldr r0, [r0] @@ -21550,12 +21550,12 @@ sub_81A5B88: @ 81A5B88 adds r0, r1 movs r1, 0 strh r1, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _081A5BD6 .pool _081A5BD0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _081A5BD6: @@ -22026,7 +22026,7 @@ _081A5FE4: beq _081A6030 b _081A6044 _081A5FEA: - ldr r3, =gScriptResult + ldr r3, =gSpecialVar_ScriptResult ldr r0, [r7] lsls r1, r6, 1 lsls r2, r5, 2 @@ -22035,7 +22035,7 @@ _081A5FEA: b _081A603C .pool _081A6000: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult ldr r2, [r7] ldr r0, =0x00000cdc adds r2, r0 @@ -22054,7 +22054,7 @@ _081A6000: b _081A6044 .pool _081A6030: - ldr r3, =gScriptResult + ldr r3, =gSpecialVar_ScriptResult ldr r0, [r7] lsls r1, r6, 1 lsls r2, r5, 2 @@ -23248,7 +23248,7 @@ sub_81A6A08: @ 81A6A08 str r0, [r1] movs r4, 0 add r5, sp, 0x14 - ldr r7, =gScriptResult + ldr r7, =gSpecialVar_ScriptResult movs r1, 0 _081A6A1E: mov r2, sp @@ -23407,7 +23407,7 @@ _081A6B18: lsrs r4, r0, 24 cmp r4, 0x2 bls _081A6B0E - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] movs r4, 0x1 @@ -24180,7 +24180,7 @@ _081A7174: .4byte _081A71E8 .4byte _081A720C _081A7188: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r1, [r3] ldr r3, =0x00000e02 adds r1, r3 @@ -24189,7 +24189,7 @@ _081A7188: b _081A723A .pool _081A71A0: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, [r3] ldr r3, =0x00000ca9 adds r0, r1, r3 @@ -24203,7 +24203,7 @@ _081A71A0: b _081A7238 .pool _081A71C4: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, [r3] ldr r3, =0x00000ca9 adds r0, r1, r3 @@ -24217,7 +24217,7 @@ _081A71C4: b _081A7238 .pool _081A71E8: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, [r3] ldr r3, =0x00000ca9 adds r0, r1, r3 @@ -24233,7 +24233,7 @@ _081A71E8: _081A720C: cmp r2, 0 beq _081A7228 - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, [r3] ldr r1, =0x00000cdc adds r0, r1 @@ -24243,7 +24243,7 @@ _081A720C: b _081A7236 .pool _081A7228: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, [r3] ldr r3, =0x00000cdc adds r0, r3 @@ -24424,12 +24424,12 @@ sub_81A73B8: @ 81A73B8 ldrh r0, [r0] cmp r0, 0xE bls _081A73DC - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _081A73E0 .pool _081A73DC: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 _081A73E0: strh r0, [r1] @@ -24440,7 +24440,7 @@ _081A73E0: thumb_func_start sub_81A73EC sub_81A73EC: @ 81A73EC - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r1, =gUnknown_0300128C ldrb r1, [r1] strh r1, [r0] @@ -24528,27 +24528,27 @@ _081A7484: beq _081A74A4 b _081A74C2 _081A748E: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 b _081A74C0 .pool _081A7498: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _081A74C0 .pool _081A74A4: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 b _081A74C0 .pool _081A74B0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x3 b _081A74C0 .pool _081A74BC: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x4 _081A74C0: strh r0, [r1] @@ -24560,7 +24560,7 @@ _081A74C2: thumb_func_start sub_81A74CC sub_81A74CC: @ 81A74CC - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r1, =gUnknown_0300128D ldrb r1, [r1] strh r1, [r0] @@ -24580,7 +24580,7 @@ sub_81A74E0: @ 81A74E0 adds r4, 0x1 adds r0, r4, 0 bl sub_81A7F38 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r4, [r0] pop {r4} pop {r0} @@ -26066,7 +26066,7 @@ _081A807A: thumb_func_start sub_81A8090 sub_81A8090: @ 81A8090 push {r4,lr} - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl InBattlePike lsls r0, 24 lsrs r0, 24 @@ -26110,7 +26110,7 @@ sub_81A80DC: @ 81A80DC push {r4-r7,lr} mov r7, r8 push {r7} - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r4] movs r0, 0x1 @@ -26295,7 +26295,7 @@ _081A824C: thumb_func_start sub_81A825C sub_81A825C: @ 81A825C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r2, 0xE1 @@ -26311,7 +26311,7 @@ sub_81A825C: @ 81A825C thumb_func_start sub_81A827C sub_81A827C: @ 81A827C - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, =gUnknown_0861266C ldr r0, =gSaveBlock2Ptr ldr r0, [r0] @@ -26754,7 +26754,7 @@ _081A8634: thumb_func_start sub_81A863C sub_81A863C: @ 81A863C push {r4,lr} - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult movs r0, 0 bl sub_81A8590 lsls r0, 24 @@ -26787,7 +26787,7 @@ sub_81A8658: @ 81A8658 ldrb r4, [r0] adds r0, r4, 0 bl sub_81A7F38 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r4, [r0] pop {r4} pop {r0} @@ -26821,7 +26821,7 @@ sub_81A86C0: @ 81A86C0 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] movs r0, 0 @@ -26895,7 +26895,7 @@ _081A8766: mov r0, r9 cmp r0, 0x1 bne _081A8778 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] b _081A8786 @@ -27919,13 +27919,13 @@ _081A8F70: .4byte _081A9010 .4byte _081A9028 _081A8F8C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r1, [r3] ldr r3, =0x00000e18 b _081A8FFE .pool _081A8F9C: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, [r3] lsls r1, r4, 1 ldr r3, =0x00000e1a @@ -27937,14 +27937,14 @@ _081A8F9C: _081A8FB4: cmp r4, 0 beq _081A8FCC - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, [r3] ldr r1, =0x00000cdc adds r0, r1 b _081A9030 .pool _081A8FCC: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, [r3] ldr r3, =0x00000cdc adds r0, r3 @@ -27954,14 +27954,14 @@ _081A8FCC: b _081A9036 .pool _081A8FE4: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r1, [r3] ldr r2, =0x00000e1a adds r1, r2 b _081A9000 .pool _081A8FF8: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r1, [r3] ldr r3, =0x00000e1c _081A8FFE: @@ -27972,7 +27972,7 @@ _081A9000: b _081A903A .pool _081A9010: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, [r3] ldr r1, =0x00000cdc adds r0, r1 @@ -27982,7 +27982,7 @@ _081A9010: b _081A9036 .pool _081A9028: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, [r3] ldr r3, =0x00000cdc adds r0, r3 @@ -28211,12 +28211,12 @@ sub_81A91FC: @ 81A91FC adds r0, r1 movs r1, 0 strh r1, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _081A924A .pool _081A9244: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _081A924A: @@ -28296,7 +28296,7 @@ CalculateBattlePyramidItemBallItemId: @ 81A9290 _081A92DE: bl sub_81AA9E4 lsls r0, 24 - ldr r1, =gScriptLastTalked + ldr r1, =gSpecialVar_ScriptLastTalked ldrh r4, [r1] ldr r1, =gUnknown_08613650 lsrs r0, 20 @@ -28401,7 +28401,7 @@ sub_81A93C8: @ 81A93C8 lsls r1, 4 adds r3, r0, r1 movs r2, 0 - ldr r4, =gScriptLastTalked + ldr r4, =gSpecialVar_ScriptLastTalked b _081A93F4 .pool _081A93E4: @@ -28712,7 +28712,7 @@ _081A9650: thumb_func_start sub_81A966C sub_81A966C: @ 81A966C push {r4,lr} - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl InBattlePyramid lsls r0, 24 lsrs r0, 24 @@ -28745,7 +28745,7 @@ _081A9698: b _081A9754 .pool _081A96B4: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult ldrh r0, [r4] cmp r0, 0x1 beq _081A9710 @@ -28775,7 +28775,7 @@ _081A96F4: ldrh r0, [r0] bl PlaySE _081A96FC: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @@ -29352,7 +29352,7 @@ _081A9B86: strb r3, [r0, 0x6] mov r7, r10 ldr r2, [r7] - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrh r1, [r0] subs r1, 0x1 lsls r0, r1, 1 diff --git a/asm/battle_setup.s b/asm/battle_setup.s index 5c7196579..a6075da3f 100644 --- a/asm/battle_setup.s +++ b/asm/battle_setup.s @@ -1344,7 +1344,7 @@ sub_80B1158: @ 80B1158 sub sp, 0x8 ldr r0, =0x00004023 bl GetVarPointer - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldrh r1, [r2] strh r1, [r0] ldrh r0, [r2] @@ -1669,7 +1669,7 @@ battle_80801F0: @ 80B13F8 ldrh r1, [r0] cmp r1, 0 beq _080B141A - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked strh r1, [r0] lsls r0, r1, 24 lsrs r0, 24 @@ -1793,7 +1793,7 @@ _080B153C: adds r1, r5, 0 bl TrainerBattleLoadArgs bl battle_80801F0 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrb r0, [r0] bl sub_81A9AA8 ldr r1, =gTrainerBattleOpponent_A @@ -1803,7 +1803,7 @@ _080B156C: ldr r0, =gUnknown_08550014 adds r1, r5, 0 bl TrainerBattleLoadArgs - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrb r0, [r0] bl sub_81A9AA8 _080B157C: @@ -1833,7 +1833,7 @@ _080B15A8: adds r1, r5, 0 bl TrainerBattleLoadArgs bl battle_80801F0 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrb r0, [r0] bl battle_init ldr r1, =gTrainerBattleOpponent_A @@ -1843,7 +1843,7 @@ _080B15D8: ldr r0, =gUnknown_08550014 adds r1, r5, 0 bl TrainerBattleLoadArgs - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrb r0, [r0] bl battle_init b _080B157C @@ -1882,7 +1882,7 @@ SingleTrainerWantsBattle: @ 80B162C lsrs r0, 24 ldr r2, =gSelectedMapObject strb r0, [r2] - ldr r4, =gScriptLastTalked + ldr r4, =gSpecialVar_ScriptLastTalked ldr r3, =gMapObjects lsls r2, r0, 3 adds r2, r0 @@ -1910,7 +1910,7 @@ TwoTrainersWantBattle: @ 80B1670 lsrs r0, 24 ldr r2, =gSelectedMapObject strb r0, [r2] - ldr r4, =gScriptLastTalked + ldr r4, =gSpecialVar_ScriptLastTalked ldr r3, =gMapObjects lsls r2, r0, 3 adds r2, r0 @@ -2332,7 +2332,7 @@ sub_80B1A14: @ 80B1A14 ldrb r0, [r0] cmp r0, 0x1 bhi _080B1A44 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrb r0, [r0] bl sub_81A9AA8 lsls r0, 16 @@ -2370,7 +2370,7 @@ _080B1A7C: ldrb r0, [r0] cmp r0, 0x1 bhi _080B1AAC - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrb r0, [r0] bl battle_init adds r1, r0, 0 @@ -3484,7 +3484,7 @@ CheckIfMultipleTrainersWantBattle: @ 80B22D8 ldr r1, =gUnknown_02038BF8 movs r0, 0x1 strb r0, [r1] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _080B230A .pool @@ -3492,7 +3492,7 @@ _080B2300: ldr r1, =gUnknown_02038BF8 movs r0, 0 strb r0, [r1] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 _080B230A: strh r0, [r1] diff --git a/asm/battle_tent.s b/asm/battle_tent.s index 5cb92dbed..1fa985d1b 100755 --- a/asm/battle_tent.s +++ b/asm/battle_tent.s @@ -57,7 +57,7 @@ sub_81B99D4: @ 81B99D4 thumb_func_start sub_81B9A28 sub_81B9A28: @ 81B9A28 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000e6a @@ -196,12 +196,12 @@ sub_81B9B28: @ 81B9B28 adds r0, r1 movs r1, 0 strh r1, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _081B9B76 .pool _081B9B70: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _081B9B76: @@ -263,7 +263,7 @@ sub_81B9BA0: @ 81B9BA0 thumb_func_start sub_81B9BF4 sub_81B9BF4: @ 81B9BF4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000e6c @@ -357,12 +357,12 @@ sub_81B9C98: @ 81B9C98 adds r0, r1 movs r1, 0 strh r1, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _081B9CE6 .pool _081B9CE0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _081B9CE6: @@ -436,7 +436,7 @@ sub_81B9D28: @ 81B9D28 thumb_func_start sub_81B9D7C sub_81B9D7C: @ 81B9D7C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000e6e @@ -530,12 +530,12 @@ sub_81B9E20: @ 81B9E20 adds r0, r1 movs r1, 0 strh r1, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _081B9E6E .pool _081B9E68: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _081B9E6E: diff --git a/asm/battle_tower.s b/asm/battle_tower.s index 74c84e34c..e21f9b5be 100755 --- a/asm/battle_tower.s +++ b/asm/battle_tower.s @@ -132,12 +132,12 @@ _08162094: lsls r1, 24 lsrs r1, 24 bl sub_8164FCC - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult strh r0, [r1] b _081620E8 .pool _081620A8: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult ldr r2, [r5] ldr r0, =0x00000cdc adds r2, r0 @@ -294,7 +294,7 @@ _081621EE: adds r0, 0x1 strh r0, [r1] bl sub_8163E90 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, [r5] adds r0, r4 ldrh r0, [r0] @@ -4714,7 +4714,7 @@ sub_8164828: @ 8164828 lsls r0, 16 lsrs r0, 16 mov r8, r0 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrh r0, [r0] subs r5, r0, 0x2 ldr r0, =gSaveBlock2Ptr @@ -5076,7 +5076,7 @@ sub_8164B74: @ 8164B74 adds r0, r2 ldrh r6, [r0] bl GetMultiplayerId - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x6 bls _08164BAC @@ -5126,7 +5126,7 @@ _08164C18: mov r1, sp movs r2, 0x4 bl SendBlock - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _08164DB4 .pool @@ -5204,7 +5204,7 @@ _08164CB0: mov r4, r8 cmp r4, 0xD ble _08164C68 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 b _08164DB4 .pool @@ -5222,7 +5222,7 @@ _08164CE0: adds r1, r3 movs r2, 0x28 bl SendBlock - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x3 b _08164DB4 .pool @@ -5268,13 +5268,13 @@ _08164D14: ldrb r0, [r0] cmp r0, 0 bne _08164DB0 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x4 b _08164DB4 .pool _08164D98: bl sub_800AC34 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x5 b _08164DB4 .pool @@ -5284,7 +5284,7 @@ _08164DA8: cmp r0, 0 bne _08164DB6 _08164DB0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x6 _08164DB4: strh r0, [r1] @@ -5625,7 +5625,7 @@ sub_816502C: @ 816502C movs r0, 0x45 mov r10, r0 _0816506A: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult mov r9, r1 movs r0, 0 strh r0, [r1] @@ -5681,7 +5681,7 @@ _081650D4: cmp r6, r8 blt _0816508C _081650DC: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0 beq _08165132 @@ -5901,7 +5901,7 @@ _08165294: thumb_func_start sub_81652B4 sub_81652B4: @ 81652B4 push {r4-r6,lr} - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r2] ldr r1, =gSaveBlock2Ptr @@ -5943,7 +5943,7 @@ _081652F2: ldr r3, =0x00000bec adds r0, r1, r3 bl sub_816534C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _08165316: diff --git a/asm/cable_club.s b/asm/cable_club.s index 15ba76e9c..0fd919872 100644 --- a/asm/cable_club.s +++ b/asm/cable_club.s @@ -663,7 +663,7 @@ sub_80B28A8: @ 80B28A8 b _080B2908 .pool _080B28F4: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult adds r0, r7, 0 adds r1, r6, 0 bl sub_80B2478 @@ -703,7 +703,7 @@ sub_80B2918: @ 80B2918 bl sub_80B24F8 cmp r0, 0x1 beq _080B29E6 - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult adds r0, r6, 0 adds r1, r5, 0 bl sub_80B2478 @@ -791,7 +791,7 @@ sub_80B2A08: @ 80B2A08 bl sub_80B24F8 cmp r0, 0x1 beq _080B2ACE - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x4 bne _080B2A38 @@ -1067,7 +1067,7 @@ _080B2C7E: movs r0, 0 bl sub_800B330 bl ResetBlockReceivedFlags - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult adds r1, r5, 0 bl task_map_chg_seq_0807EC34 _080B2C9C: @@ -1111,7 +1111,7 @@ sub_80B2CEC: @ 80B2CEC adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x5 strh r0, [r1] ldr r0, =gTasks @@ -1139,7 +1139,7 @@ sub_80B2D2C: @ 80B2D2C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x6 strh r0, [r1] ldr r0, =gTasks @@ -1284,7 +1284,7 @@ sub_80B2E4C: @ 80B2E4C thumb_func_start sub_80B2E74 sub_80B2E74: @ 80B2E74 push {lr} - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] ldr r1, =gUnknown_020229C6 @@ -1353,7 +1353,7 @@ sub_80B2EE4: @ 80B2EE4 b _080B2FC6 .pool _080B2F0C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x1 bne _080B2FA8 @@ -1415,7 +1415,7 @@ _080B2F74: _080B2F82: cmp r7, 0 beq _080B2FA8 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0xC strh r0, [r1] bl sub_800AD10 diff --git a/asm/contest_link_80F57C4.s b/asm/contest_link_80F57C4.s index f20070978..0a7ffe3c1 100644 --- a/asm/contest_link_80F57C4.s +++ b/asm/contest_link_80F57C4.s @@ -548,7 +548,7 @@ _080F5D2A: movs r0, 0x8 strh r0, [r1] bl InterviewBefore - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x1 beq _080F5D58 @@ -4648,7 +4648,7 @@ sub_80F7F30: @ 80F7F30 ldrb r0, [r4] bl sub_80DB09C _080F7F5E: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] pop {r4,r5} pop {r0} diff --git a/asm/daycare.s b/asm/daycare.s index 065911df8..79a0c7636 100644 --- a/asm/daycare.s +++ b/asm/daycare.s @@ -3075,12 +3075,12 @@ c3_080469FC: @ 8071204 b _0807124E .pool _0807123C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _0807124E .pool _08071248: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 strh r0, [r1] _0807124E: @@ -3109,7 +3109,7 @@ _08071284: ands r0, r2 cmp r0, 0 beq _080712B4 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] ldrb r0, [r4, 0x8] movs r1, 0 diff --git a/asm/dewford_trend.s b/asm/dewford_trend.s index 40df2d6a0..be3d0367c 100644 --- a/asm/dewford_trend.s +++ b/asm/dewford_trend.s @@ -667,7 +667,7 @@ sub_81229C8: @ 81229C8 negs r0, r0 lsrs r4, r0, 31 _08122A0C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r4, [r0] pop {r4} pop {r0} @@ -677,7 +677,7 @@ _08122A0C: thumb_func_start sub_8122A30 sub_8122A30: @ 8122A30 - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00002e6c diff --git a/asm/easy_chat.s b/asm/easy_chat.s index a85169b61..9e9b4bcaa 100644 --- a/asm/easy_chat.s +++ b/asm/easy_chat.s @@ -1659,7 +1659,7 @@ _0811AFAC: b _0811AFE6 .pool _0811AFC0: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] ldr r0, =gUnknown_0203A118 ldr r0, [r0] @@ -1709,7 +1709,7 @@ _0811B00C: .pool _0811B020: bl sub_811BE9C - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl sub_811B4EC strh r0, [r4] bl sub_811B3E4 @@ -1860,7 +1860,7 @@ _0811B118: b _0811B14A .pool _0811B134: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl sub_811B4EC strh r0, [r4] bl sub_811B3E4 diff --git a/asm/field_control_avatar.s b/asm/field_control_avatar.s index fa923d94b..baf159a8d 100644 --- a/asm/field_control_avatar.s +++ b/asm/field_control_avatar.s @@ -184,7 +184,7 @@ sub_809C014: @ 809C014 push {r4-r6,lr} sub sp, 0x8 adds r5, r0, 0 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked movs r1, 0 strh r1, [r0] ldr r0, =gSelectedMapObject @@ -582,13 +582,13 @@ _0809C34C: ble _0809C340 ldr r0, =gSelectedMapObject strb r3, [r0] - ldr r1, =gScriptLastTalked + ldr r1, =gSpecialVar_ScriptLastTalked adds r0, r2, r3 lsls r0, 2 adds r0, r5 ldrb r0, [r0, 0x8] strh r0, [r1] - ldr r0, =gScriptFacing + ldr r0, =gSpecialVar_ScriptFacing strh r6, [r0] adds r0, r3, 0 bl GetFieldObjectScriptPointerByFieldObjectId @@ -668,13 +668,13 @@ _0809C400: _0809C40C: ldr r0, =gSelectedMapObject strb r4, [r0] - ldr r1, =gScriptLastTalked + ldr r1, =gSpecialVar_ScriptLastTalked adds r0, r2, r4 lsls r0, 2 adds r0, r3 ldrb r0, [r0, 0x8] strh r0, [r1] - ldr r0, =gScriptFacing + ldr r0, =gSpecialVar_ScriptFacing strh r7, [r0] bl InTrainerHill cmp r0, 0x1 @@ -687,7 +687,7 @@ _0809C43C: bl GetFieldObjectScriptPointerByFieldObjectId _0809C442: adds r1, r0, 0 - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrb r0, [r0] bl GetRamScript adds r1, r0, 0 diff --git a/asm/field_poison.s b/asm/field_poison.s index 652026523..ec9976361 100644 --- a/asm/field_poison.s +++ b/asm/field_poison.s @@ -203,12 +203,12 @@ _080F96C0: cmp r0, 0 beq _080F96F0 _080F96E6: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _080F9718 .pool _080F96F0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] b _080F9718 @@ -224,7 +224,7 @@ _080F96FC: b _080F9722 .pool _080F9714: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _080F9718: bl EnableBothScriptContexts diff --git a/asm/field_screen.s b/asm/field_screen.s index 4ab8a5a53..beea78db0 100644 --- a/asm/field_screen.s +++ b/asm/field_screen.s @@ -10424,7 +10424,7 @@ sub_80B0534: @ 80B0534 lsls r1, 3 ldr r0, =gTasks + 0x8 adds r1, r0 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0 bne _080B0568 diff --git a/asm/fldeff_80F9BCC.s b/asm/fldeff_80F9BCC.s index 63acc9982..77faa0f81 100644 --- a/asm/fldeff_80F9BCC.s +++ b/asm/fldeff_80F9BCC.s @@ -563,7 +563,7 @@ _080F9FFE: sub_80FA004: @ 80FA004 push {r4,lr} bl sub_80E8BC8 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x1 beq _080FA0AE @@ -2063,7 +2063,7 @@ _080FACC2: ldr r0, =gStringVar2 ldr r1, =gText_Gold bl StringCopy - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] ldr r0, =0x00004054 @@ -2087,7 +2087,7 @@ _080FAD14: ldr r0, =gStringVar2 ldr r1, =gText_Silver bl StringCopy - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] ldr r0, =0x00004054 @@ -2103,12 +2103,12 @@ _080FAD14: b _080FAD8A .pool _080FAD60: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _080FAD70 .pool _080FAD6C: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 _080FAD70: strh r0, [r1] @@ -2131,7 +2131,7 @@ _080FAD8A: b _080FADCE .pool _080FADA4: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x3 strh r0, [r1] ldr r0, =0x00004054 diff --git a/asm/fldeff_strength.s b/asm/fldeff_strength.s index 947517ed5..2918be52d 100644 --- a/asm/fldeff_strength.s +++ b/asm/fldeff_strength.s @@ -17,7 +17,7 @@ hm_prepare_rocksmash: @ 8145DC4 movs r0, 0 b _08145DF2 _08145DD8: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 diff --git a/asm/item_menu.s b/asm/item_menu.s index 1e4dfca49..3b7ec89cb 100755 --- a/asm/item_menu.s +++ b/asm/item_menu.s @@ -121,7 +121,7 @@ sub_81AAC28: @ 81AAC28 ldr r0, =gSpecialVar_0x8005 movs r1, 0 strh r1, [r0] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] pop {r0} bx r0 @@ -135,7 +135,7 @@ sub_81AAC50: @ 81AAC50 movs r0, 0x7 movs r1, 0x5 bl GoToBagMenu - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] pop {r0} @@ -150,7 +150,7 @@ sub_81AAC70: @ 81AAC70 movs r0, 0x8 movs r1, 0x5 bl GoToBagMenu - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] pop {r0} @@ -5729,7 +5729,7 @@ unknown_ItemMenu_Show: @ 81ADE38 ldr r0, =gScriptItemId ldrh r0, [r0] strh r0, [r1] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] bl bag_menu_remove_some_window @@ -5764,7 +5764,7 @@ unknown_ItemMenu_Give2: @ 81ADE8C ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] bl bag_menu_remove_some_window @@ -5795,7 +5795,7 @@ unknown_ItemMenu_Confirm2: @ 81ADEDC adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] bl bag_menu_remove_some_window diff --git a/asm/link.s b/asm/link.s index 291f71a57..d702ad957 100644 --- a/asm/link.s +++ b/asm/link.s @@ -18044,7 +18044,7 @@ BerryBlenderLinkBecomeLeader: @ 801273C movs r0, 0 strb r0, [r1, 0xC] strb r0, [r1, 0xD] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult strh r0, [r1] pop {r0} bx r0 @@ -18891,7 +18891,7 @@ _08012EE6: bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x5 strh r0, [r1] b _08012F50 @@ -18900,7 +18900,7 @@ _08012EFC: bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x8 strh r0, [r1] b _08012F50 @@ -19569,7 +19569,7 @@ BerryBlenderLinkJoinGroup: @ 80134A4 movs r0, 0 strb r0, [r1, 0x8] strb r0, [r1, 0x9] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult strh r0, [r1] pop {r0} bx r0 @@ -20194,13 +20194,13 @@ _08013AE4: lsls r0, 24 cmp r0, 0 beq _08013B82 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult movs r1, 0x6 b _08013B58 .pool _08013B14: bl sub_800E084 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult movs r1, 0x5 b _08013B58 .pool @@ -20226,7 +20226,7 @@ _08013B4A: lsls r0, 24 cmp r0, 0 beq _08013B82 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult movs r1, 0x8 _08013B58: strh r1, [r0] @@ -21544,7 +21544,7 @@ _0801474C: _08014764: adds r0, r4, 0 bl DestroyTask - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] ldr r0, =gUnknown_02022C2C @@ -21600,7 +21600,7 @@ _080147CC: .4byte _08014992 .4byte _0801499C _080147F0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] ldr r0, =gUnknown_02022C2C @@ -21744,7 +21744,7 @@ _0801494A: bl sub_80B2AF4 cmp r0, 0 beq _08014980 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult movs r1, 0xB strh r1, [r0] movs r0, 0x7 @@ -21835,7 +21835,7 @@ sub_8014A00: @ 8014A00 strb r2, [r1, 0xC] strb r2, [r1, 0xD] strb r4, [r1, 0x18] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r2, [r0] pop {r4} pop {r0} @@ -22295,7 +22295,7 @@ _08014E4E: beq _08014EF2 adds r0, r4, 0 bl DestroyTask - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x5 strh r0, [r1] b _08014EF2 @@ -22384,7 +22384,7 @@ sub_8014EFC: @ 8014EFC strb r2, [r1, 0x9] subs r4, 0x15 strb r4, [r1, 0x12] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r2, [r0] pop {r4} pop {r0} @@ -22725,7 +22725,7 @@ _0801526A: adds r0, r6, 0 bl DestroyTask bl sub_800EDD4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x5 strh r0, [r1] b _080152A0 @@ -22773,7 +22773,7 @@ sub_80152A8: @ 80152A8 strb r2, [r1, 0x9] subs r4, 0x15 strb r4, [r1, 0x12] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r2, [r0] pop {r4} pop {r0} @@ -23097,7 +23097,7 @@ _080155C2: adds r0, r4, 0 bl DestroyTask bl sub_800EDD4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x5 strh r0, [r1] b _08015604 @@ -23141,7 +23141,7 @@ UnionRoomSpecial: @ 801560C strb r1, [r0, 0x16] strh r1, [r0, 0x10] strh r1, [r0, 0x12] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] movs r0, 0xD0 movs r1, 0x1 @@ -23384,7 +23384,7 @@ _08015878: ldr r0, [r6, 0xC] movs r1, 0x4 bl sub_80175EC - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] movs r0, 0x3 @@ -23486,7 +23486,7 @@ _080159A0: movs r0, 0x4 bl _08016876 _080159A6: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult ldrh r0, [r4] cmp r0, 0 beq _08015A0A @@ -25069,7 +25069,7 @@ var_800D_set_xB: @ 8016884 bl InUnionRoom cmp r0, 0x1 bne _08016894 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0xB strh r0, [r1] _08016894: @@ -30491,7 +30491,7 @@ _0801940C: b _08019922 .pool _0801942C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x5 beq _08019436 @@ -30992,7 +30992,7 @@ _080197F8: b _08019922 .pool _08019810: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x5 beq _0801981A @@ -39452,7 +39452,7 @@ _0801DC10: thumb_func_start sub_801DC20 sub_801DC20: @ 801DC20 push {r4-r6,lr} - ldr r6, =gScriptResult + ldr r6, =gSpecialVar_ScriptResult bl sub_801B044 adds r4, r0, 0 bl IsMysteryEventEnabled @@ -59190,7 +59190,7 @@ sub_8027A48: @ 8027A48 sub_8027A5C: @ 8027A5C push {r4-r6,lr} movs r5, 0 - ldr r6, =gScriptResult + ldr r6, =gSpecialVar_ScriptResult _08027A62: movs r0, 0x64 adds r1, r5, 0 @@ -59215,7 +59215,7 @@ _08027A94: adds r5, 0x1 cmp r5, 0x5 ble _08027A62 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _08027AA0: @@ -68862,7 +68862,7 @@ _0802C924: bl sub_802C908 cmp r0, 0 beq _0802C95C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _0802C966 .pool @@ -68870,7 +68870,7 @@ _0802C95C: adds r5, 0x1 cmp r5, 0x5 ble _0802C924 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 _0802C966: strh r0, [r1] diff --git a/asm/map_obj_lock.s b/asm/map_obj_lock.s index ee60814f5..79823d8eb 100644 --- a/asm/map_obj_lock.s +++ b/asm/map_obj_lock.s @@ -256,7 +256,7 @@ sub_8098574: @ 8098574 lsls r0, 2 ldr r1, =gMapObjects adds r0, r1 - ldr r1, =gScriptFacing + ldr r1, =gSpecialVar_ScriptFacing ldrb r1, [r1] bl FieldObjectFaceOppositeDirection pop {r0} diff --git a/asm/mauville_old_man.s b/asm/mauville_old_man.s index 4972d4096..2d61afe1d 100644 --- a/asm/mauville_old_man.s +++ b/asm/mauville_old_man.s @@ -157,7 +157,7 @@ sub_81201C8: @ 81201C8 thumb_func_start sub_81201DC sub_81201DC: @ 81201DC push {r4,lr} - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl sub_81201C8 lsls r0, 24 lsrs r0, 24 @@ -170,7 +170,7 @@ sub_81201DC: @ 81201DC thumb_func_start sub_81201F4 sub_81201F4: @ 81201F4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00002e51 @@ -347,7 +347,7 @@ sub_8120340: @ 8120340 thumb_func_start sub_8120358 sub_8120358: @ 8120358 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00002e28 @@ -379,14 +379,14 @@ sub_812038C: @ 812038C ldr r0, =0x0000ffff cmp r1, r0 bne _081203AC - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 b _081203B6 .pool _081203AC: ldr r0, =gStringVar1 bl CopyEasyChatWord - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 _081203B6: strh r0, [r1] @@ -405,14 +405,14 @@ sub_81203C4: @ 81203C4 ldrb r0, [r2, 0x1] cmp r0, 0xA bne _081203EC - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] strb r0, [r2, 0x1] b _081203F2 .pool _081203EC: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _081203F2: @@ -503,7 +503,7 @@ _081204C4: adds r0, 0x1 _081204C8: strb r0, [r5, 0x1] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] pop {r4-r6} @@ -2382,13 +2382,13 @@ _0812132C: cmp r4, r0 bne _0812135C _0812134E: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] b _08121364 .pool _0812135C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] ldr r0, =gUnknown_03001178 strb r4, [r0] diff --git a/asm/party_menu.s b/asm/party_menu.s index f2e681b9b..041ff6f18 100755 --- a/asm/party_menu.s +++ b/asm/party_menu.s @@ -1219,7 +1219,7 @@ sub_81B0BFC: @ 81B0BFC ldrb r0, [r0, 0xB] cmp r0, 0xC bne _081B0C40 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] ldr r0, =gSpecialVar_0x8005 @@ -8135,7 +8135,7 @@ sub_81B4578: @ 81B4578 lsls r0, 16 lsrs r0, 16 mov r8, r0 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r7, [r0] cmp r7, 0 bne _081B45F8 @@ -12928,7 +12928,7 @@ _081B6FC0: _081B6FDC: cmp r0, 0x2 bne _081B6FE4 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r2, [r0] _081B6FE4: adds r0, r5, 0 @@ -13324,7 +13324,7 @@ _081B7306: _081B7368: cmp r0, 0x2 bne _081B7370 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] _081B7370: ldr r0, =gTasks @@ -14933,7 +14933,7 @@ sub_81B81A8: @ 81B81A8 bl GetMonData lsls r0, 16 lsrs r7, r0, 16 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0 bne _081B8208 @@ -17381,7 +17381,7 @@ _081B95BA: thumb_func_start sub_81B95E0 sub_81B95E0: @ 81B95E0 push {r4,r5,lr} - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] movs r4, 0 @@ -17490,7 +17490,7 @@ sub_81B968C: @ 81B968C thumb_func_start sub_81B96D0 sub_81B96D0: @ 81B96D0 push {r4,r5,lr} - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] movs r4, 0 @@ -17741,13 +17741,13 @@ sub_81B98DC: @ 81B98DC adds r1, r0, 0 cmp r1, 0 beq _081B990C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] b _081B9910 .pool _081B990C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _081B9910: pop {r0} @@ -17760,7 +17760,7 @@ sub_81B9918: @ 81B9918 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] ldr r0, =gSpecialVar_0x8004 @@ -17813,7 +17813,7 @@ _081B9980: bl sub_80D23A8 cmp r0, 0x1 beq _081B999C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _081B999C: diff --git a/asm/pokemon_summary_screen.s b/asm/pokemon_summary_screen.s index fd2518075..db9429c6a 100755 --- a/asm/pokemon_summary_screen.s +++ b/asm/pokemon_summary_screen.s @@ -5238,7 +5238,7 @@ _081C6AF8: bl Free adds r0, r5, 0 bl Free - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] b _081C6BC6 @@ -5266,7 +5266,7 @@ _081C6B9C: lsrs r6, r0, 24 cmp r6, 0x2 bls _081C6B9C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] adds r0, r7, 0 diff --git a/asm/pokenav.s b/asm/pokenav.s index 0c7a80742..926e8979a 100755 --- a/asm/pokenav.s +++ b/asm/pokenav.s @@ -27683,7 +27683,7 @@ _081D4AF8: movs r2, 0x80 orrs r1, r2 strb r1, [r0] - ldr r0, =gScriptFacing + ldr r0, =gSpecialVar_ScriptFacing ldrh r0, [r0] cmp r0, 0x2 beq _081D4B3A @@ -29323,7 +29323,7 @@ _081D5854: sub_81D58D8: @ 81D58D8 push {lr} bl sub_80008E8 - ldr r3, =gScriptResult + ldr r3, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r3] ldr r0, =gSaveBlock1Ptr @@ -29381,7 +29381,7 @@ sub_81D5924: @ 81D5924 cmp r4, 0 beq _081D596C _081D5952: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 strh r0, [r1] b _081D59C0 @@ -29413,12 +29413,12 @@ _081D596C: negs r0, r0 ands r0, r2 strb r0, [r1] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r4, [r0] b _081D59C0 .pool _081D59BC: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r6, [r0] _081D59C0: pop {r3} @@ -29444,7 +29444,7 @@ sub_81D59D0: @ 81D59D0 lsrs r5, r0, 24 cmp r5, 0 beq _081D59FC - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r3, [r0] b _081D5A4E .pool @@ -29473,12 +29473,12 @@ _081D59FC: adds r2, r0 ldr r0, [r2] str r0, [r1] - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r5, [r0] b _081D5A4E .pool _081D5A48: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _081D5A4E: @@ -29556,7 +29556,7 @@ sub_81D5AD0: @ 81D5AD0 negs r0, r0 ands r0, r1 strb r0, [r2] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 b _081D5B20 .pool @@ -29569,12 +29569,12 @@ _081D5B00: negs r0, r0 ands r0, r1 strb r0, [r2] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _081D5B20 .pool _081D5B1C: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 _081D5B20: strh r0, [r1] @@ -29653,12 +29653,12 @@ sub_81D5BBC: @ 81D5BBC movs r2, 0 movs r3, 0x1 bl ConvertIntToDecimalStringN - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 b _081D5BF0 .pool _081D5BEC: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 _081D5BF0: strh r0, [r1] @@ -29672,7 +29672,7 @@ _081D5BF0: sub_81D5C00: @ 81D5C00 push {lr} bl sub_81D56B0 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] bl sub_81D5710 @@ -29721,12 +29721,12 @@ sub_81D5C5C: @ 81D5C5C lsrs r1, r0, 24 cmp r1, 0 bne _081D5C74 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _081D5C7A .pool _081D5C74: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _081D5C7A: @@ -30495,7 +30495,7 @@ sub_81D62AC: @ 81D62AC thumb_func_start sub_81D62B4 sub_81D62B4: @ 81D62B4 push {lr} - ldr r0, =gScriptLastTalked + ldr r0, =gSpecialVar_ScriptLastTalked ldrh r1, [r0] movs r0, 0x5 bl sub_81D572C @@ -30772,7 +30772,7 @@ _081D64D4: thumb_func_start sub_81D64DC sub_81D64DC: @ 81D64DC - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ef9 @@ -30825,7 +30825,7 @@ sub_81D6534: @ 81D6534 cmp r0, 0x6 beq _081D6560 bl sub_81D5C00 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0 beq _081D6560 @@ -30851,12 +30851,12 @@ sub_81D6568: @ 81D6568 ands r0, r1 cmp r0, 0 beq _081D6590 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 b _081D6594 .pool _081D6590: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 _081D6594: strh r0, [r1] diff --git a/asm/recorded_battle.s b/asm/recorded_battle.s index 2209312c2..df410700a 100644 --- a/asm/recorded_battle.s +++ b/asm/recorded_battle.s @@ -334,7 +334,7 @@ sub_8185054: @ 8185054 cmp r0, 0xFF bne _081850BC _0818507A: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, =gBattleOutcome movs r0, 0x5 strb r0, [r1] diff --git a/asm/rom6.s b/asm/rom6.s index b729369c8..5b7202873 100644 --- a/asm/rom6.s +++ b/asm/rom6.s @@ -31,7 +31,7 @@ npc_before_player_of_type: @ 8135424 ldrb r0, [r2, 0x5] cmp r0, r5 bne _08135470 - ldr r1, =gScriptLastTalked + ldr r1, =gSpecialVar_ScriptLastTalked ldrb r0, [r2, 0x8] strh r0, [r1] movs r0, 0x1 @@ -262,7 +262,7 @@ sub_8135654: @ 8135654 lsls r0, 24 cmp r0, 0 beq _0813568C - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 @@ -2136,7 +2136,7 @@ _081366B6: _081366D0: movs r0, 0x5 bl PlaySE - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldr r2, =0x0000ffff adds r1, r2, 0 strh r1, [r0] @@ -2853,7 +2853,7 @@ sub_8136D2C: @ 8136D2C adds r1, r3 ldr r1, [r1] bl StringCopy - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldrh r0, [r5] strh r0, [r1] lsls r0, 24 @@ -2888,7 +2888,7 @@ sub_8136D90: @ 8136D90 lsls r0, 24 lsrs r0, 24 strh r0, [r6] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldrh r0, [r5] strh r0, [r1] lsls r0, 24 @@ -3333,7 +3333,7 @@ sub_81370FC: @ 81370FC lsls r0, 24 cmp r0, 0 beq _08137134 - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 @@ -4899,7 +4899,7 @@ _08137E58: lsls r0, 24 lsrs r4, r0, 24 _08137E5C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r4, [r0] pop {r4-r7} pop {r0} @@ -7214,7 +7214,7 @@ _081390E6: cmp r0, 0xC bne _0813913C _08139128: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _0813914A .pool @@ -7224,7 +7224,7 @@ _0813913C: lsrs r5, r0, 24 cmp r5, 0x5 bls _081390E6 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 _0813914A: strh r0, [r1] @@ -8044,7 +8044,7 @@ _081397BE: thumb_func_start sub_81397C4 sub_81397C4: @ 81397C4 push {r4,r5,lr} - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldrh r1, [r2] ldr r0, =0x0000270f cmp r1, r0 @@ -8123,7 +8123,7 @@ _08139862: thumb_func_start sub_813986C sub_813986C: @ 813986C push {lr} - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x4 bhi _081398B8 @@ -9381,7 +9381,7 @@ _0813A2BE: strh r4, [r3, 0x26] b _0813A2D2 _0813A2C6: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x7F strh r0, [r1] adds r0, r4, 0 @@ -9649,7 +9649,7 @@ sub_813A4EC: @ 813A4EC b _0813A566 .pool _0813A51C: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x7F strh r0, [r1] movs r0, 0x5 @@ -9657,7 +9657,7 @@ _0813A51C: b _0813A54C .pool _0813A530: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r4, [r0] movs r0, 0x5 bl PlaySE @@ -10930,7 +10930,7 @@ task_deoxys_sound: @ 813AFDC lsrs r0, 24 cmp r0, 0x1 bne _0813B004 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x3 b _0813B06A .pool @@ -10961,7 +10961,7 @@ _0813B004: mov r0, r8 movs r1, 0 bl VarSet - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] b _0813B070 @@ -10971,7 +10971,7 @@ _0813B05C: bne _0813B080 ldr r0, =0x000008d4 bl FlagSet - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 _0813B06A: strh r0, [r1] @@ -10991,7 +10991,7 @@ _0813B080: ldr r0, =0x00004035 adds r1, r5, 0 bl VarSet - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] adds r0, r7, 0 @@ -11684,7 +11684,7 @@ _0813B62E: ldrh r1, [r5] cmp r1, 0x1 bne _0813B668 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _0813B790 .pool @@ -11698,7 +11698,7 @@ _0813B668: ldrh r0, [r0] cmp r0, 0x1 bne _0813B68C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 b _0813B6AC .pool @@ -11710,12 +11710,12 @@ _0813B68C: ldrh r0, [r0] cmp r0, 0 bne _0813B6A8 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x3 b _0813B6AC .pool _0813B6A8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 _0813B6AC: strh r0, [r1] @@ -11736,7 +11736,7 @@ _0813B6C2: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r2, 0x2 bl SendBlock b _0813B708 @@ -11751,7 +11751,7 @@ _0813B6E4: lsls r0, 24 cmp r0, 0 beq _0813B790 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r0, =gBlockRecvBuffer ldrh r0, [r0] strh r0, [r1] @@ -11773,7 +11773,7 @@ _0813B728: lsls r0, 24 cmp r0, 0 bne _0813B74C - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x2 bne _0813B790 @@ -11782,7 +11782,7 @@ _0813B728: b _0813B790 .pool _0813B74C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x3 bne _0813B790 @@ -12041,7 +12041,7 @@ _0813B94E: thumb_func_start sub_813B968 sub_813B968: @ 813B968 push {r4,r5,lr} - ldr r5, =gScriptResult + ldr r5, =gSpecialVar_ScriptResult ldr r0, =gSpecialVar_0x8004 ldrh r0, [r0] movs r1, 0x7 diff --git a/asm/script_menu.s b/asm/script_menu.s index 55ce5736a..889a0c10c 100644 --- a/asm/script_menu.s +++ b/asm/script_menu.s @@ -24,7 +24,7 @@ ScriptMenu_Multichoice: @ 80E1E08 lsrs r0, 24 cmp r0, 0x1 beq _080E1E4C - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult movs r1, 0xFF strh r1, [r0] movs r0, 0 @@ -70,7 +70,7 @@ ScriptMenu_MultichoiceWithDefault: @ 80E1E58 lsrs r0, 24 cmp r0, 0x1 beq _080E1EA8 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0xFF strh r0, [r1] str r4, [sp] @@ -358,13 +358,13 @@ _080E20B8: bne _080E20FC movs r0, 0x5 bl PlaySE - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x7F strh r0, [r1] b _080E20EC .pool _080E20E8: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _080E20EC: ldrb r0, [r5, 0xC] @@ -389,7 +389,7 @@ ScriptMenu_YesNo: @ 80E2108 lsrs r0, 24 cmp r0, 0x1 beq _080E2138 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0xFF strh r0, [r1] bl sub_8197930 @@ -410,7 +410,7 @@ _080E213A: thumb_func_start sub_80E2140 sub_80E2140: @ 80E2140 push {lr} - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0xFF beq _080E2154 @@ -465,12 +465,12 @@ _080E219C: _080E21A4: movs r0, 0x5 bl PlaySE - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 b _080E21B8 .pool _080E21B4: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 _080E21B8: strh r0, [r1] @@ -517,7 +517,7 @@ ScriptMenu_MultichoiceGrid: @ 80E21D0 b _080E22E8 .pool _080E2210: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult movs r1, 0xFF strh r1, [r0] movs r2, 0 @@ -655,13 +655,13 @@ sub_80E2308: @ 80E2308 bne _080E2360 movs r0, 0x5 bl PlaySE - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x7F strh r0, [r1] b _080E2350 .pool _080E234C: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _080E2350: ldrb r0, [r5, 0xC] @@ -686,7 +686,7 @@ sp109_CreatePCMenu: @ 80E236C lsrs r0, 24 cmp r0, 0x1 beq _080E2394 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0xFF strh r0, [r1] bl CreatePCMenu @@ -893,7 +893,7 @@ sub_80E2548: @ 80E2548 lsrs r0, 24 cmp r0, 0x1 beq _080E2570 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0xFF strh r0, [r1] bl sub_80E2578 @@ -1266,7 +1266,7 @@ _080E2860: thumb_func_start sub_80E2878 sub_80E2878: @ 80E2878 push {lr} - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldrh r0, [r2] cmp r0, 0x7F beq _080E288C @@ -1648,7 +1648,7 @@ sp106_CreateStartMenu: @ 80E2B7C lsrs r0, 24 cmp r0, 0x1 beq _080E2BA4 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0xFF strh r0, [r1] bl CreateStartMenu diff --git a/asm/script_pokemon_util_80F87D8.s b/asm/script_pokemon_util_80F87D8.s index 18d7b7fe3..7e67a8045 100644 --- a/asm/script_pokemon_util_80F87D8.s +++ b/asm/script_pokemon_util_80F87D8.s @@ -952,7 +952,7 @@ sub_80F8FA0: @ 80F8FA0 ands r0, r1 cmp r0, 0 bne _080F8FD8 - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 @@ -960,7 +960,7 @@ sub_80F8FA0: @ 80F8FA0 b _080F8FDE .pool _080F8FD8: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x4 strh r0, [r1] _080F8FDE: @@ -987,11 +987,11 @@ sub_80F8FE8: @ 80F8FE8 adds r0, r1 str r0, [r2] lsrs r0, 16 - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult b _080F902A .pool _080F9020: - ldr r4, =gScriptResult + ldr r4, =gSpecialVar_ScriptResult bl Random lsls r0, 16 lsrs r0, 16 @@ -1376,7 +1376,7 @@ _080F9310: cmp r1, 0x2 bne _080F9318 _080F9314: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _080F9318: pop {r0} @@ -1550,12 +1550,12 @@ sub_80F9460: @ 80F9460 ldrb r1, [r0] cmp r1, 0 bne _080F9478 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _080F947E .pool _080F9478: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _080F947E: @@ -1590,12 +1590,12 @@ sub_80F94B8: @ 80F94B8 ldrb r1, [r0] cmp r1, 0 bne _080F94D0 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _080F94D6 .pool _080F94D0: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _080F94D6: diff --git a/asm/secret_base.s b/asm/secret_base.s index 69cfff512..a7c90daea 100644 --- a/asm/secret_base.s +++ b/asm/secret_base.s @@ -74,7 +74,7 @@ sub_80E8B58: @ 80E8B58 thumb_func_start sub_80E8B6C sub_80E8B6C: @ 80E8B6C push {r4,lr} - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult movs r1, 0 strh r1, [r0] movs r3, 0 @@ -123,13 +123,13 @@ sub_80E8BC8: @ 80E8BC8 ldrb r1, [r0] cmp r1, 0 beq _080E8BEC - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] b _080E8BF0 .pool _080E8BEC: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _080E8BF0: pop {r0} @@ -1175,7 +1175,7 @@ _080E941E: cmp r0, 0x1 bne _080E9554 _080E9462: - ldr r6, =gScriptResult + ldr r6, =gSpecialVar_ScriptResult mov r1, r9 ldr r0, [r1, 0x4] ldr r1, [r0, 0x4] @@ -1428,7 +1428,7 @@ sub_80E9680: @ 80E9680 push {lr} bl sub_80E8B58 bl sub_80E8B6C - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrh r0, [r0] cmp r0, 0x1 beq _080E969C @@ -1527,12 +1527,12 @@ sub_80E9744: @ 80E9744 ldrb r1, [r1] cmp r0, r1 beq _080E9770 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 b _080E9774 .pool _080E9770: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 _080E9774: strh r0, [r1] @@ -2079,7 +2079,7 @@ sub_80E9BDC: @ 80E9BDC lsrs r1, r0, 24 cmp r1, 0x1 bne _080E9C04 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] b _080E9C22 .pool @@ -2089,12 +2089,12 @@ _080E9C04: lsrs r0, 24 cmp r0, 0x9 bls _080E9C1C - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x2 b _080E9C20 .pool _080E9C1C: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 _080E9C20: strh r0, [r1] @@ -2920,7 +2920,7 @@ sub_80EA30C: @ 80EA30C adds r1, r0 lsls r1, 5 adds r3, r1 - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult ldrb r0, [r0] ldr r1, =0x00001a9d adds r3, r1 @@ -2981,7 +2981,7 @@ _080EA39A: lsls r0, 24 lsrs r0, 24 strh r0, [r4] - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r0, =gSaveBlock1Ptr ldr r1, [r0] lsls r0, r5, 2 diff --git a/asm/start_menu.s b/asm/start_menu.s index 4f8544eea..752f2c810 100644 --- a/asm/start_menu.s +++ b/asm/start_menu.s @@ -974,13 +974,13 @@ task50_save_game: @ 809FFD0 _0809FFEC: cmp r1, 0x3 bgt _080A0000 - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] b _080A0000 .pool _0809FFFC: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r1, [r0] _080A0000: adds r0, r4, 0 diff --git a/asm/starter_choose.s b/asm/starter_choose.s index da42959ea..a90302941 100644 --- a/asm/starter_choose.s +++ b/asm/starter_choose.s @@ -555,7 +555,7 @@ _08134420: beq _08134450 b _0813449A _08134426: - ldr r2, =gScriptResult + ldr r2, =gSpecialVar_ScriptResult ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 diff --git a/asm/trader.s b/asm/trader.s index 8e0b17905..3d594fd2e 100644 --- a/asm/trader.s +++ b/asm/trader.s @@ -335,7 +335,7 @@ _08133CCA: sub_8133CD8: @ 8133CD8 ldr r0, =gSaveBlock1Ptr ldr r0, [r0] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult ldr r2, =0x00002e59 adds r0, r2 ldrb r0, [r0] @@ -348,7 +348,7 @@ sub_8133CD8: @ 8133CD8 sub_8133CF4: @ 8133CF4 push {r4,r5,lr} movs r4, 0 - ldr r5, =gScriptResult + ldr r5, =gSpecialVar_ScriptResult _08133CFA: adds r0, r4, 0 bl CountDecorationCategoryN @@ -365,7 +365,7 @@ _08133D10: lsrs r4, r0, 24 cmp r4, 0x7 bls _08133CFA - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] _08133D20: @@ -378,7 +378,7 @@ _08133D20: thumb_func_start sub_8133D2C sub_8133D2C: @ 8133D2C push {r4-r6,lr} - ldr r6, =gScriptResult + ldr r6, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r6] ldr r4, =gDecorations diff --git a/asm/trainer_see.s b/asm/trainer_see.s index 59dd9f74b..ebea70d6c 100644 --- a/asm/trainer_see.s +++ b/asm/trainer_see.s @@ -1300,7 +1300,7 @@ sub_80B45D0: @ 80B45D0 bne _080B460C adds r0, 0x1 strb r0, [r1] - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0x1 strh r0, [r1] bl UnfreezeMapObjects @@ -1313,7 +1313,7 @@ _080B460C: movs r0, 0 strb r0, [r1] _080B4610: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _080B4616: diff --git a/asm/wild_encounter.s b/asm/wild_encounter.s index 9b6c901f6..c10b8f389 100644 --- a/asm/wild_encounter.s +++ b/asm/wild_encounter.s @@ -1628,12 +1628,12 @@ rock_smash_wild_pokemon_encounter: @ 80B550C bne _080B5568 bl sub_80B0698 _080B5554: - ldr r0, =gScriptResult + ldr r0, =gSpecialVar_ScriptResult strh r4, [r0] b _080B556E .pool _080B5568: - ldr r1, =gScriptResult + ldr r1, =gSpecialVar_ScriptResult movs r0, 0 strh r0, [r1] _080B556E: diff --git a/constants/constants.inc b/constants/constants.inc index fbd4e8af0..db0a4ec30 100644 --- a/constants/constants.inc +++ b/constants/constants.inc @@ -18,3 +18,5 @@ .include "constants/field_object_constants.inc" .include "constants/contest_move_effects.inc" .include "constants/songs.inc" + .include "constants/flags.inc" + .include "constants/vars.inc" diff --git a/constants/flags.inc b/constants/flags.inc new file mode 100644 index 000000000..520ebdd12 --- /dev/null +++ b/constants/flags.inc @@ -0,0 +1,106 @@ + .equiv FLAG_TRAINER_FLAG_START, 0x500 + .equiv TRAINERS_FLAG_NO, 0x356 + .equiv CODE_FLAGS, (FLAG_TRAINER_FLAG_START + TRAINERS_FLAG_NO + 0xA) @ 0x860 + +@ SYSTEM FLAGS + + .equiv FLAG_SYS_POKEMON_GET, CODE_FLAGS + 0x0 + .equiv FLAG_SYS_POKEDEX_GET, CODE_FLAGS + 0x1 + .equiv FLAG_SYS_POKENAV_GET, CODE_FLAGS + 0x2 +@ third one appears unused + .equiv FLAG_SYS_GAME_CLEAR, CODE_FLAGS + 0x4 + .equiv FLAG_SYS_CHAT_USED, CODE_FLAGS + 0x5 + .equiv FLAG_SYS_HIPSTER_MEET, CODE_FLAGS + 0x6 + +@ badges + .equiv FLAG_BADGE01_GET, CODE_FLAGS + 0x7 + .equiv FLAG_BADGE02_GET, CODE_FLAGS + 0x8 + .equiv FLAG_BADGE03_GET, CODE_FLAGS + 0x9 + .equiv FLAG_BADGE04_GET, CODE_FLAGS + 0xA + .equiv FLAG_BADGE05_GET, CODE_FLAGS + 0xB + .equiv FLAG_BADGE06_GET, CODE_FLAGS + 0xC + .equiv FLAG_BADGE07_GET, CODE_FLAGS + 0xD + .equiv FLAG_BADGE08_GET, CODE_FLAGS + 0xE + +@ cities and towns + .equiv FLAG_VISITED_LITTLEROOT_TOWN, CODE_FLAGS + 0xF + .equiv FLAG_VISITED_OLDALE_TOWN, CODE_FLAGS + 0x10 + .equiv FLAG_VISITED_DEWFORD_TOWN, CODE_FLAGS + 0x11 + .equiv FLAG_VISITED_LAVARIDGE_TOWN, CODE_FLAGS + 0x12 + .equiv FLAG_VISITED_FALLARBOR_TOWN, CODE_FLAGS + 0x13 + .equiv FLAG_VISITED_VERDANTURF_TOWN, CODE_FLAGS + 0x14 + .equiv FLAG_VISITED_PACIFIDLOG_TOWN, CODE_FLAGS + 0x15 + .equiv FLAG_VISITED_PETALBURG_CITY, CODE_FLAGS + 0x16 + .equiv FLAG_VISITED_SLATEPORT_CITY, CODE_FLAGS + 0x17 + .equiv FLAG_VISITED_MAUVILLE_CITY, CODE_FLAGS + 0x18 + .equiv FLAG_VISITED_RUSTBORO_CITY, CODE_FLAGS + 0x19 + .equiv FLAG_VISITED_FORTREE_CITY, CODE_FLAGS + 0x1A + .equiv FLAG_VISITED_LILYCOVE_CITY, CODE_FLAGS + 0x1B + .equiv FLAG_VISITED_MOSSDEEP_CITY, CODE_FLAGS + 0x1C + .equiv FLAG_VISITED_SOOTOPOLIS_CITY, CODE_FLAGS + 0x1D + .equiv FLAG_VISITED_EVER_GRANDE_CITY, CODE_FLAGS + 0x1E + + .equiv FLAG_SYS_UNKNOWN_880, CODE_FLAGS + 0x20 + + .equiv FLAG_SYS_USE_FLASH, CODE_FLAGS + 0x28 + .equiv FLAG_SYS_USE_STRENGTH, CODE_FLAGS + 0x29 + .equiv FLAG_SYS_WEATHER_CTRL, CODE_FLAGS + 0x2A + .equiv FLAG_SYS_CYCLING_ROAD, CODE_FLAGS + 0x2B + .equiv FLAG_SYS_SAFARI_MODE, CODE_FLAGS + 0x2C + .equiv FLAG_SYS_CRUISE_MODE, CODE_FLAGS + 0x2D + + .equiv FLAG_SYS_TV_HOME, CODE_FLAGS + 0x30 + .equiv FLAG_SYS_TV_WATCH, CODE_FLAGS + 0x31 + .equiv FLAG_SYS_TV_START, CODE_FLAGS + 0x32 + .equiv FLAG_SYS_POPWORD_INPUT, CODE_FLAGS + 0x33 + .equiv FLAG_SYS_MIX_RECORD, CODE_FLAGS + 0x34 + .equiv FLAG_SYS_CLOCK_SET, CODE_FLAGS + 0x35 + .equiv FLAG_SYS_NATIONAL_DEX, CODE_FLAGS + 0x36 + .equiv FLAG_SYS_CAVE_SHIP, CODE_FLAGS + 0x37 + .equiv FLAG_SYS_CAVE_WONDER, CODE_FLAGS + 0x38 + .equiv FLAG_SYS_CAVE_BATTLE, CODE_FLAGS + 0x39 + .equiv FLAG_SYS_SHOAL_TIDE, CODE_FLAGS + 0x3A + .equiv FLAG_SYS_RIBBON_GET, CODE_FLAGS + 0x3B + + .equiv FLAG_SYS_PC_LANETTE, CODE_FLAGS + 0x4B + .equiv FLAG_SYS_MYSTERY_EVENT_ENABLE, CODE_FLAGS + 0x4C + .equiv FLAG_SYS_ENC_UP_ITEM, CODE_FLAGS + 0x4D + .equiv FLAG_SYS_ENC_DOWN_ITEM, CODE_FLAGS + 0x4E + .equiv FLAG_SYS_BRAILLE_DIG, CODE_FLAGS + 0x4F + .equiv FLAG_SYS_BRAILLE_STRENGTH, CODE_FLAGS + 0x50 + .equiv FLAG_SYS_BRAILLE_WAIT, CODE_FLAGS + 0x51 + .equiv FLAG_SYS_BRAILLE_FLY, CODE_FLAGS + 0x52 + .equiv FLAG_SYS_HAS_EON_TICKET, CODE_FLAGS + 0x53 + + .equiv FLAG_SYS_POKEMON_LEAGUE_FLY, CODE_FLAGS + 0x54 + + .equiv FLAG_SYS_TV_LATI, CODE_FLAGS + 0x5D + + .equiv FLAG_SYS_SHOAL_ITEM, CODE_FLAGS + 0x5F + .equiv FLAG_SYS_B_DASH, CODE_FLAGS + 0x60 @ got Running Shoes + .equiv FLAG_SYS_CTRL_OBJ_DELETE, CODE_FLAGS + 0x61 + .equiv FLAG_SYS_RESET_RTC_ENABLE, CODE_FLAGS + 0x62 + + .equiv FLAG_SYS_TOWER_SILVER, CODE_FLAGS + 0x64 + .equiv FLAG_SYS_TOWER_GOLD, CODE_FLAGS + 0x65 + .equiv FLAG_SYS_DOME_SILVER, CODE_FLAGS + 0x66 + .equiv FLAG_SYS_DOME_GOLD, CODE_FLAGS + 0x67 + .equiv FLAG_SYS_PALACE_SILVER, CODE_FLAGS + 0x68 + .equiv FLAG_SYS_PALACE_GOLD, CODE_FLAGS + 0x69 + .equiv FLAG_SYS_ARENA_SILVER, CODE_FLAGS + 0x6A + .equiv FLAG_SYS_ARENA_GOLD, CODE_FLAGS + 0x6B + .equiv FLAG_SYS_FACTORY_SILVER, CODE_FLAGS + 0x6C + .equiv FLAG_SYS_FACTORY_GOLD, CODE_FLAGS + 0x6D + .equiv FLAG_SYS_PIKE_SILVER, CODE_FLAGS + 0x6E + .equiv FLAG_SYS_PIKE_GOLD, CODE_FLAGS + 0x6F + .equiv FLAG_SYS_PYRAMID_SILVER, CODE_FLAGS + 0x70 + .equiv FLAG_SYS_PYRAMID_GOLD, CODE_FLAGS + 0x71 + .equiv FLAG_SYS_FRONTIER_PASS, CODE_FLAGS + 0x72 + + .equiv FLAG_SYS_STORAGE_UNKNOWN_FLAG, CODE_FLAGS + 0x77 + + .equiv FLAG_SYS_MYSTERY_GIFT_ENABLE, CODE_FLAGS + 0x7B + +@ SPECIAL FLAGS (unknown purpose) + + .equiv SPECIAL_FLAG_1, 0x4001 diff --git a/constants/variables.inc b/constants/variables.inc deleted file mode 100644 index 01b66b100..000000000 --- a/constants/variables.inc +++ /dev/null @@ -1,8 +0,0 @@ - .equiv FACING, 0x800C - .equiv RESULT, 0x800D - .equiv ITEM_ID, 0x800E - .equiv LAST_TALKED, 0x800F - .equiv CONTEST_RANK, 0x8010 - .equiv CONTEST_CATEGORY, 0x8011 - .equiv MON_BOX_ID, 0x8012 - .equiv MON_BOX_POS, 0x8013 diff --git a/constants/vars.inc b/constants/vars.inc new file mode 100644 index 000000000..e2719e10c --- /dev/null +++ b/constants/vars.inc @@ -0,0 +1,278 @@ + .equiv VAR_0x4000, 0x4000 + .equiv VAR_0x4001, 0x4001 + .equiv VAR_0x4002, 0x4002 + .equiv VAR_0x4003, 0x4003 + .equiv VAR_0x4004, 0x4004 + .equiv VAR_0x4005, 0x4005 + .equiv VAR_0x4006, 0x4006 + .equiv VAR_0x4007, 0x4007 + .equiv VAR_0x4008, 0x4008 + .equiv VAR_0x4009, 0x4009 + .equiv VAR_0x400A, 0x400A + .equiv VAR_0x400B, 0x400B + .equiv VAR_0x400C, 0x400C + .equiv VAR_0x400D, 0x400D + .equiv VAR_0x400E, 0x400E + .equiv VAR_0x400F, 0x400F + .equiv VAR_0x4010, 0x4010 + .equiv VAR_0x4011, 0x4011 + .equiv VAR_0x4012, 0x4012 + .equiv VAR_0x4013, 0x4013 + .equiv VAR_0x4014, 0x4014 + .equiv VAR_0x4015, 0x4015 + .equiv VAR_0x4016, 0x4016 + .equiv VAR_0x4017, 0x4017 + .equiv VAR_0x4018, 0x4018 + .equiv VAR_0x4019, 0x4019 + .equiv VAR_0x401A, 0x401A + .equiv VAR_0x401B, 0x401B + .equiv VAR_0x401C, 0x401C + .equiv VAR_0x401D, 0x401D + .equiv VAR_0x401E, 0x401E + .equiv VAR_0x401F, 0x401F + .equiv VAR_RECYCLE_GOODS, 0x4020 + .equiv VAR_REPEL_STEP_COUNT, 0x4021 + .equiv VAR_ICE_STEP_COUNT, 0x4022 + .equiv VAR_FIRST_POKE, 0x4023 + .equiv VAR_MIRAGE_RND_H, 0x4024 + .equiv VAR_MIRAGE_RND_L, 0x4025 + .equiv VAR_SECRET_BASE_MAP, 0x4026 + .equiv VAR_0x4027, 0x4027 + .equiv VAR_0x4028, 0x4028 + .equiv VAR_0x4029, 0x4029 + .equiv VAR_HAPPINESS_STEP_COUNTER, 0x402A + .equiv VAR_POISON_STEP_COUNTER, 0x402B + .equiv VAR_RESET_RTC_ENABLE, 0x402C + .equiv VAR_0x402D, 0x402D + .equiv VAR_0x402E, 0x402E + .equiv VAR_0x402F, 0x402F + .equiv VAR_0x4030, 0x4030 + .equiv VAR_0x4031, 0x4031 + .equiv VAR_0x4032, 0x4032 + .equiv VAR_0x4033, 0x4033 + .equiv VAR_0x4034, 0x4034 + .equiv VAR_0x4035, 0x4035 + .equiv VAR_STORAGE_UNKNOWN, 0x4036 + .equiv VAR_0x4037, 0x4037 + .equiv VAR_0x4038, 0x4038 + .equiv VAR_0x4039, 0x4039 + .equiv VAR_0x403A, 0x403A + .equiv VAR_0x403B, 0x403B + .equiv VAR_0x403C, 0x403C + .equiv VAR_0x403D, 0x403D + .equiv VAR_0x403E, 0x403E + .equiv VAR_0x403F, 0x403F + .equiv VAR_DAYS, 0x4040 + .equiv VAR_0x4041, 0x4041 + .equiv VAR_0x4042, 0x4042 + .equiv VAR_DEPT_STORE_FLOOR, 0x4043 + .equiv VAR_0x4044, 0x4044 + .equiv VAR_POKELOT_PRIZE, 0x4045 + .equiv VAR_NATIONAL_DEX, 0x4046 + .equiv VAR_SEEDOT_SIZE_RECORD, 0x4047 + .equiv VAR_ASH_GATHER_COUNT, 0x4048 + .equiv VAR_BIRCH_STATE, 0x4049 + .equiv VAR_CRUISE_STEP_COUNT, 0x404A + .equiv VAR_POKELOT_RND1, 0x404B + .equiv VAR_POKELOT_RND2, 0x404C + .equiv VAR_0x404D, 0x404D + .equiv VAR_0x404E, 0x404E + .equiv VAR_LOTAD_SIZE_RECORD, 0x404F + .equiv VAR_0x4050, 0x4050 + .equiv VAR_0x4051, 0x4051 + .equiv VAR_0x4052, 0x4052 + .equiv VAR_0x4053, 0x4053 + .equiv VAR_0x4054, 0x4054 + .equiv VAR_0x4055, 0x4055 + .equiv VAR_0x4056, 0x4056 + .equiv VAR_0x4057, 0x4057 + .equiv VAR_0x4058, 0x4058 + .equiv VAR_0x4059, 0x4059 + .equiv VAR_0x405A, 0x405A + .equiv VAR_0x405B, 0x405B + .equiv VAR_0x405C, 0x405C + .equiv VAR_0x405D, 0x405D + .equiv VAR_0x405E, 0x405E + .equiv VAR_0x405F, 0x405F + .equiv VAR_0x4060, 0x4060 + .equiv VAR_0x4061, 0x4061 + .equiv VAR_0x4062, 0x4062 + .equiv VAR_0x4063, 0x4063 + .equiv VAR_0x4064, 0x4064 + .equiv VAR_0x4065, 0x4065 + .equiv VAR_0x4066, 0x4066 + .equiv VAR_0x4067, 0x4067 + .equiv VAR_0x4068, 0x4068 + .equiv VAR_0x4069, 0x4069 + .equiv VAR_0x406A, 0x406A + .equiv VAR_0x406B, 0x406B + .equiv VAR_0x406C, 0x406C + .equiv VAR_0x406D, 0x406D + .equiv VAR_0x406E, 0x406E + .equiv VAR_0x406F, 0x406F + .equiv VAR_0x4070, 0x4070 + .equiv VAR_0x4071, 0x4071 + .equiv VAR_0x4072, 0x4072 + .equiv VAR_0x4073, 0x4073 + .equiv VAR_0x4074, 0x4074 + .equiv VAR_0x4075, 0x4075 + .equiv VAR_0x4076, 0x4076 + .equiv VAR_0x4077, 0x4077 + .equiv VAR_0x4078, 0x4078 + .equiv VAR_0x4079, 0x4079 + .equiv VAR_0x407A, 0x407A + .equiv VAR_0x407B, 0x407B + .equiv VAR_0x407C, 0x407C + .equiv VAR_0x407D, 0x407D + .equiv VAR_0x407E, 0x407E + .equiv VAR_0x407F, 0x407F + .equiv VAR_0x4080, 0x4080 + .equiv VAR_0x4081, 0x4081 + .equiv VAR_0x4082, 0x4082 + .equiv VAR_0x4083, 0x4083 + .equiv VAR_0x4084, 0x4084 + .equiv VAR_0x4085, 0x4085 + .equiv VAR_0x4086, 0x4086 + .equiv VAR_0x4087, 0x4087 + .equiv VAR_0x4088, 0x4088 + .equiv VAR_0x4089, 0x4089 + .equiv VAR_0x408A, 0x408A + .equiv VAR_0x408B, 0x408B + .equiv VAR_0x408C, 0x408C + .equiv VAR_0x408D, 0x408D + .equiv VAR_0x408E, 0x408E + .equiv VAR_0x408F, 0x408F + .equiv VAR_0x4090, 0x4090 + .equiv VAR_0x4091, 0x4091 + .equiv VAR_0x4092, 0x4092 + .equiv VAR_0x4093, 0x4093 + .equiv VAR_0x4094, 0x4094 + .equiv VAR_0x4095, 0x4095 + .equiv VAR_0x4096, 0x4096 + .equiv VAR_0x4097, 0x4097 + .equiv VAR_0x4098, 0x4098 + .equiv VAR_0x4099, 0x4099 + .equiv VAR_0x409A, 0x409A + .equiv VAR_0x409B, 0x409B + .equiv VAR_0x409C, 0x409C + .equiv VAR_0x409D, 0x409D + .equiv VAR_0x409E, 0x409E + .equiv VAR_0x409F, 0x409F + .equiv VAR_0x40A0, 0x40A0 + .equiv VAR_0x40A1, 0x40A1 + .equiv VAR_0x40A2, 0x40A2 + .equiv VAR_0x40A3, 0x40A3 + .equiv VAR_0x40A4, 0x40A4 + .equiv VAR_0x40A5, 0x40A5 + .equiv VAR_0x40A6, 0x40A6 + .equiv VAR_0x40A7, 0x40A7 + .equiv VAR_0x40A8, 0x40A8 + .equiv VAR_0x40A9, 0x40A9 + .equiv VAR_0x40AA, 0x40AA + .equiv VAR_0x40AB, 0x40AB + .equiv VAR_0x40AC, 0x40AC + .equiv VAR_0x40AD, 0x40AD + .equiv VAR_0x40AE, 0x40AE + .equiv VAR_0x40AF, 0x40AF + .equiv VAR_0x40B0, 0x40B0 + .equiv VAR_0x40B1, 0x40B1 + .equiv VAR_0x40B2, 0x40B2 + .equiv VAR_0x40B3, 0x40B3 + .equiv VAR_PORTHOLE, 0x40B4 + .equiv VAR_0x40B5, 0x40B5 + .equiv VAR_0x40B6, 0x40B6 + .equiv VAR_0x40B7, 0x40B7 + .equiv VAR_0x40B8, 0x40B8 + .equiv VAR_0x40B9, 0x40B9 + .equiv VAR_0x40BA, 0x40BA + .equiv VAR_0x40BB, 0x40BB + .equiv VAR_0x40BC, 0x40BC + .equiv VAR_0x40BD, 0x40BD + .equiv VAR_0x40BE, 0x40BE + .equiv VAR_0x40BF, 0x40BF + .equiv VAR_0x40C0, 0x40C0 + .equiv VAR_0x40C1, 0x40C1 + .equiv VAR_0x40C2, 0x40C2 + .equiv VAR_0x40C3, 0x40C3 + .equiv VAR_0x40C4, 0x40C4 + .equiv VAR_0x40C5, 0x40C5 + .equiv VAR_0x40C6, 0x40C6 + .equiv VAR_0x40C7, 0x40C7 + .equiv VAR_0x40C8, 0x40C8 + .equiv VAR_0x40C9, 0x40C9 + .equiv VAR_0x40CA, 0x40CA + .equiv VAR_0x40CB, 0x40CB + .equiv VAR_0x40CC, 0x40CC + .equiv VAR_0x40CD, 0x40CD + .equiv VAR_0x40CE, 0x40CE + .equiv VAR_FRONTIER_FACILITY, 0x40CF + .equiv VAR_0x40D0, 0x40D0 + .equiv VAR_0x40D1, 0x40D1 + .equiv VAR_0x40D2, 0x40D2 + .equiv VAR_0x40D3, 0x40D3 + .equiv VAR_0x40D4, 0x40D4 + .equiv VAR_0x40D5, 0x40D5 + .equiv VAR_0x40D6, 0x40D6 + .equiv VAR_0x40D7, 0x40D7 + .equiv VAR_0x40D8, 0x40D8 + .equiv VAR_0x40D9, 0x40D9 + .equiv VAR_0x40DA, 0x40DA + .equiv VAR_0x40DB, 0x40DB + .equiv VAR_0x40DC, 0x40DC + .equiv VAR_0x40DD, 0x40DD + .equiv VAR_0x40DE, 0x40DE + .equiv VAR_0x40DF, 0x40DF + .equiv VAR_0x40E0, 0x40E0 + .equiv VAR_0x40E1, 0x40E1 + .equiv VAR_0x40E2, 0x40E2 + .equiv VAR_0x40E3, 0x40E3 + .equiv VAR_0x40E4, 0x40E4 + .equiv VAR_0x40E5, 0x40E5 + .equiv VAR_DAILY_SLOTS, 0x40E6 + .equiv VAR_DAILY_WILDS, 0x40E7 + .equiv VAR_DAILY_BLENDER, 0x40E8 + .equiv VAR_DAILY_PLANTED_BERRIES, 0x40E9 + .equiv VAR_DAILY_PICKED_BERRIES, 0x40EA + .equiv VAR_DAILY_ROULETTE, 0x40EB + .equiv VAR_0x40EC, 0x40EC + .equiv VAR_0x40ED, 0x40ED + .equiv VAR_0x40EE, 0x40EE + .equiv VAR_0x40EF, 0x40EF + .equiv VAR_0x40F0, 0x40F0 + .equiv VAR_DAILY_BP, 0x40F1 + .equiv VAR_0x40F2, 0x40F2 + .equiv VAR_0x40F3, 0x40F3 + .equiv VAR_0x40F4, 0x40F4 + .equiv VAR_0x40F5, 0x40F5 + .equiv VAR_0x40F6, 0x40F6 + .equiv VAR_0x40F7, 0x40F7 + .equiv VAR_0x40F8, 0x40F8 + .equiv VAR_0x40F9, 0x40F9 + .equiv VAR_0x40FA, 0x40FA + .equiv VAR_0x40FB, 0x40FB + .equiv VAR_0x40FC, 0x40FC + .equiv VAR_0x40FD, 0x40FD + .equiv VAR_0x40FE, 0x40FE + .equiv VAR_0x40FF, 0x40FF + + .equiv VAR_0x8000, 0x8000 + .equiv VAR_0x8001, 0x8001 + .equiv VAR_0x8002, 0x8002 + .equiv VAR_0x8003, 0x8003 + .equiv VAR_0x8004, 0x8004 + .equiv VAR_0x8005, 0x8005 + .equiv VAR_0x8006, 0x8006 + .equiv VAR_0x8007, 0x8007 + .equiv VAR_0x8008, 0x8008 + .equiv VAR_0x8009, 0x8009 + .equiv VAR_0x800A, 0x800A + .equiv VAR_0x800B, 0x800B + .equiv VAR_FACING, 0x800C + .equiv VAR_RESULT, 0x800D + .equiv VAR_ITEM_ID, 0x800E + .equiv VAR_LAST_TALKED, 0x800F + .equiv VAR_CONTEST_RANK, 0x8010 + .equiv VAR_CONTEST_CATEGORY, 0x8011 + .equiv VAR_MON_BOX_ID, 0x8012 + .equiv VAR_MON_BOX_POS, 0x8013 + .equiv VAR_0x8014, 0x8014 diff --git a/data/event_scripts.s b/data/event_scripts.s index 2383907ee..dfa72d93d 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -1,7 +1,6 @@ .include "asm/macros.inc" .include "asm/macros/event.inc" .include "constants/constants.inc" - .include "constants/variables.inc" .section script_data, "aw", %progbits diff --git a/include/event_data.h b/include/event_data.h index 0bd11fdcd..4030d5ec0 100644 --- a/include/event_data.h +++ b/include/event_data.h @@ -42,11 +42,11 @@ extern u16 gSpecialVar_0x8008; extern u16 gSpecialVar_0x8009; extern u16 gSpecialVar_0x800A; extern u16 gSpecialVar_0x800B; -extern u16 gScriptResult; -extern u16 gScriptLastTalked; -extern u16 gScriptFacing; -extern u16 gSpecialVar_0x8012; -extern u16 gSpecialVar_0x8013; +extern u16 gSpecialVar_ScriptResult; +extern u16 gSpecialVar_ScriptLastTalked; +extern u16 gSpecialVar_ScriptFacing; +extern u16 gSpecialVar_MonBoxId; +extern u16 gSpecialVar_MonBoxPos; extern u16 gSpecialVar_0x8014; #endif // GUARD_EVENT_DATA_H diff --git a/include/flags.h b/include/flags.h index 7d825feba..e0bb121f6 100644 --- a/include/flags.h +++ b/include/flags.h @@ -1,29 +1,29 @@ #ifndef GUARD_FLAGS_H #define GUARD_FLAGS_H -#define TRAINER_FLAG_START 0x500 +#define FLAG_TRAINER_FLAG_START 0x500 #define TRAINERS_FLAG_NO 0x356 -#define CODE_FLAGS (TRAINER_FLAG_START + TRAINERS_FLAG_NO + 0xA) // 0x860 +#define CODE_FLAGS (FLAG_TRAINER_FLAG_START + TRAINERS_FLAG_NO + 0xA) // 0x860 // SYSTEM FLAGS -#define SYS_POKEMON_GET CODE_FLAGS + 0 -#define SYS_POKEDEX_GET CODE_FLAGS + 1 -#define SYS_POKENAV_GET CODE_FLAGS + 2 +#define FLAG_SYS_POKEMON_GET CODE_FLAGS + 0 +#define FLAG_SYS_POKEDEX_GET CODE_FLAGS + 1 +#define FLAG_SYS_POKENAV_GET CODE_FLAGS + 2 // third one appears unused -#define SYS_GAME_CLEAR CODE_FLAGS + 4 -#define SYS_CHAT_USED CODE_FLAGS + 5 -#define SYS_HIPSTER_MEET CODE_FLAGS + 6 +#define FLAG_SYS_GAME_CLEAR CODE_FLAGS + 4 +#define FLAG_SYS_CHAT_USED CODE_FLAGS + 5 +#define FLAG_SYS_HIPSTER_MEET CODE_FLAGS + 6 // badges -#define BADGE01_GET CODE_FLAGS + 7 -#define BADGE02_GET CODE_FLAGS + 8 -#define BADGE03_GET CODE_FLAGS + 9 -#define BADGE04_GET CODE_FLAGS + 0xA -#define BADGE05_GET CODE_FLAGS + 0xB -#define BADGE06_GET CODE_FLAGS + 0xC -#define BADGE07_GET CODE_FLAGS + 0xD -#define BADGE08_GET CODE_FLAGS + 0xE +#define FLAG_BADGE01_GET CODE_FLAGS + 7 +#define FLAG_BADGE02_GET CODE_FLAGS + 8 +#define FLAG_BADGE03_GET CODE_FLAGS + 9 +#define FLAG_BADGE04_GET CODE_FLAGS + 0xA +#define FLAG_BADGE05_GET CODE_FLAGS + 0xB +#define FLAG_BADGE06_GET CODE_FLAGS + 0xC +#define FLAG_BADGE07_GET CODE_FLAGS + 0xD +#define FLAG_BADGE08_GET CODE_FLAGS + 0xE // cities and towns #define FLAG_VISITED_LITTLEROOT_TOWN CODE_FLAGS + 0xF @@ -43,66 +43,66 @@ #define FLAG_VISITED_SOOTOPOLIS_CITY CODE_FLAGS + 0x1D #define FLAG_VISITED_EVER_GRANDE_CITY CODE_FLAGS + 0x1E -#define SYS_UNKNOWN_880 CODE_FLAGS + 0x20 +#define FLAG_SYS_UNKNOWN_880 CODE_FLAGS + 0x20 -#define SYS_USE_FLASH CODE_FLAGS + 0x28 -#define SYS_USE_STRENGTH CODE_FLAGS + 0x29 -#define SYS_WEATHER_CTRL CODE_FLAGS + 0x2A -#define SYS_CYCLING_ROAD CODE_FLAGS + 0x2B -#define SYS_SAFARI_MODE CODE_FLAGS + 0x2C -#define SYS_CRUISE_MODE CODE_FLAGS + 0x2D +#define FLAG_SYS_USE_FLASH CODE_FLAGS + 0x28 +#define FLAG_SYS_USE_STRENGTH CODE_FLAGS + 0x29 +#define FLAG_SYS_WEATHER_CTRL CODE_FLAGS + 0x2A +#define FLAG_SYS_CYCLING_ROAD CODE_FLAGS + 0x2B +#define FLAG_SYS_SAFARI_MODE CODE_FLAGS + 0x2C +#define FLAG_SYS_CRUISE_MODE CODE_FLAGS + 0x2D -#define SYS_TV_HOME CODE_FLAGS + 0x30 -#define SYS_TV_WATCH CODE_FLAGS + 0x31 -#define SYS_TV_START CODE_FLAGS + 0x32 -#define SYS_POPWORD_INPUT CODE_FLAGS + 0x33 -#define SYS_MIX_RECORD CODE_FLAGS + 0x34 -#define SYS_CLOCK_SET CODE_FLAGS + 0x35 -#define SYS_NATIONAL_DEX CODE_FLAGS + 0x36 -#define SYS_CAVE_SHIP CODE_FLAGS + 0x37 -#define SYS_CAVE_WONDER CODE_FLAGS + 0x38 -#define SYS_CAVE_BATTLE CODE_FLAGS + 0x39 -#define SYS_SHOAL_TIDE CODE_FLAGS + 0x3A -#define SYS_RIBBON_GET CODE_FLAGS + 0x3B +#define FLAG_SYS_TV_HOME CODE_FLAGS + 0x30 +#define FLAG_SYS_TV_WATCH CODE_FLAGS + 0x31 +#define FLAG_SYS_TV_START CODE_FLAGS + 0x32 +#define FLAG_SYS_POPWORD_INPUT CODE_FLAGS + 0x33 +#define FLAG_SYS_MIX_RECORD CODE_FLAGS + 0x34 +#define FLAG_SYS_CLOCK_SET CODE_FLAGS + 0x35 +#define FLAG_SYS_NATIONAL_DEX CODE_FLAGS + 0x36 +#define FLAG_SYS_CAVE_SHIP CODE_FLAGS + 0x37 +#define FLAG_SYS_CAVE_WONDER CODE_FLAGS + 0x38 +#define FLAG_SYS_CAVE_BATTLE CODE_FLAGS + 0x39 +#define FLAG_SYS_SHOAL_TIDE CODE_FLAGS + 0x3A +#define FLAG_SYS_RIBBON_GET CODE_FLAGS + 0x3B -#define SYS_PC_LANETTE CODE_FLAGS + 0x4B -#define SYS_MYSTERY_EVENT_ENABLE CODE_FLAGS + 0x4C -#define SYS_ENC_UP_ITEM CODE_FLAGS + 0x4D -#define SYS_ENC_DOWN_ITEM CODE_FLAGS + 0x4E -#define SYS_BRAILLE_DIG CODE_FLAGS + 0x4F -#define SYS_BRAILLE_STRENGTH CODE_FLAGS + 0x50 -#define SYS_BRAILLE_WAIT CODE_FLAGS + 0x51 -#define SYS_BRAILLE_FLY CODE_FLAGS + 0x52 -#define SYS_HAS_EON_TICKET CODE_FLAGS + 0x53 +#define FLAG_SYS_PC_LANETTE CODE_FLAGS + 0x4B +#define FLAG_SYS_MYSTERY_EVENT_ENABLE CODE_FLAGS + 0x4C +#define FLAG_SYS_ENC_UP_ITEM CODE_FLAGS + 0x4D +#define FLAG_SYS_ENC_DOWN_ITEM CODE_FLAGS + 0x4E +#define FLAG_SYS_BRAILLE_DIG CODE_FLAGS + 0x4F +#define FLAG_SYS_BRAILLE_STRENGTH CODE_FLAGS + 0x50 +#define FLAG_SYS_BRAILLE_WAIT CODE_FLAGS + 0x51 +#define FLAG_SYS_BRAILLE_FLY CODE_FLAGS + 0x52 +#define FLAG_SYS_HAS_EON_TICKET CODE_FLAGS + 0x53 -#define SYS_POKEMON_LEAGUE_FLY CODE_FLAGS + 0x54 +#define FLAG_SYS_POKEMON_LEAGUE_FLY CODE_FLAGS + 0x54 -#define SYS_TV_LATI CODE_FLAGS + 0x5D +#define FLAG_SYS_TV_LATI CODE_FLAGS + 0x5D -#define SYS_SHOAL_ITEM CODE_FLAGS + 0x5F -#define SYS_B_DASH CODE_FLAGS + 0x60 // got Running Shoes -#define SYS_CTRL_OBJ_DELETE CODE_FLAGS + 0x61 -#define SYS_RESET_RTC_ENABLE CODE_FLAGS + 0x62 +#define FLAG_SYS_SHOAL_ITEM CODE_FLAGS + 0x5F +#define FLAG_SYS_B_DASH CODE_FLAGS + 0x60 // got Running Shoes +#define FLAG_SYS_CTRL_OBJ_DELETE CODE_FLAGS + 0x61 +#define FLAG_SYS_RESET_RTC_ENABLE CODE_FLAGS + 0x62 -#define SYS_TOWER_SILVER CODE_FLAGS + 0x64 -#define SYS_TOWER_GOLD CODE_FLAGS + 0x65 -#define SYS_DOME_SILVER CODE_FLAGS + 0x66 -#define SYS_DOME_GOLD CODE_FLAGS + 0x67 -#define SYS_PALACE_SILVER CODE_FLAGS + 0x68 -#define SYS_PALACE_GOLD CODE_FLAGS + 0x69 -#define SYS_ARENA_SILVER CODE_FLAGS + 0x6A -#define SYS_ARENA_GOLD CODE_FLAGS + 0x6B -#define SYS_FACTORY_SILVER CODE_FLAGS + 0x6C -#define SYS_FACTORY_GOLD CODE_FLAGS + 0x6D -#define SYS_PIKE_SILVER CODE_FLAGS + 0x6E -#define SYS_PIKE_GOLD CODE_FLAGS + 0x6F -#define SYS_PYRAMID_SILVER CODE_FLAGS + 0x70 -#define SYS_PYRAMID_GOLD CODE_FLAGS + 0x71 -#define SYS_FRONTIER_PASS CODE_FLAGS + 0x72 +#define FLAG_SYS_TOWER_SILVER CODE_FLAGS + 0x64 +#define FLAG_SYS_TOWER_GOLD CODE_FLAGS + 0x65 +#define FLAG_SYS_DOME_SILVER CODE_FLAGS + 0x66 +#define FLAG_SYS_DOME_GOLD CODE_FLAGS + 0x67 +#define FLAG_SYS_PALACE_SILVER CODE_FLAGS + 0x68 +#define FLAG_SYS_PALACE_GOLD CODE_FLAGS + 0x69 +#define FLAG_SYS_ARENA_SILVER CODE_FLAGS + 0x6A +#define FLAG_SYS_ARENA_GOLD CODE_FLAGS + 0x6B +#define FLAG_SYS_FACTORY_SILVER CODE_FLAGS + 0x6C +#define FLAG_SYS_FACTORY_GOLD CODE_FLAGS + 0x6D +#define FLAG_SYS_PIKE_SILVER CODE_FLAGS + 0x6E +#define FLAG_SYS_PIKE_GOLD CODE_FLAGS + 0x6F +#define FLAG_SYS_PYRAMID_SILVER CODE_FLAGS + 0x70 +#define FLAG_SYS_PYRAMID_GOLD CODE_FLAGS + 0x71 +#define FLAG_SYS_FRONTIER_PASS CODE_FLAGS + 0x72 -#define SYS_STORAGE_UNKNOWN_FLAG CODE_FLAGS + 0x77 +#define FLAG_SYS_STORAGE_UNKNOWN_FLAG CODE_FLAGS + 0x77 -#define SYS_MYSTERY_GIFT_ENABLE CODE_FLAGS + 0x7B +#define FLAG_SYS_MYSTERY_GIFT_ENABLE CODE_FLAGS + 0x7B // SPECIAL FLAGS (unknown purpose) diff --git a/src/battle_2.c b/src/battle_2.c index 6b7c4063e..bd2899aec 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -511,7 +511,7 @@ static void sub_8036A5C(void) gBattleStruct->field_182 = r6; *(&gBattleStruct->field_183) = r6 >> 8; - gBattleStruct->field_183 |= FlagGet(SYS_FRONTIER_PASS) << 7; + gBattleStruct->field_183 |= FlagGet(FLAG_SYS_FRONTIER_PASS) << 7; } static void SetPlayerBerryDataInBattleStruct(void) @@ -1612,7 +1612,7 @@ void BattleMainCB2(void) if (gMain.heldKeys & B_BUTTON && gBattleTypeFlags & BATTLE_TYPE_RECORDED && sub_8186450()) { - gScriptResult = gBattleOutcome = BATTLE_PLAYER_TELEPORTED; + gSpecialVar_ScriptResult = gBattleOutcome = BATTLE_PLAYER_TELEPORTED; ResetPaletteFadeControl(); BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); SetMainCallback2(CB2_QuitRecordedBattle); @@ -2070,7 +2070,7 @@ static void sub_8038F34(void) if (!gSaveBlock2Ptr->field_CA9_b && i == monsCount) { - if (FlagGet(SYS_FRONTIER_PASS)) + if (FlagGet(FLAG_SYS_FRONTIER_PASS)) { FreeAllWindowBuffers(); SetMainCallback2(sub_80392A8); @@ -4428,7 +4428,7 @@ u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreChosenMoves) // badge boost if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_FRONTIER)) - && FlagGet(BADGE03_GET) + && FlagGet(FLAG_BADGE03_GET) && GetBankSide(bank1) == SIDE_PLAYER) { speedBank1 = (speedBank1 * 110) / 100; @@ -4462,7 +4462,7 @@ u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreChosenMoves) // badge boost if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_FRONTIER)) - && FlagGet(BADGE03_GET) + && FlagGet(FLAG_BADGE03_GET) && GetBankSide(bank2) == SIDE_PLAYER) { speedBank2 = (speedBank2 * 110) / 100; @@ -4751,7 +4751,7 @@ static void HandleEndTurn_BattleWon(void) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) { - gScriptResult = gBattleOutcome; + gSpecialVar_ScriptResult = gBattleOutcome; gBattleTextBuff1[0] = gBattleOutcome; gBankAttacker = GetBankByIdentity(IDENTITY_PLAYER_MON1); gBattlescriptCurrInstr = BattleScript_LinkBattleWonOrLost; @@ -5013,7 +5013,7 @@ static void ReturnFromBattleToOverworld(void) if (gBattleTypeFlags & BATTLE_TYPE_LINK && gReceivedRemoteLinkPlayers != 0) return; - gScriptResult = gBattleOutcome; + gSpecialVar_ScriptResult = gBattleOutcome; gMain.inBattle = 0; gMain.callback1 = gPreBattleCallback1; diff --git a/src/battle_message.c b/src/battle_message.c index aeff721d6..5797650bc 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1907,7 +1907,7 @@ u32 BattleStringExpandPlaceholders(const u8* src, u8* dst) HANDLE_NICKNAME_STRING_CASE(gBattleScripting.bank, *(&gBattleStruct->field_52)) break; case B_TXT_PC_CREATOR_NAME: // lanette pc - if (FlagGet(SYS_PC_LANETTE)) + if (FlagGet(FLAG_SYS_PC_LANETTE)) toCpy = gText_Lanettes; else toCpy = gText_Someones; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 28357d984..784c2e80d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -11160,7 +11160,7 @@ static void atkF0_give_caught_mon(void) gBattleCommunication[MULTISTRING_CHOOSER] = 2; } - if (FlagGet(SYS_PC_LANETTE)) + if (FlagGet(FLAG_SYS_PC_LANETTE)) gBattleCommunication[MULTISTRING_CHOOSER]++; } diff --git a/src/battle_util.c b/src/battle_util.c index 0a0badb33..537bb2793 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3511,16 +3511,16 @@ u8 IsPokeDisobedient(void) return 0; if (!IsOtherTrainer(gBattleMons[gBankAttacker].otId, gBattleMons[gBankAttacker].otName)) return 0; - if (FlagGet(BADGE08_GET)) + if (FlagGet(FLAG_BADGE08_GET)) return 0; obedienceLevel = 10; - if (FlagGet(BADGE02_GET)) + if (FlagGet(FLAG_BADGE02_GET)) obedienceLevel = 30; - if (FlagGet(BADGE04_GET)) + if (FlagGet(FLAG_BADGE04_GET)) obedienceLevel = 50; - if (FlagGet(BADGE06_GET)) + if (FlagGet(FLAG_BADGE06_GET)) obedienceLevel = 70; } diff --git a/src/berry.c b/src/berry.c index 98cf7d932..2d3efa9c6 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1169,7 +1169,7 @@ void FieldObjectInteractionGetBerryTreeData(void) id = FieldObjectGetBerryTreeId(gSelectedMapObject); berry = GetBerryTypeByBerryTreeId(id); ResetBerryTreeSparkleFlag(id); - unk = gScriptLastTalked; + unk = gSpecialVar_ScriptLastTalked; num = gSaveBlock1Ptr->location.mapNum; group = gSaveBlock1Ptr->location.mapGroup; if (sub_8092E9C(unk, num, group)) @@ -1219,7 +1219,7 @@ void FieldObjectInteractionPickBerryTree(void) void FieldObjectInteractionRemoveBerryTree(void) { RemoveBerryTree(FieldObjectGetBerryTreeId(gSelectedMapObject)); - sub_8092EF0(gScriptLastTalked, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); + sub_8092EF0(gSpecialVar_ScriptLastTalked, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); } u8 PlayerHasBerries(void) diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index 9a6f0371c..c8055470a 100755 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -33,7 +33,7 @@ void sub_8179944(void); bool8 ShouldDoBrailleDigEffect(void) { - if (!FlagGet(SYS_BRAILLE_DIG) + if (!FlagGet(FLAG_SYS_BRAILLE_DIG) && (gSaveBlock1Ptr->location.mapGroup == 0x18 && gSaveBlock1Ptr->location.mapNum == 0x47)) { @@ -58,7 +58,7 @@ void DoBrailleDigEffect(void) MapGridSetMetatileIdAt(18, 9, 3636); DrawWholeMapView(); PlaySE(SE_BAN); - FlagSet(SYS_BRAILLE_DIG); + FlagSet(FLAG_SYS_BRAILLE_DIG); ScriptContext2_Disable(); } @@ -81,7 +81,7 @@ bool8 CheckRelicanthWailord(void) void ShouldDoBrailleStrengthEffectOld(void) { /* - if (!FlagGet(SYS_BRAILLE_STRENGTH) && (gSaveBlock1.location.mapGroup == MAP_GROUP_DESERT_RUINS && gSaveBlock1.location.mapNum == MAP_ID_DESERT_RUINS)) + if (!FlagGet(FLAG_SYS_BRAILLE_STRENGTH) && (gSaveBlock1.location.mapGroup == MAP_GROUP_DESERT_RUINS && gSaveBlock1.location.mapNum == MAP_ID_DESERT_RUINS)) { if (gSaveBlock1.pos.x == 10 && gSaveBlock1.pos.y == 23) return TRUE; @@ -105,13 +105,13 @@ void DoBrailleStrengthEffect(void) MapGridSetMetatileIdAt(16, 27, 3636); DrawWholeMapView(); PlaySE(SE_BAN); - FlagSet(SYS_BRAILLE_STRENGTH); + FlagSet(FLAG_SYS_BRAILLE_STRENGTH); ScriptContext2_Disable(); } bool8 ShouldDoBrailleFlyEffect(void) { - if (!FlagGet(SYS_BRAILLE_FLY) && (gSaveBlock1.location.mapGroup == MAP_GROUP_ANCIENT_TOMB && gSaveBlock1.location.mapNum == MAP_ID_ANCIENT_TOMB)) + if (!FlagGet(FLAG_SYS_BRAILLE_FLY) && (gSaveBlock1.location.mapGroup == MAP_GROUP_ANCIENT_TOMB && gSaveBlock1.location.mapNum == MAP_ID_ANCIENT_TOMB)) { if (gSaveBlock1.pos.x == 8 && gSaveBlock1.pos.y == 25) return TRUE; @@ -151,7 +151,7 @@ void UseFlyAncientTomb_Finish(void) MapGridSetMetatileIdAt(16, 27, 3636); DrawWholeMapView(); PlaySE(SE_BAN); - FlagSet(SYS_BRAILLE_FLY); + FlagSet(FLAG_SYS_BRAILLE_FLY); ScriptContext2_Disable(); } */ @@ -205,7 +205,7 @@ void SealedChamberShakingEffect(u8 taskId) // moved later in the function because it was rewritten. bool8 ShouldDoBrailleStrengthEffect(void) { - if (!FlagGet(SYS_BRAILLE_STRENGTH) && (gSaveBlock1Ptr->location.mapGroup == 0x18 && gSaveBlock1Ptr->location.mapNum == 0x06)) + if (!FlagGet(FLAG_SYS_BRAILLE_STRENGTH) && (gSaveBlock1Ptr->location.mapGroup == 0x18 && gSaveBlock1Ptr->location.mapNum == 0x06)) { if (gSaveBlock1Ptr->pos.x == 6 && gSaveBlock1Ptr->pos.y == 23) { gBraillePuzzleCallbackFlag = STRENGTH_PUZZLE; return TRUE; } @@ -240,13 +240,13 @@ void sub_8179860(void) MapGridSetMetatileIdAt(16, 27, 3636); DrawWholeMapView(); PlaySE(SE_BAN); - FlagSet(SYS_BRAILLE_STRENGTH); + FlagSet(FLAG_SYS_BRAILLE_STRENGTH); ScriptContext2_Disable(); } bool8 ShouldDoBrailleFlyEffect(void) { - if (!FlagGet(SYS_BRAILLE_FLY) && (gSaveBlock1Ptr->location.mapGroup == 0x18 && gSaveBlock1Ptr->location.mapNum == 0x44)) + if (!FlagGet(FLAG_SYS_BRAILLE_FLY) && (gSaveBlock1Ptr->location.mapGroup == 0x18 && gSaveBlock1Ptr->location.mapNum == 0x44)) { if (gSaveBlock1Ptr->pos.x == 8 && gSaveBlock1Ptr->pos.y == 25) { gBraillePuzzleCallbackFlag = FLY_PUZZLE; return TRUE; } @@ -276,7 +276,7 @@ void sub_8179944(void) MapGridSetMetatileIdAt(16, 27, 3636); DrawWholeMapView(); PlaySE(SE_BAN); - FlagSet(SYS_BRAILLE_FLY); + FlagSet(FLAG_SYS_BRAILLE_FLY); ScriptContext2_Disable(); } @@ -284,7 +284,7 @@ void sub_8179944(void) void DoBrailleWait(void) { /* - if (!FlagGet(SYS_BRAILLE_WAIT)) + if (!FlagGet(FLAG_SYS_BRAILLE_WAIT)) CreateTask(Task_BrailleWait, 0x50); } @@ -387,7 +387,7 @@ bool8 ShouldDoBrailleRegicePuzzle(void) if (gSaveBlock1Ptr->location.mapGroup == 0x18 && gSaveBlock1Ptr->location.mapNum == 0x43) { // _08179A1A - if (FlagGet(SYS_BRAILLE_WAIT) != FALSE) + if (FlagGet(FLAG_SYS_BRAILLE_WAIT) != FALSE) return FALSE; if (FlagGet(2) == FALSE) return FALSE; diff --git a/src/calculate_base_damage.c b/src/calculate_base_damage.c index 8996059f9..89770b17a 100644 --- a/src/calculate_base_damage.c +++ b/src/calculate_base_damage.c @@ -84,13 +84,13 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de if (attacker->ability == ABILITY_HUGE_POWER || attacker->ability == ABILITY_PURE_POWER) attack *= 2; - if (ShouldGetStatBadgeBoost(BADGE01_GET, bankAtk)) + if (ShouldGetStatBadgeBoost(FLAG_BADGE01_GET, bankAtk)) attack = (110 * attack) / 100; - if (ShouldGetStatBadgeBoost(BADGE05_GET, bankDef)) + if (ShouldGetStatBadgeBoost(FLAG_BADGE05_GET, bankDef)) defense = (110 * defense) / 100; - if (ShouldGetStatBadgeBoost(BADGE07_GET, bankAtk)) + if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, bankAtk)) spAttack = (110 * spAttack) / 100; - if (ShouldGetStatBadgeBoost(BADGE07_GET, bankDef)) + if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, bankDef)) spDefense = (110 * spDefense) / 100; for (i = 0; i < 17; i++) diff --git a/src/decoration.c b/src/decoration.c index 0179d36a1..5396a125c 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -2133,10 +2133,10 @@ void sub_8129708(void) u16 i; gSpecialVar_0x8005 = 0; - gScriptResult = 0; + gSpecialVar_ScriptResult = 0; if (gSpecialVar_0x8004 == sCurDecorSelectedInRearrangement) { - gScriptResult = 1; + gSpecialVar_ScriptResult = 1; } else if (gDecorations[gUnknown_0203A17C.items[sDecorRearrangementDataBuffer[gSpecialVar_0x8004].idx]].permission == DECORPERM_SOLID_MAT) { diff --git a/src/event_data.c b/src/event_data.c index 19a310db5..88cf4dedc 100644 --- a/src/event_data.c +++ b/src/event_data.c @@ -17,11 +17,11 @@ EWRAM_DATA u16 gSpecialVar_0x8008 = 0; EWRAM_DATA u16 gSpecialVar_0x8009 = 0; EWRAM_DATA u16 gSpecialVar_0x800A = 0; EWRAM_DATA u16 gSpecialVar_0x800B = 0; -EWRAM_DATA u16 gScriptResult = 0; -EWRAM_DATA u16 gScriptLastTalked = 0; -EWRAM_DATA u16 gScriptFacing = 0; -EWRAM_DATA u16 gSpecialVar_0x8012 = 0; -EWRAM_DATA u16 gSpecialVar_0x8013 = 0; +EWRAM_DATA u16 gSpecialVar_ScriptResult = 0; +EWRAM_DATA u16 gSpecialVar_ScriptLastTalked = 0; +EWRAM_DATA u16 gSpecialVar_ScriptFacing = 0; +EWRAM_DATA u16 gSpecialVar_MonBoxId = 0; +EWRAM_DATA u16 gSpecialVar_MonBoxPos = 0; EWRAM_DATA u16 gSpecialVar_0x8014 = 0; EWRAM_DATA static u8 gUnknown_020375FC[16] = {0}; @@ -40,11 +40,11 @@ void ClearTempFieldEventData(void) { memset(gSaveBlock1Ptr->flags, 0, TEMP_FLAGS_SIZE); memset(gSaveBlock1Ptr->vars, 0, TEMP_VARS_SIZE); - FlagClear(SYS_ENC_UP_ITEM); - FlagClear(SYS_ENC_DOWN_ITEM); - FlagClear(SYS_USE_STRENGTH); - FlagClear(SYS_CTRL_OBJ_DELETE); - FlagClear(SYS_UNKNOWN_880); + FlagClear(FLAG_SYS_ENC_UP_ITEM); + FlagClear(FLAG_SYS_ENC_DOWN_ITEM); + FlagClear(FLAG_SYS_USE_STRENGTH); + FlagClear(FLAG_SYS_CTRL_OBJ_DELETE); + FlagClear(FLAG_SYS_UNKNOWN_880); } // probably had different flag splits at one point. @@ -58,7 +58,7 @@ void DisableNationalPokedex(void) u16 *nationalDexVar = GetVarPointer(VAR_NATIONAL_DEX); gSaveBlock2Ptr->pokedex.nationalMagic = 0; *nationalDexVar = 0; - FlagClear(SYS_NATIONAL_DEX); + FlagClear(FLAG_SYS_NATIONAL_DEX); } void EnableNationalPokedex(void) @@ -66,7 +66,7 @@ void EnableNationalPokedex(void) u16 *nationalDexVar = GetVarPointer(VAR_NATIONAL_DEX); gSaveBlock2Ptr->pokedex.nationalMagic = 0xDA; *nationalDexVar = 0x302; - FlagSet(SYS_NATIONAL_DEX); + FlagSet(FLAG_SYS_NATIONAL_DEX); gSaveBlock2Ptr->pokedex.unknown1 = 1; gSaveBlock2Ptr->pokedex.order = 0; sub_80BB358(); @@ -74,7 +74,7 @@ void EnableNationalPokedex(void) bool32 IsNationalPokedexEnabled(void) { - if (gSaveBlock2Ptr->pokedex.nationalMagic == 0xDA && VarGet(VAR_NATIONAL_DEX) == 0x302 && FlagGet(SYS_NATIONAL_DEX)) + if (gSaveBlock2Ptr->pokedex.nationalMagic == 0xDA && VarGet(VAR_NATIONAL_DEX) == 0x302 && FlagGet(FLAG_SYS_NATIONAL_DEX)) return TRUE; else return FALSE; @@ -82,32 +82,32 @@ bool32 IsNationalPokedexEnabled(void) void DisableMysteryEvent(void) { - FlagClear(SYS_MYSTERY_EVENT_ENABLE); + FlagClear(FLAG_SYS_MYSTERY_EVENT_ENABLE); } void EnableMysteryEvent(void) { - FlagSet(SYS_MYSTERY_EVENT_ENABLE); + FlagSet(FLAG_SYS_MYSTERY_EVENT_ENABLE); } bool32 IsMysteryEventEnabled(void) { - return FlagGet(SYS_MYSTERY_EVENT_ENABLE); + return FlagGet(FLAG_SYS_MYSTERY_EVENT_ENABLE); } void DisableMysteryGift(void) { - FlagClear(SYS_MYSTERY_GIFT_ENABLE); + FlagClear(FLAG_SYS_MYSTERY_GIFT_ENABLE); } void EnableMysteryGift(void) { - FlagSet(SYS_MYSTERY_GIFT_ENABLE); + FlagSet(FLAG_SYS_MYSTERY_GIFT_ENABLE); } bool32 IsMysteryGiftEnabled(void) { - return FlagGet(SYS_MYSTERY_GIFT_ENABLE); + return FlagGet(FLAG_SYS_MYSTERY_GIFT_ENABLE); } void sub_809D4D8(void) @@ -145,18 +145,18 @@ void sub_809D570(void) void DisableResetRTC(void) { VarSet(VAR_RESET_RTC_ENABLE, 0); - FlagClear(SYS_RESET_RTC_ENABLE); + FlagClear(FLAG_SYS_RESET_RTC_ENABLE); } void EnableResetRTC(void) { VarSet(VAR_RESET_RTC_ENABLE, 0x920); - FlagSet(SYS_RESET_RTC_ENABLE); + FlagSet(FLAG_SYS_RESET_RTC_ENABLE); } bool32 CanResetRTC(void) { - if (FlagGet(SYS_RESET_RTC_ENABLE) && VarGet(VAR_RESET_RTC_ENABLE) == 0x920) + if (FlagGet(FLAG_SYS_RESET_RTC_ENABLE) && VarGet(VAR_RESET_RTC_ENABLE) == 0x920) return TRUE; else return FALSE; diff --git a/src/field_special_scene.c b/src/field_special_scene.c index 54c1d8144..f92f342eb 100755 --- a/src/field_special_scene.c +++ b/src/field_special_scene.c @@ -354,7 +354,7 @@ void sub_80FB768(void) void sub_80FB7A4(void) { - FlagSet(SYS_CRUISE_MODE); + FlagSet(FLAG_SYS_CRUISE_MODE); FlagSet(0x4001); FlagSet(0x4000); saved_warp2_set(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); diff --git a/src/item.c b/src/item.c index 0114676b6..a684ea6f0 100644 --- a/src/item.c +++ b/src/item.c @@ -165,11 +165,11 @@ bool8 HasAtLeastOneBerry(void) { if (CheckBagHasItem(i, 1) == TRUE) { - gScriptResult = 1; + gSpecialVar_ScriptResult = 1; return TRUE; } } - gScriptResult = 0; + gSpecialVar_ScriptResult = 0; return FALSE; } diff --git a/src/lilycove_lady.c b/src/lilycove_lady.c index 3b7ae49f2..f7ec5dbaf 100644 --- a/src/lilycove_lady.c +++ b/src/lilycove_lady.c @@ -242,11 +242,11 @@ void sub_818D9C0(void) { lilycoveLady = &gSaveBlock1Ptr->lilycoveLady; VarSet(VAR_0x4011, gUnknown_0860B074[lilycoveLady->contest.category]); - gScriptResult = TRUE; + gSpecialVar_ScriptResult = TRUE; } else { - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; } } @@ -308,7 +308,7 @@ void SetLilycoveLadyRandomly(void) void sub_818DAEC(void) { - gScriptResult = GetLilycoveLadyId(); + gSpecialVar_ScriptResult = GetLilycoveLadyId(); } static u8 sub_818DB04(const u16 *data) diff --git a/src/lottery_corner.c b/src/lottery_corner.c index 3939f7d7f..7c8c32189 100644 --- a/src/lottery_corner.c +++ b/src/lottery_corner.c @@ -42,7 +42,7 @@ void SetRandomLotteryNumber(u16 i) void RetrieveLotteryNumber(void) { u16 lottoNumber = GetLotteryNumber(); - gScriptResult = lottoNumber; + gSpecialVar_ScriptResult = lottoNumber; } void PickLotteryCornerTicket(void) @@ -66,7 +66,7 @@ void PickLotteryCornerTicket(void) if (!GetMonData(pkmn, MON_DATA_IS_EGG)) { u32 otId = GetMonData(pkmn, MON_DATA_OT_ID); - u8 numMatchingDigits = GetMatchingDigits(gScriptResult, otId); + u8 numMatchingDigits = GetMatchingDigits(gSpecialVar_ScriptResult, otId); if (numMatchingDigits > gSpecialVar_0x8004 && numMatchingDigits > 1) { @@ -90,7 +90,7 @@ void PickLotteryCornerTicket(void) !GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_IS_EGG)) { u32 otId = GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_OT_ID); - u8 numMatchingDigits = GetMatchingDigits(gScriptResult, otId); + u8 numMatchingDigits = GetMatchingDigits(gSpecialVar_ScriptResult, otId); if (numMatchingDigits > gSpecialVar_0x8004 && numMatchingDigits > 1) { diff --git a/src/pokemon_2.c b/src/pokemon_2.c index 587773836..3802cc5eb 100644 --- a/src/pokemon_2.c +++ b/src/pokemon_2.c @@ -1086,10 +1086,10 @@ u8 SendMonToPC(struct Pokemon* mon) { MonRestorePP(mon); CopyMon(checkingMon, &mon->box, sizeof(mon->box)); - gSpecialVar_0x8012 = boxNo; - gSpecialVar_0x8013 = boxPos; + gSpecialVar_MonBoxId = boxNo; + gSpecialVar_MonBoxPos = boxPos; if (get_unknown_box_id() != boxNo) - FlagClear(SYS_STORAGE_UNKNOWN_FLAG); + FlagClear(FLAG_SYS_STORAGE_UNKNOWN_FLAG); VarSet(VAR_STORAGE_UNKNOWN, boxNo); return MON_GIVEN_TO_PC; } diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c index 1758fba32..e138b86c8 100644 --- a/src/pokemon_size_record.c +++ b/src/pokemon_size_record.c @@ -109,13 +109,13 @@ static void FormatMonSizeRecord(u8 *string, u32 size) static u8 CompareMonSize(u16 species, u16 *sizeRecord) { - if (gScriptResult == 0xFF) + if (gSpecialVar_ScriptResult == 0xFF) { return 0; } else { - struct Pokemon *pkmn = &gPlayerParty[gScriptResult]; + struct Pokemon *pkmn = &gPlayerParty[gSpecialVar_ScriptResult]; if (GetMonData(pkmn, MON_DATA_IS_EGG) == TRUE || GetMonData(pkmn, MON_DATA_SPECIES) != species) { @@ -173,7 +173,7 @@ void CompareSeedotSize(void) { u16 *sizeRecord = GetVarPointer(VAR_SEEDOT_SIZE_RECORD); - gScriptResult = CompareMonSize(SPECIES_SEEDOT, sizeRecord); + gSpecialVar_ScriptResult = CompareMonSize(SPECIES_SEEDOT, sizeRecord); } void InitLotadSizeRecord(void) @@ -192,7 +192,7 @@ void CompareLotadSize(void) { u16 *sizeRecord = GetVarPointer(VAR_LOTAD_SIZE_RECORD); - gScriptResult = CompareMonSize(SPECIES_LOTAD, sizeRecord); + gSpecialVar_ScriptResult = CompareMonSize(SPECIES_LOTAD, sizeRecord); } void GiveGiftRibbonToParty(u8 index, u8 ribbonId) @@ -217,6 +217,6 @@ void GiveGiftRibbonToParty(u8 index, u8 ribbonId) } } if (gotRibbon) - FlagSet(SYS_RIBBON_GET); + FlagSet(FLAG_SYS_RIBBON_GET); } } diff --git a/src/safari_zone.c b/src/safari_zone.c index 77c6bbd61..a493dd13f 100644 --- a/src/safari_zone.c +++ b/src/safari_zone.c @@ -50,17 +50,17 @@ static void DecrementFeederStepCounters(void); bool32 GetSafariZoneFlag(void) { - return FlagGet(SYS_SAFARI_MODE); + return FlagGet(FLAG_SYS_SAFARI_MODE); } void SetSafariZoneFlag(void) { - FlagSet(SYS_SAFARI_MODE); + FlagSet(FLAG_SYS_SAFARI_MODE); } void ResetSafariZoneFlag(void) { - FlagClear(SYS_SAFARI_MODE); + FlagClear(FLAG_SYS_SAFARI_MODE); } void EnterSafariMode(void) @@ -152,13 +152,13 @@ void GetPokeblockFeederInFront(void) && sPokeblockFeeders[i].x == x && sPokeblockFeeders[i].y == y) { - gScriptResult = i; + gSpecialVar_ScriptResult = i; StringCopy(gStringVar1, gPokeblockNames[sPokeblockFeeders[i].pokeblock.color]); return; } } - gScriptResult = -1; + gSpecialVar_ScriptResult = -1; } void GetPokeblockFeederWithinRange(void) @@ -181,13 +181,13 @@ void GetPokeblockFeederWithinRange(void) y *= -1; if ((x + y) <= 5) { - gScriptResult = i; + gSpecialVar_ScriptResult = i; return; } } } - gScriptResult = -1; + gSpecialVar_ScriptResult = -1; } // unused @@ -195,20 +195,20 @@ struct Pokeblock *SafariZoneGetPokeblockInFront(void) { GetPokeblockFeederInFront(); - if (gScriptResult == 0xFFFF) + if (gSpecialVar_ScriptResult == 0xFFFF) return NULL; else - return &sPokeblockFeeders[gScriptResult].pokeblock; + return &sPokeblockFeeders[gSpecialVar_ScriptResult].pokeblock; } struct Pokeblock *SafariZoneGetActivePokeblock(void) { GetPokeblockFeederWithinRange(); - if (gScriptResult == 0xFFFF) + if (gSpecialVar_ScriptResult == 0xFFFF) return NULL; else - return &sPokeblockFeeders[gScriptResult].pokeblock; + return &sPokeblockFeeders[gSpecialVar_ScriptResult].pokeblock; } void SafariZoneActivatePokeblockFeeder(u8 pkblId) @@ -255,13 +255,13 @@ bool8 GetInFrontFeederPokeblockAndSteps(void) { GetPokeblockFeederInFront(); - if (gScriptResult == 0xFFFF) + if (gSpecialVar_ScriptResult == 0xFFFF) { return FALSE; } ConvertIntToDecimalStringN(gStringVar2, - sPokeblockFeeders[gScriptResult].stepCounter, + sPokeblockFeeders[gSpecialVar_ScriptResult].stepCounter, STR_CONV_MODE_LEADING_ZEROS, 3); return TRUE; diff --git a/src/scrcmd.c b/src/scrcmd.c index 219dfebd0..4fa88f359 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -69,7 +69,7 @@ extern u16 gSpecialVar_0x8001; extern u16 gSpecialVar_0x8002; extern u16 gSpecialVar_0x8004; -extern u16 gScriptResult; +extern u16 gSpecialVar_ScriptResult; extern u16 gScriptContestCategory; @@ -491,7 +491,7 @@ bool8 ScrCmd_random(struct ScriptContext *ctx) { u16 max = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = Random() % max; + gSpecialVar_ScriptResult = Random() % max; return FALSE; } @@ -500,7 +500,7 @@ bool8 ScrCmd_giveitem(struct ScriptContext *ctx) u16 itemId = VarGet(ScriptReadHalfword(ctx)); u32 quantity = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = AddBagItem(itemId, (u8)quantity); + gSpecialVar_ScriptResult = AddBagItem(itemId, (u8)quantity); return FALSE; } @@ -509,7 +509,7 @@ bool8 ScrCmd_takeitem(struct ScriptContext *ctx) u16 itemId = VarGet(ScriptReadHalfword(ctx)); u32 quantity = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = RemoveBagItem(itemId, (u8)quantity); + gSpecialVar_ScriptResult = RemoveBagItem(itemId, (u8)quantity); return FALSE; } @@ -518,7 +518,7 @@ bool8 ScrCmd_checkitemspace(struct ScriptContext *ctx) u16 itemId = VarGet(ScriptReadHalfword(ctx)); u32 quantity = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = CheckBagHasSpace(itemId, (u8)quantity); + gSpecialVar_ScriptResult = CheckBagHasSpace(itemId, (u8)quantity); return FALSE; } @@ -527,7 +527,7 @@ bool8 ScrCmd_checkitem(struct ScriptContext *ctx) u16 itemId = VarGet(ScriptReadHalfword(ctx)); u32 quantity = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = CheckBagHasItem(itemId, (u8)quantity); + gSpecialVar_ScriptResult = CheckBagHasItem(itemId, (u8)quantity); return FALSE; } @@ -535,7 +535,7 @@ bool8 ScrCmd_checkitemtype(struct ScriptContext *ctx) { u16 itemId = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = GetPocketByItemId(itemId); + gSpecialVar_ScriptResult = GetPocketByItemId(itemId); return FALSE; } @@ -544,7 +544,7 @@ bool8 ScrCmd_givepcitem(struct ScriptContext *ctx) u16 itemId = VarGet(ScriptReadHalfword(ctx)); u16 quantity = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = AddPCItem(itemId, quantity); + gSpecialVar_ScriptResult = AddPCItem(itemId, quantity); return FALSE; } @@ -553,7 +553,7 @@ bool8 ScrCmd_checkpcitem(struct ScriptContext *ctx) u16 itemId = VarGet(ScriptReadHalfword(ctx)); u16 quantity = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = CheckPCHasItem(itemId, quantity); + gSpecialVar_ScriptResult = CheckPCHasItem(itemId, quantity); return FALSE; } @@ -561,7 +561,7 @@ bool8 ScrCmd_givedecoration(struct ScriptContext *ctx) { u32 decorId = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = DecorationAdd(decorId); + gSpecialVar_ScriptResult = DecorationAdd(decorId); return FALSE; } @@ -569,7 +569,7 @@ bool8 ScrCmd_takedecoration(struct ScriptContext *ctx) { u32 decorId = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = DecorationRemove(decorId); + gSpecialVar_ScriptResult = DecorationRemove(decorId); return FALSE; } @@ -577,7 +577,7 @@ bool8 ScrCmd_checkdecorspace(struct ScriptContext *ctx) { u32 decorId = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = DecorationCheckSpace(decorId); + gSpecialVar_ScriptResult = DecorationCheckSpace(decorId); return FALSE; } @@ -585,7 +585,7 @@ bool8 ScrCmd_checkdecor(struct ScriptContext *ctx) { u32 decorId = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = CheckHasDecoration(decorId); + gSpecialVar_ScriptResult = CheckHasDecoration(decorId); return FALSE; } @@ -909,7 +909,7 @@ bool8 ScrCmd_getplayerxy(struct ScriptContext *ctx) bool8 ScrCmd_getpartysize(struct ScriptContext *ctx) { - gScriptResult = CalculatePlayerPartyCount(); + gSpecialVar_ScriptResult = CalculatePlayerPartyCount(); return FALSE; } @@ -1835,7 +1835,7 @@ bool8 ScrCmd_givemon(struct ScriptContext *ctx) u32 unkParam2 = ScriptReadWord(ctx); u8 unkParam3 = ScriptReadByte(ctx); - gScriptResult = ScriptGiveMon(species, level, item, unkParam1, unkParam2, unkParam3); + gSpecialVar_ScriptResult = ScriptGiveMon(species, level, item, unkParam1, unkParam2, unkParam3); return FALSE; } @@ -1843,7 +1843,7 @@ bool8 ScrCmd_giveegg(struct ScriptContext *ctx) { u16 species = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = ScriptGiveEgg(species); + gSpecialVar_ScriptResult = ScriptGiveEgg(species); return FALSE; } @@ -1862,7 +1862,7 @@ bool8 ScrCmd_checkpartymove(struct ScriptContext *ctx) u8 i; u16 moveId = ScriptReadHalfword(ctx); - gScriptResult = 6; + gSpecialVar_ScriptResult = 6; for (i = 0; i < 6; i++) { u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL); @@ -1871,7 +1871,7 @@ bool8 ScrCmd_checkpartymove(struct ScriptContext *ctx) // UB: GetMonData() arguments don't match function definition if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG) && pokemon_has_move(&gPlayerParty[i], moveId) == TRUE) { - gScriptResult = i; + gSpecialVar_ScriptResult = i; gSpecialVar_0x8004 = species; break; } @@ -1905,7 +1905,7 @@ bool8 ScrCmd_checkmoney(struct ScriptContext *ctx) u8 ignore = ScriptReadByte(ctx); if (!ignore) - gScriptResult = IsEnoughMoney(&gSaveBlock1Ptr->money, amount); + gSpecialVar_ScriptResult = IsEnoughMoney(&gSaveBlock1Ptr->money, amount); return FALSE; } @@ -2085,7 +2085,7 @@ bool8 ScrCmd_getpricereduction(struct ScriptContext *ctx) { u16 value = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = GetPriceReduction(value); + gSpecialVar_ScriptResult = GetPriceReduction(value); return FALSE; } @@ -2160,7 +2160,7 @@ bool8 ScrCmd_setrespawn(struct ScriptContext *ctx) bool8 ScrCmd_checkplayergender(struct ScriptContext *ctx) { - gScriptResult = gSaveBlock2Ptr->playerGender; + gSpecialVar_ScriptResult = gSaveBlock2Ptr->playerGender; return FALSE; } @@ -2285,9 +2285,9 @@ bool8 ScrCmd_givecoins(struct ScriptContext *ctx) u16 coins = VarGet(ScriptReadHalfword(ctx)); if (GiveCoins(coins) == TRUE) - gScriptResult = 0; + gSpecialVar_ScriptResult = 0; else - gScriptResult = 1; + gSpecialVar_ScriptResult = 1; return FALSE; } @@ -2296,9 +2296,9 @@ bool8 ScrCmd_takecoins(struct ScriptContext *ctx) u16 coins = VarGet(ScriptReadHalfword(ctx)); if (TakeCoins(coins) == TRUE) - gScriptResult = 0; + gSpecialVar_ScriptResult = 0; else - gScriptResult = 1; + gSpecialVar_ScriptResult = 1; return FALSE; } @@ -2367,7 +2367,7 @@ bool8 ScrCmd_checkmonobedience(struct ScriptContext *ctx) { u16 partyIndex = VarGet(ScriptReadHalfword(ctx)); - gScriptResult = GetMonData(&gPlayerParty[partyIndex], MON_DATA_OBEDIENCE, NULL); + gSpecialVar_ScriptResult = GetMonData(&gPlayerParty[partyIndex], MON_DATA_OBEDIENCE, NULL); return FALSE; } diff --git a/src/start_menu.c b/src/start_menu.c index 37331a922..f45fd8626 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -74,12 +74,12 @@ void AddStartMenuAction(u8 action) static void BuildStartMenuActions_Normal(void) { - if (FlagGet(SYS_POKEDEX_GET) == TRUE) + if (FlagGet(FLAG_SYS_POKEDEX_GET) == TRUE) AddStartMenuAction(MENU_ACTION_POKEDEX); - if (FlagGet(SYS_POKEMON_GET) == TRUE) + if (FlagGet(FLAG_SYS_POKEMON_GET) == TRUE) AddStartMenuAction(MENU_ACTION_POKEMON); AddStartMenuAction(MENU_ACTION_BAG); - if (FlagGet(SYS_POKENAV_GET) == TRUE) + if (FlagGet(FLAG_SYS_POKENAV_GET) == TRUE) AddStartMenuAction(MENU_ACTION_POKENAV); AddStartMenuAction(MENU_ACTION_PLAYER); AddStartMenuAction(MENU_ACTION_SAVE); @@ -102,7 +102,7 @@ static void BuildStartMenuActions_LinkMode(void) { AddStartMenuAction(MENU_ACTION_POKEMON); AddStartMenuAction(MENU_ACTION_BAG); - if (FlagGet(SYS_POKENAV_GET) == TRUE) + if (FlagGet(FLAG_SYS_POKENAV_GET) == TRUE) AddStartMenuAction(MENU_ACTION_POKENAV); AddStartMenuAction(MENU_ACTION_PLAYER_LINK); AddStartMenuAction(MENU_ACTION_OPTION); @@ -113,7 +113,7 @@ static void BuildStartMenuActions_UnionRoom(void) { AddStartMenuAction(MENU_ACTION_POKEMON); AddStartMenuAction(MENU_ACTION_BAG); - if (FlagGet(SYS_POKENAV_GET) == TRUE) + if (FlagGet(FLAG_SYS_POKENAV_GET) == TRUE) AddStartMenuAction(MENU_ACTION_POKENAV); AddStartMenuAction(MENU_ACTION_PLAYER); AddStartMenuAction(MENU_ACTION_OPTION); diff --git a/src/tv.c b/src/tv.c index 3c822b394..3601f7a10 100644 --- a/src/tv.c +++ b/src/tv.c @@ -214,23 +214,23 @@ const struct { // TODO: Figure out what these are, and define constants in include/flags.h const u16 sGoldSymbolFlags[] = { - SYS_TOWER_GOLD, - SYS_DOME_GOLD, - SYS_PALACE_GOLD, - SYS_ARENA_GOLD, - SYS_FACTORY_GOLD, - SYS_PIKE_GOLD, - SYS_PYRAMID_GOLD + FLAG_SYS_TOWER_GOLD, + FLAG_SYS_DOME_GOLD, + FLAG_SYS_PALACE_GOLD, + FLAG_SYS_ARENA_GOLD, + FLAG_SYS_FACTORY_GOLD, + FLAG_SYS_PIKE_GOLD, + FLAG_SYS_PYRAMID_GOLD }; const u16 sSilverSymbolFlags[] = { - SYS_TOWER_SILVER, - SYS_DOME_SILVER, - SYS_PALACE_SILVER, - SYS_ARENA_SILVER, - SYS_FACTORY_SILVER, - SYS_PIKE_SILVER, - SYS_PYRAMID_SILVER + FLAG_SYS_TOWER_SILVER, + FLAG_SYS_DOME_SILVER, + FLAG_SYS_PALACE_SILVER, + FLAG_SYS_ARENA_SILVER, + FLAG_SYS_FACTORY_SILVER, + FLAG_SYS_PIKE_SILVER, + FLAG_SYS_PYRAMID_SILVER }; // TODO: Figure out what these are, and define constants in include/vars.h @@ -823,7 +823,7 @@ u8 FindAnyTVShowOnTheAir(void) void UpdateTVScreensOnMap(int width, int height) { - FlagSet(SYS_TV_WATCH); + FlagSet(FLAG_SYS_TV_WATCH); switch (CheckForBigMovieOrEmergencyNewsOnTV()) { case 1: @@ -836,9 +836,9 @@ void UpdateTVScreensOnMap(int width, int height) { SetTVMetatilesOnMap(width, height, 0x3); } - else if (FlagGet(SYS_TV_START) && (FindAnyTVShowOnTheAir() != 0xff || FindAnyTVNewsOnTheAir() != 0xff || IsTVShowInSearchOfTrainersAiring())) + else if (FlagGet(FLAG_SYS_TV_START) && (FindAnyTVShowOnTheAir() != 0xff || FindAnyTVNewsOnTheAir() != 0xff || IsTVShowInSearchOfTrainersAiring())) { - FlagClear(SYS_TV_WATCH); + FlagClear(FLAG_SYS_TV_WATCH); SetTVMetatilesOnMap(width, height, 0x3); } break; @@ -1288,7 +1288,7 @@ void PutBattleUpdateOnTheAir(u8 a0, u16 a1, u16 a2, u16 a3) if (sCurTVShowSlot != -1) { FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_BATTLE_UPDATE); - if (gScriptResult != 1) + if (gSpecialVar_ScriptResult != 1) { show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; show->battleUpdate.kind = TVSHOW_BATTLE_UPDATE; @@ -1337,7 +1337,7 @@ bool8 Put3CheersForPokeblocksOnTheAir(const u8 *partnersName, u8 flavor, u8 unus return FALSE; } FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_3_CHEERS_FOR_POKEBLOCKS); - if (gScriptResult == 1) + if (gSpecialVar_ScriptResult == 1) { return FALSE; } @@ -1606,7 +1606,7 @@ void PutNameRaterShowOnTheAir(void) TVShow *show; InterviewBefore_NameRater(); - if (gScriptResult != 1) + if (gSpecialVar_ScriptResult != 1) { GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar1); if (StringLength(gSaveBlock2Ptr->playerName) > 1 && StringLength(gStringVar1) > 1) @@ -1653,7 +1653,7 @@ void PutLilycoveContestLadyShowOnTheAir(void) TVShow *show; sub_80EFA88(); - if (gScriptResult != TRUE) + if (gSpecialVar_ScriptResult != TRUE) { show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; sub_818E848(&show->contestLiveUpdates2.language); @@ -1731,7 +1731,7 @@ void sub_80ED718(void) u16 outbreakIdx; TVShow *show; - if (FlagGet(SYS_GAME_CLEAR)) + if (FlagGet(FLAG_SYS_GAME_CLEAR)) { for (i = 0; i < 24; i ++) { @@ -1943,7 +1943,7 @@ void sub_80EDB44(void) show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; show->rivalTrainer.kind = TVSHOW_TODAYS_RIVAL_TRAINER; show->rivalTrainer.active = FALSE; - for (i = BADGE01_GET, nBadges = 0; i < BADGE01_GET + 8; i ++) + for (i = FLAG_BADGE01_GET, nBadges = 0; i < FLAG_BADGE01_GET + 8; i ++) { if (FlagGet(i)) { @@ -2613,7 +2613,7 @@ bool8 sub_80EE7C0(void) return TRUE; } FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_FAN_CLUB_SPECIAL); - if (gScriptResult == TRUE) + if (gSpecialVar_ScriptResult == TRUE) { return TRUE; } @@ -2814,7 +2814,7 @@ void sub_80EED88(void) { u8 newsKind; - if (FlagGet(SYS_GAME_CLEAR)) + if (FlagGet(FLAG_SYS_GAME_CLEAR)) { sCurTVShowSlot = sub_80EEE30(gSaveBlock1Ptr->pokeNews); if (sCurTVShowSlot != -1 && rbernoulli(1, 100) != TRUE) @@ -2905,7 +2905,7 @@ void DoPokeNews(void) i = FindAnyTVNewsOnTheAir(); if (i == 0xFF) { - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; } else { @@ -2928,7 +2928,7 @@ void DoPokeNews(void) gSaveBlock1Ptr->pokeNews[i].state = 0; ShowFieldMessage(sPokeNewsTextGroup_Upcoming[gSaveBlock1Ptr->pokeNews[i].kind]); } - gScriptResult = TRUE; + gSpecialVar_ScriptResult = TRUE; } } @@ -2959,7 +2959,7 @@ bool8 IsPriceDiscounted(u8 newsKind) switch (newsKind) { case POKENEWS_SLATEPORT: - if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_SLATEPORT_CITY && gSaveBlock1Ptr->location.mapNum == MAP_ID_SLATEPORT_CITY && gScriptLastTalked == 25) + if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_SLATEPORT_CITY && gSaveBlock1Ptr->location.mapNum == MAP_ID_SLATEPORT_CITY && gSpecialVar_ScriptLastTalked == 25) { return TRUE; } @@ -3005,7 +3005,7 @@ void sub_80EF120(u16 days) } else { - if (gSaveBlock1Ptr->pokeNews[i].state == 0 && FlagGet(SYS_GAME_CLEAR) == TRUE) + if (gSaveBlock1Ptr->pokeNews[i].state == 0 && FlagGet(FLAG_SYS_GAME_CLEAR) == TRUE) { gSaveBlock1Ptr->pokeNews[i].state = 1; } @@ -3189,7 +3189,7 @@ void FindActiveBroadcastByShowType_SetScriptResult(u8 kind) { if (gSaveBlock1Ptr->tvShows[i].common.active == TRUE) { - gScriptResult = TRUE; + gSpecialVar_ScriptResult = TRUE; } else { @@ -3205,7 +3205,7 @@ void FindActiveBroadcastByShowType_SetScriptResult(u8 kind) void InterviewBefore(void) { - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; switch (gSpecialVar_0x8005) { case TVSHOW_FAN_CLUB_LETTER: @@ -3244,7 +3244,7 @@ void InterviewBefore(void) void InterviewBefore_FanClubLetter(void) { FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_FAN_CLUB_LETTER); - if (!gScriptResult) + if (!gSpecialVar_ScriptResult) { StringCopy(gStringVar1, gSpeciesNames[GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPECIES, NULL)]); InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubLetter.words, 6); @@ -3254,7 +3254,7 @@ void InterviewBefore_FanClubLetter(void) void InterviewBefore_RecentHappenings(void) { FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_RECENT_HAPPENINGS); - if (!gScriptResult) + if (!gSpecialVar_ScriptResult) { InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].recentHappenings.words, 6); } @@ -3263,7 +3263,7 @@ void InterviewBefore_RecentHappenings(void) void InterviewBefore_PkmnFanClubOpinions(void) { FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_PKMN_FAN_CLUB_OPINIONS); - if (!gScriptResult) + if (!gSpecialVar_ScriptResult) { StringCopy(gStringVar1, gSpeciesNames[GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPECIES, NULL)]); GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_NICKNAME, gStringVar2); @@ -3274,7 +3274,7 @@ void InterviewBefore_PkmnFanClubOpinions(void) void InterviewBefore_Dummy(void) { - gScriptResult = TRUE; + gSpecialVar_ScriptResult = TRUE; } void InterviewBefore_NameRater(void) @@ -3285,7 +3285,7 @@ void InterviewBefore_NameRater(void) void InterviewBefore_BravoTrainerPkmnProfile(void) { FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE); - if (!gScriptResult) + if (!gSpecialVar_ScriptResult) { InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].bravoTrainer.words, 2); } @@ -3304,7 +3304,7 @@ void InterviewBefore_3CheersForPokeblocks(void) void InterviewBefore_BravoTrainerBTProfile(void) { FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE); - if (!gScriptResult) + if (!gSpecialVar_ScriptResult) { InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].bravoTrainerTower.words, 1); } @@ -3313,7 +3313,7 @@ void InterviewBefore_BravoTrainerBTProfile(void) void InterviewBefore_FanClubSpecial(void) { FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_FAN_CLUB_SPECIAL); - if (!gScriptResult) + if (!gSpecialVar_ScriptResult) { InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanClubSpecial.words, 1); } @@ -3429,11 +3429,11 @@ void sub_80EFA88(void) gSpecialVar_0x8006 = sCurTVShowSlot; if (sCurTVShowSlot == -1) { - gScriptResult = TRUE; + gSpecialVar_ScriptResult = TRUE; } else { - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; } } @@ -3636,7 +3636,7 @@ void ChangeBoxPokemonNickname(void) { struct BoxPokemon *boxMon; - boxMon = GetBoxedMonPtr(gSpecialVar_0x8012, gSpecialVar_0x8013); + boxMon = GetBoxedMonPtr(gSpecialVar_MonBoxId, gSpecialVar_MonBoxPos); GetBoxMonData(boxMon, MON_DATA_NICKNAME, gStringVar3); GetBoxMonData(boxMon, MON_DATA_NICKNAME, gStringVar2); DoNamingScreen(3, gStringVar2, GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL), GetBoxMonGender(boxMon), GetBoxMonData(boxMon, MON_DATA_PERSONALITY, NULL), ChangeBoxPokemonNickname_CB); @@ -3644,7 +3644,7 @@ void ChangeBoxPokemonNickname(void) void ChangeBoxPokemonNickname_CB(void) { - SetBoxMonNickFromAnyBox(gSpecialVar_0x8012, gSpecialVar_0x8013, gStringVar2); + SetBoxMonNickFromAnyBox(gSpecialVar_MonBoxId, gSpecialVar_MonBoxPos, gStringVar2); c2_exit_to_overworld_1_continue_scripts_restart_music(); } @@ -3658,11 +3658,11 @@ void TV_CheckMonOTIDEqualsPlayerID(void) { if (GetPlayerIDAsU32() == GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_OT_ID, NULL)) { - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; } else { - gScriptResult = TRUE; + gSpecialVar_ScriptResult = TRUE; } } @@ -3712,11 +3712,11 @@ u8 CheckForBigMovieOrEmergencyNewsOnTV(void) return 0; } } - if (FlagGet(SYS_TV_LATI) == TRUE) + if (FlagGet(FLAG_SYS_TV_LATI) == TRUE) { return 1; } - if (FlagGet(SYS_TV_HOME) == TRUE) + if (FlagGet(FLAG_SYS_TV_HOME) == TRUE) { return 2; } @@ -4561,7 +4561,7 @@ void sub_80F0B64(void) { u16 i; - if (FlagGet(SYS_GAME_CLEAR) != TRUE) + if (FlagGet(FLAG_SYS_GAME_CLEAR) != TRUE) { for (i = 0; i < 24; i ++) { @@ -4736,7 +4736,7 @@ void sub_80F0F24(void) { u8 i; - if (FlagGet(SYS_GAME_CLEAR) != TRUE) + if (FlagGet(FLAG_SYS_GAME_CLEAR) != TRUE) { for (i = 0; i < 16; i ++) { @@ -5108,7 +5108,7 @@ void DoTVShowBravoTrainerPokemonProfile(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -5180,7 +5180,7 @@ void DoTVShowBravoTrainerBattleTower(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch(state) { @@ -5277,7 +5277,7 @@ void DoTVShowTodaysSmartShopper(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch(state) { @@ -5400,7 +5400,7 @@ void DoTVShowTheNameRaterShow(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -5498,7 +5498,7 @@ void DoTVShowPokemonTodaySuccessfulCapture(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -5576,7 +5576,7 @@ void DoTVShowPokemonTodayFailedCapture(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -5630,7 +5630,7 @@ void DoTVShowPokemonFanClubLetter(void) u16 rval; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -5683,7 +5683,7 @@ void DoTVShowRecentHappenings(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -5718,7 +5718,7 @@ void DoTVShowPokemonFanClubOpinions(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -5768,7 +5768,7 @@ void DoTVShowPokemonContestLiveUpdates(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -6115,7 +6115,7 @@ void DoTVShowPokemonBattleUpdate(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -6187,7 +6187,7 @@ void DoTVShow3CheersForPokeblocks(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -6288,7 +6288,7 @@ void DoTVShowInSearchOfTrainers(void) { u8 state; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -6344,7 +6344,7 @@ void DoTVShowInSearchOfTrainers(void) CopyEasyChatWord(gStringVar1, gSaveBlock1Ptr->gabbyAndTyData.quote[0]); StringCopy(gStringVar2, gSpeciesNames[gSaveBlock1Ptr->gabbyAndTyData.mon1]); StringCopy(gStringVar3, gSpeciesNames[gSaveBlock1Ptr->gabbyAndTyData.mon2]); - gScriptResult = TRUE; + gSpecialVar_ScriptResult = TRUE; sTVShowState = 0; TakeTVShowInSearchOfTrainersOffTheAir(); break; @@ -6358,7 +6358,7 @@ void DoTVShowPokemonAngler(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; if (show->pokemonAngler.nBites < show->pokemonAngler.nFails) { sTVShowState = 0; @@ -6392,7 +6392,7 @@ void DoTVShowTheWorldOfMasters(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -6422,7 +6422,7 @@ void DoTVShowTodaysRivalTrainer(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -6571,7 +6571,7 @@ void DoTVShowDewfordTrendWatcherNetwork(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -6627,7 +6627,7 @@ void DoTVShowHoennTreasureInvestigators(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -6671,7 +6671,7 @@ void DoTVShowFindThatGamer(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -6745,7 +6745,7 @@ void DoTVShowBreakingNewsTV(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -6848,7 +6848,7 @@ void DoTVShowSecretBaseVisit(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -6944,7 +6944,7 @@ void DoTVShowPokemonLotteryWinnerFlashReport(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; TVShowConvertInternationalString(gStringVar1, show->lottoWinner.playerName, show->lottoWinner.language); if (show->lottoWinner.whichPrize == 0) @@ -6974,7 +6974,7 @@ void DoTVShowThePokemonBattleSeminar(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -7038,7 +7038,7 @@ void DoTVShowTrainerFanClubSpecial(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -7104,7 +7104,7 @@ void DoTVShowTrainerFanClub(void) u32 playerId; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -7191,7 +7191,7 @@ void DoTVShowSpotTheCuties(void) u32 playerId; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -7296,7 +7296,7 @@ void DoTVShowPokemonNewsBattleFrontier(void) u32 playerId; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -7445,7 +7445,7 @@ void DoTVShowWhatsNo1InHoennToday(void) u32 playerId; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -7561,7 +7561,7 @@ void DoTVShowSecretBaseSecrets(void) u16 i; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -7797,7 +7797,7 @@ void DoTVShowSafariFanClub(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -7884,7 +7884,7 @@ void DoTVShowPokemonContestLiveUpdates2(void) u8 state; show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; - gScriptResult = FALSE; + gSpecialVar_ScriptResult = FALSE; state = sTVShowState; switch (state) { @@ -7916,7 +7916,7 @@ void DoTVShowPokemonContestLiveUpdates2(void) void TVShowDone(void) { - gScriptResult = TRUE; + gSpecialVar_ScriptResult = TRUE; sTVShowState = 0; gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004].common.active = FALSE; } diff --git a/src/walda_phrase.c b/src/walda_phrase.c index 7e06d1319..c1da86b15 100644 --- a/src/walda_phrase.c +++ b/src/walda_phrase.c @@ -98,17 +98,17 @@ u16 TryGetWallpaperWithWaldaPhrase(void) u16 backgroundClr, foregroundClr; u8 patternId, iconId; u16 trainerId = ReadUnalignedWord(gSaveBlock2Ptr->playerTrainerId); - gScriptResult = TryCalculateWallpaper(&backgroundClr, &foregroundClr, &iconId, &patternId, trainerId, GetWaldaPhrasePtr()); + gSpecialVar_ScriptResult = TryCalculateWallpaper(&backgroundClr, &foregroundClr, &iconId, &patternId, trainerId, GetWaldaPhrasePtr()); - if (gScriptResult) + if (gSpecialVar_ScriptResult) { SetWaldaWallpaperPatternId(patternId); SetWaldaWallpaperIconId(iconId); SetWaldaWallpaperColors(backgroundClr, foregroundClr); } - SetWaldaWallpaperLockedOrUnlocked(gScriptResult); - return (bool8)(gScriptResult); + SetWaldaWallpaperLockedOrUnlocked(gSpecialVar_ScriptResult); + return (bool8)(gSpecialVar_ScriptResult); } static u8 GetLetterTableId(u8 letter)