1991 · Ocean Software

Toki

This minisite was contributed by air, unorig. It’s currently claimed by unorig who is editing it to reach a Gold tier standard.

Ocean's conversion of TAD Corporation's 1989 arcade platformer, in which a warrior turned into an ape spits fireballs to rescue his captured love. On the C64 it shipped as a 128 KB cartridge, and the game treats that cartridge as a library it copies from rather than a program it runs.

01 · The cartridge

Sixteen banks behind one window

The cartridge holds 128 KB in sixteen 8 KB banks, and the C64 sees one bank at a time at $8000. Switching on starts bank 0, and by the time the game's first routine in RAM runs $51FB, most of the program has been copied out of the cartridge. During play the game keeps the cartridge out of sight and runs entirely from RAM, including a copy of bank 3 at $8000.

When it needs something from the cartridge, a short routine in the stack page brings bank 0 back, looks the item up in a directory of eight-byte entries, switches to the bank that holds it, and copies it into place $011F. The stage names, GAME OVER, and STAGE CLEAR never reach RAM: they stay in bank 0.

Each directory entry names a bank, where to read in it, where to write in RAM, and how many bytes, and one flag bit decides whether the copy writes into the I/O chips or into the RAM beneath them $0153. Only one entry sets that bit: 120 bytes of colours for colour RAM at $DB48. Switching on copies the first six entries $0100, which lay banks 1 to 4 end to end from $4000 to $BD6B and put two pieces of bank 0 low in memory, then jumps into the copy of bank 3 at $8000 $0118. The last fifteen entries come in five sets of three, each filling $C000, $BD76, and $0C01, one set for each of the five stages.

Starting a stage looks up where its set begins in a five-byte table in bank 0, one byte per stage $0B08, and copies entries from there until it reaches one marked as packed $0A9B. The second flag bit marks that packed entry, 2.2 to 3.3 KB copied to $0C01, and the copy hands it to an unpacker in bank 0 $8DA2. The unpacker works backwards from the end of the data and expands each stage in place to between 5.3 and 7.1 KB, filling $0C01 upward. None of a stage's block is code: the routines that run each of the game's objects read from tables in it, so each stage carries its own data for them $A23D. The same unpacker runs at power-on, where four entries from three banks make one packed block that grows to 14.5 KB at $0C01 $5240. Each stage overwrites that block. Two more entries follow, the same for every stage $0B11. The stage number that picks the set starts at 0 for a new game and goes up by one as each stage ends $81B1.

02 · Timing

A frame driven by an NMI

A CIA timer set to one PAL frame raises an NMI every frame $4D1D, and the NMI sets up a raster interrupt for the top of the status panel $837E. That interrupt picks a display mode the VIC-II shows as black, and behind those eight black lines it switches to the panel's own video bank, character set, and colours. A second interrupt turns the black mode off, and the panel appears $BCE1. The main loop runs the game's updates once a frame $80F9 and spends its spare time waiting for the next one $819B.

03 · Screens

From title to stage 1

Toki title screen, the logo over a volcano and jungle

Title. Fire on joystick port 2 moves on.

Stage card reading Stage 1, Labyrinth of Caves, with SFX and Music choices

Stage card. Each stage has a name, and the player picks sound effects or music. The game stores five names: Labyrinth of Caves, Lake Neptune, Caverns of Fire, Ice Palace, and Dark Jungle.

Toki standing in the jungle at the start of stage 1, with the status bar below

Stage 1. The timer starts at 4:30.

04 · The frame

Ten updates, in a fixed order

Each frame the main loop calls ten routines one after another $80F9. The player moves after the objects, the view window is worked out from the player's new position, and the sprite tables are filled just before the background strip for the next scroll step is drawn.

StepWhat it does
Stage objects $A178Runs the enemies and other stage objects, each through the handler its stage table names.
Short-lived objects $8434Runs a pool of nine objects that come and go.
Player $8572Reads the joysticks, moves Toki, fires, and ends by finding which stage section he is in.
View window $427DTurns the scroll position into the visible part of the stage in pixels.
Player effect $B8CFCounts down a timed effect on the player and makes the sprite flash near its end.
Player sprites $9F42Puts the player's first two sprites into the list of sprites to draw.
Hits $A3BFDraws the objects and tests each against the player's boxes.
Third sprite $A0A4Puts the player's third sprite straight into the first hardware sprite slot.
Sprite tables $951ASorts the list into the hardware sprite tables, top to bottom.
Scroll edge $5B83Draws the strip of background that the next scroll step will bring into view.

Scrolling follows a zone

Every stage is cut into sections, and each section has a record that says how the view behaves there $92DF. In one setting the view follows the player: while he stays inside a zone the view holds still, and when he leaves it the view scrolls two pixels a frame toward that side $470C. Two other settings in the record make the view move by itself, horizontally or vertically, until it meets the section's limit, and then follow the player along the other axis.

A stage skip behind two joysticks

The player routine also tests for a joystick combination that no player would press by accident $8572. The Discoveries tab says what it does.

05 · The release

An arcade game on a cartridge, and the only one Ocean made for 8-bit

TAD Corporation made Toki for the arcades in 1989.1 Ocean Software published the Commodore 64 version in 1991, on a cartridge only, alongside versions for the Amiga and Atari ST.1 The C64 version was the only 8-bit computer version Ocean released, and it leaves out the arcade's full intro, one of its music tracks, and one of its levels.3 The cartridge itself stores five stage names.

The manual credits the program to Al Dukes, the graphics to Mike Clayton, Joff Scarcliffe, and William Harbison, and the music and effects to Keith Tinman.2

Zzap!64: "a fun little conversion"

Zzap!64 reviewed the cartridge in issue 80, January 1992, at £14.99.4 Stuart Wynne and Phil King gave it 82 %: presentation 70 %, graphics 79 %, sound 74 %, hookability 83 %, and lastability 81 %. Wynne's complaint was "Turricanitis": the game offers little over Turrican and cannot compare in size or graphics, and he found the main sprite "rather splodgy". King agreed the graphics were a little blurred, with the odd glitch on big villains, and still found it playable, because the arcade layout switches from horizontal to vertical scrolling and mixes in swimming sections, so "you never know what's at the end of the next screen". Both liked that the cartridge needs no multiload.

Commodore Force: "a fair and lasting romp"

Commodore Force covered the game in the Round-Up of issue 5, May 1993, and gave it a Force Factor of 79 %.5 The reviewer saw another macho hunk turned into a primate, called the graphics "a little basic", and praised the many and varied villains and the levels that must be tackled in different ways, some scrolling vertically and others horizontally. The scan ends mid-sentence, at "a fair and lasting romp is on offer for fans of the".

Commodore Power: "probably worth a go for most people"

Commodore Power reviewed the cartridge at £14.99, with Richard Taylor writing, and gave it a Danger Rating of 73 %: graphics 7, sonics 6, half-life 8, and fix factor 7, each out of 10.6 Taylor liked the control, which lets the player move in mid-jump, and the five levels, each quite large and needing no loading because the game is on a cartridge. His complaint was that once the levels have been sussed they become quite easy, because everything is in the same place. The graphics and sound "aren't outstanding", but it all works well together, and with the new cartridge price the game is "probably worth a go for most people".