_spu_FiDMA (#914)

Trying the remaining one from this again
https://github.com/Xeeynamo/sotn-decomp/pull/859
https://decomp.me/scratch/ergMa
This commit is contained in:
sozud 2023-12-30 11:24:22 -05:00 committed by GitHub
parent 2d2eb200f1
commit b3160407b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 3 deletions

View File

@ -23,8 +23,9 @@ typedef struct tagSpuMalloc {
u32 size;
} SPU_MALLOC;
extern s32 D_80033550;
extern void (* volatile _spu_transferCallback)();
extern s32 _spu_inTransfer;
extern s32 _spu_transferCallback;
void _SpuCallback(s32 arg0);
extern void (*_spu_IRQCallback)();

View File

@ -9,7 +9,6 @@ extern s32 D_80033568[];
extern s32 _spu_EVdma;
extern s32 _spu_mem_mode_plus;
extern s32 _spu_transMode;
extern volatile s32 _spu_transferCallback;
s32 SpuClearReverbWorkArea(s32 rev_mode) {
volatile s32 callback;

View File

@ -25,7 +25,33 @@ INCLUDE_ASM("asm/us/main/nonmatchings/psxsdk/libspu/spu", _spu_init);
INCLUDE_ASM("asm/us/main/nonmatchings/psxsdk/libspu/spu", _spu_writeByIO);
INCLUDE_ASM("asm/us/main/nonmatchings/psxsdk/libspu/spu", _spu_FiDMA);
void _spu_FiDMA(void) {
volatile s32 sp0;
volatile s32 sp4;
s32 var_v1;
volatile SPU_RXX* rxx;
if (D_80033550 == 0) {
WASTE_TIME();
WASTE_TIME();
WASTE_TIME();
}
rxx = &_spu_RXX->rxx;
rxx->spucnt &= 0xFFCF;
for (var_v1 = 0; rxx->spucnt & 0x30; var_v1++) {
if (var_v1 + 1 > 0xF00) {
break;
}
}
if (_spu_transferCallback) {
_spu_transferCallback();
return;
}
DeliverEvent(0xF0000009U, 0x20U);
}
extern s32* D_80033508;
extern s32* D_8003350C;