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.

The background maps of all five stages, drawn from the game's own tables.

The maps

Every stage is a stack of rows of 16-pixel blocks

Each stage's background is a single map, and the game scrolls a window over it.

A stage's map is a list of rows, found through two tables of row addresses, one of low bytes $002A and one of high bytes $002C. Each byte of a row is a block number. A block is two characters wide and two high, 16 pixels square, and its number picks four characters from a table $002E, in the order upper left, upper right, lower left, and lower right. Each block also has a properties byte that the movement code reads $0030: bit 0 means solid, bit 1 harmful, and bits 2 and 3 slopes. In stage 1 the table holds 91 blocks, and the first three are plain black.

The rows of a stage are not all the same length, and most rows start part-way across the map. A row holds only the columns that its stage sections cover, and its address is set back by the row's first column, so the byte for column x is at the row address plus x. Drawn that way, every block number in stages 1, 2, and 5 lies inside the block table, and the stage 5 rows fill a map 121 blocks wide. The table below gives each stage's rows by length.

StageRowsRow lengths in blocks, top to bottomDrawn below
1 · Labyrinth of Caves5610 rows of 47, 8 of 25, 6 of 19, and 32 of 59yes
2 · Lake Neptune3410 rows of 155, 12 of 146, and 12 of 19yes
3 · Caverns of Fire879 rows of 41, 17 of 19, 15 of 55, 23 of 19, 3 of 36, 7 of 39, 2 of 85, 1 of 67, 9 of 87, and a last rowyes
4 · Ice Palace337 rows of 60, 11 of 95, 2 of 120, 11 of 102, 1 of 89, and a last rowyes
5 · Dark Jungle7610 rows of 63, 46 of 19, 9 of 63, and 11 of 121yes

In stages 3 and 4 the first rows start inside the block table, so a few cells at the top of the map hold bytes that are not block numbers: 4 cells in stage 3 and 24 in stage 4. They are left blank. The number of rows comes from the length of the row address table, and a row's length from the gap between its address and the next one. The length of the last row is not known in stages 3 and 4, and the picture gives it the length of the row above.

Stage 1

Labyrinth of Caves

The background map of stage 1, Labyrinth of Caves, 59 blocks wide and 56 high

The background of stage 1, 59 blocks wide and 56 high, 944 by 896 pixels. Dark grey marks places no row covers. Enemies, items, and the player are not part of the map. The three shared colours are the ones the game sets for the stage playfield.

Stage 2

Lake Neptune

The background map of stage 2, Lake Neptune, 155 blocks wide and 34 high

The background of stage 2, 155 blocks wide and 34 high, 2480 by 544 pixels. Dark grey marks places no row covers. Enemies, items, and the player are not part of the map. The three shared colours are the ones the game sets for the stage playfield.

Stage 3

Caverns of Fire

The background map of stage 3, Caverns of Fire, 87 blocks wide and 87 high

The background of stage 3, 87 blocks wide and 87 high, 1392 by 1392 pixels. Dark grey marks places no row covers. Enemies, items, and the player are not part of the map. The three shared colours are the ones the game sets for the stage playfield.

Stage 4

Ice Palace

The background map of stage 4, Ice Palace, 120 blocks wide and 33 high

The background of stage 4, 120 blocks wide and 33 high, 1920 by 528 pixels. Dark grey marks places no row covers. Enemies, items, and the player are not part of the map. The three shared colours are the ones the game sets for the stage playfield.

Stage 5

Dark Jungle

The background map of stage 5, Dark Jungle, 121 blocks wide and 76 high

The background of stage 5, 121 blocks wide and 76 high, 1936 by 1216 pixels. Dark grey marks places no row covers. Enemies, items, and the player are not part of the map. The three shared colours are the ones the game sets for the stage playfield.