mirror of
https://github.com/izzy2lost/Starship.git
synced 2026-07-05 15:19:42 -07:00
* Matched perspective, contquery, contreaddata, recvmesg and sendmesg * Fixed libultra compilation flags * Matched viblack * Matched virepeatline, visetmode, visetspecial and viswapbuf * Matched cartrominit, dpsetstat, sptask, sptaskyield, visetevent, createthread, gettime, setthreadpri, settime, settimer and starthread * Fixed bss bs * Matched even more libultra stuff * Matched even more * __osRdbSend * Decompiled most of the functions of libultra <3 * Matched last functions * Added a separation to libultra macros * Removed ARRLEN from controller.h * Fix libultra warnings --------- Co-authored-by: Alejandro Javier Asenjo Nitti <alejandro.asenjo88@gmail.com>
40 lines
828 B
C
40 lines
828 B
C
#include "macros.h"
|
|
#include "PR/os_internal.h"
|
|
#include "PR/ultraerror.h"
|
|
#include "osint.h"
|
|
|
|
__OSEventState __osEventStateTab[OS_NUM_EVENTS] ALIGNED(8);
|
|
#if BUILD_VERSION >= VERSION_J
|
|
u32 __osPreNMI = FALSE;
|
|
#endif
|
|
|
|
void osSetEventMesg(OSEvent event, OSMesgQueue* mq, OSMesg msg) {
|
|
register u32 saveMask;
|
|
__OSEventState* es;
|
|
|
|
#ifdef _DEBUG
|
|
if (event >= OS_NUM_EVENTS) {
|
|
__osError(ERR_OSSETEVENTMESG, 1, event);
|
|
return;
|
|
}
|
|
#endif
|
|
|
|
saveMask = __osDisableInt();
|
|
|
|
es = &__osEventStateTab[event];
|
|
|
|
es->messageQueue = mq;
|
|
es->message = msg;
|
|
|
|
#if BUILD_VERSION >= VERSION_J
|
|
if (event == OS_EVENT_PRENMI) {
|
|
if (__osShutdown && !__osPreNMI) {
|
|
osSendMesg(mq, msg, OS_MESG_NOBLOCK);
|
|
}
|
|
__osPreNMI = TRUE;
|
|
}
|
|
#endif
|
|
|
|
__osRestoreInt(saveMask);
|
|
}
|