From 9bae8900f0d8cf097a2d9e4e58e2e507941c4fd6 Mon Sep 17 00:00:00 2001 From: kyleburnette Date: Tue, 2 Nov 2021 14:56:47 -0700 Subject: [PATCH] sp.c OK (#389) * io/sp OK * Fixed function prototype * Made tharo's suggestions --- src/libultra/io/sp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libultra/io/sp.c b/src/libultra/io/sp.c index 6c829b0627..db2e5b4511 100644 --- a/src/libultra/io/sp.c +++ b/src/libultra/io/sp.c @@ -1,3 +1,10 @@ #include "global.h" -#pragma GLOBAL_ASM("asm/non_matchings/boot/sp/__osSpDeviceBusy.s") +s32 __osSpDeviceBusy(void) { + register u32 status = HW_REG(SP_STATUS_REG, u32); + + if (status & (SP_STATUS_DMA_BUSY | SP_STATUS_DMA_FULL | SP_STATUS_IO_FULL)) { + return true; + } + return false; +}