A bunch of chnages so far. Need to clean it up some more.

This commit is contained in:
Xillicis 2025-03-30 22:29:38 -06:00
parent ce6d7eedcd
commit 31da0802a3
3 changed files with 34 additions and 31 deletions

View File

@ -141,7 +141,7 @@ MainPokedexScreen: ; 0x280fe
pop hl
bit BIT_POKEDEX_MON_CAUGHT, [hl]
jp z, .done
call LoadPokemonDescription
call LoadPokemonDescriptionIntoVRAM
call Func_2885c
call CleanSpriteBuffer
call ScrollPokemonDescriptionDown
@ -183,9 +183,9 @@ MainPokedexScreen: ; 0x280fe
ret
MonInfoPokedexScreen: ; 0x28178
ld a, [wd956]
ld a, [wPokedexDescriptionPageFlag]
bit 0, a
jr z, .asm_28190
jr z, .lastPokedexDescriptionPage
ldh a, [hNewlyPressedButtons]
bit BIT_A_BUTTON, a
jr z, .checkIfBPressed
@ -197,7 +197,7 @@ MonInfoPokedexScreen: ; 0x28178
jr z, .checkIfGameboyColorAndStartPressed
jr .BButtonPressed
.asm_28190
.lastPokedexDescriptionPage
ldh a, [hNewlyPressedButtons]
and $3
jr z, .checkIfGameboyColorAndStartPressed
@ -901,7 +901,7 @@ DisplayPokedexScrollBarAndCursor: ; 0x285db
.decideCursorSprite
ld c, a
push bc
ldh a, [hJoypadState] ; are we holding down a button? Is that right?
ldh a, [hJoypadState]
and a
ld a, [wPokedexBlinkingCursorAndScrollBarCounter]
jr z, .wasJoyHeld
@ -925,7 +925,6 @@ DisplayPokedexScrollBarAndCursor: ; 0x285db
ld a, [wd95c]
and a
ret z
; not sure what happens here yet
dec a
ld [wd95c], a
sla a
@ -1303,7 +1302,7 @@ Func_288a2: ; 0x288a2
call LoadVRAMData
ret
LoadPokemonDescription: ; 0x288c6
LoadPokemonDescriptionIntoVRAM: ; 0x288c6
ld a, [wCurPokedexIndex]
ld c, a
ld b, $0
@ -1332,11 +1331,11 @@ LoadPokemonDescription: ; 0x288c6
xor a
ld [wd860], a
ld [wd861], a
ld bc, $906c
ld bc, $906c ; $90 is the tile number for the first VWF character
ld de, vTilesSH tile $10
call Func_28d97
call LoadPokedexVWFCharacterTiles
rl a
ld [wd956], a
ld [wPokedexDescriptionPageFlag], a
ld a, l
ld [wd957], a
ld a, h
@ -1350,9 +1349,9 @@ Func_28912: ; 0x28912
ld l, a
ld a, [wd958]
ld h, a
call Func_28d97
call LoadPokedexVWFCharacterTiles
rl a
ld [wd956], a
ld [wPokedexDescriptionPageFlag], a
ld a, l
ld [wd957], a
ld a, h
@ -1427,8 +1426,6 @@ Func_28972: ; 0x28972
jr nz, .asm_28978
ret
; Something with checking if Pokemon has been seen
; DOUBLE CHECK THE NAME
GetPokemonName: ; 0x28993
push hl
ld c, a
@ -1458,7 +1455,8 @@ GetPokemonName: ; 0x28993
xor a
ld [wd860], a
ld [wd861], a
ld bc, $500a ; not a pointer
; `b` and `c` are used for setting the font width.
ld bc, $500a
call Func_28e09
pop hl
ret
@ -2074,7 +2072,7 @@ Func_28d88: ; 0x28d88
call PutTileInVRAM
ret
Func_28d97: ; 0x28d97
LoadPokedexVWFCharacterTiles: ; 0x28d97
push de
ld a, b
ldh [hVariableWidthFontFF8C], a
@ -2087,7 +2085,7 @@ Func_28d97: ; 0x28d97
ldh [hVariableWidthFontFF91], a
call Func_28e73 ; function zeros out a large chunk of memory
.asm_28daa
call Func_2957c
call PokedexDescriptionVWFCharacterMapping
jr nc, .asm_28dcb
push hl
ldh [hVariableWidthFontFF92], a
@ -2125,7 +2123,7 @@ Func_28d97: ; 0x28d97
ld a, [wd861]
ld c, a
ld b, $0
bit 7, c
bit 7, c ; `c` is always either 0 or 4, hence this always sets the zero flag
jr z, .asm_28de9
dec b
.asm_28de9
@ -2216,6 +2214,7 @@ Func_28e09: ; 0x28e09
pop af
ret
; Appears to select a certain amount of memory that will get zeroed out.
Func_28e73: ; 0x28e73
push hl
ldh a, [hVariableWidthFontFF8F]
@ -2231,7 +2230,6 @@ Func_28e73: ; 0x28e73
rl b
sla c
rl b
; Subtract bc from the function address, hl.
ld hl, Func_29566
ld a, l
sub c
@ -2244,7 +2242,7 @@ Func_28e73: ; 0x28e73
; indicating how many memory locations we should zero out.
push hl
ld hl, wc000
ld a, [wd860] ; loading `a` here has no effect.
ld a, [wd860]
ret
Func_28e9a:
@ -2258,34 +2256,36 @@ ENDR
pop hl
ret
Func_2957c: ; 0x2957c
; This function takes in the character ID and performs some kind of mapping on it.
; Not exactly sure why. Need to research more.
PokedexDescriptionVWFCharacterMapping: ; 0x2957c
ld a, BANK(PokedexDescriptionPointers)
call ReadByteFromBank
inc hl
and a
ret z
cp $d ; carriage return
jr nz, .asm_2958c
jr nz, .checkNumericCharacter
ld a, $ff
scf
ret
.asm_2958c
.checkNumericCharacter
cp "0"
jr c, .asm_29594
jr c, .checkUpperCaseCharacter
cp "9" + 1
jr c, .asm_295be
.asm_29594
.checkUpperCaseCharacter
cp "A"
jr c, .asm_2959c
jr c, .checkLowerCaseCharacter
cp "Z" + 1
jr c, .asm_295c2
.asm_2959c
.checkLowerCaseCharacter
cp "a"
jr c, .asm_295a4
jr c, .checkSpecialCharacter
cp "z" + 1
jr c, .asm_295c6
.asm_295a4
.checkSpecialCharacter
cp " "
jr z, .asm_295ca
cp ","

View File

@ -1,7 +1,7 @@
LoadDexVWFCharacter_: ; 0x8d17
; Loads a single variable-width-font character used in various parts of the Pokedex screen.
ldh a, [hVariableWidthFontFF92]
cp $80
cp $80 ; $80 = 256 / 2
jp c, Func_8e01
ldh a, [hVariableWidthFontFF90]
ld c, a
@ -10,6 +10,8 @@ LoadDexVWFCharacter_: ; 0x8d17
ldh a, [hVariableWidthFontFF93]
ld l, a
ld h, $0
; `hl` points to CharacterWidths address of the respective character
; `bc` is the flipped VWF value.
add hl, bc
ldh a, [hVariableWidthFontFF8E]
cp h
@ -40,6 +42,7 @@ LoadDexVWFCharacter_: ; 0x8d17
rr l
ldh a, [hVariableWidthFontFF8F]
cp l
; jump when done?
jp c, Func_8df7
.asm_8d5c
ldh a, [hVariableWidthFontFF90]

View File

@ -2366,7 +2366,7 @@ wKeyConfigUpperTilt:: ; 0xd952
wKeyConfigMenu:: ; 0xd954
ds $2
wd956:: ; 0xd956
wPokedexDescriptionPageFlag:: ; 0xd956
ds $1
wd957:: ; 0xd957