7 #define GSP_SCREEN_TOP 0
8 #define GSP_SCREEN_BOTTOM 1
9 #define GSP_SCREEN_WIDTH 240
10 #define GSP_SCREEN_HEIGHT_TOP 400
11 #define GSP_SCREEN_HEIGHT_TOP_2X 800
12 #define GSP_SCREEN_HEIGHT_BOTTOM 320
145 #define gspWaitForPSC0() gspWaitForEvent(GSPGPU_EVENT_PSC0, false)
148 #define gspWaitForPSC1() gspWaitForEvent(GSPGPU_EVENT_PSC1, false)
151 #define gspWaitForVBlank() gspWaitForVBlank0()
154 #define gspWaitForVBlank0() gspWaitForEvent(GSPGPU_EVENT_VBlank0, true)
157 #define gspWaitForVBlank1() gspWaitForEvent(GSPGPU_EVENT_VBlank1, true)
160 #define gspWaitForPPF() gspWaitForEvent(GSPGPU_EVENT_PPF, false)
163 #define gspWaitForP3D() gspWaitForEvent(GSPGPU_EVENT_P3D, false)
166 #define gspWaitForDMA() gspWaitForEvent(GSPGPU_EVENT_DMA, false)
bool gspIsPresentPending(unsigned screen)
Returns true if a prior gspPresentBuffer command is still pending to be processed by GSP.
Result gspInit(void)
Initializes GSPGPU.
GSPGPU_Event
GSPGPU events.
Definition: gspgpu.h:53
@ GSPGPU_EVENT_MAX
Used to know how many events there are.
Definition: gspgpu.h:62
@ GSPGPU_EVENT_PPF
Display transfer finished.
Definition: gspgpu.h:58
@ GSPGPU_EVENT_VBlank0
TODO.
Definition: gspgpu.h:56
@ GSPGPU_EVENT_DMA
TODO.
Definition: gspgpu.h:60
@ GSPGPU_EVENT_PSC0
Memory fill completed.
Definition: gspgpu.h:54
@ GSPGPU_EVENT_PSC1
TODO.
Definition: gspgpu.h:55
@ GSPGPU_EVENT_VBlank1
TODO.
Definition: gspgpu.h:57
@ GSPGPU_EVENT_P3D
Command list processing finished.
Definition: gspgpu.h:59
Result GSPGPU_SetLcdForceBlack(u8 flags)
Sets whether to force the LCD to black.
void gspExit(void)
Exits GSPGPU.
Result GSPGPU_FlushDataCache(const void *adr, u32 size)
Flushes memory from the data cache.
Result GSPGPU_AcquireRight(u8 flags)
Acquires GPU rights.
void gspSetEventCallback(GSPGPU_Event id, ThreadFunc cb, void *data, bool oneShot)
Configures a callback to run when a GSPGPU event occurs.
Result gspSubmitGxCommand(const u32 gxCommand[0x8])
Submits a GX command.
Handle * gspGetSessionHandle(void)
Gets a pointer to the current gsp::Gpu session handle.
Result GSPGPU_SetLedForceOff(bool disable)
Sets 3D_LEDSTATE to the input state value.
Result GSPGPU_RegisterInterruptRelayQueue(Handle eventHandle, u32 flags, Handle *outMemHandle, u8 *threadID)
Registers the interrupt relay queue.
Result GSPGPU_SaveVramSysArea(void)
Saves the VRAM sys area.
Result GSPGPU_RestoreVramSysArea(void)
Restores the VRAM sys area.
Result GSPGPU_ImportDisplayCaptureInfo(GSPGPU_CaptureInfo *captureinfo)
Retrieves display capture info.
Result GSPGPU_WriteHWRegs(u32 regAddr, const u32 *data, u8 size)
Writes to GPU hardware registers.
Result GSPGPU_UnregisterInterruptRelayQueue(void)
Unregisters the interrupt relay queue.
GSPGPU_Event gspWaitForAnyEvent(void)
Waits for any GSPGPU event to occur.
static unsigned gspGetBytesPerPixel(GSPGPU_FramebufferFormat format)
Gets the number of bytes per pixel for the specified format.
Definition: gspgpu.h:70
void gspWaitForEvent(GSPGPU_Event id, bool nextEvent)
Waits for a GSPGPU event to occur.
Result GSPGPU_ReleaseRight(void)
Releases GPU rights.
Result GSPGPU_TriggerCmdReqQueue(void)
Triggers a handling of commands written to shared memory.
bool gspHasGpuRight(void)
Returns true if the application currently has GPU rights.
Result GSPGPU_InvalidateDataCache(const void *adr, u32 size)
Invalidates memory in the data cache.
bool gspPresentBuffer(unsigned screen, unsigned swap, const void *fb_a, const void *fb_b, u32 stride, u32 mode)
Presents a buffer to the specified screen.
Result GSPGPU_WriteHWRegsWithMask(u32 regAddr, const u32 *data, u8 datasize, const u32 *maskdata, u8 masksize)
Writes to GPU hardware registers with a mask.
GSPGPU_FramebufferFormat
Framebuffer format.
Definition: gspgpu.h:28
@ GSP_RGB5_A1_OES
RGB5A1. (2 bytes)
Definition: gspgpu.h:32
@ GSP_RGBA4_OES
RGBA4. (2 bytes)
Definition: gspgpu.h:33
@ GSP_BGR8_OES
BGR8. (3 bytes)
Definition: gspgpu.h:30
@ GSP_RGBA8_OES
RGBA8. (4 bytes)
Definition: gspgpu.h:29
@ GSP_RGB565_OES
RGB565. (2 bytes)
Definition: gspgpu.h:31
Result GSPGPU_ResetGpuCore(void)
Resets the GPU.
Result GSPGPU_ReadHWRegs(u32 regAddr, u32 *data, u8 size)
Reads from GPU hardware registers.
Result GSPGPU_SetBufferSwap(u32 screenid, const GSPGPU_FramebufferInfo *framebufinfo)
Updates a screen's framebuffer state.
Capture info entry.
Definition: gspgpu.h:38
u32 format
Framebuffer format.
Definition: gspgpu.h:41
u32 * framebuf1_vaddr
Right framebuffer.
Definition: gspgpu.h:40
u32 * framebuf0_vaddr
Left framebuffer.
Definition: gspgpu.h:39
u32 framebuf_widthbytesize
Framebuffer pitch.
Definition: gspgpu.h:42
Capture info.
Definition: gspgpu.h:47
Framebuffer information.
Definition: gspgpu.h:16
u32 unk
Unknown.
Definition: gspgpu.h:23
u32 framebuf_widthbytesize
Value for 0x1EF00X90, controls framebuffer width.
Definition: gspgpu.h:20
u32 format
Framebuffer format, this u16 is written to the low u16 for LCD register 0x1EF00X70.
Definition: gspgpu.h:21
u32 * framebuf0_vaddr
Framebuffer virtual address, for the main screen this is the 3D left framebuffer.
Definition: gspgpu.h:18
u32 active_framebuf
Active framebuffer. (0 = first, 1 = second)
Definition: gspgpu.h:17
u32 * framebuf1_vaddr
For the main screen: 3D right framebuffer address.
Definition: gspgpu.h:19
u32 framebuf_dispselect
Value for 0x1EF00X78, controls which framebuffer is displayed.
Definition: gspgpu.h:22
void(* ThreadFunc)(void *)
Thread entrypoint function.
Definition: types.h:43
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
u32 Handle
Resource handle.
Definition: types.h:41
s32 Result
Function result.
Definition: types.h:42
uint32_t u32
32-bit unsigned integer
Definition: types.h:23