core2/code_6DA30.c progress

This commit is contained in:
Banjo Kazooie
2022-09-28 18:17:24 -05:00
parent c1bfe456bf
commit a307feabec
10 changed files with 96 additions and 85 deletions

View File

@@ -1,4 +1,4 @@
# banjo (88.8665%) # banjo (88.9275%)
<img src="./progress/progress_total.svg"> <img src="./progress/progress_total.svg">

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="#38e000" d="M44 0h67v20H44z"/> <path fill="#37e000" 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">87.6077%</text> <text x="78.5" y="15" fill="#010101" fill-opacity=".3">87.7140%</text>
<text x="77.5" y="14">87.6077%</text> <text x="77.5" y="14">87.7140%</text>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -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">88.8665%</text> <text x="184.5" y="15" fill="#010101" fill-opacity=".3">88.9275%</text>
<text x="183.5" y="14">88.8665%</text> <text x="183.5" y="14">88.9275%</text>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,5 +1,6 @@
#include <ultratypes.h> #include <ultratypes.h>
//TODO Implement CRC calculation in Makefile(?)
u32 D_80390B20 = 0x00282B61; //BGS.code CRC1 u32 D_80390B20 = 0x00282B61; //BGS.code CRC1
u32 D_80390B24 = 0xccdaeea0; //BGS.code CRC2 u32 D_80390B24 = 0xccdaeea0; //BGS.code CRC2
u32 D_80390B28 = 0x0002DE6B; //BGS.data CRC1 (with this value = 0) u32 D_80390B28 = 0x0002DE6B; //BGS.data CRC1 (with this value = 0)

View File

@@ -5,12 +5,11 @@
extern void func_8028F710(s32, f32); extern void func_8028F710(s32, f32);
/* .data */ /* .data */
u8 D_80390F30[] = { //TODO Implement CRC calculation in Makefile(?)
0x00, 0x27, 0x45, 0x30, u32 D_80390F30 = 0x00274530; //GV.code CRC1
0xAA, 0x18, 0xBB, 0xF3, u32 D_80390F34 = 0xAA18BBF3; //GV.code CRC2
0x00, 0x03, 0x03, 0x1C, u32 D_80390F38 = 0x0003031C; //GV.data CRC1 (with this value = 0)
0x00, 0x00, 0x00, 0x00
};
/* .code */ /* .code */
void func_80389F00(void){ void func_80389F00(void){

View File

@@ -164,10 +164,6 @@ void func_802EEE3C(ParticleEmitter *this, Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 a
f32 sp80[3]; f32 sp80[3];
f32 sp74[3]; f32 sp74[3];
Particle *iPtr; Particle *iPtr;
s32 tmp_a0;
s32 tmp_a1;
s32 tmp_a2;
s32 tmp_a3;
if(arg4 != (this->unk18 & 0x4)) if(arg4 != (this->unk18 & 0x4))
return; return;
@@ -180,8 +176,8 @@ void func_802EEE3C(ParticleEmitter *this, Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 a
if( 0.0f != this->unk10 || 1.0 != this->unk14 || this->unk49 != 0xff ){ if( 0.0f != this->unk10 || 1.0 != this->unk14 || this->unk49 != 0xff ){
func_8033A410((s32) (iPtr->unkC*this->unk49)); func_8033A410((s32) (iPtr->unkC*this->unk49));
}//L802EEF5C }//L802EEF5C
tmp_a3 = (this->unk18 & 0x10)?0:1; // tmp_a3 = (this->unk18 & 0x10)?0:1;
set_model_render_mode(tmp_a3); set_model_render_mode((this->unk18 & 0x10)?0:1);
func_803391A4(gfx, mtx, sp8C, iPtr->unk24, iPtr->size_30, NULL, this->model_20); func_803391A4(gfx, mtx, sp8C, iPtr->unk24, iPtr->size_30, NULL, this->model_20);
} }
} }
@@ -192,14 +188,14 @@ void func_802EEE3C(ParticleEmitter *this, Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 a
|| this->unk3C[2] != 0xff || this->unk3C[2] != 0xff
|| this->unk49 != 0xff || this->unk49 != 0xff
){ ){
tmp_a3 = (this->unk18 & 0x10)? 9: 0xf; func_803382E4((this->unk18 & 0x10)? 9: 0xf);
func_803382E4(tmp_a3);
func_80338338(this->unk3C[0], this->unk3C[1], this->unk3C[2]); func_80338338(this->unk3C[0], this->unk3C[1], this->unk3C[2]);
tmp_a0 = (this->unk3C[0] < 8)? 0 : this->unk3C[0] - 8; func_803382B4(
tmp_a1 = (this->unk3C[1] < 8)? 0 : this->unk3C[1] - 8; (this->unk3C[0] < 8)? 0 : this->unk3C[0] - 8,
tmp_a2 = (this->unk3C[2] < 8)? 0 : this->unk3C[2] - 8; (this->unk3C[1] < 8)? 0 : this->unk3C[1] - 8,
tmp_a3 = (this->unk18 & 0x20)? 0xff : this->unk49; (this->unk3C[2] < 8)? 0 : this->unk3C[2] - 8,
func_803382B4(tmp_a0, tmp_a1, tmp_a2, tmp_a3); (this->unk18 & 0x20)? 0xff : this->unk49
);
func_80338370(); func_80338370();
func_80335D30(gfx); func_80335D30(gfx);
} }

View File

@@ -32,7 +32,7 @@ typedef struct map_font_texture_map{
typedef struct{ typedef struct{
u8 unk0; u8 unk0;
u8 unk1; u8 unk1;
u8 pad2[1]; s8 unk2;
s8 unk3; s8 unk3;
}Struct_6DA30_0_s; }Struct_6DA30_0_s;
@@ -46,7 +46,7 @@ extern struct {
u8 unk3; u8 unk3;
} D_80369078; } D_80369078;
extern s32 D_80369068[]; extern s32 D_80369068[]; //max letter width
extern MapFontTextureMap D_8036907C[]; extern MapFontTextureMap D_8036907C[];
extern u8 D_80369200[]; extern u8 D_80369200[];
@@ -71,7 +71,7 @@ extern u8 D_8037724C[4];
extern u8 D_80377250[4]; extern u8 D_80377250[4];
extern u8 D_80377254[4]; extern u8 D_80377254[4];
s8 D_80380AB0; char D_80380AB0;
BKSprite *D_80380AB8[0x5]; BKSprite *D_80380AB8[0x5];
FontLetter *print_sFonts[4]; FontLetter *print_sFonts[4];
@@ -79,7 +79,7 @@ PrintBuffer *print_sPrintBuffer;
PrintBuffer *print_sCurrentPtr; PrintBuffer *print_sCurrentPtr;
s32 D_80380AE8; s32 D_80380AE8;
s32 D_80380AEC; s32 D_80380AEC;
s32 D_80380AF0; s32 D_80380AF0; //print_sMonospaced
s32 D_80380AF4; s32 D_80380AF4;
s32 D_80380AF8; s32 D_80380AF8;
s32 D_80380AFC; s32 D_80380AFC;
@@ -97,6 +97,8 @@ f32 D_80380FA0;
f32 D_80380FA8[0x20]; f32 D_80380FA8[0x20];
void func_802F7A2C(s32 arg0);
//returns map texture assetID for current map; //returns map texture assetID for current map;
enum asset_e func_802F49C0(void){ enum asset_e func_802F49C0(void){
s32 i; s32 i;
@@ -288,25 +290,23 @@ void func_802F5188(void){
func_802F5010(); func_802F5010();
} }
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6DA30/func_802F51B8.s") void func_802F51B8(void){
/*void func_802F51B8(void){
s32 i, j; s32 i, j;
s32 length; s32 length;
int found; int found;
length = strlen(D_80369200); length = strlen(D_80369200);
D_80380AEC = 0; D_80380AE8 = \
D_80380AF0 = 0; D_80380AEC = \
D_80380AF4 = 0; D_80380AF0 = \
D_80380AF8 = 0; D_80380AF4 = \
D_80380AFC = 0; D_80380AF8 = \
D_80380B00 = 0; D_80380AFC = \
D_80380B04 = 0; print_sInFontFormatMode = \
print_sInFontFormatMode = FALSE; D_80380B04 = \
D_80380B0C = 0; D_80380B00 = \
D_80380B10 = 0; D_80380B10 = \
D_80380B14 = 0; D_80380B14 = 0;
D_80380AE8 = 0;
D_80380AB0 = 0; D_80380AB0 = 0;
func_802F7A2C(3); func_802F7A2C(3);
D_80380AB8[0] = assetcache_get(SPRITE_DIALOG_FONT_ALPHAMASK); D_80380AB8[0] = assetcache_get(SPRITE_DIALOG_FONT_ALPHAMASK);
@@ -327,12 +327,11 @@ void func_802F5188(void){
}//L802F5330 }//L802F5330
if(!found) if(!found)
D_80380F20[i] = -1; D_80380F20[i] = -1;
//L802F533C
} }
assetcache_release(D_80380AB8[4]); assetcache_release(D_80380AB8[4]);
D_80380AB8[4] = NULL; D_80380AB8[4] = NULL;
D_80380B1C = func_802F49C0(); D_80380B1C = func_802F49C0();
}//*/ }
void func_802F5374(void){ void func_802F5374(void){
if(D_80380B18 > 0 && --D_80380B18 == 0){ if(D_80380B18 > 0 && --D_80380B18 == 0){
@@ -365,7 +364,7 @@ void func_802F542C(void){
} }
//returns the pixel data and type for a given letter //returns the pixel data and type for a given letter
void *func_802F5494(s32 letterId, s32 *fontType){ BKSpriteTextureBlock *func_802F5494(s32 letterId, s32 *fontType){
if(D_80380AE8 != 1 || (D_80380AE8 == 1 && letterId < 0xA)){ if(D_80380AE8 != 1 || (D_80380AE8 == 1 && letterId < 0xA)){
*fontType = D_80380AB8[D_80380AE8]->type; *fontType = D_80380AB8[D_80380AE8]->type;
return print_sFonts[D_80380AE8][letterId].unk0; return print_sFonts[D_80380AE8][letterId].unk0;
@@ -641,8 +640,58 @@ void _printbuffer_draw_letter(s32 letter, f32* xPtr, f32* yPtr, f32 arg3, Gfx **
} }
#endif #endif
f32 func_802F6C90(u8 letter, f32* xPtr, f32 *yPtr, f32 arg3); f32 func_802F6C90(u8 letter, f32* xPtr, f32 *yPtr, f32 arg3){
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6DA30/func_802F6C90.s") s32 sp44;
s32 i;
bool var_v0;
f32 sp38;
s32 sp34;
f32 var_f2;
s32 sp2C;
sp38 = *xPtr;
var_v0 = FALSE;
sp34 = 0;
if (D_80380AE8 == 1) {
if (letter < 0x80) {
if (D_80380F20[letter] >= 0) {
for(i = 0; D_80369000[i].unk0 != 0; i++) {
if ((D_80369000[i].unk1 == letter) && (D_80369000[i].unk0 == D_80380AB0)) {
sp34 = D_80369000[i].unk2;
break;
}
}
D_80380AB0 = letter;
sp44 = D_80380F20[letter];
var_v0 = TRUE;
sp38 += sp34 * arg3;
}
}
}
else{
return *xPtr;
}
if (!var_v0 || print_sInFontFormatMode) {
if (letter == ' ') {
var_f2 = (D_80380AF0) ? D_80369068[D_80380AE8] : 0.8*D_80369068[D_80380AE8];
}
else{
return *xPtr;
}
}
else {
if(D_80380AF0){
var_f2 = D_80369068[D_80380AE8];
}
else{
var_f2 = func_802F5494(sp44, &sp2C)->x;
}
}
var_f2 += (sp34 - 4);
*xPtr += var_f2 * arg3;
return sp38;
}
void printbuffer_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) { void printbuffer_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
s32 j; s32 j;

View File

@@ -143,40 +143,6 @@ extern struct31s D_803934AC;
extern struct42s D_803934D4; extern struct42s D_803934D4;
extern s32 D_80393504[4]; extern s32 D_80393504[4];
/* .rodata */
extern f32 D_80394D50;
extern f64 D_80394D58;
extern f32 D_80394D60;
extern f32 D_80394D64;
extern f32 D_80394D68;
extern f32 D_80394D6C;
extern f32 D_80394D70;
extern f32 D_80394D74;
extern f32 D_80394D78;
extern f32 D_80394D7C;
extern f64 D_80394F88;
extern f32 D_80394D80;
extern f32 D_80394D84;
extern f32 D_80394D88;
extern f32 D_80394D8C; //! .rodata : 0.9f
extern f64 D_80394D90; //! .rodata : 1.7
extern f64 D_80394D98; //! .rodata : 1.1
extern f32 D_80394FC0;
extern f32 D_80394FC4;
extern f32 D_80394FC8;
extern f32 D_80394FCC;
extern f32 D_80394FD0;
extern f32 D_80394FD4;
extern f32 D_80394FD8;
extern f32 D_80394FDC;
extern f32 D_80394FE0;
extern f32 D_80394FE4;
extern f32 D_80394FE8;
extern f32 D_80394FEC;
extern f32 D_80394FF0;
/* .bss */ /* .bss */

View File

@@ -99,7 +99,7 @@ extern struct {
u8 UNK_07; u8 UNK_07;
f32 unk8; f32 unk8;
} D_80394354[]; // unk size } D_80394354[];
// ? // ?
extern struct { extern struct {

View File

@@ -33,14 +33,14 @@ segments:
- [0x790, c, code_790] #DONE - [0x790, c, code_790] #DONE
- [0xA40, c, code_A40] #DONE - [0xA40, c, code_A40] #DONE
- [0x11F0, c, code_11F0] #DONE - [0x11F0, c, code_11F0] #DONE
- [0x19E0, c, code_19E0] - [0x19E0, c, code_19E0] #DONE
- [0x1FF0, c, code_1FF0] #DONE - [0x1FF0, c, code_1FF0] #DONE
- [0x2350, c, code_2350] #DONE - [0x2350, c, code_2350] #DONE
- [0x3E00, c, code_3E00] #DONE - [0x3E00, c, code_3E00] #DONE
- [0x4400, c, code_4400] #DONE - [0x4400, c, code_4400] #DONE
- [0x45D0, c, code_45D0] #DONE - [0x45D0, c, code_45D0] #DONE
- [0x4770, c, code_4770] #DONE - [0x4770, c, code_4770] #DONE
- [0x5CC0, c, code_5CC0] #DONE - [0x5CC0, c, code_5CC0]
- [0x6AE0, c, code_6AE0] #DONE - [0x6AE0, c, code_6AE0] #DONE
- [0x7980, c, code_7980] #DONE - [0x7980, c, code_7980] #DONE
- [0x8330, c, code_8330] #DONE - [0x8330, c, code_8330] #DONE