Sega Master System / Mark III / Game Gear
TransBot maintains a master "game state" variable in the low 4 bits of the byte at $c003. The valid values are:
|0||Value immediately changed to 1|
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).
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:
|TransBot Logo Tiles||N/A||4||955||1664||57.4%|
|TransBot Logo Name Table ||N/A||2||72||136||52.9%|
|Astro Flash Logo Tiles||N/A||4||1734||2656||65.3%|
|Astro Flash Logo Name Table||N/A||2||106||196||54.1%|
|Sega Mark III Logo||N/A||4||241||300||80.3%|
|Level Name Tables ||2||1297||2400||54.0%|
|Background Tiles 1||4||1983||3072||64.6%|
|Background Tiles 2||4||2016||3072||65.6%|
|Sprite Tiles 1||2||2911||3072||94.8%|
|Sprite Tiles 2||2||2553||2560||99.7%|
|Sprite Tiles 3||2||2209||2560||86.3%|
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.
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.
TransBot contains unusual data for the logo screen: instead of the common "Sega Mark III", the text "MASTER SYSTEM" is present. This text is exactly the same as that used in the M404 Prototype BIOS, and can also be found within a few other ROMs.
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.
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.
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:
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:
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.
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.
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.
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:
%00---nnn tt tt tt...n possibly different enemies, types follow
%01mmm--- ssm identical enemies, type ss
%10mmmnnn ss tt tt tt...m identical enemies, type ss, then n possibly different enemies, types follow
%11---nnn ttn identical enemies, type tt 
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.
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.
This table summarises the contents of the TransBot (Size: 32KB; CRC32: 4bc42857) and Astro Flash (Size: 32KB; CRC32: c795182d) ROMs:
|Initial Data for VDP Registers 0-9|
|Code: Pause Handler|
|Initialisers for Demo Variables (At |
|Title Screen Palette|
|Logo Screen Palette|
|PSG Silencing Data|
|PSG Tone Table|
|N/A||TransBot Logo Tiles|
|N/A||TransBot Logo Name Table|
|N/A||Astro Flash Logo Tiles|
|N/A||Astro Flash Logo Name Table|
|N/A||Master System Logo Name Table|
|N/A||Master System Logo Tiles|
|N/A||Sega Mark III Logo|
|Level Name Tables|
|Background Tiles 1|
|Background Tiles 2|
|Sprite Tiles 1|
|Sprite Tiles 2|
|Sprite Tiles 3|
|Overground Enemy Pointer Table|
|Underground Enemy Pointer Table|
|Enemy Group Descriptions|
|Demo Simulated Input Data|
|N/A||ROM Header (Product Code: 4004; Version: 0; Region: SMS Export; ROM Size: 32KB)|
|N/A||Partial ROM Header (Product Code: 503; Version: 0; Region: SMS Japan; ROM Size: 32KB)|
Within areas marked "Unknown" in the ROM map, the following jump tables exist:
|23||Sound Track Number|
|15||Sound Coordination Flag|
The pre-release version of TransBot is missing several pieces of code which were added for the final version:
retinstruction 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.
Astro Flash does not contain any of these pieces of code.
Researched by Paul Baker