##### Ninja Library - System Function

# njInitSystem

Initializes the system

### FORMAT

`

  void njInitSystem( mode, frame, count )
  Int mode
  Int frame
  Int count

`

### PARAMETER

  `mode` | Screen mode
  `frame` | Frame buffer mode
  `count` | Frame count

### RETURN

  None

### DESCRIPTION

  Changes the system to the specified screen resolution.

  The size of the 2D clip area is set to the same size as the screen. Z clip set between -1.0 and -6000.0. Distance of the 3D projection screen set to 500. Aspects of X and Y set to 1.0. Color mode set to NJD_COLOR_MODE_NORMAL.

  The following screen modes can be set.

  NJD_RESOLUTION_VGA
  NJD_RESOLUTION_320x240_NTSCNI
  NJD_RESOLUTION_320x240_NTSCI
  NJD_RESOLUTION_640x240_NTSCNI
  NJD_RESOLUTION_640x240_NTSCI
  NJD_RESOLUTION_320x480_NTSCNI_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

  Each meanings is as follows.

  Notation | Meaning
  VGA | VGA Mode
  320x240 | Screen resolution 320x240
  320x480 | Screen resolution 320x480
  640x240 | Screen resolution 640x240
  640x480 | Screen resolution 640x480
  NTSC/PAL | Type of display
  I/NI | 30Int Display/60Int Display
  ANTI | Anti-aliase
  FF | TypeB flicker free *

  When FF is not specified, it becomes TypeA flicker free. Refer to Hardware overview (dreamcast_hw.doc) for details.

  Frame buffer modes are as follows.

  Notation | Meaning
  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

  The frame count is specified in 1/60-second units. For example, if "2" is specified, the frame changes every 1/30 seconds. Frame changes are performed with `njWaitVSync()` function.

### EXAMPLE

      njInitSystem( NJD_RESOLUTION_VGA, NJD_FRAMEBUFFER_MODE_RGB565, 1 );
      Sets screen resolution to VGA (640x480) and frame speed to 1/60 sec. units.

### NOTE

  Initialization of system must be set at the beginning of the program. Performed inside the `sbInitSystem()` function at the target.

### REFERENCE

  `njWaitVSync()
  njClipZ()
  njSetAspect()
  njSetScreen()
  `

njInitSystem

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999