mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-03 18:36:00 -04:00
c40bb119e1
* 1 scene done, Z2_SOUGEN OK * All scenes OK * Makefile improvements * Use WIP ZAPD branch as submodule * Add spawn rotation flag macro * Fix bad merge * Move scenes to be in their own subfolders * Rename and restructure extracted baserom files * Progress tracking for assets * Add asset progress to csv * Use master ZAPD * Use distclean like in OOT * Fix up a few things with the makefile * Fix scenes not being dumped from ELF Co-authored-by: Rozelette <Uberpanzermensch@gmail.com>
37 lines
885 B
C
37 lines
885 B
C
#include <ultra64.h>
|
|
#include <global.h>
|
|
|
|
void osStartThread(OSThread* t) {
|
|
register u32 saveMask;
|
|
|
|
saveMask = __osDisableInt();
|
|
|
|
switch (t->state) {
|
|
case 8:
|
|
t->state = 2;
|
|
__osEnqueueThread(&__osRunQueue, t);
|
|
break;
|
|
case 1:
|
|
if ((t->queue == NULL) || (t->queue == &__osRunQueue)) {
|
|
t->state = 2;
|
|
__osEnqueueThread(&__osRunQueue, t);
|
|
} else {
|
|
t->state = 8;
|
|
__osEnqueueThread(t->queue, t);
|
|
__osEnqueueThread(&__osRunQueue, __osPopThread(t->queue));
|
|
}
|
|
break;
|
|
}
|
|
|
|
if (__osRunningThread == NULL) {
|
|
__osDispatchThread();
|
|
} else {
|
|
if (__osRunningThread->priority < __osRunQueue->priority) {
|
|
__osRunningThread->state = 2;
|
|
__osEnqueueAndYield(&__osRunQueue);
|
|
}
|
|
}
|
|
|
|
__osRestoreInt(saveMask);
|
|
}
|