Link dsp.c

Former-commit-id: 65ea70e44b
This commit is contained in:
Phillip Stephens 2022-10-22 09:49:11 -07:00
parent b7d74c3237
commit 599aa5347e
4 changed files with 47 additions and 4 deletions

View File

@ -21,7 +21,8 @@
"sipriv.h": "c",
"dvd_regs.h": "c",
"dvd.h": "c",
"dvdpriv.h": "c"
"dvdpriv.h": "c",
"__ppc_eabi_linker.h": "c"
},
"files.autoSave": "onFocusChange",
"files.insertFinalNewline": true,

View File

@ -759,7 +759,7 @@ LIBS = [
"cflags": "$cflags_base",
"host": False,
"objects": [
["Dolphin/dsp/dsp", False],
["Dolphin/dsp/dsp", True],
["Dolphin/dsp/dsp_debug", True],
"Dolphin/dsp/dsp_task",
],

View File

@ -648,7 +648,7 @@ DB_FILES :=\
$(BUILD_DIR)/src/Dolphin/db.ep.o\
DSP_FILES :=\
$(BUILD_DIR)/asm/Dolphin/dsp/dsp.o\
$(BUILD_DIR)/src/Dolphin/dsp/dsp.ep.o\
$(BUILD_DIR)/src/Dolphin/dsp/dsp_debug.o\
$(BUILD_DIR)/asm/Dolphin/dsp/dsp_task.o

View File

@ -83,6 +83,7 @@ void DSPHalt(void) {
u32 DSPGetDMAStatus(void) { return __DSPRegs[5] & 0x200; }
#if NONMATCHING
DSPTaskInfo* DSPAddTask(DSPTaskInfo* task) {
u32 oldInt;
oldInt = OSDisableInterrupts();
@ -96,7 +97,48 @@ DSPTaskInfo* DSPAddTask(DSPTaskInfo* task) {
return task;
}
#else
#pragma push
#include "__ppc_eabi_linker.h"
/* clang-format off */
#pragma optimization_level 0
#pragma optimizewithasm off
extern void __DSP_insert_task(DSPTaskInfo* task);
asm DSPTaskInfo* DSPAddTask(DSPTaskInfo* task) {
nofralloc
mflr r0
stw r0, 4(r1)
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
stw r30, 0x10(r1)
mr r30, r3
bl OSDisableInterrupts
addi r31, r3, 0
addi r3, r30, 0
bl __DSP_insert_task
li r0, 0
stw r0, 0(r30)
li r0, 1
addi r3, r31, 0
stw r0, 8(r30)
bl OSRestoreInterrupts
lwz r0, __DSP_first_task
cmplw r30, r0
bne lbl_8036FBB4
mr r3, r30
bl __DSP_boot_task
lbl_8036FBB4:
mr r3, r30
lwz r0, 0x1c(r1)
lwz r31, 0x14(r1)
lwz r30, 0x10(r1)
addi r1, r1, 0x18
mtlr r0
blr
}
#endif
/* clang-format on */
#pragma pop
#ifdef __cplusplus
}
#endif