Skip to content

Add native Foenix F256K file browser (C/cc65) - #2

Open
jhonnaker1 wants to merge 1 commit into
idolpx:masterfrom
jhonnaker1:add-f256k-port
Open

Add native Foenix F256K file browser (C/cc65)#2
jhonnaker1 wants to merge 1 commit into
idolpx:masterfrom
jhonnaker1:add-f256k-port

Conversation

@jhonnaker1

Copy link
Copy Markdown

Adds a Foenix F256K file browser in its own f256/ subtree.

Unlike the MEGA65 and Commander X16 targets, the F256K shares no code with the 6502 core: it has no Commodore KERNAL, no PETSCII, and no CBM DOS. It runs the TinyCore MicroKernel (event-based), draws through the Vicky video chip, and stores files on FAT32. So this is a from-scratch native port written in C (cc65), kept fully separate from sources/.

What it does

Browse the SD card, cursor through the listing, enter/leave folders, and launch a program with Return — the CBM-FileBrowser experience, native on the F256.

How it works

  • Directory listing via the kernel's event-based Directory API (opendir/readdir in the vendored kernel.c); <DIR> flags, dot/._* junk filtered.
  • Vicky text mode — character + colour matrices paged through the $C000 I/O window (MMU_IO_CTRL $0001), 16-entry CLUTs at $D800/$D840; matrix writes bracketed with sei/cli (the keyboard IRQ needs I/O page 0).
  • Keyboard via NextEvent; the F256 delivers arrows as ASCII control codes.
  • Launch by chaining to the flash-resident pexec loader ("-") via RunNamed; quit chains back to the shell KUP ("basic").
  • Emits a PGZ (load $2000); run from SuperBASIC with /- fb256.

Build & run

cd f256 && make        # -> build/fb256.pgz  (needs cc65)

Put fb256.pgz on the SD card, boot to SuperBASIC, /- fb256. See F256.md for full docs and controls.

Notes

  • Toolchain glue (f256jr_pgz.cfg, pgz.s, kernel.c, api.h, dirent.h, f256jr.lib) is vendored from ghackwrench/F256_Jr_Kernel_DOS.
  • Verified end-to-end in the f256k MAME: boot, listing, colour render, navigation/paging, subdir in/out, launching a program, and quit back to SuperBASIC.
  • Branched off master and independent of Add MEGA65 (native C65) and Commander X16 targets #1 (the MEGA65/X16 targets), so the two can be reviewed/merged separately.

🤖 Generated with Claude Code

The F256K has no Commodore KERNAL, PETSCII or CBM DOS, so it can't share the
6502 core the MEGA65/X16 targets use. This is a from-scratch native browser in
C (cc65) against the F256 TinyCore MicroKernel, in its own f256/ subtree:

- Directory listing via the kernel's event-based Directory API (opendir/readdir).
- Vicky per-cell-colour text mode (char/colour matrices paged through the I/O
  window), with the sei/cli discipline the keyboard IRQ requires.
- Keyboard via NextEvent; arrows arrive as ASCII control codes.
- Launch by chaining to the flash-resident pexec loader ("-") via RunNamed;
  quit chains back to the shell KUP ("basic").
- Emits a PGZ (load $2000); run from SuperBASIC with `/- fb256`.

Toolchain glue (linker cfg, PGZ startup, kernel.c POSIX/dir layer, api.h,
f256jr.lib) is vendored from ghackwrench/F256_Jr_Kernel_DOS. Verified end to
end in the f256k MAME: boot, listing, navigation, subdir in/out, launch, quit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant