Shinobi Library - System Function

sbInitSystem

Initializes the system

FORMAT

void sbInitSystem( mode, frame, Count )
Int mode
Int frame
Int Count

PARAMETER

 mode  Screen mode 
 frame  Frame buffer mode 
 count  Frame count 

RETURN

None

DESCRIPTION

Initializes the Dreamcast hardware and readies the SEGA library for use. In addition, this function also calls njInitSystem(), and sets the mode for the specified screen resolution.

Sets the 2D clipping area to the same size as the screen.
Sets Z clipping to a range form -1.0 to -60000.0.
Sets the 3D screen projection surface distance to 500.
Sets the aspect for both X and Y to 1.0.
Sets the color mode to NJD_COLOR_MODE_NORMAL.

The screen modes that can be set are as listed below.

NJD_RESOLUTION_VGA
NJD_RESOLUTION_320x240_NTSCNI
NJD_RESOLUTION_320x240_NTSCI
NJD_RESOLUTION_640x240_NTSCNI
NJD_RESOLUTION_640x240_NTSCI
NJD_RESOLUTION_320x480_NTSCIN_FF
NJD_RESOLUTION_320x480_NTSCNI
NJD_RESOLUTION_320x480_NTSCI
NJD_RESOLUTION_640x480_NTSCNI_FF
NJD_RESOLUTION_640x480_NTSCNI
NJD_RESOLUTION_640x480_NTSCI
NJD_RESOLUTION_320x240_PALNI
NJD_RESOLUTION_320x240_PALI
NJD_RESOLUTION_640x240_PALNI
NJD_RESOLUTION_640x240_PALI
NJD_RESOLUTION_320x480_PALNI_FF
NJD_RESOLUTION_320x480_PALNI
NJD_RESOLUTION_320x480_PALI
NJD_RESOLUTION_640x480_PALNI_FF
NJD_RESOLUTION_640x480_PALNI
NJD_RESOLUTION_640x480_PALI
NJD_RESOLUTION_VGA_ANTI
NJD_RESOLUTION_320x240_NTSCNI_ANTI
NJD_RESOLUTION_320x240_NTSCI_ANTI
NJD_RESOLUTION_640x240_NTSCNI_ANTI
NJD_RESOLUTION_640x240_NTSCI_ANTI
NJD_RESOLUTION_320x480_NTSCNI_FF_ANTI
NJD_RESOLUTION_320x480_NTSCNI_ANTI
NJD_RESOLUTION_320x480_NTSCI_ANTI
NJD_RESOLUTION_640x480_NTSCNI_FF_ANTI
NJD_RESOLUTION_640x480_NTSCNI_ANTI
NJD_RESOLUTION_640x480_NTSCI_ANTI
NJD_RESOLUTION_320x240_PALNI_ANTI
NJD_RESOLUTION_320x240_PALI_ANTI
NJD_RESOLUTION_640x240_PALNI_ANTI
NJD_RESOLUTION_640x240_PALI_ANTI
NJD_RESOLUTION_320x480_PALNI_FF_ANTI
NJD_RESOLUTION_320x480_PALNI_ANTI
NJD_RESOLUTION_320x480_PALI_ANTI
NJD_RESOLUTION_640x480_PALNI_FF_ANTI
NJD_RESOLUTION_640x480_PALNI_ANTI
NJD_RESOLUTION_640x480_PALI_ANTI

The explanation of each respective screen is set forth below.

 Notation  Explanation 
 VGA  VGA Mode 
 320x240  Screen resolution 320x240 
 320x480  Screen resolution 320x480 
 640x240  Screen resolution 640x240 
 640x480  Screen resolution 640x480 
 NTSC/PAL  Display system 
 I/NI  30Int display/60Int display 
 ANTI  Anti-alias 
 FF  TypeB flicker-free (*) 

If FF is not specified, TypeA flicker-free is set. For more detailed information on these screens, refer to the Dreamcast hardware document (dreamcast_hw.pdf).

Frame buffer modes are listed below.

 Notation  Explanation 
 NJD_FRAMEBUFFER_MODE_RGB565  Red 5bit/green 6bit/blue 5bit 
 NJD_FRAMEBUFFER_MODE_RGB555  Red 5bit/green 5bit/blue 5bit 
 NJD_FRAMEBUFFER_MODE_ARGB1555  Alpha 1bit/red 5bit/green 5bit/blue 5bit 
 NJD_FRAMEBUFFER_MODE_RGB888  Red 8bit/green 8bit/blue 8bit 
 NJD_FRAMEBUFFER_MODE_ARGB8888  Alpha 8bit/red 8bit/green 8bit/blue 8bit 

This function sets the frame count with a value given in units of 1/60th of a second. For example, a setting of "2" results in a frame change every 1/30th of a second. Frame changes are performed by using the njWaitVSync() function.


EXAMPLE

sbInitSystem( NJD_RESOLUTION_VGA, NJD_FRAMEBUFFER_MODE_RGB565, 1 ); 
Initializes the Shinobi library, sets the screen resolution to VGA (640 x 480), 
one frame, 1/60th second.

NOTE

This function must be called at the beginning of a program. Some screen modes may not be permitted with some hardware configurations. Processing that was previously performed using njInitSystem() should be replaced with this function. Because the parameters are completely identical to njInitSystem(), all that is necessary is to replace the function literal only.

REFERENCE

sbExitSystem()
njInitSystem()

sbInitSystem
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999