Commit Graph
4 Commits
Author SHA1 Message Date
javier 2e7ee12ec1 Adjusted the naming of the library in the Package file.
CI / Build & test (macOS) (push) Has been cancelled
CI / Embedded Swift cross-compile (push) Has been cancelled
Documentation / deploy (push) Has been cancelled
2026-07-25 12:02:55 +02:00
javierandClaude Fable 5 e4e99cc894 Add a mock PlaydateAPI test harness for the wrapper layer
The mock allocates real playdate_* structs whose function pointers are
Swift stubs that record their arguments, then hands the fake PlaydateAPI*
to Playdate.initialize(with:). This makes the wrapper plumbing testable on
the host: argument forwarding and type conversion (buttons, colors,
patterns, UTF-8 text), callback trampolines (menu items, sprite update,
audio sources), ownership (bitmaps freed exactly once, table-vended
bitmaps not freed, file handles closed once), collision-info parsing with
system-allocator balance, the JSON tree builder driven by a simulated
parser callback sequence, and regression tests for the CallbackSource
lifecycle fix. Tests run serialized because the recording state is global.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 07:15:50 +02:00
javierandClaude Fable 5 6485997edc Promote subsystem namespaces to the top level of the module
System, Display, Graphics, Sprite, Sound, File, JSON, Lua, Scoreboards,
Network, Rect, SystemEvent, and AccessReply now live at module scope
instead of being nested in the Playdate enum; consumers write
System.log(...) instead of Playdate.System.log(...), and can qualify with
the module name (PlayDate.System) on collision. The Playdate enum remains
only as the raw C API bootstrap (initialize(with:), api, apiPointer), and
Playdate.Error is renamed PlaydateError so no top-level type shadows
Swift.Error.

Breaking change for any existing consumers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 11:10:25 +02:00
javierandClaude Fable 5 09760f99b0 Swift bindings to the Playdate C API
Wraps all ten subsystems of the Playdate SDK 3.1.1 C API (system, display,
graphics, sprites, sound, file, JSON, Lua, scoreboards, network) in
idiomatic Swift: namespaced APIs, wrapper types with ownership semantics,
closures for callbacks, and typed throws. Written within the Embedded Swift
subset so the same code can target the device.

The SDK headers are resolved through a "playdate" pkg-config module
(Scripts/install-pkgconfig.sh), so the package works as a normal SwiftPM
dependency without unsafe build flags.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 10:33:45 +02:00