Five reels, twenty lines and Santa, in 6303 machine code, on one 32K Datapak that plays on every Organiser II from the 8K CM to the LZ64. The credits are play money: nothing can be bought, sold or cashed. This report shows the screens as the emulator drew them, the game and its maths, how the program is put together, and where every byte goes.
The four-line LZ and LZ64 show five reels by four rows, the two-line CM, XP and LA five by two; the reels take every other column and the panel the rest. Every screen below is the emulator's own: the character in each cell and the eight defined characters at that moment, captured by tests/tour.js and drawn here dot for dot (letters in a dot font). Characters 0 to 3 hold the pictures (Mrs Claus, a reindeer, a bell, a house), 4 to 7 the stage: the spinning drums, the symbol landing, Santa himself.
The credits, bet, settings, statistics and random state are saved in A:SANSAV after every spin, before its animation starts, so switching off mid-show loses nothing.
| Symbol | 3 | 4 | 5 |
|---|
The pictured symbols are the game's own defined characters; the others are letters.
| Counted exactly from the strips | Four lines (LZ) | Two lines (CM) |
|---|---|---|
| Return to player | 95.732% | 95.726% |
| Santa lands | 1 spin in 8 | |
| Xmas Spins start | 1 spin in 62.3 | |
| Free spins a feature, on average | 13.5 | |
| 100,000 spins in the emulator (sampled) | 94.6% | 98.6% |
The spec gives each grid its own base strips. Counting every combination of stops gives its figures exactly, which confirmed the reading of its rules. The two sampled returns differ from the exact one by sampling error: one 233× win moves 100,000 spins by a few points.
The game is one 4,898-byte OPL integer array, the same on every model, holding 6303 machine code. The kernel stays; the screens, the effects, the scenes and their data wait on the pack and come into one shared region when they are needed.
What every cell should show (kv_under) against what the LCD shows (kv_shown). A frame sends only what changed, straight to the display controller, and the 8 defined characters from a shadow copy. Pictures (0-3) are only redrawn in place; the stage (4-7) moves.
A frame draws, then sounds for the rest of its length a tick (1/120 s) at a time; the drawing time, measured on the free-running counter since the last frame ended, is taken off. Frames keep time within 1% with sound on, soft or off.
A tone is a loop of 32 + 4S cycles: all 45 notes from E4 to C8 within 0.7% of pitch. On top: pulse width (bells that ring and die away; the Soft setting), slides, arpeggios, noise, clicks and vibrato. A tune has two parts, melody and bass (one byte a note each): while both sound the melody has two ticks in three and the bass one, the bass keeps quiet in the gap at the end of each melody note (so repeated notes sound apart), and the time the extra work takes is charged so the tune keeps time. A tune and an effect play together, the effect heard.
Scenes are data: scripts/*.scr, assembled by tools/script.py into blobs the resident script reader plays. Santa (5 by 16 dots) is drawn by the compositor into a moving window of the four stage characters, one dot at a time, with a one-dot halo, over whatever the cells show.
| Unit | Code | Data after it | What it does |
|---|
“Data after it”: what the overlay reads in just above its own code (the tune buffer, 80 bytes, counted in). Every overlay has relocation fix-ups stored with it on the pack.
Santa's delivery picks a style at random (or always the standard walk): walk, heavy sack, tiptoe, skip, ice, sledge, and the stretch goals' pogo stick, moonwalk, carried by a reindeer and parachute. Each has its four poses, footfall, tune and manner. With no house showing he looks both ways, shrugs and goes back.
Twelve carols (the jukebox plays any), three win fanfares and Auld Lang Syne for New Year, each with a bass line written for this game. The emulator has no buzzer, so the recordings below were made from the game's own sound engine by tools/sounds.js: the same notes and cycle counts, written to WAV.
Measured (tests/m_mem.js): the most padding with which SANTA still starts and plays on a blank 3.3-ROM CM is 1,122 bytes; an LZ has at least 2,000 to spare. The game itself runs short at 1,172 (m_mem2.js, with SANTA’s check made to pass): SANTA asks for 5,268 free (5,148 once A:SANSAV exists) and refuses cleanly 48 bytes before that.
And 256 bytes of variables outside it, in the launchers’ code that never runs again once the game has started, as Connect 4 and Reversi do: SANTAG’s code before its USR call, just below the array (its copy of the bootstrap string among it), holds the screen model and the number’s digits, 175 of 178 bytes; SANTA’s code before its call of SANTAG, just above, holds Santa’s pose and halo and the script stack (44 of 45), and its “NEEDS” message the wins and the 32-bit work (37 of 41). The start-up code checks that the launchers’ code that does run again is where the build put it (SPINS ERROR 3 if SANTAG is run by itself), and tests/t_hidden.js checks it on all 29 ROMs.
Region R holds one overlay, the data it reads in just after its code, and the playing tune in the top 121 bytes (HARK, the longest, with its bass). The spec planned a fixed overlay slot and a separate 600-byte scene buffer; sharing one region is smaller. Each walk style has its own small blob, and OV_SPINFX plays no tune, so needs no tune buffer. OV_WALK, with the tune buffer above it, sets the size.
Solid: code. Hatched: the data read in after it, and the tune buffer. The line is the region's end.
Three files: SANTA, SANTAG and SANK. SANK is the kernel block (the kernel, its fixer and fix-ups, read in one go) and then area B: an index of 71 items and every overlay, driver and data item, each found through the index. The spec's SANB0-3 became sections of this one file. There is room for 5,350 bytes more.
A pass through the whole program for RAM. Each change was checked by tests/t_trace.js: thousands of screens, frame by frame, against the first build’s, with the game’s results checked spin for spin as before.
| Before | After | How | |
|---|---|---|---|
| Kernel code | 3,380 | 2,990 | The script reader keeps only the 19 commands the scenes use, and they no longer return a carry; one byte a note; numbers by dividing by ten instead of a table of powers; the command table on the pack |
| Variables in the array | 579 | 276 | Dead ones gone; OV_GAME’s own in OV_GAME; the wins one byte a line; 256 bytes into the launchers’ code |
| Region R | 1,721 | 1,489 | OV_WALK read every style’s poses and effects (and five tunes it never used): now one small blob a style; OV_SPINFX needs no tune buffer |
| The array | 5,774 | 4,849 | |
| Spare on a blank CM | 246 | 1,172 |
Two-part music came afterwards and took 126 bytes back; a second, smaller round of cuts won 115 of them again (below): the array is 4,898 (after the title-tune fix and the AUTO marker, below) and a blank CM has 1,122 spare.
OV_WINFX’s line cells, characters and text buffer (21 bytes) were declared after the label where its line table is read in. Once one winning line had been shown, lines 1 to 5 read garbage rows and put wrote outside the screen, into the screen driver’s code. It showed most at Quick, so in autoplay, during the Xmas Spins.
A load between a flag test and its branch reset the zero flag, so in every walk style Santa threw with the tiptoe’s finger-to-lips pose. Now he throws properly, and hushes only on tiptoe.
Three cuts that change nothing seen or heard took 115 bytes off the kernel: the Xmas Spins’ set-up and counting moved into OV_GAME, each overlay call in the main loop became a short call and two bytes, the tone set-up’s three range clamps share one routine, and 15 short branches the assembler had quietly made long were brought back in range. Then new tests set out to break the game rather than confirm it, and found three bugs.
It counts down its switch-off time (5 minutes as it comes) and only the game’s key waits set that back. Autoplay, a long Xmas Spins or the snow run without one, so it switched off in the middle; on again the screen was blank, then garbled. Now every frame sets it back, and it switches off only in the game’s own wait, which redraws everything.
The 5-minute idle count lived in the rest screen’s own image, so each idle scene (every 80 s) started it again, and a CM left at rest would have run its batteries flat. The count is now kept over the scenes and the snow, and the snow ends by itself.
The doors are bits in the save, and nothing cleared them: after one December, no door opened again. The save now keeps the year they were opened in.
Heard on the first listen: the opening Jingle Bells was hard to recognise. Its repeated notes are told apart only by a silent tick at each note’s end, and the bass filled that silence. Now the bass keeps quiet there, the gap is 3 ticks on longer notes, and the melody has two ticks in three. And during autoplay the panel says AUTO through every spin, and the autoplay list (or the menu, after Spin) no longer leaves its letters between the reels while the spin plays. The winning line’s text (“LINE 12 +1234”) was longer than the panel and lost its last digits; it is now “L12 +120”, line left and pay right, as the other panel lines.
Damaged save files (a new player); settings out of range in a save whose sum agrees (now put right as read); credits from 0 to 4.29 billion (from a billion the panel shows the last 8 digits); the pack pulled out (back to the Organiser’s menu); slot C; EXE held for a minute (73 spins); no stray memory write in over an hour of random play.
All in a headless copy of the Jape emulator (tools/emu.js) driven from Node, against the real ROMs. node tests/run_all.js runs the main suite in a few minutes; the long ones run on their own.
| Test | What it shows | Result |
|---|---|---|
| t_linefast | The 6303's way to pay a line equals brute force | All 161,051 lines |
| t_game, t_long | OV_GAME against the JavaScript reference, spin for spin; stop chi-squared | 100,000 spins on each grid, 0 differences; chi-squared well under the 99.9% point on every reel |
| t_sound | Pitch of every note; frame lengths with each sound and setting | 45 notes within 0.7%; frames within 1% |
| t_walk, t_delivery | The compositor; Santa's delivery | pass |
| t_flow | Whole plays (a Santa spin, a feature, a win): the credits end right on both models | pass |
| t_save, t_auto, t_xmasday, t_stretch | The save file, autoplay, Christmas Day, the stretch goals | pass |
| t_skip | EXE at every moment of a play ends in the same state as no key | pass |
| t_stress | Random keys at random moments; credits shown equal credits at every rest | 20 minutes each, CM and LZ64 |
| t_roms | Starts, plays a spin with Santa, leaves cleanly | All 29 ROMs |
| m_mem, m_mem2 | The memory margin on the smallest machines | 1,122 B on a CM; ≥2,000 on an LZ |
| t_watch | Every memory write the game’s own code makes, during long random play with random settings: anything outside its own places reported with the instruction; the kernel and driver checked unchanged after every key | 15 to 20 minutes each on CM, XP, LZ, LZ64: none |
| t_break | Experiments: two Decembers of advent; damaged saves; credits from 0 to 4.29 billion; the pack pulled; idle until the Organiser switches off; long autoplay; slot C; the 250-spin cap against the reference; the tune buffer while tunes play; EXE held a minute | found the three bugs below; now all pass |
| t_trace | Every screen, frame by frame, of a set of plays (Full, Quick, Off; all ten walk styles; every scene; the menus) against another build’s, the cosmetic random bytes pinned | 6,080 screens (LZ64) and 4,837 (CM) the same as the first build’s |
| t_hidden | The variables in the launchers’ code: the code that runs again intact after play, leaving clean, starting again resumes | All 29 ROMs |
| Measured | |
|---|---|
| A spin at Full animation | about 2.5 s to the last reel; Santa's delivery about 4 s more |
| Frame rate | 8, 10, 12 or 15 a second (Glass speed); the spin's drums at 30 |
| Tunes | keep their tempo whatever the Glass speed; only animation frames scale |