diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2017-06-13 19:28:50 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2017-06-13 19:28:50 -0400 |
commit | 355498d85b71536580025364ccaa5ceb94c4194d (patch) | |
tree | daf27a8cb8ad3a1258476a9ac693b97c5a9dc183 | |
parent | 454d7bbdd7ee6c5cb61680da855755869662968f (diff) |
Decoration inventory data
-rwxr-xr-x[-rw-r--r--] | data/decoration.s | 0 | ||||
-rw-r--r-- | data/decoration_inventory.s | 16 | ||||
-rwxr-xr-x[-rw-r--r--] | data/decorations.inc | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | include/decoration_inventory.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | include/menu.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | include/sprite.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | ld_script.txt | 2 | ||||
-rwxr-xr-x | src/decoration.c | 28 | ||||
-rwxr-xr-x[-rw-r--r--] | src/decoration_inventory.c | 13 | ||||
-rwxr-xr-x[-rw-r--r--] | src/menu.c | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | src/scrcmd.c | 0 |
11 files changed, 28 insertions, 31 deletions
diff --git a/data/decoration.s b/data/decoration.s index d37e41823..d37e41823 100644..100755 --- a/data/decoration.s +++ b/data/decoration.s diff --git a/data/decoration_inventory.s b/data/decoration_inventory.s deleted file mode 100644 index a70dedbe5..000000000 --- a/data/decoration_inventory.s +++ /dev/null @@ -1,16 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - -@ pointer to decorations, capacity - .align 2 -gDecorationInventories:: @ 8402E40 - .4byte gSaveBlock1 + 0x26A0, 10 @ DESK - .4byte gSaveBlock1 + 0x26AA, 10 @ CHAIR - .4byte gSaveBlock1 + 0x26B4, 10 @ PLANT - .4byte gSaveBlock1 + 0x26BE, 30 @ ORNAMENT - .4byte gSaveBlock1 + 0x26DC, 30 @ MAT - .4byte gSaveBlock1 + 0x26FA, 10 @ POSTER - .4byte gSaveBlock1 + 0x2704, 40 @ DOLL - .4byte gSaveBlock1 + 0x272C, 10 @ CUSHION diff --git a/data/decorations.inc b/data/decorations.inc index 268ebee9a..268ebee9a 100644..100755 --- a/data/decorations.inc +++ b/data/decorations.inc diff --git a/include/decoration_inventory.h b/include/decoration_inventory.h index dd87e7239..dd87e7239 100644..100755 --- a/include/decoration_inventory.h +++ b/include/decoration_inventory.h diff --git a/include/menu.h b/include/menu.h index 04ab78b27..04ab78b27 100644..100755 --- a/include/menu.h +++ b/include/menu.h diff --git a/include/sprite.h b/include/sprite.h index bda635885..bda635885 100644..100755 --- a/include/sprite.h +++ b/include/sprite.h diff --git a/ld_script.txt b/ld_script.txt index b4c30ad57..884b886d6 100644..100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -461,7 +461,7 @@ SECTIONS { data/battle_anim_81258BC.o(.rodata); data/battle_anim_812C144.o(.rodata); data/learn_move.o(.rodata); - data/decoration_inventory.o(.rodata); + src/decoration_inventory.o(.rodata); src/roamer.o(.rodata); data/battle_tower.o(.rodata); data/use_pokeblock.o(.rodata); diff --git a/src/decoration.c b/src/decoration.c index 729f14280..3fa230cd5 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -2105,7 +2105,7 @@ void sub_8100B6C(void) } for (j=0; j<gUnknown_020391B4[i].var02; j++) { - for (k=0; k<gUnknown_020391B4[i].var01; k++) + for (k=0; k<gUnknown_020391B4[i].width; k++) { MapGridSetMetatileEntryAt(x + 7 + k, y + 7 - j, ((u16 *)gMapHeader.mapData->map)[(x + k) + gMapHeader.mapData->width * (y - j)] | 0x3000); } @@ -2277,43 +2277,43 @@ void sub_8101118(u8 decorIdx, struct UnkStruct_020391B4 *unk_020391B4) { if (gDecorations[decorIdx].decor_field_12 == 0) { - unk_020391B4->var01 = 1; + unk_020391B4->width = 1; unk_020391B4->var02 = 1; } else if (gDecorations[decorIdx].decor_field_12 == 1) { - unk_020391B4->var01 = 2; + unk_020391B4->width = 2; unk_020391B4->var02 = 1; } else if (gDecorations[decorIdx].decor_field_12 == 2) { - unk_020391B4->var01 = 3; + unk_020391B4->width = 3; unk_020391B4->var02 = 1; } else if (gDecorations[decorIdx].decor_field_12 == 3) { - unk_020391B4->var01 = 4; + unk_020391B4->width = 4; unk_020391B4->var02 = 2; } else if (gDecorations[decorIdx].decor_field_12 == 4) { - unk_020391B4->var01 = 2; + unk_020391B4->width = 2; unk_020391B4->var02 = 2; } else if (gDecorations[decorIdx].decor_field_12 == 5) { - unk_020391B4->var01 = 1; + unk_020391B4->width = 1; unk_020391B4->var02 = 2; } else if (gDecorations[decorIdx].decor_field_12 == 6) { - unk_020391B4->var01 = 1; + unk_020391B4->width = 1; unk_020391B4->var02 = 3; } else if (gDecorations[decorIdx].decor_field_12 == 7) { - unk_020391B4->var01 = 2; + unk_020391B4->width = 2; unk_020391B4->var02 = 4; } else if (gDecorations[decorIdx].decor_field_12 == 8) { - unk_020391B4->var01 = 3; + unk_020391B4->width = 3; unk_020391B4->var02 = 3; } else if (gDecorations[decorIdx].decor_field_12 == 9) { - unk_020391B4->var01 = 3; + unk_020391B4->width = 3; unk_020391B4->var02 = 2; } } @@ -2340,9 +2340,9 @@ bool8 sub_8101200(u8 taskId, u8 decorIdx, struct UnkStruct_020391B4 *unk_020391B { unk_020391B4->var02--; } - if (x >= xOff && x < xOff + unk_020391B4->var01 && y > yOff - unk_020391B4->var02 && y <= yOff) + if (x >= xOff && x < xOff + unk_020391B4->width && y > yOff - unk_020391B4->var02 && y <= yOff) { - sub_8101198(unk_020391B4->var01 - (x - xOff + 1), yOff - y); + sub_8101198(unk_020391B4->width - (x - xOff + 1), yOff - y); return TRUE; } return FALSE; @@ -2434,7 +2434,7 @@ void sub_8101460(u8 taskId) { xOff = ewram_1f000.pos[gUnknown_020391B4[0].var00] >> 4; yOff = ewram_1f000.pos[gUnknown_020391B4[0].var00] & 0xf; - sub_81013B8(xOff, yOff - gUnknown_020391B4[0].var02 + 1, xOff + gUnknown_020391B4[0].var01 - 1, yOff); + sub_81013B8(xOff, yOff - gUnknown_020391B4[0].var02 + 1, xOff + gUnknown_020391B4[0].width - 1, yOff); } } } diff --git a/src/decoration_inventory.c b/src/decoration_inventory.c index a483629b1..c3dfdb2a8 100644..100755 --- a/src/decoration_inventory.c +++ b/src/decoration_inventory.c @@ -8,6 +8,19 @@ #include "decoration.h" #include "decoration_inventory.h" +#define DECOR_INV(ptr) {.items = (u8 *)&ptr, .size = sizeof ptr} + +struct DecorationInventory const gDecorationInventories[] = { + DECOR_INV(gSaveBlock1.decorDesk), + DECOR_INV(gSaveBlock1.decorChair), + DECOR_INV(gSaveBlock1.decorPlant), + DECOR_INV(gSaveBlock1.decorOrnament), + DECOR_INV(gSaveBlock1.decorMat), + DECOR_INV(gSaveBlock1.decorPoster), + DECOR_INV(gSaveBlock1.decorDoll), + DECOR_INV(gSaveBlock1.decorCushion) +}; + void ClearDecorationInventory(u8 invIdx) { u8 i; diff --git a/src/menu.c b/src/menu.c index 61eaebb6f..61eaebb6f 100644..100755 --- a/src/menu.c +++ b/src/menu.c diff --git a/src/scrcmd.c b/src/scrcmd.c index 33867b58a..33867b58a 100644..100755 --- a/src/scrcmd.c +++ b/src/scrcmd.c |