|
DevelopmentSega Master System / Mark III / Game Gear |
Home - Forums - Games - Scans - Maps - Cheats - Credits |
No Mapping Flat Code in $0000 - $34d4 / $3471 (TransBot / Astro Flash) [1]
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).
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:
Data | TransBot Address Range | Astro Flash Address Range | Deinterleaved Data Blocks | Compressed Size (bytes) | Decompressed Size (bytes) | Compression Ratio |
---|---|---|---|---|---|---|
TransBot Logo Tiles | $3f89 - $4343 | N/A | 4 | 955 | 1664 | 57.4% |
TransBot Logo Name Table [2] | $4344 - $438b | N/A | 2 | 72 | 136 | 52.9% |
Astro Flash Logo Tiles | N/A | $3f26 - $45eb | 4 | 1734 | 2656 | 65.3% |
Astro Flash Logo Name Table | N/A | $45ec - $4655 | 2 | 106 | 196 | 54.1% |
Sega Mark III Logo | N/A | $4656 - $4746 | 4 | 241 | 300 | 80.3% |
Level Name Tables [3] | $4480 - $4990 | $4747 - $4c57 | 2 | 1297 | 2400 | 54.0% |
Background Tiles 1 | $4991 - $514f | $4c58 - $5416 | 4 | 1983 | 3072 | 64.6% |
Background Tiles 2 | $5150 - $592f | $5417 - $5bf6 | 4 | 2016 | 3072 | 65.6% |
Sprite Tiles 1 | $5930 - $648e | $5bf7 - $6755 | 2 | 2911 | 3072 | 94.8% |
Sprite Tiles 2 | $648f - $6e87 | $6756 - $714e | 2 | 2553 | 2560 | 99.7% |
Sprite Tiles 3 | $6e88 - $7728 | $714f - $79ef | 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:
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 |
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:
Index | $00 | $01 |
---|---|---|
Value | $00 | $0f |
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 |
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.
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--- ss
m identical enemies, type ss
%10mmmnnn ss tt tt tt...
m identical enemies, type ss, then n possibly different enemies, types follow
%11---nnn tt
n identical enemies, type tt [4]
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:
TransBot Address Range | Astro Flash Address Range | Contents |
---|---|---|
$0000 - $0002 | $0000 - $0002 | Code: jp $008a |
$0003 - $0022 | $0003 - $0022 | Main Palette |
$0023 - $0037 | $0023 - $0037 | Unused |
$0038 - $003a | $0038 - $003a | Code: jp Instruction |
$003b - $004e | $003b - $004e | Initial Data for VDP Registers 0-9 |
$004f - $0065 | $004f - $0065 | Unused |
$0066 - $0084 | $0066 - $0084 | Code: Pause Handler |
$0085 - $0089 | $0085 - $0089 | Initialisers for Demo Variables (At $0088 is a pointer to the simulated input data) |
$008a - $030b | $008a - $02f1 | Unknown |
$030c - $031c | $02f2 - $02f9 | Title Screen Palette |
$031d - $26a6 | $02fa - $263b | Unknown |
$26a7 - $26a8 | $263c - $263d | Logo Screen Palette |
$26a9 - $34d4 | $263e - $3471 | Unknown |
$34d5 - $34d8 | $3472 - $3475 | PSG Silencing Data |
$34d9 - $356a | $3476 - $3507 | PSG Tone Table |
$356b - $3f88 | $3508 - $3f25 | Unknown Data |
$3f89 - $4343 | N/A | TransBot Logo Tiles |
$4344 - $438b | N/A | TransBot Logo Name Table |
N/A | $3f26 - $45eb | Astro Flash Logo Tiles |
N/A | $45ec - $4655 | Astro Flash Logo Name Table |
$438c - $43ef | N/A | Master System Logo Name Table |
$43f0 - $447f | N/A | Master System Logo Tiles |
N/A | $4656 - $4746 | Sega Mark III Logo |
$4480 - $4990 | $4747 - $4c57 | Level Name Tables |
$4991 - $514f | $4c58 - $5416 | Background Tiles 1 |
$5150 - $592f | $5417 - $5bf6 | Background Tiles 2 |
$5930 - $648e | $5bf7 - $6755 | Sprite Tiles 1 |
$648f - $6e87 | $6756 - $714e | Sprite Tiles 2 |
$6e88 - $7728 | $714f - $79ef | Sprite Tiles 3 |
$7729 - $7868 | $79f0 - $7b2f | Overground Enemy Pointer Table |
$7869 - $78c8 | $7b30 - $7b8f | Underground Enemy Pointer Table |
$78c9 - $7ab9 | $7b90 - $7d80 | Enemy Group Descriptions |
$7aba - $7cd4 | $7d81 - $7f9b | Demo Simulated Input Data |
$7cd5 - $7fef | $7f9c - $7ff7 | Unused [5] |
$7ff0 - $7fff | N/A | ROM Header (Product Code: 4004; Version: 0; Region: SMS Export; ROM Size: 32KB) |
N/A | $7ff8 - $7ffb | Name: "NTKK " |
N/A | $7ffc - $7fff | 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:
TransBot Address Range | Astro Flash Address Range | Number of Entries | TransBot Jump Instruction Address | Astro Flash Jump Instruction Address | Indexed By |
---|---|---|---|---|---|
$0268 - $0273 | $024e - $0259 | 6 | $0267 | $024d | Game State |
$0514 - $051f | $04f0 - $04fb | 6 | $1b29 | $1abe | Unknown |
$0d55 - $0d60 | $0cf8 - $0d03 | 6 | $1b29 | $1abe | Unknown |
$111e - $1125 | $10b3 - $10ba | 4 | $1b29 | $1abe | Unknown |
$12c5 - $12c8 | $125a - $125d | 2 | $1b29 | $1abe | Unknown |
$1a48 - $1a4b | $19dd - $19e0 | 2 | $1b29 | $1abe | Unknown |
$1b42 - $1b45 | $1ad7 - $1ada | 2 | $1b29 | $1abe | Unknown |
$1b86 - $1b89 | $1b1b - $1b1e | 2 | $1b29 | $1abe | Unknown |
$1bd9 - $1bdc | $1b6e - $1b71 | 2 | $1b29 | $1abe | Unknown |
$1c6c - $1c6f | $1c01 - $1c04 | 2 | $1b29 | $1abe | Unknown |
$1d9b - $1d9e | $1d30 - $1d33 | 2 | $1b29 | $1abe | Unknown |
$1db0 - $1db3 | $1d45 - $1d48 | 2 | $1b29 | $1abe | Unknown |
$1e00 - $1e05 | $1d95 - $1d9a | 3 | $1b29 | $1abe | Unknown |
$1f0c - $1f13 | $1ea1 - $1ea8 | 4 | $1b29 | $1abe | Unknown |
$201a - $201f | $1faf - $1fb4 | 3 | $1b29 | $1abe | Unknown |
$206e - $2071 | $2003 - $2006 | 2 | $1b29 | $1abe | Unknown |
$20c8 - $20cf | $205d - $2064 | 4 | $1b29 | $1abe | Unknown |
$2133 - $2136 | $20c8 - $20cb | 2 | $1b29 | $1abe | Unknown |
$21a1 - $21a4 | $2136 - $2139 | 2 | $1b29 | $1abe | Unknown |
$21db - $21de | $2170 - $2173 | 2 | $1b29 | $1abe | Unknown |
$2247 - $224a | $21dc - $21df | 2 | $1b29 | $1abe | Unknown |
$2356 - $235f | $22eb - $22f4 | 5 | $1b29 | $1abe | Unknown |
$26b7 - $26be | $264c - $2653 | 4 | $1b29 | $1abe | Unknown |
$2fd0 - $3073 | $2f6d - $3010 | 82 | $0154 | $013a | Enemy Type |
$3108 - $3135 | $30a5 - $30d2 | 23 | $30d9 | $3076 | Sound Track Number |
$33b3 - $33d0 | $3350 - $336d | 15 | $33ae | $334b | Sound Coordination Flag |
The pre-release version of TransBot is missing several pieces of code which were added for the final version:
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.
Astro Flash does not contain any of these pieces of code.
Researched by RetroSpark