mirror of
https://github.com/n64decomp/mk64
synced 2026-08-04 00:49:03 -04:00
Update the GfxPool struct and match some functions (#134)
* Update the GfxPool struct and match some functions Also reordered variables.h a bit * Match 2 more functions * Replace reaming ->buffer references with ->mtxPool Update the mips_to_c output of a couple functions based on new GfxPool definition Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
+138
-30
@@ -1,6 +1,9 @@
|
||||
#include <ultra64.h>
|
||||
#include <macros.h>
|
||||
#include <common_structs.h>
|
||||
#include "code_80040E50.h"
|
||||
#include "main.h"
|
||||
#include "variables.h"
|
||||
|
||||
//#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
@@ -696,59 +699,164 @@ GLOBAL_ASM("asm/non_matchings/code_80040E50/func_80041D24.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
//generated by mips_to_c commit 5bd751fca3befef73d6a2e20d84a88cc918a77fe
|
||||
void guOrtho(Mtx *, f32, f32, f32, f32, f32, f32, f32); /* extern */
|
||||
extern s32 D_800DC52C;
|
||||
extern s8 D_801658FE;
|
||||
extern Mtx D_80183D60;
|
||||
|
||||
void func_80041D34(void) {
|
||||
s32 temp_v0;
|
||||
|
||||
guOrtho(&D_80183D60, 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f);
|
||||
temp_v0 = D_800DC52C;
|
||||
if (temp_v0 != 0) {
|
||||
if (temp_v0 != 1) {
|
||||
if (temp_v0 != 2) {
|
||||
if (temp_v0 != 3) {
|
||||
return;
|
||||
}
|
||||
guOrtho(&gGfxPool->buffer[40], 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f);
|
||||
return;
|
||||
}
|
||||
guOrtho(&gGfxPool->buffer[40], 0.0f, 160.0f, 120.0f, 0.0f, -1.0f, 1.0f, 1.0f);
|
||||
return;
|
||||
}
|
||||
switch (D_800DC52C) { /* irregular */
|
||||
case 0:
|
||||
guOrtho(&gGfxPool->mtxPool[5], 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f);
|
||||
break;
|
||||
case 2:
|
||||
guOrtho(&gGfxPool->mtxPool[5], 0.0f, 160.0f, 120.0f, 0.0f, -1.0f, 1.0f, 1.0f);
|
||||
break;
|
||||
case 1:
|
||||
if (D_801658FE == 0) {
|
||||
guOrtho(&gGfxPool->buffer[40], 0.0f, 320.0f, 120.0f, 0.0f, -1.0f, 1.0f, 1.0f);
|
||||
return;
|
||||
guOrtho(&gGfxPool->mtxPool[5], 0.0f, 320.0f, 120.0f, 0.0f, -1.0f, 1.0f, 1.0f);
|
||||
break;
|
||||
}
|
||||
guOrtho(&gGfxPool->buffer[40], 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f);
|
||||
return;
|
||||
guOrtho(&gGfxPool->mtxPool[5], 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f);
|
||||
break;
|
||||
case 3:
|
||||
guOrtho(&gGfxPool->mtxPool[5], 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f);
|
||||
break;
|
||||
}
|
||||
guOrtho(&gGfxPool->buffer[40], 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80040E50/func_80041D34.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
extern void *gDisplayListHead;
|
||||
|
||||
void func_80041EF4(void) {
|
||||
gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP);
|
||||
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[5]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
? func_80022180(s32, ? *, s32 *); /* extern */
|
||||
? func_80041A78(? *, s32, ?); /* extern */
|
||||
extern s32 D_8018D120;
|
||||
extern void *gDisplayListHead;
|
||||
extern s32 gGfxPool;
|
||||
|
||||
UNUSED void func_80041F54(s32 arg0, ? arg1) {
|
||||
? sp20;
|
||||
void *temp_v1;
|
||||
|
||||
func_80041A78(&sp20, arg0, arg1);
|
||||
func_80022180(gGfxPool + (D_8018D120 << 6) + 0x2C0, &sp20, &D_8018D120);
|
||||
temp_v1 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v1 + 8;
|
||||
temp_v1->unk0 = 0x01020040;
|
||||
temp_v1->unk4 = (s32) ((gGfxPool + (D_8018D120 << 6) + 0x2C0) & 0x1FFFFFFF);
|
||||
D_8018D120 += 1;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80040E50/func_80041F54.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
? func_80022180(s32, ? *, s32 *); /* extern */
|
||||
? func_80041AD8(? *, s32); /* extern */
|
||||
extern s32 D_8018D120;
|
||||
extern void *gDisplayListHead;
|
||||
extern s32 gGfxPool;
|
||||
|
||||
UNUSED void func_80042000(s32 arg0) {
|
||||
? sp20;
|
||||
void *temp_v1;
|
||||
|
||||
func_80041AD8(&sp20, arg0 & 0xFFFF);
|
||||
func_80022180(gGfxPool + (D_8018D120 << 6) + 0x2C0, &sp20, &D_8018D120);
|
||||
temp_v1 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v1 + 8;
|
||||
temp_v1->unk0 = 0x01020040;
|
||||
temp_v1->unk4 = (s32) ((gGfxPool + (D_8018D120 << 6) + 0x2C0) & 0x1FFFFFFF);
|
||||
D_8018D120 += 1;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80040E50/func_80042000.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
? func_80022180(s32, ? *, s32 *); /* extern */
|
||||
? func_80041B68(? *, f32); /* extern */
|
||||
extern s32 D_8018D120;
|
||||
extern void *gDisplayListHead;
|
||||
extern s32 gGfxPool;
|
||||
|
||||
UNUSED void func_800420A8(f32 arg0) {
|
||||
? sp20;
|
||||
void *temp_v1;
|
||||
|
||||
func_80041B68(&sp20, arg0);
|
||||
func_80022180(gGfxPool + (D_8018D120 << 6) + 0x2C0, &sp20, &D_8018D120);
|
||||
temp_v1 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v1 + 8;
|
||||
temp_v1->unk0 = 0x01020040;
|
||||
temp_v1->unk4 = (s32) ((gGfxPool + (D_8018D120 << 6) + 0x2C0) & 0x1FFFFFFF);
|
||||
D_8018D120 += 1;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80040E50/func_800420A8.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
? func_80022180(s32, ? *, s32 *); /* extern */
|
||||
? func_80041BBC(?, ? *, u16, ?); /* extern */
|
||||
extern s32 D_8018D120;
|
||||
extern void *gDisplayListHead;
|
||||
extern s32 gGfxPool;
|
||||
|
||||
UNUSED void func_8004214C(u16 arg0, ? arg1) {
|
||||
? sp20;
|
||||
void *temp_v1;
|
||||
|
||||
func_80041BBC(arg1, &sp20, arg0, arg1);
|
||||
func_80022180(gGfxPool + (D_8018D120 << 6) + 0x2C0, &sp20, &D_8018D120);
|
||||
temp_v1 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v1 + 8;
|
||||
temp_v1->unk0 = 0x01020040;
|
||||
temp_v1->unk4 = (s32) ((gGfxPool + (D_8018D120 << 6) + 0x2C0) & 0x1FFFFFFF);
|
||||
D_8018D120 += 1;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80040E50/func_8004214C.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
? func_80022180(s32, ? *); /* extern */
|
||||
? func_80041A78(? *, s32, s32); /* extern */
|
||||
? func_80041B68(? *, s32, void **); /* extern */
|
||||
extern s32 D_8018D120;
|
||||
extern void *gDisplayListHead;
|
||||
extern s32 gGfxPool;
|
||||
|
||||
UNUSED void func_800421FC(s32 arg0, s32 arg1, s32 arg2) {
|
||||
? sp30;
|
||||
void *temp_v1;
|
||||
void *temp_v1_2;
|
||||
|
||||
func_80041A78(&sp30, arg0, arg1);
|
||||
func_80022180(gGfxPool + (D_8018D120 << 6) + 0x2C0, &sp30);
|
||||
temp_v1 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v1 + 8;
|
||||
temp_v1->unk4 = 0x80000;
|
||||
temp_v1->unk0 = 0xBA001301;
|
||||
temp_v1->unk0 = 0x01020040;
|
||||
temp_v1->unk4 = (s32) ((gGfxPool + (D_8018D120 << 6) + 0x2C0) & 0x1FFFFFFF);
|
||||
D_8018D120 += 1;
|
||||
func_80041B68(&sp30, arg2, &gDisplayListHead);
|
||||
func_80022180(gGfxPool + (D_8018D120 << 6) + 0x2C0, &sp30);
|
||||
temp_v1_2 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v1_2 + 8;
|
||||
temp_v1_2->unk0 = 0x1030040;
|
||||
temp_v1_2->unk4 = &gGfxPool->buffer[40] & 0x1FFFFFFF;
|
||||
temp_v1_2->unk0 = 0x01000040;
|
||||
temp_v1_2->unk4 = (s32) ((gGfxPool + (D_8018D120 << 6) + 0x2C0) & 0x1FFFFFFF);
|
||||
D_8018D120 += 1;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80040E50/func_80041EF4.s")
|
||||
GLOBAL_ASM("asm/non_matchings/code_80040E50/func_800421FC.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
|
||||
Reference in New Issue
Block a user