Refactor the Unown wall word data (#1131)

This commit is contained in:
Sylvie
2024-07-24 10:56:46 -04:00
committed by GitHub
parent 024c8749a0
commit fed587fc37
4 changed files with 50 additions and 56 deletions

View File

@@ -105,8 +105,8 @@ DisplayUnownWords:
and a
jr z, .load
ld d, $0
ld e, $5
ld d, 0
ld e, UNOWN_WALL_MENU_HEADER_SIZE
.loop
add hl, de
dec a
@@ -148,17 +148,19 @@ DisplayUnownWords:
call CloseWindow
ret
pushc
setcharmap unown
INCLUDE "data/events/unown_walls.asm"
_DisplayUnownWords_FillAttr:
ld a, [de]
cp $ff
cp "@"
ret z
cp $60
cp "Y"
ld a, VRAM_BANK_1 | PAL_BG_BROWN
jr c, .got_pal
ld a, PAL_BG_BROWN
.got_pal
call .PlaceSquare
inc hl
@@ -183,7 +185,7 @@ _DisplayUnownWords_CopyWord:
push de
.word_loop
ld a, [de]
cp $ff
cp "@"
jr z, .word_done
ld c, a
call .ConvertChar
@@ -200,12 +202,12 @@ _DisplayUnownWords_CopyWord:
.ConvertChar:
push hl
ld a, c
cp $60
jr z, .Tile60
cp $62
jr z, .Tile62
cp $64
jr z, .Tile64
cp "Y"
jr z, .YChar
cp "Z"
jr z, .ZChar
cp "-"
jr z, .DashChar
ld [hli], a
inc a
ld [hld], a
@@ -221,7 +223,7 @@ _DisplayUnownWords_CopyWord:
pop hl
ret
.Tile60:
.YChar:
ld [hl], $5b
inc hl
ld [hl], $5c
@@ -233,7 +235,7 @@ _DisplayUnownWords_CopyWord:
pop hl
ret
.Tile62:
.ZChar:
ld [hl], $4e
inc hl
ld [hl], $4f
@@ -245,7 +247,7 @@ _DisplayUnownWords_CopyWord:
pop hl
ret
.Tile64:
.DashChar:
ld [hl], $2
inc hl
ld [hl], $3
@@ -256,3 +258,5 @@ _DisplayUnownWords_CopyWord:
ld [hl], $2
pop hl
ret
popc