Merge pull request #366 from Cuyler36:m_island_full_match

Fully match m_island
This commit is contained in:
Cuyler36
2024-06-30 22:11:16 -04:00
committed by GitHub
+5 -13
View File
@@ -749,8 +749,6 @@ static void mISL_toHole(mActor_name_t* fg, u16* deposit, int bx, int bz) {
}
}
/* @nonmatching */
#ifndef MUST_MATCH
extern void mISL_agb_to_gc(Island_c* gc, Island_agb_c* agb) {
int island_x_blocks[mISL_FG_BLOCK_X_NUM];
int i;
@@ -762,7 +760,7 @@ extern void mISL_agb_to_gc(Island_c* gc, Island_agb_c* agb) {
mISL_agb_to_gc_cottage(&gc->cottage, &agb->cottage);
bcopy(&agb->flag_design, &gc->flag_design, sizeof(mNW_original_design_c));
mISL_agb_to_gc_animal(&gc->animal, &agb->animal);
mISL_short((u16*)gc->deposit, (u16*)agb->deposit, sizeof(gc->deposit) / sizeof(u16));
mISL_short(gc->deposit[0], agb->deposit[0], sizeof(gc->deposit) / sizeof(u16));
bcopy(agb->bg_data, gc->bg_data, sizeof(gc->bg_data));
mISL_gc_to_agb_time(&gc->renew_time, &agb->renew_time);
gc->last_song_to_island = agb->last_song_to_island;
@@ -773,18 +771,12 @@ extern void mISL_agb_to_gc(Island_c* gc, Island_agb_c* agb) {
mFI_GetIslandBlockNumX(island_x_blocks);
for (i = 0; i < mISL_FG_BLOCK_X_NUM; i++) {
int idx = i + island_x_blocks[0];
mActor_name_t* fg_p = &gc->fgblock[0][i].items[0][0];
u16* deposit_p = (u16*)&gc->deposit[(u16)i]; // the access to deposit is strange, casting to u16 is
// incorrect but it makes all other instructions correct
/* This may be fakematch */
int x = i + 1;
mISL_toHole(fg_p, deposit_p, idx, mISL_BLOCK_Z);
mISL_toHole((mActor_name_t*)&gc->fgblock[0][i], gc->deposit[--x], (i) + island_x_blocks[0],
mISL_BLOCK_Z);
}
}
}
}
#else
extern asm void mISL_agb_to_gc(Island_c* gc, Island_agb_c* agb) {
#include "asm/803b5948.s"
}
#endif