From 30f3a65e2de99cdffd091289b4edb8e14be9032d Mon Sep 17 00:00:00 2001 From: user Date: Thu, 16 Jul 2026 16:17:02 +0200 Subject: sh: handle backspace in readline; prompt is now '#' readc() returning $08/$7F now drops the last char from the command buffer (and emits one $08 so the terminal erases it) instead of storing the raw byte. Previously "lzs" left the buffer as "lz\x08s", so the command "ls" was reported "not found" even though the screen showed "ls". Also change the shell prompt from '$' to '#'. osk: B button types the selected key SHIFTED (uppercase a-z). A types the key as shown (lowercase/digit/symbol); B on a letter subtracts 32 for the uppercase glyph (the font already has A-Z). Non-letters are unchanged. --- src/osk.asm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/osk.asm') diff --git a/src/osk.asm b/src/osk.asm index 490a402..02700c6 100644 --- a/src/osk.asm +++ b/src/osk.asm @@ -337,9 +337,22 @@ osk_handle:: bit 4, a call nz, osk_right ld a, [wPadNew] - bit 0, a ; A: type the selected key + bit 0, a ; A: type the key as shown + jr z, .chkb + call osk_selected + scf + ret +.chkb + ld a, [wPadNew] + bit 1, a ; B: type the key SHIFTED (uppercase a-z) jr z, .none call osk_selected + cp "a" + jr c, .shifted + cp "z"+1 + jr nc, .shifted + sub 32 ; 'a'..'z' -> 'A'..'Z' +.shifted scf ret .none -- cgit v1.3.1-sl0p