mirror of
https://github.com/zeldaret/oot
synced 2026-07-11 15:18:59 -04:00
merge with upstream
This commit is contained in:
+1
-2
@@ -1,7 +1,6 @@
|
||||
#include <z64.h>
|
||||
|
||||
void __assert(const char* exp, const char* file, s32 line)
|
||||
{
|
||||
void __assert(const char* exp, const char* file, s32 line) {
|
||||
char msg[256];
|
||||
osSyncPrintf("Assertion failed: %s, file %s, line %d, thread %d\n", exp, file, line, osGetThreadId(NULL));
|
||||
sprintf(msg, "ASSERT: %s:%d(%d)", file, line, osGetThreadId(NULL));
|
||||
|
||||
@@ -7,14 +7,12 @@ u8 sIdleThreadStack[0x400];
|
||||
StackEntry sIdleThreadInfo;
|
||||
u8 sBootThreadStack[0x400];
|
||||
|
||||
void cleararena(void)
|
||||
{
|
||||
void cleararena(void) {
|
||||
bzero(_dmadataSegmentStart, (u8*)osMemSize - OS_K0_TO_PHYSICAL(_dmadataSegmentStart));
|
||||
}
|
||||
|
||||
void bootproc(void)
|
||||
{
|
||||
StackCheck_Init(&sBootThreadInfo, sBootThreadStack, sBootThreadStack+sizeof(sBootThreadStack), 0, -1, "boot");
|
||||
void bootproc(void) {
|
||||
StackCheck_Init(&sBootThreadInfo, sBootThreadStack, sBootThreadStack + sizeof(sBootThreadStack), 0, -1, "boot");
|
||||
|
||||
osMemSize = osGetMemSize();
|
||||
cleararena();
|
||||
@@ -25,8 +23,8 @@ void bootproc(void)
|
||||
osDriveRomInit();
|
||||
isPrintfInit();
|
||||
Locale_Init();
|
||||
|
||||
StackCheck_Init(&sIdleThreadInfo, sIdleThreadStack, sIdleThreadStack+sizeof(sIdleThreadStack), 0, 256, "idle");
|
||||
osCreateThread(&sIdleThread, 1, Idle_ThreadEntry, 0, sIdleThreadStack+sizeof(sIdleThreadStack), 10);
|
||||
|
||||
StackCheck_Init(&sIdleThreadInfo, sIdleThreadStack, sIdleThreadStack + sizeof(sIdleThreadStack), 0, 256, "idle");
|
||||
osCreateThread(&sIdleThread, 1, Idle_ThreadEntry, 0, sIdleThreadStack + sizeof(sIdleThreadStack), 10);
|
||||
osStartThread(&sIdleThread);
|
||||
}
|
||||
|
||||
+9
-10
@@ -17,15 +17,15 @@ u32 gViConfigFeatures = OS_VI_DITHER_FILTER_ON | OS_VI_GAMMA_OFF;
|
||||
f32 gViConfigXScale = 1.0;
|
||||
f32 gViConfigYScale = 1.0;
|
||||
|
||||
void Main_ThreadEntry(void* arg0)
|
||||
{
|
||||
void Main_ThreadEntry(void* arg0) {
|
||||
OSTime var1;
|
||||
|
||||
osSyncPrintf("mainx 実行開始\n");
|
||||
DmaMgr_Start();
|
||||
osSyncPrintf("codeセグメントロード中...");
|
||||
var1 = osGetTime();
|
||||
DmaMgr_SendRequest1((u32)_dmadataSegmentEnd, (u32)_codeSegmentRomStart, _codeSegmentRomEnd - _codeSegmentRomStart, "../idle.c", 238);
|
||||
DmaMgr_SendRequest1((u32)_dmadataSegmentEnd, (u32)_codeSegmentRomStart, _codeSegmentRomEnd - _codeSegmentRomStart,
|
||||
"../idle.c", 238);
|
||||
var1 -= osGetTime();
|
||||
osSyncPrintf("\rcodeセグメントロード中...完了\n");
|
||||
osSyncPrintf("転送時間 %6.3f\n");
|
||||
@@ -35,8 +35,7 @@ void Main_ThreadEntry(void* arg0)
|
||||
osSyncPrintf("mainx 実行終了\n");
|
||||
}
|
||||
|
||||
void Idle_ThreadEntry(void* a0)
|
||||
{
|
||||
void Idle_ThreadEntry(void* a0) {
|
||||
osSyncPrintf("アイドルスレッド(idleproc)実行開始\n");
|
||||
osSyncPrintf("作製者 : %s\n", gBuildTeam);
|
||||
osSyncPrintf("作成日時 : %s\n", gBuildDate);
|
||||
@@ -57,8 +56,7 @@ void Idle_ThreadEntry(void* a0)
|
||||
gViConfigXScale = 1.0f;
|
||||
gViConfigYScale = 1.0f;
|
||||
|
||||
switch (osTvType)
|
||||
{
|
||||
switch (osTvType) {
|
||||
case 1:
|
||||
D_80013960 = 2;
|
||||
gViConfigMode = osViModeNtscLan1;
|
||||
@@ -82,11 +80,12 @@ void Idle_ThreadEntry(void* a0)
|
||||
osViBlack(1);
|
||||
osViSwapBuffer(0x803da80);
|
||||
osCreatePiManager(0x96, &gPiMgrCmdQ, sPiMgrCmdBuff, 0x32);
|
||||
StackCheck_Init(&sMainStackInfo, sMainStack, sMainStack+sizeof(sMainStack), 0, 0x400, "main");
|
||||
osCreateThread(&sMainThread, 3, Main_ThreadEntry, a0, sMainStack+sizeof(sMainStack), 10);
|
||||
StackCheck_Init(&sMainStackInfo, sMainStack, sMainStack + sizeof(sMainStack), 0, 0x400, "main");
|
||||
osCreateThread(&sMainThread, 3, Main_ThreadEntry, a0, sMainStack + sizeof(sMainStack), 10);
|
||||
osStartThread(&sMainThread);
|
||||
osSetThreadPri(NULL, 0);
|
||||
|
||||
while(1)
|
||||
while (1) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
+23
-29
@@ -1,82 +1,76 @@
|
||||
#include <z64.h>
|
||||
#include <global.h>
|
||||
|
||||
OSPiHandle* sISVHandle; //official name : is_Handle
|
||||
OSPiHandle* sISVHandle; // official name : is_Handle
|
||||
|
||||
#define gISVDbgPrnAdrs ((ISVDbg*)0xb3ff0000)
|
||||
#define ASCII_TO_U32(a, b, c, d) ((u32)((a << 24) | (b << 16) | (c << 8) | (d << 0)))
|
||||
|
||||
void isPrintfInit()
|
||||
{
|
||||
void isPrintfInit() {
|
||||
sISVHandle = osCartRomInit();
|
||||
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->put, 0);
|
||||
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->get, 0);
|
||||
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->magic, ASCII_TO_U32('I','S','6','4'));
|
||||
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->magic, ASCII_TO_U32('I', 'S', '6', '4'));
|
||||
}
|
||||
|
||||
void osSyncPrintfUnused(const char* fmt, ...)
|
||||
{
|
||||
void osSyncPrintfUnused(const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
_Printf(&is_proutSyncPrintf, NULL, fmt, args);
|
||||
}
|
||||
|
||||
void osSyncPrintf(const char* fmt, ...)
|
||||
{
|
||||
void osSyncPrintf(const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
_Printf(&is_proutSyncPrintf, NULL, fmt, args);
|
||||
}
|
||||
|
||||
//assumption
|
||||
void rmonPrintf(const char* fmt, ...)
|
||||
{
|
||||
// assumption
|
||||
void rmonPrintf(const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
_Printf(&is_proutSyncPrintf, NULL, fmt, args);
|
||||
}
|
||||
|
||||
u32 is_proutSyncPrintf(void* arg0, const char *str, s32 count)
|
||||
{
|
||||
u32 is_proutSyncPrintf(void* arg0, const char* str, s32 count) {
|
||||
u32 data;
|
||||
s32 pos;
|
||||
s32 start;
|
||||
s32 end;
|
||||
|
||||
osEPiReadIo(sISVHandle, (u32)&gISVDbgPrnAdrs->magic, &data);
|
||||
if (data != ASCII_TO_U32('I','S','6','4'))
|
||||
if (data != ASCII_TO_U32('I', 'S', '6', '4')) {
|
||||
return 1;
|
||||
}
|
||||
osEPiReadIo(sISVHandle, (u32)&gISVDbgPrnAdrs->get, &data);
|
||||
pos = data;
|
||||
osEPiReadIo(sISVHandle, (u32)&gISVDbgPrnAdrs->put, &data);
|
||||
start = data;
|
||||
end = start + count;
|
||||
if (end >= 0xffe0)
|
||||
{
|
||||
if (end >= 0xffe0) {
|
||||
end -= 0xffe0;
|
||||
if (pos < end || start < pos)
|
||||
if (pos < end || start < pos) {
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (start < pos && pos < end)
|
||||
}
|
||||
} else {
|
||||
if (start < pos && pos < end) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
while (count)
|
||||
{
|
||||
while (count) {
|
||||
u32 addr = (u32)&gISVDbgPrnAdrs->data + (start & 0xffffffc);
|
||||
s32 shift = ((3 - (start & 3)) * 8);
|
||||
if (*str)
|
||||
{
|
||||
if (*str) {
|
||||
osEPiReadIo(sISVHandle, addr, &data);
|
||||
osEPiWriteIo(sISVHandle, addr, (*str << shift) | (data & ~(0xff << shift)));
|
||||
|
||||
start++;
|
||||
if (start >= 0xffe0)
|
||||
if (start >= 0xffe0) {
|
||||
start -= 0xffe0;
|
||||
}
|
||||
}
|
||||
count--;
|
||||
str++;
|
||||
@@ -85,9 +79,9 @@ u32 is_proutSyncPrintf(void* arg0, const char *str, s32 count)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void func_80002384(const char* exp, const char* file, u32 line)
|
||||
{
|
||||
void func_80002384(const char* exp, const char* file, u32 line) {
|
||||
osSyncPrintf("File:%s Line:%d %s \n", file, line, exp);
|
||||
while (true)
|
||||
while (true) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
+45
-47
@@ -2,22 +2,25 @@
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
float LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, float var1, const char* var2Name, float var2, const char* var3Name, float var3)
|
||||
{
|
||||
if (var1 < var2 || var3 < var1)
|
||||
osSyncPrintf("%s %d: range error %s(%f) < %s(%f) < %s(%f)\n", exp, arg1, var2Name, var2, var1Name, var1, var3Name, var3);
|
||||
float LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, float var1, const char* var2Name,
|
||||
float var2, const char* var3Name, float var3) {
|
||||
if (var1 < var2 || var3 < var1) {
|
||||
osSyncPrintf("%s %d: range error %s(%f) < %s(%f) < %s(%f)\n", exp, arg1, var2Name, var2, var1Name, var1,
|
||||
var3Name, var3);
|
||||
}
|
||||
return var1;
|
||||
}
|
||||
|
||||
s32 LogUtils_CheckIntRange(const char* exp, s32 arg1, const char* var1Name, s32 var1, const char* var2Name, s32 var2, const char* var3Name, s32 var3)
|
||||
{
|
||||
if (var1 < var2 || var3 < var1)
|
||||
osSyncPrintf("%s %d: range error %s(%d) < %s(%d) < %s(%d)\n", exp, arg1, var2Name, var2, var1Name, var1, var3Name, var3);
|
||||
s32 LogUtils_CheckIntRange(const char* exp, s32 arg1, const char* var1Name, s32 var1, const char* var2Name, s32 var2,
|
||||
const char* var3Name, s32 var3) {
|
||||
if (var1 < var2 || var3 < var1) {
|
||||
osSyncPrintf("%s %d: range error %s(%d) < %s(%d) < %s(%d)\n", exp, arg1, var2Name, var2, var1Name, var1,
|
||||
var3Name, var3);
|
||||
}
|
||||
return var1;
|
||||
}
|
||||
|
||||
void LogUtils_LogHexDump(void* ptr, s32 size0)
|
||||
{
|
||||
void LogUtils_LogHexDump(void* ptr, s32 size0) {
|
||||
u8* addr = (u8*)ptr;
|
||||
s32 size = (s32)size0;
|
||||
s32 rest;
|
||||
@@ -28,40 +31,39 @@ void LogUtils_LogHexDump(void* ptr, s32 size0)
|
||||
osSyncPrintf("address off +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +a +b +c +d +e +f 0123456789abcdef\n");
|
||||
|
||||
off = 0;
|
||||
while (size > 0)
|
||||
{
|
||||
while (size > 0) {
|
||||
|
||||
osSyncPrintf("%08x %04x", addr, off);
|
||||
rest = (size < 0x10) ? size : 0x10;
|
||||
|
||||
i = 0;
|
||||
while (true)
|
||||
{
|
||||
if(i < rest)
|
||||
while (true) {
|
||||
if (i < rest) {
|
||||
osSyncPrintf(" %02x", *((u8*)addr + i));
|
||||
else
|
||||
} else {
|
||||
osSyncPrintf(" ");
|
||||
}
|
||||
|
||||
i++;
|
||||
if (i > 0xf)
|
||||
if (i > 0xf) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
osSyncPrintf(" ");
|
||||
|
||||
i = 0;
|
||||
while (true)
|
||||
{
|
||||
if(i < rest)
|
||||
{
|
||||
u8 a = *(addr+i);
|
||||
while (true) {
|
||||
if (i < rest) {
|
||||
u8 a = *(addr + i);
|
||||
osSyncPrintf("%c", (a >= 0x20 && a < 0x7f) ? a : '.');
|
||||
}
|
||||
else
|
||||
} else {
|
||||
osSyncPrintf(" ");
|
||||
}
|
||||
|
||||
i++;
|
||||
if (i > 0xf)
|
||||
if (i > 0xf) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
osSyncPrintf("\n");
|
||||
size -= rest;
|
||||
@@ -70,46 +72,42 @@ void LogUtils_LogHexDump(void* ptr, s32 size0)
|
||||
}
|
||||
}
|
||||
|
||||
void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char *name, const char *file, s32 line)
|
||||
{
|
||||
void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char* name, const char* file, s32 line) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "%s %d %s[%d] max=%u ptr=%08x\n" VT_RST, file, line, name, value, max, ptr);
|
||||
}
|
||||
|
||||
void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* file, s32 line)
|
||||
{
|
||||
u32 mask = (unk - 1);
|
||||
if (value & mask)
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "%s %d:%s(%08x) は バウンダリ(%d)違反です\n" VT_RST, file, line, name, value, unk);
|
||||
void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* file, s32 line) {
|
||||
u32 mask = (unk - 1);
|
||||
if (value & mask) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "%s %d:%s(%08x) は バウンダリ(%d)違反です\n" VT_RST, file, line, name, value,
|
||||
unk);
|
||||
}
|
||||
}
|
||||
|
||||
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, s32 line)
|
||||
{
|
||||
if (!ptr)
|
||||
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, s32 line) {
|
||||
if (!ptr) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "%s %d:%s は はヌルポインタです\n" VT_RST, file, line, exp);
|
||||
}
|
||||
}
|
||||
|
||||
//check valid pointer
|
||||
void LogUtils_CheckValidPointer(const char* exp, void* ptr0, const char* file, s32 line)
|
||||
{
|
||||
// check valid pointer
|
||||
void LogUtils_CheckValidPointer(const char* exp, void* ptr0, const char* file, s32 line) {
|
||||
u32 ptr = (u32)ptr0;
|
||||
if (!ptr || ptr < 0x80000000U || (0x80000000U + osMemSize) <= ptr)
|
||||
if (!ptr || ptr < 0x80000000U || (0x80000000U + osMemSize) <= ptr) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "%s %d:ポインタ %s(%08x) が異常です\n" VT_RST, file, line, exp, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
//there's probalby a macro like this : MACRO(exp) LogUtils_LogThreadId(__FILE__, __LINE__); osSyncPrintf(exp)
|
||||
void LogUtils_LogThreadId(const char* name, s32 line)
|
||||
{
|
||||
void LogUtils_LogThreadId(const char* name, s32 line) {
|
||||
osSyncPrintf("<%d %s %d>", osGetThreadId(NULL), name, line);
|
||||
}
|
||||
|
||||
void LogUtils_HungupThread(const char* name, s32 line)
|
||||
{
|
||||
void LogUtils_HungupThread(const char* name, s32 line) {
|
||||
osSyncPrintf("*** HungUp in thread %d, [%s:%d] ***\n", osGetThreadId(NULL), name, line);
|
||||
Fault_AddHungupAndCrash(name, line);
|
||||
}
|
||||
|
||||
void LogUtils_ResetHungup()
|
||||
{
|
||||
void LogUtils_ResetHungup() {
|
||||
osSyncPrintf("*** Reset ***\n");
|
||||
Fault_AddHungupAndCrash("Reset", 0);
|
||||
}
|
||||
}
|
||||
|
||||
+50
-57
@@ -5,137 +5,130 @@
|
||||
StackEntry* sStackInfoListStart = NULL;
|
||||
StackEntry* sStackInfoListEnd = NULL;
|
||||
|
||||
void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace, const char* name)
|
||||
{
|
||||
void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace,
|
||||
const char* name) {
|
||||
StackEntry* iter;
|
||||
u32* addr;
|
||||
|
||||
if (!entry)
|
||||
if (!entry) {
|
||||
sStackInfoListStart = NULL;
|
||||
else
|
||||
{
|
||||
} else {
|
||||
entry->head = (u32)stackTop;
|
||||
entry->tail = (u32)stackBottom;
|
||||
entry->initValue = initValue;
|
||||
entry->minSpace = minSpace;
|
||||
entry->name = name;
|
||||
iter = sStackInfoListStart;
|
||||
while (iter)
|
||||
{
|
||||
if (iter == entry)
|
||||
{
|
||||
while (iter) {
|
||||
if (iter == entry) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "stackcheck_init: %08x は既にリスト中にある\n" VT_RST, entry);
|
||||
return;
|
||||
}
|
||||
iter = iter->next;
|
||||
}
|
||||
|
||||
|
||||
entry->prev = sStackInfoListEnd;
|
||||
entry->next = NULL;
|
||||
|
||||
if (sStackInfoListEnd)
|
||||
|
||||
if (sStackInfoListEnd) {
|
||||
sStackInfoListEnd->next = entry;
|
||||
}
|
||||
|
||||
sStackInfoListEnd = entry;
|
||||
if (!sStackInfoListStart)
|
||||
if (!sStackInfoListStart) {
|
||||
sStackInfoListStart = entry;
|
||||
}
|
||||
|
||||
if (entry->minSpace != -1)
|
||||
{
|
||||
if (entry->minSpace != -1) {
|
||||
addr = (u32*)entry->head;
|
||||
while ((u32)addr < entry->tail)
|
||||
while ((u32)addr < entry->tail) {
|
||||
*addr++ = entry->initValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StackCheck_Cleanup(StackEntry* entry)
|
||||
{
|
||||
void StackCheck_Cleanup(StackEntry* entry) {
|
||||
bool inconsistency = false;
|
||||
|
||||
if (!entry->prev)
|
||||
{
|
||||
if (entry == sStackInfoListStart)
|
||||
if (!entry->prev) {
|
||||
if (entry == sStackInfoListStart) {
|
||||
sStackInfoListStart = entry->next;
|
||||
else
|
||||
} else {
|
||||
inconsistency = true;
|
||||
}
|
||||
else
|
||||
}
|
||||
} else {
|
||||
entry->prev->next = entry->next;
|
||||
|
||||
if (!entry->next)
|
||||
{
|
||||
if (entry == sStackInfoListEnd)
|
||||
sStackInfoListEnd = entry->prev;
|
||||
else
|
||||
inconsistency = true;
|
||||
}
|
||||
if (inconsistency)
|
||||
|
||||
if (!entry->next) {
|
||||
if (entry == sStackInfoListEnd) {
|
||||
sStackInfoListEnd = entry->prev;
|
||||
} else {
|
||||
inconsistency = true;
|
||||
}
|
||||
}
|
||||
if (inconsistency) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "stackcheck_cleanup: %08x リスト不整合です\n" VT_RST, entry);
|
||||
}
|
||||
}
|
||||
|
||||
StackStatus StackCheck_GetState(StackEntry* entry)
|
||||
{
|
||||
StackStatus StackCheck_GetState(StackEntry* entry) {
|
||||
u32* last;
|
||||
u32 used;
|
||||
u32 free;
|
||||
s32 ret;
|
||||
|
||||
for (last = (u32*)entry->head; (u32)last < entry->tail; last++)
|
||||
{
|
||||
if (entry->initValue != *last)
|
||||
for (last = (u32*)entry->head; (u32)last < entry->tail; last++) {
|
||||
if (entry->initValue != *last) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
used = entry->tail - (u32)last;
|
||||
free = (u32)last - entry->head;
|
||||
|
||||
if (free == 0)
|
||||
{
|
||||
if (free == 0) {
|
||||
ret = STACK_STATUS_OVERFLOW;
|
||||
osSyncPrintf(VT_FGCOL(RED));
|
||||
}
|
||||
else if (free < entry->minSpace && entry->minSpace != -1)
|
||||
{
|
||||
} else if (free < entry->minSpace && entry->minSpace != -1) {
|
||||
ret = STACK_STATUS_WARNING;
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
ret = STACK_STATUS_OK;
|
||||
}
|
||||
|
||||
osSyncPrintf("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, free, entry->name ? entry->name : "(null)");
|
||||
osSyncPrintf("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, free,
|
||||
entry->name ? entry->name : "(null)");
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
if (ret != STACK_STATUS_OK)
|
||||
if (ret != STACK_STATUS_OK) {
|
||||
LogUtils_LogHexDump(entry->head, entry->tail - entry->head);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
u32 StackCheck_CheckAll()
|
||||
{
|
||||
u32 StackCheck_CheckAll() {
|
||||
u32 ret = 0;
|
||||
|
||||
StackEntry* iter = sStackInfoListStart;
|
||||
while(iter)
|
||||
{
|
||||
while (iter) {
|
||||
u32 state = StackCheck_GetState(iter);
|
||||
if (state != STACK_STATUS_OK)
|
||||
if (state != STACK_STATUS_OK) {
|
||||
ret = 1;
|
||||
}
|
||||
iter = iter->next;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
u32 StackCheck_Check(StackEntry* entry)
|
||||
{
|
||||
if (!entry)
|
||||
u32 StackCheck_Check(StackEntry* entry) {
|
||||
if (!entry) {
|
||||
return StackCheck_CheckAll();
|
||||
else
|
||||
} else {
|
||||
return StackCheck_GetState(entry);
|
||||
}
|
||||
}
|
||||
|
||||
+17
-18
@@ -2,35 +2,34 @@
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
//this should probably go elsewhere but right now viconfig.o is the only object between idle and z_std_dma
|
||||
// this should probably go elsewhere but right now viconfig.o is the only object between idle and z_std_dma
|
||||
OSPiHandle* gCartHandle = 0;
|
||||
|
||||
void ViConfig_UpdateVi(u32 arg0)
|
||||
{
|
||||
if (arg0 != 0)
|
||||
{
|
||||
void ViConfig_UpdateVi(u32 arg0) {
|
||||
if (arg0 != 0) {
|
||||
osSyncPrintf(VT_COL(YELLOW, BLACK) "osViSetYScale1(%f);\n" VT_RST, 1.0f);
|
||||
|
||||
if (osTvType == 0)
|
||||
if (osTvType == 0) {
|
||||
osViSetMode(&osViModePalLan1);
|
||||
}
|
||||
|
||||
osViSetYScale(1.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
osViSetMode(&gViConfigMode);
|
||||
|
||||
if (gViConfigAdditionalScanLines != 0)
|
||||
if (gViConfigAdditionalScanLines != 0) {
|
||||
osViExtendVStart(gViConfigAdditionalScanLines);
|
||||
}
|
||||
|
||||
if (gViConfigFeatures != 0)
|
||||
if (gViConfigFeatures != 0) {
|
||||
osViSetSpecialFeatures(gViConfigFeatures);
|
||||
}
|
||||
|
||||
if (gViConfigXScale != 1.0f)
|
||||
if (gViConfigXScale != 1.0f) {
|
||||
osViSetXScale(gViConfigXScale);
|
||||
}
|
||||
|
||||
if (gViConfigYScale != 1.0f)
|
||||
{
|
||||
if (gViConfigYScale != 1.0f) {
|
||||
osSyncPrintf(VT_COL(YELLOW, BLACK) "osViSetYScale3(%f);\n" VT_RST, gViConfigYScale);
|
||||
osViSetYScale(gViConfigYScale);
|
||||
}
|
||||
@@ -39,10 +38,10 @@ void ViConfig_UpdateVi(u32 arg0)
|
||||
gViConfigUseDefault = arg0;
|
||||
}
|
||||
|
||||
void ViConfig_UpdateBlack()
|
||||
{
|
||||
if (gViConfigUseDefault != 0)
|
||||
void ViConfig_UpdateBlack() {
|
||||
if (gViConfigUseDefault != 0) {
|
||||
osViBlack(1);
|
||||
else
|
||||
} else {
|
||||
osViBlack(0);
|
||||
}
|
||||
}
|
||||
|
||||
+32
-49
@@ -7,61 +7,51 @@ u32 sYaz0CurRomStart;
|
||||
u32 sYaz0CurSize;
|
||||
u32 sYaz0MaxPtr;
|
||||
|
||||
void* Yaz0_FirstDMA()
|
||||
{
|
||||
void* Yaz0_FirstDMA() {
|
||||
u32 pad0;
|
||||
u32 pad1;
|
||||
u32 dmaSize;
|
||||
u32 curSize;
|
||||
|
||||
sYaz0MaxPtr = sYaz0CurDataEnd - 0x19;
|
||||
|
||||
|
||||
curSize = sYaz0CurDataEnd - (u32)sYaz0DataBuffer;
|
||||
dmaSize = (curSize > sYaz0CurSize)
|
||||
? sYaz0CurSize
|
||||
: curSize;
|
||||
|
||||
dmaSize = (curSize > sYaz0CurSize) ? sYaz0CurSize : curSize;
|
||||
|
||||
DmaMgr_DMARomToRam(sYaz0CurRomStart, sYaz0DataBuffer, dmaSize);
|
||||
sYaz0CurRomStart += dmaSize;
|
||||
sYaz0CurSize -= dmaSize;
|
||||
return sYaz0DataBuffer;
|
||||
}
|
||||
|
||||
void* Yaz0_NextDMA(void* curSrcPos)
|
||||
{
|
||||
void* Yaz0_NextDMA(void* curSrcPos) {
|
||||
u8* dst;
|
||||
u32 restSize;
|
||||
u32 dmaSize;
|
||||
|
||||
restSize = sYaz0CurDataEnd - (u32)curSrcPos;
|
||||
|
||||
dst = (restSize & 7)
|
||||
? (sYaz0DataBuffer - (restSize & 7)) + 8
|
||||
: sYaz0DataBuffer;
|
||||
dst = (restSize & 7) ? (sYaz0DataBuffer - (restSize & 7)) + 8 : sYaz0DataBuffer;
|
||||
|
||||
bcopy(curSrcPos, dst, restSize);
|
||||
dmaSize = (sYaz0CurDataEnd - (u32)dst) - restSize;
|
||||
if (sYaz0CurSize < dmaSize)
|
||||
if (sYaz0CurSize < dmaSize) {
|
||||
dmaSize = sYaz0CurSize;
|
||||
}
|
||||
|
||||
if (dmaSize != 0)
|
||||
{
|
||||
if (dmaSize != 0) {
|
||||
DmaMgr_DMARomToRam(sYaz0CurRomStart, (u32)dst + restSize, dmaSize);
|
||||
sYaz0CurRomStart += dmaSize;
|
||||
sYaz0CurSize -= dmaSize;
|
||||
if (!sYaz0CurSize)
|
||||
if (!sYaz0CurSize) {
|
||||
sYaz0MaxPtr = (u32)dst + restSize + dmaSize;
|
||||
}
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// has an extra check at the start of the small compressed loop
|
||||
// along with an extra move instruction
|
||||
// maybe some regalloc differences besides these issues
|
||||
void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst)
|
||||
{
|
||||
void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst) {
|
||||
u32 bitIdx;
|
||||
u8* src;
|
||||
u8* dstEnd;
|
||||
@@ -69,54 +59,47 @@ void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst)
|
||||
u32 nibble;
|
||||
u8* backPtr;
|
||||
s32 chunkSize;
|
||||
u32 curDecBit;
|
||||
u32 off;
|
||||
|
||||
bitIdx = 0;
|
||||
src = hdr->data;
|
||||
src = (u8*)hdr->data;
|
||||
dstEnd = dst + hdr->decSize;
|
||||
|
||||
do
|
||||
{
|
||||
if (bitIdx == 0)
|
||||
{
|
||||
if ((sYaz0MaxPtr < (u32)src) && (sYaz0CurSize != 0))
|
||||
do {
|
||||
if (bitIdx == 0) {
|
||||
if ((sYaz0MaxPtr < (u32)src) && (sYaz0CurSize != 0)) {
|
||||
src = Yaz0_NextDMA(src);
|
||||
}
|
||||
|
||||
chunkHeader = *src++;
|
||||
bitIdx = 8;
|
||||
}
|
||||
|
||||
curDecBit = chunkHeader & (1 << 7);
|
||||
chunkHeader <<= 1;
|
||||
|
||||
if (curDecBit) // uncompressed
|
||||
{
|
||||
*dst++ = *src++;
|
||||
}
|
||||
else // compressed
|
||||
{
|
||||
if (chunkHeader & (1 << 7)) { // uncompressed
|
||||
*dst = *src;
|
||||
dst++;
|
||||
src++;
|
||||
} else { // compressed
|
||||
off = ((*src & 0xF) << 8 | *(src + 1));
|
||||
nibble = *src >> 4;
|
||||
backPtr = dst - (*(src + 1) | (*src & 0xF) << 8);
|
||||
backPtr = dst - off;
|
||||
src += 2;
|
||||
|
||||
chunkSize = (nibble == 0) // N = chunkSize; B = back offset
|
||||
? *src++ + 0x12 // 3 bytes 0B BB NN
|
||||
: nibble + 2; // 2 bytes NB BB
|
||||
chunkSize = (nibble == 0) // N = chunkSize; B = back offset
|
||||
? *src++ + 0x12 // 3 bytes 0B BB NN
|
||||
: nibble + 2; // 2 bytes NB BB
|
||||
|
||||
for (off = chunkSize; off > 0; off--)
|
||||
do {
|
||||
*dst++ = *(backPtr++ - 1);
|
||||
chunkSize--;
|
||||
} while (chunkSize != 0);
|
||||
}
|
||||
|
||||
chunkHeader <<= 1;
|
||||
bitIdx--;
|
||||
} while (dst != dstEnd);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/yaz0/Yaz0_DecompressImpl.s")
|
||||
#endif
|
||||
|
||||
void Yaz0_Decompress(u32 romStart, void* dst, u32 size)
|
||||
{
|
||||
void Yaz0_Decompress(u32 romStart, void* dst, u32 size) {
|
||||
sYaz0CurRomStart = romStart;
|
||||
sYaz0CurSize = size;
|
||||
sYaz0CurDataEnd = sYaz0DataBuffer + sizeof(sYaz0DataBuffer);
|
||||
|
||||
+17
-19
@@ -6,16 +6,14 @@
|
||||
u32 gCurrentRegion = 0;
|
||||
LocaleCartInfo sCartInfo;
|
||||
|
||||
//temporary
|
||||
// temporary
|
||||
extern PadMgr gPadMgr;
|
||||
|
||||
void Locale_Init()
|
||||
{
|
||||
void Locale_Init() {
|
||||
osEPiReadIo(gCartHandle, 0x38, &sCartInfo.mediaFormat);
|
||||
osEPiReadIo(gCartHandle, 0x3C, &sCartInfo.regionInfo);
|
||||
|
||||
switch (sCartInfo.countryCode)
|
||||
{
|
||||
switch (sCartInfo.countryCode) {
|
||||
case 'J': // "NTSC-U (North America)"
|
||||
gCurrentRegion = REGION_US;
|
||||
break;
|
||||
@@ -36,39 +34,39 @@ void Locale_Init()
|
||||
osSyncPrintf("z_locale_init:日本用かアメリカ用か3コンで判断させる\n");
|
||||
}
|
||||
|
||||
void Locale_ResetRegion()
|
||||
{
|
||||
void Locale_ResetRegion() {
|
||||
gCurrentRegion = REGION_NULL;
|
||||
}
|
||||
|
||||
u32 func_80001F48()
|
||||
{
|
||||
PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; //cast required to match
|
||||
u32 func_80001F48() {
|
||||
PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; // cast required to match
|
||||
|
||||
if (gCurrentRegion == REGION_NATIVE)
|
||||
if (gCurrentRegion == REGION_NATIVE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (padMgr->unk_2A8 & 4)
|
||||
if (padMgr->unk_2A8 & 4) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
u32 func_80001F8C()
|
||||
{
|
||||
PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; //cast required to match
|
||||
u32 func_80001F8C() {
|
||||
PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; // cast required to match
|
||||
|
||||
if (gCurrentRegion == REGION_NATIVE)
|
||||
if (gCurrentRegion == REGION_NATIVE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (padMgr->unk_2A8 & 4)
|
||||
if (padMgr->unk_2A8 & 4) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// This function appears to be unused?
|
||||
u32 Locale_IsRegionNative()
|
||||
{
|
||||
u32 Locale_IsRegionNative() {
|
||||
return gCurrentRegion == REGION_NATIVE;
|
||||
}
|
||||
|
||||
+1662
-1665
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
u64 gGfxSPTaskOutputBuffer[0x3000];
|
||||
|
||||
// 0xC00 bytes
|
||||
u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE];
|
||||
u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE];
|
||||
|
||||
// 0x400 bytes
|
||||
u8 gGfxSPTaskStack[0x400];
|
||||
|
||||
+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));
|
||||
}
|
||||
|
||||
+297
-425
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,28 +0,0 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
GlobalContext* func_80026B00(void)
|
||||
{
|
||||
return D_80157DA0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80026B00/func_80026B0C.s")
|
||||
|
||||
void func_80026C1C(u8* arg0)
|
||||
{
|
||||
arg0[0] = 0;
|
||||
arg0[1] = 0;
|
||||
arg0[2] = 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80026B00/func_80026C2C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80026B00/Effect_Add.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80026B00/func_80026E74.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80026B00/func_80026F70.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80026B00/func_8002709C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80026B00/func_800271A8.s")
|
||||
+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,5 +0,0 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C360/func_8006C360.s")
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
extern u32 osResetType;
|
||||
|
||||
/*
|
||||
void func_8007BE60(u32* a0)
|
||||
{
|
||||
u32 var1;
|
||||
|
||||
//*a0 = 0;
|
||||
|
||||
if (osResetType == 0)
|
||||
{
|
||||
a0[1] = 0;
|
||||
a0[2] = 0;
|
||||
a0[3] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
var1 = a0[3] + a0[5];
|
||||
a0[1]++;
|
||||
a0[2] = (var1 < a0[5]) + a0[2] + a0[4];
|
||||
a0[3] = var1;
|
||||
}
|
||||
|
||||
a0[5] = 0;
|
||||
a0[4] = 0;
|
||||
}
|
||||
*/
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BE60/func_8007BE60.s")
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x00 */ u32 unk_00;
|
||||
/* 0x04 */ char unk_04[0x0C];
|
||||
/* 0x10 */ OSTime unk_10;
|
||||
} struct_8007BED4;
|
||||
|
||||
void func_8007BED4(struct_8007BED4* arg0)
|
||||
{
|
||||
arg0->unk_00 = 1;
|
||||
arg0->unk_10 = osGetTime();
|
||||
}
|
||||
|
||||
u32 func_8007BF08(struct_8007BED4* arg0)
|
||||
{
|
||||
return arg0->unk_00;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF10/func_8007BF10.s")
|
||||
|
||||
+46
-58
@@ -1,10 +1,9 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void func_8007C1AC(Vec3f* dest, struct_80045714* arg1);
|
||||
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,66 +19,60 @@ 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")
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b)
|
||||
{
|
||||
f32 fVar1;
|
||||
Vec3f* func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b) {
|
||||
Vec3f v1;
|
||||
Vec3f v2;
|
||||
f32 temp;
|
||||
|
||||
v1.x = b->x - a->x;
|
||||
v1.y = b->y - a->y;
|
||||
v1.z = b->z - a->z;
|
||||
|
||||
temp = func_8007C058(sqrtf(SQ(v1.x) + SQ(v1.y) + SQ(v1.z)), 0.01f);
|
||||
|
||||
v2.x = v1.x / temp;
|
||||
v2.y = v1.y / temp;
|
||||
v2.z = v1.z / temp;
|
||||
|
||||
*dest = v2;
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1) {
|
||||
Vec3f v;
|
||||
f32 sin4;
|
||||
f32 cos4;
|
||||
f32 sin6;
|
||||
f32 cos6;
|
||||
|
||||
v.x = b->x - a->x;
|
||||
v.y = b->y - a->y;
|
||||
v.z = b->z - a->z;
|
||||
cos4 = Math_Coss(arg1->unk_04);
|
||||
cos6 = Math_Coss(arg1->unk_06);
|
||||
sin4 = Math_Sins(arg1->unk_04);
|
||||
sin6 = Math_Sins(arg1->unk_06);
|
||||
|
||||
fVar1 = func_8007C058(sqrtf(v.x * v.x + v.y * v.y + v.z * v.z), D_8013CB80);
|
||||
v.x = arg1->unk_00 * sin4 * sin6;
|
||||
v.y = arg1->unk_00 * cos4;
|
||||
v.z = arg1->unk_00 * sin4 * cos6;
|
||||
|
||||
dest->x = v.x / fVar1;
|
||||
dest->y = v.y / fVar1;
|
||||
dest->z = v.z / fVar1;
|
||||
*dest = v;
|
||||
|
||||
return dest;
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF90/func_8007C0F8.s")
|
||||
#endif
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void func_8007C1AC(Vec3f* dest, struct_80045714* arg1)
|
||||
{
|
||||
f32 fVar1;
|
||||
f32 fVar2;
|
||||
f32 fVar3;
|
||||
f32 fVar4;
|
||||
f32 fVar5;
|
||||
f32 fVar6;
|
||||
|
||||
fVar1 = Math_Coss(arg1->unk_04);
|
||||
fVar2 = Math_Coss(arg1->unk_06);
|
||||
fVar3 = Math_Coss(arg1->unk_04);
|
||||
fVar4 = Math_Coss(arg1->unk_06);
|
||||
fVar6 = arg1->unk_00;
|
||||
fVar5 = arg1->unk_00;
|
||||
dest->x = arg1->unk_00 * fVar3 * fVar4;
|
||||
dest->y = fVar6 * fVar1;
|
||||
dest->z = fVar5 * fVar3 * fVar2;
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF90/func_8007C1AC.s")
|
||||
#endif
|
||||
|
||||
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;
|
||||
@@ -96,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;
|
||||
@@ -107,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;
|
||||
@@ -118,12 +108,11 @@ 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 = func_800FD250(b->z - a->z, b->y - a->y);
|
||||
var.y = func_800FD250(b->x - a->x, b->z - a->z);
|
||||
var.x = Math_atan2f(b->z - a->z, b->y - a->y);
|
||||
var.y = Math_atan2f(b->x - a->x, b->z - a->z);
|
||||
var.z = 0;
|
||||
|
||||
*dest = var;
|
||||
@@ -134,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);
|
||||
|
||||
+19
-33
@@ -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,49 +32,38 @@ 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
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void func_800AA0F0(void)
|
||||
{
|
||||
if ((gPadMgr.unk_460 == func_800A9F30) && (gPadMgr.unk_464 == 0))
|
||||
{
|
||||
// asm loads/writes directly to 0x80166D20 and 0x80166D24
|
||||
// but the compiler wants to reuse offsets from 0x801668C0
|
||||
gPadMgr.unk_460 = NULL;
|
||||
gPadMgr.unk_464 = 0;
|
||||
void func_800AA0F0(void) {
|
||||
PadMgr* padmgr = &gPadMgr;
|
||||
|
||||
if ((padmgr->unk_460 == func_800A9F30) && (padmgr->unk_464 == 0)) {
|
||||
padmgr->unk_460 = NULL;
|
||||
padmgr->unk_464 = 0;
|
||||
}
|
||||
|
||||
func_800D3178(&D_80160FD0);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_800A9F30/func_800AA0F0.s")
|
||||
#endif
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
#include <global.h>
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 type;
|
||||
/* 0x04 */ u32 setScissor;
|
||||
/* 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),
|
||||
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),
|
||||
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)),
|
||||
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx D_8012AC58[] = {
|
||||
gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_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),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
// Init func
|
||||
void func_800ACE70(struct_801664F0* this) {
|
||||
this->type = 0;
|
||||
this->setScissor = false;
|
||||
this->color.c.r = 0xFF;
|
||||
this->color.c.g = 0xFF;
|
||||
this->color.c.b = 0xFF;
|
||||
this->color.c.a = 0xFF;
|
||||
}
|
||||
|
||||
// Destroy func
|
||||
void func_800ACE90(struct_801664F0* this) {
|
||||
}
|
||||
|
||||
// Update func
|
||||
void func_800ACE98(struct_801664F0* this, Gfx** gfxp) {
|
||||
Gfx* gfx;
|
||||
|
||||
gfx = *gfxp;
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
gDPSetPrimDepth(gfx++, -1, -1);
|
||||
|
||||
if (this->setScissor == true) {
|
||||
gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
#include <global.h>
|
||||
#include <padmgr.h>
|
||||
#include <vt.h>
|
||||
|
||||
extern PadMgr gPadMgr;
|
||||
|
||||
u32 D_8012DBC0 = false;
|
||||
|
||||
void func_800D31A0() {
|
||||
osSyncPrintf(VT_FGCOL(RED) "\n**** Freeze!! ****\n" VT_RST);
|
||||
while (true) {
|
||||
func_800FF4AC(1000); // msleep
|
||||
}
|
||||
}
|
||||
|
||||
void func_800D31F0() {
|
||||
PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; // cast required to match
|
||||
|
||||
D_8012DBC0 = (padMgr->unk_2A8 & 2) != 0;
|
||||
}
|
||||
|
||||
void func_800D3210() {
|
||||
D_8012DBC0 = false;
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
#include <fp.h>
|
||||
|
||||
s32 use_cfrac;
|
||||
|
||||
f32 Math_tanf(f32 x) {
|
||||
f32 sin = sinf(x);
|
||||
f32 cos = cosf(x);
|
||||
return sin / cos;
|
||||
}
|
||||
|
||||
f32 Math_floorf(f32 x) {
|
||||
return floorf(x);
|
||||
}
|
||||
|
||||
f32 Math_ceilf(f32 x) {
|
||||
return ceilf(x);
|
||||
}
|
||||
|
||||
f32 Math_roundf(f32 x) {
|
||||
return roundf(x);
|
||||
}
|
||||
|
||||
f32 Math_truncf(f32 x) {
|
||||
return truncf(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 poly = x;
|
||||
f32 sq = SQ(x);
|
||||
f32 exp = x * sq;
|
||||
const f32* c = coeffs;
|
||||
f32 term;
|
||||
|
||||
while (1) {
|
||||
term = *c++ * exp;
|
||||
if (poly + term == poly) {
|
||||
break;
|
||||
}
|
||||
poly = poly + term;
|
||||
exp = exp * sq;
|
||||
}
|
||||
|
||||
return poly;
|
||||
}
|
||||
|
||||
/* Ditto for two quadrants */
|
||||
f32 Math_atanf_taylor(f32 x) {
|
||||
f32 t;
|
||||
f32 q;
|
||||
|
||||
if (x > 0.f) {
|
||||
t = x;
|
||||
} else if (x < 0.f) {
|
||||
t = -x;
|
||||
} else if (x == 0.f) {
|
||||
return 0.f;
|
||||
} else {
|
||||
return qNaN0x10000;
|
||||
}
|
||||
|
||||
if (t <= M_SQRT2 - 1.f) {
|
||||
return Math_atanf_taylor_q(x);
|
||||
}
|
||||
|
||||
if (t >= M_SQRT2 + 1.f) {
|
||||
q = M_PI / 2 - Math_atanf_taylor_q(1.f / t);
|
||||
} else {
|
||||
q = M_PI / 4 - Math_atanf_taylor_q((1.f - t) / (1.f + t));
|
||||
}
|
||||
|
||||
if (x > 0.f) {
|
||||
return q;
|
||||
} else {
|
||||
return -q;
|
||||
}
|
||||
}
|
||||
|
||||
/* Arctangent approximation using a continued fraction */
|
||||
f32 Math_atanf_cfrac(f32 x) {
|
||||
s32 sector;
|
||||
f32 z;
|
||||
f32 conv;
|
||||
f32 sq;
|
||||
s32 i;
|
||||
|
||||
if (x >= -1.f && x <= 1.f) {
|
||||
sector = 0;
|
||||
} else if (x > 1.f) {
|
||||
sector = 1;
|
||||
x = 1.f / x;
|
||||
} else if (x < -1.f) {
|
||||
sector = -1;
|
||||
x = 1.f / x;
|
||||
} else {
|
||||
return qNaN0x10000;
|
||||
}
|
||||
|
||||
sq = SQ(x);
|
||||
conv = 0.f;
|
||||
z = 8.f;
|
||||
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) {
|
||||
return conv;
|
||||
} else if (sector > 0) {
|
||||
return M_PI / 2 - conv;
|
||||
} else {
|
||||
return -M_PI / 2 - conv;
|
||||
}
|
||||
}
|
||||
|
||||
f32 Math_atanf(f32 x) {
|
||||
if (use_cfrac == 0) {
|
||||
return Math_atanf_taylor(x);
|
||||
} else {
|
||||
return Math_atanf_cfrac(x);
|
||||
}
|
||||
}
|
||||
|
||||
f32 Math_atan2f(f32 y, f32 x) {
|
||||
if (x == 0.f) {
|
||||
if (y == 0.f) {
|
||||
return 0.f;
|
||||
} else if (y > 0.f) {
|
||||
return M_PI / 2;
|
||||
} else if (y < 0.f) {
|
||||
return -M_PI / 2;
|
||||
} else {
|
||||
return qNaN0x10000;
|
||||
}
|
||||
} else if (x >= 0.f) {
|
||||
return Math_atanf(y / x);
|
||||
} else if (y < 0.f) {
|
||||
return Math_atanf(y / x) - M_PI;
|
||||
} else {
|
||||
return M_PI - Math_atanf(-(y / x));
|
||||
}
|
||||
}
|
||||
|
||||
f32 Math_asinf(f32 x) {
|
||||
return Math_atan2f(x, sqrtf(1.f - SQ(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);
|
||||
}
|
||||
|
||||
+254
-268
@@ -1,10 +1,10 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
#include <alloca.h>
|
||||
#include <vt.h>
|
||||
|
||||
//data
|
||||
const char* sExceptionNames[] =
|
||||
{
|
||||
// data
|
||||
const char* sExceptionNames[] = {
|
||||
"Interrupt",
|
||||
"TLB modification",
|
||||
"TLB exception on load",
|
||||
@@ -31,7 +31,7 @@ const char* sExceptionNames[] =
|
||||
"Inexact operation",
|
||||
};
|
||||
|
||||
//bss
|
||||
// bss
|
||||
FaultThreadStruct* sFaultStructPtr;
|
||||
u8 sFaultIsWaitingForInput;
|
||||
char sFaultStack[0x600];
|
||||
@@ -40,76 +40,67 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void Fault_ProcessClientContext(FaultClientContext* ctx)
|
||||
{
|
||||
void Fault_ProcessClientContext(FaultClientContext* ctx) {
|
||||
OSMesgQueue queue;
|
||||
OSMesg msg;
|
||||
OSThread* t;
|
||||
OSTimer timer;
|
||||
OSMesg recMsg;
|
||||
OSThread* thread;
|
||||
OSTimer timer;
|
||||
u32 timerMsgVal;
|
||||
|
||||
timerMsgVal = 666;
|
||||
thread = NULL;
|
||||
|
||||
osCreateMesgQueue(&queue, &msg, 1);
|
||||
ctx->queue = &queue;
|
||||
ctx->msg = NULL;
|
||||
if (sFaultStructPtr->currClientThreadSp)
|
||||
{
|
||||
|
||||
if (sFaultStructPtr->currClientThreadSp != 0) {
|
||||
thread = alloca(sizeof(OSThread));
|
||||
osCreateThread(thread, 2, Fault_ClientProcessThread, ctx, sFaultStructPtr->currClientThreadSp, 0x7E);
|
||||
osStartThread(thread);
|
||||
} else {
|
||||
Fault_ClientProcessThread(ctx);
|
||||
t = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
OSThread thread;
|
||||
osCreateThread(&thread, 2, &Fault_ClientProcessThread, ctx, sFaultStructPtr->currClientThreadSp, 0x7E);
|
||||
osStartThread(&thread);
|
||||
t = &thread;
|
||||
}
|
||||
|
||||
while(true)
|
||||
{
|
||||
osSetTimer(&timer, OS_USEC_TO_CYCLES(1000000), 0, &queue, (OSMesg)0x29A);
|
||||
while (true) {
|
||||
osSetTimer(&timer, OS_USEC_TO_CYCLES(1000000), 0, &queue, (OSMesg)timerMsgVal);
|
||||
osRecvMesg(&queue, &recMsg, 1);
|
||||
|
||||
if (recMsg == (OSMesg)0x29A)
|
||||
if (recMsg != (OSMesg)666) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (sFaultIsWaitingForInput)
|
||||
{
|
||||
if (!sFaultIsWaitingForInput) {
|
||||
ctx->ret = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
osStopTimer(&timer);
|
||||
if (t)
|
||||
{
|
||||
osStopThread(t);
|
||||
//osDestroyThread(t);
|
||||
osDestroyThread(t);
|
||||
|
||||
if (thread != NULL) {
|
||||
osStopThread(thread);
|
||||
osDestroyThread(thread);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_ProcessClientContext.s")
|
||||
#endif
|
||||
|
||||
|
||||
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,16 +111,19 @@ u32 Fault_ProcessClient(u32 callback, u32 param0, u32 param1)
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void Fault_AddClient(FaultClient *client, void* callback, void* param0, void* param1)
|
||||
{
|
||||
bool alreadyExist = false;
|
||||
OSIntMask mask = osSetIntMask(1);
|
||||
FaultClient* iter = sFaultStructPtr->clients;
|
||||
while (iter)
|
||||
{
|
||||
if (iter == client)
|
||||
{
|
||||
alreadyExist = true;
|
||||
// minor ordering differences
|
||||
void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* param1) {
|
||||
OSIntMask mask;
|
||||
u32 alreadyExists;
|
||||
FaultClient* iter;
|
||||
|
||||
alreadyExists = false;
|
||||
mask = osSetIntMask(1);
|
||||
|
||||
iter = sFaultStructPtr->clients;
|
||||
while (iter) {
|
||||
if (iter == client) {
|
||||
alreadyExists = true;
|
||||
goto end;
|
||||
}
|
||||
iter = iter->next;
|
||||
@@ -143,8 +137,9 @@ void Fault_AddClient(FaultClient *client, void* callback, void* param0, void* pa
|
||||
|
||||
end:
|
||||
osSetIntMask(mask);
|
||||
if (alreadyExist)
|
||||
if (alreadyExists) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "fault_AddClient: %08x は既にリスト中にある\n" VT_RST, client);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_AddClient.s")
|
||||
@@ -183,11 +178,11 @@ 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")
|
||||
|
||||
void Fault_RemoveAddrConvClient(FaultAddrConvClient* client) {
|
||||
@@ -224,24 +219,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;
|
||||
}
|
||||
@@ -249,131 +243,127 @@ 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
|
||||
bool Fault_WaitForInputImpl()
|
||||
{
|
||||
// ordering differences and possibly regalloc
|
||||
u32 Fault_WaitForInputImpl() {
|
||||
u16 kDown;
|
||||
bool exitDebugger;
|
||||
|
||||
u32 exitDebugger;
|
||||
s32 count = 600;
|
||||
Input* curInput = &sFaultStructPtr->padInput;
|
||||
while (true)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
|
||||
while (true) {
|
||||
while (true) {
|
||||
Fault_Sleep(0x10);
|
||||
Fault_UpdatePadImpl();
|
||||
|
||||
kDown = curInput->padPressed;
|
||||
if (kDown == 0x20)
|
||||
|
||||
if (kDown == 0x20) {
|
||||
sFaultStructPtr->faultActive = !sFaultStructPtr->faultActive;
|
||||
}
|
||||
|
||||
if (!sFaultStructPtr->faultActive)
|
||||
if (!sFaultStructPtr->faultActive) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (count-- < 1)
|
||||
if (count-- < 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (kDown == 0x8000 || kDown == 0x100)
|
||||
break;
|
||||
if (kDown == 0x200)
|
||||
if (kDown == 0x8000 || kDown == 0x100) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (kDown == 0x200) {
|
||||
return true;
|
||||
if (kDown == 0x800)
|
||||
}
|
||||
|
||||
if (kDown == 0x800) {
|
||||
FaultDrawer_SetOsSyncPrintfEnabled(true);
|
||||
if (kDown == 0x400)
|
||||
}
|
||||
|
||||
if (kDown == 0x400) {
|
||||
FaultDrawer_SetOsSyncPrintfEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
#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)
|
||||
{
|
||||
u32 raw = *(u32*)value;
|
||||
int v0 = ((raw & 0x7f800000) >> 0x17) - 0x7f;
|
||||
|
||||
if ((v0 >= -0x7e && v0 < 0x80) || raw == 0)
|
||||
FaultDrawer_Printf("F%02d:%14.7e ", idx, *value);
|
||||
else
|
||||
FaultDrawer_Printf("F%02d: %08x(16) ", idx, raw);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void Fault_LogFReg(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)
|
||||
osSyncPrintf("F%02d:%14.7e ", idx, *value);
|
||||
else
|
||||
osSyncPrintf("F%02d: %08x(16) ", idx, raw);
|
||||
if ((v0 >= -0x7e && v0 < 0x80) || raw == 0) {
|
||||
FaultDrawer_Printf("F%02d:%14.7e ", idx, *value);
|
||||
} else {
|
||||
FaultDrawer_Printf("F%02d: %08x(16) ", idx, raw);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_LogFReg.s")
|
||||
#endif
|
||||
|
||||
void Fault_PrintFPCR(u32 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) {
|
||||
osSyncPrintf("F%02d:%14.7e ", idx, *value);
|
||||
} else {
|
||||
osSyncPrintf("F%02d: %08x(16) ", idx, *(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;
|
||||
@@ -381,30 +371,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);
|
||||
@@ -455,14 +443,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");
|
||||
@@ -508,26 +497,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;
|
||||
}
|
||||
@@ -554,7 +540,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);
|
||||
@@ -567,65 +553,83 @@ void Fault_DrawMemDumpPage(const char* title, u32* addr, u32 param_3) {
|
||||
FaultDrawer_SetCharPad(0, 0);
|
||||
}
|
||||
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1)
|
||||
{
|
||||
s32 count;
|
||||
u16 held;
|
||||
s32 off;
|
||||
// saved register and stack usage differences
|
||||
// possibly some minor ordering and regalloc differences
|
||||
void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) {
|
||||
Input* curInput = &sFaultStructPtr->padInput;
|
||||
u32 addr = pc;
|
||||
while (true)
|
||||
{
|
||||
if (addr < 0x80000000)
|
||||
s32 count;
|
||||
s32 off;
|
||||
|
||||
while (true) {
|
||||
if (addr < 0x80000000) {
|
||||
addr = 0x80000000;
|
||||
if (addr > 0x807fff00)
|
||||
}
|
||||
if (addr > 0x807fff00) {
|
||||
addr = 0x807fff00;
|
||||
}
|
||||
|
||||
addr &= ~0xF;
|
||||
Fault_DrawMemDumpPage("Dump", (u32*)addr);
|
||||
Fault_DrawMemDumpPage("Dump", (u32*)addr, 0);
|
||||
count = 600;
|
||||
while (sFaultStructPtr->faultActive)
|
||||
{
|
||||
if (count-- == 0)
|
||||
return;
|
||||
Fault_Sleep(0x10);
|
||||
Fault_UpdatePadImpl();
|
||||
if ((sFaultStructPtr->padInput.padPressed | ~0x20) == ~0x20)
|
||||
sFaultStructPtr->faultActive = false;
|
||||
}
|
||||
do
|
||||
{
|
||||
Fault_Sleep(0x10);
|
||||
Fault_UpdatePadImpl();
|
||||
} while (sFaultStructPtr->padInput.padPressed == 0);
|
||||
|
||||
if ((sFaultStructPtr->padInput.padPressed | ~0x1000) == ~0)
|
||||
while (sFaultStructPtr->faultActive) {
|
||||
if (count == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
count--;
|
||||
Fault_Sleep(0x10);
|
||||
Fault_UpdatePadImpl();
|
||||
if (!~(curInput->padPressed | ~0x20)) {
|
||||
sFaultStructPtr->faultActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
Fault_Sleep(0x10);
|
||||
Fault_UpdatePadImpl();
|
||||
} while (curInput->padPressed == 0);
|
||||
|
||||
if (!~(curInput->padPressed | ~0x1000)) {
|
||||
return;
|
||||
held = sFaultStructPtr->padInput.status;
|
||||
if ((held | ~0x8000) == ~0)
|
||||
}
|
||||
|
||||
if (!~(curInput->raw.pad | ~0x8000)) {
|
||||
return;
|
||||
}
|
||||
|
||||
off = 0x10;
|
||||
if ((held | ~0x2000) == ~0)
|
||||
if (!~(curInput->raw.pad | ~0x2000)) {
|
||||
off = 0x100;
|
||||
if ((held | ~0x4000) == ~0)
|
||||
}
|
||||
if (!~(curInput->raw.pad | ~0x4000)) {
|
||||
off <<= 8;
|
||||
if ((held | ~0x800) == ~0)
|
||||
}
|
||||
if (!~(curInput->raw.pad | ~0x800)) {
|
||||
addr -= off;
|
||||
if ((held | ~0x400) == ~0)
|
||||
addr -= off;
|
||||
if ((held | ~0x8) == ~0)
|
||||
}
|
||||
if (!~(curInput->raw.pad | ~0x400)) {
|
||||
addr += off;
|
||||
}
|
||||
if (!~(curInput->raw.pad | ~0x8)) {
|
||||
addr = pc;
|
||||
if ((held | ~0x4) == ~0)
|
||||
}
|
||||
if (!~(curInput->raw.pad | ~0x4)) {
|
||||
addr = sp;
|
||||
if ((held | ~0x2) == ~0)
|
||||
}
|
||||
if (!~(curInput->raw.pad | ~0x2)) {
|
||||
addr = unk0;
|
||||
if ((held | ~0x1) == ~0)
|
||||
}
|
||||
if (!~(curInput->raw.pad | ~0x1)) {
|
||||
addr = unk1;
|
||||
if ((held | ~0x20) == ~0)
|
||||
}
|
||||
if (!~(curInput->raw.pad | ~0x20)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sFaultStructPtr->faultActive = true;
|
||||
}
|
||||
#else
|
||||
@@ -638,8 +642,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;
|
||||
@@ -649,38 +652,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();
|
||||
@@ -690,71 +694,60 @@ void Fault_ProcessClients(void)
|
||||
}
|
||||
}
|
||||
|
||||
void Fault_UpdatePad()
|
||||
{
|
||||
void Fault_UpdatePad() {
|
||||
Fault_UpdatePadImpl();
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
|
||||
void Fault_ThreadEntry(u32 unused)
|
||||
{
|
||||
OSThread *faultedThread;
|
||||
// saved register and stack usage differences
|
||||
void Fault_ThreadEntry(void* arg) {
|
||||
OSThread* faultedThread;
|
||||
OSMesg msg;
|
||||
|
||||
//osSetEventMesg
|
||||
osSetEventMesg(OS_EVENT_CPU_BREAK, &sFaultStructPtr->queue, 1);
|
||||
osSetEventMesg(OS_EVENT_FAULT, &sFaultStructPtr->queue, 2);
|
||||
while (true)
|
||||
{
|
||||
osRecvMesg(&sFaultStructPtr->queue, &msg, 1);
|
||||
|
||||
if (msg == (OSMesg)1)
|
||||
{
|
||||
sFaultStructPtr->msgId = 1;
|
||||
osSyncPrintf("フォルトマネージャ:OS_EVENT_CPU_BREAKを受信しました\n");
|
||||
}
|
||||
else if (msg == (OSMesg)2)
|
||||
{
|
||||
sFaultStructPtr->msgId = 2;
|
||||
osSyncPrintf("フォルトマネージャ:OS_EVENT_FAULTを受信しました\n");
|
||||
}
|
||||
else if (msg != (OSMesg)3)
|
||||
{
|
||||
sFaultStructPtr->msgId = (u8)3;
|
||||
osSyncPrintf("フォルトマネージャ:不明なメッセージを受信しました\n");
|
||||
}
|
||||
while (true) {
|
||||
do {
|
||||
osRecvMesg(&sFaultStructPtr->queue, &msg, 1);
|
||||
|
||||
if (msg == (OSMesg)1) {
|
||||
sFaultStructPtr->msgId = 1;
|
||||
osSyncPrintf("フォルトマネージャ:OS_EVENT_CPU_BREAKを受信しました\n");
|
||||
} else if (1 && msg == (OSMesg)2) {
|
||||
sFaultStructPtr->msgId = 2;
|
||||
osSyncPrintf("フォルトマネージャ:OS_EVENT_FAULTを受信しました\n");
|
||||
} else if (msg == (OSMesg)3) {
|
||||
Fault_UpdatePad();
|
||||
faultedThread = NULL;
|
||||
continue;
|
||||
} else {
|
||||
sFaultStructPtr->msgId = 3;
|
||||
osSyncPrintf("フォルトマネージャ:不明なメッセージを受信しました\n");
|
||||
}
|
||||
|
||||
if (msg == (OSMesg)3)
|
||||
{
|
||||
Fault_UpdatePad();
|
||||
faultedThread = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
faultedThread = __osGetCurrFaultedThread();
|
||||
osSyncPrintf("__osGetCurrFaultedThread()=%08x\n", faultedThread);
|
||||
if (!faultedThread)
|
||||
{
|
||||
|
||||
if (faultedThread == NULL) {
|
||||
faultedThread = Fault_FindFaultedThread();
|
||||
osSyncPrintf("FindFaultedThread()=%08x\n", faultedThread);
|
||||
}
|
||||
}
|
||||
|
||||
if (!faultedThread)
|
||||
continue;
|
||||
} while (faultedThread == NULL);
|
||||
|
||||
__osSetFpcCsr(__osGetFpcCsr() & -0xf81);
|
||||
sFaultStructPtr->faultedThread = faultedThread;
|
||||
while (!sFaultStructPtr->faultHandlerEnabled)
|
||||
|
||||
while (!sFaultStructPtr->faultHandlerEnabled) {
|
||||
Fault_Sleep(1000);
|
||||
}
|
||||
|
||||
Fault_Sleep(500);
|
||||
Fault_CommitFB();
|
||||
|
||||
if (sFaultStructPtr->faultActive)
|
||||
if (sFaultStructPtr->faultActive) {
|
||||
Fault_Wait5Seconds();
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Fault_DrawCornerRec(0xF801);
|
||||
Fault_WaitForButtonCombo();
|
||||
}
|
||||
@@ -763,8 +756,7 @@ void Fault_ThreadEntry(u32 unused)
|
||||
FaultDrawer_SetForeColor(0xFFFF);
|
||||
FaultDrawer_SetBackColor(0);
|
||||
|
||||
do
|
||||
{
|
||||
do {
|
||||
Fault_PrintThreadContext(faultedThread);
|
||||
Fault_LogThreadContext(faultedThread);
|
||||
Fault_WaitForInput();
|
||||
@@ -781,10 +773,9 @@ void Fault_ThreadEntry(u32 unused)
|
||||
FaultDrawer_DrawText(0x40, 0x64, " THANK YOU! ");
|
||||
FaultDrawer_DrawText(0x40, 0x6E, " You are great debugger!");
|
||||
Fault_WaitForInput();
|
||||
|
||||
} while (!sFaultStructPtr->exitDebugger);
|
||||
|
||||
while(!sFaultStructPtr->exitDebugger){}
|
||||
while (!sFaultStructPtr->exitDebugger) {}
|
||||
|
||||
Fault_ResumeThread(faultedThread);
|
||||
}
|
||||
@@ -793,14 +784,12 @@ void Fault_ThreadEntry(u32 unused)
|
||||
#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();
|
||||
@@ -814,13 +803,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)");
|
||||
@@ -829,16 +817,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);
|
||||
|
||||
+167
-180
@@ -2,277 +2,268 @@
|
||||
#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)
|
||||
{
|
||||
s32 x, y;
|
||||
for (y = 0; y < yend-ystart+1; y++)
|
||||
for (x = 0; x < xend-xstart+1; x++)
|
||||
sFaultDrawerStruct.fb[sFaultDrawerStruct.w*y+x] = color;
|
||||
void FaultDrawer_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 color) {
|
||||
u16* fb;
|
||||
s32 x, y;
|
||||
s32 xDiff = sFaultDrawerStruct.w - xStart;
|
||||
s32 yDiff = sFaultDrawerStruct.h - yStart;
|
||||
s32 xSize = xEnd - xStart + 1;
|
||||
s32 ySize = yEnd - yStart + 1;
|
||||
|
||||
if (xDiff > 0 && yDiff > 0) {
|
||||
if (xDiff < xSize) {
|
||||
xSize = xDiff;
|
||||
}
|
||||
|
||||
if (yDiff < ySize) {
|
||||
ySize = yDiff;
|
||||
}
|
||||
|
||||
fb = sFaultDrawerStruct.fb + sFaultDrawerStruct.w * yStart + xStart;
|
||||
for (y = 0; y < ySize; y++) {
|
||||
for (x = 0; x < xSize; x++) {
|
||||
*fb++ = color;
|
||||
}
|
||||
fb += sFaultDrawerStruct.w - xSize;
|
||||
}
|
||||
|
||||
osWritebackDCacheAll();
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault_drawer/FaultDrawer_DrawRecImpl.s")
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void FaultDrawer_DrawChar(char c)
|
||||
{
|
||||
void FaultDrawer_DrawChar(char c) {
|
||||
u16* fb;
|
||||
s32 x, y;
|
||||
u32* dataStart = &sFaultDrawerStruct.fontData[(c >> 3) * 0x10 + (c & 4) >> 2];
|
||||
u16* fb = &sFaultDrawerStruct.fb[sFaultDrawerStruct.w * sFaultDrawerStruct.cursorY + sFaultDrawerStruct.cursorX];
|
||||
u32* dataPtr;
|
||||
u32 data;
|
||||
s32 cursorX = sFaultDrawerStruct.cursorX;
|
||||
s32 cursorY = sFaultDrawerStruct.cursorY;
|
||||
u32** fontData = &sFaultDrawerStruct.fontData;
|
||||
s32 shift = c % 4;
|
||||
|
||||
if (sFaultDrawerStruct.xStart <= sFaultDrawerStruct.cursorX &&
|
||||
sFaultDrawerStruct.charW + sFaultDrawerStruct.cursorX -1 <= sFaultDrawerStruct.xEnd &&
|
||||
sFaultDrawerStruct.yStart <= sFaultDrawerStruct.cursorY &&
|
||||
sFaultDrawerStruct.charH + sFaultDrawerStruct.cursorY -1 <= sFaultDrawerStruct.yEnd &&
|
||||
sFaultDrawerStruct.charH != 0
|
||||
)
|
||||
{
|
||||
for (y = 0; y < sFaultDrawerStruct.charH; y++)
|
||||
{
|
||||
u32 mask = 0x10000000 << (c & 3);
|
||||
for (x = 0; x < sFaultDrawerStruct.charW; x++)
|
||||
{
|
||||
if ((mask & *dataStart))
|
||||
dataPtr = &fontData[0][(((c / 8) * 16) + ((c & 4) >> 2))];
|
||||
fb = sFaultDrawerStruct.fb + (sFaultDrawerStruct.w * cursorY) + cursorX;
|
||||
|
||||
if ((sFaultDrawerStruct.xStart <= cursorX) &&
|
||||
((sFaultDrawerStruct.charW + cursorX - 1) <= sFaultDrawerStruct.xEnd) &&
|
||||
(sFaultDrawerStruct.yStart <= cursorY) &&
|
||||
((sFaultDrawerStruct.charH + cursorY - 1) <= sFaultDrawerStruct.yEnd)) {
|
||||
for (y = 0; y < sFaultDrawerStruct.charH; y++) {
|
||||
u32 mask = 0x10000000 << shift;
|
||||
data = *dataPtr;
|
||||
for (x = 0; x < sFaultDrawerStruct.charW; x++) {
|
||||
if (mask & data) {
|
||||
fb[x] = sFaultDrawerStruct.foreColor;
|
||||
else
|
||||
if (sFaultDrawerStruct.backColor & 1)
|
||||
fb[x] = sFaultDrawerStruct.backColor;
|
||||
} else if (sFaultDrawerStruct.backColor & 1) {
|
||||
fb[x] = sFaultDrawerStruct.backColor;
|
||||
}
|
||||
mask >>= 4;
|
||||
}
|
||||
fb += sFaultDrawerStruct.w;
|
||||
dataStart += 2;
|
||||
dataPtr += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
#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(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);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count)
|
||||
{
|
||||
while (count)
|
||||
{
|
||||
s32 curXStart; //s32?
|
||||
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)
|
||||
FaultDrawer_SetForeColor(gFaultStruct.colors[*str + 12]);
|
||||
if (*str > 0x30 && *str < 0x3A) {
|
||||
FaultDrawer_SetForeColor(sFaultDrawerStruct.printColors[*str - 0x30]);
|
||||
}
|
||||
|
||||
curXStart = sFaultDrawerStruct.cursorX;
|
||||
curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*str == '\n')
|
||||
{
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled)
|
||||
osSyncPrintf("\n");
|
||||
} else {
|
||||
switch (*str) {
|
||||
case '\n':
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled) {
|
||||
osSyncPrintf("\n");
|
||||
}
|
||||
|
||||
sFaultDrawerStruct.cursorX = sFaultDrawerStruct.w;
|
||||
curXStart = sFaultDrawerStruct.w;
|
||||
curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW;
|
||||
}
|
||||
else if (*str == '\x1a')
|
||||
{
|
||||
sFaultDrawerStruct.escCode = true;
|
||||
curXStart = sFaultDrawerStruct.cursorX;
|
||||
curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled)
|
||||
osSyncPrintf("%c", *str);
|
||||
sFaultDrawerStruct.cursorX = sFaultDrawerStruct.w;
|
||||
curXStart = sFaultDrawerStruct.cursorX;
|
||||
curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW;
|
||||
break;
|
||||
case '\x1A':
|
||||
sFaultDrawerStruct.escCode = true;
|
||||
curXStart = sFaultDrawerStruct.cursorX;
|
||||
curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW;
|
||||
break;
|
||||
default:
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled) {
|
||||
osSyncPrintf("%c", *str);
|
||||
}
|
||||
|
||||
FaultDrawer_DrawChar(*str);
|
||||
sFaultDrawerStruct.cursorX += sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad;
|
||||
FaultDrawer_DrawChar(*str);
|
||||
sFaultDrawerStruct.cursorX += sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad;
|
||||
|
||||
curXStart = sFaultDrawerStruct.cursorX;
|
||||
curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW;
|
||||
curXStart = sFaultDrawerStruct.cursorX;
|
||||
curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW;
|
||||
}
|
||||
}
|
||||
|
||||
if (curXEnd <= curXStart)
|
||||
{
|
||||
sFaultDrawerStruct.cursorY += sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad;
|
||||
if (curXEnd <= curXStart) {
|
||||
sFaultDrawerStruct.cursorX = sFaultDrawerStruct.xStart;
|
||||
if (sFaultDrawerStruct.yEnd - sFaultDrawerStruct.charH <= (u16)sFaultDrawerStruct.cursorY) //cast?
|
||||
{
|
||||
if (sFaultDrawerStruct.inputCallback)
|
||||
{
|
||||
sFaultDrawerStruct.cursorY += sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad;
|
||||
if (sFaultDrawerStruct.yEnd - sFaultDrawerStruct.charH <= sFaultDrawerStruct.cursorY) {
|
||||
if (sFaultDrawerStruct.inputCallback) {
|
||||
sFaultDrawerStruct.inputCallback();
|
||||
FaultDrawer_FillScreen();
|
||||
}
|
||||
sFaultDrawerStruct.cursorY = sFaultDrawerStruct.yStart;
|
||||
}
|
||||
}
|
||||
|
||||
count--;
|
||||
str++;
|
||||
}
|
||||
|
||||
osWritebackDCacheAll();
|
||||
|
||||
return arg0;
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault_drawer/FaultDrawer_FormatStringFunc.s")
|
||||
#endif
|
||||
|
||||
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);
|
||||
|
||||
@@ -280,25 +271,21 @@ void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...)
|
||||
FaultDrawer_VPrintf(fmt, args);
|
||||
}
|
||||
|
||||
void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h)
|
||||
{
|
||||
sFaultDrawerStruct.fb = (u16*)fb;
|
||||
void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h) {
|
||||
sFaultDrawerStruct.fb = 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;
|
||||
|
||||
+255
-268
@@ -1,159 +1,204 @@
|
||||
#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
|
||||
void GfxPrint_InitDlist(GfxPrint* this)
|
||||
{
|
||||
u32 palette;
|
||||
u32 tile;
|
||||
// regalloc and minor ordering differences
|
||||
void GfxPrint_InitDlist(GfxPrint* this) {
|
||||
s32 width = 16;
|
||||
s32 height = 256;
|
||||
s32 i;
|
||||
|
||||
gDPPipeSync(this->dlist++);
|
||||
gDPSetOtherMode(this->dlist++, 0xECF0, 0x504244);
|
||||
gDPSetCombineLERP(this->dlist++, K5, K5, 0, TEXEL0, 0, 0, 0, TEXEL0, K5, K5, 0, TEXEL0, 0, 0, 0, TEXEL0);
|
||||
gDPLoadTextureBlock(this->dlist++, sGfxPrintFontData, G_IM_FMT_CI, G_IM_SIZ_4b, 16, 256, 0, 0, 0, 0, 0, 0, 0); //? missmatch here
|
||||
gDPLoadTLUT(this->dlist++, 64, 0x100, sGfxPrintFontTLUT);
|
||||
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_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2);
|
||||
gDPSetCombineMode(this->dlist++, G_CC_DECALRGBA, G_CC_DECALRGBA);
|
||||
|
||||
tile = 2;
|
||||
palette = 1;
|
||||
do
|
||||
{
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0x0, tile, palette++, G_TX_NOMIRROR | G_TX_CLAMP, 0, 0, G_TX_NOMIRROR | G_TX_CLAMP, 0, 0);
|
||||
gDPSetTileSize(this->dlist++, tile, 0, 0, 15, 255);
|
||||
tile+=2;
|
||||
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);
|
||||
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));
|
||||
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,
|
||||
((height)-1) << G_TEXTURE_IMAGE_FRAC);
|
||||
|
||||
} while (palette < 4);
|
||||
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);
|
||||
gDPSetTileSize(this->dlist++, i * 2, 0, 0, 60, 1020);
|
||||
}
|
||||
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color);
|
||||
gDPLoadTextureTile(this->dlist++, sGfxPrintUnkData, G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 0, 7, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 1, 3, 0, 0);
|
||||
gDPLoadTLUT(this->dlist++, 16, 0x140, sGfxPrintUnkTLUT);
|
||||
|
||||
tile = 3;
|
||||
do
|
||||
{
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, tile, 0x0, G_TX_RENDERTILE, 4, G_TX_NOMIRROR | G_TX_WRAP, 3, 0, G_TX_NOMIRROR | G_TX_WRAP, 1, 0);
|
||||
gDPSetTileSize(this->dlist++, tile, 0, 0, 1, 7);
|
||||
tile += 2;
|
||||
} while (tile != 9);
|
||||
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);
|
||||
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,
|
||||
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);
|
||||
gDPSetTileSize(this->dlist++, i * 2 + 1, 0, 0, 4, 28);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#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;
|
||||
@@ -162,193 +207,141 @@ 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;
|
||||
}
|
||||
|
||||
//close from matching
|
||||
#ifdef NON_MATCHING
|
||||
void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c)
|
||||
{
|
||||
u32 test;
|
||||
u32 test2;
|
||||
|
||||
if (this->flag & GFXPRINT_UPDATE_MODE)
|
||||
{
|
||||
// regalloc and ordering differences
|
||||
void GfxPrint_PrintCharImpl(GfxPrint* this, u8 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, K5, TEXEL1, COMBINED_ALPHA, TEXEL0, 0, TEXEL1, 0, K5, K5, 0, COMBINED, 0, 0, 0, COMBINED);
|
||||
}
|
||||
else
|
||||
{
|
||||
gDPSetCombineMode(this->dlist++, G_CC_INTERFERENCE, G_CC_PASS2);
|
||||
} 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, K5, PRIMITIVE, COMBINED_ALPHA, 0, 0, 0, TEXEL0, TEXEL0, K5, PRIMITIVE, COMBINED_ALPHA, 0, 0, 0, TEXEL0);
|
||||
gDPSetCombineMode(this->dlist++, G_CC_MODULATEIDECALA_PRIM, G_CC_MODULATEIDECALA_PRIM);
|
||||
}
|
||||
}
|
||||
|
||||
test = (c & 4) << 6;
|
||||
test2 = (c >> 3) << 8;
|
||||
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+0x24)<<1, (this->posY+0x24)<<1, c<<1, test, test2, 512, 512); //c*2 ?
|
||||
else
|
||||
gSPTextureRectangle(this->dlist++, this->posX+4, this->posY+4, this->posX+0x24, this->posY+0x24, c<<1, test, test2, 1024, 1024);
|
||||
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);
|
||||
} 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);
|
||||
}
|
||||
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color);
|
||||
}
|
||||
if (this->flag & GFXPRINT_FLAG64)
|
||||
gSPTextureRectangle(this->dlist++, (this->posX)<<1, (this->posY)<<1, (this->posX + 0x20)<<1, (this->posY + 0x20)<<1, c << 1, test, test2, 512, 512);
|
||||
else
|
||||
gSPTextureRectangle(this->dlist++, this->posX, this->posY, this->posX + 0x20, this->posY + 0x20, c << 1, test, test2, 1024, 1024);
|
||||
|
||||
this->posX += 0x20;
|
||||
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);
|
||||
} 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);
|
||||
}
|
||||
|
||||
this->posX += 32;
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/gfxprint/GfxPrint_PrintCharImpl.s")
|
||||
#endif
|
||||
|
||||
void GfxPrint_PrintChar(GfxPrint* this, u8 c) {
|
||||
u8 charParam = c;
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void GfxPrint_PrintChar(GfxPrint *this, char c)
|
||||
{
|
||||
if (c == ' ')
|
||||
if (c == ' ') {
|
||||
this->posX += 0x20;
|
||||
else if (c > 0x20 && c < 0x7f)
|
||||
GfxPrint_PrintCharImpl(this, c);
|
||||
else if (c >= 0xa0 && c < 0xe0)
|
||||
{
|
||||
u8 charParam = c;
|
||||
if ((this->flag & GFXPRINT_FLAG1) != 0)
|
||||
{
|
||||
if (c < 0xc0)
|
||||
} else if (c > 0x20 && c < 0x7F) {
|
||||
GfxPrint_PrintCharImpl(this, charParam);
|
||||
} 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:
|
||||
return;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
return;
|
||||
//tab
|
||||
case 9:
|
||||
{
|
||||
u32 uVar1;
|
||||
break;
|
||||
case '\n':
|
||||
this->posY += 0x20;
|
||||
case '\r':
|
||||
this->posX = this->baseX;
|
||||
break;
|
||||
case '\t':
|
||||
do {
|
||||
GfxPrint_PrintCharImpl(this, 0x20);
|
||||
uVar1 = this->posX - this->baseX;
|
||||
if (uVar1 < 0 && uVar1 != 0)
|
||||
uVar1 -= 0x100;
|
||||
} while (uVar1 != 0);
|
||||
return;
|
||||
}
|
||||
//line feed
|
||||
case 0xa:
|
||||
{
|
||||
this->posY += 0x20;
|
||||
this->posX = this->baseX;
|
||||
return;
|
||||
}
|
||||
/*
|
||||
case 0xb:
|
||||
case 0xc:
|
||||
return;
|
||||
*/
|
||||
//carriage return
|
||||
case 0xd:
|
||||
{
|
||||
this->posX = this->baseX;
|
||||
return;
|
||||
}
|
||||
case 0x8a:
|
||||
this->flag &= ~GFXPRINT_USE_RGBA16;
|
||||
this->flag |= GFXPRINT_UPDATE_MODE;
|
||||
return;
|
||||
case 0x8b:
|
||||
} while ((this->posX - this->baseX) % 256);
|
||||
break;
|
||||
case 0x8D:
|
||||
this->flag |= GFXPRINT_FLAG1;
|
||||
break;
|
||||
case 0x8C:
|
||||
this->flag &= ~GFXPRINT_FLAG1;
|
||||
break;
|
||||
case 0x8B:
|
||||
this->flag |= GFXPRINT_USE_RGBA16;
|
||||
this->flag |= GFXPRINT_UPDATE_MODE;
|
||||
return;
|
||||
case 0x8c:
|
||||
this->flag &= ~GFXPRINT_FLAG1;
|
||||
return;
|
||||
case 0x8d:
|
||||
this->flag |= GFXPRINT_FLAG1;
|
||||
return;
|
||||
case 0x8e:
|
||||
break;
|
||||
case 0x8A:
|
||||
this->flag &= ~GFXPRINT_USE_RGBA16;
|
||||
this->flag |= GFXPRINT_UPDATE_MODE;
|
||||
break;
|
||||
case 0x8E:
|
||||
default:
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/gfxprint/GfxPrint_PrintChar.s")
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
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;
|
||||
@@ -364,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;
|
||||
@@ -398,15 +387,13 @@ 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);
|
||||
|
||||
GfxPrint_VPrintf(this, fmt, args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,526 @@
|
||||
#include <global.h>
|
||||
#include <ultra64/hardware.h>
|
||||
#include <sched.h>
|
||||
#include <vt.h>
|
||||
#include <PR/os_cont.h>
|
||||
|
||||
#define GFXPOOL_HEAD_MAGIC 0x1234
|
||||
#define GFXPOOL_TAIL_MAGIC 0x5678
|
||||
|
||||
OSTime sGraphUpdateTime;
|
||||
OSTime sGraphSetTaskTime;
|
||||
FaultClient sGraphFaultClient;
|
||||
CfbInfo sGraphCfbInfos[3];
|
||||
FaultClient sGraphUcodeFaultClient;
|
||||
|
||||
UCodeInfo D_8012D230[3] = {
|
||||
{ 1, D_80155F50 }, { 2, NULL }, { 3, D_801120C0 + 0xFB0 }, // D_80113070
|
||||
};
|
||||
|
||||
UCodeInfo D_8012D248[3] = {
|
||||
{ 1, D_80155F50 }, { 2, NULL }, { 3, D_801120C0 + 0xFB0 }, // D_80113070
|
||||
};
|
||||
|
||||
void Graph_FaultClient() {
|
||||
void* nextFb;
|
||||
void* newFb;
|
||||
|
||||
nextFb = osViGetNextFramebuffer();
|
||||
newFb = ((u32)SysCfb_GetFbPtr(0) != (u32)nextFb) ? SysCfb_GetFbPtr(0) : SysCfb_GetFbPtr(1);
|
||||
|
||||
osViSwapBuffer(newFb);
|
||||
Fault_WaitForInput();
|
||||
osViSwapBuffer(nextFb);
|
||||
}
|
||||
|
||||
void Graph_DisassembleUCode(void* arg0) {
|
||||
UCodeDisas disassembler;
|
||||
|
||||
if (HREG(80) == 7 && HREG(81) != 0) {
|
||||
func_800D7F5C(&disassembler);
|
||||
disassembler.enableLog = HREG(83);
|
||||
func_800DAC80(&disassembler, 3, D_8012D230);
|
||||
func_800DAC90(&disassembler, D_80155F50);
|
||||
func_800D8400(&disassembler, arg0);
|
||||
HREG(93) = disassembler.dlCnt;
|
||||
HREG(84) = disassembler.tri2Cnt * 2 + disassembler.tri1Cnt + (disassembler.quadCnt * 2) + disassembler.lineCnt;
|
||||
HREG(85) = disassembler.vtxCnt;
|
||||
HREG(86) = disassembler.spvtxCnt;
|
||||
HREG(87) = disassembler.tri1Cnt;
|
||||
HREG(88) = disassembler.tri2Cnt;
|
||||
HREG(89) = disassembler.quadCnt;
|
||||
HREG(90) = disassembler.lineCnt;
|
||||
HREG(91) = disassembler.syncErr;
|
||||
HREG(92) = disassembler.loaducodeCnt;
|
||||
if (HREG(82) == 1 || HREG(82) == 2) {
|
||||
osSyncPrintf("vtx_cnt=%d\n", disassembler.vtxCnt);
|
||||
osSyncPrintf("spvtx_cnt=%d\n", disassembler.spvtxCnt);
|
||||
osSyncPrintf("tri1_cnt=%d\n", disassembler.tri1Cnt);
|
||||
osSyncPrintf("tri2_cnt=%d\n", disassembler.tri2Cnt);
|
||||
osSyncPrintf("quad_cnt=%d\n", disassembler.quadCnt);
|
||||
osSyncPrintf("line_cnt=%d\n", disassembler.lineCnt);
|
||||
osSyncPrintf("sync_err=%d\n", disassembler.syncErr);
|
||||
osSyncPrintf("loaducode_cnt=%d\n", disassembler.loaducodeCnt);
|
||||
osSyncPrintf("dl_depth=%d\n", disassembler.dlDepth);
|
||||
osSyncPrintf("dl_cnt=%d\n", disassembler.dlCnt);
|
||||
}
|
||||
func_800D7FC4(&disassembler);
|
||||
}
|
||||
}
|
||||
|
||||
void Graph_UCodeFaultClient(void* arg0) {
|
||||
UCodeDisas disassembler;
|
||||
|
||||
func_800D7F5C(&disassembler);
|
||||
disassembler.enableLog = true;
|
||||
func_800DAC80(&disassembler, 3, D_8012D248);
|
||||
func_800DAC90(&disassembler, D_80155F50);
|
||||
func_800D8400(&disassembler, arg0);
|
||||
func_800D7FC4(&disassembler);
|
||||
}
|
||||
|
||||
void* Graph_InitTHGA(GraphicsContext* gfxCtx) {
|
||||
GfxPool* pool;
|
||||
|
||||
pool = &gGfxPools[gfxCtx->gfxPoolIdx & 1];
|
||||
|
||||
pool->headMagic = GFXPOOL_HEAD_MAGIC;
|
||||
pool->tailMagic = GFXPOOL_TAIL_MAGIC;
|
||||
THGA_Ct(&gfxCtx->polyOpa, pool->polyOpaBuffer, sizeof(pool->polyOpaBuffer));
|
||||
THGA_Ct(&gfxCtx->polyXlu, pool->polyXluBuffer, sizeof(pool->polyXluBuffer));
|
||||
THGA_Ct(&gfxCtx->overlay, pool->overlayBuffer, sizeof(pool->overlayBuffer));
|
||||
THGA_Ct(&gfxCtx->work, pool->workBuffer, sizeof(pool->workBuffer));
|
||||
|
||||
gfxCtx->polyOpaBuffer = pool->polyOpaBuffer;
|
||||
gfxCtx->polyXluBuffer = pool->polyXluBuffer;
|
||||
gfxCtx->overlayBuffer = pool->overlayBuffer;
|
||||
gfxCtx->workBuffer = pool->workBuffer;
|
||||
|
||||
gfxCtx->curFrameBuffer = (u16*)SysCfb_GetFbPtr(gfxCtx->fbIdx % 2);
|
||||
gfxCtx->unk_014 = 0;
|
||||
}
|
||||
|
||||
GameStateOverlay* Graph_GetNextGameState() {
|
||||
void* gameStateInitFunc;
|
||||
|
||||
gameStateInitFunc = func_800C546C();
|
||||
if (gameStateInitFunc == TitleSetup_Init) {
|
||||
return &gGameStateOverlayTable[0];
|
||||
}
|
||||
if (gameStateInitFunc == func_80801E44) {
|
||||
return &gGameStateOverlayTable[1];
|
||||
}
|
||||
if (gameStateInitFunc == Title_Init) {
|
||||
return &gGameStateOverlayTable[2];
|
||||
}
|
||||
if (gameStateInitFunc == func_800BCA64) {
|
||||
return &gGameStateOverlayTable[3];
|
||||
}
|
||||
if (gameStateInitFunc == Opening_Init) {
|
||||
return &gGameStateOverlayTable[4];
|
||||
}
|
||||
if (gameStateInitFunc == func_80811A20) {
|
||||
return &gGameStateOverlayTable[5];
|
||||
}
|
||||
|
||||
LOG_ADDRESS("game_init_func", gameStateInitFunc, "../graph.c", 696);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Graph_Init(GraphicsContext* gfxCtx) {
|
||||
bzero(gfxCtx, sizeof(GraphicsContext));
|
||||
gfxCtx->gfxPoolIdx = 0;
|
||||
gfxCtx->fbIdx = 0;
|
||||
gfxCtx->viMode = NULL;
|
||||
gfxCtx->viFeatures = gViConfigFeatures;
|
||||
gfxCtx->xScale = gViConfigXScale;
|
||||
gfxCtx->yScale = gViConfigYScale;
|
||||
osCreateMesgQueue(&gfxCtx->queue, gfxCtx->msgBuff, ARRAY_COUNT(gfxCtx->msgBuff));
|
||||
func_800D31F0();
|
||||
Fault_AddClient(&sGraphFaultClient, Graph_FaultClient, 0, 0);
|
||||
}
|
||||
|
||||
void Graph_Destroy(GraphicsContext* gfxCtx) {
|
||||
func_800D3210();
|
||||
Fault_RemoveClient(&sGraphFaultClient);
|
||||
}
|
||||
|
||||
// Close to matching, reordering at the end
|
||||
#ifdef NON_MATCHING
|
||||
void Graph_TaskSet00(GraphicsContext* gfxCtx) {
|
||||
static u32 D_8012D260 = 0;
|
||||
static s32 sGraphCfbInfoIdx = 0;
|
||||
|
||||
OSTimer timer;
|
||||
OSMesg msg;
|
||||
OSMesgQueue* mq;
|
||||
u32 temp;
|
||||
OSTime time;
|
||||
OSTask_t* task;
|
||||
Gfx* dispRefs[3];
|
||||
OSScTask* scTask;
|
||||
CfbInfo* cfb;
|
||||
|
||||
mq = &gfxCtx->queue;
|
||||
task = &gfxCtx->task.list.t;
|
||||
scTask = &gfxCtx->task;
|
||||
|
||||
D_8016A528 = osGetTime() - sGraphSetTaskTime - D_8016A558;
|
||||
|
||||
osSetTimer(&timer, 140625000, 0, mq, 666);
|
||||
|
||||
osRecvMesg(mq, &msg, OS_MESG_BLOCK);
|
||||
osStopTimer(&timer);
|
||||
if (msg == (OSMesg)666) {
|
||||
osSyncPrintf(VT_FGCOL(RED));
|
||||
osSyncPrintf("RCPが帰ってきませんでした。"); // "RCP did not return."
|
||||
osSyncPrintf(VT_RST);
|
||||
LogUtils_LogHexDump(&HW_REG(SP_MEM_ADDR_REG, u32), 0x20);
|
||||
LogUtils_LogHexDump(&DPC_START_REG, 0x20);
|
||||
LogUtils_LogHexDump(gGfxSPTaskYieldBuffer, sizeof(gGfxSPTaskYieldBuffer));
|
||||
|
||||
SREG(6) = -1;
|
||||
if (D_8012D260) {
|
||||
temp = D_8012D260;
|
||||
HREG(80) = 7;
|
||||
HREG(81) = 1;
|
||||
HREG(82) = 2;
|
||||
D_8012D260 = temp;
|
||||
Graph_DisassembleUCode(temp);
|
||||
}
|
||||
Fault_AddHungupAndCrashImpl("RCP is HUNG UP!!", "Oh! MY GOD!!");
|
||||
}
|
||||
osRecvMesg(mq, &msg, OS_MESG_NOBLOCK);
|
||||
D_8012D260 = gfxCtx->workBuffer;
|
||||
if (gfxCtx->callback) {
|
||||
gfxCtx->callback(gfxCtx, gfxCtx->callbackParam);
|
||||
}
|
||||
|
||||
time = osGetTime();
|
||||
if (D_8016A550) {
|
||||
D_8016A558 = (D_8016A558 + time) - D_8016A550;
|
||||
D_8016A550 = time;
|
||||
}
|
||||
D_8016A520 = D_8016A558;
|
||||
D_8016A558 = 0;
|
||||
sGraphSetTaskTime = osGetTime();
|
||||
|
||||
task->type = M_GFXTASK;
|
||||
task->flags = OS_SC_DRAM_DLIST;
|
||||
task->ucode_boot = SysUcode_GetUCodeBoot();
|
||||
task->ucode_boot_size = SysUcode_GetUcodeBootSize();
|
||||
task->ucode = SysUcode_GetUcode();
|
||||
task->ucode_data = SysUcode_GetUcodeData();
|
||||
task->ucode_size = 0x1000;
|
||||
task->ucode_data_size = 0x800;
|
||||
task->dram_stack = gGfxSPTaskStack;
|
||||
task->dram_stack_size = sizeof(gGfxSPTaskStack);
|
||||
task->output_buff = gGfxSPTaskOutputBuffer;
|
||||
task->output_buff_size = gGfxSPTaskYieldBuffer; // ??
|
||||
task->data_ptr = gfxCtx->workBuffer;
|
||||
|
||||
Graph_OpenDisps(dispRefs, gfxCtx, "../graph.c", 828);
|
||||
task->data_size = (u32)gfxCtx->work.p - (u32)gfxCtx->workBuffer;
|
||||
Graph_CloseDisps(dispRefs, gfxCtx, "../graph.c", 830);
|
||||
|
||||
task->yield_data_ptr = gGfxSPTaskYieldBuffer;
|
||||
task->yield_data_size = sizeof(gGfxSPTaskYieldBuffer);
|
||||
|
||||
scTask->next = NULL;
|
||||
scTask->flags = OS_SC_RCP_MASK | OS_SC_SWAPBUFFER | OS_SC_LAST_TASK;
|
||||
if (SREG(33) & 1) {
|
||||
SREG(33) &= ~1;
|
||||
scTask->flags &= ~OS_SC_SWAPBUFFER;
|
||||
gfxCtx->fbIdx--;
|
||||
}
|
||||
|
||||
scTask->msg = NULL;
|
||||
scTask->msgQ = mq;
|
||||
|
||||
cfb = sGraphCfbInfos + sGraphCfbInfoIdx++;
|
||||
cfb->fb1 = gfxCtx->curFrameBuffer;
|
||||
cfb->swapbuffer = gfxCtx->curFrameBuffer;
|
||||
cfb->viMode = gfxCtx->viMode;
|
||||
cfb->features = gfxCtx->viFeatures;
|
||||
cfb->xScale = gfxCtx->xScale;
|
||||
cfb->yScale = gfxCtx->yScale;
|
||||
cfb->unk_10 = 0;
|
||||
cfb->updateRate = R_UPDATE_RATE;
|
||||
|
||||
scTask->framebuffer = cfb;
|
||||
sGraphCfbInfoIdx = sGraphCfbInfoIdx % ARRAY_COUNT(sGraphCfbInfos);
|
||||
gfxCtx->schedMsgQ = &gSchedContext.cmdQ;
|
||||
|
||||
osSendMesg(&gSchedContext.cmdQ, scTask, OS_MESG_BLOCK);
|
||||
func_800C95F8(&gSchedContext); // osScKickEntryMsg
|
||||
}
|
||||
#else
|
||||
u32 D_8012D260 = 0;
|
||||
u32 sGraphCfbInfoIdx = 0;
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/graph/Graph_TaskSet00.s")
|
||||
#endif
|
||||
|
||||
// Very close to matching, stack usage
|
||||
#ifdef NON_MATCHING
|
||||
void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
|
||||
u32 problem; // 0xC4 -> 0xD4
|
||||
Gfx* dispRefs[5]; // 0xB0 -> 0xC0
|
||||
Gfx* dispRefs2[9]; // 0x8C -> 0x9C
|
||||
Gfx* dispRefs3[9]; // 0x68 -> 0x78
|
||||
u64 time;
|
||||
GfxPool* pool; // 0x4C -> 0x6C
|
||||
|
||||
gameState->unk_A0 = 0;
|
||||
Graph_InitTHGA(gfxCtx);
|
||||
|
||||
Graph_OpenDisps(dispRefs, gfxCtx, "../graph.c", 966);
|
||||
gDPNoOpString(gfxCtx->work.p++, "WORK_DISP 開始", 0);
|
||||
gDPNoOpString(gfxCtx->polyOpa.p++, "POLY_OPA_DISP 開始", 0);
|
||||
gDPNoOpString(gfxCtx->polyXlu.p++, "POLY_XLU_DISP 開始", 0);
|
||||
gDPNoOpString(gfxCtx->overlay.p++, "OVERLAY_DISP 開始", 0);
|
||||
Graph_CloseDisps(dispRefs, gfxCtx, "../graph.c", 975);
|
||||
|
||||
func_800C4A98(gameState); // Game_ReqPadData
|
||||
func_800C4AC8(gameState); // Game_SetGameFrame
|
||||
|
||||
Graph_OpenDisps(dispRefs2, gfxCtx, "../graph.c", 987);
|
||||
gDPNoOpString(gfxCtx->work.p++, "WORK_DISP 終了", 0);
|
||||
gDPNoOpString(gfxCtx->polyOpa.p++, "POLY_OPA_DISP 終了", 0);
|
||||
gDPNoOpString(gfxCtx->polyXlu.p++, "POLY_XLU_DISP 終了", 0);
|
||||
gDPNoOpString(gfxCtx->overlay.p++, "OVERLAY_DISP 終了", 0);
|
||||
Graph_CloseDisps(dispRefs2, gfxCtx, "../graph.c", 996);
|
||||
|
||||
Graph_OpenDisps(dispRefs3, gfxCtx, "../graph.c", 999);
|
||||
gSPBranchList(gfxCtx->work.p++, gfxCtx->polyOpaBuffer);
|
||||
gSPBranchList(gfxCtx->polyOpa.p++, gfxCtx->polyXluBuffer);
|
||||
gSPBranchList(gfxCtx->polyXlu.p++, gfxCtx->overlayBuffer);
|
||||
gDPPipeSync(gfxCtx->overlay.p++);
|
||||
gDPFullSync(gfxCtx->overlay.p++);
|
||||
gSPEndDisplayList(gfxCtx->overlay.p++);
|
||||
Graph_CloseDisps(dispRefs3, gfxCtx, "../graph.c", 1028);
|
||||
|
||||
if (HREG(80) == 10 && HREG(93) == 2) {
|
||||
HREG(80) = 7;
|
||||
HREG(81) = -1;
|
||||
HREG(83) = HREG(92);
|
||||
}
|
||||
if (HREG(80) == 7 && HREG(81) != 0) {
|
||||
if (HREG(82) == 3) {
|
||||
Fault_AddClient(&sGraphUcodeFaultClient, Graph_UCodeFaultClient, gfxCtx->workBuffer, "do_count_fault");
|
||||
}
|
||||
|
||||
Graph_DisassembleUCode(gfxCtx->workBuffer);
|
||||
|
||||
if (HREG(82) == 3) {
|
||||
Fault_RemoveClient(&sGraphUcodeFaultClient);
|
||||
}
|
||||
|
||||
if (HREG(81) < 0) {
|
||||
LogUtils_LogHexDump(&HW_REG(SP_MEM_ADDR_REG, u32), 0x20);
|
||||
LogUtils_LogHexDump(&DPC_START_REG, 0x20);
|
||||
}
|
||||
|
||||
if (HREG(81) < 0) {
|
||||
HREG(81) = 0;
|
||||
}
|
||||
}
|
||||
|
||||
problem = false;
|
||||
pool = &gGfxPools[gfxCtx->gfxPoolIdx & 1];
|
||||
if (pool->headMagic != GFXPOOL_HEAD_MAGIC) {
|
||||
// BUG (?) : devs might've forgotten "problem = true;"
|
||||
osSyncPrintf("%c", 7);
|
||||
// Dynamic area head is destroyed
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "ダイナミック領域先頭が破壊されています\n" VT_RST);
|
||||
Fault_AddHungupAndCrash("../graph.c", 1070);
|
||||
}
|
||||
if (pool->tailMagic != GFXPOOL_TAIL_MAGIC) {
|
||||
problem = true;
|
||||
osSyncPrintf("%c", 7);
|
||||
// Dynamic region tail is destroyed
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "ダイナミック領域末尾が破壊されています\n" VT_RST);
|
||||
Fault_AddHungupAndCrash("../graph.c", 1076);
|
||||
}
|
||||
|
||||
if (THGA_IsCrash(&gfxCtx->polyOpa)) {
|
||||
problem = true;
|
||||
osSyncPrintf("%c", 7);
|
||||
// Zelda 0 is dead
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "ゼルダ0は死んでしまった(graph_alloc is empty)\n" VT_RST);
|
||||
}
|
||||
if (THGA_IsCrash(&gfxCtx->polyXlu)) {
|
||||
problem = true;
|
||||
osSyncPrintf("%c", 7);
|
||||
// Zelda 1 is dead
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "ゼルダ1は死んでしまった(graph_alloc is empty)\n" VT_RST);
|
||||
}
|
||||
if (THGA_IsCrash(&gfxCtx->overlay)) {
|
||||
problem = true;
|
||||
osSyncPrintf("%c", 7);
|
||||
// Zelda 4 is dead
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "ゼルダ4は死んでしまった(graph_alloc is empty)\n" VT_RST);
|
||||
}
|
||||
|
||||
if (!problem) {
|
||||
Graph_TaskSet00(gfxCtx);
|
||||
gfxCtx->gfxPoolIdx++;
|
||||
gfxCtx->fbIdx++;
|
||||
}
|
||||
|
||||
func_800F3054();
|
||||
time = osGetTime();
|
||||
D_8016A538 = D_8016A568;
|
||||
D_8016A530 = D_8016A560;
|
||||
D_8016A540 = D_8016A580;
|
||||
D_8016A568 = 0;
|
||||
D_8016A560 = 0;
|
||||
D_8016A580 = 0;
|
||||
|
||||
if (sGraphUpdateTime != 0) {
|
||||
D_8016A548 = time - sGraphUpdateTime;
|
||||
}
|
||||
sGraphUpdateTime = time;
|
||||
|
||||
if (D_8012DBC0 && (!~(gameState->input[0].padPressed | ~Z_TRIG)) &&
|
||||
(!~(gameState->input[0].raw.pad | ~(L_TRIG | R_TRIG)))) {
|
||||
gSaveContext.game_mode = 0;
|
||||
SET_NEXT_GAMESTATE(gameState, func_80801E44, char[0x240]); // TODO : SelectContext
|
||||
gameState->running = false;
|
||||
}
|
||||
|
||||
if (D_8012DBC0 && PreNmiBuff_IsResetting(gAppNmiBufferPtr) && !gameState->unk_A0) {
|
||||
// To reset mode
|
||||
osSyncPrintf(VT_COL(YELLOW, BLACK) "PRE-NMIによりリセットモードに移行します\n" VT_RST);
|
||||
SET_NEXT_GAMESTATE(gameState, PreNMI_Init, PreNMIContext);
|
||||
gameState->running = false;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/graph/Graph_Update.s")
|
||||
#endif
|
||||
|
||||
void Graph_ThreadEntry(void* arg0) {
|
||||
GraphicsContext gfxCtx;
|
||||
GameState* gameState;
|
||||
u32 size;
|
||||
GameStateOverlay* nextOvl;
|
||||
GameStateOverlay* ovl;
|
||||
char faultMsg[0x50];
|
||||
|
||||
nextOvl = &gGameStateOverlayTable[0];
|
||||
|
||||
// Start graphic thread execution
|
||||
osSyncPrintf("グラフィックスレッド実行開始\n");
|
||||
Graph_Init(&gfxCtx);
|
||||
|
||||
while (nextOvl) {
|
||||
ovl = nextOvl;
|
||||
Overlay_LoadGameState(ovl);
|
||||
|
||||
size = ovl->instanceSize;
|
||||
// Class size =%d bytes
|
||||
osSyncPrintf("クラスサイズ=%dバイト\n", size);
|
||||
|
||||
gameState = SystemArena_MallocDebug(size, "../graph.c", 1196);
|
||||
|
||||
if (!gameState) {
|
||||
// Failure to secure
|
||||
osSyncPrintf("確保失敗\n");
|
||||
|
||||
sprintf(faultMsg, "CLASS SIZE= %d bytes", size);
|
||||
Fault_AddHungupAndCrashImpl("GAME CLASS MALLOC FAILED", faultMsg);
|
||||
}
|
||||
func_800C5080(gameState, ovl->init, &gfxCtx); // Game_Ct
|
||||
|
||||
while (func_800C547C(gameState)) // Game_IsGameStateRunning
|
||||
{
|
||||
Graph_Update(&gfxCtx, gameState);
|
||||
}
|
||||
|
||||
nextOvl = Graph_GetNextGameState(gameState);
|
||||
func_800C5360(gameState); // Game_Dt
|
||||
SystemArena_FreeDebug(gameState, "../graph.c", 1227);
|
||||
Overlay_FreeGameState(ovl);
|
||||
}
|
||||
Graph_Destroy(&gfxCtx);
|
||||
// End of graphic thread execution
|
||||
osSyncPrintf("グラフィックスレッド実行終了\n");
|
||||
}
|
||||
|
||||
void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size) {
|
||||
TwoHeadGfxArena* thga = &gfxCtx->polyOpa;
|
||||
|
||||
if (HREG(59) == 1) {
|
||||
osSyncPrintf("graph_alloc siz=%d thga size=%08x bufp=%08x head=%08x tail=%08x\n", size, thga->size, thga->bufp,
|
||||
thga->p, thga->d);
|
||||
}
|
||||
return THGA_AllocEnd(&gfxCtx->polyOpa, ALIGN16(size));
|
||||
}
|
||||
|
||||
void* Graph_Alloc2(GraphicsContext* gfxCtx, size_t size) {
|
||||
TwoHeadGfxArena* thga = &gfxCtx->polyOpa;
|
||||
|
||||
if (HREG(59) == 1) {
|
||||
osSyncPrintf("graph_alloc siz=%d thga size=%08x bufp=%08x head=%08x tail=%08x\n", size, thga->size, thga->bufp,
|
||||
thga->p, thga->d);
|
||||
}
|
||||
return THGA_AllocEnd(&gfxCtx->polyOpa, ALIGN16(size));
|
||||
}
|
||||
|
||||
void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, s32 line) {
|
||||
if (HREG(80) == 7 && HREG(82) != 4) {
|
||||
dispRefs[0] = gfxCtx->polyOpa.p;
|
||||
dispRefs[1] = gfxCtx->polyXlu.p;
|
||||
dispRefs[2] = gfxCtx->overlay.p;
|
||||
|
||||
gDPNoOpOpenDisp(gfxCtx->polyOpa.p++, file, line);
|
||||
gDPNoOpOpenDisp(gfxCtx->polyXlu.p++, file, line);
|
||||
gDPNoOpOpenDisp(gfxCtx->overlay.p++, file, line);
|
||||
}
|
||||
}
|
||||
|
||||
void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, s32 line) {
|
||||
if (HREG(80) == 7 && HREG(82) != 4) {
|
||||
if (dispRefs[0] + 1 == gfxCtx->polyOpa.p) {
|
||||
gfxCtx->polyOpa.p = dispRefs[0];
|
||||
} else {
|
||||
gDPNoOpCloseDisp(gfxCtx->polyOpa.p++, file, line);
|
||||
}
|
||||
|
||||
if (dispRefs[1] + 1 == gfxCtx->polyXlu.p) {
|
||||
gfxCtx->polyXlu.p = dispRefs[1];
|
||||
} else {
|
||||
gDPNoOpCloseDisp(gfxCtx->polyXlu.p++, file, line);
|
||||
}
|
||||
|
||||
if (dispRefs[2] + 1 == gfxCtx->overlay.p) {
|
||||
gfxCtx->overlay.p = dispRefs[2];
|
||||
} else {
|
||||
gDPNoOpCloseDisp(gfxCtx->overlay.p++, file, line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Gfx* Graph_GfxPlusOne(Gfx* gfx) {
|
||||
return gfx + 1;
|
||||
}
|
||||
|
||||
Gfx* Graph_BranchDlist(Gfx* gfx, Gfx* dst) {
|
||||
gSPBranchList(gfx, dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
void* Graph_DlistAlloc(Gfx** gfx, u32 size) {
|
||||
u8* ptr;
|
||||
Gfx* dst;
|
||||
|
||||
size = ((size + 7) & ~7),
|
||||
|
||||
ptr = *gfx + 1;
|
||||
|
||||
dst = (Gfx*)(ptr + size);
|
||||
gSPBranchList(*gfx, dst);
|
||||
|
||||
*gfx = dst;
|
||||
return ptr;
|
||||
}
|
||||
+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;
|
||||
|
||||
+32
-38
@@ -7,7 +7,7 @@ u32 gScreenWidth = SCREEN_WIDTH;
|
||||
u32 gScreenHeight = SCREEN_HEIGHT;
|
||||
u32 gSystemHeapSize = 0;
|
||||
|
||||
u8* gAppNmiBufferPtr;
|
||||
PreNmiBuff* gAppNmiBufferPtr;
|
||||
SchedContext gSchedContext;
|
||||
PadMgr gPadMgr;
|
||||
IrqMgr gIrqMgr;
|
||||
@@ -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,27 +43,24 @@ 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 = osAppNmiBuffer;
|
||||
func_8007BE60(gAppNmiBufferPtr);
|
||||
gAppNmiBufferPtr = (PreNmiBuff*)osAppNmiBuffer;
|
||||
PreNmiBuff_Init(gAppNmiBufferPtr);
|
||||
Fault_Start();
|
||||
SysCfb_Init(0);
|
||||
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
|
||||
func_8007BED4(gAppNmiBufferPtr);
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
+120
-140
@@ -1,130 +1,125 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
#include <PR/os_cont.h>
|
||||
#include <ultra64/controller.h>
|
||||
#include <padmgr.h>
|
||||
|
||||
OSMesgQueue* PadMgr_LockGetControllerQueue(PadMgr* padmgr)
|
||||
{
|
||||
s32 D_8012D280 = 1;
|
||||
|
||||
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)
|
||||
{
|
||||
osRecvMesg(&padmgr->queue2, 0, OS_MESG_BLOCK);
|
||||
void PadMgr_Lock2(PadMgr* padmgr) {
|
||||
osRecvMesg(&padmgr->queue2, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
void PadMgr_Unlock2(PadMgr* padmgr)
|
||||
{
|
||||
osSendMesg(&padmgr->queue2, 0, OS_MESG_BLOCK);
|
||||
void PadMgr_Unlock2(PadMgr* padmgr) {
|
||||
osSendMesg(&padmgr->queue2, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void func_800C740C(PadMgr* padmgr)
|
||||
{
|
||||
// regalloc and minor ordering differences
|
||||
void func_800C740C(PadMgr* padmgr) {
|
||||
static u32 D_8012D284 = 0;
|
||||
static u32 D_8016A4F0;
|
||||
s32 temp;
|
||||
s32 var1;
|
||||
OSMesgQueue* ctrlrqueue;
|
||||
s32 var3;
|
||||
s32 var4;
|
||||
s32 i;
|
||||
|
||||
temp = 1;
|
||||
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] == 1)
|
||||
{
|
||||
if (padmgr->unk_2B2[i] != 0)
|
||||
{
|
||||
if (padmgr->unk_2B6[i] < 3)
|
||||
{
|
||||
osSyncPrintf(D_80145894); //"\x1b[33m" (probably formatting/debugger interface)
|
||||
osSyncPrintf(D_8014589C, i + 1, D_801458B0); //"padmgr: %d[JPN]Con: ", "[JPN]Vibration pack jumble jumble"
|
||||
osSyncPrintf(D_801458CC); //"\x1b[m" (probably formatting/debugger interface)
|
||||
if (osSetVibration(&padmgr->unk_controller[i], 1) != 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) {
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック ぶるぶるぶるぶる");
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
if (osSetVibration(&padmgr->unk_controller[i], temp) != 0) {
|
||||
padmgr->unk_2AE[i] = 0;
|
||||
osSyncPrintf(D_801458D0);
|
||||
osSyncPrintf(D_801458D8, i + 1, D_801458EC); //"A communication error has occurred with the vibraton pack"
|
||||
osSyncPrintf(D_80145914);
|
||||
}
|
||||
else
|
||||
{
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックで通信エラーが発生しました");
|
||||
osSyncPrintf(VT_RST);
|
||||
} else {
|
||||
padmgr->unk_2B6[i] = 3;
|
||||
}
|
||||
|
||||
var1 = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (padmgr->unk_2B6[i] != 0)
|
||||
{
|
||||
osSyncPrintf(D_80145918);
|
||||
osSyncPrintf(D_80145920, i + 1, D_80145934); //"Stop vibration pack"
|
||||
osSyncPrintf(D_80145944);
|
||||
if (osSetVibration(&padmgr->unk_controller[i], 0) != 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) {
|
||||
padmgr->unk_2AE[i] = 0;
|
||||
osSyncPrintf(D_80145948);
|
||||
osSyncPrintf(D_80145950, i + 1, D_80145964); //"A communication error has occurred with the vibration pack"
|
||||
osSyncPrintf(D_8014598C);
|
||||
}
|
||||
else
|
||||
{
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックで通信エラーが発生しました");
|
||||
osSyncPrintf(VT_RST);
|
||||
} else {
|
||||
padmgr->unk_2B6[i]--;
|
||||
}
|
||||
|
||||
var1 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (padmgr->unk_2AE[i] != 0)
|
||||
{
|
||||
if (padmgr->unk_2AE[i] == 1)
|
||||
{
|
||||
osSyncPrintf(D_80145990);
|
||||
osSyncPrintf(D_80145998, i + 1, D_801459AC); //"Vibration pack seems to be pulled out"
|
||||
osSyncPrintf(D_801459CC);
|
||||
} 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
|
||||
{
|
||||
osSyncPrintf(D_801459D0);
|
||||
osSyncPrintf(D_80145A24);
|
||||
osSyncPrintf(D_801459D8, i + 1, D_801459EC); //"It seems that a controller pack that is not a vibration pack was pulled out"
|
||||
} else {
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1,
|
||||
"振動パックではないコントローラパックが抜かれたようです");
|
||||
osSyncPrintf(VT_RST);
|
||||
padmgr->unk_2AE[i] = 0;
|
||||
}
|
||||
}
|
||||
@@ -132,35 +127,26 @@ 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(D_80145A28);
|
||||
osSyncPrintf(D_80145A30, var3 + 1, D_80145A44); //"Recognized vibration pack"
|
||||
osSyncPrintf(D_80145A60);
|
||||
}
|
||||
else if (var4 == 11)
|
||||
{
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", var3 + 1, "振動パックを認識しました");
|
||||
osSyncPrintf(VT_RST);
|
||||
} else if (var4 == 11) {
|
||||
padmgr->unk_2AE[var3] = 2;
|
||||
}
|
||||
else if (var4 == 4)
|
||||
{
|
||||
LogUtils_LogThreadId(D_80145A64, 282);
|
||||
++D_8012D284;
|
||||
osSyncPrintf(D_80145A70, D_8012D284); //"++errcnt = %d"
|
||||
osSyncPrintf(D_80145A80);
|
||||
osSyncPrintf(D_80145A88, var3 + 1, D_80145A9C); //"Controller pack communication error"
|
||||
osSyncPrintf(D_80145ABC);
|
||||
} else if (var4 == 4) {
|
||||
LOG_NUM("++errcnt", ++D_8012D284, "../padmgr.c", 282);
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", var3 + 1, "コントローラパックの通信エラー");
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,27 +155,25 @@ void func_800C740C(PadMgr* padmgr)
|
||||
PadMgr_UnlockReleaseControllerQueue(padmgr, ctrlrqueue);
|
||||
}
|
||||
#else
|
||||
u32 D_8012D284 = 0;
|
||||
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))
|
||||
{
|
||||
osSyncPrintf("\x1b[33m");
|
||||
//EUC-JP: コン | 'Con'? , EUC-JP: 振動パック 停止 | Stop vibration pack
|
||||
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
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック 停止");
|
||||
osSyncPrintf("\x1b[m");
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
|
||||
osSetVibration(&padmgr->unk_controller[i], 0);
|
||||
@@ -199,21 +183,19 @@ 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;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
//func_800A23CC in 1.0
|
||||
void func_800C7948(PadMgr* padmgr, u8* a1)
|
||||
{
|
||||
// minor ordering difference
|
||||
// 800A23CC in 1.0
|
||||
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];
|
||||
@@ -229,46 +211,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:
|
||||
@@ -281,14 +262,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;
|
||||
|
||||
+26
-38
@@ -1,66 +1,54 @@
|
||||
#include <global.h>
|
||||
|
||||
volatile u32 sSysCfbFbPtr[2]; //may not be volatile but it currently gets SysCfb_Init closer from matching
|
||||
u32 sSysCfbFbPtr[2];
|
||||
u32 sSysCfbEnd;
|
||||
|
||||
//small reaordering
|
||||
#ifdef NON_MATCHING
|
||||
void SysCfb_Init(s32 n64dd)
|
||||
{
|
||||
if (osMemSize >= 0x800000U)
|
||||
{
|
||||
//8MB or more memory is installed
|
||||
void SysCfb_Init(s32 n64dd) {
|
||||
u32 screenSize;
|
||||
u32 tmpFbEnd;
|
||||
if (osMemSize >= 0x800000U) {
|
||||
// 8MB or more memory is installed
|
||||
osSyncPrintf("8Mバイト以上のメモリが搭載されています\n");
|
||||
if (n64dd == 1)
|
||||
{
|
||||
//RAM 8M mode (N64DD compatible)
|
||||
tmpFbEnd = 0x8044BE80;
|
||||
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;
|
||||
sSysCfbEnd = tmpFbEnd;
|
||||
}
|
||||
}
|
||||
else if (osMemSize >= 0x400000U)
|
||||
{
|
||||
sSysCfbEnd = 0x80400000;
|
||||
} else if (osMemSize >= 0x400000U) {
|
||||
osSyncPrintf("RAM4M mode\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
sSysCfbEnd = 0x80400000;
|
||||
} else {
|
||||
LogUtils_HungupThread("../sys_cfb.c", 0x162);
|
||||
}
|
||||
|
||||
screenSize = SCREEN_WIDTH * SCREEN_HEIGHT;
|
||||
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 - (screenSize * 4);
|
||||
sSysCfbFbPtr[1] = sSysCfbEnd - (screenSize * 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;
|
||||
}
|
||||
}
|
||||
|
||||
+158
-219
@@ -1,96 +1,91 @@
|
||||
#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;
|
||||
f32 tx;
|
||||
f32 ty;
|
||||
|
||||
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
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
tx = cmf->xx;
|
||||
ty = cmf->yx;
|
||||
cmf->wx += tx * x + ty * y + cmf->zx * z;
|
||||
tx = cmf->xy;
|
||||
ty = cmf->yy;
|
||||
cmf->wy += tx * x + ty * y + cmf->zy * z;
|
||||
tx = cmf->xz;
|
||||
ty = cmf->yz;
|
||||
cmf->wz += tx * x + ty * y + cmf->zz * z;
|
||||
tx = cmf->xw;
|
||||
ty = cmf->yw;
|
||||
cmf->ww += tx * x + ty * y + cmf->zw * z;
|
||||
} else {
|
||||
func_800A7A24(cmf, x, y, z);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#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 +98,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 +137,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 +167,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 +201,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 +231,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 +265,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 +295,20 @@ void Matrix_RotateZ(f32 z, u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode)
|
||||
{
|
||||
/*
|
||||
* Rotates the top of the matrix stack by `z` degrees, then
|
||||
* rotates that matrix by `y` degrees, then rotates that matrix
|
||||
* by `x` degrees. (roll-pitch-yaw)
|
||||
* Original Name: Matrix_RotateXYZ, changed to reflect rotation order.
|
||||
*/
|
||||
void Matrix_RotateZYX(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 +332,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 +357,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,52 +381,52 @@ 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)
|
||||
{
|
||||
/*
|
||||
* Translates the top of the matrix stack by `translation` units,
|
||||
* then rotates that matrix by `rotation` in Z-Y-X order (roll-pitch-yaw)
|
||||
*/
|
||||
void Matrix_TranslateThenRotateZYX(Vec3f* translation, Vec3s* rotation) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
f32 temp1;
|
||||
f32 temp2;
|
||||
|
||||
sin = Math_Sins(arg1->z);
|
||||
cos = Math_Coss(arg1->z);
|
||||
sin = Math_Sins(rotation->z);
|
||||
cos = Math_Coss(rotation->z);
|
||||
|
||||
temp1 = cmf->xx;
|
||||
temp2 = cmf->yx;
|
||||
cmf->wx += temp1 * arg0->x + temp2 * arg0->y + cmf->zx * arg0->z;
|
||||
cmf->wx += temp1 * translation->x + temp2 * translation->y + cmf->zx * translation->z;
|
||||
cmf->xx = temp1 * cos + temp2 * sin;
|
||||
cmf->yx = temp2 * cos - temp1 * sin;
|
||||
|
||||
temp1 = cmf->xy;
|
||||
temp2 = cmf->yy;
|
||||
cmf->wy += temp1 * arg0->x + temp2 * arg0->y + cmf->zy * arg0->z;
|
||||
cmf->wy += temp1 * translation->x + temp2 * translation->y + cmf->zy * translation->z;
|
||||
cmf->xy = temp1 * cos + temp2 * sin;
|
||||
cmf->yy = temp2 * cos - temp1 * sin;
|
||||
|
||||
temp1 = cmf->xz;
|
||||
temp2 = cmf->yz;
|
||||
cmf->wz += temp1 * arg0->x + temp2 * arg0->y + cmf->zz * arg0->z;
|
||||
cmf->wz += temp1 * translation->x + temp2 * translation->y + cmf->zz * translation->z;
|
||||
cmf->xz = temp1 * cos + temp2 * sin;
|
||||
cmf->yz = temp2 * cos - temp1 * sin;
|
||||
|
||||
temp1 = cmf->xw;
|
||||
temp2 = cmf->yw;
|
||||
cmf->ww += temp1 * arg0->x + temp2 * arg0->y + cmf->zw * arg0->z;
|
||||
cmf->ww += temp1 * translation->x + temp2 * translation->y + cmf->zw * translation->z;
|
||||
cmf->xw = temp1 * cos + temp2 * sin;
|
||||
cmf->yw = temp2 * cos - temp1 * sin;
|
||||
|
||||
if (arg1->y != 0)
|
||||
{
|
||||
sin = Math_Sins(arg1->y);
|
||||
cos = Math_Coss(arg1->y);
|
||||
if (rotation->y != 0) {
|
||||
sin = Math_Sins(rotation->y);
|
||||
cos = Math_Coss(rotation->y);
|
||||
|
||||
temp1 = cmf->xx;
|
||||
temp2 = cmf->zx;
|
||||
@@ -478,10 +449,9 @@ void func_800D1340(Vec3f* arg0, Vec3s* arg1)
|
||||
cmf->zw = temp1 * sin + temp2 * cos;
|
||||
}
|
||||
|
||||
if (arg1->x != 0)
|
||||
{
|
||||
sin = Math_Sins(arg1->x);
|
||||
cos = Math_Coss(arg1->x);
|
||||
if (rotation->x != 0) {
|
||||
sin = Math_Sins(rotation->x);
|
||||
cos = Math_Coss(rotation->x);
|
||||
|
||||
temp1 = cmf->yx;
|
||||
temp2 = cmf->zx;
|
||||
@@ -507,8 +477,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 +497,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 +507,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 +516,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 +533,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 +543,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 +618,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 +638,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 +673,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 +695,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 +718,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,24 +743,24 @@ void func_800D1FD4(MtxF* mf)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// same differences as func_800D2264
|
||||
void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag)
|
||||
{
|
||||
vec->x = func_800FD250(-mf->zy, sqrtf(SQ(mf->zx) + SQ(mf->zz))) * (32768 / M_PI);
|
||||
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 = func_800FD250(-mf->xz, mf->xx) * (32768 / M_PI);
|
||||
vec->y = Math_atan2f(-mf->xz, mf->xx) * (32768 / M_PI);
|
||||
return;
|
||||
}
|
||||
|
||||
vec->y = func_800FD250(mf->zx, mf->zz) * (32768 / M_PI);
|
||||
vec->y = Math_atan2f(mf->zx, mf->zz) * (32768 / M_PI);
|
||||
|
||||
if (!flag)
|
||||
vec->z = func_800FD250(mf->xy, mf->yy) * (32768 / M_PI);
|
||||
else
|
||||
vec->z = func_800FD250(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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_800D20CC.s")
|
||||
@@ -815,24 +768,24 @@ 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)
|
||||
{
|
||||
vec->y = func_800FD250(-mf->xz, sqrtf(SQ(mf->xx) + SQ(mf->xy))) * (32768 / M_PI);
|
||||
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 = func_800FD250(-mf->yx, mf->yy) * (32768 / M_PI);
|
||||
vec->z = Math_atan2f(-mf->yx, mf->yy) * (32768 / M_PI);
|
||||
return;
|
||||
}
|
||||
|
||||
vec->z = func_800FD250(mf->xy, mf->xx) * (32768 / M_PI);
|
||||
vec->z = Math_atan2f(mf->xy, mf->xx) * (32768 / M_PI);
|
||||
|
||||
if (!flag)
|
||||
vec->x = func_800FD250(mf->yz, mf->zz) * (32768 / M_PI);
|
||||
else
|
||||
vec->x = func_800FD250(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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_800D2264.s")
|
||||
@@ -840,8 +793,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 +803,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 +834,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 +868,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 +892,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 +910,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 +929,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 +988,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 +1042,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 func_800D2DF0()
|
||||
{
|
||||
u32 SysUcode_GetUCodeBoot() {
|
||||
return &D_80009320;
|
||||
}
|
||||
|
||||
u32 func_800D2DFC()
|
||||
{
|
||||
u32 SysUcode_GetUcodeBootSize() {
|
||||
return (u32)&D_800093F0 - (u32)&D_80009320;
|
||||
}
|
||||
|
||||
u32 func_800D2E14()
|
||||
{
|
||||
u32 SysUcode_GetUcode() {
|
||||
return D_8012DBA0;
|
||||
}
|
||||
|
||||
u32 func_800D2E20()
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
+6
-10
@@ -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;
|
||||
gameState->init = func_80800878; gameState->size = sizeof(TitleContext);
|
||||
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;
|
||||
|
||||
+1765
-2289
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")
|
||||
|
||||
|
||||
+360
-475
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void Gfx_DrawDListOpa(GlobalContext* globalCtx, u32 dlist) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
Graph_OpenDisps(dispRefs, 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);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, dlist);
|
||||
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 219);
|
||||
}
|
||||
|
||||
void Gfx_DrawDListXlu(GlobalContext* globalCtx, u32 dlist) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
Graph_OpenDisps(dispRefs, 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);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, dlist);
|
||||
|
||||
Graph_CloseDisps(dispRefs, 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;
|
||||
@@ -14,8 +13,7 @@ void SaveContext_Init(void)
|
||||
gSaveContext.chamber_cutscene_num = 0;
|
||||
gSaveContext.next_day_time = 0xFFFF;
|
||||
gSaveContext.environment_time = 0;
|
||||
gSaveContext.unk_141C = 1;
|
||||
gSaveContext.dogIsLost = 1;
|
||||
gSaveContext.transition_type = 0xFF;
|
||||
gSaveContext.unk_13EE = 50;
|
||||
}
|
||||
|
||||
|
||||
+64
-60
@@ -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;
|
||||
@@ -46,9 +44,10 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
|
||||
osSyncPrintf("parameter->parameterSegment=%x", interfaceCtx->parameterSegment);
|
||||
|
||||
if (interfaceCtx->parameterSegment == NULL)
|
||||
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);
|
||||
@@ -57,28 +56,33 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
osSyncPrintf("DOアクション テクスチャ初期=%x\n", 0x480);
|
||||
osSyncPrintf("parameter->do_actionSegment=%x", interfaceCtx->do_actionSegment);
|
||||
|
||||
if (interfaceCtx->do_actionSegment == NULL)
|
||||
if (interfaceCtx->do_actionSegment == NULL) {
|
||||
__assert("parameter->do_actionSegment != NULL", "../z_construct.c", 169);
|
||||
}
|
||||
|
||||
do_actionStart = _do_action_staticSegmentRomStart;
|
||||
|
||||
if (gSaveContext.language == 0)
|
||||
if (gSaveContext.language == 0) {
|
||||
do_actionOffset = 0;
|
||||
else if (gSaveContext.language == 1)
|
||||
} else if (gSaveContext.language == 1) {
|
||||
do_actionOffset = 0x2B80;
|
||||
else
|
||||
} 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)
|
||||
if (gSaveContext.language == 0) {
|
||||
do_actionOffset = 0x480;
|
||||
else if (gSaveContext.language == 1)
|
||||
} else if (gSaveContext.language == 1) {
|
||||
do_actionOffset = 0x3000;
|
||||
else
|
||||
} 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);
|
||||
|
||||
@@ -86,69 +90,72 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", 0x4000);
|
||||
osSyncPrintf("parameter->icon_itemSegment=%x\n", interfaceCtx->icon_itemSegment);
|
||||
|
||||
if (interfaceCtx->icon_itemSegment == NULL)
|
||||
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)
|
||||
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);
|
||||
else if (gSaveContext.equips.button_items[0] != 0xFF)
|
||||
_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)
|
||||
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)
|
||||
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)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8))
|
||||
if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8)) {
|
||||
temp = 0;
|
||||
else
|
||||
} else {
|
||||
temp = 1;
|
||||
}
|
||||
|
||||
gSaveContext.timer_x[temp] = 26;
|
||||
|
||||
if (gSaveContext.health_capacity > 0xA0)
|
||||
if (gSaveContext.health_capacity > 0xA0) {
|
||||
gSaveContext.timer_y[temp] = 54;
|
||||
else
|
||||
} else {
|
||||
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 +186,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 +208,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 +532,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 +623,6 @@ void func_80111070(void)
|
||||
VREG(92) = -0x3F;
|
||||
}
|
||||
|
||||
void func_80112098(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_80112098(GlobalContext* globalCtx) {
|
||||
func_80111070();
|
||||
}
|
||||
|
||||
+237
-8
@@ -1,20 +1,249 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
#include <PR/os_cont.h>
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug/func_800636C0.s")
|
||||
typedef struct {
|
||||
u8 x;
|
||||
u8 y;
|
||||
u8 colorId;
|
||||
char text[0x15];
|
||||
} PrintTextBuffer;
|
||||
|
||||
void func_8006375C(UNK_TYPE arg0, UNK_TYPE arg1, UNK_TYPE arg2)
|
||||
{
|
||||
typedef struct {
|
||||
u16 push;
|
||||
u16 held;
|
||||
} InputCombo;
|
||||
|
||||
GameInfo* gGameInfo;
|
||||
int D_8015FA94; // no known symbols
|
||||
PrintTextBuffer D_8015FA98[0x16];
|
||||
|
||||
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 },
|
||||
};
|
||||
|
||||
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 },
|
||||
{ START_BUTTON, R_CBUTTONS },
|
||||
};
|
||||
|
||||
char regChar[] = " SOPQMYDUIZCNKXcsiWAVHGmnBdkb";
|
||||
|
||||
// initialize GameInfo
|
||||
void func_800636C0() {
|
||||
s32 i;
|
||||
|
||||
gGameInfo = (GameInfo*)SystemArena_MallocDebug(sizeof(GameInfo), "../z_debug.c", 260);
|
||||
gGameInfo->regPage = 0;
|
||||
gGameInfo->regGroup = 0;
|
||||
gGameInfo->regCur = 0;
|
||||
gGameInfo->dpadLast = 0;
|
||||
gGameInfo->repeat = 0;
|
||||
for (i = 0; i < ARRAY_COUNT(gGameInfo->data); i++) {
|
||||
gGameInfo->data[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug/func_8006376C.s")
|
||||
// Called when free movement is active.
|
||||
// 8011D394 to enable camera debugger
|
||||
void func_8006375C(s32 arg0, s32 arg1, float* d_80855320) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug/func_80063828.s")
|
||||
// Copy Camera Debugger Text
|
||||
void func_8006376C(u8 x, u8 y, u8 colorId, const char* text) {
|
||||
PrintTextBuffer* buf;
|
||||
char* bufText;
|
||||
s16 i;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug/func_8006390C.s")
|
||||
buf = &D_8015FA98[D_8011E0B0];
|
||||
if (D_8011E0B0 < 0x16) {
|
||||
buf->x = x;
|
||||
buf->y = y;
|
||||
buf->colorId = colorId;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug/func_80063C04.s")
|
||||
i = 0;
|
||||
bufText = buf->text;
|
||||
while (*bufText++ = *text++) {
|
||||
if (i++ > 0x14) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug/func_80063D7C.s")
|
||||
*bufText = '\0';
|
||||
D_8011E0B0++;
|
||||
}
|
||||
}
|
||||
|
||||
// Draw Text
|
||||
void func_80063828(GfxPrint* gfxPrint) {
|
||||
s32 i;
|
||||
Color_RGBA8* color;
|
||||
PrintTextBuffer* buffer;
|
||||
char* text;
|
||||
|
||||
i = 0;
|
||||
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);
|
||||
i += 1;
|
||||
} while (i < D_8011E0B0);
|
||||
}
|
||||
}
|
||||
|
||||
// Edit REG
|
||||
void func_8006390C(Input* input) {
|
||||
|
||||
s32 dpad;
|
||||
s32 regGroup;
|
||||
s32 increment;
|
||||
InputCombo* input_combo;
|
||||
s32 i;
|
||||
|
||||
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)) {
|
||||
input_combo = inputCombos;
|
||||
for (i = 0; i < REG_GROUPS; i++) {
|
||||
if (~(~input_combo->push | input->raw.pad) || ~(~input_combo->held | input->padPressed)) {
|
||||
input_combo++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < REG_GROUPS) {
|
||||
if (i == gGameInfo->regGroup) {
|
||||
gGameInfo->regPage = (gGameInfo->regPage + 1) % (REG_PAGES + 1);
|
||||
return;
|
||||
}
|
||||
gGameInfo->regGroup = i;
|
||||
gGameInfo->regPage = 0;
|
||||
}
|
||||
} else {
|
||||
switch (gGameInfo->regPage - 1) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
|
||||
if (dpad == gGameInfo->dpadLast) {
|
||||
gGameInfo->repeat--;
|
||||
if (gGameInfo->repeat < 0) {
|
||||
gGameInfo->repeat = 1;
|
||||
} 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;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
if (iREG(0)) {
|
||||
iREG(0) = 0;
|
||||
func_800AA000(0, iREG(1), iREG(2), iREG(3));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Draw Memory Viewer
|
||||
void func_80063C04(GfxPrint* gfxPrint) {
|
||||
s32 i;
|
||||
s32 page;
|
||||
s32 regGroup;
|
||||
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
|
||||
name[0] = 'R';
|
||||
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) {
|
||||
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) {
|
||||
GfxPrint_SetColor(gfxPrint, 0, 0x80, 0x80, 0x80);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80063D7C(GraphicsContext* gfxCtx) {
|
||||
Gfx* sp7C;
|
||||
Gfx* sp78;
|
||||
Gfx* tempRet;
|
||||
void* unk2[6];
|
||||
GfxPrint gfxPrint;
|
||||
void* unk[2];
|
||||
Gfx* dispRefs[4]; // stores state of GfxCtx next ptrs
|
||||
|
||||
Graph_OpenDisps(dispRefs, gfxCtx, "../z_debug.c", 628);
|
||||
GfxPrint_Ctor(&gfxPrint);
|
||||
sp78 = gfxCtx->polyOpa.p;
|
||||
tempRet = Graph_GfxPlusOne(gfxCtx->polyOpa.p);
|
||||
gSPDisplayList(gfxCtx->overlay.p++, tempRet);
|
||||
GfxPrint_Open(&gfxPrint, tempRet);
|
||||
|
||||
if ((OREG(0) == 1) || (OREG(0) == 8)) {
|
||||
func_80063828(&gfxPrint);
|
||||
}
|
||||
|
||||
if (gGameInfo->regPage != 0) {
|
||||
func_80063C04(&gfxPrint);
|
||||
}
|
||||
|
||||
D_8011E0B0 = 0;
|
||||
sp7C = GfxPrint_Close(&gfxPrint);
|
||||
gSPEndDisplayList(sp7C++);
|
||||
Graph_BranchDlist(sp78, sp7C);
|
||||
gfxCtx->polyOpa.p = sp7C;
|
||||
if (0) {}
|
||||
Graph_CloseDisps(dispRefs, gfxCtx, "../z_debug.c", 664);
|
||||
GfxPrint_Dtor(&gfxPrint);
|
||||
}
|
||||
|
||||
+26
-40
@@ -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,25 +59,22 @@ 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];
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_debug_display.c", 169);
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_debug_display.c", 169);
|
||||
|
||||
func_80094678(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -91,30 +83,23 @@ static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, Glo
|
||||
Matrix_Translate(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, MTXMODE_NEW);
|
||||
Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY);
|
||||
Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY);
|
||||
Matrix_RotateXYZ(dispObj->rot.x, dispObj->rot.y, dispObj->rot.z, MTXMODE_APPLY);
|
||||
Matrix_RotateZYX(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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_debug_display.c", 211);
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_debug_display.c", 211);
|
||||
func_8009435C(globalCtx->state.gfxCtx);
|
||||
|
||||
gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, dispObj->color.r, dispObj->color.g, dispObj->color.b, dispObj->color.a);
|
||||
@@ -124,8 +109,9 @@ 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);
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_debug_display.c", 231);
|
||||
}
|
||||
|
||||
+341
-474
File diff suppressed because it is too large
Load Diff
+234
-220
@@ -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,512 +161,526 @@ 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 556);
|
||||
Graph_OpenDisps(dispRefs, 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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 572);
|
||||
Graph_OpenDisps(dispRefs, 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);
|
||||
gfxCtx->polyXlu.p = Gfx_CallSetupDL(gfxCtx->polyXlu.p, 5);
|
||||
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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 588);
|
||||
Graph_OpenDisps(dispRefs, 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));
|
||||
Gfx_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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 628);
|
||||
Graph_OpenDisps(dispRefs, 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));
|
||||
Gfx_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();
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 663);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 670);
|
||||
Graph_OpenDisps(dispRefs, 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));
|
||||
Gfx_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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 712);
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 712);
|
||||
|
||||
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);
|
||||
Gfx_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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 742);
|
||||
Graph_OpenDisps(dispRefs, 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);
|
||||
Gfx_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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 772);
|
||||
Graph_OpenDisps(dispRefs, 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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 811);
|
||||
Graph_OpenDisps(dispRefs, 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);
|
||||
gfxCtx->polyXlu.p = Gfx_CallSetupDL(gfxCtx->polyXlu.p, 5);
|
||||
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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 834);
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 834);
|
||||
|
||||
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);
|
||||
Gfx_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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 868);
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 868);
|
||||
|
||||
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);
|
||||
Gfx_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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 890);
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 890);
|
||||
|
||||
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);
|
||||
Gfx_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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 913);
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 913);
|
||||
|
||||
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);
|
||||
Gfx_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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 936);
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 936);
|
||||
|
||||
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);
|
||||
Gfx_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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 959);
|
||||
Graph_OpenDisps(dispRefs, 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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 975);
|
||||
Graph_OpenDisps(dispRefs, 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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 998);
|
||||
Graph_OpenDisps(dispRefs, 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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1015);
|
||||
Graph_OpenDisps(dispRefs, 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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1039);
|
||||
Graph_OpenDisps(dispRefs, 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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1063);
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1063);
|
||||
|
||||
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);
|
||||
Gfx_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]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1081);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1088);
|
||||
Graph_OpenDisps(dispRefs, 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]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[3]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1100);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1108);
|
||||
Graph_OpenDisps(dispRefs, 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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1133);
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1133);
|
||||
|
||||
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);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1162);
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1162);
|
||||
|
||||
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);
|
||||
Gfx_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]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1181);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1188);
|
||||
Graph_OpenDisps(dispRefs, 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]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1207);
|
||||
Graph_CloseDisps(dispRefs, 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];
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1214);
|
||||
Graph_OpenDisps(dispRefs, 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]);
|
||||
@@ -676,5 +690,5 @@ static void func_8006B870(GlobalContext* globalCtx, s16 drawId)
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[6]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[7]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1230);
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1230);
|
||||
}
|
||||
|
||||
@@ -9,15 +9,14 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_blure/func_80020A50.s")
|
||||
|
||||
void func_80020F60(u32 unused, GraphicsContext* gfxCtx)
|
||||
{
|
||||
Gfx* gfxArr[5];
|
||||
void func_80020F60(u32 unused, GraphicsContext* gfxCtx) {
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, gfxCtx, D_80135180, 809);
|
||||
Graph_OpenDisps(dispRefs, gfxCtx, D_80135180, 809);
|
||||
|
||||
gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 0x26);
|
||||
gfxCtx->polyXlu.p = Gfx_CallSetupDL(gfxCtx->polyXlu.p, 0x26);
|
||||
|
||||
func_800C6B54(gfxArr, gfxCtx, D_80135194, 813);
|
||||
Graph_CloseDisps(dispRefs, gfxCtx, D_80135194, 813);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_blure/func_80020FC0.s")
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
GlobalContext* func_80026B00(void) {
|
||||
return D_80157DA0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect/func_80026B0C.s")
|
||||
|
||||
void func_80026C1C(u8* arg0) {
|
||||
arg0[0] = 0;
|
||||
arg0[1] = 0;
|
||||
arg0[2] = 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect/func_80026C2C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect/Effect_Add.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect/func_80026E74.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect/func_80026F70.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect/func_8002709C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect/func_800271A8.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")
|
||||
|
||||
|
||||
+164
-6
@@ -1,14 +1,172 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_elf_message/func_8006BBC0.s")
|
||||
// TODO: use macros to define elf messages once the format is fully documented
|
||||
ElfMessage sChildSariaMsgs[] = {
|
||||
{ 0x66, 0x00, 0x03, 0x00 }, { 0x00, 0x37, 0x61, 0x00 }, { 0xE0, 0x00, 0x64, 0x00 }, { 0x00, 0x25, 0x62, 0x00 },
|
||||
{ 0x00, 0x37, 0x63, 0x00 }, { 0x00, 0x43, 0x65, 0x00 }, { 0x06, 0x30, 0x66, 0x66 }, { 0x06, 0x30, 0x66, 0x67 },
|
||||
{ 0x06, 0x30, 0x66, 0x68 }, { 0x06, 0x20, 0x67, 0x65 }, { 0x06, 0x30, 0x68, 0x69 }, { 0x06, 0x30, 0x68, 0x6A },
|
||||
{ 0xE0, 0x00, 0x69, 0x00 },
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_elf_message/func_8006BE88.s")
|
||||
ElfMessage sAdultSariaMsgs[] = {
|
||||
{ 0x06, 0x30, 0x6A, 0x66 }, { 0x06, 0x30, 0x6B, 0x67 }, { 0x06, 0x30, 0x6B, 0x68 },
|
||||
{ 0x06, 0x30, 0x6C, 0x69 }, { 0x06, 0x30, 0x6C, 0x6A }, { 0xE0, 0x00, 0x6D, 0x00 },
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_elf_message/func_8006BF1C.s")
|
||||
#ifdef NON_MATCHING
|
||||
// minor ordering and regalloc differences
|
||||
u32 ElfMessage_CheckCondition(ElfMessage* msg) {
|
||||
u16 temp;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_elf_message/func_8006C0FC.s")
|
||||
switch (msg->byte0 & 0x1E) {
|
||||
case 0:
|
||||
temp = 1 << (msg->byte1 & 0x0F);
|
||||
return ((msg->byte0 & 1) == 1) == !!(gSaveContext.event_chk_inf[(msg->byte1 & 0xF0) >> 4] & temp);
|
||||
case 2:
|
||||
return ((msg->byte0 & 1) == 1) ==
|
||||
!!(gBitFlags[msg->byte1 - ITEM_KEY_BOSS] & gSaveContext.dungeon_items[gSaveContext.dungeon_index]);
|
||||
case 4:
|
||||
return ((msg->byte0 & 1) == 1) == (msg->byte3 == INV_CONTENT(msg->byte1));
|
||||
case 6:
|
||||
switch (msg->byte1 & 0xF0) {
|
||||
case 0x00:
|
||||
return ((msg->byte0 & 1) == 1) == ((msg->byte1 & 0x0F) == CUR_UPG_VALUE(UPG_STRENGTH));
|
||||
case 0x10:
|
||||
return ((msg->byte0 & 1) == 1) ==
|
||||
!!((gBitFlags[msg->byte3 - ITEM_BOOTS_KOKIRI] << gEquipShifts[EQUIP_BOOTS]) &
|
||||
gSaveContext.equipment);
|
||||
case 0x20:
|
||||
return ((msg->byte0 & 1) == 1) ==
|
||||
!!(gBitFlags[msg->byte3 - ITEM_SONG_MINUET + 6] & gSaveContext.quest_items);
|
||||
case 0x30:
|
||||
return ((msg->byte0 & 1) == 1) ==
|
||||
!!(gBitFlags[msg->byte3 - ITEM_MEDALLION_FOREST] & gSaveContext.quest_items);
|
||||
case 0x40:
|
||||
return ((msg->byte0 & 1) == 1) == !!gSaveContext.magic_acquired;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_elf_message/func_8006C2B0.s")
|
||||
// "Unplanned conditions"
|
||||
LOG_STRING("企画外 条件", "../z_elf_message.c", 156);
|
||||
__assert("0", "../z_elf_message.c", 157);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_elf_message/func_8006C318.s")
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
u32 ElfMessage_CheckCondition(ElfMessage* msg);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_elf_message/ElfMessage_CheckCondition.s")
|
||||
#endif
|
||||
|
||||
u32 func_8006BE88(ElfMessage** msgp) {
|
||||
u32 temp = true;
|
||||
|
||||
while (((*msgp)->byte0 & 0xE0) == 0x20) {
|
||||
if (!ElfMessage_CheckCondition(*msgp)) {
|
||||
temp = false;
|
||||
}
|
||||
*msgp += 1;
|
||||
}
|
||||
|
||||
if (temp) {
|
||||
return ElfMessage_CheckCondition(*msgp);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
u32 func_8006BF1C(ElfMessage** msgp) {
|
||||
ElfMessage* msg;
|
||||
u32 sp44[10];
|
||||
s32 temp1;
|
||||
s32 temp2;
|
||||
s32 temp3;
|
||||
|
||||
msg = *msgp;
|
||||
temp1 = 0;
|
||||
temp2 = 0;
|
||||
do {
|
||||
sp44[temp2] = ElfMessage_CheckCondition(msg);
|
||||
temp1 += sp44[temp2];
|
||||
temp2++;
|
||||
msg++;
|
||||
} while ((msg->byte0 & 0xE0) == 0x40);
|
||||
|
||||
if (temp1 == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
temp3 = Math_Rand_ZeroFloat(temp1);
|
||||
for (temp1 = 0; temp1 < temp2; temp1++) {
|
||||
if (sp44[temp1]) {
|
||||
if (temp3 > 0) {
|
||||
temp3--;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
*msgp += 1;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
u16 ElfMessage_GetTextFromMsgs(ElfMessage* msg) {
|
||||
while (true) {
|
||||
switch (msg->byte0 & 0xE0) {
|
||||
case 0x00:
|
||||
if (ElfMessage_CheckCondition(msg)) {
|
||||
return msg->byte2 | 0x100;
|
||||
}
|
||||
break;
|
||||
case 0x20:
|
||||
if (func_8006BE88(&msg)) {
|
||||
return msg->byte2 | 0x100;
|
||||
}
|
||||
break;
|
||||
case 0x40:
|
||||
if (func_8006BF1C(&msg)) {
|
||||
return msg->byte2 | 0x100;
|
||||
}
|
||||
break;
|
||||
case 0x60:
|
||||
if (ElfMessage_CheckCondition(msg)) {
|
||||
msg += msg->byte2;
|
||||
msg--;
|
||||
}
|
||||
break;
|
||||
case 0xE0:
|
||||
return msg->byte2 | 0x100;
|
||||
default:
|
||||
// "Unplanned conditions"
|
||||
LOG_STRING("企画外 条件", "../z_elf_message.c", 281);
|
||||
__assert("0", "../z_elf_message.c", 282);
|
||||
}
|
||||
msg++;
|
||||
}
|
||||
}
|
||||
|
||||
u16 ElfMessage_GetSariaText(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
ElfMessage* msgs;
|
||||
|
||||
if (LINK_IS_CHILD) {
|
||||
if (Actor_FindNearby(globalCtx, &player->actor, ACTOR_EN_SA, 4, 800.0f) == NULL) {
|
||||
msgs = sChildSariaMsgs;
|
||||
} else {
|
||||
return 0x0160; // Special text about Saria preferring to talk to you face-to-face
|
||||
}
|
||||
} else {
|
||||
msgs = sAdultSariaMsgs;
|
||||
}
|
||||
|
||||
return ElfMessage_GetTextFromMsgs(msgs);
|
||||
}
|
||||
|
||||
u16 ElfMessage_GetCUpText(GlobalContext* globalCtx) {
|
||||
if (globalCtx->cUpElfMsgs == NULL) {
|
||||
return 0;
|
||||
} else {
|
||||
return ElfMessage_GetTextFromMsgs(globalCtx->cUpElfMsgs);
|
||||
}
|
||||
}
|
||||
|
||||
+83
-108
@@ -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;
|
||||
@@ -99,8 +94,9 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
break;
|
||||
}
|
||||
|
||||
if (this->actor.params >= 9)
|
||||
if (this->actor.params >= 9) {
|
||||
sp28 = 12.0f;
|
||||
}
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, sp28);
|
||||
|
||||
@@ -112,8 +108,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 +154,12 @@ 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->actor.params < 5) {
|
||||
this->actor.sub_98.mass = 0xFF;
|
||||
}
|
||||
|
||||
if (this->dynaPolyId != -1) {
|
||||
DynaPolyInfo_Alloc(D_8011546C[this->dynaPolyId], &sp34);
|
||||
this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp34);
|
||||
}
|
||||
@@ -173,51 +168,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 +213,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 +252,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,24 +328,26 @@ 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];
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_en_a_keep.c", 701);
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_a_keep.c", 701);
|
||||
|
||||
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);
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_a_keep.c", 715);
|
||||
}
|
||||
|
||||
+225
-328
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,70 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
u16 sReactionTextIds[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 },
|
||||
{ 0x0000, 0x7128, 0x7129, 0x7128, 0x7128, 0x7128, 0x7128, 0x712A, 0x712B },
|
||||
{ 0x0000, 0x7128, 0x7129, 0x712B, 0x7128, 0x7128, 0x7128, 0x7129, 0x7128 },
|
||||
{ 0x0000, 0x712D, 0x712D, 0x712D, 0x712D, 0x712D, 0x712D, 0x712D, 0x712F },
|
||||
{ 0x0000, 0x712C, 0x712C, 0x712C, 0x712E, 0x712C, 0x712C, 0x712F, 0x712F },
|
||||
{ 0x0000, 0x712C, 0x712C, 0x712C, 0x712F, 0x712C, 0x712C, 0x712F, 0x712F },
|
||||
{ 0x0000, 0x7130, 0x7132, 0x7133, 0x7130, 0x7130, 0x7131, 0x7132, 0x7131 },
|
||||
{ 0x0000, 0x7134, 0x7137, 0x7135, 0x7134, 0x7136, 0x7135, 0x7134, 0x7135 },
|
||||
{ 0x0000, 0x7138, 0x713A, 0x7138, 0x7139, 0x713A, 0x7138, 0x7139, 0x713B },
|
||||
{ 0x0000, 0x7144, 0x7146, 0x7144, 0x7146, 0x7147, 0x7145, 0x7145, 0x7147 },
|
||||
{ 0x0000, 0x7148, 0x7149, 0x7149, 0x714A, 0x714A, 0x714B, 0x7149, 0x714B },
|
||||
{ 0x0000, 0x714C, 0x714D, 0x714C, 0x714C, 0x714E, 0x714C, 0x714E, 0x714F },
|
||||
{ 0x0000, 0x7150, 0x7153, 0x7152, 0x7150, 0x7151, 0x7153, 0x7153, 0x7151 },
|
||||
{ 0x0000, 0x7155, 0x7156, 0x7157, 0x7154, 0x7156, 0x7156, 0x7156, 0x7156 },
|
||||
{ 0x0000, 0x715A, 0x7159, 0x715B, 0x715A, 0x715A, 0x7158, 0x7158, 0x715B },
|
||||
{ 0x0000, 0x715E, 0x715D, 0x715D, 0x715F, 0x715E, 0x715C, 0x715C, 0x715D },
|
||||
{ 0x0000, 0x7163, 0x7162, 0x7160, 0x7163, 0x7160, 0x7161, 0x7161, 0x7160 },
|
||||
{ 0x0000, 0x7164, 0x7166, 0x7164, 0x7167, 0x7164, 0x7164, 0x7164, 0x7167 },
|
||||
{ 0x0000, 0x716B, 0x7169, 0x7168, 0x716B, 0x716A, 0x716B, 0x716B, 0x716A },
|
||||
{ 0x0000, 0x716C, 0x716D, 0x716F, 0x716C, 0x716E, 0x716E, 0x716E, 0x716F },
|
||||
{ 0x0000, 0x7171, 0x7173, 0x7170, 0x7172, 0x0000, 0x0000, 0x0000, 0x0000 },
|
||||
{ 0x0000, 0x7176, 0x7177, 0x7174, 0x7174, 0x7175, 0x7174, 0x7174, 0x7177 },
|
||||
{ 0x0000, 0x7178, 0x7179, 0x7179, 0x717B, 0x717A, 0x717B, 0x717A, 0x717B },
|
||||
{ 0x0000, 0x717D, 0x717C, 0x717C, 0x717D, 0x717F, 0x717C, 0x717E, 0x717D },
|
||||
{ 0x0000, 0x7183, 0x7181, 0x7180, 0x7183, 0x7182, 0x7183, 0x7181, 0x7183 },
|
||||
{ 0x0000, 0x7184, 0x7186, 0x7185, 0x7186, 0x7184, 0x7187, 0x7186, 0x7184 },
|
||||
{ 0x0000, 0x71A4, 0x71A6, 0x71A5, 0x0000, 0x71A6, 0x71A6, 0x71A6, 0x71A7 },
|
||||
{ 0x0000, 0x7188, 0x7188, 0x7189, 0x7188, 0x7189, 0x718B, 0x718A, 0x7189 },
|
||||
{ 0x0000, 0x718C, 0x718C, 0x718D, 0x718C, 0x718E, 0x718F, 0x718D, 0x718C },
|
||||
{ 0x0000, 0x7190, 0x7190, 0x7191, 0x7192, 0x7191, 0x7193, 0x7190, 0x7191 },
|
||||
{ 0x0000, 0x7196, 0x7194, 0x7195, 0x7196, 0x7197, 0x7194, 0x7196, 0x7195 },
|
||||
{ 0x0000, 0x7199, 0x719A, 0x7198, 0x7198, 0x719A, 0x719A, 0x719B, 0x7198 },
|
||||
{ 0x0000, 0x719D, 0x719C, 0x719E, 0x719D, 0x719D, 0x719C, 0x719F, 0x719E },
|
||||
{ 0x0000, 0x71A1, 0x71A0, 0x71A1, 0x71A2, 0x71A1, 0x71A2, 0x71A3, 0x71A2 },
|
||||
{ 0x0000, 0x711C, 0x711E, 0x711C, 0x711F, 0x711E, 0x711C, 0x711D, 0x711F },
|
||||
{ 0x0000, 0x7104, 0x7105, 0x7107, 0x7107, 0x7105, 0x7106, 0x7107, 0x7107 },
|
||||
{ 0x0000, 0x7107, 0x7105, 0x7107, 0x7107, 0x7106, 0x7107, 0x7107, 0x7105 },
|
||||
{ 0x0000, 0x7113, 0x7117, 0x7113, 0x7110, 0x7112, 0x7112, 0x7116, 0x7112 },
|
||||
{ 0x0000, 0x7113, 0x7113, 0x7113, 0x7113, 0x7113, 0x7113, 0x7111, 0x7113 },
|
||||
{ 0x0000, 0x7113, 0x7117, 0x7113, 0x7110, 0x7112, 0x7112, 0x7116, 0x7112 },
|
||||
{ 0x0000, 0x7117, 0x7117, 0x7117, 0x7117, 0x7117, 0x7117, 0x7117, 0x7113 },
|
||||
{ 0x0000, 0x7101, 0x7100, 0x7102, 0x7103, 0x7101, 0x7100, 0x7102, 0x7103 },
|
||||
{ 0x0000, 0x7100, 0x7102, 0x7100, 0x7100, 0x7100, 0x7100, 0x7100, 0x7102 },
|
||||
{ 0x0000, 0x710A, 0x7109, 0x7109, 0x710A, 0x710B, 0x7108, 0x7109, 0x710B },
|
||||
{ 0x0000, 0x7117, 0x7112, 0x7113, 0x7110, 0x710C, 0x7117, 0x710E, 0x7112 },
|
||||
{ 0x0000, 0x710D, 0x710F, 0x710C, 0x7112, 0x710D, 0x710C, 0x710C, 0x710F },
|
||||
{ 0x0000, 0x710A, 0x7109, 0x711A, 0x710A, 0x7109, 0x7108, 0x710B, 0x7109 },
|
||||
{ 0x0000, 0x710C, 0x710F, 0x7113, 0x7110, 0x710D, 0x7112, 0x7116, 0x710D },
|
||||
{ 0x0000, 0x7115, 0x7114, 0x7114, 0x7115, 0x7114, 0x7114, 0x7116, 0x7117 },
|
||||
{ 0x0000, 0x7113, 0x710F, 0x7113, 0x7110, 0x710C, 0x711A, 0x710D, 0x7112 },
|
||||
{ 0x0000, 0x7101, 0x7102, 0x7103, 0x7101, 0x7100, 0x7100, 0x7102, 0x7100 },
|
||||
{ 0x0000, 0x7112, 0x710E, 0x7112, 0x710E, 0x710D, 0x7112, 0x710E, 0x710F },
|
||||
{ 0x0000, 0x7142, 0x7141, 0x7142, 0x7143, 0x7140, 0x7140, 0x7141, 0x7143 },
|
||||
{ 0x0000, 0x713C, 0x713D, 0x713D, 0x713E, 0x713E, 0x713F, 0x713D, 0x713F },
|
||||
{ 0x0000, 0x7101, 0x7102, 0x7103, 0x7101, 0x7100, 0x7100, 0x7102, 0x7100 },
|
||||
{ 0x0000, 0x7113, 0x7117, 0x7113, 0x7110, 0x7112, 0x7112, 0x7116, 0x7112 },
|
||||
{ 0x0000, 0x7104, 0x7105, 0x7107, 0x7105, 0x7105, 0x7105, 0x7107, 0x7107 },
|
||||
{ 0x0000, 0x7104, 0x7105, 0x7107, 0x7105, 0x710C, 0x7105, 0x7107, 0x7107 },
|
||||
};
|
||||
|
||||
u16 Text_GetFaceReaction(GlobalContext* globalCtx, u32 reactionSet) {
|
||||
u8 currentMask = func_8008F080(globalCtx);
|
||||
return sReactionTextIds[reactionSet][currentMask];
|
||||
}
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#include <global.h>
|
||||
|
||||
#define GAMESTATE_OVERLAY(name, init, destroy, size) \
|
||||
{ \
|
||||
NULL, (u32)_ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, _ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, 0, init, destroy, 0, 0, 0, size \
|
||||
}
|
||||
#define GAMESTATE_OVERLAY_INTERNAL(init, destroy, size) \
|
||||
{ NULL, 0, 0, NULL, NULL, 0, init, destroy, 0, 0, 0, size }
|
||||
|
||||
GameStateOverlay gGameStateOverlayTable[] = {
|
||||
GAMESTATE_OVERLAY_INTERNAL(TitleSetup_Init, TitleSetup_Destroy, sizeof(GameState)),
|
||||
GAMESTATE_OVERLAY(select, func_80801E44, func_80801E0C, 0x240), // TODO : sizeof(SelectContext)
|
||||
GAMESTATE_OVERLAY(title, Title_Init, Title_Destroy, sizeof(TitleContext)),
|
||||
GAMESTATE_OVERLAY_INTERNAL(func_800BCA64, func_800BC8EC, sizeof(GlobalContext)),
|
||||
GAMESTATE_OVERLAY(opening, Opening_Init, Opening_Destroy, sizeof(OpeningContext)),
|
||||
GAMESTATE_OVERLAY(file_choose, func_80811A20, func_80811A18, 0x1CAE0),
|
||||
};
|
||||
+136
-185
@@ -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,239 +33,209 @@ 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 },
|
||||
{ 0xF6F7, 0x0139, 0x1766 },
|
||||
};
|
||||
|
||||
if (gSaveContext.entrance_index == 0x028A)
|
||||
if (gSaveContext.entrance_index == 0x028A) {
|
||||
spawnPos = spawnPositions[0];
|
||||
else if (gSaveContext.entrance_index == 0x028E)
|
||||
} else if (gSaveContext.entrance_index == 0x028E) {
|
||||
spawnPos = spawnPositions[1];
|
||||
else if (gSaveContext.entrance_index == 0x0292)
|
||||
} else if (gSaveContext.entrance_index == 0x0292) {
|
||||
spawnPos = spawnPositions[2];
|
||||
else
|
||||
} 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);
|
||||
if (player->rideActor == NULL)
|
||||
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);
|
||||
if (player->rideActor == NULL)
|
||||
} 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);
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
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);
|
||||
if (player->rideActor == NULL)
|
||||
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;
|
||||
|
||||
temp = 0;
|
||||
if (((gSaveContext.event_inf[0] & 0x10) >> 4) && D_8011F9B8[i].type == 6)
|
||||
if (((gSaveContext.event_inf[0] & 0x10) >> 4) && D_8011F9B8[i].type == 6) {
|
||||
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);
|
||||
if (player->rideActor == NULL)
|
||||
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);
|
||||
}
|
||||
|
||||
player->actor.posRot.pos.x = D_8011F9B8[i].pos.x;
|
||||
player->actor.posRot.pos.y = D_8011F9B8[i].pos.y;
|
||||
@@ -285,12 +251,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 +262,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 +287,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,67 +7,54 @@ 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)
|
||||
LogUtils_LogThreadId("../z_kaleido_scope_call.c", 98);
|
||||
osSyncPrintf("kaleido_scope_move = %08x\n", func_80826CB4);
|
||||
LogUtils_LogThreadId("../z_kaleido_scope_call.c", 99);
|
||||
osSyncPrintf("kaleido_scope_move_func = %08x\n", sKaleidoScopeUpdateFunc);
|
||||
LogUtils_LogThreadId("../z_kaleido_scope_call.c", 100);
|
||||
osSyncPrintf("kaleido_scope_draw = %08x\n", func_808262B8);
|
||||
LogUtils_LogThreadId("../z_kaleido_scope_call.c", 101);
|
||||
osSyncPrintf("kaleido_scope_draw_func = %08x\n", sKaleidoScopeDrawFunc);
|
||||
|
||||
LOG_ADDRESS("kaleido_scope_move", func_80826CB4, "../z_kaleido_scope_call.c", 98);
|
||||
LOG_ADDRESS("kaleido_scope_move_func", sKaleidoScopeUpdateFunc, "../z_kaleido_scope_call.c", 99);
|
||||
LOG_ADDRESS("kaleido_scope_draw", func_808262B8, "../z_kaleido_scope_call.c", 100);
|
||||
LOG_ADDRESS("kaleido_scope_draw_func", sKaleidoScopeDrawFunc, "../z_kaleido_scope_call.c", 101);
|
||||
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 +62,36 @@ 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)
|
||||
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 +104,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")
|
||||
|
||||
|
||||
+155
-242
@@ -1,112 +1,94 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void Lib_MemSet(void* dest, size_t size, u8 val)
|
||||
{
|
||||
u8* destu = dest;
|
||||
u32 i;
|
||||
void Lib_MemSet(u8* dest, size_t size, u8 val) {
|
||||
u32 i = 0;
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
*destu++ = val;
|
||||
// TODO: Convert this to while/for if possible
|
||||
if (i == size) {
|
||||
return;
|
||||
}
|
||||
do {
|
||||
*dest++ = val;
|
||||
i++;
|
||||
} while (i != size);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lib/Lib_MemSet.s")
|
||||
#endif
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -114,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;
|
||||
}
|
||||
@@ -129,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;
|
||||
}
|
||||
@@ -180,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;
|
||||
|
||||
@@ -223,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;
|
||||
@@ -284,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;
|
||||
@@ -293,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);
|
||||
}
|
||||
|
||||
@@ -331,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;
|
||||
|
||||
@@ -405,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;
|
||||
|
||||
@@ -419,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;
|
||||
|
||||
@@ -432,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -473,174 +401,159 @@ 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;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc differences
|
||||
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;
|
||||
s16 step;
|
||||
|
||||
baseStep = diff / invScale;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return diff;
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lib/Math_SmoothScaleMaxMinS.s")
|
||||
#endif
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
+111
-203
@@ -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;
|
||||
@@ -49,29 +48,23 @@ void Health_InitData(GlobalContext* globalCtx)
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// this function still needs some work
|
||||
void Health_UpdateData(GlobalContext* globalCtx)
|
||||
{
|
||||
// this function still needs some work but it should be functionally equivalent
|
||||
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;
|
||||
@@ -222,188 +206,131 @@ void Interface_DrawHealth(GlobalContext* globalCtx)
|
||||
s32 curCombineModeSet = 0;
|
||||
u8* curBgImgLoaded = NULL;
|
||||
s32 ddHeartCountMinusOne = gSaveContext.defense_hearts - 1;
|
||||
Gfx* gfxArr[5];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, gfxCtx, "../z_lifemeter.c", 353);
|
||||
Graph_OpenDisps(dispRefs, 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,62 +373,55 @@ void Interface_DrawHealth(GlobalContext* globalCtx)
|
||||
}
|
||||
|
||||
offsetX += 10.0f;
|
||||
if (i == 9)
|
||||
{
|
||||
if (i == 9) {
|
||||
offsetY += 10.0f;
|
||||
offsetX = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
func_800C6B54(gfxArr, gfxCtx, "../z_lifemeter.c", 606);
|
||||
Graph_CloseDisps(dispRefs, gfxCtx, "../z_lifemeter.c", 606);
|
||||
}
|
||||
|
||||
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")
|
||||
|
||||
|
||||
+48
-70
@@ -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;
|
||||
@@ -94,28 +86,27 @@ void MapMark_Draw(GlobalContext* globalCtx)
|
||||
s32 rectLeft;
|
||||
s32 rectTop;
|
||||
GraphicsContext* gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
mapMarkData = &sLoadedMarkDataTable[dungeonId][interfaceCtx->roomNum][0];
|
||||
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_map_mark.c", 303);
|
||||
Graph_OpenDisps(dispRefs, 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,44 +114,31 @@ 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++;
|
||||
}
|
||||
mapMarkData++;
|
||||
}
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_map_mark.c", 339);
|
||||
Graph_CloseDisps(dispRefs, 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")
|
||||
|
||||
|
||||
+38
-49
@@ -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)
|
||||
{
|
||||
Gfx* gfxArr[7];
|
||||
void func_8007B9A4(GraphicsContext* gfxCtx, u8 arg1) {
|
||||
Gfx* dispRefs[7];
|
||||
|
||||
func_800C6AC4(gfxArr, gfxCtx, "../z_moji.c", 86);
|
||||
Graph_OpenDisps(dispRefs, 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);
|
||||
Graph_CloseDisps(dispRefs, gfxCtx, "../z_moji.c", 123);
|
||||
}
|
||||
|
||||
void func_8007BBA8(GraphicsContext* gfxCtx, u8* arg1)
|
||||
{
|
||||
void func_8007BBA8(GraphicsContext* gfxCtx, u8* arg1) {
|
||||
s32 i;
|
||||
Gfx* gfxArr[5];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
func_800C6AC4(gfxArr, gfxCtx, "../z_moji.c", 137);
|
||||
Graph_OpenDisps(dispRefs, 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]);
|
||||
@@ -119,5 +108,5 @@ void func_8007BBA8(GraphicsContext* gfxCtx, u8* arg1)
|
||||
}
|
||||
}
|
||||
|
||||
func_800C6B54(gfxArr, gfxCtx, "../z_moji.c", 181);
|
||||
Graph_CloseDisps(dispRefs, gfxCtx, "../z_moji.c", 181);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
#include <sched.h>
|
||||
|
||||
void MsgEvent_SendNullTask() {
|
||||
u32 pad[4];
|
||||
OSScTask task;
|
||||
OSMesgQueue queue;
|
||||
OSMesg msg;
|
||||
u32 pad2[1];
|
||||
|
||||
task.next = NULL;
|
||||
task.flags = OS_SC_RCP_MASK;
|
||||
task.msgQ = &queue;
|
||||
task.msg = NULL;
|
||||
task.framebuffer = NULL;
|
||||
task.list.t.type = M_NULTASK;
|
||||
osCreateMesgQueue(task.msgQ, &msg, 1);
|
||||
osSendMesg(&gSchedContext.cmdQ, &task, OS_MESG_BLOCK);
|
||||
func_800C95F8(&gSchedContext); // osScKickEntryMsg
|
||||
osRecvMesg(&queue, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
+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) {
|
||||
}
|
||||
|
||||
+1609
-2289
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,46 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
Path* Path_GetByIndex(GlobalContext* globalCtx, s16 index, s16 max) {
|
||||
Path* path;
|
||||
|
||||
if (index != max) {
|
||||
path = &globalCtx->setupPathList[index];
|
||||
} else {
|
||||
path = NULL;
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw) {
|
||||
f32 dx;
|
||||
f32 dz;
|
||||
Vec3s* pointPos;
|
||||
|
||||
if (path == NULL) {
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
pointPos = SEGMENTED_TO_VIRTUAL(path->points);
|
||||
pointPos = &pointPos[waypoint];
|
||||
|
||||
dx = pointPos->x - actor->posRot.pos.x;
|
||||
dz = pointPos->z - actor->posRot.pos.z;
|
||||
|
||||
*yaw = Math_atan2f(dx, dz) * (32768 / M_PI);
|
||||
|
||||
return SQ(dx) + SQ(dz);
|
||||
}
|
||||
|
||||
void Path_CopyLastPoint(Path* path, Vec3f* dest) {
|
||||
Vec3s* pointPos;
|
||||
|
||||
if (path != NULL) {
|
||||
pointPos = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[path->count - 1];
|
||||
|
||||
dest->x = pointPos->x;
|
||||
dest->y = pointPos->y;
|
||||
dest->z = pointPos->z;
|
||||
}
|
||||
}
|
||||
+23
-46
@@ -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) {
|
||||
Gfx_SetFog2(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,14 +52,13 @@ 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;
|
||||
globalCtx->setupEntranceList = NULL;
|
||||
globalCtx->setupExitList = NULL;
|
||||
globalCtx->naviMsgSegment = NULL;
|
||||
globalCtx->cUpElfMsgs = NULL;
|
||||
globalCtx->setupPathList = NULL;
|
||||
globalCtx->nbSetupActors = 0;
|
||||
Object_InitBank(globalCtx, &globalCtx->objectCtx);
|
||||
@@ -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")
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user