summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
Diffstat (limited to 'home')
-rw-r--r--home/joypad.asm42
-rw-r--r--home/menu.asm24
-rw-r--r--home/movement.asm8
-rw-r--r--home/palettes.asm16
-rw-r--r--home/text.asm25
-rw-r--r--home/tilemap.asm10
-rw-r--r--home/vblank.asm2
7 files changed, 69 insertions, 58 deletions
diff --git a/home/joypad.asm b/home/joypad.asm
index aa7d092af..b16b716ac 100644
--- a/home/joypad.asm
+++ b/home/joypad.asm
@@ -39,7 +39,7 @@ Joypad:: ; 935
; We can only get four inputs at a time.
; We take d-pad first for no particular reason.
- ld a, D_PAD
+ ld a, R_DPAD
ld [rJOYP], a
; Read twice to give the request time to take.
rept 2
@@ -57,7 +57,7 @@ endr
; Buttons make 8 total inputs (A, B, Select, Start).
; We can fit this into one byte.
- ld a, BUTTONS
+ ld a, R_BUTTONS
ld [rJOYP], a
; Wait for input to stabilize.
rept 6
@@ -285,7 +285,7 @@ Functiona1b:: ; a1b
cp D_UP | SELECT | B_BUTTON
jr z, .asm_a34
- ld a, [$ffa9]
+ ld a, [hJoyLast]
and START | A_BUTTON
jr nz, .asm_a34
@@ -325,29 +325,29 @@ CloseText:: ; a46
Functiona57:: ; a57
call GetJoypad
- ld a, [$ffaa]
+ ld a, [hInMenu]
and a
ld a, [hJoyPressed]
- jr z, .asm_a63
+ jr z, .ok
ld a, [hJoyDown]
-.asm_a63
+.ok
ld [hJoyLast], a
ld a, [hJoyPressed]
and a
- jr z, .asm_a70
+ jr z, .checkframedelay
ld a, 15
ld [TextDelayFrames], a
ret
-.asm_a70
+.checkframedelay
ld a, [TextDelayFrames]
and a
- jr z, .asm_a7a
+ jr z, .restartframedelay
xor a
ld [hJoyLast], a
ret
-.asm_a7a
+.restartframedelay
ld a, 5
ld [TextDelayFrames], a
ret
@@ -356,23 +356,23 @@ Functiona57:: ; a57
Functiona80:: ; a80
ld a, [hConnectionStripLength]
push af
- ld a, [$ffb0]
+ ld a, [hConnectedMapWidth]
push af
xor a
ld [hConnectionStripLength], a
ld a, $6
- ld [$ffb0], a
+ ld [hConnectedMapWidth], a
.asm_a8d
push hl
hlcoord 18, 17
call Functionb06
pop hl
call Functiona57
- ld a, [$ffa9]
+ ld a, [hJoyLast]
and $3
jr z, .asm_a8d
pop af
- ld [$ffb0], a
+ ld [hConnectedMapWidth], a
pop af
ld [hConnectionStripLength], a
ret
@@ -380,7 +380,7 @@ Functiona80:: ; a80
Functionaa5:: ; aa5
call Functiona57
- ld a, [$ffa9]
+ ld a, [hJoyLast]
and A_BUTTON | B_BUTTON
jr z, Functionaa5
ret
@@ -456,16 +456,16 @@ Functionb06:: ; b06
dec a
ld [hConnectionStripLength], a
ret nz
- ld a, [$ffb0]
+ ld a, [hConnectedMapWidth]
dec a
- ld [$ffb0], a
+ ld [hConnectedMapWidth], a
ret nz
ld a, $7a
ld [hl], a
ld a, $ff
ld [hConnectionStripLength], a
ld a, $6
- ld [$ffb0], a
+ ld [hConnectedMapWidth], a
ret
.asm_b27
@@ -477,12 +477,12 @@ Functionb06:: ; b06
ret nz
dec a
ld [hConnectionStripLength], a
- ld a, [$ffb0]
+ ld a, [hConnectedMapWidth]
dec a
- ld [$ffb0], a
+ ld [hConnectedMapWidth], a
ret nz
ld a, $6
- ld [$ffb0], a
+ ld [hConnectedMapWidth], a
ld a, $ee
ld [hl], a
ret
diff --git a/home/menu.asm b/home/menu.asm
index 82bac3b99..bc7751a0b 100644
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -81,16 +81,16 @@ InterpretMenu2:: ; 0x1d81
call Function1c66
ld a, [wcf91]
bit 7, a
- jr z, .asm_1da7 ; 0x1d98 $d
+ jr z, .cancel ; 0x1d98 $d
call Function1c10
call Function1bc9
call Function1ff8
bit 1, a
- jr z, .asm_1da9 ; 0x1da5 $2
-.asm_1da7
+ jr z, .okay ; 0x1da5 $2
+.cancel
scf
ret
-.asm_1da9
+.okay
and a
ret
; 0x1dab
@@ -165,15 +165,15 @@ Function1dfe:: ; 1dfe
call DelayFrames
call WriteBackup
pop af
- jr c, .asm_1e16
+ jr c, .no
ld a, [wcfa9]
cp 2 ; no
- jr z, .asm_1e16
+ jr z, .no
and a
ret
-.asm_1e16
- ld a, $2
+.no
+ ld a, 2
ld [wcfa9], a
scf
ret
@@ -308,7 +308,7 @@ Function1ebd:: ; 1ebd
; 1eda
Function1eda:: ; 1eda
- call Function1cfd
+ call GetMemTileCoord
ld bc, $002a
add hl, bc
.asm_1ee1
@@ -521,13 +521,13 @@ Function1ff0:: ; 1ff0
Function1ff8:: ; 1ff8
push af
and $3
- jr z, .asm_2007
+ jr z, .nosound
ld hl, wcf81
bit 3, [hl]
- jr nz, .asm_2007
+ jr nz, .nosound
call PlayClickSFX
-.asm_2007
+.nosound
pop af
ret
; 2009
diff --git a/home/movement.asm b/home/movement.asm
index 87f28f5ca..d85be3b09 100644
--- a/home/movement.asm
+++ b/home/movement.asm
@@ -159,11 +159,11 @@ Function1bd3:: ; 1bd3
Function1bdd:: ; 1bdd
push bc
push af
- ld a, [$ffa9]
- and $f0
+ ld a, [hJoyLast]
+ and D_PAD
ld b, a
ld a, [hJoyPressed]
- and $f
+ and BUTTONS
or b
ld b, a
pop af
@@ -214,7 +214,7 @@ WriteBackup:: ; 0x1c17
ret
Function1c23:: ; 0x1c23
- call Function1cfd
+ call GetMemTileCoord
call Function1c30
call Function1d19
call Function1c30
diff --git a/home/palettes.asm b/home/palettes.asm
index 32ef29057..93498aedd 100644
--- a/home/palettes.asm
+++ b/home/palettes.asm
@@ -79,6 +79,7 @@ DmgToCgbBGPals:: ; c9f
ld [rBGP], a
push af
+; Don't need to be here if CGB
ld a, [hCGB]
and a
jr z, .end
@@ -89,7 +90,7 @@ DmgToCgbBGPals:: ; c9f
ld a, [rSVBK]
push af
- ld a, 5
+ ld a, 5 ; gfx
ld [rSVBK], a
; copy & reorder bg pal buffer
@@ -165,16 +166,21 @@ DmgToCgbObjPals:: ; ccb
Functioncf8:: ; cf8
ld [rOBP0], a
push af
+
+; Don't need to be here if CGB
ld a, [hCGB]
and a
- jr z, .asm_d22
+ jr z, .done
+
push hl
push de
push bc
+
ld a, [rSVBK]
push af
- ld a, $5
+ ld a, 5 ; gfx
ld [rSVBK], a
+
ld hl, OBPals
ld de, Unkn2Pals
ld a, [rOBP0]
@@ -183,13 +189,15 @@ Functioncf8:: ; cf8
call CopyPals
ld a, $1
ld [hCGBPalUpdate], a
+
pop af
ld [rSVBK], a
+
pop bc
pop de
pop hl
-.asm_d22
+.done
pop af
ret
; d24
diff --git a/home/text.asm b/home/text.asm
index 79f85d38b..77053d0d6 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -17,19 +17,19 @@ ClearBox:: ; fb6
ld a, " "
FillBoxWithByte::
-.col
+.row
push bc
push hl
-.row
+.col
ld [hli], a
dec c
- jr nz, .row
+ jr nz, .col
pop hl
ld bc, SCREEN_WIDTH
add hl, bc
pop bc
dec b
- jr nz, .col
+ jr nz, .row
ret
; fc8
@@ -61,8 +61,11 @@ ClearScreen:: ; fdb
TextBox:: ; fe8
-; Draw a text box width c height b at hl.
-; Dimensions do not include the border.
+; Draw a text box at hl with room for
+; b lines of c characters each.
+; Places a border around the textbox,
+; then switches the palette to the
+; text black-and-white scheme.
push bc
push hl
call TextBoxBorder
@@ -263,14 +266,14 @@ endm
dict "<ROCKET>", RocketChar
dict "<TM>", TMChar
dict "<TRNER>", TrainerChar
- dict $23, Char23
- dict $22, Char22
+ dict $23, PlaceKougeki
+ dict "<LNBRK>", Char22
dict "<CONT>", ContText
dict "<......>", SixDotsChar
dict "<DONE>", DoneText
dict "<PROMPT>", PromptText
dict "<PKMN>", PlacePKMN
- dict $24, PlacePOKE
+ dict "<POKE>", PlacePOKE
dict $25, NextChar
dict2 $1f, " "
dict "<DEXEND>", PlaceDexEnd
@@ -349,7 +352,7 @@ TMChar: print_name TMCharText ; 11b0
PCChar: print_name PCCharText ; 11b7
RocketChar: print_name RocketCharText ; 11be
PlacePOKe: print_name PlacePOKeText ; 11c5
-Char23: print_name Char23Text ; 11cc
+PlaceKougeki: print_name KougekiText ; 11cc
SixDotsChar: print_name SixDotsCharText ; 11d3
PlacePKMN: print_name PlacePKMNText ; 11da
PlacePOKE: print_name PlacePOKEText ; 11e1
@@ -444,7 +447,7 @@ TrainerCharText:: db "TRAINER@" ; 1276
PCCharText:: db "PC@" ; 127e
RocketCharText:: db "ROCKET@" ; 1281
PlacePOKeText:: db "POKé@" ; 1288
-Char23Text:: db "こうげき@" ; 128d
+KougekiText:: db "こうげき@" ; 128d
SixDotsCharText:: db "……@" ; 1292
EnemyText:: db "Enemy @" ; 1295
PlacePKMNText:: db "<PK><MN>@" ; PK MN ; 129c
diff --git a/home/tilemap.asm b/home/tilemap.asm
index d0875c37b..4ce4dced8 100644
--- a/home/tilemap.asm
+++ b/home/tilemap.asm
@@ -99,7 +99,7 @@ Function1c89:: ; 1c89
ld a, [wcf91]
bit 4, a
ret z
- call Function1cfd
+ call GetMemTileCoord
ld a, [de]
ld c, a
inc de
@@ -109,7 +109,7 @@ Function1c89:: ; 1c89
; 1cbb
Function1cbb:: ; 1cbb
- call Function1cfd
+ call GetMemTileCoord
call Function1c53
dec b
dec c
@@ -139,7 +139,7 @@ Function1cc6:: ; 1cc6
; 1ce1
Function1ce1:: ; 1ce1
- call Function1cfd
+ call GetMemTileCoord
ld bc, $0015
add hl, bc
call Function1c53
@@ -150,7 +150,7 @@ Function1ce1:: ; 1ce1
; 1cf1
Function1cf1:: ; 1cf1
- call Function1cfd
+ call GetMemTileCoord
call Function1c53
inc c
inc b
@@ -159,7 +159,7 @@ Function1cf1:: ; 1cf1
; 1cfd
-Function1cfd:: ; 1cfd
+GetMemTileCoord:: ; 1cfd
ld a, [wcf83]
ld c, a
ld a, [wcf82]
diff --git a/home/vblank.asm b/home/vblank.asm
index b8b8b0efb..870ef4808 100644
--- a/home/vblank.asm
+++ b/home/vblank.asm
@@ -146,7 +146,7 @@ VBlank0:: ; 2b1
rst Bankswitch
ld a, [hSeconds]
- ld [$ffe3], a
+ ld [hSecondsBackup], a
ret
; 325