Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
dsp.h
Go to the documentation of this file.
1#ifndef DSP_H
2#define DSP_H
3
4#include "dolphin/os/OSTime.h"
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11volatile u16 __DSPRegs[32] AT_ADDRESS(0xCC005000);
12volatile u32 __AIRegs[8] AT_ADDRESS(0xCC006C00);
13
14#define DSP_TASK_FLAG_CLEARALL 0x00000000
15#define DSP_TASK_FLAG_ATTACHED 0x00000001
16#define DSP_TASK_FLAG_CANCEL 0x00000002
17
18#define DSP_TASK_STATE_INIT 0
19#define DSP_TASK_STATE_RUN 1
20#define DSP_TASK_STATE_YIELD 2
21#define DSP_TASK_STATE_DONE 3
22
23#define DSP_MAILBOX_IN_HI (0)
24#define DSP_MAILBOX_IN_LO (1)
25#define DSP_MAILBOX_OUT_HI (2)
26#define DSP_MAILBOX_OUT_LO (3)
27#define DSP_CONTROL_STATUS (5)
28
29#define DSP_ARAM_SIZE (9)
30#define DSP_ARAM_MODE (11)
31#define DSP_ARAM_REFRESH (13)
32#define DSP_ARAM_DMA_MM_HI (16) // Main mem address
33#define DSP_ARAM_DMA_MM_LO (17)
34#define DSP_ARAM_DMA_ARAM_HI (18) // ARAM address
35#define DSP_ARAM_DMA_ARAM_LO (19)
36#define DSP_ARAM_DMA_SIZE_HI (20) // DMA buffer size
37#define DSP_ARAM_DMA_SIZE_LO (21)
38
39#define DSP_DMA_START_HI (24) // DMA start address
40#define DSP_DMA_START_LO (25)
41#define DSP_DMA_CONTROL_LEN (27)
42#define DSP_DMA_BYTES_LEFT (29)
43
44#define DSP_DMA_START_FLAG (0x8000) // set to start DSP
45
46typedef void (*DSPCallback)(void* task);
47
48typedef struct DSPTaskInfo DSPTaskInfo;
49
50typedef struct DSPTaskInfo {
51 /* 0x00 */ vu32 state;
52 /* 0x04 */ vu32 priority;
53 /* 0x08 */ vu32 flags;
54 /* 0x0C */ u16* iram_mmem_addr;
55 /* 0x10 */ u32 iram_length;
56 /* 0x14 */ u32 iram_addr;
57
58 /* 0x18 */ u16* dram_mmem_addr;
59 /* 0x1C */ u32 dram_length;
60 /* 0x20 */ u32 dram_addr;
61
62 /* 0x24 */ u16 dsp_init_vector;
64
65 /* 0x28 */ DSPCallback init_cb;
66 /* 0x2C */ DSPCallback res_cb;
67 /* 0x30 */ DSPCallback done_cb;
68 /* 0x34 */ DSPCallback req_cb;
69
70 /* 0x38 */ struct DSPTaskInfo* next;
71 /* 0x3C */ struct DSPTaskInfo* prev;
72
73 /* 0x40 */ OSTime t_context;
74 /* 0x48 */ OSTime t_task;
76
81void DSPAssertInt();
82void DSPInit(void);
83
85
86#ifdef __cplusplus
87}
88#endif
89
90#endif /* DSP_H */
static OSContext context
Definition JUTException.cpp:233
s16 __OSInterrupt
Definition OSInterrupt.h:110
s64 OSTime
Definition OSTime.h:10
T cLib_calcTimer(T *value)
Definition c_lib.h:74
u32 DSPCheckMailToDSP(void)
Definition dsp.c:12
void __DSPHandler(__OSInterrupt interrupt, OSContext *context)
Definition osdsp_task.cpp:23
volatile u16 __DSPRegs[32] AT_ADDRESS(0xCC005000)
void(* DSPCallback)(void *task)
Definition dsp.h:46
void DSPSendMailToDSP(u32 mail)
Definition dsp.c:31
void DSPInit(void)
Definition dsp.c:51
void DSPAssertInt()
Definition dsp.c:37
u32 DSPReadMailFromDSP(void)
Definition dsp.c:22
u32 DSPCheckMailFromDSP(void)
Definition dsp.c:17
Definition dsp.h:50
DSPCallback done_cb
Definition dsp.h:67
u32 iram_length
Definition dsp.h:55
u16 dsp_resume_vector
Definition dsp.h:63
struct DSPTaskInfo * next
Definition dsp.h:70
DSPCallback res_cb
Definition dsp.h:66
u16 * iram_mmem_addr
Definition dsp.h:54
vu32 flags
Definition dsp.h:53
vu32 state
Definition dsp.h:51
u32 dram_addr
Definition dsp.h:60
u16 dsp_init_vector
Definition dsp.h:62
OSTime t_context
Definition dsp.h:73
DSPCallback req_cb
Definition dsp.h:68
DSPCallback init_cb
Definition dsp.h:65
struct DSPTaskInfo * prev
Definition dsp.h:71
OSTime t_task
Definition dsp.h:74
vu32 priority
Definition dsp.h:52
u32 iram_addr
Definition dsp.h:56
u16 * dram_mmem_addr
Definition dsp.h:58
u32 dram_length
Definition dsp.h:59
Definition OSContext.h:137
unsigned long u32
Definition types.h:10
unsigned short u16
Definition types.h:9
volatile u32 vu32
Definition types.h:15