| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace the shrink-and-scroll region with a view offset. The terminal is
always 18 logical rows; term_write_tilemap maps screen row -> logical row +
wViewTop (rows the OSK covers clamp to the cursor line). Showing the OSK
sets the offset to OSK_ROWS so the cursor line lands at row 14 (above the
keyboard) and hiding it sets the offset back to 0 - now purely a remap, so
nothing is scrolled off or destroyed. term_set_view replaces term_set_rows;
term_scroll/cursor_down are back to plain 18-row scrolling.
Result: full 18-row backlog when the OSK is hidden, a shifted 15-row window
when shown, and toggling is lossless (verified: OSK-shown view == baseline
rows 3..17, and toggle on+off == baseline exactly).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
START now returns $0A regardless of cursor position, so you can submit a
command without navigating to the CR key. The CR key still works too.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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 "lz<bksp>s" 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.
|
| |
|
|
|
|
| |
Left at column 0 wraps to the last column (and vice-versa); up at the top
row wraps to the bottom (and vice-versa). Makes reaching far keys quicker
- e.g. the Enter/space area is one UP away from the top row.
|
|
|
A joypad-driven keyboard that costs zero permanent screen space: it lives
on the GB window layer, so SELECT just flips LCDC bit 5 (window enable) and
the terminal's background layer underneath is never disturbed.
- src/joypad.asm: read $FF00 with edge detection (wPadCur/Prev/New).
- src/osk.asm: 3x20 key grid (letters, digits, space, punctuation, plus
Enter/Backspace) built once into spare bank-1 VRAM tiles (104+) and laid
out on the $9C00 window map, docked to the bottom 3 rows. The highlighted
key is a palette swap on its window attribute byte (CGB BG palette 1 =
inverted), so moving the cursor is 1-2 attribute writes with no tile
rebuilding. SELECT toggles, d-pad moves, A types.
- KGetc's console poll loop now polls the joypad and osk_handle each
iteration; a key press returns its byte to the reader exactly like a
serial byte, so the shell is oblivious to the input source.
Verified in the emulator (via --keys): SELECT shows the keyboard, the
highlight tracks the d-pad, and typing "ls"+Enter runs the command and
lists the files; a second SELECT hides it and reclaims the full 18 rows.
Known limitation: the OSK overlays the bottom 3 terminal rows, so if the
prompt has scrolled to the very bottom the current input line can be
hidden. A follow-up can add a scroll region (terminal uses rows 0-14 while
the OSK is up). Input over serial still works unchanged.
|