tialGeneral Notice

When using this document, keep the following in mind:

This document is confidential. By accepting this document you acknowledge that you are boundby the terms set forth in the nondisclosure and confidentiality agreement signed separately and in
the possession of SEGA. If you have not signed such a nondisclosure agreement, please contact
SEGA immediately and return this document to SEGA.

2.

This document may include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new versions of the
document. SEGA may make improvements and/or changes in the product(s) and/or the
program(s) described in this document at any time.

3.

No one is permitted to reproduce or duplicate, in any form, the whole or part of this document
without SEGA’S written permission. Request for copies of this document and for technicalinformation about SEGA products must be made to your authorized SEGA Technical Services
representative.

4.

No license is granted by implication or otherwise under any patents, copyrights, trademarks, orother intellectual property rights of SEGA Enterprises, Ltd., SEGA of America, Inc., or any third
party.

5.

Software, circuitry, and other examples described herein are meant merely to indicate thecharacteristics and performance of SEGA’s products. SEGA assumes no responsibility for any
intellectual property claims or other problems that may result from applications based on theexamples described herein.

6.

It is possible that this document may contain reference to, or information about, SEGA products(development hardware/software) or services that are not provided in countries other than Japan.
Such references/information must not be construed to mean that SEGA intends to provide such
SEGA products or services in countries other than Japan. Any reference of a SEGA licensed product/program in this document is not intended to state or imply that you can use only SEGA’slicensed products/programs. Any functionally equivalent hardware/software can be used instead.

7.

SEGA will not be held responsible for any damage to the user that may result from accidents or any
other reasons during operation of the user’s equipment, or programs according to this document.

SE

GA

Co

nfi

de
n

1.

SE

GA

Co

nfi

de
n

tia
l

TM

SATURN
Demo-Demo
File Loader
Specifications
Library Version 1.20
2/5/1996
Doc. # ST-250-R1-031296© 1995-96 SEGA. All Rights Reserved.

tialGeneral Notice
When using this document, keep the following in mind:

This document is confidential. By accepting this document you acknowledge that you are bound by
the terms set forth in the non-disclosure and confidentiality agreement signed separately and /in thepossession of SEGA. If you have not signed such a non-disclosure agreement, please contact SEGA
immediately and return this document to SEGA.

2.

This document may include technical inaccuracies or typographical errors. Changes are periodicallymade to the information herein; these changes will be incorporated in new versions of the document.
SEGA may make improvements and/or changes in the product(s) and/or the program(s) describedin this document at any time.

3.

No one is permitted to reproduce or duplicate, in any form, the whole or part of this document
without SEGA’S written permission. Request for copies of this document and for technical information about SEGA products must be made to your authorized SEGA Technical Services representative.

4.

No license is granted by implication or otherwise under any patents, copyrights, trademarks, or otherintellectual property rights of Sega Enterprises, Ltd., Sega of America, Inc., or any third party.

5.

Software, circuitry, and other examples described herein are meant merely to indicate the characteristics and performance of SEGA’s products. SEGA assumes no responsibility for any intellectual
property claims or other problems that may result from applications based on the examples describe
herein.

6.

It is possible that this document may contain reference to, or information about, SEGA products(development hardware/ software) or services that are not provided in countries other than Japan.
Such references/ information must not be construed to mean that SEGA intends to provide such
SEGA products or services in countries other than Japan. Any reference of a SEGA licensed product/
program in this document is not intended to state or imply that you can use only SEGA’s licensed
products/programs. Any functionally equivalent hardware/software can be used instead.

7.

SEGA will not be held responsible for any damage to the user that may result from accidents or any
other reasons during operation of the user’s equipment, or programs according to this document.

GA

Co

nfi

de
n

1.

NOTE: A reader's comment/correction form is provided with thisdocument. Please address comments to :SE

SEGA of America, Inc., Technical Publications Group
150 Shoreline Drive, Redwood City, CA 94065

SEGA may use or distribute whatever information you supply in any way it
believes appropriate without incurring any obligation to you.

(02/09/96-003)

2

tia
l

Reader Correction/Comment Sheet
Keep Us Updated!

den

If you should come across any incorrect or outdated information while reading through the attacheddocument, or have any questions or comments, please let us know so that we can make the requiredchanges in subsequent revisions of the document. Simply fill out all relevant information below andreturn this form to the Developer Technical Support Manager at the address below. Please make more
copies of this form if more space is needed. Thank you for your cooperation!
General Information
Your Name:
Document Number:
Document Name:

Phone:

ST-250-R1-031296

Date:

SATURN Demo-Demo File Loader Specifications Library Version 1.20

Corrections
Page

Correction

Co

nfi

Chapter

SE

GA

Questions/Comments

Send Your Corrections/Comments to:

Fax:

415.802.1717
Attention: Evelyn Merritt
Developer Technical Support

E-Mail: dts@segaoa.com

SATURN Demo-Demo File Loader Specifications

Mail:

SEGA OF AMERICA, INC.
Attention:
Evelyn Merritt
Developer Technical Support
150 Shoreline Drive
Redwood City, California 94065

3

•

tia
l

Revision History
Release 1 (Version 1.11) 8/23/1995
Major improvements in all feature areas.
Release 2 (Version 1.12) 12/06/1995•••

Change in exit function initialization processing. Disabled interrupts. Eliminated halts of theslave CPU by the SMPC.
Added exit function name SYS_Exit.
Added Function Code 2processing to the exit function (execute IP check and run unconditionally).

Release 3 (Version 1.20) 2/5/1996••

Changed reference area address for DemoDemo data from 60020CCH to 6000CCCH.
Associated libraries were also modified for concurrence (GFS Ver. 2.10, SYS Ver. 2.10).
Added copy to SYSTEM ID save area processing in the Interface module. Changed memory map
for Interface and Kernel modules.
Eliminated root directory file count limitation (previously limited to 254 files).
Eliminated the exit function and standardized on the SYS library function SYS_Exit.
Added the FLD_INIT_DDS function macro to the interface module.

SE

GA

Co

•
•
•

de
n

•

nfi

•

4

tia
l

Table of Contents

SE

GA

Co

nfi

de
n

1. Outline ........................................................................................................................... 6
1.1 System Configuration .............................................................................................. 6
1.2 Functions and Features .......................................................................................... 7
2. File Loader Specifications ............................................................................................. 8
2.1 Interface .................................................................................................................. 8
2.2 Kernel ...................................................................................................................... 10
3. Exit Function Specifications ........................................................................................... 11
4. Demo-Demo Software Disk Configuration ..................................................................... 11
5. FLD File Overview ......................................................................................................... 12
6. Function Specifications .................................................................................................. 13
6.1 File Loader (Interface) ............................................................................................. 13
6.2 File Loader (Kernel) ................................................................................................ 14
6.3 System Exit Function .............................................................................................. 14

SATURN Demo-Demo File Loader Specifications

5

tia
l

1. Outline
This manual describes external specifications for the Demo-Demo File Loader.

Boot ROM IPL

Menu IP

nfi

Game A IP

de
n

1.1
System Configuration
The File Loader will be abbreviated as FLD in this manual.
Library symbol: FLD (File LoaDer)

Game B IP

Main Menu
File Loader
InterfaceCo

File
LoaderKernelGame BSYS_Exit()

SYS_Exit()GA

SYS_Exit()

Game ASE

Multiplayer

Figure 1 Demo-Demo Software System Configuration

The Demo-Demo File Loader comprises a file loader that loads a game selected in the
Demo-Demo Software (DDS) menu into work RAM, and an exit function (SYS_Exit)
that is called when exiting the game.
The File Loader is divided into a menu interface and a kernel that loads the first readfile of the game.
6

1.

tia
l

1.2
Functions and Features
The use of the File Loader in the following way enables Multi-GFS and the exit function
to be linked to game programs, so games can be developed without regard for whether
they are product versions or Demo-Demo versions.
Game Startup

2.

de
n

Demo-Demo games are started up by the File Loader interface and kernel.
Since the game IP is executed as is, initialization is the same as in the startup
of a normal game. Therefore, the reliability of operation is improved.
Multi-GFS Support

The files and directory structure used by each game are set up in a separate
subdirectory for each game. It is therefore not necessary to consider filename
conflicts between games, and the filenames used can be the same as those in
the actual games.

3.

nfi

Multi-GFS allows files in game subdirectories to be accessed without any modification to the product version program.
Game Exit

SE

GA

Co

Executing the exit function during Demo-Demo operation brings up the menu;
execution during the operation of the game starts up the Multiplayer.

SATURN Demo-Demo File Loader Specifications

7

2.1
1.

tia
l

2. File Loader Specifications
Interface
Process

C0H

Game name

nfi

de
n

(a) Load IP of game selected in menu to address 6002000H.
(b) Copy the entire SYSTEM ID (100H bytes from 6002000H) to the SYSTEM ID savearea (60000C00H).
(c) Copy part of SYSTEM ID (20H bytes from 60020E0H) to the SYSTEM ID parameterarea (60002A0H).
(d) Load the Demo-Demo data into the SYSTEM ID save area (4 bytes from
6000CCCH). Specifically, rewrite the part of the SYSTEM ID save area shown in
Figure 2.1. The Demo-Demo data is accessed by the Multi GFS, the SYS_Exit
function and the FLD kernel.
(e) Load the File Loader kernel (FLD_KNL.BIN) at 200000H.
(f) Rewrite the first read function hook table (6002270H) value to the 200000H
address.
(g) Jump to the IP security code (6002100H) and start up the game.
C

D

DDS

TNO

Co

01H01H(indicates
Demo-Demo
is running)(indicates
whether Demo-Demois running)
Starting
track
numberofoftheused
Starting
track
numbertheCD-DA
CD-DA track
track usedGame
subdirectory
filefile
identifierGamesubdirectory
identifier

SE

GA

Figure 2.1 SYSTEM ID Rewrite

8

E

F
FID

Memory Map

WORKRAM-H
6000000H
60002A0H
System ID parameter area

20H bytes

den60002C0H

tia
l

2.

6000C00H
6000CCCH
6000CD0H

6002000H
60020E0H
6002100H

100H bytes

Demo-Demo data

(4H bytes)

nfi

6000D00H

System ID save area

System ID (IP Start Address)

100H bytes

System ID parameters(20H bytes)

Security code start

6002270HCo

1st read function hook table value 4H bytes

6002274H
6100000H

3.

Notes

GA

Figure 2.2 Interface Memory Map

Execution of the IP sys_init.obj from both the menu and game can cause thesystem to crash when the Multiplayer is started up from a game or the reset button
is pressed.

SE

To avoid this problem, the following should be observed:(a) Do not link sys_init.obj to the menu IP.
(b) Do not modify the following menu settings.
• Cache mode
• Sector length (CDC_SetSctLen)

SATURN Demo-Demo File Loader Specifications

9

1.

tia
l

2.2
KernelThe File Loader kernel is called from the IP instead of the first read process routine inboot ROM (kernel filename: FLD_KNL.BIN).
Process

2.

Memory Mapden(a) Re-register VBLANK-IN interrupt routine in the interrupt vector table (vector
number 40). (Patch processing performed on sys_sec.obj)(b) Move to game subdirectory. This subdirectory stores the selected game.
(c) Load the first read file (file where fid is 2) and transfer to first read address.

WORKRAM- L
200000H
Hook table
200004H

Reserved area

FCH bytes

nfi

200100H

4H bytes

Area reserved for kernel program
202000H

1F00H bytes

Free space

300000H

Co

The pointer to the first read file load function is stored in the hook table.
The first read file load function exists within the kernel program.
Figure 2.3 Kernel Memory Map

3.

Hook Table Placement

SE

GA

Assign the hook table to the initialization data section (SEGA_D) and designate thememory area at link-time.

10

tia
l

3. Exit Function Specifications
The exit function uses parameter values to perform one of the following exit processes:
IP check and execution, Multiplayer user interface screen startup, infinite loop execution.
1.

IP Check & Execution

*
2.

de
n

The Demo-Demo IP is loaded and executed using a boot ROM service routine. The
following initialization process is performed at that time (when operated as a standalone product, the Multiplayer is started up).
(a) Disable interrupts (CPU status register, SCU interrupt mask register)(b) Change system clock to 26 MHz (halts the slave CPU) *(c) CD subsystem soft reset(d) Set stack pointer to the default value (6002000H)
An SMPC exit wait is not required (infinite loop may occur because of timing)
Using the SMPC slave CPU halt command is not allowed.

Multiplayer Startup

3.

nfi

Start up the Multiplayer using the SYS_EXECDMP function macro.
Infinite loop Execution

Used for debugging.

Co

4. Demo-Demo Software Disk Configuration

The configuration of the Demo-Demo software CD is shown in Table 4.1
Table 4.1 Disk Configuration
Track

SE

Description

Menu program
Menu data
Game1_IP.BIN...

Place menu program,data and game IP's in
the root directory.

FLD_KNL.BIN

File Loader kernel

Game 1
Game 1 program
Game 1 data...

Create a separate
subdirectory for eachgame and program, andplace programs and
data.

GA

CD ROM track

File

Game 2...

CD-DA track

CD-DA files not used

* The maximum number of directory nesting levels including the root directory is 8. Therefore,
the maximum number of levels that can be used by a game is 7.
SATURN Demo-Demo File Loader Specifications

11

tia
l

5. FLD File Overview
1. Files required to use the FLD librarydenTable 5.1 Files required to use the FLD library* The exit function is supplied as SYS_Exit in the system program library
sega_sys.lib (ver. 2.10 and later).
2. Files required to create FLD library

Co

nfi

Table 5.2 Files required to create FLD library

3. SEGA libraries required to create FLD library

SE

GA

Table 5.3 SEGA libraries required to create FLD library12