From 71ae3b07ea560601a3cddad9ab1eae7beedcf9ee Mon Sep 17 00:00:00 2001 From: theo3 Date: Tue, 16 Feb 2021 16:44:58 -0800 Subject: [PATCH] move playerItem table to C --- data/playerItemFunctions.s | 61 -------------------------------------- linker.ld | 2 +- src/playerItem.c | 49 ++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 62 deletions(-) delete mode 100644 data/playerItemFunctions.s create mode 100644 src/playerItem.c diff --git a/data/playerItemFunctions.s b/data/playerItemFunctions.s deleted file mode 100644 index 5626573b..00000000 --- a/data/playerItemFunctions.s +++ /dev/null @@ -1,61 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - - gPlayerItemFunctions:: @ gPlayerItemFunctions -@ replacing .incbin "baserom.gba", 0x000b2ce8, 0x64 -/*0x00*/ .4byte DeleteEntity -/*0x01*/ .4byte sub_080A7544 -/*0x02*/ .4byte sub_0801B188 -/*0x03*/ .4byte sub_0801B45C -/*0x04*/ .4byte sub_08018FCC -/*0x05*/ .4byte sub_080A2D74 -/*0x06*/ .4byte sub_08054A40 -/*0x07*/ .4byte sub_08056330 -/*0x08*/ .4byte sub_080ADA30 -/*0x09*/ .4byte sub_080704BC -/*0x0a*/ .4byte DeleteEntity -/*0x0b*/ .4byte DeleteEntity -/*0x0c*/ .4byte sub_0801B898 -/*0x0d*/ .4byte CellOverwriteSet -/*0x0e*/ .4byte SwordSpin -/*0x0f*/ .4byte SwordBeam -/*0x10*/ .4byte sub_080ACBCC -/*0x11*/ .4byte Item11 -/*0x12*/ .4byte sub_080700E8 -/*0x13*/ .4byte sub_080ACF14 -/*0x14*/ .4byte Item14 -/*0x15*/ .4byte sub_080A306C -/*0x16*/ .4byte SwordBeam -/*0x17*/ .4byte NulledItem -/*0x18*/ .4byte CellOverwriteSet - -/* -.4byte DeleteEntity -.4byte sub_080A7544 -.4byte sub_0801B188 -.4byte sub_0801B45C -.4byte sub_08018FCC -.4byte sub_080A2D74 -.4byte sub_08054A40 -.4byte sub_08056330 -.4byte sub_080ADA30 -.4byte sub_080704BC -.4byte DeleteEntity -.4byte DeleteEntity -.4byte sub_0801B898 -.4byte CellOverwriteSet -.4byte SwordSpin -.4byte SwordBeam -.4byte sub_080ACBCC -.4byte Item11 -.4byte sub_080700E8 -.4byte sub_080ACF14 -.4byte Item14 -.4byte sub_080A306C -.4byte SwordBeam -.4byte NulledItem -.4byte CellOverwriteSet -*/ diff --git a/linker.ld b/linker.ld index 3c359d8e..0a354d34 100644 --- a/linker.ld +++ b/linker.ld @@ -906,7 +906,7 @@ SECTIONS { asm/intr.o(.text); /* data */ data/data_080B2A70.o(.rodata); - data/playerItemFunctions.o(.rodata); + src/playerItem.o(.rodata); src/object.o(.rodata); src/manager.o(.rodata); src/npc.o(.rodata); diff --git a/src/playerItem.c b/src/playerItem.c new file mode 100644 index 00000000..97c37c23 --- /dev/null +++ b/src/playerItem.c @@ -0,0 +1,49 @@ +extern void DeleteEntity(); +extern void sub_080A7544(); +extern void sub_0801B188(); +extern void sub_0801B45C(); +extern void sub_08018FCC(); +extern void sub_080A2D74(); +extern void sub_08054A40(); +extern void sub_08056330(); +extern void sub_080ADA30(); +extern void sub_080704BC(); +extern void sub_0801B898(); +extern void CellOverwriteSet(); +extern void SwordSpin(); +extern void SwordBeam(); +extern void sub_080ACBCC(); +extern void Item11(); +extern void sub_080700E8(); +extern void sub_080ACF14(); +extern void Item14(); +extern void sub_080A306C(); +extern void NulledItem(); + +void (*const gPlayerItemFunctions[])() = { + DeleteEntity, + sub_080A7544, + sub_0801B188, + sub_0801B45C, + sub_08018FCC, + sub_080A2D74, + sub_08054A40, + sub_08056330, + sub_080ADA30, + sub_080704BC, + DeleteEntity, + DeleteEntity, + sub_0801B898, + CellOverwriteSet, + SwordSpin, + SwordBeam, + sub_080ACBCC, + Item11, + sub_080700E8, + sub_080ACF14, + Item14, + sub_080A306C, + SwordBeam, + NulledItem, + CellOverwriteSet +};