Move const data into playerItemSwordBeam

This commit is contained in:
Tal Hayon 2022-04-13 19:32:41 +03:00
parent e809532548
commit 8eaddf08c2
4 changed files with 13 additions and 43 deletions

View File

@ -3626,21 +3626,6 @@
"start": 736896,
"size": 1396
},
{
"path": "playerItemSwordBeam/gUnk_080B43FC.bin",
"start": 738300,
"size": 4
},
{
"path": "playerItemSwordBeam/gUnk_080B4400.bin",
"start": 738304,
"size": 8
},
{
"path": "playerItemSwordBeam/gUnk_080B4408.bin",
"start": 738312,
"size": 8
},
{
"path": "data_080B4410/gUnk_080B4410_JP.bin",
"variants": [

View File

@ -1,18 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnk_080B43F4:: @ 080B43F4
.4byte sub_08019498
.4byte sub_08019580
gUnk_080B43FC:: @ 080B43FC
.incbin "playerItemSwordBeam/gUnk_080B43FC.bin"
gUnk_080B4400:: @ 080B4400
.incbin "playerItemSwordBeam/gUnk_080B4400.bin"
gUnk_080B4408:: @ 080B4408
.incbin "playerItemSwordBeam/gUnk_080B4408.bin"

View File

@ -895,7 +895,7 @@ SECTIONS {
data/const/playerItem/playerItemGustBig.o(.rodata);
data/const/playerItem/playerItemBow.o(.rodata);
data/data_080B3E70.o(.rodata);
data/const/playerItem/playerItemSwordBeam.o(.rodata);
src/playerItem/playerItemSwordBeam.o(.rodata);
data/data_080B4410.o(.rodata);
src/playerItem/playerItemBomb.o(.rodata);
src/playerItem/playerItemBoomerang.o(.rodata);

View File

@ -7,27 +7,30 @@
#include "common.h"
#include "asm.h"
extern void (*const gUnk_080B43F4[])(Entity*);
extern Hitbox gUnk_080B4408;
extern u8 gUnk_080B43FC[];
void sub_08019498(Entity*);
void sub_08019580(Entity*);
extern u8 gUnk_08003E44;
void sub_08019644(Entity*);
extern u8 gUnk_080B4400[];
extern u8 gUnk_08003E44;
void PlayerItemSwordBeam(Entity* this) {
gUnk_080B43F4[this->action](this);
static void (*const actionFuncs[])(Entity*) = {
sub_08019498,
sub_08019580,
};
actionFuncs[this->action](this);
}
static const u8 gUnk_080B43FC[] = { 30, 29, 30, 29 };
static const u8 gUnk_080B4400[] = { 0, 4, 1, 2, -1, 0, 0, 0 };
void sub_08019498(Entity* this) {
static const Hitbox gUnk_080B4408 = { 0, 0, { 4, 0, 0, 0 }, 6, 6 };
CopyPosition(&gPlayerEntity, this);
this->action += 0x01;
this->spriteSettings.draw = 1;
this->collisionFlags = gPlayerEntity.collisionFlags + 1;
this->hitbox = &gUnk_080B4408;
this->hitbox = (Hitbox*)&gUnk_080B4408;
this->speed = 0x380;
*(u32*)&this->field_0x74 = 2;
this->field_0x70.WORD = 0;