diff --git a/include/dma.h b/include/dma.h new file mode 100644 index 0000000..8496de7 --- /dev/null +++ b/include/dma.h @@ -0,0 +1,26 @@ +#ifndef _DMA_H_ +#define _DMA_H_ + +struct UnkStruct80000E80 { + char unk0; + char filler4[0x18]; + s32 unk1C; + void *unk20; + s32 unk24; + s32 unk28; +}; + +s32 func_80000E80(s32 arg0, void *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5); +s32 func_80000F0C(s32 arg0, void *arg1, s32 arg2, s32 arg3, s32 arg4); +s32 func_80000F80(s32 arg0, void *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5); +s32 func_8000100C(s32 arg0, void *arg1, s16 arg2, s32 arg3, s32 arg4); +s32 func_80001098(s32 arg0, void *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5); +s32 func_80001124(s32 arg0, s32 arg1); +s32 func_80001184(s32 arg0, s32 arg1, s32 arg2); +s32 func_800011E4(s32 arg0, s32 arg1); +s32 func_8000123C(s32 arg0, s32 arg1); +s32 func_80001298(void *arg0, s32 arg1, s32 arg2); +s16 func_800012F8(void); +s32 func_80001304(void *arg0, s32 arg1, s32 arg2); + +#endif // _DMA_H_ diff --git a/splat.yaml b/splat.yaml index 6611366..a0ec911 100644 --- a/splat.yaml +++ b/splat.yaml @@ -31,7 +31,8 @@ segments: - [0x1060, c, main] # rsp graphics - [0x11B0, bin, noppad_11B0] # There's an extra nop align here, but cant reproduce it with just splat functionality alone. need a . += 0x10 in the linker script at this spot. - [0x11C0, c, rsp] # rsp audio - - [0x1A80, asm] # DMA transfer + - [0x1A80, c, dma] # DMA transfer + - [0x1F70, bin, noppad_1F70] # Extra nop align like earlier. Weird - [0x1F80, asm] # dp intro code - [0x28E0, asm] # dp code - [0x2EC0, asm] # intro loader diff --git a/src/dma.c b/src/dma.c new file mode 100644 index 0000000..fd3618c --- /dev/null +++ b/src/dma.c @@ -0,0 +1,179 @@ +#include +#include "common.h" +#include "dma.h" + +extern u32 D_800818E0; +extern s16 D_80083C1C; + +s32 func_80000E80(s32 arg0, void *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) { + struct UnkStruct80000E80* temp_v0; + + temp_v0 = func_80002FDC(0x2C); + if (temp_v0 != NULL) { + if (arg0 == 0) { + temp_v0->unk0 = 0xF0; + } else { + temp_v0->unk0 = 0xF1; + } + temp_v0->unk1C = arg2; + temp_v0->unk24 = arg3; + temp_v0->unk20 = arg1; + temp_v0->unk28 = arg4; + func_80000E2C(temp_v0, arg5); + } + return temp_v0 == NULL; +} + +s32 func_80000F0C(s32 arg0, void *arg1, s32 arg2, s32 arg3, s32 arg4) { + struct UnkStruct80000E80* temp_v0; + + temp_v0 = func_80002FDC(0x2C); + if (temp_v0 != NULL) { + temp_v0->unk0 = 0xF4; + temp_v0->unk1C = arg1; + temp_v0->unk24 = arg2; + temp_v0->unk20 = arg0; + temp_v0->unk28 = arg3; + func_80000E2C(temp_v0, arg4); + } + return temp_v0 == NULL; +} + +s32 func_80000F80(s32 arg0, void *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) { + struct UnkStruct80000E80* temp_v0; + + temp_v0 = func_80002FDC(0x2C); + if (temp_v0 != NULL) { + if (arg0 == 0) { + temp_v0->unk0 = 0xF2; + } else { + temp_v0->unk0 = 0xF3; + } + temp_v0->unk1C = arg2; + temp_v0->unk24 = arg3; + temp_v0->unk20 = arg1; + temp_v0->unk28 = arg4; + func_80000E2C(temp_v0, arg5); + } + return temp_v0 == NULL; +} + +s32 func_8000100C(s32 arg0, void *arg1, s16 arg2, s32 arg3, s32 arg4) { + struct UnkStruct80000E80* temp_v0; + + temp_v0 = func_80002FDC(0x2C); + if (temp_v0 != NULL) { + if (arg0 == 0) { + temp_v0->unk0 = 0xF5; + } else { + temp_v0->unk0 = 0xF6; + } + temp_v0->unk1C = arg2; + temp_v0->unk24 = 1; + temp_v0->unk20 = arg1; + temp_v0->unk28 = arg3; + func_80000E2C(temp_v0, arg4); + } + return temp_v0 == NULL; +} + +s32 func_80001098(s32 arg0, void *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) { + struct UnkStruct80000E80* temp_v0; + + temp_v0 = func_80002FDC(0x2C); + if (temp_v0 != NULL) { + if (arg0 == 0) { + temp_v0->unk0 = 5; + } else { + temp_v0->unk0 = 6; + } + temp_v0->unk1C = arg2; + temp_v0->unk24 = arg3; + temp_v0->unk20 = arg1; + temp_v0->unk28 = arg4; + func_80000E2C(temp_v0, arg5); + } + return temp_v0 == NULL; +} + +s32 func_80001124(s32 arg0, s32 arg1) { + struct UnkStruct80000E80* temp_v0; + + temp_v0 = func_80002FDC(0x2C); + if (temp_v0 != NULL) { + temp_v0->unk0 = 0xC; + temp_v0->unk20 = &D_800818E0; + temp_v0->unk28 = arg0; + func_80000E2C(temp_v0, arg1); + } + return temp_v0 == NULL; +} + +s32 func_80001184(s32 arg0, s32 arg1, s32 arg2) { + struct UnkStruct80000E80* temp_v0; + + temp_v0 = func_80002FDC(0x2C); + if (temp_v0 != NULL) { + temp_v0->unk0 = 7; + temp_v0->unk1C = arg0; + temp_v0->unk28 = arg1; + func_80000E2C(temp_v0, arg2); + } + return temp_v0 == NULL; +} + +s32 func_800011E4(s32 arg0, s32 arg1) { + struct UnkStruct80000E80 * temp_v0; + + temp_v0 = func_80002FDC(0x2C); + if (temp_v0 != NULL) { + temp_v0->unk0 = 8; + temp_v0->unk1C = 0; + temp_v0->unk28 = arg0; + func_80000E2C(temp_v0, arg1); + } + return temp_v0 == NULL; +} + +s32 func_8000123C(s32 arg0, s32 arg1) { + struct UnkStruct80000E80* temp_v0; + + temp_v0 = func_80002FDC(0x2C); + if (temp_v0 != NULL) { + temp_v0->unk0 = 8; + temp_v0->unk1C = 4; + temp_v0->unk28 = arg0; + func_80000E2C(temp_v0, arg1); + } + return temp_v0 == NULL; +} + +s32 func_80001298(void *arg0, s32 arg1, s32 arg2) { + struct UnkStruct80000E80* temp_v0; + + temp_v0 = func_80002FDC(0x2C); + if (temp_v0 != NULL) { + temp_v0->unk0 = 0xE; + temp_v0->unk20 = arg0; + temp_v0->unk28 = arg1; + func_80000E2C(temp_v0, arg2); + } + return temp_v0 == NULL; +} + +s16 func_800012F8(void) { + return D_80083C1C; +} + +s32 func_80001304(void *arg0, s32 arg1, s32 arg2) { + struct UnkStruct80000E80* temp_v0; + + temp_v0 = func_80002FDC(0x2C); + if (temp_v0 != NULL) { + temp_v0->unk0 = 0xD; + temp_v0->unk20 = arg0; + temp_v0->unk28 = arg1; + func_80000E2C(temp_v0, arg2); + } + return temp_v0 == NULL; +}