mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-03 18:36:00 -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:
+20
-20
@@ -15,28 +15,28 @@ void BgCheck2_UpdateActorPosition(CollisionContext* bgCtxt, s32 index, Actor* ac
|
||||
if (BgCheck_IsActorMeshIndexValid(index) == 0) return;
|
||||
|
||||
SkinMatrix_SetScaleRotateYRPTranslate(&prevMatrix,
|
||||
bgCtxt->dyna.actorMeshArr[index].prevParams.scale.x,
|
||||
bgCtxt->dyna.actorMeshArr[index].prevParams.scale.y,
|
||||
bgCtxt->dyna.actorMeshArr[index].prevParams.scale.z,
|
||||
bgCtxt->dyna.actorMeshArr[index].prevParams.rotation.x,
|
||||
bgCtxt->dyna.actorMeshArr[index].prevParams.rotation.y,
|
||||
bgCtxt->dyna.actorMeshArr[index].prevParams.rotation.z,
|
||||
bgCtxt->dyna.actorMeshArr[index].prevParams.pos.x,
|
||||
bgCtxt->dyna.actorMeshArr[index].prevParams.pos.y,
|
||||
bgCtxt->dyna.actorMeshArr[index].prevParams.pos.z);
|
||||
bgCtxt->dyna.bgActors[index].prevTransform.scale.x,
|
||||
bgCtxt->dyna.bgActors[index].prevTransform.scale.y,
|
||||
bgCtxt->dyna.bgActors[index].prevTransform.scale.z,
|
||||
bgCtxt->dyna.bgActors[index].prevTransform.rot.x,
|
||||
bgCtxt->dyna.bgActors[index].prevTransform.rot.y,
|
||||
bgCtxt->dyna.bgActors[index].prevTransform.rot.z,
|
||||
bgCtxt->dyna.bgActors[index].prevTransform.pos.x,
|
||||
bgCtxt->dyna.bgActors[index].prevTransform.pos.y,
|
||||
bgCtxt->dyna.bgActors[index].prevTransform.pos.z);
|
||||
|
||||
if (SkinMatrix_Invert(&prevMatrix, &prevMatrixInv) == 2) return;
|
||||
|
||||
SkinMatrix_SetScaleRotateYRPTranslate(&currMatrix,
|
||||
bgCtxt->dyna.actorMeshArr[index].currParams.scale.x,
|
||||
bgCtxt->dyna.actorMeshArr[index].currParams.scale.y,
|
||||
bgCtxt->dyna.actorMeshArr[index].currParams.scale.z,
|
||||
bgCtxt->dyna.actorMeshArr[index].currParams.rotation.x,
|
||||
bgCtxt->dyna.actorMeshArr[index].currParams.rotation.y,
|
||||
bgCtxt->dyna.actorMeshArr[index].currParams.rotation.z,
|
||||
bgCtxt->dyna.actorMeshArr[index].currParams.pos.x,
|
||||
bgCtxt->dyna.actorMeshArr[index].currParams.pos.y,
|
||||
bgCtxt->dyna.actorMeshArr[index].currParams.pos.z);
|
||||
bgCtxt->dyna.bgActors[index].curTransform.scale.x,
|
||||
bgCtxt->dyna.bgActors[index].curTransform.scale.y,
|
||||
bgCtxt->dyna.bgActors[index].curTransform.scale.z,
|
||||
bgCtxt->dyna.bgActors[index].curTransform.rot.x,
|
||||
bgCtxt->dyna.bgActors[index].curTransform.rot.y,
|
||||
bgCtxt->dyna.bgActors[index].curTransform.rot.z,
|
||||
bgCtxt->dyna.bgActors[index].curTransform.pos.x,
|
||||
bgCtxt->dyna.bgActors[index].curTransform.pos.y,
|
||||
bgCtxt->dyna.bgActors[index].curTransform.pos.z);
|
||||
|
||||
SkinMatrix_Vec3fMtxFMultXYZ(&prevMatrixInv, &actor->world.pos, &posWithInv);
|
||||
SkinMatrix_Vec3fMtxFMultXYZ(&currMatrix, &posWithInv, &newPos);
|
||||
@@ -49,7 +49,7 @@ void BgCheck2_UpdateActorYRotation(CollisionContext* bgCtxt, s32 index, Actor* a
|
||||
|
||||
if (BgCheck_IsActorMeshIndexValid(index) == 0) return;
|
||||
|
||||
angleChange = bgCtxt->dyna.actorMeshArr[index].currParams.rotation.y - bgCtxt->dyna.actorMeshArr[index].prevParams.rotation.y;
|
||||
angleChange = bgCtxt->dyna.bgActors[index].curTransform.rot.y - bgCtxt->dyna.bgActors[index].prevTransform.rot.y;
|
||||
|
||||
if (actor->id == 0) {
|
||||
((ActorPlayer*)actor)->unkAD4 += angleChange;
|
||||
@@ -83,7 +83,7 @@ u32 BgCheck2_UpdateActorAttachedToMesh(CollisionContext* bgCtxt, s32 index, Acto
|
||||
|
||||
if (BgCheck_IsActorMeshIndexValid(index) == 0) return 0;
|
||||
|
||||
if (((bgCtxt->dyna.flags[index] & 2) != 0) || ((bgCtxt->dyna.flags[index] & 1) == 0)) return 0;
|
||||
if (((bgCtxt->dyna.bgActorFlags[index] & 2) != 0) || ((bgCtxt->dyna.bgActorFlags[index] & 1) == 0)) return 0;
|
||||
|
||||
meshActor = BgCheck_GetActorOfMesh(bgCtxt,index);
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ void BcCheck3_BgActorInit(DynaPolyActor* actor, UNK_TYPE4 param_2) {
|
||||
actor->unk_158 = 0;
|
||||
}
|
||||
|
||||
void BgCheck3_LoadMesh(GlobalContext* ctxt, DynaPolyActor* actor, BgMeshHeader* meshHeader) {
|
||||
BgMeshHeader* header;
|
||||
void BgCheck3_LoadMesh(GlobalContext* ctxt, DynaPolyActor* actor, CollisionHeader* meshHeader) {
|
||||
CollisionHeader* header;
|
||||
|
||||
header = NULL;
|
||||
BgCheck_RelocateMeshHeader(meshHeader, &header);
|
||||
|
||||
+26
-26
@@ -1,8 +1,8 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void BgCheck_PolygonLinkedListNodeInit(BgPolygonLinkedListNode* node, s16* polyIndex, u16 next) {
|
||||
node->polyIndex = *polyIndex;
|
||||
void BgCheck_PolygonLinkedListNodeInit(SSNode* node, s16* polyIndex, u16 next) {
|
||||
node->polyId = *polyIndex;
|
||||
node->next = next;
|
||||
}
|
||||
|
||||
@@ -10,58 +10,58 @@ void BgCheck_PolygonLinkedListResetHead(u16* head) {
|
||||
*head = 0xFFFF;
|
||||
}
|
||||
|
||||
void BgCheck_ScenePolygonListsNodeInsert(BgScenePolygonLists* list, u16* head, s16* polyIndex) {
|
||||
void BgCheck_ScenePolygonListsNodeInsert(SSNodeList* list, u16* head, s16* polyIndex) {
|
||||
u16 index;
|
||||
|
||||
index = BgCheck_ScenePolygonListsReserveNode(list);
|
||||
BgCheck_PolygonLinkedListNodeInit(&list->nodes[index], polyIndex, *head);
|
||||
BgCheck_PolygonLinkedListNodeInit(&list->tbl[index], polyIndex, *head);
|
||||
*head = index;
|
||||
}
|
||||
|
||||
void BgCheck_PolygonLinkedListNodeInsert(BgPolygonLinkedList* list, u16* head, s16* polyIndex) {
|
||||
void BgCheck_PolygonLinkedListNodeInsert(DynaSSNodeList* list, u16* head, s16* polyIndex) {
|
||||
u16 index;
|
||||
|
||||
index = BgCheck_AllocPolygonLinkedListNode(list);
|
||||
BgCheck_PolygonLinkedListNodeInit(&list->nodes[index], polyIndex, *head);
|
||||
BgCheck_PolygonLinkedListNodeInit(&list->tbl[index], polyIndex, *head);
|
||||
*head = index;
|
||||
}
|
||||
|
||||
void BgCheck_PolygonLinkedListInit(GlobalContext* ctxt, BgPolygonLinkedList* list) {
|
||||
list->nodes = NULL;
|
||||
list->nextFreeNode = 0;
|
||||
void BgCheck_PolygonLinkedListInit(GlobalContext* ctxt, DynaSSNodeList* list) {
|
||||
list->tbl = NULL;
|
||||
list->count = 0;
|
||||
}
|
||||
|
||||
void BgCheck_PolygonLinkedListAlloc(GlobalContext* ctxt, BgPolygonLinkedList* list, u32 numNodes) {
|
||||
list->nodes = (BgPolygonLinkedListNode*)THA_AllocEndAlign(&ctxt->state.heap, numNodes << 2, 0xfffffffe);
|
||||
list->maxNodes = numNodes;
|
||||
list->nextFreeNode = 0;
|
||||
void BgCheck_PolygonLinkedListAlloc(GlobalContext* ctxt, DynaSSNodeList* list, u32 numNodes) {
|
||||
list->tbl = (SSNode*)THA_AllocEndAlign(&ctxt->state.heap, numNodes << 2, 0xfffffffe);
|
||||
list->max = numNodes;
|
||||
list->count = 0;
|
||||
}
|
||||
|
||||
void BgCheck_PolygonLinkedListReset(BgPolygonLinkedList* list) {
|
||||
list->nextFreeNode = 0;
|
||||
void BgCheck_PolygonLinkedListReset(DynaSSNodeList* list) {
|
||||
list->count = 0;
|
||||
}
|
||||
|
||||
u16 BgCheck_AllocPolygonLinkedListNode(BgPolygonLinkedList* list) {
|
||||
u16 BgCheck_AllocPolygonLinkedListNode(DynaSSNodeList* list) {
|
||||
u16 index;
|
||||
|
||||
index = list->nextFreeNode++;
|
||||
if (list->maxNodes <= index) {
|
||||
index = list->count++;
|
||||
if (list->max <= index) {
|
||||
return 0xffff;
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
void BgCheck_CreateVec3fFromVertex(BgVertex* vertex, Vec3f* vector) {
|
||||
vector->x = vertex->pos.x;
|
||||
vector->y = vertex->pos.y;
|
||||
vector->z = vertex->pos.z;
|
||||
void BgCheck_CreateVec3fFromVertex(Vec3s* vertex, Vec3f* vector) {
|
||||
vector->x = vertex->x;
|
||||
vector->y = vertex->y;
|
||||
vector->z = vertex->z;
|
||||
}
|
||||
|
||||
void BgCheck_CreateVertexFromVec3f(BgVertex* vertex, Vec3f* vector) {
|
||||
vertex->pos.x = vector->x;
|
||||
vertex->pos.y = vector->y;
|
||||
vertex->pos.z = vector->z;
|
||||
void BgCheck_CreateVertexFromVec3f(Vec3s* vertex, Vec3f* vector) {
|
||||
vertex->x = vector->x;
|
||||
vertex->y = vector->y;
|
||||
vertex->z = vector->z;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_bgcheck/func_800BFD84.asm")
|
||||
|
||||
+12
-12
@@ -192,21 +192,21 @@ void Scene_HeaderCommand02(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
|
||||
// Scene Command 0x03: Collision Header
|
||||
void Scene_HeaderCommand03(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
BgMeshHeader* temp_ret;
|
||||
BgMeshHeader* temp_s0;
|
||||
CollisionHeader* temp_ret;
|
||||
CollisionHeader* temp_s0;
|
||||
|
||||
temp_ret = (BgMeshHeader*)Lib_SegmentedToVirtual(entry->colHeader.segment);
|
||||
temp_ret = (CollisionHeader*)Lib_SegmentedToVirtual(entry->colHeader.segment);
|
||||
temp_s0 = temp_ret;
|
||||
temp_s0->vertices = (BgVertex*)Lib_SegmentedToVirtual(temp_ret->vertices);
|
||||
temp_s0->polygons = (CollisionPoly*)Lib_SegmentedToVirtual(temp_s0->polygons);
|
||||
if (temp_s0->attributes != 0) {
|
||||
temp_s0->attributes = (BgPolygonAttributes*)Lib_SegmentedToVirtual(temp_s0->attributes);
|
||||
temp_s0->vtxList = (Vec3s*)Lib_SegmentedToVirtual(temp_ret->vtxList);
|
||||
temp_s0->polyList = (CollisionPoly*)Lib_SegmentedToVirtual(temp_s0->polyList);
|
||||
if (temp_s0->surfaceTypeList != 0) {
|
||||
temp_s0->surfaceTypeList = (SurfaceType*)Lib_SegmentedToVirtual(temp_s0->surfaceTypeList);
|
||||
}
|
||||
if (temp_s0->cameraData != 0) {
|
||||
temp_s0->cameraData = (void*)Lib_SegmentedToVirtual(temp_s0->cameraData);
|
||||
if (temp_s0->cameraDataList != 0) {
|
||||
temp_s0->cameraDataList = (void*)Lib_SegmentedToVirtual(temp_s0->cameraDataList);
|
||||
}
|
||||
if (temp_s0->waterboxes != 0) {
|
||||
temp_s0->waterboxes = (BgWaterBox*)Lib_SegmentedToVirtual(temp_s0->waterboxes);
|
||||
if (temp_s0->waterBoxes != 0) {
|
||||
temp_s0->waterBoxes = (WaterBox*)Lib_SegmentedToVirtual(temp_s0->waterBoxes);
|
||||
}
|
||||
|
||||
BgCheck_Init(&ctxt->colCtx, ctxt, temp_s0);
|
||||
@@ -215,7 +215,7 @@ void Scene_HeaderCommand03(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
// Scene Command 0x04: Room List
|
||||
void Scene_HeaderCommand04(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->numRooms = entry->roomList.num;
|
||||
ctxt->roomList = (RoomFileLocation*)Lib_SegmentedToVirtual(entry->roomList.segment);
|
||||
ctxt->roomList = (RomFile*)Lib_SegmentedToVirtual(entry->roomList.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x06: Entrance List
|
||||
|
||||
+10
-10
@@ -97,16 +97,16 @@ void func_80143324(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skyTy
|
||||
|
||||
if (globalCtx->kankyoContext.unk10 == 0) {
|
||||
// Send a DMA request for the clear sky texture
|
||||
size = (u32)_vr_fine_staticSegmentRomEnd - (u32)_vr_fine_staticSegmentRomStart;
|
||||
size = (u32)_d2_fine_staticSegmentRomEnd - (u32)_d2_fine_staticSegmentRomStart;
|
||||
|
||||
DmaMgr_SendRequestImpl(&skyboxCtx->unk188, skyboxCtx->skyboxStaticSegment[0],
|
||||
(u32)_vr_fine_staticSegmentRomStart, size, 0, &skyboxCtx->loadQueue, NULL);
|
||||
(u32)_d2_fine_staticSegmentRomStart, size, 0, &skyboxCtx->loadQueue, NULL);
|
||||
} else {
|
||||
// Send a DMA request for the cloudy sky texture
|
||||
size = (u32)_vr_cloud_staticSegmentRomEnd - (u32)_vr_cloud_staticSegmentRomStart;
|
||||
size = (u32)_d2_cloud_staticSegmentRomEnd - (u32)_d2_cloud_staticSegmentRomStart;
|
||||
|
||||
DmaMgr_SendRequestImpl(&skyboxCtx->unk188, skyboxCtx->skyboxStaticSegment[0],
|
||||
(u32)_vr_cloud_staticSegmentRomStart, size, 0, &skyboxCtx->loadQueue, NULL);
|
||||
(u32)_d2_cloud_staticSegmentRomStart, size, 0, &skyboxCtx->loadQueue, NULL);
|
||||
}
|
||||
|
||||
osRecvMesg(&skyboxCtx->loadQueue, NULL, 1);
|
||||
@@ -114,26 +114,26 @@ void func_80143324(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skyTy
|
||||
|
||||
if (globalCtx->kankyoContext.unk11 == 0) {
|
||||
// Send a DMA request for the clear sky texture
|
||||
size = (u32)_vr_fine_staticSegmentRomEnd - (u32)_vr_fine_staticSegmentRomStart;
|
||||
size = (u32)_d2_fine_staticSegmentRomEnd - (u32)_d2_fine_staticSegmentRomStart;
|
||||
|
||||
DmaMgr_SendRequestImpl(&skyboxCtx->unk1A8, skyboxCtx->skyboxStaticSegment[1],
|
||||
(u32)_vr_fine_staticSegmentRomStart, size, 0, &skyboxCtx->loadQueue, NULL);
|
||||
(u32)_d2_fine_staticSegmentRomStart, size, 0, &skyboxCtx->loadQueue, NULL);
|
||||
} else {
|
||||
// Send a DMA request for the cloudy sky texture
|
||||
size = (u32)_vr_cloud_staticSegmentRomEnd - (u32)_vr_cloud_staticSegmentRomStart;
|
||||
size = (u32)_d2_cloud_staticSegmentRomEnd - (u32)_d2_cloud_staticSegmentRomStart;
|
||||
|
||||
DmaMgr_SendRequestImpl(&skyboxCtx->unk1A8, skyboxCtx->skyboxStaticSegment[1],
|
||||
(u32)_vr_cloud_staticSegmentRomStart, size, 0, &skyboxCtx->loadQueue, NULL);
|
||||
(u32)_d2_cloud_staticSegmentRomStart, size, 0, &skyboxCtx->loadQueue, NULL);
|
||||
}
|
||||
|
||||
osRecvMesg(&skyboxCtx->loadQueue, NULL, 1);
|
||||
osCreateMesgQueue(&skyboxCtx->loadQueue, &skyboxCtx->loadMsg, 1);
|
||||
|
||||
size = (u32)_vr_pal_staticSegmentRomEnd - (u32)_vr_pal_staticSegmentRomStart;
|
||||
size = (u32)_d2_fine_pal_staticSegmentRomEnd - (u32)_d2_fine_pal_staticSegmentRomStart;
|
||||
|
||||
// Send a DMA request for the skybox palette
|
||||
DmaMgr_SendRequestImpl(&skyboxCtx->unk1C8, skyboxCtx->skyboxPaletteStaticSegment,
|
||||
(u32)_vr_pal_staticSegmentRomStart, size, 0, &skyboxCtx->loadQueue, NULL);
|
||||
(u32)_d2_fine_pal_staticSegmentRomStart, size, 0, &skyboxCtx->loadQueue, NULL);
|
||||
|
||||
osRecvMesg(&skyboxCtx->loadQueue, NULL, 1);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -24,7 +24,7 @@ const ActorInit Bg_Fu_Kaiten_InitVars = {
|
||||
void BgFuKaiten_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
UNK_TYPE pad0;
|
||||
UNK_TYPE pad1;
|
||||
BgMeshHeader* header = 0;
|
||||
CollisionHeader* header = 0;
|
||||
|
||||
Actor_SetScale(thisx, 1.0);
|
||||
BcCheck3_BgActorInit(&THIS->bg, 3);
|
||||
|
||||
@@ -38,7 +38,7 @@ static InitChainEntry D_80B6DFA0[] = {
|
||||
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
extern BgMeshHeader D_06001588;
|
||||
extern CollisionHeader D_06001588;
|
||||
extern UNK_TYPE D_06001410;
|
||||
|
||||
void BgHakaCurtain_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
@@ -47,7 +47,7 @@ static InitChainEntry D_80BD5D10[] = {
|
||||
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
extern BgMeshHeader D_06000F28;
|
||||
extern CollisionHeader D_06000F28;
|
||||
extern UNK_PTR D_06000CE8;
|
||||
|
||||
s32 BgIkanaShutter_AllSwitchesPressed(BgIkanaShutter* this, GlobalContext* globalCtx) {
|
||||
|
||||
@@ -35,7 +35,7 @@ static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
extern BgMeshHeader D_06000A20; // Lilypad collision
|
||||
extern CollisionHeader D_06000A20; // Lilypad collision
|
||||
extern Gfx D_06000040[]; // Lilypad model
|
||||
|
||||
void BgLotus_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
@@ -28,7 +28,7 @@ static InitChainEntry bgMbarChairInitVars[] = {
|
||||
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
extern BgMeshHeader D_060019B4;
|
||||
extern CollisionHeader D_060019B4;
|
||||
extern UNK_TYPE D_06000288;
|
||||
|
||||
void BgMbarChair_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
Reference in New Issue
Block a user