sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
gsGlobal Struct Reference

#include <gsInit.h>

Public Member Functions

void *dma_misc __attribute__ ((aligned(64)))
 Misc 512 byte DMA Transfer Buffer (so we don't malloc at runtime).

Public Attributes

s16 Mode
 Display Mode.
s16 Interlace
 Interlace (On/Off).
s16 Field
 Field / Frame.
u32 CurrentPointer
 Current VRAM Pointer.
u32 TexturePointer
 Pointer to beginning of Texture Buffer.
u8 Dithering
 Dithering (On/Off).
s8 DitherMatrix [16]
 Dithering Matrix.
u8 DoubleBuffering
 Enable/Disable Double Buffering.
u8 ZBuffering
 Enable/Disable Z Buffering.
u32 ScreenBuffer [2]
 Screenbuffer Pointer Array.
u32 ZBuffer
 ZBuffer Pointer.
u8 EvenOrOdd
 Is ((GSREG*)CSR)->FIELD (Used for Interlace Correction).
u8 DrawOrder
 Drawing Order (GS_PER_OS/GS_OS_PER) (GS_PER_OS = Persitant objects always drawn first).
u8 FirstFrame
 Have we executed a frame yet?
u8 DrawField
 Field to draw (GS_FIELD_NORMAL/GS_FIELD_ODD/GS_FIELD_EVEN).
u8 ActiveBuffer
 Active Framebuffer.
volatile u8 LockBuffer
 Used to lock the buffer so it doesn't switch.
int Width
 Framebuffer Width (the mode's DW is a multiple of this value).
int Height
 Framebuffer Height (the mode's DH is a multiple of this value).
int Aspect
 Framebuffer Aspect Ratio (GS_ASPECT_4_3/GS_ASPECT_16_9).
int OffsetX
 X Window Offset.
int OffsetY
 Y Window Offset.
int StartX
 X Starting Coordinate (Used for Placement Correction) Default value.
int StartY
 Y Starting Coordinate (Used for Placement Correction) Default value.
int StartXOffset
 X Starting Coordinate (Used for Placement Correction) Additional correction.
int StartYOffset
 Y Starting Coordinate (Used for Placement Correction) Additional correction.
int MagH
 X Magnification Value (MAGH = DW / Width - 1).
int MagV
 Y Magnification Value (MAGV = DH / Height - 1).
int DW
 Total Display Area Width (DW = Width * (MAGH + 1)).
int DH
 Total Display Area Height (DH = Height * (MAGH + 1)).
GSBGCOLOR * BGColor
 Background Color Structure Pointer.
GSTEST * Test
 TEST Register Value Structure Pointer.
GSCLAMP * Clamp
 CLAMP Register Value Structure Pointer.
GSQUEUE * CurQueue
 Draw Queue (Current).
GSQUEUE * Per_Queue
 Draw Queue (Persistent).
GSQUEUE * Os_Queue
 Draw Queue (Oneshot).
int Os_AllocSize
 Oneshot Drawbuffer Size (Per Buffer).
int Per_AllocSize
 Persistent Drawbuffer Size (Per Buffer).
int PSM
 Pixel Storage Method (Color Mode).
int PSMZ
 ZBuffer Pixel Storage Method.
int PrimContext
 Primitive Context.
int PrimFogEnable
 Primitive Fog Enable.
int PrimAAEnable
 Primitive AntiAlaising Enable.
int PrimAlphaEnable
 Primitive Alpha Blending Enable.
u64 PrimAlpha
 Primitive Alpha Value.
u8 PABE
 Choose if to do Alpha Blend on a Per-Pixel Basis.

Detailed Description

gsGlobal Structure This is the core structure for gsKit operation.

All relevant data to GS operation including framebuffer pointers, display mode, dimensions, offsets, and GS register values are maintained here.

Most gsKit functions will require the pointer of gsGlobal as their first parameter.

To create a gsGlobal pointer it is recommended you use the gsKit_init_global routine.

Example: GSGLOBAL *gsGlobal = gsKit_init_global(GS_MODE_NTSC);

This will create, allocate, and preload gsGlobal with all default values and specific values for the NTSC display mode.

To destroy a gsGlobal structure you can use the gsKit_deinit_global routine.

Example: gsKit_deinit_global(gsGlobal);

This will free all memory allocated by gsGlobal and memory allocated by structures within gsGlobal itself.

Definition at line 899 of file gsInit.h.

Member Data Documentation

◆ ActiveBuffer

u8 gsGlobal::ActiveBuffer

Active Framebuffer.

Definition at line 916 of file gsInit.h.

◆ Aspect

int gsGlobal::Aspect

Framebuffer Aspect Ratio (GS_ASPECT_4_3/GS_ASPECT_16_9).

Definition at line 920 of file gsInit.h.

◆ BGColor

GSBGCOLOR* gsGlobal::BGColor

Background Color Structure Pointer.

Definition at line 931 of file gsInit.h.

◆ Clamp

GSCLAMP* gsGlobal::Clamp

CLAMP Register Value Structure Pointer.

Definition at line 933 of file gsInit.h.

◆ CurQueue

GSQUEUE* gsGlobal::CurQueue

Draw Queue (Current).

Definition at line 934 of file gsInit.h.

◆ CurrentPointer

u32 gsGlobal::CurrentPointer

Current VRAM Pointer.

Definition at line 904 of file gsInit.h.

◆ DH

int gsGlobal::DH

Total Display Area Height (DH = Height * (MAGH + 1)).

Definition at line 930 of file gsInit.h.

◆ Dithering

u8 gsGlobal::Dithering

Dithering (On/Off).

Definition at line 906 of file gsInit.h.

◆ DitherMatrix

s8 gsGlobal::DitherMatrix[16]

Dithering Matrix.

Definition at line 907 of file gsInit.h.

◆ DoubleBuffering

u8 gsGlobal::DoubleBuffering

Enable/Disable Double Buffering.

Definition at line 908 of file gsInit.h.

◆ DrawField

u8 gsGlobal::DrawField

Field to draw (GS_FIELD_NORMAL/GS_FIELD_ODD/GS_FIELD_EVEN).

Definition at line 915 of file gsInit.h.

◆ DrawOrder

u8 gsGlobal::DrawOrder

Drawing Order (GS_PER_OS/GS_OS_PER) (GS_PER_OS = Persitant objects always drawn first).

Definition at line 913 of file gsInit.h.

◆ DW

int gsGlobal::DW

Total Display Area Width (DW = Width * (MAGH + 1)).

Definition at line 929 of file gsInit.h.

◆ EvenOrOdd

u8 gsGlobal::EvenOrOdd

Is ((GSREG*)CSR)->FIELD (Used for Interlace Correction).

Definition at line 912 of file gsInit.h.

◆ Field

s16 gsGlobal::Field

Field / Frame.

Definition at line 903 of file gsInit.h.

◆ FirstFrame

u8 gsGlobal::FirstFrame

Have we executed a frame yet?

Definition at line 914 of file gsInit.h.

◆ Height

int gsGlobal::Height

Framebuffer Height (the mode's DH is a multiple of this value).

Definition at line 919 of file gsInit.h.

◆ Interlace

s16 gsGlobal::Interlace

Interlace (On/Off).

Definition at line 902 of file gsInit.h.

◆ LockBuffer

volatile u8 gsGlobal::LockBuffer

Used to lock the buffer so it doesn't switch.

Definition at line 917 of file gsInit.h.

◆ MagH

int gsGlobal::MagH

X Magnification Value (MAGH = DW / Width - 1).

Definition at line 927 of file gsInit.h.

◆ MagV

int gsGlobal::MagV

Y Magnification Value (MAGV = DH / Height - 1).

Definition at line 928 of file gsInit.h.

◆ Mode

s16 gsGlobal::Mode

Display Mode.

Definition at line 901 of file gsInit.h.

◆ OffsetX

int gsGlobal::OffsetX

X Window Offset.

Definition at line 921 of file gsInit.h.

◆ OffsetY

int gsGlobal::OffsetY

Y Window Offset.

Definition at line 922 of file gsInit.h.

◆ Os_AllocSize

int gsGlobal::Os_AllocSize

Oneshot Drawbuffer Size (Per Buffer).

Definition at line 937 of file gsInit.h.

◆ Os_Queue

GSQUEUE* gsGlobal::Os_Queue

Draw Queue (Oneshot).

Definition at line 936 of file gsInit.h.

◆ PABE

u8 gsGlobal::PABE

Choose if to do Alpha Blend on a Per-Pixel Basis.

Definition at line 947 of file gsInit.h.

◆ Per_AllocSize

int gsGlobal::Per_AllocSize

Persistent Drawbuffer Size (Per Buffer).

Definition at line 938 of file gsInit.h.

◆ Per_Queue

GSQUEUE* gsGlobal::Per_Queue

Draw Queue (Persistent).

Definition at line 935 of file gsInit.h.

◆ PrimAAEnable

int gsGlobal::PrimAAEnable

Primitive AntiAlaising Enable.

Definition at line 944 of file gsInit.h.

◆ PrimAlpha

u64 gsGlobal::PrimAlpha

Primitive Alpha Value.

Definition at line 946 of file gsInit.h.

◆ PrimAlphaEnable

int gsGlobal::PrimAlphaEnable

Primitive Alpha Blending Enable.

Definition at line 945 of file gsInit.h.

◆ PrimContext

int gsGlobal::PrimContext

Primitive Context.

Definition at line 942 of file gsInit.h.

◆ PrimFogEnable

int gsGlobal::PrimFogEnable

Primitive Fog Enable.

Definition at line 943 of file gsInit.h.

◆ PSM

int gsGlobal::PSM

Pixel Storage Method (Color Mode).

Definition at line 940 of file gsInit.h.

◆ PSMZ

int gsGlobal::PSMZ

ZBuffer Pixel Storage Method.

Definition at line 941 of file gsInit.h.

◆ ScreenBuffer

u32 gsGlobal::ScreenBuffer[2]

Screenbuffer Pointer Array.

Definition at line 910 of file gsInit.h.

◆ StartX

int gsGlobal::StartX

X Starting Coordinate (Used for Placement Correction) Default value.

Definition at line 923 of file gsInit.h.

◆ StartXOffset

int gsGlobal::StartXOffset

X Starting Coordinate (Used for Placement Correction) Additional correction.

Definition at line 925 of file gsInit.h.

◆ StartY

int gsGlobal::StartY

Y Starting Coordinate (Used for Placement Correction) Default value.

Definition at line 924 of file gsInit.h.

◆ StartYOffset

int gsGlobal::StartYOffset

Y Starting Coordinate (Used for Placement Correction) Additional correction.

Definition at line 926 of file gsInit.h.

◆ Test

GSTEST* gsGlobal::Test

TEST Register Value Structure Pointer.

Definition at line 932 of file gsInit.h.

◆ TexturePointer

u32 gsGlobal::TexturePointer

Pointer to beginning of Texture Buffer.

Definition at line 905 of file gsInit.h.

◆ Width

int gsGlobal::Width

Framebuffer Width (the mode's DW is a multiple of this value).

Definition at line 918 of file gsInit.h.

◆ ZBuffer

u32 gsGlobal::ZBuffer

ZBuffer Pointer.

Definition at line 911 of file gsInit.h.

◆ ZBuffering

u8 gsGlobal::ZBuffering

Enable/Disable Z Buffering.

Definition at line 909 of file gsInit.h.


The documentation for this struct was generated from the following file: