From 023cfdbb051ea5184ebc7fa329db3ca43f1ca23e Mon Sep 17 00:00:00 2001 From: yenatch Date: Thu, 12 Jun 2014 18:32:42 -0700 Subject: [PATCH] Consolidate monster structs in wram and sram. The PartyMon struct is really the box struct with volatile variables like status added. Some other labels have been reworked. Move structs no longer have explicit labels since their location is arbitrary and usually shared. --- battle/ai/scoring.asm | 261 ++++--- battle/core.asm | 296 ++++---- battle/effect_commands.asm | 103 +-- constants/misc_constants.asm | 4 +- data/odd_eggs.asm | 2 +- engine/engine_flags.asm | 12 +- engine/scripting.asm | 2 +- event/name_rater.asm | 10 +- event/poke_seer.asm | 6 +- home/battle.asm | 8 +- home/map.asm | 2 +- items/item_effects.asm | 20 +- main.asm | 1232 +++++++++++++++++----------------- wram.asm | 708 +++++-------------- 14 files changed, 1128 insertions(+), 1538 deletions(-) diff --git a/battle/ai/scoring.asm b/battle/ai/scoring.asm index 7a34ec3d0..ab4aca83f 100644 --- a/battle/ai/scoring.asm +++ b/battle/ai/scoring.asm @@ -16,7 +16,7 @@ AIScoring_RedStatus: ; 38591 inc de call AIGetEnemyMove - ld a, [EnemyMoveEffect] + ld a, [wEnemyMoveStruct + MOVE_EFFECT] ld c, a push hl @@ -28,7 +28,7 @@ AIScoring_RedStatus: ; 38591 pop hl jr nz, .discourage - ld a, [EnemyMoveEffect] + ld a, [wEnemyMoveStruct + MOVE_EFFECT] push hl push de push bc @@ -82,7 +82,7 @@ AIScoring_RedStatMods: ; 385e0 inc de call AIGetEnemyMove - ld a, [EnemyMoveEffect] + ld a, [wEnemyMoveStruct + MOVE_EFFECT] cp EFFECT_ATTACK_UP jr c, .checkmove @@ -119,7 +119,7 @@ AIScoring_RedStatMods: ; 385e0 jr nz, .discourage .encourage - call Function_0x39527 + call Function39527 jr c, .checkmove dec [hl] @@ -173,7 +173,7 @@ AIScoring_RedSuperEffective: ; 38635 jr c, .noteffective ; effective - ld a, [EnemyMovePower] + ld a, [wEnemyMoveStruct + MOVE_POWER] and a jr z, .checkmove dec [hl] @@ -185,7 +185,7 @@ AIScoring_RedSuperEffective: ; 38635 push hl push de push bc - ld a, [EnemyMoveType] + ld a, [wEnemyMoveStruct + MOVE_TYPE] ld d, a ld hl, EnemyMonMoves ld b, EnemyMonMovesEnd - EnemyMonMoves + 1 @@ -199,10 +199,10 @@ AIScoring_RedSuperEffective: ; 38635 jr z, .asm_38693 call AIGetEnemyMove - ld a, [EnemyMoveType] + ld a, [wEnemyMoveStruct + MOVE_TYPE] cp d jr z, .checkmove2 - ld a, [EnemyMovePower] + ld a, [wEnemyMoveStruct + MOVE_POWER] and a jr nz, .asm_38692 jr .checkmove2 @@ -244,7 +244,7 @@ AIScoring_Offensive: ; 386a2 inc de call AIGetEnemyMove - ld a, [EnemyMovePower] + ld a, [wEnemyMoveStruct + MOVE_POWER] and a jr nz, .checkmove @@ -275,7 +275,7 @@ AIScoring_Smart: ; 386be push hl call AIGetEnemyMove - ld a, [EnemyMoveEffect] + ld a, [wEnemyMoveStruct + MOVE_EFFECT] ld hl, .table_386f2 ld de, 3 call IsInArray @@ -398,7 +398,7 @@ AIScoring_Sleep: ; 387e3 ret nc .asm_387f0 - call Function_0x39527 + call Function39527 ret c dec [hl] dec [hl] @@ -421,7 +421,7 @@ AIScoring_LeechHit: ; 387f7 call AICheckEnemyMaxHP ret c - call Function_0x39521 + call Function39521 ret c dec [hl] @@ -484,8 +484,8 @@ AIScoring_LockOn: ; 3881d call AIGetEnemyMove - ld a, [EnemyMoveAccuracy] - cp $b4 + ld a, [wEnemyMoveStruct + MOVE_ACC] + cp 180 jr nc, .asm_3884f ld a, $1 @@ -513,7 +513,7 @@ AIScoring_LockOn: ; 3881d .asm_3887a pop hl - call Function_0x39527 + call Function39527 ret c dec [hl] @@ -538,8 +538,8 @@ AIScoring_LockOn: ; 3881d inc de call AIGetEnemyMove - ld a, [EnemyMoveAccuracy] - cp $b4 + ld a, [wEnemyMoveStruct + MOVE_ACC] + cp 180 jr nc, .asm_3888b dec [hl] @@ -602,19 +602,16 @@ AIScoring_EvasionUp: ; 388d4 jp nc, AIDiscourageMove call AICheckEnemyMaxHP - jr nc, .asm_388f2 ld a, [PlayerSubStatus5] - bit 0, a + bit SUBSTATUS_TOXIC, a jr nz, .asm_388ef call Random - cp $b2 jr nc, .asm_38911 - .asm_388ef dec [hl] dec [hl] @@ -622,42 +619,35 @@ AIScoring_EvasionUp: ; 388d4 .asm_388f2 call AICheckEnemyQuarterHP - jr nc, .asm_3890f call Random - cp $a jr c, .asm_388ef call AICheckEnemyHalfHP - jr nc, .asm_3890a - call Function_0x39521 - + call Function39521 jr c, .asm_388ef - jr .asm_38911 .asm_3890a - call Function_0x39527 - + call Function39527 jr c, .asm_38911 - .asm_3890f inc [hl] inc [hl] .asm_38911 ld a, [PlayerSubStatus5] - bit 0, a + bit SUBSTATUS_TOXIC, a jr nz, .asm_38938 ld a, [PlayerSubStatus4] - bit 7, a + bit SUBSTATUS_LEECH_SEED, a jr nz, .asm_38941 ld a, [EnemyEvaLevel] @@ -671,7 +661,7 @@ AIScoring_EvasionUp: ; 388d4 jr nz, .asm_388ef ld a, [PlayerSubStatus1] - bit 6, a + bit SUBSTATUS_ENCORED, a jr nz, .asm_388ef @@ -688,7 +678,7 @@ AIScoring_EvasionUp: ; 388d4 ret .asm_38941 - call Function_0x39527 + call Function39527 ret c dec [hl] @@ -706,7 +696,7 @@ AIScoring_AlwaysHit: ; 38947 ret c .asm_38954 - call Function_0x39521 + call Function39521 ret c dec [hl] @@ -721,30 +711,29 @@ AIScoring_MirrorMove: ; 3895b jr nz, .asm_38968 call AICompareSpeed - ret nc - jp AIDiscourageMove + jp AIDiscourageMove .asm_38968 push hl ld hl, Table_0x39301 ld de, 1 call IsInArray - pop hl ret nc - call Function_0x39527 + call Function39527 ret c + dec [hl] call AICompareSpeed - ret nc - call Random + call Random cp $19 ret c + dec [hl] ret ; 38985 @@ -752,23 +741,19 @@ AIScoring_MirrorMove: ; 3895b AIScoring_AccuracyDown: ; 38985 call AICheckPlayerMaxHP - jr nc, .asm_389a0 call AICheckEnemyHalfHP - jr nc, .asm_389a0 ld a, [PlayerSubStatus5] - bit 0, a + bit SUBSTATUS_TOXIC, a jr nz, .asm_3899d call Random - cp $b2 jr nc, .asm_389bf - .asm_3899d dec [hl] dec [hl] @@ -776,42 +761,34 @@ AIScoring_AccuracyDown: ; 38985 .asm_389a0 call AICheckPlayerQuarterHP - jr nc, .asm_389bd call Random - cp $a jr c, .asm_3899d call AICheckPlayerHalfHP - jr nc, .asm_389b8 - call Function_0x39521 - + call Function39521 jr c, .asm_3899d - jr .asm_389bf - .asm_389b8 - call Function_0x39527 - + call Function39527 jr c, .asm_389bf - .asm_389bd inc [hl] inc [hl] .asm_389bf ld a, [PlayerSubStatus5] - bit 0, a + bit SUBSTATUS_TOXIC, a jr nz, .asm_389e6 ld a, [PlayerSubStatus4] - bit 7, a + bit SUBSTATUS_LEECH_SEED, a jr nz, .asm_389ef ld a, [EnemyEvaLevel] @@ -825,10 +802,9 @@ AIScoring_AccuracyDown: ; 38985 jr nz, .asm_3899d ld a, [PlayerSubStatus1] - bit 6, a + bit SUBSTATUS_ENCORED, a jr nz, .asm_3899d - .asm_389e4 inc [hl] ret @@ -842,9 +818,9 @@ AIScoring_AccuracyDown: ; 38985 ret .asm_389ef - call Function_0x39527 - + call Function39527 ret c + dec [hl] ret ; 389f5 @@ -862,7 +838,6 @@ AIScoring_Haze: ; 389f5 jr c, .asm_38a12 jr .asm_389fb - .asm_38a05 ld hl, PlayerAtkLevel ld c, $8 @@ -984,7 +959,7 @@ AIScoring_Bind: ; 38a71 jr z, .asm_38a91 .asm_38a8b - call Function_0x39527 + call Function39527 ret c inc [hl] ret @@ -992,7 +967,7 @@ AIScoring_Bind: ; 38a71 .asm_38a91 call AICheckEnemyQuarterHP ret nc - call Function_0x39527 + call Function39527 ret c dec [hl] dec [hl] @@ -1022,7 +997,7 @@ AIScoring_Unused2B: ; 38a9c call AIGetEnemyMove - ld a, [EnemyMoveEffect] + ld a, [wEnemyMoveStruct + MOVE_EFFECT] cp EFFECT_PROTECT jr z, .asm_38ad5 dec c @@ -1081,14 +1056,14 @@ AIScoring_SpDefenseUp2: ; 38aed ret nc ld a, [BattleMonType1] - cp FIRE + cp SPECIAL jr nc, .asm_38b09 ld a, [BattleMonType2] - cp FIRE + cp SPECIAL ret c .asm_38b09 - call Function_0x39521 + call Function39521 ret c dec [hl] dec [hl] @@ -1128,14 +1103,14 @@ AIScoring_Paralyze: ; 38b26 ret c call AICheckEnemyQuarterHP ret nc - call Function_0x39521 + call Function39521 ret c dec [hl] dec [hl] ret .asm_38b3a - call Function_0x39527 + call Function39527 ret c inc [hl] ret @@ -1143,7 +1118,7 @@ AIScoring_Paralyze: ; 38b26 AIScoring_SpeedDownHit: ; 38b40 - ld a, [EnemyMoveAnimation] + ld a, [wEnemyMoveStruct + MOVE_ANIM] cp ICY_WIND ret nz call AICheckEnemyQuarterHP @@ -1174,7 +1149,7 @@ AIScoring_HyperBeam: ; 38b63 jr c, .asm_38b72 call AICheckEnemyQuarterHP ret c - call Function_0x39527 + call Function39527 ret c dec [hl] ret @@ -1184,7 +1159,7 @@ AIScoring_HyperBeam: ; 38b63 cp 40 ret c inc [hl] - call Function_0x39527 + call Function39527 ret c inc [hl] ret @@ -1196,7 +1171,7 @@ AIScoring_Rage: ; 38b7f bit 6, a jr z, .asm_38b9b - call Function_0x39527 + call Function39527 jr c, .asm_38b8c dec [hl] @@ -1216,7 +1191,7 @@ AIScoring_Rage: ; 38b7f call AICheckEnemyHalfHP jr nc, .asm_38ba6 - call Function_0x39521 + call Function39521 ret nc dec [hl] ret @@ -1249,7 +1224,7 @@ AIScoring_Mimic: ; 38ba8 jr c, .asm_38bef jr z, .asm_38bd4 - call Function_0x39527 + call Function39527 jr c, .asm_38bd4 dec [hl] @@ -1263,7 +1238,7 @@ AIScoring_Mimic: ; 38ba8 pop hl ret nc - call Function_0x39527 + call Function39527 ret c dec [hl] ret @@ -1291,12 +1266,12 @@ AIScoring_Counter: ; 38bf1 call AIGetEnemyMove - ld a, [EnemyMovePower] + ld a, [wEnemyMoveStruct + MOVE_POWER] and a jr z, .asm_38c0e - ld a, [EnemyMoveType] - cp $14 + ld a, [wEnemyMoveStruct + MOVE_TYPE] + cp SPECIAL jr nc, .asm_38c0e inc b @@ -1319,12 +1294,12 @@ AIScoring_Counter: ; 38bf1 call AIGetEnemyMove - ld a, [EnemyMovePower] + ld a, [wEnemyMoveStruct + MOVE_POWER] and a jr z, .asm_38c38 - ld a, [EnemyMoveType] - cp $14 + ld a, [wEnemyMoveStruct + MOVE_TYPE] + cp SPECIAL jr nc, .asm_38c38 @@ -1354,12 +1329,12 @@ AIScoring_Encore: ; 38c3b call AIGetEnemyMove - ld a, [EnemyMovePower] + ld a, [wEnemyMoveStruct + MOVE_POWER] and a jr z, .asm_38c68 push hl - ld a, [EnemyMoveType] + ld a, [wEnemyMoveStruct + MOVE_TYPE] ld hl, EnemyMonType1 ld a, $41 call Predef @@ -1433,7 +1408,7 @@ AIScoring_Encore: ; 38c3b AIScoring_PainSplit: ; 38ca4 push hl - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld b, [hl] inc hl ld c, [hl] @@ -1490,7 +1465,7 @@ AIScoring_Spite: ; 38cd5 call AICompareSpeed jp c, AIDiscourageMove - call Function_0x39527 + call Function39527 ret c inc [hl] ret @@ -1596,7 +1571,7 @@ AIScoring_HealBell: ; 38d1f .asm_38d48 and $27 ret z - call Function_0x39527 + call Function39527 ret c dec [hl] @@ -1664,7 +1639,7 @@ AIScoring_Conversion2: ; 38d98 ld a, BANK(Moves) call GetFarByte - ld [PlayerMoveType], a + ld [wPlayerMoveStruct + MOVE_TYPE], a xor a ld [hBattleTurn], a @@ -1677,7 +1652,7 @@ AIScoring_Conversion2: ; 38d98 jr c, .asm_38dc9 ret z - call Function_0x39527 + call Function39527 ret c dec [hl] @@ -1713,7 +1688,7 @@ AIScoring_Disable: ; 38dd1 ret .asm_38dee - ld a, [EnemyMovePower] + ld a, [wEnemyMoveStruct + MOVE_POWER] and a ret nz @@ -1755,7 +1730,7 @@ AIScoring_MeanLook: ; 38dfb ret .asm_38e26 - call Function_0x39521 + call Function39521 ret c dec [hl] dec [hl] @@ -1792,7 +1767,7 @@ AICheckLastPlayerMon: ; 38e2e AIScoring_Nightmare: ; 38e4a - call Function_0x39527 + call Function39527 ret c dec [hl] ret @@ -1832,12 +1807,12 @@ AIScoring_Curse: ; 38e5c ld a, [BattleMonType1] cp GHOST jr z, .asm_38e92 - cp FIRE + cp SPECIAL ret nc ld a, [BattleMonType2] - cp FIRE + cp SPECIAL ret nc - call Function_0x39521 + call Function39521 ret c dec [hl] dec [hl] @@ -1892,7 +1867,7 @@ AIScoring_Curse: ; 38e5c ret nz .asm_38ecb - call Function_0x39527 + call Function39527 ret c dec [hl] @@ -1936,7 +1911,7 @@ AIScoring_Protect: ; 38ed2 jr c, .asm_38f14 .asm_38f0d - call Function_0x39521 + call Function39521 ret c dec [hl] ret @@ -2002,14 +1977,14 @@ AIScoring_PerishSong: ; 38f4a pop hl ret c - call Function_0x39527 + call Function39527 ret c inc [hl] ret .asm_38f6f - call Function_0x39527 + call Function39527 ret c dec [hl] @@ -2043,7 +2018,7 @@ AIScoring_Sandstorm: ; 38f7a call AICheckPlayerHalfHP jr nc, .asm_38fa6 - call Function_0x39527 + call Function39527 ret c dec [hl] @@ -2079,7 +2054,7 @@ AIScoring_Endure: ; 38fac call AIHasMove jr nc, .asm_38fcb - call Function_0x39521 + call Function39521 ret c dec [hl] @@ -2091,7 +2066,7 @@ AIScoring_Endure: ; 38fac ld a, [EnemySubStatus5] bit SUBSTATUS_LOCK_ON, a ret z - call Function_0x39527 + call Function39527 ret c dec [hl] @@ -2161,7 +2136,7 @@ AIScoring_Rollout: ; 38fef ret .asm_39020 - call Function_0x39521 + call Function39521 ret c inc [hl] ret @@ -2174,7 +2149,7 @@ AIScoring_Attract: ; 39026 and a jr z, .asm_39032 - call Function_0x39521 + call Function39521 ret c inc [hl] ret @@ -2191,7 +2166,7 @@ AIScoring_Attract: ; 39026 AIScoring_Safeguard: ; 3903a call AICheckPlayerHalfHP ret c - call Function_0x39521 + call Function39521 ret c inc [hl] ret @@ -2217,7 +2192,7 @@ AIScoring_Earthquake: ; 39044 .asm_39058 call AICompareSpeed ret c - call Function_0x39527 + call Function39527 ret c dec [hl] ret @@ -2239,13 +2214,13 @@ AIScoring_BatonPass: ; 39062 AIScoring_Pursuit: ; 39072 call AICheckPlayerQuarterHP jr nc, .asm_3907d - call Function_0x39521 + call Function39521 ret c inc [hl] ret .asm_3907d - call Function_0x39527 + call Function39527 ret c dec [hl] dec [hl] @@ -2267,7 +2242,7 @@ AIScoring_RapidSpin: ; 39084 ret z .asm_39097 - call Function_0x39521 + call Function39521 ret c dec [hl] @@ -2372,7 +2347,7 @@ AIScoring_WeatherMove: ; 3910d call AICheckPlayerHalfHP jr nc, AIBadWeatherType - call Function_0x39527 + call Function39527 ret c dec [hl] @@ -2476,7 +2451,7 @@ AIScoring_PsychUp: ; 39152 ld a, [EnemyEvaLevel] cp $8 ret nc - call Function_0x39521 + call Function39521 ret c dec [hl] @@ -2502,12 +2477,12 @@ AIScoring_MirrorCoat: ; 3918b call AIGetEnemyMove - ld a, [EnemyMovePower] + ld a, [wEnemyMoveStruct + MOVE_POWER] and a jr z, .asm_391a8 - ld a, [EnemyMoveType] - cp FIRE + ld a, [wEnemyMoveStruct + MOVE_TYPE] + cp SPECIAL jr c, .asm_391a8 inc b @@ -2530,12 +2505,12 @@ AIScoring_MirrorCoat: ; 3918b call AIGetEnemyMove - ld a, [EnemyMovePower] + ld a, [wEnemyMoveStruct + MOVE_POWER] and a jr z, .asm_391d2 - ld a, [EnemyMoveType] - cp FIRE + ld a, [wEnemyMoveStruct + MOVE_TYPE] + cp SPECIAL jr c, .asm_391d2 @@ -2574,7 +2549,7 @@ AIScoring_Gust: ; 391d5 .asm_391e9 call AICompareSpeed ret c - call Function_0x39527 + call Function39527 ret c dec [hl] ret @@ -2600,7 +2575,7 @@ AIScoring_Stomp: ; 39200 and a ret z - call Function_0x39521 + call Function39521 ret c dec [hl] @@ -2625,7 +2600,7 @@ AIScoring_Solarbeam: ; 3920b ret .asm_3921e - call Function_0x39521 + call Function39521 ret c dec [hl] @@ -2650,13 +2625,13 @@ AIScoring_Thunder: ; 39225 AICompareSpeed: ; 39233 push bc - ld a, [EnemyMonSpd + 1] + ld a, [EnemyMonSpeed + 1] ld b, a - ld a, [BattleMonSpd + 1] + ld a, [BattleMonSpeed + 1] cp b - ld a, [EnemyMonSpd] + ld a, [EnemyMonSpeed] ld b, a - ld a, [BattleMonSpd] + ld a, [BattleMonSpeed] sbc b pop bc ret @@ -2677,8 +2652,8 @@ AICheckEnemyMaxHP: ; 39251 push hl push de push bc - ld de, EnemyMonHPHi - ld hl, EnemyMonMaxHPHi + ld de, EnemyMonHP + ld hl, EnemyMonMaxHP ; fallthrough ; 3925a @@ -2733,7 +2708,7 @@ AICheckEnemyHalfHP: ; 39281 push hl push de push bc - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld b, [hl] inc hl ld c, [hl] @@ -2756,7 +2731,7 @@ AICheckEnemyQuarterHP: ; 39298 push hl push de push bc - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld b, [hl] inc hl ld c, [hl] @@ -2811,7 +2786,7 @@ AIHasMove: ; 392ca call AIGetEnemyMove - ld a, [EnemyMoveEffect] + ld a, [wEnemyMoveStruct + MOVE_EFFECT] cp b jr z, .asm_392e3 @@ -2898,7 +2873,7 @@ AIScoring_Opportunist: ; 39315 call AICheckEnemyQuarterHP jr nc, .asm_39322 - call Function_0x39527 + call Function39527 ret c .asm_39322 @@ -2992,7 +2967,7 @@ AIScoring_Aggressive: ; 39369 push de push bc call AIGetEnemyMove - ld a, [EnemyMovePower] + ld a, [wEnemyMoveStruct + MOVE_POWER] and a jr z, .nodamage call AIDamageCalc @@ -3043,14 +3018,14 @@ AIScoring_Aggressive: ; 39369 call AIGetEnemyMove - ld a, [EnemyMovePower] + ld a, [wEnemyMoveStruct + MOVE_POWER] cp 2 jr c, .checkmove2 push hl push de push bc - ld a, [EnemyMoveEffect] + ld a, [wEnemyMoveStruct + MOVE_EFFECT] ld hl, .aggressivemoves ld de, 1 call IsInArray @@ -3077,7 +3052,7 @@ AIScoring_Aggressive: ; 39369 AIDamageCalc: ; 393e7 ld a, 1 ld [hBattleTurn], a - ld a, [EnemyMoveEffect] + ld a, [wEnemyMoveStruct + MOVE_EFFECT] ld de, 1 ld hl, .ConstantDamageEffects call IsInArray @@ -3175,7 +3150,7 @@ AIScoring_StatusImmunity: ; 39453 inc de call AIGetEnemyMove - ld a, [EnemyMoveEffect] + ld a, [wEnemyMoveStruct + MOVE_EFFECT] cp EFFECT_TOXIC jr z, .poisonimmunity cp EFFECT_POISON @@ -3185,7 +3160,7 @@ AIScoring_StatusImmunity: ; 39453 cp EFFECT_PARALYZE jr z, .typeimmunity - ld a, [EnemyMovePower] + ld a, [wEnemyMoveStruct + MOVE_POWER] and a jr z, .checkmove @@ -3242,12 +3217,12 @@ AIScoring_Risky: ; 394a9 push hl call AIGetEnemyMove - ld a, [EnemyMovePower] + ld a, [wEnemyMoveStruct + MOVE_POWER] and a jr z, .nextmove ; Don't use risky moves at max hp. - ld a, [EnemyMoveEffect] + ld a, [wEnemyMoveStruct + MOVE_EFFECT] ld de, 1 ld hl, .riskymoves call IsInArray @@ -3317,7 +3292,7 @@ AIGetEnemyMove: ; 39508 ld bc, MOVE_LENGTH call AddNTimes - ld de, EnemyMoveStruct + ld de, wEnemyMoveStruct ld a, BANK(Moves) call FarCopyBytes @@ -3328,14 +3303,14 @@ AIGetEnemyMove: ; 39508 ; 39521 -Function_0x39521: ; 39521 +Function39521: ; 39521 call Random cp 50 ; 1/5 ret ; 39527 -Function_0x39527: ; 39527 +Function39527: ; 39527 call Random cp $80 ; 1/2 ret diff --git a/battle/core.asm b/battle/core.asm index 9f3dbc661..dda37000d 100644 --- a/battle/core.asm +++ b/battle/core.asm @@ -12,8 +12,8 @@ Function3c000: ; 3c000 inc a ld [$d264], a ld hl, OTPartyMon1HP - ld bc, $002f - ld d, $3 + ld bc, OTPartyMon2 - (OTPartyMon1 + 1) + ld d, NUM_MOVES - 1 .asm_3c019 inc d ld a, [hli] @@ -166,8 +166,8 @@ Function3c12f: ; 3c12f call Function3c3f5 jp c, .asm_3c1be xor a - ld [$c710], a - ld [$c711], a + ld [wPlayerIsSwitching], a + ld [wEnemyIsSwitching], a ld [$d264], a ld [$c73f], a ld [$c740], a @@ -455,7 +455,7 @@ Function3c314: ; 3c314 jr z, .asm_3c35b cp $d jr z, .asm_3c35b - sub $4 + sub NUM_MOVES jr c, .asm_3c35b ld a, [$d0ec] cp $2 @@ -537,8 +537,8 @@ Function3c314: ; 3c314 jr .asm_3c3c5 .asm_3c3c5 - ld de, BattleMonSpd - ld hl, EnemyMonSpd + ld de, BattleMonSpeed + ld hl, EnemyMonSpeed ld c, $2 call StringCmp jr z, .asm_3c3d8 @@ -653,26 +653,26 @@ Function3c434: ; 3c434 callab UpdateMoveData xor a ld [$c732], a - ld a, [PlayerMoveEffect] - cp $77 + ld a, [wPlayerMoveStruct + MOVE_EFFECT] + cp EFFECT_FURY_CUTTER jr z, .asm_3c494 xor a ld [PlayerFuryCutterCount], a .asm_3c494 - ld a, [PlayerMoveEffect] - cp $51 + ld a, [wPlayerMoveStruct + MOVE_EFFECT] + cp EFFECT_RAGE jr z, .asm_3c4a4 ld hl, PlayerSubStatus4 - res 6, [hl] + res SUBSTATUS_RAGE, [hl] xor a ld [$c72b], a .asm_3c4a4 - ld a, [PlayerMoveEffect] - cp $6f + ld a, [wPlayerMoveStruct + MOVE_EFFECT] + cp EFFECT_PROTECT jr z, .asm_3c4c9 - cp $74 + cp EFFECT_ENDURE jr z, .asm_3c4c9 xor a ld [PlayerProtectCount], a @@ -1055,7 +1055,7 @@ Function3c706: ; 3c706 and a jr z, Function3c710 Function3c70b: ; 3c70b - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP jr Function3c713 Function3c710: ; 3c710 @@ -1176,7 +1176,7 @@ Function3c716: ; 3c716 ld a, [hBattleTurn] and a jr z, .asm_3c7f4 - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP .asm_3c7f4 ld a, [hli] @@ -1243,7 +1243,7 @@ Function3c801: ; 3c801 ret .asm_3c85c - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP xor a ld [hli], a ld [hl], a @@ -1352,7 +1352,7 @@ Function3c8eb: ; 3c8eb ld a, [hBattleTurn] and a jr z, .asm_3c922 - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP .asm_3c922 ld a, [hli] @@ -2423,7 +2423,7 @@ EnemyPartyMonEntrance: ; 3cf78 call SetEnemyTurn call SpikesDamage xor a - ld [EnemyMoveAnimation], a + ld [wEnemyMoveStruct + MOVE_ANIM], a ld [$d0ec], a inc a ret @@ -2732,7 +2732,7 @@ KantoGymLeaders: Function3d14e: ; 3d14e call Function3cef1 - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld a, [hli] or [hl] call z, Function3cf14 @@ -2743,7 +2743,7 @@ Function3d14e: ; 3d14e ld a, d and a jp z, LostBattle - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld a, [hli] or [hl] jr nz, .asm_3d185 @@ -2841,7 +2841,7 @@ Function3d1f8: ; 3d1f8 cp $1 jr z, .asm_3d20a ld hl, PartyMon1Speed - ld de, EnemyMonSpd + ld de, EnemyMonSpeed jp Function3d8b3 ; 3d227 @@ -2862,7 +2862,7 @@ Function3d227: ; 3d227 ld [$d0ec], a call Function3d2e0 jr c, .asm_3d251 - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld a, [hli] or [hl] jr nz, .asm_3d26c @@ -3296,7 +3296,7 @@ Function3d4e1: ; 3d4e1 ld [$c6fc], a ld [$d0ec], a inc a - ld [$c711], a + ld [wEnemyIsSwitching], a call Function309d jp Function3e3ad ; 3d517 @@ -3309,8 +3309,8 @@ Function3d517: ; 3d517 .asm_3d522 call Function3d6ca - ld a, $1 - ld [$c711], a + ld a, 1 + ld [wEnemyIsSwitching], a call Function3d7a0 call Function3d7b8 jp Function3d7c7 @@ -3321,7 +3321,7 @@ Function3d533: ; 3d533 and a jr z, .asm_3d541 ld a, [$d430] - sub $4 + sub NUM_MOVES ld b, a jr .asm_3d555 @@ -3435,10 +3435,10 @@ Function3d5d7: ; 3d5d7 push de push bc dec a - ld hl, Moves + MOVE_ANIM + ld hl, Moves ld bc, MOVE_LENGTH call AddNTimes - ld de, EnemyMoveAnimation + ld de, wEnemyMoveStruct ld a, BANK(Moves) call FarCopyBytes call SetEnemyTurn @@ -3475,14 +3475,14 @@ Function3d618: ; 3d618 ld a, BANK(BaseData) call FarCopyBytes ld a, [BattleMonType1] - ld [PlayerMoveType], a + ld [wPlayerMoveStruct + MOVE_TYPE], a call SetPlayerTurn callab Function347c8 ld a, [$d265] cp $b jr nc, .asm_3d663 ld a, [BattleMonType2] - ld [PlayerMoveType], a + ld [wPlayerMoveStruct + MOVE_TYPE], a callab Function347c8 ld a, [$d265] cp $b @@ -3592,14 +3592,14 @@ Function3d6ca: ; 3d6ca ld a, [$def4] and a jr nz, .asm_3d708 - ld hl, EnemyMonAtkDefDV - ld a, $2d + ld hl, EnemyMonDVs + ld a, PREDEF_GET_UNOWN_LETTER call Predef ld a, [UnownLetter] ld [$def4], a .asm_3d708 - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld a, [hli] ld [$c6ea], a ld a, [hl] @@ -3759,7 +3759,7 @@ NewEnemyMonStatus: ; 3d834 ld [hl], a ld [EnemyDisableCount], a ld [EnemyFuryCutterCount], a - ld [$c681], a + ld [EnemyProtectCount], a ld [$c72c], a ld [EnemyDisabledMove], a ld [$c6fa], a @@ -4019,21 +4019,21 @@ Function3d8b3: ; 3d8b3 Function3da0d: ; 3da0d - ld a, $0 + ld a, PartyMon1Species - PartyMon1 call GetPartyParamLocation ld de, BattleMonSpecies - ld bc, $0006 + ld bc, 1 + 1 + NUM_MOVES ; species, item, moves ; BattleMonDVs - BattleMonSpecies call CopyBytes - ld bc, $000f + ld bc, PartyMon1DVs - (PartyMon1Species + 1 + 1 + NUM_MOVES) add hl, bc - ld de, BattleMonAtkDefDV - ld bc, $0007 + ld de, BattleMonDVs + ld bc, 2 + NUM_MOVES + 1 ; DVs, PP, happiness ; BattleMonLevel - BattleMonDVs call CopyBytes inc hl inc hl inc hl ld de, BattleMonLevel - ld bc, $0011 + ld bc, 1 + 1 + 1 + 2 + 2 * 6 ; level, status, unused, stats call CopyBytes ld a, [BattleMonSpecies] ld [TempBattleMonSpecies], a @@ -4044,15 +4044,15 @@ Function3da0d: ; 3da0d ld [BattleMonType1], a ld a, [BaseType2] ld [BattleMonType2], a - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld a, [CurBattleMon] call SkipNames ld de, BattleMonNick - ld bc, $000b + ld bc, PKMN_NAME_LENGTH call CopyBytes - ld hl, BattleMonAtk + ld hl, BattleMonAttack ld de, PlayerStats - ld bc, $000a + ld bc, 2 * 5 call CopyBytes call Function3ec2c call BadgeStatBoosts @@ -4074,7 +4074,7 @@ Function3da7c: ; 3da7c ; 3da85 Function3da85: ; 3da85 - ld hl, BattleMonAtkDefDV + ld hl, BattleMonDVs ld a, [PlayerSubStatus5] bit 3, a ret z @@ -4084,7 +4084,7 @@ Function3da85: ; 3da85 ; 3da97 Function3da97: ; 3da97 - ld hl, EnemyMonAtkDefDV + ld hl, EnemyMonDVs ld a, [EnemySubStatus5] bit 3, a ret z @@ -4092,7 +4092,7 @@ Function3da97: ; 3da97 ld a, [IsInBattle] dec a ret z - ld hl, OTPartyMon1AtkDefDV + ld hl, OTPartyMon1DVs ld a, [CurOTMon] jp GetPartyLocation ; 3dab1 @@ -4114,31 +4114,31 @@ Function3dabd: ; 3dabd ld hl, OTPartyMon1Species call GetPartyLocation ld de, EnemyMonSpecies - ld bc, $0006 + ld bc, 1 + 1 + NUM_MOVES call CopyBytes - ld bc, $000f + ld bc, OTPartyMon1DVs - (OTPartyMon1Species + 1 + 1 + NUM_MOVES) add hl, bc - ld de, EnemyMonAtkDefDV - ld bc, $0007 + ld de, EnemyMonDVs + ld bc, 2 + NUM_MOVES + 1 call CopyBytes inc hl inc hl inc hl ld de, EnemyMonLevel - ld bc, $0011 + ld bc, 1 + 1 + 1 + 2 + 2 * 6 call CopyBytes ld a, [EnemyMonSpecies] ld [CurSpecies], a call GetBaseData - ld hl, OTPartyMon1Nickname + ld hl, OTPartyMonNicknames ld a, [CurPartyMon] call SkipNames ld de, EnemyMonNick - ld bc, $000b + ld bc, PKMN_NAME_LENGTH call CopyBytes - ld hl, EnemyMonAtk + ld hl, EnemyMonAttack ld de, EnemyStats - ld bc, $000a + ld bc, 2 * 5 call CopyBytes call Function3ec30 ld hl, BaseType1 @@ -4148,9 +4148,9 @@ Function3dabd: ; 3dabd inc de ld a, [hl] ld [de], a - ld hl, BaseHP + ld hl, BaseStats ld de, EnemyMonBaseStats - ld b, $5 + ld b, 5 .asm_3db25 ld a, [hli] ld [de], a @@ -4177,7 +4177,7 @@ Function3db32: ; 3db32 call Function3db5f call EmptyBattleTextBox call Function309d - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld a, [hli] or [hl] ret @@ -4185,12 +4185,12 @@ Function3db32: ; 3db32 Function3db5f: ; 3db5f - ld hl, BattleMonAtkDefDV - ld a, $2d + ld hl, BattleMonDVs + ld a, PREDEF_GET_UNOWN_LETTER call Predef hlcoord 1, 5 - ld b, $7 - ld c, $8 + ld b, 7 + ld c, 8 call ClearBox call WaitBGMap xor a @@ -4201,7 +4201,7 @@ Function3db5f: ; 3db5f ld [$d0d2], a ld [CurMoveNum], a ld [TypeModifier], a - ld [PlayerMoveAnimation], a + ld [wPlayerMoveStruct + MOVE_ANIM], a ld [LastEnemyCounterMove], a ld [LastPlayerCounterMove], a ld [LastPlayerMove], a @@ -4223,7 +4223,7 @@ Function3db5f: ; 3db5f call Function3ee17 .asm_3dbbc - ld a, $0 + ld a, PartyMon1Species - PartyMon1 call GetPartyParamLocation ld b, h ld c, l @@ -4281,20 +4281,20 @@ BreakAttraction: ; 3dc18 SpikesDamage: ; 3dc23 ld hl, PlayerScreens - ld de, BattleMonType1 + ld de, BattleMonType ld bc, Function3df48 ld a, [hBattleTurn] and a jr z, .ok ld hl, EnemyScreens - ld de, EnemyMonType1 + ld de, EnemyMonType ld bc, Function3e036 .ok bit SCREENS_SPIKES, [hl] ret z -; Flying-types aren't affected by Spikes. + ; Flying-types aren't affected by Spikes. ld a, [de] cp FLYING ret z @@ -4321,15 +4321,17 @@ SpikesDamage: ; 3dc23 ; 3dc5b Function3dc5b: ; 3dc5b - ld a, $10 + ld a, BATTLE_VARS_MOVE call GetBattleVar ld b, a call GetMoveEffect ld a, b - cp $80 + cp EFFECT_PURSUIT jr nz, .asm_3dce4 + ld a, [CurBattleMon] push af + ld hl, DoPlayerTurn ld a, [hBattleTurn] and a @@ -4337,25 +4339,29 @@ Function3dc5b: ; 3dc5b ld hl, DoEnemyTurn ld a, [$c71a] ld [CurBattleMon], a - .asm_3dc7e ld a, BANK(DoPlayerTurn) rst FarCall - ld a, $10 + + ld a, BATTLE_VARS_MOVE call _GetBattleVar ld a, $ff ld [hl], a + pop af ld [CurBattleMon], a + ld a, [hBattleTurn] and a jr z, .asm_3dcc0 + ld a, [$c71a] call Function399f ld hl, BattleMonHP ld a, [hli] or [hl] jr nz, .asm_3dce4 + ld a, $f0 ld [CryTracks], a ld a, [BattleMonSpecies] @@ -4371,10 +4377,11 @@ Function3dc5b: ; 3dc5b jr .asm_3dcdf .asm_3dcc0 - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld a, [hli] or [hl] jr nz, .asm_3dce4 + ld de, SFX_KINESIS call PlaySFX call WaitSFX @@ -4436,8 +4443,8 @@ Function3dd2f: ; 3dd2f ld a, b cp $1 ret nz - ld de, EnemyMonHPLo - ld hl, EnemyMonMaxHPHi + ld de, EnemyMonHP + 1 + ld hl, EnemyMonMaxHP ld a, [hBattleTurn] and a jr z, .asm_3dd4a @@ -4945,7 +4952,7 @@ Function3e043: ; 3e043 ld h, b ld l, c dec hl - ld hl, EnemyMonAtkDefDV + ld hl, EnemyMonDVs ld de, TempMonDVs ld a, [EnemySubStatus5] bit 3, a @@ -4990,7 +4997,7 @@ Function3e043: ; 3e043 call PrintLevel .asm_3e0be - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld a, [hli] ld [$ffb5], a ld a, [hld] @@ -5008,7 +5015,7 @@ Function3e043: ; 3e043 ld a, $30 ld [hMultiplier], a call Multiply - ld hl, EnemyMonMaxHPHi + ld hl, EnemyMonMaxHP ld a, [hli] ld b, a ld a, [hl] @@ -5386,8 +5393,8 @@ Function3e358: ; 3e358 ; 3e3ad Function3e3ad: ; 3e3ad - ld a, $1 - ld [$c710], a + ld a, 1 + ld [wPlayerIsSwitching], a ld a, [InLinkBattle] and a jr z, .asm_3e3c1 @@ -5412,7 +5419,7 @@ Function3e3ad: ; 3e3ad jp z, .asm_3e3ca cp $d jp z, .asm_3e3ca - cp $4 + cp NUM_MOVES jp c, .asm_3e3ca cp $f jr nz, .asm_3e3e9 @@ -5452,9 +5459,9 @@ BattleMonEntrance: ; 3e40b call SetEnemyTurn call Function3dc5b - jr c, .asm_3e423 + jr c, .ok call Function3dce6 -.asm_3e423 +.ok hlcoord 9, 7 lb bc, 5, 11 @@ -5506,8 +5513,8 @@ Function3e489: ; 3e489 call Function30b4 ld a, $3 ld [$cfa9], a - ld hl, BattleMonSpd - ld de, EnemyMonSpd + ld hl, BattleMonSpeed + ld de, EnemyMonSpeed call Function3d8b3 ld a, $0 ld [$d266], a @@ -5906,7 +5913,7 @@ MoveInfoBox: ; 3e6c8 ld [hl], "/" callab UpdateMoveData - ld a, [PlayerMoveAnimation] + ld a, [wPlayerMoveStruct + MOVE_ANIM] ld b, a hlcoord 2, 10 ld a, PREDEF_PRINT_MOVE_TYPE @@ -5996,7 +6003,7 @@ Function3e786: ; 3e786 Function3e7c1: ; 3e7c1 - ld a, [$c711] + ld a, [wEnemyIsSwitching] and a ret nz ld a, [InLinkBattle] @@ -6013,16 +6020,17 @@ Function3e7c1: ; 3e7c1 jp z, .asm_3e8bd cp $d jp z, .asm_3e82c - cp $4 + cp NUM_MOVES jp nc, Function3e8c1 ld [CurEnemyMoveNum], a ld c, a ld a, [EnemySubStatus1] - bit 6, a + bit SUBSTATUS_ENCORED, a jp nz, .asm_3e882 ld a, [EnemySubStatus3] - and $13 + and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_ROLLOUT | 1 << SUBSTATUS_BIDE jp nz, .asm_3e882 + ld hl, EnemySubStatus5 bit 4, [hl] ld a, [LastEnemyMove] @@ -6113,14 +6121,14 @@ Function3e7c1: ; 3e7c1 ld [$c733], a .asm_3e894 - ld a, [EnemyMoveEffect] + ld a, [wEnemyMoveStruct + MOVE_EFFECT] cp EFFECT_FURY_CUTTER jr z, .asm_3e89f xor a ld [EnemyFuryCutterCount], a .asm_3e89f - ld a, [EnemyMoveEffect] + ld a, [wEnemyMoveStruct + MOVE_EFFECT] cp EFFECT_RAGE jr z, .asm_3e8af ld hl, EnemySubStatus4 @@ -6129,13 +6137,13 @@ Function3e7c1: ; 3e7c1 ld [$c72c], a .asm_3e8af - ld a, [EnemyMoveEffect] + ld a, [wEnemyMoveStruct + MOVE_EFFECT] cp EFFECT_PROTECT ret z cp EFFECT_ENDURE ret z xor a - ld [$c681], a + ld [EnemyProtectCount], a ret .asm_3e8bd @@ -6146,7 +6154,7 @@ Function3e7c1: ; 3e7c1 Function3e8c1: ; 3e8c1 xor a ld [EnemyFuryCutterCount], a - ld [$c681], a + ld [EnemyProtectCount], a ld [$c72c], a ld hl, EnemySubStatus4 res SUBSTATUS_RAGE, [hl] @@ -6492,9 +6500,9 @@ LoadEnemyMon: ; 3e8eb ld [hli], a ; Full HP... - ld a, [EnemyMonMaxHPHi] + ld a, [EnemyMonMaxHP] ld [hli], a - ld a, [EnemyMonMaxHPLo] + ld a, [EnemyMonMaxHP + 1] ld [hl], a ; ...unless it's a RoamMon @@ -6510,13 +6518,13 @@ LoadEnemyMon: ; 3e8eb jr z, .InitRoamHP ; Update from the struct if it has ld a, [hl] - ld [EnemyMonHPLo], a + ld [EnemyMonHP + 1], a jr .Moves .InitRoamHP ; HP only uses the lo byte in the RoamMon struct since ; Raikou/Entei/Suicune will have < 256 hp at level 40 - ld a, [EnemyMonHPLo] + ld a, [EnemyMonHP + 1] ld [hl], a jr .Moves @@ -6527,9 +6535,9 @@ LoadEnemyMon: ; 3e8eb ld a, [CurPartyMon] call GetPartyLocation ld a, [hld] - ld [EnemyMonHPLo], a + ld [EnemyMonHP + 1], a ld a, [hld] - ld [EnemyMonHPHi], a + ld [EnemyMonHP], a ; Make sure everything knows which monster the opponent is using ld a, [CurPartyMon] @@ -6975,11 +6983,11 @@ Function3ecb7: ; 3ecb7 ld a, [$d265] and a ld a, c - ld hl, BattleMonAtk + ld hl, BattleMonAttack ld de, PlayerStats ld bc, PlayerAtkLevel jr z, .asm_3ecd2 - ld hl, EnemyMonAtk + ld hl, EnemyMonAttack ld de, EnemyStats ld bc, EnemyAtkLevel @@ -7113,7 +7121,7 @@ BadgeStatBoosts: ; 3ed45 or c ld b, a - ld hl, BattleMonAtk + ld hl, BattleMonAttack ld c, 4 .CheckBadge ld a, b @@ -7432,7 +7440,7 @@ Function3ee3b: ; 3ee3b ld a, [$ffb5] ld [StringBuffer2], a ld a, [CurPartyMon] - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call GetNick ld hl, UnknownText_0x3f11b call BattleTextBox @@ -7960,14 +7968,14 @@ Function3f26d: ; 3f26d jr nz, .asm_3f2ce .asm_3f27c - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld a, [hli] or [hl] ld hl, UnknownText_0x3f2d1 jr z, .asm_3f2ce xor a ld [hMultiplicand], a - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld a, [hli] ld [$c6ea], a ld [$ffb5], a @@ -7977,7 +7985,7 @@ Function3f26d: ; 3f26d ld a, $19 ld [hMultiplier], a call Multiply - ld hl, EnemyMonMaxHPHi + ld hl, EnemyMonMaxHP ld a, [hli] ld b, [hl] srl a @@ -8052,7 +8060,7 @@ UnknownText_0x3f2fa: ; 3f2fa Function3f2ff: ; 3f2ff push de push bc - ld hl, EnemyMonHPLo + ld hl, EnemyMonHP + 1 ld de, $c6eb ld b, [hl] dec hl @@ -8067,7 +8075,7 @@ Function3f2ff: ; 3f2ff ld a, $19 ld [hMultiplier], a call Multiply - ld hl, EnemyMonMaxHPHi + ld hl, EnemyMonMaxHP ld a, [hli] ld b, [hl] srl a @@ -8300,8 +8308,8 @@ Function3f447: ; 3f447 push af ld a, [BattleMonSpecies] ld [CurPartySpecies], a - ld hl, BattleMonAtkDefDV - ld a, $2d + ld hl, BattleMonDVs + ld a, PREDEF_GET_UNOWN_LETTER call Predef ld de, $9310 ld a, $3d @@ -8339,8 +8347,8 @@ Function3f486: ; 3f486 ld [CurSpecies], a ld [CurPartySpecies], a call GetBaseData - ld hl, EnemyMonAtkDefDV - ld a, $2d + ld hl, EnemyMonDVs + ld a, PREDEF_GET_UNOWN_LETTER call Predef ld de, VTiles2 ld a, $3e @@ -8537,8 +8545,8 @@ Function3f607: ; 3f607 ld de, $c739 ld bc, NUM_MOVES call CopyBytes - ld hl, EnemyMonAtkDefDV - ld a, $2d + ld hl, EnemyMonDVs + ld a, PREDEF_GET_UNOWN_LETTER call Predef ld a, [CurPartySpecies] cp UNOWN @@ -8975,7 +8983,7 @@ Function3f998: ; 3f998 and $f jr z, .asm_3f9af call GetRoamMonHP - ld a, [EnemyMonHPLo] + ld a, [EnemyMonHP + 1] ld [hl], a jr .asm_3f9ca @@ -9003,74 +9011,74 @@ Function3f998: ; 3f998 GetRoamMonMapGroup: ; 3f9d1 ld a, [TempEnemyMonSpecies] ld b, a - ld a, [RoamMon1Species] + ld a, [wRoamMon1Species] cp b - ld hl, RoamMon1MapGroup + ld hl, wRoamMon1MapGroup ret z - ld a, [RoamMon2Species] + ld a, [wRoamMon2Species] cp b - ld hl, RoamMon2MapGroup + ld hl, wRoamMon2MapGroup ret z - ld hl, RoamMon3MapGroup + ld hl, wRoamMon3MapGroup ret ; 3f9e9 GetRoamMonMapNumber: ; 3f9e9 ld a, [TempEnemyMonSpecies] ld b, a - ld a, [RoamMon1Species] + ld a, [wRoamMon1Species] cp b - ld hl, RoamMon1MapNumber + ld hl, wRoamMon1MapNumber ret z - ld a, [RoamMon2Species] + ld a, [wRoamMon2Species] cp b - ld hl, RoamMon2MapNumber + ld hl, wRoamMon2MapNumber ret z - ld hl, RoamMon3MapNumber + ld hl, wRoamMon3MapNumber ret ; 3fa01 GetRoamMonHP: ; 3fa01 -; output: hl = RoamMonHP +; output: hl = wRoamMonHP ld a, [TempEnemyMonSpecies] ld b, a - ld a, [RoamMon1Species] + ld a, [wRoamMon1Species] cp b - ld hl, RoamMon1HP + ld hl, wRoamMon1HP ret z - ld a, [RoamMon2Species] + ld a, [wRoamMon2Species] cp b - ld hl, RoamMon2HP + ld hl, wRoamMon2HP ret z - ld hl, RoamMon3HP + ld hl, wRoamMon3HP ret ; 3fa19 GetRoamMonDVs: ; 3fa19 -; output: hl = RoamMonDVs +; output: hl = wRoamMonDVs ld a, [TempEnemyMonSpecies] ld b, a - ld a, [RoamMon1Species] + ld a, [wRoamMon1Species] cp b - ld hl, RoamMon1DVs + ld hl, wRoamMon1DVs ret z - ld a, [RoamMon2Species] + ld a, [wRoamMon2Species] cp b - ld hl, RoamMon2DVs + ld hl, wRoamMon2DVs ret z - ld hl, RoamMon3DVs + ld hl, wRoamMon3DVs ret ; 3fa31 GetRoamMonSpecies: ; 3fa31 ld a, [TempEnemyMonSpecies] - ld hl, RoamMon1Species + ld hl, wRoamMon1Species cp [hl] ret z - ld hl, RoamMon2Species + ld hl, wRoamMon2Species cp [hl] ret z - ld hl, RoamMon3Species + ld hl, wRoamMon3Species ret ; 3fa42 diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm index b7f41c04f..9e1b0d8e5 100644 --- a/battle/effect_commands.asm +++ b/battle/effect_commands.asm @@ -2395,12 +2395,12 @@ BattleCommand09: ; 34d32 call .StatModifiers - ld a, [PlayerMoveAccuracy] + ld a, [wPlayerMoveStruct + MOVE_ACC] ld b, a ld a, [hBattleTurn] and a jr z, .BrightPowder - ld a, [EnemyMoveAccuracy] + ld a, [wEnemyMoveStruct + MOVE_ACC] ld b, a .BrightPowder @@ -2592,7 +2592,7 @@ BattleCommand09: ; 34d32 ld a, [hBattleTurn] and a - ld hl, PlayerMoveAccuracy + ld hl, wPlayerMoveStruct + MOVE_ACC ld a, [PlayerAccLevel] ld b, a ld a, [EnemyEvaLevel] @@ -2600,7 +2600,7 @@ BattleCommand09: ; 34d32 jr z, .asm_34e60 - ld hl, EnemyMoveAccuracy + ld hl, wEnemyMoveStruct + MOVE_ACC ld a, [EnemyAccLevel] ld b, a ld a, [PlayerEvaLevel] @@ -2695,11 +2695,11 @@ BattleCommand90: ; 34ecc jr nz, .failed push hl - ld hl, PlayerMoveEffectChance + ld hl, wPlayerMoveStruct + MOVE_CHANCE ld a, [hBattleTurn] and a jr z, .asm_34ee1 - ld hl, EnemyMoveEffectChance + ld hl, wEnemyMoveStruct + MOVE_CHANCE .asm_34ee1 call BattleRandom @@ -3224,7 +3224,7 @@ BattleCommand11: ; 351c0 ; Faint the user if it fainted an opponent using Destiny Bond. - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld a, [hBattleTurn] and a jr z, .asm_351cb @@ -3438,7 +3438,7 @@ PlayerAttackDamage: ; 352e2 call ResetDamage - ld hl, PlayerMovePower + ld hl, wPlayerMoveStruct + MOVE_POWER ld a, [hli] and a ld d, a @@ -3450,7 +3450,7 @@ PlayerAttackDamage: ; 352e2 ; Physical - ld hl, EnemyMonDef + ld hl, EnemyMonDefense ld a, [hli] ld b, a ld c, [hl] @@ -3463,7 +3463,7 @@ PlayerAttackDamage: ; 352e2 rl b .physicalcrit - ld hl, BattleMonAtk + ld hl, BattleMonAttack call GetDamageStatsCritical jr c, .thickclub @@ -3586,7 +3586,7 @@ GetDamageStats: ; 3537e ld a, [hBattleTurn] and a jr nz, .enemy - ld a, [PlayerMoveType] + ld a, [wPlayerMoveStruct + MOVE_TYPE] cp SPECIAL ; special ld a, [PlayerSAtkLevel] @@ -3600,7 +3600,7 @@ GetDamageStats: ; 3537e jr .end .enemy - ld a, [EnemyMoveType] + ld a, [wEnemyMoveStruct + MOVE_TYPE] cp SPECIAL ; special ld a, [EnemySAtkLevel] @@ -3699,8 +3699,8 @@ EnemyAttackDamage: ; 353f6 call ResetDamage ; No damage dealt with 0 power. - ld hl, EnemyMovePower - ld a, [hli] ; hl = EnemyMoveType + ld hl, wEnemyMoveStruct + MOVE_POWER + ld a, [hli] ; hl = wEnemyMoveStruct + MOVE_TYPE ld d, a and a ret z @@ -3711,7 +3711,7 @@ EnemyAttackDamage: ; 353f6 ; Physical - ld hl, BattleMonDef + ld hl, BattleMonDefense ld a, [hli] ld b, a ld c, [hl] @@ -3724,7 +3724,7 @@ EnemyAttackDamage: ; 353f6 rl b .physicalcrit - ld hl, EnemyMonAtk + ld hl, EnemyMonAttack call GetDamageStatsCritical jr c, .thickclub @@ -3804,7 +3804,7 @@ BattleCommanda1: ; 35461 ld [DefaultFlypoint], a .asm_3548d ld a, [DefaultFlypoint] - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call GetNick ld a, $22 call Function355bd @@ -3847,7 +3847,7 @@ BattleCommanda1: ; 35461 ld a, [hl] ld e, a pop bc - ld a, [PlayerMovePower] + ld a, [wPlayerMoveStruct + MOVE_POWER] ld d, a ret @@ -3893,7 +3893,7 @@ BattleCommanda1: ; 35461 .asm_35532 ld a, [DefaultFlypoint] - ld hl, OTPartyMon1Nickname + ld hl, OTPartyMonNicknames ld bc, $000b call AddNTimes ld de, StringBuffer1 @@ -3952,7 +3952,7 @@ BattleCommanda1: ; 35461 ld a, [hl] ld e, a pop bc - ld a, [EnemyMovePower] + ld a, [wEnemyMoveStruct + MOVE_POWER] ld d, a ret ; 355b0 @@ -4004,12 +4004,12 @@ Function355dd: ; 355dd call ResetDamage ld a, [hBattleTurn] and a - ld hl, BattleMonDef + ld hl, BattleMonDefense ld de, PlayerScreens ld a, [BattleMonLevel] jr z, .asm_355f7 - ld hl, EnemyMonDef + ld hl, EnemyMonDefense ld de, EnemyScreens ld a, [EnemyMonLevel] .asm_355f7 @@ -4345,7 +4345,7 @@ BattleCommand3f: ; 35726 ld a, $0 jr .asm_3578c ; 35769 $21 .asm_3576b - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld a, [hBattleTurn] and a jr z, .asm_35776 ; 35771 $3 @@ -4376,7 +4376,7 @@ BattleCommand3f: ; 35726 ld a, [hBattleTurn] and a jr z, .asm_3579d ; 35798 $3 - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP .asm_3579d xor a ld [$ffb3], a @@ -4433,14 +4433,14 @@ BattleCommand3f: ; 35726 ld a, [hl] jr nz, .asm_357f8 - ld hl, PlayerMovePower + ld hl, wPlayerMoveStruct + MOVE_POWER ld [hl], a push hl call PlayerAttackDamage jr .asm_35800 .asm_357f8 - ld hl, EnemyMovePower + ld hl, wEnemyMoveStruct + MOVE_POWER ld [hl], a push hl call EnemyAttackDamage @@ -4600,7 +4600,7 @@ BattleCommand41: ; 35864 ld a, b ld [CurPlayerMove], a dec a - ld de, PlayerMoveStruct + ld de, wPlayerMoveStruct call GetMoveData jr .asm_3591a .asm_358ef @@ -4629,7 +4629,7 @@ BattleCommand41: ; 35864 ld a, b ld [CurEnemyMove], a dec a - ld de, EnemyMoveStruct + ld de, wEnemyMoveStruct call GetMoveData .asm_3591a call AnimateCurrentMove @@ -4654,14 +4654,14 @@ BattleCommand42: ; 35926 jp nz, Function359cd call AnimateCurrentMove ld hl, $c63f - ld de, EnemyMonMaxHPLo + ld de, EnemyMonMaxHP + 1 call .asm_3597d ld a, $1 ld [$d10a], a hlcoord 10, 9 ld a, $b call Predef - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld a, [hli] ld [$d1ed], a ld a, [hli] @@ -5230,7 +5230,7 @@ BattleCommand4a: ; 35c0f BattleCommand4b: ; 35c94 ; falseswipe - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld a, [hBattleTurn] and a jr z, .asm_35c9f ; 35c9a $3 @@ -5362,7 +5362,7 @@ Function35d1c: ; 35d1c ld a, [EnemyMonHP] ld [$d1ec + 1], a sbc b - ld [EnemyMonHPHi], a + ld [EnemyMonHP], a jr nc, .asm_35d59 ld a, [$d1ed] @@ -5837,8 +5837,8 @@ Function36011: ; 36011 ld a, [hBattleTurn] and a jr z, .asm_36037 ; 0x3602f $6 - ld hl, EnemyMonHPHi - ld de, EnemyMonMaxHPHi + ld hl, EnemyMonHP + ld de, EnemyMonMaxHP .asm_36037 ld bc, $d1ed ld a, [hli] @@ -6396,12 +6396,12 @@ BattleCommand1d: ; 362e3 jr nc, .Hit push hl - ld hl, EnemyMonAtk + 1 + ld hl, EnemyMonAttack + 1 ld de, EnemyStats ld a, [hBattleTurn] and a jr z, .asm_36366 - ld hl, BattleMonAtk + 1 + ld hl, BattleMonAttack + 1 ld de, PlayerStats .asm_36366 call Function3641a @@ -6840,7 +6840,7 @@ BattleCommanda7: ; 365c3 Function365d7: ; 365d7 ld hl, PlayerAtkLevel ld de, PlayerStats - ld bc, BattleMonAtk + ld bc, BattleMonAttack ld a, $5 call Function3661d @@ -6863,7 +6863,7 @@ Function365d7: ; 365d7 Function365fd: ; 365fd ld hl, EnemyAtkLevel ld de, EnemyStats - ld bc, EnemyMonAtk + ld bc, EnemyMonAttack ld a, $5 call Function3661d @@ -7040,8 +7040,8 @@ BattleCommand22: ; 366e5 ld [de], a inc de ld [de], a - ld [PlayerMoveEffect], a - ld [EnemyMoveEffect], a + ld [wPlayerMoveStruct + MOVE_EFFECT], a + ld [wEnemyMoveStruct + MOVE_EFFECT], a call BattleRandom and $1 inc a @@ -7257,7 +7257,7 @@ BattleCommand23: ; 3680f inc a ld [$d232], a call Function36804 - ld a, [PlayerMoveAnimation] + ld a, [wPlayerMoveStruct + MOVE_ANIM] jp .asm_36975 .asm_36869 call Function349f4 @@ -7348,7 +7348,7 @@ BattleCommand23: ; 3680f inc a ld [$d232], a call Function36804 - ld a, [EnemyMoveAnimation] + ld a, [wEnemyMoveStruct + MOVE_ANIM] jr .asm_36975 .asm_36908 @@ -7687,7 +7687,7 @@ BattleCommand26: ; 36af3 jr z, .asm_36b2f ; 36afb $32 ld hl, EnemyMonLevel ld de, BattleMonLevel - ld bc, PlayerMoveAccuracy + ld bc, wPlayerMoveStruct + MOVE_ACC ld a, [hBattleTurn] and a jr z, .asm_36b12 ; 36b09 $7 @@ -7695,7 +7695,7 @@ BattleCommand26: ; 36af3 ld h, d ld l, e pop de - ld bc, EnemyMoveAccuracy + ld bc, wEnemyMoveStruct + MOVE_ACC .asm_36b12 ld a, [de] sub [hl] @@ -7990,7 +7990,7 @@ BattleCommand27: ; 36cb2 ld a, [hBattleTurn] and a jr z, .asm_36cbd ; 36cb8 $3 - ld hl, EnemyMonMaxHPHi + ld hl, EnemyMonMaxHP .asm_36cbd ld a, BATTLE_VARS_MOVE_ANIM call GetBattleVar @@ -9951,20 +9951,25 @@ CheckAnyOtherAliveMons: ; 37b01 BattleCommand68: ; 37b1d - ld hl, $c711 +; pursuit +; Double damage if the opponent is switching. + + ld hl, wEnemyIsSwitching ld a, [hBattleTurn] and a - jr z, .asm_37b28 ; 37b23 $3 - ld hl, $c710 -.asm_37b28 + jr z, .ok + ld hl, wPlayerIsSwitching +.ok ld a, [hl] and a ret z + ld hl, CurDamage + 1 sla [hl] dec hl rl [hl] ret nc + ld a, $ff ld [hli], a ld [hl], a diff --git a/constants/misc_constants.asm b/constants/misc_constants.asm index 076684345..605344478 100644 --- a/constants/misc_constants.asm +++ b/constants/misc_constants.asm @@ -1,3 +1,4 @@ +PARTY_LENGTH EQU 6 ; strings PLAYER_NAME_LENGTH EQU 8 @@ -16,7 +17,8 @@ TRAINER_NAME EQU 7 ; boxes -NUM_BOXES EQU 14 +MONS_PER_BOX EQU 20 +NUM_BOXES EQU 14 ; predefs diff --git a/data/odd_eggs.asm b/data/odd_eggs.asm index 68062ec3b..95f64ded8 100644 --- a/data/odd_eggs.asm +++ b/data/odd_eggs.asm @@ -35,7 +35,7 @@ GiveOddEgg: ; 1fb4b6 ld hl, OddEggs ld a, OddEgg2 - OddEgg1 call AddNTimes - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $0046 call CopyBytes ld a, EGG_TICKET diff --git a/engine/engine_flags.asm b/engine/engine_flags.asm index 11414438e..34f26c87c 100644 --- a/engine/engine_flags.asm +++ b/engine/engine_flags.asm @@ -9,13 +9,13 @@ dwb $d957, %00001000 ; expn card dwb $d957, %10000000 ; on/off - ; DaycareMan, %10000000 ; daycare 1 on - dwb DaycareMan, %01000000 ; monster 1 and 2 are compatible - ; DaycareMan, %00100000 ; egg is ready - dwb DaycareMan, %00000001 ; monster 1 in daycare + ; wDaycareMan, %10000000 ; daycare 1 on + dwb wDaycareMan, %01000000 ; monster 1 and 2 are compatible + ; wDaycareMan, %00100000 ; egg is ready + dwb wDaycareMan, %00000001 ; monster 1 in daycare - ; DaycareLady, %10000000 = daycare 2 on - dwb DaycareLady, %00000001 ; monster 2 in daycare + ; wDaycareLady, %10000000 = daycare 2 on + dwb wDaycareLady, %00000001 ; monster 2 in daycare dwb $d854, %00000001 ; mom saving money ; $8 dwb $d854, %10000000 ; dst diff --git a/engine/scripting.asm b/engine/scripting.asm index 43af00669..63c5ca1f2 100644 --- a/engine/scripting.asm +++ b/engine/scripting.asm @@ -2659,7 +2659,7 @@ Script_giveegg: ; 0x97968 ld [CurPartySpecies], a call GetScriptByte ld [CurPartyLevel], a - callba Functiondf8c + callba GiveEgg ret nc ld a, $2 ld [ScriptVar], a diff --git a/event/name_rater.asm b/event/name_rater.asm index 3f2bf3912..d22ece2b5 100644 --- a/event/name_rater.asm +++ b/event/name_rater.asm @@ -34,7 +34,7 @@ NameRater: ; fb6ed call Functionfb7d3 ld hl, UnknownText_0xfb837 jr c, .asm_fb76c - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld bc, $000b ld a, [CurPartyMon] call AddNTimes @@ -70,12 +70,12 @@ NameRater: ; fb6ed ; fb78a Functionfb78a: ; fb78a - ld hl, PartyMon1OT - ld bc, $000b + ld hl, PartyMonOT + ld bc, NAME_LENGTH ld a, [CurPartyMon] call AddNTimes ld de, PlayerName - ld c, $b + ld c, NAME_LENGTH call .asm_fb7b1 jr c, .asm_fb7bc ld hl, PartyMon1ID @@ -122,7 +122,7 @@ Functionfb7be: ; fb7be ; fb7d3 Functionfb7d3: ; fb7d3 - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld bc, $000b ld a, [CurPartyMon] call AddNTimes diff --git a/event/poke_seer.asm b/event/poke_seer.asm index f49e8ce07..13b2ddbeb 100644 --- a/event/poke_seer.asm +++ b/event/poke_seer.asm @@ -139,7 +139,7 @@ ReadCaughtData: ; 4f134 GetCaughtName: ; 4f176 ld a, [CurPartyMon] - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld bc, PKMN_NAME_LENGTH call AddNTimes ld de, $d003 @@ -258,8 +258,8 @@ GetCaughtLocation: ; 4f20a GetCaughtOT: ; 4f242 ld a, [CurPartyMon] - ld hl, PartyMon1OT - ld bc, $000b + ld hl, PartyMonOT + ld bc, NAME_LENGTH call AddNTimes ld de, $d02a ld bc, $000b diff --git a/home/battle.asm b/home/battle.asm index fc670d927..809b0d843 100644 --- a/home/battle.asm +++ b/home/battle.asm @@ -250,10 +250,10 @@ _GetBattleVar:: ; 39e7 dw PlayerSubStatus4, EnemySubStatus4 dw PlayerSubStatus5, EnemySubStatus5 dw BattleMonStatus, EnemyMonStatus - dw PlayerMoveAnimation, EnemyMoveAnimation - dw PlayerMoveEffect, EnemyMoveEffect - dw PlayerMovePower, EnemyMovePower - dw PlayerMoveType, EnemyMoveType + dw wPlayerMoveStruct + MOVE_ANIM, wEnemyMoveStruct + MOVE_ANIM + dw wPlayerMoveStruct + MOVE_EFFECT, wEnemyMoveStruct + MOVE_EFFECT + dw wPlayerMoveStruct + MOVE_POWER, wEnemyMoveStruct + MOVE_POWER + dw wPlayerMoveStruct + MOVE_TYPE, wEnemyMoveStruct + MOVE_TYPE dw CurPlayerMove, CurEnemyMove dw LastEnemyCounterMove, LastPlayerCounterMove dw LastPlayerMove, LastEnemyMove diff --git a/home/map.asm b/home/map.asm index 77a53b8d2..2291faa29 100644 --- a/home/map.asm +++ b/home/map.asm @@ -120,7 +120,7 @@ Function2198:: ; 2198 ld e, a ld a, [$d195] ld d, a - ld hl, EnemyMoveAnimation + ld hl, $c608 ld b, $5 .asm_21a5 diff --git a/items/item_effects.asm b/items/item_effects.asm index d294d198c..61ff2033e 100644 --- a/items/item_effects.asm +++ b/items/item_effects.asm @@ -274,7 +274,7 @@ ParkBall: ; e8a2 ld a, b ld [$ffb6], a - ld hl, EnemyMonHPHi + ld hl, EnemyMonHP ld b, [hl] inc hl ld c, [hl] @@ -449,9 +449,9 @@ ParkBall: ; e8a2 .asm_ea1a set 3, [hl] ld hl, $c6f2 - ld a, [EnemyMonAtkDefDV] + ld a, [EnemyMonDVs] ld [hli], a - ld a, [EnemyMonSpdSpclDV] + ld a, [EnemyMonDVs + 1] ld [hl], a .asm_ea27 @@ -579,7 +579,7 @@ ParkBall: ; e8a2 ld a, [PartyCount] dec a ld [CurPartyMon], a - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld bc, PKMN_NAME_LENGTH call AddNTimes @@ -1316,11 +1316,11 @@ Functioneed9: ; eed9 ; eeeb Table_eeeb: ; eeeb - db HP_UP, PartyMon1HPExp - PartyMon1StatExp - db PROTEIN, PartyMon1AtkExp - PartyMon1StatExp - db IRON, PartyMon1DefExp - PartyMon1StatExp - db CARBOS, PartyMon1SpdExp - PartyMon1StatExp - db CALCIUM, PartyMon1SpclExp - PartyMon1StatExp + db HP_UP, PartyMon1HPExp - PartyMon1StatExp + db PROTEIN, PartyMon1AtkExp - PartyMon1StatExp + db IRON, PartyMon1DefExp - PartyMon1StatExp + db CARBOS, PartyMon1SpdExp - PartyMon1StatExp + db CALCIUM, PartyMon1SpcExp - PartyMon1StatExp ; eef5 @@ -1334,7 +1334,7 @@ Functioneef5: ; eef5 ld [CurPartyLevel], a call GetBaseData ld a, [CurPartyMon] - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call GetNick ret ; 0xef14 diff --git a/main.asm b/main.asm index ef9196b6a..8f297163b 100644 --- a/main.asm +++ b/main.asm @@ -3891,7 +3891,7 @@ Function5bae: ; 5bae ld a, 1 call GetSRAMBank - ld hl, BoxCount + ld hl, sBoxCount call Function5ca1 call CloseSRAM @@ -3908,16 +3908,16 @@ Function5bae: ; 5bae call Function5ca1 xor a - ld [RoamMon1Species], a - ld [RoamMon2Species], a - ld [RoamMon3Species], a + ld [wRoamMon1Species], a + ld [wRoamMon2Species], a + ld [wRoamMon3Species], a ld a, -1 - ld [RoamMon1MapGroup], a - ld [RoamMon2MapGroup], a - ld [RoamMon3MapGroup], a - ld [RoamMon1MapNumber], a - ld [RoamMon2MapNumber], a - ld [RoamMon3MapNumber], a + ld [wRoamMon1MapGroup], a + ld [wRoamMon2MapGroup], a + ld [wRoamMon3MapGroup], a + ld [wRoamMon1MapNumber], a + ld [wRoamMon2MapNumber], a + ld [wRoamMon3MapNumber], a ld a, 0 call GetSRAMBank @@ -3977,8 +3977,8 @@ Function5ca1: ; 5ca1 ; 5ca6 Function5ca6: ; 5ca6 - ld hl, Box1Name - ld c, $0 + ld hl, wBoxNames + ld c, 0 .asm_5cab push hl ld de, .Box @@ -3986,22 +3986,22 @@ Function5ca6: ; 5ca6 dec hl ld a, c inc a - cp $a + cp 10 jr c, .asm_5cbe - sub $a - ld [hl], $f7 + sub 10 + ld [hl], "1" inc hl .asm_5cbe - add $f6 + add "0" ld [hli], a - ld [hl], $50 + ld [hl], "@" pop hl - ld de, $0009 + ld de, 9 add hl, de inc c ld a, c - cp $e + cp NUM_BOXES jr c, .asm_5cab ret @@ -4041,18 +4041,14 @@ Function5ce9: ; 5ce9 ld de, GreensName .Copy - ld bc, $000b + ld bc, NAME_LENGTH call CopyBytes ret -.Rival - db "???@" -.Red - db "RED@" -.Green - db "GREEN@" -.Mom - db "MOM@" +.Rival db "???@" +.Red db "RED@" +.Green db "GREEN@" +.Mom db "MOM@" ; 5d23 Function5d23: ; 5d23 @@ -5258,11 +5254,11 @@ Function64db: ; 64db Function6508: ; 6508 call Function309d ld a, [CurPartyMon] - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call GetNick ld hl, StringBuffer1 ld de, $d050 - ld bc, $000b + ld bc, PKMN_NAME_LENGTH call CopyBytes Function6520: ; 6520 @@ -6514,7 +6510,7 @@ StepHappiness:: ; 725a DaycareStep:: ; 7282 - ld a, [DaycareMan] + ld a, [wDaycareMan] bit 0, a jr z, .asm_72a4 @@ -6536,7 +6532,7 @@ DaycareStep:: ; 7282 ld [hl], a .asm_72a4 - ld a, [DaycareLady] + ld a, [wDaycareLady] bit 0, a jr z, .asm_72c6 @@ -6558,10 +6554,10 @@ DaycareStep:: ; 7282 ld [hl], a .asm_72c6 - ld hl, DaycareMan + ld hl, wDaycareMan bit 5, [hl] ; egg ret z - ld hl, StepsToEgg + ld hl, wStepsToEgg dec [hl] ret nz @@ -6586,7 +6582,7 @@ DaycareStep:: ; 7282 call Random cp b ret nc - ld hl, DaycareMan + ld hl, wDaycareMan res 5, [hl] set 6, [hl] ret @@ -6635,7 +6631,7 @@ SpecialGiveShuckle: ; 7305 ; Nickname. ld a, [PartyCount] dec a - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call SkipNames ld de, SpecialShuckleNick call CopyName2 @@ -6643,7 +6639,7 @@ SpecialGiveShuckle: ; 7305 ; OT. ld a, [PartyCount] dec a - ld hl, PartyMon1OT + ld hl, PartyMonOT call SkipNames ld de, SpecialShuckleOT call CopyName2 @@ -6691,7 +6687,7 @@ SpecialReturnShuckle: ; 737e ; OT ld a, [CurPartyMon] - ld hl, PartyMon1OT + ld hl, PartyMonOT call SkipNames ld de, SpecialShuckleOT .CheckOT @@ -7767,7 +7763,7 @@ PredefPointers: ; 856b dwb Functionda96, BANK(Functionda96) dwb Functiondb3f, BANK(Functiondb3f) ; $8 dwb Functionde6e, BANK(Functionde6e) - dwb Functiondf8c, BANK(Functiondf8c) + dwb GiveEgg, BANK(GiveEgg) dwb Functionc6e0, BANK(Functionc6e0) dwb Functione167, BANK(Functione167) dwb Functione17b, BANK(Functione17b) @@ -8939,7 +8935,7 @@ Functionc6f5: ; c6f5 GetPartyNick: ; c706 ; write CurPartyMon nickname to StringBuffer1-3 - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld a, BOXMON ld [MonType], a ld a, [CurPartyMon] @@ -12321,7 +12317,7 @@ Functiond88c: ; d88c .asm_d899 ld a, [de] inc a - cp $7 + cp PARTY_LENGTH + 1 ret nc ld [de], a ld a, [de] @@ -12337,11 +12333,11 @@ Functiond88c: ; d88c inc de ld a, $ff ld [de], a - ld hl, PartyMon1OT + ld hl, PartyMonOT ld a, [MonType] and $f jr z, .asm_d8bc - ld hl, OTPartyMon1OT + ld hl, OTPartyMonOT .asm_d8bc ld a, [$ffae] @@ -12350,7 +12346,7 @@ Functiond88c: ; d88c ld d, h ld e, l ld hl, PlayerName - ld bc, $000b + ld bc, NAME_LENGTH call CopyBytes ld a, [MonType] and a @@ -12358,14 +12354,14 @@ Functiond88c: ; d88c ld a, [CurPartySpecies] ld [$d265], a call GetPokemonName - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld a, [$ffae] dec a call SkipNames ld d, h ld e, l ld hl, StringBuffer1 - ld bc, $000b + ld bc, PKMN_NAME_LENGTH call CopyBytes .asm_d8f0 @@ -12542,10 +12538,10 @@ Functiond906: ; d906 jr .asm_da29 .asm_d9f3 - ld a, [EnemyMonAtkDefDV] + ld a, [EnemyMonDVs] ld [de], a inc de - ld a, [EnemyMonSpdSpclDV] + ld a, [EnemyMonDVs + 1] ld [de], a inc de @@ -12591,7 +12587,7 @@ Functiond906: ; d906 ld a, [IsInBattle] dec a jr nz, .asm_da3b - ld hl, EnemyMonMaxHPHi + ld hl, EnemyMonMaxHP ld bc, $000c call CopyBytes pop hl @@ -12609,14 +12605,14 @@ Functiond906: ; d906 and $f jr nz, .asm_da6b ld a, [CurPartySpecies] - cp $c9 + cp UNOWN jr nz, .asm_da6b ld hl, PartyMon1DVs ld a, [PartyCount] dec a ld bc, PartyMon2 - PartyMon1 call AddNTimes - ld a, $2d + ld a, PREDEF_GET_UNOWN_LETTER call Predef callab Functionfba18 @@ -12659,13 +12655,13 @@ FillPP: ; da6d Functionda96: ; da96 ld hl, PartyCount ld a, [hl] - cp $6 + cp PARTY_LENGTH scf ret z inc a ld [hl], a ld c, a - ld b, $0 + ld b, 0 add hl, bc ld a, [CurPartySpecies] ld [hli], a @@ -12679,32 +12675,33 @@ Functionda96: ; da96 ld d, h ld hl, TempMonSpecies call CopyBytes - ld hl, PartyMon1OT + ld hl, PartyMonOT ld a, [PartyCount] dec a call SkipNames ld d, h ld e, l - ld hl, OTPartyMon1OT + ld hl, OTPartyMonOT ld a, [CurPartyMon] call SkipNames - ld bc, $000b + ld bc, NAME_LENGTH call CopyBytes - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld a, [PartyCount] dec a call SkipNames ld d, h ld e, l - ld hl, OTPartyMon1Nickname + ld hl, OTPartyMonNicknames ld a, [CurPartyMon] call SkipNames - ld bc, $000b + ld bc, PKMN_NAME_LENGTH call CopyBytes + ld a, [CurPartySpecies] ld [$d265], a - cp $fd - jr z, .asm_db12 + cp EGG + jr z, .owned dec a call SetSeenAndCaughtMon ld hl, PartyMon1Happiness @@ -12713,26 +12710,26 @@ Functionda96: ; da96 ld bc, PartyMon2 - PartyMon1 call AddNTimes ld [hl], BASE_HAPPINESS +.owned -.asm_db12 ld a, [CurPartySpecies] - cp $c9 - jr nz, .asm_db3d + cp UNOWN + jr nz, .done ld hl, PartyMon1DVs ld a, [PartyCount] dec a ld bc, PartyMon2 - PartyMon1 call AddNTimes - ld a, $2d + ld a, PREDEF_GET_UNOWN_LETTER call Predef callab Functionfba18 ld a, [$def4] and a - jr nz, .asm_db3d + jr nz, .done ld a, [UnownLetter] ld [$def4], a +.done -.asm_db3d and a ret ; db3f @@ -12746,29 +12743,29 @@ Functiondb3f: ; db3f cp $2 jr z, .asm_db60 cp $3 - ld hl, BreedMon1Species + ld hl, wBreedMon1Species jr z, .asm_db9b - ld hl, BoxCount + ld hl, sBoxCount ld a, [hl] - cp $14 + cp MONS_PER_BOX jr nz, .asm_db69 jp Functiondcb1 .asm_db60 ld hl, PartyCount ld a, [hl] - cp $6 + cp PARTY_LENGTH jp z, Functiondcb1 .asm_db69 inc a ld [hl], a ld c, a - ld b, $0 + ld b, 0 add hl, bc ld a, [$d10b] cp $2 - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] jr z, .asm_db7c ld a, [CurPartySpecies] @@ -12781,9 +12778,9 @@ Functiondb3f: ; db3f ld bc, PartyMon2 - PartyMon1 ld a, [PartyCount] jr nz, .asm_db97 - ld hl, BoxMon1Species - ld bc, $0020 - ld a, [BoxCount] + ld hl, sBoxMon1Species + ld bc, sBoxMon1End - sBoxMon1 + ld a, [sBoxCount] .asm_db97 dec a @@ -12795,11 +12792,11 @@ Functiondb3f: ; db3f ld d, h ld a, [$d10b] and a - ld hl, BoxMon1Species - ld bc, $0020 + ld hl, sBoxMon1Species + ld bc, sBoxMon1End - sBoxMon1 jr z, .asm_dbb7 cp $2 - ld hl, BreedMon1Species + ld hl, wBreedMon1Species jr z, .asm_dbbd ld hl, PartyMon1Species ld bc, PartyMon2 - PartyMon1 @@ -12809,18 +12806,18 @@ Functiondb3f: ; db3f call AddNTimes .asm_dbbd - ld bc, $0020 + ld bc, sBoxMon1End - sBoxMon1 call CopyBytes ld a, [$d10b] cp $3 - ld de, BreedMon1OT + ld de, wBreedMon1OT jr z, .asm_dbe2 dec a - ld hl, PartyMon1OT + ld hl, PartyMonOT ld a, [PartyCount] jr nz, .asm_dbdc - ld hl, BoxMon1OT - ld a, [BoxCount] + ld hl, sBoxMonOT + ld a, [sBoxCount] .asm_dbdc dec a @@ -12829,32 +12826,32 @@ Functiondb3f: ; db3f ld e, l .asm_dbe2 - ld hl, BoxMon1OT + ld hl, sBoxMonOT ld a, [$d10b] and a jr z, .asm_dbf5 - ld hl, BreedMon1OT + ld hl, wBreedMon1OT cp $2 jr z, .asm_dbfb - ld hl, PartyMon1OT + ld hl, PartyMonOT .asm_dbf5 ld a, [CurPartyMon] call SkipNames .asm_dbfb - ld bc, $000b + ld bc, NAME_LENGTH call CopyBytes ld a, [$d10b] cp $3 - ld de, BreedMon1Nick + ld de, wBreedMon1Nick jr z, .asm_dc20 dec a - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld a, [PartyCount] jr nz, .asm_dc1a - ld hl, BoxMon1Nickname - ld a, [BoxCount] + ld hl, sBoxMonNicknames + ld a, [sBoxCount] .asm_dc1a dec a @@ -12863,21 +12860,21 @@ Functiondb3f: ; db3f ld e, l .asm_dc20 - ld hl, BoxMon1Nickname + ld hl, sBoxMonNicknames ld a, [$d10b] and a jr z, .asm_dc33 - ld hl, BreedMon1Nick + ld hl, wBreedMon1Nick cp $2 jr z, .asm_dc39 - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames .asm_dc33 ld a, [CurPartyMon] call SkipNames .asm_dc39 - ld bc, $000b + ld bc, PKMN_NAME_LENGTH call CopyBytes pop hl ld a, [$d10b] @@ -12922,7 +12919,7 @@ Functiondb3f: ; db3f ld d, h ld e, l ld a, [CurPartySpecies] - cp $fd + cp EGG jr z, .asm_dc9e inc hl inc hl @@ -12941,7 +12938,7 @@ Functiondb3f: ; db3f jr .asm_dcac .asm_dca4 - ld a, [BoxCount] + ld a, [sBoxCount] dec a ld b, a call Functiondcb6 @@ -12962,12 +12959,12 @@ Functiondcb1: ; dcb1 Functiondcb6: ; dcb6 ld a, b - ld hl, BoxMons - ld bc, BoxMon2 - BoxMon1 + ld hl, sBoxMons + ld bc, sBoxMon1End - sBoxMon1 call AddNTimes ld b, h ld c, l - ld hl, BoxMon1PP - BoxMon1 + ld hl, sBoxMon1PP - sBoxMon1 add hl, bc push hl push bc @@ -12975,7 +12972,7 @@ Functiondcb6: ; dcb6 ld bc, NUM_MOVES call CopyBytes pop bc - ld hl, BoxMon1Moves - BoxMon1 + ld hl, sBoxMon1Moves - sBoxMon1 add hl, bc push hl ld de, TempMonMoves @@ -13027,7 +13024,7 @@ Functiondcb6: ; dcb6 Functiondd21: ; dd21 - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] ld [CurPartySpecies], a ld de, SFX_TRANSACTION call PlaySFX @@ -13043,7 +13040,7 @@ Functiondd21: ; dd21 ; dd42 Functiondd42: ; dd42 - ld a, [BreedMon2Species] + ld a, [wBreedMon2Species] ld [CurPartySpecies], a ld de, SFX_TRANSACTION call PlaySFX @@ -13061,7 +13058,7 @@ Functiondd42: ; dd42 Functiondd64: ; dd64 ld hl, PartyCount ld a, [hl] - cp $6 + cp PARTY_LENGTH jr nz, .asm_dd6e scf ret @@ -13070,22 +13067,22 @@ Functiondd64: ; dd64 inc a ld [hl], a ld c, a - ld b, $0 + ld b, 0 add hl, bc ld a, [$d10b] and a - ld a, [BreedMon1Species] - ld de, BreedMon1Nick + ld a, [wBreedMon1Species] + ld de, wBreedMon1Nick jr z, .asm_dd86 - ld a, [BreedMon2Species] - ld de, BreedMon2Nick + ld a, [wBreedMon2Species] + ld de, wBreedMon2Nick .asm_dd86 ld [hli], a ld [CurSpecies], a ld a, $ff ld [hl], a - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld a, [PartyCount] dec a call SkipNames @@ -13095,7 +13092,7 @@ Functiondd64: ; dd64 pop de call CopyBytes push hl - ld hl, PartyMon1OT + ld hl, PartyMonOT ld a, [PartyCount] dec a call SkipNames @@ -13168,7 +13165,7 @@ Functionde1a: ; de1a ; de2a Functionde2a: ; de2a - ld de, BreedMon1Nick + ld de, wBreedMon1Nick call Functionde44 xor a ld [$d10b], a @@ -13176,7 +13173,7 @@ Functionde2a: ; de2a ; de37 Functionde37: ; de37 - ld de, BreedMon2Nick + ld de, wBreedMon2Nick call Functionde44 xor a ld [$d10b], a @@ -13185,28 +13182,28 @@ Functionde37: ; de37 Functionde44: ; de44 ld a, [CurPartyMon] - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call SkipNames call CopyBytes ld a, [CurPartyMon] - ld hl, PartyMon1OT + ld hl, PartyMonOT call SkipNames call CopyBytes ld a, [CurPartyMon] ld hl, PartyMon1Species ld bc, PartyMon2 - PartyMon1 call AddNTimes - ld bc, $0020 + ld bc, sBoxMon1End - sBoxMon1 jp CopyBytes ; de6e Functionde6e: ; de6e - ld a, 1 ; BANK(BoxCount) + ld a, 1 ; BANK(sBoxCount) call GetSRAMBank - ld de, BoxCount + ld de, sBoxCount ld a, [de] - cp 20 + cp MONS_PER_BOX jp nc, Functiondf42 inc a ld [de], a @@ -13225,19 +13222,19 @@ Functionde6e: ; de6e call GetBaseData call ShiftBoxMon ld hl, PlayerName - ld de, BoxMonOT - ld bc, BoxMon2OT - BoxMon1OT + ld de, sBoxMonOT + ld bc, NAME_LENGTH call CopyBytes ld a, [CurPartySpecies] ld [$d265], a call GetPokemonName - ld de, BoxMon1Nickname + ld de, sBoxMonNicknames ld hl, StringBuffer1 - ld bc, BoxMon2Nickname - BoxMon1Nickname + ld bc, PKMN_NAME_LENGTH call CopyBytes ld hl, EnemyMon - ld de, BoxMon1 - ld bc, 6 ; species + item + moves + ld de, sBoxMon1 + ld bc, 1 + 1 + NUM_MOVES ; species + item + moves call CopyBytes ld hl, PlayerID ld a, [hli] @@ -13267,15 +13264,15 @@ Functionde6e: ; de6e inc de dec b jr nz, .asm_dee5 - ld hl, EnemyMonAtkDefDV - ld b, $6 + ld hl, EnemyMonDVs + ld b, 2 + NUM_MOVES ; DVs and PP ; EnemyMonHappiness - EnemyMonDVs .asm_deef ld a, [hli] ld [de], a inc de dec b jr nz, .asm_deef - ld a, $46 + ld a, BASE_HAPPINESS ld [de], a inc de xor a @@ -13293,17 +13290,17 @@ Functionde6e: ; de6e ld a, [CurPartySpecies] cp UNOWN jr nz, .asm_df20 - ld hl, BoxMon1DVs + ld hl, sBoxMon1DVs ld a, $2d call Predef callab Functionfba18 .asm_df20 - ld hl, BoxMon1Moves + ld hl, sBoxMon1Moves ld de, TempMonMoves ld bc, NUM_MOVES call CopyBytes - ld hl, BoxMon1PP + ld hl, sBoxMon1PP ld de, TempMonPP ld bc, NUM_MOVES call CopyBytes @@ -13321,19 +13318,19 @@ Functiondf42: ; df42 ; df47 ShiftBoxMon: ; df47 - ld hl, BoxMonOT - ld bc, BoxMon2OT - BoxMon1OT + ld hl, sBoxMonOT + ld bc, NAME_LENGTH call .asm_df5f - ld hl, BoxMonNicknames - ld bc, BoxMon2Nickname - BoxMon1Nickname + ld hl, sBoxMonNicknames + ld bc, PKMN_NAME_LENGTH call .asm_df5f - ld hl, BoxMons - ld bc, BoxMon2 - BoxMon1 + ld hl, sBoxMons + ld bc, sBoxMon1End - sBoxMon1 .asm_df5f - ld a, [BoxCount] + ld a, [sBoxCount] cp 2 ret c @@ -13344,13 +13341,13 @@ ShiftBoxMon: ; df47 ld d, h pop hl - ld a, [BoxCount] + ld a, [sBoxCount] dec a call AddNTimes dec hl push hl - ld a, [BoxCount] + ld a, [sBoxCount] dec a ld hl, 0 call AddNTimes @@ -13368,7 +13365,7 @@ ShiftBoxMon: ; df47 ret ; df8c -Functiondf8c:: ; df8c +GiveEgg:: ; df8c ld a, [CurPartySpecies] push af callab GetPreEvolution @@ -13421,14 +13418,14 @@ Functiondf8c:: ; df8c ld [hl], a ld hl, PartyCount ld a, [hl] - ld b, $0 + ld b, 0 ld c, a add hl, bc - ld a, $fd + ld a, EGG ld [hl], a ld a, [PartyCount] dec a - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call SkipNames ld de, Stringe035 call CopyName2 @@ -13469,9 +13466,9 @@ Functione039: ; e039 and a jr z, .asm_e04a - ld a, 1 ; BANK(BoxCount) + ld a, 1 ; BANK(sBoxCount) call GetSRAMBank - ld hl, BoxCount + ld hl, sBoxCount .asm_e04a ld a, [hl] @@ -13490,13 +13487,13 @@ Functione039: ; e039 ld [hli], a inc a jr nz, .asm_e057 - ld hl, PartyMon1OT - ld d, $5 + ld hl, PartyMonOT + ld d, PARTY_LENGTH - 1 ld a, [$d10b] and a jr z, .asm_e06d - ld hl, BoxMonOT - ld d, $13 + ld hl, sBoxMonOT + ld d, MONS_PER_BOX - 1 .asm_e06d ld a, [CurPartyMon] @@ -13510,13 +13507,13 @@ Functione039: ; e039 .asm_e07e ld d, h ld e, l - ld bc, $000b + ld bc, PKMN_NAME_LENGTH add hl, bc - ld bc, PartyMon1Nickname + ld bc, PartyMonNicknames ld a, [$d10b] and a jr z, .asm_e090 - ld bc, BoxMonNicknames + ld bc, sBoxMonNicknames .asm_e090 call CopyDataUntil @@ -13525,8 +13522,8 @@ Functione039: ; e039 ld a, [$d10b] and a jr z, .asm_e0a5 - ld hl, BoxMons - ld bc, BoxMon2 - BoxMon1 + ld hl, sBoxMons + ld bc, sBoxMon1End - sBoxMon1 .asm_e0a5 ld a, [CurPartyMon] @@ -13536,37 +13533,37 @@ Functione039: ; e039 ld a, [$d10b] and a jr z, .asm_e0bc - ld bc, BoxMon2 - BoxMon1 + ld bc, sBoxMon1End - sBoxMon1 add hl, bc - ld bc, BoxMonOT + ld bc, sBoxMonOT jr .asm_e0c3 .asm_e0bc ld bc, PartyMon2 - PartyMon1 add hl, bc - ld bc, PartyMon1OT + ld bc, PartyMonOT .asm_e0c3 call CopyDataUntil - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld a, [$d10b] and a jr z, .asm_e0d2 - ld hl, BoxMonNicknames + ld hl, sBoxMonNicknames .asm_e0d2 - ld bc, BoxMon2Nickname - BoxMon1Nickname + ld bc, PKMN_NAME_LENGTH ld a, [CurPartyMon] call AddNTimes ld d, h ld e, l - ld bc, BoxMon2Nickname - BoxMon1Nickname + ld bc, PKMN_NAME_LENGTH add hl, bc ld bc, PartyMonNicknamesEnd ld a, [$d10b] and a jr z, .asm_e0ed - ld bc, BoxMonNicknamesEnd + ld bc, sBoxMonNicknamesEnd .asm_e0ed call CopyDataUntil @@ -13854,7 +13851,7 @@ Functione277:: ; e277 ld [MonType], a call Functiond88c jr nc, .asm_e2b0 - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld a, [PartyCount] dec a ld [CurPartyMon], a @@ -13899,7 +13896,7 @@ Functione277:: ; e277 and a jr z, .asm_e2e1 ld a, [CurItem] - ld [BoxMon1Item], a + ld [sBoxMon1Item], a .asm_e2e1 ld a, [CurPartySpecies] @@ -13936,7 +13933,7 @@ Functione277:: ; e277 jr nz, .asm_e35e push hl ld a, [CurPartyMon] - ld hl, PartyMon1OT + ld hl, PartyMonOT call SkipNames ld d, h ld e, l @@ -13967,7 +13964,7 @@ Functione277:: ; e277 .asm_e35e ld a, $1 call GetSRAMBank - ld de, BoxMon1OT + ld de, sBoxMonOT .asm_e366 ld a, [ScriptBank] call GetFarByte @@ -13979,7 +13976,7 @@ Functione277:: ; e277 ld a, [ScriptBank] call GetFarByte ld b, a - ld hl, BoxMon1ID + ld hl, sBoxMon1ID call Random ld [hli], a call Random @@ -14019,7 +14016,7 @@ Functione277:: ; e277 ld a, $1 call GetSRAMBank ld hl, $d050 - ld de, BoxMon1Nickname + ld de, sBoxMonNicknames ld bc, $000b call CopyBytes call CloseSRAM @@ -14225,7 +14222,7 @@ Functione512: ; e512 ld a, [PartyCount] and a jr z, .asm_e51e - cp $2 + cp 2 jr c, .asm_e526 and a ret @@ -14300,7 +14297,7 @@ Functione559: ; e559 (3:6559) Functione56d: ; e56d ld a, [PartyCount] - cp $6 + cp PARTY_LENGTH jr nc, .asm_e576 and a ret @@ -14347,7 +14344,7 @@ ClearPCItemScreen: ; e58b Functione5bb: ; e5bb ld a, [CurPartyMon] - ld hl, BoxMon1Species + ld hl, sBoxMon1Species ld bc, $0020 call AddNTimes ld de, TempMonSpecies @@ -14377,7 +14374,7 @@ Functione5d9: ; e5d9 .asm_e5f1 ld a, $1 - ld hl, BoxCount + ld hl, sBoxCount .asm_e5f6 call GetSRAMBank @@ -14386,7 +14383,7 @@ Functione5d9: ; e5d9 add hl, bc ld b, a ld c, $0 - ld de, EnemyMoveAnimation + ld de, $c608 ld a, b and a jr z, .asm_e66a @@ -14479,7 +14476,7 @@ Unknown_e66e: ; e66e ; e698 Functione698: ; e698 - ld hl, BreedMon1Species + ld hl, wBreedMon1Species ld de, TempMonSpecies ld bc, $0020 call CopyBytes @@ -14494,7 +14491,7 @@ Functione698: ; e698 ; e6b3 Functione6b3: ; e6b3 - ld hl, BreedMon2Species + ld hl, wBreedMon2Species ld de, TempMonSpecies ld bc, $0020 call CopyBytes @@ -15294,7 +15291,7 @@ Function103fd: ; 103fd callba PartyMenuSelect jr c, .asm_10475 ld a, [CurPartySpecies] ; $d108 - cp $fd + cp EGG jr nz, .asm_10453 ld hl, UnknownText_0x1048d call PrintText @@ -15307,7 +15304,7 @@ Function103fd: ; 103fd call GetCurNick ld hl, StringBuffer1 ; $d073 ld de, $d050 - ld bc, $b + ld bc, PKMN_NAME_LENGTH call CopyBytes call Function12bd9 pop af @@ -20776,7 +20773,7 @@ Function13172: ; 13172 call ClearBox xor a ld [MonType], a - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld a, [CurPartyMon] call GetNick hlcoord 5, 1 @@ -22008,7 +22005,7 @@ ContestScore: ; 13900 call .AddContestStat ; DVs - ld a, [wContestMonAtkDefDV] + ld a, [wContestMonDVs + 0] ld b, a and 2 add a @@ -22022,7 +22019,7 @@ ContestScore: ; 13900 add c ld d, a - ld a, [wContestMonSpdSpcDV] + ld a, [wContestMonDVs + 1] ld b, a and 2 ld c, a @@ -22179,7 +22176,7 @@ Function13a12: ; 13a12 or [hl] jr z, .asm_13a2b ld hl, PartyCount - ld a, $1 + ld a, 1 ld [hli], a inc hl ld a, [hl] @@ -22196,7 +22193,7 @@ Function13a12: ; 13a12 ; 13a31 Function13a31: ; 13a31 - ld hl, $dcd9 + ld hl, PartySpecies + 1 ld a, [$df9b] ld [hl], a ld b, $1 @@ -22926,9 +22923,9 @@ GetMonSprite: ; 14259 cp SPRITE_POKEMON jr c, .Normal cp SPRITE_DAYCARE_MON_1 - jr z, .BreedMon1 + jr z, .wBreedMon1 cp SPRITE_DAYCARE_MON_2 - jr z, .BreedMon2 + jr z, .wBreedMon2 cp SPRITE_VARS jr nc, .Variable jr .Icon @@ -22946,12 +22943,12 @@ GetMonSprite: ; 14259 ld a, [hl] jr .Mon -.BreedMon1 - ld a, [BreedMon1Species] +.wBreedMon1 + ld a, [wBreedMon1Species] jr .Mon -.BreedMon2 - ld a, [BreedMon2Species] +.wBreedMon2 + ld a, [wBreedMon2Species] .Mon ld e, a @@ -25231,8 +25228,8 @@ Function150f9: ; 150f9 push de ld a, $1 call GetSRAMBank - ld hl, BoxCount - ld de, EnemyMoveAnimation + ld hl, sBoxCount + ld de, $c608 ld bc, $01e0 call CopyBytes call CloseSRAM @@ -25241,14 +25238,14 @@ Function150f9: ; 150f9 push af push de call GetSRAMBank - ld hl, EnemyMoveAnimation + ld hl, $c608 ld bc, $01e0 call CopyBytes call CloseSRAM ld a, $1 call GetSRAMBank ld hl, $aef0 - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $01e0 call CopyBytes call CloseSRAM @@ -25261,14 +25258,14 @@ Function150f9: ; 150f9 push af push de call GetSRAMBank - ld hl, EnemyMoveAnimation + ld hl, $c608 ld bc, $01e0 call CopyBytes call CloseSRAM ld a, $1 call GetSRAMBank ld hl, $b0d0 - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $008e call CopyBytes call CloseSRAM @@ -25279,7 +25276,7 @@ Function150f9: ; 150f9 ld e, l ld d, h call GetSRAMBank - ld hl, EnemyMoveAnimation + ld hl, $c608 ld bc, $008e call CopyBytes call CloseSRAM @@ -25296,13 +25293,13 @@ Function1517d: ; 1517d (5:517d) push af push hl call GetSRAMBank - ld de, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct) + ld de, $c608 ld bc, $1e0 call CopyBytes call CloseSRAM ld a, $1 call GetSRAMBank - ld hl, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct) + ld hl, $c608 ld de, $ad10 ld bc, $1e0 call CopyBytes @@ -25314,13 +25311,13 @@ Function1517d: ; 1517d (5:517d) push af push hl call GetSRAMBank - ld de, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct) + ld de, $c608 ld bc, $1e0 call CopyBytes call CloseSRAM ld a, $1 call GetSRAMBank - ld hl, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct) + ld hl, $c608 ld de, $aef0 ld bc, $1e0 call CopyBytes @@ -25330,13 +25327,13 @@ Function1517d: ; 1517d (5:517d) ld de, $1e0 add hl, de call GetSRAMBank - ld de, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct) + ld de, $c608 ld bc, $8e call CopyBytes call CloseSRAM ld a, $1 call GetSRAMBank - ld hl, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct) + ld hl, $c608 ld de, $b0d0 ld bc, $8e call CopyBytes @@ -28712,17 +28709,17 @@ MenuData2_0x166bd: ; 0x166bd ; 0x166d6 Function166d6: ; 166d6 - ld hl, DaycareMan + ld hl, wDaycareMan bit 0, [hl] jr nz, .asm_166fe - ld hl, DaycareMan + ld hl, wDaycareMan ld a, $0 call Function1678f jr c, .asm_16724 call Function16798 jr c, .asm_16721 callba Functionde2a - ld hl, DaycareMan + ld hl, wDaycareMan set 0, [hl] call Function167f6 call Function16a3b @@ -28730,13 +28727,13 @@ Function166d6: ; 166d6 .asm_166fe callba Functione698 - ld hl, BreedMon1Nick + ld hl, wBreedMon1Nick call Function1686d call Function16807 jr c, .asm_16721 callba Functiondd21 call Function16850 - ld hl, DaycareMan + ld hl, wDaycareMan res 0, [hl] res 5, [hl] jr .asm_16724 @@ -28751,17 +28748,17 @@ Function166d6: ; 166d6 ; 1672a Function1672a: ; 1672a - ld hl, DaycareLady + ld hl, wDaycareLady bit 0, [hl] jr nz, .asm_16752 - ld hl, DaycareLady + ld hl, wDaycareLady ld a, $2 call Function16781 jr c, .asm_1677b call Function16798 jr c, .asm_16778 callba Functionde37 - ld hl, DaycareLady + ld hl, wDaycareLady set 0, [hl] call Function167f6 call Function16a3b @@ -28769,15 +28766,15 @@ Function1672a: ; 1672a .asm_16752 callba Functione6b3 - ld hl, BreedMon2Nick + ld hl, wBreedMon2Nick call Function1686d call Function16807 jr c, .asm_16778 callba Functiondd42 call Function16850 - ld hl, DaycareLady + ld hl, wDaycareLady res 0, [hl] - ld hl, DaycareMan + ld hl, wDaycareMan res 5, [hl] jr .asm_1677b @@ -28830,7 +28827,7 @@ Function16798: ; 16798 ld d, [hl] callba ItemIsMail jr c, .asm_167ed - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld a, [CurPartyMon] call GetNick and a @@ -29118,7 +29115,7 @@ UnknownText_0x16931: ; 0x16931 ; 0x16936 Function16936: ; 16936 - ld hl, DaycareMan + ld hl, wDaycareMan bit 6, [hl] jr nz, Function16949 ld hl, UnknownText_0x16944 @@ -29140,7 +29137,7 @@ Function16949: ; 16949 cp $6 jr nc, .asm_16987 call Function169ac - ld hl, DaycareMan + ld hl, wDaycareMan res 6, [hl] call Function16a3b ld hl, UnknownText_0x16998 @@ -29213,26 +29210,26 @@ Function169ac: ; 169ac add hl, bc ld a, EGG ld [hli], a - ld a, [EggSpecies] + ld a, [wEggMonSpecies] ld [CurSpecies], a ld [CurPartySpecies], a ld a, $ff ld [hl], a - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld bc, $000b call Function16a31 - ld hl, EggNick + ld hl, wEggNick call CopyBytes - ld hl, PartyMon1OT + ld hl, PartyMonOT ld bc, $000b call Function16a31 - ld hl, EggOT + ld hl, wEggOT call CopyBytes ld hl, PartyMon1 ld bc, PartyMon2 - PartyMon1 call Function16a31 - ld hl, EggMon - ld bc, $0020 + ld hl, wEggMon + ld bc, wEggMonEnd - wEggMon call CopyBytes call GetBaseData ld a, [PartyCount] @@ -29278,10 +29275,10 @@ Function16a31: ; 16a31 ; 16a3b Function16a3b: ; 16a3b - ld a, [DaycareLady] + ld a, [wDaycareLady] bit 0, a ret z - ld a, [DaycareMan] + ld a, [wDaycareMan] bit 0, a ret z callab Function16e1d @@ -29290,40 +29287,40 @@ Function16a3b: ; 16a3b ret z inc a ret z - ld hl, DaycareMan + ld hl, wDaycareMan set 5, [hl] .asm_16a59 call Random cp 150 jr c, .asm_16a59 - ld [StepsToEgg], a + ld [wStepsToEgg], a jp Function16a66 ; 16a66 Function16a66: ; 16a66 xor a - ld hl, EggSpecies - ld bc, $0020 + ld hl, wEggMon + ld bc, wEggMonEnd - wEggMon call ByteFill - ld hl, EggNick - ld bc, $000b + ld hl, wEggNick + ld bc, PKMN_NAME_LENGTH call ByteFill - ld hl, EggOT - ld bc, $000b + ld hl, wEggOT + ld bc, NAME_LENGTH call ByteFill ld a, [$df21] ld [TempMonDVs], a ld a, [$df22] ld [$d124], a - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] ld [CurPartySpecies], a ld a, $3 ld [MonType], a - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] cp DITTO ld a, $1 jr z, .asm_16ab6 - ld a, [BreedMon2Species] + ld a, [wBreedMon2Species] cp DITTO ld a, $0 jr z, .asm_16ab6 @@ -29333,11 +29330,11 @@ Function16a66: ; 16a66 inc a .asm_16ab6 - ld [DittoInDaycare], a + ld [wDittoInDaycare], a and a - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] jr z, .asm_16ac2 - ld a, [BreedMon2Species] + ld a, [wBreedMon2Species] .asm_16ac2 ld [CurPartySpecies], a @@ -29357,14 +29354,14 @@ Function16a66: ; 16a66 .asm_16ae8 ld [CurPartySpecies], a ld [CurSpecies], a - ld [EggSpecies], a + ld [wEggMonSpecies], a call GetBaseData - ld hl, EggNick + ld hl, wEggNick ld de, String_16be0 call CopyName2 ld hl, PlayerName - ld de, EggOT - ld bc, $000b + ld de, wEggOT + ld bc, NAME_LENGTH call CopyBytes xor a ld [$df7c], a @@ -29404,11 +29401,11 @@ Function16a66: ; 16a66 ld [hld], a ld [$d124], a ld de, $df21 - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] cp DITTO jr z, .asm_16b98 ld de, $df5a - ld a, [BreedMon2Species] + ld a, [wBreedMon2Species] cp DITTO jr z, .asm_16b98 ld a, $3 @@ -29420,7 +29417,7 @@ Function16a66: ; 16a66 ld bc, $df5a jr c, .asm_16bab jr z, .asm_16b90 - ld a, [DittoInDaycare] + ld a, [wDittoInDaycare] and a jr z, .asm_16b98 ld d, b @@ -29428,7 +29425,7 @@ Function16a66: ; 16a66 jr .asm_16b98 .asm_16b90 - ld a, [DittoInDaycare] + ld a, [wDittoInDaycare] and a jr nz, .asm_16b98 ld d, b @@ -29784,7 +29781,7 @@ Function16e1d: ; 16e1d call Function16ed6 ld c, $0 jp nc, .asm_16eb7 - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] ld [CurPartySpecies], a ld a, [$df21] ld [TempMonDVs], a @@ -29801,7 +29798,7 @@ Function16e1d: ; 16e1d .asm_16e48 push bc - ld a, [BreedMon2Species] + ld a, [wBreedMon2Species] ld [CurPartySpecies], a ld a, [$df5a] ld [TempMonDVs], a @@ -29823,16 +29820,16 @@ Function16e1d: ; 16e1d .asm_16e70 ld c, $0 - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] cp DITTO jr z, .asm_16e82 - ld a, [BreedMon2Species] + ld a, [wBreedMon2Species] cp DITTO jr nz, .asm_16eb7 jr .asm_16e89 .asm_16e82 - ld a, [BreedMon2Species] + ld a, [wBreedMon2Species] cp DITTO jr z, .asm_16eb7 @@ -29840,9 +29837,9 @@ Function16e1d: ; 16e1d call Function16ebc ld c, $ff jp z, .asm_16eb7 - ld a, [BreedMon2Species] + ld a, [wBreedMon2Species] ld b, a - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] cp b ld c, $fe jr z, .asm_16e9f @@ -29889,19 +29886,19 @@ Function16ebc: ; 16ebc (5:6ebc) ; 16ed6 Function16ed6: ; 16ed6 - ld a, [BreedMon2Species] + ld a, [wBreedMon2Species] ld [CurSpecies], a call GetBaseData ld a, [BaseEggGroups] cp $ff jr z, .asm_16f3a - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] ld [CurSpecies], a call GetBaseData ld a, [BaseEggGroups] cp $ff jr z, .asm_16f3a - ld a, [BreedMon2Species] + ld a, [wBreedMon2Species] cp DITTO jr z, .asm_16f3c ld [CurSpecies], a @@ -29914,7 +29911,7 @@ Function16ed6: ; 16ed6 and $f0 swap a ld c, a - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] cp DITTO jr z, .asm_16f3c ld [CurSpecies], a @@ -30080,7 +30077,7 @@ Function16f7a: ; 16f7a (5:6f7a) ld a, [$d47c] ld [hl], a ld a, [CurPartyMon] ; $d109 - ld hl, PartyMonOT ; $ddff (aliases: PartyMon1OT) + ld hl, PartyMonOT ; $ddff (aliases: PartyMonOT) ld bc, $b call AddNTimes ld d, h @@ -30090,7 +30087,7 @@ Function16f7a: ; 16f7a (5:6f7a) ld hl, UnknownText_0x1708b call PrintText ld a, [CurPartyMon] ; $d109 - ld hl, PartyMonNicknames ; $de41 (aliases: PartyMon1Nickname) + ld hl, PartyMonNicknames ; $de41 (aliases: PartyMonNicknames) ld bc, $b call AddNTimes ld d, h @@ -30211,7 +30208,7 @@ Function170e4: ; 170e4 GLOBAL EggMoves push bc - ld a, [EggSpecies] + ld a, [wEggMonSpecies] dec a ld c, a ld b, 0 @@ -30245,7 +30242,7 @@ GLOBAL EggMoves jr .asm_1710c .asm_17116 - ld a, [EggSpecies] + ld a, [wEggMonSpecies] dec a ld c, a ld b, 0 @@ -30343,13 +30340,13 @@ Function17169: ; 17169 Function17197: ; 17197 ld hl, $df47 - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] cp DITTO jr z, .asm_171b1 - ld a, [BreedMon2Species] + ld a, [wBreedMon2Species] cp DITTO jr z, .asm_171d7 - ld a, [DittoInDaycare] + ld a, [wDittoInDaycare] and a ret z ld hl, $df0e @@ -30358,7 +30355,7 @@ Function17197: ; 17197 .asm_171b1 ld a, [CurPartySpecies] push af - ld a, [BreedMon2Species] + ld a, [wBreedMon2Species] ld [CurPartySpecies], a ld a, [$df5a] ld [TempMonDVs], a @@ -30375,7 +30372,7 @@ Function17197: ; 17197 .asm_171d7 ld a, [CurPartySpecies] push af - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] ld [CurPartySpecies], a ld a, [$df21] ld [TempMonDVs], a @@ -30403,13 +30400,13 @@ Function17197: ; 17197 Function1720b: ; 1720b ld hl, $df0e - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] cp DITTO ret z - ld a, [BreedMon2Species] + ld a, [wBreedMon2Species] cp DITTO jr z, .asm_17220 - ld a, [DittoInDaycare] + ld a, [wDittoInDaycare] and a ret z @@ -30425,7 +30422,7 @@ Function17224: ; 17224 (5:7224) ld [CurPartySpecies], a ; $d108 ld [CurSpecies], a ; $cf60 call GetBaseData - ld hl, BattleMonDVs ; $c632 (aliases: BattleMonAtkDefDV) + ld hl, BattleMonDVs ld a, $2d call Predef pop de @@ -30438,7 +30435,7 @@ Function1723c: ; 1723c (5:723c) ld [CurPartySpecies], a ; $d108 ld [CurSpecies], a ; $cf60 call GetBaseData - ld hl, BattleMonDVs ; $c632 (aliases: BattleMonAtkDefDV) + ld hl, BattleMonDVs ld a, $2d call Predef pop de @@ -30672,26 +30669,26 @@ Function17418: ; 17418 (5:7418) Function17421: ; 17421 ld hl, UnknownText_0x17467 call PrintText - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] call Function37ce - ld a, [DaycareLady] + ld a, [wDaycareLady] bit 0, a jr z, Function1745f call Functionaaf - ld hl, BreedMon2Nick + ld hl, wBreedMon2Nick call Function1746c jp PrintText Function17440: ; 17440 ld hl, UnknownText_0x17462 call PrintText - ld a, [BreedMon2Species] + ld a, [wBreedMon2Species] call Function37ce - ld a, [DaycareMan] + ld a, [wDaycareMan] bit 0, a jr z, Function1745f call Functionaaf - ld hl, BreedMon1Nick + ld hl, wBreedMon1Nick call Function1746c jp PrintText @@ -36345,7 +36342,7 @@ Function2805d: ; 2805d call Function75f ld a, $fe ld [de], a - ld hl, EnemyMoveAnimation + ld hl, $c608 ld de, PlayerSDefLevel ld bc, $00c8 call Function75f @@ -36488,7 +36485,7 @@ Function28177: ; 28177 call Function75f ld a, $fe ld [de], a - ld hl, EnemyMoveAnimation + ld hl, $c608 ld de, PlayerSDefLevel ld bc, $00c8 call Function75f @@ -36838,7 +36835,7 @@ Function28434: ; 28434 ld [hli], a dec b jr nz, .asm_28441 - ld hl, EnemyMoveAnimation + ld hl, $c608 ld a, $fd ld [hli], a ld [hli], a @@ -36850,7 +36847,7 @@ Function28434: ; 28434 dec b jr nz, .asm_28457 ld hl, $c818 - ld de, PlayerMoveType + ld de, $c612 ld bc, $0000 .asm_28464 inc c @@ -37087,10 +37084,10 @@ Function28595: ; 28595 ld hl, PartyMon1Species ld bc, $0120 call CopyBytes - ld hl, PartyMon1OT + ld hl, PartyMonOT ld bc, $0042 call CopyBytes - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld bc, $0042 call CopyBytes ld a, [InLinkBattle] @@ -37226,10 +37223,10 @@ Function2868a: ; 2868a pop hl ld bc, $0108 add hl, bc - ld de, OTPartyMon1OT + ld de, OTPartyMonOT ld bc, $0042 call CopyBytes - ld de, OTPartyMon1Nickname + ld de, OTPartyMonNicknames ld bc, $0042 jp CopyBytes ; 286ba @@ -38059,7 +38056,7 @@ Function28b87: ; 28b87 ld [PlayerSDefLevel], a push af ld a, [DefaultFlypoint] - ld hl, PartyMon1OT + ld hl, PartyMonOT call SkipNames ld de, $c6f2 ld bc, $000b @@ -38098,7 +38095,7 @@ Function28b87: ; 28b87 ld a, [hl] ld [PlayerLightScreenCount], a ld a, [$d003] - ld hl, OTPartyMon1OT + ld hl, OTPartyMonOT call SkipNames ld de, $c724 ld bc, $000b @@ -38110,7 +38107,7 @@ Function28b87: ; 28b87 ld [$c731], a ld a, [hl] ld [$c732], a - ld hl, OTPartyMon1AtkDefDV + ld hl, OTPartyMon1DVs ld a, [$d003] call GetPartyLocation ld a, [hli] @@ -40541,14 +40538,14 @@ Function2a09c: ; 2a09c ; 2a0b7 Function2a0b7: ; 2a0b7 - ld a, [RoamMon1Species] + ld a, [wRoamMon1Species] ld b, a ld a, [$d265] cp b ret nz - ld a, [RoamMon1MapGroup] + ld a, [wRoamMon1MapGroup] ld b, a - ld a, [RoamMon1MapNumber] + ld a, [wRoamMon1MapNumber] ld c, a call Function2a09c ret nc @@ -40558,14 +40555,14 @@ Function2a0b7: ; 2a0b7 ; 2a0cf Function2a0cf: ; 2a0cf - ld a, [RoamMon2Species] + ld a, [wRoamMon2Species] ld b, a ld a, [$d265] cp b ret nz - ld a, [RoamMon2MapGroup] + ld a, [wRoamMon2MapGroup] ld b, a - ld a, [RoamMon2MapNumber] + ld a, [wRoamMon2MapNumber] ld c, a call Function2a09c ret nc @@ -40911,45 +40908,45 @@ Function2a288: ; 2a288 InitRoamMons: ; 2a2a0 -; initialize RoamMon structs +; initialize wRoamMon structs ; species ld a, RAIKOU - ld [RoamMon1Species], a + ld [wRoamMon1Species], a ld a, ENTEI - ld [RoamMon2Species], a + ld [wRoamMon2Species], a ; ld a, SUICUNE -; ld [RoamMon3Species], a +; ld [wRoamMon3Species], a ; level ld a, 40 - ld [RoamMon1Level], a - ld [RoamMon2Level], a -; ld [RoamMon3Level], a + ld [wRoamMon1Level], a + ld [wRoamMon2Level], a +; ld [wRoamMon3Level], a ; raikou starting map ld a, GROUP_ROUTE_42 - ld [RoamMon1MapGroup], a + ld [wRoamMon1MapGroup], a ld a, MAP_ROUTE_42 - ld [RoamMon1MapNumber], a + ld [wRoamMon1MapNumber], a ; entei starting map ld a, GROUP_ROUTE_37 - ld [RoamMon2MapGroup], a + ld [wRoamMon2MapGroup], a ld a, MAP_ROUTE_37 - ld [RoamMon2MapNumber], a + ld [wRoamMon2MapNumber], a ; suicune starting map ; ld a, GROUP_ROUTE_38 -; ld [RoamMon3MapGroup], a +; ld [wRoamMon3MapGroup], a ; ld a, MAP_ROUTE_38 -; ld [RoamMon3MapNumber], a +; ld [wRoamMon3MapNumber], a ; hp xor a ; generate new stats - ld [RoamMon1HP], a - ld [RoamMon2HP], a -; ld [RoamMon3HP], a + ld [wRoamMon1HP], a + ld [wRoamMon2HP], a +; ld [wRoamMon3HP], a ret ; 2a2ce @@ -40966,7 +40963,7 @@ Function2a2ce: ; 2a2ce and 3 jr z, .asm_2a30a dec a - ld hl, RoamMon1MapGroup + ld hl, wRoamMon1MapGroup ld c, a ld b, 0 ld a, 7 @@ -40999,43 +40996,43 @@ Function2a2ce: ; 2a2ce Function2a30d: ; 2a30d - ld a, [RoamMon1MapGroup] + ld a, [wRoamMon1MapGroup] cp $ff jr z, .asm_2a324 ld b, a - ld a, [RoamMon1MapNumber] + ld a, [wRoamMon1MapNumber] ld c, a call Function2a355 ld a, b - ld [RoamMon1MapGroup], a + ld [wRoamMon1MapGroup], a ld a, c - ld [RoamMon1MapNumber], a + ld [wRoamMon1MapNumber], a .asm_2a324 - ld a, [RoamMon2MapGroup] + ld a, [wRoamMon2MapGroup] cp $ff jr z, .asm_2a33b ld b, a - ld a, [RoamMon2MapNumber] + ld a, [wRoamMon2MapNumber] ld c, a call Function2a355 ld a, b - ld [RoamMon2MapGroup], a + ld [wRoamMon2MapGroup], a ld a, c - ld [RoamMon2MapNumber], a + ld [wRoamMon2MapNumber], a .asm_2a33b - ld a, [RoamMon3MapGroup] + ld a, [wRoamMon3MapGroup] cp $ff jr z, .asm_2a352 ld b, a - ld a, [RoamMon3MapNumber] + ld a, [wRoamMon3MapNumber] ld c, a call Function2a355 ld a, b - ld [RoamMon3MapGroup], a + ld [wRoamMon3MapGroup], a ld a, c - ld [RoamMon3MapNumber], a + ld [wRoamMon3MapNumber], a .asm_2a352 jp Function2a3f6 @@ -41096,34 +41093,34 @@ Function2a355: ; 2a355 ret Function2a394: ; 2a394 - ld a, [RoamMon1MapGroup] + ld a, [wRoamMon1MapGroup] cp $ff jr z, .asm_2a3a6 call Function2a3cd ld a, b - ld [RoamMon1MapGroup], a + ld [wRoamMon1MapGroup], a ld a, c - ld [RoamMon1MapNumber], a + ld [wRoamMon1MapNumber], a .asm_2a3a6 - ld a, [RoamMon2MapGroup] + ld a, [wRoamMon2MapGroup] cp $ff jr z, .asm_2a3b8 call Function2a3cd ld a, b - ld [RoamMon2MapGroup], a + ld [wRoamMon2MapGroup], a ld a, c - ld [RoamMon2MapNumber], a + ld [wRoamMon2MapNumber], a .asm_2a3b8 - ld a, [RoamMon3MapGroup] + ld a, [wRoamMon3MapGroup] cp $ff jr z, .asm_2a3ca call Function2a3cd ld a, b - ld [RoamMon3MapGroup], a + ld [wRoamMon3MapGroup], a ld a, c - ld [RoamMon3MapNumber], a + ld [wRoamMon3MapNumber], a .asm_2a3ca jp Function2a3f6 @@ -42615,7 +42612,7 @@ Function2c867: ; 2c867 call Predef push bc ld a, [CurPartyMon] ; $d109 - ld hl, PartyMonNicknames ; $de41 (aliases: PartyMon1Nickname) + ld hl, PartyMonNicknames ; $de41 (aliases: PartyMonNicknames) call GetNick pop bc ld a, c @@ -43443,8 +43440,8 @@ ClearBattleRAM: ; 2ef18 ld [hl], a ; Clear the entire BattleMons area - ld hl, EnemyMoveStruct - ld bc, $0139 + ld hl, wBattle + ld bc, wBattleEnd - wBattle xor a call ByteFill @@ -43929,8 +43926,8 @@ Function382ae: ; 382ae callab AICheckEnemyMaxHP jr c, .asm_382e4 push bc - ld de, EnemyMonMaxHPLo - ld hl, EnemyMonHPLo + ld de, EnemyMonMaxHP + 1 + ld hl, EnemyMonHP + 1 ld a, [de] sub [hl] jr z, .asm_382e7 @@ -44100,23 +44097,23 @@ Function383b5: ; 383b5 (e:43b5) ld [EnemyConfuseCount], a ; $c67b asm_383c6: ; 383c6 (e:43c6) ld de, $d1ec - ld hl, EnemyMonHPLo ; $d217 + ld hl, EnemyMonHP + 1 ; $d217 ld a, [hld] ld [de], a inc de ld a, [hl] ld [de], a inc de - ld hl, EnemyMonMaxHPLo ; $d219 + ld hl, EnemyMonMaxHP + 1 ; $d219 ld a, [hld] ld [de], a inc de ld [Buffer1], a ; $d1ea (aliases: MagikarpLength) - ld [EnemyMonHPLo], a ; $d217 + ld [EnemyMonHP + 1], a ; $d217 ld a, [hl] ld [de], a ld [Buffer2], a ; $d1eb (aliases: MovementType) - ld [EnemyMonHPHi], a ; $d216 (aliases: EnemyMonHP) + ld [EnemyMonHP], a ; $d216 (aliases: EnemyMonHP) jr asm_38436 ; 383e8 (e:43e8) @@ -44137,7 +44134,7 @@ Function383f4: ; 383f4 (e:43f4) Function383f8: ; 383f8 ld [$d1f1], a - ld hl, EnemyMonHPLo ; $d217 + ld hl, EnemyMonHP + 1 ; $d217 ld a, [hl] ld [$d1ec], a add b @@ -44154,7 +44151,7 @@ Function383f8: ; 383f8 inc hl ld a, [hld] ld b, a - ld de, EnemyMonMaxHPLo ; $d219 + ld de, EnemyMonMaxHP + 1 ; $d219 ld a, [de] dec de ld [Buffer1], a ; $d1ea (aliases: MagikarpLength) @@ -44304,7 +44301,7 @@ Function38511: ; 38511 Function3851e: ; 3851e ld [hMultiplier], a - ld hl, EnemyMonMaxHPHi + ld hl, EnemyMonMaxHP ld a, [hli] ld [hProduct], a ld a, [hl] @@ -44315,7 +44312,7 @@ Function3851e: ; 3851e ld c, a ld a, [$ffb5] ld b, a - ld hl, EnemyMonHPLo + ld hl, EnemyMonHP + 1 ld a, [hld] ld e, a ld a, [hl] @@ -47760,7 +47757,7 @@ Function421f5: ; 421f5 ld a, [hl] ld [Buffer2], a ld a, [CurPartyMon] - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call GetNick call CopyName1 ld hl, UnknownText_0x42482 @@ -47929,7 +47926,7 @@ Function42414: ; 42414 jr nz, .asm_4242b ld a, [CurPartyMon] ld bc, $000b - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call AddNTimes push hl ld a, [CurSpecies] @@ -48948,7 +48945,7 @@ Function446cc:: ; 446cc call CopyBytes pop af push af - ld hl, PartyMon1OT + ld hl, PartyMonOT ld bc, $000b call AddNTimes ld bc, $000a @@ -51399,7 +51396,7 @@ Function492b9: ; 492b9 call Predef push bc ld a, [CurPartyMon] - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call GetNick pop bc ld a, c @@ -53945,7 +53942,7 @@ CheckOwnMonAnywhere: ; 0x4a721 ld d, a ld e, 0 ld hl, PartyMon1Species - ld bc, PartyMon1OT + ld bc, PartyMonOT ; Run CheckOwnMon on each Pokémon in the party. .partymon @@ -53963,13 +53960,13 @@ CheckOwnMonAnywhere: ; 0x4a721 ; Run CheckOwnMon on each Pokémon in the PC. ld a, 1 call GetSRAMBank - ld a, [BoxCount] + ld a, [sBoxCount] and a jr z, .boxes ld d, a - ld hl, BoxMon1Species - ld bc, BoxMon1OT + ld hl, sBoxMon1Species + ld bc, sBoxMonOT .openboxmon call CheckOwnMon jr nc, .next @@ -53980,7 +53977,7 @@ CheckOwnMonAnywhere: ; 0x4a721 .next push bc - ld bc, BoxMon2 - BoxMon1 + ld bc, sBoxMon2 - sBoxMon1 add hl, bc pop bc call UpdateOTPointer @@ -54019,13 +54016,13 @@ CheckOwnMonAnywhere: ; 0x4a721 push bc push hl - ld de, BoxMons - BoxCount + ld de, sBoxMons - sBoxCount add hl, de ld d, h ld e, l pop hl push de - ld de, BoxMonOT - BoxCount + ld de, sBoxMonOT - sBoxCount add hl, de ld b, h ld c, l @@ -54044,7 +54041,7 @@ CheckOwnMonAnywhere: ; 0x4a721 .nextboxmon push bc - ld bc, BoxMon2 - BoxMon1 + ld bc, sBoxMon2 - sBoxMon1 add hl, bc pop bc call UpdateOTPointer @@ -54153,7 +54150,7 @@ Unknown_4a810: ; 4a810 UpdateOTPointer: ; 0x4a83a push hl - ld hl, PartyMon2OT - PartyMon1OT + ld hl, NAME_LENGTH add hl, bc ld b, h ld c, l @@ -54173,7 +54170,7 @@ Function4a843: ; 4a843 ld d, a ld e, 0 ld hl, PartyMon1Species - ld bc, PartyMon1OT + ld bc, PartyMonOT .asm_4a851 call Function4a8dc ret c @@ -54186,12 +54183,12 @@ Function4a843: ; 4a843 jr nz, .asm_4a851 ld a, 1 call GetSRAMBank - ld a, [BoxCount] + ld a, [sBoxCount] and a jr z, .asm_4a888 ld d, a - ld hl, BoxMon1Species - ld bc, BoxMon1OT + ld hl, sBoxMon1Species + ld bc, sBoxMonOT .asm_4a873 call Function4a8dc jr nc, .asm_4a87c @@ -54200,7 +54197,7 @@ Function4a843: ; 4a843 .asm_4a87c push bc - ld bc, BoxMon2 - BoxMon1 + ld bc, sBoxMon2 - sBoxMon1 add hl, bc pop bc call Function4a91e @@ -54230,13 +54227,13 @@ Function4a843: ; 4a843 jr z, .asm_4a8d1 push bc push hl - ld de, BoxMons - BoxCount + ld de, sBoxMons - sBoxCount add hl, de ld d, h ld e, l pop hl push de - ld de, BoxMonOT - BoxCount + ld de, sBoxMonOT - sBoxCount add hl, de ld b, h ld c, l @@ -54251,7 +54248,7 @@ Function4a843: ; 4a843 .asm_4a8c4 push bc - ld bc, BoxMon2 - BoxMon1 + ld bc, sBoxMon2 - sBoxMon1 add hl, bc pop bc call Function4a91e @@ -54316,7 +54313,7 @@ Unknown_4a8f4: ; 4a8f4 Function4a91e: ; 4a91e push hl - ld hl, PartyMon2OT - PartyMon1OT + ld hl, NAME_LENGTH add hl, bc ld b, h ld c, l @@ -54438,7 +54435,7 @@ Function4a9c3: ; 4a9c3 Function4a9d7: ; 4a9d7 ld a, [DefaultFlypoint] - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call GetNick ld h, d ld l, e @@ -54446,7 +54443,7 @@ Function4a9d7: ; 4a9d7 ld bc, $0006 call CopyBytes ld a, [$d003] - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call GetNick ld h, d ld l, e @@ -54454,7 +54451,7 @@ Function4a9d7: ; 4a9d7 ld bc, $0006 call CopyBytes ld a, [$d004] - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call GetNick ld h, d ld l, e @@ -55593,7 +55590,7 @@ ENDM Function4d15b:: ; 4d15b - ld hl, EnemyMoveAnimation + ld hl, $c608 ld a, [$d196] and a jr z, .asm_4d168 @@ -56381,12 +56378,12 @@ Function4d87a: ; 4d87a jr nz, .asm_4d88d ld a, $1 call GetSRAMBank - ld a, [BoxCount] + ld a, [sBoxCount] and a jr z, .asm_4d8c8 ld d, a - ld hl, BoxMon1ID - ld bc, BoxSpecies + ld hl, sBoxMon1ID + ld bc, sBoxSpecies .asm_4d8af ld a, [bc] inc bc @@ -56399,7 +56396,7 @@ Function4d87a: ; 4d87a .asm_4d8bf push bc - ld bc, BoxMon2 - BoxMon1 + ld bc, sBoxMon2 - sBoxMon1 add hl, bc pop bc dec d @@ -56446,7 +56443,7 @@ Function4d87a: ; 4d87a .asm_4d901 push bc - ld bc, BoxMon2 - BoxMon1 + ld bc, sBoxMon2 - sBoxMon1 add hl, bc pop bc dec d @@ -56625,7 +56622,7 @@ Function4d9e5: ; 4d9e5 call CopyBytes ld a, [PartyCount] dec a - ld hl, PartyMon1OT + ld hl, PartyMonOT call SkipNames ld d, h ld e, l @@ -56651,7 +56648,7 @@ Function4d9e5: ; 4d9e5 .asm_4da66 ld a, [PartyCount] dec a - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call SkipNames ld d, h ld e, l @@ -56683,20 +56680,20 @@ Function4d9e5: ; 4d9e5 Function4daa3: ; 4daa3 ld a, $1 call GetSRAMBank - ld hl, BoxCount + ld hl, sBoxCount ld a, [hl] - cp 20 + cp MONS_PER_BOX call CloseSRAM jr nc, .asm_4db08 xor a ld [CurPartyMon], a ld hl, $df9c ld de, $d018 - ld bc, BoxMon2 - BoxMon1 + ld bc, sBoxMon2 - sBoxMon1 call CopyBytes ld hl, PlayerName ld de, $d00d - ld bc, $000b + ld bc, NAME_LENGTH call CopyBytes callab Function51322 ld a, [CurPartySpecies] @@ -56714,21 +56711,21 @@ Function4daa3: ; 4daa3 .asm_4daf7 ld a, $1 call GetSRAMBank - ld de, BoxMon1Nickname - ld bc, $000b + ld de, sBoxMonNicknames + ld bc, PKMN_NAME_LENGTH call CopyBytes call CloseSRAM .asm_4db08 ld a, $1 call GetSRAMBank - ld a, [BoxMon1Level] + ld a, [sBoxMon1Level] ld [CurPartyLevel], a call CloseSRAM call Function4db83 ld a, $1 call GetSRAMBank - ld hl, BoxMon1CaughtLocation + ld hl, sBoxMon1CaughtLocation ld a, [hl] and $80 ld b, $13 @@ -56804,7 +56801,7 @@ Function4db53: ; 4db53 Function4db83: ; 4db83 ld a, $1 call GetSRAMBank - ld hl, BoxMon1CaughtLevel + ld hl, sBoxMon1CaughtLevel call Function4db53 call CloseSRAM ret @@ -56814,7 +56811,7 @@ Function4db92: ; 4db92 push bc ld a, $1 call GetSRAMBank - ld hl, BoxMon1CaughtLevel + ld hl, sBoxMon1CaughtLevel pop bc call Function4dbaf call CloseSRAM @@ -57800,7 +57797,7 @@ Function4e1cc: ; 4e1cc (13:61cc) Unknown_4e216: ; 4e216 dw PartyMonOT dw OTPartyMonOT - dw BoxMonOT + dw sBoxMonOT dw $d00d ; 4e21e @@ -57907,7 +57904,7 @@ Jumptable_4e2b5: ; 4e2b5 (13:62b5) Function4e2bf: ; 4e2bf (13:62bf) ld a, [CurPartyMon] ; $d109 ld hl, PartyMons ; $dcdf (aliases: PartyMon1, PartyMon1Species) - ld bc, $30 + ld bc, PartyMon2 - PartyMon1 call AddNTimes ld b, h ld c, l @@ -57920,7 +57917,7 @@ Function4e2cf: ; 4e2cf (13:62cf) ; no known jump sources Function4e2d1: ; 4e2d1 (13:62d1) - ld hl, BoxMons + ld hl, sBoxMons ld bc, $30 ld a, [CurPartyMon] ; $d109 call AddNTimes @@ -59123,7 +59120,7 @@ Function5009b: ; 5009b push bc push hl push hl - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld a, b call GetNick pop hl @@ -59860,7 +59857,7 @@ YouHaveNoPKMNString: ; 0x50556 Function50566: ; 50566 ld a, [CurPartyMon] - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call GetNick ld a, [PartyMenuActionText] and $f @@ -60501,15 +60498,15 @@ Function508d5: ; 508d5 jr .asm_50905 .asm_508f1 - ld a, 1 ; BANK(BoxSpecies) + ld a, 1 ; BANK(sBoxSpecies) call GetSRAMBank - ld hl, BoxSpecies + ld hl, sBoxSpecies call .asm_50905 call CloseSRAM ret .asm_50900 - ld a, [BreedMon1Species] + ld a, [wBreedMon1Species] jr .asm_50909 .asm_50905 @@ -60797,11 +60794,11 @@ GetGender: ; 50bdd dec a jr z, .PartyMon -; 2: BoxMon - ld hl, BoxMon1DVs - ld bc, BoxMon2 - BoxMon1 +; 2: sBoxMon + ld hl, sBoxMon1DVs + ld bc, sBoxMon2 - sBoxMon1 dec a - jr z, .BoxMon + jr z, .sBoxMon ; 3: Unknown ld hl, TempMonDVs @@ -60816,14 +60813,14 @@ GetGender: ; 50bdd ; Get our place in the party/box. .PartyMon -.BoxMon +.sBoxMon ld a, [CurPartyMon] call AddNTimes .DVs -; BoxMon data is read directly from SRAM. +; sBoxMon data is read directly from SRAM. ld a, [MonType] cp BOXMON ld a, 1 @@ -60842,7 +60839,7 @@ GetGender: ; 50bdd or b ld b, a -; Close SRAM if we were dealing with a BoxMon. +; Close SRAM if we were dealing with a sBoxMon. ld a, [MonType] cp BOXMON call z, CloseSRAM @@ -60997,7 +60994,7 @@ Function50cd0: ; 50cd0 Function50cdb: ; 50cdb push hl push hl - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld a, [CurPartyMon] call GetNick pop hl @@ -61157,7 +61154,7 @@ Function50db9: ; 50db9 cp $1 jr nz, .asm_50dca ld hl, OTPartyCount - ld de, OTPartyMon1OT + ld de, OTPartyMonOT ld a, ENEMY_OT_NAME jr .asm_50dfc .asm_50dca @@ -61165,7 +61162,7 @@ Function50db9: ; 50db9 cp $4 jr nz, .asm_50dd8 ld hl, PartyCount - ld de, PartyMon1OT + ld de, PartyMonOT ld a, PARTY_OT_NAME jr .asm_50dfc .asm_50dd8 @@ -61477,12 +61474,12 @@ Function50f62: ; 50f62 (14:4f62) ld bc, $30 call CopyBytes ld a, [Buffer2] ; $d1eb (aliases: MovementType) - ld hl, PartyMonOT ; $ddff (aliases: PartyMon1OT) + ld hl, PartyMonOT ; $ddff (aliases: PartyMonOT) call SkipNames push hl call Function51036 ld a, [$d1ec] - ld hl, PartyMonOT ; $ddff (aliases: PartyMon1OT) + ld hl, PartyMonOT ; $ddff (aliases: PartyMonOT) call SkipNames pop de push hl @@ -61490,12 +61487,12 @@ Function50f62: ; 50f62 (14:4f62) pop de ld hl, DefaultFlypoint ; $d002 call Function51039 - ld hl, PartyMonNicknames ; $de41 (aliases: PartyMon1Nickname) + ld hl, PartyMonNicknames ; $de41 (aliases: PartyMonNicknames) ld a, [Buffer2] ; $d1eb (aliases: MovementType) call SkipNames push hl call Function51036 - ld hl, PartyMonNicknames ; $de41 (aliases: PartyMon1Nickname) + ld hl, PartyMonNicknames ; $de41 (aliases: PartyMonNicknames) ld a, [$d1ec] call SkipNames pop de @@ -61546,8 +61543,8 @@ GetUnownLetter: ; 51040 ; Return Unown letter in UnownLetter based on DVs at hl ; Take the middle 2 bits of each DV and place them in order: -; AtkDefDV | SpdSpcDV -; .ww..xx. .yy..zz. +; atk def spd spc +; .ww..xx. .yy..zz. ; atk ld a, [hl] @@ -62026,27 +62023,27 @@ Function512f2: ; 512f2 Function51322: ; 51322 ld a, $1 call GetSRAMBank - ld hl, BoxCount + ld hl, sBoxCount call Function513cb - ld a, [BoxCount] + ld a, [sBoxCount] dec a ld [$d265], a - ld hl, BoxMon1Nickname - ld bc, $000b - ld de, DefaultFlypoint + ld hl, sBoxMonNicknames + ld bc, PKMN_NAME_LENGTH + ld de, $d002 call Function513e0 - ld a, [BoxCount] + ld a, [sBoxCount] dec a ld [$d265], a - ld hl, BoxMon1OT - ld bc, $000b + ld hl, sBoxMonOT + ld bc, NAME_LENGTH ld de, $d00d call Function513e0 - ld a, [BoxCount] + ld a, [sBoxCount] dec a ld [$d265], a - ld hl, BoxMon1Species - ld bc, $0020 + ld hl, sBoxMons + ld bc, sBoxMon1End - sBoxMon1 ld de, $d018 call Function513e0 ld hl, $d01a @@ -62069,21 +62066,21 @@ Function5138b: ; 5138b ld a, [PartyCount] dec a ld [$d265], a - ld hl, PartyMon1Nickname - ld bc, $000b - ld de, DefaultFlypoint + ld hl, PartyMonNicknames + ld bc, PKMN_NAME_LENGTH + ld de, $d002 call Function513e0 ld a, [PartyCount] dec a ld [$d265], a - ld hl, PartyMon1OT - ld bc, $000b + ld hl, PartyMonOT + ld bc, NAME_LENGTH ld de, $d00d call Function513e0 ld a, [PartyCount] dec a ld [$d265], a - ld hl, PartyMon1Species + ld hl, PartyMons ld bc, PartyMon2 - PartyMon1 ld de, $d018 call Function513e0 @@ -62095,7 +62092,7 @@ Function513cb: ; 513cb inc hl ld a, [CurPartyMon] ld c, a - ld b, $0 + ld b, 0 add hl, bc ld a, [CurPartySpecies] ld c, a @@ -63254,10 +63251,10 @@ Function806ff: ; 806ff Function80715: ; 80715 ; Remaining slots in the current box. - ld a, $1 + ld a, 1 ; BANK(sBoxCount) call GetSRAMBank - ld hl, BoxCount - ld a, 20 + ld hl, sBoxCount + ld a, MONS_PER_BOX sub [hl] ld b, a call CloseSRAM @@ -63458,13 +63455,13 @@ Function819a7: ; 819a7 dec c jr nz, .asm_819d6 ld a, $94 - ld [EnemyMoveAnimation], a + ld [$c608], a ld a, $52 - ld [EnemyMoveEffect], a + ld [$c609], a ld a, $4a - ld [EnemyMovePower], a + ld [$c60a], a ld a, $29 - ld [EnemyMoveType], a + ld [$c60b], a pop af ld [rSVBK], a ret @@ -63766,13 +63763,13 @@ Function81bf4: ; 81bf4 add hl, hl ld de, OverworldMap add hl, de - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $0004 call CopyBytes xor a ld [$cf64], a ld [$cf65], a - ld de, EnemyMoveAnimation + ld de, $c608 call Function81ea5 ret ; 81c18 @@ -63803,14 +63800,14 @@ Function81c33: ; 81c33 ld a, $5 ld [rSVBK], a ld hl, BGPals - ld de, EnemyMoveAnimation + ld de, $c608 ld c, $1 call Function81ee3 hlcoord 10, 2 - ld de, EnemyMoveAnimation + ld de, $c608 call Function81ca7 hlcoord 15, 2 - ld de, EnemyMovePower + ld de, $c60a call Function81ca7 ld a, $1 ld [hCGBPalUpdate], a @@ -63828,13 +63825,13 @@ Function81c33: ; 81c33 ld [hli], a ld a, $7f ld [hli], a - ld a, [EnemyMoveAnimation] + ld a, [$c608] ld [hli], a - ld a, [EnemyMoveEffect] + ld a, [$c609] ld [hli], a - ld a, [EnemyMovePower] + ld a, [$c60a] ld [hli], a - ld a, [EnemyMoveType] + ld a, [$c60b] ld [hli], a xor a ld [hli], a @@ -63843,10 +63840,10 @@ Function81c33: ; 81c33 ld hl, $cda9 call Function81f0c hlcoord 10, 2 - ld de, EnemyMoveAnimation + ld de, $c608 call Function81ca7 hlcoord 15, 2 - ld de, EnemyMovePower + ld de, $c60a call Function81ca7 ld a, $3 ld [$cf63], a @@ -63939,14 +63936,14 @@ Function81d0a: ; 81d0a .asm_81d1d xor a ld [$cf65], a - ld de, EnemyMoveAnimation + ld de, $c608 call Function81ea5 ret .asm_81d28 ld a, $1 ld [$cf65], a - ld de, EnemyMovePower + ld de, $c60a call Function81ea5 ret @@ -63958,7 +63955,7 @@ Function81d34: ; 81d34 ld a, [hl] and $40 jr nz, Function81d84 - ld hl, PlayerMoveType + ld hl, $c612 jr Function81d63 Function81d46: ; 81d46 @@ -63969,7 +63966,7 @@ Function81d46: ; 81d46 ld a, [hl] and $40 jr nz, Function81d84 - ld hl, PlayerMoveAccuracy + ld hl, $c613 jr Function81d63 Function81d58: ; 81d58 @@ -63977,7 +63974,7 @@ Function81d58: ; 81d58 ld a, [hl] and $40 jr nz, Function81d84 - ld hl, PlayerMovePP + ld hl, $c614 Function81d63: ; 81d63 ld a, [$ffa9] @@ -64150,21 +64147,21 @@ Function81e5e: ; 81e5e ; 81e67 Function81e67: ; 81e67 - ld a, [PlayerMoveType] + ld a, [$c612] and $1f ld e, a - ld a, [PlayerMoveAccuracy] + ld a, [$c613] and $7 sla a swap a or e ld e, a - ld a, [PlayerMoveAccuracy] + ld a, [$c613] and $18 sla a swap a ld d, a - ld a, [PlayerMovePP] + ld a, [$c614] and $1f sla a sla a @@ -64174,23 +64171,23 @@ Function81e67: ; 81e67 and a jr z, .asm_81e9c ld a, e - ld [EnemyMovePower], a + ld [$c60a], a ld a, d - ld [EnemyMoveType], a + ld [$c60b], a ret .asm_81e9c ld a, e - ld [EnemyMoveAnimation], a + ld [$c608], a ld a, d - ld [EnemyMoveEffect], a + ld [$c609], a ret ; 81ea5 Function81ea5: ; 81ea5 ld a, [de] and $1f - ld [PlayerMoveType], a + ld [$c612], a ld a, [de] and $e0 swap a @@ -64202,12 +64199,12 @@ Function81ea5: ; 81ea5 swap a srl a or b - ld [PlayerMoveAccuracy], a + ld [$c613], a ld a, [de] and $7c srl a srl a - ld [PlayerMovePP], a + ld [$c614], a ret ; 81eca @@ -64222,7 +64219,7 @@ Function81eca: ; 81eca add hl, de ld e, l ld d, h - ld hl, EnemyMoveAnimation + ld hl, $c608 ld bc, $0004 call CopyBytes ret @@ -64371,11 +64368,11 @@ Function81f5e: ; 81f5e ld b, $70 ld c, $5 ld hl, Sprites - ld de, PlayerMoveType + ld de, $c612 call .asm_81fb7 - ld de, PlayerMoveAccuracy + ld de, $c613 call .asm_81fb7 - ld de, PlayerMovePP + ld de, $c614 call .asm_81fb7 ret @@ -64523,10 +64520,10 @@ Function8220f: ; 8220f add hl, hl ld de, Unkn1Pals add hl, de - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $0008 call CopyBytes - ld de, EnemyMoveAnimation + ld de, $c608 call Function81ea5 pop af ld [rSVBK], a @@ -64572,7 +64569,7 @@ Function82236: ; 82236 ld a, [$cf64] ld bc, $0008 call AddNTimes - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $0008 call CopyBytes pop af @@ -64604,20 +64601,20 @@ Function822a3: ; 822a3 call AddNTimes ld e, l ld d, h - ld hl, EnemyMoveAnimation + ld hl, $c608 ld bc, $0008 call CopyBytes hlcoord 1, 0 - ld de, EnemyMoveAnimation + ld de, $c608 call Function81ca7 hlcoord 6, 0 - ld de, EnemyMovePower + ld de, $c60a call Function81ca7 hlcoord 11, 0 - ld de, EnemyMoveAccuracy + ld de, $c60c call Function81ca7 hlcoord 16, 0 - ld de, EnemyMoveEffectChance + ld de, $c60e call Function81ca7 pop af ld [rSVBK], a @@ -64675,7 +64672,7 @@ Function82309: ; 82309 ld [$cf66], a ld e, a ld d, $0 - ld hl, EnemyMoveAnimation + ld hl, $c608 add hl, de add hl, de ld e, l @@ -64691,7 +64688,7 @@ Function82339: ; 82338 ld a, [hl] and $40 jr nz, Function82387 - ld hl, PlayerMoveType + ld hl, $c612 jr Function82368 Function8234b: ; 8234b @@ -64702,7 +64699,7 @@ Function8234b: ; 8234b ld a, [hl] and $40 jr nz, Function82387 - ld hl, PlayerMoveAccuracy + ld hl, $c613 jr Function82368 Function8235d: ; 8235d @@ -64710,7 +64707,7 @@ Function8235d: ; 8235d ld a, [hl] and $40 jr nz, Function82387 - ld hl, PlayerMovePP + ld hl, $c614 Function82368: ; 82368 ld a, [$ffa9] @@ -64751,21 +64748,21 @@ Function8238c: ; 8238c ; 82391 Function82391: ; 82391 - ld a, [PlayerMoveType] + ld a, [$c612] and $1f ld e, a - ld a, [PlayerMoveAccuracy] + ld a, [$c613] and $7 sla a swap a or e ld e, a - ld a, [PlayerMoveAccuracy] + ld a, [$c613] and $18 sla a swap a ld d, a - ld a, [PlayerMovePP] + ld a, [$c614] and $1f sla a sla a @@ -64774,7 +64771,7 @@ Function82391: ; 82391 ld a, [$cf66] ld c, a ld b, $0 - ld hl, EnemyMoveAnimation + ld hl, $c608 add hl, bc add hl, bc ld a, e @@ -66036,13 +66033,13 @@ Unknown_84807: ; 84807 ; known jump sources: 844f2 (21:44f2) Function84817: ; 84817 (21:4817) xor a - ld [DefaultFlypoint], a ; $d002 - ld hl, TileMap ; $c4a0 (aliases: SpritesEnd) + ld [$d002], a + ld hl, TileMap ld bc, $168 ld a, $7f call ByteFill call Function84a0e - ld hl, TileMap ; $c4a0 (aliases: SpritesEnd) + ld hl, TileMap ld bc, $b4 ld a, $7f call ByteFill @@ -66051,9 +66048,9 @@ Function84817: ; 84817 (21:4817) hlcoord 4, 3 ld de, String_84865 call PlaceString - ld a, [MovementBuffer] ; $d007 - ld bc, $9 - ld hl, Box1Name ; $db75 + ld a, [$d007] + ld bc, 9 + ld hl, wBoxNames call AddNTimes ld d, h ld e, l @@ -66440,7 +66437,7 @@ Function864c3: ; 864c3 ld a, [$cf64] cp $6 jr nc, .asm_864fb - ld hl, EnemyMoveEffect + ld hl, $c609 ld bc, $0010 call AddNTimes ld a, [hl] @@ -66545,7 +66542,7 @@ Function8653f: ; 8653f pop bc push bc ld a, c - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld bc, $000b call AddNTimes ld bc, $000a @@ -66701,7 +66698,7 @@ Function86692: ; 86692 ld a, [$cf64] cp $6 jr nc, .asm_866a7 - ld hl, EnemyMoveEffect + ld hl, $c609 ld bc, $0010 call AddNTimes ld a, [hl] @@ -66717,7 +66714,7 @@ Function86692: ; 86692 call WhiteBGMap pop hl call Function86748 - ld a, [EnemyMoveAnimation] + ld a, [$c608] cp 200 + 1 jr c, .asm_866c6 ld de, String_866fc @@ -66731,7 +66728,7 @@ Function86692: ; 86692 hlcoord 1, 2 call PlaceString hlcoord 2, 2 - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $0103 call PrintNum hlcoord 11, 2 @@ -66776,7 +66773,7 @@ Function8671c: ; 8671c ld a, [hl] and a jr z, .asm_86743 - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $0062 call CopyBytes call CloseSRAM @@ -79595,9 +79592,9 @@ Function8e8b1: ; 8e8b1 (23:68b1) ld a, $60 ld [hl], a ld a, c - ld [EnemyMoveAnimation], a ; $c608 (aliases: EnemyMoveStruct) + ld [$c608], a ld a, b - ld [EnemyMoveEffect], a ; $c609 + ld [$c609], a ret ; known jump sources: 8e898 (23:6898) @@ -91310,7 +91307,7 @@ Functioncc000: ; cc000 call PrintNum hlcoord 11, 10 - ld de, EnemyMonMaxHPHi + ld de, EnemyMonMaxHP call PrintNum ld hl, SwitchMonText @@ -93252,7 +93249,7 @@ Functione1190: ; e1190 xor a ld [hBGMapMode], a call DisableLCD - ld hl, EnemyMoveAnimation + ld hl, $c608 ld bc, $01e0 xor a call ByteFill @@ -96022,7 +96019,7 @@ Functione2c6e: ; e2c6e (38:6c6e) ld a, [hl] and a jr z, .asm_e2cee - ld hl, PartyMonNicknames ; $de41 (aliases: PartyMon1Nickname) + ld hl, PartyMonNicknames ; $de41 (aliases: PartyMonNicknames) ld bc, $b ld a, e call AddNTimes @@ -96485,9 +96482,9 @@ Functione2fd6: ; e2fd6 (38:6fd6) .asm_e3020 ld hl, PartySpecies ; $dcd8 call Functione3357 - ld hl, PartyMonNicknames ; $de41 (aliases: PartyMon1Nickname) + ld hl, PartyMonNicknames ; $de41 (aliases: PartyMonNicknames) call Functione3363 - ld hl, PartyMonOT ; $ddff (aliases: PartyMon1OT) + ld hl, PartyMonOT ; $ddff (aliases: PartyMonOT) call Functione3376 ld hl, PartyMons ; $dcdf (aliases: PartyMon1, PartyMon1Species) ld bc, $30 @@ -96530,7 +96527,7 @@ Functione307c: ; e307c (38:707c) ld hl, $cb2a add [hl] ld [CurPartyMon], a ; $d109 - ld hl, PartyMonNicknames ; $de41 (aliases: PartyMon1Nickname) + ld hl, PartyMonNicknames ; $de41 (aliases: PartyMonNicknames) ld a, [CurPartyMon] ; $d109 call GetNick ld a, $1 @@ -96817,14 +96814,14 @@ Functione32b0: ; e32b0 ld [CurPartyMon], a ld a, $1 call GetSRAMBank - ld hl, BoxSpecies + ld hl, sBoxSpecies call Functione3357 - ld hl, BoxMon1Nickname + ld hl, sBoxMonNicknames call Functione3363 - ld hl, BoxMon1OT + ld hl, sBoxMonOT call Functione3376 - ld hl, BoxMon1Species - ld bc, $0020 + ld hl, sBoxMons + ld bc, sBoxMon1End - sBoxMon1 call Functione3389 call CloseSRAM callba Function5088b @@ -96854,9 +96851,9 @@ Functione3316: ; e3316 ld [CurPartyMon], a ld hl, PartySpecies call Functione3357 - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call Functione3363 - ld hl, PartyMon1OT + ld hl, PartyMonOT call Functione3376 ld hl, PartyMon1Species ld bc, PartyMon2 - PartyMon1 @@ -97088,8 +97085,8 @@ Functione3619: ; e3619 ; known jump sources: e36e7 (38:76e7), e375d (38:775d), e376e (38:776e) Functione3626: ; e3626 (38:7626) - ld bc, $9 - ld hl, Box1Name ; $db75 + ld bc, 9 + ld hl, wBoxNames call AddNTimes ld d, h ld e, l @@ -97122,7 +97119,10 @@ String_e3663: ; e3663 ; e3668 String_e3668: ; e3668 - db "/20@" + db "/" + db "0" + MONS_PER_BOX / 10 + db "0" + MONS_PER_BOX % 10 + db "@" ; e366c ; known jump sources: e3717 (38:7717) @@ -101180,7 +101180,7 @@ Functionfbb32: ; fbb32 ld [de], a inc de ld a, [CurPartyMon] - ld hl, PartyMon1OT + ld hl, PartyMonOT call SkipNames call CopyBytes ld a, $3 @@ -101686,7 +101686,7 @@ Functionfcc63: ; fcc63 call Functionfcde8 call Functionfcdf4 - ld hl, PartyMon1OT + ld hl, PartyMonOT ld bc, $000b call Functionfcdd7 ld de, $c6f2 @@ -101756,7 +101756,7 @@ Functionfcc63: ; fcc63 ld de, $c70e call Functionfcdf4 - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld bc, PKMN_NAME_LENGTH call Functionfcdde ld hl, $c70e @@ -101771,7 +101771,7 @@ Functionfcc63: ; fcc63 ld de, $c719 call Functionfcdf4 - ld hl, PartyMon1OT + ld hl, PartyMonOT ld bc, $000b call Functionfcdde ld hl, $c724 @@ -104596,10 +104596,10 @@ Function1020ea: ; 1020ea bit 2, [hl] jr nz, .asm_102110 call Function10218d - ld hl, EnemyMoveAnimation + ld hl, $c608 bit 4, [hl] jr z, .asm_102110 - ld hl, EnemyMoveAnimation + ld hl, $c608 bit 2, [hl] jr nz, .asm_102110 call Function102112 @@ -104619,7 +104619,7 @@ Function102112: ; 102112 ld c, $28 .asm_10211c push hl - ld de, PlayerMoveAnimation + ld de, $c60f ld b, $1f .asm_102122 ld a, [de] @@ -104678,7 +104678,7 @@ Function102142: ; 102142 ; 102180 Function102180: ; 102180 - ld hl, EnemyMoveEffect + ld hl, $c609 ld de, StringBuffer2 ld bc, $000b call CopyBytes @@ -104687,18 +104687,18 @@ Function102180: ; 102180 Function10218d: ; 10218d ld hl, $dc00 - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $0026 ld a, $5 call FarCopyWRAM - ld de, EnemyMoveEffect + ld de, $c609 ret ; 10219f Function10219f: ; 10219f call FadeToMenu call Function10218d - ld de, EnemyMoveEffect + ld de, $c609 callba Function8ac4e call Functiona36 call PlayClickSFX @@ -104709,7 +104709,7 @@ Function10219f: ; 10219f Function1021b8: ; 1021b8 call FadeToMenu call Function10218d - ld de, PlayerMoveAnimation + ld de, $c60f callba Function8ac70 ld a, c ld [StringBuffer1], a @@ -107635,45 +107635,37 @@ DisplayUsedMoveText: ; 105db0 UsedMoveText: ; 105db9 - ; this is a stream of text and asm from 105db9 to 105ef6 -; print actor name text_jump _ActorNameText start_asm -; ???? ld a, [hBattleTurn] and a jr nz, .start -; append used move list - ld a, [PlayerMoveAnimation] + ld a, [wPlayerMoveStruct + MOVE_ANIM] call UpdateUsedMoves .start -; get address for last move - ld a, $13 ; last move + ld a, BATTLE_VARS_LAST_MOVE call _GetBattleVar ld d, h ld e, l -; get address for last counter move - ld a, $11 + ld a, BATTLE_VARS_LAST_COUNTER_MOVE call _GetBattleVar -; get move animation (id) - ld a, $c ; move animation + ld a, BATTLE_VARS_MOVE_ANIM call GetBattleVar ld [$d265], a -; check actor ???? push hl callba Function34548 pop hl jr nz, .grammar -; update last move + ; update last move ld a, [$d265] ld [hl], a ld [de], a @@ -107685,13 +107677,13 @@ UsedMoveText: ; 105db9 ; everything except 'instead' made redundant in localization -; check obedience + ; check obedience ld a, [AlreadyDisobeyed] and a ld hl, UsedMove2Text ret nz -; check move grammar + ; check move grammar ld a, [$d265] cp $3 ld hl, UsedMove2Text @@ -111529,33 +111521,33 @@ Function119451: ; 119451 (46:5451) Function119471: ; 119471 (46:5471) push af ld a, [hli] - ld [EnemyMoveAnimation], a ; $c608 (aliases: EnemyMoveStruct) + ld [$c608], a ld a, [hli] - ld [EnemyMoveType], a ; $c60b + ld [$c60b], a ld a, [hli] - ld [EnemyMoveEffect], a ; $c609 + ld [$c609], a ld a, [hli] - ld [EnemyMovePower], a ; $c60a + ld [$c60a], a ld a, [hli] - ld [EnemyMoveAccuracy], a ; $c60c + ld [$c60c], a ld a, [hli] - ld [EnemyMovePP], a ; $c60d + ld [$c60d], a ; $c60d push hl - ld a, [EnemyMoveAnimation] ; $c608 (aliases: EnemyMoveStruct) + ld a, [$c608] cp $ff jr z, .asm_1194a7 - ld a, [EnemyMovePower] ; $c60a + ld a, [$c60a] cp $ff jr z, .asm_1194a7 - ld a, [EnemyMoveEffect] ; $c609 + ld a, [$c609] cp $ff jr nz, .asm_1194a7 call Function119584 jr c, .asm_11950c jr .asm_1194f0 .asm_1194a7 - ld hl, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct) - ld de, EnemyMoveType ; $c60b + ld hl, $c608 + ld de, $c60b ld c, $3 .asm_1194af ld a, [de] @@ -111571,7 +111563,7 @@ Function119471: ; 119471 (46:5471) .asm_1194bc ld c, $3 ld hl, $cd49 - ld de, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct) + ld de, $c608 .asm_1194c4 ld a, [de] inc de @@ -111588,7 +111580,7 @@ Function119471: ; 119471 (46:5471) .asm_1194d5 ld c, $3 ld hl, $cd49 - ld de, EnemyMoveType ; $c60b + ld de, $c60b .asm_1194dd ld a, [de] inc de @@ -111609,7 +111601,7 @@ Function119471: ; 119471 (46:5471) .asm_1194f3 ld c, $3 ld hl, $cd49 - ld de, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct) + ld de, $c608 .asm_1194fb ld a, [de] inc de @@ -111628,9 +111620,9 @@ Function119471: ; 119471 (46:5471) ld a, $1 ld [$cd50], a ld a, l - ld [EnemyMoveAnimation], a ; $c608 (aliases: EnemyMoveStruct) + ld [$c608], a ld a, h - ld [EnemyMoveEffect], a ; $c609 + ld [$c609], a ld de, $cd69 ld c, $10 ld b, $0 @@ -111710,9 +111702,9 @@ Function119471: ; 119471 (46:5471) ; known jump sources: 1194a0 (46:54a0) Function119584: ; 119584 (46:5584) - ld a, [EnemyMoveAnimation] ; $c608 (aliases: EnemyMoveStruct) + ld a, [$c608] ld b, a - ld a, [EnemyMoveType] ; $c60b + ld a, [$c60b] ld c, a cp b jr c, .asm_11959c @@ -111729,9 +111721,9 @@ Function119584: ; 119584 (46:5584) cp b jr c, .asm_119595 .asm_1195a2 - ld a, [EnemyMovePower] ; $c60a + ld a, [$c60a] ld b, a - ld a, [EnemyMovePP] ; $c60d + ld a, [$c60d] ; $c60d ld c, a cp b jr c, .asm_1195ba @@ -111776,9 +111768,9 @@ Function1195c4: ; 1195c4 (46:55c4) call CopyBytes xor a ld [de], a - ld a, [EnemyMoveAnimation] ; $c608 (aliases: EnemyMoveStruct) + ld a, [$c608] ld l, a - ld a, [EnemyMoveEffect] ; $c609 + ld a, [$c609] ld h, a ld de, $cd69 ld bc, $10 @@ -111950,11 +111942,11 @@ Function119d93: ; 119d93 (46:5d93) ld a, $1 ld [rSVBK], a ; $ff00+$70 ld a, [$cd4f] - ld c, $a + ld c, 10 call SimpleMultiply ld hl, $cd50 ld [hl], a - ld bc, $30 + ld bc, PartyMon2 - PartyMon1 ld de, PartyMon1Level ; $dcfe ld a, [PartyCount] ; $dcd7 .asm_119daf @@ -111992,28 +111984,28 @@ Function119dd1: ; 119dd1 (46:5dd1) ld a, [rSVBK] ; $ff00+$70 push af ld a, [$cd4f] - cp $7 + cp 70 / 10 jr nc, .asm_119e08 ld a, $1 ld [rSVBK], a ; $ff00+$70 ld hl, PartyMon1Level ; $dcfe - ld bc, $30 + ld bc, PartyMon2 - PartyMon1 ld de, PartySpecies ; $dcd8 ld a, [PartyCount] ; $dcd7 .asm_119deb push af ld a, [de] - cp $96 + cp MEWTWO jr z, .asm_119dfd - cp $97 + cp MEW jr z, .asm_119dfd - cp $f9 + cp LUGIA jr c, .asm_119e02 - cp $fc + cp NUM_POKEMON + 1 jr nc, .asm_119e02 .asm_119dfd ld a, [hl] - cp $46 + cp 70 jr c, .asm_119e0d .asm_119e02 add hl, bc @@ -112033,7 +112025,7 @@ Function119dd1: ; 119dd1 (46:5dd1) call GetPokemonName ld hl, StringBuffer1 ; $d073 ld de, $cd49 - ld bc, $b + ld bc, PKMN_NAME_LENGTH call CopyBytes ld a, $a ld [$cf66], a @@ -112603,13 +112595,13 @@ Function11b5e8: ; 11b5e8 ld a, $0 call GetSRAMBank ld hl, $d4ba - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $0004 call CopyBytes call CloseSRAM ld a, $5 call GetSRAMBank - ld hl, EnemyMoveAnimation + ld hl, $c608 ld de, $b08c ld bc, $0004 call CopyBytes @@ -112663,7 +112655,7 @@ Function11b65a: ; 11b65a INCBIN "baserom.gbc",$11b669,$11b7e5 - $11b669 Function11b7e5: ; 11b7e5 - ld a, [EnemyMovePP] + ld a, [$c60d] ld [PlayerLightScreenCount], a ld [CurPartySpecies], a ld a, [$cd81] @@ -112674,16 +112666,16 @@ Function11b7e5: ; 11b7e5 call CopyBytes ld a, $50 ld [de], a - ld a, [PlayerMoveAccuracy] + ld a, [$c613] ld [$c731], a - ld a, [PlayerMovePP] + ld a, [$c614] ld [$c732], a ld hl, $c622 ld a, [hli] ld [$c72f], a ld a, [hl] ld [$c730], a - ld bc, EnemyMovePP + ld bc, $c60d callba GetCaughtGender ld a, c ld [$c733], a @@ -112833,7 +112825,7 @@ Function11b93b: ; 11b93b xor a ld [$a800], a ld hl, $a823 - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $008f call CopyBytes call CloseSRAM @@ -112902,7 +112894,7 @@ Function11b98f: ; 11b98f ld h, a ld bc, PartyMon2 - PartyMon1 call CopyBytes - ld hl, PartyMon1OT + ld hl, PartyMonOT ld bc, $000b ld a, [$cd2a] .asm_11b9d8 @@ -112920,7 +112912,7 @@ Function11b98f: ; 11b98f call CopyBytes ld a, $50 ld [de], a - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames ld bc, $000b ld a, [$cd2a] .asm_11b9f9 @@ -113199,7 +113191,7 @@ Function11c0c6: ; 11c0c6 .asm_11c123 sub e ld [$cf64], a - ld de, EnemyMoveAnimation + ld de, $c608 .asm_11c12a ld a, [de] cp $50 @@ -113226,7 +113218,7 @@ Function11c0c6: ; 11c0c6 Function11c14a: ; 11c14a ld c, $0 - ld hl, EnemyMoveAnimation + ld hl, $c608 .asm_11c14f ld a, [hli] cp $50 @@ -113241,7 +113233,7 @@ Function11c156: ; 11c156 ld a, $1 ld [rSVBK], a ld a, $50 - ld hl, EnemyMoveAnimation + ld hl, $c608 ld bc, $000b call ByteFill ld a, d @@ -113270,9 +113262,9 @@ Function11c156: ; 11c156 add hl, bc ld bc, $0005 .asm_11c18f - ld de, EnemyMoveAnimation + ld de, $c608 call CopyBytes - ld de, EnemyMoveAnimation + ld de, $c608 pop af ld [rSVBK], a ret @@ -116110,7 +116102,7 @@ Function170121: ; 170121 ld a, $5 call GetSRAMBank ld hl, $a948 - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $00f6 call CopyBytes call CloseSRAM @@ -116629,21 +116621,21 @@ Function170923: ; 170923 Function17093c: ; 17093c (5c:493c) xor a ld [ScriptVar], a ; $c2dd - ld a, $81 + ld a, EGG_TICKET ld [CurItem], a ; $d106 ld hl, NumItems ; $d892 (aliases: TMsHMsEnd) call CheckItem ret nc ld a, [PartyCount] ; $dcd7 - ld b, $0 + ld b, 0 ld c, a ld hl, PartySpecies ; $dcd8 .asm_170955 ld a, [hli] - cp $fd + cp EGG jr nz, .asm_17099f push hl - ld hl, PartyMonOT ; $ddff (aliases: PartyMon1OT) + ld hl, PartyMonOT ; $ddff (aliases: PartyMonOT) ld de, $6 ld a, b and a @@ -116653,7 +116645,7 @@ Function17093c: ; 17093c (5c:493c) dec a jr nz, .asm_170965 .asm_170969 - ld de, $49a4 + ld de, String_1709a4 ld a, $6 .asm_17096e push af @@ -116673,7 +116665,7 @@ Function17093c: ; 17093c (5c:493c) ld [hli], a ld [hli], a pop hl - ld a, $81 + ld a, EGG_TICKET ld [CurItem], a ; $d106 ld a, $1 ld [$d10c], a @@ -116684,6 +116676,7 @@ Function17093c: ; 17093c (5c:493c) ld a, $1 ld [ScriptVar], a ; $c2dd ret + .asm_17099d pop af pop hl @@ -116694,7 +116687,8 @@ Function17093c: ; 17093c (5c:493c) ret ; 1709a4 (5c:49a4) -INCBIN "baserom.gbc",$1709a4,$1709aa - $1709a4 +String_1709a4: ; 1709a4 + db "なぞナゾ@@" ; no known jump sources Function1709aa: ; 1709aa (5c:49aa) @@ -116814,7 +116808,7 @@ Function170b16: ; 170b16 (5c:4b16) call GetSRAMBank ld a, [$b2fb] call CloseSRAM - ld c, $a + ld c, 10 call SimpleDivide ld a, b ld [$cd4f], a @@ -117040,10 +117034,10 @@ Function171ac9: ; 171ac9 (5c:5ac9) ; no known jump sources Function171ad7: ; 171ad7 (5c:5ad7) xor a - ld hl, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct) + ld hl, $c608 ld bc, $66 call ByteFill - ld de, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct) + ld de, $c608 ld a, $c call Function3e32 jp Function171c66 @@ -117073,7 +117067,7 @@ Function171aec: ; 171aec (5c:5aec) jr nz, .asm_171b01 hlcoord 2, 7 ld a, $3 - ld de, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct) + ld de, $c608 .asm_171b1b push af push hl @@ -117675,7 +117669,7 @@ Function17d1f1: ; 17d1f1 dec a ld bc, PartyMon2 - PartyMon1 call AddNTimes - ld a, $2d + ld a, PREDEF_GET_UNOWN_LETTER call Predef callab Functionfba18 ld a, [$def4] @@ -117855,7 +117849,7 @@ Function17d370: ; 17d370 callba Function104061 call DisableLCD ld hl, $8ee0 - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $0010 call CopyBytes ld a, $1 @@ -117868,7 +117862,7 @@ Function17d370: ; 17d370 ld hl, $97f0 ld bc, $0010 call ByteFill - ld hl, EnemyMoveAnimation + ld hl, $c608 ld de, $8ee0 ld bc, $0010 call CopyBytes @@ -117931,7 +117925,7 @@ Function17d60b: ; 17d60b ld a, $5 call GetSRAMBank ld hl, $b1d3 - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $0020 call CopyBytes ld a, [$b1b1] @@ -117966,7 +117960,7 @@ Function17d60b: ; 17d60b ld [$cd49], a push hl push de - ld hl, EnemyMoveAnimation + ld hl, $c608 ld e, b ld d, $0 add hl, de @@ -118210,7 +118204,7 @@ Function17f0f8: ; 17f0f8 ld a, [$cd55] ld d, a add hl, de - ld de, EnemyMoveAnimation + ld de, $c608 ld a, [$cd56] ld c, a ld b, $0 @@ -118218,7 +118212,7 @@ Function17f0f8: ; 17f0f8 ld a, $50 ld [de], a pop hl - ld de, EnemyMoveAnimation + ld de, $c608 call PlaceString ld a, c ld [$cd52], a @@ -118310,10 +118304,10 @@ Function17f181: ; 17f181 add hl, de ld a, [hl] ld c, a - ld de, EnemyMoveAnimation + ld de, $c608 callba Function48c63 pop hl - ld de, EnemyMoveAnimation + ld de, $c608 call PlaceString ld a, c ld [$cd52], a @@ -118545,13 +118539,13 @@ Function17f2ff: ; 17f2ff ld a, $1 ld [rSVBK], a ld hl, PlayerName - ld de, EnemyMoveAnimation + ld de, $c608 ld bc, $0006 call CopyBytes ld a, $4 ld [rSVBK], a pop hl - ld de, EnemyMoveAnimation + ld de, $c608 call PlaceString ld a, c ld [$cd52], a @@ -118592,10 +118586,10 @@ Function17f334: ; 17f334 .asm_17f35d ld c, a call CloseSRAM - ld de, EnemyMoveAnimation + ld de, $c608 callba Function48c63 pop hl - ld de, EnemyMoveAnimation + ld de, $c608 call PlaceString ld a, c ld [$cd52], a @@ -118809,7 +118803,7 @@ Function17f44f: ; 17f44f ld l, a ld a, [$cd56] ld h, a - ld de, EnemyMoveAnimation + ld de, $c608 ld a, [$cd57] ld c, a ld b, $0 @@ -118827,7 +118821,7 @@ Function17f44f: ; 17f44f call GetSRAMBank .asm_17f4b7 - ld de, EnemyMoveAnimation + ld de, $c608 pop hl push hl ld a, [$cd57] @@ -119457,7 +119451,7 @@ Function1dc381: ; 1dc381 ld a, [CurPartySpecies] ld [$d265], a ld [CurSpecies], a - ld hl, PartyMon1Nickname + ld hl, PartyMonNicknames call Function1dc50e hlcoord 8, 4 call PlaceString @@ -119477,7 +119471,7 @@ Function1dc381: ; 1dc381 hlcoord 1, 9 ld de, String1dc550 call PlaceString - ld hl, PartyMon1OT + ld hl, PartyMonOT call Function1dc50e hlcoord 4, 9 call PlaceString diff --git a/wram.asm b/wram.asm index eb572b201..77108fc6b 100644 --- a/wram.asm +++ b/wram.asm @@ -1,51 +1,72 @@ INCLUDE "includes.asm" +flag_array: MACRO + ds ((\1) + 7) / 8 +ENDM -party_struct: MACRO - -\1Species:: db -\1Item:: db - -\1Moves:: ds NUM_MOVES - -\1ID:: dw -\1Exp:: ds 3 ; Big endian +box_struct_length EQU 32 +box_struct: MACRO +\1Species:: db +\1Item:: db +\1Moves:: ds NUM_MOVES +\1ID:: dw +\1Exp:: ds 3 \1StatExp:: -\1HPExp:: dw -\1AtkExp:: dw -\1DefExp:: dw -\1SpdExp:: dw -\1SpclExp:: dw - -\1DVs:: -\1AtkDefDV:: db -\1SpdSpcDV:: db - -\1PP:: ds NUM_MOVES - -\1Happiness:: db -\1PokerusStatus:: db - +\1HPExp:: dw +\1AtkExp:: dw +\1DefExp:: dw +\1SpdExp:: dw +\1SpcExp:: dw +\1DVs:: ds 2 +\1PP:: ds NUM_MOVES +\1Happiness:: db +\1PokerusStatus:: db \1CaughtData:: \1CaughtTime:: \1CaughtLevel:: db \1CaughtGender:: \1CaughtLocation:: db +\1Level:: db +\1End:: +ENDM -\1Level:: db - -\1Status:: db -\1Unused:: db - -; Stats are big endian. -\1HP:: dw -\1MaxHP:: dw -\1Attack:: dw -\1Defense:: dw -\1Speed:: dw -\1SpclAtk:: dw -\1SpclDef:: dw +party_struct: MACRO + box_struct \1 +\1Status:: db +\1Unused:: db +\1HP:: dw +\1MaxHP:: dw +\1Stats:: ; big endian +\1Attack:: dw +\1Defense:: dw +\1Speed:: dw +\1SpclAtk:: dw +\1SpclDef:: dw +\1StatsEnd:: +ENDM +battle_struct: MACRO +\1Species:: db +\1Item:: db +\1Moves:: ds NUM_MOVES +\1MovesEnd:: +\1DVs:: ds 2 +\1PP:: ds NUM_MOVES +\1Happiness:: db +\1Level:: db +\1Status:: ds 2 +\1HP:: dw +\1MaxHP:: dw +\1Stats:: ; big endian +\1Attack:: dw +\1Defense:: dw +\1Speed:: dw +\1SpclAtk:: dw +\1SpclDef:: dw +\1StatsEnd:: +\1Type:: +\1Type1:: db +\1Type2:: db ENDM @@ -422,100 +443,24 @@ Sprites:: ; c400 ; bit 4: pal # (non-cgb) ; bit 3: vram bank (cgb only) ; bit 2-0: pal # (cgb only) - ds 160 + ds 4 * 40 SpritesEnd:: TileMap:: ; c4a0 ; 20x18 grid of 8x8 tiles - ds 360 + ds SCREEN_WIDTH * SCREEN_HEIGHT TileMapEnd:: -SECTION "BattleMons",WRAM0[$c608] -EnemyMoveStruct:: -EnemyMoveAnimation:: ; c608 - ds 1 -EnemyMoveEffect:: ; c609 - ds 1 -EnemyMovePower:: ; c60a - ds 1 -EnemyMoveType:: ; c60b - ds 1 -EnemyMoveAccuracy:: ; c60c - ds 1 -EnemyMovePP:: ; c60d - ds 1 -EnemyMoveEffectChance:: ; c60e - ds 1 +wBattle:: -PlayerMoveStruct:: -PlayerMoveAnimation:: ; c60f - ds 1 -PlayerMoveEffect:: ; c610 - ds 1 -PlayerMovePower:: ; c611 - ds 1 -PlayerMoveType:: ; c612 - ds 1 -PlayerMoveAccuracy:: ; c613 - ds 1 -PlayerMovePP:: ; c614 - ds 1 -PlayerMoveEffectChance:: ; c615 - ds 1 +wEnemyMoveStruct:: ds MOVE_LENGTH ; c608 +wPlayerMoveStruct:: ds MOVE_LENGTH ; c60f -EnemyMonNick:: ; c616 - ds 11 -BattleMonNick:: ; c621 - ds 11 - - -BattleMonSpecies:: ; c62c - ds 1 -BattleMonItem:: ; c62d - ds 1 - -BattleMonMoves:: ; c62e - ds NUM_MOVES - -BattleMonDVs:: -BattleMonAtkDefDV:: ; c632 - ds 1 -BattleMonSpdSpclDV:: ; c633 - ds 1 - -BattleMonPP:: ; c634 - ds NUM_MOVES - -BattleMonHappiness:: ; c638 - ds 1 -BattleMonLevel:: ; c639 - ds 1 - -BattleMonStatus:: ; c63a - ds 2 - -BattleMonHP:: ; c63c - ds 2 -BattleMonMaxHP:: ; c63e - ds 2 - -BattleMonAtk:: ; c640 - ds 2 -BattleMonDef:: ; c642 - ds 2 -BattleMonSpd:: ; c644 - ds 2 -BattleMonSpclAtk:: ; c646 - ds 2 -BattleMonSpclDef:: ; c648 - ds 2 - -BattleMonType1:: ; c64a - ds 1 -BattleMonType2:: ; c64b - ds 1 +EnemyMonNick:: ds 11 ; c616 +BattleMonNick:: ds 11 ; c621 +BattleMon:: battle_struct BattleMon ; c62c ds 10 OTName:: ; c656 @@ -812,7 +757,10 @@ EffectFailed:: ; c70d FailedMessage:: ; c70e ds 1 - ds 3 + ds 1 + +wPlayerIsSwitching:: ds 1 ; c710 +wEnemyIsSwitching:: ds 1 ; c711 PlayerUsedMoves:: ; c712 ; add a move that has been used once by the player @@ -826,11 +774,14 @@ LastPlayerMove:: ; c71b LastEnemyMove:: ; c71c ds 1 + ds 23 -SECTION "battle",WRAM0[$c734] BattleEnded:: ; c734 ds 1 + ds 12 +wBattleEnd:: +; c741 SECTION "overworldmap",WRAM0[$c800] OverworldMap:: ; c800 @@ -868,7 +819,7 @@ AttrMap:: ; cdd9 ; read horizontally from the top row ; bit 3: vram bank ; bit 0-2: palette id - ds 360 + ds SCREEN_WIDTH * SCREEN_HEIGHT ds 30 @@ -1071,7 +1022,6 @@ CurPartyMon:: ; d109 TempMon:: party_struct TempMon -TempMonEnd:: ; d13e ds 3 @@ -1214,7 +1164,7 @@ TilesetPalettes:: ; d1e6 ds 2 EvolvableFlags:: ; d1e8 - ds 1 + flag_array PARTY_LENGTH ds 1 @@ -1229,76 +1179,13 @@ SECTION "BattleMons2",WRAMX[$d1fa],BANK[1] LinkBattleRNs:: ; d1fa ds 10 -TempEnemyMonSpecies:: ; d204 - ds 1 -TempBattleMonSpecies:: ; d205 - ds 1 - -EnemyMon:: -EnemyMonSpecies:: ; d206 - ds 1 -EnemyMonItem:: ; d207 - ds 1 - -EnemyMonMoves:: ; d208 - ds NUM_MOVES -EnemyMonMovesEnd:: - -EnemyMonDVs:: -EnemyMonAtkDefDV:: ; d20c - ds 1 -EnemyMonSpdSpclDV:: ; d20d - ds 1 - -EnemyMonPP:: ; d20e - ds NUM_MOVES - -EnemyMonHappiness:: ; d212 - ds 1 -EnemyMonLevel:: ; d213 - ds 1 - -EnemyMonStatus:: ; d214 - ds 2 - -EnemyMonHP:: -EnemyMonHPHi:: ; d216 - ds 1 -EnemyMonHPLo:: ; d217 - ds 1 - -EnemyMonMaxHP:: -EnemyMonMaxHPHi:: ; d218 - ds 1 -EnemyMonMaxHPLo:: ; d219 - ds 1 - -EnemyMonStats:: -EnemyMonAtk:: ; d21a - ds 2 -EnemyMonDef:: ; d21c - ds 2 -EnemyMonSpd:: ; d21e - ds 2 -EnemyMonSpclAtk:: ; d220 - ds 2 -EnemyMonSpclDef:: ; d222 - ds 2 -EnemyMonStatsEnd:: - -EnemyMonType1:: ; d224 - ds 1 -EnemyMonType2:: ; d225 - ds 1 - -EnemyMonBaseStats:: ; d226 - ds 5 - -EnemyMonCatchRate:: ; d22b - ds 1 -EnemyMonBaseExp:: ; d22c - ds 1 +TempEnemyMonSpecies:: ds 1 ; d204 +TempBattleMonSpecies:: ds 1 ; d205 +EnemyMon:: battle_struct EnemyMon ; d206 +EnemyMonBaseStats:: ds 5 ; d226 +EnemyMonCatchRate:: db ; d22b +EnemyMonBaseExp:: db ; d22c EnemyMonEnd:: @@ -1402,57 +1289,23 @@ SECTION "TimeOfDay",WRAMX[$d269],BANK[1] TimeOfDay:: ; d269 ds 1 + SECTION "OTParty",WRAMX[$d280],BANK[1] -OTPartyCount:: ; d280 - ds 1 ; number of Pokémon in party -OTPartySpecies:: ; d281 - ds 6 ; species of each Pokémon in party -; d287 - ds 1 ; any empty slots including the 7th must be FF - ; or the routine will keep going +OTPartyCount:: ds 1 ; d280 +OTPartySpecies:: ds 6 ; d281 +OTPartyEnd:: ds 1 -OTPartyMon1:: ; d288 - party_struct OTPartyMon1 -OTPartyMon2:: ; d2b8 - party_struct OTPartyMon2 -OTPartyMon3:: ; d2e8 - party_struct OTPartyMon3 -OTPartyMon4:: ; d318 - party_struct OTPartyMon4 -OTPartyMon5:: ; d348 - party_struct OTPartyMon5 -OTPartyMon6:: ; d378 - party_struct OTPartyMon6 +OTPartyMon1:: party_struct OTPartyMon1 ; d288 +OTPartyMon2:: party_struct OTPartyMon2 ; d2b8 +OTPartyMon3:: party_struct OTPartyMon3 ; d2e8 +OTPartyMon4:: party_struct OTPartyMon4 ; d318 +OTPartyMon5:: party_struct OTPartyMon5 ; d348 +OTPartyMon6:: party_struct OTPartyMon6 ; d378 +OTPartyMonOT:: ds 11 * 6 ; d3a8 +OTPartyMonNicknames:: ds 11 * 6 ; d3ea -OTPartyMonOT:: -OTPartyMon1OT:: ; d3a8 - ds 11 -OTPartyMon2OT:: ; d3b3 - ds 11 -OTPartyMon3OT:: ; d3be - ds 11 -OTPartyMon4OT:: ; d3c9 - ds 11 -OTPartyMon5OT:: ; d3d4 - ds 11 -OTPartyMon6OT:: ; d3df - ds 11 - -OTPartyMonNicknames:: -OTPartyMon1Nickname:: ; d3ea - ds 11 -OTPartyMon2Nickname:: ; d3f5 - ds 11 -OTPartyMon3Nickname:: ; d400 - ds 11 -OTPartyMon4Nickname:: ; d40b - ds 11 -OTPartyMon5Nickname:: ; d416 - ds 11 -OTPartyMon6Nickname:: ; d421 - ds 11 SECTION "Map Events", WRAMX[$d432], BANK[1] MapStatus:: ; d432 @@ -1789,7 +1642,7 @@ EventFlags:: ; da72 ;PoliceAtElmsLabEvent:: ; db52 ;SalesmanMahoganyTownEvent:: ; db5c ;RedGyaradosEvent:: ; db5c - ds 250 + flag_array 2000 ; db6c SECTION "Boxes",WRAMX[$db72],BANK[1] @@ -1800,35 +1653,7 @@ wCurBox:: ; db72 ds 2 ; 8 chars + $50 -wBoxNames:: -Box1Name:: ; db75 - ds 9 -Box2Name:: ; db7e - ds 9 -Box3Name:: ; db87 - ds 9 -Box4Name:: ; db90 - ds 9 -Box5Name:: ; db99 - ds 9 -Box6Name:: ; dba2 - ds 9 -Box7Name:: ; dbab - ds 9 -Box8Name:: ; dbb4 - ds 9 -Box9Name:: ; dbbd - ds 9 -Box10Name:: ; dbc6 - ds 9 -Box11Name:: ; dbcf - ds 9 -Box12Name:: ; dbd8 - ds 9 -Box13Name:: ; dbe1 - ds 9 -Box14Name:: ; dbea - ds 9 +wBoxNames:: ds 9 * NUM_BOXES ; db75 SECTION "bike", WRAMX[$dbf5],BANK[1] BikeFlags:: ; dbf5 @@ -1867,7 +1692,7 @@ PoisonStepCount:: ; dc74 SECTION "Visited Spawn Points", WRAMX[$dca5],BANK[1] VisitedSpawns:: ; dca5 - ds 4 + flag_array 27 SECTION "BackupMapInfo", WRAMX[$dcad],BANK[1] @@ -1901,155 +1726,87 @@ PartyEnd:: ; dcde ds 1 ; legacy functions don't check PartyCount PartyMons:: -PartyMon1:: ; dcdf - party_struct PartyMon1 -PartyMon2:: ; dd0f - party_struct PartyMon2 -PartyMon3:: ; dd3f - party_struct PartyMon3 -PartyMon4:: ; dd6f - party_struct PartyMon4 -PartyMon5:: ; dd9f - party_struct PartyMon5 -PartyMon6:: ; ddcf - party_struct PartyMon6 +PartyMon1:: party_struct PartyMon1 ; dcdf +PartyMon2:: party_struct PartyMon2 ; dd0f +PartyMon3:: party_struct PartyMon3 ; dd3f +PartyMon4:: party_struct PartyMon4 ; dd6f +PartyMon5:: party_struct PartyMon5 ; dd9f +PartyMon6:: party_struct PartyMon6 ; ddcf -PartyMonOT:: -PartyMon1OT:: ; ddff - ds 11 -PartyMon2OT:: ; de0a - ds 11 -PartyMon3OT:: ; de15 - ds 11 -PartyMon4OT:: ; de20 - ds 11 -PartyMon5OT:: ; de2b - ds 11 -PartyMon6OT:: ; de36 - ds 11 +PartyMonOT:: ds 11 * 6 ; ddff -PartyMonNicknames:: -PartyMon1Nickname:: ; de41 - ds 11 -PartyMon2Nickname:: ; de4c - ds 11 -PartyMon3Nickname:: ; de57 - ds 11 -PartyMon4Nickname:: ; de62 - ds 11 -PartyMon5Nickname:: ; de6d - ds 11 -PartyMon6Nickname:: ; de78 - ds 11 +PartyMonNicknames:: ds 11 * 6 ; de41 PartyMonNicknamesEnd:: -SECTION "Pokedex",WRAMX[$de99],BANK[1] + +SECTION "Pokedex", WRAMX[$de99], BANK[1] + PokedexCaught:: ; de99 - ds 32 + flag_array 251 EndPokedexCaught:: + PokedexSeen:: ; deb9 - ds 32 + flag_array 251 EndPokedexSeen:: + UnownDex:: ; ded9 ds 26 UnlockedUnowns:: ; def3 ds 1 -SECTION "Breeding",WRAMX[$def5],BANK[1] -DaycareMan:: ; def5 + ds 1 + +wDaycareMan:: ; def5 ; bit 7: active ; bit 6: monsters are compatible ; bit 5: egg ready ; bit 0: monster 1 in daycare ds 1 -BreedMon1:: -BreedMon1Nick:: ; def6 - ds 11 -BreedMon1OT:: ; df01 - ds 11 -BreedMon1Stats:: -BreedMon1Species:: ; df0c - ds 1 - ds 31 +wBreedMon1:: +wBreedMon1Nick:: ds PKMN_NAME_LENGTH ; def6 +wBreedMon1OT:: ds NAME_LENGTH ; df01 +wBreedMon1Stats:: box_struct wBreedMon1 ; df0c -DaycareLady:: ; df2c +wDaycareLady:: ; df2c ; bit 7: active ; bit 0: monster 2 in daycare ds 1 -StepsToEgg:: ; df2d +wStepsToEgg:: ; df2d ds 1 -DittoInDaycare:: ; df2e +wDittoInDaycare:: ; df2e ; z: yes ; nz: no ds 1 -BreedMon2:: -BreedMon2Nick:: ; df2f - ds 11 -BreedMon2OT:: ; df3a - ds 11 -BreedMon2Stats:: -BreedMon2Species:: ; df45 - ds 1 - ds 31 +wBreedMon2:: +wBreedMon2Nick:: ds PKMN_NAME_LENGTH ; df2f +wBreedMon2OT:: ds NAME_LENGTH ; df3a +wBreedMon2Stats:: box_struct wBreedMon2 ; df45 -EggNick:: ; df65 -; EGG@ - ds 11 -EggOT:: ; df70 - ds 11 -EggMon:: -EggSpecies:: ; df7b - ds 1 - ds 31 +wEggNick:: ds PKMN_NAME_LENGTH ; df65 +wEggOT:: ds NAME_LENGTH ; df70 +wEggMon:: box_struct wEggMon ; df7b ds 1 -wContestMon:: ; df9c - party_struct wContestMon +wContestMon:: party_struct wContestMon ; df9c ds 3 -RoamMon1Species:: ; dfcf - ds 1 -RoamMon1Level:: ; dfd0 - ds 1 -RoamMon1MapGroup:: ; dfd1 - ds 1 -RoamMon1MapNumber:: ; dfd2 - ds 1 -RoamMon1HP:: ; dfd3 - ds 1 -RoamMon1DVs:: ; dfd4 - ds 2 +roam_struct: MACRO +\1Species:: db +\1Level:: db +\1MapGroup:: db +\1MapNumber:: db +\1HP:: ds 1 +\1DVs:: ds 2 +ENDM -RoamMon2Species:: ; dfd6 - ds 1 -RoamMon2Level:: ; dfd7 - ds 1 -RoamMon2MapGroup:: ; dfd8 - ds 1 -RoamMon2MapNumber:: ; dfd9 - ds 1 -RoamMon2HP:: ; dfda - ds 1 -RoamMon2DVs:: ; dfdb - ds 2 - -RoamMon3Species:: ; dfdd - ds 1 -RoamMon3Level:: ; dfde - ds 1 -RoamMon3MapGroup:: ; dfdf - ds 1 -RoamMon3MapNumber:: ; dfe0 - ds 1 -RoamMon3HP:: ; dfe1 - ds 1 -RoamMon3DVs:: ; dfe2 - ds 2 +wRoamMon1:: roam_struct wRoamMon1 ; dfcf +wRoamMon2:: roam_struct wRoamMon2 ; dfd6 +wRoamMon3:: roam_struct wRoamMon3 ; dfdd @@ -2107,175 +1864,24 @@ BattleAnimTemps:: ; d419 ds 8 -SECTION "SRAMBank1",SRAM,BANK[1] +SECTION "Scratch", SRAM, BANK[0] -SECTION "BoxMons",SRAM[$ad10],BANK[1] -BoxCount:: ; ad10 - ds 1 -BoxSpecies:: ; ad11 - ds 20 - ds 1 -BoxMons:: -BoxMon1:: -BoxMon1Species:: ; ad26 - ds 1 -BoxMon1Item:: ; ad27 - ds 1 -BoxMon1Moves:: ; ad28 - ds 4 -BoxMon1ID:: ; ad2c - ds 2 -BoxMon1Exp:: ; ad2e - ds 3 -BoxMon1HPExp:: ; ad31 - ds 2 -BoxMon1AtkExp:: ; ad33 - ds 2 -BoxMon1DefExp:: ; ad35 - ds 2 -BoxMon1SpdExp:: ; ad37 - ds 2 -BoxMon1SpcExp:: ; ad39 - ds 2 -BoxMon1DVs:: ; ad3b - ds 2 -BoxMon1PP:: ; ad3d - ds 4 -BoxMon1Happiness:: ; ad41 - ds 1 -BoxMon1PokerusStatus:: ; ad42 - ds 1 -BoxMon1CaughtData:: -BoxMon1CaughtTime:: -BoxMon1CaughtLevel:: ; ad43 - ds 1 -BoxMon1CaughtGender:: -BoxMon1CaughtLocation:: ; ad44 - ds 1 -BoxMon1Level:: ; ad45 + +SECTION "SRAM Bank 1", SRAM, BANK[1] + +SECTION "BoxMons", SRAM[$ad10], BANK[1] + +sBoxCount:: ds 1 ; ad10 +sBoxSpecies:: ds MONS_PER_BOX ; ad11 ds 1 -BoxMon2:: ; ad46 - ds 32 -BoxMon3:: ; ad66 - ds 32 -BoxMon4:: ; ad86 - ds 32 -BoxMon5:: ; ada6 - ds 32 -BoxMon6:: ; adc6 - ds 32 -BoxMon7:: ; ade6 - ds 32 -BoxMon8:: ; ae06 - ds 32 -BoxMon9:: ; ae26 - ds 32 -BoxMon10:: ; ae46 - ds 32 -BoxMon11:: ; ae66 - ds 32 -BoxMon12:: ; ae86 - ds 32 -BoxMon13:: ; aea6 - ds 32 -BoxMon14:: ; aec6 - ds 32 -BoxMon15:: ; aee6 - ds 32 -BoxMon16:: ; af06 - ds 32 -BoxMon17:: ; af26 - ds 32 -BoxMon18:: ; af46 - ds 32 -BoxMon19:: ; af66 - ds 32 -BoxMon20:: ; af86 - ds 32 +sBoxMons:: ; ad26 +sBoxMon1:: box_struct sBoxMon1 +sBoxMon2:: + ds box_struct_length * (MONS_PER_BOX +- 1) -BoxMonOT:: -BoxMon1OT:: ; afa6 - ds 11 -BoxMon2OT:: ; afb1 - ds 11 -BoxMon3OT:: ; afbc - ds 11 -BoxMon4OT:: ; afc7 - ds 11 -BoxMon5OT:: ; afd2 - ds 11 -BoxMon6OT:: ; afdd - ds 11 -BoxMon7OT:: ; afe8 - ds 11 -BoxMon8OT:: ; aff3 - ds 11 -BoxMon9OT:: ; affe - ds 11 -BoxMon10OT:: ; b009 - ds 11 -BoxMon11OT:: ; b014 - ds 11 -BoxMon12OT:: ; b01f - ds 11 -BoxMon13OT:: ; b02a - ds 11 -BoxMon14OT:: ; b035 - ds 11 -BoxMon15OT:: ; b040 - ds 11 -BoxMon16OT:: ; b04b - ds 11 -BoxMon17OT:: ; b056 - ds 11 -BoxMon18OT:: ; b061 - ds 11 -BoxMon19OT:: ; b06c - ds 11 -BoxMon20OT:: ; b077 - ds 11 - -BoxMonNicknames:: -BoxMon1Nickname:: ; b082 - ds 11 -BoxMon2Nickname:: ; b08d - ds 11 -BoxMon3Nickname:: ; b098 - ds 11 -BoxMon4Nickname:: ; b0a3 - ds 11 -BoxMon5Nickname:: ; b0ae - ds 11 -BoxMon6Nickname:: ; b0b9 - ds 11 -BoxMon7Nickname:: ; b0c4 - ds 11 -BoxMon8Nickname:: ; b0cf - ds 11 -BoxMon9Nickname:: ; b0da - ds 11 -BoxMon10Nickname:: ; b0e5 - ds 11 -BoxMon11Nickname:: ; b0f0 - ds 11 -BoxMon12Nickname:: ; b0fb - ds 11 -BoxMon13Nickname:: ; b106 - ds 11 -BoxMon14Nickname:: ; b111 - ds 11 -BoxMon15Nickname:: ; b11c - ds 11 -BoxMon16Nickname:: ; b127 - ds 11 -BoxMon17Nickname:: ; b132 - ds 11 -BoxMon18Nickname:: ; b13d - ds 11 -BoxMon19Nickname:: ; b148 - ds 11 -BoxMon20Nickname:: ; b153 - ds 11 -BoxMonNicknamesEnd:: +sBoxMonOT:: ds 11 * 20 ; afa6 +sBoxMonNicknames:: ds 11 * 20 ; b082 +sBoxMonNicknamesEnd:: +; b15e