Sega Master System ROM signatures
When loading ROM, the SMS' BIOS checks for a special signature
at the end of that ROM. If that signature is incorrect, the ROM
Collapse OS has a program to generate that signature at B165.
This document describes what it does.
At boot, the BIOS checks $10 bytes before the $8000, then
$4000, then $2000 mark for a signature. This signature has
the following structure.
$00-$07: String constant: "TMR SEGA"
$08-$09: null bytes
$0c-$0e: null bytes
$0f : "size" flag
The checksum is a simple 16-bit sum of all bytes up to the
beginning of the signature.
The size flag can have 3 values: $4a for an 8K ROM, $4b for
16K and $4c for 32K. It can have other values for other kinds
of sizes, but we don't care about them in the context of
Generating the signature
Before generating the signature, you need to have the contents
of your ROM somewhere in memory. Then, you load B165 and you
call "segasig" which has the signature "addr size". "addr" is
the adress of the beginning of the ROM and "size" is 0, 1 or 2
depending on whether your ROM is 8K, 16K or 32K.
Calling the word will write the $10 bytes signature at the
end of the ROM.
Note that all I/O use the "Addressed device" words (see
usage.txt), so I/O indirections will work.
This page generated at 2021-09-19 21:05:03 from documentation in CollapseOS snapshot 20210917.