SGL User's Manual
SGL Tutorial

PROGRAMMER'S STRUCT


1. About Sega Saturn 3D game library

1-1. Programming work flow
Host machine settings
ICE settings
Make file setting / execution
Debugger startup / initial settings
Load / execute the program
debug
1-2. Precautions when using the library
Numerical values used in the library
Coordinate system

2. Drawing

2-1. Polygon
2-2. Polygons in SGL
Polygon drawing routine
Parameters required for polygon drawing
2-3. Combination of multiple polygons
Creating a cube
2-4. Polygon distortion problem
Note. SGL library functions that appeared in this chapter

3. Light source

3-1. Light source
3-2. Light source setting
Note. SGL library functions that appeared in this chapter

4. Coordinate transformation

4-1. Coordinate system
4-2. Homography
Perspective transformation
Viewing volume
4-3. Modeling transformation
Object rotation
Move objects
Enlargement / reduction of objects
Special modeling transformation
Difference in results due to conversion order
4-4. Clipping
2D clipping
3D clipping
4-5. Window
Window concept
Window settings in SGL
Reset the default window
Sample program
Range of influence by windows
Note. SGL library functions that appeared in this chapter

[Demo Program A: Bouncing Cube]

5. Matrix

5-1. Matrix
5-2. Object representation by hierarchical structure
stack
Hierarchical concept
Definition of hierarchical structure by Sega Saturn
5-3. Matrix function
Note. SGL library functions that appeared in this chapter

[Demo Program B: Matrix Animation]

6. Camera

6-1. Camera definition and settings
6-2. Camera settings using ″ slLookAt〃
6-3. Actual camera operation
Note. SGL library functions that appeared in this chapter

7. Polygon face attributes

7-1. Attributes
7-2.Plane
7-3. Sort
7-4.Texture
7-5.Color
7-6. Gouraud
7-7.Mode
7-8.Dir
7-9.Option

8. Scroll

8-1. Scrolling in SGL
8-2. Scroll unit
8-3. Screen mode
8-4. Scroll screen
8-5. Scroll data storage in memory
Scroll data type
Scroll data storage in VRAM
Precautions regarding data storage in VRAM 1
Precautions regarding data storage in VRAM 2
Color RAM
Data storage in color RAM
8-6. Scroll function setting
About VRAM access restrictions
Character pattern
Scroll limit by the number of character colors
Scrolling restrictions due to VRAM access
Pattern name data
Data type of pattern name data
About auxiliary data
page
plane
map
Reduction setting
Function settings specific to the rotary scroll screen 1
Function settings specific to the rotary scroll screen 2
Flow of scroll setting
8-7. Scroll drawing
Back screen settings
Display position setting
Scroll registration
Precautions regarding scroll registration
Start drawing
Flow until scroll drawing
8-8. Normal scroll screen
Moving the normal scroll screen
Enlarging / reducing the normal scroll screen
8-9. Rotating scroll screen
Rotate scroll move
Rotation scroll screen enlargement / reduction
Rotate scroll screen rotation
8-10. Special scroll function
ASCII scroll
Transparent color bit
Color calculation
Line color screen
Color offset
8-11. Priority
8-12. Character / numerical display
Note. SGL library functions that appeared in this chapter

9. Controller input

9-1. Input system used in Sega Saturn
9-2. Actual operation
Bits used in the input system
Bit operation by input
Handling of device information in SGL
Discrimination of input data
9-3. Sample program
9-4. Library functions used in the sample
Sprite function
Other functions
Note. SGL library functions that appeared in this chapter

10. Event control

10-1. Event structure
Event processing
EVENT structure
Event list
10-2. Event processing using SGL function
Event initialization
Creating an event list
Event format
Event execution
10-3. Change the event list
Add event
Insert event
Delete event
Change the event list during event execution
10-4. Expansion of USER area
Extension of user area using work area
Expansion of user area using event area
10-5. Precautions for event processing
10-6. Event processing flow
10-7. Example of using the event
Note. SGL library functions that appeared in this chapter

11. Arithmetic functions

11-1. General arithmetic functions
11-2. Trigonometric functions
11-3. Special arithmetic functions
Note. SGL library functions that appeared in this chapter

[Demo Program C: Walking Akira]

12. CD-ROM library

12-1. About the CD-ROM library
12-2. Access to CD-ROM
CD-ROM logical structure
Read file
Split reading of files
About the look-ahead function
Playing CDDA files
Other general matters
12-3. CD library function
CDHN file handle
CDKEY Key for classifying sector data
CDBUF read area information
Sint32 slCdInit (Sint32 nfile, void * work) Initialization
Sint32 slCdChgDir (Sint8 * pathname) Directory move
CDHN slCdOpen (Sint8 * pathname, CDKEY key []) File open
Sint32 slCdLoadFile (CDHN cdhn, CDBUF buf []) File loading
Sint32 slCdTrans (CDHN cdhn, CDBUF buf [], Sint32 ndata []) Stream transfer
Bool slCdResetBuf (CDHN cdhn, CDKEY * key) Reset transfer area
Sint32 slCdAbort (CDHN cdhn) Read interruption
Sint32 slCdPause (CDHN cdhn) Pause reading
Sint32 slCdGetStatus (CDHN cdhn, Sint32 ndata []) Get status
Error code

13. Backup library

13-1. Features of backup library
device
File
Library expansion
13-2. Basic processing flow
13-3. Sample program
Note. Backup library function

14. Sound library

14-1. Overview of sound control
14-2. Sound driver settings
Set sound driver and start MC68000
Set of sound data
BGM performance
Sound effect output
Sound effect output using PCM sound source
Functions that affect the overall sound output
14-3. Memory map
14-4. Sample program
Sample program for BGM and sound effect playback test
Sample program for PCM sound source playback test
Note. Sound library functions that appeared in this chapter

Demo program summary

[Demo Program A: Bouncing Cube]
[Demo Program B: Matrix Animation]
[Demo Program C: Walking Akira]

SGL User's Manual
Copyright SEGA ENTERPRISES, LTD., 1997