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>