Search › A-Z › J › Jape (Psion Organiser II)
Jape (Psion Organiser II)
Jape (Javascript Psion Emulator) by Jaap Scherphuis runs a Psion Organiser II entirely in the web browser, having been rewritten from an earlier Java applet. It emulates the CM/XP two-line models and the LZ/LZ64 four-line models, supports state snapshots and can load .opk memory-pack images.
Runs on: Web browser
Jape (Psion Organiser II) Online Emulator
Play Jape (Psion Organiser II) using JavaScript directly in your browser.
Controls
Configurations
| Configuration | Emulator | Machine | OS | Legal | |
|---|---|---|---|---|---|
| Psion Organiser II (XP) | Jape (Psion Organiser II) | Psion Organiser II | grey | Open ⛶ |
Machines emulated
Chips
Notes
Embedding
Jape is a set of plain-global JavaScript modules with no bundler. Vendor the whole src/** tree (the nine scripts, the system ROM under roms/, the device images under images/ and the flash-file driver other/fdrive19.bin) and load the scripts in dependency order. Build the machine with new Psion(canvasId), then choose a model and reset:
var psion = new Psion("screen");
psion.reset({ // XP (32K), English Rom 3.6
rom: J+"roms/36-la.rom", ram: 32, screen: 2,
keyboard: KeyboardLayout.Normal,
screenImage: J+"images/disp_2xp.gif",
keyboardImage: J+"images/keyb_norm.gif",
coverImage: J+"images/cover_org2.gif"
});
Booting. The Organiser starts switched off. It powers on the way the real machine does: hold the ON/CLEAR key and let an output-compare interrupt fire, and the semi-custom chip calls switchOn(), which resets the HD6303 to the ROM vector and boots to the menu. Our loop presses ON at startup and releases it once bus.isSwitchedOff() clears.
We own the loop. Instead of psion.startRunning() (an internal real-time loop we cannot step), we call the HD6303 ourselves. Asset paths are made absolute through a global window.JAPE_BASE so the ROM and image requests resolve from the emulator folder rather than the play page.
| Member | Kind | What it does |
|---|---|---|
cpu.execute(ticks) | method | Run the HD6303 for a budget of clock ticks. execute(1) runs exactly one instruction, our single-step primitive. |
cpu.dbgRegs() | method | Live registers A, B, D, X, PC, SP, the P byte and the six condition flags. |
cpu.dbgSetReg(name,v) | method | Write a register back from the debugger. |
memory.read(a) | method | Side-effect-free bus read: RAM below $8000, banked ROM above. Feeds the hex and disassembly views. |
bus.write(a,v) | method | The CPU write path; we wrap it to implement write watchpoints. |
psion.paint() | method | Redraw the device shell and the live LCD onto the canvas after each frame or step. |
The registers, memory and single-step are the only hooks the debugger needs, and they are added as a small dbg* shim on the vendored HD6303 and Psion objects.
Debugger integration
The machine plug-in jape-psion-debug.js reads window.EMU_BOOT and calls EmuKit.defineMachine with the transport, the HD6303 register set and one 64 KB address-space view disassembled by the hd6301 decoder.
A new CPU decoder. The HD6301/6303 is a Motorola 6800-family part, so none of the existing decoders fit. /debugger/src/cpus/hd6301.js adds a flat opcode table for the 6801 set plus the 6303 extras: the read-modify-write immediates AIM, OIM, EIM and TIM, plus XGDX and SLP. It handles the inherent, immediate (8 and 16 bit, big-endian), direct, extended, indexed and relative modes, and prints unknown bytes as .byte.
EmuKit.registerDecoder('hd6301', function(read, addr){
var op = read(addr) & 0xff, e = M[op];
if (!e) return { length: 1, mnem: '.byte', text: '.byte