12 #define GX_BUFFER_DIM(w, h) (((h)<<16)|((w)&0xFFFF))
51 #define GX_TRANSFER_FLIP_VERT(x) ((x)<<0)
53 #define GX_TRANSFER_OUT_TILED(x) ((x)<<1)
55 #define GX_TRANSFER_RAW_COPY(x) ((x)<<3)
57 #define GX_TRANSFER_IN_FORMAT(x) ((x)<<8)
59 #define GX_TRANSFER_OUT_FORMAT(x) ((x)<<12)
61 #define GX_TRANSFER_SCALING(x) ((x)<<24)
64 #define GX_CMDLIST_UPDATE_GAS_ACC BIT(0)
66 #define GX_CMDLIST_FLUSH BIT(1)
83 typedef struct tag_gxCmdQueue_s
90 void (* callback)(
struct tag_gxCmdQueue_s*);
void GX_BindQueue(gxCmdQueue_s *queue)
Selects a command queue to which GX_* functions will add commands instead of immediately submitting t...
Result GX_ProcessCommandList(u32 *buf0a, u32 buf0s, u8 flags)
Processes a GPU command list.
GX_TRANSFER_SCALE
Anti-aliasing modes.
Definition: gx.h:34
@ GX_TRANSFER_SCALE_XY
2x2 anti-aliasing
Definition: gx.h:37
@ GX_TRANSFER_SCALE_NO
No anti-aliasing.
Definition: gx.h:35
@ GX_TRANSFER_SCALE_X
2x1 anti-aliasing
Definition: gx.h:36
Result GX_TextureCopy(u32 *inadr, u32 indim, u32 *outadr, u32 outdim, u32 size, u32 flags)
Initiates a texture copy.
void gxCmdQueueAdd(gxCmdQueue_s *queue, const gxCmdEntry_s *entry)
Adds a command to a GX command queue.
Result GX_DisplayTransfer(u32 *inadr, u32 indim, u32 *outadr, u32 outdim, u32 flags)
Initiates a display transfer.
Result GX_RequestDma(u32 *src, u32 *dst, u32 length)
Requests a DMA.
static void gxCmdQueueSetCallback(gxCmdQueue_s *queue, void(*callback)(gxCmdQueue_s *), void *user)
Sets the completion callback for a GX command queue.
Definition: gx.h:133
void gxCmdQueueClear(gxCmdQueue_s *queue)
Clears a GX command queue.
Result GX_MemoryFill(u32 *buf0a, u32 buf0v, u32 *buf0e, u16 control0, u32 *buf1a, u32 buf1v, u32 *buf1e, u16 control1)
Fills the memory of two buffers with the given values.
void gxCmdQueueRun(gxCmdQueue_s *queue)
Runs a GX command queue, causing it to begin processing incoming commands as they arrive.
bool gxCmdQueueWait(gxCmdQueue_s *queue, s64 timeout)
Waits for a GX command queue to finish executing pending commands.
GX_TRANSFER_FORMAT
Supported transfer pixel formats.
Definition: gx.h:19
@ GX_TRANSFER_FMT_RGB565
5-bit Red + 6-bit Green + 5-bit Blue
Definition: gx.h:22
@ GX_TRANSFER_FMT_RGB5A1
5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha
Definition: gx.h:23
@ GX_TRANSFER_FMT_RGB8
8-bit Red + 8-bit Green + 8-bit Blue
Definition: gx.h:21
@ GX_TRANSFER_FMT_RGBA4
4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha
Definition: gx.h:24
@ GX_TRANSFER_FMT_RGBA8
8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha
Definition: gx.h:20
Result GX_FlushCacheRegions(u32 *buf0a, u32 buf0s, u32 *buf1a, u32 buf1s, u32 *buf2a, u32 buf2s)
Flushes the cache regions of three buffers.
void gxCmdQueueStop(gxCmdQueue_s *queue)
Stops a GX command queue from processing incoming commands.
GX_FILL_CONTROL
GX transfer control flags.
Definition: gx.h:42
@ GX_FILL_32BIT_DEPTH
The buffer has a 32 bit per pixel depth.
Definition: gx.h:47
@ GX_FILL_TRIGGER
Trigger the PPF event.
Definition: gx.h:43
@ GX_FILL_16BIT_DEPTH
The buffer has a 16 bit per pixel depth.
Definition: gx.h:45
@ GX_FILL_FINISHED
Indicates if the memory fill is complete. You should not use it when requesting a transfer.
Definition: gx.h:44
@ GX_FILL_24BIT_DEPTH
The buffer has a 24 bit per pixel depth.
Definition: gx.h:46
GX command queue structure.
Definition: gx.h:84
void(* callback)(struct tag_gxCmdQueue_s *)
User callback.
Definition: gx.h:90
u16 numEntries
Number of commands in the queue.
Definition: gx.h:87
void * user
Data for user callback.
Definition: gx.h:91
u16 curEntry
Index of the first pending command to be submitted to GX.
Definition: gx.h:88
u16 lastEntry
Number of commands completed by GX.
Definition: gx.h:89
u16 maxEntries
Capacity of the command array.
Definition: gx.h:86
gxCmdEntry_s * entries
Pointer to array of GX command entries.
Definition: gx.h:85
int64_t s64
64-bit signed integer
Definition: types.h:29
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
s32 Result
Function result.
Definition: types.h:42
uint16_t u16
16-bit unsigned integer
Definition: types.h:22
uint32_t u32
32-bit unsigned integer
Definition: types.h:23
GX command entry.
Definition: gx.h:70
u8 type
Command type.
Definition: gx.h:74