mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-22 22:24:16 -04:00
Make aligned original data its own struct for prasing reasons
This commit is contained in:
@@ -13,7 +13,7 @@ extern "C" {
|
||||
|
||||
typedef struct mask_cat_data_s {
|
||||
/* 0x000 */ PersonalID_c creator_pid;
|
||||
/* 0x020 */ u8 design[mNW_DESIGN_TEX_SIZE] ATTRIBUTE_ALIGN(32); /* this is aligned to 32 bytes for ARAM transfer */
|
||||
/* 0x020 */ mNW_original_tex_c design; /* this is aligned to 32 bytes for ARAM transfer */
|
||||
} mMC_design_c;
|
||||
|
||||
typedef struct mask_cat_s {
|
||||
|
||||
@@ -42,12 +42,16 @@ enum {
|
||||
mNW_PALETTE_NUM
|
||||
};
|
||||
|
||||
typedef struct original_texture_s {
|
||||
u8 data[mNW_DESIGN_TEX_SIZE];
|
||||
} ATTRIBUTE_ALIGN(32) mNW_original_tex_c;
|
||||
|
||||
/* sizeof(mNW_original_design_c) == 0x220 */
|
||||
typedef struct original_data_s {
|
||||
/* 0x000 */ u8 name[mNW_ORIGINAL_DESIGN_NAME_LEN];
|
||||
/* 0x010 */ u8 palette;
|
||||
|
||||
/* 0x020 */ u8 design[mNW_DESIGN_TEX_SIZE] ATTRIBUTE_ALIGN(32); /* this is aligned to 32 bytes for ARAM transfer */
|
||||
/* 0x020 */ mNW_original_tex_c design; /* this is aligned to 32 bytes for ARAM transfer */
|
||||
} mNW_original_design_c;
|
||||
|
||||
/* sizeof(mNW_needlework_c) == 0x1100 */
|
||||
|
||||
+8
-8
@@ -56,7 +56,7 @@ static void mNW_InitMyOriginalTexture(int player_no) {
|
||||
for (i = 0; i < mNW_DEFAULT_ORIGINAL_TEX_NUM; i++) {
|
||||
_JW_GetResourceAram(
|
||||
JW_GetAramAddress(27) + i * mNW_DESIGN_TEX_SIZE,
|
||||
Save_Get(private[player_no].my_org[i & 7].design),
|
||||
Save_Get(private[player_no].my_org[i & 7].design.data),
|
||||
mNW_DESIGN_TEX_SIZE
|
||||
);
|
||||
}
|
||||
@@ -112,7 +112,7 @@ static void mNW_InitNeedleworkTexture() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < mNW_TOTAL_DESIGN_NUM; i++) {
|
||||
mNW_CopyNeedleworkDefaultTexture(Save_Get(needlework.original_design[i & 7].design), i);
|
||||
mNW_CopyNeedleworkDefaultTexture(Save_Get(needlework.original_design[i & 7].design.data), i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ extern u16* mNW_PaletteIdx2Palette(int palette_idx) {
|
||||
**/
|
||||
extern void mNW_CopyOriginalTextureClass(mNW_original_design_c* dst, mNW_original_design_c* src) {
|
||||
bcopy(src, dst, sizeof(mNW_original_design_c));
|
||||
DCStoreRangeNoSync(dst->design, mNW_DESIGN_TEX_SIZE);
|
||||
DCStoreRangeNoSync(dst->design.data, mNW_DESIGN_TEX_SIZE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -332,7 +332,7 @@ extern void mNW_CopyOriginalTextureClass(mNW_original_design_c* dst, mNW_origina
|
||||
**/
|
||||
extern void mNW_CopyOriginalTexture(void* dst, mNW_original_design_c* src) {
|
||||
if (dst != NULL) {
|
||||
bcopy(src->design, dst, mNW_DESIGN_TEX_SIZE);
|
||||
bcopy(src->design.data, dst, mNW_DESIGN_TEX_SIZE);
|
||||
DCStoreRangeNoSync(dst, mNW_DESIGN_TEX_SIZE);
|
||||
}
|
||||
}
|
||||
@@ -358,7 +358,7 @@ extern void mNW_CopyOriginalPalette(void* dst, mNW_original_design_c* src) {
|
||||
**/
|
||||
extern void mNW_OverWriteOriginalTexture(mNW_original_design_c* dst, u8* src) {
|
||||
if (src != NULL) {
|
||||
u8* tex = dst->design;
|
||||
u8* tex = dst->design.data;
|
||||
bcopy(src, tex, mNW_DESIGN_TEX_SIZE);
|
||||
DCStoreRangeNoSync(tex, mNW_DESIGN_TEX_SIZE);
|
||||
}
|
||||
@@ -389,8 +389,8 @@ extern void mNW_SwapOriginalData(mNW_original_design_c* org0, mNW_original_desig
|
||||
bcopy(org0, &mNW_swap_work, sizeof(mNW_original_design_c));
|
||||
bcopy(org1, org0, sizeof(mNW_original_design_c));
|
||||
bcopy(&mNW_swap_work, org1, sizeof(mNW_original_design_c));
|
||||
DCStoreRangeNoSync(org0->design, mNW_DESIGN_TEX_SIZE);
|
||||
DCStoreRangeNoSync(org1->design, mNW_DESIGN_TEX_SIZE);
|
||||
DCStoreRangeNoSync(org0->design.data, mNW_DESIGN_TEX_SIZE);
|
||||
DCStoreRangeNoSync(org1->design.data, mNW_DESIGN_TEX_SIZE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -403,7 +403,7 @@ extern void mNW_InitOriginalData(mNW_original_design_c* design) {
|
||||
|
||||
u8* tex;
|
||||
mNW_OverWriteOriginalName(design, name);
|
||||
tex = design->design;
|
||||
tex = design->design.data;
|
||||
mem_clear(tex, mNW_DESIGN_TEX_SIZE, 0xFF);
|
||||
DCStoreRangeNoSync(tex, mNW_DESIGN_TEX_SIZE);
|
||||
design->palette = 0;
|
||||
|
||||
Reference in New Issue
Block a user