mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-04-04 10:31:45 +13:00
Use *Coord instead of FuncCoord
Using 'Coord =' doesn't like using wTileMap So use hlCoord, deCoord, bcCoord, aCoord, Coorda, or dwCoord to avoid static addresses
This commit is contained in:
parent
b36f793667
commit
bd533aa79b
53 changed files with 519 additions and 975 deletions
|
|
@ -118,8 +118,7 @@ HandlePokedexSideMenu: ; 4006d (10:406d)
|
|||
pop af
|
||||
ld [wCurrentMenuItem],a
|
||||
push bc
|
||||
FuncCoord 0,3
|
||||
ld hl,Coord
|
||||
hlCoord 0, 3
|
||||
ld de,20
|
||||
ld bc,$7f0d ; 13 blank tiles
|
||||
call DrawTileLine ; cover up the menu cursor in the pokemon list
|
||||
|
|
@ -127,8 +126,7 @@ HandlePokedexSideMenu: ; 4006d (10:406d)
|
|||
ret
|
||||
.buttonBPressed
|
||||
push bc
|
||||
FuncCoord 15,10
|
||||
ld hl,Coord
|
||||
hlCoord 15, 10
|
||||
ld de,20
|
||||
ld bc,$7f07 ; 7 blank tiles
|
||||
call DrawTileLine ; cover up the menu cursor in the side menu
|
||||
|
|
@ -155,53 +153,43 @@ HandlePokedexListMenu: ; 40111 (10:4111)
|
|||
xor a
|
||||
ld [H_AUTOBGTRANSFERENABLED],a
|
||||
; draw the horizontal line separating the seen and owned amounts from the menu
|
||||
FuncCoord 15,8
|
||||
ld hl,Coord
|
||||
hlCoord 15, 8
|
||||
ld a,$7a ; horizontal line tile
|
||||
ld [hli],a
|
||||
ld [hli],a
|
||||
ld [hli],a
|
||||
ld [hli],a
|
||||
ld [hli],a
|
||||
FuncCoord 14,0
|
||||
ld hl,Coord
|
||||
hlCoord 14, 0
|
||||
ld [hl],$71 ; vertical line tile
|
||||
FuncCoord 14,1
|
||||
ld hl,Coord
|
||||
hlCoord 14, 1
|
||||
call DrawPokedexVerticalLine
|
||||
FuncCoord 14,9
|
||||
ld hl,Coord
|
||||
hlCoord 14, 9
|
||||
call DrawPokedexVerticalLine
|
||||
ld hl,wPokedexSeen
|
||||
ld b,wPokedexSeenEnd - wPokedexSeen
|
||||
call CountSetBits
|
||||
ld de,wd11e
|
||||
FuncCoord 16,3
|
||||
ld hl,Coord
|
||||
hlCoord 16, 3
|
||||
ld bc,$0103
|
||||
call PrintNumber ; print number of seen pokemon
|
||||
ld hl,wPokedexOwned
|
||||
ld b,wPokedexOwnedEnd - wPokedexOwned
|
||||
call CountSetBits
|
||||
ld de,wd11e
|
||||
FuncCoord 16,6
|
||||
ld hl,Coord
|
||||
hlCoord 16, 6
|
||||
ld bc,$0103
|
||||
call PrintNumber ; print number of owned pokemon
|
||||
FuncCoord 16,2
|
||||
ld hl,Coord
|
||||
hlCoord 16, 2
|
||||
ld de,PokedexSeenText
|
||||
call PlaceString
|
||||
FuncCoord 16,5
|
||||
ld hl,Coord
|
||||
hlCoord 16, 5
|
||||
ld de,PokedexOwnText
|
||||
call PlaceString
|
||||
FuncCoord 1,1
|
||||
ld hl,Coord
|
||||
hlCoord 1, 1
|
||||
ld de,PokedexContentsText
|
||||
call PlaceString
|
||||
FuncCoord 16,10
|
||||
ld hl,Coord
|
||||
hlCoord 16, 10
|
||||
ld de,PokedexMenuItemsText
|
||||
call PlaceString
|
||||
; find the highest pokedex number among the pokemon the player has seen
|
||||
|
|
@ -223,12 +211,10 @@ HandlePokedexListMenu: ; 40111 (10:4111)
|
|||
.loop
|
||||
xor a
|
||||
ld [H_AUTOBGTRANSFERENABLED],a
|
||||
FuncCoord 4,2
|
||||
ld hl,Coord
|
||||
hlCoord 4, 2
|
||||
ld bc,$0e0a
|
||||
call ClearScreenArea
|
||||
FuncCoord 1,3
|
||||
ld hl,Coord
|
||||
hlCoord 1, 3
|
||||
ld a,[wListScrollOffset]
|
||||
ld [wd11e],a
|
||||
ld d,7
|
||||
|
|
@ -422,47 +408,36 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
|
|||
push af
|
||||
xor a
|
||||
ld [$ffd7],a
|
||||
FuncCoord 0,0
|
||||
ld hl,Coord
|
||||
hlCoord 0, 0
|
||||
ld de,1
|
||||
ld bc,$6414
|
||||
call DrawTileLine ; draw top border
|
||||
FuncCoord 0,17
|
||||
ld hl,Coord
|
||||
hlCoord 0, 17
|
||||
ld b,$6f
|
||||
call DrawTileLine ; draw bottom border
|
||||
FuncCoord 0,1
|
||||
ld hl,Coord
|
||||
hlCoord 0, 1
|
||||
ld de,20
|
||||
ld bc,$6610
|
||||
call DrawTileLine ; draw left border
|
||||
FuncCoord 19,1
|
||||
ld hl,Coord
|
||||
hlCoord 19, 1
|
||||
ld b,$67
|
||||
call DrawTileLine ; draw right border
|
||||
FuncCoord 0,0
|
||||
ld a,$63 ; upper left corner tile
|
||||
ld [Coord],a
|
||||
FuncCoord 19,0
|
||||
Coorda 0, 0
|
||||
ld a,$65 ; upper right corner tile
|
||||
ld [Coord],a
|
||||
FuncCoord 0,17
|
||||
Coorda 19, 0
|
||||
ld a,$6c ; lower left corner tile
|
||||
ld [Coord],a
|
||||
FuncCoord 19,17
|
||||
Coorda 0, 17
|
||||
ld a,$6e ; lower right corner tile
|
||||
ld [Coord],a
|
||||
FuncCoord 0,9
|
||||
ld hl,Coord
|
||||
Coorda 19, 17
|
||||
hlCoord 0, 9
|
||||
ld de,PokedexDataDividerLine
|
||||
call PlaceString ; draw horizontal divider line
|
||||
FuncCoord 9,6
|
||||
ld hl,Coord
|
||||
hlCoord 9, 6
|
||||
ld de,HeightWeightText
|
||||
call PlaceString
|
||||
call GetMonName
|
||||
FuncCoord 9,2
|
||||
ld hl,Coord
|
||||
hlCoord 9, 2
|
||||
call PlaceString
|
||||
ld hl,PokedexEntryPointers
|
||||
ld a,[wd11e]
|
||||
|
|
@ -474,8 +449,7 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
|
|||
ld a,[hli]
|
||||
ld e,a
|
||||
ld d,[hl] ; de = address of pokedex entry
|
||||
FuncCoord 9,4
|
||||
ld hl,Coord
|
||||
hlCoord 9, 4
|
||||
call PlaceString ; print species name
|
||||
ld h,b
|
||||
ld l,c
|
||||
|
|
@ -483,8 +457,7 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
|
|||
ld a,[wd11e]
|
||||
push af
|
||||
call IndexToPokedex
|
||||
FuncCoord 2,8
|
||||
ld hl,Coord
|
||||
hlCoord 2, 8
|
||||
ld a, "№"
|
||||
ld [hli],a
|
||||
ld a,$f2
|
||||
|
|
@ -506,8 +479,7 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
|
|||
call Delay3
|
||||
call GBPalNormal
|
||||
call GetMonHeader ; load pokemon picture location
|
||||
FuncCoord 1,1
|
||||
ld hl,Coord
|
||||
hlCoord 1, 1
|
||||
call LoadFlippedFrontSpriteByMonIndex ; draw pokemon picture
|
||||
ld a,[wcf91]
|
||||
call PlayCry ; play pokemon cry
|
||||
|
|
@ -520,16 +492,14 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
|
|||
jp z,.waitForButtonPress ; if the pokemon has not been owned, don't print the height, weight, or description
|
||||
inc de ; de = address of feet (height)
|
||||
ld a,[de] ; reads feet, but a is overwritten without being used
|
||||
FuncCoord 12,6
|
||||
ld hl,Coord
|
||||
hlCoord 12, 6
|
||||
ld bc,$0102
|
||||
call PrintNumber ; print feet (height)
|
||||
ld a,$60 ; feet symbol tile (one tick)
|
||||
ld [hl],a
|
||||
inc de
|
||||
inc de ; de = address of inches (height)
|
||||
FuncCoord 15,6
|
||||
ld hl,Coord
|
||||
hlCoord 15, 6
|
||||
ld bc,$8102
|
||||
call PrintNumber ; print inches (height)
|
||||
ld a,$61 ; inches symbol tile (two ticks)
|
||||
|
|
@ -550,13 +520,11 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
|
|||
dec de
|
||||
ld a,[de] ; a = lower byte of weight
|
||||
ld [hl],a ; store lower byte of weight in [$ff8c]
|
||||
FuncCoord 11,8
|
||||
ld de,$ff8b
|
||||
ld hl,Coord
|
||||
hlCoord 11, 8
|
||||
ld bc,$0205 ; no leading zeroes, right-aligned, 2 bytes, 5 digits
|
||||
call PrintNumber ; print weight
|
||||
FuncCoord 14,8
|
||||
ld hl,Coord
|
||||
hlCoord 14, 8
|
||||
ld a,[$ff8c]
|
||||
sub a,10
|
||||
ld a,[$ff8b]
|
||||
|
|
@ -574,8 +542,7 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
|
|||
ld [$ff8b],a ; restore original value of [$ff8b]
|
||||
pop hl
|
||||
inc hl ; hl = address of pokedex description text
|
||||
FuncCoord 1,11
|
||||
ld bc,Coord
|
||||
bcCoord 1, 11
|
||||
ld a,2
|
||||
ld [$fff4],a
|
||||
call TextCommandProcessor ; print pokedex description text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue