mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-05 09:05:26 -04:00
9649319ec4
* Reorganize files into libs/{dolphin,JSystem,PowerPC_EABI_Support,revolution,TRK_MINNOW_DOLPHIN}
* Update configure.py and project.py for new libs structure
* Refactor `#include <dolphin/x.h>` -> `<x.h>`
* Remove `__REVOLUTION_SDK__` forwards from dolphin
* Fix dolphin/ references in revolution
* Wrap `#include <dolphin.h>` in `!__REVOLUTION_SDK__`
* Always build TRK against dolphin headers
* Resolve revolution SDK header resolution issues
54 lines
966 B
C
54 lines
966 B
C
#include <revolution/ipc.h>
|
|
#include <revolution/os/OSIpc.h>
|
|
#include <revolution/os.h>
|
|
|
|
static void* IPCBufferHi;
|
|
static void* IPCBufferLo;
|
|
|
|
static void* IPCCurrentBufferHi;
|
|
static void* IPCCurrentBufferLo;
|
|
|
|
static u8 Initialized;
|
|
|
|
void IPCInit(void) {
|
|
if (Initialized) {
|
|
return;
|
|
}
|
|
|
|
IPCBufferHi = __OSGetIPCBufferHi();
|
|
IPCBufferLo = __OSGetIPCBufferLo();
|
|
IPCCurrentBufferHi = IPCBufferHi;
|
|
IPCCurrentBufferLo = IPCBufferLo;
|
|
|
|
Initialized = TRUE;
|
|
}
|
|
|
|
#if SDK_AUG2010
|
|
void IPCReInit(void) {
|
|
Initialized = FALSE;
|
|
IPCInit();
|
|
}
|
|
#endif
|
|
|
|
u32 IPCReadReg(u32 regIdx) {
|
|
u32 reg = __IPCRegs[regIdx];
|
|
return reg;
|
|
}
|
|
|
|
void IPCWriteReg(u32 regIdx, u32 data) {
|
|
__IPCRegs[regIdx] = data;
|
|
}
|
|
|
|
void* IPCGetBufferHi(void) {
|
|
return IPCCurrentBufferHi;
|
|
}
|
|
|
|
void* IPCGetBufferLo(void) {
|
|
return IPCCurrentBufferLo;
|
|
}
|
|
|
|
void IPCSetBufferLo(void* newLo) {
|
|
ASSERTLINE(296, IPCBufferLo <= newLo);
|
|
IPCCurrentBufferLo = newLo;
|
|
}
|