1982 · Commodore

Clowns

This minisite was contributed by air, Nico-van-der-Zijden. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/clowns with me to Gold.

The whole game, ported to JavaScript routine by routine and run on the cartridge's own bytes, with the mouse as the paddle.

01 · Play

Play Clowns with the mouse as the paddle

Move the mouse across the screen to slide the see-saw. Click, or press Space, for the paddle's button.

The game as the port runs it. On the title screen, click or press F1 (or 1) for the menu, then F1 for one player or F3 (or 2) for two; both players turn the same mouse. The see-saw's raised end has to be under the falling clown. The keys 1 and 2 stand for F1 and F3, which a browser keeps for itself; the arrow keys move the see-saw too.

02 · The port

Every tick checked against the cartridge's own code

Nothing on this page emulates a 6502. The game is written out in JavaScript, one function for each routine of the listing: the compiled program's procedures (the title, the menu, a game, a jump, the flight, the collisions and the bonuses) and the machine-code library under them (drawing the clown and testing its pixels, scrolling the balloons, the see-saw, the status line, the tunes and the effects). It runs on the game's own 64 KB, loaded from the bytes the Source code tab shows, and keeps every variable where the game keeps it.

test_play.js runs the port beside the cartridge's own code on the kit's model of the C64, from the reset vector on, with the same input: the title's demonstration, a one-player game steered by a program that keeps the see-saw under the clown until the game is over, then a two-player game. At every tick, where the game restarts its timer ($F717), the two memories are compared, and so are colour RAM and every register written to the video chip and the SID. Left out are the compiled program's own workings, which the port passes as JavaScript values instead: the runtime's scratch bytes at $02-$10 and the frames of its software stack from $0244.

The page keeps the C64's pace by keeping its clock. Each tick costs what it cost the game on the kit's machine, measured per loop: a tick of flight, of the run along a platform, of a tune, of the demonstration. The screen is drawn from the port's memory sixty times a second by the site's model of the video chip, with the cartridge's top 4 KB in the chip's view, as an Ultimax cartridge has it.