Commit Graph
3 Commits
Author SHA1 Message Date
Stefan ArentzandClaude Fable 5 b4fc82a0cc Upgrade the frontend from SDL2 to SDL3 (#207)
* Upgrade the frontend from SDL2 to SDL3

Port the ewm crate from the sdl2 crate (0.38) to sdl3 (0.18.4),
linking against Homebrew SDL3 via pkg-config. Behavior is unchanged.

- sdl.rs: SDL3 removed SDL_RendererInfo, so the texture-format probe
  walks the renderer properties instead; the accelerated check becomes
  a software-renderer name check (the ACCELERATED flag is gone), and
  RGB888 is now spelled XRGB8888.
- snd.rs: the SDL2 AudioQueue becomes an SDL3 audio stream. The
  queued_bytes() backpressure cap replaces AudioQueue::size(), and the
  prime-then-resume order keeps the underrun headroom (SDL3 devices
  start paused). SDL3 has no per-device sample-buffer request.
- boo.rs/one.rs/two.rs: into_canvas() is infallible with no builder,
  set_logical_size() takes a presentation mode, the timer subsystem is
  replaced by sdl3::timer::ticks(), text input is per-window,
  fullscreen is a bool, Keycode::Num1 is Keycode::_1, and the game
  controller subsystem is now gamepads with positional button names
  (A/B/X/Y -> South/East/West/North).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* CI: build on ubuntu-26.04 with libsdl3-dev

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 20:09:27 -04:00
Stefan ArentzandClaude Fable 5 d05006ec3a Phase 9: remove the C, promote Rust to the root (#199)
* Phase 9: remove the C tree, promote the Rust workspace to the root

Pure git mv / git rm plus the mechanical path fixes:

- Delete src/*.c, src/*.h, src/Makefile, src/CMakeLists.txt, the Lua
  scripts, .travis.yml, and scripts/gen-golden-trace.* (the golden
  trace regeneration needed the C tree; the checked-in golden file is
  now frozen — regenerating requires the C from git history).
- git mv src/rom -> rom and rust/* -> the repo root.
- Fix include_bytes! and test paths for the new layout (src/rom ->
  rom, one directory level less). No other code changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Phase 9: CI drops the C job; ignore /target

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Phase 9: rewrite README for the Rust build; REWRITE.md complete

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Phase 9: rustfmt after the path shortening

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 11:23:52 -04:00
Stefan ArentzandClaude Fable 5 fbad7d01de Phase 0: Rust workspace scaffolding + CI (#190)
* Phase 0: Rust workspace scaffolding + CI

Adds the parallel Rust workspace under rust/ per REWRITE.md:
- ewm-core (headless lib, zero dependencies) and ewm (binary,
  declares sdl2 now so CI installs SDL2 headers from day one;
  prints the same usage line as the C binary)
- rust-toolchain.toml pinning 1.91.1 with rustfmt + clippy
- GitHub Actions CI: C build job (ubuntu + libsdl2-dev) and Rust
  job (fmt --check, clippy -D warnings, test)
- Anchor the 'ewm' gitignore pattern to src/ so rust/ewm is tracked;
  ignore rust/target/
- README note pointing at REWRITE.md

The C tree in src/ is untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* CI: build the C tree on macOS

gcc on ubuntu fails -Werror with -Wimplicit-fallthrough in two.c;
src/ is frozen until Phase 9, so build C where it has always built
(macOS, as Travis did).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* CI: point clang at the Homebrew prefix via CPATH/LIBRARY_PATH

The committed Makefile does not search /opt/homebrew, so SDL2
headers are not found on the arm64 macOS runner. src/ is frozen,
so pass the paths through the environment instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 08:42:08 -04:00