From 057e5377af2d086917b9cd0ffb336231d7d098cb Mon Sep 17 00:00:00 2001 From: user Date: Thu, 16 Jul 2026 11:42:38 +0200 Subject: fs rewrite stage 1: persistent block device (bounce buffer, cart SRAM) - blk.asm: read_block/write_block move 256-byte blocks between battery-backed cart-RAM banks (8-11, the 'disk') and a WRAM bounce buffer. Banking is hidden in those two routines; they inline the 'restore my bank' step so they never touch the stack while the disk bank is mapped over the process's $A000 window (the stack lives there too -- a call/ret would rug-pull it). - format-on-first-boot: superblock magic in block 0; otherwise the disk persists. - cart RAM bumped to 128 KiB (-r 4); process banks 0-7, disk banks 8-11. - debug tool 'blk fill/peek' + syscalls to validate round-trip and persistence. - verified: round-trip incl. cross-bank (block 100 -> bank 11); block survives a reboot via .sav; magic intact (no reformat on 2nd boot). - old WRAM 8-slot FS still backs the tools until stages 2-3. --- src/syscall.asm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/syscall.asm') diff --git a/src/syscall.asm b/src/syscall.asm index 2fc66b6..29dc2b0 100644 --- a/src/syscall.asm +++ b/src/syscall.asm @@ -57,6 +57,8 @@ SyscallTable: dw sys_ps ; 20 PS dw sys_progname ; 21 PROGNAME dw sys_reap ; 22 REAP + dw sys_bfill ; 23 BFILL (debug) + dw sys_bpeek ; 24 BPEEK (debug) ; ----------------------------------------------------------------------------- sys_nosys: -- cgit v1.3.1-sl0p