core2/gczoombox.c done

This commit is contained in:
Banjo Kazooie
2022-07-17 19:13:20 -05:00
parent dd13d34074
commit 1c4efad6d3
8 changed files with 148 additions and 97 deletions

View File

@@ -9,7 +9,7 @@
</mask> </mask>
<g mask="url(#anybadge_1)"> <g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h44v20H0z"/> <path fill="#555" d="M0 0h44v20H0z"/>
<path fill="#87e000" d="M44 0h67v20H44z"/> <path fill="#85e000" d="M44 0h67v20H44z"/>
<path fill="url(#b)" d="M0 0h111v20H0z"/> <path fill="url(#b)" d="M0 0h111v20H0z"/>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
@@ -17,7 +17,7 @@
<text x="22.0" y="14">core1</text> <text x="22.0" y="14">core1</text>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="78.5" y="15" fill="#010101" fill-opacity=".3">69.9776%</text> <text x="78.5" y="15" fill="#010101" fill-opacity=".3">70.3700%</text>
<text x="77.5" y="14">69.9776%</text> <text x="77.5" y="14">70.3700%</text>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -9,7 +9,7 @@
</mask> </mask>
<g mask="url(#anybadge_1)"> <g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h44v20H0z"/> <path fill="#555" d="M0 0h44v20H0z"/>
<path fill="#78e000" d="M44 0h67v20H44z"/> <path fill="#76e000" d="M44 0h67v20H44z"/>
<path fill="url(#b)" d="M0 0h111v20H0z"/> <path fill="url(#b)" d="M0 0h111v20H0z"/>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
@@ -17,7 +17,7 @@
<text x="22.0" y="14">core2</text> <text x="22.0" y="14">core2</text>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="78.5" y="15" fill="#010101" fill-opacity=".3">73.1304%</text> <text x="78.5" y="15" fill="#010101" fill-opacity=".3">73.6289%</text>
<text x="77.5" y="14">73.1304%</text> <text x="77.5" y="14">73.6289%</text>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -9,7 +9,7 @@
</mask> </mask>
<g mask="url(#anybadge_1)"> <g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h150v20H0z"/> <path fill="#555" d="M0 0h150v20H0z"/>
<path fill="#5de000" d="M150 0h67v20H150z"/> <path fill="#5ce000" d="M150 0h67v20H150z"/>
<path fill="url(#b)" d="M0 0h217v20H0z"/> <path fill="url(#b)" d="M0 0h217v20H0z"/>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
@@ -17,7 +17,7 @@
<text x="75.0" y="14">Banjo-Kazooie (us.v10)</text> <text x="75.0" y="14">Banjo-Kazooie (us.v10)</text>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="184.5" y="15" fill="#010101" fill-opacity=".3">79.1959%</text> <text x="184.5" y="15" fill="#010101" fill-opacity=".3">79.5388%</text>
<text x="183.5" y="14">79.1959%</text> <text x="183.5" y="14">79.5388%</text>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -217,8 +217,8 @@ void func_80246C2C(void){
#ifndef NONMATCHING //MATCHES but requires .data defined for local static variable #ifndef NONMATCHING //MATCHES but requires .data defined for local static variable
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_8C50/func_80246D78.s") #pragma GLOBAL_ASM("asm/nonmatchings/core1/code_8C50/func_80246D78.s")
#else #else
static s32 D_802759A4;
void func_80246D78(void){ void func_80246D78(void){
static s32 D_802759A4;
s32 sp2C = (D_8027FC0C != 0) && (D_8028062C == D_80280628) && (D_8027FC18 == 2) && (D_8027FC1C == 0x10); s32 sp2C = (D_8027FC0C != 0) && (D_8028062C == D_80280628) && (D_8027FC18 == 2) && (D_8027FC1C == 0x10);
volatile s32 sp30; volatile s32 sp30;

View File

@@ -2,8 +2,13 @@
#include "functions.h" #include "functions.h"
#include "variables.h" #include "variables.h"
void func_8024A840(s32 arg0, s32 arg1, s32 arg2); void func_8024A3C8(s32 x, s32 y);
void func_8024A85C(s32 arg0); void func_8024A840(s32 r, s32 g, s32 b);
void func_8024A85C(s32 buffer_indx);
extern s32 D_80276588; //framebuffer width
extern s16 D_803A5D00[2][0xF660]; //framebuffer
extern s16 D_80275BBC; extern s16 D_80275BBC;
@@ -143,29 +148,114 @@ s32 func_802485BC(void){
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80249F34.s") #pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80249F34.s")
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_8024A284.s") //fill framebuffer with vert and horz lines
void func_8024A284(s32 x, s32 y, s32 arg2, s32 arg3, s32 horz_spacing, s32 vert_spacing) {
s32 var_s2;
s32 var_s3;
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_8024A3C8.s") for(var_s2 = 0; var_s2 < D_80276588; var_s2 += horz_spacing){
for(var_s3 = 0; var_s3 < D_8027658C; var_s3++){
func_8024A3C8(x + var_s2, y + var_s3);
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_8024A490.s") }
}
for(var_s3 = 0; var_s3 < D_8027658C; var_s3 += vert_spacing) {
for(var_s2 = 0; var_s2 < D_80276588; var_s2++){
func_8024A3C8(x + var_s2, y + var_s3);
}
}
}
//fills in pixel in frame buffer with D_802806E0 color
void func_8024A3C8(s32 x, s32 y) {
s32 temp_v0;
if (x >= 0) {
if ((x < D_80276588) && (y >= 0) && (y < D_8027658C)) {
D_803A5D00[D_802806EC][x + y * D_80276588] = _SHIFTL(D_802806E0 >> 3, 11, 5) | _SHIFTL(D_802806E4 >> 3, 6, 5) | _SHIFTL(D_802806E8 >> 3, 1, 5) | _SHIFTL(1, 0, 1);
}
}
}
//draw rectangular outline
void func_8024A490(s32 x, s32 y, s32 w, s32 h) {
s32 var_s1;
for(var_s1 = 0; var_s1 < w; var_s1++){
func_8024A3C8(x + var_s1, y);
func_8024A3C8(x + var_s1, y + h - 1);
}
for(var_s1 = 1; var_s1 < h - 1; var_s1++){
func_8024A3C8(x, y + var_s1);
func_8024A3C8(x + w - 1, y + var_s1);
}
}
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_8024A564.s") #pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_8024A564.s")
#else
void func_8024A564(s32 x, s32 y, u16 *arg2, s32 arg3, s32 arg4, f32 arg5, f32 arg6) {
s32 temp_a2;
s32 temp_a2_2;
s32 temp_a2_3;
s32 temp_f6;
s32 temp_f6_2;
s32 temp_lo;
s32 temp_t5;
s32 var_a0;
s32 var_a2;
s32 var_t1;
s32 var_t3;
s32 var_v0;
s32 var_v1;
u16 temp_t8;
s16 *var_t0;
s16 *var_t2;
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_8024A770.s") var_v0 = 0;
var_v1 = D_80276588;
var_t0 = &D_803A5D00[D_802806EC][x + y * D_80276588];
for( var_t1 = (arg4 * arg6) + 0.5; var_t1 != 0; var_t1--){
var_a2 = ((var_v0 >> 8) * arg3) << 8;
var_t2 = var_t0;
var_v0 += (s32) ((f64) (256.0f / arg6) + 0.5);
for(var_t3 = (arg3 * arg5) + 0.5; var_t3 != 0; var_t3--){
*var_t2 = arg2[var_a2 >> 8];
var_a2 += (s32) ((f64) (256.0f / arg5) + 0.5);
var_t2++;
}
var_t0 += D_80276588;
}
}
#endif
//fills in rectangle in frame buffer with D_802806E0 color
void func_8024A770(s32 x, s32 y, s32 w, s32 h) {
s32 var_s0;
s32 var_s1;
s32 var_s4;
var_s4 = 0;
for(var_s4 = 0; var_s4 < w; var_s4++) {
for(var_s0 = 0; var_s0 < h; var_s0++){
func_8024A3C8(x + var_s4, y + var_s0);
}
}
}
void func_8024A810(void){ void func_8024A810(void){
func_8024A840(0, 0x80, 0); func_8024A840(0, 0x80, 0);
func_8024A85C(0); func_8024A85C(0);
} }
void func_8024A840(s32 arg0, s32 arg1, s32 arg2){ void func_8024A840(s32 r, s32 g, s32 b){
D_802806E0 = arg0; D_802806E0 = r;
D_802806E4 = arg1; D_802806E4 = g;
D_802806E8 = arg2; D_802806E8 = b;
} }
void func_8024A85C(s32 arg0){ void func_8024A85C(s32 buffer_indx){
D_802806EC = arg0; D_802806EC = buffer_indx;
} }
s32 func_8024A868(void){ s32 func_8024A868(void){

View File

@@ -46,7 +46,7 @@ typedef struct map_savestate_s{
extern MapSavestate *D_8037E650[]; extern MapSavestate *D_8037E650[];
void func_802E3BD0(s32 arg0); void func_802E3BD0(s32 frame_buffer_indx);
int func_802E49F0(void); int func_802E49F0(void);
/* .code */ /* .code */
@@ -268,8 +268,8 @@ void func_802E39D0(Gfx **gdl, Mtx **mptr, Vtx **vptr, s32 arg3, s32 arg4){
osWritebackDCache(v_start, sizeof(Vtx)*( *vptr - v_start)); osWritebackDCache(v_start, sizeof(Vtx)*( *vptr - v_start));
} }
void func_802E3BD0(s32 arg0){ void func_802E3BD0(s32 frame_buffer_indx){
func_8024A85C(arg0); func_8024A85C(frame_buffer_indx);
} }
void func_802E3BF0(void){ void func_802E3BF0(void){

View File

@@ -578,8 +578,7 @@ void func_80316764(gczoombox_t *this, s32 arg1) {
if (this->unk186 > 0) { if (this->unk186 > 0) {
this->unk186--; this->unk186--;
} else { } else {
// if (randf() < 0.01) { /* USE ONCE .RODATA DEFINED */ if (randf() < 0.01) {
if (randf() < D_803788F0) {
this->unk1A4_22 = TRUE; this->unk1A4_22 = TRUE;
this->unk186 = this->unk188 - 4; this->unk186 = this->unk188 - 4;
} }
@@ -670,9 +669,6 @@ s32 func_80316ED4(u8 *arg0){
return strlen(arg0); return strlen(arg0);
} }
#ifndef NONMATCHING //matches requires .rodata which requires gczoombox_new() matching
#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/zoombox/func_80316EF4.s")
#else
void func_80316EF4(gczoombox_t *this){ void func_80316EF4(gczoombox_t *this){
s32 sp58[6]; s32 sp58[6];
s32 sp4C[3]; s32 sp4C[3];
@@ -956,7 +952,6 @@ void func_80316EF4(gczoombox_t *this){
break; break;
} }
} }
#endif
//_gczoombox_loadSprite //_gczoombox_loadSprite
void func_80317C90(gczoombox_t *this, s32 portrait_id){ void func_80317C90(gczoombox_t *this, s32 portrait_id){
@@ -998,11 +993,10 @@ void func_80317D10(gczoombox_t *this, s32 portrait_id){
} }
} }
#ifdef NONMATCHING
gczoombox_t *gczoombox_new(s32 arg0, s32 portrait_id, s32 arg2, s32 arg3, void (*arg4)(s32, s32)){ gczoombox_t *gczoombox_new(s32 arg0, s32 portrait_id, s32 arg2, s32 arg3, void (*arg4)(s32, s32)){
gczoombox_t *this; gczoombox_t *this;
s32 i; s32 i;
s32 temp_v1_2; s32 temp_v1;
this = (gczoombox_t *)malloc(sizeof(gczoombox_t)); this = (gczoombox_t *)malloc(sizeof(gczoombox_t));
this->unk130 = arg4; this->unk130 = arg4;
@@ -1032,43 +1026,26 @@ gczoombox_t *gczoombox_new(s32 arg0, s32 portrait_id, s32 arg2, s32 arg3, void (
this->unk174 = 0x25; this->unk174 = 0x25;
this->unk170 = -0x66; this->unk170 = -0x66;
} }
this->unk18A = 0;
this->unk189 = 0;
this->unk187 = 0;
this->unk186 = 0;
this->unk185 = 0;
this->unk181 = 0;
this->unk180 = 0;
this->unk172 = this->unk164; this->unk172 = this->unk164;
this->unk181 =\
this->unk185 =\
this->unk186 =\
this->unk187 =\
this->unk189 =\
this->unk18A = 0;
this->unk180 = 0;
this->unk18C = 0.0f; this->unk18C = 0.0f;
this->unk194 = 0.999f; this->unk194 = 0.999f;
// this->unk194 = D_80378938;
this->unk198 = 1.0f; this->unk198 = 1.0f;
this->unk19C = 0.0f; this->unk19C = 0.0f;
this->unk1A0 = 0.0333333f; this->unk1A0 = 0.0333333351f;
// this->unk1A0 = D_8037893C;
// this->unk1A4_31 = \
// this->unk1A4_30 = \
// this->unk1A4_29 = \
// this->unk1A4_28 = \
// this->unk1A4_27 = \
// this->unk1A4_26 = \
// this->unk1A4_25 = \
// this->unk1A4_23 = \
// this->unk1A4_22 = \
// this->unk1A4_21 = \
// this->unk1A4_20 = \
// this->unk1A4_17 = \
// this->unk1A4_16 = \
// this->unk1A4_15 = \
// this->unk1A4_14 = \
// this->unk1A4_13 = \
// 0;
// this->unk1A4_11 = this->unk1A4_18 = 1;
this->unk1A4_31 =\
this->unk1A4_30 =\
this->unk1A4_29 =\
this->unk1A4_28 =\
this->unk1A4_27 =\
this->unk1A4_26 =\
this->unk1A4_25 =\ this->unk1A4_25 =\
this->unk1A4_23 =\ this->unk1A4_23 =\
this->unk1A4_22 =\ this->unk1A4_22 =\
@@ -1078,21 +1055,9 @@ gczoombox_t *gczoombox_new(s32 arg0, s32 portrait_id, s32 arg2, s32 arg3, void (
this->unk1A4_16 =\ this->unk1A4_16 =\
this->unk1A4_15 =\ this->unk1A4_15 =\
this->unk1A4_14 =\ this->unk1A4_14 =\
this->unk1A4_13 = FALSE; this->unk1A4_13 = 0;
temp_v1_2 = this->unk1A4_13; this->unk1A4_11 = this->unk1A4_18 = 1;
this->unk1A4_31 = \
this->unk1A4_30 = \
this->unk1A4_29 = \
this->unk1A4_28 = \
this->unk1A4_27 = \
this->unk1A4_26 = temp_v1_2;
this->unk1A4_18 = TRUE;
this->unk1A4_11 = this->unk1A4_18;
this->unkF0 = assetcache_get(0x89d); this->unkF0 = assetcache_get(0x89d);
func_80317C90(this, portrait_id); func_80317C90(this, portrait_id);
@@ -1118,9 +1083,6 @@ gczoombox_t *gczoombox_new(s32 arg0, s32 portrait_id, s32 arg2, s32 arg3, void (
_gczoombox_memClear( &this->unkB0, 0x40); _gczoombox_memClear( &this->unkB0, 0x40);
return this; return this;
} }
#else
#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/zoombox/gczoombox_new.s")
#endif
bool func_80318284(gczoombox_t *this, s32 arg1, u8 **arg2) { bool func_80318284(gczoombox_t *this, s32 arg1, u8 **arg2) {
s32 phi_v0; s32 phi_v0;

View File

@@ -290,7 +290,7 @@ segments:
- [0x87E30, c, code_87E30] - [0x87E30, c, code_87E30]
- [0x8A7B0, c, gc/pauseMenu] - [0x8A7B0, c, gc/pauseMenu]
- [0x8DC20, c, code_8DC20] - [0x8DC20, c, code_8DC20]
- [0x8E270, c, gc/zoombox] - [0x8E270, c, gc/zoombox] #DONE
- [0x91E10, c, code_91E10] - [0x91E10, c, code_91E10]
- [0x935F0, c, code_935F0] - [0x935F0, c, code_935F0]
- [0x93C10, c, code_93C10] - [0x93C10, c, code_93C10]
@@ -733,9 +733,8 @@ segments:
- [0xF14C0, .rodata, gc/transition] - [0xF14C0, .rodata, gc/transition]
- [0xF1520, .rodata, code_85800] - [0xF1520, .rodata, code_85800]
- [0xF1540, bin, data_F1540] - [0xF1540, bin, data_F1540]
# - [0xF18F0, .rodata, gc/zoombox] - [0xF18F0, .rodata, gc/zoombox]
- [0xF1900, .rodata, gc/zoombox] # - [0xF1960, bin, data_F1960]
- [0xF1960, bin, data_F1960]
- [0xF19C0, .rodata, code_91E10] - [0xF19C0, .rodata, code_91E10]
- [0xF1A00, bin, data_F1A00] - [0xF1A00, bin, data_F1A00]
- [0xF1DC0, .rodata, code_9A9D0] - [0xF1DC0, .rodata, code_9A9D0]