1. Overview
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.
2. Master System
2.1 M404 Prototype BIOS
 |
| 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:
- It has a much more impressive bumper screen than other non-Japanese BIOSes
- It checks for the string "
COPYRIGHTSEGA" at offset $7fe0
- It checks for the string "
COPYRIGHT SEGA" at offset $7fe0
- It checks if the VBlank handler at offset $0038 matches the code
jp $00c8
- It checks on all three slots, the same as other BIOSes
- It does not do any region checking
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.
2.2 US/European Master System BIOS v1.3 (1986)
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:
Checksum:
ld a,e ; add (hl) to de
add (hl)
ld e,a
ld a,d
adc $00
ld d,a
inc hl ; move pointer on and decrement counter
dec bc
ld a,b ; repeat until counter is zero
or c
jr nz,Checksum
ret
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; 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.
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.
 |
| US/European BIOS screenshot |
If all slots are found to be empty, an instructional sreen is shown.
While it is showing, it is possible to press a key combination (Up+1+2 on
the Player 1 controller; additional buttons may also be pressed and it
will still work) to trigger a "secret" Snail Maze game.
2.3 Japanese Master System BIOS v2.1 (1987)
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:
CheckSlot:
ld hl,$0000 ; look at ROM from $0000
ld bc,$003c ; loop 256 times, mask $3c
ld a,(hl) ; get byte
and c ; and with $3c = %00111100
ld e,a ; store in e
Loop:
ld a,(hl) ; get byte
inc l ; pointer++
and c ; and with $3c
cp e ; compare to first byte
jp nz,$0000 ; if not equal, run slot
djnz Loop ; repeat 256 times
ret ; Nothing found
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.
2.4 US/European BIOS v2.4 with Hang On and Safari Hunt (1988)
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 U+1+2 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 optimisation 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 page (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.
2.5 US/European BIOS v3.4 with Hang On (1988)
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.
2.6 US/European BIOS v4.4 with Missile Defense 3-D (1988)
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 3-D", 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 3-D" 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".
2.7 US/European BIOS with Alex Kidd in Miracle World (1990)
 |
| 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 the rice cake Alex Kidd eats before each level was changed to a hamburger (to better suit Western audiences), and the jump and punch buttons were reversed (to the more common layout where 2 = jump).
2.8 European BIOS with Sonic The Hedgehog (1991)
 |
| 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.
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.
2.9 Korean Samsung Gam*Boy/Aladdin Boy II BIOS with Alex Kidd in Miracle World
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.
3. Game Gear
3.1 No BIOS
Early Game Gear systems have no BIOS.
3.2 "Majesco" Game Gear BIOS
 |
Game Gear BIOS bumper screen (GG mode) |
 |
Game Gear BIOS bumper screen (SMS mode) |
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 $1ff0, $3ff0 and then $7ff0 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.
4. SF-7000
The SF-7000? Super Control Station add-on for the
SC-3000 has no BIOS, but it does have an
Initial Program Loader that provides BIOS-like
functionality.
5. Other systems
All other Sega 8-bit home systems (SG-1000, SC-3000, Mark III) have no BIOS.