mirror of
https://github.com/thornAvery/jep-hack.git
synced 2026-02-08 17:15:24 +13:00
First Commit
Upload literally everything from the pokecrystal16 expand-move-ID branch
This commit is contained in:
commit
2f8a41f833
4618 changed files with 480386 additions and 0 deletions
282
engine/pokedex/pokedex_2.asm
Normal file
282
engine/pokedex/pokedex_2.asm
Normal file
|
|
@ -0,0 +1,282 @@
|
|||
AnimateDexSearchSlowpoke:
|
||||
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
|
||||
|
||||
.FrameIDs:
|
||||
; frame ID, duration
|
||||
db 0, 7
|
||||
db 1, 7
|
||||
db 2, 7
|
||||
db 3, 7
|
||||
db 4, 7
|
||||
db -2
|
||||
|
||||
DoDexSearchSlowpokeFrame:
|
||||
ld a, [wDexSearchSlowpokeFrame]
|
||||
ld hl, .SlowpokeSpriteData
|
||||
ld de, wShadowOAMSprite00
|
||||
.loop
|
||||
ld a, [hli]
|
||||
cp -1
|
||||
ret z
|
||||
ld [de], a ; y
|
||||
inc de
|
||||
ld a, [hli]
|
||||
ld [de], a ; x
|
||||
inc de
|
||||
ld a, [wDexSearchSlowpokeFrame]
|
||||
ld b, a
|
||||
add a
|
||||
add b
|
||||
add [hl]
|
||||
inc hl
|
||||
ld [de], a ; tile id
|
||||
inc de
|
||||
ld a, [hli]
|
||||
ld [de], a ; attributes
|
||||
inc de
|
||||
jr .loop
|
||||
|
||||
.SlowpokeSpriteData:
|
||||
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
|
||||
db -1
|
||||
|
||||
DisplayDexEntry:
|
||||
call GetPokemonName
|
||||
hlcoord 9, 3
|
||||
call PlaceString ; mon species
|
||||
ld a, [wTempSpecies]
|
||||
ld b, a
|
||||
call GetDexEntryPointer
|
||||
ld a, b
|
||||
push af
|
||||
hlcoord 9, 5
|
||||
call PlaceFarString ; dex species
|
||||
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
|
||||
push hl
|
||||
ld a, [wTempSpecies]
|
||||
call GetPokemonIndexFromID
|
||||
ld b, l
|
||||
ld c, h
|
||||
ld hl, sp + 0
|
||||
ld d, h
|
||||
ld e, l
|
||||
pop hl
|
||||
push bc
|
||||
lb bc, PRINTNUM_LEADINGZEROS | 2, 3
|
||||
call PrintNum
|
||||
pop bc
|
||||
; Check to see if we caught it. Get out of here if we haven't.
|
||||
ld a, [wTempSpecies]
|
||||
call CheckCaughtMon
|
||||
pop hl
|
||||
pop bc
|
||||
ret z
|
||||
; Get the height of the Pokemon.
|
||||
ld a, [wCurPartySpecies]
|
||||
ld [wCurSpecies], a
|
||||
inc hl
|
||||
ld a, b
|
||||
push af
|
||||
push hl
|
||||
call GetFarWord
|
||||
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
|
||||
; Print the height, with two of the four digits in front of the decimal point
|
||||
ld hl, sp+0
|
||||
ld d, h
|
||||
ld e, l
|
||||
hlcoord 12, 7
|
||||
lb bc, 2, (2 << 4) | 4
|
||||
call PrintNum
|
||||
; Replace the decimal point with a ft symbol
|
||||
hlcoord 14, 7
|
||||
ld [hl], $5e
|
||||
pop af
|
||||
pop hl
|
||||
|
||||
.skip_height
|
||||
pop af
|
||||
push af
|
||||
inc hl
|
||||
push hl
|
||||
dec hl
|
||||
call GetFarWord
|
||||
ld d, l
|
||||
ld e, h
|
||||
ld a, e
|
||||
or d
|
||||
jr z, .skip_weight
|
||||
push de
|
||||
; Print the weight, with four of the five digits in front of the decimal point
|
||||
ld hl, sp+0
|
||||
ld d, h
|
||||
ld e, l
|
||||
hlcoord 11, 9
|
||||
lb bc, 2, (4 << 4) | 5
|
||||
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
|
||||
call PlaceFarString
|
||||
pop bc
|
||||
ld a, [wPokedexStatus]
|
||||
or a ; check for page 2
|
||||
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
|
||||
call PlaceFarString
|
||||
ret
|
||||
|
||||
POKeString: ; unreferenced
|
||||
db "#@"
|
||||
|
||||
GetDexEntryPointer:
|
||||
; return dex entry pointer b:de
|
||||
push hl
|
||||
ld a, b
|
||||
call GetPokemonIndexFromID
|
||||
dec hl
|
||||
ld d, h
|
||||
ld e, l
|
||||
add hl, hl
|
||||
add hl, de
|
||||
ld de, PokedexDataPointerTable
|
||||
add hl, de
|
||||
ld a, [hli]
|
||||
ld b, a
|
||||
ld a, [hli]
|
||||
ld e, a
|
||||
ld d, [hl]
|
||||
pop hl
|
||||
ret
|
||||
|
||||
GetDexEntryPagePointer:
|
||||
call GetDexEntryPointer
|
||||
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
|
||||
|
||||
INCLUDE "data/pokemon/dex_entry_pointers.asm"
|
||||
Loading…
Add table
Add a link
Reference in a new issue