6#ifndef __LIBDRAGON_RDP_H
7#define __LIBDRAGON_RDP_H
24#define DP_START ((volatile uint32_t*)0xA4100000)
27#define DP_END ((volatile uint32_t*)0xA4100004)
30#define DP_CURRENT ((volatile uint32_t*)0xA4100008)
33#define DP_STATUS ((volatile uint32_t*)0xA410000C)
36#define DP_CLOCK ((volatile uint32_t*)0xA4100010)
39#define DP_BUSY ((volatile uint32_t*)0xA4100014)
42#define DP_PIPE_BUSY ((volatile uint32_t*)0xA4100018)
45#define DP_TMEM_BUSY ((volatile uint32_t*)0xA410001C)
48#define DP_STATUS_DMEM_DMA (1 << 0)
50#define DP_STATUS_FREEZE (1 << 1)
52#define DP_STATUS_FLUSH (1 << 2)
54#define DP_STATUS_GCLK_ALIVE (1 << 3)
56#define DP_STATUS_TMEM_BUSY (1 << 4)
58#define DP_STATUS_PIPE_BUSY (1 << 5)
60#define DP_STATUS_BUSY (1 << 6)
62#define DP_STATUS_BUFFER_READY (1 << 7)
64#define DP_STATUS_DMA_BUSY (1 << 8)
66#define DP_STATUS_END_VALID (1 << 9)
68#define DP_STATUS_START_VALID (1 << 10)
70#define DP_WSTATUS_RESET_XBUS_DMEM_DMA (1<<0)
71#define DP_WSTATUS_SET_XBUS_DMEM_DMA (1<<1)
72#define DP_WSTATUS_RESET_FREEZE (1<<2)
73#define DP_WSTATUS_SET_FREEZE (1<<3)
74#define DP_WSTATUS_RESET_FLUSH (1<<4)
75#define DP_WSTATUS_SET_FLUSH (1<<5)
76#define DP_WSTATUS_RESET_TMEM_COUNTER (1<<6)
77#define DP_WSTATUS_RESET_PIPE_COUNTER (1<<7)
78#define DP_WSTATUS_RESET_CMD_COUNTER (1<<8)
79#define DP_WSTATUS_RESET_CLOCK_COUNTER (1<<9)
335__attribute__((deprecated(
"use rdpq_init instead")))
336void rdp_init(
void );
338__attribute__((deprecated("use
rdpq_close instead")))
339void rdp_close(
void );
341__attribute__((deprecated("use
rdpq_attach instead")))
342static inline
void rdp_attach(
surface_t *surface )
347__attribute__((deprecated(
"use rdpq_detach_cb instead")))
348static inline
void rdp_detach_async(
void (*cb)(
void*),
void *arg )
353__attribute__((deprecated(
"use rdpq_detach_wait instead")))
354void rdp_detach(
void );
357static inline
bool rdp_is_attached(
void )
362__attribute__((deprecated(
"use rdpq_detach_show instead")))
363static inline
void rdp_detach_show(
surface_t *disp )
368__attribute__((deprecated(
"use rdpq_attach instead")))
374__attribute__((deprecated(
"use rdqp_detach_wait instead")))
375static inline
void rdp_detach_display(
void )
380__attribute__((deprecated(
"use rdpq_set_scissor instead")))
381void rdp_set_clipping( uint32_t tx, uint32_t ty, uint32_t bx, uint32_t by );
383__attribute__((deprecated("default clipping is activated automatically during rdp_attach_display")))
384void rdp_set_default_clipping(
void );
386__attribute__((deprecated("syncs are now performed automatically -- or use rdpq_sync_* functions otherwise")))
387void rdp_sync( sync_t sync );
390void rdp_draw_filled_rectangle(
int tx,
int ty,
int bx,
int by );
393static inline
void rdp_set_primitive_color(uint32_t color) {
398__attribute__((deprecated(
"use rdpq_set_mode_fill instead")))
399void rdp_enable_primitive_fill(
void );
402void rdp_enable_texture_copy(
void );
void display_show(surface_t *surf)
Display a buffer on the screen.
Definition display.c:340
void rdp_draw_textured_rectangle_scaled(uint32_t texslot, int tx, int ty, int bx, int by, double x_scale, double y_scale, mirror_t mirror)
Draw a textured rectangle with a scaled texture.
Definition rdp.c:228
void rdp_set_texture_flush(flush_t flush)
Set the flush strategy for texture loads.
Definition rdp.c:288
uint32_t rdp_load_texture(uint32_t texslot, uint32_t texloc, mirror_t mirror, sprite_t *sprite)
Load a sprite into RDP TMEM.
Definition rdp.c:197
void rdp_draw_sprite_scaled(uint32_t texslot, int x, int y, double x_scale, double y_scale, mirror_t mirror)
Draw a texture to the screen as a scaled sprite.
Definition rdp.c:265
mirror_t
Mirror settings for textures.
Definition rdp.h:85
void rdp_draw_textured_rectangle(uint32_t texslot, int tx, int ty, int bx, int by, mirror_t mirror)
Draw a textured rectangle.
Definition rdp.c:253
void rdp_draw_sprite(uint32_t texslot, int x, int y, mirror_t mirror)
Draw a texture to the screen as a sprite.
Definition rdp.c:259
uint32_t rdp_load_texture_stride(uint32_t texslot, uint32_t texloc, mirror_t mirror, sprite_t *sprite, int offset)
Load part of a sprite into RDP TMEM.
Definition rdp.c:208
void rdp_draw_filled_triangle(float x1, float y1, float x2, float y2, float x3, float y3)
Draw a filled triangle.
Definition rdp.c:280
flush_t
Caching strategy for loaded textures.
Definition rdp.h:100
void rdp_set_blend_color(uint32_t color)
Set the blend draw color for subsequent filled primitive operations.
Definition rdp.c:275
@ MIRROR_X
Enable texture mirroring on x axis.
Definition rdp.h:89
@ MIRROR_Y
Enable texture mirroring on y axis.
Definition rdp.h:91
@ MIRROR_XY
Enable texture mirroring on both x & y axis.
Definition rdp.h:93
@ MIRROR_DISABLED
Disable texture mirroring.
Definition rdp.h:87
@ FLUSH_STRATEGY_AUTOMATIC
Cache will be flushed on all incoming textures.
Definition rdp.h:104
@ FLUSH_STRATEGY_NONE
Textures are assumed to be pre-flushed.
Definition rdp.h:102
void rdp_enable_blend_fill(void)
Enable display of 2D filled (untextured) triangles, with possible alpha blending.
void rdpq_set_fill_color(color_t color)
Enqueue a SET_FILL_COLOR RDP command.
Definition rdpq.h:837
void rdpq_close()
Shutdown the RDPQ library.
Definition rdpq.c:487
void __rdpq_write8_syncchange(uint32_t cmd_id, uint32_t arg0, uint32_t arg1, uint32_t autosync)
Write a standard 8-byte RDP command, which changes some autosync resources
Definition rdpq.c:911
void rdpq_detach_cb(void(*cb)(void *), void *arg)
Detach the RDP from the current surface, and call a callback when the RDP has finished drawing to it.
Definition rdpq_attach.c:123
void rdpq_attach(const surface_t *surf_color, const surface_t *surf_z)
Attach the RDP to a color surface (and optionally a Z buffer)
Definition rdpq_attach.c:76
void rdpq_detach(void)
Detach the RDP from the current surface, and restore the previous one.
Definition rdpq_attach.h:137
bool rdpq_is_attached(void)
Check if the RDP is currently attached to a surface.
Definition rdpq_attach.c:22
RDP Command queue: surface attachment API.
void rdpq_set_mode_copy(bool transparency)
Reset render mode to COPY type.
Definition rdpq_mode.c:84
#define rdpq_fill_rectangle(x0, y0, x1, y1)
Draw a filled rectangle (RDP command: FILL_RECTANGLE)
Definition rdpq_rect.h:249
Sprite structure.
Definition sprite.h:40
A surface buffer for graphics.
Definition surface.h:138