From 9200805699b387f7620aafe9c6e41d401135d6f1 Mon Sep 17 00:00:00 2001 From: Ryan Myers Date: Thu, 21 Oct 2021 08:52:04 -0400 Subject: [PATCH] __osSiDeviceBusy from libreultra --- lib/src/os/si.c | 12 ++++++++++++ lib/src/os/unknown_0D5EC0.c | 3 +-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 lib/src/os/si.c diff --git a/lib/src/os/si.c b/lib/src/os/si.c new file mode 100644 index 00000000..2d627a7f --- /dev/null +++ b/lib/src/os/si.c @@ -0,0 +1,12 @@ +/* The comment below is needed for this file to be picked up by generate_ld */ +/* RAM_POS: 0x800D52C0 */ + +#include "libultra_internal.h" +#include "siint.h" + +int __osSiDeviceBusy() { + register u32 stat = IO_READ(SI_STATUS_REG); + if (stat & (SI_STATUS_DMA_BUSY | SI_STATUS_RD_BUSY)) + return 1; + return 0; +} diff --git a/lib/src/os/unknown_0D5EC0.c b/lib/src/os/unknown_0D5EC0.c index 34e43d5b..00860e71 100644 --- a/lib/src/os/unknown_0D5EC0.c +++ b/lib/src/os/unknown_0D5EC0.c @@ -1,11 +1,10 @@ /* The comment below is needed for this file to be picked up by generate_ld */ -/* RAM_POS: 0x800D52C0 */ +/* RAM_POS: 0x800D52EC */ #include "macros.h" #include "libultra_internal.h" #include "viint.h" -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osSiDeviceBusy.s") GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osSumcalc.s") GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osIdCheckSum.s") GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osRepairPackId.s")