SATURN DEMO CODE AND CUSTOM LIBRARIES
2/20/96
Introduction
------------
These directories contain Saturn demonstration code that was shown at
the 1996 Sega Saturn Developer's Conference, during the sessions "Suggested
Uses for the DSP" and "Advanced Graphic Effects." All of the various demos
rely on a common set of custom libraries, which are also included here. Here
is a brief description of what each directory contains. Further details may
be found in the readme files in the individual directories, or within the
source code.
DEMODSP
-------
The program dsp.sre displays a number of simple 3D models using a 3D
library which uses the SCU DSP to accelerate point transformation and
lighting calculations transparently.
DEMOGOUR
--------
The program gour.sre demonstrates Gouraud shading on a variety of 3D models
and allows comparisons between Gouraud shading and flat shading with a
variety of light source positions.
DEMOCOEF
--------
The program coef.sre demonstrates novel uses of the VDP2 coefficient
tables, showing how to create a curved surface and a surface with a
bump in it.
DEMOWIN
-------
The program win.sre demonstrates how to use the rotation parameter window
to simultaneously display two independent views of the same rotating
background.
DEMODUAL
--------
The program dual.sre demonstrates how to display rbg0 and rbg1
simultaneously. In this demo, both RBG0 and RBG1 are character screens,
and they are both capable of two-axis rotation only.
DEMODUAL2
---------
The program dual2.sre also demonstrates the use of both rotating
backgrounds. In this demo, RBG0 is a bitmap, and RBG1 is a character
screen. RBG0 is capable of three-axis rotation, while RBG1 is
restricted to two-axis rotation.
DEMODUAL3
---------
The program dual3.sre demonstrates yet another configuration which
permits the display of both rotating backgrounds. Here, RBG0 and RBG1
are once again both character screens, but RBG0 can perform three-axis
rotation, because its coefficient table is in color RAM. RBG1 is still
restricted to two-axis rotation.
3D
--
This directory contains the 3D library code, which consists of the
single module 3d.c. This module contains functions to perform 3D
transformations, 2D projections, backface culling, lighting calcula-
tions, and rendering (i.e. the generation of VDP1 command tables).
There is also code to perform miscellaneous matrix operations. The
transformation, projection, and lighting routines make use of the
slave SH2, and the transformation and lighting routines also make
use of the DSP.
MATH
----
This directory contains short functions, most written in SH2 assembly
language, to perform multiplication, division, square roots, to compute
dot products, sines, cosines, pseudo-random numbers, and to scale
vectors.
UTIL
----
This is a catch-all directory which holds modules which control the
vdp1, the vdp2, the slave SH2, and the smpc, as well as a memory manager
and miscellaneous modules that move memory, set up a stack, etc.
PROFILE
-------
This directory contains a rudimentary profiling tool that uses the SH2's
free-running timer to allow sections of code to be timed.
LIB
---
The libraries created by the modules in the above directories are
collected here.
PIX
---
This directory contains the original graphics files used by the VDP2
demos. The files were converted using the bgcon background converter.
Notes on Rebuilding
-------------------
These demos were built using the gnu C compiler v2.7-95q3 (SOA 951018).
The makefiles and linker scripts are currently configured to output
S-record files for use on a small programming box. To get output in
coff format, edit the makefiles and change .cof to .sre, and edit the
.lnk files, changing OUTPUT_FORMAT("srec") to OUTPUT_FORMAT("coff-sh").
These demos do make some use of certain SBL library functions, and you
will probably have to edit the various makefiles so that the pathnames
of the various SBL libraries and include files will reflect your
particular installation.
Disclaimers
-----------
While this code has been used successfully by its author and is not
known to be buggy, it has not been subjected to any sort of formal test
cycle, and it should not be assumed to be bug-free.
While these libraries attempt to do what they do in a reasonably
general manner, the libraries are intended for demonstration purposes
only; they are not comprehensive enough to be used for actual game
development.