summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2017-04-30 18:17:07 -0700
committerYamaArashi <shadow962@live.com>2017-04-30 18:17:07 -0700
commit0b491add8e7e9bdabb3f08f26d28eb0b70b67956 (patch)
tree004875bbbea8672c71258b6c02bd8f9cb1d03936
parent500ce71ff42e0ecf067a819edab0ddb6e2d63cd7 (diff)
define item_use data in C
-rw-r--r--data/item_use.s46
-rw-r--r--data/rotating_gate.s15
-rw-r--r--ld_script.txt2
-rw-r--r--src/item_use.c41
4 files changed, 51 insertions, 53 deletions
diff --git a/data/item_use.s b/data/item_use.s
deleted file mode 100644
index c4ab824a5..000000000
--- a/data/item_use.s
+++ /dev/null
@@ -1,46 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .section .rodata
-
- .align 2
-gUnknown_083D613C:: @ 83D613C
- .byte 1, 0, 1, 0, 0, 0, 0, 0
- .byte 1, 1, 1, 0, 0, 0, 0, 0
- .byte 1, 0, 1, 1, 0, 0, 0, 0
- .byte 1, 1, 1, 1, 0, 0, 0, 0
- .byte 1, 0, 1, 0, 1, 0, 0, 0
- .byte 1, 1, 1, 0, 1, 0, 0, 0
- .byte 1, 0, 1, 1, 1, 0, 0, 0
- .byte 1, 0, 1, 0, 1, 1, 0, 0
- .byte 1, 1, 1, 1, 1, 0, 0, 0
- .byte 1, 1, 1, 0, 1, 1, 0, 0
- .byte 1, 0, 1, 1, 1, 1, 0, 0
- .byte 1, 1, 1, 1, 1, 1, 0, 0
-
-Unknown_83D619C::
- .string "この チケットで ふねに のりほうだい\n"
- .string "はやく のってみたいな$"
-
-Unknown_83D61BC::
- .string "この チケットで ふねに のりほうだい\n"
- .string "はやく のってみたいな$"
-
- .align 2
-gUnknown_083D61DC:: @ 83D61DC
- .4byte Unknown_83D619C
- .4byte Unknown_83D61BC
-
- .align 2
-gExitToOverworldFuncList:: @ 83D61E4
- .4byte sub_808B020
- .4byte c2_exit_to_overworld_2_switch
- .4byte sub_810B96C
-
-gItemFinderDirections:: @ 83D61F0
- .byte DIR_NORTH, DIR_EAST, DIR_SOUTH, DIR_WEST
-
- .align 2
-gUnknown_083D61F4:: @ 83D61F4
- .4byte sub_80C9FC0
- .4byte CleanUpItemMenuMessage
diff --git a/data/rotating_gate.s b/data/rotating_gate.s
index 05993ddd3..06cc64e51 100644
--- a/data/rotating_gate.s
+++ b/data/rotating_gate.s
@@ -294,3 +294,18 @@ gUnknown_083D611C:: @ 83D611C
.byte 0, 1, 0, 0
.byte -1, 0, 0, 0
.byte -2, 0, 0, 0
+
+ .align 2
+gUnknown_083D613C:: @ 83D613C
+ .byte 1, 0, 1, 0, 0, 0, 0, 0
+ .byte 1, 1, 1, 0, 0, 0, 0, 0
+ .byte 1, 0, 1, 1, 0, 0, 0, 0
+ .byte 1, 1, 1, 1, 0, 0, 0, 0
+ .byte 1, 0, 1, 0, 1, 0, 0, 0
+ .byte 1, 1, 1, 0, 1, 0, 0, 0
+ .byte 1, 0, 1, 1, 1, 0, 0, 0
+ .byte 1, 0, 1, 0, 1, 1, 0, 0
+ .byte 1, 1, 1, 1, 1, 0, 0, 0
+ .byte 1, 1, 1, 0, 1, 1, 0, 0
+ .byte 1, 0, 1, 1, 1, 1, 0, 0
+ .byte 1, 1, 1, 1, 1, 1, 0, 0
diff --git a/ld_script.txt b/ld_script.txt
index c5c665163..6d21f6442 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -405,7 +405,7 @@ SECTIONS {
src/field_special_scene.o(.rodata);
data/field_special_scene.o(.rodata);
data/rotating_gate.o(.rodata);
- data/item_use.o(.rodata);
+ src/item_use.o(.rodata);
data/battle_anim_80CA710.o(.rodata);
src/bike.o(.rodata);
data/easy_chat.o(.rodata);
diff --git a/src/item_use.c b/src/item_use.c
index 4fcf8d2c1..5c485bb11 100644
--- a/src/item_use.c
+++ b/src/item_use.c
@@ -23,13 +23,9 @@
#include "task.h"
#include "vars.h"
-extern void (* const gExitToOverworldFuncList[])();
extern void (* gUnknown_03005D00)(u8);
extern void (* gUnknown_0300485C)(void);
extern void (* gUnknown_03004AE4)(u8);
-extern void (* const gUnknown_083D61F4[])();
-
-extern u8 *gUnknown_083D61DC[];
extern u8 gMoveNames[][13];
@@ -37,7 +33,6 @@ extern u8 gUnknown_02038561;
extern u8 gLastFieldPokeMenuOpened;
extern u8 gUnknown_02024E6C;
-extern u8 gItemFinderDirections[];
extern u8 gUnknown_081A1654[];
extern u8 gUnknown_081A168F[];
@@ -45,7 +40,7 @@ extern u16 gUnknown_02024A6A[];
extern void HandleItemMenuPaletteFade(u8);
extern void ExecuteItemUseFromBlackPalette(void);
-extern void DisplayItemMessageOnField(u8, u8*, TaskFunc, u16);
+extern void DisplayItemMessageOnField(u8, const u8 *, TaskFunc, u16);
extern void CleanUpItemMenuMessage(u8);
extern void CleanUpOverworldMessage(u8);
extern void ItemUseOnFieldCB_Bike(u8);
@@ -75,6 +70,8 @@ extern bool8 ExecuteTableBasedItemEffect_(struct Pokemon *mon, u16, u8, u16);
extern void sub_8094E4C(void);
extern u8 ExecuteTableBasedItemEffect__(u8 u8, u16 u16, int i);
extern u8 GetItemEffectType();
+extern void sub_808B020(void);
+extern void sub_810B96C(void);
extern u8 gOtherText_DadsAdvice[];
extern u8 gOtherText_CantGetOffBike[];
@@ -110,10 +107,42 @@ void sub_80C9D74(u8);
void sub_80C9EE4(u8);
void sub_80C9F10(u8);
void sub_80C9F80(u8);
+void sub_80C9FC0(u8);
void ItemUseOutOfBattle_TMHM(u8);
void ItemUseOutOfBattle_EvolutionStone(u8);
void ItemUseOutOfBattle_CannotUse(u8);
+static const u8 Unknown_83D619C[] = _(
+ "この チケットで ふねに のりほうだい\n"
+ "はやく のってみたいな"
+);
+
+static const u8 Unknown_83D61BC[] = _(
+ "この チケットで ふねに のりほうだい\n"
+ "はやく のってみたいな"
+);
+
+static const u8 *const gUnknown_083D61DC[] =
+{
+ Unknown_83D619C,
+ Unknown_83D61BC,
+};
+
+static void (* const gExitToOverworldFuncList[])(void) =
+{
+ sub_808B020,
+ c2_exit_to_overworld_2_switch,
+ sub_810B96C,
+};
+
+static const u8 gItemFinderDirections[] = { DIR_NORTH, DIR_EAST, DIR_SOUTH, DIR_WEST };
+
+static void (* const gUnknown_083D61F4[])(u8) =
+{
+ sub_80C9FC0,
+ CleanUpItemMenuMessage,
+};
+
void ExecuteSwitchToOverworldFromItemUse(u8 taskId)
{
u8 taskData;