2018-06-24 07:09:41 -07:00
|
|
|
AnimateDexSearchSlowpoke:
|
2017-12-11 19:59:30 -08:00
|
|
|
ld hl, .FrameIDs
|
|
|
|
ld b, 25
|
|
|
|
.loop
|
|
|
|
ld a, [hli]
|
|
|
|
|
|
|
|
; Wrap around
|
|
|
|
cp $fe
|
|
|
|
jr nz, .ok
|
|
|
|
ld hl, .FrameIDs
|
|
|
|
ld a, [hli]
|
|
|
|
.ok
|
|
|
|
|
|
|
|
ld [wDexSearchSlowpokeFrame], a
|
|
|
|
ld a, [hli]
|
|
|
|
ld c, a
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
call DoDexSearchSlowpokeFrame
|
|
|
|
pop hl
|
|
|
|
pop bc
|
|
|
|
call DelayFrames
|
|
|
|
dec b
|
|
|
|
jr nz, .loop
|
|
|
|
xor a
|
|
|
|
ld [wDexSearchSlowpokeFrame], a
|
|
|
|
call DoDexSearchSlowpokeFrame
|
|
|
|
ld c, 32
|
|
|
|
call DelayFrames
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.FrameIDs:
|
2017-12-11 19:59:30 -08:00
|
|
|
; frame ID, duration
|
|
|
|
db 0, 7
|
|
|
|
db 1, 7
|
|
|
|
db 2, 7
|
|
|
|
db 3, 7
|
|
|
|
db 4, 7
|
|
|
|
db -2
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
DoDexSearchSlowpokeFrame:
|
2017-12-11 19:59:30 -08:00
|
|
|
ld a, [wDexSearchSlowpokeFrame]
|
2018-01-02 14:26:23 -08:00
|
|
|
ld hl, .SlowpokeSpriteData
|
2018-01-30 11:52:46 -08:00
|
|
|
ld de, wVirtualOAMSprite00
|
2017-12-11 19:59:30 -08:00
|
|
|
.loop
|
|
|
|
ld a, [hli]
|
|
|
|
cp -1
|
|
|
|
ret z
|
2018-01-10 10:47:57 -08:00
|
|
|
ld [de], a ; y
|
2017-12-11 19:59:30 -08:00
|
|
|
inc de
|
|
|
|
ld a, [hli]
|
2018-01-10 10:47:57 -08:00
|
|
|
ld [de], a ; x
|
2017-12-11 19:59:30 -08:00
|
|
|
inc de
|
|
|
|
ld a, [wDexSearchSlowpokeFrame]
|
|
|
|
ld b, a
|
|
|
|
add a
|
|
|
|
add b
|
|
|
|
add [hl]
|
|
|
|
inc hl
|
2018-01-10 10:47:57 -08:00
|
|
|
ld [de], a ; tile id
|
2017-12-11 19:59:30 -08:00
|
|
|
inc de
|
|
|
|
ld a, [hli]
|
2018-01-10 10:47:57 -08:00
|
|
|
ld [de], a ; attributes
|
2017-12-11 19:59:30 -08:00
|
|
|
inc de
|
|
|
|
jr .loop
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SlowpokeSpriteData:
|
`dsprite y, ypx, x, xpx, off, attr` -> `dbsprite x, y, xpx, ypx, off, attr`
2020-04-04 13:00:30 -07:00
|
|
|
dbsprite 9, 11, 0, 0, $00, 0
|
|
|
|
dbsprite 10, 11, 0, 0, $01, 0
|
|
|
|
dbsprite 11, 11, 0, 0, $02, 0
|
|
|
|
dbsprite 9, 12, 0, 0, $10, 0
|
|
|
|
dbsprite 10, 12, 0, 0, $11, 0
|
|
|
|
dbsprite 11, 12, 0, 0, $12, 0
|
|
|
|
dbsprite 9, 13, 0, 0, $20, 0
|
|
|
|
dbsprite 10, 13, 0, 0, $21, 0
|
|
|
|
dbsprite 11, 13, 0, 0, $22, 0
|
2017-12-11 19:59:30 -08:00
|
|
|
db -1
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
DisplayDexEntry:
|
2017-12-11 19:59:30 -08:00
|
|
|
call GetPokemonName
|
|
|
|
hlcoord 9, 3
|
|
|
|
call PlaceString ; mon species
|
2018-07-28 16:27:34 -07:00
|
|
|
ld a, [wTempSpecies]
|
2017-12-11 19:59:30 -08:00
|
|
|
ld b, a
|
|
|
|
call GetDexEntryPointer
|
|
|
|
ld a, b
|
|
|
|
push af
|
|
|
|
hlcoord 9, 5
|
2020-12-07 10:32:08 -08:00
|
|
|
call PlaceFarString ; dex species
|
2017-12-11 19:59:30 -08:00
|
|
|
ld h, b
|
|
|
|
ld l, c
|
|
|
|
push de
|
|
|
|
; Print dex number
|
|
|
|
hlcoord 2, 8
|
|
|
|
ld a, $5c ; No
|
|
|
|
ld [hli], a
|
|
|
|
ld a, $5d ; .
|
|
|
|
ld [hli], a
|
2018-07-28 16:27:34 -07:00
|
|
|
ld de, wTempSpecies
|
2017-12-11 19:59:30 -08:00
|
|
|
lb bc, PRINTNUM_LEADINGZEROS | 1, 3
|
|
|
|
call PrintNum
|
|
|
|
; Check to see if we caught it. Get out of here if we haven't.
|
2018-07-28 16:27:34 -07:00
|
|
|
ld a, [wTempSpecies]
|
2017-12-11 19:59:30 -08:00
|
|
|
dec a
|
|
|
|
call CheckCaughtMon
|
|
|
|
pop hl
|
|
|
|
pop bc
|
|
|
|
ret z
|
|
|
|
; Get the height of the Pokemon.
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
|
|
|
ld [wCurSpecies], a
|
2017-12-11 19:59:30 -08:00
|
|
|
inc hl
|
|
|
|
ld a, b
|
|
|
|
push af
|
|
|
|
push hl
|
2021-01-09 12:16:05 -08:00
|
|
|
call GetFarWord
|
2017-12-11 19:59:30 -08:00
|
|
|
ld d, l
|
|
|
|
ld e, h
|
|
|
|
pop hl
|
|
|
|
inc hl
|
|
|
|
inc hl
|
|
|
|
ld a, d
|
|
|
|
or e
|
|
|
|
jr z, .skip_height
|
|
|
|
push hl
|
|
|
|
push de
|
2019-06-09 16:52:46 -07:00
|
|
|
; Print the height, with two of the four digits in front of the decimal point
|
2020-06-17 07:39:17 -07:00
|
|
|
ld hl, sp+0
|
2017-12-11 19:59:30 -08:00
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
hlcoord 12, 7
|
2019-06-09 08:46:06 -07:00
|
|
|
lb bc, 2, (2 << 4) | 4
|
2017-12-11 19:59:30 -08:00
|
|
|
call PrintNum
|
2019-06-09 08:46:06 -07:00
|
|
|
; Replace the decimal point with a ft symbol
|
2017-12-11 19:59:30 -08:00
|
|
|
hlcoord 14, 7
|
2019-06-09 08:46:06 -07:00
|
|
|
ld [hl], $5e
|
2017-12-11 19:59:30 -08:00
|
|
|
pop af
|
|
|
|
pop hl
|
|
|
|
|
|
|
|
.skip_height
|
|
|
|
pop af
|
|
|
|
push af
|
|
|
|
inc hl
|
|
|
|
push hl
|
|
|
|
dec hl
|
2021-01-09 12:16:05 -08:00
|
|
|
call GetFarWord
|
2017-12-11 19:59:30 -08:00
|
|
|
ld d, l
|
|
|
|
ld e, h
|
|
|
|
ld a, e
|
|
|
|
or d
|
|
|
|
jr z, .skip_weight
|
|
|
|
push de
|
2019-06-09 16:52:46 -07:00
|
|
|
; Print the weight, with four of the five digits in front of the decimal point
|
2020-06-17 07:39:17 -07:00
|
|
|
ld hl, sp+0
|
2017-12-11 19:59:30 -08:00
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
hlcoord 11, 9
|
2019-06-09 08:46:06 -07:00
|
|
|
lb bc, 2, (4 << 4) | 5
|
2017-12-11 19:59:30 -08:00
|
|
|
call PrintNum
|
|
|
|
pop de
|
|
|
|
|
|
|
|
.skip_weight
|
|
|
|
; Page 1
|
|
|
|
lb bc, 5, SCREEN_WIDTH - 2
|
|
|
|
hlcoord 2, 11
|
|
|
|
call ClearBox
|
|
|
|
hlcoord 1, 10
|
|
|
|
ld bc, SCREEN_WIDTH - 1
|
|
|
|
ld a, $61 ; horizontal divider
|
|
|
|
call ByteFill
|
|
|
|
; page number
|
|
|
|
hlcoord 1, 9
|
|
|
|
ld [hl], $55
|
|
|
|
inc hl
|
|
|
|
ld [hl], $55
|
|
|
|
hlcoord 1, 10
|
|
|
|
ld [hl], $56 ; P.
|
|
|
|
inc hl
|
|
|
|
ld [hl], $57 ; 1
|
|
|
|
pop de
|
|
|
|
inc de
|
|
|
|
pop af
|
|
|
|
hlcoord 2, 11
|
|
|
|
push af
|
2020-12-07 10:32:08 -08:00
|
|
|
call PlaceFarString
|
2017-12-11 19:59:30 -08:00
|
|
|
pop bc
|
|
|
|
ld a, [wPokedexStatus]
|
2018-01-16 14:59:05 -08:00
|
|
|
or a ; check for page 2
|
2017-12-11 19:59:30 -08:00
|
|
|
ret z
|
|
|
|
|
|
|
|
; Page 2
|
|
|
|
push bc
|
|
|
|
push de
|
|
|
|
lb bc, 5, SCREEN_WIDTH - 2
|
|
|
|
hlcoord 2, 11
|
|
|
|
call ClearBox
|
|
|
|
hlcoord 1, 10
|
|
|
|
ld bc, SCREEN_WIDTH - 1
|
|
|
|
ld a, $61
|
|
|
|
call ByteFill
|
|
|
|
; page number
|
|
|
|
hlcoord 1, 9
|
|
|
|
ld [hl], $55
|
|
|
|
inc hl
|
|
|
|
ld [hl], $55
|
|
|
|
hlcoord 1, 10
|
|
|
|
ld [hl], $56 ; P.
|
|
|
|
inc hl
|
|
|
|
ld [hl], $58 ; 2
|
|
|
|
pop de
|
|
|
|
inc de
|
|
|
|
pop af
|
|
|
|
hlcoord 2, 11
|
2020-12-07 10:32:08 -08:00
|
|
|
call PlaceFarString
|
2017-12-11 19:59:30 -08:00
|
|
|
ret
|
|
|
|
|
2020-06-21 13:27:43 -07:00
|
|
|
POKeString: ; unreferenced
|
2017-12-11 19:59:30 -08:00
|
|
|
db "#@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
GetDexEntryPointer:
|
2017-12-11 19:59:30 -08:00
|
|
|
; return dex entry pointer b:de
|
|
|
|
push hl
|
|
|
|
ld hl, PokedexDataPointerTable
|
|
|
|
ld a, b
|
|
|
|
dec a
|
|
|
|
ld d, 0
|
|
|
|
ld e, a
|
|
|
|
add hl, de
|
|
|
|
add hl, de
|
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
|
|
|
push de
|
|
|
|
rlca
|
|
|
|
rlca
|
2018-01-16 14:27:50 -08:00
|
|
|
maskbits NUM_DEX_ENTRY_BANKS
|
2017-12-11 19:59:30 -08:00
|
|
|
ld hl, .PokedexEntryBanks
|
|
|
|
ld d, 0
|
|
|
|
ld e, a
|
|
|
|
add hl, de
|
|
|
|
ld b, [hl]
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2018-02-03 17:40:21 -08:00
|
|
|
.PokedexEntryBanks:
|
2018-06-12 20:29:15 -07:00
|
|
|
db BANK("Pokedex Entries 001-064")
|
|
|
|
db BANK("Pokedex Entries 065-128")
|
|
|
|
db BANK("Pokedex Entries 129-192")
|
|
|
|
db BANK("Pokedex Entries 193-251")
|
2017-12-11 19:59:30 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
GetDexEntryPagePointer:
|
|
|
|
call GetDexEntryPointer
|
2017-12-11 19:59:30 -08:00
|
|
|
push hl
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
; skip species name
|
|
|
|
.loop1
|
|
|
|
ld a, b
|
|
|
|
call GetFarByte
|
|
|
|
inc hl
|
|
|
|
cp "@"
|
|
|
|
jr nz, .loop1
|
|
|
|
; skip height and weight
|
|
|
|
rept 4
|
|
|
|
inc hl
|
|
|
|
endr
|
|
|
|
; if c != 1: skip entry
|
|
|
|
dec c
|
|
|
|
jr z, .done
|
|
|
|
; skip entry
|
|
|
|
.loop2
|
|
|
|
ld a, b
|
|
|
|
call GetFarByte
|
|
|
|
inc hl
|
|
|
|
cp "@"
|
|
|
|
jr nz, .loop2
|
|
|
|
|
|
|
|
.done
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
pop hl
|
|
|
|
ret
|
2018-06-25 10:45:50 -07:00
|
|
|
|
|
|
|
INCLUDE "data/pokemon/dex_entry_pointers.asm"
|