This document describes the data structures used by Atari's Tempest. The latest version of this document should be available from the TempEd site at http://www.thundercross.freeserve.co.uk The information required is contained in the ROM file '136002.118'. TempEd uses the following C structure: typedef unsigned char uint8; // Byte type typedef struct uint8
remap[16]; The data is stored at an offset of 380 into the 2K ROM file, i.e. : ...
x : the x-coordinates of the points in the level. x[L][P] is the
x-coordinate of point P of level L. x & y are in the range 0-255. angle : the angles of the sectors in the level. angle[L][S] is the angle of sector S of level L. angle is in the range 0-15 (representing 0-360
degrees). remap : the order of the levels as encountered in the game. remap is in the range 0-15 (representing levels
1-16). scale : the scale of the levels, or more accurately one-over the scale since small values give big levels. scale is in the range 1-255, although 10-28 is the range of the original levels. y3d : the 3D y-offset, or 'camera height' for the levels. y3d is in the range 0-255. y2d : 'Low' byte of 2D y-offset. y2d is in the range 0-255. y2db is (usually) in the
range -2 to +2. yoffset = LevelData->y2db[L]*256 + LevelData->y2d[L]; open : open / closed status of the levels. open is either 255 or 0. fscale : 'Low' byte of flipper scale. The 'flipper scale' is the value used to scale the
flippers when they are in the act of flipping. When flippers are lying
fully in a sector, they take their shape from that sector's co-ordinates.
Like the level scale, small values mean big flippers. fs = LevelData->fscale2[L]*128 + LevelData->fscale[L]; TempEd calculates this value based on the average sector width of the level (actually, one-over the average width). Text messages are stored in the ROM file '136002.121', starting from an offset of 350. The string format is odd. The last character in a string is signified by having its topmost bit set. This allows strings to be stored with no terminating characters between them, although Tempest makes no use of this. The remaining bits should be divided by 2 - presumably the game uses them to index into a table of 2-byte values. 0 represents 'space', 1-10 represent the digits '0' to '9', 11-36 represent 'A' to 'Z', 38 is '-', 39 is '1/2' and 40 is the copyright symbol. 37 is unused, and appears as 'space'. Tempest uses a colour table to decide the colours for
the level, player and enemies for a given 'cycle' (ie. set of 16 levels).
Cycle 1 is the blue levels, cycle 2 the red levels etc. The table is
contained in the ROM file '136002.119', at an offset of 509 bytes. The
colours are stored in the following order : bullets (also explosions and
'AVOID SPIKES' message), claw (player), tankers, flippers, pulsars,
spikers (also score), level, info (level number & 'SUPERZAPPER
RECHARGE' message). The values are repeated for the 6 cycles, giving a
table of 48 bytes. |