mirror of
https://github.com/zeldaret/oot
synced 2026-06-02 02:00:24 -04:00
Format all src C files
This commit is contained in:
+36
-67
@@ -1,172 +1,141 @@
|
||||
#include <global.h>
|
||||
|
||||
void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, u32 size)
|
||||
{
|
||||
void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, u32 size) {
|
||||
THA_Ct((TwoHeadArena*)thga, start, size);
|
||||
}
|
||||
|
||||
void THGA_Dt(TwoHeadGfxArena* thga)
|
||||
{
|
||||
void THGA_Dt(TwoHeadGfxArena* thga) {
|
||||
THA_Dt((TwoHeadArena*)thga);
|
||||
}
|
||||
|
||||
u32 THGA_IsCrash(TwoHeadGfxArena* thga)
|
||||
{
|
||||
u32 THGA_IsCrash(TwoHeadGfxArena* thga) {
|
||||
return THA_IsCrash((TwoHeadArena*)thga);
|
||||
}
|
||||
|
||||
void THGA_Init(TwoHeadGfxArena* thga)
|
||||
{
|
||||
void THGA_Init(TwoHeadGfxArena* thga) {
|
||||
THA_Init((TwoHeadArena*)thga);
|
||||
}
|
||||
|
||||
s32 THGA_GetSize(TwoHeadGfxArena* thga)
|
||||
{
|
||||
s32 THGA_GetSize(TwoHeadGfxArena* thga) {
|
||||
return THA_GetSize((TwoHeadArena*)thga);
|
||||
}
|
||||
|
||||
Gfx* THGA_GetHead(TwoHeadGfxArena* thga)
|
||||
{
|
||||
Gfx* THGA_GetHead(TwoHeadGfxArena* thga) {
|
||||
return THA_GetHead((TwoHeadArena*)thga);
|
||||
}
|
||||
|
||||
void THGA_SetHead(TwoHeadGfxArena* thga, Gfx* start)
|
||||
{
|
||||
void THGA_SetHead(TwoHeadGfxArena* thga, Gfx* start) {
|
||||
THA_SetHead((TwoHeadArena*)thga, start);
|
||||
}
|
||||
|
||||
Gfx* THGA_GetTail(TwoHeadGfxArena* thga)
|
||||
{
|
||||
Gfx* THGA_GetTail(TwoHeadGfxArena* thga) {
|
||||
return THA_GetTail((TwoHeadArena*)thga);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocStartArray8(TwoHeadGfxArena* thga, u32 count)
|
||||
{
|
||||
Gfx* THGA_AllocStartArray8(TwoHeadGfxArena* thga, u32 count) {
|
||||
return THA_AllocStart((TwoHeadArena*)thga, count * 8);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocStart8(TwoHeadGfxArena* thga)
|
||||
{
|
||||
Gfx* THGA_AllocStart8(TwoHeadGfxArena* thga) {
|
||||
return THGA_AllocStartArray8(thga, 1);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocStart8Wrapper(TwoHeadGfxArena* thga)
|
||||
{
|
||||
Gfx* THGA_AllocStart8Wrapper(TwoHeadGfxArena* thga) {
|
||||
return THGA_AllocStart8(thga);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocEnd(TwoHeadGfxArena* thga, u32 size)
|
||||
{
|
||||
Gfx* THGA_AllocEnd(TwoHeadGfxArena* thga, u32 size) {
|
||||
return THA_AllocEnd((TwoHeadArena*)thga, size);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocEndArray64(TwoHeadGfxArena* thga, u32 count)
|
||||
{
|
||||
Gfx* THGA_AllocEndArray64(TwoHeadGfxArena* thga, u32 count) {
|
||||
return THGA_AllocEnd(thga, count * 0x40);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocEnd64(TwoHeadGfxArena* thga)
|
||||
{
|
||||
Gfx* THGA_AllocEnd64(TwoHeadGfxArena* thga) {
|
||||
return THGA_AllocEnd(thga, 0x40);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocEndArray16(TwoHeadGfxArena* thga, u32 count)
|
||||
{
|
||||
Gfx* THGA_AllocEndArray16(TwoHeadGfxArena* thga, u32 count) {
|
||||
return THGA_AllocEnd(thga, count * 0x10);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocEnd16(TwoHeadGfxArena* thga)
|
||||
{
|
||||
Gfx* THGA_AllocEnd16(TwoHeadGfxArena* thga) {
|
||||
return THGA_AllocEnd(thga, 0x10);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void* THA_GetHead(TwoHeadArena* tha)
|
||||
{
|
||||
void* THA_GetHead(TwoHeadArena* tha) {
|
||||
return tha->head;
|
||||
}
|
||||
|
||||
void THA_SetHead(TwoHeadArena* tha, void* start)
|
||||
{
|
||||
void THA_SetHead(TwoHeadArena* tha, void* start) {
|
||||
tha->head = start;
|
||||
}
|
||||
|
||||
void* THA_GetTail(TwoHeadArena* tha)
|
||||
{
|
||||
void* THA_GetTail(TwoHeadArena* tha) {
|
||||
return tha->tail;
|
||||
}
|
||||
|
||||
void* THA_AllocStart(TwoHeadArena* tha, u32 size)
|
||||
{
|
||||
void* THA_AllocStart(TwoHeadArena* tha, u32 size) {
|
||||
void* start = tha->head;
|
||||
tha->head += size;
|
||||
return start;
|
||||
}
|
||||
|
||||
void* THA_AllocStart1(TwoHeadArena* tha)
|
||||
{
|
||||
void* THA_AllocStart1(TwoHeadArena* tha) {
|
||||
return THA_AllocStart(tha, 1);
|
||||
}
|
||||
|
||||
void* THA_AllocEnd(TwoHeadArena* tha, u32 size)
|
||||
{
|
||||
void* THA_AllocEnd(TwoHeadArena* tha, u32 size) {
|
||||
u32 mask;
|
||||
u32* temp;
|
||||
|
||||
if (size == 8)
|
||||
if (size == 8) {
|
||||
mask = ~7;
|
||||
else if (size == 4 || size == 12)
|
||||
} else if (size == 4 || size == 12) {
|
||||
mask = ~3;
|
||||
else if (size == 2 || size == 6 || size == 10 || size == 12 || size == 14)
|
||||
} else if (size == 2 || size == 6 || size == 10 || size == 12 || size == 14) {
|
||||
mask = ~1;
|
||||
else
|
||||
} else {
|
||||
mask = (size >= 0x10) ? ~0xF : 0;
|
||||
}
|
||||
|
||||
temp = (u32*)&tha->tail; // required to match
|
||||
return tha->tail = (void*)(((*temp & mask) - size) & mask);
|
||||
}
|
||||
|
||||
void* THA_AllocEndAlign16(TwoHeadArena *tha, u32 size)
|
||||
{
|
||||
void* ret = (void*)(u32)((((u32)tha->tail & ~0xF) - size) & ((~(0xF & 0xFFFFFFFFFFFFFFFF)) & 0xFFFFFFFFu)); // required to match
|
||||
void* THA_AllocEndAlign16(TwoHeadArena* tha, u32 size) {
|
||||
void* ret = (void*)(u32)((((u32)tha->tail & ~0xF) - size) &
|
||||
((~(0xF & 0xFFFFFFFFFFFFFFFF)) & 0xFFFFFFFFu)); // required to match
|
||||
tha->tail = ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void* THA_AllocEndAlign(TwoHeadArena* tha, u32 size, u32 mask)
|
||||
{
|
||||
void* THA_AllocEndAlign(TwoHeadArena* tha, u32 size, u32 mask) {
|
||||
void* ret = (void*)((((u32)tha->tail & mask) - size) & mask);
|
||||
tha->tail = ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
s32 THA_GetSize(TwoHeadArena* tha)
|
||||
{
|
||||
s32 THA_GetSize(TwoHeadArena* tha) {
|
||||
return tha->tail - tha->head;
|
||||
}
|
||||
|
||||
u32 THA_IsCrash(TwoHeadArena* tha)
|
||||
{
|
||||
u32 THA_IsCrash(TwoHeadArena* tha) {
|
||||
return THA_GetSize(tha) < 0;
|
||||
}
|
||||
|
||||
void THA_Init(TwoHeadArena* tha)
|
||||
{
|
||||
void THA_Init(TwoHeadArena* tha) {
|
||||
tha->head = tha->bufp;
|
||||
tha->tail = tha->bufp + tha->size;
|
||||
}
|
||||
|
||||
void THA_Ct(TwoHeadArena* tha, void* ptr, u32 size)
|
||||
{
|
||||
void THA_Ct(TwoHeadArena* tha, void* ptr, u32 size) {
|
||||
tha->bufp = ptr;
|
||||
tha->size = size;
|
||||
THA_Init(tha);
|
||||
}
|
||||
|
||||
void THA_Dt(TwoHeadArena* tha)
|
||||
{
|
||||
void THA_Dt(TwoHeadArena* tha) {
|
||||
bzero(tha, sizeof(TwoHeadArena));
|
||||
}
|
||||
|
||||
+249
-332
File diff suppressed because it is too large
Load Diff
@@ -14,4 +14,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/audioMgr/func_800C3FC4.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/audioMgr/func_800C3FEC.s")
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
GlobalContext* func_80026B00(void)
|
||||
{
|
||||
GlobalContext* func_80026B00(void) {
|
||||
return D_80157DA0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80026B00/func_80026B0C.s")
|
||||
|
||||
void func_80026C1C(u8* arg0)
|
||||
{
|
||||
void func_80026C1C(u8* arg0) {
|
||||
arg0[0] = 0;
|
||||
arg0[1] = 0;
|
||||
arg0[2] = 0;
|
||||
|
||||
+18
-21
@@ -3,59 +3,56 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_800430A0/func_800430A0.s")
|
||||
|
||||
void func_800432A0(CollisionContext* colCtx, u32 floorPolySource, Actor* actor)
|
||||
{
|
||||
if (func_8003E934(floorPolySource) != 0)
|
||||
{
|
||||
void func_800432A0(CollisionContext* colCtx, u32 floorPolySource, Actor* actor) {
|
||||
if (func_8003E934(floorPolySource) != 0) {
|
||||
s16 v1 = colCtx->dyna.actorMeshArr[floorPolySource].rot2.y - colCtx->dyna.actorMeshArr[floorPolySource].rot1.y;
|
||||
|
||||
if (actor->id == 0)
|
||||
if (actor->id == 0) {
|
||||
((Player*)actor)->unk_83C += v1;
|
||||
}
|
||||
|
||||
actor->shape.rot.y += v1;
|
||||
actor->posRot.rot.y += v1;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80043334(CollisionContext* colCtx, Actor* actor, u32 floorPolySource)
|
||||
{
|
||||
if (func_8003E934(floorPolySource) != 0)
|
||||
{
|
||||
void func_80043334(CollisionContext* colCtx, Actor* actor, u32 floorPolySource) {
|
||||
if (func_8003E934(floorPolySource) != 0) {
|
||||
DynaPolyActor* dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
|
||||
if (dynaActor != NULL)
|
||||
{
|
||||
if (dynaActor != NULL) {
|
||||
func_800434A8(dynaActor);
|
||||
|
||||
if ((actor->flags & 0x4000000) == 0x4000000)
|
||||
if ((actor->flags & 0x4000000) == 0x4000000) {
|
||||
func_80043538(dynaActor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_800433A4(CollisionContext* colCtx, u32 floorPolySource, Actor* actor)
|
||||
{
|
||||
s32 func_800433A4(CollisionContext* colCtx, u32 floorPolySource, Actor* actor) {
|
||||
s32 sp24 = 0;
|
||||
DynaPolyActor* dynaActor;
|
||||
|
||||
if (func_8003E934(floorPolySource) == 0)
|
||||
if (func_8003E934(floorPolySource) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((colCtx->dyna.flags[floorPolySource] & 2) || !(colCtx->dyna.flags[floorPolySource] & 1))
|
||||
if ((colCtx->dyna.flags[floorPolySource] & 2) || !(colCtx->dyna.flags[floorPolySource] & 1)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
|
||||
|
||||
if (dynaActor == NULL)
|
||||
if (dynaActor == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (dynaActor->unk_15C & 1)
|
||||
{
|
||||
if (dynaActor->unk_15C & 1) {
|
||||
func_800430A0(colCtx, floorPolySource, actor);
|
||||
sp24 = 1;
|
||||
}
|
||||
|
||||
if (dynaActor->unk_15C & 2)
|
||||
{
|
||||
if (dynaActor->unk_15C & 2) {
|
||||
func_800432A0(colCtx, floorPolySource, actor);
|
||||
sp24 = 1;
|
||||
}
|
||||
|
||||
+30
-36
@@ -1,8 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void DynaPolyInfo_SetActorMove(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags)
|
||||
{
|
||||
void DynaPolyInfo_SetActorMove(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags) {
|
||||
dynaActor->dynaPolyId = -1;
|
||||
dynaActor->unk_15C = flags;
|
||||
dynaActor->unk_160 = 0;
|
||||
@@ -10,77 +9,72 @@ void DynaPolyInfo_SetActorMove(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags)
|
||||
dynaActor->unk_154 = 0.0f;
|
||||
}
|
||||
|
||||
void func_800434A0(DynaPolyActor *dynaActor)
|
||||
{
|
||||
void func_800434A0(DynaPolyActor* dynaActor) {
|
||||
dynaActor->unk_160 = 0;
|
||||
}
|
||||
|
||||
void func_800434A8(DynaPolyActor *dynaActor)
|
||||
{
|
||||
void func_800434A8(DynaPolyActor* dynaActor) {
|
||||
dynaActor->unk_160 |= 1;
|
||||
}
|
||||
|
||||
void func_800434B8(DynaPolyActor *dynaActor)
|
||||
{
|
||||
void func_800434B8(DynaPolyActor* dynaActor) {
|
||||
dynaActor->unk_160 |= 2;
|
||||
}
|
||||
|
||||
void func_800434C8(CollisionContext* colCtx, u32 floorPolySource)
|
||||
{
|
||||
DynaPolyActor *dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
|
||||
void func_800434C8(CollisionContext* colCtx, u32 floorPolySource) {
|
||||
DynaPolyActor* dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
|
||||
|
||||
if (dynaActor != NULL)
|
||||
if (dynaActor != NULL) {
|
||||
func_800434B8(dynaActor);
|
||||
}
|
||||
}
|
||||
|
||||
void func_800434F8(DynaPolyActor* dynaActor)
|
||||
{
|
||||
void func_800434F8(DynaPolyActor* dynaActor) {
|
||||
dynaActor->unk_160 |= 4;
|
||||
}
|
||||
|
||||
void func_80043508(CollisionContext* colCtx, u32 floorPolySource)
|
||||
{
|
||||
DynaPolyActor *dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
|
||||
void func_80043508(CollisionContext* colCtx, u32 floorPolySource) {
|
||||
DynaPolyActor* dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
|
||||
|
||||
if (dynaActor != NULL)
|
||||
if (dynaActor != NULL) {
|
||||
func_800434F8(dynaActor);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80043538(DynaPolyActor* dynaActor)
|
||||
{
|
||||
void func_80043538(DynaPolyActor* dynaActor) {
|
||||
dynaActor->unk_160 |= 8;
|
||||
}
|
||||
|
||||
s32 func_80043548(DynaPolyActor* dynaActor)
|
||||
{
|
||||
if (dynaActor->unk_160 & 1)
|
||||
s32 func_80043548(DynaPolyActor* dynaActor) {
|
||||
if (dynaActor->unk_160 & 1) {
|
||||
return 1;
|
||||
else
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_8004356C(DynaPolyActor* dynaActor)
|
||||
{
|
||||
if (dynaActor->unk_160 & 2)
|
||||
s32 func_8004356C(DynaPolyActor* dynaActor) {
|
||||
if (dynaActor->unk_160 & 2) {
|
||||
return 1;
|
||||
else
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_80043590(DynaPolyActor* dynaActor)
|
||||
{
|
||||
if (dynaActor->unk_160 & 4)
|
||||
s32 func_80043590(DynaPolyActor* dynaActor) {
|
||||
if (dynaActor->unk_160 & 4) {
|
||||
return 1;
|
||||
else
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_800435B4(DynaPolyActor* dynaActor)
|
||||
{
|
||||
if (dynaActor->unk_160 & 8)
|
||||
s32 func_800435B4(DynaPolyActor* dynaActor) {
|
||||
if (dynaActor->unk_160 & 8) {
|
||||
return 1;
|
||||
else
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80043480/func_800435D8.s")
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void* MemCopy(void* dest, void* src, s32 size)
|
||||
{
|
||||
void* MemCopy(void* dest, void* src, s32 size) {
|
||||
u8* destu = (u8*)dest;
|
||||
u8* srcu = (u8*)src;
|
||||
|
||||
while (size > 0)
|
||||
{
|
||||
while (size > 0) {
|
||||
*destu++ = *srcu++;
|
||||
size--;
|
||||
}
|
||||
@@ -15,13 +13,11 @@ void* MemCopy(void* dest, void* src, s32 size)
|
||||
return dest;
|
||||
}
|
||||
|
||||
void* MemSet(void* dest, s32 val, s32 size)
|
||||
{
|
||||
void* MemSet(void* dest, s32 val, s32 size) {
|
||||
u8* destu = (u8*)dest;
|
||||
s32 s = size;
|
||||
|
||||
while (s > 0)
|
||||
{
|
||||
while (s > 0) {
|
||||
*destu++ = val;
|
||||
s--;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
u16 D_8011F3F0[60][9] =
|
||||
{
|
||||
u16 D_8011F3F0[60][9] = {
|
||||
{ 0x0000, 0x7124, 0x7127, 0x7126, 0x7125, 0x7127, 0x7124, 0x7125, 0x7127 },
|
||||
{ 0x0000, 0x7128, 0x7129, 0x7128, 0x7128, 0x7128, 0x7128, 0x712A, 0x712B },
|
||||
{ 0x0000, 0x7128, 0x712B, 0x7128, 0x7128, 0x7129, 0x7128, 0x712B, 0x7128 },
|
||||
@@ -65,8 +64,7 @@ u16 D_8011F3F0[60][9] =
|
||||
{ 0x0000, 0x7104, 0x7105, 0x7107, 0x7105, 0x710C, 0x7105, 0x7107, 0x7107 },
|
||||
};
|
||||
|
||||
u16 func_8006C360(GlobalContext* globalCtx, u32 idx)
|
||||
{
|
||||
u16 func_8006C360(GlobalContext* globalCtx, u32 idx) {
|
||||
u8 mask = func_8008F080(globalCtx);
|
||||
return D_8011F3F0[idx][mask];
|
||||
}
|
||||
|
||||
@@ -8,4 +8,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C438.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C4A4.s")
|
||||
|
||||
|
||||
@@ -4,4 +4,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C510/func_8006C510.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C510/func_8006C5A8.s")
|
||||
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006EA30/func_8006ECF4.s")
|
||||
|
||||
void func_8006EE48(UNK_TYPE arg0)
|
||||
{
|
||||
|
||||
void func_8006EE48(UNK_TYPE arg0) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006EA30/func_8006EE50.s")
|
||||
|
||||
|
||||
+10
-21
@@ -3,8 +3,7 @@
|
||||
|
||||
Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1);
|
||||
|
||||
f32 func_8007BF90(Vec3f* a, Vec3f* b)
|
||||
{
|
||||
f32 func_8007BF90(Vec3f* a, Vec3f* b) {
|
||||
f32 dx = a->x - b->x;
|
||||
f32 dy = a->y - b->y;
|
||||
f32 dz = a->z - b->z;
|
||||
@@ -12,8 +11,7 @@ f32 func_8007BF90(Vec3f* a, Vec3f* b)
|
||||
return sqrtf(SQ(dx) + SQ(dy) + SQ(dz));
|
||||
}
|
||||
|
||||
f32 func_8007BFD0(Vec3f* a, Vec3f* b, Vec3f* dest)
|
||||
{
|
||||
f32 func_8007BFD0(Vec3f* a, Vec3f* b, Vec3f* dest) {
|
||||
dest->x = a->x - b->x;
|
||||
dest->y = a->y - b->y;
|
||||
dest->z = a->z - b->z;
|
||||
@@ -21,20 +19,17 @@ f32 func_8007BFD0(Vec3f* a, Vec3f* b, Vec3f* dest)
|
||||
return sqrtf(SQ(dest->x) + SQ(dest->y) + SQ(dest->z));
|
||||
}
|
||||
|
||||
f32 func_8007C028(Vec3f* a, Vec3f* b)
|
||||
{
|
||||
f32 func_8007C028(Vec3f* a, Vec3f* b) {
|
||||
return sqrtf(SQ(a->x - b->x) + SQ(a->z - b->z));
|
||||
}
|
||||
|
||||
f32 func_8007C058(f32 arg0, f32 arg1)
|
||||
{
|
||||
f32 func_8007C058(f32 arg0, f32 arg1) {
|
||||
return (arg1 <= fabsf(arg0)) ? arg0 : ((arg0 >= 0) ? arg1 : -arg1);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF90/func_8007C0A8.s")
|
||||
|
||||
Vec3f* func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b)
|
||||
{
|
||||
Vec3f* func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b) {
|
||||
Vec3f v1;
|
||||
Vec3f v2;
|
||||
f32 temp;
|
||||
@@ -54,8 +49,7 @@ Vec3f* func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b)
|
||||
return dest;
|
||||
}
|
||||
|
||||
Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1)
|
||||
{
|
||||
Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1) {
|
||||
Vec3f v;
|
||||
f32 sin4;
|
||||
f32 cos4;
|
||||
@@ -78,8 +72,7 @@ Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1)
|
||||
|
||||
void func_8007C3F4(struct_80045714* arg0, Vec3f* arg1);
|
||||
|
||||
void func_8007C25C(Vec3f* dest, struct_80045714* arg1)
|
||||
{
|
||||
void func_8007C25C(Vec3f* dest, struct_80045714* arg1) {
|
||||
struct_80045714 var;
|
||||
|
||||
var.unk_00 = arg1->unk_00;
|
||||
@@ -95,8 +88,7 @@ void func_8007C25C(Vec3f* dest, struct_80045714* arg1)
|
||||
|
||||
void func_8007C29C(struct_80045714* arg0, Vec3f* arg1);
|
||||
|
||||
void func_8007C440(struct_80045714* arg0, Vec3f* a, Vec3f* b)
|
||||
{
|
||||
void func_8007C440(struct_80045714* arg0, Vec3f* a, Vec3f* b) {
|
||||
Vec3f var;
|
||||
|
||||
var.x = b->x - a->x;
|
||||
@@ -106,8 +98,7 @@ void func_8007C440(struct_80045714* arg0, Vec3f* a, Vec3f* b)
|
||||
func_8007C29C(arg0, &var);
|
||||
}
|
||||
|
||||
void func_8007C490(struct_80045714* arg0, Vec3f* a, Vec3f* b)
|
||||
{
|
||||
void func_8007C490(struct_80045714* arg0, Vec3f* a, Vec3f* b) {
|
||||
Vec3f var;
|
||||
|
||||
var.x = b->x - a->x;
|
||||
@@ -117,8 +108,7 @@ void func_8007C490(struct_80045714* arg0, Vec3f* a, Vec3f* b)
|
||||
func_8007C3F4(arg0, &var);
|
||||
}
|
||||
|
||||
Vec3f* func_8007C4E0(Vec3f* dest, Vec3f* a, Vec3f* b)
|
||||
{
|
||||
Vec3f* func_8007C4E0(Vec3f* dest, Vec3f* a, Vec3f* b) {
|
||||
Vec3f var;
|
||||
|
||||
var.x = Math_atan2f(b->z - a->z, b->y - a->y);
|
||||
@@ -133,4 +123,3 @@ Vec3f* func_8007C4E0(Vec3f* dest, Vec3f* a, Vec3f* b)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF90/func_8007C574.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF90/func_8007C5E0.s")
|
||||
|
||||
|
||||
+55
-224
@@ -2,244 +2,77 @@
|
||||
#include <global.h>
|
||||
|
||||
// Bit Flag array in which gBitFlags[n] is literally (1 << n)
|
||||
u32 gBitFlags[] =
|
||||
{
|
||||
(1 << 0), (1 << 1), (1 << 2), (1 << 3),
|
||||
(1 << 4), (1 << 5), (1 << 6), (1 << 7),
|
||||
(1 << 8), (1 << 9), (1 << 10), (1 << 11),
|
||||
(1 << 12), (1 << 13), (1 << 14), (1 << 15),
|
||||
(1 << 16), (1 << 17), (1 << 18), (1 << 19),
|
||||
(1 << 20), (1 << 21), (1 << 22), (1 << 23),
|
||||
(1 << 24), (1 << 25), (1 << 26), (1 << 27),
|
||||
(1 << 28), (1 << 29), (1 << 30), (1 << 31),
|
||||
u32 gBitFlags[] = {
|
||||
(1 << 0), (1 << 1), (1 << 2), (1 << 3), (1 << 4), (1 << 5), (1 << 6), (1 << 7),
|
||||
(1 << 8), (1 << 9), (1 << 10), (1 << 11), (1 << 12), (1 << 13), (1 << 14), (1 << 15),
|
||||
(1 << 16), (1 << 17), (1 << 18), (1 << 19), (1 << 20), (1 << 21), (1 << 22), (1 << 23),
|
||||
(1 << 24), (1 << 25), (1 << 26), (1 << 27), (1 << 28), (1 << 29), (1 << 30), (1 << 31),
|
||||
};
|
||||
|
||||
u16 gEquipMasks[] = { 0x000F, 0x00F0, 0x0F00, 0xF000 };
|
||||
u16 gEquipNegMasks[] = { 0xFFF0, 0xFF0F, 0xF0FF, 0x0FFF };
|
||||
u32 gUpgradeMasks[] = { 0x00000007, 0x00000038, 0x000001C0, 0x00000E00, 0x00003000, 0x0001C000, 0x000E0000, 0x00700000 };
|
||||
u32 gUpgradeNegMasks[] = { 0xFFFFFFF8, 0xFFFFFFC7, 0xFFFFFE3F, 0xFFFFF1FF, 0xFFFFCFFF, 0xFFFE3FFF, 0xFFF1FFFF, 0xFF8FFFFF };
|
||||
u32 gUpgradeMasks[] = {
|
||||
0x00000007, 0x00000038, 0x000001C0, 0x00000E00, 0x00003000, 0x0001C000, 0x000E0000, 0x00700000,
|
||||
};
|
||||
u32 gUpgradeNegMasks[] = {
|
||||
0xFFFFFFF8, 0xFFFFFFC7, 0xFFFFFE3F, 0xFFFFF1FF, 0xFFFFCFFF, 0xFFFE3FFF, 0xFFF1FFFF, 0xFF8FFFFF,
|
||||
};
|
||||
u8 gEquipShifts[] = { 0, 4, 8, 12 };
|
||||
u8 gUpgradeShifts[] = { 0, 3, 6, 9, 12, 14, 17, 20 };
|
||||
|
||||
u16 gUpgradeCapacities[][4] =
|
||||
{
|
||||
{ 0, 30, 40, 50 }, // Quivers
|
||||
{ 0, 20, 30, 40 }, // Bomb Bags
|
||||
{ 0, 0, 0, 0 }, // Unused (Scale)
|
||||
{ 0, 0, 0, 0 }, // Unused (Strength)
|
||||
{ 99, 200, 500, 500 }, // Wallets
|
||||
{ 0, 30, 40, 50 }, // Deku Seed Bullet Bags
|
||||
{ 0, 10, 20, 30 }, // Deku Stick Upgrades
|
||||
{ 0, 20, 30, 40 }, // Deku Nut Upgrades
|
||||
u16 gUpgradeCapacities[][4] = {
|
||||
{ 0, 30, 40, 50 }, // Quivers
|
||||
{ 0, 20, 30, 40 }, // Bomb Bags
|
||||
{ 0, 0, 0, 0 }, // Unused (Scale)
|
||||
{ 0, 0, 0, 0 }, // Unused (Strength)
|
||||
{ 99, 200, 500, 500 }, // Wallets
|
||||
{ 0, 30, 40, 50 }, // Deku Seed Bullet Bags
|
||||
{ 0, 10, 20, 30 }, // Deku Stick Upgrades
|
||||
{ 0, 20, 30, 40 }, // Deku Nut Upgrades
|
||||
};
|
||||
|
||||
u32 D_8012723C[] = { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 }; // Unused
|
||||
u32 D_8012724C[] = { 0, 8, 16, 24 }; // Unused
|
||||
u32 D_8012724C[] = { 0, 8, 16, 24 }; // Unused
|
||||
|
||||
// TODO: use symbols for these icon textures once textures are properly in C
|
||||
u32 gItemIcons[] =
|
||||
{
|
||||
0x08000000,
|
||||
0x08001000,
|
||||
0x08002000,
|
||||
0x08003000,
|
||||
0x08004000,
|
||||
0x08005000,
|
||||
0x08006000,
|
||||
0x08007000,
|
||||
0x08008000,
|
||||
0x08009000,
|
||||
0x0800A000,
|
||||
0x0800B000,
|
||||
0x0800C000,
|
||||
0x0800D000,
|
||||
0x0800E000,
|
||||
0x0800F000,
|
||||
0x08010000,
|
||||
0x08011000,
|
||||
0x08012000,
|
||||
0x08013000,
|
||||
0x08014000,
|
||||
0x08015000,
|
||||
0x08016000,
|
||||
0x08017000,
|
||||
0x08018000,
|
||||
0x08019000,
|
||||
0x0801A000,
|
||||
0x0801B000,
|
||||
0x0801C000,
|
||||
0x0801D000,
|
||||
0x0801E000,
|
||||
0x0801F000,
|
||||
0x08020000,
|
||||
0x08021000,
|
||||
0x08022000,
|
||||
0x08023000,
|
||||
0x08024000,
|
||||
0x08025000,
|
||||
0x08026000,
|
||||
0x08027000,
|
||||
0x08028000,
|
||||
0x08029000,
|
||||
0x0802A000,
|
||||
0x0802B000,
|
||||
0x0802C000,
|
||||
0x0802D000,
|
||||
0x0802E000,
|
||||
0x0802F000,
|
||||
0x08030000,
|
||||
0x08031000,
|
||||
0x08032000,
|
||||
0x08033000,
|
||||
0x08034000,
|
||||
0x08035000,
|
||||
0x08036000,
|
||||
0x08037000,
|
||||
0x08038000,
|
||||
0x08039000,
|
||||
0x0803A000,
|
||||
0x0803B000,
|
||||
0x0803C000,
|
||||
0x0803D000,
|
||||
0x0803E000,
|
||||
0x0803F000,
|
||||
0x08040000,
|
||||
0x08041000,
|
||||
0x08042000,
|
||||
0x08043000,
|
||||
0x08044000,
|
||||
0x08045000,
|
||||
0x08046000,
|
||||
0x08047000,
|
||||
0x08048000,
|
||||
0x08049000,
|
||||
0x0804A000,
|
||||
0x0804B000,
|
||||
0x0804C000,
|
||||
0x0804D000,
|
||||
0x0804E000,
|
||||
0x0804F000,
|
||||
0x08050000,
|
||||
0x08051000,
|
||||
0x08052000,
|
||||
0x08053000,
|
||||
0x08054000,
|
||||
0x08055000,
|
||||
0x08056000,
|
||||
0x08057000,
|
||||
0x08058000,
|
||||
0x08059000,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x09000000,
|
||||
0x09000900,
|
||||
0x09001200,
|
||||
0x09001B00,
|
||||
0x09002400,
|
||||
0x09002D00,
|
||||
0x09003600,
|
||||
0x09003F00,
|
||||
0x09004800,
|
||||
0x09005100,
|
||||
0x09005A00,
|
||||
0x09006300,
|
||||
0x09006C00,
|
||||
0x09007500,
|
||||
0x09007E00,
|
||||
0x09009000,
|
||||
0x09008700,
|
||||
0x09007E00,
|
||||
0x0900A200,
|
||||
0x0900AB00,
|
||||
0x0805A000,
|
||||
0x0805A900,
|
||||
0x0805B200,
|
||||
0x02002D40,
|
||||
0x02002A40,
|
||||
0x02002C40,
|
||||
0x02002B40,
|
||||
0x02002940,
|
||||
u32 gItemIcons[] = {
|
||||
0x08000000, 0x08001000, 0x08002000, 0x08003000, 0x08004000, 0x08005000, 0x08006000, 0x08007000, 0x08008000,
|
||||
0x08009000, 0x0800A000, 0x0800B000, 0x0800C000, 0x0800D000, 0x0800E000, 0x0800F000, 0x08010000, 0x08011000,
|
||||
0x08012000, 0x08013000, 0x08014000, 0x08015000, 0x08016000, 0x08017000, 0x08018000, 0x08019000, 0x0801A000,
|
||||
0x0801B000, 0x0801C000, 0x0801D000, 0x0801E000, 0x0801F000, 0x08020000, 0x08021000, 0x08022000, 0x08023000,
|
||||
0x08024000, 0x08025000, 0x08026000, 0x08027000, 0x08028000, 0x08029000, 0x0802A000, 0x0802B000, 0x0802C000,
|
||||
0x0802D000, 0x0802E000, 0x0802F000, 0x08030000, 0x08031000, 0x08032000, 0x08033000, 0x08034000, 0x08035000,
|
||||
0x08036000, 0x08037000, 0x08038000, 0x08039000, 0x0803A000, 0x0803B000, 0x0803C000, 0x0803D000, 0x0803E000,
|
||||
0x0803F000, 0x08040000, 0x08041000, 0x08042000, 0x08043000, 0x08044000, 0x08045000, 0x08046000, 0x08047000,
|
||||
0x08048000, 0x08049000, 0x0804A000, 0x0804B000, 0x0804C000, 0x0804D000, 0x0804E000, 0x0804F000, 0x08050000,
|
||||
0x08051000, 0x08052000, 0x08053000, 0x08054000, 0x08055000, 0x08056000, 0x08057000, 0x08058000, 0x08059000,
|
||||
0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440,
|
||||
0x08089440, 0x08089440, 0x08089440, 0x09000000, 0x09000900, 0x09001200, 0x09001B00, 0x09002400, 0x09002D00,
|
||||
0x09003600, 0x09003F00, 0x09004800, 0x09005100, 0x09005A00, 0x09006300, 0x09006C00, 0x09007500, 0x09007E00,
|
||||
0x09009000, 0x09008700, 0x09007E00, 0x0900A200, 0x0900AB00, 0x0805A000, 0x0805A900, 0x0805B200, 0x02002D40,
|
||||
0x02002A40, 0x02002C40, 0x02002B40, 0x02002940,
|
||||
};
|
||||
|
||||
// Used to map item IDs to inventory slots
|
||||
u8 gItemSlots[] =
|
||||
{
|
||||
SLOT_STICK,
|
||||
SLOT_NUT,
|
||||
SLOT_BOMB,
|
||||
SLOT_BOW,
|
||||
SLOT_ARROW_FIRE,
|
||||
SLOT_DINS_FIRE,
|
||||
SLOT_SLINGSHOT,
|
||||
SLOT_OCARINA,
|
||||
SLOT_OCARINA,
|
||||
SLOT_BOMBCHU,
|
||||
SLOT_HOOKSHOT,
|
||||
SLOT_HOOKSHOT,
|
||||
SLOT_ARROW_ICE,
|
||||
SLOT_FARORES_WIND,
|
||||
SLOT_BOOMERANG,
|
||||
SLOT_LENS,
|
||||
SLOT_BEAN,
|
||||
SLOT_HAMMER,
|
||||
SLOT_ARROW_LIGHT,
|
||||
SLOT_NAYRUS_LOVE,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT
|
||||
u8 gItemSlots[] = {
|
||||
SLOT_STICK, SLOT_NUT, SLOT_BOMB, SLOT_BOW, SLOT_ARROW_FIRE, SLOT_DINS_FIRE,
|
||||
SLOT_SLINGSHOT, SLOT_OCARINA, SLOT_OCARINA, SLOT_BOMBCHU, SLOT_HOOKSHOT, SLOT_HOOKSHOT,
|
||||
SLOT_ARROW_ICE, SLOT_FARORES_WIND, SLOT_BOOMERANG, SLOT_LENS, SLOT_BEAN, SLOT_HAMMER,
|
||||
SLOT_ARROW_LIGHT, SLOT_NAYRUS_LOVE, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT, SLOT_TRADE_ADULT,
|
||||
};
|
||||
|
||||
void Inventory_ChangeEquipment(s16 equipment, u16 value)
|
||||
{
|
||||
void Inventory_ChangeEquipment(s16 equipment, u16 value) {
|
||||
gSaveContext.equips.equipment &= gEquipNegMasks[equipment];
|
||||
gSaveContext.equips.equipment |= value << gEquipShifts[equipment];
|
||||
}
|
||||
|
||||
u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment)
|
||||
{
|
||||
u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) {
|
||||
Player* player = PLAYER;
|
||||
s32 pad;
|
||||
u16 sp26;
|
||||
@@ -249,18 +82,17 @@ u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment)
|
||||
// Translates to: "Erasing equipment item = %d zzz=%d"
|
||||
osSyncPrintf("装備アイテム抹消 = %d zzz=%d\n", equipment, sp26);
|
||||
|
||||
if (sp26)
|
||||
{
|
||||
if (sp26) {
|
||||
sp26 >>= gEquipShifts[equipment];
|
||||
|
||||
gSaveContext.equips.equipment &= gEquipNegMasks[equipment];
|
||||
gSaveContext.equipment ^= gBitFlags[sp26 - 1] << gEquipShifts[equipment];
|
||||
|
||||
if (equipment == EQUIP_TUNIC)
|
||||
if (equipment == EQUIP_TUNIC) {
|
||||
gSaveContext.equips.equipment |= 0x0100;
|
||||
}
|
||||
|
||||
if (equipment == EQUIP_SWORD)
|
||||
{
|
||||
if (equipment == EQUIP_SWORD) {
|
||||
gSaveContext.equips.button_items[0] = ITEM_NONE;
|
||||
gSaveContext.inf_table[29] = 1;
|
||||
}
|
||||
@@ -272,8 +104,7 @@ u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment)
|
||||
return sp26;
|
||||
}
|
||||
|
||||
void Inventory_ChangeUpgrade(s16 upgrade, s16 value)
|
||||
{
|
||||
void Inventory_ChangeUpgrade(s16 upgrade, s16 value) {
|
||||
gSaveContext.upgrades &= gUpgradeNegMasks[upgrade];
|
||||
gSaveContext.upgrades |= value << gUpgradeShifts[upgrade];
|
||||
}
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ OSPiHandle piHandle;
|
||||
/* 0x74 */ OSIoMesg ioMesg;
|
||||
/* 0x8C */ OSMesgQueue mesgQ;
|
||||
} struct_800A9D40;
|
||||
|
||||
struct_800A9D40 D_8012A690 = {0};
|
||||
struct_800A9D40 D_8012A690 = { 0 };
|
||||
|
||||
void func_800A9D40(u32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 handlePageSize, u8 handleRelDuration,
|
||||
u8 handlePulse, u32 handleSpeed)
|
||||
{
|
||||
u8 handlePulse, u32 handleSpeed) {
|
||||
u32 int_disabled;
|
||||
|
||||
OSPiHandle *handle = &D_8012A690.piHandle;
|
||||
if ((u32) OS_PHYSICAL_TO_K1(addr) != (*handle).baseAddress)
|
||||
{
|
||||
OSPiHandle* handle = &D_8012A690.piHandle;
|
||||
if ((u32)OS_PHYSICAL_TO_K1(addr) != (*handle).baseAddress) {
|
||||
D_8012A690.piHandle.type = handleType;
|
||||
(*handle).baseAddress = OS_PHYSICAL_TO_K1(addr);
|
||||
D_8012A690.piHandle.latency = handleLatency;
|
||||
@@ -37,8 +34,7 @@ void func_800A9D40(u32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u
|
||||
}
|
||||
}
|
||||
|
||||
void func_800A9E14(UNK_PTR dramAddr, size_t size, UNK_TYPE arg2)
|
||||
{
|
||||
void func_800A9E14(UNK_PTR dramAddr, size_t size, UNK_TYPE arg2) {
|
||||
OSMesg mesg;
|
||||
|
||||
osCreateMesgQueue(&D_8012A690.mesgQ, &mesg, 1);
|
||||
@@ -50,8 +46,7 @@ void func_800A9E14(UNK_PTR dramAddr, size_t size, UNK_TYPE arg2)
|
||||
osInvalDCache(dramAddr, size);
|
||||
}
|
||||
|
||||
void Sram_ReadWrite(UNK_TYPE arg0, UNK_PTR dramAddr, size_t size, UNK_TYPE arg3)
|
||||
{
|
||||
void Sram_ReadWrite(UNK_TYPE arg0, UNK_PTR dramAddr, size_t size, UNK_TYPE arg3) {
|
||||
osSyncPrintf("ssSRAMReadWrite:%08x %08x %08x %d\n", arg0, dramAddr, size, arg3);
|
||||
func_800A9D40(arg0, 3, 1, 5, 0xd, 2, 0xc, 0);
|
||||
func_800A9E14(dramAddr, size, arg3);
|
||||
|
||||
+15
-25
@@ -5,26 +5,23 @@
|
||||
extern u8 D_80160FD0[];
|
||||
extern PadMgr gPadMgr;
|
||||
|
||||
void func_800A9F30(s32 a, s32 b)
|
||||
{
|
||||
void func_800A9F30(s32 a, s32 b) {
|
||||
func_800D2E30(&D_80160FD0);
|
||||
func_800C7948(a, &D_80160FD0);
|
||||
}
|
||||
|
||||
void func_800A9F6C(f32 a, u8 b, u8 c, u8 d)
|
||||
{
|
||||
void func_800A9F6C(f32 a, u8 b, u8 c, u8 d) {
|
||||
s32 temp1, temp2;
|
||||
|
||||
if (1000000.0f < a)
|
||||
if (1000000.0f < a) {
|
||||
temp1 = 1000;
|
||||
else
|
||||
} else {
|
||||
temp1 = sqrtf(a);
|
||||
}
|
||||
|
||||
if ((temp1 < 1000) && (b != 0) && (d != 0))
|
||||
{
|
||||
if ((temp1 < 1000) && (b != 0) && (d != 0)) {
|
||||
temp2 = b - (temp1 * 255) / 1000;
|
||||
if (temp2 > 0)
|
||||
{
|
||||
if (temp2 > 0) {
|
||||
D_801610DA = temp2;
|
||||
D_80160FD0[0x10B] = c;
|
||||
D_80160FD0[0x10C] = d;
|
||||
@@ -35,22 +32,19 @@ void func_800A9F6C(f32 a, u8 b, u8 c, u8 d)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_800A9F30/func_800AA000.s")
|
||||
// this function is very similar to the one above but has a loop in it I can't figure out
|
||||
|
||||
void func_800AA0B4(void)
|
||||
{
|
||||
void func_800AA0B4(void) {
|
||||
func_800D3140(&D_80160FD0);
|
||||
|
||||
gPadMgr.unk_460 = func_800A9F30;
|
||||
gPadMgr.unk_464 = 0;
|
||||
|
||||
if (0) ; // Necessary to match
|
||||
if (0) {} // Necessary to match
|
||||
}
|
||||
|
||||
void func_800AA0F0(void)
|
||||
{
|
||||
void func_800AA0F0(void) {
|
||||
PadMgr* padmgr = &gPadMgr;
|
||||
|
||||
if ((padmgr->unk_460 == func_800A9F30) && (padmgr->unk_464 == 0))
|
||||
{
|
||||
if ((padmgr->unk_460 == func_800A9F30) && (padmgr->unk_464 == 0)) {
|
||||
padmgr->unk_460 = NULL;
|
||||
padmgr->unk_464 = 0;
|
||||
}
|
||||
@@ -58,22 +52,18 @@ void func_800AA0F0(void)
|
||||
func_800D3178(&D_80160FD0);
|
||||
}
|
||||
|
||||
u32 func_800AA148(void)
|
||||
{
|
||||
u32 func_800AA148(void) {
|
||||
return ((gPadMgr.unk_2AE[0] ^ 1) == 0);
|
||||
}
|
||||
|
||||
void func_800AA15C(void)
|
||||
{
|
||||
void func_800AA15C(void) {
|
||||
D_801610D4 = 2;
|
||||
}
|
||||
|
||||
void func_800AA16C(void)
|
||||
{
|
||||
void func_800AA16C(void) {
|
||||
D_801610D4 = 0;
|
||||
}
|
||||
|
||||
void func_800AA178(u32 a)
|
||||
{
|
||||
void func_800AA178(u32 a) {
|
||||
D_801610D5 = !!a;
|
||||
}
|
||||
|
||||
+42
-67
@@ -1,75 +1,63 @@
|
||||
#include <global.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 type;
|
||||
/* 0x04 */ u32 setScissor;
|
||||
/* 0x08 */ union
|
||||
{
|
||||
/* 0x08 */ union {
|
||||
Color_RGBA8 c;
|
||||
u32 rgba;
|
||||
} color;
|
||||
/* 0x0C */ u32 unk_0C;
|
||||
} struct_801664F0;
|
||||
|
||||
Gfx D_8012AC00[] =
|
||||
{
|
||||
gsDPSetOtherMode(
|
||||
G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
|
||||
G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | G_RM_VISCVG | G_RM_VISCVG2),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
|
||||
Gfx D_8012AC00[] = {
|
||||
gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | G_RM_VISCVG | G_RM_VISCVG2),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
|
||||
gsDPPipeSync(),
|
||||
gsDPSetBlendColor(0, 0, 0, 8),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx D_8012AC28[] =
|
||||
{
|
||||
gsDPSetOtherMode(
|
||||
G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
|
||||
G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
|
||||
GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG,G_BL_CLR_MEM, G_BL_A_MEM) |
|
||||
GBL_c2(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM)),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
|
||||
Gfx D_8012AC28[] = {
|
||||
gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
|
||||
GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM) |
|
||||
GBL_c2(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM)),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx D_8012AC40[] =
|
||||
{
|
||||
gsDPSetOtherMode(
|
||||
G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
|
||||
G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
|
||||
GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) |
|
||||
GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)),
|
||||
Gfx D_8012AC40[] = {
|
||||
gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
|
||||
GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) |
|
||||
GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)),
|
||||
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx D_8012AC58[] =
|
||||
{
|
||||
Gfx D_8012AC58[] = {
|
||||
gsDPSetCombineLERP(K5, K5, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE, K5, K5, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE),
|
||||
gsDPSetOtherMode(
|
||||
G_AD_NOTPATTERN | G_CD_DISABLE | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
|
||||
G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
|
||||
gsDPSetOtherMode(
|
||||
G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
|
||||
G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
|
||||
GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) |
|
||||
GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_DISABLE | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
|
||||
gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
|
||||
GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) |
|
||||
GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
//Init func
|
||||
void func_800ACE70(struct_801664F0* this)
|
||||
{
|
||||
// Init func
|
||||
void func_800ACE70(struct_801664F0* this) {
|
||||
this->type = 0;
|
||||
this->setScissor = false;
|
||||
this->color.c.r = 0xFF;
|
||||
@@ -78,15 +66,12 @@ void func_800ACE70(struct_801664F0* this)
|
||||
this->color.c.a = 0xFF;
|
||||
}
|
||||
|
||||
//Destroy func
|
||||
void func_800ACE90(struct_801664F0* this)
|
||||
{
|
||||
|
||||
// Destroy func
|
||||
void func_800ACE90(struct_801664F0* this) {
|
||||
}
|
||||
|
||||
//Update func
|
||||
void func_800ACE98(struct_801664F0* this, Gfx** gfxp)
|
||||
{
|
||||
// Update func
|
||||
void func_800ACE98(struct_801664F0* this, Gfx** gfxp) {
|
||||
Gfx* gfx;
|
||||
|
||||
gfx = *gfxp;
|
||||
@@ -94,37 +79,27 @@ void func_800ACE98(struct_801664F0* this, Gfx** gfxp)
|
||||
gDPPipeSync(gfx++);
|
||||
gDPSetPrimDepth(gfx++, -1, -1);
|
||||
|
||||
if (this->setScissor == true)
|
||||
{
|
||||
if (this->setScissor == true) {
|
||||
gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
}
|
||||
|
||||
switch(this->type)
|
||||
{
|
||||
|
||||
switch (this->type) {
|
||||
case 1:
|
||||
{
|
||||
gSPDisplayList(gfx++, D_8012AC40);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
gDPSetColor(gfx++, G_SETPRIMCOLOR, this->color.rgba);
|
||||
gSPDisplayList(gfx++, D_8012AC58);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
gDPSetColor(gfx++, G_SETBLENDCOLOR, this->color.rgba);
|
||||
gSPDisplayList(gfx++, D_8012AC00);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
gDPSetColor(gfx++, G_SETFOGCOLOR, this->color.rgba);
|
||||
gSPDisplayList(gfx++, D_8012AC28);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
*gfxp = gfx;
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
#include <z64.h>
|
||||
|
||||
#define printSpStatus(x, name) if (x & SP_STATUS_##name) osSyncPrintf(#name " ")
|
||||
#define printDpStatus(x, name) if (x & DPC_STATUS_##name) osSyncPrintf(#name " ")
|
||||
#define printSpStatus(x, name) \
|
||||
if (x & SP_STATUS_##name) \
|
||||
osSyncPrintf(#name " ")
|
||||
#define printDpStatus(x, name) \
|
||||
if (x & DPC_STATUS_##name) \
|
||||
osSyncPrintf(#name " ")
|
||||
|
||||
void func_800FBCE0()
|
||||
{
|
||||
void func_800FBCE0() {
|
||||
u32 spStatus = __osSpGetStatus();
|
||||
u32 dpStatus = osDpGetStatus();
|
||||
|
||||
@@ -41,10 +44,9 @@ void func_800FBCE0()
|
||||
osSyncPrintf("\n");
|
||||
}
|
||||
|
||||
void func_800FBFD8()
|
||||
{
|
||||
void func_800FBFD8() {
|
||||
func_800FBCE0();
|
||||
osDpSetStatus(DPC_SET_FREEZE | DPC_SET_FLUSH);
|
||||
__osSpSetStatus(SP_SET_HALT | SP_SET_SIG2 | SP_CLR_INTR_BREAK);
|
||||
func_800FBCE0();
|
||||
}
|
||||
}
|
||||
|
||||
+53
-88
@@ -1,52 +1,44 @@
|
||||
#include <global.h>
|
||||
|
||||
typedef void (*arg3_800FC868)(void*);
|
||||
typedef void (*arg3_800FC8D8)(void*,u32);
|
||||
typedef void (*arg3_800FC948)(void*,u32,u32,u32,u32,u32,u32,u32,u32);
|
||||
typedef void (*arg3_800FCA18)(void*,u32);
|
||||
typedef void (*arg3_800FC8D8)(void*, u32);
|
||||
typedef void (*arg3_800FC948)(void*, u32, u32, u32, u32, u32, u32, u32, u32);
|
||||
typedef void (*arg3_800FCA18)(void*, u32);
|
||||
|
||||
typedef struct InitFunc
|
||||
{
|
||||
typedef struct InitFunc {
|
||||
s32 nextOffset;
|
||||
void (*func)(void);
|
||||
} InitFunc;
|
||||
|
||||
//.data
|
||||
void *sInitFuncs = NULL;
|
||||
// .data
|
||||
void* sInitFuncs = NULL;
|
||||
|
||||
char sNew[4] =
|
||||
{
|
||||
'n', 'e', 'w',
|
||||
char sNew[4] = { 'n', 'e', 'w' };
|
||||
|
||||
char D_80134488[0x18] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x00, 0x00,
|
||||
0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
char D_80134488[0x18] =
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x7F, 0x80, 0x00, 0x00, 0xFF, 0x80, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, void *allocatedVRamAddr)
|
||||
{
|
||||
s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd, void* allocatedVRamAddr) {
|
||||
u32 pad;
|
||||
u32 end;
|
||||
u32 bssSize;
|
||||
OverlayRelocationSection *ovl;
|
||||
OverlayRelocationSection* ovl;
|
||||
u32 relocCnt;
|
||||
u32 ovlOffset;
|
||||
u32 size;
|
||||
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
// Start loading dynamic link function
|
||||
osSyncPrintf("\nダイナミックリンクファンクションのロードを開始します\n");
|
||||
}
|
||||
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
size = vRomEnd - vRomStart;
|
||||
//DMA transfer of TEXT, DATA, RODATA + rel (%08x-%08x)
|
||||
osSyncPrintf("TEXT,DATA,RODATA+relをDMA転送します(%08x-%08x)\n", allocatedVRamAddr, (u32)allocatedVRamAddr + size);
|
||||
// DMA transfer of TEXT, DATA, RODATA + rel (%08x-%08x)
|
||||
osSyncPrintf("TEXT,DATA,RODATA+relをDMA転送します(%08x-%08x)\n", allocatedVRamAddr,
|
||||
(u32)allocatedVRamAddr + size);
|
||||
}
|
||||
|
||||
size = vRomEnd - vRomStart;
|
||||
@@ -56,13 +48,12 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
|
||||
ovlOffset = ((s32*)end)[-1];
|
||||
|
||||
ovl = (OverlayRelocationSection*)((u32)end - ovlOffset);
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
osSyncPrintf("TEXT(%08x), DATA(%08x), RODATA(%08x), BSS(%08x)\n", ovl->textSize, ovl->dataSize, ovl->rodataSize, ovl->bssSize);
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
osSyncPrintf("TEXT(%08x), DATA(%08x), RODATA(%08x), BSS(%08x)\n", ovl->textSize, ovl->dataSize, ovl->rodataSize,
|
||||
ovl->bssSize);
|
||||
}
|
||||
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
// Relocate
|
||||
osSyncPrintf("リロケーションします\n");
|
||||
}
|
||||
@@ -70,10 +61,8 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
|
||||
Overlay_DoRelocation(allocatedVRamAddr, ovl, vRamStart);
|
||||
|
||||
bssSize = ovl->bssSize;
|
||||
if(bssSize != 0)
|
||||
{
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
if (bssSize != 0) {
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
// Clear BSS area (% 08x-% 08x)
|
||||
osSyncPrintf("BSS領域をクリアします(%08x-%08x)\n", end, end + ovl->bssSize);
|
||||
}
|
||||
@@ -85,8 +74,7 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
|
||||
}
|
||||
|
||||
size = (u32)&ovl->relocations[ovl->nRelocations] - (u32)ovl;
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
// Clear REL area (%08x-%08x)
|
||||
osSyncPrintf("REL領域をクリアします(%08x-%08x)\n", ovl, (u32)ovl + size);
|
||||
}
|
||||
@@ -97,8 +85,7 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
|
||||
osWritebackDCache(allocatedVRamAddr, size);
|
||||
osInvalICache(allocatedVRamAddr, size);
|
||||
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
// Finish loading dynamic link function
|
||||
osSyncPrintf("ダイナミックリンクファンクションのロードを終了します\n\n");
|
||||
}
|
||||
@@ -106,10 +93,8 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
|
||||
}
|
||||
|
||||
// possibly some kind of new() function
|
||||
void *func_800FC800(u32 size)
|
||||
{
|
||||
if (size == 0)
|
||||
{
|
||||
void* func_800FC800(u32 size) {
|
||||
if (size == 0) {
|
||||
size = 1;
|
||||
}
|
||||
|
||||
@@ -117,106 +102,87 @@ void *func_800FC800(u32 size)
|
||||
}
|
||||
|
||||
// possible some kind of delete() function
|
||||
void func_800FC83C(void *ptr)
|
||||
{
|
||||
if (ptr != NULL)
|
||||
{
|
||||
void func_800FC83C(void* ptr) {
|
||||
if (ptr != NULL) {
|
||||
__osFree(&gSystemArena, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
void func_800FC868(void *blk, u32 nBlk, u32 blkSize, arg3_800FC868 arg3)
|
||||
{
|
||||
void func_800FC868(void* blk, u32 nBlk, u32 blkSize, arg3_800FC868 arg3) {
|
||||
u32 pos;
|
||||
|
||||
for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0))
|
||||
{
|
||||
for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0)) {
|
||||
arg3((void*)pos);
|
||||
}
|
||||
}
|
||||
|
||||
void func_800FC8D8(void *blk, u32 nBlk, s32 blkSize, arg3_800FC8D8 arg3)
|
||||
{
|
||||
void func_800FC8D8(void* blk, u32 nBlk, s32 blkSize, arg3_800FC8D8 arg3) {
|
||||
u32 pos;
|
||||
|
||||
for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0))
|
||||
{
|
||||
for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0)) {
|
||||
arg3((void*)pos, 2);
|
||||
}
|
||||
}
|
||||
|
||||
void *func_800FC948(void *blk, u32 nBlk, u32 blkSize, arg3_800FC948 arg3)
|
||||
{
|
||||
void* func_800FC948(void* blk, u32 nBlk, u32 blkSize, arg3_800FC948 arg3) {
|
||||
u32 pos;
|
||||
if (blk == NULL)
|
||||
{
|
||||
if (blk == NULL) {
|
||||
blk = func_800FC800(nBlk * blkSize);
|
||||
}
|
||||
|
||||
if (blk != NULL && arg3 != NULL)
|
||||
{
|
||||
if (blk != NULL && arg3 != NULL) {
|
||||
pos = (u32)blk;
|
||||
while(pos < (u32)blk + (nBlk * blkSize))
|
||||
{
|
||||
while (pos < (u32)blk + (nBlk * blkSize)) {
|
||||
arg3((void*)pos, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
pos = (u32)pos + (blkSize & ~0);
|
||||
}
|
||||
|
||||
}
|
||||
return blk;
|
||||
}
|
||||
|
||||
void func_800FCA18(void *blk, u32 nBlk, u32 blkSize, arg3_800FCA18 arg3, s32 arg4)
|
||||
{
|
||||
void func_800FCA18(void* blk, u32 nBlk, u32 blkSize, arg3_800FCA18 arg3, s32 arg4) {
|
||||
u32 pos;
|
||||
u32 end ;
|
||||
u32 end;
|
||||
s32 masked_arg2;
|
||||
|
||||
if (blk == 0)
|
||||
{
|
||||
if (blk == 0) {
|
||||
return;
|
||||
}
|
||||
if (arg3 != 0)
|
||||
{
|
||||
if (arg3 != 0) {
|
||||
end = (u32)blk;
|
||||
masked_arg2 = (s32)(blkSize & ~0);
|
||||
pos = (u32)end + (nBlk * blkSize);
|
||||
|
||||
if (masked_arg2) { }
|
||||
if (masked_arg2) {}
|
||||
|
||||
while (pos > end)
|
||||
{
|
||||
while (pos > end) {
|
||||
do {
|
||||
pos -= masked_arg2;
|
||||
arg3((void*)pos, 2);
|
||||
} while (0);
|
||||
}
|
||||
|
||||
if (!masked_arg2){ }
|
||||
if (!masked_arg2) {}
|
||||
}
|
||||
|
||||
if (arg4 != 0)
|
||||
{
|
||||
if (arg4 != 0) {
|
||||
func_800FC83C(blk);
|
||||
}
|
||||
}
|
||||
|
||||
void func_800FCB34(void)
|
||||
{
|
||||
InitFunc *initFunc;
|
||||
void func_800FCB34(void) {
|
||||
InitFunc* initFunc;
|
||||
u32 nextOffset;
|
||||
InitFunc *prev;
|
||||
InitFunc* prev;
|
||||
|
||||
initFunc = (InitFunc*)&sInitFuncs;
|
||||
nextOffset = initFunc->nextOffset;
|
||||
prev = NULL;
|
||||
|
||||
while(nextOffset != 0)
|
||||
{
|
||||
while (nextOffset != 0) {
|
||||
initFunc = (InitFunc*)((s32)initFunc + nextOffset);
|
||||
|
||||
if(initFunc->func != NULL)
|
||||
{
|
||||
if (initFunc->func != NULL) {
|
||||
(*initFunc->func)();
|
||||
}
|
||||
|
||||
@@ -228,8 +194,7 @@ void func_800FCB34(void)
|
||||
sInitFuncs = prev;
|
||||
}
|
||||
|
||||
void SystemHeap_Init(void *start, u32 size)
|
||||
{
|
||||
void SystemHeap_Init(void* start, u32 size) {
|
||||
SystemArena_Init(start, size);
|
||||
func_800FCB34();
|
||||
}
|
||||
}
|
||||
|
||||
+45
-113
@@ -4,65 +4,47 @@
|
||||
|
||||
s32 use_cfrac;
|
||||
|
||||
f32 Math_tanf(f32 x)
|
||||
{
|
||||
f32 Math_tanf(f32 x) {
|
||||
f32 sin = sinf(x);
|
||||
f32 cos = cosf(x);
|
||||
return sin / cos;
|
||||
}
|
||||
|
||||
f32 Math_floorf(f32 x)
|
||||
{
|
||||
f32 Math_floorf(f32 x) {
|
||||
return floorf(x);
|
||||
}
|
||||
|
||||
f32 Math_ceilf(f32 x)
|
||||
{
|
||||
f32 Math_ceilf(f32 x) {
|
||||
return ceilf(x);
|
||||
}
|
||||
|
||||
f32 Math_roundf(f32 x)
|
||||
{
|
||||
f32 Math_roundf(f32 x) {
|
||||
return roundf(x);
|
||||
}
|
||||
|
||||
f32 Math_truncf(f32 x)
|
||||
{
|
||||
f32 Math_truncf(f32 x) {
|
||||
return truncf(x);
|
||||
}
|
||||
|
||||
f32 Math_nearbyintf(f32 x)
|
||||
{
|
||||
f32 Math_nearbyintf(f32 x) {
|
||||
return nearbyintf(x);
|
||||
}
|
||||
|
||||
/* Arctangent approximation using a Taylor series (one quadrant) */
|
||||
f32 Math_atanf_taylor_q(f32 x)
|
||||
{
|
||||
static const f32 coeffs[] =
|
||||
{
|
||||
-1.f / 3,
|
||||
+1.f / 5,
|
||||
-1.f / 7,
|
||||
+1.f / 9,
|
||||
-1.f / 11,
|
||||
+1.f / 13,
|
||||
-1.f / 15,
|
||||
+1.f / 17,
|
||||
0.f,
|
||||
f32 Math_atanf_taylor_q(f32 x) {
|
||||
static const f32 coeffs[] = {
|
||||
-1.f / 3, +1.f / 5, -1.f / 7, +1.f / 9, -1.f / 11, +1.f / 13, -1.f / 15, +1.f / 17, 0.f,
|
||||
};
|
||||
|
||||
f32 poly = x;
|
||||
f32 sq = SQ(x);
|
||||
f32 exp = x * sq;
|
||||
const f32 *c = coeffs;
|
||||
const f32* c = coeffs;
|
||||
f32 term;
|
||||
|
||||
while (1)
|
||||
{
|
||||
while (1) {
|
||||
term = *c++ * exp;
|
||||
if (poly + term == poly)
|
||||
{
|
||||
if (poly + term == poly) {
|
||||
break;
|
||||
}
|
||||
poly = poly + term;
|
||||
@@ -73,157 +55,107 @@ f32 Math_atanf_taylor_q(f32 x)
|
||||
}
|
||||
|
||||
/* Ditto for two quadrants */
|
||||
f32 Math_atanf_taylor(f32 x)
|
||||
{
|
||||
f32 Math_atanf_taylor(f32 x) {
|
||||
f32 t;
|
||||
f32 q;
|
||||
|
||||
if (x > 0.f)
|
||||
{
|
||||
if (x > 0.f) {
|
||||
t = x;
|
||||
}
|
||||
else if (x < 0.f)
|
||||
{
|
||||
} else if (x < 0.f) {
|
||||
t = -x;
|
||||
}
|
||||
else if (x == 0.f)
|
||||
{
|
||||
} else if (x == 0.f) {
|
||||
return 0.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return qNaN0x10000;
|
||||
}
|
||||
|
||||
if (t <= M_SQRT2 - 1.f)
|
||||
{
|
||||
if (t <= M_SQRT2 - 1.f) {
|
||||
return Math_atanf_taylor_q(x);
|
||||
}
|
||||
|
||||
if (t >= M_SQRT2 + 1.f)
|
||||
{
|
||||
if (t >= M_SQRT2 + 1.f) {
|
||||
q = M_PI / 2 - Math_atanf_taylor_q(1.f / t);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
q = M_PI / 4 - Math_atanf_taylor_q((1.f - t) / (1.f + t));
|
||||
}
|
||||
|
||||
if (x > 0.f)
|
||||
{
|
||||
if (x > 0.f) {
|
||||
return q;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return -q;
|
||||
}
|
||||
}
|
||||
|
||||
/* Arctangent approximation using a continued fraction */
|
||||
f32 Math_atanf_cfrac(f32 x)
|
||||
{
|
||||
f32 Math_atanf_cfrac(f32 x) {
|
||||
s32 sector;
|
||||
f32 z;
|
||||
f32 conv;
|
||||
f32 sq;
|
||||
s32 i;
|
||||
|
||||
if (x >= -1.f && x <= 1.f)
|
||||
{
|
||||
if (x >= -1.f && x <= 1.f) {
|
||||
sector = 0;
|
||||
}
|
||||
else if (x > 1.f)
|
||||
{
|
||||
} else if (x > 1.f) {
|
||||
sector = 1;
|
||||
x = 1.f / x;
|
||||
}
|
||||
else if (x < -1.f)
|
||||
{
|
||||
} else if (x < -1.f) {
|
||||
sector = -1;
|
||||
x = 1.f / x;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return qNaN0x10000;
|
||||
}
|
||||
|
||||
sq = SQ(x);
|
||||
conv = 0.f;
|
||||
z = 8.f;
|
||||
for (i = 8; i != 0; i--)
|
||||
{
|
||||
for (i = 8; i != 0; i--) {
|
||||
conv = SQ(z) * sq / (2.f * z + 1.f + conv);
|
||||
z -= 1.f;
|
||||
}
|
||||
conv = x / (1.f + conv);
|
||||
|
||||
if (sector == 0)
|
||||
{
|
||||
if (sector == 0) {
|
||||
return conv;
|
||||
}
|
||||
else if (sector > 0)
|
||||
{
|
||||
} else if (sector > 0) {
|
||||
return M_PI / 2 - conv;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return -M_PI / 2 - conv;
|
||||
}
|
||||
}
|
||||
|
||||
f32 Math_atanf(f32 x)
|
||||
{
|
||||
if (use_cfrac == 0)
|
||||
{
|
||||
f32 Math_atanf(f32 x) {
|
||||
if (use_cfrac == 0) {
|
||||
return Math_atanf_taylor(x);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return Math_atanf_cfrac(x);
|
||||
}
|
||||
}
|
||||
|
||||
f32 Math_atan2f(f32 y, f32 x)
|
||||
{
|
||||
if (x == 0.f)
|
||||
{
|
||||
if (y == 0.f)
|
||||
{
|
||||
f32 Math_atan2f(f32 y, f32 x) {
|
||||
if (x == 0.f) {
|
||||
if (y == 0.f) {
|
||||
return 0.f;
|
||||
}
|
||||
else if (y > 0.f)
|
||||
{
|
||||
} else if (y > 0.f) {
|
||||
return M_PI / 2;
|
||||
}
|
||||
else if (y < 0.f)
|
||||
{
|
||||
} else if (y < 0.f) {
|
||||
return -M_PI / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return qNaN0x10000;
|
||||
}
|
||||
}
|
||||
else if (x >= 0.f)
|
||||
{
|
||||
} else if (x >= 0.f) {
|
||||
return Math_atanf(y / x);
|
||||
}
|
||||
else if (y < 0.f)
|
||||
{
|
||||
} else if (y < 0.f) {
|
||||
return Math_atanf(y / x) - M_PI;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return M_PI - Math_atanf(-(y / x));
|
||||
}
|
||||
}
|
||||
|
||||
f32 Math_asinf(f32 x)
|
||||
{
|
||||
f32 Math_asinf(f32 x) {
|
||||
return Math_atan2f(x, sqrtf(1.f - SQ(x)));
|
||||
}
|
||||
|
||||
f32 Math_acosf(f32 x)
|
||||
{
|
||||
f32 Math_acosf(f32 x) {
|
||||
return M_PI / 2 - Math_asinf(x);
|
||||
}
|
||||
|
||||
@@ -80,4 +80,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_800B958C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_800B9638.s")
|
||||
|
||||
|
||||
+32
-51
@@ -1,131 +1,112 @@
|
||||
#include <global.h>
|
||||
|
||||
#define LOG_SEVERITY_NOLOG 0
|
||||
#define LOG_SEVERITY_ERROR 2
|
||||
#define LOG_SEVERITY_VERBOSE 3
|
||||
#define LOG_SEVERITY_NOLOG 0
|
||||
#define LOG_SEVERITY_ERROR 2
|
||||
#define LOG_SEVERITY_VERBOSE 3
|
||||
|
||||
s32 gDebugArenaLogSeverity = LOG_SEVERITY_ERROR;
|
||||
Arena sDebugArena;
|
||||
|
||||
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action)
|
||||
{
|
||||
if (!ptr)
|
||||
{
|
||||
if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR)
|
||||
{
|
||||
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
|
||||
if (!ptr) {
|
||||
if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) {
|
||||
//"%s: %u bytes %s failed\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action);
|
||||
__osDisplayArena(&sDebugArena);
|
||||
__osDisplayArena(&sDebugArena);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE)
|
||||
{
|
||||
} else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
|
||||
//"%s: %u bytes %s succeeded\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action);
|
||||
}
|
||||
}
|
||||
|
||||
void* DebugArena_Malloc(u32 size)
|
||||
{
|
||||
void* DebugArena_Malloc(u32 size) {
|
||||
void* ptr;
|
||||
ptr = __osMalloc(&sDebugArena, size);
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc", "確保"); //Secure
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* DebugArena_MallocDebug(u32 size, const char* file, s32 line)
|
||||
{
|
||||
void* DebugArena_MallocDebug(u32 size, const char* file, s32 line) {
|
||||
void* ptr;
|
||||
ptr = __osMallocDebug(&sDebugArena, size, file, line);
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_DEBUG", "確保"); //Secure
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_DEBUG", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* DebugArena_MallocR(u32 size)
|
||||
{
|
||||
void* DebugArena_MallocR(u32 size) {
|
||||
void* ptr;
|
||||
ptr = __osMallocR(&sDebugArena, size);
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_r", "確保"); //Secure
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_r", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* DebugArena_MallocRDebug(u32 size, const char* file, s32 line)
|
||||
{
|
||||
void* DebugArena_MallocRDebug(u32 size, const char* file, s32 line) {
|
||||
void* ptr;
|
||||
ptr = __osMallocRDebug(&sDebugArena, size, file, line);
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_r_DEBUG", "確保"); //Secure
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_r_DEBUG", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* DebugArena_Realloc(void* ptr, u32 newSize)
|
||||
{
|
||||
void* DebugArena_Realloc(void* ptr, u32 newSize) {
|
||||
ptr = __osRealloc(&sDebugArena, ptr, newSize);
|
||||
DebugArena_CheckPointer(ptr, newSize, "debug_realloc", "再確保"); // Re-securing
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line)
|
||||
{
|
||||
void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) {
|
||||
ptr = __osReallocDebug(&sDebugArena, ptr, newSize, file, line);
|
||||
DebugArena_CheckPointer(ptr, newSize, "debug_realloc_DEBUG", "再確保"); // Re-securing
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void DebugArena_Free(void* ptr)
|
||||
{
|
||||
void DebugArena_Free(void* ptr) {
|
||||
__osFree(&sDebugArena, ptr);
|
||||
}
|
||||
|
||||
void DebugArena_FreeDebug(void* ptr, const char* file, s32 line)
|
||||
{
|
||||
void DebugArena_FreeDebug(void* ptr, const char* file, s32 line) {
|
||||
__osFreeDebug(&sDebugArena, ptr, file, line);
|
||||
}
|
||||
|
||||
void* DebugArena_Calloc(u32 num, u32 size)
|
||||
{
|
||||
void* DebugArena_Calloc(u32 num, u32 size) {
|
||||
void* ret;
|
||||
u32 n;
|
||||
|
||||
n = num*size;
|
||||
|
||||
n = num * size;
|
||||
ret = __osMalloc(&sDebugArena, n);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
bzero(ret, n);
|
||||
}
|
||||
|
||||
DebugArena_CheckPointer(ret, n, "debug_calloc", "確保");
|
||||
return ret;
|
||||
}
|
||||
|
||||
void DebugArena_Display()
|
||||
{
|
||||
//Zelda heap display (devs forgot to change "Zelda" to "Debug" apparently)
|
||||
void DebugArena_Display() {
|
||||
// Zelda heap display (devs forgot to change "Zelda" to "Debug" apparently)
|
||||
osSyncPrintf("ゼルダヒープ表示\n");
|
||||
__osDisplayArena(&sDebugArena);
|
||||
}
|
||||
|
||||
void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc)
|
||||
{
|
||||
void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) {
|
||||
ArenaImpl_GetSizes(&sDebugArena, outMaxFree, outFree, outAlloc);
|
||||
}
|
||||
|
||||
void DebugArena_Check()
|
||||
{
|
||||
void DebugArena_Check() {
|
||||
__osCheckArena(&sDebugArena);
|
||||
}
|
||||
|
||||
void DebugArena_Init(void* start, u32 size)
|
||||
{
|
||||
void DebugArena_Init(void* start, u32 size) {
|
||||
gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
||||
__osMallocInit(&sDebugArena, start, size);
|
||||
}
|
||||
|
||||
void DebugArena_Cleanup()
|
||||
{
|
||||
void DebugArena_Cleanup() {
|
||||
gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
||||
__osMallocCleanup(&sDebugArena);
|
||||
}
|
||||
|
||||
u8 DebugArena_IsInitalized()
|
||||
{
|
||||
u8 DebugArena_IsInitalized() {
|
||||
return __osMallocIsInitalized(&sDebugArena);
|
||||
}
|
||||
|
||||
+120
-176
@@ -3,9 +3,8 @@
|
||||
#include <alloca.h>
|
||||
#include <vt.h>
|
||||
|
||||
//data
|
||||
const char* sExceptionNames[] =
|
||||
{
|
||||
// data
|
||||
const char* sExceptionNames[] = {
|
||||
"Interrupt",
|
||||
"TLB modification",
|
||||
"TLB exception on load",
|
||||
@@ -32,7 +31,7 @@ const char* sExceptionNames[] =
|
||||
"Inexact operation",
|
||||
};
|
||||
|
||||
//bss
|
||||
// bss
|
||||
FaultThreadStruct* sFaultStructPtr;
|
||||
u8 sFaultIsWaitingForInput;
|
||||
char sFaultStack[0x600];
|
||||
@@ -41,23 +40,22 @@ FaultThreadStruct gFaultStruct;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/pad_800D3F10.s")
|
||||
|
||||
void Fault_SleepImpl(u32 duration)
|
||||
{
|
||||
void Fault_SleepImpl(u32 duration) {
|
||||
u64 value = (duration * OS_CPU_COUNTER) / 1000ull;
|
||||
func_800FF3A0(value);
|
||||
}
|
||||
|
||||
void Fault_ClientProcessThread(FaultClientContext* ctx)
|
||||
{
|
||||
if (ctx->callback)
|
||||
void Fault_ClientProcessThread(FaultClientContext* ctx) {
|
||||
if (ctx->callback) {
|
||||
ctx->ret = ctx->callback(ctx->param0, ctx->param1);
|
||||
}
|
||||
|
||||
if (ctx->queue)
|
||||
if (ctx->queue) {
|
||||
osSendMesg(ctx->queue, ctx->msg, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void Fault_ProcessClientContext(FaultClientContext* ctx)
|
||||
{
|
||||
void Fault_ProcessClientContext(FaultClientContext* ctx) {
|
||||
OSMesgQueue queue;
|
||||
OSMesg msg;
|
||||
OSMesg recMsg;
|
||||
@@ -72,27 +70,23 @@ void Fault_ProcessClientContext(FaultClientContext* ctx)
|
||||
ctx->queue = &queue;
|
||||
ctx->msg = NULL;
|
||||
|
||||
if (sFaultStructPtr->currClientThreadSp != 0)
|
||||
{
|
||||
if (sFaultStructPtr->currClientThreadSp != 0) {
|
||||
thread = alloca(sizeof(OSThread));
|
||||
osCreateThread(thread, 2, Fault_ClientProcessThread, ctx, sFaultStructPtr->currClientThreadSp, 0x7E);
|
||||
osStartThread(thread);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Fault_ClientProcessThread(ctx);
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
while (true) {
|
||||
osSetTimer(&timer, OS_USEC_TO_CYCLES(1000000), 0, &queue, (OSMesg)timerMsgVal);
|
||||
osRecvMesg(&queue, &recMsg, 1);
|
||||
|
||||
if (recMsg != (OSMesg)666)
|
||||
if (recMsg != (OSMesg)666) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!sFaultIsWaitingForInput)
|
||||
{
|
||||
if (!sFaultIsWaitingForInput) {
|
||||
ctx->ret = -1;
|
||||
break;
|
||||
}
|
||||
@@ -100,15 +94,13 @@ void Fault_ProcessClientContext(FaultClientContext* ctx)
|
||||
|
||||
osStopTimer(&timer);
|
||||
|
||||
if (thread != NULL)
|
||||
{
|
||||
if (thread != NULL) {
|
||||
osStopThread(thread);
|
||||
osDestroyThread(thread);
|
||||
}
|
||||
}
|
||||
|
||||
u32 Fault_ProcessClient(u32 callback, u32 param0, u32 param1)
|
||||
{
|
||||
u32 Fault_ProcessClient(u32 callback, u32 param0, u32 param1) {
|
||||
FaultClientContext a;
|
||||
a.callback = callback;
|
||||
a.param0 = param0;
|
||||
@@ -120,8 +112,7 @@ u32 Fault_ProcessClient(u32 callback, u32 param0, u32 param1)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// minor ordering differences
|
||||
void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* param1)
|
||||
{
|
||||
void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* param1) {
|
||||
OSIntMask mask;
|
||||
u32 alreadyExists;
|
||||
FaultClient* iter;
|
||||
@@ -130,10 +121,8 @@ void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* pa
|
||||
mask = osSetIntMask(1);
|
||||
|
||||
iter = sFaultStructPtr->clients;
|
||||
while (iter)
|
||||
{
|
||||
if (iter == client)
|
||||
{
|
||||
while (iter) {
|
||||
if (iter == client) {
|
||||
alreadyExists = true;
|
||||
goto end;
|
||||
}
|
||||
@@ -188,8 +177,9 @@ void Fault_RemoveClient(FaultClient* client) {
|
||||
|
||||
osSetIntMask(mask);
|
||||
|
||||
if (listIsEmpty)
|
||||
if (listIsEmpty) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "fault_RemoveClient: %08x リスト不整合です\n" VT_RST, client);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_AddAddrConvClient.s")
|
||||
@@ -228,24 +218,23 @@ void Fault_RemoveAddrConvClient(FaultAddrConvClient* client) {
|
||||
osSetIntMask(mask);
|
||||
|
||||
if (listIsEmpty) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "fault_AddressConverterRemoveClient: %08x は既にリスト中にある\n" VT_RST, client);
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "fault_AddressConverterRemoveClient: %08x は既にリスト中にある\n" VT_RST,
|
||||
client);
|
||||
}
|
||||
}
|
||||
|
||||
u32 Fault_ConvertAddress(FaultAddrConvClient* client)
|
||||
{
|
||||
u32 Fault_ConvertAddress(FaultAddrConvClient* client) {
|
||||
u32 ret;
|
||||
FaultAddrConvClient* iter = sFaultStructPtr->addrConvClients;
|
||||
|
||||
while(iter)
|
||||
{
|
||||
if (iter->callback)
|
||||
{
|
||||
while (iter) {
|
||||
if (iter->callback) {
|
||||
ret = Fault_ProcessClient(iter->callback, client, iter->param);
|
||||
if (ret == -1)
|
||||
if (ret == -1) {
|
||||
Fault_RemoveAddrConvClient(iter);
|
||||
else if (ret)
|
||||
} else if (ret) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
iter = iter->next;
|
||||
}
|
||||
@@ -253,35 +242,29 @@ u32 Fault_ConvertAddress(FaultAddrConvClient* client)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Fault_Sleep(u32 duration)
|
||||
{
|
||||
void Fault_Sleep(u32 duration) {
|
||||
Fault_SleepImpl(duration);
|
||||
}
|
||||
|
||||
void Fault_PadCallback(Input* input)
|
||||
{
|
||||
//BUG: this function is not called correctly and thus will crash from reading a bad pointer at 0x800C7E4C
|
||||
void Fault_PadCallback(Input* input) {
|
||||
// BUG: this function is not called correctly and thus will crash from reading a bad pointer at 0x800C7E4C
|
||||
func_800C7E08(input, 0);
|
||||
}
|
||||
|
||||
void Fault_UpdatePadImpl()
|
||||
{
|
||||
void Fault_UpdatePadImpl() {
|
||||
sFaultStructPtr->padCallback(&sFaultStructPtr->padInput);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// ordering differences and possibly regalloc
|
||||
u32 Fault_WaitForInputImpl()
|
||||
{
|
||||
u32 Fault_WaitForInputImpl() {
|
||||
u16 kDown;
|
||||
u32 exitDebugger;
|
||||
s32 count = 600;
|
||||
Input* curInput = &sFaultStructPtr->padInput;
|
||||
|
||||
while (true)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
while (true) {
|
||||
while (true) {
|
||||
Fault_Sleep(0x10);
|
||||
Fault_UpdatePadImpl();
|
||||
|
||||
@@ -316,71 +299,63 @@ u32 Fault_WaitForInputImpl()
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_WaitForInputImpl.s")
|
||||
#endif
|
||||
|
||||
void Fault_WaitForInput()
|
||||
{
|
||||
void Fault_WaitForInput() {
|
||||
sFaultIsWaitingForInput = 1;
|
||||
Fault_WaitForInputImpl();
|
||||
sFaultIsWaitingForInput = 0;
|
||||
}
|
||||
|
||||
void Fault_DrawRec(s32 x, s32 y, s32 w, s32 h, u16 color)
|
||||
{
|
||||
void Fault_DrawRec(s32 x, s32 y, s32 w, s32 h, u16 color) {
|
||||
FaultDrawer_DrawRecImpl(x, y, x + w - 1, y + h - 1, color);
|
||||
}
|
||||
|
||||
void Fault_FillScreenBlack()
|
||||
{
|
||||
void Fault_FillScreenBlack() {
|
||||
FaultDrawer_SetForeColor(0xFFFF);
|
||||
FaultDrawer_SetBackColor(1);
|
||||
FaultDrawer_FillScreen();
|
||||
FaultDrawer_SetBackColor(0);
|
||||
}
|
||||
|
||||
void Fault_FillScreenRed()
|
||||
{
|
||||
void Fault_FillScreenRed() {
|
||||
FaultDrawer_SetForeColor(0xFFFF);
|
||||
FaultDrawer_SetBackColor(0xF001);
|
||||
FaultDrawer_FillScreen();
|
||||
FaultDrawer_SetBackColor(0);
|
||||
}
|
||||
|
||||
void Fault_DrawCornerRec(u16 color)
|
||||
{
|
||||
void Fault_DrawCornerRec(u16 color) {
|
||||
Fault_DrawRec(0x16, 0x10, 8, 1, color);
|
||||
}
|
||||
|
||||
void Fault_PrintFReg(s32 idx, f32* value)
|
||||
{
|
||||
void Fault_PrintFReg(s32 idx, f32* value) {
|
||||
u32 raw = *(u32*)value;
|
||||
s32 v0 = ((raw & 0x7f800000) >> 0x17) - 0x7f;
|
||||
|
||||
if ((v0 >= -0x7e && v0 < 0x80) || raw == 0)
|
||||
if ((v0 >= -0x7e && v0 < 0x80) || raw == 0) {
|
||||
FaultDrawer_Printf("F%02d:%14.7e ", idx, *value);
|
||||
else
|
||||
} else {
|
||||
FaultDrawer_Printf("F%02d: %08x(16) ", idx, raw);
|
||||
}
|
||||
}
|
||||
|
||||
void Fault_LogFReg(s32 idx, f32* value)
|
||||
{
|
||||
void Fault_LogFReg(s32 idx, f32* value) {
|
||||
u32 raw = *(u32*)value;
|
||||
s32 v0 = ((raw & 0x7f800000) >> 0x17) - 0x7f;
|
||||
|
||||
if ((v0 >= -0x7e && v0 < 0x80) || raw == 0)
|
||||
if ((v0 >= -0x7e && v0 < 0x80) || raw == 0) {
|
||||
osSyncPrintf("F%02d:%14.7e ", idx, *value);
|
||||
else
|
||||
} else {
|
||||
osSyncPrintf("F%02d: %08x(16) ", idx, *(u32*)value);
|
||||
}
|
||||
}
|
||||
|
||||
void Fault_PrintFPCR(u32 value)
|
||||
{
|
||||
void Fault_PrintFPCR(u32 value) {
|
||||
s32 i;
|
||||
u32 flag = 0x20000;
|
||||
FaultDrawer_Printf("FPCSR:%08xH ", value);
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
if (value & flag)
|
||||
{
|
||||
FaultDrawer_Printf("(%s)", sExceptionNames[i+18]);
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (value & flag) {
|
||||
FaultDrawer_Printf("(%s)", sExceptionNames[i + 18]);
|
||||
break;
|
||||
}
|
||||
flag >>= 1;
|
||||
@@ -388,30 +363,28 @@ void Fault_PrintFPCR(u32 value)
|
||||
FaultDrawer_Printf("\n");
|
||||
}
|
||||
|
||||
void Fault_LogFPCR(u32 value)
|
||||
{
|
||||
void Fault_LogFPCR(u32 value) {
|
||||
s32 i;
|
||||
u32 flag = 0x20000;
|
||||
osSyncPrintf("FPCSR:%08xH ", value);
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
if (value & flag)
|
||||
{
|
||||
osSyncPrintf("(%s)\n", sExceptionNames[i+18]);
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (value & flag) {
|
||||
osSyncPrintf("(%s)\n", sExceptionNames[i + 18]);
|
||||
break;
|
||||
}
|
||||
flag >>= 1;
|
||||
}
|
||||
}
|
||||
|
||||
void Fault_PrintThreadContext(OSThread* t)
|
||||
{
|
||||
__OSThreadContext *ctx;
|
||||
s32 causeStrIdx = (s32) ((((u32) t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10;
|
||||
if (causeStrIdx == 0x17)
|
||||
void Fault_PrintThreadContext(OSThread* t) {
|
||||
__OSThreadContext* ctx;
|
||||
s32 causeStrIdx = (s32)((((u32)t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10;
|
||||
if (causeStrIdx == 0x17) {
|
||||
causeStrIdx = 0x10;
|
||||
if (causeStrIdx == 0x1f)
|
||||
}
|
||||
if (causeStrIdx == 0x1f) {
|
||||
causeStrIdx = 0x11;
|
||||
}
|
||||
|
||||
FaultDrawer_FillScreen();
|
||||
FaultDrawer_SetCharPad(-2, 4);
|
||||
@@ -462,14 +435,15 @@ void Fault_PrintThreadContext(OSThread* t)
|
||||
FaultDrawer_SetCharPad(0, 0);
|
||||
}
|
||||
|
||||
void Fault_LogThreadContext(OSThread* t)
|
||||
{
|
||||
__OSThreadContext *ctx;
|
||||
s32 causeStrIdx = (s32) ((((u32) t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10;
|
||||
if (causeStrIdx == 0x17)
|
||||
void Fault_LogThreadContext(OSThread* t) {
|
||||
__OSThreadContext* ctx;
|
||||
s32 causeStrIdx = (s32)((((u32)t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10;
|
||||
if (causeStrIdx == 0x17) {
|
||||
causeStrIdx = 0x10;
|
||||
if (causeStrIdx == 0x1f)
|
||||
}
|
||||
if (causeStrIdx == 0x1f) {
|
||||
causeStrIdx = 0x11;
|
||||
}
|
||||
|
||||
ctx = &t->context;
|
||||
osSyncPrintf("\n");
|
||||
@@ -515,26 +489,23 @@ void Fault_LogThreadContext(OSThread* t)
|
||||
osSyncPrintf("\n");
|
||||
}
|
||||
|
||||
OSThread* Fault_FindFaultedThread()
|
||||
{
|
||||
OSThread* Fault_FindFaultedThread() {
|
||||
OSThread* iter = func_80104140();
|
||||
while (iter->priority != -1)
|
||||
{
|
||||
if (iter->priority > 0 && iter->priority < 0x7f && (iter->flags & 3))
|
||||
while (iter->priority != -1) {
|
||||
if (iter->priority > 0 && iter->priority < 0x7f && (iter->flags & 3)) {
|
||||
return iter;
|
||||
}
|
||||
iter = iter->tlnext;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Fault_Wait5Seconds(void)
|
||||
{
|
||||
OSTime start[2]; //to make the function allocate 0x28 bytes of stack instead of 0x20
|
||||
void Fault_Wait5Seconds(void) {
|
||||
OSTime start[2]; // to make the function allocate 0x28 bytes of stack instead of 0x20
|
||||
start[0] = osGetTime();
|
||||
do
|
||||
{
|
||||
do {
|
||||
Fault_Sleep(0x10);
|
||||
} while ((osGetTime() - start[0]) < OS_USEC_TO_CYCLES(5000000)+1); //0xdf84759
|
||||
} while ((osGetTime() - start[0]) < OS_USEC_TO_CYCLES(5000000) + 1); // 0xdf84759
|
||||
|
||||
sFaultStructPtr->faultActive = true;
|
||||
}
|
||||
@@ -561,7 +532,7 @@ void Fault_DrawMemDumpPage(const char* title, u32* addr, u32 param_3) {
|
||||
Fault_FillScreenBlack();
|
||||
FaultDrawer_SetCharPad(-2, 0);
|
||||
|
||||
FaultDrawer_DrawText(0x24, 0x12, "%s %08x", title? title : "PrintDump", alignedAddr);
|
||||
FaultDrawer_DrawText(0x24, 0x12, "%s %08x", title ? title : "PrintDump", alignedAddr);
|
||||
if (alignedAddr >= (u32*)0x80000000 && alignedAddr < (u32*)0xC0000000) {
|
||||
for (y = 0x1C; y != 0xE2; y += 9) {
|
||||
FaultDrawer_DrawText(0x18, y, "%06x", writeAddr);
|
||||
@@ -577,15 +548,13 @@ void Fault_DrawMemDumpPage(const char* title, u32* addr, u32 param_3) {
|
||||
#ifdef NON_MATCHING
|
||||
// saved register and stack usage differences
|
||||
// possibly some minor ordering and regalloc differences
|
||||
void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1)
|
||||
{
|
||||
void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) {
|
||||
Input* curInput = &sFaultStructPtr->padInput;
|
||||
u32 addr = pc;
|
||||
s32 count;
|
||||
s32 off;
|
||||
|
||||
while (true)
|
||||
{
|
||||
while (true) {
|
||||
if (addr < 0x80000000)
|
||||
addr = 0x80000000;
|
||||
if (addr > 0x807fff00)
|
||||
@@ -595,8 +564,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1)
|
||||
Fault_DrawMemDumpPage("Dump", (u32*)addr, 0);
|
||||
count = 600;
|
||||
|
||||
while (sFaultStructPtr->faultActive)
|
||||
{
|
||||
while (sFaultStructPtr->faultActive) {
|
||||
if (count == 0)
|
||||
return;
|
||||
|
||||
@@ -607,8 +575,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1)
|
||||
sFaultStructPtr->faultActive = false;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
do {
|
||||
Fault_Sleep(0x10);
|
||||
Fault_UpdatePadImpl();
|
||||
} while (curInput->padPressed == 0);
|
||||
@@ -652,8 +619,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_LogStackTrace.s")
|
||||
|
||||
void Fault_ResumeThread(OSThread* t)
|
||||
{
|
||||
void Fault_ResumeThread(OSThread* t) {
|
||||
t->context.cause = 0;
|
||||
t->context.fpcsr = 0;
|
||||
t->context.pc += 4;
|
||||
@@ -663,39 +629,39 @@ void Fault_ResumeThread(OSThread* t)
|
||||
osStartThread(t);
|
||||
}
|
||||
|
||||
void Fault_CommitFB()
|
||||
{
|
||||
void Fault_CommitFB() {
|
||||
u16* fb;
|
||||
osViSetYScale(1.0f);
|
||||
osViSetMode(&osViModeNtscLan1);
|
||||
osViSetSpecialFeatures(0x42); //gama_disable|dither_fliter_enable_aa_mode3_disable
|
||||
osViSetSpecialFeatures(0x42); // gama_disable|dither_fliter_enable_aa_mode3_disable
|
||||
osViBlack(false);
|
||||
|
||||
if (sFaultStructPtr->fb)
|
||||
if (sFaultStructPtr->fb) {
|
||||
fb = sFaultStructPtr->fb;
|
||||
else
|
||||
{
|
||||
} else {
|
||||
fb = (u16*)osViGetNextFramebuffer();
|
||||
if ((u32)fb == 0x80000000)
|
||||
if ((u32)fb == 0x80000000) {
|
||||
fb = (u16*)((osMemSize | 0x80000000) - 0x25800);
|
||||
}
|
||||
}
|
||||
|
||||
osViSwapBuffer(fb);
|
||||
FaultDrawer_SetDrawerFB(fb, 0x140, 0xf0);
|
||||
}
|
||||
|
||||
void Fault_ProcessClients(void)
|
||||
{
|
||||
void Fault_ProcessClients(void) {
|
||||
FaultClient* iter = sFaultStructPtr->clients;
|
||||
s32 idx = 0;
|
||||
|
||||
while(iter)
|
||||
{
|
||||
if (iter->callback)
|
||||
{
|
||||
while (iter) {
|
||||
if (iter->callback) {
|
||||
Fault_FillScreenBlack();
|
||||
FaultDrawer_SetCharPad(-2, 0);
|
||||
FaultDrawer_Printf("\x1a""8CallBack (%d) %08x %08x %08x\n""\x1a""7", idx++, iter, iter->param1, iter->param2);
|
||||
FaultDrawer_Printf("\x1a"
|
||||
"8CallBack (%d) %08x %08x %08x\n"
|
||||
"\x1a"
|
||||
"7",
|
||||
idx++, iter, iter->param1, iter->param2);
|
||||
FaultDrawer_SetCharPad(0, 0);
|
||||
Fault_ProcessClient(iter->callback, iter->param1, iter->param2);
|
||||
Fault_WaitForInput();
|
||||
@@ -705,45 +671,34 @@ void Fault_ProcessClients(void)
|
||||
}
|
||||
}
|
||||
|
||||
void Fault_UpdatePad()
|
||||
{
|
||||
void Fault_UpdatePad() {
|
||||
Fault_UpdatePadImpl();
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// saved register and stack usage differences
|
||||
void Fault_ThreadEntry(void* arg)
|
||||
{
|
||||
void Fault_ThreadEntry(void* arg) {
|
||||
OSThread* faultedThread;
|
||||
OSMesg msg;
|
||||
|
||||
osSetEventMesg(OS_EVENT_CPU_BREAK, &sFaultStructPtr->queue, 1);
|
||||
osSetEventMesg(OS_EVENT_FAULT, &sFaultStructPtr->queue, 2);
|
||||
|
||||
while (true)
|
||||
{
|
||||
do
|
||||
{
|
||||
while (true) {
|
||||
do {
|
||||
osRecvMesg(&sFaultStructPtr->queue, &msg, 1);
|
||||
|
||||
if (msg == (OSMesg)1)
|
||||
{
|
||||
if (msg == (OSMesg)1) {
|
||||
sFaultStructPtr->msgId = 1;
|
||||
osSyncPrintf("フォルトマネージャ:OS_EVENT_CPU_BREAKを受信しました\n");
|
||||
}
|
||||
else if (1 && msg == (OSMesg)2)
|
||||
{
|
||||
} else if (1 && msg == (OSMesg)2) {
|
||||
sFaultStructPtr->msgId = 2;
|
||||
osSyncPrintf("フォルトマネージャ:OS_EVENT_FAULTを受信しました\n");
|
||||
}
|
||||
else if (msg == (OSMesg)3)
|
||||
{
|
||||
} else if (msg == (OSMesg)3) {
|
||||
Fault_UpdatePad();
|
||||
faultedThread = NULL;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sFaultStructPtr->msgId = 3;
|
||||
osSyncPrintf("フォルトマネージャ:不明なメッセージを受信しました\n");
|
||||
}
|
||||
@@ -751,8 +706,7 @@ void Fault_ThreadEntry(void* arg)
|
||||
faultedThread = __osGetCurrFaultedThread();
|
||||
osSyncPrintf("__osGetCurrFaultedThread()=%08x\n", faultedThread);
|
||||
|
||||
if (faultedThread == NULL)
|
||||
{
|
||||
if (faultedThread == NULL) {
|
||||
faultedThread = Fault_FindFaultedThread();
|
||||
osSyncPrintf("FindFaultedThread()=%08x\n", faultedThread);
|
||||
}
|
||||
@@ -769,8 +723,7 @@ void Fault_ThreadEntry(void* arg)
|
||||
|
||||
if (sFaultStructPtr->faultActive)
|
||||
Fault_Wait5Seconds();
|
||||
else
|
||||
{
|
||||
else {
|
||||
Fault_DrawCornerRec(0xF801);
|
||||
Fault_WaitForButtonCombo();
|
||||
}
|
||||
@@ -779,8 +732,7 @@ void Fault_ThreadEntry(void* arg)
|
||||
FaultDrawer_SetForeColor(0xFFFF);
|
||||
FaultDrawer_SetBackColor(0);
|
||||
|
||||
do
|
||||
{
|
||||
do {
|
||||
Fault_PrintThreadContext(faultedThread);
|
||||
Fault_LogThreadContext(faultedThread);
|
||||
Fault_WaitForInput();
|
||||
@@ -799,10 +751,7 @@ void Fault_ThreadEntry(void* arg)
|
||||
Fault_WaitForInput();
|
||||
} while (!sFaultStructPtr->exitDebugger);
|
||||
|
||||
while (!sFaultStructPtr->exitDebugger)
|
||||
{
|
||||
|
||||
}
|
||||
while (!sFaultStructPtr->exitDebugger) {}
|
||||
|
||||
Fault_ResumeThread(faultedThread);
|
||||
}
|
||||
@@ -811,14 +760,12 @@ void Fault_ThreadEntry(void* arg)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_ThreadEntry.s")
|
||||
#endif
|
||||
|
||||
void Fault_SetFB(void* fb, u16 w, u16 h)
|
||||
{
|
||||
void Fault_SetFB(void* fb, u16 w, u16 h) {
|
||||
sFaultStructPtr->fb = fb;
|
||||
FaultDrawer_SetDrawerFB(fb, w, h);
|
||||
}
|
||||
|
||||
void Fault_Start(void)
|
||||
{
|
||||
void Fault_Start(void) {
|
||||
sFaultStructPtr = &gFaultStruct;
|
||||
bzero(sFaultStructPtr, sizeof(FaultThreadStruct));
|
||||
FaultDrawer_SetDefault();
|
||||
@@ -832,13 +779,12 @@ void Fault_Start(void)
|
||||
sFaultStructPtr->faultActive = false;
|
||||
gFaultStruct.faultHandlerEnabled = true;
|
||||
osCreateMesgQueue(&sFaultStructPtr->queue, &sFaultStructPtr->msg, 1);
|
||||
StackCheck_Init(sFaultThreadInfo, &sFaultStack, sFaultStack+sizeof(sFaultStack), 0, 0x100, "fault");
|
||||
StackCheck_Init(sFaultThreadInfo, &sFaultStack, sFaultStack + sizeof(sFaultStack), 0, 0x100, "fault");
|
||||
osCreateThread(&sFaultStructPtr->thread, 2, &Fault_ThreadEntry, 0, sFaultThreadInfo, 0x7f);
|
||||
osStartThread(&sFaultStructPtr->thread);
|
||||
}
|
||||
|
||||
void Fault_HangupFaultClient(const char* arg0, const char* arg1)
|
||||
{
|
||||
void Fault_HangupFaultClient(const char* arg0, const char* arg1) {
|
||||
osSyncPrintf("HungUp on Thread %d\n", osGetThreadId(0));
|
||||
osSyncPrintf("%s\n", arg0 ? arg0 : "(NULL)");
|
||||
osSyncPrintf("%s\n", arg1 ? arg1 : "(NULL)");
|
||||
@@ -847,16 +793,14 @@ void Fault_HangupFaultClient(const char* arg0, const char* arg1)
|
||||
FaultDrawer_Printf("%s\n", arg1 ? arg1 : "(NULL)");
|
||||
}
|
||||
|
||||
void Fault_AddHungupAndCrashImpl(const char* arg0, const char* arg1)
|
||||
{
|
||||
void Fault_AddHungupAndCrashImpl(const char* arg0, const char* arg1) {
|
||||
FaultClient client;
|
||||
char padd[4];
|
||||
Fault_AddClient(&client, &Fault_HangupFaultClient, arg0, arg1);
|
||||
*(u32*)0x11111111 = 0; //trigger an exception
|
||||
*(u32*)0x11111111 = 0; // trigger an exception
|
||||
}
|
||||
|
||||
void Fault_AddHungupAndCrash(const char* filename, u32 line)
|
||||
{
|
||||
void Fault_AddHungupAndCrash(const char* filename, u32 line) {
|
||||
char msg[256];
|
||||
sprintf(msg, "HungUp %s:%d", filename, line);
|
||||
Fault_AddHungupAndCrashImpl(msg, NULL);
|
||||
|
||||
+102
-124
@@ -2,77 +2,72 @@
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
//rodata
|
||||
// rodata
|
||||
const u32 sFaultDrawerFont[] = {
|
||||
0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700,
|
||||
0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000,
|
||||
0x08BFFB00, 0x0EFFFFC0, 0x0BF00FB0, 0x0FF00330, 0x0FF00FF0, 0x0FF00220, 0x0CFBBF60, 0x0FFCCE20,
|
||||
0x0DD44FF0, 0x0FF00220, 0x0FF00FF0, 0x0FF00330, 0x0CFBBF40, 0x0EF77740, 0x00000000, 0x00000000,
|
||||
0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700,
|
||||
0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000,
|
||||
0x08BFFB00, 0x000DE000, 0x0BF00FB0, 0x005DE600, 0x0FF00FF0, 0x055CC660, 0x0CFBBF60, 0x773FF377,
|
||||
0x0DD44FF0, 0xBB3FF3BB, 0x0FF00FF0, 0x099CCAA0, 0x0CFBBF40, 0x009DEA00, 0x00000000, 0x000DE000,
|
||||
0x04C22C40, 0x028D5020, 0x0CCAACC0, 0x21F91710, 0x04C22C40, 0x12493400, 0x00820800, 0x01975110,
|
||||
0x088A8880, 0x04615241, 0x00800800, 0x43117530, 0x00A20800, 0x60055600, 0x00000000, 0x04400040,
|
||||
0x00221100, 0x00000080, 0x000FB000, 0x00000880, 0x040DA400, 0x00008800, 0x08CDE880, 0x022AA220,
|
||||
0x08CDE880, 0x02AA2220, 0x040DA400, 0x0CD10000, 0x000FB000, 0x8C510000, 0x00221100, 0x81100000,
|
||||
0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700,
|
||||
0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000,
|
||||
0x00333300, 0x04489980, 0x033CC330, 0x00CD1088, 0x033CC330, 0x02BF62A8, 0x00333320, 0x01104C80,
|
||||
0x01100330, 0x0015C800, 0x033CC330, 0x02673220, 0x003FF300, 0x04409900, 0x00880000, 0x00000000,
|
||||
0x05DFFD10, 0x07FFFF60, 0x1CE00EC1, 0x0FF00990, 0x1EE11661, 0x0FF00110, 0x1EF45621, 0x0FF66710,
|
||||
0x1EF23661, 0x0FF08990, 0x1EF10FE1, 0x0FF00990, 0x16ECCE21, 0x07FBBB20, 0x01111110, 0x00000000,
|
||||
0x09B66FD0, 0x27D88E60, 0x0992ED10, 0x2FF02EE0, 0x099AE510, 0x2FF62EE0, 0x099B7510, 0x2FD64EE0,
|
||||
0x0DDAE510, 0x2FD04EE0, 0x0DD2ED10, 0x2FD00EE0, 0x09F66F90, 0x27D99F70, 0x00000000, 0x00000000,
|
||||
0x07FFFF00, 0x8F711FF0, 0x2FD00FF0, 0x8F711FF0, 0x2FD00770, 0x8E611EE0, 0x27DDDF60, 0x8E691EE0,
|
||||
0x27764AA0, 0x8EE99EE0, 0x2FD06E80, 0x8AE7FEA0, 0x07FA8E60, 0x88277A80, 0x00000000, 0x00000000,
|
||||
0x077CCFF0, 0x13266011, 0x077CCFF0, 0x03766510, 0x0239D720, 0x04533540, 0x002FF200, 0x01133110,
|
||||
0x005FB100, 0x00033000, 0x055EE550, 0x01133110, 0x055EEDD0, 0x02233000, 0x00088880, 0x8AABB888,
|
||||
0x00001100, 0x00044510, 0x04623320, 0x00440110, 0x04C89AA0, 0x00EEAB10, 0x0CE66720, 0x0EF55FB0,
|
||||
0x0EE00660, 0x0BF62B90, 0x0EE00660, 0x03FC8990, 0x04EEEEA0, 0x00773BB0, 0x00000000, 0x08888800,
|
||||
0x09900000, 0x00111000, 0x09922440, 0x00011000, 0x09908800, 0x26EFDE20, 0x099BB540, 0x2EC33CE2,
|
||||
0x0D9A2550, 0x2EC33CE2, 0x0DDAA550, 0x2EC33CE2, 0x09D6ED10, 0x26CBBC62, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00011000, 0x05FBFFE0, 0x8E6116E8, 0x0FF40330, 0x8F7117F8,
|
||||
0x07FC8B30, 0x8E6996E8, 0x05733BA0, 0x8A6DD6A8, 0x0DD88A20, 0x08A779B2, 0x01100220, 0x00000000,
|
||||
0x00000080, 0x8A011000, 0x00000800, 0x80A11000, 0x07744F70, 0x80A99000, 0x0231DF20, 0x84E60004,
|
||||
0x0027DA20, 0xC8AA4C40, 0x00573B20, 0x00A11800, 0x05546F50, 0x00A99800, 0x02222080, 0x02001888,
|
||||
0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990,
|
||||
0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000, 0x08BFFB00, 0x0EFFFFC0,
|
||||
0x0BF00FB0, 0x0FF00330, 0x0FF00FF0, 0x0FF00220, 0x0CFBBF60, 0x0FFCCE20, 0x0DD44FF0, 0x0FF00220, 0x0FF00FF0,
|
||||
0x0FF00330, 0x0CFBBF40, 0x0EF77740, 0x00000000, 0x00000000, 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0,
|
||||
0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40,
|
||||
0x026EF700, 0x00000000, 0x00000000, 0x08BFFB00, 0x000DE000, 0x0BF00FB0, 0x005DE600, 0x0FF00FF0, 0x055CC660,
|
||||
0x0CFBBF60, 0x773FF377, 0x0DD44FF0, 0xBB3FF3BB, 0x0FF00FF0, 0x099CCAA0, 0x0CFBBF40, 0x009DEA00, 0x00000000,
|
||||
0x000DE000, 0x04C22C40, 0x028D5020, 0x0CCAACC0, 0x21F91710, 0x04C22C40, 0x12493400, 0x00820800, 0x01975110,
|
||||
0x088A8880, 0x04615241, 0x00800800, 0x43117530, 0x00A20800, 0x60055600, 0x00000000, 0x04400040, 0x00221100,
|
||||
0x00000080, 0x000FB000, 0x00000880, 0x040DA400, 0x00008800, 0x08CDE880, 0x022AA220, 0x08CDE880, 0x02AA2220,
|
||||
0x040DA400, 0x0CD10000, 0x000FB000, 0x8C510000, 0x00221100, 0x81100000, 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0,
|
||||
0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990, 0x05589760, 0x0DD22990, 0x05599770,
|
||||
0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000, 0x00333300, 0x04489980, 0x033CC330, 0x00CD1088, 0x033CC330,
|
||||
0x02BF62A8, 0x00333320, 0x01104C80, 0x01100330, 0x0015C800, 0x033CC330, 0x02673220, 0x003FF300, 0x04409900,
|
||||
0x00880000, 0x00000000, 0x05DFFD10, 0x07FFFF60, 0x1CE00EC1, 0x0FF00990, 0x1EE11661, 0x0FF00110, 0x1EF45621,
|
||||
0x0FF66710, 0x1EF23661, 0x0FF08990, 0x1EF10FE1, 0x0FF00990, 0x16ECCE21, 0x07FBBB20, 0x01111110, 0x00000000,
|
||||
0x09B66FD0, 0x27D88E60, 0x0992ED10, 0x2FF02EE0, 0x099AE510, 0x2FF62EE0, 0x099B7510, 0x2FD64EE0, 0x0DDAE510,
|
||||
0x2FD04EE0, 0x0DD2ED10, 0x2FD00EE0, 0x09F66F90, 0x27D99F70, 0x00000000, 0x00000000, 0x07FFFF00, 0x8F711FF0,
|
||||
0x2FD00FF0, 0x8F711FF0, 0x2FD00770, 0x8E611EE0, 0x27DDDF60, 0x8E691EE0, 0x27764AA0, 0x8EE99EE0, 0x2FD06E80,
|
||||
0x8AE7FEA0, 0x07FA8E60, 0x88277A80, 0x00000000, 0x00000000, 0x077CCFF0, 0x13266011, 0x077CCFF0, 0x03766510,
|
||||
0x0239D720, 0x04533540, 0x002FF200, 0x01133110, 0x005FB100, 0x00033000, 0x055EE550, 0x01133110, 0x055EEDD0,
|
||||
0x02233000, 0x00088880, 0x8AABB888, 0x00001100, 0x00044510, 0x04623320, 0x00440110, 0x04C89AA0, 0x00EEAB10,
|
||||
0x0CE66720, 0x0EF55FB0, 0x0EE00660, 0x0BF62B90, 0x0EE00660, 0x03FC8990, 0x04EEEEA0, 0x00773BB0, 0x00000000,
|
||||
0x08888800, 0x09900000, 0x00111000, 0x09922440, 0x00011000, 0x09908800, 0x26EFDE20, 0x099BB540, 0x2EC33CE2,
|
||||
0x0D9A2550, 0x2EC33CE2, 0x0DDAA550, 0x2EC33CE2, 0x09D6ED10, 0x26CBBC62, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00011000, 0x05FBFFE0, 0x8E6116E8, 0x0FF40330, 0x8F7117F8, 0x07FC8B30, 0x8E6996E8,
|
||||
0x05733BA0, 0x8A6DD6A8, 0x0DD88A20, 0x08A779B2, 0x01100220, 0x00000000, 0x00000080, 0x8A011000, 0x00000800,
|
||||
0x80A11000, 0x07744F70, 0x80A99000, 0x0231DF20, 0x84E60004, 0x0027DA20, 0xC8AA4C40, 0x00573B20, 0x00A11800,
|
||||
0x05546F50, 0x00A99800, 0x02222080, 0x02001888,
|
||||
};
|
||||
|
||||
//data
|
||||
FaultDrawer sFaultDrawerDefault =
|
||||
{
|
||||
(u16*)0x803DA800, //fb
|
||||
320, 240, //w, h
|
||||
16, 223, //yStart, yEnd
|
||||
22, 297,//xStart, xEnd
|
||||
0xFFFF, 0x0000, //foreColor, backColor
|
||||
22, 16, //cursorX, cursorY
|
||||
sFaultDrawerFont, //font
|
||||
// data
|
||||
// clang-format off
|
||||
FaultDrawer sFaultDrawerDefault = {
|
||||
(u16*)0x803DA800, // fb
|
||||
320, 240, // w, h
|
||||
16, 223, // yStart, yEnd
|
||||
22, 297, // xStart, xEnd
|
||||
0xFFFF, 0x0000, // foreColor, backColor
|
||||
22, 16, // cursorX, cursorY
|
||||
sFaultDrawerFont, // font
|
||||
8, 8, 0, 0,
|
||||
{ //printColors
|
||||
{ // printColors
|
||||
0x0001, 0xF801, 0x07C1, 0xFFC1,
|
||||
0x003F, 0xF83F, 0x07FF, 0xFFFF,
|
||||
0x7BDF, 0xB5AD
|
||||
},
|
||||
0, //escCode
|
||||
0, //osSyncPrintfEnabled
|
||||
NULL, //inputCallback
|
||||
0, // escCode
|
||||
0, // osSyncPrintfEnabled
|
||||
NULL, // inputCallback
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
//bss
|
||||
// bss
|
||||
FaultDrawer sFaultDrawerStruct;
|
||||
char D_8016B6C0[0x20]; //? unused
|
||||
|
||||
void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled)
|
||||
{
|
||||
void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) {
|
||||
sFaultDrawerStruct.osSyncPrintfEnabled = enabled;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void FaultDrawer_DrawRecImpl(s32 xstart, s32 ystart, s32 xend, s32 yend, u16 color)
|
||||
{
|
||||
if (sFaultDrawerStruct.w - xstart > 0 && sFaultDrawerStruct.h - ystart > 0)
|
||||
{
|
||||
void FaultDrawer_DrawRecImpl(s32 xstart, s32 ystart, s32 xend, s32 yend, u16 color) {
|
||||
if (sFaultDrawerStruct.w - xstart > 0 && sFaultDrawerStruct.h - ystart > 0) {
|
||||
s32 x, y;
|
||||
|
||||
for (y = 0; y <= yend - ystart; y++)
|
||||
@@ -88,8 +83,7 @@ void FaultDrawer_DrawRecImpl(s32 xstart, s32 ystart, s32 xend, s32 yend, u16 col
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc and minor ordering differences
|
||||
void FaultDrawer_DrawChar(char c)
|
||||
{
|
||||
void FaultDrawer_DrawChar(char c) {
|
||||
s32 x, y;
|
||||
u32* dataPtr;
|
||||
u16* fb;
|
||||
@@ -102,14 +96,11 @@ void FaultDrawer_DrawChar(char c)
|
||||
if ((sFaultDrawerStruct.xStart <= sFaultDrawerStruct.cursorX) &&
|
||||
((sFaultDrawerStruct.charW + sFaultDrawerStruct.cursorX - 1) <= sFaultDrawerStruct.xEnd) &&
|
||||
(sFaultDrawerStruct.yStart <= sFaultDrawerStruct.cursorY) &&
|
||||
((sFaultDrawerStruct.charH + sFaultDrawerStruct.cursorY - 1) <= sFaultDrawerStruct.yEnd))
|
||||
{
|
||||
for (y = 0; y < sFaultDrawerStruct.charH; y++)
|
||||
{
|
||||
((sFaultDrawerStruct.charH + sFaultDrawerStruct.cursorY - 1) <= sFaultDrawerStruct.yEnd)) {
|
||||
for (y = 0; y < sFaultDrawerStruct.charH; y++) {
|
||||
u32 mask = 0x10000000 << (c % 4);
|
||||
u32 data = *dataPtr;
|
||||
for (x = 0; x < sFaultDrawerStruct.charW; x++)
|
||||
{
|
||||
for (x = 0; x < sFaultDrawerStruct.charW; x++) {
|
||||
if (mask & data)
|
||||
fb[x] = sFaultDrawerStruct.foreColor;
|
||||
else if (sFaultDrawerStruct.backColor & 1)
|
||||
@@ -125,93 +116,89 @@ void FaultDrawer_DrawChar(char c)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault_drawer/FaultDrawer_DrawChar.s")
|
||||
#endif
|
||||
|
||||
s32 FaultDrawer_ColorToPrintColor(u16 color)
|
||||
{
|
||||
s32 FaultDrawer_ColorToPrintColor(u16 color) {
|
||||
s32 i;
|
||||
for (i = 0; i < 10; i++)
|
||||
if (color == sFaultDrawerStruct.printColors[i])
|
||||
for (i = 0; i < 10; i++) {
|
||||
if (color == sFaultDrawerStruct.printColors[i]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void FaultDrawer_UpdatePrintColor()
|
||||
{
|
||||
void FaultDrawer_UpdatePrintColor() {
|
||||
s32 idx;
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled)
|
||||
{
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled) {
|
||||
osSyncPrintf(VT_RST);
|
||||
idx = FaultDrawer_ColorToPrintColor(sFaultDrawerStruct.foreColor);
|
||||
if (idx >= 0 && idx < 8)
|
||||
if (idx >= 0 && idx < 8) {
|
||||
osSyncPrintf(VT_SGR("3%d"), idx);
|
||||
}
|
||||
idx = FaultDrawer_ColorToPrintColor(sFaultDrawerStruct.backColor);
|
||||
if (idx >= 0 && idx < 8)
|
||||
if (idx >= 0 && idx < 8) {
|
||||
osSyncPrintf(VT_SGR("4%d"), idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FaultDrawer_SetForeColor(u16 color)
|
||||
{
|
||||
void FaultDrawer_SetForeColor(u16 color) {
|
||||
sFaultDrawerStruct.foreColor = color;
|
||||
FaultDrawer_UpdatePrintColor();
|
||||
}
|
||||
|
||||
void FaultDrawer_SetBackColor(u16 color)
|
||||
{
|
||||
void FaultDrawer_SetBackColor(u16 color) {
|
||||
sFaultDrawerStruct.backColor = color;
|
||||
FaultDrawer_UpdatePrintColor();
|
||||
}
|
||||
|
||||
void FaultDrawer_SetFontColor(u16 color)
|
||||
{
|
||||
FaultDrawer_SetForeColor((u16)(color | 1)); //force alpha to be set
|
||||
void FaultDrawer_SetFontColor(u16 color) {
|
||||
FaultDrawer_SetForeColor((u16)(color | 1)); // force alpha to be set
|
||||
}
|
||||
|
||||
void FaultDrawer_SetCharPad(s8 padW, s8 padH)
|
||||
{
|
||||
void FaultDrawer_SetCharPad(s8 padW, s8 padH) {
|
||||
sFaultDrawerStruct.charWPad = padW;
|
||||
sFaultDrawerStruct.charHPad = padH;
|
||||
}
|
||||
|
||||
void FaultDrawer_SetCursor(s32 x, s32 y)
|
||||
{
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled)
|
||||
osSyncPrintf(VT_CUP("%d", "%d"), (y - sFaultDrawerStruct.yStart) / (sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad), (x - sFaultDrawerStruct.xStart) / (sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad));
|
||||
void FaultDrawer_SetCursor(s32 x, s32 y) {
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled) {
|
||||
osSyncPrintf(VT_CUP("%d", "%d"),
|
||||
(y - sFaultDrawerStruct.yStart) / (sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad),
|
||||
(x - sFaultDrawerStruct.xStart) / (sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad));
|
||||
}
|
||||
sFaultDrawerStruct.cursorX = x;
|
||||
sFaultDrawerStruct.cursorY = y;
|
||||
}
|
||||
|
||||
void FaultDrawer_FillScreen()
|
||||
{
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled)
|
||||
void FaultDrawer_FillScreen() {
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled) {
|
||||
osSyncPrintf(VT_CLS);
|
||||
}
|
||||
|
||||
FaultDrawer_DrawRecImpl(sFaultDrawerStruct.xStart, sFaultDrawerStruct.yStart, sFaultDrawerStruct.xEnd, sFaultDrawerStruct.yEnd, sFaultDrawerStruct.backColor | 1);
|
||||
FaultDrawer_DrawRecImpl(sFaultDrawerStruct.xStart, sFaultDrawerStruct.yStart, sFaultDrawerStruct.xEnd,
|
||||
sFaultDrawerStruct.yEnd, sFaultDrawerStruct.backColor | 1);
|
||||
FaultDrawer_SetCursor(sFaultDrawerStruct.xStart, sFaultDrawerStruct.yStart);
|
||||
}
|
||||
|
||||
u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count)
|
||||
{
|
||||
for (count; count != 0; count--, str++)
|
||||
{
|
||||
u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count) {
|
||||
for (count; count != 0; count--, str++) {
|
||||
s32 curXStart;
|
||||
s32 curXEnd;
|
||||
|
||||
if (sFaultDrawerStruct.escCode)
|
||||
{
|
||||
if (sFaultDrawerStruct.escCode) {
|
||||
sFaultDrawerStruct.escCode = false;
|
||||
if (*str > 0x30 && *str < 0x3A)
|
||||
if (*str > 0x30 && *str < 0x3A) {
|
||||
FaultDrawer_SetForeColor(sFaultDrawerStruct.printColors[*str - 0x30]);
|
||||
}
|
||||
|
||||
curXStart = sFaultDrawerStruct.cursorX;
|
||||
curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (*str)
|
||||
{
|
||||
} else {
|
||||
switch (*str) {
|
||||
case '\n':
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled)
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled) {
|
||||
osSyncPrintf("\n");
|
||||
}
|
||||
|
||||
sFaultDrawerStruct.cursorX = sFaultDrawerStruct.w;
|
||||
curXStart = sFaultDrawerStruct.cursorX;
|
||||
@@ -223,8 +210,9 @@ u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count)
|
||||
curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW;
|
||||
break;
|
||||
default:
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled)
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled) {
|
||||
osSyncPrintf("%c", *str);
|
||||
}
|
||||
|
||||
FaultDrawer_DrawChar(*str);
|
||||
sFaultDrawerStruct.cursorX += sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad;
|
||||
@@ -234,14 +222,11 @@ u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count)
|
||||
}
|
||||
}
|
||||
|
||||
if (curXEnd <= curXStart)
|
||||
{
|
||||
if (curXEnd <= curXStart) {
|
||||
sFaultDrawerStruct.cursorX = sFaultDrawerStruct.xStart;
|
||||
sFaultDrawerStruct.cursorY += sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad;
|
||||
if (sFaultDrawerStruct.yEnd - sFaultDrawerStruct.charH <= sFaultDrawerStruct.cursorY)
|
||||
{
|
||||
if (sFaultDrawerStruct.inputCallback)
|
||||
{
|
||||
if (sFaultDrawerStruct.yEnd - sFaultDrawerStruct.charH <= sFaultDrawerStruct.cursorY) {
|
||||
if (sFaultDrawerStruct.inputCallback) {
|
||||
sFaultDrawerStruct.inputCallback();
|
||||
FaultDrawer_FillScreen();
|
||||
}
|
||||
@@ -255,21 +240,18 @@ u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count)
|
||||
return arg0;
|
||||
}
|
||||
|
||||
void FaultDrawer_VPrintf(const char* str, char* args) //va_list
|
||||
{
|
||||
void FaultDrawer_VPrintf(const char* str, char* args) { // va_list
|
||||
_Printf(&FaultDrawer_FormatStringFunc, &sFaultDrawerStruct, str, args);
|
||||
}
|
||||
|
||||
void FaultDrawer_Printf(const char* fmt, ...)
|
||||
{
|
||||
void FaultDrawer_Printf(const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
FaultDrawer_VPrintf(fmt, args);
|
||||
}
|
||||
|
||||
void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...)
|
||||
{
|
||||
void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
@@ -277,25 +259,21 @@ void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...)
|
||||
FaultDrawer_VPrintf(fmt, args);
|
||||
}
|
||||
|
||||
void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h)
|
||||
{
|
||||
void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h) {
|
||||
sFaultDrawerStruct.fb = (u16*)fb;
|
||||
sFaultDrawerStruct.w = w;
|
||||
sFaultDrawerStruct.h = h;
|
||||
}
|
||||
|
||||
void FaultDrawer_SetInputCallback(void(*callback)())
|
||||
{
|
||||
void FaultDrawer_SetInputCallback(void (*callback)()) {
|
||||
sFaultDrawerStruct.inputCallback = callback;
|
||||
}
|
||||
|
||||
void FaultDrawer_WritebackFBDCache()
|
||||
{
|
||||
osWritebackDCache(sFaultDrawerStruct.fb, sFaultDrawerStruct.w*sFaultDrawerStruct.h*2);
|
||||
void FaultDrawer_WritebackFBDCache() {
|
||||
osWritebackDCache(sFaultDrawerStruct.fb, sFaultDrawerStruct.w * sFaultDrawerStruct.h * 2);
|
||||
}
|
||||
|
||||
void FaultDrawer_SetDefault()
|
||||
{
|
||||
void FaultDrawer_SetDefault() {
|
||||
bcopy(&sFaultDrawerDefault, &sFaultDrawerStruct, sizeof(FaultDrawer));
|
||||
sFaultDrawerStruct.fb = (u16*)((osMemSize | 0x80000000) - 0x25800);
|
||||
}
|
||||
|
||||
+17
-29
@@ -1,26 +1,22 @@
|
||||
#include <global.h>
|
||||
|
||||
void GameAlloc_Log(GameAlloc* this)
|
||||
{
|
||||
void GameAlloc_Log(GameAlloc* this) {
|
||||
GameAllocEntry* iter;
|
||||
|
||||
osSyncPrintf("this = %08x\n", this);
|
||||
|
||||
iter = this->base.next;
|
||||
while (iter != &this->base)
|
||||
{
|
||||
while (iter != &this->base) {
|
||||
osSyncPrintf("ptr = %08x size = %d\n", iter, iter->size);
|
||||
iter = iter->next;
|
||||
}
|
||||
}
|
||||
|
||||
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 line)
|
||||
{
|
||||
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 line) {
|
||||
GameAllocEntry* ptr;
|
||||
|
||||
ptr = SystemArena_MallocDebug(size+sizeof(GameAllocEntry), file, line);
|
||||
if (ptr)
|
||||
{
|
||||
ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), file, line);
|
||||
if (ptr) {
|
||||
ptr->size = size;
|
||||
ptr->prev = this->head;
|
||||
this->head->next = ptr;
|
||||
@@ -28,18 +24,16 @@ void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 lin
|
||||
ptr->next = &this->base;
|
||||
this->base.prev = this->head;
|
||||
return ptr + 1;
|
||||
}
|
||||
else
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void* GameAlloc_Malloc(GameAlloc* this, u32 size)
|
||||
{
|
||||
void* GameAlloc_Malloc(GameAlloc* this, u32 size) {
|
||||
GameAllocEntry* ptr;
|
||||
|
||||
ptr = SystemArena_MallocDebug(size+sizeof(GameAllocEntry), "../gamealloc.c", 93);
|
||||
if (ptr)
|
||||
{
|
||||
ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), "../gamealloc.c", 93);
|
||||
if (ptr) {
|
||||
ptr->size = size;
|
||||
ptr->prev = this->head;
|
||||
this->head->next = ptr;
|
||||
@@ -47,17 +41,15 @@ void* GameAlloc_Malloc(GameAlloc* this, u32 size)
|
||||
ptr->next = &this->base;
|
||||
this->base.prev = this->head;
|
||||
return ptr + 1;
|
||||
}
|
||||
else
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void GameAlloc_Free(GameAlloc* this, void* data)
|
||||
{
|
||||
void GameAlloc_Free(GameAlloc* this, void* data) {
|
||||
GameAllocEntry* ptr;
|
||||
|
||||
if (data)
|
||||
{
|
||||
if (data) {
|
||||
ptr = &((GameAllocEntry*)data)[-1];
|
||||
LogUtils_CheckNullPointer("ptr->prev", ptr->prev, "../gamealloc.c", 120);
|
||||
LogUtils_CheckNullPointer("ptr->next", ptr->next, "../gamealloc.c", 121);
|
||||
@@ -68,14 +60,12 @@ void GameAlloc_Free(GameAlloc* this, void* data)
|
||||
}
|
||||
}
|
||||
|
||||
void GameAlloc_Cleanup(GameAlloc* this)
|
||||
{
|
||||
void GameAlloc_Cleanup(GameAlloc* this) {
|
||||
GameAllocEntry* next;
|
||||
GameAllocEntry* cur;
|
||||
|
||||
next = this->base.next;
|
||||
while (&this->base != next)
|
||||
{
|
||||
while (&this->base != next) {
|
||||
cur = next;
|
||||
next = next->next;
|
||||
SystemArena_FreeDebug(cur, "../gamealloc.c", 145);
|
||||
@@ -84,11 +74,9 @@ void GameAlloc_Cleanup(GameAlloc* this)
|
||||
this->head = &this->base;
|
||||
this->base.next = &this->base;
|
||||
this->base.prev = &this->base;
|
||||
|
||||
}
|
||||
|
||||
void GameAlloc_Init(GameAlloc* this)
|
||||
{
|
||||
void GameAlloc_Init(GameAlloc* this) {
|
||||
this->head = &this->base;
|
||||
this->base.next = &this->base;
|
||||
this->base.prev = &this->base;
|
||||
|
||||
+197
-238
@@ -1,188 +1,196 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
//.bss
|
||||
// .bss
|
||||
u8 D_801755F0;
|
||||
|
||||
//.data
|
||||
u16 sGfxPrintFontTLUT[64] =
|
||||
{
|
||||
0x0000, 0xFFFF, 0x0000, 0xFFFF,
|
||||
0x0000, 0xFFFF, 0x0000, 0xFFFF,
|
||||
0x0000, 0xFFFF, 0x0000, 0xFFFF,
|
||||
0x0000, 0xFFFF, 0x0000, 0xFFFF,
|
||||
0x0000, 0x0000, 0xFFFF, 0xFFFF,
|
||||
0x0000, 0x0000, 0xFFFF, 0xFFFF,
|
||||
0x0000, 0x0000, 0xFFFF, 0xFFFF,
|
||||
0x0000, 0x0000, 0xFFFF, 0xFFFF,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||
// .data
|
||||
u16 sGfxPrintFontTLUT[64] = {
|
||||
0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000,
|
||||
0xFFFF, 0x0000, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000,
|
||||
0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||
0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||
};
|
||||
|
||||
u16 sGfxPrintUnkTLUT[16] =
|
||||
{
|
||||
0xF801, 0xFBC1, 0xFFC1, 0x07C1,
|
||||
0x0421, 0x003F, 0x803F, 0xF83F,
|
||||
0xF801, 0xFBC1, 0xFFC1, 0x07C1,
|
||||
0x0421, 0x003F, 0x803F, 0xF83F,
|
||||
u16 sGfxPrintUnkTLUT[16] = {
|
||||
0xF801, 0xFBC1, 0xFFC1, 0x07C1, 0x0421, 0x003F, 0x803F, 0xF83F,
|
||||
0xF801, 0xFBC1, 0xFFC1, 0x07C1, 0x0421, 0x003F, 0x803F, 0xF83F,
|
||||
};
|
||||
|
||||
u8 sGfxPrintUnkData[8] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 };
|
||||
|
||||
u8 sGfxPrintFontData[(16*256)/2] =
|
||||
{
|
||||
0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00,
|
||||
0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x08, 0xBF, 0xFB, 0x00, 0x0E, 0xFF, 0xFF, 0xC0, 0x0B, 0xF0, 0x0F, 0xB0, 0x0F, 0xF0, 0x03, 0x30, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0C, 0xFB, 0xBF, 0x60, 0x0F, 0xFC, 0xCE, 0x20,
|
||||
0x0D, 0xD4, 0x4F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x03, 0x30, 0x0C, 0xFB, 0xBF, 0x40, 0x0E, 0xF7, 0x77, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00,
|
||||
0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x08, 0xBF, 0xFB, 0x00, 0x00, 0x0D, 0xE0, 0x00, 0x0B, 0xF0, 0x0F, 0xB0, 0x00, 0x5D, 0xE6, 0x00, 0x0F, 0xF0, 0x0F, 0xF0, 0x05, 0x5C, 0xC6, 0x60, 0x0C, 0xFB, 0xBF, 0x60, 0x77, 0x3F, 0xF3, 0x77,
|
||||
0x0D, 0xD4, 0x4F, 0xF0, 0xBB, 0x3F, 0xF3, 0xBB, 0x0F, 0xF0, 0x0F, 0xF0, 0x09, 0x9C, 0xCA, 0xA0, 0x0C, 0xFB, 0xBF, 0x40, 0x00, 0x9D, 0xEA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0xE0, 0x00,
|
||||
0x04, 0xC2, 0x2C, 0x40, 0x02, 0x8D, 0x50, 0x20, 0x0C, 0xCA, 0xAC, 0xC0, 0x21, 0xF9, 0x17, 0x10, 0x04, 0xC2, 0x2C, 0x40, 0x12, 0x49, 0x34, 0x00, 0x00, 0x82, 0x08, 0x00, 0x01, 0x97, 0x51, 0x10,
|
||||
0x08, 0x8A, 0x88, 0x80, 0x04, 0x61, 0x52, 0x41, 0x00, 0x80, 0x08, 0x00, 0x43, 0x11, 0x75, 0x30, 0x00, 0xA2, 0x08, 0x00, 0x60, 0x05, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x40,
|
||||
0x00, 0x22, 0x11, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0F, 0xB0, 0x00, 0x00, 0x00, 0x08, 0x80, 0x04, 0x0D, 0xA4, 0x00, 0x00, 0x00, 0x88, 0x00, 0x08, 0xCD, 0xE8, 0x80, 0x02, 0x2A, 0xA2, 0x20,
|
||||
0x08, 0xCD, 0xE8, 0x80, 0x02, 0xAA, 0x22, 0x20, 0x04, 0x0D, 0xA4, 0x00, 0x0C, 0xD1, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0x00, 0x8C, 0x51, 0x00, 0x00, 0x00, 0x22, 0x11, 0x00, 0x81, 0x10, 0x00, 0x00,
|
||||
0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00,
|
||||
0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x33, 0x33, 0x00, 0x04, 0x48, 0x99, 0x80, 0x03, 0x3C, 0xC3, 0x30, 0x00, 0xCD, 0x10, 0x88, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0xBF, 0x62, 0xA8, 0x00, 0x33, 0x33, 0x20, 0x01, 0x10, 0x4C, 0x80,
|
||||
0x01, 0x10, 0x03, 0x30, 0x00, 0x15, 0xC8, 0x00, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0x67, 0x32, 0x20, 0x00, 0x3F, 0xF3, 0x00, 0x04, 0x40, 0x99, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0xDF, 0xFD, 0x10, 0x07, 0xFF, 0xFF, 0x60, 0x1C, 0xE0, 0x0E, 0xC1, 0x0F, 0xF0, 0x09, 0x90, 0x1E, 0xE1, 0x16, 0x61, 0x0F, 0xF0, 0x01, 0x10, 0x1E, 0xF4, 0x56, 0x21, 0x0F, 0xF6, 0x67, 0x10,
|
||||
0x1E, 0xF2, 0x36, 0x61, 0x0F, 0xF0, 0x89, 0x90, 0x1E, 0xF1, 0x0F, 0xE1, 0x0F, 0xF0, 0x09, 0x90, 0x16, 0xEC, 0xCE, 0x21, 0x07, 0xFB, 0xBB, 0x20, 0x01, 0x11, 0x11, 0x10, 0x00, 0x00, 0x00, 0x00,
|
||||
0x09, 0xB6, 0x6F, 0xD0, 0x27, 0xD8, 0x8E, 0x60, 0x09, 0x92, 0xED, 0x10, 0x2F, 0xF0, 0x2E, 0xE0, 0x09, 0x9A, 0xE5, 0x10, 0x2F, 0xF6, 0x2E, 0xE0, 0x09, 0x9B, 0x75, 0x10, 0x2F, 0xD6, 0x4E, 0xE0,
|
||||
0x0D, 0xDA, 0xE5, 0x10, 0x2F, 0xD0, 0x4E, 0xE0, 0x0D, 0xD2, 0xED, 0x10, 0x2F, 0xD0, 0x0E, 0xE0, 0x09, 0xF6, 0x6F, 0x90, 0x27, 0xD9, 0x9F, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x07, 0xFF, 0xFF, 0x00, 0x8F, 0x71, 0x1F, 0xF0, 0x2F, 0xD0, 0x0F, 0xF0, 0x8F, 0x71, 0x1F, 0xF0, 0x2F, 0xD0, 0x07, 0x70, 0x8E, 0x61, 0x1E, 0xE0, 0x27, 0xDD, 0xDF, 0x60, 0x8E, 0x69, 0x1E, 0xE0,
|
||||
0x27, 0x76, 0x4A, 0xA0, 0x8E, 0xE9, 0x9E, 0xE0, 0x2F, 0xD0, 0x6E, 0x80, 0x8A, 0xE7, 0xFE, 0xA0, 0x07, 0xFA, 0x8E, 0x60, 0x88, 0x27, 0x7A, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x07, 0x7C, 0xCF, 0xF0, 0x13, 0x26, 0x60, 0x11, 0x07, 0x7C, 0xCF, 0xF0, 0x03, 0x76, 0x65, 0x10, 0x02, 0x39, 0xD7, 0x20, 0x04, 0x53, 0x35, 0x40, 0x00, 0x2F, 0xF2, 0x00, 0x01, 0x13, 0x31, 0x10,
|
||||
0x00, 0x5F, 0xB1, 0x00, 0x00, 0x03, 0x30, 0x00, 0x05, 0x5E, 0xE5, 0x50, 0x01, 0x13, 0x31, 0x10, 0x05, 0x5E, 0xED, 0xD0, 0x02, 0x23, 0x30, 0x00, 0x00, 0x08, 0x88, 0x80, 0x8A, 0xAB, 0xB8, 0x88,
|
||||
0x00, 0x00, 0x11, 0x00, 0x00, 0x04, 0x45, 0x10, 0x04, 0x62, 0x33, 0x20, 0x00, 0x44, 0x01, 0x10, 0x04, 0xC8, 0x9A, 0xA0, 0x00, 0xEE, 0xAB, 0x10, 0x0C, 0xE6, 0x67, 0x20, 0x0E, 0xF5, 0x5F, 0xB0,
|
||||
0x0E, 0xE0, 0x06, 0x60, 0x0B, 0xF6, 0x2B, 0x90, 0x0E, 0xE0, 0x06, 0x60, 0x03, 0xFC, 0x89, 0x90, 0x04, 0xEE, 0xEE, 0xA0, 0x00, 0x77, 0x3B, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0x88, 0x00,
|
||||
0x09, 0x90, 0x00, 0x00, 0x00, 0x11, 0x10, 0x00, 0x09, 0x92, 0x24, 0x40, 0x00, 0x01, 0x10, 0x00, 0x09, 0x90, 0x88, 0x00, 0x26, 0xEF, 0xDE, 0x20, 0x09, 0x9B, 0xB5, 0x40, 0x2E, 0xC3, 0x3C, 0xE2,
|
||||
0x0D, 0x9A, 0x25, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x0D, 0xDA, 0xA5, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x09, 0xD6, 0xED, 0x10, 0x26, 0xCB, 0xBC, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x05, 0xFB, 0xFF, 0xE0, 0x8E, 0x61, 0x16, 0xE8, 0x0F, 0xF4, 0x03, 0x30, 0x8F, 0x71, 0x17, 0xF8,
|
||||
0x07, 0xFC, 0x8B, 0x30, 0x8E, 0x69, 0x96, 0xE8, 0x05, 0x73, 0x3B, 0xA0, 0x8A, 0x6D, 0xD6, 0xA8, 0x0D, 0xD8, 0x8A, 0x20, 0x08, 0xA7, 0x79, 0xB2, 0x01, 0x10, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x80, 0x8A, 0x01, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x80, 0xA1, 0x10, 0x00, 0x07, 0x74, 0x4F, 0x70, 0x80, 0xA9, 0x90, 0x00, 0x02, 0x31, 0xDF, 0x20, 0x84, 0xE6, 0x00, 0x04,
|
||||
0x00, 0x27, 0xDA, 0x20, 0xC8, 0xAA, 0x4C, 0x40, 0x00, 0x57, 0x3B, 0x20, 0x00, 0xA1, 0x18, 0x00, 0x05, 0x54, 0x6F, 0x50, 0x00, 0xA9, 0x98, 0x00, 0x02, 0x22, 0x20, 0x80, 0x02, 0x00, 0x18, 0x88,
|
||||
0x00, 0x04, 0x44, 0x40, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x0C, 0x44, 0x44, 0x00, 0x00, 0x04, 0x40, 0x00, 0x88, 0xC0, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x00, 0x0C, 0x46, 0xA4, 0x40,
|
||||
0x00, 0x0C, 0xC0, 0x00, 0x08, 0x8E, 0xE0, 0x00, 0x02, 0x08, 0x80, 0x00, 0x80, 0xD0, 0x88, 0x00, 0x28, 0xA8, 0x80, 0x00, 0x88, 0xCD, 0x4C, 0x40, 0x0A, 0x88, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xE0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0x00, 0x80, 0x01, 0x06, 0x10, 0x00, 0x56, 0xE7, 0x50, 0x80, 0x02, 0x1F, 0xF1, 0x00,
|
||||
0x38, 0x8C, 0xB8, 0x00, 0x0B, 0xF6, 0x0B, 0x00, 0x94, 0xC0, 0x28, 0x00, 0x06, 0x07, 0x6A, 0x00, 0xCB, 0xA6, 0xC8, 0x00, 0x00, 0x47, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x0A, 0x80, 0x00, 0x00, 0x39, 0x14, 0x20, 0x02, 0x22, 0x24, 0x00, 0x08, 0xAE, 0xA8, 0x60, 0x04, 0x28, 0x99, 0x70, 0x07, 0x75, 0xD1, 0x04, 0x0F, 0xB3, 0x33, 0xD0, 0x00, 0xAE, 0xBE, 0xA4,
|
||||
0x25, 0x15, 0x20, 0xA0, 0x02, 0x61, 0x0C, 0x02, 0x20, 0x42, 0x08, 0x20, 0x2C, 0x30, 0x14, 0x02, 0x02, 0x28, 0x82, 0x00, 0x03, 0xAC, 0xC1, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x08, 0x12, 0x00, 0x08, 0x00, 0x28, 0x00, 0x0A, 0xCF, 0xEE, 0x20, 0x0B, 0x62, 0x2E, 0x20, 0x02, 0x10, 0x82, 0x40, 0x01, 0x44, 0xE4, 0x40, 0x03, 0x00, 0x0E, 0x00, 0x8D, 0xEA, 0xAC, 0x00,
|
||||
0x02, 0x10, 0x0A, 0x00, 0x01, 0xE0, 0x24, 0x00, 0x0C, 0x21, 0x02, 0x00, 0x09, 0x42, 0x21, 0x00, 0x00, 0xCC, 0xF4, 0x40, 0x02, 0xBF, 0xD4, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x0C, 0xCC, 0xC4, 0x40, 0x00, 0x0C, 0xC0, 0x00, 0x00, 0x02, 0xA0, 0x40,
|
||||
0x00, 0x0C, 0xC0, 0x00, 0x04, 0xCE, 0x64, 0x40, 0x02, 0x08, 0x80, 0x00, 0x00, 0x90, 0x00, 0x40, 0x28, 0xA8, 0x80, 0x00, 0x08, 0x01, 0x04, 0x00, 0x0A, 0x88, 0x80, 0x00, 0x04, 0x44, 0x40, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x54, 0x44, 0x00, 0xEE, 0xFE, 0xE0, 0x00, 0x09, 0x3B, 0x3F, 0x00,
|
||||
0x21, 0xD8, 0x20, 0x00, 0x00, 0x54, 0x4F, 0x00, 0x18, 0x58, 0x20, 0x00, 0x00, 0x01, 0x86, 0x00, 0xC6, 0x7E, 0x40, 0x00, 0x00, 0xEF, 0x66, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x80, 0x04, 0x00, 0x00, 0xC0, 0x20, 0x00, 0xAA, 0xAA, 0xEA, 0x20, 0xEF, 0xFF, 0xFF, 0x00, 0x80, 0x44, 0x19, 0x30, 0x00, 0x49, 0x24, 0x00, 0xC5, 0x35, 0x1B, 0x10, 0x00, 0x4B, 0x24, 0x00,
|
||||
0x01, 0x35, 0xA0, 0x00, 0x8C, 0xA9, 0xAC, 0x80, 0x00, 0x2C, 0x00, 0x00, 0x04, 0x21, 0xA4, 0x00, 0x2A, 0x84, 0x00, 0x00, 0x73, 0x11, 0xF1, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0B, 0x11, 0x19, 0x00, 0x00, 0x40, 0x00, 0x00, 0x8F, 0xEE, 0xEF, 0xE0, 0x0B, 0x76, 0x66, 0xD0, 0x1A, 0x00, 0x0B, 0x40, 0x4C, 0x40, 0x02, 0xD0, 0x28, 0x00, 0x1A, 0x40, 0x01, 0xD0, 0x2C, 0x10,
|
||||
0x00, 0x00, 0x38, 0x40, 0x00, 0x40, 0x28, 0x10, 0x00, 0x01, 0xA0, 0x40, 0x00, 0x42, 0x83, 0x00, 0x05, 0xFE, 0x44, 0x40, 0x03, 0xFD, 0x54, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x09, 0x99, 0x9B, 0x00, 0x00, 0x10, 0x20, 0x00, 0x07, 0x26, 0x21, 0x40, 0x2A, 0xFE, 0xEE, 0xA0, 0x8D, 0x8C, 0xA9, 0xC0, 0x00, 0x10, 0x20, 0x80, 0x32, 0x33, 0xB3, 0x60, 0x00, 0x19, 0x28, 0x00,
|
||||
0x00, 0x00, 0xA1, 0x40, 0x00, 0x10, 0xB1, 0x00, 0x00, 0x08, 0x34, 0x00, 0x00, 0x1A, 0x08, 0x00, 0x05, 0xF7, 0x40, 0x00, 0x8E, 0xF4, 0x44, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x08, 0x14, 0x02, 0x80, 0x00, 0x04, 0x00, 0x00, 0x1D, 0x11, 0xDB, 0x00, 0xDD, 0xFD, 0xDD, 0xD0, 0x0C, 0x88, 0x07, 0x00, 0x02, 0x06, 0x00, 0x90, 0x48, 0x00, 0x34, 0x00, 0x2C, 0x04, 0x2C, 0x10,
|
||||
0x48, 0x11, 0x21, 0x40, 0x04, 0x84, 0x83, 0x40, 0x59, 0x03, 0x00, 0x50, 0x40, 0x0C, 0x10, 0x60, 0x42, 0xA9, 0x88, 0xC0, 0x40, 0x15, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x11, 0x02, 0x00, 0x40, 0x08, 0x98, 0x88, 0x80, 0x08, 0xF9, 0x98, 0xC0, 0x06, 0x77, 0x75, 0x50, 0x02, 0x0C, 0x05, 0x00, 0x19, 0x98, 0xA8, 0xD0, 0x0B, 0x99, 0xCA, 0x80, 0x04, 0x54, 0x65, 0xC0,
|
||||
0x20, 0x08, 0x50, 0x20, 0x00, 0x10, 0x20, 0xC0, 0x31, 0x1C, 0x04, 0x20, 0x00, 0x01, 0x28, 0x40, 0x26, 0x63, 0xBB, 0xE0, 0x26, 0xEF, 0xE6, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x02, 0x01, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0F, 0x8A, 0x89, 0x80, 0xC3, 0xF3, 0x11, 0x30, 0x0F, 0x02, 0x01, 0x80, 0xC9, 0xC0, 0x00, 0x30, 0x0F, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00, 0x30,
|
||||
0x0E, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00, 0x30, 0x0E, 0x02, 0x52, 0x80, 0x00, 0x00, 0x03, 0x00, 0x2C, 0xDF, 0xA8, 0x80, 0x02, 0x33, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x03, 0x88, 0x00, 0x01, 0x02, 0x80, 0x00, 0x03, 0xFF, 0xF7, 0x00, 0x0F, 0x26, 0xE4, 0x72, 0xCC, 0x38, 0x00, 0x40, 0x0C, 0x38, 0x99, 0x00, 0x03, 0x0A, 0x31, 0x50, 0x0C, 0xB1, 0x82, 0x80,
|
||||
0x03, 0x28, 0x06, 0x00, 0x87, 0x88, 0x2A, 0xA0, 0x01, 0x05, 0xC2, 0x00, 0x85, 0x82, 0xC2, 0x80, 0x10, 0x00, 0x39, 0x10, 0x08, 0x51, 0xBF, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x80, 0x04, 0x00, 0x48, 0x9D, 0xCC, 0x40, 0xC9, 0xE6, 0x7F, 0x40, 0x40, 0x00, 0x94, 0x00, 0x5B, 0x21, 0x0C, 0xB0, 0x48, 0xAE, 0xCC, 0x40, 0xE1, 0x30, 0x0C, 0x30, 0x43, 0x01, 0xA4, 0x00,
|
||||
0xE1, 0x24, 0x5D, 0x30, 0x78, 0x8C, 0xD6, 0x10, 0xF1, 0x60, 0x94, 0x70, 0xD0, 0x40, 0x9C, 0x70, 0x0B, 0x8C, 0x53, 0x00, 0x0C, 0x9D, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x39, 0x50, 0x00, 0x00, 0x88, 0xF0, 0x00, 0x2E, 0xAF, 0xC6, 0x00, 0x03, 0x01, 0x77, 0x60, 0x04, 0xF0, 0x41, 0x60, 0x03, 0x92, 0xF8, 0x12, 0x0F, 0xBD, 0x91, 0x40, 0x1B, 0x28, 0x60, 0x92,
|
||||
0x70, 0xF4, 0x01, 0xF0, 0x0A, 0xD4, 0x65, 0x82, 0x53, 0xE0, 0x01, 0xE0, 0x04, 0x10, 0x68, 0x60, 0x04, 0x2A, 0xBE, 0x00, 0x00, 0x4F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x02, 0x3A, 0xEE, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0D, 0x84, 0xA5, 0x00, 0xC1, 0xC2, 0x11, 0x00, 0x45, 0x0E, 0x27, 0x00, 0xD9, 0xC3, 0x00, 0x10, 0x07, 0xF8, 0x8D, 0x20, 0x01, 0x30, 0x00, 0x10,
|
||||
0xAC, 0x02, 0x25, 0xA0, 0x01, 0x22, 0x00, 0x10, 0x44, 0x20, 0x16, 0xA0, 0x13, 0x02, 0x00, 0x30, 0x04, 0x1B, 0xAA, 0x40, 0x21, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
u8 sGfxPrintFontData[(16 * 256) / 2] = {
|
||||
0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D,
|
||||
0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, 0x01, 0x56, 0x29, 0x90, 0x05, 0x58,
|
||||
0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xBF, 0xFB, 0x00, 0x0E, 0xFF, 0xFF, 0xC0, 0x0B, 0xF0, 0x0F, 0xB0,
|
||||
0x0F, 0xF0, 0x03, 0x30, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0C, 0xFB, 0xBF, 0x60, 0x0F, 0xFC, 0xCE,
|
||||
0x20, 0x0D, 0xD4, 0x4F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x03, 0x30, 0x0C, 0xFB,
|
||||
0xBF, 0x40, 0x0E, 0xF7, 0x77, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDF, 0xFD, 0x00, 0x0A,
|
||||
0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00,
|
||||
0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, 0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29,
|
||||
0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x08, 0xBF, 0xFB, 0x00, 0x00, 0x0D, 0xE0, 0x00, 0x0B, 0xF0, 0x0F, 0xB0, 0x00, 0x5D, 0xE6, 0x00, 0x0F,
|
||||
0xF0, 0x0F, 0xF0, 0x05, 0x5C, 0xC6, 0x60, 0x0C, 0xFB, 0xBF, 0x60, 0x77, 0x3F, 0xF3, 0x77, 0x0D, 0xD4, 0x4F, 0xF0,
|
||||
0xBB, 0x3F, 0xF3, 0xBB, 0x0F, 0xF0, 0x0F, 0xF0, 0x09, 0x9C, 0xCA, 0xA0, 0x0C, 0xFB, 0xBF, 0x40, 0x00, 0x9D, 0xEA,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0xE0, 0x00, 0x04, 0xC2, 0x2C, 0x40, 0x02, 0x8D, 0x50, 0x20, 0x0C, 0xCA,
|
||||
0xAC, 0xC0, 0x21, 0xF9, 0x17, 0x10, 0x04, 0xC2, 0x2C, 0x40, 0x12, 0x49, 0x34, 0x00, 0x00, 0x82, 0x08, 0x00, 0x01,
|
||||
0x97, 0x51, 0x10, 0x08, 0x8A, 0x88, 0x80, 0x04, 0x61, 0x52, 0x41, 0x00, 0x80, 0x08, 0x00, 0x43, 0x11, 0x75, 0x30,
|
||||
0x00, 0xA2, 0x08, 0x00, 0x60, 0x05, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x40, 0x00, 0x22, 0x11,
|
||||
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0F, 0xB0, 0x00, 0x00, 0x00, 0x08, 0x80, 0x04, 0x0D, 0xA4, 0x00, 0x00, 0x00,
|
||||
0x88, 0x00, 0x08, 0xCD, 0xE8, 0x80, 0x02, 0x2A, 0xA2, 0x20, 0x08, 0xCD, 0xE8, 0x80, 0x02, 0xAA, 0x22, 0x20, 0x04,
|
||||
0x0D, 0xA4, 0x00, 0x0C, 0xD1, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0x00, 0x8C, 0x51, 0x00, 0x00, 0x00, 0x22, 0x11, 0x00,
|
||||
0x81, 0x10, 0x00, 0x00, 0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D,
|
||||
0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, 0x01, 0x56,
|
||||
0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02,
|
||||
0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x00, 0x04, 0x48, 0x99, 0x80,
|
||||
0x03, 0x3C, 0xC3, 0x30, 0x00, 0xCD, 0x10, 0x88, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0xBF, 0x62, 0xA8, 0x00, 0x33, 0x33,
|
||||
0x20, 0x01, 0x10, 0x4C, 0x80, 0x01, 0x10, 0x03, 0x30, 0x00, 0x15, 0xC8, 0x00, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0x67,
|
||||
0x32, 0x20, 0x00, 0x3F, 0xF3, 0x00, 0x04, 0x40, 0x99, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
|
||||
0xDF, 0xFD, 0x10, 0x07, 0xFF, 0xFF, 0x60, 0x1C, 0xE0, 0x0E, 0xC1, 0x0F, 0xF0, 0x09, 0x90, 0x1E, 0xE1, 0x16, 0x61,
|
||||
0x0F, 0xF0, 0x01, 0x10, 0x1E, 0xF4, 0x56, 0x21, 0x0F, 0xF6, 0x67, 0x10, 0x1E, 0xF2, 0x36, 0x61, 0x0F, 0xF0, 0x89,
|
||||
0x90, 0x1E, 0xF1, 0x0F, 0xE1, 0x0F, 0xF0, 0x09, 0x90, 0x16, 0xEC, 0xCE, 0x21, 0x07, 0xFB, 0xBB, 0x20, 0x01, 0x11,
|
||||
0x11, 0x10, 0x00, 0x00, 0x00, 0x00, 0x09, 0xB6, 0x6F, 0xD0, 0x27, 0xD8, 0x8E, 0x60, 0x09, 0x92, 0xED, 0x10, 0x2F,
|
||||
0xF0, 0x2E, 0xE0, 0x09, 0x9A, 0xE5, 0x10, 0x2F, 0xF6, 0x2E, 0xE0, 0x09, 0x9B, 0x75, 0x10, 0x2F, 0xD6, 0x4E, 0xE0,
|
||||
0x0D, 0xDA, 0xE5, 0x10, 0x2F, 0xD0, 0x4E, 0xE0, 0x0D, 0xD2, 0xED, 0x10, 0x2F, 0xD0, 0x0E, 0xE0, 0x09, 0xF6, 0x6F,
|
||||
0x90, 0x27, 0xD9, 0x9F, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x00, 0x8F, 0x71,
|
||||
0x1F, 0xF0, 0x2F, 0xD0, 0x0F, 0xF0, 0x8F, 0x71, 0x1F, 0xF0, 0x2F, 0xD0, 0x07, 0x70, 0x8E, 0x61, 0x1E, 0xE0, 0x27,
|
||||
0xDD, 0xDF, 0x60, 0x8E, 0x69, 0x1E, 0xE0, 0x27, 0x76, 0x4A, 0xA0, 0x8E, 0xE9, 0x9E, 0xE0, 0x2F, 0xD0, 0x6E, 0x80,
|
||||
0x8A, 0xE7, 0xFE, 0xA0, 0x07, 0xFA, 0x8E, 0x60, 0x88, 0x27, 0x7A, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x07, 0x7C, 0xCF, 0xF0, 0x13, 0x26, 0x60, 0x11, 0x07, 0x7C, 0xCF, 0xF0, 0x03, 0x76, 0x65, 0x10, 0x02, 0x39,
|
||||
0xD7, 0x20, 0x04, 0x53, 0x35, 0x40, 0x00, 0x2F, 0xF2, 0x00, 0x01, 0x13, 0x31, 0x10, 0x00, 0x5F, 0xB1, 0x00, 0x00,
|
||||
0x03, 0x30, 0x00, 0x05, 0x5E, 0xE5, 0x50, 0x01, 0x13, 0x31, 0x10, 0x05, 0x5E, 0xED, 0xD0, 0x02, 0x23, 0x30, 0x00,
|
||||
0x00, 0x08, 0x88, 0x80, 0x8A, 0xAB, 0xB8, 0x88, 0x00, 0x00, 0x11, 0x00, 0x00, 0x04, 0x45, 0x10, 0x04, 0x62, 0x33,
|
||||
0x20, 0x00, 0x44, 0x01, 0x10, 0x04, 0xC8, 0x9A, 0xA0, 0x00, 0xEE, 0xAB, 0x10, 0x0C, 0xE6, 0x67, 0x20, 0x0E, 0xF5,
|
||||
0x5F, 0xB0, 0x0E, 0xE0, 0x06, 0x60, 0x0B, 0xF6, 0x2B, 0x90, 0x0E, 0xE0, 0x06, 0x60, 0x03, 0xFC, 0x89, 0x90, 0x04,
|
||||
0xEE, 0xEE, 0xA0, 0x00, 0x77, 0x3B, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0x88, 0x00, 0x09, 0x90, 0x00, 0x00,
|
||||
0x00, 0x11, 0x10, 0x00, 0x09, 0x92, 0x24, 0x40, 0x00, 0x01, 0x10, 0x00, 0x09, 0x90, 0x88, 0x00, 0x26, 0xEF, 0xDE,
|
||||
0x20, 0x09, 0x9B, 0xB5, 0x40, 0x2E, 0xC3, 0x3C, 0xE2, 0x0D, 0x9A, 0x25, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x0D, 0xDA,
|
||||
0xA5, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x09, 0xD6, 0xED, 0x10, 0x26, 0xCB, 0xBC, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00,
|
||||
0x05, 0xFB, 0xFF, 0xE0, 0x8E, 0x61, 0x16, 0xE8, 0x0F, 0xF4, 0x03, 0x30, 0x8F, 0x71, 0x17, 0xF8, 0x07, 0xFC, 0x8B,
|
||||
0x30, 0x8E, 0x69, 0x96, 0xE8, 0x05, 0x73, 0x3B, 0xA0, 0x8A, 0x6D, 0xD6, 0xA8, 0x0D, 0xD8, 0x8A, 0x20, 0x08, 0xA7,
|
||||
0x79, 0xB2, 0x01, 0x10, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8A, 0x01, 0x10, 0x00, 0x00,
|
||||
0x00, 0x08, 0x00, 0x80, 0xA1, 0x10, 0x00, 0x07, 0x74, 0x4F, 0x70, 0x80, 0xA9, 0x90, 0x00, 0x02, 0x31, 0xDF, 0x20,
|
||||
0x84, 0xE6, 0x00, 0x04, 0x00, 0x27, 0xDA, 0x20, 0xC8, 0xAA, 0x4C, 0x40, 0x00, 0x57, 0x3B, 0x20, 0x00, 0xA1, 0x18,
|
||||
0x00, 0x05, 0x54, 0x6F, 0x50, 0x00, 0xA9, 0x98, 0x00, 0x02, 0x22, 0x20, 0x80, 0x02, 0x00, 0x18, 0x88, 0x00, 0x04,
|
||||
0x44, 0x40, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x0C, 0x44, 0x44, 0x00, 0x00, 0x04, 0x40, 0x00, 0x88,
|
||||
0xC0, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x00, 0x0C, 0x46, 0xA4, 0x40, 0x00, 0x0C, 0xC0, 0x00, 0x08, 0x8E, 0xE0, 0x00,
|
||||
0x02, 0x08, 0x80, 0x00, 0x80, 0xD0, 0x88, 0x00, 0x28, 0xA8, 0x80, 0x00, 0x88, 0xCD, 0x4C, 0x40, 0x0A, 0x88, 0x80,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xE0, 0x08, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x08, 0x88, 0x00, 0x80, 0x01, 0x06, 0x10, 0x00, 0x56, 0xE7, 0x50, 0x80, 0x02, 0x1F, 0xF1, 0x00, 0x38,
|
||||
0x8C, 0xB8, 0x00, 0x0B, 0xF6, 0x0B, 0x00, 0x94, 0xC0, 0x28, 0x00, 0x06, 0x07, 0x6A, 0x00, 0xCB, 0xA6, 0xC8, 0x00,
|
||||
0x00, 0x47, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x80, 0x00, 0x00, 0x39, 0x14,
|
||||
0x20, 0x02, 0x22, 0x24, 0x00, 0x08, 0xAE, 0xA8, 0x60, 0x04, 0x28, 0x99, 0x70, 0x07, 0x75, 0xD1, 0x04, 0x0F, 0xB3,
|
||||
0x33, 0xD0, 0x00, 0xAE, 0xBE, 0xA4, 0x25, 0x15, 0x20, 0xA0, 0x02, 0x61, 0x0C, 0x02, 0x20, 0x42, 0x08, 0x20, 0x2C,
|
||||
0x30, 0x14, 0x02, 0x02, 0x28, 0x82, 0x00, 0x03, 0xAC, 0xC1, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x08, 0x12, 0x00, 0x08, 0x00, 0x28, 0x00, 0x0A, 0xCF, 0xEE, 0x20, 0x0B, 0x62, 0x2E, 0x20, 0x02, 0x10, 0x82,
|
||||
0x40, 0x01, 0x44, 0xE4, 0x40, 0x03, 0x00, 0x0E, 0x00, 0x8D, 0xEA, 0xAC, 0x00, 0x02, 0x10, 0x0A, 0x00, 0x01, 0xE0,
|
||||
0x24, 0x00, 0x0C, 0x21, 0x02, 0x00, 0x09, 0x42, 0x21, 0x00, 0x00, 0xCC, 0xF4, 0x40, 0x02, 0xBF, 0xD4, 0x40, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x0C, 0xCC, 0xC4, 0x40, 0x00, 0x0C, 0xC0, 0x00, 0x00, 0x02, 0xA0,
|
||||
0x40, 0x00, 0x0C, 0xC0, 0x00, 0x04, 0xCE, 0x64, 0x40, 0x02, 0x08, 0x80, 0x00, 0x00, 0x90, 0x00, 0x40, 0x28, 0xA8,
|
||||
0x80, 0x00, 0x08, 0x01, 0x04, 0x00, 0x0A, 0x88, 0x80, 0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x54, 0x44, 0x00,
|
||||
0xEE, 0xFE, 0xE0, 0x00, 0x09, 0x3B, 0x3F, 0x00, 0x21, 0xD8, 0x20, 0x00, 0x00, 0x54, 0x4F, 0x00, 0x18, 0x58, 0x20,
|
||||
0x00, 0x00, 0x01, 0x86, 0x00, 0xC6, 0x7E, 0x40, 0x00, 0x00, 0xEF, 0x66, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0xC0, 0x20, 0x00, 0xAA, 0xAA, 0xEA, 0x20, 0xEF, 0xFF, 0xFF, 0x00, 0x80,
|
||||
0x44, 0x19, 0x30, 0x00, 0x49, 0x24, 0x00, 0xC5, 0x35, 0x1B, 0x10, 0x00, 0x4B, 0x24, 0x00, 0x01, 0x35, 0xA0, 0x00,
|
||||
0x8C, 0xA9, 0xAC, 0x80, 0x00, 0x2C, 0x00, 0x00, 0x04, 0x21, 0xA4, 0x00, 0x2A, 0x84, 0x00, 0x00, 0x73, 0x11, 0xF1,
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x11, 0x19, 0x00, 0x00, 0x40, 0x00, 0x00, 0x8F, 0xEE,
|
||||
0xEF, 0xE0, 0x0B, 0x76, 0x66, 0xD0, 0x1A, 0x00, 0x0B, 0x40, 0x4C, 0x40, 0x02, 0xD0, 0x28, 0x00, 0x1A, 0x40, 0x01,
|
||||
0xD0, 0x2C, 0x10, 0x00, 0x00, 0x38, 0x40, 0x00, 0x40, 0x28, 0x10, 0x00, 0x01, 0xA0, 0x40, 0x00, 0x42, 0x83, 0x00,
|
||||
0x05, 0xFE, 0x44, 0x40, 0x03, 0xFD, 0x54, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x99, 0x9B,
|
||||
0x00, 0x00, 0x10, 0x20, 0x00, 0x07, 0x26, 0x21, 0x40, 0x2A, 0xFE, 0xEE, 0xA0, 0x8D, 0x8C, 0xA9, 0xC0, 0x00, 0x10,
|
||||
0x20, 0x80, 0x32, 0x33, 0xB3, 0x60, 0x00, 0x19, 0x28, 0x00, 0x00, 0x00, 0xA1, 0x40, 0x00, 0x10, 0xB1, 0x00, 0x00,
|
||||
0x08, 0x34, 0x00, 0x00, 0x1A, 0x08, 0x00, 0x05, 0xF7, 0x40, 0x00, 0x8E, 0xF4, 0x44, 0xC0, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x02, 0x80, 0x00, 0x04, 0x00, 0x00, 0x1D, 0x11, 0xDB, 0x00, 0xDD, 0xFD, 0xDD,
|
||||
0xD0, 0x0C, 0x88, 0x07, 0x00, 0x02, 0x06, 0x00, 0x90, 0x48, 0x00, 0x34, 0x00, 0x2C, 0x04, 0x2C, 0x10, 0x48, 0x11,
|
||||
0x21, 0x40, 0x04, 0x84, 0x83, 0x40, 0x59, 0x03, 0x00, 0x50, 0x40, 0x0C, 0x10, 0x60, 0x42, 0xA9, 0x88, 0xC0, 0x40,
|
||||
0x15, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x02, 0x00, 0x40, 0x08, 0x98, 0x88, 0x80,
|
||||
0x08, 0xF9, 0x98, 0xC0, 0x06, 0x77, 0x75, 0x50, 0x02, 0x0C, 0x05, 0x00, 0x19, 0x98, 0xA8, 0xD0, 0x0B, 0x99, 0xCA,
|
||||
0x80, 0x04, 0x54, 0x65, 0xC0, 0x20, 0x08, 0x50, 0x20, 0x00, 0x10, 0x20, 0xC0, 0x31, 0x1C, 0x04, 0x20, 0x00, 0x01,
|
||||
0x28, 0x40, 0x26, 0x63, 0xBB, 0xE0, 0x26, 0xEF, 0xE6, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x02, 0x01, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0F, 0x8A, 0x89, 0x80, 0xC3, 0xF3, 0x11, 0x30, 0x0F, 0x02, 0x01, 0x80,
|
||||
0xC9, 0xC0, 0x00, 0x30, 0x0F, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00, 0x30, 0x0E, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00,
|
||||
0x30, 0x0E, 0x02, 0x52, 0x80, 0x00, 0x00, 0x03, 0x00, 0x2C, 0xDF, 0xA8, 0x80, 0x02, 0x33, 0x30, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x88, 0x00, 0x01, 0x02, 0x80, 0x00, 0x03, 0xFF, 0xF7, 0x00, 0x0F,
|
||||
0x26, 0xE4, 0x72, 0xCC, 0x38, 0x00, 0x40, 0x0C, 0x38, 0x99, 0x00, 0x03, 0x0A, 0x31, 0x50, 0x0C, 0xB1, 0x82, 0x80,
|
||||
0x03, 0x28, 0x06, 0x00, 0x87, 0x88, 0x2A, 0xA0, 0x01, 0x05, 0xC2, 0x00, 0x85, 0x82, 0xC2, 0x80, 0x10, 0x00, 0x39,
|
||||
0x10, 0x08, 0x51, 0xBF, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x48, 0x9D,
|
||||
0xCC, 0x40, 0xC9, 0xE6, 0x7F, 0x40, 0x40, 0x00, 0x94, 0x00, 0x5B, 0x21, 0x0C, 0xB0, 0x48, 0xAE, 0xCC, 0x40, 0xE1,
|
||||
0x30, 0x0C, 0x30, 0x43, 0x01, 0xA4, 0x00, 0xE1, 0x24, 0x5D, 0x30, 0x78, 0x8C, 0xD6, 0x10, 0xF1, 0x60, 0x94, 0x70,
|
||||
0xD0, 0x40, 0x9C, 0x70, 0x0B, 0x8C, 0x53, 0x00, 0x0C, 0x9D, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x01, 0x39, 0x50, 0x00, 0x00, 0x88, 0xF0, 0x00, 0x2E, 0xAF, 0xC6, 0x00, 0x03, 0x01, 0x77, 0x60, 0x04, 0xF0,
|
||||
0x41, 0x60, 0x03, 0x92, 0xF8, 0x12, 0x0F, 0xBD, 0x91, 0x40, 0x1B, 0x28, 0x60, 0x92, 0x70, 0xF4, 0x01, 0xF0, 0x0A,
|
||||
0xD4, 0x65, 0x82, 0x53, 0xE0, 0x01, 0xE0, 0x04, 0x10, 0x68, 0x60, 0x04, 0x2A, 0xBE, 0x00, 0x00, 0x4F, 0x80, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3A, 0xEE, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0D, 0x84, 0xA5,
|
||||
0x00, 0xC1, 0xC2, 0x11, 0x00, 0x45, 0x0E, 0x27, 0x00, 0xD9, 0xC3, 0x00, 0x10, 0x07, 0xF8, 0x8D, 0x20, 0x01, 0x30,
|
||||
0x00, 0x10, 0xAC, 0x02, 0x25, 0xA0, 0x01, 0x22, 0x00, 0x10, 0x44, 0x20, 0x16, 0xA0, 0x13, 0x02, 0x00, 0x30, 0x04,
|
||||
0x1B, 0xAA, 0x40, 0x21, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
};
|
||||
|
||||
#define gDPSetPrimColorMod(pkt, m, l, rgba) \
|
||||
_DW({ \
|
||||
Gfx *_g = (Gfx *)(pkt); \
|
||||
\
|
||||
_g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | \
|
||||
_SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8)); \
|
||||
_g->words.w1 = (rgba); \
|
||||
})
|
||||
#define gDPSetPrimColorMod(pkt, m, l, rgba) \
|
||||
_DW({ \
|
||||
Gfx* _g = (Gfx*)(pkt); \
|
||||
\
|
||||
_g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | _SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8)); \
|
||||
_g->words.w1 = (rgba); \
|
||||
})
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc and minor ordering differences
|
||||
void GfxPrint_InitDlist(GfxPrint* this)
|
||||
{
|
||||
void GfxPrint_InitDlist(GfxPrint* this) {
|
||||
s32 width = 16;
|
||||
s32 height = 256;
|
||||
s32 i;
|
||||
|
||||
gDPPipeSync(this->dlist++);
|
||||
gDPSetOtherMode(this->dlist++,
|
||||
G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP |
|
||||
G_TT_IA16 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_IA16 | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2);
|
||||
gDPSetCombineLERP(this->dlist++,
|
||||
0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0,
|
||||
0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0);
|
||||
gDPSetCombineLERP(this->dlist++, 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0);
|
||||
|
||||
gDPSetTextureImage(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b_LOAD_BLOCK, 1, sGfxPrintFontData);
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b_LOAD_BLOCK,
|
||||
0, 0, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPLoadSync(this->dlist++);
|
||||
gDPLoadBlock(this->dlist++, G_TX_LOADTILE, 0, 0,
|
||||
(((width)*(height) + G_IM_SIZ_4b_INCR) >> G_IM_SIZ_4b_SHIFT) - 1,
|
||||
CALC_DXT(width, G_IM_SIZ_4b_BYTES));
|
||||
gDPLoadBlock(this->dlist++, G_TX_LOADTILE, 0, 0, (((width) * (height) + G_IM_SIZ_4b_INCR) >> G_IM_SIZ_4b_SHIFT) - 1,
|
||||
CALC_DXT(width, G_IM_SIZ_4b_BYTES));
|
||||
gDPPipeSync(this->dlist++);
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b,
|
||||
1, 0, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPSetTileSize(this->dlist++, G_TX_RENDERTILE, 0, 0,
|
||||
((width)-1) << G_TEXTURE_IMAGE_FRAC,
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPSetTileSize(this->dlist++, G_TX_RENDERTILE, 0, 0, ((width)-1) << G_TEXTURE_IMAGE_FRAC,
|
||||
((height)-1) << G_TEXTURE_IMAGE_FRAC);
|
||||
|
||||
gDPLoadTLUT(this->dlist++, 64, 256, sGfxPrintFontTLUT);
|
||||
|
||||
for (i = 1; i < 4; i++)
|
||||
{
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b,
|
||||
1, 0, i * 2, i,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
for (i = 1; i < 4; i++) {
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, i * 2, i, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPSetTileSize(this->dlist++, i * 2, 0, 0, 60, 1020);
|
||||
}
|
||||
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color);
|
||||
|
||||
gDPSetTextureImage(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, sGfxPrintUnkData);
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b,
|
||||
1, 0, G_TX_LOADTILE, 0 ,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, 3,
|
||||
G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
|
||||
gDPLoadSync(this->dlist++);
|
||||
gDPLoadTile(this->dlist++, G_TX_LOADTILE, 0, 0, 2, 28);
|
||||
gDPPipeSync(this->dlist++);
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b,
|
||||
1, 0, 1, 4,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD,
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 1, 4, G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
|
||||
gDPSetTileSize(this->dlist++, 1, 0, 0, 4, 28);
|
||||
|
||||
gDPLoadTLUT(this->dlist++, 16, 320, sGfxPrintUnkTLUT);
|
||||
|
||||
for (i = 1; i < 4; i++)
|
||||
{
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b,
|
||||
1, 0, i * 2 + 1, 4,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
|
||||
for (i = 1; i < 4; i++) {
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, i * 2 + 1, 4, G_TX_NOMIRROR | G_TX_WRAP, 3,
|
||||
G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
|
||||
gDPSetTileSize(this->dlist++, i * 2 + 1, 0, 0, 4, 28);
|
||||
}
|
||||
}
|
||||
@@ -190,8 +198,7 @@ void GfxPrint_InitDlist(GfxPrint* this)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/gfxprint/GfxPrint_InitDlist.s")
|
||||
#endif
|
||||
|
||||
void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a)
|
||||
{
|
||||
void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a) {
|
||||
this->color.r = r;
|
||||
this->color.g = g;
|
||||
this->color.b = b;
|
||||
@@ -200,89 +207,61 @@ void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a)
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color);
|
||||
}
|
||||
|
||||
|
||||
void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y)
|
||||
{
|
||||
void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y) {
|
||||
this->posX = this->baseX + (x << 2);
|
||||
this->posY = this->baseY + (y << 2);
|
||||
}
|
||||
|
||||
void GfxPrint_SetPos(GfxPrint* this, s32 x, s32 y)
|
||||
{
|
||||
void GfxPrint_SetPos(GfxPrint* this, s32 x, s32 y) {
|
||||
GfxPrint_SetPosPx(this, x << 3, y << 3);
|
||||
}
|
||||
|
||||
void GfxPrint_SetBasePosPx(GfxPrint* this, s32 x, s32 y)
|
||||
{
|
||||
void GfxPrint_SetBasePosPx(GfxPrint* this, s32 x, s32 y) {
|
||||
this->baseX = x << 2;
|
||||
this->baseY = y << 2;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc and ordering differences
|
||||
void GfxPrint_PrintCharImpl(GfxPrint* this, char c)
|
||||
{
|
||||
if (this->flag & GFXPRINT_UPDATE_MODE)
|
||||
{
|
||||
void GfxPrint_PrintCharImpl(GfxPrint* this, char c) {
|
||||
if (this->flag & GFXPRINT_UPDATE_MODE) {
|
||||
this->flag &= ~GFXPRINT_UPDATE_MODE;
|
||||
|
||||
gDPPipeSync(this->dlist++);
|
||||
if (this->flag & GFXPRINT_USE_RGBA16)
|
||||
{
|
||||
if (this->flag & GFXPRINT_USE_RGBA16) {
|
||||
gDPSetTextureLUT(this->dlist++, G_TT_RGBA16);
|
||||
gDPSetCycleType(this->dlist++, G_CYC_2CYCLE);
|
||||
gDPSetRenderMode(this->dlist++, G_RM_OPA_CI, G_RM_XLU_SURF2);
|
||||
gDPSetCombineLERP(this->dlist++,
|
||||
TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0,
|
||||
0, 0, 0, COMBINED, 0, 0, 0, COMBINED);
|
||||
}
|
||||
else
|
||||
{
|
||||
gDPSetCombineLERP(this->dlist++, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0,
|
||||
COMBINED);
|
||||
} else {
|
||||
gDPSetTextureLUT(this->dlist++, G_TT_IA16);
|
||||
gDPSetCycleType(this->dlist++, G_CYC_1CYCLE);
|
||||
gDPSetRenderMode(this->dlist++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
|
||||
gDPSetCombineLERP(this->dlist++,
|
||||
TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0,
|
||||
TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0);
|
||||
gDPSetCombineLERP(this->dlist++, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0,
|
||||
TEXEL0);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->flag & GFXPRINT_FLAG4)
|
||||
{
|
||||
if (this->flag & GFXPRINT_FLAG4) {
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, 0);
|
||||
|
||||
if (this->flag & GFXPRINT_FLAG64)
|
||||
gSPTextureRectangle(this->dlist++,
|
||||
(this->posX + 4) << 1, (this->posY + 4) << 1,
|
||||
(this->posX + 4 + 32) << 1, (this->posY + 4 + 32) << 1,
|
||||
c * 2,
|
||||
(u16)(c & 4) * 64, (u16)(c >> 3) * 256,
|
||||
512, 512);
|
||||
gSPTextureRectangle(this->dlist++, (this->posX + 4) << 1, (this->posY + 4) << 1, (this->posX + 4 + 32) << 1,
|
||||
(this->posY + 4 + 32) << 1, c * 2, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 512, 512);
|
||||
else
|
||||
gSPTextureRectangle(this->dlist++,
|
||||
this->posX + 4, this->posY + 4,
|
||||
this->posX + 4 + 32, this->posY + 4 + 32,
|
||||
c * 2,
|
||||
(u16)(c & 4) * 64, (u16)(c >> 3) * 256,
|
||||
1024, 1024);
|
||||
gSPTextureRectangle(this->dlist++, this->posX + 4, this->posY + 4, this->posX + 4 + 32, this->posY + 4 + 32,
|
||||
c * 2, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1024, 1024);
|
||||
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color);
|
||||
}
|
||||
|
||||
if (this->flag & GFXPRINT_FLAG64)
|
||||
gSPTextureRectangle(this->dlist++,
|
||||
(this->posX) << 1, (this->posY) << 1,
|
||||
(this->posX + 32) << 1, (this->posY + 32) << 1,
|
||||
c * 2,
|
||||
(u16)(c & 4) * 64, (u16)(c >> 3) * 256,
|
||||
512, 512);
|
||||
gSPTextureRectangle(this->dlist++, (this->posX) << 1, (this->posY) << 1, (this->posX + 32) << 1,
|
||||
(this->posY + 32) << 1, c * 2, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 512, 512);
|
||||
else
|
||||
gSPTextureRectangle(this->dlist++,
|
||||
this->posX, this->posY,
|
||||
this->posX + 32, this->posY + 32,
|
||||
c * 2,
|
||||
(u16)(c & 4) * 64, (u16)(c >> 3) * 256,
|
||||
1024, 1024);
|
||||
gSPTextureRectangle(this->dlist++, this->posX, this->posY, this->posX + 32, this->posY + 32, c * 2,
|
||||
(u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1024, 1024);
|
||||
|
||||
this->posX += 32;
|
||||
}
|
||||
@@ -290,33 +269,24 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, char c)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/gfxprint/GfxPrint_PrintCharImpl.s")
|
||||
#endif
|
||||
|
||||
void GfxPrint_PrintChar(GfxPrint* this, u8 c)
|
||||
{
|
||||
void GfxPrint_PrintChar(GfxPrint* this, u8 c) {
|
||||
u8 charParam = c;
|
||||
|
||||
if (c == ' ')
|
||||
{
|
||||
if (c == ' ') {
|
||||
this->posX += 0x20;
|
||||
}
|
||||
else if (c > 0x20 && c < 0x7F)
|
||||
{
|
||||
} else if (c > 0x20 && c < 0x7F) {
|
||||
GfxPrint_PrintCharImpl(this, charParam);
|
||||
}
|
||||
else if (c >= 0xA0 && c < 0xE0)
|
||||
{
|
||||
if (this->flag & GFXPRINT_FLAG1)
|
||||
{
|
||||
if (c < 0xC0)
|
||||
} else if (c >= 0xA0 && c < 0xE0) {
|
||||
if (this->flag & GFXPRINT_FLAG1) {
|
||||
if (c < 0xC0) {
|
||||
charParam = c - 0x20;
|
||||
else
|
||||
} else {
|
||||
charParam = c + 0x20;
|
||||
}
|
||||
}
|
||||
GfxPrint_PrintCharImpl(this, charParam);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
} else {
|
||||
switch (c) {
|
||||
case 0:
|
||||
break;
|
||||
case '\n':
|
||||
@@ -325,8 +295,7 @@ void GfxPrint_PrintChar(GfxPrint* this, u8 c)
|
||||
this->posX = this->baseX;
|
||||
break;
|
||||
case '\t':
|
||||
do
|
||||
{
|
||||
do {
|
||||
GfxPrint_PrintCharImpl(this, 0x20);
|
||||
} while ((this->posX - this->baseX) % 256);
|
||||
break;
|
||||
@@ -351,32 +320,28 @@ void GfxPrint_PrintChar(GfxPrint* this, u8 c)
|
||||
}
|
||||
}
|
||||
|
||||
void GfxPrint_PrintStringWithSize(GfxPrint* this, const void* buffer, size_t charSize, size_t charCount)
|
||||
{
|
||||
void GfxPrint_PrintStringWithSize(GfxPrint* this, const void* buffer, size_t charSize, size_t charCount) {
|
||||
const char* str = (const char*)buffer;
|
||||
size_t count = charSize * charCount;
|
||||
|
||||
while (count)
|
||||
{
|
||||
while (count) {
|
||||
GfxPrint_PrintChar(this, *str++);
|
||||
count--;
|
||||
}
|
||||
}
|
||||
|
||||
void GfxPrint_PrintString(GfxPrint* this, const char* str)
|
||||
{
|
||||
while (*str)
|
||||
void GfxPrint_PrintString(GfxPrint* this, const char* str) {
|
||||
while (*str) {
|
||||
GfxPrint_PrintChar(this, *(str++));
|
||||
}
|
||||
}
|
||||
|
||||
GfxPrint* GfxPrint_Callback(GfxPrint* this, const char* str, size_t size)
|
||||
{
|
||||
GfxPrint* GfxPrint_Callback(GfxPrint* this, const char* str, size_t size) {
|
||||
GfxPrint_PrintStringWithSize(this, str, sizeof(char), size);
|
||||
return this;
|
||||
}
|
||||
|
||||
void GfxPrint_Ctor(GfxPrint* this)
|
||||
{
|
||||
void GfxPrint_Ctor(GfxPrint* this) {
|
||||
this->flag &= ~GFXPRINT_OPEN;
|
||||
|
||||
this->callback = &GfxPrint_Callback;
|
||||
@@ -392,31 +357,27 @@ void GfxPrint_Ctor(GfxPrint* this)
|
||||
this->flag |= GFXPRINT_FLAG4;
|
||||
this->flag |= GFXPRINT_UPDATE_MODE;
|
||||
|
||||
if ((D_801755F0 & GFXPRINT_FLAG64))
|
||||
if ((D_801755F0 & GFXPRINT_FLAG64)) {
|
||||
this->flag |= GFXPRINT_FLAG64; //? dsdx/dtdy
|
||||
else
|
||||
} else {
|
||||
this->flag &= ~GFXPRINT_FLAG64;
|
||||
}
|
||||
}
|
||||
|
||||
void GfxPrint_Dtor(GfxPrint* this)
|
||||
{
|
||||
|
||||
void GfxPrint_Dtor(GfxPrint* this) {
|
||||
}
|
||||
|
||||
void GfxPrint_Open(GfxPrint* this, Gfx* dlist)
|
||||
{
|
||||
if (!(this->flag & GFXPRINT_OPEN))
|
||||
{
|
||||
void GfxPrint_Open(GfxPrint* this, Gfx* dlist) {
|
||||
if (!(this->flag & GFXPRINT_OPEN)) {
|
||||
this->flag |= GFXPRINT_OPEN;
|
||||
this->dlist = dlist;
|
||||
GfxPrint_InitDlist(this);
|
||||
}
|
||||
else
|
||||
} else {
|
||||
osSyncPrintf("gfxprint_open:2重オープンです\n");
|
||||
}
|
||||
}
|
||||
|
||||
Gfx* GfxPrint_Close(GfxPrint* this)
|
||||
{
|
||||
Gfx* GfxPrint_Close(GfxPrint* this) {
|
||||
Gfx* ret;
|
||||
|
||||
this->flag &= ~GFXPRINT_OPEN;
|
||||
@@ -426,13 +387,11 @@ Gfx* GfxPrint_Close(GfxPrint* this)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void GfxPrint_VPrintf(GfxPrint *this, const char *fmt, va_list args)
|
||||
{
|
||||
void GfxPrint_VPrintf(GfxPrint* this, const char* fmt, va_list args) {
|
||||
func_800FF340(&this->callback, fmt, args);
|
||||
}
|
||||
|
||||
void GfxPrint_Printf(GfxPrint* this, const char* fmt, ...)
|
||||
{
|
||||
void GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
|
||||
+81
-92
@@ -6,18 +6,17 @@ volatile OSTime sIrqMgrResetTime = 0;
|
||||
volatile OSTime sIrqMgrRetraceTime = 0;
|
||||
u32 sIrqMgrRetraceCount = 0;
|
||||
|
||||
#define RETRACE_MSG 666
|
||||
#define PRE_NMI_MSG 669
|
||||
#define PRENMI450_MSG 671
|
||||
#define PRENMI480_MSG 672
|
||||
#define PRENMI500_MSG 673
|
||||
#define RETRACE_MSG 666
|
||||
#define PRE_NMI_MSG 669
|
||||
#define PRENMI450_MSG 671
|
||||
#define PRENMI480_MSG 672
|
||||
#define PRENMI500_MSG 673
|
||||
|
||||
#define STATUS_IDLE 0
|
||||
#define STATUS_PRENMI 1
|
||||
#define STATUS_NMI 2
|
||||
#define STATUS_IDLE 0
|
||||
#define STATUS_PRENMI 1
|
||||
#define STATUS_NMI 2
|
||||
|
||||
void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ)
|
||||
{
|
||||
void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ) {
|
||||
u32 prevMask;
|
||||
|
||||
LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 96);
|
||||
@@ -32,15 +31,16 @@ void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ)
|
||||
|
||||
osSetIntMask(prevMask);
|
||||
|
||||
if (this->resetStatus > STATUS_IDLE)
|
||||
osSendMesg(c->queue, (OSMesg)&this->prenmiMsg, OS_MESG_NOBLOCK);
|
||||
if (this->resetStatus > STATUS_IDLE) {
|
||||
osSendMesg(c->queue, (OSMesg) & this->prenmiMsg, OS_MESG_NOBLOCK);
|
||||
}
|
||||
|
||||
if (this->resetStatus >= STATUS_NMI)
|
||||
osSendMesg(c->queue, (OSMesg)&this->nmiMsg, OS_MESG_NOBLOCK);
|
||||
if (this->resetStatus >= STATUS_NMI) {
|
||||
osSendMesg(c->queue, (OSMesg) & this->nmiMsg, OS_MESG_NOBLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c)
|
||||
{
|
||||
void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c) {
|
||||
IrqMgrClient* iter;
|
||||
IrqMgrClient* lastIter;
|
||||
u32 prevMask;
|
||||
@@ -50,17 +50,16 @@ void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c)
|
||||
|
||||
LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 129);
|
||||
LogUtils_CheckNullPointer("c", c, "../irqmgr.c", 130);
|
||||
|
||||
|
||||
prevMask = osSetIntMask(1);
|
||||
|
||||
while (iter)
|
||||
{
|
||||
if (iter == c)
|
||||
{
|
||||
if (lastIter)
|
||||
while (iter) {
|
||||
if (iter == c) {
|
||||
if (lastIter) {
|
||||
lastIter->prev = c->prev;
|
||||
else
|
||||
} else {
|
||||
this->clients = c->prev;
|
||||
}
|
||||
break;
|
||||
}
|
||||
lastIter = iter;
|
||||
@@ -70,160 +69,150 @@ void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c)
|
||||
osSetIntMask(prevMask);
|
||||
}
|
||||
|
||||
void IrqMgr_SendMesgForClient(IrqMgr* this, OSMesg msg)
|
||||
{
|
||||
void IrqMgr_SendMesgForClient(IrqMgr* this, OSMesg msg) {
|
||||
IrqMgrClient* iter;
|
||||
|
||||
iter = this->clients;
|
||||
while(iter)
|
||||
{
|
||||
if (iter->queue->validCount >= iter->queue->msgCount)
|
||||
//irqmgr_SendMesgForClient: Message queue is overflowing mq=%08x cnt=%d
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "irqmgr_SendMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST, iter->queue, iter->queue->validCount);
|
||||
else
|
||||
while (iter) {
|
||||
if (iter->queue->validCount >= iter->queue->msgCount) {
|
||||
// irqmgr_SendMesgForClient: Message queue is overflowing mq=%08x cnt=%d
|
||||
osSyncPrintf(
|
||||
VT_COL(RED, WHITE) "irqmgr_SendMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST,
|
||||
iter->queue, iter->queue->validCount);
|
||||
} else {
|
||||
osSendMesg(iter->queue, msg, OS_MESG_NOBLOCK);
|
||||
|
||||
}
|
||||
|
||||
iter = iter->prev;
|
||||
}
|
||||
}
|
||||
|
||||
void IrqMgr_JamMesgForClient(IrqMgr* this, OSMesg msg)
|
||||
{
|
||||
void IrqMgr_JamMesgForClient(IrqMgr* this, OSMesg msg) {
|
||||
IrqMgrClient* iter;
|
||||
|
||||
iter = this->clients;
|
||||
while(iter)
|
||||
{
|
||||
if (iter->queue->validCount >= iter->queue->msgCount)
|
||||
//irqmgr_JamMesgForClient: Message queue is overflowing mq=%08x cnt=%d
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "irqmgr_JamMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST, iter->queue, iter->queue->validCount);
|
||||
else
|
||||
//mistake? the function's name suggests it would use osJamMesg
|
||||
while (iter) {
|
||||
if (iter->queue->validCount >= iter->queue->msgCount) {
|
||||
// irqmgr_JamMesgForClient: Message queue is overflowing mq=%08x cnt=%d
|
||||
osSyncPrintf(
|
||||
VT_COL(RED, WHITE) "irqmgr_JamMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST,
|
||||
iter->queue, iter->queue->validCount);
|
||||
} else {
|
||||
// mistake? the function's name suggests it would use osJamMesg
|
||||
osSendMesg(iter->queue, msg, OS_MESG_NOBLOCK);
|
||||
|
||||
}
|
||||
|
||||
iter = iter->prev;
|
||||
}
|
||||
}
|
||||
|
||||
void IrqMgr_HandlePreNMI(IrqMgr *this)
|
||||
{
|
||||
u64 temp = STATUS_PRENMI; //required to match
|
||||
void IrqMgr_HandlePreNMI(IrqMgr* this) {
|
||||
u64 temp = STATUS_PRENMI; // required to match
|
||||
gIrqMgrResetStatus = temp;
|
||||
this->resetStatus = STATUS_PRENMI;
|
||||
|
||||
sIrqMgrResetTime = this->resetTime = osGetTime();
|
||||
osSetTimer(&this->timer, OS_USEC_TO_CYCLES(450000), 0ull, &this->queue, (OSMesg)PRENMI450_MSG);
|
||||
IrqMgr_JamMesgForClient(this, (OSMesg)&this->prenmiMsg);
|
||||
IrqMgr_JamMesgForClient(this, (OSMesg) & this->prenmiMsg);
|
||||
}
|
||||
|
||||
void IrqMgr_CheckStack()
|
||||
{
|
||||
osSyncPrintf("irqmgr.c: PRENMIから0.5秒経過\n"); //0.5 seconds after PRENMI
|
||||
if (StackCheck_Check(NULL) == 0)
|
||||
{
|
||||
osSyncPrintf("スタックは大丈夫みたいです\n"); //The stack looks ok
|
||||
}
|
||||
else
|
||||
{
|
||||
void IrqMgr_CheckStack() {
|
||||
osSyncPrintf("irqmgr.c: PRENMIから0.5秒経過\n"); // 0.5 seconds after PRENMI
|
||||
if (StackCheck_Check(NULL) == 0) {
|
||||
osSyncPrintf("スタックは大丈夫みたいです\n"); // The stack looks ok
|
||||
} else {
|
||||
osSyncPrintf("%c", 7);
|
||||
osSyncPrintf(VT_FGCOL(RED));
|
||||
osSyncPrintf("スタックがオーバーフローしたか危険な状態です\n"); //Stack overflow or dangerous
|
||||
osSyncPrintf("早々にスタックサイズを増やすか、スタックを消費しないようにしてください\n"); //Increase stack size early or don't consume stack
|
||||
osSyncPrintf("スタックがオーバーフローしたか危険な状態です\n"); // Stack overflow or dangerous
|
||||
osSyncPrintf(
|
||||
"早々にスタックサイズを増やすか、スタックを消費しないようにしてください\n"); // Increase stack size early or
|
||||
// don't consume stack
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
}
|
||||
|
||||
void IrqMgr_HandlePRENMI450(IrqMgr* this)
|
||||
{
|
||||
u64 temp = STATUS_NMI; //required to match
|
||||
void IrqMgr_HandlePRENMI450(IrqMgr* this) {
|
||||
u64 temp = STATUS_NMI; // required to match
|
||||
gIrqMgrResetStatus = temp;
|
||||
this->resetStatus = STATUS_NMI;
|
||||
osSetTimer(&this->timer, OS_USEC_TO_CYCLES(30000), 0ull, &this->queue, (OSMesg)PRENMI480_MSG);
|
||||
IrqMgr_SendMesgForClient(this, (OSMesg)&this->nmiMsg);
|
||||
IrqMgr_SendMesgForClient(this, (OSMesg) & this->nmiMsg);
|
||||
}
|
||||
|
||||
void IrqMgr_HandlePRENMI480(IrqMgr* this)
|
||||
{
|
||||
void IrqMgr_HandlePRENMI480(IrqMgr* this) {
|
||||
u32 ret;
|
||||
osSetTimer(&this->timer, OS_USEC_TO_CYCLES(20000), 0ull, &this->queue, (OSMesg)PRENMI500_MSG);
|
||||
ret = func_801031F0(); //osAfterPreNMI
|
||||
if (ret)
|
||||
{
|
||||
osSyncPrintf("osAfterPreNMIが %d を返しました!?\n", ret); //osAfterPreNMI returned %d !?
|
||||
ret = func_801031F0(); // osAfterPreNMI
|
||||
if (ret) {
|
||||
osSyncPrintf("osAfterPreNMIが %d を返しました!?\n", ret); // osAfterPreNMI returned %d !?
|
||||
osSetTimer(&this->timer, OS_USEC_TO_CYCLES(1000), 0ull, &this->queue, (OSMesg)PRENMI480_MSG);
|
||||
}
|
||||
}
|
||||
|
||||
void IrqMgr_HandlePRENMI500(IrqMgr* this)
|
||||
{
|
||||
void IrqMgr_HandlePRENMI500(IrqMgr* this) {
|
||||
IrqMgr_CheckStack();
|
||||
}
|
||||
|
||||
void IrqMgr_HandleRetrace(IrqMgr* this)
|
||||
{
|
||||
if (sIrqMgrRetraceTime == 0ull)
|
||||
{
|
||||
if (this->retraceTime == 0)
|
||||
void IrqMgr_HandleRetrace(IrqMgr* this) {
|
||||
if (sIrqMgrRetraceTime == 0ull) {
|
||||
if (this->retraceTime == 0) {
|
||||
this->retraceTime = osGetTime();
|
||||
else
|
||||
} else {
|
||||
sIrqMgrRetraceTime = osGetTime() - this->retraceTime;
|
||||
}
|
||||
}
|
||||
sIrqMgrRetraceCount++;
|
||||
IrqMgr_SendMesgForClient(this, (OSMesg)&this->retraceMsg);
|
||||
IrqMgr_SendMesgForClient(this, (OSMesg) & this->retraceMsg);
|
||||
}
|
||||
|
||||
void IrqMgr_ThreadEntry(void* arg0)
|
||||
{
|
||||
void IrqMgr_ThreadEntry(void* arg0) {
|
||||
OSMesg msg;
|
||||
IrqMgr* this;
|
||||
u8 exit;
|
||||
|
||||
this = (IrqMgr*)arg0;
|
||||
msg = 0;
|
||||
osSyncPrintf("IRQマネージャスレッド実行開始\n"); //Start IRQ manager thread execution
|
||||
osSyncPrintf("IRQマネージャスレッド実行開始\n"); // Start IRQ manager thread execution
|
||||
exit = false;
|
||||
|
||||
while (!exit)
|
||||
{
|
||||
while (!exit) {
|
||||
osRecvMesg(&this->queue, &msg, OS_MESG_BLOCK);
|
||||
switch ((u32)msg)
|
||||
{
|
||||
switch ((u32)msg) {
|
||||
case RETRACE_MSG:
|
||||
IrqMgr_HandleRetrace(this);
|
||||
break;
|
||||
case PRE_NMI_MSG:
|
||||
osSyncPrintf("PRE_NMI_MSG\n");
|
||||
osSyncPrintf("スケジューラ:PRE_NMIメッセージを受信\n"); //Scheduler: Receives PRE_NMI message
|
||||
osSyncPrintf("スケジューラ:PRE_NMIメッセージを受信\n"); // Scheduler: Receives PRE_NMI message
|
||||
IrqMgr_HandlePreNMI(this);
|
||||
break;
|
||||
case PRENMI450_MSG:
|
||||
osSyncPrintf("PRENMI450_MSG\n");
|
||||
osSyncPrintf("スケジューラ:PRENMI450メッセージを受信\n"); //Scheduler: Receives PRENMI450 message
|
||||
osSyncPrintf("スケジューラ:PRENMI450メッセージを受信\n"); // Scheduler: Receives PRENMI450 message
|
||||
IrqMgr_HandlePRENMI450(this);
|
||||
break;
|
||||
case PRENMI480_MSG:
|
||||
osSyncPrintf("PRENMI480_MSG\n");
|
||||
osSyncPrintf("スケジューラ:PRENMI480メッセージを受信\n"); //Scheduler: Receives PRENMI480 message
|
||||
osSyncPrintf("スケジューラ:PRENMI480メッセージを受信\n"); // Scheduler: Receives PRENMI480 message
|
||||
IrqMgr_HandlePRENMI480(this);
|
||||
break;
|
||||
case PRENMI500_MSG:
|
||||
osSyncPrintf("PRENMI500_MSG\n");
|
||||
osSyncPrintf("スケジューラ:PRENMI500メッセージを受信\n"); //Scheduler: Receives PRENMI500 message
|
||||
osSyncPrintf("スケジューラ:PRENMI500メッセージを受信\n"); // Scheduler: Receives PRENMI500 message
|
||||
exit = true;
|
||||
IrqMgr_HandlePRENMI500(this);
|
||||
break;
|
||||
default:
|
||||
osSyncPrintf("irqmgr.c:予期しないメッセージを受け取りました(%08x)\n", msg); //Unexpected message received
|
||||
osSyncPrintf("irqmgr.c:予期しないメッセージを受け取りました(%08x)\n",
|
||||
msg); // Unexpected message received
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
osSyncPrintf("IRQマネージャスレッド実行終了\n"); //End of IRQ manager thread execution
|
||||
osSyncPrintf("IRQマネージャスレッド実行終了\n"); // End of IRQ manager thread execution
|
||||
}
|
||||
|
||||
void IrqMgr_Create(IrqMgr* this, void* stack, OSPri pri, u8 retraceCount)
|
||||
{
|
||||
void IrqMgr_Create(IrqMgr* this, void* stack, OSPri pri, u8 retraceCount) {
|
||||
LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 346);
|
||||
LogUtils_CheckNullPointer("stack", stack, "../irqmgr.c", 347);
|
||||
this->clients = NULL;
|
||||
|
||||
+21
-19
@@ -1,64 +1,66 @@
|
||||
#include <global.h>
|
||||
|
||||
ListAlloc* ListAlloc_Init(ListAlloc* this)
|
||||
{
|
||||
ListAlloc* ListAlloc_Init(ListAlloc* this) {
|
||||
this->prev = NULL;
|
||||
this->next = NULL;
|
||||
return this;
|
||||
}
|
||||
|
||||
void* ListAlloc_Alloc(ListAlloc* this, u32 size)
|
||||
{
|
||||
void* ListAlloc_Alloc(ListAlloc* this, u32 size) {
|
||||
ListAlloc* ptr;
|
||||
ListAlloc* next;
|
||||
|
||||
|
||||
ptr = SystemArena_MallocDebug(size + sizeof(ListAlloc), "../listalloc.c", 40);
|
||||
if (!ptr)
|
||||
if (!ptr) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
next = this->next;
|
||||
|
||||
if (next)
|
||||
if (next) {
|
||||
next->next = ptr;
|
||||
|
||||
}
|
||||
|
||||
ptr->prev = next;
|
||||
ptr->next = NULL;
|
||||
this->next = ptr;
|
||||
|
||||
if (!this->prev)
|
||||
if (!this->prev) {
|
||||
this->prev = ptr;
|
||||
}
|
||||
|
||||
return (u8*)ptr + sizeof(ListAlloc);
|
||||
}
|
||||
|
||||
void ListAlloc_Free(ListAlloc* this, void* data)
|
||||
{
|
||||
void ListAlloc_Free(ListAlloc* this, void* data) {
|
||||
ListAlloc* ptr;
|
||||
|
||||
ptr = &((ListAlloc*)data)[-1];
|
||||
|
||||
if (ptr->prev)
|
||||
if (ptr->prev) {
|
||||
ptr->prev->next = ptr->next;
|
||||
}
|
||||
|
||||
if (ptr->next)
|
||||
if (ptr->next) {
|
||||
ptr->next->prev = ptr->prev;
|
||||
}
|
||||
|
||||
if (this->prev == ptr)
|
||||
if (this->prev == ptr) {
|
||||
this->prev = ptr->next;
|
||||
}
|
||||
|
||||
if (this->next == ptr)
|
||||
if (this->next == ptr) {
|
||||
this->next = ptr->prev;
|
||||
}
|
||||
|
||||
SystemArena_FreeDebug(ptr, "../listalloc.c", 72);
|
||||
}
|
||||
|
||||
void ListAlloc_FreeAll(ListAlloc* this)
|
||||
{
|
||||
void ListAlloc_FreeAll(ListAlloc* this) {
|
||||
ListAlloc* iter;
|
||||
|
||||
iter = this->prev;
|
||||
while (iter)
|
||||
{
|
||||
while (iter) {
|
||||
ListAlloc_Free(this, (u8*)iter + sizeof(ListAlloc));
|
||||
iter = this->prev;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
#include <global.h>
|
||||
|
||||
void *Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd)
|
||||
{
|
||||
void *allocatedVRamAddr;
|
||||
void* Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd) {
|
||||
void* allocatedVRamAddr;
|
||||
|
||||
allocatedVRamAddr = SystemArena_MallocRDebug((s32)vRamEnd - (s32)vRamStart, "../loadfragment2.c", 31);
|
||||
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
osSyncPrintf("OVL:SPEC(%08x-%08x) REAL(%08x-%08x) OFFSET(%08x)\n", vRamStart, vRamEnd, allocatedVRamAddr, ((u32)vRamEnd - (u32)vRamStart) + (u32)allocatedVRamAddr, (u32)vRamStart - (u32)allocatedVRamAddr);
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
osSyncPrintf("OVL:SPEC(%08x-%08x) REAL(%08x-%08x) OFFSET(%08x)\n", vRamStart, vRamEnd, allocatedVRamAddr,
|
||||
((u32)vRamEnd - (u32)vRamStart) + (u32)allocatedVRamAddr, (u32)vRamStart - (u32)allocatedVRamAddr);
|
||||
}
|
||||
|
||||
if(allocatedVRamAddr != NULL)
|
||||
{
|
||||
if (allocatedVRamAddr != NULL) {
|
||||
Overlay_Load(vRomStart, vRomEnd, vRamStart, vRamEnd, allocatedVRamAddr);
|
||||
}
|
||||
|
||||
return allocatedVRamAddr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#include <global.h>
|
||||
|
||||
s32 gOverlayLogSeverity = 2;
|
||||
s32 gOverlayLogSeverity = 2;
|
||||
|
||||
+28
-34
@@ -23,21 +23,19 @@ StackEntry sSchedStackInfo;
|
||||
StackEntry sAudioStackInfo;
|
||||
StackEntry sPadMgrStackInfo;
|
||||
StackEntry sIrqMgrStackInfo;
|
||||
u8 gAudioMgr[0x298]; //type should be AudioMgr
|
||||
u8 gAudioMgr[0x298]; // type should be AudioMgr
|
||||
OSMesgQueue sSiIntMsgQ;
|
||||
OSMesg sSiIntMsgBuf[1];
|
||||
|
||||
|
||||
void Main_LogSystemHeap()
|
||||
{
|
||||
void Main_LogSystemHeap() {
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
//System heap size% 08x (% dKB) Start address% 08x
|
||||
osSyncPrintf("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", gSystemHeapSize, gSystemHeapSize / 1024, gSystemHeap);
|
||||
// System heap size% 08x (% dKB) Start address% 08x
|
||||
osSyncPrintf("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", gSystemHeapSize, gSystemHeapSize / 1024,
|
||||
gSystemHeap);
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
|
||||
void Main(void* arg0)
|
||||
{
|
||||
void Main(void* arg0) {
|
||||
IrqMgrClient irqClient;
|
||||
OSMesgQueue irqMgrMsgQ;
|
||||
OSMesg irqMgrMsgBuf[60];
|
||||
@@ -45,9 +43,9 @@ void Main(void* arg0)
|
||||
u32 fb;
|
||||
s32 debugHeap;
|
||||
s32 debugHeapSize;
|
||||
s16 *msg;
|
||||
s16* msg;
|
||||
|
||||
osSyncPrintf("mainproc 実行開始\n"); //Start running
|
||||
osSyncPrintf("mainproc 実行開始\n"); // Start running
|
||||
gScreenWidth = SCREEN_WIDTH;
|
||||
gScreenHeight = SCREEN_HEIGHT;
|
||||
gAppNmiBufferPtr = (PreNmiBuff*)osAppNmiBuffer;
|
||||
@@ -57,15 +55,12 @@ void Main(void* arg0)
|
||||
sysHeap = (u32)gSystemHeap;
|
||||
fb = SysCfb_GetFbPtr(0);
|
||||
gSystemHeapSize = (fb - sysHeap);
|
||||
osSyncPrintf("システムヒープ初期化 %08x-%08x %08x\n", sysHeap, fb, gSystemHeapSize); //System heap initalization
|
||||
SystemHeap_Init(sysHeap, gSystemHeapSize); //initializes the system heap
|
||||
if (osMemSize >= 0x800000U)
|
||||
{
|
||||
osSyncPrintf("システムヒープ初期化 %08x-%08x %08x\n", sysHeap, fb, gSystemHeapSize); // System heap initalization
|
||||
SystemHeap_Init(sysHeap, gSystemHeapSize); // initializes the system heap
|
||||
if (osMemSize >= 0x800000U) {
|
||||
debugHeap = SysCfb_GetFbEnd();
|
||||
debugHeapSize = (s32) (0x80600000 - debugHeap);
|
||||
}
|
||||
else
|
||||
{
|
||||
debugHeapSize = (s32)(0x80600000 - debugHeap);
|
||||
} else {
|
||||
debugHeapSize = 0x400;
|
||||
debugHeap = SystemArena_MallocDebug(debugHeapSize, "../main.c", 0x235);
|
||||
}
|
||||
@@ -81,43 +76,42 @@ void Main(void* arg0)
|
||||
Main_LogSystemHeap();
|
||||
|
||||
osCreateMesgQueue(&irqMgrMsgQ, irqMgrMsgBuf, 0x3c);
|
||||
StackCheck_Init(&sIrqMgrStackInfo, sIrqMgrStack, sIrqMgrStack+sizeof(sIrqMgrStack), 0, 0x100, "irqmgr");
|
||||
StackCheck_Init(&sIrqMgrStackInfo, sIrqMgrStack, sIrqMgrStack + sizeof(sIrqMgrStack), 0, 0x100, "irqmgr");
|
||||
IrqMgr_Create(&gIrqMgr, &sGraphStackInfo, 0x11, 1);
|
||||
|
||||
osSyncPrintf("タスクスケジューラの初期化\n"); //Initialize the task scheduler
|
||||
StackCheck_Init(&sSchedStackInfo, sSchedStack, sSchedStack+sizeof(sSchedStack), 0, 0x100, "sched");
|
||||
osSyncPrintf("タスクスケジューラの初期化\n"); // Initialize the task scheduler
|
||||
StackCheck_Init(&sSchedStackInfo, sSchedStack, sSchedStack + sizeof(sSchedStack), 0, 0x100, "sched");
|
||||
func_800C9874(&gSchedContext, &sAudioStack, 0xf, D_80013960, 1, &gIrqMgr);
|
||||
|
||||
IrqMgr_AddClient(&gIrqMgr, &irqClient, &irqMgrMsgQ);
|
||||
|
||||
StackCheck_Init(&sAudioStackInfo, sAudioStack, sAudioStack+sizeof(sAudioStack), 0, 0x100, "audio");
|
||||
func_800C3FEC(&gAudioMgr, sAudioStack+sizeof(sAudioStack), 0xc, 0xa, &gSchedContext, &gIrqMgr);
|
||||
StackCheck_Init(&sAudioStackInfo, sAudioStack, sAudioStack + sizeof(sAudioStack), 0, 0x100, "audio");
|
||||
func_800C3FEC(&gAudioMgr, sAudioStack + sizeof(sAudioStack), 0xc, 0xa, &gSchedContext, &gIrqMgr);
|
||||
|
||||
StackCheck_Init(&sPadMgrStackInfo, sPadMgrStack, sPadMgrStack+sizeof(sPadMgrStack), 0, 0x100, "padmgr");
|
||||
StackCheck_Init(&sPadMgrStackInfo, sPadMgrStack, sPadMgrStack + sizeof(sPadMgrStack), 0, 0x100, "padmgr");
|
||||
PadMgr_Init(&gPadMgr, &sSiIntMsgQ, &gIrqMgr, 7, 0xe, &sIrqMgrStack);
|
||||
|
||||
func_800C3FC4(&gAudioMgr);
|
||||
|
||||
StackCheck_Init(&sGraphStackInfo, sGraphStack, sGraphStack+sizeof(sGraphStack), 0, 0x100, "graph");
|
||||
osCreateThread(&sGraphThread, 4, Graph_ThreadEntry, arg0, sGraphStack+sizeof(sGraphStack), 0xb);
|
||||
StackCheck_Init(&sGraphStackInfo, sGraphStack, sGraphStack + sizeof(sGraphStack), 0, 0x100, "graph");
|
||||
osCreateThread(&sGraphThread, 4, Graph_ThreadEntry, arg0, sGraphStack + sizeof(sGraphStack), 0xb);
|
||||
osStartThread(&sGraphThread);
|
||||
osSetThreadPri(0, 0xf);
|
||||
|
||||
while (true)
|
||||
{
|
||||
while (true) {
|
||||
msg = NULL;
|
||||
osRecvMesg(&irqMgrMsgQ, &msg, OS_MESG_BLOCK);
|
||||
if (msg == NULL)
|
||||
if (msg == NULL) {
|
||||
break;
|
||||
if (*msg == OS_SC_PRE_NMI_MSG)
|
||||
{
|
||||
osSyncPrintf("main.c: リセットされたみたいだよ\n"); //Looks like it's been reset
|
||||
}
|
||||
if (*msg == OS_SC_PRE_NMI_MSG) {
|
||||
osSyncPrintf("main.c: リセットされたみたいだよ\n"); // Looks like it's been reset
|
||||
PreNmiBuff_SetReset(gAppNmiBufferPtr);
|
||||
}
|
||||
}
|
||||
|
||||
osSyncPrintf("mainproc 後始末\n"); //Cleanup
|
||||
osSyncPrintf("mainproc 後始末\n"); // Cleanup
|
||||
osDestroyThread(&sGraphThread);
|
||||
func_800FBFD8();
|
||||
osSyncPrintf("mainproc 実行終了\n"); //End of execution
|
||||
osSyncPrintf("mainproc 実行終了\n"); // End of execution
|
||||
}
|
||||
|
||||
+76
-109
@@ -8,50 +8,53 @@
|
||||
|
||||
s32 D_8012D280 = 1;
|
||||
|
||||
OSMesgQueue* PadMgr_LockGetControllerQueue(PadMgr* padmgr)
|
||||
{
|
||||
OSMesgQueue* PadMgr_LockGetControllerQueue(PadMgr* padmgr) {
|
||||
OSMesgQueue* ctrlrqueue = NULL;
|
||||
|
||||
if (D_8012D280 > 2)
|
||||
//EUC-JP: ロック待ち | Waiting for lock
|
||||
osSyncPrintf("%2d %d serialMsgQロック待ち %08x %08x %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, padmgr, &padmgr->queue1, &ctrlrqueue);
|
||||
if (D_8012D280 > 2) {
|
||||
// EUC-JP: ロック待ち | Waiting for lock
|
||||
osSyncPrintf("%2d %d serialMsgQロック待ち %08x %08x %08x\n", osGetThreadId(NULL),
|
||||
padmgr->queue1.validCount, padmgr, &padmgr->queue1, &ctrlrqueue);
|
||||
}
|
||||
|
||||
osRecvMesg(&padmgr->queue1, &ctrlrqueue, OS_MESG_BLOCK);
|
||||
|
||||
if (D_8012D280 > 2)
|
||||
//EUC-JP: をロックしました | Locked
|
||||
osSyncPrintf("%2d %d serialMsgQをロックしました %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, ctrlrqueue);
|
||||
if (D_8012D280 > 2) {
|
||||
// EUC-JP: をロックしました | Locked
|
||||
osSyncPrintf("%2d %d serialMsgQをロックしました %08x\n", osGetThreadId(NULL),
|
||||
padmgr->queue1.validCount, ctrlrqueue);
|
||||
}
|
||||
|
||||
return ctrlrqueue;
|
||||
}
|
||||
|
||||
void PadMgr_UnlockReleaseControllerQueue(PadMgr* padmgr, OSMesgQueue* ctrlrqueue)
|
||||
{
|
||||
if (D_8012D280 > 2)
|
||||
//EUC-JP: ロック解除します | Unlock
|
||||
osSyncPrintf("%2d %d serialMsgQロック解除します %08x %08x %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue);
|
||||
void PadMgr_UnlockReleaseControllerQueue(PadMgr* padmgr, OSMesgQueue* ctrlrqueue) {
|
||||
if (D_8012D280 > 2) {
|
||||
// EUC-JP: ロック解除します | Unlock
|
||||
osSyncPrintf("%2d %d serialMsgQロック解除します %08x %08x %08x\n", osGetThreadId(NULL),
|
||||
padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue);
|
||||
}
|
||||
|
||||
osSendMesg(&padmgr->queue1, ctrlrqueue, OS_MESG_BLOCK);
|
||||
|
||||
if (D_8012D280 > 2)
|
||||
//EUC-JP: ロック解除しました | Unlocked
|
||||
osSyncPrintf("%2d %d serialMsgQロック解除しました %08x %08x %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue);
|
||||
if (D_8012D280 > 2) {
|
||||
// EUC-JP: ロック解除しました | Unlocked
|
||||
osSyncPrintf("%2d %d serialMsgQロック解除しました %08x %08x %08x\n", osGetThreadId(NULL),
|
||||
padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue);
|
||||
}
|
||||
}
|
||||
|
||||
void PadMgr_Lock2(PadMgr* padmgr)
|
||||
{
|
||||
void PadMgr_Lock2(PadMgr* padmgr) {
|
||||
osRecvMesg(&padmgr->queue2, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
void PadMgr_Unlock2(PadMgr* padmgr)
|
||||
{
|
||||
void PadMgr_Unlock2(PadMgr* padmgr) {
|
||||
osSendMesg(&padmgr->queue2, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc and minor ordering differences
|
||||
void func_800C740C(PadMgr* padmgr)
|
||||
{
|
||||
void func_800C740C(PadMgr* padmgr) {
|
||||
static u32 D_8012D284 = 0;
|
||||
static u32 D_8016A4F0;
|
||||
s32 temp;
|
||||
@@ -65,54 +68,39 @@ void func_800C740C(PadMgr* padmgr)
|
||||
ctrlrqueue = PadMgr_LockGetControllerQueue(padmgr);
|
||||
var1 = 0;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (padmgr->unk_2AA[i] != 0)
|
||||
{
|
||||
if (padmgr->pad_status[i].status & 1)
|
||||
{
|
||||
if (padmgr->unk_2AE[i] == temp)
|
||||
{
|
||||
if (padmgr->unk_2B2[i] != 0)
|
||||
{
|
||||
if (padmgr->unk_2B6[i] < 3)
|
||||
{
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (padmgr->unk_2AA[i] != 0) {
|
||||
if (padmgr->pad_status[i].status & 1) {
|
||||
if (padmgr->unk_2AE[i] == temp) {
|
||||
if (padmgr->unk_2B2[i] != 0) {
|
||||
if (padmgr->unk_2B6[i] < 3) {
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック ぶるぶるぶるぶる");
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
if (osSetVibration(&padmgr->unk_controller[i], temp) != 0)
|
||||
{
|
||||
if (osSetVibration(&padmgr->unk_controller[i], temp) != 0) {
|
||||
padmgr->unk_2AE[i] = 0;
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックで通信エラーが発生しました");
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
padmgr->unk_2B6[i] = 3;
|
||||
}
|
||||
|
||||
var1 = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (padmgr->unk_2B6[i] != 0)
|
||||
{
|
||||
} else {
|
||||
if (padmgr->unk_2B6[i] != 0) {
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック 停止");
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
if (osSetVibration(&padmgr->unk_controller[i], 0) != 0)
|
||||
{
|
||||
if (osSetVibration(&padmgr->unk_controller[i], 0) != 0) {
|
||||
padmgr->unk_2AE[i] = 0;
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックで通信エラーが発生しました");
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
padmgr->unk_2B6[i]--;
|
||||
}
|
||||
|
||||
@@ -120,22 +108,17 @@ void func_800C740C(PadMgr* padmgr)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (padmgr->unk_2AE[i] != 0)
|
||||
{
|
||||
if (padmgr->unk_2AE[i] == 1)
|
||||
{
|
||||
} else {
|
||||
if (padmgr->unk_2AE[i] != 0) {
|
||||
if (padmgr->unk_2AE[i] == 1) {
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックが抜かれたようです");
|
||||
osSyncPrintf(VT_RST);
|
||||
padmgr->unk_2AE[i] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックではないコントローラパックが抜かれたようです");
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1,
|
||||
"振動パックではないコントローラパックが抜かれたようです");
|
||||
osSyncPrintf(VT_RST);
|
||||
padmgr->unk_2AE[i] = 0;
|
||||
}
|
||||
@@ -144,29 +127,22 @@ void func_800C740C(PadMgr* padmgr)
|
||||
}
|
||||
}
|
||||
|
||||
if (!var1)
|
||||
{
|
||||
if (!var1) {
|
||||
var3 = D_8016A4F0 % 4;
|
||||
|
||||
if ((padmgr->unk_2AA[var3] != 0) && (padmgr->pad_status[var3].status & 1) && (padmgr->unk_2AE[var3] != 1))
|
||||
{
|
||||
if ((padmgr->unk_2AA[var3] != 0) && (padmgr->pad_status[var3].status & 1) && (padmgr->unk_2AE[var3] != 1)) {
|
||||
var4 = osProbeVibrationPack(ctrlrqueue, &padmgr->unk_controller[var3], var3);
|
||||
|
||||
if (var4 == 0)
|
||||
{
|
||||
if (var4 == 0) {
|
||||
padmgr->unk_2AE[var3] = 1;
|
||||
osSetVibration(&padmgr->unk_controller[var3], 1);
|
||||
osSetVibration(&padmgr->unk_controller[var3], 0);
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", var3 + 1, "振動パックを認識しました");
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
else if (var4 == 11)
|
||||
{
|
||||
} else if (var4 == 11) {
|
||||
padmgr->unk_2AE[var3] = 2;
|
||||
}
|
||||
else if (var4 == 4)
|
||||
{
|
||||
} else if (var4 == 4) {
|
||||
LogUtils_LogThreadId("../padmgr.c", 282);
|
||||
osSyncPrintf("++errcnt = %d\n", ++D_8012D284);
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
@@ -185,22 +161,18 @@ u32 D_8016A4F0;
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/func_800C740C.s")
|
||||
#endif
|
||||
|
||||
//func_800A2300 in 1.0
|
||||
void func_800C7818(PadMgr* padmgr)
|
||||
{
|
||||
// func_800A2300 in 1.0
|
||||
void func_800C7818(PadMgr* padmgr) {
|
||||
s32 i;
|
||||
OSMesgQueue* ctrlrqueue;
|
||||
|
||||
ctrlrqueue = PadMgr_LockGetControllerQueue(padmgr);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (osProbeVibrationPack(ctrlrqueue, &padmgr->unk_controller[i], i) == 0)
|
||||
{
|
||||
if ((gFaultStruct.msgId == 0) && (padmgr->unk_45D != 0))
|
||||
{
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (osProbeVibrationPack(ctrlrqueue, &padmgr->unk_controller[i], i) == 0) {
|
||||
if ((gFaultStruct.msgId == 0) && (padmgr->unk_45D != 0)) {
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
//EUC-JP: コン | 'Con'? , EUC-JP: 振動パック 停止 | Stop vibration pack
|
||||
// EUC-JP: コン | 'Con'? , EUC-JP: 振動パック 停止 | Stop vibration pack
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック 停止");
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
@@ -212,13 +184,11 @@ void func_800C7818(PadMgr* padmgr)
|
||||
PadMgr_UnlockReleaseControllerQueue(padmgr, ctrlrqueue);
|
||||
}
|
||||
|
||||
void func_800C7928(PadMgr* padmgr)
|
||||
{
|
||||
void func_800C7928(PadMgr* padmgr) {
|
||||
padmgr->unk_45C = 3;
|
||||
}
|
||||
|
||||
void func_800C7934(PadMgr* padmgr, u32 a1, u32 a2)
|
||||
{
|
||||
void func_800C7934(PadMgr* padmgr, u32 a1, u32 a2) {
|
||||
padmgr->unk_2B2[a1] = a2;
|
||||
padmgr->unk_45D = 0xF0;
|
||||
}
|
||||
@@ -226,8 +196,7 @@ void func_800C7934(PadMgr* padmgr, u32 a1, u32 a2)
|
||||
#ifdef NON_MATCHING
|
||||
// minor ordering difference
|
||||
// 800A23CC in 1.0
|
||||
void func_800C7948(PadMgr* padmgr, u8* a1)
|
||||
{
|
||||
void func_800C7948(PadMgr* padmgr, u8* a1) {
|
||||
padmgr->unk_2B2[0] = a1[0];
|
||||
padmgr->unk_2B2[1] = a1[1];
|
||||
padmgr->unk_2B2[2] = a1[2];
|
||||
@@ -243,46 +212,45 @@ void func_800C7948(PadMgr* padmgr, u8* a1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/func_800C7C14.s")
|
||||
|
||||
void func_800C7DD0(PadMgr* padmgr)
|
||||
{
|
||||
void func_800C7DD0(PadMgr* padmgr) {
|
||||
osSyncPrintf("padmgr_HandlePreNMI()\n");
|
||||
padmgr->unk_45E = 1;
|
||||
func_800C7928(padmgr);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/func_800C7E08.s")
|
||||
//void func_800C7E08(Input*, u32);
|
||||
// void func_800C7E08(Input*, u32);
|
||||
|
||||
//800A2918 in 1.0
|
||||
void PadMgr_Run(PadMgr* padmgr)
|
||||
{
|
||||
// 800A2918 in 1.0
|
||||
void PadMgr_Run(PadMgr* padmgr) {
|
||||
s16* mesg;
|
||||
s32 bVar2;
|
||||
|
||||
mesg = NULL;
|
||||
//EUC-JP: コントローラスレッド実行開始 | Start of controller thread execution
|
||||
// EUC-JP: コントローラスレッド実行開始 | Start of controller thread execution
|
||||
osSyncPrintf("コントローラスレッド実行開始\n");
|
||||
bVar2 = 0;
|
||||
|
||||
while (bVar2 == 0)
|
||||
{
|
||||
if ((D_8012D280 > 2) && (padmgr->queue3.validCount == 0))
|
||||
//EUC-JP: コントローラスレッドイベント待ち | Waiting for controller thread event
|
||||
osSyncPrintf("コントローラスレッドイベント待ち %lld\n" , (osGetTime() * 64) / 3000);
|
||||
while (bVar2 == 0) {
|
||||
if ((D_8012D280 > 2) && (padmgr->queue3.validCount == 0)) {
|
||||
// EUC-JP: コントローラスレッドイベント待ち | Waiting for controller thread event
|
||||
osSyncPrintf("コントローラスレッドイベント待ち %lld\n", (osGetTime() * 64) / 3000);
|
||||
}
|
||||
|
||||
osRecvMesg(&padmgr->queue3, &mesg, OS_MESG_BLOCK);
|
||||
LogUtils_CheckNullPointer("msg", mesg, "../padmgr.c", 563);
|
||||
|
||||
switch (*mesg)
|
||||
{
|
||||
switch (*mesg) {
|
||||
case OS_SC_RETRACE_MSG:
|
||||
if (D_8012D280 > 2)
|
||||
if (D_8012D280 > 2) {
|
||||
osSyncPrintf("padmgr_HandleRetraceMsg START %lld\n", (osGetTime() * 64) / 3000);
|
||||
}
|
||||
|
||||
func_800C7C14(padmgr);
|
||||
|
||||
if (D_8012D280 > 2)
|
||||
if (D_8012D280 > 2) {
|
||||
osSyncPrintf("padmgr_HandleRetraceMsg END %lld\n", (osGetTime() * 64) / 3000);
|
||||
}
|
||||
|
||||
break;
|
||||
case OS_SC_PRE_NMI_MSG:
|
||||
@@ -295,14 +263,13 @@ void PadMgr_Run(PadMgr* padmgr)
|
||||
}
|
||||
|
||||
IrqMgr_RemoveClient(padmgr->unk_78, &padmgr->unk_70);
|
||||
//EUC-JP: コントローラスレッド実行終了 | Controller thread execution end
|
||||
// EUC-JP: コントローラスレッド実行終了 | Controller thread execution end
|
||||
osSyncPrintf("コントローラスレッド実行終了\n");
|
||||
}
|
||||
|
||||
//func_800A2A14 in 1.0
|
||||
void PadMgr_Init(PadMgr* padmgr, OSMesgQueue* ctrlrqueue, UNK_TYPE arg2, OSId id, OSPri priority, void* stack)
|
||||
{
|
||||
//EUC-JP: パッドマネージャ作成 | Create pad manager
|
||||
// func_800A2A14 in 1.0
|
||||
void PadMgr_Init(PadMgr* padmgr, OSMesgQueue* ctrlrqueue, UNK_TYPE arg2, OSId id, OSPri priority, void* stack) {
|
||||
// EUC-JP: パッドマネージャ作成 | Create pad manager
|
||||
osSyncPrintf("パッドマネージャ作成 padmgr_Create()\n");
|
||||
bzero(padmgr, sizeof(PadMgr));
|
||||
padmgr->unk_78 = arg2;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#include <global.h>
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/relocation/Overlay_DoRelocation.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/relocation/Overlay_DoRelocation.s")
|
||||
|
||||
+31
-36
@@ -4,14 +4,13 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C82A0.s")
|
||||
|
||||
void func_800C84E4(SchedContext* sc, UNK_TYPE arg1)
|
||||
{
|
||||
if (sc->unk_24C != 0)
|
||||
{
|
||||
void func_800C84E4(SchedContext* sc, UNK_TYPE arg1) {
|
||||
if (sc->unk_24C != 0) {
|
||||
sc->unk_24C = 0;
|
||||
|
||||
if (gIrqMgrResetStatus == 0)
|
||||
if (gIrqMgrResetStatus == 0) {
|
||||
ViConfig_UpdateVi(0);
|
||||
}
|
||||
}
|
||||
|
||||
func_800C82A0(arg1);
|
||||
@@ -19,26 +18,25 @@ void func_800C84E4(SchedContext* sc, UNK_TYPE arg1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C8534.s")
|
||||
|
||||
void func_800C87CC(SchedContext* sc)
|
||||
{
|
||||
void func_800C87CC(SchedContext* sc) {
|
||||
ViConfig_UpdateVi(1);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C87F0.s")
|
||||
|
||||
void func_800C8910(SchedContext* sc)
|
||||
{
|
||||
if (!(sc->curRSPTask->state & 0x10))
|
||||
{
|
||||
if (sc->curRSPTask->list.t.type == M_AUDTASK)
|
||||
void func_800C8910(SchedContext* sc) {
|
||||
if (!(sc->curRSPTask->state & 0x10)) {
|
||||
if (sc->curRSPTask->list.t.type == M_AUDTASK) {
|
||||
__assert("sc->curRSPTask->list.t.type != M_AUDTASK", "../sched.c", 496);
|
||||
}
|
||||
|
||||
sc->curRSPTask->state |= 0x10;
|
||||
|
||||
osSpTaskYield();
|
||||
|
||||
if (D_8012D290 != 0)
|
||||
if (D_8012D290 != 0) {
|
||||
osSyncPrintf("%08d:osSpTaskYield\n", (u32)((osGetTime() * 64) / 3000));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,39 +44,37 @@ void func_800C8910(SchedContext* sc)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C8A94.s")
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x00 */ char unk_00[0x04];
|
||||
/* 0x00 */ u32 unk_04;
|
||||
/* 0x00 */ u32 unk_08;
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x04];
|
||||
/* 0x00 */ u32 unk_04;
|
||||
/* 0x00 */ u32 unk_08;
|
||||
/* 0x0C */ UNK_TYPE unk_0C;
|
||||
/* 0x10 */ char unk_10[0x40];
|
||||
/* 0x10 */ char unk_10[0x40];
|
||||
/* 0x50 */ OSMesgQueue* msgQ;
|
||||
/* 0x54 */ OSMesg msg;
|
||||
/* 0x54 */ OSMesg msg;
|
||||
} struct_800C8C40;
|
||||
|
||||
void func_800C8BC4(SchedContext* sc, struct_800C8C40* arg1)
|
||||
{
|
||||
if (sc->pendingSwapBuf1 == 0)
|
||||
{
|
||||
void func_800C8BC4(SchedContext* sc, struct_800C8C40* arg1) {
|
||||
if (sc->pendingSwapBuf1 == 0) {
|
||||
sc->pendingSwapBuf1 = arg1->unk_0C;
|
||||
|
||||
LogUtils_CheckValidPointer("sc->pending_swapbuffer1", sc->pendingSwapBuf1, "../sched.c", 618);
|
||||
|
||||
if ((sc->unk_240 == NULL) || (sc->unk_240->unk_12 < 1))
|
||||
if ((sc->unk_240 == NULL) || (sc->unk_240->unk_12 < 1)) {
|
||||
func_800C84E4(sc, arg1->unk_0C);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u32 func_800C8C40(SchedContext* sc, struct_800C8C40* arg1)
|
||||
{
|
||||
if (!(arg1->unk_04 & 3))
|
||||
{
|
||||
if (arg1->msgQ != NULL)
|
||||
u32 func_800C8C40(SchedContext* sc, struct_800C8C40* arg1) {
|
||||
if (!(arg1->unk_04 & 3)) {
|
||||
if (arg1->msgQ != NULL) {
|
||||
osSendMesg(arg1->msgQ, arg1->msg, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
if (arg1->unk_08 & 0x40)
|
||||
if (arg1->unk_08 & 0x40) {
|
||||
func_800C8BC4(sc, arg1);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -96,18 +92,17 @@ u32 func_800C8C40(SchedContext* sc, struct_800C8C40* arg1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C94B4.s")
|
||||
|
||||
void func_800C95F8(OSMesgQueue* mq)
|
||||
{
|
||||
if (D_8012D290 != 0)
|
||||
void func_800C95F8(OSMesgQueue* mq) {
|
||||
if (D_8012D290 != 0) {
|
||||
osSyncPrintf("osScKickEntryMsg\n");
|
||||
}
|
||||
|
||||
osSendMesg(mq, 670, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C9644.s")
|
||||
|
||||
void func_800C9874(SchedContext* sc, void* stack, OSPri priority, UNK_TYPE arg3, UNK_TYPE arg4, UNK_TYPE arg5)
|
||||
{
|
||||
void func_800C9874(SchedContext* sc, void* stack, OSPri priority, UNK_TYPE arg3, UNK_TYPE arg4, UNK_TYPE arg5) {
|
||||
bzero(sc, sizeof(SchedContext));
|
||||
sc->unk_24C = 1;
|
||||
osCreateMesgQueue(&sc->interruptQ, sc->intBuf, 8);
|
||||
|
||||
+9
-15
@@ -1,36 +1,30 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x18];
|
||||
/* 0x18 */ s32 unk_18;
|
||||
/* 0x1C */ s32 unk_1C;
|
||||
/* 0x18 */ s32 unk_18;
|
||||
/* 0x1C */ s32 unk_1C;
|
||||
} struct_801664D0; // size = 0x20
|
||||
|
||||
extern struct_801664D0 D_801664D0;
|
||||
|
||||
void func_800C9940(struct_801664D0* arg0, u32 arg1, u32 arg2)
|
||||
{
|
||||
void func_800C9940(struct_801664D0* arg0, u32 arg1, u32 arg2) {
|
||||
LogUtils_CheckNullPointer("this", arg0, "../speed_meter.c", 181);
|
||||
arg0->unk_18 = arg1;
|
||||
arg0->unk_1C = arg2;
|
||||
}
|
||||
|
||||
void func_800C9998(struct_801664D0* arg0)
|
||||
{
|
||||
void func_800C9998(struct_801664D0* arg0) {
|
||||
func_800C9940(arg0, 0x20, 0x16);
|
||||
}
|
||||
|
||||
void func_800C99BC(struct_801664D0* arg0)
|
||||
{
|
||||
|
||||
void func_800C99BC(struct_801664D0* arg0) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/speed_meter/func_800C99C4.s")
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 unk_00;
|
||||
/* 0x04 */ u32 unk_04;
|
||||
/* 0x08 */ u16 unk_08;
|
||||
@@ -41,8 +35,8 @@ typedef struct
|
||||
/* 0x18 */ u32 unk_18;
|
||||
} struct_800C9E08;
|
||||
|
||||
void func_800C9E08(struct_800C9E08* arg0, u32 arg1, u32 arg2, u16 arg3, u16 arg4, u32 arg5, u32 arg6, u32 arg7, u32 arg8)
|
||||
{
|
||||
void func_800C9E08(struct_800C9E08* arg0, u32 arg1, u32 arg2, u16 arg3, u16 arg4, u32 arg5, u32 arg6, u32 arg7,
|
||||
u32 arg8) {
|
||||
arg0->unk_00 = arg1;
|
||||
arg0->unk_04 = arg2;
|
||||
arg0->unk_08 = arg3;
|
||||
|
||||
+21
-32
@@ -1,66 +1,55 @@
|
||||
#include <global.h>
|
||||
|
||||
volatile u32 sSysCfbFbPtr[2]; //may not be volatile but it currently gets SysCfb_Init closer from matching
|
||||
volatile u32 sSysCfbFbPtr[2]; // may not be volatile but it currently gets SysCfb_Init closer from matching
|
||||
u32 sSysCfbEnd;
|
||||
|
||||
//small reaordering
|
||||
// small reaordering
|
||||
#ifdef NON_MATCHING
|
||||
void SysCfb_Init(s32 n64dd)
|
||||
{
|
||||
if (osMemSize >= 0x800000U)
|
||||
{
|
||||
//8MB or more memory is installed
|
||||
void SysCfb_Init(s32 n64dd) {
|
||||
if (osMemSize >= 0x800000U) {
|
||||
// 8MB or more memory is installed
|
||||
osSyncPrintf("8Mバイト以上のメモリが搭載されています\n");
|
||||
if (n64dd == 1)
|
||||
{
|
||||
//RAM 8M mode (N64DD compatible)
|
||||
if (n64dd == 1) {
|
||||
// RAM 8M mode (N64DD compatible)
|
||||
osSyncPrintf("RAM 8M mode (N64DD対応)\n");
|
||||
sSysCfbEnd = 0x805FB000;
|
||||
}
|
||||
else
|
||||
{
|
||||
//The margin for this version is% dK bytes
|
||||
} else {
|
||||
// The margin for this version is% dK bytes
|
||||
osSyncPrintf("このバージョンのマージンは %dK バイトです\n", (0x4BC00 / 1024));
|
||||
sSysCfbEnd = 0x8044BE80;
|
||||
}
|
||||
}
|
||||
else if (osMemSize >= 0x400000U)
|
||||
{
|
||||
} else if (osMemSize >= 0x400000U) {
|
||||
sSysCfbEnd = 0x80400000;
|
||||
osSyncPrintf("RAM4M mode\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
LogUtils_HungupThread("../sys_cfb.c", 0x162);
|
||||
}
|
||||
|
||||
sSysCfbEnd &= ~0x3f;
|
||||
//The final address used by the system is% 08x
|
||||
// The final address used by the system is% 08x
|
||||
osSyncPrintf("システムが使用する最終アドレスは %08x です\n", sSysCfbEnd);
|
||||
sSysCfbFbPtr[0] = sSysCfbEnd - (SCREEN_WIDTH*SCREEN_HEIGHT*4);
|
||||
sSysCfbFbPtr[1] = sSysCfbEnd - (SCREEN_WIDTH*SCREEN_HEIGHT*2);
|
||||
//Frame buffer addresses are% 08x and% 08x
|
||||
sSysCfbFbPtr[0] = sSysCfbEnd - (SCREEN_WIDTH * SCREEN_HEIGHT * 4);
|
||||
sSysCfbFbPtr[1] = sSysCfbEnd - (SCREEN_WIDTH * SCREEN_HEIGHT * 2);
|
||||
// Frame buffer addresses are% 08x and% 08x
|
||||
osSyncPrintf("フレームバッファのアドレスは %08x と %08x です\n", sSysCfbFbPtr[0], sSysCfbFbPtr[1]);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_cfb/SysCfb_Init.s")
|
||||
#endif
|
||||
|
||||
void SysCfb_Reset()
|
||||
{
|
||||
void SysCfb_Reset() {
|
||||
sSysCfbFbPtr[0] = 0;
|
||||
sSysCfbFbPtr[1] = 0;
|
||||
sSysCfbEnd = 0;
|
||||
}
|
||||
|
||||
u32 SysCfb_GetFbPtr(s32 idx)
|
||||
{
|
||||
if (idx < 2)
|
||||
u32 SysCfb_GetFbPtr(s32 idx) {
|
||||
if (idx < 2) {
|
||||
return sSysCfbFbPtr[idx];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 SysCfb_GetFbEnd()
|
||||
{
|
||||
u32 SysCfb_GetFbEnd() {
|
||||
return sSysCfbEnd;
|
||||
}
|
||||
}
|
||||
|
||||
+109
-188
@@ -1,83 +1,74 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
Mtx gMtxClear =
|
||||
{
|
||||
// clang-format off
|
||||
Mtx gMtxClear = {
|
||||
65536, 0, 1, 0,
|
||||
0, 65536, 0, 1,
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
};
|
||||
MtxF gMtxFClear =
|
||||
{
|
||||
MtxF gMtxFClear = {
|
||||
1.0f, 0.0f, 0.0f, 0.0f,
|
||||
0.0f, 1.0f, 0.0f, 0.0f,
|
||||
0.0f, 0.0f, 1.0f, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, 1.0f,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
MtxF* sMatrixStack; // "Matrix_stack"
|
||||
MtxF* sMatrixStack; // "Matrix_stack"
|
||||
MtxF* sCurrentMatrix; // "Matrix_now"
|
||||
|
||||
void Matrix_Init(GameState* gameState)
|
||||
{
|
||||
void Matrix_Init(GameState* gameState) {
|
||||
sCurrentMatrix = Game_Alloc(gameState, 20 * sizeof(MtxF), "../sys_matrix.c", 153);
|
||||
sMatrixStack = sCurrentMatrix;
|
||||
}
|
||||
|
||||
void Matrix_Push(void)
|
||||
{
|
||||
void Matrix_Push(void) {
|
||||
Matrix_MtxFCopy(sCurrentMatrix + 1, sCurrentMatrix);
|
||||
sCurrentMatrix++;
|
||||
}
|
||||
|
||||
void Matrix_Pull(void)
|
||||
{
|
||||
void Matrix_Pull(void) {
|
||||
sCurrentMatrix--;
|
||||
if (sCurrentMatrix < sMatrixStack)
|
||||
if (sCurrentMatrix < sMatrixStack) {
|
||||
__assert("Matrix_now >= Matrix_stack", "../sys_matrix.c", 176);
|
||||
}
|
||||
}
|
||||
|
||||
void Matrix_Get(MtxF* dest)
|
||||
{
|
||||
void Matrix_Get(MtxF* dest) {
|
||||
Matrix_MtxFCopy(dest, sCurrentMatrix);
|
||||
}
|
||||
|
||||
void Matrix_Put(MtxF* src)
|
||||
{
|
||||
void Matrix_Put(MtxF* src) {
|
||||
Matrix_MtxFCopy(sCurrentMatrix, src);
|
||||
}
|
||||
|
||||
MtxF* Matrix_GetCurrent(void)
|
||||
{
|
||||
MtxF* Matrix_GetCurrent(void) {
|
||||
return sCurrentMatrix;
|
||||
}
|
||||
|
||||
void Matrix_Mult(MtxF* mf, u8 mode)
|
||||
{
|
||||
void Matrix_Mult(MtxF* mf, u8 mode) {
|
||||
MtxF* cmf = Matrix_GetCurrent();
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
func_800A6FA0(cmf, mf, cmf);
|
||||
else
|
||||
} else {
|
||||
Matrix_MtxFCopy(sCurrentMatrix, mf);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// minor ordering and regalloc differences
|
||||
void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode)
|
||||
{
|
||||
void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
cmf->wx += cmf->xx * x + cmf->yx * y + cmf->zx * z;
|
||||
cmf->wy += cmf->xy * x + cmf->yy * y + cmf->zy * z;
|
||||
cmf->wz += cmf->xz * x + cmf->yz * y + cmf->zz * z;
|
||||
cmf->ww += cmf->xw * x + cmf->yw * y + cmf->zw * z;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
func_800A7A24(cmf, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -85,12 +76,10 @@ void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_Translate.s")
|
||||
#endif
|
||||
|
||||
void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode)
|
||||
{
|
||||
void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
cmf->xx *= x;
|
||||
cmf->xy *= x;
|
||||
cmf->xz *= x;
|
||||
@@ -103,25 +92,20 @@ void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode)
|
||||
cmf->xw *= x;
|
||||
cmf->yw *= y;
|
||||
cmf->zw *= z;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
func_800A76A4(cmf, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
void Matrix_RotateX(f32 x, u8 mode)
|
||||
{
|
||||
void Matrix_RotateX(f32 x, u8 mode) {
|
||||
MtxF* cmf;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
f32 temp1;
|
||||
f32 temp2;
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
{
|
||||
if (x != 0)
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
if (x != 0) {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
sin = sinf(x);
|
||||
@@ -147,18 +131,13 @@ void Matrix_RotateX(f32 x, u8 mode)
|
||||
cmf->yw = temp1 * cos + temp2 * sin;
|
||||
cmf->zw = temp2 * cos - temp1 * sin;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
if (x != 0)
|
||||
{
|
||||
if (x != 0) {
|
||||
sin = sinf(x);
|
||||
cos = cosf(x);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sin = 0.0f;
|
||||
cos = 1.0f;
|
||||
}
|
||||
@@ -182,18 +161,15 @@ void Matrix_RotateX(f32 x, u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void Matrix_RotateY(f32 y, u8 mode)
|
||||
{
|
||||
void Matrix_RotateY(f32 y, u8 mode) {
|
||||
MtxF* cmf;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
f32 temp1;
|
||||
f32 temp2;
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
{
|
||||
if (y != 0)
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
if (y != 0) {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
sin = sinf(y);
|
||||
@@ -219,18 +195,13 @@ void Matrix_RotateY(f32 y, u8 mode)
|
||||
cmf->xw = temp1 * cos - temp2 * sin;
|
||||
cmf->zw = temp1 * sin + temp2 * cos;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
if (y != 0)
|
||||
{
|
||||
if (y != 0) {
|
||||
sin = sinf(y);
|
||||
cos = cosf(y);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sin = 0.0f;
|
||||
cos = 1.0f;
|
||||
}
|
||||
@@ -254,18 +225,15 @@ void Matrix_RotateY(f32 y, u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void Matrix_RotateZ(f32 z, u8 mode)
|
||||
{
|
||||
void Matrix_RotateZ(f32 z, u8 mode) {
|
||||
MtxF* cmf;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
f32 temp1;
|
||||
f32 temp2;
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
{
|
||||
if (z != 0)
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
if (z != 0) {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
sin = sinf(z);
|
||||
@@ -291,18 +259,13 @@ void Matrix_RotateZ(f32 z, u8 mode)
|
||||
cmf->xw = temp1 * cos + temp2 * sin;
|
||||
cmf->yw = temp2 * cos - temp1 * sin;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
if (z != 0)
|
||||
{
|
||||
if (z != 0) {
|
||||
sin = sinf(z);
|
||||
cos = cosf(z);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sin = 0.0f;
|
||||
cos = 1.0f;
|
||||
}
|
||||
@@ -326,16 +289,14 @@ void Matrix_RotateZ(f32 z, u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode)
|
||||
{
|
||||
void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
f32 temp1;
|
||||
f32 temp2;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
sin = Math_Sins(z);
|
||||
cos = Math_Coss(z);
|
||||
|
||||
@@ -359,8 +320,7 @@ void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode)
|
||||
cmf->xw = temp1 * cos + temp2 * sin;
|
||||
cmf->yw = temp2 * cos - temp1 * sin;
|
||||
|
||||
if (y != 0)
|
||||
{
|
||||
if (y != 0) {
|
||||
sin = Math_Sins(y);
|
||||
cos = Math_Coss(y);
|
||||
|
||||
@@ -385,8 +345,7 @@ void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode)
|
||||
cmf->zw = temp1 * sin + temp2 * cos;
|
||||
}
|
||||
|
||||
if (x != 0)
|
||||
{
|
||||
if (x != 0) {
|
||||
sin = Math_Sins(x);
|
||||
cos = Math_Coss(x);
|
||||
|
||||
@@ -410,15 +369,12 @@ void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode)
|
||||
cmf->yw = temp1 * cos + temp2 * sin;
|
||||
cmf->zw = temp2 * cos - temp1 * sin;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
func_800A7704(cmf, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
void func_800D1340(Vec3f* arg0, Vec3s* arg1)
|
||||
{
|
||||
void func_800D1340(Vec3f* arg0, Vec3s* arg1) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
@@ -452,8 +408,7 @@ void func_800D1340(Vec3f* arg0, Vec3s* arg1)
|
||||
cmf->xw = temp1 * cos + temp2 * sin;
|
||||
cmf->yw = temp2 * cos - temp1 * sin;
|
||||
|
||||
if (arg1->y != 0)
|
||||
{
|
||||
if (arg1->y != 0) {
|
||||
sin = Math_Sins(arg1->y);
|
||||
cos = Math_Coss(arg1->y);
|
||||
|
||||
@@ -478,8 +433,7 @@ void func_800D1340(Vec3f* arg0, Vec3s* arg1)
|
||||
cmf->zw = temp1 * sin + temp2 * cos;
|
||||
}
|
||||
|
||||
if (arg1->x != 0)
|
||||
{
|
||||
if (arg1->x != 0) {
|
||||
sin = Math_Sins(arg1->x);
|
||||
cos = Math_Coss(arg1->x);
|
||||
|
||||
@@ -507,8 +461,7 @@ void func_800D1340(Vec3f* arg0, Vec3s* arg1)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc differences
|
||||
void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
|
||||
{
|
||||
void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
f32 sp30;
|
||||
f32 sp2C;
|
||||
@@ -528,8 +481,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
|
||||
cmf->zw = 0.0f;
|
||||
cmf->ww = 1.0f;
|
||||
|
||||
if (vec->x != 0)
|
||||
{
|
||||
if (vec->x != 0) {
|
||||
sp24 = Math_Sins(vec->x);
|
||||
sp28 = Math_Coss(vec->x);
|
||||
|
||||
@@ -539,9 +491,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
|
||||
cmf->yz = sp2C * sp24;
|
||||
cmf->zx = sp30 * sp28;
|
||||
cmf->yx = sp30 * sp24;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cmf->zz = sp2C;
|
||||
cmf->zx = sp30;
|
||||
cmf->zy = 0.0f;
|
||||
@@ -550,8 +500,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
|
||||
cmf->yy = 1.0f;
|
||||
}
|
||||
|
||||
if (vec->z != 0)
|
||||
{
|
||||
if (vec->z != 0) {
|
||||
sp24 = Math_Sins(vec->z);
|
||||
sp28 = Math_Coss(vec->z);
|
||||
|
||||
@@ -568,9 +517,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
|
||||
sp2C = cmf->yy;
|
||||
cmf->xy = sp2C * sp24;
|
||||
cmf->yy = sp2C * sp28;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cmf->xy = 0.0f;
|
||||
}
|
||||
}
|
||||
@@ -580,74 +527,73 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// mostly regalloc differences
|
||||
Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest)
|
||||
{
|
||||
Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) {
|
||||
u16* m1 = (u16*)&dest->m[0][0];
|
||||
u16* m2 = (u16*)&dest->m[2][0];
|
||||
s32 temp;
|
||||
|
||||
temp = src->xx * 65536.0f;
|
||||
m1[0] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[0] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[0] = temp & 0xFFFF;
|
||||
|
||||
temp = src->xy * 65536.0f;
|
||||
m1[1] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[1] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[1] = temp & 0xFFFF;
|
||||
|
||||
temp = src->xz * 65536.0f;
|
||||
m1[2] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[2] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[2] = temp & 0xFFFF;
|
||||
|
||||
temp = src->xw * 65536.0f;
|
||||
m1[3] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[3] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[3] = temp & 0xFFFF;
|
||||
|
||||
temp = src->yx * 65536.0f;
|
||||
m1[4] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[4] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[4] = temp & 0xFFFF;
|
||||
|
||||
temp = src->yy * 65536.0f;
|
||||
m1[5] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[5] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[5] = temp & 0xFFFF;
|
||||
|
||||
temp = src->yz * 65536.0f;
|
||||
m1[6] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[6] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[6] = temp & 0xFFFF;
|
||||
|
||||
temp = src->yw * 65536.0f;
|
||||
m1[7] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[7] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[7] = temp & 0xFFFF;
|
||||
|
||||
temp = src->zx * 65536.0f;
|
||||
m1[8] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[8] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[8] = temp & 0xFFFF;
|
||||
|
||||
temp = src->zy * 65536.0f;
|
||||
m1[9] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[9] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[9] = temp & 0xFFFF;
|
||||
|
||||
temp = src->zz * 65536.0f;
|
||||
m1[10] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[10] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[10] = temp & 0xFFFF;
|
||||
|
||||
temp = src->zw * 65536.0f;
|
||||
m1[11] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[11] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[11] = temp & 0xFFFF;
|
||||
|
||||
temp = src->wx * 65536.0f;
|
||||
m1[12] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[12] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[12] = temp & 0xFFFF;
|
||||
|
||||
temp = src->wy * 65536.0f;
|
||||
m1[13] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[13] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[13] = temp & 0xFFFF;
|
||||
|
||||
temp = src->wz * 65536.0f;
|
||||
m1[14] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[14] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[14] = temp & 0xFFFF;
|
||||
|
||||
temp = src->ww * 65536.0f;
|
||||
m1[15] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[15] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[15] = temp & 0xFFFF;
|
||||
|
||||
return dest;
|
||||
@@ -656,23 +602,19 @@ Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_MtxFToMtx.s")
|
||||
#endif
|
||||
|
||||
Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line)
|
||||
{
|
||||
Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line) {
|
||||
return Matrix_MtxFToMtx(Matrix_CheckFloats(sCurrentMatrix, file, line), dest);
|
||||
}
|
||||
|
||||
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line)
|
||||
{
|
||||
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line) {
|
||||
return Matrix_ToMtx(Graph_Alloc(gfxCtx, sizeof(Mtx)), file, line);
|
||||
}
|
||||
|
||||
Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx)
|
||||
{
|
||||
Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx) {
|
||||
return Matrix_MtxFToMtx(src, Graph_Alloc(gfxCtx, sizeof(Mtx)));
|
||||
}
|
||||
|
||||
void Matrix_MultVec3f(Vec3f* src, Vec3f* dest)
|
||||
{
|
||||
void Matrix_MultVec3f(Vec3f* src, Vec3f* dest) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
|
||||
dest->x = cmf->wx + (cmf->xx * src->x + cmf->yx * src->y + cmf->zx * src->z);
|
||||
@@ -680,8 +622,7 @@ void Matrix_MultVec3f(Vec3f* src, Vec3f* dest)
|
||||
dest->z = cmf->wz + (cmf->xz * src->x + cmf->yz * src->y + cmf->zz * src->z);
|
||||
}
|
||||
|
||||
void Matrix_MtxFCopy(MtxF* dest, MtxF* src)
|
||||
{
|
||||
void Matrix_MtxFCopy(MtxF* dest, MtxF* src) {
|
||||
dest->xx = src->xx;
|
||||
dest->xy = src->xy;
|
||||
dest->xz = src->xz;
|
||||
@@ -716,8 +657,7 @@ void Matrix_MtxFCopy(MtxF* dest, MtxF* src)
|
||||
dest->ww = src->ww;
|
||||
}
|
||||
|
||||
void Matrix_MtxToMtxF(Mtx* src, MtxF* dest)
|
||||
{
|
||||
void Matrix_MtxToMtxF(Mtx* src, MtxF* dest) {
|
||||
u16* m1 = (u16*)&src->m[0][0];
|
||||
u16* m2 = (u16*)&src->m[2][0];
|
||||
|
||||
@@ -739,15 +679,13 @@ void Matrix_MtxToMtxF(Mtx* src, MtxF* dest)
|
||||
dest->ww = ((m1[15] << 0x10) | m2[15]) * (1 / 65536.0f);
|
||||
}
|
||||
|
||||
void Matrix_MultVec3fExt(Vec3f* src, Vec3f* dest, MtxF* mf)
|
||||
{
|
||||
void Matrix_MultVec3fExt(Vec3f* src, Vec3f* dest, MtxF* mf) {
|
||||
dest->x = mf->wx + (mf->xx * src->x + mf->yx * src->y + mf->zx * src->z);
|
||||
dest->y = mf->wy + (mf->xy * src->x + mf->yy * src->y + mf->zy * src->z);
|
||||
dest->z = mf->wz + (mf->xz * src->x + mf->yz * src->y + mf->zz * src->z);
|
||||
}
|
||||
|
||||
void Matrix_Reverse(MtxF* mf)
|
||||
{
|
||||
void Matrix_Reverse(MtxF* mf) {
|
||||
f32 temp;
|
||||
|
||||
temp = mf->xy;
|
||||
@@ -764,8 +702,7 @@ void Matrix_Reverse(MtxF* mf)
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void func_800D1FD4(MtxF* mf)
|
||||
{
|
||||
void func_800D1FD4(MtxF* mf) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
f32 temp;
|
||||
|
||||
@@ -790,12 +727,10 @@ void func_800D1FD4(MtxF* mf)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// same differences as func_800D2264
|
||||
void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag)
|
||||
{
|
||||
void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag) {
|
||||
vec->x = Math_atan2f(-mf->zy, sqrtf(SQ(mf->zx) + SQ(mf->zz))) * (32768 / M_PI);
|
||||
|
||||
if ((vec->x == 0x4000) || (vec->x == -0x4000))
|
||||
{
|
||||
if ((vec->x == 0x4000) || (vec->x == -0x4000)) {
|
||||
vec->z = 0;
|
||||
vec->y = Math_atan2f(-mf->xz, mf->xx) * (32768 / M_PI);
|
||||
return;
|
||||
@@ -806,8 +741,9 @@ void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag)
|
||||
if (!flag)
|
||||
vec->z = Math_atan2f(mf->xy, mf->yy) * (32768 / M_PI);
|
||||
else
|
||||
vec->z = Math_atan2f(mf->xy / sqrtf(SQ(mf->xx) + SQ(mf->xz) + SQ(mf->xy)),
|
||||
mf->yy / sqrtf(SQ(mf->yx) + SQ(mf->yz) + SQ(mf->yy))) * (32768 / M_PI);
|
||||
vec->z = Math_atan2f(mf->xy / sqrtf(SQ(mf->xx) + SQ(mf->xz) + SQ(mf->xy)),
|
||||
mf->yy / sqrtf(SQ(mf->yx) + SQ(mf->yz) + SQ(mf->yy))) *
|
||||
(32768 / M_PI);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_800D20CC.s")
|
||||
@@ -815,12 +751,10 @@ void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// same differences as func_800D20CC
|
||||
void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag)
|
||||
{
|
||||
void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag) {
|
||||
vec->y = Math_atan2f(-mf->xz, sqrtf(SQ(mf->xx) + SQ(mf->xy))) * (32768 / M_PI);
|
||||
|
||||
if ((vec->y == 0x4000) || (vec->y == -0x4000))
|
||||
{
|
||||
if ((vec->y == 0x4000) || (vec->y == -0x4000)) {
|
||||
vec->x = 0;
|
||||
vec->z = Math_atan2f(-mf->yx, mf->yy) * (32768 / M_PI);
|
||||
return;
|
||||
@@ -831,8 +765,9 @@ void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag)
|
||||
if (!flag)
|
||||
vec->x = Math_atan2f(mf->yz, mf->zz) * (32768 / M_PI);
|
||||
else
|
||||
vec->x = Math_atan2f(mf->yz / sqrtf(SQ(mf->yx) + SQ(mf->yy) + SQ(mf->yz)),
|
||||
mf->zz / sqrtf(SQ(mf->zx) + SQ(mf->zy) + SQ(mf->zz))) * (32768 / M_PI);
|
||||
vec->x = Math_atan2f(mf->yz / sqrtf(SQ(mf->yx) + SQ(mf->yy) + SQ(mf->yz)),
|
||||
mf->zz / sqrtf(SQ(mf->zx) + SQ(mf->zy) + SQ(mf->zz))) *
|
||||
(32768 / M_PI);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_800D2264.s")
|
||||
@@ -840,8 +775,7 @@ void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc differences
|
||||
void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
|
||||
{
|
||||
void func_800D23FC(f32 f, Vec3f* vec, u8 mode) {
|
||||
MtxF* cmf;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
@@ -851,10 +785,8 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
|
||||
f32 temp3;
|
||||
f32 temp4;
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
{
|
||||
if (f != 0)
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
if (f != 0) {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
sin = sinf(f);
|
||||
@@ -884,13 +816,10 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
|
||||
cmf->yz = temp2 * cos + vec->y * temp4 + sin * (temp3 * vec->x - temp1 * vec->z);
|
||||
cmf->zz = temp3 * cos + vec->z * temp4 + sin * (temp1 * vec->y - temp2 * vec->x);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
if (f != 0)
|
||||
{
|
||||
if (f != 0) {
|
||||
sin = sinf(f);
|
||||
cos = cosf(f);
|
||||
rCos = 1.0f - cos;
|
||||
@@ -921,9 +850,7 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
|
||||
cmf->wy = 0.0f;
|
||||
cmf->wz = 0.0f;
|
||||
cmf->ww = 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cmf->xy = 0.0f;
|
||||
cmf->xz = 0.0f;
|
||||
cmf->xw = 0.0f;
|
||||
@@ -947,17 +874,16 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_800D23FC.s")
|
||||
#endif
|
||||
|
||||
MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line)
|
||||
{
|
||||
MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line) {
|
||||
s32 i, j;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
if (!(-32768.0f <= mf->mf[i][j]) || !(mf->mf[i][j] < 32768.0f))
|
||||
{
|
||||
osSyncPrintf("%s %d: [%s] =\n/ %12.6f %12.6f %12.6f %12.6f \\\n| %12.6f %12.6f %12.6f %12.6f |\n| %12.6f %12.6f %12.6f %12.6f |\n\\ %12.6f %12.6f %12.6f %12.6f /\n", file, line, "mf", mf->xx, mf->yx, mf->zx, mf->wx, mf->xy, mf->yy, mf->zy, mf->wy, mf->xz, mf->yz, mf->zz, mf->wz, mf->xw, mf->yw, mf->zw, mf->ww);
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
if (!(-32768.0f <= mf->mf[i][j]) || !(mf->mf[i][j] < 32768.0f)) {
|
||||
osSyncPrintf("%s %d: [%s] =\n/ %12.6f %12.6f %12.6f %12.6f \\\n| %12.6f %12.6f %12.6f %12.6f |\n| "
|
||||
"%12.6f %12.6f %12.6f %12.6f |\n\\ %12.6f %12.6f %12.6f %12.6f /\n",
|
||||
file, line, "mf", mf->xx, mf->yx, mf->zx, mf->wx, mf->xy, mf->yy, mf->zy, mf->wy, mf->xz,
|
||||
mf->yz, mf->zz, mf->wz, mf->xw, mf->yw, mf->zw, mf->ww);
|
||||
Fault_AddHungupAndCrash(file, line);
|
||||
}
|
||||
}
|
||||
@@ -966,8 +892,7 @@ MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line)
|
||||
return mf;
|
||||
}
|
||||
|
||||
void func_800D2A34(MtxF* mf, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
|
||||
{
|
||||
void func_800D2A34(MtxF* mf, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
|
||||
mf->xy = 0.0f;
|
||||
mf->xz = 0.0f;
|
||||
mf->xw = 0.0f;
|
||||
@@ -986,16 +911,14 @@ void func_800D2A34(MtxF* mf, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
|
||||
mf->ww = 1.0f;
|
||||
}
|
||||
|
||||
void func_800D2A98(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
|
||||
{
|
||||
void func_800D2A98(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
|
||||
MtxF mf;
|
||||
|
||||
func_800D2A34(&mf, arg1, arg2, arg3, arg4);
|
||||
func_801064E0(&mf, mtx);
|
||||
}
|
||||
|
||||
void func_800D2AE4(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
|
||||
{
|
||||
void func_800D2AE4(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
|
||||
u16* m1 = (u16*)&mtx->m[0][0];
|
||||
u16* m2 = (u16*)&mtx->m[2][0];
|
||||
u32 temp;
|
||||
@@ -1047,8 +970,7 @@ void func_800D2AE4(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
|
||||
m2[15] = 0;
|
||||
}
|
||||
|
||||
void func_800D2BD0(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6)
|
||||
{
|
||||
void func_800D2BD0(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) {
|
||||
u16* m1 = (u16*)&mtx->m[0][0];
|
||||
u16* m2 = (u16*)&mtx->m[2][0];
|
||||
u32 temp;
|
||||
@@ -1102,8 +1024,7 @@ void func_800D2BD0(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// minor ordering and regalloc differences
|
||||
void func_800D2CEC(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6)
|
||||
{
|
||||
void func_800D2CEC(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) {
|
||||
u16* m1 = (u16*)&mtx->m[0][0];
|
||||
u16* m2 = (u16*)&mtx->m[2][0];
|
||||
u32 temp;
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
#include <global.h>
|
||||
|
||||
u32 SysUcode_GetUCodeBoot()
|
||||
{
|
||||
u32 SysUcode_GetUCodeBoot() {
|
||||
return &D_80009320;
|
||||
}
|
||||
|
||||
u32 SysUcode_GetUcodeBootSize()
|
||||
{
|
||||
u32 SysUcode_GetUcodeBootSize() {
|
||||
return (u32)&D_800093F0 - (u32)&D_80009320;
|
||||
}
|
||||
|
||||
u32 SysUcode_GetUcode()
|
||||
{
|
||||
u32 SysUcode_GetUcode() {
|
||||
return D_8012DBA0;
|
||||
}
|
||||
|
||||
u32 SysUcode_GetUcodeData()
|
||||
{
|
||||
u32 SysUcode_GetUcodeData() {
|
||||
return D_8012DBA4;
|
||||
}
|
||||
|
||||
+30
-49
@@ -1,131 +1,112 @@
|
||||
#include <global.h>
|
||||
|
||||
#define LOG_SEVERITY_NOLOG 0
|
||||
#define LOG_SEVERITY_ERROR 2
|
||||
#define LOG_SEVERITY_VERBOSE 3
|
||||
#define LOG_SEVERITY_NOLOG 0
|
||||
#define LOG_SEVERITY_ERROR 2
|
||||
#define LOG_SEVERITY_VERBOSE 3
|
||||
|
||||
s32 gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
||||
Arena gSystemArena;
|
||||
|
||||
void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action)
|
||||
{
|
||||
if (!ptr)
|
||||
{
|
||||
if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR)
|
||||
{
|
||||
void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
|
||||
if (!ptr) {
|
||||
if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR) {
|
||||
//"%s: %u bytes %s failed\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action);
|
||||
__osDisplayArena(&gSystemArena);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE)
|
||||
{
|
||||
} else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
|
||||
//"%s: %u bytes %s succeeded\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action);
|
||||
}
|
||||
}
|
||||
|
||||
void* SystemArena_Malloc(u32 size)
|
||||
{
|
||||
void* SystemArena_Malloc(u32 size) {
|
||||
void* ptr;
|
||||
ptr = __osMalloc(&gSystemArena, size);
|
||||
SystemArena_CheckPointer(ptr, size, "malloc", "確保"); //Secure
|
||||
SystemArena_CheckPointer(ptr, size, "malloc", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* SystemArena_MallocDebug(u32 size, const char* file, s32 line)
|
||||
{
|
||||
void* SystemArena_MallocDebug(u32 size, const char* file, s32 line) {
|
||||
void* ptr;
|
||||
ptr = __osMallocDebug(&gSystemArena, size, file, line);
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_DEBUG", "確保"); //Secure
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_DEBUG", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* SystemArena_MallocR(u32 size)
|
||||
{
|
||||
void* SystemArena_MallocR(u32 size) {
|
||||
void* ptr;
|
||||
ptr = __osMallocR(&gSystemArena, size);
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_r", "確保"); //Secure
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_r", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* SystemArena_MallocRDebug(u32 size, const char* file, s32 line)
|
||||
{
|
||||
void* SystemArena_MallocRDebug(u32 size, const char* file, s32 line) {
|
||||
void* ptr;
|
||||
ptr = __osMallocRDebug(&gSystemArena, size, file, line);
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_r_DEBUG", "確保"); //Secure
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_r_DEBUG", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* SystemArena_Realloc(void* ptr, u32 newSize)
|
||||
{
|
||||
void* SystemArena_Realloc(void* ptr, u32 newSize) {
|
||||
ptr = __osRealloc(&gSystemArena, ptr, newSize);
|
||||
SystemArena_CheckPointer(ptr, newSize, "realloc", "再確保"); // Re-securing
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line)
|
||||
{
|
||||
void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) {
|
||||
ptr = __osReallocDebug(&gSystemArena, ptr, newSize, file, line);
|
||||
SystemArena_CheckPointer(ptr, newSize, "realloc_DEBUG", "再確保"); // Re-securing
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void SystemArena_Free(void* ptr)
|
||||
{
|
||||
void SystemArena_Free(void* ptr) {
|
||||
__osFree(&gSystemArena, ptr);
|
||||
}
|
||||
|
||||
void SystemArena_FreeDebug(void* ptr, const char* file, s32 line)
|
||||
{
|
||||
void SystemArena_FreeDebug(void* ptr, const char* file, s32 line) {
|
||||
__osFreeDebug(&gSystemArena, ptr, file, line);
|
||||
}
|
||||
|
||||
void* SystemArena_Calloc(u32 num, u32 size)
|
||||
{
|
||||
void* SystemArena_Calloc(u32 num, u32 size) {
|
||||
void* ret;
|
||||
u32 n;
|
||||
|
||||
n = num*size;
|
||||
n = num * size;
|
||||
ret = __osMalloc(&gSystemArena, n);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
bzero(ret, n);
|
||||
}
|
||||
|
||||
SystemArena_CheckPointer(ret, n, "calloc", "確保");
|
||||
return ret;
|
||||
}
|
||||
|
||||
void SystemArena_Display()
|
||||
{
|
||||
//System heap display
|
||||
void SystemArena_Display() {
|
||||
// System heap display
|
||||
osSyncPrintf("システムヒープ表示\n");
|
||||
__osDisplayArena(&gSystemArena);
|
||||
}
|
||||
|
||||
void SystemArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc)
|
||||
{
|
||||
void SystemArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) {
|
||||
ArenaImpl_GetSizes(&gSystemArena, outMaxFree, outFree, outAlloc);
|
||||
}
|
||||
|
||||
void SystemArena_Check()
|
||||
{
|
||||
void SystemArena_Check() {
|
||||
__osCheckArena(&gSystemArena);
|
||||
}
|
||||
|
||||
void SystemArena_Init(void* start, u32 size)
|
||||
{
|
||||
void SystemArena_Init(void* start, u32 size) {
|
||||
gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
||||
__osMallocInit(&gSystemArena, start, size);
|
||||
}
|
||||
|
||||
void SystemArena_Cleanup()
|
||||
{
|
||||
void SystemArena_Cleanup() {
|
||||
gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
||||
__osMallocCleanup(&gSystemArena);
|
||||
}
|
||||
|
||||
u8 SystemArena_IsInitalized()
|
||||
{
|
||||
u8 SystemArena_IsInitalized() {
|
||||
return __osMallocIsInitalized(&gSystemArena);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
#include <global.h>
|
||||
|
||||
void TitleSetup_InitImpl(GameState* gameState)
|
||||
{
|
||||
//Zelda common data initalization
|
||||
void TitleSetup_InitImpl(GameState* gameState) {
|
||||
// Zelda common data initalization
|
||||
osSyncPrintf("ゼルダ共通データ初期化\n");
|
||||
SaveContext_Init();
|
||||
gameState->running = false;
|
||||
SET_NEXT_GAMESTATE(gameState, Title_Init, TitleContext);
|
||||
}
|
||||
|
||||
void TitleSetup_Destroy(GameState* gameState)
|
||||
{
|
||||
|
||||
void TitleSetup_Destroy(GameState* gameState) {
|
||||
}
|
||||
|
||||
void TitleSetup_Init(GameState* gameState)
|
||||
{
|
||||
void TitleSetup_Init(GameState* gameState) {
|
||||
gameState->destroy = TitleSetup_Destroy;
|
||||
TitleSetup_InitImpl(gameState);
|
||||
}
|
||||
}
|
||||
|
||||
+40
-39
@@ -2,109 +2,110 @@
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
void Overlay_LoadGameState(GameStateOverlay* overlayEntry)
|
||||
{
|
||||
if (overlayEntry->loadedRamAddr != NULL)
|
||||
{
|
||||
void Overlay_LoadGameState(GameStateOverlay* overlayEntry) {
|
||||
if (overlayEntry->loadedRamAddr != NULL) {
|
||||
// Translates to: "ALREADY LINKED"
|
||||
osSyncPrintf("既にリンクされています\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (overlayEntry->vramStart == 0)
|
||||
if (overlayEntry->vramStart == 0) {
|
||||
overlayEntry->unk_28 = 0;
|
||||
else
|
||||
{
|
||||
} else {
|
||||
overlayEntry->loadedRamAddr = Overlay_AllocateAndLoad(overlayEntry->vromStart, overlayEntry->vromEnd,
|
||||
overlayEntry->vramStart, overlayEntry->vramEnd);
|
||||
|
||||
if (overlayEntry->loadedRamAddr == NULL)
|
||||
{
|
||||
if (overlayEntry->loadedRamAddr == NULL) {
|
||||
// Translates to: "LOADING FAILED"
|
||||
osSyncPrintf("ロードに失敗しました\n");
|
||||
return;
|
||||
}
|
||||
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("OVL(d):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n",
|
||||
overlayEntry->vramStart, overlayEntry->vramEnd,
|
||||
osSyncPrintf("OVL(d):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", overlayEntry->vramStart, overlayEntry->vramEnd,
|
||||
overlayEntry->loadedRamAddr,
|
||||
(u32)overlayEntry->loadedRamAddr + (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart,
|
||||
(u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr,
|
||||
"");
|
||||
(u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr, "");
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
if (overlayEntry->unk_14 != NULL)
|
||||
if (overlayEntry->unk_14 != NULL) {
|
||||
overlayEntry->unk_14 = (void*)((u32)overlayEntry->unk_14 -
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->unk_14 = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->init != NULL)
|
||||
if (overlayEntry->init != NULL) {
|
||||
overlayEntry->init = (void*)((u32)overlayEntry->init -
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->init = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->destroy != NULL)
|
||||
if (overlayEntry->destroy != NULL) {
|
||||
overlayEntry->destroy = (void*)((u32)overlayEntry->destroy -
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->destroy = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->unk_20 != NULL)
|
||||
if (overlayEntry->unk_20 != NULL) {
|
||||
overlayEntry->unk_20 = (void*)((u32)overlayEntry->unk_20 -
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->unk_20 = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->unk_24 != NULL)
|
||||
if (overlayEntry->unk_24 != NULL) {
|
||||
overlayEntry->unk_24 = (void*)((u32)overlayEntry->unk_24 -
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->unk_24 = NULL;
|
||||
}
|
||||
|
||||
overlayEntry->unk_28 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Overlay_FreeGameState(GameStateOverlay* overlayEntry)
|
||||
{
|
||||
if (overlayEntry->loadedRamAddr != NULL)
|
||||
{
|
||||
void Overlay_FreeGameState(GameStateOverlay* overlayEntry) {
|
||||
if (overlayEntry->loadedRamAddr != NULL) {
|
||||
s32 temp = overlayEntry->unk_28 != 0 ? -1 : 0;
|
||||
|
||||
if (temp == 0)
|
||||
{
|
||||
if (overlayEntry->unk_14 != NULL)
|
||||
if (temp == 0) {
|
||||
if (overlayEntry->unk_14 != NULL) {
|
||||
overlayEntry->unk_14 = (void*)((u32)overlayEntry->unk_14 +
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->unk_14 = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->init != NULL)
|
||||
if (overlayEntry->init != NULL) {
|
||||
overlayEntry->init = (void*)((u32)overlayEntry->init +
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->init = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->destroy != NULL)
|
||||
if (overlayEntry->destroy != NULL) {
|
||||
overlayEntry->destroy = (void*)((u32)overlayEntry->destroy +
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->destroy = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->unk_20 != NULL)
|
||||
if (overlayEntry->unk_20 != NULL) {
|
||||
overlayEntry->unk_20 = (void*)((u32)overlayEntry->unk_20 +
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->unk_20 = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->unk_24 != NULL)
|
||||
if (overlayEntry->unk_24 != NULL) {
|
||||
overlayEntry->unk_24 = (void*)((u32)overlayEntry->unk_24 +
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->unk_24 = NULL;
|
||||
}
|
||||
|
||||
SystemArena_FreeDebug(overlayEntry->loadedRamAddr, "../z_DLF.c", 149);
|
||||
overlayEntry->loadedRamAddr = NULL;
|
||||
|
||||
+1597
-2085
File diff suppressed because it is too large
Load Diff
+22
-36
@@ -2,24 +2,19 @@
|
||||
#include <global.h>
|
||||
#include <initvars.h>
|
||||
|
||||
#define ACTOR_OVERLAY(name, allocType) \
|
||||
{ \
|
||||
(u32)_ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, \
|
||||
_ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, \
|
||||
NULL, &name##_InitVars, #name, allocType, 0 \
|
||||
#define ACTOR_OVERLAY(name, allocType) \
|
||||
{ \
|
||||
(u32) _ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, _ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, NULL, &name##_InitVars, #name, allocType, 0 \
|
||||
}
|
||||
|
||||
#define ACTOR_OVERLAY_INTERNAL(name, allocType) \
|
||||
{ \
|
||||
0, 0, \
|
||||
NULL, NULL, \
|
||||
NULL, &name##_InitVars, #name, allocType, 0 \
|
||||
}
|
||||
#define ACTOR_OVERLAY_INTERNAL(name, allocType) \
|
||||
{ 0, 0, NULL, NULL, NULL, &name##_InitVars, #name, allocType, 0 }
|
||||
|
||||
#define ACTOR_OVERLAY_UNSET { 0 }
|
||||
#define ACTOR_OVERLAY_UNSET \
|
||||
{ 0 }
|
||||
|
||||
ActorOverlay gActorOverlayTable[] =
|
||||
{
|
||||
ActorOverlay gActorOverlayTable[] = {
|
||||
ACTOR_OVERLAY_INTERNAL(Player, ALLOCTYPE_NORMAL),
|
||||
ACTOR_OVERLAY_UNSET,
|
||||
ACTOR_OVERLAY(En_Test, ALLOCTYPE_NORMAL),
|
||||
@@ -497,26 +492,21 @@ s32 gMaxProfile = 0;
|
||||
|
||||
static FaultClient sFaultClient;
|
||||
|
||||
void ActorOverlayTable_LogPrint(void)
|
||||
{
|
||||
void ActorOverlayTable_LogPrint(void) {
|
||||
ActorOverlay* overlayEntry;
|
||||
u32 i;
|
||||
|
||||
osSyncPrintf("actor_dlftbls %u\n", gMaxProfile);
|
||||
osSyncPrintf("RomStart RomEnd SegStart SegEnd allocp profile segname\n");
|
||||
|
||||
for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++)
|
||||
{
|
||||
osSyncPrintf("%08x %08x %08x %08x %08x %08x %s\n",
|
||||
overlayEntry->vromStart, overlayEntry->vromEnd,
|
||||
overlayEntry->vramStart, overlayEntry->vramEnd,
|
||||
overlayEntry->loadedRamAddr, &overlayEntry->initInfo->id,
|
||||
overlayEntry->name != NULL ? overlayEntry->name : "?");
|
||||
for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++) {
|
||||
osSyncPrintf("%08x %08x %08x %08x %08x %08x %s\n", overlayEntry->vromStart, overlayEntry->vromEnd,
|
||||
overlayEntry->vramStart, overlayEntry->vramEnd, overlayEntry->loadedRamAddr,
|
||||
&overlayEntry->initInfo->id, overlayEntry->name != NULL ? overlayEntry->name : "?");
|
||||
}
|
||||
}
|
||||
|
||||
void ActorOverlayTable_FaultPrint(void* arg0, void* arg1)
|
||||
{
|
||||
void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) {
|
||||
ActorOverlay* overlayEntry;
|
||||
u32 overlaySize;
|
||||
s32 i;
|
||||
@@ -526,26 +516,22 @@ void ActorOverlayTable_FaultPrint(void* arg0, void* arg1)
|
||||
FaultDrawer_Printf("actor_dlftbls %u\n", gMaxProfile);
|
||||
FaultDrawer_Printf("No. RamStart- RamEnd cn Name\n");
|
||||
|
||||
for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++)
|
||||
{
|
||||
for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++) {
|
||||
overlaySize = (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart;
|
||||
if (overlayEntry->loadedRamAddr != NULL)
|
||||
{
|
||||
FaultDrawer_Printf("%3d %08x-%08x %3d %s\n",
|
||||
i, overlayEntry->loadedRamAddr, (u32)overlayEntry->loadedRamAddr + overlaySize,
|
||||
overlayEntry->nbLoaded, overlayEntry->name != NULL ? overlayEntry->name : "");
|
||||
if (overlayEntry->loadedRamAddr != NULL) {
|
||||
FaultDrawer_Printf("%3d %08x-%08x %3d %s\n", i, overlayEntry->loadedRamAddr,
|
||||
(u32)overlayEntry->loadedRamAddr + overlaySize, overlayEntry->nbLoaded,
|
||||
overlayEntry->name != NULL ? overlayEntry->name : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ActorOverlayTable_Init(void)
|
||||
{
|
||||
void ActorOverlayTable_Init(void) {
|
||||
gMaxProfile = ACTOR_DLF_MAX;
|
||||
Fault_AddClient(&sFaultClient, ActorOverlayTable_FaultPrint, NULL, NULL);
|
||||
}
|
||||
|
||||
void ActorOverlayTable_Cleanup(void)
|
||||
{
|
||||
void ActorOverlayTable_Cleanup(void) {
|
||||
Fault_RemoveClient(&sFaultClient);
|
||||
gMaxProfile = 0;
|
||||
}
|
||||
|
||||
+81
-107
@@ -3,47 +3,41 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038600.s")
|
||||
|
||||
void func_80038708(s16* puParm1, s16* puParm2, u16 uParm3)
|
||||
{
|
||||
*puParm1 = *puParm2;
|
||||
puParm1[1] = uParm3;
|
||||
void func_80038708(s16* puParm1, s16* puParm2, u16 uParm3) {
|
||||
*puParm1 = *puParm2;
|
||||
puParm1[1] = uParm3;
|
||||
}
|
||||
|
||||
void func_8003871C(u16* puParm1)
|
||||
{
|
||||
*puParm1 = 0xFFFF;
|
||||
void func_8003871C(u16* puParm1) {
|
||||
*puParm1 = 0xFFFF;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038728.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038780.s")
|
||||
|
||||
void func_800387FC(u32 uParm1, u32* puParm2)
|
||||
{
|
||||
*puParm2 = 0;
|
||||
puParm2[1] = 0;
|
||||
void func_800387FC(u32 uParm1, u32* puParm2) {
|
||||
*puParm2 = 0;
|
||||
puParm2[1] = 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003880C.s")
|
||||
|
||||
void func_80038870(int iParm1)
|
||||
{
|
||||
*(u32*)(iParm1 + 4) = 0;
|
||||
void func_80038870(int iParm1) {
|
||||
*(u32*)(iParm1 + 4) = 0;
|
||||
}
|
||||
|
||||
u32 func_80038878(s32 iParm1)
|
||||
{
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = *(u32*)(iParm1 + 4) & 0xffff;
|
||||
*(int *)(iParm1 + 4) = *(u32*)(iParm1 + 4) + 1;
|
||||
|
||||
if (*(int *)(iParm1 + 8) <= (int)uVar1)
|
||||
{
|
||||
return 0xffff;
|
||||
}
|
||||
u32 func_80038878(s32 iParm1) {
|
||||
u32 uVar1;
|
||||
|
||||
return uVar1;
|
||||
uVar1 = *(u32*)(iParm1 + 4) & 0xffff;
|
||||
*(int*)(iParm1 + 4) = *(u32*)(iParm1 + 4) + 1;
|
||||
|
||||
if (*(int*)(iParm1 + 8) <= (int)uVar1) {
|
||||
return 0xffff;
|
||||
}
|
||||
|
||||
return uVar1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800388A8.s")
|
||||
@@ -56,7 +50,6 @@ u32 func_80038878(s32 iParm1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038A28.s")
|
||||
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038B7C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038BE0.s")
|
||||
@@ -175,12 +168,11 @@ u32 func_80038878(s32 iParm1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E214.s")
|
||||
|
||||
void func_8003E398(u16* puParm1)
|
||||
{
|
||||
*puParm1 = 0;
|
||||
puParm1[1] = 0;
|
||||
*(u32*)(puParm1 + 2) = 0;
|
||||
*(u32*)(puParm1 + 4) = 0;
|
||||
void func_8003E398(u16* puParm1) {
|
||||
*puParm1 = 0;
|
||||
puParm1[1] = 0;
|
||||
*(u32*)(puParm1 + 2) = 0;
|
||||
*(u32*)(puParm1 + 4) = 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E3AC.s")
|
||||
@@ -195,15 +187,12 @@ void func_8003E398(u16* puParm1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E688.s")
|
||||
|
||||
void func_8003E6C4(u16* puParm1)
|
||||
{
|
||||
*puParm1 = 0;
|
||||
func_8003E688();
|
||||
void func_8003E6C4(u16* puParm1) {
|
||||
*puParm1 = 0;
|
||||
func_8003E688();
|
||||
}
|
||||
|
||||
|
||||
void func_8003E6E4(u16* a0)
|
||||
{
|
||||
void func_8003E6E4(u16* a0) {
|
||||
*a0 = 0;
|
||||
}
|
||||
|
||||
@@ -211,21 +200,17 @@ void func_8003E6E4(u16* a0)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E750.s")
|
||||
|
||||
void func_8003E804(int iParm1)
|
||||
{
|
||||
func_8003E5B4(iParm1 + 0x14, iParm1 + 0x34);
|
||||
void func_8003E804(int iParm1) {
|
||||
func_8003E5B4(iParm1 + 0x14, iParm1 + 0x34);
|
||||
}
|
||||
|
||||
|
||||
void func_8003E82C(u32* a0)
|
||||
{
|
||||
void func_8003E82C(u32* a0) {
|
||||
*a0 = 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E834.s")
|
||||
|
||||
void func_8003E888(u32* a0)
|
||||
{
|
||||
void func_8003E888(u32* a0) {
|
||||
*a0 = 0;
|
||||
}
|
||||
|
||||
@@ -235,8 +220,7 @@ void func_8003E888(u32* a0)
|
||||
|
||||
/*
|
||||
NON-MATCHING
|
||||
void func_8003E8EC(u32 uParm1, u32* iParm2)
|
||||
{
|
||||
void func_8003E8EC(u32 uParm1, u32* iParm2) {
|
||||
iParm2[0x06] = iParm2[0x0E];
|
||||
iParm2[0x05] = iParm2[0x0D];
|
||||
iParm2[0x07] = iParm2[0x0F];
|
||||
@@ -246,30 +230,28 @@ void func_8003E8EC(u32 uParm1, u32* iParm2)
|
||||
iParm2[0x0B] = iParm2[0x13];
|
||||
iParm2[0x0C] = iParm2[0x14];
|
||||
|
||||
|
||||
|
||||
//int i;
|
||||
//for (i = 0; i < 4; i++)
|
||||
//{
|
||||
//for (i = 0; i < 4; i++) {
|
||||
//iParm2[0x06 + (i * 2)] = iParm2[0x0E + (i * 2)];
|
||||
//iParm2[0x07 + (i * 2)] = iParm2[0x0D + (i * 2)];
|
||||
//}
|
||||
}
|
||||
*/
|
||||
|
||||
u32 func_8003E934(int iParm1)
|
||||
{
|
||||
if (!((-1 < iParm1) && (iParm1 < 0x32)))
|
||||
return 0;
|
||||
u32 func_8003E934(int iParm1) {
|
||||
if (!((-1 < iParm1) && (iParm1 < 0x32))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void func_8003E954(u32 uParm1, u8* puParm2)
|
||||
{
|
||||
*puParm2 = 1;
|
||||
func_8003E82C(puParm2 + 0x13f0);
|
||||
func_8003E888(puParm2 + 0x13f4);
|
||||
func_800387FC(uParm1, puParm2 + 0x13f8);
|
||||
void func_8003E954(u32 uParm1, u8* puParm2) {
|
||||
*puParm2 = 1;
|
||||
func_8003E82C(puParm2 + 0x13f0);
|
||||
func_8003E888(puParm2 + 0x13f4);
|
||||
func_800387FC(uParm1, puParm2 + 0x13f8);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E9A0.s")
|
||||
@@ -323,19 +305,16 @@ void func_8003E954(u32 uParm1, u8* puParm2)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800418D0.s")
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void func_80041978(int iParm1, int iParm2)
|
||||
{
|
||||
u8* puVar1;
|
||||
void func_80041978(int iParm1, int iParm2) {
|
||||
u8* puVar1;
|
||||
|
||||
puVar1 = *(u8 **)(iParm1 + 8);
|
||||
if (puVar1 < puVar1 + iParm2)
|
||||
{
|
||||
*puVar1 = 0;
|
||||
while (puVar1++ < (u8*)(*(int *)(iParm1 + 8) + iParm2))
|
||||
{
|
||||
*puVar1 = 0;
|
||||
puVar1 = *(u8**)(iParm1 + 8);
|
||||
if (puVar1 < puVar1 + iParm2) {
|
||||
*puVar1 = 0;
|
||||
while (puVar1++ < (u8*)(*(int*)(iParm1 + 8) + iParm2)) {
|
||||
*puVar1 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041978.s")
|
||||
@@ -343,12 +322,11 @@ void func_80041978(int iParm1, int iParm2)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800419B0.s")
|
||||
|
||||
u32 func_80041A28(CollisionContext *a0, u32 a1, u32 a2)
|
||||
{
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = func_800419B0(a0, a1, a2, 0);
|
||||
return uVar1 & 0xff;
|
||||
u32 func_80041A28(CollisionContext* a0, u32 a1, u32 a2) {
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = func_800419B0(a0, a1, a2, 0);
|
||||
return uVar1 & 0xff;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041A4C.s")
|
||||
@@ -365,12 +343,11 @@ u32 func_80041A28(CollisionContext *a0, u32 a1, u32 a2)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041D4C.s")
|
||||
|
||||
u32 func_80041D94(u32 a0, u32 a1, u32 a2)
|
||||
{
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = func_800419B0(a0, a1, a2, 0);
|
||||
return uVar1 >> 0x15 & 0x1f;
|
||||
u32 func_80041D94(u32 a0, u32 a1, u32 a2) {
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = func_800419B0(a0, a1, a2, 0);
|
||||
return uVar1 >> 0x15 & 0x1f;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041DB8.s")
|
||||
@@ -385,12 +362,11 @@ u32 func_80041D94(u32 a0, u32 a1, u32 a2)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041EEC.s")
|
||||
|
||||
u32 func_80041F10(u32 a0, u32 a1, u32 a2)
|
||||
{
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = func_800419B0(a0, a1, a2, 1);
|
||||
return uVar1 & 0xf;
|
||||
u32 func_80041F10(u32 a0, u32 a1, u32 a2) {
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = func_800419B0(a0, a1, a2, 1);
|
||||
return uVar1 & 0xf;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041F34.s")
|
||||
@@ -409,29 +385,28 @@ u32 func_80041F10(u32 a0, u32 a1, u32 a2)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800420E4.s")
|
||||
|
||||
u32 func_80042108(u32 a0, u32 a1, u32 a2)
|
||||
{
|
||||
u32 result;
|
||||
s32 var1;
|
||||
u32 func_80042108(u32 a0, u32 a1, u32 a2) {
|
||||
u32 result;
|
||||
s32 var1;
|
||||
|
||||
var1 = func_800419B0(a0, a1, a2, 1);
|
||||
var1 = func_800419B0(a0, a1, a2, 1);
|
||||
|
||||
if (var1 << 4 < 0)
|
||||
result = 1;
|
||||
else
|
||||
result = 0;
|
||||
if (var1 << 4 < 0) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8004213C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042244.s")
|
||||
|
||||
u8 func_80042538(CollisionContext *colCtx, s32 iParm2)
|
||||
{
|
||||
u8 func_80042538(CollisionContext* colCtx, s32 iParm2) {
|
||||
u32 var1 = *(u32*)(iParm2 + 0xc);
|
||||
return var1;
|
||||
return var1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042548.s")
|
||||
@@ -451,4 +426,3 @@ u8 func_80042538(CollisionContext *colCtx, s32 iParm2)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042EF8.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042FC4.s")
|
||||
|
||||
|
||||
+315
-421
File diff suppressed because it is too large
Load Diff
@@ -1,29 +1,29 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void Draw_DListOpa(GlobalContext* globalCtx, u32 dlist)
|
||||
{
|
||||
void Draw_DListOpa(GlobalContext* globalCtx, u32 dlist) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 214);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 216), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 216),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, dlist);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 219);
|
||||
}
|
||||
|
||||
void Draw_DListXlu(GlobalContext* globalCtx, u32 dlist)
|
||||
{
|
||||
void Draw_DListXlu(GlobalContext* globalCtx, u32 dlist) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 228);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 230), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 230),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, dlist);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 233);
|
||||
|
||||
@@ -7,15 +7,13 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B65C.s")
|
||||
|
||||
s32 func_8005B6A0(GlobalContext* globalCtx, Collider* collision)
|
||||
{
|
||||
s32 func_8005B6A0(GlobalContext* globalCtx, Collider* collision) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B6B0.s")
|
||||
|
||||
s32 func_8005B6EC(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src)
|
||||
{
|
||||
s32 func_8005B6EC(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src) {
|
||||
collision->actor = actor;
|
||||
collision->unk_14 = src->unk_00;
|
||||
collision->colliderFlags = src->colliderFlags;
|
||||
@@ -26,8 +24,7 @@ s32 func_8005B6EC(GlobalContext* globalCtx, Collider* collision, Actor* actor, C
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005B72C(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src)
|
||||
{
|
||||
s32 func_8005B72C(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src) {
|
||||
collision->actor = actor;
|
||||
collision->unk_14 = src->unk_00;
|
||||
collision->colliderFlags = src->colliderFlags;
|
||||
@@ -38,20 +35,17 @@ s32 func_8005B72C(GlobalContext* globalCtx, Collider* collision, Actor* actor, C
|
||||
return 1;
|
||||
}
|
||||
|
||||
void func_8005B76C(GlobalContext* globalCtx, Collider* collision)
|
||||
{
|
||||
void func_8005B76C(GlobalContext* globalCtx, Collider* collision) {
|
||||
collision->at = NULL;
|
||||
collision->colliderFlags &= ~0x6;
|
||||
}
|
||||
|
||||
void func_8005B784(GlobalContext* globalCtx, Collider* collision)
|
||||
{
|
||||
void func_8005B784(GlobalContext* globalCtx, Collider* collision) {
|
||||
collision->ac = NULL;
|
||||
collision->collideFlags &= ~0x82;
|
||||
}
|
||||
|
||||
void func_8005B79C(GlobalContext* globalCtx, Collider* collision)
|
||||
{
|
||||
void func_8005B79C(GlobalContext* globalCtx, Collider* collision) {
|
||||
collision->ot = NULL;
|
||||
collision->maskA &= ~0x2;
|
||||
collision->maskB &= ~0x1;
|
||||
@@ -59,22 +53,18 @@ void func_8005B79C(GlobalContext* globalCtx, Collider* collision)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B7C0.s")
|
||||
|
||||
s32 func_8005B7E4(GlobalContext* globalCtx, ColliderTouch* touch)
|
||||
{
|
||||
s32 func_8005B7E4(GlobalContext* globalCtx, ColliderTouch* touch) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B7F4.s")
|
||||
|
||||
void func_8005B818(GlobalContext* globalCtx, ColliderBody* body)
|
||||
{
|
||||
|
||||
void func_8005B818(GlobalContext* globalCtx, ColliderBody* body) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B824.s")
|
||||
|
||||
s32 func_8005B850(GlobalContext* globalCtx, ColliderBump* bump)
|
||||
{
|
||||
s32 func_8005B850(GlobalContext* globalCtx, ColliderBump* bump) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -82,15 +72,13 @@ s32 func_8005B850(GlobalContext* globalCtx, ColliderBump* bump)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B884.s")
|
||||
|
||||
s32 func_8005B904(GlobalContext* globalCtx, ColliderBody* body)
|
||||
{
|
||||
s32 func_8005B904(GlobalContext* globalCtx, ColliderBody* body) {
|
||||
func_8005B7E4(globalCtx, &body->toucher);
|
||||
func_8005B850(globalCtx, &body->bumper);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005B93C(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInfoInner* bodyInfoInner)
|
||||
{
|
||||
s32 func_8005B93C(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInfoInner* bodyInfoInner) {
|
||||
body->flags = bodyInfoInner->bodyFlags;
|
||||
func_8005B7F4(globalCtx, &body->toucher, &bodyInfoInner->toucherMask);
|
||||
func_8005B860(globalCtx, &body->bumper, &bodyInfoInner->bumperMask);
|
||||
@@ -100,8 +88,7 @@ s32 func_8005B93C(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInfo
|
||||
return 1;
|
||||
}
|
||||
|
||||
void func_8005B9B0(GlobalContext* globalCtx, ColliderBody* body)
|
||||
{
|
||||
void func_8005B9B0(GlobalContext* globalCtx, ColliderBody* body) {
|
||||
body->unk_18 = 0;
|
||||
body->unk_20 = 0;
|
||||
body->toucherFlags &= ~0x2;
|
||||
@@ -109,8 +96,7 @@ void func_8005B9B0(GlobalContext* globalCtx, ColliderBody* body)
|
||||
func_8005B818(globalCtx, body);
|
||||
}
|
||||
|
||||
void func_8005B9E8(GlobalContext* globalCtx, ColliderBody* body)
|
||||
{
|
||||
void func_8005B9E8(GlobalContext* globalCtx, ColliderBody* body) {
|
||||
body->bumper.unk_0A = 0;
|
||||
body->bumperFlags &= ~0x2;
|
||||
body->bumperFlags &= ~0x80;
|
||||
@@ -120,15 +106,13 @@ void func_8005B9E8(GlobalContext* globalCtx, ColliderBody* body)
|
||||
body->bumper.unk_06 = body->bumper.unk_0A;
|
||||
}
|
||||
|
||||
void func_8005BA1C(GlobalContext* globalCtx, ColliderBody* body)
|
||||
{
|
||||
void func_8005BA1C(GlobalContext* globalCtx, ColliderBody* body) {
|
||||
body->flags2 &= ~0x2;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005BA30.s")
|
||||
|
||||
s32 func_8005BA74(UNK_TYPE arg0, UNK_TYPE arg1)
|
||||
{
|
||||
s32 func_8005BA74(UNK_TYPE arg0, UNK_TYPE arg1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -158,73 +142,64 @@ s32 func_8005BA74(UNK_TYPE arg0, UNK_TYPE arg1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005C2BC.s")
|
||||
|
||||
s32 func_8005C318(GlobalContext* globalCtx, ColliderDimensions* dim)
|
||||
{
|
||||
s32 func_8005C318(GlobalContext* globalCtx, ColliderDimensions* dim) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005C328(GlobalContext* globalCtx, ColliderDimensions* dest, ColliderDimensions* src)
|
||||
{
|
||||
s32 func_8005C328(GlobalContext* globalCtx, ColliderDimensions* dest, ColliderDimensions* src) {
|
||||
*dest = *src;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 ActorCollider_AllocCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 ActorCollider_AllocCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B65C(globalCtx, &collision->base);
|
||||
func_8005B884(globalCtx, &collision->body);
|
||||
func_8005C2BC(globalCtx, &collision->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 ActorCollider_FreeCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 ActorCollider_FreeCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B6A0(globalCtx, &collision->base);
|
||||
func_8005B904(globalCtx, &collision->body);
|
||||
func_8005C318(globalCtx, &collision->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit* src)
|
||||
{
|
||||
s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit* src) {
|
||||
func_8005B6B0(globalCtx, &collision->base, &src->body);
|
||||
func_8005B93C(globalCtx, &collision->body, &src->inner);
|
||||
func_8005C328(globalCtx, &collision->dim, &src->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005C450(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src)
|
||||
{
|
||||
s32 func_8005C450(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) {
|
||||
func_8005B6EC(globalCtx, &collision->base, actor, &src->body);
|
||||
func_8005B93C(globalCtx, &collision->body, &src->inner);
|
||||
func_8005C328(globalCtx, &collision->dim, &src->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src)
|
||||
{
|
||||
s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor,
|
||||
ColliderCylinderInit* src) {
|
||||
func_8005B72C(globalCtx, &collision->base, actor, &src->body);
|
||||
func_8005B93C(globalCtx, &collision->body, &src->inner);
|
||||
func_8005C328(globalCtx, &collision->dim, &src->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005C508(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005C508(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B76C(globalCtx, &collision->base);
|
||||
func_8005B9B0(globalCtx, &collision->body);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005C540(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005C540(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B784(globalCtx, &collision->base);
|
||||
func_8005B9E8(globalCtx, &collision->body);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B79C(globalCtx, &collision->base);
|
||||
func_8005BA1C(globalCtx, &collision->body);
|
||||
return 1;
|
||||
@@ -232,8 +207,7 @@ s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005C5B0.s")
|
||||
|
||||
s32 func_8005C5F8(UNK_TYPE arg0, UNK_TYPE arg1)
|
||||
{
|
||||
s32 func_8005C5F8(UNK_TYPE arg0, UNK_TYPE arg1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -269,55 +243,48 @@ s32 func_8005CEB4(GlobalContext* globalCtx, ColliderDimensions* dim) {
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005CF90.s")
|
||||
|
||||
s32 func_8005D018(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005D018(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B65C(globalCtx, &collision->base);
|
||||
func_8005B884(globalCtx, &collision->body);
|
||||
func_8005CE6C(globalCtx, &collision->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005D060(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005D060(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B6A0(globalCtx, &collision->base);
|
||||
func_8005B904(globalCtx, &collision->body);
|
||||
func_8005CEB4(globalCtx, &collision->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005D0A8(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src)
|
||||
{
|
||||
s32 func_8005D0A8(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) {
|
||||
func_8005B6EC(globalCtx, &collision->base, actor, &src->body);
|
||||
func_8005B93C(globalCtx, &collision->body, &src->inner);
|
||||
func_8005CF90(globalCtx, &collision->dim, &src->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005D104(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src)
|
||||
{
|
||||
s32 func_8005D104(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) {
|
||||
func_8005B72C(globalCtx, &collision->base, actor, &src->body);
|
||||
func_8005B93C(globalCtx, &collision->body, &src->inner);
|
||||
func_8005CF90(globalCtx, &collision->dim, &src->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005D160(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005D160(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B76C(globalCtx, &collision->base);
|
||||
func_8005B9B0(globalCtx, &collision->body);
|
||||
func_8005CEC4(globalCtx, &collision->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005D1A8(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005D1A8(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B784(globalCtx, &collision->base);
|
||||
func_8005B9E8(globalCtx, &collision->body);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005D1E0(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005D1E0(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B79C(globalCtx, &collision->base);
|
||||
func_8005BA1C(globalCtx, &collision->body);
|
||||
return 1;
|
||||
@@ -331,9 +298,7 @@ s32 func_8005D1E0(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005D3BC.s")
|
||||
|
||||
void func_8005D400(UNK_TYPE arg0, UNK_TYPE arg1)
|
||||
{
|
||||
|
||||
void func_8005D400(UNK_TYPE arg0, UNK_TYPE arg1) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005D40C.s")
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void SaveContext_Init(void)
|
||||
{
|
||||
void SaveContext_Init(void) {
|
||||
bzero(&gSaveContext, sizeof(gSaveContext));
|
||||
D_8015FA88 = 0;
|
||||
D_8015FA8C = 0;
|
||||
@@ -18,4 +17,3 @@ void SaveContext_Init(void)
|
||||
gSaveContext.transition_type = 0xFF;
|
||||
gSaveContext.unk_13EE = 50;
|
||||
}
|
||||
|
||||
|
||||
+35
-42
@@ -1,15 +1,13 @@
|
||||
#include <ultra64.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void func_80110990(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_80110990(GlobalContext* globalCtx) {
|
||||
func_80080F44(globalCtx);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc, stack usage and minor ordering differences
|
||||
void func_801109B0(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_801109B0(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
s32 parameterStart;
|
||||
s32 parameterSize;
|
||||
@@ -32,9 +30,9 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
interfaceCtx->unk_228 = XREG(95);
|
||||
interfaceCtx->minimapAlpha = 0;
|
||||
interfaceCtx->unk_260 = 0;
|
||||
interfaceCtx->unk_244 = interfaceCtx->aAlpha = interfaceCtx->bAlpha =
|
||||
interfaceCtx->cLeftAlpha = interfaceCtx->cDownAlpha = interfaceCtx->cRightAlpha =
|
||||
interfaceCtx->healthAlpha = interfaceCtx->startAlpha = interfaceCtx->magicAlpha = 0;
|
||||
interfaceCtx->unk_244 = interfaceCtx->aAlpha = interfaceCtx->bAlpha = interfaceCtx->cLeftAlpha =
|
||||
interfaceCtx->cDownAlpha = interfaceCtx->cRightAlpha = interfaceCtx->healthAlpha = interfaceCtx->startAlpha =
|
||||
interfaceCtx->magicAlpha = 0;
|
||||
|
||||
parameterStart = _parameter_staticSegmentRomStart;
|
||||
parameterSize = _parameter_staticSegmentRomEnd - parameterStart;
|
||||
@@ -48,7 +46,7 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
|
||||
if (interfaceCtx->parameterSegment == NULL)
|
||||
__assert("parameter->parameterSegment != NULL", "../z_construct.c", 161);
|
||||
|
||||
|
||||
DmaMgr_SendRequest1(interfaceCtx->parameterSegment, parameterStart, parameterSize, "../z_construct.c", 162);
|
||||
|
||||
interfaceCtx->do_actionSegment = Game_Alloc(&globalCtx->state, 0x480, "../z_construct.c", 166);
|
||||
@@ -69,7 +67,8 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
else
|
||||
do_actionOffset = 0x5700;
|
||||
|
||||
DmaMgr_SendRequest1(interfaceCtx->do_actionSegment, do_actionStart + do_actionOffset, 0x300, "../z_construct.c", 174);
|
||||
DmaMgr_SendRequest1(interfaceCtx->do_actionSegment, do_actionStart + do_actionOffset, 0x300, "../z_construct.c",
|
||||
174);
|
||||
|
||||
if (gSaveContext.language == 0)
|
||||
do_actionOffset = 0x480;
|
||||
@@ -78,7 +77,8 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
else
|
||||
do_actionOffset = 0x5B80;
|
||||
|
||||
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->do_actionSegment + 0x300), do_actionStart + do_actionOffset, 0x180, "../z_construct.c", 178);
|
||||
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->do_actionSegment + 0x300), do_actionStart + do_actionOffset, 0x180,
|
||||
"../z_construct.c", 178);
|
||||
|
||||
interfaceCtx->icon_itemSegment = Game_Alloc(&globalCtx->state, 0x4000, "../z_construct.c", 190);
|
||||
|
||||
@@ -89,45 +89,42 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
if (interfaceCtx->icon_itemSegment == NULL)
|
||||
__assert("parameter->icon_itemSegment != NULL", "../z_construct.c", 193);
|
||||
|
||||
osSyncPrintf("Register_Item[%x, %x, %x, %x]\n",
|
||||
gSaveContext.equips.button_items[0], gSaveContext.equips.button_items[1],
|
||||
gSaveContext.equips.button_items[2], gSaveContext.equips.button_items[3]);
|
||||
osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.button_items[0],
|
||||
gSaveContext.equips.button_items[1], gSaveContext.equips.button_items[2],
|
||||
gSaveContext.equips.button_items[3]);
|
||||
|
||||
if (gSaveContext.equips.button_items[0] < 0xF0)
|
||||
DmaMgr_SendRequest1(interfaceCtx->icon_itemSegment,
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80,
|
||||
0x1000, "../z_construct.c", 198);
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80, 0x1000,
|
||||
"../z_construct.c", 198);
|
||||
else if (gSaveContext.equips.button_items[0] != 0xFF)
|
||||
DmaMgr_SendRequest1(interfaceCtx->icon_itemSegment,
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80,
|
||||
0x1000, "../z_construct.c", 203);
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80, 0x1000,
|
||||
"../z_construct.c", 203);
|
||||
|
||||
if (gSaveContext.equips.button_items[1] < 0xF0)
|
||||
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x1000),
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[1] * 0x80,
|
||||
0x1000, "../z_construct.c", 209);
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[1] * 0x80, 0x1000,
|
||||
"../z_construct.c", 209);
|
||||
|
||||
if (gSaveContext.equips.button_items[2] < 0xF0)
|
||||
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x2000),
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[2] * 0x80,
|
||||
0x1000, "../z_construct.c", 214);
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[2] * 0x80, 0x1000,
|
||||
"../z_construct.c", 214);
|
||||
|
||||
if (gSaveContext.equips.button_items[3] < 0xF0)
|
||||
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x3000),
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[3] * 0x80,
|
||||
0x1000, "../z_construct.c", 219);
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[3] * 0x80, 0x1000,
|
||||
"../z_construct.c", 219);
|
||||
|
||||
osSyncPrintf("EVENT=%d\n", gSaveContext.timer_1_state);
|
||||
|
||||
if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8) ||
|
||||
(gSaveContext.timer_2_state == 4) || (gSaveContext.timer_2_state == 10))
|
||||
{
|
||||
if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8) || (gSaveContext.timer_2_state == 4) ||
|
||||
(gSaveContext.timer_2_state == 10)) {
|
||||
osSyncPrintf("restart_flag=%d\n", gSaveContext.respawn_flag);
|
||||
|
||||
if ((gSaveContext.respawn_flag == -1) || (gSaveContext.respawn_flag == 1))
|
||||
{
|
||||
if (gSaveContext.timer_1_state == 4)
|
||||
{
|
||||
if ((gSaveContext.respawn_flag == -1) || (gSaveContext.respawn_flag == 1)) {
|
||||
if (gSaveContext.timer_1_state == 4) {
|
||||
gSaveContext.timer_1_state = 1;
|
||||
gSaveContext.timer_x[0] = 140;
|
||||
gSaveContext.timer_y[0] = 80;
|
||||
@@ -147,8 +144,7 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
gSaveContext.timer_y[temp] = 46;
|
||||
}
|
||||
|
||||
if ((gSaveContext.timer_1_state >= 11) && (gSaveContext.timer_1_state < 16))
|
||||
{
|
||||
if ((gSaveContext.timer_1_state >= 11) && (gSaveContext.timer_1_state < 16)) {
|
||||
gSaveContext.timer_1_state = 0;
|
||||
// Translates to: "Timer Stop!!!!!!!!!!!!!!!!!!!!!!"
|
||||
osSyncPrintf("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", gSaveContext.timer_1_state);
|
||||
@@ -179,8 +175,7 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_construct/func_801109B0.s")
|
||||
#endif
|
||||
|
||||
void func_80110F68(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_80110F68(GlobalContext* globalCtx) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
s32 pad;
|
||||
|
||||
@@ -202,16 +197,16 @@ void func_80110F68(GlobalContext* globalCtx)
|
||||
// Translates to: "Textbox game_alloc=%x"
|
||||
osSyncPrintf("吹き出しgame_alloc=%x\n", 0x2200);
|
||||
|
||||
if (msgCtx->textboxSegment == NULL)
|
||||
if (msgCtx->textboxSegment == NULL) {
|
||||
__assert("message->fukidashiSegment != NULL", "../z_construct.c", 352);
|
||||
}
|
||||
|
||||
func_8006EF10(&globalCtx->msgCtx.unk_128);
|
||||
|
||||
YREG(31) = 0;
|
||||
}
|
||||
|
||||
void func_80111070(void)
|
||||
{
|
||||
void func_80111070(void) {
|
||||
YREG(8) = 0xA;
|
||||
YREG(14) = 0;
|
||||
YREG(15) = 0;
|
||||
@@ -526,8 +521,7 @@ void func_80111070(void)
|
||||
WREG(94) = 3;
|
||||
WREG(95) = 6;
|
||||
|
||||
if (gSaveContext.game_mode == 0)
|
||||
{
|
||||
if (gSaveContext.game_mode == 0) {
|
||||
VREG(0) = 0x34;
|
||||
VREG(1) = 0x24;
|
||||
VREG(2) = 0xD6;
|
||||
@@ -618,7 +612,6 @@ void func_80111070(void)
|
||||
VREG(92) = -0x3F;
|
||||
}
|
||||
|
||||
void func_80112098(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_80112098(GlobalContext* globalCtx) {
|
||||
func_80111070();
|
||||
}
|
||||
|
||||
+87
-135
@@ -5,73 +5,43 @@
|
||||
#include <regs.h>
|
||||
#include <PR/os_cont.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u8 x;
|
||||
u8 y;
|
||||
u8 colorId;
|
||||
char text[0x15];
|
||||
} PrintTextBuffer;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u16 push;
|
||||
u16 held;
|
||||
} InputCombo;
|
||||
|
||||
GameInfo* gGameInfo;
|
||||
int D_8015FA94; //no known symbols
|
||||
GameInfo* gGameInfo;
|
||||
int D_8015FA94; // no known symbols
|
||||
PrintTextBuffer D_8015FA98[0x16];
|
||||
|
||||
s16 D_8011E0B0 = 0; //PrintTextBuffer index
|
||||
s16 D_8011E0B0 = 0; // PrintTextBuffer index
|
||||
Color_RGBA8 printTextColors[] = {
|
||||
{ 0xFF, 0xFF, 0x20, 0xC0 },
|
||||
{ 0xFF, 0x96, 0x80, 0xC0 },
|
||||
{ 0x80, 0x60, 0x00, 0x40 },
|
||||
{ 0xC0, 0x80, 0x10, 0x80 },
|
||||
{ 0xFF, 0xC0, 0x20, 0x80 },
|
||||
{ 0xE6, 0xE6, 0xDC, 0x40 },
|
||||
{ 0x80, 0x96, 0xFF, 0x80 },
|
||||
{ 0x80, 0xFF, 0x20, 0x80 },
|
||||
{ 0xFF, 0xFF, 0x20, 0xC0 }, { 0xFF, 0x96, 0x80, 0xC0 }, { 0x80, 0x60, 0x00, 0x40 }, { 0xC0, 0x80, 0x10, 0x80 },
|
||||
{ 0xFF, 0xC0, 0x20, 0x80 }, { 0xE6, 0xE6, 0xDC, 0x40 }, { 0x80, 0x96, 0xFF, 0x80 }, { 0x80, 0xFF, 0x20, 0x80 },
|
||||
};
|
||||
|
||||
InputCombo inputCombos[REG_GROUPS] = {
|
||||
{ L_TRIG, U_CBUTTONS },
|
||||
{ L_TRIG, L_CBUTTONS },
|
||||
{ L_TRIG, D_CBUTTONS },
|
||||
{ L_TRIG, A_BUTTON },
|
||||
{ R_TRIG, D_CBUTTONS },
|
||||
{ L_TRIG, R_CBUTTONS },
|
||||
{ L_TRIG, R_TRIG },
|
||||
{ L_TRIG, L_JPAD },
|
||||
{ L_TRIG, R_JPAD },
|
||||
{ L_TRIG, U_JPAD },
|
||||
{ L_TRIG, B_BUTTON },
|
||||
{ L_TRIG, Z_TRIG },
|
||||
{ L_TRIG, D_JPAD },
|
||||
{ R_TRIG, A_BUTTON },
|
||||
{ R_TRIG, B_BUTTON },
|
||||
{ R_TRIG, Z_TRIG },
|
||||
{ R_TRIG, L_TRIG },
|
||||
{ R_TRIG, U_CBUTTONS },
|
||||
{ R_TRIG, R_CBUTTONS },
|
||||
{ R_TRIG, L_JPAD },
|
||||
{ R_TRIG, L_CBUTTONS },
|
||||
{ R_TRIG, START_BUTTON },
|
||||
{ L_TRIG, START_BUTTON },
|
||||
{ R_TRIG, R_JPAD },
|
||||
{ R_TRIG, U_JPAD },
|
||||
{ START_BUTTON, R_TRIG },
|
||||
{ START_BUTTON, A_BUTTON },
|
||||
{ START_BUTTON, B_BUTTON },
|
||||
{ L_TRIG, U_CBUTTONS }, { L_TRIG, L_CBUTTONS }, { L_TRIG, D_CBUTTONS }, { L_TRIG, A_BUTTON },
|
||||
{ R_TRIG, D_CBUTTONS }, { L_TRIG, R_CBUTTONS }, { L_TRIG, R_TRIG }, { L_TRIG, L_JPAD },
|
||||
{ L_TRIG, R_JPAD }, { L_TRIG, U_JPAD }, { L_TRIG, B_BUTTON }, { L_TRIG, Z_TRIG },
|
||||
{ L_TRIG, D_JPAD }, { R_TRIG, A_BUTTON }, { R_TRIG, B_BUTTON }, { R_TRIG, Z_TRIG },
|
||||
{ R_TRIG, L_TRIG }, { R_TRIG, U_CBUTTONS }, { R_TRIG, R_CBUTTONS }, { R_TRIG, L_JPAD },
|
||||
{ R_TRIG, L_CBUTTONS }, { R_TRIG, START_BUTTON }, { L_TRIG, START_BUTTON }, { R_TRIG, R_JPAD },
|
||||
{ R_TRIG, U_JPAD }, { START_BUTTON, R_TRIG }, { START_BUTTON, A_BUTTON }, { START_BUTTON, B_BUTTON },
|
||||
{ START_BUTTON, R_CBUTTONS },
|
||||
};
|
||||
|
||||
char regChar[] = " SOPQMYDUIZCNKXcsiWAVHGmnBdkb";
|
||||
|
||||
//initialize GameInfo
|
||||
void func_800636C0()
|
||||
{
|
||||
// initialize GameInfo
|
||||
void func_800636C0() {
|
||||
s32 i;
|
||||
|
||||
gGameInfo = (GameInfo*)SystemArena_MallocDebug(sizeof(GameInfo), "../z_debug.c", 260);
|
||||
@@ -80,26 +50,22 @@ void func_800636C0()
|
||||
gGameInfo->regCur = 0;
|
||||
gGameInfo->dpadLast = 0;
|
||||
gGameInfo->repeat = 0;
|
||||
for (i = 0; i < ARRAY_COUNT(gGameInfo->data); i++)
|
||||
{
|
||||
for (i = 0; i < ARRAY_COUNT(gGameInfo->data); i++) {
|
||||
gGameInfo->data[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//Called when free movement is active.
|
||||
//8011D394 to enable camera debugger
|
||||
void func_8006375C(s32 arg0, s32 arg1, float* d_80855320)
|
||||
{
|
||||
|
||||
// Called when free movement is active.
|
||||
// 8011D394 to enable camera debugger
|
||||
void func_8006375C(s32 arg0, s32 arg1, float* d_80855320) {
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING //regalloc
|
||||
//Copy Camera Debugger Text
|
||||
void func_8006376C(u8 x, u8 y, u8 colorId, const char* text)
|
||||
{
|
||||
#ifdef NON_MATCHING // regalloc
|
||||
// Copy Camera Debugger Text
|
||||
void func_8006376C(u8 x, u8 y, u8 colorId, const char* text) {
|
||||
PrintTextBuffer* buf;
|
||||
char* bufText;
|
||||
s16 i; //v1
|
||||
s16 i; // v1
|
||||
|
||||
buf = &D_8015FA98[D_8011E0B0];
|
||||
if (D_8011E0B0 < 0x16) {
|
||||
@@ -112,9 +78,11 @@ void func_8006376C(u8 x, u8 y, u8 colorId, const char* text)
|
||||
bufText = buf->text + 1;
|
||||
|
||||
if (*buf->text = *text++) {
|
||||
do if (i++ > 0x14) {
|
||||
break;
|
||||
} while (*bufText++ = *text++);
|
||||
do
|
||||
if (i++ > 0x14) {
|
||||
break;
|
||||
}
|
||||
while (*bufText++ = *text++);
|
||||
}
|
||||
|
||||
*bufText = '\0';
|
||||
@@ -124,34 +92,31 @@ void func_8006376C(u8 x, u8 y, u8 colorId, const char* text)
|
||||
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug/func_8006376C.s")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//Draw Text
|
||||
void func_80063828(GfxPrint* gfxPrint)
|
||||
{
|
||||
// Draw Text
|
||||
void func_80063828(GfxPrint* gfxPrint) {
|
||||
s32 i;
|
||||
Color_RGBA8* color;
|
||||
PrintTextBuffer* buffer;
|
||||
char* text;
|
||||
|
||||
i = 0;
|
||||
if (D_8011E0B0 > 0)
|
||||
{
|
||||
do
|
||||
{
|
||||
if (D_8011E0B0 > 0) {
|
||||
do {
|
||||
buffer = &D_8015FA98[i];
|
||||
text = buffer->text;
|
||||
|
||||
color = &printTextColors[buffer->colorId];
|
||||
GfxPrint_SetColor(gfxPrint, color->r, color->g, color->b, color->a);
|
||||
GfxPrint_SetPos(gfxPrint, buffer->x, buffer->y);
|
||||
GfxPrint_Printf(gfxPrint, "%s", text);
|
||||
GfxPrint_Printf(gfxPrint, "%s", text);
|
||||
i += 1;
|
||||
} while (i < D_8011E0B0);
|
||||
}
|
||||
}
|
||||
|
||||
//Edit REG
|
||||
// Edit REG
|
||||
void func_8006390C(Input* input) {
|
||||
|
||||
s32 dpad;
|
||||
@@ -162,18 +127,14 @@ void func_8006390C(Input* input) {
|
||||
|
||||
regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE;
|
||||
dpad = input->raw.pad & 0xF00;
|
||||
if (!~(input->raw.pad | ~L_TRIG) ||
|
||||
!~(input->raw.pad | ~R_TRIG) ||
|
||||
!~(input->raw.pad | ~START_BUTTON)) {
|
||||
if (!~(input->raw.pad | ~L_TRIG) || !~(input->raw.pad | ~R_TRIG) || !~(input->raw.pad | ~START_BUTTON)) {
|
||||
input_combo = inputCombos;
|
||||
for (i = 0; i < REG_GROUPS; i++)
|
||||
{
|
||||
if (~(~input_combo->push | input->raw.pad) ||
|
||||
~(~input_combo->held | input->padPressed)) {
|
||||
for (i = 0; i < REG_GROUPS; i++) {
|
||||
if (~(~input_combo->push | input->raw.pad) || ~(~input_combo->held | input->padPressed)) {
|
||||
input_combo++;
|
||||
}
|
||||
else
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < REG_GROUPS) {
|
||||
@@ -184,10 +145,8 @@ void func_8006390C(Input* input) {
|
||||
gGameInfo->regGroup = i;
|
||||
gGameInfo->regPage = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (gGameInfo->regPage - 1)
|
||||
{
|
||||
} else {
|
||||
switch (gGameInfo->regPage - 1) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
@@ -195,80 +154,73 @@ void func_8006390C(Input* input) {
|
||||
case 4:
|
||||
case 5:
|
||||
|
||||
if (dpad == gGameInfo->dpadLast) {
|
||||
gGameInfo->repeat--;
|
||||
if (gGameInfo->repeat < 0) {
|
||||
gGameInfo->repeat = 1;
|
||||
if (dpad == gGameInfo->dpadLast) {
|
||||
gGameInfo->repeat--;
|
||||
if (gGameInfo->repeat < 0) {
|
||||
gGameInfo->repeat = 1;
|
||||
} else {
|
||||
dpad ^= gGameInfo->dpadLast;
|
||||
}
|
||||
} else {
|
||||
gGameInfo->repeat = 0x10;
|
||||
gGameInfo->dpadLast = dpad;
|
||||
}
|
||||
else {
|
||||
dpad ^= gGameInfo->dpadLast;
|
||||
}
|
||||
}
|
||||
else {
|
||||
gGameInfo->repeat = 0x10;
|
||||
gGameInfo->dpadLast = dpad;
|
||||
}
|
||||
|
||||
increment =
|
||||
(dpad & R_JPAD) ? (
|
||||
!~(input->raw.pad | ~(A_BUTTON | B_BUTTON)) ? 1000 :
|
||||
!~(input->raw.pad | ~A_BUTTON) ? 100 :
|
||||
!~(input->raw.pad | ~B_BUTTON) ? 10 : 1) :
|
||||
(dpad & L_JPAD) ? (
|
||||
!~(input->raw.pad | ~(A_BUTTON | B_BUTTON)) ? -1000 :
|
||||
!~(input->raw.pad | ~A_BUTTON) ? -100 :
|
||||
!~(input->raw.pad | ~B_BUTTON) ? -10 : -1) :
|
||||
0;
|
||||
increment = (dpad & R_JPAD)
|
||||
? (!~(input->raw.pad | ~(A_BUTTON | B_BUTTON))
|
||||
? 1000
|
||||
: !~(input->raw.pad | ~A_BUTTON) ? 100 : !~(input->raw.pad | ~B_BUTTON) ? 10 : 1)
|
||||
: (dpad & L_JPAD) ? (!~(input->raw.pad | ~(A_BUTTON | B_BUTTON))
|
||||
? -1000
|
||||
: !~(input->raw.pad | ~A_BUTTON)
|
||||
? -100
|
||||
: !~(input->raw.pad | ~B_BUTTON) ? -10 : -1)
|
||||
: 0;
|
||||
|
||||
gGameInfo->data[gGameInfo->regCur + regGroup] += increment;
|
||||
if (dpad & U_JPAD) {
|
||||
gGameInfo->regCur--;
|
||||
if (gGameInfo->regCur < 0) {
|
||||
gGameInfo->regCur = REG_PER_PAGE - 1;
|
||||
gGameInfo->data[gGameInfo->regCur + regGroup] += increment;
|
||||
if (dpad & U_JPAD) {
|
||||
gGameInfo->regCur--;
|
||||
if (gGameInfo->regCur < 0) {
|
||||
gGameInfo->regCur = REG_PER_PAGE - 1;
|
||||
}
|
||||
} else if (dpad & D_JPAD) {
|
||||
gGameInfo->regCur++;
|
||||
if (gGameInfo->regCur >= REG_PER_PAGE) {
|
||||
gGameInfo->regCur = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (dpad & D_JPAD) {
|
||||
gGameInfo->regCur++;
|
||||
if (gGameInfo->regCur >= REG_PER_PAGE) {
|
||||
gGameInfo->regCur = 0;
|
||||
if (iREG(0)) {
|
||||
iREG(0) = 0;
|
||||
func_800AA000(0, iREG(1), iREG(2), iREG(3));
|
||||
}
|
||||
}
|
||||
if (iREG(0)) {
|
||||
iREG(0) = 0;
|
||||
func_800AA000(0, iREG(1), iREG(2), iREG(3));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Draw Memory Viewer
|
||||
void func_80063C04(GfxPrint* gfxPrint)
|
||||
{
|
||||
// Draw Memory Viewer
|
||||
void func_80063C04(GfxPrint* gfxPrint) {
|
||||
s32 i;
|
||||
s32 page;
|
||||
s32 regGroup;
|
||||
s32 test; //removing affects stack
|
||||
s32 test; // removing affects stack
|
||||
char name[3];
|
||||
|
||||
page = (gGameInfo->regPage * REG_PER_PAGE) - REG_PER_PAGE;
|
||||
regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE;
|
||||
|
||||
//set up register name string
|
||||
// set up register name string
|
||||
name[0] = 'R';
|
||||
name[1] = regChar[gGameInfo->regGroup]; //r_group type char
|
||||
name[1] = regChar[gGameInfo->regGroup]; // r_group type char
|
||||
name[2] = '\0';
|
||||
GfxPrint_SetColor(gfxPrint, 0, 0x80, 0x80, 0x80);
|
||||
|
||||
for (i = 0; i != REG_PER_PAGE; i++)
|
||||
{
|
||||
if (i == gGameInfo->regCur)
|
||||
{
|
||||
for (i = 0; i != REG_PER_PAGE; i++) {
|
||||
if (i == gGameInfo->regCur) {
|
||||
GfxPrint_SetColor(gfxPrint, 0, 0xff, 0xff, 0xff);
|
||||
}
|
||||
GfxPrint_SetPos(gfxPrint, 3, i + 5);
|
||||
GfxPrint_Printf(gfxPrint, "%s%02d%6d", &name, page + i, gGameInfo->data[i + regGroup]);
|
||||
if (i == gGameInfo->regCur)
|
||||
{
|
||||
if (i == gGameInfo->regCur) {
|
||||
GfxPrint_SetColor(gfxPrint, 0, 0x80, 0x80, 0x80);
|
||||
}
|
||||
}
|
||||
@@ -281,7 +233,7 @@ void func_80063D7C(GraphicsContext* gfxCtx) {
|
||||
void* unk2[6];
|
||||
GfxPrint gfxPrint;
|
||||
void* unk[2];
|
||||
Gfx* dlFrame[4]; //stores state of GfxCtx next ptrs
|
||||
Gfx* dlFrame[4]; // stores state of GfxCtx next ptrs
|
||||
|
||||
func_800C6AC4(&dlFrame, gfxCtx, "../z_debug.c", 628);
|
||||
GfxPrint_Ctor(&gfxPrint);
|
||||
@@ -303,7 +255,7 @@ void func_80063D7C(GraphicsContext* gfxCtx) {
|
||||
gSPEndDisplayList(sp7C++);
|
||||
func_800C6C28(sp78, sp7C);
|
||||
gfxCtx->polyOpa.p = sp7C;
|
||||
if (0);
|
||||
if (0) {}
|
||||
func_800C6B54(&dlFrame, gfxCtx, "../z_debug.c", 664);
|
||||
GfxPrint_Dtor(&gfxPrint);
|
||||
}
|
||||
|
||||
+19
-33
@@ -1,25 +1,22 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 drawType; // indicates which draw function to use when displaying the object
|
||||
/* 0x04 */ u32 drawArg; // segment address (display list or texture) passed to the draw funciton when called
|
||||
} DebugDispObjectInfo; // size = 0x8
|
||||
/* 0x04 */ u32 drawArg; // segment address (display list or texture) passed to the draw funciton when called
|
||||
} DebugDispObjectInfo; // size = 0x8
|
||||
|
||||
typedef void (*DebugDispObject_DrawFunc)(DebugDispObject*, u32, GlobalContext*);
|
||||
|
||||
static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx);
|
||||
static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx);
|
||||
|
||||
static DebugDispObject_DrawFunc sDebugObjectDrawFuncTable[] =
|
||||
{
|
||||
static DebugDispObject_DrawFunc sDebugObjectDrawFuncTable[] = {
|
||||
DebugDisplay_DrawSpriteI8,
|
||||
DebugDisplay_DrawPolygon,
|
||||
};
|
||||
|
||||
static DebugDispObjectInfo sDebugObjectInfoTable[] =
|
||||
{
|
||||
static DebugDispObjectInfo sDebugObjectInfoTable[] = {
|
||||
{ 0, 0x040035F0 }, // Circle
|
||||
{ 0, 0x040038F0 }, // Cross
|
||||
{ 0, 0x040036F0 }, // Ball
|
||||
@@ -32,15 +29,13 @@ static Lights1 sDebugObjectLights = gdSPDefLights1(0x80, 0x80, 0x80, 0xFF, 0xFF,
|
||||
|
||||
static DebugDispObject* sDebugObjectListHead;
|
||||
|
||||
void DebugDisplay_Init(void)
|
||||
{
|
||||
void DebugDisplay_Init(void) {
|
||||
sDebugObjectListHead = NULL;
|
||||
}
|
||||
|
||||
DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ,
|
||||
f32 scaleX, f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha,
|
||||
s16 type, GraphicsContext* gfxCtx)
|
||||
{
|
||||
DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, f32 scaleX,
|
||||
f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha, s16 type,
|
||||
GraphicsContext* gfxCtx) {
|
||||
DebugDispObject* prevHead = sDebugObjectListHead;
|
||||
|
||||
sDebugObjectListHead = Graph_Alloc(gfxCtx, sizeof(DebugDispObject));
|
||||
@@ -64,21 +59,18 @@ DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX,
|
||||
return sDebugObjectListHead;
|
||||
}
|
||||
|
||||
void DebugDisplay_DrawObjects(GlobalContext* globalCtx)
|
||||
{
|
||||
void DebugDisplay_DrawObjects(GlobalContext* globalCtx) {
|
||||
DebugDispObject* dispObj = sDebugObjectListHead;
|
||||
DebugDispObjectInfo* objInfo;
|
||||
|
||||
while (dispObj != NULL)
|
||||
{
|
||||
while (dispObj != NULL) {
|
||||
objInfo = &sDebugObjectInfoTable[dispObj->type];
|
||||
sDebugObjectDrawFuncTable[objInfo->drawType](dispObj, objInfo->drawArg, globalCtx);
|
||||
dispObj = dispObj->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx)
|
||||
{
|
||||
static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
|
||||
@@ -93,24 +85,17 @@ static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, Glo
|
||||
Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY);
|
||||
Matrix_RotateXYZ(dispObj->rot.x, dispObj->rot.y, dispObj->rot.z, MTXMODE_APPLY);
|
||||
|
||||
gDPLoadTextureBlock(gfxCtx->polyXlu.p++,
|
||||
texture,
|
||||
G_IM_FMT_I,
|
||||
G_IM_SIZ_8b,
|
||||
16, 16,
|
||||
0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOLOD);
|
||||
gDPLoadTextureBlock(gfxCtx->polyXlu.p++, texture, G_IM_FMT_I, G_IM_SIZ_8b, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 189), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 189),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, &D_04004298);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_debug_display.c", 192);
|
||||
}
|
||||
|
||||
static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx)
|
||||
{
|
||||
static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
|
||||
@@ -124,7 +109,8 @@ static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, Global
|
||||
func_800D1694(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, &dispObj->rot);
|
||||
Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 228), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 228),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, dlist);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_debug_display.c", 231);
|
||||
|
||||
+290
-442
File diff suppressed because it is too large
Load Diff
+154
-140
@@ -29,15 +29,13 @@ static void func_8006B54C(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006B870(GlobalContext* globalCtx, s16 drawId);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x00 */ void (*drawFunc)(GlobalContext*, s16);
|
||||
/* 0x04 */ u32 dlists[8];
|
||||
typedef struct {
|
||||
/* 0x00 */ void (*drawFunc)(GlobalContext*, s16);
|
||||
/* 0x04 */ u32 dlists[8];
|
||||
} DrawItemTableEntry; // size = 0x24
|
||||
|
||||
// TODO: use symbols for these dlists once objects are in C
|
||||
static DrawItemTableEntry sDrawItemTable[] =
|
||||
{
|
||||
static DrawItemTableEntry sDrawItemTable[] = {
|
||||
{ func_8006AAA8, { 0x06000670, 0x06000750 } },
|
||||
{ func_8006A9CC, { 0x06000800 } },
|
||||
{ func_8006ABEC, { 0x06000A80, 0x06000AE0 } },
|
||||
@@ -71,8 +69,10 @@ static DrawItemTableEntry sDrawItemTable[] =
|
||||
{ func_8006A9CC, { 0x06000EE0 } },
|
||||
{ func_8006A9CC, { 0x060009A0 } },
|
||||
{ func_8006A9CC, { 0x06000B70 } },
|
||||
{ func_8006B870, { 0x06001850, 0x06001750, 0x06001790, 0x060019A0, 0x060017B0, 0x06001A28, 0x060017D0, 0x06001AD8 } },
|
||||
{ func_8006B870, { 0x06001850, 0x06001770, 0x060017F0, 0x060019A0, 0x06001810, 0x06001A28, 0x06001830, 0x06001AD8 } },
|
||||
{ func_8006B870,
|
||||
{ 0x06001850, 0x06001750, 0x06001790, 0x060019A0, 0x060017B0, 0x06001A28, 0x060017D0, 0x06001AD8 } },
|
||||
{ func_8006B870,
|
||||
{ 0x06001850, 0x06001770, 0x060017F0, 0x060019A0, 0x06001810, 0x06001A28, 0x06001830, 0x06001AD8 } },
|
||||
{ func_8006A9CC, { 0x06000F60 } },
|
||||
{ func_8006A9CC, { 0x06000340 } },
|
||||
{ func_8006A9CC, { 0x06000B90 } },
|
||||
@@ -161,88 +161,90 @@ static DrawItemTableEntry sDrawItemTable[] =
|
||||
* Draw "Get Item" Model
|
||||
* Calls the corresponding draw function for the given draw ID
|
||||
*/
|
||||
void func_800694A0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
void func_800694A0(GlobalContext* globalCtx, s16 drawId) {
|
||||
sDrawItemTable[drawId].drawFunc(globalCtx, drawId);
|
||||
}
|
||||
|
||||
// All remaining functions in this file are draw functions referenced in the table and called by the function above
|
||||
|
||||
static void func_800694E4(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_800694E4(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 556);
|
||||
|
||||
func_80093BA8(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 560), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 560),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 565);
|
||||
}
|
||||
|
||||
static void func_800695C0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_800695C0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 572);
|
||||
|
||||
gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 5);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 576), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 576),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 581);
|
||||
}
|
||||
|
||||
static void func_8006969C(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006969C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 588);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 592), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 592),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 16, 32,
|
||||
1, 1 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 8), 16, 32));
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
0 * (globalCtx->state.frames * 0), 16, 32, 1, 1 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 8), 16, 32));
|
||||
Matrix_Push();
|
||||
Matrix_Translate(-8.0f, -2.0f, 0.0f, MTXMODE_APPLY);
|
||||
func_800D1FD4(&globalCtx->mf_11DA0);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 615), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 615),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
Matrix_Pull();
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 621);
|
||||
}
|
||||
|
||||
static void func_80069880(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_80069880(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 628);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 632), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 632),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 641), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 641),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 16, 32,
|
||||
1, 1 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 6), 16, 32));
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
0 * (globalCtx->state.frames * 0), 16, 32, 1, 1 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 6), 16, 32));
|
||||
Matrix_Push();
|
||||
func_800D1FD4(&globalCtx->mf_11DA0);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 656), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 656),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
Matrix_Pull();
|
||||
@@ -250,35 +252,36 @@ static void func_80069880(GlobalContext* globalCtx, s16 drawId)
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 663);
|
||||
}
|
||||
|
||||
static void func_80069AC8(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_80069AC8(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 670);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 674), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 674),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 683), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 683),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 32, 32,
|
||||
1, 1 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 6), 32, 32));
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
0 * (globalCtx->state.frames * 0), 32, 32, 1, 1 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 6), 32, 32));
|
||||
Matrix_Push();
|
||||
func_800D1FD4(&globalCtx->mf_11DA0);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 698), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 698),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
Matrix_Pull();
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 704);
|
||||
}
|
||||
|
||||
static void func_80069CF0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_80069CF0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -286,77 +289,80 @@ static void func_80069CF0(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 0 * (globalCtx->state.frames * 0) % 256, 1 * (globalCtx->state.frames * 2) % 256, 64, 64,
|
||||
1, 0 * (globalCtx->state.frames * 0) % 128, 1 * (globalCtx->state.frames * 1) % 128, 32, 32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 723), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0) % 256,
|
||||
1 * (globalCtx->state.frames * 2) % 256, 64, 64, 1,
|
||||
0 * (globalCtx->state.frames * 0) % 128, 1 * (globalCtx->state.frames * 1) % 128, 32,
|
||||
32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 723),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 730), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 730),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 735);
|
||||
}
|
||||
|
||||
static void func_80069EB0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_80069EB0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 742);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 746), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 746),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 0 * (globalCtx->state.frames * 0), 1 * -(globalCtx->state.frames * 5), 32, 32,
|
||||
1, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 32, 64));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 760), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
1 * -(globalCtx->state.frames * 5), 32, 32, 1, 0 * (globalCtx->state.frames * 0),
|
||||
0 * (globalCtx->state.frames * 0), 32, 64));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 760),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 765);
|
||||
}
|
||||
|
||||
static void func_8006A060(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A060(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 772);
|
||||
|
||||
func_80093BA8(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 776), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 776),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 783);
|
||||
}
|
||||
|
||||
static void func_8006A158(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A158(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 811);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 815), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 815),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 5);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 822), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 822),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 827);
|
||||
}
|
||||
|
||||
static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -364,25 +370,26 @@ static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, -1 * (globalCtx->state.frames * 1), 1 * (globalCtx->state.frames * 1), 32, 32,
|
||||
1, -1 * (globalCtx->state.frames * 1), 1 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 845), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, -1 * (globalCtx->state.frames * 1),
|
||||
1 * (globalCtx->state.frames * 1), 32, 32, 1, -1 * (globalCtx->state.frames * 1),
|
||||
1 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 845),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[3]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 855), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 855),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[4]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[5]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 861);
|
||||
}
|
||||
|
||||
static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -390,17 +397,17 @@ static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 1 * (globalCtx->state.frames * 1), 0 * (globalCtx->state.frames * 1), 32, 32,
|
||||
1, 0 * (globalCtx->state.frames * 1), 0 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 878), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 1),
|
||||
0 * (globalCtx->state.frames * 1), 32, 32, 1, 0 * (globalCtx->state.frames * 1),
|
||||
0 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 878),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 883);
|
||||
}
|
||||
|
||||
static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -408,17 +415,17 @@ static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 1 * (globalCtx->state.frames * 6), 1 * (globalCtx->state.frames * 6), 32, 32,
|
||||
1, 1 * (globalCtx->state.frames * 6), 1 * (globalCtx->state.frames * 6), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 901), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 6),
|
||||
1 * (globalCtx->state.frames * 6), 32, 32, 1, 1 * (globalCtx->state.frames * 6),
|
||||
1 * (globalCtx->state.frames * 6), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 901),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 906);
|
||||
}
|
||||
|
||||
static void func_8006A73C(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A73C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -426,17 +433,17 @@ static void func_8006A73C(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 0 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 3), 32, 32,
|
||||
1, 0 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 2), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 924), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 3), 32, 32, 1, 0 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 2), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 924),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 929);
|
||||
}
|
||||
|
||||
static void func_8006A88C(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A88C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -444,100 +451,103 @@ static void func_8006A88C(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 0 * (globalCtx->state.frames * 0), 1 * (globalCtx->state.frames * 1), 32, 32,
|
||||
1, 0 * (globalCtx->state.frames * 0), 1 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 947), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
1 * (globalCtx->state.frames * 1), 32, 32, 1, 0 * (globalCtx->state.frames * 0),
|
||||
1 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 947),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 952);
|
||||
}
|
||||
|
||||
static void func_8006A9CC(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A9CC(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 959);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 963), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 963),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 968);
|
||||
}
|
||||
|
||||
static void func_8006AAA8(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006AAA8(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 975);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 979), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 979),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 986), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 986),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 991);
|
||||
}
|
||||
|
||||
static void func_8006ABEC(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006ABEC(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 998);
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1002), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1002),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1008);
|
||||
}
|
||||
|
||||
static void func_8006ACE4(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006ACE4(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1015);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1019), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1019),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1027), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1027),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1032);
|
||||
}
|
||||
|
||||
static void func_8006AE40(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006AE40(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1039);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1043), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1043),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1050), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1050),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1056);
|
||||
}
|
||||
|
||||
static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -545,10 +555,11 @@ static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 1 * (globalCtx->state.frames * 2), 1 * -(globalCtx->state.frames * 6), 32, 32,
|
||||
1, 1 * (globalCtx->state.frames * 1), -1 * (globalCtx->state.frames * 2), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1074), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 2),
|
||||
1 * -(globalCtx->state.frames * 6), 32, 32, 1, 1 * (globalCtx->state.frames * 1),
|
||||
-1 * (globalCtx->state.frames * 2), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1074),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
@@ -556,15 +567,15 @@ static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId)
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1081);
|
||||
}
|
||||
|
||||
static void func_8006B124(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006B124(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1088);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1092), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1092),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
@@ -573,28 +584,28 @@ static void func_8006B124(GlobalContext* globalCtx, s16 drawId)
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1100);
|
||||
}
|
||||
|
||||
static void func_8006B24C(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006B24C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1108);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1112), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1112),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1120), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1120),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1126);
|
||||
}
|
||||
|
||||
static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -603,20 +614,21 @@ static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId)
|
||||
Matrix_Scale(0.7f, 0.7f, 0.7f, MTXMODE_APPLY);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1140), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1140),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1148), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1148),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1154);
|
||||
}
|
||||
|
||||
static void func_8006B54C(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006B54C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -624,10 +636,11 @@ static void func_8006B54C(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 1 * (globalCtx->state.frames * 2), -1 * (globalCtx->state.frames * 2), 64, 64,
|
||||
1, 1 * (globalCtx->state.frames * 4), 1 * -(globalCtx->state.frames * 4), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1173), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 2),
|
||||
-1 * (globalCtx->state.frames * 2), 64, 64, 1, 1 * (globalCtx->state.frames * 4),
|
||||
1 * -(globalCtx->state.frames * 4), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1173),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
@@ -636,20 +649,21 @@ static void func_8006B54C(GlobalContext* globalCtx, s16 drawId)
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1181);
|
||||
}
|
||||
|
||||
static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1188);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1192), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1192),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1200), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1200),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[4]);
|
||||
@@ -657,8 +671,7 @@ static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId)
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1207);
|
||||
}
|
||||
|
||||
static void func_8006B870(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006B870(GlobalContext* globalCtx, s16 drawId) {
|
||||
u32 pad;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
@@ -666,7 +679,8 @@ static void func_8006B870(GlobalContext* globalCtx, s16 drawId)
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1214);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1218), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1218),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_blure/func_80020A50.s")
|
||||
|
||||
void func_80020F60(u32 unused, GraphicsContext* gfxCtx)
|
||||
{
|
||||
void func_80020F60(u32 unused, GraphicsContext* gfxCtx) {
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, gfxCtx, D_80135180, 809);
|
||||
@@ -29,4 +28,3 @@ void func_80020F60(u32 unused, GraphicsContext* gfxCtx)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_blure/func_800224F4.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_blure/func_80022A10.s")
|
||||
|
||||
|
||||
@@ -8,4 +8,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_shield_particle/func_8002389C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_shield_particle/func_800245BC.s")
|
||||
|
||||
|
||||
@@ -3,12 +3,9 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_spark/func_80024B00.s")
|
||||
|
||||
void func_80024F0C(UNK_TYPE arg0)
|
||||
{
|
||||
|
||||
void func_80024F0C(UNK_TYPE arg0) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_spark/func_80024F14.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_spark/func_80025000.s")
|
||||
|
||||
|
||||
@@ -12,4 +12,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_ss_dead/func_80026860.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_ss_dead/func_80026A6C.s")
|
||||
|
||||
|
||||
@@ -7,8 +7,7 @@ void Effect_SS_Delete(LoadedParticleEntry* particle);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_800272B0.s")
|
||||
|
||||
void Effect_SS_Clear(GlobalContext* globalCtx)
|
||||
{
|
||||
void Effect_SS_Clear(GlobalContext* globalCtx) {
|
||||
u32 i;
|
||||
LoadedParticleEntry* iter;
|
||||
ParticleOverlay* iter2;
|
||||
@@ -18,35 +17,36 @@ void Effect_SS_Clear(GlobalContext* globalCtx)
|
||||
EffectSS2Info.searchIndex = 0;
|
||||
EffectSS2Info.size = 0;
|
||||
|
||||
for (iter = EffectSS2Info.data_table; iter < EffectSS2Info.data_table + EffectSS2Info.size; iter++)
|
||||
for (iter = EffectSS2Info.data_table; iter < EffectSS2Info.data_table + EffectSS2Info.size; iter++) {
|
||||
Effect_SS_Delete(iter);
|
||||
}
|
||||
|
||||
// Free memory from loaded particle overlays
|
||||
iter2 = &sParticleOverlayTable[0];
|
||||
for (i = 0; i < ARRAY_COUNT(sParticleOverlayTable); i++)
|
||||
{
|
||||
for (i = 0; i < ARRAY_COUNT(sParticleOverlayTable); i++) {
|
||||
addr = iter2->loadedRamAddr;
|
||||
|
||||
if (addr != NULL)
|
||||
if (addr != NULL) {
|
||||
ZeldaArena_FreeDebug(addr, D_801357DC, 337);
|
||||
}
|
||||
|
||||
(iter2++)->loadedRamAddr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void Effect_SS_Delete(LoadedParticleEntry* particle)
|
||||
{
|
||||
if (particle->flags & 2)
|
||||
void Effect_SS_Delete(LoadedParticleEntry* particle) {
|
||||
if (particle->flags & 2) {
|
||||
func_800F89E8(particle);
|
||||
}
|
||||
|
||||
if (particle->flags & 4)
|
||||
if (particle->flags & 4) {
|
||||
func_800F89E8(&particle->unk_2C);
|
||||
}
|
||||
|
||||
Effect_SS_ResetEntry(particle);
|
||||
}
|
||||
|
||||
void Effect_SS_ResetEntry(LoadedParticleEntry* particle)
|
||||
{
|
||||
void Effect_SS_ResetEntry(LoadedParticleEntry* particle) {
|
||||
u32 i;
|
||||
|
||||
particle->type = 0x25;
|
||||
@@ -70,8 +70,9 @@ void Effect_SS_ResetEntry(LoadedParticleEntry* particle)
|
||||
particle->unk_38 = 0;
|
||||
particle->unk_3C = 0;
|
||||
|
||||
for (i = 0; i != 13; i++)
|
||||
for (i = 0; i != 13; i++) {
|
||||
particle->unk_40[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_800275D0.s")
|
||||
@@ -80,12 +81,10 @@ void Effect_SS_ResetEntry(LoadedParticleEntry* particle)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_80027798.s")
|
||||
|
||||
void Effect_SS_UpdateParticle(GlobalContext* globalCtx, s32 index)
|
||||
{
|
||||
void Effect_SS_UpdateParticle(GlobalContext* globalCtx, s32 index) {
|
||||
LoadedParticleEntry* particle = &EffectSS2Info.data_table[index];
|
||||
|
||||
if (particle->update != NULL)
|
||||
{
|
||||
if (particle->update != NULL) {
|
||||
particle->velocity.x += particle->acceleration.x;
|
||||
particle->velocity.y += particle->acceleration.y;
|
||||
particle->velocity.z += particle->acceleration.z;
|
||||
@@ -98,47 +97,43 @@ void Effect_SS_UpdateParticle(GlobalContext* globalCtx, s32 index)
|
||||
}
|
||||
}
|
||||
|
||||
void Effect_SS_UpdateAllParticles(GlobalContext* globalCtx)
|
||||
{
|
||||
void Effect_SS_UpdateAllParticles(GlobalContext* globalCtx) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < EffectSS2Info.size; i++)
|
||||
{
|
||||
if (EffectSS2Info.data_table[i].life > -1)
|
||||
{
|
||||
for (i = 0; i < EffectSS2Info.size; i++) {
|
||||
if (EffectSS2Info.data_table[i].life > -1) {
|
||||
EffectSS2Info.data_table[i].life--;
|
||||
|
||||
if (EffectSS2Info.data_table[i].life < 0)
|
||||
if (EffectSS2Info.data_table[i].life < 0) {
|
||||
Effect_SS_Delete(&EffectSS2Info.data_table[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (EffectSS2Info.data_table[i].life > -1)
|
||||
if (EffectSS2Info.data_table[i].life > -1) {
|
||||
Effect_SS_UpdateParticle(globalCtx, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Effect_SS_DrawParticle(GlobalContext* globalCtx, s32 index)
|
||||
{
|
||||
void Effect_SS_DrawParticle(GlobalContext* globalCtx, s32 index) {
|
||||
LoadedParticleEntry* particle = &EffectSS2Info.data_table[index];
|
||||
|
||||
if (particle->draw != NULL)
|
||||
if (particle->draw != NULL) {
|
||||
particle->draw(globalCtx, index, particle);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_80027BDC.s")
|
||||
|
||||
s16 func_80027DD4(s16 arg0, s16 arg1, s32 arg2)
|
||||
{
|
||||
s16 ret = !arg2 ? arg1 : (arg0 + (s32) ((f32) (arg1 - arg0) / arg2));
|
||||
s16 func_80027DD4(s16 arg0, s16 arg1, s32 arg2) {
|
||||
s16 ret = !arg2 ? arg1 : (arg0 + (s32)((f32)(arg1 - arg0) / arg2));
|
||||
return ret;
|
||||
}
|
||||
|
||||
s16 func_80027E34(s16 a0, s16 a1, f32 a2)
|
||||
{
|
||||
s16 func_80027E34(s16 a0, s16 a1, f32 a2) {
|
||||
return (a1 - a0) * a2 + a0;
|
||||
}
|
||||
|
||||
u8 func_80027E84(u8 a0, u8 a1, f32 a2)
|
||||
{
|
||||
u8 func_80027E84(u8 a0, u8 a1, f32 a2) {
|
||||
return a2 * ((f32)a1 - (f32)a0) + a0;
|
||||
}
|
||||
|
||||
@@ -164,4 +164,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002A9F4.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002AA44.s")
|
||||
|
||||
|
||||
+75
-102
@@ -1,8 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x00 */ A_OBJ_BLOCK_SMALL,
|
||||
/* 0x01 */ A_OBJ_BLOCK_LARGE,
|
||||
/* 0x02 */ A_OBJ_BLOCK_HUGE,
|
||||
@@ -17,23 +16,22 @@ typedef enum
|
||||
/* 0x0B */ A_OBJ_KNOB
|
||||
} AObjType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x14C */ u32 dynaPolyId;
|
||||
/* 0x150 */ f32 unk_150;
|
||||
/* 0x154 */ f32 unk_154;
|
||||
/* 0x158 */ s16 unk_158;
|
||||
/* 0x15C */ u32 unk_15C;
|
||||
/* 0x160 */ u8 unk_160;
|
||||
/* 0x14C */ u32 dynaPolyId;
|
||||
/* 0x150 */ f32 unk_150;
|
||||
/* 0x154 */ f32 unk_154;
|
||||
/* 0x158 */ s16 unk_158;
|
||||
/* 0x15C */ u32 unk_15C;
|
||||
/* 0x160 */ u8 unk_160;
|
||||
/* 0x164 */ ActorFunc updateFunc;
|
||||
/* 0x168 */ s32 unk_168;
|
||||
/* 0x16C */ s16 textId;
|
||||
/* 0x16E */ s16 unk_16E;
|
||||
/* 0x170 */ s16 unk_170;
|
||||
/* 0x172 */ s16 unk_172;
|
||||
/* 0x174 */ s16 unk_174;
|
||||
/* 0x178 */ f32 unk_178;
|
||||
/* 0x168 */ s32 unk_168;
|
||||
/* 0x16C */ s16 textId;
|
||||
/* 0x16E */ s16 unk_16E;
|
||||
/* 0x170 */ s16 unk_170;
|
||||
/* 0x172 */ s16 unk_172;
|
||||
/* 0x174 */ s16 unk_174;
|
||||
/* 0x178 */ f32 unk_178;
|
||||
/* 0x17C */ ColliderCylinderMain cylinderCollider;
|
||||
} ActorEnAObj; // size = 0x1C8
|
||||
|
||||
@@ -54,15 +52,13 @@ extern ColliderCylinderInit D_80115440;
|
||||
extern u32 D_8011546C[];
|
||||
extern u32 D_80115484[];
|
||||
|
||||
void En_A_Obj_SetNewUpdate(ActorEnAObj* this, ActorFunc newUpdateFunc)
|
||||
{
|
||||
void En_A_Obj_SetNewUpdate(ActorEnAObj* this, ActorFunc newUpdateFunc) {
|
||||
this->updateFunc = newUpdateFunc;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// minor ordering and regalloc differences
|
||||
void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
u32 sp34;
|
||||
s16 type;
|
||||
s16 initialParams;
|
||||
@@ -77,8 +73,7 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
this->textId = (initialParams >> 8) & 0xFF;
|
||||
this->actor.params = type;
|
||||
|
||||
switch (type & 0xFFFF)
|
||||
{
|
||||
switch (type & 0xFFFF) {
|
||||
case A_OBJ_BLOCK_SMALL:
|
||||
Actor_SetScale(&this->actor, 0.025f);
|
||||
break;
|
||||
@@ -112,8 +107,7 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
params = this->actor.params;
|
||||
this->actor.posRot2.pos = this->actor.posRot.pos;
|
||||
|
||||
switch (params)
|
||||
{
|
||||
switch (params) {
|
||||
case A_OBJ_BLOCK_LARGE:
|
||||
case A_OBJ_BLOCK_HUGE:
|
||||
this->dynaPolyId = 1;
|
||||
@@ -159,12 +153,11 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
func_8001D234(this, params);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (this->actor.params < 5)
|
||||
this->actor.sub_98.mass = 0xFF;
|
||||
|
||||
if (this->dynaPolyId != -1)
|
||||
{
|
||||
if (this->dynaPolyId != -1) {
|
||||
DynaPolyInfo_Alloc(D_8011546C[this->dynaPolyId], &sp34);
|
||||
this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp34);
|
||||
}
|
||||
@@ -173,51 +166,44 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_en_a_keep/En_A_Obj_Init.s")
|
||||
#endif
|
||||
|
||||
void En_A_Obj_Destroy(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_A_Obj_Destroy(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* cylinderCollider = &this->cylinderCollider;
|
||||
|
||||
DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId);
|
||||
|
||||
switch (this->actor.params)
|
||||
{
|
||||
switch (this->actor.params) {
|
||||
case A_OBJ_SIGNPOST_OBLONG:
|
||||
case A_OBJ_SIGNPOST_ARROW:
|
||||
ActorCollider_FreeCylinder(globalCtx, cylinderCollider);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001D204(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
if (func_8002F334(&this->actor, globalCtx))
|
||||
void func_8001D204(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
if (func_8002F334(&this->actor, globalCtx)) {
|
||||
func_8001D234(this, this->actor.params);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001D234(ActorEnAObj* this, s16 params)
|
||||
{
|
||||
void func_8001D234(ActorEnAObj* this, s16 params) {
|
||||
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D25C);
|
||||
}
|
||||
|
||||
void func_8001D25C(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001D25C(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
s16 var;
|
||||
|
||||
if (this->actor.textId != 0)
|
||||
{
|
||||
if (this->actor.textId != 0) {
|
||||
var = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
|
||||
if ((ABS(var) < 0x2800) ||
|
||||
((this->actor.params == 0xA) && (ABS(var) > 0x5800)))
|
||||
{
|
||||
if (func_8002F194(&this->actor, globalCtx))
|
||||
if ((ABS(var) < 0x2800) || ((this->actor.params == 0xA) && (ABS(var) > 0x5800))) {
|
||||
if (func_8002F194(&this->actor, globalCtx)) {
|
||||
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D204);
|
||||
else
|
||||
} else {
|
||||
func_8002F2F4(&this->actor, globalCtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001D310(ActorEnAObj* this, s16 params)
|
||||
{
|
||||
void func_8001D310(ActorEnAObj* this, s16 params) {
|
||||
this->unk_16E = 0;
|
||||
this->unk_168 = 10;
|
||||
this->actor.posRot.rot.y = 0;
|
||||
@@ -225,41 +211,34 @@ void func_8001D310(ActorEnAObj* this, s16 params)
|
||||
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D360);
|
||||
}
|
||||
|
||||
void func_8001D360(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
if (this->unk_16E == 0)
|
||||
{
|
||||
if (this->unk_160 != 0)
|
||||
{
|
||||
void func_8001D360(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_16E == 0) {
|
||||
if (this->unk_160 != 0) {
|
||||
this->unk_16E++;
|
||||
this->unk_170 = 20;
|
||||
|
||||
if ((s16)(this->actor.rotTowardsLinkY + 0x4000) < 0)
|
||||
if ((s16)(this->actor.rotTowardsLinkY + 0x4000) < 0) {
|
||||
this->unk_174 = -1000;
|
||||
else
|
||||
} else {
|
||||
this->unk_174 = 1000;
|
||||
}
|
||||
|
||||
if (this->actor.rotTowardsLinkY < 0)
|
||||
if (this->actor.rotTowardsLinkY < 0) {
|
||||
this->unk_172 = -this->unk_174;
|
||||
else
|
||||
} else {
|
||||
this->unk_172 = this->unk_174;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this->unk_168 != 0)
|
||||
{
|
||||
} else {
|
||||
if (this->unk_168 != 0) {
|
||||
this->unk_168--;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this->actor.shape.rot.y += this->unk_172;
|
||||
this->actor.shape.rot.x += this->unk_174;
|
||||
this->unk_170--;
|
||||
this->actor.gravity = -1.0f;
|
||||
|
||||
if (this->unk_170 == 0)
|
||||
{
|
||||
if (this->unk_170 == 0) {
|
||||
this->actor.posRot.pos = this->actor.initPosRot.pos;
|
||||
this->unk_16E = 0;
|
||||
this->unk_168 = 10;
|
||||
@@ -271,82 +250,74 @@ void func_8001D360(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001D480(ActorEnAObj* this, s16 params)
|
||||
{
|
||||
void func_8001D480(ActorEnAObj* this, s16 params) {
|
||||
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D4A8);
|
||||
}
|
||||
|
||||
void func_8001D4A8(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001D4A8(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
Math_SmoothScaleMaxMinF(&this->actor.speedXZ, 1.0f, 1.0f, 0.5f, 0.0f);
|
||||
this->actor.shape.rot.x = this->actor.shape.rot.x + (this->actor.posRot.rot.x >> 1);
|
||||
this->actor.shape.rot.z = this->actor.shape.rot.z + (this->actor.posRot.rot.z >> 1);
|
||||
|
||||
if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 0x8))
|
||||
{
|
||||
if (1) // Necessary to match
|
||||
if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 0x8)) {
|
||||
if (1) { // Necessary to match
|
||||
this->actor.posRot.rot.y = ((this->actor.unk_7E - this->actor.posRot.rot.y) + this->actor.unk_7E) - 0x8000;
|
||||
}
|
||||
this->actor.bgCheckFlags &= ~0x8;
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 0x2)
|
||||
{
|
||||
if (this->actor.velocity.y < -8.0f)
|
||||
{
|
||||
if (this->actor.bgCheckFlags & 0x2) {
|
||||
if (this->actor.velocity.y < -8.0f) {
|
||||
this->actor.velocity.y *= -0.6f;
|
||||
this->actor.speedXZ *= 0.6f;
|
||||
this->actor.bgCheckFlags &= ~0x3;
|
||||
}
|
||||
else
|
||||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001D5C8(ActorEnAObj* this, s16 params)
|
||||
{
|
||||
void func_8001D5C8(ActorEnAObj* this, s16 params) {
|
||||
this->actor.unk_FC = 1200.0f;
|
||||
this->actor.unk_F8 = 720.0f;
|
||||
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D608);
|
||||
}
|
||||
|
||||
void func_8001D608(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001D608(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
this->actor.speedXZ += this->unk_150;
|
||||
this->actor.posRot.rot.y = this->unk_158;
|
||||
|
||||
this->actor.speedXZ = (this->actor.speedXZ < -2.5f) ? -2.5f :
|
||||
((this->actor.speedXZ > 2.5f) ? 2.5f :
|
||||
this->actor.speedXZ);
|
||||
this->actor.speedXZ =
|
||||
(this->actor.speedXZ < -2.5f) ? -2.5f : ((this->actor.speedXZ > 2.5f) ? 2.5f : this->actor.speedXZ);
|
||||
|
||||
Math_SmoothScaleMaxMinF(&this->actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f);
|
||||
|
||||
if (this->actor.speedXZ != 0.0f)
|
||||
if (this->actor.speedXZ != 0.0f) {
|
||||
Audio_PlayActorSound2(&this->actor, 0x200A);
|
||||
}
|
||||
|
||||
this->unk_154 = 0.0f;
|
||||
this->unk_150 = 0.0f;
|
||||
}
|
||||
|
||||
void En_A_Obj_Update(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_A_Obj_Update(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* cylinderCollider;
|
||||
|
||||
this->updateFunc(this, globalCtx);
|
||||
Actor_MoveForward(&this->actor);
|
||||
|
||||
if (this->actor.gravity != 0.0f)
|
||||
{
|
||||
if (this->actor.params != A_OBJ_KNOB)
|
||||
if (this->actor.gravity != 0.0f) {
|
||||
if (this->actor.params != A_OBJ_KNOB) {
|
||||
func_8002E4B4(globalCtx, &this->actor, 5.0f, 40.0f, 0.0f, 0x1D);
|
||||
else
|
||||
} else {
|
||||
func_8002E4B4(globalCtx, &this->actor, 5.0f, 20.0f, 0.0f, 0x1D);
|
||||
}
|
||||
}
|
||||
|
||||
this->actor.posRot2.pos = this->actor.posRot.pos;
|
||||
this->actor.posRot2.pos.y += this->unk_178;
|
||||
|
||||
switch (this->actor.params)
|
||||
{
|
||||
switch (this->actor.params) {
|
||||
case A_OBJ_SIGNPOST_OBLONG:
|
||||
case A_OBJ_SIGNPOST_ARROW:
|
||||
cylinderCollider = &this->cylinderCollider;
|
||||
@@ -355,8 +326,7 @@ void En_A_Obj_Update(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
}
|
||||
}
|
||||
|
||||
void En_A_Obj_Draw(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_A_Obj_Draw(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
s32 type = this->actor.params;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
@@ -365,13 +335,16 @@ void En_A_Obj_Draw(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
|
||||
if (type > A_OBJ_KNOB)
|
||||
if (type > A_OBJ_KNOB) {
|
||||
type = A_OBJ_KNOB;
|
||||
}
|
||||
|
||||
if (this->actor.params == A_OBJ_KNOB)
|
||||
if (this->actor.params == A_OBJ_KNOB) {
|
||||
gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 1, 0x3C, 0x3C, 0x3C, 0x32);
|
||||
}
|
||||
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 712), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 712),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, D_80115484[type]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_a_keep.c", 715);
|
||||
|
||||
+194
-306
@@ -1,8 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x00 */ DROP_RUPEE_GREEN,
|
||||
/* 0x01 */ DROP_RUPEE_BLUE,
|
||||
/* 0x02 */ DROP_RUPEE_RED,
|
||||
@@ -31,8 +30,7 @@ typedef enum
|
||||
/* 0x19 */ DROP_BOMBS_SPECIAL
|
||||
} DropType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x14C */ ActorFunc updateFunc;
|
||||
/* 0x150 */ s16 collectibleFlag;
|
||||
@@ -65,15 +63,13 @@ extern u8 D_80115664[];
|
||||
|
||||
// Internal Actor Functions
|
||||
|
||||
void En_Item00_SetNewUpdate(ActorEnItem00* this, ActorFunc newUpdateFunc)
|
||||
{
|
||||
void En_Item00_SetNewUpdate(ActorEnItem00* this, ActorFunc newUpdateFunc) {
|
||||
this->updateFunc = newUpdateFunc;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// Very close to matching, just a single ordering issue
|
||||
void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
s32 pad1;
|
||||
s32 pad2;
|
||||
f32 sp34;
|
||||
@@ -91,8 +87,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
|
||||
this->actor.params = this->actor.params & 0x00FF;
|
||||
|
||||
if (Flags_GetCollectible(globalCtx, this->collectibleFlag))
|
||||
{
|
||||
if (Flags_GetCollectible(globalCtx, this->collectibleFlag)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -103,8 +98,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
|
||||
this->unk_158 = 1;
|
||||
|
||||
switch (this->actor.params)
|
||||
{
|
||||
switch (this->actor.params) {
|
||||
case DROP_RUPEE_GREEN:
|
||||
case DROP_RUPEE_BLUE:
|
||||
case DROP_RUPEE_RED:
|
||||
@@ -216,8 +210,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
this->unk_152 = 0;
|
||||
|
||||
// MISMATCH: minor ordering issues here
|
||||
if (!spawnParam8000)
|
||||
{
|
||||
if (!spawnParam8000) {
|
||||
En_Item00_SetNewUpdate(this, (ActorFunc)func_8001DFC8);
|
||||
this->unk_15A = -1;
|
||||
return;
|
||||
@@ -230,8 +223,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
this->actor.velocity.y = 0.0f;
|
||||
this->actor.gravity = 0.0f;
|
||||
|
||||
switch (this->actor.params)
|
||||
{
|
||||
switch (this->actor.params) {
|
||||
case DROP_RUPEE_GREEN:
|
||||
Item_Give(globalCtx, ITEM_RUPEE_GREEN);
|
||||
break;
|
||||
@@ -307,147 +299,131 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_en_item00/En_Item00_Init.s")
|
||||
#endif
|
||||
|
||||
void En_Item00_Destroy(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_Item00_Destroy(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* cylinderCollider = &this->cylinderCollider;
|
||||
ActorCollider_FreeCylinder(globalCtx, cylinderCollider);
|
||||
}
|
||||
|
||||
void func_8001DFC8(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
if ((this->actor.params <= DROP_RUPEE_RED) ||
|
||||
((this->actor.params == DROP_HEART) && (this->unk_15A < 0)) ||
|
||||
(this->actor.params == DROP_HEART_PIECE))
|
||||
{
|
||||
void func_8001DFC8(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
if ((this->actor.params <= DROP_RUPEE_RED) || ((this->actor.params == DROP_HEART) && (this->unk_15A < 0)) ||
|
||||
(this->actor.params == DROP_HEART_PIECE)) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL))
|
||||
{
|
||||
if (this->unk_15A == -1)
|
||||
{
|
||||
if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500))
|
||||
} else {
|
||||
if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL)) {
|
||||
if (this->unk_15A == -1) {
|
||||
if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, this->actor.posRot.rot.x - 0x4000, 2, 3000,
|
||||
1500)) {
|
||||
this->unk_15A = -2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, -this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500))
|
||||
}
|
||||
} else {
|
||||
if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, -this->actor.posRot.rot.x - 0x4000, 2, 3000,
|
||||
1500)) {
|
||||
this->unk_15A = -1;
|
||||
}
|
||||
}
|
||||
Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.x, 0, 2, 2500, 500);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->actor.params == DROP_HEART_PIECE)
|
||||
if (this->actor.params == DROP_HEART_PIECE) {
|
||||
this->actor.shape.unk_08 = Math_Sins(this->actor.shape.rot.y) * 150.0f + 850.0f;
|
||||
}
|
||||
|
||||
Math_SmoothScaleMaxMinF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
|
||||
|
||||
if (this->unk_154 == 0)
|
||||
if ((this->actor.params != DROP_SMALL_KEY) &&
|
||||
(this->actor.params != DROP_HEART_PIECE) &&
|
||||
(this->actor.params != DROP_HEART_CONTAINER))
|
||||
{
|
||||
if (this->unk_154 == 0) {
|
||||
if ((this->actor.params != DROP_SMALL_KEY) && (this->actor.params != DROP_HEART_PIECE) &&
|
||||
(this->actor.params != DROP_HEART_CONTAINER)) {
|
||||
this->unk_154 = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->unk_15A == 0)
|
||||
if ((this->actor.params != DROP_SMALL_KEY) &&
|
||||
(this->actor.params != DROP_HEART_PIECE) &&
|
||||
(this->actor.params != DROP_HEART_CONTAINER))
|
||||
{
|
||||
if (this->unk_15A == 0) {
|
||||
if ((this->actor.params != DROP_SMALL_KEY) && (this->actor.params != DROP_HEART_PIECE) &&
|
||||
(this->actor.params != DROP_HEART_CONTAINER)) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
if ((this->actor.gravity != 0.0f) && !(this->actor.bgCheckFlags & 0x0001))
|
||||
if ((this->actor.gravity != 0.0f) && !(this->actor.bgCheckFlags & 0x0001)) {
|
||||
En_Item00_SetNewUpdate(this, (ActorFunc)func_8001E1C8);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001E1C8(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001E1C8(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
f32 originalVelocity;
|
||||
Vec3f pos;
|
||||
|
||||
if (this->actor.params <= DROP_RUPEE_RED)
|
||||
if (this->actor.params <= DROP_RUPEE_RED) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
}
|
||||
|
||||
if (globalCtx->gameplayFrames & 1)
|
||||
{
|
||||
if (globalCtx->gameplayFrames & 1) {
|
||||
pos.x = this->actor.posRot.pos.x + Math_Rand_CenteredFloat(10.0f);
|
||||
pos.y = this->actor.posRot.pos.y + Math_Rand_CenteredFloat(10.0f);
|
||||
pos.z = this->actor.posRot.pos.z + Math_Rand_CenteredFloat(10.0f);
|
||||
func_80028B74(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 0x0003)
|
||||
{
|
||||
if (this->actor.bgCheckFlags & 0x0003) {
|
||||
originalVelocity = this->actor.velocity.y;
|
||||
if (originalVelocity > -2.0f)
|
||||
{
|
||||
if (originalVelocity > -2.0f) {
|
||||
En_Item00_SetNewUpdate(this, (ActorFunc)func_8001DFC8);
|
||||
this->actor.velocity.y = 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this->actor.velocity.y = originalVelocity * -0.8f;
|
||||
this->actor.bgCheckFlags = this->actor.bgCheckFlags & 0xFFFE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001E304(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001E304(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
Vec3f pos;
|
||||
s32 var1;
|
||||
|
||||
this->unk_15A++;
|
||||
|
||||
if (this->actor.params == DROP_HEART)
|
||||
{
|
||||
if (this->actor.velocity.y < 0.0f)
|
||||
{
|
||||
if (this->actor.params == DROP_HEART) {
|
||||
if (this->actor.velocity.y < 0.0f) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.gravity = -0.4f;
|
||||
if (this->actor.velocity.y < -1.5f)
|
||||
if (this->actor.velocity.y < -1.5f) {
|
||||
this->actor.velocity.y = -1.5f;
|
||||
this->actor.initPosRot.rot.z += (s16) ((this->actor.velocity.y + 3.0f) * 1000.0f);
|
||||
this->actor.posRot.pos.x += Math_Coss(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z));
|
||||
this->actor.posRot.pos.z += Math_Sins(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z));
|
||||
}
|
||||
this->actor.initPosRot.rot.z += (s16)((this->actor.velocity.y + 3.0f) * 1000.0f);
|
||||
this->actor.posRot.pos.x +=
|
||||
Math_Coss(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z));
|
||||
this->actor.posRot.pos.z +=
|
||||
Math_Sins(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z));
|
||||
}
|
||||
}
|
||||
|
||||
if (this->actor.params <= DROP_RUPEE_RED)
|
||||
{
|
||||
if (this->actor.params <= DROP_RUPEE_RED) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
}
|
||||
else if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL))
|
||||
{
|
||||
} else if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL)) {
|
||||
this->actor.posRot.rot.x -= 700;
|
||||
this->actor.shape.rot.y += 400;
|
||||
this->actor.shape.rot.x = this->actor.posRot.rot.x - 0x4000;
|
||||
}
|
||||
|
||||
if (this->actor.velocity.y <= 2.0f)
|
||||
{
|
||||
if (this->actor.velocity.y <= 2.0f) {
|
||||
var1 = (u16)this->actor.shape.rot.z + 10000;
|
||||
if (var1 < 65535)
|
||||
if (var1 < 65535) {
|
||||
this->actor.shape.rot.z += 10000;
|
||||
else
|
||||
} else {
|
||||
this->actor.shape.rot.z = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(globalCtx->gameplayFrames & 1))
|
||||
{
|
||||
if (!(globalCtx->gameplayFrames & 1)) {
|
||||
pos.x = this->actor.posRot.pos.x + (Math_Rand_ZeroOne() - 0.5f) * 10.0f;
|
||||
pos.y = this->actor.posRot.pos.y + (Math_Rand_ZeroOne() - 0.5f) * 10.0f;
|
||||
pos.z = this->actor.posRot.pos.z + (Math_Rand_ZeroOne() - 0.5f) * 10.0f;
|
||||
func_80028B74(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 0x0003)
|
||||
{
|
||||
if (this->actor.bgCheckFlags & 0x0003) {
|
||||
En_Item00_SetNewUpdate(this, (ActorFunc)func_8001DFC8);
|
||||
this->actor.shape.rot.z = 0;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
@@ -455,40 +431,36 @@ void func_8001E304(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001E5C8(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001E5C8(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
|
||||
if (this->unk_152 != 0)
|
||||
{
|
||||
if (!func_8002F410(&this->actor, globalCtx))
|
||||
{
|
||||
if (this->unk_152 != 0) {
|
||||
if (!func_8002F410(&this->actor, globalCtx)) {
|
||||
func_8002F434(&this->actor, globalCtx, this->unk_152, 50.0f, 80.0f);
|
||||
this->unk_15A++;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this->unk_152 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->unk_15A == 0)
|
||||
{
|
||||
if (this->unk_15A == 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
this->actor.posRot.pos = player->actor.posRot.pos;
|
||||
|
||||
if (this->actor.params <= DROP_RUPEE_RED)
|
||||
if (this->actor.params <= DROP_RUPEE_RED) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
else if (this->actor.params == DROP_HEART)
|
||||
} else if (this->actor.params == DROP_HEART) {
|
||||
this->actor.shape.rot.y = 0;
|
||||
}
|
||||
|
||||
this->actor.posRot.pos.y += 40.0f + Math_Sins(this->unk_15A * 15000) * (this->unk_15A * 0.3f);
|
||||
|
||||
if LINK_IS_ADULT
|
||||
this->actor.posRot.pos.y += 20.0f;
|
||||
if
|
||||
LINK_IS_ADULT
|
||||
this->actor.posRot.pos.y += 20.0f;
|
||||
}
|
||||
|
||||
extern s32 D_80157D90;
|
||||
@@ -497,8 +469,7 @@ extern s16 D_80157D94;
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// Almost matching, just a few minor ordering issues
|
||||
void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
s32 pad1;
|
||||
s32 pad2;
|
||||
s32 sp3C;
|
||||
@@ -521,44 +492,34 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
this->actor.scale.z = this->actor.scale.x;
|
||||
this->actor.scale.y = this->actor.scale.x;
|
||||
|
||||
if (this->actor.gravity)
|
||||
{
|
||||
if (this->actor.bgCheckFlags & 0x0003)
|
||||
{
|
||||
if (this->actor.gravity) {
|
||||
if (this->actor.bgCheckFlags & 0x0003) {
|
||||
// Separate symbols seem to be used here for 0x80157D90 since the loads and stores are completely separate
|
||||
if (D_80157D90 != globalCtx->gameplayFrames)
|
||||
{
|
||||
if (D_80157D90 != globalCtx->gameplayFrames) {
|
||||
D_80157D90_ = globalCtx->gameplayFrames;
|
||||
D_80157D94 = 0;
|
||||
for (i = 0; i < 50; i++)
|
||||
{
|
||||
if (globalCtx->colCtx.dyna.flags[i] & 1)
|
||||
{
|
||||
for (i = 0; i < 50; i++) {
|
||||
if (globalCtx->colCtx.dyna.flags[i] & 1) {
|
||||
dynaActor = globalCtx->colCtx.dyna.actorMeshArr[i].actor;
|
||||
if ((dynaActor != NULL) && (dynaActor->update != NULL) &&
|
||||
((dynaActor->posRot.pos.x != dynaActor->pos4.x) ||
|
||||
(dynaActor->posRot.pos.y != dynaActor->pos4.y) ||
|
||||
(dynaActor->posRot.pos.z != dynaActor->pos4.z)))
|
||||
{
|
||||
(dynaActor->posRot.pos.z != dynaActor->pos4.z))) {
|
||||
D_80157D94++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sp3A = 1;
|
||||
Actor_MoveForward(&this->actor);
|
||||
}
|
||||
|
||||
if (sp3A || D_80157D94)
|
||||
{
|
||||
if (sp3A || D_80157D94) {
|
||||
func_8002E4B4(globalCtx, &this->actor, 10.0f, 15.0f, 15.0f, 0x1D);
|
||||
|
||||
if (this->actor.unk_80 <= -10000.0f)
|
||||
{
|
||||
if (this->actor.unk_80 <= -10000.0f) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -569,8 +530,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
Actor_CollisionCheck_SetAC(globalCtx, &globalCtx->sub_11E60, &this->cylinderCollider);
|
||||
|
||||
if ((this->actor.params == DROP_SHIELD_DEKU) || (this->actor.params == DROP_SHIELD_HYLIAN) ||
|
||||
(this->actor.params == DROP_TUNIC_ZORA) || (this->actor.params == DROP_TUNIC_GORON))
|
||||
{
|
||||
(this->actor.params == DROP_TUNIC_ZORA) || (this->actor.params == DROP_TUNIC_GORON)) {
|
||||
f32 newUnkBC = Math_Coss(this->actor.shape.rot.x) * 37.0f;
|
||||
this->actor.shape.unk_08 = newUnkBC;
|
||||
if (newUnkBC >= 0.0f)
|
||||
@@ -583,8 +543,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
return;
|
||||
|
||||
// MISMATCH: The first function argument is loaded too early here
|
||||
if (!((this->actor.xzDistanceFromLink <= 30.0f) &&
|
||||
(this->actor.yDistanceFromLink >= -50.0f) &&
|
||||
if (!((this->actor.xzDistanceFromLink <= 30.0f) && (this->actor.yDistanceFromLink >= -50.0f) &&
|
||||
(this->actor.yDistanceFromLink <= 50.0f)))
|
||||
if (!func_8002F410(&this->actor, globalCtx))
|
||||
return;
|
||||
@@ -592,8 +551,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
if (globalCtx->unk_10A20 != 0)
|
||||
return;
|
||||
|
||||
switch (this->actor.params)
|
||||
{
|
||||
switch (this->actor.params) {
|
||||
case DROP_RUPEE_GREEN:
|
||||
Item_Give(globalCtx, ITEM_RUPEE_GREEN);
|
||||
break;
|
||||
@@ -675,8 +633,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
if ((sp3C != 0) && !func_8002F410(&this->actor, globalCtx))
|
||||
func_8002F554(&this->actor, globalCtx, sp3C);
|
||||
|
||||
switch (this->actor.params)
|
||||
{
|
||||
switch (this->actor.params) {
|
||||
case DROP_HEART_PIECE:
|
||||
case DROP_HEART_CONTAINER:
|
||||
case DROP_SMALL_KEY:
|
||||
@@ -684,29 +641,22 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
case DROP_SHIELD_HYLIAN:
|
||||
case DROP_TUNIC_ZORA:
|
||||
case DROP_TUNIC_GORON:
|
||||
if (func_8002F410(&this->actor, globalCtx))
|
||||
{
|
||||
if (func_8002F410(&this->actor, globalCtx)) {
|
||||
Flags_SetCollectible(globalCtx, this->collectibleFlag);
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ((this->actor.params <= DROP_RUPEE_RED) || (this->actor.params == DROP_RUPEE_ORANGE))
|
||||
{
|
||||
if ((this->actor.params <= DROP_RUPEE_RED) || (this->actor.params == DROP_RUPEE_ORANGE)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
}
|
||||
else if (sp3C != 0)
|
||||
{
|
||||
if (func_8002F410(&this->actor, globalCtx))
|
||||
{
|
||||
} else if (sp3C != 0) {
|
||||
if (func_8002F410(&this->actor, globalCtx)) {
|
||||
Flags_SetCollectible(globalCtx, this->collectibleFlag);
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_GET_ITEM, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
}
|
||||
|
||||
@@ -734,15 +684,12 @@ void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx);
|
||||
void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx);
|
||||
void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx);
|
||||
|
||||
void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
f32 unkFloat;
|
||||
|
||||
if (!(this->unk_156 & this->unk_158))
|
||||
{
|
||||
switch (this->actor.params)
|
||||
{
|
||||
if (!(this->unk_156 & this->unk_158)) {
|
||||
switch (this->actor.params) {
|
||||
case DROP_RUPEE_GREEN:
|
||||
case DROP_RUPEE_BLUE:
|
||||
case DROP_RUPEE_RED:
|
||||
@@ -757,20 +704,15 @@ void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
func_8001F1F4(this, globalCtx);
|
||||
break;
|
||||
case DROP_HEART:
|
||||
if (this->unk_15A < 0)
|
||||
{
|
||||
if (this->unk_15A == -1)
|
||||
{
|
||||
if (this->unk_15A < 0) {
|
||||
if (this->unk_15A == -1) {
|
||||
s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART);
|
||||
if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex))
|
||||
{
|
||||
if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) {
|
||||
this->actor.objBankIndex = bankIndex;
|
||||
Actor_SetObjectDependency(globalCtx, &this->actor);
|
||||
this->unk_15A = -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
unkFloat = 16.0f;
|
||||
Matrix_Scale(unkFloat, unkFloat, unkFloat, MTXMODE_APPLY);
|
||||
func_800694A0(globalCtx, 0x08);
|
||||
@@ -813,8 +755,7 @@ void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
/**
|
||||
* Draw Function used for Rupee types of En_Item00.
|
||||
*/
|
||||
void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
s32 iconNb;
|
||||
Gfx* gfxArr[5];
|
||||
@@ -824,15 +765,16 @@ void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_8002EBCC(&this->actor, globalCtx, 0);
|
||||
|
||||
if (1) // Necessary to match
|
||||
{
|
||||
if (this->actor.params <= DROP_RUPEE_RED)
|
||||
if (1) { // Necessary to match
|
||||
if (this->actor.params <= DROP_RUPEE_RED) {
|
||||
iconNb = this->actor.params;
|
||||
else
|
||||
} else {
|
||||
iconNb = this->actor.params - 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1562), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1562),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_80115530[iconNb]));
|
||||
|
||||
@@ -844,8 +786,7 @@ void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
/**
|
||||
* Draw Function used for most collectible types of En_Item00 (ammo, bombs, sticks, nuts, magic...).
|
||||
*/
|
||||
void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
s32 iconNb;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
@@ -856,16 +797,18 @@ void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
|
||||
gfxCtx->polyOpa.p = func_800BC8A0(globalCtx, gfxCtx->polyOpa.p);
|
||||
|
||||
if (this->actor.params == DROP_BOMBS_SPECIAL)
|
||||
if (this->actor.params == DROP_BOMBS_SPECIAL) {
|
||||
iconNb = 1;
|
||||
else if (this->actor.params >= DROP_ARROWS_SMALL)
|
||||
} else if (this->actor.params >= DROP_ARROWS_SMALL) {
|
||||
iconNb -= 3;
|
||||
}
|
||||
|
||||
gfxCtx->polyOpa.p = func_800946E4(gfxCtx->polyOpa.p);
|
||||
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_80115544[iconNb]));
|
||||
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1607), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1607),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, &D_0403F070);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_item00.c", 1611);
|
||||
@@ -874,8 +817,7 @@ void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
/**
|
||||
* Draw Function used for the Heart Container type of En_Item00.
|
||||
*/
|
||||
void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -883,12 +825,14 @@ void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_8002EBCC(&this->actor, globalCtx, 0);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1634), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1634),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, &D_0403BBA0);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_8002ED80(&this->actor, globalCtx, 0);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1644), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1644),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, &D_0403BCD8);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_item00.c", 1647);
|
||||
@@ -897,8 +841,7 @@ void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
/**
|
||||
* Draw Function used for the Piece of Heart type of En_Item00.
|
||||
*/
|
||||
void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -906,7 +849,8 @@ void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_8002ED80(&this->actor, globalCtx, 0);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1670), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1670),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, &D_0403B030);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_item00.c", 1673);
|
||||
@@ -916,38 +860,39 @@ void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
* Converts a given drop type ID based on link's current age, health and owned items.
|
||||
* Returns a new drop type ID or -1 to cancel the drop.
|
||||
*/
|
||||
s16 func_8001F404(s16 dropId)
|
||||
{
|
||||
if (LINK_IS_ADULT)
|
||||
{
|
||||
if (dropId == DROP_SEEDS)
|
||||
s16 func_8001F404(s16 dropId) {
|
||||
if (LINK_IS_ADULT) {
|
||||
if (dropId == DROP_SEEDS) {
|
||||
dropId = DROP_ARROWS_SMALL;
|
||||
else if (dropId == DROP_STICK)
|
||||
} else if (dropId == DROP_STICK) {
|
||||
dropId = DROP_RUPEE_GREEN;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dropId == DROP_ARROWS_SMALL || dropId == DROP_ARROWS_MEDIUM || dropId == DROP_ARROWS_LARGE)
|
||||
}
|
||||
} else {
|
||||
if (dropId == DROP_ARROWS_SMALL || dropId == DROP_ARROWS_MEDIUM || dropId == DROP_ARROWS_LARGE) {
|
||||
dropId = DROP_SEEDS;
|
||||
}
|
||||
}
|
||||
|
||||
// This is convoluted but it seems like it must be a single condition to match
|
||||
// clang-format off
|
||||
if (((dropId == DROP_BOMBS_A || dropId == DROP_BOMBS_SPECIAL || dropId == DROP_BOMBS_B) && INV_CONTENT(ITEM_BOMB) == ITEM_NONE) ||
|
||||
((dropId == DROP_ARROWS_SMALL || dropId == DROP_ARROWS_MEDIUM || dropId == DROP_ARROWS_LARGE) && INV_CONTENT(ITEM_BOW) == ITEM_NONE) ||
|
||||
((dropId == DROP_MAGIC_LARGE || dropId == DROP_MAGIC_SMALL) && gSaveContext.magic_level == 0) ||
|
||||
((dropId == DROP_SEEDS) && INV_CONTENT(ITEM_SLINGSHOT) == ITEM_NONE))
|
||||
((dropId == DROP_SEEDS) && INV_CONTENT(ITEM_SLINGSHOT) == ITEM_NONE)) {
|
||||
return -1;
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
if (dropId == DROP_HEART && gSaveContext.health_capacity == gSaveContext.health)
|
||||
if (dropId == DROP_HEART && gSaveContext.health_capacity == gSaveContext.health) {
|
||||
return DROP_RUPEE_GREEN;
|
||||
}
|
||||
|
||||
return dropId;
|
||||
}
|
||||
|
||||
// External functions used by other actors to drop collectibles, which usually results in spawning an En_Item00 actor.
|
||||
|
||||
Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params)
|
||||
{
|
||||
Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) {
|
||||
s32 pad[2];
|
||||
ActorEnItem00* spawnedActor = NULL;
|
||||
s16 param4000 = params & 0x4000;
|
||||
@@ -956,26 +901,21 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 param
|
||||
|
||||
params = params & 0x3FFF;
|
||||
|
||||
if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000)
|
||||
{
|
||||
if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000) {
|
||||
// TODO: Prevent the cast to ActorEnItem00 here since this is a different actor (En_Elf)
|
||||
spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF,
|
||||
spawnPos->x, spawnPos->y + 40.0f, spawnPos->z,
|
||||
0, 0, 0, 0x0002);
|
||||
spawnedActor = (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x,
|
||||
spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0, 0x0002);
|
||||
func_8002A9F4(globalCtx, spawnPos, 0x28E7, 1, 1, 0x28);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!param8000)
|
||||
} else {
|
||||
if (!param8000) {
|
||||
params = func_8001F404(params & 0x00FF);
|
||||
}
|
||||
|
||||
if (params != -1)
|
||||
{
|
||||
spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00,
|
||||
spawnPos->x, spawnPos->y, spawnPos->z,
|
||||
0, 0, 0, params | param8000 | param3F00);
|
||||
if ((spawnedActor != NULL) && !param8000)
|
||||
{
|
||||
if (params != -1) {
|
||||
spawnedActor =
|
||||
(ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x, spawnPos->y,
|
||||
spawnPos->z, 0, 0, 0, params | param8000 | param3F00);
|
||||
if ((spawnedActor != NULL) && !param8000) {
|
||||
spawnedActor->actor.velocity.y = !param4000 ? 8.0f : -2.0f;
|
||||
spawnedActor->actor.speedXZ = 2.0f;
|
||||
spawnedActor->actor.gravity = -0.9f;
|
||||
@@ -985,8 +925,7 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 param
|
||||
spawnedActor->unk_15A = 220;
|
||||
if ((spawnedActor->actor.params != DROP_SMALL_KEY) &&
|
||||
(spawnedActor->actor.params != DROP_HEART_PIECE) &&
|
||||
(spawnedActor->actor.params != DROP_HEART_CONTAINER))
|
||||
{
|
||||
(spawnedActor->actor.params != DROP_HEART_CONTAINER)) {
|
||||
spawnedActor->actor.room = -1;
|
||||
}
|
||||
spawnedActor->actor.flags |= 0x0010;
|
||||
@@ -994,11 +933,10 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 param
|
||||
}
|
||||
}
|
||||
|
||||
return (Actor*) spawnedActor;
|
||||
return (Actor*)spawnedActor;
|
||||
}
|
||||
|
||||
Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params)
|
||||
{
|
||||
Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) {
|
||||
ActorEnItem00* spawnedActor = NULL;
|
||||
s32 pad;
|
||||
s16 param4000 = params & 0x4000;
|
||||
@@ -1007,24 +945,18 @@ Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 para
|
||||
|
||||
params = params & 0x3FFF;
|
||||
|
||||
if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000)
|
||||
{
|
||||
if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000) {
|
||||
// TODO: Prevent the cast to ActorEnItem00 here since this is a different actor (En_Elf)
|
||||
spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF,
|
||||
spawnPos->x, spawnPos->y + 40.0f, spawnPos->z,
|
||||
0, 0, 0, 0x0002);
|
||||
spawnedActor = (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x,
|
||||
spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0, 0x0002);
|
||||
func_8002A9F4(globalCtx, spawnPos, 0x28E7, 1, 1, 0x28);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
params = func_8001F404(params & 0x00FF);
|
||||
if (params != -1)
|
||||
{
|
||||
spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00,
|
||||
spawnPos->x, spawnPos->y, spawnPos->z,
|
||||
0, 0, 0, params | param8000 | param3F00);
|
||||
if ((spawnedActor != NULL) && !param8000)
|
||||
{
|
||||
if (params != -1) {
|
||||
spawnedActor =
|
||||
(ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x, spawnPos->y,
|
||||
spawnPos->z, 0, 0, 0, params | param8000 | param3F00);
|
||||
if ((spawnedActor != NULL) && !param8000) {
|
||||
spawnedActor->actor.velocity.y = 0.0f;
|
||||
spawnedActor->actor.speedXZ = 0.0f;
|
||||
spawnedActor->actor.gravity = param4000 ? 0.0f : -0.9f;
|
||||
@@ -1034,11 +966,10 @@ Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 para
|
||||
}
|
||||
}
|
||||
|
||||
return (Actor*) spawnedActor;
|
||||
return (Actor*)spawnedActor;
|
||||
}
|
||||
|
||||
void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3f* spawnPos, s16 params)
|
||||
{
|
||||
void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3f* spawnPos, s16 params) {
|
||||
s32 pad;
|
||||
ActorEnItem00* spawnedActor;
|
||||
s16 dropQuantity;
|
||||
@@ -1050,133 +981,93 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
|
||||
param8000 = params & 0x8000;
|
||||
params = params & 0x7FFF;
|
||||
|
||||
if (fromActor != NULL)
|
||||
{
|
||||
if (fromActor->unk_116)
|
||||
{
|
||||
if (fromActor->unk_116 & 0x01)
|
||||
{
|
||||
if (fromActor != NULL) {
|
||||
if (fromActor->unk_116) {
|
||||
if (fromActor->unk_116 & 0x01) {
|
||||
params = 1 * 0x10;
|
||||
dropTableIndex = 0xB;
|
||||
}
|
||||
else if (fromActor->unk_116 & 0x02)
|
||||
{
|
||||
} else if (fromActor->unk_116 & 0x02) {
|
||||
params = 1 * 0x10;
|
||||
dropTableIndex = 0x6;
|
||||
}
|
||||
else if (fromActor->unk_116 & 0x04)
|
||||
{
|
||||
} else if (fromActor->unk_116 & 0x04) {
|
||||
params = 6 * 0x10;
|
||||
dropTableIndex = 0x9;
|
||||
}
|
||||
else if (fromActor->unk_116 & 0x08)
|
||||
{
|
||||
} else if (fromActor->unk_116 & 0x08) {
|
||||
params = 3 * 0x10;
|
||||
dropTableIndex = 0xB;
|
||||
}
|
||||
else if (fromActor->unk_116 & 0x10)
|
||||
{
|
||||
} else if (fromActor->unk_116 & 0x10) {
|
||||
params = 6 * 0x10;
|
||||
dropTableIndex = 0xC;
|
||||
}
|
||||
else if (fromActor->unk_116 & 0x20)
|
||||
{
|
||||
} else if (fromActor->unk_116 & 0x20) {
|
||||
params = 0 * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
}
|
||||
else if (fromActor->unk_116 & 0x40)
|
||||
{
|
||||
} else if (fromActor->unk_116 & 0x40) {
|
||||
params = 0 * 0x10;
|
||||
dropTableIndex = 0x1;
|
||||
}
|
||||
}
|
||||
if (fromActor->unk_116 & 0x20)
|
||||
if (fromActor->unk_116 & 0x20) {
|
||||
dropId = DROP_RUPEE_PURPLE;
|
||||
else
|
||||
} else {
|
||||
dropId = D_80115574[params + dropTableIndex];
|
||||
}
|
||||
else
|
||||
}
|
||||
} else {
|
||||
dropId = D_80115574[params + dropTableIndex];
|
||||
}
|
||||
|
||||
if (dropId == DROP_FLEXIBLE)
|
||||
{
|
||||
if (gSaveContext.health <= 0x10) // 1 heart or less
|
||||
{
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF,
|
||||
spawnPos->x, spawnPos->y + 40.0f, spawnPos->z,
|
||||
0, 0, 0, 0x0002);
|
||||
if (dropId == DROP_FLEXIBLE) {
|
||||
if (gSaveContext.health <= 0x10) { // 1 heart or less
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, 0,
|
||||
0, 0, 0x0002);
|
||||
func_8002A9F4(globalCtx, spawnPos, 0x28E7, 1, 1, 0x28);
|
||||
return;
|
||||
}
|
||||
else if (gSaveContext.health <= 0x30) // 3 hearts or less
|
||||
{
|
||||
} else if (gSaveContext.health <= 0x30) { // 3 hearts or less
|
||||
params = 0xB * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_HEART;
|
||||
}
|
||||
else if (gSaveContext.health <= 0x50) // 5 hearts or less
|
||||
{
|
||||
} else if (gSaveContext.health <= 0x50) { // 5 hearts or less
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_HEART;
|
||||
}
|
||||
else if ((gSaveContext.magic_level != 0) && (gSaveContext.magic == 0)) // Empty magic meter
|
||||
{
|
||||
} else if ((gSaveContext.magic_level != 0) && (gSaveContext.magic == 0)) { // Empty magic meter
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_MAGIC_LARGE;
|
||||
}
|
||||
else if ((gSaveContext.magic_level != 0) && (gSaveContext.magic <= (gSaveContext.magic_level >> 1))) // Half magic or less
|
||||
{
|
||||
} else if ((gSaveContext.magic_level != 0) &&
|
||||
(gSaveContext.magic <= (gSaveContext.magic_level >> 1))) { // Half magic or less
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_MAGIC_SMALL;
|
||||
}
|
||||
else if (LINK_IS_CHILD && (AMMO(ITEM_SLINGSHOT) < 6)) // Child and less then 6 deku seeds
|
||||
{
|
||||
} else if (LINK_IS_CHILD && (AMMO(ITEM_SLINGSHOT) < 6)) { // Child and less then 6 deku seeds
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_SEEDS;
|
||||
}
|
||||
else if (LINK_IS_ADULT && (AMMO(ITEM_BOW) < 6)) // Adult and less than 6 arrows
|
||||
{
|
||||
} else if (LINK_IS_ADULT && (AMMO(ITEM_BOW) < 6)) { // Adult and less than 6 arrows
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_ARROWS_MEDIUM;
|
||||
}
|
||||
else if (AMMO(ITEM_BOMB) < 6) // Less than 6 bombs
|
||||
{
|
||||
} else if (AMMO(ITEM_BOMB) < 6) { // Less than 6 bombs
|
||||
params = 0xD * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_BOMBS_A;
|
||||
}
|
||||
else if (gSaveContext.rupees < 11) // Less than 11 Rupees
|
||||
{
|
||||
} else if (gSaveContext.rupees < 11) { // Less than 11 Rupees
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_RUPEE_RED;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (dropId != 0xFF)
|
||||
{
|
||||
if (dropId != 0xFF) {
|
||||
dropQuantity = D_80115664[params + dropTableIndex];
|
||||
while (dropQuantity > 0)
|
||||
{
|
||||
if (!param8000)
|
||||
{
|
||||
while (dropQuantity > 0) {
|
||||
if (!param8000) {
|
||||
dropId = func_8001F404(dropId);
|
||||
if (dropId != 0xFF)
|
||||
{
|
||||
spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00,
|
||||
spawnPos->x, spawnPos->y, spawnPos->z,
|
||||
0, 0, 0, dropId);
|
||||
if ((spawnedActor != NULL) && (dropId != 0xFF))
|
||||
{
|
||||
if (dropId != 0xFF) {
|
||||
spawnedActor = (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00,
|
||||
spawnPos->x, spawnPos->y, spawnPos->z, 0, 0, 0, dropId);
|
||||
if ((spawnedActor != NULL) && (dropId != 0xFF)) {
|
||||
spawnedActor->actor.velocity.y = 8.0f;
|
||||
spawnedActor->actor.speedXZ = 2.0f;
|
||||
spawnedActor->actor.gravity = -0.9f;
|
||||
@@ -1186,16 +1077,13 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
|
||||
spawnedActor->actor.flags |= 0x0010;
|
||||
if ((spawnedActor->actor.params != DROP_SMALL_KEY) &&
|
||||
(spawnedActor->actor.params != DROP_HEART_PIECE) &&
|
||||
(spawnedActor->actor.params != DROP_HEART_CONTAINER))
|
||||
{
|
||||
(spawnedActor->actor.params != DROP_HEART_CONTAINER)) {
|
||||
spawnedActor->actor.room = -1;
|
||||
}
|
||||
spawnedActor->unk_15A = 220;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Item_DropCollectible(globalCtx, spawnPos, params | 0x8000);
|
||||
}
|
||||
dropQuantity--;
|
||||
|
||||
@@ -18,4 +18,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo/func_800B23E8.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo/func_800B23F0.s")
|
||||
|
||||
|
||||
@@ -14,4 +14,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_8006CBAC.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_8006CF6C.s")
|
||||
|
||||
|
||||
+119
-175
@@ -2,22 +2,20 @@
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
s32 func_8006CFC0(s32 scene)
|
||||
{
|
||||
s32 func_8006CFC0(s32 scene) {
|
||||
s32 validScenes[] = { SCENE_SPOT00, SCENE_SPOT06, SCENE_SPOT09, SCENE_SPOT12, SCENE_SPOT20 };
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(validScenes); i++)
|
||||
{
|
||||
if (scene == validScenes[i])
|
||||
for (i = 0; i < ARRAY_COUNT(validScenes); i++) {
|
||||
if (scene == validScenes[i]) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void func_8006D074(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8006D074(GlobalContext* globalCtx) {
|
||||
gSaveContext.horse_data.scene = SCENE_SPOT00;
|
||||
gSaveContext.horse_data.pos.x = -1840;
|
||||
gSaveContext.horse_data.pos.y = 72;
|
||||
@@ -25,10 +23,8 @@ void func_8006D074(GlobalContext* globalCtx)
|
||||
gSaveContext.horse_data.angle = -27353;
|
||||
}
|
||||
|
||||
void func_8006D0AC(GlobalContext* globalCtx)
|
||||
{
|
||||
if (gSaveContext.horse_data.scene == SCENE_SPOT06)
|
||||
{
|
||||
void func_8006D0AC(GlobalContext* globalCtx) {
|
||||
if (gSaveContext.horse_data.scene == SCENE_SPOT06) {
|
||||
gSaveContext.horse_data.scene = SCENE_SPOT06;
|
||||
gSaveContext.horse_data.pos.x = -2065;
|
||||
gSaveContext.horse_data.pos.y = -863;
|
||||
@@ -37,147 +33,126 @@ void func_8006D0AC(GlobalContext* globalCtx)
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x00 */ s16 scene;
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 scene;
|
||||
/* 0x02 */ Vec3s pos;
|
||||
/* 0x08 */ s16 angle;
|
||||
/* 0x0A */ s16 type;
|
||||
/* 0x08 */ s16 angle;
|
||||
/* 0x0A */ s16 type;
|
||||
} HorseSpawn;
|
||||
|
||||
void func_8006D0EC(GlobalContext* globalCtx, Player* player)
|
||||
{
|
||||
void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
|
||||
s32 i;
|
||||
HorseSpawn horseSpawns[] =
|
||||
{
|
||||
{ 81, 0xFE34, 0x0064, 0x19F0, 0, 2 },
|
||||
{ 87, 0xF877, 0xFBFF, 0x0300, 0, 2 },
|
||||
{ 90, 0x0A06, 0xFEFD, 0x02FF, 0, 2 },
|
||||
{ 93, 0xFEB8, 0x000A, 0x03B9, 0, 2 },
|
||||
HorseSpawn horseSpawns[] = {
|
||||
{ 81, 0xFE34, 0x0064, 0x19F0, 0, 2 }, { 87, 0xF877, 0xFBFF, 0x0300, 0, 2 },
|
||||
{ 90, 0x0A06, 0xFEFD, 0x02FF, 0, 2 }, { 93, 0xFEB8, 0x000A, 0x03B9, 0, 2 },
|
||||
{ 99, 0x03A0, 0x0000, 0xF718, 0, 2 },
|
||||
};
|
||||
|
||||
if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)))
|
||||
{
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
player->actor.posRot.pos.x, player->actor.posRot.pos.y, player->actor.posRot.pos.z,
|
||||
player->actor.shape.rot.x, player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
|
||||
if (player->rideActor == NULL)
|
||||
if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) {
|
||||
player->rideActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.posRot.pos.x,
|
||||
player->actor.posRot.pos.y, player->actor.posRot.pos.z, player->actor.shape.rot.x,
|
||||
player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
|
||||
if (player->rideActor == NULL) {
|
||||
__assert("player->ride.actor != NULL", "../z_horse.c", 343);
|
||||
}
|
||||
|
||||
func_8002DECC(globalCtx, player, player->rideActor);
|
||||
func_8002DE74(globalCtx, player);
|
||||
gSaveContext.horse_data.scene = globalCtx->sceneNum;
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12)
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
||||
player->rideActor->room = -1;
|
||||
}
|
||||
else if ((globalCtx->sceneNum == SCENE_SPOT12) && (gSaveContext.minigame_state == 3))
|
||||
{
|
||||
}
|
||||
} else if ((globalCtx->sceneNum == SCENE_SPOT12) && (gSaveContext.minigame_state == 3)) {
|
||||
Actor* horseActor;
|
||||
gSaveContext.minigame_state = 0;
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
3586.0f, 1413.0f, -402.0f,
|
||||
0, 0x4000, 0, 1);
|
||||
horseActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1);
|
||||
horseActor->room = -1;
|
||||
}
|
||||
else if ((gSaveContext.entrance_index == 1230) && (gSaveContext.event_chk_inf[1] & 0x100))
|
||||
{
|
||||
} else if ((gSaveContext.entrance_index == 1230) && (gSaveContext.event_chk_inf[1] & 0x100)) {
|
||||
Actor* horseActor;
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
-25.0f, 0.0f, -1600.0f,
|
||||
0, -0x4000, 0, 1);
|
||||
if (horseActor == NULL)
|
||||
horseActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1);
|
||||
if (horseActor == NULL) {
|
||||
__assert("horse_actor != NULL", "../z_horse.c", 389);
|
||||
}
|
||||
else if ((globalCtx->sceneNum == gSaveContext.horse_data.scene) && (Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0))
|
||||
{
|
||||
// Translates to: "SET BY EXISTENCE OF HORSE %d %d %d"
|
||||
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horse_data.scene, Flags_GetEventChkInf(0x18), DREG(1));
|
||||
|
||||
if (func_8006CFC0(gSaveContext.horse_data.scene))
|
||||
{
|
||||
Actor* horseActor;
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
gSaveContext.horse_data.pos.x, gSaveContext.horse_data.pos.y, gSaveContext.horse_data.pos.z,
|
||||
0, gSaveContext.horse_data.angle, 0, 1);
|
||||
if (horseActor == NULL)
|
||||
__assert("horse_actor != NULL", "../z_horse.c", 414);
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12)
|
||||
horseActor->room = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else if ((globalCtx->sceneNum == gSaveContext.horse_data.scene) &&
|
||||
(Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0)) {
|
||||
// Translates to: "SET BY EXISTENCE OF HORSE %d %d %d"
|
||||
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horse_data.scene, Flags_GetEventChkInf(0x18),
|
||||
DREG(1));
|
||||
|
||||
if (func_8006CFC0(gSaveContext.horse_data.scene)) {
|
||||
Actor* horseActor;
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, gSaveContext.horse_data.pos.x,
|
||||
gSaveContext.horse_data.pos.y, gSaveContext.horse_data.pos.z, 0,
|
||||
gSaveContext.horse_data.angle, 0, 1);
|
||||
if (horseActor == NULL) {
|
||||
__assert("horse_actor != NULL", "../z_horse.c", 414);
|
||||
}
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
||||
horseActor->room = -1;
|
||||
}
|
||||
} else {
|
||||
osSyncPrintf(VT_COL(RED, WHITE));
|
||||
// Translates to: "Horse_SetNormal():%d SET SPOT IS NO GOOD."
|
||||
osSyncPrintf("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.horse_data.scene);
|
||||
osSyncPrintf(VT_RST);
|
||||
func_8006D074(globalCtx);
|
||||
}
|
||||
}
|
||||
else if ((globalCtx->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0))
|
||||
{
|
||||
} else if ((globalCtx->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0)) {
|
||||
Actor* horseActor;
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
0.0f, 0.0f, -500.0f,
|
||||
0, 0, 0, 1);
|
||||
if (horseActor == 0)
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1);
|
||||
if (horseActor == 0) {
|
||||
__assert("horse_actor != NULL", "../z_horse.c", 443);
|
||||
}
|
||||
else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))
|
||||
{
|
||||
for (i = 0; i < ARRAY_COUNT(horseSpawns); i++)
|
||||
{
|
||||
}
|
||||
} else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) {
|
||||
for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) {
|
||||
HorseSpawn* horseSpawn = &horseSpawns[i];
|
||||
if (horseSpawn->scene == globalCtx->sceneNum)
|
||||
{
|
||||
if (horseSpawn->scene == globalCtx->sceneNum) {
|
||||
Actor* horseActor;
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
horseSpawn->pos.x, horseSpawn->pos.y, horseSpawn->pos.z,
|
||||
0, horseSpawn->angle, 0, horseSpawn->type);
|
||||
if (horseActor == NULL)
|
||||
horseActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, horseSpawn->pos.x, horseSpawn->pos.y,
|
||||
horseSpawn->pos.z, 0, horseSpawn->angle, 0, horseSpawn->type);
|
||||
if (horseActor == NULL) {
|
||||
__assert("horse_actor != NULL", "../z_horse.c", 466);
|
||||
}
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12)
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
||||
horseActor->room = -1;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!Flags_GetEventChkInf(0x18))
|
||||
{
|
||||
if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) &&(gSaveContext.night_flag != 0))
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
0.0f, 0.0f, -60.0f,
|
||||
0, 0x7360, 0, 1);
|
||||
} else if (!Flags_GetEventChkInf(0x18)) {
|
||||
if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) && (gSaveContext.night_flag != 0)) {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x00 */ s16 scene;
|
||||
/* 0x04 */ s32 cutsceneIndex;
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 scene;
|
||||
/* 0x04 */ s32 cutsceneIndex;
|
||||
/* 0x08 */ Vec3s pos;
|
||||
/* 0x0E */ s16 angle;
|
||||
/* 0x10 */ s16 type;
|
||||
/* 0x0E */ s16 angle;
|
||||
/* 0x10 */ s16 type;
|
||||
} struct_8011F9B8;
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc differences
|
||||
void func_8006D684(GlobalContext* globalCtx, Player* player)
|
||||
{
|
||||
void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
s32 pad;
|
||||
s32 i;
|
||||
Vec3s spawnPos;
|
||||
|
||||
if ((gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E ||
|
||||
gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) &&
|
||||
(gSaveContext.respawn_flag == 0))
|
||||
{
|
||||
Vec3s spawnPositions[] =
|
||||
{
|
||||
(gSaveContext.respawn_flag == 0)) {
|
||||
Vec3s spawnPositions[] = {
|
||||
{ 0xF46F, 0x0139, 0x1E14 },
|
||||
{ 0xF894, 0x0139, 0x1B67 },
|
||||
{ 0xF035, 0x0139, 0x1B15 },
|
||||
@@ -193,22 +168,18 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
|
||||
else
|
||||
spawnPos = spawnPositions[3];
|
||||
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
spawnPos.x, spawnPos.y, spawnPos.z,
|
||||
0, player->actor.posRot.rot.y, 0, 7);
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y,
|
||||
spawnPos.z, 0, player->actor.posRot.rot.y, 0, 7);
|
||||
if (player->rideActor == NULL)
|
||||
__assert("player->ride.actor != NULL", "../z_horse.c", 561);
|
||||
|
||||
func_8002DECC(globalCtx, player, player->rideActor);
|
||||
func_8002DE74(globalCtx, player);
|
||||
gSaveContext.horse_data.scene = globalCtx->sceneNum;
|
||||
}
|
||||
else if ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) &&
|
||||
(Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0))
|
||||
{
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
894.0f, 0.0f, -2084.0f,
|
||||
0, -0x7FFF, 0, 5);
|
||||
} else if ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) &&
|
||||
(Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0)) {
|
||||
player->rideActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5);
|
||||
if (player->rideActor == NULL)
|
||||
__assert("player->ride.actor != NULL", "../z_horse.c", 582);
|
||||
|
||||
@@ -218,45 +189,33 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12)
|
||||
player->rideActor->room = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
static struct_8011F9B8 D_8011F9B8[] =
|
||||
{
|
||||
{ 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 },
|
||||
{ 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 },
|
||||
{ 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 },
|
||||
{ 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 },
|
||||
{ 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 },
|
||||
{ 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 },
|
||||
{ 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
|
||||
{ 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
|
||||
} else {
|
||||
static struct_8011F9B8 D_8011F9B8[] = {
|
||||
{ 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 }, { 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 },
|
||||
{ 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 }, { 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 },
|
||||
{ 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 }, { 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 },
|
||||
{ 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, { 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
|
||||
};
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(D_8011F9B8); i++)
|
||||
{
|
||||
if ((globalCtx->sceneNum == D_8011F9B8[i].scene) && (gSaveContext.cutscene_index == D_8011F9B8[i].cutsceneIndex))
|
||||
{
|
||||
if (D_8011F9B8[i].type == 7)
|
||||
{
|
||||
if ((globalCtx->sceneNum == 99) && (gSaveContext.cutscene_index == 0xFFF1))
|
||||
{
|
||||
for (i = 0; i < ARRAY_COUNT(D_8011F9B8); i++) {
|
||||
if ((globalCtx->sceneNum == D_8011F9B8[i].scene) &&
|
||||
(gSaveContext.cutscene_index == D_8011F9B8[i].cutsceneIndex)) {
|
||||
if (D_8011F9B8[i].type == 7) {
|
||||
if ((globalCtx->sceneNum == 99) && (gSaveContext.cutscene_index == 0xFFF1)) {
|
||||
D_8011F9B8[i].pos.x = player->actor.posRot.pos.x;
|
||||
D_8011F9B8[i].pos.y = player->actor.posRot.pos.y;
|
||||
D_8011F9B8[i].pos.z = player->actor.posRot.pos.z;
|
||||
}
|
||||
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z,
|
||||
0, player->actor.posRot.rot.y, 0, D_8011F9B8[i].type);
|
||||
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
|
||||
player->actor.posRot.rot.y, 0, D_8011F9B8[i].type);
|
||||
if (player->rideActor == NULL)
|
||||
__assert("player->ride.actor != NULL", "../z_horse.c", 628);
|
||||
|
||||
func_8002DECC(globalCtx, player, player->rideActor);
|
||||
func_8002DE74(globalCtx, player);
|
||||
}
|
||||
else if ((D_8011F9B8[i].type == 5) || (D_8011F9B8[i].type == 6) || (D_8011F9B8[i].type == 8))
|
||||
{
|
||||
} else if ((D_8011F9B8[i].type == 5) || (D_8011F9B8[i].type == 6) || (D_8011F9B8[i].type == 8)) {
|
||||
Vec3f sp54;
|
||||
s32 temp;
|
||||
s32 pad2;
|
||||
@@ -266,8 +225,8 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
|
||||
temp = 0x8000;
|
||||
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z,
|
||||
0, D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp);
|
||||
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
|
||||
D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp);
|
||||
if (player->rideActor == NULL)
|
||||
__assert("player->ride.actor != NULL", "../z_horse.c", 667);
|
||||
|
||||
@@ -285,12 +244,10 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
|
||||
sp54.z = player->actor.posRot.pos.z;
|
||||
|
||||
func_800C04D8(globalCtx, globalCtx->cameraCtx.unk_5C0, &player->actor.posRot, &sp54);
|
||||
}
|
||||
else
|
||||
{
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z,
|
||||
0, D_8011F9B8[i].angle, 0, D_8011F9B8[i].type);
|
||||
} else {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x,
|
||||
D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, D_8011F9B8[i].angle, 0,
|
||||
D_8011F9B8[i].type);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -298,33 +255,24 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
|
||||
}
|
||||
}
|
||||
#else
|
||||
Vec3s D_8011F9A0[] =
|
||||
{
|
||||
Vec3s D_8011F9A0[] = {
|
||||
{ 0xF46F, 0x0139, 0x1E14 },
|
||||
{ 0xF894, 0x0139, 0x1B67 },
|
||||
{ 0xF035, 0x0139, 0x1B15 },
|
||||
{ 0xF6F7, 0x0139, 0x1766 },
|
||||
};
|
||||
struct_8011F9B8 D_8011F9B8[] =
|
||||
{
|
||||
{ 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 },
|
||||
{ 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 },
|
||||
{ 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 },
|
||||
{ 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 },
|
||||
{ 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 },
|
||||
{ 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 },
|
||||
{ 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
|
||||
{ 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
|
||||
struct_8011F9B8 D_8011F9B8[] = {
|
||||
{ 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 }, { 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 },
|
||||
{ 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 }, { 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 },
|
||||
{ 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 }, { 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 },
|
||||
{ 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, { 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
|
||||
};
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_horse/func_8006D684.s")
|
||||
#endif
|
||||
|
||||
void func_8006DC68(GlobalContext* globalCtx, Player* player)
|
||||
{
|
||||
if (LINK_IS_ADULT)
|
||||
{
|
||||
if (!func_8006CFC0(gSaveContext.horse_data.scene))
|
||||
{
|
||||
void func_8006DC68(GlobalContext* globalCtx, Player* player) {
|
||||
if (LINK_IS_ADULT) {
|
||||
if (!func_8006CFC0(gSaveContext.horse_data.scene)) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE));
|
||||
// Translates to: "Horse_Set_Check():%d SET SPOT IS NO GOOD."
|
||||
osSyncPrintf("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.horse_data.scene);
|
||||
@@ -332,35 +280,31 @@ void func_8006DC68(GlobalContext* globalCtx, Player* player)
|
||||
func_8006D074(globalCtx);
|
||||
}
|
||||
|
||||
if (func_8006CFC0(globalCtx->sceneNum))
|
||||
{
|
||||
if (func_8006CFC0(globalCtx->sceneNum)) {
|
||||
if ((gSaveContext.scene_setup_index > 3) ||
|
||||
((gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E ||
|
||||
gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) &&
|
||||
(gSaveContext.respawn_flag == 0)) ||
|
||||
((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) &&
|
||||
!Flags_GetEventChkInf(0x18) && (DREG(1) == 0)))
|
||||
{
|
||||
!Flags_GetEventChkInf(0x18) && (DREG(1) == 0))) {
|
||||
func_8006D684(globalCtx, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
func_8006D0EC(globalCtx, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2)
|
||||
{
|
||||
void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2) {
|
||||
s16 x = Math_Vec3f_Yaw(&actor->posRot.pos, arg1) - actor->posRot.rot.y;
|
||||
|
||||
if (x > arg2)
|
||||
if (x > arg2) {
|
||||
actor->posRot.rot.y += arg2;
|
||||
else if (x < -arg2)
|
||||
} else if (x < -arg2) {
|
||||
actor->posRot.rot.y -= arg2;
|
||||
else
|
||||
} else {
|
||||
actor->posRot.rot.y += x;
|
||||
}
|
||||
|
||||
actor->shape.rot.y = actor->posRot.rot.y;
|
||||
}
|
||||
|
||||
@@ -10,4 +10,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_jpeg/func_8006E0EC.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_jpeg/func_8006E418.s")
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
#define KALEIDO_OVERLAY(name) \
|
||||
{ \
|
||||
NULL, (u32)_ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, \
|
||||
_ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, \
|
||||
0, #name, \
|
||||
#define KALEIDO_OVERLAY(name) \
|
||||
{ \
|
||||
NULL, (u32)_ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, _ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, 0, #name, \
|
||||
}
|
||||
|
||||
KaleidoManagerOvl gKaleidoMgrOverlayTable[] =
|
||||
{
|
||||
KaleidoManagerOvl gKaleidoMgrOverlayTable[] = {
|
||||
KALEIDO_OVERLAY(kaleido_scope),
|
||||
KALEIDO_OVERLAY(player_actor),
|
||||
};
|
||||
@@ -18,22 +16,21 @@ void* sKaleidoAreaPtr = NULL;
|
||||
KaleidoManagerOvl* gKaleidoMgrCurOvl = NULL;
|
||||
u32 D_8012D1E0 = 0;
|
||||
|
||||
void KaleidoManager_LoadOvl(KaleidoManagerOvl* ovl)
|
||||
{
|
||||
void KaleidoManager_LoadOvl(KaleidoManagerOvl* ovl) {
|
||||
LogUtils_CheckNullPointer("KaleidoArea_allocp", sKaleidoAreaPtr, "../z_kaleido_manager.c", 99);
|
||||
ovl->loadedRamAddr = sKaleidoAreaPtr;
|
||||
Overlay_Load(ovl->vromStart, ovl->vromEnd, ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr);
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("OVL(k):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr, ((u32)ovl->loadedRamAddr + ovl->vramEnd) - (u32)ovl->vramStart, (u32)ovl->vramStart - (u32)ovl->loadedRamAddr, ovl->name);
|
||||
osSyncPrintf("OVL(k):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr,
|
||||
((u32)ovl->loadedRamAddr + ovl->vramEnd) - (u32)ovl->vramStart,
|
||||
(u32)ovl->vramStart - (u32)ovl->loadedRamAddr, ovl->name);
|
||||
osSyncPrintf(VT_RST);
|
||||
ovl->off = (u32)ovl->loadedRamAddr - (u32)ovl->vramStart;
|
||||
gKaleidoMgrCurOvl = ovl;
|
||||
}
|
||||
|
||||
void KaleidoManager_ClearOvl(KaleidoManagerOvl* ovl)
|
||||
{
|
||||
if (ovl->loadedRamAddr)
|
||||
{
|
||||
void KaleidoManager_ClearOvl(KaleidoManagerOvl* ovl) {
|
||||
if (ovl->loadedRamAddr) {
|
||||
ovl->off = 0;
|
||||
bzero(ovl->loadedRamAddr, ovl->vramEnd - (u32)ovl->vramStart);
|
||||
ovl->loadedRamAddr = NULL;
|
||||
@@ -41,18 +38,17 @@ void KaleidoManager_ClearOvl(KaleidoManagerOvl* ovl)
|
||||
}
|
||||
}
|
||||
|
||||
void KaleidoManager_Init(GlobalContext* globalCtx)
|
||||
{
|
||||
void KaleidoManager_Init(GlobalContext* globalCtx) {
|
||||
s32 largestOvl;
|
||||
s32 vramSize;
|
||||
u32 idx;
|
||||
|
||||
largestOvl = 0;
|
||||
for (idx = 0; idx < ARRAY_COUNT(gKaleidoMgrOverlayTable); idx++)
|
||||
{
|
||||
for (idx = 0; idx < ARRAY_COUNT(gKaleidoMgrOverlayTable); idx++) {
|
||||
vramSize = gKaleidoMgrOverlayTable[idx].vramEnd - (u32)gKaleidoMgrOverlayTable[idx].vramStart;
|
||||
if (largestOvl < vramSize)
|
||||
if (largestOvl < vramSize) {
|
||||
largestOvl = vramSize;
|
||||
}
|
||||
}
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("KaleidoArea の最大サイズは %d バイトを確保します\n", largestOvl);
|
||||
@@ -64,46 +60,41 @@ void KaleidoManager_Init(GlobalContext* globalCtx)
|
||||
osSyncPrintf(VT_RST);
|
||||
gKaleidoMgrCurOvl = 0;
|
||||
}
|
||||
void KaleidoManager_Destroy()
|
||||
{
|
||||
if (gKaleidoMgrCurOvl)
|
||||
{
|
||||
void KaleidoManager_Destroy() {
|
||||
if (gKaleidoMgrCurOvl) {
|
||||
KaleidoManager_ClearOvl(gKaleidoMgrCurOvl);
|
||||
gKaleidoMgrCurOvl = NULL;
|
||||
}
|
||||
sKaleidoAreaPtr = NULL;
|
||||
}
|
||||
|
||||
//NOTE: this function looks messed up and probably doesn't work like how the devs wanted it to work
|
||||
void* KaleidoManager_GetRamAddr(void* vram)
|
||||
{
|
||||
// NOTE: this function looks messed up and probably doesn't work like how the devs wanted it to work
|
||||
void* KaleidoManager_GetRamAddr(void* vram) {
|
||||
KaleidoManagerOvl* iter;
|
||||
KaleidoManagerOvl* ovl;
|
||||
u32 idx;
|
||||
|
||||
iter = gKaleidoMgrCurOvl;
|
||||
ovl = iter;
|
||||
if (!ovl)
|
||||
{
|
||||
if (!ovl) {
|
||||
iter = &gKaleidoMgrOverlayTable[0];
|
||||
for (idx = 0; idx != ARRAY_COUNT(gKaleidoMgrOverlayTable); idx++)
|
||||
{
|
||||
if ((u32)vram >= (u32)iter->vramStart && (u32)iter->vramEnd >= (u32)vram)
|
||||
{
|
||||
for (idx = 0; idx != ARRAY_COUNT(gKaleidoMgrOverlayTable); idx++) {
|
||||
if ((u32)vram >= (u32)iter->vramStart && (u32)iter->vramEnd >= (u32)vram) {
|
||||
KaleidoManager_LoadOvl(iter);
|
||||
ovl = iter;
|
||||
goto KaleidoManager_GetRamAddr_end;
|
||||
}
|
||||
//BUG: devs probably forgot iter++ here
|
||||
// BUG: devs probably forgot iter++ here
|
||||
}
|
||||
|
||||
osSyncPrintf("異常\n"); //Abnormal
|
||||
|
||||
osSyncPrintf("異常\n"); // Abnormal
|
||||
return NULL;
|
||||
}
|
||||
|
||||
KaleidoManager_GetRamAddr_end:
|
||||
if (!ovl || (u32)vram < (u32)ovl->vramStart || (u32)vram >= (u32)ovl->vramEnd)
|
||||
if (!ovl || (u32)vram < (u32)ovl->vramStart || (u32)vram >= (u32)ovl->vramEnd) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (void*)((u32)vram + ovl->off);
|
||||
}
|
||||
|
||||
@@ -7,34 +7,30 @@ float D_80161398;
|
||||
u32 D_8016139C;
|
||||
void* D_801613A0;
|
||||
|
||||
extern void func_80826CB4(GlobalContext*); //KaleidoScope_Update
|
||||
extern void func_808262B8(GlobalContext*); //KaleidoScope_Draw
|
||||
extern void func_80826CB4(GlobalContext*); // KaleidoScope_Update
|
||||
extern void func_808262B8(GlobalContext*); // KaleidoScope_Draw
|
||||
|
||||
void KaleidoScopeCall_LoadPlayer()
|
||||
{
|
||||
if ((u32)gKaleidoMgrCurOvl != (u32)&gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR])
|
||||
{
|
||||
if (gKaleidoMgrCurOvl)
|
||||
{
|
||||
void KaleidoScopeCall_LoadPlayer() {
|
||||
if ((u32)gKaleidoMgrCurOvl != (u32)&gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR]) {
|
||||
if (gKaleidoMgrCurOvl) {
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("カレイド領域 強制排除\n"); //Kaleido area forced exclusion
|
||||
osSyncPrintf("カレイド領域 強制排除\n"); // Kaleido area forced exclusion
|
||||
osSyncPrintf(VT_RST);
|
||||
KaleidoManager_ClearOvl(gKaleidoMgrCurOvl);
|
||||
}
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("プレイヤーアクター搬入\n"); //Player actor import
|
||||
osSyncPrintf("プレイヤーアクター搬入\n"); // Player actor import
|
||||
osSyncPrintf(VT_RST);
|
||||
KaleidoManager_LoadOvl(&gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR]);
|
||||
}
|
||||
}
|
||||
|
||||
void KaleidoScopeCall_Init(GlobalContext* globalCtx)
|
||||
{
|
||||
//Kaleidoscope replacement construct
|
||||
void KaleidoScopeCall_Init(GlobalContext* globalCtx) {
|
||||
// Kaleidoscope replacement construct
|
||||
osSyncPrintf("カレイド・スコープ入れ替え コンストラクト \n");
|
||||
sKaleidoScopeUpdateFunc = KaleidoManager_GetRamAddr(func_80826CB4);
|
||||
sKaleidoScopeDrawFunc = KaleidoManager_GetRamAddr(func_808262B8);
|
||||
//Note : the line numbers suggests there was a macro (see logutils.c)
|
||||
// Note : the line numbers suggests there was a macro (see logutils.c)
|
||||
LogUtils_LogThreadId("../z_kaleido_scope_call.c", 98);
|
||||
osSyncPrintf("kaleido_scope_move = %08x\n", func_80826CB4);
|
||||
LogUtils_LogThreadId("../z_kaleido_scope_call.c", 99);
|
||||
@@ -46,28 +42,23 @@ void KaleidoScopeCall_Init(GlobalContext* globalCtx)
|
||||
func_8006ECF4(globalCtx);
|
||||
}
|
||||
|
||||
void KaleidoScopeCall_Destroy(GlobalContext* globalCtx)
|
||||
{
|
||||
//Kaleidoscope replacement
|
||||
void KaleidoScopeCall_Destroy(GlobalContext* globalCtx) {
|
||||
// Kaleidoscope replacement
|
||||
osSyncPrintf("カレイド・スコープ入れ替え デストラクト \n");
|
||||
func_8006EE48(globalCtx);
|
||||
}
|
||||
|
||||
//regalloc
|
||||
// regalloc
|
||||
#ifdef NON_MATCHING
|
||||
void KaleidoScopeCall_Update(GlobalContext* globalCtx)
|
||||
{
|
||||
void KaleidoScopeCall_Update(GlobalContext* globalCtx) {
|
||||
u32 pad;
|
||||
PauseContext* pauseCtx;
|
||||
|
||||
|
||||
pauseCtx = &globalCtx->pauseCtx;
|
||||
|
||||
if (pauseCtx->state != 0 || pauseCtx->flag != 0)
|
||||
{
|
||||
if (pauseCtx->state == 1)
|
||||
{
|
||||
if (func_800B38FC() == 0)
|
||||
{
|
||||
if (pauseCtx->state != 0 || pauseCtx->flag != 0) {
|
||||
if (pauseCtx->state == 1) {
|
||||
if (func_800B38FC() == 0) {
|
||||
HREG(80) = 7;
|
||||
HREG(82) = 3;
|
||||
R_PAUSE_MENU_MODE = 1;
|
||||
@@ -75,45 +66,35 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx)
|
||||
pauseCtx->unk_1EC = 0;
|
||||
pauseCtx->state++;
|
||||
}
|
||||
}
|
||||
else if (pauseCtx->state == 8)
|
||||
{
|
||||
} else if (pauseCtx->state == 8) {
|
||||
HREG(80) = 7;
|
||||
HREG(82) = 3;
|
||||
R_PAUSE_MENU_MODE = 1;
|
||||
pauseCtx->unk_1E4 = 0;
|
||||
pauseCtx->unk_1EC = 0;
|
||||
pauseCtx->state++;
|
||||
}
|
||||
else if (pauseCtx->state == 2 || pauseCtx->state == 9)
|
||||
{
|
||||
} else if (pauseCtx->state == 2 || pauseCtx->state == 9) {
|
||||
osSyncPrintf("R_PAUSE_MENU_MODE=%d\n", R_PAUSE_MENU_MODE);
|
||||
if (R_PAUSE_MENU_MODE >= 3)
|
||||
pauseCtx->state++;
|
||||
}
|
||||
else if (pauseCtx->state != 0)
|
||||
{
|
||||
if (&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE] != gKaleidoMgrCurOvl)
|
||||
{
|
||||
if (gKaleidoMgrCurOvl)
|
||||
{
|
||||
} else if (pauseCtx->state != 0) {
|
||||
if (&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE] != gKaleidoMgrCurOvl) {
|
||||
if (gKaleidoMgrCurOvl) {
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("カレイド領域 プレイヤー 強制排除\n"); //Kaleid Zone Player Forced Elimination
|
||||
osSyncPrintf("カレイド領域 プレイヤー 強制排除\n"); // Kaleid Zone Player Forced Elimination
|
||||
osSyncPrintf(VT_RST);
|
||||
KaleidoManager_ClearOvl(gKaleidoMgrCurOvl);
|
||||
}
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("カレイド領域 カレイドスコープ搬入\n"); //Kaleid area Kaleidoscope loading
|
||||
osSyncPrintf("カレイド領域 カレイドスコープ搬入\n"); // Kaleid area Kaleidoscope loading
|
||||
osSyncPrintf(VT_RST);
|
||||
KaleidoManager_LoadOvl(&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]);
|
||||
}
|
||||
if (&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE] == gKaleidoMgrCurOvl)
|
||||
{
|
||||
if (&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE] == gKaleidoMgrCurOvl) {
|
||||
sKaleidoScopeUpdateFunc(globalCtx);
|
||||
if (globalCtx->pauseCtx.state == 0 && globalCtx->pauseCtx.flag == 0)
|
||||
{
|
||||
if (globalCtx->pauseCtx.state == 0 && globalCtx->pauseCtx.flag == 0) {
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("カレイド領域 カレイドスコープ排出\n"); //Kaleid area Kaleidoscope emission
|
||||
osSyncPrintf("カレイド領域 カレイドスコープ排出\n"); // Kaleid area Kaleidoscope emission
|
||||
osSyncPrintf(VT_RST);
|
||||
KaleidoManager_ClearOvl(&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]);
|
||||
KaleidoScopeCall_LoadPlayer();
|
||||
@@ -126,18 +107,16 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kaleido_scope_call/KaleidoScopeCall_Update.s")
|
||||
#endif
|
||||
|
||||
void KaleidoScopeCall_Draw(GlobalContext* globalCtx)
|
||||
{
|
||||
KaleidoManagerOvl *kaleidoScopeOvl;
|
||||
void KaleidoScopeCall_Draw(GlobalContext* globalCtx) {
|
||||
KaleidoManagerOvl* kaleidoScopeOvl;
|
||||
|
||||
if (R_PAUSE_MENU_MODE >= 3)
|
||||
{
|
||||
if ((globalCtx->pauseCtx.state >= 4 && globalCtx->pauseCtx.state < 8) || (globalCtx->pauseCtx.state >= 11 && globalCtx->pauseCtx.state < 19))
|
||||
{
|
||||
if (R_PAUSE_MENU_MODE >= 3) {
|
||||
if ((globalCtx->pauseCtx.state >= 4 && globalCtx->pauseCtx.state < 8) ||
|
||||
(globalCtx->pauseCtx.state >= 11 && globalCtx->pauseCtx.state < 19)) {
|
||||
kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
|
||||
if (gKaleidoMgrCurOvl == kaleidoScopeOvl)
|
||||
if (gKaleidoMgrCurOvl == kaleidoScopeOvl) {
|
||||
sKaleidoScopeDrawFunc(globalCtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,4 +6,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kanfont/func_8006EEBC.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kanfont/func_8006EF10.s")
|
||||
|
||||
|
||||
+5
-11
@@ -31,8 +31,7 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_80073A5C.s")
|
||||
|
||||
f32 func_800746DC()
|
||||
{
|
||||
f32 func_800746DC() {
|
||||
return Math_Rand_ZeroOne() - 0.5f;
|
||||
}
|
||||
|
||||
@@ -70,23 +69,19 @@ f32 func_800746DC()
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800773A8.s")
|
||||
|
||||
s32 func_800775CC()
|
||||
{
|
||||
s32 func_800775CC() {
|
||||
return gSaveContext.unk_18;
|
||||
}
|
||||
|
||||
void func_800775D8()
|
||||
{
|
||||
void func_800775D8() {
|
||||
gSaveContext.unk_18 = 0;
|
||||
}
|
||||
|
||||
s32 func_800775E4()
|
||||
{
|
||||
s32 func_800775E4() {
|
||||
return gSaveContext.unk_14;
|
||||
}
|
||||
|
||||
void func_800775F0(u16 arg0)
|
||||
{
|
||||
void func_800775F0(u16 arg0) {
|
||||
gSaveContext.unk_140E = arg0;
|
||||
}
|
||||
|
||||
@@ -97,4 +92,3 @@ void func_800775F0(u16 arg0)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_80077684.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800776E4.s")
|
||||
|
||||
|
||||
+148
-226
@@ -1,109 +1,94 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void Lib_MemSet(u8* dest, size_t size, u8 val)
|
||||
{
|
||||
void Lib_MemSet(u8* dest, size_t size, u8 val) {
|
||||
u32 i = 0;
|
||||
|
||||
// TODO: Convert this to while/for if possible
|
||||
if (i == size) return;
|
||||
if (i == size) {
|
||||
return;
|
||||
}
|
||||
do {
|
||||
*dest++ = val;
|
||||
i++;
|
||||
} while (i != size);
|
||||
}
|
||||
|
||||
f32 Math_Coss(s16 angle)
|
||||
{
|
||||
f32 Math_Coss(s16 angle) {
|
||||
return coss(angle) * (1.0f / 32767);
|
||||
}
|
||||
|
||||
f32 Math_Sins(s16 angle)
|
||||
{
|
||||
f32 Math_Sins(s16 angle) {
|
||||
return sins(angle) * (1.0f / 32767);
|
||||
}
|
||||
|
||||
s32 Math_ApproxUpdateScaledS(s16* pValue, s16 target, s16 step)
|
||||
{
|
||||
s32 Math_ApproxUpdateScaledS(s16* pValue, s16 target, s16 step) {
|
||||
f32 updateScale;
|
||||
|
||||
if (step != 0)
|
||||
{
|
||||
if (step != 0) {
|
||||
updateScale = R_UPDATE_RATE * 0.5f;
|
||||
|
||||
if ((s16)(*pValue - target) > 0)
|
||||
if ((s16)(*pValue - target) > 0) {
|
||||
step = -step;
|
||||
}
|
||||
|
||||
*pValue += (s16)(step * updateScale);
|
||||
|
||||
if (((s16)(*pValue - target) * step) >= 0)
|
||||
{
|
||||
if (((s16)(*pValue - target) * step) >= 0) {
|
||||
*pValue = target;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (target == *pValue)
|
||||
{
|
||||
} else if (target == *pValue) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 Math_ApproxS(s16* pValue, s16 target, s16 step)
|
||||
{
|
||||
if (step != 0)
|
||||
{
|
||||
if (target < *pValue)
|
||||
s32 Math_ApproxS(s16* pValue, s16 target, s16 step) {
|
||||
if (step != 0) {
|
||||
if (target < *pValue) {
|
||||
step = -step;
|
||||
}
|
||||
|
||||
*pValue += step;
|
||||
|
||||
if (((*pValue - target) * step) >= 0)
|
||||
{
|
||||
if (((*pValue - target) * step) >= 0) {
|
||||
*pValue = target;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (target == *pValue)
|
||||
{
|
||||
} else if (target == *pValue) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 Math_ApproxF(f32* pValue, f32 target, f32 step)
|
||||
{
|
||||
if (step != 0.0f)
|
||||
{
|
||||
if (target < *pValue)
|
||||
s32 Math_ApproxF(f32* pValue, f32 target, f32 step) {
|
||||
if (step != 0.0f) {
|
||||
if (target < *pValue) {
|
||||
step = -step;
|
||||
}
|
||||
|
||||
*pValue += step;
|
||||
|
||||
if (((*pValue - target) * step) >= 0)
|
||||
{
|
||||
if (((*pValue - target) * step) >= 0) {
|
||||
*pValue = target;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (target == *pValue)
|
||||
{
|
||||
} else if (target == *pValue) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 func_80077A90(s16* pValue, s16 target, s16 step)
|
||||
{
|
||||
s32 func_80077A90(s16* pValue, s16 target, s16 step) {
|
||||
s16 orig = *pValue;
|
||||
|
||||
*pValue += step;
|
||||
|
||||
if (((s16)(*pValue - target) * (s16)(orig - target)) <= 0)
|
||||
{
|
||||
if (((s16)(*pValue - target) * (s16)(orig - target)) <= 0) {
|
||||
*pValue = target;
|
||||
return 1;
|
||||
}
|
||||
@@ -111,14 +96,12 @@ s32 func_80077A90(s16* pValue, s16 target, s16 step)
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 func_80077AF8(s16* pValue, s16 target, s16 step)
|
||||
{
|
||||
s32 func_80077AF8(s16* pValue, s16 target, s16 step) {
|
||||
s16 orig = *pValue;
|
||||
|
||||
*pValue += step;
|
||||
|
||||
if (((*pValue - target) * ((s16)orig - target)) <= 0)
|
||||
{
|
||||
if (((*pValue - target) * ((s16)orig - target)) <= 0) {
|
||||
*pValue = target;
|
||||
return 1;
|
||||
}
|
||||
@@ -126,50 +109,41 @@ s32 func_80077AF8(s16* pValue, s16 target, s16 step)
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 func_80077B58(s16* pValue, s16 target, s16 step)
|
||||
{
|
||||
s32 func_80077B58(s16* pValue, s16 target, s16 step) {
|
||||
s32 phi_v0 = target - *pValue;
|
||||
|
||||
if (phi_v0 < 0)
|
||||
if (phi_v0 < 0) {
|
||||
step = -step;
|
||||
}
|
||||
|
||||
if (phi_v0 >= 0x8000)
|
||||
{
|
||||
if (phi_v0 >= 0x8000) {
|
||||
step = -step;
|
||||
phi_v0 = 0xFFFF0001 - -phi_v0;
|
||||
}
|
||||
else if (phi_v0 <= -0x8000)
|
||||
{
|
||||
} else if (phi_v0 <= -0x8000) {
|
||||
phi_v0 += 0xFFFF;
|
||||
step = -step;
|
||||
}
|
||||
|
||||
if (step != 0)
|
||||
{
|
||||
if (step != 0) {
|
||||
*pValue += step;
|
||||
|
||||
if ((phi_v0 * step) <= 0)
|
||||
{
|
||||
if ((phi_v0 * step) <= 0) {
|
||||
*pValue = target;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (target == *pValue)
|
||||
{
|
||||
} else if (target == *pValue) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 func_80077C1C(f32* pValue, f32 target, f32 step)
|
||||
{
|
||||
s32 func_80077C1C(f32* pValue, f32 target, f32 step) {
|
||||
f32 orig = *pValue;
|
||||
|
||||
*pValue += step;
|
||||
|
||||
if (((*pValue - target) * (orig - target)) <= 0)
|
||||
{
|
||||
if (((*pValue - target) * (orig - target)) <= 0) {
|
||||
*pValue = target;
|
||||
return 1;
|
||||
}
|
||||
@@ -177,40 +151,34 @@ s32 func_80077C1C(f32* pValue, f32 target, f32 step)
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 func_80077C6C(f32* pValue, f32 target, f32 incrStep, f32 decrStep)
|
||||
{
|
||||
s32 func_80077C6C(f32* pValue, f32 target, f32 incrStep, f32 decrStep) {
|
||||
f32 step = (target >= *pValue) ? incrStep : decrStep;
|
||||
|
||||
if (step != 0.0f)
|
||||
{
|
||||
if (target < *pValue)
|
||||
if (step != 0.0f) {
|
||||
if (target < *pValue) {
|
||||
step = -step;
|
||||
}
|
||||
|
||||
*pValue += step;
|
||||
|
||||
if (((*pValue - target) * step) >= 0)
|
||||
{
|
||||
if (((*pValue - target) * step) >= 0) {
|
||||
*pValue = target;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (target == *pValue)
|
||||
{
|
||||
} else if (target == *pValue) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x14];
|
||||
/* 0x14 */ s8 unk_14;
|
||||
/* 0x14 */ s8 unk_15;
|
||||
/* 0x14 */ s8 unk_14;
|
||||
/* 0x14 */ s8 unk_15;
|
||||
} struct_80077D10;
|
||||
|
||||
void func_80077D10(f32* arg0, s16* arg1, struct_80077D10* arg2)
|
||||
{
|
||||
void func_80077D10(f32* arg0, s16* arg1, struct_80077D10* arg2) {
|
||||
f32 var1 = arg2->unk_14;
|
||||
f32 var2 = arg2->unk_15;
|
||||
|
||||
@@ -220,60 +188,51 @@ void func_80077D10(f32* arg0, s16* arg1, struct_80077D10* arg2)
|
||||
*arg1 = atan2s(var2, -var1);
|
||||
}
|
||||
|
||||
s16 Math_Rand_S16Offset(s16 base, s16 range)
|
||||
{
|
||||
s16 Math_Rand_S16Offset(s16 base, s16 range) {
|
||||
return (s16)(Math_Rand_ZeroOne() * range) + base;
|
||||
}
|
||||
|
||||
s16 Math_Rand_S16OffsetStride(s16 base, s16 stride, s16 range)
|
||||
{
|
||||
s16 Math_Rand_S16OffsetStride(s16 base, s16 stride, s16 range) {
|
||||
return (s16)(Math_Rand_ZeroOne() * range) * stride + base;
|
||||
}
|
||||
|
||||
void Math_Vec3f_Copy(Vec3f* dest, Vec3f* src)
|
||||
{
|
||||
void Math_Vec3f_Copy(Vec3f* dest, Vec3f* src) {
|
||||
dest->x = src->x;
|
||||
dest->y = src->y;
|
||||
dest->z = src->z;
|
||||
}
|
||||
|
||||
void Math_Vec3s_ToVec3f(Vec3f* dest, Vec3s* src)
|
||||
{
|
||||
void Math_Vec3s_ToVec3f(Vec3f* dest, Vec3s* src) {
|
||||
dest->x = src->x;
|
||||
dest->y = src->y;
|
||||
dest->z = src->z;
|
||||
}
|
||||
|
||||
void Math_Vec3f_Sum(Vec3f* a, Vec3f* b, Vec3f* dest)
|
||||
{
|
||||
void Math_Vec3f_Sum(Vec3f* a, Vec3f* b, Vec3f* dest) {
|
||||
dest->x = a->x + b->x;
|
||||
dest->y = a->y + b->y;
|
||||
dest->z = a->z + b->z;
|
||||
}
|
||||
|
||||
void Math_Vec3f_Diff(Vec3f* a, Vec3f* b, Vec3f* dest)
|
||||
{
|
||||
void Math_Vec3f_Diff(Vec3f* a, Vec3f* b, Vec3f* dest) {
|
||||
dest->x = a->x - b->x;
|
||||
dest->y = a->y - b->y;
|
||||
dest->z = a->z - b->z;
|
||||
}
|
||||
|
||||
void Math_Vec3s_DiffToVec3f(Vec3f* dest, Vec3s* a, Vec3s* b)
|
||||
{
|
||||
void Math_Vec3s_DiffToVec3f(Vec3f* dest, Vec3s* a, Vec3s* b) {
|
||||
dest->x = a->x - b->x;
|
||||
dest->y = a->y - b->y;
|
||||
dest->z = a->z - b->z;
|
||||
}
|
||||
|
||||
void Math_Vec3f_Scale(Vec3f* vec, f32 scaleF)
|
||||
{
|
||||
void Math_Vec3f_Scale(Vec3f* vec, f32 scaleF) {
|
||||
vec->x *= scaleF;
|
||||
vec->y *= scaleF;
|
||||
vec->z *= scaleF;
|
||||
}
|
||||
|
||||
f32 Math_Vec3f_DistXYZ(Vec3f* a, Vec3f* b)
|
||||
{
|
||||
f32 Math_Vec3f_DistXYZ(Vec3f* a, Vec3f* b) {
|
||||
f32 dx = b->x - a->x;
|
||||
f32 dy = b->y - a->y;
|
||||
f32 dz = b->z - a->z;
|
||||
@@ -281,8 +240,7 @@ f32 Math_Vec3f_DistXYZ(Vec3f* a, Vec3f* b)
|
||||
return sqrtf(SQ(dx) + SQ(dy) + SQ(dz));
|
||||
}
|
||||
|
||||
f32 Math_Vec3f_DistXYZAndStoreDiff(Vec3f* a, Vec3f* b, Vec3f* dest)
|
||||
{
|
||||
f32 Math_Vec3f_DistXYZAndStoreDiff(Vec3f* a, Vec3f* b, Vec3f* dest) {
|
||||
dest->x = b->x - a->x;
|
||||
dest->y = b->y - a->y;
|
||||
dest->z = b->z - a->z;
|
||||
@@ -290,29 +248,25 @@ f32 Math_Vec3f_DistXYZAndStoreDiff(Vec3f* a, Vec3f* b, Vec3f* dest)
|
||||
return sqrtf(SQ(dest->x) + SQ(dest->y) + SQ(dest->z));
|
||||
}
|
||||
|
||||
f32 Math_Vec3f_DistXZ(Vec3f* a, Vec3f* b)
|
||||
{
|
||||
f32 Math_Vec3f_DistXZ(Vec3f* a, Vec3f* b) {
|
||||
f32 dx = b->x - a->x;
|
||||
f32 dz = b->z - a->z;
|
||||
|
||||
return sqrtf(SQ(dx) + SQ(dz));
|
||||
}
|
||||
|
||||
f32 Math_Vec3f_DiffY(Vec3f* a, Vec3f* b)
|
||||
{
|
||||
f32 Math_Vec3f_DiffY(Vec3f* a, Vec3f* b) {
|
||||
return b->y - a->y;
|
||||
}
|
||||
|
||||
s16 Math_Vec3f_Yaw(Vec3f* a, Vec3f* b)
|
||||
{
|
||||
s16 Math_Vec3f_Yaw(Vec3f* a, Vec3f* b) {
|
||||
f32 dx = b->x - a->x;
|
||||
f32 dz = b->z - a->z;
|
||||
|
||||
return atan2s(dz, dx);
|
||||
}
|
||||
|
||||
s16 Math_Vec3f_Pitch(Vec3f* a, Vec3f* b)
|
||||
{
|
||||
s16 Math_Vec3f_Pitch(Vec3f* a, Vec3f* b) {
|
||||
return atan2s(Math_Vec3f_DistXZ(a, b), a->y - b->y);
|
||||
}
|
||||
|
||||
@@ -328,69 +282,51 @@ void IChain_Apply_Vec3f(u8* ptr, InitChainEntry* ichain);
|
||||
void IChain_Apply_Vec3fdiv1000(u8* ptr, InitChainEntry* ichain);
|
||||
void IChain_Apply_Vec3s(u8* ptr, InitChainEntry* ichain);
|
||||
|
||||
void (*sInitChainHandlers[])(u8* ptr, InitChainEntry* ichain) =
|
||||
{
|
||||
IChain_Apply_u8,
|
||||
IChain_Apply_s8,
|
||||
IChain_Apply_u16,
|
||||
IChain_Apply_s16,
|
||||
IChain_Apply_u32,
|
||||
IChain_Apply_s32,
|
||||
IChain_Apply_f32,
|
||||
IChain_Apply_f32div1000,
|
||||
IChain_Apply_Vec3f,
|
||||
IChain_Apply_Vec3fdiv1000,
|
||||
IChain_Apply_Vec3s,
|
||||
void (*sInitChainHandlers[])(u8* ptr, InitChainEntry* ichain) = {
|
||||
IChain_Apply_u8, IChain_Apply_s8, IChain_Apply_u16, IChain_Apply_s16,
|
||||
IChain_Apply_u32, IChain_Apply_s32, IChain_Apply_f32, IChain_Apply_f32div1000,
|
||||
IChain_Apply_Vec3f, IChain_Apply_Vec3fdiv1000, IChain_Apply_Vec3s,
|
||||
};
|
||||
|
||||
void Actor_ProcessInitChain(Actor* actor, InitChainEntry* ichain)
|
||||
{
|
||||
do sInitChainHandlers[ichain->type]((u8*)actor, ichain);
|
||||
while ((ichain++)->cont);
|
||||
void Actor_ProcessInitChain(Actor* actor, InitChainEntry* ichain) {
|
||||
do {
|
||||
sInitChainHandlers[ichain->type]((u8*)actor, ichain);
|
||||
} while ((ichain++)->cont);
|
||||
}
|
||||
|
||||
void IChain_Apply_u8(u8* ptr, InitChainEntry* ichain)
|
||||
{
|
||||
void IChain_Apply_u8(u8* ptr, InitChainEntry* ichain) {
|
||||
*(u8*)(ptr + ichain->offset) = ichain->value;
|
||||
}
|
||||
|
||||
void IChain_Apply_s8(u8* ptr, InitChainEntry* ichain)
|
||||
{
|
||||
void IChain_Apply_s8(u8* ptr, InitChainEntry* ichain) {
|
||||
*(s8*)(ptr + ichain->offset) = ichain->value;
|
||||
}
|
||||
|
||||
void IChain_Apply_u16(u8* ptr, InitChainEntry* ichain)
|
||||
{
|
||||
void IChain_Apply_u16(u8* ptr, InitChainEntry* ichain) {
|
||||
*(u16*)(ptr + ichain->offset) = ichain->value;
|
||||
}
|
||||
|
||||
void IChain_Apply_s16(u8* ptr, InitChainEntry* ichain)
|
||||
{
|
||||
void IChain_Apply_s16(u8* ptr, InitChainEntry* ichain) {
|
||||
*(s16*)(ptr + ichain->offset) = ichain->value;
|
||||
}
|
||||
|
||||
void IChain_Apply_u32(u8* ptr, InitChainEntry* ichain)
|
||||
{
|
||||
void IChain_Apply_u32(u8* ptr, InitChainEntry* ichain) {
|
||||
*(u32*)(ptr + ichain->offset) = ichain->value;
|
||||
}
|
||||
|
||||
void IChain_Apply_s32(u8* ptr, InitChainEntry* ichain)
|
||||
{
|
||||
void IChain_Apply_s32(u8* ptr, InitChainEntry* ichain) {
|
||||
*(s32*)(ptr + ichain->offset) = ichain->value;
|
||||
}
|
||||
|
||||
void IChain_Apply_f32(u8* ptr, InitChainEntry* ichain)
|
||||
{
|
||||
void IChain_Apply_f32(u8* ptr, InitChainEntry* ichain) {
|
||||
*(f32*)(ptr + ichain->offset) = ichain->value;
|
||||
}
|
||||
|
||||
void IChain_Apply_f32div1000(u8* ptr, InitChainEntry* ichain)
|
||||
{
|
||||
void IChain_Apply_f32div1000(u8* ptr, InitChainEntry* ichain) {
|
||||
*(f32*)(ptr + ichain->offset) = ichain->value / 1000.0f;
|
||||
}
|
||||
|
||||
void IChain_Apply_Vec3f(u8* ptr, InitChainEntry* ichain)
|
||||
{
|
||||
void IChain_Apply_Vec3f(u8* ptr, InitChainEntry* ichain) {
|
||||
Vec3f* vec;
|
||||
f32 val;
|
||||
|
||||
@@ -402,8 +338,7 @@ void IChain_Apply_Vec3f(u8* ptr, InitChainEntry* ichain)
|
||||
vec->x = val;
|
||||
}
|
||||
|
||||
void IChain_Apply_Vec3fdiv1000(u8* ptr, InitChainEntry* ichain)
|
||||
{
|
||||
void IChain_Apply_Vec3fdiv1000(u8* ptr, InitChainEntry* ichain) {
|
||||
Vec3f* vec;
|
||||
f32 val;
|
||||
|
||||
@@ -416,8 +351,7 @@ void IChain_Apply_Vec3fdiv1000(u8* ptr, InitChainEntry* ichain)
|
||||
vec->x = val;
|
||||
}
|
||||
|
||||
void IChain_Apply_Vec3s(u8* ptr, InitChainEntry* ichain)
|
||||
{
|
||||
void IChain_Apply_Vec3s(u8* ptr, InitChainEntry* ichain) {
|
||||
Vec3s* vec;
|
||||
s16 val;
|
||||
|
||||
@@ -429,40 +363,37 @@ void IChain_Apply_Vec3s(u8* ptr, InitChainEntry* ichain)
|
||||
vec->x = val;
|
||||
}
|
||||
|
||||
f32 Math_SmoothScaleMaxMinF(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 minStep)
|
||||
{
|
||||
f32 Math_SmoothScaleMaxMinF(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 minStep) {
|
||||
f32 var;
|
||||
|
||||
if (*pValue != target)
|
||||
{
|
||||
if (*pValue != target) {
|
||||
var = (target - *pValue) * scale;
|
||||
|
||||
if ((var >= minStep) || (var <= -minStep))
|
||||
{
|
||||
if (var > maxStep)
|
||||
if ((var >= minStep) || (var <= -minStep)) {
|
||||
if (var > maxStep) {
|
||||
var = maxStep;
|
||||
}
|
||||
|
||||
if (var < -maxStep)
|
||||
if (var < -maxStep) {
|
||||
var = -maxStep;
|
||||
}
|
||||
|
||||
*pValue += var;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (var < minStep)
|
||||
{
|
||||
} else {
|
||||
if (var < minStep) {
|
||||
*pValue += minStep;
|
||||
var = minStep;
|
||||
|
||||
if (target < *pValue)
|
||||
if (target < *pValue) {
|
||||
*pValue = target;
|
||||
}
|
||||
}
|
||||
if (var > -minStep)
|
||||
{
|
||||
if (var > -minStep) {
|
||||
*pValue += -minStep;
|
||||
|
||||
if (*pValue < target)
|
||||
if (*pValue < target) {
|
||||
*pValue = target;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -470,128 +401,123 @@ f32 Math_SmoothScaleMaxMinF(f32* pValue, f32 target, f32 scale, f32 maxStep, f32
|
||||
return fabsf(target - *pValue);
|
||||
}
|
||||
|
||||
void Math_SmoothScaleMaxF(f32* pValue, f32 target, f32 scale, f32 maxStep)
|
||||
{
|
||||
void Math_SmoothScaleMaxF(f32* pValue, f32 target, f32 scale, f32 maxStep) {
|
||||
f32 step;
|
||||
|
||||
if (*pValue != target)
|
||||
{
|
||||
if (*pValue != target) {
|
||||
step = (target - *pValue) * scale;
|
||||
|
||||
if (step > maxStep)
|
||||
if (step > maxStep) {
|
||||
step = maxStep;
|
||||
else if (step < -maxStep)
|
||||
} else if (step < -maxStep) {
|
||||
step = -maxStep;
|
||||
}
|
||||
|
||||
*pValue += step;
|
||||
}
|
||||
}
|
||||
|
||||
void Math_SmoothDownscaleMaxF(f32* pValue, f32 scale, f32 maxStep)
|
||||
{
|
||||
void Math_SmoothDownscaleMaxF(f32* pValue, f32 scale, f32 maxStep) {
|
||||
f32 step;
|
||||
|
||||
step = *pValue * scale;
|
||||
|
||||
if (step > maxStep)
|
||||
if (step > maxStep) {
|
||||
step = maxStep;
|
||||
else if (step < -maxStep)
|
||||
} else if (step < -maxStep) {
|
||||
step = -maxStep;
|
||||
}
|
||||
|
||||
*pValue -= step;
|
||||
}
|
||||
|
||||
f32 func_800784D8(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 minStep)
|
||||
{
|
||||
f32 func_800784D8(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 minStep) {
|
||||
f32 step;
|
||||
f32 baseStep;
|
||||
|
||||
step = 0.0f;
|
||||
baseStep = target - *pValue;
|
||||
|
||||
if (*pValue != target)
|
||||
{
|
||||
if (baseStep > 180.0f)
|
||||
if (*pValue != target) {
|
||||
if (baseStep > 180.0f) {
|
||||
baseStep = -(360.0f - baseStep);
|
||||
else if (baseStep < -180.0f)
|
||||
} else if (baseStep < -180.0f) {
|
||||
baseStep = 360.0f + baseStep;
|
||||
}
|
||||
|
||||
step = baseStep * scale;
|
||||
|
||||
if ((step >= minStep) || (step <= -minStep))
|
||||
{
|
||||
if (step > maxStep)
|
||||
if ((step >= minStep) || (step <= -minStep)) {
|
||||
if (step > maxStep) {
|
||||
step = maxStep;
|
||||
}
|
||||
|
||||
if (step < -maxStep)
|
||||
if (step < -maxStep) {
|
||||
step = -maxStep;
|
||||
}
|
||||
|
||||
*pValue += step;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (step < minStep)
|
||||
{
|
||||
} else {
|
||||
if (step < minStep) {
|
||||
step = minStep;
|
||||
*pValue += step;
|
||||
if (*pValue > target)
|
||||
if (*pValue > target) {
|
||||
*pValue = target;
|
||||
}
|
||||
}
|
||||
if (step > -minStep)
|
||||
{
|
||||
if (step > -minStep) {
|
||||
step = -minStep;
|
||||
*pValue += step;
|
||||
if (*pValue < target)
|
||||
if (*pValue < target) {
|
||||
*pValue = target;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (*pValue >= 360.0f)
|
||||
if (*pValue >= 360.0f) {
|
||||
*pValue -= 360.0f;
|
||||
}
|
||||
|
||||
if (*pValue < 0.0f)
|
||||
if (*pValue < 0.0f) {
|
||||
*pValue += 360.0f;
|
||||
}
|
||||
|
||||
return step;
|
||||
}
|
||||
|
||||
s16 Math_SmoothScaleMaxMinS(s16* pValue, s16 target, s16 invScale, s16 maxStep, s16 minStep)
|
||||
{
|
||||
s16 Math_SmoothScaleMaxMinS(s16* pValue, s16 target, s16 invScale, s16 maxStep, s16 minStep) {
|
||||
s16 step = 0;
|
||||
s16 diff = (target - *pValue);
|
||||
|
||||
s32 baseStep = diff / invScale;
|
||||
|
||||
if (*pValue != target)
|
||||
{
|
||||
if (*pValue != target) {
|
||||
step = baseStep;
|
||||
|
||||
if ((step > minStep) || (step < -minStep))
|
||||
{
|
||||
if (step > maxStep)
|
||||
if ((step > minStep) || (step < -minStep)) {
|
||||
if (step > maxStep) {
|
||||
step = maxStep;
|
||||
}
|
||||
|
||||
if (step < -maxStep)
|
||||
if (step < -maxStep) {
|
||||
step = -maxStep;
|
||||
}
|
||||
|
||||
*pValue += step;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (diff >= 0)
|
||||
{
|
||||
} else {
|
||||
if (diff >= 0) {
|
||||
*pValue += minStep;
|
||||
|
||||
if ((s16)(target - *pValue) <= 0)
|
||||
if ((s16)(target - *pValue) <= 0) {
|
||||
*pValue = target;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
} else {
|
||||
*pValue -= minStep;
|
||||
|
||||
if ((s16)(target - *pValue) >= 0)
|
||||
if ((s16)(target - *pValue) >= 0) {
|
||||
*pValue = target;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -599,39 +525,35 @@ s16 Math_SmoothScaleMaxMinS(s16* pValue, s16 target, s16 invScale, s16 maxStep,
|
||||
return diff;
|
||||
}
|
||||
|
||||
void Math_SmoothScaleMaxS(s16* pValue, s16 target, s16 invScale, s16 maxStep)
|
||||
{
|
||||
void Math_SmoothScaleMaxS(s16* pValue, s16 target, s16 invScale, s16 maxStep) {
|
||||
s16 step = target - *pValue;
|
||||
|
||||
step /= invScale;
|
||||
|
||||
if (step > maxStep)
|
||||
if (step > maxStep) {
|
||||
*pValue += maxStep;
|
||||
else if (step < -maxStep)
|
||||
} else if (step < -maxStep) {
|
||||
*pValue -= maxStep;
|
||||
else
|
||||
} else {
|
||||
*pValue += step;
|
||||
}
|
||||
}
|
||||
|
||||
void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src)
|
||||
{
|
||||
void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src) {
|
||||
dst->r = src->r;
|
||||
dst->g = src->g;
|
||||
dst->b = src->b;
|
||||
dst->a = src->a;
|
||||
}
|
||||
|
||||
void func_80078884(u16 sfxId)
|
||||
{
|
||||
void func_80078884(u16 sfxId) {
|
||||
Audio_PlaySoundGeneral(sfxId, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
}
|
||||
|
||||
void func_800788CC(u16 sfxId)
|
||||
{
|
||||
void func_800788CC(u16 sfxId) {
|
||||
Audio_PlaySoundGeneral(sfxId, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
}
|
||||
|
||||
void func_80078914(Vec3f* arg0, u16 sfxId)
|
||||
{
|
||||
void func_80078914(Vec3f* arg0, u16 sfxId) {
|
||||
Audio_PlaySoundGeneral(sfxId, arg0, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
}
|
||||
|
||||
+107
-199
@@ -17,8 +17,7 @@ s16 D_8015FDC8[3];
|
||||
s16 D_8015FDD0[6];
|
||||
s16 D_8015FDE0[6];
|
||||
|
||||
void Health_InitData(GlobalContext* globalCtx)
|
||||
{
|
||||
void Health_InitData(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
|
||||
interfaceCtx->unk_228 = 0x140;
|
||||
@@ -50,28 +49,22 @@ void Health_InitData(GlobalContext* globalCtx)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// this function still needs some work
|
||||
void Health_UpdateData(GlobalContext* globalCtx)
|
||||
{
|
||||
void Health_UpdateData(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
f32 temp_f0 = interfaceCtx->unk_1FE * 0.1f;
|
||||
s16 temp1, temp2, temp3;
|
||||
|
||||
if (0) ;
|
||||
if (0) {}
|
||||
|
||||
if (interfaceCtx->unk_200 != 0)
|
||||
{
|
||||
if (interfaceCtx->unk_200 != 0) {
|
||||
interfaceCtx->unk_1FE--;
|
||||
if (interfaceCtx->unk_1FE <= 0)
|
||||
{
|
||||
if (interfaceCtx->unk_1FE <= 0) {
|
||||
interfaceCtx->unk_1FE = 0;
|
||||
interfaceCtx->unk_200 = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
interfaceCtx->unk_1FE++;
|
||||
if (interfaceCtx->unk_1FE >= 10)
|
||||
{
|
||||
if (interfaceCtx->unk_1FE >= 10) {
|
||||
interfaceCtx->unk_1FE = 10;
|
||||
interfaceCtx->unk_200 = 1;
|
||||
}
|
||||
@@ -153,21 +146,18 @@ void Health_UpdateData(GlobalContext* globalCtx)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lifemeter/Health_UpdateData.s")
|
||||
#endif
|
||||
|
||||
s32 func_80078E18(GlobalContext* globalCtx)
|
||||
{
|
||||
s32 func_80078E18(GlobalContext* globalCtx) {
|
||||
gSaveContext.health = globalCtx->interfaceCtx.unk_226;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_80078E34(GlobalContext* globalCtx)
|
||||
{
|
||||
s32 func_80078E34(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
|
||||
interfaceCtx->unk_228 = 0x140;
|
||||
interfaceCtx->unk_226 += 0x10;
|
||||
|
||||
if (interfaceCtx->unk_226 >= gSaveContext.health)
|
||||
{
|
||||
if (interfaceCtx->unk_226 >= gSaveContext.health) {
|
||||
interfaceCtx->unk_226 = gSaveContext.health;
|
||||
return 1;
|
||||
}
|
||||
@@ -175,21 +165,16 @@ s32 func_80078E34(GlobalContext* globalCtx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 func_80078E84(GlobalContext* globalCtx)
|
||||
{
|
||||
s32 func_80078E84(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
|
||||
if (interfaceCtx->unk_228 != 0)
|
||||
{
|
||||
if (interfaceCtx->unk_228 != 0) {
|
||||
interfaceCtx->unk_228--;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
interfaceCtx->unk_228 = 0x140;
|
||||
interfaceCtx->unk_226 -= 0x10;
|
||||
|
||||
if (interfaceCtx->unk_226 <= 0)
|
||||
{
|
||||
if (interfaceCtx->unk_226 <= 0) {
|
||||
interfaceCtx->unk_226 = 0;
|
||||
globalCtx->unk_11D58(globalCtx, -(gSaveContext.health + 1));
|
||||
return 1;
|
||||
@@ -199,8 +184,7 @@ s32 func_80078E84(GlobalContext* globalCtx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Interface_DrawHealth(GlobalContext* globalCtx)
|
||||
{
|
||||
void Interface_DrawHealth(GlobalContext* globalCtx) {
|
||||
s32 pad[5];
|
||||
u8* heartBgImg;
|
||||
u32 curColorSet;
|
||||
@@ -226,184 +210,127 @@ void Interface_DrawHealth(GlobalContext* globalCtx)
|
||||
|
||||
func_800C6AC4(gfxArr, gfxCtx, "../z_lifemeter.c", 353);
|
||||
|
||||
if (!(gSaveContext.health % 0x10))
|
||||
if (!(gSaveContext.health % 0x10)) {
|
||||
fullHeartCount--;
|
||||
}
|
||||
|
||||
curColorSet = -1;
|
||||
offsetY = 0.0f;
|
||||
offsetX = 0.0f;
|
||||
|
||||
for (i = 0; i < totalHeartCount; i++)
|
||||
{
|
||||
if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne))
|
||||
{
|
||||
if (i < fullHeartCount)
|
||||
{
|
||||
if (curColorSet != 0)
|
||||
{
|
||||
for (i = 0; i < totalHeartCount; i++) {
|
||||
if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) {
|
||||
if (i < fullHeartCount) {
|
||||
if (curColorSet != 0) {
|
||||
curColorSet = 0;
|
||||
gDPPipeSync(gfxCtx->overlay.p++);
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
|
||||
interfaceCtx->unk_20E[0], interfaceCtx->unk_20E[2],
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, interfaceCtx->unk_20E[0], interfaceCtx->unk_20E[2],
|
||||
interfaceCtx->unk_20E[4], interfaceCtx->healthAlpha);
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++,
|
||||
interfaceCtx->unk_21A[0], interfaceCtx->unk_21A[2],
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++, interfaceCtx->unk_21A[0], interfaceCtx->unk_21A[2],
|
||||
interfaceCtx->unk_21A[4], 0xFF);
|
||||
}
|
||||
}
|
||||
else if (i == fullHeartCount)
|
||||
{
|
||||
if (curColorSet != 1)
|
||||
{
|
||||
} else if (i == fullHeartCount) {
|
||||
if (curColorSet != 1) {
|
||||
curColorSet = 1;
|
||||
gDPPipeSync(gfxCtx->overlay.p++);
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
|
||||
interfaceCtx->unk_202[0], interfaceCtx->unk_202[1],
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, interfaceCtx->unk_202[0], interfaceCtx->unk_202[1],
|
||||
interfaceCtx->unk_202[2], interfaceCtx->healthAlpha);
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++,
|
||||
interfaceCtx->unk_208[0], interfaceCtx->unk_208[1],
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++, interfaceCtx->unk_208[0], interfaceCtx->unk_208[1],
|
||||
interfaceCtx->unk_208[2], 0xFF);
|
||||
}
|
||||
}
|
||||
else if (i > fullHeartCount)
|
||||
{
|
||||
if (curColorSet != 2)
|
||||
{
|
||||
} else if (i > fullHeartCount) {
|
||||
if (curColorSet != 2) {
|
||||
curColorSet = 2;
|
||||
gDPPipeSync(gfxCtx->overlay.p++);
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
|
||||
interfaceCtx->unk_20E[0], interfaceCtx->unk_20E[2],
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, interfaceCtx->unk_20E[0], interfaceCtx->unk_20E[2],
|
||||
interfaceCtx->unk_20E[4], interfaceCtx->healthAlpha);
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++,
|
||||
interfaceCtx->unk_21A[0], interfaceCtx->unk_21A[2],
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++, interfaceCtx->unk_21A[0], interfaceCtx->unk_21A[2],
|
||||
interfaceCtx->unk_21A[4], 0xFF);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (curColorSet != 3)
|
||||
{
|
||||
} else {
|
||||
if (curColorSet != 3) {
|
||||
curColorSet = 3;
|
||||
gDPPipeSync(gfxCtx->overlay.p++);
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
|
||||
interfaceCtx->unk_20E[1], interfaceCtx->unk_20E[3],
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, interfaceCtx->unk_20E[1], interfaceCtx->unk_20E[3],
|
||||
interfaceCtx->unk_20E[5], interfaceCtx->healthAlpha);
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++,
|
||||
interfaceCtx->unk_21A[1], interfaceCtx->unk_21A[3],
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++, interfaceCtx->unk_21A[1], interfaceCtx->unk_21A[3],
|
||||
interfaceCtx->unk_21A[5], 0xFF);
|
||||
}
|
||||
}
|
||||
|
||||
if (i < fullHeartCount)
|
||||
if (i < fullHeartCount) {
|
||||
heartBgImg = D_02000400;
|
||||
else if (i == fullHeartCount)
|
||||
} else if (i == fullHeartCount) {
|
||||
heartBgImg = D_8011FFB0[curHeartFraction];
|
||||
else
|
||||
} else {
|
||||
heartBgImg = D_02000000;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i < fullHeartCount)
|
||||
{
|
||||
if (curColorSet != 4)
|
||||
{
|
||||
}
|
||||
} else {
|
||||
if (i < fullHeartCount) {
|
||||
if (curColorSet != 4) {
|
||||
curColorSet = 4;
|
||||
gDPPipeSync(gfxCtx->overlay.p++);
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
|
||||
D_8015FDD0[0], D_8015FDD0[1],
|
||||
D_8015FDD0[2], interfaceCtx->healthAlpha);
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++,
|
||||
D_8015FDE0[0], D_8015FDE0[1],
|
||||
D_8015FDE0[2], 0xFF);
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, D_8015FDD0[0], D_8015FDD0[1], D_8015FDD0[2],
|
||||
interfaceCtx->healthAlpha);
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++, D_8015FDE0[0], D_8015FDE0[1], D_8015FDE0[2], 0xFF);
|
||||
}
|
||||
}
|
||||
else if (i == fullHeartCount)
|
||||
{
|
||||
if (curColorSet != 5)
|
||||
{
|
||||
} else if (i == fullHeartCount) {
|
||||
if (curColorSet != 5) {
|
||||
curColorSet = 5;
|
||||
gDPPipeSync(gfxCtx->overlay.p++);
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
|
||||
D_8015FDC0[0], D_8015FDC0[1],
|
||||
D_8015FDC0[2], interfaceCtx->healthAlpha);
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++,
|
||||
D_8015FDC8[0], D_8015FDC8[1],
|
||||
D_8015FDC8[2], 0xFF);
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, D_8015FDC0[0], D_8015FDC0[1], D_8015FDC0[2],
|
||||
interfaceCtx->healthAlpha);
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++, D_8015FDC8[0], D_8015FDC8[1], D_8015FDC8[2], 0xFF);
|
||||
}
|
||||
}
|
||||
else if (i > fullHeartCount)
|
||||
{
|
||||
if (curColorSet != 6)
|
||||
{
|
||||
} else if (i > fullHeartCount) {
|
||||
if (curColorSet != 6) {
|
||||
curColorSet = 6;
|
||||
gDPPipeSync(gfxCtx->overlay.p++);
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
|
||||
D_8015FDD0[0], D_8015FDD0[1],
|
||||
D_8015FDD0[2], interfaceCtx->healthAlpha);
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++,
|
||||
D_8015FDE0[0], D_8015FDE0[1],
|
||||
D_8015FDE0[2], 0xFF);
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, D_8015FDD0[0], D_8015FDD0[1], D_8015FDD0[2],
|
||||
interfaceCtx->healthAlpha);
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++, D_8015FDE0[0], D_8015FDE0[1], D_8015FDE0[2], 0xFF);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (curColorSet != 7)
|
||||
{
|
||||
} else {
|
||||
if (curColorSet != 7) {
|
||||
curColorSet = 7;
|
||||
gDPPipeSync(gfxCtx->overlay.p++);
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
|
||||
D_8015FDD0[3], D_8015FDD0[4],
|
||||
D_8015FDD0[5], interfaceCtx->healthAlpha);
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++,
|
||||
D_8015FDE0[3], D_8015FDE0[4],
|
||||
D_8015FDE0[5], 0xFF);
|
||||
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, D_8015FDD0[3], D_8015FDD0[4], D_8015FDD0[5],
|
||||
interfaceCtx->healthAlpha);
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++, D_8015FDE0[3], D_8015FDE0[4], D_8015FDE0[5], 0xFF);
|
||||
}
|
||||
}
|
||||
|
||||
if (i < fullHeartCount)
|
||||
if (i < fullHeartCount) {
|
||||
heartBgImg = D_02000900;
|
||||
else if (i == fullHeartCount)
|
||||
} else if (i == fullHeartCount) {
|
||||
heartBgImg = D_8011FFF0[curHeartFraction];
|
||||
else
|
||||
} else {
|
||||
heartBgImg = D_02000500;
|
||||
}
|
||||
}
|
||||
|
||||
if (curBgImgLoaded != heartBgImg)
|
||||
{
|
||||
if (curBgImgLoaded != heartBgImg) {
|
||||
curBgImgLoaded = heartBgImg;
|
||||
gDPLoadTextureBlock(gfxCtx->overlay.p++,
|
||||
heartBgImg,
|
||||
G_IM_FMT_IA,
|
||||
G_IM_SIZ_8b,
|
||||
16, 16,
|
||||
0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOMASK,
|
||||
gDPLoadTextureBlock(gfxCtx->overlay.p++, heartBgImg, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 16, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOLOD);
|
||||
}
|
||||
|
||||
if (i != fullHeartCount)
|
||||
{
|
||||
if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne))
|
||||
{
|
||||
if (curCombineModeSet != 1)
|
||||
{
|
||||
if (i != fullHeartCount) {
|
||||
if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) {
|
||||
if (curCombineModeSet != 1) {
|
||||
curCombineModeSet = 1;
|
||||
func_80094520(gfxCtx);
|
||||
gDPSetCombineLERP(gfxCtx->overlay.p++,
|
||||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||
gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0,
|
||||
PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE,
|
||||
0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (curCombineModeSet != 3)
|
||||
{
|
||||
} else {
|
||||
if (curCombineModeSet != 3) {
|
||||
curCombineModeSet = 3;
|
||||
func_80094520(gfxCtx);
|
||||
gDPSetCombineLERP(gfxCtx->overlay.p++,
|
||||
ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0,
|
||||
ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
|
||||
gDPSetCombineLERP(gfxCtx->overlay.p++, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0,
|
||||
PRIMITIVE, 0, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -414,40 +341,28 @@ void Interface_DrawHealth(GlobalContext* globalCtx)
|
||||
temp4 *= 1024.0f;
|
||||
temp1 = 8.0f;
|
||||
temp1 *= 0.68f;
|
||||
gSPTextureRectangle(gfxCtx->overlay.p++,
|
||||
(s32)((temp2 - temp1) * 4), (s32)((temp3 - temp1) * 4),
|
||||
(s32)((temp2 + temp1) * 4), (s32)((temp3 + temp1) * 4),
|
||||
G_TX_RENDERTILE,
|
||||
0, 0,
|
||||
gSPTextureRectangle(gfxCtx->overlay.p++, (s32)((temp2 - temp1) * 4), (s32)((temp3 - temp1) * 4),
|
||||
(s32)((temp2 + temp1) * 4), (s32)((temp3 + temp1) * 4), G_TX_RENDERTILE, 0, 0,
|
||||
(s32)temp4, (s32)temp4);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne))
|
||||
{
|
||||
if (curCombineModeSet != 2)
|
||||
{
|
||||
} else {
|
||||
if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) {
|
||||
if (curCombineModeSet != 2) {
|
||||
curCombineModeSet = 2;
|
||||
func_80094A14(gfxCtx);
|
||||
gDPSetCombineLERP(gfxCtx->overlay.p++,
|
||||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||
gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0,
|
||||
PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE,
|
||||
0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (curCombineModeSet != 4)
|
||||
{
|
||||
} else {
|
||||
if (curCombineModeSet != 4) {
|
||||
curCombineModeSet = 4;
|
||||
func_80094A14(gfxCtx);
|
||||
gDPSetCombineLERP(gfxCtx->overlay.p++,
|
||||
ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0,
|
||||
ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
|
||||
gDPSetCombineLERP(gfxCtx->overlay.p++, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0,
|
||||
PRIMITIVE, 0, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (1)
|
||||
{
|
||||
if (1) {
|
||||
Mtx* matrix = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
func_800D2CEC(matrix, 1.0f - (0.32f * sp144), 1.0f - (0.32f * sp144), 1.0f - (0.32f * sp144),
|
||||
-130.0f + offsetX, 94.5f - offsetY, 0.0f);
|
||||
@@ -458,8 +373,7 @@ void Interface_DrawHealth(GlobalContext* globalCtx)
|
||||
}
|
||||
|
||||
offsetX += 10.0f;
|
||||
if (i == 9)
|
||||
{
|
||||
if (i == 9) {
|
||||
offsetY += 10.0f;
|
||||
offsetX = 0.0f;
|
||||
}
|
||||
@@ -470,50 +384,44 @@ void Interface_DrawHealth(GlobalContext* globalCtx)
|
||||
|
||||
u32 Health_IsCritical(void);
|
||||
|
||||
void Health_HandleCriticalAlarm(GlobalContext* globalCtx)
|
||||
{
|
||||
void Health_HandleCriticalAlarm(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
|
||||
if (interfaceCtx->unk_22C != 0)
|
||||
{
|
||||
if (interfaceCtx->unk_22C != 0) {
|
||||
interfaceCtx->unk_22A--;
|
||||
if (interfaceCtx->unk_22A <= 0)
|
||||
{
|
||||
if (interfaceCtx->unk_22A <= 0) {
|
||||
interfaceCtx->unk_22A = 0;
|
||||
interfaceCtx->unk_22C = 0;
|
||||
if (!func_8008E988(globalCtx) && (globalCtx->pauseCtx.state == 0) &&
|
||||
(globalCtx->pauseCtx.flag == 0) && Health_IsCritical() && !func_800BFC84(globalCtx))
|
||||
{
|
||||
if (!func_8008E988(globalCtx) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) &&
|
||||
Health_IsCritical() && !func_800BFC84(globalCtx)) {
|
||||
func_80078884(NA_SE_SY_HITPOINT_ALARM);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
interfaceCtx->unk_22A++;
|
||||
if (interfaceCtx->unk_22A >= 10)
|
||||
{
|
||||
if (interfaceCtx->unk_22A >= 10) {
|
||||
interfaceCtx->unk_22A = 10;
|
||||
interfaceCtx->unk_22C = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u32 Health_IsCritical(void)
|
||||
{
|
||||
u32 Health_IsCritical(void) {
|
||||
s32 var;
|
||||
|
||||
if (gSaveContext.health_capacity <= 0x50)
|
||||
if (gSaveContext.health_capacity <= 0x50) {
|
||||
var = 0x10;
|
||||
else if (gSaveContext.health_capacity <= 0xA0)
|
||||
} else if (gSaveContext.health_capacity <= 0xA0) {
|
||||
var = 0x18;
|
||||
else if (gSaveContext.health_capacity <= 0xF0)
|
||||
} else if (gSaveContext.health_capacity <= 0xF0) {
|
||||
var = 0x20;
|
||||
else
|
||||
} else {
|
||||
var = 0x2C;
|
||||
}
|
||||
|
||||
if ((var >= gSaveContext.health) && (gSaveContext.health > 0))
|
||||
if ((var >= gSaveContext.health) && (gSaveContext.health > 0)) {
|
||||
return 1;
|
||||
else
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
+42
-61
@@ -3,8 +3,8 @@
|
||||
|
||||
extern LightsList sLightsList;
|
||||
|
||||
void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius, u32 type)
|
||||
{
|
||||
void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue,
|
||||
s16 radius, u32 type) {
|
||||
info->type = type;
|
||||
info->params.posX = posX;
|
||||
info->params.posY = posY;
|
||||
@@ -12,26 +12,24 @@ void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s
|
||||
Lights_SetPositionalLightColorAndRadius(info, red, green, blue, radius);
|
||||
}
|
||||
|
||||
void Lights_InitType0PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius)
|
||||
{
|
||||
void Lights_InitType0PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue,
|
||||
s16 radius) {
|
||||
Lights_InitPositionalLight(info, posX, posY, posZ, red, green, blue, radius, 0);
|
||||
}
|
||||
|
||||
void Lights_InitType2PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius)
|
||||
{
|
||||
void Lights_InitType2PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue,
|
||||
s16 radius) {
|
||||
Lights_InitPositionalLight(info, posX, posY, posZ, red, green, blue, radius, 2);
|
||||
}
|
||||
|
||||
void Lights_SetPositionalLightColorAndRadius(LightInfoPositional* info, u8 red, u8 green, u8 blue, s16 radius)
|
||||
{
|
||||
void Lights_SetPositionalLightColorAndRadius(LightInfoPositional* info, u8 red, u8 green, u8 blue, s16 radius) {
|
||||
info->params.red = red;
|
||||
info->params.green = green;
|
||||
info->params.blue = blue;
|
||||
info->params.radius = radius;
|
||||
}
|
||||
|
||||
void Lights_InitDirectional(LightInfoDirectional* info, s8 dirX, s8 dirY, s8 dirZ, u8 red, u8 green, u8 blue)
|
||||
{
|
||||
void Lights_InitDirectional(LightInfoDirectional* info, s8 dirX, s8 dirY, s8 dirZ, u8 red, u8 green, u8 blue) {
|
||||
info->type = 1;
|
||||
info->params.dirX = dirX;
|
||||
info->params.dirY = dirY;
|
||||
@@ -41,8 +39,7 @@ void Lights_InitDirectional(LightInfoDirectional* info, s8 dirX, s8 dirY, s8 dir
|
||||
info->params.blue = blue;
|
||||
}
|
||||
|
||||
void Lights_MapperInit(LightMapper* mapper, u8 red, u8 green, u8 blue)
|
||||
{
|
||||
void Lights_MapperInit(LightMapper* mapper, u8 red, u8 green, u8 blue) {
|
||||
mapper->ambient.l.col[0] = red;
|
||||
mapper->ambient.l.colc[0] = red;
|
||||
mapper->ambient.l.col[1] = green;
|
||||
@@ -54,22 +51,20 @@ void Lights_MapperInit(LightMapper* mapper, u8 red, u8 green, u8 blue)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_80079EFC.s")
|
||||
|
||||
Light* Lights_MapperGetNextFreeSlot(LightMapper* mapper)
|
||||
{
|
||||
if (6 < mapper->numLights)
|
||||
Light* Lights_MapperGetNextFreeSlot(LightMapper* mapper) {
|
||||
if (6 < mapper->numLights) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &mapper->lights[mapper->numLights++];
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_8007A084.s")
|
||||
|
||||
void func_8007A40C(LightMapper* mapper, LightInfoDirectionalParams* params, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8007A40C(LightMapper* mapper, LightInfoDirectionalParams* params, GlobalContext* globalCtx) {
|
||||
Light* light = Lights_MapperGetNextFreeSlot(mapper);
|
||||
|
||||
if (light != NULL)
|
||||
{
|
||||
if (light != NULL) {
|
||||
light->l.col[0] = light->l.colc[0] = params->red;
|
||||
light->l.col[1] = light->l.colc[1] = params->green;
|
||||
light->l.col[2] = light->l.colc[2] = params->blue;
|
||||
@@ -81,25 +76,21 @@ void func_8007A40C(LightMapper* mapper, LightInfoDirectionalParams* params, Glob
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_8007A474.s")
|
||||
|
||||
z_Light* Lights_FindFreeSlot()
|
||||
{
|
||||
z_Light* Lights_FindFreeSlot() {
|
||||
z_Light* ret;
|
||||
|
||||
if (0x1F < sLightsList.numOccupied)
|
||||
if (0x1F < sLightsList.numOccupied) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = &sLightsList.lights[sLightsList.nextFree];
|
||||
|
||||
while (ret->info != NULL)
|
||||
{
|
||||
while (ret->info != NULL) {
|
||||
sLightsList.nextFree++;
|
||||
|
||||
if (sLightsList.nextFree < 0x20)
|
||||
{
|
||||
if (sLightsList.nextFree < 0x20) {
|
||||
ret++;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sLightsList.nextFree = 0;
|
||||
ret = &sLightsList.lights[0];
|
||||
}
|
||||
@@ -112,36 +103,32 @@ z_Light* Lights_FindFreeSlot()
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// single ordering difference
|
||||
void Lights_Free(z_Light* light)
|
||||
{
|
||||
if (light != NULL)
|
||||
{
|
||||
void Lights_Free(z_Light* light) {
|
||||
if (light != NULL) {
|
||||
sLightsList.numOccupied--;
|
||||
light->info = NULL;
|
||||
sLightsList.nextFree = (light - sLightsList.lights) / sizeof(z_Light); //! @bug Due to pointer arithmetic, the division is unnecessary
|
||||
sLightsList.nextFree = (light - sLightsList.lights) /
|
||||
sizeof(z_Light); //! @bug Due to pointer arithmetic, the division is unnecessary
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/Lights_Free.s")
|
||||
#endif
|
||||
|
||||
void func_8007A614(GlobalContext* globalCtx, LightingContext* lightCtx)
|
||||
{
|
||||
void func_8007A614(GlobalContext* globalCtx, LightingContext* lightCtx) {
|
||||
Lights_ClearHead(globalCtx, lightCtx);
|
||||
Lights_SetAmbientColor(lightCtx, 0x50, 0x50, 0x50);
|
||||
func_8007A698(lightCtx, 0, 0, 0, 0x3e4, 0x3200);
|
||||
bzero(&sLightsList, sizeof(sLightsList));
|
||||
}
|
||||
|
||||
void Lights_SetAmbientColor(LightingContext* lightCtx, u8 red, u8 green, u8 blue)
|
||||
{
|
||||
void Lights_SetAmbientColor(LightingContext* lightCtx, u8 red, u8 green, u8 blue) {
|
||||
lightCtx->ambientRed = red;
|
||||
lightCtx->ambientGreen = green;
|
||||
lightCtx->ambientBlue = blue;
|
||||
}
|
||||
|
||||
void func_8007A698(LightingContext* lightCtx, u8 arg1, u8 arg2, u8 arg3, s16 arg4, s16 arg5)
|
||||
{
|
||||
void func_8007A698(LightingContext* lightCtx, u8 arg1, u8 arg2, u8 arg3, s16 arg4, s16 arg5) {
|
||||
lightCtx->unk_07 = arg1;
|
||||
lightCtx->unk_08 = arg2;
|
||||
lightCtx->unk_09 = arg3;
|
||||
@@ -149,38 +136,33 @@ void func_8007A698(LightingContext* lightCtx, u8 arg1, u8 arg2, u8 arg3, s16 arg
|
||||
lightCtx->unk_0C = arg5;
|
||||
}
|
||||
|
||||
LightMapper* Lights_CreateMapper(LightingContext* lightCtx, GraphicsContext* gfxCtx)
|
||||
{
|
||||
LightMapper* Lights_CreateMapper(LightingContext* lightCtx, GraphicsContext* gfxCtx) {
|
||||
return func_8007A960(gfxCtx, lightCtx->ambientRed, lightCtx->ambientGreen, lightCtx->ambientBlue);
|
||||
}
|
||||
|
||||
void Lights_ClearHead(GlobalContext* globalCtx, LightingContext* lightCtx)
|
||||
{
|
||||
void Lights_ClearHead(GlobalContext* globalCtx, LightingContext* lightCtx) {
|
||||
lightCtx->lightsHead = NULL;
|
||||
}
|
||||
|
||||
void Lights_RemoveAll(GlobalContext* globalCtx, LightingContext* lightCtx)
|
||||
{
|
||||
while (lightCtx->lightsHead != NULL)
|
||||
{
|
||||
void Lights_RemoveAll(GlobalContext* globalCtx, LightingContext* lightCtx) {
|
||||
while (lightCtx->lightsHead != NULL) {
|
||||
Lights_Remove(globalCtx, lightCtx, lightCtx->lightsHead);
|
||||
lightCtx->lightsHead = lightCtx->lightsHead->next;
|
||||
}
|
||||
}
|
||||
|
||||
z_Light* Lights_Insert(GlobalContext* globalCtx, LightingContext* lightCtx, LightInfo* info)
|
||||
{
|
||||
z_Light* Lights_Insert(GlobalContext* globalCtx, LightingContext* lightCtx, LightInfo* info) {
|
||||
z_Light* light;
|
||||
|
||||
light = Lights_FindFreeSlot();
|
||||
if (light != NULL)
|
||||
{
|
||||
if (light != NULL) {
|
||||
light->info = info;
|
||||
light->prev = NULL;
|
||||
light->next = lightCtx->lightsHead;
|
||||
|
||||
if (lightCtx->lightsHead != NULL)
|
||||
if (lightCtx->lightsHead != NULL) {
|
||||
lightCtx->lightsHead->prev = light;
|
||||
}
|
||||
|
||||
lightCtx->lightsHead = light;
|
||||
}
|
||||
@@ -188,17 +170,17 @@ z_Light* Lights_Insert(GlobalContext* globalCtx, LightingContext* lightCtx, Ligh
|
||||
return light;
|
||||
}
|
||||
|
||||
void Lights_Remove(GlobalContext* globalCtx, LightingContext* lightCtx, z_Light* light)
|
||||
{
|
||||
if (light != NULL)
|
||||
{
|
||||
if (light->prev != NULL)
|
||||
void Lights_Remove(GlobalContext* globalCtx, LightingContext* lightCtx, z_Light* light) {
|
||||
if (light != NULL) {
|
||||
if (light->prev != NULL) {
|
||||
light->prev->next = light->next;
|
||||
else
|
||||
} else {
|
||||
lightCtx->lightsHead = light->next;
|
||||
}
|
||||
|
||||
if (light->next != NULL)
|
||||
if (light->next != NULL) {
|
||||
light->next->prev = light->prev;
|
||||
}
|
||||
|
||||
Lights_Free(light);
|
||||
}
|
||||
@@ -211,4 +193,3 @@ void Lights_Remove(GlobalContext* globalCtx, LightingContext* lightCtx, z_Light*
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_8007A9B4.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_8007ABBC.s")
|
||||
|
||||
|
||||
+32
-51
@@ -1,131 +1,112 @@
|
||||
#include <global.h>
|
||||
|
||||
#define LOG_SEVERITY_NOLOG 0
|
||||
#define LOG_SEVERITY_ERROR 2
|
||||
#define LOG_SEVERITY_VERBOSE 3
|
||||
#define LOG_SEVERITY_NOLOG 0
|
||||
#define LOG_SEVERITY_ERROR 2
|
||||
#define LOG_SEVERITY_VERBOSE 3
|
||||
|
||||
s32 gZeldaArenaLogSeverity = LOG_SEVERITY_ERROR;
|
||||
Arena sZeldaArena;
|
||||
|
||||
void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action)
|
||||
{
|
||||
if (!ptr)
|
||||
{
|
||||
if (gZeldaArenaLogSeverity >= LOG_SEVERITY_ERROR)
|
||||
{
|
||||
void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
|
||||
if (!ptr) {
|
||||
if (gZeldaArenaLogSeverity >= LOG_SEVERITY_ERROR) {
|
||||
//"%s: %u bytes %s failed\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action);
|
||||
__osDisplayArena(&sZeldaArena);
|
||||
__osDisplayArena(&sZeldaArena);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (gZeldaArenaLogSeverity >= LOG_SEVERITY_VERBOSE)
|
||||
{
|
||||
} else if (gZeldaArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
|
||||
//"%s: %u bytes %s succeeded\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action);
|
||||
}
|
||||
}
|
||||
|
||||
void* ZeldaArena_Malloc(u32 size)
|
||||
{
|
||||
void* ZeldaArena_Malloc(u32 size) {
|
||||
void* ptr;
|
||||
ptr = __osMalloc(&sZeldaArena, size);
|
||||
ZeldaArena_CheckPointer(ptr, size, "zelda_malloc", "確保"); //Secure
|
||||
ZeldaArena_CheckPointer(ptr, size, "zelda_malloc", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* ZeldaArena_MallocDebug(u32 size, const char* file, s32 line)
|
||||
{
|
||||
void* ZeldaArena_MallocDebug(u32 size, const char* file, s32 line) {
|
||||
void* ptr;
|
||||
ptr = __osMallocDebug(&sZeldaArena, size, file, line);
|
||||
ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_DEBUG", "確保"); //Secure
|
||||
ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_DEBUG", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* ZeldaArena_MallocR(u32 size)
|
||||
{
|
||||
void* ZeldaArena_MallocR(u32 size) {
|
||||
void* ptr;
|
||||
ptr = __osMallocR(&sZeldaArena, size);
|
||||
ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_r", "確保"); //Secure
|
||||
ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_r", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* ZeldaArena_MallocRDebug(u32 size, const char* file, s32 line)
|
||||
{
|
||||
void* ZeldaArena_MallocRDebug(u32 size, const char* file, s32 line) {
|
||||
void* ptr;
|
||||
ptr = __osMallocRDebug(&sZeldaArena, size, file, line);
|
||||
ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_r_DEBUG", "確保"); //Secure
|
||||
ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_r_DEBUG", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* ZeldaArena_Realloc(void* ptr, u32 newSize)
|
||||
{
|
||||
void* ZeldaArena_Realloc(void* ptr, u32 newSize) {
|
||||
ptr = __osRealloc(&sZeldaArena, ptr, newSize);
|
||||
ZeldaArena_CheckPointer(ptr, newSize, "zelda_realloc", "再確保"); // Re-securing
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line)
|
||||
{
|
||||
void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) {
|
||||
ptr = __osReallocDebug(&sZeldaArena, ptr, newSize, file, line);
|
||||
ZeldaArena_CheckPointer(ptr, newSize, "zelda_realloc_DEBUG", "再確保"); // Re-securing
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void ZeldaArena_Free(void* ptr)
|
||||
{
|
||||
void ZeldaArena_Free(void* ptr) {
|
||||
__osFree(&sZeldaArena, ptr);
|
||||
}
|
||||
|
||||
void ZeldaArena_FreeDebug(void* ptr, const char* file, s32 line)
|
||||
{
|
||||
void ZeldaArena_FreeDebug(void* ptr, const char* file, s32 line) {
|
||||
__osFreeDebug(&sZeldaArena, ptr, file, line);
|
||||
}
|
||||
|
||||
void* ZeldaArena_Calloc(u32 num, u32 size)
|
||||
{
|
||||
void* ZeldaArena_Calloc(u32 num, u32 size) {
|
||||
void* ret;
|
||||
u32 n;
|
||||
|
||||
n = num*size;
|
||||
|
||||
n = num * size;
|
||||
ret = __osMalloc(&sZeldaArena, n);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
bzero(ret, n);
|
||||
}
|
||||
|
||||
ZeldaArena_CheckPointer(ret, n, "zelda_calloc", "確保");
|
||||
return ret;
|
||||
}
|
||||
|
||||
void ZeldaArena_Display()
|
||||
{
|
||||
//Zelda heap display
|
||||
void ZeldaArena_Display() {
|
||||
// Zelda heap display
|
||||
osSyncPrintf("ゼルダヒープ表示\n");
|
||||
__osDisplayArena(&sZeldaArena);
|
||||
}
|
||||
|
||||
void ZeldaArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc)
|
||||
{
|
||||
void ZeldaArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) {
|
||||
ArenaImpl_GetSizes(&sZeldaArena, outMaxFree, outFree, outAlloc);
|
||||
}
|
||||
|
||||
void ZeldaArena_Check()
|
||||
{
|
||||
void ZeldaArena_Check() {
|
||||
__osCheckArena(&sZeldaArena);
|
||||
}
|
||||
|
||||
void ZeldaArena_Init(void* start, u32 size)
|
||||
{
|
||||
void ZeldaArena_Init(void* start, u32 size) {
|
||||
gZeldaArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
||||
__osMallocInit(&sZeldaArena, start, size);
|
||||
}
|
||||
|
||||
void ZeldaArena_Cleanup()
|
||||
{
|
||||
void ZeldaArena_Cleanup() {
|
||||
gZeldaArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
||||
__osMallocCleanup(&sZeldaArena);
|
||||
}
|
||||
|
||||
u8 ZeldaArena_IsInitalized()
|
||||
{
|
||||
u8 ZeldaArena_IsInitalized() {
|
||||
return __osMallocIsInitalized(&sZeldaArena);
|
||||
}
|
||||
|
||||
@@ -22,4 +22,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_exp/func_80082248.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_exp/func_8008226C.s")
|
||||
|
||||
|
||||
+45
-67
@@ -2,8 +2,7 @@
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ void* texture;
|
||||
/* 0x04 */ u32 imageFormat;
|
||||
/* 0x08 */ u32 imageSize;
|
||||
@@ -15,76 +14,69 @@ typedef struct
|
||||
/* 0x20 */ u32 dtdy;
|
||||
} MapMarkInfo; // size = 0x24
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ void* loadedRamAddr; // original name: "allocp"
|
||||
/* 0x04 */ u32 vromStart;
|
||||
/* 0x08 */ u32 vromEnd;
|
||||
/* 0x0C */ u32 vramStart;
|
||||
/* 0x10 */ u32 vramEnd;
|
||||
/* 0x14 */ u32 vramTable;
|
||||
/* 0x04 */ u32 vromStart;
|
||||
/* 0x08 */ u32 vromEnd;
|
||||
/* 0x0C */ u32 vramStart;
|
||||
/* 0x10 */ u32 vramEnd;
|
||||
/* 0x14 */ u32 vramTable;
|
||||
} MapMarkDataOverlay; // size = 0x18
|
||||
|
||||
static u32 sBaseImageSizes[] = { 0, 1, 2, 3 };
|
||||
static u32 sBaseImageSizes[] = { 0, 1, 2, 3 };
|
||||
static u32 sLoadBlockImageSizes[] = { 2, 2, 2, 3 };
|
||||
static u32 sIncrImageSizes[] = { 3, 1, 0, 0 };
|
||||
static u32 sShiftImageSizes[] = { 2, 1, 0, 0 };
|
||||
static u32 sBytesImageSizes[] = { 0, 1, 2, 4 };
|
||||
static u32 sIncrImageSizes[] = { 3, 1, 0, 0 };
|
||||
static u32 sShiftImageSizes[] = { 2, 1, 0, 0 };
|
||||
static u32 sBytesImageSizes[] = { 0, 1, 2, 4 };
|
||||
static u32 sLineBytesImageSizes[] = { 0, 1, 2, 2 };
|
||||
|
||||
#define G_IM_SIZ_MARK sBaseImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_LOAD_BLOCK sLoadBlockImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_INCR sIncrImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_SHIFT sShiftImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_BYTES sBytesImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_LINE_BYTES sLineBytesImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK sBaseImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_LOAD_BLOCK sLoadBlockImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_INCR sIncrImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_SHIFT sShiftImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_BYTES sBytesImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_LINE_BYTES sLineBytesImageSizes[markInfo->imageSize]
|
||||
|
||||
static MapMarkInfo sMapMarkInfoTable[] =
|
||||
{
|
||||
static MapMarkInfo sMapMarkInfoTable[] = {
|
||||
{ D_02002580, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 32, 32, 1024, 1024 }, // Chest Icon
|
||||
{ D_02002900, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 32, 32, 1024, 1024 }, // Boss Skull Icon
|
||||
{ D_02002900, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 32, 32, 1024, 1024 }, // Boss Skull Icon
|
||||
};
|
||||
|
||||
static MapMarkDataOverlay sMapMarkDataOvl =
|
||||
{
|
||||
static MapMarkDataOverlay sMapMarkDataOvl = {
|
||||
NULL,
|
||||
(u32)_ovl_map_mark_dataSegmentRomStart,
|
||||
(u32)_ovl_map_mark_dataSegmentRomEnd,
|
||||
(u32)_ovl_map_mark_dataSegmentStart,
|
||||
(u32)_ovl_map_mark_dataSegmentEnd,
|
||||
(u32)gMapMarkDataTable
|
||||
(u32)gMapMarkDataTable,
|
||||
};
|
||||
|
||||
static MapMarksData** sLoadedMarkDataTable;
|
||||
|
||||
extern u8** D_8015FFD0;
|
||||
|
||||
void MapMark_Init(GlobalContext* globalCtx)
|
||||
{
|
||||
void MapMark_Init(GlobalContext* globalCtx) {
|
||||
MapMarkDataOverlay* overlay = &sMapMarkDataOvl;
|
||||
u32 overlaySize = overlay->vramEnd - overlay->vramStart;
|
||||
|
||||
overlay->loadedRamAddr = Game_Alloc(&globalCtx->state, overlaySize, "../z_map_mark.c", 235);
|
||||
LogUtils_CheckNullPointer("dlftbl->allocp", overlay->loadedRamAddr, "../z_map_mark.c", 236);
|
||||
|
||||
Overlay_Load(overlay->vromStart, overlay->vromEnd,
|
||||
overlay->vramStart, overlay->vramEnd,
|
||||
overlay->loadedRamAddr);
|
||||
Overlay_Load(overlay->vromStart, overlay->vromEnd, overlay->vramStart, overlay->vramEnd, overlay->loadedRamAddr);
|
||||
|
||||
sLoadedMarkDataTable = gMapMarkDataTable;
|
||||
sLoadedMarkDataTable = (void*)(s32)((overlay->vramTable != 0) ?
|
||||
(void*)(overlay->vramTable - (s32)(overlay->vramStart - (s32)overlay->loadedRamAddr)) :
|
||||
NULL);
|
||||
sLoadedMarkDataTable =
|
||||
(void*)(s32)((overlay->vramTable != 0)
|
||||
? (void*)(overlay->vramTable - (s32)(overlay->vramStart - (s32)overlay->loadedRamAddr))
|
||||
: NULL);
|
||||
}
|
||||
|
||||
void MapMark_ClearPointers(GlobalContext* globalCtx)
|
||||
{
|
||||
void MapMark_ClearPointers(GlobalContext* globalCtx) {
|
||||
sMapMarkDataOvl.loadedRamAddr = NULL;
|
||||
sLoadedMarkDataTable = NULL;
|
||||
}
|
||||
|
||||
void MapMark_Draw(GlobalContext* globalCtx)
|
||||
{
|
||||
void MapMark_Draw(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx;
|
||||
MapMarkData* mapMarkData;
|
||||
MapMarkPoint* markPoint;
|
||||
@@ -99,11 +91,10 @@ void MapMark_Draw(GlobalContext* globalCtx)
|
||||
dungeonId = gSaveContext.dungeon_index;
|
||||
interfaceCtx = &globalCtx->interfaceCtx;
|
||||
|
||||
if ((D_8015FFD0 != NULL) && (globalCtx->interfaceCtx.roomNum >= D_8015FFD0[7][dungeonId]))
|
||||
{
|
||||
if ((D_8015FFD0 != NULL) && (globalCtx->interfaceCtx.roomNum >= D_8015FFD0[7][dungeonId])) {
|
||||
// Translates to: "ROOM NUMBER EXCEEDED, YIKES %d/%d MapMarkDraw PROCESSING INTERRUPTED"
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "部屋番号がオーバーしてるで,ヤバイで %d/%d \nMapMarkDraw の処理を中断します\n", VT_RST,
|
||||
globalCtx->interfaceCtx.roomNum, D_8015FFD0[7][dungeonId]);
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "部屋番号がオーバーしてるで,ヤバイで %d/%d \nMapMarkDraw の処理を中断します\n",
|
||||
VT_RST, globalCtx->interfaceCtx.roomNum, D_8015FFD0[7][dungeonId]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -112,10 +103,10 @@ void MapMark_Draw(GlobalContext* globalCtx)
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_map_mark.c", 303);
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (mapMarkData->markType == -1)
|
||||
while (1) {
|
||||
if (mapMarkData->markType == -1) {
|
||||
break;
|
||||
}
|
||||
|
||||
gDPPipeSync(gfxCtx->overlay.p++);
|
||||
gDPSetTextureLUT(gfxCtx->overlay.p++, G_TT_NONE);
|
||||
@@ -123,31 +114,20 @@ void MapMark_Draw(GlobalContext* globalCtx)
|
||||
gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, interfaceCtx->minimapAlpha);
|
||||
|
||||
markPoint = &mapMarkData->points[0];
|
||||
for (i = 0; i < mapMarkData->count; i++)
|
||||
{
|
||||
if ((mapMarkData->markType != 0) || !Flags_GetTreasure(globalCtx, markPoint->chestFlag))
|
||||
{
|
||||
for (i = 0; i < mapMarkData->count; i++) {
|
||||
if ((mapMarkData->markType != 0) || !Flags_GetTreasure(globalCtx, markPoint->chestFlag)) {
|
||||
markInfo = &sMapMarkInfoTable[mapMarkData->markType];
|
||||
|
||||
gDPPipeSync(gfxCtx->overlay.p++);
|
||||
gDPLoadTextureBlock(gfxCtx->overlay.p++,
|
||||
markInfo->texture,
|
||||
markInfo->imageFormat,
|
||||
G_IM_SIZ_MARK,
|
||||
markInfo->textureWidth, markInfo->textureHeight,
|
||||
0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOLOD);
|
||||
gDPLoadTextureBlock(gfxCtx->overlay.p++, markInfo->texture, markInfo->imageFormat, G_IM_SIZ_MARK,
|
||||
markInfo->textureWidth, markInfo->textureHeight, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
rectLeft = (GREG(94) + markPoint->x + 204) << 2;
|
||||
rectTop = (GREG(95) + markPoint->y + 140) << 2;
|
||||
gSPTextureRectangle(gfxCtx->overlay.p++,
|
||||
rectLeft, rectTop,
|
||||
markInfo->rectWidth + rectLeft, rectTop + markInfo->rectHeight,
|
||||
G_TX_RENDERTILE,
|
||||
0, 0,
|
||||
markInfo->dsdx, markInfo->dtdy);
|
||||
gSPTextureRectangle(gfxCtx->overlay.p++, rectLeft, rectTop, markInfo->rectWidth + rectLeft,
|
||||
rectTop + markInfo->rectHeight, G_TX_RENDERTILE, 0, 0, markInfo->dsdx,
|
||||
markInfo->dtdy);
|
||||
}
|
||||
markPoint++;
|
||||
}
|
||||
@@ -157,10 +137,8 @@ void MapMark_Draw(GlobalContext* globalCtx)
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_map_mark.c", 339);
|
||||
}
|
||||
|
||||
void MapMark_DrawConditionally(GlobalContext* globalCtx)
|
||||
{
|
||||
switch (globalCtx->sceneNum)
|
||||
{
|
||||
void MapMark_DrawConditionally(GlobalContext* globalCtx) {
|
||||
switch (globalCtx->sceneNum) {
|
||||
case SCENE_YDAN:
|
||||
case SCENE_DDAN:
|
||||
case SCENE_BDAN:
|
||||
|
||||
@@ -82,4 +82,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_PAL/func_80110460.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_PAL/func_801104C8.s")
|
||||
|
||||
|
||||
+32
-43
@@ -11,107 +11,96 @@ s32 D_80120124 = 0;
|
||||
UNK_TYPE D_8015FFC0;
|
||||
UNK_TYPE D_8015FFC4;
|
||||
|
||||
void func_8007B910(u32 red, u32 green, u32 blue, u32 alpha)
|
||||
{
|
||||
void func_8007B910(u32 red, u32 green, u32 blue, u32 alpha) {
|
||||
sFontColorRed = red;
|
||||
sFontColorGreen = green;
|
||||
sFontColorBlue = blue;
|
||||
sFontColorAlpha = alpha;
|
||||
}
|
||||
|
||||
void func_8007B934(s32 arg0, s32 arg1)
|
||||
{
|
||||
if (arg0 > 39)
|
||||
void func_8007B934(s32 arg0, s32 arg1) {
|
||||
if (arg0 > 39) {
|
||||
D_80120120 = 39 * 8;
|
||||
else if (arg0 < 0)
|
||||
} else if (arg0 < 0) {
|
||||
D_80120120 = 0;
|
||||
else
|
||||
} else {
|
||||
D_80120120 = arg0 * 8;
|
||||
}
|
||||
|
||||
if (arg1 > 29)
|
||||
if (arg1 > 29) {
|
||||
D_80120124 = 29 * 8;
|
||||
else if (arg1 < 0)
|
||||
} else if (arg1 < 0) {
|
||||
D_80120124 = 0;
|
||||
else
|
||||
} else {
|
||||
D_80120124 = arg1 * 8;
|
||||
}
|
||||
}
|
||||
|
||||
void func_8007B9A4(GraphicsContext* gfxCtx, u8 arg1)
|
||||
{
|
||||
void func_8007B9A4(GraphicsContext* gfxCtx, u8 arg1) {
|
||||
Gfx* gfxArr[7];
|
||||
|
||||
func_800C6AC4(gfxArr, gfxCtx, "../z_moji.c", 86);
|
||||
|
||||
if ((u32)gLetterTLUT & 0xF)
|
||||
if ((u32)gLetterTLUT & 0xF) {
|
||||
osSyncPrintf("moji_tlut --> %X\n", gLetterTLUT);
|
||||
}
|
||||
|
||||
if (D_8015FFC0 != (arg1 & 3))
|
||||
{
|
||||
if (D_8015FFC0 != (arg1 & 3)) {
|
||||
gDPLoadTLUT(gfxCtx->polyOpa.p++, 16, 256, &gLetterTLUT[arg1 & 3]);
|
||||
D_8015FFC0 = arg1 & 3;
|
||||
}
|
||||
|
||||
gSPTextureRectangle(gfxCtx->polyOpa.p++,
|
||||
D_80120120 << 2, D_80120124 << 2,
|
||||
(D_80120120 + 8) << 2, (D_80120124 + 8) << 2,
|
||||
G_TX_RENDERTILE,
|
||||
(u16)(arg1 & 4) * 64, (u16)(arg1 >> 3) * 256,
|
||||
1024, 1024);
|
||||
gSPTextureRectangle(gfxCtx->polyOpa.p++, D_80120120 << 2, D_80120124 << 2, (D_80120120 + 8) << 2,
|
||||
(D_80120124 + 8) << 2, G_TX_RENDERTILE, (u16)(arg1 & 4) * 64, (u16)(arg1 >> 3) * 256, 1024,
|
||||
1024);
|
||||
|
||||
func_800C6B54(gfxArr, gfxCtx, "../z_moji.c", 123);
|
||||
}
|
||||
|
||||
void func_8007BBA8(GraphicsContext* gfxCtx, u8* arg1)
|
||||
{
|
||||
void func_8007BBA8(GraphicsContext* gfxCtx, u8* arg1) {
|
||||
s32 i;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, gfxCtx, "../z_moji.c", 137);
|
||||
|
||||
if ((u32)gFontFF & 0xF)
|
||||
if ((u32)gFontFF & 0xF) {
|
||||
osSyncPrintf("font_ff --> %X\n", gFontFF);
|
||||
}
|
||||
|
||||
gDPPipeSync(gfxCtx->polyOpa.p++);
|
||||
gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0,
|
||||
sFontColorRed, sFontColorGreen,
|
||||
sFontColorBlue, sFontColorAlpha);
|
||||
gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, sFontColorRed, sFontColorGreen, sFontColorBlue, sFontColorAlpha);
|
||||
|
||||
gDPSetTextureImage(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_16b, 1, (s32)gFontFF);
|
||||
gDPSetTile(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_16b,
|
||||
0, 0, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPSetTile(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPLoadSync(gfxCtx->polyOpa.p++);
|
||||
gDPLoadBlock(gfxCtx->polyOpa.p++, G_TX_LOADTILE, 0, 0, 511, 2048);
|
||||
gDPPipeSync(gfxCtx->polyOpa.p++);
|
||||
gDPSetTile(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_4b,
|
||||
1, 0, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPSetTile(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPSetTileSize(gfxCtx->polyOpa.p++, G_TX_RENDERTILE, 0, 0, 60, 508);
|
||||
|
||||
D_8015FFC0 = -1;
|
||||
|
||||
for (i = 0; arg1[i] != 0; i++)
|
||||
{
|
||||
switch (arg1[i])
|
||||
{
|
||||
for (i = 0; arg1[i] != 0; i++) {
|
||||
switch (arg1[i]) {
|
||||
case 9:
|
||||
D_80120120 = (((D_80120120 / 8) / 8) + 1) * 8 * 8;
|
||||
if (D_80120120 >= 320)
|
||||
{
|
||||
if (D_80120120 >= 320) {
|
||||
D_80120120 = 0;
|
||||
D_80120124 += 8;
|
||||
if (D_80120124 >= 240)
|
||||
if (D_80120124 >= 240) {
|
||||
D_80120124 = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
case 13:
|
||||
D_80120120 = 0;
|
||||
D_80120124 += 8;
|
||||
if (D_80120124 >= 240)
|
||||
if (D_80120124 >= 240) {
|
||||
D_80120124 = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
func_8007B9A4(gfxCtx, arg1[i]);
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
#include <global.h>
|
||||
#include <sched.h>
|
||||
|
||||
void MsgEvent_SendNullTask()
|
||||
{
|
||||
void MsgEvent_SendNullTask() {
|
||||
u32 pad[4];
|
||||
OSScTask task;
|
||||
OSMesgQueue queue;
|
||||
|
||||
+18
-25
@@ -1,8 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 unk_00;
|
||||
/* 0x04 */ u32 unk_04;
|
||||
/* 0x08 */ s16 unk_08;
|
||||
@@ -13,29 +12,26 @@ typedef struct
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_8007C704.s")
|
||||
|
||||
void func_8007C76C(f32* pfParm1, s16 *puParm2)
|
||||
{
|
||||
puParm2[0] = pfParm1[0];
|
||||
puParm2[1] = pfParm1[1];
|
||||
puParm2[2] = pfParm1[2];
|
||||
void func_8007C76C(f32* pfParm1, s16* puParm2) {
|
||||
puParm2[0] = pfParm1[0];
|
||||
puParm2[1] = pfParm1[1];
|
||||
puParm2[2] = pfParm1[2];
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_8007C7A8.s")
|
||||
|
||||
void func_8007C7F8(u32 uParm1, u32 uParm2)
|
||||
{
|
||||
u8 auStack4[4];
|
||||
u8 auStack8[4];
|
||||
|
||||
func_8003C940(uParm1, auStack4, auStack8, uParm2);
|
||||
void func_8007C7F8(u32 uParm1, u32 uParm2) {
|
||||
u8 auStack4[4];
|
||||
u8 auStack8[4];
|
||||
|
||||
func_8003C940(uParm1, auStack4, auStack8, uParm2);
|
||||
}
|
||||
|
||||
void func_8007C820(struct_8007C820* puParm1, s16 uParm2, s16 uParm3, u32 uParm4, u32 param_5)
|
||||
{
|
||||
puParm1->unk_00 = uParm4;
|
||||
puParm1->unk_04 = param_5;
|
||||
puParm1->unk_08 = uParm2;
|
||||
puParm1->unk_0A = uParm3;
|
||||
void func_8007C820(struct_8007C820* puParm1, s16 uParm2, s16 uParm3, u32 uParm4, u32 param_5) {
|
||||
puParm1->unk_00 = uParm4;
|
||||
puParm1->unk_04 = param_5;
|
||||
puParm1->unk_08 = uParm2;
|
||||
puParm1->unk_0A = uParm3;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_8007C850.s")
|
||||
@@ -52,18 +48,15 @@ void func_8007C820(struct_8007C820* puParm1, s16 uParm2, s16 uParm3, u32 uParm4,
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_800806BC.s")
|
||||
|
||||
void func_8008070C()
|
||||
{
|
||||
void func_8008070C() {
|
||||
D_80120130 = 0;
|
||||
}
|
||||
|
||||
void func_80080718()
|
||||
{
|
||||
void func_80080718() {
|
||||
D_80120130 = 1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_80080728.s")
|
||||
|
||||
void func_80080788(UNK_TYPE arg0, UNK_TYPE arg1)
|
||||
{
|
||||
void func_80080788(UNK_TYPE arg0, UNK_TYPE arg1) {
|
||||
}
|
||||
|
||||
+1358
-2129
File diff suppressed because it is too large
Load Diff
+22
-45
@@ -1,39 +1,33 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void func_800BC450(GlobalContext* globalCtx)
|
||||
{
|
||||
func_8005A7A8(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0],
|
||||
globalCtx->unk_1242B - 1, globalCtx);
|
||||
void func_800BC450(GlobalContext* globalCtx) {
|
||||
func_8005A7A8(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], globalCtx->unk_1242B - 1,
|
||||
globalCtx);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BC490.s")
|
||||
|
||||
s32 func_800BC56C(GlobalContext* globalCtx, s16 arg1)
|
||||
{
|
||||
s32 func_800BC56C(GlobalContext* globalCtx, s16 arg1) {
|
||||
return arg1 == globalCtx->unk_1242B;
|
||||
}
|
||||
|
||||
void func_800BC590(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_800BC590(GlobalContext* globalCtx) {
|
||||
osSyncPrintf("Game_play_shop_pr_vr_switch_set()\n");
|
||||
if (YREG(15) == 0x10)
|
||||
{
|
||||
if (YREG(15) == 0x10) {
|
||||
globalCtx->unk_1242B = 2;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BC5E0.s")
|
||||
|
||||
void func_800BC88C(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_800BC88C(GlobalContext* globalCtx) {
|
||||
globalCtx->unk_123F0 = -1;
|
||||
}
|
||||
|
||||
Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* a1)
|
||||
{
|
||||
func_80093708(a1, globalCtx->lightCtx.unk_07, globalCtx->lightCtx.unk_08,
|
||||
globalCtx->lightCtx.unk_09, 0, globalCtx->lightCtx.unk_0A, 1000);
|
||||
Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* a1) {
|
||||
func_80093708(a1, globalCtx->lightCtx.unk_07, globalCtx->lightCtx.unk_08, globalCtx->lightCtx.unk_09, 0,
|
||||
globalCtx->lightCtx.unk_0A, 1000);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BC8EC.s")
|
||||
@@ -48,8 +42,7 @@ Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* a1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BFAE4.s")
|
||||
|
||||
s32 func_800BFC84(GlobalContext* globalCtx)
|
||||
{
|
||||
s32 func_800BFC84(GlobalContext* globalCtx) {
|
||||
return globalCtx->csCtx.state != 0 || func_8008E988(globalCtx) != 0;
|
||||
}
|
||||
|
||||
@@ -59,8 +52,7 @@ s32 func_800BFC84(GlobalContext* globalCtx)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BFEC4.s")
|
||||
|
||||
void func_800BFF0C(GlobalContext* globalCtx, s32 a1)
|
||||
{
|
||||
void func_800BFF0C(GlobalContext* globalCtx, s32 a1) {
|
||||
globalCtx->curSpawn = a1;
|
||||
globalCtx->linkActorEntry = NULL;
|
||||
globalCtx->unk_11DFC = NULL;
|
||||
@@ -85,8 +77,7 @@ void func_800BFF0C(GlobalContext* globalCtx, s32 a1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0230.s")
|
||||
|
||||
s16 func_800C030C(GlobalContext* globalCtx)
|
||||
{
|
||||
s16 func_800C030C(GlobalContext* globalCtx) {
|
||||
return globalCtx->cameraCtx.unk_5C0;
|
||||
}
|
||||
|
||||
@@ -120,8 +111,7 @@ s16 func_800C030C(GlobalContext* globalCtx)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0AF4.s")
|
||||
|
||||
void func_800C0B60(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_800C0B60(GlobalContext* globalCtx) {
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].temp_swch_flags = globalCtx->actorCtx.flags.tempSwch;
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].temp_collect_flags = globalCtx->actorCtx.flags.tempCollect;
|
||||
gSaveContext.respawn_flag = 1;
|
||||
@@ -130,48 +120,35 @@ void func_800C0B60(GlobalContext* globalCtx)
|
||||
globalCtx->fadeOutTransition = 2;
|
||||
}
|
||||
|
||||
void func_800C0BB4(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_800C0BB4(GlobalContext* globalCtx) {
|
||||
gSaveContext.respawn_flag = -1;
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_GANON_SONOGO ||
|
||||
globalCtx->sceneNum == SCENE_GANON_FINAL ||
|
||||
globalCtx->sceneNum == SCENE_GANONTIKA_SONOGO ||
|
||||
globalCtx->sceneNum == SCENE_GANON_DEMO)
|
||||
{
|
||||
if (globalCtx->sceneNum == SCENE_GANON_SONOGO || globalCtx->sceneNum == SCENE_GANON_FINAL ||
|
||||
globalCtx->sceneNum == SCENE_GANONTIKA_SONOGO || globalCtx->sceneNum == SCENE_GANON_DEMO) {
|
||||
globalCtx->nextEntranceIndex = 0x043F;
|
||||
Item_Give(globalCtx, ITEM_SWORD_MASTER);
|
||||
}
|
||||
else if (gSaveContext.entrance_index == 0x028A ||
|
||||
gSaveContext.entrance_index == 0x028E ||
|
||||
gSaveContext.entrance_index == 0x0292 ||
|
||||
gSaveContext.entrance_index == 0x0476)
|
||||
{
|
||||
} else if (gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E ||
|
||||
gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) {
|
||||
globalCtx->nextEntranceIndex = 0x01F9;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
globalCtx->nextEntranceIndex = gSaveContext.entrance_index;
|
||||
}
|
||||
|
||||
globalCtx->fadeOutTransition = 2;
|
||||
}
|
||||
|
||||
void func_800C0C88(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_800C0C88(GlobalContext* globalCtx) {
|
||||
func_800C0AF4(globalCtx, 0, 0xDFF);
|
||||
func_800C0BB4(globalCtx);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0CB8.s")
|
||||
|
||||
s32 func_800C0D28(GlobalContext* globalCtx)
|
||||
{
|
||||
s32 func_800C0D28(GlobalContext* globalCtx) {
|
||||
return globalCtx->unk_7B8 != 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0D34.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0DB4.s")
|
||||
|
||||
|
||||
@@ -15,8 +15,7 @@ void PlayerCall_Destroy(Player* player, GlobalContext* globalCtx);
|
||||
void PlayerCall_Update(Player* player, GlobalContext* globalCtx);
|
||||
void PlayerCall_Draw(Player* player, GlobalContext* globalCtx);
|
||||
|
||||
const ActorInit Player_InitVars =
|
||||
{
|
||||
const ActorInit Player_InitVars = {
|
||||
ACTOR_PLAYER,
|
||||
ACTORTYPE_PLAYER,
|
||||
0,
|
||||
@@ -29,35 +28,30 @@ const ActorInit Player_InitVars =
|
||||
(ActorFunc)PlayerCall_Draw,
|
||||
};
|
||||
|
||||
void PlayerCall_InitFuncPtrs()
|
||||
{
|
||||
void PlayerCall_InitFuncPtrs() {
|
||||
sPlayerCallInitFunc = KaleidoManager_GetRamAddr(func_80846CD8);
|
||||
sPlayerCallDestroyFunc = KaleidoManager_GetRamAddr(func_8084AB54);
|
||||
sPlayerCallUpdateFunc = KaleidoManager_GetRamAddr(func_80849EA8);
|
||||
sPlayerCallDrawFunc = KaleidoManager_GetRamAddr(func_8084A5C4);
|
||||
}
|
||||
|
||||
void PlayerCall_Init(Player* player, GlobalContext* globalCtx)
|
||||
{
|
||||
void PlayerCall_Init(Player* player, GlobalContext* globalCtx) {
|
||||
KaleidoScopeCall_LoadPlayer();
|
||||
PlayerCall_InitFuncPtrs();
|
||||
sPlayerCallInitFunc(player, globalCtx);
|
||||
}
|
||||
|
||||
void PlayerCall_Destroy(Player* player, GlobalContext* globalCtx)
|
||||
{
|
||||
void PlayerCall_Destroy(Player* player, GlobalContext* globalCtx) {
|
||||
KaleidoScopeCall_LoadPlayer();
|
||||
sPlayerCallDestroyFunc(player, globalCtx);
|
||||
}
|
||||
|
||||
void PlayerCall_Update(Player* player, GlobalContext* globalCtx)
|
||||
{
|
||||
void PlayerCall_Update(Player* player, GlobalContext* globalCtx) {
|
||||
KaleidoScopeCall_LoadPlayer();
|
||||
sPlayerCallUpdateFunc(player, globalCtx);
|
||||
}
|
||||
|
||||
void PlayerCall_Draw(Player* player, GlobalContext* globalCtx)
|
||||
{
|
||||
void PlayerCall_Draw(Player* player, GlobalContext* globalCtx) {
|
||||
KaleidoScopeCall_LoadPlayer();
|
||||
sPlayerCallDrawFunc(player, globalCtx);
|
||||
}
|
||||
|
||||
+31
-66
@@ -3,33 +3,22 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008E750.s")
|
||||
|
||||
UNK_TYPE func_8008E8DC(GlobalContext* globalCtx, Player* player)
|
||||
{
|
||||
return (
|
||||
player->stateFlags1 & 0x20000080 ||
|
||||
player->action ||
|
||||
globalCtx->sceneLoadFlag == 0x14 ||
|
||||
player->stateFlags1 & 1 ||
|
||||
player->unk_692 & 0x80 ||
|
||||
gSaveContext.unk_13F0 &&
|
||||
func_8008F0D8(player, player->unk_154) >= 0
|
||||
);
|
||||
|
||||
UNK_TYPE func_8008E8DC(GlobalContext* globalCtx, Player* player) {
|
||||
return (player->stateFlags1 & 0x20000080 || player->action || globalCtx->sceneLoadFlag == 0x14 ||
|
||||
player->stateFlags1 & 1 || player->unk_692 & 0x80 ||
|
||||
gSaveContext.unk_13F0 && func_8008F0D8(player, player->unk_154) >= 0);
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008E988(GlobalContext* globalCtx)
|
||||
{
|
||||
UNK_TYPE func_8008E988(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
return func_8008E8DC(globalCtx, player) || player->unk_6AD == 4;
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008E9C4(Player* player)
|
||||
{
|
||||
UNK_TYPE func_8008E9C4(Player* player) {
|
||||
return player->stateFlags1 & 0x10;
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008E9D0(Player* player)
|
||||
{
|
||||
UNK_TYPE func_8008E9D0(Player* player) {
|
||||
return LINK_IS_CHILD && player->currentShield == 2;
|
||||
}
|
||||
|
||||
@@ -41,8 +30,7 @@ UNK_TYPE func_8008E9D0(Player* player)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008EC04.s")
|
||||
|
||||
void func_8008EC70(Player* player)
|
||||
{
|
||||
void func_8008EC70(Player* player) {
|
||||
player->unk_154 = player->unk_151;
|
||||
func_8008EC04(player, func_8008E9F8(player, player->unk_151));
|
||||
player->unk_6AD = 0;
|
||||
@@ -50,19 +38,16 @@ void func_8008EC70(Player* player)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008ECAC.s")
|
||||
|
||||
void func_8008ED9C(GlobalContext* globalCtx, Player* player, UNK_TYPE item, UNK_TYPE arg2)
|
||||
{
|
||||
void func_8008ED9C(GlobalContext* globalCtx, Player* player, UNK_TYPE item, UNK_TYPE arg2) {
|
||||
Inventory_UpdateBottleItem(globalCtx, item, player->unk_150);
|
||||
if (item != ITEM_BOTTLE)
|
||||
{
|
||||
if (item != ITEM_BOTTLE) {
|
||||
player->unk_152 = item;
|
||||
player->unk_151 = arg2;
|
||||
}
|
||||
player->unk_154 = arg2;
|
||||
}
|
||||
|
||||
void func_8008EDF0(Player* player)
|
||||
{
|
||||
void func_8008EDF0(Player* player) {
|
||||
player->unk_664 = NULL;
|
||||
player->stateFlags2 &= ~0x2000;
|
||||
}
|
||||
@@ -71,8 +56,7 @@ void func_8008EDF0(Player* player)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008EEAC.s")
|
||||
|
||||
UNK_TYPE func_8008EF44(GlobalContext* globalCtx, UNK_TYPE arg1)
|
||||
{
|
||||
UNK_TYPE func_8008EF44(GlobalContext* globalCtx, UNK_TYPE arg1) {
|
||||
globalCtx->unk_11E5C = (arg1 + 1);
|
||||
return 1;
|
||||
}
|
||||
@@ -81,69 +65,56 @@ UNK_TYPE func_8008EF44(GlobalContext* globalCtx, UNK_TYPE arg1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008F034.s")
|
||||
|
||||
u8 func_8008F080(GlobalContext* globalCtx)
|
||||
{
|
||||
u8 func_8008F080(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
return player->currentMask;
|
||||
}
|
||||
|
||||
void func_8008F08C(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8008F08C(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
player->currentMask = 0;
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008F098(GlobalContext* globalCtx)
|
||||
{
|
||||
UNK_TYPE func_8008F098(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
return player->currentShield == 3;
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008F0AC(GlobalContext* globalCtx)
|
||||
{
|
||||
UNK_TYPE func_8008F0AC(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
return player->unk_15D == 0xa && player->currentShield == 3;
|
||||
}
|
||||
|
||||
s32 func_8008F0D8(Player* player, UNK_TYPE arg1)
|
||||
{
|
||||
s32 func_8008F0D8(Player* player, UNK_TYPE arg1) {
|
||||
s32 temp_v0 = arg1 - 0x15;
|
||||
if (temp_v0 >= 0 && temp_v0 < 6)
|
||||
{
|
||||
if (temp_v0 >= 0 && temp_v0 < 6) {
|
||||
return temp_v0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008F104(Player* player)
|
||||
{
|
||||
UNK_TYPE func_8008F104(Player* player) {
|
||||
return player->unk_151 == 0x10 || player->unk_151 == 0x11;
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008F128(Player* player)
|
||||
{
|
||||
UNK_TYPE func_8008F128(Player* player) {
|
||||
return func_8008F104(player) && player->heldActor == NULL;
|
||||
}
|
||||
|
||||
s32 func_8008F158(UNK_TYPE arg0)
|
||||
{
|
||||
s32 func_8008F158(UNK_TYPE arg0) {
|
||||
s32 temp_v0 = arg0 - 2;
|
||||
if (temp_v0 > 0 && temp_v0 < 6)
|
||||
{
|
||||
if (temp_v0 > 0 && temp_v0 < 6) {
|
||||
return temp_v0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void func_8008F180(Player* player)
|
||||
{
|
||||
void func_8008F180(Player* player) {
|
||||
func_8008F158(player->unk_151);
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008F1A0(Player* player)
|
||||
{
|
||||
if (player->unk_151 >= 5 && player->unk_151 < 8)
|
||||
{
|
||||
UNK_TYPE func_8008F1A0(Player* player) {
|
||||
if (player->unk_151 >= 5 && player->unk_151 < 8) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -151,33 +122,27 @@ UNK_TYPE func_8008F1A0(Player* player)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008F1CC.s")
|
||||
|
||||
s32 func_8008F224(Player* player, UNK_TYPE arg1)
|
||||
{
|
||||
s32 func_8008F224(Player* player, UNK_TYPE arg1) {
|
||||
s32 temp_v0 = arg1 - 0x1E;
|
||||
if (temp_v0 >= 0 && temp_v0 < 0xD)
|
||||
{
|
||||
if (temp_v0 >= 0 && temp_v0 < 0xD) {
|
||||
return temp_v0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void func_8008F250(Player* player)
|
||||
{
|
||||
void func_8008F250(Player* player) {
|
||||
func_8008F224(player, player->unk_151);
|
||||
}
|
||||
|
||||
s32 func_8008F270(Player* player, UNK_TYPE arg1)
|
||||
{
|
||||
s32 func_8008F270(Player* player, UNK_TYPE arg1) {
|
||||
s32 temp_v0 = arg1 - 0x12;
|
||||
if (temp_v0 >= 0 && temp_v0 < 2)
|
||||
{
|
||||
if (temp_v0 >= 0 && temp_v0 < 2) {
|
||||
return temp_v0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
s32 func_8008F29C(Player* player)
|
||||
{
|
||||
s32 func_8008F29C(Player* player) {
|
||||
return func_8008F270(player, player->unk_151);
|
||||
}
|
||||
|
||||
|
||||
+7
-15
@@ -2,23 +2,20 @@
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
void func_80092320(PreNMIContext* prenmiCtx)
|
||||
{
|
||||
void func_80092320(PreNMIContext* prenmiCtx) {
|
||||
prenmiCtx->state.running = false;
|
||||
prenmiCtx->state.init = NULL;
|
||||
prenmiCtx->state.size = 0;
|
||||
}
|
||||
|
||||
void PreNMI_Update(PreNMIContext* prenmiCtx)
|
||||
{
|
||||
void PreNMI_Update(PreNMIContext* prenmiCtx) {
|
||||
osSyncPrintf(VT_COL(YELLOW, BLACK) "prenmi_move\n" VT_RST);
|
||||
|
||||
// Strings existing only in rodata
|
||||
("../z_prenmi.c");
|
||||
("(int)volume = %d\n");
|
||||
|
||||
if (prenmiCtx->timer == 0)
|
||||
{
|
||||
if (prenmiCtx->timer == 0) {
|
||||
ViConfig_UpdateVi(1);
|
||||
func_80092320(prenmiCtx);
|
||||
return;
|
||||
@@ -27,8 +24,7 @@ void PreNMI_Update(PreNMIContext* prenmiCtx)
|
||||
prenmiCtx->timer--;
|
||||
}
|
||||
|
||||
void PreNMI_Draw(PreNMIContext* prenmiCtx)
|
||||
{
|
||||
void PreNMI_Draw(PreNMIContext* prenmiCtx) {
|
||||
GraphicsContext* gfxCtx = prenmiCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -45,21 +41,17 @@ void PreNMI_Draw(PreNMIContext* prenmiCtx)
|
||||
func_800C6B54(gfxArr, gfxCtx, "../z_prenmi.c", 112);
|
||||
}
|
||||
|
||||
void PreNMI_Main(PreNMIContext* prenmiCtx)
|
||||
{
|
||||
void PreNMI_Main(PreNMIContext* prenmiCtx) {
|
||||
PreNMI_Update(prenmiCtx);
|
||||
PreNMI_Draw(prenmiCtx);
|
||||
|
||||
prenmiCtx->state.unk_A0 = 1;
|
||||
}
|
||||
|
||||
void PreNMI_Destroy(PreNMIContext* prenmiCtx)
|
||||
{
|
||||
|
||||
void PreNMI_Destroy(PreNMIContext* prenmiCtx) {
|
||||
}
|
||||
|
||||
void PreNMI_Init(PreNMIContext* prenmiCtx)
|
||||
{
|
||||
void PreNMI_Init(PreNMIContext* prenmiCtx) {
|
||||
prenmiCtx->state.main = PreNMI_Main;
|
||||
prenmiCtx->state.destroy = PreNMI_Destroy;
|
||||
prenmiCtx->timer = 30;
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
#define COLD_RESET 0
|
||||
#define NMI 1
|
||||
#define COLD_RESET 0
|
||||
#define NMI 1
|
||||
|
||||
|
||||
void PreNmiBuff_Init(PreNmiBuff* this)
|
||||
{
|
||||
void PreNmiBuff_Init(PreNmiBuff* this) {
|
||||
this->resetting = false;
|
||||
if (osResetType == COLD_RESET)
|
||||
{
|
||||
if (osResetType == COLD_RESET) {
|
||||
this->resetCount = 0;
|
||||
this->duration = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this->resetCount++;
|
||||
this->duration += this->resetTime;
|
||||
}
|
||||
@@ -22,14 +17,11 @@ void PreNmiBuff_Init(PreNmiBuff* this)
|
||||
this->resetTime = 0;
|
||||
}
|
||||
|
||||
|
||||
void PreNmiBuff_SetReset(PreNmiBuff* this)
|
||||
{
|
||||
void PreNmiBuff_SetReset(PreNmiBuff* this) {
|
||||
this->resetting = true;
|
||||
this->resetTime = osGetTime();
|
||||
}
|
||||
|
||||
u32 PreNmiBuff_IsResetting(PreNmiBuff* this)
|
||||
{
|
||||
u32 PreNmiBuff_IsResetting(PreNmiBuff* this) {
|
||||
return this->resetting;
|
||||
}
|
||||
|
||||
+17
-28
@@ -133,29 +133,25 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094E54.s")
|
||||
|
||||
Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y)
|
||||
{
|
||||
Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y) {
|
||||
return Draw_TexScroll(gfxCtx, x, y, 0, 0);
|
||||
}
|
||||
|
||||
Gfx* Draw_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height)
|
||||
{
|
||||
Gfx* Draw_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height) {
|
||||
Gfx* displayList = Graph_Alloc(gfxCtx, 3 * sizeof(Gfx));
|
||||
|
||||
x %= 2048;
|
||||
y %= 2048;
|
||||
|
||||
gDPTileSync(displayList);
|
||||
gDPSetTileSize(displayList+1, 0, x, y,
|
||||
(x+((width-1)<<2)), (y+((height-1)<<2)));
|
||||
gSPEndDisplayList(displayList+2);
|
||||
gDPSetTileSize(displayList + 1, 0, x, y, (x + ((width - 1) << 2)), (y + ((height - 1) << 2)));
|
||||
gSPEndDisplayList(displayList + 2);
|
||||
|
||||
return displayList;
|
||||
}
|
||||
|
||||
Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1,
|
||||
s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2)
|
||||
{
|
||||
Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2,
|
||||
u32 y2, s32 width2, s32 height2) {
|
||||
Gfx* displayList = Graph_Alloc(gfxCtx, 5 * sizeof(Gfx));
|
||||
|
||||
x1 %= 2048;
|
||||
@@ -164,20 +160,16 @@ Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 w
|
||||
y2 %= 2048;
|
||||
|
||||
gDPTileSync(displayList);
|
||||
gDPSetTileSize(displayList+1, tile1, x1, y1,
|
||||
(x1+((width1-1)<<2)), (y1+((height1-1)<<2)));
|
||||
gDPTileSync(displayList+2);
|
||||
gDPSetTileSize(displayList+3, tile2, x2, y2,
|
||||
(x2+((width2-1)<<2)), (y2+((height2-1)<<2)));
|
||||
gSPEndDisplayList(displayList+4);
|
||||
gDPSetTileSize(displayList + 1, tile1, x1, y1, (x1 + ((width1 - 1) << 2)), (y1 + ((height1 - 1) << 2)));
|
||||
gDPTileSync(displayList + 2);
|
||||
gDPSetTileSize(displayList + 3, tile2, x2, y2, (x2 + ((width2 - 1) << 2)), (y2 + ((height2 - 1) << 2)));
|
||||
gSPEndDisplayList(displayList + 4);
|
||||
|
||||
return displayList;
|
||||
}
|
||||
|
||||
Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1,
|
||||
s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2,
|
||||
s32 red, s32 green, s32 blue, s32 alpha)
|
||||
{
|
||||
Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2,
|
||||
u32 x2, u32 y2, s32 width2, s32 height2, s32 red, s32 green, s32 blue, s32 alpha) {
|
||||
Gfx* displayList = Graph_Alloc(gfxCtx, 6 * sizeof(Gfx));
|
||||
|
||||
x1 %= 2048;
|
||||
@@ -186,13 +178,11 @@ Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y
|
||||
y2 %= 2048;
|
||||
|
||||
gDPTileSync(displayList);
|
||||
gDPSetTileSize(displayList+1, tile1, x1, y1,
|
||||
(x1+((width1-1)<<2)), (y1+((height1-1)<<2)));
|
||||
gDPTileSync(displayList+2);
|
||||
gDPSetTileSize(displayList+3, tile2, x2, y2,
|
||||
(x2+((width2-1)<<2)), (y2+((height2-1)<<2)));
|
||||
gDPSetEnvColor(displayList+4, red, green, blue, alpha);
|
||||
gSPEndDisplayList(displayList+5);
|
||||
gDPSetTileSize(displayList + 1, tile1, x1, y1, (x1 + ((width1 - 1) << 2)), (y1 + ((height1 - 1) << 2)));
|
||||
gDPTileSync(displayList + 2);
|
||||
gDPSetTileSize(displayList + 3, tile2, x2, y2, (x2 + ((width2 - 1) << 2)), (y2 + ((height2 - 1) << 2)));
|
||||
gDPSetEnvColor(displayList + 4, red, green, blue, alpha);
|
||||
gSPEndDisplayList(displayList + 5);
|
||||
|
||||
return displayList;
|
||||
}
|
||||
@@ -202,4 +192,3 @@ Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80095248.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80095974.s")
|
||||
|
||||
|
||||
+112
-180
@@ -9,14 +9,13 @@ void func_80096F6C(GlobalContext* globalCtx, Room* room, u32 flags);
|
||||
Vec3f D_801270A0 = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
// unused
|
||||
Gfx D_801270B0[] =
|
||||
{
|
||||
Gfx D_801270B0[] = {
|
||||
gsDPPipeSync(),
|
||||
gsSPClearGeometryMode(G_ZBUFFER | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
|
||||
gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, SHADE, 0, 0, 0, SHADE, 0, 0, 0, SHADE),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP |
|
||||
G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_FILL | G_PM_NPRIMITIVE,
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_FILL | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, 320, 240),
|
||||
@@ -24,21 +23,17 @@ Gfx D_801270B0[] =
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
void (*sRoomDrawHandlers[])(GlobalContext* globalCtx, Room* room, u32 flags) =
|
||||
{
|
||||
void (*sRoomDrawHandlers[])(GlobalContext* globalCtx, Room* room, u32 flags) = {
|
||||
func_80095AB4,
|
||||
func_80096F6C,
|
||||
func_80095D04,
|
||||
};
|
||||
|
||||
void func_80095AA0(GlobalContext* globalCtx, Room* room, UNK_TYPE arg2, UNK_TYPE arg3)
|
||||
{
|
||||
|
||||
void func_80095AA0(GlobalContext* globalCtx, Room* room, UNK_TYPE arg2, UNK_TYPE arg3) {
|
||||
}
|
||||
|
||||
// Room Draw Polygon Type 0
|
||||
void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
{
|
||||
void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
s32 i;
|
||||
PolygonType0* polygon0;
|
||||
PolygonDlist* polygonDlist;
|
||||
@@ -48,16 +43,14 @@ void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_room.c", 193);
|
||||
|
||||
if (flags & 1)
|
||||
{
|
||||
if (flags & 1) {
|
||||
func_800342EC(&D_801270A0, globalCtx);
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x03, room->segment);
|
||||
func_80093C80(globalCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
}
|
||||
|
||||
if (flags & 2)
|
||||
{
|
||||
if (flags & 2) {
|
||||
func_8003435C(&D_801270A0, globalCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x03, room->segment);
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
@@ -66,13 +59,14 @@ void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
|
||||
polygon0 = &room->mesh->polygon0;
|
||||
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon0->start);
|
||||
for (i = 0; i < polygon0->num; i++)
|
||||
{
|
||||
if ((flags & 1) && (polygonDlist->opa != NULL))
|
||||
for (i = 0; i < polygon0->num; i++) {
|
||||
if ((flags & 1) && (polygonDlist->opa != NULL)) {
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, polygonDlist->opa);
|
||||
}
|
||||
|
||||
if ((flags & 2) && (polygonDlist->xlu != NULL))
|
||||
if ((flags & 2) && (polygonDlist->xlu != NULL)) {
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, polygonDlist->xlu);
|
||||
}
|
||||
|
||||
polygonDlist++;
|
||||
}
|
||||
@@ -82,10 +76,9 @@ void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
|
||||
#define SHAPE_SORT_MAX 64
|
||||
|
||||
typedef struct struct_80095D04
|
||||
{
|
||||
typedef struct struct_80095D04 {
|
||||
/* 0x00 */ PolygonDlist2* unk_00;
|
||||
/* 0x04 */ f32 unk_04;
|
||||
/* 0x04 */ f32 unk_04;
|
||||
/* 0x08 */ struct struct_80095D04* unk_08;
|
||||
/* 0x0C */ struct struct_80095D04* unk_0C;
|
||||
} struct_80095D04; // size = 0x10
|
||||
@@ -93,8 +86,7 @@ typedef struct struct_80095D04
|
||||
// Room Draw Polygon Type 2
|
||||
#ifdef NON_MATCHING
|
||||
// this function still needs some work
|
||||
void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
{
|
||||
void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
PolygonType2* polygon2;
|
||||
PolygonDlist2* polygonDlist;
|
||||
struct_80095D04 spB8[SHAPE_SORT_MAX];
|
||||
@@ -120,16 +112,14 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
func_800C6AC4(sp5C, globalCtx->state.gfxCtx, "../z_room.c", 287);
|
||||
|
||||
if (flags & 1)
|
||||
{
|
||||
if (flags & 1) {
|
||||
func_800342EC(&D_801270A0, globalCtx);
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x03, room->segment);
|
||||
func_80093C80(globalCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
}
|
||||
|
||||
if (flags & 2)
|
||||
{
|
||||
if (flags & 2) {
|
||||
func_8003435C(&D_801270A0, globalCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x03, room->segment);
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
@@ -143,46 +133,36 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
__assert("polygon2->num <= SHAPE_SORT_MAX", "../z_room.c", 317);
|
||||
|
||||
sp78 = polygonDlist;
|
||||
for (sp9C = 0; sp9C < polygon2->num; sp9C++)
|
||||
{
|
||||
for (sp9C = 0; sp9C < polygon2->num; sp9C++) {
|
||||
sp90.x = polygonDlist->pos.x;
|
||||
sp90.y = polygonDlist->pos.y;
|
||||
sp90.z = polygonDlist->pos.z;
|
||||
func_800A6E10(&globalCtx->mf_11D60, &sp90, &sp84, &sp80);
|
||||
temp_f0 = polygonDlist->unk_06;
|
||||
if (-temp_f0 < sp84.z)
|
||||
{
|
||||
if (-temp_f0 < sp84.z) {
|
||||
temp_f2 = sp84.z - temp_f0;
|
||||
if (temp_f2 < globalCtx->lightCtx.unk_0C)
|
||||
{
|
||||
if (temp_f2 < globalCtx->lightCtx.unk_0C) {
|
||||
spA4->unk_00 = polygonDlist;
|
||||
spA4->unk_04 = temp_f2;
|
||||
phi_v0 = spB4;
|
||||
if (spB4 == 0)
|
||||
{
|
||||
if (spB4 == 0) {
|
||||
spB0 = spA4;
|
||||
spB4 = spA4;
|
||||
spA4->unk_0C = NULL;
|
||||
spA4->unk_08 = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
} else {
|
||||
do {
|
||||
if (spA4->unk_04 < phi_v0->unk_04)
|
||||
break;
|
||||
phi_v0 = phi_v0->unk_0C;
|
||||
} while (phi_v0 != NULL);
|
||||
|
||||
if (phi_v0 == NULL)
|
||||
{
|
||||
if (phi_v0 == NULL) {
|
||||
spA4->unk_08 = spB0;
|
||||
spA4->unk_0C = NULL;
|
||||
spB0->unk_0C = spA4;
|
||||
spB0 = spA4;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
phi_a0 = phi_v0->unk_08;
|
||||
spA4->unk_08 = phi_a0;
|
||||
if (phi_a0 == NULL)
|
||||
@@ -190,7 +170,7 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
else
|
||||
phi_a0->unk_0C = spA4;
|
||||
phi_v0->unk_08 = spA4;
|
||||
spA4->unk_0C = (void *) phi_v0;
|
||||
spA4->unk_0C = (void*)phi_v0;
|
||||
}
|
||||
}
|
||||
spA4 = spA4++;
|
||||
@@ -202,32 +182,25 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
iREG(87) = polygon2->num;
|
||||
|
||||
sp9C = 1;
|
||||
while (spB4 != NULL)
|
||||
{
|
||||
while (spB4 != NULL) {
|
||||
phi_s0 = spB4->unk_00;
|
||||
if (iREG(86) != 0)
|
||||
{
|
||||
if (iREG(86) != 0) {
|
||||
phi_v1 = 0;
|
||||
while (phi_v1 < polygon2->num)
|
||||
{
|
||||
while (phi_v1 < polygon2->num) {
|
||||
if (phi_s0 == sp78)
|
||||
break;
|
||||
phi_v1++;
|
||||
sp78++;
|
||||
}
|
||||
|
||||
if (((iREG(86) == 1) && (iREG(89) > sp9C)) ||
|
||||
((iREG(86) == 2) && (iREG(89) == sp9C)))
|
||||
{
|
||||
if (((iREG(86) == 1) && (iREG(89) > sp9C)) || ((iREG(86) == 2) && (iREG(89) == sp9C))) {
|
||||
if ((flags & 1) && (phi_s0->opa != NULL))
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, phi_s0->opa);
|
||||
|
||||
if ((flags & 2) && (phi_s0->xlu != NULL))
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, phi_s0->xlu);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if ((flags & 1) && (phi_s0->opa != NULL))
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, phi_s0->opa);
|
||||
|
||||
@@ -251,14 +224,12 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// long multiplication by 64 doesn't quite match
|
||||
s32 func_80096238(void* data)
|
||||
{
|
||||
s32 func_80096238(void* data) {
|
||||
OSTime timeBefore;
|
||||
OSTime timeAfter;
|
||||
OSTime time;
|
||||
|
||||
if (*(u32*)data == JPEG_MARKER)
|
||||
{
|
||||
if (*(u32*)data == JPEG_MARKER) {
|
||||
// Translates to: "EXPANDING JPEG DATA"
|
||||
osSyncPrintf("JPEGデータを展開します\n");
|
||||
// Translates to: "JPEG DATA ADDRESS %08x"
|
||||
@@ -267,8 +238,7 @@ s32 func_80096238(void* data)
|
||||
osSyncPrintf("ワークバッファアドレス(Zバッファ)%08x\n", gZBuffer);
|
||||
|
||||
timeBefore = osGetTime();
|
||||
if (!func_8006E418(data, gZBuffer, gGfxSPTaskOutputBuffer, sizeof(gGfxSPTaskOutputBuffer)))
|
||||
{
|
||||
if (!func_8006E418(data, gZBuffer, gGfxSPTaskOutputBuffer, sizeof(gGfxSPTaskOutputBuffer))) {
|
||||
timeAfter = osGetTime();
|
||||
time = ((timeAfter - timeBefore) * 64) / 3000;
|
||||
|
||||
@@ -280,9 +250,7 @@ s32 func_80096238(void* data)
|
||||
osSyncPrintf("元のバッファのサイズが150キロバイト無いと暴走するでしょう。\n");
|
||||
|
||||
bcopy(gZBuffer, data, sizeof(gZBuffer));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// Translates to: "FAILURE! WHY IS IT 〜"
|
||||
osSyncPrintf("失敗!なんで〜\n");
|
||||
}
|
||||
@@ -296,8 +264,8 @@ s32 func_80096238(void* data)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// pointer arithmetic doesn't quite match
|
||||
void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0, u16 tlutCount, f32 frameX, f32 frameY)
|
||||
{
|
||||
void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0,
|
||||
u16 tlutCount, f32 frameX, f32 frameY) {
|
||||
Gfx* displayListHead;
|
||||
uObjBg* bg;
|
||||
|
||||
@@ -305,7 +273,7 @@ void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 heigh
|
||||
func_80096238(SEGMENTED_TO_VIRTUAL(source));
|
||||
|
||||
displayListHead++;
|
||||
gSPBranchList(displayListHead, displayListHead+5);
|
||||
gSPBranchList(displayListHead, displayListHead + 5);
|
||||
bg = (void*)displayListHead;
|
||||
bg->b.imageX = 0;
|
||||
bg->b.imageW = width * 4;
|
||||
@@ -320,45 +288,36 @@ void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 heigh
|
||||
bg->b.imagePal = 0;
|
||||
bg->b.imageFlip = 0;
|
||||
|
||||
if (fmt == G_IM_FMT_CI)
|
||||
{
|
||||
displayListHead = (void*)(bg+1);
|
||||
if (fmt == G_IM_FMT_CI) {
|
||||
displayListHead = (void*)(bg + 1);
|
||||
gDPLoadTLUT(displayListHead++, tlutCount, 256, tlut);
|
||||
}
|
||||
else
|
||||
{
|
||||
displayListHead = (void*)(bg+1);
|
||||
} else {
|
||||
displayListHead = (void*)(bg + 1);
|
||||
gDPPipeSync(displayListHead++);
|
||||
}
|
||||
|
||||
if ((fmt == G_IM_FMT_RGBA) && (SREG(26) == 0))
|
||||
{
|
||||
if ((fmt == G_IM_FMT_RGBA) && (SREG(26) == 0)) {
|
||||
bg->b.frameW = width * 4;
|
||||
bg->b.frameH = height * 4;
|
||||
func_80104B00(bg);
|
||||
gDPSetOtherMode(displayListHead++,
|
||||
mode0 | G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT |
|
||||
G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_COPY | G_PM_NPRIMITIVE,
|
||||
mode0 | G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE |
|
||||
G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_COPY | G_PM_NPRIMITIVE,
|
||||
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2);
|
||||
gSPBgRectCopy(displayListHead++, bg);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
bg->s.frameW = width * 4;
|
||||
bg->s.frameH = height * 4;
|
||||
bg->s.scaleW = 1024;
|
||||
bg->s.scaleH = 1024;
|
||||
bg->s.imageYorig = bg->b.imageY;
|
||||
gDPSetOtherMode(displayListHead++,
|
||||
mode0 | G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT |
|
||||
G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_THRESHOLD | G_ZS_PIXEL | AA_EN |
|
||||
CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | ALPHA_CVG_SEL |
|
||||
GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA) |
|
||||
GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA));
|
||||
gDPSetCombineLERP(displayListHead++,
|
||||
0, 0, 0, TEXEL0, 0, 0, 0, 1,
|
||||
0, 0, 0, TEXEL0, 0, 0, 0, 1);
|
||||
mode0 | G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE |
|
||||
G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_THRESHOLD | G_ZS_PIXEL | AA_EN | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | ALPHA_CVG_SEL |
|
||||
GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA) |
|
||||
GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA));
|
||||
gDPSetCombineLERP(displayListHead++, 0, 0, 0, TEXEL0, 0, 0, 0, 1, 0, 0, 0, TEXEL0, 0, 0, 0, 1);
|
||||
gSPObjRenderMode(displayListHead++, 0x0C); // unknown object render mode?
|
||||
gSPBgRect1Cyc(displayListHead++, bg);
|
||||
}
|
||||
@@ -367,13 +326,13 @@ void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 heigh
|
||||
*displayList = displayListHead;
|
||||
}
|
||||
#else
|
||||
void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0, u16 tlutCount, f32 frameX, f32 frameY);
|
||||
void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0,
|
||||
u16 tlutCount, f32 frameX, f32 frameY);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_room/func_8009638C.s")
|
||||
#endif
|
||||
|
||||
// Room Draw Polygon Type 1 - Single Format
|
||||
void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
{
|
||||
void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
Camera* camera;
|
||||
Gfx* spA8;
|
||||
PolygonType1* polygon1;
|
||||
@@ -396,33 +355,27 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
sp94 = (flags & 1) && polygonDlist->opa && !(SREG(25) & 2);
|
||||
sp90 = (flags & 2) && polygonDlist->xlu && !(SREG(25) & 4);
|
||||
|
||||
if (sp94 || sp98)
|
||||
{
|
||||
if (sp94 || sp98) {
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x03, room->segment);
|
||||
|
||||
if (sp94)
|
||||
{
|
||||
if (sp94) {
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, polygonDlist->opa);
|
||||
}
|
||||
|
||||
if (sp98)
|
||||
{
|
||||
if (sp98) {
|
||||
// gSPLoadUcodeL(gfxCtx->polyOpa.p++, rspS2DEX)?
|
||||
gSPLoadUcodeEx(gfxCtx->polyOpa.p++, D_00113070, D_001579A0, 0x800);
|
||||
|
||||
if (1)
|
||||
{
|
||||
if (1) {
|
||||
Vec3f sp60;
|
||||
spA8 = gfxCtx->polyOpa.p;
|
||||
func_8005AFB4(&sp60, camera);
|
||||
func_8009638C(&spA8, polygon1->single.source, polygon1->single.tlut,
|
||||
polygon1->single.width, polygon1->single.height,
|
||||
polygon1->single.fmt, polygon1->single.siz,
|
||||
func_8009638C(&spA8, polygon1->single.source, polygon1->single.tlut, polygon1->single.width,
|
||||
polygon1->single.height, polygon1->single.fmt, polygon1->single.siz,
|
||||
polygon1->single.mode0, polygon1->single.tlutCount,
|
||||
(sp60.x + sp60.z) * 1.2f + sp60.y * 0.6f,
|
||||
sp60.y * 2.4f + (sp60.x + sp60.z) * 0.3f);
|
||||
(sp60.x + sp60.z) * 1.2f + sp60.y * 0.6f, sp60.y * 2.4f + (sp60.x + sp60.z) * 0.3f);
|
||||
gfxCtx->polyOpa.p = spA8;
|
||||
}
|
||||
|
||||
@@ -431,8 +384,7 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
}
|
||||
}
|
||||
|
||||
if (sp90)
|
||||
{
|
||||
if (sp90) {
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x03, room->segment);
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
@@ -442,16 +394,14 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_room.c", 691);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
char unk_00[0x0E];
|
||||
s16 unk_0E;
|
||||
s16 unk_0E;
|
||||
} struct_80041C10_ret;
|
||||
|
||||
extern struct_80041C10_ret* func_80041C10(CollisionContext*, s32, s32);
|
||||
|
||||
BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx)
|
||||
{
|
||||
BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) {
|
||||
Camera* camera;
|
||||
s32 camId;
|
||||
s16 camId2;
|
||||
@@ -462,17 +412,18 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx)
|
||||
camera = globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0];
|
||||
camId = camera->unk_148;
|
||||
camId2 = func_80041C10(&globalCtx->colCtx, camId, 50)->unk_0E;
|
||||
if (camId2 >= 0)
|
||||
if (camId2 >= 0) {
|
||||
camId = camId2;
|
||||
}
|
||||
|
||||
player = PLAYER;
|
||||
player->actor.params = (player->actor.params & 0xFF00) | camId;
|
||||
|
||||
bgImage = SEGMENTED_TO_VIRTUAL(polygon1->multi.list);
|
||||
for (i = 0; i < polygon1->multi.count; i++)
|
||||
{
|
||||
if (bgImage->id == camId)
|
||||
for (i = 0; i < polygon1->multi.count; i++) {
|
||||
if (bgImage->id == camId) {
|
||||
return bgImage;
|
||||
}
|
||||
bgImage++;
|
||||
}
|
||||
|
||||
@@ -486,8 +437,7 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx)
|
||||
// Room Draw Polygon Type 1 - Multi Format
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc differences
|
||||
void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
{
|
||||
void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
Camera* camera;
|
||||
Gfx* spA8;
|
||||
BgImage* bgImage;
|
||||
@@ -512,33 +462,26 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
sp90 = (flags & 1) && polygonDlist->opa && !(SREG(25) & 2);
|
||||
sp8C = (flags & 2) && polygonDlist->xlu && !(SREG(25) & 4);
|
||||
|
||||
if (sp90 || sp94)
|
||||
{
|
||||
if (sp90 || sp94) {
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x03, room->segment);
|
||||
|
||||
if (sp90)
|
||||
{
|
||||
if (sp90) {
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, polygonDlist->opa);
|
||||
}
|
||||
|
||||
if (sp94)
|
||||
{
|
||||
if (sp94) {
|
||||
// gSPLoadUcodeL(gfxCtx->polyOpa.p++, rspS2DEX)?
|
||||
gSPLoadUcodeEx(gfxCtx->polyOpa.p++, D_00113070, D_001579A0, 0x800);
|
||||
|
||||
if (1)
|
||||
{
|
||||
if (1) {
|
||||
Vec3f sp5C;
|
||||
spA8 = gfxCtx->polyOpa.p;
|
||||
func_8005AFB4(&sp5C, camera);
|
||||
func_8009638C(&spA8, bgImage->source, bgImage->tlut,
|
||||
bgImage->width, bgImage->height,
|
||||
bgImage->fmt, bgImage->siz,
|
||||
bgImage->mode0, bgImage->tlutCount,
|
||||
(sp5C.x + sp5C.z) * 1.2f + sp5C.y * 0.6f,
|
||||
sp5C.y * 2.4f + (sp5C.x + sp5C.z) * 0.3f);
|
||||
func_8009638C(&spA8, bgImage->source, bgImage->tlut, bgImage->width, bgImage->height, bgImage->fmt,
|
||||
bgImage->siz, bgImage->mode0, bgImage->tlutCount,
|
||||
(sp5C.x + sp5C.z) * 1.2f + sp5C.y * 0.6f, sp5C.y * 2.4f + (sp5C.x + sp5C.z) * 0.3f);
|
||||
gfxCtx->polyOpa.p = spA8;
|
||||
}
|
||||
|
||||
@@ -547,8 +490,7 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
}
|
||||
}
|
||||
|
||||
if (sp8C)
|
||||
{
|
||||
if (sp8C) {
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x03, room->segment);
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
@@ -562,28 +504,26 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
#endif
|
||||
|
||||
// Room Draw Polygon Type 1
|
||||
void func_80096F6C(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
{
|
||||
void func_80096F6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
PolygonType1* polygon1 = &room->mesh->polygon1;
|
||||
|
||||
if (polygon1->format == 1)
|
||||
if (polygon1->format == 1) {
|
||||
func_80096680(globalCtx, room, flags);
|
||||
else if (polygon1->format == 2)
|
||||
} else if (polygon1->format == 2) {
|
||||
func_80096B6C(globalCtx, room, flags);
|
||||
else
|
||||
} else {
|
||||
LogUtils_HungupThread("../z_room.c", 841);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80096FD4(GlobalContext* globalCtx, Room* room)
|
||||
{
|
||||
void func_80096FD4(GlobalContext* globalCtx, Room* room) {
|
||||
room->num = -1;
|
||||
room->segment = NULL;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc differences
|
||||
u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx)
|
||||
{
|
||||
u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
RomFile* roomList;
|
||||
TransitionActorEntry* transitionActor;
|
||||
s32 i, j;
|
||||
@@ -598,30 +538,27 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx)
|
||||
|
||||
maxRoomSize = 0;
|
||||
roomList = globalCtx->roomList;
|
||||
for (i = 0; i < globalCtx->nbRooms; i++)
|
||||
{
|
||||
for (i = 0; i < globalCtx->nbRooms; i++) {
|
||||
roomSize = roomList[i].vromEnd - roomList[i].vromStart;
|
||||
osSyncPrintf("ROOM%d size=%d\n", i, roomSize);
|
||||
if (maxRoomSize < roomSize)
|
||||
maxRoomSize = roomSize;
|
||||
}
|
||||
|
||||
if (globalCtx->nbTransitionActors != 0)
|
||||
{
|
||||
if (globalCtx->nbTransitionActors != 0) {
|
||||
j = 0;
|
||||
roomList = globalCtx->roomList;
|
||||
transitionActor = &globalCtx->transitionActorList[0];
|
||||
LogUtils_LogThreadId("../z_room.c", 912);
|
||||
osSyncPrintf("game_play->room_rom_address.num = %d\n", globalCtx->nbRooms);
|
||||
for (j = 0; j < globalCtx->nbTransitionActors; j++)
|
||||
{
|
||||
for (j = 0; j < globalCtx->nbTransitionActors; j++) {
|
||||
frontRoom = transitionActor->frontRoom;
|
||||
backRoom = transitionActor->backRoom;
|
||||
frontRoomSize = (frontRoom < 0) ? 0 : roomList[frontRoom].vromEnd - roomList[frontRoom].vromStart;
|
||||
backRoomSize = (backRoom < 0) ? 0 : roomList[backRoom].vromEnd - roomList[backRoom].vromStart;
|
||||
cumulRoomSize = (frontRoom != backRoom) ? frontRoomSize + backRoomSize : frontRoomSize;
|
||||
osSyncPrintf("DOOR%d=<%d> ROOM1=<%d, %d> ROOM2=<%d, %d>\n",
|
||||
j, cumulRoomSize, frontRoom, frontRoomSize, backRoom, backRoomSize);
|
||||
osSyncPrintf("DOOR%d=<%d> ROOM1=<%d, %d> ROOM2=<%d, %d>\n", j, cumulRoomSize, frontRoom, frontRoomSize,
|
||||
backRoom, backRoomSize);
|
||||
if (maxRoomSize < cumulRoomSize)
|
||||
maxRoomSize = cumulRoomSize;
|
||||
transitionActor++;
|
||||
@@ -642,7 +579,7 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx)
|
||||
roomCtx->status = 0;
|
||||
|
||||
if (gSaveContext.respawn_flag > 0)
|
||||
nextRoomNum = gSaveContext.respawn[gSaveContext.respawn_flag-1].room_index;
|
||||
nextRoomNum = gSaveContext.respawn[gSaveContext.respawn_flag - 1].room_index;
|
||||
else
|
||||
nextRoomNum = globalCtx->setupEntranceList[globalCtx->curSpawn].room;
|
||||
func_8009728C(globalCtx, roomCtx, nextRoomNum);
|
||||
@@ -653,30 +590,29 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_room/func_80096FE8.s")
|
||||
#endif
|
||||
|
||||
s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum)
|
||||
{
|
||||
s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum) {
|
||||
u32 size;
|
||||
|
||||
if (0) ; // Necessary to match
|
||||
if (0) {} // Necessary to match
|
||||
|
||||
if (roomCtx->status == 0)
|
||||
{
|
||||
if (roomCtx->status == 0) {
|
||||
roomCtx->prevRoom = roomCtx->curRoom;
|
||||
roomCtx->curRoom.num = roomNum;
|
||||
roomCtx->curRoom.segment = NULL;
|
||||
roomCtx->status = 1;
|
||||
|
||||
if (roomNum >= globalCtx->nbRooms)
|
||||
if (roomNum >= globalCtx->nbRooms) {
|
||||
__assert("read_room_ID < game_play->room_rom_address.num", "../z_room.c", 1009);
|
||||
}
|
||||
|
||||
size = globalCtx->roomList[roomNum].vromEnd - globalCtx->roomList[roomNum].vromStart;
|
||||
roomCtx->unk_34 = (void*)ALIGN16((s32)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7));
|
||||
|
||||
if (0) ; // Also necessary to match
|
||||
if (0) {} // Also necessary to match
|
||||
|
||||
osCreateMesgQueue(&roomCtx->loadQueue, &roomCtx->loadMsg, 1);
|
||||
DmaMgr_SendRequest2(&roomCtx->dmaRequest, roomCtx->unk_34, globalCtx->roomList[roomNum].vromStart, size,
|
||||
0, &roomCtx->loadQueue, NULL, "../z_room.c", 1036);
|
||||
DmaMgr_SendRequest2(&roomCtx->dmaRequest, roomCtx->unk_34, globalCtx->roomList[roomNum].vromStart, size, 0,
|
||||
&roomCtx->loadQueue, NULL, "../z_room.c", 1036);
|
||||
roomCtx->unk_30 ^= 1;
|
||||
|
||||
return 1;
|
||||
@@ -685,12 +621,9 @@ s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum)
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx)
|
||||
{
|
||||
if (roomCtx->status == 1)
|
||||
{
|
||||
if (!osRecvMesg(&roomCtx->loadQueue, NULL, OS_MESG_NOBLOCK))
|
||||
{
|
||||
s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
if (roomCtx->status == 1) {
|
||||
if (!osRecvMesg(&roomCtx->loadQueue, NULL, OS_MESG_NOBLOCK)) {
|
||||
roomCtx->status = 0;
|
||||
roomCtx->curRoom.segment = roomCtx->unk_34;
|
||||
gSegments[3] = PHYSICAL_TO_VIRTUAL2(roomCtx->unk_34);
|
||||
@@ -708,25 +641,24 @@ s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags)
|
||||
{
|
||||
if (room->segment != NULL)
|
||||
{
|
||||
void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
if (room->segment != NULL) {
|
||||
gSegments[3] = PHYSICAL_TO_VIRTUAL(room->segment);
|
||||
if (room->mesh->polygon.type >= ARRAY_COUNTU(sRoomDrawHandlers))
|
||||
if (room->mesh->polygon.type >= ARRAY_COUNTU(sRoomDrawHandlers)) {
|
||||
__assert("this->ground_shape->polygon.type < number(Room_Draw_Proc)", "../z_room.c", 1125);
|
||||
}
|
||||
sRoomDrawHandlers[room->mesh->polygon.type](globalCtx, room, flags);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80097534(GlobalContext* globalCtx, RoomContext* roomCtx)
|
||||
{
|
||||
void func_80097534(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
roomCtx->prevRoom.num = -1;
|
||||
roomCtx->prevRoom.segment = NULL;
|
||||
func_80031B14(globalCtx, &globalCtx->actorCtx);
|
||||
Actor_SpawnTransitionActors(globalCtx, &globalCtx->actorCtx);
|
||||
func_80080E04(globalCtx, roomCtx->curRoom.num);
|
||||
if (!((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_SPOT20)))
|
||||
if (!((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_SPOT20))) {
|
||||
func_800807A0(globalCtx);
|
||||
}
|
||||
func_800F66C0(globalCtx->roomCtx.curRoom.echo);
|
||||
}
|
||||
|
||||
+9
-18
@@ -2,10 +2,8 @@
|
||||
#include <global.h>
|
||||
#include <PR/os_cont.h>
|
||||
|
||||
void Sample_Calc(SampleContext* this)
|
||||
{
|
||||
if (!~(this->state.input[0].padPressed | ~START_BUTTON))
|
||||
{
|
||||
void Sample_Calc(SampleContext* this) {
|
||||
if (!~(this->state.input[0].padPressed | ~START_BUTTON)) {
|
||||
SET_NEXT_GAMESTATE(&this->state, func_800BCA64, GlobalContext);
|
||||
this->state.running = false;
|
||||
}
|
||||
@@ -13,8 +11,7 @@ void Sample_Calc(SampleContext* this)
|
||||
|
||||
// very close from matching, the only difference is the place of "mtx" in the stack
|
||||
#ifdef NON_MATCHING
|
||||
void Sample_Draw(SampleContext* this)
|
||||
{
|
||||
void Sample_Draw(SampleContext* this) {
|
||||
u32 pad;
|
||||
GraphicsContext* gfxCtx = this->state.gfxCtx;
|
||||
View* view = &this->view;
|
||||
@@ -49,19 +46,15 @@ void Sample_Draw(SampleContext* this)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sample/Sample_Draw.s")
|
||||
#endif
|
||||
|
||||
void Sample_Update(SampleContext* this)
|
||||
{
|
||||
void Sample_Update(SampleContext* this) {
|
||||
Sample_Draw(this);
|
||||
Sample_Calc(this);
|
||||
}
|
||||
|
||||
void Sample_Destroy(SampleContext* this)
|
||||
{
|
||||
|
||||
void Sample_Destroy(SampleContext* this) {
|
||||
}
|
||||
|
||||
void Sample_SetupView(SampleContext* this)
|
||||
{
|
||||
void Sample_SetupView(SampleContext* this) {
|
||||
View* view;
|
||||
GraphicsContext* gfxCtx;
|
||||
u32 v0[4];
|
||||
@@ -94,16 +87,14 @@ void Sample_SetupView(SampleContext* this)
|
||||
func_800AA358(view, &v1, &v2, &v3);
|
||||
}
|
||||
|
||||
void Sample_LoadTitleStatic(SampleContext* this)
|
||||
{
|
||||
void Sample_LoadTitleStatic(SampleContext* this) {
|
||||
u32 size = _title_staticSegmentRomEnd - _title_staticSegmentRomStart;
|
||||
|
||||
|
||||
this->staticSegment = Game_Alloc(&this->state, size, "../z_sample.c", 163);
|
||||
DmaMgr_SendRequest1(this->staticSegment, _title_staticSegmentRomStart, size, "../z_sample.c", 164);
|
||||
}
|
||||
|
||||
void Sample_Init(SampleContext* this)
|
||||
{
|
||||
void Sample_Init(SampleContext* this) {
|
||||
this->state.main = Sample_Update;
|
||||
this->state.destroy = Sample_Destroy;
|
||||
R_UPDATE_RATE = 1;
|
||||
|
||||
+142
-212
@@ -4,26 +4,31 @@
|
||||
|
||||
RomFile sNaviMsgFiles[];
|
||||
|
||||
s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId)
|
||||
{
|
||||
s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId) {
|
||||
u32 size;
|
||||
|
||||
objectCtx->status[objectCtx->num].id = objectId;
|
||||
size = gObjectTable[objectId].vromEnd - gObjectTable[objectId].vromStart;
|
||||
|
||||
osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n",
|
||||
objectId, (f64)(size / 1024.0f), objectCtx->status[objectCtx->num].segment);
|
||||
osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n", objectId, (f64)(size / 1024.0f),
|
||||
objectCtx->status[objectCtx->num].segment);
|
||||
|
||||
osSyncPrintf("num=%d adrs=%x end=%x\n",
|
||||
objectCtx->num, (s32)objectCtx->status[objectCtx->num].segment + size, objectCtx->spaceEnd);
|
||||
osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->num, (s32)objectCtx->status[objectCtx->num].segment + size,
|
||||
objectCtx->spaceEnd);
|
||||
|
||||
if (!((objectCtx->num < OBJECT_EXCHANGE_BANK_MAX) && (((s32)objectCtx->status[objectCtx->num].segment + size) < (s32)objectCtx->spaceEnd)))
|
||||
__assert("this->num < OBJECT_EXCHANGE_BANK_MAX && (this->status[this->num].Segment + size) < this->endSegment", "../z_scene.c", 142);
|
||||
if (!((objectCtx->num < OBJECT_EXCHANGE_BANK_MAX) &&
|
||||
(((s32)objectCtx->status[objectCtx->num].segment + size) < (s32)objectCtx->spaceEnd))) {
|
||||
__assert("this->num < OBJECT_EXCHANGE_BANK_MAX && (this->status[this->num].Segment + size) < this->endSegment",
|
||||
"../z_scene.c", 142);
|
||||
}
|
||||
|
||||
DmaMgr_SendRequest1(objectCtx->status[objectCtx->num].segment, gObjectTable[objectId].vromStart, size, "../z_scene.c", 145);
|
||||
DmaMgr_SendRequest1(objectCtx->status[objectCtx->num].segment, gObjectTable[objectId].vromStart, size,
|
||||
"../z_scene.c", 145);
|
||||
|
||||
if (objectCtx->num < OBJECT_EXCHANGE_BANK_MAX - 1)
|
||||
objectCtx->status[objectCtx->num + 1].segment = (void*)ALIGN16((s32)objectCtx->status[objectCtx->num].segment + size);
|
||||
if (objectCtx->num < OBJECT_EXCHANGE_BANK_MAX - 1) {
|
||||
objectCtx->status[objectCtx->num + 1].segment =
|
||||
(void*)ALIGN16((s32)objectCtx->status[objectCtx->num].segment + size);
|
||||
}
|
||||
|
||||
objectCtx->num++;
|
||||
objectCtx->unk_09 = objectCtx->num;
|
||||
@@ -31,35 +36,33 @@ s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId)
|
||||
return objectCtx->num - 1;
|
||||
}
|
||||
|
||||
void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx)
|
||||
{
|
||||
void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx) {
|
||||
GlobalContext* globalCtx2 = globalCtx; // Needs to be a new variable to match (possibly a sub struct?)
|
||||
u32 spaceSize;
|
||||
s32 i;
|
||||
|
||||
if (globalCtx2->sceneNum == SCENE_SPOT00)
|
||||
if (globalCtx2->sceneNum == SCENE_SPOT00) {
|
||||
spaceSize = 1024000;
|
||||
else if (globalCtx2->sceneNum == SCENE_GANON_DEMO)
|
||||
{
|
||||
if (gSaveContext.scene_setup_index != 4)
|
||||
} else if (globalCtx2->sceneNum == SCENE_GANON_DEMO) {
|
||||
if (gSaveContext.scene_setup_index != 4) {
|
||||
spaceSize = 1177600;
|
||||
else
|
||||
} else {
|
||||
spaceSize = 1024000;
|
||||
}
|
||||
else if (globalCtx2->sceneNum == SCENE_JYASINBOSS)
|
||||
}
|
||||
} else if (globalCtx2->sceneNum == SCENE_JYASINBOSS) {
|
||||
spaceSize = 1075200;
|
||||
else if (globalCtx2->sceneNum == SCENE_KENJYANOMA)
|
||||
} else if (globalCtx2->sceneNum == SCENE_KENJYANOMA) {
|
||||
spaceSize = 1075200;
|
||||
else if (globalCtx2->sceneNum == SCENE_GANON_BOSS)
|
||||
} else if (globalCtx2->sceneNum == SCENE_GANON_BOSS) {
|
||||
spaceSize = 1075200;
|
||||
else
|
||||
} else {
|
||||
spaceSize = 1024000;
|
||||
}
|
||||
|
||||
objectCtx->num = objectCtx->unk_09 = 0;
|
||||
objectCtx->mainKeepIndex = objectCtx->subKeepIndex = 0;
|
||||
|
||||
for (i = 0; i < OBJECT_EXCHANGE_BANK_MAX; i++)
|
||||
{
|
||||
for (i = 0; i < OBJECT_EXCHANGE_BANK_MAX; i++) {
|
||||
objectCtx->status[i].id = 0;
|
||||
}
|
||||
|
||||
@@ -68,37 +71,32 @@ void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx)
|
||||
osSyncPrintf("オブジェクト入れ替えバンク情報 %8.3fKB\n", (f64)(spaceSize / 1024.0f));
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
objectCtx->spaceStart = objectCtx->status[0].segment = Game_Alloc(&globalCtx->state, spaceSize, "../z_scene.c", 219);
|
||||
objectCtx->spaceStart = objectCtx->status[0].segment =
|
||||
Game_Alloc(&globalCtx->state, spaceSize, "../z_scene.c", 219);
|
||||
objectCtx->spaceEnd = (void*)((s32)objectCtx->spaceStart + spaceSize);
|
||||
|
||||
objectCtx->mainKeepIndex = Object_Spawn(objectCtx, OBJECT_GAMEPLAY_KEEP);
|
||||
gSegments[4] = PHYSICAL_TO_VIRTUAL(objectCtx->status[objectCtx->mainKeepIndex].segment);
|
||||
}
|
||||
|
||||
void Object_UpdateBank(ObjectContext* objectCtx)
|
||||
{
|
||||
void Object_UpdateBank(ObjectContext* objectCtx) {
|
||||
s32 i;
|
||||
ObjectStatus* status;
|
||||
RomFile* objectFile;
|
||||
u32 size;
|
||||
|
||||
status = &objectCtx->status[0];
|
||||
for (i = 0; i < objectCtx->num; i++)
|
||||
{
|
||||
if (status->id < 0)
|
||||
{
|
||||
if (status->dmaRequest.vromAddr == 0)
|
||||
{
|
||||
for (i = 0; i < objectCtx->num; i++) {
|
||||
if (status->id < 0) {
|
||||
if (status->dmaRequest.vromAddr == 0) {
|
||||
osCreateMesgQueue(&status->loadQueue, &status->loadMsg, 1);
|
||||
objectFile = &gObjectTable[-status->id];
|
||||
size = objectFile->vromEnd - objectFile->vromStart;
|
||||
osSyncPrintf("OBJECT EXCHANGE BANK-%2d SIZE %8.3fK SEG=%08x\n",
|
||||
i, (f64)(size / 1024.0f), status->segment);
|
||||
DmaMgr_SendRequest2(&status->dmaRequest, status->segment, objectFile->vromStart, size,
|
||||
0, &status->loadQueue, NULL, "../z_scene.c", 266);
|
||||
}
|
||||
else if (!osRecvMesg(&status->loadQueue, NULL, OS_MESG_NOBLOCK))
|
||||
{
|
||||
osSyncPrintf("OBJECT EXCHANGE BANK-%2d SIZE %8.3fK SEG=%08x\n", i, (f64)(size / 1024.0f),
|
||||
status->segment);
|
||||
DmaMgr_SendRequest2(&status->dmaRequest, status->segment, objectFile->vromStart, size, 0,
|
||||
&status->loadQueue, NULL, "../z_scene.c", 266);
|
||||
} else if (!osRecvMesg(&status->loadQueue, NULL, OS_MESG_NOBLOCK)) {
|
||||
status->id = -status->id;
|
||||
}
|
||||
}
|
||||
@@ -106,47 +104,43 @@ void Object_UpdateBank(ObjectContext* objectCtx)
|
||||
}
|
||||
}
|
||||
|
||||
s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId)
|
||||
{
|
||||
s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < objectCtx->num; i++)
|
||||
{
|
||||
if (ABS(objectCtx->status[i].id) == objectId)
|
||||
for (i = 0; i < objectCtx->num; i++) {
|
||||
if (ABS(objectCtx->status[i].id) == objectId) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
s32 Object_IsLoaded(ObjectContext* objectCtx, s32 bankIndex)
|
||||
{
|
||||
if (objectCtx->status[bankIndex].id > 0)
|
||||
s32 Object_IsLoaded(ObjectContext* objectCtx, s32 bankIndex) {
|
||||
if (objectCtx->status[bankIndex].id > 0) {
|
||||
return 1;
|
||||
else
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void func_800981B8(ObjectContext* objectCtx)
|
||||
{
|
||||
void func_800981B8(ObjectContext* objectCtx) {
|
||||
s32 i;
|
||||
s32 id;
|
||||
u32 size;
|
||||
|
||||
for (i = 0; i < objectCtx->num; i++)
|
||||
{
|
||||
for (i = 0; i < objectCtx->num; i++) {
|
||||
id = objectCtx->status[i].id;
|
||||
size = gObjectTable[id].vromEnd - gObjectTable[id].vromStart;
|
||||
osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n",
|
||||
objectCtx->status[i].id, (f64)(size / 1024.0f), objectCtx->status[i].segment);
|
||||
osSyncPrintf("num=%d adrs=%x end=%x\n",
|
||||
objectCtx->num, (s32)objectCtx->status[i].segment + size, objectCtx->spaceEnd);
|
||||
osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n", objectCtx->status[i].id, (f64)(size / 1024.0f),
|
||||
objectCtx->status[i].segment);
|
||||
osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->num, (s32)objectCtx->status[i].segment + size,
|
||||
objectCtx->spaceEnd);
|
||||
DmaMgr_SendRequest1(objectCtx->status[i].segment, gObjectTable[id].vromStart, size, "../z_scene.c", 342);
|
||||
}
|
||||
}
|
||||
|
||||
void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId)
|
||||
{
|
||||
void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId) {
|
||||
ObjectStatus* status = &objectCtx->status[bankIndex];
|
||||
RomFile* objectFile = &gObjectTable[objectId];
|
||||
u32 size;
|
||||
@@ -156,14 +150,15 @@ void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId)
|
||||
status->dmaRequest.vromAddr = 0;
|
||||
|
||||
size = objectFile->vromEnd - objectFile->vromStart;
|
||||
osSyncPrintf("OBJECT EXCHANGE NO=%2d BANK=%3d SIZE=%8.3fK\n",
|
||||
bankIndex, objectId, (f64)(size / 1024.0f));
|
||||
osSyncPrintf("OBJECT EXCHANGE NO=%2d BANK=%3d SIZE=%8.3fK\n", bankIndex, objectId, (f64)(size / 1024.0f));
|
||||
|
||||
if (1) // Necessary to match
|
||||
if (1) { // Necessary to match
|
||||
nextPtr = (void*)ALIGN16((s32)status->segment + size);
|
||||
}
|
||||
|
||||
if (nextPtr >= objectCtx->spaceEnd)
|
||||
if (nextPtr >= objectCtx->spaceEnd) {
|
||||
__assert("nextptr < this->endSegment", "../z_scene.c", 381);
|
||||
}
|
||||
|
||||
// Translates to: "OBJECT EXCHANGE FREE SIZE=%08x"
|
||||
osSyncPrintf("オブジェクト入れ替え空きサイズ=%08x\n", (s32)objectCtx->spaceEnd - (s32)nextPtr);
|
||||
@@ -171,25 +166,21 @@ void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId)
|
||||
return nextPtr;
|
||||
}
|
||||
|
||||
s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd)
|
||||
{
|
||||
s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd) {
|
||||
u32 cmdCode;
|
||||
|
||||
while (1)
|
||||
{
|
||||
while (1) {
|
||||
cmdCode = sceneCmd->base.code;
|
||||
osSyncPrintf("*** Scene_Word = { code=%d, data1=%02x, data2=%04x } ***\n",
|
||||
cmdCode, sceneCmd->base.data1, sceneCmd->base.data2);
|
||||
osSyncPrintf("*** Scene_Word = { code=%d, data1=%02x, data2=%04x } ***\n", cmdCode, sceneCmd->base.data1,
|
||||
sceneCmd->base.data2);
|
||||
|
||||
if (cmdCode == 0x14)
|
||||
if (cmdCode == 0x14) {
|
||||
break;
|
||||
|
||||
if (cmdCode <= 0x19)
|
||||
{
|
||||
gSceneCmdHandlers[cmdCode](globalCtx, sceneCmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (cmdCode <= 0x19) {
|
||||
gSceneCmdHandlers[cmdCode](globalCtx, sceneCmd);
|
||||
} else {
|
||||
osSyncPrintf(VT_FGCOL(RED));
|
||||
// Translates to: "code VARIABLE IS ABNORMAL"
|
||||
osSyncPrintf("code の値が異常です\n");
|
||||
@@ -205,8 +196,7 @@ s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd)
|
||||
// Scene Command 0x00: Link Spawn List
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc differences
|
||||
void func_80098508(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_80098508(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
ActorEntry* linkEntry = (ActorEntry*)SEGMENTED_TO_VIRTUAL(cmd->spawnList.segment) +
|
||||
globalCtx->setupEntranceList[globalCtx->curSpawn].spawn;
|
||||
s16 linkObjectId;
|
||||
@@ -227,21 +217,18 @@ void func_80098508(GlobalContext* globalCtx, SceneCmd* cmd);
|
||||
#endif
|
||||
|
||||
// Scene Command 0x01: Actor List
|
||||
void func_800985DC(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_800985DC(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->nbSetupActors = cmd->actorList.num;
|
||||
globalCtx->setupActorList = SEGMENTED_TO_VIRTUAL(cmd->actorList.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x02: Cutscene Camera List
|
||||
void func_80098630(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_80098630(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->unk_11DFC = SEGMENTED_TO_VIRTUAL(cmd->csCameraList.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x03: Collision Header
|
||||
void func_80098674(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_80098674(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
CollisionHeader* colHeader;
|
||||
|
||||
colHeader = SEGMENTED_TO_VIRTUAL(cmd->colHeader.segment);
|
||||
@@ -256,34 +243,30 @@ void func_80098674(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
}
|
||||
|
||||
// Scene Command 0x04: Room List
|
||||
void func_800987A4(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_800987A4(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->nbRooms = cmd->roomList.num;
|
||||
globalCtx->roomList = SEGMENTED_TO_VIRTUAL(cmd->roomList.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x06: Entrance List
|
||||
void func_800987F8(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_800987F8(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->setupEntranceList = SEGMENTED_TO_VIRTUAL(cmd->entranceList.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x07: Special Files
|
||||
void func_8009883C(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
if (cmd->specialFiles.keepObjectId != 0)
|
||||
{
|
||||
void func_8009883C(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
if (cmd->specialFiles.keepObjectId != 0) {
|
||||
globalCtx->objectCtx.subKeepIndex = Object_Spawn(&globalCtx->objectCtx, cmd->specialFiles.keepObjectId);
|
||||
gSegments[5] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment);
|
||||
}
|
||||
|
||||
if (cmd->specialFiles.naviMsgNum != 0)
|
||||
if (cmd->specialFiles.naviMsgNum != 0) {
|
||||
globalCtx->naviMsgSegment = func_800BFE5C(globalCtx, &sNaviMsgFiles[cmd->specialFiles.naviMsgNum - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
// Scene Command 0x08: Room Behavior
|
||||
void func_80098904(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_80098904(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->roomCtx.curRoom.unk_03 = cmd->roomBehavior.gpFlag1;
|
||||
globalCtx->roomCtx.curRoom.unk_02 = cmd->roomBehavior.gpFlag2 & 0xFF;
|
||||
globalCtx->roomCtx.curRoom.showInvisActors = (cmd->roomBehavior.gpFlag2 >> 8) & 1;
|
||||
@@ -291,16 +274,14 @@ void func_80098904(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
}
|
||||
|
||||
// Scene Command 0x0A: Mesh Header
|
||||
void func_80098958(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_80098958(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->roomCtx.curRoom.mesh = SEGMENTED_TO_VIRTUAL(cmd->mesh.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x0B: Object List
|
||||
#ifdef NON_MATCHING
|
||||
// this function still needs some work
|
||||
void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
s32 i, j, k;
|
||||
s16* objectEntry;
|
||||
ObjectStatus* status;
|
||||
@@ -313,21 +294,16 @@ void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
k = 0;
|
||||
status = status2;
|
||||
i = globalCtx->objectCtx.unk_09;
|
||||
while (i < globalCtx->objectCtx.num)
|
||||
{
|
||||
if (status->id != *objectEntry)
|
||||
{
|
||||
while (i < globalCtx->objectCtx.num) {
|
||||
if (status->id != *objectEntry) {
|
||||
status3 = status2;
|
||||
for (j = i; j < globalCtx->objectCtx.num; j++)
|
||||
{
|
||||
for (j = i; j < globalCtx->objectCtx.num; j++) {
|
||||
status3->id = 0;
|
||||
status3++;
|
||||
}
|
||||
globalCtx->objectCtx.num = i;
|
||||
func_80031A28(globalCtx, &globalCtx->actorCtx);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
i++;
|
||||
status++;
|
||||
k++;
|
||||
@@ -339,8 +315,7 @@ void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
if (cmd->objectList.num > OBJECT_EXCHANGE_BANK_MAX)
|
||||
__assert("scene_info->object_bank.num <= OBJECT_EXCHANGE_BANK_MAX", "../z_scene.c", 705);
|
||||
|
||||
while (k < cmd->objectList.num)
|
||||
{
|
||||
while (k < cmd->objectList.num) {
|
||||
nextPtr = func_800982FC(&globalCtx->objectCtx, i, *objectEntry);
|
||||
if (i < OBJECT_EXCHANGE_BANK_MAX - 1)
|
||||
globalCtx->objectCtx.status[i + 1].segment = nextPtr;
|
||||
@@ -357,75 +332,69 @@ void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd);
|
||||
#endif
|
||||
|
||||
// Scene Command 0x0C: Light List
|
||||
void func_80098B74(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_80098B74(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
s32 i;
|
||||
LightInfo* lightInfo;
|
||||
|
||||
lightInfo = SEGMENTED_TO_VIRTUAL(cmd->lightList.segment);
|
||||
for (i = 0; i < cmd->lightList.num; i++)
|
||||
{
|
||||
for (i = 0; i < cmd->lightList.num; i++) {
|
||||
Lights_Insert(globalCtx, &globalCtx->lightCtx, lightInfo);
|
||||
lightInfo++;
|
||||
}
|
||||
}
|
||||
|
||||
// Scene Command 0x0D: Path List
|
||||
void func_80098C24(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_80098C24(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->setupPathList = SEGMENTED_TO_VIRTUAL(cmd->pathList.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x0E: Transition Actor List
|
||||
void func_80098C68(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_80098C68(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->nbTransitionActors = cmd->transiActorList.num;
|
||||
globalCtx->transitionActorList = SEGMENTED_TO_VIRTUAL(cmd->transiActorList.segment);
|
||||
}
|
||||
|
||||
void func_80098CBC(GlobalContext* globalCtx, u8* nbTransitionActors)
|
||||
{
|
||||
void func_80098CBC(GlobalContext* globalCtx, u8* nbTransitionActors) {
|
||||
*nbTransitionActors = 0;
|
||||
}
|
||||
|
||||
// Scene Command 0x0F: Light Setting List
|
||||
void func_80098CC8(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_80098CC8(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->nbLightSettings = cmd->lightSettingList.num;
|
||||
globalCtx->lightSettingsList = SEGMENTED_TO_VIRTUAL(cmd->lightSettingList.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x11: Skybox Settings
|
||||
void func_80098D1C(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_80098D1C(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->skyboxId = cmd->skyboxSettings.skyboxId;
|
||||
globalCtx->gloomySky = globalCtx->unk_10A3C = cmd->skyboxSettings.unk_05;
|
||||
globalCtx->unk_10A42 = cmd->skyboxSettings.unk_06;
|
||||
}
|
||||
|
||||
// Scene Command 0x12: Skybox Disables
|
||||
void func_80098D5C(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_80098D5C(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->skyDisabled = cmd->skyboxDisables.unk_04;
|
||||
globalCtx->sunMoonDisabled = cmd->skyboxDisables.unk_05;
|
||||
}
|
||||
|
||||
// Scene Command 0x10: Time Settings
|
||||
void func_80098D80(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_80098D80(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
u32 dayTime;
|
||||
|
||||
if ((cmd->timeSettings.hour != 0xFF) && (cmd->timeSettings.min != 0xFF))
|
||||
if ((cmd->timeSettings.hour != 0xFF) && (cmd->timeSettings.min != 0xFF)) {
|
||||
gSaveContext.environment_time = gSaveContext.day_time =
|
||||
((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / 0.021972656f;
|
||||
}
|
||||
|
||||
if (cmd->timeSettings.unk_06 != 0xFF)
|
||||
if (cmd->timeSettings.unk_06 != 0xFF) {
|
||||
globalCtx->unk_10A26 = cmd->timeSettings.unk_06;
|
||||
else
|
||||
} else {
|
||||
globalCtx->unk_10A26 = 0;
|
||||
}
|
||||
|
||||
if (gSaveContext.unk_1422 == 0)
|
||||
if (gSaveContext.unk_1422 == 0) {
|
||||
D_8011FB40 = globalCtx->unk_10A26;
|
||||
}
|
||||
|
||||
dayTime = gSaveContext.day_time;
|
||||
globalCtx->unk_10A28 = -(Math_Sins(dayTime - 0x8000) * 120.0f) * 25.0f;
|
||||
@@ -435,23 +404,22 @@ void func_80098D80(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
globalCtx->unk_10A30 = (Math_Coss(dayTime - 0x8000) * 20.0f) * 25.0f;
|
||||
|
||||
if (((globalCtx->unk_10A26 == 0) && (gSaveContext.cutscene_index < 0xFFF0)) ||
|
||||
(gSaveContext.entrance_index == 0x0604))
|
||||
{
|
||||
(gSaveContext.entrance_index == 0x0604)) {
|
||||
gSaveContext.environment_time = gSaveContext.day_time;
|
||||
if ((gSaveContext.environment_time >= 0x2AAC) && (gSaveContext.environment_time < 0x4555))
|
||||
if ((gSaveContext.environment_time >= 0x2AAC) && (gSaveContext.environment_time < 0x4555)) {
|
||||
gSaveContext.environment_time = 0x3556;
|
||||
else if ((gSaveContext.environment_time >= 0x4555) && (gSaveContext.environment_time < 0x5556))
|
||||
} else if ((gSaveContext.environment_time >= 0x4555) && (gSaveContext.environment_time < 0x5556)) {
|
||||
gSaveContext.environment_time = 0x5556;
|
||||
else if ((gSaveContext.environment_time >= 0xAAAB) && (gSaveContext.environment_time < 0xB556))
|
||||
} else if ((gSaveContext.environment_time >= 0xAAAB) && (gSaveContext.environment_time < 0xB556)) {
|
||||
gSaveContext.environment_time = 0xB556;
|
||||
else if ((gSaveContext.environment_time >= 0xC001) && (gSaveContext.environment_time < 0xCAAC))
|
||||
} else if ((gSaveContext.environment_time >= 0xC001) && (gSaveContext.environment_time < 0xCAAC)) {
|
||||
gSaveContext.environment_time = 0xCAAC;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Scene Command 0x05: Wind Settings
|
||||
void func_80099090(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_80099090(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
s8 temp1 = cmd->windSettings.unk_04;
|
||||
s8 temp2 = cmd->windSettings.unk_05;
|
||||
s8 temp3 = cmd->windSettings.unk_06;
|
||||
@@ -463,38 +431,33 @@ void func_80099090(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
}
|
||||
|
||||
// Scene Command 0x13: Exit List
|
||||
void func_800990F0(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_800990F0(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->setupExitList = SEGMENTED_TO_VIRTUAL(cmd->exitList.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x09: Undefined
|
||||
void func_80099134(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
|
||||
void func_80099134(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// Scene Command 0x15: Sound Settings
|
||||
void func_80099140(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_80099140(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->soundCtx.musicSeq = cmd->soundSettings.musicSeq;
|
||||
globalCtx->soundCtx.nighttimeSFX = cmd->soundSettings.nighttimeSFX;
|
||||
|
||||
if (gSaveContext.seq_index == 0xFF)
|
||||
if (gSaveContext.seq_index == 0xFF) {
|
||||
Audio_SetBGM(cmd->soundSettings.bgmId | 0xF0000000);
|
||||
}
|
||||
}
|
||||
|
||||
// Scene Command 0x16: Echo Setting
|
||||
void func_8009918C(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_8009918C(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->roomCtx.curRoom.echo = cmd->echoSettings.echo;
|
||||
}
|
||||
|
||||
// Scene Command 0x18: Alternate Headers
|
||||
#ifdef NON_MATCHING
|
||||
// minor ordering and regalloc differences
|
||||
void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
SceneCmd** altHeaders;
|
||||
SceneCmd* altHeader;
|
||||
|
||||
@@ -502,31 +465,25 @@ void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
osSyncPrintf("\n[ZU]sceneset time =[%X]", gSaveContext.cutscene_index);
|
||||
osSyncPrintf("\n[ZU]sceneset counter=[%X]", gSaveContext.scene_setup_index);
|
||||
|
||||
if (gSaveContext.scene_setup_index != 0)
|
||||
{
|
||||
if (gSaveContext.scene_setup_index != 0) {
|
||||
altHeaders = SEGMENTED_TO_VIRTUAL(cmd->altHeaders.segment);
|
||||
altHeader = altHeaders[gSaveContext.scene_setup_index - 1];
|
||||
|
||||
if (altHeader != NULL)
|
||||
{
|
||||
if (altHeader != NULL) {
|
||||
Scene_ExecuteCommands(globalCtx, SEGMENTED_TO_VIRTUAL(altHeader));
|
||||
(cmd + 1)->base.code = 0x14;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// Translates to: "COUGHH! THERE IS NO SPECIFIED DATAAAAA!"
|
||||
osSyncPrintf("\nげぼはっ! 指定されたデータがないでええっす!");
|
||||
|
||||
if (gSaveContext.scene_setup_index == 3)
|
||||
{
|
||||
if (gSaveContext.scene_setup_index == 3) {
|
||||
altHeaders = SEGMENTED_TO_VIRTUAL(cmd->altHeaders.segment);
|
||||
altHeader = altHeaders[gSaveContext.scene_setup_index - 2];
|
||||
|
||||
// Translates to: "USING ADULT DAY DATA THERE!"
|
||||
osSyncPrintf("\nそこで、大人の昼データを使用するでええっす!!");
|
||||
|
||||
if (altHeader != NULL)
|
||||
{
|
||||
if (altHeader != NULL) {
|
||||
Scene_ExecuteCommands(globalCtx, SEGMENTED_TO_VIRTUAL(altHeader));
|
||||
(cmd + 1)->base.code = 0x14;
|
||||
}
|
||||
@@ -540,73 +497,47 @@ void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd);
|
||||
#endif
|
||||
|
||||
// Scene Command 0x17: Cutscene Data
|
||||
void func_8009934C(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_8009934C(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
osSyncPrintf("\ngame_play->demo_play.data=[%x]", globalCtx->csCtx.segment);
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(cmd->cutsceneData.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x19: Misc. Settings (Camera & World Map Area)
|
||||
void func_800993C0(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
{
|
||||
void func_800993C0(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
YREG(15) = cmd->miscSettings.cameraMovement;
|
||||
gSaveContext.world_map_area = cmd->miscSettings.area;
|
||||
|
||||
if ((globalCtx->sceneNum == SCENE_SHOP1) || (globalCtx->sceneNum == SCENE_SYATEKIJYOU))
|
||||
{
|
||||
if (LINK_AGE_IN_YEARS == YEARS_ADULT)
|
||||
{
|
||||
if ((globalCtx->sceneNum == SCENE_SHOP1) || (globalCtx->sceneNum == SCENE_SYATEKIJYOU)) {
|
||||
if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
|
||||
gSaveContext.world_map_area = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_GANON_TOU)) ||
|
||||
((globalCtx->sceneNum >= SCENE_ENTRA) && (globalCtx->sceneNum <= SCENE_SHRINE_R)))
|
||||
{
|
||||
if (gSaveContext.cutscene_index < 0xFFF0)
|
||||
{
|
||||
((globalCtx->sceneNum >= SCENE_ENTRA) && (globalCtx->sceneNum <= SCENE_SHRINE_R))) {
|
||||
if (gSaveContext.cutscene_index < 0xFFF0) {
|
||||
gSaveContext.world_map_area_data |= gBitFlags[gSaveContext.world_map_area];
|
||||
osSyncPrintf("000 area_arrival=%x (%d)\n", gSaveContext.world_map_area_data, gSaveContext.world_map_area);
|
||||
osSyncPrintf("000 area_arrival=%x (%d)\n", gSaveContext.world_map_area_data,
|
||||
gSaveContext.world_map_area);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void (*gSceneCmdHandlers[])(GlobalContext*, SceneCmd*) =
|
||||
{
|
||||
func_80098508,
|
||||
func_800985DC,
|
||||
func_80098630,
|
||||
func_80098674,
|
||||
func_800987A4,
|
||||
func_80099090,
|
||||
func_800987F8,
|
||||
func_8009883C,
|
||||
func_80098904,
|
||||
func_80099134,
|
||||
func_80098958,
|
||||
func_8009899C,
|
||||
func_80098B74,
|
||||
func_80098C24,
|
||||
func_80098C68,
|
||||
func_80098CC8,
|
||||
func_80098D80,
|
||||
func_80098D1C,
|
||||
func_80098D5C,
|
||||
func_800990F0,
|
||||
NULL,
|
||||
func_80099140,
|
||||
func_8009918C,
|
||||
func_8009934C,
|
||||
func_800991A0,
|
||||
func_800993C0,
|
||||
void (*gSceneCmdHandlers[])(GlobalContext*, SceneCmd*) = {
|
||||
func_80098508, func_800985DC, func_80098630, func_80098674, func_800987A4, func_80099090, func_800987F8,
|
||||
func_8009883C, func_80098904, func_80099134, func_80098958, func_8009899C, func_80098B74, func_80098C24,
|
||||
func_80098C68, func_80098CC8, func_80098D80, func_80098D1C, func_80098D5C, func_800990F0, NULL,
|
||||
func_80099140, func_8009918C, func_8009934C, func_800991A0, func_800993C0,
|
||||
};
|
||||
|
||||
#define ROM_FILE(name) { (u32)_##name##SegmentRomStart, (u32)_##name##SegmentRomEnd }
|
||||
#define ROM_FILE_EMPTY(name) { (u32)_##name##SegmentRomStart, (u32)_##name##SegmentRomStart }
|
||||
#define ROM_FILE_UNSET { 0 }
|
||||
#define ROM_FILE(name) \
|
||||
{ (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomEnd }
|
||||
#define ROM_FILE_EMPTY(name) \
|
||||
{ (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomStart }
|
||||
#define ROM_FILE_UNSET \
|
||||
{ 0 }
|
||||
|
||||
RomFile sNaviMsgFiles[] =
|
||||
{
|
||||
RomFile sNaviMsgFiles[] = {
|
||||
ROM_FILE(elf_message_field),
|
||||
ROM_FILE(elf_message_ydan),
|
||||
ROM_FILE_UNSET,
|
||||
@@ -616,8 +547,7 @@ s16 gLinkObjectIds[] = { OBJECT_LINK_BOY, OBJECT_LINK_CHILD };
|
||||
|
||||
u32 gObjectTableSize = 402;
|
||||
|
||||
RomFile gObjectTable[] =
|
||||
{
|
||||
RomFile gObjectTable[] = {
|
||||
ROM_FILE_UNSET,
|
||||
ROM_FILE(gameplay_keep),
|
||||
ROM_FILE(gameplay_field_keep),
|
||||
|
||||
+879
-2187
File diff suppressed because it is too large
Load Diff
@@ -174,4 +174,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skelanime/func_800A56F0.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skelanime/func_800A5774.s")
|
||||
|
||||
|
||||
@@ -20,4 +20,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skin/func_800A63CC.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skin/func_800A6408.s")
|
||||
|
||||
|
||||
@@ -10,4 +10,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skin_awb/func_800A698C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skin_awb/func_800A6AC4.s")
|
||||
|
||||
|
||||
@@ -40,4 +40,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skin_matrix/func_800A7EC0.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skin_matrix/func_800A8030.s")
|
||||
|
||||
|
||||
@@ -24,4 +24,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sram/func_800A9CD4.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sram/func_800A9D28.s")
|
||||
|
||||
|
||||
@@ -60,4 +60,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800AB9EC.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800ABE74.s")
|
||||
|
||||
|
||||
@@ -16,4 +16,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vimode/func_800ACA98.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vimode/func_800ACAF8.s")
|
||||
|
||||
|
||||
@@ -12,4 +12,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vismono/func_800AD5C0.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vismono/func_800AD870.s")
|
||||
|
||||
|
||||
@@ -12,4 +12,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vr_box/func_800AF218.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vr_box/func_800B0E50.s")
|
||||
|
||||
|
||||
@@ -6,4 +6,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vr_box_draw/func_800B10C4.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vr_box_draw/func_800B1744.s")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user