mirror of https://github.com/zeldaret/tp.git
150 lines
3.9 KiB
C
150 lines
3.9 KiB
C
//
|
|
// Generated By: dol2asm
|
|
// Translation Unit: OSAlarm
|
|
//
|
|
|
|
#include "dolphin/os/OSAlarm.h"
|
|
#include "dol2asm.h"
|
|
#include "dolphin/os/OSReset.h"
|
|
#include "dolphin/types.h"
|
|
|
|
//
|
|
// External References:
|
|
//
|
|
|
|
void PPCMtdec();
|
|
void __OSSetExceptionHandler();
|
|
void __OSGetExceptionHandler();
|
|
void OSSetCurrentContext();
|
|
void OSLoadContext();
|
|
void OSClearContext();
|
|
void OSDisableInterrupts();
|
|
void OSRestoreInterrupts();
|
|
void OSRegisterResetFunction();
|
|
void OSDisableScheduler();
|
|
void OSEnableScheduler();
|
|
void __OSReschedule();
|
|
void __DVDTestAlarm();
|
|
void __div2i();
|
|
|
|
//
|
|
// Declarations:
|
|
//
|
|
|
|
/* ############################################################################################## */
|
|
/* 803CF480-803CF490 -00001 0010+00 1/1 0/0 0/0 .data ResetFunctionInfo */
|
|
static OSResetFunctionInfo ResetFunctionInfo = {
|
|
OnReset,
|
|
0xFFFFFFFF,
|
|
NULL,
|
|
NULL,
|
|
};
|
|
|
|
/* 80451638-80451640 000B38 0008+00 5/5 0/0 0/0 .sbss AlarmQueue */
|
|
static u8 AlarmQueue[8];
|
|
|
|
/* 8033A8A0-8033A8F8 3351E0 0058+00 0/0 3/3 0/0 .text OSInitAlarm */
|
|
#pragma push
|
|
#pragma optimization_level 0
|
|
#pragma optimizewithasm off
|
|
asm void OSInitAlarm(void) {
|
|
nofralloc
|
|
#include "asm/dolphin/os/OSAlarm/OSInitAlarm.s"
|
|
}
|
|
#pragma pop
|
|
|
|
/* 8033A8F8-8033A908 335238 0010+00 0/0 17/17 0/0 .text OSCreateAlarm */
|
|
void OSCreateAlarm(OSAlarm* alarm) {
|
|
alarm->handler = NULL;
|
|
alarm->tag = 0;
|
|
}
|
|
|
|
/* 8033A908-8033AB58 335248 0250+00 3/3 0/0 0/0 .text InsertAlarm */
|
|
#pragma push
|
|
#pragma optimization_level 0
|
|
#pragma optimizewithasm off
|
|
static asm void InsertAlarm(OSAlarm* alarm, s64 time, OSAlarmHandler* handler) {
|
|
nofralloc
|
|
#include "asm/dolphin/os/OSAlarm/InsertAlarm.s"
|
|
}
|
|
#pragma pop
|
|
|
|
/* 8033AB58-8033ABC0 335498 0068+00 0/0 18/18 0/0 .text OSSetAlarm */
|
|
#pragma push
|
|
#pragma optimization_level 0
|
|
#pragma optimizewithasm off
|
|
asm void OSSetAlarm(OSAlarm* alarm, s64 time, OSAlarmHandler* handler) {
|
|
nofralloc
|
|
#include "asm/dolphin/os/OSAlarm/OSSetAlarm.s"
|
|
}
|
|
#pragma pop
|
|
|
|
/* 8033ABC0-8033AC3C 335500 007C+00 0/0 1/1 0/0 .text OSSetPeriodicAlarm */
|
|
#pragma push
|
|
#pragma optimization_level 0
|
|
#pragma optimizewithasm off
|
|
asm void OSSetPeriodicAlarm(OSAlarm* alarm, s64 start, s64 period, OSAlarmHandler* handler) {
|
|
nofralloc
|
|
#include "asm/dolphin/os/OSAlarm/OSSetPeriodicAlarm.s"
|
|
}
|
|
#pragma pop
|
|
|
|
/* 8033AC3C-8033AD58 33557C 011C+00 1/1 11/11 0/0 .text OSCancelAlarm */
|
|
#pragma push
|
|
#pragma optimization_level 0
|
|
#pragma optimizewithasm off
|
|
asm void OSCancelAlarm(OSAlarm* alarm) {
|
|
nofralloc
|
|
#include "asm/dolphin/os/OSAlarm/OSCancelAlarm.s"
|
|
}
|
|
#pragma pop
|
|
|
|
/* 8033AD58-8033AF88 335698 0230+00 1/1 0/0 0/0 .text DecrementerExceptionCallback */
|
|
#pragma push
|
|
#pragma optimization_level 0
|
|
#pragma optimizewithasm off
|
|
static asm void DecrementerExceptionCallback(__OSException exception, OSContext* context) {
|
|
nofralloc
|
|
#include "asm/dolphin/os/OSAlarm/DecrementerExceptionCallback.s"
|
|
}
|
|
#pragma pop
|
|
|
|
/* 8033AF88-8033AFD8 3358C8 0050+00 1/1 0/0 0/0 .text DecrementerExceptionHandler */
|
|
static asm void DecrementerExceptionHandler(register __OSException exception,
|
|
register OSContext* context) {
|
|
// clang-format off
|
|
nofralloc
|
|
|
|
stw r0, 0(context)
|
|
stw r1, 4(context)
|
|
stw r2, 8(context)
|
|
stmw r6, 0x18(context)
|
|
mfspr r0, 0x391
|
|
stw r0, 0x1a8(context)
|
|
mfspr r0, 0x392
|
|
stw r0, 0x1ac(context)
|
|
mfspr r0, 0x393
|
|
stw r0, 0x1b0(context)
|
|
mfspr r0, 0x394
|
|
stw r0, 0x1b4(context)
|
|
mfspr r0, 0x395
|
|
stw r0, 0x1b8(context)
|
|
mfspr r0, 0x396
|
|
stw r0, 0x1bc(context)
|
|
mfspr r0, 0x397
|
|
stw r0, 0x1c0(context)
|
|
stwu r1, -8(r1)
|
|
b DecrementerExceptionCallback
|
|
// clang-format on
|
|
}
|
|
|
|
/* 8033AFD8-8033B078 335918 00A0+00 1/0 0/0 0/0 .text OnReset */
|
|
#pragma push
|
|
#pragma optimization_level 0
|
|
#pragma optimizewithasm off
|
|
static asm s32 OnReset(s32 param_0) {
|
|
nofralloc
|
|
#include "asm/dolphin/os/OSAlarm/OnReset.s"
|
|
}
|
|
#pragma pop
|