Decompiled osViSetEvent

This commit is contained in:
Ryan Myers
2021-09-22 15:03:29 -04:00
parent 01b4e79e36
commit d78fbc2e5a
5 changed files with 17 additions and 41 deletions
@@ -1,31 +0,0 @@
glabel osViSetEventMsg
/* 0D2980 800D1D80 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 0D2984 800D1D84 AFBF001C */ sw $ra, 0x1c($sp)
/* 0D2988 800D1D88 AFA40028 */ sw $a0, 0x28($sp)
/* 0D298C 800D1D8C AFA5002C */ sw $a1, 0x2c($sp)
/* 0D2990 800D1D90 AFA60030 */ sw $a2, 0x30($sp)
/* 0D2994 800D1D94 0C034958 */ jal __osDisableInt
/* 0D2998 800D1D98 AFB00018 */ sw $s0, 0x18($sp)
/* 0D299C 800D1D9C 3C0F800E */ lui $t7, %hi(__osViNext) # $t7, 0x800e
/* 0D29A0 800D1DA0 8DEF4874 */ lw $t7, %lo(__osViNext)($t7)
/* 0D29A4 800D1DA4 8FAE0028 */ lw $t6, 0x28($sp)
/* 0D29A8 800D1DA8 3C19800E */ lui $t9, %hi(__osViNext) # $t9, 0x800e
/* 0D29AC 800D1DAC 3C09800E */ lui $t1, %hi(__osViNext) # $t1, 0x800e
/* 0D29B0 800D1DB0 ADEE0010 */ sw $t6, 0x10($t7)
/* 0D29B4 800D1DB4 8F394874 */ lw $t9, %lo(__osViNext)($t9)
/* 0D29B8 800D1DB8 8FB8002C */ lw $t8, 0x2c($sp)
/* 0D29BC 800D1DBC 00408025 */ move $s0, $v0
/* 0D29C0 800D1DC0 02002025 */ move $a0, $s0
/* 0D29C4 800D1DC4 AF380014 */ sw $t8, 0x14($t9)
/* 0D29C8 800D1DC8 8D294874 */ lw $t1, %lo(__osViNext)($t1)
/* 0D29CC 800D1DCC 8FA80030 */ lw $t0, 0x30($sp)
/* 0D29D0 800D1DD0 0C034960 */ jal __osRestoreInt
/* 0D29D4 800D1DD4 A5280002 */ sh $t0, 2($t1)
/* 0D29D8 800D1DD8 8FBF001C */ lw $ra, 0x1c($sp)
/* 0D29DC 800D1DDC 8FB00018 */ lw $s0, 0x18($sp)
/* 0D29E0 800D1DE0 27BD0028 */ addiu $sp, $sp, 0x28
/* 0D29E4 800D1DE4 03E00008 */ jr $ra
/* 0D29E8 800D1DE8 00000000 */ nop
/* 0D29EC 800D1DEC 00000000 */ nop
+1 -1
View File
@@ -93,7 +93,7 @@ void osCreateScheduler(OSSched *sc, void *stack, OSPri priority, u8 mode, u8 num
osSetEventMesg(OS_EVENT_DP, &sc->interruptQ, (OSMesg)668);
osSetEventMesg(OS_EVENT_PRENMI, &sc->interruptQ, (OSMesg)669);
osViSetEventMsg(&sc->interruptQ, (OSMesg)666, numFields);
osViSetEvent(&sc->interruptQ, (OSMesg)666, numFields);
osCreateThread(&sc->thread, 5, __scMain, (void *)sc, stack, priority);
+2 -2
View File
@@ -68,10 +68,10 @@ void osCreateViManager(OSPri pri) {
void __osTimerInterrupt(void);
//Fails due to how retrace is declared. Not sure how to fix it.
void viMgrMain(void *arg) {
static u16 retrace;
__OSViContext *vc;
OSDevMgr *dm;
OSIoMesg *mesg;
static u16 retrace;
s32 first;
u32 count;
@@ -86,7 +86,7 @@ void viMgrMain(void *arg) {
dm = (OSDevMgr *)arg;
while (TRUE) {
osRecvMesg(dm->evtQueue, &mesg, OS_MESG_BLOCK);
osRecvMesg(dm->evtQueue, (OSMesg *)&mesg, OS_MESG_BLOCK);
switch (mesg->hdr.type) {
case OS_MESG_TYPE_VRETRACE:
__osViSwapContext();
+14
View File
@@ -0,0 +1,14 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800D1D80 */
#include "libultra_internal.h"
#include "viint.h"
void osViSetEvent(OSMesgQueue *mq, OSMesg m, u32 retraceCount) {
register u32 saveMask;
saveMask = __osDisableInt();
__osViNext->msgq = mq;
__osViNext->msg = m;
__osViNext->retraceCount = retraceCount;
__osRestoreInt(saveMask);
}
-7
View File
@@ -1,7 +0,0 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800D1D80 */
#include "types.h"
#include "macros.h"
GLOBAL_ASM("lib/asm/non_matchings/osViSetEventMsg_0D2980/osViSetEventMsg.s")