1984 Β· Mastertronic

Chiller

This minisite was curated by unorig, air.

Play the full game in your browser, start on any screen, and see how this port was checked against the C64 original.

Loading the game's bytes…
Start on
Cheats
  • ← β†’ or Z C walk
  • ↑, Space or Shift jump
  • ? or / swap to the girl and back, on the way home
  • Any key or Space after GAME OVER starts again

The game's own screen, drawn from the port's memory each frame as the video chip would draw it. Start on begins a new game and takes it to that level the way the game gets there, finishing each level before it in turn with its crosses taken, so the way home finds the five levels as play leaves them. The cheats work on the game's own routines: with Endless energy the routine that takes a step off the energy bar takes nothing, and with Ghosts don't hurt a ghost's touch adds no poison. Skip this level does what taking the last cross does.

01 Β· The port

Every routine of the game, checked against the original

Nothing on this page emulates a 6502. The game's 188 routines are written out in JavaScript, one function each, named by the listing's labels, and run on the game's own 64 KB of memory.

The page loads that memory from the listing, the same bytes the Source code tab shows. From then on the port reads and writes the game's variables where the game keeps them, draws the levels from the game's own maps, plays the game's own tunes and puts its sprites where the game puts them. The picture is drawn from that memory as the video chip would draw it.

How it was checked

Each routine was first checked alone against the game's code, run in a 6502 simulator: two to four thousand random starting states each, with every instruction the routine can reach reached at least once. Then the whole port ran beside the original, from 366 moments of play saved on all ten levels, with the same random joystick. At the start of every pass of the main loop all 64 KB are compared, and so are colour RAM and the registers the game writes to the video and sound chips. Only the stack is left out.

SessionsPassesResult
366 sessions of up to 5,000 passes, 31 to 40 on each level, through deaths, crosses taken, the cards between levels and the game over1,739,834identical at every pass in 357; the other 9 left in step at the same interrupt race (below)

A session that reaches the game over ends there, because the random joystick only changes at a pass and the game over waits for fire. The 34 moments that were saved during that wait were left out, since the port starts a session at the main loop.

Where the original depends on its interrupt

The music and the keyboard scan run 60 times a second from a timer interrupt, which on the C64 can fall between any two of the game's instructions. The port runs it between its own steps. Where that changes what the game reads, the check gives the port what the game's code read.

Speed

The game runs about fifteen passes of its main loop a frame, so a port that ran as fast as the browser can would be a different game. The page keeps a PAL machine's clock, 312 lines of 63 cycles, and each routine the port calls moves it on by that routine's own cycles. The costs were fitted by least squares on the game's timings in 46 of the sessions above, over a million stretches of code between two points of the main loop. On 46 other sessions the fitted cycles came to within 0.14 % of the game's. The interrupt's own time, 1,197 cycles on average, is added where it falls.

From a new game, 400 framesPasses, originalPasses, this page
The forest, standing6,1796,148
The cinema, walking right5,5085,502
The graveyard, walking left6,0576,078
The house, going home, walking right5,9486,099
The forest, going home, standing6,2316,155

Over all ten levels, standing still and walking either way, the page's count of passes is within 4 % of the original's.

02 Β· Differences

What differs from a C64