Japi Base v0.3 — directory listing API + double-buffered text
Two platform additions and a small demo fix that flow from them.
New
- Directory listing API.
japi_opendir/japi_readdir/japi_closedir, with ajapi_dir_topaque handle that walks both FatFs (SD) and littlefs entries..and..are skipped. Enables file-browsing applications on top of Japi Base. - Double-buffered text buffer. A hidden second copy of
vga_text_bufferis published onvga_wait_vblank()via memcpy during the vertical blank. A render that doesn't finish within one frame no longer has its later writes overrun by the scanline reader — cursor blocks, status bars, overlays, anything written after a long fill all show up cleanly. Frees up the way for larger animations and smooth scrolling. ~24 KB extra RAM.
API contract
Writes via vga_set_char / vga_print / vga_clear are now visible to the scanline only after the next vga_wait_vblank(). Same model as SDL_RenderPresent / glSwapBuffers. The "Hello, Japi Base" example in the README is updated to show the convention.
Demo
Two wait-loops in the demo (wait_key(), and the showcase animation loop) now call vga_wait_vblank() so static pages and the showcase render correctly under the new convention. The bouncing-balls and Starry Night phases already synced on vblank for their bitmap updates and didn't need changes.
Flash
Download japi_base.uf2, hold BOOTSEL while plugging in your Pico 2, and copy it onto the RP2350 drive that appears.