diff options
112 files changed, 5153 insertions, 6476 deletions
diff --git a/asm/battle_message.s b/asm/battle_message.s index 17841a4e9..0e3588d14 100644 --- a/asm/battle_message.s +++ b/asm/battle_message.s @@ -16,7 +16,7 @@ sub_8120AA8: @ 8120AA8 lsls r0, 16 lsrs r7, r0, 16 movs r6, 0 - ldr r5, _08120B70 @ =gUnknown_02039270 + ldr r5, _08120B70 @ =gSelectedOrderFromParty ldr r4, _08120B74 @ =gUnknown_02024A60 ldrb r1, [r4] lsls r1, 9 @@ -73,7 +73,7 @@ _08120B10: movs r2, 0 ldr r0, _08120B9C @ =gUnknown_030041C0 mov r8, r0 - ldr r3, _08120B70 @ =gUnknown_02039270 + ldr r3, _08120B70 @ =gSelectedOrderFromParty ldr r1, _08120BA4 @ =gUnknown_03004290 mov r12, r1 ldr r5, _08120BA8 @ =gUnknown_030042B0 @@ -111,7 +111,7 @@ _08120B64: ldr r0, [r0] mov pc, r0 .align 2, 0 -_08120B70: .4byte gUnknown_02039270 +_08120B70: .4byte gSelectedOrderFromParty _08120B74: .4byte gUnknown_02024A60 _08120B78: .4byte gUnknown_02023A64 _08120B7C: .4byte gUnknown_02024C04 @@ -414,7 +414,7 @@ _08120DE4: .4byte gUnknown_08400622 _08120DE8: mov r0, r10 bl sub_8121D1C - ldr r0, _08120E14 @ =gUnknown_02039270 + ldr r0, _08120E14 @ =gSelectedOrderFromParty ldr r2, [r0] ldrh r1, [r2] movs r0, 0xB1 @@ -433,7 +433,7 @@ _08120DE8: bl StringCopy b _08120E38 .align 2, 0 -_08120E14: .4byte gUnknown_02039270 +_08120E14: .4byte gSelectedOrderFromParty _08120E18: .4byte gUnknown_03004290 _08120E1C: .4byte gUnknown_08401674 _08120E20: .4byte 0x02000000 @@ -1368,7 +1368,7 @@ _081215E8: .align 2, 0 _081215F4: .4byte gUnknown_02024A6A _081215F8: - ldr r0, _08121610 @ =gUnknown_02039270 + ldr r0, _08121610 @ =gSelectedOrderFromParty ldr r2, [r0] ldrh r1, [r2] movs r0, 0xB1 @@ -1380,14 +1380,14 @@ _081215F8: adds r0, r2 b _08121634 .align 2, 0 -_08121610: .4byte gUnknown_02039270 +_08121610: .4byte gSelectedOrderFromParty _08121614: .4byte 0x02000000 _08121618: .4byte 0x000160a0 _0812161C: ldrh r1, [r2] b _08121652 _08121620: - ldr r0, _08121640 @ =gUnknown_02039270 + ldr r0, _08121640 @ =gSelectedOrderFromParty ldr r2, [r0] ldrh r1, [r2, 0x2] movs r0, 0xB1 @@ -1404,7 +1404,7 @@ _08121634: adds r4, r0, r1 b _081219E6 .align 2, 0 -_08121640: .4byte gUnknown_02039270 +_08121640: .4byte gSelectedOrderFromParty _08121644: .4byte 0x02000000 _08121648: .4byte 0x000160a0 _0812164C: .4byte gUnknown_08401674 @@ -2274,7 +2274,7 @@ sub_8121D1C: @ 8121D1C push {r4,r5,lr} adds r4, r0, 0 movs r2, 0 - ldr r5, _08121D50 @ =gUnknown_02039270 + ldr r5, _08121D50 @ =gSelectedOrderFromParty ldr r3, _08121D54 @ =gUnknown_084016BC _08121D26: cmp r2, 0x4 @@ -2299,7 +2299,7 @@ _08121D3C: bl StringCopy b _08121D68 .align 2, 0 -_08121D50: .4byte gUnknown_02039270 +_08121D50: .4byte gSelectedOrderFromParty _08121D54: .4byte gUnknown_084016BC _08121D58: .4byte gUnknown_08400E5E _08121D5C: @@ -2329,7 +2329,7 @@ _08121D7E: cmp r0, 0xFF bne _08121D7C ldr r1, _08121DB4 @ =gUnknown_084016BC - ldr r5, _08121DB8 @ =gUnknown_02039270 + ldr r5, _08121DB8 @ =gSelectedOrderFromParty movs r0, 0 lsls r0, 1 adds r2, r0, r1 @@ -2356,7 +2356,7 @@ _08121DA8: mov pc, r0 .align 2, 0 _08121DB4: .4byte gUnknown_084016BC -_08121DB8: .4byte gUnknown_02039270 +_08121DB8: .4byte gSelectedOrderFromParty _08121DBC: .4byte _08121DC0 .align 2, 0 _08121DC0: diff --git a/asm/choose_party.s b/asm/choose_party.s index 673933814..25122e4ef 100644 --- a/asm/choose_party.s +++ b/asm/choose_party.s @@ -47,7 +47,7 @@ _08121E54: .4byte 0x00000263 sub_8121E58: @ 8121E58 push {lr} movs r1, 0 - ldr r3, _08121E74 @ =gUnknown_02039270 + ldr r3, _08121E74 @ =gSelectedOrderFromParty movs r2, 0 _08121E60: adds r0, r1, r3 @@ -60,7 +60,7 @@ _08121E60: pop {r0} bx r0 .align 2, 0 -_08121E74: .4byte gUnknown_02039270 +_08121E74: .4byte gSelectedOrderFromParty thumb_func_end sub_8121E58 thumb_func_start sub_8121E78 @@ -192,7 +192,7 @@ _08121F78: _08121F7E: cmp r4, 0x2 bhi _08121FA0 - ldr r0, _08121FC4 @ =gUnknown_02039270 + ldr r0, _08121FC4 @ =gSelectedOrderFromParty adds r0, r4, r0 ldrb r0, [r0] cmp r0, r6 @@ -223,7 +223,7 @@ _08121FA0: bl sub_806BC3C b _08121FD4 .align 2, 0 -_08121FC4: .4byte gUnknown_02039270 +_08121FC4: .4byte gSelectedOrderFromParty _08121FC8: .4byte gPlayerParty _08121FCC: adds r0, r5, 0 @@ -372,7 +372,7 @@ sub_81220C8: @ 81220C8 ldrb r0, [r0] cmp r0, 0 beq _081221A2 - ldr r0, _081220F4 @ =gUnknown_02039270 + ldr r0, _081220F4 @ =gSelectedOrderFromParty ldrb r0, [r0, 0x2] cmp r0, 0 bne _08122100 @@ -381,7 +381,7 @@ sub_81220C8: @ 81220C8 .align 2, 0 _081220EC: .4byte 0x0201b000 _081220F0: .4byte 0x00000263 -_081220F4: .4byte gUnknown_02039270 +_081220F4: .4byte gSelectedOrderFromParty _081220F8: movs r0, 0x12 b _081221A4 @@ -391,7 +391,7 @@ _081220FC: _08122100: movs r5, 0 _08122102: - ldr r4, _081221B4 @ =gUnknown_02039270 + ldr r4, _081221B4 @ =gSelectedOrderFromParty adds r4, r5, r4 ldrb r0, [r4] movs r1, 0x64 @@ -430,7 +430,7 @@ _0812214A: add r0, r9 movs r1, 0 ldrsh r4, [r0, r1] - ldr r0, _081221B4 @ =gUnknown_02039270 + ldr r0, _081221B4 @ =gSelectedOrderFromParty adds r6, r5, r0 ldrb r0, [r6] mov r2, r8 @@ -481,7 +481,7 @@ _081221A4: pop {r1} bx r1 .align 2, 0 -_081221B4: .4byte gUnknown_02039270 +_081221B4: .4byte gSelectedOrderFromParty _081221B8: .4byte gUnknown_030042FC _081221BC: .4byte 0x0201b000 _081221C0: .4byte 0x00000282 @@ -495,7 +495,7 @@ sub_81221CC: @ 81221CC lsls r0, 24 lsrs r2, r0, 24 movs r1, 0 - ldr r3, _081221E4 @ =gUnknown_02039270 + ldr r3, _081221E4 @ =gSelectedOrderFromParty _081221D6: adds r0, r1, r3 ldrb r0, [r0] @@ -504,7 +504,7 @@ _081221D6: movs r0, 0x1 b _081221F4 .align 2, 0 -_081221E4: .4byte gUnknown_02039270 +_081221E4: .4byte gSelectedOrderFromParty _081221E8: adds r0, r1, 0x1 lsls r0, 24 @@ -525,7 +525,7 @@ sub_81221F8: @ 81221F8 movs r0, 0x5 movs r1, 0x1 bl sub_806D538 - ldr r5, _08122248 @ =gUnknown_03005CE0 + ldr r5, _08122248 @ =gLastFieldPokeMenuOpened ldrb r1, [r5] movs r0, 0x64 muls r0, r1 @@ -556,7 +556,7 @@ sub_81221F8: @ 81221F8 movs r0, 0x1 b _08122270 .align 2, 0 -_08122248: .4byte gUnknown_03005CE0 +_08122248: .4byte gLastFieldPokeMenuOpened _0812224C: .4byte gPlayerParty _08122250: .4byte gTasks _08122254: .4byte gUnknown_084017D8 @@ -633,7 +633,7 @@ _081222E0: bl PlaySE adds r0, r4, 0 bl sub_806CA38 - ldr r1, _08122320 @ =gUnknown_03005CE0 + ldr r1, _08122320 @ =gLastFieldPokeMenuOpened strb r0, [r1] lsls r0, 24 lsrs r0, 24 @@ -657,7 +657,7 @@ _081222E0: str r1, [r0] b _08122342 .align 2, 0 -_08122320: .4byte gUnknown_03005CE0 +_08122320: .4byte gLastFieldPokeMenuOpened _08122324: .4byte gPlayerParty _08122328: .4byte gStringVar1 _0812232C: .4byte gTasks @@ -868,7 +868,7 @@ sub_81224A8: @ 81224A8 .align 2, 0 _081224CC: .4byte gTasks _081224D0: - ldr r0, _081224F8 @ =gUnknown_02039270 + ldr r0, _081224F8 @ =gSelectedOrderFromParty ldrb r0, [r0] cmp r0, 0 beq _08122504 @@ -888,7 +888,7 @@ _081224D0: str r1, [r0] b _08122520 .align 2, 0 -_081224F8: .4byte gUnknown_02039270 +_081224F8: .4byte gSelectedOrderFromParty _081224FC: .4byte gTasks _08122500: .4byte sub_8122450 _08122504: @@ -939,7 +939,7 @@ _08122536: adds r0, r1 ldr r1, _08122584 @ =gStringVar1 bl GetMonNickname - ldr r1, _08122588 @ =gUnknown_03005CE0 + ldr r1, _08122588 @ =gLastFieldPokeMenuOpened ldrb r0, [r4] strb r0, [r1] ldrb r0, [r5] @@ -952,7 +952,7 @@ _08122578: .4byte 0x0201b260 _0812257C: .4byte gUnknown_020384F0 _08122580: .4byte gPlayerParty _08122584: .4byte gStringVar1 -_08122588: .4byte gUnknown_03005CE0 +_08122588: .4byte gLastFieldPokeMenuOpened _0812258C: .4byte sub_806AEDC _08122590: bl sub_80F9344 @@ -1088,8 +1088,8 @@ sub_8122694: @ 8122694 lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 - ldr r3, _081226D4 @ =gUnknown_02039270 - ldr r2, _081226D8 @ =gUnknown_03005CE0 + ldr r3, _081226D4 @ =gSelectedOrderFromParty + ldr r2, _081226D8 @ =gLastFieldPokeMenuOpened _081226A0: adds r1, r4, r3 ldrb r0, [r1] @@ -1116,8 +1116,8 @@ _081226CC: bl sub_8122838 b _08122716 .align 2, 0 -_081226D4: .4byte gUnknown_02039270 -_081226D8: .4byte gUnknown_03005CE0 +_081226D4: .4byte gSelectedOrderFromParty +_081226D8: .4byte gLastFieldPokeMenuOpened _081226DC: adds r0, r4, 0x1 lsls r0, 24 @@ -1196,8 +1196,8 @@ sub_8122770: @ 8122770 lsls r0, 24 lsrs r6, r0, 24 movs r4, 0 - ldr r5, _08122798 @ =gUnknown_03005CE0 - ldr r3, _0812279C @ =gUnknown_02039270 + ldr r5, _08122798 @ =gLastFieldPokeMenuOpened + ldr r3, _0812279C @ =gSelectedOrderFromParty _0812277C: adds r2, r4, r3 ldrb r1, [r2] @@ -1213,8 +1213,8 @@ _0812277C: beq _081227AC b _081227BE .align 2, 0 -_08122798: .4byte gUnknown_03005CE0 -_0812279C: .4byte gUnknown_02039270 +_08122798: .4byte gLastFieldPokeMenuOpened +_0812279C: .4byte gSelectedOrderFromParty _081227A0: ldrb r0, [r3, 0x1] strb r0, [r3] @@ -1237,7 +1237,7 @@ _081227BE: ldrb r0, [r5] movs r1, 0x70 bl sub_806BC3C - ldr r4, _081227F8 @ =gUnknown_02039270 + ldr r4, _081227F8 @ =gSelectedOrderFromParty ldrb r0, [r4] cmp r0, 0 beq _081227DA @@ -1262,7 +1262,7 @@ _081227EC: pop {r0} bx r0 .align 2, 0 -_081227F8: .4byte gUnknown_02039270 +_081227F8: .4byte gSelectedOrderFromParty thumb_func_end sub_8122770 thumb_func_start sub_81227FC @@ -1982,7 +1982,7 @@ sub_8122D94: @ 8122D94 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, _08122DCC @ =gUnknown_03005CE0 + ldr r0, _08122DCC @ =gLastFieldPokeMenuOpened ldrb r1, [r0] movs r0, 0x64 muls r0, r1 @@ -2006,7 +2006,7 @@ sub_8122D94: @ 8122D94 bl sub_806E750 b _08122DFA .align 2, 0 -_08122DCC: .4byte gUnknown_03005CE0 +_08122DCC: .4byte gLastFieldPokeMenuOpened _08122DD0: .4byte gPlayerParty _08122DD4: .4byte gTasks _08122DD8: .4byte gUnknown_08401810 @@ -2061,7 +2061,7 @@ _08122E38: bl PlaySE adds r0, r4, 0 bl sub_806CA38 - ldr r1, _08122E70 @ =gUnknown_03005CE0 + ldr r1, _08122E70 @ =gLastFieldPokeMenuOpened strb r0, [r1] ldrb r1, [r1] movs r0, 0x64 @@ -2081,7 +2081,7 @@ _08122E38: str r1, [r0] b _08122E9C .align 2, 0 -_08122E70: .4byte gUnknown_03005CE0 +_08122E70: .4byte gLastFieldPokeMenuOpened _08122E74: .4byte gPlayerParty _08122E78: .4byte gStringVar1 _08122E7C: .4byte gTasks @@ -2089,7 +2089,7 @@ _08122E80: .4byte sub_8122EAC _08122E84: movs r0, 0x5 bl PlaySE - ldr r1, _08122EA4 @ =gUnknown_03005CE0 + ldr r1, _08122EA4 @ =gLastFieldPokeMenuOpened movs r0, 0xFF strb r0, [r1] ldr r1, _08122EA8 @ =gSpecialVar_0x8004 @@ -2102,7 +2102,7 @@ _08122E9C: pop {r0} bx r0 .align 2, 0 -_08122EA4: .4byte gUnknown_03005CE0 +_08122EA4: .4byte gLastFieldPokeMenuOpened _08122EA8: .4byte gSpecialVar_0x8004 thumb_func_end sub_8122E0C @@ -2204,7 +2204,7 @@ sub_8122F70: @ 8122F70 lsls r0, 24 lsrs r0, 24 ldr r2, _08122F88 @ =gSpecialVar_0x8004 - ldr r1, _08122F8C @ =gUnknown_03005CE0 + ldr r1, _08122F8C @ =gLastFieldPokeMenuOpened ldrb r1, [r1] strh r1, [r2] bl sub_8123138 @@ -2212,7 +2212,7 @@ sub_8122F70: @ 8122F70 bx r0 .align 2, 0 _08122F88: .4byte gSpecialVar_0x8004 -_08122F8C: .4byte gUnknown_03005CE0 +_08122F8C: .4byte gLastFieldPokeMenuOpened thumb_func_end sub_8122F70 thumb_func_start sub_8122F90 @@ -2239,7 +2239,7 @@ _08122F96: adds r0, r1 ldr r1, _08122FE4 @ =gStringVar1 bl GetMonNickname - ldr r1, _08122FE8 @ =gUnknown_03005CE0 + ldr r1, _08122FE8 @ =gLastFieldPokeMenuOpened ldrb r0, [r4] strb r0, [r1] ldrb r0, [r5] @@ -2252,7 +2252,7 @@ _08122FD8: .4byte 0x0201b260 _08122FDC: .4byte gUnknown_020384F0 _08122FE0: .4byte gPlayerParty _08122FE4: .4byte gStringVar1 -_08122FE8: .4byte gUnknown_03005CE0 +_08122FE8: .4byte gLastFieldPokeMenuOpened _08122FEC: .4byte sub_806AEDC _08122FF0: bl sub_80F9344 diff --git a/asm/daycare.s b/asm/daycare.s index d78757d8f..886643fce 100644 --- a/asm/daycare.s +++ b/asm/daycare.s @@ -196,7 +196,7 @@ _08041498: .4byte 0x00002b4c thumb_func_start daycare_send daycare_send: @ 804149C push {lr} - ldr r0, _080414B4 @ =gUnknown_03005CE0 + ldr r0, _080414B4 @ =gLastFieldPokeMenuOpened ldrb r1, [r0] movs r0, 0x64 muls r0, r1 @@ -207,7 +207,7 @@ daycare_send: @ 804149C pop {r0} bx r0 .align 2, 0 -_080414B4: .4byte gUnknown_03005CE0 +_080414B4: .4byte gLastFieldPokeMenuOpened _080414B8: .4byte gPlayerParty _080414BC: .4byte gSaveBlock1 + 0x2F9C thumb_func_end daycare_send @@ -2104,7 +2104,7 @@ _08042324: .4byte gStringVar2 thumb_func_start sub_8042328 sub_8042328: @ 8042328 push {r4-r6,lr} - ldr r6, _08042354 @ =gUnknown_03005CE0 + ldr r6, _08042354 @ =gLastFieldPokeMenuOpened ldrb r0, [r6] movs r5, 0x64 muls r0, r5 @@ -2123,7 +2123,7 @@ sub_8042328: @ 8042328 pop {r1} bx r1 .align 2, 0 -_08042354: .4byte gUnknown_03005CE0 +_08042354: .4byte gLastFieldPokeMenuOpened _08042358: .4byte gPlayerParty _0804235C: .4byte gStringVar1 thumb_func_end sub_8042328 @@ -2722,7 +2722,7 @@ _0804279C: bl sub_8072DEC movs r0, 0x5 bl PlaySE - ldr r3, _080427DC @ =gUnknown_03005CE0 + ldr r3, _080427DC @ =gLastFieldPokeMenuOpened ldr r2, _080427E0 @ =gScriptResult ldr r1, _080427E4 @ =gTasks lsls r0, r4, 2 @@ -2742,7 +2742,7 @@ _0804279C: bl EnableBothScriptContexts b _08042816 .align 2, 0 -_080427DC: .4byte gUnknown_03005CE0 +_080427DC: .4byte gLastFieldPokeMenuOpened _080427E0: .4byte gScriptResult _080427E4: .4byte gTasks _080427E8: @@ -2752,7 +2752,7 @@ _080427E8: cmp r0, 0 beq _08042816 bl sub_8072DEC - ldr r0, _0804281C @ =gUnknown_03005CE0 + ldr r0, _0804281C @ =gLastFieldPokeMenuOpened ldr r1, _08042820 @ =gScriptResult strh r4, [r1] movs r1, 0x2 @@ -2770,7 +2770,7 @@ _08042816: pop {r0} bx r0 .align 2, 0 -_0804281C: .4byte gUnknown_03005CE0 +_0804281C: .4byte gLastFieldPokeMenuOpened _08042820: .4byte gScriptResult thumb_func_end DaycareLevelMenuProcessKeyInput diff --git a/asm/field_effect.s b/asm/field_effect.s index 4bcba42ce..66d89ef09 100644 --- a/asm/field_effect.s +++ b/asm/field_effect.s @@ -1620,7 +1620,7 @@ task00_8084310: @ 8086604 cmp r0, 0 beq _08086666 ldr r1, _08086670 @ =gUnknown_0202FF84 - ldr r0, _08086674 @ =gUnknown_03005CE0 + ldr r0, _08086674 @ =gLastFieldPokeMenuOpened ldrb r0, [r0] str r0, [r1] cmp r0, 0x5 @@ -1654,7 +1654,7 @@ _08086666: .align 2, 0 _0808666C: .4byte gTasks _08086670: .4byte gUnknown_0202FF84 -_08086674: .4byte gUnknown_03005CE0 +_08086674: .4byte gLastFieldPokeMenuOpened _08086678: .4byte CB2_LoadMap _0808667C: .4byte gUnknown_0300485C _08086680: .4byte mapldr_08084390 diff --git a/asm/field_tasks.s b/asm/field_tasks.s index 23a49109d..5f3e3a03f 100644 --- a/asm/field_tasks.s +++ b/asm/field_tasks.s @@ -1523,7 +1523,7 @@ _08069F9E: bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl MetatileBehavior_IsAsh + bl MetatileBehavior_IsAshGrass lsls r0, 24 cmp r0, 0 beq _0806A02A diff --git a/asm/fldeff_80C5CD4.s b/asm/fldeff_80C5CD4.s index 4214f8f9e..25ede5738 100644 --- a/asm/fldeff_80C5CD4.s +++ b/asm/fldeff_80C5CD4.s @@ -881,7 +881,7 @@ _080C6398: .4byte sub_80C660C sub_80C639C: @ 80C639C push {lr} ldr r1, _080C63B0 @ =gUnknown_0202FF84 - ldr r0, _080C63B4 @ =gUnknown_03005CE0 + ldr r0, _080C63B4 @ =gLastFieldPokeMenuOpened ldrb r0, [r0] str r0, [r1] ldr r0, _080C63B8 @ =gUnknown_081A2CE6 @@ -890,7 +890,7 @@ sub_80C639C: @ 80C639C bx r0 .align 2, 0 _080C63B0: .4byte gUnknown_0202FF84 -_080C63B4: .4byte gUnknown_03005CE0 +_080C63B4: .4byte gLastFieldPokeMenuOpened _080C63B8: .4byte gUnknown_081A2CE6 thumb_func_end sub_80C639C @@ -1026,7 +1026,7 @@ sub_80C6498: @ 80C6498 sub_80C64A8: @ 80C64A8 push {lr} ldr r1, _080C64BC @ =gUnknown_0202FF84 - ldr r0, _080C64C0 @ =gUnknown_03005CE0 + ldr r0, _080C64C0 @ =gLastFieldPokeMenuOpened ldrb r0, [r0] str r0, [r1] ldr r0, _080C64C4 @ =gUnknown_081A2D3E @@ -1035,7 +1035,7 @@ sub_80C64A8: @ 80C64A8 bx r0 .align 2, 0 _080C64BC: .4byte gUnknown_0202FF84 -_080C64C0: .4byte gUnknown_03005CE0 +_080C64C0: .4byte gLastFieldPokeMenuOpened _080C64C4: .4byte gUnknown_081A2D3E thumb_func_end sub_80C64A8 @@ -1213,7 +1213,7 @@ sub_80C65FC: @ 80C65FC sub_80C660C: @ 80C660C push {lr} ldr r1, _080C6620 @ =gUnknown_0202FF84 - ldr r0, _080C6624 @ =gUnknown_03005CE0 + ldr r0, _080C6624 @ =gLastFieldPokeMenuOpened ldrb r0, [r0] str r0, [r1] ldr r0, _080C6628 @ =gUnknown_081A2D96 @@ -1222,7 +1222,7 @@ sub_80C660C: @ 80C660C bx r0 .align 2, 0 _080C6620: .4byte gUnknown_0202FF84 -_080C6624: .4byte gUnknown_03005CE0 +_080C6624: .4byte gLastFieldPokeMenuOpened _080C6628: .4byte gUnknown_081A2D96 thumb_func_end sub_80C660C diff --git a/asm/fldeff_cut.s b/asm/fldeff_cut.s deleted file mode 100644 index a56ad32fa..000000000 --- a/asm/fldeff_cut.s +++ /dev/null @@ -1,797 +0,0 @@ - .include "constants/gba_constants.inc" - .include "constants/species_constants.inc" - .include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start SetUpFieldMove_Cut -SetUpFieldMove_Cut: @ 80A2504 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0x52 - bl npc_before_player_of_type - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A2534 - ldr r1, _080A2524 @ =gUnknown_0300485C - ldr r0, _080A2528 @ =sub_808AB90 - str r0, [r1] - ldr r1, _080A252C @ =gUnknown_03005CE4 - ldr r0, _080A2530 @ =sub_80A2634 - b _080A25A8 - .align 2, 0 -_080A2524: .4byte gUnknown_0300485C -_080A2528: .4byte sub_808AB90 -_080A252C: .4byte gUnknown_03005CE4 -_080A2530: .4byte sub_80A2634 -_080A2534: - ldr r4, _080A25B0 @ =gUnknown_0203923C - adds r1, r4, 0x2 - adds r0, r4, 0 - bl PlayerGetDestCoords - movs r7, 0 - mov r8, r4 -_080A2542: - ldr r1, _080A25B4 @ =0x0000ffff - adds r0, r7, r1 - mov r2, r8 - ldrh r2, [r2, 0x2] - adds r0, r2 - movs r6, 0 - lsls r0, 16 - asrs r5, r0, 16 -_080A2552: - ldr r1, _080A25B4 @ =0x0000ffff - adds r0, r6, r1 - mov r2, r8 - ldrh r2, [r2] - adds r0, r2 - lsls r0, 16 - asrs r4, r0, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - mov r2, r8 - movs r1, 0x4 - ldrsb r1, [r2, r1] - cmp r0, r1 - bne _080A25C8 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsPokeGrass - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A259E - adds r0, r4, 0 - bl MetatileBehavior_IsAsh - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A25C8 -_080A259E: - ldr r1, _080A25B8 @ =gUnknown_0300485C - ldr r0, _080A25BC @ =sub_808AB90 - str r0, [r1] - ldr r1, _080A25C0 @ =gUnknown_03005CE4 - ldr r0, _080A25C4 @ =sub_80A25E8 -_080A25A8: - str r0, [r1] - movs r0, 0x1 - b _080A25DE - .align 2, 0 -_080A25B0: .4byte gUnknown_0203923C -_080A25B4: .4byte 0x0000ffff -_080A25B8: .4byte gUnknown_0300485C -_080A25BC: .4byte sub_808AB90 -_080A25C0: .4byte gUnknown_03005CE4 -_080A25C4: .4byte sub_80A25E8 -_080A25C8: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _080A2552 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _080A2542 - movs r0, 0 -_080A25DE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end SetUpFieldMove_Cut - - thumb_func_start sub_80A25E8 -sub_80A25E8: @ 80A25E8 - push {lr} - movs r0, 0x1 - bl FieldEffectStart - ldr r0, _080A25FC @ =gUnknown_0202FF84 - ldr r1, _080A2600 @ =gUnknown_03005CE0 - ldrb r1, [r1] - str r1, [r0] - pop {r0} - bx r0 - .align 2, 0 -_080A25FC: .4byte gUnknown_0202FF84 -_080A2600: .4byte gUnknown_03005CE0 - thumb_func_end sub_80A25E8 - - thumb_func_start FldEff_UseCutOnGrass -FldEff_UseCutOnGrass: @ 80A2604 - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, _080A262C @ =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, _080A2630 @ =sub_80A2684 - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - movs r0, 0x12 - bl IncrementGameStat - movs r0, 0 - pop {r1} - bx r1 - .align 2, 0 -_080A262C: .4byte gTasks -_080A2630: .4byte sub_80A2684 - thumb_func_end FldEff_UseCutOnGrass - - thumb_func_start sub_80A2634 -sub_80A2634: @ 80A2634 - push {lr} - ldr r1, _080A2648 @ =gUnknown_0202FF84 - ldr r0, _080A264C @ =gUnknown_03005CE0 - ldrb r0, [r0] - str r0, [r1] - ldr r0, _080A2650 @ =UseCutScript - bl ScriptContext1_SetupScript - pop {r0} - bx r0 - .align 2, 0 -_080A2648: .4byte gUnknown_0202FF84 -_080A264C: .4byte gUnknown_03005CE0 -_080A2650: .4byte UseCutScript - thumb_func_end sub_80A2634 - - thumb_func_start FldEff_UseCutOnTree -FldEff_UseCutOnTree: @ 80A2654 - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, _080A267C @ =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, _080A2680 @ =sub_80A2B00 - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - movs r0, 0x12 - bl IncrementGameStat - movs r0, 0 - pop {r1} - bx r1 - .align 2, 0 -_080A267C: .4byte gTasks -_080A2680: .4byte sub_80A2B00 - thumb_func_end FldEff_UseCutOnTree - - thumb_func_start sub_80A2684 -sub_80A2684: @ 80A2684 - push {lr} - movs r0, 0x1 - bl FieldEffectActiveListRemove - movs r0, 0x3A - bl FieldEffectStart - pop {r0} - bx r0 - thumb_func_end sub_80A2684 - - thumb_func_start FldEff_CutGrass -FldEff_CutGrass: @ 80A2698 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r7, 0 - movs r0, 0x80 - bl PlaySE - ldr r4, _080A2790 @ =gUnknown_0203923C - adds r1, r4, 0x2 - adds r0, r4, 0 - bl PlayerGetDestCoords - mov r8, r4 -_080A26B2: - ldr r1, _080A2794 @ =0x0000ffff - adds r0, r7, r1 - mov r2, r8 - ldrh r2, [r2, 0x2] - adds r0, r2 - movs r6, 0 - lsls r0, 16 - asrs r5, r0, 16 -_080A26C2: - ldr r1, _080A2794 @ =0x0000ffff - adds r0, r6, r1 - mov r2, r8 - ldrh r2, [r2] - adds r0, r2 - lsls r0, 16 - asrs r4, r0, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - mov r2, r8 - movs r1, 0x4 - ldrsb r1, [r2, r1] - cmp r0, r1 - bne _080A270E - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_80578F8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A270E - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80A27A8 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_805BCC0 -_080A270E: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _080A26C2 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _080A26B2 - ldr r1, _080A2790 @ =gUnknown_0203923C - ldrh r0, [r1] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r1, 0x2] - subs r1, 0x2 - lsls r1, 16 - asrs r1, 16 - bl sub_80A28F4 - bl DrawWholeMapView - movs r7, 0 - ldr r4, _080A2798 @ =gSprites -_080A2740: - ldr r0, _080A279C @ =gPlayerAvatar - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x2] - lsls r1, 23 - lsrs r1, 7 - movs r2, 0x80 - lsls r2, 12 - adds r1, r2 - asrs r1, 16 - ldrb r2, [r0] - adds r2, 0x14 - ldr r0, _080A27A0 @ =gSpriteTemplate_CutGrass - movs r3, 0 - bl CreateSprite - ldr r1, _080A27A4 @ =0x0201fff0 - adds r1, r7, r1 - strb r0, [r1] - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - lsls r1, r7, 5 - strh r1, [r0, 0x32] - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x7 - bls _080A2740 - movs r0, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_080A2790: .4byte gUnknown_0203923C -_080A2794: .4byte 0x0000ffff -_080A2798: .4byte gSprites -_080A279C: .4byte gPlayerAvatar -_080A27A0: .4byte gSpriteTemplate_CutGrass -_080A27A4: .4byte 0x0201fff0 - thumb_func_end FldEff_CutGrass - - thumb_func_start sub_80A27A8 -sub_80A27A8: @ 80A27A8 - push {r4-r7,lr} - lsls r0, 16 - lsls r1, 16 - lsrs r6, r0, 16 - asrs r4, r0, 16 - lsrs r7, r1, 16 - asrs r5, r1, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - ldr r0, _080A27E0 @ =0x00000207 - cmp r1, r0 - bgt _080A27F4 - subs r0, 0x1 - cmp r1, r0 - bge _080A286C - cmp r1, 0x25 - beq _080A288E - cmp r1, 0x25 - bgt _080A27E4 - cmp r1, 0xD - beq _080A2834 - cmp r1, 0x15 - beq _080A2834 - b _080A2898 - .align 2, 0 -_080A27E0: .4byte 0x00000207 -_080A27E4: - movs r0, 0xE3 - lsls r0, 1 - cmp r1, r0 - beq _080A2844 - adds r0, 0x1 - cmp r1, r0 - beq _080A284A - b _080A2898 -_080A27F4: - ldr r0, _080A280C @ =0x00000212 - cmp r1, r0 - beq _080A287C - cmp r1, r0 - bgt _080A2810 - subs r0, 0xA - cmp r1, r0 - beq _080A2834 - adds r0, 0x2 - cmp r1, r0 - beq _080A287C - b _080A2898 - .align 2, 0 -_080A280C: .4byte 0x00000212 -_080A2810: - ldr r0, _080A2824 @ =0x00000282 - cmp r1, r0 - beq _080A285C - cmp r1, r0 - bgt _080A2828 - subs r0, 0x1 - cmp r1, r0 - beq _080A2854 - b _080A2898 - .align 2, 0 -_080A2824: .4byte 0x00000282 -_080A2828: - ldr r0, _080A2830 @ =0x00000283 - cmp r1, r0 - beq _080A2864 - b _080A2898 - .align 2, 0 -_080A2830: .4byte 0x00000283 -_080A2834: - lsls r0, r6, 16 - asrs r0, 16 - lsls r1, r7, 16 - asrs r1, 16 - movs r2, 0x1 - bl MapGridSetMetatileIdAt - b _080A2898 -_080A2844: - movs r2, 0xE7 - lsls r2, 1 - b _080A286E -_080A284A: - ldr r2, _080A2850 @ =0x000001cf - b _080A286E - .align 2, 0 -_080A2850: .4byte 0x000001cf -_080A2854: - ldr r2, _080A2858 @ =0x00000279 - b _080A286E - .align 2, 0 -_080A2858: .4byte 0x00000279 -_080A285C: - ldr r2, _080A2860 @ =0x0000027a - b _080A286E - .align 2, 0 -_080A2860: .4byte 0x0000027a -_080A2864: - ldr r2, _080A2868 @ =0x0000027b - b _080A286E - .align 2, 0 -_080A2868: .4byte 0x0000027b -_080A286C: - ldr r2, _080A2878 @ =0x00000271 -_080A286E: - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt - b _080A2898 - .align 2, 0 -_080A2878: .4byte 0x00000271 -_080A287C: - lsls r0, r6, 16 - asrs r0, 16 - lsls r1, r7, 16 - asrs r1, 16 - movs r2, 0x86 - lsls r2, 2 - bl MapGridSetMetatileIdAt - b _080A2898 -_080A288E: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0xE - bl MapGridSetMetatileIdAt -_080A2898: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A27A8 - - thumb_func_start sub_80A28A0 -sub_80A28A0: @ 80A28A0 - push {lr} - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r1, r0, 16 - adds r2, r1, 0 - cmp r1, 0x1 - bne _080A28BC - movs r0, 0x1 - b _080A28EE -_080A28BC: - ldr r0, _080A28C8 @ =0x00000279 - cmp r1, r0 - bne _080A28CC - movs r0, 0x2 - b _080A28EE - .align 2, 0 -_080A28C8: .4byte 0x00000279 -_080A28CC: - ldr r0, _080A28D8 @ =0x0000027a - cmp r1, r0 - bne _080A28DC - movs r0, 0x3 - b _080A28EE - .align 2, 0 -_080A28D8: .4byte 0x0000027a -_080A28DC: - ldr r0, _080A28E8 @ =0x0000027b - cmp r2, r0 - beq _080A28EC - movs r0, 0 - b _080A28EE - .align 2, 0 -_080A28E8: .4byte 0x0000027b -_080A28EC: - movs r0, 0x4 -_080A28EE: - pop {r1} - bx r1 - thumb_func_end sub_80A28A0 - - thumb_func_start sub_80A28F4 -sub_80A28F4: @ 80A28F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsls r1, 16 - movs r2, 0xC0 - lsls r2, 10 - adds r0, r1, r2 - lsrs r0, 16 - mov r9, r0 - movs r4, 0 - asrs r7, r1, 16 -_080A2914: - mov r1, r10 - lsls r0, r1, 16 - asrs r0, 16 - lsls r4, 16 - asrs r1, r4, 16 - adds r0, r1 - lsls r0, 16 - lsrs r6, r0, 16 - asrs r5, r0, 16 - adds r0, r5, 0 - adds r1, r7, 0 - bl MapGridGetMetatileIdAt - mov r8, r4 - cmp r0, 0x15 - bne _080A2996 - adds r4, r7, 0x1 - lsls r1, r4, 16 - asrs r1, 16 - adds r0, r5, 0 - bl sub_80A28A0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _080A296A - cmp r0, 0x2 - bgt _080A2952 - cmp r0, 0x1 - beq _080A295C - b _080A2996 -_080A2952: - cmp r0, 0x3 - beq _080A297C - cmp r0, 0x4 - beq _080A298C - b _080A2996 -_080A295C: - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x82 - lsls r2, 2 - bl MapGridSetMetatileIdAt - b _080A2996 -_080A296A: - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, _080A2978 @ =0x00000281 - bl MapGridSetMetatileIdAt - b _080A2996 - .align 2, 0 -_080A2978: .4byte 0x00000281 -_080A297C: - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, _080A2988 @ =0x00000282 - bl MapGridSetMetatileIdAt - b _080A2996 - .align 2, 0 -_080A2988: .4byte 0x00000282 -_080A298C: - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, _080A2A30 @ =0x00000283 - bl MapGridSetMetatileIdAt -_080A2996: - lsls r0, r6, 16 - asrs r5, r0, 16 - mov r2, r9 - lsls r0, r2, 16 - asrs r4, r0, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - cmp r0, 0x1 - bne _080A2A10 - adds r4, 0x1 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - movs r1, 0x82 - lsls r1, 2 - cmp r0, r1 - bne _080A29C8 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl MapGridSetMetatileIdAt -_080A29C8: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, _080A2A34 @ =0x00000281 - cmp r0, r1 - bne _080A29E0 - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, _080A2A38 @ =0x00000279 - bl MapGridSetMetatileIdAt -_080A29E0: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, _080A2A3C @ =0x00000282 - cmp r0, r1 - bne _080A29F8 - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, _080A2A40 @ =0x0000027a - bl MapGridSetMetatileIdAt -_080A29F8: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, _080A2A30 @ =0x00000283 - cmp r0, r1 - bne _080A2A10 - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, _080A2A44 @ =0x0000027b - bl MapGridSetMetatileIdAt -_080A2A10: - movs r0, 0x80 - lsls r0, 9 - add r0, r8 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bgt _080A2A20 - b _080A2914 -_080A2A20: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080A2A30: .4byte 0x00000283 -_080A2A34: .4byte 0x00000281 -_080A2A38: .4byte 0x00000279 -_080A2A3C: .4byte 0x00000282 -_080A2A40: .4byte 0x0000027a -_080A2A44: .4byte 0x0000027b - thumb_func_end sub_80A28F4 - - thumb_func_start sub_80A2A48 -sub_80A2A48: @ 80A2A48 - movs r2, 0 - movs r1, 0x8 - strh r1, [r0, 0x2E] - strh r2, [r0, 0x30] - strh r2, [r0, 0x34] - ldr r1, _080A2A58 @ =objc_8097BBC - str r1, [r0, 0x1C] - bx lr - .align 2, 0 -_080A2A58: .4byte objc_8097BBC - thumb_func_end sub_80A2A48 - - thumb_func_start objc_8097BBC -objc_8097BBC: @ 80A2A5C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl Sin - strh r0, [r4, 0x24] - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl Cos - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x8 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x2E] - adds r1, 0x1 - ldrh r2, [r4, 0x34] - lsls r0, r2, 16 - asrs r0, 18 - adds r1, r0 - strh r1, [r4, 0x2E] - adds r2, 0x1 - strh r2, [r4, 0x34] - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0x1C - beq _080A2AA8 - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - b _080A2AAC -_080A2AA8: - ldr r0, _080A2AB4 @ =sub_80A2AB8 - str r0, [r4, 0x1C] -_080A2AAC: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080A2AB4: .4byte sub_80A2AB8 - thumb_func_end objc_8097BBC - - thumb_func_start sub_80A2AB8 -sub_80A2AB8: @ 80A2AB8 - push {r4-r6,lr} - movs r4, 0x1 -_080A2ABC: - ldr r6, _080A2AF8 @ =0x0201fff0 - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, _080A2AFC @ =gSprites - adds r0, r5 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _080A2ABC - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x3A - bl FieldEffectStop - bl sub_8064E2C - bl ScriptContext2_Disable - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_080A2AF8: .4byte 0x0201fff0 -_080A2AFC: .4byte gSprites - thumb_func_end sub_80A2AB8 - - thumb_func_start sub_80A2B00 -sub_80A2B00: @ 80A2B00 - push {lr} - movs r0, 0x80 - bl PlaySE - movs r0, 0x2 - bl FieldEffectActiveListRemove - bl EnableBothScriptContexts - pop {r0} - bx r0 - thumb_func_end sub_80A2B00 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/hall_of_fame.s b/asm/hall_of_fame.s index f0295656c..3ad85d7cf 100644 --- a/asm/hall_of_fame.s +++ b/asm/hall_of_fame.s @@ -539,11 +539,11 @@ sub_8142274: @ 8142274 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r1, _081422A8 @ =gUnknown_03005EBC + ldr r1, _081422A8 @ =gGameContinueCallback ldr r0, _081422AC @ =sub_8141FC4 str r0, [r1] movs r0, 0x3 - bl sub_8125D44 + bl TrySavingData movs r0, 0x37 bl PlaySE ldr r1, _081422B0 @ =gTasks @@ -559,7 +559,7 @@ sub_8142274: @ 8142274 pop {r0} bx r0 .align 2, 0 -_081422A8: .4byte gUnknown_03005EBC +_081422A8: .4byte gGameContinueCallback _081422AC: .4byte sub_8141FC4 _081422B0: .4byte gTasks _081422B4: .4byte sub_81422B8 diff --git a/asm/item_menu.s b/asm/item_menu.s index b5ed56b69..29109f3d9 100644 --- a/asm/item_menu.s +++ b/asm/item_menu.s @@ -5128,7 +5128,7 @@ sub_80A599C: @ 80A599C movs r4, 0 strh r2, [r1, 0x18] strh r3, [r1, 0x1A] - ldr r1, _080A59CC @ =gUnknown_03005CE0 + ldr r1, _080A59CC @ =gLastFieldPokeMenuOpened strb r4, [r1] bl sub_80A5AE4 pop {r4} @@ -5137,7 +5137,7 @@ sub_80A599C: @ 80A599C .align 2, 0 _080A59C4: .4byte gTasks _080A59C8: .4byte sub_805469C -_080A59CC: .4byte gUnknown_03005CE0 +_080A59CC: .4byte gLastFieldPokeMenuOpened thumb_func_end sub_80A599C thumb_func_start sub_80A59D0 diff --git a/asm/item_use.s b/asm/item_use.s index c4f6fb74a..66b9d7800 100644 --- a/asm/item_use.s +++ b/asm/item_use.s @@ -6,147 +6,6 @@ .text - thumb_func_start sub_80C962C -sub_80C962C: @ 80C962C - push {r4-r6,lr} - lsls r1, 16 - lsrs r3, r1, 16 - lsls r2, 16 - lsrs r4, r2, 16 - ldrb r2, [r0, 0x3] - ldr r5, [r0, 0x10] - movs r1, 0 - cmp r1, r2 - bge _080C9680 - lsls r0, r3, 16 - asrs r6, r0, 16 - lsls r0, r4, 16 - asrs r4, r0, 16 - adds r3, r5, 0 -_080C964A: - ldrb r0, [r3, 0x5] - cmp r0, 0x7 - bne _080C9678 - ldrh r0, [r3] - cmp r6, r0 - bne _080C9678 - ldrh r0, [r3, 0x2] - cmp r4, r0 - bne _080C9678 - movs r1, 0x96 - lsls r1, 2 - adds r0, r1, 0 - ldrh r3, [r3, 0xA] - adds r0, r3 - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080C9680 - movs r0, 0x1 - b _080C9682 -_080C9678: - adds r3, 0xC - adds r1, 0x1 - cmp r1, r2 - blt _080C964A -_080C9680: - movs r0, 0 -_080C9682: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80C962C - - thumb_func_start sub_80C9688 -sub_80C9688: @ 80C9688 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - bl mapconnection_get_mapheader - adds r3, r0, 0 - ldrb r0, [r4] - cmp r0, 0x2 - beq _080C96B0 - cmp r0, 0x2 - bgt _080C96A6 - cmp r0, 0x1 - beq _080C96C4 - b _080C9704 -_080C96A6: - cmp r0, 0x3 - beq _080C96DC - cmp r0, 0x4 - beq _080C96E6 - b _080C9704 -_080C96B0: - ldr r0, [r4, 0x4] - adds r0, 0x7 - subs r0, r5, r0 - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, [r3] - ldr r0, [r0, 0x4] - subs r0, 0x7 - adds r0, r6 - b _080C96FA -_080C96C4: - ldr r0, [r4, 0x4] - adds r0, 0x7 - subs r0, r5, r0 - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, _080C96D8 @ =gMapHeader - ldr r0, [r0] - ldr r0, [r0, 0x4] - b _080C96F6 - .align 2, 0 -_080C96D8: .4byte gMapHeader -_080C96DC: - ldr r0, [r3] - ldr r0, [r0] - subs r0, 0x7 - adds r0, r5 - b _080C96F0 -_080C96E6: - ldr r0, _080C9700 @ =gMapHeader - ldr r0, [r0] - ldr r0, [r0] - adds r0, 0x7 - subs r0, r5, r0 -_080C96F0: - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, [r4, 0x4] -_080C96F6: - adds r0, 0x7 - subs r0, r6, r0 -_080C96FA: - lsls r0, 16 - lsrs r2, r0, 16 - b _080C9708 - .align 2, 0 -_080C9700: .4byte gMapHeader -_080C9704: - movs r0, 0 - b _080C971A -_080C9708: - ldr r0, [r3, 0x4] - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - bl sub_80C962C - lsls r0, 24 - lsrs r0, 24 -_080C971A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80C9688 - thumb_func_start sub_80C9720 sub_80C9720: @ 80C9720 push {r4-r7,lr} @@ -1033,13 +892,13 @@ ItemUseOutOfBattle_SacredAsh: @ 80C9DCC push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 - ldr r1, _080C9DDC @ =gUnknown_03005CE0 + ldr r1, _080C9DDC @ =gLastFieldPokeMenuOpened movs r0, 0 strb r0, [r1] movs r5, 0 b _080C9DE6 .align 2, 0 -_080C9DDC: .4byte gUnknown_03005CE0 +_080C9DDC: .4byte gLastFieldPokeMenuOpened _080C9DE0: adds r0, r5, 0x1 lsls r0, 24 @@ -1062,7 +921,7 @@ _080C9DE6: bl GetMonData cmp r0, 0 bne _080C9DE0 - ldr r0, _080C9E2C @ =gUnknown_03005CE0 + ldr r0, _080C9E2C @ =gLastFieldPokeMenuOpened strb r5, [r0] _080C9E10: ldr r1, _080C9E30 @ =gUnknown_03004AE4 @@ -1078,7 +937,7 @@ _080C9E10: bx r0 .align 2, 0 _080C9E28: .4byte gPlayerParty -_080C9E2C: .4byte gUnknown_03005CE0 +_080C9E2C: .4byte gLastFieldPokeMenuOpened _080C9E30: .4byte gUnknown_03004AE4 _080C9E34: .4byte sub_8070048 _080C9E38: .4byte gUnknown_02038561 diff --git a/asm/party_menu.s b/asm/party_menu.s index 02959f0c3..f405d174a 100644 --- a/asm/party_menu.s +++ b/asm/party_menu.s @@ -10413,13 +10413,13 @@ _080702B0: ldr r1, [r4, 0x10] str r1, [r0] _080702C6: - ldr r1, _080702D4 @ =gUnknown_03005CE0 + ldr r1, _080702D4 @ =gLastFieldPokeMenuOpened movs r0, 0 strb r0, [r1] b _080702DE .align 2, 0 _080702D0: .4byte gTasks -_080702D4: .4byte gUnknown_03005CE0 +_080702D4: .4byte gLastFieldPokeMenuOpened _080702D8: adds r0, r5, 0 bl sub_8070088 diff --git a/asm/pokemon_menu.s b/asm/pokemon_menu.s index 1ceaaff4f..2f1c16f8c 100644 --- a/asm/pokemon_menu.s +++ b/asm/pokemon_menu.s @@ -31,7 +31,7 @@ sub_8089A8C: @ 8089A8C ldr r5, _08089AD0 @ =gUnknown_0202FFA9 movs r0, 0 strb r0, [r5] - ldr r0, _08089AD4 @ =gUnknown_03005CE0 + ldr r0, _08089AD4 @ =gLastFieldPokeMenuOpened ldrb r1, [r0] movs r0, 0x64 muls r0, r1 @@ -57,7 +57,7 @@ sub_8089A8C: @ 8089A8C b _08089BC8 .align 2, 0 _08089AD0: .4byte gUnknown_0202FFA9 -_08089AD4: .4byte gUnknown_03005CE0 +_08089AD4: .4byte gLastFieldPokeMenuOpened _08089AD8: .4byte gPlayerParty _08089ADC: .4byte gUnknown_0202FFAA _08089AE0: @@ -73,7 +73,7 @@ _08089AE8: beq _08089B48 ldr r5, _08089B24 @ =gUnknown_0839F554 _08089AF4: - ldr r0, _08089B28 @ =gUnknown_03005CE0 + ldr r0, _08089B28 @ =gLastFieldPokeMenuOpened ldrb r1, [r0] movs r0, 0x64 muls r0, r1 @@ -97,7 +97,7 @@ _08089AF4: b _08089B48 .align 2, 0 _08089B24: .4byte gUnknown_0839F554 -_08089B28: .4byte gUnknown_03005CE0 +_08089B28: .4byte gLastFieldPokeMenuOpened _08089B2C: .4byte gPlayerParty _08089B30: .4byte gUnknown_0202FFAA _08089B34: .4byte gUnknown_0202FFA9 @@ -132,7 +132,7 @@ _08089B48: movs r2, 0x1 bl AppendToList _08089B76: - ldr r0, _08089BB0 @ =gUnknown_03005CE0 + ldr r0, _08089BB0 @ =gLastFieldPokeMenuOpened ldrb r1, [r0] movs r0, 0x64 muls r0, r1 @@ -156,7 +156,7 @@ _08089B76: _08089BA4: .4byte gUnknown_0202FFAA _08089BA8: .4byte gUnknown_0202FFA9 _08089BAC: .4byte gPlayerParty + 1 * 0x64 -_08089BB0: .4byte gUnknown_03005CE0 +_08089BB0: .4byte gLastFieldPokeMenuOpened _08089BB4: adds r0, r4, 0 adds r1, r5, 0 @@ -336,7 +336,7 @@ _08089D04: bl PlaySE adds r0, r4, 0 bl sub_806CA38 - ldr r1, _08089D48 @ =gUnknown_03005CE0 + ldr r1, _08089D48 @ =gLastFieldPokeMenuOpened strb r0, [r1] ldrb r1, [r1] movs r0, 0x64 @@ -361,7 +361,7 @@ _08089D04: bl sub_808B5B4 b _08089D84 .align 2, 0 -_08089D48: .4byte gUnknown_03005CE0 +_08089D48: .4byte gLastFieldPokeMenuOpened _08089D4C: .4byte gPlayerParty _08089D50: .4byte gStringVar1 _08089D54: .4byte gUnknown_0202FFA8 @@ -492,7 +492,7 @@ sub_8089E4C: @ 8089E4C lsrs r1, r0, 24 cmp r1, 0 bne _08089E72 - ldr r0, _08089E7C @ =gUnknown_03005CE0 + ldr r0, _08089E7C @ =gLastFieldPokeMenuOpened strb r1, [r0] ldr r0, _08089E80 @ =sub_805469C bl SetMainCallback2 @@ -504,14 +504,14 @@ _08089E72: bx r0 .align 2, 0 _08089E78: .4byte gPaletteFade -_08089E7C: .4byte gUnknown_03005CE0 +_08089E7C: .4byte gLastFieldPokeMenuOpened _08089E80: .4byte sub_805469C thumb_func_end sub_8089E4C thumb_func_start sub_8089E84 sub_8089E84: @ 8089E84 push {lr} - ldr r0, _08089EAC @ =gUnknown_03005CE0 + ldr r0, _08089EAC @ =gLastFieldPokeMenuOpened ldrb r1, [r0] movs r0, 0x64 muls r0, r1 @@ -528,7 +528,7 @@ sub_8089E84: @ 8089E84 pop {r0} bx r0 .align 2, 0 -_08089EAC: .4byte gUnknown_03005CE0 +_08089EAC: .4byte gLastFieldPokeMenuOpened _08089EB0: .4byte gPlayerParty _08089EB4: .4byte gStringVar1 _08089EB8: .4byte gUnknown_0202FFA8 @@ -561,7 +561,7 @@ _08089ED8: ldrb r0, [r4] movs r1, 0 bl sub_806BF74 - ldr r1, _08089F0C @ =gUnknown_03005CE0 + ldr r1, _08089F0C @ =gLastFieldPokeMenuOpened ldrb r0, [r5] strb r0, [r1] bl sub_8089E84 @@ -572,7 +572,7 @@ _08089F04: pop {r0} bx r0 .align 2, 0 -_08089F0C: .4byte gUnknown_03005CE0 +_08089F0C: .4byte gLastFieldPokeMenuOpened _08089F10: .4byte sub_806AEDC thumb_func_end sub_8089EBC @@ -1126,7 +1126,7 @@ _0808A370: cmp r0, 0x1 bne _0808A364 ldrb r0, [r4] - ldr r1, _0808A39C @ =gUnknown_03005CE0 + ldr r1, _0808A39C @ =gLastFieldPokeMenuOpened ldrb r1, [r1] bl sub_806C994 ldrb r0, [r4] @@ -1139,7 +1139,7 @@ _0808A394: pop {r0} bx r0 .align 2, 0 -_0808A39C: .4byte gUnknown_03005CE0 +_0808A39C: .4byte gLastFieldPokeMenuOpened _0808A3A0: .4byte sub_806AEDC thumb_func_end sub_808A358 @@ -1155,7 +1155,7 @@ _0808A3AA: cmp r0, 0x1 bne _0808A3E4 ldrb r0, [r4] - ldr r1, _0808A3DC @ =gUnknown_03005CE0 + ldr r1, _0808A3DC @ =gLastFieldPokeMenuOpened ldrb r1, [r1] bl sub_806C994 ldrb r0, [r4] @@ -1169,7 +1169,7 @@ _0808A3AA: b _0808A3F0 .align 2, 0 _0808A3D8: .4byte 0x0201b260 -_0808A3DC: .4byte gUnknown_03005CE0 +_0808A3DC: .4byte gLastFieldPokeMenuOpened _0808A3E0: .4byte sub_806AEDC _0808A3E4: bl sub_80F9344 @@ -1205,7 +1205,7 @@ sub_808A3F8: @ 808A3F8 adds r0, r4, 0 movs r1, 0 bl sub_806BD58 - ldr r0, _0808A46C @ =gUnknown_03005CE0 + ldr r0, _0808A46C @ =gLastFieldPokeMenuOpened ldrb r1, [r0] adds r0, r4, 0 bl sub_806C994 @@ -1232,7 +1232,7 @@ sub_808A3F8: @ 808A3F8 _0808A460: .4byte gScriptItemId _0808A464: .4byte sub_808A330 _0808A468: .4byte gPaletteFade -_0808A46C: .4byte gUnknown_03005CE0 +_0808A46C: .4byte gLastFieldPokeMenuOpened _0808A470: .4byte gPlayerParty _0808A474: .4byte sub_808A34C _0808A478: @@ -1298,7 +1298,7 @@ _0808A4EC: cmp r0, 0x1 bne _0808A4E0 ldrb r0, [r4] - ldr r1, _0808A518 @ =gUnknown_03005CE0 + ldr r1, _0808A518 @ =gLastFieldPokeMenuOpened ldrb r1, [r1] bl sub_806C994 ldrb r0, [r4] @@ -1311,7 +1311,7 @@ _0808A510: pop {r0} bx r0 .align 2, 0 -_0808A518: .4byte gUnknown_03005CE0 +_0808A518: .4byte gLastFieldPokeMenuOpened _0808A51C: .4byte sub_806AEDC thumb_func_end sub_808A4D4 @@ -1334,7 +1334,7 @@ sub_808A520: @ 808A520 movs r1, 0x1 bl RemoveBagItem _0808A542: - ldr r6, _0808A590 @ =gUnknown_03005CE0 + ldr r6, _0808A590 @ =gLastFieldPokeMenuOpened ldrb r0, [r6] movs r5, 0x64 muls r0, r5 @@ -1366,7 +1366,7 @@ _0808A542: _0808A584: .4byte gPaletteFade _0808A588: .4byte gScriptResult _0808A58C: .4byte gUnknown_0202E8F8 -_0808A590: .4byte gUnknown_03005CE0 +_0808A590: .4byte gLastFieldPokeMenuOpened _0808A594: .4byte gPlayerParty _0808A598: .4byte sub_8089CD4 _0808A59C: @@ -1397,7 +1397,7 @@ sub_808A5BC: @ 808A5BC ands r0, r1 cmp r0, 0 bne _0808A5EA - ldr r0, _0808A5F4 @ =gUnknown_03005CE0 + ldr r0, _0808A5F4 @ =gLastFieldPokeMenuOpened ldrb r0, [r0] ldr r1, _0808A5F8 @ =gScriptItemId ldrh r1, [r1] @@ -1416,7 +1416,7 @@ _0808A5EA: bx r0 .align 2, 0 _0808A5F0: .4byte gPaletteFade -_0808A5F4: .4byte gUnknown_03005CE0 +_0808A5F4: .4byte gLastFieldPokeMenuOpened _0808A5F8: .4byte gScriptItemId _0808A5FC: .4byte gTasks _0808A600: .4byte sub_808A1E0 @@ -1755,7 +1755,7 @@ _0808A8A4: .4byte sub_808A8A8 sub_808A8A8: @ 808A8A8 push {lr} ldr r1, _0808A8C4 @ =gUnknown_020384F0 - ldr r0, _0808A8C8 @ =gUnknown_03005CE0 + ldr r0, _0808A8C8 @ =gLastFieldPokeMenuOpened ldrb r0, [r0] strb r0, [r1] ldr r0, _0808A8CC @ =0x0201b000 @@ -1768,7 +1768,7 @@ sub_808A8A8: @ 808A8A8 bx r0 .align 2, 0 _0808A8C4: .4byte gUnknown_020384F0 -_0808A8C8: .4byte gUnknown_03005CE0 +_0808A8C8: .4byte gLastFieldPokeMenuOpened _0808A8CC: .4byte 0x0201b000 _0808A8D0: .4byte 0x00000262 thumb_func_end sub_808A8A8 @@ -2129,7 +2129,7 @@ sub_808ABA8: @ 808ABA8 lsrs r0, 24 cmp r0, 0x1 bne _0808ABDE - ldr r0, _0808ABE4 @ =gUnknown_03005CE0 + ldr r0, _0808ABE4 @ =gLastFieldPokeMenuOpened ldrb r1, [r0] movs r0, 0x64 muls r0, r1 @@ -2149,7 +2149,7 @@ _0808ABDE: pop {r0} bx r0 .align 2, 0 -_0808ABE4: .4byte gUnknown_03005CE0 +_0808ABE4: .4byte gLastFieldPokeMenuOpened _0808ABE8: .4byte gPlayerParty _0808ABEC: .4byte gUnknown_0202FF84 _0808ABF0: .4byte gUnknown_03005CE4 @@ -2190,7 +2190,7 @@ _0808AC28: .4byte gMain sub_808AC2C: @ 808AC2C push {lr} ldr r0, _0808AC40 @ =gUnknown_0202FF84 - ldr r1, _0808AC44 @ =gUnknown_03005CE0 + ldr r1, _0808AC44 @ =gLastFieldPokeMenuOpened ldrb r1, [r1] str r1, [r0] movs r0, 0x9 @@ -2199,7 +2199,7 @@ sub_808AC2C: @ 808AC2C bx r0 .align 2, 0 _0808AC40: .4byte gUnknown_0202FF84 -_0808AC44: .4byte gUnknown_03005CE0 +_0808AC44: .4byte gLastFieldPokeMenuOpened thumb_func_end sub_808AC2C thumb_func_start SetUpFieldMove_Surf @@ -2239,7 +2239,7 @@ _0808AC86: sub_808AC8C: @ 808AC8C push {lr} ldr r0, _0808ACA0 @ =gUnknown_0202FF84 - ldr r1, _0808ACA4 @ =gUnknown_03005CE0 + ldr r1, _0808ACA4 @ =gLastFieldPokeMenuOpened ldrb r1, [r1] str r1, [r0] movs r0, 0x1F @@ -2248,7 +2248,7 @@ sub_808AC8C: @ 808AC8C bx r0 .align 2, 0 _0808ACA0: .4byte gUnknown_0202FF84 -_0808ACA4: .4byte gUnknown_03005CE0 +_0808ACA4: .4byte gLastFieldPokeMenuOpened thumb_func_end sub_808AC8C thumb_func_start SetUpFieldMove_Fly @@ -2320,7 +2320,7 @@ _0808AD24: cmp r0, 0x1 bne _0808AD18 ldrb r0, [r4] - ldr r1, _0808AD50 @ =gUnknown_03005CE0 + ldr r1, _0808AD50 @ =gLastFieldPokeMenuOpened ldrb r1, [r1] bl sub_806C994 ldrb r0, [r4] @@ -2333,7 +2333,7 @@ _0808AD48: pop {r0} bx r0 .align 2, 0 -_0808AD50: .4byte gUnknown_03005CE0 +_0808AD50: .4byte gLastFieldPokeMenuOpened _0808AD54: .4byte sub_806AEDC thumb_func_end sub_808AD0C @@ -2363,7 +2363,7 @@ _0808AD84: .4byte sub_808AD0C thumb_func_start unref_sub_808AD88 unref_sub_808AD88: @ 808AD88 push {lr} - ldr r0, _0808ADA4 @ =gUnknown_03005CE0 + ldr r0, _0808ADA4 @ =gLastFieldPokeMenuOpened ldrb r1, [r0] movs r0, 0x64 muls r0, r1 @@ -2376,7 +2376,7 @@ unref_sub_808AD88: @ 808AD88 pop {r1} bx r1 .align 2, 0 -_0808ADA4: .4byte gUnknown_03005CE0 +_0808ADA4: .4byte gLastFieldPokeMenuOpened _0808ADA8: .4byte gPlayerParty thumb_func_end unref_sub_808AD88 @@ -2384,7 +2384,7 @@ _0808ADA8: .4byte gPlayerParty sub_808ADAC: @ 808ADAC push {lr} ldr r0, _0808ADC0 @ =gUnknown_0202FF84 - ldr r1, _0808ADC4 @ =gUnknown_03005CE0 + ldr r1, _0808ADC4 @ =gLastFieldPokeMenuOpened ldrb r1, [r1] str r1, [r0] movs r0, 0x2C @@ -2393,7 +2393,7 @@ sub_808ADAC: @ 808ADAC bx r0 .align 2, 0 _0808ADC0: .4byte gUnknown_0202FF84 -_0808ADC4: .4byte gUnknown_03005CE0 +_0808ADC4: .4byte gLastFieldPokeMenuOpened thumb_func_end sub_808ADAC thumb_func_start SetUpFieldMove_Dive @@ -2432,7 +2432,7 @@ _0808AE04: .4byte sub_808ADAC sub_808AE08: @ 808AE08 push {lr} ldr r0, _0808AE1C @ =gUnknown_0202FF84 - ldr r1, _0808AE20 @ =gUnknown_03005CE0 + ldr r1, _0808AE20 @ =gLastFieldPokeMenuOpened ldrb r1, [r1] str r1, [r0] movs r0, 0x2B @@ -2441,7 +2441,7 @@ sub_808AE08: @ 808AE08 bx r0 .align 2, 0 _0808AE1C: .4byte gUnknown_0202FF84 -_0808AE20: .4byte gUnknown_03005CE0 +_0808AE20: .4byte gLastFieldPokeMenuOpened thumb_func_end sub_808AE08 thumb_func_start SetUpFieldMove_Waterfall @@ -2648,7 +2648,7 @@ _0808AFBC: _0808AFC2: bl sub_808AF20 _0808AFC6: - ldr r4, _0808B000 @ =gUnknown_03005CE0 + ldr r4, _0808B000 @ =gLastFieldPokeMenuOpened ldrb r0, [r4] cmp r0, 0x5 bhi _0808AFE2 @@ -2666,7 +2666,7 @@ _0808AFE2: strb r0, [r4] _0808AFE6: ldrb r0, [r5] - ldr r1, _0808B000 @ =gUnknown_03005CE0 + ldr r1, _0808B000 @ =gLastFieldPokeMenuOpened ldrb r1, [r1] bl sub_806C994 ldrb r0, [r5] @@ -2676,7 +2676,7 @@ _0808AFE6: bl SetMainCallback2 b _0808B018 .align 2, 0 -_0808B000: .4byte gUnknown_03005CE0 +_0808B000: .4byte gLastFieldPokeMenuOpened _0808B004: .4byte gPlayerParty _0808B008: .4byte sub_806AEDC _0808B00C: @@ -2796,7 +2796,7 @@ _0808B0EC: .4byte gPaletteFade _0808B0F0: adds r0, r4, 0 bl sub_806CA38 - ldr r1, _0808B118 @ =gUnknown_03005CE0 + ldr r1, _0808B118 @ =gLastFieldPokeMenuOpened strb r0, [r1] ldrb r1, [r1] movs r0, 0x64 @@ -2811,7 +2811,7 @@ _0808B0F0: bl PlaySE b _0808B1CE .align 2, 0 -_0808B118: .4byte gUnknown_03005CE0 +_0808B118: .4byte gLastFieldPokeMenuOpened _0808B11C: .4byte gPlayerParty _0808B120: bl sub_806D5A4 @@ -2857,7 +2857,7 @@ _0808B180: .4byte sub_808B2B4 _0808B184: adds r0, r4, 0 bl sub_806CA38 - ldr r1, _0808B1D8 @ =gUnknown_03005CE0 + ldr r1, _0808B1D8 @ =gLastFieldPokeMenuOpened strb r0, [r1] movs r0, 0x5 bl PlaySE @@ -2896,7 +2896,7 @@ _0808B1CE: pop {r0} bx r0 .align 2, 0 -_0808B1D8: .4byte gUnknown_03005CE0 +_0808B1D8: .4byte gLastFieldPokeMenuOpened _0808B1DC: .4byte gUnknown_02038561 _0808B1E0: .4byte gTasks _0808B1E4: .4byte sub_808B25C @@ -3092,7 +3092,7 @@ sub_808B338: @ 808B338 bne _0808B384 adds r0, r5, 0 bl sub_806CA38 - ldr r1, _0808B390 @ =gUnknown_03005CE0 + ldr r1, _0808B390 @ =gLastFieldPokeMenuOpened strb r0, [r1] ldrb r1, [r1] movs r0, 0x64 @@ -3121,7 +3121,7 @@ _0808B384: bx r0 .align 2, 0 _0808B38C: .4byte gPaletteFade -_0808B390: .4byte gUnknown_03005CE0 +_0808B390: .4byte gLastFieldPokeMenuOpened _0808B394: .4byte gPlayerParty _0808B398: .4byte gSaveBlock1 + 0x2B4C _0808B39C: .4byte sub_808B3EC @@ -3147,7 +3147,7 @@ _0808B3B8: cmp r0, 0x1 bne _0808B3AC ldrb r0, [r4] - ldr r1, _0808B3E4 @ =gUnknown_03005CE0 + ldr r1, _0808B3E4 @ =gLastFieldPokeMenuOpened ldrb r1, [r1] bl sub_806C994 ldrb r0, [r4] @@ -3160,7 +3160,7 @@ _0808B3DC: pop {r0} bx r0 .align 2, 0 -_0808B3E4: .4byte gUnknown_03005CE0 +_0808B3E4: .4byte gLastFieldPokeMenuOpened _0808B3E8: .4byte sub_806AEDC thumb_func_end sub_808B3A0 @@ -3187,7 +3187,7 @@ sub_808B3EC: @ 808B3EC movs r1, 0x1 bl RemoveBagItem _0808B416: - ldr r6, _0808B470 @ =gUnknown_03005CE0 + ldr r6, _0808B470 @ =gLastFieldPokeMenuOpened ldrb r0, [r6] movs r5, 0x64 muls r0, r5 @@ -3224,7 +3224,7 @@ _0808B416: _0808B464: .4byte gPaletteFade _0808B468: .4byte gScriptResult _0808B46C: .4byte gUnknown_0202E8F8 -_0808B470: .4byte gUnknown_03005CE0 +_0808B470: .4byte gLastFieldPokeMenuOpened _0808B474: .4byte gPlayerParty _0808B478: .4byte sub_808B25C _0808B47C: .4byte sub_806AEDC @@ -3258,7 +3258,7 @@ sub_808B4A4: @ 808B4A4 ands r0, r1 cmp r0, 0 bne _0808B4D2 - ldr r0, _0808B4DC @ =gUnknown_03005CE0 + ldr r0, _0808B4DC @ =gLastFieldPokeMenuOpened ldrb r0, [r0] ldr r1, _0808B4E0 @ =gScriptItemId ldrh r1, [r1] @@ -3277,7 +3277,7 @@ _0808B4D2: bx r0 .align 2, 0 _0808B4D8: .4byte gPaletteFade -_0808B4DC: .4byte gUnknown_03005CE0 +_0808B4DC: .4byte gLastFieldPokeMenuOpened _0808B4E0: .4byte gScriptItemId _0808B4E4: .4byte gTasks _0808B4E8: .4byte sub_808B4EC diff --git a/asm/reset_rtc_screen.s b/asm/reset_rtc_screen.s index 1b58b417b..2fbc559c8 100644 --- a/asm/reset_rtc_screen.s +++ b/asm/reset_rtc_screen.s @@ -1238,7 +1238,7 @@ _0806AE54: .4byte 0x00004040 _0806AE58: .4byte gSystemText_ClockResetDataSave _0806AE5C: movs r0, 0 - bl sub_8125D44 + bl TrySavingData lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 diff --git a/asm/rom_810CBB4.s b/asm/rom_810CBB4.s index 8eacec455..b4223f094 100644 --- a/asm/rom_810CBB4.s +++ b/asm/rom_810CBB4.s @@ -47,7 +47,7 @@ sub_810CBFC: @ 810CBFC lsls r0, 24 lsrs r0, 24 ldr r2, _0810CC24 @ =gUnknown_0202FF84 - ldr r1, _0810CC28 @ =gUnknown_03005CE0 + ldr r1, _0810CC28 @ =gLastFieldPokeMenuOpened ldrb r1, [r1] str r1, [r2] ldr r2, _0810CC2C @ =gTasks @@ -63,7 +63,7 @@ sub_810CBFC: @ 810CBFC bx r0 .align 2, 0 _0810CC24: .4byte gUnknown_0202FF84 -_0810CC28: .4byte gUnknown_03005CE0 +_0810CC28: .4byte gLastFieldPokeMenuOpened _0810CC2C: .4byte gTasks _0810CC30: .4byte sub_810CC34 thumb_func_end sub_810CBFC diff --git a/asm/rom_81258BC.s b/asm/rom_81258BC.s index a169258ae..aadab16fd 100644 --- a/asm/rom_81258BC.s +++ b/asm/rom_81258BC.s @@ -2244,14 +2244,14 @@ sub_812BFD4: @ 812BFD4 movs r0, 0x33 bl FieldEffectStart ldr r0, _0812BFE8 @ =gUnknown_0202FF84 - ldr r1, _0812BFEC @ =gUnknown_03005CE0 + ldr r1, _0812BFEC @ =gLastFieldPokeMenuOpened ldrb r1, [r1] str r1, [r0] pop {r0} bx r0 .align 2, 0 _0812BFE8: .4byte gUnknown_0202FF84 -_0812BFEC: .4byte gUnknown_03005CE0 +_0812BFEC: .4byte gLastFieldPokeMenuOpened thumb_func_end sub_812BFD4 thumb_func_start FldEff_SweetScent @@ -18242,7 +18242,7 @@ SetUpFieldMove_SoftBoiled: @ 8133CCC push {r4-r6,lr} mov r6, r8 push {r6} - ldr r0, _08133D14 @ =gUnknown_03005CE0 + ldr r0, _08133D14 @ =gLastFieldPokeMenuOpened mov r8, r0 ldrb r0, [r0] movs r6, 0x64 @@ -18273,7 +18273,7 @@ SetUpFieldMove_SoftBoiled: @ 8133CCC movs r0, 0 b _08133D1E .align 2, 0 -_08133D14: .4byte gUnknown_03005CE0 +_08133D14: .4byte gLastFieldPokeMenuOpened _08133D18: .4byte gPlayerParty _08133D1C: movs r0, 0x1 @@ -21701,7 +21701,7 @@ _08135750: .4byte 0x00000564 _08135754: movs r2, 0 ldr r4, _0813576C @ =gSaveBlock2 + 0x565 - ldr r3, _08135770 @ =gUnknown_02039270 + ldr r3, _08135770 @ =gSelectedOrderFromParty _0813575A: adds r0, r2, r4 adds r1, r2, r3 @@ -21713,7 +21713,7 @@ _0813575A: b _0813589A .align 2, 0 _0813576C: .4byte gSaveBlock2 + 0x565 -_08135770: .4byte gUnknown_02039270 +_08135770: .4byte gSelectedOrderFromParty _08135774: ldr r3, _081357C0 @ =0x00000564 adds r0, r5, r3 @@ -22042,7 +22042,7 @@ _08135A10: .4byte 0x00000554 sub_8135A14: @ 8135A14 push {r4,lr} movs r2, 0 - ldr r4, _08135A34 @ =gUnknown_02039270 + ldr r4, _08135A34 @ =gSelectedOrderFromParty ldr r3, _08135A38 @ =gSaveBlock2 + 0x565 _08135A1C: adds r0, r2, r4 @@ -22057,7 +22057,7 @@ _08135A1C: pop {r0} bx r0 .align 2, 0 -_08135A34: .4byte gUnknown_02039270 +_08135A34: .4byte gSelectedOrderFromParty _08135A38: .4byte gSaveBlock2 + 0x565 thumb_func_end sub_8135A14 @@ -22293,7 +22293,7 @@ _08135BF8: orrs r0, r1 strb r0, [r2] movs r0, 0x2 - bl sub_8125D44 + bl TrySavingData pop {r4,r5} pop {r0} bx r0 diff --git a/asm/script_pokemon_util_80C4BF0.s b/asm/script_pokemon_util_80C4BF0.s deleted file mode 100644 index 6777ca135..000000000 --- a/asm/script_pokemon_util_80C4BF0.s +++ /dev/null @@ -1,1399 +0,0 @@ - .include "constants/gba_constants.inc" - .include "constants/species_constants.inc" - .include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start sub_80C4BF0 -sub_80C4BF0: @ 80C4BF0 - push {r4,lr} - ldr r2, _080C4C1C @ =gSaveBlock1 - ldr r1, _080C4C20 @ =gContestMons - ldrb r3, [r1, 0x15] - movs r4, 0x9B - lsls r4, 5 - adds r0, r2, r4 - strh r3, [r0] - adds r0, r1, 0 - adds r0, 0x55 - ldrb r3, [r0] - adds r4, 0x2 - adds r0, r2, r4 - strh r3, [r0] - adds r1, 0x95 - ldrb r0, [r1] - ldr r1, _080C4C24 @ =0x00001364 - adds r2, r1 - strh r0, [r2] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080C4C1C: .4byte gSaveBlock1 -_080C4C20: .4byte gContestMons -_080C4C24: .4byte 0x00001364 - thumb_func_end sub_80C4BF0 - - thumb_func_start sub_80C4C28 -sub_80C4C28: @ 80C4C28 - push {lr} - ldr r0, _080C4C40 @ =gSpecialVar_0x8005 - ldrb r0, [r0] - adds r1, r0, 0 - cmp r0, 0x1 - beq _080C4C4E - cmp r0, 0x1 - bgt _080C4C44 - cmp r0, 0 - beq _080C4C4A - b _080C4C56 - .align 2, 0 -_080C4C40: .4byte gSpecialVar_0x8005 -_080C4C44: - cmp r1, 0x2 - beq _080C4C52 - b _080C4C56 -_080C4C4A: - movs r1, 0x3 - b _080C4C58 -_080C4C4E: - movs r1, 0x4 - b _080C4C58 -_080C4C52: - movs r1, 0x5 - b _080C4C58 -_080C4C56: - movs r1, 0x64 -_080C4C58: - ldr r0, _080C4C60 @ =gSpecialVar_0x8004 - strh r1, [r0] - pop {r0} - bx r0 - .align 2, 0 -_080C4C60: .4byte gSpecialVar_0x8004 - thumb_func_end sub_80C4C28 - - thumb_func_start sub_80C4C64 -sub_80C4C64: @ 80C4C64 - push {lr} - bl sub_80C46EC - bl sub_80C4740 - bl sub_80C48F4 - pop {r0} - bx r0 - thumb_func_end sub_80C4C64 - - thumb_func_start sub_80C4C78 -sub_80C4C78: @ 80C4C78 - push {lr} - ldr r0, _080C4C8C @ =gScriptContestCategory - ldrh r0, [r0] - cmp r0, 0x4 - bhi _080C4CB8 - lsls r0, 2 - ldr r1, _080C4C90 @ =_080C4C94 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .align 2, 0 -_080C4C8C: .4byte gScriptContestCategory -_080C4C90: .4byte _080C4C94 - .align 2, 0 -_080C4C94: - .4byte _080C4CA8 - .4byte _080C4CAC - .4byte _080C4CB0 - .4byte _080C4CB4 - .4byte _080C4CB8 -_080C4CA8: - movs r0, 0x8 - b _080C4CBA -_080C4CAC: - movs r0, 0x9 - b _080C4CBA -_080C4CB0: - movs r0, 0xA - b _080C4CBA -_080C4CB4: - movs r0, 0xB - b _080C4CBA -_080C4CB8: - movs r0, 0xC -_080C4CBA: - ldr r1, _080C4CD0 @ =gSaveBlock1 - lsls r0, 5 - adds r0, r1 - ldr r1, _080C4CD4 @ =0x00002e04 - adds r0, r1 - ldrh r1, [r0] - cmp r1, 0 - bne _080C4CDC - ldr r0, _080C4CD8 @ =gSpecialVar_0x8004 - strh r1, [r0] - b _080C4CE2 - .align 2, 0 -_080C4CD0: .4byte gSaveBlock1 -_080C4CD4: .4byte 0x00002e04 -_080C4CD8: .4byte gSpecialVar_0x8004 -_080C4CDC: - ldr r1, _080C4CE8 @ =gSpecialVar_0x8004 - movs r0, 0x1 - strh r0, [r1] -_080C4CE2: - pop {r0} - bx r0 - .align 2, 0 -_080C4CE8: .4byte gSpecialVar_0x8004 - thumb_func_end sub_80C4C78 - - thumb_func_start sub_80C4CEC -sub_80C4CEC: @ 80C4CEC - push {lr} - movs r0, 0xFF - bl sub_80B2A7C - pop {r0} - bx r0 - thumb_func_end sub_80C4CEC - - thumb_func_start sub_80C4CF8 -sub_80C4CF8: @ 80C4CF8 - push {lr} - ldr r0, _080C4D28 @ =gUnknown_02038690 - ldr r1, _080C4D2C @ =gContestPlayerMonIndex - ldrb r2, [r1] - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _080C4D40 - ldr r0, _080C4D30 @ =gScriptContestRank - ldrh r0, [r0] - cmp r0, 0x3 - bne _080C4D40 - ldr r1, _080C4D34 @ =gUnknown_02038678 - lsls r0, r2, 1 - adds r0, r1 - movs r2, 0 - ldrsh r1, [r0, r2] - ldr r0, _080C4D38 @ =0x0000031f - cmp r1, r0 - ble _080C4D40 - ldr r1, _080C4D3C @ =gSpecialVar_0x8004 - movs r0, 0x1 - b _080C4D44 - .align 2, 0 -_080C4D28: .4byte gUnknown_02038690 -_080C4D2C: .4byte gContestPlayerMonIndex -_080C4D30: .4byte gScriptContestRank -_080C4D34: .4byte gUnknown_02038678 -_080C4D38: .4byte 0x0000031f -_080C4D3C: .4byte gSpecialVar_0x8004 -_080C4D40: - ldr r1, _080C4D4C @ =gSpecialVar_0x8004 - movs r0, 0 -_080C4D44: - strh r0, [r1] - pop {r0} - bx r0 - .align 2, 0 -_080C4D4C: .4byte gSpecialVar_0x8004 - thumb_func_end sub_80C4CF8 - - thumb_func_start sub_80C4D50 -sub_80C4D50: @ 80C4D50 - push {lr} - movs r3, 0 - ldr r0, _080C4D78 @ =gSaveBlock1 - ldr r1, _080C4D7C @ =0x00002f04 - adds r2, r0, r1 - movs r1, 0x4 -_080C4D5C: - ldrh r0, [r2] - cmp r0, 0 - beq _080C4D68 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_080C4D68: - adds r2, 0x20 - subs r1, 0x1 - cmp r1, 0 - bge _080C4D5C - adds r0, r3, 0 - pop {r1} - bx r1 - .align 2, 0 -_080C4D78: .4byte gSaveBlock1 -_080C4D7C: .4byte 0x00002f04 - thumb_func_end sub_80C4D50 - - thumb_func_start sub_80C4D80 -sub_80C4D80: @ 80C4D80 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r0, _080C4EA0 @ =gUnknown_02038670 - mov r12, r0 - ldr r1, _080C4EA4 @ =gSpecialVar_0x8006 - mov r8, r1 - ldr r2, _080C4EA8 @ =gStringVar1 - mov r9, r2 - mov r2, r12 - mov r1, sp - movs r6, 0x3 -_080C4D9E: - ldrh r0, [r2] - strh r0, [r1] - adds r2, 0x2 - adds r1, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _080C4D9E - movs r6, 0 -_080C4DAE: - movs r1, 0x3 - cmp r1, r6 - ble _080C4DD8 -_080C4DB4: - subs r4, r1, 0x1 - lsls r0, r4, 1 - mov r5, sp - adds r3, r5, r0 - lsls r0, r1, 1 - adds r2, r5, r0 - ldrh r5, [r3] - movs r7, 0 - ldrsh r1, [r3, r7] - movs r7, 0 - ldrsh r0, [r2, r7] - cmp r1, r0 - bge _080C4DD2 - strh r5, [r2] - strh r0, [r3] -_080C4DD2: - adds r1, r4, 0 - cmp r1, r6 - bgt _080C4DB4 -_080C4DD8: - adds r6, 0x1 - cmp r6, 0x2 - ble _080C4DAE - mov r2, r8 - ldrh r0, [r2] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - movs r2, 0 - movs r7, 0 - movs r6, 0 - lsls r0, 16 - asrs r4, r0, 16 - adds r3, r0, 0 - mov r1, sp -_080C4DF6: - movs r5, 0 - ldrsh r0, [r1, r5] - cmp r0, r4 - bne _080C4E12 - lsls r0, r2, 24 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r2, r0, 24 - mov r5, r8 - ldrh r5, [r5] - cmp r6, r5 - bne _080C4E12 - adds r7, r2, 0 -_080C4E12: - adds r1, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _080C4DF6 - movs r6, 0 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - asrs r1, r3, 16 - lsls r2, 24 - mov r10, r2 - cmp r0, r1 - beq _080C4E40 - adds r2, r1, 0 - mov r1, sp -_080C4E30: - adds r1, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - bgt _080C4E40 - movs r4, 0 - ldrsh r0, [r1, r4] - cmp r0, r2 - bne _080C4E30 -_080C4E40: - lsls r0, r6, 24 - lsrs r4, r0, 24 - adds r2, r7, 0 - movs r6, 0 - asrs r5, r3, 16 - mov r8, r5 - mov r1, r12 - movs r5, 0 - ldrsh r0, [r1, r5] - cmp r8, r0 - bne _080C4E60 - cmp r7, 0x1 - beq _080C4E78 -_080C4E5A: - subs r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080C4E60: - adds r6, 0x1 - cmp r6, 0x3 - bgt _080C4E78 - lsls r0, r6, 1 - add r0, r12 - asrs r1, r3, 16 - movs r5, 0 - ldrsh r0, [r0, r5] - cmp r1, r0 - bne _080C4E60 - cmp r2, 0x1 - bne _080C4E5A -_080C4E78: - lsls r1, r6, 24 - lsrs r1, 24 - mov r0, r9 - bl sub_80C4698 - ldr r0, _080C4EAC @ =gIsLinkContest - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C4EB8 - ldr r0, _080C4EB0 @ =gStringVar2 - lsls r1, r6, 3 - subs r1, r6 - lsls r1, 2 - ldr r2, _080C4EB4 @ =gLinkPlayers + 0x8 - adds r1, r2 - bl sub_80C4674 - b _080C4EC4 - .align 2, 0 -_080C4EA0: .4byte gUnknown_02038670 -_080C4EA4: .4byte gSpecialVar_0x8006 -_080C4EA8: .4byte gStringVar1 -_080C4EAC: .4byte gIsLinkContest -_080C4EB0: .4byte gStringVar2 -_080C4EB4: .4byte gLinkPlayers + 0x8 -_080C4EB8: - ldr r0, _080C4ED8 @ =gStringVar2 - lsls r1, r6, 6 - ldr r2, _080C4EDC @ =gUnknown_0203857D - adds r1, r2 - bl sub_80C4674 -_080C4EC4: - mov r1, r10 - asrs r0, r1, 24 - cmp r0, 0x1 - beq _080C4ED0 - cmp r7, r0 - bne _080C4EE4 -_080C4ED0: - ldr r0, _080C4EE0 @ =gSpecialVar_0x8006 - strh r4, [r0] - b _080C4EEA - .align 2, 0 -_080C4ED8: .4byte gStringVar2 -_080C4EDC: .4byte gUnknown_0203857D -_080C4EE0: .4byte gSpecialVar_0x8006 -_080C4EE4: - ldr r1, _080C4EFC @ =gSpecialVar_0x8006 - adds r0, r4, 0x4 - strh r0, [r1] -_080C4EEA: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080C4EFC: .4byte gSpecialVar_0x8006 - thumb_func_end sub_80C4D80 - - thumb_func_start ShowContestWinnerCleanup -ShowContestWinnerCleanup: @ 80C4F00 - push {lr} - ldr r0, _080C4F0C @ =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - pop {r0} - bx r0 - .align 2, 0 -_080C4F0C: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music - thumb_func_end ShowContestWinnerCleanup - - thumb_func_start ShowContestWinner -ShowContestWinner: @ 80C4F10 - push {r4-r6,lr} - ldr r6, _080C4F54 @ =gUnknown_0203856C - ldrb r0, [r6] - cmp r0, 0 - beq _080C4F40 - bl sub_80AAF30 - ldr r4, _080C4F58 @ =0x02000000 - ldr r0, _080C4F5C @ =0x00015ddf - adds r1, r4, r0 - movs r5, 0 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0xFE - movs r1, 0 - bl sub_80B2C4C - ldr r1, _080C4F60 @ =0x00015dde - adds r4, r1 - strb r0, [r4] - movs r0, 0x3 - bl sub_80B2A7C - strb r5, [r6] -_080C4F40: - ldr r0, _080C4F64 @ =CB2_ContestPainting - bl SetMainCallback2 - ldr r1, _080C4F68 @ =gMain - ldr r0, _080C4F6C @ =ShowContestWinnerCleanup - str r0, [r1, 0x8] - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_080C4F54: .4byte gUnknown_0203856C -_080C4F58: .4byte 0x02000000 -_080C4F5C: .4byte 0x00015ddf -_080C4F60: .4byte 0x00015dde -_080C4F64: .4byte CB2_ContestPainting -_080C4F68: .4byte gMain -_080C4F6C: .4byte ShowContestWinnerCleanup - thumb_func_end ShowContestWinner - - thumb_func_start sub_80C4F70 -sub_80C4F70: @ 80C4F70 - push {r4,lr} - ldr r0, _080C4FA8 @ =0x00004010 - ldr r4, _080C4FAC @ =gContestMons - ldrb r1, [r4, 0x15] - bl VarSet - ldr r0, _080C4FB0 @ =0x00004011 - adds r1, r4, 0 - adds r1, 0x55 - ldrb r1, [r1] - bl VarSet - ldr r0, _080C4FB4 @ =0x00004012 - adds r1, r4, 0 - adds r1, 0x95 - ldrb r1, [r1] - bl VarSet - ldr r0, _080C4FB8 @ =0x00004013 - adds r1, r4, 0 - adds r1, 0xD5 - ldrb r1, [r1] - bl VarSet - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080C4FA8: .4byte 0x00004010 -_080C4FAC: .4byte gContestMons -_080C4FB0: .4byte 0x00004011 -_080C4FB4: .4byte 0x00004012 -_080C4FB8: .4byte 0x00004013 - thumb_func_end sub_80C4F70 - - thumb_func_start GiveMonArtistRibbon -GiveMonArtistRibbon: @ 80C4FBC - push {r4-r6,lr} - sub sp, 0x4 - ldr r6, _080C501C @ =gUnknown_02038694 - ldrb r0, [r6] - movs r5, 0x64 - muls r0, r5 - ldr r4, _080C5020 @ =gPlayerParty - adds r0, r4 - movs r1, 0x46 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - cmp r0, 0 - bne _080C5038 - ldr r0, _080C5024 @ =gUnknown_02038690 - ldr r1, _080C5028 @ =gContestPlayerMonIndex - ldrb r2, [r1] - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _080C5038 - ldr r0, _080C502C @ =gScriptContestRank - ldrh r0, [r0] - cmp r0, 0x3 - bne _080C5038 - ldr r1, _080C5030 @ =gUnknown_02038678 - lsls r0, r2, 1 - adds r0, r1 - movs r2, 0 - ldrsh r1, [r0, r2] - ldr r0, _080C5034 @ =0x0000031f - cmp r1, r0 - ble _080C5038 - movs r1, 0x1 - mov r0, sp - strb r1, [r0] - ldrb r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0x46 - mov r2, sp - bl SetMonData - movs r0, 0x1 - b _080C503A - .align 2, 0 -_080C501C: .4byte gUnknown_02038694 -_080C5020: .4byte gPlayerParty -_080C5024: .4byte gUnknown_02038690 -_080C5028: .4byte gContestPlayerMonIndex -_080C502C: .4byte gScriptContestRank -_080C5030: .4byte gUnknown_02038678 -_080C5034: .4byte 0x0000031f -_080C5038: - movs r0, 0 -_080C503A: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end GiveMonArtistRibbon - - thumb_func_start sub_80C5044 -sub_80C5044: @ 80C5044 - ldr r0, _080C504C @ =gUnknown_0203856C - ldrb r0, [r0] - bx lr - .align 2, 0 -_080C504C: .4byte gUnknown_0203856C - thumb_func_end sub_80C5044 - - thumb_func_start ShowContestEntryMonPic -ShowContestEntryMonPic: @ 80C5050 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r4, _080C513C @ =sub_80C5190 - adds r0, r4, 0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080C512A - movs r0, 0xA - mov r10, r0 - movs r7, 0x3 - movs r1, 0x3 - movs r2, 0x13 - movs r3, 0xD - bl MenuDrawTextWindow - ldr r2, _080C5140 @ =gContestMons - ldr r0, _080C5144 @ =gSpecialVar_0x8006 - ldrh r1, [r0] - lsls r1, 6 - adds r0, r1, r2 - ldrh r6, [r0] - adds r0, r2, 0 - adds r0, 0x38 - adds r0, r1, r0 - ldr r0, [r0] - mov r8, r0 - adds r2, 0x3C - adds r1, r2 - ldr r1, [r1] - mov r9, r1 - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, _080C5148 @ =gTasks - lsls r5, r0, 2 - adds r5, r0 - lsls r5, 3 - adds r5, r1 - movs r0, 0 - strh r0, [r5, 0x8] - strh r6, [r5, 0xA] - lsls r0, r6, 3 - ldr r1, _080C514C @ =gMonFrontPicTable - adds r0, r1 - ldr r1, _080C5150 @ =gMonFrontPicCoords - lsls r2, r6, 2 - adds r2, r1 - ldrb r1, [r2] - ldrb r2, [r2, 0x1] - ldr r4, _080C5154 @ =gUnknown_081FAF4C - ldr r3, [r4] - ldr r4, [r4, 0x4] - str r4, [sp] - str r6, [sp, 0x4] - mov r4, r8 - str r4, [sp, 0x8] - bl HandleLoadSpecialPokePic - adds r0, r6, 0 - mov r1, r9 - mov r2, r8 - bl sub_80409C8 - adds r4, r0, 0 - bl LoadCompressedObjectPalette - adds r0, r6, 0 - movs r1, 0x1 - bl GetMonSpriteTemplate_803C56C - ldr r0, _080C5158 @ =gUnknown_02024E8C - ldrh r1, [r4, 0x4] - strh r1, [r0, 0x2] - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xC] - mov r1, r10 - strh r1, [r5, 0xE] - strh r7, [r5, 0x10] - ldr r3, _080C515C @ =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x1C - adds r0, r1, r0 - ldr r2, _080C5160 @ =SpriteCallbackDummy - str r2, [r0] - adds r1, r3 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] -_080C512A: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080C513C: .4byte sub_80C5190 -_080C5140: .4byte gContestMons -_080C5144: .4byte gSpecialVar_0x8006 -_080C5148: .4byte gTasks -_080C514C: .4byte gMonFrontPicTable -_080C5150: .4byte gMonFrontPicCoords -_080C5154: .4byte gUnknown_081FAF4C -_080C5158: .4byte gUnknown_02024E8C -_080C515C: .4byte gSprites -_080C5160: .4byte SpriteCallbackDummy - thumb_func_end ShowContestEntryMonPic - - thumb_func_start sub_80C5164 -sub_80C5164: @ 80C5164 - push {lr} - ldr r0, _080C5188 @ =sub_80C5190 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080C5184 - ldr r0, _080C518C @ =gTasks - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_080C5184: - pop {r0} - bx r0 - .align 2, 0 -_080C5188: .4byte sub_80C5190 -_080C518C: .4byte gTasks - thumb_func_end sub_80C5164 - - thumb_func_start sub_80C5190 -sub_80C5190: @ 80C5190 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, _080C51B4 @ =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080C5222 - cmp r0, 0x1 - bgt _080C51B8 - cmp r0, 0 - beq _080C51F8 - b _080C5222 - .align 2, 0 -_080C51B4: .4byte gTasks -_080C51B8: - cmp r0, 0x2 - beq _080C51C2 - cmp r0, 0x3 - beq _080C5204 - b _080C5222 -_080C51C2: - movs r0, 0xC - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, _080C5200 @ =gSprites - adds r5, r0, r1 - ldrb r0, [r5, 0x5] - lsrs r0, 4 - bl GetSpritePaletteTagByPaletteNum - lsls r0, 16 - lsrs r0, 16 - bl FreeSpritePaletteByTag - ldrb r0, [r5, 0x1] - lsls r0, 30 - cmp r0, 0 - beq _080C51F2 - ldrb r0, [r5, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix -_080C51F2: - adds r0, r5, 0 - bl DestroySprite -_080C51F8: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080C5222 - .align 2, 0 -_080C5200: .4byte gSprites -_080C5204: - ldrb r2, [r4, 0xE] - adds r0, r2, 0 - ldrb r3, [r4, 0x10] - adds r1, r3, 0 - adds r2, 0x9 - lsls r2, 24 - lsrs r2, 24 - adds r3, 0xA - lsls r3, 24 - lsrs r3, 24 - bl MenuZeroFillWindowRect - adds r0, r5, 0 - bl DestroyTask -_080C5222: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80C5190 - - thumb_func_start ScriptGetMultiplayerId -ScriptGetMultiplayerId: @ 80C5228 - push {r4,lr} - ldr r0, _080C5244 @ =gIsLinkContest - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C524C - ldr r4, _080C5248 @ =gScriptResult - bl GetMultiplayerId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - b _080C5252 - .align 2, 0 -_080C5244: .4byte gIsLinkContest -_080C5248: .4byte gScriptResult -_080C524C: - ldr r1, _080C5258 @ =gScriptResult - movs r0, 0x4 - strh r0, [r1] -_080C5252: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080C5258: .4byte gScriptResult - thumb_func_end ScriptGetMultiplayerId - - thumb_func_start ScriptRandom -ScriptRandom: @ 80C525C - push {r4,lr} - ldr r0, _080C5280 @ =gIsLinkContest - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C5294 - ldr r2, _080C5284 @ =gUnknown_03005D28 - ldr r1, [r2] - ldr r0, _080C5288 @ =0x41c64e6d - muls r0, r1 - ldr r1, _080C528C @ =0x00006073 - adds r0, r1 - str r0, [r2] - lsrs r0, 16 - ldr r4, _080C5290 @ =gScriptResult - b _080C529E - .align 2, 0 -_080C5280: .4byte gIsLinkContest -_080C5284: .4byte gUnknown_03005D28 -_080C5288: .4byte 0x41c64e6d -_080C528C: .4byte 0x00006073 -_080C5290: .4byte gScriptResult -_080C5294: - ldr r4, _080C52AC @ =gScriptResult - bl Random - lsls r0, 16 - lsrs r0, 16 -_080C529E: - ldrh r1, [r4] - bl __umodsi3 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080C52AC: .4byte gScriptResult - thumb_func_end ScriptRandom - - thumb_func_start HealPlayerParty -HealPlayerParty: @ 80C52B0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - mov r8, r0 - ldr r0, _080C536C @ =gPlayerPartyCount - ldrb r0, [r0] - cmp r8, r0 - bcs _080C535C - ldr r1, _080C5370 @ =gPlayerParty - mov r10, r1 - mov r6, sp -_080C52CE: - movs r0, 0x64 - mov r4, r8 - muls r4, r0 - add r4, r10 - adds r0, r4, 0 - movs r1, 0x3A - bl GetMonData - lsls r1, r0, 16 - strb r0, [r6] - lsrs r1, 24 - strb r1, [r6, 0x1] - adds r0, r4, 0 - movs r1, 0x39 - mov r2, sp - bl SetMonData - adds r0, r4, 0 - movs r1, 0x15 - bl GetMonData - lsls r0, 24 - lsrs r7, r0, 24 - movs r5, 0 - movs r1, 0x1 - add r1, r8 - mov r9, r1 -_080C5304: - adds r1, r5, 0 - adds r1, 0xD - adds r0, r4, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r7, 0 - adds r2, r5, 0 - bl CalculatePPWithBonus - strb r0, [r6] - adds r1, r5, 0 - adds r1, 0x11 - adds r0, r4, 0 - mov r2, sp - bl SetMonData - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _080C5304 - movs r0, 0 - strb r0, [r6] - strb r0, [r6, 0x1] - strb r0, [r6, 0x2] - strb r0, [r6, 0x3] - movs r1, 0x64 - mov r0, r8 - muls r0, r1 - add r0, r10 - movs r1, 0x37 - mov r2, sp - bl SetMonData - mov r1, r9 - lsls r0, r1, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, _080C536C @ =gPlayerPartyCount - ldrb r0, [r0] - cmp r8, r0 - bcc _080C52CE -_080C535C: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080C536C: .4byte gPlayerPartyCount -_080C5370: .4byte gPlayerParty - thumb_func_end HealPlayerParty - - thumb_func_start ScriptGiveMon -ScriptGiveMon: @ 80C5374 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x78 - adds r5, r0, 0 - adds r3, r1, 0 - adds r4, r2, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 16 - lsrs r0, r4, 16 - mov r8, r0 - add r6, sp, 0x14 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r3, 0 - movs r3, 0x20 - bl CreateMon - add r0, sp, 0x10 - mov r1, r8 - strb r1, [r0] - lsrs r4, 24 - strb r4, [r0, 0x1] - adds r0, r6, 0 - movs r1, 0xC - add r2, sp, 0x10 - bl SetMonData - adds r0, r6, 0 - bl GiveMonToPlayer - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r5, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0x1 - bgt _080C53E8 - cmp r4, 0 - blt _080C53E8 - adds r0, r5, 0 - movs r1, 0x2 - bl sub_8090D90 - adds r0, r5, 0 - movs r1, 0x3 - bl sub_8090D90 -_080C53E8: - adds r0, r4, 0 - add sp, 0x78 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end ScriptGiveMon - - thumb_func_start ScriptGiveEgg -ScriptGiveEgg: @ 80C53F8 - push {lr} - sub sp, 0x68 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r0, sp - movs r2, 0x1 - bl sub_8042044 - add r2, sp, 0x64 - movs r0, 0x1 - strb r0, [r2] - mov r0, sp - movs r1, 0x2D - bl SetMonData - mov r0, sp - bl GiveMonToPlayer - lsls r0, 24 - lsrs r0, 24 - add sp, 0x68 - pop {r1} - bx r1 - thumb_func_end ScriptGiveEgg - - thumb_func_start CheckForAlivePartyMons -CheckForAlivePartyMons: @ 80C5428 - push {lr} - bl sub_803DAA0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - beq _080C5444 - cmp r1, 0x1 - bgt _080C5440 - cmp r1, 0 - beq _080C5444 - b _080C5448 -_080C5440: - cmp r1, 0x2 - bne _080C5448 -_080C5444: - ldr r0, _080C544C @ =gScriptResult - strh r1, [r0] -_080C5448: - pop {r0} - bx r0 - .align 2, 0 -_080C544C: .4byte gScriptResult - thumb_func_end CheckForAlivePartyMons - - thumb_func_start CheckPartyMonHasHeldItem -CheckPartyMonHasHeldItem: @ 80C5450 - push {r4-r7,lr} - lsls r0, 16 - lsrs r6, r0, 16 - movs r5, 0 - movs r7, 0xCE - lsls r7, 1 -_080C545C: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, _080C548C @ =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _080C5490 - cmp r0, r7 - beq _080C5490 - adds r0, r4, 0 - movs r1, 0xC - bl GetMonData - cmp r0, r6 - bne _080C5490 - movs r0, 0x1 - b _080C5498 - .align 2, 0 -_080C548C: .4byte gPlayerParty -_080C5490: - adds r5, 0x1 - cmp r5, 0x5 - ble _080C545C - movs r0, 0 -_080C5498: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end CheckPartyMonHasHeldItem - - thumb_func_start GetNameOfEnigmaBerryInPlayerParty -GetNameOfEnigmaBerryInPlayerParty: @ 80C54A0 - push {r4,lr} - movs r0, 0xAF - bl CheckPartyMonHasHeldItem - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - cmp r4, 0x1 - bne _080C54C2 - movs r0, 0xAF - bl ItemIdToBerryType - lsls r0, 24 - lsrs r0, 24 - ldr r1, _080C54CC @ =gStringVar1 - bl GetBerryNameByBerryType -_080C54C2: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .align 2, 0 -_080C54CC: .4byte gStringVar1 - thumb_func_end GetNameOfEnigmaBerryInPlayerParty - - thumb_func_start ScriptWildBattle -ScriptWildBattle: @ 80C54D0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - lsls r7, r2, 16 - lsrs r6, r7, 16 - bl ZeroEnemyPartyMons - ldr r0, _080C552C @ =gEnemyParty - mov r8, r0 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - mov r0, r8 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x20 - bl CreateMon - cmp r6, 0 - beq _080C551E - add r0, sp, 0x10 - strb r6, [r0] - adds r1, r0, 0 - lsrs r0, r7, 24 - strb r0, [r1, 0x1] - mov r0, r8 - movs r1, 0xC - add r2, sp, 0x10 - bl SetMonData -_080C551E: - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080C552C: .4byte gEnemyParty - thumb_func_end ScriptWildBattle - - thumb_func_start ScriptSetMonMoveSlot -ScriptSetMonMoveSlot: @ 80C5530 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 24 - lsrs r2, 24 - cmp r3, 0x6 - bls _080C554C - ldr r0, _080C5560 @ =gPlayerPartyCount - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_080C554C: - movs r0, 0x64 - muls r0, r3 - ldr r1, _080C5564 @ =gPlayerParty - adds r0, r1 - adds r1, r4, 0 - bl SetMonMoveSlot - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080C5560: .4byte gPlayerPartyCount -_080C5564: .4byte gPlayerParty - thumb_func_end ScriptSetMonMoveSlot - - thumb_func_start sub_80C5568 -sub_80C5568: @ 80C5568 - push {lr} - ldr r1, _080C5578 @ =gMain - ldr r0, _080C557C @ =sub_80C5580 - str r0, [r1, 0x8] - bl sub_8121E10 - pop {r0} - bx r0 - .align 2, 0 -_080C5578: .4byte gMain -_080C557C: .4byte sub_80C5580 - thumb_func_end sub_80C5568 - - thumb_func_start sub_80C5580 -sub_80C5580: @ 80C5580 - push {lr} - ldr r0, _080C5590 @ =gUnknown_02039270 - ldrb r1, [r0] - cmp r1, 0 - bne _080C5598 - ldr r0, _080C5594 @ =gScriptResult - strh r1, [r0] - b _080C559E - .align 2, 0 -_080C5590: .4byte gUnknown_02039270 -_080C5594: .4byte gScriptResult -_080C5598: - ldr r1, _080C55A8 @ =gScriptResult - movs r0, 0x1 - strh r0, [r1] -_080C559E: - ldr r0, _080C55AC @ =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - pop {r0} - bx r0 - .align 2, 0 -_080C55A8: .4byte gScriptResult -_080C55AC: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music - thumb_func_end sub_80C5580 - - thumb_func_start ChooseBattleTowerPlayerParty -ChooseBattleTowerPlayerParty: @ 80C55B0 - push {lr} - ldr r1, _080C55C0 @ =gMain - ldr r0, _080C55C4 @ =SetBattleTowerPlayerParty - str r0, [r1, 0x8] - bl sub_8121E34 - pop {r0} - bx r0 - .align 2, 0 -_080C55C0: .4byte gMain -_080C55C4: .4byte SetBattleTowerPlayerParty - thumb_func_end ChooseBattleTowerPlayerParty - - thumb_func_start SetBattleTowerPlayerParty -SetBattleTowerPlayerParty: @ 80C55C8 - push {r4,lr} - ldr r0, _080C55DC @ =gUnknown_02039270 - ldrb r4, [r0] - cmp r4, 0 - bne _080C55E4 - bl LoadPlayerParty - ldr r0, _080C55E0 @ =gScriptResult - strh r4, [r0] - b _080C55EE - .align 2, 0 -_080C55DC: .4byte gUnknown_02039270 -_080C55E0: .4byte gScriptResult -_080C55E4: - bl ReducePlayerPartyToThree - ldr r1, _080C55FC @ =gScriptResult - movs r0, 0x1 - strh r0, [r1] -_080C55EE: - ldr r0, _080C5600 @ =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080C55FC: .4byte gScriptResult -_080C5600: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music - thumb_func_end SetBattleTowerPlayerParty - - thumb_func_start ReducePlayerPartyToThree -ReducePlayerPartyToThree: @ 80C5604 - push {r4-r7,lr} - sub sp, 0x134 - add r0, sp, 0x12C - movs r1, 0 - str r1, [r0] - ldr r2, _080C5674 @ =0x0500004b - mov r1, sp - bl CpuSet - movs r5, 0 - movs r7, 0x64 - ldr r6, _080C5678 @ =gPlayerParty - mov r4, sp -_080C561E: - ldr r0, _080C567C @ =gUnknown_02039270 - adds r1, r5, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _080C5638 - subs r0, 0x1 - adds r1, r0, 0 - muls r1, r7 - adds r1, r6 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy -_080C5638: - adds r4, 0x64 - adds r5, 0x1 - cmp r5, 0x2 - ble _080C561E - add r0, sp, 0x130 - movs r1, 0 - str r1, [r0] - ldr r4, _080C5678 @ =gPlayerParty - ldr r2, _080C5680 @ =0x05000096 - adds r1, r4, 0 - bl CpuSet - mov r5, sp - add r6, sp, 0xC8 -_080C5654: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - adds r5, 0x64 - adds r4, 0x64 - cmp r5, r6 - ble _080C5654 - bl CalculatePlayerPartyCount - add sp, 0x134 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080C5674: .4byte 0x0500004b -_080C5678: .4byte gPlayerParty -_080C567C: .4byte gUnknown_02039270 -_080C5680: .4byte 0x05000096 - thumb_func_end ReducePlayerPartyToThree - - .align 2, 0 @ Don't pad with nop. diff --git a/data/diploma.s b/data/diploma.s index c4edb83d8..508e86c63 100644 --- a/data/diploma.s +++ b/data/diploma.s @@ -3,15 +3,3 @@ .section .rodata - .align 2 -gDiplomaPalettes:: @ 840CB0C - .incbin "graphics/misc/diploma_national.gbapal" - .incbin "graphics/misc/diploma_hoenn.gbapal" - - .align 2 -gDiplomaTilemap:: @ 840CB4C - .incbin "graphics/misc/diploma_map.bin.lz" - - .align 2 -gDiplomaTiles:: @ 840D288 - .incbin "graphics/misc/diploma.4bpp.lz" diff --git a/data/metatile_behavior.s b/data/metatile_behavior.s deleted file mode 100644 index 6588828d0..000000000 --- a/data/metatile_behavior.s +++ /dev/null @@ -1,246 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - -gUnknown_08308E2C:: @ 8308E2C - .byte 0b100 - .byte 0b000 - .byte 0b101 - .byte 0b101 - .byte 0b000 - .byte 0b001 - .byte 0b101 - .byte 0b100 - .byte 0b101 - .byte 0b100 - .byte 0b100 - .byte 0b101 - .byte 0b100 - .byte 0b000 - .byte 0b000 - .byte 0b100 - .byte 0b111 - .byte 0b111 - .byte 0b111 - .byte 0b110 - .byte 0b110 - .byte 0b111 - .byte 0b100 - .byte 0b100 - .byte 0b000 - .byte 0b110 - .byte 0b000 - .byte 0b100 - .byte 0b100 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b100 - .byte 0b100 - .byte 0b111 - .byte 0b100 - .byte 0b101 - .byte 0b101 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b111 - .byte 0b100 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b110 - .byte 0b110 - .byte 0b110 - .byte 0b110 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b110 - .byte 0b110 - .byte 0b100 - .byte 0b110 - .byte 0b000 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b100 - .byte 0b100 - .byte 0b000 - .byte 0b100 - .byte 0b000 - .byte 0b000 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b000 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b100 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 - .byte 0b000 diff --git a/data/multichoice.inc b/data/multichoice.inc deleted file mode 100644 index 256038c23..000000000 --- a/data/multichoice.inc +++ /dev/null @@ -1,471 +0,0 @@ - .align 2 -MultichoiceList_00: - .4byte OtherText_Petalburg, 0 - .4byte OtherText_Slateport, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_02: - .4byte OtherText_Enter, 0 - .4byte OtherText_Info3, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_03: - .4byte OtherText_WhatsAContest, 0 - .4byte OtherText_TypesOfContest, 0 - .4byte OtherText_Ranks, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_04: - .4byte OtherText_CoolContest, 0 - .4byte OtherText_BeautyContest, 0 - .4byte OtherText_CuteContest, 0 - .4byte OtherText_SmartContest, 0 - .4byte OtherText_ToughContest, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_06: - .4byte OtherText_Decoration, 0 - .4byte OtherText_PackUp, 0 - .4byte OtherText_Registry, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_05: - .4byte OtherText_Decoration, 0 - .4byte OtherText_PackUp, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_07: - .4byte OtherText_Register, 0 - .4byte OtherText_Registry, 0 - .4byte OtherText_Information, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_12: - .4byte OtherText_Mach, 0 - .4byte OtherText_Acro, 0 - - .align 2 -MultichoiceList_13: - .4byte OtherText_Poison, 0 - .4byte OtherText_Paralysis, 0 - .4byte OtherText_Sleep, 0 - .4byte OtherText_Burn, 0 - .4byte OtherText_Frozen, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_14: - .4byte OtherText_Dewford, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_16: - .4byte OtherText_SawIt, 0 - .4byte OtherText_NotYet, 0 - - .align 2 -MultichoiceList_17: - .4byte OtherText_Yes, 0 - .4byte OtherText_No, 0 - .4byte OtherText_Info3, 0 - - .align 2 -MultichoiceList_18: - .4byte OtherText_SingleBattle, 0 - .4byte OtherText_DoubleBattle, 0 - .4byte OtherText_MultiBattle, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_19: - .4byte OtherText_Littleroot, 0 - .4byte OtherText_Slateport, 0 - .4byte OtherText_Lilycove, 0 - - .align 2 -MultichoiceList_20: - .4byte OtherText_Yes, 0 - .4byte OtherText_No, 0 - .4byte OtherText_Info3, 0 - - .align 2 -MultichoiceList_23: - .4byte OtherText_MakeAChallenge, 0 - .4byte OtherText_ObtainInformation, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_24: - .4byte OtherText_Lv50_2, 0 - .4byte OtherText_Lv100_2, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_25: - .4byte OtherText_Zigzagoon, 0 - .4byte OtherText_Nincada, 0 - .4byte OtherText_Poochyena, 0 - - .align 2 -MultichoiceList_26: - .4byte OtherText_Nincada2, 0 - .4byte OtherText_Lotad, 0 - .4byte OtherText_Roselia, 0 - - .align 2 -MultichoiceList_27: - .4byte OtherText_Shroomish, 0 - .4byte OtherText_Nincada3, 0 - .4byte OtherText_Surskit, 0 - - .align 2 -MultichoiceList_28: - .4byte OtherText_Treecko, 0 - .4byte OtherText_Torchic, 0 - .4byte OtherText_Mudkip, 0 - - .align 2 -MultichoiceList_29: - .4byte OtherText_Seedot, 0 - .4byte OtherText_Shroomish2, 0 - .4byte OtherText_Spinda, 0 - - .align 2 -MultichoiceList_30: - .4byte OtherText_Shroomish3, 0 - .4byte OtherText_Zigzagoon2, 0 - .4byte OtherText_Wurmple, 0 - - .align 2 -MultichoiceList_31: - .4byte OtherText_PokeBall, 0 - .4byte OtherText_SuperPotion, 0 - .4byte OtherText_SamePrice, 0 - - .align 2 -MultichoiceList_32: - .4byte OtherText_Yen135, 0 - .4byte OtherText_Yen155, 0 - .4byte OtherText_Yen175, 0 - - .align 2 -MultichoiceList_33: - .4byte OtherText_CostMore, 0 - .4byte OtherText_CostLess, 0 - .4byte OtherText_SamePrice2, 0 - - .align 2 -MultichoiceList_34: - .4byte OtherText_MaleSymbol, 0 - .4byte OtherText_FemaleSymbol, 0 - .4byte OtherText_Neither, 0 - - .align 2 -MultichoiceList_35: - .4byte OtherText_Males, 0 - .4byte OtherText_Females, 0 - .4byte OtherText_SameNumber, 0 - - .align 2 -MultichoiceList_36: - .4byte OtherText_Male, 0 - .4byte OtherText_Female, 0 - .4byte OtherText_ItDepends, 0 - - .align 2 -MultichoiceList_37: - .4byte OtherText_Six2, 0 - .4byte OtherText_Eight2, 0 - .4byte OtherText_Ten, 0 - - .align 2 -MultichoiceList_38: - .4byte OtherText_One, 0 - .4byte OtherText_Two, 0 - .4byte OtherText_Three, 0 - - .align 2 -MultichoiceList_39: - .4byte OtherText_Six, 0 - .4byte OtherText_Seven, 0 - .4byte OtherText_Eight, 0 - - .align 2 -MultichoiceList_42: - .4byte OtherText_FreshWater, 0 - .4byte OtherText_SodaPop, 0 - .4byte OtherText_Lemonade, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_43: - .4byte OtherText_HowToRide, 0 - .4byte OtherText_HowToTurn, 0 - .4byte OtherText_SandySlopes, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_44: - .4byte OtherText_Wheelies, 0 - .4byte OtherText_BunnyHops, 0 - .4byte OtherText_Jumping, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_45: - .4byte OtherText_Satisfied, 0 - .4byte OtherText_Dissatisfied, 0 - - .align 2 -MultichoiceList_46: - .4byte OtherText_Deepseatooth, 0 - .4byte OtherText_Deepseascale, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_47: - .4byte OtherText_BlueFlute2, 0 - .4byte OtherText_YellowFlute2, 0 - .4byte OtherText_RedFlute2, 0 - .4byte OtherText_WhiteFlute2, 0 - .4byte OtherText_BlackFlute2, 0 - .4byte OtherText_GlassChair, 0 - .4byte OtherText_GlassDesk, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_48: - .4byte OtherText_TreeckoDoll, 0 - .4byte OtherText_TorchicDoll, 0 - .4byte OtherText_MudkipDoll, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_55: - .4byte OtherText_TM32, 0 - .4byte OtherText_TM29, 0 - .4byte OtherText_TM35, 0 - .4byte OtherText_TM24, 0 - .4byte OtherText_TM13, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_49: - .4byte OtherText_50Coins, 0 - .4byte OtherText_500Coins, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_50: - .4byte OtherText_Excellent, 0 - .4byte OtherText_NotSoHot, 0 - - .align 2 -MultichoiceList_52: - .4byte OtherText_Lilycove, 0 - .4byte OtherText_BattleTower, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_53: - .4byte OtherText_Slateport, 0 - .4byte OtherText_Lilycove, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_54: - .4byte OtherText_Right, 0 - .4byte OtherText_Left, 0 - - .align 2 -MultichoiceList_56: - .4byte OtherText_Slateport, 0 - .4byte OtherText_BattleTower, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_57: - .4byte OtherText_1F_2, 0 - .4byte OtherText_2F_2, 0 - .4byte OtherText_3F_2, 0 - .4byte OtherText_4F_2, 0 - .4byte OtherText_5F_2, 0 - - .align 2 -MultichoiceList_58: - .4byte OtherText_RedShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_59: - .4byte OtherText_YellowShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_60: - .4byte OtherText_RedShard, 0 - .4byte OtherText_YellowShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_61: - .4byte OtherText_BlueShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_62: - .4byte OtherText_RedShard, 0 - .4byte OtherText_BlueShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_63: - .4byte OtherText_YellowShard, 0 - .4byte OtherText_BlueShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_64: - .4byte OtherText_RedShard, 0 - .4byte OtherText_YellowShard, 0 - .4byte OtherText_BlueShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_65: - .4byte OtherText_GreenShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_66: - .4byte OtherText_RedShard, 0 - .4byte OtherText_GreenShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_67: - .4byte OtherText_YellowShard, 0 - .4byte OtherText_GreenShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_68: - .4byte OtherText_RedShard, 0 - .4byte OtherText_YellowShard, 0 - .4byte OtherText_GreenShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_69: - .4byte OtherText_BlueShard, 0 - .4byte OtherText_GreenShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_70: - .4byte OtherText_RedShard, 0 - .4byte OtherText_BlueShard, 0 - .4byte OtherText_GreenShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_71: - .4byte OtherText_YellowShard, 0 - .4byte OtherText_BlueShard, 0 - .4byte OtherText_GreenShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_72: - .4byte OtherText_RedShard, 0 - .4byte OtherText_YellowShard, 0 - .4byte OtherText_BlueShard, 0 - .4byte OtherText_GreenShard, 0 - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -MultichoiceList_01: - .4byte gOtherText_CancelNoTerminator, 0 - - .align 2 -gMultichoiceLists:: @ 83CDE00 - .4byte MultichoiceList_00, 3 - .4byte MultichoiceList_01, 1 - .4byte MultichoiceList_02, 3 - .4byte MultichoiceList_03, 4 - .4byte MultichoiceList_04, 6 - .4byte MultichoiceList_05, 3 - .4byte MultichoiceList_06, 4 - .4byte MultichoiceList_07, 4 - .4byte MultichoiceList_01, 1 - .4byte MultichoiceList_01, 1 - .4byte MultichoiceList_01, 1 - .4byte MultichoiceList_01, 1 - .4byte MultichoiceList_12, 2 - .4byte MultichoiceList_13, 6 - .4byte MultichoiceList_14, 2 - .4byte MultichoiceList_01, 1 - .4byte MultichoiceList_16, 2 - .4byte MultichoiceList_17, 3 - .4byte MultichoiceList_18, 4 - .4byte MultichoiceList_19, 3 - .4byte MultichoiceList_20, 3 - .4byte MultichoiceList_01, 1 - .4byte MultichoiceList_01, 1 - .4byte MultichoiceList_23, 3 - .4byte MultichoiceList_24, 3 - .4byte MultichoiceList_25, 3 - .4byte MultichoiceList_26, 3 - .4byte MultichoiceList_27, 3 - .4byte MultichoiceList_28, 3 - .4byte MultichoiceList_29, 3 - .4byte MultichoiceList_30, 3 - .4byte MultichoiceList_31, 3 - .4byte MultichoiceList_32, 3 - .4byte MultichoiceList_33, 3 - .4byte MultichoiceList_34, 3 - .4byte MultichoiceList_35, 3 - .4byte MultichoiceList_36, 3 - .4byte MultichoiceList_37, 3 - .4byte MultichoiceList_38, 3 - .4byte MultichoiceList_39, 3 - .4byte MultichoiceList_01, 1 - .4byte MultichoiceList_01, 1 - .4byte MultichoiceList_42, 4 - .4byte MultichoiceList_43, 4 - .4byte MultichoiceList_44, 4 - .4byte MultichoiceList_45, 2 - .4byte MultichoiceList_46, 3 - .4byte MultichoiceList_47, 8 - .4byte MultichoiceList_48, 4 - .4byte MultichoiceList_49, 3 - .4byte MultichoiceList_50, 2 - .4byte MultichoiceList_01, 1 - .4byte MultichoiceList_52, 3 - .4byte MultichoiceList_53, 3 - .4byte MultichoiceList_54, 2 - .4byte MultichoiceList_55, 6 - .4byte MultichoiceList_56, 3 - .4byte MultichoiceList_57, 5 - .4byte MultichoiceList_58, 2 - .4byte MultichoiceList_59, 2 - .4byte MultichoiceList_60, 3 - .4byte MultichoiceList_61, 2 - .4byte MultichoiceList_62, 3 - .4byte MultichoiceList_63, 3 - .4byte MultichoiceList_64, 4 - .4byte MultichoiceList_65, 2 - .4byte MultichoiceList_66, 3 - .4byte MultichoiceList_67, 3 - .4byte MultichoiceList_68, 4 - .4byte MultichoiceList_69, 3 - .4byte MultichoiceList_70, 4 - .4byte MultichoiceList_71, 4 - .4byte MultichoiceList_72, 5 diff --git a/data/save.s b/data/save.s deleted file mode 100644 index bcb08e0ca..000000000 --- a/data/save.s +++ /dev/null @@ -1,29 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - - .align 2 -gSaveSectionLocations:: @ 8401DA4 - .4byte gSaveBlock2, 0x890 - .4byte gSaveBlock1 + 0xF80 * 0, 0xF80 - .4byte gSaveBlock1 + 0xF80 * 1, 0xF80 - .4byte gSaveBlock1 + 0xF80 * 2, 0xF80 - .4byte gSaveBlock1 + 0xF80 * 3, 0xC40 - .4byte gPokemonStorage + 0xF80 * 0, 0xF80 - .4byte gPokemonStorage + 0xF80 * 1, 0xF80 - .4byte gPokemonStorage + 0xF80 * 2, 0xF80 - .4byte gPokemonStorage + 0xF80 * 3, 0xF80 - .4byte gPokemonStorage + 0xF80 * 4, 0xF80 - .4byte gPokemonStorage + 0xF80 * 5, 0xF80 - .4byte gPokemonStorage + 0xF80 * 6, 0xF80 - .4byte gPokemonStorage + 0xF80 * 7, 0xF80 - .4byte gPokemonStorage + 0xF80 * 8, 0x7D0 - - .align 2 -gHallOfFameSaveSectionLocations:: @ 8401E14 - .4byte gHallOfFame + 0xF80 * 0, 0xF80 - .4byte gHallOfFame + 0xF80 * 1, 0xF80 - -gUnknown_08401E24:: @ 8401E24 - .byte 0x1E, 0x1F @ flash sectors diff --git a/data/save_failed_screen.s b/data/save_failed_screen.s deleted file mode 100644 index 5d22810ea..000000000 --- a/data/save_failed_screen.s +++ /dev/null @@ -1,10 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - -gSaveFailedClockPal:: @ 8411960 - .incbin "graphics/misc/clock_small.gbapal" - -gSaveFailedClockGfx:: @ 8411980 - .incbin "graphics/misc/clock_small.4bpp.lz" diff --git a/data/script_menu.s b/data/script_menu.s deleted file mode 100644 index e28616300..000000000 --- a/data/script_menu.s +++ /dev/null @@ -1,29 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - -@ 83CD788 - .include "data/multichoice.inc" - - .align 2 -gUnknown_083CE048:: @ 83CE048 - .4byte OtherText_Cool2 - .4byte OtherText_Beauty3 - .4byte OtherText_Cute2 - .4byte OtherText_Smart2 - .4byte OtherText_Tough2 - .4byte OtherText_Normal - .4byte OtherText_Super - .4byte OtherText_Hyper - .4byte OtherText_Master - .4byte OtherText_Cool3 - .4byte OtherText_Beauty4 - .4byte OtherText_Cute3 - .4byte OtherText_Smart3 - .4byte OtherText_Tough3 - .4byte OtherText_Items - .4byte OtherText_KeyItems - .4byte OtherText_Balls - .4byte OtherText_TMsHMs - .4byte OtherText_Berries diff --git a/data/scripts/maps/IslandCave.inc b/data/scripts/maps/IslandCave.inc index b52b13b5a..c5d932a91 100644 --- a/data/scripts/maps/IslandCave.inc +++ b/data/scripts/maps/IslandCave.inc @@ -31,7 +31,7 @@ IslandCave_MapScript1_15EF15:: @ 815EF15 setflag 2133 end -gUnknown_0815EF19:: @ 815EF19 +gIslandCave_EventScript_OpenRegiiceChamber:: @ 815EF19 setmaptile 7, 19, 554, 1 setmaptile 8, 19, 555, 1 setmaptile 9, 19, 556, 1 diff --git a/data/strings.s b/data/strings.s deleted file mode 100644 index f83ad62d0..000000000 --- a/data/strings.s +++ /dev/null @@ -1,2041 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - -gExpandedPlaceholder_Empty:: @ 840DC80 - .string "$" - -gExpandedPlaceholder_Kun:: @ 840DC81 - .string "$" - -gExpandedPlaceholder_Chan:: @ 840DC82 - .string "$" - -gExpandedPlaceholder_Sapphire:: @ 840DC83 - .string "SAPPHIRE$" - -gExpandedPlaceholder_Ruby:: @ 840DC8C - .string "RUBY$" - -gExpandedPlaceholder_Aqua:: @ 840DC91 - .string "AQUA$" - -gExpandedPlaceholder_Magma:: @ 840DC96 - .string "MAGMA$" - -gExpandedPlaceholder_Archie:: @ 840DC9C - .string "ARCHIE$" - -gExpandedPlaceholder_Maxie:: @ 840DCA3 - .string "MAXIE$" - -gExpandedPlaceholder_Kyogre:: @ 840DCA9 - .string "KYOGRE$" - -gExpandedPlaceholder_Groudon:: @ 840DCB0 - .string "GROUDON$" - -gExpandedPlaceholder_Brendan:: @ 840DCB8 - .string "BRENDAN$" - -gExpandedPlaceholder_May:: @ 840DCC0 - .string "MAY$" - -gSystemText_Egg:: @ 840DCC4 - .string "EGG$" - -gSystemText_Pokemon2:: @ 840DCC8 - .string "POKéMON$" - -gMainMenuString_NewGame:: @ 840DCD0 - .string "NEW GAME$" - -gMainMenuString_Continue:: @ 840DCD9 - .string "CONTINUE$" - -gMainMenuString_Option:: @ 840DCE2 - .string "OPTION$" - -gMainMenuString_MysteryEvents:: @ 840DCE9 - .string "MYSTERY EVENTS$" - -SystemText_UpdatingSaveExternal:: - .string "Updating save file using external\ndata. Please wait.$" - -SystemText_SaveUpdated:: - .string "The save file has been updated.$" - -SystemText_SaveUpdatedExchangeBackup:: - .string "The save file has been updated.\pFurther game data cannot be saved\nto the backup memory.\pPlease exchange the backup memory.\pFor details, please contact the\nNintendo Service Center.$" - -SystemText_SaveNotUpdated:: - .string "The save file could not be updated.\pPlease exchange the backup\nmemory.\pFor details, please contact the\nNintendo Service Center.$" - -gSaveFileCorruptMessage:: @ 840DE81 - .string "The save file is corrupt. The\nprevious save file will be loaded.$" - -gSaveFileDeletedMessage:: @ 840DEC2 - .string " The save file has been deleted...$" - -gBoardNotInstalledMessage:: @ 840DEE5 - .string "The 1M sub-circuit board is\nnot installed.$" - -gBatteryDryMessage:: @ 840DF10 - .string "The internal battery has run dry.\nThe game can be played.\pHowever, clock-based events will\nno longer occur.$" - -gMainMenuString_Player:: @ 840DF7C - .string "PLAYER$" - -gMainMenuString_Pokedex:: @ 840DF83 - .string "POKéDEX$" - -gMainMenuString_Time:: @ 840DF8B - .string "TIME$" - -gMainMenuString_Badges:: @ 840DF90 - .string "BADGES$" - -gBirchText_Boy:: - .string "BOY$" -gBirchText_Girl:: - .string "GIRL$" -gBirchText_NewName:: - .string "NEW NAME$" - -gDefaultBoyName1:: - .ifdef SAPPHIRE - .string "SEAN$" - .else - .string "LANDON$" - .endif -gDefaultBoyName2:: - .string "TERRY$" -gDefaultBoyName3:: - .string "SETH$" -gDefaultBoyName4:: - .string "TOM$" - -gDefaultGirlName1:: - .ifdef SAPPHIRE - .string "MARINA$" - .else - .string "TERRA$" - .endif -gDefaultGirlName2:: - .string "KIMMY$" -gDefaultGirlName3:: - .string "NICOLA$" -gDefaultGirlName4:: - .string "SARA$" - -gSystemText_IntroWeCall:: - .string "This is what we call\na POKéMON.$" - -gSystemText_NewPara:: @ 840DFF7 - .string "\p$" - -gDexText_UnknownPoke:: @ 840DFF9 - .string " ????? POKéMON$" @ why 12 spaces? - -gDexText_UnknownHeight:: @ 840E013 - .string "{CLEAR_TO 0x0C}??’??”$" - -gDexText_UnknownWeight:: @ 840E01D - .string "????.? lbs.$" - .string "$" - -gDexText_CryOf:: @ 840E02A - .string "{CLEAR_TO 2}CRY OF$" - .string "$" - -gDexText_SizeComparedTo:: @ 840E035 - .string "SIZE COMPARED TO $" - -gDexText_RegisterComplete:: @ 840E047 - .string "POKéDEX registration completed.$" - -gDexText_Searching:: @ 840E067 - .string "Searching...\nPlease wait.$" - -gDexText_SearchComplete:: @ 840E081 - .string "Search completed.$" - -gDexText_NoMatching:: @ 840E093 - .string "No matching POKéMON were found.$" - -DexText_SearchForPoke:: - .string "Search for POKéMON based on\nselected parameters.$" -DexText_SwitchDex:: - .string "Switch POKéDEX listings.$" -DexText_ReturnToDex:: - .string "Return to the POKéDEX.$" -DexText_SelectDexMode:: - .string "Select the POKéDEX mode.$" -DexText_SelectDexList:: - .string "Select the POKéDEX listing mode.$" -DexText_ListByABC:: - .string "List by the first letter in the name.\n/Spotted POKéMON only.$" -DexText_ListByColor:: - .string "List by body color.\n/Spotted POKéMON only.$" -DexText_ListByType:: - .string "List by type.\n/Owned POKéMON only.$" -DexText_ExecuteSearchSwitch:: - .string "Execute search/switch.$" -DexText_HoennDex:: - .string "HOENN DEX$" -DexText_NationalDex:: - .string "NATIONAL DEX$" -DexText_NumericalMode:: - .string "NUMERICAL MODE$" -DexText_ABCMode:: - .string "A TO Z MODE$" -DexText_HeaviestMode:: - .string "HEAVIEST MODE$" -DexText_LightestMode:: - .string "LIGHTEST MODE$" -DexText_TallestMode:: - .string "TALLEST MODE$" -DexText_SmallestMode:: - .string "SMALLEST MODE$" -DexText_ABC:: - .string "ABC$" -DexText_DEF:: - .string "DEF$" -DexText_GHI:: - .string "GHI$" -DexText_JKL:: - .string "JKL$" -DexText_MNO:: - .string "MNO$" -DexText_PQR:: - .string "PQR$" -DexText_STU:: - .string "STU$" -DexText_VWX:: - .string "VWX$" -DexText_YZ:: - .string "YZ$" -DexText_Red:: - .string "RED$" -DexText_Blue:: - .string "BLUE$" -DexText_Yellow:: - .string "YELLOW$" -DexText_Green:: - .string "GREEN$" -DexText_Black:: - .string "BLACK$" -DexText_Brown:: - .string "BROWN$" -DexText_Purple:: - .string "PURPLE$" -DexText_Gray:: - .string "GRAY$" -DexText_White:: - .string "WHITE$" -DexText_Pink:: - .string "PINK$" -DexText_HoennDex2:: - .string "HOENN region’s POKéDEX$" -DexText_NationalDex2:: - .string "National edition POKéDEX$" -DexText_ListByNumber:: - .string "POKéMON are listed according to their\nnumber.$" -DexText_ListByABC2:: - .string "Spotted and owned POKéMON are listed\nalphabetically.$" -DexText_ListByHeavyToLightest:: - .string "Owned POKéMON are listed from the\nheaviest to the lightest.$" -DexText_ListByLightToHeaviest:: - .string "Owned POKéMON are listed from the\nlightest to the heaviest.$" -DexText_ListByTallToSmallest:: - .string "Owned POKéMON are listed from the\ntallest to the smallest.$" -DexText_ListBySmallToTallest:: - .string "Owned POKéMON are listed from the\nsmallest to the tallest.$" -DexText_Terminator5:: - .string "$" -DexText_DontSpecify:: - .string "DON’T SPECIFY.$" -DexText_None:: - .string "NONE$" -DexText_RightPointingTriangle:: - .string "▶$" @ right-pointing triangle -DexText_Terminator6:: - .string " $" - -gMenuText_WelcomeToHOFAndDexRating:: @ 840E44F - .string "Welcome to the HALL OF FAME!$" - .string "Spotted POKéMON: {STR_VAR_1}!\nOwned POKéMON: {STR_VAR_2}!\pPROF. BIRCH’s POKéDEX rating!\pPROF. BIRCH: Let’s see...\p$" - -gMenuText_HOFSaving:: @ 840E4CD - .string "SAVING...\nDON’T TURN OFF THE POWER.$" - -gMenuText_HOFCorrupt:: @ 840E4F1 - .string "The HALL OF FAME data is corrupt.$" - -gMenuText_HOFNumber:: @ 840E513 - .string "HALL OF FAME No. $" - -gMenuText_HOFCongratulations:: @ 840E525 - .string "LEAGUE CHAMPION!\nCONGRATULATIONS!$" - -gOtherText_Number2:: @ 840E547 - .string "No. $" - -gOtherText_Level3:: @ 840E54C - .string "Lv. $" - -gOtherText_IDNumber:: @ 840E551 - .string "IDNo. /$" - -gOtherText_Name:: @ 840E559 - .string "NAME /$" - -gOtherText_IDNumber2:: @ 840E560 - .string "IDNo. /$" - -gOtherText_BirchInTrouble:: @ 840E568 - .string "{HIGHLIGHT WHITE2}{COLOR DARK_GREY}PROF. BIRCH is in trouble!\nRelease a POKéMON and rescue him!$" - -gOtherText_DoYouChoosePoke:: @ 840E5AB - .string "{HIGHLIGHT WHITE2}{COLOR DARK_GREY}Do you choose this POKéMON?$" - -gOtherText_Poke:: @ 840E5CD - .string "POKéMON$" - -gSystemText_SaveErrorExchangeBackup:: @ 840E5D5 - .string "Save error.\pPlease exchange the\nbackup memory.$" - -gOtherText_FlyToWhere:: @ 840E604 - .string "FLY to where?$" - -OtherText_Use:: - .string "USE$" -OtherText_Toss:: - .string "TOSS$" -OtherText_Register:: - .string "REGISTER$" -OtherText_Give2:: - .string "GIVE$" -OtherText_CheckTag:: - .string "CHECK TAG$" -OtherText_Confirm:: - .string "CONFIRM$" - -gOtherText_Walk:: @ 840E63B - .string "WALK$" - -gUnknownText_Exit:: @ 840E640 - .string "EXIT$" - -gOtherText_CancelNoTerminator:: @ 840E645 - .string "CANCEL$" - -gOtherText_CancelWithTerminator:: @ 840E64C - .string "$CANCEL$" - -OtherText_Item:: - .string "ITEM$" -OtherText_Mail:: - .string "MAIL$" -OtherText_Take2:: - .string "TAKE$" -OtherText_Store:: - .string "STORE$" - -gOtherText_Check:: @ 840E669 - .string "CHECK$" - -gOtherText_None:: @ 840E66F - .string "NONE$" - -gOtherText_ThreeQuestions2:: @ 840E674 - .string "???$" - -gOtherText_FiveQuestionsAndSlash:: @ 840E678 - .string "?????$" - .string "/$" - -gOtherText_OneDash:: @ 840E680 - .string "-$" - -gOtherText_TwoDashes:: @ 840E682 - .string "--$" - -gOtherText_ThreeDashes2:: @ 840E685 - .string "---$" - -gOtherText_MaleSymbol2:: @ 840E689 - .string "♂$" - -gOtherText_FemaleSymbolAndLv:: @ 840E68B - .string "♀$" - .string "Lv.$" - -gOtherText_TallPlusAndRightArrow:: @ 840E691 - .string "{TALL_PLUS}$" - .string "{RIGHT_ARROW}$" - -gMenuText_GoBackToPrev:: @ 840E697 - .string "Go back to the\nprevious menu.$" - -gOtherText_WhatWillYouDo:: @ 840E6B5 - .string "What would you like to do?$" - -gOtherText_xString1:: @ 840E6D0 - .string "×{STR_VAR_1}$" - -gOtherText_Berry2:: @ 840E6D4 - .string " BERRY$" - -gOtherText_Coins2:: @ 840E6DB - .string "{STR_VAR_1} COINS$" - -gOtherText_CloseBag:: @ 840E6E4 - .string "CLOSE BAG$" - -OtherText_TheField3:: - .string "the field.$" -OtherText_TheBattle:: - .string "the battle.$" -OtherText_ThePokeList:: - .string "the POKéMON LIST.$" -OtherText_TheShop:: - .string "the shop.$" -OtherText_TheField:: - .string "the field.$" -OtherText_TheField2:: - .string "the field.$" -OtherText_ThePC:: - .string "the PC.$" - - .align 2 -gUnknown_0840E740:: @ 840E740 - .4byte OtherText_TheField3 - .4byte OtherText_TheBattle - .4byte OtherText_ThePokeList - .4byte OtherText_TheShop - .4byte OtherText_TheField - .4byte OtherText_TheField2 - .4byte OtherText_ThePC - -gOtherText_ReturnTo:: @ 840E75C - .string "Return to$" - -gOtherText_WhatWillYouDo2:: @ 840E766 - .string "What would you\nlike to do?$" - -gOtherText_CantWriteMail:: @ 840E781 - .string "You can’t write\nMAIL here.$" - -gOtherText_NoPokemon:: @ 840E79C - .string "There is no\nPOKéMON.{PAUSE_UNTIL_PRESS}$" - -gOtherText_SwitchWhichItem:: @ 840E7B3 - .string "Switch with which\nitem?$" - -gOtherText_CantBeHeld:: @ 840E7CB - .string "{STR_VAR_1} can’t be held.$" - -gOtherText_CantBeHeldHere:: @ 840E7DD - .string "{STR_VAR_1} can’t be held here.$" - -gOtherText_HowManyToDeposit:: @ 840E7F4 - .string "How many do you\nwant to deposit?$" - -gOtherText_DepositedItems:: @ 840E815 - .string "Deposited {STR_VAR_2}\n{STR_VAR_1}(s).$" - -gOtherText_NoRoomForItems:: @ 840E829 - .string "There’s no room to\nstore items.$" - -gOtherText_CantStoreSomeoneItem:: @ 840E849 - .string "You can’t store\nsomeone else’s item\nin the PC.$" - -gOtherText_TooImportant:: @ 840E878 - .string "That’s much too\nimportant to toss\nout!$" - -gOtherText_HowManyToToss:: @ 840E89F - .string "Toss out how many?$" - -gOtherText_ThrewAwayItem:: @ 840E8B2 - .string "Threw away {STR_VAR_2}\n{STR_VAR_1}(s).$" - -gOtherText_OkayToThrowAwayPrompt:: @ 840E8C7 - .string "Is it okay to\nthrow away {STR_VAR_2}\n{STR_VAR_1}(s)?$" - -gOtherText_DadsAdvice:: @ 840E8EA - .string "DAD’s advice...\n{PLAYER}, there’s a time and place for\leverything!{PAUSE_UNTIL_PRESS}$" - -gOtherText_CantGetOffBike:: @ 840E929 - .string "You can’t dismount your BIKE here.{PAUSE_UNTIL_PRESS}$" - -gOtherText_ItemfinderResponding:: @ 840E94E - .string "Oh!\nThe machine’s responding!\pThere’s an item buried around here!{PAUSE_UNTIL_PRESS}$" - -gOtherText_ItemfinderItemUnderfoot:: @ 840E992 - .string "The machine’s indicating something\nright underfoot!{PAUSE_UNTIL_PRESS}$" - -gOtherText_NoResponse:: @ 840E9C8 - .string "... ... ... ... Nope!\nThere’s no response.{PAUSE_UNTIL_PRESS}$" - -gOtherText_Coins3:: @ 840E9F5 - .string "Your COINS:\n{STR_VAR_1}{PAUSE_UNTIL_PRESS}$" - -gOtherText_BootedTM:: @ 840EA06 - .string "Booted up a TM.$" - -gOtherText_BootedHM:: @ 840EA16 - .string "Booted up an HM.$" - -gOtherText_ContainsMove:: @ 840EA27 - .string "It contained\n{STR_VAR_1}.\pTeach {STR_VAR_1}\nto a POKéMON?$" - -gOtherText_UsedItem:: @ 840EA4F - .string "{PLAYER} used the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" - -gOtherText_RepelLingers:: @ 840EA61 - .string "But the effects of a REPEL lingered\nfrom earlier.{PAUSE_UNTIL_PRESS}$" - -gOtherText_UsedFlute:: @ 840EA95 - .string "{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be lured.{PAUSE_UNTIL_PRESS}$" - -gOtherText_UsedRepel:: @ 840EAC3 - .string "{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be repelled.{PAUSE_UNTIL_PRESS}$" - -gOtherText_BoxIsFull:: @ 840EAF4 - .string "The BOX is full.{PAUSE_UNTIL_PRESS}$" - -gOtherText_Size:: @ 840EB07 - .string "SIZE /$" - -gOtherText_Firm:: @ 840EB0E - .string "FIRM /$" - -gContestStatsText_Unknown1:: @ 840EB15 - .string "{STR_VAR_1}.{STR_VAR_2}”$" - -ContestStatsText_VerySoft:: - .string "Very soft$" -ContestStatsText_Soft:: - .string "Soft$" -ContestStatsText_Hard:: - .string "Hard$" -ContestStatsText_VeryHard:: - .string "Very hard$" -ContestStatsText_SuperHard:: - .string "Super hard$" -ContestStatsText_RedPokeBlock:: - .string "RED {POKEBLOCK}$" -ContestStatsText_BluePokeBlock:: - .string "BLUE {POKEBLOCK}$" -ContestStatsText_PinkPokeBlock:: - .string "PINK {POKEBLOCK}$" -ContestStatsText_GreenPokeBlock:: - .string "GREEN {POKEBLOCK}$" -ContestStatsText_YellowPokeBlock:: - .string "YELLOW {POKEBLOCK}$" -ContestStatsText_PurplePokeBlock:: - .string "PURPLE {POKEBLOCK}$" -ContestStatsText_IndigoPokeBlock:: - .string "INDIGO {POKEBLOCK}$" -ContestStatsText_BrownPokeBlock:: - .string "BROWN {POKEBLOCK}$" -ContestStatsText_LiteBluePokeBlock:: - .string "LITEBLUE {POKEBLOCK}$" -ContestStatsText_OlivePokeBlock:: - .string "OLIVE {POKEBLOCK}$" -ContestStatsText_GrayPokeBlock:: - .string "GRAY {POKEBLOCK}$" -ContestStatsText_BlackPokeBlock:: - .string "BLACK {POKEBLOCK}$" -ContestStatsText_WhitePokeBlock:: - .string "WHITE {POKEBLOCK}$" -ContestStatsText_GoldPokeBlock:: - .string "GOLD {POKEBLOCK}$" - -gContestStatsText_Spicy:: @ 840EBED - .string "SPICY$" - -gContestStatsText_Dry:: @ 840EBF3 - .string "DRY$" - -gContestStatsText_Sweet:: @ 840EBF7 - .string "SWEET$" - -gContestStatsText_Bitter:: @ 840EBFD - .string "BITTER$" - -gContestStatsText_Sour:: @ 840EC04 - .string "SOUR$" - .string "TASTY$" @ tasty is probably unused, but feel isn't. - .string "FEEL$" - -gContestStatsText_StowCase:: @ 840EC14 - .string "Stow CASE.$" - -gContestStatsText_ThrowAwayPrompt:: @ 840EC1F - .string "Throw away this\n{STR_VAR_1}?$" - -gContestStatsText_WasThrownAway:: @ 840EC33 - .string "The {STR_VAR_1}\nwas thrown away.$" - -gContestStatsText_NormallyAte:: @ 840EC4B - .string "{STR_VAR_1} ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" - -gContestStatsText_HappilyAte:: @ 840EC5C - .string "{STR_VAR_1} happily ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" - -gContestStatsText_DisdainfullyAte:: @ 840EC75 - .string "{STR_VAR_1} disdainfully ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" - -MartText_Buy:: - .string "BUY$" -MartText_Sell:: - .string "SELL$" -MartText_Quit2:: - .string "QUIT$" - -gOtherText_QuitShopping:: @ 840ECA1 - .string "Quit shopping.$" - -gOtherText_HowManyYouWant:: @ 840ECB0 - .string "{STR_VAR_1}? Certainly.\nHow many would you like?$" - -gOtherText_ThatWillBe:: @ 840ECD8 - .string "{STR_VAR_1}? And you wanted {STR_VAR_2}?\nThat will be ¥{STR_VAR_3}.$" - -gOtherText_ThatWillBe2:: @ 840ED01 - .string "{STR_VAR_1}, is it?\nThat’ll be ¥{STR_VAR_2}. Do you want it?$" - -gOtherText_ThatWillBe3:: @ 840ED2C - .string "You wanted {STR_VAR_1}?\nThat’ll be ¥{STR_VAR_2}. Will that be okay?$" - -gOtherText_HereYouGo:: @ 840ED5E - .string "Here you go!\nThank you very much.$" - -gOtherText_HereYouGo2:: @ 840ED80 - .string "Thank you!\nI’ll send it to your home PC.$" - -gOtherText_HereYouGo3:: @ 840EDA9 - .string "Thanks!\nI’ll send it to your PC at home.$" - -gOtherText_NotEnoughMoney:: @ 840EDD2 - .string "You don’t have enough money.{PAUSE_UNTIL_PRESS}$" - -gOtherText_NoRoomFor:: @ 840EDF1 - .string "You have no more room for items.{PAUSE_UNTIL_PRESS}$" - -gOtherText_SpaceForIsFull:: @ 840EE14 - .string "The space for {STR_VAR_1} is full.{PAUSE_UNTIL_PRESS}$" - -gOtherText_AnythingElse:: @ 840EE30 - .string "Is there anything else I can help\nyou with?$" - -gOtherText_CanIHelpYou:: @ 840EE5C - .string "Can I help you with anything else?$" - -gOtherText_FreePremierBall:: @ 840EE7F - .string "I’ll throw in a PREMIER BALL, too.{PAUSE_UNTIL_PRESS}$" - -gOtherText_CantBuyThat:: @ 840EEA4 - .string "{STR_VAR_2}? Oh, no.\nI can’t buy that.{PAUSE_UNTIL_PRESS}$" - -gOtherText_HowManyToSell:: @ 840EEC4 - .string "{STR_VAR_2}?\nHow many would you like to sell?$" - -gOtherText_CanPay:: @ 840EEE9 - .string "I can pay ¥{STR_VAR_1}.\nWould that be okay?$" - -gOtherText_SoldItem:: @ 840EF0C - .string "Turned over the {STR_VAR_2}\nand received ¥{STR_VAR_1}.$" - -OtherText_Money:: - .string "¥{STR_VAR_1}$" -OtherText_Shift:: - .string "SHIFT$" -OtherText_SendOut:: - .string "SEND OUT$" -OtherText_Switch2:: - .string "SWITCH$" -OtherText_Summary:: - .string "SUMMARY$" -OtherText_Moves:: - .string "MOVES$" -OtherText_Enter2:: - .string "ENTER$" -OtherText_NoEntry:: - .string "NO ENTRY$" -OtherText_Take:: - .string "TAKE$" -OtherText_Read2:: - .string "READ$" - -gOtherText_Hp2:: @ 840EF72 - .string "HP$" - -gOtherText_SpAtk2:: @ 840EF75 - .string "SP. ATK$" - -gOtherText_SpDef2:: @ 840EF7D - .string "SP. DEF$" - -gOtherText_WontHaveAnyEffect:: @ 840EF85 - .string "It won’t have any effect.{PAUSE_UNTIL_PRESS}$" - -gOtherText_CantUseOnPoke:: @ 840EFA1 - .if REVISION >= 1 - .string "This can’t be used on\nthat POKéMON.{PAUSE_UNTIL_PRESS}$" - .else - .string "This item can’t be used on\nthat POKéMON.{PAUSE_UNTIL_PRESS}$" - .endif - -gOtherText_CantBeSwitched:: @ 840EFCC - .string "{STR_VAR_1} can’t be switched\nout!{PAUSE_UNTIL_PRESS}$" - -gOtherText_AlreadyBattle:: @ 840EFE8 - .string "{STR_VAR_1} is already\nin battle!{PAUSE_UNTIL_PRESS}$" - -gOtherText_AlreadySelected:: @ 840F003 - .string "{STR_VAR_1} has already been\nselected.{PAUSE_UNTIL_PRESS}$" - -gOtherText_NoEnergyLeft:: @ 840F023 - .string "{STR_VAR_1} has no energy\nleft to battle!{PAUSE_UNTIL_PRESS}$" - -gOtherText_CantSwitchPokeWithYours:: @ 840F046 - .string "You can’t switch {STR_VAR_1}’s\nPOKéMON with one of yours!{PAUSE_UNTIL_PRESS}$" - -gOtherText_EGGCantBattle:: @ 840F079 - .string "An EGG can’t battle!{PAUSE_UNTIL_PRESS}$" - -gOtherText_CantBeUsedBadge:: @ 840F090 - .string "This can’t be used until a new\nBADGE is obtained.$" - -gOtherText_NoMoreThreePoke:: @ 840F0C2 - .string "No more than three POKéMON\nmay enter.$" - -gOtherText_SendRemovedMailPrompt:: @ 840F0E8 - .string "Send the removed MAIL to\nyour PC?$" - -gOtherText_MailWasSent:: @ 840F10A - .string "The MAIL was sent to your PC.{PAUSE_UNTIL_PRESS}$" - -gOtherText_MailboxIsFull:: @ 840F12A - .string "Your PC’s MAILBOX is full.{PAUSE_UNTIL_PRESS}$" - -gOtherText_MailRemovedMessageLost:: @ 840F147 - .string "If the MAIL is removed, the\nmessage will be lost. Okay?$" - -gOtherText_MailMustBeRemoved:: @ 840F17F - .string "MAIL must be removed before\nholding an item.{PAUSE_UNTIL_PRESS}$" - -gOtherText_WasGivenToHold:: @ 840F1AE - .string "{STR_VAR_1} was given the\n{STR_VAR_2} to hold.{PAUSE_UNTIL_PRESS}$" - -gOtherText_AlreadyHolding:: @ 840F1CD - .string "{STR_VAR_1} is already holding\none {STR_VAR_2}.\pWould you like to switch the\ntwo items?$" - -gOtherText_NotHoldingAnything:: @ 840F213 - .string "{STR_VAR_1} isn’t\nholding anything.{PAUSE_UNTIL_PRESS}$" - -gOtherText_ReceivedTheThingFrom:: @ 840F230 - .string "Received the {STR_VAR_2}\nfrom {STR_VAR_1}.{PAUSE_UNTIL_PRESS}$" - -gOtherText_MailTaken:: @ 840F24B - .string "MAIL was taken from the\nPOKéMON.{PAUSE_UNTIL_PRESS}$" - -gOtherText_TakenAndReplaced:: @ 840F26E - .string "The {STR_VAR_2} was taken and\nreplaced with the {STR_VAR_1}.{PAUSE_UNTIL_PRESS}$" - -gOtherText_PokeHoldingItemCantMail:: @ 840F29B - .string "This POKéMON is holding an item.\nIt cannot hold MAIL.{PAUSE_UNTIL_PRESS}$" - -gOtherText_MailTransferredMailbox:: @ 840F2D3 - .string "MAIL was transferred from\nthe MAILBOX.{PAUSE_UNTIL_PRESS}$" - -gOtherText_BagFullCannotRemoveItem:: @ 840F2FC - .string "The BAG is full. The POKéMON’s\nitem could not be removed.{PAUSE_UNTIL_PRESS}$" - -gOtherText_LearnedMove:: @ 840F338 - .string "{STR_VAR_1} learned\n{STR_VAR_2}!$" - -gOtherText_NotCompatible:: @ 840F347 - .string "{STR_VAR_1} and {STR_VAR_2}\nare not compatible.\p{STR_VAR_2} can’t be learned.{PAUSE_UNTIL_PRESS}$" - -gOtherText_WantsToLearn:: @ 840F37C - .string "{STR_VAR_1} wants to learn the\nmove {STR_VAR_2}.\pHowever, {STR_VAR_1} already\nknows four moves.\pShould a move be deleted and\nreplaced with {STR_VAR_2}?$" - -gOtherText_StopTryingTo:: @ 840F3F0 - .string "Stop trying to teach\n{STR_VAR_2}?$" - -gOtherText_DidNotLearnMove2:: @ 840F409 - .string "{STR_VAR_1} did not learn the\nmove {STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" - -gOtherText_WhichMoveToForget2:: @ 840F429 - .string "Which move should be forgotten?{PAUSE_UNTIL_PRESS}$" - -gOtherText_ForgetMove123_2:: @ 840F44B - .string "{PAUSE 32}1, {PAUSE 15}2, and{PAUSE 15}... {PAUSE 15}... {PAUSE 15}... {PAUSE 15}{PLAY_SE SE_KON}Poof!\p{STR_VAR_1} forgot how to\nuse {STR_VAR_2}.\pAnd...{PAUSE_UNTIL_PRESS}$" - -gOtherText_AlreadyKnows:: @ 840F49E - .string "{STR_VAR_1} already knows\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" - -gOtherText_HPRestoredBy:: @ 840F4B5 - .string "{STR_VAR_1}’s HP was restored by\n{STR_VAR_2} points.{PAUSE_UNTIL_PRESS}$" - -gOtherText_CuredPoisoning:: @ 840F4DA - .string "{STR_VAR_1} was cured of its\npoisoning.{PAUSE_UNTIL_PRESS}$" - -gOtherText_CuredParalysis:: @ 840F4FB - .string "{STR_VAR_1} was cured of\nparalysis.{PAUSE_UNTIL_PRESS}$" - -gOtherText_WokeUp:: @ 840F518 - .string "{STR_VAR_1} woke up.{PAUSE_UNTIL_PRESS}$" - -gOtherText_BurnHealed:: @ 840F526 - .string "{STR_VAR_1}’s burn was healed.{PAUSE_UNTIL_PRESS}$" - -gOtherText_ThawedOut:: @ 840F53E - .string "{STR_VAR_1} was thawed out.{PAUSE_UNTIL_PRESS}$" - -gOtherText_PPRestored:: @ 840F553 - .string "PP was restored.{PAUSE_UNTIL_PRESS}$" - -gOtherText_RegainedHealth:: @ 840F566 - .string "{STR_VAR_1} regained health.{PAUSE_UNTIL_PRESS}$" - -gOtherText_BecameHealthy:: @ 840F57C - .string "{STR_VAR_1} became healthy.{PAUSE_UNTIL_PRESS}$" - -gOtherText_PPIncreased:: @ 840F591 - .string "{STR_VAR_1}’s PP increased.{PAUSE_UNTIL_PRESS}$" - -gOtherText_ElevatedTo:: @ 840F5A6 - .string "{STR_VAR_1} was elevated to\nLv. {STR_VAR_2}.$" - -gOtherText_WasRaised:: @ 840F5C1 - .string "{STR_VAR_1}’s {STR_VAR_2} was\nraised.{PAUSE_UNTIL_PRESS}$" - -gOtherText_SnapConfusion:: @ 840F5D7 - .string "{STR_VAR_1} snapped out of its\nconfusion.{PAUSE_UNTIL_PRESS}$" - -gOtherText_GotOverLove:: @ 840F5FA - .string "{STR_VAR_1} got over its\ninfatuation.{PAUSE_UNTIL_PRESS}$" - -OtherText_ChoosePoke:: - .string "Choose a POKéMON.$" -OtherText_MovePokeTo:: - .string "Move to where?$" -OtherText_TeachWhat:: - .string "Teach which POKéMON?$" -OtherText_UseWhat:: - .string "Use on which POKéMON?$" -OtherText_GiveWhat:: - .string "Give to which POKéMON?$" -OtherText_DoWhat:: - .string "Do what with {STR_VAR_1}?$" -OtherText_NothingToCut:: - .string "There’s nothing to CUT.$" -OtherText_CantSurf:: - .string "You can’t SURF here.$" -OtherText_AlreadySurfing:: - .string "You’re already SURFING.$" -OtherText_CantUseThatHere:: - .string "Can’t use that here.$" -OtherText_RestoreWhatMove:: - .string "Restore which move?$" -OtherText_BoostPP:: - .string "Boost PP of which move?$" -OtherText_DoWhatWithItem:: - .string "Do what with an item?$" -OtherText_NoPokeForBattle:: - .string "No POKéMON for battle!$" -OtherText_ChoosePoke2:: - .string "Choose a POKéMON.$" -OtherText_NotEnoughHP:: - .string "Not enough HP...$" -OtherText_ThreePokeNeeded:: - .string "Three POKéMON are needed.$" -OtherText_PokeCantBeSame:: - .string "POKéMON can’t be the same.$" -OtherText_NoIdenticalHoldItems:: - .string "No identical hold items.$" -OtherText_TeachWhichPoke:: - .string "Teach which POKéMON?$" - -gOtherText_Attack:: @ 840F7C6 - .string "ATTACK$" - -gOtherText_Defense:: @ 840F7CD - .string "DEFENSE$" - -gOtherText_SpAtk:: @ 840F7D5 - .string "SP. ATK$" - -gOtherText_SpDef:: @ 840F7DD - .string "SP. DEF$" - -gOtherText_Speed:: @ 840F7E5 - .string "SPEED$" - -gOtherText_HP:: @ 840F7EB - .string "HP$" - -gOtherText_Terminator18:: @ 840F7EE - .string "$" - -gOtherText_OriginalTrainer:: @ 840F7EF - .string "OT/$" - -gOtherText_Type2:: @ 840F7F3 - .string "TYPE/$" - -gOtherText_Power2:: @ 840F7F9 - .string "POWER$" - -gOtherText_Accuracy2:: @ 840F7FF - .string "ACCURACY$" - -gOtherText_Appeal2:: @ 840F808 - .string "APPEAL$" - -gOtherText_Jam2:: @ 840F80F - .string "JAM$" - -gOtherText_Status:: @ 840F813 - .string "STATUS$" - -gOtherText_ExpPoints:: @ 840F81A - .string "EXP. POINTS$" - -gOtherText_NextLv:: @ 840F826 - .string "NEXT LV.$" - -gOtherText_Ribbons00:: @ 840F82F - .string "RIBBONS: 00$" - -OtherText_Event:: - .string "EVENT$" -OtherText_Switch:: - .string "SWITCH$" -OtherText_PokeInfo:: - .string "POKéMON INFO$" -OtherText_PokeSkills:: - .string "POKéMON SKILLS$" -OtherText_BattleMoves:: - .string "BATTLE MOVES$" -OtherText_ContestMoves:: - .string "C0NTEST MOVES$" @why the l33t 0, that's stupid -OtherText_Info:: - .string "INFO$" - -gOtherText_EggLongTime:: @ 840F884 - .string "It looks like this EGG will\ntake a long time to hatch.$" - -gOtherText_EggSomeTime:: @ 840F8BB - .string "What will hatch from this?\nIt will take some time.$" - -gOtherText_EggSoon:: @ 840F8EE - .string "It moves occasionally.\nIt should hatch soon.$" - -gOtherText_EggAbout:: @ 840F91B - .string "It’s making sounds.\nIt’s about to hatch!$" - -gOtherText_CantForgetHMs:: @ 840F944 - .string "HM moves can’t be\nforgotten now.$" - -gOtherText_PlayersBase:: @ 840F965 - .string "’s BASE$" - -gOtherText_OkayToDeleteFromRegistry:: @ 840F96D - .string "Is it okay to delete {STR_VAR_1}\nfrom the REGISTRY?$" - -gOtherText_RegisteredDataDeleted:: @ 840F998 - .string "The registered data was deleted.{PAUSE_UNTIL_PRESS}$" - -gSecretBaseText_NoRegistry:: @ 840F9BB - .string "There is no REGISTRY.{PAUSE_UNTIL_PRESS}$" - -SecretBaseText_DelRegist:: - .string "DEL REGIST.$" -SecretBaseText_Decorate:: - .string "DECORATE$" -SecretBaseText_PutAway:: - .string "PUT AWAY$" -SecretBaseText_Toss:: - .string "TOSS$" -SecretBaseText_PutOutDecor:: - .string "Put out the selected decoration item.$" -SecretBaseText_StoreChosenDecor:: - .string "Store the chosen decoration in the PC.$" -SecretBaseText_ThrowAwayDecor:: - .string "Throw away unwanted decorations.$" - -gSecretBaseText_NoDecors:: @ 840FA64 - .string "There are no decorations.{PAUSE_UNTIL_PRESS}$" - -SecretBaseText_Desk:: - .string "DESK$" -SecretBaseText_Chair:: - .string "CHAIR$" -SecretBaseText_Plant:: - .string "PLANT$" -SecretBaseText_Ornament:: - .string "ORNAMENT$" -SecretBaseText_Mat:: - .string "MAT$" -SecretBaseText_Poster:: - .string "POSTER$" -SecretBaseText_Doll:: - .string "DOLL$" -SecretBaseText_Cushion:: - .string "CUSHION$" - -gSecretBaseText_GoldRank:: @ 840FAB2 - .string "GOLD$" - -gSecretBaseText_SilverRank:: @ 840FAB7 - .string "SILVER$" - -gSecretBaseText_PlaceItHere:: @ 840FABE - .string "Place it here?$" - -gSecretBaseText_CantBePlacedHere:: @ 840FACD - .string "It can’t be placed here.$" - -gSecretBaseText_CancelDecorating:: @ 840FAE6 - .string "Cancel decorating?$" - -gSecretBaseText_InUseAlready:: @ 840FAF9 - .string "This is in use already.$" - -gSecretBaseText_NoMoreDecor:: @ 840FB11 - .string "No more decorations can be placed.\nThe most that can be placed is {STR_VAR_1}.$" - -gSecretBaseText_NoMoreDecor2:: @ 840FB57 - .string "No more decorations can be placed.\nThe most that can be placed is {STR_VAR_1}.$" - .string "This can’t be placed here.\nIt must be on a DESK, etc.$" - -gSecretBaseText_DecorCantPlace:: @ 840FBD3 - .string "This decoration can’t be placed in\nyour own room.$" - -gSecretBaseText_DecorInUse:: @ 840FC05 - .string "This decoration is in use.\nIt can’t be thrown away.$" - -gSecretBaseText_WillBeDiscarded:: @ 840FC39 - .string "This {STR_VAR_1} will be discarded.\nIs that okay?$" - -gSecretBaseText_DecorThrownAway:: @ 840FC62 - .string "The decoration item was thrown away.$" - -gSecretBaseText_StopPuttingAwayDecor:: @ 840FC87 - .string "Stop putting away decorations?$" - -gSecretBaseText_NoDecor:: @ 840FCA6 - .string "There is no decoration item here.$" - -gSecretBaseText_ReturnDecor:: @ 840FCC8 - .string "Return this decoration to the PC?$" - -gSecretBaseText_DecorReturned:: @ 840FCEA - .string "The decoration was returned to the PC.$" - -gSecretBaseText_NoDecorInUse:: @ 840FD11 - .string "There are no decorations in use.{PAUSE_UNTIL_PRESS}$" - -SecretBaseText_Tristan:: - .string "TRISTAN$" -SecretBaseText_Philip:: - .string "PHILIP$" -SecretBaseText_Dennis:: - .string "DENNIS$" -SecretBaseText_Roberto:: - .string "ROBERTO$" -SecretBaseText_TurnOff:: - .string "TURN OFF$" -SecretBaseText_Decoration:: - .string "DECORATION$" -SecretBaseText_ItemStorage:: - .string "ITEM STORAGE$" - -gPCText_Mailbox:: @ 840FD73 - .string "MAILBOX$" - -PCText_DepositItem:: - .string "DEPOSIT ITEM$" -PCText_WithdrawItem:: - .string "WITHDRAW ITEM$" -PCText_TossItem:: - .string "TOSS ITEM$" -PCText_StoreItems:: - .string "Store items in the PC.$" -PCText_TakeOutItems:: - .string "Take out items from the PC.$" -PCText_ThrowAwayItems:: - .string "Throw away items stored in the PC.$" - -gOtherText_NoItems:: @ 840FDF6 - .string "There are no items.{PAUSE_UNTIL_PRESS}$" - -gOtherText_NoMoreRoom:: @ 840FE0C - .string "There is no more\nroom in the BAG.$" - -gOtherText_HowManyToWithdraw:: @ 840FE2E - .string "How many do you\nwant to withdraw?$" - -gOtherText_WithdrewThing:: @ 840FE50 - .string "Withdrew {STR_VAR_2}\n{STR_VAR_1}(s).$" - -OtherText_Read:: - .string "READ$" - -gOtherText_MoveToBag:: @ 840FE68 - .string "MOVE TO BAG$" - -OtherText_Give:: - .string "GIVE$" - -gOtherText_NoMailHere:: @ 840FE79 - .string "There’s no MAIL here.{PAUSE_UNTIL_PRESS}$" - -gOtherText_WhatWillYouDoMail:: @ 840FE91 - .string "What would you like to do with\n{STR_VAR_1}’s MAIL?$" - -gOtherText_MessageWillBeLost:: @ 840FEBB - .string "The message will be lost.\nIs that okay?$" - -gOtherText_BagIsFull:: @ 840FEE3 - .string "The BAG is full.{PAUSE_UNTIL_PRESS}$" - -gOtherText_MailWasReturned:: @ 840FEF6 - .string "The MAIL was returned to the BAG\nwith its message erased.{PAUSE_UNTIL_PRESS}$" - -gOtherText_Dad:: @ 840FF32 - .string "DAD$" - -gOtherText_Mom:: @ 840FF36 - .string "MOM$" - -gOtherText_Wallace:: @ 840FF3A - .string "WALLACE$" - -gOtherText_Steven:: @ 840FF42 - .string "STEVEN$" - -gOtherText_Brawly:: @ 840FF49 - .string "BRAWLY$" - -gOtherText_Winona:: @ 840FF50 - .string "WINONA$" - -gOtherText_Phoebe:: @ 840FF57 - .string "PHOEBE$" - -gOtherText_Glacia:: @ 840FF5E - .string "GLACIA$" - -gContestText_ContestWinner:: @ 840FF65 - .string "CONTEST WINNER\n$" - -gOtherText_Unknown1:: @ 840FF75 - .string "’s $" - -OtherText_Cool:: - .string "COOL $" -OtherText_Beauty2:: - .string "BEAUTY $" -OtherText_Cute:: - .string "CUTE $" -OtherText_Smart:: - .string "SMART $" -OtherText_Tough:: - .string "TOUGH $" -OtherText_NonstopSuperCool:: - .string "Nonstop super-cool -\nthe inestimable $" -OtherText_Terminator6:: - .string "$" -OtherText_GoodLookingPoke:: - .string "Hey, there!\nThe good-looking POKéMON $" -OtherText_Terminator7:: - .string "$" -OtherText_MarvelousGreat:: - .string "The marvelous, wonderful, and\nvery great $" -OtherText_Terminator8:: - .string "$" -OtherText_CenturyLastVenus:: - .string "This century’s last Venus -\nthe beautiful $" -OtherText_Terminator9:: - .string "$" -OtherText_Terminator10:: - .string "$" -OtherText_DazzlingSlime:: - .string "’s dazzling,\nglittering smile$" -OtherText_PokeCenterIdol:: - .string "POKéMON CENTER’s super idol -\nthe incomparable $" -OtherText_Terminator11:: - .string "$" -OtherText_LovelyAndSweet:: - .string "The lovely and sweet $" -OtherText_Terminator12:: - .string "$" -OtherText_ThePretty:: - .string "The pretty $" -OtherText_WinningPortrait:: - .string "’s\nwinning portrait$" -OtherText_GiveUsWink:: - .string "Give us a wink!\nThe cutie POKéMON $" -OtherText_Terminator13:: - .string "$" -OtherText_SmartnessMaestro:: - .string "The smartness maestro -\nThe wise POKéMON $" -OtherText_Terminator14:: - .string "$" -OtherText_ChosenPokeAmong:: - .string "The chosen POKéMON -\nThe one among POKéMON $" -OtherText_Terminator15:: - .string "$" -OtherText_TheExcellent:: - .string "The excellent $" -OtherText_ItsMomentOfElegance:: - .string "’s\nmoment of elegance$" -OtherText_PowerfullyMuscular:: - .string "The powerfully muscular\nspeedster $" -OtherText_Terminator16:: - .string "$" -OtherText_StrongErEst:: - .string "The strong, stronger, and\nstrongest $" -OtherText_Terminator17:: - .string "$" -OtherText_MightyTough:: - .string "The mighty tough\nhyper POKéMON $" -OtherText_Exclamation:: - .string "!$" -OtherText_Petalburg:: - .string "PETALBURG$" -OtherText_Slateport:: - .string "SLATEPORT$" -OtherText_Littleroot:: - .string "LITTLEROOT$" -OtherText_Lilycove:: - .string "LILYCOVE$" -OtherText_Dewford:: - .string "DEWFORD$" -OtherText_Enter:: - .string "ENTER$" -OtherText_Info3:: - .string "INFO$" -OtherText_WhatsAContest:: - .string "What’s a CONTEST?$" -OtherText_TypesOfContest:: - .string "Types of CONTESTS$" -OtherText_Ranks:: - .string "Ranks$" -OtherText_Judging:: - .string "Judging$" -OtherText_CoolContest:: - .string "COOL CONTEST$" -OtherText_BeautyContest:: - .string "BEAUTY CONTEST$" -OtherText_CuteContest:: - .string "CUTE CONTEST$" -OtherText_SmartContest:: - .string "SMART CONTEST$" -OtherText_ToughContest:: - .string "TOUGH CONTEST$" -OtherText_Decoration:: - .string "DECORATION$" -OtherText_PackUp:: - .string "PACK UP$" -OtherText_Count:: - .string "COUNT$" -OtherText_Registry:: - .string "REGISTRY$" -OtherText_Information:: - .string "INFORMATION$" -OtherText_Mach:: - .string "MACH$" -OtherText_Acro:: - .string "ACRO$" -OtherText_Poison:: - .string "PSN$" -OtherText_Paralysis:: - .string "PAR$" -OtherText_Sleep:: - .string "SLP$" -OtherText_Burn:: - .string "BRN$" -OtherText_Frozen:: - .string "FRZ$" -OtherText_Quit:: - .string "QUIT$" -OtherText_SawIt:: - .string "Saw it$" -OtherText_NotYet:: - .string "Not yet$" -OtherText_Yes:: - .string "YES$" -OtherText_No:: - .string "NO$" -OtherText_Info2:: - .string "INFO$" -OtherText_SingleBattle:: - .string "SINGLE BATTLE$" -OtherText_DoubleBattle:: - .string "DOUBLE BATTLE$" -OtherText_MultiBattle:: - .string "MULTI BATTLE$" -OtherText_MrBriney:: - .string "MR. BRINEY$" -OtherText_MakeAChallenge:: - .string "Make a challenge.$" -OtherText_ObtainInformation:: - .string "Obtain information.$" -OtherText_Lv50_2:: - .string "LV. 50$" -OtherText_Lv100_2:: - .string "LV. 100$" -OtherText_Zigzagoon:: - .string "ZIGZAGOON$" -OtherText_Nincada:: - .string "NINCADA$" -OtherText_Poochyena:: - .string "POOCHYENA$" -OtherText_Nincada2:: - .string "NINCADA$" -OtherText_Lotad:: - .string "LOTAD$" -OtherText_Roselia:: - .string "ROSELIA$" -OtherText_Shroomish:: - .string "SHROOMISH$" -OtherText_Nincada3:: - .string "NINCADA$" -OtherText_Surskit:: - .string "SURSKIT$" -OtherText_Treecko:: - .string "TREECKO$" -OtherText_Torchic:: - .string "TORCHIC$" -OtherText_Mudkip:: - .string "MUDKIP$" -OtherText_Seedot:: - .string "SEEDOT$" -OtherText_Shroomish2:: - .string "SHROOMISH$" -OtherText_Spinda:: - .string "SPINDA$" -OtherText_Shroomish3:: - .string "SHROOMISH$" -OtherText_Zigzagoon2:: - .string "ZIGZAGOON$" -OtherText_Wurmple:: - .string "WURMPLE$" -OtherText_PokeBall:: - .string "POKé BALL$" -OtherText_SuperPotion:: - .string "SUPER POTION$" -OtherText_SamePrice:: - .string "Same price$" -OtherText_Yen135:: - .string "¥135$" -OtherText_Yen155:: - .string "¥155$" -OtherText_Yen175:: - .string "¥175$" -OtherText_CostMore:: - .string "They will cost more.$" -OtherText_CostLess:: - .string "They will cost less.$" -OtherText_SamePrice2:: - .string "Same price$" -OtherText_MaleSymbol:: - .string "♂$" -OtherText_FemaleSymbol:: - .string "♀$" -OtherText_Neither:: - .string "Neither$" -OtherText_Males:: - .string "Males$" -OtherText_Females:: - .string "Females$" -OtherText_SameNumber:: - .string "Same number$" -OtherText_Male:: - .string "Male$" -OtherText_Female:: - .string "Female$" -OtherText_ItDepends:: - .string "It depends$" -OtherText_Six2:: - .string "6$" -OtherText_Eight2:: - .string "8$" -OtherText_Ten:: - .string "10$" -OtherText_One:: - .string "1$" -OtherText_Two:: - .string "2$" -OtherText_Three:: - .string "3$" -OtherText_Six:: - .string "6$" -OtherText_Seven:: - .string "7$" -OtherText_Eight:: - .string "8$" -OtherText_FreshWater:: - .string "FRESH WATER{CLEAR_TO 0x48}¥200$" -OtherText_SodaPop:: - .string "SODA POP{CLEAR_TO 0x48}¥300$" -OtherText_Lemonade:: - .string "LEMONADE{CLEAR_TO 0x48}¥350$" -OtherText_HowToRide:: - .string "HOW TO RIDE$" -OtherText_HowToTurn:: - .string "HOW TO TURN$" -OtherText_SandySlopes:: - .string "SANDY SLOPES$" -OtherText_Wheelies:: - .string "WHEELIES$" -OtherText_BunnyHops:: - .string "BUNNY-HOPS$" -OtherText_Jumping:: - .string "JUMPING$" -OtherText_Satisfied:: - .string "Satisfied$" -OtherText_Dissatisfied:: - .string "Dissatisfied$" -OtherText_Deepseatooth:: - .string "DEEPSEATOOTH$" -OtherText_Deepseascale:: - .string "DEEPSEASCALE$" -OtherText_BlueFlute2:: - .string "BLUE FLUTE$" -OtherText_YellowFlute2:: - .string "YELLOW FLUTE$" -OtherText_RedFlute2:: - .string "RED FLUTE$" -OtherText_WhiteFlute2:: - .string "WHITE FLUTE$" -OtherText_BlackFlute2:: - .string "BLACK FLUTE$" -OtherText_GlassChair:: - .string "GLASS CHAIR$" -OtherText_GlassDesk:: - .string "GLASS DESK$" -OtherText_TreeckoDoll:: - .string "TREECKO DOLL 1,000 COINS$" -OtherText_TorchicDoll:: - .string "TORCHIC DOLL 1,000 COINS$" -OtherText_MudkipDoll:: - .string "MUDKIP DOLL 1,000 COINS$" -OtherText_50Coins:: - .string " 50 COINS ¥1,000$" -OtherText_500Coins:: - .string "500 COINS ¥10,000$" -OtherText_Excellent:: - .string "Excellent!$" -OtherText_NotSoHot:: - .string "Not so hot$" -OtherText_RedShard:: - .string "RED SHARD$" -OtherText_YellowShard:: - .string "YELLOW SHARD$" -OtherText_BlueShard:: - .string "BLUE SHARD$" -OtherText_GreenShard:: - .string "GREEN SHARD$" -OtherText_BattleTower:: - .string "BATTLE TOWER$" -OtherText_Right:: - .string "Right$" -OtherText_Left:: - .string "Left$" -OtherText_TM32:: - .string "TM32 1,500 COINS$" -OtherText_TM29:: - .string "TM29 3,500 COINS$" -OtherText_TM35:: - .string "TM35 4,000 COINS$" -OtherText_TM24:: - .string "TM24 4,000 COINS$" -OtherText_TM13:: - .string "TM13 4,000 COINS$" -OtherText_1F_2:: - .string "1F$" -OtherText_2F_2:: - .string "2F$" -OtherText_3F_2:: - .string "3F$" -OtherText_4F_2:: - .string "4F$" -OtherText_5F_2:: - .string "5F$" -OtherText_Cool2:: - .string "COOL$" -OtherText_Beauty3:: - .string "BEAUTY$" -OtherText_Cute2:: - .string "CUTE$" -OtherText_Smart2:: - .string "SMART$" -OtherText_Tough2:: - .string "TOUGH$" -OtherText_Normal:: - .string "NORMAL$" -OtherText_Super:: - .string "SUPER$" -OtherText_Hyper:: - .string "HYPER$" -OtherText_Master:: - .string "MASTER$" -OtherText_Cool3:: - .string "COOL$" -OtherText_Beauty4:: - .string "BEAUTY$" -OtherText_Cute3:: - .string "CUTE$" -OtherText_Smart3:: - .string "SMART$" -OtherText_Tough3:: - .string "TOUGH$" -OtherText_Items:: - .string "ITEMS$" -OtherText_KeyItems:: - .string "KEY ITEMS$" -OtherText_Balls:: - .string "BALLS$" -OtherText_TMsHMs:: - .string "TMs & HMs$" -OtherText_Berries:: - .string "BERRIES$" - -gPCText_SomeonesPC:: @ 8410753 - .string "SOMEONE’S PC$" - -gPCText_LanettesPC:: @ 8410760 - .string "LANETTE’S PC$" - -gPCText_PlayersPC:: @ 841076D - .string "{PLAYER}’s PC$" - -gPCText_HallOfFame:: @ 8410775 - .string "HALL OF FAME$" - -gPCText_LogOff:: @ 8410782 - .string "LOG OFF$" - -gOtherText_99Times:: @ 841078A - .string "99 times +$" - -gOtherText_1Minute:: @ 8410795 - .string "1 minute +$" - -gOtherText_Seconds:: @ 84107A0 - .string " seconds$" - -gOtherText_Times:: @ 84107A9 - .string " times$" - .string ".$" - -gOtherText_BigGuy:: @ 84107B2 - .string "Big guy$" - -gOtherText_BigGirl:: @ 84107BA - .string "Big girl$" - -gOtherText_Son:: @ 84107C3 - .string "son$" - -gOtherText_Daughter:: @ 84107C7 - .string "daughter$" - -OtherText_BlueFlute:: - .string "BLUE FLUTE$" -OtherText_YellowFlute:: - .string "YELLOW FLUTE$" -OtherText_RedFlute:: - .string "RED FLUTE$" -OtherText_WhiteFlute:: - .string "WHITE FLUTE$" -OtherText_BlackFlute:: - .string "BLACK FLUTE$" -OtherText_PrettyChair:: - .string "PRETTY CHAIR$" -OtherText_PrettyDesk:: - .string "PRETTY DESK$" -OtherText_1F:: - .string "1F$" -OtherText_2F:: - .string "2F$" -OtherText_3F:: - .string "3F$" -OtherText_4F:: - .string "4F$" -OtherText_5F:: - .string "5F$" -OtherText_6F:: - .string "6F$" -OtherText_7F:: - .string "7F$" -OtherText_8F:: - .string "8F$" -OtherText_9F:: - .string "9F$" -OtherText_10F:: - .string "10F$" -OtherText_11F:: - .string "11F$" -OtherText_B1F:: - .string "B1F$" -OtherText_B2F:: - .string "B2F$" -OtherText_B3F:: - .string "B3F$" -OtherText_B4F:: - .string "B4F$" -OtherText_Rooftop:: - .string "ROOFTOP$" - -gOtherText_NowOn:: @ 841085E - .string "Now on:$" - -gPCText_Cancel:: @ 8410866 - .string "CANCEL$" - -PCText_ExitBox:: - .string "Exit from the BOX.$" -PCText_WhatYouDo:: - .string "What would you like to do?$" -PCText_PickATheme:: - .string "Please pick a theme.$" -PCText_PickAWallpaper:: - .string "Please pick out wallpaper.$" -PCText_IsSelected:: - .string " is selected.$" -PCText_JumpToWhichBox:: - .string "Jump to which BOX?$" -PCText_DepositInWhichBox:: - .string "Deposit in which BOX?$" -PCText_WasDeposited:: - .string " was deposited.$" -PCText_BoxIsFull:: - .string "The BOX is full.$" -PCText_ReleasePoke:: - .string "Release this POKéMON?$" -PCText_WasReleased:: - .string " was released.$" -PCText_ByeBye:: - .string "Bye-bye, !$" -PCText_MarkPoke:: - .string "Mark your POKéMON.$" -PCText_LastPoke:: - .string "That’s your last POKéMON!$" -PCText_PartyFull:: - .string "Your party’s full!$" -PCText_HoldingPoke:: - .string "You’re holding a POKéMON!$" -PCText_WhichOneWillTake:: - .string "Which one will you take?$" -PCText_CantReleaseEgg:: - .string "You can’t release an EGG.$" -PCText_ContinueBox:: - .string "Continue BOX operations?$" -PCText_CameBack:: - .string " came back!$" -PCText_Worried:: - .string "Was it worried about you?$" -PCText_Surprise:: - .string "... ... ... ... ...!$" -PCText_PleaseRemoveMail:: - .string "Please remove the MAIL.$" -PCText_Cancel2:: - .string "CANCEL$" -PCText_Deposit:: - .string "DEPOSIT$" -PCText_Withdraw:: - .string "WITHDRAW$" -PCText_Switch:: - .string "SWITCH$" -PCText_Move:: - .string "MOVE$" -PCText_Place:: - .string "PLACE$" -PCText_Summary:: - .string "SUMMARY$" -PCText_Release:: - .string "RELEASE$" -PCText_Mark:: - .string "MARK$" -PCText_Name:: - .string "NAME$" -PCText_Jump:: - .string "JUMP$" -PCText_Wallpaper:: - .string "WALLPAPER$" -PCText_Scenery1:: - .string "SCENERY 1$" -PCText_Scenery2:: - .string "SCENERY 2$" -PCText_Scenery3:: - .string "SCENERY 3$" -PCText_Etc:: - .string "ETCETERA$" -PCText_Forest:: - .string "FOREST$" -PCText_City:: - .string "CITY$" -PCText_Desert:: - .string "DESERT$" -PCText_Savanna:: - .string "SAVANNA$" -PCText_Crag:: - .string "CRAG$" -PCText_Volcano:: - .string "VOLCANO$" -PCText_Snow:: - .string "SNOW$" -PCText_Cave:: - .string "CAVE$" -PCText_Beach:: - .string "BEACH$" -PCText_Seafloor:: - .string "SEAFLOOR$" -PCText_River:: - .string "RIVER$" -PCText_Sky:: - .string "SKY$" -PCText_Polka:: - .string "POLKA-DOT$" -PCText_PokeCenter:: - .string "POKéCENTER$" -PCText_Machine:: - .string "MACHINE$" -PCText_Plain:: - .string "PLAIN$" -PCText_WhatDoYouWant:: - .string "What do you want?$" -PCText_WithdrawPoke:: - .string "WITHDRAW POKéMON$" -PCText_DepositPoke:: - .string "DEPOSIT POKéMON$" -PCText_MovePoke:: - .string "MOVE POKéMON$" -PCText_SeeYa:: - .string "SEE YA!$" -PCText_MovePokeToParty:: - .string "Move POKéMON stored in BOXES to\nyour party.$" -PCText_StorePokeInBox:: - .string "Store POKéMON in your party in BOXES.$" -PCText_OrganizeBoxesParty:: - .string "Organize the POKéMON in BOXES and\nin your party.$" -PCText_ReturnToPrevMenu:: - .string "Return to the previous menu.$" - -gPCText_OnlyOne:: @ 8410C1C - .string "There is just one POKéMON with you.$" - -gPCText_PartyFull2:: @ 8410C40 - .string "Your party is full!$" - -gPCText_BOX:: @ 8410C54 - .string "BOX$" - -PCText_CheckMap:: - .string "{CLEAR 0}Check the map of the HOENN region.$" -PCText_CheckPoke:: - .string "{CLEAR 0}Check POKéMON in detail.$" -PCText_CheckTrainer:: - .string "{CLEAR 0}Check TRAINER information.$" -PCText_CheckRibbons:: - .string "{CLEAR 0}Check obtained RIBBONS.$" -PCText_PutAwayNav:: - .string "{CLEAR 0}Put away the POKéNAV.$" -PCText_NoRibbonWin:: - .string "{CLEAR 0}There are no RIBBON winners.$" -PCText_NoTrainers:: - .string "{CLEAR 0}No TRAINERS are registered.$" -PCText_CheckParty:: - .string "{CLEAR 0}Check party POKéMON in detail.$" -PCText_CheckPokeAll:: - .string "{CLEAR 0}Check all POKéMON in detail.$" -PCText_ReturnToNav:: - .string "{CLEAR 0}Return to the POKéNAV menu.$" -PCText_FindCool:: - .string "{CLEAR 0}Find cool POKéMON.$" -PCText_FindBeauty:: - .string "{CLEAR 0}Find beautiful POKéMON.$" -PCText_FindCute:: - .string "{CLEAR 0}Find cute POKéMON.$" -PCText_FindSmart:: - .string "{CLEAR 0}Find smart POKéMON.$" -PCText_FindTough:: - .string "{CLEAR 0}Find tough POKéMON.$" -PCText_ReturnToCondition:: - .string "{CLEAR 0}Return to the CONDITION menu.$" - -gOtherText_NumberRegistered:: @ 8410E22 - .string "No. registered$" - -gOtherText_NumberBattles:: @ 8410E31 - .string "No. of battles$" - -gOtherText_Strategy:: @ 8410E40 - .string "{PALETTE 5}STRATEGY$" - -gOtherText_TrainersPokemon:: @ 8410E4C - .string "{PALETTE 5}TRAINER’S POKéMON$" - -gOtherText_SelfIntroduction:: @ 8410E61 - .string "{PALETTE 5}SELF-INTRODUCTION$" - -gOtherText_Nature2:: @ 8410E76 - .string "NATURE/$" - -gOtherText_InParty:: @ 8410E7E - .string "IN PARTY$" - -gOtherText_Number:: @ 8410E87 - .string "No. $" - -gOtherText_Ribbons:: @ 8410E8C - .string "RIBBONS$" - -OtherText_MakeProfilePage1:: - .string "Make your profile by combining$" -OtherText_MakeProfilePage2:: - .string "four words or phrases.$" -OtherText_MakeMessagePage1:: - .string "Make a message with 6 phrases.$" -OtherText_MakeMessagePage2:: - .string "Max. two 12-letter phrases/line.$" -OtherText_DescribeFeelingsPage1:: - .string "Find words that describe your$" -OtherText_DescribeFeelingsPage2:: - .string "feelings right now.$" -OtherText_WithFourPhrases:: - .string "With four phrases,$" -OtherText_CombineNinePhrasesPage1:: - .string "Combine nine phrases and$" -OtherText_CombineNinePhrasesPage2:: - .string "make a message.$" -OtherText_ImproveBardSongPage1:: - .string "Change just one word or phrase$" -OtherText_ImproveBardSongPage2:: - .string "and improve the BARD’s song.$" -OtherText_YourProfile:: - .string "Your profile $" -OtherText_YourFeelingBattle:: - .string "Your feeling at the battle’s start$" -OtherText_SetWinMessage:: - .string "What you say if you win a battle$" -OtherText_SetLossMessage:: - .string "What you say if you lose a battle$" -OtherText_TheAnswer:: - .string "The answer$" -OtherText_MailMessage:: - .string "The MAIL message$" -OtherText_MailSalutation:: - .string "The MAIL salutation$" -OtherText_NewSong:: - .string "The new song$" -OtherText_CombineTwoPhrasesPage1:: - .string "Combine two phrases and$" -OtherText_CombineTwoPhrasesPage2:: - .string "make a trendy saying.$" -OtherText_ConfirmTrendyPage1:: - .string "The trendy saying$" -OtherText_ConfirmTrendyPage2:: - .string "is as shown. Okay?$" -OtherText_HipsterPage1:: - .string "I’ll combine two phrases and$" -OtherText_HipsterPage2:: - .string "teach you a good saying.$" - -gOtherText_TextDeletedConfirmPage1:: @ 84110EE - .string "All the text being edited will$" - -gOtherText_TextDeletedConfirmPage2:: @ 841110D - .string "be deleted. Is that okay?$" - -gOtherText_QuitEditing:: @ 8411127 - .string "Quit editing?$" - -gOtherText_EditedTextNoSavePage1:: @ 8411135 - .string "The edited text will not be saved.$" - -gOtherText_EditedTextNoSavePage2:: @ 8411158 - .string "Is that okay?$" - -gOtherText_EnterAPhraseOrWord:: @ 8411166 - .string "Please enter a phrase or word.$" - -gOtherText_TextNoDelete:: @ 8411185 - .string "The entire text can’t be deleted.$" - -gOtherText_OnlyOnePhrase:: @ 84111A7 - .string "Only one phrase may be changed.$" - -gOtherText_OriginalSongRestored:: @ 84111C7 - .string "The original song will be restored.$" - -gOtherText_TrendyAlready:: @ 84111EB - .string "That’s trendy already!$" - -gOtherText_CombineTwoPhrases:: @ 8411202 - .string "Combine two words or phrases.$" - -gOtherText_QuitGivingInfo:: @ 8411220 - .string "Quit giving information?$" - -gOtherText_StopGivingMail:: @ 8411239 - .string "Stop giving the POKéMON MAIL?$" - -gOtherText_Profile:: @ 8411257 - .string "PROFILE$" - -gOtherText_AtBattleStart:: @ 841125F - .string "At the battle’s start.$" - -gOtherText_UponWinningBattle:: @ 8411276 - .string "Upon winning a battle.$" - -gOtherText_UponLosingBattle:: @ 841128D - .string "Upon losing a battle.$" - -gOtherText_TheBardsSong:: @ 84112A3 - .string "The BARD’s Song$" - -gOtherText_WhatsHipHappening:: @ 84112B3 - .string "What’s hip and happening?$" - -gOtherText_Interview:: @ 84112CD - .string "Interview$" - -gOtherText_GoodSaying:: @ 84112D7 - .string "Good saying$" - -OtherText_SoPretty:: - .string " so pretty!$" -OtherText_SoDarling:: - .string " so darling!$" -OtherText_SoRelaxed:: - .string " so relaxed!$" -OtherText_SoSunny:: - .string " so sunny!$" -OtherText_SoDesirable:: - .string " so desirable!$" -OtherText_SoExciting:: - .string " so exciting!$" -OtherText_SoAmusing:: - .string " so amusing!$" -OtherText_SoMagical:: - .string " so magical!$" - -gOtherText_Is:: @ 841134B - .string " is$" - -gOtherText_DontYouAgree:: @ 841134F - .string "\nDon’t you agree?$" - -OtherText_WantVacationNicePlace:: - .string "I so want to go on a vacation.\nWould you happen to know a nice place?$" -OtherText_BoughtCrayonsIsNice:: - .string "I bought crayons with 120 colors!\nDon’t you think that’s nice?$" -OtherText_IfWeCouldFloat:: - .string "Wouldn’t it be nice if we could float\naway on a cloud of bubbles?$" -OtherText_SandWashesAwayMakeSad:: - .string "When you write on a sandy beach,\nthey wash away. It makes me sad.$" -OtherText_WhatsBottomSeaLike:: - .string "What’s the bottom of the sea like?\nJust once I would so love to go!$" -OtherText_SeeSettingSun:: - .string "When you see the setting sun, does it\nmake you want to go home?$" -OtherText_LyingInGreenGrass:: - .string "Lying back in the green grass...\nOh, it’s so, so nice!$" -OtherText_SecretBasesWonderful:: - .string "SECRET BASES are so wonderful!\nCan’t you feel the excitement?$" -OtherText_PokeLeague:: - .string "POKéMON LEAGUE$" -OtherText_PokeCenter:: - .string "POKéMON CENTER$" - -gOtherText_GetsAPokeBlock:: @ 8411581 - .string " gets a {POKEBLOCK}?$" - -OtherText_Coolness:: - .string "Coolness $" -OtherText_Beauty:: - .string "Beauty $" -OtherText_Cuteness:: - .string "Cuteness $" -OtherText_Smartness:: - .string "Smartness $" -OtherText_Toughness:: - .string "Toughness $" - -gOtherText_WasEnhanced:: @ 84115C2 - .string "was enhanced!$" - -gOtherText_NothingChanged:: @ 84115D0 - .string "Nothing changed!$" - -gOtherText_WontEat:: @ 84115E1 - .string "It won’t eat anymore...$" - -gSystemText_SaveFailedBackupCheck:: @ 84115F9 - .string "Save failed.\nChecking the backup memory...\nPlease wait.\n{COLOR RED}“Time required: 1 minute”$" - -gSystemText_BackupDamagedGameContinue:: @ 841164E - .string "The backup memory is damaged or\nthe internal battery has run dry.\nThe game can be played. However,\nprogress cannot be saved.$" - -gSystemText_GameplayEnded:: @ 84116CB - .string "{COLOR RED}“Gameplay cannot be continued.\nReturning to the title screen...”$" - -gSystemText_CheckCompleteSaveAttempt:: @ 841170F - .string "Check completed.\nAttempting to save again.\nPlease wait.$" - -gSystemText_SaveCompletedGameEnd:: @ 8411747 - .string "Save completed.\n{COLOR RED}“Gameplay cannot be continued.\nReturning to the title screen.”$" - -gSystemText_SaveCompletedPressA:: @ 8411799 - .string "Save completed.\n{COLOR RED}“Please press the A Button.”$" - -gOtherText_Ferry:: @ 84117C9 - .string "FERRY$" - -gOtherText_SecretBase:: @ 84117CF - .string "SECRET BASE$" - -gOtherText_Hideout:: @ 84117DB - .string "HIDEOUT$" - -gSystemText_ResetRTCPrompt:: @ 84117E3 - .string "Reset RTC?\nA: Confirm, B: Cancel$" - -gSystemText_PresentTime:: @ 8411804 - .string "Present time in game$" - -gSystemText_PreviousTime:: @ 8411819 - .string "Previous time in game$" - -gSystemText_PleaseResetTime:: @ 841182F - .string "Please reset the time.$" - -gSystemText_ClockResetDataSave:: @ 8411846 - .string "The clock has been reset.\nData will be saved. Please wait.$" - -gSystemText_SaveCompleted:: @ 8411881 - .string "Save completed.$" - -gSystemText_SaveFailed:: @ 8411891 - .string "Save failed...$" - -gSystemText_NoSaveFileNoTime:: @ 84118A0 - .string "There is no save file, so the time\ncan’t be set.$" - -gSystemText_ClockAdjustmentUsable:: @ 84118D1 - .string "The in-game clock adjustment system\nis now useable.$" - -gSystemText_Saving:: @ 8411905 - .string "SAVING...\nDON’T TURN OFF THE POWER.$" diff --git a/include/asm.inc.h b/include/asm.inc.h index 8189914fa..9ee10aa58 100644 --- a/include/asm.inc.h +++ b/include/asm.inc.h @@ -38,14 +38,6 @@ void CreatePokeballSprite(u8 r0, u8 r1, u8 r2, u8 r3, u8 s1, u8 s2, u8 s3, u16 s // asm/berry_blender.o void sub_80516C4(u8, u16); -// src/field_door.o -void FieldSetDoorOpened(u32, u32); -void FieldSetDoorClosed(u32, u32); -s8 FieldAnimateDoorClose(u32, u32); -s8 FieldAnimateDoorOpen(u32, u32); -bool8 FieldIsDoorAnimationRunning(void); -u32 sub_8058790(u32 x, u32 y); - // asm/field_map_obj.o void sub_805AA98(); u8 sub_805AB54(void); @@ -137,32 +129,11 @@ u8 ZCoordToPriority(u8); void FieldObjectUpdateZCoord(struct MapObject *pObject); void SetObjectSubpriorityByZCoord(u8, struct Sprite *, u8); -// src/field_map_obj_helpers.o -bool8 FreezeMapObject(struct MapObject *); -void FreezeMapObjects(void); -void FreezeMapObjectsExceptOne(u8); -void UnfreezeMapObjects(void); -void sub_806487C(struct Sprite *sprite, bool8 invisible); -void sub_8064990(u8, u8); - -// asm/field_control_avatar.o -void FieldClearPlayerInput(struct FieldInput *pStruct); -void FieldGetPlayerInput(struct FieldInput *pStruct, u16 keys, u16 heldKeys); -int sub_8068024(struct FieldInput *pStruct); -u8 *sub_80682A8(struct MapPosition *, u8, u8); -void overworld_poison_timer_set(void); -void prev_quest_postbuffer_cursor_backup_reset(void); -u8 *sub_8068E24(struct MapPosition *); -u8 *GetFieldObjectScriptPointerForComparison(); - // asm/field_tasks.o void SetUpFieldTasks(); void ActivatePerStepCallback(u8); void ResetFieldTasksArgs(void); -// asm/clock.o -void DoTimeBasedEvents(void); - // asm/reset_rtc_screen.o void CB2_InitResetRtcScreen(void); @@ -203,10 +174,6 @@ u8 sub_8083664(void); void sub_8083A84(TaskFunc); s32 sub_8083BF4(u8 id); -// src/fldeff_emotion.o -void sub_8084894(struct Sprite *sprite, u16 a2, u8 a3); -void objc_exclamation_mark_probably(struct Sprite *sprite); - // asm/rom_80859BC.o u8 CreateTrainerSprite_BirchSpeech(u8, u16, u16, u8, void *); void LoadTrainerGfx_TrainerCard(u8 gender, int, void *); @@ -259,11 +226,6 @@ u8 sub_80A7D8C(u8 berry, int i, int i1); void sub_80A7DD4(void); u8 sub_80A7E5C(u8); -// src/matsuda_debug_menu.o -void sub_80AA280(u8); -void sub_80AA5E8(u8); -void sub_80AA658(u8); - // asm/contest.o void sub_80AB1B0(void); void sub_80AE098(u8); @@ -279,18 +241,6 @@ void CreatePokemartMenu(void *); void CreateDecorationShop1Menu(void *); void CreateDecorationShop2Menu(void *); -// src/script_menu.o -bool8 sub_80B5054(u8, u8, u8, u8); -bool8 sub_80B50B0(u8, u8, u8, u8, u8); -bool8 Multichoice(u8, u8, u8, u8); -bool8 yes_no_box(u8, u8); -bool8 sub_80B5578(u8, u8, u8, u8, u8); -bool8 sub_80B58C4(u16, u8, u8); -void *picbox_close(void); - -// asm/naming_screen.o -void DoNamingScreen(u8 r0, u8 *r1, u16 r2, u16 r3, u32 s0, MainCallback s4); - // asm/secret_base.o void sub_80BB5B4(void); u8 sub_80BBB24(void); @@ -330,15 +280,6 @@ void sub_80C4940(void); void sub_80C4980(u8); u8 sub_80C4B34(u8 *); -// asm/script_pokemon_util_80C4BF0.o -u8 sub_80C4D50(void); -void ShowContestWinner(void); -void HealPlayerParty(); -u8 ScriptGiveMon(u16, u8, u16, u32, u32, u8); -u8 ScriptGiveEgg(u16); -void ScriptWildBattle(u16, u8, u16); -void ScriptSetMonMoveSlot(u8, u16, u8); - // asm/fldeff_80C5CD4.o void DoFieldPoisonEffect(void); bool32 FieldPoisonEffectIsRunning(void); @@ -357,16 +298,6 @@ void sub_80C8E1C(u8); void sub_80C8EBC(u8); void sub_80C8F34(u8); -// asm/bike.o -void MovePlayerOnBike(u8, u16, u16); -void sub_80E5B38(u16 i, u16 c); -u8 IsRunningDisallowed(u8); -bool8 player_should_look_direction_be_enforced_upon_movement(void); -void BikeClearState(int i, int i1); -void sub_80E6010(u8 i); -s16 GetPlayerSpeed(void); -void sub_80E6084(); - // asm/easy_chat.o void sub_80E6764(void); void sub_80EB3FC(u8 *, u16); @@ -385,13 +316,6 @@ bool8 sub_80F9344(void); void sub_80F9368(void); void sub_80F9438(void); -// asm/script_pokemon_util_80F99CC.o -void sub_80F99CC(void); - -// src/dewford_trend.o -void sub_80FA17C(void); -void sub_80FA4E4(void *, u32, u8); - // asm/region_map.o void sub_80FBFB4(u8 *str, u8 region, u8); void CopyMapName(); @@ -400,13 +324,6 @@ u8 *CopyLocationName(u8 *dest, u8 location); // asm/slot_machine.o void PlaySlotMachine(u8, void *); -// asm/contest_painting.o -void sub_8106630(u32); - -// asm/rom6.o -bool8 npc_before_player_of_type(u8); -u8 oei_task_add(void); - // asm/pokeblock.o void sub_810C994(void); void sub_810CA6C(s32); @@ -464,13 +381,6 @@ void sub_8134AC0(void *); // src/player_pc.o void NewGameInitPCItems(void); -// src/intro.o -void sub_813CE30(u16, u16, u16, u16); - -// asm/braille_puzzles.o -bool8 ShouldDoBrailleStrengthEffect(void); -void DoBrailleStrengthEffect(void); - // asm/intro_credits_graphics.o void load_intro_part2_graphics(/*TODO: arg types*/); void sub_8148C78(/*TODO: arg types*/); @@ -482,14 +392,3 @@ u8 intro_create_brendan_sprite(/*TODO: arg types*/); u8 intro_create_may_sprite(/*TODO: arg types*/); u8 intro_create_latios_sprite(/*TODO: arg types*/); u8 intro_create_latias_sprite(/*TODO: arg types*/); - -// asm/name_string_util.o -void SanitizeNameString(u8*); - -// src/agb_flash.o -u16 ReadFlashId(void); -u16 SetFlashTimerIntr(u8 timerNum, void (**intrFunc)(void)); -void ReadFlash(u16 sectorNum, u32 offset, u8 *dest, u32 size); -u32 ProgramFlashSectorAndVerify(); -u32 ProgramFlashSectorAndVerifyNBytes(u16 sectorNum, u8 *src, u32 n); -u16 IdentifyFlash(void); diff --git a/include/battle.h b/include/battle.h index daaa78cd3..4b9144721 100644 --- a/include/battle.h +++ b/include/battle.h @@ -107,9 +107,12 @@ struct SmallItemStruct struct BattleStruct /* 0x2000000 */ { - u8 filler0[0x1601C]; + u8 filler0[0x15DDE]; + /*0x15DDE*/ u8 unk15DDE; + /*0x15DDF*/ u8 unk15DDF; + /*0x15DE0*/ u8 filler15DE0[0x23C]; // 0xAF off? struct SmallBattleStruct1 unk; - u8 filler1[0x68]; // 0x2016020 + u8 filler1[0x68]; /* 0x16089 */ u8 safariFleeRate; u8 filler1_2[0x42]; /* 0x160CB */ u8 linkPlayerIndex; diff --git a/include/battle_ai.h b/include/battle_ai.h new file mode 100644 index 000000000..a5fea3480 --- /dev/null +++ b/include/battle_ai.h @@ -0,0 +1,31 @@ +#ifndef GUARD_BATTLEAI_H +#define GUARD_BATTLEAI_H + +#define AIScriptRead32(ptr) ((ptr)[0] | (ptr)[1] << 8 | (ptr)[2] << 16 | (ptr)[3] << 24) +#define AIScriptRead16(ptr) ((ptr)[0] | (ptr)[1] << 8) +#define AIScriptRead8(ptr) ((ptr)[0]) +#define AIScriptReadPtr(ptr) (u8*) AIScriptRead32(ptr) + +enum +{ + TARGET, + USER +}; + +// AI states +enum +{ + AIState_SettingUp, + AIState_Processing, + AIState_FinishedProcessing, + AIState_DoNotProcess +}; + +// battle_ai +void BattleAI_SetupAIData(void); +void BattleAI_DoAIProcessing(void); +void sub_810745C(void); +void AIStackPushVar(u8 *); +u8 AIStackPop(void); + +#endif diff --git a/include/battle_anim.h b/include/battle_anim.h new file mode 100644 index 000000000..eb98ebf09 --- /dev/null +++ b/include/battle_anim.h @@ -0,0 +1,58 @@ +#ifndef GUARD_BATTLEANIM_H +#define GUARD_BATTLEANIM_H + +#define SCRIPT_READ_8(ptr) ((ptr)[0]) +#define SCRIPT_READ_16(ptr) ((ptr)[0] | ((ptr)[1] << 8)) +#define SCRIPT_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24)) + +#define REG_BGnCNT_BITFIELD(n) (*(struct BGCntrlBitfield *)REG_ADDR_BG##n##CNT) +#define REG_BG1CNT_BITFIELD REG_BGnCNT_BITFIELD(1) +#define REG_BG2CNT_BITFIELD REG_BGnCNT_BITFIELD(2) + +#define EWRAM_14800 ((u16 *)(unk_2000000 + 0x14800)) +#define EWRAM_17800 ((struct UnknownStruct1 *)(unk_2000000 + 0x17800)) +#define EWRAM_17810 ((struct UnknownStruct3 *)(unk_2000000 + 0x17810)) +#define EWRAM_18000 ((u16 *)(unk_2000000 + 0x18000)) +#define EWRAM_19348 (*(u16 *)(unk_2000000 + 0x19348)) + +struct BGCntrlBitfield +{ + volatile u16 priority:2; + volatile u16 charBaseBlock:2; + volatile u16 field_0_2:4; + volatile u16 field_1_0:5; + volatile u16 areaOverflowMode:1; + volatile u16 screenSize:2; +}; + +struct BattleAnimBackground +{ + void *image; + void *palette; + void *tilemap; +}; + +struct UnknownStruct1 +{ + u8 unk0; +}; + +struct UnknownStruct2 +{ + void *unk0; + u16 *unk4; + u8 unk8; +}; + +struct UnknownStruct3 +{ + u8 unk0; + u8 filler1[0xB]; +}; + +void move_something(const u8 *const moveAnims[], u16 b, u8 c); +bool8 b_side_obj__get_some_boolean(u8 a); +void sub_8076034(u8, u8); +bool8 sub_8076BE0(void); + +#endif diff --git a/include/battle_party_menu.h b/include/battle_party_menu.h index c808cdcd7..d0ae8da35 100644 --- a/include/battle_party_menu.h +++ b/include/battle_party_menu.h @@ -13,8 +13,23 @@ struct UnknownStruct1 s16 unk266; }; +struct PartyMenuItem +{ + const u8 *text; + TaskFunc func; +}; + +struct PartyPopupMenu +{ + u8 unk0; + u8 unk1; + const u8 *unk4; +}; + extern u8 unk_2000000[]; +void SetUpBattlePokemonMenu(u8); + #define EWRAM_1609D unk_2000000[0x1609D] #define EWRAM_1B000 (*(struct UnknownStruct1 *)(unk_2000000 + 0x1B000)) diff --git a/include/battle_setup.h b/include/battle_setup.h index 2a1a2e717..e88aefe6d 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -1,84 +1,136 @@ #ifndef GUARD_BATTLE_SETUP_H #define GUARD_BATTLE_SETUP_H -// task01_battle_start -// task_add_01_battle_start +#define NUM_TRAINER_EYE_TRAINERS 56 +#define TRAINER_REMATCH_STEPS 255 + +// IV + LEVEL + SPECIES +struct TrainerPartyMember0 +{ + u16 iv; + u8 level; + u16 species; +}; + +// IV + LEVEL + SPECIES + MOVES +struct TrainerPartyMember1 +{ + u16 iv; + u8 level; + u16 species; + u16 moves[4]; +}; + +// IV + LEVEL + SPECIES + ITEMS +struct TrainerPartyMember2 +{ + u16 iv; + u8 level; + u16 species; + u16 heldItem; +}; + +// IV + LEVEL + SPECIES + ITEMS + MOVES +struct TrainerPartyMember3 +{ + u16 iv; + u8 level; + u16 species; + u16 heldItem; + u16 moves[4]; +}; + +struct TrainerBattleSpec +{ + void *ptr; + u8 ptrType; +}; + +struct TrainerEyeTrainer +{ + u16 trainerNums[5]; + u16 mapGroup; + u16 mapNum; +}; + +//void task01_battle_start(u8 taskId); +//void task_add_01_battle_start(u8 transition, u16 song); void CheckForSafariZoneAndProceed(void); void StartBattle_StandardWild(void); void StartBattle_Roamer(void); void StartBattle_Safari(void); -// task_add_01_battle_start_with_music_and_stats -// StartBattle_WallyTutorial +//void task_add_01_battle_start_with_music_and_stats(void); +//void StartBattle_WallyTutorial(void); void StartBattle_ScriptedWild(void); -// StartBattle_SouthernIsland -// StartBattle_Rayquaza -// StartBattle_GroudonKyogre -// StartBattle_Regi +//void StartBattle_SouthernIsland(void); +//void StartBattle_Rayquaza(void); +//void StartBattle_GroudonKyogre(void); +//void StartBattle_Regi(void); void HandleWildBattleEnd(void); void HandleScriptedWildBattleEnd(void); -// GetBattleTerrain -// GetBattleTransitionTypeByMap -// GetSumOfPartyMonLevel -// GetSumOfEnemyPartyLevel +s8 GetBattleTerrain(void); +//s8 GetBattleTransitionTypeByMap(void); +//u16 GetSumOfPartyMonLevel(u8 numMons); +//u8 GetSumOfEnemyPartyLevel(u16 trainerNum, u8 numMons); u8 GetWildBattleTransition(void); u8 GetTrainerBattleTransition(void); -// GetBattleTowerBattleTransition -// ChooseStarter +u8 GetBattleTowerBattleTransition(void); +//void ChooseStarter(void); void CB2_GiveStarter(void); void CB2_StartFirstBattle(void); void HandleFirstBattleEnd(void); -// TrainerBattleLoadArg32 -// TrainerBattleLoadArg16 -// TrainerBattleLoadArg8 -// trainerflag_opponent +//u32 TrainerBattleLoadArg32(u8 *ptr); +//u16 TrainerBattleLoadArg16(u8 *ptr); +//u8 TrainerBattleLoadArg8(u8 *ptr); +//u16 trainerflag_opponent(void); bool32 battle_exit_is_player_defeat(u32 a1); -// sub_80822BC -// TrainerBattleLoadArgs -// battle_80801F0 +//void sub_80822BC(void); +//void TrainerBattleLoadArgs(const struct TrainerBattleSpec *specs, u8 *data); +//void battle_80801F0(void); u8 *TrainerBattleConfigure(u8 *data); void TrainerWantsBattle(u8, u8 *); bool32 GetTrainerFlagFromScriptPointer(u8 *data); -// sub_8082524 -// sub_8082558 -// sub_8082564 -// sub_808257C -// unref_sub_8082590 +//void sub_8082524(void); +//u8 sub_8082558(void); +//u8 sub_8082564(void); +//void sub_808257C(void); +//void unref_sub_8082590(void); // unused u8 trainer_flag_check(u16); void trainer_flag_set(u16); void trainer_flag_clear(u16); void sub_80825E4(void); void sub_808260C(void); -// do_choose_name_or_words_screen -// sub_80826B0 -// sub_80826D8 +void do_choose_name_or_words_screen(void); +//void sub_80826B0(void); +//void sub_80826D8(void); u8 *sub_80826E8(void); u8 *sub_8082700(void); -// sub_8082718 -// PlayTrainerEncounterMusic -// SanitizeString +//void sub_8082718(void); +//void PlayTrainerEncounterMusic(void); +//u8 *SanitizeString(u8 *str); u8 *sub_808281C(void); -// sub_8082830 -// unref_sub_808286C +u8 *sub_8082830(void); +//u8 *unref_sub_808286C(void); u8 *sub_8082880(void); -// sub_8082894 -// sub_80828B8 -// sub_80828FC -// sub_80829A8 -// sub_80829E8 -// sub_8082A18 -// sub_8082A54 -// sub_8082A90 -// sub_8082AE4 -// sub_8082B10 -// sub_8082B44 +//s32 sub_8082894(const struct TrainerEyeTrainer *trainers, u16 trainerNum); +//s32 sub_80828B8(const struct TrainerEyeTrainer *trainers, u16 trainerNum); +//bool32 sub_80828FC(const struct TrainerEyeTrainer *trainers, u16 mapGroup, u16 mapNum); +//s32 sub_80829A8(const struct TrainerEyeTrainer *trainers, u16 mapGroup, u16 mapNum); +//s32 sub_80829E8(const struct TrainerEyeTrainer *trainers, u16 mapGroup, u16 mapNum); +//bool8 sub_8082A18(const struct TrainerEyeTrainer *trainers, u16 trainerNum); +//bool8 sub_8082A54(const struct TrainerEyeTrainer *trainers, u16 trainerNum); +//u16 sub_8082A90(const struct TrainerEyeTrainer *trainers, u16 trainerNum); +//void sub_8082AE4(const struct TrainerEyeTrainer *trainers, u16 trainerNum); +//bool8 sub_8082B10(const struct TrainerEyeTrainer *trainers, u16 trainerNum); +//bool32 sub_8082B44(void); void sub_8082B78(void); -// sub_8082BA4 +//bool32 sub_8082BA4(void); void sub_8082BD0(u16, u16); -// sub_8082C0C -// unref_sub_8082C2C +s32 sub_8082C0C(u16 mapGroup, u16 mapNum); +s32 unref_sub_8082C2C(u16 mapGroup, u16 mapNum); u16 sub_8082C4C(u16 a1); -// sub_8082C68 -// sub_8082C9C +//s32 sub_8082C68(void); +//u8 sub_8082C9C(void); void sub_8082CB8(void); #endif // GUARD_BATTLE_SETUP_H diff --git a/include/bike.h b/include/bike.h new file mode 100644 index 000000000..decbd1d49 --- /dev/null +++ b/include/bike.h @@ -0,0 +1,56 @@ +#ifndef GUARD_BIKE_H +#define GUARD_BIKE_H + +struct UnknownStruct1 +{ + u32 unk0; + u32 unk4; + u32 unk8; + u32 unkC; + const u8 *unk10; + const u8 *unk14; + u32 unk18; +}; + +// Player speeds +enum +{ + SPEED_STANDING, + SPEED_NORMAL, + SPEED_FAST, + SPEED_FASTER, + SPEED_FASTEST, +}; + +//Acro bike states +enum +{ + ACRO_STATE_NORMAL, + ACRO_STATE_TURNING, + ACRO_STATE_WHEELIE_STANDING, + ACRO_STATE_BUNNY_HOP, + ACRO_STATE_WHEELIE_MOVING, + ACRO_STATE_5, + ACRO_STATE_6, +}; + +//Acro bike transitions +enum +{ + ACRO_TRANS_FACE_DIRECTION, + ACRO_TRANS_NORMAL_TO_WHEELIE = 3, + ACRO_TRANS_WHEELIE_TO_NORMAL, +}; + +void MovePlayerOnBike(u8 direction, u16 newKeys, u16 heldKeys); +void sub_80E5B38(u16 a, u16 b); +bool8 IsRunningDisallowed(u8 tile); +bool8 IsBikingDisallowedByPlayer(void); +bool8 player_should_look_direction_be_enforced_upon_movement(void); +void GetOnOffBike(u8 var); +void BikeClearState(int var1, int var2); +void sub_80E6010(u8 var); +s16 GetPlayerSpeed(void); +void sub_80E6084(void); + +#endif diff --git a/include/braille_puzzles.h b/include/braille_puzzles.h new file mode 100644 index 000000000..2b0e2bb96 --- /dev/null +++ b/include/braille_puzzles.h @@ -0,0 +1,14 @@ +#ifndef GUARD_BRAILLEPUZZLES_H +#define GUARD_BRAILLEPUZZLES_H + +bool8 ShouldDoBrailleStrengthEffect(void); +void DoBrailleStrengthEffect(void); +void UseFlyAncientTomb_Callback(void); +void UseFlyAncientTomb_Finish(void); +void Task_BrailleWait(u8 taskId); +bool32 BrailleWait_CheckButtonPress(void); +void SealedChamberShakingEffect(u8 taskId); +bool8 ShouldDoBrailleDigEffect(void); +void DoBrailleDigEffect(void); + +#endif diff --git a/include/clock.h b/include/clock.h new file mode 100644 index 000000000..4e6560c91 --- /dev/null +++ b/include/clock.h @@ -0,0 +1,8 @@ +#ifndef GUARD_CLOCK_H +#define GUARD_CLOCK_H + +// TODO: time of day and seconds in a day defines + +void DoTimeBasedEvents(void); + +#endif diff --git a/include/contest.h b/include/contest.h new file mode 100644 index 000000000..82520717f --- /dev/null +++ b/include/contest.h @@ -0,0 +1,26 @@ +#ifndef GUARD_CONTEST_H +#define GUARD_CONTEST_H + +struct ContestPokemon +{ + /* 0x00 */ u16 species; + /* 0x02 */ u8 nickname[POKEMON_NAME_LENGTH]; + /* 0x0D */ u8 trainerName[8]; + /* 0x15 */ u8 unk15; + /* 0x16 */ u8 unk16; + /* 0x17 */ u8 filler17[7]; + /* 0x1E */ u16 moves[4]; // moves + /* 0x26 */ u8 cool; // cool + /* 0x27 */ u8 beauty; // beauty + /* 0x28 */ u8 cute; // cute + /* 0x29 */ u8 smart; // smart + /* 0x2A */ u8 tough; // tough + /* 0x2B */ u8 sheen; // sheen + /* 0x2C */ u8 filler2C[12]; + /* 0x38 */ u32 unk38; + /* 0x3C */ u32 unk3C; +}; // wow + +extern struct ContestPokemon gContestMons[]; + +#endif // GUARD_CONTEST_H diff --git a/include/contest_painting.h b/include/contest_painting.h new file mode 100644 index 000000000..896aa299b --- /dev/null +++ b/include/contest_painting.h @@ -0,0 +1,77 @@ +#ifndef GUARD_CONTESTPAINTING_H +#define GUARD_CONTESTPAINTING_H + +#define MOSAIC_BIT_BG_HSIZE (0) +#define MOSAIC_BIT_BG_VSIZE (4) +#define MOSAIC_BIT_OBJ_HSIZE (8) +#define MOSAIC_BIT_OBJ_VSIZE (12) + +enum +{ + CONTEST_COOL, + CONTEST_BEAUTY, + CONTEST_CUTE, + CONTEST_SMART, + CONTEST_TOUGH, +}; + +enum +{ + CONTESTRESULT_COOL = 9, + CONTESTRESULT_BEAUTY = 13, + CONTESTRESULT_CUTE = 2, + CONTESTRESULT_SMART = 36, + CONTESTRESULT_TOUGH = 6, +}; + +struct Unk2015E00 +{ + u16 unk2015e00[128][32]; + u16 unk2017e00[0]; +}; + +struct ContestEntry +{ + /*0x00*/ u8 var0; + /*0x04*/ u32 var4; + /*0x08*/ u16 var8; + /*0x0A*/ u8 contestType; + /*0x0B*/ u8 pokemon_name[POKEMON_NAME_LENGTH]; + /*0x15*/ u8 pad15; + /*0x16*/ u8 trainer_name[OT_NAME_LENGTH]; +}; + +struct Unk3000756 +{ + /*0x00*/ u8 var_0; +}; + +struct LabelPair +{ + const u8 *prefix; + const u8 *suffix; +}; + +struct Unk03005E20 +{ + u8 var_0; + u8 pad1[3]; + u16 (*var_4)[][32]; + u16 (*var_8)[]; + u8 pad0C[4]; + u32 var_10; + u16 var_14; + u16 var_16; + u8 var_18; + u8 var_19; + u8 var_1A; + u8 var_1B; + u8 var_1C; + u8 var_1D; + u8 var_1E; + u8 var_1F; +}; + +void sub_8106630(u32); + +#endif diff --git a/include/dewford_trend.h b/include/dewford_trend.h new file mode 100644 index 000000000..713d491b6 --- /dev/null +++ b/include/dewford_trend.h @@ -0,0 +1,10 @@ +#ifndef GUARD_DEWFORDTREND_H +#define GUARD_DEWFORDTREND_H + +#define ARRAY_2007800 ((struct EasyChatPair *)(unk_2000000 + 0x7800)) +#define ARRAY_2007900 ((struct EasyChatPair *)(unk_2000000 + 0x7900)) + +void sub_80FA17C(void); +void sub_80FA4E4(void *, u32, u8); + +#endif diff --git a/include/field_control_avatar.h b/include/field_control_avatar.h new file mode 100644 index 000000000..3f17ebee9 --- /dev/null +++ b/include/field_control_avatar.h @@ -0,0 +1,13 @@ +#ifndef GUARD_FIELDCONTROLAVATAR_H +#define GUARD_FIELDCONTROLAVATAR_H + +void FieldClearPlayerInput(struct FieldInput *pStruct); +void FieldGetPlayerInput(struct FieldInput *pStruct, u16 keys, u16 heldKeys); +int sub_8068024(struct FieldInput *pStruct); +u8 *sub_80682A8(struct MapPosition *, u8, u8); +void overworld_poison_timer_set(void); +void prev_quest_postbuffer_cursor_backup_reset(void); +u8 *sub_8068E24(struct MapPosition *); +u8 *GetFieldObjectScriptPointerForComparison(); + +#endif diff --git a/include/field_door.h b/include/field_door.h new file mode 100644 index 000000000..1759e0dc1 --- /dev/null +++ b/include/field_door.h @@ -0,0 +1,25 @@ +#ifndef GUARD_FIELDDOOR_H +#define GUARD_FIELDDOOR_H + +struct DoorGraphics +{ + u16 metatileNum; + u8 unk2; + void *tiles; + void *palette; +}; + +struct DoorAnimFrame +{ + u8 time; + u16 offset; +}; + +void FieldSetDoorOpened(u32, u32); +void FieldSetDoorClosed(u32, u32); +s8 FieldAnimateDoorClose(u32, u32); +s8 FieldAnimateDoorOpen(u32, u32); +bool8 FieldIsDoorAnimationRunning(void); +u32 sub_8058790(u32 x, u32 y); + +#endif diff --git a/include/field_map_obj_helpers.h b/include/field_map_obj_helpers.h new file mode 100644 index 000000000..5498bde12 --- /dev/null +++ b/include/field_map_obj_helpers.h @@ -0,0 +1,11 @@ +#ifndef GUARD_FIELDMAPOBJHELP_H +#define GUARD_FIELDMAPOBJHELP_H + +bool8 FreezeMapObject(struct MapObject *); +void FreezeMapObjects(void); +void FreezeMapObjectsExceptOne(u8); +void UnfreezeMapObjects(void); +void sub_806487C(struct Sprite *sprite, bool8 invisible); +void sub_8064990(u8, u8); + +#endif diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 3efca3af7..a4f77a172 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -78,7 +78,7 @@ u8 GetPlayerAvatarGraphicsIdByCurrentState(void); void SetPlayerAvatarExtraStateTransition(u8 a, u8 b); void InitPlayerAvatar(s16 a, s16 b, u8 c, u8 d); // sub_8059B88 -// sub_8059BF4 +void sub_8059BF4(void); // sub_8059C3C void sub_8059C94(u8); // sub_8059D08 diff --git a/include/fieldmap.h b/include/fieldmap.h new file mode 100644 index 000000000..936d27b4a --- /dev/null +++ b/include/fieldmap.h @@ -0,0 +1,6 @@ +#ifndef GUARD_FIELDMAP2_H +#define GUARD_FIELDMAP2_H + +struct MapHeader *mapconnection_get_mapheader(struct MapConnection *connection); + +#endif diff --git a/include/gba/flash_internal.h b/include/gba/flash_internal.h index 6156b6c14..cbcfb5466 100644 --- a/include/gba/flash_internal.h +++ b/include/gba/flash_internal.h @@ -65,6 +65,10 @@ u16 ReadFlashId(void); void StartFlashTimer(u8 phase); void SetReadFlash1(u16 *dest); void StopFlashTimer(void); +u16 SetFlashTimerIntr(u8 timerNum, void (**intrFunc)(void)); +u32 ProgramFlashSectorAndVerify(u16 sectorNum, u8 *src); +void ReadFlash(u16 sectorNum, u32 offset, u8 *dest, u32 size); +u32 ProgramFlashSectorAndVerifyNBytes(u16 sectorNum, u8 *src, u32 n); u16 WaitForFlashWrite_Common(u8 phase, u8 *addr, u8 lastData); @@ -73,4 +77,7 @@ u16 EraseFlashSector_MX(u16 sectorNum); u16 ProgramFlashByte_MX(u16 sectorNum, u32 offset, u8 data); u16 ProgramFlashSector_MX(u16 sectorNum, u8 *src); +// agb_flash_1m +u16 IdentifyFlash(void); + #endif // GUARD_GBA_FLASH_INTERNAL_H diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 3c6f4cf4e..508d7e4ed 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -107,8 +107,21 @@ struct BgEvent s16 x, y; u8 unk4; u8 kind; - s16 filler_6; - u8 *script; + // 0x2 padding for the union beginning. + union { // carried over from diego's FR/LG work, seems to be the same struct + // in gen 3, "kind" (0x3 in BgEvent struct) determines the method to read the union. + u8 *script; + + // hidden item type probably + struct { + u8 filler6[0x2]; + u16 hiddenItemId; // flag offset to determine flag lookup + } hiddenItem; + + // secret base type + u16 secretBaseId; + + } bgUnion; }; struct MapEvents @@ -126,10 +139,10 @@ struct MapEvents struct MapConnection { - u8 direction; - u32 offset; - u8 mapGroup; - u8 mapNum; + /*0x00*/ u8 direction; + /*0x01*/ u32 offset; + /*0x05*/ u8 mapGroup; + /*0x06*/ u8 mapNum; }; struct MapConnections diff --git a/include/global.h b/include/global.h index 56338a9e8..ad08af84f 100644 --- a/include/global.h +++ b/include/global.h @@ -71,6 +71,11 @@ enum BAG_KEYITEMS }; +struct TextStruct +{ + const u8 *text; +}; + struct Coords16 { s16 x; @@ -167,7 +172,8 @@ struct RamScript struct SB1_2EFC_Struct { - u8 unknown[0x20]; + u16 var; + u8 unknown[0x1E]; }; struct EasyChatPair @@ -295,6 +301,25 @@ typedef union OldMan { struct UnkMauvilleOldManStruct2 oldMan2; } OldMan; +struct Unk_SB_Access_Struct1 +{ + u8 filler0[0xF8]; + struct SB1_2EFC_Struct sb1_2EFC_struct[5]; +}; + +struct Unk_SB_Access_Struct2 +{ + struct SB1_2EFC_Struct sb1_2EFC_struct2[12]; // each is 0x20 + /*0x2F84*/ u8 filler[0x18]; +}; + +/*0x2E04*/ +typedef union SB_Struct { + struct Unk_SB_Access_Struct1 unkSB1; + struct Unk_SB_Access_Struct2 unkSB2; +} SB_Struct; +// size is 0x198 + struct SaveBlock1 /* 0x02025734 */ { /*0x00*/ struct Coords16 pos; @@ -364,8 +389,8 @@ struct SaveBlock1 /* 0x02025734 */ /*0x2D94*/ OldMan oldMan; /*0x2DC0*/ u8 unk_2DC0[0x14]; /*0x2DD4*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff - /*0x2DFC*/ u8 filler_2DFC[0x100]; - /*0x2EFC*/ struct SB1_2EFC_Struct sb1_2EFC_struct[5]; + /*0x2DFC*/ u8 filler_2DFC[0x8]; + /*0x2E04*/ SB_Struct sbStruct; /*0x2F9C*/ u8 filler_2F9C[0xA0]; /*0x303C*/ u8 filler_303C[0x38]; /*0x3074*/ u8 filler_3074[0x42]; diff --git a/include/intro.h b/include/intro.h index a859a9ce4..7fdbd9cb0 100644 --- a/include/intro.h +++ b/include/intro.h @@ -3,5 +3,6 @@ void c2_copyright_1(void); void CB2_InitCopyrightScreen(void); +void sub_813CE30(u16, u16, u16, u16); #endif // GUARD_INTRO_H diff --git a/include/matsuda_debug_menu.h b/include/matsuda_debug_menu.h new file mode 100644 index 000000000..5df53d688 --- /dev/null +++ b/include/matsuda_debug_menu.h @@ -0,0 +1,11 @@ +#ifndef GUARD_MATSUDADEBUG_H +#define GUARD_MATSUDADEBUG_H + +#define BIT(n) (1 << (n)) + +void sub_80AB184(void); +void sub_80AA280(u8); +void sub_80AA5E8(u8); +void sub_80AA658(u8); + +#endif diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index 2960a1b6f..f4250f07b 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -72,7 +72,7 @@ bool8 MetatileBehavior_IsPuddle(u8); bool8 MetatileBehavior_IsTallGrass(u8); bool8 MetatileBehavior_IsLongGrass(u8); bool8 MetatileBehavior_IsBerryTreeSoil(u8); -bool8 MetatileBehavior_IsAsh(u8); +bool8 MetatileBehavior_IsAshGrass(u8); bool8 MetatileBehavior_IsUnusedFootprintMetatile(u8); bool8 MetatileBehavior_IsBridge(u8); u8 sub_8057450(u8); @@ -123,7 +123,7 @@ bool8 MetatileBehavior_IsVerticalRail(u8); bool8 MetatileBehavior_IsHorizontalRail(u8); bool8 MetatileBehavior_IsSeaweed(u8); bool8 MetatileBehavior_IsRunningDisallowed(u8); -bool8 sub_80578F8(u8); +bool8 MetatileBehavior_IsCuttableGrass(u8); bool8 sub_805791C(u8); bool8 MetatileBehavior_IsPictureBookShelf(u8); bool8 MetatileBehavior_IsBookShelf(u8); diff --git a/include/metatile_behaviors.h b/include/metatile_behaviors.h index ea705054e..1241fbb81 100644 --- a/include/metatile_behaviors.h +++ b/include/metatile_behaviors.h @@ -32,7 +32,7 @@ #define MB_ICE 0x20 #define MB_SAND 0x21 #define MB_SEAWEED 0x22 -#define MB_ASH 0x24 +#define MB_ASHGRASS 0x24 #define MB_25 0x25 #define MB_THIN_ICE 0x26 #define MB_CRACKED_ICE 0x27 diff --git a/include/name_string_util.h b/include/name_string_util.h new file mode 100644 index 000000000..110f8cc22 --- /dev/null +++ b/include/name_string_util.h @@ -0,0 +1,7 @@ +#ifndef GUARD_NAMESTRINGUTIL_H +#define GUARD_NAMESTRINGUTIL_H + +void PadNameString(u8 *a1, u8 a2); +void SanitizeNameString(u8 *a1); + +#endif diff --git a/include/naming_screen.h b/include/naming_screen.h new file mode 100644 index 000000000..b6b464538 --- /dev/null +++ b/include/naming_screen.h @@ -0,0 +1,83 @@ +#ifndef GUARD_NAMINGSCREEN_H +#define GUARD_NAMINGSCREEN_H + +#define KBEVENT_NONE 0 +#define KBEVENT_PRESSED_A 5 +#define KBEVENT_PRESSED_B 6 +#define KBEVENT_PRESSED_SELECT 8 +#define KBEVENT_PRESSED_START 9 + +enum +{ + NAMING_SCREEN_TEMPLATE_PLAYER_NAME, + NAMING_SCREEN_TEMPLATE_BOX_NAME, + NAMING_SCREEN_TEMPLATE_MON_NAME, +}; + +struct NamingScreenTemplate +{ + u8 unk0; + u8 maxChars; + u8 unk2; + u8 unk3; + u8 unk4; //mode? + u8 unk5; + u8 unk6; + u8 unk7; + const u8 *title; +}; + +struct NamingScreenData +{ + /*0x00*/ u8 state; + /*0x01*/ u8 templateNum; + /*0x02*/ u16 unk2; + /*0x04*/ u16 bg1vOffset; + /*0x06*/ u16 bg2vOffset; + /*0x08*/ u16 unk8; + /*0x0A*/ u16 unkA; + /*0x0C*/ u8 unkC; + /*0x0D*/ u8 unkD; + /*0x0E*/ u8 currentPage; + /*0x0F*/ u8 cursorSpriteId; + /*0x10*/ u8 unk10; + /*0x11*/ u8 textBuffer[0x10]; + /*0x21*/ u8 filler21[0x13]; + const struct NamingScreenTemplate *template; + /*0x38*/ u8 *destBuffer; + /*0x3C*/ u16 unk3C; //savedKeyRepeatStartDelay + /*0x3E*/ u16 unk3E; + /*0x40*/ u16 unk40; + /*0x42*/ u32 unk42; + /*0x46*/ MainCallback returnCallback; +}; + +enum +{ + PAGE_UPPER, + PAGE_LOWER, + PAGE_OTHERS, +}; + +enum +{ + MAIN_STATE_BEGIN_FADE_IN, + MAIN_STATE_WAIT_FADE_IN, + MAIN_STATE_HANDLE_INPUT, + MAIN_STATE_MOVE_TO_OK_BUTTON, + MAIN_STATE_START_PAGE_SWAP, + MAIN_STATE_WAIT_PAGE_SWAP, + MAIN_STATE_6, + MAIN_STATE_UPDATE_SENT_TO_PC_MESSAGE, + MAIN_STATE_BEGIN_FADE_OUT, +}; + +enum +{ + INPUT_STATE_DISABLED, + INPUT_STATE_ENABLED, +}; + +void DoNamingScreen(u8 r0, u8 *r1, u16 r2, u16 r3, u32 s0, MainCallback s4); + +#endif diff --git a/include/rom4.h b/include/rom4.h index bb3486c38..5aae277a6 100644 --- a/include/rom4.h +++ b/include/rom4.h @@ -20,7 +20,7 @@ struct LinkPlayerMapObject // sub_8052F5C // flag_var_implications_of_teleport_ void new_game(void); -// sub_8053014 +void sub_8053014(void); void sub_8053050(void); // sub_805308C void ResetGameStats(void); diff --git a/include/rom6.h b/include/rom6.h new file mode 100644 index 000000000..e7a3ba48e --- /dev/null +++ b/include/rom6.h @@ -0,0 +1,7 @@ +#ifndef GUARD_ROM6_H +#define GUARD_ROM6_H + +bool8 npc_before_player_of_type(u8); +u8 oei_task_add(void); + +#endif diff --git a/include/save.h b/include/save.h index fe22e4ad7..b9d4121ec 100644 --- a/include/save.h +++ b/include/save.h @@ -12,38 +12,63 @@ struct SaveSection u8 data[0xFF4]; u16 id; u16 checksum; - u32 unknown; + u32 security; u32 counter; -}; +}; // size is 0x1000 +// headless save section? struct UnkSaveSection { u8 data[0xFF4]; - u32 unknown; + u32 security; +}; // size is 0xFF8 + +// Ruby/Sapphire's save data is Flash 128K, which is 32 save sectors. +#define NUM_SECTORS 32 // defined in agb_flash but not in a header + +#define UNKNOWN_CHECK_VALUE 0x8012025 + +// SetDamagedSectorBits states +enum +{ + ENABLE, + DISABLE, + CHECK // unused +}; + +// Do save types +enum +{ + NORMAL_SAVE, + LINK_SAVE, + EREADER_SAVE, // mossdeep event + HOF_SAVE, + DIFFERENT_FILE_SAVE, + HOF_DELETE_SAVE // unused }; void ClearSaveData(void); -void sub_81251B8(void); -bool32 sub_81251D4(u8 op, u8 bit); -u8 save_write_to_flash(u16 a1, struct SaveSectionLocation *a2); -u8 sub_81252D8(u16, struct SaveSectionLocation *); -u8 sub_81253C8(u8 sector, u8 *data, u16 size); -u8 sub_8125440(u8, u8 *); -u32 sub_812546C(struct SaveSectionLocation *a1); -u32 sub_81254C8(struct SaveSectionLocation *a1); -u8 sub_812550C(u16 a1, struct SaveSectionLocation *a2); -u8 sub_812556C(u16 a1, struct SaveSectionLocation *a2); -u8 sub_81255B8(u16, struct SaveSectionLocation *); -u8 sub_8125758(u16 a1, struct SaveSectionLocation *a2); -u8 sub_81257F0(u16 a1, struct SaveSectionLocation *a2); -u8 sub_812587C(u16 a1, struct SaveSectionLocation *a2); -u8 sub_81258BC(u16, struct SaveSectionLocation *); -u8 sub_8125974(struct SaveSectionLocation *); +void ResetSaveCounters(void); +bool32 ManipulateSectorBits(u8 op, u8 bit); +u8 save_write_to_flash(u16 a1, const struct SaveSectionLocation *a2); +u8 HandleWriteSector(u16, const struct SaveSectionLocation *); +u8 HandleWriteSectorNBytes(u8 sector, u8 *data, u16 size); +u8 TryWriteSector(u8, u8 *); +u32 RestoreSaveBackupVarsAndIncrement(const struct SaveSectionLocation *location); +u32 RestoreSaveBackupVars(const struct SaveSectionLocation *location); +u8 sub_812550C(u16 a1, const struct SaveSectionLocation *location); +u8 sub_812556C(u16 a1, const struct SaveSectionLocation *location); +u8 sub_81255B8(u16, const struct SaveSectionLocation *location); +u8 sub_8125758(u16 a1, const struct SaveSectionLocation *location); +u8 sub_81257F0(u16 a1, const struct SaveSectionLocation *location); +u8 sub_812587C(u16 a1, const struct SaveSectionLocation *location); +u8 sub_81258BC(u16, const struct SaveSectionLocation *location); +u8 sub_8125974(const struct SaveSectionLocation *location); u8 sub_8125B88(u8 a1, u8 *data, u16 size); u8 sub_8125BF8(u8, struct SaveSection *); -u16 sub_8125C10(void *, u16); -u8 sub_8125C3C(u8 a1); -u8 sub_8125D44(u8 a1); +u16 CalculateChecksum(void *, u16); +u8 HandleSavingData(u8 saveType); +u8 TrySavingData(u8 saveType); u8 sub_8125D80(void); bool8 sub_8125DA8(void); u8 sub_8125DDC(void); diff --git a/include/script_menu.h b/include/script_menu.h new file mode 100644 index 000000000..7a504556e --- /dev/null +++ b/include/script_menu.h @@ -0,0 +1,31 @@ +#ifndef GUARD_SCRIPTMENU_H +#define GUARD_SCRIPTMENU_H + +struct MultichoiceListStruct +{ + struct MenuAction *list; + u8 count; +}; + +bool8 sub_80B5054(u8 left, u8 top, u8 var3, u8 var4); +bool8 sub_80B50B0(u8 left, u8 top, u8 var3, u8 var4, u8 var5); +u16 GetStringWidthInTilesForScriptMenu(const u8 *str); +void DrawMultichoiceMenu(u8, u8, u8, struct MenuAction *list, u8, u8); +void sub_80B5230(u8, u8, u8, u8, u8, u8); +void sub_80B52B4(u8); +bool8 Multichoice(u8 var1, u8 var2, u8 var3, u8 var4); +void sub_80B53B4(u8, u8, u8, struct MenuAction *list, u8); +bool8 yes_no_box(u8 var1, u8 var2); +bool8 IsScriptActive(void); // unused +void task_yes_no_maybe(u8); +bool8 sub_80B5578(u8 left, u8 top, u8 multichoiceId, u8 a4, u8 columnCount); +void sub_80B5684(u8); +bool8 TryCreatePCMenu(void); +void CreatePCMenu(void); +void sub_80B5838(void); +void task_picbox(u8 taskId); +bool8 sub_80B58C4(u16 var1, u8 var2, u8 var3); +void *picbox_close(void); +bool8 sub_80B59AC(void); + +#endif diff --git a/include/script_pokemon_80C4.h b/include/script_pokemon_80C4.h new file mode 100644 index 000000000..6d4e689b5 --- /dev/null +++ b/include/script_pokemon_80C4.h @@ -0,0 +1,22 @@ +#ifndef GUARD_SCRIPTPOKE80C4_H +#define GUARD_SCRIPTPOKE80C4_H + +struct MonCoords +{ + u8 x, y; +}; + +void sub_80C5190(u8); +void sub_80C5580(void); +void SetBattleTowerPlayerParty(void); +void ReducePlayerPartyToThree(void); + +u8 sub_80C4D50(void); +void ShowContestWinner(void); +void HealPlayerParty(); +u8 ScriptGiveMon(u16, u8, u16, u32, u32, u8); +u8 ScriptGiveEgg(u16); +void ScriptWildBattle(u16, u8, u16); +void ScriptSetMonMoveSlot(u8, u16, u8); + +#endif diff --git a/include/script_pokemon_80F9.h b/include/script_pokemon_80F9.h new file mode 100644 index 000000000..d65c99c15 --- /dev/null +++ b/include/script_pokemon_80F9.h @@ -0,0 +1,17 @@ +#ifndef GUARD_SCRIPTPOKE80F9_H +#define GUARD_SCRIPTPOKE80F9_H + +struct UnknownStruct2018000 +{ + u8 filler0[0x8]; + u8 unk8; +}; + +extern struct UnknownStruct2018000 unk_2018000; + +void sub_80F9A8C(u8); +void sub_80F9C00(void); +void sub_80F9E1C(void); +void sub_80F99CC(void); + +#endif diff --git a/include/strings.h b/include/strings.h new file mode 100644 index 000000000..89a78e478 --- /dev/null +++ b/include/strings.h @@ -0,0 +1,905 @@ +#ifndef GUARD_STRINGS_H +#define GUARD_STRINGS_H + +// placeholder strings +extern const u8 gExpandedPlaceholder_Empty[]; +extern const u8 gExpandedPlaceholder_Kun[]; +extern const u8 gExpandedPlaceholder_Chan[]; +extern const u8 gExpandedPlaceholder_Sapphire[]; +extern const u8 gExpandedPlaceholder_Ruby[]; +extern const u8 gExpandedPlaceholder_Aqua[]; +extern const u8 gExpandedPlaceholder_Magma[]; +extern const u8 gExpandedPlaceholder_Archie[]; +extern const u8 gExpandedPlaceholder_Maxie[]; +extern const u8 gExpandedPlaceholder_Kyogre[]; +extern const u8 gExpandedPlaceholder_Groudon[]; +extern const u8 gExpandedPlaceholder_Brendan[]; +extern const u8 gExpandedPlaceholder_May[]; + +// system text +extern const u8 gSystemText_Egg[]; +extern const u8 gSystemText_Pokemon2[]; + +// main menu text +extern const u8 gMainMenuString_NewGame[]; +extern const u8 gMainMenuString_Continue[]; +extern const u8 gMainMenuString_Option[]; +extern const u8 gMainMenuString_MysteryEvents[]; + +// system text 2 +extern const u8 SystemText_UpdatingSaveExternal[]; +extern const u8 SystemText_SaveUpdated[]; +extern const u8 SystemText_SaveUpdatedExchangeBackup[]; +extern const u8 SystemText_SaveNotUpdated[]; + +// save file text +extern const u8 gSaveFileCorruptMessage[]; +extern const u8 gSaveFileDeletedMessage[]; + +// system text 3 +extern const u8 gBoardNotInstalledMessage[]; +extern const u8 gBatteryDryMessage[]; + +// main menu text 2 +extern const u8 gMainMenuString_Player[]; +extern const u8 gMainMenuString_Pokedex[]; +extern const u8 gMainMenuString_Time[]; +extern const u8 gMainMenuString_Badges[]; + +// birch text +extern const u8 gBirchText_Boy[]; +extern const u8 gBirchText_Girl[]; +extern const u8 gBirchText_NewName[]; + +extern const u8 gDefaultBoyName1[]; +extern const u8 gDefaultBoyName2[]; +extern const u8 gDefaultBoyName3[]; +extern const u8 gDefaultBoyName4[]; + +extern const u8 gDefaultGirlName1[]; +extern const u8 gDefaultGirlName2[]; +extern const u8 gDefaultGirlName3[]; +extern const u8 gDefaultGirlName4[]; + +extern const u8 gSystemText_IntroWeCall[]; +extern const u8 gSystemText_NewPara[]; + +extern const u8 gDexText_UnknownPoke[]; +extern const u8 gDexText_UnknownHeight[]; +extern const u8 gDexText_UnknownWeight[]; +extern const u8 gDexText_CryOf[]; +extern const u8 gDexText_SizeComparedTo[]; +extern const u8 gDexText_RegisterComplete[]; +extern const u8 gDexText_Searching[]; +extern const u8 gDexText_SearchComplete[]; +extern const u8 gDexText_NoMatching[]; + +extern const u8 DexText_SearchForPoke[]; +extern const u8 DexText_SwitchDex[]; +extern const u8 DexText_ReturnToDex[]; +extern const u8 DexText_SelectDexMode[]; +extern const u8 DexText_SelectDexList[]; +extern const u8 DexText_ListByABC[]; +extern const u8 DexText_ListByColor[]; +extern const u8 DexText_ListByType[]; +extern const u8 DexText_ExecuteSearchSwitch[]; +extern const u8 DexText_HoennDex[]; +extern const u8 DexText_NationalDex[]; +extern const u8 DexText_NumericalMode[]; +extern const u8 DexText_ABCMode[]; +extern const u8 DexText_HeaviestMode[]; +extern const u8 DexText_LightestMode[]; +extern const u8 DexText_TallestMode[]; +extern const u8 DexText_SmallestMode[]; +extern const u8 DexText_ABC[]; +extern const u8 DexText_DEF[]; +extern const u8 DexText_GHI[]; +extern const u8 DexText_JKL[]; +extern const u8 DexText_MNO[]; +extern const u8 DexText_PQR[]; +extern const u8 DexText_STU[]; +extern const u8 DexText_VWX[]; +extern const u8 DexText_YZ[]; +extern const u8 DexText_Red[]; +extern const u8 DexText_Blue[]; +extern const u8 DexText_Yellow[]; +extern const u8 DexText_Green[]; +extern const u8 DexText_Black[]; +extern const u8 DexText_Brown[]; +extern const u8 DexText_Purple[]; +extern const u8 DexText_Gray[]; +extern const u8 DexText_White[]; +extern const u8 DexText_Pink[]; +extern const u8 DexText_HoennDex2[]; +extern const u8 DexText_NationalDex2[]; +extern const u8 DexText_ListByNumber[]; +extern const u8 DexText_ListByABC2[]; +extern const u8 DexText_ListByHeavyToLightest[]; +extern const u8 DexText_ListByLightToHeaviest[]; +extern const u8 DexText_ListByTallToSmallest[]; +extern const u8 DexText_ListBySmallToTallest[]; +extern const u8 DexText_Terminator5[]; +extern const u8 DexText_DontSpecify[]; +extern const u8 DexText_None[]; +extern const u8 DexText_RightPointingTriangle[]; +extern const u8 DexText_Terminator6[]; + +extern const u8 gMenuText_WelcomeToHOFAndDexRating[]; +extern const u8 gMenuText_HOFSaving[]; +extern const u8 gMenuText_HOFCorrupt[]; +extern const u8 gMenuText_HOFNumber[]; +extern const u8 gMenuText_HOFCongratulations[]; + +extern const u8 gOtherText_Number2[]; +extern const u8 gOtherText_Level3[]; +extern const u8 gOtherText_IDNumber[]; +extern const u8 gOtherText_Name[]; +extern const u8 gOtherText_IDNumber2[]; +extern const u8 gOtherText_BirchInTrouble[]; +extern const u8 gOtherText_DoYouChoosePoke[]; +extern const u8 gOtherText_Poke[]; + +extern const u8 gSystemText_SaveErrorExchangeBackup[]; +extern const u8 gOtherText_FlyToWhere[]; + +extern const u8 OtherText_Use[]; +extern const u8 OtherText_Toss[]; +extern const u8 OtherText_Register[]; +extern const u8 OtherText_Give2[]; +extern const u8 OtherText_CheckTag[]; +extern const u8 OtherText_Confirm[]; +extern const u8 gOtherText_Walk[]; + +extern const u8 gUnknownText_Exit[]; +extern const u8 gOtherText_CancelNoTerminator[]; +extern const u8 gOtherText_CancelWithTerminator[]; + +extern const u8 OtherText_Item[]; +extern const u8 OtherText_Mail[]; +extern const u8 OtherText_Take2[]; +extern const u8 OtherText_Store[]; + +extern const u8 gOtherText_Check[]; +extern const u8 gOtherText_None[]; + +extern const u8 gOtherText_ThreeQuestions2[]; + +extern const u8 gOtherText_FiveQuestionsAndSlash[]; + +extern const u8 gOtherText_OneDash[]; +extern const u8 gOtherText_TwoDashes[]; +extern const u8 gOtherText_ThreeDashes2[]; +extern const u8 gOtherText_MaleSymbol2[]; +extern const u8 gOtherText_FemaleSymbolAndLv[]; +extern const u8 gOtherText_TallPlusAndRightArrow[]; +extern const u8 gMenuText_GoBackToPrev[]; +extern const u8 gOtherText_WhatWillYouDo[]; + +extern const u8 gOtherText_xString1[]; +extern const u8 gOtherText_Berry2[]; +extern const u8 gOtherText_Coins2[]; +extern const u8 gOtherText_CloseBag[]; + +extern const u8 OtherText_TheField3[]; +extern const u8 OtherText_TheBattle[]; +extern const u8 OtherText_ThePokeList[]; +extern const u8 OtherText_TheShop[]; +extern const u8 OtherText_TheField[]; +extern const u8 OtherText_TheField2[]; +extern const u8 OtherText_ThePC[]; + +extern const struct TextStruct gUnknown_0840E740[]; + +extern const u8 gOtherText_ReturnTo[]; +extern const u8 gOtherText_WhatWillYouDo2[]; +extern const u8 gOtherText_CantWriteMail[]; +extern const u8 gOtherText_NoPokemon[]; +extern const u8 gOtherText_SwitchWhichItem[]; +extern const u8 gOtherText_CantBeHeld[]; +extern const u8 gOtherText_CantBeHeldHere[]; +extern const u8 gOtherText_HowManyToDeposit[]; +extern const u8 gOtherText_DepositedItems[]; +extern const u8 gOtherText_NoRoomForItems[]; +extern const u8 gOtherText_CantStoreSomeoneItem[]; +extern const u8 gOtherText_TooImportant[]; +extern const u8 gOtherText_HowManyToToss[]; +extern const u8 gOtherText_ThrewAwayItem[]; +extern const u8 gOtherText_OkayToThrowAwayPrompt[]; +extern const u8 gOtherText_DadsAdvice[]; +extern const u8 gOtherText_CantGetOffBike[]; +extern const u8 gOtherText_ItemfinderResponding[]; +extern const u8 gOtherText_ItemfinderItemUnderfoot[]; +extern const u8 gOtherText_NoResponse[]; +extern const u8 gOtherText_Coins3[]; +extern const u8 gOtherText_BootedTM[]; +extern const u8 gOtherText_BootedHM[]; +extern const u8 gOtherText_ContainsMove[]; +extern const u8 gOtherText_UsedItem[]; +extern const u8 gOtherText_RepelLingers[]; +extern const u8 gOtherText_UsedFlute[]; +extern const u8 gOtherText_UsedRepel[]; +extern const u8 gOtherText_BoxIsFull[]; +extern const u8 gOtherText_Size[]; +extern const u8 gOtherText_Firm[]; + +extern const u8 gContestStatsText_Unknown1[]; + +extern const u8 ContestStatsText_VerySoft[]; +extern const u8 ContestStatsText_Soft[]; +extern const u8 ContestStatsText_Hard[]; +extern const u8 ContestStatsText_VeryHard[]; +extern const u8 ContestStatsText_SuperHard[]; + +extern const u8 ContestStatsText_RedPokeBlock[]; +extern const u8 ContestStatsText_BluePokeBlock[]; +extern const u8 ContestStatsText_PinkPokeBlock[]; +extern const u8 ContestStatsText_GreenPokeBlock[]; +extern const u8 ContestStatsText_YellowPokeBlock[]; +extern const u8 ContestStatsText_PurplePokeBlock[]; +extern const u8 ContestStatsText_IndigoPokeBlock[]; +extern const u8 ContestStatsText_BrownPokeBlock[]; +extern const u8 ContestStatsText_LiteBluePokeBlock[]; +extern const u8 ContestStatsText_OlivePokeBlock[]; +extern const u8 ContestStatsText_GrayPokeBlock[]; +extern const u8 ContestStatsText_BlackPokeBlock[]; +extern const u8 ContestStatsText_WhitePokeBlock[]; +extern const u8 ContestStatsText_GoldPokeBlock[]; + +extern const u8 gContestStatsText_Spicy[]; +extern const u8 gContestStatsText_Dry[]; +extern const u8 gContestStatsText_Sweet[]; +extern const u8 gContestStatsText_Bitter[]; +extern const u8 gContestStatsText_Sour[]; + +extern const u8 gContestStatsText_StowCase[]; +extern const u8 gContestStatsText_ThrowAwayPrompt[]; +extern const u8 gContestStatsText_WasThrownAway[]; +extern const u8 gContestStatsText_NormallyAte[]; +extern const u8 gContestStatsText_HappilyAte[]; +extern const u8 gContestStatsText_DisdainfullyAte[]; + +extern const u8 MartText_Buy[]; +extern const u8 MartText_Sell[]; +extern const u8 MartText_Quit2[]; + +extern const u8 gOtherText_QuitShopping[]; + +extern const u8 gOtherText_HowManyYouWant[]; +extern const u8 gOtherText_ThatWillBe[]; +extern const u8 gOtherText_ThatWillBe2[]; +extern const u8 gOtherText_ThatWillBe3[]; +extern const u8 gOtherText_HereYouGo[]; +extern const u8 gOtherText_HereYouGo2[]; +extern const u8 gOtherText_HereYouGo3[]; +extern const u8 gOtherText_NotEnoughMoney[]; +extern const u8 gOtherText_NoRoomFor[]; +extern const u8 gOtherText_SpaceForIsFull[]; +extern const u8 gOtherText_AnythingElse[]; +extern const u8 gOtherText_CanIHelpYou[]; +extern const u8 gOtherText_FreePremierBall[]; +extern const u8 gOtherText_CantBuyThat[]; +extern const u8 gOtherText_HowManyToSell[]; +extern const u8 gOtherText_CanPay[]; +extern const u8 gOtherText_SoldItem[]; + +extern const u8 OtherText_Money[]; +extern const u8 OtherText_Shift[]; +extern const u8 OtherText_SendOut[]; +extern const u8 OtherText_Switch2[]; +extern const u8 OtherText_Summary[]; +extern const u8 OtherText_Moves[]; +extern const u8 OtherText_Enter2[]; +extern const u8 OtherText_NoEntry[]; +extern const u8 OtherText_Take[]; +extern const u8 OtherText_Read2[]; + +extern const u8 gOtherText_Hp2[]; +extern const u8 gOtherText_SpAtk2[]; +extern const u8 gOtherText_SpDef2[]; +extern const u8 gOtherText_WontHaveAnyEffect[]; + +extern const u8 gOtherText_CantUseOnPoke[]; + +extern const u8 gOtherText_CantBeSwitched[]; +extern const u8 gOtherText_AlreadyBattle[]; +extern const u8 gOtherText_AlreadySelected[]; +extern const u8 gOtherText_NoEnergyLeft[]; +extern const u8 gOtherText_CantSwitchPokeWithYours[]; +extern const u8 gOtherText_EGGCantBattle[]; +extern const u8 gOtherText_CantBeUsedBadge[]; +extern const u8 gOtherText_NoMoreThreePoke[]; +extern const u8 gOtherText_SendRemovedMailPrompt[]; +extern const u8 gOtherText_MailWasSent[]; +extern const u8 gOtherText_MailboxIsFull[]; +extern const u8 gOtherText_MailRemovedMessageLost[]; +extern const u8 gOtherText_MailMustBeRemoved[]; +extern const u8 gOtherText_WasGivenToHold[]; +extern const u8 gOtherText_AlreadyHolding[]; +extern const u8 gOtherText_NotHoldingAnything[]; +extern const u8 gOtherText_ReceivedTheThingFrom[]; +extern const u8 gOtherText_MailTaken[]; +extern const u8 gOtherText_TakenAndReplaced[]; +extern const u8 gOtherText_PokeHoldingItemCantMail[]; +extern const u8 gOtherText_MailTransferredMailbox[]; +extern const u8 gOtherText_BagFullCannotRemoveItem[]; +extern const u8 gOtherText_LearnedMove[]; +extern const u8 gOtherText_NotCompatible[]; +extern const u8 gOtherText_WantsToLearn[]; +extern const u8 gOtherText_StopTryingTo[]; +extern const u8 gOtherText_DidNotLearnMove2[]; +extern const u8 gOtherText_WhichMoveToForget2[]; +extern const u8 gOtherText_ForgetMove123_2[]; +extern const u8 gOtherText_AlreadyKnows[]; +extern const u8 gOtherText_HPRestoredBy[]; +extern const u8 gOtherText_CuredPoisoning[]; +extern const u8 gOtherText_CuredParalysis[]; +extern const u8 gOtherText_WokeUp[]; +extern const u8 gOtherText_BurnHealed[]; +extern const u8 gOtherText_ThawedOut[]; +extern const u8 gOtherText_PPRestored[]; +extern const u8 gOtherText_RegainedHealth[]; +extern const u8 gOtherText_BecameHealthy[]; +extern const u8 gOtherText_PPIncreased[]; +extern const u8 gOtherText_ElevatedTo[]; +extern const u8 gOtherText_WasRaised[]; +extern const u8 gOtherText_SnapConfusion[]; +extern const u8 gOtherText_GotOverLove[]; +extern const u8 OtherText_ChoosePoke[]; +extern const u8 OtherText_MovePokeTo[]; +extern const u8 OtherText_TeachWhat[]; +extern const u8 OtherText_UseWhat[]; +extern const u8 OtherText_GiveWhat[]; +extern const u8 OtherText_DoWhat[]; +extern const u8 OtherText_NothingToCut[]; +extern const u8 OtherText_CantSurf[]; +extern const u8 OtherText_AlreadySurfing[]; +extern const u8 OtherText_CantUseThatHere[]; +extern const u8 OtherText_RestoreWhatMove[]; +extern const u8 OtherText_BoostPP[]; +extern const u8 OtherText_DoWhatWithItem[]; +extern const u8 OtherText_NoPokeForBattle[]; +extern const u8 OtherText_ChoosePoke2[]; +extern const u8 OtherText_NotEnoughHP[]; +extern const u8 OtherText_ThreePokeNeeded[]; +extern const u8 OtherText_PokeCantBeSame[]; +extern const u8 OtherText_NoIdenticalHoldItems[]; +extern const u8 OtherText_TeachWhichPoke[]; +extern const u8 gOtherText_Attack[]; +extern const u8 gOtherText_Defense[]; +extern const u8 gOtherText_SpAtk[]; +extern const u8 gOtherText_SpDef[]; +extern const u8 gOtherText_Speed[]; +extern const u8 gOtherText_HP[]; +extern const u8 gOtherText_Terminator18[]; +extern const u8 gOtherText_OriginalTrainer[]; +extern const u8 gOtherText_Type2[]; +extern const u8 gOtherText_Power2[]; +extern const u8 gOtherText_Accuracy2[]; +extern const u8 gOtherText_Appeal2[]; +extern const u8 gOtherText_Jam2[]; +extern const u8 gOtherText_Status[]; +extern const u8 gOtherText_ExpPoints[]; +extern const u8 gOtherText_NextLv[]; +extern const u8 gOtherText_Ribbons00[]; + +extern const u8 OtherText_Event[]; +extern const u8 OtherText_Switch[]; +extern const u8 OtherText_PokeInfo[]; +extern const u8 OtherText_PokeSkills[]; +extern const u8 OtherText_BattleMoves[]; +extern const u8 OtherText_ContestMoves[]; +extern const u8 OtherText_Info[]; + +extern const u8 gOtherText_EggLongTime[]; +extern const u8 gOtherText_EggSomeTime[]; +extern const u8 gOtherText_EggSoon[]; +extern const u8 gOtherText_EggAbout[]; +extern const u8 gOtherText_CantForgetHMs[]; +extern const u8 gOtherText_PlayersBase[]; +extern const u8 gOtherText_OkayToDeleteFromRegistry[]; +extern const u8 gOtherText_RegisteredDataDeleted[]; + +extern const u8 gSecretBaseText_NoRegistry[]; +extern const u8 SecretBaseText_DelRegist[]; +extern const u8 SecretBaseText_Decorate[]; +extern const u8 SecretBaseText_PutAway[]; +extern const u8 SecretBaseText_Toss[]; +extern const u8 SecretBaseText_PutOutDecor[]; +extern const u8 SecretBaseText_StoreChosenDecor[]; +extern const u8 SecretBaseText_ThrowAwayDecor[]; +extern const u8 gSecretBaseText_NoDecors[]; +extern const u8 SecretBaseText_Desk[]; +extern const u8 SecretBaseText_Chair[]; +extern const u8 SecretBaseText_Plant[]; +extern const u8 SecretBaseText_Ornament[]; +extern const u8 SecretBaseText_Mat[]; +extern const u8 SecretBaseText_Poster[]; +extern const u8 SecretBaseText_Doll[]; +extern const u8 SecretBaseText_Cushion[]; +extern const u8 gSecretBaseText_GoldRank[]; +extern const u8 gSecretBaseText_SilverRank[]; +extern const u8 gSecretBaseText_PlaceItHere[]; +extern const u8 gSecretBaseText_CantBePlacedHere[]; +extern const u8 gSecretBaseText_CancelDecorating[]; +extern const u8 gSecretBaseText_InUseAlready[]; +extern const u8 gSecretBaseText_NoMoreDecor[]; +extern const u8 gSecretBaseText_NoMoreDecor2[]; +extern const u8 gSecretBaseText_DecorCantPlace[]; +extern const u8 gSecretBaseText_DecorInUse[]; +extern const u8 gSecretBaseText_WillBeDiscarded[]; +extern const u8 gSecretBaseText_DecorThrownAway[]; +extern const u8 gSecretBaseText_StopPuttingAwayDecor[]; +extern const u8 gSecretBaseText_NoDecor[]; +extern const u8 gSecretBaseText_ReturnDecor[]; +extern const u8 gSecretBaseText_DecorReturned[]; +extern const u8 gSecretBaseText_NoDecorInUse[]; +extern const u8 SecretBaseText_Tristan[]; +extern const u8 SecretBaseText_Philip[]; +extern const u8 SecretBaseText_Dennis[]; +extern const u8 SecretBaseText_Roberto[]; +extern const u8 SecretBaseText_TurnOff[]; +extern const u8 SecretBaseText_Decoration[]; +extern const u8 SecretBaseText_ItemStorage[]; + +extern const u8 gPCText_Mailbox[]; +extern const u8 PCText_DepositItem[]; +extern const u8 PCText_WithdrawItem[]; +extern const u8 PCText_TossItem[]; +extern const u8 PCText_StoreItems[]; +extern const u8 PCText_TakeOutItems[]; +extern const u8 PCText_ThrowAwayItems[]; + +extern const u8 gOtherText_NoItems[]; +extern const u8 gOtherText_NoMoreRoom[]; +extern const u8 gOtherText_HowManyToWithdraw[]; +extern const u8 gOtherText_WithdrewThing[]; +extern const u8 OtherText_Read[]; +extern const u8 gOtherText_MoveToBag[]; +extern const u8 OtherText_Give[]; +extern const u8 gOtherText_NoMailHere[]; +extern const u8 gOtherText_WhatWillYouDoMail[]; +extern const u8 gOtherText_MessageWillBeLost[]; +extern const u8 gOtherText_BagIsFull[]; +extern const u8 gOtherText_MailWasReturned[]; +extern const u8 gOtherText_Dad[]; +extern const u8 gOtherText_Mom[]; +extern const u8 gOtherText_Wallace[]; +extern const u8 gOtherText_Steven[]; +extern const u8 gOtherText_Brawly[]; +extern const u8 gOtherText_Winona[]; +extern const u8 gOtherText_Phoebe[]; +extern const u8 gOtherText_Glacia[]; +extern const u8 gContestText_ContestWinner[]; +extern const u8 gOtherText_Unknown1[]; +extern const u8 OtherText_Cool[]; +extern const u8 OtherText_Beauty2[]; +extern const u8 OtherText_Cute[]; +extern const u8 OtherText_Smart[]; +extern const u8 OtherText_Tough[]; +extern const u8 OtherText_NonstopSuperCool[]; +extern const u8 OtherText_Terminator6[]; +extern const u8 OtherText_GoodLookingPoke[]; +extern const u8 OtherText_Terminator7[]; +extern const u8 OtherText_MarvelousGreat[]; +extern const u8 OtherText_Terminator8[]; +extern const u8 OtherText_CenturyLastVenus[]; +extern const u8 OtherText_Terminator9[]; +extern const u8 OtherText_Terminator10[]; +extern const u8 OtherText_DazzlingSmile[]; +extern const u8 OtherText_PokeCenterIdol[]; +extern const u8 OtherText_Terminator11[]; +extern const u8 OtherText_LovelyAndSweet[]; +extern const u8 OtherText_Terminator12[]; +extern const u8 OtherText_ThePretty[]; +extern const u8 OtherText_WinningPortrait[]; +extern const u8 OtherText_GiveUsWink[]; +extern const u8 OtherText_Terminator13[]; +extern const u8 OtherText_SmartnessMaestro[]; +extern const u8 OtherText_Terminator14[]; +extern const u8 OtherText_ChosenPokeAmong[]; +extern const u8 OtherText_Terminator15[]; +extern const u8 OtherText_TheExcellent[]; +extern const u8 OtherText_ItsMomentOfElegance[]; +extern const u8 OtherText_PowerfullyMuscular[]; +extern const u8 OtherText_Terminator16[]; +extern const u8 OtherText_StrongErEst[]; +extern const u8 OtherText_Terminator17[]; +extern const u8 OtherText_MightyTough[]; +extern const u8 OtherText_Exclamation[]; +extern const u8 OtherText_Petalburg[]; +extern const u8 OtherText_Slateport[]; +extern const u8 OtherText_Littleroot[]; +extern const u8 OtherText_Lilycove[]; +extern const u8 OtherText_Dewford[]; +extern const u8 OtherText_Enter[]; +extern const u8 OtherText_Info3[]; +extern const u8 OtherText_WhatsAContest[]; +extern const u8 OtherText_TypesOfContest[]; +extern const u8 OtherText_Ranks[]; +extern const u8 OtherText_Judging[]; +extern const u8 OtherText_CoolContest[]; +extern const u8 OtherText_BeautyContest[]; +extern const u8 OtherText_CuteContest[]; +extern const u8 OtherText_SmartContest[]; +extern const u8 OtherText_ToughContest[]; +extern const u8 OtherText_Decoration[]; +extern const u8 OtherText_PackUp[]; +extern const u8 OtherText_Count[]; +extern const u8 OtherText_Registry[]; +extern const u8 OtherText_Information[]; +extern const u8 OtherText_Mach[]; +extern const u8 OtherText_Acro[]; +extern const u8 OtherText_Poison[]; +extern const u8 OtherText_Paralysis[]; +extern const u8 OtherText_Sleep[]; +extern const u8 OtherText_Burn[]; +extern const u8 OtherText_Frozen[]; +extern const u8 OtherText_Quit[]; +extern const u8 OtherText_SawIt[]; +extern const u8 OtherText_NotYet[]; +extern const u8 OtherText_Yes[]; +extern const u8 OtherText_No[]; +extern const u8 OtherText_Info2[]; +extern const u8 OtherText_SingleBattle[]; +extern const u8 OtherText_DoubleBattle[]; +extern const u8 OtherText_MultiBattle[]; +extern const u8 OtherText_MrBriney[]; +extern const u8 OtherText_MakeAChallenge[]; +extern const u8 OtherText_ObtainInformation[]; +extern const u8 OtherText_Lv50_2[]; +extern const u8 OtherText_Lv100_2[]; +extern const u8 OtherText_Zigzagoon[]; +extern const u8 OtherText_Nincada[]; +extern const u8 OtherText_Poochyena[]; +extern const u8 OtherText_Nincada2[]; +extern const u8 OtherText_Lotad[]; +extern const u8 OtherText_Roselia[]; +extern const u8 OtherText_Shroomish[]; +extern const u8 OtherText_Nincada3[]; +extern const u8 OtherText_Surskit[]; +extern const u8 OtherText_Treecko[]; +extern const u8 OtherText_Torchic[]; +extern const u8 OtherText_Mudkip[]; +extern const u8 OtherText_Seedot[]; +extern const u8 OtherText_Shroomish2[]; +extern const u8 OtherText_Spinda[]; +extern const u8 OtherText_Shroomish3[]; +extern const u8 OtherText_Zigzagoon2[]; +extern const u8 OtherText_Wurmple[]; +extern const u8 OtherText_PokeBall[]; +extern const u8 OtherText_SuperPotion[]; +extern const u8 OtherText_SamePrice[]; +extern const u8 OtherText_Yen135[]; +extern const u8 OtherText_Yen155[]; +extern const u8 OtherText_Yen175[]; +extern const u8 OtherText_CostMore[]; +extern const u8 OtherText_CostLess[]; +extern const u8 OtherText_SamePrice2[]; +extern const u8 OtherText_MaleSymbol[]; +extern const u8 OtherText_FemaleSymbol[]; +extern const u8 OtherText_Neither[]; +extern const u8 OtherText_Males[]; +extern const u8 OtherText_Females[]; +extern const u8 OtherText_SameNumber[]; +extern const u8 OtherText_Male[]; +extern const u8 OtherText_Female[]; +extern const u8 OtherText_ItDepends[]; +extern const u8 OtherText_Six2[]; +extern const u8 OtherText_Eight2[]; +extern const u8 OtherText_Ten[]; +extern const u8 OtherText_One[]; +extern const u8 OtherText_Two[]; +extern const u8 OtherText_Three[]; +extern const u8 OtherText_Six[]; +extern const u8 OtherText_Seven[]; +extern const u8 OtherText_Eight[]; +extern const u8 OtherText_FreshWater[]; +extern const u8 OtherText_SodaPop[]; +extern const u8 OtherText_Lemonade[]; +extern const u8 OtherText_HowToRide[]; +extern const u8 OtherText_HowToTurn[]; +extern const u8 OtherText_SandySlopes[]; +extern const u8 OtherText_Wheelies[]; +extern const u8 OtherText_BunnyHops[]; +extern const u8 OtherText_Jumping[]; +extern const u8 OtherText_Satisfied[]; +extern const u8 OtherText_Dissatisfied[]; +extern const u8 OtherText_Deepseatooth[]; +extern const u8 OtherText_Deepseascale[]; +extern const u8 OtherText_BlueFlute2[]; +extern const u8 OtherText_YellowFlute2[]; +extern const u8 OtherText_RedFlute2[]; +extern const u8 OtherText_WhiteFlute2[]; +extern const u8 OtherText_BlackFlute2[]; +extern const u8 OtherText_GlassChair[]; +extern const u8 OtherText_GlassDesk[]; +extern const u8 OtherText_TreeckoDoll[]; +extern const u8 OtherText_TorchicDoll[]; +extern const u8 OtherText_MudkipDoll[]; +extern const u8 OtherText_50Coins[]; +extern const u8 OtherText_500Coins[]; +extern const u8 OtherText_Excellent[]; +extern const u8 OtherText_NotSoHot[]; +extern const u8 OtherText_RedShard[]; +extern const u8 OtherText_YellowShard[]; +extern const u8 OtherText_BlueShard[]; +extern const u8 OtherText_GreenShard[]; +extern const u8 OtherText_BattleTower[]; +extern const u8 OtherText_Right[]; +extern const u8 OtherText_Left[]; +extern const u8 OtherText_TM32[]; +extern const u8 OtherText_TM29[]; +extern const u8 OtherText_TM35[]; +extern const u8 OtherText_TM24[]; +extern const u8 OtherText_TM13[]; +extern const u8 OtherText_1F_2[]; +extern const u8 OtherText_2F_2[]; +extern const u8 OtherText_3F_2[]; +extern const u8 OtherText_4F_2[]; +extern const u8 OtherText_5F_2[]; +extern const u8 OtherText_Cool2[]; +extern const u8 OtherText_Beauty3[]; +extern const u8 OtherText_Cute2[]; +extern const u8 OtherText_Smart2[]; +extern const u8 OtherText_Tough2[]; +extern const u8 OtherText_Normal[]; +extern const u8 OtherText_Super[]; +extern const u8 OtherText_Hyper[]; +extern const u8 OtherText_Master[]; +extern const u8 OtherText_Cool3[]; +extern const u8 OtherText_Beauty4[]; +extern const u8 OtherText_Cute3[]; +extern const u8 OtherText_Smart3[]; +extern const u8 OtherText_Tough3[]; +extern const u8 OtherText_Items[]; +extern const u8 OtherText_KeyItems[]; +extern const u8 OtherText_Balls[]; +extern const u8 OtherText_TMsHMs[]; +extern const u8 OtherText_Berries[]; + +extern const u8 gPCText_SomeonesPC[]; +extern const u8 gPCText_LanettesPC[]; +extern const u8 gPCText_PlayersPC[]; +extern const u8 gPCText_HallOfFame[]; +extern const u8 gPCText_LogOff[]; + +extern const u8 gOtherText_99Times[]; +extern const u8 gOtherText_1Minute[]; +extern const u8 gOtherText_Seconds[]; +extern const u8 gOtherText_Times[]; +extern const u8 gOtherText_BigGuy[]; +extern const u8 gOtherText_BigGirl[]; +extern const u8 gOtherText_Son[]; +extern const u8 gOtherText_Daughter[]; +extern const u8 OtherText_BlueFlute[]; +extern const u8 OtherText_YellowFlute[]; +extern const u8 OtherText_RedFlute[]; +extern const u8 OtherText_WhiteFlute[]; +extern const u8 OtherText_BlackFlute[]; +extern const u8 OtherText_PrettyChair[]; +extern const u8 OtherText_PrettyDesk[]; +extern const u8 OtherText_1F[]; +extern const u8 OtherText_2F[]; +extern const u8 OtherText_3F[]; +extern const u8 OtherText_4F[]; +extern const u8 OtherText_5F[]; +extern const u8 OtherText_6F[]; +extern const u8 OtherText_7F[]; +extern const u8 OtherText_8F[]; +extern const u8 OtherText_9F[]; +extern const u8 OtherText_10F[]; +extern const u8 OtherText_11F[]; +extern const u8 OtherText_B1F[]; +extern const u8 OtherText_B2F[]; +extern const u8 OtherText_B3F[]; +extern const u8 OtherText_B4F[]; +extern const u8 OtherText_Rooftop[]; + +extern const u8 gOtherText_NowOn[]; + +extern const u8 gPCText_Cancel[]; + +extern const u8 PCText_ExitBox[]; +extern const u8 PCText_WhatYouDo[]; +extern const u8 PCText_PickATheme[]; +extern const u8 PCText_PickAWallpaper[]; +extern const u8 PCText_IsSelected[]; +extern const u8 PCText_JumpToWhichBox[]; +extern const u8 PCText_DepositInWhichBox[]; +extern const u8 PCText_WasDeposited[]; +extern const u8 PCText_BoxIsFull[]; +extern const u8 PCText_ReleasePoke[]; +extern const u8 PCText_WasReleased[]; +extern const u8 PCText_ByeBye[]; +extern const u8 PCText_MarkPoke[]; +extern const u8 PCText_LastPoke[]; +extern const u8 PCText_PartyFull[]; +extern const u8 PCText_HoldingPoke[]; +extern const u8 PCText_WhichOneWillTake[]; +extern const u8 PCText_CantReleaseEgg[]; +extern const u8 PCText_ContinueBox[]; +extern const u8 PCText_CameBack[]; +extern const u8 PCText_Worried[]; +extern const u8 PCText_Surprise[]; +extern const u8 PCText_PleaseRemoveMail[]; +extern const u8 PCText_Cancel2[]; +extern const u8 PCText_Deposit[]; +extern const u8 PCText_Withdraw[]; +extern const u8 PCText_Switch[]; +extern const u8 PCText_Move[]; +extern const u8 PCText_Place[]; +extern const u8 PCText_Summary[]; +extern const u8 PCText_Release[]; +extern const u8 PCText_Mark[]; +extern const u8 PCText_Name[]; +extern const u8 PCText_Jump[]; +extern const u8 PCText_Wallpaper[]; +extern const u8 PCText_Scenery1[]; +extern const u8 PCText_Scenery2[]; +extern const u8 PCText_Scenery3[]; +extern const u8 PCText_Etc[]; +extern const u8 PCText_Forest[]; +extern const u8 PCText_City[]; +extern const u8 PCText_Desert[]; +extern const u8 PCText_Savanna[]; +extern const u8 PCText_Crag[]; +extern const u8 PCText_Volcano[]; +extern const u8 PCText_Snow[]; +extern const u8 PCText_Cave[]; +extern const u8 PCText_Beach[]; +extern const u8 PCText_Seafloor[]; +extern const u8 PCText_River[]; +extern const u8 PCText_Sky[]; +extern const u8 PCText_Polka[]; +extern const u8 PCText_PokeCenter[]; +extern const u8 PCText_Machine[]; +extern const u8 PCText_Plain[]; +extern const u8 PCText_WhatDoYouWant[]; +extern const u8 PCText_WithdrawPoke[]; +extern const u8 PCText_DepositPoke[]; +extern const u8 PCText_MovePoke[]; +extern const u8 PCText_SeeYa[]; +extern const u8 PCText_MovePokeToParty[]; +extern const u8 PCText_StorePokeInBox[]; +extern const u8 PCText_OrganizeBoxesParty[]; +extern const u8 PCText_ReturnToPrevMenu[]; + +extern const u8 gPCText_OnlyOne[]; +extern const u8 gPCText_PartyFull2[]; +extern const u8 gPCText_BOX[]; + +// pokenav +extern const u8 PCText_CheckMap[]; +extern const u8 PCText_CheckPoke[]; +extern const u8 PCText_CheckTrainer[]; +extern const u8 PCText_CheckRibbons[]; +extern const u8 PCText_PutAwayNav[]; +extern const u8 PCText_NoRibbonWin[]; +extern const u8 PCText_NoTrainers[]; +extern const u8 PCText_CheckParty[]; +extern const u8 PCText_CheckPokeAll[]; +extern const u8 PCText_ReturnToNav[]; +extern const u8 PCText_FindCool[]; +extern const u8 PCText_FindBeauty[]; +extern const u8 PCText_FindCute[]; +extern const u8 PCText_FindSmart[]; +extern const u8 PCText_FindTough[]; +extern const u8 PCText_ReturnToCondition[]; + +extern const u8 gOtherText_NumberRegistered[]; +extern const u8 gOtherText_NumberBattles[]; +extern const u8 gOtherText_Strategy[]; +extern const u8 gOtherText_TrainersPokemon[]; +extern const u8 gOtherText_SelfIntroduction[]; +extern const u8 gOtherText_Nature2[]; +extern const u8 gOtherText_InParty[]; +extern const u8 gOtherText_Number[]; +extern const u8 gOtherText_Ribbons[]; +extern const u8 OtherText_MakeProfilePage1[]; +extern const u8 OtherText_MakeProfilePage2[]; +extern const u8 OtherText_MakeMessagePage1[]; +extern const u8 OtherText_MakeMessagePage2[]; +extern const u8 OtherText_DescribeFeelingsPage1[]; +extern const u8 OtherText_DescribeFeelingsPage2[]; +extern const u8 OtherText_WithFourPhrases[]; +extern const u8 OtherText_CombineNinePhrasesPage1[]; +extern const u8 OtherText_CombineNinePhrasesPage2[]; +extern const u8 OtherText_ImproveBardSongPage1[]; +extern const u8 OtherText_ImproveBardSongPage2[]; +extern const u8 OtherText_YourProfile[]; +extern const u8 OtherText_YourFeelingBattle[]; +extern const u8 OtherText_SetWinMessage[]; +extern const u8 OtherText_SetLossMessage[]; +extern const u8 OtherText_TheAnswer[]; +extern const u8 OtherText_MailMessage[]; +extern const u8 OtherText_MailSalutation[]; +extern const u8 OtherText_NewSong[]; +extern const u8 OtherText_CombineTwoPhrasesPage1[]; +extern const u8 OtherText_CombineTwoPhrasesPage2[]; +extern const u8 OtherText_ConfirmTrendyPage1[]; +extern const u8 OtherText_ConfirmTrendyPage2[]; +extern const u8 OtherText_HipsterPage1[]; +extern const u8 OtherText_HipsterPage2[]; + +extern const u8 gOtherText_TextDeletedConfirmPage1[]; +extern const u8 gOtherText_TextDeletedConfirmPage2[]; +extern const u8 gOtherText_QuitEditing[]; +extern const u8 gOtherText_EditedTextNoSavePage1[]; +extern const u8 gOtherText_EditedTextNoSavePage2[]; +extern const u8 gOtherText_EnterAPhraseOrWord[]; +extern const u8 gOtherText_TextNoDelete[]; +extern const u8 gOtherText_OnlyOnePhrase[]; +extern const u8 gOtherText_OriginalSongRestored[]; +extern const u8 gOtherText_TrendyAlready[]; +extern const u8 gOtherText_CombineTwoPhrases[]; +extern const u8 gOtherText_QuitGivingInfo[]; +extern const u8 gOtherText_StopGivingMail[]; +extern const u8 gOtherText_Profile[]; +extern const u8 gOtherText_AtBattleStart[]; +extern const u8 gOtherText_UponWinningBattle[]; +extern const u8 gOtherText_UponLosingBattle[]; + +// mauville_old_man? +extern const u8 gOtherText_TheBardsSong[]; +extern const u8 gOtherText_WhatsHipHappening[]; +extern const u8 gOtherText_Interview[]; +extern const u8 gOtherText_GoodSaying[]; +extern const u8 OtherText_SoPretty[]; +extern const u8 OtherText_SoDarling[]; +extern const u8 OtherText_SoRelaxed[]; +extern const u8 OtherText_SoSunny[]; +extern const u8 OtherText_SoDesirable[]; +extern const u8 OtherText_SoExciting[]; +extern const u8 OtherText_SoAmusing[]; +extern const u8 OtherText_SoMagical[]; + +extern const u8 gOtherText_Is[]; +extern const u8 gOtherText_DontYouAgree[]; + +extern const u8 OtherText_WantVacationNicePlace[]; +extern const u8 OtherText_BoughtCrayonsIsNice[]; +extern const u8 OtherText_IfWeCouldFloat[]; +extern const u8 OtherText_SandWashesAwayMakeSad[]; +extern const u8 OtherText_WhatsBottomSeaLike[]; +extern const u8 OtherText_SeeSettingSun[]; +extern const u8 OtherText_LyingInGreenGrass[]; +extern const u8 OtherText_SecretBasesWonderful[]; + +extern const u8 OtherText_PokeLeague[]; +extern const u8 OtherText_PokeCenter[]; + +extern const u8 gOtherText_GetsAPokeBlock[]; + +extern const u8 OtherText_Coolness[]; +extern const u8 OtherText_Beauty[]; +extern const u8 OtherText_Cuteness[]; +extern const u8 OtherText_Smartness[]; +extern const u8 OtherText_Toughness[]; + +extern const u8 gOtherText_WasEnhanced[]; +extern const u8 gOtherText_NothingChanged[]; +extern const u8 gOtherText_WontEat[]; + +extern const u8 gSystemText_SaveFailedBackupCheck[]; +extern const u8 gSystemText_BackupDamagedGameContinue[]; +extern const u8 gSystemText_GameplayEnded[]; +extern const u8 gSystemText_CheckCompleteSaveAttempt[]; +extern const u8 gSystemText_SaveCompletedGameEnd[]; +extern const u8 gSystemText_SaveCompletedPressA[]; + +extern const u8 gOtherText_Ferry[]; +extern const u8 gOtherText_SecretBase[]; +extern const u8 gOtherText_Hideout[]; + +extern const u8 gSystemText_ResetRTCPrompt[]; +extern const u8 gSystemText_PresentTime[]; +extern const u8 gSystemText_PreviousTime[]; +extern const u8 gSystemText_PleaseResetTime[]; +extern const u8 gSystemText_ClockResetDataSave[]; +extern const u8 gSystemText_SaveCompleted[]; +extern const u8 gSystemText_SaveFailed[]; +extern const u8 gSystemText_NoSaveFileNoTime[]; +extern const u8 gSystemText_ClockAdjustmentUsable[]; +extern const u8 gSystemText_Saving[]; + +#endif diff --git a/include/trainer_see.h b/include/trainer_see.h index e4d1fe270..dd04912e7 100644 --- a/include/trainer_see.h +++ b/include/trainer_see.h @@ -30,5 +30,7 @@ void sub_80846E4(u8 taskId); void sub_8084794(u32 var); void sub_80847C8(void); void sub_80847D8(u8); +void sub_8084894(struct Sprite *sprite, u16 a2, u8 a3); +void objc_exclamation_mark_probably(struct Sprite *sprite); #endif // GUARD_TRAINER_SEE_H diff --git a/include/vars.h b/include/vars.h index e041e33bb..3fc71dc15 100644 --- a/include/vars.h +++ b/include/vars.h @@ -23,4 +23,6 @@ #define VAR_BARBOACH_SIZE_RECORD 0x404F +#define VAR_PORTHOLE 0x40B4 + #endif // GUARD_VARS_H diff --git a/ld_script.txt b/ld_script.txt index 808effb55..2be635d7a 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -139,7 +139,7 @@ SECTIONS { src/pokemon_summary_screen.o(.text); asm/pokemon_summary_screen.o(.text_80A0958); src/script_movement.o(.text); - asm/fldeff_cut.o(.text); + src/fldeff_cut.o(.text); asm/mail_data.o(.text); src/map_name_popup.o(.text); asm/item_menu.o(.text); @@ -167,7 +167,7 @@ SECTIONS { asm/tv.o(.text_80C1C5C); src/tv.o(.text_d); asm/contest_link_80C2020.o(.text); - asm/script_pokemon_util_80C4BF0.o(.text); + src/script_pokemon_util_80C4BF0.o(.text); src/field_poison.o(.text); src/pokemon_size_record.o(.text); asm/fldeff_80C5CD4.o(.text); @@ -313,7 +313,7 @@ SECTIONS { data/tilesets.o(.rodata); data/maps.o(.rodata); src/fieldmap.o(.rodata); - data/metatile_behavior.o(.rodata); + src/metatile_behavior.o(.rodata); data/field_door.o(.rodata); src/field_player_avatar.o(.rodata); data/field_player_avatar.o(.rodata); @@ -367,7 +367,7 @@ SECTIONS { data/contest.o(.rodata); data/shop.o(.rodata); src/berry.o(.rodata); - data/script_menu.o(.rodata); + src/script_menu.o(.rodata); src/naming_screen.o(.rodata); data/naming_screen.o(.rodata); data/money.o(.rodata); @@ -379,6 +379,7 @@ SECTIONS { data/contest_link_80C2020.o(.rodata); src/pokemon_size_record.o(.rodata); data/fldeff_80C5CD4.o(.rodata); + src/field_special_scene.o(.rodata); data/field_special_scene.o(.rodata); data/rotating_gate.o(.rodata); data/item_use.o(.rodata); @@ -412,7 +413,7 @@ SECTIONS { data/battle_message.o(.rodata); data/choose_party.o(.rodata); data/cable_car.o(.rodata); - data/save.o(.rodata); + src/save.o(.rodata); data/field_effect_helpers.o(.rodata); data/contest_ai.o(.rodata); data/rom_81258BC.o(.rodata); @@ -423,11 +424,10 @@ SECTIONS { src/credits.o(.rodata); data/credits.o(.rodata); src/lottery_corner.o(.rodata); - data/diploma.o(.rodata); - data/strings.o(.rodata); + src/diploma.o(.rodata); + src/strings.o(.rodata); data/berry_tag_screen.o(.rodata); src/save_failed_screen.o(.rodata); - data/save_failed_screen.o(.rodata); data/pokeblock_feed.o(.rodata); data/intro_credits_graphics.o(.rodata); data/evolution_graphics.o(.rodata); diff --git a/shared_syms.txt b/shared_syms.txt index 893a46c1a..ca008972f 100644 --- a/shared_syms.txt +++ b/shared_syms.txt @@ -33,3 +33,4 @@ unk_201C000 = 0x201C000; gHallOfFame = 0x201E000; unk_201f800 = 0x201F800; +gCutGrassSpriteArray = 0x201FFF0; diff --git a/src/agb_flash.c b/src/agb_flash.c index 34fb4e84a..340d469a7 100644 --- a/src/agb_flash.c +++ b/src/agb_flash.c @@ -217,7 +217,7 @@ u32 VerifyFlashSector(u16 sectorNum, u8 *src) tgt = FLASH_BASE + (sectorNum << gFlash->sector.shift); size = gFlash->sector.size; - return verifyFlashSector_Core(src, tgt, size); + return verifyFlashSector_Core(src, tgt, size); // return 0 if verified. } u32 VerifyFlashSectorNBytes(u16 sectorNum, u8 *src, u32 n) @@ -256,12 +256,12 @@ u32 VerifyFlashSectorNBytes(u16 sectorNum, u8 *src, u32 n) return verifyFlashSector_Core(src, tgt, n); } -u32 ProgramFlashSectorAndVerify(u16 sectorNum, u8 *src) +u32 ProgramFlashSectorAndVerify(u16 sectorNum, u8 *src) // 3rd is unused { u8 i; u32 result; - for (i = 0; i < 3; i++) + for (i = 0; i < 3; i++) // 3 attempts { result = ProgramFlashSector(sectorNum, src); if (result != 0) @@ -272,7 +272,7 @@ u32 ProgramFlashSectorAndVerify(u16 sectorNum, u8 *src) break; } - return result; + return result; // return 0 if verified and programmed. } u32 ProgramFlashSectorAndVerifyNBytes(u16 sectorNum, u8 *src, u32 n) diff --git a/src/battle_ai.c b/src/battle_ai.c index ceab60ca0..07f319e40 100644 --- a/src/battle_ai.c +++ b/src/battle_ai.c @@ -8,29 +8,10 @@ #include "rng.h" #include "species.h" #include "moves.h" - -#define AIScriptRead32(ptr) ((ptr)[0] | (ptr)[1] << 8 | (ptr)[2] << 16 | (ptr)[3] << 24) -#define AIScriptRead16(ptr) ((ptr)[0] | (ptr)[1] << 8) -#define AIScriptRead8(ptr) ((ptr)[0]) -#define AIScriptReadPtr(ptr) (u8*) AIScriptRead32(ptr) +#include "battle_ai.h" extern void sub_801CAF8(u8, u8); -enum -{ - TARGET, - USER -}; - -// AI states -enum -{ - AIState_SettingUp, - AIState_Processing, - AIState_FinishedProcessing, - AIState_DoNotProcess -}; - extern void move_effectiveness_something(u16, u8, u8); extern u16 gBattleTypeFlags; @@ -283,12 +264,6 @@ const u16 sDiscouragedPowerfulMoveEffects[] = 0xFFFF }; -void BattleAI_SetupAIData(void); -void BattleAI_DoAIProcessing(void); -void sub_810745C(void); -void AIStackPushVar(u8 *); -u8 AIStackPop(void); - // if the AI is a Link battle, safari, battle tower, or ereader, it will ignore considering item uses. void BattleAI_HandleItemUseBeforeAISetup(void) { diff --git a/src/battle_anim.c b/src/battle_anim.c index 4cc337a0c..c381f4f87 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -6,55 +6,7 @@ #include "sound.h" #include "sprite.h" #include "task.h" - -#define SCRIPT_READ_8(ptr) ((ptr)[0]) -#define SCRIPT_READ_16(ptr) ((ptr)[0] | ((ptr)[1] << 8)) -#define SCRIPT_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24)) - -#define REG_BGnCNT_BITFIELD(n) (*(struct BGCntrlBitfield *)REG_ADDR_BG##n##CNT) -#define REG_BG1CNT_BITFIELD REG_BGnCNT_BITFIELD(1) -#define REG_BG2CNT_BITFIELD REG_BGnCNT_BITFIELD(2) - -#define EWRAM_14800 ((u16 *)(unk_2000000 + 0x14800)) -#define EWRAM_17800 ((struct UnknownStruct1 *)(unk_2000000 + 0x17800)) -#define EWRAM_17810 ((struct UnknownStruct3 *)(unk_2000000 + 0x17810)) -#define EWRAM_18000 ((u16 *)(unk_2000000 + 0x18000)) -#define EWRAM_19348 (*(u16 *)(unk_2000000 + 0x19348)) - -struct BGCntrlBitfield -{ - volatile u16 priority:2; - volatile u16 charBaseBlock:2; - volatile u16 field_0_2:4; - volatile u16 field_1_0:5; - volatile u16 areaOverflowMode:1; - volatile u16 screenSize:2; -}; - -struct BattleAnimBackground -{ - void *image; - void *palette; - void *tilemap; -}; - -struct UnknownStruct1 -{ - u8 unk0; -}; - -struct UnknownStruct2 -{ - void *unk0; - u16 *unk4; - u8 unk8; -}; - -struct UnknownStruct3 -{ - u8 unk0; - u8 filler1[0xB]; -}; +#include "battle_anim.h" extern u8 unk_2000000[]; extern u16 gUnknown_02024A6A[4]; @@ -117,7 +69,6 @@ extern void sub_800D7B8(void); extern u8 obj_id_for_side_relative_to_move(); extern u8 battle_get_per_side_status_permutated(); -void move_something(const u8 *const moveAnims[], u16 b, u8 c); static void sub_80759D0(void); static void ScriptCmd_loadsprite(void); static void ScriptCmd_unloadsprite(void); @@ -130,8 +81,6 @@ static void ScriptCmd_hang2(void); static void ScriptCmd_end(void); static void ScriptCmd_playse(void); static void ScriptCmd_monbg(void); -bool8 b_side_obj__get_some_boolean(u8 a); -void sub_8076034(u8, u8); static void sub_8076380(void); static void task_pA_ma0A_obj_to_bg_pal(u8); static void ScriptCmd_clearmonbg(void); @@ -148,7 +97,6 @@ static void ScriptCmd_setvar(void); static void ScriptCmd_ifelse(void); static void ScriptCmd_jumpif(void); static void ScriptCmd_jump(void); -bool8 sub_8076BE0(void); static void ScriptCmd_fadetobg(void); static void ScriptCmd_fadetobg_25(void); static void task_p5_load_battle_screen_elements(u8); diff --git a/src/battle_anim_80A7E7C.c b/src/battle_anim_80A7E7C.c index 8cb6fdf9c..474d268a0 100644 --- a/src/battle_anim_80A7E7C.c +++ b/src/battle_anim_80A7E7C.c @@ -2,6 +2,7 @@ #include "sprite.h" #include "task.h" #include "trig.h" +#include "battle_anim.h" #define TASK gTasks[task] #define SPRITE gSprites[TASK.data[0]] @@ -16,7 +17,6 @@ extern u8 gUnknown_0202F7C9; extern u8 obj_id_for_side_relative_to_move(u8 side); extern void move_anim_task_del(u8 task); -extern bool8 b_side_obj__get_some_boolean(u8 side); extern u8 battle_get_side_with_given_state(u8 state); extern u8 battle_side_get_owner(u8 side); extern void oamt_set_x3A_32(struct Sprite *sprite, void(*callback)(struct Sprite*)); @@ -27,7 +27,6 @@ extern void sub_80784A8(struct Sprite *sprite); extern void sub_8078E70(u8 sprite, u8); extern void obj_id_set_rotscale(u8 sprite, int, int, u16); extern void sub_8078F40(u8 sprite); -extern bool8 sub_8076BE0(); extern void sub_8078F9C(u8 sprite); static void sub_80A7EF0(u8 task); diff --git a/src/battle_party_menu.c b/src/battle_party_menu.c index dab97db9b..2d47f4e7d 100644 --- a/src/battle_party_menu.c +++ b/src/battle_party_menu.c @@ -11,19 +11,6 @@ #include "text.h" #include "battle_party_menu.h" -struct PartyMenuItem -{ - const u8 *text; - TaskFunc func; -}; - -struct PartyPopupMenu -{ - u8 unk0; - u8 unk1; - const u8 *unk4; -}; - extern u8 IsLinkDoubleBattle(void); extern void TryCreatePartyMenuMonIcon(u8, u8, struct Pokemon *); extern void LoadHeldItemIconGraphics(void); diff --git a/src/battle_setup.c b/src/battle_setup.c index 858b6cca1..c9839bb87 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -23,61 +23,12 @@ #include "weather.h" #include "map_constants.h" #include "opponent_constants.h" - -#define NUM_TRAINER_EYE_TRAINERS 56 -#define TRAINER_REMATCH_STEPS 255 +#include "script_pokemon_80C4.h" +#include "field_map_obj_helpers.h" +#include "field_control_avatar.h" extern u16 gScriptResult; -// IV + LEVEL + SPECIES -struct TrainerPartyMember0 -{ - u16 iv; - u8 level; - u16 species; -}; - -// IV + LEVEL + SPECIES + MOVES -struct TrainerPartyMember1 -{ - u16 iv; - u8 level; - u16 species; - u16 moves[4]; -}; - -// IV + LEVEL + SPECIES + ITEMS -struct TrainerPartyMember2 -{ - u16 iv; - u8 level; - u16 species; - u16 heldItem; -}; - -// IV + LEVEL + SPECIES + ITEMS + MOVES -struct TrainerPartyMember3 -{ - u16 iv; - u8 level; - u16 species; - u16 heldItem; - u16 moves[4]; -}; - -struct TrainerBattleSpec -{ - void *ptr; - u8 ptrType; -}; - -struct TrainerEyeTrainer -{ - u16 trainerNums[5]; - u16 mapGroup; - u16 mapNum; -}; - extern void (*gUnknown_0300485C)(void); extern struct Pokemon gEnemyParty[]; @@ -1158,7 +1109,7 @@ u8 *sub_8082700(void) return gUnknown_081C6C02; } -void sub_8082718() +void sub_8082718(void) { ShowFieldMessage(sub_8082880()); } diff --git a/src/berry.c b/src/berry.c index 2f8f6a799..e81c7a5ff 100644 --- a/src/berry.c +++ b/src/berry.c @@ -6,6 +6,7 @@ #include "main.h" #include "rng.h" #include "text.h" +#include "field_control_avatar.h" #define BERRY_NAME_LENGTH 6 diff --git a/src/bike.c b/src/bike.c index a1a3fded9..7693c7539 100644 --- a/src/bike.c +++ b/src/bike.c @@ -8,20 +8,10 @@ #include "songs.h" #include "sound.h" #include "rom4.h" +#include "bike.h" extern u8 sub_80608A4(u8); -struct UnknownStruct1 -{ - u32 unk0; - u32 unk4; - u32 unk8; - u32 unkC; - const u8 *unk10; - const u8 *unk14; - u32 unk18; -}; - extern u8 gUnknown_02039250; extern u8 gUnknown_02039251; extern u8 gUnknown_0202E854; @@ -84,36 +74,6 @@ static void (*const gUnknown_083DB5A4[])(u8) = sub_80593F4, }; -// Player speeds -enum -{ - SPEED_STANDING, - SPEED_NORMAL, - SPEED_FAST, - SPEED_FASTER, - SPEED_FASTEST, -}; - -//Acro bike states -enum -{ - ACRO_STATE_NORMAL, - ACRO_STATE_TURNING, - ACRO_STATE_WHEELIE_STANDING, - ACRO_STATE_BUNNY_HOP, - ACRO_STATE_WHEELIE_MOVING, - ACRO_STATE_5, - ACRO_STATE_6, -}; - -//Acro bike transitions -enum -{ - ACRO_TRANS_FACE_DIRECTION, - ACRO_TRANS_NORMAL_TO_WHEELIE = 3, - ACRO_TRANS_WHEELIE_TO_NORMAL, -}; - static void (*const sAcroBikeTransitions[])(u8) = { AcroBikeTransition_FaceDirection, diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index 8bbd1ce13..94643691c 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -12,19 +12,15 @@ #include "species.h" #include "task.h" #include "text.h" +#include "braille_puzzles.h" +#include "rom6.h" extern u8 gPlayerPartyCount; -extern u8 gUnknown_03005CE0; +extern u8 gLastFieldPokeMenuOpened; extern u32 gUnknown_0202FF84[]; -extern u8 gUnknown_0815EF19[]; - -void UseFlyAncientTomb_Callback(void); -void UseFlyAncientTomb_Finish(void); -void Task_BrailleWait(u8 taskId); -bool32 BrailleWait_CheckButtonPress(void); -void SealedChamberShakingEffect(u8 taskId); +extern u8 gIslandCave_EventScript_OpenRegiiceChamber[]; // regiice event script bool8 ShouldDoBrailleDigEffect(void) { @@ -110,7 +106,7 @@ bool8 ShouldDoBrailleFlyEffect(void) void DoBrailleFlyEffect(void) { - gUnknown_0202FF84[0] = gUnknown_03005CE0; + gUnknown_0202FF84[0] = gLastFieldPokeMenuOpened; FieldEffectStart(0x3C); } @@ -196,7 +192,7 @@ void Task_BrailleWait(u8 taskId) break; case 4: sub_8064E2C(); - ScriptContext1_SetupScript(gUnknown_0815EF19); + ScriptContext1_SetupScript(gIslandCave_EventScript_OpenRegiiceChamber); DestroyTask(taskId); break; } diff --git a/src/clock.c b/src/clock.c index 85188cd19..fd9e6915a 100644 --- a/src/clock.c +++ b/src/clock.c @@ -6,6 +6,7 @@ #include "rom4.h" #include "rtc.h" #include "wallclock.h" +#include "clock.h" extern void sub_80FA220(u16); extern void sub_80BE8C4(u16); diff --git a/src/contest_painting.c b/src/contest_painting.c index 556456814..41f6afabf 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -8,91 +8,21 @@ #include "sprite.h" #include "string_util.h" #include "text.h" - -#define MOSAIC_BIT_BG_HSIZE (0) -#define MOSAIC_BIT_BG_VSIZE (4) -#define MOSAIC_BIT_OBJ_HSIZE (8) -#define MOSAIC_BIT_OBJ_VSIZE (12) - -enum -{ - CONTEST_COOL, - CONTEST_BEAUTY, - CONTEST_CUTE, - CONTEST_SMART, - CONTEST_TOUGH, -}; - -enum -{ - CONTESTRESULT_COOL = 9, - CONTESTRESULT_BEAUTY = 13, - CONTESTRESULT_CUTE = 2, - CONTESTRESULT_SMART = 36, - CONTESTRESULT_TOUGH = 6, -}; - -struct Unk2015E00 -{ - u16 unk2015e00[128][32]; - u16 unk2017e00[0]; -}; - -struct ContestEntry -{ - /*0x00*/ u8 var0; - /*0x04*/ u32 var4; - /*0x08*/ u16 var8; - /*0x0A*/ u8 contestType; - /*0x0B*/ u8 pokemon_name[POKEMON_NAME_LENGTH]; - /*0x15*/ u8 pad15; - /*0x16*/ u8 trainer_name[OT_NAME_LENGTH]; -}; - -struct Unk3000756 -{ - /*0x00*/ u8 var_0; -}; - -struct LabelPair -{ - const u8 *prefix; - const u8 *suffix; -}; - -struct Unk03005E20 -{ - u8 var_0; - u8 pad1[3]; - u16 (*var_4)[][32]; - u16 (*var_8)[]; - u8 pad0C[4]; - u32 var_10; - u16 var_14; - u16 var_16; - u8 var_18; - u8 var_19; - u8 var_1A; - u8 var_1B; - u8 var_1C; - u8 var_1D; - u8 var_1E; - u8 var_1F; -}; +#include "contest_painting.h" extern u8 unk_2000000[]; -extern struct ContestEntry unk_2015de0; -extern struct Unk2015E00 unk_2015e00; extern u8 gUnknown_03000750; extern u16 gUnknown_03000752; extern u16 gUnknown_03000754; -extern struct Unk3000756 gUnknown_03000756; extern u16 (*gUnknown_03005E10)[][32]; -extern struct Unk03005E20 gUnknown_03005E20; extern u8 gUnknown_03005E40[]; -extern struct ContestEntry *gUnknown_03005E8C; extern u16 (*gUnknown_03005E90)[]; +extern struct ContestEntry unk_2015de0; +extern struct Unk2015E00 unk_2015e00; +extern struct Unk3000756 gUnknown_03000756; +extern struct Unk03005E20 gUnknown_03005E20; +extern struct ContestEntry *gUnknown_03005E8C; extern const struct SpriteSheet gMonFrontPicTable[]; extern const struct MonCoords gMonFrontPicCoords[]; extern const struct SpriteSheet gMonBackPicTable[]; @@ -112,7 +42,7 @@ extern const u8 OtherText_Terminator8[]; extern const u8 OtherText_CenturyLastVenus[]; extern const u8 OtherText_Terminator9[]; extern const u8 OtherText_Terminator10[]; -extern const u8 OtherText_DazzlingSlime[]; +extern const u8 OtherText_DazzlingSmile[]; extern const u8 OtherText_PokeCenterIdol[]; extern const u8 OtherText_Terminator11[]; extern const u8 OtherText_LovelyAndSweet[]; @@ -174,7 +104,7 @@ const struct LabelPair gUnknown_083F60C0[] = {OtherText_GoodLookingPoke, OtherText_Terminator7}, {OtherText_MarvelousGreat, OtherText_Terminator8}, {OtherText_CenturyLastVenus, OtherText_Terminator9}, - {OtherText_Terminator10, OtherText_DazzlingSlime}, + {OtherText_Terminator10, OtherText_DazzlingSmile}, {OtherText_PokeCenterIdol, OtherText_Terminator11}, {OtherText_LovelyAndSweet, OtherText_Terminator12}, {OtherText_ThePretty, OtherText_WinningPortrait}, diff --git a/src/dewford_trend.c b/src/dewford_trend.c index 751d6c416..b2a8e81da 100644 --- a/src/dewford_trend.c +++ b/src/dewford_trend.c @@ -4,12 +4,10 @@ #include "link.h" #include "rng.h" #include "text.h" +#include "dewford_trend.h" extern u8 unk_2000000[]; -#define ARRAY_2007800 ((struct EasyChatPair *)(unk_2000000 + 0x7800)) -#define ARRAY_2007900 ((struct EasyChatPair *)(unk_2000000 + 0x7900)) - extern u16 gScriptResult; extern u16 gSpecialVar_0x8004; diff --git a/src/diploma.c b/src/diploma.c index 270d69ce1..649f4a33d 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -10,9 +10,6 @@ #include "task.h" #include "text.h" -extern u8 gDiplomaTiles[]; -extern u8 gDiplomaTilemap[]; -extern u8 gDiplomaPalettes[]; extern u8 gOtherText_NationalDex[]; extern u8 gOtherText_HoennDex[]; extern u8 gOtherText_DiplomaCertificationGameFreak[]; @@ -24,6 +21,15 @@ static void Task_DiplomaWaitForKeyPress(u8); static void Task_DiplomaFadeOut(u8); static void DisplayDiplomaText(void); +static const u16 gDiplomaPalettes[][16] = +{ + INCBIN_U16("graphics/misc/diploma_national.gbapal"), + INCBIN_U16("graphics/misc/diploma_hoenn.gbapal"), +}; + +static const u8 gDiplomaTilemap[] = INCBIN_U8("graphics/misc/diploma_map.bin.lz"); +static const u8 gDiplomaTiles[] = INCBIN_U8("graphics/misc/diploma.4bpp.lz"); + static void VBlankCB(void) { LoadOam(); diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 992e461eb..9bff65004 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -13,6 +13,8 @@ #include "trainer_see.h" #include "vars.h" #include "wild_encounter.h" +#include "bike.h" +#include "field_control_avatar.h" struct Coords32 { @@ -336,13 +338,13 @@ static u8 *TryGetInvisibleMapObjectScript(struct MapPosition *position, u8 unuse if (bgEvent == NULL) return NULL; - if (bgEvent->script == NULL) + if (bgEvent->bgUnion.script == NULL) return gUnknown_081C6C02; switch (bgEvent->kind) { case 0: default: - return bgEvent->script; + return bgEvent->bgUnion.script; case 1: if (c != 2) return NULL; @@ -362,21 +364,21 @@ static u8 *TryGetInvisibleMapObjectScript(struct MapPosition *position, u8 unuse case 5: case 6: case 7: - gSpecialVar_0x8004 = ((u32)bgEvent->script >> 16) + 0x258; - gSpecialVar_0x8005 = (u32)bgEvent->script; + gSpecialVar_0x8004 = ((u32)bgEvent->bgUnion.script >> 16) + 0x258; + gSpecialVar_0x8005 = (u32)bgEvent->bgUnion.script; if (FlagGet(gSpecialVar_0x8004) == TRUE) return NULL; return HiddenItemScript; case 8: if (c == 2) { - gSpecialVar_0x8004 = (u32)bgEvent->script; + gSpecialVar_0x8004 = (u32)bgEvent->bgUnion.script; if (sub_80BC050()) return gUnknown_081A2C51; } return NULL; } - return bgEvent->script; + return bgEvent->bgUnion.script; } static u8 *sub_8068500(struct MapPosition *position, u8 b, u8 c) diff --git a/src/field_door.c b/src/field_door.c index f527681ac..4b1390d11 100644 --- a/src/field_door.c +++ b/src/field_door.c @@ -3,20 +3,7 @@ #include "field_camera.h" #include "metatile_behavior.h" #include "task.h" - -struct DoorGraphics -{ - u16 metatileNum; - u8 unk2; - void *tiles; - void *palette; -}; - -struct DoorAnimFrame -{ - u8 time; - u16 offset; -}; +#include "field_door.h" extern struct DoorAnimFrame gDoorOpenAnimFrames[]; extern struct DoorAnimFrame gDoorCloseAnimFrames[]; diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index d52a68271..53bbf013b 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -16,19 +16,15 @@ #include "task.h" #include "wild_encounter.h" #include "map_object_constants.h" +#include "bike.h" +#include "field_map_obj_helpers.h" extern u8 gOtherText_OhABite[]; extern u8 gOtherText_PokeOnHook[]; extern u8 gOtherText_NotEvenANibble[]; extern u8 gOtherText_ItGotAway[]; -extern struct -{ - s32 x; - s32 y; - u32 unk8; - u32 unkC; -} gUnknown_0202FF84; +extern u32 gUnknown_0202FF84[]; //Functions static u32 sub_80587D8(void); @@ -731,9 +727,9 @@ void PlayerAvatarTransition_Surfing(struct MapObject *a) sub_805B980(a, GetPlayerAvatarGraphicsIdByStateId(3)); FieldObjectTurn(a, a->placeholder18); SetPlayerAvatarStateMask(8); - gUnknown_0202FF84.x = a->coords2.x; - gUnknown_0202FF84.y = a->coords2.y; - gUnknown_0202FF84.unk8 = gPlayerAvatar.mapObjectId; + gUnknown_0202FF84[0] = a->coords2.x; + gUnknown_0202FF84[1] = a->coords2.y; + gUnknown_0202FF84[2] = gPlayerAvatar.mapObjectId; unk = FieldEffectStart(8); a->mapobj_unk_1A = unk; sub_8127ED0(unk, 1); @@ -1291,10 +1287,10 @@ u8 sub_8059EA4(struct Task *task, struct MapObject *b, struct MapObject *c) FieldObjectClearAnimIfSpecialAnimFinished(c); FieldObjectSetSpecialAnim(b, GetStepInPlaceDelay16AnimId(task->data[2])); FieldObjectSetSpecialAnim(c, GetSimpleGoAnimId(task->data[2])); - gUnknown_0202FF84.x = c->coords2.x; - gUnknown_0202FF84.y = c->coords2.y; - gUnknown_0202FF84.unk8 = c->elevation; - gUnknown_0202FF84.unkC = gSprites[c->spriteId].oam.priority; + gUnknown_0202FF84[0] = c->coords2.x; + gUnknown_0202FF84[1] = c->coords2.y; + gUnknown_0202FF84[2] = c->elevation; + gUnknown_0202FF84[3] = gSprites[c->spriteId].oam.priority; FieldEffectStart(10); PlaySE(SE_W070); task->data[0]++; diff --git a/src/field_special_scene.c b/src/field_special_scene.c index 819a4ab5f..fe7daea0a 100644 --- a/src/field_special_scene.c +++ b/src/field_special_scene.c @@ -11,6 +11,17 @@ #include "sprite.h" #include "task.h" +#define SECONDS(value) ((signed) (60.0 * value + 0.5)) + +// porthole states +enum +{ + INIT_PORTHOLE, + IDLE_CHECK, + EXECUTE_MOVEMENT, + EXIT_PORTHOLE, +}; + extern s8 gTruckCamera_HorizontalTable[]; extern u8 gUnknown_083D295F[]; @@ -44,20 +55,18 @@ void Task_Truck1(u8 taskId) u8 mapNum, mapGroup; register s16 zero asm("r4"); - box1 = GetTruckBoxMovement(data[0] + 30) * 4; // box 1 happens 30 frames earlier than the other 2. + box1 = GetTruckBoxMovement(data[0] + 30) * 4; // top box. sub_805BD90(1, gSaveBlock1.location.mapNum, gSaveBlock1.location.mapGroup, 3, box1 + 3); - box2 = GetTruckBoxMovement(data[0]) * 2; + box2 = GetTruckBoxMovement(data[0]) * 2; // bottom left box. sub_805BD90(2, gSaveBlock1.location.mapNum, gSaveBlock1.location.mapGroup, 0, box2 - 3); - box3 = GetTruckBoxMovement(data[0]) * 4; + box3 = GetTruckBoxMovement(data[0]) * 4; // bottom right box. mapNum = gSaveBlock1.location.mapNum; mapGroup = gSaveBlock1.location.mapGroup; zero = 0; sub_805BD90(3, mapNum, mapGroup, -3, box3); - data[0]++; - - if (data[0] == 0x7530) // timer? - data[0] = zero; + if (++data[0] == SECONDS(500)) // this will never run + data[0] = zero; // reset the timer if it gets stuck. cameraYpan = GetTruckCameraBobbingY(data[0]); SetCameraPanning(0, cameraYpan); @@ -142,7 +151,7 @@ void Task_HandleTruckSequence(u8 taskId) */ case 0: data[1]++; - if (data[1] == 90) + if (data[1] == SECONDS(1.5)) { SetCameraPanningCallback(0); data[1] = 0; // reset the timer. @@ -153,7 +162,7 @@ void Task_HandleTruckSequence(u8 taskId) break; case 1: data[1]++; - if (data[1] == 150) + if (data[1] == SECONDS(2.5)) { pal_fill_black(); data[1] = 0; @@ -162,7 +171,7 @@ void Task_HandleTruckSequence(u8 taskId) break; case 2: data[1]++; - if (!gPaletteFade.active && data[1] > 300) + if (!gPaletteFade.active && data[1] > SECONDS(5)) { data[1] = 0; DestroyTask(data[2]); @@ -241,22 +250,22 @@ bool8 sub_80C7754(void) } } -void sub_80C77A0(u8 taskId) +void Task_HandlePorthole(u8 taskId) { s16 *data = gTasks[taskId].data; - u16 *var = GetVarPointer(0x40B4); + u16 *var = GetVarPointer(VAR_PORTHOLE); struct WarpData *location = &gSaveBlock1.location; switch (data[0]) { - case 0: + case INIT_PORTHOLE: // finish fading before making porthole finish. if (!gPaletteFade.active) { data[1] = 0; - data[0] = 2; + data[0] = EXECUTE_MOVEMENT; // execute movement before checking if should be exited. strange? } break; - case 1: + case IDLE_CHECK: // idle and move. if (gMain.newKeys & A_BUTTON) data[1] = 1; if (!sub_80A212C(0xFF, location->mapNum, location->mapGroup)) @@ -271,25 +280,25 @@ void sub_80C77A0(u8 taskId) return; } data[0] = 2; - case 2: + case EXECUTE_MOVEMENT: // execute movement. if (data[1]) { - data[0] = 3; + data[0] = EXIT_PORTHOLE; // exit porthole. return; } - - if (*var == 2) + // run this once. + if (*var == 2) // which direction? { exec_movement(0xFF, location->mapNum, location->mapGroup, gUnknown_083D295F); - data[0] = 1; + data[0] = IDLE_CHECK; // run case 1. } else { exec_movement(0xFF, location->mapNum, location->mapGroup, gUnknown_083D2961); - data[0] = 1; + data[0] = IDLE_CHECK; // run case 1. } break; - case 3: + case EXIT_PORTHOLE: // exit porthole. FlagReset(0x4001); FlagReset(0x4000); copy_saved_warp2_bank_and_enter_x_to_warp1(0); @@ -320,7 +329,7 @@ void sub_80C791C(void) sub_80C78A0(); gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = TRUE; pal_fill_black(); - CreateTask(sub_80C77A0, 80); + CreateTask(Task_HandlePorthole, 80); ScriptContext2_Enable(); } diff --git a/src/fieldmap.c b/src/fieldmap.c index 7a24897c4..b34a51bdc 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -1,5 +1,6 @@ #include "global.h" #include "palette.h" +#include "fieldmap.h" struct BackupMapData { diff --git a/src/fldeff_cut.c b/src/fldeff_cut.c new file mode 100644 index 000000000..f432027ab --- /dev/null +++ b/src/fldeff_cut.c @@ -0,0 +1,300 @@ +#include "global.h" +#include "asm.h" +#include "metatile_behavior.h" +#include "metatile_behaviors.h" +#include "field_player_avatar.h" +#include "field_effect.h" +#include "rom4.h" +#include "script.h" +#include "rom6.h" +#include "sound.h" +#include "field_camera.h" +#include "sprite.h" +#include "songs.h" +#include "trig.h" +#include "map_obj_lock.h" + +extern u8 gCutGrassSpriteArray[8]; // seems to be an array of 8 sprite IDs + +extern void (*gUnknown_0300485C)(void); +extern void (*gUnknown_03005CE4)(void); + +extern struct SpriteTemplate gSpriteTemplate_CutGrass; + +extern struct MapPosition gUnknown_0203923C; + +extern u8 gLastFieldPokeMenuOpened; +extern u32 gUnknown_0202FF84[]; + +extern u8 UseCutScript; + +extern void sub_808AB90(void); // unknown args +extern void sub_805BCC0(s16 x, s16 y); + +void sub_80A2634(void); +void sub_80A25E8(void); +void sub_80A2684(void); +void sub_80A27A8(s16, s16); +void sub_80A28F4(s16, s16); +void objc_8097BBC(struct Sprite *sprite); +void sub_80A2AB8(void); +void sub_80A2B00(void); // unknown args + +bool8 SetUpFieldMove_Cut(void) +{ + s16 x, y; + u8 i, j; + u8 tileBehavior; + + if(npc_before_player_of_type(0x52) == TRUE) // is in front of tree? + { + gUnknown_0300485C = sub_808AB90; + gUnknown_03005CE4 = sub_80A2634; + return TRUE; + } + else // is in ash or grass to cut? + { + PlayerGetDestCoords(&gUnknown_0203923C.x, &gUnknown_0203923C.y); + for(i = 0; i < 3; i++) + { + y = i - 1 + gUnknown_0203923C.y; + for(j = 0; j < 3; j++) + { + x = j - 1 + gUnknown_0203923C.x; + if(MapGridGetZCoordAt(x, y) == (s8)gUnknown_0203923C.height) + { + tileBehavior = MapGridGetMetatileBehaviorAt(x, y); + if(MetatileBehavior_IsPokeGrass(tileBehavior) == TRUE + || MetatileBehavior_IsAshGrass(tileBehavior) == TRUE) + { + gUnknown_0300485C = sub_808AB90; + gUnknown_03005CE4 = sub_80A25E8; + return TRUE; + } + } + } + } + return FALSE; // do not use cut + } +} + +void sub_80A25E8(void) +{ + FieldEffectStart(1); + gUnknown_0202FF84[0] = gLastFieldPokeMenuOpened; +} + +bool8 FldEff_UseCutOnGrass(void) +{ + u8 taskId = oei_task_add(); + + gTasks[taskId].data[8] = (u32)sub_80A2684 >> 16; + gTasks[taskId].data[9] = (u32)sub_80A2684; + IncrementGameStat(0x12); + return FALSE; +} + +void sub_80A2634(void) +{ + gUnknown_0202FF84[0] = gLastFieldPokeMenuOpened; + ScriptContext1_SetupScript(&UseCutScript); +} + +bool8 FldEff_UseCutOnTree(void) +{ + u8 taskId = oei_task_add(); + + gTasks[taskId].data[8] = (u32)sub_80A2B00 >> 16; + gTasks[taskId].data[9] = (u32)sub_80A2B00; + IncrementGameStat(0x12); + return FALSE; +} + +void sub_80A2684(void) +{ + FieldEffectActiveListRemove(1); + FieldEffectStart(0x3A); +} + +bool8 FldEff_CutGrass(void) +{ + s16 x, y; + u8 tileBehavior; + u8 i, j; // not in for loop? + + for(i = 0, PlaySE(SE_W015), PlayerGetDestCoords(&gUnknown_0203923C.x, &gUnknown_0203923C.y); i < 3; i++) + { + y = i - 1 + gUnknown_0203923C.y; + for(j = 0; j < 3; j++) + { + x = j - 1 + gUnknown_0203923C.x; + if(MapGridGetZCoordAt(x, y) == (s8)gUnknown_0203923C.height) + { + tileBehavior = MapGridGetMetatileBehaviorAt(x, y); + if(MetatileBehavior_IsCuttableGrass(tileBehavior) == TRUE) + { + sub_80A27A8(x, y); + sub_805BCC0(x, y); + } + } + } + } + sub_80A28F4(gUnknown_0203923C.x - 1, gUnknown_0203923C.y - 2); + DrawWholeMapView(); + + // populate sprite ID array + for(i = 0; i < 8; i++) + { + gCutGrassSpriteArray[i] = CreateSprite((struct SpriteTemplate *)&gSpriteTemplate_CutGrass, + gSprites[gPlayerAvatar.spriteId].oam.x + 8, gSprites[gPlayerAvatar.spriteId].oam.y + 20, 0); + gSprites[gCutGrassSpriteArray[i]].data2 = 32 * i; + } + return 0; +} + +// set map grid metatile depending on x, y +// TODO: enum for metatile IDs +void sub_80A27A8(s16 x, s16 y) +{ + int metatileId = MapGridGetMetatileIdAt(x, y); + + switch(metatileId) + { + case 0x208: + case 0x15: + case 0xD: + MapGridSetMetatileIdAt(x, y, 0x1); + break; + case 0x1C6: + MapGridSetMetatileIdAt(x, y, 0x1CE); + break; + case 0x1C7: + MapGridSetMetatileIdAt(x, y, 0x1CF); + break; + case 0x281: + MapGridSetMetatileIdAt(x, y, 0x279); + break; + case 0x282: + MapGridSetMetatileIdAt(x, y, 0x27A); + break; + case 0x283: + MapGridSetMetatileIdAt(x, y, 0x27B); + break; + case 0x206: + case 0x207: + MapGridSetMetatileIdAt(x, y, 0x271); + break; + case 0x212: + case 0x20A: + MapGridSetMetatileIdAt(x, y, 0x218); + break; + case 0x25: + MapGridSetMetatileIdAt(x, y, 0xE); + break; + } +} + +s32 sub_80A28A0(s16 x, s16 y) +{ + u16 metatileId = MapGridGetMetatileIdAt(x, y); + + if(metatileId == 1) + return 1; + else if(metatileId == 633) + return 2; + else if(metatileId == 634) + return 3; + else if(metatileId == 635) + return 4; + else + return 0; +} + +void sub_80A28F4(s16 x, s16 y) +{ + s16 i; + u16 lowerY = y + 3; + + for(i = 0; i < 3; i++) + { + u16 currentX = x + i; + s16 currentXsigned = x + i; + if(MapGridGetMetatileIdAt(currentXsigned, y) == 21) + { + switch((u8)sub_80A28A0(currentXsigned, y + 1)) + { + case 1: + MapGridSetMetatileIdAt(currentXsigned, y + 1, 0x208); + break; + case 2: + MapGridSetMetatileIdAt(currentXsigned, y + 1, 0x281); + break; + case 3: + MapGridSetMetatileIdAt(currentXsigned, y + 1, 0x282); + break; + case 4: + MapGridSetMetatileIdAt(currentXsigned, y + 1, 0x283); + break; + } + } + if(MapGridGetMetatileIdAt((s16)currentX, (s16)lowerY) == 1) + { + if(MapGridGetMetatileIdAt((s16)currentX, (s16)lowerY + 1) == 0x208) + MapGridSetMetatileIdAt((s16)currentX, (s16)lowerY + 1, 0x1); + if(MapGridGetMetatileIdAt((s16)currentX, (s16)lowerY + 1) == 0x281) + MapGridSetMetatileIdAt((s16)currentX, (s16)lowerY + 1, 0x279); + if(MapGridGetMetatileIdAt((s16)currentX, (s16)lowerY + 1) == 0x282) + MapGridSetMetatileIdAt((s16)currentX, (s16)lowerY + 1, 0x27A); + if(MapGridGetMetatileIdAt((s16)currentX, (s16)lowerY + 1) == 0x283) + MapGridSetMetatileIdAt((s16)currentX, (s16)lowerY + 1, 0x27B); + } + } +} + +void sub_80A2A48(struct Sprite *sprite) +{ + sprite->data0 = 8; + sprite->data1 = 0; + sprite->data3 = 0; + sprite->callback = (void *)objc_8097BBC; +} + +void objc_8097BBC(struct Sprite *sprite) +{ + u16 tempdata; + u16 tempdata2; + + sprite->pos2.x = Sin(sprite->data2, sprite->data0); + sprite->pos2.y = Cos(sprite->data2, sprite->data0); + + sprite->data2 = (sprite->data2 + 8) & 0xFF; + sprite->data0 += ((tempdata2 = sprite->data3) << 16 >> 18) + 1; // what? + sprite->data3 = tempdata2 + 1; + + tempdata = sprite->data1; + if((s16)tempdata != 28) // done rotating the grass, execute clean up function + sprite->data1++; + else + sprite->callback = (void *)sub_80A2AB8; +} + +void sub_80A2AB8(void) +{ + u8 i; + + for(i = 1; i < 8; i++) + { + DestroySprite(&gSprites[gCutGrassSpriteArray[i]]); + } + + FieldEffectStop(&gSprites[gCutGrassSpriteArray[0]], 0x3A); + sub_8064E2C(); + ScriptContext2_Disable(); +} + +void sub_80A2B00(void) +{ + PlaySE(0x80); + FieldEffectActiveListRemove(2); + EnableBothScriptContexts(); +} diff --git a/src/fldeff_strength.c b/src/fldeff_strength.c index dedb62a90..e7e7473d0 100644 --- a/src/fldeff_strength.c +++ b/src/fldeff_strength.c @@ -5,14 +5,16 @@ #include "script.h" #include "task.h" #include "text.h" +#include "braille_puzzles.h" +#include "rom6.h" static void sub_811AA18(void); static void sub_811AA38(void); static void sub_811AA9C(void); -extern u32 gUnknown_0202FF84; +extern u32 gUnknown_0202FF84[]; -extern u8 gUnknown_03005CE0; +extern u8 gLastFieldPokeMenuOpened; extern u16 gScriptResult; extern void (*gUnknown_0300485C)(void); extern void (*gUnknown_03005CE4)(void); @@ -23,7 +25,7 @@ bool8 SetUpFieldMove_Strength(void) { if (ShouldDoBrailleStrengthEffect()) { - gScriptResult = gUnknown_03005CE0; + gScriptResult = gLastFieldPokeMenuOpened; gUnknown_0300485C = sub_808AB90; gUnknown_03005CE4 = sub_811AA38; } @@ -31,7 +33,7 @@ bool8 SetUpFieldMove_Strength(void) { if (npc_before_player_of_type(87) != TRUE) return 0; - gScriptResult = gUnknown_03005CE0; + gScriptResult = gLastFieldPokeMenuOpened; gUnknown_0300485C = sub_808AB90; gUnknown_03005CE4 = sub_811AA18; } @@ -41,13 +43,13 @@ bool8 SetUpFieldMove_Strength(void) static void sub_811AA18(void) { - gUnknown_0202FF84 = gUnknown_03005CE0; + gUnknown_0202FF84[0] = gLastFieldPokeMenuOpened; ScriptContext1_SetupScript(UseStrengthScript); } static void sub_811AA38(void) { - gUnknown_0202FF84 = gUnknown_03005CE0; + gUnknown_0202FF84[0] = gLastFieldPokeMenuOpened; FieldEffectStart(40); } @@ -57,7 +59,7 @@ bool8 FldEff_UseStrength(void) gTasks[taskId].data[8] = (u32)sub_811AA9C >> 16; gTasks[taskId].data[9] = (u32)sub_811AA9C; - GetMonNickname(&gPlayerParty[gUnknown_0202FF84], gStringVar1); + GetMonNickname(&gPlayerParty[gUnknown_0202FF84[0]], gStringVar1); return FALSE; } diff --git a/src/fldeff_teleport.c b/src/fldeff_teleport.c index afa5ea997..0e6933649 100644 --- a/src/fldeff_teleport.c +++ b/src/fldeff_teleport.c @@ -3,13 +3,14 @@ #include "field_effect.h" #include "field_player_avatar.h" #include "rom4.h" +#include "rom6.h" extern void sub_8087BA8(void); -extern u32 gUnknown_0202FF84; +extern u32 gUnknown_0202FF84[]; extern void (*gUnknown_0300485C)(void); -extern u8 gUnknown_03005CE0; +extern u8 gLastFieldPokeMenuOpened; extern void (*gUnknown_03005CE4)(void); void hm_teleport_run_dp02scr(void); @@ -31,7 +32,7 @@ void hm_teleport_run_dp02scr(void) { new_game(); FieldEffectStart(63); - gUnknown_0202FF84 = gUnknown_03005CE0; + gUnknown_0202FF84[0] = gLastFieldPokeMenuOpened; } bool8 FldEff_UseTeleport(void) diff --git a/src/intro.c b/src/intro.c index 72478b773..fd0a3316e 100644 --- a/src/intro.c +++ b/src/intro.c @@ -34,7 +34,7 @@ extern u16 gUnknown_0203931A; extern u16 gUnknown_02039358; extern u16 gUnknown_0203935A; extern u32 gIntroFrameCounter; -extern struct GcmbStruct gUnknown_03005EE0; +extern struct GcmbStruct gMultibootProgramStruct; extern u16 gSaveFileStatus; extern u8 gReservedSpritePaletteCount; extern struct SpriteSheet gMonFrontPicTable[]; @@ -851,7 +851,7 @@ static void LoadCopyrightGraphics(u16 a1, u16 a2, u16 a3) static void SerialCb_CopyrightScreen(void) { - GameCubeMultiBoot_HandleSerialInterrupt(&gUnknown_03005EE0); + GameCubeMultiBoot_HandleSerialInterrupt(&gMultibootProgramStruct); } static u8 SetUpCopyrightScreen(void) @@ -892,15 +892,15 @@ static u8 SetUpCopyrightScreen(void) SetVBlankCallback(VBlankCB_Intro); REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON; SetSerialCallback(SerialCb_CopyrightScreen); - GameCubeMultiBoot_Init(&gUnknown_03005EE0); + GameCubeMultiBoot_Init(&gMultibootProgramStruct); default: UpdatePaletteFade(); gMain.state++; - GameCubeMultiBoot_Main(&gUnknown_03005EE0); + GameCubeMultiBoot_Main(&gMultibootProgramStruct); break; case 140: - GameCubeMultiBoot_Main(&gUnknown_03005EE0); - if (gUnknown_03005EE0.gcmb_field_2 != 1) + GameCubeMultiBoot_Main(&gMultibootProgramStruct); + if (gMultibootProgramStruct.gcmb_field_2 != 1) { BeginNormalPaletteFade(0xFFFFFFFFu, 0, 0, 0x10, 0); gMain.state++; @@ -911,9 +911,9 @@ static u8 SetUpCopyrightScreen(void) break; CreateTask(Task_IntroLoadPart1Graphics, 0); SetMainCallback2(MainCB2_Intro); - if (gUnknown_03005EE0.gcmb_field_2) + if (gMultibootProgramStruct.gcmb_field_2) { - GameCubeMultiBoot_ExecuteProgram(&gUnknown_03005EE0); + GameCubeMultiBoot_ExecuteProgram(&gMultibootProgramStruct); } else { @@ -931,7 +931,7 @@ void c2_copyright_1(void) if (!SetUpCopyrightScreen()) { sub_8052E4C(); - sub_81251B8(); + ResetSaveCounters(); sub_8125EC8(0); if (gSaveFileStatus == 0 || gSaveFileStatus == 2) ClearSav2(); diff --git a/src/item_use.c b/src/item_use.c index 344a3bc0d..b68b72b26 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -16,6 +16,7 @@ #include "string_util.h" #include "task.h" #include "weather.h" +#include "fieldmap.h" extern void (* const gExitToOverworldFuncList[])(); extern void (* gUnknown_03005D00)(u8); @@ -38,6 +39,7 @@ extern u8 GetPlayerDirectionTowardsHiddenItem(s16, s16); extern void SetPlayerDirectionTowardsItem(u8); extern void DisplayItemRespondingMessageAndExitItemfinder(u8); extern void RotatePlayerAndExitItemfinder(u8); +extern void sub_80C9838(u8, s16, s16); extern u8 gOtherText_DadsAdvice[]; extern u8 gOtherText_CantGetOffBike[]; @@ -47,9 +49,10 @@ extern u8 gItemFinderDirections[]; extern u16 gScriptItemId; -bool8 ItemfinderCheckForHiddenItems(struct MapEvents *events, int); +bool8 ItemfinderCheckForHiddenItems(struct MapEvents *events, u8 taskId); void RunItemfinderResults(u8); void ExitItemfinder(u8); +void sub_80C9720(u8); void ExecuteSwitchToOverworldFromItemUse(u8 taskId) { @@ -88,9 +91,9 @@ void SetUpItemUseOnFieldCallback(u8 taskId) gUnknown_03005D00(taskId); } -void HandleDeniedItemUseMessage(u8 var1, u8 playerMenuStatus, const u8 *var3) +void HandleDeniedItemUseMessage(u8 var1, u8 playerMenuStatus, const u8 *text) { - StringExpandPlaceholders(gStringVar4, var3); + StringExpandPlaceholders(gStringVar4, text); switch (playerMenuStatus) { @@ -290,125 +293,96 @@ void ExitItemfinder(u8 taskId) DestroyTask(taskId); } -// too much struct math. -__attribute__((naked)) -bool8 ItemfinderCheckForHiddenItems(struct MapEvents *events, int var) +bool8 ItemfinderCheckForHiddenItems(struct MapEvents *events, u8 taskId) { - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - mov r7, r9\n\ - mov r6, r8\n\ - push {r6,r7}\n\ - sub sp, 0x4\n\ - adds r5, r0, 0\n\ - lsls r1, 24\n\ - lsrs r6, r1, 24\n\ - mov r4, sp\n\ - adds r4, 0x2\n\ - mov r0, sp\n\ - adds r1, r4, 0\n\ - bl PlayerGetDestCoords\n\ - ldr r1, _080C9618 @ =gTasks\n\ - lsls r0, r6, 2\n\ - adds r0, r6\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - movs r1, 0\n\ - strh r1, [r0, 0xC]\n\ - movs r3, 0\n\ - mov r9, r4\n\ - ldrb r0, [r5, 0x3]\n\ - cmp r3, r0\n\ - bge _080C95FC\n\ - subs r1, 0x5\n\ - mov r8, r1\n\ -_080C9580:\n\ - lsls r3, 16\n\ - asrs r1, r3, 16\n\ - ldr r2, [r5, 0x10]\n\ - lsls r0, r1, 1\n\ - adds r0, r1\n\ - lsls r4, r0, 2\n\ - adds r1, r4, r2\n\ - ldrb r0, [r1, 0x5]\n\ - adds r7, r3, 0\n\ - cmp r0, 0x7\n\ - bne _080C95EC\n\ - movs r2, 0x96\n\ - lsls r2, 2\n\ - adds r0, r2, 0\n\ - ldrh r1, [r1, 0xA]\n\ - adds r0, r1\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - bl FlagGet\n\ - lsls r0, 24\n\ - cmp r0, 0\n\ - bne _080C95EC\n\ - ldr r1, [r5, 0x10]\n\ - adds r1, r4, r1\n\ - ldrh r2, [r1]\n\ - adds r2, 0x7\n\ - mov r0, sp\n\ - ldrh r0, [r0]\n\ - subs r2, r0\n\ - ldrh r0, [r1, 0x2]\n\ - adds r0, 0x7\n\ - mov r3, r9\n\ - ldrh r1, [r3]\n\ - subs r0, r1\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - lsls r2, 16\n\ - asrs r1, r2, 16\n\ - movs r3, 0xE0\n\ - lsls r3, 11\n\ - adds r2, r3\n\ - lsrs r2, 16\n\ - cmp r2, 0xE\n\ - bhi _080C95EC\n\ - lsls r0, 16\n\ - asrs r2, r0, 16\n\ - cmp r2, r8\n\ - blt _080C95EC\n\ - cmp r2, 0x5\n\ - bgt _080C95EC\n\ - adds r0, r6, 0\n\ - bl sub_80C9838\n\ -_080C95EC:\n\ - movs r1, 0x80\n\ - lsls r1, 9\n\ - adds r0, r7, r1\n\ - lsrs r3, r0, 16\n\ - asrs r0, 16\n\ - ldrb r2, [r5, 0x3]\n\ - cmp r0, r2\n\ - blt _080C9580\n\ -_080C95FC:\n\ - adds r0, r6, 0\n\ - bl sub_80C9720\n\ - ldr r0, _080C9618 @ =gTasks\n\ - lsls r1, r6, 2\n\ - adds r1, r6\n\ - lsls r1, 3\n\ - adds r1, r0\n\ - movs r3, 0xC\n\ - ldrsh r0, [r1, r3]\n\ - cmp r0, 0x1\n\ - beq _080C961C\n\ - movs r0, 0\n\ - b _080C961E\n\ - .align 2, 0\n\ -_080C9618: .4byte gTasks\n\ -_080C961C:\n\ - movs r0, 0x1\n\ -_080C961E:\n\ - add sp, 0x4\n\ - pop {r3,r4}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - pop {r4-r7}\n\ - pop {r1}\n\ - bx r1\n\ - .syntax divided"); + int distanceX, distanceY; + u16 x, y; + s16 newDistanceX, newDistanceY, i; + + PlayerGetDestCoords(&x, &y); + gTasks[taskId].data[2] = FALSE; + + for (i = 0; i < events->bgEventCount; i++) + { + if ((events -> bgEvents[i].kind == 7) && !FlagGet(events -> bgEvents[i].bgUnion.hiddenItem.hiddenItemId + 600)) + { + // do a distance lookup of each item so long as the index remains less than the objects on the current map. + distanceX = (u16)events -> bgEvents[i].x + 7; + newDistanceX = distanceX - x; + distanceY = (u16)events -> bgEvents[i].y + 7; + newDistanceY = distanceY - y; + + // is item in range? + if ((u16)(newDistanceX + 7) < 15 && (newDistanceY >= -5) && (newDistanceY < 6)) + sub_80C9838(taskId, newDistanceX, newDistanceY); // send coordinates of the item relative to the player + } + } + sub_80C9720(taskId); + + // hidden item detected? + if(gTasks[taskId].data[2] == TRUE) + return TRUE; + else + return FALSE; +} + +bool8 HiddenItemAtPos(struct MapEvents *events, s16 x, s16 y) +{ + u8 bgEventCount = events->bgEventCount; + struct BgEvent *bgEvent = events->bgEvents; + int i; + + for(i = 0; i < bgEventCount; i++) + { + if(bgEvent[i].kind == 7 && x == (u16)bgEvent[i].x && y == (u16)bgEvent[i].y) // hidden item and coordinates matches x and y passed? + { + if(!FlagGet(bgEvent[i].bgUnion.hiddenItem.hiddenItemId + 600)) + return TRUE; + else + return FALSE; + } + } + return FALSE; +} + +bool8 sub_80C9688(struct MapConnection *connection, int x, int y) +{ + struct MapHeader *mapHeader; + u16 localX, localY; + u32 localOffset; + s32 localLength; + + mapHeader = mapconnection_get_mapheader(connection); + + switch(connection->direction) + { + // same weird temp variable behavior seen in HiddenItemAtPos + case 2: + localOffset = connection->offset + 7; + localX = x - localOffset; + localLength = mapHeader->mapData->height - 7; + localY = localLength + y; // additions are reversed for some reason + break; + case 1: + localOffset = connection->offset + 7; + localX = x - localOffset; + localLength = gMapHeader.mapData->height + 7; + localY = y - localLength; + break; + case 3: + localLength = mapHeader->mapData->width - 7; + localX = localLength + x; // additions are reversed for some reason + localOffset = connection->offset + 7; + localY = y - localOffset; + break; + case 4: + localLength = gMapHeader.mapData->width + 7; + localX = x - localLength; + localOffset = connection->offset + 7; + localY = y - localOffset; + break; + default: + return FALSE; + } + return HiddenItemAtPos(mapHeader->events, localX, localY); } diff --git a/src/link.c b/src/link.c index 3a3e9eebf..783f6aecd 100644 --- a/src/link.c +++ b/src/link.c @@ -402,7 +402,7 @@ static void LinkTestProcessKeyInput(void) if (gMain.newKeys & START_BUTTON) SetSuppressLinkErrorMessage(TRUE); if (gMain.newKeys & R_BUTTON) - sub_8125D44(1); + TrySavingData(LINK_SAVE); if (gMain.newKeys & SELECT_BUTTON) sub_800832C(); if (gLinkTestDebugValuesEnabled) diff --git a/src/load_save.c b/src/load_save.c index 0642c4cb3..0add1b0e3 100644 --- a/src/load_save.c +++ b/src/load_save.c @@ -1,4 +1,5 @@ #include "global.h" +#include "gba/flash_internal.h" #include "load_save.h" #include "asm.h" #include "main.h" diff --git a/src/mail.c b/src/mail.c index 466a64c9c..97c8dab5b 100644 --- a/src/mail.c +++ b/src/mail.c @@ -9,6 +9,7 @@ #include "string_util.h" #include "task.h" #include "text.h" +#include "name_string_util.h" struct UnkMailStruct { diff --git a/src/main_menu.c b/src/main_menu.c index f47b3bb47..3c8df52d4 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -17,6 +17,7 @@ #include "task.h" #include "text.h" #include "title_screen.h" +#include "naming_screen.h" #define BirchSpeechUpdateWindowText() ((u8)MenuUpdateWindowText_OverrideLineLength(24)) diff --git a/src/map_obj_lock.c b/src/map_obj_lock.c index b1e7bb3df..e500deca0 100644 --- a/src/map_obj_lock.c +++ b/src/map_obj_lock.c @@ -3,6 +3,7 @@ #include "asm.h" #include "field_player_avatar.h" #include "task.h" +#include "field_map_obj_helpers.h" extern u16 gScriptFacing; diff --git a/src/matsuda_debug_menu.c b/src/matsuda_debug_menu.c index 66e865ed6..6177d9edb 100644 --- a/src/matsuda_debug_menu.c +++ b/src/matsuda_debug_menu.c @@ -10,8 +10,8 @@ #include "string_util.h" #include "task.h" #include "text.h" - -#define BIT(n) (1 << (n)) +#include "contest.h" +#include "matsuda_debug_menu.h" extern u8 gUnknown_0203856C; extern u8 gUnknown_0203857D[][64]; @@ -63,24 +63,6 @@ extern u8* gMatsudaDebugMenuTextList2[]; extern u8* gMatsudaDebugMenuTextList3[]; extern u8 gMatsudaDebugMenuContestTopLeft[][2]; -struct ContestPokemon -{ - /* 0x00 */ u16 species; - /* 0x02 */ u8 nickname[POKEMON_NAME_LENGTH]; - /* 0x0D */ u8 trainerName[8]; - /* 0x15 */ u8 filler15[9]; - /* 0x1E */ u16 moves[4]; // moves - /* 0x26 */ u8 cool; // cool - /* 0x27 */ u8 beauty; // beauty - /* 0x28 */ u8 cute; // cute - /* 0x29 */ u8 smart; // smart - /* 0x2A */ u8 tough; // tough - /* 0x2B */ u8 sheen; // sheen - /* 0x2C */ u8 filler2C[20]; -}; - -extern struct ContestPokemon gContestMons[]; - extern bool8 gReceivedRemoteLinkPlayers; extern u16 gBlockRecvBuffer[MAX_LINK_PLAYERS][BLOCK_BUFFER_SIZE / 2]; @@ -103,7 +85,6 @@ static void sub_80AA10C(void); static void sub_80AA5BC(u8); static void sub_80AA614(u8, u8); static void sub_80AAD08(struct Sprite *, s8); -extern void sub_80AB184(void); extern void sub_80AB47C(void); extern int sub_80B2A7C(u8); //Don't know return type size @@ -431,7 +412,7 @@ static void sub_80AA10C(void) gSprites[spriteId].data3 = zero; // only this assignment of zero is necessary. other replacements of 0 with zero do not change the asm, compiler will treat it the same. } -void sub_80AA280(u8 var) +void sub_80AA280(u8 var) // no? { u8 i; diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 9a049bb40..a7fb5abef 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1,7 +1,251 @@ #include "global.h" #include "metatile_behaviors.h" -extern u8 gUnknown_08308E2C[]; +#define TILE_ATTRIBUTES(three, two, one) (((one) ? 1 : 0) | ((two) ? 2 : 0) | ((three) ? 4 : 0)) + +static const u8 sTileBitAttributes[] = +{ + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, TRUE), + TILE_ATTRIBUTES(TRUE, FALSE, TRUE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, TRUE), + TILE_ATTRIBUTES(TRUE, FALSE, TRUE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, TRUE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, TRUE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, TRUE, TRUE), + TILE_ATTRIBUTES(TRUE, TRUE, TRUE), + TILE_ATTRIBUTES(TRUE, TRUE, TRUE), + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), + TILE_ATTRIBUTES(TRUE, TRUE, TRUE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, TRUE, TRUE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, TRUE), + TILE_ATTRIBUTES(TRUE, FALSE, TRUE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, TRUE, TRUE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + TILE_ATTRIBUTES(FALSE, FALSE, FALSE) +}; bool8 MetatileBehavior_IsWaterfall(u8); @@ -13,7 +257,7 @@ bool8 MetatileBehavior_IsATile(u8 var) bool8 MetatileBehavior_IsEncounterTile(u8 var) { - if ((gUnknown_08308E2C[var] & 1) != 0) + if ((sTileBitAttributes[var] & 1) != 0) return TRUE; else return FALSE; @@ -149,7 +393,7 @@ bool8 MetatileBehavior_IsDeepSouthWarp(u8 var) bool8 MetatileBehavior_IsSurfableWaterOrUnderwater(u8 var) { - if ((gUnknown_08308E2C[var] & 2) != 0) + if ((sTileBitAttributes[var] & 2) != 0) return TRUE; else return FALSE; @@ -582,9 +826,9 @@ bool8 MetatileBehavior_IsBerryTreeSoil(u8 var) return FALSE; } -bool8 MetatileBehavior_IsAsh(u8 var) +bool8 MetatileBehavior_IsAshGrass(u8 var) { - if (var == MB_ASH) + if (var == MB_ASHGRASS) return TRUE; else return FALSE; @@ -992,9 +1236,9 @@ bool8 MetatileBehavior_IsRunningDisallowed(u8 var) return FALSE; } -bool8 sub_80578F8(u8 var) +bool8 MetatileBehavior_IsCuttableGrass(u8 var) { - if (var == MB_TALL_GRASS || var == MB_LONG_GRASS || var == MB_ASH || var == MB_LONG_GRASS_SOUTH_EDGE) + if (var == MB_TALL_GRASS || var == MB_LONG_GRASS || var == MB_ASHGRASS || var == MB_LONG_GRASS_SOUTH_EDGE) return TRUE; else return FALSE; diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index 3c867fb01..693b28948 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -295,7 +295,7 @@ static void CB2_MysteryEventMenu(void) unkVal = sub_812613C(unk_2000000); CpuFill32(0, unk_2000000, 0x7D4); if (!GetEventLoadMessage(gStringVar4, unkVal)) - sub_8125D44(0); + TrySavingData(NORMAL_SAVE); gMain.state++; break; case 12: diff --git a/src/naming_screen.c b/src/naming_screen.c index aa8066eb5..54a796264 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -10,64 +10,13 @@ #include "task.h" #include "text.h" #include "trig.h" +#include "naming_screen.h" extern u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8, u8); extern u8 CreateMonIcon(); extern void sub_809D51C(void); extern void MultiplyInvertedPaletteRGBComponents(u16, u8, u8, u8); -enum -{ - NAMING_SCREEN_TEMPLATE_PLAYER_NAME, - NAMING_SCREEN_TEMPLATE_BOX_NAME, - NAMING_SCREEN_TEMPLATE_MON_NAME, -}; - -struct NamingScreenTemplate -{ - u8 unk0; - u8 maxChars; - u8 unk2; - u8 unk3; - u8 unk4; //mode? - u8 unk5; - u8 unk6; - u8 unk7; - const u8 *title; -}; - -struct NamingScreenData -{ - u8 state; - u8 templateNum; - u16 unk2; - u16 bg1vOffset; - u16 bg2vOffset; - u16 unk8; - u16 unkA; - u8 unkC; - u8 unkD; - u8 currentPage; - u8 cursorSpriteId; - u8 unk10; - u8 textBuffer[0x10]; - u8 filler21[0x13]; - const struct NamingScreenTemplate *template; - u8 *destBuffer; - u16 unk3C; //savedKeyRepeatStartDelay - u16 unk3E; - u16 unk40; - u32 unk44; - MainCallback returnCallback; -}; - -enum -{ - PAGE_UPPER, - PAGE_LOWER, - PAGE_OTHERS, -}; - extern u16 gKeyRepeatStartDelay; extern u8 unk_2000000[]; @@ -140,7 +89,7 @@ static void sub_80B6CA8(void); static void sub_80B6D04(void); static void sub_80B6E44(void); static void InputInit(void); -static void sub_80B6438(void); +static void sub_80B6438(void); static void sub_80B5E50(void); static void Task_NamingScreenMain(u8); static void SetInputState(u8); @@ -188,31 +137,6 @@ static void sub_80B76E0(); static void nullsub_20(u8, u8); static void PrintKeyboardCharacters(u8); -enum -{ - MAIN_STATE_BEGIN_FADE_IN, - MAIN_STATE_WAIT_FADE_IN, - MAIN_STATE_HANDLE_INPUT, - MAIN_STATE_MOVE_TO_OK_BUTTON, - MAIN_STATE_START_PAGE_SWAP, - MAIN_STATE_WAIT_PAGE_SWAP, - MAIN_STATE_6, - MAIN_STATE_UPDATE_SENT_TO_PC_MESSAGE, - MAIN_STATE_BEGIN_FADE_OUT, -}; - -enum -{ - INPUT_STATE_DISABLED, - INPUT_STATE_ENABLED, -}; - -#define KBEVENT_NONE 0 -#define KBEVENT_PRESSED_A 5 -#define KBEVENT_PRESSED_B 6 -#define KBEVENT_PRESSED_SELECT 8 -#define KBEVENT_PRESSED_START 9 - void DoNamingScreen(u8 templateNum, u8 *destBuffer, u16 c, u16 d, u32 e, MainCallback returnCallback) { StoreNamingScreenParameters(templateNum, destBuffer, c, d, e, returnCallback); @@ -307,7 +231,7 @@ static void GetNamingScreenParameters(void) namingScreenData.templateNum = task->data[0]; namingScreenData.unk3E = task->data[1]; namingScreenData.unk40 = task->data[2]; - namingScreenData.unk44 = (task->data[3] << 16) | (u16)task->data[4]; + namingScreenData.unk42 = (task->data[3] << 16) | (u16)task->data[4]; LoadWordFromTwoHalfwords(&task->data[5], (u32 *)&namingScreenData.destBuffer); LoadWordFromTwoHalfwords(&task->data[7], (u32 *)&namingScreenData.returnCallback); DestroyTask(taskId); @@ -1406,7 +1330,7 @@ static void sub_80B6EFC(void) u8 spriteId; sub_809D51C(); - spriteId = CreateMonIcon(namingScreenData.unk3E, SpriteCallbackDummy, 0x34, 0x18, 0, namingScreenData.unk44); + spriteId = CreateMonIcon(namingScreenData.unk3E, SpriteCallbackDummy, 0x34, 0x18, 0, namingScreenData.unk42); gSprites[spriteId].oam.priority = 3; } @@ -1476,7 +1400,7 @@ static bool8 sub_80B7004(void) return FALSE; } -static void sub_80B7090(void) +static void sub_80B7090(void) // DoInput? { u8 r5; u8 r4; diff --git a/src/new_game.c b/src/new_game.c index 99c7839eb..82a26b52b 100644 --- a/src/new_game.c +++ b/src/new_game.c @@ -11,8 +11,9 @@ #include "rom4.h" #include "rtc.h" #include "script.h" +#include "dewford_trend.h" -extern u8 gUnknown_020297EC; +extern u8 gDifferentSaveFile; extern u8 gPlayerPartyCount; extern u8 gUnknown_03005CE8; @@ -22,8 +23,9 @@ extern u8 gUnknown_0819FA81[]; const struct SB1_2EFC_Struct gUnknown_08216604 = { - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0x0000, + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, } @@ -73,7 +75,7 @@ void sub_8052DA8(void) sub_80B2D1C(); for (i = 0; i < 5; i++) - gSaveBlock1.sb1_2EFC_struct[i] = gUnknown_08216604; + gSaveBlock1.sbStruct.unkSB1.sb1_2EFC_struct[i] = gUnknown_08216604; } void sub_8052DE4(void) @@ -95,7 +97,7 @@ void ClearSav2(void) void sub_8052E4C(void) { - gUnknown_020297EC = 0; + gDifferentSaveFile = 0; sub_808C0A0(); ZeroPlayerPartyMons(); ZeroEnemyPartyMons(); @@ -104,9 +106,10 @@ void sub_8052E4C(void) void NewGameInitData(void) { - if (!gSaveFileStatus || gSaveFileStatus == 2) + if (gSaveFileStatus == 0 || gSaveFileStatus == 2) RtcReset(); - gUnknown_020297EC = 1; + + gDifferentSaveFile = 1; ZeroPlayerPartyMons(); ZeroEnemyPartyMons(); sub_808C02C(); diff --git a/src/record_mixing.c b/src/record_mixing.c index b148fa644..57a6790f1 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -10,6 +10,7 @@ #include "sound.h" #include "string_util.h" #include "task.h" +#include "dewford_trend.h" extern void *recordMixingSecretBases; extern void *recordMixingTvShows; diff --git a/src/rom4.c b/src/rom4.c index 37c6b84ad..9d7fec115 100644 --- a/src/rom4.c +++ b/src/rom4.c @@ -30,6 +30,10 @@ #include "tileset_anim.h" #include "weather.h" #include "wild_encounter.h" +#include "script_pokemon_80C4.h" +#include "clock.h" +#include "field_map_obj_helpers.h" +#include "field_control_avatar.h" #ifdef SAPPHIRE #define LEGENDARY_MUSIC BGM_OOAME // Heavy Rain @@ -465,16 +469,10 @@ struct MapConnection *sub_8053818(u8 dir) if (connection == NULL) return NULL; - - i = 0; - - while (i < count) - { - if (connection->direction == dir) + + for(i = 0; i < count; i++, connection++) + if (connection->direction == dir) return connection; - i++; - connection++; - } return NULL; } diff --git a/src/rom6.c b/src/rom6.c index 581bd46b4..037516489 100644 --- a/src/rom6.c +++ b/src/rom6.c @@ -8,19 +8,17 @@ #include "sound.h" #include "sprite.h" #include "task.h" +#include "rom6.h" +#include "braille_puzzles.h" extern u16 gScriptLastTalked; extern u32 gUnknown_0202FF84[]; extern struct MapPosition gUnknown_0203923C; extern void (*gUnknown_0300485C)(void); -extern u8 gUnknown_03005CE0; +extern u8 gLastFieldPokeMenuOpened; extern void (*gUnknown_03005CE4)(void); extern u8 UseRockSmashScript[]; -extern bool8 ShouldDoBrailleDigEffect(void); -extern void DoBrailleDigEffect(void); -extern void sub_8053014(void); -extern void sub_8059BF4(void); extern void sub_808AB90(void); extern void task08_080A1C44(u8); extern u8 sub_80CA1C8(void); @@ -136,7 +134,7 @@ bool8 SetUpFieldMove_RockSmash(void) static void sub_810B53C(void) { - gUnknown_0202FF84[0] = gUnknown_03005CE0; + gUnknown_0202FF84[0] = gLastFieldPokeMenuOpened; ScriptContext1_SetupScript(UseRockSmashScript); } @@ -175,7 +173,7 @@ static void sub_810B5D8(void) { sub_8053014(); FieldEffectStart(0x26); - gUnknown_0202FF84[0] = gUnknown_03005CE0; + gUnknown_0202FF84[0] = gLastFieldPokeMenuOpened; } int FldEff_UseDig(void) diff --git a/src/save.c b/src/save.c index 9d70bfffd..b5934e231 100644 --- a/src/save.c +++ b/src/save.c @@ -1,58 +1,83 @@ #include "global.h" +#include "gba/flash_internal.h" #include "gba/gba.h" #include "save.h" #include "asm.h" -#include "gba/flash_internal.h" #include "load_save.h" #include "rom4.h" #include "save_failed_screen.h" -extern struct SaveSection unk_2000000; - -extern u32 gUnknown_02039284; - -extern u16 gUnknown_03005E9C; -extern u32 gUnknown_03005EA0; -extern u16 gUnknown_03005EA4; -extern u32 gUnknown_03005EA8; -extern u32 gUnknown_03005EAC; -extern struct SaveSection *gUnknown_03005EB0; +extern u32 gLastSaveSectorStatus; // used but in an unferenced function, so unused +extern u16 gLastWrittenSector; +extern u32 gLastSaveCounter; +extern u16 gLastKnownGoodSector; +extern u32 gDamagedSaveSectors; +extern u32 gSaveCounter; +extern struct SaveSection unk_2000000; // slow save RAM +extern struct SaveSection *gFastSaveSection; // the pointer is in fast IWRAM but may sometimes point to the slower EWRAM. extern u16 gUnknown_03005EB4; extern u16 gSaveFileStatus; -extern u32 gUnknown_03005EBC; +extern u32 gGameContinueCallback; -extern struct SaveSectionLocation gSaveSectionLocations[]; -extern struct SaveSectionLocation gHallOfFameSaveSectionLocations[]; -extern u8 gUnknown_08401E24[]; +extern struct PokemonStorage gPokemonStorage; +extern struct HallOfFame gHallOfFame; + +const struct SaveSectionLocation gSaveSectionLocations[] = +{ + {((u8 *) &gSaveBlock2), 0x890}, + {((u8 *) &gSaveBlock1) + 0xF80 * 0, 0xF80}, + {((u8 *) &gSaveBlock1) + 0xF80 * 1, 0xF80}, + {((u8 *) &gSaveBlock1) + 0xF80 * 2, 0xF80}, + {((u8 *) &gSaveBlock1) + 0xF80 * 3, 0xC40}, + {((u8 *) &gPokemonStorage) + 0xF80 * 0, 0xF80}, + {((u8 *) &gPokemonStorage) + 0xF80 * 1, 0xF80}, + {((u8 *) &gPokemonStorage) + 0xF80 * 2, 0xF80}, + {((u8 *) &gPokemonStorage) + 0xF80 * 3, 0xF80}, + {((u8 *) &gPokemonStorage) + 0xF80 * 4, 0xF80}, + {((u8 *) &gPokemonStorage) + 0xF80 * 5, 0xF80}, + {((u8 *) &gPokemonStorage) + 0xF80 * 6, 0xF80}, + {((u8 *) &gPokemonStorage) + 0xF80 * 7, 0xF80}, + {((u8 *) &gPokemonStorage) + 0xF80 * 8, 0x7D0} +}; + +const struct SaveSectionLocation gHallOfFameSaveSectionLocations[] = +{ + {((u8 *) &gHallOfFame) + 0xF80 * 0, 0xF80}, + {((u8 *) &gHallOfFame) + 0xF80 * 1, 0xF80} +}; + +const u8 gFlashSectors[] = { 0x1E, 0x1F }; void ClearSaveData(void) { u16 i; - for (i = 0; i < 32; i++) + + for (i = 0; i < NUM_SECTORS; i++) EraseFlashSector(i); } -void sub_81251B8(void) +// ResetSaveCounters +void ResetSaveCounters(void) { - gUnknown_03005EAC = 0; - gUnknown_03005E9C = 0; - gUnknown_03005EA8 = 0; + gSaveCounter = 0; + gLastWrittenSector = 0; + gDamagedSaveSectors = 0; } -bool32 sub_81251D4(u8 op, u8 bit) +bool32 SetDamagedSectorBits(u8 op, u8 bit) { bool32 retVal = FALSE; switch (op) { - case 0: - gUnknown_03005EA8 |= 1 << bit; + case ENABLE: + gDamagedSaveSectors |= (1 << bit); break; - case 1: - gUnknown_03005EA8 &= ~(1 << bit); + case DISABLE: + gDamagedSaveSectors &= ~(1 << bit); break; - case 2: - if (gUnknown_03005EA8 & (1 << bit)) + case CHECK: // unused + if (gDamagedSaveSectors & (1 << bit)) retVal = TRUE; break; } @@ -60,67 +85,70 @@ bool32 sub_81251D4(u8 op, u8 bit) return retVal; } -u8 save_write_to_flash(u16 a1, struct SaveSectionLocation *a2) +u8 save_write_to_flash(u16 a1, const struct SaveSectionLocation *location) { u32 retVal; u16 i; - gUnknown_03005EB0 = &unk_2000000; + gFastSaveSection = &unk_2000000; - if (a1 != 0xFFFF) + if (a1 != 0xFFFF) // for link { - retVal = sub_81252D8(a1, a2); + retVal = HandleWriteSector(a1, location); } else { - gUnknown_03005EA4 = gUnknown_03005E9C; - gUnknown_03005EA0 = gUnknown_03005EAC; - gUnknown_03005E9C++; - gUnknown_03005E9C = gUnknown_03005E9C % 14; - gUnknown_03005EAC++; + gLastKnownGoodSector = gLastWrittenSector; // backup the current written sector before attempting to write. + gLastSaveCounter = gSaveCounter; + gLastWrittenSector++; + gLastWrittenSector = gLastWrittenSector % 14; + gSaveCounter++; retVal = 1; + for (i = 0; i < 14; i++) - sub_81252D8(i, a2); - if (gUnknown_03005EA8) + HandleWriteSector(i, location); + + if (gDamagedSaveSectors != 0) // skip the damaged sector. { retVal = 0xFF; - gUnknown_03005E9C = gUnknown_03005EA4; - gUnknown_03005EAC = gUnknown_03005EA0; + gLastWrittenSector = gLastKnownGoodSector; + gSaveCounter = gLastSaveCounter; } } return retVal; } -u8 sub_81252D8(u16 a1, struct SaveSectionLocation *a2) +u8 HandleWriteSector(u16 a1, const struct SaveSectionLocation *location) { u16 i; u16 sector; u8 *data; u16 size; - sector = a1 + gUnknown_03005E9C; + sector = a1 + gLastWrittenSector; sector %= 14; - sector += 14 * (gUnknown_03005EAC % 2); + sector += 14 * (gSaveCounter % 2); - data = a2[a1].data; - size = a2[a1].size; + data = location[a1].data; + size = location[a1].size; + // clear save section. for (i = 0; i < sizeof(struct SaveSection); i++) - ((char *)gUnknown_03005EB0)[i] = 0; + ((char *)gFastSaveSection)[i] = 0; - gUnknown_03005EB0->id = a1; - gUnknown_03005EB0->unknown = 0x8012025; - gUnknown_03005EB0->counter = gUnknown_03005EAC; + gFastSaveSection->id = a1; + gFastSaveSection->security = UNKNOWN_CHECK_VALUE; + gFastSaveSection->counter = gSaveCounter; for (i = 0; i < size; i++) - gUnknown_03005EB0->data[i] = data[i]; + gFastSaveSection->data[i] = data[i]; - gUnknown_03005EB0->checksum = sub_8125C10(data, size); - return sub_8125440(sector, gUnknown_03005EB0->data); + gFastSaveSection->checksum = CalculateChecksum(data, size); + return TryWriteSector(sector, gFastSaveSection->data); } -u8 sub_81253C8(u8 sector, u8 *data, u16 size) +u8 HandleWriteSectorNBytes(u8 sector, u8 *data, u16 size) { u16 i; struct SaveSection *section = &unk_2000000; @@ -128,66 +156,66 @@ u8 sub_81253C8(u8 sector, u8 *data, u16 size) for (i = 0; i < sizeof(struct SaveSection); i++) ((char *)section)[i] = 0; - section->unknown = 0x8012025; + section->security = UNKNOWN_CHECK_VALUE; for (i = 0; i < size; i++) section->data[i] = data[i]; - section->id = sub_8125C10(data, size); // id instead of checksum? - return sub_8125440(sector, section->data); + section->id = CalculateChecksum(data, size); // though this appears to be incorrect, it might be some sector checksum instead of a whole save checksum and only appears to be relevent to HOF data, if used. + return TryWriteSector(sector, section->data); } -u8 sub_8125440(u8 sector, u8 *data) +u8 TryWriteSector(u8 sector, u8 *data) { - if (ProgramFlashSectorAndVerify(sector, data)) + if (ProgramFlashSectorAndVerify(sector, data) != 0) // is damaged? { - sub_81251D4(0, sector); + SetDamagedSectorBits(ENABLE, sector); // set damaged sector bits. return 0xFF; } else { - sub_81251D4(1, sector); + SetDamagedSectorBits(DISABLE, sector); // unset damaged sector bits. it's safe now. return 1; } } -u32 sub_812546C(struct SaveSectionLocation *a1) +u32 RestoreSaveBackupVarsAndIncrement(const struct SaveSectionLocation *location) // location is unused { - gUnknown_03005EB0 = &unk_2000000; - gUnknown_03005EA4 = gUnknown_03005E9C; - gUnknown_03005EA0 = gUnknown_03005EAC; - gUnknown_03005E9C++; - gUnknown_03005E9C = gUnknown_03005E9C % 14; - gUnknown_03005EAC++; + gFastSaveSection = &unk_2000000; + gLastKnownGoodSector = gLastWrittenSector; + gLastSaveCounter = gSaveCounter; + gLastWrittenSector++; + gLastWrittenSector = gLastWrittenSector % 14; + gSaveCounter++; gUnknown_03005EB4 = 0; - gUnknown_03005EA8 = 0; + gDamagedSaveSectors = 0; return 0; } -u32 sub_81254C8(struct SaveSectionLocation *a1) +u32 RestoreSaveBackupVars(const struct SaveSectionLocation *location) // only ever called once, and gSaveBlock2 is passed to this function. location is unused { - gUnknown_03005EB0 = &unk_2000000; - gUnknown_03005EA4 = gUnknown_03005E9C; - gUnknown_03005EA0 = gUnknown_03005EAC; + gFastSaveSection = &unk_2000000; + gLastKnownGoodSector = gLastWrittenSector; + gLastSaveCounter = gSaveCounter; gUnknown_03005EB4 = 0; - gUnknown_03005EA8 = 0; + gDamagedSaveSectors = 0; return 0; } -u8 sub_812550C(u16 a1, struct SaveSectionLocation *a2) +u8 sub_812550C(u16 a1, const struct SaveSectionLocation *location) { u8 retVal; if (gUnknown_03005EB4 < a1 - 1) { retVal = 1; - sub_81252D8(gUnknown_03005EB4, a2); + HandleWriteSector(gUnknown_03005EB4, location); gUnknown_03005EB4++; - if (gUnknown_03005EA8) + if (gDamagedSaveSectors) { retVal = 0xFF; - gUnknown_03005E9C = gUnknown_03005EA4; - gUnknown_03005EAC = gUnknown_03005EA0; + gLastWrittenSector = gLastKnownGoodSector; + gSaveCounter = gLastSaveCounter; } } else @@ -198,20 +226,22 @@ u8 sub_812550C(u16 a1, struct SaveSectionLocation *a2) return retVal; } -u8 sub_812556C(u16 a1, struct SaveSectionLocation *a2) +u8 sub_812556C(u16 a1, const struct SaveSectionLocation *location) { u8 retVal = 1; - sub_81255B8(a1 - 1, a2); - if (gUnknown_03005EA8) + + sub_81255B8(a1 - 1, location); + + if (gDamagedSaveSectors) { retVal = 0xFF; - gUnknown_03005E9C = gUnknown_03005EA4; - gUnknown_03005EAC = gUnknown_03005EA0; + gLastWrittenSector = gLastKnownGoodSector; + gSaveCounter = gLastSaveCounter; } return retVal; } -u8 sub_81255B8(u16 a1, struct SaveSectionLocation *a2) +u8 sub_81255B8(u16 a1, const struct SaveSectionLocation *location) { u16 i; u16 sector; @@ -219,32 +249,35 @@ u8 sub_81255B8(u16 a1, struct SaveSectionLocation *a2) u16 size; u8 status; - sector = a1 + gUnknown_03005E9C; + sector = a1 + gLastWrittenSector; sector %= 14; - sector += 14 * (gUnknown_03005EAC % 2); + sector += 14 * (gSaveCounter % 2); - data = a2[a1].data; - size = a2[a1].size; + data = location[a1].data; + size = location[a1].size; + // clear temp save section. for (i = 0; i < sizeof(struct SaveSection); i++) - ((char *)gUnknown_03005EB0)[i] = 0; + ((char *)gFastSaveSection)[i] = 0; - gUnknown_03005EB0->id = a1; - gUnknown_03005EB0->unknown = 0x8012025; - gUnknown_03005EB0->counter = gUnknown_03005EAC; + gFastSaveSection->id = a1; + gFastSaveSection->security = UNKNOWN_CHECK_VALUE; + gFastSaveSection->counter = gSaveCounter; + // set temp section's data. for (i = 0; i < size; i++) - gUnknown_03005EB0->data[i] = data[i]; + gFastSaveSection->data[i] = data[i]; - gUnknown_03005EB0->checksum = sub_8125C10(data, size); + // calculate checksum. + gFastSaveSection->checksum = CalculateChecksum(data, size); EraseFlashSector(sector); status = 1; - for (i = 0; i < 0xFF8; i++) + for (i = 0; i < sizeof(struct UnkSaveSection); i++) { - if (ProgramFlashByte(sector, i, ((u8 *)gUnknown_03005EB0)[i])) + if (ProgramFlashByte(sector, i, ((u8 *)gFastSaveSection)[i])) { status = 0xFF; break; @@ -253,7 +286,7 @@ u8 sub_81255B8(u16 a1, struct SaveSectionLocation *a2) if (status == 0xFF) { - sub_81251D4(0, sector); + SetDamagedSectorBits(ENABLE, sector); return 0xFF; } else @@ -262,7 +295,7 @@ u8 sub_81255B8(u16 a1, struct SaveSectionLocation *a2) for (i = 0; i < 7; i++) { - if (ProgramFlashByte(sector, 0xFF9 + i, ((u8 *)gUnknown_03005EB0)[0xFF9 + i])) + if (ProgramFlashByte(sector, 0xFF9 + i, ((u8 *)gFastSaveSection)[0xFF9 + i])) { status = 0xFF; break; @@ -271,105 +304,107 @@ u8 sub_81255B8(u16 a1, struct SaveSectionLocation *a2) if (status == 0xFF) { - sub_81251D4(0, sector); + SetDamagedSectorBits(ENABLE, sector); return 0xFF; } else { - sub_81251D4(1, sector); + SetDamagedSectorBits(DISABLE, sector); return 1; } } } -u8 sub_8125758(u16 a1, struct SaveSectionLocation *a2) +u8 sub_8125758(u16 a1, const struct SaveSectionLocation *location) { u16 sector; - sector = a1 + gUnknown_03005E9C - 1; + sector = a1 + gLastWrittenSector - 1; sector %= 14; - sector += 14 * (gUnknown_03005EAC % 2); + sector += 14 * (gSaveCounter % 2); - if (ProgramFlashByte(sector, 0xFF8, ((u8 *)gUnknown_03005EB0)[0xFF8])) + if (ProgramFlashByte(sector, sizeof(struct UnkSaveSection), ((u8 *)gFastSaveSection)[sizeof(struct UnkSaveSection)])) { - sub_81251D4(0, sector); - gUnknown_03005E9C = gUnknown_03005EA4; - gUnknown_03005EAC = gUnknown_03005EA0; + // sector is damaged, so enable the bit in gDamagedSaveSectors and restore the last written sector and save counter. + SetDamagedSectorBits(ENABLE, sector); + gLastWrittenSector = gLastKnownGoodSector; + gSaveCounter = gLastSaveCounter; return 0xFF; } else { - sub_81251D4(1u, sector); + SetDamagedSectorBits(DISABLE, sector); return 1; } } -u8 sub_81257F0(u16 a1, struct SaveSectionLocation *a2) +u8 sub_81257F0(u16 a1, const struct SaveSectionLocation *location) { u16 sector; - sector = a1 + gUnknown_03005E9C - 1; + sector = a1 + gLastWrittenSector - 1; sector %= 14; - sector += 14 * (gUnknown_03005EAC % 2); + sector += 14 * (gSaveCounter % 2); - if (ProgramFlashByte(sector, 0xFF8, 0x25)) + if (ProgramFlashByte(sector, sizeof(struct UnkSaveSection), 0x25)) { - sub_81251D4(0, sector); - gUnknown_03005E9C = gUnknown_03005EA4; - gUnknown_03005EAC = gUnknown_03005EA0; + // sector is damaged, so enable the bit in gDamagedSaveSectors and restore the last written sector and save counter. + SetDamagedSectorBits(ENABLE, sector); + gLastWrittenSector = gLastKnownGoodSector; + gSaveCounter = gLastSaveCounter; return 0xFF; } else { - sub_81251D4(1u, sector); + SetDamagedSectorBits(DISABLE, sector); return 1; } } -u8 sub_812587C(u16 a1, struct SaveSectionLocation *a2) +u8 sub_812587C(u16 a1, const struct SaveSectionLocation *location) { u8 retVal; - gUnknown_03005EB0 = &unk_2000000; + gFastSaveSection = &unk_2000000; if (a1 != 0xFFFF) { retVal = 0xFF; } else { - retVal = sub_8125974(a2); - sub_81258BC(0xFFFF, a2); + retVal = sub_8125974(location); + sub_81258BC(0xFFFF, location); } return retVal; } -u8 sub_81258BC(u16 a1, struct SaveSectionLocation *a2) +u8 sub_81258BC(u16 a1, const struct SaveSectionLocation *location) { u16 i; u16 checksum; - u16 v3 = 14 * (gUnknown_03005EAC % 2); + u16 v3 = 14 * (gSaveCounter % 2); u16 id; for (i = 0; i < 14; i++) { - sub_8125BF8(i + v3, gUnknown_03005EB0); - id = gUnknown_03005EB0->id; + sub_8125BF8(i + v3, gFastSaveSection); + id = gFastSaveSection->id; if (id == 0) - gUnknown_03005E9C = i; - checksum = sub_8125C10(gUnknown_03005EB0->data, a2[id].size); - if (gUnknown_03005EB0->unknown == 0x8012025 - && gUnknown_03005EB0->checksum == checksum) + gLastWrittenSector = i; + checksum = CalculateChecksum(gFastSaveSection->data, location[id].size); + if (gFastSaveSection->security == UNKNOWN_CHECK_VALUE + && gFastSaveSection->checksum == checksum) { u16 j; - for (j = 0; j < a2[id].size; j++) - ((u8 *)a2[id].data)[j] = gUnknown_03005EB0->data[j]; + for (j = 0; j < location[id].size; j++) + ((u8 *)location[id].data)[j] = gFastSaveSection->data[j]; } } return 1; } -u8 sub_8125974(struct SaveSectionLocation *a1) +u8 sub_8125974(const struct SaveSectionLocation *location) { u16 i; u16 checksum; @@ -385,15 +420,15 @@ u8 sub_8125974(struct SaveSectionLocation *a1) for (i = 0; i < 14; i++) { - sub_8125BF8(i, gUnknown_03005EB0); - if (gUnknown_03005EB0->unknown == 0x8012025) + sub_8125BF8(i, gFastSaveSection); + if (gFastSaveSection->security == UNKNOWN_CHECK_VALUE) { v5 = TRUE; - checksum = sub_8125C10(gUnknown_03005EB0->data, a1[gUnknown_03005EB0->id].size); - if (gUnknown_03005EB0->checksum == checksum) + checksum = CalculateChecksum(gFastSaveSection->data, location[gFastSaveSection->id].size); + if (gFastSaveSection->checksum == checksum) { - v2 = gUnknown_03005EB0->counter; - v4 |= 1 << gUnknown_03005EB0->id; + v2 = gFastSaveSection->counter; + v4 |= 1 << gFastSaveSection->id; } } } @@ -415,15 +450,15 @@ u8 sub_8125974(struct SaveSectionLocation *a1) for (i = 0; i < 14; i++) { - sub_8125BF8(i + 14, gUnknown_03005EB0); - if (gUnknown_03005EB0->unknown == 0x8012025) + sub_8125BF8(i + 14, gFastSaveSection); + if (gFastSaveSection->security == UNKNOWN_CHECK_VALUE) { v5 = TRUE; - checksum = sub_8125C10(gUnknown_03005EB0->data, a1[gUnknown_03005EB0->id].size); - if (gUnknown_03005EB0->checksum == checksum) + checksum = CalculateChecksum(gFastSaveSection->data, location[gFastSaveSection->id].size); + if (gFastSaveSection->checksum == checksum) { - v3 = gUnknown_03005EB0->counter; - v4 |= 1 << gUnknown_03005EB0->id; + v3 = gFastSaveSection->counter; + v4 |= 1 << gFastSaveSection->id; } } } @@ -446,22 +481,22 @@ u8 sub_8125974(struct SaveSectionLocation *a1) { if ((unsigned)(v2 + 1) < (unsigned)(v3 + 1)) { - gUnknown_03005EAC = v3; + gSaveCounter = v3; } else { - gUnknown_03005EAC = v2; + gSaveCounter = v2; } } else { if (v2 < v3) { - gUnknown_03005EAC = v3; + gSaveCounter = v3; } else { - gUnknown_03005EAC = v2; + gSaveCounter = v2; } } return 1; @@ -469,7 +504,7 @@ u8 sub_8125974(struct SaveSectionLocation *a1) if (v14 == 1) { - gUnknown_03005EAC = v2; + gSaveCounter = v2; if (v10 == 255) return 255; return 1; @@ -477,7 +512,7 @@ u8 sub_8125974(struct SaveSectionLocation *a1) if (v10 == 1) { - gUnknown_03005EAC = v3; + gSaveCounter = v3; if (v14 == 255) return 255; return 1; @@ -485,13 +520,13 @@ u8 sub_8125974(struct SaveSectionLocation *a1) if (v14 == 0 && v10 == 0) { - gUnknown_03005EAC = 0; - gUnknown_03005E9C = 0; + gSaveCounter = 0; + gLastWrittenSector = 0; return 0; } - gUnknown_03005EAC = 0; - gUnknown_03005E9C = 0; + gSaveCounter = 0; + gLastWrittenSector = 0; return 2; } @@ -500,9 +535,9 @@ u8 sub_8125B88(u8 a1, u8 *data, u16 size) u16 i; struct SaveSection *section = &unk_2000000; sub_8125BF8(a1, section); - if (section->unknown == 0x8012025) + if (section->security == UNKNOWN_CHECK_VALUE) { - u16 checksum = sub_8125C10(section->data, size); + u16 checksum = CalculateChecksum(section->data, size); if (section->id == checksum) { for (i = 0; i < size; i++) @@ -522,11 +557,11 @@ u8 sub_8125B88(u8 a1, u8 *data, u16 size) u8 sub_8125BF8(u8 sector, struct SaveSection *section) { - ReadFlash(sector, 0, section->data, 0x1000); + ReadFlash(sector, 0, section->data, sizeof(struct SaveSection)); return 1; } -u16 sub_8125C10(void *data, u16 size) +u16 CalculateChecksum(void *data, u16 size) { u16 i; u32 checksum = 0; @@ -537,37 +572,37 @@ u16 sub_8125C10(void *data, u16 size) return ((checksum >> 16) + checksum); } -u8 sub_8125C3C(u8 a1) +u8 HandleSavingData(u8 saveType) { u8 i; - switch (a1) + switch (saveType) { - case 5: + case HOF_DELETE_SAVE: // deletes save before HOF case. unused for (i = 28; i < 32; i++) EraseFlashSector(i); - case 3: + case HOF_SAVE: // hall of fame. if (GetGameStat(10) < 999) IncrementGameStat(10); for (i = 0; i < 2; i++) - sub_81253C8(28 + i, gHallOfFameSaveSectionLocations[i].data, gHallOfFameSaveSectionLocations[i].size); + HandleWriteSectorNBytes(28 + i, gHallOfFameSaveSectionLocations[i].data, gHallOfFameSaveSectionLocations[i].size); SaveSerializedGame(); save_write_to_flash(0xFFFF, gSaveSectionLocations); break; - case 0: + case NORMAL_SAVE: // normal save. default: SaveSerializedGame(); save_write_to_flash(0xFFFF, gSaveSectionLocations); break; - case 1: + case LINK_SAVE: // link save. update only the pokemon, i think. SaveSerializedGame(); for (i = 0; i < 5; i++) save_write_to_flash(i, gSaveSectionLocations); break; - case 2: + case EREADER_SAVE: // used in mossdeep "game corner" before/after battling old man e-reader trainer SaveSerializedGame(); save_write_to_flash(0, gSaveSectionLocations); break; - case 4: + case DIFFERENT_FILE_SAVE: // there is a different file, so erase the file and overwrite it completely. for (i = 28; i < 32; i++) EraseFlashSector(i); SaveSerializedGame(); @@ -577,49 +612,49 @@ u8 sub_8125C3C(u8 a1) return 0; } -u8 sub_8125D44(u8 a1) +u8 TrySavingData(u8 saveType) // TrySave { if (gFlashMemoryPresent != TRUE) return 0xFF; - sub_8125C3C(a1); - if (!gUnknown_03005EA8) + HandleSavingData(saveType); + if (!gDamagedSaveSectors) return 1; - DoSaveFailedScreen(a1); + DoSaveFailedScreen(saveType); return 0xFF; } -u8 sub_8125D80(void) +u8 sub_8125D80(void) // trade.s save { if (gFlashMemoryPresent != TRUE) return 1; SaveSerializedGame(); - sub_812546C(gSaveSectionLocations); + RestoreSaveBackupVarsAndIncrement(gSaveSectionLocations); return 0; } -bool8 sub_8125DA8(void) +bool8 sub_8125DA8(void) // trade.s save { - u8 v0 = sub_812550C(14, gSaveSectionLocations); - if (gUnknown_03005EA8) + u8 retVal = sub_812550C(14, gSaveSectionLocations); + if (gDamagedSaveSectors) DoSaveFailedScreen(0); - if (v0 == 0xFF) + if (retVal == 0xFF) return 1; else return 0; } -u8 sub_8125DDC(void) +u8 sub_8125DDC(void) // trade.s save { sub_812556C(14, gSaveSectionLocations); - if (gUnknown_03005EA8) + if (gDamagedSaveSectors) DoSaveFailedScreen(0); return 0; } -u8 sub_8125E04(void) +u8 sub_8125E04(void) // trade.s save { sub_8125758(14, gSaveSectionLocations); - if (gUnknown_03005EA8) + if (gDamagedSaveSectors) DoSaveFailedScreen(0); return 0; } @@ -630,7 +665,7 @@ u8 sub_8125E2C(void) return 1; SaveSerializedGame(); - sub_81254C8(gSaveSectionLocations); + RestoreSaveBackupVars(gSaveSectionLocations); sub_812556C(gUnknown_03005EB4 + 1, gSaveSectionLocations); return 0; } @@ -649,7 +684,7 @@ u8 sub_8125E6C(void) sub_81257F0(val, gSaveSectionLocations); retVal = 1; } - if (gUnknown_03005EA8) + if (gDamagedSaveSectors) DoSaveFailedScreen(1); return retVal; } @@ -671,7 +706,7 @@ u8 sub_8125EC8(u8 a1) result = sub_812587C(0xFFFF, gSaveSectionLocations); LoadSerializedGame(); gSaveFileStatus = result; - gUnknown_03005EBC = 0; + gGameContinueCallback = 0; break; case 3: result = sub_8125B88(28, gHallOfFameSaveSectionLocations[0].data, gHallOfFameSaveSectionLocations[0].size); @@ -688,12 +723,12 @@ bool8 unref_sub_8125F4C(struct UnkSaveSection *a1) u16 i; char *raw = (char *)a1; - for (i = 0; i < 0x1000; i++) + for (i = 0; i < sizeof(struct SaveSection); i++) raw[i] = 0; - ReadFlash(gUnknown_08401E24[0], 0, a1->data, 4096); + ReadFlash(gFlashSectors[0], 0, a1->data, 4096); - if (a1->unknown != 0x8012025) + if (a1->security != UNKNOWN_CHECK_VALUE) return FALSE; return TRUE; @@ -702,10 +737,10 @@ bool8 unref_sub_8125F4C(struct UnkSaveSection *a1) u8 unref_sub_8125FA0(void) { u16 i; - u8 v0 = sub_8125D44(0); + u8 v0 = TrySavingData(0); for (i = 0; i < 2; i++) - EraseFlashSector(gUnknown_08401E24[i]); + EraseFlashSector(gFlashSectors[i]); if (v0 == 255) { @@ -727,25 +762,25 @@ u8 unref_sub_8125FF0(u8 *data, u16 size) u16 i; struct UnkSaveSection *section = (struct UnkSaveSection *)&unk_2000000; - for (i = 0; i < 0x1000; i++) + for (i = 0; i < sizeof(struct SaveSection); i++) ((char *)section)[i] = 0; - section->unknown = 0x8012025; + section->security = UNKNOWN_CHECK_VALUE; for (i = 0; i < size; i++) section->data[i] = data[i]; - gUnknown_02039284 = ProgramFlashSectorAndVerifyNBytes(gUnknown_08401E24[0], (u8 *)section, 0x1000); + gLastSaveSectorStatus = ProgramFlashSectorAndVerifyNBytes(gFlashSectors[0], (u8 *)section, sizeof(struct SaveSection)); - if (gUnknown_02039284) - return 255; + if (gLastSaveSectorStatus) + return 0xFF; else return 1; } u8 unref_sub_8126068(u8 sector, u8 *data, u32 size) { - if (ProgramFlashSectorAndVerify(sector, data, size)) + if (ProgramFlashSectorAndVerify(sector, data)) return 255; else return 1; @@ -753,6 +788,6 @@ u8 unref_sub_8126068(u8 sector, u8 *data, u32 size) u8 unref_sub_8126080(u8 sector, u8 *data) { - ReadFlash(sector, 0, data, 0x1000); + ReadFlash(sector, 0, data, sizeof(struct SaveSection)); return 1; } diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 1e2651aa6..dd0e1b966 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -20,18 +20,19 @@ #define CLOCK_WIN_TOP (MSG_WIN_TOP - 4) -struct SaveFailedStruct +struct SaveFailedClockStruct { - u16 unk0; - u16 unk2; + bool16 clockRunning; + u16 timer; // appears to be unused, the only case its "used" cannot be reached normally + u8 unused[0xE]; // appears to be unused space. alternatively, there could have been multiple clock structs. however, neither of these cases are fulfilled, so the purpose of this space is unknown. one theory is that there is room for 3 more clock structs (2 16-bit values), so its possible GF intended there to be support for link-based save failed screens in case the synchronization failed, or it in fact was present in an earlier build but taken out for reasons. }; extern u8 unk_2000000[]; -extern u16 gUnknown_0203933C; -extern struct SaveFailedStruct gUnknown_0203933E; -extern u32 gUnknown_03005EA8; -extern u32 gUnknown_03005EBC; +extern u16 gSaveFailedType; +extern struct SaveFailedClockStruct gSaveFailedClockInfo; +extern u32 gDamagedSaveSectors; +extern u32 gGameContinueCallback; extern u8 gBirchHelpGfx[]; @@ -44,10 +45,7 @@ extern u8 gSystemText_GameplayEnded[]; extern u8 gBirchGrassTilemap[]; extern u8 gBirchBagTilemap[]; - -extern const u8 gSaveFailedClockGfx[]; -extern const u8 gSaveFailedClockPal[]; -extern u8 gBirchBagGrassPal[]; +extern u8 gBirchBagGrassPal[0x40]; static const struct OamData sClockOamData = { @@ -78,6 +76,9 @@ static const u8 sClockFrames[8][3] = { 5, 1, 0 }, }; +static const u8 gSaveFailedClockPal[] = INCBIN_U8("graphics/misc/clock_small.gbapal"); +static const u8 gSaveFailedClockGfx[] = INCBIN_U8("graphics/misc/clock_small.4bpp.lz"); + static void VBlankCB(void); static void CB2_SaveFailedScreen(void); static void CB2_WipeSave(void); @@ -89,11 +90,11 @@ static bool8 VerifySectorWipe(u16 sector); static bool8 WipeSector(u16 sector); static bool8 WipeSectors(u32 sectorBits); -void DoSaveFailedScreen(u8 var) +void DoSaveFailedScreen(u8 saveType) { SetMainCallback2(CB2_SaveFailedScreen); - gUnknown_0203933C = var; - gUnknown_0203933E.unk0 = 0; + gSaveFailedType = saveType; + gSaveFailedClockInfo.clockRunning = FALSE; } static void VBlankCB(void) @@ -135,8 +136,8 @@ static void CB2_SaveFailedScreen(void) ResetSpriteData(); ResetTasks(); ResetPaletteFade(); - LoadPalette(&gBirchBagGrassPal, 0, 0x40); - LoadPalette(&gSaveFailedClockPal, 0x100, 0x20); + LoadPalette(&gBirchBagGrassPal, 0, sizeof(gBirchBagGrassPal)); + LoadPalette(&gSaveFailedClockPal, 0x100, sizeof(gSaveFailedClockPal)); SetUpWindowConfig(&gWindowConfig_81E6C3C); InitMenuWindow(&gWindowConfig_81E6CE4); MenuDrawTextWindow(13, CLOCK_WIN_TOP, 16, CLOCK_WIN_TOP + 3); // clock window @@ -169,11 +170,11 @@ static void CB2_WipeSave(void) { u8 wipeTries = 0; - gUnknown_0203933E.unk0 = 1; + gSaveFailedClockInfo.clockRunning = TRUE; - while (gUnknown_03005EA8 && wipeTries < 3) + while (gDamagedSaveSectors != 0 && wipeTries < 3) // while there are still attempts left, keep trying to fix the save sectors. { - if (WipeSectors(gUnknown_03005EA8)) + if (WipeSectors(gDamagedSaveSectors) != FALSE) { MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); @@ -183,9 +184,9 @@ static void CB2_WipeSave(void) MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); MenuPrint(gSystemText_CheckCompleteSaveAttempt, 2, MSG_WIN_TOP + 1); - sub_8125C3C(gUnknown_0203933C); + HandleSavingData(gSaveFailedType); - if (gUnknown_03005EA8) + if (gDamagedSaveSectors != 0) { #ifdef BUGFIX_SAVEFAILEDSCREEN2 MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); @@ -206,9 +207,10 @@ static void CB2_WipeSave(void) { MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); - if (!gUnknown_03005EBC) // cant continue game. + // no callback exists, so the game cannot continue. + if (gGameContinueCallback == 0) MenuPrint(gSystemText_SaveCompletedGameEnd, 2, MSG_WIN_TOP + 1); - else // can continue game. + else // callback exists, so continue MenuPrint(gSystemText_SaveCompletedPressA, 2, MSG_WIN_TOP + 1); } @@ -217,7 +219,7 @@ static void CB2_WipeSave(void) static void CB2_GameplayCannotBeContinued(void) { - gUnknown_0203933E.unk0 = 0; + gSaveFailedClockInfo.clockRunning = FALSE; if (gMain.newKeys & A_BUTTON) { @@ -230,13 +232,11 @@ static void CB2_GameplayCannotBeContinued(void) static void CB2_FadeAndReturnToTitleScreen(void) { - u8 zero; - - gUnknown_0203933E.unk0 = zero = 0; + gSaveFailedClockInfo.clockRunning = FALSE; if (gMain.newKeys & A_BUTTON) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, zero, 16, 0); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); SetVBlankCallback(VBlankCB); SetMainCallback2(CB2_ReturnToTitleScreen); } @@ -246,14 +246,14 @@ static void CB2_ReturnToTitleScreen(void) { if (!UpdatePaletteFade()) { - if (!gUnknown_03005EBC) + if (gGameContinueCallback == 0) // no callback exists, so do a soft reset. { DoSoftReset(); } else { - SetMainCallback2((MainCallback)gUnknown_03005EBC); - gUnknown_03005EBC = 0; + SetMainCallback2((MainCallback)gGameContinueCallback); + gGameContinueCallback = 0; } } } @@ -266,7 +266,7 @@ static void VBlankCB_UpdateClockGraphics(void) gMain.oamBuffer[0].x = 112; gMain.oamBuffer[0].y = (CLOCK_WIN_TOP + 1) * 8; - if (gUnknown_0203933E.unk0) + if (gSaveFailedClockInfo.clockRunning != FALSE) { gMain.oamBuffer[0].tileNum = sClockFrames[n][0]; gMain.oamBuffer[0].matrixNum = (sClockFrames[n][2] << 4) | (sClockFrames[n][1] << 3); @@ -278,8 +278,8 @@ static void VBlankCB_UpdateClockGraphics(void) CpuFastCopy(gMain.oamBuffer, (void *)OAM, 4); - if (gUnknown_0203933E.unk2) - gUnknown_0203933E.unk2--; + if (gSaveFailedClockInfo.timer) // maybe was used for debugging? + gSaveFailedClockInfo.timer--; } static bool8 VerifySectorWipe(u16 sector) diff --git a/src/save_menu_util.c b/src/save_menu_util.c index 7790bbb1b..7899fabb1 100644 --- a/src/save_menu_util.c +++ b/src/save_menu_util.c @@ -81,22 +81,18 @@ void PrintSaveMapName(s16 x, s16 y) void PrintSaveBadges(s16 x, s16 y) { char badges[16]; - u8 badgeCount; MenuPrint(gOtherText_Badges, x, y); - badgeCount = GetBadgeCount(); - ConvertIntToDecimalString(badges, badgeCount); + ConvertIntToDecimalString(badges, GetBadgeCount()); MenuPrint_RightAligned(badges, x + 12, y); } void PrintSavePokedexCount(s16 x, s16 y) { char pokedex[16]; - u16 pokedexCount; MenuPrint(gOtherText_Pokedex, x, y); - pokedexCount = GetPokedexSeenCount(); - ConvertIntToDecimalStringN(pokedex, pokedexCount, 1, 3); + ConvertIntToDecimalStringN(pokedex, GetPokedexSeenCount(), 1, 3); MenuPrint_RightAligned(pokedex, x + 12, y); } diff --git a/src/scrcmd.c b/src/scrcmd.c index a13a42e87..b780cc6b4 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -9,6 +9,8 @@ #include "field_effect.h" #include "field_message_box.h" #include "field_player_avatar.h" +#include "field_map_obj_helpers.h" +#include "field_door.h" #include "item.h" #include "main.h" #include "map_obj_lock.h" @@ -23,6 +25,11 @@ #include "sound.h" #include "string_util.h" #include "weather.h" +#include "script_menu.h" +#include "script_pokemon_80F9.h" +#include "script_pokemon_80C4.h" +#include "clock.h" +#include "contest_painting.h" typedef u16 (*SpecialFunc)(void); typedef void (*NativeFunc)(void); diff --git a/src/script_menu.c b/src/script_menu.c index 51230b66b..de3dd7269 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -6,35 +6,576 @@ #include "sound.h" #include "sprite.h" #include "task.h" +#include "strings.h" +#include "script_menu.h" -struct MultichoiceListStruct +// multichoice lists +const struct MenuAction MultichoiceList_00[] = { - struct MenuAction *list; - u8 count; + {(u8 *)OtherText_Petalburg, 0}, + {(u8 *)OtherText_Slateport, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; -extern const struct MultichoiceListStruct gMultichoiceLists[]; +const struct MenuAction MultichoiceList_02[] = +{ + {(u8 *)OtherText_Enter, 0}, + {(u8 *)OtherText_Info3, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; -extern u16 gScriptResult; +const struct MenuAction MultichoiceList_03[] = +{ + {(u8 *)OtherText_WhatsAContest, 0}, + {(u8 *)OtherText_TypesOfContest, 0}, + {(u8 *)OtherText_Ranks, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; -extern void FreeResourcesAndDestroySprite(struct Sprite *sprite); -extern u8 CreateMonSprite_PicBox(u16, s16, s16, u8); -extern u8 sub_80B59AC(void); +const struct MenuAction MultichoiceList_04[] = +{ + {(u8 *)OtherText_CoolContest, 0}, + {(u8 *)OtherText_BeautyContest, 0}, + {(u8 *)OtherText_CuteContest, 0}, + {(u8 *)OtherText_SmartContest, 0}, + {(u8 *)OtherText_ToughContest, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_06[] = +{ + {(u8 *)OtherText_Decoration, 0}, + {(u8 *)OtherText_PackUp, 0}, + {(u8 *)OtherText_Registry, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_05[] = +{ + {(u8 *)OtherText_Decoration, 0}, + {(u8 *)OtherText_PackUp, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_07[] = +{ + {(u8 *)OtherText_Register, 0}, + {(u8 *)OtherText_Registry, 0}, + {(u8 *)OtherText_Information, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_12[] = +{ + {(u8 *)OtherText_Mach, 0}, + {(u8 *)OtherText_Acro, 0}, +}; + +const struct MenuAction MultichoiceList_13[] = +{ + {(u8 *)OtherText_Poison, 0}, + {(u8 *)OtherText_Paralysis, 0}, + {(u8 *)OtherText_Sleep, 0}, + {(u8 *)OtherText_Burn, 0}, + {(u8 *)OtherText_Frozen, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_14[] = +{ + {(u8 *)OtherText_Dewford, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_16[] = +{ + {(u8 *)OtherText_SawIt, 0}, + {(u8 *)OtherText_NotYet, 0}, +}; + +const struct MenuAction MultichoiceList_17[] = +{ + {(u8 *)OtherText_Yes, 0}, + {(u8 *)OtherText_No, 0}, + {(u8 *)OtherText_Info3, 0}, +}; + +const struct MenuAction MultichoiceList_18[] = +{ + {(u8 *)OtherText_SingleBattle, 0}, + {(u8 *)OtherText_DoubleBattle, 0}, + {(u8 *)OtherText_MultiBattle, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_19[] = +{ + {(u8 *)OtherText_Littleroot, 0}, + {(u8 *)OtherText_Slateport, 0}, + {(u8 *)OtherText_Lilycove, 0}, +}; + +const struct MenuAction MultichoiceList_20[] = +{ + {(u8 *)OtherText_Yes, 0}, + {(u8 *)OtherText_No, 0}, + {(u8 *)OtherText_Info3, 0}, +}; + +const struct MenuAction MultichoiceList_23[] = +{ + {(u8 *)OtherText_MakeAChallenge, 0}, + {(u8 *)OtherText_ObtainInformation, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_24[] = +{ + {(u8 *)OtherText_Lv50_2, 0}, + {(u8 *)OtherText_Lv100_2, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_25[] = +{ + {(u8 *)OtherText_Zigzagoon, 0}, + {(u8 *)OtherText_Nincada, 0}, + {(u8 *)OtherText_Poochyena, 0}, +}; + +const struct MenuAction MultichoiceList_26[] = +{ + {(u8 *)OtherText_Nincada2, 0}, + {(u8 *)OtherText_Lotad, 0}, + {(u8 *)OtherText_Roselia, 0}, +}; + +const struct MenuAction MultichoiceList_27[] = +{ + {(u8 *)OtherText_Shroomish, 0}, + {(u8 *)OtherText_Nincada3, 0}, + {(u8 *)OtherText_Surskit, 0}, +}; + +const struct MenuAction MultichoiceList_28[] = +{ + {(u8 *)OtherText_Treecko, 0}, + {(u8 *)OtherText_Torchic, 0}, + {(u8 *)OtherText_Mudkip, 0}, +}; + +const struct MenuAction MultichoiceList_29[] = +{ + {(u8 *)OtherText_Seedot, 0}, + {(u8 *)OtherText_Shroomish2, 0}, + {(u8 *)OtherText_Spinda, 0}, +}; + +const struct MenuAction MultichoiceList_30[] = +{ + {(u8 *)OtherText_Shroomish3, 0}, + {(u8 *)OtherText_Zigzagoon2, 0}, + {(u8 *)OtherText_Wurmple, 0}, +}; + +const struct MenuAction MultichoiceList_31[] = +{ + {(u8 *)OtherText_PokeBall, 0}, + {(u8 *)OtherText_SuperPotion, 0}, + {(u8 *)OtherText_SamePrice, 0}, +}; + +const struct MenuAction MultichoiceList_32[] = +{ + {(u8 *)OtherText_Yen135, 0}, + {(u8 *)OtherText_Yen155, 0}, + {(u8 *)OtherText_Yen175, 0}, +}; + +const struct MenuAction MultichoiceList_33[] = +{ + {(u8 *)OtherText_CostMore, 0}, + {(u8 *)OtherText_CostLess, 0}, + {(u8 *)OtherText_SamePrice2, 0}, +}; + +const struct MenuAction MultichoiceList_34[] = +{ + {(u8 *)OtherText_MaleSymbol, 0}, + {(u8 *)OtherText_FemaleSymbol, 0}, + {(u8 *)OtherText_Neither, 0}, +}; + +const struct MenuAction MultichoiceList_35[] = +{ + {(u8 *)OtherText_Males, 0}, + {(u8 *)OtherText_Females, 0}, + {(u8 *)OtherText_SameNumber, 0}, +}; + +const struct MenuAction MultichoiceList_36[] = +{ + {(u8 *)OtherText_Male, 0}, + {(u8 *)OtherText_Female, 0}, + {(u8 *)OtherText_ItDepends, 0}, +}; + +const struct MenuAction MultichoiceList_37[] = +{ + {(u8 *)OtherText_Six2, 0}, + {(u8 *)OtherText_Eight2, 0}, + {(u8 *)OtherText_Ten, 0}, +}; + +const struct MenuAction MultichoiceList_38[] = +{ + {(u8 *)OtherText_One, 0}, + {(u8 *)OtherText_Two, 0}, + {(u8 *)OtherText_Three, 0}, +}; + +const struct MenuAction MultichoiceList_39[] = +{ + {(u8 *)OtherText_Six, 0}, + {(u8 *)OtherText_Seven, 0}, + {(u8 *)OtherText_Eight, 0}, +}; + +const struct MenuAction MultichoiceList_42[] = +{ + {(u8 *)OtherText_FreshWater, 0}, + {(u8 *)OtherText_SodaPop, 0}, + {(u8 *)OtherText_Lemonade, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_43[] = +{ + {(u8 *)OtherText_HowToRide, 0}, + {(u8 *)OtherText_HowToTurn, 0}, + {(u8 *)OtherText_SandySlopes, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_44[] = +{ + {(u8 *)OtherText_Wheelies, 0}, + {(u8 *)OtherText_BunnyHops, 0}, + {(u8 *)OtherText_Jumping, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_45[] = +{ + {(u8 *)OtherText_Satisfied, 0}, + {(u8 *)OtherText_Dissatisfied, 0}, +}; + +const struct MenuAction MultichoiceList_46[] = +{ + {(u8 *)OtherText_Deepseatooth, 0}, + {(u8 *)OtherText_Deepseascale, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_47[] = +{ + {(u8 *)OtherText_BlueFlute2, 0}, + {(u8 *)OtherText_YellowFlute2, 0}, + {(u8 *)OtherText_RedFlute2, 0}, + {(u8 *)OtherText_WhiteFlute2, 0}, + {(u8 *)OtherText_BlackFlute2, 0}, + {(u8 *)OtherText_GlassChair, 0}, + {(u8 *)OtherText_GlassDesk, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_48[] = +{ + {(u8 *)OtherText_TreeckoDoll, 0}, + {(u8 *)OtherText_TorchicDoll, 0}, + {(u8 *)OtherText_MudkipDoll, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_55[] = +{ + {(u8 *)OtherText_TM32, 0}, + {(u8 *)OtherText_TM29, 0}, + {(u8 *)OtherText_TM35, 0}, + {(u8 *)OtherText_TM24, 0}, + {(u8 *)OtherText_TM13, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_49[] = +{ + {(u8 *)OtherText_50Coins, 0}, + {(u8 *)OtherText_500Coins, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_50[] = +{ + {(u8 *)OtherText_Excellent, 0}, + {(u8 *)OtherText_NotSoHot, 0}, +}; + +const struct MenuAction MultichoiceList_52[] = +{ + {(u8 *)OtherText_Lilycove, 0}, + {(u8 *)OtherText_BattleTower, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_53[] = +{ + {(u8 *)OtherText_Slateport, 0}, + {(u8 *)OtherText_Lilycove, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_54[] = +{ + {(u8 *)OtherText_Right, 0}, + {(u8 *)OtherText_Left, 0}, +}; + +const struct MenuAction MultichoiceList_56[] = +{ + {(u8 *)OtherText_Slateport, 0}, + {(u8 *)OtherText_BattleTower, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_57[] = +{ + {(u8 *)OtherText_1F_2, 0}, + {(u8 *)OtherText_2F_2, 0}, + {(u8 *)OtherText_3F_2, 0}, + {(u8 *)OtherText_4F_2, 0}, + {(u8 *)OtherText_5F_2, 0}, +}; + +const struct MenuAction MultichoiceList_58[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_59[] = +{ + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_60[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_61[] = +{ + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_62[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_63[] = +{ + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_64[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_65[] = +{ + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_66[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_67[] = +{ + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_68[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_69[] = +{ + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_70[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_71[] = +{ + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_72[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_01[] = +{ + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MultichoiceListStruct gMultichoiceLists[] = +{ + {(struct MenuAction *)MultichoiceList_00, 3}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_02, 3}, + {(struct MenuAction *)MultichoiceList_03, 4}, + {(struct MenuAction *)MultichoiceList_04, 6}, + {(struct MenuAction *)MultichoiceList_05, 3}, + {(struct MenuAction *)MultichoiceList_06, 4}, + {(struct MenuAction *)MultichoiceList_07, 4}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_12, 2}, + {(struct MenuAction *)MultichoiceList_13, 6}, + {(struct MenuAction *)MultichoiceList_14, 2}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_16, 2}, + {(struct MenuAction *)MultichoiceList_17, 3}, + {(struct MenuAction *)MultichoiceList_18, 4}, + {(struct MenuAction *)MultichoiceList_19, 3}, + {(struct MenuAction *)MultichoiceList_20, 3}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_23, 3}, + {(struct MenuAction *)MultichoiceList_24, 3}, + {(struct MenuAction *)MultichoiceList_25, 3}, + {(struct MenuAction *)MultichoiceList_26, 3}, + {(struct MenuAction *)MultichoiceList_27, 3}, + {(struct MenuAction *)MultichoiceList_28, 3}, + {(struct MenuAction *)MultichoiceList_29, 3}, + {(struct MenuAction *)MultichoiceList_30, 3}, + {(struct MenuAction *)MultichoiceList_31, 3}, + {(struct MenuAction *)MultichoiceList_32, 3}, + {(struct MenuAction *)MultichoiceList_33, 3}, + {(struct MenuAction *)MultichoiceList_34, 3}, + {(struct MenuAction *)MultichoiceList_35, 3}, + {(struct MenuAction *)MultichoiceList_36, 3}, + {(struct MenuAction *)MultichoiceList_37, 3}, + {(struct MenuAction *)MultichoiceList_38, 3}, + {(struct MenuAction *)MultichoiceList_39, 3}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_42, 4}, + {(struct MenuAction *)MultichoiceList_43, 4}, + {(struct MenuAction *)MultichoiceList_44, 4}, + {(struct MenuAction *)MultichoiceList_45, 2}, + {(struct MenuAction *)MultichoiceList_46, 3}, + {(struct MenuAction *)MultichoiceList_47, 8}, + {(struct MenuAction *)MultichoiceList_48, 4}, + {(struct MenuAction *)MultichoiceList_49, 3}, + {(struct MenuAction *)MultichoiceList_50, 2}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_52, 3}, + {(struct MenuAction *)MultichoiceList_53, 3}, + {(struct MenuAction *)MultichoiceList_54, 2}, + {(struct MenuAction *)MultichoiceList_55, 6}, + {(struct MenuAction *)MultichoiceList_56, 3}, + {(struct MenuAction *)MultichoiceList_57, 5}, + {(struct MenuAction *)MultichoiceList_58, 2}, + {(struct MenuAction *)MultichoiceList_59, 2}, + {(struct MenuAction *)MultichoiceList_60, 3}, + {(struct MenuAction *)MultichoiceList_61, 2}, + {(struct MenuAction *)MultichoiceList_62, 3}, + {(struct MenuAction *)MultichoiceList_63, 3}, + {(struct MenuAction *)MultichoiceList_64, 4}, + {(struct MenuAction *)MultichoiceList_65, 2}, + {(struct MenuAction *)MultichoiceList_66, 3}, + {(struct MenuAction *)MultichoiceList_67, 3}, + {(struct MenuAction *)MultichoiceList_68, 4}, + {(struct MenuAction *)MultichoiceList_69, 3}, + {(struct MenuAction *)MultichoiceList_70, 4}, + {(struct MenuAction *)MultichoiceList_71, 4}, + {(struct MenuAction *)MultichoiceList_72, 5} +}; + +const struct TextStruct gUnknown_083CE048[] = +{ + OtherText_Cool2, + OtherText_Beauty3, + OtherText_Cute2, + OtherText_Smart2, + OtherText_Tough2, + OtherText_Normal, + OtherText_Super, + OtherText_Hyper, + OtherText_Master, + OtherText_Cool3, + OtherText_Beauty4, + OtherText_Cute3, + OtherText_Smart3, + OtherText_Tough3, + OtherText_Items, + OtherText_KeyItems, + OtherText_Balls, + OtherText_TMsHMs, + OtherText_Berries, +}; -extern u8 gPCText_PlayersPC[]; -extern u8 gPCText_SomeonesPC[]; -extern u8 gPCText_HallOfFame[]; -extern u8 gPCText_LogOff[]; -extern u8 gPCText_LanettesPC[]; extern u8 gPCText_WhichPCShouldBeAccessed[]; -void DrawMultichoiceMenu(u8, u8, u8, struct MenuAction *list, u8, u8); -void sub_80B53B4(u8, u8, u8, struct MenuAction *list, u8); -void sub_80B52B4(u8); -void sub_80B5230(u8, u8, u8, u8, u8, u8); -void task_yes_no_maybe(u8); -void sub_80B5684(u8); -void CreatePCMenu(void); +extern u16 gScriptResult; + +// field_effect +extern void FreeResourcesAndDestroySprite(struct Sprite *sprite); +extern u8 CreateMonSprite_PicBox(u16, s16, s16, u8); bool8 sub_80B5054(u8 left, u8 top, u8 var3, u8 var4) { @@ -60,7 +601,7 @@ bool8 sub_80B50B0(u8 left, u8 top, u8 var3, u8 var4, u8 var5) } } -u16 GetStringWidthInTilesForScriptMenu(u8 *str) +u16 GetStringWidthInTilesForScriptMenu(const u8 *str) { // each tile on screen is 8x8, so it needs the number of tiles and not pixels, hence the division by 8. return (GetStringWidthGivenWindowConfig((struct WindowConfig *)&gWindowConfig_81E6CE4, str) + 7) / 8; diff --git a/src/script_movement.c b/src/script_movement.c index 781235986..dcd772d5f 100644 --- a/src/script_movement.c +++ b/src/script_movement.c @@ -1,6 +1,7 @@ #include "global.h" #include "asm.h" #include "task.h" +#include "field_map_obj_helpers.h" extern const u32 gBitTable[]; extern u8 *gUnknown_020384F8[]; diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c new file mode 100644 index 000000000..ba1545861 --- /dev/null +++ b/src/script_pokemon_util_80C4BF0.c @@ -0,0 +1,722 @@ +#include "global.h" +#include "contest.h" +#include "rom4.h" +#include "main.h" +#include "battle.h" +#include "event_data.h" +#include "pokemon.h" +#include "task.h" +#include "menu.h" +#include "decompress.h" +#include "link.h" +#include "rng.h" +#include "pokedex.h" +#include "asm.h" +#include "species.h" +#include "berry.h" +#include "items.h" +#include "load_save.h" +#include "script_pokemon_80C4.h" + +#define CONTEST_ENTRY_PIC_LEFT 10 +#define CONTEST_ENTRY_PIC_TOP 3 + +extern const struct SpriteSheet gMonFrontPicTable[]; +extern struct MonCoords gMonFrontPicCoords[]; + +extern void sub_80C46EC(void); +extern void sub_80C4740(void); +extern void sub_80C48F4(void); +extern void sub_80B2A7C(u8); +extern void sub_80AAF30(void); // matsuda debug? +extern u8 sub_80B2C4C(u8, u8); +extern void CB2_ContestPainting(void); +extern void sub_8042044(struct Pokemon *mon, u16, u8); +extern void sub_8121E10(void); +extern void sub_8121E34(void); + +extern void *gUnknown_081FAF4C[]; +extern struct SpriteTemplate gUnknown_02024E8C; +extern struct SpritePalette *sub_80409C8(u16, u32, u32); + +extern u8 gContestPlayerMonIndex; +extern u8 gIsLinkContest; +extern u8 gPlayerPartyCount; +extern u8 gSelectedOrderFromParty[]; + +extern u16 gSpecialVar_0x8004; +extern u16 gSpecialVar_0x8005; +extern u16 gSpecialVar_0x8006; + +extern u16 gScriptContestCategory; +extern u16 gScriptContestRank; +extern u16 gScriptResult; + +extern u32 gUnknown_03005D28; + +extern u8 gUnknown_02038694; +extern u8 gUnknown_0203856C; +extern u8 gUnknown_02038690[]; +extern u16 gUnknown_02038678[]; + +void sub_80C4BF0(void) +{ + gSaveBlock1.vars[0x10] = gContestMons[0].unk16; + gSaveBlock1.vars[0x11] = gContestMons[1].unk16; + gSaveBlock1.vars[0x12] = gContestMons[2].unk16; +} + +void sub_80C4C28(void) +{ + u16 var; + u8 specialVar = gSpecialVar_0x8005; + + switch(specialVar) + { + case 0: + var = 3; + break; + case 1: + var = 4; + break; + case 2: + var = 5; + break; + default: + var = 100; + break; + } + gSpecialVar_0x8004 = var; +} + +void sub_80C4C64(void) +{ + sub_80C46EC(); + sub_80C4740(); + sub_80C48F4(); +} + +void sub_80C4C78(void) +{ + u16 var; + u16 returnVar; + + switch(gScriptContestCategory) + { + case 0: + var = 8; + break; + case 1: + var = 9; + break; + case 2: + var = 10; + break; + case 3: + var = 11; + break; + case 4: + default: + var = 12; + break; + } + + returnVar = gSaveBlock1.sbStruct.unkSB2.sb1_2EFC_struct2[var].var; + + if(returnVar == 0) + gSpecialVar_0x8004 = returnVar; + else + gSpecialVar_0x8004 = 1; +} + +void sub_80C4CEC(void) +{ + sub_80B2A7C(0xFF); +} + +void sub_80C4CF8(void) +{ + if(!gUnknown_02038690[gContestPlayerMonIndex] + && gScriptContestRank == 3 + && (s16)gUnknown_02038678[gContestPlayerMonIndex] >= 800) + { + gSpecialVar_0x8004 = 1; + } + else + { + gSpecialVar_0x8004 = 0; + } +} + +u8 sub_80C4D50(void) +{ + u8 retVar = 0; + int i; + + for (i = 0; i < 5; i++) + if (gSaveBlock1.sbStruct.unkSB2.sb1_2EFC_struct2[i + 8].var) + retVar++; + + return retVar; +} + +// nope. too hard +__attribute__((naked)) +void sub_80C4D80(void) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x8\n\ + ldr r0, _080C4EA0 @ =gUnknown_02038670\n\ + mov r12, r0\n\ + ldr r1, _080C4EA4 @ =gSpecialVar_0x8006\n\ + mov r8, r1\n\ + ldr r2, _080C4EA8 @ =gStringVar1\n\ + mov r9, r2\n\ + mov r2, r12\n\ + mov r1, sp\n\ + movs r6, 0x3\n\ +_080C4D9E:\n\ + ldrh r0, [r2]\n\ + strh r0, [r1]\n\ + adds r2, 0x2\n\ + adds r1, 0x2\n\ + subs r6, 0x1\n\ + cmp r6, 0\n\ + bge _080C4D9E\n\ + movs r6, 0\n\ +_080C4DAE:\n\ + movs r1, 0x3\n\ + cmp r1, r6\n\ + ble _080C4DD8\n\ +_080C4DB4:\n\ + subs r4, r1, 0x1\n\ + lsls r0, r4, 1\n\ + mov r5, sp\n\ + adds r3, r5, r0\n\ + lsls r0, r1, 1\n\ + adds r2, r5, r0\n\ + ldrh r5, [r3]\n\ + movs r7, 0\n\ + ldrsh r1, [r3, r7]\n\ + movs r7, 0\n\ + ldrsh r0, [r2, r7]\n\ + cmp r1, r0\n\ + bge _080C4DD2\n\ + strh r5, [r2]\n\ + strh r0, [r3]\n\ +_080C4DD2:\n\ + adds r1, r4, 0\n\ + cmp r1, r6\n\ + bgt _080C4DB4\n\ +_080C4DD8:\n\ + adds r6, 0x1\n\ + cmp r6, 0x2\n\ + ble _080C4DAE\n\ + mov r2, r8\n\ + ldrh r0, [r2]\n\ + lsls r0, 1\n\ + add r0, sp\n\ + ldrh r0, [r0]\n\ + movs r2, 0\n\ + movs r7, 0\n\ + movs r6, 0\n\ + lsls r0, 16\n\ + asrs r4, r0, 16\n\ + adds r3, r0, 0\n\ + mov r1, sp\n\ +_080C4DF6:\n\ + movs r5, 0\n\ + ldrsh r0, [r1, r5]\n\ + cmp r0, r4\n\ + bne _080C4E12\n\ + lsls r0, r2, 24\n\ + movs r2, 0x80\n\ + lsls r2, 17\n\ + adds r0, r2\n\ + lsrs r2, r0, 24\n\ + mov r5, r8\n\ + ldrh r5, [r5]\n\ + cmp r6, r5\n\ + bne _080C4E12\n\ + adds r7, r2, 0\n\ +_080C4E12:\n\ + adds r1, 0x2\n\ + adds r6, 0x1\n\ + cmp r6, 0x3\n\ + ble _080C4DF6\n\ + movs r6, 0\n\ + mov r0, sp\n\ + movs r1, 0\n\ + ldrsh r0, [r0, r1]\n\ + asrs r1, r3, 16\n\ + lsls r2, 24\n\ + mov r10, r2\n\ + cmp r0, r1\n\ + beq _080C4E40\n\ + adds r2, r1, 0\n\ + mov r1, sp\n\ +_080C4E30:\n\ + adds r1, 0x2\n\ + adds r6, 0x1\n\ + cmp r6, 0x3\n\ + bgt _080C4E40\n\ + movs r4, 0\n\ + ldrsh r0, [r1, r4]\n\ + cmp r0, r2\n\ + bne _080C4E30\n\ +_080C4E40:\n\ + lsls r0, r6, 24\n\ + lsrs r4, r0, 24\n\ + adds r2, r7, 0\n\ + movs r6, 0\n\ + asrs r5, r3, 16\n\ + mov r8, r5\n\ + mov r1, r12\n\ + movs r5, 0\n\ + ldrsh r0, [r1, r5]\n\ + cmp r8, r0\n\ + bne _080C4E60\n\ + cmp r7, 0x1\n\ + beq _080C4E78\n\ +_080C4E5A:\n\ + subs r0, r2, 0x1\n\ + lsls r0, 24\n\ + lsrs r2, r0, 24\n\ +_080C4E60:\n\ + adds r6, 0x1\n\ + cmp r6, 0x3\n\ + bgt _080C4E78\n\ + lsls r0, r6, 1\n\ + add r0, r12\n\ + asrs r1, r3, 16\n\ + movs r5, 0\n\ + ldrsh r0, [r0, r5]\n\ + cmp r1, r0\n\ + bne _080C4E60\n\ + cmp r2, 0x1\n\ + bne _080C4E5A\n\ +_080C4E78:\n\ + lsls r1, r6, 24\n\ + lsrs r1, 24\n\ + mov r0, r9\n\ + bl sub_80C4698\n\ + ldr r0, _080C4EAC @ =gIsLinkContest\n\ + ldrb r1, [r0]\n\ + movs r0, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080C4EB8\n\ + ldr r0, _080C4EB0 @ =gStringVar2\n\ + lsls r1, r6, 3\n\ + subs r1, r6\n\ + lsls r1, 2\n\ + ldr r2, _080C4EB4 @ =gLinkPlayers + 0x8\n\ + adds r1, r2\n\ + bl sub_80C4674\n\ + b _080C4EC4\n\ + .align 2, 0\n\ +_080C4EA0: .4byte gUnknown_02038670\n\ +_080C4EA4: .4byte gSpecialVar_0x8006\n\ +_080C4EA8: .4byte gStringVar1\n\ +_080C4EAC: .4byte gIsLinkContest\n\ +_080C4EB0: .4byte gStringVar2\n\ +_080C4EB4: .4byte gLinkPlayers + 0x8\n\ +_080C4EB8:\n\ + ldr r0, _080C4ED8 @ =gStringVar2\n\ + lsls r1, r6, 6\n\ + ldr r2, _080C4EDC @ =gUnknown_0203857D\n\ + adds r1, r2\n\ + bl sub_80C4674\n\ +_080C4EC4:\n\ + mov r1, r10\n\ + asrs r0, r1, 24\n\ + cmp r0, 0x1\n\ + beq _080C4ED0\n\ + cmp r7, r0\n\ + bne _080C4EE4\n\ +_080C4ED0:\n\ + ldr r0, _080C4EE0 @ =gSpecialVar_0x8006\n\ + strh r4, [r0]\n\ + b _080C4EEA\n\ + .align 2, 0\n\ +_080C4ED8: .4byte gStringVar2\n\ +_080C4EDC: .4byte gUnknown_0203857D\n\ +_080C4EE0: .4byte gSpecialVar_0x8006\n\ +_080C4EE4:\n\ + ldr r1, _080C4EFC @ =gSpecialVar_0x8006\n\ + adds r0, r4, 0x4\n\ + strh r0, [r1]\n\ +_080C4EEA:\n\ + add sp, 0x8\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ +_080C4EFC: .4byte gSpecialVar_0x8006\n\ + .syntax divided"); +} + +void ShowContestWinnerCleanup(void) +{ + SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music); +} + +void ShowContestWinner(void) +{ + if(gUnknown_0203856C) + { + sub_80AAF30(); + BATTLE_STRUCT->unk15DDF = 1; + BATTLE_STRUCT->unk15DDE = sub_80B2C4C(254, 0); + sub_80B2A7C(3); + gUnknown_0203856C = 0; + } + SetMainCallback2(CB2_ContestPainting); + gMain.savedCallback = ShowContestWinnerCleanup; +} + +void sub_80C4F70(void) +{ + VarSet(0x4010, gContestMons[0].unk16); + VarSet(0x4011, gContestMons[1].unk16); + VarSet(0x4012, gContestMons[2].unk16); + VarSet(0x4013, gContestMons[3].unk16); +} + +bool8 GiveMonArtistRibbon(void) +{ + u8 ribbon = GetMonData(&gPlayerParty[gUnknown_02038694], MON_DATA_ARTIST_RIBBON); + + if(ribbon == FALSE + && gUnknown_02038690[gContestPlayerMonIndex] == 0 + && gScriptContestRank == 3 + && (s16)gUnknown_02038678[gContestPlayerMonIndex] >= 800) + { + ribbon = TRUE; + SetMonData(&gPlayerParty[gUnknown_02038694], MON_DATA_ARTIST_RIBBON, &ribbon); + return TRUE; + } + else + { + return FALSE; + } +} + +u8 sub_80C5044(void) +{ + return gUnknown_0203856C; +} + +void ShowContestEntryMonPic(void) +{ + struct SpritePalette *paletteData; + u32 var1, var2; + u16 species; + u8 spriteId; + u8 taskId; + + if(FindTaskIdByFunc(sub_80C5190) == 0xFF) + { + u8 left = CONTEST_ENTRY_PIC_LEFT; + u8 top = CONTEST_ENTRY_PIC_TOP; + + MenuDrawTextWindow(left, top, 19, 13); + species = gContestMons[gSpecialVar_0x8006].species; + var1 = gContestMons[gSpecialVar_0x8006].unk38; // v2 + var2 = gContestMons[gSpecialVar_0x8006].unk3C; // v3 + taskId = CreateTask(sub_80C5190, 0x50); + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = species; + HandleLoadSpecialPokePic((struct SpriteSheet *)&gMonFrontPicTable[species].data, + gMonFrontPicCoords[species].x, gMonFrontPicCoords[species].y, + (u32)gUnknown_081FAF4C[0], gUnknown_081FAF4C[1], species, var1); + paletteData = sub_80409C8(species, var2, var1); + LoadCompressedObjectPalette(paletteData); + GetMonSpriteTemplate_803C56C(species, 1); + gUnknown_02024E8C.paletteTag = paletteData->tag; + spriteId = CreateSprite(&gUnknown_02024E8C, 0x78, 0x40, 0); + gTasks[taskId].data[2] = spriteId; + gTasks[taskId].data[3] = left; + gTasks[taskId].data[4] = top; + gSprites[spriteId].callback = SpriteCallbackDummy; + gSprites[spriteId].oam.priority = 0; + } +} + +void sub_80C5164(void) +{ + u8 taskId = FindTaskIdByFunc(sub_80C5190); + + if(taskId != 0xFF) + gTasks[taskId].data[0]++; +} + +void sub_80C5190(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + struct Sprite *sprite; + + switch(task->data[0]) + { + case 2: + sprite = &gSprites[task->data[2]]; + FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(sprite->oam.paletteNum)); + + if(sprite->oam.affineMode) + FreeOamMatrix(sprite->oam.matrixNum); + + DestroySprite(sprite); + task->data[0]++; + break; + case 0: + task->data[0]++; + break; + case 3: + MenuZeroFillWindowRect(task->data[3], task->data[4], task->data[3] + 9, task->data[4] + 10); + DestroyTask(taskId); + break; + case 1: + default: + break; + } +} + +void ScriptGetMultiplayerId(void) +{ + if(gIsLinkContest & 1) + gScriptResult = GetMultiplayerId(); + else + gScriptResult = 4; +} + +void ScriptRandom(void) +{ + u16 random; + u16 *scriptPtr; + + if(gIsLinkContest & 1) + { + gUnknown_03005D28 = 1103515245 * gUnknown_03005D28 + 24691; + random = gUnknown_03005D28 >> 16; + scriptPtr = &gScriptResult; + } + else + { + scriptPtr = &gScriptResult; + random = Random(); + } + *scriptPtr = random % *scriptPtr; +} + +void HealPlayerParty(void) +{ + u8 i, j; + u8 ppBonuses; + u8 arg[4]; + + // restore HP. + for(i = 0; i < gPlayerPartyCount; i++) + { + u16 maxHP = GetMonData(&gPlayerParty[i], MON_DATA_MAX_HP); + arg[0] = maxHP; + arg[1] = maxHP >> 8; + SetMonData(&gPlayerParty[i], MON_DATA_HP, arg); + ppBonuses = GetMonData(&gPlayerParty[i], MON_DATA_PP_BONUSES); + + // restore PP. + for(j = 0; j < 4; j++) + { + arg[0] = CalculatePPWithBonus(GetMonData(&gPlayerParty[i], MON_DATA_MOVE1 + j), ppBonuses, j); + SetMonData(&gPlayerParty[i], MON_DATA_PP1 + j, arg); + } + + // since status is u32, the four 0 assignments here are probably for safety to prevent undefined data from reaching SetMonData. + arg[0] = 0; + arg[1] = 0; + arg[2] = 0; + arg[3] = 0; + SetMonData(&gPlayerParty[i], MON_DATA_STATUS, arg); + } +} + +u8 ScriptGiveMon(u16 species, u8 var, u16 item, u32 var3, u32 var4, u8 var5) +{ + u16 nationalSpecies; + int sentToPc; + u8 array[2]; + struct Pokemon mon; + + CreateMon(&mon, species, var, 32, 0, 0, 0, 0); + array[0] = item; + array[1] = item >> 8; + SetMonData(&mon, MON_DATA_HELD_ITEM, array); + sentToPc = GiveMonToPlayer(&mon); + nationalSpecies = SpeciesToNationalPokedexNum(species); + + // nested if check to fool compiler + if(sentToPc < 2) + { + if(sentToPc >= 0) + { + // set both the seen and caught flags + sub_8090D90(nationalSpecies, 2); + sub_8090D90(nationalSpecies, 3); + } + } + return sentToPc; +} + +u8 ScriptGiveEgg(u16 value) +{ + struct Pokemon mon; + u8 data; + + sub_8042044(&mon, value, 1); + data = 1; + SetMonData(&mon, MON_DATA_IS_EGG, &data); + + return GiveMonToPlayer(&mon); +} + +void CheckForAlivePartyMons(void) +{ + u8 var = sub_803DAA0(); + + switch(var) + { + case 1: + gScriptResult = var; + break; + case 0: + gScriptResult = var; + break; + case 2: + gScriptResult = var; + break; + } +} + +bool8 CheckPartyMonHasHeldItem(u16 item) +{ + int i; + + for(i = 0; i < 6; i++) + { + u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2); + if(species != SPECIES_NONE && species != SPECIES_EGG && GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM) == item) + return TRUE; + } + return FALSE; +} + +bool8 GetNameOfEnigmaBerryInPlayerParty(void) +{ + bool8 hasItem = CheckPartyMonHasHeldItem(ITEM_ENIGMA_BERRY); + + if(hasItem == TRUE) + GetBerryNameByBerryType(ItemIdToBerryType(ITEM_ENIGMA_BERRY), gStringVar1); + + return hasItem; +} + +void ScriptWildBattle(u16 species, u8 level, u16 item) +{ + u8 data[2]; + + ZeroEnemyPartyMons(); + CreateMon(&gEnemyParty[0], species, level, 0x20, 0, 0, 0, 0); + + if(item) + { + data[0] = item; + data[1] = item >> 8; + SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, data); + } +} + +void ScriptSetMonMoveSlot(u8 monIndex, u16 move, u8 slot) +{ + if(monIndex > 6) + monIndex = gPlayerPartyCount - 1; + + SetMonMoveSlot(&gPlayerParty[monIndex], move, slot); +} + +void sub_80C5568(void) +{ + gMain.savedCallback = sub_80C5580; + sub_8121E10(); +} + +void sub_80C5580(void) +{ + u8 var = gSelectedOrderFromParty[0]; + + switch(var) + { + case 0: + gScriptResult = 0; + break; + default: + gScriptResult = 1; + break; + } + + SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music); +} + +void ChooseBattleTowerPlayerParty(void) +{ + gMain.savedCallback = SetBattleTowerPlayerParty; + sub_8121E34(); +} + +void SetBattleTowerPlayerParty(void) +{ + u8 var = gSelectedOrderFromParty[0]; + + switch(var) + { + case 0: // player quit battle tower? + LoadPlayerParty(); + gScriptResult = 0; + break; + default: // load battle tower. + ReducePlayerPartyToThree(); + gScriptResult = 1; + break; + } + + SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music); +} + +void ReducePlayerPartyToThree(void) +{ + struct Pokemon party[3]; + int i; + + CpuFill32(0, party, sizeof party); + + // copy the selected pokemon according to the order. + for(i = 0; i < 3; i++) + if(gSelectedOrderFromParty[i]) // as long as the order keeps going (did the player select 1 mon? 2? 3?), do not stop + party[i] = gPlayerParty[gSelectedOrderFromParty[i] - 1]; // index is 0 based, not literal + + // delete the last 3 pokemon + CpuFill32(0, gPlayerParty, sizeof gPlayerParty); + + // overwrite the first 3 with the order copied to. + for(i = 0; i < 3; i++) + gPlayerParty[i] = party[i]; + + CalculatePlayerPartyCount(); +} diff --git a/src/script_pokemon_util_80F99CC.c b/src/script_pokemon_util_80F99CC.c index 5e57ef84b..1a848c665 100644 --- a/src/script_pokemon_util_80F99CC.c +++ b/src/script_pokemon_util_80F99CC.c @@ -9,6 +9,7 @@ #include "pokemon.h" #include "text.h" #include "string_util.h" +#include "script_pokemon_80F9.h" extern u8 gPlayerPartyCount; extern u16 gSpecialVar_0x8004; @@ -36,18 +37,6 @@ extern void sub_8123138(u8); extern u8 sub_8040574(struct Pokemon *party); extern void sub_809D9F0(struct Pokemon *party, u8, u8, void *, u32); -void sub_80F9A8C(u8); -void sub_80F9C00(void); -void sub_80F9E1C(void); - -struct UnknownStruct2018000 -{ - u8 filler0[0x8]; - u8 unk8; -}; - -extern struct UnknownStruct2018000 unk_2018000; - void sub_80F99CC(void) { u8 taskId; diff --git a/src/start_menu.c b/src/start_menu.c index 9c10c4cae..d1344ce90 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -22,6 +22,7 @@ #include "task.h" #include "trainer_card.h" #include "weather.h" +#include "field_map_obj_helpers.h" //Menu actions enum { @@ -41,7 +42,7 @@ static u8 (*saveDialogCallback)(void); static u8 saveDialogTimer; //Number of frames to keep the window on screen after save was completed static bool8 savingComplete; -extern bool8 gUnknown_020297EC; +extern bool8 gDifferentSaveFile; extern u16 gSaveFileStatus; extern u16 gScriptResult; extern u8 (*gCallback_03004AE8)(void); @@ -586,7 +587,6 @@ static u8 SaveDialogCB_DisplayConfirmMessage(void) { MenuZeroFillScreen(); HandleDrawSaveWindowInfo(0, 0); - //"Would you like to save the game?" DisplaySaveMessageWithCallback(gSaveText_WouldYouLikeToSave, SaveDialogCB_DisplayConfirmYesNoMenu); return SAVE_IN_PROGRESS; } @@ -608,7 +608,7 @@ static u8 SaveDialogCB_ProcessConfirmYesNoMenu(void) { case 0: case 2: - if (gUnknown_020297EC == FALSE) + if (gDifferentSaveFile == FALSE) { saveDialogCallback = SaveDialogCB_SaveFileExists; return SAVE_IN_PROGRESS; @@ -632,7 +632,7 @@ static u8 SaveDialogCB_ProcessConfirmYesNoMenu(void) static u8 SaveDialogCB_SaveFileExists(void) { DisplaySaveMessageWithCallback( - gUnknown_020297EC == TRUE ? gSaveText_ThereIsADifferentFile : gSaveText_ThereIsAlreadyAFile, + gDifferentSaveFile == TRUE ? gSaveText_ThereIsADifferentFile : gSaveText_ThereIsAlreadyAFile, SaveDialogCB_DisplayOverwriteYesNoMenu); return SAVE_IN_PROGRESS; } @@ -670,20 +670,20 @@ static u8 SaveDialogCB_DisplaySavingMessage(void) static u8 SaveDialogCB_DoSave(void) { - u8 a; + bool8 saveSucceeded; IncrementGameStat(0); - if (gUnknown_020297EC == TRUE) + if (gDifferentSaveFile == TRUE) { - a = sub_8125D44(4); - gUnknown_020297EC = FALSE; + saveSucceeded = TrySavingData(DIFFERENT_FILE_SAVE); + gDifferentSaveFile = FALSE; } else { - a = sub_8125D44(0); + saveSucceeded = TrySavingData(NORMAL_SAVE); } - if (a == 1) + if (saveSucceeded == TRUE) { //"(Player) saved the game." DisplaySaveMessageWithCallback(gSaveText_PlayerSavedTheGame, SaveDialogCB_SaveSuccess); diff --git a/src/strings.c b/src/strings.c new file mode 100644 index 000000000..fed0c86e2 --- /dev/null +++ b/src/strings.c @@ -0,0 +1,923 @@ +#include "global.h" + +// placeholder strings +const u8 gExpandedPlaceholder_Empty[] = _(""); +const u8 gExpandedPlaceholder_Kun[] = _(""); +const u8 gExpandedPlaceholder_Chan[] = _(""); +const u8 gExpandedPlaceholder_Sapphire[] = _("SAPPHIRE"); +const u8 gExpandedPlaceholder_Ruby[] = _("RUBY"); +const u8 gExpandedPlaceholder_Aqua[] = _("AQUA"); +const u8 gExpandedPlaceholder_Magma[] = _("MAGMA"); +const u8 gExpandedPlaceholder_Archie[] = _("ARCHIE"); +const u8 gExpandedPlaceholder_Maxie[] = _("MAXIE"); +const u8 gExpandedPlaceholder_Kyogre[] = _("KYOGRE"); +const u8 gExpandedPlaceholder_Groudon[] = _("GROUDON"); +const u8 gExpandedPlaceholder_Brendan[] = _("BRENDAN"); +const u8 gExpandedPlaceholder_May[] = _("MAY"); + +// system text +const u8 gSystemText_Egg[] = _("EGG"); +const u8 gSystemText_Pokemon2[] = _("POKéMON"); + +// main menu text +const u8 gMainMenuString_NewGame[] = _("NEW GAME"); +const u8 gMainMenuString_Continue[] = _("CONTINUE"); +const u8 gMainMenuString_Option[] = _("OPTION"); +const u8 gMainMenuString_MysteryEvents[] = _("MYSTERY EVENTS"); + +// system text 2 +const u8 SystemText_UpdatingSaveExternal[] = _("Updating save file using external\ndata. Please wait."); +const u8 SystemText_SaveUpdated[] = _("The save file has been updated."); +const u8 SystemText_SaveUpdatedExchangeBackup[] = _("The save file has been updated.\pFurther game data cannot be saved\nto the backup memory.\pPlease exchange the backup memory.\pFor details, please contact the\nNintendo Service Center."); +const u8 SystemText_SaveNotUpdated[] = _("The save file could not be updated.\pPlease exchange the backup\nmemory.\pFor details, please contact the\nNintendo Service Center."); + +// save file text +const u8 gSaveFileCorruptMessage[] = _("The save file is corrupt. The\nprevious save file will be loaded."); +const u8 gSaveFileDeletedMessage[] = _(" The save file has been deleted..."); + +// system text 3 +const u8 gBoardNotInstalledMessage[] = _("The 1M sub-circuit board is\nnot installed."); +const u8 gBatteryDryMessage[] = _("The internal battery has run dry.\nThe game can be played.\pHowever, clock-based events will\nno longer occur."); + +// main menu text 2 +const u8 gMainMenuString_Player[] = _("PLAYER"); +const u8 gMainMenuString_Pokedex[] = _("POKéDEX"); +const u8 gMainMenuString_Time[] = _("TIME"); +const u8 gMainMenuString_Badges[] = _("BADGES"); + +// birch text +const u8 gBirchText_Boy[] = _("BOY"); +const u8 gBirchText_Girl[] = _("GIRL"); +const u8 gBirchText_NewName[] = _("NEW NAME"); + +#ifdef SAPPHIRE +const u8 gDefaultBoyName1[] = _("SEAN"); +#else +const u8 gDefaultBoyName1[] = _("LANDON"); +#endif +const u8 gDefaultBoyName2[] = _("TERRY"); +const u8 gDefaultBoyName3[] = _("SETH"); +const u8 gDefaultBoyName4[] = _("TOM"); + +#ifdef SAPPHIRE +const u8 gDefaultGirlName1[] = _("MARINA"); +#else +const u8 gDefaultGirlName1[] = _("TERRA"); +#endif +const u8 gDefaultGirlName2[] = _("KIMMY"); +const u8 gDefaultGirlName3[] = _("NICOLA"); +const u8 gDefaultGirlName4[] = _("SARA"); + +const u8 gSystemText_IntroWeCall[] = _("This is what we call\na POKéMON."); +const u8 gSystemText_NewPara[] = _("\p"); + +const u8 gDexText_UnknownPoke[] = _(" ????? POKéMON"); +const u8 gDexText_UnknownHeight[] = _("{CLEAR_TO 0x0C}??’??”"); +const u8 gDexText_UnknownWeight[] = _("????.? lbs.$"); // extra terminator? +const u8 gDexText_CryOf[] = _("{CLEAR_TO 2}CRY OF$"); // extra terminator? +const u8 gDexText_SizeComparedTo[] = _("SIZE COMPARED TO "); +const u8 gDexText_RegisterComplete[] = _("POKéDEX registration completed."); +const u8 gDexText_Searching[] = _("Searching...\nPlease wait."); +const u8 gDexText_SearchComplete[] = _("Search completed."); +const u8 gDexText_NoMatching[] = _("No matching POKéMON were found."); + +const u8 DexText_SearchForPoke[] = _("Search for POKéMON based on\nselected parameters."); +const u8 DexText_SwitchDex[] = _("Switch POKéDEX listings."); +const u8 DexText_ReturnToDex[] = _("Return to the POKéDEX."); +const u8 DexText_SelectDexMode[] = _("Select the POKéDEX mode."); +const u8 DexText_SelectDexList[] = _("Select the POKéDEX listing mode."); +const u8 DexText_ListByABC[] = _("List by the first letter in the name.\n/Spotted POKéMON only."); +const u8 DexText_ListByColor[] = _("List by body color.\n/Spotted POKéMON only."); +const u8 DexText_ListByType[] = _("List by type.\n/Owned POKéMON only."); +const u8 DexText_ExecuteSearchSwitch[] = _("Execute search/switch."); +const u8 DexText_HoennDex[] = _("HOENN DEX"); +const u8 DexText_NationalDex[] = _("NATIONAL DEX"); +const u8 DexText_NumericalMode[] = _("NUMERICAL MODE"); +const u8 DexText_ABCMode[] = _("A TO Z MODE"); +const u8 DexText_HeaviestMode[] = _("HEAVIEST MODE"); +const u8 DexText_LightestMode[] = _("LIGHTEST MODE"); +const u8 DexText_TallestMode[] = _("TALLEST MODE"); +const u8 DexText_SmallestMode[] = _("SMALLEST MODE"); +const u8 DexText_ABC[] = _("ABC"); +const u8 DexText_DEF[] = _("DEF"); +const u8 DexText_GHI[] = _("GHI"); +const u8 DexText_JKL[] = _("JKL"); +const u8 DexText_MNO[] = _("MNO"); +const u8 DexText_PQR[] = _("PQR"); +const u8 DexText_STU[] = _("STU"); +const u8 DexText_VWX[] = _("VWX"); +const u8 DexText_YZ[] = _("YZ"); +const u8 DexText_Red[] = _("RED"); +const u8 DexText_Blue[] = _("BLUE"); +const u8 DexText_Yellow[] = _("YELLOW"); +const u8 DexText_Green[] = _("GREEN"); +const u8 DexText_Black[] = _("BLACK"); +const u8 DexText_Brown[] = _("BROWN"); +const u8 DexText_Purple[] = _("PURPLE"); +const u8 DexText_Gray[] = _("GRAY"); +const u8 DexText_White[] = _("WHITE"); +const u8 DexText_Pink[] = _("PINK"); +const u8 DexText_HoennDex2[] = _("HOENN region’s POKéDEX"); +const u8 DexText_NationalDex2[] = _("National edition POKéDEX"); +const u8 DexText_ListByNumber[] = _("POKéMON are listed according to their\nnumber."); +const u8 DexText_ListByABC2[] = _("Spotted and owned POKéMON are listed\nalphabetically."); +const u8 DexText_ListByHeavyToLightest[] = _("Owned POKéMON are listed from the\nheaviest to the lightest."); +const u8 DexText_ListByLightToHeaviest[] = _("Owned POKéMON are listed from the\nlightest to the heaviest."); +const u8 DexText_ListByTallToSmallest[] = _("Owned POKéMON are listed from the\ntallest to the smallest."); +const u8 DexText_ListBySmallToTallest[] = _("Owned POKéMON are listed from the\nsmallest to the tallest."); +const u8 DexText_Terminator5[] = _(""); +const u8 DexText_DontSpecify[] = _("DON’T SPECIFY."); +const u8 DexText_None[] = _("NONE"); +const u8 DexText_RightPointingTriangle[] = _("▶"); // right pointing triangle +const u8 DexText_Terminator6[] = _(" "); + +const u8 gMenuText_WelcomeToHOFAndDexRating[] = _("Welcome to the HALL OF FAME!$Spotted POKéMON: {STR_VAR_1}!\nOwned POKéMON: {STR_VAR_2}!\pPROF. BIRCH’s POKéDEX rating!\pPROF. BIRCH: Let’s see...\p"); +const u8 gMenuText_HOFSaving[] = _("SAVING...\nDON’T TURN OFF THE POWER."); +const u8 gMenuText_HOFCorrupt[] = _("The HALL OF FAME data is corrupt."); +const u8 gMenuText_HOFNumber[] = _("HALL OF FAME No. "); +const u8 gMenuText_HOFCongratulations[] = _("LEAGUE CHAMPION!\nCONGRATULATIONS!"); + +const u8 gOtherText_Number2[] = _("No. "); +const u8 gOtherText_Level3[] = _("Lv. "); +const u8 gOtherText_IDNumber[] = _("IDNo. /"); +const u8 gOtherText_Name[] = _("NAME /"); +const u8 gOtherText_IDNumber2[] = _("IDNo. /"); +const u8 gOtherText_BirchInTrouble[] = _("{HIGHLIGHT WHITE2}{COLOR DARK_GREY}PROF. BIRCH is in trouble!\nRelease a POKéMON and rescue him!"); +const u8 gOtherText_DoYouChoosePoke[] = _("{HIGHLIGHT WHITE2}{COLOR DARK_GREY}Do you choose this POKéMON?"); +const u8 gOtherText_Poke[] = _("POKéMON"); + +const u8 gSystemText_SaveErrorExchangeBackup[] = _("Save error.\pPlease exchange the\nbackup memory."); +const u8 gOtherText_FlyToWhere[] = _("FLY to where?"); + +const u8 OtherText_Use[] = _("USE"); +const u8 OtherText_Toss[] = _("TOSS"); +const u8 OtherText_Register[] = _("REGISTER"); +const u8 OtherText_Give2[] = _("GIVE"); +const u8 OtherText_CheckTag[] = _("CHECK TAG"); +const u8 OtherText_Confirm[] = _("CONFIRM"); +const u8 gOtherText_Walk[] = _("WALK"); + +const u8 gUnknownText_Exit[] = _("EXIT"); +const u8 gOtherText_CancelNoTerminator[] = _("CANCEL"); +const u8 gOtherText_CancelWithTerminator[] = _("$CANCEL"); // with terminator at beginning? + +const u8 OtherText_Item[] = _("ITEM"); +const u8 OtherText_Mail[] = _("MAIL"); +const u8 OtherText_Take2[] = _("TAKE"); +const u8 OtherText_Store[] = _("STORE"); + +const u8 gOtherText_Check[] = _("CHECK"); +const u8 gOtherText_None[] = _("NONE"); + +const u8 gOtherText_ThreeQuestions2[] = _("???"); + +const u8 gOtherText_FiveQuestionsAndSlash[] = _("?????$/"); + +const u8 gOtherText_OneDash[] = _("-"); +const u8 gOtherText_TwoDashes[] = _("--"); +const u8 gOtherText_ThreeDashes2[] = _("---"); +const u8 gOtherText_MaleSymbol2[] = _("♂"); +const u8 gOtherText_FemaleSymbolAndLv[] = _("♀$Lv."); +const u8 gOtherText_TallPlusAndRightArrow[] = _("{TALL_PLUS}${RIGHT_ARROW}"); +const u8 gMenuText_GoBackToPrev[] = _("Go back to the\nprevious menu."); +const u8 gOtherText_WhatWillYouDo[] = _("What would you like to do?"); + +const u8 gOtherText_xString1[] = _("×{STR_VAR_1}"); +const u8 gOtherText_Berry2[] = _(" BERRY"); +const u8 gOtherText_Coins2[] = _("{STR_VAR_1} COINS"); +const u8 gOtherText_CloseBag[] = _("CLOSE BAG"); + +const u8 OtherText_TheField3[] = _("the field."); +const u8 OtherText_TheBattle[] = _("the battle."); +const u8 OtherText_ThePokeList[] = _("the POKéMON LIST."); +const u8 OtherText_TheShop[] = _("the shop."); +const u8 OtherText_TheField[] = _("the field."); +const u8 OtherText_TheField2[] = _("the field."); +const u8 OtherText_ThePC[] = _("the PC."); + +const struct TextStruct gUnknown_0840E740[7] = +{ + OtherText_TheField3, + OtherText_TheBattle, + OtherText_ThePokeList, + OtherText_TheShop, + OtherText_TheField, + OtherText_TheField2, + OtherText_ThePC, +}; + +const u8 gOtherText_ReturnTo[] = _("Return to"); +const u8 gOtherText_WhatWillYouDo2[] = _("What would you\nlike to do?"); +const u8 gOtherText_CantWriteMail[] = _("You can’t write\nMAIL here."); +const u8 gOtherText_NoPokemon[] = _("There is no\nPOKéMON.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_SwitchWhichItem[] = _("Switch with which\nitem?"); +const u8 gOtherText_CantBeHeld[] = _("{STR_VAR_1} can’t be held."); +const u8 gOtherText_CantBeHeldHere[] = _("{STR_VAR_1} can’t be held here."); +const u8 gOtherText_HowManyToDeposit[] = _("How many do you\nwant to deposit?"); +const u8 gOtherText_DepositedItems[] = _("Deposited {STR_VAR_2}\n{STR_VAR_1}(s)."); +const u8 gOtherText_NoRoomForItems[] = _("There’s no room to\nstore items."); +const u8 gOtherText_CantStoreSomeoneItem[] = _("You can’t store\nsomeone else’s item\nin the PC."); +const u8 gOtherText_TooImportant[] = _("That’s much too\nimportant to toss\nout!"); +const u8 gOtherText_HowManyToToss[] = _("Toss out how many?"); +const u8 gOtherText_ThrewAwayItem[] = _("Threw away {STR_VAR_2}\n{STR_VAR_1}(s)."); +const u8 gOtherText_OkayToThrowAwayPrompt[] = _("Is it okay to\nthrow away {STR_VAR_2}\n{STR_VAR_1}(s)?"); +const u8 gOtherText_DadsAdvice[] = _("DAD’s advice...\n{PLAYER}, there’s a time and place for\leverything!{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_CantGetOffBike[] = _("You can’t dismount your BIKE here.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_ItemfinderResponding[] = _("Oh!\nThe machine’s responding!\pThere’s an item buried around here!{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_ItemfinderItemUnderfoot[] = _("The machine’s indicating something\nright underfoot!{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_NoResponse[] = _("... ... ... ... Nope!\nThere’s no response.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_Coins3[] = _("Your COINS:\n{STR_VAR_1}{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_BootedTM[] = _("Booted up a TM."); +const u8 gOtherText_BootedHM[] = _("Booted up an HM."); +const u8 gOtherText_ContainsMove[] = _("It contained\n{STR_VAR_1}.\pTeach {STR_VAR_1}\nto a POKéMON?"); +const u8 gOtherText_UsedItem[] = _("{PLAYER} used the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_RepelLingers[] = _("But the effects of a REPEL lingered\nfrom earlier.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_UsedFlute[] = _("{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be lured.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_UsedRepel[] = _("{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be repelled.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_BoxIsFull[] = _("The BOX is full.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_Size[] = _("SIZE /"); +const u8 gOtherText_Firm[] = _("FIRM /"); + +const u8 gContestStatsText_Unknown1[] = _("{STR_VAR_1}.{STR_VAR_2}”"); + +const u8 ContestStatsText_VerySoft[] = _("Very soft"); +const u8 ContestStatsText_Soft[] = _("Soft"); +const u8 ContestStatsText_Hard[] = _("Hard"); +const u8 ContestStatsText_VeryHard[] = _("Very hard"); +const u8 ContestStatsText_SuperHard[] = _("Super hard"); + +const u8 ContestStatsText_RedPokeBlock[] = _("RED {POKEBLOCK}"); +const u8 ContestStatsText_BluePokeBlock[] = _("BLUE {POKEBLOCK}"); +const u8 ContestStatsText_PinkPokeBlock[] = _("PINK {POKEBLOCK}"); +const u8 ContestStatsText_GreenPokeBlock[] = _("GREEN {POKEBLOCK}"); +const u8 ContestStatsText_YellowPokeBlock[] = _("YELLOW {POKEBLOCK}"); +const u8 ContestStatsText_PurplePokeBlock[] = _("PURPLE {POKEBLOCK}"); +const u8 ContestStatsText_IndigoPokeBlock[] = _("INDIGO {POKEBLOCK}"); +const u8 ContestStatsText_BrownPokeBlock[] = _("BROWN {POKEBLOCK}"); +const u8 ContestStatsText_LiteBluePokeBlock[] = _("LITEBLUE {POKEBLOCK}"); +const u8 ContestStatsText_OlivePokeBlock[] = _("OLIVE {POKEBLOCK}"); +const u8 ContestStatsText_GrayPokeBlock[] = _("GRAY {POKEBLOCK}"); +const u8 ContestStatsText_BlackPokeBlock[] = _("BLACK {POKEBLOCK}"); +const u8 ContestStatsText_WhitePokeBlock[] = _("WHITE {POKEBLOCK}"); +const u8 ContestStatsText_GoldPokeBlock[] = _("GOLD {POKEBLOCK}"); + +const u8 gContestStatsText_Spicy[] = _("SPICY"); +const u8 gContestStatsText_Dry[] = _("DRY"); +const u8 gContestStatsText_Sweet[] = _("SWEET"); +const u8 gContestStatsText_Bitter[] = _("BITTER"); +const u8 gContestStatsText_Sour[] = _("SOUR$TASTY$FEEL"); // tasty is unused, feel might not be + +const u8 gContestStatsText_StowCase[] = _("Stow CASE."); +const u8 gContestStatsText_ThrowAwayPrompt[] = _("Throw away this\n{STR_VAR_1}?"); +const u8 gContestStatsText_WasThrownAway[] = _("The {STR_VAR_1}\nwas thrown away."); +const u8 gContestStatsText_NormallyAte[] = _("{STR_VAR_1} ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); +const u8 gContestStatsText_HappilyAte[] = _("{STR_VAR_1} happily ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); +const u8 gContestStatsText_DisdainfullyAte[] = _("{STR_VAR_1} disdainfully ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); + +const u8 MartText_Buy[] = _("BUY"); +const u8 MartText_Sell[] = _("SELL"); +const u8 MartText_Quit2[] = _("QUIT"); + +const u8 gOtherText_QuitShopping[] = _("Quit shopping."); + +const u8 gOtherText_HowManyYouWant[] = _("{STR_VAR_1}? Certainly.\nHow many would you like?"); +const u8 gOtherText_ThatWillBe[] = _("{STR_VAR_1}? And you wanted {STR_VAR_2}?\nThat will be ¥{STR_VAR_3}."); +const u8 gOtherText_ThatWillBe2[] = _("{STR_VAR_1}, is it?\nThat’ll be ¥{STR_VAR_2}. Do you want it?"); +const u8 gOtherText_ThatWillBe3[] = _("You wanted {STR_VAR_1}?\nThat’ll be ¥{STR_VAR_2}. Will that be okay?"); +const u8 gOtherText_HereYouGo[] = _("Here you go!\nThank you very much."); +const u8 gOtherText_HereYouGo2[] = _("Thank you!\nI’ll send it to your home PC."); +const u8 gOtherText_HereYouGo3[] = _("Thanks!\nI’ll send it to your PC at home."); +const u8 gOtherText_NotEnoughMoney[] = _("You don’t have enough money.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_NoRoomFor[] = _("You have no more room for items.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_SpaceForIsFull[] = _("The space for {STR_VAR_1} is full.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_AnythingElse[] = _("Is there anything else I can help\nyou with?"); +const u8 gOtherText_CanIHelpYou[] = _("Can I help you with anything else?"); +const u8 gOtherText_FreePremierBall[] = _("I’ll throw in a PREMIER BALL, too.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_CantBuyThat[] = _("{STR_VAR_2}? Oh, no.\nI can’t buy that.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_HowManyToSell[] = _("{STR_VAR_2}?\nHow many would you like to sell?"); +const u8 gOtherText_CanPay[] = _("I can pay ¥{STR_VAR_1}.\nWould that be okay?"); +const u8 gOtherText_SoldItem[] = _("Turned over the {STR_VAR_2}\nand received ¥{STR_VAR_1}."); + +const u8 OtherText_Money[] = _("¥{STR_VAR_1}"); +const u8 OtherText_Shift[] = _("SHIFT"); +const u8 OtherText_SendOut[] = _("SEND OUT"); +const u8 OtherText_Switch2[] = _("SWITCH"); +const u8 OtherText_Summary[] = _("SUMMARY"); +const u8 OtherText_Moves[] = _("MOVES"); +const u8 OtherText_Enter2[] = _("ENTER"); +const u8 OtherText_NoEntry[] = _("NO ENTRY"); +const u8 OtherText_Take[] = _("TAKE"); +const u8 OtherText_Read2[] = _("READ"); + +const u8 gOtherText_Hp2[] = _("HP"); +const u8 gOtherText_SpAtk2[] = _("SP. ATK"); +const u8 gOtherText_SpDef2[] = _("SP. DEF"); +const u8 gOtherText_WontHaveAnyEffect[] = _("It won’t have any effect.{PAUSE_UNTIL_PRESS}"); + +#if REVISION >= 1 +const u8 gOtherText_CantUseOnPoke[] = _("This can’t be used on\nthat POKéMON.{PAUSE_UNTIL_PRESS}"); +#else +const u8 gOtherText_CantUseOnPoke[] = _("This item can’t be used on\nthat POKéMON.{PAUSE_UNTIL_PRESS}"); +#endif + +const u8 gOtherText_CantBeSwitched[] = _("{STR_VAR_1} can’t be switched\nout!{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_AlreadyBattle[] = _("{STR_VAR_1} is already\nin battle!{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_AlreadySelected[] = _("{STR_VAR_1} has already been\nselected.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_NoEnergyLeft[] = _("{STR_VAR_1} has no energy\nleft to battle!{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_CantSwitchPokeWithYours[] = _("You can’t switch {STR_VAR_1}’s\nPOKéMON with one of yours!{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_EGGCantBattle[] = _("An EGG can’t battle!{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_CantBeUsedBadge[] = _("This can’t be used until a new\nBADGE is obtained."); +const u8 gOtherText_NoMoreThreePoke[] = _("No more than three POKéMON\nmay enter."); +const u8 gOtherText_SendRemovedMailPrompt[] = _("Send the removed MAIL to\nyour PC?"); +const u8 gOtherText_MailWasSent[] = _("The MAIL was sent to your PC.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_MailboxIsFull[] = _("Your PC’s MAILBOX is full.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_MailRemovedMessageLost[] = _("If the MAIL is removed, the\nmessage will be lost. Okay?"); +const u8 gOtherText_MailMustBeRemoved[] = _("MAIL must be removed before\nholding an item.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_WasGivenToHold[] = _("{STR_VAR_1} was given the\n{STR_VAR_2} to hold.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_AlreadyHolding[] = _("{STR_VAR_1} is already holding\none {STR_VAR_2}.\pWould you like to switch the\ntwo items?"); +const u8 gOtherText_NotHoldingAnything[] = _("{STR_VAR_1} isn’t\nholding anything.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_ReceivedTheThingFrom[] = _("Received the {STR_VAR_2}\nfrom {STR_VAR_1}.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_MailTaken[] = _("MAIL was taken from the\nPOKéMON.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_TakenAndReplaced[] = _("The {STR_VAR_2} was taken and\nreplaced with the {STR_VAR_1}.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_PokeHoldingItemCantMail[] = _("This POKéMON is holding an item.\nIt cannot hold MAIL.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_MailTransferredMailbox[] = _("MAIL was transferred from\nthe MAILBOX.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_BagFullCannotRemoveItem[] = _("The BAG is full. The POKéMON’s\nitem could not be removed.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_LearnedMove[] = _("{STR_VAR_1} learned\n{STR_VAR_2}!"); +const u8 gOtherText_NotCompatible[] = _("{STR_VAR_1} and {STR_VAR_2}\nare not compatible.\p{STR_VAR_2} can’t be learned.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_WantsToLearn[] = _("{STR_VAR_1} wants to learn the\nmove {STR_VAR_2}.\pHowever, {STR_VAR_1} already\nknows four moves.\pShould a move be deleted and\nreplaced with {STR_VAR_2}?"); +const u8 gOtherText_StopTryingTo[] = _("Stop trying to teach\n{STR_VAR_2}?"); +const u8 gOtherText_DidNotLearnMove2[] = _("{STR_VAR_1} did not learn the\nmove {STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_WhichMoveToForget2[] = _("Which move should be forgotten?{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_ForgetMove123_2[] = _("{PAUSE 32}1, {PAUSE 15}2, and{PAUSE 15}... {PAUSE 15}... {PAUSE 15}... {PAUSE 15}{PLAY_SE SE_KON}Poof!\p{STR_VAR_1} forgot how to\nuse {STR_VAR_2}.\pAnd...{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_AlreadyKnows[] = _("{STR_VAR_1} already knows\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_HPRestoredBy[] = _("{STR_VAR_1}’s HP was restored by\n{STR_VAR_2} points.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_CuredPoisoning[] = _("{STR_VAR_1} was cured of its\npoisoning.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_CuredParalysis[] = _("{STR_VAR_1} was cured of\nparalysis.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_WokeUp[] = _("{STR_VAR_1} woke up.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_BurnHealed[] = _("{STR_VAR_1}’s burn was healed.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_ThawedOut[] = _("{STR_VAR_1} was thawed out.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_PPRestored[] = _("PP was restored.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_RegainedHealth[] = _("{STR_VAR_1} regained health.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_BecameHealthy[] = _("{STR_VAR_1} became healthy.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_PPIncreased[] = _("{STR_VAR_1}’s PP increased.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_ElevatedTo[] = _("{STR_VAR_1} was elevated to\nLv. {STR_VAR_2}."); +const u8 gOtherText_WasRaised[] = _("{STR_VAR_1}’s {STR_VAR_2} was\nraised.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_SnapConfusion[] = _("{STR_VAR_1} snapped out of its\nconfusion.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_GotOverLove[] = _("{STR_VAR_1} got over its\ninfatuation.{PAUSE_UNTIL_PRESS}"); +const u8 OtherText_ChoosePoke[] = _("Choose a POKéMON."); +const u8 OtherText_MovePokeTo[] = _("Move to where?"); +const u8 OtherText_TeachWhat[] = _("Teach which POKéMON?"); +const u8 OtherText_UseWhat[] = _("Use on which POKéMON?"); +const u8 OtherText_GiveWhat[] = _("Give to which POKéMON?"); +const u8 OtherText_DoWhat[] = _("Do what with {STR_VAR_1}?"); +const u8 OtherText_NothingToCut[] = _("There’s nothing to CUT."); +const u8 OtherText_CantSurf[] = _("You can’t SURF here."); +const u8 OtherText_AlreadySurfing[] = _("You’re already SURFING."); +const u8 OtherText_CantUseThatHere[] = _("Can’t use that here."); +const u8 OtherText_RestoreWhatMove[] = _("Restore which move?"); +const u8 OtherText_BoostPP[] = _("Boost PP of which move?"); +const u8 OtherText_DoWhatWithItem[] = _("Do what with an item?"); +const u8 OtherText_NoPokeForBattle[] = _("No POKéMON for battle!"); +const u8 OtherText_ChoosePoke2[] = _("Choose a POKéMON."); +const u8 OtherText_NotEnoughHP[] = _("Not enough HP..."); +const u8 OtherText_ThreePokeNeeded[] = _("Three POKéMON are needed."); +const u8 OtherText_PokeCantBeSame[] = _("POKéMON can’t be the same."); +const u8 OtherText_NoIdenticalHoldItems[] = _("No identical hold items."); +const u8 OtherText_TeachWhichPoke[] = _("Teach which POKéMON?"); +const u8 gOtherText_Attack[] = _("ATTACK"); +const u8 gOtherText_Defense[] = _("DEFENSE"); +const u8 gOtherText_SpAtk[] = _("SP. ATK"); +const u8 gOtherText_SpDef[] = _("SP. DEF"); +const u8 gOtherText_Speed[] = _("SPEED"); +const u8 gOtherText_HP[] = _("HP"); +const u8 gOtherText_Terminator18[] = _(""); +const u8 gOtherText_OriginalTrainer[] = _("OT/"); +const u8 gOtherText_Type2[] = _("TYPE/"); +const u8 gOtherText_Power2[] = _("POWER"); +const u8 gOtherText_Accuracy2[] = _("ACCURACY"); +const u8 gOtherText_Appeal2[] = _("APPEAL"); +const u8 gOtherText_Jam2[] = _("JAM"); +const u8 gOtherText_Status[] = _("STATUS"); +const u8 gOtherText_ExpPoints[] = _("EXP. POINTS"); +const u8 gOtherText_NextLv[] = _("NEXT LV."); +const u8 gOtherText_Ribbons00[] = _("RIBBONS: 00"); + +const u8 OtherText_Event[] = _("EVENT"); +const u8 OtherText_Switch[] = _("SWITCH"); +const u8 OtherText_PokeInfo[] = _("POKéMON INFO"); +const u8 OtherText_PokeSkills[] = _("POKéMON SKILLS"); +const u8 OtherText_BattleMoves[] = _("BATTLE MOVES"); +const u8 OtherText_ContestMoves[] = _("C0NTEST MOVES"); // why the l33t 0, that's stupid +const u8 OtherText_Info[] = _("INFO"); + +const u8 gOtherText_EggLongTime[] = _("It looks like this EGG will\ntake a long time to hatch."); +const u8 gOtherText_EggSomeTime[] = _("What will hatch from this?\nIt will take some time."); +const u8 gOtherText_EggSoon[] = _("It moves occasionally.\nIt should hatch soon."); +const u8 gOtherText_EggAbout[] = _("It’s making sounds.\nIt’s about to hatch!"); +const u8 gOtherText_CantForgetHMs[] = _("HM moves can’t be\nforgotten now."); +const u8 gOtherText_PlayersBase[] = _("’s BASE"); +const u8 gOtherText_OkayToDeleteFromRegistry[] = _("Is it okay to delete {STR_VAR_1}\nfrom the REGISTRY?"); +const u8 gOtherText_RegisteredDataDeleted[] = _("The registered data was deleted.{PAUSE_UNTIL_PRESS}"); + +const u8 gSecretBaseText_NoRegistry[] = _("There is no REGISTRY.{PAUSE_UNTIL_PRESS}"); +const u8 SecretBaseText_DelRegist[] = _("DEL REGIST."); +const u8 SecretBaseText_Decorate[] = _("DECORATE"); +const u8 SecretBaseText_PutAway[] = _("PUT AWAY"); +const u8 SecretBaseText_Toss[] = _("TOSS"); +const u8 SecretBaseText_PutOutDecor[] = _("Put out the selected decoration item."); +const u8 SecretBaseText_StoreChosenDecor[] = _("Store the chosen decoration in the PC."); +const u8 SecretBaseText_ThrowAwayDecor[] = _("Throw away unwanted decorations."); +const u8 gSecretBaseText_NoDecors[] = _("There are no decorations.{PAUSE_UNTIL_PRESS}"); +const u8 SecretBaseText_Desk[] = _("DESK"); +const u8 SecretBaseText_Chair[] = _("CHAIR"); +const u8 SecretBaseText_Plant[] = _("PLANT"); +const u8 SecretBaseText_Ornament[] = _("ORNAMENT"); +const u8 SecretBaseText_Mat[] = _("MAT"); +const u8 SecretBaseText_Poster[] = _("POSTER"); +const u8 SecretBaseText_Doll[] = _("DOLL"); +const u8 SecretBaseText_Cushion[] = _("CUSHION"); +const u8 gSecretBaseText_GoldRank[] = _("GOLD"); +const u8 gSecretBaseText_SilverRank[] = _("SILVER"); +const u8 gSecretBaseText_PlaceItHere[] = _("Place it here?"); +const u8 gSecretBaseText_CantBePlacedHere[] = _("It can’t be placed here."); +const u8 gSecretBaseText_CancelDecorating[] = _("Cancel decorating?"); +const u8 gSecretBaseText_InUseAlready[] = _("This is in use already."); +const u8 gSecretBaseText_NoMoreDecor[] = _("No more decorations can be placed.\nThe most that can be placed is {STR_VAR_1}."); +const u8 gSecretBaseText_NoMoreDecor2[] = _("No more decorations can be placed.\nThe most that can be placed is {STR_VAR_1}.$This can’t be placed here.\nIt must be on a DESK, etc."); +const u8 gSecretBaseText_DecorCantPlace[] = _("This decoration can’t be placed in\nyour own room."); +const u8 gSecretBaseText_DecorInUse[] = _("This decoration is in use.\nIt can’t be thrown away."); +const u8 gSecretBaseText_WillBeDiscarded[] = _("This {STR_VAR_1} will be discarded.\nIs that okay?"); +const u8 gSecretBaseText_DecorThrownAway[] = _("The decoration item was thrown away."); +const u8 gSecretBaseText_StopPuttingAwayDecor[] = _("Stop putting away decorations?"); +const u8 gSecretBaseText_NoDecor[] = _("There is no decoration item here."); +const u8 gSecretBaseText_ReturnDecor[] = _("Return this decoration to the PC?"); +const u8 gSecretBaseText_DecorReturned[] = _("The decoration was returned to the PC."); +const u8 gSecretBaseText_NoDecorInUse[] = _("There are no decorations in use.{PAUSE_UNTIL_PRESS}"); +const u8 SecretBaseText_Tristan[] = _("TRISTAN"); +const u8 SecretBaseText_Philip[] = _("PHILIP"); +const u8 SecretBaseText_Dennis[] = _("DENNIS"); +const u8 SecretBaseText_Roberto[] = _("ROBERTO"); +const u8 SecretBaseText_TurnOff[] = _("TURN OFF"); +const u8 SecretBaseText_Decoration[] = _("DECORATION"); +const u8 SecretBaseText_ItemStorage[] = _("ITEM STORAGE"); + +const u8 gPCText_Mailbox[] = _("MAILBOX"); +const u8 PCText_DepositItem[] = _("DEPOSIT ITEM"); +const u8 PCText_WithdrawItem[] = _("WITHDRAW ITEM"); +const u8 PCText_TossItem[] = _("TOSS ITEM"); +const u8 PCText_StoreItems[] = _("Store items in the PC."); +const u8 PCText_TakeOutItems[] = _("Take out items from the PC."); +const u8 PCText_ThrowAwayItems[] = _("Throw away items stored in the PC."); + +const u8 gOtherText_NoItems[] = _("There are no items.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_NoMoreRoom[] = _("There is no more\nroom in the BAG."); +const u8 gOtherText_HowManyToWithdraw[] = _("How many do you\nwant to withdraw?"); +const u8 gOtherText_WithdrewThing[] = _("Withdrew {STR_VAR_2}\n{STR_VAR_1}(s)."); +const u8 OtherText_Read[] = _("READ"); +const u8 gOtherText_MoveToBag[] = _("MOVE TO BAG"); +const u8 OtherText_Give[] = _("GIVE"); +const u8 gOtherText_NoMailHere[] = _("There’s no MAIL here.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_WhatWillYouDoMail[] = _("What would you like to do with\n{STR_VAR_1}’s MAIL?"); +const u8 gOtherText_MessageWillBeLost[] = _("The message will be lost.\nIs that okay?"); +const u8 gOtherText_BagIsFull[] = _("The BAG is full.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_MailWasReturned[] = _("The MAIL was returned to the BAG\nwith its message erased.{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_Dad[] = _("DAD"); +const u8 gOtherText_Mom[] = _("MOM"); +const u8 gOtherText_Wallace[] = _("WALLACE"); +const u8 gOtherText_Steven[] = _("STEVEN"); +const u8 gOtherText_Brawly[] = _("BRAWLY"); +const u8 gOtherText_Winona[] = _("WINONA"); +const u8 gOtherText_Phoebe[] = _("PHOEBE"); +const u8 gOtherText_Glacia[] = _("GLACIA"); +const u8 gContestText_ContestWinner[] = _("CONTEST WINNER\n"); +const u8 gOtherText_Unknown1[] = _("’s "); +const u8 OtherText_Cool[] = _("COOL "); +const u8 OtherText_Beauty2[] = _("BEAUTY "); +const u8 OtherText_Cute[] = _("CUTE "); +const u8 OtherText_Smart[] = _("SMART "); +const u8 OtherText_Tough[] = _("TOUGH "); +const u8 OtherText_NonstopSuperCool[] = _("Nonstop super-cool -\nthe inestimable "); +const u8 OtherText_Terminator6[] = _(""); +const u8 OtherText_GoodLookingPoke[] = _("Hey, there!\nThe good-looking POKéMON "); +const u8 OtherText_Terminator7[] = _(""); +const u8 OtherText_MarvelousGreat[] = _("The marvelous, wonderful, and\nvery great "); +const u8 OtherText_Terminator8[]= _(""); +const u8 OtherText_CenturyLastVenus[]= _("This century’s last Venus -\nthe beautiful "); +const u8 OtherText_Terminator9[]= _(""); +const u8 OtherText_Terminator10[]= _(""); +const u8 OtherText_DazzlingSmile[]= _("’s dazzling,\nglittering smile"); +const u8 OtherText_PokeCenterIdol[]= _("POKéMON CENTER’s super idol -\nthe incomparable "); +const u8 OtherText_Terminator11[]= _(""); +const u8 OtherText_LovelyAndSweet[]= _("The lovely and sweet "); +const u8 OtherText_Terminator12[]= _(""); +const u8 OtherText_ThePretty[]= _("The pretty "); +const u8 OtherText_WinningPortrait[] = _("’s\nwinning portrait"); +const u8 OtherText_GiveUsWink[] = _("Give us a wink!\nThe cutie POKéMON "); +const u8 OtherText_Terminator13[] = _(""); +const u8 OtherText_SmartnessMaestro[] = _("The smartness maestro -\nThe wise POKéMON "); +const u8 OtherText_Terminator14[] = _(""); +const u8 OtherText_ChosenPokeAmong[] = _("The chosen POKéMON -\nThe one among POKéMON "); +const u8 OtherText_Terminator15[] = _(""); +const u8 OtherText_TheExcellent[] = _("The excellent "); +const u8 OtherText_ItsMomentOfElegance[] = _("’s\nmoment of elegance"); +const u8 OtherText_PowerfullyMuscular[] = _("The powerfully muscular\nspeedster "); +const u8 OtherText_Terminator16[] = _(""); +const u8 OtherText_StrongErEst[] = _("The strong, stronger, and\nstrongest "); +const u8 OtherText_Terminator17[] = _(""); +const u8 OtherText_MightyTough[] = _("The mighty tough\nhyper POKéMON "); +const u8 OtherText_Exclamation[] = _("!"); +const u8 OtherText_Petalburg[] = _("PETALBURG"); +const u8 OtherText_Slateport[] = _("SLATEPORT"); +const u8 OtherText_Littleroot[] = _("LITTLEROOT"); // unused contest location? +const u8 OtherText_Lilycove[] = _("LILYCOVE"); +const u8 OtherText_Dewford[] = _("DEWFORD"); +const u8 OtherText_Enter[] = _("ENTER"); +const u8 OtherText_Info3[] = _("INFO"); +const u8 OtherText_WhatsAContest[] = _("What’s a CONTEST?"); +const u8 OtherText_TypesOfContest[] = _("Types of CONTESTS"); +const u8 OtherText_Ranks[] = _("Ranks"); +const u8 OtherText_Judging[] = _("Judging"); +const u8 OtherText_CoolContest[] = _("COOL CONTEST"); +const u8 OtherText_BeautyContest[] = _("BEAUTY CONTEST"); +const u8 OtherText_CuteContest[] = _("CUTE CONTEST"); +const u8 OtherText_SmartContest[] = _("SMART CONTEST"); +const u8 OtherText_ToughContest[] = _("TOUGH CONTEST"); +const u8 OtherText_Decoration[] = _("DECORATION"); +const u8 OtherText_PackUp[] = _("PACK UP"); +const u8 OtherText_Count[] = _("COUNT"); +const u8 OtherText_Registry[] = _("REGISTRY"); +const u8 OtherText_Information[] = _("INFORMATION"); +const u8 OtherText_Mach[] = _("MACH"); +const u8 OtherText_Acro[] = _("ACRO"); +const u8 OtherText_Poison[] = _("PSN"); +const u8 OtherText_Paralysis[] = _("PAR"); +const u8 OtherText_Sleep[] = _("SLP"); +const u8 OtherText_Burn[] = _("BRN"); +const u8 OtherText_Frozen[] = _("FRZ"); +const u8 OtherText_Quit[] = _("QUIT"); +const u8 OtherText_SawIt[] = _("Saw it"); +const u8 OtherText_NotYet[] = _("Not yet"); +const u8 OtherText_Yes[] = _("YES"); +const u8 OtherText_No[] = _("NO"); +const u8 OtherText_Info2[] = _("INFO"); +const u8 OtherText_SingleBattle[] = _("SINGLE BATTLE"); +const u8 OtherText_DoubleBattle[] = _("DOUBLE BATTLE"); +const u8 OtherText_MultiBattle[] = _("MULTI BATTLE"); +const u8 OtherText_MrBriney[] = _("MR. BRINEY"); +const u8 OtherText_MakeAChallenge[] = _("Make a challenge."); +const u8 OtherText_ObtainInformation[] = _("Obtain information."); +const u8 OtherText_Lv50_2[] = _("LV. 50"); +const u8 OtherText_Lv100_2[] = _("LV. 100"); +const u8 OtherText_Zigzagoon[] = _("ZIGZAGOON"); +const u8 OtherText_Nincada[] = _("NINCADA"); +const u8 OtherText_Poochyena[] = _("POOCHYENA"); +const u8 OtherText_Nincada2[] = _("NINCADA"); +const u8 OtherText_Lotad[] = _("LOTAD"); +const u8 OtherText_Roselia[] = _("ROSELIA"); +const u8 OtherText_Shroomish[] = _("SHROOMISH"); +const u8 OtherText_Nincada3[] = _("NINCADA"); +const u8 OtherText_Surskit[] = _("SURSKIT"); +const u8 OtherText_Treecko[] = _("TREECKO"); +const u8 OtherText_Torchic[] = _("TORCHIC"); +const u8 OtherText_Mudkip[] = _("MUDKIP"); +const u8 OtherText_Seedot[] = _("SEEDOT"); +const u8 OtherText_Shroomish2[] = _("SHROOMISH"); +const u8 OtherText_Spinda[] = _("SPINDA"); +const u8 OtherText_Shroomish3[] = _("SHROOMISH"); +const u8 OtherText_Zigzagoon2[] = _("ZIGZAGOON"); +const u8 OtherText_Wurmple[] = _("WURMPLE"); +const u8 OtherText_PokeBall[] = _("POKé BALL"); +const u8 OtherText_SuperPotion[] = _("SUPER POTION"); +const u8 OtherText_SamePrice[] = _("Same price"); +const u8 OtherText_Yen135[] = _("¥135"); +const u8 OtherText_Yen155[] = _("¥155"); +const u8 OtherText_Yen175[] = _("¥175"); +const u8 OtherText_CostMore[] = _("They will cost more."); +const u8 OtherText_CostLess[] = _("They will cost less."); +const u8 OtherText_SamePrice2[] = _("Same price"); +const u8 OtherText_MaleSymbol[] = _("♂"); +const u8 OtherText_FemaleSymbol[] = _("♀"); +const u8 OtherText_Neither[] = _("Neither"); +const u8 OtherText_Males[] = _("Males"); +const u8 OtherText_Females[] = _("Females"); +const u8 OtherText_SameNumber[] = _("Same number"); +const u8 OtherText_Male[] = _("Male"); +const u8 OtherText_Female[] = _("Female"); +const u8 OtherText_ItDepends[] = _("It depends"); +const u8 OtherText_Six2[] = _("6"); +const u8 OtherText_Eight2[] = _("8"); +const u8 OtherText_Ten[] = _("10"); +const u8 OtherText_One[] = _("1"); +const u8 OtherText_Two[] = _("2"); +const u8 OtherText_Three[] = _("3"); +const u8 OtherText_Six[] = _("6"); +const u8 OtherText_Seven[] = _("7"); +const u8 OtherText_Eight[] = _("8"); +const u8 OtherText_FreshWater[] = _("FRESH WATER{CLEAR_TO 0x48}¥200"); +const u8 OtherText_SodaPop[] = _("SODA POP{CLEAR_TO 0x48}¥300"); +const u8 OtherText_Lemonade[] = _("LEMONADE{CLEAR_TO 0x48}¥350"); +const u8 OtherText_HowToRide[] = _("HOW TO RIDE"); +const u8 OtherText_HowToTurn[] = _("HOW TO TURN"); +const u8 OtherText_SandySlopes[] = _("SANDY SLOPES"); +const u8 OtherText_Wheelies[] = _("WHEELIES"); +const u8 OtherText_BunnyHops[] = _("BUNNY-HOPS"); +const u8 OtherText_Jumping[] = _("JUMPING"); +const u8 OtherText_Satisfied[] = _("Satisfied"); +const u8 OtherText_Dissatisfied[] = _("Dissatisfied"); +const u8 OtherText_Deepseatooth[] = _("DEEPSEATOOTH"); +const u8 OtherText_Deepseascale[] = _("DEEPSEASCALE"); +const u8 OtherText_BlueFlute2[] = _("BLUE FLUTE"); +const u8 OtherText_YellowFlute2[] = _("YELLOW FLUTE"); +const u8 OtherText_RedFlute2[] = _("RED FLUTE"); +const u8 OtherText_WhiteFlute2[] = _("WHITE FLUTE"); +const u8 OtherText_BlackFlute2[] = _("BLACK FLUTE"); +const u8 OtherText_GlassChair[] = _("GLASS CHAIR"); +const u8 OtherText_GlassDesk[] = _("GLASS DESK"); +const u8 OtherText_TreeckoDoll[] = _("TREECKO DOLL 1,000 COINS"); +const u8 OtherText_TorchicDoll[] = _("TORCHIC DOLL 1,000 COINS"); +const u8 OtherText_MudkipDoll[] = _("MUDKIP DOLL 1,000 COINS"); +const u8 OtherText_50Coins[] = _(" 50 COINS ¥1,000"); +const u8 OtherText_500Coins[] = _("500 COINS ¥10,000"); +const u8 OtherText_Excellent[] = _("Excellent!"); +const u8 OtherText_NotSoHot[] = _("Not so hot"); +const u8 OtherText_RedShard[] = _("RED SHARD"); +const u8 OtherText_YellowShard[] = _("YELLOW SHARD"); +const u8 OtherText_BlueShard[] = _("BLUE SHARD"); +const u8 OtherText_GreenShard[] = _("GREEN SHARD"); +const u8 OtherText_BattleTower[] = _("BATTLE TOWER"); +const u8 OtherText_Right[] = _("Right"); +const u8 OtherText_Left[] = _("Left"); +const u8 OtherText_TM32[] = _("TM32 1,500 COINS"); +const u8 OtherText_TM29[] = _("TM29 3,500 COINS"); +const u8 OtherText_TM35[] = _("TM35 4,000 COINS"); +const u8 OtherText_TM24[] = _("TM24 4,000 COINS"); +const u8 OtherText_TM13[] = _("TM13 4,000 COINS"); +const u8 OtherText_1F_2[] = _("1F"); +const u8 OtherText_2F_2[] = _("2F"); +const u8 OtherText_3F_2[] = _("3F"); +const u8 OtherText_4F_2[] = _("4F"); +const u8 OtherText_5F_2[] = _("5F"); +const u8 OtherText_Cool2[] = _("COOL"); +const u8 OtherText_Beauty3[] = _("BEAUTY"); +const u8 OtherText_Cute2[] = _("CUTE"); +const u8 OtherText_Smart2[] = _("SMART"); +const u8 OtherText_Tough2[] = _("TOUGH"); +const u8 OtherText_Normal[] = _("NORMAL"); +const u8 OtherText_Super[] = _("SUPER"); +const u8 OtherText_Hyper[] = _("HYPER"); +const u8 OtherText_Master[] = _("MASTER"); +const u8 OtherText_Cool3[] = _("COOL"); +const u8 OtherText_Beauty4[] = _("BEAUTY"); +const u8 OtherText_Cute3[] = _("CUTE"); +const u8 OtherText_Smart3[] = _("SMART"); +const u8 OtherText_Tough3[] = _("TOUGH"); +const u8 OtherText_Items[] = _("ITEMS"); +const u8 OtherText_KeyItems[] = _("KEY ITEMS"); +const u8 OtherText_Balls[] = _("BALLS"); +const u8 OtherText_TMsHMs[] = _("TMs & HMs"); +const u8 OtherText_Berries[] = _("BERRIES"); + +const u8 gPCText_SomeonesPC[] = _("SOMEONE’S PC"); +const u8 gPCText_LanettesPC[] = _("LANETTE’S PC"); +const u8 gPCText_PlayersPC[] = _("{PLAYER}’s PC"); +const u8 gPCText_HallOfFame[] = _("HALL OF FAME"); +const u8 gPCText_LogOff[] = _("LOG OFF"); + +const u8 gOtherText_99Times[] = _("99 times +"); +const u8 gOtherText_1Minute[] = _("1 minute +"); +const u8 gOtherText_Seconds[] = _(" seconds"); +const u8 gOtherText_Times[] = _(" times$."); +const u8 gOtherText_BigGuy[] = _("Big guy"); +const u8 gOtherText_BigGirl[] = _("Big girl"); +const u8 gOtherText_Son[] = _("son"); +const u8 gOtherText_Daughter[] = _("daughter"); +const u8 OtherText_BlueFlute[] = _("BLUE FLUTE"); +const u8 OtherText_YellowFlute[] = _("YELLOW FLUTE"); +const u8 OtherText_RedFlute[] = _("RED FLUTE"); +const u8 OtherText_WhiteFlute[] = _("WHITE FLUTE"); +const u8 OtherText_BlackFlute[] = _("BLACK FLUTE"); +const u8 OtherText_PrettyChair[] = _("PRETTY CHAIR"); +const u8 OtherText_PrettyDesk[] = _("PRETTY DESK"); +const u8 OtherText_1F[] = _("1F"); +const u8 OtherText_2F[] = _("2F"); +const u8 OtherText_3F[] = _("3F"); +const u8 OtherText_4F[] = _("4F"); +const u8 OtherText_5F[] = _("5F"); +const u8 OtherText_6F[] = _("6F"); +const u8 OtherText_7F[] = _("7F"); +const u8 OtherText_8F[] = _("8F"); +const u8 OtherText_9F[] = _("9F"); +const u8 OtherText_10F[] = _("10F"); +const u8 OtherText_11F[] = _("11F"); +const u8 OtherText_B1F[] = _("B1F"); +const u8 OtherText_B2F[] = _("B2F"); +const u8 OtherText_B3F[] = _("B3F"); +const u8 OtherText_B4F[] = _("B4F"); +const u8 OtherText_Rooftop[] = _("ROOFTOP"); + +const u8 gOtherText_NowOn[] = _("Now on:"); + +const u8 gPCText_Cancel[] = _("CANCEL"); + +const u8 PCText_ExitBox[] = _("Exit from the BOX."); +const u8 PCText_WhatYouDo[] = _("What would you like to do?"); +const u8 PCText_PickATheme[] = _("Please pick a theme."); +const u8 PCText_PickAWallpaper[] = _("Please pick out wallpaper."); +const u8 PCText_IsSelected[] = _(" is selected."); +const u8 PCText_JumpToWhichBox[] = _("Jump to which BOX?"); +const u8 PCText_DepositInWhichBox[] = _("Deposit in which BOX?"); +const u8 PCText_WasDeposited[] = _(" was deposited."); +const u8 PCText_BoxIsFull[] = _("The BOX is full."); +const u8 PCText_ReleasePoke[] = _("Release this POKéMON?"); +const u8 PCText_WasReleased[] = _(" was released."); +const u8 PCText_ByeBye[] = _("Bye-bye, !"); +const u8 PCText_MarkPoke[] = _("Mark your POKéMON."); +const u8 PCText_LastPoke[] = _("That’s your last POKéMON!"); +const u8 PCText_PartyFull[] = _("Your party’s full!"); +const u8 PCText_HoldingPoke[] = _("You’re holding a POKéMON!"); +const u8 PCText_WhichOneWillTake[] = _("Which one will you take?"); +const u8 PCText_CantReleaseEgg[] = _("You can’t release an EGG."); +const u8 PCText_ContinueBox[] = _("Continue BOX operations?"); +const u8 PCText_CameBack[] = _(" came back!"); +const u8 PCText_Worried[] = _("Was it worried about you?"); +const u8 PCText_Surprise[] = _("... ... ... ... ...!"); +const u8 PCText_PleaseRemoveMail[] = _("Please remove the MAIL."); +const u8 PCText_Cancel2[] = _("CANCEL"); +const u8 PCText_Deposit[] = _("DEPOSIT"); +const u8 PCText_Withdraw[] = _("WITHDRAW"); +const u8 PCText_Switch[] = _("SWITCH"); +const u8 PCText_Move[] = _("MOVE"); +const u8 PCText_Place[] = _("PLACE"); +const u8 PCText_Summary[] = _("SUMMARY"); +const u8 PCText_Release[] = _("RELEASE"); +const u8 PCText_Mark[] = _("MARK"); +const u8 PCText_Name[] = _("NAME"); +const u8 PCText_Jump[] = _("JUMP"); +const u8 PCText_Wallpaper[] = _("WALLPAPER"); +const u8 PCText_Scenery1[] = _("SCENERY 1"); +const u8 PCText_Scenery2[] = _("SCENERY 2"); +const u8 PCText_Scenery3[] = _("SCENERY 3"); +const u8 PCText_Etc[] = _("ETCETERA"); +const u8 PCText_Forest[] = _("FOREST"); +const u8 PCText_City[] = _("CITY"); +const u8 PCText_Desert[] = _("DESERT"); +const u8 PCText_Savanna[] = _("SAVANNA"); +const u8 PCText_Crag[] = _("CRAG"); +const u8 PCText_Volcano[] = _("VOLCANO"); +const u8 PCText_Snow[] = _("SNOW"); +const u8 PCText_Cave[] = _("CAVE"); +const u8 PCText_Beach[] = _("BEACH"); +const u8 PCText_Seafloor[] = _("SEAFLOOR"); +const u8 PCText_River[] = _("RIVER"); +const u8 PCText_Sky[] = _("SKY"); +const u8 PCText_Polka[] = _("POLKA-DOT"); +const u8 PCText_PokeCenter[] = _("POKéCENTER"); +const u8 PCText_Machine[] = _("MACHINE"); +const u8 PCText_Plain[] = _("PLAIN"); +const u8 PCText_WhatDoYouWant[] = _("What do you want?"); +const u8 PCText_WithdrawPoke[] = _("WITHDRAW POKéMON"); +const u8 PCText_DepositPoke[] = _("DEPOSIT POKéMON"); +const u8 PCText_MovePoke[] = _("MOVE POKéMON"); +const u8 PCText_SeeYa[] = _("SEE YA!"); +const u8 PCText_MovePokeToParty[] = _("Move POKéMON stored in BOXES to\nyour party."); +const u8 PCText_StorePokeInBox[] = _("Store POKéMON in your party in BOXES."); +const u8 PCText_OrganizeBoxesParty[] = _("Organize the POKéMON in BOXES and\nin your party."); +const u8 PCText_ReturnToPrevMenu[] = _("Return to the previous menu."); + +const u8 gPCText_OnlyOne[] = _("There is just one POKéMON with you."); +const u8 gPCText_PartyFull2[] = _("Your party is full!"); +const u8 gPCText_BOX[] = _("BOX"); + +// pokenav +const u8 PCText_CheckMap[] = _("{CLEAR 0}Check the map of the HOENN region."); +const u8 PCText_CheckPoke[] = _("{CLEAR 0}Check POKéMON in detail."); +const u8 PCText_CheckTrainer[] = _("{CLEAR 0}Check TRAINER information."); +const u8 PCText_CheckRibbons[] = _("{CLEAR 0}Check obtained RIBBONS."); +const u8 PCText_PutAwayNav[] = _("{CLEAR 0}Put away the POKéNAV."); +const u8 PCText_NoRibbonWin[] = _("{CLEAR 0}There are no RIBBON winners."); +const u8 PCText_NoTrainers[] = _("{CLEAR 0}No TRAINERS are registered."); +const u8 PCText_CheckParty[] = _("{CLEAR 0}Check party POKéMON in detail."); +const u8 PCText_CheckPokeAll[] = _("{CLEAR 0}Check all POKéMON in detail."); +const u8 PCText_ReturnToNav[] = _("{CLEAR 0}Return to the POKéNAV menu."); +const u8 PCText_FindCool[] = _("{CLEAR 0}Find cool POKéMON."); +const u8 PCText_FindBeauty[] = _("{CLEAR 0}Find beautiful POKéMON."); +const u8 PCText_FindCute[] = _("{CLEAR 0}Find cute POKéMON."); +const u8 PCText_FindSmart[] = _("{CLEAR 0}Find smart POKéMON."); +const u8 PCText_FindTough[] = _("{CLEAR 0}Find tough POKéMON."); +const u8 PCText_ReturnToCondition[] = _("{CLEAR 0}Return to the CONDITION menu."); + +const u8 gOtherText_NumberRegistered[] = _("No. registered"); +const u8 gOtherText_NumberBattles[] = _("No. of battles"); +const u8 gOtherText_Strategy[] = _("{PALETTE 5}STRATEGY"); +const u8 gOtherText_TrainersPokemon[] = _("{PALETTE 5}TRAINER’S POKéMON"); +const u8 gOtherText_SelfIntroduction[] = _("{PALETTE 5}SELF-INTRODUCTION"); +const u8 gOtherText_Nature2[] = _("NATURE/"); +const u8 gOtherText_InParty[] = _("IN PARTY"); +const u8 gOtherText_Number[] = _("No. "); +const u8 gOtherText_Ribbons[] = _("RIBBONS"); +const u8 OtherText_MakeProfilePage1[] = _("Make your profile by combining"); +const u8 OtherText_MakeProfilePage2[] = _("four words or phrases."); +const u8 OtherText_MakeMessagePage1[] = _("Make a message with 6 phrases."); +const u8 OtherText_MakeMessagePage2[] = _("Max. two 12-letter phrases/line."); +const u8 OtherText_DescribeFeelingsPage1[] = _("Find words that describe your"); +const u8 OtherText_DescribeFeelingsPage2[] = _("feelings right now."); +const u8 OtherText_WithFourPhrases[] = _("With four phrases,"); +const u8 OtherText_CombineNinePhrasesPage1[] = _("Combine nine phrases and"); +const u8 OtherText_CombineNinePhrasesPage2[] = _("make a message."); +const u8 OtherText_ImproveBardSongPage1[] = _("Change just one word or phrase"); +const u8 OtherText_ImproveBardSongPage2[] = _("and improve the BARD’s song."); +const u8 OtherText_YourProfile[] = _("Your profile "); +const u8 OtherText_YourFeelingBattle[] = _("Your feeling at the battle’s start"); +const u8 OtherText_SetWinMessage[] = _("What you say if you win a battle"); +const u8 OtherText_SetLossMessage[] = _("What you say if you lose a battle"); +const u8 OtherText_TheAnswer[] = _("The answer"); +const u8 OtherText_MailMessage[] = _("The MAIL message"); +const u8 OtherText_MailSalutation[] = _("The MAIL salutation"); +const u8 OtherText_NewSong[] = _("The new song"); +const u8 OtherText_CombineTwoPhrasesPage1[] = _("Combine two phrases and"); +const u8 OtherText_CombineTwoPhrasesPage2[] = _("make a trendy saying."); +const u8 OtherText_ConfirmTrendyPage1[] = _("The trendy saying"); +const u8 OtherText_ConfirmTrendyPage2[] = _("is as shown. Okay?"); +const u8 OtherText_HipsterPage1[] = _("I’ll combine two phrases and"); +const u8 OtherText_HipsterPage2[] = _("teach you a good saying."); + +const u8 gOtherText_TextDeletedConfirmPage1[] = _("All the text being edited will"); +const u8 gOtherText_TextDeletedConfirmPage2[] = _("be deleted. Is that okay?"); +const u8 gOtherText_QuitEditing[] = _("Quit editing?"); +const u8 gOtherText_EditedTextNoSavePage1[] = _("The edited text will not be saved."); +const u8 gOtherText_EditedTextNoSavePage2[] = _("Is that okay?"); +const u8 gOtherText_EnterAPhraseOrWord[] = _("Please enter a phrase or word."); +const u8 gOtherText_TextNoDelete[] = _("The entire text can’t be deleted."); +const u8 gOtherText_OnlyOnePhrase[] = _("Only one phrase may be changed."); +const u8 gOtherText_OriginalSongRestored[] = _("The original song will be restored."); +const u8 gOtherText_TrendyAlready[] = _("That’s trendy already!"); +const u8 gOtherText_CombineTwoPhrases[] = _("Combine two words or phrases."); +const u8 gOtherText_QuitGivingInfo[] = _("Quit giving information?"); +const u8 gOtherText_StopGivingMail[] = _("Stop giving the POKéMON MAIL?"); +const u8 gOtherText_Profile[] = _("PROFILE"); +const u8 gOtherText_AtBattleStart[] = _("At the battle’s start."); +const u8 gOtherText_UponWinningBattle[] = _("Upon winning a battle."); +const u8 gOtherText_UponLosingBattle[] = _("Upon losing a battle."); + +// mauville_old_man? +const u8 gOtherText_TheBardsSong[] = _("The BARD’s Song"); +const u8 gOtherText_WhatsHipHappening[] = _("What’s hip and happening?"); +const u8 gOtherText_Interview[] = _("Interview"); +const u8 gOtherText_GoodSaying[] = _("Good saying"); +const u8 OtherText_SoPretty[] = _(" so pretty!"); +const u8 OtherText_SoDarling[] = _(" so darling!"); +const u8 OtherText_SoRelaxed[] = _(" so relaxed!"); +const u8 OtherText_SoSunny[] = _(" so sunny!"); +const u8 OtherText_SoDesirable[] = _(" so desirable!"); +const u8 OtherText_SoExciting[] = _(" so exciting!"); +const u8 OtherText_SoAmusing[] = _(" so amusing!"); +const u8 OtherText_SoMagical[] = _(" so magical!"); + +const u8 gOtherText_Is[] = _(" is"); +const u8 gOtherText_DontYouAgree[] = _("\nDon’t you agree?"); + +const u8 OtherText_WantVacationNicePlace[] = _("I so want to go on a vacation.\nWould you happen to know a nice place?"); +const u8 OtherText_BoughtCrayonsIsNice[] = _("I bought crayons with 120 colors!\nDon’t you think that’s nice?"); +const u8 OtherText_IfWeCouldFloat[] = _("Wouldn’t it be nice if we could float\naway on a cloud of bubbles?"); +const u8 OtherText_SandWashesAwayMakeSad[] = _("When you write on a sandy beach,\nthey wash away. It makes me sad."); +const u8 OtherText_WhatsBottomSeaLike[] = _("What’s the bottom of the sea like?\nJust once I would so love to go!"); +const u8 OtherText_SeeSettingSun[] = _("When you see the setting sun, does it\nmake you want to go home?"); +const u8 OtherText_LyingInGreenGrass[] = _("Lying back in the green grass...\nOh, it’s so, so nice!"); +const u8 OtherText_SecretBasesWonderful[] = _("SECRET BASES are so wonderful!\nCan’t you feel the excitement?"); + +const u8 OtherText_PokeLeague[] = _("POKéMON LEAGUE"); +const u8 OtherText_PokeCenter[] = _("POKéMON CENTER"); + +const u8 gOtherText_GetsAPokeBlock[] = _(" gets a {POKEBLOCK}?"); + +const u8 OtherText_Coolness[] = _("Coolness "); +const u8 OtherText_Beauty[] = _("Beauty "); +const u8 OtherText_Cuteness[] = _("Cuteness "); +const u8 OtherText_Smartness[] = _("Smartness "); +const u8 OtherText_Toughness[] = _("Toughness "); + +const u8 gOtherText_WasEnhanced[] = _("was enhanced!"); +const u8 gOtherText_NothingChanged[] = _("Nothing changed!"); +const u8 gOtherText_WontEat[] = _("It won’t eat anymore..."); + +const u8 gSystemText_SaveFailedBackupCheck[] = _("Save failed.\nChecking the backup memory...\nPlease wait.\n{COLOR RED}“Time required: 1 minute”"); +const u8 gSystemText_BackupDamagedGameContinue[] = _("The backup memory is damaged or\nthe internal battery has run dry.\nThe game can be played. However,\nprogress cannot be saved."); +const u8 gSystemText_GameplayEnded[] = _("{COLOR RED}“Gameplay cannot be continued.\nReturning to the title screen...”"); +const u8 gSystemText_CheckCompleteSaveAttempt[] = _("Check completed.\nAttempting to save again.\nPlease wait."); +const u8 gSystemText_SaveCompletedGameEnd[] = _("Save completed.\n{COLOR RED}“Gameplay cannot be continued.\nReturning to the title screen.”"); +const u8 gSystemText_SaveCompletedPressA[] = _("Save completed.\n{COLOR RED}“Please press the A Button.”"); + +const u8 gOtherText_Ferry[] = _("FERRY"); +const u8 gOtherText_SecretBase[] = _("SECRET BASE"); +const u8 gOtherText_Hideout[] = _("HIDEOUT"); + +const u8 gSystemText_ResetRTCPrompt[] = _("Reset RTC?\nA: Confirm, B: Cancel"); +const u8 gSystemText_PresentTime[] = _("Present time in game"); +const u8 gSystemText_PreviousTime[] = _("Previous time in game"); +const u8 gSystemText_PleaseResetTime[] = _("Please reset the time."); +const u8 gSystemText_ClockResetDataSave[] = _("The clock has been reset.\nData will be saved. Please wait."); +const u8 gSystemText_SaveCompleted[] = _("Save completed."); +const u8 gSystemText_SaveFailed[] = _("Save failed..."); +const u8 gSystemText_NoSaveFileNoTime[] = _("There is no save file, so the time\ncan’t be set."); +const u8 gSystemText_ClockAdjustmentUsable[] = _("The in-game clock adjustment system\nis now useable."); +const u8 gSystemText_Saving[] = _("SAVING...\nDON’T TURN OFF THE POWER."); diff --git a/src/task.c b/src/task.c index e79929c63..3c28a66d9 100644 --- a/src/task.c +++ b/src/task.c @@ -1,48 +1,48 @@ #include "global.h" #include "task.h" -#define NUM_TASKS 16 - +#define ACTIVE_SENTINEL 0x10 #define HEAD_SENTINEL 0xFE #define TAIL_SENTINEL 0xFF -struct Task gTasks[NUM_TASKS]; +// gTasks is a queue of the active 16 tasks +struct Task gTasks[ACTIVE_SENTINEL]; static void InsertTask(u8 newTaskId); static u8 FindFirstActiveTask(); void ResetTasks() { - u8 i; + u8 taskId; - for (i = 0; i < NUM_TASKS; i++) + for (taskId = 0; taskId < ACTIVE_SENTINEL; taskId++) { - gTasks[i].isActive = FALSE; - gTasks[i].func = TaskDummy; - gTasks[i].prev = i; - gTasks[i].next = i + 1; - gTasks[i].priority = -1; - memset(gTasks[i].data, 0, sizeof(gTasks[i].data)); + gTasks[taskId].isActive = FALSE; + gTasks[taskId].func = TaskDummy; + gTasks[taskId].prev = taskId; + gTasks[taskId].next = taskId + 1; + gTasks[taskId].priority = -1; + memset(gTasks[taskId].data, 0, sizeof(gTasks[taskId].data)); } gTasks[0].prev = HEAD_SENTINEL; - gTasks[NUM_TASKS - 1].next = TAIL_SENTINEL; + gTasks[ACTIVE_SENTINEL - 1].next = TAIL_SENTINEL; } u8 CreateTask(TaskFunc func, u8 priority) { - u8 i; + u8 taskId; - for (i = 0; i < NUM_TASKS; i++) + for (taskId = 0; taskId < ACTIVE_SENTINEL; taskId++) { - if (!gTasks[i].isActive) + if (!gTasks[taskId].isActive) { - gTasks[i].func = func; - gTasks[i].priority = priority; - InsertTask(i); - memset(gTasks[i].data, 0, sizeof(gTasks[i].data)); - gTasks[i].isActive = TRUE; - return i; + gTasks[taskId].func = func; + gTasks[taskId].priority = priority; + InsertTask(taskId); + memset(gTasks[taskId].data, 0, sizeof(gTasks[taskId].data)); + gTasks[taskId].isActive = TRUE; + return taskId; } } @@ -53,9 +53,9 @@ static void InsertTask(u8 newTaskId) { u8 taskId = FindFirstActiveTask(); - if (taskId == NUM_TASKS) + if (taskId == ACTIVE_SENTINEL) { - // The new task is the only task. + // The task system inserts from the top downwards starting from the end (0xFF) to 0. If FindFirstActiveTask returned the value equivalent to ACTIVE_SENTINEL, it means it is the only task because it searched the entire queue. gTasks[newTaskId].prev = HEAD_SENTINEL; gTasks[newTaskId].next = TAIL_SENTINEL; return; @@ -69,12 +69,14 @@ static void InsertTask(u8 newTaskId) // so we insert the new task before it. gTasks[newTaskId].prev = gTasks[taskId].prev; gTasks[newTaskId].next = taskId; + if (gTasks[taskId].prev != HEAD_SENTINEL) - gTasks[gTasks[taskId].prev].next = newTaskId; + gTasks[gTasks[taskId].prev].next = newTaskId; // as long as we are not at the end, insert the newTask appropriately. + gTasks[taskId].prev = newTaskId; return; } - if (gTasks[taskId].next == TAIL_SENTINEL) + if (gTasks[taskId].next == TAIL_SENTINEL) // we did not find a space for the task, so overwrite the last task as it is the lowest priority. { // We've reached the end. gTasks[newTaskId].prev = taskId; @@ -82,7 +84,7 @@ static void InsertTask(u8 newTaskId) gTasks[taskId].next = newTaskId; return; } - taskId = gTasks[taskId].next; + taskId = gTasks[taskId].next; // neither the priority was lower, nor the end. check the next task. } } @@ -112,11 +114,11 @@ void DestroyTask(u8 taskId) } } -void RunTasks() +void RunTasks(void) { u8 taskId = FindFirstActiveTask(); - if (taskId != NUM_TASKS) + if (taskId != ACTIVE_SENTINEL) { do { @@ -126,11 +128,11 @@ void RunTasks() } } -static u8 FindFirstActiveTask() +static u8 FindFirstActiveTask(void) { u8 taskId; - for (taskId = 0; taskId < NUM_TASKS; taskId++) + for (taskId = 0; taskId < ACTIVE_SENTINEL; taskId++) if (gTasks[taskId].isActive == TRUE && gTasks[taskId].prev == HEAD_SENTINEL) break; @@ -173,7 +175,7 @@ bool8 FuncIsActiveTask(TaskFunc func) { u8 i; - for (i = 0; i < NUM_TASKS; i++) + for (i = 0; i < ACTIVE_SENTINEL; i++) if (gTasks[i].isActive == TRUE && gTasks[i].func == func) return TRUE; @@ -184,19 +186,19 @@ u8 FindTaskIdByFunc(TaskFunc func) { s32 i; - for (i = 0; i < NUM_TASKS; i++) + for (i = 0; i < ACTIVE_SENTINEL; i++) if (gTasks[i].isActive == TRUE && gTasks[i].func == func) return (u8)i; return -1; } -u8 GetTaskCount() +u8 GetTaskCount(void) { u8 i; u8 count = 0; - for (i = 0; i < NUM_TASKS; i++) + for (i = 0; i < ACTIVE_SENTINEL; i++) if (gTasks[i].isActive == TRUE) count++; diff --git a/src/trainer_card.c b/src/trainer_card.c index 5239c6c90..0070e8a9a 100644 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -14,6 +14,7 @@ #include "sprite.h" #include "string_util.h" #include "task.h" +#include "script_pokemon_80C4.h" typedef void (*Callback)(void); diff --git a/src/trainer_see.c b/src/trainer_see.c index 9d58faab8..56085f9be 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -1,5 +1,4 @@ #include "global.h" -#include "trainer_see.h" #include "asm.h" #include "asm_fieldmap.h" #include "battle_setup.h" @@ -9,6 +8,7 @@ #include "script.h" #include "sprite.h" #include "task.h" +#include "trainer_see.h" extern bool8 (*gIsTrainerInRange[])(struct MapObject *, u16, s16, s16); extern bool8 (*gTrainerSeeFuncList[])(u8, struct Task *, struct MapObject *); diff --git a/sym_common.txt b/sym_common.txt index 4a404ccf8..fcd138cb4 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -216,7 +216,7 @@ gUnknown_03005560: @ 3005560 gUnknown_030056A0: @ 30056A0 .space 0x640 -gUnknown_03005CE0: @ 3005CE0 +gLastFieldPokeMenuOpened: @ 3005CE0 .space 0x4 gUnknown_03005CE4: @ 3005CE4 @@ -309,22 +309,22 @@ gUnknown_03005E94: @ 3005E94 gUnknown_03005E98: @ 3005E98 .space 0x4 -gUnknown_03005E9C: @ 3005E9C +gLastWrittenSector: @ 3005E9C .space 0x4 -gUnknown_03005EA0: @ 3005EA0 +gLastSaveCounter: @ 3005EA0 .space 0x4 -gUnknown_03005EA4: @ 3005EA4 +gLastKnownGoodSector: @ 3005EA4 .space 0x4 -gUnknown_03005EA8: @ 3005EA8 +gDamagedSaveSectors: @ 3005EA8 .space 0x4 -gUnknown_03005EAC: @ 3005EAC +gSaveCounter: @ 3005EAC .space 0x4 -gUnknown_03005EB0: @ 3005EB0 +gFastSaveSection: @ 3005EB0 .space 0x4 gUnknown_03005EB4: @ 3005EB4 @@ -333,13 +333,13 @@ gUnknown_03005EB4: @ 3005EB4 gSaveFileStatus: @ 3005EB8 .space 0x4 -gUnknown_03005EBC: @ 3005EBC +gGameContinueCallback: @ 3005EBC .space 0x14 gIntroFrameCounter: @ 3005ED0 .space 0x10 -gUnknown_03005EE0: @ 3005EE0 +gMultibootProgramStruct: @ 3005EE0 .space 0x2C gUnknown_03005F0C: @ 3005F0C diff --git a/sym_ewram.txt b/sym_ewram.txt index 10ebf59c9..fd8d4bb49 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -335,7 +335,7 @@ gUnknown_020297E4: @ 20297E4 gUnknown_020297E8: @ 20297E8 .space 0x4 -gUnknown_020297EC: @ 20297EC +gDifferentSaveFile: @ 20297EC .space 0x1 gUnknown_020297ED: @ 20297ED @@ -512,13 +512,7 @@ gUnknown_0202FF58: @ 202FF58 .include "src/wild_encounter.o" gUnknown_0202FF84: @ 202FF84 - .space 0x4 - -gUnknown_0202FF88: @ 202FF88 - .space 0x4 - -gUnknown_0202FF8C: @ 202FF8C - .space 0x18 + .space 0x20 gUnknown_0202FFA4: @ 202FFA4 .space 0x4 @@ -937,7 +931,7 @@ gUnknown_0203926A: @ 203926A gUnknown_0203926C: @ 203926C .space 0x4 -gUnknown_02039270: @ 2039270 +gSelectedOrderFromParty: @ 2039270 .space 0x4 gUnknown_02039274: @ 2039274 @@ -961,7 +955,7 @@ gUnknown_0203927C: @ 203927C gUnknown_0203927D: @ 203927D .space 0x7 -gUnknown_02039284: @ 2039284 +gLastSaveSectorStatus: @ 2039284 .space 0x4 gUnknown_02039288: @ 2039288 @@ -1025,12 +1019,13 @@ gUnknown_0203932E: @ 203932E gUnknown_02039338: @ 2039338 .space 0x4 -gUnknown_0203933C: @ 203933C +gSaveFailedType: @ 203933C .space 0x2 -gUnknown_0203933E: @ 203933E +gSaveFailedClockInfo: @ 203933E .space 0x12 + .align 2 gUnknown_02039350: @ 2039350 .space 0x8 |