mirror of
https://github.com/HarbourMasters/Starship
synced 2026-05-23 06:54:39 -04:00
decomp __osAiDeviceBusy
This commit is contained in:
+18
-2
@@ -1,3 +1,19 @@
|
||||
#include "common.h"
|
||||
#include "global.h"
|
||||
#include "PR/rcp.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/us/nonmatchings/libultra/io/ai/__osAiDeviceBusy.s")
|
||||
// TODO: Put in proper header:
|
||||
typedef unsigned long int uintptr_t;
|
||||
|
||||
#define HW_REG(reg, type) *(volatile type*)(uintptr_t)((reg) | 0xa0000000)
|
||||
#define AI_STATUS_REG 0x0450000C
|
||||
#define AI_STATUS_AI_FULL (1 << 31)
|
||||
|
||||
s32 __osAiDeviceBusy(void) {
|
||||
register s32 status = HW_REG(AI_STATUS_REG, u32);
|
||||
|
||||
if (status & AI_STATUS_AI_FULL) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user