You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Virtual FS upload/export**: `web/vfs-helpers.js` — `CbmVfsHelpers.vfsUploadFiles`, `vfsExportFile`, `vfsMountUI` (browser → MEMFS and MEMFS → download). Wired into `web/index.html`, `web/canvas.html`, and tutorial embeds (`showVfsTools`). CI WASM artifacts include `vfs-helpers.js`.
14
14
-**Canvas GFX parity with basic-gfx**: `SCREEN 1` bitmap rendering; software PNG sprites (`gfx/gfx_software_sprites.c`, vendored `gfx/stb_image.h`) replacing the old WASM sprite stubs; compositing order matches Raylib (base then z-sorted sprites). `web/canvas.html` draws `#OPTION border` padding from `Module.wasmGfxBorderPx` / `wasmGfxBorderColorIdx`. Guide: `docs/gfx-canvas-parity.md`. `tests/wasm_browser_canvas_test.py` covers bitmap + sprite smoke.
15
+
-**Example**: `examples/gfx_canvas_demo.bas` + `gfx_canvas_demo.png` (and `web/gfx_canvas_demo.png` for Playwright fetch); canvas test runs the full demo source.
Copy file name to clipboardExpand all lines: README.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -407,6 +407,7 @@ The `examples` folder (included in release archives) contains:
407
407
-`examples/dungeon.bas`: larger PETSCII dungeon-style map with `POKE`/screen RAM and custom charset data (terminal or `basic-gfx` with `-petscii`).
408
408
-`examples/gfx_game_shell.bas`: **basic-gfx** tutorial game — tile `DATA`, `POKE` map, `LOADSPRITE`/`DRAWSPRITE` for 8×8 PNG actors (`player.png`, `enemy.png`) and HUD (`hud_panel.png`), `INKEY$()` + enemy chase. Run: `./basic-gfx examples/gfx_game_shell.bas`.
409
409
-`examples/gfx_sprite_hud_demo.bas`: minimal **DRAWSPRITE** over PETSCII (semi-transparent `hud_panel.png`); comments explain pixel vs text-row coordinates.
410
+
-`examples/gfx_canvas_demo.bas` + `examples/gfx_canvas_demo.png`: small **PETSCII + PNG sprite** sample for **basic-gfx** or **`web/canvas.html`** (upload the PNG to the virtual filesystem, or use `web/gfx_canvas_demo.png` when serving `web/`).
410
411
-`examples/colaburger_viewer.bas`, `examples/gfx_colaburger_viewer.bas`, and `examples/colaburger.seq`: PETSCII .seq file viewer.
411
412
-**.seq files** are sequential dumps of PETSCII screen codes (e.g. from BBS logs or PETSCII art).
412
413
- The terminal viewer reads the file byte-by-byte with `GET#`, prints each byte via `CHR$`, and wraps after
@@ -508,13 +509,13 @@ make basic-gfx
508
509
make basic-wasm
509
510
# Optional: MODULARIZE terminal build for embedding multiple interpreters (see docs/tutorial-embedding.md)
510
511
make basic-wasm-modular
511
-
# Optional: 40×25 PETSCII canvas (GfxVideoState; no Raylib/sprites in browser)
Produces `web/basic.js` and `web/basic.wasm` (Asyncify-enabled), **`web/basic-modular.js`** / **`web/basic-modular.wasm`** for **`tutorial-embed.js`**, and optionally `web/basic-canvas.js` / `web/basic-canvas.wasm` plus **`web/canvas.html`** for a Canvas 2D PETSCII screen. Serve `web/` over HTTP (e.g. `cd web && python3 -m http.server 8080`) and open in a browser. The terminal demo uses an inline **INPUT** field and keyboard routing for **GET** / **INKEY$**; see `web/README.md` for details.
516
517
517
-
**PETSCII canvas** (no Raylib): `make basic-wasm-canvas` produces `web/basic-canvas.js`, `web/basic-canvas.wasm`, and `web/canvas.html`. The page refreshes the canvas during `SLEEP` and loops via a shared RGBA framebuffer.
518
+
**PETSCII canvas** (no Raylib): `make basic-wasm-canvas` produces `web/basic-canvas.js`, `web/basic-canvas.wasm`, and `web/canvas.html`. The page refreshes the canvas during `SLEEP` and loops via a shared RGBA framebuffer (PETSCII, `SCREEN 1` bitmap, and **`LOADSPRITE`/`DRAWSPRITE`** like **basic-gfx**). Try **`examples/gfx_canvas_demo.bas`**: paste into the canvas page, use **Upload to VFS** to add **`gfx_canvas_demo.png`** (same file is copied to **`web/gfx_canvas_demo.png`** for local fetch tests), then Run.
518
519
519
520
**Automated WASM smoke tests** (headless Chromium via Playwright): install `pip install -r tests/requirements-wasm.txt`, run `python3 -m playwright install chromium`, then `make wasm-test`, `make wasm-canvas-test`, and **`make wasm-tutorial-test`**. These run in GitHub Actions for **tagged releases** and the **nightly** workflow; artifacts include `cbm-basic-wasm.tar.gz` (terminal, modular tutorial files, and canvas).
Copy file name to clipboardExpand all lines: docs/gfx-canvas-parity.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,4 +31,8 @@ The browser build `make basic-wasm-canvas` targets the same **GfxVideoState** mo
31
31
32
32
## Tests
33
33
34
-
`make wasm-canvas-test` checks **bitmap mode** (`SCREEN 1` + `PSET`) and **sprite overlay** (fetch `testfixtures/red8x8.png` into MEMFS, `LOADSPRITE` + `DRAWSPRITE`, sample a red pixel).
34
+
`make wasm-canvas-test` checks **bitmap mode** (`SCREEN 1` + `PSET`), **sprite overlay** (fetch `testfixtures/red8x8.png` into MEMFS), and the **`examples/gfx_canvas_demo.bas`** program (fetch `gfx_canvas_demo.png` from the static `web/` copy into MEMFS, assert a red pixel inside the drawn sprite).
35
+
36
+
## Example program
37
+
38
+
`examples/gfx_canvas_demo.bas` — two `PRINT` lines plus `LOADSPRITE` / `DRAWSPRITE` for `gfx_canvas_demo.png` (8×8 solid red PNG, same asset as `tests/fixtures/red8x8.png`).
0 commit comments