The SGADE Documentation

the SGADE The Socrates Gameboy Advance Development Engine

The SGADE is a development library for the Nintendo Gameboy Advance. It's free for all uses and is distributed without guarantees. For more information visit the SGADE page.


Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

SoDisplay

All general display related stuff. More...

Files

file  SoDisplay.c
file  SoDisplay.h

Defines

#define SO_REG_DISP_CNT
 GBA display control register, defined in the header cause it's used in multiple files.

#define SO_REG_DISP_STAT
 GBA display statistics register, defined in the header cause it's used in multiple files.

#define SO_REG_SCANLINE_COUNT
 GBA scanline counter register, defined in the header cause it's used in multiple files.

#define SO_REG_DISP_MOSAIC_W
 GBA display mosaic register, defined in the header cause it's used in multiple files.

#define SO_SCREEN_WIDTH
 Width of the GBA screen.

#define SO_SCREEN_HALF_WIDTH
 Half of the GBA screen width.

#define SO_SCREEN_HEIGHT
 Height of the GBA screen.

#define SO_SCREEN_HALF_HEIGHT
 Half of the GBA screen height.

#define SO_RED
 Pure red;.

#define SO_GREEN
 Pure green;.

#define SO_BLUE
 Pure blue;.

#define SO_WHITE
 Pure white;.

#define SO_BLACK
 Pure black;.

#define SO_YELLOW
 Pure yellow;.

#define SO_CYAN
 Pure cyan;.

#define SO_MAGENTA
 Pure magenta (purple);.

#define SO_PURPLE
 Pure purple (magenta);.

#define SO_RGB(r, g, b)
 Converts three 5 bit values for RGB into one 16 bit RGB value.

#define SO_RGB_GET_R(c)
 Extracts the 5 bit R value out of a 15 bit RGB value.

#define SO_RGB_GET_G(c)
 Extracts the 5 bit G value out of a 15 bit RGB value.

#define SO_RGB_GET_B(c)
 Extracts the 5 bit B value out of a 15 bit RGB value.

#define SO_SCREEN_HALF_WIDTH_MULTIPLY(y)
 Multiplies the given number by the half width (120) of the GBA screen;.


Functions

void SoDisplayInitialize (void)
 Initializes the display.

void SoDisplayEnable (u32 a_Enable)
 Enables or disables the display.

void SoDisplaySetMode (u32 a_Mode)
 Sets the current video display mode (0..6).

u32 SoDisplayGetMode (void)
 Gets the current video display mode.

u32 SoDisplayGetVCounter (void)
 Returns the current scanline count.

bool SoDisplayIsInVBlank (void)
 Tests whether we are in VBlank or not.

bool SoDisplayIsInHBlank (void)
 Tests whether we are in HBlank or not.

void SoDisplayWaitForVBlankStart (void)
 Waits until we are at the start of VBlank.

void SoDisplayWaitForVBlankEnd (void)
 Waits until we VBlank has ended.


Variables

u16 SO_REG_DISP_MOSAIC_RW
 GBA display mosaic register backup, so we can both read and write;.


Detailed Description

All general display related stuff.

Singleton

This module contains and defines everything related to the display of the GBA. Very specific stuff gets it's own module like SoMode4Renderer and SoMode4PolygonRasterizer but this module contains the most general stuff.


Define Documentation

#define SO_REG_DISP_MOSAIC_W
 

GBA display mosaic register, defined in the header cause it's used in multiple files.

Warning:
Write only register. Use the SO_REG_DISP_MOSAIC_RW register instead.


Function Documentation

void SoDisplayEnable u32    a_Enable
 

Enables or disables the display.

Parameters:
a_Enable  This function updates the display's forced blank status. If it is enabled, the display will be show as all white.

u32 SoDisplayGetMode void   
 

Gets the current video display mode.

This routine retrieves the current video display mode.

u32 SoDisplayGetVCounter void   
 

Returns the current scanline count.

Returns :
Current scanline count.

void SoDisplayInitialize void   
 

Initializes the display.

Resets the display registers.

bool SoDisplayIsInHBlank void   
 

Tests whether we are in HBlank or not.

Returns :
true if we are in HBlank and false otherwise.

bool SoDisplayIsInVBlank void   
 

Tests whether we are in VBlank or not.

Returns :
true if we are in VBlank and false otherwise.

void SoDisplaySetMode u32    a_Mode
 

Sets the current video display mode (0..6).

Parameters:
a_Mode  the mode to be set
This routine changes the current display mode. Currently only supports modes 0 (text BG mode) and 4 (bitmap mode)

void SoDisplayWaitForVBlankEnd void   
 

Waits until we VBlank has ended.

Routine just halts the CPU (except for interrupts) until the display finishes VBlank.

Warning:
If this function is already outside of VBlank it will return immediately.

void SoDisplayWaitForVBlankStart void   
 

Waits until we are at the start of VBlank.

Routine just halts the CPU (except for interrupts) until the display reaches the start of VBlank.

Warning:
If this function is already in VBlank it will return immediately.


Variable Documentation

u16 SO_REG_DISP_MOSAIC_RW  
 

GBA display mosaic register backup, so we can both read and write;.

Warning:
This register needs to be copied into SO_REG_DISP_MOSAIC_W to have any effect.


Copyright 2002 by the SGADE authors. See SoLicense.h or Visit the SGADE page for more information.