Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match func_800AFE00 #631

Merged
merged 3 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 0 additions & 95 deletions asm/non_matchings/code_800AF9B0/func_800AFE00.s

This file was deleted.

46 changes: 16 additions & 30 deletions src/code_800AF9B0.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,44 +125,30 @@ void func_800AFC54(Vtx *arg0, s32 arg1, s32 arg2, s32 arg3, s16 arg4[3]) {
GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800AFC54.s")
#endif

void func_800AFE00(Vtx *arg0, s16 (*arg1)[3], s32 arg2, s32 arg3);
#ifdef NON_MATCHING
// guessing on the Vtx kind again
void func_800AFE00(Vtx *arg0, Vec3s *arg1, s32 arg2, s32 arg3) {
s32 idx1; // v0
s32 idx2; // v0
s32 i, j;
s16 sp14[6];

if (arg2 == 0) {
idx1 = 0;
} else {
idx1 = arg2 - 1;
}
s32 idx1;
s32 idx2;
s32 i;
Vtx *vtx;
s16 sp14[2][3];

if (arg2 == arg3) {
idx2 = arg3;
} else {
idx2 = arg2 + 1;
}
idx1 = (arg2 == 0) ? 0 : arg2 - 1;
idx2 = (arg2 == arg3) ? arg3 : arg2 + 1;

for (i = 0; i != 3; i++) {
sp14[i + 0] = (arg1[arg2][i] + arg1[idx1][i]) / 2;
sp14[i + 3] = (arg1[arg2][i] + arg1[idx2][i - 1]) / 2;
for (i = 0; i < 3; i++) {
sp14[0][i] = (arg1[idx1][i] + arg1[arg2][i]) / 2;
sp14[1][i] = (arg1[idx2][i] + arg1[arg2][i]) / 2;
}

for (i = 0; i < 30; i += 4) {
for (j = 0; j < 4; j++) {
s16 *v = &sp14[(j&1)*3];
(arg0[i+j]).v.cn[0] = v[0];
(arg0[i+j]).v.cn[1] = v[1];
(arg0[i+j]).v.cn[2] = v[2];
for (idx2 = 0; idx2 < 0x1E0; idx2 += 0x30) {
for (i = 0; i < 4; i++) {
vtx = &arg0[i];
vtx[idx2 / 1].v.cn[0] = sp14[i % 2][0];
vtx[idx2 / 1].v.cn[1] = sp14[i % 2][1];
vtx[idx2 / 1].v.cn[2] = sp14[i % 2][2];
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800AFE00.s")
#endif

void func_800AFF58(Vtx *arg0) {
UNUSED u32 pad88[26];
Expand Down
Loading