sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
dmaCore.h File Reference
#include "dmaKit.h"

Go to the source code of this file.

Macros

#define DMA_SET_CHCR(DIR, MODE, ASP, TTE, TIE, STR, TAG)
#define DMA_SET_MADR(A, B)
#define DMA_SET_TADR(A, B)
#define DMA_SET_ASR0(A, B)
#define DMA_SET_ASR1(A, B)
#define DMA_SET_SADR(A)
#define DMA_SET_SIZE(A)
#define DMA_MAX_SIZE   0xFFFF
#define DMA_REFE   0x0
#define DMA_CNT   0x1
#define DMA_NEXT   0x2
#define DMA_REF   0x3
#define DMA_REFS   0x4
#define DMA_CALL   0x5
#define DMA_RET   0x6
#define DMA_END   0x7
#define DMA_TAG(QWC, PCE, ID, IRQ, ADDR, SPR)

Functions

int dmaKit_wait (u16 channel, u32 timeout)
void dmaKit_wait_fast (void)
void dmaKit_send (u16 channel, void *data, u32 size)
void dmaKit_send_ucab (u16 channel, void *data, u32 size)
void dmaKit_send_spr (u16 channel, void *data, u32 size)
void dmaKit_send_chain (u16 channel, void *data, u32 size)
void dmaKit_send_chain_ucab (u16 channel, void *data)
void dmaKit_send_chain_spr (u16 channel, void *data)
void dmaKit_get_spr (u16 channel, void *data, void *dest, u32 size)

Macro Definition Documentation

◆ DMA_CALL

#define DMA_CALL   0x5

Definition at line 56 of file dmaCore.h.

◆ DMA_CNT

#define DMA_CNT   0x1

Definition at line 52 of file dmaCore.h.

◆ DMA_END

#define DMA_END   0x7

Definition at line 58 of file dmaCore.h.

◆ DMA_MAX_SIZE

#define DMA_MAX_SIZE   0xFFFF

Definition at line 49 of file dmaCore.h.

◆ DMA_NEXT

#define DMA_NEXT   0x2

Definition at line 53 of file dmaCore.h.

◆ DMA_REF

#define DMA_REF   0x3

Definition at line 54 of file dmaCore.h.

◆ DMA_REFE

#define DMA_REFE   0x0

Definition at line 51 of file dmaCore.h.

◆ DMA_REFS

#define DMA_REFS   0x4

Definition at line 55 of file dmaCore.h.

◆ DMA_RET

#define DMA_RET   0x6

Definition at line 57 of file dmaCore.h.

◆ DMA_SET_ASR0

#define DMA_SET_ASR0 ( A,
B )
Value:
(u32)((A) & 0x7FFFFFFF) << 0 | \
(u32)((B) & 0x00000001) << 31

Definition at line 35 of file dmaCore.h.

◆ DMA_SET_ASR1

#define DMA_SET_ASR1 ( A,
B )
Value:
(u32)((A) & 0x7FFFFFFF) << 0 | \
(u32)((B) & 0x00000001) << 31

Definition at line 39 of file dmaCore.h.

◆ DMA_SET_CHCR

#define DMA_SET_CHCR ( DIR,
MODE,
ASP,
TTE,
TIE,
STR,
TAG )
Value:
(u32)((DIR) & 0x00000001) << 0 | (u32)((MODE) & 0x00000003) << 2 | \
(u32)((ASP) & 0x00000003) << 4 | (u32)((TTE ) & 0x00000001) << 6 | \
(u32)((TIE) & 0x00000001) << 7 | (u32)((STR ) & 0x00000001) << 8 | \
(u32)((TAG) & 0x0000FFFF) << 16

Definition at line 21 of file dmaCore.h.

◆ DMA_SET_MADR

#define DMA_SET_MADR ( A,
B )
Value:
(u32)((A) & 0x7FFFFFFF) << 0 | \
(u32)((B) & 0x00000001) << 31

Definition at line 27 of file dmaCore.h.

◆ DMA_SET_SADR

#define DMA_SET_SADR ( A)
Value:
(u32)((A) & 0x00003FFF) << 0

Definition at line 43 of file dmaCore.h.

◆ DMA_SET_SIZE

#define DMA_SET_SIZE ( A)
Value:
(u32)((A) & 0x0000FFFF) << 0

Definition at line 46 of file dmaCore.h.

◆ DMA_SET_TADR

#define DMA_SET_TADR ( A,
B )
Value:
(u32)((A) & 0x7FFFFFFF) << 0 | \
(u32)((B) & 0x00000001) << 31

Definition at line 31 of file dmaCore.h.

◆ DMA_TAG

#define DMA_TAG ( QWC,
PCE,
ID,
IRQ,
ADDR,
SPR )
Value:
( \
((u64)(QWC) << 0) | ((u64)(PCE) << 26) | \
((u64)(ID) << 28) | ((u64)(IRQ) << 31) | \
((u64)(ADDR) << 32) | ((u64)(SPR) << 63))

Definition at line 60 of file dmaCore.h.

Function Documentation

◆ dmaKit_get_spr()

void dmaKit_get_spr ( u16 channel,
void * data,
void * dest,
u32 size )

DMA Get from Scratchpad Routine Transfers data from an external source to the EE. (ex: Scratchpad -> EE Main Memory)

Definition at line 214 of file dmaCore.c.

◆ dmaKit_send()

void dmaKit_send ( u16 channel,
void * data,
u32 size )

DMA Send Routine Standard DMA send routine.

Definition at line 56 of file dmaCore.c.

◆ dmaKit_send_chain()

void dmaKit_send_chain ( u16 channel,
void * data,
u32 size )

DMA Chain Send Routine Sends data over the DMAC using a DMA Chain.

Definition at line 135 of file dmaCore.c.

◆ dmaKit_send_chain_spr()

void dmaKit_send_chain_spr ( u16 channel,
void * data )

DMA Chain Scratchpad Send Sends data over the DMAC using a DMA Chain via the scratchpad.

Definition at line 189 of file dmaCore.c.

◆ dmaKit_send_chain_ucab()

void dmaKit_send_chain_ucab ( u16 channel,
void * data )

DMA Chain UCAB Send Sends data which has been written to RAM using UCAB over the DMAC using a DMA Chain.

Definition at line 163 of file dmaCore.c.

◆ dmaKit_send_spr()

void dmaKit_send_spr ( u16 channel,
void * data,
u32 size )

DMA Scratchpad Send Routine Similar to dmaKit_send, but reads from the scratchpad instead.

Definition at line 110 of file dmaCore.c.

◆ dmaKit_send_ucab()

void dmaKit_send_ucab ( u16 channel,
void * data,
u32 size )

DMA UCAB Send Routine Similar to dmaKit_send, but for UCAB data pointers.

Definition at line 84 of file dmaCore.c.

◆ dmaKit_wait()

int dmaKit_wait ( u16 channel,
u32 timeout )

DMA Wait Routine This routine checks and waits for the DMAC to become free. The other routines in dmaKit use this to know when it's clear to send data over the DMAC.

Definition at line 19 of file dmaCore.c.

◆ dmaKit_wait_fast()

void dmaKit_wait_fast ( void )

DMA Fast Wait Routine This routine does the same as above, but using an accelerated EE instruction method rather than register polling. The channels argument takes a bitmask of the channels you want to wait for.

Definition at line 45 of file dmaCore.c.