Put const data in button

This commit is contained in:
Tal Hayon 2022-04-16 23:39:56 +03:00
parent 3952a45700
commit cec735cee2
4 changed files with 15 additions and 27 deletions

View File

@ -41029,11 +41029,6 @@
"size": 89,
"type": "animation"
},
{
"path": "button/gUnk_0811EE50.bin",
"start": 1175120,
"size": 12
},
{
"path": "animations/gSpriteAnimations_MinishEmoticon_2.bin",
"start": 1175140,

View File

@ -1,16 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnk_0811EE38:: @ 0811EE38
.4byte sub_08081AE0
.4byte sub_08081B84
.4byte sub_08081BAC
.4byte sub_08081BE0
.4byte sub_08081C30
.4byte sub_08081C98
gUnk_0811EE50:: @ 0811EE50
.incbin "button/gUnk_0811EE50.bin"

View File

@ -1329,7 +1329,7 @@ SECTIONS {
src/object/deathFx.o(.rodata);
data/animations/object/deathFx.o(.rodata);
src/object/itemForSale.o(.rodata);
data/const/object/button.o(.rodata);
src/object/button.o(.rodata);
src/object/minishEmoticon.o(.rodata);
data/animations/object/minishEmoticon.o(.rodata);
data/const/object/pot.o(.rodata);

View File

@ -1,10 +1,18 @@
#include "object.h"
#include "functions.h"
extern void (*const gUnk_0811EE38[])(Entity*);
void sub_08081AE0(Entity*);
void sub_08081B84(Entity*);
void sub_08081BAC(Entity*);
void sub_08081BE0(Entity*);
void sub_08081C30(Entity*);
void sub_08081C98(Entity*);
void Button(Entity* this) {
gUnk_0811EE38[this->action](this);
static void (*const actionFuncs[])(Entity*) = {
sub_08081AE0, sub_08081B84, sub_08081BAC, sub_08081BE0, sub_08081C30, sub_08081C98,
};
actionFuncs[this->action](this);
}
extern u32 sub_08081E3C(Entity*);
@ -172,10 +180,11 @@ u32 sub_08081E0C(Entity* this) {
}
}
extern u16 gUnk_0811EE50[];
u32 sub_08081E3C(Entity* this) {
u16* tmp1;
static const u16 gUnk_0811EE50[] = {
0x77, 0x78, 0x79, 0x7a, 0, 0,
};
const u16* tmp1;
int tmp2;
tmp2 = GetTileType(this->field_0x74.HWORD, this->collisionLayer);
tmp1 = gUnk_0811EE50;