KallistiOS git master
Independent SDK for the Sega Dreamcast
|
SH4 CPU Peripheral for burst memory transactions. More...
Files | |
file | sq.h |
Functions to access the SH4 Store Queues. | |
Macros | |
#define | SQ_MASK_DEST_ADDR(dest) |
Mask dest to Store Queue area as address. | |
#define | SQ_MASK_DEST(dest) |
Mask dest to Store Queue area as pointer. | |
#define | sq_flush(dest) |
Write-back one Store Queue. | |
Functions | |
void * | pvr_sq_load (void *dest, const void *src, size_t n, pvr_dma_type_t type) |
Copy a block of memory to VRAM. | |
void * | pvr_sq_set16 (void *dest, uint32_t c, size_t n, pvr_dma_type_t type) |
Set a block of PVR memory to a 16-bit value. | |
void * | pvr_sq_set32 (void *dest, uint32_t c, size_t n, pvr_dma_type_t type) |
Set a block of PVR memory to a 32-bit value. | |
uint32_t * | sq_lock (void *dest) |
Lock Store Queues. | |
void | sq_unlock (void) |
Unlock Store Queues. | |
void | sq_wait (void) |
Wait for both Store Queues to complete. | |
void * | sq_cpy (void *dest, const void *src, size_t n) |
Copy a block of memory. | |
void * | sq_fast_cpy (void *dest, const void *src, size_t n) |
Copy a block of memory. | |
void * | sq_set (void *dest, uint32_t c, size_t n) |
Set a block of memory to an 8-bit value. | |
void * | sq_set16 (void *dest, uint32_t c, size_t n) |
Set a block of memory to a 16-bit value. | |
void * | sq_set32 (void *dest, uint32_t c, size_t n) |
Set a block of memory to a 32-bit value. | |
void | sq_clr (void *dest, size_t n) |
Clear a block of memory. | |
SH4 CPU Peripheral for burst memory transactions.
The store queues are a way to do efficient burst transfers from the CPU to external memory. They can be used in a variety of ways, such as to transfer a texture to PVR memory. The transfers are in units of 32-bytes, and the destinations must be 32-byte aligned.
#define sq_flush | ( | dest | ) |
Write-back one Store Queue.
Initiates write-back from SQ buffer to external memory.
dest | The address to copy to (32-byte aligned). |
#define SQ_MASK_DEST | ( | dest | ) |
Mask dest to Store Queue area as pointer.
#define SQ_MASK_DEST_ADDR | ( | dest | ) |
Mask dest to Store Queue area as address.
void * pvr_sq_load | ( | void * | dest, |
const void * | src, | ||
size_t | n, | ||
pvr_dma_type_t | type ) |
Copy a block of memory to VRAM.
This function is similar to sq_cpy(), but it has been optimized for writing to a destination residing within VRAM.
The dest pointer must be at least 32-byte aligned and reside in video memory, the src pointer must be at least 8-byte aligned, and n must be a multiple of 32.
dest | The address to copy to (32-byte aligned). |
src | The address to copy from (32-bit (8-byte) aligned). |
n | The number of bytes to copy (multiple of 32). |
type | The type of SQ/DMA transfer to do (see list of modes). |
void * pvr_sq_set16 | ( | void * | dest, |
uint32_t | c, | ||
size_t | n, | ||
pvr_dma_type_t | type ) |
Set a block of PVR memory to a 16-bit value.
This function is similar to sq_set16(), but it has been optimized for writing to a destination residing within VRAM.
The dest pointer must be at least 32-byte aligned and reside in video memory, n must be a multiple of 32 and only the low 16-bits are used from c.
dest | The address to begin setting at (32-byte aligned). |
c | The value to set (in the low 16-bits). |
n | The number of bytes to set (multiple of 32). |
type | The type of SQ/DMA transfer to do (see list of modes). |
void * pvr_sq_set32 | ( | void * | dest, |
uint32_t | c, | ||
size_t | n, | ||
pvr_dma_type_t | type ) |
Set a block of PVR memory to a 32-bit value.
This function is similar to sq_set32(), but it has been optimized for writing to a destination residing within VRAM.
The dest pointer must be at least 32-byte aligned and reside in video memory, n must be a multiple of 32.
dest | The address to begin setting at (32-byte aligned). |
c | The value to set. |
n | The number of bytes to set (multiple of 32). |
type | The type of SQ/DMA transfer to do (see list of modes). |
void sq_clr | ( | void * | dest, |
size_t | n ) |
Clear a block of memory.
This function is similar to calling memset() with a value to set of 0, but uses the store queues to do its work.
dest | The address to begin clearing at (32-byte aligned). |
n | The number of bytes to clear (multiple of 32). |
void * sq_cpy | ( | void * | dest, |
const void * | src, | ||
size_t | n ) |
Copy a block of memory.
This function is similar to memcpy4(), but uses the store queues to do its work.
dest | The address to copy to (32-byte aligned). |
src | The address to copy from (32-bit (4/8-byte) aligned). |
n | The number of bytes to copy (multiple of 32). |
void * sq_fast_cpy | ( | void * | dest, |
const void * | src, | ||
size_t | n ) |
Copy a block of memory.
This function is similar to sq_cpy() but expects the user to lock/unlock the store queues before and after as well as having different requirements for the params.
dest | The store queue address to copy to (32-byte aligned). |
src | The address to copy from (8-byte aligned). |
n | The number of 32-byte blocks to copy. |
uint32_t * sq_lock | ( | void * | dest | ) |
Lock Store Queues.
Locks the store queues so that they cannot be used from another thread until unlocked.
dest | The destination address. |
void * sq_set | ( | void * | dest, |
uint32_t | c, | ||
size_t | n ) |
Set a block of memory to an 8-bit value.
This function is similar to calling memset(), but uses the store queues to do its work.
dest | The address to begin setting at (32-byte aligned). |
c | The value to set (in the low 8-bits). |
n | The number of bytes to set (multiple of 32). |
void * sq_set16 | ( | void * | dest, |
uint32_t | c, | ||
size_t | n ) |
Set a block of memory to a 16-bit value.
This function is similar to calling memset2(), but uses the store queues to do its work.
dest | The address to begin setting at (32-byte aligned). |
c | The value to set (in the low 16-bits). |
n | The number of bytes to set (multiple of 32). |
void * sq_set32 | ( | void * | dest, |
uint32_t | c, | ||
size_t | n ) |
Set a block of memory to a 32-bit value.
This function is similar to calling memset4(), but uses the store queues to do its work.
dest | The address to begin setting at (32-byte aligned). |
c | The value to set (all 32-bits). |
n | The number of bytes to set (multiple of 32). |
void sq_unlock | ( | void | ) |
Unlock Store Queues.
Unlocks the store queues so that they can be used from any thread.
void sq_wait | ( | void | ) |
Wait for both Store Queues to complete.
Wait for both store queues to complete by writing to SQ area.