aboutsummaryrefslogtreecommitdiffstats
path: root/src/programs.asm
diff options
context:
space:
mode:
authoruser <user@clank>2026-07-16 16:30:33 +0200
committeruser <user@clank>2026-07-16 16:30:33 +0200
commitfe51f65be393161da81d6db6144418c97a8e0fe7 (patch)
treed80b52641b954a42ae532057727d9df27ba9b17a /src/programs.asm
parentosk: bind START to Enter (CR) (diff)
downloadgbos-fe51f65be393161da81d6db6144418c97a8e0fe7.tar.gz
gbos-fe51f65be393161da81d6db6144418c97a8e0fe7.tar.xz
gbos-fe51f65be393161da81d6db6144418c97a8e0fe7.zip
term/osk: scroll region so the OSK never hides the input line
The terminal now has a variable usable height (wTermRows). term_scroll and cursor_down operate within [0 .. wTermRows-1], and term_set_rows(n) shrinks or grows that region, scrolling the cursor up into view when it would fall outside. osk_toggle shrinks the terminal to the rows above the keyboard on show (18 - OSK_ROWS = 15) and restores full height on hide, so the active line is always visible just above the docked keyboard, and hiding the OSK reclaims all 18 rows. Also add c/count.c ("count [n]", default 25): prints n numbered lines to observe/debug scrolling and the scroll-region behavior. Registered as program id 21 / bank 23. Fixed the arg to read argv[0] (getargs returns the string after the command name). Verified: filling the screen then opening the OSK scrolls the latest line to row 14 (visible) with the keyboard at 15-17; closing it restores rows 15-17; count N prints exactly N lines.
Diffstat (limited to '')
-rw-r--r--src/programs.asm7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/programs.asm b/src/programs.asm
index 64efc4d..40d9034 100644
--- a/src/programs.asm
+++ b/src/programs.asm
@@ -103,6 +103,9 @@ ProgBlk:
SECTION "prog_mkdir", ROMX[$4000], BANK[22]
ProgMkdir:
INCBIN "c/mkdir.bin"
+SECTION "prog_count", ROMX[$4000], BANK[23]
+ProgCount:
+ INCBIN "c/count.bin"
; -----------------------------------------------------------------------------
; PROG_SH (bank 3) - the shell, now written in C (c/sh.c): parses >/</| and
@@ -187,6 +190,8 @@ ProgramTable::
dw ProgBlk
db LOW(BANK(ProgMkdir)), HIGH(BANK(ProgMkdir))
dw ProgMkdir
+ db LOW(BANK(ProgCount)), HIGH(BANK(ProgCount))
+ dw ProgCount
; -----------------------------------------------------------------------------
; NameTable (ROM0) - command name -> program id, searched by sys_lookup.
@@ -235,4 +240,6 @@ NameTable::
db PROG_BLK
db "mkdir", 0
db PROG_MKDIR
+ db "count", 0
+ db PROG_COUNT
db 0