diff --git a/.gitmodules b/.gitmodules index 1f76b5370..e5177ea1e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "extras"] path = extras - url = git://github.com/kanzure/pokemon-reverse-engineering-tools.git + url = git://github.com/pret/pokemon-reverse-engineering-tools.git diff --git a/battle/ai/items.asm b/battle/ai/items.asm index 7d847b9da..95997a67e 100644 --- a/battle/ai/items.asm +++ b/battle/ai/items.asm @@ -1,11 +1,11 @@ AI_SwitchOrTryItem: ; 38000 and a - ld a, [IsInBattle] + ld a, [wBattleMode] dec a ret z - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ret nz @@ -731,7 +731,7 @@ AI_Switch: ; 3846c callba Function3d57a xor a ld [wd264], a - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ret nz scf diff --git a/battle/anim_commands.asm b/battle/anim_commands.asm index 80b9bf41d..82d5eab62 100644 --- a/battle/anim_commands.asm +++ b/battle/anim_commands.asm @@ -237,16 +237,16 @@ Functioncc220: ; cc220 ; Appears to be unused. xor a ld [hBGMapMode], a - ld a, $80 + ld a, (VBGMap0 tile $28) % $100 ld [hBGMapAddress], a - ld a, $9a + ld a, (VBGMap0 tile $28) / $100 ld [hBGMapAddress + 1], a call Function3200 ld a, $60 ld [hWY], a xor a ld [hBGMapAddress], a - ld a, $98 + ld a, VBGMap0 / $100 ld [hBGMapAddress + 1], a call BattleAnimDelayFrame ret @@ -709,7 +709,7 @@ BattleAnimCmd_D5: ; cc485 (33:4485) rept 4 add hl, hl endr - ld de, $8310 + ld de, VTiles0 tile $31 add hl, de ld a, [BattleAnimByte] call Functionce846 @@ -817,13 +817,13 @@ endr ld a, $49 ld [hl], a - ld hl, $8730 - ld de, $9060 + ld hl, VTiles0 tile $73 + ld de, VTiles2 tile $06 ld a, $70 ld [BattleAnimTemps], a ld a, $7 call Functioncc561 - ld de, $9310 + ld de, VTiles2 tile $31 ld a, $60 ld [BattleAnimTemps], a ld a, $6 @@ -873,13 +873,13 @@ endr ld a, $43 ld [hl], a - ld hl, $8660 - ld de, $9050 + ld hl, VTiles0 tile $66 + ld de, VTiles2 tile $05 ld a, $70 ld [BattleAnimTemps], a ld a, $7 call Functioncc5b3 - ld de, $9310 + ld de, VTiles2 tile $31 ld a, $60 ld [BattleAnimTemps], a ld a, $6 @@ -932,7 +932,7 @@ BattleAnimCmd_DC: ; cc5dc (33:45dc) ld [CurPartySpecies], a ; CurPartySpecies ld hl, BattleMonDVs ; BattleMonDVs predef GetUnownLetter - ld de, $8000 + ld de, VTiles0 tile $00 predef GetFrontpic jr .done @@ -941,7 +941,7 @@ BattleAnimCmd_DC: ; cc5dc (33:45dc) ld [CurPartySpecies], a ; CurPartySpecies ld hl, EnemyMonDVs ; EnemyMonDVs predef GetUnownLetter - ld de, $8000 + ld de, VTiles0 tile $00 predef GetBackpic .done @@ -953,19 +953,19 @@ BattleAnimCmd_DC: ; cc5dc (33:45dc) BattleAnimCmd_E8: ; cc622 (33:4622) - ld de, $8000 + ld de, VTiles0 tile $00 ld a, [hBattleTurn] ; $ff00+$e4 and a jr z, .player - ld hl, $9000 + ld hl, VTiles2 tile $00 ld b, 0 ld c, $31 call Request2bpp ret .player - ld hl, $9310 + ld hl, VTiles2 tile $31 ld b, 0 ld c, $24 call Request2bpp @@ -1009,7 +1009,7 @@ GetSubstitutePic: ; cc64c ld de, sScratch + $1b0 call CopyMonsterSpriteTile - ld hl, $9000 + ld hl, VTiles2 tile $00 ld de, sScratch lb bc, BANK(GetSubstitutePic), 7 * 7 call Request2bpp @@ -1029,7 +1029,7 @@ GetSubstitutePic: ; cc64c ld de, sScratch + $170 call CopyMonsterSpriteTile - ld hl, $9310 + ld hl, VTiles2 tile $31 ld de, sScratch lb bc, BANK(GetSubstitutePic), 6 * 6 call Request2bpp @@ -1077,7 +1077,7 @@ GetMinimizePic: ; cc6e7 (33:46e7) ld de, sScratch + $1a0 call CopyMinimizePic - ld hl, $9000 + ld hl, VTiles2 tile $00 ld de, sScratch lb bc, BANK(GetMinimizePic), $31 ret @@ -1085,7 +1085,7 @@ GetMinimizePic: ; cc6e7 (33:46e7) .player ld de, sScratch + $160 call CopyMinimizePic - ld hl, $9310 + ld hl, VTiles2 tile $31 ld de, sScratch lb bc, BANK(GetMinimizePic), $24 ret @@ -1110,7 +1110,7 @@ BattleAnimCmd_E9: ; cc735 (33:4735) xor a call GetSRAMBank call GetMinimizePic - ld hl, $8000 + ld hl, VTiles0 tile $00 call Request2bpp call CloseSRAM pop af @@ -1159,14 +1159,14 @@ BattleAnimCmd_E6: ; cc776 (33:4776) ld hl, BattleMonDVs ; BattleMonDVs predef GetUnownLetter - ld de, $9000 + ld de, VTiles2 tile $00 predef GetFrontpic jr .done .player ld hl, EnemyMonDVs ; EnemyMonDVs predef GetUnownLetter - ld de, $9310 + ld de, VTiles2 tile $31 predef GetBackpic .done diff --git a/battle/core.asm b/battle/core.asm index 5f355fc27..6fc9a6f49 100644 --- a/battle/core.asm +++ b/battle/core.asm @@ -25,7 +25,7 @@ Function3c000: ; 3c000 .asm_3c021 ld a, d ld [wBattleAction], a - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr z, .asm_3c031 @@ -34,7 +34,7 @@ Function3c000: ; 3c000 jr z, .asm_3c04c .asm_3c031 - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr z, .asm_3c047 xor a @@ -97,7 +97,7 @@ Function3c000: ; 3c000 call Function309d call SetPlayerTurn call SpikesDamage - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr z, .asm_3c0df ld a, [$ffcb] @@ -123,18 +123,18 @@ Function3c000: ; 3c000 WildFled_EnemyFled_LinkBattleCanceled: ; 3c0e5 call Function30b4 - ld a, [wd0ee] + ld a, [wBattleResult] and $c0 add $2 - ld [wd0ee], a - ld a, [InLinkBattle] + ld [wBattleResult], a + ld a, [wLinkMode] and a ld hl, BattleText_WildFled jr z, .asm_3c115 - ld a, [wd0ee] + ld a, [wBattleResult] and $c0 - ld [wd0ee], a + ld [wBattleResult], a ld hl, BattleText_EnemyFled call Function3d2e0 jr nc, .asm_3c115 @@ -149,7 +149,7 @@ WildFled_EnemyFled_LinkBattleCanceled: ; 3c0e5 call StdBattleTextBox .asm_3c118 - call Function3ceec + call StopDangerSound call Function3d2e0 jr c, .asm_3c126 @@ -264,40 +264,40 @@ Function3c1c0: ; 3c1c0 Function3c1d6: ; 3c1d6 ld a, [$ffcb] cp $1 - jr z, .asm_3c1fe - call Function3c23c + jr z, .CheckEnemyFirst + call CheckFaint_PlayerThenEnemy ret c call Function3ca26 - call Function3c23c + call CheckFaint_PlayerThenEnemy ret c call HandleWeather - call Function3c23c + call CheckFaint_PlayerThenEnemy ret c call Function3c874 - call Function3c23c + call CheckFaint_PlayerThenEnemy ret c call Function3c801 - call Function3c23c + call CheckFaint_PlayerThenEnemy ret c - jr .asm_3c21e + jr .NoMoreFaintingConditions -.asm_3c1fe - call Function3c25c +.CheckEnemyFirst + call CheckFaint_EnemyThenPlayer ret c call Function3ca26 - call Function3c25c + call CheckFaint_EnemyThenPlayer ret c call HandleWeather - call Function3c25c + call CheckFaint_EnemyThenPlayer ret c call Function3c874 - call Function3c25c + call CheckFaint_EnemyThenPlayer ret c call Function3c801 - call Function3c25c + call CheckFaint_EnemyThenPlayer ret c -.asm_3c21e +.NoMoreFaintingConditions call Function3c8eb call Function3c93c call HanleDefrost @@ -310,52 +310,52 @@ Function3c1d6: ; 3c1d6 jp Function3c4df ; 3c23c -Function3c23c: ; 3c23c +CheckFaint_PlayerThenEnemy: ; 3c23c call HasPlayerFainted - jr nz, .asm_3c24a - call Function3d14e + jr nz, .PlayerNotFainted + call HandlePlayerMonFaint ld a, [BattleEnded] and a - jr nz, .asm_3c25a + jr nz, .BattleIsOver -.asm_3c24a +.PlayerNotFainted call HasEnemyFainted - jr nz, .asm_3c258 - call Function3cd55 + jr nz, .BattleContinues + call HandleEnemyMonFaint ld a, [BattleEnded] and a - jr nz, .asm_3c25a + jr nz, .BattleIsOver -.asm_3c258 +.BattleContinues and a ret -.asm_3c25a +.BattleIsOver scf ret ; 3c25c -Function3c25c: ; 3c25c +CheckFaint_EnemyThenPlayer: ; 3c25c call HasEnemyFainted - jr nz, .asm_3c26a - call Function3cd55 + jr nz, .EnemyNotFainted + call HandleEnemyMonFaint ld a, [BattleEnded] and a - jr nz, .asm_3c27a + jr nz, .BattleIsOver -.asm_3c26a +.EnemyNotFainted call HasPlayerFainted - jr nz, .asm_3c278 - call Function3d14e + jr nz, .BattleContinues + call HandlePlayerMonFaint ld a, [BattleEnded] and a - jr nz, .asm_3c27a + jr nz, .BattleIsOver -.asm_3c278 +.BattleContinues and a ret -.asm_3c27a +.BattleIsOver scf ret ; 3c27c @@ -438,7 +438,7 @@ Function3c27c: ; 3c27c ; 3c300 Function3c300: ; 3c300 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr z, .asm_3c30d ld a, [wBattleAction] @@ -456,7 +456,7 @@ Function3c300: ; 3c300 ; 3c314 Function3c314: ; 3c314 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr z, .asm_3c35b ld a, [wBattleAction] @@ -584,10 +584,10 @@ Function3c3f5: ; 3c3f5 ld a, [wdc79] and a jr nz, .asm_3c40e - ld a, [wd0ee] + ld a, [wBattleResult] and $c0 add $2 - ld [wd0ee], a + ld [wBattleResult], a scf ret @@ -778,7 +778,7 @@ Function3c4df: ; 3c4df Function3c543: ; 3c543 - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr nz, .Stay @@ -952,14 +952,14 @@ Function3c5fe: ; 3c5fe and a ret nz call HasPlayerFainted - jp z, Function3d14e + jp z, HandlePlayerMonFaint call HasEnemyFainted - jp z, Function3cd55 + jp z, HandleEnemyMonFaint .asm_3c62f call SetEnemyTurn call ResidualDamage - jp z, Function3cd55 + jp z, HandleEnemyMonFaint call RefreshBattleHuds call Function3c6cf call Function3d2e0 @@ -968,12 +968,12 @@ Function3c5fe: ; 3c5fe and a ret nz call HasEnemyFainted - jp z, Function3cd55 + jp z, HandleEnemyMonFaint call HasPlayerFainted - jp z, Function3d14e + jp z, HandlePlayerMonFaint call SetPlayerTurn call ResidualDamage - jp z, Function3d14e + jp z, HandlePlayerMonFaint call RefreshBattleHuds xor a ld [wd0ec], a @@ -994,14 +994,14 @@ Function3c664: ; 3c664 call Function3d2e0 ret c call HasEnemyFainted - jp z, Function3cd55 + jp z, HandleEnemyMonFaint call HasPlayerFainted - jp z, Function3d14e + jp z, HandlePlayerMonFaint push bc call SetPlayerTurn call ResidualDamage pop bc - jp z, Function3d14e + jp z, HandlePlayerMonFaint push bc call RefreshBattleHuds pop af @@ -1016,14 +1016,14 @@ Function3c664: ; 3c664 and a ret nz call HasPlayerFainted - jp z, Function3d14e + jp z, HandlePlayerMonFaint call HasEnemyFainted - jp z, Function3cd55 + jp z, HandleEnemyMonFaint .asm_3c6be call SetEnemyTurn call ResidualDamage - jp z, Function3cd55 + jp z, HandleEnemyMonFaint call RefreshBattleHuds xor a ld [wd0ec], a @@ -1272,7 +1272,7 @@ Function3c801: ; 3c801 xor a ld [hli], a ld [hl], a - ld a, [IsInBattle] + ld a, [wBattleMode] dec a ret z ld hl, OTPartyMon1HP @@ -1429,7 +1429,7 @@ Function3c93c: ; 3c93c jr z, .asm_3c99b ld de, wc739 ld hl, wc735 - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr z, .asm_3c99b ld hl, OTPartyMon1PP @@ -1518,7 +1518,7 @@ Function3c93c: ; 3c93c ld a, [hBattleTurn] and a jr z, .asm_3ca12 - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr z, .asm_3ca14 call Function3df1f @@ -1637,7 +1637,7 @@ HanleDefrost: ; 3ca8f xor a ld [EnemyMonStatus], a - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr z, .asm_3caef ld a, [CurOTMon] @@ -2095,12 +2095,12 @@ Function3cd3c: ; 3cd3c ret ; 3cd55 -Function3cd55: ; 3cd55 - call Function3cf14 +HandleEnemyMonFaint: ; 3cd55 + call FaintEnemyPokemon ld hl, BattleMonHP ld a, [hli] or [hl] - call z, Function3cef1 + call z, FaintYourPokemon xor a ld [wc6f7], a call Function3ce01 @@ -2119,17 +2119,17 @@ Function3cd55: ; 3cd55 ld c, 60 call DelayFrames - ld a, [IsInBattle] + ld a, [wBattleMode] dec a - jr nz, .asm_3cd8c + jr nz, .trainer ld a, 1 ld [BattleEnded], a ret -.asm_3cd8c - call Function3cf35 - jp z, Function3cfa4 +.trainer + call CheckEnemyTrainerDefeated + jp z, WinTrainerBattle ld hl, BattleMonHP ld a, [hli] @@ -2196,7 +2196,7 @@ Function3cdca: ; 3cdca Function3ce01: ; 3ce01 call UpdateBattleMonInParty - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr z, .asm_3ce16 ld a, [CurOTMon] @@ -2215,13 +2215,13 @@ Function3ce01: ; 3ce01 ld [hl], a call NewEnemyMonStatus call BreakAttraction - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr z, .asm_3ce2f jr .asm_3ce37 .asm_3ce2f - call Function3ceec + call StopDangerSound ld a, $1 ld [wc6fd], a @@ -2240,14 +2240,14 @@ Function3ce01: ; 3ce01 ld a, d and a ret z - ld a, [IsInBattle] + ld a, [wBattleMode] dec a call z, Function3d0ea call EmptyBattleTextBox call Function309d - ld a, [wd0ee] + ld a, [wBattleResult] and $c0 - ld [wd0ee], a + ld [wBattleResult], a call Function3ceaa jr z, .asm_3ce72 ld hl, EnemyMonBaseStats @@ -2342,20 +2342,20 @@ Function3ceaa: ; 3ceaa -Function3ceec: ; 3ceec +StopDangerSound: ; 3ceec xor a ld [Danger], a ret ; 3cef1 -Function3cef1: ; 3cef1 - call Function3ceec +FaintYourPokemon: ; 3cef1 + call StopDangerSound call WaitSFX ld a, $f0 ld [CryTracks], a ld a, [BattleMonSpecies] call PlayStereoCry - call Function3d43b + call PlayerMonFaintedAnimation hlcoord 9, 7 lb bc, 5, 11 call ClearBox @@ -2363,11 +2363,11 @@ Function3cef1: ; 3cef1 jp StdBattleTextBox ; 3cf14 -Function3cf14: ; 3cf14 +FaintEnemyPokemon: ; 3cf14 call WaitSFX ld de, SFX_KINESIS call PlaySFX - call Function3d432 + call EnemyMonFaintedAnimation ld de, SFX_FAINT call PlaySFX hlcoord 1, 0 @@ -2377,20 +2377,22 @@ Function3cf14: ; 3cf14 jp StdBattleTextBox ; 3cf35 -Function3cf35: ; 3cf35 +CheckEnemyTrainerDefeated: ; 3cf35 ld a, [OTPartyCount] ld b, a xor a ld hl, OTPartyMon1HP ld de, PartyMon2 - PartyMon1 -.asm_3cf40 + +.loop or [hl] inc hl or [hl] dec hl add hl, de dec b - jr nz, .asm_3cf40 + jr nz, .loop + and a ret ; 3cf4a @@ -2401,7 +2403,7 @@ Function3cf4a: ; 3cf4a call Function3e12e call WaitBGMap callba Function2c012 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr z, .asm_3cf6d call Function3e8e4 @@ -2447,12 +2449,12 @@ EnemyPartyMonEntrance: ; 3cf78 ret ; 3cfa4 -Function3cfa4: ; 3cfa4 - call Function3ceec +WinTrainerBattle: ; 3cfa4 + call StopDangerSound ld a, $1 ld [wc6fd], a ld [BattleEnded], a - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ld a, b call z, Function3d0ea @@ -2461,7 +2463,7 @@ Function3cfa4: ; 3cfa4 call StdBattleTextBox call IsMobileBattle jr z, .asm_3cff5 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ret nz @@ -2631,7 +2633,7 @@ Function3d0be: ; 3d0be push bc ld b, h ld c, l - callba Function106008 + callba MobileFn_106008 pop bc pop hl .asm_3d0ce @@ -2664,7 +2666,7 @@ Function3d0ea: ; 3d0ea call PlayMusic call DelayFrame ld de, MUSIC_WILD_VICTORY - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr nz, .asm_3d113 push de @@ -2747,15 +2749,15 @@ KantoGymLeaders: db SABRINA db BLAINE db BLUE - db $ff + db -1 -Function3d14e: ; 3d14e - call Function3cef1 +HandlePlayerMonFaint: ; 3d14e + call FaintYourPokemon ld hl, EnemyMonHP ld a, [hli] or [hl] - call z, Function3cf14 + call z, FaintEnemyPokemon ld a, $1 ld [wc6f7], a call Function3d1aa @@ -2766,20 +2768,20 @@ Function3d14e: ; 3d14e ld hl, EnemyMonHP ld a, [hli] or [hl] - jr nz, .asm_3d185 + jr nz, .notfainted call Function3ce01 - ld a, [IsInBattle] + ld a, [wBattleMode] dec a - jr nz, .asm_3d17f + jr nz, .trainer ld a, $1 ld [BattleEnded], a ret -.asm_3d17f - call Function3cf35 - jp z, Function3cfa4 +.trainer + call CheckEnemyTrainerDefeated + jp z, WinTrainerBattle -.asm_3d185 +.notfainted call Function3d1f8 jr nc, .asm_3d190 ld a, $1 @@ -2829,10 +2831,10 @@ Function3d1aa: ; 3d1aa ld a, [CurBattleMon] ld [CurPartyMon], a callab ChangeHappiness - ld a, [wd0ee] + ld a, [wBattleResult] and %11000000 add $1 - ld [wd0ee], a + ld [wBattleResult], a ld a, [wc6f7] and a ret z @@ -2842,7 +2844,7 @@ Function3d1aa: ; 3d1aa Function3d1f8: ; 3d1f8 call EmptyBattleTextBox call Function309d - ld a, [IsInBattle] + ld a, [wBattleMode] and a dec a ret nz @@ -2870,7 +2872,7 @@ Function3d227: ; 3d227 call Function1d6e call Function3d2f7 call ForcePickPartyMonInBattle - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr z, .asm_3d241 ld a, $1 @@ -2949,8 +2951,8 @@ Function3d2b3: ; 3d2b3 Function3d2e0: ; 3d2e0 - ld a, [InLinkBattle] - cp $4 + ld a, [wLinkMode] + cp LINK_MOBILE jr nz, .asm_3d2ef ; It's not a mobile battle ld a, [wcd2b] @@ -2967,8 +2969,8 @@ Function3d2e0: ; 3d2e0 ; 3d2f1 IsMobileBattle: ; 3d2f1 - ld a, [InLinkBattle] - cp $4 + ld a, [wLinkMode] + cp LINK_MOBILE ret ; 3d2f7 @@ -3086,7 +3088,7 @@ LostBattle: ; 3d38e ; Remove the enemy from the screen. hlcoord 0, 0 - ld bc, $0815 + lb bc, 8, 21 call ClearBox call Function3ebd8 @@ -3103,7 +3105,7 @@ LostBattle: ; 3d38e .asm_3d3bd ; Remove the enemy from the screen. hlcoord 0, 0 - ld bc, $0815 + lb bc, 8, 21 call ClearBox call Function3ebd8 @@ -3119,7 +3121,7 @@ LostBattle: ; 3d38e ret .asm_3d3e3 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .LostLinkBattle @@ -3131,13 +3133,13 @@ LostBattle: ; 3d38e .LostLinkBattle call UpdateEnemyMonInParty - call Function3cf35 + call CheckEnemyTrainerDefeated jr nz, .asm_3d40a ld hl, TiedAgainstText - ld a, [wd0ee] + ld a, [wBattleResult] and $c0 add 2 - ld [wd0ee], a + ld [wBattleResult], a jr .text .asm_3d40a @@ -3155,7 +3157,7 @@ LostBattle: ; 3d38e .asm_3d417 ; Remove the enemy from the screen. hlcoord 0, 0 - ld bc, $0815 + lb bc, 8, 21 call ClearBox call Function3ebd8 @@ -3169,38 +3171,40 @@ LostBattle: ; 3d38e ; 3d432 -Function3d432: ; 3d432 +EnemyMonFaintedAnimation: ; 3d432 hlcoord 12, 5 decoord 12, 6 - jp Function3d444 + jp MonFaintedAnimation ; 3d43b -Function3d43b: ; 3d43b +PlayerMonFaintedAnimation: ; 3d43b hlcoord 1, 10 decoord 1, 11 - jp Function3d444 + jp MonFaintedAnimation ; 3d444 -Function3d444: ; 3d444 +MonFaintedAnimation: ; 3d444 ld a, [wcfbe] push af set 6, a ld [wcfbe], a - ld b, $7 -.asm_3d44f + ld b, 7 + +.OuterLoop push bc push de push hl - ld b, $6 -.asm_3d454 + ld b, 6 + +.InnerLoop push bc push hl push de - ld bc, $0007 + ld bc, 7 call CopyBytes pop de pop hl - ld bc, -20 + ld bc, -SCREEN_WIDTH add hl, bc push hl ld h, d @@ -3211,7 +3215,8 @@ Function3d444: ; 3d444 pop hl pop bc dec b - jr nz, .asm_3d454 + jr nz, .InnerLoop + ld bc, 20 add hl, bc ld de, .Spaces @@ -3222,7 +3227,8 @@ Function3d444: ; 3d444 pop de pop bc dec b - jr nz, .asm_3d44f + jr nz, .OuterLoop + pop af ld [wcfbe], a ret @@ -3337,7 +3343,7 @@ Function3d517: ; 3d517 ; 3d533 Function3d533: ; 3d533 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr z, .asm_3d541 @@ -3630,7 +3636,7 @@ Function3d714: ; 3d714 ld a, [PartyCount] dec a jp z, .asm_3d749 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jp nz, .asm_3d749 ld a, [Options] @@ -3862,11 +3868,11 @@ Function3d8b3: ; 3d8b3 cp BATTLETYPE_SUICUNE jp z, .asm_3d98d - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jp nz, .asm_3d9a2 - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jp nz, .asm_3d992 @@ -3979,7 +3985,7 @@ Function3d8b3: ; 3d8b3 ret .asm_3d9a2 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ld a, $2 jr z, .asm_3d9cf @@ -4003,11 +4009,11 @@ Function3d8b3: ; 3d8b3 dec a .asm_3d9cf ld b, a - ld a, [wd0ee] + ld a, [wBattleResult] and $c0 add b - ld [wd0ee], a - call Function3ceec + ld [wBattleResult], a + call StopDangerSound push de ld de, SFX_RUN call WaitPlaySFX @@ -4021,7 +4027,7 @@ Function3d8b3: ; 3d8b3 ret .asm_3d9f5 - call Function3ceec + call StopDangerSound ld hl, wcd2a bit 4, [hl] jr nz, .asm_3da05 @@ -4107,7 +4113,7 @@ Function3da97: ; 3da97 bit SUBSTATUS_TRANSFORMED, a ret z ld hl, wc6f2 - ld a, [IsInBattle] + ld a, [wBattleMode] dec a ret z ld hl, OTPartyMon1DVs @@ -4387,7 +4393,7 @@ Function3dc5b: ; 3dc5b ld hl, wc664 ld b, $0 predef FlagPredef - call Function3d43b + call PlayerMonFaintedAnimation ld hl, BattleText_PkmnFainted jr .asm_3dcdf @@ -4403,7 +4409,7 @@ Function3dc5b: ; 3dc5b ld de, SFX_FAINT call PlaySFX call WaitSFX - call Function3d432 + call EnemyMonFaintedAnimation ld hl, BattleText_EnemyPkmnFainted .asm_3dcdf @@ -4658,7 +4664,7 @@ Function3de51: ; 3de51 call Function3df1f xor a ld [bc], a - ld a, [IsInBattle] + ld a, [wBattleMode] dec a ret z ld [hl], $0 @@ -5127,7 +5133,7 @@ BattleMenu: ; 3e139 ld a, [InputType] or a jr z, .asm_3e171 - callba Function1de294 + callba _DudeAutoInput_DownA .asm_3e171 call LoadBattleMenu2 @@ -5183,7 +5189,7 @@ LoadBattleMenu2: ; 3e19b ; 3e1c7 BattleMenu_Pack: ; 3e1c7 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jp nz, ItemsCantBeUsed @@ -5245,7 +5251,7 @@ Function3e234: ; 3e234 and a jr nz, .asm_3e279 callab CheckItemPocket - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] cp $3 jr z, .asm_3e24a call WhiteBGMap @@ -5268,7 +5274,7 @@ Function3e234: ; 3e234 call Function3df2c call WaitBGMap call Function309d - call Function1fbf + call ResetTextRelatedRAM call Function3ee27 and a ret @@ -5276,10 +5282,10 @@ Function3e234: ; 3e234 .asm_3e279 xor a ld [wc64e], a - ld a, [wd0ee] + ld a, [wBattleResult] and $c0 - ld [wd0ee], a - call Function1fbf + ld [wBattleResult], a + call ResetTextRelatedRAM call Function32f9 scf ret @@ -5348,12 +5354,12 @@ Function3e2f5: ; 3e2f5 Function3e308: ; 3e308 call DisableLCD - ld hl, $9310 + ld hl, VTiles2 tile $31 ld de, VTiles0 ld bc, $0110 call CopyBytes ld hl, VTiles2 - ld de, $8110 + ld de, VTiles0 tile $11 ld bc, $0310 call CopyBytes call EnableLCD @@ -5365,10 +5371,10 @@ Function3e308: ; 3e308 call MaxVolume call DisableLCD ld hl, VTiles0 - ld de, $9310 + ld de, VTiles2 tile $31 ld bc, $0110 call CopyBytes - ld hl, $8110 + ld hl, VTiles0 tile $11 ld de, VTiles2 ld bc, $0310 call CopyBytes @@ -5422,7 +5428,7 @@ Function3e358: ; 3e358 Function3e3ad: ; 3e3ad ld a, 1 ld [wPlayerIsSwitching], a - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr z, .asm_3e3c1 call Function1d6e @@ -5431,7 +5437,7 @@ Function3e3ad: ; 3e3ad .asm_3e3c1 call Function3e7c1 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .asm_3e3cf @@ -5587,7 +5593,7 @@ Function3e4bc: ; 3e4bc call GetPartyParamLocation .asm_3e4e2 - ld de, wd25e + ld de, wListMoves_MoveIndicesBuffer ld bc, NUM_MOVES call CopyBytes xor a @@ -5650,7 +5656,7 @@ Function3e4bc: ; 3e4bc dec a ld b, $c3 jr z, .asm_3e569 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .asm_3e569 ld b, $c7 @@ -5960,8 +5966,8 @@ MoveInfoBox: ; 3e6c8 Function3e75f: ; 3e75f hlcoord 5, 11 - ld a, [InLinkBattle] - cp $4 + ld a, [wLinkMode] ; What's the point of this check? + cp LINK_MOBILE jr c, .ok hlcoord 5, 11 .ok @@ -6034,7 +6040,7 @@ Function3e7c1: ; 3e7c1 ld a, [wEnemyIsSwitching] and a ret nz - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr z, .asm_3e817 call EmptyBattleTextBox @@ -6108,7 +6114,7 @@ Function3e7c1: ; 3e7c1 jr .asm_3e8bd .asm_3e84f - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr nz, .asm_3e882 .asm_3e855 @@ -6222,7 +6228,7 @@ LoadEnemyMon: ; 3e8eb call ByteFill ; We don't need to be here if we're in a link battle - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jp nz, Function3dabd @@ -6244,7 +6250,7 @@ LoadEnemyMon: ; 3e8eb ; Let's get the item: ; Is the item predetermined? - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr z, .WildItem @@ -6293,7 +6299,7 @@ LoadEnemyMon: ; 3e8eb ; Initialize DVs ; If we're in a trainer battle, DVs are predetermined - ld a, [IsInBattle] + ld a, [wBattleMode] and a jr z, .InitDVs @@ -6320,7 +6326,7 @@ LoadEnemyMon: ; 3e8eb ; See GetTrainerDVs for more on that callba GetTrainerDVs ; These are the DVs we'll use if we're actually in a trainer battle - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr nz, .UpdateDVs @@ -6396,7 +6402,7 @@ LoadEnemyMon: ; 3e8eb ; We've still got more to do if we're dealing with a wild monster - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr nz, .Happiness @@ -6496,7 +6502,7 @@ LoadEnemyMon: ; 3e8eb ; If we're in a trainer battle, ; get the rest of the parameters from the party struct - ld a, [IsInBattle] + ld a, [wBattleMode] cp a, TRAINER_BATTLE jr z, .OpponentParty @@ -6586,7 +6592,7 @@ LoadEnemyMon: ; 3e8eb ; Get moves ld de, EnemyMonMoves ; Are we in a trainer battle? - ld a, [IsInBattle] + ld a, [wBattleMode] cp a, TRAINER_BATTLE jr nz, .WildMoves ; Then copy moves from the party struct @@ -6613,7 +6619,7 @@ endr .PP ; Trainer battle? - ld a, [IsInBattle] + ld a, [wBattleMode] cp a, TRAINER_BATTLE jr z, .TrainerPP @@ -6657,7 +6663,7 @@ endr call GetPokemonName ; Did we catch it? - ld a, [IsInBattle] + ld a, [wBattleMode] and a ret z @@ -6725,7 +6731,7 @@ CheckSleepingTreeMon: ; 3eb38 db EXEGGCUTE db LEDYBA db AIPOM - db $ff ; end + db -1 ; end .Day db VENONAT @@ -6733,7 +6739,7 @@ CheckSleepingTreeMon: ; 3eb38 db NOCTOWL db SPINARAK db HERACROSS - db $ff ; end + db -1 ; end .Morn db VENONAT @@ -6741,7 +6747,7 @@ CheckSleepingTreeMon: ; 3eb38 db NOCTOWL db SPINARAK db HERACROSS - db $ff ; end + db -1 ; end ; 3eb75 @@ -6837,7 +6843,8 @@ Function3ebd8: ; 3ebd8 callab GetTrainerPic hlcoord 19, 0 ld c, $0 -.asm_3ebf3 + +.outer_loop inc c ld a, c cp $7 @@ -6848,14 +6855,16 @@ Function3ebd8: ; 3ebd8 ld d, $0 push bc push hl -.asm_3ec01 + +.inner_loop call Function3ec1a inc hl ld a, $7 add d ld d, a dec c - jr nz, .asm_3ec01 + jr nz, .inner_loop + ld a, $1 ld [hBGMapMode], a ld c, $4 @@ -6863,7 +6872,7 @@ Function3ebd8: ; 3ebd8 pop hl pop bc dec hl - jr .asm_3ebf3 + jr .outer_loop ; 3ec1a Function3ec1a: ; 3ec1a @@ -6871,13 +6880,15 @@ Function3ec1a: ; 3ec1a push de push bc ld e, $7 -.asm_3ec1f + +.loop ld [hl], d - ld bc, $0014 + ld bc, SCREEN_WIDTH add hl, bc inc d dec e - jr nz, .asm_3ec1f + jr nz, .loop + pop bc pop de pop hl @@ -7116,7 +7127,7 @@ BadgeStatBoosts: ; 3ed45 ; The boosted stats are in order, except PlainBadge and MineralBadge's boosts are swapped. - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ret nz @@ -7210,15 +7221,15 @@ Function3eda6: ; 3eda6 Function3edad: ; 3edad ld de, GFX_f8ac0 - ld hl, $96c0 + ld hl, VTiles2 tile $6c lb bc, BANK(GFX_f8ac0), 4 call Get1bpp ld de, GFX_f8ae0 - ld hl, $9730 + ld hl, VTiles2 tile $73 lb bc, BANK(GFX_f8ae0), 6 call Get1bpp ld de, GFX_f8b10 - ld hl, $9550 + ld hl, VTiles2 tile $55 lb bc, BANK(GFX_f8b10), 8 jp Get2bpp ; 3edd1 @@ -7237,7 +7248,7 @@ _BattleRandom:: ; 3edd8 ; To circumvent this a shared PRNG is used instead. ; But if we're in a non-link battle we're safe to use it - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jp z, Random @@ -7338,7 +7349,7 @@ Function3ee27: ; 3ee27 Function3ee3b: ; 3ee3b ; Give experience. - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ret nz @@ -7452,7 +7463,7 @@ endr .asm_3eee2 ld [StringBuffer2 + 2], a - ld a, [IsInBattle] + ld a, [wBattleMode] dec a call nz, DoubleExp push bc @@ -7977,7 +7988,7 @@ Function3f22c: ; 3f22c SendOutPkmnText: ; 3f26d - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr z, .asm_3f27c @@ -8333,7 +8344,7 @@ Function3f447: ; 3f447 ld [CurPartySpecies], a ld hl, BattleMonDVs predef GetUnownLetter - ld de, $9310 + ld de, VTiles2 tile $31 predef GetBackpic pop af ld [CurPartySpecies], a @@ -8392,9 +8403,13 @@ Function3f4b4: ; 3f4b4 StartBattle: ; 3f4c1 +; This check prevents you from entering a battle without any Pokemon. +; Those using walk-through-walls to bypass getting a Pokemon experience +; the effects of this check. ld a, [PartyCount] and a ret z + ld a, [TimeOfDayPal] push af call Function3f4dd @@ -8414,17 +8429,17 @@ Function3f4d9: ; 3f4d9 Function3f4dd: ; 3f4dd - callba Function106050 - call Function3f54e + callba MobileFn_106050 ; mobile + call LoadTrainerOrWildMonPic xor a ld [TempBattleMonSpecies], a ld [wd0d2], a xor a ld [$ffde], a callba PlayBattleMusic - callba Function2ee18 - callba Function2ee2f - call Function2ed3 + callba ShowLinkBattleParticipants + callba FindFirstAliveMon + call DisableSpriteUpdates callba ClearBattleRAM call Function3f55e call Function3f568 @@ -8446,7 +8461,7 @@ Function3f4dd: ; 3f4dd ld bc, 4 << 8 + 10 call ClearBox call ClearSprites - ld a, [IsInBattle] + ld a, [wBattleMode] cp $1 call z, UpdateEnemyHUD ld a, $1 @@ -8454,14 +8469,14 @@ Function3f4dd: ; 3f4dd ret ; 3f54e -Function3f54e: ; 3f54e +LoadTrainerOrWildMonPic: ; 3f54e ld a, [OtherTrainerClass] and a - jr nz, .asm_3f55a + jr nz, .Trainer ld a, [TempWildMonSpecies] ld [CurPartySpecies], a -.asm_3f55a +.Trainer ld [TempEnemyMonSpecies], a ret ; 3f55e @@ -8469,8 +8484,8 @@ Function3f54e: ; 3f54e Function3f55e: ; 3f55e ld a, [OtherTrainerClass] and a - jp nz, Function3f594 - jp Function3f607 + jp nz, Function3f594 ; trainer + jp Function3f607 ; wild ; 3f568 Function3f568: ; 3f568 @@ -8499,7 +8514,7 @@ Function3f568: ; 3f568 Function3f594: ; 3f594 ld [TrainerClass], a - callba Function10606a + callba MobileFn_10606a xor a ld [TempEnemyMonSpecies], a callab Function3957b @@ -8521,10 +8536,10 @@ Function3f594: ; 3f594 hlcoord 12, 0 lb bc, 7, 7 predef FillBox - ld a, $ff + ld a, -1 ld [CurOTMon], a ld a, TRAINER_BATTLE - ld [IsInBattle], a + ld [wBattleMode], a call IsJohtoGymLeader jr nc, .done @@ -8554,8 +8569,8 @@ Function3f594: ; 3f594 Function3f607: ; 3f607 ld a, $1 - ld [IsInBattle], a - callba Function10605d + ld [wBattleMode], a + callba MobileFn_10605d call LoadEnemyMon ld hl, EnemyMonMoves ld de, wc735 @@ -8589,7 +8604,7 @@ Function3f607: ; 3f607 Function3f662: ; 3f662 ld hl, EnemyMonMoves - ld de, wd25e + ld de, wListMoves_MoveIndicesBuffer ld b, NUM_MOVES .loop ld a, [de] @@ -8647,17 +8662,17 @@ Function3f69e: ; 3f69e ; 3f6a5 Function3f6a5: ; 3f6a5 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a - jr z, .asm_3f6b7 + jr z, .not_linked call Function3f759 ld c, 150 call DelayFrames call Function3f77c ret -.asm_3f6b7 - ld a, [wd0ee] +.not_linked + ld a, [wBattleResult] and $f ret nz call Function3f71d @@ -8672,7 +8687,7 @@ Function3f6d0: ; 3f6d0 call Function3f998 xor a ld [Danger], a - ld [IsInBattle], a + ld [wBattleMode], a ld [BattleType], a ld [AttackMissed], a ld [TempWildMonSpecies], a @@ -8681,11 +8696,11 @@ Function3f6d0: ; 3f6d0 ld [wd267], a ld [wd232], a ld [wd0d8], a - ld [wd0da], a - ld [wd0d9], a + ld [wKeyItemsPocketCursor], a + ld [wItemsPocketCursor], a ld [wd0d2], a ld [CurMoveNum], a - ld [wd0db], a + ld [wBallsPocketCursor], a ld [wd0d6], a ld [wd0e4], a ld [wd0e0], a @@ -8739,7 +8754,7 @@ endr ; 3f759 Function3f759: ; 3f759 - callba Function1060df + callba MobileFn_1060df callba Function106187 ld a, [CurOTMon] ld hl, OTPartyMon1Status @@ -8747,7 +8762,7 @@ Function3f759: ; 3f759 ld a, [EnemyMonStatus] ld [hl], a call ClearTileMap - callba Function2c1b2 + callba _ShowLinkBattleParticipants ret ; 3f77c @@ -8762,22 +8777,22 @@ Function3f77c: ; 3f77c callba Function2b930 .asm_3f797 - ld a, [wd0ee] + ld a, [wBattleResult] and $f cp $1 jr c, .asm_3f7ad jr z, .asm_3f7b8 - callba Function106107 + callba MobileFn_106107 ld de, .Draw jr .asm_3f7c3 .asm_3f7ad - callba Function1060fb + callba MobileFn_1060fb ld de, .Win jr .asm_3f7c3 .asm_3f7b8 - callba Function106101 + callba MobileFn_106101 ld de, .Lose jr .asm_3f7c3 @@ -8830,8 +8845,8 @@ Function3f80f: ; 3f80f Function3f830: ; 3f830 - ld a, [InLinkBattle] - cp $4 + ld a, [wLinkMode] + cp LINK_MOBILE ret ; 3f836 @@ -8870,7 +8885,7 @@ Function3f85f: ; 3f85f ld a, [de] and a jr z, .asm_3f8c9 - ld a, [wd4b4] + ld a, [wSavedAtLeastOnce] and a jr z, .asm_3f8c9 push hl @@ -8967,7 +8982,7 @@ Function3f85f: ; 3f85f ret .asm_3f92b - ld a, [wd4b4] + ld a, [wSavedAtLeastOnce] and a ret nz ld de, .Scores @@ -8981,9 +8996,9 @@ Function3f85f: ; 3f85f ; 3f947 .Format ; 3f947 - db " --- ", $22, " - - -@" + db " --- - - -@" .Record ; 3f964 - db $52, "'s RECORD@" + db "'s RECORD@" .Result ; 3f96e db "RESULT WIN LOSE DRAW@" .Total ; 3f983 @@ -8995,7 +9010,7 @@ Function3f998: ; 3f998 ld a, [BattleType] cp BATTLETYPE_ROAMING jr nz, .asm_3f9c4 - ld a, [wd0ee] + ld a, [wBattleResult] and $f jr z, .asm_3f9af call GetRoamMonHP @@ -9159,7 +9174,7 @@ endr ; 3faa0 Function3faa0: ; 3faa0 - ld a, [wd0ee] + ld a, [wBattleResult] and $f cp $1 ld bc, $000d @@ -9394,7 +9409,7 @@ GetBattleBackpic: ; 3fbff jr z, .Decompress ; What gender are we? - ld a, [wd45b] + ld a, [wPlayerSpriteSetupFlags] bit 2, a jr nz, .Chris ld a, [PlayerGender] @@ -9411,7 +9426,7 @@ GetBattleBackpic: ; 3fbff ld hl, ChrisBackpic .Decompress - ld de, $9310 + ld de, VTiles2 tile $31 ld c, $31 predef DecompressPredef ret @@ -9424,7 +9439,7 @@ Function3fc30: ; 3fc30 ld a, $6 ld [rSVBK], a ld hl, VTiles0 - ld de, $9310 + ld de, VTiles2 tile $31 ld a, [hROMBank] ld b, a ld c, $31 @@ -9478,7 +9493,7 @@ Function3fc5b: ; 3fc5b BattleStartMessage: ; 3fc8b - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr z, .asm_3fcaa @@ -9531,7 +9546,7 @@ BattleStartMessage: ; 3fc8b cp BATTLETYPE_FISH jr nz, .asm_3fcfd - callba Function106086 + callba MobileFn_106086 ld hl, HookedPokemonAttackedText jr .asm_3fd0e diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm index 63e27359d..95ce78a80 100644 --- a/battle/effect_commands.asm +++ b/battle/effect_commands.asm @@ -12,7 +12,7 @@ DoPlayerTurn: ; 34000 DoEnemyTurn: ; 3400a call SetEnemyTurn - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr z, DoTurn @@ -696,7 +696,7 @@ BattleCommand02: ; 343db ; No obedience in link battles ; (since no handling exists for enemy) - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ret nz @@ -1080,7 +1080,7 @@ endr jr z, .asm_345a4 ; skip this part entirely if wildbattle - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr z, .asm_345c5 @@ -3521,7 +3521,7 @@ Function3534d: ; 3534d inc l .asm_3536b - ld a, [InLinkBattle] + ld a, [wLinkMode] cp 3 jr z, .done @@ -3835,11 +3835,11 @@ BattleCommanda1: ; 35461 sub b ld [DefaultFlypoint], a .asm_3550d - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr z, .asm_3556b - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .asm_35532 @@ -4825,7 +4825,7 @@ BattleCommand46: ; 35a74 call Function372d8 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr z, .asm_35a83 call AnimateFailedMove @@ -4888,7 +4888,7 @@ BattleCommand46: ; 35a74 ld a, [hBattleTurn] and a jr z, .asm_35af6 - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr nz, .asm_35af6 ld a, [hl] @@ -5180,7 +5180,7 @@ endr ld a, [hBattleTurn] and a jr nz, .asm_35c81 - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr nz, .asm_35c81 ld hl, wc739 @@ -5585,7 +5585,7 @@ Function35ece: ; 35ece jr z, .asm_35eec ; Not in link battle - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .asm_35eec @@ -5683,7 +5683,7 @@ BattleCommand2f: ; 35f2c and a jr z, .asm_35f89 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .asm_35f89 @@ -6331,7 +6331,7 @@ BattleCommand1d: ; 362e3 and a jr z, .DidntMiss - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .DidntMiss @@ -7124,7 +7124,7 @@ BattleCommanda0: ; 36778 ld a, [hBattleTurn] and a jr nz, .asm_367bf - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr nz, .failed ld a, [CurPartyLevel] @@ -7149,7 +7149,7 @@ BattleCommanda0: ; 36778 jp PrintButItFailed .asm_367bf - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr nz, .failed ld a, [BattleMonLevel] @@ -7188,10 +7188,10 @@ BattleCommanda0: ; 36778 Function36804: ; 36804 - ld a, [wd0ee] + ld a, [wBattleResult] and $c0 or $2 - ld [wd0ee], a + ld [wBattleResult], a ret ; 3680f @@ -7214,7 +7214,7 @@ BattleCommand23: ; 3680f ld a, [AttackMissed] and a jr nz, .asm_36852 ; 36830 $20 - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr nz, .asm_36869 ; 36836 $31 ld a, [CurPartyLevel] @@ -7300,7 +7300,7 @@ BattleCommand23: ; 3680f and a jr nz, .asm_368f3 - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr nz, .asm_36908 @@ -7496,7 +7496,7 @@ BattleCommand24: ; 369b6 dec a jr .asm_36a3a .asm_36a0b - ld a, [IsInBattle] + ld a, [wBattleMode] cp $1 jp z, .asm_36a1e ld a, [OTPartyCount] @@ -8177,7 +8177,7 @@ BattleCommand30: ; 36dc7 and a jr z, .asm_36e0e - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .asm_36e0e @@ -8519,7 +8519,7 @@ BattleCommand35: ; 36f9d BattleCommand36: ; 36fe1 call AnimateCurrentMove - callba Function1060e5 + callba MobileFn_1060e5 jp PrintNothingHappened ; 36fed @@ -9152,7 +9152,7 @@ CheckSubstituteOpp: ; 37378 BattleCommand1a: ; 37380 - callba Function10610d + callba MobileFn_10610d ld a, $4 ld [wcfca], a ld c, $3 @@ -9281,7 +9281,7 @@ BattleCommand53: ; 37563 and a jr z, .party - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr z, .done @@ -9493,7 +9493,7 @@ BattleCommand60: ; 3784b BattleCommand61: ; 37874 ; present - ld a, [InLinkBattle] + ld a, [wLinkMode] cp $3 jr z, .asm_3787d push bc @@ -9502,7 +9502,7 @@ BattleCommand61: ; 37874 call BattleCommand07 - ld a, [InLinkBattle] + ld a, [wLinkMode] cp $3 jr z, .asm_37889 pop de @@ -9765,7 +9765,7 @@ BattleCommand67: ; 379c9 .Enemy ; Wildmons don't have anything to switch to - ld a, [IsInBattle] + ld a, [wBattleMode] dec a ; WILDMON jp z, FailedBatonPass @@ -9800,7 +9800,7 @@ BattleCommand67: ; 379c9 BatonPass_LinkPlayerSwitch: ; 37a67 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ret z @@ -9819,7 +9819,7 @@ BatonPass_LinkPlayerSwitch: ; 37a67 BatonPass_LinkEnemySwitch: ; 37a82 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ret z @@ -10057,7 +10057,7 @@ BattleCommand6a6c: ; 37b7e jr z, .Full ; Don't factor in time of day in link battles. - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .Weather diff --git a/battle/effects/thief.asm b/battle/effects/thief.asm index dbbe0396b..730fcd66c 100644 --- a/battle/effects/thief.asm +++ b/battle/effects/thief.asm @@ -30,11 +30,11 @@ BattleCommand50: ; 37492 and a ret nz - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr z, .stealenemyitem - ld a, [IsInBattle] + ld a, [wBattleMode] dec a ret z diff --git a/battle/magikarp_length.asm b/battle/magikarp_length.asm new file mode 100644 index 000000000..237450928 --- /dev/null +++ b/battle/magikarp_length.asm @@ -0,0 +1,215 @@ +CalcMagikarpLength: ; fbbfc +; Return Magikarp's length (in mm) at MagikarpLength (big endian). +; +; input: +; de: EnemyMonDVs +; bc: PlayerID + +; This function is poorly commented. + +; In short, it generates a value between 190 and 1786 using +; a Magikarp's DVs and its trainer ID. This value is further +; filtered in LoadEnemyMon to make longer Magikarp even rarer. + +; The value is generated from a lookup table. +; The index is determined by the dv xored with the player's trainer id. + +; bc = rrc(dv[0]) ++ rrc(dv[1]) ^ rrc(id) + +; if bc < 10: [MagikarpLength] = c + 190 +; if bc >= $ff00: [MagikarpLength] = c + 1370 +; else: [MagikarpLength] = z * 100 + (bc - x) / y + +; X, Y, and Z depend on the value of b as follows: + +; if b = 0: x = 310, y = 2, z = 3 +; if b = 1: x = 710, y = 4, z = 4 +; if b = 2-9: x = 2710, y = 20, z = 5 +; if b = 10-29: x = 7710, y = 50, z = 6 +; if b = 30-68: x = 17710, y = 100, z = 7 +; if b = 69-126: x = 32710, y = 150, z = 8 +; if b = 127-185: x = 47710, y = 150, z = 9 +; if b = 186-224: x = 57710, y = 100, z = 10 +; if b = 225-243: x = 62710, y = 50, z = 11 +; if b = 244-251: x = 64710, y = 20, z = 12 +; if b = 252-253: x = 65210, y = 5, z = 13 +; if b = 254: x = 65410, y = 2, z = 14 + + + ; bc = rrc(dv[0]) ++ rrc(dv[1]) ^ rrc(id) + + ; id + ld h, b + ld l, c + ld a, [hli] + ld b, a + ld c, [hl] + rrc b + rrc c + + ; dv + ld a, [de] + inc de + rrca + rrca + xor b + ld b, a + + ld a, [de] + rrca + rrca + xor c + ld c, a + + ; if bc < 10: + ; de = bc + 190 + ; break + + ld a, b + and a + jr nz, .no + ld a, c + cp 10 + jr nc, .no + + ld hl, 190 + add hl, bc + ld d, h + ld e, l + jr .done + +.no + + ld hl, .Lengths + ld a, 2 + ld [wd265], a + +.read + ld a, [hli] + ld e, a + ld a, [hli] + ld d, a + call .BCLessThanDE + jr nc, .next + + ; c = (bc - de) / [hl] + call .BCMinusDE + ld a, b + ld [hDividend + 0], a + ld a, c + ld [hDividend + 1], a + ld a, [hl] + ld [hDivisor], a + ld b, 2 + call Divide + ld a, [hQuotient + 2] + ld c, a + + ; de = c + 100 * (2 + i) + xor a + ld [hMultiplicand + 0], a + ld [hMultiplicand + 1], a + ld a, 100 + ld [hMultiplicand + 2], a + ld a, [wd265] + ld [hMultiplier], a + call Multiply + ld b, 0 + ld a, [hProduct + 3] + add c + ld e, a + ld a, [hProduct + 2] + adc b + ld d, a + jr .done + +.next + inc hl ; align to next triplet + ld a, [wd265] + inc a + ld [wd265], a + cp 16 + jr c, .read + + call .BCMinusDE + ld hl, 1600 + add hl, bc + ld d, h + ld e, l + +.done + ; hl = de * 10 + ld h, d + ld l, e +rept 2 + add hl, hl +endr + add hl, de + add hl, hl + + ; hl = hl / 254 + ld de, -254 + ld a, -1 +.div_254 + inc a + add hl, de + jr c, .div_254 + + ; d, e = hl / 12, hl % 12 + ld d, 0 +.mod_12 + cp 12 + jr c, .ok + sub 12 + inc d + jr .mod_12 +.ok + ld e, a + + ld hl, MagikarpLength + ld [hl], d + inc hl + ld [hl], e + ret +; fbc9a + +.BCLessThanDE: ; fbc9a +; Intention: Return bc < de. +; Reality: Return b < d. + ld a, b + cp d + ret c + ret nc ; whoops + ld a, c + cp e + ret +; fbca1 + +.BCMinusDE: ; fbca1 +; bc -= de + ld a, c + sub e + ld c, a + ld a, b + sbc d + ld b, a + ret +; fbca8 + +.Lengths: ; fbca8 +; ????, divisor + dwb 110, 1 + dwb 310, 2 + dwb 710, 4 + dwb 2710, 20 + dwb 7710, 50 + dwb 17710, 100 + dwb 32710, 150 + dwb 47710, 150 + dwb 57710, 100 + dwb 62710, 50 + dwb 64710, 20 + dwb 65210, 5 + dwb 65410, 2 + dwb 65510, 1 ; not used +; fbcd2 diff --git a/battle/misc.asm b/battle/misc.asm index a8dccca84..6d38b8e2f 100644 --- a/battle/misc.asm +++ b/battle/misc.asm @@ -161,7 +161,7 @@ endr DoBadgeTypeBoosts: ; fbe24 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ret nz diff --git a/constants.asm b/constants.asm index 2d3c19fa2..1c3791396 100644 --- a/constants.asm +++ b/constants.asm @@ -10,6 +10,7 @@ INCLUDE "constants/type_constants.asm" INCLUDE "constants/move_constants.asm" INCLUDE "constants/battle_constants.asm" INCLUDE "constants/map_constants.asm" +INCLUDE "constants/map_setup_constants.asm" INCLUDE "constants/landmark_constants.asm" INCLUDE "constants/item_constants.asm" INCLUDE "constants/trainer_constants.asm" @@ -26,3 +27,5 @@ INCLUDE "constants/misc_constants.asm" INCLUDE "constants/std_constants.asm" INCLUDE "constants/deco_constants.asm" INCLUDE "constants/radio_constants.asm" +INCLUDE "constants/sprite_constants.asm" +INCLUDE "constants/tilemap_constants.asm" diff --git a/constants/battle_constants.asm b/constants/battle_constants.asm index 523e1345c..6ee0995cd 100644 --- a/constants/battle_constants.asm +++ b/constants/battle_constants.asm @@ -315,3 +315,32 @@ SUBSTATUS_CURLED EQU 0 const EFFECT_BEAT_UP const EFFECT_FLY const EFFECT_DEFENSE_CURL + +; Battle vars used in home/battle.asm + const_def + const PLAYER_SUBSTATUS_1 + const ENEMY_SUBSTATUS_1 + const PLAYER_SUBSTATUS_2 + const ENEMY_SUBSTATUS_2 + const PLAYER_SUBSTATUS_3 + const ENEMY_SUBSTATUS_3 + const PLAYER_SUBSTATUS_4 + const ENEMY_SUBSTATUS_4 + const PLAYER_SUBSTATUS_5 + const ENEMY_SUBSTATUS_5 + const PLAYER_STATUS + const ENEMY_STATUS + const PLAYER_MOVE_ANIMATION + const ENEMY_MOVE_ANIMATION + const PLAYER_MOVE_EFFECT + const ENEMY_MOVE_EFFECT + const PLAYER_MOVE_POWER + const ENEMY_MOVE_POWER + const PLAYER_MOVE_TYPE + const ENEMY_MOVE_TYPE + const PLAYER_CUR_MOVE + const ENEMY_CUR_MOVE + const PLAYER_COUNTER_MOVE + const ENEMY_COUNTER_MOVE + const PLAYER_LAST_MOVE + const ENEMY_LAST_MOVE diff --git a/constants/item_constants.asm b/constants/item_constants.asm index 376a3696d..80f27a5f6 100644 --- a/constants/item_constants.asm +++ b/constants/item_constants.asm @@ -352,7 +352,7 @@ const_value SET 70 const HELD_TRADE_EVOLVE const HELD_AMULET_COIN const HELD_BRIGHTPOWDER - const HELD_4E + const HELD_78 const HELD_FOCUS_BAND const_def @@ -364,3 +364,8 @@ const_value SET 70 const ITEMATTR_POCKET const ITEMATTR_HELP NUM_ITEMATTRS EQU const_value + +ITEMMENU_NOUSE EQU 0 +ITEMMENU_CURRENT EQU 4 +ITEMMENU_PARTY EQU 5 +ITEMMENU_CLOSE EQU 6 diff --git a/constants/map_constants.asm b/constants/map_constants.asm index 2ea5cea7e..1b553c783 100644 --- a/constants/map_constants.asm +++ b/constants/map_constants.asm @@ -6,445 +6,472 @@ MAP_NONE EQU 0 ; map group ids const_def - newgroup - mapgroup OLIVINE_POKECENTER_1F, 4, 5 - mapgroup OLIVINE_GYM, 8, 5 - mapgroup OLIVINE_VOLTORB_HOUSE, 4, 4 - mapgroup OLIVINE_HOUSE_BETA, 4, 4 - mapgroup OLIVINE_PUNISHMENT_SPEECH_HOUSE, 4, 4 - mapgroup OLIVINE_GOOD_ROD_HOUSE, 4, 4 - mapgroup OLIVINE_CAFE, 4, 4 - mapgroup OLIVINE_MART, 4, 6 - mapgroup ROUTE_38_ECRUTEAK_GATE, 4, 5 - mapgroup ROUTE_39_BARN, 4, 4 - mapgroup ROUTE_39_FARMHOUSE, 4, 4 - mapgroup ROUTE_38, 9, 20 - mapgroup ROUTE_39, 18, 10 - mapgroup OLIVINE_CITY, 18, 20 + newgroup ; 1 - newgroup - mapgroup MAHOGANY_RED_GYARADOS_SPEECH_HOUSE, 4, 4 - mapgroup MAHOGANY_GYM, 9, 5 - mapgroup MAHOGANY_POKECENTER_1F, 4, 5 - mapgroup ROUTE_42_ECRUTEAK_GATE, 4, 5 - mapgroup ROUTE_42, 9, 30 - mapgroup ROUTE_44, 9, 30 - mapgroup MAHOGANY_TOWN, 9, 10 + mapgroup OLIVINE_POKECENTER_1F, 4, 5 ; 1 + mapgroup OLIVINE_GYM, 8, 5 ; 2 + mapgroup OLIVINE_VOLTORB_HOUSE, 4, 4 ; 3 + mapgroup OLIVINE_HOUSE_BETA, 4, 4 ; 4 + mapgroup OLIVINE_PUNISHMENT_SPEECH_HOUSE, 4, 4 ; 5 + mapgroup OLIVINE_GOOD_ROD_HOUSE, 4, 4 ; 6 + mapgroup OLIVINE_CAFE, 4, 4 ; 7 + mapgroup OLIVINE_MART, 4, 6 ; 8 + mapgroup ROUTE_38_ECRUTEAK_GATE, 4, 5 ; 9 + mapgroup ROUTE_39_BARN, 4, 4 ; 10 + mapgroup ROUTE_39_FARMHOUSE, 4, 4 ; 11 + mapgroup ROUTE_38, 9, 20 ; 12 + mapgroup ROUTE_39, 18, 10 ; 13 + mapgroup OLIVINE_CITY, 18, 20 ; 14 - newgroup - mapgroup SPROUT_TOWER_1F, 8, 10 - mapgroup SPROUT_TOWER_2F, 8, 10 - mapgroup SPROUT_TOWER_3F, 8, 10 - mapgroup TIN_TOWER_1F, 9, 10 - mapgroup TIN_TOWER_2F, 9, 10 - mapgroup TIN_TOWER_3F, 9, 10 - mapgroup TIN_TOWER_4F, 9, 10 - mapgroup TIN_TOWER_5F, 9, 10 - mapgroup TIN_TOWER_6F, 9, 10 - mapgroup TIN_TOWER_7F, 9, 10 - mapgroup TIN_TOWER_8F, 9, 10 - mapgroup TIN_TOWER_9F, 9, 10 - mapgroup BURNED_TOWER_1F, 9, 10 - mapgroup BURNED_TOWER_B1F, 9, 10 - mapgroup NATIONAL_PARK, 27, 20 - mapgroup NATIONAL_PARK_BUG_CONTEST, 27, 20 - mapgroup RADIO_TOWER_1F, 4, 9 - mapgroup RADIO_TOWER_2F, 4, 9 - mapgroup RADIO_TOWER_3F, 4, 9 - mapgroup RADIO_TOWER_4F, 4, 9 - mapgroup RADIO_TOWER_5F, 4, 9 - mapgroup RUINS_OF_ALPH_OUTSIDE, 18, 10 - mapgroup RUINS_OF_ALPH_HO_OH_CHAMBER, 5, 4 - mapgroup RUINS_OF_ALPH_KABUTO_CHAMBER, 5, 4 - mapgroup RUINS_OF_ALPH_OMANYTE_CHAMBER, 5, 4 - mapgroup RUINS_OF_ALPH_AERODACTYL_CHAMBER, 5, 4 - mapgroup RUINS_OF_ALPH_INNER_CHAMBER, 14, 10 - mapgroup RUINS_OF_ALPH_RESEARCH_CENTER, 4, 4 - mapgroup RUINS_OF_ALPH_HO_OH_ITEM_ROOM, 5, 4 - mapgroup RUINS_OF_ALPH_KABUTO_ITEM_ROOM, 5, 4 - mapgroup RUINS_OF_ALPH_OMANYTE_ITEM_ROOM, 5, 4 - mapgroup RUINS_OF_ALPH_AERODACTYL_ITEM_ROOM, 5, 4 - mapgroup RUINS_OF_ALPH_HO_OH_WORD_ROOM, 12, 10 - mapgroup RUINS_OF_ALPH_KABUTO_WORD_ROOM, 7, 10 - mapgroup RUINS_OF_ALPH_OMANYTE_WORD_ROOM, 8, 10 - mapgroup RUINS_OF_ALPH_AERODACTYL_WORD_ROOM, 7, 10 - mapgroup UNION_CAVE_1F, 18, 10 - mapgroup UNION_CAVE_B1F, 18, 10 - mapgroup UNION_CAVE_B2F, 18, 10 - mapgroup SLOWPOKE_WELL_B1F, 9, 10 - mapgroup SLOWPOKE_WELL_B2F, 9, 10 - mapgroup OLIVINE_LIGHTHOUSE_1F, 9, 10 - mapgroup OLIVINE_LIGHTHOUSE_2F, 9, 10 - mapgroup OLIVINE_LIGHTHOUSE_3F, 9, 10 - mapgroup OLIVINE_LIGHTHOUSE_4F, 9, 10 - mapgroup OLIVINE_LIGHTHOUSE_5F, 9, 10 - mapgroup OLIVINE_LIGHTHOUSE_6F, 9, 10 - mapgroup MAHOGANY_MART_1F, 4, 4 - mapgroup TEAM_ROCKET_BASE_B1F, 9, 15 - mapgroup TEAM_ROCKET_BASE_B2F, 9, 15 - mapgroup TEAM_ROCKET_BASE_B3F, 9, 15 - mapgroup ILEX_FOREST, 27, 15 - mapgroup WAREHOUSE_ENTRANCE, 18, 15 - mapgroup UNDERGROUND_PATH_SWITCH_ROOM_ENTRANCES, 18, 15 - mapgroup GOLDENROD_DEPT_STORE_B1F, 9, 10 - mapgroup UNDERGROUND_WAREHOUSE, 9, 10 - mapgroup MOUNT_MORTAR_1F_OUTSIDE, 18, 20 - mapgroup MOUNT_MORTAR_1F_INSIDE, 27, 20 - mapgroup MOUNT_MORTAR_2F_INSIDE, 18, 20 - mapgroup MOUNT_MORTAR_B1F, 18, 20 - mapgroup ICE_PATH_1F, 18, 20 - mapgroup ICE_PATH_B1F, 18, 10 - mapgroup ICE_PATH_B2F_MAHOGANY_SIDE, 9, 10 - mapgroup ICE_PATH_B2F_BLACKTHORN_SIDE, 9, 5 - mapgroup ICE_PATH_B3F, 9, 10 - mapgroup WHIRL_ISLAND_NW, 9, 5 - mapgroup WHIRL_ISLAND_NE, 9, 10 - mapgroup WHIRL_ISLAND_SW, 9, 10 - mapgroup WHIRL_ISLAND_CAVE, 9, 5 - mapgroup WHIRL_ISLAND_SE, 9, 5 - mapgroup WHIRL_ISLAND_B1F, 18, 20 - mapgroup WHIRL_ISLAND_B2F, 18, 10 - mapgroup WHIRL_ISLAND_LUGIA_CHAMBER, 9, 10 - mapgroup SILVER_CAVE_ROOM_1, 18, 10 - mapgroup SILVER_CAVE_ROOM_2, 18, 15 - mapgroup SILVER_CAVE_ROOM_3, 18, 10 - mapgroup SILVER_CAVE_ITEM_ROOMS, 9, 10 - mapgroup DARK_CAVE_VIOLET_ENTRANCE, 18, 20 - mapgroup DARK_CAVE_BLACKTHORN_ENTRANCE, 18, 15 - mapgroup DRAGONS_DEN_1F, 9, 5 - mapgroup DRAGONS_DEN_B1F, 18, 20 - mapgroup DRAGON_SHRINE, 5, 5 - mapgroup TOHJO_FALLS, 9, 15 - mapgroup DIGLETTS_CAVE, 18, 10 - mapgroup MOUNT_MOON, 9, 15 - mapgroup UNDERGROUND, 14, 3 - mapgroup ROCK_TUNNEL_1F, 18, 15 - mapgroup ROCK_TUNNEL_B1F, 18, 15 - mapgroup SAFARI_ZONE_FUCHSIA_GATE_BETA, 4, 5 - mapgroup SAFARI_ZONE_BETA, 18, 10 - mapgroup VICTORY_ROAD, 36, 10 + newgroup ; 2 - newgroup - mapgroup ECRUTEAK_HOUSE, 9, 10 - mapgroup WISE_TRIOS_ROOM, 4, 4 - mapgroup ECRUTEAK_POKECENTER_1F, 4, 5 - mapgroup ECRUTEAK_LUGIA_SPEECH_HOUSE, 4, 4 - mapgroup DANCE_THEATRE, 7, 6 - mapgroup ECRUTEAK_MART, 4, 6 - mapgroup ECRUTEAK_GYM, 9, 5 - mapgroup ECRUTEAK_ITEMFINDER_HOUSE, 4, 4 - mapgroup ECRUTEAK_CITY, 18, 20 + mapgroup MAHOGANY_RED_GYARADOS_SPEECH_HOUSE, 4, 4 ; 1 + mapgroup MAHOGANY_GYM, 9, 5 ; 2 + mapgroup MAHOGANY_POKECENTER_1F, 4, 5 ; 3 + mapgroup ROUTE_42_ECRUTEAK_GATE, 4, 5 ; 4 + mapgroup ROUTE_42, 9, 30 ; 5 + mapgroup ROUTE_44, 9, 30 ; 6 + mapgroup MAHOGANY_TOWN, 9, 10 ; 7 - newgroup - mapgroup BLACKTHORN_GYM_1F, 9, 5 - mapgroup BLACKTHORN_GYM_2F, 9, 5 - mapgroup BLACKTHORN_DRAGON_SPEECH_HOUSE, 4, 4 - mapgroup BLACKTHORN_DODRIO_TRADE_HOUSE, 4, 4 - mapgroup BLACKTHORN_MART, 4, 6 - mapgroup BLACKTHORN_POKECENTER_1F, 4, 5 - mapgroup MOVE_DELETERS_HOUSE, 4, 4 - mapgroup ROUTE_45, 45, 10 - mapgroup ROUTE_46, 18, 10 - mapgroup BLACKTHORN_CITY, 18, 20 + newgroup ; 3 - newgroup - mapgroup CINNABAR_POKECENTER_1F, 4, 5 - mapgroup CINNABAR_POKECENTER_2F_BETA, 4, 8 - mapgroup ROUTE_19___FUCHSIA_GATE, 4, 5 - mapgroup SEAFOAM_GYM, 4, 5 - mapgroup ROUTE_19, 18, 10 - mapgroup ROUTE_20, 9, 30 - mapgroup ROUTE_21, 18, 10 - mapgroup CINNABAR_ISLAND, 9, 10 + mapgroup SPROUT_TOWER_1F, 8, 10 ; 1 + mapgroup SPROUT_TOWER_2F, 8, 10 ; 2 + mapgroup SPROUT_TOWER_3F, 8, 10 ; 3 + mapgroup TIN_TOWER_1F, 9, 10 ; 4 + mapgroup TIN_TOWER_2F, 9, 10 ; 5 + mapgroup TIN_TOWER_3F, 9, 10 ; 6 + mapgroup TIN_TOWER_4F, 9, 10 ; 7 + mapgroup TIN_TOWER_5F, 9, 10 ; 8 + mapgroup TIN_TOWER_6F, 9, 10 ; 9 + mapgroup TIN_TOWER_7F, 9, 10 ; 10 + mapgroup TIN_TOWER_8F, 9, 10 ; 11 + mapgroup TIN_TOWER_9F, 9, 10 ; 12 + mapgroup BURNED_TOWER_1F, 9, 10 ; 13 + mapgroup BURNED_TOWER_B1F, 9, 10 ; 14 + mapgroup NATIONAL_PARK, 27, 20 ; 15 + mapgroup NATIONAL_PARK_BUG_CONTEST, 27, 20 ; 16 + mapgroup RADIO_TOWER_1F, 4, 9 ; 17 + mapgroup RADIO_TOWER_2F, 4, 9 ; 18 + mapgroup RADIO_TOWER_3F, 4, 9 ; 19 + mapgroup RADIO_TOWER_4F, 4, 9 ; 20 + mapgroup RADIO_TOWER_5F, 4, 9 ; 21 + mapgroup RUINS_OF_ALPH_OUTSIDE, 18, 10 ; 22 + mapgroup RUINS_OF_ALPH_HO_OH_CHAMBER, 5, 4 ; 23 + mapgroup RUINS_OF_ALPH_KABUTO_CHAMBER, 5, 4 ; 24 + mapgroup RUINS_OF_ALPH_OMANYTE_CHAMBER, 5, 4 ; 25 + mapgroup RUINS_OF_ALPH_AERODACTYL_CHAMBER, 5, 4 ; 26 + mapgroup RUINS_OF_ALPH_INNER_CHAMBER, 14, 10 ; 27 + mapgroup RUINS_OF_ALPH_RESEARCH_CENTER, 4, 4 ; 28 + mapgroup RUINS_OF_ALPH_HO_OH_ITEM_ROOM, 5, 4 ; 29 + mapgroup RUINS_OF_ALPH_KABUTO_ITEM_ROOM, 5, 4 ; 30 + mapgroup RUINS_OF_ALPH_OMANYTE_ITEM_ROOM, 5, 4 ; 31 + mapgroup RUINS_OF_ALPH_AERODACTYL_ITEM_ROOM, 5, 4 ; 32 + mapgroup RUINS_OF_ALPH_HO_OH_WORD_ROOM, 12, 10 ; 33 + mapgroup RUINS_OF_ALPH_KABUTO_WORD_ROOM, 7, 10 ; 34 + mapgroup RUINS_OF_ALPH_OMANYTE_WORD_ROOM, 8, 10 ; 35 + mapgroup RUINS_OF_ALPH_AERODACTYL_WORD_ROOM, 7, 10 ; 36 + mapgroup UNION_CAVE_1F, 18, 10 ; 37 + mapgroup UNION_CAVE_B1F, 18, 10 ; 38 + mapgroup UNION_CAVE_B2F, 18, 10 ; 39 + mapgroup SLOWPOKE_WELL_B1F, 9, 10 ; 40 + mapgroup SLOWPOKE_WELL_B2F, 9, 10 ; 41 + mapgroup OLIVINE_LIGHTHOUSE_1F, 9, 10 ; 42 + mapgroup OLIVINE_LIGHTHOUSE_2F, 9, 10 ; 43 + mapgroup OLIVINE_LIGHTHOUSE_3F, 9, 10 ; 44 + mapgroup OLIVINE_LIGHTHOUSE_4F, 9, 10 ; 45 + mapgroup OLIVINE_LIGHTHOUSE_5F, 9, 10 ; 46 + mapgroup OLIVINE_LIGHTHOUSE_6F, 9, 10 ; 47 + mapgroup MAHOGANY_MART_1F, 4, 4 ; 48 + mapgroup TEAM_ROCKET_BASE_B1F, 9, 15 ; 49 + mapgroup TEAM_ROCKET_BASE_B2F, 9, 15 ; 50 + mapgroup TEAM_ROCKET_BASE_B3F, 9, 15 ; 51 + mapgroup ILEX_FOREST, 27, 15 ; 52 + mapgroup WAREHOUSE_ENTRANCE, 18, 15 ; 53 + mapgroup UNDERGROUND_PATH_SWITCH_ROOM_ENTRANCES, 18, 15 ; 54 + mapgroup GOLDENROD_DEPT_STORE_B1F, 9, 10 ; 55 + mapgroup UNDERGROUND_WAREHOUSE, 9, 10 ; 56 + mapgroup MOUNT_MORTAR_1F_OUTSIDE, 18, 20 ; 57 + mapgroup MOUNT_MORTAR_1F_INSIDE, 27, 20 ; 58 + mapgroup MOUNT_MORTAR_2F_INSIDE, 18, 20 ; 59 + mapgroup MOUNT_MORTAR_B1F, 18, 20 ; 60 + mapgroup ICE_PATH_1F, 18, 20 ; 61 + mapgroup ICE_PATH_B1F, 18, 10 ; 62 + mapgroup ICE_PATH_B2F_MAHOGANY_SIDE, 9, 10 ; 63 + mapgroup ICE_PATH_B2F_BLACKTHORN_SIDE, 9, 5 ; 64 + mapgroup ICE_PATH_B3F, 9, 10 ; 65 + mapgroup WHIRL_ISLAND_NW, 9, 5 ; 66 + mapgroup WHIRL_ISLAND_NE, 9, 10 ; 67 + mapgroup WHIRL_ISLAND_SW, 9, 10 ; 68 + mapgroup WHIRL_ISLAND_CAVE, 9, 5 ; 69 + mapgroup WHIRL_ISLAND_SE, 9, 5 ; 70 + mapgroup WHIRL_ISLAND_B1F, 18, 20 ; 71 + mapgroup WHIRL_ISLAND_B2F, 18, 10 ; 72 + mapgroup WHIRL_ISLAND_LUGIA_CHAMBER, 9, 10 ; 73 + mapgroup SILVER_CAVE_ROOM_1, 18, 10 ; 74 + mapgroup SILVER_CAVE_ROOM_2, 18, 15 ; 75 + mapgroup SILVER_CAVE_ROOM_3, 18, 10 ; 76 + mapgroup SILVER_CAVE_ITEM_ROOMS, 9, 10 ; 77 + mapgroup DARK_CAVE_VIOLET_ENTRANCE, 18, 20 ; 78 + mapgroup DARK_CAVE_BLACKTHORN_ENTRANCE, 18, 15 ; 79 + mapgroup DRAGONS_DEN_1F, 9, 5 ; 80 + mapgroup DRAGONS_DEN_B1F, 18, 20 ; 81 + mapgroup DRAGON_SHRINE, 5, 5 ; 82 + mapgroup TOHJO_FALLS, 9, 15 ; 83 + mapgroup DIGLETTS_CAVE, 18, 10 ; 84 + mapgroup MOUNT_MOON, 9, 15 ; 85 + mapgroup UNDERGROUND, 14, 3 ; 86 + mapgroup ROCK_TUNNEL_1F, 18, 15 ; 87 + mapgroup ROCK_TUNNEL_B1F, 18, 15 ; 88 + mapgroup SAFARI_ZONE_FUCHSIA_GATE_BETA, 4, 5 ; 89 + mapgroup SAFARI_ZONE_BETA, 18, 10 ; 90 + mapgroup VICTORY_ROAD, 36, 10 ; 91 - newgroup - mapgroup CERULEAN_GYM_BADGE_SPEECH_HOUSE, 4, 4 - mapgroup CERULEAN_POLICE_STATION, 4, 4 - mapgroup CERULEAN_TRADE_SPEECH_HOUSE, 4, 4 - mapgroup CERULEAN_POKECENTER_1F, 4, 5 - mapgroup CERULEAN_POKECENTER_2F_BETA, 4, 8 - mapgroup CERULEAN_GYM, 8, 5 - mapgroup CERULEAN_MART, 4, 6 - mapgroup ROUTE_10_POKECENTER_1F, 4, 5 - mapgroup ROUTE_10_POKECENTER_2F_BETA, 4, 8 - mapgroup POWER_PLANT, 9, 10 - mapgroup BILLS_HOUSE, 4, 4 - mapgroup ROUTE_4, 9, 20 - mapgroup ROUTE_9, 9, 30 - mapgroup ROUTE_10_NORTH, 9, 10 - mapgroup ROUTE_24, 9, 10 - mapgroup ROUTE_25, 9, 30 - mapgroup CERULEAN_CITY, 18, 20 + newgroup ; 4 - newgroup - mapgroup AZALEA_POKECENTER_1F, 4, 5 - mapgroup CHARCOAL_KILN, 4, 4 - mapgroup AZALEA_MART, 4, 6 - mapgroup KURTS_HOUSE, 4, 8 - mapgroup AZALEA_GYM, 8, 5 - mapgroup ROUTE_33, 9, 10 - mapgroup AZALEA_TOWN, 9, 20 + mapgroup ECRUTEAK_HOUSE, 9, 10 ; 1 + mapgroup WISE_TRIOS_ROOM, 4, 4 ; 2 + mapgroup ECRUTEAK_POKECENTER_1F, 4, 5 ; 3 + mapgroup ECRUTEAK_LUGIA_SPEECH_HOUSE, 4, 4 ; 4 + mapgroup DANCE_THEATRE, 7, 6 ; 5 + mapgroup ECRUTEAK_MART, 4, 6 ; 6 + mapgroup ECRUTEAK_GYM, 9, 5 ; 7 + mapgroup ECRUTEAK_ITEMFINDER_HOUSE, 4, 4 ; 8 + mapgroup ECRUTEAK_CITY, 18, 20 ; 9 - newgroup - mapgroup LAKE_OF_RAGE_HIDDEN_POWER_HOUSE, 4, 4 - mapgroup LAKE_OF_RAGE_MAGIKARP_HOUSE, 4, 4 - mapgroup ROUTE_43_MAHOGANY_GATE, 4, 5 - mapgroup ROUTE_43_GATE, 4, 5 - mapgroup ROUTE_43, 27, 10 - mapgroup LAKE_OF_RAGE, 18, 20 + newgroup ; 5 - newgroup - mapgroup ROUTE_32, 45, 10 - mapgroup ROUTE_35, 18, 10 - mapgroup ROUTE_36, 9, 30 - mapgroup ROUTE_37, 9, 10 - mapgroup VIOLET_CITY, 18, 20 - mapgroup VIOLET_MART, 4, 6 - mapgroup VIOLET_GYM, 8, 5 - mapgroup EARLS_POKEMON_ACADEMY, 8, 4 - mapgroup VIOLET_NICKNAME_SPEECH_HOUSE, 4, 4 - mapgroup VIOLET_POKECENTER_1F, 4, 5 - mapgroup VIOLET_ONIX_TRADE_HOUSE, 4, 4 - mapgroup ROUTE_32_RUINS_OF_ALPH_GATE, 4, 5 - mapgroup ROUTE_32_POKECENTER_1F, 4, 5 - mapgroup ROUTE_35_GOLDENROD_GATE, 4, 5 - mapgroup ROUTE_35_NATIONAL_PARK_GATE, 4, 4 - mapgroup ROUTE_36_RUINS_OF_ALPH_GATE, 4, 5 - mapgroup ROUTE_36_NATIONAL_PARK_GATE, 4, 5 + mapgroup BLACKTHORN_GYM_1F, 9, 5 ; 1 + mapgroup BLACKTHORN_GYM_2F, 9, 5 ; 2 + mapgroup BLACKTHORN_DRAGON_SPEECH_HOUSE, 4, 4 ; 3 + mapgroup BLACKTHORN_DODRIO_TRADE_HOUSE, 4, 4 ; 4 + mapgroup BLACKTHORN_MART, 4, 6 ; 5 + mapgroup BLACKTHORN_POKECENTER_1F, 4, 5 ; 6 + mapgroup MOVE_DELETERS_HOUSE, 4, 4 ; 7 + mapgroup ROUTE_45, 45, 10 ; 8 + mapgroup ROUTE_46, 18, 10 ; 9 + mapgroup BLACKTHORN_CITY, 18, 20 ; 10 - newgroup - mapgroup ROUTE_34, 27, 10 - mapgroup GOLDENROD_CITY, 18, 20 - mapgroup GOLDENROD_GYM, 9, 10 - mapgroup GOLDENROD_BIKE_SHOP, 4, 4 - mapgroup GOLDENROD_HAPPINESS_RATER, 4, 4 - mapgroup GOLDENROD_BILLS_HOUSE, 4, 4 - mapgroup GOLDENROD_MAGNET_TRAIN_STATION, 9, 10 - mapgroup GOLDENROD_FLOWER_SHOP, 4, 4 - mapgroup GOLDENROD_PP_SPEECH_HOUSE, 4, 4 - mapgroup GOLDENROD_NAME_RATERS_HOUSE, 4, 4 - mapgroup GOLDENROD_DEPT_STORE_1F, 4, 8 - mapgroup GOLDENROD_DEPT_STORE_2F, 4, 8 - mapgroup GOLDENROD_DEPT_STORE_3F, 4, 8 - mapgroup GOLDENROD_DEPT_STORE_4F, 4, 8 - mapgroup GOLDENROD_DEPT_STORE_5F, 4, 8 - mapgroup GOLDENROD_DEPT_STORE_6F, 4, 8 - mapgroup GOLDENROD_DEPT_STORE_ELEVATOR, 2, 2 - mapgroup GOLDENROD_DEPT_STORE_ROOF, 4, 8 - mapgroup GOLDENROD_GAME_CORNER, 7, 10 - mapgroup GOLDENROD_POKECENTER_1F, 4, 5 - mapgroup GOLDENROD_POKECOM_CENTER_2F_MOBILE, 16, 16 - mapgroup ILEX_FOREST_AZALEA_GATE, 4, 5 - mapgroup ROUTE_34_ILEX_FOREST_GATE, 4, 5 - mapgroup DAYCARE, 4, 5 + newgroup ; 6 - newgroup - mapgroup ROUTE_6, 9, 10 - mapgroup ROUTE_11, 9, 20 - mapgroup VERMILION_CITY, 18, 20 - mapgroup VERMILION_HOUSE_FISHING_SPEECH_HOUSE, 4, 4 - mapgroup VERMILION_POKECENTER_1F, 4, 5 - mapgroup VERMILION_POKECENTER_2F_BETA, 4, 8 - mapgroup POKEMON_FAN_CLUB, 4, 5 - mapgroup VERMILION_MAGNET_TRAIN_SPEECH_HOUSE, 4, 4 - mapgroup VERMILION_MART, 4, 6 - mapgroup VERMILION_HOUSE_DIGLETTS_CAVE_SPEECH_HOUSE, 4, 4 - mapgroup VERMILION_GYM, 9, 5 - mapgroup ROUTE_6_SAFFRON_GATE, 4, 5 - mapgroup ROUTE_6_UNDERGROUND_ENTRANCE, 4, 4 + mapgroup CINNABAR_POKECENTER_1F, 4, 5 ; 1 + mapgroup CINNABAR_POKECENTER_2F_BETA, 4, 8 ; 2 + mapgroup ROUTE_19___FUCHSIA_GATE, 4, 5 ; 3 + mapgroup SEAFOAM_GYM, 4, 5 ; 4 + mapgroup ROUTE_19, 18, 10 ; 5 + mapgroup ROUTE_20, 9, 30 ; 6 + mapgroup ROUTE_21, 18, 10 ; 7 + mapgroup CINNABAR_ISLAND, 9, 10 ; 8 - newgroup - mapgroup ROUTE_1, 18, 10 - mapgroup PALLET_TOWN, 9, 10 - mapgroup REDS_HOUSE_1F, 4, 4 - mapgroup REDS_HOUSE_2F, 4, 4 - mapgroup BLUES_HOUSE, 4, 4 - mapgroup OAKS_LAB, 6, 5 + newgroup ; 7 - newgroup - mapgroup ROUTE_3, 9, 30 - mapgroup PEWTER_CITY, 18, 20 - mapgroup PEWTER_NIDORAN_SPEECH_HOUSE, 4, 4 - mapgroup PEWTER_GYM, 7, 5 - mapgroup PEWTER_MART, 4, 6 - mapgroup PEWTER_POKECENTER_1F, 4, 5 - mapgroup PEWTER_POKECENTER_2F_BETA, 4, 8 - mapgroup PEWTER_SNOOZE_SPEECH_HOUSE, 4, 4 + mapgroup CERULEAN_GYM_BADGE_SPEECH_HOUSE, 4, 4 ; 1 + mapgroup CERULEAN_POLICE_STATION, 4, 4 ; 2 + mapgroup CERULEAN_TRADE_SPEECH_HOUSE, 4, 4 ; 3 + mapgroup CERULEAN_POKECENTER_1F, 4, 5 ; 4 + mapgroup CERULEAN_POKECENTER_2F_BETA, 4, 8 ; 5 + mapgroup CERULEAN_GYM, 8, 5 ; 6 + mapgroup CERULEAN_MART, 4, 6 ; 7 + mapgroup ROUTE_10_POKECENTER_1F, 4, 5 ; 8 + mapgroup ROUTE_10_POKECENTER_2F_BETA, 4, 8 ; 9 + mapgroup POWER_PLANT, 9, 10 ; 10 + mapgroup BILLS_HOUSE, 4, 4 ; 11 + mapgroup ROUTE_4, 9, 20 ; 12 + mapgroup ROUTE_9, 9, 30 ; 13 + mapgroup ROUTE_10_NORTH, 9, 10 ; 14 + mapgroup ROUTE_24, 9, 10 ; 15 + mapgroup ROUTE_25, 9, 30 ; 16 + mapgroup CERULEAN_CITY, 18, 20 ; 17 - newgroup - mapgroup OLIVINE_PORT, 18, 10 - mapgroup VERMILION_PORT, 18, 10 - mapgroup FAST_SHIP_1F, 9, 16 - mapgroup FAST_SHIP_CABINS_NNW_NNE_NE, 16, 4 - mapgroup FAST_SHIP_CABINS_SW_SSW_NW, 16, 4 - mapgroup FAST_SHIP_CABINS_SE_SSE_CAPTAINS_CABIN, 17, 5 - mapgroup FAST_SHIP_B1F, 8, 16 - mapgroup OLIVINE_PORT_PASSAGE, 9, 10 - mapgroup VERMILION_PORT_PASSAGE, 9, 10 - mapgroup MOUNT_MOON_SQUARE, 9, 15 - mapgroup MOUNT_MOON_GIFT_SHOP, 4, 4 - mapgroup TIN_TOWER_ROOF, 9, 10 + newgroup ; 8 - newgroup - mapgroup ROUTE_23, 9, 10 - mapgroup INDIGO_PLATEAU_POKECENTER_1F, 7, 9 - mapgroup WILLS_ROOM, 9, 5 - mapgroup KOGAS_ROOM, 9, 5 - mapgroup BRUNOS_ROOM, 9, 5 - mapgroup KARENS_ROOM, 9, 5 - mapgroup LANCES_ROOM, 12, 5 - mapgroup HALL_OF_FAME, 7, 5 + mapgroup AZALEA_POKECENTER_1F, 4, 5 ; 1 + mapgroup CHARCOAL_KILN, 4, 4 ; 2 + mapgroup AZALEA_MART, 4, 6 ; 3 + mapgroup KURTS_HOUSE, 4, 8 ; 4 + mapgroup AZALEA_GYM, 8, 5 ; 5 + mapgroup ROUTE_33, 9, 10 ; 6 + mapgroup AZALEA_TOWN, 9, 20 ; 7 - newgroup - mapgroup ROUTE_13, 9, 30 - mapgroup ROUTE_14, 18, 10 - mapgroup ROUTE_15, 9, 20 - mapgroup ROUTE_18, 9, 10 - mapgroup FUCHSIA_CITY, 18, 20 - mapgroup FUCHSIA_MART, 4, 6 - mapgroup SAFARI_ZONE_MAIN_OFFICE, 4, 4 - mapgroup FUCHSIA_GYM, 9, 5 - mapgroup FUCHSIA_BILL_SPEECH_HOUSE, 4, 4 - mapgroup FUCHSIA_POKECENTER_1F, 4, 5 - mapgroup FUCHSIA_POKECENTER_2F_BETA, 4, 8 - mapgroup SAFARI_ZONE_WARDENS_HOME, 4, 5 - mapgroup ROUTE_15_FUCHSIA_GATE, 4, 5 + newgroup ; 9 - newgroup - mapgroup ROUTE_8, 9, 20 - mapgroup ROUTE_12, 27, 10 - mapgroup ROUTE_10_SOUTH, 9, 10 - mapgroup LAVENDER_TOWN, 9, 10 - mapgroup LAVENDER_POKECENTER_1F, 4, 5 - mapgroup LAVENDER_POKECENTER_2F_BETA, 4, 8 - mapgroup MR_FUJIS_HOUSE, 4, 5 - mapgroup LAVENDER_TOWN_SPEECH_HOUSE, 4, 4 - mapgroup LAVENDER_NAME_RATER, 4, 4 - mapgroup LAVENDER_MART, 4, 6 - mapgroup SOUL_HOUSE, 4, 5 - mapgroup LAV_RADIO_TOWER_1F, 4, 10 - mapgroup ROUTE_8_SAFFRON_GATE, 4, 5 - mapgroup ROUTE_12_SUPER_ROD_HOUSE, 4, 4 + mapgroup LAKE_OF_RAGE_HIDDEN_POWER_HOUSE, 4, 4 ; 1 + mapgroup LAKE_OF_RAGE_MAGIKARP_HOUSE, 4, 4 ; 2 + mapgroup ROUTE_43_MAHOGANY_GATE, 4, 5 ; 3 + mapgroup ROUTE_43_GATE, 4, 5 ; 4 + mapgroup ROUTE_43, 27, 10 ; 5 + mapgroup LAKE_OF_RAGE, 18, 20 ; 6 - newgroup - mapgroup ROUTE_28, 9, 20 - mapgroup SILVER_CAVE_OUTSIDE, 18, 20 - mapgroup SILVER_CAVE_POKECENTER_1F, 4, 5 - mapgroup ROUTE_28_FAMOUS_SPEECH_HOUSE, 4, 4 + newgroup ; 10 - newgroup - mapgroup POKECENTER_2F, 4, 8 - mapgroup TRADE_CENTER, 4, 5 - mapgroup COLOSSEUM, 4, 5 - mapgroup TIME_CAPSULE, 4, 5 - mapgroup MOBILE_TRADE_ROOM_MOBILE, 4, 5 - mapgroup MOBILE_BATTLE_ROOM, 4, 5 + mapgroup ROUTE_32, 45, 10 ; 1 + mapgroup ROUTE_35, 18, 10 ; 2 + mapgroup ROUTE_36, 9, 30 ; 3 + mapgroup ROUTE_37, 9, 10 ; 4 + mapgroup VIOLET_CITY, 18, 20 ; 5 + mapgroup VIOLET_MART, 4, 6 ; 6 + mapgroup VIOLET_GYM, 8, 5 ; 7 + mapgroup EARLS_POKEMON_ACADEMY, 8, 4 ; 8 + mapgroup VIOLET_NICKNAME_SPEECH_HOUSE, 4, 4 ; 9 + mapgroup VIOLET_POKECENTER_1F, 4, 5 ; 10 + mapgroup VIOLET_ONIX_TRADE_HOUSE, 4, 4 ; 11 + mapgroup ROUTE_32_RUINS_OF_ALPH_GATE, 4, 5 ; 12 + mapgroup ROUTE_32_POKECENTER_1F, 4, 5 ; 13 + mapgroup ROUTE_35_GOLDENROD_GATE, 4, 5 ; 14 + mapgroup ROUTE_35_NATIONAL_PARK_GATE, 4, 4 ; 15 + mapgroup ROUTE_36_RUINS_OF_ALPH_GATE, 4, 5 ; 16 + mapgroup ROUTE_36_NATIONAL_PARK_GATE, 4, 5 ; 17 - newgroup - mapgroup ROUTE_7, 9, 10 - mapgroup ROUTE_16, 9, 10 - mapgroup ROUTE_17, 45, 10 - mapgroup CELADON_CITY, 18, 20 - mapgroup CELADON_DEPT_STORE_1F, 4, 8 - mapgroup CELADON_DEPT_STORE_2F, 4, 8 - mapgroup CELADON_DEPT_STORE_3F, 4, 8 - mapgroup CELADON_DEPT_STORE_4F, 4, 8 - mapgroup CELADON_DEPT_STORE_5F, 4, 8 - mapgroup CELADON_DEPT_STORE_6F, 4, 8 - mapgroup CELADON_DEPT_STORE_ELEVATOR, 2, 2 - mapgroup CELADON_MANSION_1F, 5, 4 - mapgroup CELADON_MANSION_2F, 5, 4 - mapgroup CELADON_MANSION_3F, 5, 4 - mapgroup CELADON_MANSION_ROOF, 5, 4 - mapgroup CELADON_MANSION_ROOF_HOUSE, 4, 4 - mapgroup CELADON_POKECENTER_1F, 4, 5 - mapgroup CELADON_POKECENTER_2F_BETA, 4, 8 - mapgroup CELADON_GAME_CORNER, 7, 10 - mapgroup CELADON_GAME_CORNER_PRIZE_ROOM, 3, 3 - mapgroup CELADON_GYM, 9, 5 - mapgroup CELADON_CAFE, 4, 6 - mapgroup ROUTE_16_FUCHSIA_SPEECH_HOUSE, 4, 4 - mapgroup ROUTE_16_GATE, 4, 5 - mapgroup ROUTE_7_SAFFRON_GATE, 4, 5 - mapgroup ROUTE_17_18_GATE, 4, 5 + newgroup ; 11 - newgroup - mapgroup ROUTE_40, 18, 10 - mapgroup ROUTE_41, 27, 25 - mapgroup CIANWOOD_CITY, 27, 15 - mapgroup MANIAS_HOUSE, 4, 4 - mapgroup CIANWOOD_GYM, 9, 5 - mapgroup CIANWOOD_POKECENTER_1F, 4, 5 - mapgroup CIANWOOD_PHARMACY, 4, 4 - mapgroup CIANWOOD_CITY_PHOTO_STUDIO, 4, 4 - mapgroup CIANWOOD_LUGIA_SPEECH_HOUSE, 4, 4 - mapgroup POKE_SEERS_HOUSE, 4, 4 - mapgroup BATTLE_TOWER_1F, 5, 8 - mapgroup BATTLE_TOWER_BATTLE_ROOM, 4, 4 - mapgroup BATTLE_TOWER_ELEVATOR, 2, 2 - mapgroup BATTLE_TOWER_HALLWAY, 2, 11 - mapgroup ROUTE_40_BATTLE_TOWER_GATE, 4, 5 - mapgroup BATTLE_TOWER_OUTSIDE, 14, 10 + mapgroup ROUTE_34, 27, 10 ; 1 + mapgroup GOLDENROD_CITY, 18, 20 ; 2 + mapgroup GOLDENROD_GYM, 9, 10 ; 3 + mapgroup GOLDENROD_BIKE_SHOP, 4, 4 ; 4 + mapgroup GOLDENROD_HAPPINESS_RATER, 4, 4 ; 5 + mapgroup GOLDENROD_BILLS_HOUSE, 4, 4 ; 6 + mapgroup GOLDENROD_MAGNET_TRAIN_STATION, 9, 10 ; 7 + mapgroup GOLDENROD_FLOWER_SHOP, 4, 4 ; 8 + mapgroup GOLDENROD_PP_SPEECH_HOUSE, 4, 4 ; 9 + mapgroup GOLDENROD_NAME_RATERS_HOUSE, 4, 4 ; 10 + mapgroup GOLDENROD_DEPT_STORE_1F, 4, 8 ; 11 + mapgroup GOLDENROD_DEPT_STORE_2F, 4, 8 ; 12 + mapgroup GOLDENROD_DEPT_STORE_3F, 4, 8 ; 13 + mapgroup GOLDENROD_DEPT_STORE_4F, 4, 8 ; 14 + mapgroup GOLDENROD_DEPT_STORE_5F, 4, 8 ; 15 + mapgroup GOLDENROD_DEPT_STORE_6F, 4, 8 ; 16 + mapgroup GOLDENROD_DEPT_STORE_ELEVATOR, 2, 2 ; 17 + mapgroup GOLDENROD_DEPT_STORE_ROOF, 4, 8 ; 18 + mapgroup GOLDENROD_GAME_CORNER, 7, 10 ; 19 + mapgroup GOLDENROD_POKECENTER_1F, 4, 5 ; 20 + mapgroup GOLDENROD_POKECOM_CENTER_2F_MOBILE, 16, 16 ; 21 + mapgroup ILEX_FOREST_AZALEA_GATE, 4, 5 ; 22 + mapgroup ROUTE_34_ILEX_FOREST_GATE, 4, 5 ; 23 + mapgroup DAYCARE, 4, 5 ; 24 - newgroup - mapgroup ROUTE_2, 27, 10 - mapgroup ROUTE_22, 9, 20 - mapgroup VIRIDIAN_CITY, 18, 20 - mapgroup VIRIDIAN_GYM, 9, 5 - mapgroup VIRIDIAN_NICKNAME_SPEECH_HOUSE, 4, 4 - mapgroup TRAINER_HOUSE_1F, 7, 5 - mapgroup TRAINER_HOUSE_B1F, 8, 5 - mapgroup VIRIDIAN_MART, 4, 6 - mapgroup VIRIDIAN_POKECENTER_1F, 4, 5 - mapgroup VIRIDIAN_POKECENTER_2F_BETA, 4, 8 - mapgroup ROUTE_2_NUGGET_SPEECH_HOUSE, 4, 4 - mapgroup ROUTE_2_GATE, 4, 5 - mapgroup VICTORY_ROAD_GATE, 9, 10 + newgroup ; 12 - newgroup - mapgroup ROUTE_26, 54, 10 - mapgroup ROUTE_27, 9, 40 - mapgroup ROUTE_29, 9, 30 - mapgroup NEW_BARK_TOWN, 9, 10 - mapgroup ELMS_LAB, 6, 5 - mapgroup KRISS_HOUSE_1F, 4, 5 - mapgroup KRISS_HOUSE_2F, 3, 4 - mapgroup KRISS_NEIGHBORS_HOUSE, 4, 4 - mapgroup ELMS_HOUSE, 4, 4 - mapgroup ROUTE_26_HEAL_SPEECH_HOUSE, 4, 4 - mapgroup ROUTE_26_DAY_OF_WEEK_SIBLINGS_HOUSE, 4, 4 - mapgroup ROUTE_27_SANDSTORM_HOUSE, 4, 4 - mapgroup ROUTE_29_46_GATE, 4, 5 + mapgroup ROUTE_6, 9, 10 ; 1 + mapgroup ROUTE_11, 9, 20 ; 2 + mapgroup VERMILION_CITY, 18, 20 ; 3 + mapgroup VERMILION_HOUSE_FISHING_SPEECH_HOUSE, 4, 4 ; 4 + mapgroup VERMILION_POKECENTER_1F, 4, 5 ; 5 + mapgroup VERMILION_POKECENTER_2F_BETA, 4, 8 ; 6 + mapgroup POKEMON_FAN_CLUB, 4, 5 ; 7 + mapgroup VERMILION_MAGNET_TRAIN_SPEECH_HOUSE, 4, 4 ; 8 + mapgroup VERMILION_MART, 4, 6 ; 9 + mapgroup VERMILION_HOUSE_DIGLETTS_CAVE_SPEECH_HOUSE, 4, 4 ; 10 + mapgroup VERMILION_GYM, 9, 5 ; 11 + mapgroup ROUTE_6_SAFFRON_GATE, 4, 5 ; 12 + mapgroup ROUTE_6_UNDERGROUND_ENTRANCE, 4, 4 ; 13 - newgroup - mapgroup ROUTE_5, 9, 10 - mapgroup SAFFRON_CITY, 18, 20 - mapgroup FIGHTING_DOJO, 6, 5 - mapgroup SAFFRON_GYM, 9, 10 - mapgroup SAFFRON_MART, 4, 6 - mapgroup SAFFRON_POKECENTER_1F, 4, 5 - mapgroup SAFFRON_POKECENTER_2F_BETA, 4, 8 - mapgroup MR_PSYCHICS_HOUSE, 4, 4 - mapgroup SAFFRON_TRAIN_STATION, 9, 10 - mapgroup SILPH_CO_1F, 4, 8 - mapgroup COPYCATS_HOUSE_1F, 4, 4 - mapgroup COPYCATS_HOUSE_2F, 3, 5 - mapgroup ROUTE_5_UNDERGROUND_ENTRANCE, 4, 4 - mapgroup ROUTE_5_SAFFRON_CITY_GATE, 4, 5 - mapgroup ROUTE_5_CLEANSE_TAG_SPEECH_HOUSE, 4, 4 + newgroup ; 13 + + mapgroup ROUTE_1, 18, 10 ; 1 + mapgroup PALLET_TOWN, 9, 10 ; 2 + mapgroup REDS_HOUSE_1F, 4, 4 ; 3 + mapgroup REDS_HOUSE_2F, 4, 4 ; 4 + mapgroup BLUES_HOUSE, 4, 4 ; 5 + mapgroup OAKS_LAB, 6, 5 ; 6 + + newgroup ; 14 + + mapgroup ROUTE_3, 9, 30 ; 1 + mapgroup PEWTER_CITY, 18, 20 ; 2 + mapgroup PEWTER_NIDORAN_SPEECH_HOUSE, 4, 4 ; 3 + mapgroup PEWTER_GYM, 7, 5 ; 4 + mapgroup PEWTER_MART, 4, 6 ; 5 + mapgroup PEWTER_POKECENTER_1F, 4, 5 ; 6 + mapgroup PEWTER_POKECENTER_2F_BETA, 4, 8 ; 7 + mapgroup PEWTER_SNOOZE_SPEECH_HOUSE, 4, 4 ; 8 + + newgroup ; 15 + + mapgroup OLIVINE_PORT, 18, 10 ; 1 + mapgroup VERMILION_PORT, 18, 10 ; 2 + mapgroup FAST_SHIP_1F, 9, 16 ; 3 + mapgroup FAST_SHIP_CABINS_NNW_NNE_NE, 16, 4 ; 4 + mapgroup FAST_SHIP_CABINS_SW_SSW_NW, 16, 4 ; 5 + mapgroup FAST_SHIP_CABINS_SE_SSE_CAPTAINS_CABIN, 17, 5 ; 6 + mapgroup FAST_SHIP_B1F, 8, 16 ; 7 + mapgroup OLIVINE_PORT_PASSAGE, 9, 10 ; 8 + mapgroup VERMILION_PORT_PASSAGE, 9, 10 ; 9 + mapgroup MOUNT_MOON_SQUARE, 9, 15 ; 10 + mapgroup MOUNT_MOON_GIFT_SHOP, 4, 4 ; 11 + mapgroup TIN_TOWER_ROOF, 9, 10 ; 12 + + newgroup ; 16 + + mapgroup ROUTE_23, 9, 10 ; 1 + mapgroup INDIGO_PLATEAU_POKECENTER_1F, 7, 9 ; 2 + mapgroup WILLS_ROOM, 9, 5 ; 3 + mapgroup KOGAS_ROOM, 9, 5 ; 4 + mapgroup BRUNOS_ROOM, 9, 5 ; 5 + mapgroup KARENS_ROOM, 9, 5 ; 6 + mapgroup LANCES_ROOM, 12, 5 ; 7 + mapgroup HALL_OF_FAME, 7, 5 ; 8 + + newgroup ; 17 + + mapgroup ROUTE_13, 9, 30 ; 1 + mapgroup ROUTE_14, 18, 10 ; 2 + mapgroup ROUTE_15, 9, 20 ; 3 + mapgroup ROUTE_18, 9, 10 ; 4 + mapgroup FUCHSIA_CITY, 18, 20 ; 5 + mapgroup FUCHSIA_MART, 4, 6 ; 6 + mapgroup SAFARI_ZONE_MAIN_OFFICE, 4, 4 ; 7 + mapgroup FUCHSIA_GYM, 9, 5 ; 8 + mapgroup FUCHSIA_BILL_SPEECH_HOUSE, 4, 4 ; 9 + mapgroup FUCHSIA_POKECENTER_1F, 4, 5 ; 10 + mapgroup FUCHSIA_POKECENTER_2F_BETA, 4, 8 ; 11 + mapgroup SAFARI_ZONE_WARDENS_HOME, 4, 5 ; 12 + mapgroup ROUTE_15_FUCHSIA_GATE, 4, 5 ; 13 + + newgroup ; 18 + + mapgroup ROUTE_8, 9, 20 ; 1 + mapgroup ROUTE_12, 27, 10 ; 2 + mapgroup ROUTE_10_SOUTH, 9, 10 ; 3 + mapgroup LAVENDER_TOWN, 9, 10 ; 4 + mapgroup LAVENDER_POKECENTER_1F, 4, 5 ; 5 + mapgroup LAVENDER_POKECENTER_2F_BETA, 4, 8 ; 6 + mapgroup MR_FUJIS_HOUSE, 4, 5 ; 7 + mapgroup LAVENDER_TOWN_SPEECH_HOUSE, 4, 4 ; 8 + mapgroup LAVENDER_NAME_RATER, 4, 4 ; 9 + mapgroup LAVENDER_MART, 4, 6 ; 10 + mapgroup SOUL_HOUSE, 4, 5 ; 11 + mapgroup LAV_RADIO_TOWER_1F, 4, 10 ; 12 + mapgroup ROUTE_8_SAFFRON_GATE, 4, 5 ; 13 + mapgroup ROUTE_12_SUPER_ROD_HOUSE, 4, 4 ; 14 + + newgroup ; 19 + + mapgroup ROUTE_28, 9, 20 ; 1 + mapgroup SILVER_CAVE_OUTSIDE, 18, 20 ; 2 + mapgroup SILVER_CAVE_POKECENTER_1F, 4, 5 ; 3 + mapgroup ROUTE_28_FAMOUS_SPEECH_HOUSE, 4, 4 ; 4 + + newgroup ; 20 + + mapgroup POKECENTER_2F, 4, 8 ; 1 + mapgroup TRADE_CENTER, 4, 5 ; 2 + mapgroup COLOSSEUM, 4, 5 ; 3 + mapgroup TIME_CAPSULE, 4, 5 ; 4 + mapgroup MOBILE_TRADE_ROOM_MOBILE, 4, 5 ; 5 + mapgroup MOBILE_BATTLE_ROOM, 4, 5 ; 6 + + newgroup ; 21 + + mapgroup ROUTE_7, 9, 10 ; 1 + mapgroup ROUTE_16, 9, 10 ; 2 + mapgroup ROUTE_17, 45, 10 ; 3 + mapgroup CELADON_CITY, 18, 20 ; 4 + mapgroup CELADON_DEPT_STORE_1F, 4, 8 ; 5 + mapgroup CELADON_DEPT_STORE_2F, 4, 8 ; 6 + mapgroup CELADON_DEPT_STORE_3F, 4, 8 ; 7 + mapgroup CELADON_DEPT_STORE_4F, 4, 8 ; 8 + mapgroup CELADON_DEPT_STORE_5F, 4, 8 ; 9 + mapgroup CELADON_DEPT_STORE_6F, 4, 8 ; 10 + mapgroup CELADON_DEPT_STORE_ELEVATOR, 2, 2 ; 11 + mapgroup CELADON_MANSION_1F, 5, 4 ; 12 + mapgroup CELADON_MANSION_2F, 5, 4 ; 13 + mapgroup CELADON_MANSION_3F, 5, 4 ; 14 + mapgroup CELADON_MANSION_ROOF, 5, 4 ; 15 + mapgroup CELADON_MANSION_ROOF_HOUSE, 4, 4 ; 16 + mapgroup CELADON_POKECENTER_1F, 4, 5 ; 17 + mapgroup CELADON_POKECENTER_2F_BETA, 4, 8 ; 18 + mapgroup CELADON_GAME_CORNER, 7, 10 ; 19 + mapgroup CELADON_GAME_CORNER_PRIZE_ROOM, 3, 3 ; 20 + mapgroup CELADON_GYM, 9, 5 ; 21 + mapgroup CELADON_CAFE, 4, 6 ; 22 + mapgroup ROUTE_16_FUCHSIA_SPEECH_HOUSE, 4, 4 ; 23 + mapgroup ROUTE_16_GATE, 4, 5 ; 24 + mapgroup ROUTE_7_SAFFRON_GATE, 4, 5 ; 25 + mapgroup ROUTE_17_18_GATE, 4, 5 ; 26 + + newgroup ; 22 + + mapgroup ROUTE_40, 18, 10 ; 1 + mapgroup ROUTE_41, 27, 25 ; 2 + mapgroup CIANWOOD_CITY, 27, 15 ; 3 + mapgroup MANIAS_HOUSE, 4, 4 ; 4 + mapgroup CIANWOOD_GYM, 9, 5 ; 5 + mapgroup CIANWOOD_POKECENTER_1F, 4, 5 ; 6 + mapgroup CIANWOOD_PHARMACY, 4, 4 ; 7 + mapgroup CIANWOOD_CITY_PHOTO_STUDIO, 4, 4 ; 8 + mapgroup CIANWOOD_LUGIA_SPEECH_HOUSE, 4, 4 ; 9 + mapgroup POKE_SEERS_HOUSE, 4, 4 ; 10 + mapgroup BATTLE_TOWER_1F, 5, 8 ; 11 + mapgroup BATTLE_TOWER_BATTLE_ROOM, 4, 4 ; 12 + mapgroup BATTLE_TOWER_ELEVATOR, 2, 2 ; 13 + mapgroup BATTLE_TOWER_HALLWAY, 2, 11 ; 14 + mapgroup ROUTE_40_BATTLE_TOWER_GATE, 4, 5 ; 15 + mapgroup BATTLE_TOWER_OUTSIDE, 14, 10 ; 16 + + newgroup ; 23 + + mapgroup ROUTE_2, 27, 10 ; 1 + mapgroup ROUTE_22, 9, 20 ; 2 + mapgroup VIRIDIAN_CITY, 18, 20 ; 3 + mapgroup VIRIDIAN_GYM, 9, 5 ; 4 + mapgroup VIRIDIAN_NICKNAME_SPEECH_HOUSE, 4, 4 ; 5 + mapgroup TRAINER_HOUSE_1F, 7, 5 ; 6 + mapgroup TRAINER_HOUSE_B1F, 8, 5 ; 7 + mapgroup VIRIDIAN_MART, 4, 6 ; 8 + mapgroup VIRIDIAN_POKECENTER_1F, 4, 5 ; 9 + mapgroup VIRIDIAN_POKECENTER_2F_BETA, 4, 8 ; 10 + mapgroup ROUTE_2_NUGGET_SPEECH_HOUSE, 4, 4 ; 11 + mapgroup ROUTE_2_GATE, 4, 5 ; 12 + mapgroup VICTORY_ROAD_GATE, 9, 10 ; 13 + + newgroup ; 24 + + mapgroup ROUTE_26, 54, 10 ; 1 + mapgroup ROUTE_27, 9, 40 ; 2 + mapgroup ROUTE_29, 9, 30 ; 3 + mapgroup NEW_BARK_TOWN, 9, 10 ; 4 + mapgroup ELMS_LAB, 6, 5 ; 5 + mapgroup KRISS_HOUSE_1F, 4, 5 ; 6 + mapgroup KRISS_HOUSE_2F, 3, 4 ; 7 + mapgroup KRISS_NEIGHBORS_HOUSE, 4, 4 ; 8 + mapgroup ELMS_HOUSE, 4, 4 ; 9 + mapgroup ROUTE_26_HEAL_SPEECH_HOUSE, 4, 4 ; 10 + mapgroup ROUTE_26_DAY_OF_WEEK_SIBLINGS_HOUSE, 4, 4 ; 11 + mapgroup ROUTE_27_SANDSTORM_HOUSE, 4, 4 ; 12 + mapgroup ROUTE_29_46_GATE, 4, 5 ; 13 + + newgroup ; 25 + + mapgroup ROUTE_5, 9, 10 ; 1 + mapgroup SAFFRON_CITY, 18, 20 ; 2 + mapgroup FIGHTING_DOJO, 6, 5 ; 3 + mapgroup SAFFRON_GYM, 9, 10 ; 4 + mapgroup SAFFRON_MART, 4, 6 ; 5 + mapgroup SAFFRON_POKECENTER_1F, 4, 5 ; 6 + mapgroup SAFFRON_POKECENTER_2F_BETA, 4, 8 ; 7 + mapgroup MR_PSYCHICS_HOUSE, 4, 4 ; 8 + mapgroup SAFFRON_TRAIN_STATION, 9, 10 ; 9 + mapgroup SILPH_CO_1F, 4, 8 ; 10 + mapgroup COPYCATS_HOUSE_1F, 4, 4 ; 11 + mapgroup COPYCATS_HOUSE_2F, 3, 5 ; 12 + mapgroup ROUTE_5_UNDERGROUND_ENTRANCE, 4, 4 ; 13 + mapgroup ROUTE_5_SAFFRON_CITY_GATE, 4, 5 ; 14 + mapgroup ROUTE_5_CLEANSE_TAG_SPEECH_HOUSE, 4, 4 ; 15 + + newgroup ; 26 + + mapgroup ROUTE_30, 27, 10 ; 1 + mapgroup ROUTE_31, 9, 20 ; 2 + mapgroup CHERRYGROVE_CITY, 9, 20 ; 3 + mapgroup CHERRYGROVE_MART, 4, 6 ; 4 + mapgroup CHERRYGROVE_POKECENTER_1F, 4, 5 ; 5 + mapgroup CHERRYGROVE_GYM_SPEECH_HOUSE, 4, 4 ; 6 + mapgroup GUIDE_GENTS_HOUSE, 4, 4 ; 7 + mapgroup CHERRYGROVE_EVOLUTION_SPEECH_HOUSE, 4, 4 ; 8 + mapgroup ROUTE_30_BERRY_SPEECH_HOUSE, 4, 4 ; 9 + mapgroup MR_POKEMONS_HOUSE, 4, 4 ; 10 + mapgroup ROUTE_31_VIOLET_GATE, 4, 5 ; 11 - newgroup - mapgroup ROUTE_30, 27, 10 - mapgroup ROUTE_31, 9, 20 - mapgroup CHERRYGROVE_CITY, 9, 20 - mapgroup CHERRYGROVE_MART, 4, 6 - mapgroup CHERRYGROVE_POKECENTER_1F, 4, 5 - mapgroup CHERRYGROVE_GYM_SPEECH_HOUSE, 4, 4 - mapgroup GUIDE_GENTS_HOUSE, 4, 4 - mapgroup CHERRYGROVE_EVOLUTION_SPEECH_HOUSE, 4, 4 - mapgroup ROUTE_30_BERRY_SPEECH_HOUSE, 4, 4 - mapgroup MR_POKEMONS_HOUSE, 4, 4 - mapgroup ROUTE_31_VIOLET_GATE, 4, 5 ; elevator floors @@ -474,188 +501,6 @@ MAP_NONE EQU 0 shift_const SOUTH shift_const NORTH -; sprites - const_def - const SPRITE_NONE ; 00 - const SPRITE_CHRIS ; 01 - const SPRITE_CHRIS_BIKE ; 02 - const SPRITE_GAMEBOY_KID ; 03 - const SPRITE_SILVER ; 04 - const SPRITE_OAK ; 05 - const SPRITE_RED ; 06 - const SPRITE_BLUE ; 07 - const SPRITE_BILL ; 08 - const SPRITE_ELDER ; 09 - const SPRITE_JANINE ; 0a - const SPRITE_KURT ; 0b - const SPRITE_MOM ; 0c - const SPRITE_BLAINE ; 0d - const SPRITE_REDS_MOM ; 0e - const SPRITE_DAISY ; 0f - const SPRITE_ELM ; 10 - const SPRITE_WILL ; 11 - const SPRITE_FALKNER ; 12 - const SPRITE_WHITNEY ; 13 - const SPRITE_BUGSY ; 14 - const SPRITE_MORTY ; 15 - const SPRITE_CHUCK ; 16 - const SPRITE_JASMINE ; 17 - const SPRITE_PRYCE ; 18 - const SPRITE_CLAIR ; 19 - const SPRITE_BROCK ; 1a - const SPRITE_KAREN ; 1b - const SPRITE_BRUNO ; 1c - const SPRITE_MISTY ; 1d - const SPRITE_LANCE ; 1e - const SPRITE_SURGE ; 1f - const SPRITE_ERIKA ; 20 - const SPRITE_KOGA ; 21 - const SPRITE_SABRINA ; 22 - const SPRITE_COOLTRAINER_M ; 23 - const SPRITE_COOLTRAINER_F ; 24 - const SPRITE_BUG_CATCHER ; 25 - const SPRITE_TWIN ; 26 - const SPRITE_YOUNGSTER ; 27 - const SPRITE_LASS ; 28 - const SPRITE_TEACHER ; 29 - const SPRITE_BUENA ; 2a - const SPRITE_SUPER_NERD ; 2b - const SPRITE_ROCKER ; 2c - const SPRITE_POKEFAN_M ; 2d - const SPRITE_POKEFAN_F ; 2e - const SPRITE_GRAMPS ; 2f - const SPRITE_GRANNY ; 30 - const SPRITE_SWIMMER_GUY ; 31 - const SPRITE_SWIMMER_GIRL ; 32 - const SPRITE_BIG_SNORLAX ; 33 - const SPRITE_SURFING_PIKACHU ; 34 - const SPRITE_ROCKET ; 35 - const SPRITE_ROCKET_GIRL ; 36 - const SPRITE_NURSE ; 37 - const SPRITE_LINK_RECEPTIONIST ; 38 - const SPRITE_CLERK ; 39 - const SPRITE_FISHER ; 3a - const SPRITE_FISHING_GURU ; 3b - const SPRITE_SCIENTIST ; 3c - const SPRITE_KIMONO_GIRL ; 3d - const SPRITE_SAGE ; 3e - const SPRITE_UNUSED_GUY ; 3f - const SPRITE_GENTLEMAN ; 40 - const SPRITE_BLACK_BELT ; 41 - const SPRITE_RECEPTIONIST ; 42 - const SPRITE_OFFICER ; 43 - const SPRITE_CAL ; 44 - const SPRITE_SLOWPOKE ; 45 - const SPRITE_CAPTAIN ; 46 - const SPRITE_BIG_LAPRAS ; 47 - const SPRITE_GYM_GUY ; 48 - const SPRITE_SAILOR ; 49 - const SPRITE_BIKER ; 4a - const SPRITE_PHARMACIST ; 4b - const SPRITE_MONSTER ; 4c - const SPRITE_FAIRY ; 4d - const SPRITE_BIRD ; 4e - const SPRITE_DRAGON ; 4f - const SPRITE_BIG_ONIX ; 50 - const SPRITE_N64 ; 51 - const SPRITE_SUDOWOODO ; 52 - const SPRITE_SURF ; 53 - const SPRITE_POKE_BALL ; 54 - const SPRITE_POKEDEX ; 55 - const SPRITE_PAPER ; 56 - const SPRITE_VIRTUAL_BOY ; 57 - const SPRITE_OLD_LINK_RECEPTIONIST ; 58 - const SPRITE_ROCK ; 59 - const SPRITE_BOULDER ; 5a - const SPRITE_SNES ; 5b - const SPRITE_FAMICOM ; 5c - const SPRITE_FRUIT_TREE ; 5d - const SPRITE_GOLD_TROPHY ; 5e - const SPRITE_SILVER_TROPHY ; 5f - const SPRITE_KRIS ; 60 - const SPRITE_KRIS_BIKE ; 61 - const SPRITE_KURT_OUTSIDE ; 62 - const SPRITE_SUICUNE ; 63 - const SPRITE_ENTEI ; 64 - const SPRITE_RAIKOU ; 65 - const SPRITE_STANDING_YOUNGSTER ; 66 - -const_value SET $80 - -SPRITE_POKEMON EQU const_value - const SPRITE_UNOWN ; 80 - const SPRITE_GEODUDE ; 81 - const SPRITE_GROWLITHE ; 82 - const SPRITE_WEEDLE ; 83 - const SPRITE_SHELLDER ; 84 - const SPRITE_ODDISH ; 85 - const SPRITE_GENGAR ; 86 - const SPRITE_ZUBAT ; 87 - const SPRITE_MAGIKARP ; 88 - const SPRITE_SQUIRTLE ; 89 - const SPRITE_TOGEPI ; 8a - const SPRITE_BUTTERFREE ; 8b - const SPRITE_DIGLETT ; 8c - const SPRITE_POLIWAG ; 8d - const SPRITE_PIKACHU ; 8e - const SPRITE_CLEFAIRY ; 8f - const SPRITE_CHARMANDER ; 90 - const SPRITE_JYNX ; 91 - const SPRITE_STARMIE ; 92 - const SPRITE_BULBASAUR ; 93 - const SPRITE_JIGGLYPUFF ; 94 - const SPRITE_GRIMER ; 95 - const SPRITE_EKANS ; 96 - const SPRITE_PARAS ; 97 - const SPRITE_TENTACOOL ; 98 - const SPRITE_TAUROS ; 99 - const SPRITE_MACHOP ; 9a - const SPRITE_VOLTORB ; 9b - const SPRITE_LAPRAS ; 9c - const SPRITE_RHYDON ; 9d - const SPRITE_MOLTRES ; 9e - const SPRITE_SNORLAX ; 9f - const SPRITE_GYARADOS ; a0 - const SPRITE_LUGIA ; a1 - const SPRITE_HO_OH ; a2 - -const_value SET $e0 - const SPRITE_DAYCARE_MON_1 ; e0 - const SPRITE_DAYCARE_MON_2 ; e1 - -const_value SET $f0 -SPRITE_VARS EQU const_value - const SPRITE_CONSOLE ; f0 - const SPRITE_DOLL_1 ; f1 - const SPRITE_DOLL_2 ; f2 - const SPRITE_BIG_DOLL ; f3 - const SPRITE_WEIRD_TREE ; f4 - const SPRITE_OLIVINE_RIVAL ; f5 - const SPRITE_AZALEA_ROCKET ; f6 - const SPRITE_FUCHSIA_GYM_1 ; f7 - const SPRITE_FUCHSIA_GYM_2 ; f8 - const SPRITE_FUCHSIA_GYM_3 ; f9 - const SPRITE_FUCHSIA_GYM_4 ; fa - const SPRITE_COPYCAT ; fb - const SPRITE_JANINE_IMPERSONATOR ; fc - -; sprite types -const_value SET 1 - const WALKING_SPRITE - const STANDING_SPRITE - const STILL_SPRITE - -; sprite palettes - const_def - const PAL_OW_RED - const PAL_OW_BLUE - const PAL_OW_GREEN - const PAL_OW_BROWN - const PAL_OW_PINK - const PAL_OW_SILVER - const PAL_OW_TREE - const PAL_OW_ROCK - ; permissions const_value SET 1 const TOWN @@ -795,42 +640,6 @@ const_value = -1 const SPAWN_FAST_SHIP NUM_SPAWNS EQU const_value - const_def - const SPRITEMOVEFN_00 - const SPRITEMOVEFN_01 - const SPRITEMOVEFN_02 - const SPRITEMOVEFN_03 - const SPRITEMOVEFN_04 - const SPRITEMOVEFN_05 - const SPRITEMOVEFN_06 - const SPRITEMOVEFN_07 - const SPRITEMOVEFN_08 - const SPRITEMOVEFN_09 - const SPRITEMOVEFN_0A - const SPRITEMOVEFN_0B - const SPRITEMOVEFN_0C - const SPRITEMOVEFN_0D - const SPRITEMOVEFN_0E - const SPRITEMOVEFN_0F - const SPRITEMOVEFN_10 - const SPRITEMOVEFN_11 - const SPRITEMOVEFN_12 - const SPRITEMOVEFN_13 - const SPRITEMOVEFN_14 - const SPRITEMOVEFN_15 - const SPRITEMOVEFN_16 - const SPRITEMOVEFN_17 - const SPRITEMOVEFN_18 - const SPRITEMOVEFN_19 - const SPRITEMOVEFN_1A - const SPRITEMOVEFN_1B - const SPRITEMOVEFN_1C - const SPRITEMOVEFN_1D - const SPRITEMOVEFN_1E - const SPRITEMOVEFN_1F - const SPRITEMOVEFN_20 - const SPRITEMOVEFN_21 - const_def const PALETTE_AUTO const PALETTE_DAY diff --git a/constants/map_setup_constants.asm b/constants/map_setup_constants.asm new file mode 100644 index 000000000..e3088496f --- /dev/null +++ b/constants/map_setup_constants.asm @@ -0,0 +1,64 @@ +const_value SET $f0 + const MAPSETUP_00 + const MAPSETUP_WARP + const MAPSETUP_02 + const MAPSETUP_RELOADMAP + const MAPSETUP_04 + const MAPSETUP_05 + const MAPSETUP_06 + const MAPSETUP_07 + const MAPSETUP_08 + const MAPSETUP_09 + const MAPSETUP_10 + const MAPSETUP_BADWARP + +; Command descriptions from Condensation water's scripting compendium. const_def + const_def + + const map_lcd_on + const map_lcd_off + const map_sound_off + const map_music + const map_start_music + const map_fade_music + const map_fade + const map_bike_music + const map_music_force + const map_max_volume + const map_load_blocks + const map_connection_blocks + const map_save_screen + const map_buffer_screen + const map_load_graphics + const map_load_tileset_header + const map_time_of_day + const map_palettes + const map_wildmons + const map_sprites + const map_change_callback + const map_start_callback + const map_load_objects + const map_load_spawn + const map_load_connection + const map_load_warp + const map_attributes + const map_attributes_2 + const map_clear_bg_palettes + const map_fade_out_palettes + const map_fade_in_palettes + const map_anchor_screen + const map_warp_face + const map_face_down + const map_spawn_coord + const map_player_coord + const map_prolong_sprites + const map_delay_sprites + const map_update_roam + const map_keep_roam + const map_fade_out_music + const map_animations_on + const map_animations_off + const map_keep_palettes + const map_text_scroll_off + const map_stop_script +map_end_setup_script EQU -1 diff --git a/constants/misc_constants.asm b/constants/misc_constants.asm index 9678faf8a..833c84377 100644 --- a/constants/misc_constants.asm +++ b/constants/misc_constants.asm @@ -46,8 +46,6 @@ CHECK_FLAG EQU 2 ; joypad -BUTTONS EQU %00010000 -D_PAD EQU %00100000 NO_INPUT EQU %00000000 A_BUTTON EQU %00000001 @@ -59,6 +57,11 @@ D_LEFT EQU %00100000 D_UP EQU %01000000 D_DOWN EQU %10000000 +BUTTONS EQU A_BUTTON | B_BUTTON | SELECT | START +D_PAD EQU D_RIGHT | D_LEFT | D_UP | D_DOWN + +R_DPAD EQU %00100000 +R_BUTTONS EQU %00010000 ; screen HP_BAR_LENGTH EQU 6 @@ -146,3 +149,13 @@ const_value = 1 const HAPPINESS_MASSAGE ; 12 const HAPPINESS_GAINLEVELATHOME ; 13 + + const_def + const LINK_NULL + const LINK_TIMECAPSULE + const LINK_TRADECENTER + const LINK_COLOSSEUM + const LINK_MOBILE + +HMENURETURN_SCRIPT EQU %10000000 +HMENURETURN_ASM EQU %11111111 diff --git a/constants/phone_constants.asm b/constants/phone_constants.asm index d49afb253..1eb2b2d23 100644 --- a/constants/phone_constants.asm +++ b/constants/phone_constants.asm @@ -40,13 +40,28 @@ const PHONE_BUENA const_def - const ELMCALL_NONE - const ELMCALL_POKERUS - const ELMCALL_ROBBED - const ELMCALL_ASSISTANT - const ELMCALL_WEIRDBROADCAST - const ELMCALL_SSTICKET - const ELMCALL_UNKNOWN - const MOMCALL_WORRIED - const ELMCALL_MASTERBALL + const SPECIALCALL_NONE + const SPECIALCALL_POKERUS + const SPECIALCALL_ROBBED + const SPECIALCALL_ASSISTANT + const SPECIALCALL_WEIRDBROADCAST + const SPECIALCALL_SSTICKET + const SPECIALCALL_BIKESHOP + const SPECIALCALL_WORRIED + const SPECIALCALL_MASTERBALL + const_def + const PHONE_CONTACT_TRAINER_CLASS + const PHONE_CONTACT_TRAINER_NUMBER + const PHONE_CONTACT_MAP_GROUP + const PHONE_CONTACT_MAP_NUMBER + const PHONE_CONTACT_SCRIPT1_TIME + const PHONE_CONTACT_SCRIPT1_BANK + const PHONE_CONTACT_SCRIPT1_ADDR_LO + const PHONE_CONTACT_SCRIPT1_ADDR_HI + const PHONE_CONTACT_SCRIPT2_TIME + const PHONE_CONTACT_SCRIPT2_BANK + const PHONE_CONTACT_SCRIPT2_ADDR_LO + const PHONE_CONTACT_SCRIPT2_ADDR_HI +PHONE_TABLE_WIDTH EQU const_value +CONTACT_LIST_SIZE EQU 10 diff --git a/constants/script_constants.asm b/constants/script_constants.asm index 484f00dba..191a9c024 100644 --- a/constants/script_constants.asm +++ b/constants/script_constants.asm @@ -5,7 +5,7 @@ LAST_TALKED EQU -2 const_def const VAR_STRINGBUFFER2 const VAR_PARTYCOUNT - const VAR_02 + const VAR_BATTLERESULT const VAR_BATTLETYPE const VAR_TIMEOFDAY const VAR_DEXCAUGHT @@ -23,11 +23,15 @@ LAST_TALKED EQU -2 const VAR_CONTESTMINUTES const VAR_XCOORD const VAR_YCOORD - const VAR_POKERUS + const VAR_SPECIALPHONECALL const VAR_15 - const VAR_16 + const VAR_KURT_APRICORNS const VAR_CALLERID const VAR_BLUECARDBALANCE - const VAR_19 + const VAR_BUENASPASSWORD const VAR_KENJI_BREAK NUM_VARS EQU const_value + +RETVAR_STRBUF2 EQU (0 << 6) +RETVAR_ADDR_DE EQU (1 << 6) +RETVAR_EXECUTE EQU (2 << 6) diff --git a/constants/sprite_constants.asm b/constants/sprite_constants.asm new file mode 100644 index 000000000..f0fb8d6ad --- /dev/null +++ b/constants/sprite_constants.asm @@ -0,0 +1,219 @@ + +; sprites + const_def + const SPRITE_NONE ; 00 + const SPRITE_CHRIS ; 01 + const SPRITE_CHRIS_BIKE ; 02 + const SPRITE_GAMEBOY_KID ; 03 + const SPRITE_SILVER ; 04 + const SPRITE_OAK ; 05 + const SPRITE_RED ; 06 + const SPRITE_BLUE ; 07 + const SPRITE_BILL ; 08 + const SPRITE_ELDER ; 09 + const SPRITE_JANINE ; 0a + const SPRITE_KURT ; 0b + const SPRITE_MOM ; 0c + const SPRITE_BLAINE ; 0d + const SPRITE_REDS_MOM ; 0e + const SPRITE_DAISY ; 0f + const SPRITE_ELM ; 10 + const SPRITE_WILL ; 11 + const SPRITE_FALKNER ; 12 + const SPRITE_WHITNEY ; 13 + const SPRITE_BUGSY ; 14 + const SPRITE_MORTY ; 15 + const SPRITE_CHUCK ; 16 + const SPRITE_JASMINE ; 17 + const SPRITE_PRYCE ; 18 + const SPRITE_CLAIR ; 19 + const SPRITE_BROCK ; 1a + const SPRITE_KAREN ; 1b + const SPRITE_BRUNO ; 1c + const SPRITE_MISTY ; 1d + const SPRITE_LANCE ; 1e + const SPRITE_SURGE ; 1f + const SPRITE_ERIKA ; 20 + const SPRITE_KOGA ; 21 + const SPRITE_SABRINA ; 22 + const SPRITE_COOLTRAINER_M ; 23 + const SPRITE_COOLTRAINER_F ; 24 + const SPRITE_BUG_CATCHER ; 25 + const SPRITE_TWIN ; 26 + const SPRITE_YOUNGSTER ; 27 + const SPRITE_LASS ; 28 + const SPRITE_TEACHER ; 29 + const SPRITE_BUENA ; 2a + const SPRITE_SUPER_NERD ; 2b + const SPRITE_ROCKER ; 2c + const SPRITE_POKEFAN_M ; 2d + const SPRITE_POKEFAN_F ; 2e + const SPRITE_GRAMPS ; 2f + const SPRITE_GRANNY ; 30 + const SPRITE_SWIMMER_GUY ; 31 + const SPRITE_SWIMMER_GIRL ; 32 + const SPRITE_BIG_SNORLAX ; 33 + const SPRITE_SURFING_PIKACHU ; 34 + const SPRITE_ROCKET ; 35 + const SPRITE_ROCKET_GIRL ; 36 + const SPRITE_NURSE ; 37 + const SPRITE_LINK_RECEPTIONIST ; 38 + const SPRITE_CLERK ; 39 + const SPRITE_FISHER ; 3a + const SPRITE_FISHING_GURU ; 3b + const SPRITE_SCIENTIST ; 3c + const SPRITE_KIMONO_GIRL ; 3d + const SPRITE_SAGE ; 3e + const SPRITE_UNUSED_GUY ; 3f + const SPRITE_GENTLEMAN ; 40 + const SPRITE_BLACK_BELT ; 41 + const SPRITE_RECEPTIONIST ; 42 + const SPRITE_OFFICER ; 43 + const SPRITE_CAL ; 44 + const SPRITE_SLOWPOKE ; 45 + const SPRITE_CAPTAIN ; 46 + const SPRITE_BIG_LAPRAS ; 47 + const SPRITE_GYM_GUY ; 48 + const SPRITE_SAILOR ; 49 + const SPRITE_BIKER ; 4a + const SPRITE_PHARMACIST ; 4b + const SPRITE_MONSTER ; 4c + const SPRITE_FAIRY ; 4d + const SPRITE_BIRD ; 4e + const SPRITE_DRAGON ; 4f + const SPRITE_BIG_ONIX ; 50 + const SPRITE_N64 ; 51 + const SPRITE_SUDOWOODO ; 52 + const SPRITE_SURF ; 53 + const SPRITE_POKE_BALL ; 54 + const SPRITE_POKEDEX ; 55 + const SPRITE_PAPER ; 56 + const SPRITE_VIRTUAL_BOY ; 57 + const SPRITE_OLD_LINK_RECEPTIONIST ; 58 + const SPRITE_ROCK ; 59 + const SPRITE_BOULDER ; 5a + const SPRITE_SNES ; 5b + const SPRITE_FAMICOM ; 5c + const SPRITE_FRUIT_TREE ; 5d + const SPRITE_GOLD_TROPHY ; 5e + const SPRITE_SILVER_TROPHY ; 5f + const SPRITE_KRIS ; 60 + const SPRITE_KRIS_BIKE ; 61 + const SPRITE_KURT_OUTSIDE ; 62 + const SPRITE_SUICUNE ; 63 + const SPRITE_ENTEI ; 64 + const SPRITE_RAIKOU ; 65 + const SPRITE_STANDING_YOUNGSTER ; 66 + +const_value SET $80 + +SPRITE_POKEMON EQU const_value + const SPRITE_UNOWN ; 80 + const SPRITE_GEODUDE ; 81 + const SPRITE_GROWLITHE ; 82 + const SPRITE_WEEDLE ; 83 + const SPRITE_SHELLDER ; 84 + const SPRITE_ODDISH ; 85 + const SPRITE_GENGAR ; 86 + const SPRITE_ZUBAT ; 87 + const SPRITE_MAGIKARP ; 88 + const SPRITE_SQUIRTLE ; 89 + const SPRITE_TOGEPI ; 8a + const SPRITE_BUTTERFREE ; 8b + const SPRITE_DIGLETT ; 8c + const SPRITE_POLIWAG ; 8d + const SPRITE_PIKACHU ; 8e + const SPRITE_CLEFAIRY ; 8f + const SPRITE_CHARMANDER ; 90 + const SPRITE_JYNX ; 91 + const SPRITE_STARMIE ; 92 + const SPRITE_BULBASAUR ; 93 + const SPRITE_JIGGLYPUFF ; 94 + const SPRITE_GRIMER ; 95 + const SPRITE_EKANS ; 96 + const SPRITE_PARAS ; 97 + const SPRITE_TENTACOOL ; 98 + const SPRITE_TAUROS ; 99 + const SPRITE_MACHOP ; 9a + const SPRITE_VOLTORB ; 9b + const SPRITE_LAPRAS ; 9c + const SPRITE_RHYDON ; 9d + const SPRITE_MOLTRES ; 9e + const SPRITE_SNORLAX ; 9f + const SPRITE_GYARADOS ; a0 + const SPRITE_LUGIA ; a1 + const SPRITE_HO_OH ; a2 + +const_value SET $e0 + const SPRITE_DAYCARE_MON_1 ; e0 + const SPRITE_DAYCARE_MON_2 ; e1 + +const_value SET $f0 +SPRITE_VARS EQU const_value + const SPRITE_CONSOLE ; f0 + const SPRITE_DOLL_1 ; f1 + const SPRITE_DOLL_2 ; f2 + const SPRITE_BIG_DOLL ; f3 + const SPRITE_WEIRD_TREE ; f4 + const SPRITE_OLIVINE_RIVAL ; f5 + const SPRITE_AZALEA_ROCKET ; f6 + const SPRITE_FUCHSIA_GYM_1 ; f7 + const SPRITE_FUCHSIA_GYM_2 ; f8 + const SPRITE_FUCHSIA_GYM_3 ; f9 + const SPRITE_FUCHSIA_GYM_4 ; fa + const SPRITE_COPYCAT ; fb + const SPRITE_JANINE_IMPERSONATOR ; fc + +; sprite types +const_value SET 1 + const WALKING_SPRITE + const STANDING_SPRITE + const STILL_SPRITE + +; sprite palettes + const_def + const PAL_OW_RED + const PAL_OW_BLUE + const PAL_OW_GREEN + const PAL_OW_BROWN + const PAL_OW_PINK + const PAL_OW_SILVER + const PAL_OW_TREE + const PAL_OW_ROCK + +; sprite movements + const_def + const SPRITEMOVEFN_00 + const SPRITEMOVEFN_01 + const SPRITEMOVEFN_02 + const SPRITEMOVEFN_03 + const SPRITEMOVEFN_04 + const SPRITEMOVEFN_05 + const SPRITEMOVEFN_06 + const SPRITEMOVEFN_07 + const SPRITEMOVEFN_08 + const SPRITEMOVEFN_09 + const SPRITEMOVEFN_0A + const SPRITEMOVEFN_0B + const SPRITEMOVEFN_0C + const SPRITEMOVEFN_0D + const SPRITEMOVEFN_0E + const SPRITEMOVEFN_0F + const SPRITEMOVEFN_10 + const SPRITEMOVEFN_11 + const SPRITEMOVEFN_12 + const SPRITEMOVEFN_13 + const SPRITEMOVEFN_14 + const SPRITEMOVEFN_15 + const SPRITEMOVEFN_16 + const SPRITEMOVEFN_17 + const SPRITEMOVEFN_18 + const SPRITEMOVEFN_19 + const SPRITEMOVEFN_1A + const SPRITEMOVEFN_1B + const SPRITEMOVEFN_1C + const SPRITEMOVEFN_1D + const SPRITEMOVEFN_1E + const SPRITEMOVEFN_1F + const SPRITEMOVEFN_20 + const SPRITEMOVEFN_21 diff --git a/constants/tilemap_constants.asm b/constants/tilemap_constants.asm new file mode 100644 index 000000000..e47a1b269 --- /dev/null +++ b/constants/tilemap_constants.asm @@ -0,0 +1,5 @@ +LANDTILE EQU 0 +WALLTILE EQU 1 +WATRTILE EQU 15 + +TALK EQU 1 << 4 diff --git a/constants/trainer_constants.asm b/constants/trainer_constants.asm index 807eb74ee..e53c201b2 100644 --- a/constants/trainer_constants.asm +++ b/constants/trainer_constants.asm @@ -1,5 +1,12 @@ ; trainer groups - enum_start 1 + enum_start + trainerclass TRAINER_NONE ; 0 + const PHONECONTACT_MOM + const PHONECONTACT_BIKESHOP + const PHONECONTACT_BILL + const PHONECONTACT_ELM + const PHONECONTACT_BUENA + trainerclass FALKNER ; 1 trainerclass WHITNEY ; 2 @@ -607,3 +614,33 @@ const EUSINE NUM_TRAINER_CLASSES EQU __enum__ + + const_def + const NO_AI +const_value = 0 + shift_const AI_BASIC + shift_const AI_SETUP + shift_const AI_TYPES + shift_const AI_OFFENSIVE + shift_const AI_SMART + shift_const AI_OPPORTUNIST + shift_const AI_AGGRESSIVE + shift_const AI_CAUTIOUS + shift_const AI_STATUS + shift_const AI_RISKY + shift_const AI_10 + shift_const AI_11 + shift_const AI_12 + shift_const AI_13 + shift_const AI_14 + shift_const AI_15 + + const_def + const TRNATTR_ITEM1 + const TRNATTR_ITEM2 + const TRNATTR_BASEMONEY + const TRNATTR_AI1 + const TRNATTR_AI2 + const TRNATTR_AI3 + const TRNATTR_AI4 +NUM_TRAINER_ATTRIBUTES EQU const_value diff --git a/contents.asm b/contents.asm index af277dcad..0d55c2dcd 100644 --- a/contents.asm +++ b/contents.asm @@ -34,7 +34,6 @@ POKEDEX_ENTRIES_4 EQU $74 ; engine/events.o ; engine/scripting.o ; engine/events_2.o - EVENTS EQU $25 diff --git a/data/wild/fish.asm b/data/wild/fish.asm index e2deb093a..b528bbed8 100644 --- a/data/wild/fish.asm +++ b/data/wild/fish.asm @@ -134,14 +134,14 @@ GetFishGroupHeader: ; 9245b ret .group11 - ld a, [wdfce] + ld a, [wFishingSwarmFlag] cp 1 jr nz, .end ld d, 6 jr .end .group12 - ld a, [wdfce] + ld a, [wFishingSwarmFlag] cp 2 jr nz, .end ld d, 7 diff --git a/engine/battle_start.asm b/engine/battle_start.asm new file mode 100644 index 000000000..4b12bb632 --- /dev/null +++ b/engine/battle_start.asm @@ -0,0 +1,872 @@ +Predef_StartBattle: ; 8c20f + call Function8c26d + ld a, [rBGP] + ld [wcfc7], a + ld a, [rOBP0] + ld [wcfc8], a + ld a, [rOBP1] + ld [wcfc9], a + call DelayFrame + ld hl, hVBlank + ld a, [hl] + push af + ld [hl], $1 + +.loop + ld a, [wJumptableIndex] + bit 7, a + jr nz, .done + call FlashyTransitionToBattle + call DelayFrame + jr .loop + +.done + ld a, [rSVBK] + push af + ld a, $5 + ld [rSVBK], a + + ld hl, Unkn1Pals + ld bc, $0040 + xor a + call ByteFill + + pop af + ld [rSVBK], a + + ld a, %11111111 + ld [wcfc7], a + call DmgToCgbBGPals + call DelayFrame + xor a + ld [hLCDStatCustom], a + ld [hLCDStatCustom + 1], a + ld [hLCDStatCustom + 2], a + ld [hSCY], a + + ld a, $1 + ld [rSVBK], a + pop af + ld [hVBlank], a + call DelayFrame + ret +; 8c26d + +Function8c26d: ; 8c26d + ld a, [wLinkMode] + cp LINK_MOBILE + jr z, .mobile + callba Function6454 + call UpdateSprites + call DelayFrame + call Function8c2a0 + call Function8cf4f + jr .resume + +.mobile + call LoadTrainerBattlePokeballTiles + +.resume + ld a, SCREEN_HEIGHT_PX + ld [hWY], a + call DelayFrame + xor a + ld [hBGMapMode], a + ld hl, wJumptableIndex + xor a +rept 2 + ld [hli], a +endr + ld [hl], a + call WipeLYOverrides + ret +; 8c2a0 + +Function8c2a0: ; 8c2a0 + call LoadTrainerBattlePokeballTiles + ld hl, VBGMap0 + call Function8c2cf + ret +; 8c2aa + +LoadTrainerBattlePokeballTiles: +; Load the tiles used in the Pokeball Graphic that fills the screen +; at the start of every Trainer battle. + ld de, TrainerBattlePokeballTiles + ld hl, VTiles1 tile $7e + ld b, BANK(TrainerBattlePokeballTiles) + ld c, 2 + call Request2bpp + + ld a, [rVBK] + push af + ld a, $1 + ld [rVBK], a + + ld de, TrainerBattlePokeballTiles + ld hl, VTiles4 tile $7e + ld b, BANK(TrainerBattlePokeballTiles) + ld c, 2 + call Request2bpp + + pop af + ld [rVBK], a + ret +; 8c2cf + +Function8c2cf: ; 8c2cf + ld a, [rSVBK] + push af + ld a, $6 + ld [rSVBK], a + push hl + ld hl, w6_d000 + ld bc, $28 * $10 + +.loop + ld [hl], -1 + inc hl + dec bc + ld a, c + or b + jr nz, .loop + + pop hl + ld de, w6_d000 + ld b, BANK(Function8c2cf) ; BANK(@) + ld c, $28 + call Request2bpp + pop af + ld [rSVBK], a + ret +; 8c2f4 + +TrainerBattlePokeballTiles: ; 8c2f4 +INCBIN "gfx/overworld/trainer_battle_pokeball_tiles.2bpp" + + +FlashyTransitionToBattle: ; 8c314 + ld a, [wJumptableIndex] + ld e, a + ld d, 0 + ld hl, .jumptable +rept 2 + add hl, de +endr + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] +; 8c323 + +.jumptable: ; 8c323 (23:4323) + dw StartTrainerBattle_DetermineWhichAnimation ; 00 + + ; Animation 1: cave + dw StartTrainerBattle_LoadPokeBallGraphics ; 01 + dw StartTrainerBattle_SetUpBGMap ; 02 + dw StartTrainerBattle_Flash ; 03 + dw StartTrainerBattle_Flash ; 04 + dw StartTrainerBattle_Flash ; 05 + dw StartTrainerBattle_NextScene ; 06 + dw StartTrainerBattle_SetUpForWavyOutro ; 07 + dw StartTrainerBattle_SineWave ; 08 + + ; Animation 2: cave, stronger + dw StartTrainerBattle_LoadPokeBallGraphics ; 09 + dw StartTrainerBattle_SetUpBGMap ; 0a + dw StartTrainerBattle_Flash ; 0b + dw StartTrainerBattle_Flash ; 0c + dw StartTrainerBattle_Flash ; 0d + dw StartTrainerBattle_NextScene ; 0e + ; There is no setup for this one + dw StartTrainerBattle_ZoomToBlack ; 0f + + ; Animation 3: no cave + dw StartTrainerBattle_LoadPokeBallGraphics ; 10 + dw StartTrainerBattle_SetUpBGMap ; 11 + dw StartTrainerBattle_Flash ; 12 + dw StartTrainerBattle_Flash ; 13 + dw StartTrainerBattle_Flash ; 14 + dw StartTrainerBattle_NextScene ; 15 + dw StartTrainerBattle_SetUpForSpinOutro ; 16 + dw StartTrainerBattle_SpinToBlack ; 17 + + ; Animation 4: no cave, stronger + dw StartTrainerBattle_LoadPokeBallGraphics ; 18 + dw StartTrainerBattle_SetUpBGMap ; 19 + dw StartTrainerBattle_Flash ; 1a + dw StartTrainerBattle_Flash ; 1b + dw StartTrainerBattle_Flash ; 1c + dw StartTrainerBattle_NextScene ; 1d + dw StartTrainerBattle_SetUpForRandomScatterOutro ; 1e + dw StartTrainerBattle_SpeckleToBlack ; 1f + + ; All animations jump to here. + dw StartTrainerBattle_Finish ; 20 + + +StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365) +; The screen flashes a different number of +; times depending on the level of your lead +; Pokemon relative to the opponent's. + ld de, 0 + ld a, [BattleMonLevel] + add 3 + ld hl, EnemyMonLevel + cp [hl] + jr nc, .okay + set 0, e +.okay + ld a, [wPermission] + cp CAVE + jr z, .okay2 + cp PERM_5 + jr z, .okay2 + cp DUNGEON + jr z, .okay2 + set 1, e +.okay2 + ld hl, .StartingPoints + add hl, de + ld a, [hl] + ld [wJumptableIndex], a + ret +; 8c38f (23:438f) + +.StartingPoints: ; 8c38f + db 1, 9 + db 16, 24 +; 8c393 + +StartTrainerBattle_Finish: ; 8c393 (23:4393) + call ClearSprites + ld a, $80 + ld [wJumptableIndex], a + ret + +StartTrainerBattle_NextScene: ; 8c39c (23:439c) + ld hl, wJumptableIndex + inc [hl] + ret + +StartTrainerBattle_SetUpBGMap: ; 8c3a1 (23:43a1) + call StartTrainerBattle_NextScene + xor a + ld [wcf64], a + ld [hBGMapMode], a ; $ff00+$d4 + ret + +StartTrainerBattle_Flash: ; 8c3ab (23:43ab) + call .DoFlashAnimation + ret nc + call StartTrainerBattle_NextScene + ret + +.DoFlashAnimation: ; 8c3b3 (23:43b3) + ld a, [wd847] + cp -1 + jr z, .done + ld hl, wcf64 + ld a, [hl] + inc [hl] + srl a + ld e, a + ld d, 0 + ld hl, .pals + add hl, de + ld a, [hl] + cp %00000001 + jr z, .done + ld [wcfc7], a + call DmgToCgbBGPals + and a + ret + +.done + xor a + ld [wcf64], a + scf + ret +; 8c3db (23:43db) + +.pals: ; 8c3db + db %11111001 ; 3321 + db %11111110 ; 3332 + db %11111111 ; 3333 + db %11111110 ; 3332 + db %11111001 ; 3321 + db %11100100 ; 3210 + db %10010000 ; 2100 + db %01000000 ; 1000 + db %00000000 ; 0000 + db %01000000 ; 1000 + db %10010000 ; 2100 + db %11100100 ; 3210 + db %00000001 ; 0001 +; 8c3e8 + +StartTrainerBattle_SetUpForWavyOutro: ; 8c3e8 (23:43e8) + callba Function5602 + ld a, $5 + ld [rSVBK], a ; $ff00+$70 + call StartTrainerBattle_NextScene + ld a, $43 + ld [hLCDStatCustom], a ; $ff00+$c6 + xor a + ld [hLCDStatCustom + 1], a + ld a, $90 + ld [hLCDStatCustom + 2], a + xor a + ld [wcf64], a + ld [wcf65], a + ret + +StartTrainerBattle_SineWave: ; 8c408 (23:4408) + ld a, [wcf64] + cp $60 + jr nc, .end + call .DoSineWave + ret + +.end + ld a, $20 + ld [wJumptableIndex], a + ret + +.DoSineWave: ; 8c419 (23:4419) + ld hl, wcf65 + ld a, [hl] + inc [hl] + ld hl, wcf64 + ld d, [hl] + add [hl] + ld [hl], a + ld a, $90 + ld bc, wd100 + ld e, $0 + +.loop + push af + push de + ld a, e + call StartTrainerBattle_DrawSineWave + ld [bc], a + inc bc + pop de + ld a, e + add $2 + ld e, a + pop af + dec a + jr nz, .loop + ret + +StartTrainerBattle_SetUpForSpinOutro: ; 8c43d (23:443d) + callba Function5602 + ld a, $5 + ld [rSVBK], a ; $ff00+$70 + call StartTrainerBattle_NextScene + xor a + ld [wcf64], a + ret + +spintable_entry: MACRO + db \1 + dw .wedge\2 + dwcoord \3, \4 +ENDM + +; quadrants + const_def + const UPPER_LEFT + const UPPER_RIGHT + const LOWER_LEFT + const LOWER_RIGHT + +StartTrainerBattle_SpinToBlack: ; 8c44f (23:444f) + xor a + ld [hBGMapMode], a ; $ff00+$d4 + ld a, [wcf64] + ld e, a + ld d, 0 + ld hl, .spintable +rept 5 + add hl, de +endr + ld a, [hli] + cp -1 + jr z, .end + ld [wcf65], a + call .load + ld a, $1 + ld [hBGMapMode], a ; $ff00+$d4 + call DelayFrame + call DelayFrame + ld hl, wcf64 + inc [hl] + ret + +.end + ld a, $1 + ld [hBGMapMode], a ; $ff00+$d4 + call DelayFrame + call DelayFrame + call DelayFrame + xor a + ld [hBGMapMode], a ; $ff00+$d4 + ld a, $20 + ld [wJumptableIndex], a + ret +; 8c490 (23:4490) + +.spintable: ; 8c490 + spintable_entry UPPER_LEFT, 1, 1, 6 + spintable_entry UPPER_LEFT, 2, 0, 3 + spintable_entry UPPER_LEFT, 3, 1, 0 + spintable_entry UPPER_LEFT, 4, 5, 0 + spintable_entry UPPER_LEFT, 5, 9, 0 + spintable_entry UPPER_RIGHT, 5, 10, 0 + spintable_entry UPPER_RIGHT, 4, 14, 0 + spintable_entry UPPER_RIGHT, 3, 18, 0 + spintable_entry UPPER_RIGHT, 2, 19, 3 + spintable_entry UPPER_RIGHT, 1, 18, 6 + spintable_entry LOWER_RIGHT, 1, 18, 11 + spintable_entry LOWER_RIGHT, 2, 19, 14 + spintable_entry LOWER_RIGHT, 3, 18, 17 + spintable_entry LOWER_RIGHT, 4, 14, 17 + spintable_entry LOWER_RIGHT, 5, 10, 17 + spintable_entry LOWER_LEFT, 5, 9, 17 + spintable_entry LOWER_LEFT, 4, 5, 17 + spintable_entry LOWER_LEFT, 3, 1, 17 + spintable_entry LOWER_LEFT, 2, 0, 14 + spintable_entry LOWER_LEFT, 1, 1, 11 + db -1 +; 8c4f5 + +.load: ; 8c4f5 (23:44f5) + ld a, [hli] + ld e, a + ld a, [hli] + ld d, a + ld a, [hli] + ld h, [hl] + ld l, a +.loop + push hl + ld a, [de] + ld c, a + inc de +.loop1 + ld [hl], $ff + ld a, [wcf65] + bit 0, a + jr z, .leftside + inc hl + jr .okay1 +.leftside + dec hl +.okay1 + dec c + jr nz, .loop1 + pop hl + ld a, [wcf65] + bit 1, a + ld bc, SCREEN_WIDTH + jr z, .upper + ld bc, -SCREEN_WIDTH +.upper + add hl, bc + ld a, [de] + inc de + cp -1 + ret z + and a + jr z, .loop + ld c, a +.loop2 + ld a, [wcf65] + bit 0, a + jr z, .leftside2 + dec hl + jr .okay2 +.leftside2 + inc hl +.okay2 + dec c + jr nz, .loop2 + jr .loop +; 8c538 (23:4538) + +.wedge1: db 2, 3, 5, 4, 9, -1 +.wedge2: db 1, 1, 2, 2, 4, 2, 4, 2, 3, -1 +.wedge3: db 2, 1, 3, 1, 4, 1, 4, 1, 4, 1, 3, 1, 2, 1, 1, 1, 1, -1 +.wedge4: db 4, 1, 4, 0, 3, 1, 3, 0, 2, 1, 2, 0, 1, -1 +.wedge5: db 4, 0, 3, 0, 3, 0, 2, 0, 2, 0, 1, 0, 1, 0, 1, -1 +; 8c578 + +StartTrainerBattle_SetUpForRandomScatterOutro: ; 8c578 (23:4578) + callba Function5602 + ld a, $5 + ld [rSVBK], a ; $ff00+$70 + call StartTrainerBattle_NextScene + ld a, $10 + ld [wcf64], a + ld a, $1 + ld [hBGMapMode], a ; $ff00+$d4 + ret + +StartTrainerBattle_SpeckleToBlack: ; 8c58f (23:458f) + ld hl, wcf64 + ld a, [hl] + and a + jr z, .done + dec [hl] + ld c, $c +.loop + push bc + call .BlackOutRandomTile + pop bc + dec c + jr nz, .loop + ret + +.done + ld a, $1 + ld [hBGMapMode], a ; $ff00+$d4 + call DelayFrame + call DelayFrame + call DelayFrame + xor a + ld [hBGMapMode], a ; $ff00+$d4 + ld a, $20 + ld [wJumptableIndex], a + ret + +.BlackOutRandomTile: ; 8c5b8 (23:45b8) +.y_loop + call Random + cp SCREEN_HEIGHT + jr nc, .y_loop + ld b, a + +.x_loop + call Random + cp SCREEN_WIDTH + jr nc, .x_loop + ld c, a + + hlcoord 0, -1 + ld de, SCREEN_WIDTH + inc b + +.row_loop + add hl, de + dec b + jr nz, .row_loop + add hl, bc + +; If the tile has already been blacked out, +; sample a new tile + ld a, [hl] + cp $ff + jr z, .y_loop + ld [hl], $ff + ret + +StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc) + ld a, [OtherTrainerClass] + and a + jp z, .nextscene + + xor a + ld [hBGMapMode], a ; $ff00+$d4 + hlcoord 0, 0, AttrMap + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH + inc b + inc c + jr .enter_loop_midway + +.loop + ld a, [hl] + or %00000111 + ld [hli], a +.enter_loop_midway + dec c + jr nz, .loop + dec b + jr nz, .loop + + call .loadpokeballgfx ; load a, [OtherTrainerClass] \ ld de, PokeBallTransition + hlcoord 2, 1 + + ld b, SCREEN_WIDTH - 4 +.loop2 + push hl + ld c, 2 +.loop3 + push hl + ld a, [de] + inc de +.loop4 +; Loading is done bit by bit + and a + jr z, .done + sla a + jr nc, .no_load + ld [hl], $fe ; "8" +.no_load + inc hl + jr .loop4 + +.done + pop hl + push bc + ld bc, (SCREEN_WIDTH - 4) / 2 + add hl, bc + pop bc + dec c + jr nz, .loop3 + + pop hl + push bc + ld bc, SCREEN_WIDTH + add hl, bc + pop bc + dec b + jr nz, .loop2 + + ld a, [hCGB] ; $ff00+$e6 + and a + jr nz, .cgb + ld a, $1 + ld [hBGMapMode], a ; $ff00+$d4 + call DelayFrame + call DelayFrame + jr .nextscene + +.cgb + ld hl, .daypals + ld a, [TimeOfDayPal] + and (1 << 2) - 1 + cp 3 + jr nz, .daytime + ld hl, .nightpals +.daytime + ld a, [rSVBK] ; $ff00+$70 + push af + ld a, $5 ; WRAM5 = palettes + ld [rSVBK], a ; $ff00+$70 + call .copypals + push hl + ld de, Unkn1Pals + 8 * 7 + ld bc, $8 + call CopyBytes + pop hl + ld de, BGPals + 8 * 7 + ld bc, $8 + call CopyBytes + pop af + ld [rSVBK], a ; $ff00+$70 + ld a, $1 + ld [hCGBPalUpdate], a ; $ff00+$e5 + call DelayFrame + call Function8cf4f + +.nextscene: ; 8c673 (23:4673) + call StartTrainerBattle_NextScene + ret + +.copypals: ; 8c677 (23:4677) + ld de, Unkn1Pals + 8 * 7 + call .copy + ld de, BGPals + 8 * 7 + call .copy + ld de, Unkn2Pals + 8 * 6 + call .copy + ld de, OBPals + 8 * 6 + call .copy + ld de, Unkn2Pals + 8 * 7 + call .copy + ld de, OBPals + 8 * 7 + +.copy: ; 8c698 (23:4698) + push hl + ld bc, $8 + call CopyBytes + pop hl + ret +; 8c6a1 (23:46a1) + +.daypals: ; 8c6a1 + RGB 31, 18, 29 + RGB 31, 11, 15 + RGB 31, 05, 05 + RGB 07, 07, 07 +; 8c6a9 + +.nightpals: ; 8c6a9 + RGB 31, 18, 29 + RGB 31, 05, 05 + RGB 31, 05, 05 + RGB 31, 05, 05 + +.loadpokeballgfx: + ld a, [OtherTrainerClass] + ld de, PokeBallTransition + ret + +PokeBallTransition: + db %00000011, %11000000 + db %00001111, %11110000 + db %00111100, %00111100 + db %00110000, %00001100 + db %01100000, %00000110 + db %01100011, %11000110 + db %11000110, %01100011 + db %11111100, %00111111 + db %11111100, %00111111 + db %11000110, %01100011 + db %01100011, %11000110 + db %01100000, %00000110 + db %00110000, %00001100 + db %00111100, %00111100 + db %00001111, %11110000 + db %00000011, %11000000 + +WipeLYOverrides: ; 8c6d8 + ld a, [rSVBK] + push af + ld a, $5 + ld [rSVBK], a + ld hl, LYOverrides + call .wipe + ld hl, LYOverridesBackup + call .wipe + pop af + ld [rSVBK], a + ret +; 8c6ef + +.wipe: ; 8c6ef + xor a + ld c, SCREEN_HEIGHT_PX +.loop + ld [hli], a + dec c + jr nz, .loop + ret +; 8c6f7 + + +StartTrainerBattle_DrawSineWave: ; 8c6f7 (23:46f7) + and (1 << 6) - 1 + cp 1 << 5 + jr nc, .okay + call .DoSineWave + ld a, h + ret + +.okay + and (1 << 5) - 1 + call .DoSineWave + ld a, h + xor -1 ; cpl + inc a + ret + +.DoSineWave: ; 8c70c (23:470c) + ld e, a + ld a, d + ld d, 0 + ld hl, .sinewave +rept 2 + add hl, de +endr + ld e, [hl] + inc hl + ld d, [hl] + ld hl, 0 +.loop + srl a + jr nc, .skip + add hl, de +.skip + sla e + rl d + and a + jr nz, .loop + ret +; 8c728 (23:4728) + +.sinewave: ; 8c728 + sine_wave $100 +; 8c768 + +zoombox: macro +; width, height, start y, start x + db \1, \2 + dwcoord \3, \4 +endm + +StartTrainerBattle_ZoomToBlack: ; 8c768 (23:4768) + callba Function5602 + ld de, .boxes + +.loop + ld a, [de] + cp -1 + jr z, .done + inc de + ld c, a + ld a, [de] + inc de + ld b, a + ld a, [de] + inc de + ld l, a + ld a, [de] + inc de + ld h, a + xor a + ld [hBGMapMode], a ; $ff00+$d4 + call .Copy + call WaitBGMap + jr .loop + +.done + ld a, $20 + ld [wJumptableIndex], a + ret +; 8c792 (23:4792) + +.boxes: ; 8c792 + zoombox 4, 2, 8, 8 + zoombox 6, 4, 7, 7 + zoombox 8, 6, 6, 6 + zoombox 10, 8, 5, 5 + zoombox 12, 10, 4, 4 + zoombox 14, 12, 3, 3 + zoombox 16, 14, 2, 2 + zoombox 18, 16, 1, 1 + zoombox 20, 18, 0, 0 + db -1 +; 8c7b7 + +.Copy: ; 8c7b7 (23:47b7) + ld a, $ff +.row + push bc + push hl +.col + ld [hli], a + dec c + jr nz, .col + pop hl + ld bc, SCREEN_WIDTH + add hl, bc + pop bc + dec b + jr nz, .row + ret +; 8c7c9 (23:47c9) diff --git a/engine/color.asm b/engine/color.asm index 0e932f786..ed65f59df 100644 --- a/engine/color.asm +++ b/engine/color.asm @@ -83,7 +83,7 @@ Function8aa4: ; 8aa4 push bc ld hl, PalPacket_9ce6 ld de, wcda9 - ld bc, $0010 + ld bc, PalPacket_9cf6 - PalPacket_9ce6 call CopyBytes pop bc pop de @@ -105,7 +105,7 @@ Function8aa4: ; 8aa4 Function8ad1: ; 8ad1 ld hl, PalPacket_9c56 + 1 - call Function9610 + call CopyFourPalettes call Function971a call Function9699 ret @@ -196,8 +196,8 @@ Function8b4d: ; 8b4d .asm_8b5c ld de, Unkn2Pals ld a, $3b - call Function9625 - jp Function9630 + call GetAthPalletFromPalettes9df6 + jp LoadHLPaletteIntoDE ; 8b67 Function8b67: ; 8b67 @@ -212,8 +212,8 @@ Function8b67: ; 8b67 .asm_8b76 ld de, Unkn2Pals ld a, $3c - call Function9625 - jp Function9630 + call GetAthPalletFromPalettes9df6 + jp LoadHLPaletteIntoDE ; 8b81 Function8b81: ; 8b81 @@ -309,7 +309,7 @@ Function8bec: ; 8bec .asm_8c0b ld b, $0 add hl, bc - ld bc, $0604 + lb bc, 6, 4 ld a, [EnemySafeguardCount] and $3 call Function9663 @@ -386,7 +386,7 @@ endr jr .asm_8c7b .asm_8c82 - ld bc, $0208 + lb bc, 2, 8 ld a, e call Function9663 ret @@ -520,7 +520,7 @@ INCLUDE "predef/cgb.asm" Function95f0: ; 95f0 ld hl, Palette_9608 ld de, Unkn1Pals - ld bc, $0008 + ld bc, 8 ld a, $5 call FarCopyWRAM call Function96a4 @@ -537,28 +537,29 @@ Palette_9608: ; 9608 ; 9610 -Function9610: ; 9610 +CopyFourPalettes: ; 9610 ld de, Unkn1Pals ld c, $4 -Function9615: ; 9615 +CopyPalettes: ; 9615 +.loop push bc ld a, [hli] push hl - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE pop hl inc hl pop bc dec c - jr nz, Function9615 + jr nz, .loop ret ; 9625 -Function9625: ; 9625 +GetAthPalletFromPalettes9df6: ; 9625 ld l, a ld h, $0 -rept 3 +rept 3 ; multiply by 8 add hl, hl endr ld bc, Palettes_9df6 @@ -566,18 +567,18 @@ endr ret ; 9630 -Function9630: ; 9630 +LoadHLPaletteIntoDE: ; 9630 ld a, [rSVBK] push af ld a, $5 ld [rSVBK], a ld c, $8 -.asm_9639 +.loop ld a, [hli] ld [de], a inc de dec c - jr nz, .asm_9639 + jr nz, .loop pop af ld [rSVBK], a ret @@ -595,12 +596,12 @@ Function9643: ; 9643 ld [de], a inc de ld c, $4 -.asm_9654 +.loop ld a, [hli] ld [de], a inc de dec c - jr nz, .asm_9654 + jr nz, .loop xor a ld [de], a inc de @@ -612,19 +613,19 @@ Function9643: ; 9643 ; 9663 Function9663: ; 9663 -.asm_9663 +.row push bc push hl -.asm_9665 +.col ld [hli], a dec c - jr nz, .asm_9665 + jr nz, .col pop hl - ld bc, $0014 + ld bc, SCREEN_WIDTH add hl, bc pop bc dec b - jr nz, .asm_9663 + jr nz, .row ret ; 9673 @@ -743,7 +744,7 @@ Function96f3: ; 96f3 jr .asm_970b .asm_9712 - ld bc, $0208 + lb bc, 2, 8 ld a, e call Function9663 ret @@ -784,16 +785,16 @@ Function973a: ; 973a Function974b: ; 974b and a jp nz, Function97f9 - ld a, [wd45b] + ld a, [wPlayerSpriteSetupFlags] bit 2, a - jr nz, .asm_9760 + jr nz, .male ld a, [PlayerGender] and a - jr z, .asm_9760 + jr z, .male ld hl, KrisPalette ret -.asm_9760 +.male ld hl, PlayerPalette ret ; 9764 @@ -876,21 +877,21 @@ Function97cc: ; 97cc ld a, $90 ld [rOBPI], a ld a, $1c - call Function9625 + call GetAthPalletFromPalettes9df6 call Function97e5 ld a, $21 - call Function9625 + call GetAthPalletFromPalettes9df6 call Function97e5 ret ; 97e5 Function97e5: ; 97e5 ld c, $8 -.asm_97e7 +.loop ld a, [hli] ld [rOBPD], a dec c - jr nz, .asm_97e7 + jr nz, .loop ret ; 97ee @@ -935,32 +936,32 @@ Function981a: ; 981a and $7 ret z ld b, a -.asm_981f +.loop push bc xor a ld [rJOYP], a ld a, $30 ld [rJOYP], a ld b, $10 -.asm_9829 +.loop2 ld e, $8 ld a, [hli] ld d, a -.asm_982d +.loop3 bit 0, d ld a, $10 - jr nz, .asm_9835 + jr nz, .okay ld a, $20 -.asm_9835 +.okay ld [rJOYP], a ld a, $30 ld [rJOYP], a rr d dec e - jr nz, .asm_982d + jr nz, .loop3 dec b - jr nz, .asm_9829 + jr nz, .loop2 ld a, $20 ld [rJOYP], a ld a, $30 @@ -968,7 +969,7 @@ Function981a: ; 981a call Function9a7a pop bc dec b - jr nz, .asm_981f + jr nz, .loop ret ; 9853 diff --git a/engine/credits.asm b/engine/credits.asm index 449fc0ac0..5c0013e17 100644 --- a/engine/credits.asm +++ b/engine/credits.asm @@ -124,7 +124,7 @@ Function109847:: ; 109847 jr z, .asm_10984f ld a, $40 .asm_10984f - ld [wcf63], a + ld [wJumptableIndex], a ld a, [rSVBK] push af @@ -148,17 +148,17 @@ Function109847:: ; 109847 jr nz, .asm_10986a ld de, CreditsBorderGFX - ld hl, $9200 + ld hl, VTiles2 tile $20 lb bc, BANK(CreditsBorderGFX), $09 call Request2bpp ld de, CopyrightGFX - ld hl, $9600 + ld hl, VTiles2 tile $60 lb bc, BANK(CopyrightGFX), $1d call Request2bpp ld de, TheEndGFX - ld hl, $9400 + ld hl, VTiles2 tile $40 lb bc, BANK(TheEndGFX), $10 call Request2bpp @@ -193,7 +193,7 @@ Function109847:: ; 109847 ld a, $5 ld [hVBlank], a ld a, $1 - ld [$ffaa], a + ld [hInMenu], a xor a ld [hBGMapMode], a ld [CreditsPos], a @@ -225,7 +225,7 @@ Function1098fd: ; 1098fd ld a, [hJoypadDown] and $1 ret z - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a ret ; 109908 @@ -234,7 +234,7 @@ Function109908: ; 109908 ld a, [hJoypadDown] and $2 ret z - ld a, [wcf63] + ld a, [wJumptableIndex] bit 6, a ret z ld hl, CreditsPos @@ -255,7 +255,7 @@ Function109908: ; 109908 ; 109926 Function109926: ; 109926 - ld a, [wcf63] + ld a, [wJumptableIndex] and $f ld e, a ld d, 0 @@ -287,12 +287,12 @@ Jumptable_109937: ; 109937 (42:5937) Function109951: ; 109951 (42:5951) - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret Function109956: ; 109956 (42:5956) - ld hl, wcf63 + ld hl, wJumptableIndex ld a, [hl] and $f0 ld [hl], a @@ -348,7 +348,7 @@ Function1099a3: ; 1099a3 (42:59a3) ParseCredits: ; 1099aa - ld hl, wcf63 + ld hl, wJumptableIndex bit 7, [hl] jp nz, .done @@ -488,7 +488,7 @@ endr .end ; Stop execution. - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ld a, $20 ld [MusicFade], a diff --git a/engine/engine_flags.asm b/engine/engine_flags.asm index 278c7c996..5baa52cc4 100644 --- a/engine/engine_flags.asm +++ b/engine/engine_flags.asm @@ -1,198 +1,200 @@ ; All locations are in WRAM bank 1. - +engine_flag: MACRO + dwb \1, 1 << \2 +ENDM ; location, bit ; pokegear - dwb wPokegearFlags, %00000010 ; radio card ; $0 - dwb wPokegearFlags, %00000001 ; map card - dwb wPokegearFlags, %00000100 ; phone card - dwb wPokegearFlags, %00001000 ; expn card - dwb wPokegearFlags, %10000000 ; on/off + engine_flag wPokegearFlags, 1 ; radio card ; $0 + engine_flag wPokegearFlags, 0 ; map card + engine_flag wPokegearFlags, 2 ; phone card + engine_flag wPokegearFlags, 3 ; expn card + engine_flag wPokegearFlags, 7 ; on/off - ; 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 + ; wDaycareMan, 7 ; daycare 1 on + engine_flag wDaycareMan, 6 ; monster 1 and 2 are compatible + ; wDaycareMan, 5 ; egg is ready + engine_flag wDaycareMan, 0 ; monster 1 in daycare - ; wDaycareLady, %10000000 = daycare 2 on - dwb wDaycareLady, %00000001 ; monster 2 in daycare + ; wDaycareLady, 7 = daycare 2 on + engine_flag wDaycareLady, 0 ; monster 2 in daycare - dwb wMomSavingMoney, %00000001 ; mom saving money ; $8 - dwb wMomSavingMoney, %10000000 ; dst + engine_flag wMomSavingMoney, 0 ; mom saving money ; $8 + engine_flag wMomSavingMoney, 7 ; dst - dwb wdc39, %00000001 + engine_flag wdc39, 0 - dwb StatusFlags, %00000001 ; pokedex - dwb StatusFlags, %00000010 ; unown dex - dwb StatusFlags, %00001000 ; pokerus - dwb StatusFlags, %00010000 ; rocket signal on ch20 - dwb StatusFlags, %01000000 ; credits skip - dwb StatusFlags, %10000000 ; bug contest on ; $10 - dwb StatusFlags2, %00000100 ; bug contest timer - dwb StatusFlags2, %00000010 - dwb StatusFlags2, %00000001 ; rockets in radio tower - dwb StatusFlags2, %00010000 ; bike shop call enabled (1024 bike steps reqd) - dwb StatusFlags2, %00100000 ; give pokerus; berry -> berry juice when trading? - dwb StatusFlags2, %01000000 - dwb StatusFlags2, %10000000 ; rockets in mahogany + engine_flag StatusFlags, 0 ; pokedex + engine_flag StatusFlags, 1 ; unown dex + engine_flag StatusFlags, 3 ; pokerus + engine_flag StatusFlags, 4 ; rocket signal on ch20 + engine_flag StatusFlags, 6 ; credits skip + engine_flag StatusFlags, 7 ; bug contest on ; $10 + engine_flag StatusFlags2, 2 ; bug contest timer + engine_flag StatusFlags2, 1 + engine_flag StatusFlags2, 0 ; rockets in radio tower + engine_flag StatusFlags2, 4 ; bike shop call enabled (1024 bike steps reqd) + engine_flag StatusFlags2, 5 ; give pokerus + engine_flag StatusFlags2, 6 ; berry -> berry juice when trading? + engine_flag StatusFlags2, 7 ; rockets in mahogany - dwb BikeFlags, %00000001 ; strength active ; $18 - dwb BikeFlags, %00000010 ; always on bike (cant surf) - dwb BikeFlags, %00000100 ; downhill (cycling road) + engine_flag BikeFlags, 0 ; strength active ; $18 + engine_flag BikeFlags, 1 ; always on bike (cant surf) + engine_flag BikeFlags, 2 ; downhill (cycling road) - dwb JohtoBadges, %00000001 ; zephyrbadge - dwb JohtoBadges, %00000010 ; hivebadge - dwb JohtoBadges, %00000100 ; plainbadge - dwb JohtoBadges, %00001000 ; fogbadge - dwb JohtoBadges, %00010000 ; mineralbadge - dwb JohtoBadges, %00100000 ; stormbadge ; $20 - dwb JohtoBadges, %01000000 ; glacierbadge - dwb JohtoBadges, %10000000 ; risingbadge + engine_flag JohtoBadges, 0 ; zephyrbadge + engine_flag JohtoBadges, 1 ; hivebadge + engine_flag JohtoBadges, 2 ; plainbadge + engine_flag JohtoBadges, 3 ; fogbadge + engine_flag JohtoBadges, 4 ; mineralbadge + engine_flag JohtoBadges, 5 ; stormbadge ; $20 + engine_flag JohtoBadges, 6 ; glacierbadge + engine_flag JohtoBadges, 7 ; risingbadge - dwb KantoBadges, %00000001 ; boulderbadge - dwb KantoBadges, %00000010 ; cascadebadge - dwb KantoBadges, %00000100 ; thunderbadge - dwb KantoBadges, %00001000 ; rainbowbadge - dwb KantoBadges, %00010000 ; soulbadge - dwb KantoBadges, %00100000 ; marshbadge ; $28 - dwb KantoBadges, %01000000 ; volcanobadge - dwb KantoBadges, %10000000 ; earthbadge + engine_flag KantoBadges, 0 ; boulderbadge + engine_flag KantoBadges, 1 ; cascadebadge + engine_flag KantoBadges, 2 ; thunderbadge + engine_flag KantoBadges, 3 ; rainbowbadge + engine_flag KantoBadges, 4 ; soulbadge + engine_flag KantoBadges, 5 ; marshbadge ; $28 + engine_flag KantoBadges, 6 ; volcanobadge + engine_flag KantoBadges, 7 ; earthbadge ; unown sets - dwb UnlockedUnowns, %00000001 ; 1 - dwb UnlockedUnowns, %00000010 ; 2 - dwb UnlockedUnowns, %00000100 ; 3 - dwb UnlockedUnowns, %00001000 ; 4 - dwb UnlockedUnowns, %00010000 ; 5 - dwb UnlockedUnowns, %00100000 ; 6 ; $30 - dwb UnlockedUnowns, %01000000 ; 7 - dwb UnlockedUnowns, %10000000 ; 8 + engine_flag UnlockedUnowns, 0 ; 1 + engine_flag UnlockedUnowns, 1 ; 2 + engine_flag UnlockedUnowns, 2 ; 3 + engine_flag UnlockedUnowns, 3 ; 4 + engine_flag UnlockedUnowns, 4 ; 5 + engine_flag UnlockedUnowns, 5 ; 6 ; $30 + engine_flag UnlockedUnowns, 6 ; 7 + engine_flag UnlockedUnowns, 7 ; 8 ; fly - dwb VisitedSpawns, %00000001 ; your house - dwb VisitedSpawns, %00000010 ; viridian pokecenter - dwb VisitedSpawns, %00000100 ; pallet - dwb VisitedSpawns, %00001000 ; viridian - dwb VisitedSpawns, %00010000 ; pewter - dwb VisitedSpawns, %00100000 ; cerulean ; $38 - dwb VisitedSpawns, %01000000 ; rock tunnel - dwb VisitedSpawns, %10000000 ; vermilion - dwb VisitedSpawns + 1, %00000001 ; lavender - dwb VisitedSpawns + 1, %00000010 ; saffron - dwb VisitedSpawns + 1, %00000100 ; celadon - dwb VisitedSpawns + 1, %00001000 ; fuchsia - dwb VisitedSpawns + 1, %00010000 ; cinnabar - dwb VisitedSpawns + 1, %00100000 ; indigo plateau ; $40 - dwb VisitedSpawns + 1, %01000000 ; new bark - dwb VisitedSpawns + 1, %10000000 ; cherrygrove - dwb VisitedSpawns + 2, %00000001 ; violet - dwb VisitedSpawns + 2, %00000100 ; azalea - dwb VisitedSpawns + 2, %00001000 ; cianwood - dwb VisitedSpawns + 2, %00010000 ; goldenrod - dwb VisitedSpawns + 2, %00100000 ; olivine - dwb VisitedSpawns + 2, %01000000 ; ecruteak ; $48 - dwb VisitedSpawns + 2, %10000000 ; mahogany - dwb VisitedSpawns + 3, %00000001 ; lake of rage - dwb VisitedSpawns + 3, %00000010 ; blackthorn - dwb VisitedSpawns + 3, %00000100 ; silver cave - dwb VisitedSpawns + 3, %00010000 ; unused + engine_flag VisitedSpawns, 0 ; your house + engine_flag VisitedSpawns, 1 ; viridian pokecenter + engine_flag VisitedSpawns, 2 ; pallet + engine_flag VisitedSpawns, 3 ; viridian + engine_flag VisitedSpawns, 4 ; pewter + engine_flag VisitedSpawns, 5 ; cerulean ; $38 + engine_flag VisitedSpawns, 6 ; rock tunnel + engine_flag VisitedSpawns, 7 ; vermilion + engine_flag VisitedSpawns + 1, 0 ; lavender + engine_flag VisitedSpawns + 1, 1 ; saffron + engine_flag VisitedSpawns + 1, 2 ; celadon + engine_flag VisitedSpawns + 1, 3 ; fuchsia + engine_flag VisitedSpawns + 1, 4 ; cinnabar + engine_flag VisitedSpawns + 1, 5 ; indigo plateau ; $40 + engine_flag VisitedSpawns + 1, 6 ; new bark + engine_flag VisitedSpawns + 1, 7 ; cherrygrove + engine_flag VisitedSpawns + 2, 0 ; violet + engine_flag VisitedSpawns + 2, 2 ; azalea + engine_flag VisitedSpawns + 2, 3 ; cianwood + engine_flag VisitedSpawns + 2, 4 ; goldenrod + engine_flag VisitedSpawns + 2, 5 ; olivine + engine_flag VisitedSpawns + 2, 6 ; ecruteak ; $48 + engine_flag VisitedSpawns + 2, 7 ; mahogany + engine_flag VisitedSpawns + 3, 0 ; lake of rage + engine_flag VisitedSpawns + 3, 1 ; blackthorn + engine_flag VisitedSpawns + 3, 2 ; silver cave + engine_flag VisitedSpawns + 3, 4 ; unused - dwb wLuckyNumberShowFlag, %00000001 ; lucky number show - dwb StatusFlags2, %00001000 + engine_flag wLuckyNumberShowFlag, 0 ; lucky number show + engine_flag StatusFlags2, 3 ; ???? - dwb DailyFlags, %00000001 ; kurt making balls ; $50 - dwb DailyFlags, %00000010 - dwb DailyFlags, %00000100 ; special wilddata? - dwb DailyFlags, %00001000 ; time capsule (24h wait) - dwb DailyFlags, %00010000 ; all fruit trees - dwb DailyFlags, %00100000 ; shuckle given - dwb DailyFlags, %01000000 ; goldenrod underground merchant closed - dwb DailyFlags, %10000000 ; fought in trainer hall today + engine_flag DailyFlags, 0 ; kurt making balls ; $50 + engine_flag DailyFlags, 1 ; ???? + engine_flag DailyFlags, 2 ; special wilddata? + engine_flag DailyFlags, 3 ; time capsule (24h wait) + engine_flag DailyFlags, 4 ; all fruit trees + engine_flag DailyFlags, 5 ; shuckle given + engine_flag DailyFlags, 6 ; goldenrod underground merchant closed + engine_flag DailyFlags, 7 ; fought in trainer hall today - dwb WeeklyFlags, %00000001 ; mt moon square clefairy ; $58 - dwb WeeklyFlags, %00000010 ; union cave lapras - dwb WeeklyFlags, %00000100 ; goldenrod underground haircut used - dwb WeeklyFlags, %00001000 ; goldenrod mall happiness event floor05 person07 - dwb WeeklyFlags, %00010000 ; tea in blues house - dwb WeeklyFlags, %00100000 ; indigo plateau rival fight - dwb WeeklyFlags, %01000000 ; move tutor - dwb WeeklyFlags, %10000000 ; buenas password + engine_flag WeeklyFlags, 0 ; mt moon square clefairy ; $58 + engine_flag WeeklyFlags, 1 ; union cave lapras + engine_flag WeeklyFlags, 2 ; goldenrod underground haircut used + engine_flag WeeklyFlags, 3 ; goldenrod mall happiness event floor05 person07 + engine_flag WeeklyFlags, 4 ; tea in blues house + engine_flag WeeklyFlags, 5 ; indigo plateau rival fight + engine_flag WeeklyFlags, 6 ; move tutor + engine_flag WeeklyFlags, 7 ; buenas password - dwb SwarmFlags, %00000001 ; $60 - dwb SwarmFlags, %00000010 ; goldenrod dept store sale is on + engine_flag SwarmFlags, 0 ; $60 + engine_flag SwarmFlags, 1 ; goldenrod dept store sale is on - dwb GameTimerPause, %10000000 ; $62 + engine_flag GameTimerPause, 7 ; $62 - dwb PlayerGender, %00000001 ; player is female + engine_flag PlayerGender, 0 ; player is female - dwb wdbf3, %00000100 ; have gs ball after kurt examined it + engine_flag wCelebiEvent, 2 ; have gs ball after kurt examined it ; rematches - dwb wDailyRematchFlags, %00000001 ; jack - dwb wDailyRematchFlags, %00000010 ; huey - dwb wDailyRematchFlags, %00000100 ; gaven - dwb wDailyRematchFlags, %00001000 ; beth ; $68 - dwb wDailyRematchFlags, %00010000 ; jose - dwb wDailyRematchFlags, %00100000 ; reena - dwb wDailyRematchFlags, %01000000 ; joey - dwb wDailyRematchFlags, %10000000 ; wade - dwb wDailyRematchFlags + 1, %00000001 ; ralph - dwb wDailyRematchFlags + 1, %00000010 ; liz - dwb wDailyRematchFlags + 1, %00000100 ; anthony - dwb wDailyRematchFlags + 1, %00001000 ; todd ; $70 - dwb wDailyRematchFlags + 1, %00010000 ; gina - dwb wDailyRematchFlags + 1, %00100000 ; arnie - dwb wDailyRematchFlags + 1, %01000000 ; alan - dwb wDailyRematchFlags + 1, %10000000 ; dana - dwb wDailyRematchFlags + 2, %00000001 ; chad - dwb wDailyRematchFlags + 2, %00000010 ; tully - dwb wDailyRematchFlags + 2, %00000100 ; brent - dwb wDailyRematchFlags + 2, %00001000 ; tiffany ; $78 - dwb wDailyRematchFlags + 2, %00010000 ; vance - dwb wDailyRematchFlags + 2, %00100000 ; wilton - dwb wDailyRematchFlags + 2, %01000000 ; parry - dwb wDailyRematchFlags + 2, %10000000 ; erin + engine_flag wDailyRematchFlags, 0 ; jack + engine_flag wDailyRematchFlags, 1 ; huey + engine_flag wDailyRematchFlags, 2 ; gaven + engine_flag wDailyRematchFlags, 3 ; beth ; $68 + engine_flag wDailyRematchFlags, 4 ; jose + engine_flag wDailyRematchFlags, 5 ; reena + engine_flag wDailyRematchFlags, 6 ; joey + engine_flag wDailyRematchFlags, 7 ; wade + engine_flag wDailyRematchFlags + 1, 0 ; ralph + engine_flag wDailyRematchFlags + 1, 1 ; liz + engine_flag wDailyRematchFlags + 1, 2 ; anthony + engine_flag wDailyRematchFlags + 1, 3 ; todd ; $70 + engine_flag wDailyRematchFlags + 1, 4 ; gina + engine_flag wDailyRematchFlags + 1, 5 ; arnie + engine_flag wDailyRematchFlags + 1, 6 ; alan + engine_flag wDailyRematchFlags + 1, 7 ; dana + engine_flag wDailyRematchFlags + 2, 0 ; chad + engine_flag wDailyRematchFlags + 2, 1 ; tully + engine_flag wDailyRematchFlags + 2, 2 ; brent + engine_flag wDailyRematchFlags + 2, 3 ; tiffany ; $78 + engine_flag wDailyRematchFlags + 2, 4 ; vance + engine_flag wDailyRematchFlags + 2, 5 ; wilton + engine_flag wDailyRematchFlags + 2, 6 ; parry + engine_flag wDailyRematchFlags + 2, 7 ; erin - dwb wDailyPhoneItemFlags, %00000001 ; beverly has nugget - dwb wDailyPhoneItemFlags, %00000010 ; jose has star piece - dwb wDailyPhoneItemFlags, %00000100 ; wade has item (see bittable1 $032b-e) - dwb wDailyPhoneItemFlags, %00001000 ; gina has leaf stone ; $80 - dwb wDailyPhoneItemFlags, %00010000 ; alan has fire stone - dwb wDailyPhoneItemFlags, %00100000 ; liz has thunderstone - dwb wDailyPhoneItemFlags, %01000000 ; derek has nugget - dwb wDailyPhoneItemFlags, %10000000 ; tully has water stone + engine_flag wDailyPhoneItemFlags, 0 ; beverly has nugget + engine_flag wDailyPhoneItemFlags, 1 ; jose has star piece + engine_flag wDailyPhoneItemFlags, 2 ; wade has item (see bittable1 $032b-e) + engine_flag wDailyPhoneItemFlags, 3 ; gina has leaf stone ; $80 + engine_flag wDailyPhoneItemFlags, 4 ; alan has fire stone + engine_flag wDailyPhoneItemFlags, 5 ; liz has thunderstone + engine_flag wDailyPhoneItemFlags, 6 ; derek has nugget + engine_flag wDailyPhoneItemFlags, 7 ; tully has water stone - dwb wDailyPhoneItemFlags + 1, %00000001 ; tiffany has pink bow - dwb wDailyPhoneItemFlags + 1, %00000010 ; wilton has item (see bittable1 $032f-31) + engine_flag wDailyPhoneItemFlags + 1, 0 ; tiffany has pink bow + engine_flag wDailyPhoneItemFlags + 1, 1 ; wilton has item (see bittable1 $032f-31) - dwb wDailyPhoneTimeOfDayFlags, %00000001 - dwb wDailyPhoneTimeOfDayFlags, %00000010 ; $88 - dwb wDailyPhoneTimeOfDayFlags, %00000100 - dwb wDailyPhoneTimeOfDayFlags, %00001000 - dwb wDailyPhoneTimeOfDayFlags, %00010000 - dwb wDailyPhoneTimeOfDayFlags, %00100000 - dwb wDailyPhoneTimeOfDayFlags, %01000000 - dwb wDailyPhoneTimeOfDayFlags, %10000000 + engine_flag wDailyPhoneTimeOfDayFlags, 0 + engine_flag wDailyPhoneTimeOfDayFlags, 1 ; $88 + engine_flag wDailyPhoneTimeOfDayFlags, 2 + engine_flag wDailyPhoneTimeOfDayFlags, 3 + engine_flag wDailyPhoneTimeOfDayFlags, 4 + engine_flag wDailyPhoneTimeOfDayFlags, 5 + engine_flag wDailyPhoneTimeOfDayFlags, 6 + engine_flag wDailyPhoneTimeOfDayFlags, 7 - dwb wDailyPhoneTimeOfDayFlags + 1, %00000001 - dwb wDailyPhoneTimeOfDayFlags + 1, %00000010 ; $90 - dwb wDailyPhoneTimeOfDayFlags + 1, %00000100 - dwb wDailyPhoneTimeOfDayFlags + 1, %00001000 - dwb wDailyPhoneTimeOfDayFlags + 1, %00010000 - dwb wDailyPhoneTimeOfDayFlags + 1, %00100000 - dwb wDailyPhoneTimeOfDayFlags + 1, %01000000 - dwb wDailyPhoneTimeOfDayFlags + 1, %10000000 + engine_flag wDailyPhoneTimeOfDayFlags + 1, 0 + engine_flag wDailyPhoneTimeOfDayFlags + 1, 1 ; $90 + engine_flag wDailyPhoneTimeOfDayFlags + 1, 2 + engine_flag wDailyPhoneTimeOfDayFlags + 1, 3 + engine_flag wDailyPhoneTimeOfDayFlags + 1, 4 + engine_flag wDailyPhoneTimeOfDayFlags + 1, 5 + engine_flag wDailyPhoneTimeOfDayFlags + 1, 6 + engine_flag wDailyPhoneTimeOfDayFlags + 1, 7 - dwb wDailyPhoneTimeOfDayFlags + 2, %00000001 - dwb wDailyPhoneTimeOfDayFlags + 2, %00000010 ; $98 - dwb wDailyPhoneTimeOfDayFlags + 2, %00000100 - dwb wDailyPhoneTimeOfDayFlags + 2, %00001000 - dwb wDailyPhoneTimeOfDayFlags + 2, %00010000 - dwb wDailyPhoneTimeOfDayFlags + 2, %00100000 - dwb wDailyPhoneTimeOfDayFlags + 2, %01000000 - dwb wDailyPhoneTimeOfDayFlags + 2, %10000000 + engine_flag wDailyPhoneTimeOfDayFlags + 2, 0 + engine_flag wDailyPhoneTimeOfDayFlags + 2, 1 ; $98 + engine_flag wDailyPhoneTimeOfDayFlags + 2, 2 + engine_flag wDailyPhoneTimeOfDayFlags + 2, 3 + engine_flag wDailyPhoneTimeOfDayFlags + 2, 4 + engine_flag wDailyPhoneTimeOfDayFlags + 2, 5 + engine_flag wDailyPhoneTimeOfDayFlags + 2, 6 + engine_flag wDailyPhoneTimeOfDayFlags + 2, 7 - dwb wd45b, %00000100 ; female player has been transformed into male + engine_flag wPlayerSpriteSetupFlags, 2 ; female player has been transformed into male - dwb SwarmFlags, %00000100 ; dunsparce swarm ; $a0 - dwb SwarmFlags, %00001000 ; yanma swarm + engine_flag SwarmFlags, 2 ; dunsparce swarm ; $a0 + engine_flag SwarmFlags, 3 ; yanma swarm diff --git a/engine/events.asm b/engine/events.asm index b0f9fb769..961a7f517 100644 --- a/engine/events.asm +++ b/engine/events.asm @@ -123,7 +123,7 @@ StartMap: ; 96724 ld hl, MapStatus ld bc, $3e ; 62 call ByteFill - callba Function113e5 + callba InitCallReceiveDelay call ClearJoypad ; fallthrough ; 9673e @@ -138,19 +138,19 @@ EnterMap: ; 9673e call ClearAllScriptFlags3 ld a, [hMapEntryMethod] - cp $f7 + cp MAPSETUP_07 jr nz, .dontset call SetAll_ScriptFlags3 .dontset ld a, [hMapEntryMethod] - cp $f3 + cp MAPSETUP_RELOADMAP jr nz, .dontresetpoison xor a ld [PoisonStepCount], a .dontresetpoison - xor a + xor a ; end map entry ld [hMapEntryMethod], a ld a, 2 ; HandleMap ld [MapStatus], a @@ -285,12 +285,12 @@ Function96812: ; 96812 PlayerEvents: ; 9681f xor a - +; If there's already a player event, don't interrupt it. ld a, [ScriptRunning] and a ret nz - call Function968e4 + call Dummy_CheckScriptFlags3Bit5 ; This is a waste of time call CheckTrainerBattle3 jr c, .ok @@ -298,13 +298,13 @@ PlayerEvents: ; 9681f call CheckTileEvent jr c, .ok - call Function97c30 + call RunMemScript jr c, .ok - call Function968ec + call DoMapTrigger jr c, .ok - call Function9693a + call CheckTimeEvents jr c, .ok call OWPlayerInput @@ -320,7 +320,7 @@ PlayerEvents: ; 9681f pop af ld [ScriptRunning], a - call Function96beb + call DoPlayerEvent ld a, [ScriptRunning] cp 4 jr z, .ok2 @@ -361,7 +361,7 @@ CheckTileEvent: ; 96874 callba CheckMovingOffEdgeOfMap jr c, .return4 - call Function2238 + call CheckWarpTile jr c, .return6 .bit2 @@ -436,11 +436,11 @@ SetUpFiveStepWildEncounterCooldown: ; 968d1 ret ; 968d7 -Function968d7: ; 968d7 +ret_968d7: ; 968d7 ret -; 968d8 +;968d8 -Function968d8: ; 968d8 +SetMinTwoStepWildEncounterCooldown: ; 968d8 ld a, [wWildEncounterCooldown] cp 2 ret nc @@ -449,15 +449,15 @@ Function968d8: ; 968d8 ret ; 968e4 -Function968e4: ; 968e4 +Dummy_CheckScriptFlags3Bit5: ; 968e4 call CheckBit5_ScriptFlags3 ret z - call Function2f3e + call ret_2f3e ret ; 968ec -Function968ec: ; 968ec - ld a, [wdc07] +DoMapTrigger: ; 968ec + ld a, [wCurrMapTriggerCount] and a jr z, .nope @@ -468,7 +468,7 @@ Function968ec: ; 968ec ld e, a ld d, 0 - ld hl, wdc07 + 1 + ld hl, wCurrMapTriggerHeaderPointer ld a, [hli] ld h, [hl] ld l, a @@ -505,23 +505,23 @@ endr ret ; 9693a -Function9693a: ; 9693a - ld a, [InLinkBattle] +CheckTimeEvents: ; 9693a + ld a, [wLinkMode] and a jr nz, .nothing ld hl, StatusFlags2 bit 2, [hl] - jr z, .asm_96951 + jr z, .do_daily - callba Function114a4 - jr c, .elevator + callba CheckBugContestTimer + jr c, .end_bug_contest xor a ret -.asm_96951 - callba Function11452 - callba Function114e7 +.do_daily + callba CheckDailyResetTimer + callba CheckPokerusTrick callba CheckPhoneCall ret c @@ -529,7 +529,7 @@ Function9693a: ; 9693a xor a ret -.elevator +.end_bug_contest ld a, BANK(BugCatchingContestOverScript) ld hl, BugCatchingContestOverScript call CallScript @@ -537,7 +537,7 @@ Function9693a: ; 9693a ret ; 96970 -Function96970: ; 96970 +.unused ; 96970 ld a, 8 scf ret @@ -856,7 +856,7 @@ PlayerMovement: ; 96af0 ; 96b10 .seven ; 96b10 - call Function968d7 ; empty + call ret_968d7 ; mobile xor a ld c, a ret @@ -898,7 +898,7 @@ PlayerMovement: ; 96af0 CheckMenuOW: ; 96b30 xor a - ld [$ffa0], a + ld [hMenuReturn], a ld [$ffa1], a ld a, [hJoyPressed] @@ -940,9 +940,9 @@ SelectMenuScript: ; 96b5f StartMenuCallback: SelectMenuCallback: ; 96b66 - copybytetovar $ffa0 - if_equal %10000000, .Script - if_equal -1, .Asm + copybytetovar hMenuReturn + if_equal HMENURETURN_SCRIPT, .Script + if_equal HMENURETURN_ASM, .Asm end ; 96b72 @@ -957,75 +957,85 @@ SelectMenuCallback: ; 96b66 CountStep: ; 96b79 - ld a, [InLinkBattle] + ; Don't count steps in link communication rooms. + ld a, [wLinkMode] and a jr nz, .done - callba Function90136 - jr c, .setminus1 + ; If there is a special phone call, don't count the step. + callba CheckSpecialPhoneCall + jr c, .doscript - call Function96bd7 - jr c, .setminus1 + ; If Repel wore off, don't count the step. + call DoRepelStep + jr c, .doscript + ; Count the step for poison and total steps ld hl, PoisonStepCount inc [hl] ld hl, StepCount inc [hl] - jr nz, .asm_96b9c + ; Every 256 steps, increase the happiness of all your Pokemon. + jr nz, .skip_happiness callba StepHappiness -.asm_96b9c +.skip_happiness + ; Every 256 steps, offset from the happiness incrementor by 128 steps, + ; decrease the hatch counter of all your eggs until you reach the first + ; one that is ready to hatch. ld a, [StepCount] cp $80 - jr nz, .asm_96bab + jr nz, .skip_egg - callba Function16f3e - jr nz, .set8 + callba DoEggStep + jr nz, .hatch -.asm_96bab +.skip_egg + ; Increase the EXP of (both) DayCare Pokemon by 1. callba DaycareStep + ; Every four steps, deal damage to all Poisoned Pokemon ld hl, PoisonStepCount ld a, [hl] cp 4 - jr c, .poisoned + jr c, .skip_poison ld [hl], 0 - callba Function505da - jr c, .setminus1 + callba DoPoisonStep + jr c, .doscript -.poisoned - callba Function97db3 +.skip_poison + callba DoBikeStep .done xor a ret -.setminus1 +.doscript ld a, -1 scf ret -.set8 +.hatch ld a, 8 scf ret ; 96bd3 -Function96bd3: ; 96bd3 +.unreferenced: ; 96bd3 ld a, 7 scf ret ; 96bd7 -Function96bd7: ; 96bd7 - ld a, [wdca1] +DoRepelStep: ; 96bd7 + ld a, [wRepelEffect] and a ret z dec a - ld [wdca1], a + ld [wRepelEffect], a ret nz ld a, BANK(RepelWoreOffScript) ld hl, RepelWoreOffScript @@ -1034,11 +1044,11 @@ Function96bd7: ; 96bd7 ret ; 96beb -Function96beb: ; 96beb +DoPlayerEvent: ; 96beb ld a, [ScriptRunning] and a ret z - cp -1 + cp -1 ; run script ret z cp 10 ret nc @@ -1059,17 +1069,17 @@ endr ; 96c0c ScriptPointers96c0c: ; 96c0c - dbw BANK(Invalid_0x96c2d), Invalid_0x96c2d - dbw BANK(SeenByTrainerScript), SeenByTrainerScript - dbw BANK(TalkToTrainerScript), TalkToTrainerScript - dbw BANK(FindItemInBallScript), FindItemInBallScript - dbw BANK(UnknownScript_0x96c4d), UnknownScript_0x96c4d - dbw BANK(WarpToNewMapScript), WarpToNewMapScript - dbw BANK(FallIntoMapScript), FallIntoMapScript - dbw BANK(UnknownScript_0x124c8), UnknownScript_0x124c8 - dbw BANK(HatchEggScript), HatchEggScript - dbw BANK(UnknownScript_0x96c4f), UnknownScript_0x96c4f - dbw BANK(Invalid_0x96c2d), Invalid_0x96c2d + dba Invalid_0x96c2d + dba SeenByTrainerScript + dba TalkToTrainerScript + dba FindItemInBallScript + dba UnknownScript_0x96c4d + dba WarpToNewMapScript + dba FallIntoMapScript + dba UnknownScript_0x124c8 + dba HatchEggScript + dba UnknownScript_0x96c4f + dba Invalid_0x96c2d ; 96c2d Invalid_0x96c2d: ; 96c2d @@ -1087,16 +1097,16 @@ HatchEggScript: ; 96c2f WarpToNewMapScript: ; 96c34 warpsound - newloadmap $f5 + newloadmap MAPSETUP_05 end ; 96c38 FallIntoMapScript: ; 96c38 - newloadmap $f6 + newloadmap MAPSETUP_06 playsound SFX_KINESIS applymovement PLAYER, MovementData_0x96c48 playsound SFX_STRENGTH - scall UnknownScript_0x96c4a + scall LandAfterPitfallScript end ; 96c48 @@ -1105,7 +1115,7 @@ MovementData_0x96c48: ; 96c48 step_end ; 96c4a -UnknownScript_0x96c4a: ; 96c4a +LandAfterPitfallScript: ; 96c4a earthquake 16 end ; 96c4d diff --git a/engine/events_2.asm b/engine/events_2.asm index 96ebfb515..966fa7d20 100644 --- a/engine/events_2.asm +++ b/engine/events_2.asm @@ -8,33 +8,39 @@ WarpToSpawnPoint:: ; 97c28 ret ; 97c30 -Function97c30:: ; 97c30 - ld a, [wd45c] +RunMemScript:: ; 97c30 +; If there is no script here, we don't need to be here. + ld a, [wMapReentryScriptQueueFlag] and a ret z - ld hl, wd45c + 2 +; Execute the script at (wMapReentryScriptBank):(wMapReentryScriptAddress). + ld hl, wMapReentryScriptAddress ld a, [hli] ld h, [hl] ld l, a - ld a, [wd45c + 1] + ld a, [wMapReentryScriptBank] call CallScript scf +; Clear the buffer for the next script. push af xor a - ld hl, wd45c + ld hl, wMapReentryScriptQueueFlag ld bc, 8 call ByteFill pop af ret ; 97c4f -Function97c4f:: ; 97c4f - ld hl, wd45c +LoadScriptBDE:: ; 97c4f +; If there's already a script here, don't overwrite. + ld hl, wMapReentryScriptQueueFlag ld a, [hl] and a ret nz +; Set the flag ld [hl], 1 inc hl +; Load the script pointer b:de into (wMapReentryScriptBank):(wMapReentryScriptAddress) ld [hl], b inc hl ld [hl], e @@ -262,46 +268,60 @@ ContestMons: ; 97d87 db -1, VENOMOTH, 30, 40 ; 97db3 -Function97db3:: ; 97db3 +DoBikeStep:: ; 97db3 nop nop - ; fallthrough -; 97db5 - -Function97db5: ; 97db5 + ; If the bike shop owner doesn't have our number, or + ; if we've already gotten the call, we don't have to + ; be here. ld hl, StatusFlags2 bit 4, [hl] jr z, .NoCall + + ; If we're not on the bike, we don't have to be here. ld a, [PlayerState] - cp 1 + cp PLAYER_BIKE jr nz, .NoCall + + ; If we're not in an area of phone service, we don't + ; have to be here. call GetMapHeaderPhoneServiceNybble and a jr nz, .NoCall - ld hl, wdca1 + 1 + + ; Check the bike step count and check whether we've + ; taken 65536 of them yet. + ld hl, wBikeStep ld a, [hli] ld d, a ld e, [hl] - cp -1 - jr nz, .asm_97dd8 + cp 255 + jr nz, .increment ld a, e - cp -1 - jr z, .asm_97ddc + cp 255 + jr z, .dont_increment -.asm_97dd8 +.increment inc de ld [hl], e dec hl ld [hl], d -.asm_97ddc +.dont_increment + ; If we've taken at least 1024 steps, have the bike + ; shop owner try to call us. ld a, d - cp $4 + cp 1024 >> 8 jr c, .NoCall + + ; If a call has already been queued, don't overwrite + ; that call. ld a, [wSpecialPhoneCallID] and a jr nz, .NoCall - ld a, 6 + + ; Queue the call. + ld a, SPECIALCALL_BIKESHOP ld [wSpecialPhoneCallID], a xor a ld [wSpecialPhoneCallID + 1], a @@ -488,7 +508,7 @@ Function97eb7: ; 97eb7 ; 97eb8 Function97eb8: ; 97eb8 - call Function2f3e + call ret_2f3e ret ; 97ebc diff --git a/engine/fruit_trees.asm b/engine/fruit_trees.asm index 9404a5564..9002404fd 100644 --- a/engine/fruit_trees.asm +++ b/engine/fruit_trees.asm @@ -58,7 +58,7 @@ CheckFruitTree: ; 44055 ; 4405f PickedFruitTree: ; 4405f - callba Function10609b ; empty function + callba MobileFn_10609b ; empty function ld b, 1 jp GetFruitTreeFlag ; 4406a diff --git a/engine/map_objects.asm b/engine/map_objects.asm index d9282d965..d73ebd142 100644 --- a/engine/map_objects.asm +++ b/engine/map_objects.asm @@ -2196,7 +2196,7 @@ Function4ecd: ; 4ecd add hl, bc ld a, [hl] ld b, a - callba Function807e + callba CopyDECoordsToMapObject pop bc ld hl, OBJECT_FLAGS add hl, bc @@ -3064,7 +3064,7 @@ Function579d: ; 579d ; 57bc Function57bc: ; 57bc - ld hl, wd45b + ld hl, wPlayerSpriteSetupFlags bit 7, [hl] jr nz, .ok ret @@ -3076,10 +3076,10 @@ Function57bc: ; 57bc ; 57ca Function57ca: ; 57ca - ld hl, wd45b + ld hl, wPlayerSpriteSetupFlags bit 5, [hl] ret z - ld a, [wd45b] + ld a, [wPlayerSpriteSetupFlags] and 3 rept 2 add a @@ -3137,7 +3137,7 @@ Function5803:: ; 5803 Function5815: ; 5815 call Function18de ret c - ld a, [$ffb0] + ld a, [hConnectedMapWidth] ld [wd4cd], a ret ; 581f @@ -3166,7 +3166,7 @@ Function582c: ; 582c ld hl, OBJECT_09 add hl, bc ld [hl], 0 - ld a, [$ffb0] + ld a, [hConnectedMapWidth] ld [wd4ce], a ret ; 5847 diff --git a/engine/map_setup.asm b/engine/map_setup.asm index f89d68a19..8b1e3a7fe 100644 --- a/engine/map_setup.asm +++ b/engine/map_setup.asm @@ -31,57 +31,6 @@ MapSetupScripts: ; 15377 dw MapSetupScript12 ; 1538f - -; Command descriptions from Condensation water's scripting compendium. - const_def - const map_lcd_on ; 00 = Turn LCD on - const map_lcd_off ; 01 = Turn LCD off - const map_sound_off ; 02 = Turn speakers off - const map_music ; 03 = Music check for current map/ special check for bug catcher contest - const map_start_music ; 04 = Start map music anew - const map_fade_music ; 05 = Music check for current map / special check for Bug Contest/ music with FadeOut (old) and FadeIn - const map_fade ; 06 = Fade out music + screen - const map_bike_music ; 07 = If HIRO is on bike = bike music, else play map music - const map_music_force ; 08 = Play map music - const map_max_volume ; 09 = Turn music to highest volume - const map_load_blocks ; 0A = Write map data to MapRAM - const map_connection_blocks ; 0B = Compute map’s connection pars and write into MapRAM - const map_save_screen ; 0C = Write current part of map into temporary memory - const map_buffer_screen ; 0D = Write current part of map into read-from memory - const map_load_graphics ; 0E = Write tileset header to ram/ load tileset/ load sprite tiles/ load special tiles - const map_load_tileset_header ; 0F = Write tileset header to ram - const map_time_of_day ; 10 = Compute time of day/ Update screen - const map_palettes ; 11 = Load map palettes - const map_wildmons ; 12 = Load probabilities for wild Pokémon battles - const map_sprites ; 13 = Delete sprite data and draw new sprites - const map_change_callback ; 14 = Check 2nd script header for 05 and 03 callbacks - const map_start_callback ; 15 = Check 2nd script header for 03 callbacks - const map_load_objects ; 16 = Analyze people data anew and check 2nd script header for 02 callbacks - const map_load_spawn ; 17 = Writes arrival data for arrival by flying/Blackout from table 05:5319 to ram - const map_load_connection ; 18 = Writes arrival data for entering a map by connection to ram - const map_load_warp ; 19 = Write warp data to ram when entering warp - const map_attributes ; 1A = Load complete map data (primary, secondary, event, script headers) - const map_attributes_2 ; 1B = Same as 1A, but some settings aren’t loaded new from the rom, such as hide function of the people events - const map_clear_bg_palettes ; 1C = Fill palette data with FFFF (=white) - const map_fade_out_palettes ; 1D = All BG pallet color are converted to 0|0 (Pal0, Col0), all sprite colors to x|0 (FadeOut) - const map_fade_in_palettes ; 1E = Palette FadeIn - const map_anchor_screen ; 1F = Compute position of upper left-most block visible on screen - const map_warp_face ; 20 = Position computation when HIRO leaves a warp - const map_face_down ; 21 = Set HIRO’s facing to “down” - const map_spawn_coord ; 22 = Prepare HIRO data for arrival by flight - const map_player_coord ; 23 = Compute HIRO x/y data anew - const map_prolong_sprites ; 24 = Prolong old sprites before removing them - const map_delay_sprites ; 25 = Delay rendering new sprites - const map_update_roam ; 26 = Compute chances to meet Raikou, Entei or Suicune - const map_keep_roam ; 27 = Recover chances to meet Raikou, Entei or Suicune - const map_fade_out_music ; 28 = Temporarily stop music playing - const map_animations_on ; 29 = Activate animations - const map_animations_off ; 2A = Deactivate animations - const map_keep_palettes ; 2B = Recover all palettes - const map_text_scroll_off ; 2C = Turn off text scroll (for town name overlays) - const map_stop_script ; 2D = Deactivate code prolonging - - MapSetupScript4: ; 1538f db map_prolong_sprites @@ -112,7 +61,7 @@ MapSetupScript1: ; 15392 db map_fade_in_palettes db map_animations_on db map_wildmons - db -1 + db map_end_setup_script MapSetupScript11: ; 153a9 db map_load_spawn @@ -136,7 +85,7 @@ MapSetupScript11: ; 153a9 db map_fade_in_palettes db map_animations_on db map_wildmons - db -1 + db map_end_setup_script MapSetupScript7: ; 153bf db map_animations_off @@ -155,7 +104,7 @@ MapSetupScript7: ; 153bf db map_wildmons db map_update_roam db map_animations_on - db -1 + db map_end_setup_script MapSetupScript6: ; 153d0 db map_prolong_sprites @@ -184,7 +133,7 @@ MapSetupScript9: ; 153d2 db map_animations_on db map_wildmons db map_update_roam - db -1 + db map_end_setup_script MapSetupScript3: ; 153e7 db map_fade @@ -202,7 +151,7 @@ MapSetupScript3: ; 153e7 db map_fade_in_palettes db map_animations_on db map_wildmons - db -1 + db map_end_setup_script MapSetupScript8: ; 153f7 db map_fade @@ -221,7 +170,7 @@ MapSetupScript8: ; 153f7 db map_animations_on db map_wildmons db map_text_scroll_off - db -1 + db map_end_setup_script MapSetupScript2: ; 15408 db map_lcd_off @@ -241,12 +190,12 @@ MapSetupScript2: ; 15408 db map_fade_in_palettes db map_animations_on db map_wildmons - db -1 + db map_end_setup_script MapSetupScript10: ; 1541a db map_load_blocks db map_connection_blocks - db -1 + db map_end_setup_script ReadMapSetupScript: ; 1541d @@ -374,13 +323,13 @@ Function154ea: ; 154ea ; 154eb DelayClearingOldSprites: ; 154eb - ld hl, wd45b + ld hl, wPlayerSpriteSetupFlags set 7, [hl] ret ; 154f1 DelayLoadingNewSprites: ; 154f1 - ld hl, wd45b + ld hl, wPlayerSpriteSetupFlags set 6, [hl] ret diff --git a/engine/more_phone_scripts.asm b/engine/more_phone_scripts.asm index a2192514e..5bc1f1560 100644 --- a/engine/more_phone_scripts.asm +++ b/engine/more_phone_scripts.asm @@ -1656,5 +1656,5 @@ UnknownScript_0xa0b04: BikeShopPhoneScript: farwritetext UnknownText_0x174000 clearflag ENGINE_BIKE_SHOP_CALL_ENABLED - specialphonecall ELMCALL_NONE + specialphonecall SPECIALCALL_NONE end diff --git a/engine/pack.asm b/engine/pack.asm index 84413e1cb..ecdb35c74 100644 --- a/engine/pack.asm +++ b/engine/pack.asm @@ -4,8 +4,8 @@ Pack: ; 10000 set 4, [hl] call Function1068a .loop - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] bit 7, a jr nz, .done call Function10026 @@ -21,7 +21,7 @@ Pack: ; 10000 ; 10026 Function10026: ; 10026 - ld a, [wcf63] + ld a, [wJumptableIndex] ld hl, Jumptable_10030 call Function1086b jp [hl] @@ -47,31 +47,31 @@ Function10046: ; 10046 (4:4046) ld [hBGMapMode], a ; $ff00+$d4 call Function10955 ld a, [wcf64] - ld [wcf63], a + ld [wJumptableIndex], a call Function10a40 ret Function10056: ; 10056 (4:4056) xor a ld [wcf65], a - call Function10a36 - call Function109bb - call Function1089a + call ClearPocketList + call DrawPocketName + call WaitBGMap_DrawPackGFX call Function10866 ret Function10067: ; 10067 (4:4067) ld hl, MenuDataHeader_0x10a4f call CopyMenuDataHeader - ld a, [wd0d9] - ld [wcf88], a + ld a, [wItemsPocketCursor] + ld [wPocketCursorBuffer], a ld a, [wd0df] ld [wd0e4], a call Function350c ld a, [wd0e4] ld [wd0df], a ld a, [wcfa9] - ld [wd0d9], a + ld [wItemsPocketCursor], a ld b, $7 ld c, $3 call Function108d4 @@ -82,24 +82,24 @@ Function10067: ; 10067 (4:4067) Function10094: ; 10094 (4:4094) ld a, $2 ld [wcf65], a - call Function10a36 - call Function109bb - call Function1089a + call ClearPocketList + call DrawPocketName + call WaitBGMap_DrawPackGFX call Function10866 ret Function100a6: ; 100a6 (4:40a6) ld hl, MenuDataHeader_0x10a7f call CopyMenuDataHeader - ld a, [wd0da] - ld [wcf88], a + ld a, [wKeyItemsPocketCursor] + ld [wPocketCursorBuffer], a ld a, [wd0e0] ld [wd0e4], a call Function350c ld a, [wd0e4] ld [wd0e0], a ld a, [wcfa9] - ld [wd0da], a + ld [wKeyItemsPocketCursor], a ld b, $3 ld c, $7 call Function108d4 @@ -110,11 +110,11 @@ Function100a6: ; 100a6 (4:40a6) Function100d3: ; 100d3 (4:40d3) ld a, $3 ld [wcf65], a - call Function10a36 - call Function109bb + call ClearPocketList + call DrawPocketName xor a ld [hBGMapMode], a ; $ff00+$d4 - call Function1089a + call WaitBGMap_DrawPackGFX call Function10866 ret @@ -125,7 +125,7 @@ Function100e8: ; 100e8 (4:40e8) call Function108d4 ret c callba _CheckTossableItem - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] and a jr nz, .asm_1010a ld hl, MenuDataHeader_0x1013b @@ -205,31 +205,31 @@ Function10159: ; 10159 xor a ld [hBGMapMode], a ; $ff00+$d4 call Function10955 - call Function1089a + call WaitBGMap_DrawPackGFX call Function10a40 ret Function10186: ; 10186 (4:4186) ld a, $1 ld [wcf65], a - call Function10a36 - call Function109bb - call Function1089a + call ClearPocketList + call DrawPocketName + call WaitBGMap_DrawPackGFX call Function10866 ret Function10198: ; 10198 (4:4198) ld hl, MenuDataHeader_0x10aaf call CopyMenuDataHeader - ld a, [wd0db] - ld [wcf88], a + ld a, [wBallsPocketCursor] + ld [wPocketCursorBuffer], a ld a, [wd0e1] ld [wd0e4], a call Function350c ld a, [wd0e4] ld [wd0e1], a ld a, [wcfa9] - ld [wd0db], a + ld [wBallsPocketCursor], a ld b, $1 ld c, $5 call Function108d4 @@ -239,54 +239,62 @@ Function10198: ; 10198 (4:4198) Function101c5: ; 101c5 (4:41c5) callba _CheckTossableItem - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] and a - jr nz, .asm_101f9 + jr nz, .tossable callba CheckSelectableItem - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] and a - jr nz, .asm_101eb + jr nz, .selectable callba CheckItemMenu - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] and a - jr nz, .asm_10207 - jr .asm_10227 -.asm_101eb + jr nz, .usable + jr .unusable + +.selectable callba CheckItemMenu - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] and a - jr nz, .asm_1020f - jr .asm_1022f -.asm_101f9 + jr nz, .selectable_usable + jr .selectable_unusable + +.tossable callba CheckSelectableItem - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] and a - jr nz, .asm_10217 - jr .asm_1021f -.asm_10207 + jr nz, .tossable_selectable + jr .tossable_unselectable + +.usable ld hl, MenuDataHeader_0x10249 ld de, Jumptable_1026a - jr .asm_10235 -.asm_1020f + jr .build_menu + +.selectable_usable ld hl, MenuDataHeader_0x10274 ld de, Jumptable_10291 - jr .asm_10235 -.asm_10217 + jr .build_menu + +.tossable_selectable ld hl, MenuDataHeader_0x10299 ld de, Jumptable_102ac - jr .asm_10235 -.asm_1021f + jr .build_menu + +.tossable_unselectable ld hl, MenuDataHeader_0x102b0 ld de, Jumptable_102c7 - jr .asm_10235 -.asm_10227 + jr .build_menu + +.unusable ld hl, MenuDataHeader_0x102cd ld de, Jumptable_102ea - jr .asm_10235 -.asm_1022f + jr .build_menu + +.selectable_unusable ld hl, MenuDataHeader_0x102f2 ld de, Jumptable_1030b -.asm_10235 +.build_menu push de call LoadMenuDataHeader call InterpretMenu2 @@ -350,7 +358,7 @@ Jumptable_10291: ; 10291 ; 10299 MenuDataHeader_0x10299: ; 0x10299 - db $40 ; flags + db %01000000 ; flags db 07, 13 ; start coords db 11, 19 ; end coords dw MenuData2_0x102a1 @@ -370,7 +378,7 @@ Jumptable_102ac: ; 102ac ; 102b0 MenuDataHeader_0x102b0: ; 0x102b0 - db $40 ; flags + db %01000000 ; flags db 05, 13 ; start coords db 11, 19 ; end coords dw MenuData2_0x102b8 @@ -439,54 +447,54 @@ Jumptable_1030b: ; 1030b Function10311: ; 10311 callba CheckItemMenu - ld a, [wd142] - ld hl, Jumptable_1031f + ld a, [wItemAttributeParamBuffer] + ld hl, .jumptable rst JumpTable ret ; 1031f -Jumptable_1031f: ; 1031f (4:431f) - dw Function1032d - dw Function1032d - dw Function1032d - dw Function1032d - dw Function10334 - dw Function10338 - dw Function10355 +.jumptable: ; 1031f (4:431f) + dw .Oak + dw .Oak + dw .Oak + dw .Oak + dw .Current + dw .Party + dw .Field ; 1035c -Function1032d: ; 1032d (4:432d) +.Oak: ; 1032d (4:432d) ld hl, UnknownText_0x10af3 call Function10889 ret -Function10334: ; 10334 (4:4334) +.Current: ; 10334 (4:4334) call DoItemEffect ret -Function10338: ; 10338 (4:4338) +.Party: ; 10338 (4:4338) ld a, [PartyCount] and a - jr z, .asm_1034e + jr z, .NoPokemon call DoItemEffect xor a ld [hBGMapMode], a ; $ff00+$d4 call Function10955 - call Function1089a + call WaitBGMap_DrawPackGFX call Function10a40 ret -.asm_1034e +.NoPokemon ld hl, UnknownText_0x10af8 call Function10889 ret -Function10355: ; 10355 (4:4355) +.Field: ; 10355 (4:4355) call DoItemEffect ld a, [wd0ec] and a - jr z, Function1032d + jr z, .Oak ld a, $a - ld [wcf63], a + ld [wJumptableIndex], a ret ; 10364 (4:4364) @@ -529,26 +537,26 @@ Function1039d: ; 1039d .asm_103aa xor a - ld [wd0db], a + ld [wBallsPocketCursor], a ld [wd0e1], a ret .asm_103b2 xor a - ld [wd0d9], a + ld [wItemsPocketCursor], a ld [wd0df], a ret .asm_103ba xor a - ld [wd0da], a + ld [wKeyItemsPocketCursor], a ld [wd0e0], a ret ; 103c2 Function103c2: ; 103c2 callba CheckSelectableItem - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] and a jr nz, .asm_103f6 ld a, [wcf65] @@ -605,7 +613,7 @@ Function103fd: ; 103fd call PrintText jr .asm_10427 .asm_10453 - ld a, [wcf63] + ld a, [wJumptableIndex] push af ld a, [wcf64] push af @@ -618,14 +626,14 @@ Function103fd: ; 103fd pop af ld [wcf64], a pop af - ld [wcf63], a + ld [wJumptableIndex], a .asm_10475 pop af ld [Options], a xor a ld [hBGMapMode], a ; $ff00+$d4 call Function10955 - call Function1089a + call WaitBGMap_DrawPackGFX call Function10a40 ret @@ -651,8 +659,8 @@ BattlePack: ; 10493 set 4, [hl] call Function1068a .asm_1049b - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_104ad call Function104b9 @@ -668,7 +676,7 @@ BattlePack: ; 10493 ; 104b9 Function104b9: ; 104b9 - ld a, [wcf63] + ld a, [wJumptableIndex] ld hl, Jumptable_104c3 call Function1086b jp [hl] @@ -694,31 +702,31 @@ Function104d9: ; 104d9 (4:44d9) ld [hBGMapMode], a ; $ff00+$d4 call Function10955 ld a, [wcf64] - ld [wcf63], a + ld [wJumptableIndex], a call Function10a40 ret Function104e9: ; 104e9 (4:44e9) xor a ld [wcf65], a - call Function10a36 - call Function109bb - call Function1089a + call ClearPocketList + call DrawPocketName + call WaitBGMap_DrawPackGFX call Function10866 ret Function104fa: ; 104fa (4:44fa) ld hl, MenuDataHeader_0x10a4f call CopyMenuDataHeader - ld a, [wd0d9] - ld [wcf88], a + ld a, [wItemsPocketCursor] + ld [wPocketCursorBuffer], a ld a, [wd0df] ld [wd0e4], a call Function350c ld a, [wd0e4] ld [wd0df], a ld a, [wcfa9] - ld [wd0d9], a + ld [wItemsPocketCursor], a ld b, $7 ld c, $3 call Function108d4 @@ -729,24 +737,24 @@ Function104fa: ; 104fa (4:44fa) Function10527: ; 10527 (4:4527) ld a, $2 ld [wcf65], a - call Function10a36 - call Function109bb - call Function1089a + call ClearPocketList + call DrawPocketName + call WaitBGMap_DrawPackGFX call Function10866 ret Function10539: ; 10539 (4:4539) ld hl, MenuDataHeader_0x10a7f call CopyMenuDataHeader - ld a, [wd0da] - ld [wcf88], a + ld a, [wKeyItemsPocketCursor] + ld [wPocketCursorBuffer], a ld a, [wd0e0] ld [wd0e4], a call Function350c ld a, [wd0e4] ld [wd0e0], a ld a, [wcfa9] - ld [wd0da], a + ld [wKeyItemsPocketCursor], a ld b, $3 ld c, $7 call Function108d4 @@ -757,11 +765,11 @@ Function10539: ; 10539 (4:4539) Function10566: ; 10566 (4:4566) ld a, $3 ld [wcf65], a - call Function10a36 - call Function109bb + call ClearPocketList + call DrawPocketName xor a ld [hBGMapMode], a ; $ff00+$d4 - call Function1089a + call WaitBGMap_DrawPackGFX ld hl, UnknownText_0x10b0c call Function10889 call Function10866 @@ -780,24 +788,24 @@ Function10581: ; 10581 (4:4581) Function10594: ; 10594 (4:4594) ld a, $1 ld [wcf65], a - call Function10a36 - call Function109bb - call Function1089a + call ClearPocketList + call DrawPocketName + call WaitBGMap_DrawPackGFX call Function10866 ret Function105a6: ; 105a6 (4:45a6) ld hl, MenuDataHeader_0x10aaf call CopyMenuDataHeader - ld a, [wd0db] - ld [wcf88], a + ld a, [wBallsPocketCursor] + ld [wPocketCursorBuffer], a ld a, [wd0e1] ld [wd0e4], a call Function350c ld a, [wd0e4] ld [wd0e1], a ld a, [wcfa9] - ld [wd0db], a + ld [wBallsPocketCursor], a ld b, $1 ld c, $5 call Function108d4 @@ -807,18 +815,18 @@ Function105a6: ; 105a6 (4:45a6) Function105d3: ; 105d3 (4:45d3) callba CheckItemContext - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] Function105dc: ; 105dc (4:45dc) and a - jr z, .asm_105e7 - ld hl, MenuDataHeader_0x10601 - ld de, Jumptable_10614 - jr .asm_105ed -.asm_105e7 - ld hl, MenuDataHeader_0x10618 - ld de, Jumptable_10627 -.asm_105ed + jr z, .NoUse + ld hl, .UsableMenuDataHeader + ld de, .UsableJumptable + jr .proceed +.NoUse + ld hl, .UnusableMenuDataHeader + ld de, .UnusableJumptable +.proceed push de call LoadMenuDataHeader call InterpretMenu2 @@ -831,113 +839,115 @@ Function105dc: ; 105dc (4:45dc) jp [hl] ; 10601 (4:4601) -MenuDataHeader_0x10601: ; 0x10601 +.UsableMenuDataHeader: ; 0x10601 db $40 ; flags db 07, 13 ; start coords db 11, 19 ; end coords - dw MenuData2_0x10609 + dw .UsableMenuData2 db 1 ; default option ; 0x10609 -MenuData2_0x10609: ; 0x10609 +.UsableMenuData2: ; 0x10609 db $c0 ; flags db 2 ; items db "USE@" db "QUIT@" ; 0x10614 -Jumptable_10614: ; 10614 - dw Function10629 - dw Function10689 +.UsableJumptable: ; 10614 + dw .Use + dw .Quit ; 10618 -MenuDataHeader_0x10618: ; 0x10618 +.UnusableMenuDataHeader: ; 0x10618 db $40 ; flags db 09, 13 ; start coords db 11, 19 ; end coords - dw MenuData2_0x10620 + dw .UnusableMenuData2 db 1 ; default option ; 0x10620 -MenuData2_0x10620: ; 0x10620 +.UnusableMenuData2: ; 0x10620 db $c0 ; flags db 1 ; items db "QUIT@" ; 0x10627 -Jumptable_10627: ; 10627 - dw Function10689 +.UnusableJumptable: ; 10627 + dw .Quit ; 10629 -Function10629: ; 10629 +.Use: ; 10629 callba CheckItemContext - ld a, [wd142] - ld hl, Jumptable_10637 + ld a, [wItemAttributeParamBuffer] + ld hl, .ItemFunctionJumptable rst JumpTable ret -Jumptable_10637: ; 10637 (4:4637) - dw Function10645 - dw Function10645 - dw Function10645 - dw Function10645 - dw Function1064c - dw Function10656 - dw Function10671 +.ItemFunctionJumptable: ; 10637 (4:4637) + dw .Oak + dw .Oak + dw .Oak + dw .Oak + dw .Unused + dw .BattleField + dw .BattleOnly -Function10645: ; 10645 (4:4645) +.Oak: ; 10645 (4:4645) ld hl, UnknownText_0x10af3 call Function10889 ret -Function1064c: ; 1064c (4:464c) +.Unused: ; 1064c (4:464c) call DoItemEffect ld a, [wd0ec] and a - jr nz, asm_1066c + jr nz, .asm_1066c ret -Function10656: ; 10656 (4:4656) +.BattleField: ; 10656 (4:4656) call DoItemEffect ld a, [wd0ec] and a - jr nz, asm_1067e + jr nz, .asm_1067e xor a ld [hBGMapMode], a ; $ff00+$d4 call Function10955 - call Function1089a + call WaitBGMap_DrawPackGFX call Function10a40 ret -asm_1066c: ; 1066c (4:466c) - call WhiteBGMap - jr asm_1067e -Function10671: ; 10671 (4:4671) +.asm_1066c: ; 1066c (4:466c) + call WhiteBGMap + jr .asm_1067e + +.BattleOnly: ; 10671 (4:4671) call DoItemEffect ld a, [wd0ec] and a - jr z, Function10645 + jr z, .Oak cp $2 - jr z, asm_10684 -asm_1067e: ; 1067e (4:467e) + jr z, .asm_10684 +.asm_1067e: ; 1067e (4:467e) ld a, $a - ld [wcf63], a + ld [wJumptableIndex], a ret -asm_10684: ; 10684 (4:4684) + +.asm_10684: ; 10684 (4:4684) xor a ld [wd0ec], a ret ; 10689 (4:4689) -Function10689: ; 10689 +.Quit: ; 10689 ret ; 1068a Function1068a: ; 1068a xor a - ld [wcf63], a + ld [wJumptableIndex], a ld a, [wd0d6] and $3 ld [wcf65], a @@ -955,7 +965,7 @@ Function1068a: ; 1068a Function106a5: ; 106a5 xor a ld [hBGMapMode], a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [wcf65], a ld [wcf66], a @@ -974,7 +984,7 @@ Function106be: ; 106be ; 106c7 Function106c7: ; 106c7 - ld a, [wcf63] + ld a, [wJumptableIndex] ld hl, Jumptable_106d1 call Function1086b jp [hl] @@ -982,74 +992,74 @@ Function106c7: ; 106c7 Jumptable_106d1: ; 106d1 (4:46d1) - dw Function106d9 - dw Function1073b - dw Function106ff - dw Function10726 + dw .ItemsPocket + dw .BallsPocket + dw .KeyItemsPocket + dw .TMHMPocket -Function106d9: ; 106d9 (4:46d9) +.ItemsPocket: ; 106d9 (4:46d9) xor a - call Function10762 + call InitPocket ld hl, MenuDataHeader_0x10a67 call CopyMenuDataHeader - ld a, [wd0d9] - ld [wcf88], a + ld a, [wItemsPocketCursor] + ld [wPocketCursorBuffer], a ld a, [wd0df] ld [wd0e4], a call Function350c ld a, [wd0e4] ld [wd0df], a ld a, [wcfa9] - ld [wd0d9], a + ld [wItemsPocketCursor], a ret -Function106ff: ; 106ff (4:46ff) +.KeyItemsPocket: ; 106ff (4:46ff) ld a, $2 - call Function10762 + call InitPocket ld hl, MenuDataHeader_0x10a97 call CopyMenuDataHeader - ld a, [wd0da] - ld [wcf88], a + ld a, [wKeyItemsPocketCursor] + ld [wPocketCursorBuffer], a ld a, [wd0e0] ld [wd0e4], a call Function350c ld a, [wd0e4] ld [wd0e0], a ld a, [wcfa9] - ld [wd0da], a + ld [wKeyItemsPocketCursor], a ret -Function10726: ; 10726 (4:4726) +.TMHMPocket: ; 10726 (4:4726) ld a, $3 - call Function10762 - call Function1089a + call InitPocket + call WaitBGMap_DrawPackGFX callba Function2c76f ld a, [CurItem] ld [CurItem], a ret -Function1073b: ; 1073b (4:473b) +.BallsPocket: ; 1073b (4:473b) ld a, $1 - call Function10762 + call InitPocket ld hl, MenuDataHeader_0x10ac7 call CopyMenuDataHeader - ld a, [wd0db] - ld [wcf88], a + ld a, [wBallsPocketCursor] + ld [wPocketCursorBuffer], a ld a, [wd0e1] ld [wd0e4], a call Function350c ld a, [wd0e4] ld [wd0e1], a ld a, [wcfa9] - ld [wd0db], a + ld [wBallsPocketCursor], a ret -Function10762: ; 10762 (4:4762) +InitPocket: ; 10762 (4:4762) ld [wcf65], a - call Function10a36 - call Function109bb - call Function1089a + call ClearPocketList + call DrawPocketName + call WaitBGMap_DrawPackGFX ret @@ -1083,10 +1093,10 @@ Function1076f: ; 1076f ret .asm_10795 - ld a, [wcf63] + ld a, [wJumptableIndex] dec a and $3 - ld [wcf63], a + ld [wJumptableIndex], a push de ld de, SFX_UNKNOWN_62 call PlaySFX @@ -1095,10 +1105,10 @@ Function1076f: ; 1076f ret .asm_107a8 - ld a, [wcf63] + ld a, [wJumptableIndex] inc a and $3 - ld [wcf63], a + ld [wJumptableIndex], a push de ld de, SFX_UNKNOWN_62 call PlaySFX @@ -1112,7 +1122,7 @@ Function107bb: ; 107bb ld a, [InputType] or a jr z, .asm_107ca - callba Function1de28f + callba _DudeAutoInput_RightA .asm_107ca call Function107d7 @@ -1124,7 +1134,7 @@ Function107bb: ; 107bb ; 107d7 Function107d7: ; 107d7 - ld a, [wcf63] + ld a, [wJumptableIndex] ld hl, Jumptable_107e1 call Function1086b jp [hl] @@ -1157,8 +1167,8 @@ MenuData2_0x107f7: ; 0x107f7 db 5, 8 ; rows, columns db 2 ; horizontal spacing dbw 0, OTPartyMons - dbw BANK(Function24ab4), Function24ab4 - dbw BANK(Function24ac3), Function24ac3 + dbw BANK(PlaceMenuItemName), PlaceMenuItemName + dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity dbw BANK(Function244c3), Function244c3 ; 10807 @@ -1181,15 +1191,15 @@ MenuData2_0x10816: ; 0x10816 db 5, 8 ; rows, columns db 1 ; horizontal spacing dbw 0, OTPartyMon1Exp + 2 - dbw BANK(Function24ab4), Function24ab4 - dbw BANK(Function24ac3), Function24ac3 + dbw BANK(PlaceMenuItemName), PlaceMenuItemName + dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity dbw BANK(Function244c3), Function244c3 ; 10826 Function10826: ; 10826 (4:4826) ld a, $3 - call Function10762 - call Function1089a + call InitPocket + call WaitBGMap_DrawPackGFX callba Function2c76f ld a, [CurItem] ld [CurItem], a @@ -1214,21 +1224,21 @@ MenuData2_0x1084a: ; 0x1084a db 5, 8 ; rows, columns db 2 ; horizontal spacing dbw 0, OTPartyMon1CaughtGender - dbw BANK(Function24ab4), Function24ab4 - dbw BANK(Function24ac3), Function24ac3 + dbw BANK(PlaceMenuItemName), PlaceMenuItemName + dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity dbw BANK(Function244c3), Function244c3 ; 1085a Function1085a: ; 1085a (4:485a) push hl - call Function10762 + call InitPocket pop hl call CopyMenuDataHeader call Function350c ret Function10866: ; 10866 (4:4866) - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret @@ -1245,14 +1255,14 @@ endr ; 10874 Function10874: ; 10874 (4:4874) - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] xor a ld [wcf66], a ret Function1087e: ; 1087e (4:487e) - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ld a, $1 ld [wcf66], a @@ -1268,23 +1278,23 @@ Function10889: ; 10889 (4:4889) ld [Options], a ret -Function1089a: ; 1089a (4:489a) +WaitBGMap_DrawPackGFX: ; 1089a (4:489a) call WaitBGMap -Function1089d: ; 1089d +DrawPackGFX: ; 1089d ld a, [wcf65] and $3 ld e, a ld d, $0 ld a, [BattleType] cp BATTLETYPE_TUTORIAL - jr z, .asm_108b3 + jr z, .male_dude ld a, [PlayerGender] bit 0, a - jr nz, .asm_108c5 + jr nz, .female -.asm_108b3 +.male_dude ld hl, PackGFXPointers rept 2 add hl, de @@ -1292,13 +1302,13 @@ endr ld a, [hli] ld e, a ld d, [hl] - ld hl, $9500 + ld hl, VTiles2 tile $50 lb bc, BANK(PackGFX), 15 call Request2bpp ret -.asm_108c5 - callba Function48e81 +.female + callba DrawKrisPackGFX ret ; 108cc @@ -1336,12 +1346,12 @@ Function108d4: ; 108d4 (4:48d4) ret .asm_108fa ld a, $9 - ld [wcf63], a + ld [wJumptableIndex], a scf ret .asm_10901 ld a, b - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a push de ld de, SFX_UNKNOWN_62 @@ -1351,7 +1361,7 @@ Function108d4: ; 108d4 (4:48d4) ret .asm_10912 ld a, c - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a push de ld de, SFX_UNKNOWN_62 @@ -1412,13 +1422,13 @@ Function10955: ; 10955 inc a dec c jr nz, .asm_1098a - call Function109bb + call DrawPocketName call Function109a5 hlcoord 0, 12 lb bc, 4, 18 call TextBox call EnableLCD - call Function1089d + call DrawPackGFX ret ; 109a5 @@ -1440,7 +1450,7 @@ Function109a5: ; 109a5 ret ; 109bb -Function109bb: ; 109bb +DrawPocketName: ; 109bb ld a, [wcf65] ; * 15 @@ -1450,30 +1460,30 @@ Function109bb: ; 109bb ld d, 0 ld e, a - ld hl, Tilemap_109e1 + ld hl, .tilemap add hl, de ld d, h ld e, l hlcoord 0, 7 ld c, 3 -.asm_109d0 +.row ld b, 5 -.asm_109d2 +.col ld a, [de] inc de ld [hli], a dec b - jr nz, .asm_109d2 + jr nz, .col ld a, c - ld c, 15 + ld c, SCREEN_WIDTH - 5 add hl, bc ld c, a dec c - jr nz, .asm_109d0 + jr nz, .row ret ; 109e1 -Tilemap_109e1: ; 109e1 +.tilemap: ; 109e1 db $00, $04, $04, $04, $01, $06, $07, $08, $09, $0a, $02, $05, $05, $05, $03 db $00, $04, $04, $04, $01, $15, $16, $17, $18, $19, $02, $05, $05, $05, $03 db $00, $04, $04, $04, $01, $0b, $0c, $0d, $0e, $0f, $02, $05, $05, $05, $03 @@ -1491,21 +1501,21 @@ Function10a1d: ; 10a1d Function10a2a: ; 10a2a hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - ld a, $7f + ld a, " " call ByteFill ret ; 10a36 -Function10a36: ; 10a36 (4:4a36) +ClearPocketList: ; 10a36 (4:4a36) hlcoord 5, 2 - ld bc, $a0f + lb bc, 10, SCREEN_WIDTH - 5 call ClearBox ret Function10a40: ; 10a40 call WaitBGMap - ld b, $14 + ld b, SCREEN_WIDTH call GetSGBLayout call Function32f9 call DelayFrame @@ -1525,8 +1535,8 @@ MenuData2_0x10a57: ; 0x10a57 db 5, 8 ; rows, columns db 2 ; horizontal spacing dbw 0, NumItems - dbw BANK(Function24ab4), Function24ab4 - dbw BANK(Function24ac3), Function24ac3 + dbw BANK(PlaceMenuItemName), PlaceMenuItemName + dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity dbw BANK(Function244c3), Function244c3 ; 10a67 @@ -1543,8 +1553,8 @@ MenuData2_0x10a6f: ; 0x10a6f db 5, 8 ; rows, columns db 2 ; horizontal spacing dbw 0, NumItems - dbw BANK(Function24ab4), Function24ab4 - dbw BANK(Function24ac3), Function24ac3 + dbw BANK(PlaceMenuItemName), PlaceMenuItemName + dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity dbw BANK(Function244c3), Function244c3 ; 10a7f @@ -1561,8 +1571,8 @@ MenuData2_0x10a87: ; 0x10a87 db 5, 8 ; rows, columns db 1 ; horizontal spacing dbw 0, NumKeyItems - dbw BANK(Function24ab4), Function24ab4 - dbw BANK(Function24ac3), Function24ac3 + dbw BANK(PlaceMenuItemName), PlaceMenuItemName + dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity dbw BANK(Function244c3), Function244c3 ; 10a97 @@ -1579,8 +1589,8 @@ MenuData2_0x10a9f: ; 0x10a9f db 5, 8 ; rows, columns db 1 ; horizontal spacing dbw 0, NumKeyItems - dbw BANK(Function24ab4), Function24ab4 - dbw BANK(Function24ac3), Function24ac3 + dbw BANK(PlaceMenuItemName), PlaceMenuItemName + dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity dbw BANK(Function244c3), Function244c3 ; 10aaf @@ -1597,8 +1607,8 @@ MenuData2_0x10ab7: ; 0x10ab7 db 5, 8 ; rows, columns db 2 ; horizontal spacing dbw 0, NumBalls - dbw BANK(Function24ab4), Function24ab4 - dbw BANK(Function24ac3), Function24ac3 + dbw BANK(PlaceMenuItemName), PlaceMenuItemName + dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity dbw BANK(Function244c3), Function244c3 ; 10ac7 @@ -1615,8 +1625,8 @@ MenuData2_0x10acf: ; 0x10acf db 5, 8 ; rows, columns db 2 ; horizontal spacing dbw 0, NumBalls - dbw BANK(Function24ab4), Function24ab4 - dbw BANK(Function24ac3), Function24ac3 + dbw BANK(PlaceMenuItemName), PlaceMenuItemName + dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity dbw BANK(Function244c3), Function244c3 ; 10adf diff --git a/engine/phone.asm b/engine/phone.asm new file mode 100644 index 000000000..0ba5cf6e1 --- /dev/null +++ b/engine/phone.asm @@ -0,0 +1,884 @@ +AddPhoneNumber:: ; 90000 + call _CheckCellNum + jr c, .cant_add + call Phone_FindOpenSlot + jr nc, .cant_add + ld [hl], c + xor a + ret + +.cant_add + scf + ret +; 9000f + + +DelCellNum:: ; 9000f + call _CheckCellNum + jr nc, .not_in_list + xor a + ld [hl], a + ret + +.not_in_list + scf + ret +; 90019 + +CheckCellNum:: ; 90019 + jp _CheckCellNum ; wtf +; 9001c + +_CheckCellNum: ; 9001c + ld hl, wPhoneList + ld b, CONTACT_LIST_SIZE +.loop + ld a, [hli] + cp c + jr z, .got_it + dec b + jr nz, .loop + xor a + ret + +.got_it + dec hl + scf + ret +; 9002d + +Phone_FindOpenSlot: ; 9002d + call GetRemainingSpaceInPhoneList + ld b, a + ld hl, wPhoneList +.loop + ld a, [hli] + and a + jr z, .FoundOpenSpace + dec b + jr nz, .loop + xor a + ret + +.FoundOpenSpace + dec hl + scf + ret +; 90040 + +GetRemainingSpaceInPhoneList: ; 90040 + xor a + ld [Buffer1], a + ld hl, PermanentNumbers +.loop + ld a, [hli] + cp -1 + jr z, .done + cp c + jr z, .elm_or_mom + push bc + push hl + ld c, a + call _CheckCellNum + jr c, .elm_or_mom_in_list + ld hl, Buffer1 + inc [hl] + +.elm_or_mom_in_list + pop hl + pop bc + +.elm_or_mom + jr .loop + +.done + ld a, CONTACT_LIST_SIZE + ld hl, Buffer1 + sub [hl] + ret +; 90066 + +PermanentNumbers: ; 90066 + db PHONECONTACT_MOM, PHONECONTACT_ELM, -1 +; 90069 + + +FarPlaceString: ; 90069 + ld a, [hROMBank] + push af + ld a, b + rst Bankswitch + + call PlaceString + + pop af + rst Bankswitch + ret +; 90074 + + +CheckPhoneCall:: ; 90074 (24:4074) +; Check if the phone is ringing in the overworld. + + call CheckStandingOnEntrance + jr z, .no_call + + call .timecheck + nop + jr nc, .no_call + + call Random + ld b, a + and 50 percent + cp b + jr nz, .no_call + + call GetMapHeaderPhoneServiceNybble + and a + jr nz, .no_call + + call GetAvailableCallers + call ChooseRandomCaller + jr nc, .no_call + + ld e, a + call LoadCallerScript + ld a, BANK(Script_ReceivePhoneCall) + ld hl, Script_ReceivePhoneCall + call CallScript + scf + ret + +.no_call + xor a + ret + +.timecheck: ; 900a6 (24:40a6) + callba CheckReceiveCallTimer + ret + +CheckPhoneContactTimeOfDay: ; 900ad (24:40ad) + push hl + push bc + push de + push af + + callba CheckTime + pop af + and (1 << MORN) + (1 << DAY) + (1 << NITE) + and c + + pop de + pop bc + pop hl + ret + +ChooseRandomCaller: ; 900bf (24:40bf) +; If no one is available to call, don't return anything. + ld a, [EngineBuffer3] + and a + jr z, .NothingToSample + +; Sample a random number between 0 and 31. + ld c, a + call Random + ld a, [hRandomAdd] ; $ff00+$e1 + swap a + and $1f +; Compute that number modulo the number of available callers. + call SimpleDivide +; Return the caller ID you just sampled. + ld c, a + ld b, 0 + ld hl, EngineBuffer4 + add hl, bc + ld a, [hl] + scf + ret + +.NothingToSample + xor a + ret + +GetAvailableCallers: ; 900de (24:40de) + callba CheckTime + ld a, c + ld [EngineBuffer1], a ; wd03e (aliases: MenuItemsList, CurFruitTree, CurInput) + ld hl, EngineBuffer3 + ld bc, 11 + xor a + call ByteFill + ld de, wPhoneList + ld a, CONTACT_LIST_SIZE + +.loop + ld [EngineBuffer2], a + ld a, [de] + and a + jr z, .not_good_for_call + ld hl, PhoneContacts + PHONE_CONTACT_SCRIPT2_TIME + ld bc, PHONE_TABLE_WIDTH + call AddNTimes + ld a, [EngineBuffer1] ; wd03e (aliases: MenuItemsList, CurFruitTree, CurInput) + and [hl] + jr z, .not_good_for_call + ld bc, PHONE_CONTACT_MAP_GROUP - PHONE_CONTACT_SCRIPT2_TIME + add hl, bc + ld a, [MapGroup] + cp [hl] + jr nz, .different_map + inc hl + ld a, [MapNumber] + cp [hl] + jr z, .not_good_for_call +.different_map + ld a, [EngineBuffer3] + ld c, a + ld b, $0 + inc a + ld [EngineBuffer3], a + ld hl, EngineBuffer4 + add hl, bc + ld a, [de] + ld [hl], a +.not_good_for_call + inc de + ld a, [EngineBuffer2] + dec a + jr nz, .loop + ret + +CheckSpecialPhoneCall:: ; 90136 (24:4136) + ld a, [wSpecialPhoneCallID] + and a + jr z, .NoPhoneCall + + dec a + ld c, a + ld b, 0 + ld hl, SpecialPhoneCallList + ld a, 6 + call AddNTimes + ld a, [hli] + ld h, [hl] + ld l, a + call _hl_ + jr nc, .NoPhoneCall + + call .DoSpecialPhoneCall +rept 2 + inc hl +endr + ld a, [hli] + ld e, a + push hl + call LoadCallerScript + pop hl + ld de, wd048 + ld a, [hli] + ld [de], a + inc de + ld a, [hli] + ld [de], a + inc de + ld a, [hli] + ld [de], a + ld a, BANK(.script) + ld hl, .script + call CallScript + scf + ret +.NoPhoneCall + xor a + ret +; 90173 (24:4173) + +.script: ; 0x90173 + pause 30 + jump Script_ReceivePhoneCall +; 0x90178 + +.DoSpecialPhoneCall: ; 90178 (24:4178) + ld a, [wSpecialPhoneCallID] + dec a + ld c, a + ld b, 0 + ld hl, SpecialPhoneCallList + ld a, 6 + call AddNTimes + ret + +SpecialCallOnlyWhenOutside: ; 90188 + ld a, [wPermission] + cp TOWN + jr z, .outside + cp ROUTE + jr z, .outside + xor a + ret + +.outside + scf + ret + +SpecialCallWhereverYouAre: ; 90197 + scf + ret + +Function90199: ; 90199 (24:4199) + ; Don't do the call if you're in a link communication + ld a, [wLinkMode] + and a + jr nz, .OutOfArea + ; If you're in an area without phone service, don't do the call + call GetMapHeaderPhoneServiceNybble + and a + jr nz, .OutOfArea + ; If the person can't take a call at that time, don't do the call + ld a, b + ld [wCurrentCaller], a + ld hl, PhoneContacts + ld bc, PHONE_TABLE_WIDTH + call AddNTimes + ld d, h + ld e, l + ld hl, PHONE_CONTACT_SCRIPT1_TIME + add hl, de + ld a, [hl] + call CheckPhoneContactTimeOfDay + jr z, .OutOfArea + ; If we're in the same map as the person we're calling, + ; use the "Just talk to that person" script. + ld hl, PHONE_CONTACT_MAP_GROUP + add hl, de + ld a, [MapGroup] + cp [hl] + jr nz, .GetPhoneScript + ld hl, PHONE_CONTACT_MAP_NUMBER + add hl, de + ld a, [MapNumber] + cp [hl] + jr nz, .GetPhoneScript + ld b, BANK(PhoneScript_JustTalkToThem) + ld hl, PhoneScript_JustTalkToThem + jr .DoPhoneCall + +.GetPhoneScript + ld hl, PHONE_CONTACT_SCRIPT1_BANK + add hl, de + ld b, [hl] + ld hl, PHONE_CONTACT_SCRIPT1_ADDR_LO + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jr .DoPhoneCall + +.OutOfArea + ld b, BANK(UnknownScript_0x90209) + ld de, UnknownScript_0x90209 + call ExecuteCallbackScript + ret + +.DoPhoneCall + ld a, b + ld [wd002], a + ld a, l + ld [wd003], a + ld a, h + ld [wd004], a + ld b, BANK(UnknownScript_0x90205) + ld de, UnknownScript_0x90205 + call ExecuteCallbackScript + ret +; 90205 (24:4205) + +UnknownScript_0x90205: ; 0x90205 + ptcall wd002 + return +; 0x90209 + +UnknownScript_0x90209: ; 0x90209 + scall UnknownScript_0x90657 + return +; 0x9020d + +LoadCallerScript: ; 9020d (24:420d) + nop + nop + ld a, e + ld [wCurrentCaller], a + and a + jr nz, .actualcaller + ld a, BANK(WrongNumber) + ld hl, WrongNumber + jr .proceed + +.actualcaller + ld hl, PhoneContacts + ld bc, 12 + ld a, e + call AddNTimes + ld a, BANK(PhoneContacts) +.proceed + ld de, EngineBuffer2 + ld bc, 12 + call FarCopyBytes + ret +; 90233 (24:4233) + +WrongNumber: ; 90233 + db TRAINER_NONE, PHONE_00 + dba .script +.script: + writetext .text + end +.text: + ; Huh? Sorry, wrong number! + text_jump UnknownText_0x1c5565 + db "@" +; 90241 + +Script_ReceivePhoneCall: ; 0x90241 + refreshscreen $0 + callasm RingTwice_StartCall + ptcall wd048 + closetext + callasm HangUp + loadmovesprites + callasm InitCallReceiveDelay + end +; 0x90255 + +Script_SpecialBillCall:: ; 0x90255 + callasm Function9025c + jump Script_ReceivePhoneCall +; 0x9025c + +Function9025c: ; 9025c + ld e, PHONE_BILL + jp LoadCallerScript +; 90261 + +UnknownScript_0x90261: ; 0x90261 + callasm Function9026a + pause 30 + jump Script_ReceivePhoneCall +; 0x9026a + +Function9026a: ; 9026a + ld e, PHONE_ELM + jp LoadCallerScript +; 9026f + +RingTwice_StartCall: ; 9026f + call .Ring + call .Ring + callba MobileFn_1060d3 + ret +; 9027c + +.Ring: ; 9027c (24:427c) + call Phone_StartRinging + call Phone_Wait20Frames + call Phone_CallerTextboxWithName + call Phone_Wait20Frames + call Phone_CallerTextbox + call Phone_Wait20Frames + call Phone_CallerTextboxWithName + ret + +Phone_CallerTextboxWithName: ; 90292 (24:4292) + ld a, [wCurrentCaller] + ld b, a + call Function90363 + ret + + +PhoneCall:: ; 9029a + ld a, b + ld [PhoneScriptBank], a + ld a, e + ld [PhoneCallerLo], a + ld a, d + ld [PhoneCallerHi], a + call Phone_FirstOfTwoRings + call Phone_FirstOfTwoRings + callba MobileFn_1060d3 + ret +; 902b3 + +Phone_FirstOfTwoRings: ; 902b3 + call Phone_StartRinging + call Phone_Wait20Frames + call Phone_CallerTextboxWithName2 + call Phone_Wait20Frames + call Phone_CallerTextbox + call Phone_Wait20Frames + call Phone_CallerTextboxWithName2 + ret +; 902c9 + +Phone_CallerTextboxWithName2: ; 902c9 + call Phone_CallerTextbox + hlcoord 1, 2 + ld [hl], $62 +rept 2 + inc hl +endr + ld a, [PhoneScriptBank] + ld b, a + ld a, [PhoneCallerLo] + ld e, a + ld a, [PhoneCallerHi] + ld d, a + call FarPlaceString + ret +; 902e3 + + +Phone_NoSignal: ; 902e3 (24:42e3) + ld de, SFX_NO_SIGNAL + call PlaySFX + jr Phone_CallEnd + +HangUp:: ; 902eb + call HangUp_Beep + call HangUp_Wait20Frames +Phone_CallEnd: + call HangUp_BoopOn + call HangUp_Wait20Frames + call HangUp_BoopOff + call HangUp_Wait20Frames + call HangUp_BoopOn + call HangUp_Wait20Frames + call HangUp_BoopOff + call HangUp_Wait20Frames + call HangUp_BoopOn + call HangUp_Wait20Frames + call HangUp_BoopOff + call HangUp_Wait20Frames + ret +; 90316 + +Function90316: ; 90316 + ld de, SFX_SHUT_DOWN_PC + call PlaySFX + ret +; 9031d + +HangUp_Beep: ; 9031d + ld hl, UnknownText_0x9032a + call PrintText + ld de, SFX_HANG_UP + call PlaySFX + ret +; 9032a + +UnknownText_0x9032a: ; 9032a + text_jump UnknownText_0x1c5580 + db "@" +; 9032f + + +HangUp_BoopOn: ; 9032f + ld hl, UnknownText_0x90336 + call PrintText + ret +; 90336 + +UnknownText_0x90336: ; 0x90336 + text_jump UnknownText_0x1c5588 + db "@" +; 0x9033b + + +HangUp_BoopOff: ; 9033b + call SpeechTextBox + ret +; 9033f + +Phone_StartRinging: ; 9033f + call WaitSFX + ld de, SFX_CALL + call PlaySFX + call Phone_CallerTextbox + call UpdateSprites + callba Function4d188 + ret +; 90355 + +HangUp_Wait20Frames: ; 90355 + jr Phone_Wait20Frames + +Phone_Wait20Frames + ld c, 20 + call DelayFrames + callba Function4d188 + ret +; 90363 + + +Function90363: ; 90363 (24:4363) + push bc + call Phone_CallerTextbox + hlcoord 1, 1 + ld [hl], $62 +rept 2 + inc hl +endr + ld d, h + ld e, l + pop bc + call Function90380 + ret + + +Phone_CallerTextbox: ; 90375 + hlcoord 0, 0 + ld b, 2 + ld c, SCREEN_WIDTH - 2 + call TextBox + ret +; 90380 + + +Function90380: ; 90380 (24:4380) + ld h, d + ld l, e + ld a, b + call GetCallerTrainerClass + call GetCallerName + ret + +Function9038a: ; 9038a (24:438a) + ld a, c + call GetCallerTrainerClass + ld a, c + ret nz + ld a, b + cp $1 + ret z + cp $4 + ret z + ld c, $1 + ret + +GetCallerTrainerClass: ; 9039a + push hl + ld hl, PhoneContacts + PHONE_CONTACT_TRAINER_CLASS + ld bc, PHONE_TABLE_WIDTH + call AddNTimes + ld a, [hli] + ld b, [hl] + ld c, a + pop hl + ret +; 903a9 + + +GetCallerName: ; 903a9 (24:43a9) + ld a, c + and a + jr z, .NotTrainer + + call Phone_GetTrainerName + push hl + push bc + call PlaceString + ld a, ":" + ld [bc], a + pop bc + pop hl + ld de, SCREEN_WIDTH + 3 + add hl, de + call Phone_GetTrainerClassName + call PlaceString + ret + +.NotTrainer + push hl + ld c, b + ld b, 0 + ld hl, NonTrainerCallerNames +rept 2 + add hl, bc +endr + ld a, [hli] + ld e, a + ld d, [hl] + pop hl + call PlaceString + ret +; 903d6 (24:43d6) + +NonTrainerCallerNames: ; 903d6 + dw .none + dw .mom + dw .bikeshop + dw .bill + dw .elm + dw .buena + +.none: db "----------@" +.mom: db "MOM:@" +.bill: db "BILL:@" +.elm: db "PROF.ELM:@" +.bikeshop: db "BIKE SHOP:@" +.buena: db "BUENA:", $22, " DISC JOCKEY@" +; 90423 + +Phone_GetTrainerName: ; 90423 (24:4423) + push hl + push bc + callba GetTrainerName + pop bc + pop hl + ret + +Phone_GetTrainerClassName: ; 9042e (24:442e) + push hl + push bc + callba GetTrainerClassName + pop bc + pop hl + ret + +GetCallerLocation: ; 90439 + ld a, [wCurrentCaller] + call GetCallerTrainerClass + ld d, c + ld e, b + push de + ld a, [wCurrentCaller] + ld hl, PhoneContacts + PHONE_CONTACT_MAP_GROUP + ld bc, PHONE_TABLE_WIDTH + call AddNTimes + ld b, [hl] + inc hl + ld c, [hl] + push bc + call GetWorldMapLocation + ld e, a + callba GetLandmarkName + pop bc + pop de + ret +; 9045f + +PhoneContacts: ; 9045f +phone: MACRO + db \1, \2 ; trainer + map \3 ; map + db \4 + dba \5 ; script 1 + db \6 + dba \7 ; script 2 +ENDM + + phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript + phone TRAINER_NONE, PHONECONTACT_MOM, KRISS_HOUSE_1F, 7, MomPhoneScript, 0, UnusedPhoneScript + phone TRAINER_NONE, PHONECONTACT_BIKESHOP, OAKS_LAB, 0, UnusedPhoneScript, 0, UnusedPhoneScript + phone TRAINER_NONE, PHONECONTACT_BILL, N_A, 7, BillPhoneScript1, 0, BillPhoneScript2 + phone TRAINER_NONE, PHONECONTACT_ELM, ELMS_LAB, 7, ElmPhoneScript1, 0, ElmPhoneScript2 + phone SCHOOLBOY, JACK1, NATIONAL_PARK, 7, JackPhoneScript1, 7, JackPhoneScript2 + phone POKEFANF, BEVERLY1, NATIONAL_PARK, 7, BeverlyPhoneScript1, 7, BeverlyPhoneScript2 + phone SAILOR, HUEY1, OLIVINE_LIGHTHOUSE_2F, 7, HueyPhoneScript1, 7, HueyPhoneScript2 + phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript + phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript + phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript + phone COOLTRAINERM, GAVEN3, ROUTE_26, 7, GavenPhoneScript1, 7, GavenPhoneScript2 + phone COOLTRAINERF, BETH1, ROUTE_26, 7, BethPhoneScript1, 7, BethPhoneScript2 + phone BIRD_KEEPER, JOSE2, ROUTE_27, 7, JosePhoneScript1, 7, JosePhoneScript2 + phone COOLTRAINERF, REENA1, ROUTE_27, 7, ReenaPhoneScript1, 7, ReenaPhoneScript2 + phone YOUNGSTER, JOEY1, ROUTE_30, 7, JoeyPhoneScript1, 7, JoeyPhoneScript2 + phone BUG_CATCHER, WADE1, ROUTE_31, 7, WadePhoneScript1, 7, WadePhoneScript2 + phone FISHER, RALPH1, ROUTE_32, 7, RalphPhoneScript1, 7, RalphPhoneScript2 + phone PICNICKER, LIZ1, ROUTE_32, 7, LizPhoneScript1, 7, LizPhoneScript2 + phone HIKER, ANTHONY2, ROUTE_33, 7, AnthonyPhoneScript1, 7, AnthonyPhoneScript2 + phone CAMPER, TODD1, ROUTE_34, 7, ToddPhoneScript1, 7, ToddPhoneScript2 + phone PICNICKER, GINA1, ROUTE_34, 7, GinaPhoneScript1, 7, GinaPhoneScript2 + phone JUGGLER, IRWIN1, ROUTE_35, 7, IrwinPhoneScript1, 7, IrwinPhoneScript2 + phone BUG_CATCHER, ARNIE1, ROUTE_35, 7, ArniePhoneScript1, 7, ArniePhoneScript2 + phone SCHOOLBOY, ALAN1, ROUTE_36, 7, AlanPhoneScript1, 7, AlanPhoneScript2 + phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript + phone LASS, DANA1, ROUTE_38, 7, DanaPhoneScript1, 7, DanaPhoneScript2 + phone SCHOOLBOY, CHAD1, ROUTE_38, 7, ChadPhoneScript1, 7, ChadPhoneScript2 + phone POKEFANM, DEREK1, ROUTE_39, 7, DerekPhoneScript1, 7, DerekPhoneScript2 + phone FISHER, TULLY1, ROUTE_42, 7, TullyPhoneScript1, 7, TullyPhoneScript2 + phone POKEMANIAC, BRENT1, ROUTE_43, 7, BrentPhoneScript1, 7, BrentPhoneScript2 + phone PICNICKER, TIFFANY3, ROUTE_43, 7, TiffanyPhoneScript1, 7, TiffanyPhoneScript2 + phone BIRD_KEEPER, VANCE1, ROUTE_44, 7, VancePhoneScript1, 7, VancePhoneScript2 + phone FISHER, WILTON1, ROUTE_44, 7, WiltonPhoneScript1, 7, WiltonPhoneScript2 + phone BLACKBELT_T, KENJI3, ROUTE_45, 7, KenjiPhoneScript1, 7, KenjiPhoneScript2 + phone HIKER, PARRY1, ROUTE_45, 7, ParryPhoneScript1, 7, ParryPhoneScript2 + phone PICNICKER, ERIN1, ROUTE_46, 7, ErinPhoneScript1, 7, ErinPhoneScript2 + phone TRAINER_NONE, PHONECONTACT_BUENA, GOLDENROD_DEPT_STORE_ROOF, 7, BuenaPhoneScript1, 7, BuenaPhoneScript2 +; 90627 + +SpecialPhoneCallList: ; 90627 + dw SpecialCallOnlyWhenOutside + db PHONE_ELM + dba ElmPhoneScript2 + + dw SpecialCallOnlyWhenOutside + db PHONE_ELM + dba ElmPhoneScript2 + + dw SpecialCallOnlyWhenOutside + db PHONE_ELM + dba ElmPhoneScript2 + + dw SpecialCallOnlyWhenOutside + db PHONE_ELM + dba ElmPhoneScript2 + + dw SpecialCallWhereverYouAre + db PHONE_ELM + dba ElmPhoneScript2 + + dw SpecialCallWhereverYouAre + db PHONE_OAK ; ???????? + dba BikeShopPhoneScript ; bike shop + + dw SpecialCallWhereverYouAre + db PHONE_MOM + dba MomPhoneLectureScript + + dw SpecialCallOnlyWhenOutside + db PHONE_ELM + dba ElmPhoneScript2 +; 90657 + +UnknownScript_0x90657: ; 0x90657 + writetext UnknownText_0x9065b + end +; 0x9065b + +UnknownText_0x9065b: ; 0x9065b + ; That number is out of the area. + text_jump UnknownText_0x1c558b + db "@" +; 0x90660 + +PhoneScript_JustTalkToThem: ; 0x90660 + writetext UnknownText_0x90664 + end +; 0x90664 + +UnknownText_0x90664: ; 0x90664 + ; Just go talk to that person! + text_jump UnknownText_0x1c55ac + db "@" +; 0x90669 + +UnknownScript_0x90669: ; 0x90669 + writetext UnknownText_0x9066d + end +; 0x9066d + +UnknownText_0x9066d: ; 0x9066d + ; Thank you! + text_jump UnknownText_0x1c55ca + db "@" +; 0x90672 diff --git a/engine/phone_scripts.asm b/engine/phone_scripts.asm index 5be1c9a77..5d8afd028 100644 --- a/engine/phone_scripts.asm +++ b/engine/phone_scripts.asm @@ -141,7 +141,7 @@ MomPhoneNoGymQuestScript: ; 0xbcfac MomPhoneLectureScript: ; 0xbcfb1 setevent EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST setflag ENGINE_DST - specialphonecall ELMCALL_NONE + specialphonecall SPECIALCALL_NONE farwritetext MomPhoneLectureText yesorno iftrue MomPhoneSaveMoneyScript @@ -194,7 +194,7 @@ BillPhoneScript2: ; 0xbd007 ; Elm ElmPhoneScript1: ; 0xbd00d - checkcode VAR_POKERUS + checkcode VAR_SPECIALPHONECALL if_equal $1, .pokerus checkevent EVENT_SHOWED_TOGEPI_TO_ELM iftrue .discovery @@ -253,46 +253,46 @@ ElmPhoneScript1: ; 0xbd00d .pokerus ; 0xbd079 farwritetext ElmPhonePokerusText - specialphonecall ELMCALL_NONE + specialphonecall SPECIALCALL_NONE end ElmPhoneScript2: ; 0xbd081 - checkcode VAR_POKERUS + checkcode VAR_SPECIALPHONECALL if_equal $2, .disaster if_equal $3, .assistant if_equal $4, .rocket if_equal $5, .gift if_equal $8, .gift farwritetext ElmPhonePokerusText - specialphonecall ELMCALL_NONE + specialphonecall SPECIALCALL_NONE end .disaster ; 0xbd09f farwritetext ElmPhoneDisasterText - specialphonecall ELMCALL_NONE + specialphonecall SPECIALCALL_NONE setevent EVENT_ELM_CALLED_ABOUT_STOLEN_POKEMON end .assistant ; 0xbd0aa farwritetext ElmPhoneEggAssistantText - specialphonecall ELMCALL_NONE + specialphonecall SPECIALCALL_NONE clearevent EVENT_ELMS_AIDE_IN_VIOLET_POKEMON_CENTER setevent EVENT_ELMS_AIDE_IN_LAB end .rocket ; 0xbd0b8 farwritetext ElmPhoneRocketText - specialphonecall ELMCALL_NONE + specialphonecall SPECIALCALL_NONE end .gift ; 0xbd0c0 farwritetext ElmPhoneGiftText - specialphonecall ELMCALL_NONE + specialphonecall SPECIALCALL_NONE end .unused ; 0xbd0c8 farwritetext ElmPhoneUnusedText - specialphonecall ELMCALL_NONE + specialphonecall SPECIALCALL_NONE end ; bd0d0 @@ -833,7 +833,7 @@ UnknownScript_0xbd544: pokenamemem QWILFISH, $1 displaylocation ROUTE_32, $2 writebyte $1 - special Functionc3fc + special Special_ActivateFishingSwarm farjump UnknownScript_0xa05d6 UnknownScript_0xbd55c: diff --git a/engine/pokedex.asm b/engine/pokedex.asm index 970863675..dd58e940d 100644 --- a/engine/pokedex.asm +++ b/engine/pokedex.asm @@ -16,10 +16,10 @@ Pokedex: ; 40000 push af xor a ld [VramState], a - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a xor a ld [$ffde], a @@ -27,8 +27,8 @@ Pokedex: ; 40000 call DelayFrame .main - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] bit 7, a jr nz, .exit call Function4010b @@ -44,7 +44,7 @@ Pokedex: ; 40000 ld [wd959], a pop af - ld [$ffaa], a + ld [hInMenu], a pop af ld [VramState], a pop af @@ -75,7 +75,7 @@ ENDC call ByteFill xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [wcf65], a ld [wcf66], a @@ -173,7 +173,7 @@ Function400ed: ; 400ed ; 4010b Function4010b: ; 4010b - ld a, [wcf63] + ld a, [wJumptableIndex] ld hl, Jumptable_40115 call Function41432 jp [hl] @@ -198,12 +198,12 @@ Jumptable_40115: ; 40115 (10:4115) Function40131: ; 40131 (10:4131) - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret Function40136: ; 40136 (10:4136) - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret @@ -283,7 +283,7 @@ Function401ae: ; 401ae (10:41ae) call Function40bd0 ret z ld a, $2 - ld [wcf63], a + ld [wJumptableIndex], a ld a, $0 ld [wcf64], a ret @@ -291,7 +291,7 @@ Function401ae: ; 401ae (10:41ae) .select call Function41401 ld a, $7 - ld [wcf63], a + ld [wJumptableIndex], a xor a ld [hSCX], a ; $ff00+$cf ld a, $a7 @@ -302,7 +302,7 @@ Function401ae: ; 401ae (10:41ae) .start call Function41401 ld a, $5 - ld [wcf63], a + ld [wJumptableIndex], a xor a ld [hSCX], a ; $ff00+$cf ld a, $a7 @@ -312,7 +312,7 @@ Function401ae: ; 401ae (10:41ae) .b ld a, $d - ld [wcf63], a + ld [wJumptableIndex], a ret Function40217: ; 40217 (10:4217) @@ -372,7 +372,7 @@ Function40258: ; 40258 (10:4258) .asm_40288 call MaxVolume ld a, [wcf64] - ld [wcf63], a + ld [wJumptableIndex], a ret ; 40292 (10:4292) @@ -408,7 +408,7 @@ Function402aa: ; 402aa (10:42aa) call Function41423 ld a, [CurPartySpecies] call PlayCry - ld hl, wcf63 + ld hl, wJumptableIndex dec [hl] ret ; 402e8 (10:42e8) @@ -478,11 +478,11 @@ Function4034f: ; 4034f push af ld a, [wcf64] push af - ld a, [wcf63] + ld a, [wJumptableIndex] push af callba Function8442c pop af - ld [wcf63], a + ld [wJumptableIndex], a pop af ld [wcf64], a pop af @@ -552,7 +552,7 @@ Function403be: ; 403be (10:43be) .asm_403ea call Function41401 ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 403f3 (10:43f3) @@ -604,13 +604,13 @@ Function40417: ; 40417 (10:4417) .asm_40431 call Function41401 ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret Function4043a: ; 4043a (10:443a) call Function41401 ld a, $b - ld [wcf63], a + ld [wJumptableIndex], a ret Function40443: ; 40443 (10:4443) @@ -656,7 +656,7 @@ Function40471: ; 40471 (10:4471) .asm_40495 call Function41401 ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 4049e (10:449e) @@ -710,14 +710,14 @@ Function404b7: ; 404b7 ld [wc7d1], a call Function41401 ld a, $9 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 40501 Function40501: ; 40501 call Function41401 ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 4050a @@ -779,7 +779,7 @@ Function40562: ; 40562 (10:4562) call Function40bd0 ret z ld a, $2 - ld [wcf63], a + ld [wJumptableIndex], a ld a, $9 ld [wcf64], a ret @@ -795,7 +795,7 @@ Function40562: ; 40562 (10:4562) call ClearSprites call Function40bdc ld a, $5 - ld [wcf63], a + ld [wJumptableIndex], a xor a ld [hSCX], a ; $ff00+$cf ld a, $a7 @@ -827,7 +827,7 @@ Function405df: ; 405df (10:45df) .asm_405eb call Function41401 ld a, $7 - ld [wcf63], a + ld [wJumptableIndex], a call DelayFrame call Function41a24 jr nz, .asm_40603 @@ -836,7 +836,7 @@ Function405df: ; 405df (10:45df) .asm_40603 ld hl, PokedexLZ - ld de, $9310 + ld de, VTiles2 tile $31 lb bc, BANK(PokedexLZ), $3a call Functione73 @@ -844,7 +844,7 @@ Function405df: ; 405df (10:45df) ret Function40610: ; 40610 (10:4610) - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_RIGHT jr nz, .right @@ -913,7 +913,7 @@ Function4066c: ; 4066c (10:466c) ld [wc7e2], a ld a, [wc7d0] ld [wc7e3], a - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_UP jr nz, .up @@ -964,7 +964,7 @@ Function406c5: ; 406c5 (10:46c5) ld d, a ld a, [wc7d2] ld e, a - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_UP jr nz, Function406ea @@ -1799,7 +1799,7 @@ Function40f4f: ; 40f4f (10:4f4f) ld a, [wc7d8] cp $2 jr nc, .asm_40f63 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and $20 jr nz, .asm_40f65 @@ -2274,7 +2274,7 @@ Function4135a: ; 4135a (10:535a) jr nz, .asm_413c1 call Function413f5 jr c, .asm_413bf - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_LEFT | D_UP and b @@ -2460,7 +2460,7 @@ Function4147b: ; 4147b push hl ld e, l ld d, h - ld hl, $9620 + ld hl, VTiles2 tile $62 lb bc, BANK(Footprints), 2 call Request1bpp pop hl @@ -2472,7 +2472,7 @@ Function4147b: ; 4147b ld e, l ld d, h - ld hl, $9640 + ld hl, VTiles2 tile $64 lb bc, BANK(Footprints), 2 call Request1bpp @@ -2488,7 +2488,7 @@ Function414b7: ; 414b7 call ByteFill call Function414fb call Functione5f - ld hl, $9600 + ld hl, VTiles2 tile $60 ld bc, $0200 call Function41504 call Function41a24 @@ -2498,7 +2498,7 @@ Function414b7: ; 414b7 .asm_414e0 ld hl, PokedexLZ - ld de, $9310 + ld de, VTiles2 tile $31 call Decompress .asm_414e9 @@ -2554,7 +2554,7 @@ Function41a2c: ; 41a2c ld bc, $1b0 call Function41504 ld de, sScratch + $188 - ld hl, $9400 + ld hl, VTiles2 tile $40 lb bc, BANK(Function41a2c), $1b call Request2bpp call CloseSRAM @@ -2575,7 +2575,7 @@ Function41a58: ; 41a58 (10:5a58) ld a, UNOWN ld [CurPartySpecies], a call GetBaseData - ld de, $9000 + ld de, VTiles2 tile $00 predef GetFrontpic pop af ld [UnownLetter], a diff --git a/engine/predef.asm b/engine/predef.asm index 47bc2528a..748d14c49 100644 --- a/engine/predef.asm +++ b/engine/predef.asm @@ -82,9 +82,9 @@ PredefPointers:: ; 856b add_predef Predef_LoadSGBLayout add_predef Function91d11 add_predef CheckContestMon - add_predef Function8c20f - add_predef Function8c000 - add_predef Function8c000_2 + add_predef Predef_StartBattle + add_predef Predef35 + add_predef Predef36 add_predef PlayBattleAnim add_predef Predef38 ; $38 add_predef Predef39 diff --git a/engine/radio.asm b/engine/radio.asm index 4ebd0e1e8..d833b66f5 100644 --- a/engine/radio.asm +++ b/engine/radio.asm @@ -1707,7 +1707,7 @@ BuenasPassword3: ; b8f47 (2e:4f47) BuenasPassword4: ; b8f55 (2e:4f55) call BuenasPasswordCheckMidnight jp c, BuenasPassword8 - ld a, [wdc4a] + ld a, [wBuenasPassword] ; If we already generated the password today, we don't need to generate a new one. ld hl, WeeklyFlags bit 7, [hl] @@ -1727,9 +1727,9 @@ BuenasPassword4: ; b8f55 (2e:4f55) and $3 cp $3 jr nc, .greater_than_three -; The high nybble of wdc4a will now contain the password group index, and the low nybble contains the actual password. +; The high nybble of wBuenasPassword will now contain the password group index, and the low nybble contains the actual password. add e - ld [wdc4a], a + ld [wBuenasPassword], a ; Set the flag so that we don't generate a new password this week. ld hl, WeeklyFlags set 7, [hl] diff --git a/engine/save.asm b/engine/save.asm index 92b65398b..549991207 100644 --- a/engine/save.asm +++ b/engine/save.asm @@ -380,7 +380,7 @@ ErasePreviousSave: ; 14cbb ld [sStackTop + 1], a call CloseSRAM ld a, $1 - ld [wd4b4], a + ld [wSavedAtLeastOnce], a ret ; 14ce2 @@ -486,7 +486,7 @@ Function14d93: ; 14d93 Function14da0: ; 14da0 - ld a, [wd4b4] + ld a, [wSavedAtLeastOnce] and a ret nz call ErasePreviousSave diff --git a/engine/scripting.asm b/engine/scripting.asm index f8ac4cc0c..2dadafee1 100644 --- a/engine/scripting.asm +++ b/engine/scripting.asm @@ -529,7 +529,7 @@ Script_interpretmenu: ; 0x96f41 ld a, [ScriptBank] ld hl, InterpretMenu rst FarCall - ld a, [wcf88] + ld a, [wPocketCursorBuffer] jr nc, .ok xor a .ok @@ -651,7 +651,7 @@ Script_specialsound: ; 0x96fe4 ; script command 0x88 callba CheckItemPocket - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] cp TM_HM ld de, SFX_GET_TM jr z, .play @@ -665,7 +665,7 @@ Script_specialsound: ; 0x96fe4 GetPocketName: ; 96ffe callba CheckItemPocket - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] dec a ld hl, .Pockets and 3 @@ -1338,12 +1338,12 @@ Script_moveperson: ; 0x97341 call GetScriptPerson ld b, a call GetScriptByte - add $4 + add 4 ld d, a call GetScriptByte - add $4 + add 4 ld e, a - callba Function807e + callba CopyDECoordsToMapObject ret ; 0x9735b @@ -1385,10 +1385,10 @@ Script_loademote: ; 0x97384 ; bubble (SingleByteParam) call GetScriptByte - cp $ff - jr nz, .asm_9738e ; 0x97389 $3 + cp -1 + jr nz, .not_var_emote ; 0x97389 $3 ld a, [ScriptVar] -.asm_9738e +.not_var_emote ld c, a callba Function1442f ret @@ -1417,7 +1417,7 @@ Script_showemote: ; 0x97396 ; 0x973b6 ShowEmoteScript: ; 973b6 - loademote $ff + loademote -1 applymovement2 .Show pause 0 applymovement2 .Hide @@ -1448,12 +1448,12 @@ Script_earthquake: ; 0x973c7 ld [wd003], a and $3f ld [wd005], a - ld b, BANK(UnknownScript_0x973e6) - ld de, UnknownScript_0x973e6 + ld b, BANK(.script) + ld de, .script jp ScriptCall ; 0x973e6 -UnknownScript_0x973e6: ; 973e6 +.script: ; 973e6 applymovement PLAYER, wd002 end ; 973eb @@ -1487,7 +1487,7 @@ Script_battlecheck: ; 0x973fb Script_loadtrainerdata: ; 0x97400 ; script command 0x5c - ld a, $81 + ld a, (1 << 7) | 1 ld [wd459], a ld a, [WalkingDirection] ld [OtherTrainerClass], a @@ -1502,7 +1502,7 @@ Script_loadpokedata: ; 0x97412 ; pokemon (PokemonParam) ; level (DecimalParam) - ld a, $80 + ld a, (1 << 7) ld [wd459], a call GetScriptByte ld [TempWildMonSpecies], a @@ -1517,7 +1517,7 @@ Script_loadtrainer: ; 0x97424 ; trainer_group (TrainerGroupParam) ; trainer_id (TrainerIdParam) - ld a, $81 + ld a, (1 << 7) | 1 ld [wd459], a call GetScriptByte ld [OtherTrainerClass], a @@ -1531,7 +1531,7 @@ Script_startbattle: ; 0x97436 call BufferScreen predef StartBattle - ld a, [wd0ee] + ld a, [wBattleResult] and $3f ld [ScriptVar], a ret @@ -1555,26 +1555,28 @@ Script_returnafterbattle: ; 0x97459 ld hl, wd459 ld d, [hl] ld [hl], $0 - ld a, [wd0ee] + ld a, [wBattleResult] and $3f cp $1 - jr nz, .asm_97470 ; 0x97466 $8 + jr nz, .notblackedout ; 0x97466 $8 ld b, BANK(UnknownScript_0x124c1) ld hl, UnknownScript_0x124c1 jp ScriptJump -.asm_97470 + +.notblackedout bit 0, d - jr z, .asm_9747c ; 0x97472 $8 - callba Functionfcfec - jr .asm_9748e ; 0x9747a $12 -.asm_9747c - ld a, [wd0ee] + jr z, .was_wild ; 0x97472 $8 + callba MomTriesToBuySomething + jr .done ; 0x9747a $12 + +.was_wild + ld a, [wBattleResult] bit 7, a - jr z, .asm_9748e ; 0x97481 $b - ld b, BANK(UnknownScript_0x90255) - ld de, UnknownScript_0x90255 - callba Function97c4f -.asm_9748e + jr z, .done ; 0x97481 $b + ld b, BANK(Script_SpecialBillCall) + ld de, Script_SpecialBillCall + callba LoadScriptBDE +.done jp Script_reloadmap ; 0x97491 @@ -1583,7 +1585,7 @@ Script_reloadmap: ; 0x97491 xor a ld [wd459], a - ld a, $f3 + ld a, MAPSETUP_RELOADMAP ld [hMapEntryMethod], a ld a, $1 call LoadMapStatus @@ -2202,7 +2204,7 @@ Script_name: ; 0x97716 ; memory (SingleByteParam) call GetScriptByte - ld [wcf61], a + ld [wNamedObjectTypeBuffer], a ContinueToGetName: ; 0x9771c call GetScriptByte @@ -2219,7 +2221,7 @@ Script_trainerclassname: ; 0x9772b ; memory (SingleByteParam) ld a, TRAINER_NAME - ld [wcf61], a + ld [wNamedObjectTypeBuffer], a jr ContinueToGetName ; 0x97730 $ea ; 0x97732 @@ -2811,10 +2813,10 @@ Script_warpfacing: ; 0x97a0e call GetScriptByte and $3 ld c, a - ld a, [wd45b] + ld a, [wPlayerSpriteSetupFlags] set 5, a or c - ld [wd45b], a + ld [wPlayerSpriteSetupFlags], a ; fall through Script_warp: ; 0x97a1d @@ -2838,7 +2840,7 @@ Script_warp: ; 0x97a1d ld [YCoord], a ld a, -1 ld [wd001], a - ld a, -15 + ld a, MAPSETUP_WARP ld [hMapEntryMethod], a ld a, 1 call LoadMapStatus @@ -2850,7 +2852,7 @@ Script_warp: ; 0x97a1d call GetScriptByte ld a, -1 ld [wd001], a - ld a, -5 + ld a, MAPSETUP_BADWARP ld [hMapEntryMethod], a ld a, 1 call LoadMapStatus @@ -2966,7 +2968,7 @@ Script_reloadmappart:: ; 0x97ae3 ; script command 0x7c xor a - ld [$ffd4], a + ld [hBGMapMode], a call Function2173 call Function2914 callba Function104061 @@ -3011,7 +3013,7 @@ Script_reloadandreturn: ; 0x97b16 Script_loadfont: ; 0x97b1c ; script command 0x47 - call Function2e08 + call LoadFont ret ; 0x97b20 @@ -3044,7 +3046,7 @@ Script_loadmovesprites: ; 0x97b2f ; script command 0x49 call Function2e20 - call Function2dcf + call LoadMoveSprites ret ; 0x97b36 diff --git a/engine/specials.asm b/engine/specials.asm index 41b0d9e9a..e9fe2987f 100644 --- a/engine/specials.asm +++ b/engine/specials.asm @@ -39,7 +39,7 @@ SpecialsPointers:: ; c029 add_special Special_GetMysteryGiftItem add_special Special_UnlockMysteryGift -; Bug Catching Contest +; Map Events add_special BugContestJudging add_special CheckPartyFullAfterContest add_special CheckFirstMonFainted @@ -88,25 +88,25 @@ SpecialsPointers:: ; c029 add_special Special_FindAtLeastThatHappy add_special Special_FindThatSpecies add_special Special_FindThatSpeciesYourTrainerID - add_special Functionc3ef - add_special Function17421 - add_special Function17440 + add_special Special_CheckUnusedTwoDayTimer ; unreferenced + add_special Special_DayCareMon1 + add_special Special_DayCareMon2 add_special Special_SelectRandomBugContestContestants - add_special Functionc3fc + add_special Special_ActivateFishingSwarm add_special ToggleMaptileDecorations add_special ToggleDecorationsVisibility add_special SpecialGiveShuckle add_special SpecialReturnShuckle - add_special Function73f7 + add_special Special_BillsGrandfather add_special SpecialCheckPokerus - add_special Function24b25 - add_special Function24b4e + add_special Special_DisplayCoinCaseBalance + add_special Special_DisplayMoneyAndCoinBalance add_special Function24ae8 add_special Special_CheckForLuckyNumberWinners add_special Special_CheckLuckyNumberShowFlag add_special Special_ResetLuckyNumberShowFlag - add_special Function4d9d3 - add_special Function88018 + add_special Special_PrintTodaysLuckyNumber + add_special Special_SelectApricornForKurt add_special SpecialNameRater add_special Functionc2da add_special GetFirstPokemonHappiness @@ -169,7 +169,7 @@ SpecialsPointers:: ; c029 add_special SpecialBuenasPassword add_special SpecialBuenaPrize add_special SpecialDratini - add_special Function11485 + add_special Special_SampleKenjiBreakCountdown add_special SpecialBeastsCheck add_special SpecialMonCheck add_special Functionc225 @@ -482,16 +482,16 @@ ScriptReturnCarry: ; c3e2 ret ; c3ef -Functionc3ef: ; c3ef - callba Function1150c - ld a, [wdc3a] +Special_CheckUnusedTwoDayTimer: ; c3ef + callba CheckUnusedTwoDayTimer + ld a, [wUnusedTwoDayTimer] ld [ScriptVar], a ret ; c3fc -Functionc3fc: ; c3fc +Special_ActivateFishingSwarm: ; c3fc ld a, [ScriptVar] - ld [wdfce], a + ld [wFishingSwarmFlag], a ret ; c403 @@ -523,7 +523,7 @@ SpecialCheckPokerus: ; c419 ; c422 Special_ResetLuckyNumberShowFlag: ; c422 - callba Function1152b + callba RestartLuckyNumberCountdown ld hl, wLuckyNumberShowFlag res 0, [hl] callba LoadOrRegenerateLuckyIDNumber @@ -531,7 +531,7 @@ Special_ResetLuckyNumberShowFlag: ; c422 ; c434 Special_CheckLuckyNumberShowFlag: ; c434 - callba Function11542 + callba CheckLuckyNumberShowFlag jp ScriptReturnCarry ; c43d diff --git a/engine/std_scripts.asm b/engine/std_scripts.asm index 95c91b647..5c0df0355 100644 --- a/engine/std_scripts.asm +++ b/engine/std_scripts.asm @@ -159,7 +159,7 @@ PokeCenterNurseScript: .pokerus_done setflag ENGINE_POKERUS - specialphonecall ELMCALL_POKERUS + specialphonecall SPECIALCALL_POKERUS end DifficultBookshelfScript: @@ -297,7 +297,7 @@ RadioTowerRocketsScript: clearevent EVENT_RADIO_TOWER_ROCKET_TAKEOVER clearevent EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER setevent EVENT_MAHOGANY_TOWN_POKEFAN_M_BLOCKS_EAST - specialphonecall ELMCALL_WEIRDBROADCAST + specialphonecall SPECIALCALL_WEIRDBROADCAST domaptrigger MAHOGANY_TOWN, $1 end @@ -1809,7 +1809,7 @@ CoinVendor_IntroScript: ; 0xbcde0 farwritetext CoinVendor_IntroText CoinVendor_SellCoinsMenuScript: ; 0xbcde4 - special Function24b4e + special Special_DisplayMoneyAndCoinBalance loadmenudata CoinVendor_MenuDataHeader interpretmenu2 writebackup diff --git a/engine/time.asm b/engine/time.asm index 8b3f5d758..fce01ffac 100755 --- a/engine/time.asm +++ b/engine/time.asm @@ -1,104 +1,104 @@ -Function113d6: ; 113d6 - call Function114dd +_InitializeStartDay: ; 113d6 + call InitializeStartDay ret ; 113da -Function113da: ; 113da +ClearDailyTimers: ; 113da xor a ld [wLuckyNumberDayBuffer], a - ld [wdc3a], a - ld [wdc1c], a + ld [wUnusedTwoDayTimer], a + ld [wDailyResetTimer], a ret ; 113e5 -Function113e5:: ; 113e5 +InitCallReceiveDelay:: ; 113e5 xor a - ld [wd464], a + ld [wTimeCyclesSinceLastCall], a -Function113e9: ; 113e9 - ld a, [wd464] +NextCallReceiveDelay: ; 113e9 + ld a, [wTimeCyclesSinceLastCall] cp 3 - jr c, .asm_113f2 + jr c, .okay ld a, 3 -.asm_113f2 +.okay ld e, a ld d, 0 - ld hl, .data_113fd + ld hl, .ReceiveCallDelays add hl, de ld a, [hl] - jp Function1142e + jp RestartReceiveCallDelay ; 113fd -.data_113fd +.ReceiveCallDelays db 20, 10, 5, 3 ; 11401 -Function11401: ; 11401 - call Function1143c +CheckReceiveCallTimer: ; 11401 + call CheckReceiveCallDelay ; check timer ret nc - ld hl, wd464 + ld hl, wTimeCyclesSinceLastCall ld a, [hl] cp 3 - jr nc, .asm_1140e + jr nc, .ok inc [hl] -.asm_1140e - call Function113e9 +.ok + call NextCallReceiveDelay ; restart timer scf ret ; 11413 -Function11413: ; 11413 +InitOneDayCountdown: ; 11413 ld a, 1 -Function11415: ; 11415 +InitNDaysCountdown: ; 11415 ld [hl], a push hl call UpdateTime pop hl inc hl - call Function11621 + call CopyDayToHL ret ; 11420 -Function11420: ; 11420 +CheckDayDependentEventHL: ; 11420 inc hl push hl - call Function115cf - call Function115c8 + call CalcDaysSince + call GetDaysSince pop hl dec hl - call Function11586 + call UpdateTimeRemaining ret ; 1142e -Function1142e: ; 1142e - ld hl, wd465 +RestartReceiveCallDelay: ; 1142e + ld hl, wReceiveCallDelay_MinsRemaining ld [hl], a call UpdateTime - ld hl, wd466 - call Function1162e + ld hl, wReceiveCallDelay_StartTime + call CopyDayHourMinToHL ret ; 1143c -Function1143c: ; 1143c - ld hl, wd466 - call Function115d6 - call Function115ae - ld hl, wd465 - call Function11586 +CheckReceiveCallDelay: ; 1143c + ld hl, wReceiveCallDelay_StartTime + call CalcMinsHoursDaysSince + call GetMinutesSinceIfLessThan60 + ld hl, wReceiveCallDelay_MinsRemaining + call UpdateTimeRemaining ret ; 1144c -Function1144c: ; 1144c - ld hl, wdc1c - jp Function11413 +RestartDailyResetTimer: ; 1144c + ld hl, wDailyResetTimer + jp InitOneDayCountdown ; 11452 -Function11452:: ; 11452 - ld hl, wdc1c - call Function11420 +CheckDailyResetTimer:: ; 11452 + ld hl, wDailyResetTimer + call CheckDayDependentEventHL ret nc xor a ld hl, DailyFlags @@ -121,18 +121,19 @@ endr ld hl, wdc58 ld a, [hl] and a - jr z, .asm_11480 + jr z, .RestartKenjiBreakCountdown dec [hl] - jr nz, .asm_11483 + jr nz, .DontRestartKenjiBreakCountdown -.asm_11480 - call Function11485 +.RestartKenjiBreakCountdown + call Special_SampleKenjiBreakCountdown -.asm_11483 - jr Function1144c +.DontRestartKenjiBreakCountdown + jr RestartDailyResetTimer ; 11485 -Function11485: ; 11485 +Special_SampleKenjiBreakCountdown: ; 11485 +; Generate a random number between 3 and 5 call Random and 3 add 3 @@ -140,99 +141,101 @@ Function11485: ; 11485 ret ; 11490 -Function11490: ; 11490 - ld a, $14 - ld [wd46c], a - ld a, $0 - ld [wd46d], a +StartBugContestTimer: ; 11490 + ld a, 20 + ld [wBugContestMinsRemaining], a + ld a, 0 + ld [wBugContestSecsRemaining], a call UpdateTime - ld hl, wdc35 - call Function11613 + ld hl, wBugContestStartTime + call CopyDayHourMinSecToHL ret ; 114a4 -Function114a4:: ; 114a4 (4:54a4) - ld hl, wdc35 - call Function115db - ld a, [wcfd7] +CheckBugContestTimer:: ; 114a4 (4:54a4) + ld hl, wBugContestStartTime + call CalcSecsMinsHoursDaysSince + ld a, [wDaysSince] and a - jr nz, .asm_114d4 - ld a, [wcfd6] + jr nz, .timed_out + ld a, [wHoursSince] and a - jr nz, .asm_114d4 - ld a, [wcfd4] + jr nz, .timed_out + ld a, [wSecondsSince] ld b, a - ld a, [wd46d] + ld a, [wBugContestSecsRemaining] sub b - jr nc, .asm_114c2 - add $3c -.asm_114c2 - ld [wd46d], a - ld a, [wcfd5] + jr nc, .okay + add 60 + +.okay + ld [wBugContestSecsRemaining], a + ld a, [wMinutesSince] ld b, a - ld a, [wd46c] + ld a, [wBugContestMinsRemaining] sbc b - ld [wd46c], a - jr c, .asm_114d4 + ld [wBugContestMinsRemaining], a + jr c, .timed_out and a ret -.asm_114d4 + +.timed_out xor a - ld [wd46c], a - ld [wd46d], a + ld [wBugContestMinsRemaining], a + ld [wBugContestSecsRemaining], a scf ret -Function114dd: ; 114dd +InitializeStartDay: ; 114dd call UpdateTime - ld hl, wdc23 - call Function11621 + ld hl, wStartDay + call CopyDayToHL ret ; 114e7 -Function114e7:: ; 114e7 - ld hl, wdc23 - call Function115cf - call Function115c8 +CheckPokerusTrick:: ; 114e7 + ld hl, wStartDay + call CalcDaysSince + call GetDaysSince and a - jr z, .asm_114fa + jr z, .done ld b, a callba ApplyPokerusTick -.asm_114fa +.done xor a ret ; 114fc -Function114fc: ; 114fc - ld a, $2 - ld hl, wdc3a +SetUnusedTwoDayTimer: ; 114fc + ld a, 2 + ld hl, wUnusedTwoDayTimer ld [hl], a call UpdateTime - ld hl, wdc3b - call Function11621 + ld hl, wUnusedTwoDayTimerStartDate + call CopyDayToHL ret ; 1150c -Function1150c: ; 1150c - ld hl, wdc3b - call Function115cf - call Function115c8 - ld hl, wdc3a - call Function11586 +CheckUnusedTwoDayTimer: ; 1150c + ld hl, wUnusedTwoDayTimerStartDate + call CalcDaysSince + call GetDaysSince + ld hl, wUnusedTwoDayTimer + call UpdateTimeRemaining ret ; 1151c -Function1151c: ; 1151c +Function1151c: ; unreferenced ld hl, DailyFlags set 2, [hl] ret ; 11522 -Function11522: ; 11522 +Function11522: ; unreferenced and a ld hl, DailyFlags bit 2, [hl] @@ -241,10 +244,10 @@ Function11522: ; 11522 ret ; 1152b -Function1152b: ; 1152b +RestartLuckyNumberCountdown: ; 1152b call .GetDaysUntilNextFriday ld hl, wLuckyNumberDayBuffer - jp Function11415 + jp InitNDaysCountdown ; 11534 .GetDaysUntilNextFriday: ; 11534 @@ -262,172 +265,175 @@ Function1152b: ; 1152b ret ; 11542 -Function11542: ; 11542 +CheckLuckyNumberShowFlag: ; 11542 ld hl, wLuckyNumberDayBuffer - jp Function11420 + jp CheckDayDependentEventHL ; 11548 -Function11548: ; 11548 - ld a, BANK(s0_abfa) +DoMysteryGiftIfDayHasPassed: ; 11548 + ld a, BANK(sMysteryGiftTimer) call GetSRAMBank - ld hl, s0_abfa + ld hl, sMysteryGiftTimer ld a, [hli] ld [Buffer1], a ld a, [hl] ld [Buffer2], a call CloseSRAM + ld hl, Buffer1 - call Function11420 - jr nc, .asm_11572 + call CheckDayDependentEventHL + jr nc, .not_timed_out ld hl, Buffer1 - call Function11413 + call InitOneDayCountdown call CloseSRAM callba Function1050c8 -.asm_11572 - ld a, BANK(s0_abfa) +.not_timed_out + ld a, BANK(sMysteryGiftTimer) call GetSRAMBank ld hl, Buffer1 ld a, [hli] - ld [s0_abfa], a + ld [sMysteryGiftTimer], a ld a, [hl] - ld [s0_abfa + 1], a + ld [sMysteryGiftTimer + 1], a call CloseSRAM ret ; 11586 -Function11586: ; 11586 +UpdateTimeRemaining: ; 11586 +; If the amount of time elapsed exceeds the capacity of its +; unit, skip this part. cp -1 - jr z, .skip + jr z, .set_carry ld c, a - ld a, [hl] + ld a, [hl] ; time remaining sub c jr nc, .ok xor a .ok ld [hl], a - jr z, .skip + jr z, .set_carry xor a ret -.skip +.set_carry xor a ld [hl], a scf ret ; 11599 -Function11599: ; 11599 - ld a, [wcfd7] +GetSecondsSinceIfLessThan60: ; 11599 + ld a, [wDaysSince] and a - jr nz, Function115cc - ld a, [wcfd6] + jr nz, GetTimeElapsed_ExceedsUnitLimit + ld a, [wHoursSince] and a - jr nz, Function115cc - ld a, [wcfd5] - jr nz, Function115cc - ld a, [wcfd4] + jr nz, GetTimeElapsed_ExceedsUnitLimit + ld a, [wMinutesSince] + jr nz, GetTimeElapsed_ExceedsUnitLimit + ld a, [wSecondsSince] ret ; 115ae -Function115ae: ; 115ae - ld a, [wcfd7] +GetMinutesSinceIfLessThan60: ; 115ae + ld a, [wDaysSince] and a - jr nz, Function115cc - ld a, [wcfd6] + jr nz, GetTimeElapsed_ExceedsUnitLimit + ld a, [wHoursSince] and a - jr nz, Function115cc - ld a, [wcfd5] + jr nz, GetTimeElapsed_ExceedsUnitLimit + ld a, [wMinutesSince] ret ; 115be -Function115be: ; 115be - ld a, [wcfd7] +GetHoursSinceIfLessThan24: ; 115be + ld a, [wDaysSince] and a - jr nz, Function115cc - ld a, [wcfd6] + jr nz, GetTimeElapsed_ExceedsUnitLimit + ld a, [wHoursSince] ret ; 115c8 -Function115c8: ; 115c8 - ld a, [wcfd7] +GetDaysSince: ; 115c8 + ld a, [wDaysSince] ret ; 115cc -Function115cc: ; 115cc - ld a, $ff +GetTimeElapsed_ExceedsUnitLimit: ; 115cc + ld a, -1 ret ; 115cf -Function115cf: ; 115cf +CalcDaysSince: ; 115cf xor a - jr Function11605 + jr _CalcDaysSince ; 115d2 -Function115d2: ; 115d2 +CalcHoursDaysSince: ; 115d2 inc hl xor a - jr Function115f8 + jr _CalcHoursDaysSince ; 115d6 -Function115d6: ; 115d6 +CalcMinsHoursDaysSince: ; 115d6 rept 2 inc hl endr xor a - jr Function115eb + jr _CalcMinsHoursDaysSince ; 115db -Function115db: ; 115db +CalcSecsMinsHoursDaysSince: ; 115db rept 3 inc hl endr ld a, [hSeconds] ld c, a sub [hl] - jr nc, .asm_115e6 + jr nc, .skip add 60 -.asm_115e6 - ld [hl], c +.skip + ld [hl], c ; current seconds dec hl - ld [wcfd4], a + ld [wSecondsSince], a ; seconds since -Function115eb: ; 115eb +_CalcMinsHoursDaysSince: ; 115eb ld a, [hMinutes] ld c, a sbc [hl] - jr nc, .asm_115f3 + jr nc, .skip add 60 -.asm_115f3 - ld [hl], c +.skip + ld [hl], c ; current minutes dec hl - ld [wcfd5], a + ld [wMinutesSince], a ; minutes since -Function115f8: ; 115f8 +_CalcHoursDaysSince: ; 115f8 ld a, [hHours] ld c, a sbc [hl] - jr nc, .asm_11600 + jr nc, .skip add 24 -.asm_11600 - ld [hl], c +.skip + ld [hl], c ; current hours dec hl - ld [wcfd6], a + ld [wHoursSince], a ; hours since -Function11605 +_CalcDaysSince: ld a, [CurDay] ld c, a sbc [hl] jr nc, .skip add 20 * 7 .skip - ld [hl], c - ld [wcfd7], a + ld [hl], c ; current days + ld [wDaysSince], a ; days since ret ; 11613 -Function11613: ; 11613 +CopyDayHourMinSecToHL: ; 11613 ld a, [CurDay] ld [hli], a ld a, [hHours] @@ -439,13 +445,13 @@ Function11613: ; 11613 ret ; 11621 -Function11621: ; 11621 +CopyDayToHL: ; 11621 ld a, [CurDay] ld [hl], a ret ; 11626 -Function11626: ; 11626 +CopyDayHourToHL: ; 11626 ld a, [CurDay] ld [hli], a ld a, [hHours] @@ -453,7 +459,7 @@ Function11626: ; 11626 ret ; 1162e -Function1162e: ; 1162e +CopyDayHourMinToHL: ; 1162e ld a, [CurDay] ld [hli], a ld a, [hHours] diff --git a/engine/timeofdaypals.asm b/engine/timeofdaypals.asm new file mode 100644 index 000000000..bdfcc8b05 --- /dev/null +++ b/engine/timeofdaypals.asm @@ -0,0 +1,414 @@ +Function8c001:: ; 8c001 + call UpdateTime + ld a, [TimeOfDay] + ld [CurTimeOfDay], a + call GetTimePalette + ld [TimeOfDayPal], a + ret +; 8c011 + + +_TimeOfDayPals:: ; 8c011 +; return carry if pals are changed + +; forced pals? + ld hl, wd846 + bit 7, [hl] + jr nz, .dontchange + +; do we need to bother updating? + ld a, [TimeOfDay] + ld hl, CurTimeOfDay + cp [hl] + jr z, .dontchange + +; if so, the time of day has changed + ld a, [TimeOfDay] + ld [CurTimeOfDay], a + +; get palette id + call GetTimePalette + +; same palette as before? + ld hl, TimeOfDayPal + cp [hl] + jr z, .dontchange + +; update palette id + ld [TimeOfDayPal], a + + +; save bg palette 8 + ld hl, Unkn1Pals + 8 * 7 ; Unkn1Pals + 7 pals + +; save wram bank + ld a, [rSVBK] + ld b, a +; wram bank 5 + ld a, 5 + ld [rSVBK], a + +; push palette + ld c, 4 ; NUM_PAL_COLORS +.push + ld d, [hl] + inc hl + ld e, [hl] + inc hl + push de + dec c + jr nz, .push + +; restore wram bank + ld a, b + ld [rSVBK], a + + +; update sgb pals + ld b, $9 + call GetSGBLayout + + +; restore bg palette 8 + ld hl, Unkn2Pals - 1 ; last byte in Unkn1Pals + +; save wram bank + ld a, [rSVBK] + ld d, a +; wram bank 5 + ld a, 5 + ld [rSVBK], a + +; pop palette + ld e, 4 ; NUM_PAL_COLORS +.pop + pop bc + ld [hl], c + dec hl + ld [hl], b + dec hl + dec e + jr nz, .pop + +; restore wram bank + ld a, d + ld [rSVBK], a + +; update palettes + call _UpdateTimePals + call DelayFrame + +; successful change + scf + ret + +.dontchange +; no change occurred + and a + ret +; 8c070 + + +_UpdateTimePals:: ; 8c070 + ld c, $9 ; normal + call GetTimePalFade + call DmgToCgbTimePals + ret +; 8c079 + +FadeInBGMap:: ; 8c079 + ld c, $12 + call GetTimePalFade + ld b, $4 + call ConvertTimePalsDecHL + ret +; 8c084 + +FadeBlackBGMap:: ; 8c084 + call Function8c0c1 + ld c, $9 + call GetTimePalFade + ld b, $4 + call ConvertTimePalsIncHL + ret +; 8c092 + +Special_BattleTowerFade: ; 8c092 + call Function8c0c1 + ld c, $9 + call GetTimePalFade + ld b, $4 +.asm_8c09c + call DmgToCgbTimePals +rept 3 + inc hl +endr + ld c, $7 + call DelayFrames + dec b + jr nz, .asm_8c09c + ret +; 8c0ab + +Special_FadeInQuickly: ; 8c0ab + ld c, $0 + call GetTimePalFade + ld b, $4 + call ConvertTimePalsIncHL + ret +; 8c0b6 + +Special_FadeBlackQuickly: ; 8c0b6 + ld c, $9 + call GetTimePalFade + ld b, $4 + call ConvertTimePalsDecHL + ret +; 8c0c1 + + +Function8c0c1: ; 8c0c1 + ld a, [rSVBK] + push af + ld a, $5 + ld [rSVBK], a + ld hl, Unkn1Pals + ld a, [hli] + ld e, a + ld a, [hli] + ld d, a + ld hl, Unkn1Pals + 8 + ld c, $6 +.asm_8c0d4 + ld a, e + ld [hli], a + ld a, d + ld [hli], a +rept 6 + inc hl +endr + dec c + jr nz, .asm_8c0d4 + pop af + ld [rSVBK], a + ret +; 8c0e5 + +brightlevel: MACRO + db (\1 << 6) | (\2 << 4) | (\3 << 2) | \4 +ENDM + +Function8c0e5: ; 8c0e5 + ld hl, .BrightnessLevels + ld a, [wc2d0] + cp $4 ; Dark cave, needs Flash + jr z, .DarkCave + and $7 + add l + ld l, a + ld a, $0 + adc h + ld h, a + ld a, [hl] + ld [wd847], a + ret +.DarkCave + ld a, [StatusFlags] + bit 2, a + jr nz, .UsedFlash + ld a, $ff ; 3, 3, 3, 3 + ld [wd847], a + ret +.UsedFlash + ld a, $aa ; 2, 2, 2, 2 + ld [wd847], a + ret +; 8c10f (23:410f) + +.BrightnessLevels: ; 8c10f + brightlevel 3, 2, 1, 0 + brightlevel 1, 1, 1, 1 + brightlevel 2, 2, 2, 2 + brightlevel 0, 0, 0, 0 + brightlevel 3, 3, 3, 3 + brightlevel 3, 2, 1, 0 + brightlevel 3, 2, 1, 0 + brightlevel 3, 2, 1, 0 +; 8c117 + +GetTimePalette: ; 8c117 + ld a, [TimeOfDay] + ld e, a + ld d, 0 + ld hl, .TimePalettes +rept 2 + add hl, de +endr + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] +; 8c126 + +.TimePalettes + dw .MorningPalette + dw .DayPalette + dw .NitePalette + dw .DarknessPalette + +.MorningPalette + ld a, [wd847] + and %00000011 ; 0 + ret + +.DayPalette + ld a, [wd847] + and %00001100 ; 1 + srl a + srl a + ret + +.NitePalette + ld a, [wd847] + and %00110000 ; 2 + swap a + ret + +.DarknessPalette + ld a, [wd847] + and %11000000 ; 3 + rlca + rlca + ret +; 8c14e + + +DmgToCgbTimePals: ; 8c14e + push hl + push de + ld a, [hli] + call DmgToCgbBGPals + ld a, [hli] + ld e, a + ld a, [hli] + ld d, a + call DmgToCgbObjPals + pop de + pop hl + ret +; 8c15e + +ConvertTimePalsIncHL: ; 8c15e +.loop + call DmgToCgbTimePals +rept 3 + inc hl +endr + ld c, $2 + call DelayFrames + dec b + jr nz, .loop + ret +; 8c16d + +ConvertTimePalsDecHL: ; 8c16d +.loop + call DmgToCgbTimePals +rept 3 + dec hl +endr + ld c, $2 + call DelayFrames + dec b + jr nz, .loop + ret +; 8c17c + + +GetTimePalFade: ; 8c17c +; check cgb + ld a, [hCGB] + and a + jr nz, .cgb + +; else: dmg + +; index + ld a, [TimeOfDayPal] + and %11 + +; get fade table + push bc + ld c, a + ld b, $0 + ld hl, .dmgfades +rept 2 + add hl, bc +endr + ld a, [hli] + ld h, [hl] + ld l, a + pop bc + +; get place in fade table + ld b, $0 + add hl, bc + ret + +.cgb + ld hl, .cgbfade + ld b, $0 + add hl, bc + ret + +.dmgfades + dw .morn + dw .day + dw .nite + dw .darkness + +.morn + db %11111111, %11111111, %11111111 + db %11111110, %11111110, %11111110 + db %11111001, %11100100, %11100100 + db %11100100, %11010000, %11010000 + db %10010000, %10000000, %10000000 + db %01000000, %01000000, %01000000 + db %00000000, %00000000, %00000000 + +.day + db %11111111, %11111111, %11111111 + db %11111110, %11111110, %11111110 + db %11111001, %11100100, %11100100 + db %11100100, %11010000, %11010000 + db %10010000, %10000000, %10000000 + db %01000000, %01000000, %01000000 + db %00000000, %00000000, %00000000 + +.nite + db %11111111, %11111111, %11111111 + db %11111110, %11111110, %11111110 + db %11111001, %11100100, %11100100 + db %11101001, %11010000, %11010000 + db %10010000, %10000000, %10000000 + db %01000000, %01000000, %01000000 + db %00000000, %00000000, %00000000 + +.darkness + db %11111111, %11111111, %11111111 + db %11111110, %11111110, %11111111 + db %11111110, %11100100, %11111111 + db %11111101, %11010000, %11111111 + db %11111101, %10000000, %11111111 + db %00000000, %01000000, %00000000 + db %00000000, %00000000, %00000000 + +.cgbfade + db %11111111, %11111111, %11111111 + db %11111110, %11111110, %11111110 + db %11111001, %11111001, %11111001 + db %11100100, %11100100, %11100100 + db %10010000, %10010000, %10010000 + db %01000000, %01000000, %01000000 + db %00000000, %00000000, %00000000 +; 8c20f diff --git a/engine/title.asm b/engine/title.asm index 2e151c389..d29c90a23 100644 --- a/engine/title.asm +++ b/engine/title.asm @@ -9,7 +9,7 @@ _TitleScreen: ; 10ed67 ld [hBGMapMode], a ; Reset timing variables - ld hl, wcf63 + ld hl, wJumptableIndex ld [hli], a ; cf63 ; Scene? ld [hli], a ; cf64 ld [hli], a ; cf65 ; Timer lo @@ -53,27 +53,27 @@ _TitleScreen: ; 10ed67 ; Apply logo gradient: ; lines 3-4 - ld hl, $9860 ; (0,3) + ld hl, VBGMap0 tile $06 ; (0,3) ld bc, $0040 ; 2 rows ld a, 2 call ByteFill ; line 5 - ld hl, $98a0 ; (0,5) + ld hl, VBGMap0 tile $0a ; (0,5) ld bc, $0020 ; 1 row ld a, 3 call ByteFill ; line 6 - ld hl, $98c0 ; (0,6) + ld hl, VBGMap0 tile $0c ; (0,6) ld bc, $0020 ; 1 row ld a, 4 call ByteFill ; line 7 - ld hl, $98e0 ; (0,7) + ld hl, VBGMap0 tile $0e ; (0,7) ld bc, $0020 ; 1 row ld a, 5 call ByteFill ; lines 8-9 - ld hl, $9900 ; (0,8) + ld hl, VBGMap0 tile $10 ; (0,8) ld bc, $0040 ; 2 rows ld a, 6 call ByteFill @@ -86,7 +86,7 @@ _TitleScreen: ; 10ed67 call ByteFill ; Suicune gfx - ld hl, $9980 ; (0,12) + ld hl, VBGMap0 tile $18 ; (0,12) ld bc, $00c0 ; the rest of the screen ld a, 8 call ByteFill @@ -130,10 +130,10 @@ _TitleScreen: ; 10ed67 ; Initialize running Suicune? ld d, $0 - call Function10eed2 + call LoadSuicuneFrame ; Initialize background crystal - call Function10ef06 + call InitializeBackground ; Save WRAM bank ld a, [rSVBK] @@ -145,12 +145,12 @@ _TitleScreen: ; 10ed67 ; Update palette colors ld hl, TitleScreenPalettes ld de, Unkn1Pals - ld bc, $0080 + ld bc, 4 * 32 call CopyBytes ld hl, TitleScreenPalettes ld de, BGPals - ld bc, $0080 + ld bc, 4 * 32 call CopyBytes ; Restore WRAM bank @@ -220,7 +220,7 @@ _TitleScreen: ; 10ed67 ld [hBGMapMode], a xor a - ld [DefaultFlypoint], a + ld [Unkn1Pals + 2], a ; Play starting sound effect call SFXChannelsOff @@ -230,25 +230,28 @@ _TitleScreen: ; 10ed67 ret ; 10eea7 -Function10eea7: ; 10eea7 - ld hl, DefaultFlypoint +SuicuneFrameIterator: ; 10eea7 + ld hl, Unkn1Pals + 2 ld a, [hl] ld c, a inc [hl] - and $7 + +; Only do this once every eight frames + and (1 << 3) - 1 ret nz + ld a, c - and $18 + and 3 << 3 sla a swap a ld e, a ld d, $0 - ld hl, Unknown_10eece + ld hl, .Frames add hl, de ld d, [hl] xor a ld [hBGMapMode], a - call Function10eed2 + call LoadSuicuneFrame ld a, $1 ld [hBGMapMode], a ld a, $3 @@ -256,33 +259,36 @@ Function10eea7: ; 10eea7 ret ; 10eece -Unknown_10eece: ; 10eece - db $80, $88, $00, $08 +.Frames: ; 10eece + db $80 ; VTiles4 tile $00 + db $88 ; VTiles4 tile $08 + db $00 ; VTiles5 tile $00 + db $08 ; VTiles5 tile $08 ; 10eed2 -Function10eed2: ; 10eed2 +LoadSuicuneFrame: ; 10eed2 hlcoord 6, 12 - ld b, $6 -.asm_10eed7 - ld c, $8 -.asm_10eed9 + ld b, 6 +.row + ld c, 8 +.col ld a, d ld [hli], a inc d dec c - jr nz, .asm_10eed9 - ld a, $c + jr nz, .col + ld a, SCREEN_WIDTH - 8 add l ld l, a - ld a, $0 + ld a, 0 adc h ld h, a - ld a, $8 + ld a, 8 add d ld d, a dec b - jr nz, .asm_10eed7 + jr nz, .row ret ; 10eeef @@ -293,18 +299,18 @@ DrawTitleGraphic: ; 10eeef ; c: width ; d: tile to start drawing from ; e: number of tiles to advance for each row -.asm_10eeef +.row push de push bc push hl -.asm_10eef2 +.col ld a, d ld [hli], a inc d dec c - jr nz, .asm_10eef2 + jr nz, .col pop hl - ld bc, $0014 + ld bc, SCREEN_WIDTH add hl, bc pop bc pop de @@ -312,31 +318,31 @@ DrawTitleGraphic: ; 10eeef add d ld d, a dec b - jr nz, .asm_10eeef + jr nz, .row ret ; 10ef06 -Function10ef06: ; 10ef06 +InitializeBackground: ; 10ef06 ld hl, Sprites - ld d, $de + ld d, -$22 ld e, $0 - ld c, $5 -.asm_10ef0f + ld c, 5 +.loop push bc - call Function10ef1c + call .InitColumn pop bc ld a, $10 add d ld d, a dec c - jr nz, .asm_10ef0f + jr nz, .loop ret ; 10ef1c -Function10ef1c: ; 10ef1c +.InitColumn: ; 10ef1c ld c, $6 ld b, $40 -.asm_10ef20 +.loop2 ld a, d ld [hli], a ld a, b @@ -351,7 +357,7 @@ endr ld a, $80 ld [hli], a dec c - jr nz, .asm_10ef20 + jr nz, .loop2 ret ; 10ef32 @@ -363,7 +369,7 @@ AnimateTitleCrystal: ; 10ef32 ; y is really from the bottom of the sprite, which is two tiles high ld hl, Sprites ld a, [hl] - cp 6 + 16 + cp 6 + $10 ret z ; Move all 30 parts of the crystal down by 2 diff --git a/event/battle_tower.asm b/event/battle_tower.asm new file mode 100644 index 000000000..04f578fca --- /dev/null +++ b/event/battle_tower.asm @@ -0,0 +1,344 @@ +Function8b1e1: ; 8b1e1 + ld de, Unknown_8b1ed + call Function8b25b + ret z + call Function8b231 + scf + ret +; 8b1ed + +Unknown_8b1ed: ; 8b1ed + db 2 + dw Unknown_8b1f2 + dw Unknown_8b1f6 + +Unknown_8b1f2: ; 8b1f2 + dw Function8b2bb + dw Function8b2c1 +; 8b1f6 + +Unknown_8b1f6: ; 8b1f6 + dw UnknownText_0x8b1fc + dw UnknownText_0x8b23d + dw UnknownText_0x8b242 +; 8b1fc + +UnknownText_0x8b1fc: ; 0x8b1fc + ; Excuse me! + text_jump UnknownText_0x1c5937 + db "@" +; 0x8b201 + +CheckForBattleTowerRules: ; 8b201 + ld hl, StringBuffer2 + ld [hl], "3" + inc hl + ld [hl], "@" + ld de, CheckForBattleTowerRules_FunctionsText + call Function8b25b + ret z + call Function8b231 + scf + ret +; 8b215 + +CheckForBattleTowerRules_FunctionsText: ; 8b215 + db 4 + dw CheckForBattleTowerRules_Functions + dw CheckForBattleTowerRules_Text + +CheckForBattleTowerRules_Functions: ; 8b21a + dw Function_PartyCountEq3 + dw Function_PartySpeciesAreUnique + dw Function_PartyItemsAreUnique + dw Function_HasPartyAnEgg +; 8b222 + +CheckForBattleTowerRules_Text: ; 8b222 + dw JumpText_ExcuseMeYoureNotReady + dw JumpText_OnlyThreePkmnMayBeEntered + dw JumpText_ThePkmnMustAllBeDifferentKinds + dw JumpText_ThePkmnMustNotHoldTheSameItems + dw JumpText_YouCantTakeAnEgg +; 8b22c + +JumpText_ExcuseMeYoureNotReady: ; 0x8b22c + ; Excuse me. You're not ready. + text_jump Text_ExcuseMeYoureNotReady + db "@" +; 0x8b231 + +Function8b231: ; 8b231 + ld hl, UnknownText_0x8b238 + call PrintText + ret +; 8b238 + +UnknownText_0x8b238: ; 0x8b238 + ; Please return when you're ready. + text_jump UnknownText_0x1c5962 + db "@" +; 0x8b23d + +UnknownText_0x8b23d: ; 0x8b23d + ; You need at least three #MON. + text_jump UnknownText_0x1c5983 + db "@" +; 0x8b242 + +UnknownText_0x8b242: ; 0x8b242 + ; Sorry, an EGG doesn't qualify. + text_jump UnknownText_0x1c59a3 + db "@" +; 0x8b247 + +JumpText_OnlyThreePkmnMayBeEntered: ; 0x8b247 + ; Only three #MON may be entered. + text_jump Text_OnlyThreePkmnMayBeEntered + db "@" +; 0x8b24c + +JumpText_ThePkmnMustAllBeDifferentKinds: ; 0x8b24c + ; The @ #MON must all be different kinds. + text_jump Text_ThePkmnMustAllBeDifferentKinds + db "@" +; 0x8b251 + +JumpText_ThePkmnMustNotHoldTheSameItems: ; 0x8b251 + ; The @ #MON must not hold the same items. + text_jump Text_ThePkmnMustNotHoldTheSameItems + db "@" +; 0x8b256 + +JumpText_YouCantTakeAnEgg: ; 0x8b256 + ; You can't take an EGG! + text_jump Text_YouCantTakeAnEgg + db "@" +; 0x8b25b + +Function8b25b: ; 8b25b + ld bc, $0000 +.asm_8b25e + call Function8b26c + call c, Function8b28e + call Function8b276 + jr nz, .asm_8b25e + ld a, b + and a + ret +; 8b26c + +Function8b26c: ; 8b26c + push de + push bc + call Function8b27a + ld a, c + rst JumpTable + pop bc + pop de + ret +; 8b276 + +Function8b276: ; 8b276 + inc c + ld a, [de] + cp c + ret +; 8b27a + +Function8b27a: ; 8b27a + inc de + ld a, [de] + ld l, a + inc de + ld a, [de] + ld h, a + ret +; 8b281 + +Function8b281: ; 8b281 +rept 3 + inc de +endr + ld a, [de] + ld l, a + inc de + ld a, [de] + ld h, a + ret +; 8b28a + +Function8b28a: ; 8b28a + ld a, [hli] + ld h, [hl] + ld l, a + ret +; 8b28e + +Function8b28e: ; 8b28e + push de + push bc + ld a, b + and a + call z, Function8b29d + pop bc + call Function8b2a9 + ld b, $1 + pop de + ret +; 8b29d + +Function8b29d: ; 8b29d + push de + call Function8b281 + call Function8b28a + call PrintText + pop de + ret +; 8b2a9 + +Function8b2a9: ; 8b2a9 + push bc + call Function8b281 +rept 2 + inc hl +endr + ld b, $0 +rept 2 + add hl, bc +endr + call Function8b28a + call PrintText + pop bc + ret +; 8b2bb + +Function8b2bb: ; 8b2bb + ld a, [PartyCount] + cp 3 + ret +; 8b2c1 + +Function8b2c1: ; 8b2c1 + ld hl, PartyCount + ld a, [hli] + ld b, $0 + ld c, a +.asm_8b2c8 + ld a, [hli] + cp EGG + jr z, .asm_8b2ce + inc b + +.asm_8b2ce + dec c + jr nz, .asm_8b2c8 + ld a, [PartyCount] + cp b + ret z + ld a, b + cp 3 + ret +; 8b2da + +Function_PartyCountEq3: ; 8b2da + ld a, [PartyCount] + cp 3 + ret z + scf + ret +; 8b2e2 + +Function_PartySpeciesAreUnique: ; 8b2e2 + ld hl, PartyMon1Species + call VerifyUniqueness + ret +; 8b2e9 + +VerifyUniqueness: ; 8b2e9 + ld de, PartyCount + ld a, [de] + inc de + dec a + jr z, .done + ld b, a +.loop + push hl + push de + ld c, b + call .isegg + jr z, .next + ld a, [hl] + and a + jr z, .next +.loop2 + call .nextmon + call .isegg + jr z, .next2 + cp [hl] + jr z, .gotcha + +.next2 + dec c + jr nz, .loop2 + +.next + pop de + pop hl + call .nextmon + dec b + jr nz, .loop + +.done + and a + ret + +.gotcha + pop de + pop hl + scf + ret +; 8b31a + +.nextmon: ; 8b31a + push bc + ld bc, PartyMon2 - PartyMon1 + add hl, bc + inc de + pop bc + ret +; 8b322 + +.isegg: ; 8b322 + push bc + ld b, a + ld a, [de] + cp EGG + ld a, b + pop bc + ret +; 8b32a + +Function_PartyItemsAreUnique: ; 8b32a + ld hl, PartyMon1Item + call VerifyUniqueness + ret +; 8b331 + +Function_HasPartyAnEgg: ; 8b331 + ld hl, PartyCount + ld a, [hli] + ld c, a +.loop + ld a, [hli] + cp EGG + jr z, .found + dec c + jr nz, .loop + and a + ret + +.found + scf + ret +; 8b342 diff --git a/event/buena.asm b/event/buena.asm new file mode 100644 index 000000000..ada0002d6 --- /dev/null +++ b/event/buena.asm @@ -0,0 +1,342 @@ +SpecialBuenasPassword: ; 8af6b + xor a + ld [wcf76], a + ld hl, MenuDataHeader_0x8afa9 + call CopyMenuDataHeader + ld a, [wBuenasPassword] + ld c, a + callba GetBuenasPassword + ld a, [wMenuBorderLeftCoord] + add c + add $2 + ld [wMenuBorderRightCoord], a + call BackUpTiles + call Function1e5d + callba Function4ae5e + ld b, $0 + ld a, [MenuSelection] + ld c, a + ld a, [wBuenasPassword] + and $3 + cp c + jr nz, .asm_8afa4 + ld b, $1 + +.asm_8afa4 + ld a, b + ld [ScriptVar], a + ret +; 8afa9 + +MenuDataHeader_0x8afa9: ; 0x8afa9 + db $40 ; flags + db 00, 00 ; start coords + db 07, 10 ; end coords + dw MenuData2_0x8afb2 + db 1 ; default option +; 0x8afb1 + + db 0 + +MenuData2_0x8afb2: ; 0x8afb2 + db $81 ; flags + db 0 ; items + dw Unknown_8afb8 + dw Function8afbd +; 0x8afb4 + +Unknown_8afb8: ; 8afb8 + db 3 + db 0, 1, 2 + db -1 + +Function8afbd: ; 8afbd + push de + ld a, [wBuenasPassword] + and $f0 + ld c, a + ld a, [MenuSelection] + add c + ld c, a + callba GetBuenasPassword + pop hl + call PlaceString + ret +; 8afd4 + +SpecialBuenaPrize: ; 8afd4 + xor a + ld [wd0e4], a + ld a, $1 + ld [MenuSelection], a + call Function8b0d6 + call Function8b090 + ld hl, UnknownText_0x8b072 + call PrintText + jr .asm_8aff1 + +.asm_8afeb + ld hl, UnknownText_0x8b072 + call Function105a + +.asm_8aff1 + call DelayFrame + call UpdateSprites + call Function8b097 + call Function8b0e2 + jr z, .asm_8b05f + ld [wcf75], a + call Buena_getprize + ld a, [hl] + ld [wd265], a + call GetItemName + ld hl, UnknownText_0x8b077 + call Function105a + call YesNoBox + jr c, .asm_8afeb + + ld a, [wcf75] + call Buena_getprize + inc hl + ld a, [hld] + ld c, a + ld a, [wBlueCardBalance] + cp c + jr c, .InsufficientBalance + + ld a, [hli] + push hl + ld [CurItem], a + ld a, $1 + ld [wd10c], a + ld hl, NumItems + call ReceiveItem + pop hl + jr nc, .asm_8b04c + ld a, [hl] + ld c, a + ld a, [wBlueCardBalance] + sub c + ld [wBlueCardBalance], a + call Function8b097 + jr .asm_8b051 + +.InsufficientBalance + ld hl, UnknownText_0x8b081 + jr .asm_8b05a + +.asm_8b04c + ld hl, UnknownText_0x8b086 + jr .asm_8b05a + +.asm_8b051 + ld de, SFX_TRANSACTION + call PlaySFX + ld hl, UnknownText_0x8b07c + +.asm_8b05a + call Function105a + jr .asm_8afeb + +.asm_8b05f + call WriteBackup + call WriteBackup + ld hl, UnknownText_0x8b08b + call PrintText + call JoyWaitAorB + call PlayClickSFX + ret +; 8b072 + +UnknownText_0x8b072: ; 0x8b072 + ; Which prize would you like? + text_jump UnknownText_0x1c589f + db "@" +; 0x8b077 + +UnknownText_0x8b077: ; 0x8b077 + ; ? Is that right? + text_jump UnknownText_0x1c58bc + db "@" +; 0x8b07c + +UnknownText_0x8b07c: ; 0x8b07c + ; Here you go! + text_jump UnknownText_0x1c58d1 + db "@" +; 0x8b081 + +UnknownText_0x8b081: ; 0x8b081 + ; You don't have enough points. + text_jump UnknownText_0x1c58e0 + db "@" +; 0x8b086 + +UnknownText_0x8b086: ; 0x8b086 + ; You have no room for it. + text_jump UnknownText_0x1c58ff + db "@" +; 0x8b08b + +UnknownText_0x8b08b: ; 0x8b08b + ; Oh. Please come back again! + text_jump UnknownText_0x1c591a + db "@" +; 0x8b090 + +Function8b090: ; 8b090 + ld hl, MenuDataHeader_0x8b0d1 + call LoadMenuDataHeader + ret +; 8b097 + +Function8b097: ; 8b097 + ld de, wBlueCardBalance + call Function8b09e + ret +; 8b09e + +Function8b09e: ; 8b09e + push de + xor a + ld [hBGMapMode], a + ld hl, MenuDataHeader_0x8b0d1 + call CopyMenuDataHeader + call Function1cbb + call UpdateSprites + call GetMemTileCoord + ld bc, $0015 + add hl, bc + ld de, .Points_string + call PlaceString + ld h, b + ld l, c + inc hl + ld a, $7f + ld [hli], a + ld [hld], a + pop de + lb bc, 1, 2 + call PrintNum + ret +; 8b0ca + +.Points_string: + db "Points@" +; 8b0d1 + +MenuDataHeader_0x8b0d1: ; 0x8b0d1 + db $40 ; flags + db 11, 00 ; start coords + db 13, 11 ; end coords +; 8b0d6 + +Function8b0d6: ; 8b0d6 + ld hl, .menudataheader + call LoadMenuDataHeader + ret +; 8b0dd + +.menudataheader: ; 0x8b0dd + db $40 ; flags + db 00, 00 ; start coords + db 11, 17 ; end coords +; 8b0e2 + +Function8b0e2: ; 8b0e2 + ld hl, .MenuDataHeader + call CopyMenuDataHeader + ld a, [MenuSelection] + ld [wPocketCursorBuffer], a + xor a + ld [wcf76], a + ld [hBGMapMode], a + call Function352f + call UpdateSprites + call Function350c + ld a, [MenuSelection] + ld c, a + ld a, [wcfa9] + ld [MenuSelection], a + ld a, [wcf73] + cp $2 + jr z, .asm_8b111 + ld a, c + and a + ret nz + +.asm_8b111 + xor a + ret +; 8b113 + +.MenuDataHeader: ; 0x8b113 + db $40 ; flags + db 01, 01 ; start coords + db 09, 16 ; end coords + dw .MenuData2 + db 1 ; default option +; 0x8b11b + + db 0 + +.MenuData2: ; 0x8b11c + db $10 ; flags + db 4 ; items + db $d, $1 + dba .indices + dba .prizeitem + dba .prizepoints +; 8b129 + +.indices: ; 8b129 + db 9 + db 1, 2, 3, 4, 5, 6, 7, 8, 9 + db -1 +; 8b134 + +.prizeitem: ; 8b134 + ld a, [MenuSelection] + call Buena_getprize + ld a, [hl] + push de + ld [wNamedObjectIndexBuffer], a + call GetItemName + pop hl + call PlaceString + ret +; 8b147 + +.prizepoints: ; 8b147 + ld a, [MenuSelection] + call Buena_getprize + inc hl + ld a, [hl] + ld c, "0" + add c + ld [de], a + ret +; 8b154 + +Buena_getprize: ; 8b154 + dec a + ld hl, .prizes + ld b, 0 + ld c, a +rept 2 + add hl, bc +endr + ret +; 8b15e + +.prizes: ; 8b15e + db ULTRA_BALL, 2 + db FULL_RESTORE, 2 + db NUGGET, 3 + db RARE_CANDY, 3 + db PROTEIN, 5 + db IRON, 5 + db CARBOS, 5 + db CALCIUM, 5 + db HP_UP, 5 +; 8b170 diff --git a/event/kurt.asm b/event/kurt.asm new file mode 100644 index 000000000..98c276e52 --- /dev/null +++ b/event/kurt.asm @@ -0,0 +1,415 @@ +Kurt_PrintTextWhichApricorn: ; 88000 + ld hl, UnknownText_0x88007 + call PrintText + ret +; 88007 + +UnknownText_0x88007: ; 0x88007 + ; Which APRICORN should I use? + text_jump UnknownText_0x1bc06b + db "@" +; 0x8800c + +Kurt_PrintTextHowMany: ; 8800c + ld hl, UnknownText_0x88013 + call PrintText + ret +; 88013 + +UnknownText_0x88013: ; 0x88013 + ; How many should I make? + text_jump UnknownText_0x1bc089 + db "@" +; 0x88018 + +Special_SelectApricornForKurt: ; 88018 + call Function1d6e + ld c, $1 + xor a + ld [wd0e4], a + ld [wKurtApricornQuantity], a +.loop + push bc + call Kurt_PrintTextWhichApricorn + pop bc + ld a, c + ld [MenuSelection], a + call Kurt_SelectApricorn + ld a, c + ld [ScriptVar], a + and a + jr z, .done + ld [CurItem], a + ld a, [wcfa9] + ld c, a + push bc + call Kurt_PrintTextHowMany + call Kurt_SelectQuantity + pop bc + jr nc, .loop + ld a, [wd10c] + ld [wKurtApricornQuantity], a + call Kurt_GiveUpSelectedQuantityOfSelectedApricorn + +.done + call Function1d7d + ret +; 88055 + +Kurt_SelectApricorn: ; 88055 + callba FindApricornsInBag + jr c, .nope + ld hl, .MenuDataHeader + call CopyMenuDataHeader + ld a, [MenuSelection] + ld [wPocketCursorBuffer], a + xor a + ld [hBGMapMode], a + call Function352f + call UpdateSprites + call Function350c + ld a, [wcf73] + cp $2 + jr z, .nope + ld a, [MenuSelection] + cp -1 + jr nz, .done + +.nope + xor a + +.done + ld c, a + ret +; 88086 + +.MenuDataHeader: ; 0x88086 + db $40 ; flags + db 01, 01 ; start coords + db 10, 13 ; end coords + dw .MenuData2 + db 1 ; default option +; 0x8808e + + db 0 + +.MenuData2: ; 0x8808f + db $10 ; flags + db 4, 7 + db 1 + dbw 0, Buffer1 + dbw BANK(.Name), .Name + dbw BANK(.Quantity), .Quantity + dbw BANK(NULL), NULL + +.Name: ; 8809f + ld a, [MenuSelection] + and a + ret z + callba PlaceMenuItemName + ret +; 880ab + +.Quantity: ; 880ab + ld a, [MenuSelection] + ld [CurItem], a + call Kurt_GetQuantityOfApricorn + ret z + ld a, [wd10c] + ld [wcf75], a + callba PlaceMenuItemQuantity + ret +; 880c2 + +Kurt_SelectQuantity: ; 880c2 + ld a, [CurItem] + ld [MenuSelection], a + call Kurt_GetQuantityOfApricorn + jr z, .done + ld a, [wd10c] + ld [wd10d], a + ld a, $1 + ld [wd10c], a + ld hl, .MenuDataHeader + call LoadMenuDataHeader +.loop + xor a + ld [hBGMapMode], a + call Function1cbb + call UpdateSprites + call .PlaceApricornName + call PlaceApricornQuantity + call Function321c + callba Function27a28 + jr nc, .loop + + push bc + call PlayClickSFX + pop bc + ld a, b + cp -1 + jr z, .done + ld a, [wd10c] + ld [wd10c], a ; What is the point of this operation? + scf + +.done + call WriteBackup + ret +; 8810d + +.MenuDataHeader: ; 0x8810d + db $40 ; flags + db 09, 06 ; start coords + db 12, 19 ; end coords + + db 0, 0, -1, 0 ; XXX + +.PlaceApricornName: ; 88116 + call GetMemTileCoord + ld de, $0015 + add hl, de + ld d, h + ld e, l + callba PlaceMenuItemName + ret +; 88126 + +PlaceApricornQuantity: ; 88126 + call GetMemTileCoord + ld de, $0032 + add hl, de + ld [hl], "×" + inc hl + ld de, wd10c + lb bc, PRINTNUM_LEADINGZEROS | 1, 2 + jp PrintNum +; 88139 + +Kurt_GetQuantityOfApricorn: ; 88139 + push bc + ld hl, NumItems + ld a, [CurItem] + ld c, a + ld b, $0 +.loop + inc hl + ld a, [hli] + cp -1 + jr z, .done + cp c + jr nz, .loop + ld a, [hl] + add b + ld b, a + jr nc, .loop + ld b, -1 + +.done + ld a, b + sub 99 + jr c, .done2 + ld b, 99 + +.done2 + ld a, b + ld [wd10c], a + and a + pop bc + ret +; 88161 + +Kurt_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161 +; Get the quantity of Apricorns of type [CurItem] +; in the bag. Compatible with multiple stacks. + +; Initialize the search. + push de + push bc + ld hl, NumItems + ld a, [CurItem] + ld c, a + ld e, $0 + xor a + ld [ItemCountBuffer], a + ld a, -1 + ld [MiscBuffer2], a + +; Search for [CurItem] in the bag. +.loop1 +; Increase the total count. + ld a, [ItemCountBuffer] + inc a + ld [ItemCountBuffer], a +; Get the index of the next item. + inc hl + ld a, [hli] +; If we've reached the end of the pocket, break. + cp -1 + jr z, .okay1 +; If we haven't found what we're looking for, continue. + cp c + jr nz, .loop1 +; Increment the result counter and store the bag index of the match. + ld d, $0 + push hl + ld hl, MiscBuffer2 + add hl, de + inc e + ld a, [ItemCountBuffer] + dec a + ld [hli], a + ld a, -1 + ld [hl], a + pop hl + jr .loop1 + +.okay1 +; How many stacks have we found? + ld a, e + and a + jr z, .done + dec a + jr z, .OnlyOne + ld hl, MiscBuffer2 + +.loop2 + ld a, [hl] + ld c, a + push hl +.loop3 + inc hl + ld a, [hl] + cp -1 + jr z, .okay2 + ld b, a + ld a, c + call Kurt_GetAddressOfApricornQuantity + ld e, a + ld a, b + call Kurt_GetAddressOfApricornQuantity + sub e + jr z, .equal + jr c, .less + jr .loop3 + +.equal + ld a, c + sub b + jr nc, .loop3 + +.less + ld a, c + ld c, b + ld [hl], a + ld a, c + pop hl + ld [hl], a + push hl + jr .loop3 + +.okay2 + pop hl + inc hl + ld a, [hl] + cp -1 + jr nz, .loop2 + +.OnlyOne + ld hl, MiscBuffer2 +.loop4 + ld a, [hl] + cp -1 + jr z, .done + push hl + ld [ItemCountBuffer], a + call Kurt_GetRidOfItem + pop hl + ld a, [wd10c] + and a + jr z, .done + push hl + ld a, [hli] + ld c, a +.loop5 + ld a, [hli] + cp -1 + jr z, .okay3 + cp c + jr c, .loop5 + dec a + dec hl + ld [hli], a + jr .loop5 + +.okay3 + pop hl + inc hl + jr .loop4 + +.done + ld a, [wd10c] + and a + pop bc + pop de + ret +; 88201 + +Kurt_GetAddressOfApricornQuantity: ; 88201 + push hl + push bc + ld hl, NumItems + inc hl + ld c, a + ld b, $0 +rept 2 + add hl, bc +endr + inc hl + ld a, [hl] + pop bc + pop hl + ret +; 88211 + +Kurt_GetRidOfItem: ; 88211 + push bc + ld hl, NumItems + ld a, [ItemCountBuffer] + ld c, a + ld b, $0 + inc hl +rept 2 + add hl, bc +endr + ld a, [CurItem] + ld c, a + ld a, [hli] + cp -1 + jr z, .done + cp c + jr nz, .done + ld a, [wd10c] + ld c, a + ld a, [hl] + sub c + ld b, c + jr nc, .okay + add c + ld b, a + +.okay + push bc + ld hl, NumItems + ld a, b + ld [wd10c], a + call TossItem + pop bc + ld a, c + sub b + +.done + ld [wd10c], a + pop bc + ret +; 88248 diff --git a/event/mom.asm b/event/mom.asm index f6bccdc28..c3e407be3 100644 --- a/event/mom.asm +++ b/event/mom.asm @@ -1,12 +1,12 @@ Special_BankOfMom: ; 16218 - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a xor a - ld [wcf63], a + ld [wJumptableIndex], a .asm_16223 - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_1622f call Function16233 @@ -14,15 +14,15 @@ Special_BankOfMom: ; 16218 .asm_1622f pop af - ld [$ffaa], a + ld [hInMenu], a ret ; 16233 Function16233: ; 16233 - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 - ld hl, Jumptable_16242 + ld hl, .jumptable rept 2 add hl, de endr @@ -32,75 +32,75 @@ endr jp [hl] ; 16242 -Jumptable_16242: ; 16242 - dw Function16254 - dw Function1626a - dw Function16290 - dw Function162a8 - dw Function162e0 - dw Function16373 - dw Function16406 - dw Function1642d - dw Function16433 +.jumptable: ; 16242 + dw .CheckIfBankInitialized + dw .InitializeBank + dw .IsThisAboutYourMoney + dw .AccessBankOfMom + dw .StoreMoney + dw .TakeMoney + dw .StopOrStartSavingMoney + dw .AskDST + dw .JustDoWhatYouCan ; 16254 -Function16254: ; 16254 - ld a, [wd854] +.CheckIfBankInitialized: ; 16254 + ld a, [wBankOfMomMode] bit 7, a - jr nz, .asm_16264 + jr nz, .savingmoneyalready set 7, a - ld [wd854], a + ld [wBankOfMomMode], a ld a, $1 - jr .asm_16266 + jr .done_0 -.asm_16264 +.savingmoneyalready ld a, $2 -.asm_16266 - ld [wcf63], a +.done_0 + ld [wJumptableIndex], a ret ; 1626a -Function1626a: ; 1626a +.InitializeBank: ; 1626a ld hl, UnknownText_0x16649 call PrintText call YesNoBox - jr c, .asm_1627f + jr c, .DontSaveMoney ld hl, UnknownText_0x1664e call PrintText - ld a, $81 - jr .asm_16281 + ld a, %10000001 + jr .done_1 -.asm_1627f - ld a, $80 +.DontSaveMoney + ld a, %10000000 -.asm_16281 - ld [wd854], a +.done_1 + ld [wBankOfMomMode], a ld hl, UnknownText_0x16653 call PrintText ld a, $8 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 16290 -Function16290: ; 16290 +.IsThisAboutYourMoney: ; 16290 ld hl, UnknownText_0x16658 call PrintText call YesNoBox - jr c, .asm_1629f + jr c, .nope ld a, $3 - jr .asm_162a4 + jr .done_2 -.asm_1629f +.nope call DSTChecks ld a, $7 -.asm_162a4 - ld [wcf63], a +.done_2 + ld [wJumptableIndex], a ret ; 162a8 -Function162a8: ; 162a8 +.AccessBankOfMom: ; 162a8 ld hl, UnknownText_0x1665d call PrintText call Function1d6e @@ -108,36 +108,36 @@ Function162a8: ; 162a8 call CopyMenuDataHeader call InterpretMenu2 call WriteBackup - jr c, .asm_162ce + jr c, .cancel ld a, [wcfa9] cp $1 - jr z, .asm_162d2 + jr z, .withdraw cp $2 - jr z, .asm_162d6 + jr z, .deposit cp $3 - jr z, .asm_162da + jr z, .stopsaving -.asm_162ce +.cancel ld a, $7 - jr .asm_162dc + jr .done_3 -.asm_162d2 +.withdraw ld a, $5 - jr .asm_162dc + jr .done_3 -.asm_162d6 +.deposit ld a, $4 - jr .asm_162dc + jr .done_3 -.asm_162da +.stopsaving ld a, $6 -.asm_162dc - ld [wcf63], a +.done_3 + ld [wJumptableIndex], a ret ; 162e0 -Function162e0: ; 162e0 +.StoreMoney: ; 162e0 ld hl, UnknownText_0x16662 call PrintText xor a @@ -153,31 +153,31 @@ endr call Function1656b call Function16571 call WriteBackup - jr c, .asm_1636d + jr c, .CancelDeposit ld hl, StringBuffer2 ld a, [hli] or [hl] inc hl or [hl] - jr z, .asm_1636d + jr z, .CancelDeposit ld de, Money ld bc, StringBuffer2 callba CheckMoney - jr c, .asm_1635f + jr c, .DontHaveThatMuchToDeposit ld hl, StringBuffer2 ld de, StringBuffer2 + 3 - ld bc, $0003 + ld bc, 3 call CopyBytes ld bc, wd851 ld de, StringBuffer2 callba GiveMoney - jr c, .asm_16366 + jr c, .CantDepositThatMuch ld bc, StringBuffer2 + 3 ld de, Money callba TakeMoney ld hl, StringBuffer2 ld de, wd851 - ld bc, $0003 + ld bc, 3 call CopyBytes ld de, SFX_TRANSACTION call PlaySFX @@ -185,27 +185,27 @@ endr ld hl, UnknownText_0x1668a call PrintText ld a, $8 - jr .asm_1636f + jr .done_4 -.asm_1635f +.DontHaveThatMuchToDeposit ld hl, UnknownText_0x1667b call PrintText ret -.asm_16366 +.CantDepositThatMuch ld hl, UnknownText_0x16680 call PrintText ret -.asm_1636d +.CancelDeposit ld a, $7 -.asm_1636f - ld [wcf63], a +.done_4 + ld [wJumptableIndex], a ret ; 16373 -Function16373: ; 16373 +.TakeMoney: ; 16373 ld hl, UnknownText_0x16667 call PrintText xor a @@ -221,13 +221,13 @@ endr call Function1656b call Function16571 call WriteBackup - jr c, .asm_16400 + jr c, .CancelWithdraw ld hl, StringBuffer2 ld a, [hli] or [hl] inc hl or [hl] - jr z, .asm_16400 + jr z, .CancelWithdraw ld hl, StringBuffer2 ld de, StringBuffer2 + 3 ld bc, 3 @@ -235,11 +235,11 @@ endr ld de, wd851 ld bc, StringBuffer2 callba CheckMoney - jr c, .asm_163f2 + jr c, .InsufficientFundsInBank ld bc, Money ld de, StringBuffer2 callba GiveMoney - jr c, .asm_163f9 + jr c, .NotEnoughRoomInWallet ld bc, StringBuffer2 + 3 ld de, wd851 callba TakeMoney @@ -253,53 +253,53 @@ endr ld hl, UnknownText_0x1668f call PrintText ld a, $8 - jr .asm_16402 + jr .done_5 -.asm_163f2 +.InsufficientFundsInBank ld hl, UnknownText_0x16671 call PrintText ret -.asm_163f9 +.NotEnoughRoomInWallet ld hl, UnknownText_0x16676 call PrintText ret -.asm_16400 - ld a, 7 +.CancelWithdraw + ld a, $7 -.asm_16402 - ld [wcf63], a +.done_5 + ld [wJumptableIndex], a ret ; 16406 -Function16406: ; 16406 +.StopOrStartSavingMoney: ; 16406 ld hl, UnknownText_0x1666c call PrintText call YesNoBox - jr c, .asm_16422 + jr c, .StopSavingMoney ld a, $81 - ld [wd854], a + ld [wBankOfMomMode], a ld hl, UnknownText_0x16685 call PrintText ld a, $8 - ld [wcf63], a + ld [wJumptableIndex], a ret -.asm_16422 +.StopSavingMoney ld a, $80 - ld [wd854], a + ld [wBankOfMomMode], a ld a, $7 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 1642d -Function1642d: ; 1642d +.AskDST: ; 1642d ld hl, UnknownText_0x16694 call PrintText -Function16433: ; 16433 - ld hl, wcf63 +.JustDoWhatYouCan: ; 16433 + ld hl, wJumptableIndex set 7, [hl] ret ; 16439 @@ -491,7 +491,7 @@ Function1656b: ; 1656b Function16571: ; 16571 .loop - call Functiona57 + call JoyTextDelay ld hl, hJoyPressed ld a, [hl] and B_BUTTON diff --git a/event/poke_seer.asm b/event/poke_seer.asm index cb1e23966..f785e378c 100644 --- a/event/poke_seer.asm +++ b/event/poke_seer.asm @@ -11,7 +11,7 @@ SEER_LEVEL_ONLY EQU 7 SpecialPokeSeer: ; 4f0bc ld a, SEER_INTRO call PrintSeerText - call Functiona36 + call JoyWaitAorB ld b, $6 callba SelectMonFromParty diff --git a/event/unown.asm b/event/unown.asm new file mode 100644 index 000000000..d0456f896 --- /dev/null +++ b/event/unown.asm @@ -0,0 +1,300 @@ + + +SpecialHoOhChamber: ; 0x8addb + ld hl, PartySpecies + ld a, [hl] + cp HO_OH ; is Ho-oh the first Pokémon in the party? + jr nz, .done ; if not, we're done + call GetSecondaryMapHeaderPointer + ld de, EVENT_WALL_OPENED_IN_HO_OH_CHAMBER + ld b, SET_FLAG + call EventFlagAction +.done + ret +; 0x8adef + +SpecialOmanyteChamber: ; 8adef + call GetSecondaryMapHeaderPointer + ld de, EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER + ld b, CHECK_FLAG + call EventFlagAction + ld a, c + and a + jr nz, .nope + + ld a, WATER_STONE + ld [CurItem], a + ld hl, NumItems + call CheckItem + jr c, .open + + ld a, [PartyCount] + ld b, a + inc b +.loop + dec b + jr z, .nope + ld a, b + dec a + ld [CurPartyMon], a + push bc + ld a, PartyMon1Item - PartyMon1 + call GetPartyParamLocation + pop bc + ld a, [hl] + cp WATER_STONE + jr nz, .loop + +.open + call GetSecondaryMapHeaderPointer + ld de, EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER + ld b, SET_FLAG + call EventFlagAction + +.nope + ret +; 8ae30 + +SpecialAerodactylChamber: ; 8ae30 + push de + push bc + + call GetSecondaryMapHeaderPointer + ld a, h + cp RuinsofAlphAerodactylChamber_SecondMapHeader / $100 + jr nz, .nope + ld a, l + cp RuinsofAlphAerodactylChamber_SecondMapHeader % $100 + jr nz, .nope + + ld de, EVENT_WALL_OPENED_IN_AERODACTYL_CHAMBER + ld b, SET_FLAG + call EventFlagAction + + scf + jr .done + +.nope + and a + +.done + pop bc + pop de + ret +; 8ae4e + +SpecialKabutoChamber: ; 8ae4e + push hl + push de + + call GetSecondaryMapHeaderPointer + ld a, h + cp RuinsofAlphKabutoChamber_SecondMapHeader / $100 + jr nz, .done + ld a, l + cp RuinsofAlphKabutoChamber_SecondMapHeader % $100 + jr nz, .done + + ld de, EVENT_WALL_OPENED_IN_KABUTO_CHAMBER + ld b, SET_FLAG + call EventFlagAction + +.done + pop de + pop hl + ret +; 8ae68 + +Special_DisplayUnownWords: ; 8ae68 + ld a, [ScriptVar] + ld hl, MenuDataHeader_0x8aed5 + and a + jr z, .asm_8ae79 + + ld d, $0 + ld e, $5 +.asm_8ae75 + add hl, de + dec a + jr nz, .asm_8ae75 + +.asm_8ae79 + call LoadMenuDataHeader + xor a + ld [hBGMapMode], a + call Function1cbb + call UpdateSprites + call Function321c + call GetMemTileCoord + inc hl + ld d, $0 + ld e, $14 +rept 2 + add hl, de +endr + ld a, [ScriptVar] + ld c, a + ld de, Unknown_8aebc + and a + jr z, .asm_8aea5 +.asm_8ae9c + ld a, [de] + inc de + cp $ff + jr nz, .asm_8ae9c + dec c + jr nz, .asm_8ae9c + +.asm_8aea5 + call Function8af09 + ld bc, AttrMap - TileMap + add hl, bc + call Function8aee9 + call Function3200 + call JoyWaitAorB + call PlayClickSFX + call WriteBackup + ret +; 8aebc + +Unknown_8aebc: ; 8aebc + db $08, $44, $04, $00, $2e, $08, $ff + db $26, $20, $0c, $0e, $46, $ff + db $4c, $00, $46, $08, $42, $ff + db $0e, $2c, $64, $2c, $0e, $ff +; 8aed5 + +MenuDataHeader_0x8aed5: ; 0x8aed5 + db $40 ; flags + db 04, 03 ; start coords + db 09, 16 ; end coords + +MenuDataHeader_0x8aeda: ; 0x8aeda + db $40 ; flags + db 04, 04 ; start coords + db 09, 15 ; end coords + +MenuDataHeader_0x8aedf: ; 0x8aedf + db $40 ; flags + db 04, 04 ; start coords + db 09, 15 ; end coords + +MenuDataHeader_0x8aee4: ; 0x8aee4 + db $40 ; flags + db 04, 04 ; start coords + db 09, 15 ; end coords +; 8aee9 + +Function8aee9: ; 8aee9 +.asm_8aee9 + ld a, [de] + cp $ff + ret z + cp $60 + ld a, $d + jr c, .asm_8aef5 + ld a, $5 + +.asm_8aef5 + call Function8aefd +rept 2 + inc hl +endr + inc de + jr .asm_8aee9 +; 8aefd + +Function8aefd: ; 8aefd + push hl + ld [hli], a + ld [hld], a + ld b, $0 + ld c, $14 + add hl, bc + ld [hli], a + ld [hl], a + pop hl + ret +; 8af09 + +Function8af09: ; 8af09 + push hl + push de +.asm_8af0b + ld a, [de] + cp $ff + jr z, .asm_8af19 + ld c, a + call Function8af1c +rept 2 + inc hl +endr + inc de + jr .asm_8af0b + +.asm_8af19 + pop de + pop hl + ret +; 8af1c + +Function8af1c: ; 8af1c + push hl + ld a, c + cp $60 + jr z, .asm_8af3b + cp $62 + jr z, .asm_8af4b + cp $64 + jr z, .asm_8af5b + ld [hli], a + inc a + ld [hld], a + dec a + ld b, $0 + ld c, $14 + add hl, bc + ld c, $10 + add c + ld [hli], a + inc a + ld [hl], a + pop hl + ret + +.asm_8af3b + ld [hl], $5b + inc hl + ld [hl], $5c + ld bc, $0013 + add hl, bc + ld [hl], $4d + inc hl + ld [hl], $5d + pop hl + ret + +.asm_8af4b + ld [hl], $4e + inc hl + ld [hl], $4f + ld bc, $0013 + add hl, bc + ld [hl], $5e + inc hl + ld [hl], $5f + pop hl + ret + +.asm_8af5b + ld [hl], $2 + inc hl + ld [hl], $3 + ld bc, $0013 + add hl, bc + ld [hl], $3 + inc hl + ld [hl], $2 + pop hl + ret +; 8af6b diff --git a/gfx/credits/border.png b/gfx/credits/border.png index d93bddc8a..c396d533d 100644 Binary files a/gfx/credits/border.png and b/gfx/credits/border.png differ diff --git a/gfx/credits/pichu.png b/gfx/credits/pichu.png index f98642ec8..529973d29 100644 Binary files a/gfx/credits/pichu.png and b/gfx/credits/pichu.png differ diff --git a/gfx/credits/theend.png b/gfx/credits/theend.png index 165f8ba8e..1f10e16df 100644 Binary files a/gfx/credits/theend.png and b/gfx/credits/theend.png differ diff --git a/gfx/misc/pack.png b/gfx/misc/pack.png index b85fc0990..738a9dd94 100644 Binary files a/gfx/misc/pack.png and b/gfx/misc/pack.png differ diff --git a/gfx/unknown/08c2f4.2bpp b/gfx/overworld/trainer_battle_pokeball_tiles.2bpp similarity index 100% rename from gfx/unknown/08c2f4.2bpp rename to gfx/overworld/trainer_battle_pokeball_tiles.2bpp diff --git a/gfx/pics/animation.asm b/gfx/pics/animation.asm index d736ef37e..165cf642d 100644 --- a/gfx/pics/animation.asm +++ b/gfx/pics/animation.asm @@ -3,7 +3,7 @@ Functiond0000: ; d0000 hlcoord 12, 0 - ld a, [IsInBattle] + ld a, [wBattleMode] cp $1 jr z, .asm_d0012 ld e, $0 diff --git a/home.asm b/home.asm index ec4daa2d2..eef727909 100644 --- a/home.asm +++ b/home.asm @@ -95,7 +95,7 @@ Function2ecb:: ; 2ecb ; 2ed3 -Function2ed3:: ; 0x2ed3 +DisableSpriteUpdates:: ; 0x2ed3 ; disables overworld sprite updating? xor a ld [$ffde], a @@ -107,7 +107,7 @@ Function2ed3:: ; 0x2ed3 ret ; 0x2ee4 -Function2ee4:: ; 2ee4 +EnableSpriteUpdates:: ; 2ee4 ld a, $1 ld [wc2ce], a ld a, [VramState] @@ -157,7 +157,7 @@ IsInJohto:: ; 2f17 ; 2f3e -Function2f3e:: ; 2f3e +ret_2f3e:: ; 2f3e ret ; 2f3f @@ -605,24 +605,27 @@ Function3246:: ; 3246 push af xor a ld [hBGMapMode], a + ld a, [$ffde] push af xor a ld [$ffde], a + .wait ld a, [rLY] cp $7f jr c, .wait di - ld a, $1 + ld a, 1 ; BANK(VTiles3) ld [rVBK], a hlcoord 0, 0, AttrMap call Function327b - ld a, $0 + ld a, 0 ; BANK(VTiles0) ld [rVBK], a hlcoord 0, 0 call Function327b + .wait2 ld a, [rLY] cp $7f @@ -637,30 +640,33 @@ Function3246:: ; 3246 ; 327b Function327b:: ; 327b +; Copy all tiles to VBGMap ld [hSPBuffer], sp ld sp, hl - ld a, [$ffd7] + ld a, [hBGMapAddress + 1] ld h, a ld l, 0 - ld a, 18 + ld a, SCREEN_HEIGHT ld [$ffd3], a ld b, 1 << 1 ; not in v/hblank ld c, rSTAT % $100 .loop -rept 20 / 2 +rept SCREEN_WIDTH / 2 pop de +; if in v/hblank, wait until not in v/hblank .loop\@ ld a, [$ff00+c] and b jr nz, .loop\@ +; load BGMap0 ld [hl], e inc l ld [hl], d inc l endr - ld de, 32 - 20 + ld de, $20 - SCREEN_WIDTH add hl, de ld a, [$ffd3] dec a @@ -836,7 +842,7 @@ Function33c0: ; 33c3 GetName:: ; 33c3 -; Return name CurSpecies from name list wcf61 in StringBuffer1. +; Return name CurSpecies from name list wNamedObjectTypeBuffer in StringBuffer1. ld a, [hROMBank] push af @@ -844,7 +850,7 @@ GetName:: ; 33c3 push bc push de - ld a, [wcf61] + ld a, [wNamedObjectTypeBuffer] cp PKMN_NAME jr nz, .NotPokeName @@ -858,7 +864,7 @@ GetName:: ; 33c3 jr .done .NotPokeName - ld a, [wcf61] + ld a, [wNamedObjectTypeBuffer] dec a ld e, a ld d, 0 @@ -994,7 +1000,7 @@ GetItemName:: ; 3468 ld [CurSpecies], a ld a, ITEM_NAME - ld [wcf61], a + ld [wNamedObjectTypeBuffer], a call GetName jr .Copied .TM @@ -1123,7 +1129,7 @@ GetMoveName:: ; 34f8 push hl ld a, MOVE_NAME - ld [wcf61], a + ld [wNamedObjectTypeBuffer], a ld a, [wNamedObjectIndexBuffer] ; move id ld [CurSpecies], a @@ -1163,16 +1169,16 @@ Function3524:: ; 3524 ; 352f Function352f:: ; 352f - ld a, [wcf82] + ld a, [wMenuBorderTopCoord] dec a ld b, a - ld a, [wcf84] + ld a, [wMenuBorderBottomCoord] sub b ld d, a - ld a, [wcf83] + ld a, [wMenuBorderLeftCoord] dec a ld c, a - ld a, [wcf85] + ld a, [wMenuBorderRightCoord] sub c ld e, a push de @@ -1184,15 +1190,15 @@ Function352f:: ; 352f Function354b:: ; 354b call DelayFrame - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a - call Functiona57 + ld [hInMenu], a + call JoyTextDelay pop af - ld [$ffaa], a + ld [hInMenu], a - ld a, [$ffa9] + ld a, [hJoyLast] and D_RIGHT + D_LEFT + D_UP + D_DOWN ld c, a ld a, [hJoyPressed] @@ -1599,7 +1605,7 @@ Function3718:: ; 3718 jr .ok .canlose - ld a, [wd0ee] + ld a, [wBattleResult] ld hl, WalkingTile and $f jr z, .ok @@ -1736,7 +1742,7 @@ PrintLevel:: ; 382d ; Print TempMonLevel at hl ld a, [TempMonLevel] - ld [hl], LV_CHAR + ld [hl], "" inc hl ; How many digits? @@ -1752,7 +1758,7 @@ PrintLevel:: ; 382d Function383d:: ; 383d ; Print :L and all 3 digits - ld [hl], LV_CHAR + ld [hl], "" inc hl ld c, 3 ; 3842 @@ -1766,7 +1772,7 @@ Function3842:: ; 3842 Function384d:: ; 384d - ld hl, wd25e + ld hl, wListMoves_MoveIndicesBuffer ld c, a ld b, 0 add hl, bc @@ -2220,8 +2226,8 @@ Function3f6e:: ; 3f6e ; 3f7c Function3f7c:: ; 3f7c - call Function1cfd - call Function1c53 + call GetMemTileCoord + call GetMenuBoxDims dec b dec c call Function3eea diff --git a/home/battle.asm b/home/battle.asm index a374d59bc..37f39572a 100644 --- a/home/battle.asm +++ b/home/battle.asm @@ -106,7 +106,7 @@ UpdateEnemyMonInParty:: ; 39b0 ; Update level, status, current HP ; No wildmons. - ld a, [IsInBattle] + ld a, [wBattleMode] dec a ret z @@ -194,34 +194,6 @@ endr dw .status, .statusopp, .animation, .effect, .power, .type dw .curmove, .lastcounter, .lastcounteropp, .lastmove, .lastmoveopp - const_def - const PLAYER_SUBSTATUS_1 - const ENEMY_SUBSTATUS_1 - const PLAYER_SUBSTATUS_2 - const ENEMY_SUBSTATUS_2 - const PLAYER_SUBSTATUS_3 - const ENEMY_SUBSTATUS_3 - const PLAYER_SUBSTATUS_4 - const ENEMY_SUBSTATUS_4 - const PLAYER_SUBSTATUS_5 - const ENEMY_SUBSTATUS_5 - const PLAYER_STATUS - const ENEMY_STATUS - const PLAYER_MOVE_ANIMATION - const ENEMY_MOVE_ANIMATION - const PLAYER_MOVE_EFFECT - const ENEMY_MOVE_EFFECT - const PLAYER_MOVE_POWER - const ENEMY_MOVE_POWER - const PLAYER_MOVE_TYPE - const ENEMY_MOVE_TYPE - const PLAYER_CUR_MOVE - const ENEMY_CUR_MOVE - const PLAYER_COUNTER_MOVE - const ENEMY_COUNTER_MOVE - const PLAYER_LAST_MOVE - const ENEMY_LAST_MOVE - ; player enemy .substatus1 db PLAYER_SUBSTATUS_1, ENEMY_SUBSTATUS_1 .substatus1opp db ENEMY_SUBSTATUS_1, PLAYER_SUBSTATUS_1 @@ -293,8 +265,8 @@ CELL_PHONE_TOP EQU $5e CELL_PHONE_BOTTOM EQU $5f ; For mobile link battles only. - ld a, [InLinkBattle] - cp 4 + ld a, [wLinkMode] + cp LINK_MOBILE ret c ; Draw a cell phone icon at the diff --git a/home/copy.asm b/home/copy.asm index bd944aa0b..d17e459ca 100644 --- a/home/copy.asm +++ b/home/copy.asm @@ -117,8 +117,8 @@ Functione51:: ; e51 ret ; e58 -Functione58:: ; e58 - callba Functionfb4be +LoadFontsBattleExtra:: ; e58 + callba _LoadFontsBattleExtra ret ; e5f @@ -211,6 +211,7 @@ endr Request2bpp:: ; eba +; Load 2bpp at b:de to occupy c tiles of hl. ld a, [hBGMapMode] push af xor a @@ -223,19 +224,19 @@ Request2bpp:: ; eba ld a, [$ffd3] push af - ld a, $8 ld [$ffd3], a - ld a, [InLinkBattle] - cp $4 - jr nz, .asm_edc - ld a, [$ffe9] + + ld a, [wLinkMode] + cp LINK_MOBILE + jr nz, .NotMobile + ld a, [hMobile] and a - jr nz, .asm_edc + jr nz, .NotMobile ld a, $6 ld [$ffd3], a -.asm_edc +.NotMobile ld a, e ld [Requested2bppSource], a ld a, d @@ -244,12 +245,11 @@ Request2bpp:: ; eba ld [Requested2bppDest], a ld a, h ld [Requested2bppDest + 1], a - -.asm_eec +.loop ld a, c ld hl, $ffd3 cp [hl] - jr nc, .asm_f08 + jr nc, .iterate ld [Requested2bpp], a .wait @@ -268,19 +268,21 @@ Request2bpp:: ; eba ld [hBGMapMode], a ret -.asm_f08 +.iterate ld a, [$ffd3] ld [Requested2bpp], a -.asm_f0d + +.wait2 call DelayFrame ld a, [Requested2bpp] and a - jr nz, .asm_f0d + jr nz, .wait2 + ld a, c ld hl, $ffd3 sub [hl] ld c, a - jr .asm_eec + jr .loop ; f1e @@ -300,16 +302,16 @@ Request1bpp:: ; f1e ld a, $8 ld [$ffd3], a - ld a, [InLinkBattle] - cp $4 - jr nz, .asm_f40 - ld a, [$ffe9] + ld a, [wLinkMode] + cp LINK_MOBILE + jr nz, .NotMobile + ld a, [hMobile] and a - jr nz, .asm_f40 + jr nz, .NotMobile ld a, $6 ld [$ffd3], a -.asm_f40 +.NotMobile ld a, e ld [Requested1bppSource], a ld a, d @@ -318,11 +320,11 @@ Request1bpp:: ; f1e ld [Requested1bppDest], a ld a, h ld [Requested1bppDest + 1], a -.asm_f50 +.loop ld a, c ld hl, $ffd3 cp [hl] - jr nc, .asm_f6c + jr nc, .iterate ld [Requested1bpp], a .wait @@ -341,19 +343,21 @@ Request1bpp:: ; f1e ld [hBGMapMode], a ret -.asm_f6c +.iterate ld a, [$ffd3] ld [Requested1bpp], a -.asm_f71 + +.wait2 call DelayFrame ld a, [Requested1bpp] and a - jr nz, .asm_f71 + jr nz, .wait2 + ld a, c ld hl, $ffd3 sub [hl] ld c, a - jr .asm_f50 + jr .loop ; f82 diff --git a/home/init.asm b/home/init.asm index 6ada3e267..8325f6294 100644 --- a/home/init.asm +++ b/home/init.asm @@ -136,15 +136,14 @@ Init:: ; 17d ; BG on ld [rLCDC], a - ld a, $ff + ld a, -1 ld [$ffcb], a callba Function9890 - ld a, $9c - ld [$ffd7], a - - xor a + ld a, VBGMap1 / $100 + ld [hBGMapAddress + 1], a + xor a ; VBGMap1 % $100 ld [hBGMapAddress], a callba StartClock diff --git a/home/joypad.asm b/home/joypad.asm index aa7d092af..d5bfc83f3 100644 --- a/home/joypad.asm +++ b/home/joypad.asm @@ -39,7 +39,7 @@ Joypad:: ; 935 ; We can only get four inputs at a time. ; We take d-pad first for no particular reason. - ld a, D_PAD + ld a, R_DPAD ld [rJOYP], a ; Read twice to give the request time to take. rept 2 @@ -57,7 +57,7 @@ endr ; Buttons make 8 total inputs (A, B, Select, Start). ; We can fit this into one byte. - ld a, BUTTONS + ld a, R_BUTTONS ld [rJOYP], a ; Wait for input to stabilize. rept 6 @@ -198,14 +198,14 @@ GetJoypad:: ; 984 .updateauto ; An input of $ff will end the stream. ld a, [hli] - cp a, $ff + cp a, -1 jr z, .stopauto ld b, a ; A duration of $ff will end the stream indefinitely. ld a, [hli] ld [AutoInputLength], a - cp a, $ff + cp a, -1 jr nz, .next ; The current input is overwritten. @@ -273,42 +273,44 @@ StopAutoInput:: ; a0a ; a1b -Functiona1b:: ; a1b +JoyTitleScreenInput:: ; a1b +.loop call DelayFrame push bc - call Functiona57 + call JoyTextDelay pop bc ld a, [hJoyDown] cp D_UP | SELECT | B_BUTTON - jr z, .asm_a34 + jr z, .keycombo - ld a, [$ffa9] + ld a, [hJoyLast] and START | A_BUTTON - jr nz, .asm_a34 + jr nz, .keycombo dec c - jr nz, Functiona1b + jr nz, .loop and a ret -.asm_a34 +.keycombo scf ret ; a36 -Functiona36:: ; a36 +JoyWaitAorB:: ; a36 +.loop call DelayFrame call GetJoypad ld a, [hJoyPressed] and A_BUTTON | B_BUTTON ret nz call RTC - jr Functiona36 + jr .loop ; a46 CloseText:: ; a46 @@ -317,37 +319,37 @@ CloseText:: ; a46 ld a, 1 ld [hOAMUpdate], a call WaitBGMap - call Functiona36 + call JoyWaitAorB pop af ld [hOAMUpdate], a ret ; a57 -Functiona57:: ; a57 +JoyTextDelay:: ; a57 call GetJoypad - ld a, [$ffaa] + ld a, [hInMenu] and a ld a, [hJoyPressed] - jr z, .asm_a63 + jr z, .ok ld a, [hJoyDown] -.asm_a63 +.ok ld [hJoyLast], a ld a, [hJoyPressed] and a - jr z, .asm_a70 + jr z, .checkframedelay ld a, 15 ld [TextDelayFrames], a ret -.asm_a70 +.checkframedelay ld a, [TextDelayFrames] and a - jr z, .asm_a7a + jr z, .restartframedelay xor a ld [hJoyLast], a ret -.asm_a7a +.restartframedelay ld a, 5 ld [TextDelayFrames], a ret @@ -356,90 +358,95 @@ Functiona57:: ; a57 Functiona80:: ; a80 ld a, [hConnectionStripLength] push af - ld a, [$ffb0] + ld a, [hConnectedMapWidth] push af xor a ld [hConnectionStripLength], a - ld a, $6 - ld [$ffb0], a -.asm_a8d + ld a, 6 + ld [hConnectedMapWidth], a + +.loop push hl hlcoord 18, 17 call Functionb06 pop hl - call Functiona57 - ld a, [$ffa9] - and $3 - jr z, .asm_a8d + + call JoyTextDelay + ld a, [hJoyLast] + and A_BUTTON | B_BUTTON + jr z, .loop + pop af - ld [$ffb0], a + ld [hConnectedMapWidth], a pop af ld [hConnectionStripLength], a ret ; aa5 Functionaa5:: ; aa5 - call Functiona57 - ld a, [$ffa9] +.loop + call JoyTextDelay + ld a, [hJoyLast] and A_BUTTON | B_BUTTON - jr z, Functionaa5 + jr z, .loop ret ; aaf KeepTextOpen:: ; aaf - ld a, [InLinkBattle] + ld a, [wLinkMode] and a - jr nz, .asm_ac1 - call Functionac6 + jr nz, .link + call .wait_input push de ld de, SFX_READ_TEXT_2 call PlaySFX pop de ret -.asm_ac1 +.link ld c, 65 jp DelayFrames ; ac6 -Functionac6:: ; ac6 +.wait_input: ; ac6 ld a, [hOAMUpdate] push af ld a, $1 ld [hOAMUpdate], a ld a, [InputType] or a - jr z, .asm_ad9 - callba Function1de28a -.asm_ad9 - call Functionaf5 - call Functiona57 + jr z, .input_wait_loop + callba _DudeAutoInput_A + +.input_wait_loop + call .blink_cursor + call JoyTextDelay ld a, [hJoyPressed] - and $3 - jr nz, .asm_af1 + and A_BUTTON | B_BUTTON + jr nz, .received_input call RTC ld a, $1 ld [hBGMapMode], a call DelayFrame - jr .asm_ad9 + jr .input_wait_loop -.asm_af1 +.received_input pop af ld [hOAMUpdate], a ret ; af5 -Functionaf5:: ; af5 +.blink_cursor: ; af5 ld a, [$ff9b] - and $10 - jr z, .asm_aff - ld a, $ee - jr .asm_b02 + and %00010000 ; bit 4, a + jr z, .cursor_off + ld a, "▼" + jr .load_cursor_state -.asm_aff +.cursor_off ld a, [TileMap + 17 + 17 * SCREEN_WIDTH] -.asm_b02 +.load_cursor_state ld [TileMap + 18 + 17 * SCREEN_WIDTH], a ret ; b06 @@ -448,7 +455,7 @@ Functionb06:: ; b06 push bc ld a, [hl] ld b, a - ld a, $ee + ld a, "▼" cp b pop bc jr nz, .asm_b27 @@ -456,16 +463,16 @@ Functionb06:: ; b06 dec a ld [hConnectionStripLength], a ret nz - ld a, [$ffb0] + ld a, [hConnectedMapWidth] dec a - ld [$ffb0], a + ld [hConnectedMapWidth], a ret nz - ld a, $7a + ld a, "─" ld [hl], a - ld a, $ff + ld a, -1 ld [hConnectionStripLength], a - ld a, $6 - ld [$ffb0], a + ld a, 6 + ld [hConnectedMapWidth], a ret .asm_b27 @@ -477,12 +484,12 @@ Functionb06:: ; b06 ret nz dec a ld [hConnectionStripLength], a - ld a, [$ffb0] + ld a, [hConnectedMapWidth] dec a - ld [$ffb0], a + ld [hConnectedMapWidth], a ret nz ld a, $6 - ld [$ffb0], a + ld [hConnectedMapWidth], a ld a, $ee ld [hl], a ret diff --git a/home/map.asm b/home/map.asm index 1deb6c3d2..7f1c83b63 100644 --- a/home/map.asm +++ b/home/map.asm @@ -214,7 +214,7 @@ Function222a:: ; 222a ret ; 2238 -Function2238:: ; 2238 +CheckWarpTile:: ; 2238 call Function2252 ret nc push bc @@ -258,11 +258,11 @@ Function2266:: ; 2266 ld a, [MapX] sub $4 ld d, a - ld a, [wdbfb] + ld a, [wCurrMapWarpCount] and a ret z ld c, a - ld hl, wdbfc + ld hl, wCurrMapWarpHeaderPointer ld a, [hli] ld h, [hl] ld l, a @@ -294,7 +294,7 @@ Function2266:: ; 2266 pop hl call Function22a3 ret nc - ld a, [wdbfb] + ld a, [wCurrMapWarpCount] inc a sub c ld c, a @@ -325,7 +325,7 @@ Function22a7:: ; 22a7 Function22b4:: ; 22b4 push bc - ld hl, wdbfc + ld hl, wCurrMapWarpHeaderPointer ld a, [hli] ld h, [hl] ld l, a @@ -439,8 +439,8 @@ Function234f:: ; 234f ld a, [hli] ld h, [hl] ld l, a - call Function23ac - call Function23c3 + call ReadMapTriggers + call ReadMapCallbacks ret ; 235c @@ -507,34 +507,36 @@ GetMapConnection:: ; 23a3 ; 23ac -Function23ac:: ; 23ac - ld a, [hli] +ReadMapTriggers:: ; 23ac + ld a, [hli] ; trigger count ld c, a - ld [wdc07], a + ld [wCurrMapTriggerCount], a ; current map trigger count ld a, l - ld [wdc07 + 1], a + ld [wCurrMapTriggerHeaderPointer], a ; map trigger pointer ld a, h ld [wdc09], a ld a, c and a ret z - ld bc, $0004 + + ld bc, 4 ; size of a map trigger header entry call AddNTimes ret ; 23c3 -Function23c3:: ; 23c3 +ReadMapCallbacks:: ; 23c3 ld a, [hli] ld c, a - ld [wdc0a], a + ld [wCurrMapCallbackCount], a ld a, l - ld [wdc0b], a + ld [wCurrMapCallbackHeaderPointer], a ld a, h - ld [wdc0b + 1], a + ld [wCurrMapCallbackHeaderPointer + 1], a ld a, c and a ret z - ld bc, $0003 + + ld bc, 3 call AddNTimes ret ; 23da @@ -542,9 +544,9 @@ Function23c3:: ; 23c3 ReadWarps:: ; 23da ld a, [hli] ld c, a - ld [wdbfb], a + ld [wCurrMapWarpCount], a ld a, l - ld [wdbfc], a + ld [wCurrMapWarpHeaderPointer], a ld a, h ld [wdbfd], a ld a, c @@ -560,7 +562,7 @@ ReadCoordEvents:: ; 23f1 ld c, a ld [wCurrentMapXYTriggerCount], a ld a, l - ld [wdbff], a + ld [wCurrentMapXYTriggerHeaderPointer], a ld a, h ld [wdc00], a ld a, c @@ -1000,11 +1002,11 @@ RunMapCallback:: ; 263b ; 2653 Function2653:: ; 2653 - ld a, [wdc0a] + ld a, [wCurrMapCallbackCount] ld c, a and a ret z - ld hl, wdc0b + ld hl, wCurrMapCallbackHeaderPointer ld a, [hli] ld h, [hl] ld l, a @@ -1896,7 +1898,7 @@ CheckCurrentMapXYTriggers:: ; 2ad4 CheckStandingOnXYTrigger:: ; 2ae7 ; Checks to see if you are standing on an xy-trigger. If yes, copies the trigger to EngineBuffer1 and sets carry. - ld hl, wdbff + ld hl, wCurrentMapXYTriggerHeaderPointer ld a, [hli] ld h, [hl] ld l, a @@ -1958,7 +1960,7 @@ FadeToMenu:: ; 2b29 call Function1d6e callba FadeBlackBGMap call ClearSprites - call Function2ed3 + call DisableSpriteUpdates ret ; 2b3c @@ -1986,7 +1988,7 @@ Function2b5c:: ; 2b5c callba Function49409 call Function3200 callba FadeInBGMap - call Function2ee4 + call EnableSpriteUpdates ret ; 2b74 diff --git a/home/menu.asm b/home/menu.asm index 82bac3b99..c4f0ed0d9 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -1,14 +1,14 @@ ; Functions used in displaying and handling menus. -LoadMenuDataHeader:: ; 0x1d35 +LoadMenuDataHeader:: call CopyMenuDataHeader - call Function1c00 + call BackUpTiles ret -CopyMenuDataHeader:: ; 0x1d3c +CopyMenuDataHeader:: ld de, wcf81 - ld bc, $0010 + ld bc, 16 call CopyBytes ld a, [hROMBank] ld [wcf8a], a @@ -16,7 +16,7 @@ CopyMenuDataHeader:: ; 0x1d3c ; 0x1d4b Function1d4b:: ; 1d4b - ld [wcf88], a + ld [wPocketCursorBuffer], a ret ; 1d4f @@ -71,7 +71,7 @@ Function1d7d:: ; 1d7d ret ; 1d81 -InterpretMenu2:: ; 0x1d81 +InterpretMenu2:: xor a ld [hBGMapMode], a call Function1cbb @@ -81,16 +81,16 @@ InterpretMenu2:: ; 0x1d81 call Function1c66 ld a, [wcf91] bit 7, a - jr z, .asm_1da7 ; 0x1d98 $d + jr z, .cancel call Function1c10 call Function1bc9 call Function1ff8 bit 1, a - jr z, .asm_1da9 ; 0x1da5 $2 -.asm_1da7 + jr z, .okay +.cancel scf ret -.asm_1da9 +.okay and a ret ; 0x1dab @@ -103,7 +103,7 @@ GetMenu2:: ; 1dab ret ; 1db8 -Function1db8:: ; 0x1db8 +Function1db8:: push hl push bc push af @@ -131,9 +131,9 @@ YesNoBox:: ; 1dcf PlaceYesNoBox:: ; 1dd2 jr _YesNoBox -Function1dd4:: ; 1dd4 +PlaceGenericTwoOptionBox:: ; 1dd4 call LoadMenuDataHeader - jr Function1dfe + jr InterpretTwoOptionMenu _YesNoBox:: ; 1dd9 ; Return nc (yes) or c (no). @@ -141,39 +141,41 @@ _YesNoBox:: ; 1dd9 ld hl, YesNoMenuDataHeader call CopyMenuDataHeader pop bc +; This seems to be an overflow prevention, but +; it was coded wrong. ld a, b - cp $e - jr nz, .asm_1de9 - ld a, $e + cp SCREEN_WIDTH - 6 + jr nz, .okay ; should this be "jr nc"? + ld a, SCREEN_WIDTH - 6 ld b, a -.asm_1de9 +.okay ld a, b - ld [wcf83], a + ld [wMenuBorderLeftCoord], a add $5 - ld [wcf85], a + ld [wMenuBorderRightCoord], a ld a, c - ld [wcf82], a + ld [wMenuBorderTopCoord], a add $4 - ld [wcf84], a - call Function1c00 + ld [wMenuBorderBottomCoord], a + call BackUpTiles -Function1dfe:: ; 1dfe +InterpretTwoOptionMenu:: ; 1dfe call InterpretMenu2 push af ld c, $f call DelayFrames call WriteBackup pop af - jr c, .asm_1e16 + jr c, .no ld a, [wcfa9] cp 2 ; no - jr z, .asm_1e16 + jr z, .no and a ret -.asm_1e16 - ld a, $2 +.no + ld a, 2 ld [wcfa9], a scf ret @@ -196,7 +198,7 @@ YesNoMenuData2:: ; 1e25 Function1e2e:: ; 1e2e call Function1e35 - call Function1c00 + call BackUpTiles ret ; 1e35 @@ -204,24 +206,24 @@ Function1e35:: ; 1e35 push de call CopyMenuDataHeader pop de - ld a, [wcf83] + ld a, [wMenuBorderLeftCoord] ld h, a - ld a, [wcf85] + ld a, [wMenuBorderRightCoord] sub h ld h, a ld a, d - ld [wcf83], a + ld [wMenuBorderLeftCoord], a add h - ld [wcf85], a - ld a, [wcf82] + ld [wMenuBorderRightCoord], a + ld a, [wMenuBorderTopCoord] ld l, a - ld a, [wcf84] + ld a, [wMenuBorderBottomCoord] sub l ld l, a ld a, e - ld [wcf82], a + ld [wMenuBorderTopCoord], a add l - ld [wcf84], a + ld [wMenuBorderBottomCoord], a ret ; 1e5d @@ -243,14 +245,14 @@ SetUpMenu:: ; 1e70 set 7, [hl] ret -MenuFunc_1e7f:: ; 0x1e7f +MenuFunc_1e7f:: call Function1c66 call Function1ebd call Function1ea6 call Function1cbb ret -MenuWriteText:: ; 0x1e8c +MenuWriteText:: xor a ld [hBGMapMode], a call Function1ebd ; sort out the text @@ -267,18 +269,18 @@ MenuWriteText:: ; 0x1e8c ; 0x1ea6 Function1ea6:: ; 1ea6 - ld a, [wcf83] + ld a, [wMenuBorderLeftCoord] ld c, a - ld a, [wcf85] + ld a, [wMenuBorderRightCoord] sub c ld c, a ld a, [wcf92] add a inc a ld b, a - ld a, [wcf82] + ld a, [wMenuBorderTopCoord] add b - ld [wcf84], a + ld [wMenuBorderBottomCoord], a ret ; 1ebd @@ -308,7 +310,7 @@ Function1ebd:: ; 1ebd ; 1eda Function1eda:: ; 1eda - call Function1cfd + call GetMemTileCoord ld bc, $002a add hl, bc .asm_1ee1 @@ -408,7 +410,7 @@ Function1f2a:: ; 1f2a ld a, [hl] ld [MenuSelection], a ld a, [wcfa9] - ld [wcf88], a + ld [wPocketCursorBuffer], a and a ret @@ -484,21 +486,23 @@ endr ret ; 1fbf -Function1fbf:: ; 1fbf +ResetTextRelatedRAM:: ; 1fbf ld hl, wcf71 - call Function1ff0 + call .bytefill ld hl, wcf81 - call Function1ff0 + call .bytefill ld hl, wcf91 - call Function1ff0 + call .bytefill ld hl, wcfa1 - call Function1ff0 + call .bytefill + ld a, [rSVBK] push af ld a, $7 ld [rSVBK], a + xor a - ld hl, $dfff + ld hl, w7_dfff rept 2 ld [hld], a endr @@ -506,12 +510,13 @@ endr ld [wcf71], a ld a, h ld [wcf72], a + pop af ld [rSVBK], a ret ; 1ff0 -Function1ff0:: ; 1ff0 +.bytefill: ; 1ff0 ld bc, $0010 xor a call ByteFill @@ -521,13 +526,13 @@ Function1ff0:: ; 1ff0 Function1ff8:: ; 1ff8 push af and $3 - jr z, .asm_2007 + jr z, .nosound ld hl, wcf81 bit 3, [hl] - jr nz, .asm_2007 + jr nz, .nosound call PlayClickSFX -.asm_2007 +.nosound pop af ret ; 2009 @@ -566,7 +571,7 @@ InterpretMenu:: ; 202a ld a, [hROMBank] ld [wcf94], a callba Function2400e - ld a, [wcf88] + ld a, [wPocketCursorBuffer] ret ; 2039 @@ -574,7 +579,7 @@ Function2039:: ; 2039 ld a, [hROMBank] ld [wcf94], a callba Function24022 - ld a, [wcf88] + ld a, [wPocketCursorBuffer] ret ; 2048 @@ -582,7 +587,7 @@ Function2048:: ; 2048 ld a, [hROMBank] ld [wcf94], a callba Function2403c - ld a, [wcf88] + ld a, [wPocketCursorBuffer] ret ; 2057 diff --git a/home/mobile.asm b/home/mobile.asm index c6c225dc8..dbf982d72 100644 --- a/home/mobile.asm +++ b/home/mobile.asm @@ -74,9 +74,9 @@ Timer:: ; 3e93 push de push hl - ld a, [$ffe9] + ld a, [hMobile] and a - jr z, .asm_3ed2 + jr z, .pop_ret xor a ld [rTAC], a @@ -88,15 +88,15 @@ Timer:: ; 3e93 ld a, [$c86a] or a - jr z, .asm_3ed2 + jr z, .pop_ret ld a, [$c822] bit 1, a - jr nz, .asm_3eca + jr nz, .skip_Function1118de ld a, [rSC] and 1 << rSC_ON - jr nz, .asm_3eca + jr nz, .skip_Function1118de ld a, [hROMBank] push af @@ -111,14 +111,14 @@ Timer:: ; 3e93 ld [$c981], a rst Bankswitch -.asm_3eca +.skip_Function1118de ld a, [rTMA] ld [rTIMA], a ld a, 1 << rTAC_ON | rTAC_65536_HZ ld [rTAC], a -.asm_3ed2 +.pop_ret pop hl pop de pop bc diff --git a/home/movement.asm b/home/movement.asm index 87f28f5ca..82486b5c1 100644 --- a/home/movement.asm +++ b/home/movement.asm @@ -159,11 +159,11 @@ Function1bd3:: ; 1bd3 Function1bdd:: ; 1bdd push bc push af - ld a, [$ffa9] - and $f0 + ld a, [hJoyLast] + and D_PAD ld b, a ld a, [hJoyPressed] - and $f + and BUTTONS or b ld b, a pop af @@ -190,33 +190,3 @@ Function1bf7:: ; 1bf7 ret ; 1c00 -Function1c00:: ; 1c00 - callab Function24374 - ret -; 1c07 - -ExitMenu:: ; 0x1c07 - push af - callab Function243e8 - pop af - ret - -Function1c10:: ; 0x1c10 - callab Function2446d - ret - -WriteBackup:: ; 0x1c17 - push af - call ExitMenu - call Function321c - call UpdateSprites - pop af - ret - -Function1c23:: ; 0x1c23 - call Function1cfd - call Function1c30 - call Function1d19 - call Function1c30 - ret -; 0x1c30 diff --git a/home/palettes.asm b/home/palettes.asm index 32ef29057..93498aedd 100644 --- a/home/palettes.asm +++ b/home/palettes.asm @@ -79,6 +79,7 @@ DmgToCgbBGPals:: ; c9f ld [rBGP], a push af +; Don't need to be here if CGB ld a, [hCGB] and a jr z, .end @@ -89,7 +90,7 @@ DmgToCgbBGPals:: ; c9f ld a, [rSVBK] push af - ld a, 5 + ld a, 5 ; gfx ld [rSVBK], a ; copy & reorder bg pal buffer @@ -165,16 +166,21 @@ DmgToCgbObjPals:: ; ccb Functioncf8:: ; cf8 ld [rOBP0], a push af + +; Don't need to be here if CGB ld a, [hCGB] and a - jr z, .asm_d22 + jr z, .done + push hl push de push bc + ld a, [rSVBK] push af - ld a, $5 + ld a, 5 ; gfx ld [rSVBK], a + ld hl, OBPals ld de, Unkn2Pals ld a, [rOBP0] @@ -183,13 +189,15 @@ Functioncf8:: ; cf8 call CopyPals ld a, $1 ld [hCGBPalUpdate], a + pop af ld [rSVBK], a + pop bc pop de pop hl -.asm_d22 +.done pop af ret ; d24 diff --git a/home/serial.asm b/home/serial.asm index 302630cc7..d5df52a23 100644 --- a/home/serial.asm +++ b/home/serial.asm @@ -15,7 +15,7 @@ Serial:: ; 6ef jr nz, .asm_721 ld a, [$ffcb] - inc a + inc a ; is it equal to -1? jr z, .asm_726 ld a, [rSB] @@ -334,7 +334,7 @@ Function87d:: ; 87d Function8c1:: ; 8c1 push bc ld b, $60 - ld a, [InLinkBattle] + ld a, [wLinkMode] cp $1 jr z, .asm_8d7 ld b, $60 @@ -391,7 +391,7 @@ Function908:: ; 908 ; 919 Function919:: ; 919 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ret nz ld a, $2 diff --git a/home/text.asm b/home/text.asm index 79f85d38b..1445aa5ef 100644 --- a/home/text.asm +++ b/home/text.asm @@ -17,19 +17,19 @@ ClearBox:: ; fb6 ld a, " " FillBoxWithByte:: -.col +.row push bc push hl -.row +.col ld [hli], a dec c - jr nz, .row + jr nz, .col pop hl ld bc, SCREEN_WIDTH add hl, bc pop bc dec b - jr nz, .col + jr nz, .row ret ; fc8 @@ -61,8 +61,11 @@ ClearScreen:: ; fdb TextBox:: ; fe8 -; Draw a text box width c height b at hl. -; Dimensions do not include the border. +; Draw a text box at hl with room for +; b lines of c characters each. +; Places a border around the textbox, +; then switches the palette to the +; text black-and-white scheme. push bc push hl call TextBoxBorder @@ -263,14 +266,14 @@ endm dict "", RocketChar dict "", TMChar dict "", TrainerChar - dict $23, Char23 - dict $22, Char22 + dict $23, PlaceKougeki + dict "", Char22 dict "", ContText dict "<......>", SixDotsChar dict "", DoneText dict "", PromptText dict "", PlacePKMN - dict $24, PlacePOKE + dict "", PlacePOKE dict $25, NextChar dict2 $1f, " " dict "", PlaceDexEnd @@ -349,7 +352,7 @@ TMChar: print_name TMCharText ; 11b0 PCChar: print_name PCCharText ; 11b7 RocketChar: print_name RocketCharText ; 11be PlacePOKe: print_name PlacePOKeText ; 11c5 -Char23: print_name Char23Text ; 11cc +PlaceKougeki: print_name KougekiText ; 11cc SixDotsChar: print_name SixDotsCharText ; 11d3 PlacePKMN: print_name PlacePKMNText ; 11da PlacePOKE: print_name PlacePOKEText ; 11e1 @@ -386,7 +389,7 @@ PlaceMoveTargetsName_5A: ; 1205 PlaceEnemysName:: ; 121b push de - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .linkbattle @@ -425,9 +428,9 @@ PlaceGenderedPlayerName:: ; 1252 ld l, c ld a, [PlayerGender] bit 0, a - ld de, String12a5 + ld de, String_kun jr z, PlaceCommandCharacter - ld de, String12a6 + ld de, String_chan jr PlaceCommandCharacter @@ -444,7 +447,7 @@ TrainerCharText:: db "TRAINER@" ; 1276 PCCharText:: db "PC@" ; 127e RocketCharText:: db "ROCKET@" ; 1281 PlacePOKeText:: db "POKé@" ; 1288 -Char23Text:: db "こうげき@" ; 128d +KougekiText:: db "こうげき@" ; 128d SixDotsCharText:: db "……@" ; 1292 EnemyText:: db "Enemy @" ; 1295 PlacePKMNText:: db "@" ; PK MN ; 129c @@ -453,8 +456,8 @@ String12a2:: db " @" ; 12a2 Char35Text:: Char36Text:: Char37Text:: db "@" ; 12a4 -String12a5:: db "@" ; 12a5 -String12a6:: db "@" ; 12a6 +String_kun:: db "@" ; 12a5 +String_chan:: db "@" ; 12a6 ; 12a7 NextLineChar:: ; 12a7 @@ -480,31 +483,31 @@ TextFar:: ; 12b9 add hl, bc ld de, -SCREEN_WIDTH ld c, 1 -.asm_12c4 +.loop ld a, h and a - jr nz, .asm_12cd + jr nz, .next ld a, l cp SCREEN_WIDTH - jr c, .asm_12d1 + jr c, .done -.asm_12cd +.next add hl, de inc c - jr .asm_12c4 + jr .loop -.asm_12d1 +.done hlcoord 0, 0 ld de, SCREEN_WIDTH ld a, c -.asm_12d8 +.loop2 and a - jr z, .asm_12df + jr z, .done2 add hl, de dec a - jr .asm_12d8 + jr .loop2 -.asm_12df +.done2 pop de inc de ld a, [de] @@ -526,20 +529,20 @@ LineChar:: ; 12ea Paragraph:: ; 12f2 push de - ld a, [InLinkBattle] - cp $3 - jr z, .asm_1301 - cp $4 - jr z, .asm_1301 - call Function13c7 -.asm_1301 + ld a, [wLinkMode] + cp LINK_COLOSSEUM + jr z, .linkbattle + cp LINK_MOBILE + jr z, .linkbattle + call LoadBlinkingCursor +.linkbattle call Function13b6 call KeepTextOpen hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY lb bc, TEXTBOX_INNERH - 1, TEXTBOX_INNERW call ClearBox - call Function13cd + call UnloadBlinkingCursor ld c, 20 call DelayFrames hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY @@ -549,26 +552,26 @@ Paragraph:: ; 12f2 Char4B:: ; 131f - ld a, [InLinkBattle] + ld a, [wLinkMode] or a - jr nz, .asm_1328 - call Function13c7 -.asm_1328 + jr nz, .communication + call LoadBlinkingCursor +.communication call Function13b6 push de call KeepTextOpen pop de - ld a, [InLinkBattle] + ld a, [wLinkMode] or a - call z, Function13cd + call z, UnloadBlinkingCursor Char4C:: ; 1337 push de - call Function138c - call Function138c + call TextScroll + call TextScroll hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY + 2 pop de jp NextChar @@ -599,22 +602,22 @@ PlaceDexEnd:: ; 1356 ; 135a PromptText:: ; 135a - ld a, [InLinkBattle] - cp $3 + ld a, [wLinkMode] + cp LINK_COLOSSEUM jr z, .ok - cp $4 + cp LINK_MOBILE jr z, .ok - call Function13c7 -.ok + call LoadBlinkingCursor +.ok call Function13b6 call KeepTextOpen - ld a, [InLinkBattle] - cp $3 + ld a, [wLinkMode] + cp LINK_COLOSSEUM jr z, DoneText - cp $4 + cp LINK_MOBILE jr z, DoneText - call Function13cd + call UnloadBlinkingCursor DoneText:: ; 137c pop hl @@ -631,19 +634,22 @@ NullChar:: ; 1383 jp NextChar ; 138c -Function138c:: ; 138c +TextScroll:: ; 138c hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY decoord TEXTBOX_INNERX, TEXTBOX_INNERY - 1 ld a, TEXTBOX_INNERH - 1 + .col push af ld c, TEXTBOX_INNERW + .row ld a, [hli] ld [de], a inc de dec c jr nz, .row + rept 2 inc de endr @@ -653,6 +659,7 @@ endr pop af dec a jr nz, .col + hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY + 2 ld a, " " ld bc, TEXTBOX_INNERW @@ -668,7 +675,9 @@ Function13b6:: ; 13b6 push af ld a, 1 ld [hOAMUpdate], a + call WaitBGMap + pop af ld [hOAMUpdate], a pop bc @@ -679,15 +688,15 @@ Diacritic:: ; 13c6 ret ; 13c7 -Function13c7:: ; 13c7 +LoadBlinkingCursor:: ; 13c7 ld a, "▼" - ld [TileMap + 18 + 17 * SCREEN_WIDTH], a + ldcoord_a 18, 17 ret ; 13cd -Function13cd:: ; 13cd - ld a, [TileMap + 17 + 17 * SCREEN_WIDTH] - ld [TileMap + 18 + 17 * SCREEN_WIDTH], a +UnloadBlinkingCursor:: ; 13cd + lda_coord 17, 17 + ldcoord_a 18, 17 ret ; 13d4 @@ -719,19 +728,19 @@ PlaceWholeStringInBoxAtOnce:: ; 13e5 set 1, a ld [TextBoxFrame + 1], a - call Function13f6 + call DoTextUntilTerminator pop af ld [TextBoxFrame + 1], a ret ; 13f6 -Function13f6:: ; 13f6 +DoTextUntilTerminator:: ; 13f6 ld a, [hli] cp "@" ret z call .TextCommand - jr Function13f6 + jr DoTextUntilTerminator .TextCommand: push hl @@ -754,19 +763,19 @@ endr ; 1410 TextCommands:: ; 1410 - dw Text_00 - dw Text_01 - dw Text_02 - dw Text_03 - dw Text_04 - dw Text_05 - dw Text_06 - dw Text_07 - dw Text_08 - dw Text_09 - dw Text_0A + dw Text_TX + dw Text_TX_RAM + dw Text_TX_BCD + dw Text_TX_MOVE + dw Text_TX_BOX + dw Text_TX_LOW + dw Text_WAIT_BUTTON + dw Text_TX_SCROLL + dw Text_START_ASM + dw Text_TX_NUM + dw Text_TX_EXIT dw Text_PlaySound ; $0b - dw Text_0C + dw Text_TX_DOTS dw Text_0D dw Text_PlaySound ; $0e dw Text_PlaySound ; $0f @@ -774,12 +783,12 @@ TextCommands:: ; 1410 dw Text_PlaySound ; $11 dw Text_PlaySound ; $12 dw Text_PlaySound ; $13 - dw Text_14 - dw Text_15 - dw Text_16 + dw Text_TX_STRINGBUFFER + dw Text_TX_DAY + dw Text_TX_FAR ; 143e -Text_00:: ; 143e +Text_TX:: ; 143e ; TX ; write text until "@" ; [$00]["...@"] @@ -795,7 +804,7 @@ Text_00:: ; 143e ret ; 1449 -Text_01:: ; 1449 +Text_TX_RAM:: ; 1449 ; text_from_ram ; write text from a ram address ; little endian @@ -813,7 +822,7 @@ Text_01:: ; 1449 ret ; 1455 -Text_16:: ; 1455 +Text_TX_FAR:: ; 1455 ; text_jump ; write text from a different bank ; little endian @@ -834,7 +843,7 @@ Text_16:: ; 1455 push hl ld h, d ld l, e - call Function13f6 + call DoTextUntilTerminator pop hl pop af @@ -843,7 +852,7 @@ Text_16:: ; 1455 ret ; 1470 -Text_02:: ; 1470 +Text_TX_BCD:: ; 1470 ; TX_BCD ; write bcd from address, typically ram ; [$02][addr][flags] @@ -865,7 +874,7 @@ Text_02:: ; 1470 ret ; 1480 -Text_03:: ; 1480 +Text_TX_MOVE:: ; 1480 ; TX_MOVE ; move to a new tile ; [$03][addr] @@ -879,7 +888,7 @@ Text_03:: ; 1480 ret ; 148b -Text_04:: ; 148b +Text_TX_BOX:: ; 148b ; TX_BOX ; draw a box ; little endian @@ -901,7 +910,7 @@ Text_04:: ; 148b ret ; 149b -Text_05:: ; 149b +Text_TX_LOW:: ; 149b ; TX_LOW ; write text at (1,16) ; [$05] @@ -910,39 +919,41 @@ Text_05:: ; 149b ret ; 149f -Text_06:: ; 149f +Text_WAIT_BUTTON:: ; 149f ; TX_WAITBUTTON ; wait for button press ; show arrow ; [06] - ld a, [InLinkBattle] - cp $3 + ld a, [wLinkMode] + cp LINK_COLOSSEUM jp z, Text_0D - cp $4 + cp LINK_MOBILE jp z, Text_0D push hl - call Function13c7 + call LoadBlinkingCursor push bc call KeepTextOpen pop bc - call Function13cd + call UnloadBlinkingCursor pop hl ret ; 14ba -Text_07:: ; 14ba +Text_TX_SCROLL:: ; 14ba +; pushes text up two lines and sets the BC cursor to the border tile +; below the first character column of the text box. push hl - call Function13cd - call Function138c - call Function138c + call UnloadBlinkingCursor + call TextScroll + call TextScroll pop hl bccoord TEXTBOX_INNERX, TEXTBOX_INNERY + 2 ret ; 14c9 -Text_08:: ; 14c9 +Text_START_ASM:: ; 14c9 ; TX_ASM bit 7, h @@ -955,7 +966,7 @@ Text_08:: ; 14c9 ret ; 14d2 -Text_09:: ; 14d2 +Text_TX_NUM:: ; 14d2 ; TX_NUM ; [$09][addr][hi:bytes lo:digits] ld a, [hli] @@ -981,7 +992,7 @@ Text_09:: ; 14d2 ret ; 14ed -Text_0A:: ; 14ed +Text_TX_EXIT:: ; 14ed push hl push bc call GetJoypad @@ -1056,13 +1067,14 @@ TextSFX:: ; 152d db -1 ; 1543 -Text_0C:: ; 1543 +Text_TX_DOTS:: ; 1543 ; [$0C][num] ld a, [hli] ld d, a push hl ld h, b ld l, c + .loop push de ld a, "…" @@ -1077,6 +1089,7 @@ Text_0C:: ; 1543 pop de dec d jr nz, .loop + ld b, h ld c, l pop hl @@ -1094,7 +1107,7 @@ Text_0D:: ; 1562 ret ; 156a -Text_14:: ; 156a +Text_TX_STRINGBUFFER:: ; 156a ; Print a string from one of the following: ; 0: StringBuffer3 ; 1: StringBuffer4 @@ -1124,7 +1137,7 @@ endr ret ; 1582 -Text_15:: ; 1582 +Text_TX_DAY:: ; 1582 ; TX_DAY call GetWeekday diff --git a/home/tilemap.asm b/home/tilemap.asm index d0875c37b..d6a8f31b1 100644 --- a/home/tilemap.asm +++ b/home/tilemap.asm @@ -1,44 +1,79 @@ -Function1c30:: ; 0x1c30 - call Function1c53 +BackUpTiles:: ; 1c00 + callab _BackUpTiles + ret +; 1c07 + +ExitMenu:: ; 0x1c07 + push af + callab Function243e8 + pop af + ret + +Function1c10:: ; 0x1c10 + callab Function2446d + ret + +WriteBackup:: ; 0x1c17 + push af + call ExitMenu + call Function321c + call UpdateSprites + pop af + ret + +RestoreTileBackup:: ; 0x1c23 + call GetMemTileCoord + call .copy + call GetMemAttrCoord + call .copy + ret +; 0x1c30 + +.copy: ; 0x1c30 + call GetMenuBoxDims inc b inc c -.asm_1c35 + +.row push bc push hl -.asm_1c37 + +.col ld a, [de] ld [hli], a dec de dec c - jr nz, .asm_1c37 ; 0x1c3b $fa + jr nz, .col ; 0x1c3b $fa + pop hl - ld bc, $0014 + ld bc, SCREEN_WIDTH add hl, bc pop bc dec b - jr nz, .asm_1c35 ; 0x1c44 $ef + jr nz, .row ; 0x1c44 $ef + ret Function1c47:: ; 0x1c47 ld b, $10 ld de, wcf81 -.asm_1c4c +.loop ld a, [hld] ld [de], a inc de dec b - jr nz, .asm_1c4c ; 0x1c50 $fa + jr nz, .loop ; 0x1c50 $fa ret -Function1c53:: ; 0x1c53 - ld a, [wcf82] +GetMenuBoxDims:: ; 0x1c53 + ld a, [wMenuBorderTopCoord] ; top ld b, a - ld a, [wcf84] + ld a, [wMenuBorderBottomCoord] ; bottom sub b ld b, a - ld a, [wcf83] + ld a, [wMenuBorderLeftCoord] ; left ld c, a - ld a, [wcf85] + ld a, [wMenuBorderRightCoord] ; right sub c ld c, a ret @@ -99,7 +134,7 @@ Function1c89:: ; 1c89 ld a, [wcf91] bit 4, a ret z - call Function1cfd + call GetMemTileCoord ld a, [de] ld c, a inc de @@ -109,18 +144,18 @@ Function1c89:: ; 1c89 ; 1cbb Function1cbb:: ; 1cbb - call Function1cfd - call Function1c53 + call GetMemTileCoord + call GetMenuBoxDims dec b dec c jp TextBox ; 1cc6 Function1cc6:: ; 1cc6 - ld a, [wcf82] + ld a, [wMenuBorderTopCoord] ld b, a inc b - ld a, [wcf83] + ld a, [wMenuBorderLeftCoord] ld c, a inc c ld a, [wcf91] @@ -139,10 +174,10 @@ Function1cc6:: ; 1cc6 ; 1ce1 Function1ce1:: ; 1ce1 - call Function1cfd + call GetMemTileCoord ld bc, $0015 add hl, bc - call Function1c53 + call GetMenuBoxDims dec b dec c call ClearBox @@ -150,8 +185,8 @@ Function1ce1:: ; 1ce1 ; 1cf1 Function1cf1:: ; 1cf1 - call Function1cfd - call Function1c53 + call GetMemTileCoord + call GetMenuBoxDims inc c inc b call ClearBox @@ -159,10 +194,10 @@ Function1cf1:: ; 1cf1 ; 1cfd -Function1cfd:: ; 1cfd - ld a, [wcf83] +GetMemTileCoord:: ; 1cfd + ld a, [wMenuBorderLeftCoord] ld c, a - ld a, [wcf82] + ld a, [wMenuBorderTopCoord] ld b, a ; 1d05 @@ -191,10 +226,10 @@ endr ret ; 1d19 -Function1d19:: ; 1d19 - ld a, [wcf83] +GetMemAttrCoord:: ; 1d19 + ld a, [wMenuBorderLeftCoord] ld c, a - ld a, [wcf82] + ld a, [wMenuBorderTopCoord] ld b, a GetAttrCoord:: ; 1d21 diff --git a/home/time.asm b/home/time.asm index 609e466fc..173ea573c 100644 --- a/home/time.asm +++ b/home/time.asm @@ -3,7 +3,7 @@ AskTimer:: ; 591 push af - ld a, [$ffe9] + ld a, [hMobile] and a jr z, .asm_59a call Timer diff --git a/home/vblank.asm b/home/vblank.asm index b8b8b0efb..870ef4808 100644 --- a/home/vblank.asm +++ b/home/vblank.asm @@ -146,7 +146,7 @@ VBlank0:: ; 2b1 rst Bankswitch ld a, [hSeconds] - ld [$ffe3], a + ld [hSecondsBackup], a ret ; 325 diff --git a/home/window.asm b/home/window.asm index 0d30cfbdd..1198cfbe1 100644 --- a/home/window.asm +++ b/home/window.asm @@ -1,6 +1,6 @@ ResetWindow:: ; 2dba - call Function1fbf + call ResetTextRelatedRAM ld a, [hROMBank] push af ld a, BANK(Function6454) ; and BANK(Function64bf) @@ -16,12 +16,14 @@ ResetWindow:: ; 2dba ; 2dcf -Function2dcf:: ; 2dcf +LoadMoveSprites:: ; 2dcf ld a, [hOAMUpdate] push af ld a, $1 ld [hOAMUpdate], a + call Function2de2 + pop af ld [hOAMUpdate], a ld hl, VramState @@ -30,7 +32,7 @@ Function2dcf:: ; 2dcf ; 2de2 Function2de2:: ; 2de2 - call Function1fbf + call ResetTextRelatedRAM xor a ld [hBGMapMode], a call Function2173 @@ -46,8 +48,8 @@ Function2de2:: ; 2de2 ret ; 2e08 -Function2e08:: ; 2e08 - call Function1fbf +LoadFont:: ; 2e08 + call ResetTextRelatedRAM ld a, [hROMBank] push af ld a, BANK(Function6454) ; and BANK(Function64bf) @@ -68,7 +70,9 @@ Function2e20:: ; 2e20 push af ld a, $1 ld [hOAMUpdate], a + callba Function104110 + pop af ld [hOAMUpdate], a ret diff --git a/hram.asm b/hram.asm index 10a96f4b8..52ff0bf46 100644 --- a/hram.asm +++ b/hram.asm @@ -15,9 +15,12 @@ hMinutes EQU $ff96 hSeconds EQU $ff98 +hVBlankCounter EQU $ff9b + hROMBank EQU $ff9d hVBlank EQU $ff9e hMapEntryMethod EQU $ff9f +hMenuReturn EQU $ffa0 hJoypadReleased EQU $ffa2 hJoypadPressed EQU $ffa3 @@ -27,6 +30,7 @@ hJoyReleased EQU $ffa6 hJoyPressed EQU $ffa7 hJoyDown EQU $ffa8 hJoyLast EQU $ffa9 +hInMenu EQU $ffaa hConnectionStripLength EQU $ffaf hConnectedMapWidth EQU $ffb0 @@ -44,6 +48,8 @@ hMultiplicand EQU $ffb4 ; 3 bytes long hMultiplier EQU $ffb7 ; 1 byte long hProduct EQU $ffb3 ; result (4 bytes long) +hMathBuffer EQU $ffb8 + hPrintNum1 EQU $ffb3 hPrintNum2 EQU $ffb4 hPrintNum3 EQU $ffb5 @@ -51,7 +57,6 @@ hPrintNum4 EQU $ffb6 hPrintNum5 EQU $ffb7 hPrintNum6 EQU $ffb8 hPrintNum7 EQU $ffb9 -hMathBuffer EQU $ffb8 hMoneyTemp EQU $ffc3 @@ -81,9 +86,10 @@ hLastTalked EQU $ffe0 hRandom EQU $ffe1 hRandomAdd EQU $ffe1 hRandomSub EQU $ffe2 - +hSecondsBackup EQU $ffe3 hBattleTurn EQU $ffe4 hCGBPalUpdate EQU $ffe5 hCGB EQU $ffe6 hSGB EQU $ffe7 hDMATransfer EQU $ffe8 +hMobile EQU $ffe9 diff --git a/items/item_attributes.asm b/items/item_attributes.asm index c66432b0d..a4db95f63 100644 --- a/items/item_attributes.asm +++ b/items/item_attributes.asm @@ -1,777 +1,778 @@ -item_attribute: macro - ; price, effect, param, permissions, pocket, battle permissions +item_attribute: MACRO +; price, held effect, parameter, property, pocket, field menu, battle menu dw \1 - db \2, \3, \4, \5, \6 - endm + db \2, \3, \4, \5 + dn \6, \7 +ENDM Item1Attributes: ; MASTER BALL - item_attribute 0, NONE, 0, CANT_SELECT, BALL, $06 + item_attribute 0, NONE, 0, CANT_SELECT, BALL, ITEMMENU_NOUSE, ITEMMENU_CLOSE Item2Attributes: ; ULTRA BALL - item_attribute 1200, NONE, 0, CANT_SELECT, BALL, $06 + item_attribute 1200, NONE, 0, CANT_SELECT, BALL, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; BRIGHTPOWDER - item_attribute 10, HELD_BRIGHTPOWDER, 20, CANT_SELECT, ITEM, $00 + item_attribute 10, HELD_BRIGHTPOWDER, 20, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; GREAT BALL - item_attribute 600, NONE, 0, CANT_SELECT, BALL, $06 + item_attribute 600, NONE, 0, CANT_SELECT, BALL, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; # BALL - item_attribute 200, NONE, 0, CANT_SELECT, BALL, $06 + item_attribute 200, NONE, 0, CANT_SELECT, BALL, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BICYCLE - item_attribute 0, NONE, 0, CANT_TOSS, KEY_ITEM, $60 + item_attribute 0, NONE, 0, CANT_TOSS, KEY_ITEM, ITEMMENU_CLOSE, ITEMMENU_NOUSE ; MOON STONE - item_attribute 0, NONE, 0, CANT_SELECT, ITEM, $50 + item_attribute 0, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; ANTIDOTE - item_attribute 100, NONE, 0, CANT_SELECT, ITEM, $55 + item_attribute 100, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; BURN HEAL - item_attribute 250, NONE, 0, CANT_SELECT, ITEM, $55 + item_attribute 250, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; ICE HEAL - item_attribute 250, NONE, 0, CANT_SELECT, ITEM, $55 + item_attribute 250, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; AWAKENING - item_attribute 250, NONE, 0, CANT_SELECT, ITEM, $55 + item_attribute 250, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; PARLYZ HEAL - item_attribute 200, NONE, 0, CANT_SELECT, ITEM, $55 + item_attribute 200, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; FULL RESTORE - item_attribute 3000, NONE, -1, CANT_SELECT, ITEM, $55 + item_attribute 3000, NONE, -1, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; MAX POTION - item_attribute 2500, NONE, -1, CANT_SELECT, ITEM, $55 + item_attribute 2500, NONE, -1, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; HYPER POTION - item_attribute 1200, NONE, 200, CANT_SELECT, ITEM, $55 + item_attribute 1200, NONE, 200, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; SUPER POTION - item_attribute 700, NONE, 50, CANT_SELECT, ITEM, $55 + item_attribute 700, NONE, 50, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; POTION - item_attribute 300, NONE, 20, CANT_SELECT, ITEM, $55 + item_attribute 300, NONE, 20, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; ESCAPE ROPE - item_attribute 550, NONE, 0, CANT_SELECT, ITEM, $60 + item_attribute 550, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_CLOSE, ITEMMENU_NOUSE ; REPEL - item_attribute 350, NONE, 0, CANT_SELECT, ITEM, $40 + item_attribute 350, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_CURRENT, ITEMMENU_NOUSE ; MAX ELIXER - item_attribute 4500, NONE, -1, CANT_SELECT, ITEM, $55 + item_attribute 4500, NONE, -1, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; FIRE STONE - item_attribute 2100, NONE, 0, CANT_SELECT, ITEM, $50 + item_attribute 2100, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; THUNDERSTONE - item_attribute 2100, NONE, 0, CANT_SELECT, ITEM, $50 + item_attribute 2100, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; WATER STONE - item_attribute 2100, NONE, 0, CANT_SELECT, ITEM, $50 + item_attribute 2100, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; HP UP - item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, $50 + item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; PROTEIN - item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, $50 + item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; IRON - item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, $50 + item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; CARBOS - item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, $50 + item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; LUCKY PUNCH - item_attribute 10, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 10, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; CALCIUM - item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, $50 + item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; RARE CANDY - item_attribute 4800, NONE, 0, CANT_SELECT, ITEM, $50 + item_attribute 4800, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; X ACCURACY - item_attribute 950, NONE, 0, CANT_SELECT, ITEM, $06 + item_attribute 950, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; LEAF STONE - item_attribute 2100, NONE, 0, CANT_SELECT, ITEM, $50 + item_attribute 2100, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; METAL POWDER - item_attribute 10, HELD_METAL_POWDER, 10, CANT_SELECT, ITEM, $00 + item_attribute 10, HELD_METAL_POWDER, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; NUGGET - item_attribute 10000, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 10000, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; # DOLL - item_attribute 1000, NONE, 0, CANT_SELECT, ITEM, $06 + item_attribute 1000, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; FULL HEAL - item_attribute 600, NONE, 0, CANT_SELECT, ITEM, $55 + item_attribute 600, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; REVIVE - item_attribute 1500, NONE, 0, CANT_SELECT, ITEM, $55 + item_attribute 1500, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; MAX REVIVE - item_attribute 4000, NONE, 0, CANT_SELECT, ITEM, $55 + item_attribute 4000, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; GUARD SPEC. - item_attribute 700, NONE, 0, CANT_SELECT, ITEM, $06 + item_attribute 700, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; SUPER REPEL - item_attribute 500, NONE, 0, CANT_SELECT, ITEM, $40 + item_attribute 500, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_CURRENT, ITEMMENU_NOUSE ; MAX REPEL - item_attribute 700, NONE, 0, CANT_SELECT, ITEM, $40 + item_attribute 700, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_CURRENT, ITEMMENU_NOUSE ; DIRE HIT - item_attribute 650, NONE, 0, CANT_SELECT, ITEM, $06 + item_attribute 650, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; FRESH WATER - item_attribute 200, NONE, 50, CANT_SELECT, ITEM, $55 + item_attribute 200, NONE, 50, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; SODA POP - item_attribute 300, NONE, 60, CANT_SELECT, ITEM, $55 + item_attribute 300, NONE, 60, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; LEMONADE - item_attribute 350, NONE, 80, CANT_SELECT, ITEM, $55 + item_attribute 350, NONE, 80, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; X ATTACK - item_attribute 500, NONE, 0, CANT_SELECT, ITEM, $06 + item_attribute 500, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; X DEFEND - item_attribute 550, NONE, 0, CANT_SELECT, ITEM, $06 + item_attribute 550, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; X SPEED - item_attribute 350, NONE, 0, CANT_SELECT, ITEM, $06 + item_attribute 350, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; X SPECIAL - item_attribute 350, NONE, 0, CANT_SELECT, ITEM, $06 + item_attribute 350, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; COIN CASE - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $40 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_CURRENT, ITEMMENU_NOUSE ; ITEMFINDER - item_attribute 0, NONE, 0, CANT_TOSS, KEY_ITEM, $60 + item_attribute 0, NONE, 0, CANT_TOSS, KEY_ITEM, ITEMMENU_CLOSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; EXP.SHARE - item_attribute 3000, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 3000, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; OLD ROD - item_attribute 0, NONE, 0, CANT_TOSS, KEY_ITEM, $60 + item_attribute 0, NONE, 0, CANT_TOSS, KEY_ITEM, ITEMMENU_CLOSE, ITEMMENU_NOUSE ; GOOD ROD - item_attribute 0, NONE, 0, CANT_TOSS, KEY_ITEM, $60 + item_attribute 0, NONE, 0, CANT_TOSS, KEY_ITEM, ITEMMENU_CLOSE, ITEMMENU_NOUSE ; SILVER LEAF - item_attribute 1000, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 1000, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; SUPER ROD - item_attribute 0, NONE, 0, CANT_TOSS, KEY_ITEM, $60 + item_attribute 0, NONE, 0, CANT_TOSS, KEY_ITEM, ITEMMENU_CLOSE, ITEMMENU_NOUSE ; PP UP - item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, $50 + item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; ETHER - item_attribute 1200, NONE, 10, CANT_SELECT, ITEM, $55 + item_attribute 1200, NONE, 10, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; MAX ETHER - item_attribute 2000, NONE, -1, CANT_SELECT, ITEM, $55 + item_attribute 2000, NONE, -1, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; ELIXER - item_attribute 3000, NONE, 10, CANT_SELECT, ITEM, $55 + item_attribute 3000, NONE, 10, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; RED SCALE - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $00 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; SECRETPOTION - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $00 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; S.S.TICKET - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $00 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; MYSTERY EGG - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $00 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; CLEAR BELL - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $00 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; SILVER WING - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $00 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; MOOMOO MILK - item_attribute 500, NONE, 100, CANT_SELECT, ITEM, $55 + item_attribute 500, NONE, 100, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; QUICK CLAW - item_attribute 100, HELD_QUICK_CLAW, 60, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_QUICK_CLAW, 60, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; PSNCUREBERRY - item_attribute 10, HELD_HEAL_POISON, 0, CANT_SELECT, ITEM, $55 + item_attribute 10, HELD_HEAL_POISON, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; GOLD LEAF - item_attribute 1000, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 1000, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; SOFT SAND - item_attribute 100, HELD_GROUND_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_GROUND_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; SHARP BEAK - item_attribute 100, HELD_FLYING_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_FLYING_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; PRZCUREBERRY - item_attribute 10, HELD_HEAL_PARALYZE, 0, CANT_SELECT, ITEM, $55 + item_attribute 10, HELD_HEAL_PARALYZE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; BURNT BERRY - item_attribute 10, HELD_HEAL_FREEZE, 0, CANT_SELECT, ITEM, $55 + item_attribute 10, HELD_HEAL_FREEZE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; ICE BERRY - item_attribute 10, HELD_HEAL_BURN, 0, CANT_SELECT, ITEM, $55 + item_attribute 10, HELD_HEAL_BURN, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; POISON BARB - item_attribute 100, HELD_POISON_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_POISON_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; KING'S ROCK - item_attribute 100, HELD_TRADE_EVOLVE, 30, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_TRADE_EVOLVE, 30, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BITTER BERRY - item_attribute 10, HELD_HEAL_CONFUSION, 0, CANT_SELECT, ITEM, $05 + item_attribute 10, HELD_HEAL_CONFUSION, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_PARTY ; MINT BERRY - item_attribute 10, HELD_HEAL_SLEEP, 0, CANT_SELECT, ITEM, $55 + item_attribute 10, HELD_HEAL_SLEEP, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; RED APRICORN - item_attribute 200, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 200, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TINYMUSHROOM - item_attribute 500, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 500, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BIG MUSHROOM - item_attribute 5000, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 5000, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; SILVERPOWDER - item_attribute 100, HELD_BUG_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_BUG_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BLU APRICORN - item_attribute 200, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 200, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; AMULET COIN - item_attribute 100, HELD_AMULET_COIN, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_AMULET_COIN, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; YLW APRICORN - item_attribute 200, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 200, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; GRN APRICORN - item_attribute 200, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 200, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; CLEANSE TAG - item_attribute 200, HELD_CLEANSE_TAG, 0, CANT_SELECT, ITEM, $00 + item_attribute 200, HELD_CLEANSE_TAG, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; MYSTIC WATER - item_attribute 100, HELD_WATER_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_WATER_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TWISTEDSPOON - item_attribute 100, HELD_PSYCHIC_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_PSYCHIC_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; WHT APRICORN - item_attribute 200, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 200, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BLACKBELT - item_attribute 100, HELD_FIGHTING_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_FIGHTING_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BLK APRICORN - item_attribute 200, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 200, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; PNK APRICORN - item_attribute 200, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 200, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BLACKGLASSES - item_attribute 100, HELD_DARK_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_DARK_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; SLOWPOKETAIL - item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; PINK BOW - item_attribute 100, HELD_NORMAL_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_NORMAL_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; STICK - item_attribute 200, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 200, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; SMOKE BALL - item_attribute 200, HELD_ESCAPE, 0, CANT_SELECT, ITEM, $00 + item_attribute 200, HELD_ESCAPE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; NEVERMELTICE - item_attribute 100, HELD_ICE_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_ICE_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; MAGNET - item_attribute 100, HELD_ELECTRIC_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_ELECTRIC_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; MIRACLEBERRY - item_attribute 10, HELD_HEAL_STATUS, 0, CANT_SELECT, ITEM, $55 + item_attribute 10, HELD_HEAL_STATUS, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; PEARL - item_attribute 1400, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 1400, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BIG PEARL - item_attribute 7500, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 7500, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; EVERSTONE - item_attribute 200, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 200, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; SPELL TAG - item_attribute 100, HELD_GHOST_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_GHOST_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; RAGECANDYBAR - item_attribute 300, NONE, 20, CANT_SELECT, ITEM, $55 + item_attribute 300, NONE, 20, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; GS BALL - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $00 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BLUE CARD - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $40 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_CURRENT, ITEMMENU_NOUSE ; MIRACLE SEED - item_attribute 100, HELD_GRASS_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_GRASS_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; THICK CLUB - item_attribute 500, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 500, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; FOCUS BAND - item_attribute 200, HELD_FOCUS_BAND, 30, CANT_SELECT, ITEM, $00 + item_attribute 200, HELD_FOCUS_BAND, 30, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; ENERGYPOWDER - item_attribute 500, NONE, 0, CANT_SELECT, ITEM, $55 + item_attribute 500, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; ENERGY ROOT - item_attribute 800, NONE, 0, CANT_SELECT, ITEM, $55 + item_attribute 800, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; HEAL POWDER - item_attribute 450, NONE, 0, CANT_SELECT, ITEM, $55 + item_attribute 450, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; REVIVAL HERB - item_attribute 2800, NONE, 0, CANT_SELECT, ITEM, $55 + item_attribute 2800, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; HARD STONE - item_attribute 100, HELD_ROCK_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_ROCK_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; LUCKY EGG - item_attribute 200, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 200, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; CARD KEY - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $60 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_CLOSE, ITEMMENU_NOUSE ; MACHINE PART - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $00 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; EGG TICKET - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $00 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; LOST ITEM - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $00 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; STARDUST - item_attribute 2000, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 2000, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; STAR PIECE - item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 9800, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BASEMENT KEY - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $60 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_CLOSE, ITEMMENU_NOUSE ; PASS - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $00 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; CHARCOAL - item_attribute 9800, HELD_FIRE_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 9800, HELD_FIRE_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BERRY JUICE - item_attribute 100, HELD_BERRY, 20, CANT_SELECT, ITEM, $55 + item_attribute 100, HELD_BERRY, 20, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; SCOPE LENS - item_attribute 200, HELD_CRITICAL_UP, 0, CANT_SELECT, ITEM, $00 + item_attribute 200, HELD_CRITICAL_UP, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; METAL COAT - item_attribute 100, HELD_STEEL_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_STEEL_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; DRAGON FANG - item_attribute 100, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 100, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; LEFTOVERS - item_attribute 200, HELD_LEFTOVERS, 10, CANT_SELECT, ITEM, $00 + item_attribute 200, HELD_LEFTOVERS, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; MYSTERYBERRY - item_attribute 10, HELD_RESTORE_PP, -1, CANT_SELECT, ITEM, $55 + item_attribute 10, HELD_RESTORE_PP, -1, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; DRAGON SCALE - item_attribute 2100, HELD_DRAGON_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 2100, HELD_DRAGON_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BERSERK GENE - item_attribute 200, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 200, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; SACRED ASH - item_attribute 200, NONE, 0, CANT_SELECT, ITEM, $60 + item_attribute 200, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_CLOSE, ITEMMENU_NOUSE ; HEAVY BALL - item_attribute 150, NONE, 0, CANT_SELECT, BALL, $06 + item_attribute 150, NONE, 0, CANT_SELECT, BALL, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; FLOWER MAIL - item_attribute 50, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 50, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; LEVEL BALL - item_attribute 150, NONE, 0, CANT_SELECT, BALL, $06 + item_attribute 150, NONE, 0, CANT_SELECT, BALL, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; LURE BALL - item_attribute 150, NONE, 0, CANT_SELECT, BALL, $06 + item_attribute 150, NONE, 0, CANT_SELECT, BALL, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; FAST BALL - item_attribute 150, NONE, 0, CANT_SELECT, BALL, $06 + item_attribute 150, NONE, 0, CANT_SELECT, BALL, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; LIGHT BALL - item_attribute 100, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 100, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; FRIEND BALL - item_attribute 150, NONE, 0, CANT_SELECT, BALL, $06 + item_attribute 150, NONE, 0, CANT_SELECT, BALL, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; MOON BALL - item_attribute 150, NONE, 0, CANT_SELECT, BALL, $06 + item_attribute 150, NONE, 0, CANT_SELECT, BALL, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; LOVE BALL - item_attribute 150, NONE, 0, CANT_SELECT, BALL, $06 + item_attribute 150, NONE, 0, CANT_SELECT, BALL, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; NORMAL BOX - item_attribute 10, NONE, 0, CANT_SELECT, ITEM, $40 + item_attribute 10, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_CURRENT, ITEMMENU_NOUSE ; GORGEOUS BOX - item_attribute 10, NONE, 0, CANT_SELECT, ITEM, $40 + item_attribute 10, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_CURRENT, ITEMMENU_NOUSE ; SUN STONE - item_attribute 2100, NONE, 0, CANT_SELECT, ITEM, $50 + item_attribute 2100, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; POLKADOT BOW - item_attribute 100, HELD_NORMAL_BOOST, 10, CANT_SELECT, ITEM, $00 + item_attribute 100, HELD_NORMAL_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; UP-GRADE - item_attribute 2100, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 2100, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BERRY - item_attribute 10, HELD_BERRY, 10, CANT_SELECT, ITEM, $55 + item_attribute 10, HELD_BERRY, 10, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; GOLD BERRY - item_attribute 10, HELD_BERRY, 30, CANT_SELECT, ITEM, $55 + item_attribute 10, HELD_BERRY, 30, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_PARTY ; SQUIRTBOTTLE - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $60 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_CLOSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; PARK BALL - item_attribute 0, NONE, 0, CANT_SELECT, BALL, $06 + item_attribute 0, NONE, 0, CANT_SELECT, BALL, ITEMMENU_NOUSE, ITEMMENU_CLOSE ; RAINBOW WING - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, $00 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BRICK PIECE - item_attribute 50, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 50, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; SURF MAIL - item_attribute 50, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 50, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; LITEBLUEMAIL - item_attribute 50, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 50, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; PORTRAITMAIL - item_attribute 50, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 50, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; LOVELY MAIL - item_attribute 50, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 50, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; EON MAIL - item_attribute 50, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 50, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; MORPH MAIL - item_attribute 50, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 50, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; BLUESKY MAIL - item_attribute 50, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 50, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; MUSIC MAIL - item_attribute 50, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 50, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; MIRAGE MAIL - item_attribute 50, NONE, 0, CANT_SELECT, ITEM, $00 + item_attribute 50, NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TM01 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM02 - item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM03 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM04 - item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TM05 - item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM06 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM07 - item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM08 - item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM09 - item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM10 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM11 - item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM12 - item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM13 - item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM14 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM15 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM16 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM17 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM18 - item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM19 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM20 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM21 - item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM22 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM23 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM24 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM25 - item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM26 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM27 - item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM28 - item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TM29 - item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM30 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM31 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM32 - item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM33 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM34 - item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM35 - item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM36 - item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM37 - item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM38 - item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM39 - item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM40 - item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM41 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM42 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM43 - item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 1000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM44 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM45 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM46 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM47 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM48 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM49 - item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 3000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TM50 - item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, $50 + item_attribute 2000, NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; HM01 - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, $50 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; HM02 - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, $50 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; HM03 - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, $50 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; HM04 - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, $50 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; HM05 - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, $50 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; HM06 - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, $50 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; HM07 - item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, $50 + item_attribute 0, NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; TERU-SAMA - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; ? - item_attribute $9999, NONE, 0, 0, ITEM, $00 + item_attribute $9999, NONE, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE diff --git a/items/item_effects.asm b/items/item_effects.asm index fb76856ca..d40fc855e 100644 --- a/items/item_effects.asm +++ b/items/item_effects.asm @@ -208,7 +208,7 @@ FriendBall: MoonBall: LoveBall: ParkBall: ; e8a2 - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jp nz, Functionf7a0 @@ -512,7 +512,7 @@ endr cp BATTLETYPE_TUTORIAL jp z, .asm_ebd9 - callba Function10607f + callba MobileFn_10607f ld hl, UnknownText_0xedc9 call PrintText @@ -550,7 +550,7 @@ endr jp z, .asm_ebd1 cp BATTLETYPE_CELEBI jr nz, .asm_eac8 - ld hl, wd0ee + ld hl, wBattleResult set 6, [hl] .asm_eac8 @@ -628,7 +628,7 @@ endr ld a, [sBoxCount] cp MONS_PER_BOX jr nz, .asm_eb5b - ld hl, wd0ee + ld hl, wBattleResult set 7, [hl] .asm_eb5b ld a, [CurItem] @@ -1657,7 +1657,7 @@ Functionf0d6: ; f0d6 call Functionf30d ld a, 1 ret nz - ld a, [IsInBattle] + ld a, [wBattleMode] and a jr z, .asm_f104 @@ -1936,7 +1936,7 @@ Functionf2a2: ; f2a2 (3:72a2) ret Functionf2a6: ; f2a6 (3:72a6) - ld a, [IsInBattle] + ld a, [wBattleMode] and a ret z ld a, [CurPartyMon] @@ -2181,7 +2181,7 @@ Functionf3df: ; f3df (3:73df) call Functionf1db ld a, $f5 call Functionf24a - call Functiona36 + call JoyWaitAorB .asm_f413 ld a, b inc a @@ -2254,12 +2254,12 @@ Repel: ; f46a ; f46c Function_0xf46c: ; f46c - ld a, [wdca1] + ld a, [wRepelEffect] and a ld hl, UnknownText_0xf47d jp nz, PrintText ld a, b - ld [wdca1], a + ld [wRepelEffect], a jp Functionf789 ; f47d @@ -2280,15 +2280,15 @@ XAccuracy: ; f482 PokeDoll: ; f48f - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr nz, .asm_f4a6 inc a ld [wd232], a - ld a, [wd0ee] - and $c0 + ld a, [wBattleResult] + and 3 << 6 or $2 - ld [wd0ee], a + ld [wBattleResult], a jp Functionf789 .asm_f4a6 @@ -2362,20 +2362,20 @@ Tablef504: ; f504 PokeFlute: ; f50c - ld a, [IsInBattle] + ld a, [wBattleMode] and a jr nz, .asm_f512 .asm_f512 xor a - ld [wd002], a + ld [MiscBuffer2], a ld b, $ff ^ SLP ld hl, PartyMon1Status call .Functionf554 - ld a, [IsInBattle] + ld a, [wBattleMode] cp WILD_BATTLE jr z, .asm_f52b ld hl, OTPartyMon1Status @@ -2391,7 +2391,7 @@ PokeFlute: ; f50c and b ld [hl], a - ld a, [wd002] + ld a, [MiscBuffer2] and a ld hl, UnknownText_0xf56c jp z, PrintText @@ -2416,7 +2416,7 @@ PokeFlute: ; f50c and SLP jr z, .asm_f564 ld a, 1 - ld [wd002], a + ld [MiscBuffer2], a .asm_f564 pop af and b @@ -2448,7 +2448,7 @@ UnknownText_0xf576: ; 0xf576 Function_0xf57b: ; f57b - ld a, [IsInBattle] + ld a, [wBattleMode] and a jr nz, .asm_f58c @@ -2517,27 +2517,27 @@ MaxEther: Elixer: Mysteryberry: ; f5bf ld a, [CurItem] - ld [wd002], a + ld [MiscBuffer2], a -.asm_f5c5 +.loop ld b, $1 call Functionf1f9 jp c, Functionf6e0 -.asm_f5cd - ld a, [wd002] +.loop2 + ld a, [MiscBuffer2] cp MAX_ELIXER - jp z, Functionf6af + jp z, Elixer_RestorePPofAllMoves cp ELIXER - jp z, Functionf6af + jp z, Elixer_RestorePPofAllMoves ld hl, UnknownText_0xf725 - ld a, [wd002] + ld a, [MiscBuffer2] cp PP_UP - jr z, .asm_f5e7 + jr z, .ppup ld hl, UnknownText_0xf72a -.asm_f5e7 +.ppup call PrintText ld a, [CurMoveNum] @@ -2551,10 +2551,10 @@ Mysteryberry: ; f5bf pop bc ld a, b ld [CurMoveNum], a - jr nz, .asm_f5c5 + jr nz, .loop ld hl, PartyMon1Moves ld bc, PartyMon2 - PartyMon1 - call Functionf963 + call GetMthMoveOfNthPartymon push hl ld a, [hl] @@ -2563,28 +2563,28 @@ Mysteryberry: ; f5bf call CopyName1 pop hl - ld a, [wd002] + ld a, [MiscBuffer2] cp PP_UP jp nz, Functionf6a7 ld a, [hl] - cp $a6 - jr z, .asm_f62f + cp SKETCH + jr z, .CantUsePPUpOnSketch ld bc, $0015 add hl, bc ld a, [hl] - cp $c0 - jr c, .asm_f637 + cp 3 << 6 + jr c, .do_ppup -.asm_f62f +.CantUsePPUpOnSketch ld hl, UnknownText_0xf72f call PrintText - jr .asm_f5cd + jr .loop2 -.asm_f637 +.do_ppup ld a, [hl] - add $40 + add 1 << 6 ld [hl], a ld a, $1 ld [wd265], a @@ -2600,7 +2600,7 @@ Functionf64c: ; f64c ; f652 Functionf652: ; f652 - ld a, [IsInBattle] + ld a, [wBattleMode] and a jr z, .asm_f66c ld a, [CurPartyMon] @@ -2657,37 +2657,37 @@ Functionf652: ; f652 ; f6a7 Functionf6a7: ; f6a7 - call Functionf6e8 + call RestorePP jr nz, Functionf652 jp Functionf6dd ; f6af -Functionf6af: ; f6af +Elixer_RestorePPofAllMoves: ; f6af xor a ld hl, wcfa9 ld [hli], a ld [hl], a ld b, NUM_MOVES -.asm_f6b7 +.moveLoop push bc ld hl, PartyMon1Moves ld bc, PartyMon2 - PartyMon1 - call Functionf963 + call GetMthMoveOfNthPartymon ld a, [hl] and a - jr z, .asm_f6ce + jr z, .cant_restore_pp - call Functionf6e8 - jr z, .asm_f6ce + call RestorePP + jr z, .cant_restore_pp ld hl, wcfaa inc [hl] -.asm_f6ce +.cant_restore_pp ld hl, wcfa9 inc [hl] pop bc dec b - jr nz, .asm_f6b7 + jr nz, .moveLoop ld a, [wcfaa] and a jp nz, Functionf652 @@ -2702,48 +2702,48 @@ Functionf6e0: ; f6e0 ret ; f6e8 -Functionf6e8: ; f6e8 +RestorePP: ; f6e8 xor a ; PARTYMON ld [MonType], a call Functionf8ec ld hl, PartyMon1PP ld bc, PartyMon2 - PartyMon1 - call Functionf963 + call GetMthMoveOfNthPartymon ld a, [wd265] ld b, a ld a, [hl] - and $3f + and (1 << 6) - 1 cp b - jr nc, .asm_f723 + jr nc, .dont_restore - ld a, [wd002] + ld a, [MiscBuffer2] cp MAX_ELIXER - jr z, .asm_f71d + jr z, .restore_all cp MAX_ETHER - jr z, .asm_f71d + jr z, .restore_all ld c, 5 cp MYSTERYBERRY - jr z, .asm_f715 + jr z, .restore_some ld c, 10 -.asm_f715 +.restore_some ld a, [hl] - and $3f + and (1 << 6) - 1 add c cp b - jr nc, .asm_f71d + jr nc, .restore_all ld b, a -.asm_f71d +.restore_all ld a, [hl] - and $c0 + and 3 << 6 or b ld [hl], a ret -.asm_f723 +.dont_restore xor a ret ; f725 @@ -3127,9 +3127,9 @@ Functionf84c: ; f84c .asm_f876 ld a, [hl] - and $c0 - ld a, [de] - call nz, Functionf881 + and 3 << 6 + ld a, [de] ; wasted cycle + call nz, ComputeMaxPP .asm_f87d inc hl @@ -3139,8 +3139,9 @@ Functionf84c: ; f84c -Functionf881: ; f881 +ComputeMaxPP: ; f881 push bc + ; Divide the base PP by 5. ld a, [de] ld [hDividend + 3], a xor a @@ -3151,6 +3152,7 @@ Functionf881: ; f881 ld [hDivisor], a ld b, 4 call Divide + ; Get the number of PP, which are bits 6 and 7 of the PP value stored in RAM. ld a, [hl] ld b, a swap a @@ -3158,24 +3160,30 @@ Functionf881: ; f881 srl a srl a ld c, a + ; If this value is 0, we are done and a - jr z, .asm_f8b6 -.asm_f8a3 - ld a, [$ffb6] + jr z, .NoPPUp + +.loop + ; Normally, a move with 40 PP would have 64 PP with three PP Ups. + ; Since this would overflow into bit 6, we prevent that from happening + ; by decreasing the extra amount of PP each PP Up provides, resulting + ; in a maximum of 61. + ld a, [hQuotient + 2] cp $8 - jr c, .asm_f8ab + jr c, .okay ld a, $7 -.asm_f8ab +.okay add b ld b, a ld a, [wd265] dec a - jr z, .asm_f8b6 + jr z, .NoPPUp dec c - jr nz, .asm_f8a3 + jr nz, .loop -.asm_f8b6 +.NoPPUp ld [hl], b pop bc ret @@ -3203,7 +3211,7 @@ Functionf8b9: ; f8b9 pop bc pop de ld a, [de] - and $c0 + and 3 << 6 ld b, a ld a, [wd265] add b @@ -3229,30 +3237,30 @@ Functionf8ec: ; f8ec ld hl, PartyMon1Moves ld bc, PartyMon2 - PartyMon1 - jr z, .asm_f91a ; PARTYMON + jr z, .got_partymon ; PARTYMON ld hl, OTPartyMon1Moves dec a - jr z, .asm_f91a ; OTPARTYMON + jr z, .got_partymon ; OTPARTYMON ld hl, TempMonMoves dec a - jr z, .asm_f915 ; BOXMON + jr z, .got_nonpartymon ; BOXMON ld hl, TempMonMoves ; Wasted cycles dec a - jr z, .asm_f915 ; BREEDMON + jr z, .got_nonpartymon ; BREEDMON ld hl, BattleMonMoves ; WILDMON -.asm_f915 ; BOXMON, BREEDMON, WILDMON - call Functionf969 - jr .asm_f91d +.got_nonpartymon ; BOXMON, BREEDMON, WILDMON + call GetMthMoveOfCurrentMon + jr .gotdatmove -.asm_f91a ; PARTYMON, OTPARTYMON - call Functionf963 +.got_partymon ; PARTYMON, OTPARTYMON + call GetMthMoveOfNthPartymon -.asm_f91d +.gotdatmove ld a, [hl] dec a @@ -3271,12 +3279,12 @@ Functionf8ec: ; f8ec ld bc, PartyMon1PP - PartyMon1Moves ld a, [MonType] cp WILDMON - jr nz, .asm_f942 + jr nz, .notwild ld bc, EnemyMonPP - EnemyMonMoves -.asm_f942 +.notwild add hl, bc ld a, [hl] - and $c0 + and 3 << 6 pop bc or b @@ -3284,10 +3292,10 @@ Functionf8ec: ; f8ec ld [hl], a xor a ld [wd265], a - ld a, b - call Functionf881 + ld a, b ; this gets lost anyway + call ComputeMaxPP ld a, [hl] - and $3f + and (1 << 6) - 1 ld [wd265], a pop af @@ -3297,11 +3305,11 @@ Functionf8ec: ; f8ec ret ; f963 -Functionf963: ; f963 +GetMthMoveOfNthPartymon: ; f963 ld a, [CurPartyMon] call AddNTimes -Functionf969: ; f969 +GetMthMoveOfCurrentMon: ; f969 ld a, [wcfa9] ld c, a ld b, 0 diff --git a/lib/mobile/main.asm b/lib/mobile/main.asm index 739e12641..8d763dae0 100644 --- a/lib/mobile/main.asm +++ b/lib/mobile/main.asm @@ -6,43 +6,53 @@ INCLUDE "gbhw.asm" SECTION "Main", ROMX Function110000: ; 110000 (44:4000) +; Copy b bytes from hl to de +.loop ld a, [hli] ld [de], a inc de dec b - jr nz, Function110000 + jr nz, .loop ret ; 110007 (44:4007) Function110007: ; 110007 -.asm_110007 +; Copy bytes from hl to de until a 0 is encountered. +; Include the 0 in the copy, and count the number of +; nonzero bytes copied. Keep the de pointer at the +; copied zero. +.loop ld a, [hli] ld [de], a or a ret z inc de inc bc - jr .asm_110007 + jr .loop ; 11000f Function11000f: ; 11000f +; Copy bytes from hl to de until a 0 is encountered, +; or a bytes have been copied, whichever comes first. +; Add the byte count to the count previously stored +; in bc. push bc ld c, $0 ld b, a dec b -.asm_110014 +.loop ld a, [hli] ld [de], a or a - jr z, .asm_110020 + jr z, .done inc de inc c dec b - jr nz, .asm_110014 + jr nz, .loop xor a ld [de], a -.asm_110020 +.done ld a, c pop bc add c @@ -54,6 +64,7 @@ Function11000f: ; 11000f ; 110029 Function110029: ; 110029 (44:4029) +; Clear two bytes at $ca3a. xor a ld hl, $ca3a ld [hli], a @@ -61,21 +72,25 @@ Function110029: ; 110029 (44:4029) ret Function110030:: ; 110030 (44:4030) +; Use the byte at $c988 as a parameter +; for a jumptable. +; If [$c988] in {12, 14, 16}, +; clear [$c835]. push de ld a, [$c988] - cp $c - jr z, .asm_110047 - cp $e - jr z, .asm_110047 - cp $10 - jr z, .asm_110047 + cp 2 * 6 + jr z, .noreset + cp 2 * 7 + jr z, .noreset + cp 2 * 8 + jr z, .noreset xor a ld [$c835], a ld a, [$c988] -.asm_110047 +.noreset ld d, $0 ld e, a - ld hl, Jumptable_110070 + ld hl, .jumptable add hl, de ld a, [hli] ld [$c988], a @@ -89,19 +104,19 @@ Function110030:: ; 110030 (44:4030) push hl ld a, $36 cp l - jr nz, .asm_110066 + jr nz, .okay ld a, $42 cp h -.asm_110066 +.okay call nz, Function1100b4 ld hl, $c986 ld a, [hli] ld h, [hl] ld l, a - ret + ret ; indirectly jump to the function loaded from the jumptable, which returns to Function3e60. ; 110070 (44:4070) -Jumptable_110070: ; 110070 +.jumptable: ; 110070 dw Function110115 dw Function110236 dw Function110291 @@ -140,7 +155,7 @@ Jumptable_110070: ; 110070 Function1100b4: ; 1100b4 (44:40b4) push bc -.asm_1100b5 +.loop di ld a, [$c800] ld b, a @@ -150,19 +165,19 @@ Function1100b4: ; 1100b4 (44:40b4) ei or a bit 0, a - jr z, .asm_1100da + jr z, .done ld a, b or a - jr nz, .asm_1100b5 + jr nz, .loop ld a, c cp $4 - jr z, .asm_1100b5 + jr z, .loop xor a ld [$c80f], a ld hl, $c821 set 1, [hl] scf -.asm_1100da +.done pop bc ret ; 1100dc (44:40dc) diff --git a/macros.asm b/macros.asm index e366ad498..16b298268 100644 --- a/macros.asm +++ b/macros.asm @@ -78,17 +78,28 @@ bigdw: MACRO ; big-endian word dx 2, \1 ENDM +dba: MACRO ; dbw bank, address + dbw BANK(\1), \1 + ENDM + +dab: MACRO ; dwb address, bank + dwb \1, BANK(\1) + ENDM lb: MACRO ; r, hi, lo ld \1, (\2) << 8 + (\3) ENDM +ln: MACRO ; r, hi, lo + ld \1, (\2) << 4 + (\3) + ENDM bccoord equs "coord bc," decoord equs "coord de," hlcoord equs "coord hl," coord: MACRO +; register, x, y[, origin] if _NARG < 4 ld \1, TileMap + SCREEN_WIDTH * (\3) + (\2) else @@ -104,7 +115,7 @@ dwcoord: MACRO endr ENDM -ldcoord: MACRO +ldcoord_a: MACRO if _NARG < 3 ld [TileMap + SCREEN_WIDTH * (\2) + (\1)], a else @@ -112,6 +123,14 @@ ldcoord: MACRO endc ENDM +lda_coord: MACRO + if _NARG < 3 + ld a, [TileMap + SCREEN_WIDTH * (\2) + (\1)] + else + ld a, [\3 + SCREEN_WIDTH * (\2) + (\1)] + endc + ENDM + ; pic animations frame: MACRO db \1 @@ -150,28 +169,4 @@ bcd: MACRO endr ENDM -ln: MACRO - if _NARG == 5 - lb \1, \2 << 4 + \3, \4 << 4 + \5 - else - if _NARG == 3 - ld \1, \2 << 4 + \3 - else - fail "incorrect number of arguments for ln" - endc - endc -ENDM - -dwtile: MACRO - dw (\1 << 4) + \2 - if _NARG > 2 - rept _NARG + -2 - dw \3 - shift - endr - endc -ENDM - -ldtile: MACRO - ld \1, (\2 << 4) + \3 -ENDM +tile EQUS "+ $10 *" diff --git a/macros/charmap.asm b/macros/charmap.asm index de6519602..93710003a 100644 --- a/macros/charmap.asm +++ b/macros/charmap.asm @@ -1,125 +1,164 @@ - charmap "@", $50 +; Control characters + charmap "", $00 + charmap "", $14 ; + gender + charmap "", $15 + charmap "", $22 + charmap "", $24 + charmap "", $38 + charmap "", $39 + charmap "", $3f + charmap "", $49 + charmap "", $4a + charmap "", $4e + charmap "", $4f - charmap "#", $54 - charmap "№", $74 - charmap "…", $75 - charmap "┌", $79 - charmap "─", $7a - charmap "┐", $7b - charmap "│", $7c - charmap "└", $7d - charmap "┘", $7e - charmap " ", $7f - charmap "′", $6e - charmap "″", $6f - + charmap "@", $50 + charmap "", $51 + charmap "", $52 + charmap "", $53 + charmap "#", $54 + charmap "", $55 + charmap "<......>", $56 + charmap "", $57 + charmap "", $58 + charmap "", $59 + charmap "", $5a + charmap "", $5b + charmap "", $5c + charmap "", $5d + charmap "", $5e + charmap "", $5f - charmap "A", $80 - charmap "B", $81 - charmap "C", $82 - charmap "D", $83 - charmap "E", $84 - charmap "F", $85 - charmap "G", $86 - charmap "H", $87 - charmap "I", $88 - charmap "J", $89 - charmap "K", $8a - charmap "L", $8b - charmap "M", $8c - charmap "N", $8d - charmap "O", $8e - charmap "P", $8f - charmap "Q", $90 - charmap "R", $91 - charmap "S", $92 - charmap "T", $93 - charmap "U", $94 - charmap "V", $95 - charmap "W", $96 - charmap "X", $97 - charmap "Y", $98 - charmap "Z", $99 +; Actual characters + charmap "′", $6e + charmap "", $6e + charmap "″", $6f - charmap "(", $9a - charmap ")", $9b - charmap ":", $9c - charmap ";", $9d - charmap "[", $9e - charmap "]", $9f + charmap "", $70 + charmap "", $71 + charmap "№", $74 + charmap "…", $75 - charmap "a", $a0 - charmap "b", $a1 - charmap "c", $a2 - charmap "d", $a3 - charmap "e", $a4 - charmap "f", $a5 - charmap "g", $a6 - charmap "h", $a7 - charmap "i", $a8 - charmap "j", $a9 - charmap "k", $aa - charmap "l", $ab - charmap "m", $ac - charmap "n", $ad - charmap "o", $ae - charmap "p", $af - charmap "q", $b0 - charmap "r", $b1 - charmap "s", $b2 - charmap "t", $b3 - charmap "u", $b4 - charmap "v", $b5 - charmap "w", $b6 - charmap "x", $b7 - charmap "y", $b8 - charmap "z", $b9 + charmap "┌", $79 + charmap "─", $7a + charmap "┐", $7b + charmap "│", $7c + charmap "└", $7d + charmap "┘", $7e + charmap " ", $7f - charmap "Ä", $c0 - charmap "Ö", $c1 - charmap "Ü", $c2 - charmap "ä", $c3 - charmap "ö", $c4 - charmap "ü", $c5 + charmap "A", $80 + charmap "B", $81 + charmap "C", $82 + charmap "D", $83 + charmap "E", $84 + charmap "F", $85 + charmap "G", $86 + charmap "H", $87 + charmap "I", $88 + charmap "J", $89 + charmap "K", $8a + charmap "L", $8b + charmap "M", $8c + charmap "N", $8d + charmap "O", $8e + charmap "P", $8f + charmap "Q", $90 + charmap "R", $91 + charmap "S", $92 + charmap "T", $93 + charmap "U", $94 + charmap "V", $95 + charmap "W", $96 + charmap "X", $97 + charmap "Y", $98 + charmap "Z", $99 - charmap "'d", $d0 - charmap "'l", $d1 - charmap "'m", $d2 - charmap "'r", $d3 - charmap "'s", $d4 - charmap "'t", $d5 - charmap "'v", $d6 + charmap "(", $9a + charmap ")", $9b + charmap ":", $9c + charmap ";", $9d + charmap "[", $9e + charmap "]", $9f - charmap "'", $e0 - charmap "-", $e3 + charmap "a", $a0 + charmap "b", $a1 + charmap "c", $a2 + charmap "d", $a3 + charmap "e", $a4 + charmap "f", $a5 + charmap "g", $a6 + charmap "h", $a7 + charmap "i", $a8 + charmap "j", $a9 + charmap "k", $aa + charmap "l", $ab + charmap "m", $ac + charmap "n", $ad + charmap "o", $ae + charmap "p", $af + charmap "q", $b0 + charmap "r", $b1 + charmap "s", $b2 + charmap "t", $b3 + charmap "u", $b4 + charmap "v", $b5 + charmap "w", $b6 + charmap "x", $b7 + charmap "y", $b8 + charmap "z", $b9 - charmap "?", $e6 - charmap "!", $e7 - charmap ".", $e8 - charmap "&", $e9 + charmap "Ä", $c0 + charmap "Ö", $c1 + charmap "Ü", $c2 + charmap "ä", $c3 + charmap "ö", $c4 + charmap "ü", $c5 - charmap "é", $ea - charmap "→", $eb - charmap "▷", $ec - charmap "▶", $ed - charmap "▼", $ee - charmap "♂", $ef - charmap "¥", $f0 - charmap "×", $f1 - charmap "/", $f3 - charmap ",", $f4 - charmap "♀", $f5 + charmap "'d", $d0 + charmap "'l", $d1 + charmap "'m", $d2 + charmap "'r", $d3 + charmap "'s", $d4 + charmap "'t", $d5 + charmap "'v", $d6 - charmap "0", $f6 - charmap "1", $f7 - charmap "2", $f8 - charmap "3", $f9 - charmap "4", $fa - charmap "5", $fb - charmap "6", $fc - charmap "7", $fd - charmap "8", $fe - charmap "9", $ff + charmap "'", $e0 + charmap "", $e1 + charmap "", $e2 + charmap "-", $e3 + + charmap "?", $e6 + charmap "!", $e7 + charmap ".", $e8 + charmap "&", $e9 + + charmap "é", $ea + charmap "→", $eb + charmap "▷", $ec + charmap "▶", $ed + charmap "▼", $ee + charmap "♂", $ef + charmap "¥", $f0 + charmap "×", $f1 + charmap "·", $f2 + charmap "/", $f3 + charmap ",", $f4 + charmap "♀", $f5 + + charmap "0", $f6 + charmap "1", $f7 + charmap "2", $f8 + charmap "3", $f9 + charmap "4", $fa + charmap "5", $fb + charmap "6", $fc + charmap "7", $fd + charmap "8", $fe + charmap "9", $ff + +; Japanese, for those bits of text that +; were not translated to English. charmap "ガ", $5 charmap "ギ", $6 @@ -276,33 +315,3 @@ charmap "ー", $e3 charmap "ァ", $e9 - - charmap "", $52 - charmap "", $53 - charmap "", $38 - charmap "", $39 - charmap "", $59 - charmap "", $5a - charmap "", $3f - charmap "", $4a - charmap "", $e1 - charmap "", $e2 - charmap "", $70 - charmap "", $71 - charmap "", $49 - charmap "", $24 - charmap "", $14 ; + gender - charmap "", $51 - charmap "", $4f - charmap "", $4e - charmap "", $55 - charmap "", $57 - charmap "", $58 - charmap "", $15 - charmap "", $5b - charmap "", $5c - charmap "", $5d - charmap "", $5e - charmap "<......>", $56 - charmap "", $00 - charmap "", $5f diff --git a/macros/map.asm b/macros/map.asm index a9d3209c1..6133f3075 100644 --- a/macros/map.asm +++ b/macros/map.asm @@ -18,8 +18,8 @@ ENDM person_event: macro db \1 ; sprite - db \2 ; y - db \3 ; x + db \2 + 4 ; y + db \3 + 4 ; x db \4 ; movement function dn \5, \6 ; radius: y, x db \7 ; clock_hour diff --git a/main.asm b/main.asm index b67f8aff9..592bdf6cf 100644 --- a/main.asm +++ b/main.asm @@ -9,7 +9,7 @@ Function4000:: ; 4000 ld b, 1 ld c, 11 - ld a, [IsInBattle] + ld a, [wBattleMode] and a jr z, .notinbattle @@ -111,13 +111,13 @@ Function5b44: ; 5b44 call ClearTileMap call Functione5f call Functione51 - call Function1fbf + call ResetTextRelatedRAM ret ; 5b54 MysteryGift: ; 5b54 call UpdateTime - callba Function11548 + callba DoMysteryGiftIfDayHasPassed callba DoMysteryGift ret ; 5b64 @@ -149,7 +149,7 @@ NewGame: ; 5b6b Function5b8f: ; 5b8f callba Function10632f jr c, .ok - callba Function48dcb + callba InitGender ret .ok @@ -183,29 +183,29 @@ _ResetWRAM: ; 5bae call ByteFill ld a, [rLY] - ld [$ffe3], a + ld [hSecondsBackup], a call DelayFrame ld a, [hRandomSub] ld [PlayerID], a ld a, [rLY] - ld [$ffe3], a + ld [hSecondsBackup], a call DelayFrame ld a, [hRandomAdd] ld [PlayerID + 1], a call Random - ld [wd84a], a + ld [wSecretID], a call DelayFrame call Random - ld [wd84b], a + ld [wSecretID + 1], a ld hl, PartyCount call InitList xor a ld [wCurBox], a - ld [wd4b4], a + ld [wSavedAtLeastOnce], a call SetDefaultBoxNames @@ -380,7 +380,7 @@ InitializeNPCNames: ; 5ce9 InitializeWorld: ; 5d23 call ShrinkPlayer callba GetSpawnCoord - callba Function113d6 + callba _InitializeStartDay ret ; 5d33 @@ -542,7 +542,7 @@ FinishContinueFunction: ; 5e5d .loop xor a ld [wc2c1], a - ld [InLinkBattle], a + ld [wLinkMode], a ld hl, GameTimerPause set 0, [hl] res 7, [hl] @@ -648,7 +648,7 @@ MenuData2_0x5f03: ; 5f03 Function5f1c: ; 5f1c - call Function1cfd + call GetMemTileCoord push hl ld de, $005d add hl, de @@ -727,7 +727,7 @@ DisplayGameTime: ; 5f84 OakSpeech: ; 0x5f99 - callba Function90672 + callba InitClock call Function4dd call ClearTileMap @@ -947,7 +947,7 @@ ShrinkPlayer: ; 610f ld c, 3 call DelayFrames - call Function61cd + call Intro_PlacePlayerSprite call Functione5f ld c, 50 @@ -1020,7 +1020,7 @@ ShrinkFrame: ; 61b4 ret ; 61cd -Function61cd: ; 61cd +Intro_PlacePlayerSprite: ; 61cd callba GetPlayerIcon ld c, $c @@ -1028,7 +1028,7 @@ Function61cd: ; 61cd call Request2bpp ld hl, Sprites - ld de, .data_61fe + ld de, .sprites ld a, [de] inc de @@ -1058,12 +1058,12 @@ Function61cd: ; 61cd ret ; 61fe -.data_61fe ; 61fe +.sprites ; 61fe db 4 - db $4c, $48, $00 - db $4c, $50, $01 - db $54, $48, $02 - db $54, $50, $03 + db $4c, $48, 0 + db $4c, $50, 1 + db $54, $48, 2 + db $54, $50, 3 ; 620b @@ -1082,6 +1082,7 @@ Function6219: ; 6219 .loop call Function627b jr nc, .loop + call ClearSprites call WhiteBGMap pop af @@ -1123,7 +1124,7 @@ endr dw Function6389 dw Function620b dw Function620b - dw Function6392 + dw ResetClock ; 6274 @@ -1133,16 +1134,16 @@ TitleScreen: ; 6274 ; 627b Function627b: ; 627b - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a - jr nz, .true + jr nz, .done_title call TitleScreenScene - callba Function10eea7 + callba SuicuneFrameIterator call DelayFrame and a ret -.true +.done_title scf ret ; 6292 @@ -1154,7 +1155,7 @@ Function6292: ; 6292 ; unreferenced ld hl, LYOverrides + $5f ld a, [hl] dec a - ld bc, $0028 + ld bc, 2 * SCREEN_WIDTH call ByteFill ret ; 62a3 @@ -1180,7 +1181,7 @@ endr ; 62b7 Function62b7: ; 62b7 - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret ; 62bc @@ -1221,7 +1222,7 @@ TitleScreenEntrance: ; 62bc .done ; Next scene - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] xor a ld [hLCDStatCustom], a @@ -1239,7 +1240,7 @@ TitleScreenEntrance: ; 62bc TitleScreenTimer: ; 62f6 ; Next scene - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ; Start a timer @@ -1323,13 +1324,13 @@ TitleScreenMain: ; 6304 ld [wcf64], a ; Return to the intro sequence. - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret .end ; Next scene - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ; Fade out the title screen music @@ -1348,7 +1349,7 @@ TitleScreenMain: ; 6304 ld [wcf64], a ; Return to the intro sequence. - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret ; 6375 @@ -1368,7 +1369,7 @@ TitleScreenEnd: ; 6375 ld [wcf64], a ; Back to the intro. - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret ; 6389 @@ -1378,18 +1379,19 @@ Function6389: ; 6389 jp Init ; 6392 -Function6392: ; 6392 - callba Function4d3b1 +ResetClock: ; 6392 + callba _ResetClock jp Init ; 639b Function639b: ; 639b + ; If bit 0 or 1 of [wcf65] is set, we don't need to be here. ld a, [wcf65] and $3 ret nz ld bc, wc3a4 ld hl, $000a - add hl, bc + add hl, bc ; over-the-top compicated way to load wc3ae into hl ld l, [hl] ld h, 0 rept 2 @@ -1397,8 +1399,9 @@ rept 2 endr ld de, Data63ca add hl, de + ; If bit 2 of [wcf65] is set, get the second dw; else, get the first dw ld a, [wcf65] - and $4 + and %00000100 srl a srl a ld e, a @@ -1417,19 +1420,19 @@ endr ; 63ca Data63ca: ; 63ca - db $5c, $50, $00, $00 - db $5c, $68, $5c, $58 - db $5c, $68, $5c, $78 - db $5c, $88, $5c, $78 - db $00, $00, $5c, $78 - db $00, $00, $5c, $58 + dw $505c, $0000 + dw $685c, $585c + dw $685c, $785c + dw $885c, $785c + dw $0000, $785c + dw $0000, $585c ; 63e2 Copyright: ; 63e2 call ClearTileMap call Functione5f ld de, CopyrightGFX - ld hl, VTiles2 + $600 ; tile $60 + ld hl, VTiles2 tile $60 lb bc, BANK(CopyrightGFX), $1d call Request2bpp hlcoord 2, 7 @@ -1459,11 +1462,11 @@ CopyrightString: ; 63fd GameInit:: ; 642e callba Function14f1c - call Function1fbf + call ResetTextRelatedRAM call WhiteBGMap call ClearTileMap - ld a, $98 - ld [$ffd7], a + ld a, VBGMap0 / $100 + ld [hBGMapAddress + 1], a xor a ld [hBGMapAddress], a ld [hJoyDown], a @@ -1479,6 +1482,7 @@ Function6454:: ; 6454 call DelayFrame ld a, [hOAMUpdate] push af + ld a, $1 ld [hOAMUpdate], a ld a, [hBGMapMode] @@ -1486,6 +1490,7 @@ Function6454:: ; 6454 xor a ld [hBGMapMode], a call Function6473 + pop af ld [hBGMapMode], a pop af @@ -1502,7 +1507,7 @@ Function6473: ; 6473 ld a, $90 ld [hWY], a call Function2173 - ld a, $9c + ld a, VBGMap1 / $100 call Function64b9 call Function2e20 callba Function49409 @@ -1512,8 +1517,8 @@ Function6473: ; 6473 xor a ld [hBGMapMode], a ld [hWY], a - callba Function64db - ld a, $98 + callba Function64db ; no need to callba + ld a, VBGMap0 / $100 call Function64b9 xor a ld [wd152], a @@ -1527,7 +1532,7 @@ Function6473: ; 6473 ; 64b9 Function64b9: ; 64b9 - ld [$ffd7], a + ld [hBGMapAddress + 1], a xor a ld [hBGMapAddress], a ret @@ -1538,7 +1543,9 @@ Function64bf:: ; 64bf push af ld a, $1 ld [hOAMUpdate], a + call Function64cd + pop af ld [hOAMUpdate], a ret @@ -1566,9 +1573,9 @@ Function64db: ; 64db ld [rHDMA1], a ld a, w6_d000 % $100 ld [rHDMA2], a - ld a, ($9800 % $8000) / $100 + ld a, (VBGMap0 % $8000) / $100 ld [rHDMA3], a - ld a, ($9800 % $8000) % $100 + ld a, (VBGMap0 % $8000) % $100 ld [rHDMA4], a ld a, $3f ld [hDMATransfer], a @@ -1614,7 +1621,7 @@ LearnMove: ; 6508 ld [wd265], a ld b, a - ld a, [IsInBattle] + ld a, [wBattleMode] and a jr z, .not_disabled ld a, [DisabledMove] @@ -1650,7 +1657,7 @@ LearnMove: ; 6508 ld [hl], a - ld a, [IsInBattle] + ld a, [wBattleMode] and a jp z, .learned @@ -1704,7 +1711,7 @@ ForgetMove: ; 65d3 ld bc, -NUM_MOVES add hl, bc push hl - ld de, wd25e + ld de, wListMoves_MoveIndicesBuffer ld bc, NUM_MOVES call CopyBytes pop hl @@ -2422,7 +2429,7 @@ Function7041: ; 7041 ld bc, ObjectStructs xor a .loop - ld [$ffb0], a + ld [hConnectedMapWidth], a call GetObjectSprite jr z, .nope ld hl, OBJECT_04 @@ -2452,7 +2459,7 @@ Function7041: ; 7041 .ok2 ld a, [hConnectionStripLength] ld l, a - ld a, [$ffb0] + ld a, [hConnectedMapWidth] cp l jr nz, .setcarry @@ -2469,7 +2476,7 @@ Function7041: ; 7041 jr nz, .nope ld a, [hConnectionStripLength] ld l, a - ld a, [$ffb0] + ld a, [hConnectedMapWidth] cp l jr nz, .setcarry @@ -2478,7 +2485,7 @@ Function7041: ; 7041 add hl, bc ld b, h ld c, l - ld a, [$ffb0] + ld a, [hConnectedMapWidth] inc a cp NUM_OBJECT_STRUCTS jr nz, .loop @@ -2589,7 +2596,7 @@ Function7113: ; 7113 ld bc, ObjectStructs xor a .loop - ld [$ffb0], a + ld [hConnectedMapWidth], a call GetObjectSprite jr z, .asm_7160 ld hl, OBJECT_03 @@ -2612,7 +2619,7 @@ Function7113: ; 7113 ld a, [hl] cp d jr nz, .asm_714e - ld a, [$ffb0] + ld a, [hConnectedMapWidth] cp $0 jr z, .asm_7160 jr .asm_716f @@ -2635,7 +2642,7 @@ Function7113: ; 7113 add hl, bc ld b, h ld c, l - ld a, [$ffb0] + ld a, [hConnectedMapWidth] inc a cp NUM_OBJECT_STRUCTS jr nz, .loop @@ -2766,7 +2773,7 @@ endr .done ld [de], a - ld a, [IsInBattle] + ld a, [wBattleMode] and a ret z ld a, [CurPartyMon] @@ -3066,16 +3073,16 @@ SpecialReturnShuckle: ; 737e ret ; 73f7 -Function73f7: ; 73f7 +Special_BillsGrandfather: ; 73f7 callba SelectMonFromParty - jr c, .asm_740e + jr c, .cancel ld a, [CurPartySpecies] ld [ScriptVar], a - ld [wd265], a + ld [wNamedObjectIndexBuffer], a call GetPokemonName jp CopyPokemonName_Buffer1_Buffer3 -.asm_740e +.cancel xor a ld [ScriptVar], a ret @@ -3169,7 +3176,7 @@ Predef1: ; 747a SECTION "bank2", ROMX, BANK[$2] Function8000: ; 8000 - call Function2ed3 + call DisableSpriteUpdates xor a ld [hBGMapMode], a call WhiteBGMap @@ -3188,26 +3195,26 @@ Function8000: ; 8000 ; 8029 GetSpawnCoord: ; 8029 - ld a, $ff + ld a, -1 ld [wd4cd], a ld [wd4ce], a ld a, $0 ld hl, PlayerObjectTemplate call Function19a6 ld b, $0 - call Function808f + call PlayerSpawn_ConvertCoords ld a, $0 call GetMapObject ld hl, MAPOBJECT_COLOR add hl, bc - ld e, $80 - ld a, [wd45b] + ln e, (1 << 3) | PAL_OW_RED, $0 + ld a, [wPlayerSpriteSetupFlags] bit 2, a jr nz, .ok ld a, [PlayerGender] bit 0, a jr z, .ok - ld e, (PAL_OW_BLUE << 4) | $80 + ln e, (1 << 3) | PAL_OW_BLUE, $0 .ok ld [hl], e @@ -3215,7 +3222,7 @@ GetSpawnCoord: ; 8029 ld [hConnectionStripLength], a ld bc, MapObjects ld a, $0 - ld [$ffb0], a + ld [hConnectedMapWidth], a ld de, ObjectStructs call Function8116 ld a, $0 @@ -3227,11 +3234,10 @@ PlayerObjectTemplate: ; 8071 ; A dummy map object used to initialize the player object. ; Shorter than the actual amount copied by two bytes. ; Said bytes seem to be unused. - person_event SPRITE_CHRIS, 0, 0, $0b, 15, 15, -1, -1, 0, 0, 0, $0000, -1 - ; db $01, $00, $00, $0b, $ff, $ff, $ff, $00, $00, $00, $00, $ff, $ff + person_event SPRITE_CHRIS, -4, -4, $0b, 15, 15, -1, -1, 0, 0, 0, $0000, -1 ; 807e -Function807e:: ; 807e +CopyDECoordsToMapObject:: ; 807e push de ld a, b call GetMapObject @@ -3245,7 +3251,7 @@ Function807e:: ; 807e ret ; 808f -Function808f: ; 808f +PlayerSpawn_ConvertCoords: ; 808f push bc ld a, [XCoord] add 4 @@ -3254,7 +3260,7 @@ Function808f: ; 808f add 4 ld e, a pop bc - call Function807e + call CopyDECoordsToMapObject ret ; 80a1 @@ -3271,7 +3277,7 @@ Function80a1:: ; 80a1 ld e, [hl] ld a, [hConnectionStripLength] ld b, a - call Function807e + call CopyDECoordsToMapObject and a ret ; 80b8 @@ -3314,12 +3320,12 @@ CopyObjectStruct:: ; 80e7 ld a, 1 ld de, OBJECT_STRUCT_LENGTH .loop - ld [$ffb0], a + ld [hConnectedMapWidth], a ld a, [hl] and a jr z, .done add hl, de - ld a, [$ffb0] + ld a, [hConnectedMapWidth] inc a cp NUM_OBJECT_STRUCTS jr nz, .loop @@ -3346,7 +3352,7 @@ Function8116: ; 8116 ; 811d Function811d: ; 811d - ld a, [$ffb0] + ld a, [hConnectedMapWidth] ld hl, MAPOBJECT_OBJECT_STRUCT_ID add hl, bc ld [hl], a @@ -3833,7 +3839,7 @@ Function839e:: ; 839e ld hl, OBJECT_SPRITE_Y add hl, de ld [hl], a - ld a, [$ffb0] + ld a, [hConnectedMapWidth] ld hl, OBJECT_32 add hl, de ld [hl], a @@ -4094,10 +4100,10 @@ CheckTime:: ; c000 ; c012 TimeOfDayTable: ; c012 - db MORN, 1 - db DAY, 2 - db NITE, 4 - db NITE, 4 + db MORN, 1 << MORN + db DAY, 1 << DAY + db NITE, 1 << NITE + db NITE, 1 << NITE db -1 ; c01b @@ -5024,7 +5030,7 @@ UsedSurfScript: ; c986 ; c9a2 Functionc9a2: ; c9a2 - callba Function1060bb ; empty + callba MobileFn_1060bb ; empty ret ; c9a9 @@ -5323,7 +5329,7 @@ CheckContinueWaterfall: ; cb38 ld a, [StandingTile] call CheckWaterfallTile ret z - callba Function1060c1 + callba MobileFn_1060c1 ld a, $1 ld [ScriptVar], a ret @@ -6062,7 +6068,7 @@ GetFacingObject: ; cf0d callba CheckFacingObject jr nc, .fail - ld a, [$ffb0] + ld a, [hConnectedMapWidth] call GetObjectStruct ld hl, OBJECT_MAP_OBJECT_INDEX add hl, bc @@ -6594,12 +6600,12 @@ UnknownText_0xd1d0: ; 0xd1d0 _ReceiveItem:: ; d1d5 - call CheckHLequTMsHMsEnd + call DoesHLEqualNumItems jp nz, PutItemInPocket push hl call CheckItemPocket pop de - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] dec a ld hl, .Pockets rst JumpTable @@ -6641,12 +6647,12 @@ _ReceiveItem:: ; d1d5 _TossItem:: ; d20d - call CheckHLequTMsHMsEnd - jr nz, .asm_d241 + call DoesHLEqualNumItems + jr nz, .remove push hl call CheckItemPocket pop de - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] dec a ld hl, .Pockets rst JumpTable @@ -6684,17 +6690,17 @@ _TossItem:: ; d20d ld l, e ; d241 -.asm_d241 +.remove jp RemoveItemFromPocket ; d244 _CheckItem:: ; d244 - call CheckHLequTMsHMsEnd - jr nz, .asm_d278 + call DoesHLEqualNumItems + jr nz, .nope push hl call CheckItemPocket pop de - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] dec a ld hl, .Pockets rst JumpTable @@ -6732,16 +6738,16 @@ _CheckItem:: ; d244 ld l, e ; d278 -.asm_d278 +.nope jp CheckTheItem ; d27b -CheckHLequTMsHMsEnd: ; d27b +DoesHLEqualNumItems: ; d27b ld a, l - cp TMsHMsEnd % $100 + cp NumItems % $100 ret nz ld a, h - cp TMsHMsEnd / $100 + cp NumItems / $100 ret ; d283 @@ -6749,21 +6755,21 @@ GetPocketCapacity: ; d283 ld c, MAX_ITEMS ld a, e cp NumItems % $100 - jr nz, .asm_d28e + jr nz, .not_bag ld a, d cp NumItems / $100 ret z -.asm_d28e +.not_bag ld c, MAX_PC_ITEMS ld a, e cp PCItems % $100 - jr nz, .asm_d299 + jr nz, .not_pc ld a, d cp PCItems / $100 ret z -.asm_d299 +.not_pc ld c, MAX_BALLS ret ; d29c @@ -7131,50 +7137,50 @@ GetNumberedTMHM: ; d417 _CheckTossableItem:: ; d427 -; Return 1 in wd142 and carry if CurItem can't be removed from the bag. +; Return 1 in wItemAttributeParamBuffer and carry if CurItem can't be removed from the bag. ld a, ITEMATTR_PERMISSIONS call GetItemAttr bit 7, a - jr nz, Functiond47f + jr nz, ItemAttr_ReturnCarry and a ret ; d432 CheckSelectableItem: ; d432 -; Return 1 in wd142 and carry if CurItem can't be selected. +; Return 1 in wItemAttributeParamBuffer and carry if CurItem can't be selected. ld a, ITEMATTR_PERMISSIONS call GetItemAttr bit 6, a - jr nz, Functiond47f + jr nz, ItemAttr_ReturnCarry and a ret ; d43d CheckItemPocket:: ; d43d -; Return the pocket for CurItem in wd142. +; Return the pocket for CurItem in wItemAttributeParamBuffer. ld a, ITEMATTR_POCKET call GetItemAttr and $f - ld [wd142], a + ld [wItemAttributeParamBuffer], a ret ; d448 CheckItemContext: ; d448 -; Return the context for CurItem in wd142. +; Return the context for CurItem in wItemAttributeParamBuffer. ld a, ITEMATTR_HELP call GetItemAttr and $f - ld [wd142], a + ld [wItemAttributeParamBuffer], a ret ; d453 CheckItemMenu: ; d453 -; Return the menu for CurItem in wd142. +; Return the menu for CurItem in wItemAttributeParamBuffer. ld a, ITEMATTR_HELP call GetItemAttr swap a and $f - ld [wd142], a + ld [wItemAttributeParamBuffer], a ret ; d460 @@ -7190,7 +7196,7 @@ GetItemAttr: ; d460 add hl, bc xor a - ld [wd142], a + ld [wItemAttributeParamBuffer], a ld a, [CurItem] dec a @@ -7205,9 +7211,9 @@ GetItemAttr: ; d460 ret ; d47f -Functiond47f: ; d47f +ItemAttr_ReturnCarry: ; d47f ld a, 1 - ld [wd142], a + ld [wItemAttributeParamBuffer], a scf ret ; d486 @@ -7304,7 +7310,7 @@ Functiond508: ; d508 (3:5508) ret Functiond509: ; d509 (3:5509) - callba Function10602e + callba MobileFn_10602e ret Functiond510: ; d510 (3:5510) @@ -8011,7 +8017,7 @@ GeneratePartyMonStats: ; d906 ld a, [BaseDexNo] ld [de], a inc de - ld a, [IsInBattle] + ld a, [wBattleMode] and a ld a, $0 jr z, .skipitem @@ -8023,7 +8029,7 @@ GeneratePartyMonStats: ; d906 push de ld h, d ld l, e - ld a, [IsInBattle] + ld a, [wBattleMode] and a jr z, .randomlygeneratemoves ld a, [MonType] @@ -8102,7 +8108,7 @@ endr pop de pop hl push hl - ld a, [IsInBattle] + ld a, [wBattleMode] and a jr nz, .copywildmonstats call Random @@ -8207,7 +8213,7 @@ endr inc de .next2 - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr nz, .generatestats ld hl, EnemyMonMaxHP @@ -9201,7 +9207,7 @@ Functione039: ; e039 ld a, [wd10b] and a jp nz, CloseSRAM - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ret nz ld a, BANK(s0_a600) @@ -9497,14 +9503,14 @@ GivePoke:: ; e277 push af ld a, [CurItem] and a - jr z, .asm_e2e1 + jr z, .done ld a, [CurPartyMon] ld hl, PartyMon1Item ld bc, PartyMon2 - PartyMon1 call AddNTimes ld a, [CurItem] ld [hl], a - jr .asm_e2e1 + jr .done .failed ld a, [CurPartySpecies] @@ -9525,11 +9531,11 @@ GivePoke:: ; e277 push af ld a, [CurItem] and a - jr z, .asm_e2e1 + jr z, .done ld a, [CurItem] ld [sBoxMon1Item], a -.asm_e2e1 +.done ld a, [CurPartySpecies] ld [wd265], a ld [TempEnemyMonSpecies], a @@ -9563,6 +9569,7 @@ endr push de push bc jr nz, .asm_e35e + push hl ld a, [CurPartyMon] ld hl, PartyMonOT @@ -9570,14 +9577,14 @@ endr ld d, h ld e, l pop hl -.asm_e32f +.otnameloop ld a, [ScriptBank] call GetFarByte ld [de], a inc hl inc de cp "@" - jr nz, .asm_e32f + jr nz, .otnameloop ld a, [ScriptBank] call GetFarByte ld b, a @@ -9586,9 +9593,9 @@ endr ld hl, PartyMon1ID ld bc, PartyMon2 - PartyMon1 call AddNTimes - ld a, $3 + ld a, 01001 / $100 ld [hli], a - ld [hl], $e9 + ld [hl], 01001 % $100 pop bc callba SetPkmnCaughtData jr .asm_e3b2 @@ -9603,7 +9610,7 @@ endr ld [de], a inc hl inc de - cp $50 + cp "@" jr nz, .asm_e366 ld a, [ScriptBank] call GetFarByte @@ -9649,7 +9656,7 @@ endr call GetSRAMBank ld hl, wd050 ld de, sBoxMonNicknames - ld bc, $000b + ld bc, PKMN_NAME_LENGTH call CopyBytes call CloseSRAM ld b, $1 @@ -9672,7 +9679,7 @@ TextJump_WasSentToBillsPC: ; 0xe3d9 Functione3de: ; e3de push de call Function1d6e - call Function2ed3 + call DisableSpriteUpdates pop de push de ld b, $0 @@ -9722,7 +9729,7 @@ Functione41c: ; e41c (3:641c) call PrintText pop af ld [Options], a - call Functione58 + call LoadFontsBattleExtra ret ; e43a (3:643a) @@ -9741,14 +9748,14 @@ Functione443: ; e443 (3:6443) call LoadMenuDataHeader ld a, $1 .asm_e44b - ld [wcf88], a + ld [wPocketCursorBuffer], a call Function32f9 xor a ld [wcf76], a ld [hBGMapMode], a ; $ff00+$d4 call Function1e5d jr c, .asm_e46b - ld a, [wcf88] + ld a, [wPocketCursorBuffer] push af ld a, [MenuSelection] ld hl, Jumptable_e4ba @@ -9946,7 +9953,7 @@ Functione583: ; e583 (3:6583) ret ClearPCItemScreen: ; e58b - call Function2ed3 + call DisableSpriteUpdates xor a ld [hBGMapMode], a call WhiteBGMap @@ -10092,11 +10099,11 @@ Unknown_e66e: ; e66e dbw BANK(sBox7), sBox7 dbw BANK(sBox8), sBox8 dbw BANK(sBox9), sBox9 - dbw BANK(sBox10), sBox10 - dbw BANK(sBox11), sBox11 - dbw BANK(sBox12), sBox12 - dbw BANK(sBox13), sBox13 - dbw BANK(sBox14), sBox14 + dba sBox10 + dba sBox11 + dba sBox12 + dba sBox13 + dba sBox14 ; e698 Functione698: ; e698 @@ -10418,7 +10425,7 @@ TMHMMoves: ; 1167a ; 116b7 _NamingScreen: ; 0x116b7 - call Function2ed3 + call DisableSpriteUpdates call Function116c1 call Function2b74 ret @@ -10439,17 +10446,17 @@ Function116c1: ; 116c1 push af xor a ld [$ffde], a - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a call Function116f8 call DelayFrame .asm_116e5 call Function11915 jr nc, .asm_116e5 pop af - ld [$ffaa], a + ld [hInMenu], a pop af ld [$ffde], a pop af @@ -10585,7 +10592,7 @@ String_117e6: ; 117e6 Function117f5: ; 117f5 (4:57f5) ld de, PokeBallSpriteGFX - ld hl, $8000 + ld hl, VTiles0 tile $00 lb bc, BANK(PokeBallSpriteGFX), $4 call Request2bpp xor a @@ -10623,7 +10630,7 @@ String_11839: ; 11839 Function11847: ; 11847 (4:5847) push de - ld hl, $8000 + ld hl, VTiles0 tile $00 ld c, $4 push bc call Request2bpp @@ -10632,7 +10639,7 @@ Function11847: ; 11847 (4:5847) add hl, de ld e, l ld d, h - ld hl, $8040 + ld hl, VTiles0 tile $04 call Request2bpp xor a ld hl, wc300 @@ -10752,8 +10759,8 @@ Function118ca: ; 118ca ; 11915 Function11915: ; 11915 - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_11930 call Function11968 @@ -10799,7 +10806,7 @@ Function11940: ; 11940 ; 11968 Function11968: ; 11968 - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, $0 ld hl, Jumptable_11977 @@ -10836,7 +10843,7 @@ Function1197b: ; 1197b (4:597b) ld hl, $e add hl, bc ld [hl], a - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret @@ -10890,7 +10897,7 @@ Function119a1: ; 119a1 (4:59a1) .asm_119eb call Function11bf7 - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret @@ -10994,7 +11001,7 @@ Unknown_11a82: ; 11a82 ; 11a8b Function11a8b: ; 11a8b (4:5a8b) - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_UP jr nz, .up @@ -11199,21 +11206,22 @@ Function11bd0: ; 11bd0 (4:5bd0) ; 11be0 Function11be0: ; 11be0 +; load $f2, ($eb * [wc6d3]), $50 into the dw address at wc6d0 ld hl, wc6d0 ld a, [hli] ld h, [hl] ld l, a - ld [hl], $f2 + ld [hl], "·" inc hl ld a, [wc6d3] dec a ld c, a - ld a, $eb -.asm_11bf0 + ld a, "→" +.loop ld [hli], a dec c - jr nz, .asm_11bf0 - ld [hl], $50 + jr nz, .loop + ld [hl], "@" ret ; 11bf7 @@ -11289,22 +11297,22 @@ Function11c51: ; 11c51 call Functione5f ld de, GFX_11e65 - ld hl, $8eb0 + ld hl, VTiles1 tile $6b lb bc, BANK(GFX_11e65), 1 call Get1bpp ld de, GFX_11e6d - ld hl, $8f20 + ld hl, VTiles1 tile $72 lb bc, BANK(GFX_11e6d), 1 call Get1bpp - ld de, $9600 + ld de, VTiles2 tile $60 ld hl, GFX_11cb7 ld bc, $10 ld a, BANK(GFX_11cb7) call FarCopyBytes - ld de, $87e0 + ld de, VTiles0 tile $7e ld hl, GFX_11cc7 ld bc, $20 ld a, BANK(GFX_11cc7) @@ -11319,7 +11327,7 @@ Function11c51: ; 11c51 ld [wc3bf], a ld [hSCX], a ld [wc3c0], a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [hBGMapMode], a ld [wc6d2], a @@ -11385,17 +11393,17 @@ Function11e75: ; 11e75 (4:5e75) push af xor a ld [$ffde], a - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a call Function11e9a call DelayFrame .asm_11e8e call Function11fc0 jr nc, .asm_11e8e pop af - ld [$ffaa], a + ld [hInMenu], a pop af ld [$ffde], a ret @@ -11404,7 +11412,7 @@ Function11e9a: ; 11e9a (4:5e9a) call WhiteBGMap call DisableLCD call Function11c51 - ld de, $8000 + ld de, VTiles0 tile $00 ld hl, GFX_11ef4 ld bc, $80 ld a, BANK(GFX_11ef4) @@ -11427,9 +11435,9 @@ Function11e9a: ; 11e9a (4:5e9a) call GetSGBLayout call WaitBGMap call WaitTop - ld a, $e4 + ld a, %11100100 call DmgToCgbBGPals - ld a, $e4 + ld a, %11100100 call Functioncf8 call Function11be0 ld hl, wc6d0 @@ -11459,15 +11467,15 @@ String_11f7a: ; 11f7a Function11f84: ; 11f84 (4:5f84) call WaitTop hlcoord 0, 0 - ld bc, $78 + ld bc, 6 * SCREEN_WIDTH ld a, $60 call ByteFill hlcoord 0, 6 - ld bc, $f0 + ld bc, 12 * SCREEN_WIDTH ld a, " " call ByteFill hlcoord 1, 1 - ld bc, $412 + lb bc, 4, SCREEN_WIDTH - 2 call ClearBox ld de, String_121dd @@ -11491,8 +11499,8 @@ Function11fa9: ; 11fa9 (4:5fa9) ret Function11fc0: ; 11fc0 (4:5fc0) - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_11fdb call Function12008 @@ -11527,7 +11535,7 @@ Function11feb: ; 11feb (4:5feb) ret Function12008: ; 12008 (4:6008) - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_12017 @@ -11558,7 +11566,7 @@ Function1201b: ; 1201b (4:601b) ld hl, $e add hl, bc ld [hl], a - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret @@ -11628,7 +11636,7 @@ Function1203a: ; 1203a (4:603a) .asm_120a1 call Function11bf7 - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret @@ -11688,7 +11696,7 @@ Unknown_12102: ; 12102 ; 1210c Function1210c: ; 1210c (4:610c) - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_UP jr nz, .up @@ -12009,7 +12017,7 @@ Jumptable_12377: ; 12377 Function12383: ; 12383 call Function12434 ld de, GFX_123fc - ld hl, $87c0 + ld hl, VTiles0 tile $7c lb bc, BANK(GFX_123fc), $2 call Request2bpp ret @@ -12252,7 +12260,7 @@ Function1250a: ; 1250a HalveMoney: ; 12513 ; Empty function... - callba Function1060c7 + callba MobileFn_1060c7 ; Halve the player's money. ld hl, Money @@ -12416,7 +12424,7 @@ UnknownText_0x125c8: ; 0x125c8 StartMenu:: ; 125cd - call Function1fbf + call ResetTextRelatedRAM ld de, SFX_MENU call PlaySFX @@ -12433,7 +12441,7 @@ StartMenu:: ; 125cd call LoadMenuDataHeader call .SetUpMenuItems ld a, [wd0d2] - ld [wcf88], a + ld [wPocketCursorBuffer], a call .DrawMenuAccount_ call MenuFunc_1e7f call .DrawBugContestStatusBox @@ -12449,13 +12457,13 @@ StartMenu:: ; 125cd call UpdateTimePals call .SetUpMenuItems ld a, [wd0d2] - ld [wcf88], a + ld [wPocketCursorBuffer], a .Select call .GetInput jr c, .Exit call .DrawMenuAccount - ld a, [wcf88] + ld a, [wPocketCursorBuffer] ld [wd0d2], a call PlayClickSFX call Function1bee @@ -12494,7 +12502,7 @@ endr .ReturnEnd call ExitMenu .ReturnEnd2 - call Function2dcf + call LoadMoveSprites call UpdateTimePals ret @@ -12526,15 +12534,15 @@ endr .ReturnFour ; 12691 call ExitMenu - ld a, $80 - ld [$ffa0], a + ld a, HMENURETURN_SCRIPT + ld [hMenuReturn], a ret ; 12699 .ReturnThree ; 12699 call ExitMenu - ld a, $80 - ld [$ffa0], a + ld a, HMENURETURN_SCRIPT + ld [hMenuReturn], a jr .ReturnEnd2 ; 126a2 @@ -12716,7 +12724,7 @@ endr call .AppendMenuList .no_pokemon - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .no_pack ld hl, StatusFlags2 @@ -12736,7 +12744,7 @@ endr ld a, 3 ; status call .AppendMenuList - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .no_save ld hl, StatusFlags2 @@ -12762,8 +12770,8 @@ endr xor a ld hl, MenuItemsList ld [hli], a - ld a, $ff - ld bc, $000f + ld a, -1 + ld bc, MenuItemsListEnd - (MenuItemsList + 1) call ByteFill ld de, MenuItemsList + 1 ld c, 0 @@ -13011,7 +13019,7 @@ Function129f4: ; 129f4 push de call PartyMonItemName callba _CheckTossableItem - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] and a jr nz, .asm_12a3f ld hl, UnknownText_0x12a45 @@ -13147,7 +13155,7 @@ PokemonActionSubmenu: ; 12a88 dbw 17, GiveTakePartyMonItem dbw 18, CancelPokemonAction dbw 19, Function12fba ; move - dbw 20, Function12d45 ; mail + dbw 20, MonMailAction ; mail ; 12aec @@ -13230,7 +13238,7 @@ GiveTakePartyMonItem: ; 12b60 call ClearPalettes call Function12ba9 call ClearPalettes - call Functione58 + call LoadFontsBattleExtra call ExitMenu ld a, 0 ret @@ -13262,7 +13270,7 @@ Function12ba9: ; 12ba9 jr z, .next call CheckTossableItem - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] and a jr nz, .next @@ -13510,82 +13518,89 @@ Function12cfe: ; 12cfe (4:6cfe) call CloseSRAM ret -Function12d45: ; 12d45 - ld a, [InLinkBattle] - cp $1 - jr z, .asm_12d6d - cp $2 - jr z, .asm_12d6d - ld hl, MenuDataHeader_0x12dc9 +MonMailAction: ; 12d45 +; If in the time capsule or trade center, +; selecting the mail only allows you to +; read the mail. + ld a, [wLinkMode] + cp LINK_TIMECAPSULE + jr z, .read + cp LINK_TRADECENTER + jr z, .read + +; Show the READ/TAKE/QUIT menu. + ld hl, .MenuDataHeader call LoadMenuDataHeader call InterpretMenu2 call ExitMenu - jp c, .asm_12dc6 + +; Interpret the menu. + jp c, .done ld a, [wcfa9] cp $1 - jr z, .asm_12d6d + jr z, .read cp $2 - jr z, .asm_12d76 - jp .asm_12dc6 + jr z, .take + jp .done -.asm_12d6d - callba Functionb9229 +.read + callba ReadPartyMonMail ld a, $0 ret -.asm_12d76 - ld hl, UnknownText_0x12df1 +.take + ld hl, .sendmailtopctext call Function12cf5 - jr c, .asm_12d9a + jr c, .RemoveMailToBag ld a, [CurPartyMon] ld b, a callba Function4456e - jr c, .asm_12d92 - ld hl, UnknownText_0x12dfb + jr c, .MailboxFull + ld hl, .sentmailtopctext call MenuTextBoxBackup - jr .asm_12dc6 + jr .done -.asm_12d92 - ld hl, UnknownText_0x12df6 +.MailboxFull + ld hl, .mailboxfulltext call MenuTextBoxBackup - jr .asm_12dc6 + jr .done -.asm_12d9a - ld hl, UnknownText_0x12de2 +.RemoveMailToBag + ld hl, .mailwilllosemessagetext call Function12cf5 - jr c, .asm_12dc6 + jr c, .done call GetPartyItemLocation ld a, [hl] ld [CurItem], a call Function12cdf - jr nc, .asm_12dbe + jr nc, .BagIsFull call GetPartyItemLocation ld [hl], $0 call GetCurNick - ld hl, UnknownText_0x12de7 + ld hl, .tookmailfrommontext call MenuTextBoxBackup - jr .asm_12dc6 + jr .done -.asm_12dbe - ld hl, UnknownText_0x12dec +.BagIsFull + ld hl, .bagfulltext call MenuTextBoxBackup - jr .asm_12dc6 + jr .done -.asm_12dc6 +.done ld a, $3 ret ; 12dc9 -MenuDataHeader_0x12dc9: ; 0x12dc9 +.MenuDataHeader: ; 0x12dc9 db $40 ; flags db 10, 12 ; start coords db 17, 19 ; end coords - dw MenuData2_0x12dd1 + dw .MenuData2 db 1 ; default option ; 0x12dd1 -MenuData2_0x12dd1: ; 0x12dd1 +.MenuData2: ; 0x12dd1 db $80 ; flags db 3 ; items db "READ@" @@ -13594,32 +13609,38 @@ MenuData2_0x12dd1: ; 0x12dd1 ; 0x12de2 -UnknownText_0x12de2: ; 0x12de2 +.mailwilllosemessagetext: ; 0x12de2 +; The MAIL will lose its message. OK? text_jump UnknownText_0x1c1c22 db "@" ; 0x12de7 -UnknownText_0x12de7: ; 0x12de7 +.tookmailfrommontext: ; 0x12de7 +; MAIL detached from . text_jump UnknownText_0x1c1c47 db "@" ; 0x12dec -UnknownText_0x12dec: ; 0x12dec +.bagfulltext: ; 0x12dec +; There's no space for removing MAIL. text_jump UnknownText_0x1c1c62 db "@" ; 0x12df1 -UnknownText_0x12df1: ; 0x12df1 +.sendmailtopctext: ; 0x12df1 +; Send the removed MAIL to your PC? text_jump UnknownText_0x1c1c86 db "@" ; 0x12df6 -UnknownText_0x12df6: ; 0x12df6 +.mailboxfulltext: ; 0x12df6 +; Your PC's MAILBOX is full. text_jump UnknownText_0x1c1ca9 db "@" ; 0x12dfb -UnknownText_0x12dfb: ; 0x12dfb +.sentmailtopctext: ; 0x12dfb +; The MAIL was sent to your PC. text_jump UnknownText_0x1c1cc4 db "@" ; 0x12e00 @@ -13662,7 +13683,7 @@ Function12e30: ; 12e30 jr z, .asm_12e4c cp $0 jr z, .asm_12e4f - callba Function1060b5 + callba MobileFn_1060b5 ld b, $4 ld a, $2 ret @@ -13862,7 +13883,7 @@ Function12f5b: ; 12f5b ld a, [hl] push af set 4, [hl] - call Functione58 + call LoadFontsBattleExtra call Function12f73 pop bc ld a, b @@ -13970,12 +13991,12 @@ Function12fd5: ; 12fd5 jp .asm_12ff2 .asm_13018 - ld a, $7f + ld a, " " hlcoord 1, 11 - ld bc, $0005 + ld bc, 5 call ByteFill hlcoord 1, 12 - ld bc, $0512 + lb bc, 5, SCREEN_WIDTH - 2 call ClearBox hlcoord 1, 12 ld de, String_1316b @@ -13992,7 +14013,7 @@ Function12fd5: ; 12fd5 xor a ld [wd0e3], a hlcoord 1, 2 - ld bc, $0812 + lb bc, 8, SCREEN_WIDTH - 2 call ClearBox jp .asm_12fe8 ; 1305b @@ -14083,7 +14104,7 @@ Function12fd5: ; 12fd5 ld bc, $0015 add hl, bc call Function1313a - ld a, [IsInBattle] + ld a, [wBattleMode] jr z, .asm_13113 ld hl, BattleMonMoves ld bc, $0020 @@ -14159,7 +14180,7 @@ Function13172: ; 13172 xor a ld [hBGMapMode], a callba Functionfb571 - callba Function8e814 + callba InefficientlyClear121BytesAtwc300 ld a, [CurPartyMon] ld e, a ld d, $0 @@ -14207,7 +14228,7 @@ Function131ef: ; 131ef ld [MonType], a predef Function5084a ld hl, TempMonMoves - ld de, wd25e + ld de, wListMoves_MoveIndicesBuffer ld bc, NUM_MOVES call CopyBytes ld a, SCREEN_WIDTH * 2 @@ -14377,12 +14398,12 @@ SelectMenu:: ; 13327 jp UseRegisteredItem .NotRegistered - call Function2e08 + call LoadFont ld b, BANK(ItemMayBeRegisteredText) ld hl, ItemMayBeRegisteredText call MapTextbox call CloseText - jp Function2dcf + jp LoadMoveSprites ; 13340 @@ -14495,7 +14516,7 @@ endr UseRegisteredItem: ; 133c3 callba CheckItemMenu - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] ld hl, .SwitchTo rst JumpTable ret @@ -14511,17 +14532,17 @@ UseRegisteredItem: ; 133c3 ; 133df .NoFunction ; 133df - call Function2e08 + call LoadFont call CantUseItem - call Function2dcf + call LoadMoveSprites and a ret ; 133ea .Current ; 133ea - call Function2e08 + call LoadFont call DoItemEffect - call Function2dcf + call LoadMoveSprites and a ret ; 133f5 @@ -14531,7 +14552,7 @@ UseRegisteredItem: ; 133c3 call FadeToMenu call DoItemEffect call Function2b3c - call Function2dcf + call LoadMoveSprites and a ret ; 13406 @@ -14545,19 +14566,19 @@ UseRegisteredItem: ; 133c3 ld [wd0ef], a ld a, [wd0ec] cp 1 - jr nz, .asm_13425 + jr nz, ._cantuse scf - ld a, $80 - ld [$ffa0], a + ld a, HMENURETURN_SCRIPT + ld [hMenuReturn], a ret ; 13422 .CantUse ; 13422 call ResetWindow -.asm_13425 +._cantuse call CantUseItem - call Function2dcf + call LoadMoveSprites and a ret ; 1342d @@ -14767,9 +14788,9 @@ Elevator_MenuData2: ; 0x13558 db 4, 0 ; rows, columns db 1 ; horizontal spacing dbw 0, OBPals + 8 * 6 - dbw BANK(GetElevatorFlorStrings), GetElevatorFlorStrings - dbw BANK(NULL), NULL - dbw BANK(NULL), NULL + dba GetElevatorFlorStrings + dba NULL + dba NULL ; 13568 GetElevatorFlorStrings: ; 13568 @@ -14857,7 +14878,7 @@ Special_GiveParkBalls: ; 135db ld [wContestMon], a ld a, 20 ld [wdc79], a - callba Function11490 + callba StartBugContestTimer ret ; 135eb @@ -15006,7 +15027,7 @@ Script_JumpStdFromRAM: ; 0x1369a _BugContestJudging: ; 1369d call ContestScore - callba Function105f79 + callba MobileFn_105f79 call Function13819 ld a, [wd00a] call LoadContestantName @@ -16051,11 +16072,13 @@ Function1409b: ; 1409b Function140ae: ; 140ae call Function6e3 ld c, a - and $c0 + and %11000000 jr nz, .asm_140c8 + ld a, c - and $20 + and %00100000 jr z, .asm_140eb + call UpdateTime ld a, [wRTC + 0] ld b, a @@ -16064,7 +16087,7 @@ Function140ae: ; 140ae jr c, .asm_140eb .asm_140c8 - callba Function113da + callba ClearDailyTimers callba Function170923 ld a, $5 call GetSRAMBank @@ -16197,7 +16220,7 @@ GetPlayerSprite: ; 14183 ; Get Chris or Kris's sprite. ld hl, .Chris - ld a, [wd45b] + ld a, [wPlayerSpriteSetupFlags] bit 2, a jr nz, .go ld a, [PlayerGender] @@ -16846,51 +16869,51 @@ EmotesPointers: ; 144d dw ShockEmote db $40, BANK(ShockEmote) - dwtile $78, VTiles1 + dw VTiles1 tile $78 dw QuestionEmote db $40, BANK(QuestionEmote) - dwtile $78, VTiles1 + dw VTiles1 tile $78 dw HappyEmote db $40, BANK(HappyEmote) - dwtile $78, VTiles1 + dw VTiles1 tile $78 dw SadEmote db $40, BANK(SadEmote) - dwtile $78, VTiles1 + dw VTiles1 tile $78 dw HeartEmote db $40, BANK(HeartEmote) - dwtile $78, VTiles1 + dw VTiles1 tile $78 dw BoltEmote db $40, BANK(BoltEmote) - dwtile $78, VTiles1 + dw VTiles1 tile $78 dw SleepEmote db $40, BANK(SleepEmote) - dwtile $78, VTiles1 + dw VTiles1 tile $78 dw FishEmote db $40, BANK(FishEmote) - dwtile $78, VTiles1 + dw VTiles1 tile $78 dw FishingRodGFX + $00 db $10, BANK(FishingRodGFX) - dwtile $7c, VTiles1 + dw VTiles1 tile $7c dw FishingRodGFX + $10 db $20, BANK(FishingRodGFX) - dwtile $7c, VTiles1 + dw VTiles1 tile $7c dw FishingRodGFX + $30 db $20, BANK(FishingRodGFX) - dwtile $7e, VTiles1 + dw VTiles1 tile $7e dw FishingRodGFX + $50 db $10, BANK(FishingRodGFX) - dwtile $7e, VTiles1 + dw VTiles1 tile $7e ; 14495 @@ -18083,7 +18106,7 @@ KrisWithdrawItemMenu: ; 0x157d1 Function157e9: ; 0x157e9 ; check if the item has a quantity callba _CheckTossableItem - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] and a jr z, .askquantity @@ -18181,7 +18204,7 @@ KrisLogOffMenu: ; 0x15888 KrisDepositItemMenu: ; 0x1588b call Function158b8 jr c, .asm_158b6 - call Function2ed3 + call DisableSpriteUpdates call Function1d6e callba Function106a5 .asm_1589c @@ -18223,26 +18246,27 @@ Function158cc: ; 0x158cc ld a, $0 ld [wc2ce], a callba CheckItemMenu - ld a, [wd142] - ld hl, Jumptable_158e7 + ld a, [wItemAttributeParamBuffer] + ld hl, .jumptable rst JumpTable pop af ld [wc2ce], a ret ; 0x158e7 -Jumptable_158e7: ; 0x158e7 - dw .jump2 - dw .jump1 - dw .jump1 - dw .jump1 - dw .jump2 - dw .jump2 - dw .jump2 +.jumptable: ; 0x158e7 + dw .maybe_use + dw .no_use + dw .no_use + dw .no_use + dw .maybe_use + dw .maybe_use + dw .maybe_use -.jump1: +.no_use: ret -.jump2: + +.maybe_use: ld a, [Buffer1] push af ld a, [Buffer2] @@ -18257,7 +18281,7 @@ Jumptable_158e7: ; 0x158e7 Function1590a: ; 0x1590a callba _CheckTossableItem - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] and a jr z, .asm_1591d ld a, $1 @@ -18339,7 +18363,7 @@ Function15985: ; 0x15985 ld c, $12 call TextBox ld a, [wd0d7] - ld [wcf88], a + ld [wPocketCursorBuffer], a ld a, [wd0dd] ld [wd0e4], a call Function350c @@ -18408,9 +18432,9 @@ MenuData15a08: ; 0x15a08 db 4, 8 ; rows/cols? db 2 ; horizontal spacing? dbw 0, PCItems - dbw BANK(Function24ab4), Function24ab4 - dbw BANK(Function24ac3), Function24ac3 - dbw BANK(Function244c3), Function244c3 + dba PlaceMenuItemName + dba PlaceMenuItemQuantity + dba Function244c3 PC_DisplayText: ; 15a20 call MenuTextBox @@ -18915,7 +18939,7 @@ Function15cef: ; 15cef ld hl, MenuDataHeader_0x15e18 call CopyMenuDataHeader ld a, [WalkingX] - ld [wcf88], a + ld [wPocketCursorBuffer], a ld a, [WalkingY] ld [wd0e4], a call Function350c @@ -18955,7 +18979,7 @@ Function15cef: ; 15cef call TakeMoney ld a, $4 call Function15c7d - call Functiona36 + call JoyWaitAorB .asm_15d68 call SpeechTextBox @@ -18969,14 +18993,14 @@ Function15cef: ; 15cef .asm_15d6f ld a, $3 call Function15c7d - call Functiona36 + call JoyWaitAorB and a ret .asm_15d79 ld a, $2 call Function15c7d - call Functiona36 + call JoyWaitAorB and a ret ; 15d83 @@ -19035,7 +19059,7 @@ endr .asm_15dd8 ld a, $5 call Function15c7d - call Functiona36 + call JoyWaitAorB scf ret ; 15de2 @@ -19096,9 +19120,9 @@ MenuData2_0x15e20: ; 0x15e20 db 4, 8 ; rows, columns db 1 ; horizontal spacing dbw 0, OBPals + 8 * 6 - dbw BANK(Function24ab4), Function24ab4 - dbw BANK(Function15e30), Function15e30 - dbw BANK(Function244c3), Function244c3 + dba PlaceMenuItemName + dba Function15e30 + dba Function244c3 ; 15e30 Function15e30: ; 15e30 @@ -19248,7 +19272,7 @@ UnknownText_0x15eae: ; 0x15eae Function15eb3: ; 15eb3 - call Function2ed3 + call DisableSpriteUpdates callba Function106a5 .asm_15ebc callba Function106be @@ -19281,30 +19305,30 @@ UnknownText_0x15edb: ; 0x15edb Function15ee0: ; 15ee0 callba CheckItemMenu - ld a, [wd142] - ld hl, Jumptable_15eee + ld a, [wItemAttributeParamBuffer] + ld hl, .jumptable rst JumpTable ret ; 15eee -Jumptable_15eee: ; 15eee - dw Function15efd - dw Function15efc - dw Function15efc - dw Function15efc - dw Function15efd - dw Function15efd - dw Function15efd +.jumptable: ; 15eee + dw .maybe_use + dw .no_use + dw .no_use + dw .no_use + dw .maybe_use + dw .maybe_use + dw .maybe_use ; 15efc -Function15efc: ; 15efc +.no_use: ; 15efc ret ; 15efd -Function15efd: ; 15efd +.maybe_use: ; 15efd callba _CheckTossableItem - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] and a jr z, .asm_15f11 ld hl, UnknownText_0x15faf @@ -19340,7 +19364,7 @@ Function15efd: ; 15efd call PrintTextBoxText call Function15fc3 callba Function24af0 - call Functiona36 + call JoyWaitAorB .asm_15f6e call ExitMenu @@ -19434,7 +19458,7 @@ Function15fc3: ; 15fc3 Function15fcd: ; 15fcd call MenuTextBox - call Functiona36 + call JoyWaitAorB call ExitMenu ret ; 15fd7 @@ -20428,10 +20452,10 @@ Function16be4: ; 16be4 and a ret z - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a ld a, [Options] push af set 4, a @@ -20440,12 +20464,12 @@ Function16be4: ; 16be4 call ClearTileMap ld de, UnownDexATile - ld hl, $8ef0 + ld hl, VTiles1 tile $6f lb bc, BANK(UnownDexBTile), 1 call Request1bpp ld de, UnownDexBTile - ld hl, $8f50 + ld hl, VTiles1 tile $75 lb bc, BANK(UnownDexBTile), 1 call Request1bpp @@ -20474,7 +20498,7 @@ Function16be4: ; 16be4 call PlaceString xor a - ld [wcf63], a + ld [wJumptableIndex], a call Function16cc8 call WaitBGMap @@ -20489,7 +20513,7 @@ Function16be4: ; 16be4 call Function32f9 .asm_16c6b - call Functiona57 + call JoyTextDelay ld a, [hJoyPressed] and B_BUTTON @@ -20504,34 +20528,34 @@ Function16be4: ; 16be4 jr .asm_16c6b .asm_16c82 - ld a, [wcf63] + ld a, [wJumptableIndex] push af callba Function84560 call RestartMapMusic pop af - ld [wcf63], a + ld [wJumptableIndex], a jr .asm_16c6b .asm_16c95 pop af ld [Options], a pop af - ld [$ffaa], a + ld [hInMenu], a call Function222a ret ; 16ca0 Function16ca0: ; 16ca0 - ld a, [$ffa9] - and $10 + ld a, [hJoyLast] + and D_RIGHT jr nz, .asm_16cb9 - ld a, [$ffa9] - and $20 + ld a, [hJoyLast] + and D_LEFT jr nz, .asm_16cad ret .asm_16cad - ld hl, wcf63 + ld hl, wJumptableIndex ld a, [hl] and a jr nz, .asm_16cb6 @@ -20542,7 +20566,7 @@ Function16ca0: ; 16ca0 jr .asm_16cc4 .asm_16cb9 - ld hl, wcf63 + ld hl, wJumptableIndex ld a, [hl] cp $1a jr c, .asm_16cc3 @@ -20557,7 +20581,7 @@ Function16ca0: ; 16ca0 ; 16cc8 Function16cc8: ; 16cc8 - ld a, [wcf63] + ld a, [wJumptableIndex] cp 26 jr z, Function16d20 inc a @@ -20574,7 +20598,7 @@ Function16cc8: ; 16cc8 ld [$ffad], a lb bc, 7, 7 predef FillBox - ld de, $9310 + ld de, VTiles2 tile $31 callba Functione0000 ret ; 16cff @@ -20608,17 +20632,17 @@ Function16d20: ; 16d20 xor a call GetSRAMBank ld hl, sScratch - ld bc, $0310 + ld bc, $0310 ; 784 xor a call ByteFill - ld hl, $9310 + ld hl, VTiles2 tile $31 ld de, sScratch ld c, $31 ld a, [hROMBank] ld b, a call Get2bpp call CloseSRAM - ld c, $14 + ld c, 20 call DelayFrames ret ; 16d57 @@ -20649,7 +20673,7 @@ INCBIN "gfx/unknown/016da4.1bpp" Function16dac: ; 16dac hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - ld a, $7f + ld a, " " call ByteFill hlcoord 7, 11 ld a, $31 @@ -20669,7 +20693,7 @@ Function16dc7: ; 16dc7 jr z, .asm_16dfd ld hl, UnknownText_0x16e09 call PrintText - call Function2ed3 + call DisableSpriteUpdates callba Function8461a call Function2b74 ld a, [$ffac] @@ -20886,7 +20910,7 @@ Function16ed6: ; 16ed6 ret ; 16f3e -Function16f3e:: ; 16f3e +DoEggStep:: ; 16f3e ld de, PartySpecies ld hl, PartyMon1Happiness ld c, 0 @@ -20917,7 +20941,7 @@ OverworldHatchEgg:: ; 16f5e call Function16f70 call Function2b4d call RestartMapMusic - jp Function2dcf + jp LoadMoveSprites ; 16f70 Function16f70: ; 16f70 (5:6f70) @@ -20943,7 +20967,7 @@ Function16f7a: ; 16f7a (5:6f7a) push de callba Function4dbb8 - callba Function10608d + callba MobileFn_10608d ld a, [CurPartyMon] ld hl, PartyMons ; wdcdf (aliases: PartyMon1, PartyMon1Species) ld bc, PartyMon2 - PartyMon1 @@ -21381,13 +21405,13 @@ Function17254: ; 17254 (5:7254) push hl push bc hlcoord 0, 0 - ld bc, $168 - ld a, $7f + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH + ld a, " " call ByteFill pop bc pop hl ld a, b - ld [$ffd7], a + ld [hBGMapAddress + 1], a ld a, c ld [$ffad], a ld bc, $707 @@ -21410,7 +21434,7 @@ Function1727f: ; 1727f (5:727f) Function1728f: ; 1728f (5:728f) ld a, [wd265] - ld [wcf63], a + ld [wJumptableIndex], a ld a, [CurSpecies] push af ld de, MUSIC_NONE @@ -21418,15 +21442,15 @@ Function1728f: ; 1728f (5:728f) callba Function8000 call DisableLCD ld hl, EggHatchGFX - ld de, $8000 + ld de, VTiles0 tile $00 ld bc, $20 ld a, BANK(EggHatchGFX) call FarCopyBytes callba Function8cf53 - ld de, $9000 - ld a, [wcf63] + ld de, VTiles2 tile $00 + ld a, [wJumptableIndex] call Function1723c - ld de, $9310 + ld de, VTiles2 tile $31 ld a, EGG call Function17224 ld de, MUSIC_EVOLUTION @@ -21482,11 +21506,11 @@ Function1728f: ; 1728f (5:728f) hlcoord 6, 3 ld b, $98 ld c, $0 - ld a, [wcf63] + ld a, [wJumptableIndex] call Function17254 call Function17418 call WaitSFX - ld a, [wcf63] + ld a, [wJumptableIndex] ld [CurPartySpecies], a hlcoord 6, 3 ld d, $0 @@ -21590,7 +21614,7 @@ Function17418: ; 17418 (5:7418) jr nz, .asm_1741a ret -Function17421: ; 17421 +Special_DayCareMon1: ; 17421 ld hl, UnknownText_0x17467 call PrintText ld a, [wBreedMon1Species] @@ -21603,7 +21627,7 @@ Function17421: ; 17421 call Function1746c jp PrintText -Function17440: ; 17440 +Special_DayCareMon2: ; 17440 ld hl, UnknownText_0x17462 call PrintText ld a, [wBreedMon2Species] @@ -22028,7 +22052,7 @@ Function2403c:: ; 2403c ld c, a ld a, [wcfa3] call SimpleMultiply - ld [wcf88], a + ld [wPocketCursorBuffer], a and a ret ; 24085 @@ -22073,7 +22097,7 @@ Function24098: ; 24098 ld c, a ld a, [wcfaa] add c - ld [wcf88], a + ld [wPocketCursorBuffer], a and a ret @@ -22159,7 +22183,7 @@ Function2411a: ; 2411a (9:411a) call Function24193 ld a, [wcfa4] ld e, a - ld a, [wcf88] + ld a, [wPocketCursorBuffer] ld b, a xor a ld d, $0 @@ -22363,7 +22387,7 @@ Function24259: ; 24259 callab Function8cf62 .asm_24266 - call Functiona57 + call JoyTextDelay call Function1bdd and a ret z @@ -22562,53 +22586,59 @@ Function24329: ; 24329 ret ; 24374 -Function24374:: ; 24374 +_BackUpTiles:: ; 24374 ld a, [rSVBK] push af ld a, $7 ld [rSVBK], a + ld hl, wcf71 ld e, [hl] inc hl ld d, [hl] push de + ld b, $10 ld hl, wcf81 -.asm_24387 +.loop ld a, [hli] ld [de], a dec de dec b - jr nz, .asm_24387 + jr nz, .loop + +; If bit 6 or 7 of the menu flags is set, set bit 0 of the address +; at 7:[wcf71], and draw the menu using the coordinates from the header. +; Otherwise, reset bit 0 of 7:[wcf71]. ld a, [wcf81] bit 6, a - jr nz, .asm_24398 + jr nz, .bit_6 bit 7, a - jr z, .asm_243ae + jr z, .not_bit_7 -.asm_24398 +.bit_6 ld hl, wcf71 ld a, [hli] ld h, [hl] ld l, a set 0, [hl] - call Function1cfd - call Function243cd - call Function1d19 - call Function243cd - jr .asm_243b5 + call GetMemTileCoord + call .copy + call GetMemAttrCoord + call .copy + jr .done -.asm_243ae - pop hl +.not_bit_7 + pop hl ; last-pushed register was de push hl ld a, [hld] ld l, [hl] ld h, a res 0, [hl] -.asm_243b5 +.done pop hl - call Function243e7 + call .ret ; empty function ld a, h ld [de], a dec de @@ -22619,6 +22649,7 @@ Function24374:: ; 24374 ld [hl], e inc hl ld [hl], d + pop af ld [rSVBK], a ld hl, wcf78 @@ -22626,30 +22657,34 @@ Function24374:: ; 24374 ret ; 243cd -Function243cd: ; 243cd - call Function1c53 +.copy: ; 243cd + call GetMenuBoxDims inc b inc c - call Function243e7 -.asm_243d5 + call .ret ; empty function + +.row push bc push hl -.asm_243d7 + +.col ld a, [hli] ld [de], a dec de dec c - jr nz, .asm_243d7 + jr nz, .col + pop hl ld bc, SCREEN_WIDTH add hl, bc pop bc dec b - jr nz, .asm_243d5 + jr nz, .row + ret ; 243e7 -Function243e7: ; 243e7 +.ret: ; 243e7 ret ; 243e8 @@ -22674,7 +22709,7 @@ Function243e8:: ; 243e8 jr z, .next ld d, h ld e, l - call Function1c23 + call RestoreTileBackup .next call Function1c7e @@ -22743,7 +22778,7 @@ Function2446d:: ; 2446d ld a, [wcf91] ld b, a ld hl, wcfa1 - ld a, [wcf82] + ld a, [wMenuBorderTopCoord] inc a bit 6, b jr nz, .asm_2447d @@ -22751,7 +22786,7 @@ Function2446d:: ; 2446d .asm_2447d ld [hli], a - ld a, [wcf83] + ld a, [wMenuBorderLeftCoord] inc a ld [hli], a ld a, [wcf92] @@ -22782,7 +22817,7 @@ Function2446d:: ; 2446d .asm_244a9 ld [hli], a - ld a, [wcf88] + ld a, [wPocketCursorBuffer] and a jr z, .asm_244b7 ld c, a @@ -22810,11 +22845,11 @@ Function244c3: ; 0x244c3 ld a, [MenuSelection] ld [CurSpecies], a hlcoord 0, 12 - ld b, $4 - ld c, $12 + ld b, 4 + ld c, SCREEN_WIDTH - 2 call TextBox ld a, [MenuSelection] - cp $ff + cp -1 ret z decoord 1, 14 callba PrintItemDescription @@ -22836,10 +22871,10 @@ Pokepic:: ; 244e3 call GetBaseData ld de, VTiles1 predef GetFrontpic - ld a, [wcf82] + ld a, [wMenuBorderTopCoord] inc a ld b, a - ld a, [wcf83] + ld a, [wMenuBorderLeftCoord] inc a ld c, a call GetTileCoord @@ -22950,7 +22985,7 @@ Function245af:: ; 245af ld [wcf73], a ld [hBGMapMode], a inc a - ld [$ffaa], a + ld [hInMenu], a call Function2471a call Function24764 call Function247dd @@ -22963,21 +22998,21 @@ Function245af:: ; 245af Function245cb:: ; 245cb .loop - call Function24609 - jp c, Function245d6 - call z, Function245e1 + call MenuJoyAction + jp c, .exit + call z, .zero jr .loop ; 245d6 -Function245d6: ; 245d6 +.exit: ; 245d6 call Function1ff8 ld [wcf73], a ld a, 0 - ld [$ffaa], a + ld [hInMenu], a ret ; 245e1 -Function245e1: ; 245e1 +.zero: ; 245e1 call Function245f1 ld a, 1 ld [hBGMapMode], a @@ -23003,42 +23038,42 @@ Function245f1: ; 245f1 ret ; 24609 -Function24609: ; 24609 -.asm_24609 +MenuJoyAction: ; 24609 +.loop call Function1bd3 - ld a, [$ffa9] - and $f0 + ld a, [hJoyLast] + and D_PAD ld b, a ld a, [hJoyPressed] - and $f + and BUTTONS or b - bit 0, a - jp nz, Function24644 - bit 1, a - jp nz, Function2466f - bit 2, a - jp nz, Function24673 - bit 3, a - jp nz, Function24695 - bit 4, a - jp nz, Function246b5 - bit 5, a - jp nz, Function246a1 - bit 6, a - jp nz, Function246c9 - bit 7, a - jp nz, Function246df - jr .asm_24609 + bit 0, a ; A + jp nz, .a_button + bit 1, a ; B + jp nz, .b_button + bit 2, a ; Select + jp nz, .select + bit 3, a ; Start + jp nz, .start + bit 4, a ; Right + jp nz, .d_right + bit 5, a ; Left + jp nz, .d_left + bit 6, a ; Up + jp nz, .d_up + bit 7, a ; Down + jp nz, .d_down + jr .loop ; 24640 -Function24640: ; 24640 - ld a, $ff +.unreferenced: ; unreferenced + ld a, -1 and a ret ; 24644 -Function24644: ; 24644 +.a_button: ; 24644 call Function1bee ld a, [wcfa9] dec a @@ -23052,20 +23087,20 @@ Function24644: ; 24644 ld [wcf77], a ld [wd107], a ld a, [MenuSelection] - cp $ff - jr z, Function2466f - ld a, $1 + cp -1 + jr z, .b_button + ld a, A_BUTTON scf ret ; 2466f -Function2466f: ; 2466f - ld a, $2 +.b_button: ; 2466f + ld a, B_BUTTON scf ret ; 24673 -Function24673: ; 24673 +.select: ; 24673 ld a, [wcf91] bit 7, a jp z, xor_a_dec_a @@ -23073,65 +23108,65 @@ Function24673: ; 24673 dec a call Function248d5 ld a, [MenuSelection] - cp $ff + cp -1 jp z, xor_a_dec_a call Function246fc dec a ld [wcf77], a - ld a, $4 + ld a, SELECT scf ret ; 24695 -Function24695: ; 24695 +.start: ; 24695 ld a, [wcf91] bit 6, a jp z, xor_a_dec_a - ld a, $8 + ld a, START scf ret ; 246a1 -Function246a1: ; 246a1 +.d_left: ; 246a1 ld hl, wcfa6 bit 7, [hl] jp z, xor_a_dec_a ld a, [wcf91] bit 3, a jp z, xor_a_dec_a - ld a, $20 + ld a, D_LEFT scf ret ; 246b5 -Function246b5: ; 246b5 +.d_right: ; 246b5 ld hl, wcfa6 bit 7, [hl] jp z, xor_a_dec_a ld a, [wcf91] bit 2, a jp z, xor_a_dec_a - ld a, $10 + ld a, D_RIGHT scf ret ; 246c9 -Function246c9: ; 246c9 +.d_up: ; 246c9 ld hl, wcfa6 bit 7, [hl] jp z, xor_a ld hl, wd0e4 ld a, [hl] and a - jr z, .asm_246dc + jr z, .xor_dec_up dec [hl] jp xor_a -.asm_246dc +.xor_dec_up jp xor_a_dec_a ; 246df -Function246df: ; 246df +.d_down: ; 246df ld hl, wcfa6 bit 7, [hl] jp z, xor_a @@ -23141,11 +23176,11 @@ Function246df: ; 246df ld b, a ld a, [wd144] cp b - jr c, .asm_246f9 + jr c, .xor_dec_down inc [hl] jp xor_a -.asm_246f9 +.xor_dec_down jp xor_a_dec_a ; 246fc @@ -23159,19 +23194,20 @@ Function246fc: ; 246fc ; 24706 Function24706: ; 24706 (9:4706) - call Function1cfd - ld de, $14 + call GetMemTileCoord + ld de, SCREEN_WIDTH add hl, de - ld de, $28 + ld de, 2 * SCREEN_WIDTH ld a, [wcf92] .asm_24713 - ld [hl], $7f + ld [hl], " " add hl, de dec a jr nz, .asm_24713 ret Function2471a: ; 2471a +; Get the value of (wcf95):(wcf96,wcf97) and store it in wd144. ld hl, wcf96 ld a, [hli] ld h, [hl] @@ -23179,30 +23215,33 @@ Function2471a: ; 2471a ld a, [wcf95] call GetFarByte ld [wd144], a +; Store [wcf92] + [wd0e4] in c ld a, [wcf92] ld c, a ld a, [wd0e4] add c ld c, a +; If [wd144] > c, skip this next part. ld a, [wd144] inc a cp c - jr nc, .asm_24748 + jr nc, .skip +; If [wd144] > [wcf92], store ([wd144] - [wcf92]) in [wd0e4]. Else, store 0 in [wd0e4]. ld a, [wcf92] ld c, a ld a, [wd144] inc a sub c - jr nc, .asm_24745 + jr nc, .store xor a -.asm_24745 +.store ld [wd0e4], a -.asm_24748 +.skip ld a, [wd0e4] ld c, a - ld a, [wcf88] + ld a, [wPocketCursorBuffer] add c ld b, a ld a, [wd144] @@ -23215,7 +23254,7 @@ Function2471a: ; 2471a xor a ld [wd0e4], a ld a, $1 - ld [wcf88], a + ld [wPocketCursorBuffer], a .asm_24763 ret @@ -23226,10 +23265,10 @@ Function24764: ; 24764 ld c, a ld a, [wd144] ld b, a - ld a, [wcf82] + ld a, [wMenuBorderTopCoord] add $1 ld [wcfa1], a - ld a, [wcf83] + ld a, [wMenuBorderLeftCoord] add $0 ld [wcfa2], a ld a, [wcf92] @@ -23273,7 +23312,7 @@ Function24764: ; 24764 ld [wcfa8], a ld a, [wcfa3] ld b, a - ld a, [wcf88] + ld a, [wPocketCursorBuffer] and a jr z, .asm_247c8 cp b @@ -23318,15 +23357,15 @@ Function247f0: ; 247f0 ld a, [wd0e4] and a jr z, .asm_2480d - ld a, [wcf82] + ld a, [wMenuBorderTopCoord] ld b, a - ld a, [wcf85] + ld a, [wMenuBorderRightCoord] ld c, a call GetTileCoord ld [hl], $61 .asm_2480d - call Function1cfd + call GetMemTileCoord ld bc, $0015 add hl, bc ld a, [wcf92] @@ -23355,9 +23394,9 @@ Function247f0: ; 247f0 ld a, [wcf91] bit 4, a jr z, .asm_24850 - ld a, [wcf84] + ld a, [wMenuBorderBottomCoord] ld b, a - ld a, [wcf85] + ld a, [wMenuBorderRightCoord] ld c, a call GetTileCoord ld [hl], $ee @@ -23424,10 +23463,10 @@ Function2488b: ; 2488b add a add $1 ld c, a - ld a, [wcf82] + ld a, [wMenuBorderTopCoord] add c ld b, a - ld a, [wcf83] + ld a, [wMenuBorderLeftCoord] add $0 ld c, a call GetTileCoord @@ -23759,28 +23798,28 @@ Function24aab: ; 24aab (9:4aab) jr nz, Function24aab ret -Function24ab4: ; 0x24ab4 +PlaceMenuItemName: ; 0x24ab4 push de ld a, [MenuSelection] - ld [wd265], a + ld [wNamedObjectIndexBuffer], a call GetItemName pop hl call PlaceString ret ; 0x24ac3 -Function24ac3: ; 0x24ac3 +PlaceMenuItemQuantity: ; 0x24ac3 push de ld a, [MenuSelection] ld [CurItem], a callba _CheckTossableItem - ld a, [wd142] + ld a, [wItemAttributeParamBuffer] pop hl and a jr nz, .done ld de, $0015 add hl, de - ld [hl], $f1 + ld [hl], "×" inc hl ld de, wcf75 lb bc, 1, 2 @@ -23807,7 +23846,7 @@ Function24af8: ; 24af8 Function24b01: ; 24b01 call Function1cbb - call Function1cfd + call GetMemTileCoord ld de, $0015 add hl, de ld de, Money @@ -23832,7 +23871,8 @@ MenuDataHeader_0x24b1d: ; 0x24b1d db 1 ; default option ; 0x24b25 -Function24b25: ; 24b25 +Special_DisplayCoinCaseBalance: ; 24b25 + ; Place a text box of size 1x7 at 11, 0. hlcoord 11, 0 ld b, 1 ld c, 7 @@ -23841,7 +23881,7 @@ Function24b25: ; 24b25 ld de, CoinString call PlaceString hlcoord 17, 1 - ld de, String24b8e + ld de, ShowMoney_TerminatorString call PlaceString ld de, Coins lb bc, 2, 4 @@ -23850,10 +23890,10 @@ Function24b25: ; 24b25 ret ; 24b4e -Function24b4e: ; 24b4e +Special_DisplayMoneyAndCoinBalance: ; 24b4e hlcoord 5, 0 - ld b, $3 - ld c, $d + ld b, 3 + ld c, 13 call TextBox hlcoord 6, 1 ld de, MoneyString @@ -23876,7 +23916,7 @@ MoneyString: ; 24b83 db "MONEY@" CoinString: ; 24b89 db "COIN@" -String24b8e: ; 24b8e +ShowMoney_TerminatorString: ; 24b8e db "@" ; 24b8f @@ -23980,34 +24020,35 @@ String24c5e: ; 24c5e ; 24c64 -Function24c64: ; 24c64 +FindApricornsInBag: ; 24c64 +; Checks the bag for Apricorns. ld hl, Buffer1 xor a ld [hli], a dec a - ld bc, $000a + ld bc, 10 call ByteFill - ld hl, ApricornBalls -.asm_24c73 + ld hl, .ApricornBalls +.loop ld a, [hl] - cp $ff - jr z, .asm_24c8d + cp -1 + jr z, .done push hl ld [CurItem], a ld hl, NumItems call CheckItem pop hl - jr nc, .asm_24c89 + jr nc, .nope ld a, [hl] - call Function24c94 -.asm_24c89 + call .addtobuffer +.nope rept 2 inc hl endr - jr .asm_24c73 + jr .loop -.asm_24c8d +.done ld a, [Buffer1] and a ret nz @@ -24015,7 +24056,7 @@ endr ret ; 24c94 -Function24c94: ; 24c94 +.addtobuffer: ; 24c94 push hl ld hl, Buffer1 inc [hl] @@ -24027,7 +24068,7 @@ Function24c94: ; 24c94 ret ; 24ca0 -ApricornBalls: ; 24ca0 +.ApricornBalls: ; 24ca0 db RED_APRICORN, LEVEL_BALL db BLU_APRICORN, LURE_BALL db YLW_APRICORN, MOON_BALL @@ -24035,7 +24076,7 @@ ApricornBalls: ; 24ca0 db WHT_APRICORN, FAST_BALL db BLK_APRICORN, HEAVY_BALL db PNK_APRICORN, LOVE_BALL - db $ff + db -1 ; 24caf @@ -24111,10 +24152,10 @@ Function24d47: ; 24d47 inc a add a ld b, a - ld a, [wcf84] + ld a, [wMenuBorderBottomCoord] sub b inc a - ld [wcf82], a + ld [wMenuBorderTopCoord], a call Function1cbb ret ; 24d59 @@ -24154,7 +24195,7 @@ MonMenuLoop: ; 24d59 ; 24d91 PopulateMonMenu: ; 24d91 - call Function1cfd + call GetMemTileCoord ld bc, $002a ; 42 add hl, bc ld de, Buffer2 @@ -24204,7 +24245,7 @@ Function24dd4: ; 24dd4 ld a, [CurPartySpecies] cp EGG jr z, .egg - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .skip ld a, PartyMon1Moves - PartyMon1 @@ -24238,7 +24279,7 @@ Function24dd4: ; 24dd4 call Function24e83 ld a, $13 call Function24e83 - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .skip2 push hl @@ -24301,7 +24342,7 @@ Function24e68: ; 24e68 xor a ld [Buffer1], a ld hl, Buffer2 - ld bc, $0009 + ld bc, 9 call ByteFill ret ; 24e76 @@ -24312,7 +24353,7 @@ Function24e76: ; 24e76 ld d, $0 ld hl, Buffer2 add hl, de - ld [hl], $ff + ld [hl], -1 ret ; 24e83 @@ -24389,9 +24430,9 @@ LoadBattleMenu: ; 24ef2 ld hl, BattleMenuDataHeader call LoadMenuDataHeader ld a, [wd0d2] - ld [wcf88], a + ld [wPocketCursorBuffer], a call Function2039 - ld a, [wcf88] + ld a, [wPocketCursorBuffer] ld [wd0d2], a call ExitMenu ret @@ -24412,9 +24453,9 @@ ContestBattleMenu: ; 24f13 Function24f19: ; 24f19 ld a, [wd0d2] - ld [wcf88], a + ld [wPocketCursorBuffer], a call InterpretMenu - ld a, [wcf88] + ld a, [wPocketCursorBuffer] ld [wd0d2], a call ExitMenu ret @@ -24433,7 +24474,7 @@ MenuData_0x24f34: ; 0x24f34 db $81 ; flags dn 2, 2 ; rows, columns db 6 ; spacing - dbw BANK(Strings24f3d), Strings24f3d + dba Strings24f3d dbw $09, $0000 ; 0x24f3d @@ -24457,8 +24498,8 @@ MenuData_0x24f56: ; 24f56 db $81 ; flags dn 2, 2 ; rows, columns db 11 ; spacing - dbw BANK(Strings24f5f), Strings24f5f - dbw BANK(Function24f7c), Function24f7c + dba Strings24f5f + dba Function24f7c ; 24f5f Strings24f5f: ; 24f5f @@ -24489,8 +24530,8 @@ MenuData_0x24f91: ; 24f91 db $81 ; flags dn 2, 2 ; rows, columns db 12 ; spacing - dbw BANK(Strings24f9a), Strings24f9a - dbw BANK(Function24fb2), Function24fb2 + dba Strings24f9a + dba Function24fb2 ; 24f9a Strings24f9a: ; 24f9a @@ -24642,7 +24683,7 @@ Function2500e: ; 2500e Function25072: ; 25072 call Function1cbb - call Function1cfd + call GetMemTileCoord ld de, $0015 add hl, de ld [hl], $f1 @@ -24762,12 +24803,12 @@ Function25105: ; 25105 call Function2513b .asm_25117 call UpdateTime - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_25132 - ld a, [$ffa9] - and $2 + ld a, [hJoyLast] + and B_BUTTON jr nz, .asm_25132 call Function2518e call DelayFrame @@ -24786,12 +24827,12 @@ Function2513b: ; 2513b (9:513b) call DisableLCD callba Function8833e ld hl, CardRightCornerGFX - ld de, $91c0 + ld de, VTiles2 tile $1c ld bc, $10 ld a, BANK(CardRightCornerGFX) call FarCopyBytes ld hl, CardStatusGFX - ld de, $9290 + ld de, VTiles2 tile $29 ld bc, $60 + $500 ld a, BANK(CardStatusGFX) call FarCopyBytes @@ -24805,7 +24846,7 @@ Function2513b: ; 2513b (9:513b) call GetSGBLayout call Function32f9 call WaitBGMap - ld hl, wcf63 + ld hl, wJumptableIndex xor a rept 3 ld [hli], a @@ -24814,7 +24855,7 @@ endr ret Function2518e: ; 2518e (9:518e) - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, $0 ld hl, Jumptable_2519d @@ -24837,12 +24878,12 @@ Jumptable_2519d: ; 2519d (9:519d) Function251ab: ; 251ab (9:51ab) - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret Function251b0: ; 251b0 (9:51b0) - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret @@ -24853,7 +24894,7 @@ Function251b6: ; 251b6 (9:51b6) call Function253b0 call WaitBGMap ld de, CardStatusGFX - ld hl, $9290 + ld hl, VTiles2 tile $29 lb bc, BANK(CardStatusGFX), $6 + $50 call Request2bpp call Function2530a @@ -24862,14 +24903,14 @@ Function251b6: ; 251b6 (9:51b6) Function251d7: ; 251d7 (9:51d7) call Function25415 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $11 + and D_RIGHT | A_BUTTON jr nz, .asm_251e3 ret .asm_251e3 ld a, $2 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 251e9 (9:51e9) @@ -24878,7 +24919,7 @@ Function251e9: ; 251e9 and a ret z ld a, $4 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 251f4 @@ -24889,11 +24930,11 @@ Function251f4: ; 251f4 (9:51f4) call Function253b0 call WaitBGMap ld de, LeaderGFX - ld hl, $9290 + ld hl, VTiles2 tile $29 lb bc, BANK(LeaderGFX), $56 call Request2bpp ld de, BadgeGFX - ld hl, $8000 + ld hl, VTiles0 tile $00 lb bc, BANK(BadgeGFX), $2c call Request2bpp call Function2536c @@ -24903,17 +24944,17 @@ Function251f4: ; 251f4 (9:51f4) Function25221: ; 25221 (9:5221) ld hl, Unknown_254c9 call Function25438 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $1 + and A_BUTTON jr nz, Function25246 ld a, [hl] - and $20 + and D_LEFT jr nz, .asm_25235 ret .asm_25235 ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 2523b (9:523b) @@ -24922,13 +24963,13 @@ Function2523b: ; 2523b and a ret z ld a, $4 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 25246 Function25246: ; 25246 ld a, $6 - ld [wcf63], a + ld [wJumptableIndex], a ret Function2524c: ; 2524c (9:524c) @@ -24938,11 +24979,11 @@ Function2524c: ; 2524c (9:524c) call Function253b0 call WaitBGMap ld de, LeaderGFX2 - ld hl, $9290 + ld hl, VTiles2 tile $29 lb bc, BANK(LeaderGFX2), $56 call Request2bpp ld de, BadgeGFX2 - ld hl, $8000 + ld hl, VTiles0 tile $00 lb bc, BANK(BadgeGFX2), $2c call Request2bpp call Function2536c @@ -24952,21 +24993,21 @@ Function2524c: ; 2524c (9:524c) Function25279: ; 25279 (9:5279) ld hl, Unknown_254c9 call Function25438 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $20 + and D_LEFT jr nz, .asm_2528d ld a, [hl] - and $10 + and D_RIGHT jr nz, .asm_25293 ret .asm_2528d ld a, $2 - ld [wcf63], a + ld [wJumptableIndex], a ret .asm_25293 ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret Function25299: ; 25299 (9:5299) @@ -25364,7 +25405,7 @@ ProfOaksPC: ; 0x265d3 .shutdown ld hl, OakPCText4 call PrintText - call Functiona36 + call JoyWaitAorB call ExitMenu ret ; 0x265ee @@ -25374,7 +25415,7 @@ ProfOaksPCBoot ; 0x265ee call PrintText call Rate call PlaySFX ; sfx loaded by previous Rate function call - call Functiona36 + call JoyWaitAorB call WaitSFX ret ; 0x26601 @@ -25386,7 +25427,7 @@ Function26601: ; 0x26601 call PlayMusic pop de call PlaySFX - call Functiona36 + call JoyWaitAorB call WaitSFX ret ; 0x26616 @@ -25406,7 +25447,7 @@ Rate: ; 0x26616 call ClearOakRatingBuffers ld hl, OakPCText3 call PrintText - call Functiona36 + call JoyWaitAorB ld a, [wd003] ld hl, OakRatings call FindOakRating @@ -25429,7 +25470,7 @@ ClearOakRatingBuffers: ; 0x26647 ClearOakRatingBuffer: ; 0x2665a push hl ld a, "@" - ld bc, $000d + ld bc, ITEM_NAME_LENGTH call ByteFill pop hl lb bc, PRINTNUM_RIGHTALIGN | 1, 3 @@ -25654,7 +25695,7 @@ _KrisDecorationMenu: ; 0x2675c ld [wd1ef], a .asm_2676f ld a, [wd1ef] - ld [wcf88], a + ld [wPocketCursorBuffer], a call Function26806 call Function1e5d ld a, [wcfa9] @@ -25727,8 +25768,8 @@ Function26822: ; 26822 (9:6822) ld hl, StringBuffer2 xor a ld [hli], a - ld bc, $c - ld a, $ff + ld bc, ITEM_NAME_LENGTH - 1 + ld a, -1 call ByteFill ret @@ -26045,7 +26086,7 @@ MenuData2_0x269cd: ; 0x269cd db 8, 0 ; rows, columns db 1 ; horizontal spacing dbw 0, wd002 ; text pointer - dbw BANK(DecorationMenuFunction), DecorationMenuFunction + dba DecorationMenuFunction dbw 0, 0 dbw 0, 0 ; 269dd @@ -27131,7 +27172,7 @@ Function27192: ; 27192 ld a, [hBattleTurn] and a jr nz, .ourturn - ld a, [IsInBattle] + ld a, [wBattleMode] dec a jr z, .done @@ -27201,7 +27242,7 @@ LinkCommunications: ; 28000 call ClearScreen call UpdateSprites call Functione51 - call Functione58 + call LoadFontsBattleExtra callba Function16d69a call Function3200 hlcoord 3, 8 @@ -27219,8 +27260,8 @@ LinkCommunications: ; 28000 xor a ld [hli], a ld [hl], $50 - ld a, [InLinkBattle] - cp $1 + ld a, [wLinkMode] + cp LINK_TIMECAPSULE jp nz, Function28177 Function2805d: ; 2805d @@ -27417,8 +27458,8 @@ Function28177: ; 28177 ld de, wc6d0 ld bc, $00c8 call Function75f - ld a, [InLinkBattle] - cp $2 + ld a, [wLinkMode] + cp LINK_TRADECENTER jr nz, .asm_281fd ld hl, wc9f4 ld de, wcb84 @@ -27468,8 +27509,8 @@ Function28177: ; 28177 ld hl, wc90f dec c jr nz, .asm_28224 - ld a, [InLinkBattle] - cp $2 + ld a, [wLinkMode] + cp LINK_TRADECENTER jp nz, .asm_282fe ld hl, wcb84 .asm_28254 @@ -27602,8 +27643,8 @@ Function28177: ; 28177 cp $2 ld c, 66 call z, DelayFrames - ld a, [InLinkBattle] - cp $3 + ld a, [wLinkMode] + cp LINK_COLOSSEUM jr nz, .asm_283a9 ld a, CAL ld [OtherTrainerClass], a @@ -27617,7 +27658,7 @@ Function28177: ; 28177 ld [hl], a ld hl, wd26b ld de, OTName - ld bc, $000b + ld bc, NAME_LENGTH call CopyBytes call Function222a ld a, [wc2d7] @@ -27785,8 +27826,8 @@ endr dec a jr nz, .asm_2847f push bc - ld a, [InLinkBattle] - cp $1 + ld a, [wLinkMode] + cp LINK_TIMECAPSULE ld b, $d jr z, .asm_2847a ld b, $27 @@ -28016,8 +28057,8 @@ Function28595: ; 28595 ld hl, PartyMonNicknames ld bc, $0042 call CopyBytes - ld a, [InLinkBattle] - cp $2 + ld a, [wLinkMode] + cp LINK_TRADECENTER ret nz ld de, wc9f4 ld a, $20 @@ -28559,7 +28600,7 @@ Function28926: ; 28926 .asm_28946 ld a, $7f - ldcoord 11, 16 + ldcoord_a 11, 16 ld a, $13 ld [wcfa8], a ld a, $1 @@ -28591,7 +28632,7 @@ Function28926: ; 28926 .asm_2898d ld a, $7f - ldcoord 1, 16 + ldcoord_a 1, 16 ld a, $23 ld [wcfa8], a ld a, $1 @@ -28737,17 +28778,17 @@ Function28ac9: ; 28ac9 Function28ade: ; 28ade .asm_28ade ld a, $ed - ldcoord 9, 17 + ldcoord_a 9, 17 .asm_28ae3 - call Functiona57 - ld a, [$ffa9] + call JoyTextDelay + ld a, [hJoyLast] and a jr z, .asm_28ae3 bit 0, a jr nz, .asm_28b0b push af - ld a, $7f - ldcoord 9, 17 + ld a, " " + ldcoord_a 9, 17 pop af bit 6, a jr z, .asm_28b03 @@ -28762,7 +28803,7 @@ Function28ade: ; 28ade .asm_28b0b ld a, $ec - ldcoord 9, 17 + ldcoord_a 9, 17 ld a, $f ld [wcf56], a callba Function16d6ce @@ -28790,12 +28831,12 @@ Function28b22: ; 28b22 Function28b42: ; 28b42 hlcoord 0, 16 - ld a, $7e - ld bc, $0028 + ld a, "┘" + ld bc, 2 * SCREEN_WIDTH call ByteFill hlcoord 1, 16 - ld a, $7f - ld bc, SCREEN_HEIGHT + ld a, " " + ld bc, SCREEN_WIDTH - 2 call ByteFill hlcoord 2, 16 ld de, String_28b61 @@ -29076,7 +29117,7 @@ Function28b87: ; 28b87 ld c, $64 call DelayFrames call ClearTileMap - call Functione58 + call LoadFontsBattleExtra ld b, $8 call GetSGBLayout ld a, [$ffcb] @@ -29136,8 +29177,8 @@ Function28b87: ; 28b87 push bc call Function862 pop bc - ld a, [InLinkBattle] - cp $1 + ld a, [wLinkMode] + cp LINK_TIMECAPSULE jr z, .asm_28e63 ld a, b and a @@ -29148,7 +29189,7 @@ Function28b87: ; 28b87 .asm_28e63 callba Function14a58 - callba Function1060af + callba MobileFn_1060af callba Function106187 ld c, $28 call DelayFrames @@ -29162,8 +29203,8 @@ Function28b87: ; 28b87 callba Function4d354 ld c, $32 call DelayFrames - ld a, [InLinkBattle] - cp $1 + ld a, [wLinkMode] + cp LINK_TIMECAPSULE jp z, Function2805d jp Function28177 ; 28ea3 @@ -29359,12 +29400,12 @@ Function28fa1: ; 28fa1 Function28fdb: ; 28fdb xor a - ld [wcf63], a + ld [wJumptableIndex], a call WhiteBGMap call ClearSprites call ClearTileMap call DisableLCD - call Functione58 + call LoadFontsBattleExtra callab Function8cf53 ld a, [hCGB] and a @@ -29372,7 +29413,7 @@ Function28fdb: ; 28fdb ld a, $1 ld [rVBK], a ld hl, VTiles0 - ld bc, $2000 + ld bc, sScratch - VTiles0 xor a call ByteFill ld a, $0 @@ -29380,19 +29421,19 @@ Function28fdb: ; 28fdb .asm_2900b ld hl, VBGMap0 - ld bc, $0800 - ld a, $7f + ld bc, sScratch - VBGMap0 + ld a, " " call ByteFill ld hl, TradeGameBoyLZ - ld de, $9310 + ld de, VTiles2 tile $31 call Decompress ld hl, TradeArrowGFX - ld de, $8ed0 + ld de, VTiles1 tile $6d ld bc, $0010 ld a, BANK(TradeArrowGFX) call FarCopyBytes ld hl, TradeArrowGFX + $10 - ld de, $8ee0 + ld de, VTiles1 tile $6e ld bc, $0010 ld a, BANK(TradeArrowGFX) call FarCopyBytes @@ -29412,7 +29453,7 @@ Function28fdb: ; 28fdb call Function29491 ld a, [wc702] ld hl, wc72f - ld de, $8310 + ld de, VTiles0 tile $31 call Function29491 ld a, [wc6d0] ld de, wc6d1 @@ -29425,7 +29466,7 @@ Function28fdb: ; 28fdb ; 29082 Function29082: ; 29082 - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_2909b call Function290a0 @@ -29443,7 +29484,7 @@ Function29082: ; 29082 ; 290a0 Function290a0: ; 290a0 - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, JumpTable290af @@ -29508,7 +29549,7 @@ JumpTable290af: ; 290af ; 2910f Function2910f: ; 2910f - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret ; 29114 @@ -29519,7 +29560,7 @@ Function29114: ; 29114 inc hl ld d, [hl] ld a, [de] - ld [wcf63], a + ld [wJumptableIndex], a inc de ld [hl], d dec hl @@ -29528,7 +29569,7 @@ Function29114: ; 29114 ; 29123 Function29123: ; 29123 - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret ; 29129 @@ -29689,8 +29730,8 @@ Function29229: ; 29229 call DisableLCD callab Function8cf53 ld hl, VBGMap0 - ld bc, $0800 - ld a, $7f + ld bc, sScratch - VBGMap0 + ld a, " " call ByteFill xor a ld [hSCX], a @@ -29813,12 +29854,12 @@ Function292f6: ; 292f6 push af call WhiteBGMap call WaitTop - ld a, $9c - ld [$ffd7], a + ld a, VBGMap1 / $100 + ld [hBGMapAddress + 1], a call ClearTileMap hlcoord 0, 0 ld bc, SCREEN_WIDTH - ld a, $7a + ld a, "─" call ByteFill hlcoord 0, 1 ld de, wc736 @@ -29827,7 +29868,7 @@ Function292f6: ; 292f6 ld de, 0 .asm_2931e ld a, [hli] - cp $50 + cp "@" jr z, .asm_29326 dec de jr .asm_2931e @@ -29843,8 +29884,8 @@ Function292f6: ; 292f6 call ByteFill call WaitBGMap call WaitTop - ld a, $98 - ld [$ffd7], a + ld a, VBGMap0 / $100 + ld [hBGMapAddress + 1], a call ClearTileMap ret ; 29348 @@ -29954,8 +29995,8 @@ Function293de: ; 293de Function293ea: ; 293ea call WaitTop - ld a, $9c - ld [$ffd7], a + ld a, VBGMap1 / $100 + ld [hBGMapAddress + 1], a call WaitBGMap ld a, $7 ld [hWX], a @@ -29963,8 +30004,8 @@ Function293ea: ; 293ea ld [hWY], a call DelayFrame call WaitTop - ld a, $98 - ld [$ffd7], a + ld a, VBGMap0 / $100 + ld [hBGMapAddress + 1], a call ClearTileMap call Function2910f ret @@ -29979,15 +30020,15 @@ Function2940c: ; 2940c ret .asm_29417 - ld a, $9c - ld [$ffd7], a + ld a, VBGMap1 / $100 + ld [hBGMapAddress + 1], a call WaitBGMap ld a, $7 ld [hWX], a ld a, $90 ld [hWY], a - ld a, $98 - ld [$ffd7], a + ld a, VBGMap0 / $100 + ld [hBGMapAddress + 1], a call Function29114 ret ; 2942e @@ -30070,7 +30111,7 @@ Function294bb: ; 294bb jr Function294c3 Function294c0: ; 294c0 - ld de, $8310 + ld de, VTiles0 tile $31 Function294c3: ; 294c3 call DelayFrame @@ -30173,8 +30214,8 @@ Function29549: ; 29549 Function29573: ; 29573 call WaitTop call Function297cf - ld a, $9c - ld [$ffd7], a + ld a, VBGMap1 / $100 + ld [hBGMapAddress + 1], a hlcoord 3, 0 ld b, $6 ld c, $d @@ -30195,8 +30236,8 @@ String29591: ; 29591 Function295a1: ; 295a1 call WaitTop call Function297cf - ld a, $9c - ld [$ffd7], a + ld a, VBGMap1 / $100 + ld [hBGMapAddress + 1], a hlcoord 3, 0 ld b, $6 ld c, $d @@ -30217,8 +30258,8 @@ String295c2: ; 295c2 Function295d8: ; 295d8 call WaitBGMap call WaitTop - ld a, $98 - ld [$ffd7], a + ld a, VBGMap0 / $100 + ld [hBGMapAddress + 1], a ret ; 295e3 @@ -30429,8 +30470,8 @@ Function296f2: ; 296f2 (a:56f2) ; 29701 (a:5701) Function29701: ; 29701 - ld a, [InLinkBattle] - cp $1 + ld a, [wLinkMode] + cp LINK_TIMECAPSULE jr z, .asm_29725 ld hl, UnknownText_0x29737 call PrintText @@ -30490,8 +30531,8 @@ UnknownText_0x29757: ; 0x29757 Function2975c: ; 2975c call WaitTop hlcoord 0, 10 - ld bc, $00a0 - ld a, $7f + ld bc, 8 * SCREEN_WIDTH + ld a, " " call ByteFill call WaitBGMap ld hl, UnknownText_0x2977a @@ -30566,7 +30607,7 @@ Function297c9: ; 297c9 Function297cf: ; 297cf hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - ld a, $7f + ld a, " " call ByteFill ret ; 297db @@ -30637,15 +30678,15 @@ Function2981d: ; 2981d Function2982b: ; 2982b call DelayFrame ld de, TradeBallGFX - ld hl, $8620 + ld hl, VTiles0 tile $62 lb bc, BANK(TradeBallGFX), $6 call Request2bpp ld de, TradePoofGFX - ld hl, $8680 + ld hl, VTiles0 tile $68 lb bc, BANK(TradePoofGFX), $c call Request2bpp ld de, TradeCableGFX - ld hl, $8740 + ld hl, VTiles0 tile $74 lb bc, BANK(TradeCableGFX), $4 call Request2bpp xor a @@ -30660,7 +30701,7 @@ Function2985a: ; 2985a ld e, $3 callab Function8e83f ld de, TradeBubbleGFX - ld hl, $8720 + ld hl, VTiles0 tile $72 lb bc, BANK(TradeBubbleGFX), $4 call Request2bpp xor a @@ -30865,14 +30906,14 @@ Special_EnterTimeCapsule: ; 29c7b xor a ld [hVBlank], a inc a - ld [InLinkBattle], a + ld [wLinkMode], a ret ; 29c92 Special_AbortLink: ; 29c92 ld c, $3 call DelayFrames - ld a, $ff + ld a, -1 ld [$ffcb], a xor a ld [rSB], a @@ -30898,7 +30939,7 @@ Special_AbortLink: ; 29c92 ld [rSC], a ld c, $3 call DelayFrames - ld a, $ff + ld a, -1 ld [$ffcb], a ld a, [rIF] push af @@ -30913,7 +30954,7 @@ Special_AbortLink: ; 29c92 ld [hli], a ld [hl], a ld [hVBlank], a - ld [InLinkBattle], a + ld [wLinkMode], a ret ; 29ce8 @@ -30973,7 +31014,7 @@ Special_WaitForLinkedFriend: ; 29d11 jr z, .asm_29d79 cp $1 jr z, .asm_29d79 - ld a, $ff + ld a, -1 ld [$ffcb], a ld a, $2 ld [rSB], a @@ -31185,7 +31226,7 @@ Special_CheckBothSelectedSameRoom: ; 29e82 jr nz, .asm_29eaa ld a, [wd265] inc a - ld [InLinkBattle], a + ld [wLinkMode], a xor a ld [hVBlank], a ld a, $1 @@ -31199,33 +31240,33 @@ Special_CheckBothSelectedSameRoom: ; 29e82 ; 29eaf Special_TimeCapsule: ; 29eaf - ld a, $1 - ld [InLinkBattle], a - call Function2ed3 + ld a, LINK_TIMECAPSULE + ld [wLinkMode], a + call DisableSpriteUpdates callab LinkCommunications - call Function2ee4 + call EnableSpriteUpdates xor a ld [hVBlank], a ret ; 29ec4 Special_TradeCenter: ; 29ec4 - ld a, $2 - ld [InLinkBattle], a - call Function2ed3 + ld a, LINK_TRADECENTER + ld [wLinkMode], a + call DisableSpriteUpdates callab LinkCommunications - call Function2ee4 + call EnableSpriteUpdates xor a ld [hVBlank], a ret ; 29ed9 Special_Colosseum: ; 29ed9 - ld a, $3 - ld [InLinkBattle], a - call Function2ed3 + ld a, LINK_COLOSSEUM + ld [wLinkMode], a + call DisableSpriteUpdates callab LinkCommunications - call Function2ee4 + call EnableSpriteUpdates xor a ld [hVBlank], a ret @@ -31233,7 +31274,7 @@ Special_Colosseum: ; 29ed9 Special_CloseLink: ; 29eee xor a - ld [InLinkBattle], a + ld [wLinkMode], a ld c, $3 call DelayFrames jp Function29f04 @@ -31249,7 +31290,7 @@ Special_FailedLinkToPast: ; 29efa Function29f04: ; 29f04 ld c, $3 call DelayFrames - ld a, $ff + ld a, -1 ld [$ffcb], a ld a, $2 ld [rSB], a @@ -31696,7 +31737,7 @@ endr CheckRepelEffect:: ; 2a1df ; If there is no active Repel, there's no need to be here. - ld a, [wdca1] + ld a, [wRepelEffect] and a jr z, .encounter ; Get the first Pokemon in your party that isn't fainted. @@ -32419,23 +32460,23 @@ Function2b930: ; 2b930 jr nc, .asm_2b97f .asm_2b976 - ld a, [wd0ee] + ld a, [wBattleResult] and $f0 - ld [wd0ee], a + ld [wBattleResult], a ret .asm_2b97f - ld a, [wd0ee] + ld a, [wBattleResult] and $f0 add $1 - ld [wd0ee], a + ld [wBattleResult], a ret .asm_2b98a - ld a, [wd0ee] + ld a, [wBattleResult] and $f0 add $2 - ld [wd0ee], a + ld [wBattleResult], a ret ; 2b995 @@ -32563,7 +32604,7 @@ Function2c000: ; 2c000 ld [rOBP0], a call Function2c165 call Function2c01c - ld a, [IsInBattle] + ld a, [wBattleMode] dec a ret z jp Function2c03a @@ -32704,7 +32745,7 @@ Function2c0c5: ; 2c0c5 hlcoord 1, 2 ld de, 1 call Function2c0f1 - ld a, [IsInBattle] + ld a, [wBattleMode] dec a ret nz ld a, [TempEnemyMonSpecies] @@ -32760,7 +32801,7 @@ Function2c10d: ; 2c10d ld de, OTPartyCount call Function2c059 ld hl, wcfc4 - ld a, $50 + ld a, "@" ld [hli], a ld [hl], $68 ld hl, Sprites + $18 @@ -32770,7 +32811,7 @@ Function2c10d: ; 2c10d Function2c143: ; 2c143 ld de, Buffer1 ld c, $6 -.asm_2c148 +.loop ld a, [wcfc5] ld [hli], a ld a, [wcfc4] @@ -32786,13 +32827,13 @@ Function2c143: ; 2c143 ld [wcfc4], a inc de dec c - jr nz, .asm_2c148 + jr nz, .loop ret ; 2c165 Function2c165: ; 2c165 ld de, GFX_2c172 - ld hl, $8310 + ld hl, VTiles0 tile $31 lb bc, BANK(GFX_2c172), 4 call Functiondc9 ret @@ -32802,24 +32843,24 @@ GFX_2c172: ; 2c172 INCBIN "gfx/battle/balls.2bpp" ; 2c1b2 -Function2c1b2: ; 2c1b2 +_ShowLinkBattleParticipants: ; 2c1b2 call WhiteBGMap call Functione5f hlcoord 2, 3 - ld b, $9 - ld c, $e + ld b, 9 + ld c, 14 call TextBox hlcoord 4, 5 ld de, PlayerName call PlaceString hlcoord 4, 10 - ld de, wd26b + ld de, OTPlayerName call PlaceString hlcoord 9, 8 ld a, $69 ld [hli], a ld [hl], $6a - callba Function2c10d + callba Function2c10d ; no need to callba ld b, $8 call GetSGBLayout call Function32f9 @@ -33335,10 +33376,10 @@ Unknown_2c74a: ; 2c74a Function2c76f: ; 2c76f (b:476f) ld a, $1 - ld [$ffaa], a + ld [hInMenu], a call Function2c8d3 ld a, $0 - ld [$ffaa], a + ld [hInMenu], a ret nc call Function1bee call WaitBGMap @@ -33483,7 +33524,7 @@ Function2c867: ; 2c867 and a jr z, .nope - callba Function106049 + callba MobileFn_106049 ld a, [CurItem] call IsHM ret c @@ -33556,7 +33597,7 @@ Function2c8d3: ; 2c8d3 (b:48d3) ld [wcfa7], a ld a, $f3 ld [wcfa8], a - ld a, [wd0dc] + ld a, [wTMHMPocketCursor] inc a ld [wcfa9], a ld a, $1 @@ -33569,7 +33610,7 @@ Function2c915: ; 2c915 (b:4915) ld b, a ld a, [wcfa9] dec a - ld [wd0dc], a + ld [wTMHMPocketCursor], a xor a ld [hBGMapMode], a ; $ff00+$d4 ld a, [wcfa6] @@ -34090,11 +34131,14 @@ ConvertBerriesToBerryJuice: ; 2ede6 ret ; 2ee18 -Function2ee18: ; 2ee18 - ld a, [InLinkBattle] +ShowLinkBattleParticipants: ; 2ee18 +; If we're not in a communications room, +; we don't need to be here. + ld a, [wLinkMode] and a ret z - callba Function2c1b2 + + callba _ShowLinkBattleParticipants ld c, 150 call DelayFrames call ClearTileMap @@ -34103,27 +34147,28 @@ Function2ee18: ; 2ee18 ; 2ee2f -Function2ee2f: ; 2ee2f +FindFirstAliveMon: ; 2ee2f xor a ld [$ffde], a call DelayFrame ld b, 6 ld hl, PartyMon1HP ld de, PartyMon2 - PartyMon1 - 1 -.asm_2ee3d + +.loop ld a, [hli] or [hl] - jr nz, .asm_2ee45 + jr nz, .okay add hl, de dec b - jr nz, .asm_2ee3d + jr nz, .loop -.asm_2ee45 +.okay ld de, PartyMon1Level - PartyMon1HP add hl, de ld a, [hl] ld [BattleMonLevel], a - predef Function8c20f + predef Predef_StartBattle callba Function3ed9f ld a, 1 ld [hBGMapMode], a @@ -34215,7 +34260,7 @@ PlayBattleMusic: ; 2ee6c jr .done .othertrainer - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .johtotrainer @@ -34244,7 +34289,7 @@ PlayBattleMusic: ; 2ee6c ClearBattleRAM: ; 2ef18 xor a ld [wd0ec], a - ld [wd0ee], a + ld [wBattleResult], a ld hl, wd0d8 rept 3 @@ -34283,7 +34328,7 @@ endr callab ResetEnemyStatLevels - call Function1fbf + call ResetTextRelatedRAM ld hl, hBGMapAddress xor a @@ -34378,7 +34423,7 @@ GetTrainerClassName: ; 3952d ld [CurSpecies], a ld a, TRAINER_NAME - ld [wcf61], a + ld [wNamedObjectTypeBuffer], a call GetName ld de, StringBuffer1 ret @@ -34394,7 +34439,7 @@ GetTrainerClassName: ; 3952d Function39550: ; 39550 ld hl, wd26b - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jr nz, .ok @@ -34405,12 +34450,12 @@ Function39550: ; 39550 ld [CurSpecies], a ld a, TRAINER_NAME - ld [wcf61], a + ld [wNamedObjectTypeBuffer], a call GetName ld hl, StringBuffer1 .ok - ld bc, $000d + ld bc, TRAINER_CLASS_NAME_LENGTH ld de, OTName push de call CopyBytes @@ -34425,7 +34470,7 @@ Function3957b: ; 3957b ld a, [TrainerClass] dec a ld hl, TrainerClassAttributes - ld bc, 7 + ld bc, NUM_TRAINER_ATTRIBUTES call AddNTimes ld de, wc650 ld a, [hli] @@ -34446,7 +34491,7 @@ ReadTrainerParty: ; 39771 bit 0, a ret nz - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ret nz @@ -34878,7 +34923,7 @@ Function41a7f: ; 41a7f ld [hl], $3b inc hl ld bc, $0013 - ld a, $7f + ld a, " " call ByteFill callba Function4424d call EnableLCD @@ -35000,7 +35045,7 @@ endr cp EVOLVE_TRADE jr z, .trade - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jp nz, .asm_423f9 @@ -35077,7 +35122,7 @@ endr .trade - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jp z, .asm_423f9 @@ -35089,8 +35134,8 @@ endr inc a jr z, .asm_422fd - ld a, [InLinkBattle] - cp $1 + ld a, [wLinkMode] + cp LINK_TIMECAPSULE jp z, .asm_423fa ld a, [TempMonItem] @@ -35112,7 +35157,7 @@ endr ld a, [wd1e9] and a jp z, .asm_423fa - ld a, [InLinkBattle] + ld a, [wLinkMode] and a jp nz, .asm_423fa jr .asm_422fd @@ -35179,7 +35224,7 @@ endr push hl ld hl, UnknownText_0x42478 call PrintTextBoxText - callba Function106094 + callba MobileFn_106094 ld de, MUSIC_NONE call PlayMusic @@ -35273,10 +35318,10 @@ Function423ff: ; 423ff pop de pop bc pop hl - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ret nz - ld a, [IsInBattle] + ld a, [wBattleMode] and a ret nz ld a, [wd268] @@ -35622,11 +35667,11 @@ AIChooseMove: ; 440ce ; Pick the move with the lowest score. ; Wildmons attack at random. - ld a, [IsInBattle] + ld a, [wBattleMode] dec a ret z - ld a, [InLinkBattle] + ld a, [wLinkMode] and a ret nz @@ -35976,7 +36021,7 @@ endr lb bc, 2, 36 call PrintNum hlcoord 14, 7 - ld [hl], $5e + ld [hl], "" pop af pop hl @@ -35991,7 +36036,7 @@ endr ld e, h ld a, e or d - jr z, .asm_442cd + jr z, .skip push de ld hl, [sp+$0] ld d, h @@ -36001,8 +36046,8 @@ endr call PrintNum pop de -.asm_442cd - ld bc, $0512 +.skip + lb bc, 5, SCREEN_WIDTH - 2 hlcoord 2, 11 call ClearBox hlcoord 1, 10 @@ -36010,13 +36055,13 @@ endr ld a, $61 call ByteFill hlcoord 1, 9 - ld [hl], $55 + ld [hl], "" inc hl - ld [hl], $55 + ld [hl], "" hlcoord 1, 10 - ld [hl], $56 + ld [hl], "<......>" inc hl - ld [hl], $57 + ld [hl], "" pop de inc de pop af @@ -36029,7 +36074,7 @@ endr ret z push bc push de - ld bc, $0512 + lb bc, 5, SCREEN_WIDTH - 2 hlcoord 2, 11 call ClearBox hlcoord 1, 10 @@ -36037,13 +36082,13 @@ endr ld a, $61 call ByteFill hlcoord 1, 9 - ld [hl], $55 + ld [hl], "" inc hl - ld [hl], $55 + ld [hl], "" hlcoord 1, 10 - ld [hl], $56 + ld [hl], "<......>" inc hl - ld [hl], $58 + ld [hl], "" pop de inc de pop af @@ -36101,25 +36146,25 @@ Function44355: ; 44355 push hl ld h, d ld l, e -.asm_4435b +.loop1 ld a, b call GetFarByte inc hl - cp $50 - jr nz, .asm_4435b + cp "@" + jr nz, .loop1 rept 4 inc hl endr dec c - jr z, .asm_44374 -.asm_4436b + jr z, .done +.loop2 ld a, b call GetFarByte inc hl - cp $50 - jr nz, .asm_4436b + cp "@" + jr nz, .loop2 -.asm_44374 +.done ld d, h ld e, l pop hl @@ -36140,23 +36185,23 @@ Function4456e: ; 4456e call Function44648 cp $a jr nc, .asm_445be - ld bc, $002f - ld hl, s0_a834 + 1 + ld bc, PartyMon1StatsEnd - PartyMon1Item + ld hl, s0_a835 call AddNTimes ld d, h ld e, l ld a, [CurPartyMon] - ld bc, $002f + ld bc, PartyMon1StatsEnd - PartyMon1Item ld hl, s0_a600 call AddNTimes push hl ld a, BANK(s0_a834) call GetSRAMBank - ld bc, $002f + ld bc, PartyMon1StatsEnd - PartyMon1Item call CopyBytes pop hl xor a - ld bc, $002f + ld bc, PartyMon1StatsEnd - PartyMon1Item call ByteFill ld a, PartyMon1Item - PartyMon1 call GetPartyParamLocation @@ -36177,42 +36222,42 @@ Function445c0: ; 445c0 (11:45c0) call GetSRAMBank ld a, b push bc - ld hl, s0_a834 + 1 - ld bc, $2f + ld hl, s0_a835 + ld bc, PartyMon1StatsEnd - PartyMon1Item call AddNTimes push hl add hl, bc pop de pop bc -.asm_445d4 +.loop ld a, b cp $9 - jr z, .asm_445e4 + jr z, .done push bc - ld bc, $2f + ld bc, PartyMon1StatsEnd - PartyMon1Item call CopyBytes pop bc inc b - jr .asm_445d4 -.asm_445e4 + jr .loop +.done ld h, d ld l, e xor a - ld bc, $2f + ld bc, PartyMon1StatsEnd - PartyMon1Item call ByteFill ld hl, s0_a834 dec [hl] jp CloseSRAM ; 445f4 (11:45f4) -Function445f4: ; 445f4 +ReadMailMessage: ; 445f4 ld a, b - ld hl, s0_a834 + 1 - ld bc, $2f + ld hl, s0_a835 + ld bc, PartyMon1StatsEnd - PartyMon1Item call AddNTimes ld d, h ld e, l - callba Functionb9237 + callba ReadAnyMail ret Function44607: ; 44607 @@ -36220,22 +36265,22 @@ Function44607: ; 44607 call GetSRAMBank push bc ld a, b - ld bc, $2f - ld hl, s0_a834 + 1 + ld bc, PartyMon1StatsEnd - PartyMon1Item + ld hl, s0_a835 call AddNTimes push hl ld a, [CurPartyMon] - ld bc, $2f + ld bc, PartyMon1StatsEnd - PartyMon1Item ld hl, s0_a600 call AddNTimes ld d, h ld e, l pop hl push hl - ld bc, $2f + ld bc, PartyMon1StatsEnd - PartyMon1Item call CopyBytes pop hl - ld de, $2e + ld de, PartyMon1StatsEnd - PartyMon1Moves add hl, de ld d, [hl] ld a, [CurPartyMon] @@ -36274,7 +36319,7 @@ Function44654:: ; 44654 call GetSRAMBank ld a, [CurPartyMon] ld hl, s0_a600 - ld bc, $002f + ld bc, PartyMon1StatsEnd - PartyMon1Item call AddNTimes ld d, h ld e, l @@ -36288,7 +36333,7 @@ Function44654:: ; 44654 ld c, a ld a, b call GetFarByte - cp $50 + cp "@" jr z, .asm_446ab cp c ld a, $0 @@ -36485,7 +36530,7 @@ InitMail: ; 0x447b9 Function447da: ; 0x447da dec a - ld hl, s0_a834 + 1 + $21 + ld hl, s0_a835 + $21 ld bc, $002f call AddNTimes ld a, BANK(s0_a834) @@ -36523,7 +36568,7 @@ Function44806: ; 0x44806 call Function352f call UpdateSprites ld a, [wd0f1] - ld [wcf88], a + ld [wPocketCursorBuffer], a ld a, [OBPals + 8 * 6] ld [wd0e4], a call Function350c @@ -36568,7 +36613,7 @@ Function4484a: ; 0x4484a ld a, [MenuSelection] dec a ld b, a - call Function445f4 + call ReadMailMessage jp Function2b3c ; 0x44877 @@ -36615,7 +36660,7 @@ Function4484a: ; 0x4484a ld a, BANK(s0_a834) call GetSRAMBank pop af - ld hl, s0_a834 + 1 + $2e + ld hl, s0_a835 + $2e ld bc, $002f call AddNTimes ld a, [hl] @@ -36695,7 +36740,7 @@ MenuData4494c: ; 0x4494c db 4, 0 ; rows/columns? db 1 ; horizontal spacing? dbw 0,wd0f2 ; text pointer - dbw BANK(Function447fb), Function447fb + dba Function447fb dbw 0,0 dbw 0,0 @@ -36729,6 +36774,7 @@ Function48000: ; 48000 ld [wd478], a ld [DefaultFlypoint], a ld [wd003], a + ; could have done "ld a, [wd479] \ and -4", saved four operations ld a, [wd479] res 0, a ld [wd479], a @@ -36763,11 +36809,11 @@ Function4802f: ; 4802f (12:402f) call Function486bf call Functione5f ld de, GFX_488c3 - ld hl, $9100 + ld hl, VTiles2 tile $10 lb bc, BANK(GFX_488c3), 1 call Request1bpp ld de, GFX_488cb - ld hl, $9110 + ld hl, VTiles2 tile $11 lb bc, BANK(GFX_488cb), 1 call Request1bpp call Function4a3a7 @@ -37041,7 +37087,7 @@ asm_4828d: ; 4828d (12:428d) call WaitBGMap ld a, [PlayerGender] inc a - ld [wcf88], a + ld [wPocketCursorBuffer], a call Function1bc9 call PlayClickSFX call ExitMenu @@ -37085,7 +37131,7 @@ Function48304: ; 48304 (12:4304) ld b, $c ld c, $8 call Function48cdc - ld a, [wcf88] + ld a, [wPocketCursorBuffer] ld b, a ld a, [wd0e4] ld c, a @@ -37096,7 +37142,7 @@ Function48304: ; 48304 (12:4304) jr c, .asm_4833f sub $29 inc a - ld [wcf88], a + ld [wPocketCursorBuffer], a ld a, $29 .asm_4833f ld [wd0e4], a @@ -37109,7 +37155,7 @@ Function48304: ; 48304 (12:4304) ld d, a pop bc ld a, b - ld [wcf88], a + ld [wPocketCursorBuffer], a ld a, c ld [wd0e4], a ld a, d @@ -37158,7 +37204,7 @@ Function48383: ; 48383 (12:4383) .asm_483af ld hl, wcfa9 ld a, [hl] - ld [wcf88], a + ld [wPocketCursorBuffer], a scf .asm_483b7 pop bc @@ -37556,10 +37602,10 @@ Function4876f: ; 4876f (12:476f) call PlaceString ld hl, MenuDataHeader_0x48509 call LoadMenuDataHeader - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a hlcoord 10, 5 ld b, $1 ld c, $8 @@ -37590,7 +37636,7 @@ Function4876f: ; 4876f (12:476f) ld a, [wd473] push af .asm_487c6 - call Functiona57 + call JoyTextDelay call Function4880e jr nc, .asm_487c6 ld a, $1 @@ -37605,7 +37651,7 @@ Function4876f: ; 4876f (12:476f) hlcoord 11, 6 call Function487ec pop af - ld [$ffaa], a + ld [hInMenu], a jp Function4840c Function487ec: ; 487ec (12:47ec) @@ -37643,7 +37689,7 @@ Function4880e: ; 4880e (12:480e) ld a, [hJoyPressed] ; $ff00+$a7 and B_BUTTON jp nz, Function488b4 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_UP jr nz, .asm_48843 @@ -37759,10 +37805,10 @@ Function488d3: ; 488d3 (12:48d3) jp c, Function4840c ld hl, MenuDataHeader_0x4850e call LoadMenuDataHeader - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a hlcoord 10, 9 ld b, $1 ld c, $8 @@ -37788,7 +37834,7 @@ Function488d3: ; 488d3 (12:48d3) asm_48922: ; 48922 (12:4922) push bc - call Functiona57 + call JoyTextDelay ld a, [hJoyDown] ; $ff00+$a8 and a jp z, Function4896e @@ -37797,7 +37843,7 @@ asm_48922: ; 48922 (12:4922) bit 1, a jp nz, Function4896e ld a, [DefaultFlypoint] - and $cf + and %11001111 res 7, a ld [DefaultFlypoint], a pop bc @@ -37830,7 +37876,7 @@ Function4895a: ; 4895a jr asm_48972 .asm_48965 - ld a, [$ffa9] + ld a, [hJoyLast] and a jr z, asm_48972 @@ -37907,7 +37953,7 @@ asm_48972: ; 48972 (12:4972) ld bc, $108 call ClearBox pop af - ld [$ffaa], a + ld [hInMenu], a jp Function4840c Function489ea: ; 489ea (12:49ea) @@ -38084,18 +38130,18 @@ Function48ab5: ; 48ab5 (12:4ab5) dec a jr .asm_48b25 .asm_48b2c - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $40 + and D_UP jr nz, .asm_48b8d ld a, [hl] - and $80 + and D_DOWN jr nz, .asm_48b55 ld a, [hl] - and $20 + and D_LEFT jp nz, Function48bd7 ld a, [hl] - and $10 + and D_RIGHT jr nz, .asm_48b9d hlcoord 11, 10 call Function489ea @@ -38569,7 +38615,7 @@ Function48d94: ; 48d94 (12:4d94) ld [hl], a ret -Function48dcb: ; 48dcb (12:4dcb) +InitGender: ; 48dcb (12:4dcb) call Function48e14 call Function48e47 call Function48e64 @@ -38577,7 +38623,7 @@ Function48dcb: ; 48dcb (12:4dcb) call Function32f9 ld hl, UnknownText_0x48e0f call PrintText - ld hl, MenuDataHeader_0x48dfc + ld hl, .MenuDataHeader call LoadMenuDataHeader call Function3200 call InterpretMenu2 @@ -38585,20 +38631,20 @@ Function48dcb: ; 48dcb (12:4dcb) ld a, [wcfa9] dec a ld [PlayerGender], a - ld c, $a + ld c, 10 call DelayFrames ret ; 48dfc (12:4dfc) -MenuDataHeader_0x48dfc: ; 0x48dfc +.MenuDataHeader: ; 0x48dfc db $40 ; flags db 04, 06 ; start coords db 09, 12 ; end coords - dw MenuData2_0x48e04 + dw .MenuData2 db 1 ; default option ; 0x48e04 -MenuData2_0x48e04: ; 0x48e04 +.MenuData2: ; 0x48e04 db $a1 ; flags db 2 ; items db "Boy@" @@ -38624,11 +38670,11 @@ Function48e14: ; 48e14 (12:4e14) call Function48000 call Functione5f hlcoord 0, 0 - ld bc, $168 + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH ld a, $0 call ByteFill hlcoord 0, 0, AttrMap - ld bc, $168 + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH xor a call ByteFill ret @@ -38652,7 +38698,7 @@ Palette_48e5c: ; 48e5c Function48e64: ; 48e64 (12:4e64) ld de, GFX_48e71 - ld hl, $9000 + ld hl, VTiles2 tile $00 lb bc, BANK(GFX_48e71), 1 call Get2bpp ret @@ -38662,7 +38708,7 @@ GFX_48e71: ; 48e71 INCBIN "gfx/unknown/048e71.2bpp" -Function48e81: ; 48e81 +DrawKrisPackGFX: ; 48e81 ld hl, PackFGFXPointers rept 2 add hl, de @@ -38670,7 +38716,7 @@ endr ld a, [hli] ld e, a ld d, [hl] - ld hl, $9500 + ld hl, VTiles2 tile $50 lb bc, BANK(PackFGFX), 15 call Request2bpp ret @@ -38695,7 +38741,7 @@ Function4925b: ; 4925b ld b, $14 call GetSGBLayout xor a - ld [wd142], a + ld [wItemAttributeParamBuffer], a call Function492a5 ld [wd265], a ld [wd262], a @@ -38847,7 +38893,7 @@ Function49336: ; 49336 Function49346: ; 49346 (12:5346) hlcoord 0, 0, AttrMap - ld bc, $168 + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH xor a call ByteFill ret @@ -38905,7 +38951,7 @@ Function49384: ; 49384 (12:5384) ld a, $3 call Function49336 hlcoord 0, 12, AttrMap - ld bc, $78 + ld bc, 6 * SCREEN_WIDTH ld a, $7 call ByteFill ret @@ -38977,7 +39023,7 @@ Function4942f: ; 4942f xor a call ByteFill hlcoord 0, 14, AttrMap - ld bc, $0050 + ld bc, 4 * SCREEN_WIDTH ld a, $7 call ByteFill ld a, [DefaultFlypoint] @@ -39320,8 +39366,8 @@ Function49797: ; 49797 ld a, $4 call Function49336 ld a, $3 - ldcoord 0, 1, AttrMap - ldcoord 0, 14, AttrMap + ldcoord_a 0, 1, AttrMap + ldcoord_a 0, 14, AttrMap hlcoord 2, 0, AttrMap ld bc, $0812 ld a, $5 @@ -39361,7 +39407,7 @@ endr ld [hl], a hlcoord 2, 17, AttrMap ld a, $3 - ld bc, $0006 + ld bc, 6 call ByteFill ret ; 49811 @@ -39447,7 +39493,7 @@ Special_CelebiShrineEvent: ; 4989a ld [wcf64], a ld d, $0 .loop - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .done push bc @@ -39498,11 +39544,11 @@ LoadCelebiGFX: ; 49912 lb bc, BANK(SpecialCelebiLeafGFX), 4 call Request2bpp ld de, SpecialCelebiGFX - ld hl, $8840 + ld hl, VTiles1 tile $04 lb bc, BANK(SpecialCelebiGFX), $10 call Request2bpp xor a - ld [wcf63], a + ld [wJumptableIndex], a ret ; 49935 @@ -39515,7 +39561,7 @@ Function49935: ; 49935 ret .asm_4993e - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret ; 49944 @@ -39763,7 +39809,7 @@ Function49bf3: ; 49bf3 ; 49bf9 Function49bf9: ; 49bf9 - ld a, [wd0ee] + ld a, [wBattleResult] bit 6, a jr z, .asm_49c07 ld a, $1 @@ -40050,7 +40096,7 @@ Function49e3d: ; 49e3d decoord 4, 16 ld a, [hHours] ld c, a - callba Function90b3e + callba PrintHour ld [hl], ":" inc hl ld de, hMinutes @@ -40113,7 +40159,7 @@ Function49ed0: ; 49ed0 call ClearTileMap call Functione5f call Functione51 - call Function1fbf + call ResetTextRelatedRAM ret ; 49ee0 @@ -40593,7 +40639,7 @@ Function4a28a: ; 4a28a (12:628a) call CloseSRAM ld hl, UnknownText_0x4a35d call PrintText - call Functiona36 + call JoyWaitAorB .asm_4a338 call ExitMenu .asm_4a33b @@ -40745,17 +40791,17 @@ Function4a3aa: ; 4a3aa ; 4a449 (12:6449) Function4a449: ; 4a449 - ld bc, $003c + ld bc, 3 * SCREEN_WIDTH ld a, $0 hlcoord 0, 0 call ByteFill - ld bc, $0028 + ld bc, 2 * SCREEN_WIDTH ld a, $1 call ByteFill - ld bc, $0028 + ld bc, 2 * SCREEN_WIDTH ld a, $0 call ByteFill - ld bc, $0028 + ld bc, 2 * SCREEN_WIDTH ld a, $1 call ByteFill ld bc, SCREEN_WIDTH @@ -40765,14 +40811,14 @@ Function4a449: ; 4a449 ld a, $3 call ByteFill ld bc, SCREEN_WIDTH - ld a, $7f + ld a, " " call ByteFill ret ; 4a485 Function4a485: ; 4a485 (12:6485) ld de, GFX_49c0c - ld hl, $9000 + ld hl, VTiles2 tile $00 lb bc, BANK(GFX_49c0c), $d call Get2bpp ret @@ -41284,11 +41330,11 @@ BoxAddressTable1: ; 4a810 dbw BANK(sBox7), sBox7 dbw BANK(sBox8), sBox8 dbw BANK(sBox9), sBox9 - dbw BANK(sBox10), sBox10 - dbw BANK(sBox11), sBox11 - dbw BANK(sBox12), sBox12 - dbw BANK(sBox13), sBox13 - dbw BANK(sBox14), sBox14 + dba sBox10 + dba sBox11 + dba sBox12 + dba sBox13 + dba sBox14 ; 4a83a UpdateOTPointer: ; 0x4a83a @@ -41446,11 +41492,11 @@ BoxAddressTable2: ; 4a8f4 dbw BANK(sBox7), sBox7 dbw BANK(sBox8), sBox8 dbw BANK(sBox9), sBox9 - dbw BANK(sBox10), sBox10 - dbw BANK(sBox11), sBox11 - dbw BANK(sBox12), sBox12 - dbw BANK(sBox13), sBox13 - dbw BANK(sBox14), sBox14 + dba sBox10 + dba sBox11 + dba sBox12 + dba sBox13 + dba sBox14 ; 4a91e Function4a91e: ; 4a91e @@ -41489,9 +41535,9 @@ Function4a927: ; 4a927 Function4a94e: ; 4a94e call FadeToMenu - ld a, $ff + ld a, -1 ld hl, DefaultFlypoint - ld bc, $0003 + ld bc, 3 call ByteFill xor a ld [wd018], a @@ -41525,8 +41571,8 @@ Function4a94e: ; 4a94e .asm_4a990 call Function2b3c ld hl, DefaultFlypoint - ld a, $ff - ld bc, $0003 + ld a, -1 + ld bc, 3 call ByteFill scf jr .asm_4a9af @@ -41743,15 +41789,15 @@ Function4aad3: ; 4aad3 ld c, a xor a - ld [$ffb0], a + ld [hConnectedMapWidth], a .loop push bc push hl ld e, 0 callba Function8e83f - ld a, [$ffb0] + ld a, [hConnectedMapWidth] inc a - ld [$ffb0], a + ld [hConnectedMapWidth], a pop hl pop bc dec c @@ -42038,20 +42084,20 @@ Function4acaa: ; 4acaa ld a, $2 ld [wcf92], a ld a, $c - ld [wcf82], a + ld [wMenuBorderTopCoord], a jr .asm_4accc .asm_4acc2 ld a, $4 ld [wcf92], a ld a, $8 - ld [wcf82], a + ld [wMenuBorderTopCoord], a .asm_4accc ld a, $b - ld [wcf83], a + ld [wMenuBorderLeftCoord], a ld a, $1 - ld [wcf88], a + ld [wPocketCursorBuffer], a call Function1c10 ld hl, wcfa5 set 6, [hl] @@ -42259,14 +42305,14 @@ Function4ae1f: ; 4ae1f call CopyMenuDataHeader pop bc ld a, b - ld [wcf83], a + ld [wMenuBorderLeftCoord], a add $5 - ld [wcf85], a + ld [wMenuBorderRightCoord], a ld a, c - ld [wcf82], a + ld [wMenuBorderTopCoord], a add $4 - ld [wcf84], a - call Function1c00 + ld [wMenuBorderBottomCoord], a + call BackUpTiles call InterpretMenu2 push af ld c, $f @@ -42404,59 +42450,59 @@ TileCollisionTable:: ; 4ce1f ; 11 talkable water ; 1f talkable wall - db $00, $00, $00, $00, $00, $00, $00, $0f - db $00, $00, $00, $00, $00, $00, $00, $0f - db $00, $00, $1f, $00, $00, $1f, $00, $00 - db $00, $00, $1f, $00, $00, $1f, $00, $00 - db $01, $01, $11, $00, $11, $01, $01, $0f - db $01, $01, $11, $00, $11, $01, $01, $0f - db $01, $01, $01, $01, $01, $01, $01, $01 - db $01, $01, $01, $01, $01, $01, $01, $01 + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + WATRTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + WATRTILE + db NULL + LANDTILE, NULL + LANDTILE, TALK + WATRTILE, NULL + LANDTILE, NULL + LANDTILE, TALK + WATRTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, TALK + WATRTILE, NULL + LANDTILE, NULL + LANDTILE, TALK + WATRTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + WALLTILE, NULL + WALLTILE, TALK + WALLTILE, NULL + LANDTILE, TALK + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WATRTILE + db NULL + WALLTILE, NULL + WALLTILE, TALK + WALLTILE, NULL + LANDTILE, TALK + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WATRTILE + db NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE + db NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE - db $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $0f, $00, $00, $00, $00, $00 - db $00, $00, $0f, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00 + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + WATRTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + WATRTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE - db $0f, $0f, $0f, $0f, $0f, $00, $00, $00 - db $0f, $0f, $0f, $0f, $0f, $00, $00, $00 - db $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f - db $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f - db $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00 + db NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE + db NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE, NULL + WATRTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE - db $01, $01, $01, $01, $01, $01, $01, $01 - db $01, $01, $01, $01, $01, $01, $01, $01 - db $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $0f + db NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE + db NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE, NULL + WALLTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE + db NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + LANDTILE, NULL + WATRTILE ; 4cf1f -Function4cf1f: ; 4cf1f +EmptyAllSRAMBanks: ; 4cf1f ld a, $0 - call Function4cf34 + call .EmptyBank ld a, $1 - call Function4cf34 + call .EmptyBank ld a, $2 - call Function4cf34 + call .EmptyBank ld a, $3 - call Function4cf34 + call .EmptyBank ret ; 4cf34 -Function4cf34: ; 4cf34 +.EmptyBank: ; 4cf34 call GetSRAMBank - ld hl, $a000 - ld bc, $2000 + ld hl, SRAM_Begin + ld bc, SRAM_End - SRAM_Begin xor a call ByteFill call CloseSRAM @@ -42468,6 +42514,8 @@ Function4cf45: ; 4cf45 (13:4f45) ld a, [hCGB] ; $ff00+$e6 and a jp z, WaitBGMap + +; The following is a modified version of Function3246. ld a, [hBGMapMode] ; $ff00+$d4 push af xor a @@ -42476,24 +42524,26 @@ Function4cf45: ; 4cf45 (13:4f45) push af xor a ld [$ffde], a -.asm_4cf57 +.WaitLY ld a, [rLY] ; $ff00+$44 cp $60 - jr c, .asm_4cf57 + jr c, .WaitLY + di - ld a, $1 + ld a, 1 ; BANK(VBGMap2) ld [rVBK], a ; $ff00+$4f hlcoord 0, 0, AttrMap call Function4cf80 - ld a, $0 + ld a, 0 ; BANK(VBGMap0) ld [rVBK], a ; $ff00+$4f hlcoord 0, 0 call Function4cf80 -.asm_4cf72 +.WaitLY2 ld a, [rLY] ; $ff00+$44 cp $60 - jr c, .asm_4cf72 + jr c, .WaitLY2 ei + pop af ld [$ffde], a pop af @@ -42503,113 +42553,37 @@ Function4cf45: ; 4cf45 (13:4f45) Function4cf80: ; 4cf80 (13:4f80) ld [hSPBuffer], sp ; $ffd9 ld sp, hl - ld a, [$ffd7] + ld a, [hBGMapAddress + 1] ld h, a - ld l, $0 - ld a, $12 + ld l, 0 + ld a, SCREEN_HEIGHT ld [$ffd3], a - ld b, $2 - ld c, $41 -.asm_4cf91 + ld b, 1 << 1 + ld c, rSTAT % $100 + +.loop +rept SCREEN_WIDTH / 2 pop de -.asm_4cf92 +.loop\@ ld a, [$ff00+c] and b - jr nz, .asm_4cf92 + jr nz, .loop\@ ld [hl], e inc l ld [hl], d inc l - pop de -.asm_4cf9b - ld a, [$ff00+c] - and b - jr nz, .asm_4cf9b - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4cfa4 - ld a, [$ff00+c] - and b - jr nz, .asm_4cfa4 - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4cfad - ld a, [$ff00+c] - and b - jr nz, .asm_4cfad - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4cfb6 - ld a, [$ff00+c] - and b - jr nz, .asm_4cfb6 - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4cfbf - ld a, [$ff00+c] - and b - jr nz, .asm_4cfbf - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4cfc8 - ld a, [$ff00+c] - and b - jr nz, .asm_4cfc8 - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4cfd1 - ld a, [$ff00+c] - and b - jr nz, .asm_4cfd1 - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4cfda - ld a, [$ff00+c] - and b - jr nz, .asm_4cfda - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4cfe3 - ld a, [$ff00+c] - and b - jr nz, .asm_4cfe3 - ld [hl], e - inc l - ld [hl], d - inc l - ld de, $c +endr + + ld de, $20 - SCREEN_WIDTH add hl, de ld a, [$ffd3] dec a ld [$ffd3], a - jr nz, .asm_4cf91 + jr nz, .loop + ld a, [hSPBuffer] ; $ff00+$d9 ld l, a - ld a, [$ffda] + ld a, [hSPBuffer + 1] ld h, a ld sp, hl ret @@ -42624,15 +42598,15 @@ Function4cffe:: ; 4cffe ld c, a call CloseSRAM ld a, b - cp $63 - jr nz, .asm_4d01b + cp 99 + jr nz, .ok ld a, c - cp $7f - jr nz, .asm_4d01b + cp " " + jr nz, .ok ld c, $1 ret -.asm_4d01b +.ok ld c, $0 ret ; 4d01e @@ -42687,6 +42661,8 @@ Function4d188: ; 4d188 ld a, [wc2ce] cp $0 jp z, WaitBGMap + +; What follows is a modified version of Function3246. ld a, [hBGMapMode] push af xor a @@ -42695,24 +42671,26 @@ Function4d188: ; 4d188 push af xor a ld [$ffde], a -.asm_4d1a2 +.wait ld a, [rLY] cp $8f - jr c, .asm_4d1a2 + jr c, .wait + di - ld a, $1 + ld a, 1 ; BANK(VBGMap2) ld [rVBK], a hlcoord 0, 0, AttrMap call Function4d1cb - ld a, $0 + ld a, 0 ; BANK(VBGMap0) ld [rVBK], a hlcoord 0, 0 call Function4d1cb -.asm_4d1bd +.wait2 ld a, [rLY] cp $8f - jr c, .asm_4d1bd + jr c, .wait2 ei + pop af ld [$ffde], a pop af @@ -42723,113 +42701,37 @@ Function4d188: ; 4d188 Function4d1cb: ; 4d1cb ld [hSPBuffer], sp ld sp, hl - ld a, [$ffd7] + ld a, [hBGMapAddress + 1] ld h, a - ld l, $0 - ld a, $12 + ld l, 0 + ld a, SCREEN_HEIGHT ld [$ffd3], a - ld b, $2 - ld c, $41 -.asm_4d1dc + ld b, 1 << 1 ; not in v/hblank + ld c, rSTAT % $100 + +.loop +rept SCREEN_WIDTH / 2 pop de -.asm_4d1dd +.loop\@ ld a, [$ff00+c] and b - jr nz, .asm_4d1dd + jr nz, .loop\@ ld [hl], e inc l ld [hl], d inc l - pop de -.asm_4d1e6 - ld a, [$ff00+c] - and b - jr nz, .asm_4d1e6 - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4d1ef - ld a, [$ff00+c] - and b - jr nz, .asm_4d1ef - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4d1f8 - ld a, [$ff00+c] - and b - jr nz, .asm_4d1f8 - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4d201 - ld a, [$ff00+c] - and b - jr nz, .asm_4d201 - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4d20a - ld a, [$ff00+c] - and b - jr nz, .asm_4d20a - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4d213 - ld a, [$ff00+c] - and b - jr nz, .asm_4d213 - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4d21c - ld a, [$ff00+c] - and b - jr nz, .asm_4d21c - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4d225 - ld a, [$ff00+c] - and b - jr nz, .asm_4d225 - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_4d22e - ld a, [$ff00+c] - and b - jr nz, .asm_4d22e - ld [hl], e - inc l - ld [hl], d - inc l - ld de, $000c +endr + + ld de, $20 - SCREEN_WIDTH add hl, de ld a, [$ffd3] dec a ld [$ffd3], a - jr nz, .asm_4d1dc + jr nz, .loop + ld a, [hSPBuffer] ld l, a - ld a, [$ffda] + ld a, [hSPBuffer + 1] ld h, a ld sp, hl ret @@ -42886,19 +42788,19 @@ rept 2 inc c endr ld a, $7 -.asm_4d36e +.row push bc push hl -.asm_4d370 +.col ld [hli], a dec c - jr nz, .asm_4d370 + jr nz, .col pop hl ld de, SCREEN_WIDTH add hl, de pop bc dec b - jr nz, .asm_4d36e + jr nz, .row ret ; 4d37e @@ -42913,36 +42815,36 @@ Function4d37e: ; 4d37e pop hl ld de, SCREEN_WIDTH add hl, de -.asm_4d38d +.loop push hl - ld a, $79 + ld a, "┌" ld [hli], a - ld a, $7f + ld a, " " call Function4d3ab - ld [hl], $7a + ld [hl], "─" pop hl ld de, SCREEN_WIDTH add hl, de dec b - jr nz, .asm_4d38d - ld a, $7b + jr nz, .loop + ld a, "┐" ld [hli], a - ld a, $7c + ld a, "│" call Function4d3ab - ld [hl], $7d + ld [hl], "└" ret ; 4d3ab Function4d3ab: ; 4d3ab ld d, c -.asm_4d3ac +.loop ld [hli], a dec d - jr nz, .asm_4d3ac + jr nz, .loop ret ; 4d3b1 -Function4d3b1: ; 4d3b1 +_ResetClock: ; 4d3b1 callba Function8000 ld b, $8 call GetSGBLayout @@ -42950,129 +42852,129 @@ Function4d3b1: ; 4d3b1 call Functione5f ld de, MUSIC_MAIN_MENU call PlayMusic - ld hl, UnknownText_0x4d408 + ld hl, .text_askreset call PrintText - ld hl, MenuDataHeader_0x4d40d + ld hl, .NoYes_MenuDataHeader call CopyMenuDataHeader call InterpretMenu2 ret c ld a, [wcfa9] cp $1 ret z - call Function4d41e - jr c, .asm_4d3f7 + call ClockResetPassword + jr c, .wrongpassword ld a, BANK(s0_ac60) call GetSRAMBank ld a, $80 ld [s0_ac60], a call CloseSRAM - ld hl, UnknownText_0x4d3fe + ld hl, .text_okay call PrintText ret -.asm_4d3f7 - ld hl, UnknownText_0x4d403 +.wrongpassword + ld hl, .text_wrong call PrintText ret ; 4d3fe -UnknownText_0x4d3fe: ; 0x4d3fe +.text_okay: ; 0x4d3fe ; Password OK. Select CONTINUE & reset settings. text_jump UnknownText_0x1c55db db "@" ; 0x4d403 -UnknownText_0x4d403: ; 0x4d403 +.text_wrong: ; 0x4d403 ; Wrong password! text_jump UnknownText_0x1c560b db "@" ; 0x4d408 -UnknownText_0x4d408: ; 0x4d408 +.text_askreset: ; 0x4d408 ; Reset the clock? text_jump UnknownText_0x1c561c db "@" ; 0x4d40d -MenuDataHeader_0x4d40d: ; 0x4d40d +.NoYes_MenuDataHeader: ; 0x4d40d db $00 ; flags db 07, 14 ; start coords db 11, 19 ; end coords - dw MenuData2_0x4d415 + dw .NoYes_MenuData2 db 1 ; default option ; 0x4d415 -MenuData2_0x4d415: ; 0x4d415 +.NoYes_MenuData2: ; 0x4d415 db $c0 ; flags db 2 ; items db "NO@" db "YES@" ; 0x4d41e -Function4d41e: ; 4d41e - call Function4d50f +ClockResetPassword: ; 4d41e + call .CalculatePassword push de ld hl, StringBuffer2 - ld bc, $0005 + ld bc, 5 xor a call ByteFill ld a, $4 ld [StringBuffer2 + 5], a - ld hl, UnknownText_0x4d463 + ld hl, .pleaseenterpasswordtext call PrintText -.asm_4d437 - call Function4d468 -.asm_4d43a - call Functiona57 - ld a, [$ffa9] +.loop + call .updateIDdisplay +.loop2 + call JoyTextDelay + ld a, [hJoyLast] ld b, a - and $1 - jr nz, .asm_4d453 + and A_BUTTON + jr nz, .confirm ld a, b - and $f0 - jr z, .asm_4d43a - call Function4d490 + and D_PAD + jr z, .loop2 + call .dpadinput ld c, $3 call DelayFrames - jr .asm_4d437 + jr .loop -.asm_4d453 - call Function4d4e0 +.confirm + call .ConvertDecIDToBytes pop de ld a, e cp l - jr nz, .asm_4d461 + jr nz, .nope ld a, d cp h - jr nz, .asm_4d461 + jr nz, .nope and a ret -.asm_4d461 +.nope scf ret ; 4d463 -UnknownText_0x4d463: ; 0x4d463 +.pleaseenterpasswordtext: ; 0x4d463 ; Please enter the password. text_jump UnknownText_0x1c562e db "@" ; 0x4d468 -Function4d468: ; 4d468 +.updateIDdisplay: ; 4d468 hlcoord 14, 15 ld de, StringBuffer2 - ld c, $5 -.asm_4d470 + ld c, 5 +.loop3 ld a, [de] - add $f6 + add "0" ld [hli], a inc de dec c - jr nz, .asm_4d470 + jr nz, .loop3 hlcoord 14, 16 - ld bc, $0005 - ld a, $7f + ld bc, 5 + ld a, " " call ByteFill hlcoord 14, 16 ld a, [StringBuffer2 + 5] @@ -43083,22 +42985,22 @@ Function4d468: ; 4d468 ret ; 4d490 -Function4d490: ; 4d490 +.dpadinput: ; 4d490 ld a, b - and $20 - jr nz, .asm_4d4a5 + and D_LEFT + jr nz, .left ld a, b - and $10 - jr nz, .asm_4d4af + and D_RIGHT + jr nz, .right ld a, b - and $40 - jr nz, .asm_4d4ba + and D_UP + jr nz, .up ld a, b - and $80 - jr nz, .asm_4d4c8 + and D_DOWN + jr nz, .down ret -.asm_4d4a5 +.left ld a, [StringBuffer2 + 5] and a ret z @@ -43106,7 +43008,7 @@ Function4d490: ; 4d490 ld [StringBuffer2 + 5], a ret -.asm_4d4af +.right ld a, [StringBuffer2 + 5] cp $4 ret z @@ -43114,34 +43016,34 @@ Function4d490: ; 4d490 ld [StringBuffer2 + 5], a ret -.asm_4d4ba - call Function4d4d5 +.up + call .getcurrentdigit ld a, [hl] - cp $9 - jr z, .asm_4d4c5 + cp 9 + jr z, .wraparound_up inc a ld [hl], a ret -.asm_4d4c5 +.wraparound_up ld [hl], $0 ret -.asm_4d4c8 - call Function4d4d5 +.down + call .getcurrentdigit ld a, [hl] and a - jr z, .asm_4d4d2 + jr z, .wraparound_down dec a ld [hl], a ret -.asm_4d4d2 - ld [hl], $9 +.wraparound_down + ld [hl], 9 ret ; 4d4d5 -Function4d4d5: ; 4d4d5 +.getcurrentdigit: ; 4d4d5 ld a, [StringBuffer2 + 5] ld e, a ld d, $0 @@ -43150,19 +43052,19 @@ Function4d4d5: ; 4d4d5 ret ; 4d4e0 -Function4d4e0: ; 4d4e0 +.ConvertDecIDToBytes: ; 4d4e0 ld hl, 0 ld de, StringBuffer2 + 4 ld bc, 1 - call Function4d501 + call .ConvertToBytes ld bc, 10 - call Function4d501 + call .ConvertToBytes ld bc, 100 - call Function4d501 + call .ConvertToBytes ld bc, 1000 - call Function4d501 + call .ConvertToBytes ld bc, 10000 -Function4d501: ; 4d501 +.ConvertToBytes: ; 4d501 ld a, [de] dec de push hl @@ -43175,25 +43077,24 @@ Function4d501: ; 4d501 ret ; 4d50f -Function4d50f: ; 4d50f +.CalculatePassword: ; 4d50f ld a, BANK(sPlayerData) call GetSRAMBank ld de, $0000 - ld hl, sPlayerData + PlayerID - wPlayerData + ld hl, sPlayerData + (PlayerID - wPlayerData) ld c, $2 - call Function4d533 - ld hl, sPlayerData + PlayerName - wPlayerData + call .ComponentFromNumber + ld hl, sPlayerData + (PlayerName - wPlayerData) ld c, $5 - call Function4d53e - ld hl, sPlayerData + Money - wPlayerData + call .ComponentFromString + ld hl, sPlayerData + (Money - wPlayerData) ld c, $3 - call Function4d533 + call .ComponentFromNumber call CloseSRAM ret ; 4d533 -Function4d533: ; 4d533 -.asm_4d533 +.ComponentFromNumber: ; 4d533 ld a, [hli] add e ld e, a @@ -43201,12 +43102,11 @@ Function4d533: ; 4d533 adc d ld d, a dec c - jr nz, .asm_4d533 + jr nz, .ComponentFromNumber ret ; 4d53e -Function4d53e: ; 4d53e -.asm_4d53e +.ComponentFromString: ; 4d53e ld a, [hli] cp "@" ret z @@ -43216,7 +43116,7 @@ Function4d53e: ; 4d53e adc d ld d, a dec c - jr nz, .asm_4d53e + jr nz, .ComponentFromString ret ; 4d54c @@ -43237,7 +43137,7 @@ Function4d54c: ; 4d54c ld a, [wcfa9] cp $1 ret z - callba Function4cf1f + callba EmptyAllSRAMBanks ret ; 4d580 @@ -43511,7 +43411,7 @@ endr ld a, [ScriptVar] and a ret z ; found nothing - callba Function1060cd + callba MobileFn_1060cd ld a, [wFoundMatchingIDInParty] and a push af @@ -43610,11 +43510,11 @@ endr dbw BANK(sBox7), sBox7 dbw BANK(sBox8), sBox8 dbw BANK(sBox9), sBox9 - dbw BANK(sBox10), sBox10 - dbw BANK(sBox11), sBox11 - dbw BANK(sBox12), sBox12 - dbw BANK(sBox13), sBox13 - dbw BANK(sBox14), sBox14 + dba sBox10 + dba sBox11 + dba sBox12 + dba sBox13 + dba sBox14 ; 4d9c9 .FoundPartymonText: ; 0x4d9c9 @@ -43629,7 +43529,7 @@ endr db "@" ; 0x4d9d3 -Function4d9d3: ; 4d9d3 +Special_PrintTodaysLuckyNumber: ; 4d9d3 ld hl, StringBuffer3 ld de, wLuckyIDNumber lb bc, PRINTNUM_LEADINGZEROS | 2, 5 @@ -44040,11 +43940,11 @@ RetroactivelyIgnoreEggs: ; 4dc67 Function4dc7b: ; 4dc7b (13:5c7b) - ld a, [InLinkBattle] - cp $4 + ld a, [wLinkMode] + cp LINK_MOBILE jr nz, StatsScreenInit - ld a, [IsInBattle] ; wd22d (aliases: EnemyMonEnd) + ld a, [wBattleMode] ; wd22d (aliases: EnemyMonEnd) and a jr z, StatsScreenInit jr Function4dc8f @@ -44064,7 +43964,7 @@ StatsScreenInit_gotaddress: ; 4dc94 ld [$ffde], a ; disable overworld tile animations ld a, [wc2c6] ; whether sprite is to be mirrorred push af - ld a, [wcf63] + ld a, [wJumptableIndex] ld b, a ld a, [wcf64] ld c, a @@ -44083,7 +43983,7 @@ StatsScreenInit_gotaddress: ; 4dc94 ; restore old values ld a, b - ld [wcf63], a + ld [wJumptableIndex], a ld a, c ld [wcf64], a pop af @@ -44095,19 +43995,19 @@ StatsScreenInit_gotaddress: ; 4dc94 StatsScreenMain: ; 0x4dcd2 xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld a, [wcf64] and $fc or $1 ld [wcf64], a .loop ; 4dce3 - ld a, [wcf63] + ld a, [wJumptableIndex] and $7f ld hl, StatsScreenPointerTable rst JumpTable call Function4dd3a ; check for keys? - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr z, .loop ret @@ -44115,7 +44015,7 @@ StatsScreenMain: ; 0x4dcd2 StatsScreenBattle: ; 4dcf7 xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld a, [wcf64] and $fc @@ -44123,14 +44023,14 @@ StatsScreenBattle: ; 4dcf7 ld [wcf64], a .asm_4dd08 callba Function100dd2 - ld a, [wcf63] + ld a, [wJumptableIndex] and $7f ld hl, StatsScreenPointerTable rst JumpTable call Function4dd3a callba Function100dfd jr c, .asm_4dd29 - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr z, .asm_4dd08 @@ -44170,14 +44070,14 @@ Function4dd3a: ; 4dd3a (13:5d3a) ret Function4dd62: ; 4dd62 (13:5d62) - ld a, [wcf63] + ld a, [wJumptableIndex] and $80 or h - ld [wcf63], a + ld [wJumptableIndex], a ret Function4dd6c: ; 4dd6c (13:5d6c) - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret @@ -44204,9 +44104,9 @@ Function4dd72: ; 4dd72 (13:5d72) EggStatsInit: ; 4dda1 call EggStatsScreen - ld a, [wcf63] + ld a, [wJumptableIndex] inc a - ld [wcf63], a + ld [wJumptableIndex], a ret ; 0x4ddac @@ -44231,9 +44131,9 @@ Function4ddc6: ; 4ddc6 (13:5dc6) call Function4dfb6 ld hl, wcf64 res 4, [hl] - ld a, [wcf63] + ld a, [wJumptableIndex] inc a - ld [wcf63], a + ld [wJumptableIndex], a ret Function4ddd6: ; 4ddd6 (13:5dd6) @@ -44249,9 +44149,9 @@ Function4ddd6: ; 4ddd6 (13:5dd6) Function4dde6: ; 4dde6 (13:5de6) call IsSFXPlaying ret nc - ld a, [wcf63] + ld a, [wJumptableIndex] inc a - ld [wcf63], a + ld [wJumptableIndex], a ret Function4ddf2: ; 4ddf2 (13:5df2) @@ -44722,7 +44622,7 @@ Function4e147: ; 4e147 (13:6147) hlcoord 0, 10 call PlaceString ld hl, TempMonMoves - ld de, wd25e + ld de, wListMoves_MoveIndicesBuffer ld bc, NUM_MOVES call CopyBytes hlcoord 8, 10 @@ -44882,7 +44782,7 @@ Function4e289: ; 4e289 (13:6289) call IsAPokemon ret c call Function4e307 - ld de, $9000 + ld de, VTiles2 tile $00 predef Function5108b hlcoord 0, 0 ld d, $0 @@ -44970,7 +44870,7 @@ Function4e307: ; 4e307 (13:6307) ld [rVBK], a ; $ff00+$4f ld de, GFX_f9204 lb bc, BANK(GFX_f9204), 1 - ld hl, $97f0 + ld hl, VTiles2 tile $7f call Get2bpp pop af ld [rVBK], a ; $ff00+$4f @@ -45085,7 +44985,7 @@ Function4e497: ; 4e497 (13:6497) ld a, $1 ld [wc2c6], a call Function4e307 - ld de, $9000 + ld de, VTiles2 tile $00 predef Function5108b pop de hlcoord 0, 0 @@ -45334,7 +45234,7 @@ _EvolutionAnimation: ; 4e607 call Function4e708 ld de, VTiles2 - ld hl, $9310 + ld hl, VTiles2 tile $31 ld bc, $0031 call Request2bpp @@ -45517,10 +45417,10 @@ Function4e779: ; 4e779 .asm_4e779 call DelayFrame push bc - call Functiona57 + call JoyTextDelay ld a, [hJoyDown] pop bc - and $2 + and B_BUTTON jr nz, .asm_4e78c .asm_4e787 dec c @@ -45552,7 +45452,7 @@ Function4e7a6: ; 4e7a6 ret nz ld de, SFX_EVOLVED call PlaySFX - ld hl, wcf63 + ld hl, wJumptableIndex ld a, [hl] push af ld [hl], $0 @@ -45569,12 +45469,12 @@ Function4e7a6: ; 4e7a6 dec c jr nz, .asm_4e7c4 pop af - ld [wcf63], a + ld [wJumptableIndex], a ret ; 4e7cf Function4e7cf: ; 4e7cf - ld hl, wcf63 + ld hl, wJumptableIndex ld a, [hl] cp $20 ret nc @@ -45599,7 +45499,7 @@ Function4e7e8: ; 4e7e8 call Function3b2a ld hl, $000b add hl, bc - ld a, [wcf63] + ld a, [wJumptableIndex] and $e sla a pop de @@ -45652,10 +45552,10 @@ Function4e881: ; 4e881 call ClearSprites call DisableLCD call Functione51 - call Functione58 + call LoadFontsBattleExtra ld hl, VBGMap0 - ld bc, $400 - ld a, $7f + ld bc, VBGMap1 - VBGMap0 + ld a, " " call ByteFill hlcoord 0, 0, AttrMap ld bc, SCREEN_WIDTH * SCREEN_HEIGHT @@ -45685,10 +45585,10 @@ Function4e8c2: ; 4e8c2 call ClearSprites call DisableLCD call Functione51 - call Functione58 + call LoadFontsBattleExtra ld hl, VBGMap0 - ld bc, $400 - ld a, $7f + ld bc, VBGMap1 - VBGMap0 + ld a, " " call ByteFill hlcoord 0, 0, AttrMap ld bc, SCREEN_WIDTH * SCREEN_HEIGHT @@ -45697,9 +45597,9 @@ Function4e8c2: ; 4e8c2 ld hl, wd000 ld c, $40 .asm_4e8ee - ld a, $ff + ld a, -1 ld [hli], a - ld a, $7f + ld a, " " ld [hli], a dec c jr nz, .asm_4e8ee @@ -45718,8 +45618,8 @@ Function4e906: ; 4e906 ld a, $6 ld [rSVBK], a ld hl, w6_d000 - ld bc, $400 - ld a, $7f + ld bc, w6_d400 - w6_d000 + ld a, " " call ByteFill ld hl, VBGMap0 ld de, w6_d000 @@ -45902,7 +45802,7 @@ endr Function4e9e5: ; 4e9e5 ld hl, LYOverrides ld a, $90 - ld bc, $0090 + ld bc, SCREEN_HEIGHT_PX call ByteFill ret ; 4e9f1 @@ -45966,9 +45866,9 @@ CheckBattleScene: ; 4ea44 ; Return carry if battle scene is turned off. ld a, 0 - ld hl, InLinkBattle + ld hl, wLinkMode call GetFarWRAMByte - cp 4 + cp LINK_MOBILE jr z, .mobile ld a, [Options] @@ -46020,7 +45920,7 @@ INCLUDE "event/poke_seer.asm" SECTION "bank14", ROMX, BANK[$14] SelectMonFromParty: ; 50000 - call Function2ed3 + call DisableSpriteUpdates xor a ld [PartyMenuActionText], a call WhiteBGMap @@ -46037,7 +45937,7 @@ SelectMonFromParty: ; 50000 Function5001d: ; 5001d ld a, b ld [PartyMenuActionText], a - call Function2ed3 + call DisableSpriteUpdates call WhiteBGMap call Function5003f call WaitBGMap @@ -46060,9 +45960,9 @@ Function5003f: ; 5003f ; 5004f Function5004f: ; 5004f - call Functione58 - callab Function8ad1 - callab Function8e814 + call LoadFontsBattleExtra + callab Function8ad1 ; engine/color.asm + callab InefficientlyClear121BytesAtwc300 ret ; 5005f @@ -46281,7 +46181,7 @@ Function50176: ; 50176 ld a, [de] cp 100 ; This is distinct from MAX_LEVEL. jr nc, .asm_501a1 - ld a, LV_CHAR + ld a, "" ld [hli], a ld bc, $4102 .asm_501a1 @@ -46674,7 +46574,7 @@ Function503e0: ; 503e0 ret z ld c, a xor a - ld [$ffb0], a + ld [hConnectedMapWidth], a .asm_503ea push bc push hl @@ -46682,9 +46582,9 @@ Function503e0: ; 503e0 ld a, BANK(Function8e83f) ld e, $0 rst FarCall - ld a, [$ffb0] + ld a, [hConnectedMapWidth] inc a - ld [$ffb0], a + ld [hConnectedMapWidth], a pop hl pop bc dec c @@ -46764,7 +46664,7 @@ PartyMenuSelect: ; 0x50457 cp b jr z, .exitmenu ; CANCEL ld [wd0d8], a - ld a, [$ffa9] + ld a, [hJoyLast] ld b, a bit 1, b jr nz, .exitmenu ; B button? @@ -46962,7 +46862,7 @@ endr ret ; 505da -Function505da:: ; 505da +DoPoisonStep:: ; 505da ld a, [PartyCount] and a jr z, .asm_5062c @@ -48085,19 +47985,19 @@ ParString: db "PAR@" ListMoves: ; 50d6f ; List moves at hl, spaced every [Buffer1] tiles. - ld de, wd25e + ld de, wListMoves_MoveIndicesBuffer ld b, $0 -.asm_50d74 +.moves_loop ld a, [de] inc de and a - jr z, .asm_50da7 + jr z, .no_more_moves push de push hl push hl ld [CurSpecies], a ld a, MOVE_NAME - ld [wcf61], a + ld [wNamedObjectTypeBuffer], a call GetName ld de, StringBuffer1 pop hl @@ -48117,12 +48017,12 @@ ListMoves: ; 50d6f pop de ld a, b cp NUM_MOVES - jr z, .asm_50db8 - jr .asm_50d74 + jr z, .done + jr .moves_loop -.asm_50da7 +.no_more_moves ld a, b -.asm_50da8 +.nonmove_loop push af ld [hl], "-" ld a, [Buffer1] @@ -48132,9 +48032,9 @@ ListMoves: ; 50d6f pop af inc a cp NUM_MOVES - jr nz, .asm_50da8 + jr nz, .nonmove_loop -.asm_50db8 +.done ret ; 50db9 @@ -48159,7 +48059,7 @@ Function50db9: ; 50db9 cp $5 jr nz, .check_item_name - ld hl, OBPals + 8 * 6 + ld hl, CurMart ld de, PokemonNames ld a, PKMN_NAME jr .done @@ -48173,12 +48073,12 @@ Function50db9: ; 50db9 jr .done .check_ob_item_name - ld hl, OBPals + 8 * 6 + ld hl, CurMart ld de, ItemNames ld a, ITEM_NAME .done - ld [wcf61], a + ld [wNamedObjectTypeBuffer], a ld a, l ld [wd100], a ld a, h @@ -48187,7 +48087,7 @@ Function50db9: ; 50db9 ld [wd102], a ld a, d ld [wd103], a - ld bc, $67c1 ; XXX ItemAttributes? + ld bc, ItemAttributes ld a, c ld [wd104], a ld a, b @@ -48401,10 +48301,10 @@ Function50f12: Function50f34: ; 50f34 (14:4f34) push af hlcoord 0, 1 - ld bc, $28 + ld bc, 2 * SCREEN_WIDTH call AddNTimes - ld bc, $28 - ld a, $7f + ld bc, 2 * SCREEN_WIDTH + ld a, " " call ByteFill pop af ld hl, Sprites @@ -49239,7 +49139,7 @@ GetMovementInput: ; 80017 ret z ld c, a - and $f0 + and D_PAD ret nz ld a, c @@ -49551,14 +49451,14 @@ TrySurfStep: ; 801c0 call CheckWaterPermissions ld [wd040], a - jr c, .asm_801f1 + jr c, .bump call IsNPCInFront ld [wd03f], a and a - jr z, .asm_801f1 + jr z, .bump cp 2 - jr z, .asm_801f1 + jr z, .bump ld a, [wd040] and a @@ -49578,7 +49478,7 @@ TrySurfStep: ; 801c0 scf ret -.asm_801f1 +.bump xor a ret ; 801f3 @@ -50152,12 +50052,12 @@ INCLUDE "engine/engine_flags.asm" _GetVarAction:: ; 80648 (20:4648) ld a, c cp NUM_VARS - jr c, .asm_8064e + jr c, .valid xor a -.asm_8064e +.valid ld c, a ld b, 0 - ld hl, VarActionTable + ld hl, .VarActionTable rept 3 add hl, bc endr @@ -50167,104 +50067,105 @@ endr inc hl ld b, [hl] ld a, b - and $80 - jr nz, .asm_80668 + and RETVAR_EXECUTE + jr nz, .call ld a, b - and $40 + and RETVAR_ADDR_DE ret nz ld a, [de] - jr Function8066c -.asm_80668 + jr .loadstringbuffer2 + +.call call _de_ ret -Function8066c: ; 8066c (20:466c) +.loadstringbuffer2: ; 8066c (20:466c) ld de, StringBuffer2 ld [de], a ret ; 80671 (20:4671) -VarActionTable: ; 80671 -; $00: return address -; $40: return at StringBuffer2 -; $80: return function result at StringBuffer2 - dwb StringBuffer2, $00 - dwb PartyCount, $00 - dwb Function80728, $80 - dwb BattleType, $40 - dwb TimeOfDay, $00 - dwb Function806c5, $80 - dwb Function806d3, $80 - dwb CountBadges, $80 - dwb PlayerState, $40 - dwb Function806ef, $80 - dwb hHours, $00 - dwb Function806f9, $80 - dwb MapGroup, $00 - dwb MapNumber, $00 - dwb Function806ff, $80 - dwb wPermission, $00 - dwb Function80715, $80 - dwb wd46c, $00 - dwb XCoord, $00 - dwb YCoord, $00 - dwb wSpecialPhoneCallID, $00 - dwb wcf64, $00 - dwb wdca4, $00 - dwb wCurrentCaller, $40 - dwb wdc4b, $40 - dwb wdc4a, $40 - dwb wdc58, $00 - dwb NULL, $00 +.VarActionTable: ; 80671 +; $00: copy [de] to StringBuffer2 +; $40: return address in de +; $80: call function + dwb StringBuffer2, RETVAR_STRBUF2 + dwb PartyCount, RETVAR_STRBUF2 + dwb .BattleResult, RETVAR_EXECUTE + dwb BattleType, RETVAR_ADDR_DE + dwb TimeOfDay, RETVAR_STRBUF2 + dwb .CountCaughtMons, RETVAR_EXECUTE + dwb .CountSeenMons, RETVAR_EXECUTE + dwb .CountBadges, RETVAR_EXECUTE + dwb PlayerState, RETVAR_ADDR_DE + dwb .PlayerFacing, RETVAR_EXECUTE + dwb hHours, RETVAR_STRBUF2 + dwb .DayOfWeek, RETVAR_EXECUTE + dwb MapGroup, RETVAR_STRBUF2 + dwb MapNumber, RETVAR_STRBUF2 + dwb .UnownCaught, RETVAR_EXECUTE + dwb wPermission, RETVAR_STRBUF2 + dwb .BoxFreeSpace, RETVAR_EXECUTE + dwb wBugContestMinsRemaining, RETVAR_STRBUF2 + dwb XCoord, RETVAR_STRBUF2 + dwb YCoord, RETVAR_STRBUF2 + dwb wSpecialPhoneCallID, RETVAR_STRBUF2 + dwb wcf64, RETVAR_STRBUF2 + dwb wKurtApricornQuantity, RETVAR_STRBUF2 + dwb wCurrentCaller, RETVAR_ADDR_DE + dwb wBlueCardBalance, RETVAR_ADDR_DE + dwb wBuenasPassword, RETVAR_ADDR_DE + dwb wdc58, RETVAR_STRBUF2 + dwb NULL, RETVAR_STRBUF2 ; 806c5 -Function806c5: ; 806c5 +.CountCaughtMons: ; 806c5 ; Caught mons. ld hl, PokedexCaught ld b, EndPokedexCaught - PokedexCaught call CountSetBits ld a, [wd265] - jp Function8066c + jp .loadstringbuffer2 ; 806d3 -Function806d3: ; 806d3 +.CountSeenMons: ; 806d3 ; Seen mons. ld hl, PokedexSeen ld b, EndPokedexSeen - PokedexSeen call CountSetBits ld a, [wd265] - jp Function8066c + jp .loadstringbuffer2 ; 806e1 -CountBadges: ; 806e1 +.CountBadges: ; 806e1 ; Number of owned badges. ld hl, Badges ld b, 2 call CountSetBits ld a, [wd265] - jp Function8066c + jp .loadstringbuffer2 ; 806ef -Function806ef: ; 806ef +.PlayerFacing: ; 806ef ; The direction the player is facing. ld a, [PlayerDirection] and $c rrca rrca - jp Function8066c + jp .loadstringbuffer2 ; 806f9 -Function806f9: ; 806f9 +.DayOfWeek: ; 806f9 ; The day of the week. call GetWeekday - jp Function8066c + jp .loadstringbuffer2 ; 806ff -Function806ff: ; 806ff +.UnownCaught: ; 806ff ; Number of unique Unown caught. call .count ld a, b - jp Function8066c + jp .loadstringbuffer2 .count ld hl, UnownDex @@ -50280,7 +50181,7 @@ Function806ff: ; 806ff ret ; 80715 -Function80715: ; 80715 +.BoxFreeSpace: ; 80715 ; Remaining slots in the current box. ld a, BANK(sBoxCount) call GetSRAMBank @@ -50290,13 +50191,13 @@ Function80715: ; 80715 ld b, a call CloseSRAM ld a, b - jp Function8066c + jp .loadstringbuffer2 ; 80728 -Function80728: ; 80728 - ld a, [wd0ee] +.BattleResult: ; 80728 + ld a, [wBattleResult] and $3f - jp Function8066c + jp .loadstringbuffer2 ; 80730 @@ -50315,10 +50216,10 @@ ColorTest: ; 818ac ret z .asm_818b5 - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a call DisableLCD call Function81948 call Function8197c @@ -50328,11 +50229,11 @@ ColorTest: ; 818ac ld de, MUSIC_NONE call PlayMusic xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf66], a ld [wd003], a .asm_818de - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_818f0 call Function81a74 @@ -50342,7 +50243,7 @@ ColorTest: ; 818ac .asm_818f0 pop af - ld [$ffaa], a + ld [hInMenu], a ret ; 818f4 @@ -50411,13 +50312,13 @@ Function81948: ; 81948 ld a, $1 ld [rVBK], a ld hl, VTiles0 - ld bc, $2000 + ld bc, sScratch - VTiles0 xor a call ByteFill ld a, $0 ld [rVBK], a ld hl, VTiles0 - ld bc, $2000 + ld bc, sScratch - VTiles0 xor a call ByteFill hlcoord 0, 0, AttrMap @@ -50434,7 +50335,7 @@ Function81948: ; 81948 Function8197c: ; 8197c ld hl, DebugColorTestGFX + $10 - ld de, $96a0 + ld de, VTiles2 tile $6a ld bc, $0160 call CopyBytes ld hl, DebugColorTestGFX @@ -50589,20 +50490,20 @@ Palette_81a34: ; 81a34 ; 81a74 Function81a74: ; 81a74 - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] cp $4 jr nc, .asm_81a8b - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $4 + and SELECT jr nz, .asm_81a9a ld a, [hl] - and $8 + and START jr nz, .asm_81aab .asm_81a8b - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_81acf @@ -50637,7 +50538,7 @@ endr .asm_81aba ld [wcf66], a ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 81ac3 @@ -50671,17 +50572,17 @@ Function81adb: ; 81adb ld a, $6f call ByteFill hlcoord 1, 3 - ld bc, $0712 + lb bc, 7, 18 ld a, $6c - call Function81efc + call Bank20_FillBoxWithByte hlcoord 11, 0 - ld bc, $0203 + lb bc, 2, 3 ld a, $6d - call Function81efc + call Bank20_FillBoxWithByte hlcoord 16, 0 - ld bc, $0203 + lb bc, 2, 3 ld a, $6e - call Function81efc + call Bank20_FillBoxWithByte call Function81bc0 call Function81bf4 ld a, [wcf66] @@ -50704,7 +50605,7 @@ Function81adb: ; 81adb ld [wc2c6], a hlcoord 12, 3 call Function378b - ld de, $9310 + ld de, VTiles2 tile $31 predef GetBackpic ld a, $31 ld [$ffad], a @@ -50746,7 +50647,7 @@ Function81adb: ; 81adb .asm_81ba9 ld a, $1 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 81baf @@ -50817,7 +50718,7 @@ Function81c18: ; 81c18 .asm_81c2a call WaitBGMap ld a, $2 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 81c33 @@ -50842,7 +50743,7 @@ Function81c33: ; 81c33 ld a, $1 ld [hCGBPalUpdate], a ld a, $3 - ld [wcf63], a + ld [wJumptableIndex], a pop af ld [rSVBK], a ret @@ -50877,7 +50778,7 @@ endr ld de, wc608 + 2 call Function81ca7 ld a, $3 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 81ca7 @@ -50904,11 +50805,11 @@ Function81cbc: ; 81cbc ; 81cc2 Function81cc2: ; 81cc2 - ld a, [$ffa9] - and $2 + ld a, [hJoyLast] + and B_BUTTON jr nz, .asm_81cdf - ld a, [$ffa9] - and $1 + ld a, [hJoyLast] + and A_BUTTON jr nz, .asm_81ce5 ld a, [wcf64] and $3 @@ -50925,7 +50826,7 @@ endr .asm_81cdf ld a, $4 - ld [wcf63], a + ld [wJumptableIndex], a ret .asm_81ce5 @@ -50941,7 +50842,7 @@ endr add hl, bc call Function818fd ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 81d02 @@ -50953,15 +50854,15 @@ Jumptable_81d02: ; 81d02 ; 81d0a Function81d0a: ; 81d0a - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $80 + and D_DOWN jr nz, Function81d89 ld a, [hl] - and $20 + and D_LEFT jr nz, .asm_81d1d ld a, [hl] - and $10 + and D_RIGHT jr nz, .asm_81d28 ret @@ -50980,40 +50881,40 @@ Function81d0a: ; 81d0a ret Function81d34: ; 81d34 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $80 + and D_DOWN jr nz, Function81d89 ld a, [hl] - and $40 + and D_UP jr nz, Function81d84 ld hl, wc608 + 10 jr Function81d63 Function81d46: ; 81d46 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $80 + and D_DOWN jr nz, Function81d89 ld a, [hl] - and $40 + and D_UP jr nz, Function81d84 ld hl, wc608 + 11 jr Function81d63 Function81d58: ; 81d58 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $40 + and D_UP jr nz, Function81d84 ld hl, wc608 + 12 Function81d63: ; 81d63 - ld a, [$ffa9] - and $10 + ld a, [hJoyLast] + and D_RIGHT jr nz, Function81d70 - ld a, [$ffa9] - and $20 + ld a, [hJoyLast] + and D_LEFT jr nz, Function81d77 ret @@ -51033,7 +50934,7 @@ Function81d77: ; 81d77 Function81d7b: ; 81d7b call Function81e67 ld a, $2 - ld [wcf63], a + ld [wJumptableIndex], a ret Function81d84: ; 81d84 @@ -51059,37 +50960,37 @@ Function81d8e: ; 81d8e ld [wd004], a call Function81df4 ld a, $5 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 81daf Function81daf: ; 81daf ld hl, hJoyPressed ld a, [hl] - and $2 + and B_BUTTON jr nz, .asm_81dbb call Function81dc7 ret .asm_81dbb ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 81dc1 Function81dc1: ; 81dc1 - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret ; 81dc7 Function81dc7: ; 81dc7 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $40 + and D_UP jr nz, .asm_81dd5 ld a, [hl] - and $80 + and D_DOWN jr nz, .asm_81de2 ret @@ -51284,20 +51185,21 @@ endr ret ; 81efc -Function81efc: ; 81efc -.asm_81efc +Bank20_FillBoxWithByte: ; 81efc +; For some reason, we have another copy of FillBoxWithByte here +.row push bc push hl -.asm_81efe +.col ld [hli], a dec c - jr nz, .asm_81efe + jr nz, .col pop hl ld bc, SCREEN_WIDTH add hl, bc pop bc dec b - jr nz, .asm_81efc + jr nz, .row ret ; 81f0c @@ -51374,7 +51276,7 @@ Function81f5e: ; 81f5e ld [hl], a hlcoord 1, 15 ld [hl], a - ld a, [wcf63] + ld a, [wJumptableIndex] cp $3 jr nz, .asm_81fc9 ld a, [wcf64] @@ -51382,7 +51284,7 @@ Function81f5e: ; 81f5e jr z, .asm_81f8d dec a hlcoord 1, 11 - ld bc, $0028 + ld bc, 2 * SCREEN_WIDTH call AddNTimes ld [hl], $ed @@ -51447,7 +51349,7 @@ INCBIN "gfx/debug/color_test.2bpp" TilesetColorTest: ret xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [wcf65], a ld [wcf66], a @@ -51458,15 +51360,15 @@ TilesetColorTest: xor a ld [hBGMapMode], a ld de, DebugColorTestGFX + $10 - ld hl, $96a0 + ld hl, VTiles2 tile $6a lb bc, BANK(DebugColorTestGFX), $16 call Request2bpp ld de, DebugColorTestGFX ld hl, VTiles1 lb bc, BANK(DebugColorTestGFX), 1 call Request2bpp - ld a, $9c - ld [$ffd7], a + ld a, VBGMap1 / $100 + ld [hBGMapAddress + 1], a hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld a, $6f @@ -51490,7 +51392,7 @@ TilesetColorTest: call Function821f4 call Function8220f call Function3200 - ld [wcf63], a + ld [wJumptableIndex], a ld a, $40 ld [hWY], a ret @@ -51532,7 +51434,7 @@ Function821f4: ; 821f4 Function82203: ; 82203 ld a, $6a ld [hli], a - ld bc, $000f + ld bc, $10 - 1 ld a, $6b call ByteFill ret @@ -51563,12 +51465,12 @@ endr Function82236: ; 82236 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $4 + and SELECT jr nz, .loop7 ld a, [hl] - and $2 + and B_BUTTON jr nz, .asm_82299 call Function822f0 ret @@ -51660,7 +51562,7 @@ Function822f0: ; 822f0 and 3 ld e, a ld d, 0 - ld hl, Jumptable_82301 + ld hl, .jumptable rept 2 add hl, de endr @@ -51670,7 +51572,7 @@ endr jp [hl] ; 82301 -Jumptable_82301: ; 82301 +.jumptable: ; 82301 dw Function82309 dw Function82339 dw Function8234b @@ -51678,15 +51580,15 @@ Jumptable_82301: ; 82301 ; 82309 Function82309: ; 82309 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $80 + and D_DOWN jr nz, Function8238c ld a, [hl] - and $20 + and D_LEFT jr nz, .asm_8231c ld a, [hl] - and $10 + and D_RIGHT jr nz, .asm_82322 ret @@ -51714,40 +51616,40 @@ endr ret Function82339: ; 82338 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $80 + and D_DOWN jr nz, Function8238c ld a, [hl] - and $40 + and D_UP jr nz, Function82387 ld hl, wc608 + 10 jr Function82368 Function8234b: ; 8234b - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $80 + and D_DOWN jr nz, Function8238c ld a, [hl] - and $40 + and D_UP jr nz, Function82387 ld hl, wc608 + 11 jr Function82368 Function8235d: ; 8235d - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $40 + and D_UP jr nz, Function82387 ld hl, wc608 + 12 Function82368: ; 82368 - ld a, [$ffa9] - and $10 + ld a, [hJoyLast] + and D_RIGHT jr nz, .asm_82375 - ld a, [$ffa9] - and $20 + ld a, [hJoyLast] + and D_LEFT jr nz, .asm_8237c ret @@ -51838,12 +51740,12 @@ Function84000: ; 84000 ld a, [GBPrinter] ld [wcbfb], a xor a - ld [wcf63], a + ld [wJumptableIndex], a ret ; 84022 Function84022: ; 84022 - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_84031 @@ -51881,19 +51783,19 @@ Jumptable_84031: ; 84031 (21:4031) Function84059: ; 84059 (21:4059) - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret Function8405e: ; 8405e (21:405e) - ld hl, wcf63 + ld hl, wJumptableIndex dec [hl] ret Function84063: ; 84063 (21:4063) xor a ld [wca89], a - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret @@ -51903,7 +51805,7 @@ Function8406d: ; 8406d (21:406d) Function84071: ; 84071 (21:4071) ld a, $1 - ld [wcf63], a + ld [wJumptableIndex], a ret Function84077: ; 84077 (21:4077) @@ -51943,7 +51845,7 @@ Function84099: ; 84099 (21:4099) Function840c5: ; 840c5 (21:40c5) ld a, $6 - ld [wcf63], a + ld [wJumptableIndex], a ld hl, Unknown_842c9 call Function841e2 xor a @@ -52035,7 +51937,7 @@ Function84143: ; 84143 (21:4143) ld [wca88], a ld [wca89], a ld a, $e - ld [wcf63], a + ld [wJumptableIndex], a ret Function84180: ; 84180 (21:4180) @@ -52055,7 +51957,7 @@ Function84180: ; 84180 (21:4180) ret .asm_8419b ld a, $12 - ld [wcf63], a + ld [wJumptableIndex], a ret Function841a1: ; 841a1 (21:41a1) @@ -52079,7 +51981,7 @@ Function841b3: ; 841b3 (21:41b3) and $f0 ret nz xor a - ld [wcf63], a + ld [wJumptableIndex], a ret Function841c3: ; 841c3 (21:41c3) @@ -52434,10 +52336,10 @@ Function843e6: ; 843e6 (21:43e6) Function843f0: ; 843f0 .asm_843f0 - call Functiona57 + call JoyTextDelay call Function846f6 jr c, .asm_8440f - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_8440d call Function84022 @@ -52652,14 +52554,14 @@ Function84560: ; 84560 ld a, $9 ld [wcf65], a .asm_84597 - call Functiona57 + call JoyTextDelay call Function846f6 jr c, .asm_845c0 - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_845c0 call Function84022 - ld a, [wcf63] + ld a, [wJumptableIndex] cp $2 jr nc, .asm_845b5 ld a, $3 @@ -52836,7 +52738,7 @@ Function84688: ; 84688 Function846f6: ; 846f6 ld a, [hJoyDown] - and $2 + and B_BUTTON jr nz, .asm_846fe and a ret @@ -52890,7 +52792,7 @@ Function84742: ; 84742 ld [hJoyReleased], a ld [hJoyPressed], a ld [hJoyDown], a - ld [$ffa9], a + ld [hJoyLast], a ret ; 8474c @@ -53025,13 +52927,13 @@ Function84817: ; 84817 (21:4817) xor a ld [wd002], a hlcoord 0, 0 - ld bc, $168 - ld a, $7f + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH + ld a, " " call ByteFill call Function84a0e hlcoord 0, 0 - ld bc, $b4 - ld a, $7f + ld bc, 9 * SCREEN_WIDTH + ld a, " " call ByteFill call Function849e9 call Function849d7 @@ -53060,8 +52962,8 @@ String_84865: Function8486f: ; 8486f (21:486f) hlcoord 0, 0 - ld bc, $168 - ld a, $7f + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH + ld a, " " call ByteFill call Function84a0e call Function849e9 @@ -53077,8 +52979,8 @@ Function8486f: ; 8486f (21:486f) Function84893: ; 84893 (21:4893) hlcoord 0, 0 - ld bc, $168 - ld a, $7f + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH + ld a, " " call ByteFill call Function84a0e call Function849e9 @@ -53094,8 +52996,8 @@ Function84893: ; 84893 (21:4893) Function848b7: ; 848b7 (21:48b7) hlcoord 0, 0 - ld bc, $168 - ld a, $7f + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH + ld a, " " call ByteFill call Function84a0e hlcoord 1, 15 @@ -53132,7 +53034,7 @@ Function848ed: ; 848ed (21:48ed) push de push hl ld bc, $10 - ld a, $7f + ld a, " " call ByteFill pop hl push hl @@ -53153,7 +53055,7 @@ Function848ed: ; 848ed (21:48ed) ld [hli], a push hl ld bc, $e - ld a, $7f + ld a, " " call ByteFill pop hl push hl @@ -53325,7 +53227,7 @@ HallOfFame:: ; 0x8640e push af ld a, 1 ld [wc2cd], a - call Function2ed3 + call DisableSpriteUpdates ld a, SPAWN_LANCE ld [wSpawnAfterChampion], a @@ -53368,7 +53270,7 @@ RedCredits:: ; 86455 callba Function4e8c2 ld c, $8 call DelayFrames - call Function2ed3 + call DisableSpriteUpdates ld a, SPAWN_RED ld [wSpawnAfterChampion], a ld a, [StatusFlags] @@ -53405,7 +53307,7 @@ Function864b4: ; 864b4 Function864c3: ; 864c3 xor a - ld [wcf63], a + ld [wJumptableIndex], a call Function8671c jr c, .done ld de, SCREEN_WIDTH @@ -53474,7 +53376,7 @@ GetHallOfFameParty: ; 8653f ld c, 0 .next ld a, [hli] - cp $ff + cp -1 jr z, .done cp EGG jr nz, .mon @@ -53567,9 +53469,9 @@ endr predef GetUnownLetter hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - ld a, $7f + ld a, " " call ByteFill - ld de, $9310 + ld de, VTiles2 tile $31 predef GetBackpic ld a, $31 ld [$ffad], a @@ -53591,7 +53493,7 @@ endr ld [wc2c6], a hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - ld a, $7f + ld a, " " call ByteFill hlcoord 6, 5 call Function378b @@ -53628,15 +53530,15 @@ endr ; 86650 Function86650: ; 86650 - call Functione58 + call LoadFontsBattleExtra xor a - ld [wcf63], a + ld [wJumptableIndex], a .asm_86657 call Function8671c ret c call Function86665 ret c - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] jr .asm_86657 ; 86665 @@ -53648,16 +53550,16 @@ Function86665: ; 86665 call Function86692 jr c, .asm_86690 .asm_8666e - call Functiona57 - ld hl, $ffa9 + call JoyTextDelay + ld hl, hJoyLast ld a, [hl] - and $2 + and B_BUTTON jr nz, .asm_8668e ld a, [hl] - and $1 + and A_BUTTON jr nz, .asm_86688 ld a, [hl] - and $8 + and START jr nz, .asm_86690 call DelayFrame jr .asm_8666e @@ -53745,7 +53647,7 @@ String_8670c: Function8671c: ; 8671c - ld a, [wcf63] + ld a, [wJumptableIndex] cp NUM_HOF_TEAMS jr nc, .asm_86746 ld hl, sHallOfFame @@ -53787,19 +53689,19 @@ Function86748: ; 86748 ld a, [hli] ld [TempMonLevel], a ld de, StringBuffer2 - ld bc, $000a + ld bc, 10 call CopyBytes - ld a, $50 + ld a, "@" ld [StringBuffer2 + 10], a hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - ld a, $7f + ld a, " " call ByteFill hlcoord 0, 0 - ld bc, $0312 + lb bc, 3, SCREEN_WIDTH - 2 call TextBox hlcoord 0, 12 - ld bc, $0412 + lb bc, 4, SCREEN_WIDTH - 2 call TextBox ld a, [TempMonSpecies] ld [CurPartySpecies], a @@ -53860,19 +53762,19 @@ Function86748: ; 86748 Function86810: ; 86810 call WhiteBGMap - ld hl, $9630 + ld hl, VTiles2 tile $63 ld de, FontExtra + $d0 lb bc, BANK(FontExtra), 1 call Request2bpp hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - ld a, $7f + ld a, " " call ByteFill callba GetPlayerBackpic ld a, $31 ld [$ffad], a hlcoord 6, 6 - ld bc, $0606 + lb bc, 6, 6 predef FillBox ld a, $d0 ld [hSCY], a @@ -53890,7 +53792,7 @@ Function86810: ; 86810 ld [wc2c6], a hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - ld a, $7f + ld a, " " call ByteFill callba Function88840 xor a @@ -53950,417 +53852,16 @@ Function86810: ; 86810 SECTION "bank22", ROMX, BANK[$22] -Function88000: ; 88000 - ld hl, UnknownText_0x88007 - call PrintText - ret -; 88007 - -UnknownText_0x88007: ; 0x88007 - ; Which APRICORN should I use? - text_jump UnknownText_0x1bc06b - db "@" -; 0x8800c - -Function8800c: ; 8800c - ld hl, UnknownText_0x88013 - call PrintText - ret -; 88013 - -UnknownText_0x88013: ; 0x88013 - ; How many should I make? - text_jump UnknownText_0x1bc089 - db "@" -; 0x88018 - -Function88018: ; 88018 - call Function1d6e - ld c, $1 - xor a - ld [wd0e4], a - ld [wdca4], a -.asm_88024 - push bc - call Function88000 - pop bc - ld a, c - ld [MenuSelection], a - call Function88055 - ld a, c - ld [ScriptVar], a - and a - jr z, .asm_88051 - ld [CurItem], a - ld a, [wcfa9] - ld c, a - push bc - call Function8800c - call Function880c2 - pop bc - jr nc, .asm_88024 - ld a, [wd10c] - ld [wdca4], a - call Function88161 - -.asm_88051 - call Function1d7d - ret -; 88055 - -Function88055: ; 88055 - callba Function24c64 - jr c, .asm_88083 - ld hl, MenuDataHeader_0x88086 - call CopyMenuDataHeader - ld a, [MenuSelection] - ld [wcf88], a - xor a - ld [hBGMapMode], a - call Function352f - call UpdateSprites - call Function350c - ld a, [wcf73] - cp $2 - jr z, .asm_88083 - ld a, [MenuSelection] - cp $ff - jr nz, .asm_88084 - -.asm_88083 - xor a - -.asm_88084 - ld c, a - ret -; 88086 - -MenuDataHeader_0x88086: ; 0x88086 - db $40 ; flags - db 01, 01 ; start coords - db 10, 13 ; end coords - dw MenuData2_0x8808f - db 1 ; default option -; 0x8808e - - db 0 - -MenuData2_0x8808f: ; 0x8808f - db $10 ; flags - db 4, 7 - db 1 - dbw 0, wd1ea - dbw BANK(Function8809f), Function8809f - dbw BANK(Function880ab), Function880ab - dbw BANK(NULL), NULL - -Function8809f: ; 8809f - ld a, [MenuSelection] - and a - ret z - callba Function24ab4 - ret -; 880ab - -Function880ab: ; 880ab - ld a, [MenuSelection] - ld [CurItem], a - call Function88139 - ret z - ld a, [wd10c] - ld [wcf75], a - callba Function24ac3 - ret -; 880c2 - -Function880c2: ; 880c2 - ld a, [CurItem] - ld [MenuSelection], a - call Function88139 - jr z, .asm_88109 - ld a, [wd10c] - ld [wd10d], a - ld a, $1 - ld [wd10c], a - ld hl, MenuDataHeader_0x8810d - call LoadMenuDataHeader -.asm_880de - xor a - ld [hBGMapMode], a - call Function1cbb - call UpdateSprites - call Function88116 - call Function88126 - call Function321c - callba Function27a28 - jr nc, .asm_880de - push bc - call PlayClickSFX - pop bc - ld a, b - cp $ff - jr z, .asm_88109 - ld a, [wd10c] - ld [wd10c], a - scf - -.asm_88109 - call WriteBackup - ret -; 8810d - -MenuDataHeader_0x8810d: ; 0x8810d - db $40 ; flags - db 09, 06 ; start coords - db 12, 19 ; end coords - - db 0, 0, -1, 0 ; XXX - -Function88116: ; 88116 - call Function1cfd - ld de, $0015 - add hl, de - ld d, h - ld e, l - callba Function24ab4 - ret -; 88126 - -Function88126: ; 88126 - call Function1cfd - ld de, $0032 - add hl, de - ld [hl], $f1 - inc hl - ld de, wd10c - lb bc, PRINTNUM_LEADINGZEROS | 1, 2 - jp PrintNum -; 88139 - -Function88139: ; 88139 - push bc - ld hl, NumItems - ld a, [CurItem] - ld c, a - ld b, $0 -.asm_88143 - inc hl - ld a, [hli] - cp $ff - jr z, .asm_88153 - cp c - jr nz, .asm_88143 - ld a, [hl] - add b - ld b, a - jr nc, .asm_88143 - ld b, $ff - -.asm_88153 - ld a, b - sub $63 - jr c, .asm_8815a - ld b, $63 - -.asm_8815a - ld a, b - ld [wd10c], a - and a - pop bc - ret -; 88161 - -Function88161: ; 88161 - push de - push bc - ld hl, NumItems - ld a, [CurItem] - ld c, a - ld e, $0 - xor a - ld [wd107], a - ld a, $ff - ld [DefaultFlypoint], a -.asm_88175 - ld a, [wd107] - inc a - ld [wd107], a - inc hl - ld a, [hli] - cp $ff - jr z, .asm_88198 - cp c - jr nz, .asm_88175 - ld d, $0 - push hl - ld hl, DefaultFlypoint - add hl, de - inc e - ld a, [wd107] - dec a - ld [hli], a - ld a, $ff - ld [hl], a - pop hl - jr .asm_88175 - -.asm_88198 - ld a, e - and a - jr z, .asm_881fa - dec a - jr z, .asm_881d0 - ld hl, DefaultFlypoint -.asm_881a2 - ld a, [hl] - ld c, a - push hl -.asm_881a5 - inc hl - ld a, [hl] - cp $ff - jr z, .asm_881c9 - ld b, a - ld a, c - call Function88201 - ld e, a - ld a, b - call Function88201 - sub e - jr z, .asm_881bc - jr c, .asm_881c0 - jr .asm_881a5 - -.asm_881bc - ld a, c - sub b - jr nc, .asm_881a5 - -.asm_881c0 - ld a, c - ld c, b - ld [hl], a - ld a, c - pop hl - ld [hl], a - push hl - jr .asm_881a5 - -.asm_881c9 - pop hl - inc hl - ld a, [hl] - cp $ff - jr nz, .asm_881a2 - -.asm_881d0 - ld hl, DefaultFlypoint -.asm_881d3 - ld a, [hl] - cp $ff - jr z, .asm_881fa - push hl - ld [wd107], a - call Function88211 - pop hl - ld a, [wd10c] - and a - jr z, .asm_881fa - push hl - ld a, [hli] - ld c, a -.asm_881e9 - ld a, [hli] - cp $ff - jr z, .asm_881f6 - cp c - jr c, .asm_881e9 - dec a - dec hl - ld [hli], a - jr .asm_881e9 - -.asm_881f6 - pop hl - inc hl - jr .asm_881d3 - -.asm_881fa - ld a, [wd10c] - and a - pop bc - pop de - ret -; 88201 - -Function88201: ; 88201 - push hl - push bc - ld hl, NumItems - inc hl - ld c, a - ld b, $0 -rept 2 - add hl, bc -endr - inc hl - ld a, [hl] - pop bc - pop hl - ret -; 88211 - -Function88211: ; 88211 - push bc - ld hl, NumItems - ld a, [wd107] - ld c, a - ld b, $0 - inc hl -rept 2 - add hl, bc -endr - ld a, [CurItem] - ld c, a - ld a, [hli] - cp $ff - jr z, .asm_88243 - cp c - jr nz, .asm_88243 - ld a, [wd10c] - ld c, a - ld a, [hl] - sub c - ld b, c - jr nc, .asm_88235 - add c - ld b, a - -.asm_88235 - push bc - ld hl, NumItems - ld a, b - ld [wd10c], a - call TossItem - pop bc - ld a, c - sub b - -.asm_88243 - ld [wd10c], a - pop bc - ret -; 88248 - +INCLUDE "event/kurt.asm" Function88248: ; 88248 - ld c, $c + ld c, CAL ld a, [PlayerGender] bit 0, a - jr z, .asm_88253 - ld c, $e + jr z, .okay + ld c, KAREN -.asm_88253 +.okay ld a, c ld [TrainerClass], a ret @@ -54416,9 +53917,9 @@ ShowPlayerNamingChoices: ; 88297 ld hl, ChrisNameMenuHeader ld a, [PlayerGender] bit 0, a - jr z, .GotClass + jr z, .GotGender ld hl, KrisNameMenuHeader -.GotClass +.GotGender call LoadMenuDataHeader call InterpretMenu2 ld a, [wcfa9] @@ -54511,12 +54012,12 @@ Function8833e: ; 8833e jr z, .GotClass ld hl, KrisCardPic .GotClass - ld de, $9000 + ld de, VTiles2 tile $00 ld bc, $230 ld a, BANK(ChrisCardPic) ; BANK(KrisCardPic) call FarCopyBytes ld hl, CardGFX - ld de, $9230 + ld de, VTiles2 tile $23 ld bc, $60 ld a, BANK(CardGFX) call FarCopyBytes @@ -54546,7 +54047,7 @@ GetPlayerBackpic: ; 88825 GetChrisBackpic: ; 88830 ld hl, ChrisBackpic ld b, BANK(ChrisBackpic) - ld de, $9310 + ld de, VTiles2 tile $31 ld c, 7 * 7 predef DecompressPredef ret @@ -54631,7 +54132,7 @@ INCBIN "gfx/misc/kris.7x7.2bpp" GetKrisBackpic: ; 88ec9 ; Kris's backpic is uncompressed. ld de, KrisBackpic - ld hl, $9310 + ld hl, VTiles2 tile $31 lb bc, BANK(KrisBackpic), 7 * 7 ; dimensions call Get2bpp ret @@ -54646,7822 +54147,26 @@ String_89116: db "-----@" ; 8911c -String_8911c: ; 8911c - db "でんわばんごうが ただしく" ; Phone number is not - next "はいって いません!@" ; entered correctly! -; 89135 - -String_89135: ; 89135 - db "データが かわって いますが" ; The data has changed. - next "かきかえないで やめますか?@" ; Quit anyway? -; 89153 - -String_89153: ; 89153 - db "メッセージは ありません@" ; No message -; 89160 - -Function89160: ; 89160 - push af - ld a, $4 - call GetSRAMBank - pop af - ret -; 89168 - - -Function89168: ; 89168 (22:5168) - ld hl, GameTimerPause - set 7, [hl] - ret - -Function8916e: ; 8916e (22:516e) - ld hl, GameTimerPause - res 7, [hl] - ret - -Function89174: ; 89174 (22:5174) - ld hl, GameTimerPause - bit 7, [hl] - ret - -Function8917a: ; 8917a (22:517a) - ld hl, DefaultFlypoint - ld bc, $32 - xor a - call ByteFill - ret - -Function89185: ; 89185 (22:5185) -; Compares c bytes starting at de and hl and incrementing together until a match is found. - push de - push hl -.loop - ld a, [de] - inc de - cp [hl] - jr nz, .done - inc hl - dec c - jr nz, .loop -.done - pop hl - pop de - ret - -Function89193: ; 89193 -; Copies c bytes from hl to de. - push de - push hl -.loop - ld a, [hli] - ld [de], a - inc de - dec c - jr nz, .loop - pop hl - pop de - ret -; 8919e - - -Function8919e: ; 8919e (22:519e) -; Searches for the c'th string starting at de. Returns the pointer in de. - ld a, c - and a - ret z -.loop - ld a, [de] - inc de - cp "@" - jr nz, .loop - dec c - jr nz, .loop - ret - -Function891ab: ; 891ab - call Function89240 - callba Function104061 - call Function8923c - ret -; 891b8 - -Function891b8: ; 891b8 - call Function8923c - hlcoord 0, 0 - ld a, $7f - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - call ByteFill - call DelayFrame - ret -; 891ca - - -Function891ca: ; 891ca (22:51ca) - push bc - call Function891b8 - call WaitBGMap - pop bc - ret - -Function891d3: ; 891d3 (22:51d3) - push bc - call Function891ca - ld c, $10 - call DelayFrames - pop bc - ret - -Function891de: ; 891de - call Function8923c - call ClearPalettes - hlcoord 0, 0, AttrMap - ld a, $7 - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - call ByteFill - hlcoord 0, 0 - ld a, $7f - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - call ByteFill - call Function891ab - ret -; 891fe - -Function891fe: ; 891fe - push bc - call Function891de - ld c, $10 - call DelayFrames - pop bc - ret -; 89209 - -Function89209: ; 89209 - ld a, 1 - ld [wc2ce], a - ret -; 8920f - -Function8920f: ; 8920f - ld a, 0 - ld [wc2ce], a - ret -; 89215 - -Function89215: ; 89215 - push hl - push bc - ld bc, AttrMap - TileMap - add hl, bc - ld [hl], a - pop bc - pop hl - ret -; 8921f - - -Function8921f: ; 8921f (22:521f) - push de - ld de, SCREEN_WIDTH - add hl, de - inc hl - ld a, $7f -.loop - push bc - push hl -.asm_89229 - ld [hli], a - dec c - jr nz, .asm_89229 - pop hl - add hl, de - pop bc - dec b - jr nz, .loop - pop de - ret - -Function89235: ; 89235 (22:5235) - call Functiona36 - call PlayClickSFX - ret - -Function8923c: ; 8923c - xor a - ld [hBGMapMode], a - ret -; 89240 - -Function89240: ; 89240 - ld a, $1 - ld [hBGMapMode], a - ret -; 89245 - - -Function89245: ; 89245 (22:5245) - callba TryLoadSaveFile - ret c - callba Function150b9 - and a - ret - -Function89254: ; 89254 (22:5254) - ld bc, $d07 - jr Function89261 - -Function89259: ; 89259 - ld bc, $0e07 - jr Function89261 - -Function8925e: ; 8925e - ld bc, $0e0c - -Function89261: ; 89261 - push af - push bc - ld hl, MenuDataHeader_0x892a3 - call CopyMenuDataHeader - pop bc - ld hl, wcf82 - ld a, c - ld [hli], a - ld a, b - ld [hli], a - ld a, c - add $4 - ld [hli], a - ld a, b - add $5 - ld [hl], a - pop af - ld [wcf88], a - call Function1c00 - call Function8923c - call Function89209 - call InterpretMenu2 - push af - ld c, $a - call DelayFrames - call WriteBackup - call Function8920f - pop af - jr c, .done - ld a, [wcfa9] - cp $2 - jr z, .done - and a - ret - -.done - scf - ret -; 892a3 - -MenuDataHeader_0x892a3: ; 0x892a3 - db $40 ; flags - db 05, 10 ; start coords - db 09, 15 ; end coords - dw MenuData2_0x892ab - db 1 ; default option -; 0x892ab - -MenuData2_0x892ab: ; 0x892ab - db $c0 ; flags - db 2 ; items - db "はい@" - db "いいえ@" -; 0x892b4 - -Function892b4: ; 892b4 (22:52b4) - call Function8931b - -Function892b7: ; 892b7 - ld d, b - ld e, c - ld hl, 0 - add hl, bc - ld a, "@" - ld bc, 6 - call ByteFill - ld b, d - ld c, e - ld hl, 6 - add hl, bc - ld a, "@" - ld bc, 6 - call ByteFill - ld b, d - ld c, e - ld hl, 12 - add hl, bc - xor a - ld [hli], a - ld [hl], a - ld hl, 14 - add hl, bc - ld [hli], a - ld [hl], a - ld hl, 16 - add hl, bc - ld [hl], a - ld hl, 17 - add hl, bc - ld a, -1 - ld bc, 8 - call ByteFill - ld b, d - ld c, e - ld e, 6 - ld hl, 25 - add hl, bc -.loop - ld a, -1 - ld [hli], a - ld a, -1 - ld [hli], a - dec e - jr nz, .loop - ret -; 89305 - - -Function89305: ; 89305 (22:5305) - xor a - ld [MenuSelection], a - ld c, 40 -.loop - ld a, [MenuSelection] - inc a - ld [MenuSelection], a - push bc - call Function892b4 - pop bc - dec c - jr nz, .loop - ret - -Function8931b: ; 8931b - push hl - ld hl, $a03b - ld a, [MenuSelection] - dec a - ld bc, $0025 - call AddNTimes - ld b, h - ld c, l - pop hl - ret -; 8932d - -Function8932d: ; 8932d - ld hl, 0 - add hl, bc - -Function89331: ; 89331 -; Scans up to 5 characters starting at hl, looking for a nonspace character up to the next terminator. Sets carry if it does not find a nonspace character. Returns the location of the following character in hl. - push bc - ld c, 5 -.loop - ld a, [hli] - cp "@" - jr z, .terminator - cp " " - jr nz, .nonspace - dec c - jr nz, .loop - -.terminator - scf - jr .done - -.nonspace - and a - -.done - pop bc - ret -; 89346 - - -Function89346: ; 89346 (22:5346) - ld h, b - ld l, c - jr _incave - -Function8934a: ; 8934a - ld hl, 6 - add hl, bc -_incave: -; Scans up to 5 characters starting at hl, looking for a nonspace character up to the next terminator. Sets carry if it does not find a nonspace character. Returns the location of the following character in hl. - push bc - ld c, 5 -.loop - ld a, [hli] - cp "@" - jr z, .terminator - cp " " - jr nz, .nonspace - dec c - jr nz, .loop - -.terminator - scf - jr .done - -.nonspace - and a - -.done - pop bc - ret -; 89363 - -Function89363: ; 89363 -; Scans six byte pairs starting at bc to find $ff. Sets carry if it does not find a $ff. Returns the location of the byte after the first $ff found in hl. - ld h, b - ld l, c - jr ._incave - - ld hl, 25 - add hl, bc - -._incave - push de - ld e, 6 -.loop - ld a, [hli] - cp -1 - jr nz, .ok - ld a, [hli] - cp -1 - jr nz, .ok - dec e - jr nz, .loop - scf - jr .done - -.ok - and a - -.done - pop de - ret -; 89381 - -Function89381: ; 89381 - push bc - push de - call Function89b45 - jr c, .ok - push hl - ld a, -1 - ld bc, 8 - call ByteFill - pop hl - -.ok - pop de - ld c, 8 - call Function89193 - pop bc - ret -; 8939a - -Function8939a: ; 8939a - push bc - ld hl, 0 - add hl, bc - ld de, DefaultFlypoint - ld c, 6 - call Function89193 - pop bc - ld hl, 17 - add hl, bc - ld de, wd008 - call Function89381 - ret -; 893b3 - - -Function893b3: ; 893b3 (22:53b3) - call DisableLCD - call ClearSprites - call Functione51 - call Functione5f - call Function893ef - call Function8942b - call Function89455 - call EnableLCD - ret - -Function893cc: ; 893cc - call DisableLCD - call ClearSprites - call Functione51 - call Functione5f - call Function893ef - call Function89464 - call EnableLCD - ret -; 893e2 - - -Function893e2: ; 893e2 (22:53e2) - call Function89b1e - call Function893b3 - call Function8a5b6 - call Function8949c - ret - -Function893ef: ; 893ef - ld de, VTiles0 - ld hl, GFX_8940b - ld bc, $20 - ld a, BANK(GFX_8940b) - call FarCopyBytes - ret -; 893fe - -Function893fe: ; 893fe - call DisableLCD - call Function893ef - call EnableLCD - call DelayFrame - ret -; 8940b - -GFX_8940b: ; 8940b -INCBIN "gfx/unknown/08940b.2bpp" -; 8942b - -Function8942b: ; 8942b (22:542b) - ld de, $8020 - ld hl, MobileAdapterGFX + $7d0 - ld bc, $80 - ld a, BANK(MobileAdapterGFX) - call FarCopyBytes - ld de, $80a0 - ld hl, MobileAdapterGFX + $c60 - ld bc, $40 - ld a, BANK(MobileAdapterGFX) - call FarCopyBytes - ret - -Function89448: ; 89448 (22:5448) -; Clears the Sprites array - push af - ld hl, Sprites - ld d, $10 * 6 - xor a -.loop - ld [hli], a - dec d - jr nz, .loop - pop af - ret - -Function89455: ; 89455 (22:5455) - ld hl, MobileAdapterGFX + $7d0 - ld de, $90c0 - ld bc, $490 - ld a, BANK(MobileAdapterGFX) - call FarCopyBytes - ret - -Function89464: ; 89464 - ld hl, MobileAdapterGFX - ld de, VTiles2 - ld bc, $200 - ld a, BANK(MobileAdapterGFX) - call FarCopyBytes - ld hl, MobileAdapterGFX + $660 - ld de, $9200 - ld bc, $170 - ld a, BANK(MobileAdapterGFX) - call FarCopyBytes - ret -; 89481 - -Function89481: ; 89481 - ld d, 2 - call Function8934a - ret c - ld d, 0 - ld hl, 16 - add hl, bc - bit 0, [hl] - ret z - inc d - ret -; 89492 - - -Function89492: ; 89492 (22:5492) - ld d, 0 - ld a, [PlayerGender] - bit 0, a - ret z - inc d - ret - -Function8949c: ; 8949c - ld a, [rSVBK] - push af - ld a, 5 - ld [rSVBK], a - ld hl, Palette_894b3 - ld de, Unkn1Pals + 8 * 7 - ld bc, 8 - call CopyBytes - pop af - ld [rSVBK], a - ret -; 894b3 - -Palette_894b3: ; 894b3 - RGB 31, 31, 31 - RGB 31, 31, 31 - RGB 31, 31, 31 - RGB 00, 00, 00 -; 894bb - -Function894bb: ; 894bb - call Function894dc - push bc - call Function8956f - call Function8949c - call Function8a60d - pop bc - ret -; 894ca - - -Function894ca: ; 894ca (22:54ca) - push bc - call Function894dc - call Function895c7 - call Function8949c - call Function8a60d - call Function32f9 - pop bc - ret - -Function894dc: ; 894dc - push bc - ld a, [rSVBK] - push af - ld a, 5 - ld [rSVBK], a - ld c, d - ld b, 0 - ld hl, Unknown_89509 -rept 2 - add hl, bc -endr - ld a, [hli] - ld h, [hl] - ld l, a - ld de, Unkn1Pals - ld bc, 24 - call CopyBytes - ld hl, Palette_89557 - ld de, wd018 - ld bc, 24 - call CopyBytes - pop af - ld [rSVBK], a - pop bc - ret -; 89509 - -Unknown_89509: ; 89509 - dw Palette_8950f - dw Palette_89527 - dw Palette_8953f -; 8950f - -Palette_8950f: ; 8950f - RGB 31, 31, 31 - RGB 10, 17, 13 - RGB 10, 08, 22 - RGB 00, 00, 00 - - RGB 31, 31, 31 - RGB 16, 20, 31 - RGB 10, 08, 22 - RGB 00, 00, 00 - - RGB 31, 31, 31 - RGB 16, 20, 31 - RGB 10, 17, 13 - RGB 00, 00, 00 - -Palette_89527: ; 89527 - RGB 31, 31, 31 - RGB 30, 22, 11 - RGB 31, 08, 15 - RGB 00, 00, 00 - - RGB 31, 31, 31 - RGB 16, 20, 31 - RGB 31, 08, 15 - RGB 00, 00, 00 - - RGB 31, 31, 31 - RGB 16, 20, 31 - RGB 30, 22, 11 - RGB 00, 00, 00 - -Palette_8953f: ; 8953f - RGB 31, 31, 31 - RGB 15, 20, 26 - RGB 25, 07, 20 - RGB 00, 00, 00 - - RGB 31, 31, 31 - RGB 16, 20, 31 - RGB 25, 07, 20 - RGB 00, 00, 00 - - RGB 31, 31, 31 - RGB 16, 20, 31 - RGB 15, 20, 26 - RGB 00, 00, 00 - -Palette_89557: ; 89557 - RGB 31, 31, 31 - RGB 31, 31, 31 - RGB 31, 13, 00 - RGB 14, 08, 00 - - RGB 31, 31, 31 - RGB 16, 16, 31 - RGB 00, 00, 31 - RGB 00, 00, 00 - - RGB 19, 31, 11 - RGB 00, 00, 00 - RGB 00, 00, 00 - RGB 00, 00, 00 -; 8956f - -Function8956f: ; 8956f - push bc - ld hl, 16 - add hl, bc - ld d, h - ld e, l - ld hl, $000c - add hl, bc - ld b, h - ld c, l - callba Function4e929 - ld a, c - ld [TrainerClass], a - ld a, [rSVBK] - push af - ld a, 5 - ld [rSVBK], a - ld hl, wd030 - ld a, -1 - ld [hli], a - ld a, " " - ld [hl], a - pop af - ld [rSVBK], a - ld a, [TrainerClass] - ld h, 0 - ld l, a -rept 2 - add hl, hl -endr - ld de, TrainerPalettes - add hl, de - ld a, [rSVBK] - push af - ld a, $5 - ld [rSVBK], a - ld de, wd032 - ld c, 4 -.loop - ld a, BANK(TrainerPalettes) - call GetFarByte - ld [de], a - inc de - inc hl - dec c - jr nz, .loop - ld hl, wd036 - xor a - ld [hli], a - ld [hl], a - pop af - ld [rSVBK], a - pop bc - ret -; 895c7 - - -Function895c7: ; 895c7 (22:55c7) - ld a, [rSVBK] ; $ff00+$70 - push af - ld a, 5 - ld [rSVBK], a ; $ff00+$70 - ld hl, Palette_895de - ld de, wd030 - ld bc, 8 - call CopyBytes - pop af - ld [rSVBK], a ; $ff00+$70 - ret -; 895de (22:55de) - -Palette_895de: ; 895de - RGB 31, 31, 31 - RGB 07, 07, 06 - RGB 07, 07, 06 - RGB 00, 00, 00 -; 895e6 - -Function895e6: ; 895e6 - ld a, 7 - hlcoord 0, 0, AttrMap - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - call ByteFill - ret -; 895f2 - -Function895f2: ; 895f2 - push bc - xor a - hlcoord 0, 0, AttrMap - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - call ByteFill - call Function89605 - call Function89655 - pop bc - ret -; 89605 - -Function89605: ; 89605 - hlcoord 19, 2, AttrMap - ld a, 1 - ld de, SCREEN_WIDTH - ld c, 14 -.loop - ld [hl], a - dec c - jr z, .done - add hl, de - inc a - ld [hl], a - dec a - add hl, de - dec c - jr nz, .loop - -.done - hlcoord 0, 16, AttrMap - ld c, 10 - ld a, 2 -.loop2 - ld [hli], a - dec a - ld [hli], a - inc a - dec c - jr nz, .loop2 - hlcoord 1, 11, AttrMap - ld a, 4 - ld bc, 4 - call ByteFill - ld a, 5 - ld bc, 14 - call ByteFill - ret -; 8963d - -Function8963d: ; 8963d - hlcoord 12, 3, AttrMap - ld a, 6 - ld de, SCREEN_WIDTH - lb bc, 7, 7 -.loop - push hl - ld c, 7 -.next - ld [hli], a - dec c - jr nz, .next - pop hl - add hl, de - dec b - jr nz, .loop - ret -; 89655 - -Function89655: ; 89655 - hlcoord 1, 12, AttrMap - ld de, SCREEN_WIDTH - ld a, 5 - ld b, 4 -.loop - ld c, 18 - push hl -.next - ld [hli], a - dec c - jr nz, .next - pop hl - add hl, de - dec b - jr nz, .loop - ret -; 8966c - -Function8966c: ; 8966c - push bc - call Function89688 - hlcoord 4, 0 - ld c, 8 - call Function896f5 - pop bc - ret -; 8967a - - -Function8967a: ; 8967a (22:567a) - push bc - call Function89688 - hlcoord 2, 0 - ld c, 12 - call Function896f5 - pop bc - ret - -Function89688: ; 89688 - hlcoord 0, 0 - ld a, 1 - ld e, SCREEN_WIDTH - call Function896e1 - ld a, 2 - ld e, SCREEN_WIDTH - call Function896eb - ld a, 3 - ld [hli], a - ld a, 4 - ld e, SCREEN_HEIGHT - call Function896e1 - ld a, 6 - ld [hli], a - push bc - ld c, 13 -.loop - call Function896cb - dec c - jr z, .done - call Function896d6 - dec c - jr nz, .loop - -.done - pop bc - ld a, 25 - ld [hli], a - ld a, 26 - ld e, SCREEN_HEIGHT - call Function896e1 - ld a, 28 - ld [hli], a - ld a, 2 - ld e, SCREEN_WIDTH - call Function896eb - ret -; 896cb - -Function896cb: ; 896cb - ld de, SCREEN_WIDTH - 1 - ld a, 7 - ld [hl], a - add hl, de - ld a, 9 - ld [hli], a - ret -; 896d6 - -Function896d6: ; 896d6 - ld de, SCREEN_WIDTH - 1 - ld a, 10 - ld [hl], a - add hl, de - ld a, 11 - ld [hli], a - ret -; 896e1 - -Function896e1: ; 896e1 -.loop - ld [hli], a - inc a - dec e - ret z - ld [hli], a - dec a - dec e - jr nz, .loop - ret -; 896eb - -Function896eb: ; 896eb -.loop - ld [hli], a - dec a - dec e - ret z - ld [hli], a - inc a - dec e - jr nz, .loop - ret -; 896f5 - -Function896f5: ; 896f5 - call Function8971f - call Function89736 -rept 2 - inc hl -endr - ld b, 2 - -ClearScreenArea: ; 0x896ff -; clears an area of the screen -; INPUT: -; hl = address of upper left corner of the area -; b = height -; c = width - - ld a, " " ; blank tile - ld de, 20 ; screen width -.loop - push bc - push hl -.innerLoop - ld [hli], a - dec c - jr nz, .innerLoop - pop hl - pop bc - add hl, de - dec b - jr nz, .loop - - dec hl -rept 2 - inc c -endr -.asm_89713 - ld a, $36 - ld [hli], a - dec c - ret z - ld a, $18 - ld [hli], a - dec c - jr nz, .asm_89713 ; 0x8971c $f5 - ret -; 0x8971f - -Function8971f: ; 8971f - ld a, $2c - ld [hli], a - ld a, $2d - ld [hld], a - push hl - ld de, SCREEN_WIDTH - add hl, de - ld a, $31 - ld [hli], a - ld a, $32 - ld [hld], a - add hl, de - ld a, $35 - ld [hl], a - pop hl - ret -; 89736 - -Function89736: ; 89736 - push hl -rept 2 - inc hl -endr - ld e, c - ld d, $0 - add hl, de - ld a, $2f - ld [hli], a - ld a, $30 - ld [hld], a - ld de, SCREEN_WIDTH - add hl, de - ld a, $33 - ld [hli], a - ld a, $34 - ld [hl], a - add hl, de - ld a, $1f - ld [hl], a - pop hl - ret -; 89753 - -Function89753: ; 89753 - ld a, $c - ld [hl], a - xor a - call Function89215 - ret -; 8975b - -Function8975b: ; 8975b - ld a, $1d - ld [hli], a - inc a - ld [hli], a - ld a, $d - ld [hl], a -rept 2 - dec hl -endr - ld a, $4 - ld e, $3 -.asm_89769 - call Function89215 - inc hl - dec e - jr nz, .asm_89769 - ret -; 89771 - -Function89771: ; 89771 - ld a, $12 - ld [hl], a - ld a, $3 - call Function89215 - ret -; 8977a - -Function8977a: ; 8977a - ld e, $4 - ld d, $13 -.asm_8977e - ld a, d - ld [hl], a - ld a, $4 - call Function89215 - inc hl - inc d - dec e - jr nz, .asm_8977e - ld e, $e -.asm_8978c - ld a, d - ld [hl], a - xor a - call Function89215 - inc hl - dec e - jr nz, .asm_8978c - ret -; 89797 - -Function89797: ; 89797 - push bc - ld a, $e - ld [hl], a - ld bc, SCREEN_WIDTH - add hl, bc - ld a, $11 - ld [hli], a - ld a, $10 - ld c, $8 -.asm_897a6 - ld [hli], a - dec c - jr nz, .asm_897a6 - ld a, $f - ld [hl], a - pop bc - ret -; 897af - -Function897af: ; 897af - push bc - ld hl, $0010 - add hl, bc - ld d, h - ld e, l - ld hl, $000c - add hl, bc - ld b, h - ld c, l - callba Function4e929 - ld a, c - ld [TrainerClass], a - xor a - ld [CurPartySpecies], a - ld de, $9370 - callba GetTrainerPic - pop bc - ret -; 897d5 - -Function897d5: ; 897d5 - push bc - call Function8934a - jr nc, .asm_897f3 - hlcoord 12, 3, AttrMap - xor a - ld de, SCREEN_WIDTH - lb bc, 7, 7 -.asm_897e5 - push hl - ld c, $7 -.asm_897e8 - ld [hli], a - dec c - jr nz, .asm_897e8 - pop hl - add hl, de - dec b - jr nz, .asm_897e5 - pop bc - ret - -.asm_897f3 - ld a, $37 - ld [$ffad], a - hlcoord 12, 3 - lb bc, 7, 7 - predef FillBox - call Function8963d - pop bc - ret -; 89807 - - -Function89807: ; 89807 (22:5807) - ld hl, MobileAdapterGFX + $200 - ld a, [PlayerGender] - bit 0, a - jr z, .asm_89814 - ld hl, MobileAdapterGFX + $200 + $230 -.asm_89814 - call DisableLCD - ld de, $9370 - ld bc, $230 - ld a, BANK(MobileAdapterGFX) - call FarCopyBytes - call EnableLCD - call DelayFrame - ret - -Function89829: ; 89829 (22:5829) - push bc - ld bc, $705 - ld de, $14 - ld a, $37 -.asm_89832 - push bc - push hl -.asm_89834 - ld [hli], a - inc a - dec c - jr nz, .asm_89834 - pop hl - add hl, de - pop bc - dec b - jr nz, .asm_89832 - call Function8963d - pop bc - ret - -Function89844: ; 89844 - call Function89481 - call Function894bb - call Function897af - push bc - call Function3200 - call Function32f9 - pop bc - ret -; 89856 - -Function89856: ; 89856 - push bc - call Function891b8 - pop bc - call Function895f2 - call Function8966c - call Function899d3 - call Function898aa - call Function898be - call Function898dc - call Function898f3 - push bc - ld bc, wd008 - hlcoord 2, 10 - call Function89975 - pop bc - call Function897d5 - ret -; 8987f - - -Function8987f: ; 8987f (22:587f) - call Function891b8 - call Function895f2 - call Function8967a - call Function899d3 - hlcoord 5, 1 - call Function8999c - hlcoord 13, 3 - call Function89829 - call Function899b2 - hlcoord 5, 5 - call Function899c9 - ld bc, wd008 - hlcoord 2, 10 - call Function89975 - ret - -Function898aa: ; 898aa - ld a, [MenuSelection] - and a - ret z - push bc - hlcoord 6, 1 - ld de, MenuSelection - lb bc, PRINTNUM_LEADINGZEROS | 1, 2 - call PrintNum - pop bc - ret -; 898be - -Function898be: ; 898be - push bc - ld de, DefaultFlypoint - ld hl, DefaultFlypoint - call Function89331 - jr nc, .asm_898cd - ld de, String_89116 - -.asm_898cd - hlcoord 9, 1 - ld a, [MenuSelection] - and a - jr nz, .asm_898d7 - dec hl - -.asm_898d7 - call PlaceString - pop bc - ret -; 898dc - -Function898dc: ; 898dc - ld hl, $0006 - add hl, bc - push bc - ld d, h - ld e, l - call Function8934a - jr nc, .asm_898eb - ld de, String_89116 - -.asm_898eb - hlcoord 6, 4 - call PlaceString - pop bc - ret -; 898f3 - -Function898f3: ; 898f3 - push bc - ld hl, $000c - add hl, bc - ld d, h - ld e, l - call Function8934a - jr c, .asm_8990a - hlcoord 5, 5 - lb bc, PRINTNUM_LEADINGZEROS | 2, 5 - call PrintNum - jr .asm_89913 - -.asm_8990a - hlcoord 5, 5 - ld de, String_89116 - call PlaceString - -.asm_89913 - pop bc - ret -; 89915 - -Function89915: ; 89915 - push bc - push hl - ld de, Unknown_89942 - ld c, $8 -.asm_8991c - ld a, [de] - ld [hl], a - ld a, $4 - call Function89215 - inc hl - inc de - dec c - jr nz, .asm_8991c - pop hl - ld b, $4 - ld c, $2b - ld a, $8 - ld de, Unknown_8994a -.asm_89932 - push af - ld a, [de] - cp [hl] - jr nz, .asm_8993b - call Function8994e - inc de - -.asm_8993b - inc hl - pop af - dec a - jr nz, .asm_89932 - pop bc - ret -; 89942 - -Unknown_89942: ; 89942 - db $24, $25, $26, " ", $27, $28, $29, $2a -Unknown_8994a: ; 8994a - db $24, $27, $29, $ff -; 8994e - -Function8994e: ; 8994e - push hl - push de - ld de, SCREEN_WIDTH - ld a, l - sub e - ld l, a - ld a, h - sbc d - ld h, a - ld a, c - ld [hl], a - ld a, b - call Function89215 - pop de - pop hl - ret -; 89962 - -Function89962: ; 89962 - push bc - ld c, $4 - ld b, $20 -.asm_89967 - ld a, b - ld [hl], a - ld a, $4 - call Function89215 - inc hl - inc b - dec c - jr nz, .asm_89967 - pop bc - ret -; 89975 - -Function89975: ; 89975 - push bc - ld e, $8 -.asm_89978 - ld a, [bc] - ld d, a - call Function8998b - swap d - inc hl - ld a, d - call Function8998b - inc bc - inc hl - dec e - jr nz, .asm_89978 - pop bc - ret -; 8998b - -Function8998b: ; 8998b - push bc - and $f - cp $a - jr nc, .asm_89997 - ld c, $f6 - add c - jr .asm_89999 - -.asm_89997 - ld a, $7f - -.asm_89999 - ld [hl], a - pop bc - ret -; 8999c - - -Function8999c: ; 8999c (22:599c) - ld de, PlayerName - call PlaceString - inc bc - ld h, b - ld l, c - ld de, String_899ac - call PlaceString - ret -; 899ac (22:59ac) - -String_899ac: ; 899ac - db "の めいし@" -; 899b2 - -Function899b2: ; 899b2 (22:59b2) - ld bc, PlayerName - call Function89346 - jr c, .asm_899bf - ld de, PlayerName - jr .asm_899c2 -.asm_899bf - ld de, String_89116 -.asm_899c2 - hlcoord 6, 4 - call PlaceString - ret - -Function899c9: ; 899c9 (22:59c9) - ld de, PlayerID - lb bc, PRINTNUM_LEADINGZEROS | 2, 5 - call PrintNum - ret - -Function899d3: ; 899d3 - hlcoord 1, 4 - call Function89753 - hlcoord 2, 5 - call Function8975b - hlcoord 1, 9 - call Function89771 - hlcoord 1, 11 - call Function8977a - hlcoord 1, 5 - call Function89797 - hlcoord 2, 4 - call Function89962 - hlcoord 2, 9 - call Function89915 - ret -; 899fe - -Function899fe: ; 899fe - push bc - push hl - ld hl, $0019 - add hl, bc - ld b, h - ld c, l - pop hl - call Function89a0c - pop bc - ret -; 89a0c - -Function89a0c: ; 89a0c - push hl - call Function89363 - pop hl - jr c, .asm_89a1c - ld d, h - ld e, l - callba Function11c08f - ret - -.asm_89a1c - ld de, String_89153 - call PlaceString - ret -; 89a23 - - -Function89a23: ; 89a23 (22:5a23) - hlcoord 0, 11 - ld b, $4 - ld c, $12 - call Function8921f - ret - -Function89a2e: ; 89a2e (22:5a2e) - hlcoord 11, 12 - ld b, $2 - ld c, $6 - call TextBox - hlcoord 13, 13 - ld de, String_89a4e - call PlaceString - hlcoord 13, 14 - ld de, String_89a53 - call PlaceString - call Function89655 - ret -; 89a4e (22:5a4e) - -String_89a4e: ; 89a4e - db "けってい@" -; 89a53 - -String_89a53: ; 89a53 - db "やめる@" -; 89a57 - -Function89a57: ; 89a57 - call Function354b - bit 6, c - jr nz, .asm_89a78 - bit 7, c - jr nz, .asm_89a81 - bit 0, c - jr nz, .asm_89a70 - bit 1, c - jr nz, .asm_89a70 - bit 3, c - jr nz, .asm_89a74 - scf - ret - -.asm_89a70 - ld a, $1 - and a - ret - -.asm_89a74 - ld a, $2 - and a - ret - -.asm_89a78 - call Function89a9b - call nc, Function89a8a - ld a, $0 - ret - -.asm_89a81 - call Function89a93 - call nc, Function89a8a - ld a, $0 - ret -; 89a8a - -Function89a8a: ; 89a8a - push af - ld de, SFX_UNKNOWN_62 - call PlaySFX - pop af - ret -; 89a93 - -Function89a93: ; 89a93 - ld d, $28 - ld e, $1 - call Function89aa3 - ret -; 89a9b - -Function89a9b: ; 89a9b - ld d, $1 - ld e, $ff - call Function89aa3 - ret -; 89aa3 - -Function89aa3: ; 89aa3 - ld a, [MenuSelection] - ld c, a - push bc -.asm_89aa8 - ld a, [MenuSelection] - cp d - jr z, .asm_89ac0 - add e - jr nz, .asm_89ab2 - inc a - -.asm_89ab2 - ld [MenuSelection], a - call Function89ac7 - jr nc, .asm_89aa8 - call Function89ae6 - pop bc - and a - ret - -.asm_89ac0 - pop bc - ld a, c - ld [MenuSelection], a - scf - ret -; 89ac7 - -Function89ac7: ; 89ac7 - call Function89160 - call Function8931b - call Function89ad4 - call CloseSRAM - ret -; 89ad4 - -Function89ad4: ; 89ad4 - push de - call Function8932d - jr c, .asm_89ae3 - ld hl, $0011 - add hl, bc - call Function89b45 - jr c, .asm_89ae4 - -.asm_89ae3 - and a - -.asm_89ae4 - pop de - ret -; 89ae6 - -Function89ae6: ; 89ae6 - ld hl, wd031 - xor a - ld [hl], a - ld a, [MenuSelection] -.asm_89aee - cp $6 - jr c, .asm_89afc - sub $5 - ld c, a - ld a, [hl] - add $5 - ld [hl], a - ld a, c - jr .asm_89aee - -.asm_89afc - ld [wd030], a - ret -; 89b00 - - -Function89b00: ; 89b00 (22:5b00) - callba Function49351 - ret -; 89b07 (22:5b07) - -Function89b07: ; 89b07 - call Function8923c - call DelayFrame - callba Function4a3a7 - ret -; 89b14 - -Function89b14: ; 89b14 - call WhiteBGMap - call Function89b07 - call Function89b00 - ret -; 89b1e - -Function89b1e: ; 89b1e (22:5b1e) - callba Function4a485 - call Function89b00 - ret - -Function89b28: ; 89b28 (22:5b28) - call Function891de - call WhiteBGMap - call Function893e2 - call Function1d7d - call Function891ab - call Function32f9 - ret - -Function89b3b: ; 89b3b (22:5b3b) - call Function8923c - callba Function48cda - ret - -Function89b45: ; 89b45 - push hl - push bc - ld c, $10 - ld e, $0 -.asm_89b4b - ld a, [hli] - ld b, a - and $f - cp $a - jr c, .asm_89b5a - ld a, c - cp $b - jr nc, .asm_89b74 - jr .asm_89b71 - -.asm_89b5a - dec c - swap b - inc e - ld a, b - and $f - cp $a - jr c, .asm_89b6c - ld a, c - cp $b - jr nc, .asm_89b74 - jr .asm_89b71 - -.asm_89b6c - inc e - dec c - jr nz, .asm_89b4b - dec e - -.asm_89b71 - scf - jr .asm_89b75 - -.asm_89b74 - and a - -.asm_89b75 - pop bc - pop hl - ret -; 89b78 - - -Function89b78: ; 89b78 (22:5b78) - push bc - ld a, [wd010] - cp $10 - jr c, .asm_89b8c - ld a, e - and a - jr z, .asm_89b89 - ld c, e -.asm_89b85 - inc hl - dec c - jr nz, .asm_89b85 -.asm_89b89 - ld a, $7f - ld [hl], a -.asm_89b8c - ld a, [wd010] - inc a - and $1f - ld [wd010], a - pop bc - ret - -Function89b97: ; 89b97 (22:5b97) - call Function89c34 - jr c, .asm_89ba0 - call Function89448 - ret -.asm_89ba0 - ld a, [wd011] - ld hl, Unknown_89bd8 - and a - jr z, .asm_89bae -.asm_89ba9 -rept 2 - inc hl -endr - dec a - jr nz, .asm_89ba9 -.asm_89bae - ld a, [hli] - ld h, [hl] - ld l, a - ld de, Sprites -.asm_89bb4 - ld a, [hli] - cp $ff - ret z - ld c, a - ld b, $0 -.asm_89bbb - push hl - ld a, [hli] - ld [de], a - inc de - ld a, [hli] - add b - ld [de], a - inc de - ld a, $8 - add b - ld b, a - ld a, [hli] - ld [de], a - inc de - ld a, [hli] - ld [de], a - inc de - pop hl - dec c - jr nz, .asm_89bbb - ld b, $0 - ld c, $4 - add hl, bc - jr .asm_89bb4 -; 89bd8 (22:5bd8) - -Unknown_89bd8: ; 89bd8 - dw Unknown_89be0 - dw Unknown_89bf5 - dw Unknown_89c0a - dw Unknown_89c1f -; 89be0 - -Unknown_89be0: ; 89be0 - db $01, $12, $4e, $01, $00 - db $01, $19, $4e, $01, $40 - db $01, $12, $72, $01, $20 - db $01, $19, $72, $01, $60 - db $ff - -Unknown_89bf5: ; 89bf5 - db $01, $60, $16, $01, $00 - db $01, $62, $16, $01, $40 - db $01, $60, $92, $01, $20 - db $01, $62, $92, $01, $60 - db $ff - -Unknown_89c0a: ; 89c0a - db $01, $78, $66, $01, $00 - db $01, $78, $66, $01, $40 - db $01, $78, $92, $01, $20 - db $01, $78, $92, $01, $60 - db $ff - -Unknown_89c1f: ; 89c1f - db $01, $80, $66, $01, $00 - db $01, $80, $66, $01, $40 - db $01, $80, $92, $01, $20 - db $01, $80, $92, $01, $60 - db $ff -; 89c34 - -Function89c34: ; 89c34 (22:5c34) - push bc - ld a, [wd012] - ld c, a - inc a - and $f - ld [wd012], a - ld a, c - cp $8 - pop bc - ret - -Function89c44: ; 89c44 (22:5c44) - call Function89c34 - jr c, .asm_89c4f - push de - call Function89448 - pop de - ret -.asm_89c4f - ld hl, Sprites - push de - ld a, b - ld [hli], a - ld d, $8 - ld a, e - and a - ld a, c - jr z, .asm_89c60 -.asm_89c5c - add d - dec e - jr nz, .asm_89c5c -.asm_89c60 - pop de - ld [hli], a - ld a, d - ld [hli], a - xor a - ld [hli], a - ret - -Function89c67: ; 89c67 (22:5c67) - call Function354b - ld b, $0 - bit 0, c - jr z, .asm_89c74 - ld b, $1 - and a - ret -.asm_89c74 - bit 1, c - jr z, .asm_89c7a - scf - ret -.asm_89c7a - xor a - bit 6, c - jr z, .asm_89c81 - ld a, $1 -.asm_89c81 - bit 7, c - jr z, .asm_89c87 - ld a, $2 -.asm_89c87 - bit 5, c - jr z, .asm_89c8d - ld a, $3 -.asm_89c8d - bit 4, c - jr z, .asm_89c93 - ld a, $4 -.asm_89c93 - and a - ret z - dec a - ld c, a - ld d, $0 - ld hl, Unknown_89cbf - ld a, [wd02f] - and a - jr z, .asm_89ca5 - ld hl, Unknown_89ccf -.asm_89ca5 - ld a, [wd011] - and a - jr z, .asm_89cb1 - ld e, $4 -.asm_89cad - add hl, de - dec a - jr nz, .asm_89cad -.asm_89cb1 - ld e, c - add hl, de - ld a, [hl] - and a - ret z - dec a - ld [wd011], a - xor a - ld [wd012], a - ret -; 89cbf (22:5cbf) - -Unknown_89cbf: ; 89cbf - db 0, 2, 0, 0 - db 1, 3, 0, 0 - db 2, 4, 0, 0 - db 3, 0, 0, 0 - -Unknown_89ccf: ; 89ccf - db 0, 0, 0, 0 - db 0, 3, 0, 0 - db 2, 4, 0, 0 - db 3, 0, 0, 0 -; 89cdf - -Function89cdf: ; 89cdf (22:5cdf) - ld a, $10 - add b - ld b, a - ld a, $8 - add c - ld c, a - ld e, $2 - ld a, $2 - ld hl, Sprites -.asm_89cee - push af - push bc - ld d, $4 -.asm_89cf2 - ld a, b - ld [hli], a - ld a, c - ld [hli], a - ld a, e - ld [hli], a - ld a, $1 - ld [hli], a - ld a, $8 - add c - ld c, a - inc e - dec d - jr nz, .asm_89cf2 - pop bc - ld a, $8 - add b - ld b, a - pop af - dec a - jr nz, .asm_89cee - ret - -Function89d0d: ; 89d0d (22:5d0d) - call Function8923c - ld a, [rSVBK] ; $ff00+$70 - push af - ld a, $5 - ld [rSVBK], a ; $ff00+$70 - ld c, $8 - ld de, Unkn1Pals -.asm_89d1c - push bc - ld hl, Palette_89d4e - ld bc, $8 - call CopyBytes - pop bc - dec c - jr nz, .asm_89d1c - ld hl, Palette_89d56 - ld de, wd010 - ld bc, $8 - call CopyBytes - pop af - ld [rSVBK], a ; $ff00+$70 - call Function32f9 - callba Function845db - call Function89240 - ld c, $18 - call DelayFrames - call RestartMapMusic - ret -; 89d4e (22:5d4e) - -Palette_89d4e: ; 89d4e - RGB 31, 31, 31 - RGB 19, 19, 19 - RGB 15, 15, 15 - RGB 00, 00, 00 -; 89d56 - -Palette_89d56: ; 89d56 - RGB 31, 31, 31 - RGB 19, 19, 19 - RGB 19, 19, 19 - RGB 00, 00, 00 -; 89d5e - -Function89d5e: ; 89d5e (22:5d5e) - push af - call CopyMenuDataHeader - pop af - ld [wcf88], a - call Function8923c - call Function1c89 - call Function1c10 - ld hl, wcfa5 - set 7, [hl] - ret - -Function89d75: ; 89d75 (22:5d75) - push hl - call Function8923c - call _hl_ - callba Function104148 - pop hl - jr asm_89d90 - -Function89d85: ; 89d85 (22:5d85) - push hl - call Function8923c - call _hl_ - call Function3238 - pop hl - -asm_89d90: ; 89d90 (22:5d90) - call Function8923c - push hl - call _hl_ - call Function89dab - ld a, [wcfa9] - push af - call Function891ab - pop af - pop hl - jr c, .asm_89da9 - jr z, asm_89d90 - scf - ret -.asm_89da9 - and a - ret - -Function89dab: ; 89dab (22:5dab) - call Function8923c - callba Function241ba - call Function8923c - ld a, c - ld hl, wcfa8 - and [hl] - ret z - bit 0, a - jr nz, .asm_89dc7 - bit 1, a - jr nz, .asm_89dd9 - xor a - ret -.asm_89dc7 - call PlayClickSFX - ld a, [wcfa3] - ld c, a - ld a, [wcfa9] - cp c - jr z, .asm_89dd9 - call Function1bee - scf - ret -.asm_89dd9 - call PlayClickSFX - ld a, $1 - and a - ret - -Function89de0: ; 89de0 (22:5de0) - call ClearSprites - call Function89e0a - jr c, .asm_89e00 - ld c, $1 -.asm_89dea - call Function8a31c - jr z, .asm_89dfd - ld a, [wcfa9] - ld c, a - push bc - ld hl, Jumptable_89e04 - ld a, e - dec a - rst JumpTable - pop bc - jr .asm_89dea -.asm_89dfd - call Function891fe -.asm_89e00 - call Function8917a - ret - -Jumptable_89e04: ; 89e04 (22:5e04) - dw Function8a62c - dw Function8a999 - dw Function8ab93 - - -Function89e0a: ; 89e0a (22:5e0a) - call Function89160 - call Function8b3b0 - call CloseSRAM - ld hl, Jumptable_89e18 - rst JumpTable - ret - -Jumptable_89e18: ; 89e18 (22:5e18) - dw Function89e1e - dw Function8a116 - dw Function8a2aa - - -Function89e1e: ; 89e1e (22:5e1e) - call Function89160 - ld bc, $a037 - call Function8b36c - call CloseSRAM - xor a - ld [wd02d], a - -asm_89e2e: ; 89e2e (22:5e2e) - ld a, [wd02d] - ld hl, Jumptable_89e3c - rst JumpTable - ret - -Function89e36: ; 89e36 (22:5e36) - ld hl, wd02d - inc [hl] - jr asm_89e2e - -Jumptable_89e3c: ; 89e3c (22:5e3c) - dw Function89e6f - dw Function89fed - dw Function89ff6 - dw Function8a03d - dw Function89eb9 - dw Function89efd - dw Function89fce - dw Function8a04c - dw Function8a055 - dw Function8a0e6 - dw Function8a0ec - dw Function8a0f5 - dw Function89e58 - dw Function89e68 - - -Function89e58: ; 89e58 (22:5e58) - ld a, $1 - call Function8a2fe - call Function891fe - call Function893e2 - call Function89168 - and a - ret - -Function89e68: ; 89e68 (22:5e68) - call Function891fe - ld a, $1 - scf - ret - -Function89e6f: ; 89e6f (22:5e6f) - call Function891de - call Function89245 - call Function89ee1 - call Function89e9a - hlcoord 7, 4 - call Function8a58d - ld a, $5 - hlcoord 7, 4, AttrMap - call Function8a5a3 - ld a, $6 - hlcoord 10, 4, AttrMap - call Function8a5a3 - call Function891ab - call Function32f9 - jp Function89e36 - -Function89e9a: ; 89e9a (22:5e9a) - ld a, [rSVBK] ; $ff00+$70 - push af - ld a, $5 - ld [rSVBK], a ; $ff00+$70 - ld hl, Palette_89eb1 - ld de, wd028 - ld bc, $8 - call CopyBytes - pop af - ld [rSVBK], a ; $ff00+$70 - ret -; 89eb1 (22:5eb1) - -Palette_89eb1: ; 89eb1 - RGB 31, 31, 31 - RGB 31, 31, 31 - RGB 27, 19, 00 - RGB 00, 00, 00 -; 89eb9 - -Function89eb9: ; 89eb9 (22:5eb9) - call Function891fe - call Function89ee1 - call Function89e9a - hlcoord 7, 4 - call Function8a58d - ld a, $5 - hlcoord 7, 4, AttrMap - call Function8a5a3 - ld a, $6 - hlcoord 10, 4, AttrMap - call Function8a5a3 - call Function891ab - call Function32f9 - jp Function89e36 - -Function89ee1: ; 89ee1 (22:5ee1) - call WhiteBGMap - call Function893e2 - call Function8923c - callba Function4a3a7 - callba Function49384 - hlcoord 1, 0 - call Function8a53d - ret - -Function89efd: ; 89efd (22:5efd) - ld hl, wd012 - ld a, $ff - ld [hli], a - xor a -rept 4 - ld [hli], a -endr - ld [hl], a -.asm_89f09 - ld hl, wd012 - inc [hl] - ld a, [hli] - and $3 - jr nz, .asm_89f2e - ld a, [hl] - cp $4 - jr nc, .asm_89f2e - ld b, $32 - inc [hl] - ld a, [hl] - dec a - jr z, .asm_89f26 - ld c, a -.asm_89f1f - ld a, $b - add b - ld b, a - dec c - jr nz, .asm_89f1f -.asm_89f26 - ld c, $e8 - ld a, [wd013] - call Function89fa5 -.asm_89f2e - ld a, [wd013] - and a - jr z, .asm_89f58 -.asm_89f34 - call Function89f6a - ld e, a - ld a, c - cp $a8 - jr nc, .asm_89f4d - cp $46 - jr c, .asm_89f4d - ld d, $0 - dec e - ld hl, wd014 - add hl, de - set 0, [hl] - inc e - jr .asm_89f51 -.asm_89f4d - ld a, $2 - add c - ld c, a -.asm_89f51 - ld a, e - call Function89f77 - dec a - jr nz, .asm_89f34 -.asm_89f58 - call DelayFrame - ld hl, wd014 - ld c, $4 -.asm_89f60 - ld a, [hli] - and a - jr z, .asm_89f09 - dec c - jr nz, .asm_89f60 - jp Function89e36 - -Function89f6a: ; 89f6a (22:5f6a) - push af - ld de, $10 - call Function89f9a - ld a, [hli] - ld b, a - ld a, [hl] - ld c, a - pop af - ret - -Function89f77: ; 89f77 (22:5f77) - push af - ld de, $10 - call Function89f9a - ld d, $2 -.asm_89f80 - push bc - ld e, $2 -.asm_89f83 - ld a, b - ld [hli], a - ld a, c - ld [hli], a -rept 2 - inc hl -endr - ld a, $8 - add c - ld c, a - dec e - jr nz, .asm_89f83 - pop bc - ld a, $8 - add b - ld b, a - dec d - jr nz, .asm_89f80 - pop af - ret - -Function89f9a: ; 89f9a (22:5f9a) - dec a - ld hl, Sprites - and a - ret z -.asm_89fa0 - add hl, de - dec a - jr nz, .asm_89fa0 - ret - -Function89fa5: ; 89fa5 (22:5fa5) - ld de, $10 - call Function89f9a - ld e, $2 - ld d, $a -.asm_89faf - push bc - ld a, $2 -.asm_89fb2 - push af - ld a, b - ld [hli], a - ld a, c - ld [hli], a - ld a, d - inc d - ld [hli], a - ld a, $1 - ld [hli], a - ld a, $8 - add c - ld c, a - pop af - dec a - jr nz, .asm_89fb2 - pop bc - ld a, $8 - add b - ld b, a - dec e - jr nz, .asm_89faf - ret - -Function89fce: ; 89fce (22:5fce) - call Function8a5b6 - ld a, $5 - hlcoord 7, 4, AttrMap - call Function8a5a3 - ld a, $6 - hlcoord 10, 4, AttrMap - call Function8a5a3 - call Function89448 - call Function32f9 - call Function891ab - jp Function89e36 - -Function89fed: ; 89fed (22:5fed) - ld hl, UnknownText_0x8a102 - call PrintText - jp Function89e36 - -Function89ff6: ; 89ff6 (22:5ff6) - call Function891fe - call WhiteBGMap - call Function893cc - call Function89807 - call Function89492 - call Function894ca - call Function89160 - ld hl, $a603 - ld a, $ff - ld bc, $8 - call ByteFill - ld hl, $a603 - ld de, wd008 - call Function89381 - call CloseSRAM - call Function8987f - call Function89160 - hlcoord 1, 13 - ld bc, $a007 - call Function89a0c - call CloseSRAM - call Function891ab - call Function89235 - jp Function89e36 - -Function8a03d: ; 8a03d (22:603d) - ld hl, UnknownText_0x8a107 - call Function89209 - call PrintText - call Function8920f - jp Function89e36 - -Function8a04c: ; 8a04c (22:604c) - ld hl, UnknownText_0x8a10c - call PrintText - jp Function89e36 - -Function8a055: ; 8a055 (22:6055) - ld c, $7 - ld b, $4 -.asm_8a059 - call Function8a0a1 - inc c - call Function8a0c9 - push bc - call Function8a58d - pop bc - call Function8a0de - push bc - push hl - ld a, $5 - call Function8a5a3 - pop hl -rept 3 - inc hl -endr - ld a, $6 - call Function8a5a3 - call Function3238 - pop bc - ld a, c - cp $b - jr nz, .asm_8a059 - call Function8a0a1 - hlcoord 12, 4 - call Function8a58d - ld a, $5 - hlcoord 12, 4, AttrMap - call Function8a5a3 - pop hl - ld a, $6 - hlcoord 15, 4, AttrMap - call Function8a5a3 - call Function3238 - jp Function89e36 - -Function8a0a1: ; 8a0a1 (22:60a1) - call Function8923c - push bc - call Function8a0c9 - ld e, $6 -.asm_8a0aa - push hl - ld bc, $6 - add hl, bc - ld d, [hl] - call Function8a0c1 - pop hl - ld [hl], d - call Function89215 - ld bc, $14 - add hl, bc - dec e - jr nz, .asm_8a0aa - pop bc - ret - -Function8a0c1: ; 8a0c1 (22:60c1) - push hl - ld bc, AttrMap - TileMap - add hl, bc - ld a, [hl] - pop hl - ret - -Function8a0c9: ; 8a0c9 (22:60c9) - push bc - hlcoord 0, 0 - ld de, $14 - ld a, b - and a - jr z, .asm_8a0d8 -.asm_8a0d4 - add hl, de - dec b - jr nz, .asm_8a0d4 -.asm_8a0d8 - ld d, $0 - ld e, c - add hl, de - pop bc - ret - -Function8a0de: ; 8a0de (22:60de) - call Function8a0c9 - ld de, AttrMap - TileMap - add hl, de - ret - -Function8a0e6: ; 8a0e6 (22:60e6) - call Function8b539 - jp Function89e36 - -Function8a0ec: ; 8a0ec (22:60ec) - ld hl, UnknownText_0x8a111 - call PrintText - jp Function89e36 - -Function8a0f5: ; 8a0f5 (22:60f5) - call Function8b555 - jp nc, Function8a0ff - ld hl, wd02d - inc [hl] - -Function8a0ff: ; 8a0ff (22:60ff) - jp Function89e36 -; 8a102 (22:6102) - -UnknownText_0x8a102: ; 0x8a102 - ; The CARD FOLDER stores your and your friends' CARDS. A CARD contains information like the person's name, phone number and profile. - text_jump UnknownText_0x1c5238 - db "@" -; 0x8a107 - -UnknownText_0x8a107: ; 0x8a107 - ; This is your CARD. Once you've entered your phone number, you can trade CARDS with your friends. - text_jump UnknownText_0x1c52bc - db "@" -; 0x8a10c - -UnknownText_0x8a10c: ; 0x8a10c - ; If you have your friend's CARD, you can use it to make a call from a mobile phone on the 2nd floor of a #MON CENTER. - text_jump UnknownText_0x1c531e - db "@" -; 0x8a111 - -UnknownText_0x8a111: ; 0x8a111 - ; To safely store your collection of CARDS, you must set a PASSCODE for your CARD FOLDER. - text_jump UnknownText_0x1c5394 - db "@" -; 0x8a116 - -Function8a116: ; 8a116 (22:6116) - ld a, $1 - ld [wd030], a - ld hl, MenuDataHeader_0x8a176 - call LoadMenuDataHeader -.asm_8a121 - call Function8923c - call Function8a17b - jr c, .asm_8a16b - ld a, [wcfa9] - ld [wd030], a - dec d - jr z, .asm_8a140 - call Function8a20d - jr c, .asm_8a121 - xor a - call Function8a2fe - call Function8916e - jr .asm_8a16b -.asm_8a140 - call Function89174 - jr nz, .asm_8a14c - call Function8a241 - jr c, .asm_8a121 - jr .asm_8a15a -.asm_8a14c - call WaitSFX - ld de, SFX_TWINKLE - call PlaySFX - ld c, $10 - call DelayFrames -.asm_8a15a - call ExitMenu - call Function891de - call Function893e2 - call Function89245 - call Function89168 - and a - ret -.asm_8a16b - call Function89209 - call WriteBackup - call Function8920f - scf - ret -; 8a176 (22:6176) - -MenuDataHeader_0x8a176: ; 0x8a176 - db $40 ; flags - db 00, 14 ; start coords - db 06, 19 ; end coords -; 8a17b - -Function8a17b: ; 8a17b (22:617b) - decoord 14, 0 - ld b, $5 - ld c, $4 - call Function89b3b - ld hl, MenuDataHeader_0x8a19a - ld a, [wd030] - call Function89d5e - ld hl, Function8a1b0 - call Function89d75 - jr nc, .asm_8a198 - ld a, $0 -.asm_8a198 - ld d, a - ret -; 8a19a (22:619a) - -MenuDataHeader_0x8a19a: ; 0x8a19a - db $40 ; flags - db 00, 14 ; start coords - db 06, 19 ; end coords - dw MenuData2_0x8a1a2 - db 1 ; default option -; 0x8a1a2 - -MenuData2_0x8a1a2: ; 0x8a1a2 - db $e0 ; flags - db 3 ; items - db "ひらく@" - db "すてる@" - db "もどる@" -; 0x8a1b0 - -Function8a1b0: ; 8a1b0 - hlcoord 0, 12 - ld b, $4 - ld c, $12 - call TextBox - hlcoord 1, 14 - ld a, [wcfa9] - ld de, Strings_8a1cc - dec a - ld c, a - call Function8919e - call PlaceString - ret -; 8a1cc - -Strings_8a1cc: ; 8a1cc - db "めいし", $25, "せいりと へんしゅうを" - next "おこないます" - db "@" - - db "めいしフ,ルダー", $25, "めいしと" - next "あんしょうばんごう", $1f, "けします" - db "@" - - db "まえ", $25, "がめん", $1d, "もどります" - db "@" -; 8a20d - - -Function8a20d: ; 8a20d (22:620d) - ld hl, UnknownText_0x8a232 - call PrintText - ld a, $2 - call Function89259 - ret c - ld hl, UnknownText_0x8a237 - call PrintText - ld a, $2 - call Function89259 - ret c - xor a - call Function8a2fe - ld hl, UnknownText_0x8a23c - call PrintText - xor a - and a - ret -; 8a232 (22:6232) - -UnknownText_0x8a232: ; 0x8a232 - ; If the CARD FOLDER is deleted, all its CARDS and the PASSCODE will also be deleted. Beware--a deleted CARD FOLDER can't be restored. Want to delete your CARD FOLDER? - text_jump UnknownText_0x1c53ee - db "@" -; 0x8a237 - -UnknownText_0x8a237: ; 0x8a237 - ; Are you sure you want to delete it? - text_jump UnknownText_0x1c5494 - db "@" -; 0x8a23c - -UnknownText_0x8a23c: ; 0x8a23c - ; The CARD FOLDER has been deleted. - text_jump UnknownText_0x1c54b9 - db "@" -; 0x8a241 - -Function8a241: ; 8a241 (22:6241) - call Function1d6e - call Function891fe - call Function8a262 - jr nc, .asm_8a254 - call Function891fe - call Function89b28 - scf - ret -.asm_8a254 - call Function891de - call WhiteBGMap - call Function1d7d - call Function891de - and a - ret - -Function8a262: ; 8a262 (22:6262) - call WhiteBGMap - call Function893e2 - call Function8923c - callba Function4a3a7 - callba Function49384 - hlcoord 1, 0 - call Function8a53d - hlcoord 12, 4 - call Function8a58d - ld a, $5 - hlcoord 12, 4, AttrMap - call Function8a5a3 - ld a, $6 - hlcoord 15, 4, AttrMap - call Function8a5a3 - xor a - ld [wd02e], a - ld bc, wd013 - call Function8b36c - call Function8b493 - call Function891ab - call Function32f9 - call Function8b5e7 - ret - -Function8a2aa: ; 8a2aa (22:62aa) - ld hl, MenuDataHeader_0x8a2ef - call LoadMenuDataHeader - ld hl, UnknownText_0x8a2f4 - call PrintText - ld a, $1 - call Function89259 - jr nc, .asm_8a2cf - ld hl, UnknownText_0x8a2f9 - call PrintText - ld a, $2 - call Function89259 - jr c, .asm_8a2ea - call Function8a20d - jr .asm_8a2ea -.asm_8a2cf - call ExitMenu - call Function8a241 - jr c, .asm_8a2ed - ld a, $1 - call Function8a313 - call CloseSRAM - call Function891de - call Function89245 - call Function89168 - and a - ret -.asm_8a2ea - call WriteBackup -.asm_8a2ed - scf - ret -; 8a2ef (22:62ef) - -MenuDataHeader_0x8a2ef: ; 0x8a2ef - db $40 ; flags - db 12, 00 ; start coords - db 17, 19 ; end coords -; 8a2f4 - -UnknownText_0x8a2f4: ; 0x8a2f4 - ; There is an older CARD FOLDER from a previous journey. Do you want to open it? - text_jump UnknownText_0x1c54dd - db "@" -; 0x8a2f9 - -UnknownText_0x8a2f9: ; 0x8a2f9 - ; Delete the old CARD FOLDER? - text_jump UnknownText_0x1c552d - db "@" -; 0x8a2fe - -Function8a2fe: ; 8a2fe (22:62fe) - call Function8a313 - call Function89305 - ld hl, $a603 - ld bc, $8 - ld a, $ff - call ByteFill - call CloseSRAM - ret - -Function8a313: ; 8a313 (22:6313) - ld c, a - call Function89160 - ld a, c - ld [$a60b], a - ret - -Function8a31c: ; 8a31c (22:631c) - push bc - call Function8923c - callba Function4a3a7 - callba Function49384 - hlcoord 1, 0 - call Function8a53d - hlcoord 12, 4 - call Function8a58d - call Function8a3b2 - pop bc - ld a, c - ld [wcf88], a - ld [MenuSelection], a - call Function1c89 - call Function1c10 - ld hl, wcfa5 - set 7, [hl] -.asm_8a34e - call Function8a3a2 - call Function8923c - call Function8a453 - call Function8a4d3 - call Function8a4fc - call Function891ab - call Function32f9 - call Function8a383 - jr c, .asm_8a370 - jr z, .asm_8a34e -.asm_8a36a - call Function89448 - xor a - ld e, a - ret -.asm_8a370 - call Function89448 - call Function1bee - call Function8a3a2 - ld a, [MenuSelection] - cp $ff - jr z, .asm_8a36a - ld e, a - and a - ret - -Function8a383: ; 8a383 (22:6383) - callba Function241ba - ld a, c - ld hl, wcfa8 - and [hl] - ret z - bit 0, a - jr nz, .asm_8a399 - bit 1, a - jr nz, .asm_8a39e - xor a - ret -.asm_8a399 - call PlayClickSFX - scf - ret -.asm_8a39e - call PlayClickSFX - ret - -Function8a3a2: ; 8a3a2 (22:63a2) - ld a, [wcfa9] - dec a - ld hl, DefaultFlypoint - ld e, a - ld d, $0 - add hl, de - ld a, [hl] - ld [MenuSelection], a - ret - -Function8a3b2: ; 8a3b2 (22:63b2) - ld a, $1 - ld [MenuSelection], a - call Function8a4fc - call Function8a3df - jr nc, .asm_8a3ce - decoord 0, 2 - ld b, $6 - ld c, $9 - call Function89b3b - ld hl, MenuDataHeader_0x8a435 - jr .asm_8a3db -.asm_8a3ce - decoord 0, 2 - ld b, $8 - ld c, $9 - call Function89b3b - ld hl, MenuDataHeader_0x8a40f -.asm_8a3db - call CopyMenuDataHeader - ret - -Function8a3df: ; 8a3df (22:63df) - call Function89160 - ld hl, $a603 - call Function89b45 - call CloseSRAM - ld hl, DefaultFlypoint - jr c, .asm_8a3f8 - ld de, Unknown_8a408 - call Function8a400 - scf - ret -.asm_8a3f8 - ld de, Unknown_8a40b - call Function8a400 - and a - ret - -Function8a400: ; 8a400 (22:6400) - ld a, [de] - inc de - ld [hli], a - cp $ff - jr nz, Function8a400 - ret -; 8a408 (22:6408) - -Unknown_8a408: db 1, 2, -1 -Unknown_8a40b: db 1, 2, 3, -1 - -MenuDataHeader_0x8a40f: ; 0x8a40f - db $40 ; flags - db 02, 00 ; start coords - db 11, 10 ; end coords - dw MenuData2_0x8a417 - db 1 ; default option -; 0x8a417 - -MenuData2_0x8a417: ; 0x8a417 - db $a0 ; flags - db 4 ; items - db "めいしりスト@" - db "じぶんの めいし@" - db "めいしこうかん@" - db "やめる@" -; 0x8a435 - -MenuDataHeader_0x8a435: ; 0x8a435 - db $40 ; flags - db 02, 00 ; start coords - db 09, 10 ; end coords - dw MenuData2_0x8a43d - db 1 ; default option -; 0x8a43d - -MenuData2_0x8a43d: ; 0x8a43d - db $a0 ; flags - db 3 ; items - db "めいしりスト@" - db "じぶんの めいし@" - db "やめる@" -; 0x8a453 - -Function8a453: ; 8a453 (22:6453) - hlcoord 0, 12 - ld b, $4 - ld c, $12 - call TextBox - hlcoord 1, 14 - ld de, String_8a476 - ld a, [MenuSelection] - cp $ff - jr z, .asm_8a472 - ld de, Strings_8a483 - dec a - ld c, a - call Function8919e -.asm_8a472 - call PlaceString - ret -; 8a476 (22:6476) - -String_8a476: ; 8a476 - db "まえ", $25, "がめん", $1d, "もどります@" -; 8a483 - -Strings_8a483: ; 8a483 - db "おともだち", $25, "めいしは" - next "ここ", $1d, "いれておきます@" - - db "でんわばんごう", $1f, "いれると" - next "めいしこうかん", $4a, "できます@" - - db "ともだちと じぶん", $25, "めいしを" - next "せきがいせんで こうかん します@" -; 8a4d3 - -Function8a4d3: ; 8a4d3 (22:64d3) - ld a, [MenuSelection] - cp $1 - jr nz, .asm_8a4eb - ld a, $5 - hlcoord 12, 4, AttrMap - call Function8a5a3 - ld a, $7 - hlcoord 15, 4, AttrMap - call Function8a5a3 - ret -.asm_8a4eb - ld a, $7 - hlcoord 12, 4, AttrMap - call Function8a5a3 - ld a, $6 - hlcoord 15, 4, AttrMap - call Function8a5a3 - ret - -Function8a4fc: ; 8a4fc (22:64fc) - ld a, [MenuSelection] - cp $3 - jr nz, asm_8a529 - ld hl, wd012 - ld a, [hli] - ld b, a - ld a, [hld] - add b - ld [hl], a - ld b, a - ld c, $80 - call Function89cdf - call Function8a515 - ret - -Function8a515: ; 8a515 (22:6515) - ld hl, wd012 - ld a, [hl] - cp $38 - jr c, .asm_8a520 - cp $3c - ret c -.asm_8a520 - ld a, [wd013] - cpl - inc a - ld [wd013], a - ret - -asm_8a529: ; 8a529 (22:6529) - ld hl, wd012 - ld a, $3c - ld [hli], a - ld a, $ff - ld [hli], a - ld hl, Sprites - xor a - ld bc, $20 - call ByteFill - ret - -Function8a53d: ; 8a53d (22:653d) - push hl - ld a, $15 - ld c, $8 - ld de, $14 - call Function8a573 - ld a, $1d - ld c, $9 - call Function8a57c - inc a - ld [hl], a - call Function8a584 - pop hl - add hl, de - ld a, $1f - ld c, $8 - call Function8a573 - dec hl - ld a, $51 - ld [hli], a - ld a, $26 - ld c, $1 - call Function8a57c - ld a, $52 - ld c, $3 - call Function8a573 - ld a, $27 - ld c, $6 - -Function8a573: ; 8a573 (22:6573) - ld [hl], a - call Function8a584 - inc a - dec c - jr nz, Function8a573 - ret - -Function8a57c: ; 8a57c (22:657c) - ld [hl], a - call Function8a584 - dec c - jr nz, Function8a57c - ret - -Function8a584: ; 8a584 (22:6584) - push af - ld a, $4 - call Function89215 - inc hl - pop af - ret - -Function8a58d: ; 8a58d (22:658d) - ld a, $2d - ld bc, $606 - ld de, $14 -.asm_8a595 - push bc - push hl -.asm_8a597 - ld [hli], a - inc a - dec c - jr nz, .asm_8a597 - pop hl - add hl, de - pop bc - dec b - jr nz, .asm_8a595 - ret - -Function8a5a3: ; 8a5a3 (22:65a3) - ld bc, $603 - ld de, $14 -.asm_8a5a9 - push bc - push hl -.asm_8a5ab - ld [hli], a - dec c - jr nz, .asm_8a5ab - pop hl - add hl, de - pop bc - dec b - jr nz, .asm_8a5a9 - ret - -Function8a5b6: ; 8a5b6 (22:65b6) - ld a, [rSVBK] ; $ff00+$70 - push af - ld a, $5 - ld [rSVBK], a ; $ff00+$70 - ld hl, Palette_8a5e5 - ld de, wd020 - ld bc, $18 - call CopyBytes - ld hl, Palette_8a5fd - ld de, Unkn2Pals - ld bc, $8 - call CopyBytes - ld hl, Palette_8a605 - ld de, wd048 - ld bc, $8 - call CopyBytes - pop af - ld [rSVBK], a ; $ff00+$70 - ret -; 8a5e5 (22:65e5) - -Palette_8a5e5: ; 8a5e5 - RGB 31, 31, 31 - RGB 27, 19, 00 - RGB 07, 11, 22 - RGB 00, 00, 00 - RGB 31, 31, 31 - RGB 16, 16, 31 - RGB 27, 19, 00 - RGB 00, 00, 00 - RGB 31, 31, 31 - RGB 31, 00, 00 - RGB 27, 19, 00 - RGB 00, 00, 00 -; 8a5fd - -Palette_8a5fd: ; 8a5fd - RGB 00, 00, 00 - RGB 00, 00, 00 - RGB 00, 00, 00 - RGB 31, 31, 31 -; 8a605 - -Palette_8a605: ; 8a605 - RGB 00, 00, 00 - RGB 14, 18, 31 - RGB 16, 16, 31 - RGB 31, 31, 31 -; 8a60d - -Function8a60d: ; 8a60d - ld a, [rSVBK] - push af - ld a, $5 - ld [rSVBK], a - ld hl, Palette_8a624 - ld de, Unkn2Pals - ld bc, $0008 - call CopyBytes - pop af - ld [rSVBK], a - ret -; 8a624 - -Palette_8a624: ; 8a624 - RGB 31, 31, 31 - RGB 31, 31, 31 - RGB 31, 31, 31 - RGB 00, 00, 00 -; 8a62c - -Function8a62c: ; 8a62c (22:662c) - call Function1d6e - call Function891fe - xor a - call Function8b94a - call Function8b677 -.asm_8a639 - xor a - ld [wd033], a - ld [wd032], a - ld [wd0e3], a - call Function8b7bd - ld a, c - and a - jr z, .asm_8a66a - ld [MenuSelection], a - ld b, a - ld a, [wcf77] - inc a - ld [wd034], a - push bc - call Function8b960 - ld a, c - pop bc - jr z, .asm_8a639 - ld c, a - ld hl, Jumptable_8a671 - ld a, b - ld [MenuSelection], a - ld a, c - dec a - rst JumpTable - jr .asm_8a639 -.asm_8a66a - call Function891fe - call Function89b28 - ret - -Jumptable_8a671: ; 8a671 (22:6671) - dw Function8a679 - dw Function8a6cd - dw Function8a8c3 - dw Function8a930 - - -Function8a679: ; 8a679 (22:6679) - call Function891de - call WhiteBGMap - call Function893cc - call Function89160 - call Function8931b - call Function89844 - call CloseSRAM - call Function89160 - call Function8939a - call Function89856 - hlcoord 1, 13 - call Function899fe - call Function891ab - call CloseSRAM -.asm_8a6a3 - call Function89a57 - jr c, .asm_8a6a3 - and a - jr z, Function8a679 - ld hl, Jumptable_8a6bc - dec a - rst JumpTable - jr c, Function8a679 - call Function891fe - call Function8b677 - call Function89448 - ret - -Jumptable_8a6bc: ; 8a6bc (22:66bc) - dw Function8a6c0 - dw Function8a6c5 - - -Function8a6c0: ; 8a6c0 (22:66c0) - call PlayClickSFX - and a - ret - -Function8a6c5: ; 8a6c5 (22:66c5) - call PlayClickSFX - call Function89d0d - scf - ret - -Function8a6cd: ; 8a6cd (22:66cd) - call Function891de - call WhiteBGMap - call Function893cc - call Function89160 - call Function8931b - call Function89844 - call Function8a757 - call CloseSRAM -.asm_8a6e5 - call Function89160 - call Function8931b - call Function89856 - call Function89a2e - call Function891ab - xor a - ld [wd02f], a - call CloseSRAM -.asm_8a6fb - call Function89b97 - call Function89c67 - jr c, .asm_8a718 - ld a, b - and a - jr z, .asm_8a6fb - call PlayClickSFX - call Function89448 - ld a, [wd011] - ld hl, Jumptable_8a74f - rst JumpTable - jr nc, .asm_8a6e5 - jr .asm_8a742 -.asm_8a718 - call Function89160 - call Function8a765 - call CloseSRAM - jr nc, .asm_8a73f - call Function8923c - call Function89448 - call Function89a23 - hlcoord 1, 13 - ld de, String_89135 - call PlaceString - call WaitBGMap - ld a, $2 - call Function89254 - jr c, .asm_8a6e5 -.asm_8a73f - call CloseSRAM -.asm_8a742 - call WhiteBGMap - call Function89448 - call Function891d3 - call Function8b677 - ret - -Jumptable_8a74f: ; 8a74f (22:674f) - dw Function8a78c - dw Function8a7cb - dw Function8a818 - dw Function8a8a1 - - -Function8a757: ; 8a757 (22:6757) - call Function8939a - xor a - ld [wd010], a - ld [wd011], a - ld [wd012], a - ret - -Function8a765: ; 8a765 (22:6765) - call Function8931b - push bc - ld hl, $0 - add hl, bc - ld de, DefaultFlypoint - ld c, $6 - call Function89185 - pop bc - jr nz, .asm_8a78a - push bc - ld hl, $11 - add hl, bc - ld de, wd008 - ld c, $8 - call Function89185 - pop bc - jr nz, .asm_8a78a - and a - ret -.asm_8a78a - scf - ret - -Function8a78c: ; 8a78c (22:678c) - call Function891fe - ld de, DefaultFlypoint - ld b, $5 - callba Function116c1 - call Function89160 - call Function8931b - push bc - ld hl, $0 - add hl, bc - ld d, h - ld e, l - ld hl, DefaultFlypoint - call InitName - call CloseSRAM - call DelayFrame - call Functiona57 - call Function891de - call WhiteBGMap - call Function893cc - call Function89160 - pop bc - call Function89844 - call CloseSRAM - and a - ret - -Function8a7cb: ; 8a7cb (22:67cb) - ld a, [MenuSelection] - push af - call Function891de - ld de, wd008 - ld c, $0 - callba Function17a68f - jr c, .asm_8a7f4 - ld hl, wd008 - ld a, $ff - ld bc, $8 - call ByteFill - ld h, d - ld l, e - ld de, wd008 - ld c, $8 - call Function89193 -.asm_8a7f4 - pop af - ld [MenuSelection], a - call Function891de - call WhiteBGMap - call Function893cc - call Function89160 - call Function8931b - call Function89844 - call Function89856 - call Function89a2e - call Function891ab - call CloseSRAM - and a - ret - -Function8a818: ; 8a818 (22:6818) - call Function89a23 - ld hl, DefaultFlypoint - call Function89331 - jr c, .asm_8a875 - ld hl, wd008 - call Function89b45 - jr nc, .asm_8a87a - call Function89160 - call Function8a765 - jr nc, .asm_8a863 - call Function8931b - push bc - ld hl, $0 - add hl, bc - ld d, h - ld e, l - ld hl, DefaultFlypoint - ld c, $6 - call Function89193 - pop bc - ld hl, $11 - add hl, bc - ld d, h - ld e, l - ld hl, wd008 - ld c, $8 - call Function89193 - hlcoord 1, 13 - ld de, .string_8a868 - call PlaceString - call WaitBGMap - call Functiona36 -.asm_8a863 - call CloseSRAM - scf - ret -; 8a868 (22:6868) - -.string_8a868 - db "めいし", $1f, "かきかえ まし", $22, "@" - -.asm_8a875 - ld de, String_8a88b - jr .asm_8a87d -.asm_8a87a - ld de, String_8911c -.asm_8a87d - hlcoord 1, 13 - call PlaceString - call WaitBGMap - call Functiona36 - and a - ret -; 8a88b (22:688b) - -String_8a88b: ; 8a88b - db "おともだち", $25, "なまえが" - next "かかれて いません!@" -; 8a8a1 - -Function8a8a1: ; 8a8a1 (22:68a1) - call Function89160 - call Function8a765 - call CloseSRAM - jr nc, .asm_8a8bf - call Function89a23 - hlcoord 1, 13 - ld de, String_89135 - call PlaceString - ld a, $2 - call Function89254 - jr c, .asm_8a8c1 -.asm_8a8bf - scf - ret -.asm_8a8c1 - and a - ret - -Function8a8c3: ; 8a8c3 (22:68c3) - call Function891de - call WhiteBGMap - call Function893cc - call Function89160 - call Function8931b - call Function89844 - call Function8939a - call Function89856 - call CloseSRAM - call Function891ab - hlcoord 1, 13 - ld de, String_8a919 - call PlaceString - ld a, $2 - call Function89254 - jr c, .asm_8a90f - call Function89160 - call Function892b4 - call CloseSRAM - call Function89a23 - call Function8923c - hlcoord 1, 13 - ld de, String_8a926 - call PlaceString - call WaitBGMap - call Functiona36 -.asm_8a90f - call Function89448 - call Function891fe - call Function8b677 - ret -; 8a919 (22:6919) - -String_8a919: ; 8a919 - db "このデータ", $1f, "けしますか?@" -; 8a926 - -String_8a926: ; 8a926 - db "データ", $1f, "けしまし", $22, "@" -; 8a930 - -Function8a930: ; 8a930 (22:6930) - ld a, [MenuSelection] - push af - xor a - ld [wd032], a - ld a, $1 - ld [wd033], a - ld a, [wd034] - ld [wd0e3], a -.asm_8a943 - call Function8b7bd - ld a, [wcf73] - and $1 - jr nz, .asm_8a953 - ld a, c - and a - jr nz, .asm_8a943 - pop af - ret -.asm_8a953 - call Function89160 - pop af - cp c - jr z, .asm_8a995 - push bc - ld [MenuSelection], a - call Function8931b - push bc - ld h, b - ld l, c - ld de, DefaultFlypoint - ld bc, $25 - call CopyBytes - pop de - pop bc - ld a, c - ld [MenuSelection], a - call Function8931b - push bc - ld h, b - ld l, c - ld bc, $25 - call CopyBytes - pop de - ld hl, DefaultFlypoint - ld bc, $25 - call CopyBytes - ld de, SFX_SWITCH_POKEMON - call WaitPlaySFX - ld de, SFX_SWITCH_POKEMON - call WaitPlaySFX -.asm_8a995 - call CloseSRAM - ret - -Function8a999: ; 8a999 (22:6999) - ld hl, MenuDataHeader_0x8a9c9 - call LoadMenuDataHeader - ld c, $1 -.asm_8a9a1 - call Function8a9ce - jr c, .asm_8a9bb - push bc - push de - call Function1d6e - pop de - dec e - ld a, e - ld hl, Jumptable_8a9c5 - rst JumpTable - call Function891fe - call Function89b28 - pop bc - jr .asm_8a9a1 -.asm_8a9bb - call Function89209 - call WriteBackup - call Function8920f - ret - -Jumptable_8a9c5: ; 8a9c5 (22:69c5) - dw Function8aa0a - dw Function8ab3b -; 8a9c9 (22:69c9) - -MenuDataHeader_0x8a9c9: ; 0x8a9c9 - db $40 ; flags - db 04, 11 ; start coords - db 11, 18 ; end coords -; 8a9ce - -Function8a9ce: ; 8a9ce (22:69ce) - push bc - decoord 11, 4 - ld b, $6 - ld c, $6 - call Function89b3b - pop bc - ld a, c - ld hl, MenuDataHeader_0x8a9f2 - call Function89d5e - ld hl, Function8aa09 - call Function89d85 - jr c, .asm_8a9ed - ld c, a - ld e, a - and a - ret -.asm_8a9ed - ld c, a - ld e, $0 - scf - ret -; 8a9f2 (22:69f2) - -MenuDataHeader_0x8a9f2: ; 0x8a9f2 - db $40 ; flags - db 04, 11 ; start coords - db 11, 18 ; end coords - dw MenuData2_0x8a9fa - db 1 ; default option -; 0x8a9fa - -MenuData2_0x8a9fa: ; 0x8a9fa - db $a0 ; flags - db 3 ; items - db "へんしゅう@" - db "みる@" - db "やめる@" -; 0x8aa09 - -Function8aa09: ; 8aa09 - ret -; 8aa0a - -Function8aa0a: ; 8aa0a (22:6a0a) - ld a, $1 - ld [wd02f], a - ld [wd011], a - xor a - ld [wd010], a - ld [wd012], a - call Function89160 - ld hl, $a603 - ld de, wd008 - call Function89381 - call CloseSRAM - call Function891fe - call WhiteBGMap - call Function893cc - call Function89807 - call Function89492 - call Function894ca -.asm_8aa3a - call Function8987f - call Function89a2e - call Function891ab -.asm_8aa43 - call Function89b97 - call Function89c67 - jr c, .asm_8aa61 - ld a, b - and a - jr z, .asm_8aa43 - call PlayClickSFX - call Function89448 - ld a, [wd011] - dec a - ld hl, Jumptable_8aa6d - rst JumpTable - jr nc, .asm_8aa3a - jr .asm_8aa69 -.asm_8aa61 - call Function89448 - call Function8ab11 - jr nc, .asm_8aa3a -.asm_8aa69 - call Function89448 - ret - -Jumptable_8aa6d: ; 8aa6d (22:6a6d) - dw Function8aa73 - dw Function8aab6 - dw Function8ab11 - - -Function8aa73: ; 8aa73 (22:6a73) - ld a, [MenuSelection] - ld e, a - push de - call Function891de - ld de, wd008 - ld c, $0 - callba Function17a68f - jr c, .asm_8aa9d - ld hl, wd008 - ld a, $ff - ld bc, $8 - call ByteFill - ld h, d - ld l, e - ld de, wd008 - ld c, $8 - call Function89193 -.asm_8aa9d - call Function891fe - call WhiteBGMap - call Function893cc - call Function89807 - call Function89492 - call Function894ca - pop de - ld a, e - ld [MenuSelection], a - and a - ret - -Function8aab6: ; 8aab6 (22:6ab6) - call Function89a23 - ld hl, wd008 - call Function89b45 - jr nc, Function8ab00 - call Function89160 - ld de, wd008 - ld hl, $a603 - ld c, $8 - call Function89185 - jr z, .asm_8aaeb - ld hl, wd008 - ld de, $a603 - ld c, $8 - call Function89193 - hlcoord 1, 13 - ld de, String_8aaf0 - call PlaceString - call WaitBGMap - call Functiona36 -.asm_8aaeb - call CloseSRAM - scf - ret -; 8aaf0 (22:6af0) - -String_8aaf0: ; 8aaf0 - db "あたらしい めいし", $4a, "できまし", $22, "@" -; 8ab00 - -Function8ab00: ; 8ab00 - ld de, String_8911c - hlcoord 1, 13 - call PlaceString - call WaitBGMap - call Function89235 - and a - ret - -Function8ab11: ; 8ab11 (22:6b11) - call Function89160 - ld hl, $a603 - ld de, wd008 - ld c, $8 - call Function89185 - call CloseSRAM - jr z, .asm_8ab37 - call Function89a23 - hlcoord 1, 13 - ld de, String_89135 - call PlaceString - ld a, $2 - call Function89254 - jr c, .asm_8ab39 -.asm_8ab37 - scf - ret -.asm_8ab39 - and a - ret - -Function8ab3b: ; 8ab3b (22:6b3b) - call Function891fe - call WhiteBGMap - call Function893cc - call Function89807 - call Function89492 - call Function894ca - call Function89160 - ld hl, $a603 - ld de, wd008 - call Function89381 - call CloseSRAM - call Function8987f - call Function89160 - hlcoord 1, 13 - ld bc, $a007 - call Function89a0c - call CloseSRAM - call Function891ab - call Function8ab77 - jr c, Function8ab3b - ret - -Function8ab77: ; 8ab77 (22:6b77) - call Function354b - bit 0, c - jr nz, .asm_8ab8e - bit 1, c - jr nz, .asm_8ab8e - bit 3, c - jr z, Function8ab77 - call PlayClickSFX - call Function89d0d - scf - ret -.asm_8ab8e - call PlayClickSFX - and a - ret - -Function8ab93: ; 8ab93 (22:6b93) - call WhiteBGMap - call Function1d6e - callba Function105688 - call ClearSprites - call Function891fe - call Function89b28 - ret -; 8aba9 (22:6ba9) - -Function8aba9: ; 8aba9 - ld a, $2 - call Function8b94a - ld a, $1 - ld [wd032], a -.asm_8abb3 - call Function891fe - call Function8b677 -.asm_8abb9 - call Function8b7bd - jr z, .asm_8abdf - ld a, c - ld [MenuSelection], a - call Function89160 - call Function8931b - ld hl, $0011 - add hl, bc - call Function89b45 - call CloseSRAM - jr c, .asm_8abe2 - ld de, SFX_WRONG - call WaitPlaySFX - call CloseSRAM - jr .asm_8abb9 - -.asm_8abdf - xor a - ld c, a - ret - -.asm_8abe2 - call PlayClickSFX -.asm_8abe5 - call Function891de - call WhiteBGMap - call Function893cc - call Function89160 - call Function8931b - call Function89844 - call CloseSRAM - call Function89160 - call Function8939a - call Function89856 - hlcoord 1, 13 - call Function899fe - call CloseSRAM - call Function891ab -.asm_8ac0f - call Function89a57 - jr c, .asm_8ac0f - and a - jr z, .asm_8abe5 - cp $2 - jr z, .asm_8ac0f - hlcoord 0, 12 - ld b, $4 - ld c, $12 - call TextBox - hlcoord 1, 14 - ld de, String_8ac3b - call PlaceString - ld a, $1 - call Function8925e - jp c, .asm_8abb3 - ld a, [MenuSelection] - ld c, a - ret -; 8ac3b - -String_8ac3b: ; 8ac3b - db "こ", $25, "ともだち", $1d, "でんわを" - next "かけますか?@" -; 8ac4e - -Function8ac4e: ; 8ac4e - xor a - ld [MenuSelection], a - push de - call Function891de - call WhiteBGMap - call Function893cc - pop bc - call Function89844 - call Function8939a - call Function89856 - hlcoord 1, 13 - call Function899fe - call Function891ab - ret -; 8ac70 - -Function8ac70: ; 8ac70 - push de - ld a, $3 - call Function8b94a - -Function8ac76: ; 8ac76 - call Function891fe - call Function8b677 - -Function8ac7c: ; 8ac7c - call Function8b7bd - jr z, .asm_8acf0 - ld a, c - ld [wd02f], a - ld [MenuSelection], a - call Function89160 - call Function8931b - call Function8932d - call CloseSRAM - jr nc, .asm_8acb0 - call Function89160 - ld hl, $0011 - add hl, bc - call Function89b45 - call CloseSRAM - jr nc, .asm_8accc - call Function89160 - call Function892b7 - call CloseSRAM - jr .asm_8accc - -.asm_8acb0 - call Function8ad0b - jr c, Function8ac76 - and a - jr nz, .asm_8accc - call Function89160 - ld h, b - ld l, c - ld d, $0 - ld e, $6 - add hl, de - ld d, h - ld e, l - pop hl - ld c, $1f - call Function89193 - jr .asm_8ace4 - -.asm_8accc - pop hl - call Function89160 - ld d, b - ld e, c - ld c, $6 - call Function89193 - ld a, $6 - add e - ld e, a - ld a, $0 - adc d - ld d, a - ld c, $1f - call Function89193 - -.asm_8ace4 - call CloseSRAM - call Functione51 - ld a, [wd02f] - ld c, a - and a - ret - -.asm_8acf0 - ld hl, UnknownText_0x8ad06 - call PrintText - ld a, $2 - call Function89259 - jp c, Function8ac7c - call Functione51 - pop de - ld c, $0 - scf - ret -; 8ad06 - -UnknownText_0x8ad06: ; 0x8ad06 - ; Finish registering CARDS? - text_jump UnknownText_0x1c554a - db "@" -; 0x8ad0b - -Function8ad0b: ; 8ad0b -.asm_8ad0b - ld a, [MenuSelection] - ld [wd02f], a - call Function891de - call WhiteBGMap - call Function893cc - call Function89160 - call Function8931b - push bc - call Function89844 - call Function8939a - call Function89856 - hlcoord 1, 13 - call Function899fe - call CloseSRAM - call Function891ab - pop bc -.asm_8ad37 - push bc - call Function89a57 - pop bc - jr c, .asm_8ad37 - and a - jr z, .asm_8ad0b - cp $2 - jr z, .asm_8ad37 - call Function8923c - push bc - hlcoord 0, 12 - ld b, $4 - ld c, $12 - call TextBox - ld de, String_8ad89 - hlcoord 1, 14 - call PlaceString - ld a, $2 - call Function8925e - jr c, .asm_8ad87 - call Function8923c - hlcoord 0, 12 - ld b, $4 - ld c, $12 - call TextBox - ld de, String_8ad9c - hlcoord 1, 14 - call PlaceString - ld a, $1 - call Function8925e - jr c, .asm_8ad84 - ld a, $0 - jr .asm_8ad86 - -.asm_8ad84 - ld a, $1 - -.asm_8ad86 - and a - -.asm_8ad87 - pop bc - ret -; 8ad89 - -String_8ad89: ; 8ad89 - db "こ", $25, "めいし", $1f, "けして" - next "いれかえますか?@" -; 8ad9c - -String_8ad9c: ; 8ad9c - db "おともだち", $25, "なまえを" - next "のこして おきますか?@" -; 8adb3 - -Function8adb3: ; 8adb3 - call Function891de - call Function8a262 - push af - call Function891de - pop af - ret -; 8adbf - -Function8adbf: ; 8adbf - call Function89160 - ld hl, $a603 - call Function89b45 - call CloseSRAM - ret -; 8adcc - -Function8adcc: ; 8adcc - call Function89160 - call Function8b3b0 - call CloseSRAM - ret nc - cp $2 - ret z - scf - ret -; 8addb - - -SpecialHoOhChamber: ; 0x8addb - ld hl, PartySpecies - ld a, [hl] - cp HO_OH ; is Ho-oh the first Pokémon in the party? - jr nz, .done ; if not, we're done - call GetSecondaryMapHeaderPointer - ld de, EVENT_WALL_OPENED_IN_HO_OH_CHAMBER - ld b, SET_FLAG - call EventFlagAction -.done - ret -; 0x8adef - -SpecialOmanyteChamber: ; 8adef - call GetSecondaryMapHeaderPointer - ld de, EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER - ld b, CHECK_FLAG - call EventFlagAction - ld a, c - and a - jr nz, .nope - - ld a, WATER_STONE - ld [CurItem], a - ld hl, NumItems - call CheckItem - jr c, .open - - ld a, [PartyCount] - ld b, a - inc b -.loop - dec b - jr z, .nope - ld a, b - dec a - ld [CurPartyMon], a - push bc - ld a, PartyMon1Item - PartyMon1 - call GetPartyParamLocation - pop bc - ld a, [hl] - cp WATER_STONE - jr nz, .loop - -.open - call GetSecondaryMapHeaderPointer - ld de, EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER - ld b, SET_FLAG - call EventFlagAction - -.nope - ret -; 8ae30 - -SpecialAerodactylChamber: ; 8ae30 - push de - push bc - - call GetSecondaryMapHeaderPointer - ld a, h - cp RuinsofAlphAerodactylChamber_SecondMapHeader / $100 - jr nz, .nope - ld a, l - cp RuinsofAlphAerodactylChamber_SecondMapHeader % $100 - jr nz, .nope - - ld de, EVENT_WALL_OPENED_IN_AERODACTYL_CHAMBER - ld b, SET_FLAG - call EventFlagAction - - scf - jr .done - -.nope - and a - -.done - pop bc - pop de - ret -; 8ae4e - -SpecialKabutoChamber: ; 8ae4e - push hl - push de - - call GetSecondaryMapHeaderPointer - ld a, h - cp RuinsofAlphKabutoChamber_SecondMapHeader / $100 - jr nz, .done - ld a, l - cp RuinsofAlphKabutoChamber_SecondMapHeader % $100 - jr nz, .done - - ld de, EVENT_WALL_OPENED_IN_KABUTO_CHAMBER - ld b, SET_FLAG - call EventFlagAction - -.done - pop de - pop hl - ret -; 8ae68 - -Special_DisplayUnownWords: ; 8ae68 - ld a, [ScriptVar] - ld hl, MenuDataHeader_0x8aed5 - and a - jr z, .asm_8ae79 - - ld d, $0 - ld e, $5 -.asm_8ae75 - add hl, de - dec a - jr nz, .asm_8ae75 - -.asm_8ae79 - call LoadMenuDataHeader - xor a - ld [hBGMapMode], a - call Function1cbb - call UpdateSprites - call Function321c - call Function1cfd - inc hl - ld d, $0 - ld e, $14 -rept 2 - add hl, de -endr - ld a, [ScriptVar] - ld c, a - ld de, Unknown_8aebc - and a - jr z, .asm_8aea5 -.asm_8ae9c - ld a, [de] - inc de - cp $ff - jr nz, .asm_8ae9c - dec c - jr nz, .asm_8ae9c - -.asm_8aea5 - call Function8af09 - ld bc, AttrMap - TileMap - add hl, bc - call Function8aee9 - call Function3200 - call Functiona36 - call PlayClickSFX - call WriteBackup - ret -; 8aebc - -Unknown_8aebc: ; 8aebc - db $08, $44, $04, $00, $2e, $08, $ff - db $26, $20, $0c, $0e, $46, $ff - db $4c, $00, $46, $08, $42, $ff - db $0e, $2c, $64, $2c, $0e, $ff -; 8aed5 - -MenuDataHeader_0x8aed5: ; 0x8aed5 - db $40 ; flags - db 04, 03 ; start coords - db 09, 16 ; end coords - -MenuDataHeader_0x8aeda: ; 0x8aeda - db $40 ; flags - db 04, 04 ; start coords - db 09, 15 ; end coords - -MenuDataHeader_0x8aedf: ; 0x8aedf - db $40 ; flags - db 04, 04 ; start coords - db 09, 15 ; end coords - -MenuDataHeader_0x8aee4: ; 0x8aee4 - db $40 ; flags - db 04, 04 ; start coords - db 09, 15 ; end coords -; 8aee9 - -Function8aee9: ; 8aee9 -.asm_8aee9 - ld a, [de] - cp $ff - ret z - cp $60 - ld a, $d - jr c, .asm_8aef5 - ld a, $5 - -.asm_8aef5 - call Function8aefd -rept 2 - inc hl -endr - inc de - jr .asm_8aee9 -; 8aefd - -Function8aefd: ; 8aefd - push hl - ld [hli], a - ld [hld], a - ld b, $0 - ld c, $14 - add hl, bc - ld [hli], a - ld [hl], a - pop hl - ret -; 8af09 - -Function8af09: ; 8af09 - push hl - push de -.asm_8af0b - ld a, [de] - cp $ff - jr z, .asm_8af19 - ld c, a - call Function8af1c -rept 2 - inc hl -endr - inc de - jr .asm_8af0b - -.asm_8af19 - pop de - pop hl - ret -; 8af1c - -Function8af1c: ; 8af1c - push hl - ld a, c - cp $60 - jr z, .asm_8af3b - cp $62 - jr z, .asm_8af4b - cp $64 - jr z, .asm_8af5b - ld [hli], a - inc a - ld [hld], a - dec a - ld b, $0 - ld c, $14 - add hl, bc - ld c, $10 - add c - ld [hli], a - inc a - ld [hl], a - pop hl - ret - -.asm_8af3b - ld [hl], $5b - inc hl - ld [hl], $5c - ld bc, $0013 - add hl, bc - ld [hl], $4d - inc hl - ld [hl], $5d - pop hl - ret - -.asm_8af4b - ld [hl], $4e - inc hl - ld [hl], $4f - ld bc, $0013 - add hl, bc - ld [hl], $5e - inc hl - ld [hl], $5f - pop hl - ret - -.asm_8af5b - ld [hl], $2 - inc hl - ld [hl], $3 - ld bc, $0013 - add hl, bc - ld [hl], $3 - inc hl - ld [hl], $2 - pop hl - ret -; 8af6b - -SpecialBuenasPassword: ; 8af6b - xor a - ld [wcf76], a - ld hl, MenuDataHeader_0x8afa9 - call CopyMenuDataHeader - ld a, [wdc4a] - ld c, a - callba GetBuenasPassword - ld a, [wcf83] - add c - add $2 - ld [wcf85], a - call Function1c00 - call Function1e5d - callba Function4ae5e - ld b, $0 - ld a, [MenuSelection] - ld c, a - ld a, [wdc4a] - and $3 - cp c - jr nz, .asm_8afa4 - ld b, $1 - -.asm_8afa4 - ld a, b - ld [ScriptVar], a - ret -; 8afa9 - -MenuDataHeader_0x8afa9: ; 0x8afa9 - db $40 ; flags - db 00, 00 ; start coords - db 07, 10 ; end coords - dw MenuData2_0x8afb2 - db 1 ; default option -; 0x8afb1 - - db 0 - -MenuData2_0x8afb2: ; 0x8afb2 - db $81 ; flags - db 0 ; items - dw Unknown_8afb8 - dw Function8afbd -; 0x8afb4 - -Unknown_8afb8: ; 8afb8 - db 3 - db 0, 1, 2 - db -1 - -Function8afbd: ; 8afbd - push de - ld a, [wdc4a] - and $f0 - ld c, a - ld a, [MenuSelection] - add c - ld c, a - callba GetBuenasPassword - pop hl - call PlaceString - ret -; 8afd4 - -SpecialBuenaPrize: ; 8afd4 - xor a - ld [wd0e4], a - ld a, $1 - ld [MenuSelection], a - call Function8b0d6 - call Function8b090 - ld hl, UnknownText_0x8b072 - call PrintText - jr .asm_8aff1 - -.asm_8afeb - ld hl, UnknownText_0x8b072 - call Function105a - -.asm_8aff1 - call DelayFrame - call UpdateSprites - call Function8b097 - call Function8b0e2 - jr z, .asm_8b05f - ld [wcf75], a - call GetBuenaPrize - ld a, [hl] - ld [wd265], a - call GetItemName - ld hl, UnknownText_0x8b077 - call Function105a - call YesNoBox - jr c, .asm_8afeb - ld a, [wcf75] - call GetBuenaPrize - inc hl - ld a, [hld] - ld c, a - ld a, [wdc4b] - cp c - jr c, .asm_8b047 - ld a, [hli] - push hl - ld [CurItem], a - ld a, $1 - ld [wd10c], a - ld hl, NumItems - call ReceiveItem - pop hl - jr nc, .asm_8b04c - ld a, [hl] - ld c, a - ld a, [wdc4b] - sub c - ld [wdc4b], a - call Function8b097 - jr .asm_8b051 - -.asm_8b047 - ld hl, UnknownText_0x8b081 - jr .asm_8b05a - -.asm_8b04c - ld hl, UnknownText_0x8b086 - jr .asm_8b05a - -.asm_8b051 - ld de, SFX_TRANSACTION - call PlaySFX - ld hl, UnknownText_0x8b07c - -.asm_8b05a - call Function105a - jr .asm_8afeb - -.asm_8b05f - call WriteBackup - call WriteBackup - ld hl, UnknownText_0x8b08b - call PrintText - call Functiona36 - call PlayClickSFX - ret -; 8b072 - -UnknownText_0x8b072: ; 0x8b072 - ; Which prize would you like? - text_jump UnknownText_0x1c589f - db "@" -; 0x8b077 - -UnknownText_0x8b077: ; 0x8b077 - ; ? Is that right? - text_jump UnknownText_0x1c58bc - db "@" -; 0x8b07c - -UnknownText_0x8b07c: ; 0x8b07c - ; Here you go! - text_jump UnknownText_0x1c58d1 - db "@" -; 0x8b081 - -UnknownText_0x8b081: ; 0x8b081 - ; You don't have enough points. - text_jump UnknownText_0x1c58e0 - db "@" -; 0x8b086 - -UnknownText_0x8b086: ; 0x8b086 - ; You have no room for it. - text_jump UnknownText_0x1c58ff - db "@" -; 0x8b08b - -UnknownText_0x8b08b: ; 0x8b08b - ; Oh. Please come back again! - text_jump UnknownText_0x1c591a - db "@" -; 0x8b090 - -Function8b090: ; 8b090 - ld hl, MenuDataHeader_0x8b0d1 - call LoadMenuDataHeader - ret -; 8b097 - -Function8b097: ; 8b097 - ld de, wdc4b - call Function8b09e - ret -; 8b09e - -Function8b09e: ; 8b09e - push de - xor a - ld [hBGMapMode], a - ld hl, MenuDataHeader_0x8b0d1 - call CopyMenuDataHeader - call Function1cbb - call UpdateSprites - call Function1cfd - ld bc, $0015 - add hl, bc - ld de, String_8b0ca - call PlaceString - ld h, b - ld l, c - inc hl - ld a, $7f - ld [hli], a - ld [hld], a - pop de - lb bc, 1, 2 - call PrintNum - ret -; 8b0ca - -String_8b0ca: - db "Points@" -; 8b0d1 - -MenuDataHeader_0x8b0d1: ; 0x8b0d1 - db $40 ; flags - db 11, 00 ; start coords - db 13, 11 ; end coords -; 8b0d6 - -Function8b0d6: ; 8b0d6 - ld hl, MenuDataHeader_0x8b0dd - call LoadMenuDataHeader - ret -; 8b0dd - -MenuDataHeader_0x8b0dd: ; 0x8b0dd - db $40 ; flags - db 00, 00 ; start coords - db 11, 17 ; end coords -; 8b0e2 - -Function8b0e2: ; 8b0e2 - ld hl, MenuDataHeader_0x8b113 - call CopyMenuDataHeader - ld a, [MenuSelection] - ld [wcf88], a - xor a - ld [wcf76], a - ld [hBGMapMode], a - call Function352f - call UpdateSprites - call Function350c - ld a, [MenuSelection] - ld c, a - ld a, [wcfa9] - ld [MenuSelection], a - ld a, [wcf73] - cp $2 - jr z, .asm_8b111 - ld a, c - and a - ret nz - -.asm_8b111 - xor a - ret -; 8b113 - -MenuDataHeader_0x8b113: ; 0x8b113 - db $40 ; flags - db 01, 01 ; start coords - db 09, 16 ; end coords - dw MenuData2_0x8b11c - db 1 ; default option -; 0x8b11b - - db 0 - -MenuData2_0x8b11c: ; 0x8b11c - db $10 ; flags - db 4 ; items - db $d, $1 - dbw BANK(Unknown_8b129), Unknown_8b129 - dbw BANK(BuenaPrizeItem), BuenaPrizeItem - dbw BANK(BuenaPrizePoints), BuenaPrizePoints -; 8b129 - -Unknown_8b129: ; 8b129 - db 9 - db 1, 2, 3, 4, 5, 6, 7, 8, 9, $ff -; 8b134 - -BuenaPrizeItem: ; 8b134 - ld a, [MenuSelection] - call GetBuenaPrize - ld a, [hl] - push de - ld [wd265], a - call GetItemName - pop hl - call PlaceString - ret -; 8b147 - -BuenaPrizePoints: ; 8b147 - ld a, [MenuSelection] - call GetBuenaPrize - inc hl - ld a, [hl] - ld c, "0" - add c - ld [de], a - ret -; 8b154 - -GetBuenaPrize: ; 8b154 - dec a - ld hl, BuenaPrizes - ld b, 0 - ld c, a -rept 2 - add hl, bc -endr - ret -; 8b15e - -BuenaPrizes: ; 8b15e - db ULTRA_BALL, 2 - db FULL_RESTORE, 2 - db NUGGET, 3 - db RARE_CANDY, 3 - db PROTEIN, 5 - db IRON, 5 - db CARBOS, 5 - db CALCIUM, 5 - db HP_UP, 5 -; 8b170 - - +INCLUDE "misc/mobile_22.asm" +INCLUDE "event/unown.asm" +INCLUDE "event/buena.asm" INCLUDE "event/dratini.asm" - - -Function8b1e1: ; 8b1e1 - ld de, Unknown_8b1ed - call Function8b25b - ret z - call Function8b231 - scf - ret -; 8b1ed - -Unknown_8b1ed: ; 8b1ed - db 2 - dw Unknown_8b1f2 - dw Unknown_8b1f6 - -Unknown_8b1f2: ; 8b1f2 - dw Function8b2bb - dw Function8b2c1 -; 8b1f6 - -Unknown_8b1f6: ; 8b1f6 - dw UnknownText_0x8b1fc - dw UnknownText_0x8b23d - dw UnknownText_0x8b242 -; 8b1fc - -UnknownText_0x8b1fc: ; 0x8b1fc - ; Excuse me! - text_jump UnknownText_0x1c5937 - db "@" -; 0x8b201 - -CheckForBattleTowerRules: ; 8b201 - ld hl, StringBuffer2 - ld [hl], "3" - inc hl - ld [hl], "@" - ld de, CheckForBattleTowerRules_FunctionsText - call Function8b25b - ret z - call Function8b231 - scf - ret -; 8b215 - -CheckForBattleTowerRules_FunctionsText: ; 8b215 - db 4 - dw CheckForBattleTowerRules_Functions - dw CheckForBattleTowerRules_Text - -CheckForBattleTowerRules_Functions: ; 8b21a - dw Function_PartyCountEq3 - dw Function8b2e2 - dw Function8b32a - dw Function_HasPartyAnEgg -; 8b222 - -CheckForBattleTowerRules_Text: ; 8b222 - dw JumpText_ExcuseMeYoureNotReady - dw JumbText_OnlyThreePkmnMayBeEntered - dw JumpText_ThePkmnMustAllBeDifferentKinds - dw JumpText_ThePkmnMustNotHoldTheSameItems - dw JumpText_YouCantTakeAnEgg -; 8b22c - -JumpText_ExcuseMeYoureNotReady: ; 0x8b22c - ; Excuse me. You're not ready. - text_jump Text_ExcuseMeYoureNotReady - db "@" -; 0x8b231 - -Function8b231: ; 8b231 - ld hl, UnknownText_0x8b238 - call PrintText - ret -; 8b238 - -UnknownText_0x8b238: ; 0x8b238 - ; Please return when you're ready. - text_jump UnknownText_0x1c5962 - db "@" -; 0x8b23d - -UnknownText_0x8b23d: ; 0x8b23d - ; You need at least three #MON. - text_jump UnknownText_0x1c5983 - db "@" -; 0x8b242 - -UnknownText_0x8b242: ; 0x8b242 - ; Sorry, an EGG doesn't qualify. - text_jump UnknownText_0x1c59a3 - db "@" -; 0x8b247 - -JumbText_OnlyThreePkmnMayBeEntered: ; 0x8b247 - ; Only three #MON may be entered. - text_jump Text_OnlyThreePkmnMayBeEntered - db "@" -; 0x8b24c - -JumpText_ThePkmnMustAllBeDifferentKinds: ; 0x8b24c - ; The @ #MON must all be different kinds. - text_jump Text_ThePkmnMustAllBeDifferentKinds - db "@" -; 0x8b251 - -JumpText_ThePkmnMustNotHoldTheSameItems: ; 0x8b251 - ; The @ #MON must not hold the same items. - text_jump Text_ThePkmnMustNotHoldTheSameItems - db "@" -; 0x8b256 - -JumpText_YouCantTakeAnEgg: ; 0x8b256 - ; You can't take an EGG! - text_jump Text_YouCantTakeAnEgg - db "@" -; 0x8b25b - -Function8b25b: ; 8b25b - ld bc, $0000 -.asm_8b25e - call Function8b26c - call c, Function8b28e - call Function8b276 - jr nz, .asm_8b25e - ld a, b - and a - ret -; 8b26c - -Function8b26c: ; 8b26c - push de - push bc - call Function8b27a - ld a, c - rst JumpTable - pop bc - pop de - ret -; 8b276 - -Function8b276: ; 8b276 - inc c - ld a, [de] - cp c - ret -; 8b27a - -Function8b27a: ; 8b27a - inc de - ld a, [de] - ld l, a - inc de - ld a, [de] - ld h, a - ret -; 8b281 - -Function8b281: ; 8b281 -rept 3 - inc de -endr - ld a, [de] - ld l, a - inc de - ld a, [de] - ld h, a - ret -; 8b28a - -Function8b28a: ; 8b28a - ld a, [hli] - ld h, [hl] - ld l, a - ret -; 8b28e - -Function8b28e: ; 8b28e - push de - push bc - ld a, b - and a - call z, Function8b29d - pop bc - call Function8b2a9 - ld b, $1 - pop de - ret -; 8b29d - -Function8b29d: ; 8b29d - push de - call Function8b281 - call Function8b28a - call PrintText - pop de - ret -; 8b2a9 - -Function8b2a9: ; 8b2a9 - push bc - call Function8b281 -rept 2 - inc hl -endr - ld b, $0 -rept 2 - add hl, bc -endr - call Function8b28a - call PrintText - pop bc - ret -; 8b2bb - -Function8b2bb: ; 8b2bb - ld a, [PartyCount] - cp 3 - ret -; 8b2c1 - -Function8b2c1: ; 8b2c1 - ld hl, PartyCount - ld a, [hli] - ld b, $0 - ld c, a -.asm_8b2c8 - ld a, [hli] - cp EGG - jr z, .asm_8b2ce - inc b - -.asm_8b2ce - dec c - jr nz, .asm_8b2c8 - ld a, [PartyCount] - cp b - ret z - ld a, b - cp 3 - ret -; 8b2da - -Function_PartyCountEq3: ; 8b2da - ld a, [PartyCount] - cp 3 - ret z - scf - ret -; 8b2e2 - -Function8b2e2: ; 8b2e2 - ld hl, PartyMon1Species - call Function8b2e9 - ret -; 8b2e9 - -Function8b2e9: ; 8b2e9 - ld de, PartyCount - ld a, [de] - inc de - dec a - jr z, .asm_8b314 - ld b, a -.asm_8b2f2 - push hl - push de - ld c, b - call Function8b322 - jr z, .asm_8b30c - ld a, [hl] - and a - jr z, .asm_8b30c -.asm_8b2fe - call Function8b31a - call Function8b322 - jr z, .asm_8b309 - cp [hl] - jr z, .asm_8b316 - -.asm_8b309 - dec c - jr nz, .asm_8b2fe - -.asm_8b30c - pop de - pop hl - call Function8b31a - dec b - jr nz, .asm_8b2f2 - -.asm_8b314 - and a - ret - -.asm_8b316 - pop de - pop hl - scf - ret -; 8b31a - -Function8b31a: ; 8b31a - push bc - ld bc, PartyMon2 - PartyMon1 - add hl, bc - inc de - pop bc - ret -; 8b322 - -Function8b322: ; 8b322 - push bc - ld b, a - ld a, [de] - cp EGG - ld a, b - pop bc - ret -; 8b32a - -Function8b32a: ; 8b32a - ld hl, PartyMon1Item - call Function8b2e9 - ret -; 8b331 - -Function_HasPartyAnEgg: ; 8b331 - ld hl, PartyCount - ld a, [hli] - ld c, a -.asm_8b336 - ld a, [hli] - cp EGG - jr z, .asm_8b340 - dec c - jr nz, .asm_8b336 - and a - ret - -.asm_8b340 - scf - ret -; 8b342 - - -Function8b342:: ; 8b342 - call GetSecondaryMapHeaderPointer - ld d, h - ld e, l - xor a -.asm_8b348 - push af - ld hl, Jumptable_8b354 - rst JumpTable - pop af - inc a - cp 3 - jr nz, .asm_8b348 - ret -; 8b354 - -Jumptable_8b354: ; 8b354 - dw Function8b35a - dw Function8b35b - dw Function8b35c -; 8b35a - -Function8b35a: ; 8b35a - ret -; 8b35b - -Function8b35b: ; 8b35b - ret -; 8b35c - -Function8b35c: ; 8b35c - ret -; 8b35d - -Function8b35d: ; 8b35d - ld a, h - cp d - ret nz - ld a, l - cp e - ret -; 8b363 - -Function8b363: ; 8b363 - push bc - callba Function10632f - pop bc - ret -; 8b36c - -Function8b36c: ; 8b36c (22:736c) - push bc - ld h, b - ld l, c - ld bc, $4 - ld a, $ff - call ByteFill - pop bc - ret - -Function8b379: ; 8b379 (22:7379) - push bc - ld a, c - add e - ld c, a - ld a, $0 - adc b - ld b, a - ld a, [bc] - ld d, a - pop bc - ret - -Function8b385: ; 8b385 (22:7385) - push bc - ld a, c - add e - ld c, a - ld a, $0 - adc b - ld b, a - ld a, d - ld [bc], a - pop bc - ret - -Function8b391: ; 8b391 (22:7391) - push bc - ld e, $0 - ld d, $4 -.asm_8b396 - ld a, [bc] - inc bc - cp $ff - jr z, .asm_8b3a2 - inc e - dec d - jr nz, .asm_8b396 - dec e - scf -.asm_8b3a2 - pop bc - ret - -Function8b3a4: ; 8b3a4 (22:73a4) - push de - push bc - ld d, b - ld e, c - ld c, $4 - call Function89185 - pop bc - pop de - ret - -Function8b3b0: ; 8b3b0 (22:73b0) - ld bc, $a037 - ld a, [$a60b] - and a - jr z, .asm_8b3c2 - cp $3 - jr nc, .asm_8b3c2 - call Function8b391 - jr c, .asm_8b3c9 -.asm_8b3c2 - call Function8b36c - xor a - ld [$a60b], a -.asm_8b3c9 - ld a, [$a60b] - ret - -Function8b3cd: ; 8b3cd (22:73cd) - push de - push bc - ld e, $4 -.asm_8b3d1 - ld a, [bc] - inc bc - call Function8998b - inc hl - dec e - jr nz, .asm_8b3d1 - pop bc - pop de - ret - -Function8b3dd: ; 8b3dd (22:73dd) - push de - push bc - call Function354b - ld a, c - pop bc - pop de - bit 0, a - jr nz, .asm_8b3f7 - bit 1, a - jr nz, .asm_8b40e - bit 6, a - jr nz, .asm_8b429 - bit 7, a - jr nz, .asm_8b443 - and a - ret -.asm_8b3f7 - ld a, e - cp $3 - jr z, .asm_8b407 - inc e - ld d, $0 - call Function8b385 - xor a - ld [wd010], a - ret -.asm_8b407 - call PlayClickSFX - ld d, $0 - scf - ret -.asm_8b40e - ld a, e - and a - jr nz, .asm_8b41e - call PlayClickSFX - ld d, $ff - call Function8b385 - ld d, $1 - scf - ret -.asm_8b41e - ld d, $ff - call Function8b385 - dec e - xor a - ld [wd010], a - ret -.asm_8b429 - call Function8b379 - ld a, d - cp $a - jr c, .asm_8b433 - ld d, $9 -.asm_8b433 - inc d - ld a, d - cp $a - jr c, .asm_8b43b - ld d, $0 -.asm_8b43b - call Function8b385 - xor a - ld [wd010], a - ret -.asm_8b443 - call Function8b379 - ld a, d - cp $a - jr c, .asm_8b44d - ld d, $0 -.asm_8b44d - ld a, d - dec d - and a - jr nz, .asm_8b454 - ld d, $9 -.asm_8b454 - call Function8b385 - xor a - ld [wd010], a - ret - -Function8b45c: ; 8b45c (22:745c) - call Function8b36c - xor a - ld [wd010], a - ld [wd012], a - call Function8b391 - ld d, $0 - call Function8b385 -.asm_8b46e - call Function8923c - call Function8b493 - call Function8b4cc - call Function8b518 - call Function89b78 - push bc - call Function8b4fd - call Function89c44 - ld a, $1 - ld [hBGMapMode], a ; $ff00+$d4 - pop bc - call Function8b3dd - jr nc, .asm_8b46e - ld a, d - and a - ret z - scf - ret - -Function8b493: ; 8b493 (22:7493) - push bc - call Function8923c - call Function8b521 - ld hl, Jumptable_8b4a0 - pop bc - rst JumpTable - ret - -Jumptable_8b4a0: ; 8b4a0 (22:74a0) - dw Function8b4a4 - dw Function8b4b8 - - -Function8b4a4: ; 8b4a4 (22:74a4) - push bc - push de - call Function8b4d8 - call TextBox - pop de - pop bc - call Function8b4cc - call Function8b518 - call Function8b3cd - ret - -Function8b4b8: ; 8b4b8 (22:74b8) - push bc - push de - call Function8b4ea - call Function89b3b - pop de - pop bc - call Function8b4cc - call Function8b518 - call Function8b3cd - ret - -Function8b4cc: ; 8b4cc (22:74cc) - push bc - ld hl, Unknown_8b529 - call Function8b50a - ld a, [hli] - ld h, [hl] - ld l, a - pop bc - ret - -Function8b4d8: ; 8b4d8 (22:74d8) - ld hl, Unknown_8b529 - call Function8b50a - push hl -rept 2 - inc hl -endr - ld a, [hli] - ld b, a - ld a, [hl] - ld c, a - pop hl - ld a, [hli] - ld h, [hl] - ld l, a - ret - -Function8b4ea: ; 8b4ea (22:74ea) - ld hl, Unknown_8b529 - call Function8b50a - push hl -rept 2 - inc hl -endr - ld a, [hli] - ld b, a - ld a, [hl] - ld c, a - pop hl - ld a, [hli] - ld e, a - ld a, [hl] - ld d, a - ret - -Function8b4fd: ; 8b4fd (22:74fd) - ld hl, Unknown_8b529 + 4 - call Function8b50a - ld a, [hli] - ld c, a - ld a, [hli] - ld b, a - ld a, [hli] - ld d, a - ret - -Function8b50a: ; 8b50a (22:750a) - ld a, [wd02e] - and a - ret z - ld b, $0 - ld c, $8 -.asm_8b513 - add hl, bc - dec a - jr nz, .asm_8b513 - ret - -Function8b518: ; 8b518 (22:7518) - push de - ld d, $0 - ld e, $14 - add hl, de - inc hl - pop de - ret - -Function8b521: ; 8b521 (22:7521) - ld hl, Unknown_8b529 + 7 - call Function8b50a - ld a, [hl] - ret -; 8b529 (22:7529) - -Unknown_8b529: ; 8b529 - dwcoord 2, 5 - db 1, 4, $20, $49, 0, 1 - dwcoord 7, 4 - db 1, 4, $48, $41, 0, 0 -; 8b539 - -Function8b539: ; 8b539 (22:7539) - ld bc, wd017 - call Function8b36c - xor a - ld [wd012], a - ld [wd02e], a - call Function8b493 - call Function8b4fd - ld e, $0 - call Function89c44 - call Function3238 - ret - -Function8b555: ; 8b555 (22:7555) - ld hl, UnknownText_0x8b5ce - call PrintText - ld bc, wd017 - call Function8b45c - jr c, .asm_8b5c8 - call Function89448 - ld bc, wd017 - call Function8b493 - ld bc, wd017 - call Function8b664 - jr nz, .asm_8b57c - ld hl, UnknownText_0x8b5e2 - call PrintText - jr Function8b555 -.asm_8b57c - ld hl, UnknownText_0x8b5d3 - call PrintText - ld bc, wd013 - call Function8b45c - jr c, Function8b555 - ld bc, wd017 - ld hl, wd013 - call Function8b3a4 - jr z, .asm_8b5a6 - call Function89448 - ld bc, wd013 - call Function8b493 - ld hl, UnknownText_0x8b5d8 - call PrintText - jr .asm_8b57c -.asm_8b5a6 - call Function89160 - ld hl, wd013 - ld de, $a037 - ld bc, $4 - call CopyBytes - call CloseSRAM - call Function89448 - ld bc, wd013 - call Function8b493 - ld hl, UnknownText_0x8b5dd - call PrintText - and a -.asm_8b5c8 - push af - call Function89448 - pop af - ret -; 8b5ce (22:75ce) - -UnknownText_0x8b5ce: ; 0x8b5ce - ; Please enter any four-digit number. - text_jump UnknownText_0x1bc187 - db "@" -; 0x8b5d3 - -UnknownText_0x8b5d3: ; 0x8b5d3 - ; Enter the same number to confirm. - text_jump UnknownText_0x1bc1ac - db "@" -; 0x8b5d8 - -UnknownText_0x8b5d8: ; 0x8b5d8 - ; That's not the same number. - text_jump UnknownText_0x1bc1cf - db "@" -; 0x8b5dd - -UnknownText_0x8b5dd: ; 0x8b5dd - ; Your PASSCODE has been set. Enter this number next time to open the CARD FOLDER. - text_jump UnknownText_0x1bc1eb - db "@" -; 0x8b5e2 - -UnknownText_0x8b5e2: ; 0x8b5e2 - ; 0000 is invalid! - text_jump UnknownText_0x1bc23e - db "@" -; 0x8b5e7 - -Function8b5e7: ; 8b5e7 (22:75e7) - ld bc, wd013 - call Function8b36c - xor a - ld [wd012], a - ld [wd02e], a - call Function8b493 - call Function891ab - call Function8b4fd - ld e, $0 - call Function89c44 -.asm_8b602 - ld hl, UnknownText_0x8b642 - call PrintText - ld bc, wd013 - call Function8b45c - jr c, .asm_8b63c - call Function89448 - ld bc, wd013 - call Function8b493 - call Function89160 - ld hl, $a037 - call Function8b3a4 - call CloseSRAM - jr z, .asm_8b635 - ld hl, UnknownText_0x8b647 - call PrintText - ld bc, wd013 - call Function8b36c - jr .asm_8b602 -.asm_8b635 - ld hl, UnknownText_0x8b64c - call PrintText - and a -.asm_8b63c - push af - call Function89448 - pop af - ret -; 8b642 (22:7642) - -UnknownText_0x8b642: ; 0x8b642 - ; Enter the CARD FOLDER PASSCODE. - text_jump UnknownText_0x1bc251 - db "@" -; 0x8b647 - -UnknownText_0x8b647: ; 0x8b647 - ; Incorrect PASSCODE! - text_jump UnknownText_0x1bc272 - db "@" -; 0x8b64c - -UnknownText_0x8b64c: ; 0x8b64c - ; CARD FOLDER open.@ @ - text_jump UnknownText_0x1bc288 - start_asm -; 0x8b651 - -Function8b651: ; 8b651 - ld de, SFX_TWINKLE - call PlaySFX - call WaitSFX - ld c, $8 - call DelayFrames - ld hl, .string_8b663 - ret -.string_8b663 - db "@" -; 8b664 - -Function8b664: ; 8b664 (22:7664) - push bc - ld de, $4 -.asm_8b668 - ld a, [bc] - cp $0 - jr nz, .asm_8b66e - inc d -.asm_8b66e - inc bc - dec e - jr nz, .asm_8b668 - pop bc - ld a, d - cp $4 - ret - -Function8b677: ; 8b677 - call WhiteBGMap - call DisableLCD - call Function8b690 - call Function8b6bb - call Function8b6ed - call EnableLCD - call Function891ab - call Function32f9 - ret -; 8b690 - -Function8b690: ; 8b690 - ld hl, GFX_17afa5 + $514 - ld de, VTiles2 - ld bc, $160 - ld a, BANK(GFX_17afa5) - call FarCopyBytes - ld hl, GFX_17afa5 + $514 + $160 - $10 - ld de, $9610 - ld bc, $10 - ld a, BANK(GFX_17afa5) - call FarCopyBytes - ld hl, GFX_17afa5 + $514 + $160 - ld de, $8ee0 - ld bc, $10 - ld a, BANK(GFX_17afa5) - call FarCopyBytes - ret -; 8b6bb - -Function8b6bb: ; 8b6bb - ld a, [rSVBK] - push af - ld a, $5 - ld [rSVBK], a - ld hl, Palette_8b6d5 - ld de, Unkn1Pals - ld bc, $0018 - call CopyBytes - pop af - ld [rSVBK], a - call Function8949c - ret -; 8b6d5 - -Palette_8b6d5: ; 8b6d5 - RGB 31, 31, 31 - RGB 31, 21, 00 - RGB 14, 07, 03 - RGB 00, 00, 00 - RGB 31, 31, 31 - RGB 31, 21, 00 - RGB 22, 09, 17 - RGB 00, 00, 00 - RGB 31, 31, 31 - RGB 31, 21, 00 - RGB 06, 24, 08 - RGB 00, 00, 00 -; 8b6ed - -Function8b6ed: ; 8b6ed - hlcoord 0, 0, AttrMap - ld bc, $012c - xor a - call ByteFill - hlcoord 0, 14, AttrMap - ld bc, $0050 - ld a, $7 - call ByteFill - ret -; 8b703 - -Function8b703: ; 8b703 - call Function8923c - push hl - ld a, $c - ld [hli], a - inc a - call Function8b73e - inc a - ld [hl], a - pop hl - push hl - push bc - ld de, SCREEN_WIDTH - add hl, de -.asm_8b717 - push hl - ld a, $f - ld [hli], a - ld a, $7f - call Function8b73e - ld a, $11 - ld [hl], a - pop hl - ld de, SCREEN_WIDTH - add hl, de - dec b - jr nz, .asm_8b717 - call Function8b732 - pop bc - pop hl - jr Function8b744 -; 8b732 - -Function8b732: ; 8b732 - ld a, $12 - ld [hli], a - ld a, $13 - call Function8b73e - ld a, $14 - ld [hl], a - ret -; 8b73e - -Function8b73e: ; 8b73e - ld d, c -.asm_8b73f - ld [hli], a - dec d - jr nz, .asm_8b73f - ret -; 8b744 - -Function8b744: ; 8b744 - ld de, AttrMap - TileMap - add hl, de -rept 2 - inc b -endr -rept 2 - inc c -endr - xor a -.asm_8b74d - push bc - push hl -.asm_8b74f - ld [hli], a - dec c - jr nz, .asm_8b74f - pop hl - ld de, SCREEN_WIDTH - add hl, de - pop bc - dec b - jr nz, .asm_8b74d - ret -; 8b75d - -Function8b75d: ; 8b75d - call Function8923c - hlcoord 0, 0 - ld a, $1 - ld bc, SCREEN_WIDTH - call ByteFill - hlcoord 0, 1 - ld a, $2 - ld [hl], a - hlcoord 9, 1 - ld c, $b - call Function8b788 - hlcoord 1, 1 - ld a, $4 - ld e, $8 -.asm_8b780 - ld [hli], a - inc a - dec e - jr nz, .asm_8b780 - jr Function8b79e -; 8b787 - -Function8b787: ; 8b787 - ret -; 8b788 - -Function8b788: ; 8b788 -.asm_8b788 - ld a, $2 - ld [hli], a - dec c - ret z - ld a, $1 - ld [hli], a - dec c - ret z - ld a, $3 - ld [hli], a - dec c - ret z - ld a, $1 - ld [hli], a - dec c - jr nz, .asm_8b788 - ret -; 8b79e - -Function8b79e: ; 8b79e - hlcoord 0, 1, AttrMap - ld a, $1 - ld [hli], a - hlcoord 9, 1, AttrMap - ld e, $b -.asm_8b7a9 - ld a, $2 - ld [hli], a - dec e - ret z - xor a - ld [hli], a - dec e - ret z - ld a, $1 - ld [hli], a - dec e - ret z - xor a - ld [hli], a - dec e - jr nz, .asm_8b7a9 - ret -; 8b7bd - -Function8b7bd: ; 8b7bd - call Function8b855 - ld hl, MenuDataHeader_0x8b867 - call CopyMenuDataHeader - ld a, [wd030] - ld [wcf88], a - ld a, [wd031] - ld [wd0e4], a - ld a, [wd032] - and a - jr z, .asm_8b7e0 - ld a, [wcf81] - set 3, a - ld [wcf81], a - -.asm_8b7e0 - ld a, [wd0e3] - and a - jr z, .asm_8b7ea - dec a - ld [wcf77], a - -.asm_8b7ea - hlcoord 0, 2 - ld b, $b - ld c, $12 - call Function8b703 - call Function8b75d - call UpdateSprites - call Function89209 - call Function350c - call Function8920f - ld a, [wcf73] - cp $2 - jr z, .asm_8b823 - cp $20 - jr nz, .asm_8b813 - call Function8b832 - jr .asm_8b7ea - -.asm_8b813 - cp $10 - jr nz, .asm_8b81c - call Function8b83e - jr .asm_8b7ea - -.asm_8b81c - ld a, [MenuSelection] - cp $ff - jr nz, .asm_8b824 - -.asm_8b823 - xor a - -.asm_8b824 - ld c, a - ld a, [wcfa9] - ld [wd030], a - ld a, [wd0e4] - ld [wd031], a - ret -; 8b832 - -Function8b832: ; 8b832 - ld a, [wd0e4] - ld hl, wcf92 - sub [hl] - jr nc, Function8b84b - xor a - jr Function8b84b -; 8b83e - -Function8b83e: ; 8b83e - ld a, [wd0e4] - ld hl, wcf92 - add [hl] - cp $24 - jr c, Function8b84b - ld a, $24 - -Function8b84b: ; 8b84b - ld [wd0e4], a - ld a, [wcfa9] - ld [wcf88], a - ret -; 8b855 - -Function8b855: ; 8b855 - ld a, $28 - ld hl, DefaultFlypoint - ld [hli], a - ld c, $28 - xor a -.asm_8b85e - inc a - ld [hli], a - dec c - jr nz, .asm_8b85e - ld a, $ff - ld [hl], a - ret -; 8b867 - -MenuDataHeader_0x8b867: ; 0x8b867 - db $40 ; flags - db 03, 01 ; start coords - db 13, 18 ; end coords - dw MenuData2_0x8b870 - db 1 ; default option -; 0x8b86f - - db 0 - -MenuData2_0x8b870: ; 0x8b870 - db $3c ; flags - db 5 ; items - db 3, 1 - dbw 0, wd002 - dbw BANK(Function8b880), Function8b880 - dbw BANK(Function8b88c), Function8b88c - dbw BANK(Function8b8c8), Function8b8c8 -; 8b880 - -Function8b880: ; 8b880 - ld h, d - ld l, e - ld de, MenuSelection - lb bc, PRINTNUM_LEADINGZEROS | 1, 2 - call PrintNum - ret -; 8b88c - -Function8b88c: ; 8b88c - call Function89160 - ld h, d - ld l, e - push hl - ld de, String_89116 - call Function8931b - call Function8932d - jr c, .asm_8b8a3 - ld hl, $0000 - add hl, bc - ld d, h - ld e, l - -.asm_8b8a3 - pop hl - push hl - call PlaceString - pop hl - ld d, $0 - ld e, $6 - add hl, de - push hl - ld de, String_89116 - call Function8931b - call Function8934a - jr c, .asm_8b8c0 - ld hl, $0006 - add hl, bc - ld d, h - ld e, l - -.asm_8b8c0 - pop hl - call PlaceString - call CloseSRAM - ret -; 8b8c8 - -Function8b8c8: ; 8b8c8 - hlcoord 0, 14 - ld b, $2 - ld c, $12 - call TextBox - ld a, [wd033] - ld b, 0 - ld c, a - ld hl, Unknown_8b903 -rept 2 - add hl, bc -endr - ld a, [hli] - ld h, [hl] - ld l, a - ld d, h - ld e, l - hlcoord 1, 16 - call PlaceString - hlcoord 0, 13 - ld a, $f - ld [hl], a - hlcoord 19, 13 - ld a, $11 - ld [hl], a - ld a, [wd0e4] - cp $24 - ret c - hlcoord 0, 13 - ld c, $12 - call Function8b732 - ret -; 8b903 - -Unknown_8b903: ; 8b903 - dw String_8b90b - dw String_8b919 - dw String_8b92a - dw String_8b938 - -String_8b90b: db "めいしを えらんでください@" ; Please select a noun. -String_8b919: db "どの めいしと いれかえますか?@" ; OK to swap with any noun? -String_8b92a: db "あいてを えらんでください@" ; Please select an opponent. -String_8b938: db "いれる ところを えらんでください@" ; Please select a location. -; 8b94a - -Function8b94a: ; 8b94a - ld [wd033], a - xor a - ld [wd0e4], a - ld [wd032], a - ld [wd0e3], a - ld [wd031], a - ld a, $1 - ld [wd030], a - ret -; 8b960 - - -Function8b960: ; 8b960 (22:7960) - ld hl, MenuDataHeader_0x8b9ac - call LoadMenuDataHeader - call Function8b9e9 - jr c, .asm_8b97a - hlcoord 11, 0 - ld b, $6 - ld c, $7 - call Function8b703 - ld hl, MenuDataHeader_0x8b9b1 - jr .asm_8b987 -.asm_8b97a - hlcoord 11, 0 - ld b, $a - ld c, $7 - call Function8b703 - ld hl, MenuDataHeader_0x8b9ca -.asm_8b987 - ld a, $1 - call Function89d5e - ld hl, Function8b9ab - call Function89d85 - call ExitMenu - jr c, .asm_8b99c - call Function8b99f - jr nz, .asm_8b99d -.asm_8b99c - xor a -.asm_8b99d - ld c, a - ret - -Function8b99f: ; 8b99f (22:799f) - ld hl, DefaultFlypoint - dec a - ld c, a - ld b, $0 - add hl, bc - ld a, [hl] - cp $ff - ret -; 8b9ab (22:79ab) - -Function8b9ab: ; 8b9ab - ret -; 8b9ac - -MenuDataHeader_0x8b9ac: ; 0x8b9ac - db $40 ; flags - db 00, 11 ; start coords - db 11, 19 ; end coords - -MenuDataHeader_0x8b9b1: ; 0x8b9b1 - db $40 ; flags - db 00, 11 ; start coords - db 07, 19 ; end coords - dw MenuData2_0x8b9b9 - db 1 ; default option -; 0x8b9b9 - -MenuData2_0x8b9b9: ; 0x8b9b9 - db $a0 ; flags - db 3 ; items - db "へんしゅう@" ; EDIT - db "いれかえ@" ; REPLACE - db "やめる@" ; QUIT -; 0x8b9ca - -MenuDataHeader_0x8b9ca: ; 0x8b9ca - db $40 ; flags - db 00, 11 ; start coords - db 11, 19 ; end coords - dw MenuData2_0x8b9d2 - db 1 ; default option -; 0x8b9d2 - -MenuData2_0x8b9d2: ; 0x8b9d2 - db $a0 ; flags - db 5 ; items - db "みる@" ; VIEW - db "へんしゅう@" ; EDIT - db "いれかえ@" ; REPLACE - db "けす@" ; ERASE - db "やめる@" ; QUIT -; 0x8b9e9 - -Function8b9e9: ; 8b9e9 (22:79e9) - call Function89160 - call Function8931b - call Function8932d - jr nc, .asm_8b9f6 - jr .asm_8b9ff -.asm_8b9f6 - ld hl, $11 - add hl, bc - call Function89b45 - jr c, .asm_8ba08 -.asm_8b9ff - call Function892b4 - and a - ld de, Unknown_8ba1c - jr .asm_8ba0c -.asm_8ba08 - ld de, Unknown_8ba1f - scf -.asm_8ba0c - push af - ld hl, DefaultFlypoint -.asm_8ba10 - ld a, [de] - inc de - ld [hli], a - cp $ff - jr nz, .asm_8ba10 - call CloseSRAM - pop af - ret -; 8ba1c (22:7a1c) - -Unknown_8ba1c: ; 8b1ac - db 2, 4, -1 - -Unknown_8ba1f: ; 8ba1f - db 1, 2, 4, 3, -1 -; 8ba24 +INCLUDE "event/battle_tower.asm" +INCLUDE "misc/mobile_22_2.asm" SECTION "bank23", ROMX, BANK[$23] -Function8c000: ; 8c000 -Function8c000_2: +Predef35: ; 8c000 +Predef36: ret ; 8c001 -Function8c001:: ; 8c001 - call UpdateTime - ld a, [TimeOfDay] - ld [CurTimeOfDay], a - call GetTimePalette - ld [TimeOfDayPal], a - ret -; 8c011 +INCLUDE "engine/timeofdaypals.asm" +INCLUDE "engine/battle_start.asm" - -_TimeOfDayPals:: ; 8c011 -; return carry if pals are changed - -; forced pals? - ld hl, wd846 - bit 7, [hl] - jr nz, .dontchange - -; do we need to bother updating? - ld a, [TimeOfDay] - ld hl, CurTimeOfDay - cp [hl] - jr z, .dontchange - -; if so, the time of day has changed - ld a, [TimeOfDay] - ld [CurTimeOfDay], a - -; get palette id - call GetTimePalette - -; same palette as before? - ld hl, TimeOfDayPal - cp [hl] - jr z, .dontchange - -; update palette id - ld [TimeOfDayPal], a - - -; save bg palette 8 - ld hl, Unkn1Pals + 8 * 7 ; Unkn1Pals + 7 pals - -; save wram bank - ld a, [rSVBK] - ld b, a -; wram bank 5 - ld a, 5 - ld [rSVBK], a - -; push palette - ld c, 4 ; NUM_PAL_COLORS -.push - ld d, [hl] - inc hl - ld e, [hl] - inc hl - push de - dec c - jr nz, .push - -; restore wram bank - ld a, b - ld [rSVBK], a - - -; update sgb pals - ld b, $9 - call GetSGBLayout - - -; restore bg palette 8 - ld hl, wd03f ; last byte in Unkn1Pals - -; save wram bank - ld a, [rSVBK] - ld d, a -; wram bank 5 - ld a, 5 - ld [rSVBK], a - -; pop palette - ld e, 4 ; NUM_PAL_COLORS -.pop - pop bc - ld [hl], c - dec hl - ld [hl], b - dec hl - dec e - jr nz, .pop - -; restore wram bank - ld a, d - ld [rSVBK], a - -; update palettes - call _UpdateTimePals - call DelayFrame - -; successful change - scf - ret - -.dontchange -; no change occurred - and a - ret -; 8c070 - - -_UpdateTimePals:: ; 8c070 - ld c, $9 ; normal - call GetTimePalFade - call DmgToCgbTimePals - ret -; 8c079 - -FadeInBGMap:: ; 8c079 - ld c, $12 - call GetTimePalFade - ld b, $4 - call Function8c16d - ret -; 8c084 - -FadeBlackBGMap:: ; 8c084 - call Function8c0c1 - ld c, $9 - call GetTimePalFade - ld b, $4 - call Function8c15e - ret -; 8c092 - -Special_BattleTowerFade: ; 8c092 - call Function8c0c1 - ld c, $9 - call GetTimePalFade - ld b, $4 -.asm_8c09c - call DmgToCgbTimePals -rept 3 - inc hl -endr - ld c, $7 - call DelayFrames - dec b - jr nz, .asm_8c09c - ret -; 8c0ab - -Special_FadeInQuickly: ; 8c0ab - ld c, $0 - call GetTimePalFade - ld b, $4 - call Function8c15e - ret -; 8c0b6 - -Special_FadeBlackQuickly: ; 8c0b6 - ld c, $9 - call GetTimePalFade - ld b, $4 - call Function8c16d - ret -; 8c0c1 - - -Function8c0c1: ; 8c0c1 - ld a, [rSVBK] - push af - ld a, $5 - ld [rSVBK], a - ld hl, Unkn1Pals - ld a, [hli] - ld e, a - ld a, [hli] - ld d, a - ld hl, Unkn1Pals + 8 - ld c, $6 -.asm_8c0d4 - ld a, e - ld [hli], a - ld a, d - ld [hli], a -rept 6 - inc hl -endr - dec c - jr nz, .asm_8c0d4 - pop af - ld [rSVBK], a - ret -; 8c0e5 - -brightlevel: MACRO - db (\1 << 6) | (\2 << 4) | (\3 << 2) | \4 -ENDM - -Function8c0e5: ; 8c0e5 - ld hl, .BrightnessLevels - ld a, [wc2d0] - cp $4 ; Dark cave, needs Flash - jr z, .DarkCave - and $7 - add l - ld l, a - ld a, $0 - adc h - ld h, a - ld a, [hl] - ld [wd847], a - ret -.DarkCave - ld a, [StatusFlags] - bit 2, a - jr nz, .UsedFlash - ld a, $ff ; 3, 3, 3, 3 - ld [wd847], a - ret -.UsedFlash - ld a, $aa ; 2, 2, 2, 2 - ld [wd847], a - ret -; 8c10f (23:410f) - -.BrightnessLevels: ; 8c10f - brightlevel 3, 2, 1, 0 - brightlevel 1, 1, 1, 1 - brightlevel 2, 2, 2, 2 - brightlevel 0, 0, 0, 0 - brightlevel 3, 3, 3, 3 - brightlevel 3, 2, 1, 0 - brightlevel 3, 2, 1, 0 - brightlevel 3, 2, 1, 0 -; 8c117 - -GetTimePalette: ; 8c117 - ld a, [TimeOfDay] - ld e, a - ld d, 0 - ld hl, .TimePalettes -rept 2 - add hl, de -endr - ld a, [hli] - ld h, [hl] - ld l, a - jp [hl] -; 8c126 - -.TimePalettes - dw .MorningPalette - dw .DayPalette - dw .NitePalette - dw .DarknessPalette - -.MorningPalette - ld a, [wd847] - and %00000011 ; 0 - ret - -.DayPalette - ld a, [wd847] - and %00001100 ; 1 - srl a - srl a - ret - -.NitePalette - ld a, [wd847] - and %00110000 ; 2 - swap a - ret - -.DarknessPalette - ld a, [wd847] - and %11000000 ; 3 - rlca - rlca - ret -; 8c14e - - -DmgToCgbTimePals: ; 8c14e - push hl - push de - ld a, [hli] - call DmgToCgbBGPals - ld a, [hli] - ld e, a - ld a, [hli] - ld d, a - call DmgToCgbObjPals - pop de - pop hl - ret -; 8c15e - -Function8c15e: ; 8c15e -.asm_8c15e - call DmgToCgbTimePals -rept 3 - inc hl -endr - ld c, $2 - call DelayFrames - dec b - jr nz, .asm_8c15e - ret -; 8c16d - -Function8c16d: ; 8c16d -.asm_8c16d - call DmgToCgbTimePals -rept 3 - dec hl -endr - ld c, $2 - call DelayFrames - dec b - jr nz, .asm_8c16d - ret -; 8c17c - - -GetTimePalFade: ; 8c17c -; check cgb - ld a, [hCGB] - and a - jr nz, .cgb - -; else: dmg - -; index - ld a, [TimeOfDayPal] - and %11 - -; get fade table - push bc - ld c, a - ld b, $0 - ld hl, .dmgfades -rept 2 - add hl, bc -endr - ld a, [hli] - ld h, [hl] - ld l, a - pop bc - -; get place in fade table - ld b, $0 - add hl, bc - ret - -.cgb - ld hl, .cgbfade - ld b, $0 - add hl, bc - ret - -.dmgfades - dw .morn - dw .day - dw .nite - dw .darkness - -.morn - db %11111111, %11111111, %11111111 - db %11111110, %11111110, %11111110 - db %11111001, %11100100, %11100100 - db %11100100, %11010000, %11010000 - db %10010000, %10000000, %10000000 - db %01000000, %01000000, %01000000 - db %00000000, %00000000, %00000000 - -.day - db %11111111, %11111111, %11111111 - db %11111110, %11111110, %11111110 - db %11111001, %11100100, %11100100 - db %11100100, %11010000, %11010000 - db %10010000, %10000000, %10000000 - db %01000000, %01000000, %01000000 - db %00000000, %00000000, %00000000 - -.nite - db %11111111, %11111111, %11111111 - db %11111110, %11111110, %11111110 - db %11111001, %11100100, %11100100 - db %11101001, %11010000, %11010000 - db %10010000, %10000000, %10000000 - db %01000000, %01000000, %01000000 - db %00000000, %00000000, %00000000 - -.darkness - db %11111111, %11111111, %11111111 - db %11111110, %11111110, %11111111 - db %11111110, %11100100, %11111111 - db %11111101, %11010000, %11111111 - db %11111101, %10000000, %11111111 - db %00000000, %01000000, %00000000 - db %00000000, %00000000, %00000000 - -.cgbfade - db %11111111, %11111111, %11111111 - db %11111110, %11111110, %11111110 - db %11111001, %11111001, %11111001 - db %11100100, %11100100, %11100100 - db %10010000, %10010000, %10010000 - db %01000000, %01000000, %01000000 - db %00000000, %00000000, %00000000 -; 8c20f - - -Function8c20f: ; 8c20f - call Function8c26d - ld a, [rBGP] - ld [wcfc7], a - ld a, [rOBP0] - ld [wcfc8], a - ld a, [rOBP1] - ld [wcfc9], a - call DelayFrame - ld hl, hVBlank - ld a, [hl] - push af - ld [hl], $1 -.asm_8c22b - ld a, [wcf63] - bit 7, a - jr nz, .asm_8c23a - call Function8c314 - call DelayFrame - jr .asm_8c22b - -.asm_8c23a - ld a, [rSVBK] - push af - ld a, $5 - ld [rSVBK], a - ld hl, Unkn1Pals - ld bc, $0040 - xor a - call ByteFill - pop af - ld [rSVBK], a - ld a, $ff - ld [wcfc7], a - call DmgToCgbBGPals - call DelayFrame - xor a - ld [hLCDStatCustom], a - ld [hLCDStatCustom + 1], a - ld [hLCDStatCustom + 2], a - ld [hSCY], a - ld a, $1 - ld [rSVBK], a - pop af - ld [hVBlank], a - call DelayFrame - ret -; 8c26d - -Function8c26d: ; 8c26d - ld a, [InLinkBattle] - cp $4 - jr z, .asm_8c288 - callba Function6454 - call UpdateSprites - call DelayFrame - call Function8c2a0 - call Function8cf4f - jr .asm_8c28b - -.asm_8c288 - call Function8c2aa - -.asm_8c28b - ld a, $90 - ld [hWY], a - call DelayFrame - xor a - ld [hBGMapMode], a - ld hl, wcf63 - xor a -rept 2 - ld [hli], a -endr - ld [hl], a - call Function8c6d8 - ret -; 8c2a0 - -Function8c2a0: ; 8c2a0 - call Function8c2aa - ld hl, VBGMap0 - call Function8c2cf - ret -; 8c2aa - -Function8c2aa: ; 8c2aa - ld de, GFX_8c2f4 - ld hl, $8fe0 - ld b, BANK(GFX_8c2f4) - ld c, 2 - call Request2bpp - ld a, [rVBK] - push af - ld a, $1 - ld [rVBK], a - ld de, GFX_8c2f4 - ld hl, $8fe0 - ld b, BANK(GFX_8c2f4) - ld c, 2 - call Request2bpp - pop af - ld [rVBK], a - ret -; 8c2cf - -Function8c2cf: ; 8c2cf - ld a, [rSVBK] - push af - ld a, $6 - ld [rSVBK], a - push hl - ld hl, w6_d000 - ld bc, $28 * $10 -.asm_8c2dd - ld [hl], $ff - inc hl - dec bc - ld a, c - or b - jr nz, .asm_8c2dd - pop hl - ld de, w6_d000 - ld b, BANK(Function8c2cf) ; BANK(@) - ld c, $28 - call Request2bpp - pop af - ld [rSVBK], a - ret -; 8c2f4 - -GFX_8c2f4: ; 8c2f4 -INCBIN "gfx/unknown/08c2f4.2bpp" - - -Function8c314: ; 8c314 - ld a, [wcf63] - ld e, a - ld d, 0 - ld hl, Jumptable_8c323 -rept 2 - add hl, de -endr - ld a, [hli] - ld h, [hl] - ld l, a - jp [hl] -; 8c323 - -Jumptable_8c323: ; 8c323 (23:4323) - dw Function8c365 - dw Function8c5dc - dw Function8c3a1 - dw Function8c3ab - dw Function8c3ab - dw Function8c3ab - dw Function8c39c - dw Function8c3e8 - dw Function8c408 - dw Function8c5dc - dw Function8c3a1 - dw Function8c3ab - dw Function8c3ab - dw Function8c3ab - dw Function8c39c - dw Function8c768 - dw Function8c5dc - dw Function8c3a1 - dw Function8c3ab - dw Function8c3ab - dw Function8c3ab - dw Function8c39c - dw Function8c43d - dw Function8c44f - dw Function8c5dc - dw Function8c3a1 - dw Function8c3ab - dw Function8c3ab - dw Function8c3ab - dw Function8c39c - dw Function8c578 - dw Function8c58f - dw Function8c393 - - -Function8c365: ; 8c365 (23:4365) - ld de, 0 - ld a, [BattleMonLevel] - add 3 - ld hl, EnemyMonLevel - cp [hl] - jr nc, .asm_8c375 - set 0, e -.asm_8c375 - ld a, [wPermission] - cp $4 - jr z, .asm_8c386 - cp $5 - jr z, .asm_8c386 - cp $7 - jr z, .asm_8c386 - set 1, e -.asm_8c386 - ld hl, Unknown_8c38f - add hl, de - ld a, [hl] - ld [wcf63], a - ret -; 8c38f (23:438f) - -Unknown_8c38f: ; 8c38f - db 1, 9 - db 16, 24 -; 8c393 - -Function8c393: ; 8c393 (23:4393) - call ClearSprites - ld a, $80 - ld [wcf63], a - ret - -Function8c39c: ; 8c39c (23:439c) - ld hl, wcf63 - inc [hl] - ret - -Function8c3a1: ; 8c3a1 (23:43a1) - call Function8c39c - xor a - ld [wcf64], a - ld [hBGMapMode], a ; $ff00+$d4 - ret - -Function8c3ab: ; 8c3ab (23:43ab) - call Function8c3b3 - ret nc - call Function8c39c - ret - -Function8c3b3: ; 8c3b3 (23:43b3) - ld a, [wd847] - cp $ff - jr z, .asm_8c3d5 - ld hl, wcf64 - ld a, [hl] - inc [hl] - srl a - ld e, a - ld d, 0 - ld hl, Unknown_8c3db - add hl, de - ld a, [hl] - cp $1 - jr z, .asm_8c3d5 - ld [wcfc7], a - call DmgToCgbBGPals - and a - ret -.asm_8c3d5 - xor a - ld [wcf64], a - scf - ret -; 8c3db (23:43db) - -Unknown_8c3db: ; 8c3db - db $f9 ; 3321 - db $fe ; 3332 - db $ff ; 3333 - db $fe ; 3332 - db $f9 ; 3321 - db $e4 ; 3210 - db $90 ; 2100 - db $40 ; 1000 - db $00 ; 0000 - db $40 ; 1000 - db $90 ; 2100 - db $e4 ; 3210 - db $01 ; 0001 -; 8c3e8 - -Function8c3e8: ; 8c3e8 (23:43e8) - callba Function5602 - ld a, $5 - ld [rSVBK], a ; $ff00+$70 - call Function8c39c - ld a, $43 - ld [hLCDStatCustom], a ; $ff00+$c6 - xor a - ld [hLCDStatCustom + 1], a - ld a, $90 - ld [hLCDStatCustom + 2], a - xor a - ld [wcf64], a - ld [wcf65], a - ret - -Function8c408: ; 8c408 (23:4408) - ld a, [wcf64] - cp $60 - jr nc, .asm_8c413 - call Function8c419 - ret -.asm_8c413 - ld a, $20 - ld [wcf63], a - ret - -Function8c419: ; 8c419 (23:4419) - ld hl, wcf65 - ld a, [hl] - inc [hl] - ld hl, wcf64 - ld d, [hl] - add [hl] - ld [hl], a - ld a, $90 - ld bc, wd100 - ld e, $0 -.asm_8c42b - push af - push de - ld a, e - call Function8c6f7 - ld [bc], a - inc bc - pop de - ld a, e - add $2 - ld e, a - pop af - dec a - jr nz, .asm_8c42b - ret - -Function8c43d: ; 8c43d (23:443d) - callba Function5602 - ld a, $5 - ld [rSVBK], a ; $ff00+$70 - call Function8c39c - xor a - ld [wcf64], a - ret - -Function8c44f: ; 8c44f (23:444f) - xor a - ld [hBGMapMode], a ; $ff00+$d4 - ld a, [wcf64] - ld e, a - ld d, 0 - ld hl, Unknown_8c490 -rept 5 - add hl, de -endr - ld a, [hli] - cp -1 - jr z, .asm_8c47a - ld [wcf65], a - call Function8c4f5 - ld a, $1 - ld [hBGMapMode], a ; $ff00+$d4 - call DelayFrame - call DelayFrame - ld hl, wcf64 - inc [hl] - ret -.asm_8c47a - ld a, $1 - ld [hBGMapMode], a ; $ff00+$d4 - call DelayFrame - call DelayFrame - call DelayFrame - xor a - ld [hBGMapMode], a ; $ff00+$d4 - ld a, $20 - ld [wcf63], a - ret -; 8c490 (23:4490) - -Unknown_8c490: ; 8c490 -macro_8c490: MACRO - db \1 - dw \2 - dwcoord \3, \4 -ENDM - - macro_8c490 0, Unknown_8c538, 1, 6 - macro_8c490 0, Unknown_8c53e, 0, 3 - macro_8c490 0, Unknown_8c548, 1, 0 - macro_8c490 0, Unknown_8c55a, 5, 0 - macro_8c490 0, Unknown_8c568, 9, 0 - macro_8c490 1, Unknown_8c568, 10, 0 - macro_8c490 1, Unknown_8c55a, 14, 0 - macro_8c490 1, Unknown_8c548, 18, 0 - macro_8c490 1, Unknown_8c53e, 19, 3 - macro_8c490 1, Unknown_8c538, 18, 6 - macro_8c490 3, Unknown_8c538, 18, 11 - macro_8c490 3, Unknown_8c53e, 19, 14 - macro_8c490 3, Unknown_8c548, 18, 17 - macro_8c490 3, Unknown_8c55a, 14, 17 - macro_8c490 3, Unknown_8c568, 10, 17 - macro_8c490 2, Unknown_8c568, 9, 17 - macro_8c490 2, Unknown_8c55a, 5, 17 - macro_8c490 2, Unknown_8c548, 1, 17 - macro_8c490 2, Unknown_8c53e, 0, 14 - macro_8c490 2, Unknown_8c538, 1, 11 - db $ff -; 8c4f5 - -Function8c4f5: ; 8c4f5 (23:44f5) - ld a, [hli] - ld e, a - ld a, [hli] - ld d, a - ld a, [hli] - ld h, [hl] - ld l, a -.asm_8c4fc - push hl - ld a, [de] - ld c, a - inc de -.asm_8c500 - ld [hl], $ff - ld a, [wcf65] - bit 0, a - jr z, .asm_8c50c - inc hl - jr .asm_8c50d -.asm_8c50c - dec hl -.asm_8c50d - dec c - jr nz, .asm_8c500 - pop hl - ld a, [wcf65] - bit 1, a - ld bc, $14 - jr z, .asm_8c51e - ld bc, $ffec -.asm_8c51e - add hl, bc - ld a, [de] - inc de - cp $ff - ret z - and a - jr z, .asm_8c4fc - ld c, a -.asm_8c528 - ld a, [wcf65] - bit 0, a - jr z, .asm_8c532 - dec hl - jr .asm_8c533 -.asm_8c532 - inc hl -.asm_8c533 - dec c - jr nz, .asm_8c528 - jr .asm_8c4fc -; 8c538 (23:4538) - -Unknown_8c538: db 2, 3, 5, 4, 9, $ff -Unknown_8c53e: db 1, 1, 2, 2, 4, 2, 4, 2, 3, $ff -Unknown_8c548: db 2, 1, 3, 1, 4, 1, 4, 1, 4, 1, 3, 1, 2, 1, 1, 1, 1, $ff -Unknown_8c55a: db 4, 1, 4, 0, 3, 1, 3, 0, 2, 1, 2, 0, 1, $ff -Unknown_8c568: db 4, 0, 3, 0, 3, 0, 2, 0, 2, 0, 1, 0, 1, 0, 1, $ff -; 8c578 - -Function8c578: ; 8c578 (23:4578) - callba Function5602 - ld a, $5 - ld [rSVBK], a ; $ff00+$70 - call Function8c39c - ld a, $10 - ld [wcf64], a - ld a, $1 - ld [hBGMapMode], a ; $ff00+$d4 - ret - -Function8c58f: ; 8c58f (23:458f) - ld hl, wcf64 - ld a, [hl] - and a - jr z, .asm_8c5a2 - dec [hl] - ld c, $c -.asm_8c599 - push bc - call Function8c5b8 - pop bc - dec c - jr nz, .asm_8c599 - ret -.asm_8c5a2 - ld a, $1 - ld [hBGMapMode], a ; $ff00+$d4 - call DelayFrame - call DelayFrame - call DelayFrame - xor a - ld [hBGMapMode], a ; $ff00+$d4 - ld a, $20 - ld [wcf63], a - ret - -Function8c5b8: ; 8c5b8 (23:45b8) - call Random - cp $12 - jr nc, Function8c5b8 - ld b, a -.asm_8c5c0 - call Random - cp $14 - jr nc, .asm_8c5c0 - ld c, a - ld hl, Sprites + $8c - ld de, $14 - inc b -.asm_8c5cf - add hl, de - dec b - jr nz, .asm_8c5cf - add hl, bc - ld a, [hl] - cp $ff - jr z, Function8c5b8 - ld [hl], $ff - ret - -Function8c5dc: ; 8c5dc (23:45dc) - ld a, [OtherTrainerClass] - and a - jp z, Function8c673 - xor a - ld [hBGMapMode], a ; $ff00+$d4 - hlcoord 0, 0, AttrMap - ld bc, $168 - inc b - inc c - jr .asm_8c5f4 -.asm_8c5f0 - ld a, [hl] - or $7 - ld [hli], a -.asm_8c5f4 - dec c - jr nz, .asm_8c5f0 - dec b - jr nz, .asm_8c5f0 - call Function8c6b1 - hlcoord 2, 1 - ld b, $10 -.asm_8c602 - push hl - ld c, $2 -.asm_8c605 - push hl - ld a, [de] - inc de -.asm_8c608 - and a - jr z, .asm_8c614 - sla a - jr nc, .asm_8c611 - ld [hl], $fe -.asm_8c611 - inc hl - jr .asm_8c608 -.asm_8c614 - pop hl - push bc - ld bc, $8 - add hl, bc - pop bc - dec c - jr nz, .asm_8c605 - pop hl - push bc - ld bc, $14 - add hl, bc - pop bc - dec b - jr nz, .asm_8c602 - ld a, [hCGB] ; $ff00+$e6 - and a - jr nz, .asm_8c639 - ld a, $1 - ld [hBGMapMode], a ; $ff00+$d4 - call DelayFrame - call DelayFrame - jr Function8c673 -.asm_8c639 - ld hl, Unknown_8c6a1 - ld a, [TimeOfDayPal] - and 3 - cp 3 - jr nz, .asm_8c648 - ld hl, Unknown_8c6a9 -.asm_8c648 - ld a, [rSVBK] ; $ff00+$70 - push af - ld a, $5 - ld [rSVBK], a ; $ff00+$70 - call Function8c677 - push hl - ld de, Unkn1Pals + 8 * 7 - ld bc, $8 - call CopyBytes - pop hl - ld de, BGPals + 8 * 7 - ld bc, $8 - call CopyBytes - pop af - ld [rSVBK], a ; $ff00+$70 - ld a, $1 - ld [hCGBPalUpdate], a ; $ff00+$e5 - call DelayFrame - call Function8cf4f - -Function8c673: ; 8c673 (23:4673) - call Function8c39c - ret - -Function8c677: ; 8c677 (23:4677) - ld de, Unkn1Pals + 8 * 7 - call Function8c698 - ld de, BGPals + 8 * 7 - call Function8c698 - ld de, Unkn2Pals + 8 * 6 - call Function8c698 - ld de, OBPals + 8 * 6 - call Function8c698 - ld de, Unkn2Pals + 8 * 7 - call Function8c698 - ld de, OBPals + 8 * 7 - -Function8c698: ; 8c698 (23:4698) - push hl - ld bc, $8 - call CopyBytes - pop hl - ret -; 8c6a1 (23:46a1) - -Unknown_8c6a1: ; 8c6a1 - RGB 31, 18, 29 - RGB 31, 11, 15 - RGB 31, 05, 05 - RGB 07, 07, 07 -; 8c6a9 - -Unknown_8c6a9: ; 8c6a9 - RGB 31, 18, 29 - RGB 31, 05, 05 - RGB 31, 05, 05 - RGB 31, 05, 05 - -Function8c6b1: - ld a, [OtherTrainerClass] - ld de, PokeBallTransition - ret - -PokeBallTransition: - db %00000011,%11000000 - db %00001111,%11110000 - db %00111100,%00111100 - db %00110000,%00001100 - db %01100000,%00000110 - db %01100011,%11000110 - db %11000110,%01100011 - db %11111100,%00111111 - db %11111100,%00111111 - db %11000110,%01100011 - db %01100011,%11000110 - db %01100000,%00000110 - db %00110000,%00001100 - db %00111100,%00111100 - db %00001111,%11110000 - db %00000011,%11000000 - -Function8c6d8: ; 8c6d8 - ld a, [rSVBK] - push af - ld a, $5 - ld [rSVBK], a - ld hl, LYOverrides - call Function8c6ef - ld hl, LYOverridesBackup - call Function8c6ef - pop af - ld [rSVBK], a - ret -; 8c6ef - -Function8c6ef: ; 8c6ef - xor a - ld c, $90 -.asm_8c6f2 - ld [hli], a - dec c - jr nz, .asm_8c6f2 - ret -; 8c6f7 - - -Function8c6f7: ; 8c6f7 (23:46f7) - and $3f - cp $20 - jr nc, .asm_8c702 - call Function8c70c - ld a, h - ret -.asm_8c702 - and $1f - call Function8c70c - ld a, h - xor $ff - inc a - ret - -Function8c70c: ; 8c70c (23:470c) - ld e, a - ld a, d - ld d, 0 - ld hl, Unknown_8c728 -rept 2 - add hl, de -endr - ld e, [hl] - inc hl - ld d, [hl] - ld hl, 0 -.asm_8c71b - srl a - jr nc, .asm_8c720 - add hl, de -.asm_8c720 - sla e - rl d - and a - jr nz, .asm_8c71b - ret -; 8c728 (23:4728) - -Unknown_8c728: ; 8c728 - sine_wave $100 -; 8c768 - -Function8c768: ; 8c768 (23:4768) - callba Function5602 - ld de, Unknown_8c792 -.asm_8c771 - ld a, [de] - cp $ff - jr z, .asm_8c78c - inc de - ld c, a - ld a, [de] - inc de - ld b, a - ld a, [de] - inc de - ld l, a - ld a, [de] - inc de - ld h, a - xor a - ld [hBGMapMode], a ; $ff00+$d4 - call Function8c7b7 - call WaitBGMap - jr .asm_8c771 -.asm_8c78c - ld a, $20 - ld [wcf63], a - ret -; 8c792 (23:4792) - -Unknown_8c792: ; 8c792 -macro_8c792: macro - db \1, \2 - dwcoord \3, \4 -endm - macro_8c792 4, 2, 8, 8 - macro_8c792 6, 4, 7, 7 - macro_8c792 8, 6, 6, 6 - macro_8c792 10, 8, 5, 5 - macro_8c792 12, 10, 4, 4 - macro_8c792 14, 12, 3, 3 - macro_8c792 16, 14, 2, 2 - macro_8c792 18, 16, 1, 1 - macro_8c792 20, 18, 0, 0 - db $ff -; 8c7b7 - -Function8c7b7: ; 8c7b7 (23:47b7) - ld a, $ff -.asm_8c7b9 - push bc - push hl -.asm_8c7bb - ld [hli], a - dec c - jr nz, .asm_8c7bb - pop hl - ld bc, $14 - add hl, bc - pop bc - dec b - jr nz, .asm_8c7b9 - ret -; 8c7c9 (23:47c9) - -Function8c7c9: ; 8c7c9 +Function8c7c9: ; unreferenced ld a, $1 ld [hBGMapMode], a call WaitBGMap @@ -62498,7 +54203,7 @@ ShakeHeadbuttTree: ; 8c80a lb bc, BANK(GFX_8c9cc), 4 call Request2bpp ld de, HeadbuttTreeGFX - ld hl, $8840 + ld hl, VTiles1 tile $04 lb bc, BANK(HeadbuttTreeGFX), 8 call Request2bpp call Function8cad3 @@ -62510,25 +54215,25 @@ ShakeHeadbuttTree: ; 8c80a ld a, $90 ld [wc3b5], a callba Function8cf7a - call Function8c913 + call GetHeadbuttTreeRelativeLocation ld a, $20 ld [wcf64], a call WaitSFX ld de, SFX_SANDSTORM call PlaySFX -.asm_8c852 +.loop ld hl, wcf64 ld a, [hl] and a - jr z, .asm_8c86a + jr z, .done dec [hl] ld a, $90 ld [wc3b5], a callba Function8cf7a call DelayFrame - jr .asm_8c852 + jr .loop -.asm_8c86a +.done call Function2173 call WaitBGMap xor a @@ -62550,19 +54255,20 @@ HeadbuttTreeGFX: ; 8c893 INCBIN "gfx/unknown/08c893.2bpp" ; 8c913 -Function8c913: ; 8c913 +GetHeadbuttTreeRelativeLocation: ; 8c913 xor a ld [hBGMapMode], a ld a, [PlayerDirection] - and $c + and %00001100 srl a ld e, a ld d, 0 - ld hl, Unknown_8c938 + ld hl, TreeRelativeLocationTable add hl, de ld a, [hli] ld h, [hl] ld l, a + ld a, $5 ld [hli], a ld [hld], a @@ -62576,23 +54282,24 @@ Function8c913: ; 8c913 ret ; 8c938 -Unknown_8c938: ; 8c938 - dwcoord 8, 10 - dwcoord 8, 6 - dwcoord 6, 8 - dwcoord 10, 8 +TreeRelativeLocationTable: ; 8c938 + dwcoord 8, 8 + 2 ; RIGHT + dwcoord 8, 8 - 2 ; LEFT + dwcoord 8 - 2, 8 ; DOWN + dwcoord 8 + 2, 8 ; UP +; 8c940 ; 8c940 Function8c940: ; 8c940 ld a, e and $1 - ld [wcf63], a + ld [wJumptableIndex], a call Function8c96d call WaitSFX ld de, SFX_PLACE_PUZZLE_PIECE_DOWN call PlaySFX .asm_8c952 - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_8c96c ld a, $90 @@ -62628,7 +54335,7 @@ INCBIN "gfx/unknown/08c9cc.2bpp" ; 8ca0c Function8ca0c: ; 8ca0c - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_8ca1b @@ -62658,7 +54365,7 @@ Function8ca23: ; 8ca23 (23:4a23) ld [hl], $84 ld a, $20 ld [wcf64], a - ld hl, wcf63 + ld hl, wJumptableIndex rept 2 inc [hl] endr @@ -62676,14 +54383,14 @@ Function8ca3c: ; 8ca3c (23:4a3c) call Function8ca73 ld a, $20 ld [wcf64], a - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret Function8ca5c: ; 8ca5c (23:4a5c) ld a, $1 ld [hBGMapMode], a ; $ff00+$d4 - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] Function8ca64: ; 8ca64 (23:4a64) @@ -62694,7 +54401,7 @@ Function8ca64: ; 8ca64 (23:4a64) dec [hl] ret .asm_8ca6d - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret @@ -62801,7 +54508,7 @@ Function8caed: ; 8caed ld a, $80 ld [wcf64], a .asm_8cb14 - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_8cb2e ld a, $0 @@ -62838,7 +54545,7 @@ Function8cb33: ; 8cb33 ld a, $40 ld [wcf64], a .asm_8cb60 - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_8cb7a ld a, $0 @@ -62874,7 +54581,7 @@ endr Function8cb9b: ; 8cb9b (23:4b9b) callab Function8cf53 ld de, GFX_8c9cc - ld hl, $8800 + ld hl, VTiles1 tile $00 lb bc, BANK(GFX_8c9cc), 4 call Request2bpp ld a, [CurPartyMon] @@ -62887,7 +54594,7 @@ Function8cb9b: ; 8cb9b (23:4b9b) ld e, $84 callba Function8e9bc xor a - ld [wcf63], a + ld [wJumptableIndex], a ret Function8cbc8: ; 8cbc8 (23:4bc8) @@ -62905,7 +54612,7 @@ Function8cbc8: ; 8cbc8 (23:4bc8) call PlaySFX ret .asm_8cbe0 - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret @@ -62968,7 +54675,7 @@ Special_MagnetTrain: ; 8cc04 push af ld [hl], $1 .loop - ld a, [wcf63] + ld a, [wJumptableIndex] and a jr z, .initialize bit 7, a @@ -63071,11 +54778,11 @@ Function8ccc9: ; 8ccc9 add hl, de ld d, h ld e, l - ld hl, $8040 + ld hl, VTiles0 tile $04 ld c, $4 call Request2bpp call Function8cda6 - ld hl, wcf63 + ld hl, wJumptableIndex xor a ld [hli], a ld a, [wd192] @@ -63097,19 +54804,19 @@ DrawMagnetTrain: ; 8cd27 inc a cp $12 jr c, .asm_8cd2b - ld hl, $98c0 + ld hl, VBGMap0 tile $0c ld de, MagnetTrainTilemap1 ld c, 20 call .FillLine - ld hl, $98e0 + ld hl, VBGMap0 tile $0e ld de, MagnetTrainTilemap2 ld c, 20 call .FillLine - ld hl, $9900 + ld hl, VBGMap0 tile $10 ld de, MagnetTrainTilemap3 ld c, 20 call .FillLine - ld hl, $9920 + ld hl, VBGMap0 tile $12 ld de, MagnetTrainTilemap4 ld c, 20 call .FillLine @@ -63198,13 +54905,13 @@ SetMagnetTrainPals: ; 8cdc3 call ByteFill ; train - ld hl, $9880 + ld hl, VBGMap0 tile $08 ld bc, $0140 xor a call ByteFill ; more bushes - ld hl, $99c0 + ld hl, VBGMap0 tile $1c ld bc, $0080 ld a, $2 call ByteFill @@ -63221,7 +54928,7 @@ SetMagnetTrainPals: ; 8cdc3 ; 8cdf7 Function8cdf7: ; 8cdf7 - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_8ce06 @@ -63245,7 +54952,7 @@ Jumptable_8ce06: ; 8ce06 ; 8ce14 Function8ce14: ; 8ce14 - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret ; 8ce19 @@ -63349,7 +55056,7 @@ endr Function8cea2: ; 8cea2 ld a, $80 - ld [wcf63], a + ld [wJumptableIndex], a ld de, SFX_TRAIN_ARRIVED call PlaySFX ret @@ -63444,9 +55151,11 @@ Function8cf69: ; 8cf69 push de push bc push af + ld a, $0 ld [wc3b5], a call Function8cf7a + pop af pop bc pop de @@ -63457,6 +55166,7 @@ Function8cf69: ; 8cf69 Function8cf7a: ; 8cf7a ld hl, wPartyMonMenuIconAnims ld e, 10 ; Do this first loop 10 times + .loop ld a, [hl] and a @@ -63479,6 +55189,7 @@ Function8cf7a: ; 8cf7a ld a, [wc3b5] ld l, a ld h, Sprites / $0100 + .loop2 ; Clear (Sprites + [wc3b5] --> SpritesEnd) ld a, l cp SpritesEnd % $0100 @@ -63493,7 +55204,8 @@ Function8cf7a: ; 8cf7a Function8cfa8: ; 8cfa8 (23:4fa8) ld hl, wPartyMonMenuIconAnims - ld e, $a + ld e, 10 + .loop ld a, [hl] and a @@ -63507,21 +55219,24 @@ Function8cfa8: ; 8cfa8 (23:4fa8) pop de pop hl jr c, .done + .next - ld bc, $10 + ld bc, $0010 add hl, bc dec e jr nz, .loop + ld a, [wc3b5] ld l, a - ld h, $c4 + ld h, Sprites / $100 .loop2 ld a, l - cp $40 + cp 4 * 16 jr nc, .done xor a ld [hli], a jr .loop2 + .done ret @@ -63567,6 +55282,7 @@ endr add hl, bc ld a, [wc3b4] ld [hli], a +; read from the table ld a, [de] ld [hli], a inc de @@ -63577,6 +55293,7 @@ endr call Function8d109 ld [hli], a pop de + ld hl, $0004 add hl, bc ld a, e @@ -63874,6 +55591,8 @@ endr ; 8d189 Function8d189: ; 8d189 + ; Get the [bc+10]th entry in the data table + ; indexed at [bc+1] in Unknown_8d6e6 ld hl, $0001 add hl, bc ld e, [hl] @@ -63928,51 +55647,51 @@ endr ; 8d1c4 Unknown_8d1c4: ; 8d1c4 - db $01, $01, $00 - db $07, $04, $00 - db $08, $05, $05 - db $0a, $06, $00 - db $0b, $07, $06 - db $0c, $08, $06 - db $0d, $09, $07 - db $0e, $0a, $07 - db $10, $0b, $07 - db $08, $0c, $05 - db $11, $00, $00 - db $12, $0d, $08 - db $12, $0e, $08 - db $12, $0f, $08 - db $13, $10, $00 - db $15, $00, $00 - db $16, $11, $00 - db $17, $12, $00 - db $18, $12, $00 - db $19, $13, $00 - db $1a, $14, $00 - db $1b, $00, $00 - db $1d, $15, $00 - db $1e, $00, $00 - db $1d, $17, $00 - db $1f, $00, $00 - db $24, $19, $00 - db $25, $00, $00 - db $20, $13, $00 - db $26, $1a, $00 - db $2d, $00, $00 - db $2e, $00, $00 - db $2f, $00, $00 - db $30, $00, $00 - db $31, $00, $00 - db $32, $1b, $00 - db $33, $1c, $00 - db $34, $00, $00 - db $35, $1d, $00 - db $37, $1e, $00 - db $38, $1e, $00 - db $39, $20, $00 - db $3f, $21, $00 - db $3e, $22, $00 - db $40, $00, $00 + db $01, $01, $00 ; 00 + db $07, $04, $00 ; 01 + db $08, $05, $05 ; 02 + db $0a, $06, $00 ; 03 + db $0b, $07, $06 ; 04 + db $0c, $08, $06 ; 05 + db $0d, $09, $07 ; 06 + db $0e, $0a, $07 ; 07 + db $10, $0b, $07 ; 08 + db $08, $0c, $05 ; 09 + db $11, $00, $00 ; 0a + db $12, $0d, $08 ; 0b + db $12, $0e, $08 ; 0c + db $12, $0f, $08 ; 0d + db $13, $10, $00 ; 0e + db $15, $00, $00 ; 0f + db $16, $11, $00 ; 10 + db $17, $12, $00 ; 11 + db $18, $12, $00 ; 12 + db $19, $13, $00 ; 13 + db $1a, $14, $00 ; 14 + db $1b, $00, $00 ; 15 + db $1d, $15, $00 ; 16 + db $1e, $00, $00 ; 17 + db $1d, $17, $00 ; 18 + db $1f, $00, $00 ; 19 + db $24, $19, $00 ; 1a + db $25, $00, $00 ; 1b + db $20, $13, $00 ; 1c + db $26, $1a, $00 ; 1d + db $2d, $00, $00 ; 1e + db $2e, $00, $00 ; 1f + db $2f, $00, $00 ; 20 + db $30, $00, $00 ; 21 + db $31, $00, $00 ; 22 + db $32, $1b, $00 ; 23 + db $33, $1c, $00 ; 24 + db $34, $00, $00 ; 25 + db $35, $1d, $00 ; 26 + db $37, $1e, $00 ; 27 + db $38, $1e, $00 ; 28 + db $39, $20, $00 ; 29 + db $3f, $21, $00 ; 2a + db $3e, $22, $00 ; 2b + db $40, $00, $00 ; 2c ; 8d24b @@ -64064,7 +55783,7 @@ endr ld hl, $7 add hl, bc ld a, d - and $10 + and $10 ; bit 4 jr z, .asm_8d2df ld a, e and a @@ -66219,19 +57938,16 @@ Unknown_8e6a5: ; 8e6a5 ; 8e706 -Unknown_8e706: ; 8e706 - dbbw $80, $01, Unknown_8e72a - dbbw $80, $01, Unknown_8e72a - dbbw $80, $01, Unknown_8e72a - dbbw $80, $01, Unknown_8e72a - dbbw $10, $37, Unknown_8e72a - dbbw $10, $11, Unknown_8e72a - dbbw $10, $39, Unknown_8e72a - dbbw $10, $24, Unknown_8e72a - dbbw $10, $21, Unknown_8e72a - -Unknown_8e72a: - ; nothing to see here +Unknown_8e706: ; Broken 2bpp pointers + dbbw $80, $01, $672a ; 128-tile 2bpp at 1:672a (inside Multiply) + dbbw $80, $01, $672a + dbbw $80, $01, $672a + dbbw $80, $01, $672a + dbbw $10, $37, $672a ; 16-tile 2bpp at 37:672a (within Tileset11GFX) + dbbw $10, $11, $672a ; 16-tile 2bpp at 11:672a (empty data) + dbbw $10, $39, $672a ; 16-tile 2bpp at 39:672a (empty data) + dbbw $10, $24, $672a ; 16-tile 2bpp at 24:672a (inside Function926f7) + dbbw $10, $21, $672a ; 16-tile 2bpp at 21:672a (inside Function8671c) Function8e72a: ; 8e72a add $10 @@ -66247,7 +57963,7 @@ Function8e72c: ; 8e72c and $1f call Function8e741 ld a, h - xor $ff + xor $ff ; cpl inc a ret ; 8e741 @@ -66348,20 +58064,20 @@ INCBIN "gfx/unknown/08e7f4.2bpp" GFX_8e804: ; 8e804 INCBIN "gfx/unknown/08e804.2bpp" -Function8e814: ; 8e814 +InefficientlyClear121BytesAtwc300: ; 8e814 push hl push de push bc push af ld hl, wc300 - ld bc, $00c1 -.asm_8e81e + ld bc, wc3c1 - wc300 +.loop ld [hl], $0 inc hl dec bc ld a, c or b - jr nz, .asm_8e81e + jr nz, .loop pop af pop bc pop de @@ -66427,7 +58143,7 @@ Function8e862: ; 8e862 (23:6862) Function8e86c: ; 8e86c (23:686c) push bc - ld a, [$ffb0] + ld a, [hConnectedMapWidth] ld hl, PartyMon1Item ld bc, PartyMon2 - PartyMon1 call AddNTimes @@ -66499,7 +58215,7 @@ Function8e8d5: ; 8e8d5 (23:68d5) Function8e8df: ; 8e8df (23:68df) push bc - ld a, [$ffb0] + ld a, [hConnectedMapWidth] ld hl, PartyMon1Item ld bc, $30 call AddNTimes @@ -66527,7 +58243,7 @@ Function8e8df: ; 8e8df (23:68df) Function8e908: ; 8e908 (23:6908) ld a, [wc3b7] push af - ld a, [$ffb0] + ld a, [hConnectedMapWidth] ld hl, PartySpecies ld e, a ld d, $0 @@ -66536,7 +58252,7 @@ Function8e908: ; 8e908 (23:6908) call ReadMonMenuIcon ld [CurIcon], a call Function8e9db - ld a, [$ffb0] + ld a, [hConnectedMapWidth] rept 4 add a endr @@ -66553,7 +58269,7 @@ endr Function8e936: ; 8e936 (23:6936) push bc - ld a, [$ffb0] + ld a, [hConnectedMapWidth] ld b, a call Function8e94c ld a, b @@ -66720,8 +58436,8 @@ endr ; 8ea3f GetGFXUnlessMobile: ; 8ea3f - ld a, [InLinkBattle] - cp 4 ; Mobile Link Battle + ld a, [wLinkMode] + cp LINK_MOBILE jp nz, Request2bpp jp Functiondc9 ; 8ea4a @@ -66818,877 +58534,15 @@ INCLUDE "menu/mon_icons.asm" SECTION "bank24", ROMX, BANK[$24] -AddPhoneNumber:: ; 90000 - call _CheckCellNum - jr c, .asm_9000d - call Function9002d - jr nc, .asm_9000d - ld [hl], c - xor a - ret +INCLUDE "engine/phone.asm" -.asm_9000d - scf - ret -; 9000f - - -DelCellNum:: ; 9000f - call _CheckCellNum - jr nc, .asm_90017 - xor a - ld [hl], a - ret - -.asm_90017 - scf - ret -; 90019 - -CheckCellNum:: ; 90019 - jp _CheckCellNum -; 9001c - -_CheckCellNum: ; 9001c - ld hl, wdc7c - ld b, $a -.asm_90021 - ld a, [hli] - cp c - jr z, .asm_9002a - dec b - jr nz, .asm_90021 - xor a - ret - -.asm_9002a - dec hl - scf - ret -; 9002d - -Function9002d: ; 9002d - call Function90040 - ld b, a - ld hl, wdc7c -.asm_90034 - ld a, [hli] - and a - jr z, .asm_9003d - dec b - jr nz, .asm_90034 - xor a - ret - -.asm_9003d - dec hl - scf - ret -; 90040 - -Function90040: ; 90040 - xor a - ld [Buffer1], a - ld hl, Unknown_90066 -.asm_90047 - ld a, [hli] - cp $ff - jr z, .asm_9005f - cp c - jr z, .asm_9005d - push bc - push hl - ld c, a - call _CheckCellNum - jr c, .asm_9005b - ld hl, Buffer1 - inc [hl] - -.asm_9005b - pop hl - pop bc - -.asm_9005d - jr .asm_90047 - -.asm_9005f - ld a, $a - ld hl, Buffer1 - sub [hl] - ret -; 90066 - -Unknown_90066: ; 90066 - db 1, 4, $ff -; 90069 - - -Function90069: ; 90069 - ld a, [hROMBank] - push af - ld a, b - rst Bankswitch - - call PlaceString - - pop af - rst Bankswitch - ret -; 90074 - - -CheckPhoneCall:: ; 90074 (24:4074) -; Check if the phone is ringing in the overworld. - - call CheckStandingOnEntrance - jr z, .no_call - - call Function900a6 - nop - jr nc, .no_call - - call Random - ld b, a - and $7f - cp b - jr nz, .no_call - - call GetMapHeaderPhoneServiceNybble - and a - jr nz, .no_call - - call Function900de - call Function900bf - jr nc, .no_call - - ld e, a - call Function9020d - ld a, BANK(UnknownScript_0x90241) - ld hl, UnknownScript_0x90241 - call CallScript - scf - ret - -.no_call - xor a - ret - -Function900a6: ; 900a6 (24:40a6) - callba Function11401 - ret - -Function900ad: ; 900ad (24:40ad) - push hl - push bc - push de - push af - callba CheckTime - pop af - and $7 - and c - pop de - pop bc - pop hl - ret - -Function900bf: ; 900bf (24:40bf) - ld a, [wd040] - and a - jr z, .asm_900dc - ld c, a - call Random - ld a, [hRandomAdd] ; $ff00+$e1 - swap a - and $1f - call SimpleDivide - ld c, a - ld b, $0 - ld hl, wd041 - add hl, bc - ld a, [hl] - scf - ret -.asm_900dc - xor a - ret - -Function900de: ; 900de (24:40de) - callba CheckTime - ld a, c - ld [EngineBuffer1], a ; wd03e (aliases: MenuItemsList, CurFruitTree, CurInput) - ld hl, wd040 - ld bc, $b - xor a - call ByteFill - ld de, wdc7c - ld a, $a -.asm_900f7 - ld [wd03f], a - ld a, [de] - and a - jr z, .asm_9012e - ld hl, PhoneContacts + 8 - ld bc, 12 - call AddNTimes - ld a, [EngineBuffer1] ; wd03e (aliases: MenuItemsList, CurFruitTree, CurInput) - and [hl] - jr z, .asm_9012e - ld bc, $fffa - add hl, bc - ld a, [MapGroup] - cp [hl] - jr nz, .asm_9011e - inc hl - ld a, [MapNumber] - cp [hl] - jr z, .asm_9012e -.asm_9011e - ld a, [wd040] - ld c, a - ld b, $0 - inc a - ld [wd040], a - ld hl, wd041 - add hl, bc - ld a, [de] - ld [hl], a -.asm_9012e - inc de - ld a, [wd03f] - dec a - jr nz, .asm_900f7 - ret - -Function90136:: ; 90136 (24:4136) - ld a, [wSpecialPhoneCallID] - and a - jr z, .asm_90171 - dec a - ld c, a - ld b, 0 - ld hl, SpecialPhoneCallList - ld a, 6 - call AddNTimes - ld a, [hli] - ld h, [hl] - ld l, a - call _hl_ - jr nc, .asm_90171 - call Function90178 -rept 2 - inc hl -endr - ld a, [hli] - ld e, a - push hl - call Function9020d - pop hl - ld de, wd048 - ld a, [hli] - ld [de], a - inc de - ld a, [hli] - ld [de], a - inc de - ld a, [hli] - ld [de], a - ld a, BANK(UnknownScript_0x90173) - ld hl, UnknownScript_0x90173 - call CallScript - scf - ret -.asm_90171 - xor a - ret -; 90173 (24:4173) - -UnknownScript_0x90173: ; 0x90173 - pause 30 - jump UnknownScript_0x90241 -; 0x90178 - -Function90178: ; 90178 (24:4178) - ld a, [wSpecialPhoneCallID] - dec a - ld c, a - ld b, 0 - ld hl, SpecialPhoneCallList - ld a, 6 - call AddNTimes - ret - -Function90188: ; 90188 - ld a, [wPermission] - cp $1 - jr z, .asm_90195 - cp $2 - jr z, .asm_90195 - xor a - ret -.asm_90195 - scf - ret - -Function90197: ; 90197 - scf - ret - -Function90199: ; 90199 (24:4199) - ld a, [InLinkBattle] - and a - jr nz, .asm_901e7 - call GetMapHeaderPhoneServiceNybble - and a - jr nz, .asm_901e7 - ld a, b - ld [wCurrentCaller], a - ld hl, PhoneContacts - ld bc, 12 - call AddNTimes - ld d, h - ld e, l - ld hl, 4 - add hl, de - ld a, [hl] - call Function900ad - jr z, .asm_901e7 - ld hl, 2 - add hl, de - ld a, [MapGroup] - cp [hl] - jr nz, .asm_901d9 - ld hl, $3 - add hl, de - ld a, [MapNumber] - cp [hl] - jr nz, .asm_901d9 - ld b, BANK(UnknownScript_0x90660) - ld hl, UnknownScript_0x90660 - jr .asm_901f0 - -.asm_901d9 - ld hl, $5 - add hl, de - ld b, [hl] - ld hl, $6 - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jr .asm_901f0 - -.asm_901e7 - ld b, BANK(UnknownScript_0x90209) - ld de, UnknownScript_0x90209 - call ExecuteCallbackScript - ret - -.asm_901f0 - ld a, b - ld [wd002], a - ld a, l - ld [wd003], a - ld a, h - ld [wd004], a - ld b, BANK(UnknownScript_0x90205) - ld de, UnknownScript_0x90205 - call ExecuteCallbackScript - ret -; 90205 (24:4205) - -UnknownScript_0x90205: ; 0x90205 - ptcall wd002 - return -; 0x90209 - -UnknownScript_0x90209: ; 0x90209 - scall UnknownScript_0x90657 - return -; 0x9020d - -Function9020d: ; 9020d (24:420d) - nop - nop - ld a, e - ld [wCurrentCaller], a - and a - jr nz, .asm_9021d - ld a, BANK(Unknown_90233) - ld hl, Unknown_90233 - jr .asm_90229 -.asm_9021d - ld hl, PhoneContacts - ld bc, 12 - ld a, e - call AddNTimes - ld a, BANK(PhoneContacts) -.asm_90229 - ld de, wd03f - ld bc, 12 - call FarCopyBytes - ret -; 90233 (24:4233) - -Unknown_90233: ; 90233 - db 0, 0 - dbw BANK(UnknownScript_0x90238), UnknownScript_0x90238 -UnknownScript_0x90238: - writetext UnknownText_0x9023c - end -UnknownText_0x9023c: - text_jump UnknownText_0x1c5565 - db "@" -; 90241 - -UnknownScript_0x90241: ; 0x90241 - refreshscreen $0 - callasm Function9026f - ptcall wd048 - closetext - callasm HangUp - loadmovesprites - callasm Function113e5 - end -; 0x90255 - -UnknownScript_0x90255:: ; 0x90255 - callasm Function9025c - jump UnknownScript_0x90241 -; 0x9025c - -Function9025c: ; 9025c - ld e, $3 - jp Function9020d -; 90261 - -UnknownScript_0x90261: ; 0x90261 - callasm Function9026a - pause 30 - jump UnknownScript_0x90241 -; 0x9026a - -Function9026a: ; 9026a - ld e, $4 - jp Function9020d -; 9026f - -Function9026f: ; 9026f - call Function9027c - call Function9027c - callba Function1060d3 - ret -; 9027c - -Function9027c: ; 9027c (24:427c) - call Phone_StartRinging - call Phone_Wait20Frames - call Phone_CallerTextboxWithName - call Phone_Wait20Frames - call Phone_CallerTextbox - call Phone_Wait20Frames - call Phone_CallerTextboxWithName - ret - -Phone_CallerTextboxWithName: ; 90292 (24:4292) - ld a, [wCurrentCaller] - ld b, a - call Function90363 - ret - - -PhoneCall:: ; 9029a - ld a, b - ld [PhoneScriptBank], a - ld a, e - ld [PhoneCallerLo], a - ld a, d - ld [PhoneCallerHi], a - call Phone_FirstOfTwoRings - call Phone_FirstOfTwoRings - callba Function1060d3 - ret -; 902b3 - -Phone_FirstOfTwoRings: ; 902b3 - call Phone_StartRinging - call Phone_Wait20Frames - call Phone_CallerTextboxWithName2 - call Phone_Wait20Frames - call Phone_CallerTextbox - call Phone_Wait20Frames - call Phone_CallerTextboxWithName2 - ret -; 902c9 - -Phone_CallerTextboxWithName2: ; 902c9 - call Phone_CallerTextbox - hlcoord 1, 2 - ld [hl], $62 -rept 2 - inc hl -endr - ld a, [PhoneScriptBank] - ld b, a - ld a, [PhoneCallerLo] - ld e, a - ld a, [PhoneCallerHi] - ld d, a - call Function90069 - ret -; 902e3 - - -Phone_NoSignal: ; 902e3 (24:42e3) - ld de, SFX_NO_SIGNAL - call PlaySFX - jr Phone_CallEnd - -HangUp:: ; 902eb - call HangUp_Beep - call HangUp_Wait20Frames -Phone_CallEnd: - call HangUp_BoopOn - call HangUp_Wait20Frames - call HangUp_BoopOff - call HangUp_Wait20Frames - call HangUp_BoopOn - call HangUp_Wait20Frames - call HangUp_BoopOff - call HangUp_Wait20Frames - call HangUp_BoopOn - call HangUp_Wait20Frames - call HangUp_BoopOff - call HangUp_Wait20Frames - ret -; 90316 - -Function90316: ; 90316 - ld de, SFX_SHUT_DOWN_PC - call PlaySFX - ret -; 9031d - -HangUp_Beep: ; 9031d - ld hl, UnknownText_0x9032a - call PrintText - ld de, SFX_HANG_UP - call PlaySFX - ret -; 9032a - -UnknownText_0x9032a: ; 9032a - text_jump UnknownText_0x1c5580 - db "@" -; 9032f - - -HangUp_BoopOn: ; 9032f - ld hl, UnknownText_0x90336 - call PrintText - ret -; 90336 - -UnknownText_0x90336: ; 0x90336 - text_jump UnknownText_0x1c5588 - db "@" -; 0x9033b - - -HangUp_BoopOff: ; 9033b - call SpeechTextBox - ret -; 9033f - -Phone_StartRinging: ; 9033f - call WaitSFX - ld de, SFX_CALL - call PlaySFX - call Phone_CallerTextbox - call UpdateSprites - callba Function4d188 - ret -; 90355 - -HangUp_Wait20Frames: ; 90355 - jr Phone_Wait20Frames - -Phone_Wait20Frames - ld c, 20 - call DelayFrames - callba Function4d188 - ret -; 90363 - - -Function90363: ; 90363 (24:4363) - push bc - call Phone_CallerTextbox - hlcoord 1, 1 - ld [hl], $62 -rept 2 - inc hl -endr - ld d, h - ld e, l - pop bc - call Function90380 - ret - - -Phone_CallerTextbox: ; 90375 - hlcoord 0, 0 - ld b, 2 - ld c, SCREEN_WIDTH - 2 - call TextBox - ret -; 90380 - - -Function90380: ; 90380 (24:4380) - ld h, d - ld l, e - ld a, b - call GetCallerTrainerClass - call GetCallerName - ret - -Function9038a: ; 9038a (24:438a) - ld a, c - call GetCallerTrainerClass - ld a, c - ret nz - ld a, b - cp $1 - ret z - cp $4 - ret z - ld c, $1 - ret - -GetCallerTrainerClass: ; 9039a - push hl - ld hl, PhoneContacts + 0 ; PHONE_CONTACT_TRAINER_CLASS - ld bc, 12 ; PHONE_TABLE_WIDTH - call AddNTimes - ld a, [hli] - ld b, [hl] - ld c, a - pop hl - ret -; 903a9 - - -GetCallerName: ; 903a9 (24:43a9) - ld a, c - and a - jr z, .NotTrainer - - call Phone_GetTrainerName - push hl - push bc - call PlaceString - ld a, ":" - ld [bc], a - pop bc - pop hl - ld de, SCREEN_WIDTH + 3 - add hl, de - call Phone_GetTrainerClassName - call PlaceString - ret - -.NotTrainer - push hl - ld c, b - ld b, 0 - ld hl, NonTrainerCallerNames -rept 2 - add hl, bc -endr - ld a, [hli] - ld e, a - ld d, [hl] - pop hl - call PlaceString - ret -; 903d6 (24:43d6) - -NonTrainerCallerNames: ; 903d6 - dw .none - dw .mom - dw .bikeshop - dw .bill - dw .elm - dw .buena - -.none: db "----------@" -.mom: db "MOM:@" -.bill: db "BILL:@" -.elm: db "PROF.ELM:@" -.bikeshop: db "BIKE SHOP:@" -.buena: db "BUENA:", $22, " DISC JOCKEY@" -; 90423 - -Phone_GetTrainerName: ; 90423 (24:4423) - push hl - push bc - callba GetTrainerName - pop bc - pop hl - ret - -Phone_GetTrainerClassName: ; 9042e (24:442e) - push hl - push bc - callba GetTrainerClassName - pop bc - pop hl - ret - -GetCallerLocation: ; 90439 - ld a, [wCurrentCaller] - call GetCallerTrainerClass - ld d, c - ld e, b - push de - ld a, [wCurrentCaller] - ld hl, PhoneContacts + 2 ; PHONE_CONTACT_MAP_GROUP - ld bc, 12 ; PHONE_TABLE_WIDTH - call AddNTimes - ld b, [hl] - inc hl - ld c, [hl] - push bc - call GetWorldMapLocation - ld e, a - callba GetLandmarkName - pop bc - pop de - ret -; 9045f - -PhoneContacts: ; 9045f -phone: MACRO - db \1, \2 ; trainer - map \3 ; map - db \4 - dbw BANK(\5), \5 ; script 1 - db \6 - dbw BANK(\7), \7 ; script 2 -ENDM - - phone 0, 0, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript - phone 0, 1, KRISS_HOUSE_1F, 7, MomPhoneScript, 0, UnusedPhoneScript - phone 0, 2, OAKS_LAB, 0, UnusedPhoneScript, 0, UnusedPhoneScript - phone 0, 3, N_A, 7, BillPhoneScript1, 0, BillPhoneScript2 - phone 0, 4, ELMS_LAB, 7, ElmPhoneScript1, 0, ElmPhoneScript2 - phone SCHOOLBOY, JACK1, NATIONAL_PARK, 7, JackPhoneScript1, 7, JackPhoneScript2 - phone POKEFANF, BEVERLY1, NATIONAL_PARK, 7, BeverlyPhoneScript1, 7, BeverlyPhoneScript2 - phone SAILOR, HUEY1, OLIVINE_LIGHTHOUSE_2F, 7, HueyPhoneScript1, 7, HueyPhoneScript2 - phone 0, 0, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript - phone 0, 0, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript - phone 0, 0, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript - phone COOLTRAINERM, GAVEN3, ROUTE_26, 7, GavenPhoneScript1, 7, GavenPhoneScript2 - phone COOLTRAINERF, BETH1, ROUTE_26, 7, BethPhoneScript1, 7, BethPhoneScript2 - phone BIRD_KEEPER, JOSE2, ROUTE_27, 7, JosePhoneScript1, 7, JosePhoneScript2 - phone COOLTRAINERF, REENA1, ROUTE_27, 7, ReenaPhoneScript1, 7, ReenaPhoneScript2 - phone YOUNGSTER, JOEY1, ROUTE_30, 7, JoeyPhoneScript1, 7, JoeyPhoneScript2 - phone BUG_CATCHER, WADE1, ROUTE_31, 7, WadePhoneScript1, 7, WadePhoneScript2 - phone FISHER, RALPH1, ROUTE_32, 7, RalphPhoneScript1, 7, RalphPhoneScript2 - phone PICNICKER, LIZ1, ROUTE_32, 7, LizPhoneScript1, 7, LizPhoneScript2 - phone HIKER, ANTHONY2, ROUTE_33, 7, AnthonyPhoneScript1, 7, AnthonyPhoneScript2 - phone CAMPER, TODD1, ROUTE_34, 7, ToddPhoneScript1, 7, ToddPhoneScript2 - phone PICNICKER, GINA1, ROUTE_34, 7, GinaPhoneScript1, 7, GinaPhoneScript2 - phone JUGGLER, IRWIN1, ROUTE_35, 7, IrwinPhoneScript1, 7, IrwinPhoneScript2 - phone BUG_CATCHER, ARNIE1, ROUTE_35, 7, ArniePhoneScript1, 7, ArniePhoneScript2 - phone SCHOOLBOY, ALAN1, ROUTE_36, 7, AlanPhoneScript1, 7, AlanPhoneScript2 - phone 0, 0, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript - phone LASS, DANA1, ROUTE_38, 7, DanaPhoneScript1, 7, DanaPhoneScript2 - phone SCHOOLBOY, CHAD1, ROUTE_38, 7, ChadPhoneScript1, 7, ChadPhoneScript2 - phone POKEFANM, DEREK1, ROUTE_39, 7, DerekPhoneScript1, 7, DerekPhoneScript2 - phone FISHER, TULLY1, ROUTE_42, 7, TullyPhoneScript1, 7, TullyPhoneScript2 - phone POKEMANIAC, BRENT1, ROUTE_43, 7, BrentPhoneScript1, 7, BrentPhoneScript2 - phone PICNICKER, TIFFANY3, ROUTE_43, 7, TiffanyPhoneScript1, 7, TiffanyPhoneScript2 - phone BIRD_KEEPER, VANCE1, ROUTE_44, 7, VancePhoneScript1, 7, VancePhoneScript2 - phone FISHER, WILTON1, ROUTE_44, 7, WiltonPhoneScript1, 7, WiltonPhoneScript2 - phone BLACKBELT_T, KENJI3, ROUTE_45, 7, KenjiPhoneScript1, 7, KenjiPhoneScript2 - phone HIKER, PARRY1, ROUTE_45, 7, ParryPhoneScript1, 7, ParryPhoneScript2 - phone PICNICKER, ERIN1, ROUTE_46, 7, ErinPhoneScript1, 7, ErinPhoneScript2 - phone 0, 5, GOLDENROD_DEPT_STORE_ROOF, 7, BuenaPhoneScript1, 7, BuenaPhoneScript2 -; 90627 - -SpecialPhoneCallList: ; 90627 - dw Function90188 - db 4 - dbw BANK(ElmPhoneScript2), ElmPhoneScript2 - - dw Function90188 - db 4 - dbw BANK(ElmPhoneScript2), ElmPhoneScript2 - - dw Function90188 - db 4 - dbw BANK(ElmPhoneScript2), ElmPhoneScript2 - - dw Function90188 - db 4 - dbw BANK(ElmPhoneScript2), ElmPhoneScript2 - - dw Function90197 - db 4 - dbw BANK(ElmPhoneScript2), ElmPhoneScript2 - - dw Function90197 - db 2 - dbw BANK(BikeShopPhoneScript), BikeShopPhoneScript ; bike shop - - dw Function90197 - db 1 - dbw BANK(MomPhoneLectureScript), MomPhoneLectureScript - - dw Function90188 - db 4 - dbw BANK(ElmPhoneScript2), ElmPhoneScript2 -; 90657 - -UnknownScript_0x90657: ; 0x90657 - writetext UnknownText_0x9065b - end -; 0x9065b - -UnknownText_0x9065b: ; 0x9065b - ; That number is out of the area. - text_jump UnknownText_0x1c558b - db "@" -; 0x90660 - -UnknownScript_0x90660: ; 0x90660 - writetext UnknownText_0x90664 - end -; 0x90664 - -UnknownText_0x90664: ; 0x90664 - ; Just go talk to that person! - text_jump UnknownText_0x1c55ac - db "@" -; 0x90669 - -UnknownScript_0x90669: ; 0x90669 - writetext UnknownText_0x9066d - end -; 0x9066d - -UnknownText_0x9066d: ; 0x9066d - ; Thank you! - text_jump UnknownText_0x1c55ca - db "@" -; 0x90672 - -Function90672: ; 90672 (24:4672) - ld a, [$ffaa] +InitClock: ; 90672 (24:4672) +; Ask the player to set the time. + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a + ld a, $0 ld [wc2ce], a ld a, $10 @@ -67708,109 +58562,116 @@ Function90672: ; 90672 (24:4672) ld [hBGMapMode], a ; $ff00+$d4 call Functione51 ld de, GFX_908fb - ld hl, $9000 + ld hl, VTiles2 tile $00 lb bc, BANK(GFX_908fb), 1 call Request1bpp ld de, GFX_90903 - ld hl, $9010 + ld hl, VTiles2 tile $01 lb bc, BANK(GFX_90903), 1 call Request1bpp ld de, GFX_9090b - ld hl, $9020 + ld hl, VTiles2 tile $02 lb bc, BANK(GFX_9090b), 1 call Request1bpp - call Function90783 + call .ClearScreen call WaitBGMap call Function4a3 ld hl, UnknownText_0x90874 call PrintText ld hl, wc608 - ld bc, $32 + ld bc, 50 xor a call ByteFill ld a, $a - ld [wc608 + 20], a -.asm_906e8 + ld [wInitHourBuffer], a + +.loop ld hl, UnknownText_0x90879 call PrintText hlcoord 3, 7 - ld b, $2 - ld c, $f + ld b, 2 + ld c, 15 call TextBox hlcoord 11, 7 ld [hl], $1 hlcoord 11, 10 ld [hl], $2 hlcoord 4, 9 - call Function907de + call DisplayHourOClock ld c, $a call DelayFrames -.asm_9070d - call Functiona57 - call Function90795 - jr nc, .asm_9070d - ld a, [wc608 + 20] + +.SetHourLoop + call JoyTextDelay + call SetHour + jr nc, .SetHourLoop + + ld a, [wInitHourBuffer] ld [StringBuffer2 + 1], a - call Function90783 + call .ClearScreen ld hl, UnknownText_0x90886 call PrintText call YesNoBox - jr nc, .asm_9072e - call Function90783 - jr .asm_906e8 -.asm_9072e + jr nc, .HourIsSet + call .ClearScreen + jr .loop + +.HourIsSet ld hl, UnknownText_0x9089a call PrintText hlcoord 11, 7 - ld bc, $207 + lb bc, 2, 7 call TextBox hlcoord 15, 7 ld [hl], $1 hlcoord 15, 10 ld [hl], $2 hlcoord 12, 9 - call Function90859 + call DisplayMinutesWithMinString ld c, 10 call DelayFrames -.asm_90752 - call Functiona57 - call Function90810 - jr nc, .asm_90752 + +.SetMinutesLoop + call JoyTextDelay + call SetMinutes + jr nc, .SetMinutesLoop + ld a, [BattleMonNick + 5] ld [StringBuffer2 + 2], a - call Function90783 + call .ClearScreen ld hl, UnknownText_0x908a4 call PrintText call YesNoBox - jr nc, .asm_90773 - call Function90783 - jr .asm_9072e -.asm_90773 + jr nc, .MinutesAreSet + call .ClearScreen + jr .HourIsSet + +.MinutesAreSet call Function658 - ld hl, UnknownText_0x908b8 + ld hl, OakText_ResponseToSetTime call PrintText call Functiona80 pop af - ld [$ffaa], a + ld [hInMenu], a ret -Function90783: ; 90783 (24:4783) +.ClearScreen: ; 90783 (24:4783) xor a ld [hBGMapMode], a ; $ff00+$d4 hlcoord 0, 0 - ld bc, $168 + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH xor a call ByteFill ld a, $1 ld [hBGMapMode], a ; $ff00+$d4 ret -Function90795: ; 90795 (24:4795) +SetHour: ; 90795 (24:4795) ld a, [hJoyPressed] and A_BUTTON - jr nz, .asm_907dc + jr nz, .Confirm - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_UP jr nz, .up @@ -67822,50 +58683,50 @@ Function90795: ; 90795 (24:4795) ret .down - ld hl, wc608 + 20 + ld hl, wInitHourBuffer ld a, [hl] and a - jr nz, .asm_907b6 + jr nz, .DecreaseThroughMidnight ld a, 23 + 1 -.asm_907b6 +.DecreaseThroughMidnight dec a ld [hl], a - jr .asm_907c6 + jr .okay .up - ld hl, wc608 + 20 + ld hl, wInitHourBuffer ld a, [hl] cp 23 - jr c, .asm_907c4 + jr c, .AdvanceThroughMidnight ld a, -1 -.asm_907c4 +.AdvanceThroughMidnight inc a ld [hl], a -.asm_907c6 +.okay hlcoord 4, 9 ld a, " " ld bc, 15 call ByteFill hlcoord 4, 9 - call Function907de + call DisplayHourOClock call WaitBGMap and a ret -.asm_907dc +.Confirm scf ret -Function907de: ; 907de (24:47de) +DisplayHourOClock: ; 907de (24:47de) push hl - ld a, [wc608 + 20] + ld a, [wInitHourBuffer] ld c, a ld e, l ld d, h - call Function90b3e + call PrintHour inc hl - ld de, String_9087e + ld de, String_oclock call PlaceString pop hl ret @@ -67875,7 +58736,7 @@ Function907f1: ; 907f1 ld h, d ld l, e push hl - call Function907de + call DisplayHourOClock pop de rept 2 inc de @@ -67892,18 +58753,18 @@ endr ld a, [de] ld [hl], a pop hl - call Function90859 + call DisplayMinutesWithMinString rept 3 inc hl endr ret ; 90810 -Function90810: ; 90810 (24:4810) +SetMinutes: ; 90810 (24:4810) ld a, [hJoyPressed] ; $ff00+$a7 - and $1 + and A_BUTTON jr nz, .asm_90857 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_UP jr nz, .asm_90835 @@ -67938,7 +58799,7 @@ Function90810: ; 90810 (24:4810) ld bc, 7 call ByteFill hlcoord 12, 9 - call Function90859 + call DisplayMinutesWithMinString call WaitBGMap and a ret @@ -67946,15 +58807,15 @@ Function90810: ; 90810 (24:4810) scf ret -Function90859: ; 90859 (24:4859) +DisplayMinutesWithMinString: ; 90859 (24:4859) ld de, BattleMonNick + 5 - call Function90867 + call PrintTwoDigitNumberRightAlign inc hl - ld de, String_9089f + ld de, String_min call PlaceString ret -Function90867: ; 90867 (24:4867) +PrintTwoDigitNumberRightAlign: ; 90867 (24:4867) push hl ld a, " " ld [hli], a @@ -67977,7 +58838,7 @@ UnknownText_0x90879: ; 0x90879 db "@" ; 0x9087e -String_9087e: +String_oclock: db "o'clock@" ; 90886 @@ -67986,7 +58847,7 @@ UnknownText_0x90886: ; 0x90886 text_jump UnknownText_0x1bc2fd start_asm hlcoord 1, 16 - call Function907de + call DisplayHourOClock ld hl, UnknownText_0x90895 ret ; 90895 (24:4895) @@ -68003,7 +58864,7 @@ UnknownText_0x9089a: ; 0x9089a db "@" ; 0x9089f -String_9089f: +String_min: db "min.@" ; 908a4 @@ -68013,7 +58874,7 @@ UnknownText_0x908a4: ; 0x908a4 start_asm ; 0x908a9 hlcoord 7, 14 - call Function90859 + call DisplayMinutesWithMinString ld hl, UnknownText_0x908b3 ret ; 908b3 (24:48b3) @@ -68024,12 +58885,12 @@ UnknownText_0x908b3: ; 0x908b3 db "@" ; 0x908b8 -UnknownText_0x908b8: ; 0x908b8 +OakText_ResponseToSetTime: ; 0x908b8 start_asm decoord 1, 14 - ld a, [wc608 + 20] + ld a, [wInitHourBuffer] ld c, a - call Function90b3e + call PrintHour ld [hl], ":" inc hl ld de, BattleMonNick + 5 @@ -68037,37 +58898,37 @@ UnknownText_0x908b8: ; 0x908b8 call PrintNum ld b, h ld c, l - ld a, [wc608 + 20] + ld a, [wInitHourBuffer] cp 4 - jr c, .asm_908e0 + jr c, .NITE cp 11 - jr c, .asm_908e4 + jr c, .MORN cp 18 - jr c, .asm_908e8 -.asm_908e0 - ld hl, UnknownText_0x908f6 + jr c, .DAY +.NITE + ld hl, .sodark ret -.asm_908e4 - ld hl, UnknownText_0x908ec +.MORN + ld hl, .overslept ret -.asm_908e8 - ld hl, UnknownText_0x908f1 +.DAY + ld hl, .yikes ret ; 908ec (24:48ec) -UnknownText_0x908ec: ; 0x908ec +.overslept: ; 0x908ec ; ! I overslept! text_jump UnknownText_0x1bc326 db "@" ; 0x908f1 -UnknownText_0x908f1: ; 0x908f1 +.yikes: ; 0x908f1 ; ! Yikes! I over- slept! text_jump UnknownText_0x1bc336 db "@" ; 0x908f6 -UnknownText_0x908f6: ; 0x908f6 +.sodark: ; 0x908f6 ; ! No wonder it's so dark! text_jump UnknownText_0x1bc34f db "@" @@ -68082,30 +58943,30 @@ INCBIN "gfx/unknown/09090b.2bpp" ; 90913 Special_SetDayOfWeek: ; 90913 - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a ld de, GFX_90903 - ld hl, $8ef0 + ld hl, VTiles1 tile $6f lb bc, BANK(GFX_90903), 1 call Request1bpp ld de, GFX_9090b - ld hl, $8f50 + ld hl, VTiles1 tile $75 lb bc, BANK(GFX_9090b), 1 call Request1bpp xor a ld [DefaultFlypoint], a .asm_90936 hlcoord 0, 12 - ld bc, $0412 + lb bc, 4, 18 call TextBox call Function1d6e ld hl, UnknownText_0x90a3f call PrintText hlcoord 9, 3 - ld b, $2 - ld c, $9 + ld b, 2 + ld c, 9 call TextBox hlcoord 14, 3 ld [hl], $ef @@ -68117,7 +58978,7 @@ Special_SetDayOfWeek: ; 90913 ld c, $a call DelayFrames .asm_9096a - call Functiona57 + call JoyTextDelay call Function90993 jr nc, .asm_9096a call ExitMenu @@ -68131,7 +58992,7 @@ Special_SetDayOfWeek: ; 90913 call Function663 call Functione51 pop af - ld [$ffaa], a + ld [hInMenu], a ret ; 90993 @@ -68143,7 +59004,7 @@ Function90993: ; 90993 ret .asm_9099b - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_UP jr nz, .asm_909ba @@ -68311,7 +59172,7 @@ UnknownText_0x90ab7: ; 0x90ab7 Function90abc: ; 90abc hlcoord 1, 14 - ld bc, $0312 + lb bc, 3, SCREEN_WIDTH - 2 call ClearBox ld hl, UnknownText_0x90acc call PlaceWholeStringInBoxAtOnce @@ -68372,8 +59233,7 @@ UnknownText_0x90acc: ; 0x90acc ; 90b13 UnknownText_0x90b13: ; 0x90b13 - db $0 - para "Now on DEBUG…" + text "Now on DEBUG…" prompt ; 0x90b23 @@ -68393,23 +59253,23 @@ Function90b23: ; 90b23 ret ; 90b3e -Function90b3e: ; 90b3e (24:4b3e) +PrintHour: ; 90b3e (24:4b3e) ld l, e ld h, d push bc - call Function90b58 + call GetTimeOfDayString call PlaceString ld l, c ld h, b inc hl pop bc - call Function90b7f + call AdjustHourForAMorPM ld [wd265], a ld de, wd265 - call Function90867 + call PrintTwoDigitNumberRightAlign ret -Function90b58: ; 90b58 (24:4b58) +GetTimeOfDayString: ; 90b58 (24:4b58) ld a, c cp 4 jr c, .nite @@ -68418,31 +59278,33 @@ Function90b58: ; 90b58 (24:4b58) cp 18 jr c, .day .nite - ld de, String_90b71 + ld de, .NITE ret .morn - ld de, String_90b76 + ld de, .MORN ret .day - ld de, String_90b7b + ld de, .DAY ret ; 90b71 (24:4b71) -String_90b71: db "NITE@" -String_90b76: db "MORN@" -String_90b7b: db "DAY@" +.NITE: db "NITE@" +.MORN: db "MORN@" +.DAY: db "DAY@" ; 90b7f -Function90b7f: ; 90b7f (24:4b7f) +AdjustHourForAMorPM: +; Convert the hour stored in c (0-23) to a 1-12 value ld a, c or a - jr z, .asm_90b8a + jr z, .midnight cp 12 ret c ret z sub 12 ret -.asm_90b8a + +.midnight ld a, 12 ret @@ -68451,10 +59313,10 @@ Function90b8d: ; 90b8d (24:4b8d) ld a, [hl] push af set NO_TEXT_SCROLL, [hl] - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a ld a, [VramState] push af xor a @@ -68464,8 +59326,8 @@ Function90b8d: ; 90b8d (24:4b8d) .loop call UpdateTime - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] bit 7, a jr nz, .done call Function90f04 @@ -68480,13 +59342,13 @@ Function90b8d: ; 90b8d (24:4b8d) pop af ld [VramState], a pop af - ld [$ffaa], a + ld [hInMenu], a pop af ld [Options], a call WhiteBGMap xor a ld [hBGMapAddress], a - ld a, $98 + ld a, VBGMap0 / $100 ld [hBGMapAddress + 1], a ld a, $90 ld [hWY], a @@ -68512,7 +59374,7 @@ Function90bea: ; 90bea (24:4bea) ld [rLCDC], a call Function90d70 xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [wcf65], a ld [wcf66], a @@ -68567,7 +59429,7 @@ Function90c4e: ; 90c4e ld a, b push af - ld de, $8100 + ld de, VTiles0 tile $10 ld bc, $40 call FarCopyBytes pop af @@ -68576,14 +59438,14 @@ Function90c4e: ; 90c4e ld de, $c0 add hl, de - ld de, $8140 + ld de, VTiles0 tile $14 ld bc, $40 call FarCopyBytes ret .ssaqua ld hl, FastShipGFX - ld de, $8100 + ld de, VTiles0 tile $10 ld bc, $80 call CopyBytes ret @@ -68668,7 +59530,7 @@ Function90d70: ; 90d70 (24:4d70) Function90d9e: ; 90d9e (24:4d9e) ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a xor a ld [wcf64], a ret @@ -68703,7 +59565,7 @@ Function90da8: ; 90da8 (24:4da8) xor a ld [hBGMapAddress], a - ld a, $98 + ld a, VBGMap0 / $100 ld [hBGMapAddress + 1], a call Function90e00 ld a, $90 @@ -68712,7 +59574,7 @@ Function90da8: ; 90da8 (24:4da8) .asm_90de8 xor a ld [hBGMapAddress], a - ld a, $9c + ld a, VBGMap1 / $100 ld [hBGMapAddress + 1], a call Function90e00 xor a @@ -68876,7 +59738,7 @@ Function90ef7: ; 90ef7 (24:4ef7) ret Function90f04: ; 90f04 (24:4f04) - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_90f13 @@ -68908,14 +59770,14 @@ Function90f2d: ; 90f2d (24:4f2d) call Function90da8 ld hl, UnknownText_0x914d3 call PrintText - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] call Function91492 ret Function90f3e: ; 90f3e (24:4f3e) call Function90f7b - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and A_BUTTON + B_BUTTON + START + SELECT @@ -68953,7 +59815,7 @@ Function90f3e: ; 90f3e (24:4f3e) ret .asm_90f75 - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret @@ -69004,7 +59866,7 @@ Function90fb4: ; 90fb4 (24:4fb4) .kanto ld a, 5 .done - ld [wcf63], a + ld [wJumptableIndex], a call Function91492 ret @@ -69018,7 +59880,7 @@ Function90fcd: ; 90fcd (24:4fcd) ld [wc6d5], a ld a, b ld [wc6d6], a - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret @@ -69030,7 +59892,7 @@ Function90fee: ; 90fee (24:4fee) ld d, $2e ld e, $1 Function90ff2: ; 90ff2 (24:4ff2) - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and B_BUTTON jr nz, .cancel @@ -69066,12 +59928,12 @@ Function90ff2: ; 90ff2 (24:4ff2) call Function91480 ret .cancel - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret Function9102f: ; 9102f (24:502f) - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_UP jr nz, .up @@ -69214,12 +60076,12 @@ Function910f9: ; 910f9 (24:50f9) add hl, bc ld [hl], $8 call _UpdateRadioStation - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret Function91112: ; 91112 (24:5112) - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and B_BUTTON jr nz, .cancel @@ -69260,12 +60122,12 @@ Function91112: ; 91112 (24:5112) ret .cancel - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret Function91156: ; 91156 (24:5156) - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] xor a ld [wc6d2], a @@ -69285,7 +60147,7 @@ Function91171: ; 91171 (24:5171) ld a, [hl] and A_BUTTON jr nz, .a - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_LEFT jr nz, .left @@ -69318,12 +60180,12 @@ Function91171: ; 91171 (24:5171) ret .b - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret .a - ld hl, wdc7c + ld hl, wPhoneList ld a, [wc6d2] ld e, a ld d, 0 @@ -69345,13 +60207,13 @@ Function91171: ; 91171 (24:5171) call Function91342 jr c, .asm_911e5 - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret .asm_911e5 ld a, $8 - ld [wcf63], a + ld [wJumptableIndex], a ret Function911eb: ; 911eb (24:51eb) @@ -69361,7 +60223,7 @@ Function911eb: ; 911eb (24:51eb) ld hl, Options res NO_TEXT_SCROLL, [hl] xor a - ld [$ffaa], a + ld [hInMenu], a ld de, SFX_CALL call PlaySFX ld hl, UnknownText_0x9124c @@ -69380,9 +60242,9 @@ Function911eb: ; 911eb (24:51eb) ld hl, Options set NO_TEXT_SCROLL, [hl] ld a, $1 - ld [$ffaa], a + ld [hInMenu], a call Function912b7 - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret .asm_91234 @@ -69390,7 +60252,7 @@ Function911eb: ; 911eb (24:51eb) ld hl, OutOfServiceAreaText call PrintText ld a, $8 - ld [wcf63], a + ld [wJumptableIndex], a ld hl, UnknownText_0x914ce call PrintText ret @@ -69410,17 +60272,17 @@ OutOfServiceAreaText: ; 0x91251 Function91256: ; 91256 (24:5256) ld a, [hJoyPressed] ; $ff00+$a7 - and $3 + and A_BUTTON | B_BUTTON ret z callba HangUp ld a, $8 - ld [wcf63], a + ld [wJumptableIndex], a ld hl, UnknownText_0x914ce call PrintText ret Function9126d: ; 9126d (24:526d) - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_UP jr nz, .up @@ -69510,7 +60372,7 @@ endr ld a, [wc6d2] ld e, a ld d, $0 - ld hl, wdc7c + ld hl, wPhoneList add hl, de xor a ld [wc6d0], a @@ -69538,7 +60400,7 @@ endr ; 9131e (24:531e) Function9131e: ; 9131e - ld hl, wdc7c + ld hl, wPhoneList ld a, [wc6d2] ld e, a ld d, 0 @@ -69548,7 +60410,7 @@ Function9131e: ; 9131e ld d, 0 add hl, de ld [hl], 0 - ld hl, wdc7c + ld hl, wPhoneList ld c, $a .asm_91336 ld a, [hli] @@ -69564,7 +60426,7 @@ Function9131e: ; 9131e ; 91342 Function91342: ; 91342 (24:5342) - ld hl, wdc7c + ld hl, wPhoneList ld a, [wc6d2] ld e, a ld d, 0 @@ -69599,7 +60461,7 @@ Function91342: ; 91342 (24:5342) ld h, a inc de push hl - ld bc, $ffd7 + ld bc, hBGMapAddress + 1 add hl, bc ld a, [de] inc de @@ -69620,7 +60482,7 @@ Function91342: ; 91342 (24:5342) .asm_91398 push de - call Functiona57 + call JoyTextDelay pop de ld hl, hJoyPressed ld a, [hl] @@ -69783,7 +60645,7 @@ Function91480: ; 91480 (24:5480) ld de, SFX_READ_TEXT_2 call PlaySFX ld a, c - ld [wcf63], a + ld [wJumptableIndex], a ld a, b ld [wcf64], a call Function914ab @@ -69875,10 +60737,10 @@ Function9191c: ; 9191c ld a, [hl] push af set 4, [hl] - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a ld a, [VramState] push af xor a @@ -69935,7 +60797,7 @@ Function9191c: ; 9191c pop af ld [VramState], a pop af - ld [$ffaa], a + ld [hInMenu], a pop af ld [Options], a call WhiteBGMap @@ -69944,12 +60806,12 @@ Function9191c: ; 9191c Function919b0: ; 919b0 .asm_919b0 - call Functiona57 + call JoyTextDelay ld hl, hJoyPressed ld a, [hl] and B_BUTTON ret nz - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_UP jr nz, .asm_919d4 @@ -70047,7 +60909,7 @@ PlayRadio: ; 91a53 ld c, 100 call DelayFrames .loop - call Functiona57 + call JoyTextDelay ld a, [hJoyPressed] and A_BUTTON | B_BUTTON jr nz, .stop @@ -70148,7 +61010,7 @@ _FlyMap: ; 91af3 call WhiteBGMap call ClearTileMap call ClearSprites - ld hl, $ffaa + ld hl, hInMenu ld a, [hl] push af ld [hl], $1 @@ -70157,7 +61019,7 @@ _FlyMap: ; 91af3 callba Function8cf53 call Function91ff2 ld de, GFX_922e1 - ld hl, $9300 + ld hl, VTiles2 tile $30 lb bc, BANK(GFX_922e1), 6 call Request1bpp call FlyMap @@ -70166,7 +61028,7 @@ _FlyMap: ; 91af3 call GetSGBLayout call Function32f9 .loop - call Functiona57 + call JoyTextDelay ld hl, hJoyPressed ld a, [hl] and B_BUTTON @@ -70196,14 +61058,14 @@ _FlyMap: ; 91af3 .exit ld [DefaultFlypoint], a pop af - ld [$ffaa], a + ld [hInMenu], a call WhiteBGMap ld a, $90 ld [hWY], a xor a ld [hBGMapAddress], a - ld a, $98 - ld [$ffd7], a + ld a, VBGMap0 / $100 + ld [hBGMapAddress + 1], a ld a, [DefaultFlypoint] ld e, a ret @@ -70214,7 +61076,7 @@ FlyMapScroll: ; 91b73 ld e, a ld a, [EndFlypoint] ld d, a - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_UP jr nz, .ScrollNext @@ -70564,13 +61426,13 @@ Function91d11: ; 91d11 xor a ld [hBGMapMode], a ld a, $1 - ld [$ffaa], a + ld [hInMenu], a ld de, GFX_922d1 - ld hl, $87f0 + ld hl, VTiles0 tile $7f lb bc, BANK(GFX_922d1), 1 call Request2bpp ; actually 1bpp call Function91ed0 - ld hl, $8780 + ld hl, VTiles0 tile $78 ld c, $4 call Request2bpp call Function91ff2 @@ -70592,13 +61454,13 @@ Function91d11: ; 91d11 xor a call Function91e1e .asm_91d6e - call Functiona57 + call JoyTextDelay ld hl, hJoyPressed ld a, [hl] - and $3 + and A_BUTTON | B_BUTTON jr nz, .asm_91d8f ld a, [hJoypadDown] - and $4 + and SELECT jr nz, .asm_91d87 call Function91d9b call Function91dcd @@ -70847,7 +61709,7 @@ TownMapBGUpdate: ; 91ee4 ld a, l ld [hBGMapAddress], a ld a, h - ld [$ffd7], a + ld [hBGMapAddress + 1], a ; Only update palettes on CGB ld a, [hCGB] @@ -70992,7 +61854,7 @@ TownMapPlayerIcon: ; 91fa6 callba GetPlayerIcon ; Standing icon - ld hl, $8100 + ld hl, VTiles0 tile $10 ld c, 4 ; # tiles call Request2bpp @@ -71001,7 +61863,7 @@ TownMapPlayerIcon: ; 91fa6 add hl, de ld d, h ld e, l - ld hl, $8140 + ld hl, VTiles0 tile $14 ld c, 4 ; # tiles ld a, BANK(ChrisSpriteGFX) ; does nothing call Request2bpp @@ -71067,7 +61929,7 @@ Function92311: ; 92311 call WhiteBGMap call ClearTileMap call ClearSprites - ld hl, $ffaa + ld hl, hInMenu ld a, [hl] push af ld [hl], $1 @@ -71076,7 +61938,7 @@ Function92311: ; 92311 callba Function8cf53 call Function91ff2 ld de, GFX_922e1 - ld hl, $9300 + ld hl, VTiles2 tile $30 lb bc, BANK(GFX_922e1), 6 call Request1bpp call FillKantoMap @@ -71098,7 +61960,7 @@ Function92311: ; 92311 call GetSGBLayout call Function32f9 .loop - call Functiona57 + call JoyTextDelay ld hl, hJoyPressed ld a, [hl] and B_BUTTON @@ -71128,21 +61990,21 @@ Function92311: ; 92311 .asm_9239f ld [DefaultFlypoint], a pop af - ld [$ffaa], a + ld [hInMenu], a call WhiteBGMap ld a, $90 ld [hWY], a xor a ld [hBGMapAddress], a - ld a, $98 - ld [$ffd7], a + ld a, VBGMap0 / $100 + ld [hBGMapAddress + 1], a ld a, [DefaultFlypoint] ld e, a ret ; 923b8 Function923b8: ; 923b8 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_DOWN | D_RIGHT jr nz, .asm_923c6 @@ -71188,7 +62050,7 @@ Function923b8: ; 923b8 .asm_923f3 ld [hWY], a ld a, b - ld [$ffd7], a + ld [hBGMapAddress + 1], a call TownMapBubble call WaitBGMap xor a @@ -71213,7 +62075,7 @@ _SlotMachine: call PlaySFX call WaitSFX call WhiteBGMap - callba Function105fd0 + callba MobileFn_105fd0 ld hl, Options res 4, [hl] ld hl, rLCDC ; $ff40 @@ -71228,7 +62090,7 @@ Function926f7: ; 926f7 (24:66f7) call PlayMusic call DelayFrame call DisableLCD - ld hl, $9800 + ld hl, VBGMap0 tile $00 ld bc, $400 ld a, $7f call ByteFill @@ -71240,16 +62102,16 @@ Function926f7: ; 926f7 (24:66f7) xor a call ByteFill ld hl, Slots2LZ - ld de, $8000 + ld de, VTiles0 tile $00 call Decompress ld hl, Slots3LZ - ld de, $8400 + ld de, VTiles0 tile $40 call Decompress ld hl, Slots1LZ - ld de, $9000 + ld de, VTiles2 tile $00 call Decompress ld hl, Slots2LZ - ld de, $9250 + ld de, VTiles2 tile $25 call Decompress ld hl, SlotsTilemap decoord 0, 0 @@ -71269,7 +62131,7 @@ Function926f7: ; 926f7 (24:66f7) ld [hli], a ld [hl], $40 xor a - ld [wcf63], a + ld [wJumptableIndex], a ld a, $ff ld [wc709], a ld de, MUSIC_GAME_CORNER @@ -71296,7 +62158,7 @@ Function9279b: ; 9279b (24:679b) ret Function927af: ; 927af (24:67af) - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_927d1 call Function92844 @@ -71392,7 +62254,7 @@ endr ; 92844 Function92844: ; 92844 (24:6844) - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_92853 @@ -71429,7 +62291,7 @@ Jumptable_92853: ; 92853 (24:6853) Function92879: ; 92879 (24:6879) - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret @@ -71446,7 +62308,7 @@ Function9288e: ; 9288e (24:688e) call Function9307c jr nc, .asm_92899 ld a, $12 - ld [wcf63], a + ld [wJumptableIndex], a ret .asm_92899 call Function92879 @@ -71637,15 +62499,15 @@ Function929d9: ; 929d9 (24:69d9) call Function930e9 jr c, .asm_929ea ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret .asm_929ea ld a, $12 - ld [wcf63], a + ld [wJumptableIndex], a ret Function929f0: ; 929f0 (24:69f0) - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret @@ -72959,7 +63821,7 @@ Function93124: ; 93124 (24:7124) ld a, [hl] ld [wc711], a ld d, a - callba Function105fe3 + callba MobileFn_105fe3 ret .data_93145 @@ -72983,7 +63845,7 @@ Function93158: ; 93158 (24:7158) jr nz, .asm_9316c ld hl, UnknownText_0x931e0 call PrintText - callba Function105fd0 + callba MobileFn_105fd0 ret .asm_9316c srl a @@ -73005,7 +63867,7 @@ endr .asm_93188 ld hl, UnknownText_0x931b9 call PrintText - callba Function105f9f + callba MobileFn_105f9f ret ; 93195 (24:7195) @@ -73031,13 +63893,13 @@ UnknownText_0x931b9: ; 0x931b9 Function931ba: ; 931ba ld a, [EffectFailed] add $25 - ldcoord 2, 13 + ldcoord_a 2, 13 inc a - ldcoord 2, 14 + ldcoord_a 2, 14 inc a - ldcoord 3, 13 + ldcoord_a 3, 13 inc a - ldcoord 3, 14 + ldcoord_a 3, 14 hlcoord 18, 17 ld [hl], $ee ld hl, UnknownText_0x931db @@ -73481,7 +64343,7 @@ Functionb8098:: ; b8098 (2e:4098) Functionb80c6: ; b80c6 ld de, GFX_f9344 - ld hl, $9600 + ld hl, VTiles2 tile $60 lb bc, BANK(GFX_f9344), $e call Get2bpp ret @@ -73701,7 +64563,7 @@ CheckForSignpostItems: ; b8172 TreeMonEncounter: ; b81ea - callba Function1060ef + callba MobileFn_1060ef xor a ld [TempWildMonSpecies], a @@ -74166,13 +65028,13 @@ Functionb84b3: ; b84b3 ld de, KrisFishingGFX .asm_b84c7 - ld hl, $8020 + ld hl, VTiles0 tile $02 call Functionb84e3 - ld hl, $8060 + ld hl, VTiles0 tile $06 call Functionb84e3 - ld hl, $80a0 + ld hl, VTiles0 tile $0a call Functionb84e3 - ld hl, $9000 - $40 + ld hl, VTiles2 tile $00 - $40 call Functionb84e3 pop af @@ -74202,14 +65064,14 @@ INCBIN "gfx/unknown/0b8582.2bpp" INCLUDE "engine/radio.asm" -Functionb9229: ; b9229 +ReadPartyMonMail: ; b9229 ld a, [CurPartyMon] ld hl, s0_a600 - ld bc, $002f + ld bc, PartyMon1StatsEnd - PartyMon1Item call AddNTimes ld d, h ld e, l -Functionb9237: ; b9237 +ReadAnyMail: ; b9237 push de call WhiteBGMap call ClearSprites @@ -74263,11 +65125,11 @@ Functionb929a: ; b929a ret .asm_b92a8 - ld a, [wcf63] + ld a, [wJumptableIndex] push af callab Function845d4 pop af - ld [wcf63], a + ld [wJumptableIndex], a jr .asm_b929a ; b92b8 @@ -74335,7 +65197,7 @@ Unknown_b92f8: ; b92f8 Functionb9317: ; b9317 push bc - ld hl, $9310 + ld hl, VTiles2 tile $31 ld de, Unknown_b9d46 ld c, $40 call Functionb9915 @@ -74349,7 +65211,7 @@ Functionb9317: ; b9317 Functionb9335: ; b9335 push bc - ld hl, $9310 + ld hl, VTiles2 tile $31 ld de, Unknown_b9dc6 ld c, $40 call Functionb9915 @@ -74419,7 +65281,7 @@ Functionb9351: ; b9351 Functionb93d2: ; b93d2 push bc - ld hl, $9310 + ld hl, VTiles2 tile $31 ld de, Unknown_b997e ld c, $8 call Functionb9915 @@ -74438,7 +65300,7 @@ Functionb93d2: ; b93d2 ld de, MailPikaGFX ld c, $30 call Functionb991e - ld hl, $93d0 + ld hl, VTiles2 tile $3d ld de, Unknown_b9c9e ld c, $20 call Functionb990c @@ -74468,7 +65330,7 @@ Functionb93d2: ; b93d2 Functionb944b: ; b944b push bc - ld hl, $9310 + ld hl, VTiles2 tile $31 ld de, Unknown_b9e26 ld c, $28 call Functionb9915 @@ -74530,7 +65392,7 @@ Functionb9491: ; b9491 Functionb94d6: ; b94d6 push bc - ld hl, $9310 + ld hl, VTiles2 tile $31 ld bc, $0028 call Functionb97f8 ld de, Unknown_b9c96 @@ -74606,7 +65468,7 @@ Functionb94d6: ; b94d6 Functionb9582: ; b9582 push bc - ld hl, $9310 + ld hl, VTiles2 tile $31 ld de, Unknown_b997e ld c, $8 call Functionb9915 @@ -74693,7 +65555,7 @@ Functionb9636: ; b9636 Functionb963e: ; b963e push bc - ld hl, $9310 + ld hl, VTiles2 tile $31 ld de, Unknown_b9d86 ld c, $40 call Functionb990c @@ -74747,14 +65609,14 @@ Functionb963e: ; b963e Functionb96ca: ; b96ca push bc - ld hl, $9310 + ld hl, VTiles2 tile $31 ld de, Unknown_b9e4e ld c, $28 call Functionb9915 ld de, Unknown_b995e ld c, $8 call Functionb9915 - ld hl, $93d0 + ld hl, VTiles2 tile $3d ld de, Unknown_b9bfe ld c, $20 call Functionb990c @@ -74777,7 +65639,7 @@ Functionb96ca: ; b96ca Functionb9710: ; b9710 push bc - ld hl, $9310 + ld hl, VTiles2 tile $31 ld de, Unknown_b9e06 ld c, $20 call Functionb9915 @@ -74819,7 +65681,7 @@ Functionb9710: ; b9710 Functionb9776: ; b9776 push bc - ld hl, $9310 + ld hl, VTiles2 tile $31 ld bc, $0028 call Functionb97f8 ld de, Unknown_b992e @@ -75376,7 +66238,7 @@ DisplayCaughtContestMonStats: ; cc000 call WhiteBGMap call ClearTileMap call ClearSprites - call Functione58 + call LoadFontsBattleExtra ld hl, Options ld a, [hl] @@ -75688,20 +66550,20 @@ _CardFlip: ; e00ee (38:40ee) call Functione51 call Functione5f ld hl, LZ_e0d16 - ld de, $9000 + ld de, VTiles2 tile $00 call Decompress ld hl, LZ_e0ea8 - ld de, $93e0 + ld de, VTiles2 tile $3e call Decompress ld hl, LZ_e0cdb - ld de, $8000 + ld de, VTiles0 tile $00 call Decompress ld hl, GFX_e0cf6 - ld de, $8ef0 + ld de, VTiles1 tile $6f ld bc, $10 call CopyBytes ld hl, GFX_e0d06 - ld de, $8f50 + ld de, VTiles1 tile $75 ld bc, $10 call CopyBytes call Functione0521 @@ -75715,14 +66577,14 @@ _CardFlip: ; e00ee (38:40ee) call DmgToCgbObjPals call DelayFrame xor a - ld [wcf63], a + ld [wJumptableIndex], a ld a, $2 ld [wcf64], a ld [wcf65], a ld de, MUSIC_GAME_CORNER call PlayMusic .MasterLoop - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .leavethegame call .CardFlip @@ -75738,7 +66600,7 @@ _CardFlip: ; e00ee (38:40ee) ret .CardFlip: ; e0191 (38:4191) - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, .Jumptable @@ -75763,7 +66625,7 @@ endr ; e01b0 .Increment: ; e01b0 - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret ; e01b5 @@ -75779,7 +66641,7 @@ endr .SaidNo ld a, $7 - ld [wcf63], a + ld [wJumptableIndex], a ret ; e01cd @@ -75803,7 +66665,7 @@ endr ld hl, .NotEnoughCoinsText call Functione0489 ld a, $7 - ld [wcf63], a + ld [wJumptableIndex], a ret .deduct @@ -75860,9 +66722,9 @@ endr xor a ld [wcf66], a .loop - call Functiona57 - ld a, [$ffa9] - and $1 + call JoyTextDelay + ld a, [hJoyLast] + and A_BUTTON jr nz, .next ld de, SFX_KINESIS call PlaySFX @@ -75914,9 +66776,9 @@ endr ld hl, .PlaceYourBetText call Functione0489 .betloop - call Functiona57 - ld a, [$ffa9] - and $1 + call JoyTextDelay + ld a, [hJoyLast] + and A_BUTTON jr nz, .betdone call Functione089c call Functione0960 @@ -76000,7 +66862,7 @@ endr .LoopAround ld a, $1 - ld [wcf63], a + ld [wJumptableIndex], a ret ; e0356 @@ -76017,7 +66879,7 @@ endr ; 0xe0360 .Quit: ; e0360 - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret ; e0366 @@ -76203,7 +67065,7 @@ Functione04c1: ; e04c1 (38:44c1) xor a ld [hBGMapMode], a ; $ff00+$d4 hlcoord 0, 0 - ld bc, $168 + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH ld a, $29 call ByteFill hlcoord 9, 0 @@ -76278,7 +67140,7 @@ Functione0509: ; e0509 ; e0521 Functione0521: ; e0521 (38:4521) - ld de, $8f60 + ld de, VTiles1 tile $76 ld hl, $8f62 ld bc, $9e call CopyBytes @@ -76894,7 +67756,7 @@ Unknown_e0853: ; e0853 ; e089c Functione089c: ; e089c - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and D_LEFT jp nz, Functione08b8 @@ -77270,7 +68132,7 @@ Functione0c37: ; e0c37 (38:4c37) and a ret z hlcoord 0, 0, AttrMap - ld bc, $168 + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH xor a call ByteFill hlcoord 12, 1, AttrMap @@ -77384,10 +68246,10 @@ Unknown_e110c: ; e110c ; e1190 Functione1190: ; e1190 - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a call WhiteBGMap call ClearTileMap call ClearSprites @@ -77399,11 +68261,11 @@ Functione1190: ; e1190 xor a call ByteFill ld hl, GFX_e17c5 - ld de, $8e00 + ld de, VTiles1 tile $60 ld bc, $0040 call CopyBytes ld hl, LZ_e1805 - ld de, $8ed0 + ld de, VTiles1 tile $6d call Decompress call Functione17a3 hlcoord 0, 0 @@ -77421,7 +68283,7 @@ Functione1190: ; e1190 ld [hSCY], a ld [hSCX], a ld [rWY], a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [wcf65], a ld [wcf66], a @@ -77438,8 +68300,8 @@ Functione1190: ; e1190 ld [wd0ec], a call DelayFrame .asm_e1217 - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_e123d call Functione12ca @@ -77463,7 +68325,7 @@ Functione1190: ; e1190 .asm_e123d pop af - ld [$ffaa], a + ld [hInMenu], a call WhiteBGMap call ClearTileMap call ClearSprites @@ -77547,7 +68409,7 @@ Functione128d: ; e128d ; e12ca Functione12ca: ; e12ca - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_e12d9 @@ -77566,23 +68428,23 @@ Jumptable_e12d9: ; e12d9 Functione12db: ; e12db ld a, [hJoyPressed] - and $8 + and START jp nz, Functione13de ld a, [hJoyPressed] and A_BUTTON jp nz, Functione1376 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] - and $40 + and D_UP jr nz, .asm_e1301 ld a, [hl] - and $80 + and D_DOWN jr nz, .asm_e130d ld a, [hl] - and $20 + and D_LEFT jr nz, .asm_e1325 ld a, [hl] - and $10 + and D_RIGHT jr nz, .asm_e1345 ret @@ -77721,7 +68583,7 @@ Functione1376: ; e1376 ld [wd0ec], a Functione13de: ; e13de - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret @@ -78250,10 +69112,10 @@ Functione1e67: ; e1e67 (38:5e67) call GetSGBLayout callab Function8cf53 ld hl, LZ_e2221 - ld de, $9000 + ld de, VTiles2 tile $00 call Decompress ld hl, Unknown_e00ed - ld de, $8000 + ld de, VTiles0 tile $00 ld bc, $40 ld a, BANK(Unknown_e00ed) call FarCopyBytes @@ -78262,14 +69124,14 @@ Functione1e67: ; e1e67 (38:5e67) ld [hli], a ld [hl], $0 hlcoord 0, 0 - ld bc, $168 + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH xor a call ByteFill xor a ld [hSCY], a ; $ff00+$d0 ld [hSCX], a ; $ff00+$cf ld [rWY], a ; $ff00+$4a - ld [wcf63], a + ld [wJumptableIndex], a ld a, $1 ld [hBGMapMode], a ; $ff00+$d4 ld a, $e3 @@ -78281,7 +69143,7 @@ Functione1e67: ; e1e67 (38:5e67) ret Functione1ebb: ; e1ebb (38:5ebb) - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_e1ed0 call Functione1ed2 @@ -78294,7 +69156,7 @@ Functione1ebb: ; e1ebb (38:5ebb) ret Functione1ed2: ; e1ed2 (38:5ed2) - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_e1ee1 @@ -78321,7 +69183,7 @@ Jumptable_e1ee1: ; e1ee1 Functione1ef3: ; e1ef3 call Functione2152 - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret ; e1efb @@ -78329,13 +69191,13 @@ Functione1ef3: ; e1ef3 Functione1efb: ; e1efb call Functione00ed jr nc, .asm_e1f06 - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret .asm_e1f06 call Functione209d - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] xor a ld [wc708], a @@ -78364,7 +69226,7 @@ Functione1f1c: ; e1f1c call Function3b2a ld a, $5 ld [wc702], a - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret ; e1f42 @@ -78379,14 +69241,14 @@ Functione1f42: ; e1f42 and a jr nz, .asm_e1f58 ld a, $7 - ld [wcf63], a + ld [wJumptableIndex], a ret .asm_e1f58 dec [hl] xor a ld [wcf64], a - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] Functione1f61: ; e1f61 @@ -78409,7 +69271,7 @@ Functione1f61: ; e1f61 call Functione2128 xor a ld [wcf64], a - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret ; e1f8b @@ -78437,7 +69299,7 @@ Functione1f8b: ; e1f8b call Functione2128 ld a, $40 ld [wc708], a - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] Functione1fba: ; e1fba @@ -78451,7 +69313,7 @@ Functione1fba: ; e1fba .asm_e1fc3 call Functione2010 ld a, $3 - ld [wcf63], a + ld [wJumptableIndex], a ret ; e1fcc @@ -78485,19 +69347,19 @@ Functione1fcc: ; e1fcc .asm_e1ff9 call Functiona80 - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] Functione2000: ; e2000 call Functione00ed jr nc, .asm_e200b - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret .asm_e200b xor a - ld [wcf63], a + ld [wJumptableIndex], a ret ; e2010 @@ -78756,10 +69618,10 @@ Functione2183: ; e2183 ; e21a1 Functione21a1: ; e21a1 (38:61a1) - ld a, [wcf63] + ld a, [wJumptableIndex] cp $7 jr nc, .asm_e21c8 - call Functiona57 + call JoyTextDelay ld hl, hJoypadPressed ; $ffa3 ld a, [hl] and A_BUTTON @@ -78855,10 +69717,10 @@ Functione2391: ; e2391 (38:6391) push af xor a ld [VramState], a - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a xor a ld [$ffde], a call Functione2963 @@ -78866,8 +69728,8 @@ Functione2391: ; e2391 (38:6391) ld [wcb2e], a call DelayFrame .asm_e23b4 - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_e23c6 call Functione23d5 @@ -78876,7 +69738,7 @@ Functione2391: ; e2391 (38:6391) .asm_e23c6 call ClearSprites pop af - ld [$ffaa], a + ld [hInMenu], a pop af ld [VramState], a pop af @@ -78884,7 +69746,7 @@ Functione2391: ; e2391 (38:6391) ret Functione23d5: ; e23d5 (38:63d5) - ld a, [wcf63] + ld a, [wJumptableIndex] ld hl, Jumptable_e23df call Functione33df jp [hl] @@ -78946,18 +69808,18 @@ Functione241a: ; e241a (38:641a) cp $ff jr z, .asm_e2457 ld a, $2 - ld [wcf63], a + ld [wJumptableIndex], a ret ; e2452 (38:6452) .asm_e2452 - ld hl, wcf63 + ld hl, wJumptableIndex dec [hl] ret .asm_e2457 ld a, $4 - ld [wcf63], a + ld [wJumptableIndex], a ret Functione245d: ; e245d (38:645d) @@ -79009,7 +69871,7 @@ BillsPCDepositFuncDeposit: ; e24a9 (38:64a9) call Functione307c jr c, .asm_e24c1 ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a xor a ld [wcb2b], a ld [wcb2a], a @@ -79056,7 +69918,7 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0) callba Functione039 call Functione3180 ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a xor a ld [wcb2b], a ld [wcb2a], a @@ -79071,7 +69933,7 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0) BillsPCDepositFuncCancel: ; e2537 (38:6537) ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret ; e253d (38:653d) @@ -79117,10 +69979,10 @@ Functione2583: ; e2583 (38:6583) push af xor a ld [VramState], a - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a xor a ld [$ffde], a call Functione2963 @@ -79128,8 +69990,8 @@ Functione2583: ; e2583 (38:6583) ld [wcb2e], a call DelayFrame .asm_e25a7 - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_e25b9 call Functione25c8 @@ -79138,7 +70000,7 @@ Functione2583: ; e2583 (38:6583) .asm_e25b9 call ClearSprites pop af - ld [$ffaa], a + ld [hInMenu], a pop af ld [VramState], a pop af @@ -79146,7 +70008,7 @@ Functione2583: ; e2583 (38:6583) ret Functione25c8: ; e25c8 (38:65c8) - ld a, [wcf63] + ld a, [wJumptableIndex] ld hl, .jumptable call Functione33df jp [hl] @@ -79210,18 +70072,18 @@ Functione2612: ; e2612 (38:6612) cp $ff jr z, .asm_e264f ld a, $2 - ld [wcf63], a + ld [wJumptableIndex], a ret ; e264a (38:664a) .asm_e264a - ld hl, wcf63 + ld hl, wJumptableIndex dec [hl] ret .asm_e264f ld a, $4 - ld [wcf63], a + ld [wJumptableIndex], a ret ; e2655 @@ -79274,7 +70136,7 @@ endr call TryWithdrawPokemon jr c, .FailedWithdraw ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a xor a ld [wcb2b], a ld [wcb2a], a @@ -79319,7 +70181,7 @@ endr callba Functione039 call Functione3180 ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a xor a ld [wcb2b], a ld [wcb2a], a @@ -79334,7 +70196,7 @@ endr .cancel: ; e272b (38:672b) ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret ; e2731 (38:6731) @@ -79364,10 +70226,10 @@ Functione2759: ; e2759 push af xor a ld [VramState], a - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a xor a ld [$ffde], a call Functione2963 @@ -79377,8 +70239,8 @@ Functione2759: ; e2759 ld [wcb2e], a call DelayFrame .asm_e2781 - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_e2793 call Functione27a2 @@ -79388,7 +70250,7 @@ Functione2759: ; e2759 .asm_e2793 call ClearSprites pop af - ld [$ffaa], a + ld [hInMenu], a pop af ld [VramState], a pop af @@ -79397,7 +70259,7 @@ Functione2759: ; e2759 ; e27a2 Functione27a2: ; e27a2 - ld a, [wcf63] + ld a, [wJumptableIndex] ld hl, Jumptable_e27ac call Functione33df jp [hl] @@ -79463,7 +70325,7 @@ Functione27eb: ; e27eb ld [wcb2b], a ld [wcb2a], a ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret .asm_e2823 @@ -79473,16 +70335,16 @@ Functione27eb: ; e27eb cp $ff jr z, .asm_e2837 ld a, $2 - ld [wcf63], a + ld [wJumptableIndex], a ret - ld hl, wcf63 + ld hl, wJumptableIndex dec [hl] ret .asm_e2837 ld a, $6 - ld [wcf63], a + ld [wJumptableIndex], a ret ; e283d @@ -79540,7 +70402,7 @@ Functione2887: ; e2887 ld a, [wcb2e] ld [wcb31], a ld a, $4 - ld [wcf63], a + ld [wJumptableIndex], a ret ; e28a5 @@ -79558,7 +70420,7 @@ Functione28a5: ; e28a5 Functione28bd: ; e28bd ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret ; e28c3 @@ -79622,7 +70484,7 @@ Functione2903: ; e2903 ld [wcb2b], a ld [wcb2a], a ld a, $4 - ld [wcf63], a + ld [wJumptableIndex], a ret .asm_e2938 @@ -79630,11 +70492,11 @@ Functione2903: ; e2903 jr c, .asm_e2946 call Functione31e7 ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret .asm_e2946 - ld hl, wcf63 + ld hl, wJumptableIndex dec [hl] ret @@ -79646,7 +70508,7 @@ Functione2903: ; e2903 ld a, [wcb31] ld [wcb2e], a ld a, $0 - ld [wcf63], a + ld [wJumptableIndex], a ret ; e2963 @@ -79660,7 +70522,7 @@ Functione2963: ; e2963 (38:6963) xor a call ByteFill xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [wcf65], a ld [wcf66], a @@ -79669,12 +70531,12 @@ Functione2963: ; e2963 (38:6963) ret Functione298d: ; e298d (38:698d) - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret Functione2992: ; e2992 (38:6992) - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret @@ -79698,7 +70560,7 @@ Functione2998: ; e2998 (38:6998) jp Functione2a65 Functione29b5: ; e29b5 (38:69b5) - ld hl, $ffa9 + ld hl, hJoyLast ld a, [wcb2d] ld d, a ld a, [wcb2c] @@ -79716,7 +70578,7 @@ Functione29b5: ; e29b5 (38:69b5) ; e29d0 (38:69d0) Functione29d0: ; e29d0 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [wcb2d] ld d, a ld a, [wcb2c] @@ -79740,7 +70602,7 @@ Functione29d0: ; e29d0 jr Functione2a65 Functione29f4: ; e29f4 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [wcb2d] ld d, a ld a, [wcb2c] @@ -79950,7 +70812,7 @@ PCMonInfo: ; e2ac6 (38:6ac6) ld hl, TempMonDVs predef GetUnownLetter call GetBaseData - ld de, $9000 + ld de, VTiles2 tile $00 predef GetFrontpic xor a ld [wcb32], a @@ -80389,7 +71251,7 @@ Functione2e01: ; e2e01 (38:6e01) .asm_e2e0b ld hl, Unknown_e2e2b ld de, Sprites -.asm_e2e11 +.done1 ld a, [hl] cp $ff ret z @@ -80409,7 +71271,7 @@ Functione2e01: ; e2e01 (38:6e01) ld a, [hli] ld [de], a inc de - jr .asm_e2e11 + jr .done1 ; e2e2b (38:6e2b) Unknown_e2e2b: ; e2e2b @@ -81109,11 +71971,11 @@ Unknown_e33a6: ; e33a6 dbw BANK(sBox7), sBox7 dbw BANK(sBox8), sBox8 dbw BANK(sBox9), sBox9 - dbw BANK(sBox10), sBox10 - dbw BANK(sBox11), sBox11 - dbw BANK(sBox12), sBox12 - dbw BANK(sBox13), sBox13 - dbw BANK(sBox14), sBox14 + dba sBox10 + dba sBox11 + dba sBox12 + dba sBox13 + dba sBox14 ; e33d0 Functione33d0: ; e33d0 (38:73d0) @@ -81138,18 +72000,18 @@ endr Functione33e8: ; e33e8 (38:73e8) call DisableLCD - ld hl, $9000 + ld hl, VTiles2 tile $00 ld bc, $310 xor a call ByteFill call Functione51 - call Functione58 + call LoadFontsBattleExtra ld hl, PCMailGFX - ld de, $95c0 + ld de, VTiles2 tile $5c ld bc, $40 call CopyBytes ld hl, PCSelectLZ - ld de, $8000 + ld de, VTiles0 tile $00 call Decompress ld a, 6 call SkipMusic @@ -81182,26 +72044,26 @@ PCString_NoReleasingEGGS: db "No releasing EGGS!@" Functione35aa: ; e35aa (38:75aa) call Function1d6e call Functione35e2 -.asm_e35b0 +.loop xor a ld [hBGMapMode], a ; $ff00+$d4 call Functione36cf call Functione379c - ld hl, MenuDataHeader_0xe35f1 + ld hl, Functione35aa_menudataheader call CopyMenuDataHeader xor a ld [wd0e4], a hlcoord 0, 4 - ld bc, $809 + lb bc, 8, 9 call TextBox call Function350c ld a, [wcf73] cp $2 - jr z, .asm_e35de + jr z, .done call Functione37af call Functione36f9 - jr .asm_e35b0 -.asm_e35de + jr .loop +.done call WriteBackup ret @@ -81209,37 +72071,37 @@ Functione35e2: ; e35e2 (38:75e2) xor a ld [hBGMapMode], a ; $ff00+$d4 hlcoord 0, 0 - ld bc, $168 - ld a, $7f + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + ld a, " " call ByteFill ret ; e35f1 (38:75f1) -MenuDataHeader_0xe35f1: ; 0xe35f1 +Functione35aa_menudataheader: ; 0xe35f1 db $40 ; flags db 05, 01 ; start coords db 12, 09 ; end coords - dw MenuData2_0xe35f9 + dw .menudata2 db 1 ; default option ; 0xe35f9 -MenuData2_0xe35f9: ; 0xe35f9 +.menudata2: ; 0xe35f9 db $22 ; flags db 4, 0 db 1 - dbw BANK(Unknown_e3609), Unknown_e3609 - dbw BANK(Functione3619), Functione3619 - dbw BANK(NULL), NULL - dbw BANK(Functione3632), Functione3632 + dba .boxes + dba .boxnames + dba NULL + dba Functione3632 ; e3609 -Unknown_e3609: ; e3609 +.boxes: ; e3609 db 14 db 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 db -1 ; e3619 -Functione3619: ; e3619 +.boxnames: ; e3619 push de ld a, [MenuSelection] dec a @@ -81260,15 +72122,15 @@ Functione3626: ; e3626 (38:7626) Functione3632: ; e3632 hlcoord 11, 7 - ld bc, $0507 + lb bc, 5, 7 call TextBox ld a, [MenuSelection] - cp $ff + cp -1 ret z hlcoord 12, 9 ld de, String_e3663 call PlaceString - call Functione366c + call GetBoxCount ld [wd265], a hlcoord 13, 11 ld de, wd265 @@ -81285,21 +72147,21 @@ String_e3663: ; e3663 String_e3668: ; e3668 db "/" - db "0" + MONS_PER_BOX / 10 - db "0" + MONS_PER_BOX % 10 + db "0" + MONS_PER_BOX / 10 ; "2" + db "0" + MONS_PER_BOX % 10 ; "0" db "@" ; e366c -Functione366c: ; e366c (38:766c) +GetBoxCount: ; e366c (38:766c) ld a, [wCurBox] ld c, a ld a, [MenuSelection] dec a cp c - jr z, .asm_e3697 + jr z, .activebox ld c, a ld b, 0 - ld hl, Unknown_e36a5 + ld hl, .boxbanks rept 3 add hl, bc endr @@ -81312,15 +72174,17 @@ endr ld a, [hl] call CloseSRAM ld c, a - ld a, [wd4b4] + ld a, [wSavedAtLeastOnce] and a - jr z, .asm_e3695 + jr z, .newfile ld a, c ret -.asm_e3695 + +.newfile xor a ret -.asm_e3697 + +.activebox ld a, BANK(sBoxCount) ld b, a call GetSRAMBank @@ -81330,7 +72194,7 @@ endr ret ; e36a5 (38:76a5) -Unknown_e36a5: ; e36a5 +.boxbanks: ; e36a5 dbw BANK(sBox1), sBox1 dbw BANK(sBox2), sBox2 dbw BANK(sBox3), sBox3 @@ -81340,11 +72204,11 @@ Unknown_e36a5: ; e36a5 dbw BANK(sBox7), sBox7 dbw BANK(sBox8), sBox8 dbw BANK(sBox9), sBox9 - dbw BANK(sBox10), sBox10 - dbw BANK(sBox11), sBox11 - dbw BANK(sBox12), sBox12 - dbw BANK(sBox13), sBox13 - dbw BANK(sBox14), sBox14 + dba sBox10 + dba sBox11 + dba sBox12 + dba sBox13 + dba sBox14 ; e36cf Functione36cf: ; e36cf (38:76cf) @@ -81384,7 +72248,7 @@ Functione36f9: ; e36f9 (38:76f9) ret .asm_e3717 - call Functione366c + call GetBoxCount and a jr z, .asm_e372f ld e, l @@ -81418,7 +72282,7 @@ Functione36f9: ; e36f9 (38:76f9) callba Function116c1 call ClearTileMap call Functione51 - call Functione58 + call LoadFontsBattleExtra ld a, [MenuSelection] dec a call Functione3626 @@ -81507,7 +72371,7 @@ INCBIN "gfx/misc/copyright.2bpp" ; e41d0 _OptionsMenu: ; e41d0 - ld hl, $ffaa + ld hl, hInMenu ld a, [hl] push af ld [hl], $1 @@ -81520,21 +72384,21 @@ _OptionsMenu: ; e41d0 ld de, StringOptions call PlaceString xor a - ld [wcf63], a + ld [wJumptableIndex], a ld c, $6 ;number of items on the menu minus 1 (for cancel) .asm_e41f3 ;this next will display the settings of each option when the menu is opened push bc xor a - ld [$ffa9], a + ld [hJoyLast], a call GetOptionPointer pop bc - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] dec c jr nz, .asm_e41f3 call Functione4512 xor a - ld [wcf63], a + ld [wJumptableIndex], a inc a ld [hBGMapMode], a call WaitBGMap @@ -81542,9 +72406,9 @@ _OptionsMenu: ; e41d0 call GetSGBLayout call Function32f9 .asm_e4217 - call Functiona57 + call JoyTextDelay ld a, [hJoyPressed] - and $a + and START | B_BUTTON jr nz, .ExitOptions call OptionsControl jr c, .asm_e422a @@ -81562,7 +72426,7 @@ _OptionsMenu: ; e41d0 call PlaySFX call WaitSFX pop af - ld [$ffaa], a + ld [hInMenu], a ret ; e4241 @@ -81586,7 +72450,7 @@ StringOptions: ; e4241 GetOptionPointer: ; e42d6 - ld a, [wcf63] ;load the cursor position to a + ld a, [wJumptableIndex] ;load the cursor position to a ld e, a ;copy it to de ld d, 0 ld hl, .Pointers @@ -82026,11 +72890,11 @@ Options_Cancel: ; e4520 ; e452a OptionsControl: ; e452a - ld hl, wcf63 - ld a, [$ffa9] - cp $80 + ld hl, wJumptableIndex + ld a, [hJoyLast] + cp D_DOWN jr z, .DownPressed - cp $40 + cp D_UP jr z, .UpPressed and a ret @@ -82083,7 +72947,7 @@ Functione455c: ; e455c jr nz, .asm_e4564 hlcoord 1, 2 ld bc, $0028 - ld a, [wcf63] + ld a, [wJumptableIndex] call AddNTimes ld [hl], $ed ret @@ -82095,8 +72959,8 @@ Functione4579: ; e4579 call PlayMusic call WhiteBGMap call ClearTileMap - ld a, $98 - ld [$ffd7], a + ld a, VBGMap0 / $100 + ld [hBGMapAddress + 1], a xor a ld [hBGMapAddress], a ld [hJoyDown], a @@ -82118,11 +72982,11 @@ Functione4579: ; e4579 callba GBCOnlyScreen call Functione45e8 .asm_e45c0 - call Functiona57 - ld a, [$ffa9] - and $f + call JoyTextDelay + ld a, [hJoyLast] + and BUTTONS jr nz, .asm_e45de - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_e45e3 call Functione4670 @@ -82178,7 +73042,7 @@ Functione45e8: ; e45e8 add hl, bc ld [hl], $30 xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [wcf65], a ld [hSCX], a @@ -82202,7 +73066,7 @@ Functione465e: ; e465e ; e4670 Functione4670: ; e4670 - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_e467f @@ -82223,7 +73087,7 @@ Jumptable_e467f: ; e467f ; e4687 Functione4687: ; e4687 - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret ; e468c @@ -82292,7 +73156,7 @@ Functione46dd: ; e46dd ret .asm_e46e7 - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret ; e46ed @@ -82458,19 +73322,19 @@ INCBIN "gfx/splash/logo.1bpp" CrystalIntro: ; e48ac ld a, [rSVBK] push af - ld a, $5 + ld a, 5 ld [rSVBK], a - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, [hVBlank] push af call Functione4901 .loop: ; e48bc - call Functiona57 - ld a, [$ffa9] - and $f + call JoyTextDelay + ld a, [hJoyLast] + and BUTTONS jr nz, .ShutOffMusic - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .done call IntroSceneJumper @@ -82496,7 +73360,7 @@ CrystalIntro: ; e48ac pop af ld [hVBlank], a pop af - ld [$ffaa], a + ld [hInMenu], a pop af ld [rSVBK], a ret @@ -82506,15 +73370,15 @@ Functione4901: ; e4901 xor a ld [hVBlank], a ld a, $1 - ld [$ffaa], a + ld [hInMenu], a xor a ld [$ffde], a - ld [wcf63], a + ld [wJumptableIndex], a ret ; e490f IntroSceneJumper: ; e490f - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, IntroScenes @@ -82560,7 +73424,7 @@ IntroScenes: ; e491e (39:491e) NextIntroScene: ; e4956 (39:4956) - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret @@ -82574,18 +73438,18 @@ IntroScene1: ; e495b (39:495b) ld a, $1 ld [rVBK], a ; $ff00+$4f ld hl, IntroTilemap001 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, $0 ld [rVBK], a ; $ff00+$4f ld hl, IntroUnownsGFX - ld de, $9000 + ld de, VTiles2 tile $00 call Functione54c2 ld hl, IntroPulseGFX - ld de, $8000 + ld de, VTiles0 tile $00 call Functione54c2 ld hl, IntroTilemap002 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, [rSVBK] ; $ff00+$70 push af @@ -82611,32 +73475,32 @@ IntroScene1: ; e495b (39:495b) callba Function8cf53 call Functione549e xor a - ld [wcf64], a + ld [wIntroSceneFrameCounter], a ld [wcf65], a call NextIntroScene ret IntroScene2: ; e49d6 (39:49d6) ; First Unown (A) fades in, pulses, then fades out. - ld hl, wcf64 + ld hl, wIntroSceneFrameCounter ld a, [hl] inc [hl] cp $80 - jr nc, .asm_e49f9 + jr nc, .endscene cp $60 - jr nz, .asm_e49f1 + jr nz, .DontPlaySound push af ld de, $5858 call Functione51dc ld de, SFX_INTRO_UNOWN_1 call PlaySFX pop af -.asm_e49f1 +.DontPlaySound ld [wcf65], a xor a call Functione5223 ret -.asm_e49f9 +.endscene call NextIntroScene ret @@ -82650,15 +73514,15 @@ IntroScene3: ; e49fd (39:49fd) ld a, $1 ld [rVBK], a ; $ff00+$4f ld hl, IntroTilemap003 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, $0 ld [rVBK], a ; $ff00+$4f ld hl, IntroBackgroundGFX - ld de, $9000 + ld de, VTiles2 tile $00 call Functione54c2 ld hl, IntroTilemap004 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, [rSVBK] ; $ff00+$70 push af @@ -82684,20 +73548,20 @@ IntroScene3: ; e49fd (39:49fd) call Functione5516 call Functione549e xor a - ld [wcf64], a + ld [wIntroSceneFrameCounter], a call NextIntroScene ret IntroScene4: ; e4a69 (39:4a69) ; Scroll the outdoor panorama for a bit. call Functione552f - ld hl, wcf64 + ld hl, wIntroSceneFrameCounter ld a, [hl] cp $80 - jr z, .asm_e4a76 + jr z, .endscene inc [hl] ret -.asm_e4a76 +.endscene call NextIntroScene ret @@ -82712,18 +73576,18 @@ IntroScene5: ; e4a7a (39:4a7a) ld a, $1 ld [rVBK], a ; $ff00+$4f ld hl, IntroTilemap005 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, $0 ld [rVBK], a ; $ff00+$4f ld hl, IntroUnownsGFX - ld de, $9000 + ld de, VTiles2 tile $00 call Functione54c2 ld hl, IntroPulseGFX - ld de, $8000 + ld de, VTiles0 tile $00 call Functione54c2 ld hl, IntroTilemap006 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, [rSVBK] ; $ff00+$70 push af @@ -82760,39 +73624,39 @@ IntroScene6: ; e4af7 (39:4af7) ld a, [hl] inc [hl] cp $80 - jr nc, .asm_e4b3b + jr nc, .endscene cp $60 - jr z, .asm_e4b24 + jr z, .SecondUnown cp $40 - jr nc, .asm_e4b32 + jr nc, .StopUnown cp $20 - jr z, .asm_e4b0e - jr .asm_e4b1c -.asm_e4b0e + jr z, .FirstUnown + jr .NoUnown +.FirstUnown push af ld de, $3878 call Functione51dc ld de, SFX_INTRO_UNOWN_2 call PlaySFX pop af -.asm_e4b1c +.NoUnown ld [wcf65], a xor a call Functione5223 ret -.asm_e4b24 +.SecondUnown push af ld de, $7030 call Functione51dc ld de, SFX_INTRO_UNOWN_1 call PlaySFX pop af -.asm_e4b32 +.StopUnown ld [wcf65], a ld a, $1 call Functione5223 ret -.asm_e4b3b +.endscene call NextIntroScene ret @@ -82806,21 +73670,21 @@ IntroScene7: ; e4b3f (39:4b3f) ld a, $1 ld [rVBK], a ; $ff00+$4f ld hl, IntroTilemap003 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld hl, IntroPichuWooperGFX - ld de, $8000 + ld de, VTiles0 tile $00 call Functione54c2 ld a, $0 ld [rVBK], a ; $ff00+$4f ld hl, IntroSuicuneRunGFX - ld de, $8000 + ld de, VTiles0 tile $00 call Functione54de ld hl, IntroBackgroundGFX - ld de, $9000 + ld de, VTiles2 tile $00 call Functione54c2 ld hl, IntroTilemap004 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, [rSVBK] ; $ff00+$70 push af @@ -82852,14 +73716,14 @@ IntroScene7: ; e4b3f (39:4b3f) ld [wc3c0], a call Functione549e xor a - ld [wcf64], a + ld [wIntroSceneFrameCounter], a ld [wcf65], a call NextIntroScene ret IntroScene8: ; e4bd3 (39:4bd3) ; Scroll the scene, then show Suicune running across the screen. - ld hl, wcf64 + ld hl, wIntroSceneFrameCounter ld a, [hl] inc [hl] cp $40 @@ -82962,15 +73826,15 @@ IntroScene11: ; e4c86 (39:4c86) ld a, $1 ld [rVBK], a ; $ff00+$4f ld hl, IntroTilemap007 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, $0 ld [rVBK], a ; $ff00+$4f ld hl, IntroUnownsGFX - ld de, $9000 + ld de, VTiles2 tile $00 call Functione54c2 ld hl, IntroTilemap008 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, [rSVBK] ; $ff00+$70 push af @@ -82996,7 +73860,7 @@ IntroScene11: ; e4c86 (39:4c86) callba Function8cf53 call Functione549e xor a - ld [wcf64], a + ld [wIntroSceneFrameCounter], a ld [wcf65], a call NextIntroScene ret @@ -83004,7 +73868,7 @@ IntroScene11: ; e4c86 (39:4c86) IntroScene12: ; e4cfa (39:4cfa) ; Even more Unown. call Functione4d36 - ld hl, wcf64 + ld hl, wIntroSceneFrameCounter ld a, [hl] inc [hl] cp $c0 @@ -83038,20 +73902,20 @@ IntroScene12: ; e4cfa (39:4cfa) ret Functione4d36: ; e4d36 (39:4d36) - ld a, [wcf64] + ld a, [wIntroSceneFrameCounter] ld c, a - ld hl, Unknown_e4d54 -.asm_e4d3d + ld hl, .UnownSounds +.loop ld a, [hli] - cp $ff + cp -1 ret z cp c - jr z, .asm_e4d48 + jr z, .playsound rept 2 inc hl endr - jr .asm_e4d3d -.asm_e4d48 + jr .loop +.playsound ld a, [hli] ld d, [hl] ld e, a @@ -83062,7 +73926,7 @@ endr ret ; e4d54 (39:4d54) -Unknown_e4d54: ; e4d54 +.UnownSounds: ; e4d54 dbw $00, SFX_INTRO_UNOWN_3 dbw $20, SFX_INTRO_UNOWN_2 dbw $40, SFX_INTRO_UNOWN_1 @@ -83084,18 +73948,18 @@ IntroScene13: ; e4d6d (39:4d6d) ld a, $1 ld [rVBK], a ; $ff00+$4f ld hl, IntroTilemap003 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, $0 ld [rVBK], a ; $ff00+$4f ld hl, IntroSuicuneRunGFX - ld de, $8000 + ld de, VTiles0 tile $00 call Functione54de ld hl, IntroBackgroundGFX - ld de, $9000 + ld de, VTiles2 tile $00 call Functione54c2 ld hl, IntroTilemap004 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, [rSVBK] ; $ff00+$70 push af @@ -83188,22 +74052,22 @@ IntroScene15: ; e4e40 (39:4e40) ld a, $1 ld [rVBK], a ; $ff00+$4f ld hl, IntroTilemap009 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, $0 ld [rVBK], a ; $ff00+$4f ld hl, IntroSuicuneJumpGFX - ld de, $9000 + ld de, VTiles2 tile $00 call Functione54c2 ld hl, IntroUnownBackGFX - ld de, $8000 + ld de, VTiles0 tile $00 call Functione54c2 ld de, GFX_e7a5d - ld hl, $8800 + ld hl, VTiles1 tile $00 lb bc, BANK(GFX_e7a5d), 1 call Request2bpp ld hl, IntroTilemap010 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa call Functione541b ld a, [rSVBK] ; $ff00+$70 @@ -83270,15 +74134,15 @@ IntroScene17: ; e4ef5 (39:4ef5) ld a, $1 ld [rVBK], a ; $ff00+$4f ld hl, IntroTilemap011 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, $0 ld [rVBK], a ; $ff00+$4f ld hl, IntroSuicuneCloseGFX - ld de, $8800 + ld de, VTiles1 tile $00 call Functione54de ld hl, IntroTilemap012 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, [rSVBK] ; $ff00+$70 push af @@ -83336,22 +74200,22 @@ IntroScene19: ; e4f7e (39:4f7e) ld a, $1 ld [rVBK], a ; $ff00+$4f ld hl, IntroTilemap013 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, $0 ld [rVBK], a ; $ff00+$4f ld hl, IntroSuicuneBackGFX - ld de, $9000 + ld de, VTiles2 tile $00 call Functione54c2 ld hl, IntroUnownsGFX - ld de, $8800 + ld de, VTiles1 tile $00 call Functione54c2 ld de, GFX_e7a5d - ld hl, $8ff0 + ld hl, VTiles1 tile $7f lb bc, BANK(GFX_e7a5d), 1 call Request2bpp ld hl, IntroTilemap014 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa call Functione541b ld a, [rSVBK] ; $ff00+$70 @@ -83512,15 +74376,15 @@ IntroScene26: ; e50bb (39:50bb) ld a, $1 ld [rVBK], a ; $ff00+$4f ld hl, IntroTilemap015 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, $0 ld [rVBK], a ; $ff00+$4f ld hl, IntroCrystalUnownsGFX - ld de, $9000 + ld de, VTiles2 tile $00 call Functione54c2 ld hl, IntroTilemap017 - ld de, $9800 + ld de, VBGMap0 tile $00 call Functione54fa ld a, [rSVBK] ; $ff00+$70 push af @@ -83597,7 +74461,7 @@ IntroScene28: ; e5152 (39:5152) ret .done - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret @@ -83991,7 +74855,7 @@ Functione5441: ; e5441 (39:5441) Functione5451: ; e5451 (39:5451) hlcoord 0, 0 - ld bc, $168 + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH .asm_e5457 ld a, [hl] and a @@ -84730,15 +75594,15 @@ Functionfb449:: ; fb449 Functionfb48a:: ; fb48a ld de, GFX_f9214 - ld hl, $9600 + ld hl, VTiles2 tile $60 lb bc, BANK(GFX_f9214), 1 call Functionddc ld de, GFX_f8f24 - ld hl, $9620 + ld hl, VTiles2 tile $62 lb bc, BANK(GFX_f8f24), 1 call Functiondc9 ld de, FontExtra + $30 - ld hl, $9630 + ld hl, VTiles2 tile $63 lb bc, BANK(FontExtra), $16 call Functiondc9 jr Functionfb4cc @@ -84746,16 +75610,16 @@ Functionfb48a:: ; fb48a Functionfb4b0:: ; fb4b0 ld de, GFX_f9424 - ld hl, $9610 + ld hl, VTiles2 tile $61 ld b, BANK(GFX_f9424) ld c, 1 call Functiondc9 ret ; fb4be -Functionfb4be:: ; fb4be +_LoadFontsBattleExtra:: ; fb4be ld de, FontBattleExtra - ld hl, $9600 + ld hl, VTiles2 tile $60 lb bc, BANK(FontBattleExtra), $19 call Functiondc9 jr Functionfb4cc @@ -84769,10 +75633,10 @@ Functionfb4cc: ; fb4cc call AddNTimes ld d, h ld e, l - ld hl, $9790 + ld hl, VTiles2 tile $79 lb bc, BANK(Frames), 6 call Functionddc - ld hl, $97f0 + ld hl, VTiles2 tile $7f ld de, GFX_f9204 lb bc, BANK(GFX_f9204), 1 call Functionddc @@ -84781,10 +75645,10 @@ Functionfb4cc: ; fb4cc Functionfb4f2: ; fb4f2 ld de, FontBattleExtra - ld hl, $9600 + ld hl, VTiles2 tile $60 lb bc, BANK(FontBattleExtra), $c call Functiondc9 - ld hl, $9700 + ld hl, VTiles2 tile $70 ld de, FontBattleExtra + $100 lb bc, BANK(FontBattleExtra), 3 call Functiondc9 @@ -84792,46 +75656,46 @@ Functionfb4f2: ; fb4f2 Functionfb50d: ; fb50d ld de, GFX_f8ac0 - ld hl, $96c0 + ld hl, VTiles2 tile $6c lb bc, BANK(GFX_f8ac0), 4 call Functionddc ld de, GFX_f8ae0 - ld hl, $9730 + ld hl, VTiles2 tile $73 lb bc, BANK(GFX_f8ae0), 6 call Functionddc ld de, GFX_f8b10 - ld hl, $9550 + ld hl, VTiles2 tile $55 lb bc, BANK(GFX_f8b10), 9 call Functiondc9 ld de, GFX_f9214 + $90 - ld hl, $95e0 + ld hl, VTiles2 tile $5e lb bc, BANK(GFX_f9214), 2 call Functiondc9 ret ; fb53e Functionfb53e: ; fb53e - call Functionfb4be + call _LoadFontsBattleExtra ld de, GFX_f8ac0 - ld hl, $96c0 + ld hl, VTiles2 tile $6c lb bc, BANK(GFX_f8ac0), 4 call Functionddc ld de, GFX_f8ae0 - ld hl, $9780 + ld hl, VTiles2 tile $78 lb bc, BANK(GFX_f8ae0), 1 call Functionddc ld de, GFX_f8ae0 + $18 - ld hl, $9760 + ld hl, VTiles2 tile $76 lb bc, BANK(GFX_f8ae0), 2 call Functionddc ld de, GFX_f8b10 - ld hl, $9550 + ld hl, VTiles2 tile $55 lb bc, BANK(GFX_f8b10), 8 call Functiondc9 Functionfb571: ; fb571 ld de, GFX_f89b0 - ld hl, $9310 + ld hl, VTiles2 tile $31 lb bc, BANK(GFX_f89b0), $11 call Functiondc9 ret @@ -84863,8 +75727,8 @@ Functionfb57e: ; fb57e ld a, [hl] cp 101 jr nc, .asm_fb5db - ld a, [InLinkBattle] - cp $1 + ld a, [wLinkMode] + cp LINK_TIMECAPSULE jr nz, .asm_fb5d9 ld hl, OTPartySpecies ld a, [wd003] @@ -85673,7 +76537,7 @@ TRADE_AFTER EQU 4 NPCTrade:: ; fcba8 ld a, e - ld [wcf63], a + ld [wJumptableIndex], a call Functionfcc59 ld b, CHECK_FLAG call TradeFlagAction @@ -85727,8 +76591,8 @@ NPCTrade:: ; fcba8 ; fcc07 Functionfcc07: ; fcc07 - call Function2ed3 - ld a, [wcf63] + call DisableSpriteUpdates + ld a, [wJumptableIndex] push af ld a, [wcf64] push af @@ -85736,7 +76600,7 @@ Functionfcc07: ; fcc07 pop af ld [wcf64], a pop af - ld [wcf63], a + ld [wJumptableIndex], a call Function2b74 ret ; fcc23 @@ -85772,7 +76636,7 @@ CheckTradeGender: ; fcc23 TradeFlagAction: ; fcc4a ld hl, wd960 - ld a, [wcf63] + ld a, [wJumptableIndex] ld c, a predef FlagPredef ld a, c @@ -85954,7 +76818,7 @@ Functionfcc63: ; fcc63 GetTradeAttribute: ; 0xfcdc2 ld d, 0 push de - ld a, [wcf63] + ld a, [wJumptableIndex] and $f swap a ld e, a @@ -86273,8 +77137,8 @@ TradeAfterText3: ; 0xfcfe7 ; 0xfcfec -Functionfcfec:: ; fcfec - ld a, [wd45c] +MomTriesToBuySomething:: ; fcfec + ld a, [wMapReentryScriptQueueFlag] and a ret nz call GetMapHeaderPhoneServiceNybble @@ -86288,14 +77152,14 @@ Functionfcfec:: ; fcfec ret nc ld b, BANK(UnknownScript_0xfd00f) ld de, UnknownScript_0xfd00f - callba Function97c4f + callba LoadScriptBDE scf ret ; fd00f UnknownScript_0xfd00f: ; 0xfd00f callasm Functionfd017 - farjump UnknownScript_0x90241 + farjump Script_ReceivePhoneCall ; 0xfd017 Functionfd017: ; fd017 @@ -86572,7 +77436,7 @@ Function104000:: ; 104000 Function104006: ; 104006 decoord 0, 0, AttrMap - ld hl, w6_d000 + $400 + ld hl, w6_d400 call Function104263 decoord 0, 0 ld hl, w6_d000 @@ -86583,7 +77447,7 @@ Function104006: ; 104006 call Function10419d ld a, $1 ld [rVBK], a - ld hl, w6_d000 + $400 + ld hl, w6_d400 call Function10419d ret ; 10402d @@ -86611,11 +77475,11 @@ Function104047: ; 104047 Function10404d: ; 10404d decoord 0, 0, AttrMap - ld hl, $d400 + ld hl, w6_d400 call Function104263 ld a, $1 ld [rVBK], a ; $ff00+$4f - ld hl, $d400 + ld hl, w6_d400 call Function10419d ret ; 104061 @@ -86627,7 +77491,7 @@ Function104061:: ; 104061 Function104067: ; 104067 decoord 0, 0, AttrMap - ld hl, $d400 + ld hl, w6_d400 call Function104263 decoord 0, 0 ld hl, w6_d000 @@ -86638,7 +77502,7 @@ Function104067: ; 104067 push af ld a, $1 ld [rVBK], a ; $ff00+$4f - ld hl, $d400 + ld hl, w6_d400 call Function1041ad ld a, $0 ld [rVBK], a ; $ff00+$4f @@ -86657,7 +77521,7 @@ Function104099: ; 104099 Function1040a2: ; 1040a2 decoord 0, 0, AttrMap - ld hl, $d400 + ld hl, w6_d400 call Function104263 decoord 0, 0 ld hl, w6_d000 @@ -86668,7 +77532,7 @@ Function1040a2: ; 1040a2 push af ld a, $1 ld [rVBK], a - ld hl, $d400 + ld hl, w6_d400 call Function1041c1 ld a, $0 ld [rVBK], a @@ -86691,7 +77555,7 @@ Function1040da: ; 1040da ld a, $3 ld [rSVBK], a ld de, $d800 - ld a, [$ffd7] + ld a, [hBGMapAddress + 1] ld [rHDMA1], a ld a, [hBGMapAddress] ld [rHDMA2], a @@ -86727,7 +77591,7 @@ Function104110:: ; 104110 Function104116: ; 104116 decoord 0, 0, AttrMap - ld hl, $d400 + ld hl, w6_d400 call Function104263 decoord 0, 0 ld hl, w6_d000 @@ -86738,7 +77602,7 @@ Function104116: ; 104116 push af ld a, $1 ld [rVBK], a ; $ff00+$4f - ld hl, $d400 + ld hl, w6_d400 call Function1041b7 ld a, $0 ld [rVBK], a ; $ff00+$4f @@ -86757,7 +77621,7 @@ Function104148: ; 104148 (41:4148) Function10414e: ; 10414e decoord 0, 0, AttrMap - ld hl, $d400 + ld hl, w6_d400 call Function104263 ld c, $ff decoord 0, 0 @@ -86765,7 +77629,7 @@ Function10414e: ; 10414e call Function104265 ld a, $1 ld [rVBK], a - ld hl, $d400 + ld hl, w6_d400 call Function1041ad ld a, $0 ld [rVBK], a @@ -86784,7 +77648,7 @@ Function104177: ; 104177 ld [$ffde], a ld a, [rSVBK] push af - ld a, $6 + ld a, 6 ld [rSVBK], a ld a, [rVBK] push af @@ -86819,7 +77683,7 @@ Function1041a4: ; 104a14 ret Function1041ad: ; 1041ad (41:41ad) - ld a, [$ffd7] + ld a, [hBGMapAddress + 1] ld d, a ld a, [hBGMapAddress] ; $ff00+$d6 ld e, a @@ -86827,7 +77691,7 @@ Function1041ad: ; 1041ad (41:41ad) jr Function104209 Function1041b7: ; 1041b7 (41:41b7) - ld a, [$ffd7] + ld a, [hBGMapAddress + 1] ld d, a ld a, [hBGMapAddress] ; $ff00+$d6 ld e, a @@ -86836,7 +77700,7 @@ Function1041b7: ; 1041b7 (41:41b7) ; 1041c1 (41:41c1) Function1041c1: ; 1041c1 - ld a, [$ffd7] + ld a, [hBGMapAddress + 1] ld d, a ld a, [hBGMapAddress] ld e, a @@ -86859,25 +77723,25 @@ Function1041c1: ; 1041c1 ld a, $7f sub c ld d, a -.asm_1041e4 +.loop1 ld a, [rLY] cp d - jr nc, .asm_1041e4 -.asm_1041e9 + jr nc, .loop1 +.loop2 ld a, [rSTAT] and $3 - jr z, .asm_1041e9 + jr z, .loop2 ld a, b ld [rHDMA5], a ld a, [rLY] inc c ld hl, rLY -.asm_1041f8 +.loop3 cp [hl] - jr z, .asm_1041f8 + jr z, .loop3 ld a, [hl] dec c - jr nz, .asm_1041f8 + jr nz, .loop3 ld hl, rHDMA5 res 7, [hl] ret @@ -86888,54 +77752,57 @@ asm_104205: jr asm_10420b -Function104209: ; 104209 +Function104209: +; LY magic ld b, $7f asm_10420b: ld a, h ld [rHDMA1], a ld a, l - and $f0 + and $f0 ; high nybble ld [rHDMA2], a ld a, d - and $1f + and $1f ; lower 5 bits ld [rHDMA3], a ld a, e - and $f0 + and $f0 ; high nybble ld [rHDMA4], a ld a, c dec c - or $80 + or $80 ; set 7, a ld e, a ld a, b sub c ld d, a -.asm_104225 +.ly_loop ld a, [rLY] cp d - jr nc, .asm_104225 + jr nc, .ly_loop + di -.asm_10422b +.rstat_loop_1 ld a, [rSTAT] and $3 - jr nz, .asm_10422b -.asm_104231 + jr nz, .rstat_loop_1 +.rstat_loop_2 ld a, [rSTAT] and $3 - jr z, .asm_104231 + jr z, .rstat_loop_2 ld a, e ld [rHDMA5], a ld a, [rLY] inc c ld hl, rLY -.asm_104240 +.final_ly_loop cp [hl] - jr z, .asm_104240 + jr z, .final_ly_loop ld a, [hl] dec c - jr nz, .asm_104240 + jr nz, .final_ly_loop ld hl, rHDMA5 res 7, [hl] ei + ret ; 10424e @@ -86945,7 +77812,7 @@ Function10424e: ; 10424e (41:424e) ld [rHDMA1], a ; $ff00+$51 ld a, l ld [rHDMA2], a ; $ff00+$52 - ld a, [$ffd7] + ld a, [hBGMapAddress + 1] and $1f ld [rHDMA3], a ; $ff00+$53 ld a, [hBGMapAddress] ; $ff00+$d6 @@ -86960,76 +77827,95 @@ Function104263: ; 104263 (41:4263) ld c, $0 Function104265: ; 104265 (41:4265) +; back up the value of c to hConnectionStripLength ld a, [hConnectionStripLength] push af ld a, c ld [hConnectionStripLength], a - ld c, $12 -.asm_10426d - ld b, $14 -.asm_10426f + +; for each row on the screen + ld c, SCREEN_HEIGHT +.loop1 +; for each tile in the row + ld b, SCREEN_WIDTH +.loop2 +; copy from de to hl ld a, [de] inc de ld [hli], a dec b - jr nz, .asm_10426f + jr nz, .loop2 + +; load the original value of c into hl 12 times ld a, [hConnectionStripLength] - ld b, $c -.asm_104279 + ld b, 12 +.loop3 ld [hli], a dec b - jr nz, .asm_104279 + jr nz, .loop3 + dec c - jr nz, .asm_10426d + jr nz, .loop1 + +; restore the original value of hConnectionStripLength pop af ld [hConnectionStripLength], a ret Function104284:: ; 104284 + ; switch to WRAM bank 6 ld a, [rSVBK] push af ld a, $6 ld [rSVBK], a + push bc push hl - ld a, b - ld l, c + + ; Copy c tiles of the 2bpp from b:de to w6_d000 + ld a, b ; bank + ld l, c ; number of tiles ld h, $0 rept 4 - add hl, hl + add hl, hl ; multiply by 16 (16 bytes of a 2bpp = 8 x 8 tile) endr ld b, h ld c, l - ld h, d + ld h, d ; address ld l, e ld de, w6_d000 call FarCopyBytes + pop hl pop bc + push bc call DelayFrame pop bc + ld d, h ld e, l ld hl, w6_d000 call Function104209 + + ; restore the previous bank pop af ld [rSVBK], a ret ; 1042b2 Function1042b2:: ; 1042b2 -.asm_1042b2 +.loop ld a, c cp $10 - jp c, Function1042d6 - jp z, Function1042d6 + jp c, .asm_1042d6 + jp z, .asm_1042d6 push bc push hl push de ld c, $10 - call Function1042d6 + call .asm_1042d6 pop de ld hl, $0080 add hl, de @@ -87042,10 +77928,10 @@ Function1042b2:: ; 1042b2 ld a, c sub $10 ld c, a - jr .asm_1042b2 + jr .loop ; 1042d6 -Function1042d6: ; 1042d6 +.asm_1042d6: ; 1042d6 ld a, [rSVBK] push af ld a, $6 @@ -87094,13 +77980,13 @@ Function104309: ld [rVBK], a ; $ff00+$4f ld c, $8 ld hl, w6_d000 + $80 - ld de, $9c00 + ld de, VBGMap1 tile $00 call Function104209 ld a, $0 ld [rVBK], a ; $ff00+$4f ld c, $8 ld hl, w6_d000 - ld de, $9c00 + ld de, VBGMap1 tile $00 call Function104209 ret @@ -87395,13 +78281,13 @@ Function104770: ; 104770 (41:4770) ld [rVBK], a ; $ff00+$4f xor a ld bc, $400 - ld hl, $9800 + ld hl, VBGMap0 tile $00 call ByteFill pop af ld [rVBK], a ; $ff00+$4f ld a, $60 ld bc, $400 - ld hl, $9800 + ld hl, VBGMap0 tile $00 call ByteFill ret @@ -87416,7 +78302,7 @@ Function1047a3: ; 1047a3 (41:47a3) ld [rVBK], a ; $ff00+$4f Function1047b4: ; 1047b4 (41:47b4) - ld hl, $9800 + ld hl, VBGMap0 tile $00 ld c, $14 ld b, $12 .asm_1047bb @@ -87459,23 +78345,23 @@ RefreshMapSprites: ; 1047f0 call Function2914 callba Function579d callba Function154f7 - ld hl, wd45b + ld hl, wPlayerSpriteSetupFlags bit 6, [hl] jr nz, .asm_104817 ld hl, VramState set 0, [hl] call Function2e31 .asm_104817 - ld a, [wd45b] + ld a, [wPlayerSpriteSetupFlags] and $1c - ld [wd45b], a + ld [wPlayerSpriteSetupFlags], a ret CheckMovingOffEdgeOfMap:: ; 104820 (41:4820) ld a, [wd151] cp STANDING ret z - and a + and a ; DOWN jr z, .down cp UP jr z, .up @@ -87635,7 +78521,7 @@ DoMysteryGift: ; 1048ba (41:48ba) jr z, .asm_104963 call Function104a71 callba Function10619d - callba Function1060a9 + callba MobileFn_1060a9 callba Function106187 .asm_104963 ld a, [wc90f] @@ -87658,7 +78544,7 @@ DoMysteryGift: ; 1048ba (41:48ba) jr Function1049c5 .item - call Function105106 + call GetMysteryGiftBank ld a, [wc910] ld c, a callba MysteryGiftGetItem @@ -87742,13 +78628,13 @@ UnknownText_0x104a20: ; 104a20 ; 104a25 Function104a25: ; 104a25 (41:4a25) - call Function105106 + call GetMysteryGiftBank ld a, [s0_abe5] cp $5 jp CloseSRAM Function104a30: ; 104a30 (41:4a30) - call Function105106 + call GetMysteryGiftBank ld a, [wc901] ld b, a ld a, [wc902] @@ -87776,11 +78662,11 @@ Function104a30: ; 104a30 (41:4a30) jp CloseSRAM Function104a56: ; 104a56 (41:4a56) - call Function105106 + call GetMysteryGiftBank ld hl, s0_abe5 ld a, [hl] inc [hl] - ld hl, s0_abe6 + ld hl, s0_abe6 ; inc hl ld e, a ld d, $0 rept 2 @@ -87793,7 +78679,7 @@ endr jp CloseSRAM Function104a71: ; 104a71 (41:4a71) - call Function105106 + call GetMysteryGiftBank ld a, $1 ld [sMysteryGiftTrainerHouseFlag], a ld hl, wc903 @@ -88660,7 +79546,7 @@ endr ret Function105069: ; 105069 (41:5069) - call Function105106 + call GetMysteryGiftBank ld d, $0 ld b, $2 ld hl, s0_abf0 @@ -88674,7 +79560,7 @@ Function105069: ; 105069 (41:5069) pop bc pop hl ret nz - call Function105106 + call GetMysteryGiftBank ld b, $1 predef FlagPredef call CloseSRAM @@ -88682,7 +79568,7 @@ Function105069: ; 105069 (41:5069) ret Function105091: ; 105091 (41:5091) - call Function105106 + call GetMysteryGiftBank ld c, $0 .asm_105096 push bc @@ -88705,7 +79591,7 @@ Function105091: ; 105091 (41:5091) jp CloseSRAM Special_UnlockMysteryGift: ; 1050b9 - call Function105106 + call GetMysteryGiftBank ld hl, s0_abe3 ld a, [hl] inc a @@ -88717,19 +79603,19 @@ Special_UnlockMysteryGift: ; 1050b9 ; 1050c8 Function1050c8: ; 1050c8 - call Function105106 + call GetMysteryGiftBank ld a, [s0_abe5] cp $ff - jr z, .asm_1050d6 + jr z, .okay xor a ld [s0_abe5], a -.asm_1050d6 +.okay jp CloseSRAM ; 1050d9 Function1050d9: ; 1050d9 - call Function105106 + call GetMysteryGiftBank ld hl, sMysteryGiftItem ld de, s0_abe4 ld a, [hli] @@ -88742,7 +79628,7 @@ Function1050d9: ; 1050d9 Function1050ea: ; 1050ea (41:50ea) - call Function105106 + call GetMysteryGiftBank ld hl, s0_abe4 ld de, sMysteryGiftItem ld a, [hli] @@ -88763,7 +79649,7 @@ Function1050fb: ; 1050fb (41:50fb) ret -Function105106: ; 105106 +GetMysteryGiftBank: ; 105106 ld a, BANK(s0_abe4) jp GetSRAMBank ; 10510b @@ -88818,16 +79704,16 @@ Function105153: ; 105153 (41:5153) call WhiteBGMap call DisableLCD ld hl, MysteryGiftGFX - ld de, $9000 + ld de, VTiles2 tile $00 ld a, BANK(MysteryGiftGFX) - ld bc, $430 + ld bc, Function105688 - MysteryGiftGFX call FarCopyBytes hlcoord 0, 0 ld a, $42 - ld bc, $168 + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH call ByteFill hlcoord 3, 7 - ld bc, $90f + lb bc, 9, 15 call ClearBox hlcoord 0, 0 ld a, $0 @@ -89093,7 +79979,7 @@ Function10578c: ; 10578c (41:578c) ld hl, sPlayerData + PlayerID - wPlayerData ld bc, 2 call CopyBytes - ld hl, sPlayerData + wd84a - wPlayerData + ld hl, sPlayerData + wSecretID - wPlayerData ld bc, 2 call CopyBytes call CloseSRAM @@ -89117,18 +80003,18 @@ Function1057d7: ; 1057d7 (41:57d7) call WhiteBGMap call DisableLCD ld hl, MysteryGiftJP_GFX - ld de, $9000 + ld de, VTiles2 tile $00 ld a, BANK(MysteryGiftJP_GFX) ld bc, $400 call FarCopyBytes ld hl, MysteryGiftJP_GFX + $400 - ld de, $8000 + ld de, VTiles0 tile $00 ld a, BANK(MysteryGiftJP_GFX) ld bc, $80 call FarCopyBytes hlcoord 0, 0 ld a, $3f - ld bc, $168 + ld bc, SCREEN_HEIGHT * SCREEN_WIDTH call ByteFill hlcoord 3, 7 ld bc, $90f @@ -89716,7 +80602,7 @@ MagikarpLength_Mobile: mobile ; 105f33 ret ; 105f79 -Function105f79: mobile ; 105f79 +MobileFn_105f79: mobile ; 105f79 ld a, $5 call GetSRAMBank ld a, [hProduct] @@ -89745,7 +80631,7 @@ Function105f79: mobile ; 105f79 ret ; 105f9f -Function105f9f: mobile ; 105f9f +MobileFn_105f9f: mobile ; 105f9f ld a, $5 call GetSRAMBank ld hl, $a070 @@ -89782,7 +80668,7 @@ Function105f9f: mobile ; 105f9f ret ; 105fd0 -Function105fd0: mobile ; 105fd0 +MobileFn_105fd0: mobile ; 105fd0 ld a, $5 call GetSRAMBank ld hl, $a06f @@ -89794,7 +80680,7 @@ Function105fd0: mobile ; 105fd0 ret ; 105fe3 -Function105fe3: mobile ; 105fe3 +MobileFn_105fe3: mobile ; 105fe3 ld a, $5 call GetSRAMBank ld hl, $a076 @@ -89822,7 +80708,7 @@ endr ret ; 106008 -Function106008: mobile ; 106008 +MobileFn_106008: mobile ; 106008 ld a, $5 call GetSRAMBank ld hl, $a07a @@ -89852,11 +80738,11 @@ endr ret ; 10602e -Function10602e: mobile ; 10602e (41:602e) +MobileFn_10602e: mobile ; 10602e (41:602e) ld hl, $a010 jp Function106117 -Function106035: mobile ; 106035 +MobileFn_106035: mobile ; 106035 ld a, $5 call GetSRAMBank ld a, [$aa8d] @@ -89866,29 +80752,29 @@ Function106035: mobile ; 106035 ld hl, $a014 jp Function106123 -Function106049: mobile ; 106049 +MobileFn_106049: mobile ; 106049 ld hl, $a018 jp Function10611d -Function106050: mobile ; 106050 +MobileFn_106050: mobile ; 106050 ld a, [BattleType] cp BATTLETYPE_TUTORIAL ret z ld hl, $a01b jp Function10611d -Function10605d: mobile ; 10605d +MobileFn_10605d: mobile ; 10605d ld a, [BattleType] cp BATTLETYPE_TUTORIAL ret z ld hl, $a01e jp Function10611d -Function10606a: mobile ; 10606a +MobileFn_10606a: mobile ; 10606a ld hl, $a021 jp Function10611d -Function106071: mobile ; 106071 +MobileFn_106071: mobile ; 106071 ld hl, $a024 jp Function10611d @@ -89896,23 +80782,23 @@ Mobile_HallOfFame:: mobile ; 0x106078 ld hl, $a027 jp Function10611d -Function10607f: mobile ; 10607f (41:607f) +MobileFn_10607f: mobile ; 10607f (41:607f) ld hl, $a02a jp Function10611d -Function106086: mobile ; 106086 +MobileFn_106086: mobile ; 106086 ld hl, $a02d jp Function10611d -Function10608d: mobile ; 10608d (41:608d) +MobileFn_10608d: mobile ; 10608d (41:608d) ld hl, $a030 jp Function10611d -Function106094: mobile ; 106094 +MobileFn_106094: mobile ; 106094 ld hl, $a033 jp Function10611d -Function10609b: mobile ; 10609b +MobileFn_10609b: mobile ; 10609b ld hl, $a036 jp Function10611d @@ -89920,76 +80806,76 @@ Mobile_HealParty: mobile ; 1060a2 ld hl, $a039 jp Function10611d -Function1060a9: mobile ; 1060a9 (41:60a9) +MobileFn_1060a9: mobile ; 1060a9 (41:60a9) ld hl, $a03c jr Function10611d -Function1060af: mobile ; 1060af +MobileFn_1060af: mobile ; 1060af ld hl, $a03f jr Function10611d -Function1060b5: mobile ; 1060b5 +MobileFn_1060b5: mobile ; 1060b5 ld hl, $a042 jr Function10611d -Function1060bb: mobile ; 1060bb +MobileFn_1060bb: mobile ; 1060bb ld hl, $a045 jr Function10611d -Function1060c1: mobile ; 1060c1 +MobileFn_1060c1: mobile ; 1060c1 ld hl, $a048 jr Function10611d -Function1060c7: mobile ; 1060c7 +MobileFn_1060c7: mobile ; 1060c7 ld hl, $a04b jr Function10611d -Function1060cd: mobile ; 1060cd +MobileFn_1060cd: mobile ; 1060cd ld hl, $a04e jr Function106123 -Function1060d3: mobile ; 1060d3 +MobileFn_1060d3: mobile ; 1060d3 ld hl, $a051 jr Function10611d -Function1060d9: mobile ; 1060df +MobileFn_1060d9: mobile ; 1060df ld hl, $a054 jr Function10611d -Function1060df: mobile ; 1060df +MobileFn_1060df: mobile ; 1060df ld hl, $a057 jr Function10611d -Function1060e5: mobile ; 1060e5 +MobileFn_1060e5: mobile ; 1060e5 ld a, [hBattleTurn] and a ret nz ld hl, $a05a jr Function10611d -Function1060ef: mobile ; 1060ef +MobileFn_1060ef: mobile ; 1060ef ld hl, $a05d jr Function10611d -Function1060f5: mobile ; 1060f5 +MobileFn_1060f5: mobile ; 1060f5 ld hl, $a060 jr Function10611d -Function1060fb: mobile ; 1060fb +MobileFn_1060fb: mobile ; 1060fb ld hl, $a063 jr Function10611d -Function106101: mobile ; 106101 +MobileFn_106101: mobile ; 106101 ld hl, $a066 jr Function10611d ; 106107 -Function106107: mobile ; 106107 +MobileFn_106107: mobile ; 106107 ld hl, $a069 jr Function10611d ; 10610d -Function10610d: mobile ; 10610d +MobileFn_10610d: mobile ; 10610d ld a, [hBattleTurn] and a ret nz @@ -90055,7 +80941,7 @@ Function10612d: ; 10612d ret ; 106155 -Function106155: mobile ; 106155 +MobileFn_106155: mobile ; 106155 ld a, $5 call GetSRAMBank call Function106162 @@ -90369,7 +81255,7 @@ Function10630f: ; 10630f ret ; 106314 -Function106314: mobile ; 106314 +MobileFn_106314: mobile ; 106314 ld a, $4 call GetSRAMBank ld a, c @@ -90541,7 +81427,7 @@ Function106403: ; 106403 or c inc a ld c, a - call Function106314 + call MobileFn_106314 ld a, [wcd25] inc a ld [wcd25], a @@ -90559,7 +81445,7 @@ Function106403: ; 106403 .asm_106435 ld c, $0 - call Function106314 + call MobileFn_106314 ld a, [wcd25] inc a ld [wcd25], a @@ -90570,7 +81456,7 @@ Function106442: ; 106442 ld a, $36 call Function3e32 xor a - ld [$ffe9], a + ld [hMobile], a ld [$ffc9], a ld a, [wcd25] inc a @@ -90596,20 +81482,20 @@ Function106463: ; 106463 Function106464:: ; 106464 ld de, GFX_f9214 - ld hl, $9600 + ld hl, VTiles2 tile $60 lb bc, BANK(GFX_f9214), 1 call Get2bpp ld de, GFX_f9424 - ld hl, $9610 + ld hl, VTiles2 tile $61 lb bc, BANK(GFX_f9424), 1 call Get2bpp ld de, GFX_106514 - ld hl, $9620 + ld hl, VTiles2 tile $62 ld c, 9 ld b, BANK(GFX_106514) call Get2bpp ld de, $40b0 - ld hl, $96b0 + ld hl, VTiles2 tile $6b ld b, $f ; XXX no graphics at 0f:40b0 call Get2bpp callba Functionfb4cc @@ -90624,11 +81510,11 @@ Function10649b: ; 10649b call AddNTimes ld d, h ld e, l - ld hl, $9790 + ld hl, VTiles2 tile $79 ld c, $6 ld b, BANK(Frames) call Function1064c3 - ld hl, $97f0 + ld hl, VTiles2 tile $7f ld de, GFX_f9204 ld c, $1 ld b, BANK(GFX_f9204) @@ -90704,7 +81590,7 @@ Function106594:: ; 106594 lb bc, BANK(GFX_1065ad), $80 call Get2bpp ld de, GFX_1065ad + $800 - ld hl, $97f0 + ld hl, VTiles2 tile $7f lb bc, BANK(GFX_1065ad), 1 call Get2bpp ret @@ -90959,20 +81845,20 @@ Function1dc381: ; 1dc381 call ClearSprites xor a ld [hBGMapMode], a - call Functione58 + call LoadFontsBattleExtra ld de, MobileHPIcon - ld hl, $9710 + ld hl, VTiles2 tile $71 lb bc, BANK(MobileHPIcon), 1 call Request1bpp ld de, MobileLvIcon - ld hl, $96e0 + ld hl, VTiles2 tile $6e lb bc, BANK(MobileLvIcon), 1 call Request1bpp ld de, ShinyIcon - ld hl, $93f0 + ld hl, VTiles2 tile $3f lb bc, BANK(ShinyIcon), 1 call Get2bpp @@ -91059,7 +81945,7 @@ Function1dc47b: ; 1dc47b call ClearSprites xor a ld [hBGMapMode], a - call Functione58 + call LoadFontsBattleExtra xor a ld [MonType], a callba Function5084a @@ -91263,14 +82149,14 @@ INCLUDE "engine/diploma.asm" Function1ddf1c: ; 1ddf1c ld hl, LZ_1ddf33 - ld de, $9310 + ld de, VTiles2 tile $31 call Decompress ret ; 1ddf26 Function1ddf26: ; 1ddf26 (77:5f26) ld hl, LZ_1ddf33 - ld de, $9310 + ld de, VTiles2 tile $31 lb bc, BANK(LZ_1ddf33), $3a call Functione73 ret @@ -91388,14 +82274,14 @@ String_1de23c: ; 1de23c Function1de247: ; 1de247 ld a, [hBGMapAddress] ld l, a - ld a, [$ffd7] + ld a, [hBGMapAddress + 1] ld h, a push hl inc hl ld a, l ld [hBGMapAddress], a ld a, h - ld [$ffd7], a + ld [hBGMapAddress + 1], a hlcoord 19, 0 ld [hl], $66 hlcoord 19, 1 @@ -91414,7 +82300,7 @@ Function1de247: ; 1de247 ld a, l ld [hBGMapAddress], a ld a, h - ld [$ffd7], a + ld [hBGMapAddress + 1], a ret ; 1de27f @@ -91432,22 +82318,22 @@ Function1de27f: ; 1de27f -Function1de28a:: ; 1de28a +_DudeAutoInput_A:: ; 1de28a ld hl, DudeAutoInput_A - jr Function1de299 + jr _DudeAutoInput ; 1de28f -Function1de28f: ; 1de28f +_DudeAutoInput_RightA: ; 1de28f ld hl, DudeAutoInput_RightA - jr Function1de299 + jr _DudeAutoInput ; 1de294 -Function1de294: ; 1de294 +_DudeAutoInput_DownA: ; 1de294 ld hl, DudeAutoInput_DownA - jr Function1de299 + jr _DudeAutoInput ; 1de299 -Function1de299: ; 1de299 +_DudeAutoInput: ; 1de299 ld a, BANK(DudeAutoInputs) call StartAutoInput ret @@ -91714,3 +82600,4 @@ ELSE INCBIN "misc/stadium2_1.bin" ENDC + diff --git a/maps/AzaleaGym.asm b/maps/AzaleaGym.asm index a0a8b3e1e..bd764e9dd 100644 --- a/maps/AzaleaGym.asm +++ b/maps/AzaleaGym.asm @@ -371,10 +371,10 @@ AzaleaGym_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_BUGSY, 11, 9, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, BugsyScript_0x18ec1e, -1 - person_event SPRITE_BUG_CATCHER, 7, 9, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerBug_catcherBug_catcher_benny, -1 - person_event SPRITE_BUG_CATCHER, 12, 12, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerBug_catcherAl, -1 - person_event SPRITE_BUG_CATCHER, 6, 4, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerBug_catcherJosh, -1 - person_event SPRITE_TWIN, 14, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerTwinsAmyandmay1, -1 - person_event SPRITE_TWIN, 14, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerTwinsAmyandmay2, -1 - person_event SPRITE_GYM_GUY, 17, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, AzaleaGymGuyScript, -1 + person_event SPRITE_BUGSY, 7, 5, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, BugsyScript_0x18ec1e, -1 + person_event SPRITE_BUG_CATCHER, 3, 5, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerBug_catcherBug_catcher_benny, -1 + person_event SPRITE_BUG_CATCHER, 8, 8, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerBug_catcherAl, -1 + person_event SPRITE_BUG_CATCHER, 2, 0, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerBug_catcherJosh, -1 + person_event SPRITE_TWIN, 10, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerTwinsAmyandmay1, -1 + person_event SPRITE_TWIN, 10, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerTwinsAmyandmay2, -1 + person_event SPRITE_GYM_GUY, 13, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, AzaleaGymGuyScript, -1 diff --git a/maps/AzaleaMart.asm b/maps/AzaleaMart.asm index 975e7de15..b40acd8c5 100644 --- a/maps/AzaleaMart.asm +++ b/maps/AzaleaMart.asm @@ -57,6 +57,6 @@ AzaleaMart_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x18e040, -1 - person_event SPRITE_COOLTRAINER_M, 9, 6, $7, 0, 0, -1, -1, 0, 0, 0, CooltrainerMScript_0x18e047, -1 - person_event SPRITE_BUG_CATCHER, 6, 11, $5, 0, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, BugCatcherScript_0x18e04a, -1 + person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x18e040, -1 + person_event SPRITE_COOLTRAINER_M, 5, 2, $7, 0, 0, -1, -1, 0, 0, 0, CooltrainerMScript_0x18e047, -1 + person_event SPRITE_BUG_CATCHER, 2, 7, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, BugCatcherScript_0x18e04a, -1 diff --git a/maps/AzaleaPokeCenter1F.asm b/maps/AzaleaPokeCenter1F.asm index 92cec998a..f64d8ea09 100644 --- a/maps/AzaleaPokeCenter1F.asm +++ b/maps/AzaleaPokeCenter1F.asm @@ -90,7 +90,7 @@ AzaleaPokeCenter1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x18db28, -1 - person_event SPRITE_GENTLEMAN, 10, 13, $4, 1, 0, -1, -1, 0, 0, 0, GentlemanScript_0x18db2b, -1 - person_event SPRITE_FISHING_GURU, 5, 10, $6, 0, 0, -1, -1, 0, 0, 0, FishingGuruScript_0x18db2e, -1 - person_event SPRITE_POKEFAN_F, 8, 5, $2, 2, 1, -1, -1, 0, 0, 0, PokefanFScript_0x18db31, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x18db28, -1 + person_event SPRITE_GENTLEMAN, 6, 9, $4, 1, 0, -1, -1, 0, 0, 0, GentlemanScript_0x18db2b, -1 + person_event SPRITE_FISHING_GURU, 1, 6, $6, 0, 0, -1, -1, 0, 0, 0, FishingGuruScript_0x18db2e, -1 + person_event SPRITE_POKEFAN_F, 4, 1, $2, 2, 1, -1, -1, 0, 0, 0, PokefanFScript_0x18db31, -1 diff --git a/maps/AzaleaTown.asm b/maps/AzaleaTown.asm index 548e2577a..a2016e412 100644 --- a/maps/AzaleaTown.asm +++ b/maps/AzaleaTown.asm @@ -481,15 +481,15 @@ AzaleaTown_MapEventHeader: .PersonEvents: db 12 - person_event SPRITE_AZALEA_ROCKET, 13, 35, $6, 0, 0, -1, -1, 0, 0, 0, AzaleaRocketScript_0x1980ab, EVENT_AZALEA_TOWN_SLOWPOKETAIL_ROCKET - person_event SPRITE_GRAMPS, 13, 25, $2, 2, 1, -1, -1, 0, 0, 0, GrampsScript_0x1980b1, -1 - person_event SPRITE_TEACHER, 17, 19, $4, 2, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, TeacherScript_0x1980c5, -1 - person_event SPRITE_YOUNGSTER, 13, 11, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x1980c8, -1 - person_event SPRITE_SLOWPOKE, 21, 12, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES - person_event SPRITE_SLOWPOKE, 13, 22, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES - person_event SPRITE_SLOWPOKE, 13, 33, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES - person_event SPRITE_SLOWPOKE, 19, 19, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES - person_event SPRITE_FRUIT_TREE, 6, 12, $1, 0, 0, -1, -1, 0, 0, 0, WhiteApricornTree, -1 - person_event SPRITE_AZALEA_ROCKET, 14, 15, $8, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_AZALEA_TOWN - person_event SPRITE_AZALEA_ROCKET, 20, 14, $6, 0, 0, -1, -1, 0, 0, 0, AzaleaRocketScript_0x1980ae, EVENT_SLOWPOKE_WELL_ROCKETS - person_event SPRITE_KURT_OUTSIDE, 9, 10, $8, 0, 0, -1, -1, 0, 0, 0, KurtOutsideScript_0x19810c, EVENT_AZALEA_TOWN_KURT + person_event SPRITE_AZALEA_ROCKET, 9, 31, $6, 0, 0, -1, -1, 0, 0, 0, AzaleaRocketScript_0x1980ab, EVENT_AZALEA_TOWN_SLOWPOKETAIL_ROCKET + person_event SPRITE_GRAMPS, 9, 21, $2, 2, 1, -1, -1, 0, 0, 0, GrampsScript_0x1980b1, -1 + person_event SPRITE_TEACHER, 13, 15, $4, 2, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, TeacherScript_0x1980c5, -1 + person_event SPRITE_YOUNGSTER, 9, 7, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x1980c8, -1 + person_event SPRITE_SLOWPOKE, 17, 8, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES + person_event SPRITE_SLOWPOKE, 9, 18, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES + person_event SPRITE_SLOWPOKE, 9, 29, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES + person_event SPRITE_SLOWPOKE, 15, 15, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES + person_event SPRITE_FRUIT_TREE, 2, 8, $1, 0, 0, -1, -1, 0, 0, 0, WhiteApricornTree, -1 + person_event SPRITE_AZALEA_ROCKET, 10, 11, $8, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_AZALEA_TOWN + person_event SPRITE_AZALEA_ROCKET, 16, 10, $6, 0, 0, -1, -1, 0, 0, 0, AzaleaRocketScript_0x1980ae, EVENT_SLOWPOKE_WELL_ROCKETS + person_event SPRITE_KURT_OUTSIDE, 5, 6, $8, 0, 0, -1, -1, 0, 0, 0, KurtOutsideScript_0x19810c, EVENT_AZALEA_TOWN_KURT diff --git a/maps/BattleTower1F.asm b/maps/BattleTower1F.asm index 2317e8f64..53b6b8752 100644 --- a/maps/BattleTower1F.asm +++ b/maps/BattleTower1F.asm @@ -810,8 +810,8 @@ BattleTower1F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_RECEPTIONIST, 10, 11, $6, 0, 0, -1, -1, 0, 0, 0, ReceptionistScript_0x9e3e2, -1 - person_event SPRITE_YOUNGSTER, 13, 18, $9, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, YoungsterScript_0x9e55d, -1 - person_event SPRITE_COOLTRAINER_F, 13, 8, $5, 0, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerFScript_0x9e568, -1 - person_event SPRITE_BUG_CATCHER, 7, 5, $2, 1, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, BugCatcherScript_0x9e56b, -1 - person_event SPRITE_GRANNY, 7, 18, $4, 1, 0, -1, -1, 0, 0, 0, GrannyScript_0x9e56e, -1 + person_event SPRITE_RECEPTIONIST, 6, 7, $6, 0, 0, -1, -1, 0, 0, 0, ReceptionistScript_0x9e3e2, -1 + person_event SPRITE_YOUNGSTER, 9, 14, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, YoungsterScript_0x9e55d, -1 + person_event SPRITE_COOLTRAINER_F, 9, 4, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerFScript_0x9e568, -1 + person_event SPRITE_BUG_CATCHER, 3, 1, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, BugCatcherScript_0x9e56b, -1 + person_event SPRITE_GRANNY, 3, 14, $4, 1, 0, -1, -1, 0, 0, 0, GrannyScript_0x9e56e, -1 diff --git a/maps/BattleTowerBattleRoom.asm b/maps/BattleTowerBattleRoom.asm index ab40bd1be..9bc80b199 100644 --- a/maps/BattleTowerBattleRoom.asm +++ b/maps/BattleTowerBattleRoom.asm @@ -155,5 +155,5 @@ BattleTowerBattleRoom_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_YOUNGSTER, 4, 8, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_BATTLE_TOWER_BATTLE_ROOM_YOUNGSTER - person_event SPRITE_RECEPTIONIST, 10, 5, $9, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, -1 + person_event SPRITE_YOUNGSTER, 0, 4, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_BATTLE_TOWER_BATTLE_ROOM_YOUNGSTER + person_event SPRITE_RECEPTIONIST, 6, 1, $9, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, -1 diff --git a/maps/BattleTowerElevator.asm b/maps/BattleTowerElevator.asm index f8991fba6..abfd137e5 100644 --- a/maps/BattleTowerElevator.asm +++ b/maps/BattleTowerElevator.asm @@ -60,4 +60,4 @@ BattleTowerElevator_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_RECEPTIONIST, 6, 5, $9, 0, 0, -1, -1, 0, 0, 0, MovementData_0x9f58f, -1 + person_event SPRITE_RECEPTIONIST, 2, 1, $9, 0, 0, -1, -1, 0, 0, 0, MovementData_0x9f58f, -1 diff --git a/maps/BattleTowerHallway.asm b/maps/BattleTowerHallway.asm index 4c46d5857..179ec1584 100644 --- a/maps/BattleTowerHallway.asm +++ b/maps/BattleTowerHallway.asm @@ -98,4 +98,4 @@ BattleTowerHallway_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_RECEPTIONIST, 6, 15, $6, 0, 0, -1, -1, 0, 0, 0, BattleTowerHallway_MapEventHeader, -1 + person_event SPRITE_RECEPTIONIST, 2, 11, $6, 0, 0, -1, -1, 0, 0, 0, BattleTowerHallway_MapEventHeader, -1 diff --git a/maps/BattleTowerOutside.asm b/maps/BattleTowerOutside.asm index 5c2838546..43ee41e3e 100644 --- a/maps/BattleTowerOutside.asm +++ b/maps/BattleTowerOutside.asm @@ -142,7 +142,7 @@ BattleTowerOutside_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_STANDING_YOUNGSTER, 16, 10, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, StandingYoungsterScript_0x9f85f, -1 - person_event SPRITE_BUENA, 15, 17, $2, 1, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, BuenaScript_0x9f862, -1 - person_event SPRITE_SAILOR, 22, 16, $5, 0, 1, -1, -1, 0, 0, 0, SailorScript_0x9f865, EVENT_BATTLE_TOWER_OUTSIDE_SAILOR - person_event SPRITE_LASS, 28, 16, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ObjectEvent, -1 + person_event SPRITE_STANDING_YOUNGSTER, 12, 6, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, StandingYoungsterScript_0x9f85f, -1 + person_event SPRITE_BUENA, 11, 13, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, BuenaScript_0x9f862, -1 + person_event SPRITE_SAILOR, 18, 12, $5, 0, 1, -1, -1, 0, 0, 0, SailorScript_0x9f865, EVENT_BATTLE_TOWER_OUTSIDE_SAILOR + person_event SPRITE_LASS, 24, 12, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ObjectEvent, -1 diff --git a/maps/BillsHouse.asm b/maps/BillsHouse.asm index 5c3676070..3372d8498 100644 --- a/maps/BillsHouse.asm +++ b/maps/BillsHouse.asm @@ -34,7 +34,7 @@ UnknownScript_0x189553: yesorno iffalse UnknownScript_0x1896aa scall UnknownScript_0x1896a5 - special Function73f7 + special Special_BillsGrandfather iffalse UnknownScript_0x1896aa if_not_equal LICKITUNG, UnknownScript_0x1896c6 scall UnknownScript_0x1896b0 @@ -48,7 +48,7 @@ UnknownScript_0x189592: yesorno iffalse UnknownScript_0x1896aa scall UnknownScript_0x1896a5 - special Function73f7 + special Special_BillsGrandfather iffalse UnknownScript_0x1896aa if_not_equal ODDISH, UnknownScript_0x1896c6 scall UnknownScript_0x1896b0 @@ -62,7 +62,7 @@ UnknownScript_0x1895b3: yesorno iffalse UnknownScript_0x1896aa scall UnknownScript_0x1896a5 - special Function73f7 + special Special_BillsGrandfather iffalse UnknownScript_0x1896aa if_not_equal STARYU, UnknownScript_0x1896c6 scall UnknownScript_0x1896b0 @@ -78,7 +78,7 @@ UnknownScript_0x1895d4: yesorno iffalse UnknownScript_0x1896aa scall UnknownScript_0x1896a5 - special Function73f7 + special Special_BillsGrandfather iffalse UnknownScript_0x1896aa if_not_equal GROWLITHE, UnknownScript_0x1896c6 scall UnknownScript_0x1896b0 @@ -92,7 +92,7 @@ UnknownScript_0x1895f9: yesorno iffalse UnknownScript_0x1896aa scall UnknownScript_0x1896a5 - special Function73f7 + special Special_BillsGrandfather iffalse UnknownScript_0x1896aa if_not_equal VULPIX, UnknownScript_0x1896c6 scall UnknownScript_0x1896b0 @@ -106,7 +106,7 @@ UnknownScript_0x18961a: yesorno iffalse UnknownScript_0x1896aa scall UnknownScript_0x1896a5 - special Function73f7 + special Special_BillsGrandfather iffalse UnknownScript_0x1896aa if_not_equal PICHU, UnknownScript_0x1896c6 scall UnknownScript_0x1896b0 @@ -367,4 +367,4 @@ BillsHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_GRAMPS, 7, 6, $7, 2, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GrampsScript_0x189538, -1 + person_event SPRITE_GRAMPS, 3, 2, $7, 2, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GrampsScript_0x189538, -1 diff --git a/maps/BlackthornCity.asm b/maps/BlackthornCity.asm index adcf9c62f..9e2b24698 100644 --- a/maps/BlackthornCity.asm +++ b/maps/BlackthornCity.asm @@ -333,12 +333,12 @@ BlackthornCity_MapEventHeader: .PersonEvents: db 9 - person_event SPRITE_SUPER_NERD, 16, 22, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, SuperNerdScript_0x1a46e8, EVENT_BLACKTHORN_CITY_SUPER_NERD_BLOCKS_GYM - person_event SPRITE_SUPER_NERD, 16, 23, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, SuperNerdScript_0x1a46e8, EVENT_BLACKTHORN_CITY_SUPER_NERD_DOES_NOT_BLOCK_GYM - person_event SPRITE_GRAMPS, 6, 24, $6, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x1a4708, EVENT_BLACKTHORN_CITY_GRAMPS_BLOCKS_DRAGONS_DEN - person_event SPRITE_GRAMPS, 6, 25, $8, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x1a470b, EVENT_BLACKTHORN_CITY_GRAMPS_NOT_BLOCKING_DRAGONS_DEN - person_event SPRITE_BLACK_BELT, 35, 28, $5, 0, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, BlackBeltScript_0x1a470e, -1 - person_event SPRITE_COOLTRAINER_F, 29, 13, $5, 0, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerFScript_0x1a4722, -1 - person_event SPRITE_YOUNGSTER, 19, 17, $5, 0, 1, -1, -1, 0, 0, 0, YoungsterScript_0x1a4725, -1 - person_event SPRITE_YOUNGSTER, 24, 26, $6, 0, 0, -1, -1, 0, 0, 0, SantosScript, EVENT_BLACKTHORN_CITY_SANTOS_OF_SATURDAY - person_event SPRITE_COOLTRAINER_F, 23, 39, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x1a4728, -1 + person_event SPRITE_SUPER_NERD, 12, 18, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SuperNerdScript_0x1a46e8, EVENT_BLACKTHORN_CITY_SUPER_NERD_BLOCKS_GYM + person_event SPRITE_SUPER_NERD, 12, 19, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SuperNerdScript_0x1a46e8, EVENT_BLACKTHORN_CITY_SUPER_NERD_DOES_NOT_BLOCK_GYM + person_event SPRITE_GRAMPS, 2, 20, $6, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x1a4708, EVENT_BLACKTHORN_CITY_GRAMPS_BLOCKS_DRAGONS_DEN + person_event SPRITE_GRAMPS, 2, 21, $8, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x1a470b, EVENT_BLACKTHORN_CITY_GRAMPS_NOT_BLOCKING_DRAGONS_DEN + person_event SPRITE_BLACK_BELT, 31, 24, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, BlackBeltScript_0x1a470e, -1 + person_event SPRITE_COOLTRAINER_F, 25, 9, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerFScript_0x1a4722, -1 + person_event SPRITE_YOUNGSTER, 15, 13, $5, 0, 1, -1, -1, 0, 0, 0, YoungsterScript_0x1a4725, -1 + person_event SPRITE_YOUNGSTER, 20, 22, $6, 0, 0, -1, -1, 0, 0, 0, SantosScript, EVENT_BLACKTHORN_CITY_SANTOS_OF_SATURDAY + person_event SPRITE_COOLTRAINER_F, 19, 35, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x1a4728, -1 diff --git a/maps/BlackthornDodrioTradeHouse.asm b/maps/BlackthornDodrioTradeHouse.asm index 184fc16cf..2e0749ce5 100644 --- a/maps/BlackthornDodrioTradeHouse.asm +++ b/maps/BlackthornDodrioTradeHouse.asm @@ -35,4 +35,4 @@ BlackthornDodrioTradeHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_LASS, 7, 6, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, Emy, -1 + person_event SPRITE_LASS, 3, 2, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, Emy, -1 diff --git a/maps/BlackthornDragonSpeechHouse.asm b/maps/BlackthornDragonSpeechHouse.asm index d549404bd..3a50fd96f 100644 --- a/maps/BlackthornDragonSpeechHouse.asm +++ b/maps/BlackthornDragonSpeechHouse.asm @@ -58,5 +58,5 @@ BlackthornDragonSpeechHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_GRANNY, 7, 6, $3, 0, 0, -1, -1, 0, 0, 0, GrannyScript_0x195949, -1 - person_event SPRITE_EKANS, 9, 9, $16, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, EkansScript_0x19594c, -1 + person_event SPRITE_GRANNY, 3, 2, $3, 0, 0, -1, -1, 0, 0, 0, GrannyScript_0x195949, -1 + person_event SPRITE_EKANS, 5, 5, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, EkansScript_0x19594c, -1 diff --git a/maps/BlackthornGym1F.asm b/maps/BlackthornGym1F.asm index 5131b1a80..1ca683124 100644 --- a/maps/BlackthornGym1F.asm +++ b/maps/BlackthornGym1F.asm @@ -404,8 +404,8 @@ BlackthornGym1F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_CLAIR, 7, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ClairScript_0x194e24, -1 - person_event SPRITE_COOLTRAINER_M, 10, 10, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerCooltrainermMike, -1 - person_event SPRITE_COOLTRAINER_M, 18, 5, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerCooltrainermPaul, -1 - person_event SPRITE_COOLTRAINER_F, 6, 13, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerCooltrainerfLola, -1 - person_event SPRITE_GYM_GUY, 19, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, BlackthornGymGuyScript, -1 + person_event SPRITE_CLAIR, 3, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ClairScript_0x194e24, -1 + person_event SPRITE_COOLTRAINER_M, 6, 6, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerCooltrainermMike, -1 + person_event SPRITE_COOLTRAINER_M, 14, 1, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerCooltrainermPaul, -1 + person_event SPRITE_COOLTRAINER_F, 2, 9, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerCooltrainerfLola, -1 + person_event SPRITE_GYM_GUY, 15, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, BlackthornGymGuyScript, -1 diff --git a/maps/BlackthornGym2F.asm b/maps/BlackthornGym2F.asm index 02abc0bc9..50a86d5dd 100644 --- a/maps/BlackthornGym2F.asm +++ b/maps/BlackthornGym2F.asm @@ -145,11 +145,11 @@ BlackthornGym2F_MapEventHeader: .PersonEvents: db 8 - person_event SPRITE_COOLTRAINER_M, 5, 8, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerCooltrainermCody, -1 - person_event SPRITE_COOLTRAINER_F, 15, 8, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerCooltrainerfFran, -1 - person_event SPRITE_BOULDER, 6, 12, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, EVENT_BOULDER_IN_BLACKTHORN_GYM_1 - person_event SPRITE_BOULDER, 7, 6, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, EVENT_BOULDER_IN_BLACKTHORN_GYM_2 - person_event SPRITE_BOULDER, 20, 10, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, EVENT_BOULDER_IN_BLACKTHORN_GYM_3 - person_event SPRITE_BOULDER, 7, 7, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, -1 - person_event SPRITE_BOULDER, 5, 10, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, -1 - person_event SPRITE_BOULDER, 18, 12, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, -1 + person_event SPRITE_COOLTRAINER_M, 1, 4, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerCooltrainermCody, -1 + person_event SPRITE_COOLTRAINER_F, 11, 4, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerCooltrainerfFran, -1 + person_event SPRITE_BOULDER, 2, 8, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, EVENT_BOULDER_IN_BLACKTHORN_GYM_1 + person_event SPRITE_BOULDER, 3, 2, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, EVENT_BOULDER_IN_BLACKTHORN_GYM_2 + person_event SPRITE_BOULDER, 16, 6, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, EVENT_BOULDER_IN_BLACKTHORN_GYM_3 + person_event SPRITE_BOULDER, 3, 3, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, -1 + person_event SPRITE_BOULDER, 1, 6, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, -1 + person_event SPRITE_BOULDER, 14, 8, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, -1 diff --git a/maps/BlackthornMart.asm b/maps/BlackthornMart.asm index 8d20b5fa8..f39b1f4f3 100644 --- a/maps/BlackthornMart.asm +++ b/maps/BlackthornMart.asm @@ -58,6 +58,6 @@ BlackthornMart_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x195a5d, -1 - person_event SPRITE_COOLTRAINER_M, 10, 11, $5, 0, 2, -1, -1, 0, 0, 0, CooltrainerMScript_0x195a64, -1 - person_event SPRITE_BLACK_BELT, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, BlackBeltScript_0x195a67, -1 + person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x195a5d, -1 + person_event SPRITE_COOLTRAINER_M, 6, 7, $5, 0, 2, -1, -1, 0, 0, 0, CooltrainerMScript_0x195a64, -1 + person_event SPRITE_BLACK_BELT, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, BlackBeltScript_0x195a67, -1 diff --git a/maps/BlackthornPokeCenter1F.asm b/maps/BlackthornPokeCenter1F.asm index 80b418234..0c441b42d 100644 --- a/maps/BlackthornPokeCenter1F.asm +++ b/maps/BlackthornPokeCenter1F.asm @@ -61,7 +61,7 @@ BlackthornPokeCenter1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x195b79, -1 - person_event SPRITE_GENTLEMAN, 7, 9, $6, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x195b7c, -1 - person_event SPRITE_TWIN, 8, 5, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TwinScript_0x195b7f, -1 - person_event SPRITE_COOLTRAINER_M, 10, 11, $5, 0, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerMScript_0x195b82, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x195b79, -1 + person_event SPRITE_GENTLEMAN, 3, 5, $6, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x195b7c, -1 + person_event SPRITE_TWIN, 4, 1, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TwinScript_0x195b7f, -1 + person_event SPRITE_COOLTRAINER_M, 6, 7, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerMScript_0x195b82, -1 diff --git a/maps/BluesHouse.asm b/maps/BluesHouse.asm index 6639cbfc3..40ff945ae 100644 --- a/maps/BluesHouse.asm +++ b/maps/BluesHouse.asm @@ -158,4 +158,4 @@ BluesHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_DAISY, 7, 6, $3, 0, 0, -1, -1, 0, 0, 0, DaisyScript_0x19b0d0, -1 + person_event SPRITE_DAISY, 3, 2, $3, 0, 0, -1, -1, 0, 0, 0, DaisyScript_0x19b0d0, -1 diff --git a/maps/BrunosRoom.asm b/maps/BrunosRoom.asm index 6b2b38ca7..d01c549e2 100644 --- a/maps/BrunosRoom.asm +++ b/maps/BrunosRoom.asm @@ -145,4 +145,4 @@ BrunosRoom_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_BRUNO, 11, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, BrunoScript_0x1809c5, -1 + person_event SPRITE_BRUNO, 7, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, BrunoScript_0x1809c5, -1 diff --git a/maps/BurnedTower1F.asm b/maps/BurnedTower1F.asm index 27041572e..7bb2a3ed8 100644 --- a/maps/BurnedTower1F.asm +++ b/maps/BurnedTower1F.asm @@ -309,8 +309,8 @@ BurnedTower1F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_ROCK, 8, 19, $18, 0, 0, -1, -1, 0, 0, 0, BurnedTower1FRock, -1 - person_event SPRITE_SUPER_NERD, 16, 16, $3, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SuperNerdScript_0x185cbc, EVENT_BURNED_TOWER_1F_EUSINE - person_event SPRITE_SILVER, 13, 12, $8, 0, 0, -1, -1, 0, 2, 3, ObjectEvent, EVENT_RIVAL_BURNED_TOWER - person_event SPRITE_MORTY, 18, 18, $2, 1, 1, -1, -1, 8 + PAL_OW_BROWN, 0, 0, MortyScript_0x185cbf, EVENT_BURNED_TOWER_MORTY - person_event SPRITE_POKE_BALL, 6, 18, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185ccb, EVENT_BURNED_TOWER_1F_HP_UP + person_event SPRITE_ROCK, 4, 15, $18, 0, 0, -1, -1, 0, 0, 0, BurnedTower1FRock, -1 + person_event SPRITE_SUPER_NERD, 12, 12, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SuperNerdScript_0x185cbc, EVENT_BURNED_TOWER_1F_EUSINE + person_event SPRITE_SILVER, 9, 8, $8, 0, 0, -1, -1, 0, 2, 3, ObjectEvent, EVENT_RIVAL_BURNED_TOWER + person_event SPRITE_MORTY, 14, 14, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, MortyScript_0x185cbf, EVENT_BURNED_TOWER_MORTY + person_event SPRITE_POKE_BALL, 2, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185ccb, EVENT_BURNED_TOWER_1F_HP_UP diff --git a/maps/BurnedTowerB1F.asm b/maps/BurnedTowerB1F.asm index d154836e2..fe4adc591 100644 --- a/maps/BurnedTowerB1F.asm +++ b/maps/BurnedTowerB1F.asm @@ -251,12 +251,12 @@ BurnedTowerB1F_MapEventHeader: .PersonEvents: db 9 - person_event SPRITE_BOULDER, 12, 21, $19, 0, 0, -1, -1, 0, 0, 0, BurnedTowerB1FBoulder, -1 - person_event SPRITE_RAIKOU, 7, 11, $16, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, ObjectEvent, EVENT_BURNED_TOWER_B1F_BEASTS_1 - person_event SPRITE_ENTEI, 7, 16, $16, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ObjectEvent, EVENT_BURNED_TOWER_B1F_BEASTS_1 - person_event SPRITE_SUICUNE, 8, 14, $16, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_BURNED_TOWER_B1F_BEASTS_1 - person_event SPRITE_RAIKOU, 7, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_SILVER, 0, 0, ObjectEvent, EVENT_BURNED_TOWER_B1F_BEASTS_2 - person_event SPRITE_ENTEI, 7, 16, $6, 0, 0, -1, -1, 8 + PAL_OW_SILVER, 0, 0, ObjectEvent, EVENT_BURNED_TOWER_B1F_BEASTS_2 - person_event SPRITE_SUICUNE, 8, 14, $6, 0, 0, -1, -1, 8 + PAL_OW_SILVER, 0, 0, ObjectEvent, EVENT_BURNED_TOWER_B1F_BEASTS_2 - person_event SPRITE_POKE_BALL, 8, 20, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x186231, EVENT_BURNED_TOWER_B1F_TM_ENDURE - person_event SPRITE_SUPER_NERD, 16, 14, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SuperNerdScript_0x186212, EVENT_EUSINE_IN_BURNED_TOWER + person_event SPRITE_BOULDER, 8, 17, $19, 0, 0, -1, -1, 0, 0, 0, BurnedTowerB1FBoulder, -1 + person_event SPRITE_RAIKOU, 3, 7, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, ObjectEvent, EVENT_BURNED_TOWER_B1F_BEASTS_1 + person_event SPRITE_ENTEI, 3, 12, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ObjectEvent, EVENT_BURNED_TOWER_B1F_BEASTS_1 + person_event SPRITE_SUICUNE, 4, 10, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_BURNED_TOWER_B1F_BEASTS_1 + person_event SPRITE_RAIKOU, 3, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_SILVER, 0, 0, ObjectEvent, EVENT_BURNED_TOWER_B1F_BEASTS_2 + person_event SPRITE_ENTEI, 3, 12, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_SILVER, 0, 0, ObjectEvent, EVENT_BURNED_TOWER_B1F_BEASTS_2 + person_event SPRITE_SUICUNE, 4, 10, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_SILVER, 0, 0, ObjectEvent, EVENT_BURNED_TOWER_B1F_BEASTS_2 + person_event SPRITE_POKE_BALL, 4, 16, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x186231, EVENT_BURNED_TOWER_B1F_TM_ENDURE + person_event SPRITE_SUPER_NERD, 12, 10, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SuperNerdScript_0x186212, EVENT_EUSINE_IN_BURNED_TOWER diff --git a/maps/CeladonCafe.asm b/maps/CeladonCafe.asm index a60af750e..22ca25fa4 100644 --- a/maps/CeladonCafe.asm +++ b/maps/CeladonCafe.asm @@ -219,8 +219,8 @@ CeladonCafe_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_SUPER_NERD, 7, 13, $8, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, SuperNerdScript_0x73049, -1 - person_event SPRITE_FISHER, 10, 8, $8, 0, 0, -1, -1, 0, 0, 0, FisherScript_0x73051, -1 - person_event SPRITE_FISHER, 11, 5, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FisherScript_0x73062, -1 - person_event SPRITE_FISHER, 6, 5, $9, 0, 0, -1, -1, 0, 0, 0, FisherScript_0x73073, -1 - person_event SPRITE_TEACHER, 7, 8, $8, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x73084, -1 + person_event SPRITE_SUPER_NERD, 3, 9, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, SuperNerdScript_0x73049, -1 + person_event SPRITE_FISHER, 6, 4, $8, 0, 0, -1, -1, 0, 0, 0, FisherScript_0x73051, -1 + person_event SPRITE_FISHER, 7, 1, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FisherScript_0x73062, -1 + person_event SPRITE_FISHER, 2, 1, $9, 0, 0, -1, -1, 0, 0, 0, FisherScript_0x73073, -1 + person_event SPRITE_TEACHER, 3, 4, $8, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x73084, -1 diff --git a/maps/CeladonCity.asm b/maps/CeladonCity.asm index ab21a4741..1298c5833 100644 --- a/maps/CeladonCity.asm +++ b/maps/CeladonCity.asm @@ -257,12 +257,12 @@ CeladonCity_MapEventHeader: .PersonEvents: db 9 - person_event SPRITE_FISHER, 15, 30, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FisherScript_0x1a9f43, -1 - person_event SPRITE_POLIWAG, 15, 31, $16, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, CeladonCityPoliwrath, -1 - person_event SPRITE_TEACHER, 28, 24, $5, 0, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, TeacherScript_0x1a9f50, -1 - person_event SPRITE_GRAMPS, 20, 18, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, GrampsScript_0x1a9f53, -1 - person_event SPRITE_GRAMPS, 35, 12, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, GrampsScript_0x1a9f56, -1 - person_event SPRITE_YOUNGSTER, 17, 22, $5, 0, 2, -1, -1, 8 + PAL_OW_BLUE, 0, 0, YoungsterScript_0x1a9f59, -1 - person_event SPRITE_YOUNGSTER, 37, 28, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x1a9f5c, -1 - person_event SPRITE_TEACHER, 18, 10, $2, 2, 2, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TeacherScript_0x1a9f5f, -1 - person_event SPRITE_LASS, 26, 11, $4, 2, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, LassScript_0x1a9f62, -1 + person_event SPRITE_FISHER, 11, 26, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FisherScript_0x1a9f43, -1 + person_event SPRITE_POLIWAG, 11, 27, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, CeladonCityPoliwrath, -1 + person_event SPRITE_TEACHER, 24, 20, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, TeacherScript_0x1a9f50, -1 + person_event SPRITE_GRAMPS, 16, 14, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, GrampsScript_0x1a9f53, -1 + person_event SPRITE_GRAMPS, 31, 8, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, GrampsScript_0x1a9f56, -1 + person_event SPRITE_YOUNGSTER, 13, 18, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, YoungsterScript_0x1a9f59, -1 + person_event SPRITE_YOUNGSTER, 33, 24, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x1a9f5c, -1 + person_event SPRITE_TEACHER, 14, 6, $2, 2, 2, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TeacherScript_0x1a9f5f, -1 + person_event SPRITE_LASS, 22, 7, $4, 2, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, LassScript_0x1a9f62, -1 diff --git a/maps/CeladonDeptStore1F.asm b/maps/CeladonDeptStore1F.asm index 926881117..3f8250c66 100644 --- a/maps/CeladonDeptStore1F.asm +++ b/maps/CeladonDeptStore1F.asm @@ -89,6 +89,6 @@ CeladonDeptStore1F_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_RECEPTIONIST, 5, 14, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ReceptionistScript_0x709e0, -1 - person_event SPRITE_GENTLEMAN, 8, 15, $2, 1, 1, -1, -1, 0, 0, 0, GentlemanScript_0x709e3, -1 - person_event SPRITE_TEACHER, 7, 9, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TeacherScript_0x709e6, -1 + person_event SPRITE_RECEPTIONIST, 1, 10, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ReceptionistScript_0x709e0, -1 + person_event SPRITE_GENTLEMAN, 4, 11, $2, 1, 1, -1, -1, 0, 0, 0, GentlemanScript_0x709e3, -1 + person_event SPRITE_TEACHER, 3, 5, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TeacherScript_0x709e6, -1 diff --git a/maps/CeladonDeptStore2F.asm b/maps/CeladonDeptStore2F.asm index 05bacb1b1..5124f6f43 100644 --- a/maps/CeladonDeptStore2F.asm +++ b/maps/CeladonDeptStore2F.asm @@ -82,7 +82,7 @@ CeladonDeptStore2F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_CLERK, 9, 17, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ClerkScript_0x70bad, -1 - person_event SPRITE_CLERK, 9, 18, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ClerkScript_0x70bb5, -1 - person_event SPRITE_POKEFAN_M, 6, 9, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, PokefanMScript_0x70bbd, -1 - person_event SPRITE_YOUNGSTER, 6, 10, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x70bc0, -1 + person_event SPRITE_CLERK, 5, 13, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ClerkScript_0x70bad, -1 + person_event SPRITE_CLERK, 5, 14, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ClerkScript_0x70bb5, -1 + person_event SPRITE_POKEFAN_M, 2, 5, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PokefanMScript_0x70bbd, -1 + person_event SPRITE_YOUNGSTER, 2, 6, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x70bc0, -1 diff --git a/maps/CeladonDeptStore3F.asm b/maps/CeladonDeptStore3F.asm index afabcd40f..c36b713ba 100644 --- a/maps/CeladonDeptStore3F.asm +++ b/maps/CeladonDeptStore3F.asm @@ -107,8 +107,8 @@ CeladonDeptStore3F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_CLERK, 5, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ClerkScript_0x70d29, -1 - person_event SPRITE_YOUNGSTER, 8, 10, $4, 1, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x70d31, -1 - person_event SPRITE_GAMEBOY_KID, 5, 13, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, GameboyKidScript_0x70d34, -1 - person_event SPRITE_GAMEBOY_KID, 5, 14, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GameboyKidScript_0x70d3f, -1 - person_event SPRITE_SUPER_NERD, 8, 17, $2, 1, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, SuperNerdScript_0x70d4a, -1 + person_event SPRITE_CLERK, 1, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ClerkScript_0x70d29, -1 + person_event SPRITE_YOUNGSTER, 4, 6, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x70d31, -1 + person_event SPRITE_GAMEBOY_KID, 1, 9, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, GameboyKidScript_0x70d34, -1 + person_event SPRITE_GAMEBOY_KID, 1, 10, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GameboyKidScript_0x70d3f, -1 + person_event SPRITE_SUPER_NERD, 4, 13, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SuperNerdScript_0x70d4a, -1 diff --git a/maps/CeladonDeptStore4F.asm b/maps/CeladonDeptStore4F.asm index 36fac756a..99741b408 100644 --- a/maps/CeladonDeptStore4F.asm +++ b/maps/CeladonDeptStore4F.asm @@ -65,6 +65,6 @@ CeladonDeptStore4F_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 9, 17, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ClerkScript_0x70f0d, -1 - person_event SPRITE_SUPER_NERD, 10, 11, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, SuperNerdScript_0x70f15, -1 - person_event SPRITE_YOUNGSTER, 6, 12, $7, 0, 0, -1, -1, 0, 0, 0, YoungsterScript_0x70f18, -1 + person_event SPRITE_CLERK, 5, 13, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ClerkScript_0x70f0d, -1 + person_event SPRITE_SUPER_NERD, 6, 7, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, SuperNerdScript_0x70f15, -1 + person_event SPRITE_YOUNGSTER, 2, 8, $7, 0, 0, -1, -1, 0, 0, 0, YoungsterScript_0x70f18, -1 diff --git a/maps/CeladonDeptStore5F.asm b/maps/CeladonDeptStore5F.asm index 5291b5c76..94af06d81 100644 --- a/maps/CeladonDeptStore5F.asm +++ b/maps/CeladonDeptStore5F.asm @@ -84,8 +84,8 @@ CeladonDeptStore5F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_CLERK, 9, 11, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ClerkScript_0x71004, -1 - person_event SPRITE_CLERK, 9, 12, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ClerkScript_0x7100c, -1 - person_event SPRITE_GENTLEMAN, 9, 17, $2, 1, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, GentlemanScript_0x71014, -1 - person_event SPRITE_SAILOR, 8, 7, $2, 1, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SailorScript_0x71017, -1 - person_event SPRITE_TEACHER, 11, 5, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TeacherScript_0x7101a, -1 + person_event SPRITE_CLERK, 5, 7, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ClerkScript_0x71004, -1 + person_event SPRITE_CLERK, 5, 8, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ClerkScript_0x7100c, -1 + person_event SPRITE_GENTLEMAN, 5, 13, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, GentlemanScript_0x71014, -1 + person_event SPRITE_SAILOR, 4, 3, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SailorScript_0x71017, -1 + person_event SPRITE_TEACHER, 7, 1, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TeacherScript_0x7101a, -1 diff --git a/maps/CeladonDeptStore6F.asm b/maps/CeladonDeptStore6F.asm index 0dff44d4e..2eff882e8 100644 --- a/maps/CeladonDeptStore6F.asm +++ b/maps/CeladonDeptStore6F.asm @@ -168,5 +168,5 @@ CeladonDeptStore6F_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_SUPER_NERD, 6, 13, $7, 0, 0, -1, -1, 0, 0, 0, SuperNerdScript_0x7117a, -1 - person_event SPRITE_YOUNGSTER, 9, 16, $2, 1, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x7117d, -1 + person_event SPRITE_SUPER_NERD, 2, 9, $7, 0, 0, -1, -1, 0, 0, 0, SuperNerdScript_0x7117a, -1 + person_event SPRITE_YOUNGSTER, 5, 12, $2, 1, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x7117d, -1 diff --git a/maps/CeladonGameCorner.asm b/maps/CeladonGameCorner.asm index 7880ce989..4f4746f24 100644 --- a/maps/CeladonGameCorner.asm +++ b/maps/CeladonGameCorner.asm @@ -325,12 +325,12 @@ CeladonGameCorner_MapEventHeader: .PersonEvents: db 9 - person_event SPRITE_CLERK, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ClerkScript_0x7211d, -1 - person_event SPRITE_RECEPTIONIST, 6, 7, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ReceptionistScript_0x72120, -1 - person_event SPRITE_POKEFAN_M, 14, 18, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, PokefanMScript_0x72123, -1 - person_event SPRITE_TEACHER, 11, 21, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, TeacherScript_0x7212e, -1 - person_event SPRITE_FISHING_GURU, 11, 15, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FishingGuruScript_0x72139, -1 - person_event SPRITE_FISHER, 14, 12, $8, 0, 0, -1, 2, 8 + PAL_OW_RED, 0, 0, FisherScript_0x72144, -1 - person_event SPRITE_FISHER, 14, 12, $8, 0, 0, -1, 4, 8 + PAL_OW_RED, 0, 0, FisherScript_0x72144, -1 - person_event SPRITE_GYM_GUY, 7, 15, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, CeladonGymGuyScript, -1 - person_event SPRITE_GRAMPS, 12, 6, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, GrampsScript_0x72190, -1 + person_event SPRITE_CLERK, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ClerkScript_0x7211d, -1 + person_event SPRITE_RECEPTIONIST, 2, 3, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ReceptionistScript_0x72120, -1 + person_event SPRITE_POKEFAN_M, 10, 14, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PokefanMScript_0x72123, -1 + person_event SPRITE_TEACHER, 7, 17, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, TeacherScript_0x7212e, -1 + person_event SPRITE_FISHING_GURU, 7, 11, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FishingGuruScript_0x72139, -1 + person_event SPRITE_FISHER, 10, 8, $8, 0, 0, -1, 2, (1 << 3) | PAL_OW_RED, 0, 0, FisherScript_0x72144, -1 + person_event SPRITE_FISHER, 10, 8, $8, 0, 0, -1, 4, (1 << 3) | PAL_OW_RED, 0, 0, FisherScript_0x72144, -1 + person_event SPRITE_GYM_GUY, 3, 11, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CeladonGymGuyScript, -1 + person_event SPRITE_GRAMPS, 8, 2, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, GrampsScript_0x72190, -1 diff --git a/maps/CeladonGameCornerPrizeRoom.asm b/maps/CeladonGameCornerPrizeRoom.asm index 2b8267f79..83f92f2d3 100644 --- a/maps/CeladonGameCornerPrizeRoom.asm +++ b/maps/CeladonGameCornerPrizeRoom.asm @@ -17,82 +17,82 @@ MapCeladonGameCornerPrizeRoomSignpost0Script: writetext UnknownText_0x7293e closetext checkitem COIN_CASE - iffalse UnknownScript_0x7278a + iffalse CeladonPrizeRoom_NoCoinCase writetext UnknownText_0x72974 -UnknownScript_0x726fd: - special Function24b25 +CeladonPrizeRoom_tmcounterloop: + special Special_DisplayCoinCaseBalance loadmenudata MenuDataHeader_0x72790 interpretmenu2 writebackup - if_equal $1, UnknownScript_0x72714 - if_equal $2, UnknownScript_0x72730 - if_equal $3, UnknownScript_0x7274c - jump UnknownScript_0x72784 + if_equal $1, .doubleteam + if_equal $2, .psychic + if_equal $3, .hyperbeam + jump CeladonPrizeRoom_cancel -UnknownScript_0x72714: +.doubleteam: checkcoins 1500 - if_equal $2, UnknownScript_0x72778 + if_equal $2, CeladonPrizeRoom_notenoughcoins itemtotext TM_DOUBLE_TEAM, $0 - scall UnknownScript_0x72768 - iffalse UnknownScript_0x72784 - giveitem TM_DOUBLE_TEAM, $1 - iffalse UnknownScript_0x7277e + scall CeladonPrizeRoom_askbuy + iffalse CeladonPrizeRoom_cancel + giveitem TM_DOUBLE_TEAM, 1 + iffalse CeladonPrizeRoom_notenoughroom takecoins 1500 - jump UnknownScript_0x7276d + jump CeladonPrizeRoom_purchased -UnknownScript_0x72730: +.psychic: checkcoins 3500 - if_equal $2, UnknownScript_0x72778 + if_equal $2, CeladonPrizeRoom_notenoughcoins itemtotext TM_PSYCHIC, $0 - scall UnknownScript_0x72768 - iffalse UnknownScript_0x72784 - giveitem TM_PSYCHIC, $1 - iffalse UnknownScript_0x7277e + scall CeladonPrizeRoom_askbuy + iffalse CeladonPrizeRoom_cancel + giveitem TM_PSYCHIC, 1 + iffalse CeladonPrizeRoom_notenoughroom takecoins 3500 - jump UnknownScript_0x7276d + jump CeladonPrizeRoom_purchased -UnknownScript_0x7274c: +.hyperbeam: checkcoins 7500 - if_equal $2, UnknownScript_0x72778 + if_equal $2, CeladonPrizeRoom_notenoughcoins itemtotext TM_HYPER_BEAM, $0 - scall UnknownScript_0x72768 - iffalse UnknownScript_0x72784 - giveitem TM_HYPER_BEAM, $1 - iffalse UnknownScript_0x7277e + scall CeladonPrizeRoom_askbuy + iffalse CeladonPrizeRoom_cancel + giveitem TM_HYPER_BEAM, 1 + iffalse CeladonPrizeRoom_notenoughroom takecoins 7500 - jump UnknownScript_0x7276d + jump CeladonPrizeRoom_purchased -UnknownScript_0x72768: +CeladonPrizeRoom_askbuy: writetext UnknownText_0x72991 yesorno end -UnknownScript_0x7276d: +CeladonPrizeRoom_purchased: waitbutton playsound SFX_TRANSACTION writetext UnknownText_0x729ad closetext - jump UnknownScript_0x726fd + jump CeladonPrizeRoom_tmcounterloop -UnknownScript_0x72778: +CeladonPrizeRoom_notenoughcoins: writetext UnknownText_0x729bb closetext loadmovesprites end -UnknownScript_0x7277e: +CeladonPrizeRoom_notenoughroom: writetext UnknownText_0x729d8 closetext loadmovesprites end -UnknownScript_0x72784: +CeladonPrizeRoom_cancel: writetext UnknownText_0x729f2 closetext loadmovesprites end -UnknownScript_0x7278a: +CeladonPrizeRoom_NoCoinCase: writetext UnknownText_0x72a14 closetext loadmovesprites @@ -121,26 +121,26 @@ MapCeladonGameCornerPrizeRoomSignpost1Script: writetext UnknownText_0x7293e closetext checkitem COIN_CASE - iffalse UnknownScript_0x7278a -UnknownScript_0x727d3: + iffalse CeladonPrizeRoom_NoCoinCase +.loop: writetext UnknownText_0x72974 - special Function24b25 + special Special_DisplayCoinCaseBalance loadmenudata MenuDataHeader_0x72877 interpretmenu2 writebackup - if_equal $1, UnknownScript_0x727ed - if_equal $2, UnknownScript_0x7281b - if_equal $3, UnknownScript_0x72849 - jump UnknownScript_0x72784 + if_equal $1, .pikachu + if_equal $2, .porygon + if_equal $3, .larvitar + jump CeladonPrizeRoom_cancel -UnknownScript_0x727ed: +.pikachu: checkcoins 2222 - if_equal $2, UnknownScript_0x72778 + if_equal $2, CeladonPrizeRoom_notenoughcoins checkcode VAR_PARTYCOUNT - if_equal $6, UnknownScript_0x7277e + if_equal $6, CeladonPrizeRoom_notenoughroom pokenamemem PIKACHU, $0 - scall UnknownScript_0x72768 - iffalse UnknownScript_0x72784 + scall CeladonPrizeRoom_askbuy + iffalse CeladonPrizeRoom_cancel waitbutton playsound SFX_TRANSACTION writetext UnknownText_0x729ad @@ -149,16 +149,16 @@ UnknownScript_0x727ed: special Special_GameCornerPrizeMonCheckDex givepoke PIKACHU, 25 takecoins 2222 - jump UnknownScript_0x727d3 + jump .loop -UnknownScript_0x7281b: +.porygon: checkcoins 5555 - if_equal $2, UnknownScript_0x72778 + if_equal $2, CeladonPrizeRoom_notenoughcoins checkcode VAR_PARTYCOUNT - if_equal $6, UnknownScript_0x7277e + if_equal $6, CeladonPrizeRoom_notenoughroom pokenamemem PORYGON, $0 - scall UnknownScript_0x72768 - iffalse UnknownScript_0x72784 + scall CeladonPrizeRoom_askbuy + iffalse CeladonPrizeRoom_cancel waitbutton playsound SFX_TRANSACTION writetext UnknownText_0x729ad @@ -167,16 +167,16 @@ UnknownScript_0x7281b: special Special_GameCornerPrizeMonCheckDex givepoke PORYGON, 15 takecoins 5555 - jump UnknownScript_0x727d3 + jump .loop -UnknownScript_0x72849: +.larvitar: checkcoins 8888 - if_equal $2, UnknownScript_0x72778 + if_equal $2, CeladonPrizeRoom_notenoughcoins checkcode VAR_PARTYCOUNT - if_equal $6, UnknownScript_0x7277e + if_equal $6, CeladonPrizeRoom_notenoughroom pokenamemem LARVITAR, $0 - scall UnknownScript_0x72768 - iffalse UnknownScript_0x72784 + scall CeladonPrizeRoom_askbuy + iffalse CeladonPrizeRoom_cancel waitbutton playsound SFX_TRANSACTION writetext UnknownText_0x729ad @@ -185,7 +185,7 @@ UnknownScript_0x72849: special Special_GameCornerPrizeMonCheckDex givepoke LARVITAR, 40 takecoins 8888 - jump UnknownScript_0x727d3 + jump .loop MenuDataHeader_0x72877: @@ -284,5 +284,5 @@ CeladonGameCornerPrizeRoom_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_GENTLEMAN, 6, 4, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, GentlemanScript_0x726e9, -1 - person_event SPRITE_PHARMACIST, 8, 8, $4, 1, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, PharmacistScript_0x726ec, -1 + person_event SPRITE_GENTLEMAN, 2, 0, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, GentlemanScript_0x726e9, -1 + person_event SPRITE_PHARMACIST, 4, 4, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, PharmacistScript_0x726ec, -1 diff --git a/maps/CeladonGym.asm b/maps/CeladonGym.asm index 5318a2bbe..d9128f88e 100644 --- a/maps/CeladonGym.asm +++ b/maps/CeladonGym.asm @@ -278,9 +278,9 @@ CeladonGym_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_ERIKA, 7, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ErikaScript_0x72a6a, -1 - person_event SPRITE_LASS, 12, 11, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, TrainerLassMichelle, -1 - person_event SPRITE_LASS, 12, 6, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 2, TrainerPicnickerTanya, -1 - person_event SPRITE_BUENA, 9, 7, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, TrainerBeautyJulia, -1 - person_event SPRITE_TWIN, 14, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerTwinsJoandzoe1, -1 - person_event SPRITE_TWIN, 14, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerTwinsJoandzoe2, -1 + person_event SPRITE_ERIKA, 3, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ErikaScript_0x72a6a, -1 + person_event SPRITE_LASS, 8, 7, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 2, TrainerLassMichelle, -1 + person_event SPRITE_LASS, 8, 2, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 2, TrainerPicnickerTanya, -1 + person_event SPRITE_BUENA, 5, 3, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 2, TrainerBeautyJulia, -1 + person_event SPRITE_TWIN, 10, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerTwinsJoandzoe1, -1 + person_event SPRITE_TWIN, 10, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerTwinsJoandzoe2, -1 diff --git a/maps/CeladonMansion1F.asm b/maps/CeladonMansion1F.asm index cee440abc..26a9a43bf 100644 --- a/maps/CeladonMansion1F.asm +++ b/maps/CeladonMansion1F.asm @@ -91,7 +91,7 @@ CeladonMansion1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_GRANNY, 9, 5, $3, 0, 0, -1, -1, 0, 0, 0, CeladonMansionManager, -1 - person_event SPRITE_GROWLITHE, 10, 6, $16, 0, 0, -1, -1, 0, 0, 0, CeladonMansion1FMeowth, -1 - person_event SPRITE_CLEFAIRY, 8, 7, $16, 0, 0, -1, -1, 0, 0, 0, CeladonMansion1FClefairy, -1 - person_event SPRITE_GROWLITHE, 8, 8, $16, 0, 2, -1, -1, 8 + PAL_OW_BLUE, 0, 0, CeladonMansion1FNidoranF, -1 + person_event SPRITE_GRANNY, 5, 1, $3, 0, 0, -1, -1, 0, 0, 0, CeladonMansionManager, -1 + person_event SPRITE_GROWLITHE, 6, 2, $16, 0, 0, -1, -1, 0, 0, 0, CeladonMansion1FMeowth, -1 + person_event SPRITE_CLEFAIRY, 4, 3, $16, 0, 0, -1, -1, 0, 0, 0, CeladonMansion1FClefairy, -1 + person_event SPRITE_GROWLITHE, 4, 4, $16, 0, 2, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, CeladonMansion1FNidoranF, -1 diff --git a/maps/CeladonMansion3F.asm b/maps/CeladonMansion3F.asm index d64bc8f31..5e12a6349 100644 --- a/maps/CeladonMansion3F.asm +++ b/maps/CeladonMansion3F.asm @@ -206,7 +206,7 @@ CeladonMansion3F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_COOLTRAINER_M, 10, 7, $3, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerMScript_0x71670, -1 - person_event SPRITE_GYM_GUY, 8, 7, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GymGuyScript_0x71696, -1 - person_event SPRITE_SUPER_NERD, 11, 4, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SuperNerdScript_0x716bc, -1 - person_event SPRITE_FISHER, 8, 4, $7, 0, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, FisherScript_0x716bf, -1 + person_event SPRITE_COOLTRAINER_M, 6, 3, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerMScript_0x71670, -1 + person_event SPRITE_GYM_GUY, 4, 3, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GymGuyScript_0x71696, -1 + person_event SPRITE_SUPER_NERD, 7, 0, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SuperNerdScript_0x716bc, -1 + person_event SPRITE_FISHER, 4, 0, $7, 0, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, FisherScript_0x716bf, -1 diff --git a/maps/CeladonMansionRoof.asm b/maps/CeladonMansionRoof.asm index 322114ee8..b2b4f2b95 100644 --- a/maps/CeladonMansionRoof.asm +++ b/maps/CeladonMansionRoof.asm @@ -49,4 +49,4 @@ CeladonMansionRoof_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_FISHER, 9, 11, $4, 1, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, FisherScript_0x71a39, -1 + person_event SPRITE_FISHER, 5, 7, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, FisherScript_0x71a39, -1 diff --git a/maps/CeladonMansionRoofHouse.asm b/maps/CeladonMansionRoofHouse.asm index 1a3d7944b..cc89ba575 100644 --- a/maps/CeladonMansionRoofHouse.asm +++ b/maps/CeladonMansionRoofHouse.asm @@ -130,4 +130,4 @@ CeladonMansionRoofHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_PHARMACIST, 6, 7, $6, 2, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, PharmacistScript_0x71afd, -1 + person_event SPRITE_PHARMACIST, 2, 3, $6, 2, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, PharmacistScript_0x71afd, -1 diff --git a/maps/CeladonPokeCenter1F.asm b/maps/CeladonPokeCenter1F.asm index 2cc47ad65..8142d0d57 100644 --- a/maps/CeladonPokeCenter1F.asm +++ b/maps/CeladonPokeCenter1F.asm @@ -156,8 +156,8 @@ CeladonPokeCenter1F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x71e22, -1 - person_event SPRITE_GENTLEMAN, 9, 5, $5, 0, 1, -1, -1, 0, 0, 0, GentlemanScript_0x71e25, -1 - person_event SPRITE_PHARMACIST, 7, 4, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, PharmacistScript_0x71e2b, -1 - person_event SPRITE_COOLTRAINER_F, 10, 12, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x71e28, -1 - person_event SPRITE_SUPER_NERD, 7, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SuperNerdScript_0x71e2e, EVENT_SET_WHEN_FOUGHT_HO_OH + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x71e22, -1 + person_event SPRITE_GENTLEMAN, 5, 1, $5, 0, 1, -1, -1, 0, 0, 0, GentlemanScript_0x71e25, -1 + person_event SPRITE_PHARMACIST, 3, 0, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PharmacistScript_0x71e2b, -1 + person_event SPRITE_COOLTRAINER_F, 6, 8, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x71e28, -1 + person_event SPRITE_SUPER_NERD, 3, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SuperNerdScript_0x71e2e, EVENT_SET_WHEN_FOUGHT_HO_OH diff --git a/maps/CeruleanCity.asm b/maps/CeruleanCity.asm index b8a48d0a9..ce2c1eb1b 100644 --- a/maps/CeruleanCity.asm +++ b/maps/CeruleanCity.asm @@ -299,9 +299,9 @@ CeruleanCity_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_COOLTRAINER_M, 27, 19, $2, 2, 2, -1, -1, 8 + PAL_OW_BLUE, 0, 0, CooltrainerMScript_0x184009, -1 - person_event SPRITE_SUPER_NERD, 19, 27, $2, 1, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SuperNerdScript_0x18401d, -1 - person_event SPRITE_SLOWPOKE, 28, 24, $1, 0, 0, -1, -1, 0, 0, 0, CeruleanCitySlowbro, -1 - person_event SPRITE_COOLTRAINER_F, 28, 25, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x18402a, -1 - person_event SPRITE_FISHER, 30, 34, $5, 0, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, FisherScript_0x18404a, -1 - person_event SPRITE_YOUNGSTER, 16, 10, $3, 0, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x184064, -1 + person_event SPRITE_COOLTRAINER_M, 23, 15, $2, 2, 2, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, CooltrainerMScript_0x184009, -1 + person_event SPRITE_SUPER_NERD, 15, 23, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SuperNerdScript_0x18401d, -1 + person_event SPRITE_SLOWPOKE, 24, 20, $1, 0, 0, -1, -1, 0, 0, 0, CeruleanCitySlowbro, -1 + person_event SPRITE_COOLTRAINER_F, 24, 21, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x18402a, -1 + person_event SPRITE_FISHER, 26, 30, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, FisherScript_0x18404a, -1 + person_event SPRITE_YOUNGSTER, 12, 6, $3, 0, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x184064, -1 diff --git a/maps/CeruleanGym.asm b/maps/CeruleanGym.asm index a696f81d5..6907f5869 100644 --- a/maps/CeruleanGym.asm +++ b/maps/CeruleanGym.asm @@ -377,9 +377,9 @@ CeruleanGym_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_ROCKET, 14, 8, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_CERULEAN_GYM_ROCKET - person_event SPRITE_MISTY, 7, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, MistyScript_0x188432, EVENT_TRAINERS_IN_CERULEAN_GYM - person_event SPRITE_SWIMMER_GIRL, 10, 8, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerSwimmerfDiana, EVENT_TRAINERS_IN_CERULEAN_GYM - person_event SPRITE_SWIMMER_GIRL, 13, 5, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 1, TrainerSwimmerfBriana, EVENT_TRAINERS_IN_CERULEAN_GYM - person_event SPRITE_SWIMMER_GUY, 13, 12, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerSwimmermParker, EVENT_TRAINERS_IN_CERULEAN_GYM - person_event SPRITE_GYM_GUY, 17, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, CeruleanGymGuyScript, EVENT_TRAINERS_IN_CERULEAN_GYM + person_event SPRITE_ROCKET, 10, 4, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_CERULEAN_GYM_ROCKET + person_event SPRITE_MISTY, 3, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, MistyScript_0x188432, EVENT_TRAINERS_IN_CERULEAN_GYM + person_event SPRITE_SWIMMER_GIRL, 6, 4, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerSwimmerfDiana, EVENT_TRAINERS_IN_CERULEAN_GYM + person_event SPRITE_SWIMMER_GIRL, 9, 1, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 1, TrainerSwimmerfBriana, EVENT_TRAINERS_IN_CERULEAN_GYM + person_event SPRITE_SWIMMER_GUY, 9, 8, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerSwimmermParker, EVENT_TRAINERS_IN_CERULEAN_GYM + person_event SPRITE_GYM_GUY, 13, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, CeruleanGymGuyScript, EVENT_TRAINERS_IN_CERULEAN_GYM diff --git a/maps/CeruleanGymBadgeSpeechHouse.asm b/maps/CeruleanGymBadgeSpeechHouse.asm index fb37ba36a..6697c4242 100644 --- a/maps/CeruleanGymBadgeSpeechHouse.asm +++ b/maps/CeruleanGymBadgeSpeechHouse.asm @@ -30,4 +30,4 @@ CeruleanGymBadgeSpeechHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKEFAN_M, 7, 6, $9, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x188002, -1 + person_event SPRITE_POKEFAN_M, 3, 2, $9, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x188002, -1 diff --git a/maps/CeruleanMart.asm b/maps/CeruleanMart.asm index bb290c68b..e1824e5be 100644 --- a/maps/CeruleanMart.asm +++ b/maps/CeruleanMart.asm @@ -57,6 +57,6 @@ CeruleanMart_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x188ac0, -1 - person_event SPRITE_COOLTRAINER_M, 10, 5, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CooltrainerMScript_0x188ac7, -1 - person_event SPRITE_COOLTRAINER_F, 6, 11, $5, 0, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerFScript_0x188aca, -1 + person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x188ac0, -1 + person_event SPRITE_COOLTRAINER_M, 6, 1, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CooltrainerMScript_0x188ac7, -1 + person_event SPRITE_COOLTRAINER_F, 2, 7, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerFScript_0x188aca, -1 diff --git a/maps/CeruleanPokeCenter1F.asm b/maps/CeruleanPokeCenter1F.asm index 3078f9150..ea636a3b8 100644 --- a/maps/CeruleanPokeCenter1F.asm +++ b/maps/CeruleanPokeCenter1F.asm @@ -75,6 +75,6 @@ CeruleanPokeCenter1F_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x18820f, -1 - person_event SPRITE_SUPER_NERD, 8, 12, $5, 0, 1, -1, -1, 0, 0, 0, SuperNerdScript_0x188212, -1 - person_event SPRITE_GYM_GUY, 9, 5, $2, 1, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, GymGuyScript_0x18821e, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x18820f, -1 + person_event SPRITE_SUPER_NERD, 4, 8, $5, 0, 1, -1, -1, 0, 0, 0, SuperNerdScript_0x188212, -1 + person_event SPRITE_GYM_GUY, 5, 1, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, GymGuyScript_0x18821e, -1 diff --git a/maps/CeruleanPoliceStation.asm b/maps/CeruleanPoliceStation.asm index 7d5f8ea2c..a79a679f5 100644 --- a/maps/CeruleanPoliceStation.asm +++ b/maps/CeruleanPoliceStation.asm @@ -55,6 +55,6 @@ CeruleanPoliceStation_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_FISHING_GURU, 5, 9, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FishingGuruScript_0x18804a, -1 - person_event SPRITE_POKEFAN_F, 8, 9, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, PokefanFScript_0x18804d, -1 - person_event SPRITE_DIGLETT, 9, 7, $16, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, DiglettScript_0x188050, -1 + person_event SPRITE_FISHING_GURU, 1, 5, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FishingGuruScript_0x18804a, -1 + person_event SPRITE_POKEFAN_F, 4, 5, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, PokefanFScript_0x18804d, -1 + person_event SPRITE_DIGLETT, 5, 3, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, DiglettScript_0x188050, -1 diff --git a/maps/CeruleanTradeSpeechHouse.asm b/maps/CeruleanTradeSpeechHouse.asm index 18c79bbc7..aa063b1fe 100644 --- a/maps/CeruleanTradeSpeechHouse.asm +++ b/maps/CeruleanTradeSpeechHouse.asm @@ -64,7 +64,7 @@ CeruleanTradeSpeechHouse_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_GRANNY, 8, 6, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GrannyScript_0x188133, -1 - person_event SPRITE_GRAMPS, 6, 5, $2, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, GrampsScript_0x188136, -1 - person_event SPRITE_RHYDON, 6, 9, $16, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, RhydonScript_0x188139, -1 - person_event SPRITE_ZUBAT, 10, 9, $16, 0, 0, -1, -1, 0, 0, 0, ZubatScript_0x188143, -1 + person_event SPRITE_GRANNY, 4, 2, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GrannyScript_0x188133, -1 + person_event SPRITE_GRAMPS, 2, 1, $2, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, GrampsScript_0x188136, -1 + person_event SPRITE_RHYDON, 2, 5, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, RhydonScript_0x188139, -1 + person_event SPRITE_ZUBAT, 6, 5, $16, 0, 0, -1, -1, 0, 0, 0, ZubatScript_0x188143, -1 diff --git a/maps/CharcoalKiln.asm b/maps/CharcoalKiln.asm index 697a7f41e..7cd0bbcd3 100644 --- a/maps/CharcoalKiln.asm +++ b/maps/CharcoalKiln.asm @@ -163,6 +163,6 @@ CharcoalKiln_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_BLACK_BELT, 7, 6, $3, 0, 0, -1, -1, 0, 0, 0, CharcoalKilnBoss, EVENT_CHARCOAL_KILN_BOSS - person_event SPRITE_YOUNGSTER, 7, 9, $2, 1, 1, -1, -1, 0, 0, 0, CharcoalKilnApprentice, EVENT_CHARCOAL_KILN_APPRENTICE - person_event SPRITE_MOLTRES, 10, 9, $16, 2, 2, -1, -1, 8 + PAL_OW_BROWN, 0, 0, CharcoalKilnFarfetchd, EVENT_CHARCOAL_KILN_FARFETCH_D + person_event SPRITE_BLACK_BELT, 3, 2, $3, 0, 0, -1, -1, 0, 0, 0, CharcoalKilnBoss, EVENT_CHARCOAL_KILN_BOSS + person_event SPRITE_YOUNGSTER, 3, 5, $2, 1, 1, -1, -1, 0, 0, 0, CharcoalKilnApprentice, EVENT_CHARCOAL_KILN_APPRENTICE + person_event SPRITE_MOLTRES, 6, 5, $16, 2, 2, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, CharcoalKilnFarfetchd, EVENT_CHARCOAL_KILN_FARFETCH_D diff --git a/maps/CherrygroveCity.asm b/maps/CherrygroveCity.asm index 1e6ce394f..f90c6f49f 100644 --- a/maps/CherrygroveCity.asm +++ b/maps/CherrygroveCity.asm @@ -570,8 +570,8 @@ CherrygroveCity_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_GRAMPS, 10, 36, $6, 0, 0, -1, -1, 0, 0, 0, CherrygroveCityGuideGent, EVENT_GUIDE_GENT_IN_HIS_HOUSE - person_event SPRITE_SILVER, 10, 43, $3, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_CHERRYGROVE_CITY - person_event SPRITE_TEACHER, 16, 31, $5, 0, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, TeacherScript_0x19c146, -1 - person_event SPRITE_YOUNGSTER, 11, 27, $5, 0, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x19c15a, -1 - person_event SPRITE_FISHER, 16, 11, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, MysticWaterGuy, -1 + person_event SPRITE_GRAMPS, 6, 32, $6, 0, 0, -1, -1, 0, 0, 0, CherrygroveCityGuideGent, EVENT_GUIDE_GENT_IN_HIS_HOUSE + person_event SPRITE_SILVER, 6, 39, $3, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_CHERRYGROVE_CITY + person_event SPRITE_TEACHER, 12, 27, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, TeacherScript_0x19c146, -1 + person_event SPRITE_YOUNGSTER, 7, 23, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x19c15a, -1 + person_event SPRITE_FISHER, 12, 7, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, MysticWaterGuy, -1 diff --git a/maps/CherrygroveEvolutionSpeechHouse.asm b/maps/CherrygroveEvolutionSpeechHouse.asm index c95144c3d..028842eba 100644 --- a/maps/CherrygroveEvolutionSpeechHouse.asm +++ b/maps/CherrygroveEvolutionSpeechHouse.asm @@ -56,5 +56,5 @@ CherrygroveEvolutionSpeechHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_LASS, 9, 7, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LassScript_0x196cb9, -1 - person_event SPRITE_YOUNGSTER, 9, 6, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x196cb2, -1 + person_event SPRITE_LASS, 5, 3, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LassScript_0x196cb9, -1 + person_event SPRITE_YOUNGSTER, 5, 2, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x196cb2, -1 diff --git a/maps/CherrygroveGymSpeechHouse.asm b/maps/CherrygroveGymSpeechHouse.asm index f02546ae2..852d2c33b 100644 --- a/maps/CherrygroveGymSpeechHouse.asm +++ b/maps/CherrygroveGymSpeechHouse.asm @@ -59,5 +59,5 @@ CherrygroveGymSpeechHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_POKEFAN_M, 7, 6, $6, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x196ae1, -1 - person_event SPRITE_BUG_CATCHER, 9, 9, $5, 0, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, BugCatcherScript_0x196ae4, -1 + person_event SPRITE_POKEFAN_M, 3, 2, $6, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x196ae1, -1 + person_event SPRITE_BUG_CATCHER, 5, 5, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, BugCatcherScript_0x196ae4, -1 diff --git a/maps/CherrygroveMart.asm b/maps/CherrygroveMart.asm index 1a0b3de01..7c35c3b34 100644 --- a/maps/CherrygroveMart.asm +++ b/maps/CherrygroveMart.asm @@ -83,6 +83,6 @@ CherrygroveMart_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x19680a, -1 - person_event SPRITE_COOLTRAINER_M, 10, 11, $5, 0, 2, -1, -1, 0, 0, 0, CooltrainerMScript_0x19681d, -1 - person_event SPRITE_YOUNGSTER, 9, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x196831, -1 + person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x19680a, -1 + person_event SPRITE_COOLTRAINER_M, 6, 7, $5, 0, 2, -1, -1, 0, 0, 0, CooltrainerMScript_0x19681d, -1 + person_event SPRITE_YOUNGSTER, 5, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x196831, -1 diff --git a/maps/CherrygrovePokeCenter1F.asm b/maps/CherrygrovePokeCenter1F.asm index 4d7dce185..4b250f2ad 100644 --- a/maps/CherrygrovePokeCenter1F.asm +++ b/maps/CherrygrovePokeCenter1F.asm @@ -80,7 +80,7 @@ CherrygrovePokeCenter1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x19696d, -1 - person_event SPRITE_FISHER, 7, 6, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, FisherScript_0x196970, -1 - person_event SPRITE_GENTLEMAN, 10, 12, $7, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x196973, -1 - person_event SPRITE_TEACHER, 10, 5, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TeacherScript_0x196976, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x19696d, -1 + person_event SPRITE_FISHER, 3, 2, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, FisherScript_0x196970, -1 + person_event SPRITE_GENTLEMAN, 6, 8, $7, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x196973, -1 + person_event SPRITE_TEACHER, 6, 1, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TeacherScript_0x196976, -1 diff --git a/maps/CianwoodCity.asm b/maps/CianwoodCity.asm index a872d295b..1efd4ff4e 100644 --- a/maps/CianwoodCity.asm +++ b/maps/CianwoodCity.asm @@ -401,15 +401,15 @@ CianwoodCity_MapEventHeader: .PersonEvents: db 12 - person_event SPRITE_STANDING_YOUNGSTER, 41, 25, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, StandingYoungsterScript_0x1a00b3, -1 - person_event SPRITE_POKEFAN_M, 37, 21, $5, 0, 1, -1, -1, 0, 0, 0, PokefanMScript_0x1a00b6, -1 - person_event SPRITE_LASS, 46, 18, $4, 2, 0, -1, -1, 0, 0, 0, LassScript_0x1a00b9, -1 - person_event SPRITE_ROCK, 20, 12, $18, 0, 0, -1, -1, 0, 0, 0, CianwoodCityRock, -1 - person_event SPRITE_ROCK, 21, 13, $18, 0, 0, -1, -1, 0, 0, 0, CianwoodCityRock, -1 - person_event SPRITE_ROCK, 29, 8, $18, 0, 0, -1, -1, 0, 0, 0, CianwoodCityRock, -1 - person_event SPRITE_ROCK, 33, 9, $18, 0, 0, -1, -1, 0, 0, 0, CianwoodCityRock, -1 - person_event SPRITE_ROCK, 31, 14, $18, 0, 0, -1, -1, 0, 0, 0, CianwoodCityRock, -1 - person_event SPRITE_ROCK, 23, 8, $18, 0, 0, -1, -1, 0, 0, 0, CianwoodCityRock, -1 - person_event SPRITE_POKEFAN_F, 50, 14, $5, 0, 1, -1, -1, 0, 0, 0, PokefanFScript_0x1a0084, -1 - person_event SPRITE_SUPER_NERD, 25, 15, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_CIANWOOD_CITY_EUSINE - person_event SPRITE_SUICUNE, 18, 14, $1, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_SAW_SUICUNE_AT_CIANWOOD_CITY + person_event SPRITE_STANDING_YOUNGSTER, 37, 21, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, StandingYoungsterScript_0x1a00b3, -1 + person_event SPRITE_POKEFAN_M, 33, 17, $5, 0, 1, -1, -1, 0, 0, 0, PokefanMScript_0x1a00b6, -1 + person_event SPRITE_LASS, 42, 14, $4, 2, 0, -1, -1, 0, 0, 0, LassScript_0x1a00b9, -1 + person_event SPRITE_ROCK, 16, 8, $18, 0, 0, -1, -1, 0, 0, 0, CianwoodCityRock, -1 + person_event SPRITE_ROCK, 17, 9, $18, 0, 0, -1, -1, 0, 0, 0, CianwoodCityRock, -1 + person_event SPRITE_ROCK, 25, 4, $18, 0, 0, -1, -1, 0, 0, 0, CianwoodCityRock, -1 + person_event SPRITE_ROCK, 29, 5, $18, 0, 0, -1, -1, 0, 0, 0, CianwoodCityRock, -1 + person_event SPRITE_ROCK, 27, 10, $18, 0, 0, -1, -1, 0, 0, 0, CianwoodCityRock, -1 + person_event SPRITE_ROCK, 19, 4, $18, 0, 0, -1, -1, 0, 0, 0, CianwoodCityRock, -1 + person_event SPRITE_POKEFAN_F, 46, 10, $5, 0, 1, -1, -1, 0, 0, 0, PokefanFScript_0x1a0084, -1 + person_event SPRITE_SUPER_NERD, 21, 11, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_CIANWOOD_CITY_EUSINE + person_event SPRITE_SUICUNE, 14, 10, $1, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_SAW_SUICUNE_AT_CIANWOOD_CITY diff --git a/maps/CianwoodCityPhotoStudio.asm b/maps/CianwoodCityPhotoStudio.asm index 839cd931e..773c823ad 100644 --- a/maps/CianwoodCityPhotoStudio.asm +++ b/maps/CianwoodCityPhotoStudio.asm @@ -62,4 +62,4 @@ CianwoodCityPhotoStudio_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_FISHING_GURU, 7, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, FishingGuruScript_0x9e0e0, -1 + person_event SPRITE_FISHING_GURU, 3, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, FishingGuruScript_0x9e0e0, -1 diff --git a/maps/CianwoodGym.asm b/maps/CianwoodGym.asm index 5375801c2..4f66a2665 100644 --- a/maps/CianwoodGym.asm +++ b/maps/CianwoodGym.asm @@ -313,12 +313,12 @@ CianwoodGym_MapEventHeader: .PersonEvents: db 9 - person_event SPRITE_CHUCK, 5, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, ChuckScript_0x9d60f, -1 - person_event SPRITE_BLACK_BELT, 16, 6, $9, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerBlackbeltYoshi, -1 - person_event SPRITE_BLACK_BELT, 16, 11, $8, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerBlackbeltLao, -1 - person_event SPRITE_BLACK_BELT, 13, 7, $9, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerBlackbeltNob, -1 - person_event SPRITE_BLACK_BELT, 9, 9, $8, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 1, TrainerBlackbeltLung, -1 - person_event SPRITE_BOULDER, 5, 9, $19, 0, 0, -1, -1, 0, 0, 0, CianwoodGymBoulder, -1 - person_event SPRITE_BOULDER, 11, 7, $19, 0, 0, -1, -1, 0, 0, 0, CianwoodGymBoulder, -1 - person_event SPRITE_BOULDER, 11, 8, $19, 0, 0, -1, -1, 0, 0, 0, CianwoodGymBoulder, -1 - person_event SPRITE_BOULDER, 11, 9, $19, 0, 0, -1, -1, 0, 0, 0, CianwoodGymBoulder, -1 + person_event SPRITE_CHUCK, 1, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, ChuckScript_0x9d60f, -1 + person_event SPRITE_BLACK_BELT, 12, 2, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerBlackbeltYoshi, -1 + person_event SPRITE_BLACK_BELT, 12, 7, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerBlackbeltLao, -1 + person_event SPRITE_BLACK_BELT, 9, 3, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerBlackbeltNob, -1 + person_event SPRITE_BLACK_BELT, 5, 5, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 1, TrainerBlackbeltLung, -1 + person_event SPRITE_BOULDER, 1, 5, $19, 0, 0, -1, -1, 0, 0, 0, CianwoodGymBoulder, -1 + person_event SPRITE_BOULDER, 7, 3, $19, 0, 0, -1, -1, 0, 0, 0, CianwoodGymBoulder, -1 + person_event SPRITE_BOULDER, 7, 4, $19, 0, 0, -1, -1, 0, 0, 0, CianwoodGymBoulder, -1 + person_event SPRITE_BOULDER, 7, 5, $19, 0, 0, -1, -1, 0, 0, 0, CianwoodGymBoulder, -1 diff --git a/maps/CianwoodLugiaSpeechHouse.asm b/maps/CianwoodLugiaSpeechHouse.asm index a4b17b4fe..ee692036f 100644 --- a/maps/CianwoodLugiaSpeechHouse.asm +++ b/maps/CianwoodLugiaSpeechHouse.asm @@ -75,6 +75,6 @@ CianwoodLugiaSpeechHouse_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_TEACHER, 8, 6, $6, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x9e1b0, -1 - person_event SPRITE_LASS, 9, 10, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LassScript_0x9e1b3, -1 - person_event SPRITE_TWIN, 6, 4, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, TwinScript_0x9e1b6, -1 + person_event SPRITE_TEACHER, 4, 2, $6, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x9e1b0, -1 + person_event SPRITE_LASS, 5, 6, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LassScript_0x9e1b3, -1 + person_event SPRITE_TWIN, 2, 0, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, TwinScript_0x9e1b6, -1 diff --git a/maps/CianwoodPharmacy.asm b/maps/CianwoodPharmacy.asm index 6643fc69c..8d09c5075 100644 --- a/maps/CianwoodPharmacy.asm +++ b/maps/CianwoodPharmacy.asm @@ -90,4 +90,4 @@ CianwoodPharmacy_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_PHARMACIST, 7, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, CianwoodPharmacist, -1 + person_event SPRITE_PHARMACIST, 3, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CianwoodPharmacist, -1 diff --git a/maps/CianwoodPokeCenter1F.asm b/maps/CianwoodPokeCenter1F.asm index f884c9a91..e2c4dce15 100644 --- a/maps/CianwoodPokeCenter1F.asm +++ b/maps/CianwoodPokeCenter1F.asm @@ -143,7 +143,7 @@ CianwoodPokeCenter1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x9dbcf, -1 - person_event SPRITE_LASS, 9, 5, $4, 1, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LassScript_0x9dbd2, -1 - person_event SPRITE_GYM_GUY, 7, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, CianwoodGymGuyScript, -1 - person_event SPRITE_SUPER_NERD, 10, 12, $5, 0, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SuperNerdScript_0x9dbea, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x9dbcf, -1 + person_event SPRITE_LASS, 5, 1, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LassScript_0x9dbd2, -1 + person_event SPRITE_GYM_GUY, 3, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CianwoodGymGuyScript, -1 + person_event SPRITE_SUPER_NERD, 6, 8, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SuperNerdScript_0x9dbea, -1 diff --git a/maps/CinnabarIsland.asm b/maps/CinnabarIsland.asm index 6ec53d3ca..871be40c7 100644 --- a/maps/CinnabarIsland.asm +++ b/maps/CinnabarIsland.asm @@ -146,4 +146,4 @@ CinnabarIsland_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_BLUE, 10, 13, $3, 0, 0, -1, -1, 0, 0, 0, CinnabarIslandBlue, EVENT_BLUE_IN_CINNABAR + person_event SPRITE_BLUE, 6, 9, $3, 0, 0, -1, -1, 0, 0, 0, CinnabarIslandBlue, EVENT_BLUE_IN_CINNABAR diff --git a/maps/CinnabarPokeCenter1F.asm b/maps/CinnabarPokeCenter1F.asm index 168cfccac..14f300ce5 100644 --- a/maps/CinnabarPokeCenter1F.asm +++ b/maps/CinnabarPokeCenter1F.asm @@ -47,6 +47,6 @@ CinnabarPokeCenter1F_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x1ab32c, -1 - person_event SPRITE_COOLTRAINER_F, 10, 11, $5, 0, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerFScript_0x1ab32f, -1 - person_event SPRITE_FISHER, 8, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FisherScript_0x1ab332, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x1ab32c, -1 + person_event SPRITE_COOLTRAINER_F, 6, 7, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerFScript_0x1ab32f, -1 + person_event SPRITE_FISHER, 4, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FisherScript_0x1ab332, -1 diff --git a/maps/Colosseum.asm b/maps/Colosseum.asm index 1f2a53c2a..c77512f7f 100644 --- a/maps/Colosseum.asm +++ b/maps/Colosseum.asm @@ -83,5 +83,5 @@ Colosseum_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_CHRIS, 8, 7, $9, 0, 0, -1, -1, 0, 0, 0, ChrisScript_0x193499, EVENT_GAVE_KURT_APRICORNS - person_event SPRITE_CHRIS, 8, 10, $8, 0, 0, -1, -1, 0, 0, 0, ChrisScript_0x193499, EVENT_RECEIVED_BALLS_FROM_KURT + person_event SPRITE_CHRIS, 4, 3, $9, 0, 0, -1, -1, 0, 0, 0, ChrisScript_0x193499, EVENT_GAVE_KURT_APRICORNS + person_event SPRITE_CHRIS, 4, 6, $8, 0, 0, -1, -1, 0, 0, 0, ChrisScript_0x193499, EVENT_RECEIVED_BALLS_FROM_KURT diff --git a/maps/CopycatsHouse1F.asm b/maps/CopycatsHouse1F.asm index 7ea2d5dab..4eb79196c 100644 --- a/maps/CopycatsHouse1F.asm +++ b/maps/CopycatsHouse1F.asm @@ -85,6 +85,6 @@ CopycatsHouse1F_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_POKEFAN_M, 7, 6, $6, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x18ad13, -1 - person_event SPRITE_POKEFAN_F, 8, 9, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, PokefanFScript_0x18ad16, -1 - person_event SPRITE_CLEFAIRY, 10, 10, $16, 0, 0, -1, -1, 0, 0, 0, ClefairyScript_0x18ad2a, -1 + person_event SPRITE_POKEFAN_M, 3, 2, $6, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x18ad13, -1 + person_event SPRITE_POKEFAN_F, 4, 5, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, PokefanFScript_0x18ad16, -1 + person_event SPRITE_CLEFAIRY, 6, 6, $16, 0, 0, -1, -1, 0, 0, 0, ClefairyScript_0x18ad2a, -1 diff --git a/maps/CopycatsHouse2F.asm b/maps/CopycatsHouse2F.asm index 05143abae..b4e608c05 100644 --- a/maps/CopycatsHouse2F.asm +++ b/maps/CopycatsHouse2F.asm @@ -373,9 +373,9 @@ CopycatsHouse2F_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_COPYCAT, 7, 8, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, Copycat, EVENT_COPYCAT_1 - person_event SPRITE_MOLTRES, 8, 10, $16, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, CopycatsDodrio, -1 - person_event SPRITE_FAIRY, 5, 10, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, CopycatsHouse2FDoll, EVENT_COPYCATS_HOUSE_2F_DOLL - person_event SPRITE_MONSTER, 5, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CopycatsHouse2FDoll, -1 - person_event SPRITE_BIRD, 5, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, CopycatsHouse2FDoll, -1 - person_event SPRITE_COPYCAT, 7, 8, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, Copycat, EVENT_COPYCAT_2 + person_event SPRITE_COPYCAT, 3, 4, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, Copycat, EVENT_COPYCAT_1 + person_event SPRITE_MOLTRES, 4, 6, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, CopycatsDodrio, -1 + person_event SPRITE_FAIRY, 1, 6, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CopycatsHouse2FDoll, EVENT_COPYCATS_HOUSE_2F_DOLL + person_event SPRITE_MONSTER, 1, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CopycatsHouse2FDoll, -1 + person_event SPRITE_BIRD, 1, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, CopycatsHouse2FDoll, -1 + person_event SPRITE_COPYCAT, 3, 4, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, Copycat, EVENT_COPYCAT_2 diff --git a/maps/DanceTheatre.asm b/maps/DanceTheatre.asm index c40530b55..4824e67e6 100644 --- a/maps/DanceTheatre.asm +++ b/maps/DanceTheatre.asm @@ -345,12 +345,12 @@ DanceTheatre_MapEventHeader: .PersonEvents: db 9 - person_event SPRITE_KIMONO_GIRL, 6, 4, $1e, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 0, TrainerKimono_girlNaoko2, -1 - person_event SPRITE_KIMONO_GIRL, 5, 6, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 0, TrainerKimono_girlSayo, -1 - person_event SPRITE_KIMONO_GIRL, 6, 10, $3, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 0, TrainerKimono_girlZuki, -1 - person_event SPRITE_KIMONO_GIRL, 5, 13, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 0, TrainerKimono_girlKuni, -1 - person_event SPRITE_KIMONO_GIRL, 6, 15, $1f, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 0, TrainerKimono_girlMiki, -1 - person_event SPRITE_GENTLEMAN, 14, 11, $7, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x994c6, -1 - person_event SPRITE_RHYDON, 12, 10, $16, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, RhydonScript_0x9951b, -1 - person_event SPRITE_COOLTRAINER_M, 14, 14, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerMScript_0x99525, -1 - person_event SPRITE_GRANNY, 10, 7, $7, 0, 0, -1, -1, 0, 0, 0, GrannyScript_0x99528, -1 + person_event SPRITE_KIMONO_GIRL, 2, 0, $1e, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 0, TrainerKimono_girlNaoko2, -1 + person_event SPRITE_KIMONO_GIRL, 1, 2, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 0, TrainerKimono_girlSayo, -1 + person_event SPRITE_KIMONO_GIRL, 2, 6, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 0, TrainerKimono_girlZuki, -1 + person_event SPRITE_KIMONO_GIRL, 1, 9, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 0, TrainerKimono_girlKuni, -1 + person_event SPRITE_KIMONO_GIRL, 2, 11, $1f, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 0, TrainerKimono_girlMiki, -1 + person_event SPRITE_GENTLEMAN, 10, 7, $7, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x994c6, -1 + person_event SPRITE_RHYDON, 8, 6, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, RhydonScript_0x9951b, -1 + person_event SPRITE_COOLTRAINER_M, 10, 10, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerMScript_0x99525, -1 + person_event SPRITE_GRANNY, 6, 3, $7, 0, 0, -1, -1, 0, 0, 0, GrannyScript_0x99528, -1 diff --git a/maps/DarkCaveBlackthornEntrance.asm b/maps/DarkCaveBlackthornEntrance.asm index 5e52b7af6..0fdc70f4f 100644 --- a/maps/DarkCaveBlackthornEntrance.asm +++ b/maps/DarkCaveBlackthornEntrance.asm @@ -73,6 +73,6 @@ DarkCaveBlackthornEntrance_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_PHARMACIST, 7, 11, $3, 0, 0, -1, -1, 0, 0, 0, PharmacistScript_0x18c720, -1 - person_event SPRITE_POKE_BALL, 28, 25, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c73b, EVENT_DARK_CAVE_BLACKTHORN_ENTRANCE_REVIVE - person_event SPRITE_POKE_BALL, 26, 11, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c73d, EVENT_DARK_CAVE_BLACKTHORN_ENTRANCE_TM_SNORE + person_event SPRITE_PHARMACIST, 3, 7, $3, 0, 0, -1, -1, 0, 0, 0, PharmacistScript_0x18c720, -1 + person_event SPRITE_POKE_BALL, 24, 21, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c73b, EVENT_DARK_CAVE_BLACKTHORN_ENTRANCE_REVIVE + person_event SPRITE_POKE_BALL, 22, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c73d, EVENT_DARK_CAVE_BLACKTHORN_ENTRANCE_TM_SNORE diff --git a/maps/DarkCaveVioletEntrance.asm b/maps/DarkCaveVioletEntrance.asm index 59ce65a07..9807cce3e 100644 --- a/maps/DarkCaveVioletEntrance.asm +++ b/maps/DarkCaveVioletEntrance.asm @@ -43,11 +43,11 @@ DarkCaveVioletEntrance_MapEventHeader: .PersonEvents: db 8 - person_event SPRITE_POKE_BALL, 12, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c68e, EVENT_DARK_CAVE_VIOLET_ENTRANCE_POTION - person_event SPRITE_ROCK, 18, 20, $18, 0, 0, -1, -1, 0, 0, 0, DarkCaveVioletEntranceRock, -1 - person_event SPRITE_ROCK, 10, 31, $18, 0, 0, -1, -1, 0, 0, 0, DarkCaveVioletEntranceRock, -1 - person_event SPRITE_ROCK, 18, 11, $18, 0, 0, -1, -1, 0, 0, 0, DarkCaveVioletEntranceRock, -1 - person_event SPRITE_ROCK, 35, 40, $18, 0, 0, -1, -1, 0, 0, 0, DarkCaveVioletEntranceRock, -1 - person_event SPRITE_POKE_BALL, 26, 40, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c690, EVENT_DARK_CAVE_VIOLET_ENTRANCE_FULL_HEAL - person_event SPRITE_POKE_BALL, 13, 39, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c692, EVENT_DARK_CAVE_VIOLET_ENTRANCE_HYPER_POTION - person_event SPRITE_POKE_BALL, 32, 34, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c694, EVENT_DARK_CAVE_VIOLET_ENTRANCE_DIRE_HIT + person_event SPRITE_POKE_BALL, 8, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c68e, EVENT_DARK_CAVE_VIOLET_ENTRANCE_POTION + person_event SPRITE_ROCK, 14, 16, $18, 0, 0, -1, -1, 0, 0, 0, DarkCaveVioletEntranceRock, -1 + person_event SPRITE_ROCK, 6, 27, $18, 0, 0, -1, -1, 0, 0, 0, DarkCaveVioletEntranceRock, -1 + person_event SPRITE_ROCK, 14, 7, $18, 0, 0, -1, -1, 0, 0, 0, DarkCaveVioletEntranceRock, -1 + person_event SPRITE_ROCK, 31, 36, $18, 0, 0, -1, -1, 0, 0, 0, DarkCaveVioletEntranceRock, -1 + person_event SPRITE_POKE_BALL, 22, 36, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c690, EVENT_DARK_CAVE_VIOLET_ENTRANCE_FULL_HEAL + person_event SPRITE_POKE_BALL, 9, 35, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c692, EVENT_DARK_CAVE_VIOLET_ENTRANCE_HYPER_POTION + person_event SPRITE_POKE_BALL, 28, 30, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c694, EVENT_DARK_CAVE_VIOLET_ENTRANCE_DIRE_HIT diff --git a/maps/DayCare.asm b/maps/DayCare.asm index ae1c52e2e..1415c7333 100644 --- a/maps/DayCare.asm +++ b/maps/DayCare.asm @@ -175,5 +175,5 @@ DayCare_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_GRAMPS, 7, 6, $9, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x62f8f, EVENT_DAYCARE_MAN_IN_DAYCARE - person_event SPRITE_GRANNY, 7, 9, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, GrannyScript_0x62fc3, -1 + person_event SPRITE_GRAMPS, 3, 2, $9, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x62f8f, EVENT_DAYCARE_MAN_IN_DAYCARE + person_event SPRITE_GRANNY, 3, 5, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, GrannyScript_0x62fc3, -1 diff --git a/maps/DiglettsCave.asm b/maps/DiglettsCave.asm index ae9065633..67d66465c 100644 --- a/maps/DiglettsCave.asm +++ b/maps/DiglettsCave.asm @@ -42,4 +42,4 @@ DiglettsCave_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKEFAN_M, 35, 7, $6, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x74002, -1 + person_event SPRITE_POKEFAN_M, 31, 3, $6, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x74002, -1 diff --git a/maps/DragonShrine.asm b/maps/DragonShrine.asm index dd44f70a8..199b43ce8 100644 --- a/maps/DragonShrine.asm +++ b/maps/DragonShrine.asm @@ -160,7 +160,7 @@ DragonShrineTestScript: playsound SFX_GET_BADGE waitbutton special RestartMapMusic - specialphonecall ELMCALL_MASTERBALL + specialphonecall SPECIALCALL_MASTERBALL dotrigger $1 domaptrigger DRAGONS_DEN_B1F, $1 writetext UnknownText_0x18d9f2 @@ -681,7 +681,7 @@ DragonShrine_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_ELDER, 5, 9, $6, 0, 0, -1, -1, 0, 0, 0, ElderScript_0x18d1a5, EVENT_GAVE_KURT_APRICORNS - person_event SPRITE_ELDER, 8, 6, $9, 0, 0, -1, -1, 0, 0, 0, ElderScript_0x18d205, EVENT_GAVE_KURT_APRICORNS - person_event SPRITE_ELDER, 8, 11, $8, 0, 0, -1, -1, 0, 0, 0, ElderScript_0x18d20d, EVENT_GAVE_KURT_APRICORNS - person_event SPRITE_CLAIR, 12, 8, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_DRAGON_SHRINE_CLAIR + person_event SPRITE_ELDER, 1, 5, $6, 0, 0, -1, -1, 0, 0, 0, ElderScript_0x18d1a5, EVENT_GAVE_KURT_APRICORNS + person_event SPRITE_ELDER, 4, 2, $9, 0, 0, -1, -1, 0, 0, 0, ElderScript_0x18d205, EVENT_GAVE_KURT_APRICORNS + person_event SPRITE_ELDER, 4, 7, $8, 0, 0, -1, -1, 0, 0, 0, ElderScript_0x18d20d, EVENT_GAVE_KURT_APRICORNS + person_event SPRITE_CLAIR, 8, 4, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_DRAGON_SHRINE_CLAIR diff --git a/maps/DragonsDenB1F.asm b/maps/DragonsDenB1F.asm index df7d1adac..baaa07834 100644 --- a/maps/DragonsDenB1F.asm +++ b/maps/DragonsDenB1F.asm @@ -419,12 +419,12 @@ DragonsDenB1F_MapEventHeader: .PersonEvents: db 9 - person_event SPRITE_POKE_BALL, 20, 39, $1, 0, 0, -1, -1, 0, 0, 0, PokeBallScript_0x18c95a, EVENT_DRAGONS_DEN_B1F_DRAGON_FANG - person_event SPRITE_CLAIR, 34, 18, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_DRAGONS_DEN_CLAIR - person_event SPRITE_SILVER, 27, 24, $2, 2, 2, -1, -1, 0, 0, 0, SilverScript_0x18c97e, EVENT_RIVAL_DRAGONS_DEN - person_event SPRITE_COOLTRAINER_M, 12, 24, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 4, TrainerCooltrainermDarin, -1 - person_event SPRITE_COOLTRAINER_F, 12, 12, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerCooltrainerfCara, -1 - person_event SPRITE_TWIN, 21, 8, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerTwinsLeaandpia1, -1 - person_event SPRITE_TWIN, 22, 8, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerTwinsLeaandpia2, -1 - person_event SPRITE_POKE_BALL, 8, 34, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c9a1, EVENT_DRAGONS_DEN_B1F_CALCIUM - person_event SPRITE_POKE_BALL, 24, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c9a3, EVENT_DRAGONS_DEN_B1F_MAX_ELIXER + person_event SPRITE_POKE_BALL, 16, 35, $1, 0, 0, -1, -1, 0, 0, 0, PokeBallScript_0x18c95a, EVENT_DRAGONS_DEN_B1F_DRAGON_FANG + person_event SPRITE_CLAIR, 30, 14, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_DRAGONS_DEN_CLAIR + person_event SPRITE_SILVER, 23, 20, $2, 2, 2, -1, -1, 0, 0, 0, SilverScript_0x18c97e, EVENT_RIVAL_DRAGONS_DEN + person_event SPRITE_COOLTRAINER_M, 8, 20, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 4, TrainerCooltrainermDarin, -1 + person_event SPRITE_COOLTRAINER_F, 8, 8, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerCooltrainerfCara, -1 + person_event SPRITE_TWIN, 17, 4, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerTwinsLeaandpia1, -1 + person_event SPRITE_TWIN, 18, 4, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerTwinsLeaandpia2, -1 + person_event SPRITE_POKE_BALL, 4, 30, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c9a1, EVENT_DRAGONS_DEN_B1F_CALCIUM + person_event SPRITE_POKE_BALL, 20, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c9a3, EVENT_DRAGONS_DEN_B1F_MAX_ELIXER diff --git a/maps/EarlsPokemonAcademy.asm b/maps/EarlsPokemonAcademy.asm index b4b479748..4c5aeefec 100644 --- a/maps/EarlsPokemonAcademy.asm +++ b/maps/EarlsPokemonAcademy.asm @@ -425,9 +425,9 @@ EarlsPokemonAcademy_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_FISHER, 6, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, AcademyEarl, EVENT_EARLS_ACADEMY_EARL - person_event SPRITE_YOUNGSTER, 9, 6, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x68a83, -1 - person_event SPRITE_GAMEBOY_KID, 15, 7, $6, 0, 0, -1, -1, 0, 0, 0, GameboyKidScript_0x68a86, -1 - person_event SPRITE_GAMEBOY_KID, 15, 8, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, GameboyKidScript_0x68a91, -1 - person_event SPRITE_YOUNGSTER, 11, 8, $7, 0, 0, -1, -1, 0, 0, 0, YoungsterScript_0x68a9c, -1 - person_event SPRITE_POKEDEX, 8, 6, $1, 0, 0, -1, -1, 0, 0, 0, AcademyNotebook, -1 + person_event SPRITE_FISHER, 2, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, AcademyEarl, EVENT_EARLS_ACADEMY_EARL + person_event SPRITE_YOUNGSTER, 5, 2, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x68a83, -1 + person_event SPRITE_GAMEBOY_KID, 11, 3, $6, 0, 0, -1, -1, 0, 0, 0, GameboyKidScript_0x68a86, -1 + person_event SPRITE_GAMEBOY_KID, 11, 4, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, GameboyKidScript_0x68a91, -1 + person_event SPRITE_YOUNGSTER, 7, 4, $7, 0, 0, -1, -1, 0, 0, 0, YoungsterScript_0x68a9c, -1 + person_event SPRITE_POKEDEX, 4, 2, $1, 0, 0, -1, -1, 0, 0, 0, AcademyNotebook, -1 diff --git a/maps/EcruteakCity.asm b/maps/EcruteakCity.asm index e16e9b3ed..6b072e6b8 100644 --- a/maps/EcruteakCity.asm +++ b/maps/EcruteakCity.asm @@ -290,10 +290,10 @@ EcruteakCity_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_GRAMPS, 19, 22, $2, 1, 1, -1, -1, 0, 0, 0, GrampsScript_0x1a4009, -1 - person_event SPRITE_GRAMPS, 25, 24, $3, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x1a400c, -1 - person_event SPRITE_LASS, 33, 25, $5, 0, 2, -1, -1, 8 + PAL_OW_BLUE, 0, 0, LassScript_0x1a4012, -1 - person_event SPRITE_LASS, 13, 7, $7, 0, 0, -1, -1, 0, 0, 0, LassScript_0x1a4015, -1 - person_event SPRITE_FISHER, 26, 13, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FisherScript_0x1a4029, -1 - person_event SPRITE_YOUNGSTER, 18, 14, $2, 1, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x1a403d, -1 - person_event SPRITE_GRAMPS, 11, 7, $2, 1, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, GrampsScript_0x1a400f, EVENT_ECRUTEAK_CITY_GRAMPS + person_event SPRITE_GRAMPS, 15, 18, $2, 1, 1, -1, -1, 0, 0, 0, GrampsScript_0x1a4009, -1 + person_event SPRITE_GRAMPS, 21, 20, $3, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x1a400c, -1 + person_event SPRITE_LASS, 29, 21, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, LassScript_0x1a4012, -1 + person_event SPRITE_LASS, 9, 3, $7, 0, 0, -1, -1, 0, 0, 0, LassScript_0x1a4015, -1 + person_event SPRITE_FISHER, 22, 9, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FisherScript_0x1a4029, -1 + person_event SPRITE_YOUNGSTER, 14, 10, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x1a403d, -1 + person_event SPRITE_GRAMPS, 7, 3, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, GrampsScript_0x1a400f, EVENT_ECRUTEAK_CITY_GRAMPS diff --git a/maps/EcruteakGym.asm b/maps/EcruteakGym.asm index bd3ab88b8..9c012fe1c 100644 --- a/maps/EcruteakGym.asm +++ b/maps/EcruteakGym.asm @@ -429,10 +429,10 @@ EcruteakGym_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_MORTY, 5, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, MortyScript_0x99d58, -1 - person_event SPRITE_SAGE, 11, 6, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerSageJeffrey, -1 - person_event SPRITE_SAGE, 17, 7, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerSagePing, -1 - person_event SPRITE_GRANNY, 9, 11, $8, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 1, TrainerMediumMartha, -1 - person_event SPRITE_GRANNY, 13, 11, $8, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 1, TrainerMediumGrace, -1 - person_event SPRITE_GYM_GUY, 19, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, EcruteakGymGuyScript, -1 - person_event SPRITE_GRAMPS, 18, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ObjectEvent, EVENT_ECRUTEAK_GYM_GRAMPS + person_event SPRITE_MORTY, 1, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, MortyScript_0x99d58, -1 + person_event SPRITE_SAGE, 7, 2, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerSageJeffrey, -1 + person_event SPRITE_SAGE, 13, 3, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerSagePing, -1 + person_event SPRITE_GRANNY, 5, 7, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 1, TrainerMediumMartha, -1 + person_event SPRITE_GRANNY, 9, 7, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 1, TrainerMediumGrace, -1 + person_event SPRITE_GYM_GUY, 15, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, EcruteakGymGuyScript, -1 + person_event SPRITE_GRAMPS, 14, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ObjectEvent, EVENT_ECRUTEAK_GYM_GRAMPS diff --git a/maps/EcruteakHouse.asm b/maps/EcruteakHouse.asm index 20dc831a6..b410f7d46 100644 --- a/maps/EcruteakHouse.asm +++ b/maps/EcruteakHouse.asm @@ -298,7 +298,7 @@ EcruteakHouse_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_SAGE, 10, 8, $6, 0, 0, -1, -1, 0, 0, 0, SageScript_0x98062, EVENT_RANG_CLEAR_BELL_1 - person_event SPRITE_SAGE, 10, 9, $6, 0, 0, -1, -1, 0, 0, 0, SageScript_0x98062, EVENT_RANG_CLEAR_BELL_2 - person_event SPRITE_SAGE, 13, 10, $2, 1, 1, -1, -1, 0, 0, 0, SageScript_0x980b0, EVENT_ECRUTEAK_HOUSE_WANDERING_SAGE - person_event SPRITE_GRAMPS, 15, 7, $2, 1, 1, -1, -1, 0, 0, 0, GrampsScript_0x980c4, EVENT_ECRUTEAK_HOUSE_WANDERING_SAGE + person_event SPRITE_SAGE, 6, 4, $6, 0, 0, -1, -1, 0, 0, 0, SageScript_0x98062, EVENT_RANG_CLEAR_BELL_1 + person_event SPRITE_SAGE, 6, 5, $6, 0, 0, -1, -1, 0, 0, 0, SageScript_0x98062, EVENT_RANG_CLEAR_BELL_2 + person_event SPRITE_SAGE, 9, 6, $2, 1, 1, -1, -1, 0, 0, 0, SageScript_0x980b0, EVENT_ECRUTEAK_HOUSE_WANDERING_SAGE + person_event SPRITE_GRAMPS, 11, 3, $2, 1, 1, -1, -1, 0, 0, 0, GrampsScript_0x980c4, EVENT_ECRUTEAK_HOUSE_WANDERING_SAGE diff --git a/maps/EcruteakItemfinderHouse.asm b/maps/EcruteakItemfinderHouse.asm index 5cd23c7e6..bc1b6790d 100644 --- a/maps/EcruteakItemfinderHouse.asm +++ b/maps/EcruteakItemfinderHouse.asm @@ -176,5 +176,5 @@ EcruteakItemfinderHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_COOLTRAINER_M, 7, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerMScript_0x9a5fb, -1 - person_event SPRITE_POKEDEX, 7, 7, $1, 0, 0, -1, -1, 0, 0, 0, PokedexScript_0x9a620, -1 + person_event SPRITE_COOLTRAINER_M, 3, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerMScript_0x9a5fb, -1 + person_event SPRITE_POKEDEX, 3, 3, $1, 0, 0, -1, -1, 0, 0, 0, PokedexScript_0x9a620, -1 diff --git a/maps/EcruteakLugiaSpeechHouse.asm b/maps/EcruteakLugiaSpeechHouse.asm index cbd459e57..d3218b2a2 100644 --- a/maps/EcruteakLugiaSpeechHouse.asm +++ b/maps/EcruteakLugiaSpeechHouse.asm @@ -58,5 +58,5 @@ EcruteakLugiaSpeechHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_GRAMPS, 7, 6, $3, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x99334, -1 - person_event SPRITE_YOUNGSTER, 8, 9, $8, 0, 0, -1, -1, 0, 0, 0, YoungsterScript_0x99337, -1 + person_event SPRITE_GRAMPS, 3, 2, $3, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x99334, -1 + person_event SPRITE_YOUNGSTER, 4, 5, $8, 0, 0, -1, -1, 0, 0, 0, YoungsterScript_0x99337, -1 diff --git a/maps/EcruteakMart.asm b/maps/EcruteakMart.asm index f357cdd49..e38261532 100644 --- a/maps/EcruteakMart.asm +++ b/maps/EcruteakMart.asm @@ -57,6 +57,6 @@ EcruteakMart_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x99c3b, -1 - person_event SPRITE_SUPER_NERD, 6, 9, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, SuperNerdScript_0x99c42, -1 - person_event SPRITE_GRANNY, 10, 10, $7, 0, 0, -1, -1, 0, 0, 0, GrannyScript_0x99c45, -1 + person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x99c3b, -1 + person_event SPRITE_SUPER_NERD, 2, 5, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, SuperNerdScript_0x99c42, -1 + person_event SPRITE_GRANNY, 6, 6, $7, 0, 0, -1, -1, 0, 0, 0, GrannyScript_0x99c45, -1 diff --git a/maps/EcruteakPokeCenter1F.asm b/maps/EcruteakPokeCenter1F.asm index ce9bf8377..66acfaa9c 100644 --- a/maps/EcruteakPokeCenter1F.asm +++ b/maps/EcruteakPokeCenter1F.asm @@ -219,8 +219,8 @@ EcruteakPokeCenter1F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x98eb0, -1 - person_event SPRITE_POKEFAN_M, 10, 11, $a, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x98eb3, -1 - person_event SPRITE_COOLTRAINER_F, 8, 5, $3, 0, 0, -1, -1, 0, 0, 0, CooltrainerFScript_0x98ebf, -1 - person_event SPRITE_GYM_GUY, 5, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, GymGuyScript_0x98ec2, -1 - person_event SPRITE_BILL, 11, 4, $9, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_ECRUTEAK_POKE_CENTER_BILL + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x98eb0, -1 + person_event SPRITE_POKEFAN_M, 6, 7, $a, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x98eb3, -1 + person_event SPRITE_COOLTRAINER_F, 4, 1, $3, 0, 0, -1, -1, 0, 0, 0, CooltrainerFScript_0x98ebf, -1 + person_event SPRITE_GYM_GUY, 1, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, GymGuyScript_0x98ec2, -1 + person_event SPRITE_BILL, 7, 0, $9, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_ECRUTEAK_POKE_CENTER_BILL diff --git a/maps/ElmsHouse.asm b/maps/ElmsHouse.asm index aa89b9798..e8673a693 100644 --- a/maps/ElmsHouse.asm +++ b/maps/ElmsHouse.asm @@ -99,5 +99,5 @@ ElmsHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_TEACHER, 9, 5, $4, 1, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ElmsWife, -1 - person_event SPRITE_BUG_CATCHER, 8, 9, $7, 0, 0, -1, -1, 0, 0, 0, ElmsSon, -1 + person_event SPRITE_TEACHER, 5, 1, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ElmsWife, -1 + person_event SPRITE_BUG_CATCHER, 4, 5, $7, 0, 0, -1, -1, 0, 0, 0, ElmsSon, -1 diff --git a/maps/ElmsLab.asm b/maps/ElmsLab.asm index 0981badf2..45e0c2311 100644 --- a/maps/ElmsLab.asm +++ b/maps/ElmsLab.asm @@ -1408,9 +1408,9 @@ ElmsLab_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_ELM, 6, 9, $6, 0, 0, -1, -1, 0, 0, 0, ProfElmScript, -1 - person_event SPRITE_SCIENTIST, 13, 6, $3, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ElmsAideScript, EVENT_ELMS_AIDE_IN_LAB - person_event SPRITE_POKE_BALL, 7, 10, $1, 0, 0, -1, -1, 0, 0, 0, CyndaquilPokeBallScript, EVENT_CYNDAQUIL_POKEBALL_IN_ELMS_LAB - person_event SPRITE_POKE_BALL, 7, 11, $1, 0, 0, -1, -1, 0, 0, 0, TotodilePokeBallScript, EVENT_TOTODILE_POKEBALL_IN_ELMS_LAB - person_event SPRITE_POKE_BALL, 7, 12, $1, 0, 0, -1, -1, 0, 0, 0, ChikoritaPokeBallScript, EVENT_CHIKORITA_POKEBALL_IN_ELMS_LAB - person_event SPRITE_OFFICER, 7, 9, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, CopScript, EVENT_COP_IN_ELMS_LAB + person_event SPRITE_ELM, 2, 5, $6, 0, 0, -1, -1, 0, 0, 0, ProfElmScript, -1 + person_event SPRITE_SCIENTIST, 9, 2, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ElmsAideScript, EVENT_ELMS_AIDE_IN_LAB + person_event SPRITE_POKE_BALL, 3, 6, $1, 0, 0, -1, -1, 0, 0, 0, CyndaquilPokeBallScript, EVENT_CYNDAQUIL_POKEBALL_IN_ELMS_LAB + person_event SPRITE_POKE_BALL, 3, 7, $1, 0, 0, -1, -1, 0, 0, 0, TotodilePokeBallScript, EVENT_TOTODILE_POKEBALL_IN_ELMS_LAB + person_event SPRITE_POKE_BALL, 3, 8, $1, 0, 0, -1, -1, 0, 0, 0, ChikoritaPokeBallScript, EVENT_CHIKORITA_POKEBALL_IN_ELMS_LAB + person_event SPRITE_OFFICER, 3, 5, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, CopScript, EVENT_COP_IN_ELMS_LAB diff --git a/maps/FastShip1F.asm b/maps/FastShip1F.asm index 45c901391..5e3f3a0fb 100644 --- a/maps/FastShip1F.asm +++ b/maps/FastShip1F.asm @@ -310,7 +310,7 @@ FastShip1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_SAILOR, 6, 29, $6, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x75160, -1 - person_event SPRITE_SAILOR, 11, 18, $9, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x751d0, -1 - person_event SPRITE_SAILOR, 21, 26, $5, 0, 2, -1, -1, 0, 0, 0, SailorScript_0x751e4, -1 - person_event SPRITE_GENTLEMAN, 10, 23, $9, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_FAST_SHIP_1F_GENTLEMAN + person_event SPRITE_SAILOR, 2, 25, $6, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x75160, -1 + person_event SPRITE_SAILOR, 7, 14, $9, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x751d0, -1 + person_event SPRITE_SAILOR, 17, 22, $5, 0, 2, -1, -1, 0, 0, 0, SailorScript_0x751e4, -1 + person_event SPRITE_GENTLEMAN, 6, 19, $9, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_FAST_SHIP_1F_GENTLEMAN diff --git a/maps/FastShipB1F.asm b/maps/FastShipB1F.asm index 3317f2e9f..735ad6e54 100644 --- a/maps/FastShipB1F.asm +++ b/maps/FastShipB1F.asm @@ -456,15 +456,15 @@ FastShipB1F_MapEventHeader: .PersonEvents: db 12 - person_event SPRITE_SAILOR, 10, 34, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SailorScript_0x76767, EVENT_FAST_SHIP_B1F_SAILOR_LEFT - person_event SPRITE_SAILOR, 10, 35, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SailorScript_0x76767, EVENT_FAST_SHIP_B1F_SAILOR_RIGHT - person_event SPRITE_SAILOR, 15, 13, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerSailorJeff, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP - person_event SPRITE_LASS, 8, 10, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 1, TrainerPicnickerDebra, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP - person_event SPRITE_SUPER_NERD, 13, 30, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerJugglerFritz, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP - person_event SPRITE_SAILOR, 8, 21, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 4, TrainerSailorGarrett, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND - person_event SPRITE_FISHER, 12, 29, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerFisherJonah, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND - person_event SPRITE_BLACK_BELT, 15, 19, $1f, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerBlackbeltWai, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND - person_event SPRITE_SAILOR, 8, 27, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 4, TrainerSailorKenneth, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND - person_event SPRITE_TEACHER, 15, 13, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerTeacherShirley, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND - person_event SPRITE_YOUNGSTER, 13, 18, $3, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerSchoolboyNate, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND - person_event SPRITE_YOUNGSTER, 15, 18, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerSchoolboyRicky, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND + person_event SPRITE_SAILOR, 6, 30, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SailorScript_0x76767, EVENT_FAST_SHIP_B1F_SAILOR_LEFT + person_event SPRITE_SAILOR, 6, 31, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SailorScript_0x76767, EVENT_FAST_SHIP_B1F_SAILOR_RIGHT + person_event SPRITE_SAILOR, 11, 9, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerSailorJeff, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP + person_event SPRITE_LASS, 4, 6, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 1, TrainerPicnickerDebra, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP + person_event SPRITE_SUPER_NERD, 9, 26, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerJugglerFritz, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP + person_event SPRITE_SAILOR, 4, 17, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 4, TrainerSailorGarrett, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND + person_event SPRITE_FISHER, 8, 25, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerFisherJonah, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND + person_event SPRITE_BLACK_BELT, 11, 15, $1f, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerBlackbeltWai, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND + person_event SPRITE_SAILOR, 4, 23, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 4, TrainerSailorKenneth, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND + person_event SPRITE_TEACHER, 11, 9, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerTeacherShirley, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND + person_event SPRITE_YOUNGSTER, 9, 14, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerSchoolboyNate, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND + person_event SPRITE_YOUNGSTER, 11, 14, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerSchoolboyRicky, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND diff --git a/maps/FastShipCabins_NNW_NNE_NE.asm b/maps/FastShipCabins_NNW_NNE_NE.asm index 6163b9155..4f1e4be81 100644 --- a/maps/FastShipCabins_NNW_NNE_NE.asm +++ b/maps/FastShipCabins_NNW_NNE_NE.asm @@ -278,10 +278,10 @@ FastShipCabins_NNW_NNE_NE_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_COOLTRAINER_M, 7, 8, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 2, TrainerCooltrainermSean, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND - person_event SPRITE_COOLTRAINER_F, 9, 5, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerCooltrainerfCarol, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND - person_event SPRITE_SUPER_NERD, 9, 5, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerPokemaniacEthan, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND - person_event SPRITE_POKEFAN_M, 21, 8, $7, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerHikerNoland, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP - person_event SPRITE_SAILOR, 30, 8, $3, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SailorScript_0x755f1, EVENT_FAST_SHIP_CABINS_NNW_NNE_NE_SAILOR - person_event SPRITE_GENTLEMAN, 34, 11, $3, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerGentlemanEdward, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND - person_event SPRITE_PHARMACIST, 34, 6, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 4, TrainerBurglarCorey, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND + person_event SPRITE_COOLTRAINER_M, 3, 4, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 2, TrainerCooltrainermSean, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND + person_event SPRITE_COOLTRAINER_F, 5, 1, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerCooltrainerfCarol, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND + person_event SPRITE_SUPER_NERD, 5, 1, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerPokemaniacEthan, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND + person_event SPRITE_POKEFAN_M, 17, 4, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerHikerNoland, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP + person_event SPRITE_SAILOR, 26, 4, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SailorScript_0x755f1, EVENT_FAST_SHIP_CABINS_NNW_NNE_NE_SAILOR + person_event SPRITE_GENTLEMAN, 30, 7, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerGentlemanEdward, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND + person_event SPRITE_PHARMACIST, 30, 2, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 4, TrainerBurglarCorey, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND diff --git a/maps/FastShipCabins_SE_SSE_CaptainsCabin.asm b/maps/FastShipCabins_SE_SSE_CaptainsCabin.asm index f0b00e7e7..cd49d5ad5 100644 --- a/maps/FastShipCabins_SE_SSE_CaptainsCabin.asm +++ b/maps/FastShipCabins_SE_SSE_CaptainsCabin.asm @@ -471,14 +471,14 @@ FastShipCabins_SE_SSE_CaptainsCabin_MapEventHeader: .PersonEvents: db 11 - person_event SPRITE_CAPTAIN, 29, 7, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, CaptainScript_0x75ea7, -1 - person_event SPRITE_GENTLEMAN, 21, 6, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GentlemanScript_0x75f1f, EVENT_FAST_SHIP_CABINS_SE_SSE_GENTLEMAN - person_event SPRITE_TWIN, 21, 7, $a, 0, 0, -1, -1, 0, 0, 0, TwinScript_0x75f6d, EVENT_FAST_SHIP_CABINS_SE_SSE_CAPTAINS_CABIN_TWIN_1 - person_event SPRITE_TWIN, 29, 6, $a, 0, 0, -1, -1, 0, 0, 0, TwinScript_0x75ebb, EVENT_FAST_SHIP_CABINS_SE_SSE_CAPTAINS_CABIN_TWIN_2 - person_event SPRITE_POKEFAN_M, 10, 9, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 5, TrainerPokefanmColin, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP - person_event SPRITE_TWIN, 8, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerTwinsMegandpeg1, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP - person_event SPRITE_TWIN, 8, 7, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerTwinsMegandpeg2, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP - person_event SPRITE_SUPER_NERD, 9, 9, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 5, TrainerPsychicRodney, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND - person_event SPRITE_POKEFAN_M, 7, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerPokefanmJeremy, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND - person_event SPRITE_POKEFAN_F, 9, 9, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerPokefanfGeorgia, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND - person_event SPRITE_SUPER_NERD, 19, 5, $3, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerSupernerdShawn, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND + person_event SPRITE_CAPTAIN, 25, 3, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, CaptainScript_0x75ea7, -1 + person_event SPRITE_GENTLEMAN, 17, 2, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GentlemanScript_0x75f1f, EVENT_FAST_SHIP_CABINS_SE_SSE_GENTLEMAN + person_event SPRITE_TWIN, 17, 3, $a, 0, 0, -1, -1, 0, 0, 0, TwinScript_0x75f6d, EVENT_FAST_SHIP_CABINS_SE_SSE_CAPTAINS_CABIN_TWIN_1 + person_event SPRITE_TWIN, 25, 2, $a, 0, 0, -1, -1, 0, 0, 0, TwinScript_0x75ebb, EVENT_FAST_SHIP_CABINS_SE_SSE_CAPTAINS_CABIN_TWIN_2 + person_event SPRITE_POKEFAN_M, 6, 5, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 5, TrainerPokefanmColin, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP + person_event SPRITE_TWIN, 4, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerTwinsMegandpeg1, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP + person_event SPRITE_TWIN, 4, 3, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerTwinsMegandpeg2, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP + person_event SPRITE_SUPER_NERD, 5, 5, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 5, TrainerPsychicRodney, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND + person_event SPRITE_POKEFAN_M, 3, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerPokefanmJeremy, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND + person_event SPRITE_POKEFAN_F, 5, 5, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerPokefanfGeorgia, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND + person_event SPRITE_SUPER_NERD, 15, 1, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerSupernerdShawn, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND diff --git a/maps/FastShipCabins_SW_SSW_NW.asm b/maps/FastShipCabins_SW_SSW_NW.asm index b19944dc6..0c610e5df 100644 --- a/maps/FastShipCabins_SW_SSW_NW.asm +++ b/maps/FastShipCabins_SW_SSW_NW.asm @@ -239,7 +239,7 @@ FastShipCabins_SW_SSW_NW_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_FISHER, 19, 5, $1e, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 2, TrainerFirebreatherLyle, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP - person_event SPRITE_BUG_CATCHER, 19, 10, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerBug_catcherKen, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND - person_event SPRITE_BUENA, 30, 5, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerBeautyCassie, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND - person_event SPRITE_ROCKER, 32, 7, $1e, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 2, TrainerGuitaristClyde, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND + person_event SPRITE_FISHER, 15, 1, $1e, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 2, TrainerFirebreatherLyle, EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP + person_event SPRITE_BUG_CATCHER, 15, 6, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerBug_catcherKen, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND + person_event SPRITE_BUENA, 26, 1, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerBeautyCassie, EVENT_FAST_SHIP_PASSENGERS_EASTBOUND + person_event SPRITE_ROCKER, 28, 3, $1e, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 2, TrainerGuitaristClyde, EVENT_FAST_SHIP_PASSENGERS_WESTBOUND diff --git a/maps/FightingDojo.asm b/maps/FightingDojo.asm index 86d5a3cac..8b6869caf 100644 --- a/maps/FightingDojo.asm +++ b/maps/FightingDojo.asm @@ -57,5 +57,5 @@ FightingDojo_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_BLACK_BELT, 8, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, BlackBeltScript_0x189b61, -1 - person_event SPRITE_POKE_BALL, 5, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x189b6a, EVENT_PICKED_UP_FOCUS_BAND + person_event SPRITE_BLACK_BELT, 4, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, BlackBeltScript_0x189b61, -1 + person_event SPRITE_POKE_BALL, 1, 3, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x189b6a, EVENT_PICKED_UP_FOCUS_BAND diff --git a/maps/FuchsiaBillSpeechHouse.asm b/maps/FuchsiaBillSpeechHouse.asm index 97507e727..d523e58be 100644 --- a/maps/FuchsiaBillSpeechHouse.asm +++ b/maps/FuchsiaBillSpeechHouse.asm @@ -40,5 +40,5 @@ FuchsiaBillSpeechHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_POKEFAN_F, 7, 6, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, PokefanFScript_0x1963bd, -1 - person_event SPRITE_YOUNGSTER, 8, 10, $4, 1, 0, -1, -1, 0, 0, 0, YoungsterScript_0x1963c0, -1 + person_event SPRITE_POKEFAN_F, 3, 2, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PokefanFScript_0x1963bd, -1 + person_event SPRITE_YOUNGSTER, 4, 6, $4, 1, 0, -1, -1, 0, 0, 0, YoungsterScript_0x1963c0, -1 diff --git a/maps/FuchsiaCity.asm b/maps/FuchsiaCity.asm index 52cc9737f..5f8bfd8ef 100644 --- a/maps/FuchsiaCity.asm +++ b/maps/FuchsiaCity.asm @@ -154,7 +154,7 @@ FuchsiaCity_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_YOUNGSTER, 22, 27, $2, 1, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x194b22, -1 - person_event SPRITE_POKEFAN_M, 12, 17, $2, 1, 1, -1, -1, 8 + PAL_OW_BROWN, 0, 0, PokefanMScript_0x194b25, -1 - person_event SPRITE_TEACHER, 18, 20, $2, 1, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, TeacherScript_0x194b28, -1 - person_event SPRITE_FRUIT_TREE, 5, 12, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x194b43, -1 + person_event SPRITE_YOUNGSTER, 18, 23, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x194b22, -1 + person_event SPRITE_POKEFAN_M, 8, 13, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, PokefanMScript_0x194b25, -1 + person_event SPRITE_TEACHER, 14, 16, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, TeacherScript_0x194b28, -1 + person_event SPRITE_FRUIT_TREE, 1, 8, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x194b43, -1 diff --git a/maps/FuchsiaGym.asm b/maps/FuchsiaGym.asm index cf9effda0..360783a11 100644 --- a/maps/FuchsiaGym.asm +++ b/maps/FuchsiaGym.asm @@ -391,9 +391,9 @@ FuchsiaGym_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_JANINE, 14, 5, $3, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, JanineScript_0x195db9, -1 - person_event SPRITE_FUCHSIA_GYM_1, 11, 9, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, FuschiaGym1Script_0x195e1b, -1 - person_event SPRITE_FUCHSIA_GYM_2, 15, 9, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, FuschiaGym2Script_0x195e55, -1 - person_event SPRITE_FUCHSIA_GYM_3, 8, 13, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, FuschiaGym3Script_0x195e8f, -1 - person_event SPRITE_FUCHSIA_GYM_4, 6, 8, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, FuschiaGym4Script_0x195ec9, -1 - person_event SPRITE_GYM_GUY, 19, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, FuchsiaGymGuyScript, -1 + person_event SPRITE_JANINE, 10, 1, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, JanineScript_0x195db9, -1 + person_event SPRITE_FUCHSIA_GYM_1, 7, 5, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, FuschiaGym1Script_0x195e1b, -1 + person_event SPRITE_FUCHSIA_GYM_2, 11, 5, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, FuschiaGym2Script_0x195e55, -1 + person_event SPRITE_FUCHSIA_GYM_3, 4, 9, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, FuschiaGym3Script_0x195e8f, -1 + person_event SPRITE_FUCHSIA_GYM_4, 2, 4, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, FuschiaGym4Script_0x195ec9, -1 + person_event SPRITE_GYM_GUY, 15, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, FuchsiaGymGuyScript, -1 diff --git a/maps/FuchsiaMart.asm b/maps/FuchsiaMart.asm index 0d7569f8e..6b240ac15 100644 --- a/maps/FuchsiaMart.asm +++ b/maps/FuchsiaMart.asm @@ -49,6 +49,6 @@ FuchsiaMart_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x195ce8, -1 - person_event SPRITE_FISHER, 6, 7, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, FisherScript_0x195cef, -1 - person_event SPRITE_COOLTRAINER_F, 10, 11, $5, 0, 2, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x195cf2, -1 + person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x195ce8, -1 + person_event SPRITE_FISHER, 2, 3, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, FisherScript_0x195cef, -1 + person_event SPRITE_COOLTRAINER_F, 6, 7, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x195cf2, -1 diff --git a/maps/FuchsiaPokeCenter1F.asm b/maps/FuchsiaPokeCenter1F.asm index bb58030ab..183ec426c 100644 --- a/maps/FuchsiaPokeCenter1F.asm +++ b/maps/FuchsiaPokeCenter1F.asm @@ -102,7 +102,7 @@ FuchsiaPokeCenter1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, NurseScript_0x196459, -1 - person_event SPRITE_COOLTRAINER_M, 8, 12, $5, 0, 1, -1, -1, 0, 0, 0, CooltrainerMScript_0x19645c, -1 - person_event SPRITE_COOLTRAINER_F, 8, 5, $5, 0, 1, -1, -1, 0, 0, 0, CooltrainerFScript_0x19645f, -1 - person_event SPRITE_JANINE_IMPERSONATOR, 7, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, JanineImpersonatorScript_0x196462, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, NurseScript_0x196459, -1 + person_event SPRITE_COOLTRAINER_M, 4, 8, $5, 0, 1, -1, -1, 0, 0, 0, CooltrainerMScript_0x19645c, -1 + person_event SPRITE_COOLTRAINER_F, 4, 1, $5, 0, 1, -1, -1, 0, 0, 0, CooltrainerFScript_0x19645f, -1 + person_event SPRITE_JANINE_IMPERSONATOR, 3, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, JanineImpersonatorScript_0x196462, -1 diff --git a/maps/GoldenrodBikeShop.asm b/maps/GoldenrodBikeShop.asm index 8b4dba800..39a3313f3 100644 --- a/maps/GoldenrodBikeShop.asm +++ b/maps/GoldenrodBikeShop.asm @@ -125,4 +125,4 @@ GoldenrodBikeShop_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_CLERK, 6, 11, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ClerkScript_0x54750, -1 + person_event SPRITE_CLERK, 2, 7, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ClerkScript_0x54750, -1 diff --git a/maps/GoldenrodBillsHouse.asm b/maps/GoldenrodBillsHouse.asm index 23466a07f..e8fcd7602 100644 --- a/maps/GoldenrodBillsHouse.asm +++ b/maps/GoldenrodBillsHouse.asm @@ -257,6 +257,6 @@ GoldenrodBillsHouse_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_BILL, 7, 6, $9, 0, 0, -1, -1, 0, 0, 0, BillsHouseBill, EVENT_MET_BILL - person_event SPRITE_POKEFAN_F, 7, 9, $6, 0, 0, -1, -1, 0, 0, 0, BillsMom, -1 - person_event SPRITE_TWIN, 8, 9, $2, 1, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, BillsSister, -1 + person_event SPRITE_BILL, 3, 2, $9, 0, 0, -1, -1, 0, 0, 0, BillsHouseBill, EVENT_MET_BILL + person_event SPRITE_POKEFAN_F, 3, 5, $6, 0, 0, -1, -1, 0, 0, 0, BillsMom, -1 + person_event SPRITE_TWIN, 4, 5, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, BillsSister, -1 diff --git a/maps/GoldenrodCity.asm b/maps/GoldenrodCity.asm index 36c41f244..e08d75df5 100644 --- a/maps/GoldenrodCity.asm +++ b/maps/GoldenrodCity.asm @@ -43,7 +43,7 @@ MoveTutor: writetext UnknownText_0x199042 yesorno iffalse .Refused - special Function24b25 + special Special_DisplayCoinCaseBalance writetext UnknownText_0x199090 yesorno iffalse .Refused2 @@ -114,7 +114,7 @@ MoveTutor: takecoins 4000 waitbutton playsound SFX_TRANSACTION - special Function24b25 + special Special_DisplayCoinCaseBalance writetext UnknownText_0x19918b closetext loadmovesprites @@ -581,18 +581,18 @@ GoldenrodCity_MapEventHeader: .PersonEvents: db 15 - person_event SPRITE_POKEFAN_M, 22, 11, $7, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x1989e3, EVENT_GOLDENROD_CITY_CIVILIANS - person_event SPRITE_YOUNGSTER, 21, 34, $2, 1, 1, -1, -1, 0, 0, 0, YoungsterScript_0x1989e6, EVENT_GOLDENROD_CITY_CIVILIANS - person_event SPRITE_COOLTRAINER_F, 20, 16, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x1989e9, EVENT_GOLDENROD_CITY_CIVILIANS - person_event SPRITE_COOLTRAINER_F, 30, 24, $2, 2, 1, -1, -1, 0, 0, 0, CooltrainerFScript_0x1989fd, EVENT_GOLDENROD_CITY_CIVILIANS - person_event SPRITE_YOUNGSTER, 21, 23, $2, 1, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x198a11, EVENT_GOLDENROD_CITY_CIVILIANS - person_event SPRITE_LASS, 14, 21, $5, 0, 2, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LassScript_0x198a14, EVENT_GOLDENROD_CITY_CIVILIANS - person_event SPRITE_GRAMPS, 31, 15, $5, 0, 1, -1, -1, 0, 0, 0, GrampsScript_0x198a17, EVENT_GOLDENROD_CITY_CIVILIANS - person_event SPRITE_ROCKET, 20, 8, $7, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x198a1a, EVENT_GOLDENROD_CITY_ROCKET_SCOUT - person_event SPRITE_ROCKET, 24, 32, $7, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x198a29, EVENT_GOLDENROD_CITY_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 19, 12, $6, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x198a2c, EVENT_GOLDENROD_CITY_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 27, 20, $9, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x198a2f, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 24, 33, $7, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x198a32, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 11, 33, $6, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x198a35, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 14, 35, $8, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x198a38, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_POKEFAN_M, 26, 16, $3, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, MoveTutor, EVENT_GOLDENROD_CITY_MOVE_TUTOR + person_event SPRITE_POKEFAN_M, 18, 7, $7, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x1989e3, EVENT_GOLDENROD_CITY_CIVILIANS + person_event SPRITE_YOUNGSTER, 17, 30, $2, 1, 1, -1, -1, 0, 0, 0, YoungsterScript_0x1989e6, EVENT_GOLDENROD_CITY_CIVILIANS + person_event SPRITE_COOLTRAINER_F, 16, 12, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x1989e9, EVENT_GOLDENROD_CITY_CIVILIANS + person_event SPRITE_COOLTRAINER_F, 26, 20, $2, 2, 1, -1, -1, 0, 0, 0, CooltrainerFScript_0x1989fd, EVENT_GOLDENROD_CITY_CIVILIANS + person_event SPRITE_YOUNGSTER, 17, 19, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x198a11, EVENT_GOLDENROD_CITY_CIVILIANS + person_event SPRITE_LASS, 10, 17, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LassScript_0x198a14, EVENT_GOLDENROD_CITY_CIVILIANS + person_event SPRITE_GRAMPS, 27, 11, $5, 0, 1, -1, -1, 0, 0, 0, GrampsScript_0x198a17, EVENT_GOLDENROD_CITY_CIVILIANS + person_event SPRITE_ROCKET, 16, 4, $7, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x198a1a, EVENT_GOLDENROD_CITY_ROCKET_SCOUT + person_event SPRITE_ROCKET, 20, 28, $7, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x198a29, EVENT_GOLDENROD_CITY_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 15, 8, $6, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x198a2c, EVENT_GOLDENROD_CITY_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 23, 16, $9, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x198a2f, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 20, 29, $7, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x198a32, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 7, 29, $6, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x198a35, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 10, 31, $8, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x198a38, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_POKEFAN_M, 22, 12, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, MoveTutor, EVENT_GOLDENROD_CITY_MOVE_TUTOR diff --git a/maps/GoldenrodDeptStore1F.asm b/maps/GoldenrodDeptStore1F.asm index 574234975..fc4064ce0 100644 --- a/maps/GoldenrodDeptStore1F.asm +++ b/maps/GoldenrodDeptStore1F.asm @@ -93,7 +93,7 @@ GoldenrodDeptStore1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_RECEPTIONIST, 5, 14, $6, 0, 0, -1, -1, 0, 0, 0, ReceptionistScript_0x55981, -1 - person_event SPRITE_POKEFAN_F, 8, 9, $6, 0, 0, -1, -1, 0, 0, 0, PokefanFScript_0x55987, -1 - person_event SPRITE_BUG_CATCHER, 9, 9, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, BugCatcherScript_0x5598a, -1 - person_event SPRITE_GENTLEMAN, 9, 15, $2, 1, 1, -1, -1, 0, 0, 0, GentlemanScript_0x55984, -1 + person_event SPRITE_RECEPTIONIST, 1, 10, $6, 0, 0, -1, -1, 0, 0, 0, ReceptionistScript_0x55981, -1 + person_event SPRITE_POKEFAN_F, 4, 5, $6, 0, 0, -1, -1, 0, 0, 0, PokefanFScript_0x55987, -1 + person_event SPRITE_BUG_CATCHER, 5, 5, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, BugCatcherScript_0x5598a, -1 + person_event SPRITE_GENTLEMAN, 5, 11, $2, 1, 1, -1, -1, 0, 0, 0, GentlemanScript_0x55984, -1 diff --git a/maps/GoldenrodDeptStore2F.asm b/maps/GoldenrodDeptStore2F.asm index c86f89829..61f8e767f 100644 --- a/maps/GoldenrodDeptStore2F.asm +++ b/maps/GoldenrodDeptStore2F.asm @@ -113,8 +113,8 @@ GoldenrodDeptStore2F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_CLERK, 9, 17, $7, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x55b5d, -1 - person_event SPRITE_CLERK, 10, 17, $8, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x55b65, -1 - person_event SPRITE_YOUNGSTER, 10, 13, $4, 1, 0, -1, -1, 0, 0, 0, YoungsterScript_0x55b6d, -1 - person_event SPRITE_COOLTRAINER_F, 6, 10, $5, 0, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerFScript_0x55b70, -1 - person_event SPRITE_GENTLEMAN, 10, 6, $3, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x55b73, -1 + person_event SPRITE_CLERK, 5, 13, $7, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x55b5d, -1 + person_event SPRITE_CLERK, 6, 13, $8, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x55b65, -1 + person_event SPRITE_YOUNGSTER, 6, 9, $4, 1, 0, -1, -1, 0, 0, 0, YoungsterScript_0x55b6d, -1 + person_event SPRITE_COOLTRAINER_F, 2, 6, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerFScript_0x55b70, -1 + person_event SPRITE_GENTLEMAN, 6, 2, $3, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x55b73, -1 diff --git a/maps/GoldenrodDeptStore3F.asm b/maps/GoldenrodDeptStore3F.asm index dbad2bf32..40e3c507f 100644 --- a/maps/GoldenrodDeptStore3F.asm +++ b/maps/GoldenrodDeptStore3F.asm @@ -71,6 +71,6 @@ GoldenrodDeptStore3F_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 5, 10, $6, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x55db8, -1 - person_event SPRITE_SUPER_NERD, 9, 16, $a, 1, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, SuperNerdScript_0x55dc0, -1 - person_event SPRITE_ROCKER, 9, 6, $4, 1, 0, -1, -1, 0, 0, 0, RockerScript_0x55dc3, -1 + person_event SPRITE_CLERK, 1, 6, $6, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x55db8, -1 + person_event SPRITE_SUPER_NERD, 5, 12, $a, 1, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SuperNerdScript_0x55dc0, -1 + person_event SPRITE_ROCKER, 5, 2, $4, 1, 0, -1, -1, 0, 0, 0, RockerScript_0x55dc3, -1 diff --git a/maps/GoldenrodDeptStore4F.asm b/maps/GoldenrodDeptStore4F.asm index 096458710..d26263e58 100644 --- a/maps/GoldenrodDeptStore4F.asm +++ b/maps/GoldenrodDeptStore4F.asm @@ -91,7 +91,7 @@ GoldenrodDeptStore4F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_CLERK, 9, 17, $7, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x55ee9, -1 - person_event SPRITE_COOLTRAINER_M, 11, 15, $9, 0, 0, -1, -1, 0, 0, 0, CooltrainerMScript_0x55ef1, -1 - person_event SPRITE_BUG_CATCHER, 6, 11, $5, 0, 1, -1, -1, 0, 0, 0, BugCatcherScript_0x55ef4, -1 - person_event SPRITE_GAMEBOY_KID, 5, 9, $6, 0, 0, -1, -1, 0, 0, 0, GameboyKidScript_0x55ef7, -1 + person_event SPRITE_CLERK, 5, 13, $7, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x55ee9, -1 + person_event SPRITE_COOLTRAINER_M, 7, 11, $9, 0, 0, -1, -1, 0, 0, 0, CooltrainerMScript_0x55ef1, -1 + person_event SPRITE_BUG_CATCHER, 2, 7, $5, 0, 1, -1, -1, 0, 0, 0, BugCatcherScript_0x55ef4, -1 + person_event SPRITE_GAMEBOY_KID, 1, 5, $6, 0, 0, -1, -1, 0, 0, 0, GameboyKidScript_0x55ef7, -1 diff --git a/maps/GoldenrodDeptStore5F.asm b/maps/GoldenrodDeptStore5F.asm index e62ad889a..94b19336c 100644 --- a/maps/GoldenrodDeptStore5F.asm +++ b/maps/GoldenrodDeptStore5F.asm @@ -232,9 +232,9 @@ GoldenrodDeptStore5F_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_CLERK, 9, 12, $7, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x5609c, -1 - person_event SPRITE_LASS, 10, 7, $2, 1, 1, -1, -1, 0, 0, 0, LassScript_0x56130, -1 - person_event SPRITE_COOLTRAINER_M, 7, 10, $3, 0, 0, -1, -1, 0, 0, 0, CooltrainerMScript_0x56133, -1 - person_event SPRITE_POKEFAN_M, 9, 17, $2, 2, 2, -1, -1, 0, 0, 0, PokefanMScript_0x5613a, -1 - person_event SPRITE_TWIN, 5, 13, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TwinScript_0x56118, -1 - person_event SPRITE_RECEPTIONIST, 9, 11, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ReceptionistScript_0x560ce, EVENT_GOLDENROD_DEPT_STORE_5F_HAPPINESS_EVENT_LADY + person_event SPRITE_CLERK, 5, 8, $7, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x5609c, -1 + person_event SPRITE_LASS, 6, 3, $2, 1, 1, -1, -1, 0, 0, 0, LassScript_0x56130, -1 + person_event SPRITE_COOLTRAINER_M, 3, 6, $3, 0, 0, -1, -1, 0, 0, 0, CooltrainerMScript_0x56133, -1 + person_event SPRITE_POKEFAN_M, 5, 13, $2, 2, 2, -1, -1, 0, 0, 0, PokefanMScript_0x5613a, -1 + person_event SPRITE_TWIN, 1, 9, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TwinScript_0x56118, -1 + person_event SPRITE_RECEPTIONIST, 5, 7, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ReceptionistScript_0x560ce, EVENT_GOLDENROD_DEPT_STORE_5F_HAPPINESS_EVENT_LADY diff --git a/maps/GoldenrodDeptStore6F.asm b/maps/GoldenrodDeptStore6F.asm index 407457448..e64e1db54 100644 --- a/maps/GoldenrodDeptStore6F.asm +++ b/maps/GoldenrodDeptStore6F.asm @@ -169,5 +169,5 @@ GoldenrodDeptStore6F_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_LASS, 6, 14, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LassScript_0x564bf, -1 - person_event SPRITE_SUPER_NERD, 6, 12, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, SuperNerdScript_0x564c2, -1 + person_event SPRITE_LASS, 2, 10, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LassScript_0x564bf, -1 + person_event SPRITE_SUPER_NERD, 2, 8, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SuperNerdScript_0x564c2, -1 diff --git a/maps/GoldenrodDeptStoreB1F.asm b/maps/GoldenrodDeptStoreB1F.asm index 63fde1498..e0606ed4d 100644 --- a/maps/GoldenrodDeptStoreB1F.asm +++ b/maps/GoldenrodDeptStoreB1F.asm @@ -121,11 +121,11 @@ GoldenrodDeptStoreB1F_MapEventHeader: .PersonEvents: db 8 - person_event SPRITE_POKE_BALL, 19, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7d7c3, EVENT_GOLDENROD_DEPT_STORE_B1F_ETHER - person_event SPRITE_POKE_BALL, 6, 18, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7d7c5, EVENT_GOLDENROD_DEPT_STORE_B1F_AMULET_COIN - person_event SPRITE_POKE_BALL, 7, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7d7c7, EVENT_GOLDENROD_DEPT_STORE_B1F_BURN_HEAL - person_event SPRITE_POKE_BALL, 19, 19, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7d7c9, EVENT_GOLDENROD_DEPT_STORE_B1F_ULTRA_BALL - person_event SPRITE_BLACK_BELT, 14, 13, $4, 1, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, BlackBeltScript_0x7d7b0, -1 - person_event SPRITE_BLACK_BELT, 12, 8, $3, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, BlackBeltScript_0x7d7b3, -1 - person_event SPRITE_BLACK_BELT, 17, 10, $5, 0, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, BlackBeltScript_0x7d7b6, -1 - person_event SPRITE_MACHOP, 11, 11, $16, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, MachopScript_0x7d7b9, -1 + person_event SPRITE_POKE_BALL, 15, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7d7c3, EVENT_GOLDENROD_DEPT_STORE_B1F_ETHER + person_event SPRITE_POKE_BALL, 2, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7d7c5, EVENT_GOLDENROD_DEPT_STORE_B1F_AMULET_COIN + person_event SPRITE_POKE_BALL, 3, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7d7c7, EVENT_GOLDENROD_DEPT_STORE_B1F_BURN_HEAL + person_event SPRITE_POKE_BALL, 15, 15, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7d7c9, EVENT_GOLDENROD_DEPT_STORE_B1F_ULTRA_BALL + person_event SPRITE_BLACK_BELT, 10, 9, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, BlackBeltScript_0x7d7b0, -1 + person_event SPRITE_BLACK_BELT, 8, 4, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, BlackBeltScript_0x7d7b3, -1 + person_event SPRITE_BLACK_BELT, 13, 6, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, BlackBeltScript_0x7d7b6, -1 + person_event SPRITE_MACHOP, 7, 7, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, MachopScript_0x7d7b9, -1 diff --git a/maps/GoldenrodDeptStoreRoof.asm b/maps/GoldenrodDeptStoreRoof.asm index c8d1c70be..9e65e1b54 100644 --- a/maps/GoldenrodDeptStoreRoof.asm +++ b/maps/GoldenrodDeptStoreRoof.asm @@ -225,11 +225,11 @@ GoldenrodDeptStoreRoof_MapEventHeader: .PersonEvents: db 8 - person_event SPRITE_CLERK, 8, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x5673f, EVENT_GOLDENROD_SALE_OFF - person_event SPRITE_POKEFAN_F, 7, 14, $5, 0, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, PokefanFScript_0x56746, -1 - person_event SPRITE_FISHER, 5, 6, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, FisherScript_0x56749, -1 - person_event SPRITE_TWIN, 8, 7, $2, 1, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TwinScript_0x56754, EVENT_GOLDENROD_SALE_ON - person_event SPRITE_SUPER_NERD, 10, 18, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, SuperNerdScript_0x56757, EVENT_GOLDENROD_SALE_ON - person_event SPRITE_POKEFAN_M, 4, 11, $5, 0, 1, -1, -1, 0, 0, 0, PokefanMScript_0x5676a, EVENT_GOLDENROD_SALE_OFF - person_event SPRITE_TEACHER, 7, 9, $2, 1, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TeacherScript_0x5676d, EVENT_GOLDENROD_SALE_OFF - person_event SPRITE_BUG_CATCHER, 10, 5, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, BugCatcherScript_0x56770, EVENT_GOLDENROD_SALE_OFF + person_event SPRITE_CLERK, 4, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x5673f, EVENT_GOLDENROD_SALE_OFF + person_event SPRITE_POKEFAN_F, 3, 10, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PokefanFScript_0x56746, -1 + person_event SPRITE_FISHER, 1, 2, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, FisherScript_0x56749, -1 + person_event SPRITE_TWIN, 4, 3, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TwinScript_0x56754, EVENT_GOLDENROD_SALE_ON + person_event SPRITE_SUPER_NERD, 6, 14, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, SuperNerdScript_0x56757, EVENT_GOLDENROD_SALE_ON + person_event SPRITE_POKEFAN_M, 0, 7, $5, 0, 1, -1, -1, 0, 0, 0, PokefanMScript_0x5676a, EVENT_GOLDENROD_SALE_OFF + person_event SPRITE_TEACHER, 3, 5, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TeacherScript_0x5676d, EVENT_GOLDENROD_SALE_OFF + person_event SPRITE_BUG_CATCHER, 6, 1, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, BugCatcherScript_0x56770, EVENT_GOLDENROD_SALE_OFF diff --git a/maps/GoldenrodFlowerShop.asm b/maps/GoldenrodFlowerShop.asm index 3be54f501..4ff95dd8f 100644 --- a/maps/GoldenrodFlowerShop.asm +++ b/maps/GoldenrodFlowerShop.asm @@ -172,5 +172,5 @@ GoldenrodFlowerShop_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_TEACHER, 8, 6, $9, 0, 0, -1, -1, 0, 0, 0, FlowerShopTeacherScript, -1 - person_event SPRITE_LASS, 10, 9, $2, 1, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, FlowerShopFloriaScript, EVENT_FLORIA_AT_FLOWER_SHOP + person_event SPRITE_TEACHER, 4, 2, $9, 0, 0, -1, -1, 0, 0, 0, FlowerShopTeacherScript, -1 + person_event SPRITE_LASS, 6, 5, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, FlowerShopFloriaScript, EVENT_FLORIA_AT_FLOWER_SHOP diff --git a/maps/GoldenrodGameCorner.asm b/maps/GoldenrodGameCorner.asm index 0d97236b5..6fcd393dd 100644 --- a/maps/GoldenrodGameCorner.asm +++ b/maps/GoldenrodGameCorner.asm @@ -49,7 +49,7 @@ ReceptionistScript_0x56c28: iffalse UnknownScript_0x56cc3 writetext UnknownText_0x56e8b UnknownScript_0x56c36: ; 056c36 - special Function24b25 + special Special_DisplayCoinCaseBalance loadmenudata MenuDataHeader_0x56cc9 interpretmenu2 writebackup @@ -153,7 +153,7 @@ ReceptionistScript_0x56d01: iffalse UnknownScript_0x56cc3 UnknownScript_0x56d0c: writetext UnknownText_0x56e8b - special Function24b25 + special Special_DisplayCoinCaseBalance loadmenudata MenuDataHeader_0x56db0 interpretmenu2 writebackup @@ -479,15 +479,15 @@ GoldenrodGameCorner_MapEventHeader: .PersonEvents: db 12 - person_event SPRITE_CLERK, 6, 7, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ClerkScript_0x56c25, -1 - person_event SPRITE_RECEPTIONIST, 6, 20, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ReceptionistScript_0x56c28, -1 - person_event SPRITE_RECEPTIONIST, 6, 22, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ReceptionistScript_0x56d01, -1 - person_event SPRITE_PHARMACIST, 11, 12, $8, 0, 0, -1, 2, 8 + PAL_OW_BLUE, 0, 0, PharmacistScript_0x56df1, -1 - person_event SPRITE_PHARMACIST, 11, 12, $8, 0, 0, -1, 4, 8 + PAL_OW_BLUE, 0, 0, PharmacistScript_0x56df1, -1 - person_event SPRITE_POKEFAN_M, 14, 15, $9, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, PokefanMScript_0x56dfc, -1 - person_event SPRITE_COOLTRAINER_M, 12, 18, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, CooltrainerMScript_0x56e07, -1 - person_event SPRITE_POKEFAN_F, 10, 21, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, PokefanFScript_0x56e12, -1 - person_event SPRITE_COOLTRAINER_F, 7, 14, $2, 1, 2, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x56e1d, -1 - person_event SPRITE_GENTLEMAN, 14, 9, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GentlemanScript_0x56e20, -1 - person_event SPRITE_POKEFAN_M, 13, 6, $2, 1, 1, -1, -1, 8 + PAL_OW_BROWN, 0, 0, PokefanMScript_0x56e2b, -1 - person_event SPRITE_POKEFAN_M, 14, 21, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, PokefanMScript_0x56c1a, EVENT_GOLDENROD_GAME_CORNER_MOVE_TUTOR + person_event SPRITE_CLERK, 2, 3, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ClerkScript_0x56c25, -1 + person_event SPRITE_RECEPTIONIST, 2, 16, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ReceptionistScript_0x56c28, -1 + person_event SPRITE_RECEPTIONIST, 2, 18, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ReceptionistScript_0x56d01, -1 + person_event SPRITE_PHARMACIST, 7, 8, $8, 0, 0, -1, 2, (1 << 3) | PAL_OW_BLUE, 0, 0, PharmacistScript_0x56df1, -1 + person_event SPRITE_PHARMACIST, 7, 8, $8, 0, 0, -1, 4, (1 << 3) | PAL_OW_BLUE, 0, 0, PharmacistScript_0x56df1, -1 + person_event SPRITE_POKEFAN_M, 10, 11, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, PokefanMScript_0x56dfc, -1 + person_event SPRITE_COOLTRAINER_M, 8, 14, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, CooltrainerMScript_0x56e07, -1 + person_event SPRITE_POKEFAN_F, 6, 17, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PokefanFScript_0x56e12, -1 + person_event SPRITE_COOLTRAINER_F, 3, 10, $2, 1, 2, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x56e1d, -1 + person_event SPRITE_GENTLEMAN, 10, 5, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GentlemanScript_0x56e20, -1 + person_event SPRITE_POKEFAN_M, 9, 2, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, PokefanMScript_0x56e2b, -1 + person_event SPRITE_POKEFAN_M, 10, 17, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PokefanMScript_0x56c1a, EVENT_GOLDENROD_GAME_CORNER_MOVE_TUTOR diff --git a/maps/GoldenrodGym.asm b/maps/GoldenrodGym.asm index 5ba9caed8..fc30ac036 100644 --- a/maps/GoldenrodGym.asm +++ b/maps/GoldenrodGym.asm @@ -393,9 +393,9 @@ GoldenrodGym_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_WHITNEY, 7, 12, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, WhitneyScript_0x5400c, -1 - person_event SPRITE_LASS, 17, 13, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 4, TrainerLassCarrie, -1 - person_event SPRITE_LASS, 10, 13, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerLassBridget, -1 - person_event SPRITE_BUENA, 6, 4, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerBeautyVictoria, -1 - person_event SPRITE_BUENA, 9, 23, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerBeautySamantha, -1 - person_event SPRITE_GYM_GUY, 19, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, GoldenrodGymGuyScript, -1 + person_event SPRITE_WHITNEY, 3, 8, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, WhitneyScript_0x5400c, -1 + person_event SPRITE_LASS, 13, 9, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 4, TrainerLassCarrie, -1 + person_event SPRITE_LASS, 6, 9, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerLassBridget, -1 + person_event SPRITE_BUENA, 2, 0, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerBeautyVictoria, -1 + person_event SPRITE_BUENA, 5, 19, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerBeautySamantha, -1 + person_event SPRITE_GYM_GUY, 15, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, GoldenrodGymGuyScript, -1 diff --git a/maps/GoldenrodHappinessRater.asm b/maps/GoldenrodHappinessRater.asm index 8b765f757..5987e88c7 100644 --- a/maps/GoldenrodHappinessRater.asm +++ b/maps/GoldenrodHappinessRater.asm @@ -151,6 +151,6 @@ GoldenrodHappinessRater_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_TEACHER, 8, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, TeacherScript_0x54953, -1 - person_event SPRITE_POKEFAN_M, 7, 9, $8, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x54997, -1 - person_event SPRITE_TWIN, 10, 9, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TwinScript_0x5499a, -1 + person_event SPRITE_TEACHER, 4, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, TeacherScript_0x54953, -1 + person_event SPRITE_POKEFAN_M, 3, 5, $8, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x54997, -1 + person_event SPRITE_TWIN, 6, 5, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TwinScript_0x5499a, -1 diff --git a/maps/GoldenrodMagnetTrainStation.asm b/maps/GoldenrodMagnetTrainStation.asm index ca567245e..218ca086b 100644 --- a/maps/GoldenrodMagnetTrainStation.asm +++ b/maps/GoldenrodMagnetTrainStation.asm @@ -182,5 +182,5 @@ GoldenrodMagnetTrainStation_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_OFFICER, 13, 13, $6, 0, 0, -1, -1, 0, 0, 0, OfficerScript_0x550ec, -1 - person_event SPRITE_GENTLEMAN, 18, 15, $2, 2, 2, -1, -1, 0, 0, 0, GentlemanScript_0x55143, EVENT_GOLDENROD_TRAIN_STATION_GENTLEMAN + person_event SPRITE_OFFICER, 9, 9, $6, 0, 0, -1, -1, 0, 0, 0, OfficerScript_0x550ec, -1 + person_event SPRITE_GENTLEMAN, 14, 11, $2, 2, 2, -1, -1, 0, 0, 0, GentlemanScript_0x55143, EVENT_GOLDENROD_TRAIN_STATION_GENTLEMAN diff --git a/maps/GoldenrodNameRatersHouse.asm b/maps/GoldenrodNameRatersHouse.asm index ace1d7180..ff13bb628 100644 --- a/maps/GoldenrodNameRatersHouse.asm +++ b/maps/GoldenrodNameRatersHouse.asm @@ -41,4 +41,4 @@ GoldenrodNameRatersHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_GENTLEMAN, 8, 6, $6, 0, 2, -1, -1, 0, 0, 0, GentlemanScript_0x5577c, -1 + person_event SPRITE_GENTLEMAN, 4, 2, $6, 0, 2, -1, -1, 0, 0, 0, GentlemanScript_0x5577c, -1 diff --git a/maps/GoldenrodPPSpeechHouse.asm b/maps/GoldenrodPPSpeechHouse.asm index ccee18b5a..294849c5c 100644 --- a/maps/GoldenrodPPSpeechHouse.asm +++ b/maps/GoldenrodPPSpeechHouse.asm @@ -67,5 +67,5 @@ GoldenrodPPSpeechHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_FISHER, 8, 6, $4, 1, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FisherScript_0x5564a, -1 - person_event SPRITE_LASS, 7, 9, $8, 1, 0, -1, -1, 0, 0, 0, LassScript_0x5564d, -1 + person_event SPRITE_FISHER, 4, 2, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FisherScript_0x5564a, -1 + person_event SPRITE_LASS, 3, 5, $8, 1, 0, -1, -1, 0, 0, 0, LassScript_0x5564d, -1 diff --git a/maps/GoldenrodPokeCenter1F.asm b/maps/GoldenrodPokeCenter1F.asm index 8a8783b23..e36bc907e 100644 --- a/maps/GoldenrodPokeCenter1F.asm +++ b/maps/GoldenrodPokeCenter1F.asm @@ -818,8 +818,8 @@ GoldenrodPokeCenter1F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x60f91, -1 - person_event SPRITE_LINK_RECEPTIONIST, 12, 20, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ObjectEvent, -1 - person_event SPRITE_GAMEBOY_KID, 5, 10, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, GameboyKidScript_0x6101e, -1 - person_event SPRITE_LASS, 8, 5, $5, 0, 1, -1, -1, 0, 0, 0, LassScript_0x61021, -1 - person_event SPRITE_POKEFAN_F, 9, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, PokefanFScript_0x61024, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x60f91, -1 + person_event SPRITE_LINK_RECEPTIONIST, 8, 16, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ObjectEvent, -1 + person_event SPRITE_GAMEBOY_KID, 1, 6, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, GameboyKidScript_0x6101e, -1 + person_event SPRITE_LASS, 4, 1, $5, 0, 1, -1, -1, 0, 0, 0, LassScript_0x61021, -1 + person_event SPRITE_POKEFAN_F, 5, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, PokefanFScript_0x61024, -1 diff --git a/maps/GoldenrodPokeComCenter2FMobile.asm b/maps/GoldenrodPokeComCenter2FMobile.asm index b38957e30..30fb9e7fb 100644 --- a/maps/GoldenrodPokeComCenter2FMobile.asm +++ b/maps/GoldenrodPokeComCenter2FMobile.asm @@ -283,6 +283,6 @@ GoldenrodPokeComCenter2FMobile_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_SCIENTIST, 32, 8, $4, 1, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ScientistScript_0x625d1, -1 - person_event SPRITE_SCIENTIST, 31, 11, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ScientistScript_0x625d4, -1 - person_event SPRITE_SCIENTIST, 33, 11, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ScientistScript_0x625d7, -1 + person_event SPRITE_SCIENTIST, 28, 4, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ScientistScript_0x625d1, -1 + person_event SPRITE_SCIENTIST, 27, 7, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ScientistScript_0x625d4, -1 + person_event SPRITE_SCIENTIST, 29, 7, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ScientistScript_0x625d7, -1 diff --git a/maps/GuideGentsHouse.asm b/maps/GuideGentsHouse.asm index f7f3ac64a..eb6c156f1 100644 --- a/maps/GuideGentsHouse.asm +++ b/maps/GuideGentsHouse.asm @@ -43,4 +43,4 @@ GuideGentsHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_GRAMPS, 7, 6, $9, 0, 0, -1, -1, 0, 0, 0, GuideGentsHouseGuideGent, EVENT_GUIDE_GENT_VISIBLE_IN_CHERRYGROVE + person_event SPRITE_GRAMPS, 3, 2, $9, 0, 0, -1, -1, 0, 0, 0, GuideGentsHouseGuideGent, EVENT_GUIDE_GENT_VISIBLE_IN_CHERRYGROVE diff --git a/maps/HallOfFame.asm b/maps/HallOfFame.asm index a88dc094c..00ea5473b 100644 --- a/maps/HallOfFame.asm +++ b/maps/HallOfFame.asm @@ -41,7 +41,7 @@ HallOfFameScript: special HealParty checkevent EVENT_GOT_SS_TICKET_FROM_ELM iftrue .SkipPhoneCall - specialphonecall ELMCALL_SSTICKET + specialphonecall SPECIALCALL_SSTICKET .SkipPhoneCall: halloffame end @@ -126,4 +126,4 @@ HallOfFame_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_LANCE, 16, 8, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, -1 + person_event SPRITE_LANCE, 12, 4, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, -1 diff --git a/maps/IcePath1F.asm b/maps/IcePath1F.asm index 5594b4f8c..5e8dc3abd 100644 --- a/maps/IcePath1F.asm +++ b/maps/IcePath1F.asm @@ -33,6 +33,6 @@ IcePath1F_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_POKE_BALL, 11, 35, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e472, EVENT_GOT_HM07_WATERFALL - person_event SPRITE_POKE_BALL, 27, 36, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e474, EVENT_ICE_PATH_1F_PP_UP - person_event SPRITE_POKE_BALL, 13, 39, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e476, EVENT_ICE_PATH_1F_PROTEIN + person_event SPRITE_POKE_BALL, 7, 31, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e472, EVENT_GOT_HM07_WATERFALL + person_event SPRITE_POKE_BALL, 23, 32, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e474, EVENT_ICE_PATH_1F_PP_UP + person_event SPRITE_POKE_BALL, 9, 35, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e476, EVENT_ICE_PATH_1F_PROTEIN diff --git a/maps/IcePathB1F.asm b/maps/IcePathB1F.asm index f8862b8bf..74ec8026b 100644 --- a/maps/IcePathB1F.asm +++ b/maps/IcePathB1F.asm @@ -107,8 +107,8 @@ IcePathB1F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_BOULDER, 11, 15, $19, 0, 0, -1, -1, 0, 0, 0, IcePathB1FBoulder, EVENT_BOULDER_IN_ICE_PATH_1 - person_event SPRITE_BOULDER, 12, 11, $19, 0, 0, -1, -1, 0, 0, 0, IcePathB1FBoulder, EVENT_BOULDER_IN_ICE_PATH_2 - person_event SPRITE_BOULDER, 13, 12, $19, 0, 0, -1, -1, 0, 0, 0, IcePathB1FBoulder, EVENT_BOULDER_IN_ICE_PATH_3 - person_event SPRITE_BOULDER, 11, 21, $19, 0, 0, -1, -1, 0, 0, 0, IcePathB1FBoulder, EVENT_BOULDER_IN_ICE_PATH_4 - person_event SPRITE_POKE_BALL, 39, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e50d, EVENT_ICE_PATH_B1F_IRON + person_event SPRITE_BOULDER, 7, 11, $19, 0, 0, -1, -1, 0, 0, 0, IcePathB1FBoulder, EVENT_BOULDER_IN_ICE_PATH_1 + person_event SPRITE_BOULDER, 8, 7, $19, 0, 0, -1, -1, 0, 0, 0, IcePathB1FBoulder, EVENT_BOULDER_IN_ICE_PATH_2 + person_event SPRITE_BOULDER, 9, 8, $19, 0, 0, -1, -1, 0, 0, 0, IcePathB1FBoulder, EVENT_BOULDER_IN_ICE_PATH_3 + person_event SPRITE_BOULDER, 7, 17, $19, 0, 0, -1, -1, 0, 0, 0, IcePathB1FBoulder, EVENT_BOULDER_IN_ICE_PATH_4 + person_event SPRITE_POKE_BALL, 35, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e50d, EVENT_ICE_PATH_B1F_IRON diff --git a/maps/IcePathB2FBlackthornSide.asm b/maps/IcePathB2FBlackthornSide.asm index 9568d9fa4..5e31ea65e 100644 --- a/maps/IcePathB2FBlackthornSide.asm +++ b/maps/IcePathB2FBlackthornSide.asm @@ -30,4 +30,4 @@ IcePathB2FBlackthornSide_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKE_BALL, 20, 12, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e646, EVENT_ICE_PATH_B2F_BLACKTHORN_SIDE_TM_REST + person_event SPRITE_POKE_BALL, 16, 8, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e646, EVENT_ICE_PATH_B2F_BLACKTHORN_SIDE_TM_REST diff --git a/maps/IcePathB2FMahoganySide.asm b/maps/IcePathB2FMahoganySide.asm index c8d8fad47..09d37660e 100644 --- a/maps/IcePathB2FMahoganySide.asm +++ b/maps/IcePathB2FMahoganySide.asm @@ -45,9 +45,9 @@ IcePathB2FMahoganySide_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_BOULDER, 7, 15, $1, 0, 0, -1, -1, 0, 0, 0, BoulderScript_0x7e5a3, EVENT_BOULDER_IN_ICE_PATH_1A - person_event SPRITE_BOULDER, 11, 8, $1, 0, 0, -1, -1, 0, 0, 0, BoulderScript_0x7e5a3, EVENT_BOULDER_IN_ICE_PATH_2A - person_event SPRITE_BOULDER, 16, 7, $1, 0, 0, -1, -1, 0, 0, 0, BoulderScript_0x7e5a3, EVENT_BOULDER_IN_ICE_PATH_3A - person_event SPRITE_BOULDER, 17, 16, $1, 0, 0, -1, -1, 0, 0, 0, BoulderScript_0x7e5a3, EVENT_BOULDER_IN_ICE_PATH_4A - person_event SPRITE_POKE_BALL, 13, 12, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e5a6, EVENT_ICE_PATH_B2F_MAHOGANY_SIDE_FULL_HEAL - person_event SPRITE_POKE_BALL, 6, 4, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e5a8, EVENT_ICE_PATH_B2F_MAHOGANY_SIDE_MAX_POTION + person_event SPRITE_BOULDER, 3, 11, $1, 0, 0, -1, -1, 0, 0, 0, BoulderScript_0x7e5a3, EVENT_BOULDER_IN_ICE_PATH_1A + person_event SPRITE_BOULDER, 7, 4, $1, 0, 0, -1, -1, 0, 0, 0, BoulderScript_0x7e5a3, EVENT_BOULDER_IN_ICE_PATH_2A + person_event SPRITE_BOULDER, 12, 3, $1, 0, 0, -1, -1, 0, 0, 0, BoulderScript_0x7e5a3, EVENT_BOULDER_IN_ICE_PATH_3A + person_event SPRITE_BOULDER, 13, 12, $1, 0, 0, -1, -1, 0, 0, 0, BoulderScript_0x7e5a3, EVENT_BOULDER_IN_ICE_PATH_4A + person_event SPRITE_POKE_BALL, 9, 8, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e5a6, EVENT_ICE_PATH_B2F_MAHOGANY_SIDE_FULL_HEAL + person_event SPRITE_POKE_BALL, 2, 0, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e5a8, EVENT_ICE_PATH_B2F_MAHOGANY_SIDE_MAX_POTION diff --git a/maps/IcePathB3F.asm b/maps/IcePathB3F.asm index b1fe0e413..1be274d2c 100644 --- a/maps/IcePathB3F.asm +++ b/maps/IcePathB3F.asm @@ -28,5 +28,5 @@ IcePathB3F_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_POKE_BALL, 11, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e66f, EVENT_ICE_PATH_B3F_NEVERMELTICE - person_event SPRITE_ROCK, 10, 10, $18, 0, 0, -1, -1, 0, 0, 0, IcePathB3FRock, -1 + person_event SPRITE_POKE_BALL, 7, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e66f, EVENT_ICE_PATH_B3F_NEVERMELTICE + person_event SPRITE_ROCK, 6, 6, $18, 0, 0, -1, -1, 0, 0, 0, IcePathB3FRock, -1 diff --git a/maps/IlexForest.asm b/maps/IlexForest.asm index dc4203a8e..cab0b66ed 100644 --- a/maps/IlexForest.asm +++ b/maps/IlexForest.asm @@ -950,14 +950,14 @@ IlexForest_MapEventHeader: .PersonEvents: db 11 - person_event SPRITE_BIRD, 35, 18, $3, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, BirdScript_0x6eb8f, EVENT_ILEX_FOREST_FARFETCHD - person_event SPRITE_YOUNGSTER, 32, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x6eb7b, EVENT_ILEX_FOREST_APPRENTICE - person_event SPRITE_BLACK_BELT, 32, 9, $9, 0, 0, -1, -1, 0, 0, 0, BlackBeltScript_0x6edae, EVENT_ILEX_FOREST_CHARCOAL_MASTER - person_event SPRITE_ROCKER, 18, 19, $9, 0, 0, -1, -1, 0, 0, 0, RockerScript_0x6edde, -1 - person_event SPRITE_POKE_BALL, 36, 24, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6ee10, EVENT_ILEX_FOREST_REVIVE - person_event SPRITE_KURT, 33, 12, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_ILEX_FOREST_KURT - person_event SPRITE_LASS, 28, 7, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LassScript_0x6ee0d, EVENT_ILEX_FOREST_LASS - person_event SPRITE_YOUNGSTER, 5, 16, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 0, TrainerBug_catcherWayne, -1 - person_event SPRITE_POKE_BALL, 21, 13, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6ee12, EVENT_ILEX_FOREST_X_ATTACK - person_event SPRITE_POKE_BALL, 11, 21, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6ee14, EVENT_ILEX_FOREST_ANTIDOTE - person_event SPRITE_POKE_BALL, 5, 31, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6ee16, EVENT_ILEX_FOREST_ETHER + person_event SPRITE_BIRD, 31, 14, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, BirdScript_0x6eb8f, EVENT_ILEX_FOREST_FARFETCHD + person_event SPRITE_YOUNGSTER, 28, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x6eb7b, EVENT_ILEX_FOREST_APPRENTICE + person_event SPRITE_BLACK_BELT, 28, 5, $9, 0, 0, -1, -1, 0, 0, 0, BlackBeltScript_0x6edae, EVENT_ILEX_FOREST_CHARCOAL_MASTER + person_event SPRITE_ROCKER, 14, 15, $9, 0, 0, -1, -1, 0, 0, 0, RockerScript_0x6edde, -1 + person_event SPRITE_POKE_BALL, 32, 20, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6ee10, EVENT_ILEX_FOREST_REVIVE + person_event SPRITE_KURT, 29, 8, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_ILEX_FOREST_KURT + person_event SPRITE_LASS, 24, 3, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LassScript_0x6ee0d, EVENT_ILEX_FOREST_LASS + person_event SPRITE_YOUNGSTER, 1, 12, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 0, TrainerBug_catcherWayne, -1 + person_event SPRITE_POKE_BALL, 17, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6ee12, EVENT_ILEX_FOREST_X_ATTACK + person_event SPRITE_POKE_BALL, 7, 17, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6ee14, EVENT_ILEX_FOREST_ANTIDOTE + person_event SPRITE_POKE_BALL, 1, 27, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6ee16, EVENT_ILEX_FOREST_ETHER diff --git a/maps/IlexForestAzaleaGate.asm b/maps/IlexForestAzaleaGate.asm index 7a34bb76d..57034a774 100644 --- a/maps/IlexForestAzaleaGate.asm +++ b/maps/IlexForestAzaleaGate.asm @@ -45,5 +45,5 @@ IlexForestAzaleaGate_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_OFFICER, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, OfficerScript_0x62c7a, -1 - person_event SPRITE_GRANNY, 7, 5, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, GrannyScript_0x62c7d, -1 + person_event SPRITE_OFFICER, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, OfficerScript_0x62c7a, -1 + person_event SPRITE_GRANNY, 3, 1, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, GrannyScript_0x62c7d, -1 diff --git a/maps/IndigoPlateauPokeCenter1F.asm b/maps/IndigoPlateauPokeCenter1F.asm index 184ac95c4..c4ab11add 100644 --- a/maps/IndigoPlateauPokeCenter1F.asm +++ b/maps/IndigoPlateauPokeCenter1F.asm @@ -319,9 +319,9 @@ IndigoPlateauPokeCenter1F_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_NURSE, 11, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x18012c, -1 - person_event SPRITE_CLERK, 11, 15, $6, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x18012f, -1 - person_event SPRITE_COOLTRAINER_M, 15, 15, $2, 2, 2, -1, -1, 0, 0, 0, CooltrainerMScript_0x180136, -1 - person_event SPRITE_SILVER, 13, 20, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_INDIGO_PLATEAU_POKECENTER_RIVAL - person_event SPRITE_GRAMPS, 13, 5, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, TeleportGuyScript, EVENT_TELEPORT_GUY - person_event SPRITE_JYNX, 13, 4, $16, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, AbraScript, EVENT_TELEPORT_GUY + person_event SPRITE_NURSE, 7, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x18012c, -1 + person_event SPRITE_CLERK, 7, 11, $6, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x18012f, -1 + person_event SPRITE_COOLTRAINER_M, 11, 11, $2, 2, 2, -1, -1, 0, 0, 0, CooltrainerMScript_0x180136, -1 + person_event SPRITE_SILVER, 9, 16, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_INDIGO_PLATEAU_POKECENTER_RIVAL + person_event SPRITE_GRAMPS, 9, 1, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, TeleportGuyScript, EVENT_TELEPORT_GUY + person_event SPRITE_JYNX, 9, 0, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, AbraScript, EVENT_TELEPORT_GUY diff --git a/maps/KarensRoom.asm b/maps/KarensRoom.asm index 5b23b5b7b..978aaac59 100644 --- a/maps/KarensRoom.asm +++ b/maps/KarensRoom.asm @@ -153,4 +153,4 @@ KarensRoom_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_KAREN, 11, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, KarenScript_0x180bee, -1 + person_event SPRITE_KAREN, 7, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, KarenScript_0x180bee, -1 diff --git a/maps/KogasRoom.asm b/maps/KogasRoom.asm index 848e928c8..0b2dfa846 100644 --- a/maps/KogasRoom.asm +++ b/maps/KogasRoom.asm @@ -150,4 +150,4 @@ KogasRoom_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_KOGA, 11, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, KogaScript_0x18075a, -1 + person_event SPRITE_KOGA, 7, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, KogaScript_0x18075a, -1 diff --git a/maps/KrissHouse1F.asm b/maps/KrissHouse1F.asm index 0f5fc3583..50f32a5c7 100644 --- a/maps/KrissHouse1F.asm +++ b/maps/KrissHouse1F.asm @@ -404,8 +404,8 @@ KrissHouse1F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_MOM, 8, 11, $8, 0, 0, -1, -1, 0, 0, 0, MomScript_0x7a582, EVENT_KRISS_HOUSE_MOM_1 - person_event SPRITE_MOM, 6, 6, $7, 0, 0, -1, 1, 0, 0, 0, MomScript_0x7a582, EVENT_KRISS_HOUSE_MOM_2 - person_event SPRITE_MOM, 8, 11, $8, 0, 0, -1, 2, 0, 0, 0, MomScript_0x7a582, EVENT_KRISS_HOUSE_MOM_2 - person_event SPRITE_MOM, 6, 4, $7, 0, 0, -1, 4, 0, 0, 0, MomScript_0x7a582, EVENT_KRISS_HOUSE_MOM_2 - person_event SPRITE_POKEFAN_F, 8, 8, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, NeighborScript, EVENT_KRISS_HOUSE_1F_NEIGHBOR + person_event SPRITE_MOM, 4, 7, $8, 0, 0, -1, -1, 0, 0, 0, MomScript_0x7a582, EVENT_KRISS_HOUSE_MOM_1 + person_event SPRITE_MOM, 2, 2, $7, 0, 0, -1, 1, 0, 0, 0, MomScript_0x7a582, EVENT_KRISS_HOUSE_MOM_2 + person_event SPRITE_MOM, 4, 7, $8, 0, 0, -1, 2, 0, 0, 0, MomScript_0x7a582, EVENT_KRISS_HOUSE_MOM_2 + person_event SPRITE_MOM, 2, 0, $7, 0, 0, -1, 4, 0, 0, 0, MomScript_0x7a582, EVENT_KRISS_HOUSE_MOM_2 + person_event SPRITE_POKEFAN_F, 4, 4, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, NeighborScript, EVENT_KRISS_HOUSE_1F_NEIGHBOR diff --git a/maps/KrissHouse2F.asm b/maps/KrissHouse2F.asm index da5d40eab..62ec48b9c 100644 --- a/maps/KrissHouse2F.asm +++ b/maps/KrissHouse2F.asm @@ -132,7 +132,7 @@ KrissHouse2F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_CONSOLE, 6, 8, $1, 0, 0, -1, -1, 0, 0, 0, GameConsole, EVENT_KRISS_HOUSE_2F_CONSOLE - person_event SPRITE_DOLL_1, 8, 8, $1, 0, 0, -1, -1, 0, 0, 0, Doll1, EVENT_KRISS_HOUSE_2F_DOLL_1 - person_event SPRITE_DOLL_2, 8, 9, $1, 0, 0, -1, -1, 0, 0, 0, Doll2, EVENT_KRISS_HOUSE_2F_DOLL_2 - person_event SPRITE_BIG_DOLL, 5, 4, $21, 0, 0, -1, -1, 0, 0, 0, BigDoll, EVENT_KRISS_HOUSE_2F_BIG_DOLL + person_event SPRITE_CONSOLE, 2, 4, $1, 0, 0, -1, -1, 0, 0, 0, GameConsole, EVENT_KRISS_HOUSE_2F_CONSOLE + person_event SPRITE_DOLL_1, 4, 4, $1, 0, 0, -1, -1, 0, 0, 0, Doll1, EVENT_KRISS_HOUSE_2F_DOLL_1 + person_event SPRITE_DOLL_2, 4, 5, $1, 0, 0, -1, -1, 0, 0, 0, Doll2, EVENT_KRISS_HOUSE_2F_DOLL_2 + person_event SPRITE_BIG_DOLL, 1, 0, $21, 0, 0, -1, -1, 0, 0, 0, BigDoll, EVENT_KRISS_HOUSE_2F_BIG_DOLL diff --git a/maps/KrissNeighborsHouse.asm b/maps/KrissNeighborsHouse.asm index b20cac442..defaf8463 100644 --- a/maps/KrissNeighborsHouse.asm +++ b/maps/KrissNeighborsHouse.asm @@ -114,5 +114,5 @@ KrissNeighborsHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_COOLTRAINER_F, 7, 6, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, KrissNeighborsDaughter, -1 - person_event SPRITE_POKEFAN_F, 7, 9, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, KrissNeighbor, EVENT_KRISS_NEIGHBORS_HOUSE_NEIGHBOR + person_event SPRITE_COOLTRAINER_F, 3, 2, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, KrissNeighborsDaughter, -1 + person_event SPRITE_POKEFAN_F, 3, 5, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, KrissNeighbor, EVENT_KRISS_NEIGHBORS_HOUSE_NEIGHBOR diff --git a/maps/KurtsHouse.asm b/maps/KurtsHouse.asm index 7a77031c0..5a43e1ef1 100644 --- a/maps/KurtsHouse.asm +++ b/maps/KurtsHouse.asm @@ -127,7 +127,7 @@ KurtScript_0x18e178: writetext UnknownText_0x18e736 keeptextopen setevent EVENT_DRAGON_SHRINE_QUESTION_2 - special Function88018 + special Special_SelectApricornForKurt if_equal $0, .Cancel if_equal BLU_APRICORN, .Blu if_equal YLW_APRICORN, .Ylw @@ -696,8 +696,8 @@ KurtsHouse_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_KURT, 6, 7, $6, 0, 0, -1, -1, 0, 0, 0, KurtScript_0x18e178, EVENT_KURTS_HOUSE_KURT_1 - person_event SPRITE_TWIN, 7, 9, $3, 0, 0, -1, -1, 0, 0, 0, KurtsGranddaughter1, EVENT_KURTS_HOUSE_GRANDDAUGHTER_1 - person_event SPRITE_SLOWPOKE, 7, 10, $1, 0, 0, -1, -1, 0, 0, 0, KurtsHouseSlowpoke, EVENT_KURTS_HOUSE_SLOWPOKE - person_event SPRITE_KURT, 7, 18, $7, 0, 0, -1, -1, 0, 0, 0, KurtScript_0x18e3bd, EVENT_KURTS_HOUSE_KURT_2 - person_event SPRITE_TWIN, 8, 15, $9, 0, 0, -1, -1, 0, 0, 0, KurtsGranddaughter2, EVENT_KURTS_HOUSE_GRANDDAUGHTER_2 + person_event SPRITE_KURT, 2, 3, $6, 0, 0, -1, -1, 0, 0, 0, KurtScript_0x18e178, EVENT_KURTS_HOUSE_KURT_1 + person_event SPRITE_TWIN, 3, 5, $3, 0, 0, -1, -1, 0, 0, 0, KurtsGranddaughter1, EVENT_KURTS_HOUSE_GRANDDAUGHTER_1 + person_event SPRITE_SLOWPOKE, 3, 6, $1, 0, 0, -1, -1, 0, 0, 0, KurtsHouseSlowpoke, EVENT_KURTS_HOUSE_SLOWPOKE + person_event SPRITE_KURT, 3, 14, $7, 0, 0, -1, -1, 0, 0, 0, KurtScript_0x18e3bd, EVENT_KURTS_HOUSE_KURT_2 + person_event SPRITE_TWIN, 4, 11, $9, 0, 0, -1, -1, 0, 0, 0, KurtsGranddaughter2, EVENT_KURTS_HOUSE_GRANDDAUGHTER_2 diff --git a/maps/LakeofRage.asm b/maps/LakeofRage.asm index 2ace36a06..8fabac559 100644 --- a/maps/LakeofRage.asm +++ b/maps/LakeofRage.asm @@ -509,15 +509,15 @@ LakeofRage_MapEventHeader: .PersonEvents: db 12 - person_event SPRITE_LANCE, 32, 25, $7, 0, 0, -1, -1, 0, 0, 0, LanceScript_0x70022, EVENT_LAKE_OF_RAGE_LANCE - person_event SPRITE_GRAMPS, 30, 24, $7, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x7008e, -1 - person_event SPRITE_SUPER_NERD, 17, 40, $8, 0, 0, -1, -1, 0, 0, 0, SuperNerdScript_0x700a2, -1 - person_event SPRITE_COOLTRAINER_F, 33, 29, $5, 0, 1, -1, -1, 0, 0, 0, CooltrainerFScript_0x700a5, -1 - person_event SPRITE_FISHER, 27, 34, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerFisherAndre, EVENT_LAKE_OF_RAGE_CIVILIANS - person_event SPRITE_FISHER, 30, 28, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerFisherRaymond, EVENT_LAKE_OF_RAGE_CIVILIANS - person_event SPRITE_COOLTRAINER_M, 19, 8, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerCooltrainermAaron, EVENT_LAKE_OF_RAGE_CIVILIANS - person_event SPRITE_COOLTRAINER_F, 11, 40, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 0, TrainerCooltrainerfLois, EVENT_LAKE_OF_RAGE_CIVILIANS - person_event SPRITE_GYARADOS, 26, 22, $16, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, GyaradosScript_0x70063, EVENT_LAKE_OF_RAGE_RED_GYARADOS - person_event SPRITE_SUPER_NERD, 8, 8, $6, 0, 0, -1, -1, 0, 0, 0, WesleyScript, EVENT_LAKE_OF_RAGE_WESLEY_OF_WEDNESDAY - person_event SPRITE_POKE_BALL, 14, 11, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x70148, EVENT_LAKE_OF_RAGE_ELIXER - person_event SPRITE_POKE_BALL, 6, 39, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7014a, EVENT_LAKE_OF_RAGE_TM_DETECT + person_event SPRITE_LANCE, 28, 21, $7, 0, 0, -1, -1, 0, 0, 0, LanceScript_0x70022, EVENT_LAKE_OF_RAGE_LANCE + person_event SPRITE_GRAMPS, 26, 20, $7, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x7008e, -1 + person_event SPRITE_SUPER_NERD, 13, 36, $8, 0, 0, -1, -1, 0, 0, 0, SuperNerdScript_0x700a2, -1 + person_event SPRITE_COOLTRAINER_F, 29, 25, $5, 0, 1, -1, -1, 0, 0, 0, CooltrainerFScript_0x700a5, -1 + person_event SPRITE_FISHER, 23, 30, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerFisherAndre, EVENT_LAKE_OF_RAGE_CIVILIANS + person_event SPRITE_FISHER, 26, 24, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerFisherRaymond, EVENT_LAKE_OF_RAGE_CIVILIANS + person_event SPRITE_COOLTRAINER_M, 15, 4, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerCooltrainermAaron, EVENT_LAKE_OF_RAGE_CIVILIANS + person_event SPRITE_COOLTRAINER_F, 7, 36, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 0, TrainerCooltrainerfLois, EVENT_LAKE_OF_RAGE_CIVILIANS + person_event SPRITE_GYARADOS, 22, 18, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, GyaradosScript_0x70063, EVENT_LAKE_OF_RAGE_RED_GYARADOS + person_event SPRITE_SUPER_NERD, 4, 4, $6, 0, 0, -1, -1, 0, 0, 0, WesleyScript, EVENT_LAKE_OF_RAGE_WESLEY_OF_WEDNESDAY + person_event SPRITE_POKE_BALL, 10, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x70148, EVENT_LAKE_OF_RAGE_ELIXER + person_event SPRITE_POKE_BALL, 2, 35, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7014a, EVENT_LAKE_OF_RAGE_TM_DETECT diff --git a/maps/LakeofRageHiddenPowerHouse.asm b/maps/LakeofRageHiddenPowerHouse.asm index 1caa4f76f..caf510f3c 100644 --- a/maps/LakeofRageHiddenPowerHouse.asm +++ b/maps/LakeofRageHiddenPowerHouse.asm @@ -83,4 +83,4 @@ LakeofRageHiddenPowerHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_FISHER, 7, 6, $3, 0, 0, -1, -1, 0, 0, 0, HiddenPowerGuy, -1 + person_event SPRITE_FISHER, 3, 2, $3, 0, 0, -1, -1, 0, 0, 0, HiddenPowerGuy, -1 diff --git a/maps/LakeofRageMagikarpHouse.asm b/maps/LakeofRageMagikarpHouse.asm index 34214dc01..42b3ffa7a 100644 --- a/maps/LakeofRageMagikarpHouse.asm +++ b/maps/LakeofRageMagikarpHouse.asm @@ -221,4 +221,4 @@ LakeofRageMagikarpHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_FISHING_GURU, 7, 6, $3, 0, 0, -1, -1, 0, 0, 0, FishingGuruScript_0x19a6ae, -1 + person_event SPRITE_FISHING_GURU, 3, 2, $3, 0, 0, -1, -1, 0, 0, 0, FishingGuruScript_0x19a6ae, -1 diff --git a/maps/LancesRoom.asm b/maps/LancesRoom.asm index 7bb61e4fa..aaa239c62 100644 --- a/maps/LancesRoom.asm +++ b/maps/LancesRoom.asm @@ -358,6 +358,6 @@ LancesRoom_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_LANCE, 7, 9, $6, 0, 0, -1, -1, 0, 0, 0, LanceScript_0x180e7b, -1 - person_event SPRITE_TEACHER, 11, 8, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ObjectEvent, EVENT_LANCES_ROOM_OAK_AND_MARY - person_event SPRITE_OAK, 11, 8, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_LANCES_ROOM_OAK_AND_MARY + person_event SPRITE_LANCE, 3, 5, $6, 0, 0, -1, -1, 0, 0, 0, LanceScript_0x180e7b, -1 + person_event SPRITE_TEACHER, 7, 4, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ObjectEvent, EVENT_LANCES_ROOM_OAK_AND_MARY + person_event SPRITE_OAK, 7, 4, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_LANCES_ROOM_OAK_AND_MARY diff --git a/maps/LavRadioTower1F.asm b/maps/LavRadioTower1F.asm index 02debf95e..7f7d82d2e 100644 --- a/maps/LavRadioTower1F.asm +++ b/maps/LavRadioTower1F.asm @@ -233,8 +233,8 @@ LavRadioTower1F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_RECEPTIONIST, 10, 10, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ReceptionistScript_0x7ee63, -1 - person_event SPRITE_OFFICER, 5, 19, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, OfficerScript_0x7ee66, -1 - person_event SPRITE_SUPER_NERD, 7, 5, $2, 1, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, SuperNerdScript_0x7ee69, -1 - person_event SPRITE_GENTLEMAN, 5, 13, $7, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x7ee6c, -1 - person_event SPRITE_SUPER_NERD, 10, 18, $9, 0, 0, -1, -1, 0, 0, 0, SuperNerdScript_0x7eea2, -1 + person_event SPRITE_RECEPTIONIST, 6, 6, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ReceptionistScript_0x7ee63, -1 + person_event SPRITE_OFFICER, 1, 15, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, OfficerScript_0x7ee66, -1 + person_event SPRITE_SUPER_NERD, 3, 1, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SuperNerdScript_0x7ee69, -1 + person_event SPRITE_GENTLEMAN, 1, 9, $7, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x7ee6c, -1 + person_event SPRITE_SUPER_NERD, 6, 14, $9, 0, 0, -1, -1, 0, 0, 0, SuperNerdScript_0x7eea2, -1 diff --git a/maps/LavenderMart.asm b/maps/LavenderMart.asm index 066e4ef70..f6b782308 100644 --- a/maps/LavenderMart.asm +++ b/maps/LavenderMart.asm @@ -59,6 +59,6 @@ LavenderMart_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x7eb1c, -1 - person_event SPRITE_POKEFAN_M, 10, 10, $5, 0, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, PokefanMScript_0x7eb23, -1 - person_event SPRITE_ROCKER, 6, 13, $3, 0, 0, -1, -1, 0, 0, 0, RockerScript_0x7eb26, -1 + person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x7eb1c, -1 + person_event SPRITE_POKEFAN_M, 6, 6, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PokefanMScript_0x7eb23, -1 + person_event SPRITE_ROCKER, 2, 9, $3, 0, 0, -1, -1, 0, 0, 0, RockerScript_0x7eb26, -1 diff --git a/maps/LavenderNameRater.asm b/maps/LavenderNameRater.asm index f1670ef77..e00fab626 100644 --- a/maps/LavenderNameRater.asm +++ b/maps/LavenderNameRater.asm @@ -40,4 +40,4 @@ LavenderNameRater_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_GENTLEMAN, 7, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, LavenderNameRater, -1 + person_event SPRITE_GENTLEMAN, 3, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, LavenderNameRater, -1 diff --git a/maps/LavenderPokeCenter1F.asm b/maps/LavenderPokeCenter1F.asm index 2a976287a..ee1a4bf86 100644 --- a/maps/LavenderPokeCenter1F.asm +++ b/maps/LavenderPokeCenter1F.asm @@ -92,7 +92,7 @@ LavenderPokeCenter1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x7e6a0, -1 - person_event SPRITE_GENTLEMAN, 10, 11, $5, 0, 1, -1, -1, 0, 0, 0, GentlemanScript_0x7e6a3, -1 - person_event SPRITE_TEACHER, 7, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TeacherScript_0x7e6a6, -1 - person_event SPRITE_YOUNGSTER, 9, 5, $4, 1, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x7e6a9, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x7e6a0, -1 + person_event SPRITE_GENTLEMAN, 6, 7, $5, 0, 1, -1, -1, 0, 0, 0, GentlemanScript_0x7e6a3, -1 + person_event SPRITE_TEACHER, 3, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TeacherScript_0x7e6a6, -1 + person_event SPRITE_YOUNGSTER, 5, 1, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x7e6a9, -1 diff --git a/maps/LavenderTown.asm b/maps/LavenderTown.asm index 764bb3214..65b6054fd 100644 --- a/maps/LavenderTown.asm +++ b/maps/LavenderTown.asm @@ -129,7 +129,7 @@ LavenderTown_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_POKEFAN_M, 11, 16, $5, 0, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, PokefanMScript_0x1ad6e4, -1 - person_event SPRITE_TEACHER, 19, 6, $5, 0, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, TeacherScript_0x1ad6e7, -1 - person_event SPRITE_GRAMPS, 16, 18, $7, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x1ad6ea, -1 - person_event SPRITE_YOUNGSTER, 15, 10, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 1, YoungsterScript_0x1ad6ed, -1 + person_event SPRITE_POKEFAN_M, 7, 12, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PokefanMScript_0x1ad6e4, -1 + person_event SPRITE_TEACHER, 15, 2, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, TeacherScript_0x1ad6e7, -1 + person_event SPRITE_GRAMPS, 12, 14, $7, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x1ad6ea, -1 + person_event SPRITE_YOUNGSTER, 11, 6, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 1, YoungsterScript_0x1ad6ed, -1 diff --git a/maps/LavenderTownSpeechHouse.asm b/maps/LavenderTownSpeechHouse.asm index 5868646dd..37d0677ac 100644 --- a/maps/LavenderTownSpeechHouse.asm +++ b/maps/LavenderTownSpeechHouse.asm @@ -44,4 +44,4 @@ LavenderTownSpeechHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKEFAN_F, 7, 6, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, PokefanFScript_0x7ea47, -1 + person_event SPRITE_POKEFAN_F, 3, 2, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, PokefanFScript_0x7ea47, -1 diff --git a/maps/MahoganyGym.asm b/maps/MahoganyGym.asm index 897830712..9616d1a4d 100644 --- a/maps/MahoganyGym.asm +++ b/maps/MahoganyGym.asm @@ -382,10 +382,10 @@ MahoganyGym_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_PRYCE, 7, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, PryceScript_0x199a9e, -1 - person_event SPRITE_BUENA, 10, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerSkierRoxanne, -1 - person_event SPRITE_ROCKER, 21, 4, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerBoarderRonald, -1 - person_event SPRITE_BUENA, 21, 13, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerSkierClarissa, -1 - person_event SPRITE_ROCKER, 13, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerBoarderBrad, -1 - person_event SPRITE_ROCKER, 8, 6, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerBoarderDouglas, -1 - person_event SPRITE_GYM_GUY, 19, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, MahoganyGymGuyScript, -1 + person_event SPRITE_PRYCE, 3, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, PryceScript_0x199a9e, -1 + person_event SPRITE_BUENA, 6, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerSkierRoxanne, -1 + person_event SPRITE_ROCKER, 17, 0, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerBoarderRonald, -1 + person_event SPRITE_BUENA, 17, 9, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerSkierClarissa, -1 + person_event SPRITE_ROCKER, 9, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerBoarderBrad, -1 + person_event SPRITE_ROCKER, 4, 2, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerBoarderDouglas, -1 + person_event SPRITE_GYM_GUY, 15, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, MahoganyGymGuyScript, -1 diff --git a/maps/MahoganyMart1F.asm b/maps/MahoganyMart1F.asm index e4023b2af..815e53b32 100644 --- a/maps/MahoganyMart1F.asm +++ b/maps/MahoganyMart1F.asm @@ -236,8 +236,8 @@ MahoganyMart1F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_PHARMACIST, 7, 8, $6, 0, 0, -1, -1, 0, 0, 0, PharmacistScript_0x6c367, EVENT_TEAM_ROCKET_BASE_POPULATION - person_event SPRITE_BLACK_BELT, 10, 5, $3, 0, 0, -1, -1, 0, 0, 0, BlackBeltScript_0x6c37b, EVENT_TEAM_ROCKET_BASE_POPULATION - person_event SPRITE_LANCE, 10, 8, $8, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_MAHOGANY_MART_LANCE_AND_DRAGONITE - person_event SPRITE_DRAGON, 10, 7, $8, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_MAHOGANY_MART_LANCE_AND_DRAGONITE - person_event SPRITE_GRANNY, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, GrannyScript_0x6c3ee, EVENT_MAHOGANY_MART_OWNERS + person_event SPRITE_PHARMACIST, 3, 4, $6, 0, 0, -1, -1, 0, 0, 0, PharmacistScript_0x6c367, EVENT_TEAM_ROCKET_BASE_POPULATION + person_event SPRITE_BLACK_BELT, 6, 1, $3, 0, 0, -1, -1, 0, 0, 0, BlackBeltScript_0x6c37b, EVENT_TEAM_ROCKET_BASE_POPULATION + person_event SPRITE_LANCE, 6, 4, $8, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_MAHOGANY_MART_LANCE_AND_DRAGONITE + person_event SPRITE_DRAGON, 6, 3, $8, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_MAHOGANY_MART_LANCE_AND_DRAGONITE + person_event SPRITE_GRANNY, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, GrannyScript_0x6c3ee, EVENT_MAHOGANY_MART_OWNERS diff --git a/maps/MahoganyPokeCenter1F.asm b/maps/MahoganyPokeCenter1F.asm index 68c17df77..f7f8a391c 100644 --- a/maps/MahoganyPokeCenter1F.asm +++ b/maps/MahoganyPokeCenter1F.asm @@ -65,7 +65,7 @@ MahoganyPokeCenter1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x19a356, -1 - person_event SPRITE_POKEFAN_M, 6, 11, $2, 1, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, PokefanMScript_0x19a359, -1 - person_event SPRITE_YOUNGSTER, 7, 5, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x19a35c, -1 - person_event SPRITE_COOLTRAINER_F, 7, 6, $8, 0, 0, -1, -1, 0, 0, 0, CooltrainerFScript_0x19a35f, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x19a356, -1 + person_event SPRITE_POKEFAN_M, 2, 7, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PokefanMScript_0x19a359, -1 + person_event SPRITE_YOUNGSTER, 3, 1, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x19a35c, -1 + person_event SPRITE_COOLTRAINER_F, 3, 2, $8, 0, 0, -1, -1, 0, 0, 0, CooltrainerFScript_0x19a35f, -1 diff --git a/maps/MahoganyRedGyaradosSpeechHouse.asm b/maps/MahoganyRedGyaradosSpeechHouse.asm index 5e88db74e..e8f3f7199 100644 --- a/maps/MahoganyRedGyaradosSpeechHouse.asm +++ b/maps/MahoganyRedGyaradosSpeechHouse.asm @@ -73,5 +73,5 @@ MahoganyRedGyaradosSpeechHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_BLACK_BELT, 7, 6, $9, 0, 0, -1, -1, 0, 0, 0, BlackBeltScript_0x19997f, -1 - person_event SPRITE_TEACHER, 9, 10, $4, 1, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, TeacherScript_0x199982, -1 + person_event SPRITE_BLACK_BELT, 3, 2, $9, 0, 0, -1, -1, 0, 0, 0, BlackBeltScript_0x19997f, -1 + person_event SPRITE_TEACHER, 5, 6, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, TeacherScript_0x199982, -1 diff --git a/maps/MahoganyTown.asm b/maps/MahoganyTown.asm index 57b09ba35..fd582696a 100644 --- a/maps/MahoganyTown.asm +++ b/maps/MahoganyTown.asm @@ -268,7 +268,7 @@ MahoganyTown_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_POKEFAN_M, 12, 23, $6, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x19002e, EVENT_MAHOGANY_TOWN_POKEFAN_M_BLOCKS_EAST - person_event SPRITE_GRAMPS, 13, 10, $5, 0, 1, -1, -1, 0, 0, 0, GrampsScript_0x19007e, -1 - person_event SPRITE_FISHER, 18, 10, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FisherScript_0x190092, EVENT_MAHOGANY_TOWN_POKEFAN_M_BLOCKS_GYM - person_event SPRITE_LASS, 12, 16, $6, 0, 0, -1, -1, 0, 0, 0, LassScript_0x190095, EVENT_MAHOGANY_MART_OWNERS + person_event SPRITE_POKEFAN_M, 8, 19, $6, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x19002e, EVENT_MAHOGANY_TOWN_POKEFAN_M_BLOCKS_EAST + person_event SPRITE_GRAMPS, 9, 6, $5, 0, 1, -1, -1, 0, 0, 0, GrampsScript_0x19007e, -1 + person_event SPRITE_FISHER, 14, 6, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FisherScript_0x190092, EVENT_MAHOGANY_TOWN_POKEFAN_M_BLOCKS_GYM + person_event SPRITE_LASS, 8, 12, $6, 0, 0, -1, -1, 0, 0, 0, LassScript_0x190095, EVENT_MAHOGANY_MART_OWNERS diff --git a/maps/ManiasHouse.asm b/maps/ManiasHouse.asm index d7a0f3b32..3b68cfcde 100644 --- a/maps/ManiasHouse.asm +++ b/maps/ManiasHouse.asm @@ -212,4 +212,4 @@ ManiasHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_ROCKER, 8, 6, $3, 0, 0, -1, -1, 0, 0, 0, RockerScript_0x9d278, -1 + person_event SPRITE_ROCKER, 4, 2, $3, 0, 0, -1, -1, 0, 0, 0, RockerScript_0x9d278, -1 diff --git a/maps/MountMoon.asm b/maps/MountMoon.asm index 0ea33e6f9..b8ad92a93 100644 --- a/maps/MountMoon.asm +++ b/maps/MountMoon.asm @@ -182,4 +182,4 @@ MountMoon_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_SILVER, 7, 11, $8, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_MT_MOON_RIVAL + person_event SPRITE_SILVER, 3, 7, $8, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_MT_MOON_RIVAL diff --git a/maps/MountMoonGiftShop.asm b/maps/MountMoonGiftShop.asm index f7fa388ec..29f8ff680 100644 --- a/maps/MountMoonGiftShop.asm +++ b/maps/MountMoonGiftShop.asm @@ -38,7 +38,7 @@ MountMoonGiftShop_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_GRAMPS, 7, 8, $6, 0, 0, -1, 1, 0, 0, 0, GrampsScript_0x771a8, -1 - person_event SPRITE_GRAMPS, 6, 5, $9, 0, 0, -1, 2, 0, 0, 0, GrampsScript_0x771a8, -1 - person_event SPRITE_LASS, 10, 5, $5, 0, 1, -1, 1, 0, 0, 0, LassScript_0x771b0, -1 - person_event SPRITE_LASS, 8, 9, $4, 1, 0, -1, 2, 0, 0, 0, LassScript_0x771b0, -1 + person_event SPRITE_GRAMPS, 3, 4, $6, 0, 0, -1, 1, 0, 0, 0, GrampsScript_0x771a8, -1 + person_event SPRITE_GRAMPS, 2, 1, $9, 0, 0, -1, 2, 0, 0, 0, GrampsScript_0x771a8, -1 + person_event SPRITE_LASS, 6, 1, $5, 0, 1, -1, 1, 0, 0, 0, LassScript_0x771b0, -1 + person_event SPRITE_LASS, 4, 5, $4, 1, 0, -1, 2, 0, 0, 0, LassScript_0x771b0, -1 diff --git a/maps/MountMoonSquare.asm b/maps/MountMoonSquare.asm index 9c6773fcc..b371ae404 100644 --- a/maps/MountMoonSquare.asm +++ b/maps/MountMoonSquare.asm @@ -155,6 +155,6 @@ MountMoonSquare_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_FAIRY, 10, 10, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_MT_MOON_SQUARE_CLEFAIRY - person_event SPRITE_FAIRY, 10, 11, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_MT_MOON_SQUARE_CLEFAIRY - person_event SPRITE_ROCK, 11, 11, $18, 0, 0, -1, -1, 0, 0, 0, MtMoonSquareRock, EVENT_MT_MOON_SQUARE_ROCK + person_event SPRITE_FAIRY, 6, 6, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_MT_MOON_SQUARE_CLEFAIRY + person_event SPRITE_FAIRY, 6, 7, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_MT_MOON_SQUARE_CLEFAIRY + person_event SPRITE_ROCK, 7, 7, $18, 0, 0, -1, -1, 0, 0, 0, MtMoonSquareRock, EVENT_MT_MOON_SQUARE_ROCK diff --git a/maps/MountMortar1FInside.asm b/maps/MountMortar1FInside.asm index 2dae5c9a5..f830f56d3 100644 --- a/maps/MountMortar1FInside.asm +++ b/maps/MountMortar1FInside.asm @@ -127,13 +127,13 @@ MountMortar1FInside_MapEventHeader: .PersonEvents: db 10 - person_event SPRITE_BOULDER, 47, 25, $19, 0, 0, -1, -1, 0, 0, 0, MountMortar1FBoulder, -1 - person_event SPRITE_POKE_BALL, 42, 39, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7de7c, EVENT_MOUNT_MORTAR_1F_INSIDE_ESCAPE_ROPE - person_event SPRITE_POKE_BALL, 14, 20, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7de7e, EVENT_MOUNT_MORTAR_1F_INSIDE_MAX_REVIVE - person_event SPRITE_POKE_BALL, 31, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7de80, EVENT_MOUNT_MORTAR_1F_INSIDE_HYPER_POTION - person_event SPRITE_POKE_BALL, 24, 26, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7de82, EVENT_MOUNT_MORTAR_1F_INSIDE_MAX_POTION - person_event SPRITE_POKE_BALL, 23, 39, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7de84, EVENT_MOUNT_MORTAR_1F_INSIDE_NUGGET - person_event SPRITE_SUPER_NERD, 47, 37, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerPokemaniacMiller, -1 - person_event SPRITE_SUPER_NERD, 32, 28, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerSupernerdMarkus, -1 - person_event SPRITE_POKE_BALL, 20, 12, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7de86, EVENT_MOUNT_MORTAR_1F_INSIDE_IRON - person_event SPRITE_POKE_BALL, 21, 21, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7de88, EVENT_MOUNT_MORTAR_1F_INSIDE_ULTRA_BALL + person_event SPRITE_BOULDER, 43, 21, $19, 0, 0, -1, -1, 0, 0, 0, MountMortar1FBoulder, -1 + person_event SPRITE_POKE_BALL, 38, 35, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7de7c, EVENT_MOUNT_MORTAR_1F_INSIDE_ESCAPE_ROPE + person_event SPRITE_POKE_BALL, 10, 16, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7de7e, EVENT_MOUNT_MORTAR_1F_INSIDE_MAX_REVIVE + person_event SPRITE_POKE_BALL, 27, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7de80, EVENT_MOUNT_MORTAR_1F_INSIDE_HYPER_POTION + person_event SPRITE_POKE_BALL, 20, 22, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7de82, EVENT_MOUNT_MORTAR_1F_INSIDE_MAX_POTION + person_event SPRITE_POKE_BALL, 19, 35, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7de84, EVENT_MOUNT_MORTAR_1F_INSIDE_NUGGET + person_event SPRITE_SUPER_NERD, 43, 33, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerPokemaniacMiller, -1 + person_event SPRITE_SUPER_NERD, 28, 24, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerSupernerdMarkus, -1 + person_event SPRITE_POKE_BALL, 16, 8, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7de86, EVENT_MOUNT_MORTAR_1F_INSIDE_IRON + person_event SPRITE_POKE_BALL, 17, 17, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7de88, EVENT_MOUNT_MORTAR_1F_INSIDE_ULTRA_BALL diff --git a/maps/MountMortar1FOutside.asm b/maps/MountMortar1FOutside.asm index 396e2969c..f9c4271a1 100644 --- a/maps/MountMortar1FOutside.asm +++ b/maps/MountMortar1FOutside.asm @@ -40,5 +40,5 @@ MountMortar1FOutside_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_POKE_BALL, 19, 17, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7ddf6, EVENT_MOUNT_MORTAR_1F_OUTSIDE_ETHER - person_event SPRITE_POKE_BALL, 22, 35, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7ddf8, EVENT_MOUNT_MORTAR_1F_OUTSIDE_REVIVE + person_event SPRITE_POKE_BALL, 15, 13, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7ddf6, EVENT_MOUNT_MORTAR_1F_OUTSIDE_ETHER + person_event SPRITE_POKE_BALL, 18, 31, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7ddf8, EVENT_MOUNT_MORTAR_1F_OUTSIDE_REVIVE diff --git a/maps/MountMortar2FInside.asm b/maps/MountMortar2FInside.asm index cf78313ce..5580a35a5 100644 --- a/maps/MountMortar2FInside.asm +++ b/maps/MountMortar2FInside.asm @@ -76,10 +76,10 @@ MountMortar2FInside_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_POKE_BALL, 26, 32, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e0de, EVENT_MOUNT_MORTAR_2F_INSIDE_MAX_POTION - person_event SPRITE_POKE_BALL, 37, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e0e0, EVENT_MOUNT_MORTAR_2F_INSIDE_RARE_CANDY - person_event SPRITE_POKE_BALL, 21, 23, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e0e2, EVENT_MOUNT_MORTAR_2F_INSIDE_TM_DEFENSE_CURL - person_event SPRITE_POKE_BALL, 9, 20, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e0e4, EVENT_MOUNT_MORTAR_2F_INSIDE_DRAGON_SCALE - person_event SPRITE_POKE_BALL, 15, 13, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e0e6, EVENT_MOUNT_MORTAR_2F_INSIDE_ELIXER - person_event SPRITE_POKE_BALL, 9, 32, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e0e8, EVENT_MOUNT_MORTAR_2F_INSIDE_ESCAPE_ROPE - person_event SPRITE_SUPER_NERD, 30, 17, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerSupernerdHugh, -1 + person_event SPRITE_POKE_BALL, 22, 28, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e0de, EVENT_MOUNT_MORTAR_2F_INSIDE_MAX_POTION + person_event SPRITE_POKE_BALL, 33, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e0e0, EVENT_MOUNT_MORTAR_2F_INSIDE_RARE_CANDY + person_event SPRITE_POKE_BALL, 17, 19, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e0e2, EVENT_MOUNT_MORTAR_2F_INSIDE_TM_DEFENSE_CURL + person_event SPRITE_POKE_BALL, 5, 16, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e0e4, EVENT_MOUNT_MORTAR_2F_INSIDE_DRAGON_SCALE + person_event SPRITE_POKE_BALL, 11, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e0e6, EVENT_MOUNT_MORTAR_2F_INSIDE_ELIXER + person_event SPRITE_POKE_BALL, 5, 28, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e0e8, EVENT_MOUNT_MORTAR_2F_INSIDE_ESCAPE_ROPE + person_event SPRITE_SUPER_NERD, 26, 13, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerSupernerdHugh, -1 diff --git a/maps/MountMortarB1F.asm b/maps/MountMortarB1F.asm index a284e808e..5ed95afe8 100644 --- a/maps/MountMortarB1F.asm +++ b/maps/MountMortarB1F.asm @@ -144,10 +144,10 @@ MountMortarB1F_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_POKE_BALL, 16, 33, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e240, EVENT_MOUNT_MORTAR_B1F_HYPER_POTION - person_event SPRITE_POKE_BALL, 20, 8, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e242, EVENT_MOUNT_MORTAR_B1F_CARBOS - person_event SPRITE_BOULDER, 14, 13, $19, 0, 0, -1, -1, 0, 0, 0, MountMortarB1FBoulder, -1 - person_event SPRITE_BLACK_BELT, 8, 20, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, BlackBeltScript_0x7e1f6, -1 - person_event SPRITE_POKE_BALL, 28, 38, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e244, EVENT_MOUNT_MORTAR_B1F_FULL_RESTORE - person_event SPRITE_POKE_BALL, 7, 36, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e246, EVENT_MOUNT_MORTAR_B1F_MAX_ETHER - person_event SPRITE_POKE_BALL, 30, 25, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e248, EVENT_MOUNT_MORTAR_B1F_PP_UP + person_event SPRITE_POKE_BALL, 12, 29, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e240, EVENT_MOUNT_MORTAR_B1F_HYPER_POTION + person_event SPRITE_POKE_BALL, 16, 4, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e242, EVENT_MOUNT_MORTAR_B1F_CARBOS + person_event SPRITE_BOULDER, 10, 9, $19, 0, 0, -1, -1, 0, 0, 0, MountMortarB1FBoulder, -1 + person_event SPRITE_BLACK_BELT, 4, 16, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, BlackBeltScript_0x7e1f6, -1 + person_event SPRITE_POKE_BALL, 24, 34, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e244, EVENT_MOUNT_MORTAR_B1F_FULL_RESTORE + person_event SPRITE_POKE_BALL, 3, 32, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e246, EVENT_MOUNT_MORTAR_B1F_MAX_ETHER + person_event SPRITE_POKE_BALL, 26, 21, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7e248, EVENT_MOUNT_MORTAR_B1F_PP_UP diff --git a/maps/MoveDeletersHouse.asm b/maps/MoveDeletersHouse.asm index 9b59f9f42..f16f6afce 100644 --- a/maps/MoveDeletersHouse.asm +++ b/maps/MoveDeletersHouse.asm @@ -35,4 +35,4 @@ MoveDeletersHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_SUPER_NERD, 7, 6, $6, 0, 0, -1, -1, 0, 0, 0, MoveDeleter, -1 + person_event SPRITE_SUPER_NERD, 3, 2, $6, 0, 0, -1, -1, 0, 0, 0, MoveDeleter, -1 diff --git a/maps/MrFujisHouse.asm b/maps/MrFujisHouse.asm index 7c5989384..a3bc19386 100644 --- a/maps/MrFujisHouse.asm +++ b/maps/MrFujisHouse.asm @@ -91,8 +91,8 @@ MrFujisHouse_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_SUPER_NERD, 5, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, SuperNerdScript_0x7e8ca, -1 - person_event SPRITE_LASS, 8, 7, $2, 1, 1, -1, -1, 0, 0, 0, LassScript_0x7e8cd, -1 - person_event SPRITE_RHYDON, 8, 11, $16, 0, 0, -1, -1, 0, 0, 0, MrFujisPsyduck, -1 - person_event SPRITE_GROWLITHE, 9, 9, $16, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, MrFujisNidorino, -1 - person_event SPRITE_MOLTRES, 7, 5, $16, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, MrFujisPidgey, -1 + person_event SPRITE_SUPER_NERD, 1, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, SuperNerdScript_0x7e8ca, -1 + person_event SPRITE_LASS, 4, 3, $2, 1, 1, -1, -1, 0, 0, 0, LassScript_0x7e8cd, -1 + person_event SPRITE_RHYDON, 4, 7, $16, 0, 0, -1, -1, 0, 0, 0, MrFujisPsyduck, -1 + person_event SPRITE_GROWLITHE, 5, 5, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, MrFujisNidorino, -1 + person_event SPRITE_MOLTRES, 3, 1, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, MrFujisPidgey, -1 diff --git a/maps/MrPokemonsHouse.asm b/maps/MrPokemonsHouse.asm index 3d566a722..260080172 100644 --- a/maps/MrPokemonsHouse.asm +++ b/maps/MrPokemonsHouse.asm @@ -126,7 +126,7 @@ UnknownScript_0x196ec9: dotrigger $1 domaptrigger CHERRYGROVE_CITY, $1 domaptrigger ELMS_LAB, $3 - specialphonecall ELMCALL_ROBBED + specialphonecall SPECIALCALL_ROBBED clearevent EVENT_COP_IN_ELMS_LAB checkevent EVENT_GOT_TOTODILE_FROM_ELM iftrue UnknownScript_0x196f49 @@ -392,5 +392,5 @@ MrPokemonsHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_GENTLEMAN, 9, 7, $9, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x196e97, -1 - person_event SPRITE_OAK, 9, 10, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_MR_POKEMONS_HOUSE_OAK + person_event SPRITE_GENTLEMAN, 5, 3, $9, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x196e97, -1 + person_event SPRITE_OAK, 5, 6, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_MR_POKEMONS_HOUSE_OAK diff --git a/maps/MrPsychicsHouse.asm b/maps/MrPsychicsHouse.asm index 5c71ffaec..63177f81a 100644 --- a/maps/MrPsychicsHouse.asm +++ b/maps/MrPsychicsHouse.asm @@ -63,4 +63,4 @@ MrPsychicsHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_FISHING_GURU, 7, 9, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, MrPsychic, -1 + person_event SPRITE_FISHING_GURU, 3, 5, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, MrPsychic, -1 diff --git a/maps/NationalPark.asm b/maps/NationalPark.asm index 8e375e1e4..3c326d13c 100644 --- a/maps/NationalPark.asm +++ b/maps/NationalPark.asm @@ -521,17 +521,17 @@ NationalPark_MapEventHeader: .PersonEvents: db 14 - person_event SPRITE_LASS, 28, 19, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LassScript_0x5c002, -1 - person_event SPRITE_POKEFAN_F, 8, 18, $6, 0, 0, -1, -1, 0, 0, 0, PokefanFScript_0x5c005, -1 - person_event SPRITE_TEACHER, 44, 31, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TeacherScript_0x5c008, -1 - person_event SPRITE_YOUNGSTER, 45, 15, $8, 0, 0, -1, -1, 0, 0, 0, YoungsterScript_0x5c023, -1 - person_event SPRITE_YOUNGSTER, 45, 14, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x5c026, -1 - person_event SPRITE_TEACHER, 45, 21, $2, 2, 1, -1, -1, 0, 0, 0, TeacherScript_0x5c029, -1 - person_event SPRITE_GROWLITHE, 44, 30, $16, 0, 0, -1, -1, 0, 0, 0, GrowlitheScript_0x5c02c, -1 - person_event SPRITE_YOUNGSTER, 27, 31, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerSchoolboyJack1, -1 - person_event SPRITE_POKEFAN_F, 33, 22, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 2, TrainerPokefanfBeverly1, -1 - person_event SPRITE_POKEFAN_M, 13, 20, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 2, TrainerPokefanmWilliam, -1 - person_event SPRITE_LASS, 18, 12, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerLassKrise, -1 - person_event SPRITE_POKE_BALL, 16, 39, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5c1cc, EVENT_NATIONAL_PARK_PARLYZ_HEAL - person_event SPRITE_GAMEBOY_KID, 10, 30, $6, 0, 0, -1, -1, 0, 0, 0, GameboyKidScript_0x5c037, -1 - person_event SPRITE_POKE_BALL, 47, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5c1ce, EVENT_NATIONAL_PARK_TM_DIG + person_event SPRITE_LASS, 24, 15, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LassScript_0x5c002, -1 + person_event SPRITE_POKEFAN_F, 4, 14, $6, 0, 0, -1, -1, 0, 0, 0, PokefanFScript_0x5c005, -1 + person_event SPRITE_TEACHER, 40, 27, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TeacherScript_0x5c008, -1 + person_event SPRITE_YOUNGSTER, 41, 11, $8, 0, 0, -1, -1, 0, 0, 0, YoungsterScript_0x5c023, -1 + person_event SPRITE_YOUNGSTER, 41, 10, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x5c026, -1 + person_event SPRITE_TEACHER, 41, 17, $2, 2, 1, -1, -1, 0, 0, 0, TeacherScript_0x5c029, -1 + person_event SPRITE_GROWLITHE, 40, 26, $16, 0, 0, -1, -1, 0, 0, 0, GrowlitheScript_0x5c02c, -1 + person_event SPRITE_YOUNGSTER, 23, 27, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerSchoolboyJack1, -1 + person_event SPRITE_POKEFAN_F, 29, 18, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 2, TrainerPokefanfBeverly1, -1 + person_event SPRITE_POKEFAN_M, 9, 16, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 2, TrainerPokefanmWilliam, -1 + person_event SPRITE_LASS, 14, 8, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerLassKrise, -1 + person_event SPRITE_POKE_BALL, 12, 35, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5c1cc, EVENT_NATIONAL_PARK_PARLYZ_HEAL + person_event SPRITE_GAMEBOY_KID, 6, 26, $6, 0, 0, -1, -1, 0, 0, 0, GameboyKidScript_0x5c037, -1 + person_event SPRITE_POKE_BALL, 43, 1, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5c1ce, EVENT_NATIONAL_PARK_TM_DIG diff --git a/maps/NationalParkBugContest.asm b/maps/NationalParkBugContest.asm index 02669053b..5e67aacac 100644 --- a/maps/NationalParkBugContest.asm +++ b/maps/NationalParkBugContest.asm @@ -230,15 +230,15 @@ NationalParkBugContest_MapEventHeader: .PersonEvents: db 12 - person_event SPRITE_YOUNGSTER, 33, 23, $2, 2, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x5c8ec, EVENT_BUG_CATCHING_CONTESTANT_1A - person_event SPRITE_YOUNGSTER, 26, 32, $2, 2, 2, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x5c8f4, EVENT_BUG_CATCHING_CONTESTANT_2A - person_event SPRITE_ROCKER, 22, 13, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, RockerScript_0x5c8fc, EVENT_BUG_CATCHING_CONTESTANT_3A - person_event SPRITE_POKEFAN_M, 17, 11, $4, 0, 1, -1, -1, 8 + PAL_OW_BROWN, 0, 0, PokefanMScript_0x5c904, EVENT_BUG_CATCHING_CONTESTANT_4A - person_event SPRITE_YOUNGSTER, 13, 27, $3, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x5c90c, EVENT_BUG_CATCHING_CONTESTANT_5A - person_event SPRITE_YOUNGSTER, 17, 31, $2, 3, 3, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x5c914, EVENT_BUG_CATCHING_CONTESTANT_6A - person_event SPRITE_LASS, 27, 11, $5, 0, 2, -1, -1, 8 + PAL_OW_BLUE, 0, 0, LassScript_0x5c91c, EVENT_BUG_CATCHING_CONTESTANT_7A - person_event SPRITE_YOUNGSTER, 31, 15, $2, 1, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x5c924, EVENT_BUG_CATCHING_CONTESTANT_8A - person_event SPRITE_YOUNGSTER, 12, 20, $2, 1, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x5c92c, EVENT_BUG_CATCHING_CONTESTANT_9A - person_event SPRITE_YOUNGSTER, 38, 21, $2, 3, 3, -1, -1, 8 + PAL_OW_BLUE, 0, 0, YoungsterScript_0x5c934, EVENT_BUG_CATCHING_CONTESTANT_10A - person_event SPRITE_POKE_BALL, 16, 39, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5c945, EVENT_NATIONAL_PARK_PARLYZ_HEAL - person_event SPRITE_POKE_BALL, 47, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5c947, EVENT_NATIONAL_PARK_TM_DIG + person_event SPRITE_YOUNGSTER, 29, 19, $2, 2, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x5c8ec, EVENT_BUG_CATCHING_CONTESTANT_1A + person_event SPRITE_YOUNGSTER, 22, 28, $2, 2, 2, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x5c8f4, EVENT_BUG_CATCHING_CONTESTANT_2A + person_event SPRITE_ROCKER, 18, 9, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, RockerScript_0x5c8fc, EVENT_BUG_CATCHING_CONTESTANT_3A + person_event SPRITE_POKEFAN_M, 13, 7, $4, 0, 1, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, PokefanMScript_0x5c904, EVENT_BUG_CATCHING_CONTESTANT_4A + person_event SPRITE_YOUNGSTER, 9, 23, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x5c90c, EVENT_BUG_CATCHING_CONTESTANT_5A + person_event SPRITE_YOUNGSTER, 13, 27, $2, 3, 3, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x5c914, EVENT_BUG_CATCHING_CONTESTANT_6A + person_event SPRITE_LASS, 23, 7, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, LassScript_0x5c91c, EVENT_BUG_CATCHING_CONTESTANT_7A + person_event SPRITE_YOUNGSTER, 27, 11, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x5c924, EVENT_BUG_CATCHING_CONTESTANT_8A + person_event SPRITE_YOUNGSTER, 8, 16, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x5c92c, EVENT_BUG_CATCHING_CONTESTANT_9A + person_event SPRITE_YOUNGSTER, 34, 17, $2, 3, 3, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, YoungsterScript_0x5c934, EVENT_BUG_CATCHING_CONTESTANT_10A + person_event SPRITE_POKE_BALL, 12, 35, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5c945, EVENT_NATIONAL_PARK_PARLYZ_HEAL + person_event SPRITE_POKE_BALL, 43, 1, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5c947, EVENT_NATIONAL_PARK_TM_DIG diff --git a/maps/NewBarkTown.asm b/maps/NewBarkTown.asm index 12739fb5a..49788b994 100644 --- a/maps/NewBarkTown.asm +++ b/maps/NewBarkTown.asm @@ -305,6 +305,6 @@ NewBarkTown_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_TEACHER, 12, 10, $3, 0, 1, -1, -1, 0, 0, 0, TeacherScript_0x1a806f, -1 - person_event SPRITE_FISHER, 13, 16, $4, 1, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FisherScript_0x1a809b, -1 - person_event SPRITE_SILVER, 6, 7, $9, 0, 0, -1, -1, 0, 0, 0, SilverScript_0x1a809e, EVENT_RIVAL_NEW_BARK_TOWN + person_event SPRITE_TEACHER, 8, 6, $3, 0, 1, -1, -1, 0, 0, 0, TeacherScript_0x1a806f, -1 + person_event SPRITE_FISHER, 9, 12, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FisherScript_0x1a809b, -1 + person_event SPRITE_SILVER, 2, 3, $9, 0, 0, -1, -1, 0, 0, 0, SilverScript_0x1a809e, EVENT_RIVAL_NEW_BARK_TOWN diff --git a/maps/OaksLab.asm b/maps/OaksLab.asm index 1fecc8fcd..b5f1f3098 100644 --- a/maps/OaksLab.asm +++ b/maps/OaksLab.asm @@ -283,7 +283,7 @@ OaksLab_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_OAK, 6, 8, $6, 0, 0, -1, -1, 0, 0, 0, Oak, -1 - person_event SPRITE_SCIENTIST, 12, 5, $5, 0, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ScientistScript_0x19b40f, -1 - person_event SPRITE_SCIENTIST, 13, 12, $4, 1, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ScientistScript_0x19b412, -1 - person_event SPRITE_SCIENTIST, 8, 5, $2, 1, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ScientistScript_0x19b415, -1 + person_event SPRITE_OAK, 2, 4, $6, 0, 0, -1, -1, 0, 0, 0, Oak, -1 + person_event SPRITE_SCIENTIST, 8, 1, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ScientistScript_0x19b40f, -1 + person_event SPRITE_SCIENTIST, 9, 8, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ScientistScript_0x19b412, -1 + person_event SPRITE_SCIENTIST, 4, 1, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ScientistScript_0x19b415, -1 diff --git a/maps/OlivineCafe.asm b/maps/OlivineCafe.asm index 618ed332a..94747e360 100644 --- a/maps/OlivineCafe.asm +++ b/maps/OlivineCafe.asm @@ -90,6 +90,6 @@ OlivineCafe_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_SAILOR, 7, 8, $8, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x9c8c1, -1 - person_event SPRITE_FISHING_GURU, 7, 11, $4, 1, 0, -1, -1, 0, 0, 0, FishingGuruScript_0x9c8d9, -1 - person_event SPRITE_SAILOR, 10, 10, $7, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x9c8dc, -1 + person_event SPRITE_SAILOR, 3, 4, $8, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x9c8c1, -1 + person_event SPRITE_FISHING_GURU, 3, 7, $4, 1, 0, -1, -1, 0, 0, 0, FishingGuruScript_0x9c8d9, -1 + person_event SPRITE_SAILOR, 6, 6, $7, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x9c8dc, -1 diff --git a/maps/OlivineCity.asm b/maps/OlivineCity.asm index 144b8a8f3..a3d67a068 100644 --- a/maps/OlivineCity.asm +++ b/maps/OlivineCity.asm @@ -320,7 +320,7 @@ OlivineCity_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_SAILOR, 31, 30, $4, 1, 0, -1, -1, 0, 0, 0, SailorScript_0x1a88a3, -1 - person_event SPRITE_STANDING_YOUNGSTER, 17, 24, $3, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, StandingYoungsterScript_0x1a88a6, -1 - person_event SPRITE_SAILOR, 25, 21, $2, 1, 1, -1, -1, 0, 0, 0, SailorScript_0x1a88ba, -1 - person_event SPRITE_OLIVINE_RIVAL, 15, 14, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_OLIVINE_CITY + person_event SPRITE_SAILOR, 27, 26, $4, 1, 0, -1, -1, 0, 0, 0, SailorScript_0x1a88a3, -1 + person_event SPRITE_STANDING_YOUNGSTER, 13, 20, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, StandingYoungsterScript_0x1a88a6, -1 + person_event SPRITE_SAILOR, 21, 17, $2, 1, 1, -1, -1, 0, 0, 0, SailorScript_0x1a88ba, -1 + person_event SPRITE_OLIVINE_RIVAL, 11, 10, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_OLIVINE_CITY diff --git a/maps/OlivineGoodRodHouse.asm b/maps/OlivineGoodRodHouse.asm index 81cb60259..3fea640d7 100644 --- a/maps/OlivineGoodRodHouse.asm +++ b/maps/OlivineGoodRodHouse.asm @@ -96,4 +96,4 @@ OlivineGoodRodHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_FISHING_GURU, 7, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, GoodRodGuru, -1 + person_event SPRITE_FISHING_GURU, 3, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, GoodRodGuru, -1 diff --git a/maps/OlivineGym.asm b/maps/OlivineGym.asm index 7c893eca6..a1ae6dc44 100644 --- a/maps/OlivineGym.asm +++ b/maps/OlivineGym.asm @@ -212,5 +212,5 @@ OlivineGym_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_JASMINE, 7, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, JasmineScript_0x9c12f, EVENT_OLIVINE_GYM_JASMINE - person_event SPRITE_GYM_GUY, 17, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, OlivineGymGuyScript, -1 + person_event SPRITE_JASMINE, 3, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, JasmineScript_0x9c12f, EVENT_OLIVINE_GYM_JASMINE + person_event SPRITE_GYM_GUY, 13, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, OlivineGymGuyScript, -1 diff --git a/maps/OlivineHouseBeta.asm b/maps/OlivineHouseBeta.asm index 0a8c8b032..7e4f95515 100644 --- a/maps/OlivineHouseBeta.asm +++ b/maps/OlivineHouseBeta.asm @@ -54,5 +54,5 @@ OlivineHouseBeta_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_TEACHER, 7, 6, $3, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x9c58f, -1 - person_event SPRITE_RHYDON, 8, 10, $4, 2, 0, -1, -1, 0, 0, 0, RhydonScript_0x9c592, -1 + person_event SPRITE_TEACHER, 3, 2, $3, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x9c58f, -1 + person_event SPRITE_RHYDON, 4, 6, $4, 2, 0, -1, -1, 0, 0, 0, RhydonScript_0x9c592, -1 diff --git a/maps/OlivineLighthouse1F.asm b/maps/OlivineLighthouse1F.asm index fa16c0df9..10fdf1b33 100644 --- a/maps/OlivineLighthouse1F.asm +++ b/maps/OlivineLighthouse1F.asm @@ -52,5 +52,5 @@ OlivineLighthouse1F_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_SAILOR, 6, 12, $6, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x5ae67, -1 - person_event SPRITE_POKEFAN_F, 13, 20, $4, 2, 0, -1, -1, 0, 0, 0, PokefanFScript_0x5ae6a, -1 + person_event SPRITE_SAILOR, 2, 8, $6, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x5ae67, -1 + person_event SPRITE_POKEFAN_F, 9, 16, $4, 2, 0, -1, -1, 0, 0, 0, PokefanFScript_0x5ae6a, -1 diff --git a/maps/OlivineLighthouse2F.asm b/maps/OlivineLighthouse2F.asm index 5e499070c..760335793 100644 --- a/maps/OlivineLighthouse2F.asm +++ b/maps/OlivineLighthouse2F.asm @@ -221,5 +221,5 @@ OlivineLighthouse2F_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_SAILOR, 7, 13, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerSailorHuey1, -1 - person_event SPRITE_GENTLEMAN, 12, 21, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerGentlemanAlfred, -1 + person_event SPRITE_SAILOR, 3, 9, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerSailorHuey1, -1 + person_event SPRITE_GENTLEMAN, 8, 17, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerGentlemanAlfred, -1 diff --git a/maps/OlivineLighthouse3F.asm b/maps/OlivineLighthouse3F.asm index 32f3d696b..dd39a6331 100644 --- a/maps/OlivineLighthouse3F.asm +++ b/maps/OlivineLighthouse3F.asm @@ -130,7 +130,7 @@ OlivineLighthouse3F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_SAILOR, 6, 13, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerSailorTerrell, -1 - person_event SPRITE_GENTLEMAN, 9, 17, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 4, TrainerGentlemanPreston, -1 - person_event SPRITE_YOUNGSTER, 13, 7, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerBird_keeperTheo, -1 - person_event SPRITE_POKE_BALL, 6, 12, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5b279, EVENT_OLIVINE_LIGHTHOUSE_3F_ETHER + person_event SPRITE_SAILOR, 2, 9, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerSailorTerrell, -1 + person_event SPRITE_GENTLEMAN, 5, 13, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 4, TrainerGentlemanPreston, -1 + person_event SPRITE_YOUNGSTER, 9, 3, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerBird_keeperTheo, -1 + person_event SPRITE_POKE_BALL, 2, 8, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5b279, EVENT_OLIVINE_LIGHTHOUSE_3F_ETHER diff --git a/maps/OlivineLighthouse4F.asm b/maps/OlivineLighthouse4F.asm index 525ee8114..6b6662137 100644 --- a/maps/OlivineLighthouse4F.asm +++ b/maps/OlivineLighthouse4F.asm @@ -102,5 +102,5 @@ OlivineLighthouse4F_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_SAILOR, 18, 11, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerSailorKent, -1 - person_event SPRITE_LASS, 6, 15, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerLassConnie, -1 + person_event SPRITE_SAILOR, 14, 7, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerSailorKent, -1 + person_event SPRITE_LASS, 2, 11, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerLassConnie, -1 diff --git a/maps/OlivineLighthouse5F.asm b/maps/OlivineLighthouse5F.asm index 3b841c5d6..4915ee49e 100644 --- a/maps/OlivineLighthouse5F.asm +++ b/maps/OlivineLighthouse5F.asm @@ -107,8 +107,8 @@ OlivineLighthouse5F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_SAILOR, 15, 12, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerSailorErnest, -1 - person_event SPRITE_YOUNGSTER, 7, 12, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 4, TrainerBird_keeperDenis, -1 - person_event SPRITE_POKE_BALL, 16, 19, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x609aa, EVENT_OLIVINE_LIGHTHOUSE_5F_RARE_CANDY - person_event SPRITE_POKE_BALL, 19, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x609ac, EVENT_OLIVINE_LIGHTHOUSE_5F_SUPER_REPEL - person_event SPRITE_POKE_BALL, 17, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x609ae, EVENT_OLIVINE_LIGHTHOUSE_5F_TM_SWAGGER + person_event SPRITE_SAILOR, 11, 8, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerSailorErnest, -1 + person_event SPRITE_YOUNGSTER, 3, 8, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 4, TrainerBird_keeperDenis, -1 + person_event SPRITE_POKE_BALL, 12, 15, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x609aa, EVENT_OLIVINE_LIGHTHOUSE_5F_RARE_CANDY + person_event SPRITE_POKE_BALL, 15, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x609ac, EVENT_OLIVINE_LIGHTHOUSE_5F_SUPER_REPEL + person_event SPRITE_POKE_BALL, 13, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x609ae, EVENT_OLIVINE_LIGHTHOUSE_5F_TM_SWAGGER diff --git a/maps/OlivineLighthouse6F.asm b/maps/OlivineLighthouse6F.asm index e1b410855..71934fe80 100644 --- a/maps/OlivineLighthouse6F.asm +++ b/maps/OlivineLighthouse6F.asm @@ -270,6 +270,6 @@ OlivineLighthouse6F_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_JASMINE, 12, 12, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, JasmineScript_0x60b91, EVENT_OLIVINE_LIGHTHOUSE_JASMINE - person_event SPRITE_MONSTER, 12, 13, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, MonsterScript_0x60c3a, -1 - person_event SPRITE_POKE_BALL, 8, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x60c66, EVENT_OLIVINE_LIGHTHOUSE_6F_SUPER_POTION + person_event SPRITE_JASMINE, 8, 8, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, JasmineScript_0x60b91, EVENT_OLIVINE_LIGHTHOUSE_JASMINE + person_event SPRITE_MONSTER, 8, 9, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, MonsterScript_0x60c3a, -1 + person_event SPRITE_POKE_BALL, 4, 3, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x60c66, EVENT_OLIVINE_LIGHTHOUSE_6F_SUPER_POTION diff --git a/maps/OlivineMart.asm b/maps/OlivineMart.asm index e000eec7f..3b0546ef0 100644 --- a/maps/OlivineMart.asm +++ b/maps/OlivineMart.asm @@ -57,6 +57,6 @@ OlivineMart_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x9cac7, -1 - person_event SPRITE_COOLTRAINER_F, 6, 10, $5, 0, 2, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x9cace, -1 - person_event SPRITE_LASS, 10, 5, $8, 0, 0, -1, -1, 0, 0, 0, LassScript_0x9cad1, -1 + person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x9cac7, -1 + person_event SPRITE_COOLTRAINER_F, 2, 6, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x9cace, -1 + person_event SPRITE_LASS, 6, 1, $8, 0, 0, -1, -1, 0, 0, 0, LassScript_0x9cad1, -1 diff --git a/maps/OlivinePokeCenter1F.asm b/maps/OlivinePokeCenter1F.asm index 8a6128da1..63c8509c2 100644 --- a/maps/OlivinePokeCenter1F.asm +++ b/maps/OlivinePokeCenter1F.asm @@ -59,7 +59,7 @@ OlivinePokeCenter1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x9c002, -1 - person_event SPRITE_FISHING_GURU, 8, 12, $5, 0, 1, -1, -1, 0, 0, 0, FishingGuruScript_0x9c005, -1 - person_event SPRITE_FISHER, 7, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FisherScript_0x9c008, -1 - person_event SPRITE_TEACHER, 5, 11, $6, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x9c00b, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x9c002, -1 + person_event SPRITE_FISHING_GURU, 4, 8, $5, 0, 1, -1, -1, 0, 0, 0, FishingGuruScript_0x9c005, -1 + person_event SPRITE_FISHER, 3, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FisherScript_0x9c008, -1 + person_event SPRITE_TEACHER, 1, 7, $6, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x9c00b, -1 diff --git a/maps/OlivinePort.asm b/maps/OlivinePort.asm index 3cf6e26e6..ab1307f93 100644 --- a/maps/OlivinePort.asm +++ b/maps/OlivinePort.asm @@ -397,10 +397,10 @@ OlivinePort_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_SAILOR, 27, 11, $7, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x748c0, EVENT_OLIVINE_PORT_SAILOR_AT_GANGWAY - person_event SPRITE_SAILOR, 19, 11, $7, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x749fe, EVENT_OLIVINE_PORT_SPRITES_BEFORE_HALL_OF_FAME - person_event SPRITE_SAILOR, 19, 10, $9, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x7499c, EVENT_OLIVINE_PORT_SPRITES_AFTER_HALL_OF_FAME - person_event SPRITE_FISHING_GURU, 18, 8, $7, 0, 0, -1, -1, 0, 0, 0, FishingGuruScript_0x74a01, EVENT_OLIVINE_PORT_SPRITES_BEFORE_HALL_OF_FAME - person_event SPRITE_FISHING_GURU, 18, 17, $7, 0, 0, -1, -1, 0, 0, 0, FishingGuruScript_0x74a0c, EVENT_OLIVINE_PORT_SPRITES_BEFORE_HALL_OF_FAME - person_event SPRITE_YOUNGSTER, 19, 8, $6, 0, 0, -1, -1, 0, 0, 0, YoungsterScript_0x74a17, EVENT_OLIVINE_PORT_SPRITES_AFTER_HALL_OF_FAME - person_event SPRITE_COOLTRAINER_F, 19, 15, $6, 0, 0, -1, -1, 0, 0, 0, CooltrainerFScript_0x74a22, EVENT_OLIVINE_PORT_SPRITES_AFTER_HALL_OF_FAME + person_event SPRITE_SAILOR, 23, 7, $7, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x748c0, EVENT_OLIVINE_PORT_SAILOR_AT_GANGWAY + person_event SPRITE_SAILOR, 15, 7, $7, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x749fe, EVENT_OLIVINE_PORT_SPRITES_BEFORE_HALL_OF_FAME + person_event SPRITE_SAILOR, 15, 6, $9, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x7499c, EVENT_OLIVINE_PORT_SPRITES_AFTER_HALL_OF_FAME + person_event SPRITE_FISHING_GURU, 14, 4, $7, 0, 0, -1, -1, 0, 0, 0, FishingGuruScript_0x74a01, EVENT_OLIVINE_PORT_SPRITES_BEFORE_HALL_OF_FAME + person_event SPRITE_FISHING_GURU, 14, 13, $7, 0, 0, -1, -1, 0, 0, 0, FishingGuruScript_0x74a0c, EVENT_OLIVINE_PORT_SPRITES_BEFORE_HALL_OF_FAME + person_event SPRITE_YOUNGSTER, 15, 4, $6, 0, 0, -1, -1, 0, 0, 0, YoungsterScript_0x74a17, EVENT_OLIVINE_PORT_SPRITES_AFTER_HALL_OF_FAME + person_event SPRITE_COOLTRAINER_F, 15, 11, $6, 0, 0, -1, -1, 0, 0, 0, CooltrainerFScript_0x74a22, EVENT_OLIVINE_PORT_SPRITES_AFTER_HALL_OF_FAME diff --git a/maps/OlivinePortPassage.asm b/maps/OlivinePortPassage.asm index afb7a1832..f5f95d3dd 100644 --- a/maps/OlivinePortPassage.asm +++ b/maps/OlivinePortPassage.asm @@ -36,4 +36,4 @@ OlivinePortPassage_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKEFAN_M, 5, 21, $8, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x76fac, EVENT_OLIVINE_PORT_PASSAGE_POKEFAN_M + person_event SPRITE_POKEFAN_M, 1, 17, $8, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x76fac, EVENT_OLIVINE_PORT_PASSAGE_POKEFAN_M diff --git a/maps/OlivinePunishmentSpeechHouse.asm b/maps/OlivinePunishmentSpeechHouse.asm index a2bcbf8f6..e968dd1d7 100644 --- a/maps/OlivinePunishmentSpeechHouse.asm +++ b/maps/OlivinePunishmentSpeechHouse.asm @@ -54,5 +54,5 @@ OlivinePunishmentSpeechHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_POKEFAN_M, 6, 5, $3, 0, 0, -1, -1, 0, 0, 0, OlivinePunishmentSpeechHouseDad, -1 - person_event SPRITE_LASS, 9, 9, $5, 0, 2, -1, -1, 0, 0, 0, OlivinePunishmentSpeechHouseDaughter, -1 + person_event SPRITE_POKEFAN_M, 2, 1, $3, 0, 0, -1, -1, 0, 0, 0, OlivinePunishmentSpeechHouseDad, -1 + person_event SPRITE_LASS, 5, 5, $5, 0, 2, -1, -1, 0, 0, 0, OlivinePunishmentSpeechHouseDaughter, -1 diff --git a/maps/OlivineVoltorbHouse.asm b/maps/OlivineVoltorbHouse.asm index 632b556cb..717abfefe 100644 --- a/maps/OlivineVoltorbHouse.asm +++ b/maps/OlivineVoltorbHouse.asm @@ -35,4 +35,4 @@ OlivineVoltorbHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_FISHING_GURU, 7, 6, $3, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, Tim, -1 + person_event SPRITE_FISHING_GURU, 3, 2, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, Tim, -1 diff --git a/maps/PalletTown.asm b/maps/PalletTown.asm index 6c5ed9a96..efaae1087 100644 --- a/maps/PalletTown.asm +++ b/maps/PalletTown.asm @@ -89,5 +89,5 @@ PalletTown_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_TEACHER, 12, 7, $2, 2, 2, -1, -1, 0, 0, 0, TeacherScript_0x1ac6d5, -1 - person_event SPRITE_FISHER, 18, 16, $5, 0, 2, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FisherScript_0x1ac6d8, -1 + person_event SPRITE_TEACHER, 8, 3, $2, 2, 2, -1, -1, 0, 0, 0, TeacherScript_0x1ac6d5, -1 + person_event SPRITE_FISHER, 14, 12, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FisherScript_0x1ac6d8, -1 diff --git a/maps/PewterCity.asm b/maps/PewterCity.asm index e17b57836..2b74bea7b 100644 --- a/maps/PewterCity.asm +++ b/maps/PewterCity.asm @@ -174,8 +174,8 @@ PewterCity_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_COOLTRAINER_F, 15, 23, $2, 2, 2, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x18c009, -1 - person_event SPRITE_BUG_CATCHER, 33, 18, $2, 2, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, BugCatcherScript_0x18c00c, -1 - person_event SPRITE_GRAMPS, 21, 33, $5, 0, 2, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GrampsScript_0x18c00f, -1 - person_event SPRITE_FRUIT_TREE, 7, 36, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x18c03e, -1 - person_event SPRITE_FRUIT_TREE, 7, 34, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x18c040, -1 + person_event SPRITE_COOLTRAINER_F, 11, 19, $2, 2, 2, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x18c009, -1 + person_event SPRITE_BUG_CATCHER, 29, 14, $2, 2, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, BugCatcherScript_0x18c00c, -1 + person_event SPRITE_GRAMPS, 17, 29, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GrampsScript_0x18c00f, -1 + person_event SPRITE_FRUIT_TREE, 3, 32, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x18c03e, -1 + person_event SPRITE_FRUIT_TREE, 3, 30, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x18c040, -1 diff --git a/maps/PewterGym.asm b/maps/PewterGym.asm index 5270e530f..3f5b73427 100644 --- a/maps/PewterGym.asm +++ b/maps/PewterGym.asm @@ -222,6 +222,6 @@ PewterGym_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_BROCK, 5, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, BrockScript_0x1a2864, -1 - person_event SPRITE_YOUNGSTER, 9, 6, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerCamperJerry, -1 - person_event SPRITE_GYM_GUY, 15, 10, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 1, PewterGymGuyScript, -1 + person_event SPRITE_BROCK, 1, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, BrockScript_0x1a2864, -1 + person_event SPRITE_YOUNGSTER, 5, 2, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerCamperJerry, -1 + person_event SPRITE_GYM_GUY, 11, 6, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 1, PewterGymGuyScript, -1 diff --git a/maps/PewterMart.asm b/maps/PewterMart.asm index 7ee00d46d..557f0d5a3 100644 --- a/maps/PewterMart.asm +++ b/maps/PewterMart.asm @@ -57,6 +57,6 @@ PewterMart_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x1a2dcb, -1 - person_event SPRITE_YOUNGSTER, 6, 13, $5, 0, 2, -1, -1, 0, 0, 0, YoungsterScript_0x1a2dd2, -1 - person_event SPRITE_SUPER_NERD, 10, 10, $3, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, SuperNerdScript_0x1a2dd5, -1 + person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x1a2dcb, -1 + person_event SPRITE_YOUNGSTER, 2, 9, $5, 0, 2, -1, -1, 0, 0, 0, YoungsterScript_0x1a2dd2, -1 + person_event SPRITE_SUPER_NERD, 6, 6, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SuperNerdScript_0x1a2dd5, -1 diff --git a/maps/PewterNidoranSpeechHouse.asm b/maps/PewterNidoranSpeechHouse.asm index 0d819d757..773871db8 100644 --- a/maps/PewterNidoranSpeechHouse.asm +++ b/maps/PewterNidoranSpeechHouse.asm @@ -41,5 +41,5 @@ PewterNidoranSpeechHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_SUPER_NERD, 9, 7, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, SuperNerdScript_0x1a2807, -1 - person_event SPRITE_GROWLITHE, 9, 8, $16, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GrowlitheScript_0x1a280a, -1 + person_event SPRITE_SUPER_NERD, 5, 3, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, SuperNerdScript_0x1a2807, -1 + person_event SPRITE_GROWLITHE, 5, 4, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GrowlitheScript_0x1a280a, -1 diff --git a/maps/PewterPokeCenter1F.asm b/maps/PewterPokeCenter1F.asm index 5fe1a4170..0cbb4bb84 100644 --- a/maps/PewterPokeCenter1F.asm +++ b/maps/PewterPokeCenter1F.asm @@ -78,8 +78,8 @@ PewterPokeCenter1F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x1a2ee7, -1 - person_event SPRITE_TEACHER, 10, 12, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TeacherScript_0x1a2eea, -1 - person_event SPRITE_JIGGLYPUFF, 7, 5, $16, 0, 0, -1, -1, 0, 0, 0, JigglypuffScript_0x1a2eed, -1 - person_event SPRITE_BUG_CATCHER, 7, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, BugCatcherScript_0x1a2ef7, -1 - person_event SPRITE_POKEFAN_M, 6, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, PokefanMScript_0x1a2efa, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x1a2ee7, -1 + person_event SPRITE_TEACHER, 6, 8, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TeacherScript_0x1a2eea, -1 + person_event SPRITE_JIGGLYPUFF, 3, 1, $16, 0, 0, -1, -1, 0, 0, 0, JigglypuffScript_0x1a2eed, -1 + person_event SPRITE_BUG_CATCHER, 3, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, BugCatcherScript_0x1a2ef7, -1 + person_event SPRITE_POKEFAN_M, 2, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PokefanMScript_0x1a2efa, -1 diff --git a/maps/PewterSnoozeSpeechHouse.asm b/maps/PewterSnoozeSpeechHouse.asm index 78282319b..1284ec3ce 100644 --- a/maps/PewterSnoozeSpeechHouse.asm +++ b/maps/PewterSnoozeSpeechHouse.asm @@ -36,4 +36,4 @@ PewterSnoozeSpeechHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_GRAMPS, 7, 9, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GrampsScript_0x1a3059, -1 + person_event SPRITE_GRAMPS, 3, 5, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GrampsScript_0x1a3059, -1 diff --git a/maps/PokeCenter2F.asm b/maps/PokeCenter2F.asm index 532d63bf1..9a6e3076b 100644 --- a/maps/PokeCenter2F.asm +++ b/maps/PokeCenter2F.asm @@ -1040,7 +1040,7 @@ PokeCenter2F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_LINK_RECEPTIONIST, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LinkReceptionistScript_Trade, -1 - person_event SPRITE_LINK_RECEPTIONIST, 6, 13, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LinkReceptionistScript_Battle, -1 - person_event SPRITE_LINK_RECEPTIONIST, 7, 17, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LinkReceptionistScript_TimeCapsule, -1 - person_event SPRITE_OFFICER, 5, 5, $6, 0, 0, -1, -1, 0, 0, 0, OfficerScript_0x192c9a, EVENT_MYSTERY_GIFT_DELIVERY_GUY + person_event SPRITE_LINK_RECEPTIONIST, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LinkReceptionistScript_Trade, -1 + person_event SPRITE_LINK_RECEPTIONIST, 2, 9, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LinkReceptionistScript_Battle, -1 + person_event SPRITE_LINK_RECEPTIONIST, 3, 13, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LinkReceptionistScript_TimeCapsule, -1 + person_event SPRITE_OFFICER, 1, 1, $6, 0, 0, -1, -1, 0, 0, 0, OfficerScript_0x192c9a, EVENT_MYSTERY_GIFT_DELIVERY_GUY diff --git a/maps/PokeSeersHouse.asm b/maps/PokeSeersHouse.asm index ff21238a8..ef5130d9a 100644 --- a/maps/PokeSeersHouse.asm +++ b/maps/PokeSeersHouse.asm @@ -30,4 +30,4 @@ PokeSeersHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_GRANNY, 7, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, SeerScript, -1 + person_event SPRITE_GRANNY, 3, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SeerScript, -1 diff --git a/maps/PokemonFanClub.asm b/maps/PokemonFanClub.asm index 0be7efb1a..29d3cbbc5 100644 --- a/maps/PokemonFanClub.asm +++ b/maps/PokemonFanClub.asm @@ -307,9 +307,9 @@ PokemonFanClub_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_GENTLEMAN, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x1917e9, -1 - person_event SPRITE_RECEPTIONIST, 5, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ReceptionistScript_0x191821, -1 - person_event SPRITE_FISHER, 7, 6, $9, 0, 0, -1, -1, 0, 0, 0, FisherScript_0x191824, -1 - person_event SPRITE_TEACHER, 6, 11, $8, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x19186b, -1 - person_event SPRITE_FAIRY, 8, 6, $6, 0, 0, -1, -1, 0, 0, 0, FairyScript_0x19186e, EVENT_VERMILION_FAN_CLUB_DOLL - person_event SPRITE_ODDISH, 7, 11, $16, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, OddishScript_0x191871, -1 + person_event SPRITE_GENTLEMAN, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x1917e9, -1 + person_event SPRITE_RECEPTIONIST, 1, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ReceptionistScript_0x191821, -1 + person_event SPRITE_FISHER, 3, 2, $9, 0, 0, -1, -1, 0, 0, 0, FisherScript_0x191824, -1 + person_event SPRITE_TEACHER, 2, 7, $8, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x19186b, -1 + person_event SPRITE_FAIRY, 4, 2, $6, 0, 0, -1, -1, 0, 0, 0, FairyScript_0x19186e, EVENT_VERMILION_FAN_CLUB_DOLL + person_event SPRITE_ODDISH, 3, 7, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, OddishScript_0x191871, -1 diff --git a/maps/PowerPlant.asm b/maps/PowerPlant.asm index dfd984d84..2057e2bb5 100644 --- a/maps/PowerPlant.asm +++ b/maps/PowerPlant.asm @@ -401,10 +401,10 @@ PowerPlant_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_OFFICER, 18, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, OfficerScript_0x188df5, -1 - person_event SPRITE_GYM_GUY, 13, 6, $3, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GymGuyScript_0x188e15, -1 - person_event SPRITE_GYM_GUY, 15, 10, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GymGuyScript_0x188e29, -1 - person_event SPRITE_OFFICER, 7, 13, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, OfficerScript_0x188e3d, -1 - person_event SPRITE_GYM_GUY, 6, 11, $5, 0, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GymGuyScript_0x188e51, -1 - person_event SPRITE_FISHER, 14, 18, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, PowerPlantManager, -1 - person_event SPRITE_GYM_GUY, 9, 9, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GymGuyScript_0x188ecb, -1 + person_event SPRITE_OFFICER, 14, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, OfficerScript_0x188df5, -1 + person_event SPRITE_GYM_GUY, 9, 2, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GymGuyScript_0x188e15, -1 + person_event SPRITE_GYM_GUY, 11, 6, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GymGuyScript_0x188e29, -1 + person_event SPRITE_OFFICER, 3, 9, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, OfficerScript_0x188e3d, -1 + person_event SPRITE_GYM_GUY, 2, 7, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GymGuyScript_0x188e51, -1 + person_event SPRITE_FISHER, 10, 14, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PowerPlantManager, -1 + person_event SPRITE_GYM_GUY, 5, 5, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GymGuyScript_0x188ecb, -1 diff --git a/maps/RadioTower1F.asm b/maps/RadioTower1F.asm index 04a6cc907..f39a06530 100644 --- a/maps/RadioTower1F.asm +++ b/maps/RadioTower1F.asm @@ -30,7 +30,7 @@ GentlemanScript_0x5cd3d: iffalse .skip special Special_ResetLuckyNumberShowFlag .skip: - special Function4d9d3 + special Special_PrintTodaysLuckyNumber checkflag ENGINE_LUCKY_NUMBER_SHOW iftrue .GameOver writetext UnknownText_0x5cf3a @@ -484,9 +484,9 @@ RadioTower1F_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_RECEPTIONIST, 10, 9, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ReceptionistScript_0x5cd29, -1 - person_event SPRITE_LASS, 8, 20, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, LassScript_0x5ce51, EVENT_GOLDENROD_CITY_CIVILIANS - person_event SPRITE_YOUNGSTER, 8, 19, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, YoungsterScript_0x5ce54, EVENT_GOLDENROD_CITY_CIVILIANS - person_event SPRITE_ROCKET, 5, 18, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM3, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_GENTLEMAN, 10, 12, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GentlemanScript_0x5cd3d, EVENT_GOLDENROD_CITY_CIVILIANS - person_event SPRITE_COOLTRAINER_F, 10, 16, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x5cdd5, EVENT_GOLDENROD_CITY_CIVILIANS + person_event SPRITE_RECEPTIONIST, 6, 5, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ReceptionistScript_0x5cd29, -1 + person_event SPRITE_LASS, 4, 16, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, LassScript_0x5ce51, EVENT_GOLDENROD_CITY_CIVILIANS + person_event SPRITE_YOUNGSTER, 4, 15, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, YoungsterScript_0x5ce54, EVENT_GOLDENROD_CITY_CIVILIANS + person_event SPRITE_ROCKET, 1, 14, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM3, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_GENTLEMAN, 6, 8, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GentlemanScript_0x5cd3d, EVENT_GOLDENROD_CITY_CIVILIANS + person_event SPRITE_COOLTRAINER_F, 6, 12, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x5cdd5, EVENT_GOLDENROD_CITY_CIVILIANS diff --git a/maps/RadioTower2F.asm b/maps/RadioTower2F.asm index 35a3ff64c..64392145b 100644 --- a/maps/RadioTower2F.asm +++ b/maps/RadioTower2F.asm @@ -720,14 +720,14 @@ RadioTower2F_MapEventHeader: .PersonEvents: db 11 - person_event SPRITE_SUPER_NERD, 10, 10, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, SuperNerdScript_0x5d6fe, EVENT_GOLDENROD_CITY_CIVILIANS - person_event SPRITE_TEACHER, 6, 21, $5, 0, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, TeacherScript_0x5d701, -1 - person_event SPRITE_ROCKET, 8, 5, $7, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM4, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 8, 12, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM5, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 5, 8, $6, 0, 0, -1, -1, 0, 2, 2, TrainerGruntM6, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET_GIRL, 9, 14, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerGruntF2, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_BLACK_BELT, 5, 4, $6, 0, 0, -1, -1, 0, 0, 0, BlackBeltScript_0x5d71f, EVENT_RADIO_TOWER_BLACKBELT_BLOCKS_STAIRS - person_event SPRITE_BLACK_BELT, 5, 5, $6, 0, 0, -1, -1, 0, 0, 0, BlackBeltScript_0x5d722, EVENT_RADIO_TOWER_CIVILIANS_AFTER - person_event SPRITE_JIGGLYPUFF, 5, 16, $16, 0, 0, -1, -1, 0, 0, 0, JigglypuffScript_0x5d715, -1 - person_event SPRITE_BUENA, 9, 18, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, Buena, -1 - person_event SPRITE_RECEPTIONIST, 11, 16, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ReceptionistScript_0x5d8ff, EVENT_GOLDENROD_CITY_CIVILIANS + person_event SPRITE_SUPER_NERD, 6, 6, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, SuperNerdScript_0x5d6fe, EVENT_GOLDENROD_CITY_CIVILIANS + person_event SPRITE_TEACHER, 2, 17, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, TeacherScript_0x5d701, -1 + person_event SPRITE_ROCKET, 4, 1, $7, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM4, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 4, 8, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM5, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 1, 4, $6, 0, 0, -1, -1, 0, 2, 2, TrainerGruntM6, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET_GIRL, 5, 10, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerGruntF2, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_BLACK_BELT, 1, 0, $6, 0, 0, -1, -1, 0, 0, 0, BlackBeltScript_0x5d71f, EVENT_RADIO_TOWER_BLACKBELT_BLOCKS_STAIRS + person_event SPRITE_BLACK_BELT, 1, 1, $6, 0, 0, -1, -1, 0, 0, 0, BlackBeltScript_0x5d722, EVENT_RADIO_TOWER_CIVILIANS_AFTER + person_event SPRITE_JIGGLYPUFF, 1, 12, $16, 0, 0, -1, -1, 0, 0, 0, JigglypuffScript_0x5d715, -1 + person_event SPRITE_BUENA, 5, 14, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, Buena, -1 + person_event SPRITE_RECEPTIONIST, 7, 12, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ReceptionistScript_0x5d8ff, EVENT_GOLDENROD_CITY_CIVILIANS diff --git a/maps/RadioTower3F.asm b/maps/RadioTower3F.asm index f26379980..43292952b 100644 --- a/maps/RadioTower3F.asm +++ b/maps/RadioTower3F.asm @@ -343,10 +343,10 @@ RadioTower3F_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_SUPER_NERD, 8, 11, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SuperNerdScript_0x5e553, EVENT_RADIO_TOWER_CIVILIANS_AFTER - person_event SPRITE_GYM_GUY, 8, 7, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, GymGuyScript_0x5e556, -1 - person_event SPRITE_COOLTRAINER_F, 7, 15, $2, 1, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x5e56a, -1 - person_event SPRITE_ROCKET, 5, 9, $9, 0, 0, -1, -1, 0, 2, 2, TrainerGruntM7, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 6, 10, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM8, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 10, 20, $7, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM9, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_SCIENTIST, 10, 13, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 5, TrainerScientistMarc, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_SUPER_NERD, 4, 7, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SuperNerdScript_0x5e553, EVENT_RADIO_TOWER_CIVILIANS_AFTER + person_event SPRITE_GYM_GUY, 4, 3, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, GymGuyScript_0x5e556, -1 + person_event SPRITE_COOLTRAINER_F, 3, 11, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x5e56a, -1 + person_event SPRITE_ROCKET, 1, 5, $9, 0, 0, -1, -1, 0, 2, 2, TrainerGruntM7, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 2, 6, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM8, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 6, 16, $7, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM9, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_SCIENTIST, 6, 9, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 5, TrainerScientistMarc, EVENT_RADIO_TOWER_ROCKET_TAKEOVER diff --git a/maps/RadioTower4F.asm b/maps/RadioTower4F.asm index 244547475..be4cd0c42 100644 --- a/maps/RadioTower4F.asm +++ b/maps/RadioTower4F.asm @@ -257,10 +257,10 @@ RadioTower4F_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_FISHER, 8, 10, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, FisherScript_0x5eb82, EVENT_RADIO_TOWER_CIVILIANS_AFTER - person_event SPRITE_TEACHER, 10, 18, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TeacherScript_0x5eb85, -1 - person_event SPRITE_GROWLITHE, 11, 16, $16, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, GrowlitheScript_0x5ebb2, -1 - person_event SPRITE_ROCKET, 10, 9, $1f, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM10, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 5, 18, $8, 0, 2, -1, -1, 0, 2, 2, TrainerExecutivem2, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET_GIRL, 8, 16, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerGruntF4, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_SCIENTIST, 6, 8, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 4, TrainerScientistRich, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_FISHER, 4, 6, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, FisherScript_0x5eb82, EVENT_RADIO_TOWER_CIVILIANS_AFTER + person_event SPRITE_TEACHER, 6, 14, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TeacherScript_0x5eb85, -1 + person_event SPRITE_GROWLITHE, 7, 12, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, GrowlitheScript_0x5ebb2, -1 + person_event SPRITE_ROCKET, 6, 5, $1f, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM10, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 1, 14, $8, 0, 2, -1, -1, 0, 2, 2, TrainerExecutivem2, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET_GIRL, 4, 12, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerGruntF4, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_SCIENTIST, 2, 4, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 4, TrainerScientistRich, EVENT_RADIO_TOWER_ROCKET_TAKEOVER diff --git a/maps/RadioTower5F.asm b/maps/RadioTower5F.asm index e091142e8..499e7fb82 100644 --- a/maps/RadioTower5F.asm +++ b/maps/RadioTower5F.asm @@ -439,8 +439,8 @@ RadioTower5F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_GENTLEMAN, 10, 7, $3, 0, 0, -1, -1, 0, 0, 0, Director, -1 - person_event SPRITE_ROCKET, 9, 17, $8, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET_GIRL, 6, 21, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerExecutivef1, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKER, 9, 17, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, Ben, EVENT_RADIO_TOWER_CIVILIANS_AFTER - person_event SPRITE_POKE_BALL, 9, 12, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x600fe, EVENT_RADIO_TOWER_5F_ULTRA_BALL + person_event SPRITE_GENTLEMAN, 6, 3, $3, 0, 0, -1, -1, 0, 0, 0, Director, -1 + person_event SPRITE_ROCKET, 5, 13, $8, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET_GIRL, 2, 17, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerExecutivef1, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKER, 5, 13, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, Ben, EVENT_RADIO_TOWER_CIVILIANS_AFTER + person_event SPRITE_POKE_BALL, 5, 8, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x600fe, EVENT_RADIO_TOWER_5F_ULTRA_BALL diff --git a/maps/RedsHouse1F.asm b/maps/RedsHouse1F.asm index 2ab00301e..a3e23c6ff 100644 --- a/maps/RedsHouse1F.asm +++ b/maps/RedsHouse1F.asm @@ -94,4 +94,4 @@ RedsHouse1F_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_REDS_MOM, 7, 9, $8, 0, 0, -1, -1, 0, 0, 0, RedsMom, -1 + person_event SPRITE_REDS_MOM, 3, 5, $8, 0, 0, -1, -1, 0, 0, 0, RedsMom, -1 diff --git a/maps/RockTunnel1F.asm b/maps/RockTunnel1F.asm index b7fbc2f8f..6f4c0f62a 100644 --- a/maps/RockTunnel1F.asm +++ b/maps/RockTunnel1F.asm @@ -42,5 +42,5 @@ RockTunnel1F_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_POKE_BALL, 22, 8, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x743b5, EVENT_ROCK_TUNNEL_1F_ELIXER - person_event SPRITE_POKE_BALL, 19, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x743b7, EVENT_ROCK_TUNNEL_1F_TM_STEEL_WING + person_event SPRITE_POKE_BALL, 18, 4, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x743b5, EVENT_ROCK_TUNNEL_1F_ELIXER + person_event SPRITE_POKE_BALL, 15, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x743b7, EVENT_ROCK_TUNNEL_1F_TM_STEEL_WING diff --git a/maps/RockTunnelB1F.asm b/maps/RockTunnelB1F.asm index d7c0b558e..3f9547191 100644 --- a/maps/RockTunnelB1F.asm +++ b/maps/RockTunnelB1F.asm @@ -38,6 +38,6 @@ RockTunnelB1F_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_POKE_BALL, 29, 11, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x74409, EVENT_ROCK_TUNNEL_B1F_IRON - person_event SPRITE_POKE_BALL, 21, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7440b, EVENT_ROCK_TUNNEL_B1F_PP_UP - person_event SPRITE_POKE_BALL, 6, 19, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7440d, EVENT_ROCK_TUNNEL_B1F_REVIVE + person_event SPRITE_POKE_BALL, 25, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x74409, EVENT_ROCK_TUNNEL_B1F_IRON + person_event SPRITE_POKE_BALL, 17, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7440b, EVENT_ROCK_TUNNEL_B1F_PP_UP + person_event SPRITE_POKE_BALL, 2, 15, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7440d, EVENT_ROCK_TUNNEL_B1F_REVIVE diff --git a/maps/Route1.asm b/maps/Route1.asm index 8226cfd1c..0c175e98f 100644 --- a/maps/Route1.asm +++ b/maps/Route1.asm @@ -91,6 +91,6 @@ Route1_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_YOUNGSTER, 16, 8, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 4, TrainerSchoolboyDanny, -1 - person_event SPRITE_COOLTRAINER_F, 29, 13, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 2, TrainerCooltrainerfQuinn, -1 - person_event SPRITE_FRUIT_TREE, 11, 7, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1ac581, -1 + person_event SPRITE_YOUNGSTER, 12, 4, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 4, TrainerSchoolboyDanny, -1 + person_event SPRITE_COOLTRAINER_F, 25, 9, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 2, TrainerCooltrainerfQuinn, -1 + person_event SPRITE_FRUIT_TREE, 7, 3, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1ac581, -1 diff --git a/maps/Route10PokeCenter1F.asm b/maps/Route10PokeCenter1F.asm index 5bb198407..837425554 100644 --- a/maps/Route10PokeCenter1F.asm +++ b/maps/Route10PokeCenter1F.asm @@ -92,7 +92,7 @@ Route10PokeCenter1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x188bd4, -1 - person_event SPRITE_GENTLEMAN, 10, 11, $5, 0, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, GentlemanScript_0x188bd7, -1 - person_event SPRITE_GYM_GUY, 6, 11, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, GymGuyScript_0x188bda, -1 - person_event SPRITE_COOLTRAINER_F, 7, 5, $6, 0, 0, -1, -1, 0, 0, 0, CooltrainerFScript_0x188bee, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x188bd4, -1 + person_event SPRITE_GENTLEMAN, 6, 7, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, GentlemanScript_0x188bd7, -1 + person_event SPRITE_GYM_GUY, 2, 7, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, GymGuyScript_0x188bda, -1 + person_event SPRITE_COOLTRAINER_F, 3, 1, $6, 0, 0, -1, -1, 0, 0, 0, CooltrainerFScript_0x188bee, -1 diff --git a/maps/Route10South.asm b/maps/Route10South.asm index 0695fada7..662509b21 100644 --- a/maps/Route10South.asm +++ b/maps/Route10South.asm @@ -88,5 +88,5 @@ Route10South_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_POKEFAN_M, 7, 21, $8, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerHikerJim, -1 - person_event SPRITE_POKEFAN_M, 14, 12, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerPokefanmRobert, -1 + person_event SPRITE_POKEFAN_M, 3, 17, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerHikerJim, -1 + person_event SPRITE_POKEFAN_M, 10, 8, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerPokefanmRobert, -1 diff --git a/maps/Route11.asm b/maps/Route11.asm index 2b9c6908c..c3ee336ab 100644 --- a/maps/Route11.asm +++ b/maps/Route11.asm @@ -156,8 +156,8 @@ Route11_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_YOUNGSTER, 18, 26, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerYoungsterOwen, -1 - person_event SPRITE_YOUNGSTER, 8, 24, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerYoungsterJason, -1 - person_event SPRITE_YOUNGSTER, 11, 32, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerPsychicHerman, -1 - person_event SPRITE_YOUNGSTER, 10, 12, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerPsychicFidel, -1 - person_event SPRITE_FRUIT_TREE, 6, 36, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x68055, -1 + person_event SPRITE_YOUNGSTER, 14, 22, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerYoungsterOwen, -1 + person_event SPRITE_YOUNGSTER, 4, 20, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerYoungsterJason, -1 + person_event SPRITE_YOUNGSTER, 7, 28, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerPsychicHerman, -1 + person_event SPRITE_YOUNGSTER, 6, 8, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerPsychicFidel, -1 + person_event SPRITE_FRUIT_TREE, 2, 32, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x68055, -1 diff --git a/maps/Route12.asm b/maps/Route12.asm index 842b81bd3..8b7ebe964 100644 --- a/maps/Route12.asm +++ b/maps/Route12.asm @@ -178,9 +178,9 @@ Route12_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_FISHER, 17, 9, $a, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 1, TrainerFisherMartin, -1 - person_event SPRITE_FISHER, 27, 18, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 1, TrainerFisherStephen, -1 - person_event SPRITE_FISHER, 42, 14, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 5, TrainerFisherBarney, -1 - person_event SPRITE_FISHER, 11, 10, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerFisherKyle, -1 - person_event SPRITE_POKE_BALL, 47, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a700b, EVENT_ROUTE_12_CALCIUM - person_event SPRITE_POKE_BALL, 55, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a700d, EVENT_ROUTE_12_NUGGET + person_event SPRITE_FISHER, 13, 5, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 1, TrainerFisherMartin, -1 + person_event SPRITE_FISHER, 23, 14, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 1, TrainerFisherStephen, -1 + person_event SPRITE_FISHER, 38, 10, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 5, TrainerFisherBarney, -1 + person_event SPRITE_FISHER, 7, 6, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerFisherKyle, -1 + person_event SPRITE_POKE_BALL, 43, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a700b, EVENT_ROUTE_12_CALCIUM + person_event SPRITE_POKE_BALL, 51, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a700d, EVENT_ROUTE_12_NUGGET diff --git a/maps/Route12SuperRodHouse.asm b/maps/Route12SuperRodHouse.asm index 74d161e39..bc4376e32 100644 --- a/maps/Route12SuperRodHouse.asm +++ b/maps/Route12SuperRodHouse.asm @@ -93,4 +93,4 @@ Route12SuperRodHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_FISHING_GURU, 7, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, FishingGuruScript_0x7f484, -1 + person_event SPRITE_FISHING_GURU, 3, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, FishingGuruScript_0x7f484, -1 diff --git a/maps/Route13.asm b/maps/Route13.asm index 1c3c24fb3..6314a69d2 100644 --- a/maps/Route13.asm +++ b/maps/Route13.asm @@ -204,8 +204,8 @@ Route13_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_YOUNGSTER, 10, 46, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, TrainerBird_keeperPerry, -1 - person_event SPRITE_YOUNGSTER, 10, 47, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, TrainerBird_keeperBret, -1 - person_event SPRITE_POKEFAN_M, 12, 36, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerPokefanmJoshua, -1 - person_event SPRITE_POKEFAN_M, 14, 18, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 4, TrainerHikerKenny, -1 - person_event SPRITE_POKEFAN_M, 10, 29, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 4, TrainerPokefanmAlex, -1 + person_event SPRITE_YOUNGSTER, 6, 42, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 2, TrainerBird_keeperPerry, -1 + person_event SPRITE_YOUNGSTER, 6, 43, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 2, TrainerBird_keeperBret, -1 + person_event SPRITE_POKEFAN_M, 8, 32, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerPokefanmJoshua, -1 + person_event SPRITE_POKEFAN_M, 10, 14, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 4, TrainerHikerKenny, -1 + person_event SPRITE_POKEFAN_M, 6, 25, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 4, TrainerPokefanmAlex, -1 diff --git a/maps/Route14.asm b/maps/Route14.asm index 6467bdc51..08843565d 100644 --- a/maps/Route14.asm +++ b/maps/Route14.asm @@ -124,7 +124,7 @@ Route14_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_POKEFAN_M, 19, 15, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerPokefanmCarter, -1 - person_event SPRITE_YOUNGSTER, 31, 15, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerBird_keeperRoy, -1 - person_event SPRITE_POKEFAN_M, 15, 10, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerPokefanmTrevor, -1 - person_event SPRITE_TEACHER, 9, 11, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 4, TeacherScript_0x1ad47f, -1 + person_event SPRITE_POKEFAN_M, 15, 11, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerPokefanmCarter, -1 + person_event SPRITE_YOUNGSTER, 27, 11, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerBird_keeperRoy, -1 + person_event SPRITE_POKEFAN_M, 11, 6, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerPokefanmTrevor, -1 + person_event SPRITE_TEACHER, 5, 7, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 4, TeacherScript_0x1ad47f, -1 diff --git a/maps/Route15.asm b/maps/Route15.asm index 436cbbeec..a5480c880 100644 --- a/maps/Route15.asm +++ b/maps/Route15.asm @@ -210,10 +210,10 @@ Route15_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_YOUNGSTER, 14, 14, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 4, TrainerSchoolboyKipp, -1 - person_event SPRITE_YOUNGSTER, 17, 19, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerSchoolboyTommy, -1 - person_event SPRITE_YOUNGSTER, 14, 37, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerSchoolboyJohnny, -1 - person_event SPRITE_YOUNGSTER, 14, 31, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerSchoolboyBilly, -1 - person_event SPRITE_TEACHER, 16, 34, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 4, TrainerTeacherColette, -1 - person_event SPRITE_TEACHER, 14, 24, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerTeacherHillary, -1 - person_event SPRITE_POKE_BALL, 9, 16, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1aa5e4, EVENT_ROUTE_15_PP_UP + person_event SPRITE_YOUNGSTER, 10, 10, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 4, TrainerSchoolboyKipp, -1 + person_event SPRITE_YOUNGSTER, 13, 15, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerSchoolboyTommy, -1 + person_event SPRITE_YOUNGSTER, 10, 33, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerSchoolboyJohnny, -1 + person_event SPRITE_YOUNGSTER, 10, 27, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerSchoolboyBilly, -1 + person_event SPRITE_TEACHER, 12, 30, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 4, TrainerTeacherColette, -1 + person_event SPRITE_TEACHER, 10, 20, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerTeacherHillary, -1 + person_event SPRITE_POKE_BALL, 5, 12, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1aa5e4, EVENT_ROUTE_15_PP_UP diff --git a/maps/Route15FuchsiaGate.asm b/maps/Route15FuchsiaGate.asm index 4391873e4..2ffb7ee56 100644 --- a/maps/Route15FuchsiaGate.asm +++ b/maps/Route15FuchsiaGate.asm @@ -35,4 +35,4 @@ Route15FuchsiaGate_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_OFFICER, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, OfficerScript_0x19679e, -1 + person_event SPRITE_OFFICER, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, OfficerScript_0x19679e, -1 diff --git a/maps/Route16FuchsiaSpeechHouse.asm b/maps/Route16FuchsiaSpeechHouse.asm index 668dafac0..aab16e31b 100644 --- a/maps/Route16FuchsiaSpeechHouse.asm +++ b/maps/Route16FuchsiaSpeechHouse.asm @@ -38,4 +38,4 @@ Route16FuchsiaSpeechHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_SUPER_NERD, 7, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, SuperNerdScript_0x73373, -1 + person_event SPRITE_SUPER_NERD, 3, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, SuperNerdScript_0x73373, -1 diff --git a/maps/Route16Gate.asm b/maps/Route16Gate.asm index 9de374f99..b2ad14eb4 100644 --- a/maps/Route16Gate.asm +++ b/maps/Route16Gate.asm @@ -80,4 +80,4 @@ Route16Gate_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_OFFICER, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, OfficerScript_0x733ea, -1 + person_event SPRITE_OFFICER, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, OfficerScript_0x733ea, -1 diff --git a/maps/Route17.asm b/maps/Route17.asm index 976e1d710..6543defdd 100644 --- a/maps/Route17.asm +++ b/maps/Route17.asm @@ -150,7 +150,7 @@ Route17_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_BIKER, 21, 8, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 4, TrainerBikerRiley, -1 - person_event SPRITE_BIKER, 72, 13, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 1, TrainerBikerJoel, -1 - person_event SPRITE_BIKER, 57, 7, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerBikerGlenn, -1 - person_event SPRITE_BIKER, 84, 10, $9, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 4, TrainerBikerCharles, -1 + person_event SPRITE_BIKER, 17, 4, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 4, TrainerBikerRiley, -1 + person_event SPRITE_BIKER, 68, 9, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 1, TrainerBikerJoel, -1 + person_event SPRITE_BIKER, 53, 3, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerBikerGlenn, -1 + person_event SPRITE_BIKER, 80, 6, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 4, TrainerBikerCharles, -1 diff --git a/maps/Route1718Gate.asm b/maps/Route1718Gate.asm index 970e254ba..c23d76d7f 100644 --- a/maps/Route1718Gate.asm +++ b/maps/Route1718Gate.asm @@ -71,4 +71,4 @@ Route1718Gate_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_OFFICER, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, OfficerScript_0x7360e, -1 + person_event SPRITE_OFFICER, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, OfficerScript_0x7360e, -1 diff --git a/maps/Route18.asm b/maps/Route18.asm index 891418af4..00728f8d2 100644 --- a/maps/Route18.asm +++ b/maps/Route18.asm @@ -91,5 +91,5 @@ Route18_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_YOUNGSTER, 16, 13, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerBird_keeperBoris, -1 - person_event SPRITE_YOUNGSTER, 10, 17, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerBird_keeperBob, -1 + person_event SPRITE_YOUNGSTER, 12, 9, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerBird_keeperBoris, -1 + person_event SPRITE_YOUNGSTER, 6, 13, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerBird_keeperBob, -1 diff --git a/maps/Route19.asm b/maps/Route19.asm index e2ea05432..beb87fd55 100644 --- a/maps/Route19.asm +++ b/maps/Route19.asm @@ -247,9 +247,9 @@ Route19_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_SWIMMER_GIRL, 27, 13, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 0, TrainerSwimmerfDawn, -1 - person_event SPRITE_SWIMMER_GUY, 32, 17, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerSwimmermHarold, -1 - person_event SPRITE_SWIMMER_GUY, 21, 15, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerSwimmermJerome, -1 - person_event SPRITE_SWIMMER_GUY, 27, 12, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 0, TrainerSwimmermTucker, -1 - person_event SPRITE_FISHER, 9, 13, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 1, FisherScript_0x19ea4d, -1 - person_event SPRITE_FISHER, 9, 15, $5, 0, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 1, FisherScript_0x19ea61, -1 + person_event SPRITE_SWIMMER_GIRL, 23, 9, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 0, TrainerSwimmerfDawn, -1 + person_event SPRITE_SWIMMER_GUY, 28, 13, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerSwimmermHarold, -1 + person_event SPRITE_SWIMMER_GUY, 17, 11, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerSwimmermJerome, -1 + person_event SPRITE_SWIMMER_GUY, 23, 8, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 0, TrainerSwimmermTucker, -1 + person_event SPRITE_FISHER, 5, 9, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 1, FisherScript_0x19ea4d, -1 + person_event SPRITE_FISHER, 5, 11, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 1, FisherScript_0x19ea61, -1 diff --git a/maps/Route19FuchsiaGate.asm b/maps/Route19FuchsiaGate.asm index f115b5658..1036a5fdc 100644 --- a/maps/Route19FuchsiaGate.asm +++ b/maps/Route19FuchsiaGate.asm @@ -61,4 +61,4 @@ Route19FuchsiaGate_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_OFFICER, 8, 4, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, OfficerScript_0x1ab3f6, -1 + person_event SPRITE_OFFICER, 4, 0, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, OfficerScript_0x1ab3f6, -1 diff --git a/maps/Route2.asm b/maps/Route2.asm index 5b16de8b1..79a72bfae 100644 --- a/maps/Route2.asm +++ b/maps/Route2.asm @@ -162,11 +162,11 @@ Route2_MapEventHeader: .PersonEvents: db 8 - person_event SPRITE_BUG_CATCHER, 49, 14, $8, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 5, TrainerBug_catcherRob, -1 - person_event SPRITE_BUG_CATCHER, 8, 10, $1f, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerBug_catcherEd, -1 - person_event SPRITE_BUG_CATCHER, 44, 4, $9, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerBug_catcherDoug, -1 - person_event SPRITE_POKE_BALL, 33, 4, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1ac2fe, EVENT_ROUTE_2_DIRE_HIT - person_event SPRITE_POKE_BALL, 27, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1ac300, EVENT_ROUTE_2_MAX_POTION - person_event SPRITE_POKE_BALL, 6, 23, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1ac302, EVENT_ROUTE_2_CARBOS - person_event SPRITE_POKE_BALL, 54, 18, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1ac304, EVENT_ROUTE_2_ELIXER - person_event SPRITE_FRUIT_TREE, 18, 14, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1ac306, -1 + person_event SPRITE_BUG_CATCHER, 45, 10, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 5, TrainerBug_catcherRob, -1 + person_event SPRITE_BUG_CATCHER, 4, 6, $1f, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerBug_catcherEd, -1 + person_event SPRITE_BUG_CATCHER, 40, 0, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerBug_catcherDoug, -1 + person_event SPRITE_POKE_BALL, 29, 0, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1ac2fe, EVENT_ROUTE_2_DIRE_HIT + person_event SPRITE_POKE_BALL, 23, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1ac300, EVENT_ROUTE_2_MAX_POTION + person_event SPRITE_POKE_BALL, 2, 19, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1ac302, EVENT_ROUTE_2_CARBOS + person_event SPRITE_POKE_BALL, 50, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1ac304, EVENT_ROUTE_2_ELIXER + person_event SPRITE_FRUIT_TREE, 14, 10, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1ac306, -1 diff --git a/maps/Route20.asm b/maps/Route20.asm index f30062772..e6231389a 100644 --- a/maps/Route20.asm +++ b/maps/Route20.asm @@ -127,6 +127,6 @@ Route20_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_SWIMMER_GIRL, 12, 56, $a, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerSwimmerfNicole, -1 - person_event SPRITE_SWIMMER_GIRL, 17, 49, $a, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerSwimmerfLori, -1 - person_event SPRITE_SWIMMER_GUY, 17, 16, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerSwimmermCameron, -1 + person_event SPRITE_SWIMMER_GIRL, 8, 52, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerSwimmerfNicole, -1 + person_event SPRITE_SWIMMER_GIRL, 13, 45, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerSwimmerfLori, -1 + person_event SPRITE_SWIMMER_GUY, 13, 12, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerSwimmermCameron, -1 diff --git a/maps/Route21.asm b/maps/Route21.asm index 661fafadb..15dd2d96b 100644 --- a/maps/Route21.asm +++ b/maps/Route21.asm @@ -99,6 +99,6 @@ Route21_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_SWIMMER_GIRL, 20, 15, $a, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerSwimmerfNikki, -1 - person_event SPRITE_SWIMMER_GUY, 34, 6, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 4, TrainerSwimmermSeth, -1 - person_event SPRITE_FISHER, 26, 18, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 1, TrainerFisherArnold, -1 + person_event SPRITE_SWIMMER_GIRL, 16, 11, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerSwimmerfNikki, -1 + person_event SPRITE_SWIMMER_GUY, 30, 2, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 4, TrainerSwimmermSeth, -1 + person_event SPRITE_FISHER, 22, 14, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 1, TrainerFisherArnold, -1 diff --git a/maps/Route24.asm b/maps/Route24.asm index 97859e9dc..fffc4caec 100644 --- a/maps/Route24.asm +++ b/maps/Route24.asm @@ -130,4 +130,4 @@ Route24_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_ROCKET, 11, 12, $3, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x1adbfa, EVENT_ROUTE_24_ROCKET + person_event SPRITE_ROCKET, 7, 8, $3, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x1adbfa, EVENT_ROUTE_24_ROCKET diff --git a/maps/Route25.asm b/maps/Route25.asm index b7a42ab06..7b3fee499 100644 --- a/maps/Route25.asm +++ b/maps/Route25.asm @@ -439,14 +439,14 @@ Route25_MapEventHeader: .PersonEvents: db 11 - person_event SPRITE_MISTY, 13, 50, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ObjectEvent, EVENT_ROUTE_25_MISTY_BOYFRIEND - person_event SPRITE_COOLTRAINER_M, 14, 50, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ObjectEvent, EVENT_ROUTE_25_MISTY_BOYFRIEND - person_event SPRITE_YOUNGSTER, 12, 16, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerSchoolboyDudley, -1 - person_event SPRITE_LASS, 15, 20, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerLassEllen, -1 - person_event SPRITE_YOUNGSTER, 12, 25, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerSchoolboyJoe, -1 - person_event SPRITE_LASS, 10, 26, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerLassLaura, -1 - person_event SPRITE_YOUNGSTER, 8, 29, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 2, TrainerCamperLloyd, -1 - person_event SPRITE_LASS, 15, 32, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerLassShannon, -1 - person_event SPRITE_SUPER_NERD, 11, 35, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 1, TrainerSupernerdPat, -1 - person_event SPRITE_COOLTRAINER_M, 12, 41, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerMScript_0x19efac, -1 - person_event SPRITE_POKE_BALL, 8, 36, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19efe3, EVENT_ROUTE_25_PROTEIN + person_event SPRITE_MISTY, 9, 46, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ObjectEvent, EVENT_ROUTE_25_MISTY_BOYFRIEND + person_event SPRITE_COOLTRAINER_M, 10, 46, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ObjectEvent, EVENT_ROUTE_25_MISTY_BOYFRIEND + person_event SPRITE_YOUNGSTER, 8, 12, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerSchoolboyDudley, -1 + person_event SPRITE_LASS, 11, 16, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerLassEllen, -1 + person_event SPRITE_YOUNGSTER, 8, 21, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerSchoolboyJoe, -1 + person_event SPRITE_LASS, 6, 22, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerLassLaura, -1 + person_event SPRITE_YOUNGSTER, 4, 25, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 2, TrainerCamperLloyd, -1 + person_event SPRITE_LASS, 11, 28, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerLassShannon, -1 + person_event SPRITE_SUPER_NERD, 7, 31, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 1, TrainerSupernerdPat, -1 + person_event SPRITE_COOLTRAINER_M, 8, 37, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerMScript_0x19efac, -1 + person_event SPRITE_POKE_BALL, 4, 32, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19efe3, EVENT_ROUTE_25_PROTEIN diff --git a/maps/Route26.asm b/maps/Route26.asm index 16f746894..8feb7343d 100644 --- a/maps/Route26.asm +++ b/maps/Route26.asm @@ -421,11 +421,11 @@ Route26_MapEventHeader: .PersonEvents: db 8 - person_event SPRITE_COOLTRAINER_M, 28, 18, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 2, TrainerCooltrainermJake, -1 - person_event SPRITE_COOLTRAINER_M, 42, 13, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerCooltrainermGaven3, -1 - person_event SPRITE_COOLTRAINER_F, 60, 14, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerCooltrainerfJoyce, -1 - person_event SPRITE_COOLTRAINER_F, 12, 9, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 4, TrainerCooltrainerfBeth1, -1 - person_event SPRITE_YOUNGSTER, 83, 17, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, TrainerPsychicRichard, -1 - person_event SPRITE_FISHER, 96, 14, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerFisherScott, -1 - person_event SPRITE_FRUIT_TREE, 58, 18, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a4ec2, -1 - person_event SPRITE_POKE_BALL, 19, 13, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a4ec4, EVENT_ROUTE_26_MAX_ELIXER + person_event SPRITE_COOLTRAINER_M, 24, 14, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 2, TrainerCooltrainermJake, -1 + person_event SPRITE_COOLTRAINER_M, 38, 9, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerCooltrainermGaven3, -1 + person_event SPRITE_COOLTRAINER_F, 56, 10, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerCooltrainerfJoyce, -1 + person_event SPRITE_COOLTRAINER_F, 8, 5, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 4, TrainerCooltrainerfBeth1, -1 + person_event SPRITE_YOUNGSTER, 79, 13, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 2, TrainerPsychicRichard, -1 + person_event SPRITE_FISHER, 92, 10, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerFisherScott, -1 + person_event SPRITE_FRUIT_TREE, 54, 14, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a4ec2, -1 + person_event SPRITE_POKE_BALL, 15, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a4ec4, EVENT_ROUTE_26_MAX_ELIXER diff --git a/maps/Route26DayofWeekSiblingsHouse.asm b/maps/Route26DayofWeekSiblingsHouse.asm index f0e49c8a7..b0a8a1c2a 100644 --- a/maps/Route26DayofWeekSiblingsHouse.asm +++ b/maps/Route26DayofWeekSiblingsHouse.asm @@ -84,4 +84,4 @@ Route26DayofWeekSiblingsHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKEDEX, 7, 7, $1, 0, 0, -1, -1, 0, 0, 0, PokedexScript_0x7b1e4, -1 + person_event SPRITE_POKEDEX, 3, 3, $1, 0, 0, -1, -1, 0, 0, 0, PokedexScript_0x7b1e4, -1 diff --git a/maps/Route26HealSpeechHouse.asm b/maps/Route26HealSpeechHouse.asm index 091462a5b..44e3e9019 100644 --- a/maps/Route26HealSpeechHouse.asm +++ b/maps/Route26HealSpeechHouse.asm @@ -64,4 +64,4 @@ Route26HealSpeechHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_TEACHER, 7, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, TeacherScript_0x7b125, -1 + person_event SPRITE_TEACHER, 3, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, TeacherScript_0x7b125, -1 diff --git a/maps/Route27.asm b/maps/Route27.asm index 584235878..3a3d871cd 100644 --- a/maps/Route27.asm +++ b/maps/Route27.asm @@ -479,12 +479,12 @@ Route27_MapEventHeader: .PersonEvents: db 9 - person_event SPRITE_COOLTRAINER_M, 11, 52, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerCooltrainermBlake, -1 - person_event SPRITE_COOLTRAINER_M, 10, 62, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 4, TrainerCooltrainermBrian, -1 - person_event SPRITE_COOLTRAINER_F, 14, 76, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 4, TrainerCooltrainerfReena, -1 - person_event SPRITE_COOLTRAINER_F, 10, 41, $1f, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 2, TrainerCooltrainerfMegan, -1 - person_event SPRITE_YOUNGSTER, 11, 69, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerPsychicGilbert, -1 - person_event SPRITE_YOUNGSTER, 17, 62, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerBird_keeperJose2, -1 - person_event SPRITE_POKE_BALL, 16, 64, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a0a62, EVENT_ROUTE_27_TM_SOLARBEAM - person_event SPRITE_POKE_BALL, 16, 57, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a0a64, EVENT_ROUTE_27_RARE_CANDY - person_event SPRITE_FISHER, 14, 25, $3, 0, 0, -1, -1, 0, 0, 3, FisherScript_0x1a089c, -1 + person_event SPRITE_COOLTRAINER_M, 7, 48, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerCooltrainermBlake, -1 + person_event SPRITE_COOLTRAINER_M, 6, 58, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 4, TrainerCooltrainermBrian, -1 + person_event SPRITE_COOLTRAINER_F, 10, 72, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 4, TrainerCooltrainerfReena, -1 + person_event SPRITE_COOLTRAINER_F, 6, 37, $1f, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 2, TrainerCooltrainerfMegan, -1 + person_event SPRITE_YOUNGSTER, 7, 65, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerPsychicGilbert, -1 + person_event SPRITE_YOUNGSTER, 13, 58, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerBird_keeperJose2, -1 + person_event SPRITE_POKE_BALL, 12, 60, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a0a62, EVENT_ROUTE_27_TM_SOLARBEAM + person_event SPRITE_POKE_BALL, 12, 53, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a0a64, EVENT_ROUTE_27_RARE_CANDY + person_event SPRITE_FISHER, 10, 21, $3, 0, 0, -1, -1, 0, 0, 3, FisherScript_0x1a089c, -1 diff --git a/maps/Route27SandstormHouse.asm b/maps/Route27SandstormHouse.asm index cd0dfa69d..9737ae99a 100644 --- a/maps/Route27SandstormHouse.asm +++ b/maps/Route27SandstormHouse.asm @@ -109,4 +109,4 @@ Route27SandstormHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_GRANNY, 8, 6, $6, 0, 0, -1, -1, 0, 0, 0, SandstormHouseWoman, -1 + person_event SPRITE_GRANNY, 4, 2, $6, 0, 0, -1, -1, 0, 0, 0, SandstormHouseWoman, -1 diff --git a/maps/Route28FamousSpeechHouse.asm b/maps/Route28FamousSpeechHouse.asm index 75e739843..a0f474b49 100644 --- a/maps/Route28FamousSpeechHouse.asm +++ b/maps/Route28FamousSpeechHouse.asm @@ -87,5 +87,5 @@ Route28FamousSpeechHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_COOLTRAINER_F, 7, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, Celebrity, -1 - person_event SPRITE_MOLTRES, 9, 10, $16, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, CelebritysFearow, -1 + person_event SPRITE_COOLTRAINER_F, 3, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, Celebrity, -1 + person_event SPRITE_MOLTRES, 5, 6, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, CelebritysFearow, -1 diff --git a/maps/Route29.asm b/maps/Route29.asm index 54688bf22..0fa4f7677 100644 --- a/maps/Route29.asm +++ b/maps/Route29.asm @@ -430,11 +430,11 @@ Route29_MapEventHeader: .PersonEvents: db 8 - person_event SPRITE_COOLTRAINER_M, 16, 54, $3, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerMScript_0x1a0ff1, -1 - person_event SPRITE_YOUNGSTER, 20, 31, $4, 1, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x1a1028, -1 - person_event SPRITE_TEACHER, 15, 19, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TeacherScript_0x1a102b, -1 - person_event SPRITE_FRUIT_TREE, 6, 16, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a1089, -1 - person_event SPRITE_FISHER, 7, 29, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, FisherScript_0x1a102e, -1 - person_event SPRITE_COOLTRAINER_M, 8, 17, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerMScript_0x1a1031, -1 - person_event SPRITE_TEACHER, 16, 33, $3, 0, 0, -1, -1, 0, 0, 0, TuscanyScript, EVENT_ROUTE_29_TUSCANY_OF_TUESDAY - person_event SPRITE_POKE_BALL, 6, 52, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a108b, EVENT_ROUTE_29_POTION + person_event SPRITE_COOLTRAINER_M, 12, 50, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerMScript_0x1a0ff1, -1 + person_event SPRITE_YOUNGSTER, 16, 27, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x1a1028, -1 + person_event SPRITE_TEACHER, 11, 15, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TeacherScript_0x1a102b, -1 + person_event SPRITE_FRUIT_TREE, 2, 12, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a1089, -1 + person_event SPRITE_FISHER, 3, 25, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, FisherScript_0x1a102e, -1 + person_event SPRITE_COOLTRAINER_M, 4, 13, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerMScript_0x1a1031, -1 + person_event SPRITE_TEACHER, 12, 29, $3, 0, 0, -1, -1, 0, 0, 0, TuscanyScript, EVENT_ROUTE_29_TUSCANY_OF_TUESDAY + person_event SPRITE_POKE_BALL, 2, 48, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a108b, EVENT_ROUTE_29_POTION diff --git a/maps/Route2946Gate.asm b/maps/Route2946Gate.asm index ba3c55f43..513e8f263 100644 --- a/maps/Route2946Gate.asm +++ b/maps/Route2946Gate.asm @@ -51,5 +51,5 @@ Route2946Gate_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_OFFICER, 8, 4, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, OfficerScript_0x7b5bb, -1 - person_event SPRITE_YOUNGSTER, 8, 10, $4, 1, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x7b5be, -1 + person_event SPRITE_OFFICER, 4, 0, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, OfficerScript_0x7b5bb, -1 + person_event SPRITE_YOUNGSTER, 4, 6, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x7b5be, -1 diff --git a/maps/Route2Gate.asm b/maps/Route2Gate.asm index 6d539111f..a49673d55 100644 --- a/maps/Route2Gate.asm +++ b/maps/Route2Gate.asm @@ -41,4 +41,4 @@ Route2Gate_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_SCIENTIST, 8, 10, $4, 2, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ScientistScript_0x9b952, -1 + person_event SPRITE_SCIENTIST, 4, 6, $4, 2, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ScientistScript_0x9b952, -1 diff --git a/maps/Route2NuggetSpeechHouse.asm b/maps/Route2NuggetSpeechHouse.asm index 1a9f71c56..8910846dc 100644 --- a/maps/Route2NuggetSpeechHouse.asm +++ b/maps/Route2NuggetSpeechHouse.asm @@ -66,4 +66,4 @@ Route2NuggetSpeechHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_FISHER, 8, 6, $4, 2, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, FisherScript_0x9b847, -1 + person_event SPRITE_FISHER, 4, 2, $4, 2, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, FisherScript_0x9b847, -1 diff --git a/maps/Route3.asm b/maps/Route3.asm index eb45b6030..87435437f 100644 --- a/maps/Route3.asm +++ b/maps/Route3.asm @@ -143,7 +143,7 @@ Route3_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_FISHER, 16, 30, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 2, TrainerFirebreatherOtis, -1 - person_event SPRITE_YOUNGSTER, 11, 14, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerYoungsterWarren, -1 - person_event SPRITE_YOUNGSTER, 7, 20, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerYoungsterJimmy, -1 - person_event SPRITE_FISHER, 9, 53, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerFirebreatherBurt, -1 + person_event SPRITE_FISHER, 12, 26, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 2, TrainerFirebreatherOtis, -1 + person_event SPRITE_YOUNGSTER, 7, 10, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerYoungsterWarren, -1 + person_event SPRITE_YOUNGSTER, 3, 16, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerYoungsterJimmy, -1 + person_event SPRITE_FISHER, 5, 49, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerFirebreatherBurt, -1 diff --git a/maps/Route30.asm b/maps/Route30.asm index 880e643b8..07667a78b 100644 --- a/maps/Route30.asm +++ b/maps/Route30.asm @@ -416,14 +416,14 @@ Route30_MapEventHeader: .PersonEvents: db 11 - person_event SPRITE_YOUNGSTER, 30, 9, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, YoungsterScript_0x1a1673, EVENT_ROUTE_30_BATTLE - person_event SPRITE_YOUNGSTER, 32, 6, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerYoungsterJoey, EVENT_ROUTE_30_YOUNGSTER_JOEY - person_event SPRITE_YOUNGSTER, 27, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerYoungsterMikey, -1 - person_event SPRITE_BUG_CATCHER, 11, 5, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerBug_catcherDon, -1 - person_event SPRITE_YOUNGSTER, 34, 11, $5, 0, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x1a17d2, -1 - person_event SPRITE_MONSTER, 28, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ObjectEvent, EVENT_ROUTE_30_BATTLE - person_event SPRITE_MONSTER, 29, 9, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_ROUTE_30_BATTLE - person_event SPRITE_FRUIT_TREE, 43, 9, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a17f7, -1 - person_event SPRITE_FRUIT_TREE, 9, 15, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a17f9, -1 - person_event SPRITE_COOLTRAINER_F, 17, 6, $6, 0, 0, -1, -1, 0, 0, 0, CooltrainerFScript_0x1a17e6, -1 - person_event SPRITE_POKE_BALL, 39, 12, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a17f5, EVENT_ROUTE_30_ANTIDOTE + person_event SPRITE_YOUNGSTER, 26, 5, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, YoungsterScript_0x1a1673, EVENT_ROUTE_30_BATTLE + person_event SPRITE_YOUNGSTER, 28, 2, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerYoungsterJoey, EVENT_ROUTE_30_YOUNGSTER_JOEY + person_event SPRITE_YOUNGSTER, 23, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerYoungsterMikey, -1 + person_event SPRITE_BUG_CATCHER, 7, 1, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerBug_catcherDon, -1 + person_event SPRITE_YOUNGSTER, 30, 7, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x1a17d2, -1 + person_event SPRITE_MONSTER, 24, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ObjectEvent, EVENT_ROUTE_30_BATTLE + person_event SPRITE_MONSTER, 25, 5, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_ROUTE_30_BATTLE + person_event SPRITE_FRUIT_TREE, 39, 5, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a17f7, -1 + person_event SPRITE_FRUIT_TREE, 5, 11, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a17f9, -1 + person_event SPRITE_COOLTRAINER_F, 13, 2, $6, 0, 0, -1, -1, 0, 0, 0, CooltrainerFScript_0x1a17e6, -1 + person_event SPRITE_POKE_BALL, 35, 8, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a17f5, EVENT_ROUTE_30_ANTIDOTE diff --git a/maps/Route30BerrySpeechHouse.asm b/maps/Route30BerrySpeechHouse.asm index 9f90b7aea..3590efca0 100644 --- a/maps/Route30BerrySpeechHouse.asm +++ b/maps/Route30BerrySpeechHouse.asm @@ -62,4 +62,4 @@ Route30BerrySpeechHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKEFAN_M, 7, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, PokefanMScript_0x196d64, -1 + person_event SPRITE_POKEFAN_M, 3, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, PokefanMScript_0x196d64, -1 diff --git a/maps/Route31.asm b/maps/Route31.asm index 168e8bc20..832859129 100644 --- a/maps/Route31.asm +++ b/maps/Route31.asm @@ -15,7 +15,7 @@ UnknownScript_0x1a543c: return UnknownScript_0x1a5443: - specialphonecall MOMCALL_WORRIED + specialphonecall SPECIALCALL_WORRIED return TrainerBug_catcherWade1: @@ -430,10 +430,10 @@ Route31_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_FISHER, 11, 21, $6, 0, 0, -1, -1, 0, 0, 0, FisherScript_0x1a5570, -1 - person_event SPRITE_YOUNGSTER, 9, 13, $2, 1, 1, -1, -1, 0, 0, 0, YoungsterScript_0x1a55ed, -1 - person_event SPRITE_BUG_CATCHER, 17, 25, $8, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 5, TrainerBug_catcherWade1, -1 - person_event SPRITE_COOLTRAINER_M, 12, 37, $2, 1, 1, -1, -1, 0, 0, 0, CooltrainerMScript_0x1a55f6, -1 - person_event SPRITE_FRUIT_TREE, 11, 20, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a55f9, -1 - person_event SPRITE_POKE_BALL, 9, 33, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a55fb, EVENT_ROUTE_31_POTION - person_event SPRITE_POKE_BALL, 19, 23, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a55fd, EVENT_ROUTE_31_POKE_BALL + person_event SPRITE_FISHER, 7, 17, $6, 0, 0, -1, -1, 0, 0, 0, FisherScript_0x1a5570, -1 + person_event SPRITE_YOUNGSTER, 5, 9, $2, 1, 1, -1, -1, 0, 0, 0, YoungsterScript_0x1a55ed, -1 + person_event SPRITE_BUG_CATCHER, 13, 21, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 5, TrainerBug_catcherWade1, -1 + person_event SPRITE_COOLTRAINER_M, 8, 33, $2, 1, 1, -1, -1, 0, 0, 0, CooltrainerMScript_0x1a55f6, -1 + person_event SPRITE_FRUIT_TREE, 7, 16, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a55f9, -1 + person_event SPRITE_POKE_BALL, 5, 29, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a55fb, EVENT_ROUTE_31_POTION + person_event SPRITE_POKE_BALL, 15, 19, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a55fd, EVENT_ROUTE_31_POKE_BALL diff --git a/maps/Route31VioletGate.asm b/maps/Route31VioletGate.asm index d383e0fdd..83fd9ed85 100644 --- a/maps/Route31VioletGate.asm +++ b/maps/Route31VioletGate.asm @@ -42,5 +42,5 @@ Route31VioletGate_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_OFFICER, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, OfficerScript_0x197634, -1 - person_event SPRITE_COOLTRAINER_F, 6, 5, $3, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, CooltrainerFScript_0x197637, -1 + person_event SPRITE_OFFICER, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, OfficerScript_0x197634, -1 + person_event SPRITE_COOLTRAINER_F, 2, 1, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, CooltrainerFScript_0x197637, -1 diff --git a/maps/Route32.asm b/maps/Route32.asm index 1a7a0f4ce..9b4bfe553 100644 --- a/maps/Route32.asm +++ b/maps/Route32.asm @@ -946,17 +946,17 @@ Route32_MapEventHeader: .PersonEvents: db 14 - person_event SPRITE_FISHER, 53, 12, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 1, TrainerFisherJustin, -1 - person_event SPRITE_FISHER, 60, 16, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerFisherRalph1, -1 - person_event SPRITE_FISHER, 52, 10, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 1, TrainerFisherHenry, -1 - person_event SPRITE_YOUNGSTER, 26, 16, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerYoungsterAlbert, -1 - person_event SPRITE_YOUNGSTER, 67, 8, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerYoungsterGordon, -1 - person_event SPRITE_YOUNGSTER, 49, 7, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerCamperRoland, -1 - person_event SPRITE_LASS, 34, 14, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 1, TrainerPicnickerLiz1, -1 - person_event SPRITE_COOLTRAINER_M, 12, 23, $8, 0, 0, -1, -1, 0, 0, 0, CooltrainerMScript_0x19046f, -1 - person_event SPRITE_YOUNGSTER, 86, 15, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerBird_keeperPeter, -1 - person_event SPRITE_FISHER, 74, 11, $6, 0, 0, -1, -1, 0, 0, 0, FisherScript_0x1904f2, EVENT_SLOWPOKE_WELL_ROCKETS - person_event SPRITE_POKE_BALL, 57, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x190773, EVENT_ROUTE_32_GREAT_BALL - person_event SPRITE_FISHER, 17, 19, $9, 0, 0, -1, -1, 0, 0, 0, FisherScript_0x1904ce, -1 - person_event SPRITE_LASS, 71, 16, $8, 0, 0, -1, -1, 0, 0, 0, FriedaScript, EVENT_ROUTE_32_FRIEDA_OF_FRIDAY - person_event SPRITE_POKE_BALL, 34, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x190775, EVENT_ROUTE_32_REPEL + person_event SPRITE_FISHER, 49, 8, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 1, TrainerFisherJustin, -1 + person_event SPRITE_FISHER, 56, 12, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerFisherRalph1, -1 + person_event SPRITE_FISHER, 48, 6, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 1, TrainerFisherHenry, -1 + person_event SPRITE_YOUNGSTER, 22, 12, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerYoungsterAlbert, -1 + person_event SPRITE_YOUNGSTER, 63, 4, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerYoungsterGordon, -1 + person_event SPRITE_YOUNGSTER, 45, 3, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerCamperRoland, -1 + person_event SPRITE_LASS, 30, 10, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 1, TrainerPicnickerLiz1, -1 + person_event SPRITE_COOLTRAINER_M, 8, 19, $8, 0, 0, -1, -1, 0, 0, 0, CooltrainerMScript_0x19046f, -1 + person_event SPRITE_YOUNGSTER, 82, 11, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerBird_keeperPeter, -1 + person_event SPRITE_FISHER, 70, 7, $6, 0, 0, -1, -1, 0, 0, 0, FisherScript_0x1904f2, EVENT_SLOWPOKE_WELL_ROCKETS + person_event SPRITE_POKE_BALL, 53, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x190773, EVENT_ROUTE_32_GREAT_BALL + person_event SPRITE_FISHER, 13, 15, $9, 0, 0, -1, -1, 0, 0, 0, FisherScript_0x1904ce, -1 + person_event SPRITE_LASS, 67, 12, $8, 0, 0, -1, -1, 0, 0, 0, FriedaScript, EVENT_ROUTE_32_FRIEDA_OF_FRIDAY + person_event SPRITE_POKE_BALL, 30, 3, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x190775, EVENT_ROUTE_32_REPEL diff --git a/maps/Route32PokeCenter1F.asm b/maps/Route32PokeCenter1F.asm index 8eb410047..2ef9c76ef 100644 --- a/maps/Route32PokeCenter1F.asm +++ b/maps/Route32PokeCenter1F.asm @@ -107,6 +107,6 @@ Route32PokeCenter1F_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x69b52, -1 - person_event SPRITE_FISHING_GURU, 8, 5, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FishingGuruScript_0x69b55, -1 - person_event SPRITE_COOLTRAINER_F, 6, 10, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerFScript_0x69b80, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x69b52, -1 + person_event SPRITE_FISHING_GURU, 4, 1, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FishingGuruScript_0x69b55, -1 + person_event SPRITE_COOLTRAINER_F, 2, 6, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerFScript_0x69b80, -1 diff --git a/maps/Route32RuinsofAlphGate.asm b/maps/Route32RuinsofAlphGate.asm index 371489b25..2c485824d 100644 --- a/maps/Route32RuinsofAlphGate.asm +++ b/maps/Route32RuinsofAlphGate.asm @@ -60,6 +60,6 @@ Route32RuinsofAlphGate_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_OFFICER, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, OfficerScript_0x69a2d, -1 - person_event SPRITE_POKEFAN_M, 6, 12, $4, 1, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, PokefanMScript_0x69a30, -1 - person_event SPRITE_YOUNGSTER, 10, 5, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x69a33, -1 + person_event SPRITE_OFFICER, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, OfficerScript_0x69a2d, -1 + person_event SPRITE_POKEFAN_M, 2, 8, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, PokefanMScript_0x69a30, -1 + person_event SPRITE_YOUNGSTER, 6, 1, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x69a33, -1 diff --git a/maps/Route33.asm b/maps/Route33.asm index d5227cc79..e24e1a336 100644 --- a/maps/Route33.asm +++ b/maps/Route33.asm @@ -206,6 +206,6 @@ Route33_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_POKEFAN_M, 17, 10, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerHikerAnthony, -1 - person_event SPRITE_LASS, 20, 17, $2, 1, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, LassScript_0x1ac002, -1 - person_event SPRITE_FRUIT_TREE, 20, 18, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1ac0ea, -1 + person_event SPRITE_POKEFAN_M, 13, 6, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerHikerAnthony, -1 + person_event SPRITE_LASS, 16, 13, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, LassScript_0x1ac002, -1 + person_event SPRITE_FRUIT_TREE, 16, 14, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1ac0ea, -1 diff --git a/maps/Route34.asm b/maps/Route34.asm index c1706109d..7a9bae189 100644 --- a/maps/Route34.asm +++ b/maps/Route34.asm @@ -65,13 +65,13 @@ UnknownScript_0x7805b: DaycareMon1Script_0x78065: loadfont - special Function17421 + special Special_DayCareMon1 loadmovesprites end DaycareMon2Script_0x7806b: loadfont - special Function17440 + special Special_DayCareMon2 loadmovesprites end @@ -775,16 +775,16 @@ Route34_MapEventHeader: .PersonEvents: db 13 - person_event SPRITE_YOUNGSTER, 11, 17, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 5, TrainerCamperTodd1, -1 - person_event SPRITE_YOUNGSTER, 36, 19, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerYoungsterSamuel, -1 - person_event SPRITE_YOUNGSTER, 24, 15, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerYoungsterIan, -1 - person_event SPRITE_LASS, 30, 14, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerPicnickerGina1, -1 - person_event SPRITE_OFFICER, 15, 13, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, OfficerScript_0x7824c, -1 - person_event SPRITE_POKEFAN_M, 32, 22, $1e, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerPokefanmBrandon, -1 - person_event SPRITE_GRAMPS, 20, 19, $6, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x7803d, EVENT_DAYCARE_MAN_ON_ROUTE_34 - person_event SPRITE_DAYCARE_MON_1, 22, 18, $16, 2, 2, -1, -1, 0, 0, 0, DaycareMon1Script_0x78065, EVENT_DAYCARE_MON_1 - person_event SPRITE_DAYCARE_MON_2, 23, 21, $16, 2, 2, -1, -1, 0, 0, 0, DaycareMon2Script_0x7806b, EVENT_DAYCARE_MON_2 - person_event SPRITE_COOLTRAINER_F, 52, 15, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 5, TrainerCooltrainerfIrene, -1 - person_event SPRITE_COOLTRAINER_F, 52, 7, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerCooltrainerfJenn, -1 - person_event SPRITE_COOLTRAINER_F, 55, 10, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 2, TrainerCooltrainerfKate, -1 - person_event SPRITE_POKE_BALL, 34, 11, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7832b, EVENT_ROUTE_34_NUGGET + person_event SPRITE_YOUNGSTER, 7, 13, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 5, TrainerCamperTodd1, -1 + person_event SPRITE_YOUNGSTER, 32, 15, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerYoungsterSamuel, -1 + person_event SPRITE_YOUNGSTER, 20, 11, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerYoungsterIan, -1 + person_event SPRITE_LASS, 26, 10, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerPicnickerGina1, -1 + person_event SPRITE_OFFICER, 11, 9, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, OfficerScript_0x7824c, -1 + person_event SPRITE_POKEFAN_M, 28, 18, $1e, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerPokefanmBrandon, -1 + person_event SPRITE_GRAMPS, 16, 15, $6, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x7803d, EVENT_DAYCARE_MAN_ON_ROUTE_34 + person_event SPRITE_DAYCARE_MON_1, 18, 14, $16, 2, 2, -1, -1, 0, 0, 0, DaycareMon1Script_0x78065, EVENT_DAYCARE_MON_1 + person_event SPRITE_DAYCARE_MON_2, 19, 17, $16, 2, 2, -1, -1, 0, 0, 0, DaycareMon2Script_0x7806b, EVENT_DAYCARE_MON_2 + person_event SPRITE_COOLTRAINER_F, 48, 11, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 5, TrainerCooltrainerfIrene, -1 + person_event SPRITE_COOLTRAINER_F, 48, 3, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerCooltrainerfJenn, -1 + person_event SPRITE_COOLTRAINER_F, 51, 6, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 2, TrainerCooltrainerfKate, -1 + person_event SPRITE_POKE_BALL, 30, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7832b, EVENT_ROUTE_34_NUGGET diff --git a/maps/Route34IlexForestGate.asm b/maps/Route34IlexForestGate.asm index 705f60fdd..6f6cdd782 100644 --- a/maps/Route34IlexForestGate.asm +++ b/maps/Route34IlexForestGate.asm @@ -152,7 +152,7 @@ Route34IlexForestGate_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_TEACHER, 7, 13, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, TeacherScript_0x62d63, EVENT_ROUTE_34_ILEX_FOREST_GATE_TEACHER_BEHIND_COUNTER - person_event SPRITE_BUTTERFREE, 8, 13, $16, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ButterfreeScript_0x62d8a, -1 - person_event SPRITE_LASS, 8, 7, $4, 1, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LassScript_0x62d94, EVENT_ROUTE_34_ILEX_FOREST_GATE_LASS - person_event SPRITE_TEACHER, 11, 9, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, TeacherScript_0x62d63, EVENT_ROUTE_34_ILEX_FOREST_GATE_TEACHER_IN_WALKWAY + person_event SPRITE_TEACHER, 3, 9, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, TeacherScript_0x62d63, EVENT_ROUTE_34_ILEX_FOREST_GATE_TEACHER_BEHIND_COUNTER + person_event SPRITE_BUTTERFREE, 4, 9, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ButterfreeScript_0x62d8a, -1 + person_event SPRITE_LASS, 4, 3, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LassScript_0x62d94, EVENT_ROUTE_34_ILEX_FOREST_GATE_LASS + person_event SPRITE_TEACHER, 7, 5, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, TeacherScript_0x62d63, EVENT_ROUTE_34_ILEX_FOREST_GATE_TEACHER_IN_WALKWAY diff --git a/maps/Route35.asm b/maps/Route35.asm index e057fb1d5..6d2c67777 100644 --- a/maps/Route35.asm +++ b/maps/Route35.asm @@ -469,14 +469,14 @@ Route35_MapEventHeader: .PersonEvents: db 11 - person_event SPRITE_YOUNGSTER, 23, 8, $a, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 2, TrainerCamperIvan, -1 - person_event SPRITE_YOUNGSTER, 24, 12, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerCamperElliot, -1 - person_event SPRITE_LASS, 24, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerPicnickerBrooke, -1 - person_event SPRITE_LASS, 30, 14, $a, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 1, TrainerPicnickerKim, -1 - person_event SPRITE_YOUNGSTER, 32, 18, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 0, TrainerBird_keeperBryan, -1 - person_event SPRITE_FISHER, 14, 6, $1e, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 2, TrainerFirebreatherWalt, -1 - person_event SPRITE_BUG_CATCHER, 11, 20, $6, 0, 2, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerBug_catcherArnie1, -1 - person_event SPRITE_SUPER_NERD, 14, 9, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, TrainerJugglerIrwin, -1 - person_event SPRITE_OFFICER, 10, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, OfficerScript_0x19ca49, -1 - person_event SPRITE_FRUIT_TREE, 29, 6, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x19ca7e, -1 - person_event SPRITE_POKE_BALL, 20, 17, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19ca7c, EVENT_ROUTE_35_TM_ROLLOUT + person_event SPRITE_YOUNGSTER, 19, 4, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 2, TrainerCamperIvan, -1 + person_event SPRITE_YOUNGSTER, 20, 8, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerCamperElliot, -1 + person_event SPRITE_LASS, 20, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerPicnickerBrooke, -1 + person_event SPRITE_LASS, 26, 10, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 1, TrainerPicnickerKim, -1 + person_event SPRITE_YOUNGSTER, 28, 14, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 0, TrainerBird_keeperBryan, -1 + person_event SPRITE_FISHER, 10, 2, $1e, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 2, TrainerFirebreatherWalt, -1 + person_event SPRITE_BUG_CATCHER, 7, 16, $6, 0, 2, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerBug_catcherArnie1, -1 + person_event SPRITE_SUPER_NERD, 10, 5, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 2, TrainerJugglerIrwin, -1 + person_event SPRITE_OFFICER, 6, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, OfficerScript_0x19ca49, -1 + person_event SPRITE_FRUIT_TREE, 25, 2, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x19ca7e, -1 + person_event SPRITE_POKE_BALL, 16, 13, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19ca7c, EVENT_ROUTE_35_TM_ROLLOUT diff --git a/maps/Route35Goldenrodgate.asm b/maps/Route35Goldenrodgate.asm index 4ada657be..5a0c37067 100644 --- a/maps/Route35Goldenrodgate.asm +++ b/maps/Route35Goldenrodgate.asm @@ -209,6 +209,6 @@ Route35Goldenrodgate_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_OFFICER, 8, 4, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, OfficerScript_0x69d37, -1 - person_event SPRITE_POKEFAN_F, 8, 10, $4, 1, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, PokefanFScript_0x69dc6, -1 - person_event SPRITE_FISHER, 6, 7, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FisherScript_0x69dda, -1 + person_event SPRITE_OFFICER, 4, 0, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, OfficerScript_0x69d37, -1 + person_event SPRITE_POKEFAN_F, 4, 6, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, PokefanFScript_0x69dc6, -1 + person_event SPRITE_FISHER, 2, 3, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FisherScript_0x69dda, -1 diff --git a/maps/Route35NationalParkgate.asm b/maps/Route35NationalParkgate.asm index d1540988e..b63151705 100644 --- a/maps/Route35NationalParkgate.asm +++ b/maps/Route35NationalParkgate.asm @@ -458,6 +458,6 @@ Route35NationalParkgate_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_OFFICER, 5, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, OfficerScript_0x6a204, EVENT_ROUTE_35_NATIONAL_PARK_GATE_OFFICER_CONTEST_DAY - person_event SPRITE_YOUNGSTER, 9, 10, $2, 1, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x6a2d8, EVENT_ROUTE_35_NATIONAL_PARK_GATE_YOUNGSTER - person_event SPRITE_OFFICER, 7, 4, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, OfficerScript_0x6a2ca, EVENT_ROUTE_35_NATIONAL_PARK_GATE_OFFICER_NOT_CONTEST_DAY + person_event SPRITE_OFFICER, 1, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, OfficerScript_0x6a204, EVENT_ROUTE_35_NATIONAL_PARK_GATE_OFFICER_CONTEST_DAY + person_event SPRITE_YOUNGSTER, 5, 6, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x6a2d8, EVENT_ROUTE_35_NATIONAL_PARK_GATE_YOUNGSTER + person_event SPRITE_OFFICER, 3, 0, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, OfficerScript_0x6a2ca, EVENT_ROUTE_35_NATIONAL_PARK_GATE_OFFICER_NOT_CONTEST_DAY diff --git a/maps/Route36.asm b/maps/Route36.asm index 2fe5770b0..ee24cb636 100644 --- a/maps/Route36.asm +++ b/maps/Route36.asm @@ -679,12 +679,12 @@ Route36_MapEventHeader: .PersonEvents: db 9 - person_event SPRITE_YOUNGSTER, 17, 24, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerPsychicMark, -1 - person_event SPRITE_YOUNGSTER, 18, 35, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 5, TrainerSchoolboyAlan1, -1 - person_event SPRITE_WEIRD_TREE, 13, 39, $17, 0, 0, -1, -1, 0, 0, 0, WeirdTreeScript_0x19403c, EVENT_ROUTE_36_SUDOWOODO - person_event SPRITE_LASS, 12, 55, $5, 0, 2, -1, -1, 0, 0, 0, LassScript_0x1940e0, -1 - person_event SPRITE_FISHER, 13, 48, $8, 0, 0, -1, -1, 0, 0, 0, FisherScript_0x1940b9, -1 - person_event SPRITE_FRUIT_TREE, 8, 25, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x194247, -1 - person_event SPRITE_YOUNGSTER, 10, 50, $2, 1, 1, -1, -1, 0, 0, 0, ArthurScript, EVENT_ROUTE_36_ARTHUR_OF_THURSDAY - person_event SPRITE_LASS, 16, 37, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, LassScript_0x19408c, EVENT_FLORIA_AT_SUDOWOODO - person_event SPRITE_SUICUNE, 10, 25, $1, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_SAW_SUICUNE_ON_ROUTE_36 + person_event SPRITE_YOUNGSTER, 13, 20, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerPsychicMark, -1 + person_event SPRITE_YOUNGSTER, 14, 31, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 5, TrainerSchoolboyAlan1, -1 + person_event SPRITE_WEIRD_TREE, 9, 35, $17, 0, 0, -1, -1, 0, 0, 0, WeirdTreeScript_0x19403c, EVENT_ROUTE_36_SUDOWOODO + person_event SPRITE_LASS, 8, 51, $5, 0, 2, -1, -1, 0, 0, 0, LassScript_0x1940e0, -1 + person_event SPRITE_FISHER, 9, 44, $8, 0, 0, -1, -1, 0, 0, 0, FisherScript_0x1940b9, -1 + person_event SPRITE_FRUIT_TREE, 4, 21, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x194247, -1 + person_event SPRITE_YOUNGSTER, 6, 46, $2, 1, 1, -1, -1, 0, 0, 0, ArthurScript, EVENT_ROUTE_36_ARTHUR_OF_THURSDAY + person_event SPRITE_LASS, 12, 33, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, LassScript_0x19408c, EVENT_FLORIA_AT_SUDOWOODO + person_event SPRITE_SUICUNE, 6, 21, $1, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_SAW_SUICUNE_ON_ROUTE_36 diff --git a/maps/Route36NationalParkgate.asm b/maps/Route36NationalParkgate.asm index 75c240feb..a157e006c 100644 --- a/maps/Route36NationalParkgate.asm +++ b/maps/Route36NationalParkgate.asm @@ -862,15 +862,15 @@ Route36NationalParkgate_MapEventHeader: .PersonEvents: db 12 - person_event SPRITE_OFFICER, 7, 4, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, Route36OfficerScriptContest, EVENT_ROUTE_36_NATIONAL_PARK_GATE_OFFICER_CONTEST_DAY - person_event SPRITE_YOUNGSTER, 9, 6, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x6ad06, EVENT_BUG_CATCHING_CONTESTANT_1B - person_event SPRITE_YOUNGSTER, 9, 8, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x6ad1a, EVENT_BUG_CATCHING_CONTESTANT_2B - person_event SPRITE_ROCKER, 10, 6, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, RockerScript_0x6ad2e, EVENT_BUG_CATCHING_CONTESTANT_3B - person_event SPRITE_POKEFAN_M, 9, 10, $7, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, PokefanMScript_0x6ad42, EVENT_BUG_CATCHING_CONTESTANT_4B - person_event SPRITE_YOUNGSTER, 11, 6, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x6ad56, EVENT_BUG_CATCHING_CONTESTANT_5B - person_event SPRITE_YOUNGSTER, 10, 9, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x6ad6a, EVENT_BUG_CATCHING_CONTESTANT_6B - person_event SPRITE_LASS, 10, 7, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, LassScript_0x6ad7e, EVENT_BUG_CATCHING_CONTESTANT_7B - person_event SPRITE_YOUNGSTER, 11, 8, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x6ad92, EVENT_BUG_CATCHING_CONTESTANT_8B - person_event SPRITE_YOUNGSTER, 11, 10, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x6ada6, EVENT_BUG_CATCHING_CONTESTANT_9B - person_event SPRITE_YOUNGSTER, 10, 10, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, YoungsterScript_0x6adba, EVENT_BUG_CATCHING_CONTESTANT_10B - person_event SPRITE_OFFICER, 6, 7, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, OfficerScript_0x6acf4, EVENT_ROUTE_36_NATIONAL_PARK_GATE_OFFICER_NOT_CONTEST_DAY + person_event SPRITE_OFFICER, 3, 0, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, Route36OfficerScriptContest, EVENT_ROUTE_36_NATIONAL_PARK_GATE_OFFICER_CONTEST_DAY + person_event SPRITE_YOUNGSTER, 5, 2, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x6ad06, EVENT_BUG_CATCHING_CONTESTANT_1B + person_event SPRITE_YOUNGSTER, 5, 4, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x6ad1a, EVENT_BUG_CATCHING_CONTESTANT_2B + person_event SPRITE_ROCKER, 6, 2, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, RockerScript_0x6ad2e, EVENT_BUG_CATCHING_CONTESTANT_3B + person_event SPRITE_POKEFAN_M, 5, 6, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, PokefanMScript_0x6ad42, EVENT_BUG_CATCHING_CONTESTANT_4B + person_event SPRITE_YOUNGSTER, 7, 2, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x6ad56, EVENT_BUG_CATCHING_CONTESTANT_5B + person_event SPRITE_YOUNGSTER, 6, 5, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x6ad6a, EVENT_BUG_CATCHING_CONTESTANT_6B + person_event SPRITE_LASS, 6, 3, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, LassScript_0x6ad7e, EVENT_BUG_CATCHING_CONTESTANT_7B + person_event SPRITE_YOUNGSTER, 7, 4, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x6ad92, EVENT_BUG_CATCHING_CONTESTANT_8B + person_event SPRITE_YOUNGSTER, 7, 6, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x6ada6, EVENT_BUG_CATCHING_CONTESTANT_9B + person_event SPRITE_YOUNGSTER, 6, 6, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, YoungsterScript_0x6adba, EVENT_BUG_CATCHING_CONTESTANT_10B + person_event SPRITE_OFFICER, 2, 3, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, OfficerScript_0x6acf4, EVENT_ROUTE_36_NATIONAL_PARK_GATE_OFFICER_NOT_CONTEST_DAY diff --git a/maps/Route36RuinsofAlphgate.asm b/maps/Route36RuinsofAlphgate.asm index 3b9e461ca..7d6dbbd43 100644 --- a/maps/Route36RuinsofAlphgate.asm +++ b/maps/Route36RuinsofAlphgate.asm @@ -49,5 +49,5 @@ Route36RuinsofAlphgate_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_OFFICER, 8, 4, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, OfficerScript_0x6aa1a, -1 - person_event SPRITE_GRAMPS, 9, 11, $2, 2, 1, -1, -1, 8 + PAL_OW_BROWN, 0, 0, GrampsScript_0x6aa1d, -1 + person_event SPRITE_OFFICER, 4, 0, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, OfficerScript_0x6aa1a, -1 + person_event SPRITE_GRAMPS, 5, 7, $2, 2, 1, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, GrampsScript_0x6aa1d, -1 diff --git a/maps/Route37.asm b/maps/Route37.asm index 3cbbe3692..a6e49b306 100644 --- a/maps/Route37.asm +++ b/maps/Route37.asm @@ -249,10 +249,10 @@ Route37_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_WEIRD_TREE, 16, 10, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerTwinsAnnandanne1, -1 - person_event SPRITE_WEIRD_TREE, 16, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerTwinsAnnandanne2, -1 - person_event SPRITE_YOUNGSTER, 10, 10, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerPsychicGreg, -1 - person_event SPRITE_FRUIT_TREE, 9, 17, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a8e09, -1 - person_event SPRITE_BUG_CATCHER, 12, 20, $2, 1, 1, -1, -1, 0, 0, 0, SunnyScript, EVENT_ROUTE_37_SUNNY_OF_SUNDAY - person_event SPRITE_FRUIT_TREE, 9, 20, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a8e0b, -1 - person_event SPRITE_FRUIT_TREE, 11, 19, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a8e0d, -1 + person_event SPRITE_WEIRD_TREE, 12, 6, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerTwinsAnnandanne1, -1 + person_event SPRITE_WEIRD_TREE, 12, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerTwinsAnnandanne2, -1 + person_event SPRITE_YOUNGSTER, 6, 6, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerPsychicGreg, -1 + person_event SPRITE_FRUIT_TREE, 5, 13, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a8e09, -1 + person_event SPRITE_BUG_CATCHER, 8, 16, $2, 1, 1, -1, -1, 0, 0, 0, SunnyScript, EVENT_ROUTE_37_SUNNY_OF_SUNDAY + person_event SPRITE_FRUIT_TREE, 5, 16, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a8e0b, -1 + person_event SPRITE_FRUIT_TREE, 7, 15, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a8e0d, -1 diff --git a/maps/Route38.asm b/maps/Route38.asm index ad7e2d534..4c6ffa6e7 100644 --- a/maps/Route38.asm +++ b/maps/Route38.asm @@ -482,10 +482,10 @@ Route38_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_STANDING_YOUNGSTER, 5, 8, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerSchoolboyChad1, -1 - person_event SPRITE_LASS, 7, 19, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, TrainerLassDana1, -1 - person_event SPRITE_STANDING_YOUNGSTER, 19, 16, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerBird_keeperToby, -1 - person_event SPRITE_BUENA, 13, 23, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerBeautyValerie, -1 - person_event SPRITE_SAILOR, 9, 28, $1e, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, TrainerSailorHarry, -1 - person_event SPRITE_FRUIT_TREE, 14, 16, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a1f33, -1 - person_event SPRITE_BUENA, 12, 9, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerBeautyOlivia, -1 + person_event SPRITE_STANDING_YOUNGSTER, 1, 4, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerSchoolboyChad1, -1 + person_event SPRITE_LASS, 3, 15, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 2, TrainerLassDana1, -1 + person_event SPRITE_STANDING_YOUNGSTER, 15, 12, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerBird_keeperToby, -1 + person_event SPRITE_BUENA, 9, 19, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerBeautyValerie, -1 + person_event SPRITE_SAILOR, 5, 24, $1e, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 2, TrainerSailorHarry, -1 + person_event SPRITE_FRUIT_TREE, 10, 12, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a1f33, -1 + person_event SPRITE_BUENA, 8, 5, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerBeautyOlivia, -1 diff --git a/maps/Route38EcruteakGate.asm b/maps/Route38EcruteakGate.asm index 3d2112af1..1be28e252 100644 --- a/maps/Route38EcruteakGate.asm +++ b/maps/Route38EcruteakGate.asm @@ -40,4 +40,4 @@ Route38EcruteakGate_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_OFFICER, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, OfficerScript_0x9cbd7, -1 + person_event SPRITE_OFFICER, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, OfficerScript_0x9cbd7, -1 diff --git a/maps/Route39.asm b/maps/Route39.asm index 85898d7a5..2afc322bc 100644 --- a/maps/Route39.asm +++ b/maps/Route39.asm @@ -353,13 +353,13 @@ Route39_MapEventHeader: .PersonEvents: db 10 - person_event SPRITE_SAILOR, 33, 17, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 5, TrainerSailorEugene, -1 - person_event SPRITE_POKEFAN_M, 26, 14, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 4, TrainerPokefanmDerek1, -1 - person_event SPRITE_POKEFAN_F, 23, 15, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 4, TrainerPokefanfRuth, -1 - person_event SPRITE_TAUROS, 16, 7, $16, 0, 0, -1, -1, 0, 0, 0, TaurosScript_0x1a5af5, -1 - person_event SPRITE_TAUROS, 15, 10, $16, 0, 0, -1, -1, 0, 0, 0, TaurosScript_0x1a5af5, -1 - person_event SPRITE_TAUROS, 19, 8, $16, 0, 0, -1, -1, 0, 0, 0, TaurosScript_0x1a5af5, -1 - person_event SPRITE_TAUROS, 17, 12, $16, 0, 0, -1, -1, 0, 0, 0, TaurosScript_0x1a5af5, -1 - person_event SPRITE_STANDING_YOUNGSTER, 11, 17, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 1, TrainerPsychicNorman, -1 - person_event SPRITE_FRUIT_TREE, 7, 13, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a5bf4, -1 - person_event SPRITE_POKEFAN_F, 26, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, PokefanFScript_0x1a5bbe, -1 + person_event SPRITE_SAILOR, 29, 13, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 5, TrainerSailorEugene, -1 + person_event SPRITE_POKEFAN_M, 22, 10, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 4, TrainerPokefanmDerek1, -1 + person_event SPRITE_POKEFAN_F, 19, 11, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 4, TrainerPokefanfRuth, -1 + person_event SPRITE_TAUROS, 12, 3, $16, 0, 0, -1, -1, 0, 0, 0, TaurosScript_0x1a5af5, -1 + person_event SPRITE_TAUROS, 11, 6, $16, 0, 0, -1, -1, 0, 0, 0, TaurosScript_0x1a5af5, -1 + person_event SPRITE_TAUROS, 15, 4, $16, 0, 0, -1, -1, 0, 0, 0, TaurosScript_0x1a5af5, -1 + person_event SPRITE_TAUROS, 13, 8, $16, 0, 0, -1, -1, 0, 0, 0, TaurosScript_0x1a5af5, -1 + person_event SPRITE_STANDING_YOUNGSTER, 7, 13, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 1, TrainerPsychicNorman, -1 + person_event SPRITE_FRUIT_TREE, 3, 9, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a5bf4, -1 + person_event SPRITE_POKEFAN_F, 22, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PokefanFScript_0x1a5bbe, -1 diff --git a/maps/Route39Barn.asm b/maps/Route39Barn.asm index 24f41b8a9..e2420e180 100644 --- a/maps/Route39Barn.asm +++ b/maps/Route39Barn.asm @@ -200,6 +200,6 @@ Route39Barn_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_TWIN, 7, 6, $9, 0, 0, -1, -1, 0, 0, 0, TwinScript_0x9cc76, -1 - person_event SPRITE_TWIN, 7, 8, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TwinScript_0x9cc90, -1 - person_event SPRITE_TAUROS, 7, 7, $16, 0, 0, -1, -1, 0, 0, 0, TaurosScript_0x9ccaa, -1 + person_event SPRITE_TWIN, 3, 2, $9, 0, 0, -1, -1, 0, 0, 0, TwinScript_0x9cc76, -1 + person_event SPRITE_TWIN, 3, 4, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TwinScript_0x9cc90, -1 + person_event SPRITE_TAUROS, 3, 3, $16, 0, 0, -1, -1, 0, 0, 0, TaurosScript_0x9ccaa, -1 diff --git a/maps/Route39Farmhouse.asm b/maps/Route39Farmhouse.asm index a588fe8d7..16ad6cadc 100644 --- a/maps/Route39Farmhouse.asm +++ b/maps/Route39Farmhouse.asm @@ -207,5 +207,5 @@ Route39Farmhouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_POKEFAN_M, 6, 7, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, PokefanMScript_0x9ceb4, -1 - person_event SPRITE_POKEFAN_F, 8, 9, $8, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, PokefanFScript_0x9cf0e, -1 + person_event SPRITE_POKEFAN_M, 2, 3, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, PokefanMScript_0x9ceb4, -1 + person_event SPRITE_POKEFAN_F, 4, 5, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, PokefanFScript_0x9cf0e, -1 diff --git a/maps/Route4.asm b/maps/Route4.asm index 25d3163c0..d0d870489 100644 --- a/maps/Route4.asm +++ b/maps/Route4.asm @@ -133,7 +133,7 @@ Route4_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_YOUNGSTER, 13, 21, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerBird_keeperHank, -1 - person_event SPRITE_LASS, 12, 13, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 4, TrainerPicnickerHope, -1 - person_event SPRITE_LASS, 10, 25, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 4, TrainerPicnickerSharon, -1 - person_event SPRITE_POKE_BALL, 7, 30, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1ae20f, EVENT_ROUTE_4_HP_UP + person_event SPRITE_YOUNGSTER, 9, 17, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerBird_keeperHank, -1 + person_event SPRITE_LASS, 8, 9, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 4, TrainerPicnickerHope, -1 + person_event SPRITE_LASS, 6, 21, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 4, TrainerPicnickerSharon, -1 + person_event SPRITE_POKE_BALL, 3, 26, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1ae20f, EVENT_ROUTE_4_HP_UP diff --git a/maps/Route40.asm b/maps/Route40.asm index 1104fb224..09f92f176 100644 --- a/maps/Route40.asm +++ b/maps/Route40.asm @@ -344,15 +344,15 @@ Route40_MapEventHeader: .PersonEvents: db 12 - person_event SPRITE_OLIVINE_RIVAL, 19, 18, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 4, TrainerSwimmermSimon, -1 - person_event SPRITE_OLIVINE_RIVAL, 34, 22, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 5, TrainerSwimmermRandall, -1 - person_event SPRITE_SWIMMER_GIRL, 23, 7, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 4, TrainerSwimmerfElaine, -1 - person_event SPRITE_SWIMMER_GIRL, 29, 14, $1f, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerSwimmerfPaula, -1 - person_event SPRITE_ROCK, 15, 11, $18, 0, 0, -1, -1, 0, 0, 0, Route40Rock, -1 - person_event SPRITE_ROCK, 13, 10, $18, 0, 0, -1, -1, 0, 0, 0, Route40Rock, -1 - person_event SPRITE_ROCK, 12, 11, $18, 0, 0, -1, -1, 0, 0, 0, Route40Rock, -1 - person_event SPRITE_LASS, 17, 15, $6, 0, 0, -1, -1, 0, 0, 0, LassScript_0x1a61c4, -1 - person_event SPRITE_BUENA, 14, 12, $3, 0, 0, -1, -1, 0, 0, 0, MonicaScript, EVENT_ROUTE_40_MONICA_OF_MONDAY - person_event SPRITE_POKEFAN_M, 10, 11, $9, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x1a61c7, -1 - person_event SPRITE_LASS, 8, 17, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LassScript_0x1a61d3, -1 - person_event SPRITE_STANDING_YOUNGSTER, 13, 20, $3, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, StandingYoungsterScript_0x1a61d6, EVENT_BATTLE_TOWER_OUTSIDE_SAILOR + person_event SPRITE_OLIVINE_RIVAL, 15, 14, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 4, TrainerSwimmermSimon, -1 + person_event SPRITE_OLIVINE_RIVAL, 30, 18, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 5, TrainerSwimmermRandall, -1 + person_event SPRITE_SWIMMER_GIRL, 19, 3, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 4, TrainerSwimmerfElaine, -1 + person_event SPRITE_SWIMMER_GIRL, 25, 10, $1f, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerSwimmerfPaula, -1 + person_event SPRITE_ROCK, 11, 7, $18, 0, 0, -1, -1, 0, 0, 0, Route40Rock, -1 + person_event SPRITE_ROCK, 9, 6, $18, 0, 0, -1, -1, 0, 0, 0, Route40Rock, -1 + person_event SPRITE_ROCK, 8, 7, $18, 0, 0, -1, -1, 0, 0, 0, Route40Rock, -1 + person_event SPRITE_LASS, 13, 11, $6, 0, 0, -1, -1, 0, 0, 0, LassScript_0x1a61c4, -1 + person_event SPRITE_BUENA, 10, 8, $3, 0, 0, -1, -1, 0, 0, 0, MonicaScript, EVENT_ROUTE_40_MONICA_OF_MONDAY + person_event SPRITE_POKEFAN_M, 6, 7, $9, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x1a61c7, -1 + person_event SPRITE_LASS, 4, 13, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LassScript_0x1a61d3, -1 + person_event SPRITE_STANDING_YOUNGSTER, 9, 16, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, StandingYoungsterScript_0x1a61d6, EVENT_BATTLE_TOWER_OUTSIDE_SAILOR diff --git a/maps/Route40BattleTowerGate.asm b/maps/Route40BattleTowerGate.asm index c1db94157..f99b6526d 100644 --- a/maps/Route40BattleTowerGate.asm +++ b/maps/Route40BattleTowerGate.asm @@ -88,5 +88,5 @@ Route40BattleTowerGate_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_ROCKER, 7, 7, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, RockerScript_0x9f669, EVENT_BATTLE_TOWER_OUTSIDE_SAILOR - person_event SPRITE_TWIN, 9, 11, $4, 1, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, TwinScript_0x9f66c, -1 + person_event SPRITE_ROCKER, 3, 3, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, RockerScript_0x9f669, EVENT_BATTLE_TOWER_OUTSIDE_SAILOR + person_event SPRITE_TWIN, 5, 7, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, TwinScript_0x9f66c, -1 diff --git a/maps/Route41.asm b/maps/Route41.asm index f9fa92ebb..872fb5306 100644 --- a/maps/Route41.asm +++ b/maps/Route41.asm @@ -349,13 +349,13 @@ Route41_MapEventHeader: .PersonEvents: db 10 - person_event SPRITE_OLIVINE_RIVAL, 10, 36, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerSwimmermCharlie, -1 - person_event SPRITE_OLIVINE_RIVAL, 12, 50, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerSwimmermGeorge, -1 - person_event SPRITE_OLIVINE_RIVAL, 30, 24, $1e, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerSwimmermBerke, -1 - person_event SPRITE_OLIVINE_RIVAL, 34, 36, $1f, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerSwimmermKirk, -1 - person_event SPRITE_OLIVINE_RIVAL, 50, 23, $1e, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerSwimmermMathew, -1 - person_event SPRITE_SWIMMER_GIRL, 8, 21, $a, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerSwimmerfKaylee, -1 - person_event SPRITE_SWIMMER_GIRL, 23, 27, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerSwimmerfSusie, -1 - person_event SPRITE_SWIMMER_GIRL, 38, 31, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerSwimmerfDenise, -1 - person_event SPRITE_SWIMMER_GIRL, 32, 48, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 4, TrainerSwimmerfKara, -1 - person_event SPRITE_SWIMMER_GIRL, 54, 13, $a, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 2, TrainerSwimmerfWendy, -1 + person_event SPRITE_OLIVINE_RIVAL, 6, 32, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerSwimmermCharlie, -1 + person_event SPRITE_OLIVINE_RIVAL, 8, 46, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerSwimmermGeorge, -1 + person_event SPRITE_OLIVINE_RIVAL, 26, 20, $1e, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerSwimmermBerke, -1 + person_event SPRITE_OLIVINE_RIVAL, 30, 32, $1f, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerSwimmermKirk, -1 + person_event SPRITE_OLIVINE_RIVAL, 46, 19, $1e, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerSwimmermMathew, -1 + person_event SPRITE_SWIMMER_GIRL, 4, 17, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerSwimmerfKaylee, -1 + person_event SPRITE_SWIMMER_GIRL, 19, 23, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerSwimmerfSusie, -1 + person_event SPRITE_SWIMMER_GIRL, 34, 27, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerSwimmerfDenise, -1 + person_event SPRITE_SWIMMER_GIRL, 28, 44, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 4, TrainerSwimmerfKara, -1 + person_event SPRITE_SWIMMER_GIRL, 50, 9, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 2, TrainerSwimmerfWendy, -1 diff --git a/maps/Route42.asm b/maps/Route42.asm index 3861c0d90..04a508894 100644 --- a/maps/Route42.asm +++ b/maps/Route42.asm @@ -336,12 +336,12 @@ Route42_MapEventHeader: .PersonEvents: db 9 - person_event SPRITE_FISHER, 14, 44, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 1, TrainerFisherTully1, -1 - person_event SPRITE_POKEFAN_M, 13, 55, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerHikerBenjamin, -1 - person_event SPRITE_SUPER_NERD, 12, 51, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerPokemaniacShane, -1 - person_event SPRITE_FRUIT_TREE, 20, 31, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a934d, -1 - person_event SPRITE_FRUIT_TREE, 20, 32, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a934f, -1 - person_event SPRITE_FRUIT_TREE, 20, 33, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a9351, -1 - person_event SPRITE_POKE_BALL, 8, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a9349, EVENT_ROUTE_42_ULTRA_BALL - person_event SPRITE_POKE_BALL, 12, 37, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a934b, EVENT_ROUTE_42_SUPER_POTION - person_event SPRITE_SUICUNE, 20, 30, $1, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_SAW_SUICUNE_ON_ROUTE_42 + person_event SPRITE_FISHER, 10, 40, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 1, TrainerFisherTully1, -1 + person_event SPRITE_POKEFAN_M, 9, 51, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerHikerBenjamin, -1 + person_event SPRITE_SUPER_NERD, 8, 47, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerPokemaniacShane, -1 + person_event SPRITE_FRUIT_TREE, 16, 27, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a934d, -1 + person_event SPRITE_FRUIT_TREE, 16, 28, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a934f, -1 + person_event SPRITE_FRUIT_TREE, 16, 29, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a9351, -1 + person_event SPRITE_POKE_BALL, 4, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a9349, EVENT_ROUTE_42_ULTRA_BALL + person_event SPRITE_POKE_BALL, 8, 33, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a934b, EVENT_ROUTE_42_SUPER_POTION + person_event SPRITE_SUICUNE, 16, 26, $1, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_SAW_SUICUNE_ON_ROUTE_42 diff --git a/maps/Route42EcruteakGate.asm b/maps/Route42EcruteakGate.asm index de0189be6..e23810dd0 100644 --- a/maps/Route42EcruteakGate.asm +++ b/maps/Route42EcruteakGate.asm @@ -35,4 +35,4 @@ Route42EcruteakGate_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_OFFICER, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, OfficerScript_0x19a4b5, -1 + person_event SPRITE_OFFICER, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, OfficerScript_0x19a4b5, -1 diff --git a/maps/Route43.asm b/maps/Route43.asm index 128ccc54e..a4fb28fe6 100644 --- a/maps/Route43.asm +++ b/maps/Route43.asm @@ -516,11 +516,11 @@ Route43_MapEventHeader: .PersonEvents: db 8 - person_event SPRITE_SUPER_NERD, 9, 17, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, TrainerPokemaniacBen, -1 - person_event SPRITE_SUPER_NERD, 24, 17, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerPokemaniacBrent1, -1 - person_event SPRITE_SUPER_NERD, 11, 18, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, TrainerPokemaniacRon, -1 - person_event SPRITE_FISHER, 20, 8, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 4, TrainerFisherMarvin, -1 - person_event SPRITE_LASS, 29, 13, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 2, TrainerPicnickerTiffany3, -1 - person_event SPRITE_YOUNGSTER, 44, 17, $a, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerCamperSpencer, -1 - person_event SPRITE_FRUIT_TREE, 30, 5, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x19d266, -1 - person_event SPRITE_POKE_BALL, 36, 16, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19d268, EVENT_ROUTE_43_MAX_ETHER + person_event SPRITE_SUPER_NERD, 5, 13, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 2, TrainerPokemaniacBen, -1 + person_event SPRITE_SUPER_NERD, 20, 13, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerPokemaniacBrent1, -1 + person_event SPRITE_SUPER_NERD, 7, 14, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 2, TrainerPokemaniacRon, -1 + person_event SPRITE_FISHER, 16, 4, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 4, TrainerFisherMarvin, -1 + person_event SPRITE_LASS, 25, 9, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 2, TrainerPicnickerTiffany3, -1 + person_event SPRITE_YOUNGSTER, 40, 13, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerCamperSpencer, -1 + person_event SPRITE_FRUIT_TREE, 26, 1, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x19d266, -1 + person_event SPRITE_POKE_BALL, 32, 12, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19d268, EVENT_ROUTE_43_MAX_ETHER diff --git a/maps/Route43Gate.asm b/maps/Route43Gate.asm index ec3b0ca8c..4fe15bebf 100644 --- a/maps/Route43Gate.asm +++ b/maps/Route43Gate.asm @@ -264,6 +264,6 @@ Route43Gate_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_OFFICER, 8, 4, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, OfficerScript_0x19ac85, EVENT_LAKE_OF_RAGE_CIVILIANS - person_event SPRITE_ROCKET, 8, 6, $6, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x19ac82, EVENT_ROUTE_43_GATE_ROCKETS - person_event SPRITE_ROCKET, 8, 11, $7, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x19ac82, EVENT_ROUTE_43_GATE_ROCKETS + person_event SPRITE_OFFICER, 4, 0, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, OfficerScript_0x19ac85, EVENT_LAKE_OF_RAGE_CIVILIANS + person_event SPRITE_ROCKET, 4, 2, $6, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x19ac82, EVENT_ROUTE_43_GATE_ROCKETS + person_event SPRITE_ROCKET, 4, 7, $7, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x19ac82, EVENT_ROUTE_43_GATE_ROCKETS diff --git a/maps/Route43MahoganyGate.asm b/maps/Route43MahoganyGate.asm index d23b0dc12..588fa9252 100644 --- a/maps/Route43MahoganyGate.asm +++ b/maps/Route43MahoganyGate.asm @@ -54,4 +54,4 @@ Route43MahoganyGate_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_OFFICER, 8, 4, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, OfficerScript_0x19ab0b, -1 + person_event SPRITE_OFFICER, 4, 0, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, OfficerScript_0x19ab0b, -1 diff --git a/maps/Route44.asm b/maps/Route44.asm index ca12ecad6..b2a08a725 100644 --- a/maps/Route44.asm +++ b/maps/Route44.asm @@ -513,14 +513,14 @@ Route44_MapEventHeader: .PersonEvents: db 11 - person_event SPRITE_FISHER, 7, 39, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 1, TrainerFisherWilton1, -1 - person_event SPRITE_FISHER, 17, 23, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 1, TrainerFisherEdgar, -1 - person_event SPRITE_YOUNGSTER, 13, 14, $1f, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerPsychicPhil, -1 - person_event SPRITE_SUPER_NERD, 6, 47, $1f, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerPokemaniacZach, -1 - person_event SPRITE_YOUNGSTER, 9, 55, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 2, TrainerBird_keeperVance1, -1 - person_event SPRITE_COOLTRAINER_M, 19, 45, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 5, TrainerCooltrainermAllen, -1 - person_event SPRITE_COOLTRAINER_F, 18, 35, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 5, TrainerCooltrainerfCybil, -1 - person_event SPRITE_FRUIT_TREE, 9, 13, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x19da40, -1 - person_event SPRITE_POKE_BALL, 12, 34, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19da42, EVENT_ROUTE_44_MAX_REVIVE - person_event SPRITE_POKE_BALL, 8, 49, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19da44, EVENT_ROUTE_44_ULTRA_BALL - person_event SPRITE_POKE_BALL, 13, 18, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19da46, EVENT_ROUTE_44_MAX_REPEL + person_event SPRITE_FISHER, 3, 35, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 1, TrainerFisherWilton1, -1 + person_event SPRITE_FISHER, 13, 19, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 1, TrainerFisherEdgar, -1 + person_event SPRITE_YOUNGSTER, 9, 10, $1f, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerPsychicPhil, -1 + person_event SPRITE_SUPER_NERD, 2, 43, $1f, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerPokemaniacZach, -1 + person_event SPRITE_YOUNGSTER, 5, 51, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 2, TrainerBird_keeperVance1, -1 + person_event SPRITE_COOLTRAINER_M, 15, 41, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 5, TrainerCooltrainermAllen, -1 + person_event SPRITE_COOLTRAINER_F, 14, 31, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 5, TrainerCooltrainerfCybil, -1 + person_event SPRITE_FRUIT_TREE, 5, 9, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x19da40, -1 + person_event SPRITE_POKE_BALL, 8, 30, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19da42, EVENT_ROUTE_44_MAX_REVIVE + person_event SPRITE_POKE_BALL, 4, 45, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19da44, EVENT_ROUTE_44_ULTRA_BALL + person_event SPRITE_POKE_BALL, 9, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19da46, EVENT_ROUTE_44_MAX_REPEL diff --git a/maps/Route45.asm b/maps/Route45.asm index 4b4796a17..19f43124d 100644 --- a/maps/Route45.asm +++ b/maps/Route45.asm @@ -16,7 +16,7 @@ BlackbeltKenji3Script: iftrue UnknownScript_0x19e0e4 checkevent EVENT_KENJI_ASKED_FOR_PHONE_NUMBER iftrue UnknownScript_0x19e0cd - special Function11485 + special Special_SampleKenjiBreakCountdown writetext UnknownText_0x19e5e2 closetext setevent EVENT_KENJI_ASKED_FOR_PHONE_NUMBER @@ -46,7 +46,7 @@ UnknownScript_0x19e0e4: verbosegiveitem PP_UP, 1 iffalse UnknownScript_0x19e118 clearevent EVENT_KENJI_ON_BREAK - special Function11485 + special Special_SampleKenjiBreakCountdown jump UnknownScript_0x19e127 UnknownScript_0x19e10c: @@ -535,16 +535,16 @@ Route45_MapEventHeader: .PersonEvents: db 13 - person_event SPRITE_POKEFAN_M, 20, 14, $9, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 1, TrainerHikerErik, -1 - person_event SPRITE_POKEFAN_M, 69, 19, $9, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerHikerMichael, -1 - person_event SPRITE_POKEFAN_M, 32, 9, $7, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerHikerParry, -1 - person_event SPRITE_POKEFAN_M, 69, 13, $8, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 1, TrainerHikerTimothy, -1 - person_event SPRITE_BLACK_BELT, 54, 15, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerBlackbeltKenji, -1 - person_event SPRITE_COOLTRAINER_M, 22, 21, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerCooltrainermRyan, -1 - person_event SPRITE_COOLTRAINER_F, 40, 9, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerCooltrainerfKelly, -1 - person_event SPRITE_FRUIT_TREE, 86, 20, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x19e294, -1 - person_event SPRITE_POKE_BALL, 55, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19e296, EVENT_ROUTE_45_NUGGET - person_event SPRITE_POKE_BALL, 70, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19e298, EVENT_ROUTE_45_REVIVE - person_event SPRITE_POKE_BALL, 24, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19e29a, EVENT_ROUTE_45_ELIXER - person_event SPRITE_POKE_BALL, 37, 11, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19e29c, EVENT_ROUTE_45_MAX_POTION - person_event SPRITE_YOUNGSTER, 74, 8, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x19e269, -1 + person_event SPRITE_POKEFAN_M, 16, 10, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 1, TrainerHikerErik, -1 + person_event SPRITE_POKEFAN_M, 65, 15, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerHikerMichael, -1 + person_event SPRITE_POKEFAN_M, 28, 5, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerHikerParry, -1 + person_event SPRITE_POKEFAN_M, 65, 9, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 1, TrainerHikerTimothy, -1 + person_event SPRITE_BLACK_BELT, 50, 11, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerBlackbeltKenji, -1 + person_event SPRITE_COOLTRAINER_M, 18, 17, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerCooltrainermRyan, -1 + person_event SPRITE_COOLTRAINER_F, 36, 5, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerCooltrainerfKelly, -1 + person_event SPRITE_FRUIT_TREE, 82, 16, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x19e294, -1 + person_event SPRITE_POKE_BALL, 51, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19e296, EVENT_ROUTE_45_NUGGET + person_event SPRITE_POKE_BALL, 66, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19e298, EVENT_ROUTE_45_REVIVE + person_event SPRITE_POKE_BALL, 20, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19e29a, EVENT_ROUTE_45_ELIXER + person_event SPRITE_POKE_BALL, 33, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x19e29c, EVENT_ROUTE_45_MAX_POTION + person_event SPRITE_YOUNGSTER, 70, 4, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x19e269, -1 diff --git a/maps/Route46.asm b/maps/Route46.asm index ef5aa6280..bda4cc96c 100644 --- a/maps/Route46.asm +++ b/maps/Route46.asm @@ -261,9 +261,9 @@ Route46_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_POKEFAN_M, 23, 16, $8, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerHikerBailey, -1 - person_event SPRITE_YOUNGSTER, 18, 8, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 2, TrainerCamperTed, -1 - person_event SPRITE_LASS, 17, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 2, TrainerPicnickerErin1, -1 - person_event SPRITE_FRUIT_TREE, 9, 11, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a978f, -1 - person_event SPRITE_FRUIT_TREE, 10, 12, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a9791, -1 - person_event SPRITE_POKE_BALL, 19, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a978d, EVENT_ROUTE_46_X_SPEED + person_event SPRITE_POKEFAN_M, 19, 12, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerHikerBailey, -1 + person_event SPRITE_YOUNGSTER, 14, 4, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 2, TrainerCamperTed, -1 + person_event SPRITE_LASS, 13, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 2, TrainerPicnickerErin1, -1 + person_event SPRITE_FRUIT_TREE, 5, 7, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a978f, -1 + person_event SPRITE_FRUIT_TREE, 6, 8, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a9791, -1 + person_event SPRITE_POKE_BALL, 15, 1, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a978d, EVENT_ROUTE_46_X_SPEED diff --git a/maps/Route5.asm b/maps/Route5.asm index bf46f0b04..2335dd37a 100644 --- a/maps/Route5.asm +++ b/maps/Route5.asm @@ -57,4 +57,4 @@ Route5_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKEFAN_M, 20, 21, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, PokefanMScript_0x1adb19, EVENT_ROUTE_5_6_POKEFAN_M_BLOCKS_UNDERGROUND_PATH + person_event SPRITE_POKEFAN_M, 16, 17, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PokefanMScript_0x1adb19, EVENT_ROUTE_5_6_POKEFAN_M_BLOCKS_UNDERGROUND_PATH diff --git a/maps/Route5CleanseTagSpeechHouse.asm b/maps/Route5CleanseTagSpeechHouse.asm index 83d61491d..200e4eccc 100644 --- a/maps/Route5CleanseTagSpeechHouse.asm +++ b/maps/Route5CleanseTagSpeechHouse.asm @@ -75,5 +75,5 @@ Route5CleanseTagSpeechHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_GRANNY, 9, 6, $1f, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, GrannyScript_0x18b634, -1 - person_event SPRITE_TEACHER, 7, 9, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, TeacherScript_0x18b64f, -1 + person_event SPRITE_GRANNY, 5, 2, $1f, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, GrannyScript_0x18b634, -1 + person_event SPRITE_TEACHER, 3, 5, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, TeacherScript_0x18b64f, -1 diff --git a/maps/Route5SaffronCityGate.asm b/maps/Route5SaffronCityGate.asm index 41b33bd39..ee40d6d48 100644 --- a/maps/Route5SaffronCityGate.asm +++ b/maps/Route5SaffronCityGate.asm @@ -36,4 +36,4 @@ Route5SaffronCityGate_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_OFFICER, 8, 4, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, OfficerScript_0x18b5b9, -1 + person_event SPRITE_OFFICER, 4, 0, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, OfficerScript_0x18b5b9, -1 diff --git a/maps/Route5UndergroundEntrance.asm b/maps/Route5UndergroundEntrance.asm index bac1ac3f2..5029df0bd 100644 --- a/maps/Route5UndergroundEntrance.asm +++ b/maps/Route5UndergroundEntrance.asm @@ -34,4 +34,4 @@ Route5UndergroundEntrance_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_TEACHER, 6, 6, $2, 1, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TeacherScript_0x18b555, -1 + person_event SPRITE_TEACHER, 2, 2, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TeacherScript_0x18b555, -1 diff --git a/maps/Route6.asm b/maps/Route6.asm index e6090291f..50b899066 100644 --- a/maps/Route6.asm +++ b/maps/Route6.asm @@ -104,6 +104,6 @@ Route6_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_POKEFAN_M, 8, 21, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 2, PokefanMScript_0x1ad951, EVENT_ROUTE_5_6_POKEFAN_M_BLOCKS_UNDERGROUND_PATH - person_event SPRITE_POKEFAN_M, 16, 13, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 0, TrainerPokefanmRex, -1 - person_event SPRITE_POKEFAN_M, 16, 14, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 0, TrainerPokefanmAllan, -1 + person_event SPRITE_POKEFAN_M, 4, 17, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 2, PokefanMScript_0x1ad951, EVENT_ROUTE_5_6_POKEFAN_M_BLOCKS_UNDERGROUND_PATH + person_event SPRITE_POKEFAN_M, 12, 9, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 0, TrainerPokefanmRex, -1 + person_event SPRITE_POKEFAN_M, 12, 10, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 0, TrainerPokefanmAllan, -1 diff --git a/maps/Route6SaffronGate.asm b/maps/Route6SaffronGate.asm index 3ffebad46..ab457f5c5 100644 --- a/maps/Route6SaffronGate.asm +++ b/maps/Route6SaffronGate.asm @@ -75,4 +75,4 @@ Route6SaffronGate_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_OFFICER, 8, 4, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, OfficerScript_0x1926ea, -1 + person_event SPRITE_OFFICER, 4, 0, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, OfficerScript_0x1926ea, -1 diff --git a/maps/Route7SaffronGate.asm b/maps/Route7SaffronGate.asm index b57e8c4d3..05b09f015 100644 --- a/maps/Route7SaffronGate.asm +++ b/maps/Route7SaffronGate.asm @@ -61,4 +61,4 @@ Route7SaffronGate_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_OFFICER, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, OfficerScript_0x73518, -1 + person_event SPRITE_OFFICER, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, OfficerScript_0x73518, -1 diff --git a/maps/Route8.asm b/maps/Route8.asm index d4e450e3a..c8dab80a2 100644 --- a/maps/Route8.asm +++ b/maps/Route8.asm @@ -183,9 +183,9 @@ Route8_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_BIKER, 12, 14, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 5, TrainerBikerDwayne, -1 - person_event SPRITE_BIKER, 13, 14, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 5, TrainerBikerHarris, -1 - person_event SPRITE_BIKER, 14, 14, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 5, TrainerBikerZeke, -1 - person_event SPRITE_SUPER_NERD, 6, 27, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerSupernerdSam, -1 - person_event SPRITE_SUPER_NERD, 16, 35, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 4, TrainerSupernerdTom, -1 - person_event SPRITE_FRUIT_TREE, 9, 37, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x6c06c, -1 + person_event SPRITE_BIKER, 8, 10, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 5, TrainerBikerDwayne, -1 + person_event SPRITE_BIKER, 9, 10, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 5, TrainerBikerHarris, -1 + person_event SPRITE_BIKER, 10, 10, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 5, TrainerBikerZeke, -1 + person_event SPRITE_SUPER_NERD, 2, 23, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerSupernerdSam, -1 + person_event SPRITE_SUPER_NERD, 12, 31, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 4, TrainerSupernerdTom, -1 + person_event SPRITE_FRUIT_TREE, 5, 33, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x6c06c, -1 diff --git a/maps/Route8SaffronGate.asm b/maps/Route8SaffronGate.asm index 944c2bdb6..607909e0b 100644 --- a/maps/Route8SaffronGate.asm +++ b/maps/Route8SaffronGate.asm @@ -35,4 +35,4 @@ Route8SaffronGate_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_OFFICER, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, OfficerScript_0x7f416, -1 + person_event SPRITE_OFFICER, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, OfficerScript_0x7f416, -1 diff --git a/maps/Route9.asm b/maps/Route9.asm index 2e5b4da16..6f760ff73 100644 --- a/maps/Route9.asm +++ b/maps/Route9.asm @@ -216,9 +216,9 @@ Route9_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_YOUNGSTER, 15, 27, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerCamperDean, -1 - person_event SPRITE_LASS, 12, 43, $a, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 3, TrainerPicnickerHeidi, -1 - person_event SPRITE_YOUNGSTER, 8, 15, $a, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 5, TrainerCamperSid, -1 - person_event SPRITE_LASS, 19, 16, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 1, TrainerPicnickerEdna, -1 - person_event SPRITE_POKEFAN_M, 7, 32, $9, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerHikerTim, -1 - person_event SPRITE_POKEFAN_M, 19, 40, $9, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 4, TrainerHikerSidney, -1 + person_event SPRITE_YOUNGSTER, 11, 23, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerCamperDean, -1 + person_event SPRITE_LASS, 8, 39, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 3, TrainerPicnickerHeidi, -1 + person_event SPRITE_YOUNGSTER, 4, 11, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 5, TrainerCamperSid, -1 + person_event SPRITE_LASS, 15, 12, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 1, TrainerPicnickerEdna, -1 + person_event SPRITE_POKEFAN_M, 3, 28, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerHikerTim, -1 + person_event SPRITE_POKEFAN_M, 15, 36, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 4, TrainerHikerSidney, -1 diff --git a/maps/RuinsofAlphAerodactylItemRoom.asm b/maps/RuinsofAlphAerodactylItemRoom.asm index 4c9377b49..2ddcd707b 100644 --- a/maps/RuinsofAlphAerodactylItemRoom.asm +++ b/maps/RuinsofAlphAerodactylItemRoom.asm @@ -47,7 +47,7 @@ RuinsofAlphAerodactylItemRoom_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_POKE_BALL, 10, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59ab6, EVENT_PICKED_UP_GOLD_BERRY_FROM_AERODACTYL_ITEM_ROOM - person_event SPRITE_POKE_BALL, 10, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59ab8, EVENT_PICKED_UP_MOON_STONE_FROM_AERODACTYL_ITEM_ROOM - person_event SPRITE_POKE_BALL, 8, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59aba, EVENT_PICKED_UP_HEAL_POWDER_FROM_AERODACTYL_ITEM_ROOM - person_event SPRITE_POKE_BALL, 8, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59abc, EVENT_PICKED_UP_ENERGY_ROOT_FROM_AERODACTYL_ITEM_ROOM + person_event SPRITE_POKE_BALL, 6, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59ab6, EVENT_PICKED_UP_GOLD_BERRY_FROM_AERODACTYL_ITEM_ROOM + person_event SPRITE_POKE_BALL, 6, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59ab8, EVENT_PICKED_UP_MOON_STONE_FROM_AERODACTYL_ITEM_ROOM + person_event SPRITE_POKE_BALL, 4, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59aba, EVENT_PICKED_UP_HEAL_POWDER_FROM_AERODACTYL_ITEM_ROOM + person_event SPRITE_POKE_BALL, 4, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59abc, EVENT_PICKED_UP_ENERGY_ROOT_FROM_AERODACTYL_ITEM_ROOM diff --git a/maps/RuinsofAlphHoOhItemRoom.asm b/maps/RuinsofAlphHoOhItemRoom.asm index 8debefa91..c3af94b03 100644 --- a/maps/RuinsofAlphHoOhItemRoom.asm +++ b/maps/RuinsofAlphHoOhItemRoom.asm @@ -47,7 +47,7 @@ RuinsofAlphHoOhItemRoom_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_POKE_BALL, 10, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59918, EVENT_PICKED_UP_GOLD_BERRY_FROM_HO_OH_ITEM_ROOM - person_event SPRITE_POKE_BALL, 10, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5991a, EVENT_PICKED_UP_MYSTERYBERRY_FROM_HO_OH_ITEM_ROOM - person_event SPRITE_POKE_BALL, 8, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5991c, EVENT_PICKED_UP_REVIVAL_HERB_FROM_HO_OH_ITEM_ROOM - person_event SPRITE_POKE_BALL, 8, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5991e, EVENT_PICKED_UP_CHARCOAL_FROM_HO_OH_ITEM_ROOM + person_event SPRITE_POKE_BALL, 6, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59918, EVENT_PICKED_UP_GOLD_BERRY_FROM_HO_OH_ITEM_ROOM + person_event SPRITE_POKE_BALL, 6, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5991a, EVENT_PICKED_UP_MYSTERYBERRY_FROM_HO_OH_ITEM_ROOM + person_event SPRITE_POKE_BALL, 4, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5991c, EVENT_PICKED_UP_REVIVAL_HERB_FROM_HO_OH_ITEM_ROOM + person_event SPRITE_POKE_BALL, 4, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5991e, EVENT_PICKED_UP_CHARCOAL_FROM_HO_OH_ITEM_ROOM diff --git a/maps/RuinsofAlphInnerChamber.asm b/maps/RuinsofAlphInnerChamber.asm index 3219ae048..ae8bed5d6 100644 --- a/maps/RuinsofAlphInnerChamber.asm +++ b/maps/RuinsofAlphInnerChamber.asm @@ -125,6 +125,6 @@ RuinsofAlphInnerChamber_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_FISHER, 11, 7, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FisherScript_0x58f7d, EVENT_RUINS_OF_ALPH_INNER_CHAMBER_TOURISTS - person_event SPRITE_TEACHER, 17, 18, $2, 1, 1, -1, -1, 0, 0, 0, TeacherScript_0x58f80, EVENT_RUINS_OF_ALPH_INNER_CHAMBER_TOURISTS - person_event SPRITE_GRAMPS, 23, 15, $7, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, GrampsScript_0x58f83, EVENT_RUINS_OF_ALPH_INNER_CHAMBER_TOURISTS + person_event SPRITE_FISHER, 7, 3, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FisherScript_0x58f7d, EVENT_RUINS_OF_ALPH_INNER_CHAMBER_TOURISTS + person_event SPRITE_TEACHER, 13, 14, $2, 1, 1, -1, -1, 0, 0, 0, TeacherScript_0x58f80, EVENT_RUINS_OF_ALPH_INNER_CHAMBER_TOURISTS + person_event SPRITE_GRAMPS, 19, 11, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, GrampsScript_0x58f83, EVENT_RUINS_OF_ALPH_INNER_CHAMBER_TOURISTS diff --git a/maps/RuinsofAlphKabutoChamber.asm b/maps/RuinsofAlphKabutoChamber.asm index dae2628c0..e20eaf7c2 100644 --- a/maps/RuinsofAlphKabutoChamber.asm +++ b/maps/RuinsofAlphKabutoChamber.asm @@ -284,5 +284,5 @@ RuinsofAlphKabutoChamber_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_RECEPTIONIST, 9, 9, $6, 0, 0, -1, -1, 0, 0, 0, ReceptionistScript_0x58769, EVENT_RUINS_OF_ALPH_KABUTO_CHAMBER_RECEPTIONIST - person_event SPRITE_SCIENTIST, 5, 7, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ScientistScript_0x587a8, -1 + person_event SPRITE_RECEPTIONIST, 5, 5, $6, 0, 0, -1, -1, 0, 0, 0, ReceptionistScript_0x58769, EVENT_RUINS_OF_ALPH_KABUTO_CHAMBER_RECEPTIONIST + person_event SPRITE_SCIENTIST, 1, 3, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ScientistScript_0x587a8, -1 diff --git a/maps/RuinsofAlphKabutoItemRoom.asm b/maps/RuinsofAlphKabutoItemRoom.asm index 0a318ff11..02f924280 100644 --- a/maps/RuinsofAlphKabutoItemRoom.asm +++ b/maps/RuinsofAlphKabutoItemRoom.asm @@ -47,7 +47,7 @@ RuinsofAlphKabutoItemRoom_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_POKE_BALL, 10, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x599a2, EVENT_PICKED_UP_BERRY_FROM_KABUTO_ITEM_ROOM - person_event SPRITE_POKE_BALL, 10, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x599a4, EVENT_PICKED_UP_PSNCUREBERRY_FROM_KABUTO_ITEM_ROOM - person_event SPRITE_POKE_BALL, 8, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x599a6, EVENT_PICKED_UP_HEAL_POWDER_FROM_KABUTO_ITEM_ROOM - person_event SPRITE_POKE_BALL, 8, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x599a8, EVENT_PICKED_UP_ENERGYPOWDER_FROM_KABUTO_ITEM_ROOM + person_event SPRITE_POKE_BALL, 6, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x599a2, EVENT_PICKED_UP_BERRY_FROM_KABUTO_ITEM_ROOM + person_event SPRITE_POKE_BALL, 6, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x599a4, EVENT_PICKED_UP_PSNCUREBERRY_FROM_KABUTO_ITEM_ROOM + person_event SPRITE_POKE_BALL, 4, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x599a6, EVENT_PICKED_UP_HEAL_POWDER_FROM_KABUTO_ITEM_ROOM + person_event SPRITE_POKE_BALL, 4, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x599a8, EVENT_PICKED_UP_ENERGYPOWDER_FROM_KABUTO_ITEM_ROOM diff --git a/maps/RuinsofAlphOmanyteItemRoom.asm b/maps/RuinsofAlphOmanyteItemRoom.asm index 7ff070137..5fb622702 100644 --- a/maps/RuinsofAlphOmanyteItemRoom.asm +++ b/maps/RuinsofAlphOmanyteItemRoom.asm @@ -47,7 +47,7 @@ RuinsofAlphOmanyteItemRoom_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_POKE_BALL, 10, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59a2c, EVENT_PICKED_UP_MYSTERYBERRY_FROM_OMANYTE_ITEM_ROOM - person_event SPRITE_POKE_BALL, 10, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59a2e, EVENT_PICKED_UP_MYSTIC_WATER_FROM_OMANYTE_ITEM_ROOM - person_event SPRITE_POKE_BALL, 8, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59a30, EVENT_PICKED_UP_STARDUST_FROM_OMANYTE_ITEM_ROOM - person_event SPRITE_POKE_BALL, 8, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59a32, EVENT_PICKED_UP_STAR_PIECE_FROM_OMANYTE_ITEM_ROOM + person_event SPRITE_POKE_BALL, 6, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59a2c, EVENT_PICKED_UP_MYSTERYBERRY_FROM_OMANYTE_ITEM_ROOM + person_event SPRITE_POKE_BALL, 6, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59a2e, EVENT_PICKED_UP_MYSTIC_WATER_FROM_OMANYTE_ITEM_ROOM + person_event SPRITE_POKE_BALL, 4, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59a30, EVENT_PICKED_UP_STARDUST_FROM_OMANYTE_ITEM_ROOM + person_event SPRITE_POKE_BALL, 4, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59a32, EVENT_PICKED_UP_STAR_PIECE_FROM_OMANYTE_ITEM_ROOM diff --git a/maps/RuinsofAlphOutside.asm b/maps/RuinsofAlphOutside.asm index 1c1d3376d..e4748d956 100644 --- a/maps/RuinsofAlphOutside.asm +++ b/maps/RuinsofAlphOutside.asm @@ -311,8 +311,8 @@ RuinsofAlphOutside_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_YOUNGSTER, 24, 8, $6, 0, 0, -1, -1, 0, 2, 1, TrainerPsychicNathan, -1 - person_event SPRITE_SCIENTIST, 19, 15, $7, 0, 0, -1, -1, 0, 0, 0, ScientistScript_0x58043, EVENT_RUINS_OF_ALPH_OUTSIDE_SCIENTIST - person_event SPRITE_FISHER, 21, 17, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FisherScript_0x58061, EVENT_RUINS_OF_ALPH_OUTSIDE_TOURIST_FISHER - person_event SPRITE_YOUNGSTER, 15, 18, $2, 1, 1, -1, -1, 8 + PAL_OW_BROWN, 0, 0, YoungsterScript_0x58076, EVENT_RUINS_OF_ALPH_OUTSIDE_TOURIST_YOUNGSTERS - person_event SPRITE_YOUNGSTER, 12, 16, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x5807e, EVENT_RUINS_OF_ALPH_OUTSIDE_TOURIST_YOUNGSTERS + person_event SPRITE_YOUNGSTER, 20, 4, $6, 0, 0, -1, -1, 0, 2, 1, TrainerPsychicNathan, -1 + person_event SPRITE_SCIENTIST, 15, 11, $7, 0, 0, -1, -1, 0, 0, 0, ScientistScript_0x58043, EVENT_RUINS_OF_ALPH_OUTSIDE_SCIENTIST + person_event SPRITE_FISHER, 17, 13, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FisherScript_0x58061, EVENT_RUINS_OF_ALPH_OUTSIDE_TOURIST_FISHER + person_event SPRITE_YOUNGSTER, 11, 14, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, YoungsterScript_0x58076, EVENT_RUINS_OF_ALPH_OUTSIDE_TOURIST_YOUNGSTERS + person_event SPRITE_YOUNGSTER, 8, 12, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x5807e, EVENT_RUINS_OF_ALPH_OUTSIDE_TOURIST_YOUNGSTERS diff --git a/maps/RuinsofAlphResearchCenter.asm b/maps/RuinsofAlphResearchCenter.asm index bbdc6c12b..47aa063fc 100644 --- a/maps/RuinsofAlphResearchCenter.asm +++ b/maps/RuinsofAlphResearchCenter.asm @@ -412,6 +412,6 @@ RuinsofAlphResearchCenter_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_SCIENTIST, 9, 8, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ScientistScript_0x591e5, -1 - person_event SPRITE_SCIENTIST, 6, 9, $2, 1, 2, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ScientistScript_0x59214, -1 - person_event SPRITE_SCIENTIST, 9, 6, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ScientistScript_0x591d1, EVENT_RUINS_OF_ALPH_RESEARCH_CENTER_SCIENTIST + person_event SPRITE_SCIENTIST, 5, 4, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ScientistScript_0x591e5, -1 + person_event SPRITE_SCIENTIST, 2, 5, $2, 1, 2, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ScientistScript_0x59214, -1 + person_event SPRITE_SCIENTIST, 5, 2, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ScientistScript_0x591d1, EVENT_RUINS_OF_ALPH_RESEARCH_CENTER_SCIENTIST diff --git a/maps/SafariZoneWardensHome.asm b/maps/SafariZoneWardensHome.asm index 755ab9c36..911da549d 100644 --- a/maps/SafariZoneWardensHome.asm +++ b/maps/SafariZoneWardensHome.asm @@ -94,4 +94,4 @@ SafariZoneWardensHome_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_LASS, 8, 6, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, WardensGranddaughter, -1 + person_event SPRITE_LASS, 4, 2, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, WardensGranddaughter, -1 diff --git a/maps/SaffronCity.asm b/maps/SaffronCity.asm index 3b706473c..363f930d7 100644 --- a/maps/SaffronCity.asm +++ b/maps/SaffronCity.asm @@ -295,11 +295,11 @@ SaffronCity_MapEventHeader: .PersonEvents: db 8 - person_event SPRITE_LASS, 18, 11, $5, 0, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, LassScript_0x19932a, -1 - person_event SPRITE_POKEFAN_M, 34, 23, $5, 0, 2, -1, -1, 8 + PAL_OW_BROWN, 0, 0, PokefanMScript_0x19933e, -1 - person_event SPRITE_COOLTRAINER_M, 11, 36, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CooltrainerMScript_0x199352, -1 - person_event SPRITE_COOLTRAINER_F, 28, 24, $5, 0, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerFScript_0x199355, -1 - person_event SPRITE_FISHER, 16, 31, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FisherScript_0x199358, -1 - person_event SPRITE_YOUNGSTER, 23, 19, $4, 1, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, YoungsterScript_0x19936c, -1 - person_event SPRITE_YOUNGSTER, 26, 39, $2, 1, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x19936f, -1 - person_event SPRITE_LASS, 12, 23, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LassScript_0x199372, -1 + person_event SPRITE_LASS, 14, 7, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, LassScript_0x19932a, -1 + person_event SPRITE_POKEFAN_M, 30, 19, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, PokefanMScript_0x19933e, -1 + person_event SPRITE_COOLTRAINER_M, 7, 32, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CooltrainerMScript_0x199352, -1 + person_event SPRITE_COOLTRAINER_F, 24, 20, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerFScript_0x199355, -1 + person_event SPRITE_FISHER, 12, 27, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FisherScript_0x199358, -1 + person_event SPRITE_YOUNGSTER, 19, 15, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, YoungsterScript_0x19936c, -1 + person_event SPRITE_YOUNGSTER, 22, 35, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x19936f, -1 + person_event SPRITE_LASS, 8, 19, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LassScript_0x199372, -1 diff --git a/maps/SaffronGym.asm b/maps/SaffronGym.asm index a04a84d4e..8e7bb1092 100644 --- a/maps/SaffronGym.asm +++ b/maps/SaffronGym.asm @@ -330,9 +330,9 @@ SaffronGym_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_SABRINA, 12, 13, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, SabrinaScript_0x189c2e, -1 - person_event SPRITE_GRANNY, 20, 21, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerMediumRebecca, -1 - person_event SPRITE_YOUNGSTER, 20, 7, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerPsychicFranklin, -1 - person_event SPRITE_GRANNY, 8, 7, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerMediumDoris, -1 - person_event SPRITE_YOUNGSTER, 8, 21, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, TrainerPsychicJared, -1 - person_event SPRITE_GYM_GUY, 18, 13, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SaffronGymGuyScript, -1 + person_event SPRITE_SABRINA, 8, 9, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SabrinaScript_0x189c2e, -1 + person_event SPRITE_GRANNY, 16, 17, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerMediumRebecca, -1 + person_event SPRITE_YOUNGSTER, 16, 3, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerPsychicFranklin, -1 + person_event SPRITE_GRANNY, 4, 3, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerMediumDoris, -1 + person_event SPRITE_YOUNGSTER, 4, 17, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 2, TrainerPsychicJared, -1 + person_event SPRITE_GYM_GUY, 14, 9, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SaffronGymGuyScript, -1 diff --git a/maps/SaffronMart.asm b/maps/SaffronMart.asm index 318a00c3f..6a68113a7 100644 --- a/maps/SaffronMart.asm +++ b/maps/SaffronMart.asm @@ -49,6 +49,6 @@ SaffronMart_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x18a3bf, -1 - person_event SPRITE_COOLTRAINER_M, 6, 11, $3, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, CooltrainerMScript_0x18a3c6, -1 - person_event SPRITE_COOLTRAINER_F, 10, 11, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x18a3c9, -1 + person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x18a3bf, -1 + person_event SPRITE_COOLTRAINER_M, 2, 7, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, CooltrainerMScript_0x18a3c6, -1 + person_event SPRITE_COOLTRAINER_F, 6, 7, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x18a3c9, -1 diff --git a/maps/SaffronPokeCenter1F.asm b/maps/SaffronPokeCenter1F.asm index 708c75012..125e796f0 100644 --- a/maps/SaffronPokeCenter1F.asm +++ b/maps/SaffronPokeCenter1F.asm @@ -123,7 +123,7 @@ SaffronPokeCenter1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x18a47d, -1 - person_event SPRITE_TEACHER, 6, 11, $2, 1, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TeacherScript_0x18a480, -1 - person_event SPRITE_FISHER, 10, 12, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, FisherScript_0x18a48c, -1 - person_event SPRITE_YOUNGSTER, 8, 5, $3, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, YoungsterScript_0x18a4a0, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x18a47d, -1 + person_event SPRITE_TEACHER, 2, 7, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TeacherScript_0x18a480, -1 + person_event SPRITE_FISHER, 6, 8, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, FisherScript_0x18a48c, -1 + person_event SPRITE_YOUNGSTER, 4, 1, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, YoungsterScript_0x18a4a0, -1 diff --git a/maps/SaffronTrainStation.asm b/maps/SaffronTrainStation.asm index 783e76285..55587b16f 100644 --- a/maps/SaffronTrainStation.asm +++ b/maps/SaffronTrainStation.asm @@ -231,7 +231,7 @@ SaffronTrainStation_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_OFFICER, 13, 13, $6, 0, 0, -1, -1, 0, 0, 0, OfficerScript_0x18a81e, -1 - person_event SPRITE_GYM_GUY, 18, 14, $2, 1, 1, -1, -1, 0, 0, 0, GymGuyScript_0x18a875, -1 - person_event SPRITE_TEACHER, 15, 10, $9, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x18a889, EVENT_SAFFRON_TRAIN_STATION_POPULATION - person_event SPRITE_LASS, 14, 10, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LassScript_0x18a88c, EVENT_SAFFRON_TRAIN_STATION_POPULATION + person_event SPRITE_OFFICER, 9, 9, $6, 0, 0, -1, -1, 0, 0, 0, OfficerScript_0x18a81e, -1 + person_event SPRITE_GYM_GUY, 14, 10, $2, 1, 1, -1, -1, 0, 0, 0, GymGuyScript_0x18a875, -1 + person_event SPRITE_TEACHER, 11, 6, $9, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x18a889, EVENT_SAFFRON_TRAIN_STATION_POPULATION + person_event SPRITE_LASS, 10, 6, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LassScript_0x18a88c, EVENT_SAFFRON_TRAIN_STATION_POPULATION diff --git a/maps/SeafoamGym.asm b/maps/SeafoamGym.asm index 07d8c42b5..558a97995 100644 --- a/maps/SeafoamGym.asm +++ b/maps/SeafoamGym.asm @@ -171,5 +171,5 @@ SeafoamGym_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_BLAINE, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, BlaineScript_0x1ab4fb, -1 - person_event SPRITE_GYM_GUY, 9, 10, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SeafoamGymGuyScript, EVENT_SEAFOAM_GYM_GYM_GUY + person_event SPRITE_BLAINE, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, BlaineScript_0x1ab4fb, -1 + person_event SPRITE_GYM_GUY, 5, 6, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SeafoamGymGuyScript, EVENT_SEAFOAM_GYM_GYM_GUY diff --git a/maps/SilphCo1F.asm b/maps/SilphCo1F.asm index 248a88020..0acff40ce 100644 --- a/maps/SilphCo1F.asm +++ b/maps/SilphCo1F.asm @@ -68,5 +68,5 @@ SilphCo1F_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_RECEPTIONIST, 6, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ReceptionistScript_0x18abe5, -1 - person_event SPRITE_OFFICER, 5, 17, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, OfficerScript_0x18abe8, -1 + person_event SPRITE_RECEPTIONIST, 2, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ReceptionistScript_0x18abe5, -1 + person_event SPRITE_OFFICER, 1, 13, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, OfficerScript_0x18abe8, -1 diff --git a/maps/SilverCaveItemRooms.asm b/maps/SilverCaveItemRooms.asm index 075a17d87..e421dd7d8 100644 --- a/maps/SilverCaveItemRooms.asm +++ b/maps/SilverCaveItemRooms.asm @@ -28,5 +28,5 @@ SilverCaveItemRooms_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_POKE_BALL, 7, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c65e, EVENT_SILVER_CAVE_ITEM_ROOMS_MAX_REVIVE - person_event SPRITE_POKE_BALL, 15, 19, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c660, EVENT_SILVER_CAVE_ITEM_ROOMS_FULL_RESTORE + person_event SPRITE_POKE_BALL, 3, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c65e, EVENT_SILVER_CAVE_ITEM_ROOMS_MAX_REVIVE + person_event SPRITE_POKE_BALL, 11, 15, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c660, EVENT_SILVER_CAVE_ITEM_ROOMS_FULL_RESTORE diff --git a/maps/SilverCavePokeCenter1F.asm b/maps/SilverCavePokeCenter1F.asm index 1d3aa7b80..1b53d49e1 100644 --- a/maps/SilverCavePokeCenter1F.asm +++ b/maps/SilverCavePokeCenter1F.asm @@ -43,5 +43,5 @@ SilverCavePokeCenter1F_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x1ae59a, -1 - person_event SPRITE_GRANNY, 9, 5, $8, 1, 2, -1, -1, 0, 0, 0, GrannyScript_0x1ae59d, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x1ae59a, -1 + person_event SPRITE_GRANNY, 5, 1, $8, 1, 2, -1, -1, 0, 0, 0, GrannyScript_0x1ae59d, -1 diff --git a/maps/SilverCaveRoom1.asm b/maps/SilverCaveRoom1.asm index 7add34017..97546a77f 100644 --- a/maps/SilverCaveRoom1.asm +++ b/maps/SilverCaveRoom1.asm @@ -44,7 +44,7 @@ SilverCaveRoom1_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_POKE_BALL, 13, 8, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c554, EVENT_SILVER_CAVE_ROOM_1_MAX_ELIXER - person_event SPRITE_POKE_BALL, 33, 19, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c556, EVENT_SILVER_CAVE_ROOM_1_PROTEIN - person_event SPRITE_POKE_BALL, 34, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c558, EVENT_SILVER_CAVE_ROOM_1_ESCAPE_ROPE - person_event SPRITE_POKE_BALL, 22, 11, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c55a, EVENT_SILVER_CAVE_ROOM_1_ULTRA_BALL + person_event SPRITE_POKE_BALL, 9, 4, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c554, EVENT_SILVER_CAVE_ROOM_1_MAX_ELIXER + person_event SPRITE_POKE_BALL, 29, 15, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c556, EVENT_SILVER_CAVE_ROOM_1_PROTEIN + person_event SPRITE_POKE_BALL, 30, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c558, EVENT_SILVER_CAVE_ROOM_1_ESCAPE_ROPE + person_event SPRITE_POKE_BALL, 18, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c55a, EVENT_SILVER_CAVE_ROOM_1_ULTRA_BALL diff --git a/maps/SilverCaveRoom2.asm b/maps/SilverCaveRoom2.asm index 5daa7a156..ff0e18d8c 100644 --- a/maps/SilverCaveRoom2.asm +++ b/maps/SilverCaveRoom2.asm @@ -38,6 +38,6 @@ SilverCaveRoom2_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_POKE_BALL, 14, 28, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c5b2, EVENT_SILVER_CAVE_ROOM_2_CALCIUM - person_event SPRITE_POKE_BALL, 28, 26, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c5b4, EVENT_SILVER_CAVE_ROOM_2_ULTRA_BALL - person_event SPRITE_POKE_BALL, 24, 8, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c5b6, EVENT_SILVER_CAVE_ROOM_2_PP_UP + person_event SPRITE_POKE_BALL, 10, 24, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c5b2, EVENT_SILVER_CAVE_ROOM_2_CALCIUM + person_event SPRITE_POKE_BALL, 24, 22, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c5b4, EVENT_SILVER_CAVE_ROOM_2_ULTRA_BALL + person_event SPRITE_POKE_BALL, 20, 4, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c5b6, EVENT_SILVER_CAVE_ROOM_2_PP_UP diff --git a/maps/SilverCaveRoom3.asm b/maps/SilverCaveRoom3.asm index 2b98239a0..4b6109076 100644 --- a/maps/SilverCaveRoom3.asm +++ b/maps/SilverCaveRoom3.asm @@ -63,4 +63,4 @@ SilverCaveRoom3_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_RED, 14, 13, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, RedScript_0x18c603, EVENT_RED_IN_MT_SILVER + person_event SPRITE_RED, 10, 9, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, RedScript_0x18c603, EVENT_RED_IN_MT_SILVER diff --git a/maps/SlowpokeWellB1F.asm b/maps/SlowpokeWellB1F.asm index 730c6af1d..9ace60aec 100644 --- a/maps/SlowpokeWellB1F.asm +++ b/maps/SlowpokeWellB1F.asm @@ -326,12 +326,12 @@ SlowpokeWellB1F_MapEventHeader: .PersonEvents: db 9 - person_event SPRITE_ROCKET, 11, 19, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM29, EVENT_SLOWPOKE_WELL_ROCKETS - person_event SPRITE_ROCKET, 6, 9, $6, 0, 0, -1, -1, 0, 2, 1, TrainerGruntM1, EVENT_SLOWPOKE_WELL_ROCKETS - person_event SPRITE_ROCKET, 10, 9, $9, 0, 0, -1, -1, 0, 2, 2, TrainerGruntM2, EVENT_SLOWPOKE_WELL_ROCKETS - person_event SPRITE_ROCKET_GIRL, 8, 14, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 4, TrainerGruntF1, EVENT_SLOWPOKE_WELL_ROCKETS - person_event SPRITE_SLOWPOKE, 8, 11, $1, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, SlowpokeScript_0x5a681, EVENT_SLOWPOKE_WELL_SLOWPOKES - person_event SPRITE_SLOWPOKE, 6, 10, $1, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, SlowpokeScript_0x5a695, EVENT_SLOWPOKE_WELL_SLOWPOKES - person_event SPRITE_KURT, 18, 20, $7, 0, 0, -1, -1, 0, 0, 0, KurtScript_0x5a5d5, EVENT_SLOWPOKE_WELL_KURT - person_event SPRITE_BOULDER, 6, 7, $19, 0, 0, -1, -1, 0, 0, 0, SlowpokeWellB1FBoulder, -1 - person_event SPRITE_POKE_BALL, 7, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5a6a3, EVENT_SLOWPOKE_WELL_B1F_SUPER_POTION + person_event SPRITE_ROCKET, 7, 15, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM29, EVENT_SLOWPOKE_WELL_ROCKETS + person_event SPRITE_ROCKET, 2, 5, $6, 0, 0, -1, -1, 0, 2, 1, TrainerGruntM1, EVENT_SLOWPOKE_WELL_ROCKETS + person_event SPRITE_ROCKET, 6, 5, $9, 0, 0, -1, -1, 0, 2, 2, TrainerGruntM2, EVENT_SLOWPOKE_WELL_ROCKETS + person_event SPRITE_ROCKET_GIRL, 4, 10, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 4, TrainerGruntF1, EVENT_SLOWPOKE_WELL_ROCKETS + person_event SPRITE_SLOWPOKE, 4, 7, $1, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SlowpokeScript_0x5a681, EVENT_SLOWPOKE_WELL_SLOWPOKES + person_event SPRITE_SLOWPOKE, 2, 6, $1, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SlowpokeScript_0x5a695, EVENT_SLOWPOKE_WELL_SLOWPOKES + person_event SPRITE_KURT, 14, 16, $7, 0, 0, -1, -1, 0, 0, 0, KurtScript_0x5a5d5, EVENT_SLOWPOKE_WELL_KURT + person_event SPRITE_BOULDER, 2, 3, $19, 0, 0, -1, -1, 0, 0, 0, SlowpokeWellB1FBoulder, -1 + person_event SPRITE_POKE_BALL, 3, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5a6a3, EVENT_SLOWPOKE_WELL_B1F_SUPER_POTION diff --git a/maps/SlowpokeWellB2F.asm b/maps/SlowpokeWellB2F.asm index 7ebd6d6d6..fcf207bc8 100644 --- a/maps/SlowpokeWellB2F.asm +++ b/maps/SlowpokeWellB2F.asm @@ -73,5 +73,5 @@ SlowpokeWellB2F_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_GYM_GUY, 8, 9, $2, 2, 1, -1, -1, 0, 0, 1, GymGuyScript_0x5ad0b, -1 - person_event SPRITE_POKE_BALL, 9, 19, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5ad28, EVENT_SLOWPOKE_WELL_B2F_TM_RAIN_DANCE + person_event SPRITE_GYM_GUY, 4, 5, $2, 2, 1, -1, -1, 0, 0, 1, GymGuyScript_0x5ad0b, -1 + person_event SPRITE_POKE_BALL, 5, 15, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5ad28, EVENT_SLOWPOKE_WELL_B2F_TM_RAIN_DANCE diff --git a/maps/SoulHouse.asm b/maps/SoulHouse.asm index c47b4347f..f315a3b5b 100644 --- a/maps/SoulHouse.asm +++ b/maps/SoulHouse.asm @@ -83,7 +83,7 @@ SoulHouse_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_GRAMPS, 6, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GrampsScript_0x7ec47, -1 - person_event SPRITE_TEACHER, 7, 11, $5, 0, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, TeacherScript_0x7ec4a, -1 - person_event SPRITE_LASS, 9, 6, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, LassScript_0x7ec4d, -1 - person_event SPRITE_GRANNY, 7, 5, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GrannyScript_0x7ec50, -1 + person_event SPRITE_GRAMPS, 2, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GrampsScript_0x7ec47, -1 + person_event SPRITE_TEACHER, 3, 7, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, TeacherScript_0x7ec4a, -1 + person_event SPRITE_LASS, 5, 2, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, LassScript_0x7ec4d, -1 + person_event SPRITE_GRANNY, 3, 1, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GrannyScript_0x7ec50, -1 diff --git a/maps/SproutTower1F.asm b/maps/SproutTower1F.asm index 181a408b9..ee4eef4db 100644 --- a/maps/SproutTower1F.asm +++ b/maps/SproutTower1F.asm @@ -116,9 +116,9 @@ SproutTower1F_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_SAGE, 8, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SageScript_0x1844fe, -1 - person_event SPRITE_SAGE, 11, 10, $2, 1, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SageScript_0x184501, -1 - person_event SPRITE_GRANNY, 16, 15, $8, 0, 0, -1, -1, 0, 0, 0, GrannyScript_0x184504, -1 - person_event SPRITE_TEACHER, 13, 13, $7, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x184507, -1 - person_event SPRITE_SAGE, 9, 7, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 4, TrainerSageChow, -1 - person_event SPRITE_POKE_BALL, 11, 20, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18451e, EVENT_SPROUT_TOWER1F_PARLYZ_HEAL + person_event SPRITE_SAGE, 4, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SageScript_0x1844fe, -1 + person_event SPRITE_SAGE, 7, 6, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SageScript_0x184501, -1 + person_event SPRITE_GRANNY, 12, 11, $8, 0, 0, -1, -1, 0, 0, 0, GrannyScript_0x184504, -1 + person_event SPRITE_TEACHER, 9, 9, $7, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x184507, -1 + person_event SPRITE_SAGE, 5, 3, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 4, TrainerSageChow, -1 + person_event SPRITE_POKE_BALL, 7, 16, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18451e, EVENT_SPROUT_TOWER1F_PARLYZ_HEAL diff --git a/maps/SproutTower2F.asm b/maps/SproutTower2F.asm index 1386b1643..946f57d9d 100644 --- a/maps/SproutTower2F.asm +++ b/maps/SproutTower2F.asm @@ -99,6 +99,6 @@ SproutTower2F_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_SAGE, 7, 16, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 4, TrainerSageNico, -1 - person_event SPRITE_SAGE, 18, 13, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 5, TrainerSageEdmond, -1 - person_event SPRITE_POKE_BALL, 5, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1847a7, EVENT_SPROUT_TOWER2F_X_ACCURACY + person_event SPRITE_SAGE, 3, 12, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 4, TrainerSageNico, -1 + person_event SPRITE_SAGE, 14, 9, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 5, TrainerSageEdmond, -1 + person_event SPRITE_POKE_BALL, 1, 3, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1847a7, EVENT_SPROUT_TOWER2F_X_ACCURACY diff --git a/maps/SproutTower3F.asm b/maps/SproutTower3F.asm index 6f1b93811..7656bdea7 100644 --- a/maps/SproutTower3F.asm +++ b/maps/SproutTower3F.asm @@ -345,10 +345,10 @@ SproutTower3F_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_SAGE, 17, 12, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerSageJin, -1 - person_event SPRITE_SAGE, 12, 12, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, TrainerSageTroy, -1 - person_event SPRITE_SAGE, 6, 14, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SageLiScript, -1 - person_event SPRITE_SAGE, 15, 15, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerSageNeal, -1 - person_event SPRITE_POKE_BALL, 18, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x184a19, EVENT_SPROUT_TOWER_3F_POTION - person_event SPRITE_POKE_BALL, 5, 18, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x184a1b, EVENT_SPROUT_TOWER_3F_ESCAPE_ROPE - person_event SPRITE_SILVER, 8, 14, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_SPROUT_TOWER + person_event SPRITE_SAGE, 13, 8, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerSageJin, -1 + person_event SPRITE_SAGE, 8, 8, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 2, TrainerSageTroy, -1 + person_event SPRITE_SAGE, 2, 10, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SageLiScript, -1 + person_event SPRITE_SAGE, 11, 11, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerSageNeal, -1 + person_event SPRITE_POKE_BALL, 14, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x184a19, EVENT_SPROUT_TOWER_3F_POTION + person_event SPRITE_POKE_BALL, 1, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x184a1b, EVENT_SPROUT_TOWER_3F_ESCAPE_ROPE + person_event SPRITE_SILVER, 4, 10, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_SPROUT_TOWER diff --git a/maps/TeamRocketBaseB1F.asm b/maps/TeamRocketBaseB1F.asm index ec6d2338b..3f7f1f39a 100644 --- a/maps/TeamRocketBaseB1F.asm +++ b/maps/TeamRocketBaseB1F.asm @@ -786,9 +786,9 @@ TeamRocketBaseB1F_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_ROCKET, 4, 4, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_SECURITY_GRUNTS - person_event SPRITE_ROCKET, 8, 6, $9, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM16, EVENT_TEAM_ROCKET_BASE_POPULATION - person_event SPRITE_SCIENTIST, 16, 22, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerScientistJed, EVENT_TEAM_ROCKET_BASE_POPULATION - person_event SPRITE_POKE_BALL, 10, 31, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6cac4, EVENT_TEAM_ROCKET_BASE_B1F_HYPER_POTION - person_event SPRITE_POKE_BALL, 19, 18, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6cac6, EVENT_TEAM_ROCKET_BASE_B1F_NUGGET - person_event SPRITE_POKE_BALL, 16, 25, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6cac8, EVENT_TEAM_ROCKET_BASE_B1F_GUARD_SPEC + person_event SPRITE_ROCKET, 0, 0, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_SECURITY_GRUNTS + person_event SPRITE_ROCKET, 4, 2, $9, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM16, EVENT_TEAM_ROCKET_BASE_POPULATION + person_event SPRITE_SCIENTIST, 12, 18, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerScientistJed, EVENT_TEAM_ROCKET_BASE_POPULATION + person_event SPRITE_POKE_BALL, 6, 27, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6cac4, EVENT_TEAM_ROCKET_BASE_B1F_HYPER_POTION + person_event SPRITE_POKE_BALL, 15, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6cac6, EVENT_TEAM_ROCKET_BASE_B1F_NUGGET + person_event SPRITE_POKE_BALL, 12, 21, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6cac8, EVENT_TEAM_ROCKET_BASE_B1F_GUARD_SPEC diff --git a/maps/TeamRocketBaseB2F.asm b/maps/TeamRocketBaseB2F.asm index ca0aecbd9..b6363cbc2 100644 --- a/maps/TeamRocketBaseB2F.asm +++ b/maps/TeamRocketBaseB2F.asm @@ -952,17 +952,17 @@ TeamRocketBaseB2F_MapEventHeader: .PersonEvents: db 14 - person_event SPRITE_ROCKET, 20, 24, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B2F_GRUNT_WITH_EXECUTIVE - person_event SPRITE_ROCKET_GIRL, 20, 24, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B2F_EXECUTIVE - person_event SPRITE_LANCE, 17, 9, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B2F_LANCE - person_event SPRITE_DRAGON, 17, 13, $9, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B2F_DRAGONITE - person_event SPRITE_VOLTORB, 9, 11, $16, 0, 0, -1, -1, 0, 0, 0, VoltorbScript_0x6d101, EVENT_TEAM_ROCKET_BASE_B2F_ELECTRODE_1 - person_event SPRITE_VOLTORB, 11, 11, $16, 0, 0, -1, -1, 0, 0, 0, VoltorbScript_0x6d12c, EVENT_TEAM_ROCKET_BASE_B2F_ELECTRODE_2 - person_event SPRITE_VOLTORB, 13, 11, $16, 0, 0, -1, -1, 0, 0, 0, VoltorbScript_0x6d157, EVENT_TEAM_ROCKET_BASE_B2F_ELECTRODE_3 - person_event SPRITE_VOLTORB, 9, 26, $16, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B2F_ELECTRODE_1 - person_event SPRITE_VOLTORB, 11, 26, $16, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B2F_ELECTRODE_2 - person_event SPRITE_VOLTORB, 13, 26, $16, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B2F_ELECTRODE_3 - person_event SPRITE_ROCKET, 17, 29, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM17, EVENT_TEAM_ROCKET_BASE_POPULATION - person_event SPRITE_ROCKET, 5, 8, $a, 0, 0, -1, -1, 0, 2, 1, TrainerGruntM18, EVENT_TEAM_ROCKET_BASE_POPULATION - person_event SPRITE_ROCKET, 18, 25, $8, 0, 0, -1, -1, 0, 2, 4, TrainerGruntM19, EVENT_TEAM_ROCKET_BASE_POPULATION - person_event SPRITE_POKE_BALL, 14, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6d20d, EVENT_TEAM_ROCKET_BASE_B2F_TM_THIEF + person_event SPRITE_ROCKET, 16, 20, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B2F_GRUNT_WITH_EXECUTIVE + person_event SPRITE_ROCKET_GIRL, 16, 20, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B2F_EXECUTIVE + person_event SPRITE_LANCE, 13, 5, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B2F_LANCE + person_event SPRITE_DRAGON, 13, 9, $9, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B2F_DRAGONITE + person_event SPRITE_VOLTORB, 5, 7, $16, 0, 0, -1, -1, 0, 0, 0, VoltorbScript_0x6d101, EVENT_TEAM_ROCKET_BASE_B2F_ELECTRODE_1 + person_event SPRITE_VOLTORB, 7, 7, $16, 0, 0, -1, -1, 0, 0, 0, VoltorbScript_0x6d12c, EVENT_TEAM_ROCKET_BASE_B2F_ELECTRODE_2 + person_event SPRITE_VOLTORB, 9, 7, $16, 0, 0, -1, -1, 0, 0, 0, VoltorbScript_0x6d157, EVENT_TEAM_ROCKET_BASE_B2F_ELECTRODE_3 + person_event SPRITE_VOLTORB, 5, 22, $16, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B2F_ELECTRODE_1 + person_event SPRITE_VOLTORB, 7, 22, $16, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B2F_ELECTRODE_2 + person_event SPRITE_VOLTORB, 9, 22, $16, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B2F_ELECTRODE_3 + person_event SPRITE_ROCKET, 13, 25, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM17, EVENT_TEAM_ROCKET_BASE_POPULATION + person_event SPRITE_ROCKET, 1, 4, $a, 0, 0, -1, -1, 0, 2, 1, TrainerGruntM18, EVENT_TEAM_ROCKET_BASE_POPULATION + person_event SPRITE_ROCKET, 14, 21, $8, 0, 0, -1, -1, 0, 2, 4, TrainerGruntM19, EVENT_TEAM_ROCKET_BASE_POPULATION + person_event SPRITE_POKE_BALL, 10, 3, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6d20d, EVENT_TEAM_ROCKET_BASE_B2F_TM_THIEF diff --git a/maps/TeamRocketBaseB3F.asm b/maps/TeamRocketBaseB3F.asm index da1c9eb56..91b2a8396 100644 --- a/maps/TeamRocketBaseB3F.asm +++ b/maps/TeamRocketBaseB3F.asm @@ -587,17 +587,17 @@ TeamRocketBaseB3F_MapEventHeader: .PersonEvents: db 14 - person_event SPRITE_LANCE, 18, 29, $6, 0, 0, -1, -1, 0, 0, 0, LanceScript_0x6dffc, EVENT_TEAM_ROCKET_BASE_B3F_LANCE_PASSWORDS - person_event SPRITE_ROCKET, 7, 12, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B3F_EXECUTIVE - person_event SPRITE_MOLTRES, 6, 11, $16, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, MoltresScript_0x6e091, EVENT_TEAM_ROCKET_BASE_POPULATION - person_event SPRITE_ROCKET_GIRL, 11, 25, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 0, TrainerGruntF5, EVENT_TEAM_ROCKET_BASE_POPULATION - person_event SPRITE_ROCKET, 18, 9, $a, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM28, EVENT_TEAM_ROCKET_BASE_POPULATION - person_event SPRITE_SCIENTIST, 15, 27, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 0, TrainerScientistRoss, EVENT_TEAM_ROCKET_BASE_POPULATION - person_event SPRITE_SCIENTIST, 19, 15, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerScientistMitch, EVENT_TEAM_ROCKET_BASE_POPULATION - person_event SPRITE_ROCKET, 18, 28, $6, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x6e048, EVENT_TEAM_ROCKET_BASE_POPULATION - person_event SPRITE_SILVER, 9, 8, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_TEAM_ROCKET_BASE - person_event SPRITE_POKE_BALL, 16, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6e120, EVENT_TEAM_ROCKET_BASE_B3F_PROTEIN - person_event SPRITE_POKE_BALL, 16, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6e122, EVENT_TEAM_ROCKET_BASE_B3F_X_SPECIAL - person_event SPRITE_POKE_BALL, 13, 32, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6e124, EVENT_TEAM_ROCKET_BASE_B3F_FULL_HEAL - person_event SPRITE_POKE_BALL, 6, 21, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6e126, EVENT_TEAM_ROCKET_BASE_B3F_ICE_HEAL - person_event SPRITE_POKE_BALL, 14, 18, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6e128, EVENT_TEAM_ROCKET_BASE_B3F_ULTRA_BALL + person_event SPRITE_LANCE, 14, 25, $6, 0, 0, -1, -1, 0, 0, 0, LanceScript_0x6dffc, EVENT_TEAM_ROCKET_BASE_B3F_LANCE_PASSWORDS + person_event SPRITE_ROCKET, 3, 8, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_B3F_EXECUTIVE + person_event SPRITE_MOLTRES, 2, 7, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, MoltresScript_0x6e091, EVENT_TEAM_ROCKET_BASE_POPULATION + person_event SPRITE_ROCKET_GIRL, 7, 21, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 0, TrainerGruntF5, EVENT_TEAM_ROCKET_BASE_POPULATION + person_event SPRITE_ROCKET, 14, 5, $a, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM28, EVENT_TEAM_ROCKET_BASE_POPULATION + person_event SPRITE_SCIENTIST, 11, 23, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 0, TrainerScientistRoss, EVENT_TEAM_ROCKET_BASE_POPULATION + person_event SPRITE_SCIENTIST, 15, 11, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerScientistMitch, EVENT_TEAM_ROCKET_BASE_POPULATION + person_event SPRITE_ROCKET, 14, 24, $6, 0, 0, -1, -1, 0, 0, 0, RocketScript_0x6e048, EVENT_TEAM_ROCKET_BASE_POPULATION + person_event SPRITE_SILVER, 5, 4, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_TEAM_ROCKET_BASE + person_event SPRITE_POKE_BALL, 12, 1, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6e120, EVENT_TEAM_ROCKET_BASE_B3F_PROTEIN + person_event SPRITE_POKE_BALL, 12, 3, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6e122, EVENT_TEAM_ROCKET_BASE_B3F_X_SPECIAL + person_event SPRITE_POKE_BALL, 9, 28, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6e124, EVENT_TEAM_ROCKET_BASE_B3F_FULL_HEAL + person_event SPRITE_POKE_BALL, 2, 17, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6e126, EVENT_TEAM_ROCKET_BASE_B3F_ICE_HEAL + person_event SPRITE_POKE_BALL, 10, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x6e128, EVENT_TEAM_ROCKET_BASE_B3F_ULTRA_BALL diff --git a/maps/TimeCapsule.asm b/maps/TimeCapsule.asm index 24006b204..c568f3f3a 100644 --- a/maps/TimeCapsule.asm +++ b/maps/TimeCapsule.asm @@ -73,5 +73,5 @@ TimeCapsule_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_CHRIS, 8, 7, $9, 0, 0, -1, -1, 0, 0, 0, ChrisScript_0x19351a, EVENT_GAVE_KURT_APRICORNS - person_event SPRITE_CHRIS, 8, 10, $8, 0, 0, -1, -1, 0, 0, 0, ChrisScript_0x19351a, EVENT_RECEIVED_BALLS_FROM_KURT + person_event SPRITE_CHRIS, 4, 3, $9, 0, 0, -1, -1, 0, 0, 0, ChrisScript_0x19351a, EVENT_GAVE_KURT_APRICORNS + person_event SPRITE_CHRIS, 4, 6, $8, 0, 0, -1, -1, 0, 0, 0, ChrisScript_0x19351a, EVENT_RECEIVED_BALLS_FROM_KURT diff --git a/maps/TinTower1F.asm b/maps/TinTower1F.asm index f3223eeb9..f9bd58697 100644 --- a/maps/TinTower1F.asm +++ b/maps/TinTower1F.asm @@ -534,13 +534,13 @@ TinTower1F_MapEventHeader: .PersonEvents: db 10 - person_event SPRITE_SUICUNE, 13, 13, $1, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_TIN_TOWER_1F_SUICUNE - person_event SPRITE_RAIKOU, 13, 11, $1, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, ObjectEvent, EVENT_TIN_TOWER_1F_RAIKOU - person_event SPRITE_ENTEI, 13, 16, $1, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ObjectEvent, EVENT_TIN_TOWER_1F_ENTEI - person_event SPRITE_SUPER_NERD, 7, 12, $3, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SuperNerdScript_0x1851c8, EVENT_TIN_TOWER_1F_EUSINE - person_event SPRITE_SAGE, 13, 9, $3, 0, 0, -1, -1, 0, 0, 0, SageScript_0x185173, EVENT_TIN_TOWER_1F_WISE_TRIO_1 - person_event SPRITE_SAGE, 15, 15, $3, 0, 0, -1, -1, 0, 0, 0, SageScript_0x185176, EVENT_TIN_TOWER_1F_WISE_TRIO_1 - person_event SPRITE_SAGE, 10, 18, $3, 0, 0, -1, -1, 0, 0, 0, SageScript_0x185179, EVENT_TIN_TOWER_1F_WISE_TRIO_1 - person_event SPRITE_SAGE, 6, 8, $4, 1, 0, -1, -1, 0, 0, 0, SageScript_0x18517c, EVENT_TIN_TOWER_1F_WISE_TRIO_2 - person_event SPRITE_SAGE, 5, 13, $6, 0, 0, -1, -1, 0, 0, 0, SageScript_0x185188, EVENT_TIN_TOWER_1F_WISE_TRIO_2 - person_event SPRITE_SAGE, 6, 18, $5, 0, 1, -1, -1, 0, 0, 0, SageScript_0x1851bc, EVENT_TIN_TOWER_1F_WISE_TRIO_2 + person_event SPRITE_SUICUNE, 9, 9, $1, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_TIN_TOWER_1F_SUICUNE + person_event SPRITE_RAIKOU, 9, 7, $1, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, ObjectEvent, EVENT_TIN_TOWER_1F_RAIKOU + person_event SPRITE_ENTEI, 9, 12, $1, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ObjectEvent, EVENT_TIN_TOWER_1F_ENTEI + person_event SPRITE_SUPER_NERD, 3, 8, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SuperNerdScript_0x1851c8, EVENT_TIN_TOWER_1F_EUSINE + person_event SPRITE_SAGE, 9, 5, $3, 0, 0, -1, -1, 0, 0, 0, SageScript_0x185173, EVENT_TIN_TOWER_1F_WISE_TRIO_1 + person_event SPRITE_SAGE, 11, 11, $3, 0, 0, -1, -1, 0, 0, 0, SageScript_0x185176, EVENT_TIN_TOWER_1F_WISE_TRIO_1 + person_event SPRITE_SAGE, 6, 14, $3, 0, 0, -1, -1, 0, 0, 0, SageScript_0x185179, EVENT_TIN_TOWER_1F_WISE_TRIO_1 + person_event SPRITE_SAGE, 2, 4, $4, 1, 0, -1, -1, 0, 0, 0, SageScript_0x18517c, EVENT_TIN_TOWER_1F_WISE_TRIO_2 + person_event SPRITE_SAGE, 1, 9, $6, 0, 0, -1, -1, 0, 0, 0, SageScript_0x185188, EVENT_TIN_TOWER_1F_WISE_TRIO_2 + person_event SPRITE_SAGE, 2, 14, $5, 0, 1, -1, -1, 0, 0, 0, SageScript_0x1851bc, EVENT_TIN_TOWER_1F_WISE_TRIO_2 diff --git a/maps/TinTower3F.asm b/maps/TinTower3F.asm index 6d7ea32e1..308dac3a5 100644 --- a/maps/TinTower3F.asm +++ b/maps/TinTower3F.asm @@ -25,4 +25,4 @@ TinTower3F_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKE_BALL, 18, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185a37, EVENT_TIN_TOWER_3F_FULL_HEAL + person_event SPRITE_POKE_BALL, 14, 3, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185a37, EVENT_TIN_TOWER_3F_FULL_HEAL diff --git a/maps/TinTower4F.asm b/maps/TinTower4F.asm index 5ef4b4472..9532ad7d2 100644 --- a/maps/TinTower4F.asm +++ b/maps/TinTower4F.asm @@ -38,6 +38,6 @@ TinTower4F_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_POKE_BALL, 14, 18, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185a58, EVENT_TIN_TOWER_4F_ULTRA_BALL - person_event SPRITE_POKE_BALL, 18, 21, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185a5a, EVENT_TIN_TOWER_4F_PP_UP - person_event SPRITE_POKE_BALL, 16, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185a5c, EVENT_TIN_TOWER_4F_ESCAPE_ROPE + person_event SPRITE_POKE_BALL, 10, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185a58, EVENT_TIN_TOWER_4F_ULTRA_BALL + person_event SPRITE_POKE_BALL, 14, 17, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185a5a, EVENT_TIN_TOWER_4F_PP_UP + person_event SPRITE_POKE_BALL, 12, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185a5c, EVENT_TIN_TOWER_4F_ESCAPE_ROPE diff --git a/maps/TinTower5F.asm b/maps/TinTower5F.asm index f976af8a1..142501094 100644 --- a/maps/TinTower5F.asm +++ b/maps/TinTower5F.asm @@ -37,4 +37,4 @@ TinTower5F_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKE_BALL, 13, 13, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185aa9, EVENT_TIN_TOWER_5F_RARE_CANDY + person_event SPRITE_POKE_BALL, 9, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185aa9, EVENT_TIN_TOWER_5F_RARE_CANDY diff --git a/maps/TinTower6F.asm b/maps/TinTower6F.asm index 3da529383..3084eea3c 100644 --- a/maps/TinTower6F.asm +++ b/maps/TinTower6F.asm @@ -25,4 +25,4 @@ TinTower6F_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKE_BALL, 12, 12, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185ae4, EVENT_TIN_TOWER_6F_MAX_POTION + person_event SPRITE_POKE_BALL, 8, 8, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185ae4, EVENT_TIN_TOWER_6F_MAX_POTION diff --git a/maps/TinTower7F.asm b/maps/TinTower7F.asm index 1d7304490..868539f8f 100644 --- a/maps/TinTower7F.asm +++ b/maps/TinTower7F.asm @@ -28,4 +28,4 @@ TinTower7F_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKE_BALL, 5, 20, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185b05, EVENT_TIN_TOWER_7F_MAX_REVIVE + person_event SPRITE_POKE_BALL, 1, 16, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185b05, EVENT_TIN_TOWER_7F_MAX_REVIVE diff --git a/maps/TinTower8F.asm b/maps/TinTower8F.asm index 697102666..59cce2a57 100644 --- a/maps/TinTower8F.asm +++ b/maps/TinTower8F.asm @@ -35,6 +35,6 @@ TinTower8F_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_POKE_BALL, 17, 11, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185b35, EVENT_TIN_TOWER_8F_NUGGET - person_event SPRITE_POKE_BALL, 10, 15, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185b37, EVENT_TIN_TOWER_8F_MAX_ELIXER - person_event SPRITE_POKE_BALL, 5, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185b39, EVENT_TIN_TOWER_8F_FULL_RESTORE + person_event SPRITE_POKE_BALL, 13, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185b35, EVENT_TIN_TOWER_8F_NUGGET + person_event SPRITE_POKE_BALL, 6, 11, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185b37, EVENT_TIN_TOWER_8F_MAX_ELIXER + person_event SPRITE_POKE_BALL, 1, 3, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185b39, EVENT_TIN_TOWER_8F_FULL_RESTORE diff --git a/maps/TinTower9F.asm b/maps/TinTower9F.asm index a04bdafe9..c76deab16 100644 --- a/maps/TinTower9F.asm +++ b/maps/TinTower9F.asm @@ -38,4 +38,4 @@ TinTower9F_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKE_BALL, 5, 13, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185b88, EVENT_TIN_TOWER_9F_HP_UP + person_event SPRITE_POKE_BALL, 1, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185b88, EVENT_TIN_TOWER_9F_HP_UP diff --git a/maps/TinTowerRoof.asm b/maps/TinTowerRoof.asm index 59538ab55..f9aaa2fe5 100644 --- a/maps/TinTowerRoof.asm +++ b/maps/TinTowerRoof.asm @@ -60,4 +60,4 @@ TinTowerRoof_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_HO_OH, 9, 13, $16, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, HoOhScript_0x77244, EVENT_TIN_TOWER_ROOF_HO_OH + person_event SPRITE_HO_OH, 5, 9, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, HoOhScript_0x77244, EVENT_TIN_TOWER_ROOF_HO_OH diff --git a/maps/TohjoFalls.asm b/maps/TohjoFalls.asm index 886a6c640..7d6cc1522 100644 --- a/maps/TohjoFalls.asm +++ b/maps/TohjoFalls.asm @@ -25,4 +25,4 @@ TohjoFalls_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKE_BALL, 10, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18db02, EVENT_TOHJO_FALLS_MOON_STONE + person_event SPRITE_POKE_BALL, 6, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18db02, EVENT_TOHJO_FALLS_MOON_STONE diff --git a/maps/TradeCenter.asm b/maps/TradeCenter.asm index e04efdbec..8df21cba2 100644 --- a/maps/TradeCenter.asm +++ b/maps/TradeCenter.asm @@ -73,5 +73,5 @@ TradeCenter_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_CHRIS, 8, 7, $9, 0, 0, -1, -1, 0, 0, 0, ChrisScript_0x193499, EVENT_GAVE_KURT_APRICORNS - person_event SPRITE_CHRIS, 8, 10, $8, 0, 0, -1, -1, 0, 0, 0, ChrisScript_0x193499, EVENT_RECEIVED_BALLS_FROM_KURT + person_event SPRITE_CHRIS, 4, 3, $9, 0, 0, -1, -1, 0, 0, 0, ChrisScript_0x193499, EVENT_GAVE_KURT_APRICORNS + person_event SPRITE_CHRIS, 4, 6, $8, 0, 0, -1, -1, 0, 0, 0, ChrisScript_0x193499, EVENT_RECEIVED_BALLS_FROM_KURT diff --git a/maps/TrainerHouse1F.asm b/maps/TrainerHouse1F.asm index 758f3f7e5..fbed606e7 100644 --- a/maps/TrainerHouse1F.asm +++ b/maps/TrainerHouse1F.asm @@ -151,8 +151,8 @@ TrainerHouse1F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_RECEPTIONIST, 15, 4, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ReceptionistScript_0x9af67, -1 - person_event SPRITE_COOLTRAINER_M, 15, 11, $7, 0, 0, -1, -1, 0, 0, 0, CooltrainerMScript_0x9af6a, -1 - person_event SPRITE_COOLTRAINER_F, 6, 10, $6, 0, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerFScript_0x9af6d, -1 - person_event SPRITE_YOUNGSTER, 12, 8, $5, 0, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x9af70, -1 - person_event SPRITE_GENTLEMAN, 8, 6, $9, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x9af73, -1 + person_event SPRITE_RECEPTIONIST, 11, 0, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ReceptionistScript_0x9af67, -1 + person_event SPRITE_COOLTRAINER_M, 11, 7, $7, 0, 0, -1, -1, 0, 0, 0, CooltrainerMScript_0x9af6a, -1 + person_event SPRITE_COOLTRAINER_F, 2, 6, $6, 0, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerFScript_0x9af6d, -1 + person_event SPRITE_YOUNGSTER, 8, 4, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x9af70, -1 + person_event SPRITE_GENTLEMAN, 4, 2, $9, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x9af73, -1 diff --git a/maps/TrainerHouseB1F.asm b/maps/TrainerHouseB1F.asm index 652d615b6..7f58cdf4c 100644 --- a/maps/TrainerHouseB1F.asm +++ b/maps/TrainerHouseB1F.asm @@ -184,5 +184,5 @@ TrainerHouseB1F_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_RECEPTIONIST, 5, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ObjectEvent, -1 - person_event SPRITE_CHRIS, 15, 10, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, ObjectEvent, -1 + person_event SPRITE_RECEPTIONIST, 1, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ObjectEvent, -1 + person_event SPRITE_CHRIS, 11, 6, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, ObjectEvent, -1 diff --git a/maps/UndergroundPathSwitchRoomEntrances.asm b/maps/UndergroundPathSwitchRoomEntrances.asm index 90fe06ea4..63222b817 100644 --- a/maps/UndergroundPathSwitchRoomEntrances.asm +++ b/maps/UndergroundPathSwitchRoomEntrances.asm @@ -923,14 +923,14 @@ UndergroundPathSwitchRoomEntrances_MapEventHeader: .PersonEvents: db 11 - person_event SPRITE_PHARMACIST, 16, 13, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 2, TrainerBurglarDuncan, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_PHARMACIST, 12, 8, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 2, 2, TrainerBurglarEddie, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 6, 21, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM13, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 6, 15, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM11, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 6, 7, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM25, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET_GIRL, 16, 23, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerGruntF3, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_TEACHER, 31, 7, $6, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x7ca7d, -1 - person_event SPRITE_SUPER_NERD, 31, 23, $6, 0, 0, -1, -1, 0, 0, 0, SuperNerdScript_0x7ca7a, -1 - person_event SPRITE_POKE_BALL, 16, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7ce7d, EVENT_UNDERGROUND_PATH_SWITCH_ROOM_ENTRANCES_SMOKE_BALL - person_event SPRITE_POKE_BALL, 13, 18, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7ce7f, EVENT_UNDERGROUND_PATH_SWITCH_ROOM_ENTRANCES_FULL_HEAL - person_event SPRITE_SILVER, 7, 27, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_UNDERGROUND_PATH + person_event SPRITE_PHARMACIST, 12, 9, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 2, TrainerBurglarDuncan, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_PHARMACIST, 8, 4, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 2, 2, TrainerBurglarEddie, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 2, 17, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM13, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 2, 11, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM11, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 2, 3, $6, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM25, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET_GIRL, 12, 19, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerGruntF3, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_TEACHER, 27, 3, $6, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x7ca7d, -1 + person_event SPRITE_SUPER_NERD, 27, 19, $6, 0, 0, -1, -1, 0, 0, 0, SuperNerdScript_0x7ca7a, -1 + person_event SPRITE_POKE_BALL, 12, 1, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7ce7d, EVENT_UNDERGROUND_PATH_SWITCH_ROOM_ENTRANCES_SMOKE_BALL + person_event SPRITE_POKE_BALL, 9, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7ce7f, EVENT_UNDERGROUND_PATH_SWITCH_ROOM_ENTRANCES_FULL_HEAL + person_event SPRITE_SILVER, 3, 23, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_UNDERGROUND_PATH diff --git a/maps/UndergroundWarehouse.asm b/maps/UndergroundWarehouse.asm index bdc5d9bce..3f73eed86 100644 --- a/maps/UndergroundWarehouse.asm +++ b/maps/UndergroundWarehouse.asm @@ -222,10 +222,10 @@ UndergroundWarehouse_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_ROCKET, 12, 13, $7, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM24, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 19, 12, $7, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM14, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_ROCKET, 7, 18, $9, 0, 0, -1, -1, 0, 2, 4, TrainerGruntM15, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_GENTLEMAN, 12, 16, $3, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x7d9bf, EVENT_RADIO_TOWER_ROCKET_TAKEOVER - person_event SPRITE_POKE_BALL, 19, 22, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7d9e4, EVENT_UNDERGROUND_WAREHOUSE_MAX_ETHER - person_event SPRITE_POKE_BALL, 13, 17, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7d9e6, EVENT_UNDERGROUND_WAREHOUSE_TM_SLEEP_TALK - person_event SPRITE_POKE_BALL, 5, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7d9e8, EVENT_UNDERGROUND_WAREHOUSE_ULTRA_BALL + person_event SPRITE_ROCKET, 8, 9, $7, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM24, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 15, 8, $7, 0, 0, -1, -1, 0, 2, 3, TrainerGruntM14, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_ROCKET, 3, 14, $9, 0, 0, -1, -1, 0, 2, 4, TrainerGruntM15, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_GENTLEMAN, 8, 12, $3, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x7d9bf, EVENT_RADIO_TOWER_ROCKET_TAKEOVER + person_event SPRITE_POKE_BALL, 15, 18, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7d9e4, EVENT_UNDERGROUND_WAREHOUSE_MAX_ETHER + person_event SPRITE_POKE_BALL, 9, 13, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7d9e6, EVENT_UNDERGROUND_WAREHOUSE_TM_SLEEP_TALK + person_event SPRITE_POKE_BALL, 1, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7d9e8, EVENT_UNDERGROUND_WAREHOUSE_ULTRA_BALL diff --git a/maps/UnionCave1F.asm b/maps/UnionCave1F.asm index 9910f37c6..d663d2f08 100644 --- a/maps/UnionCave1F.asm +++ b/maps/UnionCave1F.asm @@ -207,12 +207,12 @@ UnionCave1F_MapEventHeader: .PersonEvents: db 9 - person_event SPRITE_POKEFAN_M, 10, 7, $9, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerHikerDaniel, -1 - person_event SPRITE_SUPER_NERD, 25, 8, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerPokemaniacLarry, -1 - person_event SPRITE_POKEFAN_M, 12, 15, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 1, TrainerHikerRussell, -1 - person_event SPRITE_FISHER, 31, 19, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 4, TrainerFirebreatherRay, -1 - person_event SPRITE_FISHER, 23, 18, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 4, TrainerFirebreatherBill, -1 - person_event SPRITE_POKE_BALL, 25, 21, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59c00, EVENT_UNION_CAVE_1F_GREAT_BALL - person_event SPRITE_POKE_BALL, 6, 8, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59c02, EVENT_UNION_CAVE_1F_X_ATTACK - person_event SPRITE_POKE_BALL, 21, 8, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59c04, EVENT_UNION_CAVE_1F_POTION - person_event SPRITE_POKE_BALL, 37, 16, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59c06, EVENT_UNION_CAVE_1F_AWAKENING + person_event SPRITE_POKEFAN_M, 6, 3, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerHikerDaniel, -1 + person_event SPRITE_SUPER_NERD, 21, 4, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerPokemaniacLarry, -1 + person_event SPRITE_POKEFAN_M, 8, 11, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 1, TrainerHikerRussell, -1 + person_event SPRITE_FISHER, 27, 15, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 4, TrainerFirebreatherRay, -1 + person_event SPRITE_FISHER, 19, 14, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 4, TrainerFirebreatherBill, -1 + person_event SPRITE_POKE_BALL, 21, 17, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59c00, EVENT_UNION_CAVE_1F_GREAT_BALL + person_event SPRITE_POKE_BALL, 2, 4, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59c02, EVENT_UNION_CAVE_1F_X_ATTACK + person_event SPRITE_POKE_BALL, 17, 4, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59c04, EVENT_UNION_CAVE_1F_POTION + person_event SPRITE_POKE_BALL, 33, 12, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x59c06, EVENT_UNION_CAVE_1F_AWAKENING diff --git a/maps/UnionCaveB1F.asm b/maps/UnionCaveB1F.asm index d9a6dc8f0..44f666981 100644 --- a/maps/UnionCaveB1F.asm +++ b/maps/UnionCaveB1F.asm @@ -163,10 +163,10 @@ UnionCaveB1F_MapEventHeader: .PersonEvents: db 7 - person_event SPRITE_POKEFAN_M, 8, 13, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerHikerPhillip, -1 - person_event SPRITE_POKEFAN_M, 11, 20, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerHikerLeonard, -1 - person_event SPRITE_SUPER_NERD, 36, 9, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerPokemaniacAndrew, -1 - person_event SPRITE_SUPER_NERD, 34, 21, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerPokemaniacCalvin, -1 - person_event SPRITE_POKE_BALL, 20, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5a016, EVENT_UNION_CAVE_B1F_TM_SWIFT - person_event SPRITE_BOULDER, 14, 11, $19, 0, 0, -1, -1, 0, 0, 0, UnionCaveB1FBoulder, -1 - person_event SPRITE_POKE_BALL, 27, 21, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5a018, EVENT_UNION_CAVE_B1F_X_DEFEND + person_event SPRITE_POKEFAN_M, 4, 9, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerHikerPhillip, -1 + person_event SPRITE_POKEFAN_M, 7, 16, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerHikerLeonard, -1 + person_event SPRITE_SUPER_NERD, 32, 5, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerPokemaniacAndrew, -1 + person_event SPRITE_SUPER_NERD, 30, 17, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerPokemaniacCalvin, -1 + person_event SPRITE_POKE_BALL, 16, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5a016, EVENT_UNION_CAVE_B1F_TM_SWIFT + person_event SPRITE_BOULDER, 10, 7, $19, 0, 0, -1, -1, 0, 0, 0, UnionCaveB1FBoulder, -1 + person_event SPRITE_POKE_BALL, 23, 17, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5a018, EVENT_UNION_CAVE_B1F_X_DEFEND diff --git a/maps/UnionCaveB2F.asm b/maps/UnionCaveB2F.asm index 4920b1d0f..34f0b619f 100644 --- a/maps/UnionCaveB2F.asm +++ b/maps/UnionCaveB2F.asm @@ -152,9 +152,9 @@ UnionCaveB2F_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_ROCKER, 23, 19, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerCooltrainermNick, -1 - person_event SPRITE_COOLTRAINER_F, 17, 9, $a, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerCooltrainerfGwen, -1 - person_event SPRITE_COOLTRAINER_F, 34, 7, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerCooltrainerfEmma, -1 - person_event SPRITE_POKE_BALL, 6, 20, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5a36a, EVENT_UNION_CAVE_B2F_ELIXER - person_event SPRITE_POKE_BALL, 23, 16, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5a36c, EVENT_UNION_CAVE_B2F_HYPER_POTION - person_event SPRITE_SURF, 35, 15, $24, 1, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SurfScript_0x5a31f, EVENT_UNION_CAVE_B2F_LAPRAS + person_event SPRITE_ROCKER, 19, 15, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerCooltrainermNick, -1 + person_event SPRITE_COOLTRAINER_F, 13, 5, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerCooltrainerfGwen, -1 + person_event SPRITE_COOLTRAINER_F, 30, 3, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerCooltrainerfEmma, -1 + person_event SPRITE_POKE_BALL, 2, 16, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5a36a, EVENT_UNION_CAVE_B2F_ELIXER + person_event SPRITE_POKE_BALL, 19, 12, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x5a36c, EVENT_UNION_CAVE_B2F_HYPER_POTION + person_event SPRITE_SURF, 31, 11, $24, 1, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SurfScript_0x5a31f, EVENT_UNION_CAVE_B2F_LAPRAS diff --git a/maps/VermilionCity.asm b/maps/VermilionCity.asm index 584e94833..aeb998ab5 100644 --- a/maps/VermilionCity.asm +++ b/maps/VermilionCity.asm @@ -294,9 +294,9 @@ VermilionCity_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_TEACHER, 13, 22, $2, 1, 1, -1, -1, 0, 0, 0, TeacherScript_0x1aa983, -1 - person_event SPRITE_GRAMPS, 10, 27, $9, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x1aa986, -1 - person_event SPRITE_MACHOP, 11, 30, $16, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, VermilionMachop, -1 - person_event SPRITE_SUPER_NERD, 20, 18, $2, 1, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, SuperNerdScript_0x1aa99b, -1 - person_event SPRITE_BIG_SNORLAX, 12, 38, $15, 0, 0, -1, -1, 0, 0, 0, VermilionSnorlax, EVENT_VERMILION_CITY_SNORLAX - person_event SPRITE_POKEFAN_M, 16, 35, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, VermilionGymBadgeGuy, -1 + person_event SPRITE_TEACHER, 9, 18, $2, 1, 1, -1, -1, 0, 0, 0, TeacherScript_0x1aa983, -1 + person_event SPRITE_GRAMPS, 6, 23, $9, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x1aa986, -1 + person_event SPRITE_MACHOP, 7, 26, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, VermilionMachop, -1 + person_event SPRITE_SUPER_NERD, 16, 14, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, SuperNerdScript_0x1aa99b, -1 + person_event SPRITE_BIG_SNORLAX, 8, 34, $15, 0, 0, -1, -1, 0, 0, 0, VermilionSnorlax, EVENT_VERMILION_CITY_SNORLAX + person_event SPRITE_POKEFAN_M, 12, 31, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, VermilionGymBadgeGuy, -1 diff --git a/maps/VermilionGym.asm b/maps/VermilionGym.asm index 06f62a832..911f1e630 100644 --- a/maps/VermilionGym.asm +++ b/maps/VermilionGym.asm @@ -287,8 +287,8 @@ VermilionGym_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_SURGE, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, SurgeScript_0x1920a5, -1 - person_event SPRITE_GENTLEMAN, 12, 12, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 4, TrainerGentlemanGregory, -1 - person_event SPRITE_ROCKER, 11, 8, $6, 0, 3, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerGuitaristVincent, -1 - person_event SPRITE_SUPER_NERD, 14, 4, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 4, TrainerJugglerHorton, -1 - person_event SPRITE_GYM_GUY, 19, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 1, VermilionGymGuyScript, -1 + person_event SPRITE_SURGE, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, SurgeScript_0x1920a5, -1 + person_event SPRITE_GENTLEMAN, 8, 8, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 4, TrainerGentlemanGregory, -1 + person_event SPRITE_ROCKER, 7, 4, $6, 0, 3, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerGuitaristVincent, -1 + person_event SPRITE_SUPER_NERD, 10, 0, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 4, TrainerJugglerHorton, -1 + person_event SPRITE_GYM_GUY, 15, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 1, VermilionGymGuyScript, -1 diff --git a/maps/VermilionHouseDiglettsCaveSpeechHouse.asm b/maps/VermilionHouseDiglettsCaveSpeechHouse.asm index 2f9882978..9aec5f3f1 100644 --- a/maps/VermilionHouseDiglettsCaveSpeechHouse.asm +++ b/maps/VermilionHouseDiglettsCaveSpeechHouse.asm @@ -34,4 +34,4 @@ VermilionHouseDiglettsCaveSpeechHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_GENTLEMAN, 7, 5, $4, 1, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, GentlemanScript_0x192031, -1 + person_event SPRITE_GENTLEMAN, 3, 1, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, GentlemanScript_0x192031, -1 diff --git a/maps/VermilionHouseFishingSpeechHouse.asm b/maps/VermilionHouseFishingSpeechHouse.asm index 03cb89002..0081bacd3 100644 --- a/maps/VermilionHouseFishingSpeechHouse.asm +++ b/maps/VermilionHouseFishingSpeechHouse.asm @@ -65,4 +65,4 @@ VermilionHouseFishingSpeechHouse_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_FISHING_GURU, 8, 6, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FishingDude, -1 + person_event SPRITE_FISHING_GURU, 4, 2, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FishingDude, -1 diff --git a/maps/VermilionMagnetTrainSpeechHouse.asm b/maps/VermilionMagnetTrainSpeechHouse.asm index 208b1f5a4..6dbee12c5 100644 --- a/maps/VermilionMagnetTrainSpeechHouse.asm +++ b/maps/VermilionMagnetTrainSpeechHouse.asm @@ -48,5 +48,5 @@ VermilionMagnetTrainSpeechHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_POKEFAN_F, 7, 6, $8, 0, 0, -1, -1, 0, 0, 0, PokefanFScript_0x191eb7, -1 - person_event SPRITE_YOUNGSTER, 7, 4, $a, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x191eba, -1 + person_event SPRITE_POKEFAN_F, 3, 2, $8, 0, 0, -1, -1, 0, 0, 0, PokefanFScript_0x191eb7, -1 + person_event SPRITE_YOUNGSTER, 3, 0, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x191eba, -1 diff --git a/maps/VermilionMart.asm b/maps/VermilionMart.asm index 12618701d..21ea46580 100644 --- a/maps/VermilionMart.asm +++ b/maps/VermilionMart.asm @@ -48,6 +48,6 @@ VermilionMart_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x191f7e, -1 - person_event SPRITE_SUPER_NERD, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, SuperNerdScript_0x191f85, -1 - person_event SPRITE_BUENA, 10, 12, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, BuenaScript_0x191f88, -1 + person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x191f7e, -1 + person_event SPRITE_SUPER_NERD, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SuperNerdScript_0x191f85, -1 + person_event SPRITE_BUENA, 6, 8, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, BuenaScript_0x191f88, -1 diff --git a/maps/VermilionPokeCenter1F.asm b/maps/VermilionPokeCenter1F.asm index f334db0ea..428c85ded 100644 --- a/maps/VermilionPokeCenter1F.asm +++ b/maps/VermilionPokeCenter1F.asm @@ -88,7 +88,7 @@ VermilionPokeCenter1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x191603, -1 - person_event SPRITE_FISHING_GURU, 6, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, FishingGuruScript_0x191606, -1 - person_event SPRITE_SAILOR, 9, 10, $4, 1, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SailorScript_0x19161a, -1 - person_event SPRITE_BUG_CATCHER, 9, 5, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, BugCatcherScript_0x19161d, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x191603, -1 + person_event SPRITE_FISHING_GURU, 2, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, FishingGuruScript_0x191606, -1 + person_event SPRITE_SAILOR, 5, 6, $4, 1, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SailorScript_0x19161a, -1 + person_event SPRITE_BUG_CATCHER, 5, 1, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, BugCatcherScript_0x19161d, -1 diff --git a/maps/VermilionPort.asm b/maps/VermilionPort.asm index e396b807a..93543dcc8 100644 --- a/maps/VermilionPort.asm +++ b/maps/VermilionPort.asm @@ -317,6 +317,6 @@ VermilionPort_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_SAILOR, 21, 11, $7, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x74dc4, EVENT_VERMILION_PORT_SAILOR_AT_GANGWAY - person_event SPRITE_SAILOR, 15, 10, $9, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x74e97, -1 - person_event SPRITE_SUPER_NERD, 15, 15, $5, 0, 2, -1, -1, 0, 0, 0, SuperNerdScript_0x74ee6, -1 + person_event SPRITE_SAILOR, 17, 7, $7, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x74dc4, EVENT_VERMILION_PORT_SAILOR_AT_GANGWAY + person_event SPRITE_SAILOR, 11, 6, $9, 0, 0, -1, -1, 0, 0, 0, SailorScript_0x74e97, -1 + person_event SPRITE_SUPER_NERD, 11, 11, $5, 0, 2, -1, -1, 0, 0, 0, SuperNerdScript_0x74ee6, -1 diff --git a/maps/VermilionPortPassage.asm b/maps/VermilionPortPassage.asm index 9ed07e519..2910622f7 100644 --- a/maps/VermilionPortPassage.asm +++ b/maps/VermilionPortPassage.asm @@ -35,4 +35,4 @@ VermilionPortPassage_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_TEACHER, 5, 21, $8, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x7701a, -1 + person_event SPRITE_TEACHER, 1, 17, $8, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x7701a, -1 diff --git a/maps/VictoryRoad.asm b/maps/VictoryRoad.asm index 32839b698..dbcfef7d4 100644 --- a/maps/VictoryRoad.asm +++ b/maps/VictoryRoad.asm @@ -263,9 +263,9 @@ VictoryRoad_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_SILVER, 17, 22, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_VICTORY_ROAD - person_event SPRITE_POKE_BALL, 32, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x74529, EVENT_VICTORY_ROAD_TM_EARTHQUAKE - person_event SPRITE_POKE_BALL, 52, 16, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7452b, EVENT_VICTORY_ROAD_MAX_REVIVE - person_event SPRITE_POKE_BALL, 33, 22, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7452d, EVENT_VICTORY_ROAD_FULL_RESTORE - person_event SPRITE_POKE_BALL, 52, 19, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7452f, EVENT_VICTORY_ROAD_FULL_HEAL - person_event SPRITE_POKE_BALL, 42, 11, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x74531, EVENT_VICTORY_ROAD_HP_UP + person_event SPRITE_SILVER, 13, 18, $7, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_VICTORY_ROAD + person_event SPRITE_POKE_BALL, 28, 3, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x74529, EVENT_VICTORY_ROAD_TM_EARTHQUAKE + person_event SPRITE_POKE_BALL, 48, 12, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7452b, EVENT_VICTORY_ROAD_MAX_REVIVE + person_event SPRITE_POKE_BALL, 29, 18, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7452d, EVENT_VICTORY_ROAD_FULL_RESTORE + person_event SPRITE_POKE_BALL, 48, 15, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7452f, EVENT_VICTORY_ROAD_FULL_HEAL + person_event SPRITE_POKE_BALL, 38, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x74531, EVENT_VICTORY_ROAD_HP_UP diff --git a/maps/VictoryRoadGate.asm b/maps/VictoryRoadGate.asm index 14163d1e1..8562ccf31 100644 --- a/maps/VictoryRoadGate.asm +++ b/maps/VictoryRoadGate.asm @@ -118,6 +118,6 @@ VictoryRoadGate_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_OFFICER, 15, 12, $9, 0, 0, -1, -1, 0, 0, 0, OfficerScript_0x9ba03, -1 - person_event SPRITE_BLACK_BELT, 9, 11, $9, 0, 0, -1, -1, 0, 0, 0, BlackBeltScript_0x9ba21, EVENT_OPENED_MT_SILVER - person_event SPRITE_BLACK_BELT, 9, 16, $8, 0, 0, -1, -1, 0, 0, 0, BlackBeltScript_0x9ba24, EVENT_FOUGHT_SNORLAX + person_event SPRITE_OFFICER, 11, 8, $9, 0, 0, -1, -1, 0, 0, 0, OfficerScript_0x9ba03, -1 + person_event SPRITE_BLACK_BELT, 5, 7, $9, 0, 0, -1, -1, 0, 0, 0, BlackBeltScript_0x9ba21, EVENT_OPENED_MT_SILVER + person_event SPRITE_BLACK_BELT, 5, 12, $8, 0, 0, -1, -1, 0, 0, 0, BlackBeltScript_0x9ba24, EVENT_FOUGHT_SNORLAX diff --git a/maps/VioletCity.asm b/maps/VioletCity.asm index d28ea9ba6..18207d968 100644 --- a/maps/VioletCity.asm +++ b/maps/VioletCity.asm @@ -301,11 +301,11 @@ VioletCity_MapEventHeader: .PersonEvents: db 8 - person_event SPRITE_FISHER, 20, 17, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, FisherScript_0x1a83bb, EVENT_VIOLET_CITY_EARL - person_event SPRITE_LASS, 32, 32, $2, 2, 2, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LassScript_0x1a8403, -1 - person_event SPRITE_SUPER_NERD, 18, 28, $2, 2, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, SuperNerdScript_0x1a8406, -1 - person_event SPRITE_GRAMPS, 24, 21, $5, 0, 1, -1, -1, 0, 0, 0, GrampsScript_0x1a8409, -1 - person_event SPRITE_YOUNGSTER, 22, 9, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x1a840c, -1 - person_event SPRITE_FRUIT_TREE, 33, 18, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a8425, -1 - person_event SPRITE_POKE_BALL, 5, 8, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a8421, EVENT_VIOLET_CITY_PP_UP - person_event SPRITE_POKE_BALL, 9, 39, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a8423, EVENT_VIOLET_CITY_RARE_CANDY + person_event SPRITE_FISHER, 16, 13, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, FisherScript_0x1a83bb, EVENT_VIOLET_CITY_EARL + person_event SPRITE_LASS, 28, 28, $2, 2, 2, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LassScript_0x1a8403, -1 + person_event SPRITE_SUPER_NERD, 14, 24, $2, 2, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SuperNerdScript_0x1a8406, -1 + person_event SPRITE_GRAMPS, 20, 17, $5, 0, 1, -1, -1, 0, 0, 0, GrampsScript_0x1a8409, -1 + person_event SPRITE_YOUNGSTER, 18, 5, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x1a840c, -1 + person_event SPRITE_FRUIT_TREE, 29, 14, $1, 0, 0, -1, -1, 0, 0, 0, FruitTreeScript_0x1a8425, -1 + person_event SPRITE_POKE_BALL, 1, 4, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a8421, EVENT_VIOLET_CITY_PP_UP + person_event SPRITE_POKE_BALL, 5, 35, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x1a8423, EVENT_VIOLET_CITY_RARE_CANDY diff --git a/maps/VioletGym.asm b/maps/VioletGym.asm index 8d53a14d3..a3b051511 100644 --- a/maps/VioletGym.asm +++ b/maps/VioletGym.asm @@ -31,7 +31,7 @@ FalknerScript_0x683c2: setevent EVENT_BEAT_BIRD_KEEPER_ROD setevent EVENT_BEAT_BIRD_KEEPER_ABE domaptrigger ELMS_LAB, $2 - specialphonecall ELMCALL_ASSISTANT + specialphonecall SPECIALCALL_ASSISTANT writetext UnknownText_0x685c8 keeptextopen verbosegiveitem TM_MUD_SLAP, 1 @@ -294,7 +294,7 @@ VioletGym_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_FALKNER, 5, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, FalknerScript_0x683c2, -1 - person_event SPRITE_YOUNGSTER, 10, 11, $8, 0, 2, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerBird_keeperRod, -1 - person_event SPRITE_YOUNGSTER, 14, 6, $9, 0, 2, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerBird_keeperAbe, -1 - person_event SPRITE_GYM_GUY, 17, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, VioletGymGuyScript, -1 + person_event SPRITE_FALKNER, 1, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, FalknerScript_0x683c2, -1 + person_event SPRITE_YOUNGSTER, 6, 7, $8, 0, 2, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerBird_keeperRod, -1 + person_event SPRITE_YOUNGSTER, 10, 2, $9, 0, 2, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerBird_keeperAbe, -1 + person_event SPRITE_GYM_GUY, 13, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, VioletGymGuyScript, -1 diff --git a/maps/VioletMart.asm b/maps/VioletMart.asm index 135869331..cd878e8ba 100644 --- a/maps/VioletMart.asm +++ b/maps/VioletMart.asm @@ -60,6 +60,6 @@ VioletMart_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x68295, -1 - person_event SPRITE_GRANNY, 10, 11, $5, 0, 1, -1, -1, 0, 0, 0, GrannyScript_0x6829c, -1 - person_event SPRITE_COOLTRAINER_M, 6, 9, $3, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerMScript_0x6829f, -1 + person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x68295, -1 + person_event SPRITE_GRANNY, 6, 7, $5, 0, 1, -1, -1, 0, 0, 0, GrannyScript_0x6829c, -1 + person_event SPRITE_COOLTRAINER_M, 2, 5, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerMScript_0x6829f, -1 diff --git a/maps/VioletNicknameSpeechHouse.asm b/maps/VioletNicknameSpeechHouse.asm index fcb7cadb0..5447e3019 100644 --- a/maps/VioletNicknameSpeechHouse.asm +++ b/maps/VioletNicknameSpeechHouse.asm @@ -56,6 +56,6 @@ VioletNicknameSpeechHouse_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_TEACHER, 7, 6, $9, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x693e9, -1 - person_event SPRITE_LASS, 8, 10, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LassScript_0x693ec, -1 - person_event SPRITE_BIRD, 6, 9, $5, 0, 1, -1, -1, 8 + PAL_OW_BROWN, 0, 0, BirdScript_0x693ef, -1 + person_event SPRITE_TEACHER, 3, 2, $9, 0, 0, -1, -1, 0, 0, 0, TeacherScript_0x693e9, -1 + person_event SPRITE_LASS, 4, 6, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LassScript_0x693ec, -1 + person_event SPRITE_BIRD, 2, 5, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, BirdScript_0x693ef, -1 diff --git a/maps/VioletOnixTradeHouse.asm b/maps/VioletOnixTradeHouse.asm index 71e0b68de..134c561df 100644 --- a/maps/VioletOnixTradeHouse.asm +++ b/maps/VioletOnixTradeHouse.asm @@ -45,5 +45,5 @@ VioletOnixTradeHouse_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_POKEFAN_M, 7, 6, $3, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x6998d, -1 - person_event SPRITE_YOUNGSTER, 9, 10, $4, 2, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x69990, -1 + person_event SPRITE_POKEFAN_M, 3, 2, $3, 0, 0, -1, -1, 0, 0, 0, PokefanMScript_0x6998d, -1 + person_event SPRITE_YOUNGSTER, 5, 6, $4, 2, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x69990, -1 diff --git a/maps/VioletPokeCenter1F.asm b/maps/VioletPokeCenter1F.asm index 7b39f3334..3172efbcb 100644 --- a/maps/VioletPokeCenter1F.asm +++ b/maps/VioletPokeCenter1F.asm @@ -226,8 +226,8 @@ VioletPokeCenter1F_MapEventHeader: .PersonEvents: db 5 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x694c9, -1 - person_event SPRITE_GAMEBOY_KID, 10, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, GameboyKidScript_0x69540, -1 - person_event SPRITE_GENTLEMAN, 8, 5, $3, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x69543, -1 - person_event SPRITE_YOUNGSTER, 5, 12, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, YoungsterScript_0x69546, -1 - person_event SPRITE_SCIENTIST, 7, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ScientistScript_0x694cc, EVENT_ELMS_AIDE_IN_VIOLET_POKEMON_CENTER + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x694c9, -1 + person_event SPRITE_GAMEBOY_KID, 6, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, GameboyKidScript_0x69540, -1 + person_event SPRITE_GENTLEMAN, 4, 1, $3, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x69543, -1 + person_event SPRITE_YOUNGSTER, 1, 8, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, YoungsterScript_0x69546, -1 + person_event SPRITE_SCIENTIST, 3, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ScientistScript_0x694cc, EVENT_ELMS_AIDE_IN_VIOLET_POKEMON_CENTER diff --git a/maps/ViridianCity.asm b/maps/ViridianCity.asm index 800425067..2ebd02c77 100644 --- a/maps/ViridianCity.asm +++ b/maps/ViridianCity.asm @@ -237,7 +237,7 @@ ViridianCity_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_GRAMPS, 9, 22, $2, 2, 2, -1, -1, 0, 0, 0, GrampsScript_0x1a9a4c, -1 - person_event SPRITE_GRAMPS, 12, 34, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GrampsScript_0x1a9a61, -1 - person_event SPRITE_FISHER, 27, 10, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, FisherScript_0x1a9a75, -1 - person_event SPRITE_YOUNGSTER, 25, 21, $2, 3, 3, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x1a9a90, -1 + person_event SPRITE_GRAMPS, 5, 18, $2, 2, 2, -1, -1, 0, 0, 0, GrampsScript_0x1a9a4c, -1 + person_event SPRITE_GRAMPS, 8, 30, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GrampsScript_0x1a9a61, -1 + person_event SPRITE_FISHER, 23, 6, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, FisherScript_0x1a9a75, -1 + person_event SPRITE_YOUNGSTER, 21, 17, $2, 3, 3, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x1a9a90, -1 diff --git a/maps/ViridianGym.asm b/maps/ViridianGym.asm index 99c825336..250893807 100644 --- a/maps/ViridianGym.asm +++ b/maps/ViridianGym.asm @@ -183,5 +183,5 @@ ViridianGym_MapEventHeader: .PersonEvents: db 2 - person_event SPRITE_BLUE, 7, 9, $6, 0, 0, -1, -1, 0, 0, 0, BlueScript_0x9aa26, EVENT_VIRIDIAN_GYM_BLUE - person_event SPRITE_GYM_GUY, 17, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ViridianGymGuyScript, EVENT_VIRIDIAN_GYM_BLUE + person_event SPRITE_BLUE, 3, 5, $6, 0, 0, -1, -1, 0, 0, 0, BlueScript_0x9aa26, EVENT_VIRIDIAN_GYM_BLUE + person_event SPRITE_GYM_GUY, 13, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ViridianGymGuyScript, EVENT_VIRIDIAN_GYM_BLUE diff --git a/maps/ViridianMart.asm b/maps/ViridianMart.asm index c3065d196..8ca273ce0 100644 --- a/maps/ViridianMart.asm +++ b/maps/ViridianMart.asm @@ -48,6 +48,6 @@ ViridianMart_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x9b5e7, -1 - person_event SPRITE_LASS, 6, 11, $5, 0, 2, -1, -1, 0, 0, 0, LassScript_0x9b5ee, -1 - person_event SPRITE_COOLTRAINER_M, 10, 5, $7, 0, 0, -1, -1, 0, 0, 0, CooltrainerMScript_0x9b5f1, -1 + person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x9b5e7, -1 + person_event SPRITE_LASS, 2, 7, $5, 0, 2, -1, -1, 0, 0, 0, LassScript_0x9b5ee, -1 + person_event SPRITE_COOLTRAINER_M, 6, 1, $7, 0, 0, -1, -1, 0, 0, 0, CooltrainerMScript_0x9b5f1, -1 diff --git a/maps/ViridianNicknameSpeechHouse.asm b/maps/ViridianNicknameSpeechHouse.asm index 543917503..c7aa1e073 100644 --- a/maps/ViridianNicknameSpeechHouse.asm +++ b/maps/ViridianNicknameSpeechHouse.asm @@ -72,7 +72,7 @@ ViridianNicknameSpeechHouse_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_POKEFAN_M, 8, 6, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, PokefanMScript_0x9ae3a, -1 - person_event SPRITE_LASS, 8, 9, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LassScript_0x9ae3d, -1 - person_event SPRITE_MOLTRES, 6, 9, $16, 0, 2, -1, -1, 8 + PAL_OW_BROWN, 0, 0, MoltresScript_0x9ae40, -1 - person_event SPRITE_GROWLITHE, 7, 10, $16, 0, 2, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GrowlitheScript_0x9ae4a, -1 + person_event SPRITE_POKEFAN_M, 4, 2, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, PokefanMScript_0x9ae3a, -1 + person_event SPRITE_LASS, 4, 5, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, LassScript_0x9ae3d, -1 + person_event SPRITE_MOLTRES, 2, 5, $16, 0, 2, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, MoltresScript_0x9ae40, -1 + person_event SPRITE_GROWLITHE, 3, 6, $16, 0, 2, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GrowlitheScript_0x9ae4a, -1 diff --git a/maps/ViridianPokeCenter1F.asm b/maps/ViridianPokeCenter1F.asm index 851a57835..1c44183f7 100644 --- a/maps/ViridianPokeCenter1F.asm +++ b/maps/ViridianPokeCenter1F.asm @@ -83,7 +83,7 @@ ViridianPokeCenter1F_MapEventHeader: .PersonEvents: db 4 - person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x9b690, -1 - person_event SPRITE_COOLTRAINER_M, 8, 12, $5, 0, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerMScript_0x9b693, -1 - person_event SPRITE_COOLTRAINER_F, 7, 9, $7, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, CooltrainerFScript_0x9b6a7, -1 - person_event SPRITE_BUG_CATCHER, 10, 5, $9, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, BugCatcherScript_0x9b6aa, -1 + person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x9b690, -1 + person_event SPRITE_COOLTRAINER_M, 4, 8, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerMScript_0x9b693, -1 + person_event SPRITE_COOLTRAINER_F, 3, 5, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, CooltrainerFScript_0x9b6a7, -1 + person_event SPRITE_BUG_CATCHER, 6, 1, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, BugCatcherScript_0x9b6aa, -1 diff --git a/maps/WarehouseEntrance.asm b/maps/WarehouseEntrance.asm index 7d30179da..0d1b786d3 100644 --- a/maps/WarehouseEntrance.asm +++ b/maps/WarehouseEntrance.asm @@ -669,12 +669,12 @@ WarehouseEntrance_MapEventHeader: .PersonEvents: db 9 - person_event SPRITE_SUPER_NERD, 35, 9, $8, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerSupernerdEric, -1 - person_event SPRITE_SUPER_NERD, 13, 10, $7, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerSupernerdTeru, -1 - person_event SPRITE_SUPER_NERD, 31, 7, $a, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, TrainerPokemaniacIssac, -1 - person_event SPRITE_SUPER_NERD, 10, 6, $9, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 3, TrainerPokemaniacDonald, -1 - person_event SPRITE_POKE_BALL, 29, 11, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7c306, EVENT_WAREHOUSE_ENTRANCE_COIN_CASE - person_event SPRITE_GRAMPS, 15, 11, $8, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, GrampsScript_0x7c146, EVENT_WAREHOUSE_ENTRANCE_GRAMPS - person_event SPRITE_SUPER_NERD, 18, 11, $8, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, OlderHaircutBrotherScript, EVENT_WAREHOUSE_ENTRANCE_OLDER_HAIRCUT_BROTHER - person_event SPRITE_SUPER_NERD, 19, 11, $8, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungerHaircutBrotherScript, EVENT_WAREHOUSE_ENTRANCE_YOUNGER_HAIRCUT_BROTHER - person_event SPRITE_GRANNY, 25, 11, $8, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, GrannyScript_0x7c132, EVENT_WAREHOUSE_ENTRANCE_GRANNY + person_event SPRITE_SUPER_NERD, 31, 5, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerSupernerdEric, -1 + person_event SPRITE_SUPER_NERD, 9, 6, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerSupernerdTeru, -1 + person_event SPRITE_SUPER_NERD, 27, 3, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 2, TrainerPokemaniacIssac, -1 + person_event SPRITE_SUPER_NERD, 6, 2, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 2, 3, TrainerPokemaniacDonald, -1 + person_event SPRITE_POKE_BALL, 25, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x7c306, EVENT_WAREHOUSE_ENTRANCE_COIN_CASE + person_event SPRITE_GRAMPS, 11, 7, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, GrampsScript_0x7c146, EVENT_WAREHOUSE_ENTRANCE_GRAMPS + person_event SPRITE_SUPER_NERD, 14, 7, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, OlderHaircutBrotherScript, EVENT_WAREHOUSE_ENTRANCE_OLDER_HAIRCUT_BROTHER + person_event SPRITE_SUPER_NERD, 15, 7, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungerHaircutBrotherScript, EVENT_WAREHOUSE_ENTRANCE_YOUNGER_HAIRCUT_BROTHER + person_event SPRITE_GRANNY, 21, 7, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, GrannyScript_0x7c132, EVENT_WAREHOUSE_ENTRANCE_GRANNY diff --git a/maps/WhirlIslandB1F.asm b/maps/WhirlIslandB1F.asm index 041fd33c3..bae2a02e1 100644 --- a/maps/WhirlIslandB1F.asm +++ b/maps/WhirlIslandB1F.asm @@ -62,9 +62,9 @@ WhirlIslandB1F_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_POKE_BALL, 17, 11, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c410, EVENT_WHIRL_ISLAND_B1F_FULL_RESTORE - person_event SPRITE_POKE_BALL, 22, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c412, EVENT_WHIRL_ISLAND_B1F_CARBOS - person_event SPRITE_POKE_BALL, 27, 37, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c414, EVENT_WHIRL_ISLAND_B1F_CALCIUM - person_event SPRITE_POKE_BALL, 12, 21, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c416, EVENT_WHIRL_ISLAND_B1F_NUGGET - person_event SPRITE_POKE_BALL, 30, 23, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c418, EVENT_WHIRL_ISLAND_B1F_ESCAPE_ROPE - person_event SPRITE_BOULDER, 30, 27, $19, 0, 0, -1, -1, 0, 0, 0, WhirlIslandB1FBoulder, -1 + person_event SPRITE_POKE_BALL, 13, 7, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c410, EVENT_WHIRL_ISLAND_B1F_FULL_RESTORE + person_event SPRITE_POKE_BALL, 18, 2, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c412, EVENT_WHIRL_ISLAND_B1F_CARBOS + person_event SPRITE_POKE_BALL, 23, 33, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c414, EVENT_WHIRL_ISLAND_B1F_CALCIUM + person_event SPRITE_POKE_BALL, 8, 17, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c416, EVENT_WHIRL_ISLAND_B1F_NUGGET + person_event SPRITE_POKE_BALL, 26, 19, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c418, EVENT_WHIRL_ISLAND_B1F_ESCAPE_ROPE + person_event SPRITE_BOULDER, 26, 23, $19, 0, 0, -1, -1, 0, 0, 0, WhirlIslandB1FBoulder, -1 diff --git a/maps/WhirlIslandB2F.asm b/maps/WhirlIslandB2F.asm index d82a646b2..091dc6f15 100644 --- a/maps/WhirlIslandB2F.asm +++ b/maps/WhirlIslandB2F.asm @@ -33,6 +33,6 @@ WhirlIslandB2F_MapEventHeader: .PersonEvents: db 3 - person_event SPRITE_POKE_BALL, 15, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c4b8, EVENT_WHIRL_ISLAND_B2F_FULL_RESTORE - person_event SPRITE_POKE_BALL, 8, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c4ba, EVENT_WHIRL_ISLAND_B2F_MAX_REVIVE - person_event SPRITE_POKE_BALL, 16, 9, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c4bc, EVENT_WHIRL_ISLAND_B2F_MAX_ELIXER + person_event SPRITE_POKE_BALL, 11, 10, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c4b8, EVENT_WHIRL_ISLAND_B2F_FULL_RESTORE + person_event SPRITE_POKE_BALL, 4, 6, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c4ba, EVENT_WHIRL_ISLAND_B2F_MAX_REVIVE + person_event SPRITE_POKE_BALL, 12, 5, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c4bc, EVENT_WHIRL_ISLAND_B2F_MAX_ELIXER diff --git a/maps/WhirlIslandLugiaChamber.asm b/maps/WhirlIslandLugiaChamber.asm index 8e75e811a..e92fac760 100644 --- a/maps/WhirlIslandLugiaChamber.asm +++ b/maps/WhirlIslandLugiaChamber.asm @@ -59,4 +59,4 @@ WhirlIslandLugiaChamber_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_LUGIA, 9, 13, $16, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, LugiaScript_0x18c518, EVENT_WHIRL_ISLAND_LUGIA_CHAMBER_LUGIA + person_event SPRITE_LUGIA, 5, 9, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, LugiaScript_0x18c518, EVENT_WHIRL_ISLAND_LUGIA_CHAMBER_LUGIA diff --git a/maps/WhirlIslandNE.asm b/maps/WhirlIslandNE.asm index 169f14a0e..dce035731 100644 --- a/maps/WhirlIslandNE.asm +++ b/maps/WhirlIslandNE.asm @@ -26,4 +26,4 @@ WhirlIslandNE_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKE_BALL, 15, 15, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c396, EVENT_WHIRL_ISLAND_NE_ULTRA_BALL + person_event SPRITE_POKE_BALL, 11, 11, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c396, EVENT_WHIRL_ISLAND_NE_ULTRA_BALL diff --git a/maps/WhirlIslandSW.asm b/maps/WhirlIslandSW.asm index 8107d24b5..e8132d1fb 100644 --- a/maps/WhirlIslandSW.asm +++ b/maps/WhirlIslandSW.asm @@ -28,4 +28,4 @@ WhirlIslandSW_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_POKE_BALL, 6, 19, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c3bc, EVENT_WHIRL_ISLAND_SW_ULTRA_BALL + person_event SPRITE_POKE_BALL, 2, 15, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x18c3bc, EVENT_WHIRL_ISLAND_SW_ULTRA_BALL diff --git a/maps/WillsRoom.asm b/maps/WillsRoom.asm index dc79a9195..6bc754d8f 100644 --- a/maps/WillsRoom.asm +++ b/maps/WillsRoom.asm @@ -148,4 +148,4 @@ WillsRoom_MapEventHeader: .PersonEvents: db 1 - person_event SPRITE_WILL, 11, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, WillScript_0x1804f8, -1 + person_event SPRITE_WILL, 7, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, WillScript_0x1804f8, -1 diff --git a/maps/WiseTriosRoom.asm b/maps/WiseTriosRoom.asm index b05162fc6..783dd397c 100644 --- a/maps/WiseTriosRoom.asm +++ b/maps/WiseTriosRoom.asm @@ -360,9 +360,9 @@ WiseTriosRoom_MapEventHeader: .PersonEvents: db 6 - person_event SPRITE_SAGE, 6, 10, $3, 0, 0, -1, -1, 0, 0, 0, SageScript_0x9859a, EVENT_WISE_TRIOS_ROOM_WISE_TRIO_1 - person_event SPRITE_SAGE, 11, 10, $5, 0, 1, -1, -1, 0, 0, 0, SageScript_0x9859d, EVENT_WISE_TRIOS_ROOM_WISE_TRIO_1 - person_event SPRITE_SAGE, 9, 11, $8, 0, 0, -1, -1, 0, 0, 0, SageScript_0x985a0, EVENT_WISE_TRIOS_ROOM_WISE_TRIO_1 - person_event SPRITE_SAGE, 6, 8, $6, 0, 0, -1, -1, 0, 2, 2, TrainerSageGaku, EVENT_WISE_TRIOS_ROOM_WISE_TRIO_2 - person_event SPRITE_SAGE, 10, 8, $7, 0, 0, -1, -1, 0, 2, 2, TrainerSageMasa, EVENT_WISE_TRIOS_ROOM_WISE_TRIO_2 - person_event SPRITE_SAGE, 8, 10, $8, 0, 0, -1, -1, 0, 2, 2, TrainerSageKoji, EVENT_WISE_TRIOS_ROOM_WISE_TRIO_2 + person_event SPRITE_SAGE, 2, 6, $3, 0, 0, -1, -1, 0, 0, 0, SageScript_0x9859a, EVENT_WISE_TRIOS_ROOM_WISE_TRIO_1 + person_event SPRITE_SAGE, 7, 6, $5, 0, 1, -1, -1, 0, 0, 0, SageScript_0x9859d, EVENT_WISE_TRIOS_ROOM_WISE_TRIO_1 + person_event SPRITE_SAGE, 5, 7, $8, 0, 0, -1, -1, 0, 0, 0, SageScript_0x985a0, EVENT_WISE_TRIOS_ROOM_WISE_TRIO_1 + person_event SPRITE_SAGE, 2, 4, $6, 0, 0, -1, -1, 0, 2, 2, TrainerSageGaku, EVENT_WISE_TRIOS_ROOM_WISE_TRIO_2 + person_event SPRITE_SAGE, 6, 4, $7, 0, 0, -1, -1, 0, 2, 2, TrainerSageMasa, EVENT_WISE_TRIOS_ROOM_WISE_TRIO_2 + person_event SPRITE_SAGE, 4, 6, $8, 0, 0, -1, -1, 0, 2, 2, TrainerSageKoji, EVENT_WISE_TRIOS_ROOM_WISE_TRIO_2 diff --git a/misc/crystal_misc.asm b/misc/crystal_misc.asm index 67bef18bc..956ee30dd 100644 --- a/misc/crystal_misc.asm +++ b/misc/crystal_misc.asm @@ -19,6 +19,7 @@ Function17a68f:: ; 17a68f (5e:668f) pop de xor a ret + .asm_17a6a6 scf ret @@ -82,6 +83,7 @@ Function17a713: ; 17a713 (5e:6713) inc c and a ret + .asm_17a71d ld [hl], $ff scf @@ -113,10 +115,12 @@ Function17a721: ; 17a721 (5e:6721) dec b jr nz, .asm_17a732 ret + .asm_17a748 ld a, $ff ld [de], a ret + .asm_17a74c ld a, $f0 or c @@ -151,13 +155,13 @@ Function17a770: ; 17a770 (5e:6770) ret Function17a781: ; 17a781 (5e:6781) - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a - call Functiona57 + ld [hInMenu], a + call JoyTextDelay pop af - ld [$ffaa], a + ld [hInMenu], a ret Function17a78f: ; 17a78f (5e:678f) @@ -167,6 +171,7 @@ Function17a78f: ; 17a78f (5e:678f) jr nz, .asm_17a79f callba Function10402d ret + .asm_17a79f callba Function104061 ret @@ -261,7 +266,7 @@ Function17a81a: ; 17a81a (5e:681a) ret Function17a83c: ; 17a83c (5e:683c) - ld a, [$ffa9] + ld a, [hJoyLast] and $f0 ld c, a ld a, [hJoyPressed] ; $ff00+$a7 @@ -297,41 +302,49 @@ Function17a848: ; 17a848 (5e:6848) jr nz, .asm_17a8a7 xor a ret + .asm_17a876 ld a, $9 call Function17aad0 scf ret + .asm_17a87d ld a, $a call Function17aad0 scf ret + .asm_17a884 ld a, $b call Function17aad0 scf ret + .asm_17a88b ld a, $c call Function17aad0 scf ret + .asm_17a892 ld a, $5 call Function17aad0 scf ret + .asm_17a899 ld a, $6 call Function17aad0 scf ret + .asm_17a8a0 ld a, $7 call Function17aad0 scf ret + .asm_17a8a7 ld a, $8 call Function17aad0 @@ -347,6 +360,7 @@ Function17a8ae: ; 17a8ae (5e:68ae) jr nz, .asm_17a8d7 xor a ret + .asm_17a8bc ld a, $b ld [$d08a], a @@ -355,12 +369,14 @@ Function17a8ae: ; 17a8ae (5e:68ae) call Function17aa88 scf ret + .asm_17a8cc call Function17aad7 call Function17aa98 call Function17a8de scf ret + .asm_17a8d7 ld a, $c call Function17aad3 @@ -383,16 +399,19 @@ Function17a8de: ; 17a8de (5e:68de) ld [$d087], a call Function17aa88 ret + .asm_17a8fd call Function17a943 call Function17aa88 ret + .asm_17a904 call Function17aad7 call Function17aa98 call Function17a91e call Function17aa88 ret + .asm_17a911 call Function17aa98 ld a, $5 @@ -409,6 +428,7 @@ Function17a91e: ; 17a91e (5e:691e) ld [$d087], a xor a ret + .asm_17a92c call Function1d6e call Function17a99e @@ -436,6 +456,7 @@ Function17a943: ; 17a943 (5e:6943) ld [$d087], a and a ret + .asm_17a95d ld a, $5 ld [$d087], a @@ -455,6 +476,7 @@ Function17a964: ; 17a964 (5e:6964) ld [hl], e and a ret + .asm_17a979 scf ret @@ -479,6 +501,7 @@ Function17a97b: ; 17a97b (5e:697b) dec c jr nz, .asm_17a990 ret + .asm_17a99d ret @@ -503,12 +526,13 @@ Function17a9cb: ; 17a9cb (5e:69cb) ld de, Sprites ; $c400 ld hl, $d088 bit 6, [hl] - jr nz, .asm_17a9df + jr nz, .bit_6_set call Function17a9e3 call Function17aa22 call Function17a9f5 ret -.asm_17a9df + +.bit_6_set call Function17a9e3 ret @@ -533,9 +557,9 @@ Function17a9f5: ; 17a9f5 (5e:69f5) ld [$d08e], a ld a, [$d08c] cp $10 - jr c, .asm_17aa0f + jr c, .okay dec a -.asm_17aa0f +.okay ld c, $8 call SimpleMultiply add $18 @@ -581,7 +605,7 @@ Function17aa4a: ; 17aa4a (5e:6a4a) add $10 ld c, a ld a, [hli] -.asm_17aa56 +.loop push af ld a, [hli] add c @@ -603,7 +627,7 @@ Function17aa4a: ; 17aa4a (5e:6a4a) inc de pop af dec a - jr nz, .asm_17aa56 + jr nz, .loop ret ; 17aa72 (5e:6a72) @@ -662,7 +686,7 @@ rept 2 ld [hli], a endr pop hl - ld de, $14 + ld de, SCREEN_WIDTH add hl, de rept 2 ld [hli], a @@ -721,17 +745,21 @@ Function17aba0: ; 17aba0 (5e:6ba0) push af ld a, $1 ld [rVBK], a ; $ff00+$4f - ld hl, $9000 + + ld hl, VTiles5 tile $00 ld de, GFX_17afa5 lb bc, BANK(GFX_17afa5), $80 call Get2bpp + pop af ld [rVBK], a ; $ff00+$4f - ld hl, $8000 + + ld hl, VTiles0 tile $00 ld de, GFX_17afa5 + $4c0 lb bc, BANK(GFX_17afa5), 5 call Get2bpp - ld hl, $8050 + + ld hl, VTiles0 tile $05 ld de, GFX_11601a lb bc, BANK(GFX_11601a), 4 call Get2bpp @@ -740,25 +768,30 @@ Function17aba0: ; 17aba0 (5e:6ba0) Function17abcf: ; 17abcf (5e:6bcf) ld a, [rSVBK] ; $ff00+$70 push af - ld a, $5 + ld a, BANK(Unkn1Pals) ld [rSVBK], a ; $ff00+$70 + ld hl, Palette_17ac55 ld de, Unkn1Pals ; $d000 ld bc, $30 call CopyBytes + ld hl, Palette_17ac95 ld de, Unkn2Pals ld bc, $40 call CopyBytes + ld hl, GFX_17afa5 + $510 - ld de, $d048 + ld de, Unkn2Pals + 2 * 4 ld bc, $10 call CopyBytes + ld hl, MapObjectPals + 8 - ld de, $d058 + ld de, Unkn2Pals + 6 * 4 ld bc, $8 ld a, BANK(MapObjectPals) call FarCopyBytes + pop af ld [rSVBK], a ; $ff00+$70 ret @@ -767,42 +800,43 @@ Function17ac0c: ; 17ac0c (5e:6c0c) call Function17ac1d call Function17ac2a hlcoord 0, 0 - ld b, $2 - ld c, $12 + ld b, 2 + ld c, SCREEN_WIDTH - 2 call Function17ac46 ret Function17ac1d: ; 17ac1d (5e:6c1d) ld hl, Tilemap_17acd5 decoord 0, 4 - ld bc, $118 + ld bc, (SCREEN_HEIGHT - 4) * SCREEN_WIDTH call CopyBytes ret Function17ac2a: ; 17ac2a (5e:6c2a) ld hl, Tilemap_17ae3d decoord 0, 4, AttrMap - ld bc, $118 + ld bc, (SCREEN_HEIGHT - 4) * SCREEN_WIDTH call CopyBytes hlcoord 0, 4, AttrMap - ld bc, $118 -.asm_17ac3c + ld bc, (SCREEN_HEIGHT - 4) * SCREEN_WIDTH +.loop ld a, [hl] or $8 ld [hli], a dec bc ld a, b or c - jr nz, .asm_17ac3c + jr nz, .loop ret Function17ac46: ; 17ac46 (5e:6c46) ld a, [$d088] bit 4, a - jr nz, .asm_17ac51 + jr nz, .bit_4_set call TextBox ret -.asm_17ac51 + +.bit_4_set call Function3eea ret ; 17ac55 (5e:6c55) @@ -812,30 +846,37 @@ Palette_17ac55: ; 17ac55 RGB 9, 10, 25 RGB 16, 19, 31 RGB 31, 31, 31 + RGB 5, 11, 9 RGB 7, 14, 12 RGB 17, 24, 22 RGB 28, 31, 31 + RGB 0, 0, 0 RGB 3, 0, 10 RGB 3, 3, 16 RGB 6, 8, 25 + RGB 5, 11, 9 RGB 28, 31, 31 RGB 7, 14, 12 RGB 17, 24, 22 + RGB 0, 0, 0 RGB 5, 2, 16 RGB 8, 8, 26 RGB 13, 9, 17 + RGB 0, 0, 0 RGB 0, 0, 0 RGB 0, 0, 0 RGB 0, 0, 0 + RGB 0, 0, 0 RGB 0, 0, 0 RGB 0, 0, 0 RGB 0, 0, 0 + RGB 0, 0, 0 RGB 0, 0, 0 RGB 0, 0, 0 @@ -846,30 +887,37 @@ Palette_17ac95: ; 17ac95 RGB 4, 3, 3 RGB 31, 13, 0 RGB 31, 31, 31 + RGB 31, 31, 31 RGB 0, 0, 0 RGB 31, 31, 31 RGB 31, 31, 31 + RGB 31, 0, 0 RGB 16, 3, 0 RGB 28, 19, 11 RGB 31, 31, 31 + RGB 31, 16, 0 RGB 9, 6, 4 RGB 31, 16, 0 RGB 31, 24, 0 + RGB 31, 18, 6 RGB 0, 3, 0 RGB 0, 9, 0 RGB 0, 12, 0 + RGB 0, 16, 0 RGB 0, 22, 0 RGB 0, 25, 0 RGB 0, 27, 0 + RGB 0, 31, 0 RGB 3, 31, 0 RGB 8, 31, 0 RGB 14, 31, 0 + RGB 16, 31, 0 RGB 22, 31, 0 RGB 27, 31, 0 diff --git a/misc/mobile_22.asm b/misc/mobile_22.asm new file mode 100644 index 000000000..1991580c5 --- /dev/null +++ b/misc/mobile_22.asm @@ -0,0 +1,4435 @@ + +String_8911c: ; 8911c + db "でんわばんごうが ただしく" ; Phone number is not + next "はいって いません!@" ; entered correctly! +; 89135 + +String_89135: ; 89135 + db "データが かわって いますが" ; The data has changed. + next "かきかえないで やめますか?@" ; Quit anyway? +; 89153 + +String_89153: ; 89153 + db "メッセージは ありません@" ; No message +; 89160 + +OpenSRAMBank4: ; 89160 + push af + ld a, $4 + call GetSRAMBank + pop af + ret +; 89168 + + +Function89168: ; 89168 (22:5168) + ld hl, GameTimerPause + set 7, [hl] + ret + +Function8916e: ; 8916e (22:516e) + ld hl, GameTimerPause + res 7, [hl] + ret + +Function89174: ; 89174 (22:5174) + ld hl, GameTimerPause + bit 7, [hl] + ret + +Function8917a: ; 8917a (22:517a) + ld hl, DefaultFlypoint + ld bc, $32 + xor a + call ByteFill + ret + +Function89185: ; 89185 (22:5185) +; Compares c bytes starting at de and hl and incrementing together until a match is found. + push de + push hl +.loop + ld a, [de] + inc de + cp [hl] + jr nz, .done + inc hl + dec c + jr nz, .loop +.done + pop hl + pop de + ret + +Function89193: ; 89193 +; Copies c bytes from hl to de. + push de + push hl +.loop + ld a, [hli] + ld [de], a + inc de + dec c + jr nz, .loop + pop hl + pop de + ret +; 8919e + + +Function8919e: ; 8919e (22:519e) +; Searches for the c'th string starting at de. Returns the pointer in de. + ld a, c + and a + ret z +.loop + ld a, [de] + inc de + cp "@" + jr nz, .loop + dec c + jr nz, .loop + ret + +Function891ab: ; 891ab + call Function89240 + callba Function104061 + call Function8923c + ret +; 891b8 + +Function891b8: ; 891b8 + call Function8923c + hlcoord 0, 0 + ld a, " " + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + call ByteFill + call DelayFrame + ret +; 891ca + + +Function891ca: ; 891ca (22:51ca) + push bc + call Function891b8 + call WaitBGMap + pop bc + ret + +Function891d3: ; 891d3 (22:51d3) + push bc + call Function891ca + ld c, $10 + call DelayFrames + pop bc + ret + +Function891de: ; 891de + call Function8923c + call ClearPalettes + hlcoord 0, 0, AttrMap + ld a, $7 + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + call ByteFill + hlcoord 0, 0 + ld a, " " + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + call ByteFill + call Function891ab + ret +; 891fe + +Function891fe: ; 891fe + push bc + call Function891de + ld c, $10 + call DelayFrames + pop bc + ret +; 89209 + +Function89209: ; 89209 + ld a, 1 + ld [wc2ce], a + ret +; 8920f + +Function8920f: ; 8920f + ld a, 0 + ld [wc2ce], a + ret +; 89215 + +Function89215: ; 89215 + push hl + push bc + ld bc, AttrMap - TileMap + add hl, bc + ld [hl], a + pop bc + pop hl + ret +; 8921f + + +Function8921f: ; 8921f (22:521f) + push de + ld de, SCREEN_WIDTH + add hl, de + inc hl + ld a, $7f +.loop + push bc + push hl +.asm_89229 + ld [hli], a + dec c + jr nz, .asm_89229 + pop hl + add hl, de + pop bc + dec b + jr nz, .loop + pop de + ret + +Function89235: ; 89235 (22:5235) + call JoyWaitAorB + call PlayClickSFX + ret + +Function8923c: ; 8923c + xor a + ld [hBGMapMode], a + ret +; 89240 + +Function89240: ; 89240 + ld a, $1 + ld [hBGMapMode], a + ret +; 89245 + + +Function89245: ; 89245 (22:5245) + callba TryLoadSaveFile + ret c + callba Function150b9 + and a + ret + +Function89254: ; 89254 (22:5254) + ld bc, $d07 + jr Function89261 + +Function89259: ; 89259 + ld bc, $0e07 + jr Function89261 + +Function8925e: ; 8925e + ld bc, $0e0c + +Function89261: ; 89261 + push af + push bc + ld hl, MenuDataHeader_0x892a3 + call CopyMenuDataHeader + pop bc + ld hl, wMenuBorderTopCoord + ld a, c + ld [hli], a + ld a, b + ld [hli], a + ld a, c + add $4 + ld [hli], a + ld a, b + add $5 + ld [hl], a + pop af + ld [wPocketCursorBuffer], a + call BackUpTiles + call Function8923c + call Function89209 + call InterpretMenu2 + push af + ld c, $a + call DelayFrames + call WriteBackup + call Function8920f + pop af + jr c, .done + ld a, [wcfa9] + cp $2 + jr z, .done + and a + ret + +.done + scf + ret +; 892a3 + +MenuDataHeader_0x892a3: ; 0x892a3 + db $40 ; flags + db 05, 10 ; start coords + db 09, 15 ; end coords + dw MenuData2_0x892ab + db 1 ; default option +; 0x892ab + +MenuData2_0x892ab: ; 0x892ab + db $c0 ; flags + db 2 ; items + db "はい@" + db "いいえ@" +; 0x892b4 + +Function892b4: ; 892b4 (22:52b4) + call Function8931b + +Function892b7: ; 892b7 + ld d, b + ld e, c + ld hl, 0 + add hl, bc + ld a, "@" + ld bc, 6 + call ByteFill + ld b, d + ld c, e + ld hl, 6 + add hl, bc + ld a, "@" + ld bc, 6 + call ByteFill + ld b, d + ld c, e + ld hl, 12 + add hl, bc + xor a + ld [hli], a + ld [hl], a + ld hl, 14 + add hl, bc + ld [hli], a + ld [hl], a + ld hl, 16 + add hl, bc + ld [hl], a + ld hl, 17 + add hl, bc + ld a, -1 + ld bc, 8 + call ByteFill + ld b, d + ld c, e + ld e, 6 + ld hl, 25 + add hl, bc +.loop + ld a, -1 + ld [hli], a + ld a, -1 + ld [hli], a + dec e + jr nz, .loop + ret +; 89305 + + +Function89305: ; 89305 (22:5305) + xor a + ld [MenuSelection], a + ld c, 40 +.loop + ld a, [MenuSelection] + inc a + ld [MenuSelection], a + push bc + call Function892b4 + pop bc + dec c + jr nz, .loop + ret + +Function8931b: ; 8931b + push hl + ld hl, $a03b + ld a, [MenuSelection] + dec a + ld bc, $0025 + call AddNTimes + ld b, h + ld c, l + pop hl + ret +; 8932d + +Function8932d: ; 8932d + ld hl, 0 + add hl, bc + +Function89331: ; 89331 +; Scans up to 5 characters starting at hl, looking for a nonspace character up to the next terminator. Sets carry if it does not find a nonspace character. Returns the location of the following character in hl. + push bc + ld c, 5 +.loop + ld a, [hli] + cp "@" + jr z, .terminator + cp " " + jr nz, .nonspace + dec c + jr nz, .loop + +.terminator + scf + jr .done + +.nonspace + and a + +.done + pop bc + ret +; 89346 + + +Function89346: ; 89346 (22:5346) + ld h, b + ld l, c + jr _incave + +Function8934a: ; 8934a + ld hl, 6 + add hl, bc +_incave: +; Scans up to 5 characters starting at hl, looking for a nonspace character up to the next terminator. Sets carry if it does not find a nonspace character. Returns the location of the following character in hl. + push bc + ld c, 5 +.loop + ld a, [hli] + cp "@" + jr z, .terminator + cp " " + jr nz, .nonspace + dec c + jr nz, .loop + +.terminator + scf + jr .done + +.nonspace + and a + +.done + pop bc + ret +; 89363 + +Function89363: ; 89363 +; Scans six byte pairs starting at bc to find $ff. Sets carry if it does not find a $ff. Returns the location of the byte after the first $ff found in hl. + ld h, b + ld l, c + jr ._incave + + ld hl, 25 + add hl, bc + +._incave + push de + ld e, 6 +.loop + ld a, [hli] + cp -1 + jr nz, .ok + ld a, [hli] + cp -1 + jr nz, .ok + dec e + jr nz, .loop + scf + jr .done + +.ok + and a + +.done + pop de + ret +; 89381 + +Function89381: ; 89381 + push bc + push de + call Function89b45 + jr c, .ok + push hl + ld a, -1 + ld bc, 8 + call ByteFill + pop hl + +.ok + pop de + ld c, 8 + call Function89193 + pop bc + ret +; 8939a + +Function8939a: ; 8939a + push bc + ld hl, 0 + add hl, bc + ld de, DefaultFlypoint + ld c, 6 + call Function89193 + pop bc + ld hl, 17 + add hl, bc + ld de, wd008 + call Function89381 + ret +; 893b3 + + +Function893b3: ; 893b3 (22:53b3) + call DisableLCD + call ClearSprites + call Functione51 + call Functione5f + call Function893ef + call Function8942b + call Function89455 + call EnableLCD + ret + +Function893cc: ; 893cc + call DisableLCD + call ClearSprites + call Functione51 + call Functione5f + call Function893ef + call Function89464 + call EnableLCD + ret +; 893e2 + + +Function893e2: ; 893e2 (22:53e2) + call Function89b1e + call Function893b3 + call Function8a5b6 + call Function8949c + ret + +Function893ef: ; 893ef + ld de, VTiles0 + ld hl, GFX_8940b + ld bc, $20 + ld a, BANK(GFX_8940b) + call FarCopyBytes + ret +; 893fe + +Function893fe: ; 893fe + call DisableLCD + call Function893ef + call EnableLCD + call DelayFrame + ret +; 8940b + +GFX_8940b: ; 8940b +INCBIN "gfx/unknown/08940b.2bpp" +; 8942b + +Function8942b: ; 8942b (22:542b) + ld de, VTiles0 tile $02 + ld hl, MobileAdapterGFX + $7d0 + ld bc, $80 + ld a, BANK(MobileAdapterGFX) + call FarCopyBytes + ld de, VTiles0 tile $0a + ld hl, MobileAdapterGFX + $c60 + ld bc, $40 + ld a, BANK(MobileAdapterGFX) + call FarCopyBytes + ret + +Function89448: ; 89448 (22:5448) +; Clears the Sprites array + push af + ld hl, Sprites + ld d, $10 * 6 + xor a +.loop + ld [hli], a + dec d + jr nz, .loop + pop af + ret + +Function89455: ; 89455 (22:5455) + ld hl, MobileAdapterGFX + $7d0 + ld de, VTiles2 tile $0c + ld bc, $490 + ld a, BANK(MobileAdapterGFX) + call FarCopyBytes + ret + +Function89464: ; 89464 + ld hl, MobileAdapterGFX + ld de, VTiles2 + ld bc, $200 + ld a, BANK(MobileAdapterGFX) + call FarCopyBytes + ld hl, MobileAdapterGFX + $660 + ld de, VTiles2 tile $20 + ld bc, $170 + ld a, BANK(MobileAdapterGFX) + call FarCopyBytes + ret +; 89481 + +Function89481: ; 89481 + ld d, 2 + call Function8934a + ret c + ld d, 0 + ld hl, 16 + add hl, bc + bit 0, [hl] + ret z + inc d + ret +; 89492 + + +Function89492: ; 89492 (22:5492) + ld d, 0 + ld a, [PlayerGender] + bit 0, a + ret z + inc d + ret + +Function8949c: ; 8949c + ld a, [rSVBK] + push af + ld a, 5 + ld [rSVBK], a + ld hl, Palette_894b3 + ld de, Unkn1Pals + 8 * 7 + ld bc, 8 + call CopyBytes + pop af + ld [rSVBK], a + ret +; 894b3 + +Palette_894b3: ; 894b3 + RGB 31, 31, 31 + RGB 31, 31, 31 + RGB 31, 31, 31 + RGB 00, 00, 00 +; 894bb + +Function894bb: ; 894bb + call Function894dc + push bc + call Function8956f + call Function8949c + call Function8a60d + pop bc + ret +; 894ca + + +Function894ca: ; 894ca (22:54ca) + push bc + call Function894dc + call Function895c7 + call Function8949c + call Function8a60d + call Function32f9 + pop bc + ret + +Function894dc: ; 894dc + push bc + ld a, [rSVBK] + push af + ld a, 5 + ld [rSVBK], a + ld c, d + ld b, 0 + ld hl, Unknown_89509 +rept 2 + add hl, bc +endr + ld a, [hli] + ld h, [hl] + ld l, a + ld de, Unkn1Pals + ld bc, 24 + call CopyBytes + ld hl, Palette_89557 + ld de, wd018 + ld bc, 24 + call CopyBytes + pop af + ld [rSVBK], a + pop bc + ret +; 89509 + +Unknown_89509: ; 89509 + dw Palette_8950f + dw Palette_89527 + dw Palette_8953f +; 8950f + +Palette_8950f: ; 8950f + RGB 31, 31, 31 + RGB 10, 17, 13 + RGB 10, 08, 22 + RGB 00, 00, 00 + + RGB 31, 31, 31 + RGB 16, 20, 31 + RGB 10, 08, 22 + RGB 00, 00, 00 + + RGB 31, 31, 31 + RGB 16, 20, 31 + RGB 10, 17, 13 + RGB 00, 00, 00 + +Palette_89527: ; 89527 + RGB 31, 31, 31 + RGB 30, 22, 11 + RGB 31, 08, 15 + RGB 00, 00, 00 + + RGB 31, 31, 31 + RGB 16, 20, 31 + RGB 31, 08, 15 + RGB 00, 00, 00 + + RGB 31, 31, 31 + RGB 16, 20, 31 + RGB 30, 22, 11 + RGB 00, 00, 00 + +Palette_8953f: ; 8953f + RGB 31, 31, 31 + RGB 15, 20, 26 + RGB 25, 07, 20 + RGB 00, 00, 00 + + RGB 31, 31, 31 + RGB 16, 20, 31 + RGB 25, 07, 20 + RGB 00, 00, 00 + + RGB 31, 31, 31 + RGB 16, 20, 31 + RGB 15, 20, 26 + RGB 00, 00, 00 + +Palette_89557: ; 89557 + RGB 31, 31, 31 + RGB 31, 31, 31 + RGB 31, 13, 00 + RGB 14, 08, 00 + + RGB 31, 31, 31 + RGB 16, 16, 31 + RGB 00, 00, 31 + RGB 00, 00, 00 + + RGB 19, 31, 11 + RGB 00, 00, 00 + RGB 00, 00, 00 + RGB 00, 00, 00 +; 8956f + +Function8956f: ; 8956f + push bc + ld hl, 16 + add hl, bc + ld d, h + ld e, l + ld hl, $000c + add hl, bc + ld b, h + ld c, l + callba Function4e929 + ld a, c + ld [TrainerClass], a + ld a, [rSVBK] + push af + ld a, 5 + ld [rSVBK], a + ld hl, wd030 + ld a, -1 + ld [hli], a + ld a, " " + ld [hl], a + pop af + ld [rSVBK], a + ld a, [TrainerClass] + ld h, 0 + ld l, a +rept 2 + add hl, hl +endr + ld de, TrainerPalettes + add hl, de + ld a, [rSVBK] + push af + ld a, $5 + ld [rSVBK], a + ld de, wd032 + ld c, 4 +.loop + ld a, BANK(TrainerPalettes) + call GetFarByte + ld [de], a + inc de + inc hl + dec c + jr nz, .loop + ld hl, wd036 + xor a + ld [hli], a + ld [hl], a + pop af + ld [rSVBK], a + pop bc + ret +; 895c7 + + +Function895c7: ; 895c7 (22:55c7) + ld a, [rSVBK] ; $ff00+$70 + push af + ld a, 5 + ld [rSVBK], a ; $ff00+$70 + ld hl, Palette_895de + ld de, wd030 + ld bc, 8 + call CopyBytes + pop af + ld [rSVBK], a ; $ff00+$70 + ret +; 895de (22:55de) + +Palette_895de: ; 895de + RGB 31, 31, 31 + RGB 07, 07, 06 + RGB 07, 07, 06 + RGB 00, 00, 00 +; 895e6 + +Function895e6: ; 895e6 + ld a, 7 + hlcoord 0, 0, AttrMap + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + call ByteFill + ret +; 895f2 + +Function895f2: ; 895f2 + push bc + xor a + hlcoord 0, 0, AttrMap + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + call ByteFill + call Function89605 + call Function89655 + pop bc + ret +; 89605 + +Function89605: ; 89605 + hlcoord 19, 2, AttrMap + ld a, 1 + ld de, SCREEN_WIDTH + ld c, 14 +.loop + ld [hl], a + dec c + jr z, .done + add hl, de + inc a + ld [hl], a + dec a + add hl, de + dec c + jr nz, .loop + +.done + hlcoord 0, 16, AttrMap + ld c, 10 + ld a, 2 +.loop2 + ld [hli], a + dec a + ld [hli], a + inc a + dec c + jr nz, .loop2 + hlcoord 1, 11, AttrMap + ld a, 4 + ld bc, 4 + call ByteFill + ld a, 5 + ld bc, 14 + call ByteFill + ret +; 8963d + +Function8963d: ; 8963d + hlcoord 12, 3, AttrMap + ld a, 6 + ld de, SCREEN_WIDTH + lb bc, 7, 7 +.loop + push hl + ld c, 7 +.next + ld [hli], a + dec c + jr nz, .next + pop hl + add hl, de + dec b + jr nz, .loop + ret +; 89655 + +Function89655: ; 89655 + hlcoord 1, 12, AttrMap + ld de, SCREEN_WIDTH + ld a, 5 + ld b, 4 +.loop + ld c, 18 + push hl +.next + ld [hli], a + dec c + jr nz, .next + pop hl + add hl, de + dec b + jr nz, .loop + ret +; 8966c + +Function8966c: ; 8966c + push bc + call Function89688 + hlcoord 4, 0 + ld c, 8 + call Function896f5 + pop bc + ret +; 8967a + + +Function8967a: ; 8967a (22:567a) + push bc + call Function89688 + hlcoord 2, 0 + ld c, 12 + call Function896f5 + pop bc + ret + +Function89688: ; 89688 + hlcoord 0, 0 + ld a, 1 + ld e, SCREEN_WIDTH + call Function896e1 + ld a, 2 + ld e, SCREEN_WIDTH + call Function896eb + ld a, 3 + ld [hli], a + ld a, 4 + ld e, SCREEN_HEIGHT + call Function896e1 + ld a, 6 + ld [hli], a + push bc + ld c, 13 +.loop + call Function896cb + dec c + jr z, .done + call Function896d6 + dec c + jr nz, .loop + +.done + pop bc + ld a, 25 + ld [hli], a + ld a, 26 + ld e, SCREEN_HEIGHT + call Function896e1 + ld a, 28 + ld [hli], a + ld a, 2 + ld e, SCREEN_WIDTH + call Function896eb + ret +; 896cb + +Function896cb: ; 896cb + ld de, SCREEN_WIDTH - 1 + ld a, 7 + ld [hl], a + add hl, de + ld a, 9 + ld [hli], a + ret +; 896d6 + +Function896d6: ; 896d6 + ld de, SCREEN_WIDTH - 1 + ld a, 10 + ld [hl], a + add hl, de + ld a, 11 + ld [hli], a + ret +; 896e1 + +Function896e1: ; 896e1 +.loop + ld [hli], a + inc a + dec e + ret z + ld [hli], a + dec a + dec e + jr nz, .loop + ret +; 896eb + +Function896eb: ; 896eb +.loop + ld [hli], a + dec a + dec e + ret z + ld [hli], a + inc a + dec e + jr nz, .loop + ret +; 896f5 + +Function896f5: ; 896f5 + call Function8971f + call Function89736 +rept 2 + inc hl +endr + ld b, 2 + +ClearScreenArea: ; 0x896ff +; clears an area of the screen +; INPUT: +; hl = address of upper left corner of the area +; b = height +; c = width + + ld a, " " ; blank tile + ld de, 20 ; screen width +.loop + push bc + push hl +.innerLoop + ld [hli], a + dec c + jr nz, .innerLoop + pop hl + pop bc + add hl, de + dec b + jr nz, .loop + + dec hl +rept 2 + inc c +endr +.asm_89713 + ld a, $36 + ld [hli], a + dec c + ret z + ld a, $18 + ld [hli], a + dec c + jr nz, .asm_89713 ; 0x8971c $f5 + ret +; 0x8971f + +Function8971f: ; 8971f + ld a, $2c + ld [hli], a + ld a, $2d + ld [hld], a + push hl + ld de, SCREEN_WIDTH + add hl, de + ld a, $31 + ld [hli], a + ld a, $32 + ld [hld], a + add hl, de + ld a, $35 + ld [hl], a + pop hl + ret +; 89736 + +Function89736: ; 89736 + push hl +rept 2 + inc hl +endr + ld e, c + ld d, $0 + add hl, de + ld a, $2f + ld [hli], a + ld a, $30 + ld [hld], a + ld de, SCREEN_WIDTH + add hl, de + ld a, $33 + ld [hli], a + ld a, $34 + ld [hl], a + add hl, de + ld a, $1f + ld [hl], a + pop hl + ret +; 89753 + +Function89753: ; 89753 + ld a, $c + ld [hl], a + xor a + call Function89215 + ret +; 8975b + +Function8975b: ; 8975b + ld a, $1d + ld [hli], a + inc a + ld [hli], a + ld a, $d + ld [hl], a +rept 2 + dec hl +endr + ld a, $4 + ld e, $3 +.asm_89769 + call Function89215 + inc hl + dec e + jr nz, .asm_89769 + ret +; 89771 + +Function89771: ; 89771 + ld a, $12 + ld [hl], a + ld a, $3 + call Function89215 + ret +; 8977a + +Function8977a: ; 8977a + ld e, $4 + ld d, $13 +.asm_8977e + ld a, d + ld [hl], a + ld a, $4 + call Function89215 + inc hl + inc d + dec e + jr nz, .asm_8977e + ld e, $e +.asm_8978c + ld a, d + ld [hl], a + xor a + call Function89215 + inc hl + dec e + jr nz, .asm_8978c + ret +; 89797 + +Function89797: ; 89797 + push bc + ld a, $e + ld [hl], a + ld bc, SCREEN_WIDTH + add hl, bc + ld a, $11 + ld [hli], a + ld a, $10 + ld c, $8 +.asm_897a6 + ld [hli], a + dec c + jr nz, .asm_897a6 + ld a, $f + ld [hl], a + pop bc + ret +; 897af + +Function897af: ; 897af + push bc + ld hl, $0010 + add hl, bc + ld d, h + ld e, l + ld hl, $000c + add hl, bc + ld b, h + ld c, l + callba Function4e929 + ld a, c + ld [TrainerClass], a + xor a + ld [CurPartySpecies], a + ld de, VTiles2 tile $37 + callba GetTrainerPic + pop bc + ret +; 897d5 + +Function897d5: ; 897d5 + push bc + call Function8934a + jr nc, .asm_897f3 + hlcoord 12, 3, AttrMap + xor a + ld de, SCREEN_WIDTH + lb bc, 7, 7 +.asm_897e5 + push hl + ld c, $7 +.asm_897e8 + ld [hli], a + dec c + jr nz, .asm_897e8 + pop hl + add hl, de + dec b + jr nz, .asm_897e5 + pop bc + ret + +.asm_897f3 + ld a, $37 + ld [$ffad], a + hlcoord 12, 3 + lb bc, 7, 7 + predef FillBox + call Function8963d + pop bc + ret +; 89807 + + +Function89807: ; 89807 (22:5807) + ld hl, MobileAdapterGFX + $200 + ld a, [PlayerGender] + bit 0, a + jr z, .asm_89814 + ld hl, MobileAdapterGFX + $200 + $230 +.asm_89814 + call DisableLCD + ld de, VTiles2 tile $37 + ld bc, $230 + ld a, BANK(MobileAdapterGFX) + call FarCopyBytes + call EnableLCD + call DelayFrame + ret + +Function89829: ; 89829 (22:5829) + push bc + ld bc, $705 + ld de, $14 + ld a, $37 +.asm_89832 + push bc + push hl +.asm_89834 + ld [hli], a + inc a + dec c + jr nz, .asm_89834 + pop hl + add hl, de + pop bc + dec b + jr nz, .asm_89832 + call Function8963d + pop bc + ret + +Function89844: ; 89844 + call Function89481 + call Function894bb + call Function897af + push bc + call Function3200 + call Function32f9 + pop bc + ret +; 89856 + +Function89856: ; 89856 + push bc + call Function891b8 + pop bc + call Function895f2 + call Function8966c + call Function899d3 + call Function898aa + call Function898be + call Function898dc + call Function898f3 + push bc + ld bc, wd008 + hlcoord 2, 10 + call Function89975 + pop bc + call Function897d5 + ret +; 8987f + + +Function8987f: ; 8987f (22:587f) + call Function891b8 + call Function895f2 + call Function8967a + call Function899d3 + hlcoord 5, 1 + call Function8999c + hlcoord 13, 3 + call Function89829 + call Function899b2 + hlcoord 5, 5 + call Function899c9 + ld bc, wd008 + hlcoord 2, 10 + call Function89975 + ret + +Function898aa: ; 898aa + ld a, [MenuSelection] + and a + ret z + push bc + hlcoord 6, 1 + ld de, MenuSelection + lb bc, PRINTNUM_LEADINGZEROS | 1, 2 + call PrintNum + pop bc + ret +; 898be + +Function898be: ; 898be + push bc + ld de, DefaultFlypoint + ld hl, DefaultFlypoint + call Function89331 + jr nc, .asm_898cd + ld de, String_89116 + +.asm_898cd + hlcoord 9, 1 + ld a, [MenuSelection] + and a + jr nz, .asm_898d7 + dec hl + +.asm_898d7 + call PlaceString + pop bc + ret +; 898dc + +Function898dc: ; 898dc + ld hl, $0006 + add hl, bc + push bc + ld d, h + ld e, l + call Function8934a + jr nc, .asm_898eb + ld de, String_89116 + +.asm_898eb + hlcoord 6, 4 + call PlaceString + pop bc + ret +; 898f3 + +Function898f3: ; 898f3 + push bc + ld hl, $000c + add hl, bc + ld d, h + ld e, l + call Function8934a + jr c, .asm_8990a + hlcoord 5, 5 + lb bc, PRINTNUM_LEADINGZEROS | 2, 5 + call PrintNum + jr .asm_89913 + +.asm_8990a + hlcoord 5, 5 + ld de, String_89116 + call PlaceString + +.asm_89913 + pop bc + ret +; 89915 + +Function89915: ; 89915 + push bc + push hl + ld de, Unknown_89942 + ld c, $8 +.asm_8991c + ld a, [de] + ld [hl], a + ld a, $4 + call Function89215 + inc hl + inc de + dec c + jr nz, .asm_8991c + pop hl + ld b, $4 + ld c, $2b + ld a, $8 + ld de, Unknown_8994a +.asm_89932 + push af + ld a, [de] + cp [hl] + jr nz, .asm_8993b + call Function8994e + inc de + +.asm_8993b + inc hl + pop af + dec a + jr nz, .asm_89932 + pop bc + ret +; 89942 + +Unknown_89942: ; 89942 + db $24, $25, $26, " ", $27, $28, $29, $2a +Unknown_8994a: ; 8994a + db $24, $27, $29, $ff +; 8994e + +Function8994e: ; 8994e + push hl + push de + ld de, SCREEN_WIDTH + ld a, l + sub e + ld l, a + ld a, h + sbc d + ld h, a + ld a, c + ld [hl], a + ld a, b + call Function89215 + pop de + pop hl + ret +; 89962 + +Function89962: ; 89962 + push bc + ld c, $4 + ld b, $20 +.asm_89967 + ld a, b + ld [hl], a + ld a, $4 + call Function89215 + inc hl + inc b + dec c + jr nz, .asm_89967 + pop bc + ret +; 89975 + +Function89975: ; 89975 + push bc + ld e, $8 +.asm_89978 + ld a, [bc] + ld d, a + call Function8998b + swap d + inc hl + ld a, d + call Function8998b + inc bc + inc hl + dec e + jr nz, .asm_89978 + pop bc + ret +; 8998b + +Function8998b: ; 8998b + push bc + and $f + cp $a + jr nc, .asm_89997 + ld c, $f6 + add c + jr .asm_89999 + +.asm_89997 + ld a, $7f + +.asm_89999 + ld [hl], a + pop bc + ret +; 8999c + + +Function8999c: ; 8999c (22:599c) + ld de, PlayerName + call PlaceString + inc bc + ld h, b + ld l, c + ld de, String_899ac + call PlaceString + ret +; 899ac (22:59ac) + +String_899ac: ; 899ac + db "の めいし@" +; 899b2 + +Function899b2: ; 899b2 (22:59b2) + ld bc, PlayerName + call Function89346 + jr c, .asm_899bf + ld de, PlayerName + jr .asm_899c2 +.asm_899bf + ld de, String_89116 +.asm_899c2 + hlcoord 6, 4 + call PlaceString + ret + +Function899c9: ; 899c9 (22:59c9) + ld de, PlayerID + lb bc, PRINTNUM_LEADINGZEROS | 2, 5 + call PrintNum + ret + +Function899d3: ; 899d3 + hlcoord 1, 4 + call Function89753 + hlcoord 2, 5 + call Function8975b + hlcoord 1, 9 + call Function89771 + hlcoord 1, 11 + call Function8977a + hlcoord 1, 5 + call Function89797 + hlcoord 2, 4 + call Function89962 + hlcoord 2, 9 + call Function89915 + ret +; 899fe + +Function899fe: ; 899fe + push bc + push hl + ld hl, $0019 + add hl, bc + ld b, h + ld c, l + pop hl + call Function89a0c + pop bc + ret +; 89a0c + +Function89a0c: ; 89a0c + push hl + call Function89363 + pop hl + jr c, .asm_89a1c + ld d, h + ld e, l + callba Function11c08f + ret + +.asm_89a1c + ld de, String_89153 + call PlaceString + ret +; 89a23 + + +Function89a23: ; 89a23 (22:5a23) + hlcoord 0, 11 + ld b, $4 + ld c, $12 + call Function8921f + ret + +Function89a2e: ; 89a2e (22:5a2e) + hlcoord 11, 12 + ld b, $2 + ld c, $6 + call TextBox + hlcoord 13, 13 + ld de, String_89a4e + call PlaceString + hlcoord 13, 14 + ld de, String_89a53 + call PlaceString + call Function89655 + ret +; 89a4e (22:5a4e) + +String_89a4e: ; 89a4e + db "けってい@" +; 89a53 + +String_89a53: ; 89a53 + db "やめる@" +; 89a57 + +Function89a57: ; 89a57 + call Function354b + bit 6, c + jr nz, .asm_89a78 + bit 7, c + jr nz, .asm_89a81 + bit 0, c + jr nz, .asm_89a70 + bit 1, c + jr nz, .asm_89a70 + bit 3, c + jr nz, .asm_89a74 + scf + ret + +.asm_89a70 + ld a, $1 + and a + ret + +.asm_89a74 + ld a, $2 + and a + ret + +.asm_89a78 + call Function89a9b + call nc, Function89a8a + ld a, $0 + ret + +.asm_89a81 + call Function89a93 + call nc, Function89a8a + ld a, $0 + ret +; 89a8a + +Function89a8a: ; 89a8a + push af + ld de, SFX_UNKNOWN_62 + call PlaySFX + pop af + ret +; 89a93 + +Function89a93: ; 89a93 + ld d, $28 + ld e, $1 + call Function89aa3 + ret +; 89a9b + +Function89a9b: ; 89a9b + ld d, $1 + ld e, $ff + call Function89aa3 + ret +; 89aa3 + +Function89aa3: ; 89aa3 + ld a, [MenuSelection] + ld c, a + push bc +.asm_89aa8 + ld a, [MenuSelection] + cp d + jr z, .asm_89ac0 + add e + jr nz, .asm_89ab2 + inc a + +.asm_89ab2 + ld [MenuSelection], a + call Function89ac7 + jr nc, .asm_89aa8 + call Function89ae6 + pop bc + and a + ret + +.asm_89ac0 + pop bc + ld a, c + ld [MenuSelection], a + scf + ret +; 89ac7 + +Function89ac7: ; 89ac7 + call OpenSRAMBank4 + call Function8931b + call Function89ad4 + call CloseSRAM + ret +; 89ad4 + +Function89ad4: ; 89ad4 + push de + call Function8932d + jr c, .asm_89ae3 + ld hl, $0011 + add hl, bc + call Function89b45 + jr c, .asm_89ae4 + +.asm_89ae3 + and a + +.asm_89ae4 + pop de + ret +; 89ae6 + +Function89ae6: ; 89ae6 + ld hl, wd031 + xor a + ld [hl], a + ld a, [MenuSelection] +.asm_89aee + cp $6 + jr c, .asm_89afc + sub $5 + ld c, a + ld a, [hl] + add $5 + ld [hl], a + ld a, c + jr .asm_89aee + +.asm_89afc + ld [wd030], a + ret +; 89b00 + + +Function89b00: ; 89b00 (22:5b00) + callba Function49351 + ret +; 89b07 (22:5b07) + +Function89b07: ; 89b07 + call Function8923c + call DelayFrame + callba Function4a3a7 + ret +; 89b14 + +Function89b14: ; 89b14 + call WhiteBGMap + call Function89b07 + call Function89b00 + ret +; 89b1e + +Function89b1e: ; 89b1e (22:5b1e) + callba Function4a485 + call Function89b00 + ret + +Function89b28: ; 89b28 (22:5b28) + call Function891de + call WhiteBGMap + call Function893e2 + call Function1d7d + call Function891ab + call Function32f9 + ret + +Function89b3b: ; 89b3b (22:5b3b) + call Function8923c + callba Function48cda + ret + +Function89b45: ; 89b45 + push hl + push bc + ld c, $10 + ld e, $0 +.asm_89b4b + ld a, [hli] + ld b, a + and $f + cp $a + jr c, .asm_89b5a + ld a, c + cp $b + jr nc, .asm_89b74 + jr .asm_89b71 + +.asm_89b5a + dec c + swap b + inc e + ld a, b + and $f + cp $a + jr c, .asm_89b6c + ld a, c + cp $b + jr nc, .asm_89b74 + jr .asm_89b71 + +.asm_89b6c + inc e + dec c + jr nz, .asm_89b4b + dec e + +.asm_89b71 + scf + jr .asm_89b75 + +.asm_89b74 + and a + +.asm_89b75 + pop bc + pop hl + ret +; 89b78 + + +Function89b78: ; 89b78 (22:5b78) + push bc + ld a, [wd010] + cp $10 + jr c, .asm_89b8c + ld a, e + and a + jr z, .asm_89b89 + ld c, e +.asm_89b85 + inc hl + dec c + jr nz, .asm_89b85 +.asm_89b89 + ld a, $7f + ld [hl], a +.asm_89b8c + ld a, [wd010] + inc a + and $1f + ld [wd010], a + pop bc + ret + +Function89b97: ; 89b97 (22:5b97) + call Function89c34 + jr c, .asm_89ba0 + call Function89448 + ret +.asm_89ba0 + ld a, [wd011] + ld hl, Unknown_89bd8 + and a + jr z, .asm_89bae +.asm_89ba9 +rept 2 + inc hl +endr + dec a + jr nz, .asm_89ba9 +.asm_89bae + ld a, [hli] + ld h, [hl] + ld l, a + ld de, Sprites +.asm_89bb4 + ld a, [hli] + cp $ff + ret z + ld c, a + ld b, $0 +.asm_89bbb + push hl + ld a, [hli] + ld [de], a + inc de + ld a, [hli] + add b + ld [de], a + inc de + ld a, $8 + add b + ld b, a + ld a, [hli] + ld [de], a + inc de + ld a, [hli] + ld [de], a + inc de + pop hl + dec c + jr nz, .asm_89bbb + ld b, $0 + ld c, $4 + add hl, bc + jr .asm_89bb4 +; 89bd8 (22:5bd8) + +Unknown_89bd8: ; 89bd8 + dw Unknown_89be0 + dw Unknown_89bf5 + dw Unknown_89c0a + dw Unknown_89c1f +; 89be0 + +Unknown_89be0: ; 89be0 + db $01, $12, $4e, $01, $00 + db $01, $19, $4e, $01, $40 + db $01, $12, $72, $01, $20 + db $01, $19, $72, $01, $60 + db $ff + +Unknown_89bf5: ; 89bf5 + db $01, $60, $16, $01, $00 + db $01, $62, $16, $01, $40 + db $01, $60, $92, $01, $20 + db $01, $62, $92, $01, $60 + db $ff + +Unknown_89c0a: ; 89c0a + db $01, $78, $66, $01, $00 + db $01, $78, $66, $01, $40 + db $01, $78, $92, $01, $20 + db $01, $78, $92, $01, $60 + db $ff + +Unknown_89c1f: ; 89c1f + db $01, $80, $66, $01, $00 + db $01, $80, $66, $01, $40 + db $01, $80, $92, $01, $20 + db $01, $80, $92, $01, $60 + db $ff +; 89c34 + +Function89c34: ; 89c34 (22:5c34) + push bc + ld a, [wd012] + ld c, a + inc a + and $f + ld [wd012], a + ld a, c + cp $8 + pop bc + ret + +Function89c44: ; 89c44 (22:5c44) + call Function89c34 + jr c, .asm_89c4f + push de + call Function89448 + pop de + ret +.asm_89c4f + ld hl, Sprites + push de + ld a, b + ld [hli], a + ld d, $8 + ld a, e + and a + ld a, c + jr z, .asm_89c60 +.asm_89c5c + add d + dec e + jr nz, .asm_89c5c +.asm_89c60 + pop de + ld [hli], a + ld a, d + ld [hli], a + xor a + ld [hli], a + ret + +Function89c67: ; 89c67 (22:5c67) + call Function354b + ld b, $0 + bit 0, c + jr z, .asm_89c74 + ld b, $1 + and a + ret +.asm_89c74 + bit 1, c + jr z, .asm_89c7a + scf + ret +.asm_89c7a + xor a + bit 6, c + jr z, .asm_89c81 + ld a, $1 +.asm_89c81 + bit 7, c + jr z, .asm_89c87 + ld a, $2 +.asm_89c87 + bit 5, c + jr z, .asm_89c8d + ld a, $3 +.asm_89c8d + bit 4, c + jr z, .asm_89c93 + ld a, $4 +.asm_89c93 + and a + ret z + dec a + ld c, a + ld d, $0 + ld hl, Unknown_89cbf + ld a, [wd02f] + and a + jr z, .asm_89ca5 + ld hl, Unknown_89ccf +.asm_89ca5 + ld a, [wd011] + and a + jr z, .asm_89cb1 + ld e, $4 +.asm_89cad + add hl, de + dec a + jr nz, .asm_89cad +.asm_89cb1 + ld e, c + add hl, de + ld a, [hl] + and a + ret z + dec a + ld [wd011], a + xor a + ld [wd012], a + ret +; 89cbf (22:5cbf) + +Unknown_89cbf: ; 89cbf + db 0, 2, 0, 0 + db 1, 3, 0, 0 + db 2, 4, 0, 0 + db 3, 0, 0, 0 + +Unknown_89ccf: ; 89ccf + db 0, 0, 0, 0 + db 0, 3, 0, 0 + db 2, 4, 0, 0 + db 3, 0, 0, 0 +; 89cdf + +Function89cdf: ; 89cdf (22:5cdf) + ld a, $10 + add b + ld b, a + ld a, $8 + add c + ld c, a + ld e, $2 + ld a, $2 + ld hl, Sprites +.asm_89cee + push af + push bc + ld d, $4 +.asm_89cf2 + ld a, b + ld [hli], a + ld a, c + ld [hli], a + ld a, e + ld [hli], a + ld a, $1 + ld [hli], a + ld a, $8 + add c + ld c, a + inc e + dec d + jr nz, .asm_89cf2 + pop bc + ld a, $8 + add b + ld b, a + pop af + dec a + jr nz, .asm_89cee + ret + +Function89d0d: ; 89d0d (22:5d0d) + call Function8923c + ld a, [rSVBK] ; $ff00+$70 + push af + ld a, $5 + ld [rSVBK], a ; $ff00+$70 + ld c, $8 + ld de, Unkn1Pals +.asm_89d1c + push bc + ld hl, Palette_89d4e + ld bc, $8 + call CopyBytes + pop bc + dec c + jr nz, .asm_89d1c + ld hl, Palette_89d56 + ld de, wd010 + ld bc, $8 + call CopyBytes + pop af + ld [rSVBK], a ; $ff00+$70 + call Function32f9 + callba Function845db + call Function89240 + ld c, $18 + call DelayFrames + call RestartMapMusic + ret +; 89d4e (22:5d4e) + +Palette_89d4e: ; 89d4e + RGB 31, 31, 31 + RGB 19, 19, 19 + RGB 15, 15, 15 + RGB 00, 00, 00 +; 89d56 + +Palette_89d56: ; 89d56 + RGB 31, 31, 31 + RGB 19, 19, 19 + RGB 19, 19, 19 + RGB 00, 00, 00 +; 89d5e + +Function89d5e: ; 89d5e (22:5d5e) + push af + call CopyMenuDataHeader + pop af + ld [wPocketCursorBuffer], a + call Function8923c + call Function1c89 + call Function1c10 + ld hl, wcfa5 + set 7, [hl] + ret + +Function89d75: ; 89d75 (22:5d75) + push hl + call Function8923c + call _hl_ + callba Function104148 + pop hl + jr asm_89d90 + +Function89d85: ; 89d85 (22:5d85) + push hl + call Function8923c + call _hl_ + call Function3238 + pop hl + +asm_89d90: ; 89d90 (22:5d90) + call Function8923c + push hl + call _hl_ + call Function89dab + ld a, [wcfa9] + push af + call Function891ab + pop af + pop hl + jr c, .asm_89da9 + jr z, asm_89d90 + scf + ret +.asm_89da9 + and a + ret + +Function89dab: ; 89dab (22:5dab) + call Function8923c + callba Function241ba + call Function8923c + ld a, c + ld hl, wcfa8 + and [hl] + ret z + bit 0, a + jr nz, .asm_89dc7 + bit 1, a + jr nz, .asm_89dd9 + xor a + ret +.asm_89dc7 + call PlayClickSFX + ld a, [wcfa3] + ld c, a + ld a, [wcfa9] + cp c + jr z, .asm_89dd9 + call Function1bee + scf + ret +.asm_89dd9 + call PlayClickSFX + ld a, $1 + and a + ret + +Function89de0: ; 89de0 (22:5de0) + call ClearSprites + call Function89e0a + jr c, .asm_89e00 + ld c, $1 +.asm_89dea + call Function8a31c + jr z, .asm_89dfd + ld a, [wcfa9] + ld c, a + push bc + ld hl, Jumptable_89e04 + ld a, e + dec a + rst JumpTable + pop bc + jr .asm_89dea +.asm_89dfd + call Function891fe +.asm_89e00 + call Function8917a + ret + +Jumptable_89e04: ; 89e04 (22:5e04) + dw Function8a62c + dw Function8a999 + dw Function8ab93 + + +Function89e0a: ; 89e0a (22:5e0a) + call OpenSRAMBank4 + call Function8b3b0 + call CloseSRAM + ld hl, Jumptable_89e18 + rst JumpTable + ret + +Jumptable_89e18: ; 89e18 (22:5e18) + dw Function89e1e + dw Function8a116 + dw Function8a2aa + + +Function89e1e: ; 89e1e (22:5e1e) + call OpenSRAMBank4 + ld bc, $a037 + call Function8b36c + call CloseSRAM + xor a + ld [wd02d], a + +asm_89e2e: ; 89e2e (22:5e2e) + ld a, [wd02d] + ld hl, Jumptable_89e3c + rst JumpTable + ret + +Function89e36: ; 89e36 (22:5e36) + ld hl, wd02d + inc [hl] + jr asm_89e2e + +Jumptable_89e3c: ; 89e3c (22:5e3c) + dw Function89e6f + dw Function89fed + dw Function89ff6 + dw Function8a03d + dw Function89eb9 + dw Function89efd + dw Function89fce + dw Function8a04c + dw Function8a055 + dw Function8a0e6 + dw Function8a0ec + dw Function8a0f5 + dw Function89e58 + dw Function89e68 + + +Function89e58: ; 89e58 (22:5e58) + ld a, $1 + call Function8a2fe + call Function891fe + call Function893e2 + call Function89168 + and a + ret + +Function89e68: ; 89e68 (22:5e68) + call Function891fe + ld a, $1 + scf + ret + +Function89e6f: ; 89e6f (22:5e6f) + call Function891de + call Function89245 + call Function89ee1 + call Function89e9a + hlcoord 7, 4 + call Function8a58d + ld a, $5 + hlcoord 7, 4, AttrMap + call Function8a5a3 + ld a, $6 + hlcoord 10, 4, AttrMap + call Function8a5a3 + call Function891ab + call Function32f9 + jp Function89e36 + +Function89e9a: ; 89e9a (22:5e9a) + ld a, [rSVBK] ; $ff00+$70 + push af + ld a, $5 + ld [rSVBK], a ; $ff00+$70 + ld hl, Palette_89eb1 + ld de, wd028 + ld bc, $8 + call CopyBytes + pop af + ld [rSVBK], a ; $ff00+$70 + ret +; 89eb1 (22:5eb1) + +Palette_89eb1: ; 89eb1 + RGB 31, 31, 31 + RGB 31, 31, 31 + RGB 27, 19, 00 + RGB 00, 00, 00 +; 89eb9 + +Function89eb9: ; 89eb9 (22:5eb9) + call Function891fe + call Function89ee1 + call Function89e9a + hlcoord 7, 4 + call Function8a58d + ld a, $5 + hlcoord 7, 4, AttrMap + call Function8a5a3 + ld a, $6 + hlcoord 10, 4, AttrMap + call Function8a5a3 + call Function891ab + call Function32f9 + jp Function89e36 + +Function89ee1: ; 89ee1 (22:5ee1) + call WhiteBGMap + call Function893e2 + call Function8923c + callba Function4a3a7 + callba Function49384 + hlcoord 1, 0 + call Function8a53d + ret + +Function89efd: ; 89efd (22:5efd) + ld hl, wd012 + ld a, $ff + ld [hli], a + xor a +rept 4 + ld [hli], a +endr + ld [hl], a +.asm_89f09 + ld hl, wd012 + inc [hl] + ld a, [hli] + and $3 + jr nz, .asm_89f2e + ld a, [hl] + cp $4 + jr nc, .asm_89f2e + ld b, $32 + inc [hl] + ld a, [hl] + dec a + jr z, .asm_89f26 + ld c, a +.asm_89f1f + ld a, $b + add b + ld b, a + dec c + jr nz, .asm_89f1f +.asm_89f26 + ld c, $e8 + ld a, [wd013] + call Function89fa5 +.asm_89f2e + ld a, [wd013] + and a + jr z, .asm_89f58 +.asm_89f34 + call Function89f6a + ld e, a + ld a, c + cp $a8 + jr nc, .asm_89f4d + cp $46 + jr c, .asm_89f4d + ld d, $0 + dec e + ld hl, wd014 + add hl, de + set 0, [hl] + inc e + jr .asm_89f51 +.asm_89f4d + ld a, $2 + add c + ld c, a +.asm_89f51 + ld a, e + call Function89f77 + dec a + jr nz, .asm_89f34 +.asm_89f58 + call DelayFrame + ld hl, wd014 + ld c, $4 +.asm_89f60 + ld a, [hli] + and a + jr z, .asm_89f09 + dec c + jr nz, .asm_89f60 + jp Function89e36 + +Function89f6a: ; 89f6a (22:5f6a) + push af + ld de, $10 + call Function89f9a + ld a, [hli] + ld b, a + ld a, [hl] + ld c, a + pop af + ret + +Function89f77: ; 89f77 (22:5f77) + push af + ld de, $10 + call Function89f9a + ld d, $2 +.asm_89f80 + push bc + ld e, $2 +.asm_89f83 + ld a, b + ld [hli], a + ld a, c + ld [hli], a +rept 2 + inc hl +endr + ld a, $8 + add c + ld c, a + dec e + jr nz, .asm_89f83 + pop bc + ld a, $8 + add b + ld b, a + dec d + jr nz, .asm_89f80 + pop af + ret + +Function89f9a: ; 89f9a (22:5f9a) + dec a + ld hl, Sprites + and a + ret z +.asm_89fa0 + add hl, de + dec a + jr nz, .asm_89fa0 + ret + +Function89fa5: ; 89fa5 (22:5fa5) + ld de, $10 + call Function89f9a + ld e, $2 + ld d, $a +.asm_89faf + push bc + ld a, $2 +.asm_89fb2 + push af + ld a, b + ld [hli], a + ld a, c + ld [hli], a + ld a, d + inc d + ld [hli], a + ld a, $1 + ld [hli], a + ld a, $8 + add c + ld c, a + pop af + dec a + jr nz, .asm_89fb2 + pop bc + ld a, $8 + add b + ld b, a + dec e + jr nz, .asm_89faf + ret + +Function89fce: ; 89fce (22:5fce) + call Function8a5b6 + ld a, $5 + hlcoord 7, 4, AttrMap + call Function8a5a3 + ld a, $6 + hlcoord 10, 4, AttrMap + call Function8a5a3 + call Function89448 + call Function32f9 + call Function891ab + jp Function89e36 + +Function89fed: ; 89fed (22:5fed) + ld hl, UnknownText_0x8a102 + call PrintText + jp Function89e36 + +Function89ff6: ; 89ff6 (22:5ff6) + call Function891fe + call WhiteBGMap + call Function893cc + call Function89807 + call Function89492 + call Function894ca + call OpenSRAMBank4 + ld hl, $a603 + ld a, -1 + ld bc, 8 + call ByteFill + ld hl, $a603 + ld de, wd008 + call Function89381 + call CloseSRAM + call Function8987f + call OpenSRAMBank4 + hlcoord 1, 13 + ld bc, $a007 + call Function89a0c + call CloseSRAM + call Function891ab + call Function89235 + jp Function89e36 + +Function8a03d: ; 8a03d (22:603d) + ld hl, UnknownText_0x8a107 + call Function89209 + call PrintText + call Function8920f + jp Function89e36 + +Function8a04c: ; 8a04c (22:604c) + ld hl, UnknownText_0x8a10c + call PrintText + jp Function89e36 + +Function8a055: ; 8a055 (22:6055) + ld c, $7 + ld b, $4 +.asm_8a059 + call Function8a0a1 + inc c + call Function8a0c9 + push bc + call Function8a58d + pop bc + call Function8a0de + push bc + push hl + ld a, $5 + call Function8a5a3 + pop hl +rept 3 + inc hl +endr + ld a, $6 + call Function8a5a3 + call Function3238 + pop bc + ld a, c + cp $b + jr nz, .asm_8a059 + call Function8a0a1 + hlcoord 12, 4 + call Function8a58d + ld a, $5 + hlcoord 12, 4, AttrMap + call Function8a5a3 + pop hl + ld a, $6 + hlcoord 15, 4, AttrMap + call Function8a5a3 + call Function3238 + jp Function89e36 + +Function8a0a1: ; 8a0a1 (22:60a1) + call Function8923c + push bc + call Function8a0c9 + ld e, $6 +.asm_8a0aa + push hl + ld bc, $6 + add hl, bc + ld d, [hl] + call Function8a0c1 + pop hl + ld [hl], d + call Function89215 + ld bc, $14 + add hl, bc + dec e + jr nz, .asm_8a0aa + pop bc + ret + +Function8a0c1: ; 8a0c1 (22:60c1) + push hl + ld bc, AttrMap - TileMap + add hl, bc + ld a, [hl] + pop hl + ret + +Function8a0c9: ; 8a0c9 (22:60c9) + push bc + hlcoord 0, 0 + ld de, $14 + ld a, b + and a + jr z, .asm_8a0d8 +.asm_8a0d4 + add hl, de + dec b + jr nz, .asm_8a0d4 +.asm_8a0d8 + ld d, $0 + ld e, c + add hl, de + pop bc + ret + +Function8a0de: ; 8a0de (22:60de) + call Function8a0c9 + ld de, AttrMap - TileMap + add hl, de + ret + +Function8a0e6: ; 8a0e6 (22:60e6) + call Function8b539 + jp Function89e36 + +Function8a0ec: ; 8a0ec (22:60ec) + ld hl, UnknownText_0x8a111 + call PrintText + jp Function89e36 + +Function8a0f5: ; 8a0f5 (22:60f5) + call Function8b555 + jp nc, Function8a0ff + ld hl, wd02d + inc [hl] + +Function8a0ff: ; 8a0ff (22:60ff) + jp Function89e36 +; 8a102 (22:6102) + +UnknownText_0x8a102: ; 0x8a102 + ; The CARD FOLDER stores your and your friends' CARDS. A CARD contains information like the person's name, phone number and profile. + text_jump UnknownText_0x1c5238 + db "@" +; 0x8a107 + +UnknownText_0x8a107: ; 0x8a107 + ; This is your CARD. Once you've entered your phone number, you can trade CARDS with your friends. + text_jump UnknownText_0x1c52bc + db "@" +; 0x8a10c + +UnknownText_0x8a10c: ; 0x8a10c + ; If you have your friend's CARD, you can use it to make a call from a mobile phone on the 2nd floor of a #MON CENTER. + text_jump UnknownText_0x1c531e + db "@" +; 0x8a111 + +UnknownText_0x8a111: ; 0x8a111 + ; To safely store your collection of CARDS, you must set a PASSCODE for your CARD FOLDER. + text_jump UnknownText_0x1c5394 + db "@" +; 0x8a116 + +Function8a116: ; 8a116 (22:6116) + ld a, $1 + ld [wd030], a + ld hl, MenuDataHeader_0x8a176 + call LoadMenuDataHeader +.asm_8a121 + call Function8923c + call Function8a17b + jr c, .asm_8a16b + ld a, [wcfa9] + ld [wd030], a + dec d + jr z, .asm_8a140 + call Function8a20d + jr c, .asm_8a121 + xor a + call Function8a2fe + call Function8916e + jr .asm_8a16b +.asm_8a140 + call Function89174 + jr nz, .asm_8a14c + call Function8a241 + jr c, .asm_8a121 + jr .asm_8a15a +.asm_8a14c + call WaitSFX + ld de, SFX_TWINKLE + call PlaySFX + ld c, $10 + call DelayFrames +.asm_8a15a + call ExitMenu + call Function891de + call Function893e2 + call Function89245 + call Function89168 + and a + ret +.asm_8a16b + call Function89209 + call WriteBackup + call Function8920f + scf + ret +; 8a176 (22:6176) + +MenuDataHeader_0x8a176: ; 0x8a176 + db $40 ; flags + db 00, 14 ; start coords + db 06, 19 ; end coords +; 8a17b + +Function8a17b: ; 8a17b (22:617b) + decoord 14, 0 + ld b, $5 + ld c, $4 + call Function89b3b + ld hl, MenuDataHeader_0x8a19a + ld a, [wd030] + call Function89d5e + ld hl, Function8a1b0 + call Function89d75 + jr nc, .asm_8a198 + ld a, $0 +.asm_8a198 + ld d, a + ret +; 8a19a (22:619a) + +MenuDataHeader_0x8a19a: ; 0x8a19a + db $40 ; flags + db 00, 14 ; start coords + db 06, 19 ; end coords + dw MenuData2_0x8a1a2 + db 1 ; default option +; 0x8a1a2 + +MenuData2_0x8a1a2: ; 0x8a1a2 + db $e0 ; flags + db 3 ; items + db "ひらく@" + db "すてる@" + db "もどる@" +; 0x8a1b0 + +Function8a1b0: ; 8a1b0 + hlcoord 0, 12 + ld b, $4 + ld c, $12 + call TextBox + hlcoord 1, 14 + ld a, [wcfa9] + ld de, Strings_8a1cc + dec a + ld c, a + call Function8919e + call PlaceString + ret +; 8a1cc + +Strings_8a1cc: ; 8a1cc + db "めいし", $25, "せいりと へんしゅうを" + next "おこないます" + db "@" + + db "めいしフ,ルダー", $25, "めいしと" + next "あんしょうばんごう", $1f, "けします" + db "@" + + db "まえ", $25, "がめん", $1d, "もどります" + db "@" +; 8a20d + + +Function8a20d: ; 8a20d (22:620d) + ld hl, UnknownText_0x8a232 + call PrintText + ld a, $2 + call Function89259 + ret c + ld hl, UnknownText_0x8a237 + call PrintText + ld a, $2 + call Function89259 + ret c + xor a + call Function8a2fe + ld hl, UnknownText_0x8a23c + call PrintText + xor a + and a + ret +; 8a232 (22:6232) + +UnknownText_0x8a232: ; 0x8a232 + ; If the CARD FOLDER is deleted, all its CARDS and the PASSCODE will also be deleted. Beware--a deleted CARD FOLDER can't be restored. Want to delete your CARD FOLDER? + text_jump UnknownText_0x1c53ee + db "@" +; 0x8a237 + +UnknownText_0x8a237: ; 0x8a237 + ; Are you sure you want to delete it? + text_jump UnknownText_0x1c5494 + db "@" +; 0x8a23c + +UnknownText_0x8a23c: ; 0x8a23c + ; The CARD FOLDER has been deleted. + text_jump UnknownText_0x1c54b9 + db "@" +; 0x8a241 + +Function8a241: ; 8a241 (22:6241) + call Function1d6e + call Function891fe + call Function8a262 + jr nc, .asm_8a254 + call Function891fe + call Function89b28 + scf + ret +.asm_8a254 + call Function891de + call WhiteBGMap + call Function1d7d + call Function891de + and a + ret + +Function8a262: ; 8a262 (22:6262) + call WhiteBGMap + call Function893e2 + call Function8923c + callba Function4a3a7 + callba Function49384 + hlcoord 1, 0 + call Function8a53d + hlcoord 12, 4 + call Function8a58d + ld a, $5 + hlcoord 12, 4, AttrMap + call Function8a5a3 + ld a, $6 + hlcoord 15, 4, AttrMap + call Function8a5a3 + xor a + ld [wd02e], a + ld bc, wd013 + call Function8b36c + call Function8b493 + call Function891ab + call Function32f9 + call Function8b5e7 + ret + +Function8a2aa: ; 8a2aa (22:62aa) + ld hl, MenuDataHeader_0x8a2ef + call LoadMenuDataHeader + ld hl, UnknownText_0x8a2f4 + call PrintText + ld a, $1 + call Function89259 + jr nc, .asm_8a2cf + ld hl, UnknownText_0x8a2f9 + call PrintText + ld a, $2 + call Function89259 + jr c, .asm_8a2ea + call Function8a20d + jr .asm_8a2ea +.asm_8a2cf + call ExitMenu + call Function8a241 + jr c, .asm_8a2ed + ld a, $1 + call Function8a313 + call CloseSRAM + call Function891de + call Function89245 + call Function89168 + and a + ret +.asm_8a2ea + call WriteBackup +.asm_8a2ed + scf + ret +; 8a2ef (22:62ef) + +MenuDataHeader_0x8a2ef: ; 0x8a2ef + db $40 ; flags + db 12, 00 ; start coords + db 17, 19 ; end coords +; 8a2f4 + +UnknownText_0x8a2f4: ; 0x8a2f4 + ; There is an older CARD FOLDER from a previous journey. Do you want to open it? + text_jump UnknownText_0x1c54dd + db "@" +; 0x8a2f9 + +UnknownText_0x8a2f9: ; 0x8a2f9 + ; Delete the old CARD FOLDER? + text_jump UnknownText_0x1c552d + db "@" +; 0x8a2fe + +Function8a2fe: ; 8a2fe (22:62fe) + call Function8a313 + call Function89305 + ld hl, $a603 + ld bc, $8 + ld a, -1 + call ByteFill + call CloseSRAM + ret + +Function8a313: ; 8a313 (22:6313) + ld c, a + call OpenSRAMBank4 + ld a, c + ld [$a60b], a + ret + +Function8a31c: ; 8a31c (22:631c) + push bc + call Function8923c + callba Function4a3a7 + callba Function49384 + hlcoord 1, 0 + call Function8a53d + hlcoord 12, 4 + call Function8a58d + call Function8a3b2 + pop bc + ld a, c + ld [wPocketCursorBuffer], a + ld [MenuSelection], a + call Function1c89 + call Function1c10 + ld hl, wcfa5 + set 7, [hl] +.asm_8a34e + call Function8a3a2 + call Function8923c + call Function8a453 + call Function8a4d3 + call Function8a4fc + call Function891ab + call Function32f9 + call Function8a383 + jr c, .asm_8a370 + jr z, .asm_8a34e +.asm_8a36a + call Function89448 + xor a + ld e, a + ret +.asm_8a370 + call Function89448 + call Function1bee + call Function8a3a2 + ld a, [MenuSelection] + cp $ff + jr z, .asm_8a36a + ld e, a + and a + ret + +Function8a383: ; 8a383 (22:6383) + callba Function241ba + ld a, c + ld hl, wcfa8 + and [hl] + ret z + bit 0, a + jr nz, .asm_8a399 + bit 1, a + jr nz, .asm_8a39e + xor a + ret +.asm_8a399 + call PlayClickSFX + scf + ret +.asm_8a39e + call PlayClickSFX + ret + +Function8a3a2: ; 8a3a2 (22:63a2) + ld a, [wcfa9] + dec a + ld hl, DefaultFlypoint + ld e, a + ld d, $0 + add hl, de + ld a, [hl] + ld [MenuSelection], a + ret + +Function8a3b2: ; 8a3b2 (22:63b2) + ld a, $1 + ld [MenuSelection], a + call Function8a4fc + call Function8a3df + jr nc, .asm_8a3ce + decoord 0, 2 + ld b, $6 + ld c, $9 + call Function89b3b + ld hl, MenuDataHeader_0x8a435 + jr .asm_8a3db +.asm_8a3ce + decoord 0, 2 + ld b, $8 + ld c, $9 + call Function89b3b + ld hl, MenuDataHeader_0x8a40f +.asm_8a3db + call CopyMenuDataHeader + ret + +Function8a3df: ; 8a3df (22:63df) + call OpenSRAMBank4 + ld hl, $a603 + call Function89b45 + call CloseSRAM + ld hl, DefaultFlypoint + jr c, .asm_8a3f8 + ld de, Unknown_8a408 + call Function8a400 + scf + ret +.asm_8a3f8 + ld de, Unknown_8a40b + call Function8a400 + and a + ret + +Function8a400: ; 8a400 (22:6400) + ld a, [de] + inc de + ld [hli], a + cp $ff + jr nz, Function8a400 + ret +; 8a408 (22:6408) + +Unknown_8a408: db 1, 2, -1 +Unknown_8a40b: db 1, 2, 3, -1 + +MenuDataHeader_0x8a40f: ; 0x8a40f + db $40 ; flags + db 02, 00 ; start coords + db 11, 10 ; end coords + dw MenuData2_0x8a417 + db 1 ; default option +; 0x8a417 + +MenuData2_0x8a417: ; 0x8a417 + db $a0 ; flags + db 4 ; items + db "めいしりスト@" + db "じぶんの めいし@" + db "めいしこうかん@" + db "やめる@" +; 0x8a435 + +MenuDataHeader_0x8a435: ; 0x8a435 + db $40 ; flags + db 02, 00 ; start coords + db 09, 10 ; end coords + dw MenuData2_0x8a43d + db 1 ; default option +; 0x8a43d + +MenuData2_0x8a43d: ; 0x8a43d + db $a0 ; flags + db 3 ; items + db "めいしりスト@" + db "じぶんの めいし@" + db "やめる@" +; 0x8a453 + +Function8a453: ; 8a453 (22:6453) + hlcoord 0, 12 + ld b, $4 + ld c, $12 + call TextBox + hlcoord 1, 14 + ld de, String_8a476 + ld a, [MenuSelection] + cp $ff + jr z, .asm_8a472 + ld de, Strings_8a483 + dec a + ld c, a + call Function8919e +.asm_8a472 + call PlaceString + ret +; 8a476 (22:6476) + +String_8a476: ; 8a476 + db "まえ", $25, "がめん", $1d, "もどります@" +; 8a483 + +Strings_8a483: ; 8a483 + db "おともだち", $25, "めいしは" + next "ここ", $1d, "いれておきます@" + + db "でんわばんごう", $1f, "いれると" + next "めいしこうかん", $4a, "できます@" + + db "ともだちと じぶん", $25, "めいしを" + next "せきがいせんで こうかん します@" +; 8a4d3 + +Function8a4d3: ; 8a4d3 (22:64d3) + ld a, [MenuSelection] + cp $1 + jr nz, .asm_8a4eb + ld a, $5 + hlcoord 12, 4, AttrMap + call Function8a5a3 + ld a, $7 + hlcoord 15, 4, AttrMap + call Function8a5a3 + ret +.asm_8a4eb + ld a, $7 + hlcoord 12, 4, AttrMap + call Function8a5a3 + ld a, $6 + hlcoord 15, 4, AttrMap + call Function8a5a3 + ret + +Function8a4fc: ; 8a4fc (22:64fc) + ld a, [MenuSelection] + cp $3 + jr nz, asm_8a529 + ld hl, wd012 + ld a, [hli] + ld b, a + ld a, [hld] + add b + ld [hl], a + ld b, a + ld c, $80 + call Function89cdf + call Function8a515 + ret + +Function8a515: ; 8a515 (22:6515) + ld hl, wd012 + ld a, [hl] + cp $38 + jr c, .asm_8a520 + cp $3c + ret c +.asm_8a520 + ld a, [wd013] + cpl + inc a + ld [wd013], a + ret + +asm_8a529: ; 8a529 (22:6529) + ld hl, wd012 + ld a, $3c + ld [hli], a + ld a, $ff + ld [hli], a + ld hl, Sprites + xor a + ld bc, $20 + call ByteFill + ret + +Function8a53d: ; 8a53d (22:653d) + push hl + ld a, $15 + ld c, $8 + ld de, $14 + call Function8a573 + ld a, $1d + ld c, $9 + call Function8a57c + inc a + ld [hl], a + call Function8a584 + pop hl + add hl, de + ld a, $1f + ld c, $8 + call Function8a573 + dec hl + ld a, $51 + ld [hli], a + ld a, $26 + ld c, $1 + call Function8a57c + ld a, $52 + ld c, $3 + call Function8a573 + ld a, $27 + ld c, $6 + +Function8a573: ; 8a573 (22:6573) + ld [hl], a + call Function8a584 + inc a + dec c + jr nz, Function8a573 + ret + +Function8a57c: ; 8a57c (22:657c) + ld [hl], a + call Function8a584 + dec c + jr nz, Function8a57c + ret + +Function8a584: ; 8a584 (22:6584) + push af + ld a, $4 + call Function89215 + inc hl + pop af + ret + +Function8a58d: ; 8a58d (22:658d) + ld a, $2d + ld bc, $606 + ld de, $14 +.asm_8a595 + push bc + push hl +.asm_8a597 + ld [hli], a + inc a + dec c + jr nz, .asm_8a597 + pop hl + add hl, de + pop bc + dec b + jr nz, .asm_8a595 + ret + +Function8a5a3: ; 8a5a3 (22:65a3) + ld bc, $603 + ld de, $14 +.asm_8a5a9 + push bc + push hl +.asm_8a5ab + ld [hli], a + dec c + jr nz, .asm_8a5ab + pop hl + add hl, de + pop bc + dec b + jr nz, .asm_8a5a9 + ret + +Function8a5b6: ; 8a5b6 (22:65b6) + ld a, [rSVBK] ; $ff00+$70 + push af + ld a, $5 + ld [rSVBK], a ; $ff00+$70 + ld hl, Palette_8a5e5 + ld de, wd020 + ld bc, $18 + call CopyBytes + ld hl, Palette_8a5fd + ld de, Unkn2Pals + ld bc, $8 + call CopyBytes + ld hl, Palette_8a605 + ld de, wd048 + ld bc, $8 + call CopyBytes + pop af + ld [rSVBK], a ; $ff00+$70 + ret +; 8a5e5 (22:65e5) + +Palette_8a5e5: ; 8a5e5 + RGB 31, 31, 31 + RGB 27, 19, 00 + RGB 07, 11, 22 + RGB 00, 00, 00 + RGB 31, 31, 31 + RGB 16, 16, 31 + RGB 27, 19, 00 + RGB 00, 00, 00 + RGB 31, 31, 31 + RGB 31, 00, 00 + RGB 27, 19, 00 + RGB 00, 00, 00 +; 8a5fd + +Palette_8a5fd: ; 8a5fd + RGB 00, 00, 00 + RGB 00, 00, 00 + RGB 00, 00, 00 + RGB 31, 31, 31 +; 8a605 + +Palette_8a605: ; 8a605 + RGB 00, 00, 00 + RGB 14, 18, 31 + RGB 16, 16, 31 + RGB 31, 31, 31 +; 8a60d + +Function8a60d: ; 8a60d + ld a, [rSVBK] + push af + ld a, $5 + ld [rSVBK], a + ld hl, Palette_8a624 + ld de, Unkn2Pals + ld bc, $0008 + call CopyBytes + pop af + ld [rSVBK], a + ret +; 8a624 + +Palette_8a624: ; 8a624 + RGB 31, 31, 31 + RGB 31, 31, 31 + RGB 31, 31, 31 + RGB 00, 00, 00 +; 8a62c + +Function8a62c: ; 8a62c (22:662c) + call Function1d6e + call Function891fe + xor a + call Function8b94a + call Function8b677 +.asm_8a639 + xor a + ld [wd033], a + ld [wd032], a + ld [wd0e3], a + call Function8b7bd + ld a, c + and a + jr z, .asm_8a66a + ld [MenuSelection], a + ld b, a + ld a, [wcf77] + inc a + ld [wd034], a + push bc + call Function8b960 + ld a, c + pop bc + jr z, .asm_8a639 + ld c, a + ld hl, Jumptable_8a671 + ld a, b + ld [MenuSelection], a + ld a, c + dec a + rst JumpTable + jr .asm_8a639 +.asm_8a66a + call Function891fe + call Function89b28 + ret + +Jumptable_8a671: ; 8a671 (22:6671) + dw Function8a679 + dw Function8a6cd + dw Function8a8c3 + dw Function8a930 + + +Function8a679: ; 8a679 (22:6679) + call Function891de + call WhiteBGMap + call Function893cc + call OpenSRAMBank4 + call Function8931b + call Function89844 + call CloseSRAM + call OpenSRAMBank4 + call Function8939a + call Function89856 + hlcoord 1, 13 + call Function899fe + call Function891ab + call CloseSRAM +.asm_8a6a3 + call Function89a57 + jr c, .asm_8a6a3 + and a + jr z, Function8a679 + ld hl, Jumptable_8a6bc + dec a + rst JumpTable + jr c, Function8a679 + call Function891fe + call Function8b677 + call Function89448 + ret + +Jumptable_8a6bc: ; 8a6bc (22:66bc) + dw Function8a6c0 + dw Function8a6c5 + + +Function8a6c0: ; 8a6c0 (22:66c0) + call PlayClickSFX + and a + ret + +Function8a6c5: ; 8a6c5 (22:66c5) + call PlayClickSFX + call Function89d0d + scf + ret + +Function8a6cd: ; 8a6cd (22:66cd) + call Function891de + call WhiteBGMap + call Function893cc + call OpenSRAMBank4 + call Function8931b + call Function89844 + call Function8a757 + call CloseSRAM +.asm_8a6e5 + call OpenSRAMBank4 + call Function8931b + call Function89856 + call Function89a2e + call Function891ab + xor a + ld [wd02f], a + call CloseSRAM +.asm_8a6fb + call Function89b97 + call Function89c67 + jr c, .asm_8a718 + ld a, b + and a + jr z, .asm_8a6fb + call PlayClickSFX + call Function89448 + ld a, [wd011] + ld hl, Jumptable_8a74f + rst JumpTable + jr nc, .asm_8a6e5 + jr .asm_8a742 +.asm_8a718 + call OpenSRAMBank4 + call Function8a765 + call CloseSRAM + jr nc, .asm_8a73f + call Function8923c + call Function89448 + call Function89a23 + hlcoord 1, 13 + ld de, String_89135 + call PlaceString + call WaitBGMap + ld a, $2 + call Function89254 + jr c, .asm_8a6e5 +.asm_8a73f + call CloseSRAM +.asm_8a742 + call WhiteBGMap + call Function89448 + call Function891d3 + call Function8b677 + ret + +Jumptable_8a74f: ; 8a74f (22:674f) + dw Function8a78c + dw Function8a7cb + dw Function8a818 + dw Function8a8a1 + + +Function8a757: ; 8a757 (22:6757) + call Function8939a + xor a + ld [wd010], a + ld [wd011], a + ld [wd012], a + ret + +Function8a765: ; 8a765 (22:6765) + call Function8931b + push bc + ld hl, $0 + add hl, bc + ld de, DefaultFlypoint + ld c, $6 + call Function89185 + pop bc + jr nz, .asm_8a78a + push bc + ld hl, $11 + add hl, bc + ld de, wd008 + ld c, $8 + call Function89185 + pop bc + jr nz, .asm_8a78a + and a + ret +.asm_8a78a + scf + ret + +Function8a78c: ; 8a78c (22:678c) + call Function891fe + ld de, DefaultFlypoint + ld b, $5 + callba Function116c1 + call OpenSRAMBank4 + call Function8931b + push bc + ld hl, $0 + add hl, bc + ld d, h + ld e, l + ld hl, DefaultFlypoint + call InitName + call CloseSRAM + call DelayFrame + call JoyTextDelay + call Function891de + call WhiteBGMap + call Function893cc + call OpenSRAMBank4 + pop bc + call Function89844 + call CloseSRAM + and a + ret + +Function8a7cb: ; 8a7cb (22:67cb) + ld a, [MenuSelection] + push af + call Function891de + ld de, wd008 + ld c, $0 + callba Function17a68f + jr c, .asm_8a7f4 + ld hl, wd008 + ld a, $ff + ld bc, $8 + call ByteFill + ld h, d + ld l, e + ld de, wd008 + ld c, $8 + call Function89193 +.asm_8a7f4 + pop af + ld [MenuSelection], a + call Function891de + call WhiteBGMap + call Function893cc + call OpenSRAMBank4 + call Function8931b + call Function89844 + call Function89856 + call Function89a2e + call Function891ab + call CloseSRAM + and a + ret + +Function8a818: ; 8a818 (22:6818) + call Function89a23 + ld hl, DefaultFlypoint + call Function89331 + jr c, .asm_8a875 + ld hl, wd008 + call Function89b45 + jr nc, .asm_8a87a + call OpenSRAMBank4 + call Function8a765 + jr nc, .asm_8a863 + call Function8931b + push bc + ld hl, $0 + add hl, bc + ld d, h + ld e, l + ld hl, DefaultFlypoint + ld c, $6 + call Function89193 + pop bc + ld hl, $11 + add hl, bc + ld d, h + ld e, l + ld hl, wd008 + ld c, $8 + call Function89193 + hlcoord 1, 13 + ld de, .string_8a868 + call PlaceString + call WaitBGMap + call JoyWaitAorB +.asm_8a863 + call CloseSRAM + scf + ret +; 8a868 (22:6868) + +.string_8a868 + db "めいし", $1f, "かきかえ まし", $22, "@" + +.asm_8a875 + ld de, String_8a88b + jr .asm_8a87d +.asm_8a87a + ld de, String_8911c +.asm_8a87d + hlcoord 1, 13 + call PlaceString + call WaitBGMap + call JoyWaitAorB + and a + ret +; 8a88b (22:688b) + +String_8a88b: ; 8a88b + db "おともだち", $25, "なまえが" + next "かかれて いません!@" +; 8a8a1 + +Function8a8a1: ; 8a8a1 (22:68a1) + call OpenSRAMBank4 + call Function8a765 + call CloseSRAM + jr nc, .asm_8a8bf + call Function89a23 + hlcoord 1, 13 + ld de, String_89135 + call PlaceString + ld a, $2 + call Function89254 + jr c, .asm_8a8c1 +.asm_8a8bf + scf + ret +.asm_8a8c1 + and a + ret + +Function8a8c3: ; 8a8c3 (22:68c3) + call Function891de + call WhiteBGMap + call Function893cc + call OpenSRAMBank4 + call Function8931b + call Function89844 + call Function8939a + call Function89856 + call CloseSRAM + call Function891ab + hlcoord 1, 13 + ld de, String_8a919 + call PlaceString + ld a, $2 + call Function89254 + jr c, .asm_8a90f + call OpenSRAMBank4 + call Function892b4 + call CloseSRAM + call Function89a23 + call Function8923c + hlcoord 1, 13 + ld de, String_8a926 + call PlaceString + call WaitBGMap + call JoyWaitAorB +.asm_8a90f + call Function89448 + call Function891fe + call Function8b677 + ret +; 8a919 (22:6919) + +String_8a919: ; 8a919 + db "このデータ", $1f, "けしますか?@" +; 8a926 + +String_8a926: ; 8a926 + db "データ", $1f, "けしまし", $22, "@" +; 8a930 + +Function8a930: ; 8a930 (22:6930) + ld a, [MenuSelection] + push af + xor a + ld [wd032], a + ld a, $1 + ld [wd033], a + ld a, [wd034] + ld [wd0e3], a +.asm_8a943 + call Function8b7bd + ld a, [wcf73] + and $1 + jr nz, .asm_8a953 + ld a, c + and a + jr nz, .asm_8a943 + pop af + ret +.asm_8a953 + call OpenSRAMBank4 + pop af + cp c + jr z, .asm_8a995 + push bc + ld [MenuSelection], a + call Function8931b + push bc + ld h, b + ld l, c + ld de, DefaultFlypoint + ld bc, $25 + call CopyBytes + pop de + pop bc + ld a, c + ld [MenuSelection], a + call Function8931b + push bc + ld h, b + ld l, c + ld bc, $25 + call CopyBytes + pop de + ld hl, DefaultFlypoint + ld bc, $25 + call CopyBytes + ld de, SFX_SWITCH_POKEMON + call WaitPlaySFX + ld de, SFX_SWITCH_POKEMON + call WaitPlaySFX +.asm_8a995 + call CloseSRAM + ret + +Function8a999: ; 8a999 (22:6999) + ld hl, MenuDataHeader_0x8a9c9 + call LoadMenuDataHeader + ld c, $1 +.asm_8a9a1 + call Function8a9ce + jr c, .asm_8a9bb + push bc + push de + call Function1d6e + pop de + dec e + ld a, e + ld hl, Jumptable_8a9c5 + rst JumpTable + call Function891fe + call Function89b28 + pop bc + jr .asm_8a9a1 +.asm_8a9bb + call Function89209 + call WriteBackup + call Function8920f + ret + +Jumptable_8a9c5: ; 8a9c5 (22:69c5) + dw Function8aa0a + dw Function8ab3b +; 8a9c9 (22:69c9) + +MenuDataHeader_0x8a9c9: ; 0x8a9c9 + db $40 ; flags + db 04, 11 ; start coords + db 11, 18 ; end coords +; 8a9ce + +Function8a9ce: ; 8a9ce (22:69ce) + push bc + decoord 11, 4 + ld b, $6 + ld c, $6 + call Function89b3b + pop bc + ld a, c + ld hl, MenuDataHeader_0x8a9f2 + call Function89d5e + ld hl, Function8aa09 + call Function89d85 + jr c, .asm_8a9ed + ld c, a + ld e, a + and a + ret +.asm_8a9ed + ld c, a + ld e, $0 + scf + ret +; 8a9f2 (22:69f2) + +MenuDataHeader_0x8a9f2: ; 0x8a9f2 + db $40 ; flags + db 04, 11 ; start coords + db 11, 18 ; end coords + dw MenuData2_0x8a9fa + db 1 ; default option +; 0x8a9fa + +MenuData2_0x8a9fa: ; 0x8a9fa + db $a0 ; flags + db 3 ; items + db "へんしゅう@" + db "みる@" + db "やめる@" +; 0x8aa09 + +Function8aa09: ; 8aa09 + ret +; 8aa0a + +Function8aa0a: ; 8aa0a (22:6a0a) + ld a, $1 + ld [wd02f], a + ld [wd011], a + xor a + ld [wd010], a + ld [wd012], a + call OpenSRAMBank4 + ld hl, $a603 + ld de, wd008 + call Function89381 + call CloseSRAM + call Function891fe + call WhiteBGMap + call Function893cc + call Function89807 + call Function89492 + call Function894ca +.asm_8aa3a + call Function8987f + call Function89a2e + call Function891ab +.asm_8aa43 + call Function89b97 + call Function89c67 + jr c, .asm_8aa61 + ld a, b + and a + jr z, .asm_8aa43 + call PlayClickSFX + call Function89448 + ld a, [wd011] + dec a + ld hl, Jumptable_8aa6d + rst JumpTable + jr nc, .asm_8aa3a + jr .asm_8aa69 +.asm_8aa61 + call Function89448 + call Function8ab11 + jr nc, .asm_8aa3a +.asm_8aa69 + call Function89448 + ret + +Jumptable_8aa6d: ; 8aa6d (22:6a6d) + dw Function8aa73 + dw Function8aab6 + dw Function8ab11 + + +Function8aa73: ; 8aa73 (22:6a73) + ld a, [MenuSelection] + ld e, a + push de + call Function891de + ld de, wd008 + ld c, $0 + callba Function17a68f + jr c, .asm_8aa9d + ld hl, wd008 + ld a, $ff + ld bc, $8 + call ByteFill + ld h, d + ld l, e + ld de, wd008 + ld c, $8 + call Function89193 +.asm_8aa9d + call Function891fe + call WhiteBGMap + call Function893cc + call Function89807 + call Function89492 + call Function894ca + pop de + ld a, e + ld [MenuSelection], a + and a + ret + +Function8aab6: ; 8aab6 (22:6ab6) + call Function89a23 + ld hl, wd008 + call Function89b45 + jr nc, Function8ab00 + call OpenSRAMBank4 + ld de, wd008 + ld hl, $a603 + ld c, $8 + call Function89185 + jr z, .asm_8aaeb + ld hl, wd008 + ld de, $a603 + ld c, $8 + call Function89193 + hlcoord 1, 13 + ld de, String_8aaf0 + call PlaceString + call WaitBGMap + call JoyWaitAorB +.asm_8aaeb + call CloseSRAM + scf + ret +; 8aaf0 (22:6af0) + +String_8aaf0: ; 8aaf0 + db "あたらしい めいし", $4a, "できまし", $22, "@" +; 8ab00 + +Function8ab00: ; 8ab00 + ld de, String_8911c + hlcoord 1, 13 + call PlaceString + call WaitBGMap + call Function89235 + and a + ret + +Function8ab11: ; 8ab11 (22:6b11) + call OpenSRAMBank4 + ld hl, $a603 + ld de, wd008 + ld c, $8 + call Function89185 + call CloseSRAM + jr z, .asm_8ab37 + call Function89a23 + hlcoord 1, 13 + ld de, String_89135 + call PlaceString + ld a, $2 + call Function89254 + jr c, .asm_8ab39 +.asm_8ab37 + scf + ret +.asm_8ab39 + and a + ret + +Function8ab3b: ; 8ab3b (22:6b3b) + call Function891fe + call WhiteBGMap + call Function893cc + call Function89807 + call Function89492 + call Function894ca + call OpenSRAMBank4 + ld hl, $a603 + ld de, wd008 + call Function89381 + call CloseSRAM + call Function8987f + call OpenSRAMBank4 + hlcoord 1, 13 + ld bc, $a007 + call Function89a0c + call CloseSRAM + call Function891ab + call Function8ab77 + jr c, Function8ab3b + ret + +Function8ab77: ; 8ab77 (22:6b77) + call Function354b + bit 0, c + jr nz, .asm_8ab8e + bit 1, c + jr nz, .asm_8ab8e + bit 3, c + jr z, Function8ab77 + call PlayClickSFX + call Function89d0d + scf + ret +.asm_8ab8e + call PlayClickSFX + and a + ret + +Function8ab93: ; 8ab93 (22:6b93) + call WhiteBGMap + call Function1d6e + callba Function105688 + call ClearSprites + call Function891fe + call Function89b28 + ret +; 8aba9 (22:6ba9) + +Function8aba9: ; 8aba9 + ld a, $2 + call Function8b94a + ld a, $1 + ld [wd032], a +.asm_8abb3 + call Function891fe + call Function8b677 +.asm_8abb9 + call Function8b7bd + jr z, .asm_8abdf + ld a, c + ld [MenuSelection], a + call OpenSRAMBank4 + call Function8931b + ld hl, $0011 + add hl, bc + call Function89b45 + call CloseSRAM + jr c, .asm_8abe2 + ld de, SFX_WRONG + call WaitPlaySFX + call CloseSRAM + jr .asm_8abb9 + +.asm_8abdf + xor a + ld c, a + ret + +.asm_8abe2 + call PlayClickSFX +.asm_8abe5 + call Function891de + call WhiteBGMap + call Function893cc + call OpenSRAMBank4 + call Function8931b + call Function89844 + call CloseSRAM + call OpenSRAMBank4 + call Function8939a + call Function89856 + hlcoord 1, 13 + call Function899fe + call CloseSRAM + call Function891ab +.asm_8ac0f + call Function89a57 + jr c, .asm_8ac0f + and a + jr z, .asm_8abe5 + cp $2 + jr z, .asm_8ac0f + hlcoord 0, 12 + ld b, $4 + ld c, $12 + call TextBox + hlcoord 1, 14 + ld de, String_8ac3b + call PlaceString + ld a, $1 + call Function8925e + jp c, .asm_8abb3 + ld a, [MenuSelection] + ld c, a + ret +; 8ac3b + +String_8ac3b: ; 8ac3b + db "こ", $25, "ともだち", $1d, "でんわを" + next "かけますか?@" +; 8ac4e + +Function8ac4e: ; 8ac4e + xor a + ld [MenuSelection], a + push de + call Function891de + call WhiteBGMap + call Function893cc + pop bc + call Function89844 + call Function8939a + call Function89856 + hlcoord 1, 13 + call Function899fe + call Function891ab + ret +; 8ac70 + +Function8ac70: ; 8ac70 + push de + ld a, $3 + call Function8b94a + +Function8ac76: ; 8ac76 + call Function891fe + call Function8b677 + +Function8ac7c: ; 8ac7c + call Function8b7bd + jr z, .asm_8acf0 + ld a, c + ld [wd02f], a + ld [MenuSelection], a + call OpenSRAMBank4 + call Function8931b + call Function8932d + call CloseSRAM + jr nc, .asm_8acb0 + call OpenSRAMBank4 + ld hl, $0011 + add hl, bc + call Function89b45 + call CloseSRAM + jr nc, .asm_8accc + call OpenSRAMBank4 + call Function892b7 + call CloseSRAM + jr .asm_8accc + +.asm_8acb0 + call Function8ad0b + jr c, Function8ac76 + and a + jr nz, .asm_8accc + call OpenSRAMBank4 + ld h, b + ld l, c + ld d, $0 + ld e, $6 + add hl, de + ld d, h + ld e, l + pop hl + ld c, $1f + call Function89193 + jr .asm_8ace4 + +.asm_8accc + pop hl + call OpenSRAMBank4 + ld d, b + ld e, c + ld c, $6 + call Function89193 + ld a, $6 + add e + ld e, a + ld a, $0 + adc d + ld d, a + ld c, $1f + call Function89193 + +.asm_8ace4 + call CloseSRAM + call Functione51 + ld a, [wd02f] + ld c, a + and a + ret + +.asm_8acf0 + ld hl, UnknownText_0x8ad06 + call PrintText + ld a, $2 + call Function89259 + jp c, Function8ac7c + call Functione51 + pop de + ld c, $0 + scf + ret +; 8ad06 + +UnknownText_0x8ad06: ; 0x8ad06 + ; Finish registering CARDS? + text_jump UnknownText_0x1c554a + db "@" +; 0x8ad0b + +Function8ad0b: ; 8ad0b +.asm_8ad0b + ld a, [MenuSelection] + ld [wd02f], a + call Function891de + call WhiteBGMap + call Function893cc + call OpenSRAMBank4 + call Function8931b + push bc + call Function89844 + call Function8939a + call Function89856 + hlcoord 1, 13 + call Function899fe + call CloseSRAM + call Function891ab + pop bc +.asm_8ad37 + push bc + call Function89a57 + pop bc + jr c, .asm_8ad37 + and a + jr z, .asm_8ad0b + cp $2 + jr z, .asm_8ad37 + call Function8923c + push bc + hlcoord 0, 12 + ld b, $4 + ld c, $12 + call TextBox + ld de, String_8ad89 + hlcoord 1, 14 + call PlaceString + ld a, $2 + call Function8925e + jr c, .asm_8ad87 + call Function8923c + hlcoord 0, 12 + ld b, $4 + ld c, $12 + call TextBox + ld de, String_8ad9c + hlcoord 1, 14 + call PlaceString + ld a, $1 + call Function8925e + jr c, .asm_8ad84 + ld a, $0 + jr .asm_8ad86 + +.asm_8ad84 + ld a, $1 + +.asm_8ad86 + and a + +.asm_8ad87 + pop bc + ret +; 8ad89 + +String_8ad89: ; 8ad89 + db "こ", $25, "めいし", $1f, "けして" + next "いれかえますか?@" +; 8ad9c + +String_8ad9c: ; 8ad9c + db "おともだち", $25, "なまえを" + next "のこして おきますか?@" +; 8adb3 + +Function8adb3: ; 8adb3 + call Function891de + call Function8a262 + push af + call Function891de + pop af + ret +; 8adbf + +Function8adbf: ; 8adbf + call OpenSRAMBank4 + ld hl, $a603 + call Function89b45 + call CloseSRAM + ret +; 8adcc + +Function8adcc: ; 8adcc + call OpenSRAMBank4 + call Function8b3b0 + call CloseSRAM + ret nc + cp $2 + ret z + scf + ret +; 8addb diff --git a/misc/mobile_22_2.asm b/misc/mobile_22_2.asm new file mode 100644 index 000000000..6e9091fa4 --- /dev/null +++ b/misc/mobile_22_2.asm @@ -0,0 +1,1155 @@ +Function8b342:: ; 8b342 +; Loads the secondary map header pointer, then runs through a +; jumptable with three dummy functions. Spends a lot of energy +; doing pretty much nothing. + call GetSecondaryMapHeaderPointer + ld d, h + ld e, l + +; Everything between here and "ret" is useless. + xor a +.loop + push af + ld hl, .jumptable + rst JumpTable + pop af + inc a + cp 3 + jr nz, .loop + ret +; 8b354 + +.jumptable: ; 8b354 + dw .zero + dw .one + dw .two +; 8b35a + +.zero: ; 8b35a + mobile +; 8b35b + +.one: ; 8b35b + mobile +; 8b35c + +.two: ; 8b35c + mobile +; 8b35d + +Function8b35d: ; 8b35d + ld a, h + cp d + ret nz + ld a, l + cp e + ret +; 8b363 + +Function8b363: ; 8b363 + push bc + callba Function10632f + pop bc + ret +; 8b36c + +Function8b36c: ; 8b36c (22:736c) + push bc + ld h, b + ld l, c + ld bc, $4 + ld a, -1 + call ByteFill + pop bc + ret + +Function8b379: ; 8b379 (22:7379) + push bc + ld a, c + add e + ld c, a + ld a, $0 + adc b + ld b, a + ld a, [bc] + ld d, a + pop bc + ret + +Function8b385: ; 8b385 (22:7385) + push bc + ld a, c + add e + ld c, a + ld a, $0 + adc b + ld b, a + ld a, d + ld [bc], a + pop bc + ret + +Function8b391: ; 8b391 (22:7391) + push bc + ld e, $0 + ld d, $4 +.asm_8b396 + ld a, [bc] + inc bc + cp $ff + jr z, .asm_8b3a2 + inc e + dec d + jr nz, .asm_8b396 + dec e + scf +.asm_8b3a2 + pop bc + ret + +Function8b3a4: ; 8b3a4 (22:73a4) + push de + push bc + ld d, b + ld e, c + ld c, $4 + call Function89185 + pop bc + pop de + ret + +Function8b3b0: ; 8b3b0 (22:73b0) + ld bc, $a037 + ld a, [$a60b] + and a + jr z, .asm_8b3c2 + cp $3 + jr nc, .asm_8b3c2 + call Function8b391 + jr c, .asm_8b3c9 +.asm_8b3c2 + call Function8b36c + xor a + ld [$a60b], a +.asm_8b3c9 + ld a, [$a60b] + ret + +Function8b3cd: ; 8b3cd (22:73cd) + push de + push bc + ld e, $4 +.asm_8b3d1 + ld a, [bc] + inc bc + call Function8998b + inc hl + dec e + jr nz, .asm_8b3d1 + pop bc + pop de + ret + +Function8b3dd: ; 8b3dd (22:73dd) + push de + push bc + call Function354b + ld a, c + pop bc + pop de + bit 0, a + jr nz, .asm_8b3f7 + bit 1, a + jr nz, .asm_8b40e + bit 6, a + jr nz, .asm_8b429 + bit 7, a + jr nz, .asm_8b443 + and a + ret +.asm_8b3f7 + ld a, e + cp $3 + jr z, .asm_8b407 + inc e + ld d, $0 + call Function8b385 + xor a + ld [wd010], a + ret +.asm_8b407 + call PlayClickSFX + ld d, $0 + scf + ret +.asm_8b40e + ld a, e + and a + jr nz, .asm_8b41e + call PlayClickSFX + ld d, $ff + call Function8b385 + ld d, $1 + scf + ret +.asm_8b41e + ld d, $ff + call Function8b385 + dec e + xor a + ld [wd010], a + ret +.asm_8b429 + call Function8b379 + ld a, d + cp $a + jr c, .asm_8b433 + ld d, $9 +.asm_8b433 + inc d + ld a, d + cp $a + jr c, .asm_8b43b + ld d, $0 +.asm_8b43b + call Function8b385 + xor a + ld [wd010], a + ret +.asm_8b443 + call Function8b379 + ld a, d + cp $a + jr c, .asm_8b44d + ld d, $0 +.asm_8b44d + ld a, d + dec d + and a + jr nz, .asm_8b454 + ld d, $9 +.asm_8b454 + call Function8b385 + xor a + ld [wd010], a + ret + +Function8b45c: ; 8b45c (22:745c) + call Function8b36c + xor a + ld [wd010], a + ld [wd012], a + call Function8b391 + ld d, $0 + call Function8b385 +.asm_8b46e + call Function8923c + call Function8b493 + call Function8b4cc + call Function8b518 + call Function89b78 + push bc + call Function8b4fd + call Function89c44 + ld a, $1 + ld [hBGMapMode], a ; $ff00+$d4 + pop bc + call Function8b3dd + jr nc, .asm_8b46e + ld a, d + and a + ret z + scf + ret + +Function8b493: ; 8b493 (22:7493) + push bc + call Function8923c + call Function8b521 + ld hl, Jumptable_8b4a0 + pop bc + rst JumpTable + ret + +Jumptable_8b4a0: ; 8b4a0 (22:74a0) + dw Function8b4a4 + dw Function8b4b8 + + +Function8b4a4: ; 8b4a4 (22:74a4) + push bc + push de + call Function8b4d8 + call TextBox + pop de + pop bc + call Function8b4cc + call Function8b518 + call Function8b3cd + ret + +Function8b4b8: ; 8b4b8 (22:74b8) + push bc + push de + call Function8b4ea + call Function89b3b + pop de + pop bc + call Function8b4cc + call Function8b518 + call Function8b3cd + ret + +Function8b4cc: ; 8b4cc (22:74cc) + push bc + ld hl, Unknown_8b529 + call Function8b50a + ld a, [hli] + ld h, [hl] + ld l, a + pop bc + ret + +Function8b4d8: ; 8b4d8 (22:74d8) + ld hl, Unknown_8b529 + call Function8b50a + push hl +rept 2 + inc hl +endr + ld a, [hli] + ld b, a + ld a, [hl] + ld c, a + pop hl + ld a, [hli] + ld h, [hl] + ld l, a + ret + +Function8b4ea: ; 8b4ea (22:74ea) + ld hl, Unknown_8b529 + call Function8b50a + push hl +rept 2 + inc hl +endr + ld a, [hli] + ld b, a + ld a, [hl] + ld c, a + pop hl + ld a, [hli] + ld e, a + ld a, [hl] + ld d, a + ret + +Function8b4fd: ; 8b4fd (22:74fd) + ld hl, Unknown_8b529 + 4 + call Function8b50a + ld a, [hli] + ld c, a + ld a, [hli] + ld b, a + ld a, [hli] + ld d, a + ret + +Function8b50a: ; 8b50a (22:750a) + ld a, [wd02e] + and a + ret z + ld b, $0 + ld c, $8 +.asm_8b513 + add hl, bc + dec a + jr nz, .asm_8b513 + ret + +Function8b518: ; 8b518 (22:7518) + push de + ld d, $0 + ld e, $14 + add hl, de + inc hl + pop de + ret + +Function8b521: ; 8b521 (22:7521) + ld hl, Unknown_8b529 + 7 + call Function8b50a + ld a, [hl] + ret +; 8b529 (22:7529) + +Unknown_8b529: ; 8b529 + dwcoord 2, 5 + db 1, 4, $20, $49, 0, 1 + dwcoord 7, 4 + db 1, 4, $48, $41, 0, 0 +; 8b539 + +Function8b539: ; 8b539 (22:7539) + ld bc, wd017 + call Function8b36c + xor a + ld [wd012], a + ld [wd02e], a + call Function8b493 + call Function8b4fd + ld e, $0 + call Function89c44 + call Function3238 + ret + +Function8b555: ; 8b555 (22:7555) + ld hl, UnknownText_0x8b5ce + call PrintText + ld bc, wd017 + call Function8b45c + jr c, .asm_8b5c8 + call Function89448 + ld bc, wd017 + call Function8b493 + ld bc, wd017 + call Function8b664 + jr nz, .asm_8b57c + ld hl, UnknownText_0x8b5e2 + call PrintText + jr Function8b555 +.asm_8b57c + ld hl, UnknownText_0x8b5d3 + call PrintText + ld bc, wd013 + call Function8b45c + jr c, Function8b555 + ld bc, wd017 + ld hl, wd013 + call Function8b3a4 + jr z, .asm_8b5a6 + call Function89448 + ld bc, wd013 + call Function8b493 + ld hl, UnknownText_0x8b5d8 + call PrintText + jr .asm_8b57c +.asm_8b5a6 + call OpenSRAMBank4 + ld hl, wd013 + ld de, $a037 + ld bc, $4 + call CopyBytes + call CloseSRAM + call Function89448 + ld bc, wd013 + call Function8b493 + ld hl, UnknownText_0x8b5dd + call PrintText + and a +.asm_8b5c8 + push af + call Function89448 + pop af + ret +; 8b5ce (22:75ce) + +UnknownText_0x8b5ce: ; 0x8b5ce + ; Please enter any four-digit number. + text_jump UnknownText_0x1bc187 + db "@" +; 0x8b5d3 + +UnknownText_0x8b5d3: ; 0x8b5d3 + ; Enter the same number to confirm. + text_jump UnknownText_0x1bc1ac + db "@" +; 0x8b5d8 + +UnknownText_0x8b5d8: ; 0x8b5d8 + ; That's not the same number. + text_jump UnknownText_0x1bc1cf + db "@" +; 0x8b5dd + +UnknownText_0x8b5dd: ; 0x8b5dd + ; Your PASSCODE has been set. Enter this number next time to open the CARD FOLDER. + text_jump UnknownText_0x1bc1eb + db "@" +; 0x8b5e2 + +UnknownText_0x8b5e2: ; 0x8b5e2 + ; 0000 is invalid! + text_jump UnknownText_0x1bc23e + db "@" +; 0x8b5e7 + +Function8b5e7: ; 8b5e7 (22:75e7) + ld bc, wd013 + call Function8b36c + xor a + ld [wd012], a + ld [wd02e], a + call Function8b493 + call Function891ab + call Function8b4fd + ld e, $0 + call Function89c44 +.asm_8b602 + ld hl, UnknownText_0x8b642 + call PrintText + ld bc, wd013 + call Function8b45c + jr c, .asm_8b63c + call Function89448 + ld bc, wd013 + call Function8b493 + call OpenSRAMBank4 + ld hl, $a037 + call Function8b3a4 + call CloseSRAM + jr z, .asm_8b635 + ld hl, UnknownText_0x8b647 + call PrintText + ld bc, wd013 + call Function8b36c + jr .asm_8b602 +.asm_8b635 + ld hl, UnknownText_0x8b64c + call PrintText + and a +.asm_8b63c + push af + call Function89448 + pop af + ret +; 8b642 (22:7642) + +UnknownText_0x8b642: ; 0x8b642 + ; Enter the CARD FOLDER PASSCODE. + text_jump UnknownText_0x1bc251 + db "@" +; 0x8b647 + +UnknownText_0x8b647: ; 0x8b647 + ; Incorrect PASSCODE! + text_jump UnknownText_0x1bc272 + db "@" +; 0x8b64c + +UnknownText_0x8b64c: ; 0x8b64c + ; CARD FOLDER open.@ @ + text_jump UnknownText_0x1bc288 + start_asm +; 0x8b651 + +Function8b651: ; 8b651 + ld de, SFX_TWINKLE + call PlaySFX + call WaitSFX + ld c, $8 + call DelayFrames + ld hl, .string_8b663 + ret +.string_8b663 + db "@" +; 8b664 + +Function8b664: ; 8b664 (22:7664) + push bc + ld de, $4 +.asm_8b668 + ld a, [bc] + cp $0 + jr nz, .asm_8b66e + inc d +.asm_8b66e + inc bc + dec e + jr nz, .asm_8b668 + pop bc + ld a, d + cp $4 + ret + +Function8b677: ; 8b677 + call WhiteBGMap + call DisableLCD + call Function8b690 + call Function8b6bb + call Function8b6ed + call EnableLCD + call Function891ab + call Function32f9 + ret +; 8b690 + +Function8b690: ; 8b690 + ld hl, GFX_17afa5 + $514 + ld de, VTiles2 + ld bc, $160 + ld a, BANK(GFX_17afa5) + call FarCopyBytes + ld hl, GFX_17afa5 + $514 + $160 - $10 + ld de, VTiles2 tile $61 + ld bc, $10 + ld a, BANK(GFX_17afa5) + call FarCopyBytes + ld hl, GFX_17afa5 + $514 + $160 + ld de, VTiles1 tile $6e + ld bc, $10 + ld a, BANK(GFX_17afa5) + call FarCopyBytes + ret +; 8b6bb + +Function8b6bb: ; 8b6bb + ld a, [rSVBK] + push af + ld a, $5 + ld [rSVBK], a + ld hl, Palette_8b6d5 + ld de, Unkn1Pals + ld bc, $0018 + call CopyBytes + pop af + ld [rSVBK], a + call Function8949c + ret +; 8b6d5 + +Palette_8b6d5: ; 8b6d5 + RGB 31, 31, 31 + RGB 31, 21, 00 + RGB 14, 07, 03 + RGB 00, 00, 00 + RGB 31, 31, 31 + RGB 31, 21, 00 + RGB 22, 09, 17 + RGB 00, 00, 00 + RGB 31, 31, 31 + RGB 31, 21, 00 + RGB 06, 24, 08 + RGB 00, 00, 00 +; 8b6ed + +Function8b6ed: ; 8b6ed + hlcoord 0, 0, AttrMap + ld bc, $012c + xor a + call ByteFill + hlcoord 0, 14, AttrMap + ld bc, $0050 + ld a, $7 + call ByteFill + ret +; 8b703 + +Function8b703: ; 8b703 + call Function8923c + push hl + ld a, $c + ld [hli], a + inc a + call Function8b73e + inc a + ld [hl], a + pop hl + push hl + push bc + ld de, SCREEN_WIDTH + add hl, de +.asm_8b717 + push hl + ld a, $f + ld [hli], a + ld a, $7f + call Function8b73e + ld a, $11 + ld [hl], a + pop hl + ld de, SCREEN_WIDTH + add hl, de + dec b + jr nz, .asm_8b717 + call Function8b732 + pop bc + pop hl + jr Function8b744 +; 8b732 + +Function8b732: ; 8b732 + ld a, $12 + ld [hli], a + ld a, $13 + call Function8b73e + ld a, $14 + ld [hl], a + ret +; 8b73e + +Function8b73e: ; 8b73e + ld d, c +.asm_8b73f + ld [hli], a + dec d + jr nz, .asm_8b73f + ret +; 8b744 + +Function8b744: ; 8b744 + ld de, AttrMap - TileMap + add hl, de +rept 2 + inc b +endr +rept 2 + inc c +endr + xor a +.asm_8b74d + push bc + push hl +.asm_8b74f + ld [hli], a + dec c + jr nz, .asm_8b74f + pop hl + ld de, SCREEN_WIDTH + add hl, de + pop bc + dec b + jr nz, .asm_8b74d + ret +; 8b75d + +Function8b75d: ; 8b75d + call Function8923c + hlcoord 0, 0 + ld a, $1 + ld bc, SCREEN_WIDTH + call ByteFill + hlcoord 0, 1 + ld a, $2 + ld [hl], a + hlcoord 9, 1 + ld c, $b + call Function8b788 + hlcoord 1, 1 + ld a, $4 + ld e, $8 +.asm_8b780 + ld [hli], a + inc a + dec e + jr nz, .asm_8b780 + jr Function8b79e +; 8b787 + +Function8b787: ; 8b787 + ret +; 8b788 + +Function8b788: ; 8b788 +.asm_8b788 + ld a, $2 + ld [hli], a + dec c + ret z + ld a, $1 + ld [hli], a + dec c + ret z + ld a, $3 + ld [hli], a + dec c + ret z + ld a, $1 + ld [hli], a + dec c + jr nz, .asm_8b788 + ret +; 8b79e + +Function8b79e: ; 8b79e + hlcoord 0, 1, AttrMap + ld a, $1 + ld [hli], a + hlcoord 9, 1, AttrMap + ld e, $b +.asm_8b7a9 + ld a, $2 + ld [hli], a + dec e + ret z + xor a + ld [hli], a + dec e + ret z + ld a, $1 + ld [hli], a + dec e + ret z + xor a + ld [hli], a + dec e + jr nz, .asm_8b7a9 + ret +; 8b7bd + +Function8b7bd: ; 8b7bd + call Function8b855 + ld hl, MenuDataHeader_0x8b867 + call CopyMenuDataHeader + ld a, [wd030] + ld [wPocketCursorBuffer], a + ld a, [wd031] + ld [wd0e4], a + ld a, [wd032] + and a + jr z, .asm_8b7e0 + ld a, [wcf81] + set 3, a + ld [wcf81], a + +.asm_8b7e0 + ld a, [wd0e3] + and a + jr z, .asm_8b7ea + dec a + ld [wcf77], a + +.asm_8b7ea + hlcoord 0, 2 + ld b, $b + ld c, $12 + call Function8b703 + call Function8b75d + call UpdateSprites + call Function89209 + call Function350c + call Function8920f + ld a, [wcf73] + cp $2 + jr z, .asm_8b823 + cp $20 + jr nz, .asm_8b813 + call Function8b832 + jr .asm_8b7ea + +.asm_8b813 + cp $10 + jr nz, .asm_8b81c + call Function8b83e + jr .asm_8b7ea + +.asm_8b81c + ld a, [MenuSelection] + cp $ff + jr nz, .asm_8b824 + +.asm_8b823 + xor a + +.asm_8b824 + ld c, a + ld a, [wcfa9] + ld [wd030], a + ld a, [wd0e4] + ld [wd031], a + ret +; 8b832 + +Function8b832: ; 8b832 + ld a, [wd0e4] + ld hl, wcf92 + sub [hl] + jr nc, Function8b84b + xor a + jr Function8b84b +; 8b83e + +Function8b83e: ; 8b83e + ld a, [wd0e4] + ld hl, wcf92 + add [hl] + cp $24 + jr c, Function8b84b + ld a, $24 + +Function8b84b: ; 8b84b + ld [wd0e4], a + ld a, [wcfa9] + ld [wPocketCursorBuffer], a + ret +; 8b855 + +Function8b855: ; 8b855 + ld a, $28 + ld hl, DefaultFlypoint + ld [hli], a + ld c, $28 + xor a +.asm_8b85e + inc a + ld [hli], a + dec c + jr nz, .asm_8b85e + ld a, $ff + ld [hl], a + ret +; 8b867 + +MenuDataHeader_0x8b867: ; 0x8b867 + db $40 ; flags + db 03, 01 ; start coords + db 13, 18 ; end coords + dw MenuData2_0x8b870 + db 1 ; default option +; 0x8b86f + + db 0 + +MenuData2_0x8b870: ; 0x8b870 + db $3c ; flags + db 5 ; items + db 3, 1 + dbw 0, wd002 + dbw BANK(Function8b880), Function8b880 + dbw BANK(Function8b88c), Function8b88c + dbw BANK(Function8b8c8), Function8b8c8 +; 8b880 + +Function8b880: ; 8b880 + ld h, d + ld l, e + ld de, MenuSelection + lb bc, PRINTNUM_LEADINGZEROS | 1, 2 + call PrintNum + ret +; 8b88c + +Function8b88c: ; 8b88c + call OpenSRAMBank4 + ld h, d + ld l, e + push hl + ld de, String_89116 + call Function8931b + call Function8932d + jr c, .asm_8b8a3 + ld hl, $0000 + add hl, bc + ld d, h + ld e, l + +.asm_8b8a3 + pop hl + push hl + call PlaceString + pop hl + ld d, $0 + ld e, $6 + add hl, de + push hl + ld de, String_89116 + call Function8931b + call Function8934a + jr c, .asm_8b8c0 + ld hl, $0006 + add hl, bc + ld d, h + ld e, l + +.asm_8b8c0 + pop hl + call PlaceString + call CloseSRAM + ret +; 8b8c8 + +Function8b8c8: ; 8b8c8 + hlcoord 0, 14 + ld b, $2 + ld c, $12 + call TextBox + ld a, [wd033] + ld b, 0 + ld c, a + ld hl, Unknown_8b903 +rept 2 + add hl, bc +endr + ld a, [hli] + ld h, [hl] + ld l, a + ld d, h + ld e, l + hlcoord 1, 16 + call PlaceString + hlcoord 0, 13 + ld a, $f + ld [hl], a + hlcoord 19, 13 + ld a, $11 + ld [hl], a + ld a, [wd0e4] + cp $24 + ret c + hlcoord 0, 13 + ld c, $12 + call Function8b732 + ret +; 8b903 + +Unknown_8b903: ; 8b903 + dw String_8b90b + dw String_8b919 + dw String_8b92a + dw String_8b938 + +String_8b90b: db "めいしを えらんでください@" ; Please select a noun. +String_8b919: db "どの めいしと いれかえますか?@" ; OK to swap with any noun? +String_8b92a: db "あいてを えらんでください@" ; Please select an opponent. +String_8b938: db "いれる ところを えらんでください@" ; Please select a location. +; 8b94a + +Function8b94a: ; 8b94a + ld [wd033], a + xor a + ld [wd0e4], a + ld [wd032], a + ld [wd0e3], a + ld [wd031], a + ld a, $1 + ld [wd030], a + ret +; 8b960 + + +Function8b960: ; 8b960 (22:7960) + ld hl, MenuDataHeader_0x8b9ac + call LoadMenuDataHeader + call Function8b9e9 + jr c, .asm_8b97a + hlcoord 11, 0 + ld b, $6 + ld c, $7 + call Function8b703 + ld hl, MenuDataHeader_0x8b9b1 + jr .asm_8b987 +.asm_8b97a + hlcoord 11, 0 + ld b, $a + ld c, $7 + call Function8b703 + ld hl, MenuDataHeader_0x8b9ca +.asm_8b987 + ld a, $1 + call Function89d5e + ld hl, Function8b9ab + call Function89d85 + call ExitMenu + jr c, .asm_8b99c + call Function8b99f + jr nz, .asm_8b99d +.asm_8b99c + xor a +.asm_8b99d + ld c, a + ret + +Function8b99f: ; 8b99f (22:799f) + ld hl, DefaultFlypoint + dec a + ld c, a + ld b, $0 + add hl, bc + ld a, [hl] + cp $ff + ret +; 8b9ab (22:79ab) + +Function8b9ab: ; 8b9ab + ret +; 8b9ac + +MenuDataHeader_0x8b9ac: ; 0x8b9ac + db $40 ; flags + db 00, 11 ; start coords + db 11, 19 ; end coords + +MenuDataHeader_0x8b9b1: ; 0x8b9b1 + db $40 ; flags + db 00, 11 ; start coords + db 07, 19 ; end coords + dw MenuData2_0x8b9b9 + db 1 ; default option +; 0x8b9b9 + +MenuData2_0x8b9b9: ; 0x8b9b9 + db $a0 ; flags + db 3 ; items + db "へんしゅう@" ; EDIT + db "いれかえ@" ; REPLACE + db "やめる@" ; QUIT +; 0x8b9ca + +MenuDataHeader_0x8b9ca: ; 0x8b9ca + db $40 ; flags + db 00, 11 ; start coords + db 11, 19 ; end coords + dw MenuData2_0x8b9d2 + db 1 ; default option +; 0x8b9d2 + +MenuData2_0x8b9d2: ; 0x8b9d2 + db $a0 ; flags + db 5 ; items + db "みる@" ; VIEW + db "へんしゅう@" ; EDIT + db "いれかえ@" ; REPLACE + db "けす@" ; ERASE + db "やめる@" ; QUIT +; 0x8b9e9 + +Function8b9e9: ; 8b9e9 (22:79e9) + call OpenSRAMBank4 + call Function8931b + call Function8932d + jr nc, .asm_8b9f6 + jr .asm_8b9ff +.asm_8b9f6 + ld hl, $11 + add hl, bc + call Function89b45 + jr c, .asm_8ba08 +.asm_8b9ff + call Function892b4 + and a + ld de, Unknown_8ba1c + jr .asm_8ba0c +.asm_8ba08 + ld de, Unknown_8ba1f + scf +.asm_8ba0c + push af + ld hl, DefaultFlypoint +.asm_8ba10 + ld a, [de] + inc de + ld [hli], a + cp $ff + jr nz, .asm_8ba10 + call CloseSRAM + pop af + ret +; 8ba1c (22:7a1c) + +Unknown_8ba1c: ; 8b1ac + db 2, 4, -1 + +Unknown_8ba1f: ; 8ba1f + db 1, 2, 4, 3, -1 +; 8ba24 diff --git a/misc/mobile_40.asm b/misc/mobile_40.asm index 64608d2a8..b6664ca73 100644 --- a/misc/mobile_40.asm +++ b/misc/mobile_40.asm @@ -84,7 +84,7 @@ Function100082: ; 100082 ld [hLCDStatCustom], a ld a, $1 ld [$ffc9], a - ld [$ffe9], a + ld [hMobile], a ei ret ; 0x1000a4 @@ -93,7 +93,7 @@ Function1000a4: ; 1000a4 di xor a ld [$ffc9], a - ld [$ffe9], a + ld [hMobile], a xor a ld [hVBlank], a call NormalSpeed @@ -166,19 +166,19 @@ Function1000fa: ; 1000fa ld [rIE], a xor a ld [$ffc9], a - ld [$ffe9], a + ld [hMobile], a ei - ld a, [InLinkBattle] + ld a, [wLinkMode] push af xor a - ld [InLinkBattle], a + ld [wLinkMode], a ld a, $4 ld [wPartyMonMenuIconAnims + 5], a callba Function11619d ld hl, wcd29 set 6, [hl] pop af - ld [InLinkBattle], a + ld [wLinkMode], a ret ; 100144 @@ -332,7 +332,7 @@ Function100232: ; 100232 pop de call PlaceString call Function100320 - call Functiona36 + call JoyWaitAorB ret ; 10024d @@ -432,7 +432,7 @@ Function100301: ; 100301 callba Function10202c callba Function115dd3 call Function100320 - call Functiona36 + call JoyWaitAorB ret ; 100320 @@ -1612,7 +1612,7 @@ Function100a09: ; 100a09 call Function100a2e ld [wd431], a callba Function4000 - ld a, [InLinkBattle] + ld a, [wLinkMode] cp $4 jr nz, .asm_100a2a call Function100a87 @@ -1786,12 +1786,12 @@ Function100b12: ; 100b12 ld a, BANK(BattleMenuDataHeader) ld [wcf94], a ld a, [wd0d2] - ld [wcf88], a + ld [wPocketCursorBuffer], a call Function100e72 call Function100b45 callba Function8e85 call Function100ed4 - ld a, [wcf88] + ld a, [wPocketCursorBuffer] ld [wd0d2], a call ExitMenu ret @@ -1818,7 +1818,7 @@ Function100b45: ; 100b45 ld c, a ld a, [wcfa3] call SimpleMultiply - ld [wcf88], a + ld [wPocketCursorBuffer], a and a ret ; 100b7a @@ -1959,7 +1959,7 @@ Function100c74: ; 100c74 ld c, 8 call TextBox ld hl, BattleMonMoves - ld de, wd25e + ld de, wListMoves_MoveIndicesBuffer ld bc, NUM_MOVES call CopyBytes ld a, SCREEN_WIDTH * 2 @@ -2010,7 +2010,7 @@ Function100cb5: ; 100cb5 cp b jr z, .asm_100d17 ld [wd0d8], a - ld a, [$ffa9] + ld a, [hJoyLast] ld b, a bit 1, b jr nz, .asm_100d17 @@ -2134,7 +2134,7 @@ Function100db0: ; 100db0 Function100dc0: ; 100dc0 - ld a, [InLinkBattle] + ld a, [wLinkMode] cp $4 jr nz, .asm_100dd0 ld hl, wcd2a @@ -2497,7 +2497,7 @@ Unknown_100ff3: ; 100ff3 dbwww $80, PlayerName, NAME_LENGTH, NULL dbwww $80, PlayerName, NAME_LENGTH, NULL dbwww $80, PlayerID, 2, NULL - dbwww $80, wd84a, 2, NULL + dbwww $80, wSecretID, 2, NULL dbwww $80, PlayerGender, 1, NULL dbwww $04, $a603, 8, NULL dbwww $04, $a007, $30, NULL @@ -2770,13 +2770,13 @@ Function1011f1: ; 1011f1 ld [wdc5f], a ld [wdc60], a ld a, $4 - ld [InLinkBattle], a + ld [wLinkMode], a ret ; 101220 Function101220: ; 101220 xor a - ld [InLinkBattle], a + ld [wLinkMode], a ret ; 101225 @@ -3911,7 +3911,7 @@ Function101913: ; 101913 ; 10194b Function10194b: ; 10194b - call Function2ed3 + call DisableSpriteUpdates call ClearSprites callba Function1021f9 ld hl, wcd29 @@ -4979,7 +4979,7 @@ Function102142: ; 102142 call MenuTextBox ld de, SFX_LEVEL_UP call PlaySFX - call Functiona36 + call JoyWaitAorB call ExitMenu call Function10219f ld hl, UnknownText_0x1021d6 @@ -5022,7 +5022,7 @@ Function10219f: ; 10219f call Function10218d ld de, $c608 + 1 callba Function8ac4e - call Functiona36 + call JoyWaitAorB call PlayClickSFX call Function1013aa ret @@ -5056,7 +5056,7 @@ UnknownText_0x1021db: ; 1021d1 Function1021e0: ; 1021e0 call MenuTextBox - call Functiona36 + call JoyWaitAorB call ExitMenu ret ; 1021ea @@ -5401,7 +5401,7 @@ Function102423: ; 102423 call Function102921 ret nc callba Function14a58 - callba Function1060af + callba MobileFn_1060af callba Function106187 ld hl, wcd4b set 1, [hl] @@ -6408,7 +6408,7 @@ Function102b12: ; 102b12 ld c, $64 call DelayFrames call Function102d9a - call Functione58 + call LoadFontsBattleExtra ld a, [wcd2f] and a jr nz, .asm_102b2b @@ -6612,12 +6612,12 @@ Function102c71: ; 102c71 ; 102c87 Function102c87: ; 102c87 - ld a, [wcf63] + ld a, [wJumptableIndex] push af ld a, [wcf64] push af ld a, [wcd4c] - ld [wcf63], a + ld [wJumptableIndex], a ld a, [PartyCount] ld [wcf64], a ld a, $0 @@ -6632,7 +6632,7 @@ Function102c87: ; 102c87 ld bc, $011a call Function102d3e ld a, [wcd4d] - ld [wcf63], a + ld [wJumptableIndex], a ld a, [OTPartyCount] ld [wcf64], a ld a, $5 @@ -6649,18 +6649,18 @@ Function102c87: ; 102c87 pop af ld [wcf64], a pop af - ld [wcf63], a + ld [wJumptableIndex], a ret ; 102cee Function102cee: ; 102cee - ld a, [wcf63] + ld a, [wJumptableIndex] dec a call Function102d34 ld de, DefaultFlypoint ld bc, $002f call CopyBytes - ld a, [wcf63] + ld a, [wJumptableIndex] ld c, a ld a, $6 sub c @@ -6669,7 +6669,7 @@ Function102cee: ; 102cee ld hl, $0000 call AddNTimes push hl - ld a, [wcf63] + ld a, [wJumptableIndex] dec a call Function102d34 ld d, h @@ -6802,7 +6802,7 @@ Function102e07: ; 102e07 hlcoord 3, 10 ld b, $1 ld c, $b - ld a, [IsInBattle] + ld a, [wBattleMode] and a jr z, .asm_102e19 call TextBox @@ -7688,7 +7688,7 @@ Function103612: ; 103612 ld a, [wdc40] and $f jr z, .asm_103622 - ld [wcf88], a + ld [wPocketCursorBuffer], a .asm_103622 call InterpretMenu2 @@ -7749,7 +7749,7 @@ Mobile_SelectThreeMons: ; 10366e jr c, .asm_103696 callba Function8b1e1 jr nc, .asm_103690 - call Functiona36 + call JoyWaitAorB jr .asm_103696 .asm_103690 @@ -7772,7 +7772,7 @@ Mobile_SelectThreeMons: ; 10366e call YesNoBox jr c, .asm_1036b5 call Function1036f9 - call Functiona36 + call JoyWaitAorB .asm_1036b5 call Function103700 @@ -7794,7 +7794,7 @@ Mobile_SelectThreeMons: ; 10366e .asm_1036d9 callba Function8b1e1 jr nc, .asm_1036e6 - call Functiona36 + call JoyWaitAorB jr .asm_1036f4 .asm_1036e6 @@ -7804,7 +7804,7 @@ Mobile_SelectThreeMons: ; 10366e .asm_1036ec call Function1036f9 - call Functiona36 + call JoyWaitAorB jr .asm_1036b5 .asm_1036f4 @@ -7859,7 +7859,7 @@ Function103700: ; 103700 .asm_10373c ld hl, UnknownText_0x10377b call PrintText - call Functiona36 + call JoyWaitAorB scf ret ; 103747 @@ -7981,10 +7981,10 @@ Function1037eb: ; 1037eb jr nc, .asm_103807 ld hl, UnknownText_0x103819 call PrintText - call Functiona36 + call JoyWaitAorB ld hl, UnknownText_0x10381e call PrintText - call Functiona36 + call JoyWaitAorB xor a ld [ScriptVar], a ret @@ -8042,7 +8042,7 @@ endr ld [hl], a ld hl, UnknownText_0x103876 call PrintText - call Functiona36 + call JoyWaitAorB callba Script_reloadmappart callba Function4a94e jr c, .asm_103870 @@ -8074,7 +8074,7 @@ Function10387b: ; 10387b ld [StringBuffer2], a ld hl, UnknownText_0x103898 call PrintText - call Functiona36 + call JoyWaitAorB ret ; 103898 diff --git a/misc/mobile_42.asm b/misc/mobile_42.asm index a66e375ea..e09899f48 100644 --- a/misc/mobile_42.asm +++ b/misc/mobile_42.asm @@ -124,7 +124,7 @@ Function108089: ; 108089 Function1080b7: ; 1080b7 xor a - ld [wcf63], a + ld [wJumptableIndex], a call WhiteBGMap call ClearSprites call ClearTileMap @@ -132,7 +132,7 @@ Function1080b7: ; 1080b7 call Function1081ad call Function1081ca call Functione51 - call Functione58 + call LoadFontsBattleExtra ld a, $1 ld [rVBK], a ld hl, LZ_108da7 @@ -141,7 +141,7 @@ Function1080b7: ; 1080b7 ld a, $0 ld [rVBK], a ld hl, LZ_108d27 - ld de, $8200 + ld de, VTiles0 tile $20 call Decompress call EnableLCD xor a @@ -158,7 +158,7 @@ Function1080b7: ; 1080b7 lb bc, BANK(TradeBallGFX), $06 call Request2bpp ld de, TradePoofGFX - ld hl, $8060 + ld hl, VTiles0 tile $06 lb bc, BANK(TradePoofGFX), $0c call Request2bpp xor a @@ -167,11 +167,11 @@ Function1080b7: ; 1080b7 ld [hl], $0 ld a, [$c6d0] ld hl, $c6fd - ld de, $8300 + ld de, VTiles0 tile $30 call Function1081e9 ld a, [wc702] ld hl, wc72f - ld de, $9310 + ld de, VTiles2 tile $31 call Function1081e9 ld a, [$c6d0] ld de, $c6d1 @@ -187,7 +187,7 @@ Function1080b7: ; 1080b7 Function108157: ; 108157 xor a - ld [wcf63], a + ld [wJumptableIndex], a call WhiteBGMap call ClearSprites call ClearTileMap @@ -195,7 +195,7 @@ Function108157: ; 108157 call Function1081ad call Function1081ca call Functione51 - call Functione58 + call LoadFontsBattleExtra call EnableLCD xor a ld [hSCX], a @@ -310,7 +310,7 @@ Function108239: ; 108239 ; 10824b Function10824b: ; 10824b - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_10825a call Function10827b @@ -327,7 +327,7 @@ Function10824b: ; 10824b ld a, $90 ld [hWY], a call Functione51 - call Functione58 + call LoadFontsBattleExtra callba Function106462 callba Function106464 scf @@ -335,7 +335,7 @@ Function10824b: ; 10824b ; 10827b Function10827b: ; 10827b - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_10828a @@ -372,7 +372,7 @@ Jumptable_10828a: ; 10828a ; 1082b2 Function1082b2: ; 1082b2 - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret ; 1082b7 @@ -383,7 +383,7 @@ Function1082b7: ; 1082b7 inc hl ld d, [hl] ld a, [de] - ld [wcf63], a + ld [wJumptableIndex], a inc de ld [hl], d dec hl @@ -392,7 +392,7 @@ Function1082b7: ; 1082b7 ; 1082c6 Function1082c6: ; 1082c6 - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret ; 1082cc @@ -587,7 +587,7 @@ Function10842c: ; 10842c lb bc, BANK(TradeBallGFX), $06 call Request2bpp ld de, TradePoofGFX - ld hl, $8060 + ld hl, VTiles0 tile $06 lb bc, BANK(TradePoofGFX), $0c call Request2bpp ld a, [$c6fd] @@ -661,7 +661,7 @@ Function1084d7: ; 1084d7 lb bc, BANK(TradeBallGFX), $06 call Request2bpp ld de, TradePoofGFX - ld hl, $8060 + ld hl, VTiles0 tile $06 lb bc, BANK(TradePoofGFX), $0c call Request2bpp xor a @@ -730,7 +730,7 @@ Function108589: ; 108589 lb bc, BANK(TradeBallGFX), $06 call Request2bpp ld de, TradePoofGFX - ld hl, $8060 + ld hl, VTiles0 tile $06 lb bc, BANK(TradePoofGFX), $0c call Request2bpp xor a @@ -832,7 +832,7 @@ Function108689: ; 108689 ld a, $0 ld [rVBK], a ld hl, LZ_108d27 - ld de, $8200 + ld de, VTiles0 tile $20 call Decompress call Function108c80 call Function108c6d @@ -876,7 +876,7 @@ Function1086f4: ; 1086f4 ld a, $0 ld [rVBK], a ld hl, LZ_108d27 - ld de, $8200 + ld de, VTiles0 tile $20 call Decompress call Function108c80 call Function108c6d @@ -1195,11 +1195,11 @@ Function10893d: ; 10893d ; 10895e Function10895e: ; 10895e - ld de, $8300 + ld de, VTiles0 tile $30 jr asm_108966 Function108963: - ld de, $9310 + ld de, VTiles2 tile $31 asm_108966 call DelayFrame @@ -1270,8 +1270,8 @@ Function1089d2: asm_1089fc call WaitTop call Function108ac8 - ld a, $9c - ld [$ffd7], a + ld a, VBGMap1 / $100 + ld [hBGMapAddress + 1], a hlcoord 5, 0 ld b, $6 ld c, $9 @@ -1293,8 +1293,8 @@ String_108a1d: ; 108a1d Function108a33: ; 108a33 call WaitTop call Function108ac8 - ld a, $9c - ld [$ffd7], a + ld a, VBGMap1 / $100 + ld [hBGMapAddress + 1], a hlcoord 5, 0 ld b, $6 ld c, $9 @@ -1313,8 +1313,8 @@ String_108a54: ; 108a54 Function108a5b: ; 108a5b call WaitTop call Function108ac8 - ld a, $9c - ld [$ffd7], a + ld a, VBGMap1 / $100 + ld [hBGMapAddress + 1], a hlcoord 4, 0 ld b, $6 ld c, $a @@ -1336,8 +1336,8 @@ String_108a79: ; 108a79 Function108a87: ; 108a87 call WaitBGMap call WaitTop - ld a, $98 - ld [$ffd7], a + ld a, VBGMap0 / $100 + ld [hBGMapAddress + 1], a ret ; 108a92 @@ -1405,7 +1405,7 @@ Function108ad4: ; 108ad4 .asm_108adf ld a, $1 ld [rVBK], a - ld hl, $94a0 + ld hl, VTiles2 tile $4a lb bc, $42, $10 call Functiondc9 call DelayFrame diff --git a/misc/mobile_45.asm b/misc/mobile_45.asm index 17300348a..52a2a65e4 100644 --- a/misc/mobile_45.asm +++ b/misc/mobile_45.asm @@ -703,7 +703,7 @@ endr ld a, d or e jr z, .asm_114559 - ld hl, wdc07 + ld hl, wCurrMapTriggerCount ld e, [hl] inc hl ld d, [hl] @@ -1537,7 +1537,7 @@ Function1149cc: ; 1149cc ld [hl], d dec hl ld [hl], e - ld hl, wdc07 + ld hl, wCurrMapTriggerCount ld e, [hl] inc hl ld d, [hl] @@ -2416,14 +2416,14 @@ Function114e62: ; 114e62 ld a, c and a jr nz, .asm_114e6f - ld a, [wdc23] + ld a, [wStartDay] and a jp z, Function11425c jr .asm_114e76 .asm_114e6f xor a - ld [wdc23], a + ld [wStartDay], a call Function114ee9 .asm_114e76 @@ -2494,7 +2494,7 @@ Function114ea0: ; 114ea0 ld [hli], a ld [hl], b xor a - ld [wdc23], a + ld [wStartDay], a ret .asm_114edb @@ -2614,7 +2614,7 @@ Function114f39: ; 114f39 ; 114f59 Function114f59: ; 114f59 - ld a, [wdc23] + ld a, [wStartDay] and a jr nz, .asm_114f7c ld a, [wdc03] @@ -2632,7 +2632,7 @@ Function114f59: ; 114f59 and a jr nz, .asm_114fe7 ld a, $1 - ld [wdc23], a + ld [wStartDay], a .asm_114f7c ld a, [wdc03] @@ -2811,7 +2811,7 @@ Function115062: ; 115062 ld d, [hl] ld b, $0 ld hl, wdc24 - ld a, [wdc23] + ld a, [wStartDay] cp $1 jr z, .asm_11509b cp $2 @@ -2836,14 +2836,14 @@ Function115062: ; 115062 call Function115d53 call Function1150b3 call Function115136 - ld a, [wdc23] + ld a, [wStartDay] inc a cp $4 jr nz, .asm_1150ae ld a, $2 .asm_1150ae - ld [wdc23], a + ld [wStartDay], a xor a .asm_1150b2 @@ -3329,7 +3329,7 @@ Function1152b8: ; 1152b8 call Function114ea0 and a jr nz, .asm_1152f9 - ld [wdc23], a + ld [wStartDay], a ld a, [wdc03] cp $6 jr nz, .asm_1152ca @@ -3337,7 +3337,7 @@ Function1152b8: ; 1152b8 .asm_115335 call Function1153b5 xor a - ld [wdc23], a + ld [wStartDay], a call Function114f59 and a jr nz, .asm_1152f9 @@ -3355,7 +3355,7 @@ Function1152b8: ; 1152b8 jr z, .asm_11536b call Function1153b5 xor a - ld [wdc23], a + ld [wStartDay], a call Function114f59 and a jr nz, .asm_1152f9 @@ -3425,7 +3425,7 @@ Function11537d: ; 11537d ld [hl], d xor a ld [wdc03], a - ld [wdc23], a + ld [wStartDay], a ret ; 1153b5 @@ -3645,7 +3645,7 @@ Function1153d2: ; 1153d2 Function1154d4: ; 1154d4 xor a - ld [wdc23], a + ld [wStartDay], a call Function1155af call Function11560a and a @@ -3659,7 +3659,7 @@ Function1154d4: ; 1154d4 cp $1 jr nz, .asm_115531 xor a - ld [wdc1c], a + ld [wDailyResetTimer], a .asm_1154f7 ld a, [BigDoll] cp $2 @@ -3699,7 +3699,7 @@ Function1154d4: ; 1154d4 .asm_115531 ld a, $1 - ld [wdc1c], a + ld [wDailyResetTimer], a ld a, $b ld [wdc03], a call Function114f59 @@ -3726,7 +3726,7 @@ Function1154d4: ; 1154d4 call Function114ea0 and a jr nz, .asm_11552c - ld a, [wdc1c] + ld a, [wDailyResetTimer] and a jr z, .asm_11557d ld a, $f @@ -3860,7 +3860,7 @@ Function11560a: ; 11560a ld c, [hl] inc hl ld b, [hl] - ld a, [wdc0a] + ld a, [wCurrMapCallbackCount] cp b jp c, .asm_1156b1 jr nz, .asm_115631 @@ -3874,7 +3874,7 @@ Function11560a: ; 11560a jr z, .asm_1156a9 ld a, [wdc09] ld l, a - ld a, [wdc0a] + ld a, [wCurrMapCallbackCount] ld h, a ld a, c cpl @@ -3887,7 +3887,7 @@ Function11560a: ; 11560a ld a, l ld [wdc09], a ld a, h - ld [wdc0a], a + ld [wCurrMapCallbackCount], a .asm_11564d ld a, $3 cp b @@ -3929,13 +3929,13 @@ Function11560a: ; 11560a ld a, [wCurrentMapSignpostCount] ld [$ff8c], a ld [$4000], a - ld hl, wdc07 + ld hl, wCurrMapTriggerCount ld e, [hl] inc hl ld d, [hl] ld hl, wdc24 call Function115d6a - ld hl, wdc07 + ld hl, wCurrMapTriggerCount ld [hl], e inc hl ld [hl], d @@ -3977,7 +3977,7 @@ Function11560a: ; 11560a ; 1156cc Function1156cc: ; 1156cc - ld a, [wdc23] + ld a, [wStartDay] and a jp z, Function11425c cp $2 @@ -4006,7 +4006,7 @@ Function1156cc: ; 1156cc call Function11581e and a jr nz, .asm_11572b - ld a, [wdc23] + ld a, [wStartDay] cp $5 jr z, .asm_115716 ld a, [Poster] @@ -4017,7 +4017,7 @@ Function1156cc: ; 1156cc jp Function11425c .asm_115716 - ld hl, wdc0a + ld hl, wCurrMapCallbackCount ld a, [hli] cpl ld e, a @@ -4030,7 +4030,7 @@ Function1156cc: ; 1156cc ld l, a add hl, de xor a - ld [wdc23], a + ld [wStartDay], a jp Function11425c .asm_11572b @@ -4165,7 +4165,7 @@ Function11575c: ; 11575c pop hl add hl, bc ld a, $2 - ld [wdc23], a + ld [wStartDay], a ret ; 1157d0 @@ -4213,7 +4213,7 @@ Function1157d0: ; 1157d0 ld a, b ld [Bed], a ld a, $4 - ld [wdc23], a + ld [wStartDay], a ret .asm_11580f @@ -4223,12 +4223,12 @@ Function1157d0: ; 1157d0 ld a, b ld [Bed], a ld a, $3 - ld [wdc23], a + ld [wStartDay], a ret ; 11581e Function11581e: ; 11581e - ld a, [wdc23] + ld a, [wStartDay] and a ret z ld a, [wdc0e] @@ -4262,9 +4262,9 @@ Function11581e: ; 11581e ld b, [hl] inc hl push hl - ld a, [wdc0a] + ld a, [wCurrMapCallbackCount] ld l, a - ld a, [wdc0b] + ld a, [wCurrMapCallbackHeaderPointer] ld h, a cp b jr c, .asm_1158bb @@ -4284,12 +4284,12 @@ Function11581e: ; 11581e inc bc add hl, bc ld a, l - ld [wdc0a], a + ld [wCurrMapCallbackCount], a ld a, h - ld [wdc0b], a + ld [wCurrMapCallbackHeaderPointer], a pop bc pop hl - ld hl, wdc07 + ld hl, wCurrMapTriggerCount ld a, [hli] ld [wCurrentMapSignpostCount], a ld [$ff8c], a @@ -4299,13 +4299,13 @@ Function11581e: ; 11581e ld d, [hl] ld hl, PartyMon5Speed call Function115d6a - ld hl, wdc07 + ld hl, wCurrMapTriggerCount ld a, [wCurrentMapSignpostCount] ld [hli], a ld a, e ld [hli], a ld [hl], d - ld a, [wdc23] + ld a, [wStartDay] cp $3 jr z, .asm_1158b4 cp $4 @@ -4314,12 +4314,12 @@ Function11581e: ; 11581e .asm_1158ad ld a, $5 - ld [wdc23], a + ld [wStartDay], a jr .asm_1158b9 .asm_1158b4 ld a, $2 - ld [wdc23], a + ld [wStartDay], a .asm_1158b9 xor a @@ -4330,7 +4330,7 @@ Function11581e: ; 11581e .asm_1158bc ld a, $ff - ld [wdc23], a + ld [wStartDay], a ret ; 1158c2 @@ -4575,7 +4575,7 @@ Function1159dc: ; 1159dc ; 1159fb Function1159fb: ; 1159fb - ld a, [wdc23] + ld a, [wStartDay] and a jp z, Function11425c cp $2 @@ -4604,7 +4604,7 @@ Function1159fb: ; 1159fb call Function115b00 and a jr nz, .asm_115a5a - ld a, [wdc23] + ld a, [wStartDay] cp $5 jr z, .asm_115a45 ld a, [Poster] @@ -4615,7 +4615,7 @@ Function1159fb: ; 1159fb jp Function11425c .asm_115a45 - ld hl, wdc0a + ld hl, wCurrMapCallbackCount ld a, [hli] cpl ld e, a @@ -4628,7 +4628,7 @@ Function1159fb: ; 1159fb ld l, a add hl, de xor a - ld [wdc23], a + ld [wStartDay], a jp Function11425c .asm_115a5a @@ -4692,7 +4692,7 @@ Function115a5f: ; 115a5f rl b add hl, bc ld a, $2 - ld [wdc23], a + ld [wStartDay], a ret ; 115ab0 @@ -4740,7 +4740,7 @@ Function115ab0: ; 115ab0 ld a, b ld [Bed], a ld a, $4 - ld [wdc23], a + ld [wStartDay], a xor a ret @@ -4751,13 +4751,13 @@ Function115ab0: ; 115ab0 ld a, b ld [Bed], a ld a, $3 - ld [wdc23], a + ld [wStartDay], a xor a ret ; 115b00 Function115b00: ; 115b00 - ld a, [wdc23] + ld a, [wStartDay] and a ret z ld a, [wdc0e] @@ -4780,7 +4780,7 @@ Function115b00: ; 115b00 jr z, .asm_115b43 cp $2 jr z, .asm_115b3b - ld a, [wdc23] + ld a, [wStartDay] cp $4 jr z, .asm_115b43 rept 2 @@ -4798,7 +4798,7 @@ endr .asm_115b3d ld a, $ff - ld [wdc23], a + ld [wStartDay], a ret .asm_115b43 @@ -4826,9 +4826,9 @@ endr ld b, [hl] inc hl push hl - ld a, [wdc0a] + ld a, [wCurrMapCallbackCount] ld l, a - ld a, [wdc0b] + ld a, [wCurrMapCallbackHeaderPointer] ld h, a cp b jr c, .asm_115b36 @@ -4848,12 +4848,12 @@ endr inc bc add hl, bc ld a, l - ld [wdc0a], a + ld [wCurrMapCallbackCount], a ld a, h - ld [wdc0b], a + ld [wCurrMapCallbackHeaderPointer], a pop bc pop hl - ld hl, wdc07 + ld hl, wCurrMapTriggerCount ld a, [hli] ld [wCurrentMapSignpostCount], a ld [$ff8c], a @@ -4863,13 +4863,13 @@ endr ld d, [hl] ld hl, wdc26 call Function115d6a - ld hl, wdc07 + ld hl, wCurrMapTriggerCount ld a, [wCurrentMapSignpostCount] ld [hli], a ld a, e ld [hli], a ld [hl], d - ld a, [wdc23] + ld a, [wStartDay] cp $3 jr z, .asm_115bc1 cp $4 @@ -4878,12 +4878,12 @@ endr .asm_115bba ld a, $5 - ld [wdc23], a + ld [wStartDay], a jr .asm_115bc6 .asm_115bc1 ld a, $2 - ld [wdc23], a + ld [wStartDay], a .asm_115bc6 xor a @@ -4949,7 +4949,7 @@ Function115bc8: ; 115bc8 jr nz, .asm_115bcc .asm_115c1b - ld a, [wdc23] + ld a, [wStartDay] cp $4 jr z, .asm_115c33 ld a, [de] @@ -5053,7 +5053,7 @@ endr .asm_115c99 ld a, $ff - ld [wdc23], a + ld [wStartDay], a ret .asm_115c9f @@ -5156,7 +5156,7 @@ Function115cfd: ; 115cfd pop hl pop hl ld a, $ff - ld [wdc23], a + ld [wStartDay], a ret .asm_115d2f @@ -5268,7 +5268,7 @@ Function115d80: ; 115d80 Function115d99: ; 115d99 ld de, GFX_11601a - ld hl, $8600 + ld hl, VTiles0 tile $60 lb bc, BANK(GFX_11601a), $14 call Get2bpp xor a @@ -5976,7 +5976,7 @@ Function1163c0: ; 1163c0 pop af ld [rSVBK], a callba Function104061 - ld a, [InLinkBattle] + ld a, [wLinkMode] cp $4 jr z, .asm_11642a ld a, $8 @@ -7656,13 +7656,13 @@ Function117656: ; 117656 ; 11765d Function11765d: ; 11765d (45:765d) - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a call Function11766b pop af - ld [$ffaa], a + ld [hInMenu], a ret Function11766b: ; 11766b (45:766b) @@ -7716,7 +7716,7 @@ Function117699: ; 117699 (45:7699) ret Function1176ee: ; 1176ee (45:76ee) - call Functiona57 + call JoyTextDelay ld a, [wcd49] bit 7, a jr nz, .asm_117709 @@ -7798,7 +7798,7 @@ Function117764: ; 117764 (45:7764) ld a, [hl] and $2 jr nz, asm_1177d6 - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and $40 jr nz, asm_1177f1 @@ -7973,11 +7973,11 @@ Function1178aa: ; 1178aa (45:78aa) ld hl, MenuDataHeader_1179b5 call LoadMenuDataHeader call Function1cbb - call Function1cfd + call GetMemTileCoord ld hl, MenuDataHeader_1179bd call LoadMenuDataHeader call Function1cbb - call Function1cfd + call GetMemTileCoord callba Function104061 hlcoord 16, 8 ld de, String_1179c5 @@ -8076,7 +8076,7 @@ Function117984: ; 117984 (45:7984) ld hl, MenuDataHeader_1179b5 call LoadMenuDataHeader call Function1cbb - call Function1cfd + call GetMemTileCoord callba Function104061 hlcoord 1, 14 ld de, String_1179e1 @@ -8150,13 +8150,13 @@ INCBIN "data/mobile/ascii-sym.txt" ; Mobile Stadium option from the continue/newgame menu. ; XXX better function names MobileStudium: ; 0x117a7f - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a call Function117a8d pop af - ld [$ffaa], a + ld [hInMenu], a ret ; 0x117a8d @@ -8168,7 +8168,7 @@ Function117a8d: ; 0x117a8d Function117a94: ; 0x117a94 xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [wcf65], a ld [wcf66], a @@ -8189,8 +8189,8 @@ Function117ab4: ; 0x117ab4 ; 0x117acd Function117acd: ; 0x117acd - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_117ae2 ; 0x117ad5 $b call Function117ae9 @@ -8202,7 +8202,7 @@ Function117acd: ; 0x117acd ret Function117ae9: ; 0x117ae9 - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, $0 ld hl, Pointers117af8 @@ -8236,7 +8236,7 @@ Function117b14: ld hl, Data117cbc call LoadMenuDataHeader call Function1cbb - call Function1cfd + call GetMemTileCoord jp Function117cdd Function117b28: @@ -8248,7 +8248,7 @@ Function117b31: ld hl, Data117cc4 call LoadMenuDataHeader call Function1cbb - call Function1cfd + call GetMemTileCoord hlcoord 16, 8 ld de, YesNo117ccc call PlaceString @@ -8306,7 +8306,7 @@ Function117b4f: call ExitMenu callba Function104061 ld a, $80 - ld [wcf63], a + ld [wJumptableIndex], a ret Function117bb6: @@ -8325,11 +8325,11 @@ Function117bb6: ld [wc303], a callba Function17f555 ld a, $80 - ld [wcf63], a + ld [wJumptableIndex], a ret .asm_117be1 ld a, $80 - ld [wcf63], a + ld [wJumptableIndex], a ret .asm_117be7 ld a, [rSVBK] @@ -8386,7 +8386,7 @@ Function117c4a: ld hl, Data117cbc call LoadMenuDataHeader call Function1cbb - call Function1cfd + call GetMemTileCoord callba Function104061 ld hl, MobileStadiumSuccessText call PrintText @@ -8411,7 +8411,7 @@ Function117c4a: pop af ld [rSVBK], a ld a, $80 - ld [wcf63], a + ld [wJumptableIndex], a ret Function117c89: @@ -8464,7 +8464,7 @@ MobileStadiumSuccessText: ; 0x117cd8 db "@" Function117cdd: ; 0x117cdd - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret @@ -8493,7 +8493,7 @@ asm_11800b ld a, $3 ld [rSVBK], a .asm_118024 - call Functiona57 + call JoyTextDelay call Function118473 ld a, [wcf66] cp $1b @@ -8534,7 +8534,7 @@ Function11805f: ; 11805f ld a, $3 ld [rSVBK], a .asm_11807d - call Functiona57 + call JoyTextDelay call Function118473 ld a, [wcf66] cp $1b @@ -8572,7 +8572,7 @@ Function1180b8: ; 1180b8 ld a, $3 ld [rSVBK], a .asm_1180d1 - call Functiona57 + call JoyTextDelay call Function118473 ld a, [wcf66] cp $28 @@ -8627,7 +8627,7 @@ Function118125: ; 118125 ld a, $3 ld [rSVBK], a .asm_11813e - call Functiona57 + call JoyTextDelay call Function118473 ld a, [wcf66] cp $f @@ -8712,7 +8712,7 @@ Function1181da: ; 1181da ld a, $3 ld [rSVBK], a .asm_1181f8 - call Functiona57 + call JoyTextDelay call Function118473 ld a, [wcf66] cp $28 @@ -8750,7 +8750,7 @@ Function118233: ; 118233 ld a, $3 ld [rSVBK], a .asm_11824c - call Functiona57 + call JoyTextDelay call Function118473 ld a, [wcf66] cp $1e @@ -8787,7 +8787,7 @@ Function118284: ; 118284 ld a, $3 ld [rSVBK], a ; $ff00+$70 .asm_11829d - call Functiona57 + call JoyTextDelay call Function118473 ld a, [wcf66] cp $20 @@ -8824,7 +8824,7 @@ Function1182d5: ; 1182d5 ld a, $3 ld [rSVBK], a .asm_1182ee - call Functiona57 + call JoyTextDelay call Function118473 ld a, [wcf66] cp $1b @@ -8862,7 +8862,7 @@ Function118329: ; 118329 ld a, $3 ld [rSVBK], a .asm_118342 - call Functiona57 + call JoyTextDelay call Function118473 ld a, [wcf66] cp $18 @@ -8899,7 +8899,7 @@ Function11837a: ; 11837a ld a, $3 ld [rSVBK], a .asm_118393 - call Functiona57 + call JoyTextDelay call Function118473 ld a, [wcf66] cp $19 @@ -8954,7 +8954,7 @@ Function1183cb: ; 1183cb ld [rIE], a ld a, $1 ld [$ffc9], a - ld [$ffe9], a + ld [hMobile], a ei callba Function106462 callba Function106464 @@ -8984,7 +8984,7 @@ Function118452: ; 118452 di xor a ld [$ffc9], a - ld [$ffe9], a + ld [hMobile], a ld [hVBlank], a call NormalSpeed xor a @@ -9756,7 +9756,7 @@ Function118936: ld hl, MenuDataHeader_119cf7 call LoadMenuDataHeader call Function1cbb - call Function1cfd + call GetMemTileCoord call Function321c hlcoord 16, 8, AttrMap ld a, $40 @@ -11817,7 +11817,7 @@ Function119800: ; 119800 ld [wc702], a ld a, [wcd81] ld [wc74e], a - ld a, [wcf63] + ld a, [wJumptableIndex] push af ld a, [wcf64] push af @@ -11840,7 +11840,7 @@ Function119800: ; 119800 pop af ld [wcf64], a pop af - ld [wcf63], a + ld [wJumptableIndex], a callba Function115dc3 jp Function119e2e ; 11984e @@ -11853,7 +11853,7 @@ Function11984e: ; 11984e and a jr nz, .asm_1198a8 callba Function170000 - ld a, [wcf63] + ld a, [wJumptableIndex] push af ld a, [wcf64] push af @@ -11876,7 +11876,7 @@ Function11984e: ; 11984e pop af ld [wcf64], a pop af - ld [wcf63], a + ld [wJumptableIndex], a callba Function115dc3 jp Function119e2e @@ -11887,7 +11887,7 @@ Function11984e: ; 11984e .asm_1198a8 callba Function17005a - ld a, [wcf63] + ld a, [wJumptableIndex] push af ld a, [wcf64] push af @@ -11910,7 +11910,7 @@ Function11984e: ; 11984e pop af ld [wcf64], a pop af - ld [wcf63], a + ld [wJumptableIndex], a callba Function115dc3 jp Function119e2e ; 1198ee @@ -13021,13 +13021,13 @@ Function11a00e: ; 11a00e .asm_11a081 xor a - ld [wcf83], a - ld [wcf82], a + ld [wMenuBorderLeftCoord], a + ld [wMenuBorderTopCoord], a ld a, $13 - ld [wcf85], a + ld [wMenuBorderRightCoord], a ld a, $5 - ld [wcf84], a - call Function1c00 + ld [wMenuBorderBottomCoord], a + call BackUpTiles callba Function11765d callba Function117ab4 callba Function106462 @@ -13044,13 +13044,13 @@ Function11a00e: ; 11a00e Function11a0ca: ; 11a0ca xor a - ld [wcf83], a - ld [wcf82], a + ld [wMenuBorderLeftCoord], a + ld [wMenuBorderTopCoord], a ld a, $13 - ld [wcf85], a + ld [wMenuBorderRightCoord], a ld a, $11 - ld [wcf84], a - call Function1c00 + ld [wMenuBorderBottomCoord], a + call BackUpTiles callba Function11765d callba Function17d3f6 callba Function106462 @@ -13211,7 +13211,7 @@ Function11a207: ; 11a207 ld hl, MenuDataHeader_11a2de call LoadMenuDataHeader call Function1cbb - call Function1cfd + call GetMemTileCoord call Function321c hlcoord 16, 8 ld de, String_11a2cf @@ -13728,13 +13728,13 @@ Function11a5b0: ; 11a5b0 Function11a5b9: ; 11a5b9 xor a - ld [wcf83], a - ld [wcf82], a + ld [wMenuBorderLeftCoord], a + ld [wMenuBorderTopCoord], a ld a, $13 - ld [wcf85], a + ld [wMenuBorderRightCoord], a ld a, $5 - ld [wcf84], a - call Function1c00 + ld [wMenuBorderBottomCoord], a + call BackUpTiles hlcoord 0, 0, AttrMap ld b, $6 ld c, $14 @@ -13753,14 +13753,14 @@ Function11a5b9: ; 11a5b9 Function11a5f5: ; 11a5f5 ld a, $e - ld [wcf83], a + ld [wMenuBorderLeftCoord], a ld a, $13 - ld [wcf85], a + ld [wMenuBorderRightCoord], a ld a, $6 - ld [wcf82], a + ld [wMenuBorderTopCoord], a ld a, $a - ld [wcf84], a - call Function1c00 + ld [wMenuBorderBottomCoord], a + call BackUpTiles hlcoord 14, 6, AttrMap ld b, $5 ld c, $6 @@ -14311,7 +14311,7 @@ UnknownText_0x11ac1f: ; 0x11ac1f Function11ac3e: ; 11ac3e call SpeechTextBox call FadeToMenu - callab Function8e814 + callab InefficientlyClear121BytesAtwc300 call Function11ac51 call Function2b3c ret @@ -14328,10 +14328,10 @@ Function11ac51: ; 11ac51 push af xor a ld [VramState], a - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a xor a ld [$ffde], a ld [wcd49], a @@ -14342,8 +14342,8 @@ Function11ac51: ; 11ac51 call Function11ad1b call DelayFrame .asm_11ac82 - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_11aca8 call Function11b314 @@ -14358,7 +14358,7 @@ Function11ac51: ; 11ac51 .asm_11aca8 call ClearSprites pop af - ld [$ffaa], a + ld [hInMenu], a pop af ld [VramState], a pop af @@ -14428,7 +14428,7 @@ Function11ad1b: ; 11ad1b ld a, [wcfa9] ld [wcd82], a dec a - ld [$ffb0], a + ld [hConnectedMapWidth], a ld a, $10 ld [wc3b7], a ld hl, Function8e83f @@ -14444,7 +14444,7 @@ Function11ad1b: ; 11ad1b xor a call ByteFill xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [wcf65], a ld [wcf66], a @@ -14456,7 +14456,7 @@ Function11ad1b: ; 11ad1b ; 11ad6e Function11ad6e: ; 11ad6e - ld a, [wcf63] + ld a, [wJumptableIndex] ld hl, Jumptable_11ad78 call Function11b239 jp [hl] @@ -14475,13 +14475,13 @@ Jumptable_11ad78: ; 11ad78 ; 11ad8a Function11ad8a: ; 11ad8a - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret ; 11ad8f Function11ad8f: ; 11ad8f - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret ; 11ad95 @@ -14522,7 +14522,7 @@ Function11adc4: ret z call PlayClickSFX xor a - ld [wcf63], a + ld [wJumptableIndex], a jr .asm_11ae2e .asm_11ade6 @@ -14643,7 +14643,7 @@ Function11ae98: ld a, $7f ld [hl], a ld a, $1 - ld [wcf63], a + ld [wJumptableIndex], a jr .asm_11aef7 .asm_11aec1 @@ -14734,7 +14734,7 @@ Function11af4e: ld a, $7f ld [hl], a ld a, $1 - ld [wcf63], a + ld [wJumptableIndex], a jr .asm_11afaa .asm_11af77 @@ -14765,7 +14765,7 @@ Function11af4e: cp $2 jr z, .asm_11af6a ld a, $6 - ld [wcf63], a + ld [wJumptableIndex], a xor a ld [ScriptVar], a @@ -15057,7 +15057,7 @@ Function11b0ff: ; 11b0ff jr .asm_11b148 .asm_11b141 - ld hl, wcf63 + ld hl, wJumptableIndex ld a, $7 ld [hl], a ret @@ -15090,7 +15090,7 @@ Function11b0ff: ; 11b0ff .asm_11b16c ld [wcd30], a ld a, $4 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 11b175 @@ -15099,7 +15099,7 @@ Function11b175: ; 11b175 ld d, a ld a, [wc7d2] ld e, a - ld hl, $ffa9 + ld hl, hJoyLast ld a, [hl] and $40 jr nz, .asm_11b19a @@ -15411,7 +15411,7 @@ Function11b314: ; 11b314 Function11b31b: ; 11b31b ld hl, Unknown_11b350 - ld a, [wcf63] + ld a, [wJumptableIndex] cp $2 jr c, .asm_11b349 ld a, [wc7d1] @@ -15419,7 +15419,7 @@ Function11b31b: ; 11b31b jr nc, .asm_11b344 cp $3 jr c, .asm_11b349 - ld a, [wcf63] + ld a, [wJumptableIndex] cp $2 jr z, .asm_11b349 cp $3 @@ -15553,7 +15553,7 @@ Function11b3d9: ; 11b3d9 ld [hli], a cp $41 jr c, .asm_11b42b - ld a, [wcf63] + ld a, [wJumptableIndex] cp $4 jr z, .asm_11b43b cp $5 @@ -15592,7 +15592,7 @@ Function11b444: ; 11b444 Function11b44b: ; 11b44b xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [wcf65], a ld [wcf66], a @@ -15604,14 +15604,14 @@ Function11b45c: ; 11b45c .asm_11b45c call Function11b46a call DelayFrame - ld a, [wcf63] + ld a, [wJumptableIndex] cp $4 jr nz, .asm_11b45c ret ; 11b46a Function11b46a: ; 11b46a - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_11b479 @@ -15780,11 +15780,11 @@ Function11b538: ; 11b538 ld [wcd2b], a ld [bc], a inc bc - ld a, [wd84a] + ld a, [wSecretID] ld [wcd2c], a ld [bc], a inc bc - ld a, [wd84b] + ld a, [wSecretID + 1] ld [wcd2d], a ld [bc], a inc bc @@ -15813,7 +15813,7 @@ Function11b570: ; 11b570 .asm_11b57f ld a, $4 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 11b585 @@ -15913,14 +15913,14 @@ Function11b64c: ; 11b64c .asm_11b64c call Function11b65a call DelayFrame - ld a, [wcf63] + ld a, [wJumptableIndex] cp $1 jr nz, .asm_11b64c ret ; 11b65a Function11b65a: ; 11b65a - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_11b669 @@ -16146,10 +16146,10 @@ Function11b7e5: ; 11b7e5 ld a, $1 ld [wd1e9], a ld a, $2 - ld [InLinkBattle], a + ld [wLinkMode], a callba Function421d8 xor a - ld [InLinkBattle], a + ld [wLinkMode], a callba Function14a58 ld a, $5 call GetSRAMBank @@ -16677,7 +16677,7 @@ Function11c08f: ; 11c08f Function11c0c6: ; 11c0c6 - ld a, [wcf63] + ld a, [wJumptableIndex] ld l, a ld a, [wcf64] ld h, a @@ -16687,7 +16687,7 @@ Function11c0c6: ; 11c0c6 ld [hli], a push de xor a - ld [wcf63], a + ld [wJumptableIndex], a ld a, $12 ld [wcf64], a ld a, $6 @@ -16720,9 +16720,9 @@ Function11c0c6: ; 11c0c6 .asm_11c102 cp e jr nc, .asm_11c11c - ld a, [wcf63] + ld a, [wJumptableIndex] inc a - ld [wcf63], a + ld [wJumptableIndex], a ld [hl], $4e rra jr c, .asm_11c113 @@ -16763,7 +16763,7 @@ Function11c0c6: ; 11c0c6 call PlaceWholeStringInBoxAtOnce pop hl ld a, l - ld [wcf63], a + ld [wJumptableIndex], a ld a, h ld [wcf64], a ret @@ -16832,13 +16832,13 @@ Function11c156: ; 11c156 ; 11c1ab Function11c1ab: ; 11c1ab - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a call Function11c1b9 pop af - ld [$ffaa], a + ld [hInMenu], a ret ; 11c1b9 @@ -16856,7 +16856,7 @@ Function11c1b9: ; 11c1b9 Function11c1ca: ; 11c1ca xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [wcf65], a ld [wcf66], a @@ -16935,10 +16935,10 @@ Function11c277: ; 11c277 (47:4277) Function11c283: ; 11c283 .asm_11c283 - call Functiona57 + call JoyTextDelay ld a, [hJoyPressed] ld [hJoypadPressed], a - ld a, [wcf63] + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_11c2a2 call Function11c2ac @@ -16953,7 +16953,7 @@ Function11c283: ; 11c283 ; 11c2ac Function11c2ac: ; 11c2ac - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_11c2bb @@ -17154,7 +17154,7 @@ Function11c3ed: ; 11c3ed (47:43ed) ld a, [de] and $1 jr nz, .asm_11c42c - ld de, $ffa9 + ld de, hJoyLast ld a, [de] and $40 jr nz, .asm_11c47c @@ -17219,7 +17219,7 @@ Function11c3ed: ; 11c3ed (47:43ed) .asm_11c472 call Function11c4a5 .asm_11c475 - ld [wcf63], a + ld [wJumptableIndex], a call PlayClickSFX ret .asm_11c47c @@ -17326,7 +17326,7 @@ Function11c53d: ; 11c53d (47:453d) and A_BUTTON jr nz, .a - ld de, $ffa9 + ld de, hJoyLast ld a, [de] and D_UP @@ -17383,7 +17383,7 @@ Function11c53d: ; 11c53d (47:453d) .asm_11c59f ld hl, wcd24 set 1, [hl] - ld [wcf63], a + ld [wJumptableIndex], a call PlayClickSFX ret @@ -17570,7 +17570,7 @@ Function11c675: ; 11c675 (47:4675) ret .select - ld de, $ffa9 + ld de, hJoyLast ld a, [de] and D_UP jr nz, .asm_11c708 @@ -17599,7 +17599,7 @@ Function11c675: ; 11c675 (47:4675) .asm_11c6fa ld a, $15 .asm_11c6fc - ld [wcf63], a + ld [wJumptableIndex], a ld hl, wcd24 set 3, [hl] call PlayClickSFX @@ -18119,7 +18119,7 @@ Function11c9c3: ; 11c9c3 (47:49c3) ld hl, wcd24 set 4, [hl] ld a, $4 - ld [wcf63], a + ld [wJumptableIndex], a call PlayClickSFX ret .asm_11c9f7 @@ -18271,7 +18271,7 @@ Function11cab3: ; 11cab3 (47:4ab3) ld [wcd2a], a ret .asm_11caf3 - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret .asm_11caf9 @@ -18280,7 +18280,7 @@ Function11cab3: ; 11cab3 (47:4ab3) ld hl, wcd24 set 4, [hl] ld a, $4 - ld [wcf63], a + ld [wJumptableIndex], a ld a, [wcd35] cp $ff ret nz @@ -18389,7 +18389,7 @@ endr ld d, a hlcoord 1, 14 call PlaceString - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] inc hl ld a, $10 @@ -18404,7 +18404,7 @@ endr ld hl, wcd24 set 4, [hl] ld a, $4 - ld [wcf63], a + ld [wJumptableIndex], a ret .asm_11cbeb ld a, [hl] @@ -18490,7 +18490,7 @@ Function11cd04: ; 11cd04 (47:4d04) and a ret z ld a, $4 - ld [wcf63], a + ld [wJumptableIndex], a ret ; 11cd10 (47:4d10) @@ -18551,7 +18551,7 @@ Function11cd54: ; 11cd54 (47:4d54) .asm_11cd7d ld a, $15 .asm_11cd7f - ld [wcf63], a + ld [wJumptableIndex], a ld hl, wcd24 set 5, [hl] call PlayClickSFX @@ -18644,7 +18644,7 @@ Function11ce2b: ; 11ce2b (47:4e2b) and B_BUTTON jr nz, .b - ld de, $ffa9 + ld de, hJoyLast ld a, [de] and D_UP jr nz, .up @@ -18692,7 +18692,7 @@ Function11ce2b: ; 11ce2b (47:4e2b) .asm_11ce96 ld a, $13 .asm_11ce98 - ld [wcf63], a + ld [wJumptableIndex], a ld hl, wcd24 set 2, [hl] call PlayClickSFX @@ -18778,7 +18778,7 @@ String_11cf79: ; 11cf79 ; 11cfb5 Function11cfb5: ; 11cfb5 (47:4fb5) - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret ; 11cfba (47:4fba) @@ -21327,7 +21327,7 @@ Function16c000: ; 16c000 Function16c031: ; 16c031 xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [DefaultFlypoint], a ld [wd003], a @@ -22187,7 +22187,7 @@ Function16d43b: ; 16d43b call GetSGBLayout call Function32f9 call WaitBGMap - call Functiona36 + call JoyWaitAorB call Function1d7d ret ; 16d465 @@ -22297,7 +22297,7 @@ Function16d696: ; 16d696 Function16d69a: ; 16d69a ld de, GFX_16cfc1 + $300 - ld hl, $9760 + ld hl, VTiles2 tile $76 lb bc, BANK(GFX_16cfc1), 8 call Get2bpp ret @@ -22362,7 +22362,7 @@ Function16d70c: ; 16d70c Function16d713: ; 16d713 push bc push af - ld a, [$ffa9] + ld a, [hJoyLast] and $f0 ld b, a ld a, [hJoyPressed] @@ -22518,7 +22518,7 @@ Function16d7e7: ; 16d7e7 callba Function8cf62 .asm_16d7f4 - call Functiona57 + call JoyTextDelay call Function16d713 and a ret z @@ -22701,9 +22701,9 @@ Function170139: ; 170139 ld [hli], a ld a, [PlayerID + 1] ld [hli], a - ld a, [wd84a] + ld a, [wSecretID] ld [hli], a - ld a, [wd84b] + ld a, [wSecretID + 1] ld [hli], a ld e, l ld d, h @@ -22784,7 +22784,7 @@ Function17020c: ; 17020c Function170215: ; 170215 xor a - ld [wcf63], a + ld [wJumptableIndex], a call Function17022c ret ; 17021d @@ -22795,7 +22795,7 @@ Function17021d: ; 17021d Function17021e: ; 17021e xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [wcf65], a ld [wcf66], a @@ -22806,14 +22806,14 @@ Function17022c: ; 17022c .asm_17022c call Jumpto_BattleTowerBattleFunction call DelayFrame - ld a, [wcf63] + ld a, [wJumptableIndex] cp $1 jr nz, .asm_17022c ret ; 17023a Jumpto_BattleTowerBattleFunction: ; 17023a - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_BattleTowerBattleFunctions @@ -22841,7 +22841,7 @@ RunBattleTowerBattle: ; 17024d or $1 ld [InBattleTowerBattle], a xor a - ld [InLinkBattle], a + ld [wLinkMode], a callba Mobile_HealParty callba HealParty call Function1702b7 @@ -22849,7 +22849,7 @@ RunBattleTowerBattle: ; 17024d predef StartBattle callba LoadPokemonData callba HealParty - ld a, [wd0ee] + ld a, [wBattleResult] ld [ScriptVar], a and a jr nz, .asm_1702a9 @@ -22871,7 +22871,7 @@ RunBattleTowerBattle: ; 17024d pop af ld [Options], a ld a, $1 - ld [wcf63], a + ld [wJumptableIndex], a ret @@ -23228,8 +23228,8 @@ Function1704f1: ; 1704f1 call ClearSprites call ClearScreen .asm_1704fa - call Functiona57 - ld a, [wcf63] + call JoyTextDelay + ld a, [wJumptableIndex] bit 7, a jr nz, .asm_17050f call Function170510 @@ -23241,7 +23241,7 @@ Function1704f1: ; 1704f1 ; 170510 Function170510: ; 170510 - ld a, [wcf63] + ld a, [wJumptableIndex] ld e, a ld d, 0 ld hl, Jumptable_17051f @@ -23332,12 +23332,12 @@ Function170577: ret .asm_1705ac - ld hl, wcf63 + ld hl, wJumptableIndex set 7, [hl] ret Function1705b2: - ld hl, wcf63 + ld hl, wJumptableIndex inc [hl] ret ; 1705b7 @@ -24298,7 +24298,7 @@ Function170c06: ; 170c06 ld a, $5 call GetSRAMBank ld hl, $a894 - ld a, [wd0ee] + ld a, [wBattleResult] and a jr nz, .asm_170c15 inc [hl] @@ -24486,7 +24486,7 @@ Function170d02: ; 170d02 ld a, $1 ld [rVBK], a ld de, GFX_171848 - ld hl, $8c10 + ld hl, VTiles1 tile $41 lb bc, BANK(GFX_171848), $18 call Get2bpp xor a @@ -24504,13 +24504,13 @@ GFX_171848: INCBIN "gfx/unknown/171848.2bpp" Function1719c8: ; 1719c8 (5c:59c8) - ld a, [$ffaa] + ld a, [hInMenu] push af ld a, $1 - ld [$ffaa], a + ld [hInMenu], a call Function1719d6 pop af - ld [$ffaa], a + ld [hInMenu], a ret Function1719d6: ; 1719d6 (5c:59d6) @@ -24539,7 +24539,7 @@ Function1719ed: ; 1719ed (5c:59ed) ret Function171a11: ; 171a11 (5c:5a11) - call Functiona57 + call JoyTextDelay ld a, [wcd49] bit 7, a jr nz, .asm_171a2c @@ -24801,7 +24801,7 @@ Function171beb: ; 171beb (5c:5beb) ld hl, MenuDataHeader_171c6b call LoadMenuDataHeader call Function1cbb - call Function1cfd + call GetMemTileCoord callba Function104061 hlcoord 1, 14 ld de, String_171c73 @@ -24869,11 +24869,11 @@ String_171c73: ; 171c73 Function171c87: ; 171c87 (5c:5c87) call DisableLCD ld hl, GFX_171db1 - ld de, $9000 + ld de, VTiles2 tile $00 ld bc, $6e0 call CopyBytes ld hl, LZ_172abd - ld de, $8000 + ld de, VTiles0 tile $00 call Decompress call EnableLCD ld hl, Tilemap_172491 @@ -24941,11 +24941,11 @@ endr Function171d2b: ; 171d2b (5c:5d2b) call DisableLCD ld hl, GFX_171db1 - ld de, $9000 + ld de, VTiles2 tile $00 ld bc, $6e0 call CopyBytes ld hl, LZ_172abd - ld de, $8000 + ld de, VTiles0 tile $00 call Decompress call EnableLCD ld hl, Tilemap_172685 @@ -25040,7 +25040,7 @@ Function172e78: ; 172e78 (5c:6e78) call ByteFill call DisableLCD ld hl, GFX_172f1f - ld de, $9000 + ld de, VTiles2 tile $00 ld bc, $610 call CopyBytes call EnableLCD diff --git a/misc/mobile_5f.asm b/misc/mobile_5f.asm index d722a59d4..96bbfd840 100644 --- a/misc/mobile_5f.asm +++ b/misc/mobile_5f.asm @@ -60,7 +60,7 @@ Function17c000: ; 17c000 ld [rSVBK], a ld hl, MobileSelectGFX - ld de, $8300 + ld de, VTiles0 tile $30 ld bc, $200 call CopyBytes @@ -300,10 +300,10 @@ Function17d0f3: ; 17d0f3 ld a, $1 ld [wd1e9], a ld a, $2 - ld [InLinkBattle], a + ld [wLinkMode], a callba Function421d8 xor a - ld [InLinkBattle], a + ld [wLinkMode], a callba Function14a58 ld a, $5 call GetSRAMBank @@ -521,7 +521,7 @@ Function17d2b6: ; 17d2b6 Function17d2c0: ; 17d2c0 xor a - ld [wcf63], a + ld [wJumptableIndex], a ld [wcf64], a ld [wcf65], a ld [wcf66], a @@ -629,7 +629,7 @@ Function17d370: ; 17d370 call ClearScreen callba Function104061 call DisableLCD - ld hl, $8ee0 + ld hl, VTiles1 tile $6e ld de, $c608 ld bc, $0010 call CopyBytes @@ -640,17 +640,17 @@ Function17d370: ; 17d370 ld bc, $0480 call CopyBytes xor a - ld hl, $97f0 + ld hl, VTiles2 tile $7f ld bc, $0010 call ByteFill ld hl, $c608 - ld de, $8ee0 + ld de, VTiles1 tile $6e ld bc, $0010 call CopyBytes xor a ld [rVBK], a ld hl, GFX_17eb7e - ld de, $9600 + ld de, VTiles2 tile $60 ld bc, $0010 call CopyBytes call EnableLCD @@ -677,7 +677,7 @@ Function17d3f6: ; 17d3f6 Function17d405: call DisableLCD - ld hl, $8ee0 + ld hl, VTiles1 tile $6e ld de, $c608 ld bc, $0010 call CopyBytes @@ -688,11 +688,11 @@ Function17d405: ld bc, $0480 call CopyBytes xor a - ld hl, $97f0 + ld hl, VTiles2 tile $7f ld bc, $0010 call ByteFill ld hl, $c608 - ld de, $8ee0 + ld de, VTiles1 tile $6e ld bc, $0010 call CopyBytes xor a @@ -714,7 +714,7 @@ Function17d405: Function17d45a: ; 17d45a .asm_17d45a - call Functiona57 + call JoyTextDelay ld a, [wcd77] bit 7, a jr nz, .asm_17d46f @@ -2980,7 +2980,7 @@ Function17e2a7: ; 17e2a7 ld [wcf66], a callba Function118233 ld de, GFX_17eb7e - ld hl, $9600 + ld hl, VTiles2 tile $60 lb bc, BANK(GFX_17eb7e), 1 call Get2bpp ld a, [wc300] @@ -3122,7 +3122,7 @@ Function17e3c3: ; 17e3c3 push af ld a, $1 ld [rSVBK], a - callba Function106155 + callba MobileFn_106155 callba Function106187 pop af ld [rSVBK], a @@ -3144,7 +3144,7 @@ Function17e3f0: ; 17e3f0 call Function17e415 call Function17e41e .asm_17e3f6 - call Functiona57 + call JoyTextDelay ld hl, hJoyPressed ld a, [hl] and $1 @@ -4678,7 +4678,7 @@ Function17f53d: ; 17f53d Function17f555: ; 17f555 .asm_17f555 - call Functiona57 + call JoyTextDelay call Function17f5ae ld a, [wc303] bit 7, a diff --git a/misc/unused_title.asm b/misc/unused_title.asm index 327eef45c..e151deb14 100644 --- a/misc/unused_title.asm +++ b/misc/unused_title.asm @@ -9,7 +9,7 @@ UnusedTitleScreen: ; 10c000 xor a ld [hBGMapMode], a - ld hl, wcf63 + ld hl, wJumptableIndex rept 3 ld [hli], a endr @@ -17,17 +17,17 @@ endr ld hl, UnusedTitleBG_GFX ld de, VTiles2 - ld bc, $800 + ld bc, VBGMap0 - VTiles2 call CopyBytes ld hl, UnusedTitleBG_GFX + $800 ld de, VTiles1 - ld bc, $800 + ld bc, VTiles2 - VTiles1 call CopyBytes ld hl, UnusedTitleFG_GFX ld de, VTiles0 - ld bc, $800 + ld bc, VTiles1 - VTiles0 call CopyBytes ld hl, UnusedTitleBG_Tilemap @@ -546,12 +546,12 @@ UnusedTitleFG_OAM: ; 10ecb1 Function10ed51: ; 10ed51 call _TitleScreen .loop - call Functiona57 - ld a, [$ffa9] + call JoyTextDelay + ld a, [hJoyLast] ld b, a and 1 jr nz, .done - call Function10eea7 + call SuicuneFrameIterator call DelayFrame jr .loop .done diff --git a/predef/cgb.asm b/predef/cgb.asm index 47d33c5b8..b5c7aedf7 100644 --- a/predef/cgb.asm +++ b/predef/cgb.asm @@ -19,21 +19,21 @@ Predef_LoadSGBLayoutCGB: ; 8d59 ld l, a ld h, 0 add hl, hl - ld de, Table8d7a + ld de, .jumptable add hl, de ld a, [hli] ld h, [hl] ld l, a - ld de, Function8d79 + ld de, .ReturnFromJumpTable push de jp [hl] ; 8d79 -Function8d79: ; 8d79 +.ReturnFromJumpTable: ; 8d79 ret ; 8d7a -Table8d7a: ; 8d7a +.jumptable: ; 8d7a dw Function8db8 dw Function8ddb dw Function8eb9 @@ -71,15 +71,15 @@ Function8db8: ; 8db8 ld hl, PalPacket_9c66 + 1 ld de, Unkn1Pals ld c, $4 - call Function9615 + call CopyPalettes ld hl, PalPacket_9c66 + 1 ld de, Unkn1Pals + $20 ld c, $4 - call Function9615 + call CopyPalettes ld hl, PalPacket_9c66 + 1 ld de, Unkn2Pals ld c, $2 - call Function9615 + call CopyPalettes jr Function8e23 Function8ddb: ; 8ddb @@ -288,13 +288,13 @@ Unknown_8f6a: ; 8f6a Function8f70: ; 8f70 ld de, Unkn1Pals ld a, $1d - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE ld a, [CurPartySpecies] cp $ff jr nz, .asm_8f8a ld hl, Palette8fba - call Function9630 + call LoadHLPaletteIntoDE jr .asm_8f90 .asm_8f8a @@ -336,13 +336,13 @@ Palette8fc2: ; 8fc2 Function8fca: ; 8fca ld de, Unkn1Pals ld a, $1d - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE ld a, [CurPartySpecies] cp $ff jr nz, .asm_8fe4 ld hl, Palette9036 - call Function9630 + call LoadHLPaletteIntoDE jr .asm_8fed .asm_8fe4 @@ -366,7 +366,7 @@ Function8fca: ; 8fca Function9009: ; 9009 ld hl, Palette9036 - call Function9630 + call LoadHLPaletteIntoDE jr .asm_901a ld bc, TempMonDVs @@ -397,8 +397,8 @@ Palette9036: ; 9036 Function903e: ; 903e ld de, Unkn1Pals ld a, $1d - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE ld a, [CurPartySpecies] call Function9775 call Function9643 @@ -471,12 +471,12 @@ Function906e: ; 906e Function90f8: ; 90f8 ld hl, PalPacket_9ca6 + 1 - call Function9610 + call CopyFourPalettes call Function9699 ld de, Unkn2Pals ld a, $3c - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE hlcoord 0, 6, AttrMap ld bc, $0c14 ld a, $1 @@ -509,7 +509,7 @@ Jumptable_912d: ; 912d Function9133: ; 9133 ld hl, Palette_914e ld de, Unkn1Pals - call Function9630 + call LoadHLPaletteIntoDE ld hl, Palette_9156 ld de, Unkn2Pals ld bc, $0010 @@ -540,23 +540,23 @@ Palette_9156: ; 9156 Function9166: ; 9166 ld de, Unkn1Pals ld a, $38 - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE ld de, Unkn2Pals ld a, $39 - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE call Function9699 ret ; 9180 Function9180: ; 9180 ld hl, PalPacket_9c36 + 1 - call Function9610 + call CopyFourPalettes ld de, Unkn2Pals ld a, $3a - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE call Function9699 ret ; 9195 @@ -580,7 +580,7 @@ Function91ad: ; 91ad ld a, $5 call FarCopyWRAM ld hl, PalPacket_9cb6 + 1 - call Function9610 + call CopyFourPalettes call Function9699 call Function96b3 ret @@ -595,7 +595,7 @@ Function91c8: ; 91c8 Function91d1: ; 91d1 ld hl, PalPacket_9c56 + 1 - call Function9610 + call CopyFourPalettes call Function8e9f call Function8e85 call Function971a @@ -609,8 +609,8 @@ Function91e4: ; 91e4 and a jr z, .asm_91f5 ld a, $1a - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE jr .asm_921a .asm_91f5 @@ -659,7 +659,7 @@ Function9228: ; 9228 Function9251: ; 9251 ld hl, PalPacket_9cb6 + 1 - call Function9610 + call CopyFourPalettes call Function9699 call Function96b3 ret @@ -667,11 +667,11 @@ Function9251: ; 9251 Function925e: ; 925e ld hl, PalPacket_9bc6 + 1 - call Function9610 + call CopyFourPalettes ld de, Unkn2Pals ld a, $4c - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE ld a, [rSVBK] push af ld a, $5 @@ -715,8 +715,8 @@ Function9289: ; 9289 call Function976b call Function9643 ld a, $24 - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE hlcoord 0, 0, AttrMap ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld a, [PlayerGender] @@ -796,8 +796,8 @@ Function9289: ; 9289 Function9373: ; 9373 ld de, Unkn1Pals ld a, $10 - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE ld a, [PlayerHPPal] ld l, a ld h, 0 @@ -821,7 +821,7 @@ endr Function93a6: ; 93a6 ld hl, PalPacket_9c46 + 1 - call Function9610 + call CopyFourPalettes call Function9699 call Function96b3 call Function96a4 @@ -833,8 +833,8 @@ Function93a6: ; 93a6 Function93ba: ; 93ba ld de, Unkn1Pals ld a, $1d - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE call Function9699 call Function96b3 call Function96a4 @@ -949,7 +949,7 @@ Function9499: ; 9499 call Function91c8 ld de, $0014 hlcoord 0, 0, AttrMap - ld a, [wcf82] + ld a, [wMenuBorderTopCoord] .asm_94a5 and a jr z, .asm_94ac @@ -958,19 +958,19 @@ Function9499: ; 9499 jr .asm_94a5 .asm_94ac - ld a, [wcf83] + ld a, [wMenuBorderLeftCoord] ld e, a ld d, $0 add hl, de - ld a, [wcf82] + ld a, [wMenuBorderTopCoord] ld b, a - ld a, [wcf84] + ld a, [wMenuBorderBottomCoord] inc a sub b ld b, a - ld a, [wcf83] + ld a, [wMenuBorderLeftCoord] ld c, a - ld a, [wcf85] + ld a, [wMenuBorderRightCoord] sub c inc a ld c, a @@ -982,7 +982,7 @@ Function9499: ; 9499 Function94d0: ; 94d0 ld hl, PalPacket_9ba6 + 1 - call Function9610 + call CopyFourPalettes call Function9699 hlcoord 0, 4, AttrMap ld bc, $0a14 @@ -1002,14 +1002,14 @@ Function94d0: ; 94d0 Function94fa: ; 94fa ld de, Unkn1Pals ld a, $4e - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE ld hl, Palette_9521 ld de, Unkn2Pals - call Function9630 + call LoadHLPaletteIntoDE ld hl, Palette_9521 ld de, Unkn2Pals + 8 - call Function9630 + call LoadHLPaletteIntoDE call Function9699 call Function96b3 call Function96a4 @@ -1047,7 +1047,7 @@ Function9542: ; 9542 Function9555: ; 9555 ld hl, PalPacket_9cc6 + 1 - call Function9610 + call CopyFourPalettes ld hl, Palettes_b681 ld de, Unkn2Pals ld bc, $0008 @@ -1055,8 +1055,8 @@ Function9555: ; 9555 call FarCopyWRAM ld de, Unkn2Pals + $38 ld a, $1c - call Function9625 - call Function9630 + call GetAthPalletFromPalettes9df6 + call LoadHLPaletteIntoDE call Function9699 ret ; 9578 diff --git a/predef/sgb.asm b/predef/sgb.asm index 590dcb3d2..12038da24 100644 --- a/predef/sgb.asm +++ b/predef/sgb.asm @@ -443,13 +443,13 @@ endr ld hl, wcda9 + $13 ld a, $5 ld [hli], a - ld a, [wcf83] + ld a, [wMenuBorderLeftCoord] ld [hli], a - ld a, [wcf82] + ld a, [wMenuBorderTopCoord] ld [hli], a - ld a, [wcf85] + ld a, [wMenuBorderRightCoord] ld [hli], a - ld a, [wcf84] + ld a, [wMenuBorderBottomCoord] ld [hl], a ld hl, wcda9 ld de, wcda9 + $10 diff --git a/sram.asm b/sram.asm index 1201925d9..280f2402d 100644 --- a/sram.asm +++ b/sram.asm @@ -1,5 +1,5 @@ SECTION "Scratch", SRAM, BANK [0] - +SRAM_Begin:: sScratch:: @@ -7,8 +7,10 @@ SECTION "SRAM Bank 0", SRAM [$a600], BANK [0] s0_a600:: ds $11a s0_a71a:: ds $11a -s0_a834:: ds $1d7 -s0_aa0b:: ds $1d7 +s0_a834:: ds 1 +s0_a835:: ds 10 * (party_struct_length + PartyMon1 - PartyMon1Item) +s0_aa0b:: ds 1 +s0_aa0c:: ds 10 * (party_struct_length + PartyMon1 - PartyMon1Item) sMysteryGiftItem:: ds 1 s0_abe3:: ds 1 @@ -16,7 +18,8 @@ s0_abe4:: ds 1 s0_abe5:: ds 1 s0_abe6:: ds 10 s0_abf0:: ds 10 -s0_abfa:: ds 2 +sMysteryGiftTimer:: ds 1 +sMysteryGiftTimerStartDay:: ds 1 ds 1 sMysteryGiftTrainerHouseFlag:: ds 1 s0_abfe:: ds 12 @@ -49,6 +52,8 @@ sBackupGameDataEnd:: sBackupChecksum:: ds 2 s0_bf0f:: ds 1 sStackTop:: ds 2 + ds $ee +SRAM_End:: SECTION "SRAM Bank 1", SRAM, BANK [1] diff --git a/text/common_4.asm b/text/common_4.asm index c96d032f8..b85295e46 100644 --- a/text/common_4.asm +++ b/text/common_4.asm @@ -1464,7 +1464,7 @@ UnknownText_0x1c5c5d: ; 0x1c5c5d UnknownText_0x1c5c5e: ; 0x1c5c5e text "You now have" line "@" - deciram wdc4b, $12 + deciram wBlueCardBalance, $12 text " points." done ; 0x1c5c7b diff --git a/tilesets/animations.asm b/tilesets/animations.asm index 8b8b7ab42..c84db6785 100644 --- a/tilesets/animations.asm +++ b/tilesets/animations.asm @@ -39,7 +39,7 @@ endr Tileset00Anim: ; 0xfc01b Tileset02Anim: ; 0xfc01b Tileset03Anim: ; 0xfc01b - dwtile $14, VTiles2, AnimateWaterTile + dw VTiles2 tile $14, AnimateWaterTile dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation @@ -53,9 +53,9 @@ Tileset03Anim: ; 0xfc01b ; 0xfc047 Tileset25Anim: ; 0xfc047 - dwtile $14, VTiles2, AnimateWaterTile + dw VTiles2 tile $14, AnimateWaterTile dw NULL, WaitTileAnimation - dwtile $5f, VTiles2, AnimateFountain + dw VTiles2 tile $5f, AnimateFountain dw NULL, WaitTileAnimation dw NULL, TileAnimationPalette dw NULL, WaitTileAnimation @@ -75,14 +75,14 @@ Tileset31Anim: ; 0xfc073 dw NULL, ForestTreeLeftAnimation2 dw NULL, ForestTreeRightAnimation2 dw NULL, AnimateFlowerTile - dwtile $14, VTiles2, AnimateWaterTile + dw VTiles2 tile $14, AnimateWaterTile dw NULL, TileAnimationPalette dw NULL, NextTileFrame8 dw NULL, DoneTileAnimation ; 0xfc0a3 Tileset01Anim: ; 0xfc0a3 - dwtile $14, VTiles2, AnimateWaterTile + dw VTiles2 tile $14, AnimateWaterTile dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation dw NULL, TileAnimationPalette @@ -98,9 +98,9 @@ Tileset01Anim: ; 0xfc0a3 ; 0xfc0d7 TilesetAnimfc0d7: ; 0xfc0d7 - dwtile $03, VTiles2, WriteTileToBuffer + dw VTiles2 tile $03, WriteTileToBuffer dw wcf41, ScrollTileRightLeft - dwtile $03, VTiles2, WriteTileFromBuffer + dw VTiles2 tile $03, WriteTileFromBuffer dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation @@ -112,9 +112,9 @@ TilesetAnimfc0d7: ; 0xfc0d7 ; 0xfc103 TilesetAnimfc103: ; 0xfc103 - dwtile $14, VTiles2, WriteTileToBuffer + dw VTiles2 tile $14, WriteTileToBuffer dw wcf41, ScrollTileRightLeft - dwtile $14, VTiles2, WriteTileFromBuffer + dw VTiles2 tile $14, WriteTileFromBuffer dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation @@ -126,7 +126,7 @@ TilesetAnimfc103: ; 0xfc103 ; 0xfc12f Tileset09Anim: ; 0xfc12f - dwtile $14, VTiles2, AnimateWaterTile + dw VTiles2 tile $14, AnimateWaterTile dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation @@ -152,48 +152,48 @@ Tileset15Anim: ; 0xfc15f ; 0xfc17f TilesetAnimfc17f: ; 0xfc17f - dwtile $53, VTiles2, WriteTileToBuffer + dw VTiles2 tile $53, WriteTileToBuffer dw wcf41, ScrollTileDown dw wcf41, ScrollTileDown - dwtile $53, VTiles2, WriteTileFromBuffer - dwtile $03, VTiles2, WriteTileToBuffer + dw VTiles2 tile $53, WriteTileFromBuffer + dw VTiles2 tile $03, WriteTileToBuffer dw wcf41, ScrollTileRightLeft - dwtile $03, VTiles2, WriteTileFromBuffer - dwtile $53, VTiles2, WriteTileToBuffer + dw VTiles2 tile $03, WriteTileFromBuffer + dw VTiles2 tile $53, WriteTileToBuffer dw wcf41, ScrollTileDown dw wcf41, ScrollTileDown - dwtile $53, VTiles2, WriteTileFromBuffer + dw VTiles2 tile $53, WriteTileFromBuffer dw NULL, DoneTileAnimation ; 0xfc1af TilesetAnimfc1af: ; 0xfc1af - dwtile $54, VTiles2, WriteTileToBuffer + dw VTiles2 tile $54, WriteTileToBuffer dw wcf41, ScrollTileDown dw wcf41, ScrollTileDown - dwtile $54, VTiles2, WriteTileFromBuffer + dw VTiles2 tile $54, WriteTileFromBuffer dw NULL, WaitTileAnimation - dwtile $03, VTiles2, WriteTileToBuffer + dw VTiles2 tile $03, WriteTileToBuffer dw wcf41, ScrollTileRightLeft - dwtile $03, VTiles2, WriteTileFromBuffer + dw VTiles2 tile $03, WriteTileFromBuffer dw NULL, WaitTileAnimation - dwtile $54, VTiles2, WriteTileToBuffer + dw VTiles2 tile $54, WriteTileToBuffer dw wcf41, ScrollTileDown dw wcf41, ScrollTileDown - dwtile $54, VTiles2, WriteTileFromBuffer + dw VTiles2 tile $54, WriteTileFromBuffer dw NULL, DoneTileAnimation ; 0xfc1e7 Tileset24Anim: ; 0xfc1e7 Tileset30Anim: ; 0xfc1e7 - dwtile $14, VTiles2, WriteTileToBuffer + dw VTiles2 tile $14, WriteTileToBuffer dw NULL, FlickeringCaveEntrancePalette dw wcf41, ScrollTileRightLeft dw NULL, FlickeringCaveEntrancePalette - dwtile $14, VTiles2, WriteTileFromBuffer + dw VTiles2 tile $14, WriteTileFromBuffer dw NULL, FlickeringCaveEntrancePalette dw NULL, TileAnimationPalette dw NULL, FlickeringCaveEntrancePalette - dwtile $40, VTiles2, WriteTileToBuffer + dw VTiles2 tile $40, WriteTileToBuffer dw NULL, FlickeringCaveEntrancePalette dw wcf41, ScrollTileDown dw NULL, FlickeringCaveEntrancePalette @@ -201,21 +201,21 @@ Tileset30Anim: ; 0xfc1e7 dw NULL, FlickeringCaveEntrancePalette dw wcf41, ScrollTileDown dw NULL, FlickeringCaveEntrancePalette - dwtile $40, VTiles2, WriteTileFromBuffer + dw VTiles2 tile $40, WriteTileFromBuffer dw NULL, FlickeringCaveEntrancePalette dw NULL, DoneTileAnimation ; 0xfc233 Tileset29Anim: ; 0xfc233 - dwtile $35, VTiles2, WriteTileToBuffer + dw VTiles2 tile $35, WriteTileToBuffer dw NULL, FlickeringCaveEntrancePalette dw wcf41, ScrollTileRightLeft dw NULL, FlickeringCaveEntrancePalette - dwtile $35, VTiles2, WriteTileFromBuffer + dw VTiles2 tile $35, WriteTileFromBuffer dw NULL, FlickeringCaveEntrancePalette dw NULL, TileAnimationPalette dw NULL, FlickeringCaveEntrancePalette - dwtile $31, VTiles2, WriteTileToBuffer + dw VTiles2 tile $31, WriteTileToBuffer dw NULL, FlickeringCaveEntrancePalette dw wcf41, ScrollTileDown dw NULL, FlickeringCaveEntrancePalette @@ -223,7 +223,7 @@ Tileset29Anim: ; 0xfc233 dw NULL, FlickeringCaveEntrancePalette dw wcf41, ScrollTileDown dw NULL, FlickeringCaveEntrancePalette - dwtile $31, VTiles2, WriteTileFromBuffer + dw VTiles2 tile $31, WriteTileFromBuffer dw NULL, FlickeringCaveEntrancePalette dw NULL, DoneTileAnimation ; 0xfc27f @@ -248,9 +248,9 @@ Tileset23Anim: ; 0xfc27f ; 0xfc2bf TilesetAnimfc2bf: ; 0xfc2bf - dwtile $4f, VTiles2, WriteTileToBuffer + dw VTiles2 tile $4f, WriteTileToBuffer dw wcf41, ScrollTileRightLeft - dwtile $4f, VTiles2, WriteTileFromBuffer + dw VTiles2 tile $4f, WriteTileFromBuffer dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation @@ -504,7 +504,7 @@ ForestTreeLeftAnimation: ; fc45c ld c, l ; Only during the Celebi event. - ld a, [wdbf3] + ld a, [wCelebiEvent] bit 2, a jr nz, .asm_fc46c ld hl, ForestTreeLeftFrames @@ -524,7 +524,7 @@ endr .asm_fc47d ld sp, hl - ld hl, $90c0 + ld hl, VTiles2 tile $0c jp WriteTile ; fc484 @@ -546,7 +546,7 @@ ForestTreeRightAnimation: ; fc4c4 ld c, l ; Only during the Celebi event. - ld a, [wdbf3] + ld a, [wCelebiEvent] bit 2, a jr nz, .asm_fc4d4 ld hl, ForestTreeRightFrames @@ -570,7 +570,7 @@ endr .asm_fc4eb ld sp, hl - ld hl, $90f0 + ld hl, VTiles2 tile $0f jp WriteTile ; fc4f2 @@ -581,7 +581,7 @@ ForestTreeLeftAnimation2: ; fc4f2 ld c, l ; Only during the Celebi event. - ld a, [wdbf3] + ld a, [wCelebiEvent] bit 2, a jr nz, .asm_fc502 ld hl, ForestTreeLeftFrames @@ -602,7 +602,7 @@ endr .asm_fc515 ld sp, hl - ld hl, $90c0 + ld hl, VTiles2 tile $0c jp WriteTile ; fc51c @@ -613,7 +613,7 @@ ForestTreeRightAnimation2: ; fc51c ld c, l ; Only during the Celebi event. - ld a, [wdbf3] + ld a, [wCelebiEvent] bit 2, a jr nz, .asm_fc52c ld hl, ForestTreeRightFrames @@ -638,7 +638,7 @@ endr .asm_fc545 ld sp, hl - ld hl, $90f0 + ld hl, VTiles2 tile $0f jp WriteTile ; fc54c @@ -725,7 +725,7 @@ endr ld hl, SafariFountainFrames add hl, de ld sp, hl - ld hl, $95b0 + ld hl, VTiles2 tile $5b jp WriteTile ; fc5eb @@ -745,7 +745,7 @@ endr ld hl, SafariFountainFrames add hl, de ld sp, hl - ld hl, $9380 + ld hl, VTiles2 tile $38 jp WriteTile ; fc605 @@ -1029,16 +1029,16 @@ FlickeringCaveEntrancePalette: ; fc71e ; fc750 -SproutPillarTilePointer1: dwtile $2d, VTiles2, SproutPillarTile1 -SproutPillarTilePointer2: dwtile $2f, VTiles2, SproutPillarTile2 -SproutPillarTilePointer3: dwtile $3d, VTiles2, SproutPillarTile3 -SproutPillarTilePointer4: dwtile $3f, VTiles2, SproutPillarTile4 -SproutPillarTilePointer5: dwtile $3c, VTiles2, SproutPillarTile5 -SproutPillarTilePointer6: dwtile $2c, VTiles2, SproutPillarTile6 -SproutPillarTilePointer7: dwtile $4d, VTiles2, SproutPillarTile7 -SproutPillarTilePointer8: dwtile $4f, VTiles2, SproutPillarTile8 -SproutPillarTilePointer9: dwtile $5d, VTiles2, SproutPillarTile9 -SproutPillarTilePointer10: dwtile $5f, VTiles2, SproutPillarTile10 +SproutPillarTilePointer1: dw VTiles2 tile $2d, SproutPillarTile1 +SproutPillarTilePointer2: dw VTiles2 tile $2f, SproutPillarTile2 +SproutPillarTilePointer3: dw VTiles2 tile $3d, SproutPillarTile3 +SproutPillarTilePointer4: dw VTiles2 tile $3f, SproutPillarTile4 +SproutPillarTilePointer5: dw VTiles2 tile $3c, SproutPillarTile5 +SproutPillarTilePointer6: dw VTiles2 tile $2c, SproutPillarTile6 +SproutPillarTilePointer7: dw VTiles2 tile $4d, SproutPillarTile7 +SproutPillarTilePointer8: dw VTiles2 tile $4f, SproutPillarTile8 +SproutPillarTilePointer9: dw VTiles2 tile $5d, SproutPillarTile9 +SproutPillarTilePointer10: dw VTiles2 tile $5f, SproutPillarTile10 SproutPillarTile1: INCBIN "gfx/tilesets/sprout-pillar/1.2bpp" SproutPillarTile2: INCBIN "gfx/tilesets/sprout-pillar/2.2bpp" @@ -1053,10 +1053,10 @@ SproutPillarTile10: INCBIN "gfx/tilesets/sprout-pillar/10.2bpp" ; fca98 -WhirlpoolFrames1: dwtile $32, VTiles2, WhirlpoolTiles1 -WhirlpoolFrames2: dwtile $33, VTiles2, WhirlpoolTiles2 -WhirlpoolFrames3: dwtile $42, VTiles2, WhirlpoolTiles3 -WhirlpoolFrames4: dwtile $43, VTiles2, WhirlpoolTiles4 +WhirlpoolFrames1: dw VTiles2 tile $32, WhirlpoolTiles1 +WhirlpoolFrames2: dw VTiles2 tile $33, WhirlpoolTiles2 +WhirlpoolFrames3: dw VTiles2 tile $42, WhirlpoolTiles3 +WhirlpoolFrames4: dw VTiles2 tile $43, WhirlpoolTiles4 ; fcaa8 WhirlpoolTiles1: INCBIN "gfx/tilesets/whirlpool/1.2bpp" diff --git a/tilesets/roofs.asm b/tilesets/roofs.asm index 1882e28ac..677c80f6c 100644 --- a/tilesets/roofs.asm +++ b/tilesets/roofs.asm @@ -11,7 +11,7 @@ LoadMapGroupRoof:: ; 1c000 ld hl, Roofs ld bc, $90 call AddNTimes - ld de, $90a0 + ld de, VTiles2 tile $0a ld bc, $90 call CopyBytes ret diff --git a/trainers/attributes.asm b/trainers/attributes.asm index 1aa506522..40a07605c 100644 --- a/trainers/attributes.asm +++ b/trainers/attributes.asm @@ -1,24 +1,3 @@ - const_def - const NO_AI -const_value = 0 - shift_const AI_BASIC - shift_const AI_SETUP - shift_const AI_TYPES - shift_const AI_OFFENSIVE - shift_const AI_SMART - shift_const AI_OPPORTUNIST - shift_const AI_AGGRESSIVE - shift_const AI_CAUTIOUS - shift_const AI_STATUS - shift_const AI_RISKY - shift_const AI_10 - shift_const AI_11 - shift_const AI_12 - shift_const AI_13 - shift_const AI_14 - shift_const AI_15 - - TrainerClassAttributes: ; 3959c ; Falkner diff --git a/vram.asm b/vram.asm new file mode 100644 index 000000000..d434fd097 --- /dev/null +++ b/vram.asm @@ -0,0 +1,13 @@ +SECTION "VRAM0", VRAM, BANK [0] +VTiles0:: ds $800 +VTiles1:: ds $800 +VTiles2:: ds $800 +VBGMap0:: ds $400 +VBGMap1:: ds $400 + +SECTION "VRAM1", VRAM, BANK [1] +VTiles3:: ds $800 +VTiles4:: ds $800 +VTiles5:: ds $800 +VBGMap2:: ds $400 +VBGMap3:: ds $400 diff --git a/wram.asm b/wram.asm index 874dc0a4e..08de7d7d4 100644 --- a/wram.asm +++ b/wram.asm @@ -129,24 +129,16 @@ channel_struct: MACRO ds 1 ; c131 ds 1 ; c132 ENDM +GLOBAL box_struct_length, party_struct_length -SECTION "CHR0", VRAM [$8000], BANK [0] -VTiles0:: -SECTION "CHR1", VRAM [$8800], BANK [0] -VTiles1:: -SECTION "CHR2", VRAM [$9000], BANK [0] -VTiles2:: -SECTION "BG0", VRAM [$9800], BANK [0] -VBGMap0:: -SECTION "BG1", VRAM [$9C00], BANK [0] -VBGMap1:: - - +INCLUDE "vram.asm" SECTION "Stack", WRAM0 wc000:: - ds $ff +StackBottom:: + ds $100 - 1 Stack:: +StackTop:: ds 1 @@ -303,7 +295,7 @@ wc2d7:: ds 1 wc2d8:: ds 1 wc2d9:: ds 1 wc2da:: ds 2 -InLinkBattle:: ; c2dc +wLinkMode:: ; c2dc ; 0 not in link battle ; 1 link battle ; 4 mobile battle @@ -372,7 +364,7 @@ wPartyMonMenuIconAnims:: ds 96 ; c314 wc374:: ds 48 ; c374 wc3a4:: ds 8 ; c3b4 wc3ac:: ds 8 ; c3bc -wc3b4:: ds 1 ; c3 +wc3b4:: ds 1 ; c3b4 wc3b5:: ds 1 CurIcon:: ; c3b6 @@ -388,7 +380,8 @@ wc3bc:: ds 1 wc3bd:: ds 1 wc3be:: ds 1 wc3bf:: ds 1 -wc3c0:: ds 12 +wc3c0:: ds 1 +wc3c1:: ds 11 wc3cc:: ds 1 wc3cd:: ds 31 wc3ec:: ds 1 @@ -450,6 +443,8 @@ wc60f:: wPlayerMoveStruct:: ds MOVE_LENGTH ; c60f wc616:: EnemyMonNick:: ds PKMN_NAME_LENGTH ; c616 + ds -5 +wInitHourBuffer:: ds 5 BattleMonNick:: ds PKMN_NAME_LENGTH ; c621 BattleMon:: battle_struct BattleMon ; c62c @@ -886,19 +881,20 @@ wc7e8:: ds 24 RSSET 0 ; Offsets for wBT_OTTempCopy:: @ $c608 -wBT_OTTempCopy_0 RB $A ; $c608 -wBT_OTTempCopy_TrainerClass RB $1 ; $c608 + $a = $c612 -wBT_OTTempCopy_Pkmn1 RB $30 ; $c608 + $b = $c613 -wBT_OTTempCopy_Pkmn1Name RB $A ; $c608 + $3b = $c643 -wBT_OTTempCopy_45 RB $1 ; $c608 + $45 = $c64d -wBT_OTTempCopy_Pkmn2 RB $30 ; $c608 + $46 = $c64e -wBT_OTTempCopy_Pkmn2Name RB $A ; $c608 + $76 = $c67e -wBT_OTTempCopy_80 RB $1 ; $c608 + $80 = $c688 -wBT_OTTempCopy_Pkmn3 RB $30 ; $c608 + $81 = $c689 -wBT_OTTempCopy_Pkmn3Name RB $A ; $c608 + $b1 = $c6b9 -wBT_OTTempCopy_BB RB $1 ; $c608 + $bb = $c6c3 +wBT_OTTempCopy_0 RB 10 ; $c608 +wBT_OTTempCopy_TrainerClass RB 1 ; $c608 + $a = $c612 +wBT_OTTempCopy_Pkmn1 RB party_struct_length ; $c608 + $b = $c613 +wBT_OTTempCopy_Pkmn1Name RB PKMN_NAME_LENGTH + -1 ; $c608 + $45 = $c64d +wBT_OTTempCopy_45 RB 1 +wBT_OTTempCopy_Pkmn2 RB party_struct_length ; $c608 + $46 = $c64e +wBT_OTTempCopy_Pkmn2Name RB PKMN_NAME_LENGTH + -1 ; $c608 + $76 = $c67e +wBT_OTTempCopy_80 RB 1 +wBT_OTTempCopy_Pkmn3 RB party_struct_length ; $c608 + $81 = $c689 +wBT_OTTempCopy_Pkmn3Name RB PKMN_NAME_LENGTH + -1 ; $c608 + $b1 = $c6b9 +wBT_OTTempCopy_BB RB 1 -GLOBAL wBT_OTTempCopy_TrainerClass, wBT_OTTempCopy_Pkmn1, wBT_OTTempCopy_Pkmn1Name, wBT_OTTempCopy_45, wBT_OTTempCopy_Pkmn2, wBT_OTTempCopy_Pkmn2Name, wBT_OTTempCopy_80, wBT_OTTempCopy_Pkmn3, wBT_OTTempCopy_Pkmn3Name, wBT_OTTempCopy_BB +GLOBAL wBT_OTTempCopy_TrainerClass, wBT_OTTempCopy_Pkmn1, wBT_OTTempCopy_Pkmn1Name, wBT_OTTempCopy_Pkmn2, wBT_OTTempCopy_Pkmn2Name, wBT_OTTempCopy_Pkmn3, wBT_OTTempCopy_Pkmn3Name +GLOBAL wBT_OTTempCopy_45, wBT_OTTempCopy_80, wBT_OTTempCopy_BB @@ -1188,15 +1184,19 @@ MonType:: ; cf5f CurSpecies:: ; cf60 ds 1 -wcf61:: ds 2 -wcf63:: ds 1 +wNamedObjectTypeBuffer:: ds 1 + ds 1 +wJumptableIndex:: ds 1 wNrOfBeatenBattleTowerTrainers:: wMomBankDigitCursorPosition:: +wIntroSceneFrameCounter:: wcf64:: ds 1 IF !DEF(CRYSTAL11) wPokedexStatus:: ENDC +wTitleScreenTimerLo:: wcf65:: ds 1 +wTitleScreenTimerHi:: wcf66:: ds 1 Requested2bpp:: ; cf67 @@ -1223,22 +1223,28 @@ wcf75:: ds 1 wcf76:: ds 1 wcf77:: ds 1 wcf78:: ds 9 + +; menu data header buffer (ds 16) wcf81:: ds 1 -wcf82:: ds 1 -wcf83:: ds 1 -wcf84:: ds 1 -wcf85:: ds 1 + +; dw related to tilemap +wMenuBorderTopCoord:: ds 1 +wMenuBorderLeftCoord:: ds 1 +wMenuBorderBottomCoord:: ds 1 +wMenuBorderRightCoord:: ds 1 + wcf86:: ds 1 wcf87:: ds 1 -wcf88:: ds 2 -wcf8a:: ds 7 +wPocketCursorBuffer:: ds 2 +wcf8a:: ds 7 ; menu data 2 bank? wcf91:: ds 1 + wcf92:: ds 1 wcf93:: ds 1 wcf94:: ds 1 -wcf95:: ds 1 -wcf96:: ds 1 -wcf97:: ds 1 +wcf95:: ds 1 ; bank +wcf96:: ds 1 ; addr lo +wcf97:: ds 1 ; addr hi wcf98:: ds 3 wcf9b:: ds 3 wcf9e:: ds 3 @@ -1339,41 +1345,52 @@ Options2:: ; cfd1 ds 2 OptionsEnd:: -wcfd4:: ds 1 -wcfd5:: ds 1 -wcfd6:: ds 1 -wcfd7:: ds 1 +; Time buffer, for counting the amount of time since +; an event began. + +wSecondsSince:: ds 1 +wMinutesSince:: ds 1 +wHoursSince:: ds 1 +wDaysSince:: ds 1 ds 40 SECTION "WRAM 1", WRAMX, BANK [1] +MiscBuffer0:: wd000:: ds 1 +MiscBuffer1:: wd001:: ds 1 wd002:: +MiscBuffer2:: PhoneScriptBank:: DefaultFlypoint:: ; d002 LuckyNumberDigit1Buffer:: ds 1 wd003:: +MiscBuffer3:: LuckyNumberDigit2Buffer:: PhoneCallerLo:: ds 1 wd004:: +MiscBuffer4:: LuckyNumberDigit3Buffer:: PhoneCallerHi:: ds 1 wd005:: +MiscBuffer5:: LuckyNumberDigit4Buffer:: StartFlypoint:: ; d005 ds 1 wd006:: +MiscBuffer6:: LuckyNumberDigit5Buffer:: EndFlypoint:: ; d006 ds 1 wd007:: +MiscBuffer7:: MovementBuffer:: ; d007 ds 1 @@ -1419,13 +1436,17 @@ EngineBuffer1:: ; d03e wd03f:: CurFruit:: ; d03f MartPointerBank:: +EngineBuffer2:: ds 1 wd040:: MartPointer:: ; d040 +EngineBuffer3:: ds 1 -wd041:: ds 1 +wd041:: +EngineBuffer4:: + ds 1 MovementAnimation:: ; d042 ds 1 @@ -1447,6 +1468,7 @@ wd048:: ds 1 wLossTextPointer:: ds 2 wd04b:: ds 2 wd04d:: ds 1 +MenuItemsListEnd:: wd04e:: ds 2 wd050:: ds 10 wd05a:: ds 12 @@ -1478,10 +1500,10 @@ CurMoveNum:: ; d0d5 wd0d6:: ds 1 wd0d7:: ds 1 wd0d8:: ds 1 -wd0d9:: ds 1 -wd0da:: ds 1 -wd0db:: ds 1 -wd0dc:: ds 1 +wItemsPocketCursor:: ds 1 +wKeyItemsPocketCursor:: ds 1 +wBallsPocketCursor:: ds 1 +wTMHMPocketCursor:: ds 1 wd0dd:: ds 2 wd0df:: ds 1 wd0e0:: ds 1 @@ -1501,7 +1523,7 @@ VramState:: ; d0ed ; flickers when climbing waterfall ds 1 -wd0ee:: ds 1 +wBattleResult:: ds 1 wd0ef:: ds 1 wd0f0:: CurMart:: ; d0f0 @@ -1521,6 +1543,7 @@ wd105:: ds 1 CurItem:: ; d106 ds 1 +ItemCountBuffer:: ; d107 wd107:: ds 1 CurPartySpecies:: ; d108 @@ -1548,7 +1571,9 @@ wd13f:: ds 2 PartyMenuActionText:: ; d141 ds 1 -wd142:: ds 1 +wItemAttributeParamBuffer:: +wd142:: + ds 1 CurPartyLevel:: ; d143 ds 1 @@ -1586,7 +1611,8 @@ wd195:: ds 1 wd196:: ds 1 wd197:: ds 2 wd199:: ds 1 -wPermission:: ds 3 +wPermission:: ds 1 + ds 2 ; width/height are in blocks (2x2 walkable tiles, 4x4 graphics tiles) MapHeader:: ; d19d @@ -1716,7 +1742,6 @@ EvolvableFlags:: ; d1e8 flag_array PARTY_LENGTH wd1e9:: ds 1 -wd1ea:: MagikarpLength:: Buffer1:: ; d1ea ds 1 @@ -1752,7 +1777,7 @@ EnemyMonBaseExp:: db ; d22c EnemyMonEnd:: -IsInBattle:: ; d22d +wBattleMode:: ; d22d ; 0: overworld ; 1: wild battle ; 2: trainer battle @@ -1848,7 +1873,7 @@ CurDamage:: ; d256 ds 2 wd25a:: ds 3 wd25d:: ds 1 -wd25e:: ds 4 +wListMoves_MoveIndicesBuffer:: ds 4 wd262:: ds 1 wd263:: ds 1 wd264:: ds 1 @@ -1864,15 +1889,14 @@ TimeOfDay:: ; d269 ds 1 ds 1 +SECTION "Enemy Party", WRAMX, BANK [1] +OTPlayerName:: wd26b:: ds 1 wd26c:: ds 1 wd26d:: ds 4 wd271:: ds 5 wd276:: ds 10 - -SECTION "Enemy Party", WRAMX, BANK [1] - OTPartyCount:: ds 1 ; d280 OTPartySpecies:: ds PARTY_LENGTH ; d281 OTPartyEnd:: ds 1 @@ -1932,13 +1956,18 @@ wd454:: ds 1 ds 4 wd459:: ds 2 -wd45b:: ds 1 -wd45c:: ds 8 -wd464:: ds 1 -wd465:: ds 1 -wd466:: ds 6 -wd46c:: ds 1 -wd46d:: ds 5 +wPlayerSpriteSetupFlags:: ds 1 +wMapReentryScriptQueueFlag:: ds 1 ; MemScriptFlag +wMapReentryScriptBank:: ds 1 ; MemScriptBank +wMapReentryScriptAddress:: ds 2 ; MemScriptAddr + ds 4 ; ????????????? +wTimeCyclesSinceLastCall:: ds 1 +wReceiveCallDelay_MinsRemaining:: ds 1 +wReceiveCallDelay_StartTime:: ds 3 + ds 3 +wBugContestMinsRemaining:: ds 1 +wBugContestSecsRemaining:: ds 1 + ds 4 wCrystalData:: PlayerGender:: ; d472 @@ -1967,7 +1996,7 @@ RivalName:: ds NAME_LENGTH ; d493 RedsName:: ds NAME_LENGTH ; d49e GreensName:: ds NAME_LENGTH ; d4a9 -wd4b4:: ds 1 +wSavedAtLeastOnce:: ds 1 wSpawnAfterChampion:: ds 1 ; init time set at newgame @@ -2106,7 +2135,7 @@ CurTimeOfDay:: ; d848 ds 1 -wd84a:: ds 1 +wSecretID:: ds 1 wd84b:: ds 1 StatusFlags:: ; d84c ds 1 @@ -2119,7 +2148,7 @@ Money:: ; d84e wd851:: wMomsMoney:: ; d851 ds 3 -wd854:: +wBankOfMomMode:: wMomSavingMoney:: ; d854 ds 1 @@ -2305,11 +2334,6 @@ wErinFightCount:: ds 1 ds 100 EventFlags:: ; da72 -;RoomDecorations:: ; dac6 -;TeamRocketAzaleaTownAttackEvent:: ; db51 -;PoliceAtElmsLabEvent:: ; db52 -;SalesmanMahoganyTownEvent:: ; db5c -;RedGyaradosEvent:: ; db5c flag_array NUM_EVENTS ; db6c @@ -2323,7 +2347,7 @@ wCurBox:: ; db72 ; 8 chars + $50 wBoxNames:: ds 9 * NUM_BOXES ; db75 -wdbf3:: ds 1 +wCelebiEvent:: ds 1 ds 1 BikeFlags:: ; dbf5 @@ -2336,11 +2360,11 @@ wCurrentMapTriggerPointer:: ; dbf7 ds 2 wCurrentCaller:: ds 2 -wdbfb:: ds 1 -wdbfc:: ds 1 +wCurrMapWarpCount:: ds 1 +wCurrMapWarpHeaderPointer:: ds 1 wdbfd:: ds 1 wCurrentMapXYTriggerCount:: ds 1 -wdbff:: ds 1 +wCurrentMapXYTriggerHeaderPointer:: ds 1 wdc00:: ds 1 wCurrentMapSignpostCount:: ds 1 wdc02:: ds 1 @@ -2348,10 +2372,11 @@ wdc03:: ds 1 wdc04:: ds 1 wdc05:: ds 1 wdc06:: ds 1 -wdc07:: ds 2 +wCurrMapTriggerCount:: ds 1 +wCurrMapTriggerHeaderPointer:: ds 1 wdc09:: ds 1 -wdc0a:: ds 1 -wdc0b:: ds 2 +wCurrMapCallbackCount:: ds 1 +wCurrMapCallbackHeaderPointer:: ds 2 wdc0d:: ds 1 wdc0e:: ds 1 @@ -2381,13 +2406,13 @@ wdc18:: ds 1 wdc19:: ds 1 wdc1a:: ds 1 wdc1b:: ds 1 -wdc1c:: ds 2 +wDailyResetTimer:: ds 2 DailyFlags:: ds 1 WeeklyFlags:: ds 1 SwarmFlags:: ds 1 wdc21:: ds 1 wdc22:: ds 1 -wdc23:: ds 1 +wStartDay:: ds 1 wdc24:: ds 2 wdc26:: ds 1 @@ -2400,15 +2425,16 @@ wLuckyNumberDayBuffer:: ds 2 ds 2 wSpecialPhoneCallID:: ds 2 wdc33:: ds 2 -wdc35:: ds 4 +wBugContestStartTime:: ds 4 ; day, hour, min, sec wdc39:: ds 1 -wdc3a:: ds 1 -wdc3b:: ds 5 +wUnusedTwoDayTimer:: ds 1 +wUnusedTwoDayTimerStartDate:: ds 1 + ds 4 wdc40:: ds 1 wdc41:: ds 1 wdc42:: ds 8 -wdc4a:: ds 1 -wdc4b:: ds 1 +wBuenasPassword:: ds 1 +wBlueCardBalance:: ds 1 wDailyRematchFlags:: ds 4 wDailyPhoneItemFlags:: ds 4 wDailyPhoneTimeOfDayFlags:: ds 4 @@ -2428,11 +2454,13 @@ PoisonStepCount:: ; dc74 wdc77:: ds 2 wdc79:: ds 1 wdc7a:: ds 2 -wdc7c:: ds 33 +wPhoneList:: ds CONTACT_LIST_SIZE + ds 23 wLuckyNumberShowFlag:: ds 2 wLuckyIDNumber:: ds 2 -wdca1:: ds 3 -wdca4:: ds 1 +wRepelEffect:: ds 1 +wBikeStep:: ds 2 +wKurtApricornQuantity:: ds 1 wPlayerDataEnd:: @@ -2562,7 +2590,7 @@ wContestMon:: party_struct wContestMon ; df9c wdfcc:: ds 1 wdfcd:: ds 1 -wdfce:: ds 1 +wFishingSwarmFlag:: ds 1 roam_struct: MACRO \1Species:: db @@ -2728,7 +2756,12 @@ w5_d422:: ds $40 SECTION "WRAM 6", WRAMX, BANK [6] -w6_d000:: ds $600 +w6_d000:: ds $400 +w6_d400:: ds $200 w6_d600:: ds $600 INCLUDE "sram.asm" + +SECTION "WRAM 7", WRAMX, BANK [7] +w7_d000:: ds $1000 - 1 +w7_dfff:: ds 1