Another World on KN5000

A port of Eric Chahi's Another World bytecode VM to the Technics KN5000 arranger keyboard.
Made possible by the ongoing reverse engineering efforts documented at arqueologiadigital.org/KN5000-docs.
github.com/felipesanches/kn5000-anotherworld

Screenshots

Running in MAME 0.285 with the KN5000 driver.

Lester in the lab
The laboratory — particle accelerator experiment
Ferrari cutscene
Opening cutscene — arriving at the lab
Lester walking
Lester walking — polygon zoom rendering

Hardware

Target CPU
TMP94C241F (TLCS-900/H2) @ 16 MHz
Display
MN89304 VGA LCD controller, 320x240 @ 8bpp
Assembler
ASL Macro Assembler (cpu 96c141)
VM origin
Big-endian Amiga/68k bytecode on little-endian TLCS-900
Status
Playable: all 10 game parts, input via SC1 serial, help/pause screen with level codes. Sound stubbed.

Plans & Design Documents

Plan
Polygon Rendering Fix
Fix drawLine off-by-one, fillPolygon overflow, and drawPoint corruption that caused blank screens.
Plan
Zoom Rendering Fix
Fix case 2/3 opcode handling and 16-bit zoom truncation causing Lester to shrink/grow incorrectly.
Plan
Timer-Based Frame Timing
Replace busy-wait loop with T0/T1 cascade timer, prescaler fix, and overrun detection.
Reference
Timer Configuration Details
Hardware timer setup, MAME vs datasheet differences, prescaler divisions, ISR design.

Code Reviews

Review
VM Opcodes vs MAME HLE
Feb 9 — Systematic comparison of all opcodes against the reference MAME HLE implementation. Found 20 issues.
Review
Polygon Rendering Glitches
Feb 10 — Deep review of drawPoint, fillPolygon, readVertices, calcStep against Fabien Sanglard's reference.
Review
Grey Screen Investigation
Feb 10 — Discovered the grey screen was correct behavior (4-bit DAC). Led to palette and rendering fixes.
Review
Serial CPanel Protocol Compatibility
Feb 11 — Found 3 critical bugs in MAME serial/cpanel emulation preventing button input. Timer, queue, and timing fixes.

Development Log

Full conversation transcripts from all Claude Code sessions, rendered as a browsable viewer.

Viewer
Conversation Log Viewer
Development sessions covering the full journey from initial setup through playable game. Includes tool calls, thinking traces, and all user/assistant messages verbatim.

Commit Timeline

Feb 9, 2026
Initial commit: KN5000 Hello World custom boot ROM
6caf1d1
Feb 9
Add MAME ROM set generation, VGA refactor, interrupt vector table
Feb 9
Fix VGA_Setup, font lookup, boot hexdump display
Feb 9
Set up Another World VM project with dual-target build
3458463 + b7cb21a
Feb 9
Add asset build pipeline for bitmap resources
496159e
Feb 9
Fix all 20 VM issues from code review
1679d39
Feb 10
Fix palette, polygon raster, thread init, DRAM layout
eac6f81
Feb 10
Fix GET_PAGE_PTR, SETUP_PALETTE index extraction, palette 0 black screen
fe3b36f .. 45ef21a
Feb 10
Fix palette colors: MN89304 DAC is 4-bit, not 6-bit
a8a13ec
Feb 10
Fix polygon rendering: drawLine, fillPolygon, drawPoint
6dd5c62 + 4565a8c
Feb 10
Add timer-based frame timing with prescaler fix
558e3d5
Feb 10
Fix polygon zoom: 16-bit zoom, case 2/3 opcode handling
3d65a8e
Feb 10
Fix VM freeze in text scenes: save/restore XIX in DRAW_STRING
bd01da6
Feb 10
Entire intro plays perfectly
Feb 11
Add splash screens: start from Part 0 logo/credits before intro
4e361b4
Feb 11
Fix freeze after death, part switching, ByteKiller decompression
acd047c .. c33fb99
Feb 11
Implement input via SC1 serial to control panel; fix 3 MAME serial bugs
Feb 12
Fix SC1MOD regression: baud rate generator instead of TO2 trigger
009c54f
Feb 12
Fix jump: JUMP_DOWN must reflect UP button per reference logic
6af0a7e
Feb 12
Add MAME driver architecture documentation (5 files)
c9be971
Feb 12
Fix thread freeze/unfreeze, bitmap rendering (RL not RLC), remove diagnostics
7ea0236 .. 4581528
Feb 12
Add all 12 screen bitmap resources for complete game
d565a2a
Feb 12
Map OTHER PARTS/TR to password screen, bypass copy protection check
0944369 + 97013e2
Feb 12
Fix DOWN input for password screen
6ec667f
Feb 12
Add HELP pause screen: 3-page overlay with controls, all 15 level codes, and credits
46892a3 + 956a257

Next Steps

The game is fully playable with all 10 parts. Remaining work is sound and real hardware testing.

Input handling
Done
Directions (UP/DOWN/LEFT/RIGHT) and ACTION mapped to KN5000 control panel buttons via SC1 serial polling. MAME serial bugs fixed (idle transition, dummy byte filter, SC1MOD clock source). See compatibility report.
Help / pause screen
Done
HELP button pauses VM and displays a 3-page overlay: control mappings, all 15 level codes, and project credits. PAGE UP/DOWN navigates; EXIT or any game button resumes. Draws to offscreen buffer to preserve game frame.
Part switching & resources
Done
All 10 game parts (protection, intro, water, jail, citadel, battle, arena, final, password x2) with full resources extracted and included. Copy protection bypassed for all parts. 12 screen bitmap resources included.
Sound & music
Stub
Opcodes 0x18 (playSound) and 0x1A (playMusic) consume their bytecode arguments but produce no output. The KN5000 sound hardware (sub CPU + DSP) is not yet understood well enough to drive it directly.
Real hardware testing
Todo
All development has been in MAME. The extension board target builds but hasn't been tested on a real KN5000. Timer prescaler behavior and INC instruction encoding may differ.