mapSavestate_apply() matched

This commit is contained in:
Banjo Kazooie
2024-05-04 23:10:06 -05:00
parent 255c800b18
commit e139aac86c
6 changed files with 42 additions and 32 deletions

View File

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

View File

@@ -393,4 +393,9 @@ typedef struct actor_array{
Actor data[]; //variable size array Actor data[]; //variable size array
}ActorArray; }ActorArray;
typedef struct {
u32 cnt;
Actor *actor_save_state[];
}ActorListSaveState;
#endif #endif

View File

@@ -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">98.3883%</text> <text x="78.5" y="15" fill="#010101" fill-opacity=".3">98.4207%</text>
<text x="77.5" y="14">98.3883%</text> <text x="77.5" y="14">98.4207%</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">98.9505%</text> <text x="184.5" y="15" fill="#010101" fill-opacity=".3">98.9690%</text>
<text x="183.5" y="14">98.9505%</text> <text x="183.5" y="14">98.9690%</text>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -8,7 +8,7 @@ typedef struct map_savestate_s{
}MapSavestate; }MapSavestate;
/* .bss */ /* .bss */
MapSavestate *D_8037E650[0x9A]; s32 D_8037E650[0x9A];
u8 pad_8037E8A8[0x18]; u8 pad_8037E8A8[0x18];
/* public functions */ /* public functions */
@@ -26,8 +26,8 @@ void mapSavestate_init(void){
void mapSavestate_free_all(void){ void mapSavestate_free_all(void){
int i; int i;
for(i = 0; i < 0x9A; i++){ for(i = 0; i < 0x9A; i++){
if(D_8037E650[i]){ if((u32*)D_8037E650[i] != NULL){
free(D_8037E650[i]); free((void *)D_8037E650[i]);
D_8037E650[i] = NULL; D_8037E650[i] = NULL;
} }
} }
@@ -37,7 +37,7 @@ void mapSavestate_defrag_all(void){
int i; int i;
for(i = 0; i < 0x9A; i++){ for(i = 0; i < 0x9A; i++){
if(D_8037E650[i]){ if(D_8037E650[i]){
D_8037E650[i] = (MapSavestate *)defrag(D_8037E650[i]); D_8037E650[i] = defrag(D_8037E650[i]);
} }
} }
} }
@@ -91,22 +91,30 @@ void mapSavestate_save(enum map_e map){
} }
#endif #endif
//mapSavestate_apply #define AS_BOOL(expr) ((expr)? TRUE : FALSE)
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/mapSavestate_apply.s")
// void mapSavestate_apply(enum map_e map){ void mapSavestate_apply(enum map_e map_id) {
// u32 **mssp = D_8037E650 + map; s32 var_s0 = 0x1F;
// int s0; u32* t;
// int val; u32 aligned_index;
// u8 *tmp;
// if(*mssp){ if(D_8037E650[map_id] == NULL)
// mapSpecificFlags_setAll(**mssp); return;
// func_80308230(1);
// func_803083B0(-1); t = reinterpret_cast(u32*, D_8037E650[map_id]);
// for(s0 = 0x20; func_803083B0((((*mssp)[s0 >> 5]) & (1 << (s0 & 0x1f)))? 1 : 0) != -1; s0++); mapSpecificFlags_setAll(*t);
// func_80308230(0); var_s0++;
// tmp = *mssp; func_80308230(1);
// func_8032A09C(tmp, (tmp + 0x10*((s0 + 0x7f) >> 7))); func_803083B0(-1);
// free(*mssp);
// *mssp = NULL; while (func_803083B0( AS_BOOL(((u32*)D_8037E650[map_id])[var_s0 >> 5] & (1 << (var_s0 & 0x1f)))) != -1) {
// } var_s0++;
// } }
func_80308230(0);
aligned_index = ((var_s0 + ((1 << 7) - 1)) >> 7);
func_8032A09C(D_8037E650[map_id], (ActorListSaveState *)D_8037E650[map_id] + (aligned_index << 2));
free((void *)D_8037E650[map_id] );
D_8037E650[map_id] = NULL;
}

View File

@@ -1769,10 +1769,7 @@ void *actors_appendToSavestate(void * begin, u32 end){
return sp3C; return sp3C;
} }
typedef struct {
u32 cnt;
Actor *actor_save_state[];
}ActorListSaveState;
void func_8032A09C(s32 arg0, ActorListSaveState *arg1) { void func_8032A09C(s32 arg0, ActorListSaveState *arg1) {
Actor **temp_v1; Actor **temp_v1;