You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
More WRAM cleanup
This commit is contained in:
@@ -1619,8 +1619,8 @@ RadioChannels:
|
||||
|
||||
LoadStation_OaksPokemonTalk: ; 91753 (24:5753)
|
||||
xor a ; OAKS_POKEMON_TALK
|
||||
ld [wd002], a
|
||||
ld [wd005], a
|
||||
ld [wCurrentRadioLine], a
|
||||
ld [wNumRadioLinesPrinted], a
|
||||
ld a, BANK(PlayRadioShow)
|
||||
ld hl, PlayRadioShow
|
||||
call Radio_BackUpFarCallParams
|
||||
@@ -1629,9 +1629,9 @@ LoadStation_OaksPokemonTalk: ; 91753 (24:5753)
|
||||
|
||||
LoadStation_PokedexShow: ; 91766 (24:5766)
|
||||
ld a, POKEDEX_SHOW
|
||||
ld [wd002], a
|
||||
ld [wCurrentRadioLine], a
|
||||
xor a
|
||||
ld [wd005], a
|
||||
ld [wNumRadioLinesPrinted], a
|
||||
ld a, BANK(PlayRadioShow)
|
||||
ld hl, PlayRadioShow
|
||||
call Radio_BackUpFarCallParams
|
||||
@@ -1640,9 +1640,9 @@ LoadStation_PokedexShow: ; 91766 (24:5766)
|
||||
|
||||
LoadStation_PokemonMusic: ; 9177b (24:577b)
|
||||
ld a, POKEMON_MUSIC
|
||||
ld [wd002], a
|
||||
ld [wCurrentRadioLine], a
|
||||
xor a
|
||||
ld [wd005], a
|
||||
ld [wNumRadioLinesPrinted], a
|
||||
ld a, BANK(PlayRadioShow)
|
||||
ld hl, PlayRadioShow
|
||||
call Radio_BackUpFarCallParams
|
||||
@@ -1651,9 +1651,9 @@ LoadStation_PokemonMusic: ; 9177b (24:577b)
|
||||
|
||||
LoadStation_LuckyChannel: ; 91790 (24:5790)
|
||||
ld a, LUCKY_CHANNEL
|
||||
ld [wd002], a
|
||||
ld [wCurrentRadioLine], a
|
||||
xor a
|
||||
ld [wd005], a
|
||||
ld [wNumRadioLinesPrinted], a
|
||||
ld a, BANK(PlayRadioShow)
|
||||
ld hl, PlayRadioShow
|
||||
call Radio_BackUpFarCallParams
|
||||
@@ -1662,9 +1662,9 @@ LoadStation_LuckyChannel: ; 91790 (24:5790)
|
||||
|
||||
LoadStation_BuenasPassword: ; 917a5 (24:57a5)
|
||||
ld a, BUENAS_PASSWORD
|
||||
ld [wd002], a
|
||||
ld [wCurrentRadioLine], a
|
||||
xor a
|
||||
ld [wd005], a
|
||||
ld [wNumRadioLinesPrinted], a
|
||||
ld a, BANK(PlayRadioShow)
|
||||
ld hl, PlayRadioShow
|
||||
call Radio_BackUpFarCallParams
|
||||
@@ -1682,9 +1682,9 @@ NotBuenasPasswordName: db "@"
|
||||
|
||||
LoadStation_UnownRadio: ; 917d5 (24:57d5)
|
||||
ld a, UNOWN_RADIO
|
||||
ld [wd002], a
|
||||
ld [wCurrentRadioLine], a
|
||||
xor a
|
||||
ld [wd005], a
|
||||
ld [wNumRadioLinesPrinted], a
|
||||
ld a, BANK(PlayRadioShow)
|
||||
ld hl, PlayRadioShow
|
||||
call Radio_BackUpFarCallParams
|
||||
@@ -1693,9 +1693,9 @@ LoadStation_UnownRadio: ; 917d5 (24:57d5)
|
||||
|
||||
LoadStation_PlacesAndPeople: ; 917ea (24:57ea)
|
||||
ld a, PLACES_AND_PEOPLE
|
||||
ld [wd002], a
|
||||
ld [wCurrentRadioLine], a
|
||||
xor a
|
||||
ld [wd005], a
|
||||
ld [wNumRadioLinesPrinted], a
|
||||
ld a, BANK(PlayRadioShow)
|
||||
ld hl, PlayRadioShow
|
||||
call Radio_BackUpFarCallParams
|
||||
@@ -1704,9 +1704,9 @@ LoadStation_PlacesAndPeople: ; 917ea (24:57ea)
|
||||
|
||||
LoadStation_LetsAllSing: ; 917ff (24:57ff)
|
||||
ld a, LETS_ALL_SING
|
||||
ld [wd002], a
|
||||
ld [wCurrentRadioLine], a
|
||||
xor a
|
||||
ld [wd005], a
|
||||
ld [wNumRadioLinesPrinted], a
|
||||
ld a, BANK(PlayRadioShow)
|
||||
ld hl, PlayRadioShow
|
||||
call Radio_BackUpFarCallParams
|
||||
@@ -1717,9 +1717,9 @@ LoadStation_LetsAllSing: ; 917ff (24:57ff)
|
||||
|
||||
LoadStation_RocketRadio: ; 91814
|
||||
ld a, ROCKET_RADIO
|
||||
ld [wd002], a
|
||||
ld [wCurrentRadioLine], a
|
||||
xor a
|
||||
ld [wd005], a
|
||||
ld [wNumRadioLinesPrinted], a
|
||||
ld a, BANK(PlayRadioShow)
|
||||
ld hl, PlayRadioShow
|
||||
call Radio_BackUpFarCallParams
|
||||
@@ -1730,9 +1730,9 @@ LoadStation_RocketRadio: ; 91814
|
||||
|
||||
LoadStation_PokeFluteRadio: ; 91829 (24:5829)
|
||||
ld a, POKE_FLUTE_RADIO
|
||||
ld [wd002], a
|
||||
ld [wCurrentRadioLine], a
|
||||
xor a
|
||||
ld [wd005], a
|
||||
ld [wNumRadioLinesPrinted], a
|
||||
ld a, BANK(PlayRadioShow)
|
||||
ld hl, PlayRadioShow
|
||||
call Radio_BackUpFarCallParams
|
||||
@@ -1741,9 +1741,9 @@ LoadStation_PokeFluteRadio: ; 91829 (24:5829)
|
||||
|
||||
LoadStation_EvolutionRadio: ; 9183e (24:583e)
|
||||
ld a, EVOLUTION_RADIO
|
||||
ld [wd002], a
|
||||
ld [wCurrentRadioLine], a
|
||||
xor a
|
||||
ld [wd005], a
|
||||
ld [wNumRadioLinesPrinted], a
|
||||
ld a, BANK(PlayRadioShow)
|
||||
ld hl, PlayRadioShow
|
||||
call Radio_BackUpFarCallParams
|
||||
@@ -1855,20 +1855,20 @@ _TownMap: ; 9191c
|
||||
ld a, $e3
|
||||
ld [rLCDC], a
|
||||
call TownMap_GetCurrentLandmark
|
||||
ld [wd002], a
|
||||
ld [wd003], a
|
||||
ld [wTownMapPlayerIconLandmark], a
|
||||
ld [wTownMapCursorLandmark], a
|
||||
xor a
|
||||
ld [hBGMapMode], a
|
||||
call .InitTilemap
|
||||
call WaitBGMap2
|
||||
ld a, [wd002]
|
||||
ld a, [wTownMapPlayerIconLandmark]
|
||||
call PokegearMap_InitPlayerIcon
|
||||
ld a, [wd003]
|
||||
ld a, [wTownMapCursorLandmark]
|
||||
call PokegearMap_InitCursor
|
||||
ld a, c
|
||||
ld [wd004], a
|
||||
ld [wTownMapCursorObjectPointer], a
|
||||
ld a, b
|
||||
ld [wd005], a
|
||||
ld [wTownMapCursorObjectPointer + 1], a
|
||||
ld b, SCGB_POKEGEAR_PALS
|
||||
call GetSGBLayout
|
||||
call SetPalettes
|
||||
@@ -1880,7 +1880,7 @@ _TownMap: ; 9191c
|
||||
call DelayFrame
|
||||
|
||||
.dmg
|
||||
ld a, [wd002]
|
||||
ld a, [wTownMapPlayerIconLandmark]
|
||||
cp KANTO_LANDMARK
|
||||
jr nc, .kanto
|
||||
ld d, KANTO_LANDMARK - 1
|
||||
@@ -1925,7 +1925,7 @@ _TownMap: ; 9191c
|
||||
jr .loop
|
||||
|
||||
.pressed_up
|
||||
ld hl, wd003
|
||||
ld hl, wTownMapCursorLandmark
|
||||
ld a, [hl]
|
||||
cp d
|
||||
jr c, .okay
|
||||
@@ -1938,7 +1938,7 @@ _TownMap: ; 9191c
|
||||
jr .next
|
||||
|
||||
.pressed_down
|
||||
ld hl, wd003
|
||||
ld hl, wTownMapCursorLandmark
|
||||
ld a, [hl]
|
||||
cp e
|
||||
jr nz, .okay2
|
||||
@@ -1951,20 +1951,20 @@ _TownMap: ; 9191c
|
||||
|
||||
.next
|
||||
push de
|
||||
ld a, [wd003]
|
||||
ld a, [wTownMapCursorLandmark]
|
||||
call PokegearMap_UpdateLandmarkName
|
||||
ld a, [wd004]
|
||||
ld a, [wTownMapCursorObjectPointer]
|
||||
ld c, a
|
||||
ld a, [wd005]
|
||||
ld a, [wTownMapCursorObjectPointer + 1]
|
||||
ld b, a
|
||||
ld a, [wd003]
|
||||
ld a, [wTownMapCursorLandmark]
|
||||
call PokegearMap_UpdateCursorPosition
|
||||
pop de
|
||||
jr .loop2
|
||||
; 91a04
|
||||
|
||||
.InitTilemap: ; 91a04
|
||||
ld a, [wd002]
|
||||
ld a, [wTownMapPlayerIconLandmark]
|
||||
cp KANTO_LANDMARK
|
||||
jr nc, .kanto2
|
||||
ld e, $0
|
||||
@@ -1992,7 +1992,7 @@ _TownMap: ; 9191c
|
||||
call ByteFill
|
||||
hlcoord 19, 2
|
||||
ld [hl], $17
|
||||
ld a, [wd003]
|
||||
ld a, [wTownMapCursorLandmark]
|
||||
call PokegearMap_UpdateLandmarkName
|
||||
callba TownMapPals
|
||||
ret
|
||||
@@ -2147,7 +2147,7 @@ _FlyMap: ; 91af3
|
||||
jr .exit
|
||||
|
||||
.pressedA
|
||||
ld a, [wd002]
|
||||
ld a, [wTownMapPlayerIconLandmark]
|
||||
ld l, a
|
||||
ld h, 0
|
||||
add hl, hl
|
||||
@@ -2155,7 +2155,7 @@ _FlyMap: ; 91af3
|
||||
add hl, de
|
||||
ld a, [hl]
|
||||
.exit
|
||||
ld [wd002], a
|
||||
ld [wTownMapPlayerIconLandmark], a
|
||||
pop af
|
||||
ld [hInMenu], a
|
||||
call ClearBGPalettes
|
||||
@@ -2165,7 +2165,7 @@ _FlyMap: ; 91af3
|
||||
ld [hBGMapAddress], a
|
||||
ld a, VBGMap0 / $100
|
||||
ld [hBGMapAddress + 1], a
|
||||
ld a, [wd002]
|
||||
ld a, [wTownMapPlayerIconLandmark]
|
||||
ld e, a
|
||||
ret
|
||||
|
||||
@@ -2186,7 +2186,7 @@ FlyMapScroll: ; 91b73
|
||||
ret
|
||||
|
||||
.ScrollNext:
|
||||
ld hl, wd002
|
||||
ld hl, wTownMapPlayerIconLandmark
|
||||
ld a, [hl]
|
||||
cp d
|
||||
jr nz, .NotAtEndYet
|
||||
@@ -2200,7 +2200,7 @@ FlyMapScroll: ; 91b73
|
||||
jr .Finally
|
||||
|
||||
.ScrollPrev:
|
||||
ld hl, wd002
|
||||
ld hl, wTownMapPlayerIconLandmark
|
||||
ld a, [hl]
|
||||
cp e
|
||||
jr nz, .NotAtStartYet
|
||||
@@ -2269,7 +2269,7 @@ TownMapBubble: ; 91bb5
|
||||
|
||||
.Name:
|
||||
; We need the map location of the default flypoint
|
||||
ld a, [wd002]
|
||||
ld a, [wTownMapPlayerIconLandmark]
|
||||
ld l, a
|
||||
ld h, 0
|
||||
add hl, hl ; two bytes per flypoint
|
||||
@@ -2285,7 +2285,7 @@ TownMapBubble: ; 91bb5
|
||||
; 91c17
|
||||
|
||||
GetMapCursorCoordinates: ; 91c17
|
||||
ld a, [wd002]
|
||||
ld a, [wTownMapPlayerIconLandmark]
|
||||
ld l, a
|
||||
ld h, $0
|
||||
add hl, hl
|
||||
@@ -2293,9 +2293,9 @@ GetMapCursorCoordinates: ; 91c17
|
||||
add hl, de
|
||||
ld e, [hl]
|
||||
callba GetLandmarkCoords
|
||||
ld a, [wd003]
|
||||
ld a, [wTownMapCursorCoordinates]
|
||||
ld c, a
|
||||
ld a, [wd004]
|
||||
ld a, [wTownMapCursorCoordinates + 1]
|
||||
ld b, a
|
||||
ld hl, $4
|
||||
add hl, bc
|
||||
@@ -2389,8 +2389,7 @@ FlyMap: ; 91c90
|
||||
ld c, a
|
||||
call GetWorldMapLocation
|
||||
; If we're not in a valid location, i.e. Pokecenter floor 2F,
|
||||
|
||||
; the backup map information is used
|
||||
; the backup map information is used.
|
||||
cp SPECIAL_MAP
|
||||
jr nz, .CheckRegion
|
||||
ld a, [BackupMapGroup]
|
||||
@@ -2399,7 +2398,7 @@ FlyMap: ; 91c90
|
||||
ld c, a
|
||||
call GetWorldMapLocation
|
||||
.CheckRegion:
|
||||
; The first 46 locations are part of Johto. The rest are in Kanto
|
||||
; The first 46 locations are part of Johto. The rest are in Kanto.
|
||||
cp KANTO_LANDMARK
|
||||
jr nc, .KantoFlyMap
|
||||
.JohtoFlyMap:
|
||||
@@ -2407,10 +2406,10 @@ FlyMap: ; 91c90
|
||||
push af
|
||||
; Start from New Bark Town
|
||||
ld a, FLY_NEW_BARK
|
||||
ld [wd002], a
|
||||
ld [wTownMapPlayerIconLandmark], a
|
||||
; Flypoints begin at New Bark Town...
|
||||
ld [StartFlypoint], a
|
||||
; ..and end at Silver Cave
|
||||
; ..and end at Silver Cave.
|
||||
ld a, FLY_MT_SILVER
|
||||
ld [EndFlypoint], a
|
||||
; Fill out the map
|
||||
@@ -2422,17 +2421,13 @@ FlyMap: ; 91c90
|
||||
|
||||
.KantoFlyMap:
|
||||
; The event that there are no flypoints enabled in a map is not
|
||||
|
||||
; accounted for. As a result, if you attempt to select a flypoint
|
||||
; when there are none enabled, the game will crash. Additionally,
|
||||
|
||||
; the flypoint selection has a default starting point that
|
||||
; can be flown to even if none are enabled
|
||||
|
||||
; can be flown to even if none are enabled.
|
||||
; To prevent both of these things from happening when the player
|
||||
; enters Kanto, fly access is restricted until Indigo Plateau is
|
||||
|
||||
; visited and its flypoint enabled
|
||||
; visited and its flypoint enabled.
|
||||
push af
|
||||
ld c, SPAWN_INDIGO
|
||||
call HasVisitedSpawn
|
||||
@@ -2447,9 +2442,8 @@ FlyMap: ; 91c90
|
||||
ld a, FLY_INDIGO
|
||||
ld [EndFlypoint], a
|
||||
; Because Indigo Plateau is the first flypoint the player
|
||||
|
||||
; visits, it's made the default flypoint
|
||||
ld [wd002], a
|
||||
; visits, it's made the default flypoint.
|
||||
ld [wTownMapPlayerIconLandmark], a
|
||||
; Fill out the map
|
||||
call FillKantoMap
|
||||
call .MapHud
|
||||
@@ -2462,7 +2456,7 @@ FlyMap: ; 91c90
|
||||
|
||||
; Start from New Bark Town
|
||||
ld a, FLY_NEW_BARK
|
||||
ld [wd002], a
|
||||
ld [wTownMapPlayerIconLandmark], a
|
||||
; Flypoints begin at New Bark Town...
|
||||
ld [StartFlypoint], a
|
||||
; ..and end at Silver Cave
|
||||
@@ -2477,21 +2471,21 @@ FlyMap: ; 91c90
|
||||
call TownMapBGUpdate
|
||||
call TownMapMon
|
||||
ld a, c
|
||||
ld [wd003], a
|
||||
ld [wTownMapCursorCoordinates], a
|
||||
ld a, b
|
||||
ld [wd004], a
|
||||
ld [wTownMapCursorCoordinates + 1], a
|
||||
ret
|
||||
|
||||
; 91d11
|
||||
|
||||
_Area: ; 91d11
|
||||
; e: Current landmark
|
||||
ld a, [wd002]
|
||||
ld a, [wTownMapPlayerIconLandmark]
|
||||
push af
|
||||
ld a, [wd003]
|
||||
ld a, [wTownMapCursorLandmark]
|
||||
push af
|
||||
ld a, e
|
||||
ld [wd002], a
|
||||
ld [wTownMapPlayerIconLandmark], a
|
||||
call ClearSprites
|
||||
xor a
|
||||
ld [hBGMapMode], a
|
||||
@@ -2545,9 +2539,9 @@ _Area: ; 91d11
|
||||
.a_b
|
||||
call ClearSprites
|
||||
pop af
|
||||
ld [wd003], a
|
||||
ld [wTownMapCursorLandmark], a
|
||||
pop af
|
||||
ld [wd002], a
|
||||
ld [wTownMapPlayerIconLandmark], a
|
||||
ret
|
||||
|
||||
; 91d9b
|
||||
@@ -2636,7 +2630,7 @@ _Area: ; 91d11
|
||||
; 91e1e
|
||||
|
||||
.GetAndPlaceNest: ; 91e1e
|
||||
ld [wd003], a
|
||||
ld [wTownMapCursorLandmark], a
|
||||
ld e, a
|
||||
callba FindNest ; load nest landmarks into TileMap[0,0]
|
||||
decoord 0, 0
|
||||
@@ -2678,7 +2672,7 @@ _Area: ; 91d11
|
||||
.HideNestsShowPlayer: ; 91e5a
|
||||
call .CheckPlayerLocation
|
||||
ret c
|
||||
ld a, [wd002]
|
||||
ld a, [wTownMapPlayerIconLandmark]
|
||||
ld e, a
|
||||
callba GetLandmarkCoords
|
||||
ld c, e
|
||||
@@ -2731,22 +2725,21 @@ _Area: ; 91d11
|
||||
|
||||
.CheckPlayerLocation: ; 91ea9
|
||||
; Don't show the player's sprite if you're
|
||||
|
||||
; not in the same region as what's currently
|
||||
; on the screen.
|
||||
ld a, [wd002]
|
||||
ld a, [wTownMapPlayerIconLandmark]
|
||||
cp FAST_SHIP
|
||||
jr z, .johto
|
||||
cp KANTO_LANDMARK
|
||||
jr c, .johto
|
||||
.kanto
|
||||
ld a, [wd003]
|
||||
ld a, [wTownMapCursorLandmark]
|
||||
and a
|
||||
jr z, .clear
|
||||
jr .ok
|
||||
|
||||
.johto
|
||||
ld a, [wd003]
|
||||
ld a, [wTownMapCursorLandmark]
|
||||
and a
|
||||
jr nz, .clear
|
||||
.ok
|
||||
@@ -2764,7 +2757,7 @@ _Area: ; 91d11
|
||||
; 91ed0
|
||||
|
||||
.GetPlayerOrFastShipIcon: ; 91ed0
|
||||
ld a, [wd002]
|
||||
ld a, [wTownMapPlayerIconLandmark]
|
||||
cp FAST_SHIP
|
||||
jr z, .FastShip
|
||||
callba GetPlayerIcon
|
||||
@@ -2991,7 +2984,7 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
|
||||
|
||||
; XXX
|
||||
xor a
|
||||
ld [wd002], a
|
||||
ld [wTownMapPlayerIconLandmark], a
|
||||
call ClearBGPalettes
|
||||
call ClearTileMap
|
||||
call ClearSprites
|
||||
@@ -3019,9 +3012,9 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
|
||||
call TownMapBGUpdate
|
||||
call TownMapMon
|
||||
ld a, c
|
||||
ld [wd003], a
|
||||
ld [wTownMapCursorCoordinates], a
|
||||
ld a, b
|
||||
ld [wd004], a
|
||||
ld [wTownMapCursorCoordinates + 1], a
|
||||
ld b, SCGB_POKEGEAR_PALS
|
||||
call GetSGBLayout
|
||||
call SetPalettes
|
||||
@@ -3045,7 +3038,7 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
|
||||
jr .finished_a_b
|
||||
|
||||
.pressedA
|
||||
ld a, [wd002]
|
||||
ld a, [wTownMapPlayerIconLandmark]
|
||||
ld l, a
|
||||
ld h, 0
|
||||
add hl, hl
|
||||
@@ -3053,7 +3046,7 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
|
||||
add hl, de
|
||||
ld a, [hl]
|
||||
.finished_a_b
|
||||
ld [wd002], a
|
||||
ld [wTownMapPlayerIconLandmark], a
|
||||
pop af
|
||||
ld [hInMenu], a
|
||||
call ClearBGPalettes
|
||||
@@ -3063,7 +3056,7 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
|
||||
ld [hBGMapAddress], a
|
||||
ld a, VBGMap0 / $100
|
||||
ld [hBGMapAddress + 1], a
|
||||
ld a, [wd002]
|
||||
ld a, [wTownMapPlayerIconLandmark]
|
||||
ld e, a
|
||||
ret
|
||||
|
||||
@@ -3080,7 +3073,7 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
|
||||
ret
|
||||
|
||||
.down_right
|
||||
ld hl, wd002
|
||||
ld hl, wTownMapPlayerIconLandmark
|
||||
ld a, [hl]
|
||||
cp FLY_INDIGO
|
||||
jr c, .okay_dr
|
||||
@@ -3090,7 +3083,7 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
|
||||
jr .continue
|
||||
|
||||
.up_left
|
||||
ld hl, wd002
|
||||
ld hl, wTownMapPlayerIconLandmark
|
||||
ld a, [hl]
|
||||
and a
|
||||
jr nz, .okay_ul
|
||||
@@ -3098,7 +3091,7 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
|
||||
.okay_ul
|
||||
dec [hl]
|
||||
.continue
|
||||
ld a, [wd002]
|
||||
ld a, [wTownMapPlayerIconLandmark]
|
||||
cp KANTO_FLYPOINT
|
||||
jr c, .johto
|
||||
call FillKantoMap
|
||||
|
||||
Reference in New Issue
Block a user