|
DevelopmentSega Master System / Mark III / Game Gear |
Home - Forums - Games - Scans - Maps - Cheats - Credits |
Some Sega systems include a simple BIOS to handle the boot process, display a bumper screen, display instructions/error screens and provide built-in games - or a subset of these. This page describes the behaviour of the various BIOS software known to exist.
M404 Prototype BIOS bumper screen |
This BIOS was dumped from a prototype Master System originally sent to Sega of America. Its functionality is quite different from any other BIOS:
COPYRIGHTSEGA
" at offset $7fe0
COPYRIGHT SEGA
" at offset $7fe0
jp $00c8
None of this functionality interferes with the operation of other BIOSes' checks of the header at $7ff0, which may or may not have been deliberate.
Only two games are known to boot with this BIOS: the Japanese version of Fantasy Zone, and Choplifter. These are known to be two of the earliest games developed for the Master System.
This BIOS is found in some prototype/demonstration Master System consoles and is very similar to the 1.3 BIOS but lacks:
Other small differences from 1.3:
This BIOS checks to see if any of the available slots (card, cartridge or expansion, in that order) have anything attached to them, and boots the first available. This is done using port $3E to map different slots into memory, and checks to determine if valid data was found in any slot.
US/European BIOS bumper screen |
The first thing it does is display an animated bumper screen, as shown on the right. While this is animating, the Sega two-tone "jingle" is played. This is purely to reinforce the Sega Master System brand.
It then checks the slots in turn. For each slot, 16 bytes are copied to RAM and checked if they contain a valid ROM header. It does this from offsets $7ff0, $3ff0 and $1ff0 in turn.
It checks to see if the first eight bytes match the ASCII string
"TMR SEGA
"; if so, it proceeds to further tests. If no header is
found at any of the three locations, the slot is assumed to be empty.
The next check is the region: if the high four bits of the last byte of the header do not equal 4, it is rejected with a "SOFTWARE ERROR" message.
Finally, it checks the checksum using this code:
It sums bc
bytes from offset hl
into de
. This is used to
checksum different regions of ROM according to the ROM header. A lower
region is checked, intended to cover all of the ROM before the header (last 16 bytes); an
upper region is then checked (if applicable) assuming a standard Sega
mapper. The lower four bits of the last byte of
the header define the regions checked:
Value | Lower region checked | Upper region checked | Total size |
---|---|---|---|
$a | $0000..$1FEF | n/a | 8KB |
$b | $0000..$3FEF | n/a | 16KB |
$c | $0000..$7FEF | n/a | 32KB |
$d | $0000..$BFEF | n/a | 48KB |
$e | $0000..$7FEF | $8000..$0FFFF | 64KB |
$f | $0000..$7FEF | $8000..$1FFFF | 128KB |
$0 | $0000..$7FEF | $8000..$3FFFF | 256KB |
$1 | $0000..$7FEF | $8000..$7FFFF | 512KB |
$2 | $0000..$7FEF | $8000..$FFFFF | 1024KB |
$3..$9 | Not supported |
If the calculated value does not match the one in the header, a "SOFTWARE ERROR" message is again shown. Otherwise, the slot is booted.
US/European BIOS screenshot |
The last value written to port $3E is also saved in RAM location $c000 (the first byte of RAM). This allows software released in more than one format to safely use port $3E, if necessary, by using this value to correctly re-enable the slot it booted from.
If all slots are found to be empty, an instructional screen is shown. While it is showing, it is possible to press a key combination (++ on the Player 1 controller; additional buttons may also be pressed and it will still work) to trigger a "secret" Snail Maze game.
This BIOS is an uncommon variation of v1.3 which has been recently discovered (cf. discussion here )
The only major difference with v1.3 is the cartridge detection code, which doesn't do any ROM header or checksum verification. Instead it just checks that the first 513 bytes of ROM are not identical. As such, it behave like a Japanese SMS and allows booting cartridges that don't read properly (they would crashes) or Japanese titles (via a custom made adapter for cartridge, or cards). So this is a cool side-effect. Here is the code:
One interesting bug in this code is that the first ROM block is copied in RAM at almost the same address as the RAM copy of the Snail Maze game's tilemap. This causes a visual glitch on the top corners of the maze when run on real hardware (photo 1 , photo 2 )
Other minor differences from v1.3:
This BIOS is similar to the US BIOS, except that because there was no header requirement for Japanese games, especially with legacy SG-1000 software to be supported, this checking has to use a less precise method: it checks to see if there is variation in the data read. It uses this code:
It checks if there is any variation in the middle four bits of the first 256 bytes in each slot and passes execution to the code in that slot if any variation is found. It may be presumed that the hardware ensures that at least these four bits are held constant for all slots when not connected to anything.
Japanese BIOS screenshot |
If it does not find anything in any of its slots it shows an instructional screen, with the text:
Translation: "Turn the power switch to OFF, then please insert some software."
It animates the screen while playing the main theme from "Space Harrier" on both the PSG and the YM2413 simultaneously.
ROM part code: MPR-11124
Dumped by Hiroshi.
This BIOS shows the same bumper screen as the US v1.3 BIOS (except the date is changed to 1988). If, at the end of this phase, buttons ++ are being pressed on controller 1 (and no other buttons), it runs the same "Snail Maze" secret game as the US/European Master System BIOS v1.3. If not, it checks for valid data on the three slots.
This aspect of its operation is almost identical to the US/European Master System BIOS v1.3. However, due to an overzealous optimization in that version (where an opcode's first byte is used as the last byte of the lookup table preceding it), which was overlooked in this version, the $2 checksum range will not be correctly summed.
It additionally includes support in the checksum routines to save and restore the current mapped bank (assuming a Sega mapper).
If no game is found, instead of showing an information screen, it runs a copy of Hang On and Safari Hunt built in to the BIOS ROM. This game has plenty of unused space for the BIOS routines to be added.
ROM part code: MPR-11459A
Dumped by Mike Gordon.
This is a 128K ROM requiring slot 2 mapping.
This BIOS functions identically to US/European BIOS v2.4 with Hang On and Safari Hunt, except that its built-in game is Hang On. This game is small so most of the BIOS ROM is blank.
ROM part code: MPR-11458
Dumped by Mike Gordon.
This is a 128K ROM requiring slot 2 mapping.
This BIOS functions almost identically to US/European BIOS v2.4 with Hang On and Safari Hunt, except that its built-in game is Missile Defense 3D", and it does not feature the "Snail Maze" secret game.
It was only included with some the "Super System" packages (including 3-D glasses and a light phaser); some of these packages instead had another BIOS and Missile Defense 3D as a separate cartridge.
The "Snail Maze" game was probably removed due to lack of space; "Missile Defense 3-D" does not have as much unused space as "Hang On and Safari Hunt".
ROM part code: MPR-11460
US/European BIOS with Alex Kidd in Miracle World bumper screen |
This BIOS features a different bumper screen to previous versions, with just a static Sega logo and no sound. It does not feature the "Snail Maze" secret game.
Its checking routines are almost identical to those of the US/European BIOS v4.4. The built-in game is now Alex Kidd in Miracle World. The $2 checksum range bug is fixed, even though the previously released incompatible BIOSes meant that it could not be used.
The removed items ("Master System" logo, animation, music, "Snail Maze" game) meant that the checksumming code was minimised and was more feasible to insert into unused space in game with an almost-full ROM.
The game is almost the same as the cartridge version, except that:
ROM part code: MPR-12808
Dumped by Mike Gordon.
This is a 128K ROM requiring slot 2 mapping.
European BIOS with Sonic the Hedgehog bumper screen |
This BIOS displays a slightly different bumper screen to "US/European BIOS with Alex Kidd in Miracle World", and again with no logo animation, music or "Snail Maze" game for the same reasons. the built-in game is now Sonic The Hedgehog.
Its checksumming routines seem to be taken from the US/European Master System BIOS v1.3 - they do not feature any of the later changes, and the $2 checksum range bug is not found.
It is worth noting that this BIOS was only featured in Master System II systems which have no card or expansion slots; but it attempts to check them anyway.
The game itself is slightly different from the cartridge version - to make room for the BIOS routines, the credits have been removed.
ROM part code: MPR-15155
This is a 256K ROM requiring mapping in both slot 1 and slot 2.
The BIOS detection code here has to take a similar approach to the Japanese BIOS, in that it cannot assume there will be a header in the ROM, so there is no checksum or region test. Because it is based on different hardware from the Japanese system (an SMS2 variant), it can take a simpler approach: it assumes that unconnected slots will have their data lines tied high, so it checks if there is any non-$FF
data in the first 16 bytes of each slot.
Similar to the Sonic BIOS, it checks all three slots (card, cartridge and expansion) even though two of them are not implemented in the hardware.
Game Gear BIOS bumper screen (GG mode) |
Game Gear BIOS bumper screen (SMS mode) |
Early Game Gear systems have no BIOS.
This BIOS writes and reads two bytes to and from port $02, in order to detect if it is in GG mode or SMS mode so it can use the correct palette data. In GG mode, this port is for the Gear to Gear Cable, and reading it returns what was written; in SMS mode, its use is uncertain, but it seems from the BIOS that it returns something other than what was written.
It then checks the cartridge at offsets $7ff0, $3ff0 and then $1ff0 for
the ASCII string "TMR SEGA
". If it is found, it turns on the screen
to show a bumper screen with the text "PRODUCED BY OR UNDER LICENSE FROM
SEGA ENTERPRISES, LTD." as shown on the right; it then pauses for a few
seconds before running the game. If the text is not found, the screen is
left turned off and the system is locked up.
This BIOS was first noticed in the Game Gear systems released in 2000 by Majesco, but has since been confirmed to be found in many of the later Sega-distributed Game Gear systems, for example in boards manufactured in 1993.
See the SF-7000 IPL.
All other Sega 8-bit home systems (SG-1000, SC-3000, Mark III) have no BIOS.
Some Mega Drive piracy devices have a boot ROM that runs in SMS mode:
*** MAGIC DRIVER V-3 *** PRODUCT MANAGER: LMM, DEBUG ENGINEER: JUS, BIOS PROGRAMMER: JSI, ALL RIGHTS RESERVED, COPYRIGHT 1991 BY JSI, CHINA COACH COMPANY LTD., FRONT FAREAST CORPORATION. 8/17/91
*** MAGIC DRIVE V3.1 *** PRODUCT MANAGER: LMM, DEBUG ENGINEER: JUS, BIOS PROGRAMMER: JSI, FRONT FAREAST CORPORATION.
* MAGIC DRIVE BIOS * COPYRIGHT BY JSI/FRONT FAREAST CO. 93-12-07
Here is a table of the features/behaviours of the various BIOSes:
BIOS | Snail maze | Required string | Checks region | Checks checksum | Slots | $2 range bug | Header locations |
---|---|---|---|---|---|---|---|
M404 prototype | COPYRIGHT SEGA | Card, Cart, Exp | n/a | $7fe0 | |||
1.0 (Prototype) | TMR SEGA | Card, Cart, Exp | $7ff0, $3ff0, $1ff0 | ||||
1.3 (US/EU) | TMR SEGA | Card, Cart, Exp | $7ff0, $3ff0, $1ff0 | ||||
2.0 (??) | Card, Cart, Exp | n/a | n/a | ||||
2.1 (JP) | Card, Cart, Exp | n/a | n/a | ||||
2.4 (Hang On/Safari Hunt) | TMR SEGA | Card, Cart, Exp | $7ff0, $3ff0, $1ff0 | ||||
3.4 (Hang On) | TMR SEGA | Card, Cart, Exp | $7ff0, $3ff0, $1ff0 | ||||
4.4 (Missile Defense 3-D) | TMR SEGA | Card, Cart, Exp | $7ff0, $3ff0, $1ff0 | ||||
Alex Kidd in Miracle World | TMR SEGA | Card, Cart, Exp | $7ff0, $3ff0, $1ff0 | ||||
Sonic The Hedgehog | TMR SEGA | Card, Cart, Exp | $7ff0, $3ff0, $1ff0 | ||||
Alex Kidd in Miracle World (KR) | Card, Cart, Exp | n/a | n/a | ||||
Game Gear | TMR SEGA | Cart | n/a | $7ff0, $3ff0, $1ff0 |