Game State

TransBot maintains a master "game state" variable in the low 4 bits of the byte at $c003. The valid values are:

Value

State

0

Value immediately changed to 1

1

Title Screen

2

Demo

3

Secret Command

4

Gameplay

5

The End

For some states, bit 6 of the same byte is used to distinguish a change of state (bit 6 reset) from a continuation of the current state (bit 6 set).

Graphics Compression

TransBot and Astro Flash use the "Phantasy Star" RLE compression format for tiles and name table data. While this method usually involves deinterleaving tile data into four blocks, TransBot achieves a better compression ratio for the sprite tiles by using only two.

The decompression routine is located at an offset of $295a in the TransBot ROM ($28f7 in Astro Flash). It takes the address of the compressed data in the IX register and the number of data blocks to decompress & interleave in E. The decompressed data is always written to RAM, starting at address $d000 - data is only copied to VRAM after decompression is complete.

The TransBot and Astro Flash ROMs contain the following data in RLE format:

In total, TransBot uses this format to compress 18536 bytes into 13996, an overall compression ratio of 75.5%. Astro Flash achieves a similar ratio of 75.7%, compressing 19888 bytes into 15050.

Master System Logo Screen

Astro Flash shows a "Sega Mark III" logo screen before its title screen. As shipped, TransBot does not show a logo screen, but the code for one is still present - it has simply been bypassed with a jump.

Patching the ROM to prevent the code being bypassed (ROM[$0275] = 00) causes the screen to be shown:

The text is stored as uncompressed 1bpp data in the ROM, at offset $43f0. The associated name table data is stored immediately before the tile data, at offset $438c.

Displaying the logo is simply a matter of copying both sets of data from the ROM to VRAM. This is actually simpler than the method used by Astro Flash to display its logo screen, since its "Sega Mark III" data (both name table entries and tiles) must be decompressed before use.

Palettes

TransBot and Astro Flash use a single palette for all gameplay, both overground and underground. The only places where different palettes are used are the "Sega Mark III"/"MASTER SYSTEM" logo screen and the title screens.

Main Palette

The 32 bytes of data defining the main TransBot / Astro Flash palette begin at offset $0003 in both ROMs. The colours in the main palette are:

Index

$00

$01

$02

$03

$04

$05

$06

$07

$08

$09

$0a

$0b

$0c

$0d

$0e

$0f

Value

$00

$15

$1a

$1f

$2f

$2a

$25

$35

$3a

$3f

$13

$17

$12

$22

$32

$00

Index

$10

$11

$12

$13

$14

$15

$16

$17

$18

$19

$1a

$1b

$1c

$1d

$1e

$1f

Value

$00

$3f

$3a

$35

$2f

$2a

$25

$0b

$03

$02

$0e

$0c

$08

$3e

$38

$00

Other Palettes

These are the other palettes used by TransBot / Astro Flash. Palette entries beyond those shown are not explicitly set by the code and thus retain their values from the main palette:

Logo Screen

Index

$00

$01

Value

$00

$0f

TransBot Title Screen

Index

$00

$01

$02

$03

$04

$05

$06

$07

$08

$09

$0a

$0b

$0c

$0d

$0e

$0f

$10

Value

$30

$3f

$2f

$1b

$17

$13

$3e

$10

$3f

$3f

$3f

$3f

$3f

$3f

$3f

$3f

$30

Astro Flash Title Screen

Index

$00

$01

$02

$03

$04

$05

$06

$07

Value

$00

$3f

$2f

$0f

$0b

$07

$03

$02

The logo screen palette data exists in the TransBot ROM at an offset of $26a7 and in the Astro Flash ROM at $263c. The TransBot / Astro Flash title screen palette data can be found at offsets of $030c and $02f2 respectively.

Note that although the TransBot title screen does not use the sprite palette, its first entry (palette index $10) is written. This is done to set the backdrop colour, which is displayed in the overscan area and when the display is blanked.

Movement

The high-performance CA-214 astro-plane can fly a speed of up to 170 pixels per second (relative to the screen). That is: while a direction is held on the controller, the CA-214 sprite will move a distance of 2 pixels in that direction per frame. Holding a diagonal direction will cause the sprite to move 2 pixels horizontally and 2 pixels vertically each frame.

The overground backdrop and underground scroll at a rate of 1 pixel per frame. A parallax effect is created on the overground level by scrolling the ground by 2 pixels each frame. The change in scroll values is triggered by a line interrupt.

Demo

If no buttons are pressed on the title screen, a demo of the underground level will begin. The CA-214's movements during the demo are driven by simulated input - the data for this is in "TransBot" format and is located at $7aba-$7cd4 in the TransBot ROM. The same data exists at $7d81-$7f9b in the Astro Flash ROM - in both cases a pointer to the data can be found at offset $0088.

Enemy Generation

During play, the game repeatedly loops through one of two enemy pointer tables: $7729-$7868 for the overground level and $7869-$78c8 for underground. When it is time to generate the next wave of enemies, the current pointer is followed - it points to a description of a group of enemies. All of these descriptions are within the address range $78c9-$7ab9. The format of each description is as follows:

The pointed-to description is processed to generate the types of a maximum of 7 enemies - these are stored in RAM at $c17a-c180. The types are later used to index into a jump table at $2fd0-$3073 - specific code can thus be executed for each enemy type.

Secret Command

The status of commands 1-4 on the Secret Command screen is stored in bits 0-3 of the RAM byte at address $c012. The byte is copied to $c100 when play starts - this copy of the command status is then read repeatedly during the game.

TransBot "Pre-Release"

After Elgramzon is destroyed, several variables are set in order to ensure that no sprites are displayed for a short time (by setting the first Y coordinate in the sprite attribute table to $d0). This has the side effect that the CA-214 reverts to weapon A, although the status bar continues to show the previous weapon.

If the player fails to survive the very first wave of enemies, the production game repeats the first wave rather than advancing to the second.

The final ROM has a ret instruction at the end of the function which handles the game state changing to "Demo".

These are the only differences between the pre-release and production versions.