summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscnorton <scnorton@biociphers.org>2017-05-31 10:12:55 -0400
committerscnorton <scnorton@biociphers.org>2017-05-31 10:12:55 -0400
commit18e060cd532fbe5678d08dd1a1386ae0763f6fc1 (patch)
tree58b6206d0353470ac238be15675c325aadf04ebb
parent859a04c318904a3894896c0c66f47def453df858 (diff)
Start to decompile use_pokeblock.s
-rw-r--r--asm/use_pokeblock.s31
-rw-r--r--include/pokenav.h31
-rw-r--r--include/use_pokeblock.h8
-rw-r--r--ld_script.txt1
-rw-r--r--src/pokenav.c17
-rw-r--r--src/use_pokeblock.c26
6 files changed, 67 insertions, 47 deletions
diff --git a/asm/use_pokeblock.s b/asm/use_pokeblock.s
index a9913b6d0..ba7001051 100644
--- a/asm/use_pokeblock.s
+++ b/asm/use_pokeblock.s
@@ -6,37 +6,6 @@
.text
- thumb_func_start sub_8136130
-sub_8136130: @ 8136130
- push {r4,r5,lr}
- ldr r4, _0813615C @ =gUnknown_02039304
- ldr r2, _08136160 @ =gUnknown_083DFEC4
- ldr r3, [r2]
- ldr r5, _08136164 @ =0x0000d164
- adds r2, r3, r5
- str r2, [r4]
- str r0, [r2, 0x8]
- str r1, [r2, 0x4]
- ldr r0, _08136168 @ =0x0000d162
- adds r3, r0
- movs r0, 0x2
- strb r0, [r3]
- ldr r0, _0813616C @ =sub_8136294
- bl launch_c3_walk_stairs_and_run_once
- ldr r0, _08136170 @ =sub_8136244
- bl SetMainCallback2
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_0813615C: .4byte gUnknown_02039304
-_08136160: .4byte gUnknown_083DFEC4
-_08136164: .4byte 0x0000d164
-_08136168: .4byte 0x0000d162
-_0813616C: .4byte sub_8136294
-_08136170: .4byte sub_8136244
- thumb_func_end sub_8136130
-
thumb_func_start sub_8136174
sub_8136174: @ 8136174
push {r4,r5,lr}
diff --git a/include/pokenav.h b/include/pokenav.h
new file mode 100644
index 000000000..df7d73b75
--- /dev/null
+++ b/include/pokenav.h
@@ -0,0 +1,31 @@
+//
+// Created by Scott Norton on 5/31/17.
+//
+
+#ifndef POKERUBY_POKENAV_H
+#define POKERUBY_POKENAV_H
+
+struct UnkPokenavStruct_Sub {
+ /*0x0*/ u16 unk0;
+ /*0x2*/ u8 filler2[6];
+};
+
+struct UnkPokenavStruct_Sub1 {
+ /*0x0*/ u32 unk0;
+ /*0x1*/ u32 unk4;
+ /*0x2*/ u32 unk8;
+};
+
+struct UnkPokenavStruct {
+ /*0x0000*/ u8 filler0000[0xCEE8];
+ /*0xCEE8*/ struct UnkPokenavStruct_Sub unkCEE8[78];
+ /*0xD158*/ u16 unkD158;
+ /*0xd15a*/ u8 fillerD15A[8];
+ /*0xd162*/ u8 unkD162[2];
+ /*0xd164*/ struct UnkPokenavStruct_Sub1 unkD164;
+};
+
+extern struct UnkPokenavStruct *gUnknown_083DFEC4;
+
+
+#endif //POKERUBY_POKENAV_H
diff --git a/include/use_pokeblock.h b/include/use_pokeblock.h
new file mode 100644
index 000000000..ca999e0ed
--- /dev/null
+++ b/include/use_pokeblock.h
@@ -0,0 +1,8 @@
+//
+// Created by Scott Norton on 5/31/17.
+//
+
+#ifndef POKERUBY_USE_POKEBLOCK_H
+#define POKERUBY_USE_POKEBLOCK_H
+
+#endif //POKERUBY_USE_POKEBLOCK_H
diff --git a/ld_script.txt b/ld_script.txt
index cae32faa2..cca808e89 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -258,6 +258,7 @@ SECTIONS {
asm/decoration_inventory.o(.text);
src/roamer.o(.text);
asm/battle_tower.o(.text);
+ src/use_pokeblock.o(.text);
asm/use_pokeblock.o(.text);
asm/battle_anim_8137220.o(.text);
src/player_pc.o(.text);
diff --git a/src/pokenav.c b/src/pokenav.c
index f50f039f8..4d1ecf421 100644
--- a/src/pokenav.c
+++ b/src/pokenav.c
@@ -1,24 +1,9 @@
#include "global.h"
#include "battle.h"
#include "data2.h"
+#include "pokenav.h"
#include "string_util.h"
-struct UnkPokenavStruct_Sub {
- /*0x0*/ u16 unk0;
- /*0x2*/ u8 filler2[6];
-};
-
-
-struct UnkPokenavStruct {
- /*0x0000*/ u8 filler0000[0xCEE8];
- /*0xCEE8*/ struct UnkPokenavStruct_Sub unkCEE8[78];
- /*0xD158*/ u16 unkD158;
-
-};
-
-extern struct UnkPokenavStruct *gUnknown_083DFEC4;
-
-
void sub_80F700C(u8 *arg0, u16 arg1) {
struct Trainer *trainer;
u8 *ptr;
diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c
new file mode 100644
index 000000000..78415cbd7
--- /dev/null
+++ b/src/use_pokeblock.c
@@ -0,0 +1,26 @@
+//
+// Created by Scott Norton on 5/31/17.
+//
+
+#include "global.h"
+#include "main.h"
+#include "pokemon.h"
+#include "pokenav.h"
+#include "use_pokeblock.h"
+
+asm(".text");
+
+extern struct UnkPokenavStruct_Sub1 *gUnknown_02039304;
+void launch_c3_walk_stairs_and_run_once(void *);
+void sub_8136244(void);
+void sub_8136294(void);
+
+void sub_8136130(u32 a0, u32 a1)
+{
+ gUnknown_02039304 = &gUnknown_083DFEC4->unkD164;
+ gUnknown_02039304->unk8 = a0;
+ gUnknown_02039304->unk4 = a1;
+ gUnknown_083DFEC4->unkD162[0] = 2;
+ launch_c3_walk_stairs_and_run_once(sub_8136294);
+ SetMainCallback2(sub_8136244);
+}