65#define G2_DMA_CHAN_SPU 0
66#define G2_DMA_CHAN_BBA 1
67#define G2_DMA_CHAN_CH2 2
68#define G2_DMA_CHAN_CH3 3
77#define G2_DMA_TO_SH4 1
124 uint32_t dir, uint32_t mode, uint32_t g2chn, uint32_t sh4chn);
149#define G2_DMA_SUSPEND_SPU (*((vuint32 *)0xa05f781C))
150#define G2_DMA_SUSPEND_BBA (*((vuint32 *)0xa05f783C))
151#define G2_DMA_SUSPEND_CH2 (*((vuint32 *)0xa05f785C))
168 G2_DMA_SUSPEND_SPU = 1;
169 G2_DMA_SUSPEND_BBA = 1;
170 G2_DMA_SUSPEND_CH2 = 1;
186 G2_DMA_SUSPEND_SPU = 0;
187 G2_DMA_SUSPEND_BBA = 0;
188 G2_DMA_SUSPEND_CH2 = 0;
194#undef G2_DMA_SUSPEND_SPU
195#undef G2_DMA_SUSPEND_BBA
196#undef G2_DMA_SUSPEND_CH2
Macros to assess FIFO status.
void irq_restore(irq_mask_t v)
Restore IRQ state.
irq_mask_t irq_disable(void)
Disable interrupts.
#define FIFO_G2
Definition fifo.h:53
#define FIFO_SH4
Definition fifo.h:54
#define FIFO_STATUS
Address of the FIFO status register.
Definition fifo.h:35
void g2_write_32(uintptr_t address, uint32_t value)
Write a 32-bit dword to G2.
uint16 g2_read_16(uintptr_t address)
Read one 16-bit word from G2.
static void g2_unlock(g2_ctx_t ctx)
Enable IRQs and G2 DMA.
Definition g2bus.h:184
void g2_read_block_16(uint16_t *output, uintptr_t address, size_t amt)
Read a block of words from G2.
void g2_write_block_8(const uint8_t *input, uintptr_t address, size_t amt)
Write a block of bytes to G2.
int g2_dma_init(void)
Initialize DMA support.
void g2_memset_8(uintptr_t address, uint8_t c, size_t amt)
Set a block of bytes to G2.
static g2_ctx_t g2_lock(void)
Disable IRQs and G2 DMA.
Definition g2bus.h:162
void(* g2_dma_callback_t)(void *data)
G2Bus DMA interrupt callback type.
Definition g2bus.h:88
void g2_write_8(uintptr_t address, uint8_t value)
Write a single byte to G2.
int g2_dma_transfer(void *sh4, void *g2bus, size_t length, uint32_t block, g2_dma_callback_t callback, void *cbdata, uint32_t dir, uint32_t mode, uint32_t g2chn, uint32_t sh4chn)
Perform a DMA transfer between SH-4 RAM and G2 Bus.
void g2_write_16(uintptr_t address, uint16_t value)
Write a 16-bit word to G2.
uint32_t g2_read_32(uintptr_t address)
Read one 32-bit dword from G2.
uint8_t g2_read_8(uintptr_t address)
Read one byte from G2.
void g2_read_block_8(uint8_t *output, uintptr_t address, size_t amt)
Read a block of bytes from G2.
void g2_dma_shutdown(void)
Shutdown DMA support.
void g2_write_block_16(const uint16_t *input, uintptr_t address, size_t amt)
Write a block of words to G2.
void g2_write_block_32(const uint32_t *input, uintptr_t address, size_t amt)
Write a block of dwords to G2.
void g2_read_block_32(uint32_t *output, uintptr_t address, size_t amt)
Read a block of dwords from G2.
void g2_fifo_wait(void)
Wait for the G2 write FIFO to empty.
unsigned short uint16
16-bit unsigned integer
Definition types.h:34
Interrupt and exception handling.
G2 context.
Definition g2bus.h:142
int irq_state
Definition g2bus.h:143