aboutsummaryrefslogtreecommitdiffstats
path: root/src/osk.asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/osk.asm')
-rw-r--r--src/osk.asm12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/osk.asm b/src/osk.asm
index 5e316e3..609f6be 100644
--- a/src/osk.asm
+++ b/src/osk.asm
@@ -16,7 +16,7 @@ DEF rBCPD EQU $FF69
DEF rWY EQU $FF4A
DEF rWX EQU $FF4B
-DEF OSK_ROWS EQU 3
+DEF OSK_ROWS EQU OSK_DOCK
DEF OSK_COLS EQU 20
DEF OSK_KEYS EQU OSK_ROWS * OSK_COLS
DEF OSK_TILE0 EQU 104 ; first OSK tile index (bank 1; terminal uses 0-103)
@@ -236,20 +236,16 @@ osk_toggle::
ld [wOskVisible], a
or a
jr z, .hide
- ; show: shift the view up so the cursor line clears the keyboard
- ld a, OSK_ROWS
- call term_set_view
+ ; show: enable window, then recompute the view so the cursor clears the keys
ld a, [rLCDC]
or %00100000
ld [rLCDC], a
- ret
+ jp term_write_tilemap
.hide
ld a, [rLCDC]
and %11011111
ld [rLCDC], a
- xor a ; view unshifted -> full 18-row backlog
- call term_set_view
- ret
+ jp term_write_tilemap ; offset recomputes to 0 -> full backlog
; movement with wrap-around; each moves the highlight
osk_up: