The first 15 sectors (32KB) of a SEGA Saturn CD contains the Boot System Initial Program code known as IP.BIN 1. In this post we will explore what it is, the purpose of it and how it works.
After the Sega Saturn’s internal BIOS code has been executed the CPU will jump to a location in the IP.BIN which will start the setup for game specific settings and meta data such as the game name and version information.
So you can think of it as both Meta Data for the inserted game and also as the starting point for the CPU.
Most of the IP.BIN is the same between games with just a few settings changed such as the:
Content that stays the same between games include:
The specification for the Sega Saturn CD Format including the IP.BIN is defined in the Official SDK documentation as “Disc Format Standards Specification Sheet” 2.
In order to create an IP.BIN for their game developers needed to link together multiple machine code object files along with their own assembly code.
These files included:
An assembly source file called SYS_ID.SRC is provided by the official SDK for developers to modify and assemble with their own meta data set (such as Game title and version information).
Developers would modify that file and assemble it with the provided assembler to result in a sys_id.obj file. This file is then linked at the start of the IP.BIN executable.
The Security code in the IP.BIN file has to be the contents of a compiled object found in the SDK, otherwise the Saturn will not boot the CD. Presumably this is to allow suing unlicensed developers for copyright infringements if it is included on their CDs.
The compiled object file is located in the official SDK at path:
It will be interesting to see if Homebrew Saturn SDKs include this file or not.
In order to region lock games, sega requires developers to include special compiled object files depending on which region they want to target, there are also contained in the
\SATURN\SEGALIB\LIB\ directory of the SDK and contains:
You can have multiple area code objects linked, does this mean there are region free Saturn games available?
There is an example linker file called smpsys.lnk which has the following contents:
Input sys_id.obj Input ..\segalib\lib\sys_sec.obj Input ..\segalib\lib\sys_arej.obj Input ..\segalib\lib\sys_aret.obj Input ..\segalib\lib\sys_areu.obj Input ..\segalib\lib\sys_aree.obj Input ..\segalib\lib\sys_init.obj Input ..\smpsys.obj STart SYSID (06002000) Output sys_ip.abs Print sys_ip.map EXIT
When this linking script is executed it creates a file called sys_ip.abs which can be renamed to IP.BIN.
The Homebrew version for the Sega Saturn SDK has its own tool for creation called the IPMaker.
If you are interested in how it works you can check out some of the source code below: IPMaker source Code - SystemID.c