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
"
5
#include "
dolphin/os/OSInterrupt.h
"
6
7
#ifdef __cplusplus
8
extern
"C"
{
9
#endif
10
11
volatile
u16
__DSPRegs
[32]
AT_ADDRESS
(0xCC005000);
12
volatile
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
46
typedef
void
(*
DSPCallback
)(
void
* task);
47
48
typedef
struct
DSPTaskInfo
DSPTaskInfo
;
49
50
typedef
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
;
63
/* 0x26 */
u16
dsp_resume_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
;
75
}
DSPTaskInfo
;
76
77
u32
DSPCheckMailToDSP
(
void
);
78
u32
DSPCheckMailFromDSP
(
void
);
79
u32
DSPReadMailFromDSP
(
void
);
80
void
DSPSendMailToDSP
(
u32
mail
);
81
void
DSPAssertInt
();
82
void
DSPInit
(
void
);
83
84
void
__DSPHandler
(
__OSInterrupt
interrupt,
OSContext
*
context
);
85
86
#ifdef __cplusplus
87
}
88
#endif
89
90
#endif
/* DSP_H */
context
static OSContext context
Definition
JUTException.cpp:233
OSInterrupt.h
__OSInterrupt
s16 __OSInterrupt
Definition
OSInterrupt.h:110
OSTime.h
OSTime
s64 OSTime
Definition
OSTime.h:10
cLib_calcTimer
T cLib_calcTimer(T *value)
Definition
c_lib.h:74
DSPCheckMailToDSP
u32 DSPCheckMailToDSP(void)
Definition
dsp.c:12
__DSPHandler
void __DSPHandler(__OSInterrupt interrupt, OSContext *context)
Definition
osdsp_task.cpp:23
AT_ADDRESS
volatile u16 __DSPRegs[32] AT_ADDRESS(0xCC005000)
DSPCallback
void(* DSPCallback)(void *task)
Definition
dsp.h:46
DSPSendMailToDSP
void DSPSendMailToDSP(u32 mail)
Definition
dsp.c:31
DSPInit
void DSPInit(void)
Definition
dsp.c:51
DSPAssertInt
void DSPAssertInt()
Definition
dsp.c:37
DSPReadMailFromDSP
u32 DSPReadMailFromDSP(void)
Definition
dsp.c:22
DSPCheckMailFromDSP
u32 DSPCheckMailFromDSP(void)
Definition
dsp.c:17
DSPTaskInfo
Definition
dsp.h:50
DSPTaskInfo::done_cb
DSPCallback done_cb
Definition
dsp.h:67
DSPTaskInfo::iram_length
u32 iram_length
Definition
dsp.h:55
DSPTaskInfo::dsp_resume_vector
u16 dsp_resume_vector
Definition
dsp.h:63
DSPTaskInfo::next
struct DSPTaskInfo * next
Definition
dsp.h:70
DSPTaskInfo::res_cb
DSPCallback res_cb
Definition
dsp.h:66
DSPTaskInfo::iram_mmem_addr
u16 * iram_mmem_addr
Definition
dsp.h:54
DSPTaskInfo::flags
vu32 flags
Definition
dsp.h:53
DSPTaskInfo::state
vu32 state
Definition
dsp.h:51
DSPTaskInfo::dram_addr
u32 dram_addr
Definition
dsp.h:60
DSPTaskInfo::dsp_init_vector
u16 dsp_init_vector
Definition
dsp.h:62
DSPTaskInfo::t_context
OSTime t_context
Definition
dsp.h:73
DSPTaskInfo::req_cb
DSPCallback req_cb
Definition
dsp.h:68
DSPTaskInfo::init_cb
DSPCallback init_cb
Definition
dsp.h:65
DSPTaskInfo::prev
struct DSPTaskInfo * prev
Definition
dsp.h:71
DSPTaskInfo::t_task
OSTime t_task
Definition
dsp.h:74
DSPTaskInfo::priority
vu32 priority
Definition
dsp.h:52
DSPTaskInfo::iram_addr
u32 iram_addr
Definition
dsp.h:56
DSPTaskInfo::dram_mmem_addr
u16 * dram_mmem_addr
Definition
dsp.h:58
DSPTaskInfo::dram_length
u32 dram_length
Definition
dsp.h:59
OSContext
Definition
OSContext.h:137
u32
unsigned long u32
Definition
types.h:10
u16
unsigned short u16
Definition
types.h:9
vu32
volatile u32 vu32
Definition
types.h:15
include
dolphin
dsp.h
Generated by
1.9.8