2015-11-17 02:07:26 +00:00
|
|
|
|
PokeGear: ; 90b8d (24:4b8d)
|
|
|
|
|
ld hl, Options
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
push af
|
|
|
|
|
set NO_TEXT_SCROLL, [hl]
|
|
|
|
|
ld a, [hInMenu]
|
|
|
|
|
push af
|
|
|
|
|
ld a, $1
|
|
|
|
|
ld [hInMenu], a
|
|
|
|
|
ld a, [VramState]
|
|
|
|
|
push af
|
|
|
|
|
xor a
|
|
|
|
|
ld [VramState], a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call .InitTilemap
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call DelayFrame
|
|
|
|
|
.loop
|
|
|
|
|
call UpdateTime
|
|
|
|
|
call JoyTextDelay
|
|
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
|
bit 7, a
|
|
|
|
|
jr nz, .done
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call PokegearJumptable
|
2015-11-28 20:13:40 +00:00
|
|
|
|
callba PlaySpriteAnimations
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call DelayFrame
|
|
|
|
|
jr .loop
|
|
|
|
|
|
|
|
|
|
.done
|
|
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
|
call PlaySFX
|
|
|
|
|
call WaitSFX
|
|
|
|
|
pop af
|
|
|
|
|
ld [VramState], a
|
|
|
|
|
pop af
|
|
|
|
|
ld [hInMenu], a
|
|
|
|
|
pop af
|
|
|
|
|
ld [Options], a
|
|
|
|
|
call ClearBGPalettes
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapAddress], a
|
|
|
|
|
ld a, VBGMap0 / $100
|
|
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
|
ld a, $90
|
|
|
|
|
ld [hWY], a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call ExitPokegearRadio_HandleMusic
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.InitTilemap: ; 90bea (24:4bea)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call ClearBGPalettes
|
|
|
|
|
call ClearTileMap
|
|
|
|
|
call ClearSprites
|
|
|
|
|
call DisableLCD
|
|
|
|
|
xor a
|
|
|
|
|
ld [hSCY], a
|
|
|
|
|
ld [hSCX], a
|
|
|
|
|
ld a, $7
|
|
|
|
|
ld [hWX], a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call Pokegear_LoadGFX
|
2015-12-02 02:54:11 +00:00
|
|
|
|
callba ClearSpriteAnims
|
2015-12-09 16:38:40 +00:00
|
|
|
|
call InitPokegearModeIndicatorArrow
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, 8
|
|
|
|
|
call SkipMusic
|
|
|
|
|
ld a, $e3
|
|
|
|
|
ld [rLCDC], a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call TownMap_InitCursorAndPlayerIconPositions
|
2015-11-17 02:07:26 +00:00
|
|
|
|
xor a
|
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
|
ld [wcf64], a
|
|
|
|
|
ld [wcf65], a
|
|
|
|
|
ld [wcf66], a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearPhoneScrollPosition], a
|
|
|
|
|
ld [wPokegearPhoneCursorPosition], a
|
|
|
|
|
ld [wPokegearPhoneSelectedPerson], a
|
|
|
|
|
ld [wPokegearRadioChannelBank], a
|
|
|
|
|
ld [wPokegearRadioChannelAddr], a
|
|
|
|
|
ld [wPokegearRadioChannelAddr + 1], a
|
|
|
|
|
call Pokegear_InitJumptableIndices
|
|
|
|
|
call InitPokegearTilemap
|
2015-12-28 15:57:04 +00:00
|
|
|
|
ld b, SCGB_POKEGEAR_PALS
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call GetSGBLayout
|
|
|
|
|
call SetPalettes
|
|
|
|
|
ld a, [hCGB]
|
|
|
|
|
and a
|
|
|
|
|
ret z
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld a, %11100100
|
|
|
|
|
call DmgToCgbObjPal0
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
Pokegear_LoadGFX: ; 90c4e
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call ClearVBank1
|
|
|
|
|
ld hl, TownMapGFX
|
|
|
|
|
ld de, VTiles2
|
|
|
|
|
ld a, BANK(TownMapGFX)
|
|
|
|
|
call FarDecompress
|
|
|
|
|
ld hl, PokegearGFX
|
|
|
|
|
ld de, VTiles2 + $30 tiles
|
|
|
|
|
ld a, BANK(PokegearGFX)
|
|
|
|
|
call FarDecompress
|
|
|
|
|
ld hl, PokegearSpritesGFX
|
|
|
|
|
ld de, VTiles0
|
|
|
|
|
ld a, BANK(PokegearSpritesGFX)
|
|
|
|
|
call Decompress
|
|
|
|
|
ld a, [MapGroup]
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [MapNumber]
|
|
|
|
|
ld c, a
|
|
|
|
|
call GetWorldMapLocation
|
|
|
|
|
cp FAST_SHIP
|
|
|
|
|
jr z, .ssaqua
|
|
|
|
|
callba GetPlayerIcon
|
|
|
|
|
push de
|
|
|
|
|
ld h, d
|
|
|
|
|
ld l, e
|
|
|
|
|
ld a, b
|
2015-12-09 16:38:40 +00:00
|
|
|
|
; standing sprite
|
2015-11-17 02:07:26 +00:00
|
|
|
|
push af
|
|
|
|
|
ld de, VTiles0 tile $10
|
|
|
|
|
ld bc, 4 tiles
|
|
|
|
|
call FarCopyBytes
|
|
|
|
|
pop af
|
|
|
|
|
pop hl
|
2015-12-09 16:38:40 +00:00
|
|
|
|
; walking sprite
|
|
|
|
|
ld de, 12 tiles
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, de
|
|
|
|
|
ld de, VTiles0 tile $14
|
|
|
|
|
ld bc, 4 tiles
|
|
|
|
|
call FarCopyBytes
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.ssaqua
|
|
|
|
|
ld hl, FastShipGFX
|
|
|
|
|
ld de, VTiles0 tile $10
|
|
|
|
|
ld bc, 8 tiles
|
|
|
|
|
call CopyBytes
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 90cb2
|
|
|
|
|
|
|
|
|
|
FastShipGFX: ; 90cb2
|
|
|
|
|
INCBIN "gfx/misc/fast_ship.2bpp"
|
|
|
|
|
; 90d32
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
InitPokegearModeIndicatorArrow: ; 90d32 (24:4d32)
|
2015-11-18 18:01:55 +00:00
|
|
|
|
depixel 4, 2, 4, 0
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, SPRITE_ANIM_INDEX_0D
|
|
|
|
|
call _InitSpriteAnimStruct
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_TILE_ID
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], $0
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
AnimatePokegearModeIndicatorArrow: ; 90d41 (24:4d41)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, wcf64
|
|
|
|
|
ld e, [hl]
|
|
|
|
|
ld d, 0
|
2016-01-10 22:44:09 +00:00
|
|
|
|
ld hl, .XCoords
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, de
|
|
|
|
|
ld a, [hl]
|
2016-01-10 22:44:09 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XOFFSET
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], a
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 90d52 (24:4d52)
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.XCoords: ; 90d52
|
2015-11-17 02:07:26 +00:00
|
|
|
|
db $00, $10, $20, $30
|
|
|
|
|
; 90d56
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
TownMap_GetCurrentLandmark: ; 90d56
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [MapGroup]
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [MapNumber]
|
|
|
|
|
ld c, a
|
|
|
|
|
call GetWorldMapLocation
|
|
|
|
|
cp SPECIAL_MAP
|
|
|
|
|
ret nz
|
|
|
|
|
ld a, [BackupMapGroup]
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [BackupMapNumber]
|
|
|
|
|
ld c, a
|
|
|
|
|
call GetWorldMapLocation
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
; 90d70
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
TownMap_InitCursorAndPlayerIconPositions: ; 90d70 (24:4d70)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [MapGroup]
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [MapNumber]
|
|
|
|
|
ld c, a
|
|
|
|
|
call GetWorldMapLocation
|
|
|
|
|
cp FAST_SHIP
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr z, .FastShip
|
2015-11-17 02:07:26 +00:00
|
|
|
|
cp SPECIAL_MAP
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr nz, .LoadLandmark
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [BackupMapGroup]
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [BackupMapNumber]
|
|
|
|
|
ld c, a
|
|
|
|
|
call GetWorldMapLocation
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.LoadLandmark:
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld [wPokegearMapPlayerIconLandmark], a
|
|
|
|
|
ld [wPokegearMapCursorLandmark], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.FastShip:
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld [wPokegearMapPlayerIconLandmark], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, NEW_BARK_TOWN
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld [wPokegearMapCursorLandmark], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
Pokegear_InitJumptableIndices: ; 90d9e (24:4d9e)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, $0
|
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [wcf64], a
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
InitPokegearTilemap: ; 90da8 (24:4da8)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
hlcoord 0, 0
|
|
|
|
|
ld bc, TileMapEnd - TileMap
|
|
|
|
|
ld a, $4f
|
|
|
|
|
call ByteFill
|
|
|
|
|
ld a, [wcf64]
|
|
|
|
|
and $3
|
|
|
|
|
add a
|
|
|
|
|
ld e, a
|
|
|
|
|
ld d, 0
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld hl, .Jumptable
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, de
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
ld h, [hl]
|
|
|
|
|
ld l, a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld de, .return_from_jumptable
|
2015-11-17 02:07:26 +00:00
|
|
|
|
push de
|
|
|
|
|
jp [hl]
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.return_from_jumptable
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call Pokegear_FinishTilemap
|
2015-11-17 02:07:26 +00:00
|
|
|
|
callba TownMapPals
|
|
|
|
|
ld a, [wcf65]
|
|
|
|
|
and a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr nz, .kanto_0
|
2015-11-17 02:07:26 +00:00
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapAddress], a
|
|
|
|
|
ld a, VBGMap0 / $100
|
|
|
|
|
ld [hBGMapAddress + 1], a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call .UpdateBGMap
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, $90
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr .finish
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.kanto_0
|
2015-11-17 02:07:26 +00:00
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapAddress], a
|
|
|
|
|
ld a, VBGMap1 / $100
|
|
|
|
|
ld [hBGMapAddress + 1], a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call .UpdateBGMap
|
2015-11-17 02:07:26 +00:00
|
|
|
|
xor a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.finish
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [hWY], a
|
|
|
|
|
ld a, [wcf65]
|
|
|
|
|
and 1
|
|
|
|
|
xor 1
|
|
|
|
|
ld [wcf65], a
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.UpdateBGMap: ; 90e00 (24:4e00)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hCGB]
|
|
|
|
|
and a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr z, .dmg
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, $2
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
ld c, 3
|
|
|
|
|
call DelayFrames
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.dmg
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call WaitBGMap
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 90e12 (24:4e12)
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.Jumptable: ; 90e12
|
|
|
|
|
dw .Clock
|
|
|
|
|
dw .Map
|
|
|
|
|
dw .Phone
|
|
|
|
|
dw .Radio
|
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 90e1a
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.Clock: ; 90e1a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld de, ClockTilemapRLE
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call Pokegear_LoadTilemapRLE
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 12, 1
|
|
|
|
|
ld de, .switch
|
|
|
|
|
call PlaceString
|
|
|
|
|
hlcoord 0, 12
|
|
|
|
|
lb bc, 4, 18
|
|
|
|
|
call TextBox
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call Pokegear_UpdateClock
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 90e36 (24:4e36)
|
|
|
|
|
|
|
|
|
|
.switch
|
|
|
|
|
db " SWITCH▶@"
|
|
|
|
|
; 90e3f
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.Map: ; 90e3f
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld a, [wPokegearMapPlayerIconLandmark]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
cp FAST_SHIP
|
|
|
|
|
jr z, .johto
|
|
|
|
|
cp KANTO_LANDMARK
|
|
|
|
|
jr nc, .kanto
|
|
|
|
|
.johto
|
|
|
|
|
ld e, 0
|
|
|
|
|
jr .ok
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
.kanto
|
|
|
|
|
ld e, 1
|
|
|
|
|
.ok
|
2015-11-18 23:35:44 +00:00
|
|
|
|
callba PokegearMap
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, $7
|
|
|
|
|
ld bc, $12
|
|
|
|
|
hlcoord 1, 2
|
|
|
|
|
call ByteFill
|
|
|
|
|
hlcoord 0, 2
|
|
|
|
|
ld [hl], $6
|
|
|
|
|
hlcoord 19, 2
|
|
|
|
|
ld [hl], $17
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld a, [wPokegearMapCursorLandmark]
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call PokegearMap_UpdateLandmarkName
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 90e72
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.Radio: ; 90e72
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld de, RadioTilemapRLE
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call Pokegear_LoadTilemapRLE
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 0, 12
|
|
|
|
|
lb bc, 4, 18
|
|
|
|
|
call TextBox
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 90e82
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.Phone: ; 90e82
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld de, PhoneTilemapRLE
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call Pokegear_LoadTilemapRLE
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 0, 12
|
|
|
|
|
lb bc, 4, 18
|
|
|
|
|
call TextBox
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call .PlacePhoneBars
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call PokegearPhone_UpdateDisplayList
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 90e98
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.PlacePhoneBars: ; 90e98 (24:4e98)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 17, 1
|
|
|
|
|
ld a, $3c
|
|
|
|
|
ld [hli], a
|
|
|
|
|
inc a
|
|
|
|
|
ld [hl], a
|
|
|
|
|
hlcoord 17, 2
|
|
|
|
|
inc a
|
|
|
|
|
ld [hli], a
|
|
|
|
|
call GetMapHeaderPhoneServiceNybble
|
|
|
|
|
and a
|
|
|
|
|
ret nz
|
|
|
|
|
hlcoord 18, 2
|
|
|
|
|
ld [hl], $3f
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
Pokegear_FinishTilemap: ; 90eb0 (24:4eb0)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 0, 0
|
|
|
|
|
ld bc, $8
|
|
|
|
|
ld a, $4f
|
|
|
|
|
call ByteFill
|
|
|
|
|
hlcoord 0, 1
|
|
|
|
|
ld bc, $8
|
|
|
|
|
ld a, $4f
|
|
|
|
|
call ByteFill
|
|
|
|
|
ld de, wPokegearFlags
|
|
|
|
|
ld a, [de]
|
|
|
|
|
bit 0, a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call nz, .PlaceMapIcon
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [de]
|
|
|
|
|
bit 2, a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call nz, .PlacePhoneIcon
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [de]
|
|
|
|
|
bit 1, a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call nz, .PlaceRadioIcon
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 0, 0
|
|
|
|
|
ld a, $46
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call .PlacePokegearCardIcon
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.PlaceMapIcon: ; 90ee4 (24:4ee4)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 2, 0
|
|
|
|
|
ld a, $40
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr .PlacePokegearCardIcon
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.PlacePhoneIcon: ; 90eeb (24:4eeb)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 4, 0
|
|
|
|
|
ld a, $44
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr .PlacePokegearCardIcon
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.PlaceRadioIcon: ; 90ef2 (24:4ef2)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 6, 0
|
|
|
|
|
ld a, $42
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.PlacePokegearCardIcon: ; 90ef7 (24:4ef7)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [hli], a
|
|
|
|
|
inc a
|
|
|
|
|
ld [hld], a
|
|
|
|
|
ld bc, $14
|
|
|
|
|
add hl, bc
|
|
|
|
|
add $f
|
|
|
|
|
ld [hli], a
|
|
|
|
|
inc a
|
|
|
|
|
ld [hld], a
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearJumptable: ; 90f04 (24:4f04)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
|
ld e, a
|
|
|
|
|
ld d, 0
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld hl, .Jumptable
|
|
|
|
|
add hl, de
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, de
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
ld h, [hl]
|
|
|
|
|
ld l, a
|
|
|
|
|
jp [hl]
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.Jumptable: ; 90f13 (24:4f13)
|
|
|
|
|
dw PokegearClock_Init
|
|
|
|
|
dw PokegearClock_Joypad
|
|
|
|
|
dw PokegearMap_CheckRegion
|
|
|
|
|
dw PokegearMap_Init
|
|
|
|
|
dw PokegearMap_JohtoMap
|
|
|
|
|
dw PokegearMap_Init
|
|
|
|
|
dw PokegearMap_KantoMap
|
|
|
|
|
dw PokegearPhone_Init
|
|
|
|
|
dw PokegearPhone_Joypad
|
|
|
|
|
dw PokegearPhone_MakePhoneCall
|
|
|
|
|
dw PokegearPhone_FinishPhoneCall
|
|
|
|
|
dw PokegearRadio_Init
|
|
|
|
|
dw PokegearRadio_Joypad
|
|
|
|
|
|
|
|
|
|
PokegearClock_Init: ; 90f2d (24:4f2d)
|
|
|
|
|
call InitPokegearTilemap
|
|
|
|
|
ld hl, PokegearText_PressAnyButtonToExit
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call PrintText
|
|
|
|
|
ld hl, wJumptableIndex
|
|
|
|
|
inc [hl]
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call ExitPokegearRadio_HandleMusic
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearClock_Joypad: ; 90f3e (24:4f3e)
|
|
|
|
|
call .UpdateClock
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, hJoyLast
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and A_BUTTON + B_BUTTON + START + SELECT
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr nz, .quit
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_RIGHT
|
|
|
|
|
ret z
|
|
|
|
|
ld a, [wPokegearFlags]
|
|
|
|
|
bit 0, a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr z, .no_map_card
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld c, $2
|
|
|
|
|
ld b, $1
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr .done
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.no_map_card
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [wPokegearFlags]
|
|
|
|
|
bit 2, a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr z, .no_phone_card
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld c, $7
|
|
|
|
|
ld b, $2
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr .done
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.no_phone_card
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [wPokegearFlags]
|
|
|
|
|
bit 1, a
|
|
|
|
|
ret z
|
|
|
|
|
ld c, $b
|
|
|
|
|
ld b, $3
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.done
|
|
|
|
|
call Pokegear_SwitchPage
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.quit
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, wJumptableIndex
|
|
|
|
|
set 7, [hl]
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.UpdateClock: ; 90f7b (24:4f7b)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call Pokegear_UpdateClock
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, $1
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
Pokegear_UpdateClock: ; 90f86 (24:4f86)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 3, 5
|
|
|
|
|
lb bc, 5, 14
|
|
|
|
|
call ClearBox
|
|
|
|
|
ld a, [hHours]
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [hMinutes]
|
|
|
|
|
ld c, a
|
|
|
|
|
decoord 6, 8
|
|
|
|
|
callba PrintHoursMins
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld hl, .DayText
|
2015-11-17 02:07:26 +00:00
|
|
|
|
bccoord 6, 6
|
2016-05-08 18:11:24 +00:00
|
|
|
|
call PlaceHLTextAtBC
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
; 90fa8 (24:4fa8)
|
|
|
|
|
db "ごぜん@"
|
|
|
|
|
db "ごご@"
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.DayText: ; 0x90faf
|
2015-11-17 02:07:26 +00:00
|
|
|
|
text_jump UnknownText_0x1c5821
|
|
|
|
|
db "@"
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 0x90fb4
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearMap_CheckRegion: ; 90fb4 (24:4fb4)
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld a, [wPokegearMapPlayerIconLandmark]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
cp FAST_SHIP
|
|
|
|
|
jr z, .johto
|
|
|
|
|
cp KANTO_LANDMARK
|
|
|
|
|
jr nc, .kanto
|
|
|
|
|
.johto
|
|
|
|
|
ld a, 3
|
|
|
|
|
jr .done
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.kanto
|
|
|
|
|
ld a, 5
|
|
|
|
|
.done
|
|
|
|
|
ld [wJumptableIndex], a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call ExitPokegearRadio_HandleMusic
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearMap_Init: ; 90fcd (24:4fcd)
|
|
|
|
|
call InitPokegearTilemap
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld a, [wPokegearMapPlayerIconLandmark]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call PokegearMap_InitPlayerIcon
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld a, [wPokegearMapCursorLandmark]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call PokegearMap_InitCursor
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, c
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearMapCursorObjectPointer], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, b
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearMapCursorObjectPointer + 1], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, wJumptableIndex
|
|
|
|
|
inc [hl]
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearMap_KantoMap: ; 90fe9 (24:4fe9)
|
2016-01-05 13:46:37 +00:00
|
|
|
|
call TownMap_GetKantoLandmarkLimits
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr PokegearMap_ContinueMap
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearMap_JohtoMap: ; 90fee (24:4fee)
|
|
|
|
|
ld d, SILVER_CAVE
|
|
|
|
|
ld e, NEW_BARK_TOWN
|
|
|
|
|
PokegearMap_ContinueMap: ; 90ff2 (24:4ff2)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, hJoyLast
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and B_BUTTON
|
|
|
|
|
jr nz, .cancel
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_RIGHT
|
|
|
|
|
jr nz, .right
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_LEFT
|
|
|
|
|
jr nz, .left
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call .DPad
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.right
|
|
|
|
|
ld a, [wPokegearFlags]
|
|
|
|
|
bit 2, a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr z, .no_phone
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld c, $7
|
|
|
|
|
ld b, $2
|
|
|
|
|
jr .done
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.no_phone
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [wPokegearFlags]
|
|
|
|
|
bit 1, a
|
|
|
|
|
ret z
|
|
|
|
|
ld c, $b
|
|
|
|
|
ld b, $3
|
|
|
|
|
jr .done
|
|
|
|
|
|
|
|
|
|
.left
|
|
|
|
|
ld c, $0
|
|
|
|
|
ld b, $0
|
|
|
|
|
.done
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call Pokegear_SwitchPage
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
.cancel
|
|
|
|
|
ld hl, wJumptableIndex
|
|
|
|
|
set 7, [hl]
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.DPad: ; 9102f (24:502f)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, hJoyLast
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_UP
|
|
|
|
|
jr nz, .up
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_DOWN
|
|
|
|
|
jr nz, .down
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
.up
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld hl, wPokegearMapCursorLandmark
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
cp d
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr c, .wrap_around_up
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, e
|
|
|
|
|
dec a
|
|
|
|
|
ld [hl], a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.wrap_around_up
|
2015-11-17 02:07:26 +00:00
|
|
|
|
inc [hl]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr .done_dpad
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
|
|
|
|
.down
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld hl, wPokegearMapCursorLandmark
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
cp e
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr nz, .wrap_around_down
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, d
|
|
|
|
|
inc a
|
|
|
|
|
ld [hl], a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.wrap_around_down
|
2015-11-17 02:07:26 +00:00
|
|
|
|
dec [hl]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.done_dpad
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld a, [wPokegearMapCursorLandmark]
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call PokegearMap_UpdateLandmarkName
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearMapCursorObjectPointer]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld c, a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearMapCursorObjectPointer + 1]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld b, a
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld a, [wPokegearMapCursorLandmark]
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call PokegearMap_UpdateCursorPosition
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearMap_InitPlayerIcon: ; 9106a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
push af
|
2015-12-09 16:38:40 +00:00
|
|
|
|
depixel 0, 0
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld b, SPRITE_ANIM_INDEX_RED_WALK
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [PlayerGender]
|
|
|
|
|
bit 0, a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr z, .got_gender
|
|
|
|
|
ld b, SPRITE_ANIM_INDEX_BLUE_WALK
|
|
|
|
|
.got_gender
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, b
|
|
|
|
|
call _InitSpriteAnimStruct
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_TILE_ID
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], $10
|
|
|
|
|
pop af
|
|
|
|
|
ld e, a
|
|
|
|
|
push bc
|
|
|
|
|
callba GetLandmarkCoords
|
|
|
|
|
pop bc
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], e
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], d
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91098
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearMap_InitCursor: ; 91098
|
2015-11-17 02:07:26 +00:00
|
|
|
|
push af
|
2015-12-09 16:38:40 +00:00
|
|
|
|
depixel 0, 0
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, SPRITE_ANIM_INDEX_0D
|
|
|
|
|
call _InitSpriteAnimStruct
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_TILE_ID
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], $4
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
2015-12-19 01:07:09 +00:00
|
|
|
|
ld [hl], SPRITE_ANIM_SEQ_NULL
|
2015-11-17 02:07:26 +00:00
|
|
|
|
pop af
|
|
|
|
|
push bc
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call PokegearMap_UpdateCursorPosition
|
2015-11-17 02:07:26 +00:00
|
|
|
|
pop bc
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 910b4
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
PokegearMap_UpdateLandmarkName: ; 910b4
|
2015-11-17 02:07:26 +00:00
|
|
|
|
push af
|
|
|
|
|
hlcoord 8, 0
|
|
|
|
|
lb bc, 2, 12
|
|
|
|
|
call ClearBox
|
|
|
|
|
pop af
|
|
|
|
|
ld e, a
|
|
|
|
|
push de
|
|
|
|
|
callba GetLandmarkName
|
|
|
|
|
pop de
|
2016-05-08 18:11:24 +00:00
|
|
|
|
callba TownMap_ConvertLineBreakCharacters
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 8, 0
|
|
|
|
|
ld [hl], $34
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 910d4
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
PokegearMap_UpdateCursorPosition: ; 910d4
|
2015-11-17 02:07:26 +00:00
|
|
|
|
push bc
|
|
|
|
|
ld e, a
|
|
|
|
|
callba GetLandmarkCoords
|
|
|
|
|
pop bc
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], e
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], d
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 910e8
|
|
|
|
|
|
2016-01-05 13:46:37 +00:00
|
|
|
|
TownMap_GetKantoLandmarkLimits: ; 910e8
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [StatusFlags]
|
|
|
|
|
bit 6, a
|
2016-01-05 13:46:37 +00:00
|
|
|
|
jr z, .not_hof
|
|
|
|
|
ld d, ROUTE_28
|
|
|
|
|
ld e, PALLET_TOWN
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-01-05 13:46:37 +00:00
|
|
|
|
.not_hof
|
|
|
|
|
ld d, ROUTE_28
|
|
|
|
|
ld e, VICTORY_ROAD
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
; 910f9
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearRadio_Init: ; 910f9 (24:50f9)
|
|
|
|
|
call InitPokegearTilemap
|
2015-11-18 18:01:55 +00:00
|
|
|
|
depixel 4, 10, 4, 4
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, SPRITE_ANIM_INDEX_14
|
|
|
|
|
call _InitSpriteAnimStruct
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_TILE_ID
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], $8
|
|
|
|
|
call _UpdateRadioStation
|
|
|
|
|
ld hl, wJumptableIndex
|
|
|
|
|
inc [hl]
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearRadio_Joypad: ; 91112 (24:5112)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, hJoyLast
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and B_BUTTON
|
|
|
|
|
jr nz, .cancel
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_LEFT
|
|
|
|
|
jr nz, .left
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearRadioChannelAddr]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld l, a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearRadioChannelAddr + 1]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld h, a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearRadioChannelBank]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
and a
|
|
|
|
|
ret z
|
|
|
|
|
rst FarCall
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.left
|
|
|
|
|
ld a, [wPokegearFlags]
|
|
|
|
|
bit 2, a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr z, .no_phone
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld c, $7
|
|
|
|
|
ld b, $2
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr .switch_page
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.no_phone
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [wPokegearFlags]
|
|
|
|
|
bit 0, a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr z, .no_map
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld c, $2
|
|
|
|
|
ld b, $1
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr .switch_page
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.no_map
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld c, $0
|
|
|
|
|
ld b, $0
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.switch_page
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call Pokegear_SwitchPage
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.cancel
|
|
|
|
|
ld hl, wJumptableIndex
|
|
|
|
|
set 7, [hl]
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearPhone_Init: ; 91156 (24:5156)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, wJumptableIndex
|
|
|
|
|
inc [hl]
|
|
|
|
|
xor a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearPhoneScrollPosition], a
|
|
|
|
|
ld [wPokegearPhoneCursorPosition], a
|
|
|
|
|
ld [wPokegearPhoneSelectedPerson], a
|
|
|
|
|
call InitPokegearTilemap
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call ExitPokegearRadio_HandleMusic
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld hl, PokegearText_WhomToCall
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call PrintText
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearPhone_Joypad: ; 91171 (24:5171)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, hJoyPressed
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and B_BUTTON
|
|
|
|
|
jr nz, .b
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and A_BUTTON
|
|
|
|
|
jr nz, .a
|
|
|
|
|
ld hl, hJoyLast
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_LEFT
|
|
|
|
|
jr nz, .left
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_RIGHT
|
|
|
|
|
jr nz, .right
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call PokegearPhone_GetDPad
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.left
|
|
|
|
|
ld a, [wPokegearFlags]
|
|
|
|
|
bit 0, a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr z, .no_map
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld c, $2
|
|
|
|
|
ld b, $1
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr .switch_page
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.no_map
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld c, $0
|
|
|
|
|
ld b, $0
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr .switch_page
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
|
|
|
|
.right
|
|
|
|
|
ld a, [wPokegearFlags]
|
|
|
|
|
bit 1, a
|
|
|
|
|
ret z
|
|
|
|
|
ld c, $b
|
|
|
|
|
ld b, $3
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.switch_page
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call Pokegear_SwitchPage
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.b
|
|
|
|
|
ld hl, wJumptableIndex
|
|
|
|
|
set 7, [hl]
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.a
|
|
|
|
|
ld hl, wPhoneList
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearPhoneScrollPosition]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld e, a
|
|
|
|
|
ld d, 0
|
|
|
|
|
add hl, de
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearPhoneCursorPosition]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld e, a
|
|
|
|
|
ld d, 0
|
|
|
|
|
add hl, de
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and a
|
|
|
|
|
ret z
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearPhoneSelectedPerson], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 1, 4
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearPhoneCursorPosition]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld bc, 20 * 2
|
|
|
|
|
call AddNTimes
|
|
|
|
|
ld [hl], "▷"
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call PokegearPhoneContactSubmenu
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr c, .quit_submenu
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, wJumptableIndex
|
|
|
|
|
inc [hl]
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.quit_submenu
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, $8
|
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearPhone_MakePhoneCall: ; 911eb (24:51eb)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call GetMapHeaderPhoneServiceNybble
|
|
|
|
|
and a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr nz, .no_service
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, Options
|
|
|
|
|
res NO_TEXT_SCROLL, [hl]
|
|
|
|
|
xor a
|
|
|
|
|
ld [hInMenu], a
|
|
|
|
|
ld de, SFX_CALL
|
|
|
|
|
call PlaySFX
|
2016-01-10 22:44:09 +00:00
|
|
|
|
ld hl, .dotdotdot
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call PrintText
|
|
|
|
|
call WaitSFX
|
|
|
|
|
ld de, SFX_CALL
|
|
|
|
|
call PlaySFX
|
2016-01-10 22:44:09 +00:00
|
|
|
|
ld hl, .dotdotdot
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call PrintText
|
|
|
|
|
call WaitSFX
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearPhoneSelectedPerson]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld b, a
|
|
|
|
|
call Function90199
|
|
|
|
|
ld c, 10
|
|
|
|
|
call DelayFrames
|
|
|
|
|
ld hl, Options
|
|
|
|
|
set NO_TEXT_SCROLL, [hl]
|
|
|
|
|
ld a, $1
|
|
|
|
|
ld [hInMenu], a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call PokegearPhone_UpdateCursor
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, wJumptableIndex
|
|
|
|
|
inc [hl]
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.no_service
|
2015-11-17 02:07:26 +00:00
|
|
|
|
callba Phone_NoSignal
|
2016-01-10 22:44:09 +00:00
|
|
|
|
ld hl, .OutOfServiceArea
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call PrintText
|
|
|
|
|
ld a, $8
|
|
|
|
|
ld [wJumptableIndex], a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld hl, PokegearText_WhomToCall
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call PrintText
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 9124c (24:524c)
|
|
|
|
|
|
2016-04-10 19:01:49 +00:00
|
|
|
|
.dotdotdot ; 0x9124c
|
2015-11-17 02:07:26 +00:00
|
|
|
|
;
|
|
|
|
|
text_jump UnknownText_0x1c5824
|
|
|
|
|
db "@"
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 0x91251
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.OutOfServiceArea: ; 0x91251
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; You're out of the service area.
|
|
|
|
|
text_jump UnknownText_0x1c5827
|
|
|
|
|
db "@"
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 0x91256
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearPhone_FinishPhoneCall: ; 91256 (24:5256)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hJoyPressed]
|
|
|
|
|
and A_BUTTON | B_BUTTON
|
|
|
|
|
ret z
|
|
|
|
|
callba HangUp
|
|
|
|
|
ld a, $8
|
|
|
|
|
ld [wJumptableIndex], a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld hl, PokegearText_WhomToCall
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call PrintText
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearPhone_GetDPad: ; 9126d (24:526d)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, hJoyLast
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_UP
|
|
|
|
|
jr nz, .up
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_DOWN
|
|
|
|
|
jr nz, .down
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.up
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld hl, wPokegearPhoneCursorPosition
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
and a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr z, .scroll_page_up
|
2015-11-17 02:07:26 +00:00
|
|
|
|
dec [hl]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr .done_joypad_same_page
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.scroll_page_up
|
|
|
|
|
ld hl, wPokegearPhoneScrollPosition
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
and a
|
|
|
|
|
ret z
|
|
|
|
|
dec [hl]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr .done_joypad_update_page
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
|
|
|
|
.down
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld hl, wPokegearPhoneCursorPosition
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
cp $3
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr nc, .scroll_page_down
|
2015-11-17 02:07:26 +00:00
|
|
|
|
inc [hl]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr .done_joypad_same_page
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.scroll_page_down
|
|
|
|
|
ld hl, wPokegearPhoneScrollPosition
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
cp $6
|
|
|
|
|
ret nc
|
|
|
|
|
inc [hl]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr .done_joypad_update_page
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.done_joypad_same_page
|
2015-11-17 02:07:26 +00:00
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call PokegearPhone_UpdateCursor
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call WaitBGMap
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.done_joypad_update_page
|
2015-11-17 02:07:26 +00:00
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call PokegearPhone_UpdateDisplayList
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call WaitBGMap
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearPhone_UpdateCursor: ; 912b7 (24:52b7)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, " "
|
|
|
|
|
hlcoord 1, 4
|
|
|
|
|
ld [hl], a
|
|
|
|
|
hlcoord 1, 6
|
|
|
|
|
ld [hl], a
|
|
|
|
|
hlcoord 1, 8
|
|
|
|
|
ld [hl], a
|
|
|
|
|
hlcoord 1, 10
|
|
|
|
|
ld [hl], a
|
|
|
|
|
hlcoord 1, 4
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearPhoneCursorPosition]
|
|
|
|
|
ld bc, 2 * SCREEN_WIDTH
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call AddNTimes
|
|
|
|
|
ld [hl], "▶"
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearPhone_UpdateDisplayList: ; 912d8 (24:52d8)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 1, 3
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld b, 9
|
|
|
|
|
ld a, " "
|
|
|
|
|
.row
|
|
|
|
|
ld c, 18
|
|
|
|
|
.col
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [hli], a
|
|
|
|
|
dec c
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr nz, .col
|
|
|
|
|
inc hl
|
2015-11-17 02:07:26 +00:00
|
|
|
|
inc hl
|
|
|
|
|
dec b
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr nz, .row
|
|
|
|
|
ld a, [wPokegearPhoneScrollPosition]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld e, a
|
|
|
|
|
ld d, $0
|
|
|
|
|
ld hl, wPhoneList
|
|
|
|
|
add hl, de
|
|
|
|
|
xor a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearPhoneLoadNameBuffer], a
|
|
|
|
|
.loop
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hli]
|
|
|
|
|
push hl
|
|
|
|
|
push af
|
|
|
|
|
hlcoord 2, 4
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearPhoneLoadNameBuffer]
|
|
|
|
|
ld bc, 2 * SCREEN_WIDTH
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call AddNTimes
|
|
|
|
|
ld d, h
|
|
|
|
|
ld e, l
|
|
|
|
|
pop af
|
|
|
|
|
ld b, a
|
|
|
|
|
call Function90380
|
|
|
|
|
pop hl
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearPhoneLoadNameBuffer]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
inc a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearPhoneLoadNameBuffer], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
cp $4
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr c, .loop
|
|
|
|
|
call PokegearPhone_UpdateCursor
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 9131e (24:531e)
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearPhone_DeletePhoneNumber: ; 9131e
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, wPhoneList
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearPhoneScrollPosition]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld e, a
|
|
|
|
|
ld d, 0
|
|
|
|
|
add hl, de
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearPhoneCursorPosition]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld e, a
|
|
|
|
|
ld d, 0
|
|
|
|
|
add hl, de
|
|
|
|
|
ld [hl], 0
|
|
|
|
|
ld hl, wPhoneList
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld c, CONTACT_LIST_SIZE
|
|
|
|
|
.loop
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hli]
|
|
|
|
|
and a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr nz, .skip
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hld]
|
|
|
|
|
ld [hli], a
|
|
|
|
|
ld [hl], 0
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.skip
|
2015-11-17 02:07:26 +00:00
|
|
|
|
dec c
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr nz, .loop
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91342
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearPhoneContactSubmenu: ; 91342 (24:5342)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, wPhoneList
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearPhoneScrollPosition]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld e, a
|
|
|
|
|
ld d, 0
|
|
|
|
|
add hl, de
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearPhoneCursorPosition]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld e, a
|
|
|
|
|
ld d, 0
|
|
|
|
|
add hl, de
|
|
|
|
|
ld c, [hl]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
callba CheckCanDeletePhoneNumber
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, c
|
|
|
|
|
and a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr z, .cant_delete
|
|
|
|
|
ld hl, .CallDeleteCancelJumptable
|
|
|
|
|
ld de, .CallDeleteCancelStrings
|
|
|
|
|
jr .got_menu_data
|
|
|
|
|
|
|
|
|
|
.cant_delete
|
|
|
|
|
ld hl, .CallCancelJumptable
|
|
|
|
|
ld de, .CallCancelStrings
|
|
|
|
|
.got_menu_data
|
2015-11-17 02:07:26 +00:00
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
push hl
|
|
|
|
|
push de
|
|
|
|
|
ld a, [de]
|
|
|
|
|
ld l, a
|
|
|
|
|
inc de
|
|
|
|
|
ld a, [de]
|
|
|
|
|
ld h, a
|
|
|
|
|
inc de
|
|
|
|
|
push hl
|
|
|
|
|
ld bc, hBGMapAddress + 1
|
|
|
|
|
add hl, bc
|
|
|
|
|
ld a, [de]
|
|
|
|
|
inc de
|
|
|
|
|
sla a
|
|
|
|
|
ld b, a
|
|
|
|
|
ld c, 8
|
|
|
|
|
push de
|
|
|
|
|
call TextBox
|
|
|
|
|
pop de
|
|
|
|
|
pop hl
|
|
|
|
|
inc hl
|
|
|
|
|
call PlaceString
|
|
|
|
|
pop de
|
|
|
|
|
xor a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearPhoneSubmenuCursor], a
|
|
|
|
|
call .UpdateCursor
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call WaitBGMap
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.loop
|
2015-11-17 02:07:26 +00:00
|
|
|
|
push de
|
|
|
|
|
call JoyTextDelay
|
|
|
|
|
pop de
|
|
|
|
|
ld hl, hJoyPressed
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_UP
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr nz, .d_up
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_DOWN
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr nz, .d_down
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
and A_BUTTON | B_BUTTON
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr nz, .a_b
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call DelayFrame
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr .loop
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.d_up
|
|
|
|
|
ld hl, wPokegearPhoneSubmenuCursor
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
and a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr z, .loop
|
2015-11-17 02:07:26 +00:00
|
|
|
|
dec [hl]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call .UpdateCursor
|
|
|
|
|
jr .loop
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.d_down
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, 2
|
|
|
|
|
add hl, de
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearPhoneSubmenuCursor]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
inc a
|
|
|
|
|
cp [hl]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr nc, .loop
|
|
|
|
|
ld [wPokegearPhoneSubmenuCursor], a
|
|
|
|
|
call .UpdateCursor
|
|
|
|
|
jr .loop
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.a_b
|
2015-11-17 02:07:26 +00:00
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call PokegearPhone_UpdateDisplayList
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, $1
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
pop hl
|
|
|
|
|
ld a, [hJoyPressed]
|
|
|
|
|
and B_BUTTON
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr nz, .Cancel
|
|
|
|
|
ld a, [wPokegearPhoneSubmenuCursor]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld e, a
|
|
|
|
|
ld d, 0
|
|
|
|
|
add hl, de
|
2016-01-10 04:41:03 +00:00
|
|
|
|
add hl, de
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hli]
|
|
|
|
|
ld h, [hl]
|
|
|
|
|
ld l, a
|
|
|
|
|
jp [hl]
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.Cancel: ; 913f1
|
|
|
|
|
ld hl, PokegearText_WhomToCall
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call PrintText
|
|
|
|
|
scf
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 913f9 (24:53f9)
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.Delete: ; 913f9
|
|
|
|
|
ld hl, PokegearText_DeleteStoredNumber
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call MenuTextBox
|
|
|
|
|
call YesNoBox
|
|
|
|
|
call ExitMenu
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr c, .CancelDelete
|
|
|
|
|
call PokegearPhone_DeletePhoneNumber
|
2015-11-17 02:07:26 +00:00
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
call PokegearPhone_UpdateDisplayList
|
|
|
|
|
ld hl, PokegearText_WhomToCall
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call PrintText
|
|
|
|
|
call WaitBGMap
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.CancelDelete:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
scf
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 9141b
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.Call: ; 9141b
|
2015-11-17 02:07:26 +00:00
|
|
|
|
and a
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 9141d
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.UpdateCursor: ; 9141d (24:541d)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
push de
|
|
|
|
|
ld a, [de]
|
|
|
|
|
inc de
|
|
|
|
|
ld l, a
|
|
|
|
|
ld a, [de]
|
|
|
|
|
inc de
|
|
|
|
|
ld h, a
|
|
|
|
|
ld a, [de]
|
|
|
|
|
ld c, a
|
|
|
|
|
push hl
|
|
|
|
|
ld a, " "
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld de, SCREEN_WIDTH * 2
|
|
|
|
|
.clear_column
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [hl], a
|
|
|
|
|
add hl, de
|
|
|
|
|
dec c
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr nz, .clear_column
|
2015-11-17 02:07:26 +00:00
|
|
|
|
pop hl
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearPhoneSubmenuCursor]
|
|
|
|
|
ld bc, SCREEN_WIDTH * 2
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call AddNTimes
|
|
|
|
|
ld [hl], "▶"
|
|
|
|
|
pop de
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 9143f (24:543f)
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.CallDeleteCancelStrings: ; 9143f
|
2015-11-17 02:07:26 +00:00
|
|
|
|
dwcoord 10, 6
|
|
|
|
|
db 3
|
|
|
|
|
db "CALL"
|
|
|
|
|
next "DELETE"
|
|
|
|
|
next "CANCEL"
|
|
|
|
|
db "@"
|
|
|
|
|
; 91455
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.CallDeleteCancelJumptable: ; 91455
|
|
|
|
|
dw .Call
|
|
|
|
|
dw .Delete
|
|
|
|
|
dw .Cancel
|
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 9145b
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.CallCancelStrings: ; 9145b
|
2015-11-17 02:07:26 +00:00
|
|
|
|
dwcoord 10, 8
|
|
|
|
|
db 2
|
|
|
|
|
db "CALL"
|
|
|
|
|
next "CANCEL"
|
|
|
|
|
db "@"
|
|
|
|
|
; 9146a
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.CallCancelJumptable: ; 9146a
|
|
|
|
|
dw .Call
|
|
|
|
|
dw .Cancel
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
; 9146e
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
; XXX
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hHours]
|
|
|
|
|
cp 12
|
2016-01-10 04:41:03 +00:00
|
|
|
|
jr c, .am
|
2015-11-17 02:07:26 +00:00
|
|
|
|
sub 12
|
|
|
|
|
ld [wd265], a
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
.am
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [wd265], a
|
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
; 91480
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
Pokegear_SwitchPage: ; 91480 (24:5480)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
|
call PlaySFX
|
|
|
|
|
ld a, c
|
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
|
ld a, b
|
|
|
|
|
ld [wcf64], a
|
|
|
|
|
call DeleteSpriteAnimStruct2ToEnd
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
ExitPokegearRadio_HandleMusic: ; 91492
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearRadioMusicPlaying]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
cp $fe
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr z, .restart_map_music
|
2015-11-17 02:07:26 +00:00
|
|
|
|
cp $ff
|
|
|
|
|
call z, EnterMapMusic
|
|
|
|
|
xor a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearRadioMusicPlaying], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.restart_map_music
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call RestartMapMusic
|
|
|
|
|
xor a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearRadioMusicPlaying], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
; 914ab
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
|
|
|
|
DeleteSpriteAnimStruct2ToEnd: ; 914ab (24:54ab)
|
|
|
|
|
ld hl, SpriteAnim2
|
|
|
|
|
ld bc, wSpriteAnimationStructsEnd - SpriteAnim2
|
|
|
|
|
xor a
|
|
|
|
|
call ByteFill
|
|
|
|
|
ld a, 2
|
|
|
|
|
ld [wSpriteAnimCount], a
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
Pokegear_LoadTilemapRLE: ; 914bb (24:54bb)
|
2016-01-10 22:44:09 +00:00
|
|
|
|
; Format: repeat count, tile ID
|
|
|
|
|
; Terminated with $FF
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 0, 0
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.loop
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [de]
|
|
|
|
|
cp $ff
|
|
|
|
|
ret z
|
|
|
|
|
ld b, a
|
|
|
|
|
inc de
|
|
|
|
|
ld a, [de]
|
|
|
|
|
ld c, a
|
|
|
|
|
inc de
|
|
|
|
|
ld a, b
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.load
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [hli], a
|
|
|
|
|
dec c
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr nz, .load
|
|
|
|
|
jr .loop
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 914ce (24:54ce)
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearText_WhomToCall: ; 0x914ce
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; Whom do you want to call?
|
|
|
|
|
text_jump UnknownText_0x1c5847
|
|
|
|
|
db "@"
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 0x914d3
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearText_PressAnyButtonToExit: ; 0x914d3
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; Press any button to exit.
|
|
|
|
|
text_jump UnknownText_0x1c5862
|
|
|
|
|
db "@"
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 0x914d8
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
PokegearText_DeleteStoredNumber: ; 0x914d8
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; Delete this stored phone number?
|
|
|
|
|
text_jump UnknownText_0x1c587d
|
|
|
|
|
db "@"
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
; 0x914dd
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
|
|
|
|
PokegearSpritesGFX: ; 914dd
|
|
|
|
|
INCBIN "gfx/misc/pokegear_sprites.2bpp.lz"
|
|
|
|
|
; 9150d
|
|
|
|
|
|
|
|
|
|
RadioTilemapRLE: ; 9150d
|
2016-01-10 22:44:09 +00:00
|
|
|
|
INCBIN "gfx/pokegear/radio.tilemap.rle"
|
2015-11-17 02:07:26 +00:00
|
|
|
|
PhoneTilemapRLE: ; 9158a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
INCBIN "gfx/pokegear/phone.tilemap.rle"
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ClockTilemapRLE: ; 915db
|
2016-01-10 22:44:09 +00:00
|
|
|
|
INCBIN "gfx/pokegear/clock.tilemap.rle"
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 9163e
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
_UpdateRadioStation: ; 9163e (24:563e)
|
|
|
|
|
jr UpdateRadioStation
|
|
|
|
|
|
2015-12-04 13:46:11 +00:00
|
|
|
|
; called from engine/sprite_anims.asm
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-12-04 13:46:11 +00:00
|
|
|
|
AnimateTuningKnob: ; 91640 (24:5640)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
push bc
|
|
|
|
|
call .TuningKnob
|
|
|
|
|
pop bc
|
|
|
|
|
ld a, [wRadioTuningKnob]
|
2015-12-04 13:46:11 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XOFFSET
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], a
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.TuningKnob: ; 9164e (24:564e)
|
|
|
|
|
ld hl, hJoyLast
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_DOWN
|
|
|
|
|
jr nz, .down
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_UP
|
|
|
|
|
jr nz, .up
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.down
|
|
|
|
|
ld hl, wRadioTuningKnob
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and a
|
|
|
|
|
ret z
|
|
|
|
|
dec [hl]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
dec [hl]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
jr .update
|
|
|
|
|
|
|
|
|
|
.up
|
|
|
|
|
ld hl, wRadioTuningKnob
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
cp 80
|
|
|
|
|
ret nc
|
|
|
|
|
inc [hl]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
inc [hl]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
.update
|
|
|
|
|
UpdateRadioStation: ; 9166f (24:566f)
|
|
|
|
|
ld hl, wRadioTuningKnob
|
|
|
|
|
ld d, [hl]
|
|
|
|
|
ld hl, RadioChannels
|
|
|
|
|
.loop
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
cp -1
|
|
|
|
|
jr z, .nostation
|
|
|
|
|
cp d
|
|
|
|
|
jr z, .foundstation
|
|
|
|
|
inc hl
|
2016-01-10 04:41:03 +00:00
|
|
|
|
inc hl
|
2015-11-17 02:07:26 +00:00
|
|
|
|
jr .loop
|
|
|
|
|
|
|
|
|
|
.nostation
|
|
|
|
|
call NoRadioStation
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.foundstation
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
ld h, [hl]
|
|
|
|
|
ld l, a
|
|
|
|
|
ld de, .returnafterstation
|
|
|
|
|
push de
|
|
|
|
|
jp [hl]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
.returnafterstation
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearRadioChannelBank]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
and a
|
|
|
|
|
ret z
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
hlcoord 2, 9
|
|
|
|
|
call PlaceString
|
|
|
|
|
ld a, $1
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 916a1 (24:56a1)
|
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
; XXX
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearRadioChannelBank], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hli]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearRadioChannelAddr], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hli]
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearRadioChannelAddr + 1], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
; 916ad
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
|
|
|
|
RadioChannels:
|
|
|
|
|
; frequencies and the shows that play on them.
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; frequency value given here = 4 × ingame_frequency − 2
|
|
|
|
|
dbw 16, .PkmnTalkAndPokedexShow
|
|
|
|
|
dbw 28, .PokemonMusic
|
|
|
|
|
dbw 32, .LuckyChannel
|
|
|
|
|
dbw 40, .BuenasPassword
|
|
|
|
|
dbw 52, .RuinsOfAlphRadio
|
|
|
|
|
dbw 64, .PlacesAndPeople
|
|
|
|
|
dbw 72, .LetsAllSing
|
|
|
|
|
dbw 78, .PokeFluteRadio
|
|
|
|
|
dbw 80, .EvolutionRadio
|
2016-01-29 05:57:06 +00:00
|
|
|
|
db -1
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.PkmnTalkAndPokedexShow:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; Pokédex Show in the morning
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; Oak's Pokémon Talk in the afternoon and evening
|
|
|
|
|
call .InJohto
|
|
|
|
|
jr nc, .NoSignal
|
|
|
|
|
ld a, [TimeOfDay]
|
|
|
|
|
and a
|
|
|
|
|
jp z, LoadStation_PokedexShow
|
|
|
|
|
jp LoadStation_OaksPokemonTalk
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.PokemonMusic:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call .InJohto
|
|
|
|
|
jr nc, .NoSignal
|
|
|
|
|
jp LoadStation_PokemonMusic
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.LuckyChannel:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call .InJohto
|
|
|
|
|
jr nc, .NoSignal
|
|
|
|
|
jp LoadStation_LuckyChannel
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.BuenasPassword:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call .InJohto
|
|
|
|
|
jr nc, .NoSignal
|
|
|
|
|
jp LoadStation_BuenasPassword
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.RuinsOfAlphRadio:
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld a, [wPokegearMapPlayerIconLandmark]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
cp RUINS_OF_ALPH
|
|
|
|
|
jr nz, .NoSignal
|
|
|
|
|
jp LoadStation_UnownRadio
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.PlacesAndPeople:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call .InJohto
|
|
|
|
|
jr c, .NoSignal
|
|
|
|
|
ld a, [wPokegearFlags]
|
|
|
|
|
bit 3, a
|
|
|
|
|
jr z, .NoSignal
|
|
|
|
|
jp LoadStation_PlacesAndPeople
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.LetsAllSing:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call .InJohto
|
|
|
|
|
jr c, .NoSignal
|
|
|
|
|
ld a, [wPokegearFlags]
|
|
|
|
|
bit 3, a
|
|
|
|
|
jr z, .NoSignal
|
|
|
|
|
jp LoadStation_LetsAllSing
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.PokeFluteRadio:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call .InJohto
|
|
|
|
|
jr c, .NoSignal
|
|
|
|
|
ld a, [wPokegearFlags]
|
|
|
|
|
bit 3, a
|
|
|
|
|
jr z, .NoSignal
|
|
|
|
|
jp LoadStation_PokeFluteRadio
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.EvolutionRadio:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; This station airs in the Lake of Rage area when Rocket are still in Mahogany.
|
|
|
|
|
ld a, [StatusFlags]
|
|
|
|
|
bit 4, a
|
|
|
|
|
jr z, .NoSignal
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld a, [wPokegearMapPlayerIconLandmark]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
cp MAHOGANY_TOWN
|
|
|
|
|
jr z, .ok
|
|
|
|
|
cp ROUTE_43
|
|
|
|
|
jr z, .ok
|
|
|
|
|
cp LAKE_OF_RAGE
|
|
|
|
|
jr nz, .NoSignal
|
|
|
|
|
.ok
|
|
|
|
|
jp LoadStation_EvolutionRadio
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.NoSignal:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call NoRadioStation
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.InJohto:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; if in Johto or on the S.S. Aqua, set carry
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; otherwise clear carry
|
2016-01-12 17:46:18 +00:00
|
|
|
|
ld a, [wPokegearMapPlayerIconLandmark]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
cp FAST_SHIP
|
|
|
|
|
jr z, .johto
|
|
|
|
|
cp KANTO_LANDMARK
|
|
|
|
|
jr c, .johto
|
|
|
|
|
.kanto
|
|
|
|
|
and a
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
.johto
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
LoadStation_OaksPokemonTalk: ; 91753 (24:5753)
|
|
|
|
|
xor a ; OAKS_POKEMON_TALK
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
ld [wd005], a
|
|
|
|
|
ld a, BANK(PlayRadioShow)
|
|
|
|
|
ld hl, PlayRadioShow
|
|
|
|
|
call Radio_BackUpFarCallParams
|
|
|
|
|
ld de, OaksPkmnTalkName
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
LoadStation_PokedexShow: ; 91766 (24:5766)
|
|
|
|
|
ld a, POKEDEX_SHOW
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [wd005], a
|
|
|
|
|
ld a, BANK(PlayRadioShow)
|
|
|
|
|
ld hl, PlayRadioShow
|
|
|
|
|
call Radio_BackUpFarCallParams
|
|
|
|
|
ld de, PokedexShowName
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
LoadStation_PokemonMusic: ; 9177b (24:577b)
|
|
|
|
|
ld a, POKEMON_MUSIC
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [wd005], a
|
|
|
|
|
ld a, BANK(PlayRadioShow)
|
|
|
|
|
ld hl, PlayRadioShow
|
|
|
|
|
call Radio_BackUpFarCallParams
|
|
|
|
|
ld de, PokemonMusicName
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
LoadStation_LuckyChannel: ; 91790 (24:5790)
|
|
|
|
|
ld a, LUCKY_CHANNEL
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [wd005], a
|
|
|
|
|
ld a, BANK(PlayRadioShow)
|
|
|
|
|
ld hl, PlayRadioShow
|
|
|
|
|
call Radio_BackUpFarCallParams
|
|
|
|
|
ld de, LuckyChannelName
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
LoadStation_BuenasPassword: ; 917a5 (24:57a5)
|
|
|
|
|
ld a, BUENAS_PASSWORD
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [wd005], a
|
|
|
|
|
ld a, BANK(PlayRadioShow)
|
|
|
|
|
ld hl, PlayRadioShow
|
|
|
|
|
call Radio_BackUpFarCallParams
|
|
|
|
|
ld de, NotBuenasPasswordName
|
|
|
|
|
ld a, [StatusFlags2]
|
|
|
|
|
bit 0, a
|
|
|
|
|
ret z
|
|
|
|
|
ld de, BuenasPasswordName
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 917c3 (24:57c3)
|
|
|
|
|
|
|
|
|
|
BuenasPasswordName: db "BUENA'S PASSWORD@"
|
|
|
|
|
NotBuenasPasswordName: db "@"
|
|
|
|
|
|
|
|
|
|
LoadStation_UnownRadio: ; 917d5 (24:57d5)
|
|
|
|
|
ld a, UNOWN_RADIO
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [wd005], a
|
|
|
|
|
ld a, BANK(PlayRadioShow)
|
|
|
|
|
ld hl, PlayRadioShow
|
|
|
|
|
call Radio_BackUpFarCallParams
|
|
|
|
|
ld de, UnknownStationName
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
LoadStation_PlacesAndPeople: ; 917ea (24:57ea)
|
|
|
|
|
ld a, PLACES_AND_PEOPLE
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [wd005], a
|
|
|
|
|
ld a, BANK(PlayRadioShow)
|
|
|
|
|
ld hl, PlayRadioShow
|
|
|
|
|
call Radio_BackUpFarCallParams
|
|
|
|
|
ld de, PlacesAndPeopleName
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
LoadStation_LetsAllSing: ; 917ff (24:57ff)
|
|
|
|
|
ld a, LETS_ALL_SING
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [wd005], a
|
|
|
|
|
ld a, BANK(PlayRadioShow)
|
|
|
|
|
ld hl, PlayRadioShow
|
|
|
|
|
call Radio_BackUpFarCallParams
|
|
|
|
|
ld de, LetsAllSingName
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91814 (24:5814)
|
|
|
|
|
|
|
|
|
|
LoadStation_RocketRadio: ; 91814
|
|
|
|
|
ld a, ROCKET_RADIO
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [wd005], a
|
|
|
|
|
ld a, BANK(PlayRadioShow)
|
|
|
|
|
ld hl, PlayRadioShow
|
|
|
|
|
call Radio_BackUpFarCallParams
|
|
|
|
|
ld de, LetsAllSingName
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91829
|
|
|
|
|
|
|
|
|
|
LoadStation_PokeFluteRadio: ; 91829 (24:5829)
|
|
|
|
|
ld a, POKE_FLUTE_RADIO
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [wd005], a
|
|
|
|
|
ld a, BANK(PlayRadioShow)
|
|
|
|
|
ld hl, PlayRadioShow
|
|
|
|
|
call Radio_BackUpFarCallParams
|
|
|
|
|
ld de, PokeFluteStationName
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
LoadStation_EvolutionRadio: ; 9183e (24:583e)
|
|
|
|
|
ld a, EVOLUTION_RADIO
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [wd005], a
|
|
|
|
|
ld a, BANK(PlayRadioShow)
|
|
|
|
|
ld hl, PlayRadioShow
|
|
|
|
|
call Radio_BackUpFarCallParams
|
|
|
|
|
ld de, UnknownStationName
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91853 (24:5853)
|
|
|
|
|
|
|
|
|
|
LoadStation_Dummy: ; 91853
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
RadioMusicRestartDE: ; 91854 (24:5854)
|
|
|
|
|
push de
|
|
|
|
|
ld a, e
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearRadioMusicPlaying], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld de, MUSIC_NONE
|
|
|
|
|
call PlayMusic
|
|
|
|
|
pop de
|
|
|
|
|
ld a, e
|
|
|
|
|
ld [wMapMusic], a
|
|
|
|
|
call PlayMusic
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
RadioMusicRestartPokemonChannel: ; 91868 (24:5868)
|
|
|
|
|
push de
|
|
|
|
|
ld a, $fe
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearRadioMusicPlaying], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld de, MUSIC_NONE
|
|
|
|
|
call PlayMusic
|
|
|
|
|
pop de
|
|
|
|
|
ld de, MUSIC_POKEMON_CHANNEL
|
|
|
|
|
call PlayMusic
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Radio_BackUpFarCallParams: ; 9187c (24:587c)
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearRadioChannelBank], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, l
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearRadioChannelAddr], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, h
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearRadioChannelAddr + 1], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
NoRadioStation: ; 91888 (24:5888)
|
|
|
|
|
call NoRadioMusic
|
|
|
|
|
call NoRadioName
|
|
|
|
|
xor a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearRadioChannelBank], a
|
|
|
|
|
ld [wPokegearRadioChannelAddr], a
|
|
|
|
|
ld [wPokegearRadioChannelAddr + 1], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, $1
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
NoRadioMusic: ; 9189d (24:589d)
|
|
|
|
|
ld de, MUSIC_NONE
|
|
|
|
|
call PlayMusic
|
|
|
|
|
ld a, $ff
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wPokegearRadioMusicPlaying], a
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
NoRadioName: ; 918a9 (24:58a9)
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
hlcoord 1, 8
|
|
|
|
|
lb bc, 3, 18
|
|
|
|
|
call ClearBox
|
|
|
|
|
hlcoord 0, 12
|
|
|
|
|
ld bc, $412
|
|
|
|
|
call TextBox
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 918bf
|
|
|
|
|
|
|
|
|
|
OaksPkmnTalkName: db "OAK's <PK><MN> Talk@"
|
|
|
|
|
PokedexShowName: db "#DEX Show@"
|
|
|
|
|
PokemonMusicName: db "#MON Music@"
|
|
|
|
|
LuckyChannelName: db "Lucky Channel@"
|
|
|
|
|
UnknownStationName: db "?????@"
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
PlacesAndPeopleName: db "Places & People@"
|
|
|
|
|
LetsAllSingName: db "Let's All Sing!@"
|
|
|
|
|
PokeFluteStationName: db "# FLUTE@"
|
|
|
|
|
; 9191c
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
_TownMap: ; 9191c
|
|
|
|
|
ld hl, Options
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
push af
|
|
|
|
|
set NO_TEXT_SCROLL, [hl]
|
|
|
|
|
|
|
|
|
|
ld a, [hInMenu]
|
|
|
|
|
push af
|
|
|
|
|
ld a, $1
|
|
|
|
|
ld [hInMenu], a
|
|
|
|
|
|
|
|
|
|
ld a, [VramState]
|
|
|
|
|
push af
|
|
|
|
|
xor a
|
|
|
|
|
ld [VramState], a
|
|
|
|
|
|
|
|
|
|
call ClearBGPalettes
|
|
|
|
|
call ClearTileMap
|
|
|
|
|
call ClearSprites
|
|
|
|
|
call DisableLCD
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call Pokegear_LoadGFX
|
2016-01-10 04:41:03 +00:00
|
|
|
|
callba ClearSpriteAnims
|
|
|
|
|
ld a, 8
|
|
|
|
|
call SkipMusic
|
|
|
|
|
ld a, $e3
|
|
|
|
|
ld [rLCDC], a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call TownMap_GetCurrentLandmark
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld [wd002], a
|
|
|
|
|
ld [wd003], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
call .InitTilemap
|
|
|
|
|
call WaitBGMap2
|
|
|
|
|
ld a, [wd002]
|
|
|
|
|
call PokegearMap_InitPlayerIcon
|
|
|
|
|
ld a, [wd003]
|
|
|
|
|
call PokegearMap_InitCursor
|
|
|
|
|
ld a, c
|
|
|
|
|
ld [wd004], a
|
|
|
|
|
ld a, b
|
|
|
|
|
ld [wd005], a
|
|
|
|
|
ld b, SCGB_POKEGEAR_PALS
|
|
|
|
|
call GetSGBLayout
|
|
|
|
|
call SetPalettes
|
|
|
|
|
ld a, [hCGB]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .dmg
|
|
|
|
|
ld a, %11100100
|
|
|
|
|
call DmgToCgbObjPal0
|
|
|
|
|
call DelayFrame
|
|
|
|
|
|
|
|
|
|
.dmg
|
|
|
|
|
ld a, [wd002]
|
|
|
|
|
cp KANTO_LANDMARK
|
|
|
|
|
jr nc, .kanto
|
|
|
|
|
ld d, KANTO_LANDMARK - 1
|
|
|
|
|
ld e, 1
|
|
|
|
|
call .loop
|
|
|
|
|
jr .resume
|
|
|
|
|
|
|
|
|
|
.kanto
|
|
|
|
|
call TownMap_GetKantoLandmarkLimits
|
|
|
|
|
call .loop
|
|
|
|
|
|
|
|
|
|
.resume
|
|
|
|
|
pop af
|
|
|
|
|
ld [VramState], a
|
|
|
|
|
pop af
|
|
|
|
|
ld [hInMenu], a
|
|
|
|
|
pop af
|
|
|
|
|
ld [Options], a
|
|
|
|
|
call ClearBGPalettes
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.loop
|
|
|
|
|
call JoyTextDelay
|
|
|
|
|
ld hl, hJoyPressed
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and B_BUTTON
|
|
|
|
|
ret nz
|
|
|
|
|
|
|
|
|
|
ld hl, hJoyLast
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_UP
|
|
|
|
|
jr nz, .pressed_up
|
|
|
|
|
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_DOWN
|
|
|
|
|
jr nz, .pressed_down
|
|
|
|
|
.loop2
|
|
|
|
|
push de
|
|
|
|
|
callba PlaySpriteAnimations
|
|
|
|
|
pop de
|
|
|
|
|
call DelayFrame
|
|
|
|
|
jr .loop
|
|
|
|
|
|
|
|
|
|
.pressed_up
|
|
|
|
|
ld hl, wd003
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
cp d
|
|
|
|
|
jr c, .okay
|
|
|
|
|
ld a, e
|
|
|
|
|
dec a
|
|
|
|
|
ld [hl], a
|
|
|
|
|
|
|
|
|
|
.okay
|
|
|
|
|
inc [hl]
|
|
|
|
|
jr .next
|
|
|
|
|
|
|
|
|
|
.pressed_down
|
|
|
|
|
ld hl, wd003
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
cp e
|
|
|
|
|
jr nz, .okay2
|
|
|
|
|
ld a, d
|
|
|
|
|
inc a
|
|
|
|
|
ld [hl], a
|
|
|
|
|
|
|
|
|
|
.okay2
|
|
|
|
|
dec [hl]
|
|
|
|
|
|
|
|
|
|
.next
|
|
|
|
|
push de
|
|
|
|
|
ld a, [wd003]
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call PokegearMap_UpdateLandmarkName
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wd004]
|
|
|
|
|
ld c, a
|
|
|
|
|
ld a, [wd005]
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [wd003]
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call PokegearMap_UpdateCursorPosition
|
2016-01-10 04:41:03 +00:00
|
|
|
|
pop de
|
|
|
|
|
jr .loop2
|
|
|
|
|
; 91a04
|
|
|
|
|
|
|
|
|
|
.InitTilemap: ; 91a04
|
|
|
|
|
ld a, [wd002]
|
|
|
|
|
cp KANTO_LANDMARK
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr nc, .kanto2
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld e, $0
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr .okay_tilemap
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.kanto2
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld e, $1
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.okay_tilemap
|
2016-01-10 04:41:03 +00:00
|
|
|
|
callba PokegearMap
|
|
|
|
|
ld a, $7
|
|
|
|
|
ld bc, 6
|
|
|
|
|
hlcoord 1, 0
|
|
|
|
|
call ByteFill
|
|
|
|
|
hlcoord 0, 0
|
|
|
|
|
ld [hl], $6
|
|
|
|
|
hlcoord 7, 0
|
|
|
|
|
ld [hl], $17
|
|
|
|
|
hlcoord 7, 1
|
|
|
|
|
ld [hl], $16
|
|
|
|
|
hlcoord 7, 2
|
|
|
|
|
ld [hl], $26
|
|
|
|
|
ld a, $7
|
|
|
|
|
ld bc, NAME_LENGTH
|
|
|
|
|
hlcoord 8, 2
|
|
|
|
|
call ByteFill
|
|
|
|
|
hlcoord 19, 2
|
|
|
|
|
ld [hl], $17
|
|
|
|
|
ld a, [wd003]
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call PokegearMap_UpdateLandmarkName
|
2016-01-10 04:41:03 +00:00
|
|
|
|
callba TownMapPals
|
|
|
|
|
ret
|
|
|
|
|
; 91a53
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
|
|
|
|
PlayRadio: ; 91a53
|
|
|
|
|
ld hl, Options
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
push af
|
|
|
|
|
set 4, [hl]
|
|
|
|
|
call .PlayStation
|
|
|
|
|
ld c, 100
|
|
|
|
|
call DelayFrames
|
|
|
|
|
.loop
|
|
|
|
|
call JoyTextDelay
|
|
|
|
|
ld a, [hJoyPressed]
|
|
|
|
|
and A_BUTTON | B_BUTTON
|
|
|
|
|
jr nz, .stop
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearRadioChannelAddr]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld l, a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearRadioChannelAddr + 1]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld h, a
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld a, [wPokegearRadioChannelBank]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
and a
|
|
|
|
|
jr z, .zero
|
|
|
|
|
rst FarCall
|
|
|
|
|
.zero
|
|
|
|
|
call DelayFrame
|
|
|
|
|
jr .loop
|
|
|
|
|
|
|
|
|
|
.stop
|
|
|
|
|
pop af
|
|
|
|
|
ld [Options], a
|
2016-01-10 22:44:09 +00:00
|
|
|
|
call ExitPokegearRadio_HandleMusic
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91a87
|
|
|
|
|
|
|
|
|
|
.PlayStation: ; 91a87
|
|
|
|
|
ld a, -1
|
|
|
|
|
ld [EnemyTurnsTaken], a
|
|
|
|
|
ld hl, .StationPointers
|
|
|
|
|
ld d, $0
|
|
|
|
|
add hl, de
|
2016-01-10 04:41:03 +00:00
|
|
|
|
add hl, de
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hli]
|
|
|
|
|
ld h, [hl]
|
|
|
|
|
ld l, a
|
|
|
|
|
ld de, .jump_return
|
|
|
|
|
push de
|
|
|
|
|
jp [hl]
|
|
|
|
|
|
|
|
|
|
.jump_return
|
|
|
|
|
push de
|
|
|
|
|
hlcoord 0, 12
|
|
|
|
|
lb bc, 4, 18
|
|
|
|
|
call TextBox
|
|
|
|
|
hlcoord 1, 14
|
|
|
|
|
ld [hl], $72
|
|
|
|
|
pop de
|
|
|
|
|
hlcoord 2, 14
|
|
|
|
|
call PlaceString
|
|
|
|
|
ld h, b
|
|
|
|
|
ld l, c
|
|
|
|
|
ld [hl], $73
|
|
|
|
|
call WaitBGMap
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91ab9
|
|
|
|
|
|
|
|
|
|
.StationPointers: ; 91ab9
|
|
|
|
|
dw .OakOrPnP
|
|
|
|
|
dw LoadStation_OaksPokemonTalk
|
|
|
|
|
dw LoadStation_PokedexShow
|
|
|
|
|
dw LoadStation_PokemonMusic
|
|
|
|
|
dw LoadStation_LuckyChannel
|
|
|
|
|
dw LoadStation_UnownRadio
|
|
|
|
|
dw LoadStation_PlacesAndPeople
|
|
|
|
|
dw LoadStation_LetsAllSing
|
|
|
|
|
dw LoadStation_RocketRadio
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91acb
|
|
|
|
|
|
|
|
|
|
.OakOrPnP: ; 91acb
|
|
|
|
|
call IsInJohto
|
|
|
|
|
and a
|
|
|
|
|
jr nz, .kanto
|
|
|
|
|
call UpdateTime
|
|
|
|
|
ld a, [TimeOfDay]
|
|
|
|
|
and a
|
|
|
|
|
jp z, LoadStation_PokedexShow
|
|
|
|
|
jp LoadStation_OaksPokemonTalk
|
|
|
|
|
|
|
|
|
|
.kanto
|
|
|
|
|
jp LoadStation_PlacesAndPeople
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91ae1
|
2015-11-18 23:35:44 +00:00
|
|
|
|
|
|
|
|
|
PokegearMap: ; 91ae1
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, e
|
|
|
|
|
and a
|
|
|
|
|
jr nz, .kanto
|
2015-12-09 16:38:40 +00:00
|
|
|
|
call LoadTownMapGFX
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call FillJohtoMap
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.kanto
|
2015-12-09 16:38:40 +00:00
|
|
|
|
call LoadTownMapGFX
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call FillKantoMap
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91af3
|
|
|
|
|
|
|
|
|
|
_FlyMap: ; 91af3
|
|
|
|
|
call ClearBGPalettes
|
|
|
|
|
call ClearTileMap
|
|
|
|
|
call ClearSprites
|
|
|
|
|
ld hl, hInMenu
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
push af
|
|
|
|
|
ld [hl], $1
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
2015-12-02 02:54:11 +00:00
|
|
|
|
callba ClearSpriteAnims
|
2015-12-09 16:38:40 +00:00
|
|
|
|
call LoadTownMapGFX
|
|
|
|
|
ld de, FlyMapLabelBorderGFX
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, VTiles2 tile $30
|
2015-12-09 16:38:40 +00:00
|
|
|
|
lb bc, BANK(FlyMapLabelBorderGFX), 6
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call Request1bpp
|
|
|
|
|
call FlyMap
|
2015-12-09 16:38:40 +00:00
|
|
|
|
call ret_91c8f
|
2015-12-28 15:57:04 +00:00
|
|
|
|
ld b, SCGB_POKEGEAR_PALS
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call GetSGBLayout
|
|
|
|
|
call SetPalettes
|
|
|
|
|
.loop
|
|
|
|
|
call JoyTextDelay
|
|
|
|
|
ld hl, hJoyPressed
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and B_BUTTON
|
|
|
|
|
jr nz, .pressedB
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and A_BUTTON
|
|
|
|
|
jr nz, .pressedA
|
|
|
|
|
call FlyMapScroll
|
|
|
|
|
call GetMapCursorCoordinates
|
2015-11-28 20:13:40 +00:00
|
|
|
|
callba PlaySpriteAnimations
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call DelayFrame
|
|
|
|
|
jr .loop
|
|
|
|
|
|
|
|
|
|
.pressedB
|
|
|
|
|
ld a, -1
|
|
|
|
|
jr .exit
|
|
|
|
|
|
|
|
|
|
.pressedA
|
|
|
|
|
ld a, [wd002]
|
|
|
|
|
ld l, a
|
|
|
|
|
ld h, 0
|
|
|
|
|
add hl, hl
|
|
|
|
|
ld de, Flypoints + 1
|
|
|
|
|
add hl, de
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
.exit
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
pop af
|
|
|
|
|
ld [hInMenu], a
|
|
|
|
|
call ClearBGPalettes
|
|
|
|
|
ld a, $90
|
|
|
|
|
ld [hWY], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapAddress], a
|
|
|
|
|
ld a, VBGMap0 / $100
|
|
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
|
ld a, [wd002]
|
|
|
|
|
ld e, a
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91b73
|
|
|
|
|
|
|
|
|
|
FlyMapScroll: ; 91b73
|
|
|
|
|
ld a, [StartFlypoint]
|
|
|
|
|
ld e, a
|
|
|
|
|
ld a, [EndFlypoint]
|
|
|
|
|
ld d, a
|
|
|
|
|
ld hl, hJoyLast
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_UP
|
|
|
|
|
jr nz, .ScrollNext
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_DOWN
|
|
|
|
|
jr nz, .ScrollPrev
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.ScrollNext:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, wd002
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
cp d
|
|
|
|
|
jr nz, .NotAtEndYet
|
|
|
|
|
ld a, e
|
|
|
|
|
dec a
|
|
|
|
|
ld [hl], a
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.NotAtEndYet:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
inc [hl]
|
|
|
|
|
call CheckIfVisitedFlypoint
|
|
|
|
|
jr z, .ScrollNext
|
|
|
|
|
jr .Finally
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.ScrollPrev:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, wd002
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
cp e
|
|
|
|
|
jr nz, .NotAtStartYet
|
|
|
|
|
ld a, d
|
|
|
|
|
inc a
|
|
|
|
|
ld [hl], a
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.NotAtStartYet:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
dec [hl]
|
|
|
|
|
call CheckIfVisitedFlypoint
|
|
|
|
|
jr z, .ScrollPrev
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.Finally:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call TownMapBubble
|
|
|
|
|
call WaitBGMap
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91bb5
|
|
|
|
|
|
|
|
|
|
TownMapBubble: ; 91bb5
|
|
|
|
|
; Draw the bubble containing the location text in the town map HUD
|
|
|
|
|
|
|
|
|
|
; Top-left corner
|
|
|
|
|
hlcoord 1, 0
|
|
|
|
|
ld a, $30
|
|
|
|
|
ld [hli], a
|
|
|
|
|
; Top row
|
|
|
|
|
ld bc, 16
|
|
|
|
|
ld a, " "
|
|
|
|
|
call ByteFill
|
|
|
|
|
; Top-right corner
|
|
|
|
|
ld a, $31
|
|
|
|
|
ld [hl], a
|
|
|
|
|
hlcoord 1, 1
|
|
|
|
|
|
|
|
|
|
; Middle row
|
|
|
|
|
ld bc, 18
|
|
|
|
|
ld a, " "
|
|
|
|
|
call ByteFill
|
|
|
|
|
|
|
|
|
|
; Bottom-left corner
|
|
|
|
|
hlcoord 1, 2
|
|
|
|
|
ld a, $32
|
|
|
|
|
ld [hli], a
|
|
|
|
|
; Bottom row
|
|
|
|
|
ld bc, 16
|
|
|
|
|
ld a, " "
|
|
|
|
|
call ByteFill
|
|
|
|
|
; Bottom-right corner
|
|
|
|
|
ld a, $33
|
|
|
|
|
ld [hl], a
|
|
|
|
|
|
|
|
|
|
; Print "Where?"
|
|
|
|
|
hlcoord 2, 0
|
|
|
|
|
ld de, .Where
|
|
|
|
|
call PlaceString
|
|
|
|
|
; Print the name of the default flypoint
|
|
|
|
|
call .Name
|
|
|
|
|
; Up/down arrows
|
|
|
|
|
hlcoord 18, 1
|
2016-04-10 18:42:14 +00:00
|
|
|
|
ld [hl], $34
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.Where:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
db "Where?@"
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.Name:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; We need the map location of the default flypoint
|
|
|
|
|
ld a, [wd002]
|
|
|
|
|
ld l, a
|
|
|
|
|
ld h, 0
|
|
|
|
|
add hl, hl ; two bytes per flypoint
|
|
|
|
|
ld de, Flypoints
|
|
|
|
|
add hl, de
|
|
|
|
|
ld e, [hl]
|
|
|
|
|
callba GetLandmarkName
|
|
|
|
|
hlcoord 2, 1
|
|
|
|
|
ld de, StringBuffer1
|
|
|
|
|
call PlaceString
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91c17
|
|
|
|
|
|
|
|
|
|
GetMapCursorCoordinates: ; 91c17
|
|
|
|
|
ld a, [wd002]
|
|
|
|
|
ld l, a
|
|
|
|
|
ld h, $0
|
|
|
|
|
add hl, hl
|
|
|
|
|
ld de, Flypoints
|
|
|
|
|
add hl, de
|
|
|
|
|
ld e, [hl]
|
|
|
|
|
callba GetLandmarkCoords
|
|
|
|
|
ld a, [wd003]
|
|
|
|
|
ld c, a
|
|
|
|
|
ld a, [wd004]
|
|
|
|
|
ld b, a
|
|
|
|
|
ld hl, $4
|
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], e
|
|
|
|
|
ld hl, $5
|
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], d
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91c3c
|
|
|
|
|
|
|
|
|
|
CheckIfVisitedFlypoint: ; 91c3c
|
|
|
|
|
; Check if the flypoint loaded in [hl] has been visited yet.
|
|
|
|
|
push bc
|
|
|
|
|
push de
|
|
|
|
|
push hl
|
|
|
|
|
ld l, [hl]
|
|
|
|
|
ld h, 0
|
|
|
|
|
add hl, hl
|
|
|
|
|
ld de, Flypoints + 1
|
|
|
|
|
add hl, de
|
|
|
|
|
ld c, [hl]
|
|
|
|
|
call HasVisitedSpawn
|
|
|
|
|
pop hl
|
|
|
|
|
pop de
|
|
|
|
|
pop bc
|
|
|
|
|
and a
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91c50
|
|
|
|
|
|
|
|
|
|
HasVisitedSpawn: ; 91c50
|
|
|
|
|
; Check if spawn point c has been visited.
|
|
|
|
|
ld hl, VisitedSpawns
|
|
|
|
|
ld b, CHECK_FLAG
|
|
|
|
|
ld d, 0
|
|
|
|
|
predef FlagPredef
|
|
|
|
|
ld a, c
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91c5e
|
|
|
|
|
|
|
|
|
|
Flypoints: ; 91c5e
|
|
|
|
|
; landmark, spawn point
|
|
|
|
|
const_def
|
|
|
|
|
flypoint: MACRO
|
|
|
|
|
const FLY_\1
|
|
|
|
|
db \2, SPAWN_\1
|
|
|
|
|
ENDM
|
|
|
|
|
; Johto
|
|
|
|
|
flypoint NEW_BARK, NEW_BARK_TOWN
|
|
|
|
|
flypoint CHERRYGROVE, CHERRYGROVE_CITY
|
|
|
|
|
flypoint VIOLET, VIOLET_CITY
|
|
|
|
|
flypoint AZALEA, AZALEA_TOWN
|
|
|
|
|
flypoint GOLDENROD, GOLDENROD_CITY
|
|
|
|
|
flypoint ECRUTEAK, ECRUTEAK_CITY
|
|
|
|
|
flypoint OLIVINE, OLIVINE_CITY
|
|
|
|
|
flypoint CIANWOOD, CIANWOOD_CITY
|
|
|
|
|
flypoint MAHOGANY, MAHOGANY_TOWN
|
|
|
|
|
flypoint LAKE, LAKE_OF_RAGE
|
|
|
|
|
flypoint BLACKTHORN, BLACKTHORN_CITY
|
|
|
|
|
flypoint MT_SILVER, SILVER_CAVE
|
|
|
|
|
; Kanto
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
KANTO_FLYPOINT EQU const_value
|
2015-11-17 02:07:26 +00:00
|
|
|
|
flypoint PALLET, PALLET_TOWN
|
|
|
|
|
flypoint VIRIDIAN, VIRIDIAN_CITY
|
|
|
|
|
flypoint PEWTER, PEWTER_CITY
|
|
|
|
|
flypoint CERULEAN, CERULEAN_CITY
|
|
|
|
|
flypoint VERMILION, VERMILION_CITY
|
|
|
|
|
flypoint ROCK_TUNNEL, ROCK_TUNNEL
|
|
|
|
|
flypoint LAVENDER, LAVENDER_TOWN
|
|
|
|
|
flypoint CELADON, CELADON_CITY
|
|
|
|
|
flypoint SAFFRON, SAFFRON_CITY
|
|
|
|
|
flypoint FUCHSIA, FUCHSIA_CITY
|
|
|
|
|
flypoint CINNABAR, CINNABAR_ISLAND
|
|
|
|
|
flypoint INDIGO, INDIGO_PLATEAU
|
|
|
|
|
db -1
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91c8f
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ret_91c8f: ; 91c8f
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91c90
|
|
|
|
|
|
|
|
|
|
FlyMap: ; 91c90
|
|
|
|
|
ld a, [MapGroup]
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [MapNumber]
|
|
|
|
|
ld c, a
|
|
|
|
|
call GetWorldMapLocation
|
|
|
|
|
; If we're not in a valid location, i.e. Pokecenter floor 2F,
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
; the backup map information is used
|
2015-11-17 02:07:26 +00:00
|
|
|
|
cp SPECIAL_MAP
|
|
|
|
|
jr nz, .CheckRegion
|
|
|
|
|
ld a, [BackupMapGroup]
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [BackupMapNumber]
|
|
|
|
|
ld c, a
|
|
|
|
|
call GetWorldMapLocation
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.CheckRegion:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; The first 46 locations are part of Johto. The rest are in Kanto
|
|
|
|
|
cp KANTO_LANDMARK
|
|
|
|
|
jr nc, .KantoFlyMap
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.JohtoFlyMap:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; Note that .NoKanto should be modified in tandem with this branch
|
|
|
|
|
push af
|
|
|
|
|
; Start from New Bark Town
|
|
|
|
|
ld a, FLY_NEW_BARK
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
; Flypoints begin at New Bark Town...
|
|
|
|
|
ld [StartFlypoint], a
|
|
|
|
|
; ..and end at Silver Cave
|
|
|
|
|
ld a, FLY_MT_SILVER
|
|
|
|
|
ld [EndFlypoint], a
|
|
|
|
|
; Fill out the map
|
|
|
|
|
call FillJohtoMap
|
|
|
|
|
call .MapHud
|
|
|
|
|
pop af
|
|
|
|
|
call TownMapPlayerIcon
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.KantoFlyMap:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; The event that there are no flypoints enabled in a map is not
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; accounted for. As a result, if you attempt to select a flypoint
|
|
|
|
|
; when there are none enabled, the game will crash. Additionally,
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; the flypoint selection has a default starting point that
|
|
|
|
|
; 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
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
; visited and its flypoint enabled
|
2015-11-17 02:07:26 +00:00
|
|
|
|
push af
|
|
|
|
|
ld c, SPAWN_INDIGO
|
|
|
|
|
call HasVisitedSpawn
|
|
|
|
|
and a
|
|
|
|
|
jr z, .NoKanto
|
|
|
|
|
; Kanto's map is only loaded if we've visited Indigo Plateau
|
|
|
|
|
|
|
|
|
|
; Flypoints begin at Pallet Town...
|
|
|
|
|
ld a, FLY_PALLET
|
|
|
|
|
ld [StartFlypoint], a
|
|
|
|
|
; ...and end at Indigo Plateau
|
|
|
|
|
ld a, FLY_INDIGO
|
|
|
|
|
ld [EndFlypoint], a
|
|
|
|
|
; Because Indigo Plateau is the first flypoint the player
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; visits, it's made the default flypoint
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
; Fill out the map
|
|
|
|
|
call FillKantoMap
|
|
|
|
|
call .MapHud
|
|
|
|
|
pop af
|
|
|
|
|
call TownMapPlayerIcon
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.NoKanto:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; If Indigo Plateau hasn't been visited, we use Johto's map instead
|
|
|
|
|
|
|
|
|
|
; Start from New Bark Town
|
|
|
|
|
ld a, FLY_NEW_BARK
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
; Flypoints begin at New Bark Town...
|
|
|
|
|
ld [StartFlypoint], a
|
|
|
|
|
; ..and end at Silver Cave
|
|
|
|
|
ld a, FLY_MT_SILVER
|
|
|
|
|
ld [EndFlypoint], a
|
|
|
|
|
call FillJohtoMap
|
|
|
|
|
pop af
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.MapHud:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call TownMapBubble
|
|
|
|
|
call TownMapPals
|
2015-11-20 16:47:52 +00:00
|
|
|
|
hlbgcoord 0, 0 ; BG Map 0
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call TownMapBGUpdate
|
|
|
|
|
call TownMapMon
|
|
|
|
|
ld a, c
|
|
|
|
|
ld [wd003], a
|
|
|
|
|
ld a, b
|
|
|
|
|
ld [wd004], a
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91d11
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
_Area: ; 91d11
|
|
|
|
|
; e: Current landmark
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [wd002]
|
|
|
|
|
push af
|
|
|
|
|
ld a, [wd003]
|
|
|
|
|
push af
|
|
|
|
|
ld a, e
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
call ClearSprites
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
ld a, $1
|
|
|
|
|
ld [hInMenu], a
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld de, PokedexNestIconGFX
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, VTiles0 tile $7f
|
2015-12-09 16:38:40 +00:00
|
|
|
|
lb bc, BANK(PokedexNestIconGFX), 1
|
|
|
|
|
call Request2bpp
|
|
|
|
|
call .GetPlayerOrFastShipIcon
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, VTiles0 tile $78
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld c, 4
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call Request2bpp
|
2015-12-09 16:38:40 +00:00
|
|
|
|
call LoadTownMapGFX
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call FillKantoMap
|
2015-12-09 16:38:40 +00:00
|
|
|
|
call .PlaceString_MonsNest
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call TownMapPals
|
2015-11-20 16:47:52 +00:00
|
|
|
|
hlbgcoord 0, 0, VBGMap1
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call TownMapBGUpdate
|
|
|
|
|
call FillJohtoMap
|
2015-12-09 16:38:40 +00:00
|
|
|
|
call .PlaceString_MonsNest
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call TownMapPals
|
2015-11-20 16:47:52 +00:00
|
|
|
|
hlbgcoord 0, 0
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call TownMapBGUpdate
|
2015-12-28 15:57:04 +00:00
|
|
|
|
ld b, SCGB_POKEGEAR_PALS
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call GetSGBLayout
|
|
|
|
|
call SetPalettes
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
2015-12-09 16:38:40 +00:00
|
|
|
|
xor a ; Johto
|
|
|
|
|
call .GetAndPlaceNest
|
2015-11-17 02:07:26 +00:00
|
|
|
|
.loop
|
|
|
|
|
call JoyTextDelay
|
|
|
|
|
ld hl, hJoyPressed
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and A_BUTTON | B_BUTTON
|
|
|
|
|
jr nz, .a_b
|
|
|
|
|
ld a, [hJoypadDown]
|
|
|
|
|
and SELECT
|
|
|
|
|
jr nz, .select
|
2015-12-09 16:38:40 +00:00
|
|
|
|
call .LeftRightInput
|
|
|
|
|
call .BlinkNestIcons
|
2015-11-17 02:07:26 +00:00
|
|
|
|
jr .next
|
|
|
|
|
|
|
|
|
|
.select
|
2015-12-09 16:38:40 +00:00
|
|
|
|
call .HideNestsShowPlayer
|
2015-11-17 02:07:26 +00:00
|
|
|
|
.next
|
|
|
|
|
call DelayFrame
|
|
|
|
|
jr .loop
|
|
|
|
|
|
|
|
|
|
.a_b
|
|
|
|
|
call ClearSprites
|
|
|
|
|
pop af
|
|
|
|
|
ld [wd003], a
|
|
|
|
|
pop af
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91d9b
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.LeftRightInput: ; 91d9b
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hl]
|
2015-12-09 16:38:40 +00:00
|
|
|
|
and D_LEFT
|
|
|
|
|
jr nz, .left
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hl]
|
2015-12-09 16:38:40 +00:00
|
|
|
|
and D_RIGHT
|
|
|
|
|
jr nz, .right
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.left
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hWY]
|
|
|
|
|
cp $90
|
|
|
|
|
ret z
|
|
|
|
|
call ClearSprites
|
|
|
|
|
ld a, $90
|
|
|
|
|
ld [hWY], a
|
2015-12-09 16:38:40 +00:00
|
|
|
|
xor a ; Johto
|
|
|
|
|
call .GetAndPlaceNest
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.right
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [StatusFlags]
|
|
|
|
|
bit 6, a ; hall of fame
|
|
|
|
|
ret z
|
|
|
|
|
ld a, [hWY]
|
|
|
|
|
and a
|
|
|
|
|
ret z
|
|
|
|
|
call ClearSprites
|
|
|
|
|
xor a
|
|
|
|
|
ld [hWY], a
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld a, 1 ; Kanto
|
|
|
|
|
call .GetAndPlaceNest
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91dcd
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.BlinkNestIcons: ; 91dcd
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hVBlankCounter]
|
|
|
|
|
ld e, a
|
|
|
|
|
and $f
|
|
|
|
|
ret nz
|
|
|
|
|
ld a, e
|
|
|
|
|
and $10
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr nz, .copy_sprites
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call ClearSprites
|
|
|
|
|
ret
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.copy_sprites
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 0, 0
|
|
|
|
|
ld de, Sprites
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld bc, SpritesEnd - Sprites
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call CopyBytes
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91de9
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.PlaceString_MonsNest: ; 91de9
|
2015-11-17 02:07:26 +00:00
|
|
|
|
hlcoord 0, 0
|
|
|
|
|
ld bc, SCREEN_WIDTH
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld a, " "
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call ByteFill
|
|
|
|
|
hlcoord 0, 1
|
|
|
|
|
ld a, $6
|
|
|
|
|
ld [hli], a
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld bc, SCREEN_WIDTH - 2
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, $7
|
|
|
|
|
call ByteFill
|
|
|
|
|
ld [hl], $17
|
|
|
|
|
call GetPokemonName
|
|
|
|
|
hlcoord 2, 0
|
|
|
|
|
call PlaceString
|
|
|
|
|
ld h, b
|
|
|
|
|
ld l, c
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld de, .String_SNest
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call PlaceString
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91e16
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.String_SNest:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
db "'S NEST@"
|
|
|
|
|
; 91e1e
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.GetAndPlaceNest: ; 91e1e
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [wd003], a
|
|
|
|
|
ld e, a
|
2015-12-09 16:38:40 +00:00
|
|
|
|
callba FindNest ; load nest landmarks into TileMap[0,0]
|
2015-11-17 02:07:26 +00:00
|
|
|
|
decoord 0, 0
|
|
|
|
|
ld hl, Sprites
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.nestloop
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [de]
|
|
|
|
|
and a
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr z, .done_nest
|
2015-11-17 02:07:26 +00:00
|
|
|
|
push de
|
|
|
|
|
ld e, a
|
|
|
|
|
push hl
|
|
|
|
|
callba GetLandmarkCoords
|
|
|
|
|
pop hl
|
2015-12-09 16:38:40 +00:00
|
|
|
|
; load into OAM
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, d
|
2015-12-09 16:38:40 +00:00
|
|
|
|
sub 4
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [hli], a
|
|
|
|
|
ld a, e
|
2015-12-09 16:38:40 +00:00
|
|
|
|
sub 4
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [hli], a
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld a, $7f ; nest icon in this context
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [hli], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [hli], a
|
2015-12-09 16:38:40 +00:00
|
|
|
|
; next
|
2015-11-17 02:07:26 +00:00
|
|
|
|
pop de
|
|
|
|
|
inc de
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr .nestloop
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.done_nest
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, Sprites
|
|
|
|
|
decoord 0, 0
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld bc, SpritesEnd - Sprites
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call CopyBytes
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91e5a
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.HideNestsShowPlayer: ; 91e5a
|
|
|
|
|
call .CheckPlayerLocation
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret c
|
|
|
|
|
ld a, [wd002]
|
|
|
|
|
ld e, a
|
|
|
|
|
callba GetLandmarkCoords
|
|
|
|
|
ld c, e
|
|
|
|
|
ld b, d
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld de, .PlayerOAM
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, Sprites
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.ShowPlayerLoop:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [de]
|
|
|
|
|
cp $80
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr z, .clear_oam
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add b
|
|
|
|
|
ld [hli], a
|
|
|
|
|
inc de
|
|
|
|
|
ld a, [de]
|
|
|
|
|
add c
|
|
|
|
|
ld [hli], a
|
|
|
|
|
inc de
|
|
|
|
|
ld a, [de]
|
2015-12-09 16:38:40 +00:00
|
|
|
|
add $78 ; where the player's sprite is loaded
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [hli], a
|
|
|
|
|
inc de
|
|
|
|
|
push bc
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld c, 0 ; RED
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [PlayerGender]
|
|
|
|
|
bit 0, a
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr z, .got_gender
|
|
|
|
|
inc c ; BLUE
|
|
|
|
|
.got_gender
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, c
|
|
|
|
|
ld [hli], a
|
|
|
|
|
pop bc
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr .ShowPlayerLoop
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.clear_oam
|
|
|
|
|
ld hl, Sprites + 4 * 4
|
|
|
|
|
ld bc, SpritesEnd - (Sprites + 4 * 4)
|
2015-11-17 02:07:26 +00:00
|
|
|
|
xor a
|
|
|
|
|
call ByteFill
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91e9c
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.PlayerOAM: ; 91e9c
|
|
|
|
|
db -1 * 8, -1 * 8, 0 ; top left
|
|
|
|
|
db -1 * 8, 0 * 8, 1 ; top right
|
|
|
|
|
db 0 * 8, -1 * 8, 2 ; bottom left
|
|
|
|
|
db 0 * 8, 0 * 8, 3 ; bottom right
|
2015-11-17 02:07:26 +00:00
|
|
|
|
db $80 ; terminator
|
|
|
|
|
; 91ea9
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.CheckPlayerLocation: ; 91ea9
|
|
|
|
|
; Don't show the player's sprite if you're
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
; not in the same region as what's currently
|
|
|
|
|
; on the screen.
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [wd002]
|
|
|
|
|
cp FAST_SHIP
|
|
|
|
|
jr z, .johto
|
|
|
|
|
cp KANTO_LANDMARK
|
|
|
|
|
jr c, .johto
|
|
|
|
|
.kanto
|
|
|
|
|
ld a, [wd003]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .clear
|
|
|
|
|
jr .ok
|
|
|
|
|
|
|
|
|
|
.johto
|
|
|
|
|
ld a, [wd003]
|
|
|
|
|
and a
|
|
|
|
|
jr nz, .clear
|
|
|
|
|
.ok
|
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.clear
|
|
|
|
|
ld hl, Sprites
|
|
|
|
|
ld bc, SpritesEnd - Sprites
|
|
|
|
|
xor a
|
|
|
|
|
call ByteFill
|
|
|
|
|
scf
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91ed0
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.GetPlayerOrFastShipIcon: ; 91ed0
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [wd002]
|
|
|
|
|
cp FAST_SHIP
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr z, .FastShip
|
2015-11-17 02:07:26 +00:00
|
|
|
|
callba GetPlayerIcon
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.FastShip:
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld de, FastShipGFX
|
|
|
|
|
ld b, BANK(FastShipGFX)
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91ee4
|
|
|
|
|
|
|
|
|
|
TownMapBGUpdate: ; 91ee4
|
|
|
|
|
; Update BG Map tiles and attributes
|
|
|
|
|
|
|
|
|
|
; BG Map address
|
|
|
|
|
ld a, l
|
|
|
|
|
ld [hBGMapAddress], a
|
|
|
|
|
ld a, h
|
|
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
|
; Only update palettes on CGB
|
|
|
|
|
ld a, [hCGB]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .tiles
|
|
|
|
|
; BG Map mode 2 (palettes)
|
|
|
|
|
ld a, 2
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
; The BG Map is updated in thirds, so we wait
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 3 frames to update the whole screen's palettes.
|
|
|
|
|
ld c, 3
|
|
|
|
|
call DelayFrames
|
|
|
|
|
.tiles
|
|
|
|
|
; Update BG Map tiles
|
|
|
|
|
call WaitBGMap
|
|
|
|
|
; Turn off BG Map update
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91eff
|
|
|
|
|
|
|
|
|
|
FillJohtoMap: ; 91eff
|
|
|
|
|
ld de, JohtoMap
|
|
|
|
|
jr FillTownMap
|
|
|
|
|
|
|
|
|
|
FillKantoMap: ; 91f04
|
|
|
|
|
ld de, KantoMap
|
|
|
|
|
FillTownMap: ; 91f07
|
|
|
|
|
hlcoord 0, 0
|
|
|
|
|
.loop
|
|
|
|
|
ld a, [de]
|
2015-12-09 16:38:40 +00:00
|
|
|
|
cp -1
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret z
|
|
|
|
|
ld a, [de]
|
|
|
|
|
ld [hli], a
|
|
|
|
|
inc de
|
|
|
|
|
jr .loop
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91f13
|
|
|
|
|
|
|
|
|
|
TownMapPals: ; 91f13
|
|
|
|
|
; Assign palettes based on tile ids
|
|
|
|
|
hlcoord 0, 0
|
|
|
|
|
decoord 0, 0, AttrMap
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
2015-11-17 02:07:26 +00:00
|
|
|
|
.loop
|
|
|
|
|
; Current tile
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
push hl
|
|
|
|
|
; HP/borders use palette 0
|
|
|
|
|
cp $60
|
|
|
|
|
jr nc, .pal0
|
|
|
|
|
; The palette data is condensed to nybbles,
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; least-significant first.
|
2016-04-02 13:28:46 +00:00
|
|
|
|
ld hl, .PalMap
|
2015-11-17 02:07:26 +00:00
|
|
|
|
srl a
|
|
|
|
|
jr c, .odd
|
|
|
|
|
; Even-numbered tile ids take the bottom nybble...
|
|
|
|
|
add l
|
|
|
|
|
ld l, a
|
|
|
|
|
ld a, h
|
|
|
|
|
adc 0
|
|
|
|
|
ld h, a
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and %111
|
|
|
|
|
jr .update
|
|
|
|
|
|
|
|
|
|
.odd
|
|
|
|
|
; ...and odd ids take the top.
|
|
|
|
|
add l
|
|
|
|
|
ld l, a
|
|
|
|
|
ld a, h
|
|
|
|
|
adc 0
|
|
|
|
|
ld h, a
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
swap a
|
|
|
|
|
and %111
|
|
|
|
|
jr .update
|
|
|
|
|
|
|
|
|
|
.pal0
|
|
|
|
|
xor a
|
|
|
|
|
.update
|
|
|
|
|
pop hl
|
|
|
|
|
ld [de], a
|
|
|
|
|
inc de
|
|
|
|
|
dec bc
|
|
|
|
|
ld a, b
|
|
|
|
|
or c
|
|
|
|
|
jr nz, .loop
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.PalMap:
|
2016-04-02 13:28:46 +00:00
|
|
|
|
townmappals: MACRO
|
|
|
|
|
rept _NARG / 2
|
|
|
|
|
dn \2, \1
|
|
|
|
|
shift
|
|
|
|
|
shift
|
|
|
|
|
endr
|
|
|
|
|
endm
|
|
|
|
|
townmappals 1, 1, 1, 2, 2, 2, 0, 0, 1, 1, 3, 1, 4, 5, 4, 5
|
|
|
|
|
townmappals 1, 1, 1, 2, 2, 2, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0
|
|
|
|
|
townmappals 1, 1, 1, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
|
|
|
|
townmappals 0, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
|
|
|
|
townmappals 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0
|
|
|
|
|
townmappals 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91f7b
|
|
|
|
|
|
|
|
|
|
TownMapMon: ; 91f7b
|
|
|
|
|
; Draw the FlyMon icon at town map location in
|
|
|
|
|
|
|
|
|
|
; Get FlyMon species
|
|
|
|
|
ld a, [CurPartyMon]
|
|
|
|
|
ld hl, PartySpecies
|
|
|
|
|
ld e, a
|
|
|
|
|
ld d, $0
|
|
|
|
|
add hl, de
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
ld [wd265], a
|
|
|
|
|
; Get FlyMon icon
|
|
|
|
|
ld e, 8 ; starting tile in VRAM
|
|
|
|
|
callba GetSpeciesIcon
|
|
|
|
|
; Animation/palette
|
2015-12-09 16:38:40 +00:00
|
|
|
|
depixel 0, 0
|
|
|
|
|
ld a, SPRITE_ANIM_INDEX_00
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call _InitSpriteAnimStruct
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_TILE_ID
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld [hl], $8
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
2015-12-19 01:07:09 +00:00
|
|
|
|
ld [hl], SPRITE_ANIM_SEQ_NULL
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 91fa6
|
|
|
|
|
|
|
|
|
|
TownMapPlayerIcon: ; 91fa6
|
|
|
|
|
; Draw the player icon at town map location in a
|
|
|
|
|
push af
|
|
|
|
|
callba GetPlayerIcon
|
|
|
|
|
; Standing icon
|
|
|
|
|
ld hl, VTiles0 tile $10
|
|
|
|
|
ld c, 4 ; # tiles
|
|
|
|
|
call Request2bpp
|
|
|
|
|
; Walking icon
|
|
|
|
|
ld hl, $c0
|
|
|
|
|
add hl, de
|
|
|
|
|
ld d, h
|
|
|
|
|
ld e, l
|
|
|
|
|
ld hl, VTiles0 tile $14
|
|
|
|
|
ld c, 4 ; # tiles
|
|
|
|
|
ld a, BANK(ChrisSpriteGFX) ; does nothing
|
|
|
|
|
call Request2bpp
|
|
|
|
|
; Animation/palette
|
2015-12-09 16:38:40 +00:00
|
|
|
|
depixel 0, 0
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld b, SPRITE_ANIM_INDEX_RED_WALK ; Male
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [PlayerGender]
|
|
|
|
|
bit 0, a
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr z, .got_gender
|
2016-01-10 04:41:03 +00:00
|
|
|
|
ld b, SPRITE_ANIM_INDEX_BLUE_WALK ; Female
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.got_gender
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, b
|
|
|
|
|
call _InitSpriteAnimStruct
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_TILE_ID
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], $10
|
|
|
|
|
pop af
|
|
|
|
|
ld e, a
|
|
|
|
|
push bc
|
|
|
|
|
callba GetLandmarkCoords
|
|
|
|
|
pop bc
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], e
|
2015-12-09 16:38:40 +00:00
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
2015-11-17 02:07:26 +00:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], d
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 0x91ff2
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
LoadTownMapGFX: ; 91ff2
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, TownMapGFX
|
|
|
|
|
ld de, VTiles2
|
|
|
|
|
lb bc, BANK(TownMapGFX), $30
|
|
|
|
|
call DecompressRequest2bpp
|
|
|
|
|
ret
|
|
|
|
|
|
2016-01-10 04:41:03 +00:00
|
|
|
|
; 91fff
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
|
|
|
|
JohtoMap: ; 91fff
|
|
|
|
|
INCBIN "gfx/misc/johto.bin"
|
|
|
|
|
; 92168
|
|
|
|
|
|
|
|
|
|
KantoMap: ; 92168
|
|
|
|
|
INCBIN "gfx/misc/kanto.bin"
|
|
|
|
|
; 922d1
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
PokedexNestIconGFX: ; 922d1
|
|
|
|
|
INCBIN "gfx/pokegear/dexmap_nest_icon.2bpp"
|
|
|
|
|
FlyMapLabelBorderGFX: ; 922e1
|
|
|
|
|
INCBIN "gfx/pokegear/flymap_label_border.2bpp"
|
2016-01-10 22:44:09 +00:00
|
|
|
|
|
|
|
|
|
; XXX
|
2015-11-17 02:07:26 +00:00
|
|
|
|
xor a
|
|
|
|
|
ld [wd002], a
|
|
|
|
|
call ClearBGPalettes
|
|
|
|
|
call ClearTileMap
|
|
|
|
|
call ClearSprites
|
|
|
|
|
ld hl, hInMenu
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
push af
|
|
|
|
|
ld [hl], $1
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
2015-12-02 02:54:11 +00:00
|
|
|
|
callba ClearSpriteAnims
|
2015-12-09 16:38:40 +00:00
|
|
|
|
call LoadTownMapGFX
|
|
|
|
|
ld de, FlyMapLabelBorderGFX
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, VTiles2 tile $30
|
2015-12-09 16:38:40 +00:00
|
|
|
|
lb bc, BANK(FlyMapLabelBorderGFX), 6
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call Request1bpp
|
|
|
|
|
call FillKantoMap
|
|
|
|
|
call TownMapBubble
|
|
|
|
|
call TownMapPals
|
2015-11-20 16:47:52 +00:00
|
|
|
|
hlbgcoord 0, 0, VBGMap1
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call TownMapBGUpdate
|
|
|
|
|
call FillJohtoMap
|
|
|
|
|
call TownMapBubble
|
|
|
|
|
call TownMapPals
|
2015-11-20 16:47:52 +00:00
|
|
|
|
hlbgcoord 0, 0
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call TownMapBGUpdate
|
|
|
|
|
call TownMapMon
|
|
|
|
|
ld a, c
|
|
|
|
|
ld [wd003], a
|
|
|
|
|
ld a, b
|
|
|
|
|
ld [wd004], a
|
2015-12-28 15:57:04 +00:00
|
|
|
|
ld b, SCGB_POKEGEAR_PALS
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call GetSGBLayout
|
|
|
|
|
call SetPalettes
|
|
|
|
|
.loop
|
|
|
|
|
call JoyTextDelay
|
|
|
|
|
ld hl, hJoyPressed
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and B_BUTTON
|
|
|
|
|
jr nz, .pressedB
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and A_BUTTON
|
|
|
|
|
jr nz, .pressedA
|
2015-12-09 16:38:40 +00:00
|
|
|
|
call .HandleDPad
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call GetMapCursorCoordinates
|
2015-11-28 20:13:40 +00:00
|
|
|
|
callba PlaySpriteAnimations
|
2015-11-17 02:07:26 +00:00
|
|
|
|
call DelayFrame
|
|
|
|
|
jr .loop
|
|
|
|
|
|
|
|
|
|
.pressedB
|
|
|
|
|
ld a, -1
|
2016-01-10 22:44:09 +00:00
|
|
|
|
jr .finished_a_b
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
|
|
|
|
.pressedA
|
|
|
|
|
ld a, [wd002]
|
|
|
|
|
ld l, a
|
|
|
|
|
ld h, 0
|
|
|
|
|
add hl, hl
|
|
|
|
|
ld de, Flypoints + 1
|
|
|
|
|
add hl, de
|
|
|
|
|
ld a, [hl]
|
2016-01-10 22:44:09 +00:00
|
|
|
|
.finished_a_b
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [wd002], a
|
|
|
|
|
pop af
|
|
|
|
|
ld [hInMenu], a
|
|
|
|
|
call ClearBGPalettes
|
|
|
|
|
ld a, $90
|
|
|
|
|
ld [hWY], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapAddress], a
|
|
|
|
|
ld a, VBGMap0 / $100
|
|
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
|
ld a, [wd002]
|
|
|
|
|
ld e, a
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 923b8
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.HandleDPad: ; 923b8
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, hJoyLast
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_DOWN | D_RIGHT
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr nz, .down_right
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
and D_UP | D_LEFT
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr nz, .up_left
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.down_right
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, wd002
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
cp FLY_INDIGO
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr c, .okay_dr
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [hl], -1
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.okay_dr
|
2015-11-17 02:07:26 +00:00
|
|
|
|
inc [hl]
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr .continue
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.up_left
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld hl, wd002
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and a
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr nz, .okay_ul
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [hl], FLY_INDIGO + 1
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.okay_ul
|
2015-11-17 02:07:26 +00:00
|
|
|
|
dec [hl]
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.continue
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld a, [wd002]
|
|
|
|
|
cp KANTO_FLYPOINT
|
|
|
|
|
jr c, .johto
|
|
|
|
|
call FillKantoMap
|
|
|
|
|
xor a
|
|
|
|
|
ld b, $9c
|
2015-12-09 16:38:40 +00:00
|
|
|
|
jr .finish
|
2015-11-17 02:07:26 +00:00
|
|
|
|
|
|
|
|
|
.johto
|
|
|
|
|
call FillJohtoMap
|
|
|
|
|
ld a, $90
|
|
|
|
|
ld b, $98
|
2015-12-09 16:38:40 +00:00
|
|
|
|
.finish
|
2015-11-17 02:07:26 +00:00
|
|
|
|
ld [hWY], a
|
|
|
|
|
ld a, b
|
|
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
|
call TownMapBubble
|
|
|
|
|
call WaitBGMap
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
ret
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
2015-11-17 02:07:26 +00:00
|
|
|
|
; 92402
|