mirror of
https://github.com/zeldaret/mm.git
synced 2026-07-30 23:54:48 -04:00
Use hex instead of decimal
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
#include <global.h>
|
||||
|
||||
typedef struct z_ActorBgIkanaRay_s {
|
||||
/* 000 */ z_Actor baseActor;
|
||||
/* 324 */ UNK_TYPE unk324;
|
||||
/* 328 */ u8 pad5[72];
|
||||
/* 400 */ UNK_TYPE unk400;
|
||||
/* 404 */ void(*unk404)(struct z_ActorBgIkanaRay_s*, z_GlobalContext*);
|
||||
/* 0x000 */ z_Actor baseActor;
|
||||
/* 0x144 */ UNK_TYPE unk144;
|
||||
/* 0x148 */ u8 pad5[0x48];
|
||||
/* 0x190 */ UNK_TYPE unk190;
|
||||
/* 0x194 */ void(*unk404)(struct z_ActorBgIkanaRay_s*, z_GlobalContext*);
|
||||
} z_ActorBgIkanaRay;
|
||||
|
||||
void z_bg_ikana_ray_init(z_ActorBgIkanaRay* this, z_GlobalContext* ctxt);
|
||||
@@ -85,16 +85,16 @@ glabel D_80BD562C
|
||||
)
|
||||
|
||||
void z_bg_ikana_ray_init(z_ActorBgIkanaRay* this, z_GlobalContext* ctxt) {
|
||||
UNK_TYPE* sp36 = &this->unk324;
|
||||
UNK_TYPE* sp24 = &this->unk144;
|
||||
u32 pad;
|
||||
|
||||
func_800FFADC((z_Actor*)this, bgIkanaRayCompInit);
|
||||
func_800E119C(ctxt, sp36);
|
||||
func_800E130C(ctxt, sp36, (z_Actor*)this, &D_80BD55F0);
|
||||
func_800E7DF8((z_Actor*)this, &this->unk324);
|
||||
this->unk400 = func_80100504((UNK_TYPE)&D_06001228); // XXX: D_06001228 is probably a constant
|
||||
func_800E119C(ctxt, sp24);
|
||||
func_800E130C(ctxt, sp24, (z_Actor*)this, &D_80BD55F0);
|
||||
func_800E7DF8((z_Actor*)this, &this->unk144);
|
||||
this->unk190 = func_80100504((UNK_TYPE)&D_06001228); // XXX: D_06001228 is probably a constant
|
||||
|
||||
if (func_800B5BB0(ctxt, this->baseActor.unk28 & 0x7F) != 0) {
|
||||
if (func_800B5BB0(ctxt, this->baseActor.unk1C & 0x7F) != 0) {
|
||||
func_80BD5500(this);
|
||||
} else {
|
||||
func_80BD5498(this);
|
||||
@@ -102,7 +102,7 @@ void z_bg_ikana_ray_init(z_ActorBgIkanaRay* this, z_GlobalContext* ctxt) {
|
||||
}
|
||||
|
||||
void z_bg_ikana_ray_fini(z_ActorBgIkanaRay* this, z_GlobalContext* ctxt) {
|
||||
UNK_TYPE* a1 = &this->unk324;
|
||||
UNK_TYPE* a1 = &this->unk144;
|
||||
func_800E11EC(ctxt, a1);
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ void func_80BD5498(z_ActorBgIkanaRay* this) {
|
||||
}
|
||||
|
||||
void func_80BD54BC(z_ActorBgIkanaRay* this, z_GlobalContext* ctxt) {
|
||||
if (func_800B5BB0(ctxt, this->baseActor.unk28 & 0x7F) != 0) {
|
||||
if (func_800B5BB0(ctxt, this->baseActor.unk1C & 0x7F) != 0) {
|
||||
func_80BD5500(this);
|
||||
}
|
||||
}
|
||||
@@ -125,7 +125,7 @@ void func_80BD5500(z_ActorBgIkanaRay* this) {
|
||||
}
|
||||
|
||||
void func_80BD5530(z_ActorBgIkanaRay* this, z_GlobalContext* ctxt) {
|
||||
func_800E2558(ctxt, &ctxt->unk100484, &this->unk324);
|
||||
func_800E2558(ctxt, &ctxt->unk18884, &this->unk144);
|
||||
}
|
||||
|
||||
void z_bg_ikana_ray_main(z_ActorBgIkanaRay* this, z_GlobalContext* ctxt) {
|
||||
@@ -133,6 +133,6 @@ void z_bg_ikana_ray_main(z_ActorBgIkanaRay* this, z_GlobalContext* ctxt) {
|
||||
}
|
||||
|
||||
void z_bg_ikana_ray_draw(z_ActorBgIkanaRay* this, z_GlobalContext* ctxt) {
|
||||
func_80131758(ctxt, this->unk400);
|
||||
func_80131758(ctxt, this->unk190);
|
||||
func_800BE03C(ctxt, (UNK_TYPE)&D_06001100); // XXX: D_06001100 is probably a constant
|
||||
}
|
||||
|
||||
+16
-16
@@ -15,40 +15,40 @@ UNK_RET func_8008019C(void) {
|
||||
}
|
||||
|
||||
UNK_RET func_800801EC(void) {
|
||||
UNK_TYPE sp28;
|
||||
UNK_PTR sp24 = (UNK_PTR)(0x80000000 + osMemSize);
|
||||
UNK_TYPE sp1C;
|
||||
UNK_PTR sp18 = (UNK_PTR)(0x80000000 + osMemSize);
|
||||
func_80080150((void*)0x80000400, &D_80000500);
|
||||
func_80080150(&D_80025D00, (int*)func_80080060);
|
||||
func_80080150(&D_80208EA0, sp24);
|
||||
func_80080150(&D_80208EA0, sp18);
|
||||
}
|
||||
|
||||
UNK_RET func_80080250(void) {
|
||||
UNK_TYPE* v0;
|
||||
UNK_PTR v1;
|
||||
UNK_PTR t7;
|
||||
UNK_TYPE sp88;
|
||||
UNK_TYPE sp84;
|
||||
UNK_TYPE sp80;
|
||||
UNK_TYPE sp76;
|
||||
UNK_TYPE sp72;
|
||||
OSMesgQueue sp48;
|
||||
OSMesg sp44;
|
||||
UNK_TYPE sp40;
|
||||
UNK_TYPE sp58;
|
||||
UNK_TYPE sp54;
|
||||
UNK_TYPE sp50;
|
||||
UNK_TYPE sp4C;
|
||||
UNK_TYPE sp48;
|
||||
OSMesgQueue sp30;
|
||||
OSMesg sp2C;
|
||||
UNK_TYPE sp28;
|
||||
|
||||
osCreateMesgQueue(&sp48, &sp44, 1);
|
||||
osCreateMesgQueue(&sp30, &sp2C, 1);
|
||||
|
||||
v1 = &D_00B3C000;
|
||||
t7 = &D_00C7A4E0;
|
||||
v0 = &D_80096B50;
|
||||
sp40 = *v0;
|
||||
sp28 = *v0;
|
||||
*v0 = 0;
|
||||
|
||||
func_80080C04((s80080A08*)&sp72, (UNK_FUN_ARG)func_800A5AC0, v1, (u32)t7 - (u32)v1, 0, &sp48, 0);
|
||||
func_80080C04((s80080A08*)&sp48, (UNK_FUN_ARG)func_800A5AC0, v1, (u32)t7 - (u32)v1, 0, &sp30, 0);
|
||||
func_8008019C();
|
||||
func_800801EC();
|
||||
osRecvMesg(&sp48, 0, 1);
|
||||
osRecvMesg(&sp30, 0, 1);
|
||||
|
||||
D_80096B50 = sp40;
|
||||
D_80096B50 = sp28;
|
||||
|
||||
func_80080150(&D_801E3FA0, &D_80208EA0);
|
||||
}
|
||||
|
||||
+31
-31
@@ -1,48 +1,48 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void func_80085320(struct s80085320* a0, UNK_PTR a1, UNK_PTR a2, UNK_TYPE a3, UNK_TYPE sp16, UNK_PTR sp20) {
|
||||
void func_80085320(s80085320* a0, UNK_PTR a1, UNK_PTR a2, UNK_TYPE a3, UNK_TYPE sp10, UNK_PTR sp14) {
|
||||
UNK_TYPE* i;
|
||||
struct s80085320* v0;
|
||||
|
||||
s80085320* v0;
|
||||
|
||||
if (a0 == NULL) {
|
||||
g_s80085320_ListHead = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
a0->unk8 = a1;
|
||||
a0->unk12 = a2;
|
||||
a0->unk16 = a3;
|
||||
a0->unk20 = sp16;
|
||||
a0->unk24 = sp20;
|
||||
|
||||
a0->unkC = a2;
|
||||
a0->unk10 = a3;
|
||||
a0->unk14 = sp10;
|
||||
a0->unk18 = sp14;
|
||||
|
||||
v0 = g_s80085320_ListHead;
|
||||
while (v0 != NULL) {
|
||||
if (v0 == a0) return;
|
||||
v0 = v0->next;
|
||||
}
|
||||
|
||||
|
||||
a0->prev = g_s80085320_ListTail;
|
||||
a0->next = NULL;
|
||||
|
||||
|
||||
if (g_s80085320_ListTail != NULL) {
|
||||
g_s80085320_ListTail->next = a0;
|
||||
}
|
||||
|
||||
|
||||
g_s80085320_ListTail = a0;
|
||||
|
||||
|
||||
if (g_s80085320_ListHead == NULL) {
|
||||
g_s80085320_ListHead = a0;
|
||||
}
|
||||
|
||||
if (a0->unk20 != -1) {
|
||||
for (i = a0->unk8; i < a0->unk12; i++) {
|
||||
*i = a0->unk16;
|
||||
|
||||
if (a0->unk14 != -1) {
|
||||
for (i = a0->unk8; i < a0->unkC; i++) {
|
||||
*i = a0->unk10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UNK_RET func_800853F8(struct s80085320* a0) {
|
||||
UNK_RET func_800853F8(s80085320* a0) {
|
||||
if (a0->prev == NULL) {
|
||||
if (g_s80085320_ListHead == a0) {
|
||||
g_s80085320_ListHead = a0->next;
|
||||
@@ -50,7 +50,7 @@ UNK_RET func_800853F8(struct s80085320* a0) {
|
||||
} else {
|
||||
a0->prev->next = a0->next;
|
||||
}
|
||||
|
||||
|
||||
if (a0->next == NULL) {
|
||||
if (g_s80085320_ListTail == a0) {
|
||||
g_s80085320_ListTail = a0->prev;
|
||||
@@ -58,32 +58,32 @@ UNK_RET func_800853F8(struct s80085320* a0) {
|
||||
}
|
||||
}
|
||||
|
||||
UNK_TYPE func_80085468(struct s80085320* a0) {
|
||||
UNK_TYPE func_80085468(s80085320* a0) {
|
||||
UNK_TYPE* v1 = a0->unk8;
|
||||
UNK_TYPE* a1 = a0->unk12;
|
||||
UNK_TYPE* a1 = a0->unkC;
|
||||
UNK_TYPE* v0 = v1;
|
||||
u32 x; // ptr_diff
|
||||
|
||||
|
||||
while (v0 < a1) {
|
||||
if (*v0++ != a0->unk16) break;
|
||||
if (*v0++ != a0->unk10) break;
|
||||
a1 = (UNK_TYPE*)((u32)v0 - (u32)v1);
|
||||
}
|
||||
|
||||
|
||||
x = v0 - v1;
|
||||
|
||||
|
||||
if (x == 0) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
if ((x < a0->unk20) && (a0->unk20 != -1)) {
|
||||
|
||||
if ((x < a0->unk14) && (a0->unk14 != -1)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
UNK_TYPE func_800854E0(UNK_ARGS) {
|
||||
struct s80085320* s0 = g_s80085320_ListHead;
|
||||
s80085320* s0 = g_s80085320_ListHead;
|
||||
UNK_TYPE ret = 0;
|
||||
while (s0 != NULL) {
|
||||
if (func_80085468(s0) != 0) {
|
||||
@@ -91,11 +91,11 @@ UNK_TYPE func_800854E0(UNK_ARGS) {
|
||||
}
|
||||
s0 = s0->next;
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
UNK_RET func_80085538(struct s80085320* a0) {
|
||||
UNK_RET func_80085538(s80085320* a0) {
|
||||
if (a0 == NULL) {
|
||||
func_800854E0();
|
||||
} else {
|
||||
|
||||
@@ -2,29 +2,29 @@
|
||||
#include <global.h>
|
||||
|
||||
UNK_TYPE func_8008D350(void) {
|
||||
u32* sp12;
|
||||
u32* spC;
|
||||
u32 sp8;
|
||||
u32 sp4;
|
||||
u32 sp0;
|
||||
|
||||
|
||||
sp8 = 0x400000;
|
||||
|
||||
|
||||
do {
|
||||
sp12 = (u32*)(sp8 + 0xA0000000);
|
||||
spC = (u32*)(sp8 + 0xA0000000);
|
||||
sp4 = *(u32*)(0xA0000000 + sp8);
|
||||
sp0 = *(u32*)(0xA00FFFFC + sp8);
|
||||
*(u32*)(0xA0000000 + sp8) = *(u32*)(0xA0000000 + sp8) ^ 0xFFFFFFFF;
|
||||
sp12[0x000FFFFC/4] = sp12[0x000FFFFC/4] ^ 0xFFFFFFFF;
|
||||
|
||||
if ((sp12[0] != (sp4 ^ 0xFFFFFFFF)) ||
|
||||
(sp12[0x000FFFFC/4] != (sp0 ^ 0xFFFFFFFF))) {
|
||||
spC[0x000FFFFC/4] = spC[0x000FFFFC/4] ^ 0xFFFFFFFF;
|
||||
|
||||
if ((spC[0] != (sp4 ^ 0xFFFFFFFF)) ||
|
||||
(spC[0x000FFFFC/4] != (sp0 ^ 0xFFFFFFFF))) {
|
||||
return sp8;
|
||||
}
|
||||
|
||||
*sp12 = sp4;
|
||||
sp12[0x000FFFFC/4] = sp0;
|
||||
|
||||
*spC = sp4;
|
||||
spC[0x000FFFFC/4] = sp0;
|
||||
sp8 = sp8 + 0x100000;
|
||||
} while(sp8 < 0x800000);
|
||||
|
||||
|
||||
return sp8;
|
||||
}
|
||||
|
||||
@@ -3,40 +3,40 @@
|
||||
|
||||
s32 func_80080790(void* a0, void* a1, s32 a2) {
|
||||
u32 spPad;
|
||||
OSIoMesg sp96;
|
||||
OSMesgQueue sp72;
|
||||
OSMesg sp68;
|
||||
OSIoMesg sp60;
|
||||
OSMesgQueue sp48;
|
||||
OSMesg sp44;
|
||||
s32 ret;
|
||||
u32 s0 = D_80096B50;
|
||||
|
||||
osInvalDCache(a1, a2);
|
||||
osCreateMesgQueue(&sp72, &sp68, 1);
|
||||
osCreateMesgQueue(&sp48, &sp44, 1);
|
||||
|
||||
if (s0 != 0) {
|
||||
while (s0 < a2) {
|
||||
sp96.hdr.pri = 0;
|
||||
sp96.hdr.retQueue = &sp72;
|
||||
sp96.devAddr = (u32)a0;
|
||||
sp96.dramAddr = a1;
|
||||
sp96.size = s0;
|
||||
ret = osEPiStartDma(D_80096B40, &sp96, 0);
|
||||
sp60.hdr.pri = 0;
|
||||
sp60.hdr.retQueue = &sp48;
|
||||
sp60.devAddr = (u32)a0;
|
||||
sp60.dramAddr = a1;
|
||||
sp60.size = s0;
|
||||
ret = osEPiStartDma(D_80096B40, &sp60, 0);
|
||||
if (ret) goto END;
|
||||
|
||||
osRecvMesg(&sp72, NULL, 1);
|
||||
osRecvMesg(&sp48, NULL, 1);
|
||||
a2 -= s0;
|
||||
a0 = (u8*)a0 + s0;
|
||||
a1 = (u8*)a1 + s0;
|
||||
}
|
||||
}
|
||||
sp96.hdr.pri = 0;
|
||||
sp96.hdr.retQueue = &sp72;
|
||||
sp96.devAddr = (u32)a0;
|
||||
sp96.dramAddr = a1;
|
||||
sp96.size = (u32)a2;
|
||||
ret = osEPiStartDma(D_80096B40, &sp96, 0);
|
||||
sp60.hdr.pri = 0;
|
||||
sp60.hdr.retQueue = &sp48;
|
||||
sp60.devAddr = (u32)a0;
|
||||
sp60.dramAddr = a1;
|
||||
sp60.size = (u32)a2;
|
||||
ret = osEPiStartDma(D_80096B40, &sp60, 0);
|
||||
if (ret) goto END;
|
||||
|
||||
osRecvMesg(&sp72, NULL, 1);
|
||||
osRecvMesg(&sp48, NULL, 1);
|
||||
|
||||
osInvalDCache(a1, a2);
|
||||
|
||||
@@ -83,7 +83,6 @@ s32 func_800809BC(u32 a0) {
|
||||
DmadataEntry* v0 = func_800808F4(a0);
|
||||
|
||||
if (v0 != NULL) {
|
||||
// TODO this uses t7 to shift instead of reusing v0
|
||||
return v0 - dmadata;
|
||||
}
|
||||
|
||||
@@ -97,44 +96,44 @@ UNK_TYPE* func_800809F4(u32 a0) {
|
||||
#ifdef NONMATCHING
|
||||
|
||||
void func_80080A08(s80080A08* a0) {
|
||||
UNK_TYPE sp52;
|
||||
UNK_TYPE sp48;
|
||||
UNK_TYPE sp44;
|
||||
UNK_TYPE sp40;
|
||||
UNK_TYPE sp36;
|
||||
UNK_TYPE sp32;
|
||||
s32 sp28;
|
||||
UNK_TYPE sp34;
|
||||
UNK_TYPE sp30;
|
||||
UNK_TYPE sp2C;
|
||||
UNK_TYPE sp28;
|
||||
UNK_TYPE sp24;
|
||||
UNK_TYPE sp20;
|
||||
s32 sp1C;
|
||||
UNK_TYPE sp18;
|
||||
|
||||
sp52 = (UNK_TYPE)a0->unk0;
|
||||
sp48 = (UNK_TYPE)a0->unk4;
|
||||
sp44 = a0->unk8;
|
||||
sp34 = (UNK_TYPE)a0->unk0;
|
||||
sp30 = (UNK_TYPE)a0->unk4;
|
||||
sp2C = a0->unk8;
|
||||
|
||||
sp28 = func_800809BC(sp52);
|
||||
sp1C = func_800809BC(sp34);
|
||||
|
||||
if ((sp28 >= 0) && (sp28 < D_8009B2BC)) {
|
||||
if (dmadata[sp28].romEnd == 0) {
|
||||
if (dmadata[sp28].vromEnd < (sp44 + sp52)) {
|
||||
if ((sp1C >= 0) && (sp1C < D_8009B2BC)) {
|
||||
if (dmadata[sp1C].romEnd == 0) {
|
||||
if (dmadata[sp1C].vromEnd < (sp2C + sp34)) {
|
||||
func_80083E4C(&D_800981C4, 499);
|
||||
}
|
||||
func_80080790((u8*)((dmadata[sp28].romStart + sp52) - dmadata[sp28].vromStart), (u8*)sp48, sp44);
|
||||
func_80080790((u8*)((dmadata[sp1C].romStart + sp34) - dmadata[sp1C].vromStart), (u8*)sp30, sp2C);
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO this part is arranged slightly different is ASM
|
||||
sp36 = dmadata[sp28].romEnd - dmadata[sp28].romStart;
|
||||
sp40 = dmadata[sp28].romStart;
|
||||
sp24 = dmadata[sp1C].romEnd - dmadata[sp1C].romStart;
|
||||
sp28 = dmadata[sp1C].romStart;
|
||||
|
||||
if (sp52 != dmadata[sp28].vromStart) {
|
||||
if (sp34 != dmadata[sp1C].vromStart) {
|
||||
func_80083E4C(&D_800981D4, 518);
|
||||
}
|
||||
|
||||
if (sp44 != (dmadata[sp28].vromEnd - dmadata[sp28].vromStart)) {
|
||||
if (sp2C != (dmadata[sp1C].vromEnd - dmadata[sp1C].vromStart)) {
|
||||
func_80083E4C(&D_800981E4, 525);
|
||||
}
|
||||
|
||||
osSetThreadPri(NULL, 10);
|
||||
func_80081178(sp40, sp48, sp36);
|
||||
func_80081178(sp28, sp30, sp24);
|
||||
osSetThreadPri(NULL, 17);
|
||||
} else {
|
||||
func_80083E4C(&D_800981F4, 558);
|
||||
@@ -253,18 +252,18 @@ glabel func_80080A08
|
||||
#ifdef NONMATCHING
|
||||
|
||||
void func_80080B84(void* a0) {
|
||||
s80080A08* sp52;
|
||||
s80080A08* sp34;
|
||||
UNK_TYPE pad;
|
||||
s80080A08* s0;
|
||||
|
||||
for (;;) {
|
||||
osRecvMesg(&D_8009B2C0, (OSMesg)&sp52, 1);
|
||||
if (sp52 == NULL) return;
|
||||
s0 = sp52;
|
||||
osRecvMesg(&D_8009B2C0, (OSMesg)&sp34, 1);
|
||||
if (sp34 == NULL) return;
|
||||
s0 = sp34;
|
||||
func_80080A08(s0);
|
||||
// TODO a0 isn't being used for this comparison
|
||||
if (s0->unk24 == NULL) continue;
|
||||
osSendMesg(&D_8009B2C0, (OSMesg)s0->unk28, 0);
|
||||
if (s0->unk18 == NULL) continue;
|
||||
osSendMesg(&D_8009B2C0, (OSMesg)s0->unk1C, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,7 +311,7 @@ glabel func_80080B84
|
||||
|
||||
#ifdef NONMATCHING
|
||||
|
||||
s32 func_80080C04(s80080A08* a0, UNK_FUN_PTR(a1), UNK_PTR a2, UNK_TYPE a3, UNK_TYPE sp48, OSMesgQueue* sp52, UNK_TYPE sp56) {
|
||||
s32 func_80080C04(s80080A08* a0, UNK_FUN_PTR(a1), UNK_PTR a2, UNK_TYPE a3, UNK_TYPE sp30, OSMesgQueue* sp34, UNK_TYPE sp38) {
|
||||
// TODO this isn't correct, it uses a lui, addiu to get the address of D_80096B60, then loads it,
|
||||
// meaning that this is likely just "if (*D_80096B60 >= 2)". However, I can not get it to not
|
||||
// produce the usual lui, lw combo to load from an address :/
|
||||
@@ -323,9 +322,9 @@ s32 func_80080C04(s80080A08* a0, UNK_FUN_PTR(a1), UNK_PTR a2, UNK_TYPE a3, UNK_T
|
||||
a0->unk0 = a2;
|
||||
a0->unk4 = a1;
|
||||
a0->unk8 = a3;
|
||||
a0->unk20 = 0;
|
||||
a0->unk24 = sp52;
|
||||
a0->unk28 = sp56;
|
||||
a0->unk14 = 0;
|
||||
a0->unk18 = sp34;
|
||||
a0->unk1C = sp38;
|
||||
|
||||
osSendMesg(&D_8009B2C0, (OSMesg)a0, 1);
|
||||
|
||||
@@ -378,19 +377,19 @@ glabel func_80080C04
|
||||
#endif
|
||||
|
||||
s32 func_80080C90(UNK_TYPE a0, UNK_PTR a1, UNK_TYPE a2) {
|
||||
s80080A08 sp72;
|
||||
OSMesgQueue sp48;
|
||||
OSMesg sp44;
|
||||
s80080A08 sp48;
|
||||
OSMesgQueue sp30;
|
||||
OSMesg sp2C;
|
||||
s32 ret;
|
||||
|
||||
osCreateMesgQueue(&sp48, &sp44, 1);
|
||||
osCreateMesgQueue(&sp30, &sp2C, 1);
|
||||
|
||||
ret = func_80080C04(&sp72, (UNK_FUN_ARG)a0, a1, a2, 0, &sp48, 0);
|
||||
ret = func_80080C04(&sp48, (UNK_FUN_ARG)a0, a1, a2, 0, &sp30, 0);
|
||||
|
||||
if (ret == -1) {
|
||||
return ret;
|
||||
} else {
|
||||
osRecvMesg(&sp48, NULL, 1);
|
||||
osRecvMesg(&sp30, NULL, 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
+21
-21
@@ -4,48 +4,48 @@
|
||||
// TODO this file looks like an actor, it should be cleaned up as such
|
||||
|
||||
UNK_RET func_800A5AC0(void* a0, UNK_TYPE a1) {
|
||||
struct s800A5AC0* s0 = (struct s800A5AC0*)a0;
|
||||
s0->unk278 = ((s0->unk28 >> 8) & 0xFF) | 0x300;
|
||||
s0->unk28 = (s0->unk28 & 0xFF) - 9;
|
||||
s800A5AC0* s0 = (s800A5AC0*)a0;
|
||||
s0->unk116 = ((s0->unk1C >> 8) & 0xFF) | 0x300;
|
||||
s0->unk1C = (s0->unk1C & 0xFF) - 9;
|
||||
func_800FFADC((z_Actor*)s0, (z_ActorCompInitEntry*)&D_801ADEAC);
|
||||
func_800B3BA4(&s0->unk188, 0, (void*)&func_800B3FC0, 0x41400000);
|
||||
func_800E1374(a1, &s0->unk328, (z_Actor*)s0, &D_801ADE80);
|
||||
func_800E7DF8((z_Actor*)s0, &s0->unk328);
|
||||
s0->unk182 = 255;
|
||||
s0->unk324 = func_800A5B98;
|
||||
func_800B3BA4(&s0->unkBC, 0, (void*)&func_800B3FC0, 0x41400000);
|
||||
func_800E1374(a1, &s0->unk148, (z_Actor*)s0, &D_801ADE80);
|
||||
func_800E7DF8((z_Actor*)s0, &s0->unk148);
|
||||
s0->unkB6 = 255;
|
||||
s0->unk144 = func_800A5B98;
|
||||
}
|
||||
|
||||
UNK_RET func_800A5B6C(struct s800A5AC0* a0, z_GlobalContext* a1) {
|
||||
UNK_TYPE* a2 = &a0->unk328;
|
||||
UNK_RET func_800A5B6C(s800A5AC0* a0, z_GlobalContext* a1) {
|
||||
UNK_TYPE* a2 = &a0->unk148;
|
||||
func_800E11EC(a1, a2);
|
||||
}
|
||||
|
||||
UNK_RET func_800A5B98(struct s800A5AC0* a0, UNK_TYPE a1) {
|
||||
UNK_RET func_800A5B98(s800A5AC0* a0, UNK_TYPE a1) {
|
||||
s16 v0;
|
||||
s32 v1;
|
||||
if (func_800B84D0(a0, a1) != 0) {
|
||||
a0->unk324 = (void(*)(struct s800A5AC0*, UNK_TYPE))func_800A5C28; //! Is this cast correct?
|
||||
a0->unk144 = (void(*)(s800A5AC0*, UNK_TYPE))func_800A5C28; //! Is this cast correct?
|
||||
} else {
|
||||
v0 = a0->unk146 - a0->unk190;
|
||||
v0 = a0->unk92 - a0->unkBE;
|
||||
v1 = (v0 < 0)? -v0 : v0;
|
||||
if ((v1 < 10240) || ((a0->unk28 == 1) && (v1 > 22528))) {
|
||||
if ((v1 < 10240) || ((a0->unk1C == 1) && (v1 > 22528))) {
|
||||
func_800B863C(a0, a1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UNK_RET func_800A5C28(struct s800A5AC0* a0) {
|
||||
UNK_RET func_800A5C28(s800A5AC0* a0) {
|
||||
if (func_800B867C(a0) != 0) {
|
||||
a0->unk324 = func_800A5B98;
|
||||
a0->unk144 = func_800A5B98;
|
||||
}
|
||||
}
|
||||
|
||||
UNK_RET func_800A5C60(struct s800A5AC0* a0, UNK_TYPE a1) {
|
||||
(a0->unk324)(a0, a1);
|
||||
UNK_RET func_800A5C60(s800A5AC0* a0, UNK_TYPE a1) {
|
||||
(a0->unk144)(a0, a1);
|
||||
func_800B675C(a0, 0x42340000);
|
||||
func_800E2928(a1, a1 + 0x18884, &a0->unk328);
|
||||
func_800E2928(a1, a1 + 0x18884, &a0->unk148);
|
||||
}
|
||||
|
||||
UNK_RET func_800A5CB8(struct s800A5AC0* a0, UNK_TYPE a1) {
|
||||
func_800BDFC0(a1, D_801ADEB0[a0->unk28], a1, a0);
|
||||
UNK_RET func_800A5CB8(s800A5AC0* a0, UNK_TYPE a1) {
|
||||
func_800BDFC0(a1, D_801ADEB0[a0->unk1C], a1, a0);
|
||||
}
|
||||
|
||||
+10
-10
@@ -3,7 +3,7 @@
|
||||
|
||||
UNK_RET func_800BF9A0(UNK_TYPE a0, UNK_TYPE a1) {
|
||||
s32 i;
|
||||
s800BF9A0_s* s0;
|
||||
s800BF9A0* s0;
|
||||
UNK_TYPE v1;
|
||||
|
||||
func_8008439C(-2, 0);
|
||||
@@ -11,27 +11,27 @@ UNK_RET func_800BF9A0(UNK_TYPE a0, UNK_TYPE a1) {
|
||||
func_800847CC(&D_801DCBC4);
|
||||
|
||||
for (i = 0, s0 = &D_801AEFD0; i < D_801B4610; i++, s0++) {
|
||||
v1 = s0->unk12 - s0->unk8;
|
||||
if (s0->unk16 == 0) continue;
|
||||
func_800847CC(&D_801DCBE4, i, s0->unk16, s0->unk16 + v1, s0->unk30, &D_801DCBFC);
|
||||
v1 = s0->unkC - s0->unk8;
|
||||
if (s0->unk10 == 0) continue;
|
||||
func_800847CC(&D_801DCBE4, i, s0->unk10, s0->unk10 + v1, s0->unk1E, &D_801DCBFC);
|
||||
}
|
||||
}
|
||||
|
||||
UNK_TYPE func_800BFA78(UNK_TYPE a0, UNK_TYPE a1) {
|
||||
s32 i;
|
||||
s800BF9A0_s* v0 = &D_801AEFD0;
|
||||
s800BF9A0* v0 = &D_801AEFD0;
|
||||
UNK_TYPE t1;
|
||||
UNK_TYPE a2;
|
||||
UNK_TYPE a0_2 = a0;
|
||||
|
||||
for (i = 0; i < D_801B4610; i++, v0++) {
|
||||
t1 = v0->unk8 - v0->unk16;
|
||||
a2 = v0->unk12 - v0->unk8;
|
||||
t1 = v0->unk8 - v0->unk10;
|
||||
a2 = v0->unkC - v0->unk8;
|
||||
|
||||
if (v0->unk16 == 0) continue;
|
||||
if (a0_2 < v0->unk16) continue;
|
||||
if (v0->unk10 == 0) continue;
|
||||
if (a0_2 < v0->unk10) continue;
|
||||
|
||||
if (a0_2 < (v0->unk16 + a2)) {
|
||||
if (a0_2 < (v0->unk10 + a2)) {
|
||||
return a0_2 + t1;
|
||||
}
|
||||
}
|
||||
|
||||
+52
-52
@@ -2,98 +2,98 @@
|
||||
#include <global.h>
|
||||
|
||||
UNK_RET func_800CAAD0(UNK_TYPE a0, UNK_TYPE a1, UNK_TYPE a2) {
|
||||
UNK_TYPE sp208;
|
||||
UNK_TYPE sp144;
|
||||
UNK_TYPE sp80;
|
||||
UNK_TYPE sp68;
|
||||
UNK_TYPE sp56;
|
||||
UNK_TYPE sp36;
|
||||
|
||||
UNK_TYPE spD0;
|
||||
UNK_TYPE sp90;
|
||||
UNK_TYPE sp50;
|
||||
UNK_TYPE sp44;
|
||||
UNK_TYPE sp38;
|
||||
UNK_TYPE sp24;
|
||||
|
||||
s800CAAD0* v1;
|
||||
|
||||
|
||||
if (func_800C6024(a1) == 0) return;
|
||||
|
||||
|
||||
v1 = (s800CAAD0*)(a0 + a1 * 100);
|
||||
|
||||
func_80139894(&sp208, v1->unk104, v1->unk108, v1->unk112, v1->unk116, v1->unk118,
|
||||
v1->unk120, v1->unk124, v1->unk128, v1->unk132);
|
||||
|
||||
if (func_80139188(&sp208, &sp144) == 2) return;
|
||||
|
||||
func_80139894(&sp80, v1->unk136, v1->unk140, v1->unk144, v1->unk148, v1->unk150,
|
||||
v1->unk152, v1->unk156, v1->unk160, v1->unk164);
|
||||
|
||||
func_80138C88(&sp144, (UNK_PTR)(a2 + 36), &sp36);
|
||||
func_80138C88(&sp80, &sp56, &sp68);
|
||||
|
||||
v1->unk0 = *(UNK_TYPE*)((u8*)sp36 + 0);
|
||||
v1->unk4 = *(UNK_TYPE*)((u8*)sp36 + 4);
|
||||
v1->unk8 = *(UNK_TYPE*)((u8*)sp36 + 8);
|
||||
|
||||
func_80139894(&spD0, v1->unk68, v1->unk6C, v1->unk70, v1->unk72, v1->unk74,
|
||||
v1->unk76, v1->unk7C, v1->unk80, v1->unk84);
|
||||
|
||||
if (func_80139188(&spD0, &sp90) == 2) return;
|
||||
|
||||
func_80139894(&sp50, v1->unk88, v1->unk8C, v1->unk90, v1->unk94, v1->unk96,
|
||||
v1->unk98, v1->unk9C, v1->unkA0, v1->unkA4);
|
||||
|
||||
func_80138C88(&sp90, (UNK_PTR)(a2 + 36), &sp24);
|
||||
func_80138C88(&sp50, &sp38, &sp44);
|
||||
|
||||
v1->unk0 = *(UNK_TYPE*)((u8*)sp24 + 0);
|
||||
v1->unk4 = *(UNK_TYPE*)((u8*)sp24 + 4);
|
||||
v1->unk8 = *(UNK_TYPE*)((u8*)sp24 + 8);
|
||||
}
|
||||
|
||||
UNK_RET func_800CAC0C(UNK_TYPE a0, UNK_TYPE a1, UNK_TYPE a2) {
|
||||
UNK_TYPE v0;
|
||||
s16 v1;
|
||||
|
||||
|
||||
if (func_800C6024(a0) == 0) return;
|
||||
|
||||
|
||||
v0 = a0 + a1 * 100;
|
||||
|
||||
|
||||
v1 = *(s16*)(v0 + 150) - *(s16*)(v0 + 118);
|
||||
|
||||
|
||||
if (*(s16*)a2 == 0) {
|
||||
*(s16*)(a2 + 2772) += v1;
|
||||
}
|
||||
|
||||
|
||||
*(s16*)(a2 + 190) += v1;
|
||||
*(s16*)(a2 + 50) += v1;
|
||||
}
|
||||
|
||||
UNK_RET func_800CACA0(UNK_TYPE a0, UNK_TYPE a1, UNK_TYPE a2) {
|
||||
UNK_TYPE sp28;
|
||||
|
||||
UNK_TYPE sp1C;
|
||||
|
||||
if (func_800C6024(a2) == 0) return;
|
||||
|
||||
sp28 = func_800C6248(a0, a2);
|
||||
|
||||
if (sp28 == 0) return;
|
||||
|
||||
func_800CAE88(sp28);
|
||||
|
||||
|
||||
sp1C = func_800C6248(a0, a2);
|
||||
|
||||
if (sp1C == 0) return;
|
||||
|
||||
func_800CAE88(sp1C);
|
||||
|
||||
if ((*(u32*)(a1 + 4) & 0x04000000) == 0x0400) {
|
||||
func_800CAF24(sp28);
|
||||
func_800CAF24(sp1C);
|
||||
}
|
||||
|
||||
|
||||
if ((*(u32*)(a1 + 4) & 0x20000) == 0x20000) {
|
||||
func_800CAF38(sp28);
|
||||
func_800CAF38(sp1C);
|
||||
}
|
||||
}
|
||||
|
||||
UNK_TYPE func_800CAD2C(UNK_TYPE a0, UNK_TYPE a1, UNK_TYPE a2) {
|
||||
UNK_TYPE v1;
|
||||
UNK_TYPE sp36 = 0;
|
||||
|
||||
UNK_TYPE sp24 = 0;
|
||||
|
||||
if (func_800C6024(a1) == 0) return;
|
||||
|
||||
if (((*(u16*)(a0 + a1*2 + 5084) & 0x2) != 0) ||
|
||||
|
||||
if (((*(u16*)(a0 + a1*2 + 5084) & 0x2) != 0) ||
|
||||
((*(u16*)(a0 + a1*2 + 5084) & 0x1) == 0)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
v1 = func_800C6248(a0, a1);
|
||||
if (v1 == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if ((*(u32*)(v1 + 340) & 0x1) != 0) {
|
||||
func_800CAAD0(a0, a1, a2);
|
||||
sp36 = 1;
|
||||
sp24 = 1;
|
||||
}
|
||||
|
||||
|
||||
if ((*(u32*)(v1 + 340) & 0x2) != 0) {
|
||||
func_800CAC0C(a0, a1, a2);
|
||||
sp36 = 1;
|
||||
sp24 = 1;
|
||||
}
|
||||
|
||||
return sp36;
|
||||
|
||||
return sp24;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ void func_800F4F40(UNK_TYPE a0, UNK_TYPE a1, UNK_TYPE a2) {
|
||||
}
|
||||
|
||||
void func_800F4F54(s800F4F54* a0, u8 a1, UNK_TYPE a2) {
|
||||
u32 arg0 = (u32)a0 + a0->unk92152 * (15 * 1024) + a2 + 19056;
|
||||
u32 arg0 = (u32)a0 + a0->unk167F8 * (15 * 1024) + a2 + 19056;
|
||||
u32 arg1 = ((a1 * 128) - 4096) + (u32)&D_00ACC000;
|
||||
func_80080C90(arg0, arg1, 128);
|
||||
}
|
||||
|
||||
@@ -2,59 +2,59 @@
|
||||
#define _CONTROLLER_H_
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u32 ramarray[15];
|
||||
/* 60 */ u32 pifstatus;
|
||||
/* 0x00 */ u32 ramarray[15];
|
||||
/* 0x3C */ u32 pifstatus;
|
||||
} OSPifRam;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u8 dummy;
|
||||
/* 1 */ u8 txsize;
|
||||
/* 2 */ u8 rxsize;
|
||||
/* 3 */ u8 cmd;
|
||||
/* 4 */ u16 button;
|
||||
/* 6 */ s8 stick_x;
|
||||
/* 7 */ s8 stick_y;
|
||||
/* 0x0 */ u8 dummy;
|
||||
/* 0x1 */ u8 txsize;
|
||||
/* 0x2 */ u8 rxsize;
|
||||
/* 0x3 */ u8 cmd;
|
||||
/* 0x4 */ u16 button;
|
||||
/* 0x6 */ s8 stick_x;
|
||||
/* 0x7 */ s8 stick_y;
|
||||
} __OSContReadFormat;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u8 dummy;
|
||||
/* 1 */ u8 txsize;
|
||||
/* 2 */ u8 rxsize;
|
||||
/* 3 */ u8 cmd;
|
||||
/* 4 */ u8 typeh;
|
||||
/* 5 */ u8 typel;
|
||||
/* 6 */ u8 status;
|
||||
/* 7 */ u8 dummy1;
|
||||
/* 0x0 */ u8 dummy;
|
||||
/* 0x1 */ u8 txsize;
|
||||
/* 0x2 */ u8 rxsize;
|
||||
/* 0x3 */ u8 cmd;
|
||||
/* 0x4 */ u8 typeh;
|
||||
/* 0x5 */ u8 typel;
|
||||
/* 0x6 */ u8 status;
|
||||
/* 0x7 */ u8 dummy1;
|
||||
} __OSContRequesFormat;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u8 dummy;
|
||||
/* 1 */ u8 txsize;
|
||||
/* 2 */ u8 rxsize;
|
||||
/* 3 */ u8 cmd;
|
||||
/* 4 */ u16 address;
|
||||
/* 6 */ u8 data[32];
|
||||
/* 38 */ u8 datacrc;
|
||||
/* 0x00 */ u8 dummy;
|
||||
/* 0x01 */ u8 txsize;
|
||||
/* 0x02 */ u8 rxsize;
|
||||
/* 0x03 */ u8 cmd;
|
||||
/* 0x04 */ u16 address;
|
||||
/* 0x06 */ u8 data[32];
|
||||
/* 0x26 */ u8 datacrc;
|
||||
} __OSContRamReadFormat;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u16 company_code;
|
||||
/* 2 */ u16 game_code;
|
||||
/* 4 */ u8 start_page;
|
||||
/* 5 */ u8 status;
|
||||
/* 6 */ u16 data_sum;
|
||||
/* 8 */ unsigned char ext_name[4];
|
||||
/* 12 */ unsigned char game_name[16];
|
||||
/* 28 */ s32 reserved;
|
||||
/* 0x00 */ u16 company_code;
|
||||
/* 0x02 */ u16 game_code;
|
||||
/* 0x04 */ u8 start_page;
|
||||
/* 0x05 */ u8 status;
|
||||
/* 0x06 */ u16 data_sum;
|
||||
/* 0x08 */ unsigned char ext_name[4];
|
||||
/* 0x0C */ unsigned char game_name[16];
|
||||
/* 0x1C */ s32 reserved;
|
||||
} __OSDir;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u8 inode_page[256];
|
||||
/* 0x0 */ u8 inode_page[256];
|
||||
} __OSInode;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,10 +30,10 @@ void osInitialize(void) {
|
||||
while (__osSiRawReadIo(0x1FC007FC, &pifdata) != 0);
|
||||
while (__osSiRawWriteIo(0x1FC007FC, pifdata | 8) != 0);
|
||||
|
||||
*(struct s8008A6FC*)0x80000000 = *((struct s8008A6FC*)__osExceptionPreamble);
|
||||
*(struct s8008A6FC*)0x80000080 = *((struct s8008A6FC*)__osExceptionPreamble);
|
||||
*(struct s8008A6FC*)0x80000100 = *((struct s8008A6FC*)__osExceptionPreamble);
|
||||
*(struct s8008A6FC*)0x80000180 = *((struct s8008A6FC*)__osExceptionPreamble);
|
||||
*(s8008A6FC*)0x80000000 = *((s8008A6FC*)__osExceptionPreamble);
|
||||
*(s8008A6FC*)0x80000080 = *((s8008A6FC*)__osExceptionPreamble);
|
||||
*(s8008A6FC*)0x80000100 = *((s8008A6FC*)__osExceptionPreamble);
|
||||
*(s8008A6FC*)0x80000180 = *((s8008A6FC*)__osExceptionPreamble);
|
||||
|
||||
osWritebackDCache((void*)0x80000000, 400);
|
||||
osInvalICache((void*)0x80000000, 400);
|
||||
|
||||
Reference in New Issue
Block a user