System level functions

This commit is contained in:
Seeky 2020-12-22 17:22:05 +00:00
parent 5b354d19fb
commit 830fcdff01
2 changed files with 30 additions and 4 deletions

View File

@ -4,7 +4,9 @@
typedef struct {
u8 unknown_0x0[0x4 - 0x0];
u32 unknown_0x4;
u8 unknown_0x8[0xf8 - 0x8];
u8 unknown_0x8[0x10 - 0x8];
u32 systemLevelFlags;
u8 unknown_0x14[0xf8 - 0x14];
s64 time;
u8 unknown_0x100[0x140 - 0x100];
s32 gsw0;

View File

@ -1,7 +1,8 @@
#include <common.h>
#include <evtmgr.h>
#include <spmario.h>
SpmarioGlobals marioSt;
SpmarioGlobals spmario;
SpmarioGlobals * gp = &spmario;
s32 _spmarioSystemLevel;
@ -11,8 +12,31 @@ s32 _spmarioSystemLevel;
// spmarioInit
// spmarioMain
// spmarioDisp
// spmarioSystemLevel
// spmarioGetSystemLevel
void spmarioSystemLevel(s32 level) {
switch (level) {
case 0:
_spmarioSystemLevel = level;
gp->systemLevelFlags &= ~3;
evtStartAll(0xff);
break;
case 1:
_spmarioSystemLevel = level;
gp->systemLevelFlags |= 1;
evtStopAll(7);
break;
case 2:
_spmarioSystemLevel = level;
gp->systemLevelFlags |= 3;
evtStopAll(0xff);
break;
}
}
s32 spmarioGetSystemLevel() {
return _spmarioSystemLevel;
}
// viPostCallback
// wiiDvdCheckThread
// wiiRumbleCheck