#+TITLE: Chapter 7: Emulation, Testing, and Verification #+AUTHOR: Hermes & Claude #+DATE: 2026-10-07 #+PARENT: [[file:index.org][Index]] #+INCLUDE: goback.org * The Verification Loop Writing retro software without an automated test loop is frustrating. You compile on modern Linux, but how do you verify that your PRC executes properly without transferring it to physical serial-cradle hardware every two minutes? Today, modern web-based and native emulators make cycle-accurate testing fast, scriptable, and headless. * Survey of Modern Palm OS Emulators | Emulator | Type | Best For | Screenshot / Automation Strategy | |----------|------|----------|-----------------------------------| | *CloudpilotEmu* | Web (WASM) | Zero-install, pixel-perfect web embedding | Embedded JavaScript API (~cloudpilot-emu-embedded~) | | *Mu* | Native (C++/Qt) | Fast desktop development, hardware peripheral emulation | Headless via ~Xvfb~ + ~scrot~ | | *POSE (Palm OS Emulator)* | Legacy Native | Historical reference (v3.5) | Requires older Linux 32-bit compatibility | * CloudpilotEmu: The Premier Modern Web Emulator CloudpilotEmu is an open-source, cycle-accurate Motorola 68000 and DragonBall emulator compiled to WebAssembly (WASM). It supports Palm OS 1.0 through 4.1 devices (PalmPilot, Palm III, Palm V, Palm m500, and Palm m515). ** The Embedded JavaScript API Rather than clicking manually through a web UI, CloudpilotEmu exports an embedded JavaScript library that allows full programmatic control: #+BEGIN_SRC html Palm OS Modern Test Harness

Palm OS Test Runner


#+END_SRC * Key Emulation Gotchas 1. *Internal Database Name vs. File Name (Pitfall #28)*: ~emu.launchByName()~ accepts the internal application database name embedded in the PRC header, not the file name on disk! To inspect the true DB name of any PRC: #+BEGIN_SRC bash strings MyApp.prc | head -n 5 # Output: # Gpp14Modern # applGP14 #+END_SRC If your file is named ~Hello.prc~ but was built with ~-n "Gpp14Modern"~, calling ~launchByName('Hello')~ will fail! 2. *Install Method Name (Pitfall #13)*: In modern CloudpilotEmu (v2.x+), the method is ~installDatabase(new Uint8Array(buf))~, NOT ~installDb()~. It is asynchronous (~await~). 3. *Canvas Pixelation CSS*: Because Palm OS renders at 160x160, modern high-DPI browser rendering applies bilinear smoothing by default, making fonts blurry. Always set: #+BEGIN_SRC css canvas { image-rendering: pixelated; image-rendering: crisp-edges; } #+END_SRC * Headless Testing with Native Emulators (Xvfb + scrot) If you use a native emulator like *Mu* on a headless CI server, drive it using an X Virtual Framebuffer: #+BEGIN_SRC bash # 1. Start Xvfb virtual display Xvfb :99 -screen 0 1024x768x24 & export DISPLAY=:99 # 2. Launch emulator with target ROM mu --rom palmM515.rom & EMU_PID=$! sleep 3 # 3. Capture screenshot of launcher scrot -z 01-boot.png # 4. Inject PRC via CLI or socket # ... sleep 2 scrot -z 02-app-running.png # Clean up kill $EMU_PID #+END_SRC Treat screenshots as primary regression-test artifacts in your repository! #+LF * Further Reading & Reference Resources - **Emulator Repositories & Modern Web Runtimes:** - CloudpilotEmu GitHub (Christian Speckner): https://github.com/spebern/cloudpilot-emu - Cloudpilot-emu-embedded NPM API: https://www.npmjs.com/package/cloudpilot-emu-embedded - Mu Palm OS Emulator (Dmitry Grinberg): https://github.com/dmitrygr/mu - **Historical Emulators & Debuggers:** - Palm OS Emulator (POSE) Historical Sourceforge Archive: https://sourceforge.net/projects/pilot-link/ - Dmitry Grinberg's rePalm & Hardware Architecture Analysis: https://dmitry.gr/?proj=27.+rePalm - **ROM Preservation:** - PalmDB Palm OS ROM Archive: https://palmdb.net/roms - Internet Archive Handheld Software Collection: https://archive.org/details/softwarelibrary_palm