summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Willems (M17.1) <progreon@gmail.com>2018-01-07 01:47:42 +0100
committerMarco Willems (M17.1) <progreon@gmail.com>2018-01-07 01:47:42 +0100
commitdbcd5075b036cdd700cdff2b863e9884037ddfca (patch)
tree6ae6920555e72c315050c674f587f4b4c1390145
parent680d3fd7b980578024226eccffe2e01072826227 (diff)
Split battle_anim_81258BC.s and decompile unused
-rw-r--r--Makefile2
-rw-r--r--asm/battle_anim_sfx.s (renamed from asm/battle_anim_81258BC.s)55
-rw-r--r--ld_script.txt6
-rw-r--r--src/battle/anim/sfx.c2
-rw-r--r--src/unused/unused_8124F94.c (renamed from src/unused_8124F94.c)0
-rw-r--r--src/unused/unused_81258BC.c36
6 files changed, 43 insertions, 58 deletions
diff --git a/Makefile b/Makefile
index c1f6a6b4f..275df021e 100644
--- a/Makefile
+++ b/Makefile
@@ -41,7 +41,7 @@ VERSIONS := ruby sapphire ruby_rev1 sapphire_rev1 ruby_rev2 sapphire_rev2 ruby_d
$(VERSIONS) $(VERSIONS:%=compare_%)
-$(shell mkdir -p build/ $(VERSIONS:%=build/%/{,asm,data,src{,/battle{,/anim},/field,/debug,/scene,/pokemon,/engine,/libs}}))
+$(shell mkdir -p build/ $(VERSIONS:%=build/%/{,asm,data,src{,/battle{,/anim},/field,/debug,/scene,/pokemon,/engine,/libs,/unused}}))
C_SRCS := $(shell find src -iname "*.c")
ASM_SRCS := $(wildcard asm/*.s)
diff --git a/asm/battle_anim_81258BC.s b/asm/battle_anim_sfx.s
index 2c19ad731..520c119cb 100644
--- a/asm/battle_anim_81258BC.s
+++ b/asm/battle_anim_sfx.s
@@ -4,61 +4,6 @@
.syntax unified
.text
-
- thumb_func_start unref_sub_812AECC
-unref_sub_812AECC: @ 812AECC
- push {lr}
- bl RunMysteryEventScript
- lsls r0, 24
- lsrs r0, 24
- adds r1, r0, 0
- cmp r0, 0x1
- beq _0812AEEA
- cmp r0, 0x1
- ble _0812AF08
- cmp r1, 0x2
- beq _0812AEF4
- cmp r1, 0x3
- beq _0812AEFA
- b _0812AF08
-_0812AEEA:
- movs r0, 0x16
- bl PlaySE
- movs r0, 0x1
- b _0812AF0A
-_0812AEF4:
- bl sub_812AF10
- b _0812AF08
-_0812AEFA:
- movs r0, 0x16
- bl PlaySE
- bl sub_812AF10
- movs r0, 0x1
- b _0812AF0A
-_0812AF08:
- movs r0, 0
-_0812AF0A:
- pop {r1}
- bx r1
- thumb_func_end unref_sub_812AECC
-
- thumb_func_start sub_812AF10
-sub_812AF10: @ 812AF10
- push {lr}
- movs r0, 0x2
- movs r1, 0xE
- movs r2, 0x1B
- movs r3, 0x13
- bl MenuDrawTextWindow
- ldr r0, _0812AF2C @ =gStringVar4
- movs r1, 0x3
- movs r2, 0xF
- bl MenuPrint
- pop {r0}
- bx r0
- .align 2, 0
-_0812AF2C: .4byte gStringVar4
- thumb_func_end sub_812AF10
thumb_func_start sub_812AF30
sub_812AF30: @ 812AF30
diff --git a/ld_script.txt b/ld_script.txt
index 9a2cbe4e5..b2d17b5ec 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -350,12 +350,14 @@ SECTIONS {
src/scene/cable_car.o(.text);
asm/roulette_util.o(.text);
src/engine/cable_car_util.o(.text);
- src/unused_8124F94.o(.text);
+ src/unused/unused_8124F94.o(.text);
src/engine/save.o(.text);
src/engine/mystery_event_script.o(.text);
src/field/field_effect_helpers.o(.text);
asm/contest_ai.o(.text);
- asm/battle_anim_81258BC.o(.text);
+ src/unused/unused_81258BC.o(.text);
+ src/battle/anim/sfx.o(.text);
+ asm/battle_anim_sfx.o(.text);
src/battle/battle_controller_safari.o(.text);
src/field/fldeff_sweetscent.o(.text);
asm/battle_anim_812C144.o(.text);
diff --git a/src/battle/anim/sfx.c b/src/battle/anim/sfx.c
new file mode 100644
index 000000000..265271ac5
--- /dev/null
+++ b/src/battle/anim/sfx.c
@@ -0,0 +1,2 @@
+#include "global.h"
+
diff --git a/src/unused_8124F94.c b/src/unused/unused_8124F94.c
index 5f76fa92e..5f76fa92e 100644
--- a/src/unused_8124F94.c
+++ b/src/unused/unused_8124F94.c
diff --git a/src/unused/unused_81258BC.c b/src/unused/unused_81258BC.c
new file mode 100644
index 000000000..c509ea4c9
--- /dev/null
+++ b/src/unused/unused_81258BC.c
@@ -0,0 +1,36 @@
+#include "constants/songs.h"
+#include "global.h"
+#include "menu.h"
+#include "mystery_event_script.h"
+#include "sound.h"
+#include "text.h"
+
+void sub_812AF10(void);
+
+bool8 unref_sub_812AECC(u8 *script)
+{
+ u8 result = RunMysteryEventScript(script);
+ switch (result)
+ {
+ case 0:
+ return FALSE;
+ case 1:
+ PlaySE(SE_BOO);
+ return TRUE;
+ case 2:
+ sub_812AF10();
+ return FALSE;
+ case 3:
+ PlaySE(SE_BOO);
+ sub_812AF10();
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+void sub_812AF10(void)
+{
+ MenuDrawTextWindow(2, 14, 27, 19);
+ MenuPrint(gStringVar4, 3, 15);
+} \ No newline at end of file