Progress update (98.8633%)

This commit is contained in:
Banjo Kazooie
2024-05-04 21:37:09 -05:00
parent af75d8b32d
commit 8f493432e5
8 changed files with 82 additions and 84 deletions

View File

@@ -129,18 +129,12 @@ void func_8023DCF4(void){
D_80275618--;
}
#ifndef NOMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_0/mainLoop.s")
#else
void mainLoop(void){
s32 x;
s32 y;
s32 r;
s32 g;
s32 b;
s32 x, y;
s32 r, g, b, a;
u16 tmp;
u16 rgba;
s32 offset;
if((func_8023DB5C() & 0x7f) == 0x11)
sns_write_payload_over_heap();
@@ -182,23 +176,24 @@ void mainLoop(void){
){
s32 offset;
//render weird CRC failure image
for(x= 0x1e; x< framebuffer_height - 0x1e; x++){//L8023DEB4
g = x >> 3;
for(y = 0x14; y < 0xeb; y++){
b = ((func_8023DB5C() << 3) + y*y + x*x) >> 3;
r = y >> 3;
rgba = _SHIFTL(b, 1, 5);
rgba |= _SHIFTL(r, 11, 5 );
rgba |= _SHIFTL(g, 6, 5);
rgba |= _SHIFTL(1, 0, 1 );
offset = ((framebuffer_width - 0xff)/2 + y + x*framebuffer_width);
D_803A5D00[0][offset] = rgba;
D_803A5D00[1][offset] = rgba;
for(y= 0x1e; y < framebuffer_height - 0x1e; y++){//L8023DEB4
for(x = 0x14; x < 0xeb; x++){
tmp = ((8 * func_8023DB5C()) + ((x*x) + (y*y)));
r = _SHIFTL(x>>3, 11, 5);
g = _SHIFTL(y>>3, 6, 5);
b = _SHIFTL(tmp>>3, 1, 5);
a = 1;
rgba = b | r | g | a;
offset = ((framebuffer_width - 0xFF) / 2) + x + (y*framebuffer_width);
D_803A5D00[0][offset] = (s32) rgba;
D_803A5D00[1][offset] = (s32) rgba;
}
}
}//L8023DF70
}
#endif
void __mainMethod(void *arg0){
core1_init();

View File

@@ -42,32 +42,27 @@ void mlMtxApply(Mtx *mPtr){
func_80245A7C(D_80282FD0, mPtr);
}
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_802514BC.s")
#else
void func_802514BC(Mtx *arg0) {
s32 i, j, k;
f32 tmp;
f32 sp38[4][4];
f32 (*sp34)[4];
f32 (*var_s0)[4];
void func_802514BC(Mtx* arg0) {
s32 row;
s32 col;
s32 i;
f32 sum;
f32 prod[4][4];
sp34 = reinterpret_cast(f32 *, *D_80282FD0);
var_s0 = reinterpret_cast(f32 *, arg0);
for(i = 0; i < 4; i++){
for(j = 0; j < 4; j++){
tmp = 0.0f;
for(k = 0; k < 4; k++){
tmp += var_s0[i][k] * sp34[k][j];
for(row = 0; row < 4; row++, arg0 = &arg0->m[1][0])
{
for(col = 0; col < 4; col++)
{
sum = 0.0;
for(i = 0; i < 4; i++)
{
sum += reinterpret_cast(f32, arg0->m[0][i]) * reinterpret_cast(f32, D_80282FD0->m[i][col]);
}
sp38[i][j] = tmp;
prod[row][col] = sum;
}
}
func_80253010(sp34, &sp38, sizeof(Mtx));
func_80253010(D_80282FD0, prod, sizeof(Mtx));
}
#endif
void func_802515D4(f32 arg0[3][3]) {
f32 var_f0;
@@ -163,7 +158,26 @@ void func_80251878(f32* arg0) {
D_80282FD0 = var_a2;
}
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_802519C8.s")
void func_802519C8(Mtx * arg0, Mtx * arg1) {
s32 row;
s32 col;
Mtx * dst = (D_80282FD0 + 1);
for (row = 0; row < 4; row++, arg1 = &arg1->m[1][0])
{
for (col = 0; col < 4; col++)
{
reinterpret_cast(f32, dst->m[row][col]) =
(
reinterpret_cast(f32, arg1->m[0][0]) * reinterpret_cast(f32, arg0->m[0][col]) +
reinterpret_cast(f32, arg1->m[0][1]) * reinterpret_cast(f32, arg0->m[1][col]) +
reinterpret_cast(f32, arg1->m[0][2]) * reinterpret_cast(f32, arg0->m[2][col]) +
reinterpret_cast(f32, arg1->m[0][3]) * reinterpret_cast(f32, arg0->m[3][col])
);
}
}
D_80282FD0 = (dst + 0);
}
//mlMtx
void mlMtxIdent(void){

View File

@@ -8,32 +8,28 @@ OSMesgQueue D_8027E0AC;
OSMesg D_8027E0C8[16]; //g_PimgrMesgBuffer
OSMesgQueue D_8027E108; //g_PimgrMesgQueue
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_2BD0/func_802405F0.s")
#else
void func_802405F0(u32 arg0, u32 arg1, s32 size){
int i;
void func_802405F0(u32 * arg0, s32 arg1, s32 size){
s32 block_cnt;
s32 block_remainder;
s32 block_size = 0x20000;
int i;
osWritebackDCache(arg0, size);
block_cnt = size/block_size;
block_cnt = size / block_size;
block_remainder = size % block_size;
for(i = 0; i < block_cnt; i++){
osPiStartDma(&D_8027E090, OS_MESG_PRI_NORMAL, OS_READ, arg1, arg0, block_size, &D_8027E0AC);
osPiStartDma(&D_8027E090, OS_MESG_PRI_NORMAL, OS_READ, arg1, arg0, 0x20000, &D_8027E0AC);
osRecvMesg(&D_8027E0AC, NULL, 1);
arg0 += 0x20000;
arg1 += 0x20000;
arg0 += 0x8000;
}
block_remainder = size%0x20000;
osPiStartDma(&D_8027E090, OS_MESG_PRI_NORMAL, OS_READ, arg1, arg0, block_remainder, &D_8027E0AC);
osRecvMesg(&D_8027E0AC, NULL, 1);
osInvalDCache(arg0, size);
}
#endif
void piMgr_create(void){
osCreateMesgQueue(&D_8027E0AC, &D_8027E0A8, 1);