mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-17 12:59:53 -04:00
Adds in scene support (#117)
* 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>
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
#include <osint.h>
|
||||
|
||||
#include "io/controller.h"
|
||||
#include "siint.h"
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
s32 osContStartQuery(OSMesgQueue* mq)
|
||||
{
|
||||
|
||||
+11
-12
@@ -1,6 +1,5 @@
|
||||
#include <bstring.h>
|
||||
#include <sptask.h>
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
OSTask* _VirtualToPhysicalTask(OSTask* intp)
|
||||
{
|
||||
@@ -27,31 +26,31 @@ OSTask* _VirtualToPhysicalTask(OSTask* intp)
|
||||
if (tp->t.yield_data_ptr) {
|
||||
tp->t.yield_data_ptr = (u64*)osVirtualToPhysical(tp->t.yield_data_ptr);
|
||||
}
|
||||
|
||||
|
||||
return &tmp_task;
|
||||
}
|
||||
|
||||
void osSpTaskLoad(OSTask* intp)
|
||||
{
|
||||
OSTask* tp;
|
||||
|
||||
|
||||
tp = _VirtualToPhysicalTask(intp);
|
||||
|
||||
|
||||
if ((tp->t.flags & 0x1) != 0) {
|
||||
tp->t.ucode_data = tp->t.yield_data_ptr;
|
||||
tp->t.ucode_data_size = tp->t.yield_data_size;
|
||||
|
||||
|
||||
intp->t.flags = intp->t.flags & 0xFFFFFFFE;
|
||||
|
||||
|
||||
if ((tp->t.flags & 0x4) != 0) {
|
||||
tp->t.ucode = *(u64**)(((u32)intp->t.yield_data_ptr + 3068) | 0xA0000000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
osWritebackDCache((void*)tp, sizeof(OSTask));
|
||||
|
||||
|
||||
__osSpSetStatus(11008);
|
||||
|
||||
|
||||
while (__osSpSetPc(0x04001000) == -1);
|
||||
while (__osSpRawStartDma(1, 0x04000FC0, (void*)tp, sizeof(OSTask)) == -1);
|
||||
while (__osSpDeviceBusy());
|
||||
@@ -61,6 +60,6 @@ void osSpTaskLoad(OSTask* intp)
|
||||
void osSpTaskStartGo(OSTask* tp)
|
||||
{
|
||||
while (__osSpDeviceBusy());
|
||||
|
||||
|
||||
__osSpSetStatus(293);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <osint.h>
|
||||
#include <viint.h>
|
||||
#include <assert.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
__OSViContext* __osViGetCurrentContext(void) {
|
||||
return __osViCurr;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include <stdarg.h>
|
||||
#include <osint.h>
|
||||
#include <viint.h>
|
||||
#include <assert.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void osViSetYScale(f32 value) {
|
||||
register u32 saveMask;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <PR/ultratypes.h>
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void osCreateThread(OSThread* t, OSId id, void* entry, void* arg, void* sp, OSPri p) {
|
||||
register u32 saveMask;
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void osDestroyThread(OSThread* t)
|
||||
{
|
||||
register u32 saveMask;
|
||||
register OSThread* pred;
|
||||
register OSThread* succ;
|
||||
|
||||
|
||||
saveMask = __osDisableInt();
|
||||
|
||||
|
||||
if (t == NULL) {
|
||||
t = __osRunningThread;
|
||||
} else if (t->state != 1) {
|
||||
__osDequeueThread(t->queue, t);
|
||||
}
|
||||
|
||||
|
||||
if (__osActiveQueue == t) {
|
||||
__osActiveQueue = __osActiveQueue->tlnext;
|
||||
} else {
|
||||
@@ -27,10 +28,10 @@ void osDestroyThread(OSThread* t)
|
||||
pred = succ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (t == __osRunningThread) {
|
||||
__osDispatchThread();
|
||||
}
|
||||
|
||||
|
||||
__osRestoreInt(saveMask);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
OSThread* __osGetCurrFaultedThread(void) {
|
||||
return __osFaultedThread;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
OSId osGetThreadId(OSThread* t) {
|
||||
if (t == NULL) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
OSPri osGetThreadPri(OSThread* t) {
|
||||
if (t == NULL) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <ramrom.h>
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
u64 osClockRate = 0x0000000003B9ACA0;
|
||||
s32 osViClock = 0x02E6D354;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
s32 osJamMesg(OSMesgQueue* mq, OSMesg msg, s32 flag) {
|
||||
register u32 saveMask;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flags) {
|
||||
register u32 saveMask;
|
||||
|
||||
|
||||
saveMask = __osDisableInt();
|
||||
|
||||
while (mq->validCount == 0)
|
||||
@@ -19,10 +20,10 @@ s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flags) {
|
||||
if (msg != NULL) {
|
||||
*msg = mq->msg[mq->first];
|
||||
}
|
||||
|
||||
|
||||
mq->first = (mq->first + 1) % mq->msgCount;
|
||||
mq->validCount--;
|
||||
|
||||
|
||||
if (mq->fullqueue->next != NULL) {
|
||||
osStartThread(__osPopThread(&mq->fullqueue));
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
s32 osSendMesg(OSMesgQueue* mq, OSMesg msg, s32 flags) {
|
||||
register u32 saveMask;
|
||||
register s32 last;
|
||||
|
||||
|
||||
saveMask = __osDisableInt();
|
||||
|
||||
|
||||
while (mq->validCount >= mq->msgCount) {
|
||||
if (flags == 1) {
|
||||
__osRunningThread->state = 8;
|
||||
@@ -15,16 +16,16 @@ s32 osSendMesg(OSMesgQueue* mq, OSMesg msg, s32 flags) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
last = (mq->first + mq->validCount) % mq->msgCount;
|
||||
|
||||
|
||||
mq->msg[last] = msg;
|
||||
mq->validCount++;
|
||||
|
||||
|
||||
if (mq->mtqueue->next != NULL) {
|
||||
osStartThread(__osPopThread(&mq->mtqueue));
|
||||
}
|
||||
|
||||
|
||||
__osRestoreInt(saveMask);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
UNK_TYPE4 D_80097F10 = 0;
|
||||
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void osSetThreadPri(OSThread* t, OSPri p) {
|
||||
register u32 saveMask;
|
||||
|
||||
|
||||
saveMask = __osDisableInt();
|
||||
|
||||
|
||||
if (t == NULL) {
|
||||
t = __osRunningThread;
|
||||
}
|
||||
|
||||
|
||||
if (t->priority != p) {
|
||||
t->priority = p;
|
||||
|
||||
@@ -22,6 +23,6 @@ void osSetThreadPri(OSThread* t, OSPri p) {
|
||||
__osEnqueueAndYield(&__osRunQueue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
__osRestoreInt(saveMask);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void osStartThread(OSThread* t) {
|
||||
register u32 saveMask;
|
||||
|
||||
|
||||
saveMask = __osDisableInt();
|
||||
|
||||
|
||||
switch (t->state) {
|
||||
case 8:
|
||||
t->state = 2;
|
||||
@@ -21,7 +22,7 @@ void osStartThread(OSThread* t) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (__osRunningThread == NULL) {
|
||||
__osDispatchThread();
|
||||
} else {
|
||||
@@ -30,6 +31,6 @@ void osStartThread(OSThread* t) {
|
||||
__osEnqueueAndYield(&__osRunQueue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
__osRestoreInt(saveMask);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void osStopThread(OSThread* t) {
|
||||
register u32 saveMask;
|
||||
register u16 state;
|
||||
|
||||
|
||||
saveMask = __osDisableInt();
|
||||
|
||||
if (t == NULL) {
|
||||
@@ -11,7 +12,7 @@ void osStopThread(OSThread* t) {
|
||||
} else {
|
||||
state = t->state;
|
||||
}
|
||||
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case 4:
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include <PR/ultratypes.h>
|
||||
#include <rmon.h>
|
||||
#include <osint.h>
|
||||
#include <viint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
s32 osStopTimer(OSTimer* t)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <PR/ultratypes.h>
|
||||
#include <osint.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
OSThread* __osThreadTail = NULL;
|
||||
UNK_TYPE D_80097E14 = -1;
|
||||
|
||||
Reference in New Issue
Block a user