libdragon
Macros | Enumerations | Functions

RDP: Hardware Display Interface. More...

Go to the source code of this file.

Macros

#define DP_START   ((volatile uint32_t*)0xA4100000)
 DP start register.
 
#define DP_END   ((volatile uint32_t*)0xA4100004)
 DP end register.
 
#define DP_CURRENT   ((volatile uint32_t*)0xA4100008)
 DP current register.
 
#define DP_STATUS   ((volatile uint32_t*)0xA410000C)
 DP status register.
 
#define DP_CLOCK   ((volatile uint32_t*)0xA4100010)
 DP clock counter.
 
#define DP_BUSY   ((volatile uint32_t*)0xA4100014)
 DP command buffer busy.
 
#define DP_PIPE_BUSY   ((volatile uint32_t*)0xA4100018)
 DP pipe busy.
 
#define DP_TMEM_BUSY   ((volatile uint32_t*)0xA410001C)
 DP tmem busy.
 
#define DP_STATUS_DMEM_DMA   (1 << 0)
 DP is using DMEM DMA.
 
#define DP_STATUS_FREEZE   (1 << 1)
 DP is frozen.
 
#define DP_STATUS_FLUSH   (1 << 2)
 DP is flushed.
 
#define DP_STATUS_GCLK_ALIVE   (1 << 3)
 DP GCLK is alive.
 
#define DP_STATUS_TMEM_BUSY   (1 << 4)
 DP TMEM is busy.
 
#define DP_STATUS_PIPE_BUSY   (1 << 5)
 DP pipeline is busy.
 
#define DP_STATUS_BUSY   (1 << 6)
 DP command unit is busy.
 
#define DP_STATUS_BUFFER_READY   (1 << 7)
 DP command buffer is ready.
 
#define DP_STATUS_DMA_BUSY   (1 << 8)
 DP DMA is busy.
 
#define DP_STATUS_END_VALID   (1 << 9)
 DP command end register is valid.
 
#define DP_STATUS_START_VALID   (1 << 10)
 DP command start register is valid.
 
#define DP_WSTATUS_RESET_XBUS_DMEM_DMA   (1<<0)
 DP_STATUS write mask: clear DP_STATUS_DMEM_DMA bit.
 
#define DP_WSTATUS_SET_XBUS_DMEM_DMA   (1<<1)
 DP_STATUS write mask: set DP_STATUS_DMEM_DMA bit.
 
#define DP_WSTATUS_RESET_FREEZE   (1<<2)
 DP_STATUS write mask: clear DP_STATUS_FREEZE bit.
 
#define DP_WSTATUS_SET_FREEZE   (1<<3)
 DP_STATUS write mask: set DP_STATUS_FREEZE bit.
 
#define DP_WSTATUS_RESET_FLUSH   (1<<4)
 DP_STATUS write mask: clear DP_STATUS_FLUSH bit.
 
#define DP_WSTATUS_SET_FLUSH   (1<<5)
 DP_STATUS write mask: set DP_STATUS_FLUSH bit.
 
#define DP_WSTATUS_RESET_TMEM_COUNTER   (1<<6)
 DP_STATUS write mask: clear TMEM counter.
 
#define DP_WSTATUS_RESET_PIPE_COUNTER   (1<<7)
 DP_STATUS write mask: clear PIPE counter.
 
#define DP_WSTATUS_RESET_CMD_COUNTER   (1<<8)
 DP_STATUS write mask: clear CMD counter.
 
#define DP_WSTATUS_RESET_CLOCK_COUNTER   (1<<9)
 DP_STATUS write mask: clear CLOCK counter.
 

Enumerations

enum  mirror_t { MIRROR_DISABLED , MIRROR_X , MIRROR_Y , MIRROR_XY }
 Mirror settings for textures. More...
 
enum  flush_t { FLUSH_STRATEGY_NONE , FLUSH_STRATEGY_AUTOMATIC }
 Caching strategy for loaded textures. More...
 

Functions

void rdp_enable_blend_fill (void)
 Enable display of 2D filled (untextured) triangles, with possible alpha blending. More...
 
uint32_t rdp_load_texture (uint32_t texslot, uint32_t texloc, mirror_t mirror, sprite_t *sprite)
 Load a sprite into RDP TMEM. More...
 
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. More...
 
void rdp_draw_textured_rectangle (uint32_t texslot, int tx, int ty, int bx, int by, mirror_t mirror)
 Draw a textured rectangle. More...
 
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. More...
 
void rdp_draw_sprite (uint32_t texslot, int x, int y, mirror_t mirror)
 Draw a texture to the screen as a sprite. More...
 
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. More...
 
void rdp_set_blend_color (uint32_t color)
 Set the blend draw color for subsequent filled primitive operations. More...
 
void rdp_draw_filled_triangle (float x1, float y1, float x2, float y2, float x3, float y3)
 Draw a filled triangle. More...
 
void rdp_set_texture_flush (flush_t flush)
 Set the flush strategy for texture loads. More...
 

Detailed Description

RDP: Hardware Display Interface.

Function Documentation

◆ rdp_enable_blend_fill()

void rdp_enable_blend_fill ( void  )

Enable display of 2D filled (untextured) triangles, with possible alpha blending.

This must be called before using rdp_draw_filled_triangle.