summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2020-08-16 18:18:55 -0700
committertheo3 <arisstephenson2@gmail.com>2020-08-16 18:18:55 -0700
commitfc71c983d06a7cb18e5de4dfd3f19b30d25c210d (patch)
treea987825e1757d4d47ee94bfbb5be94cc19a97472
parent2d2f371f223ad444aa4b4ccbbd054ad525ba3000 (diff)
split unrelated code
-rw-r--r--asm/code_080300AC.s101
-rw-r--r--asm/wizzrobeIce.s131
-rw-r--r--include/structures.h1
-rw-r--r--linker.ld2
-rw-r--r--src/code_080300AC.c25
5 files changed, 130 insertions, 130 deletions
diff --git a/asm/code_080300AC.s b/asm/code_080300AC.s
new file mode 100644
index 00000000..9533deb0
--- /dev/null
+++ b/asm/code_080300AC.s
@@ -0,0 +1,101 @@
+ .include "asm/macros.inc"
+
+ .include "constants/constants.inc"
+
+ .syntax unified
+
+ .text
+
+ thumb_func_start sub_080300E8
+sub_080300E8: @ 0x080300E8
+ push {lr}
+ ldr r1, _08030110 @ =gScreenTransition
+ adds r3, r1, #0
+ adds r3, #0xae
+ ldrh r0, [r3]
+ cmp r0, #0xff
+ beq _0803010C
+ lsls r0, r0, #2
+ adds r1, #0x6c
+ adds r0, r0, r1
+ ldr r2, _08030114 @ =gPlayerEntity
+ ldrh r1, [r0]
+ strh r1, [r2, #0x2e]
+ ldrh r0, [r0, #2]
+ adds r0, #0xc
+ strh r0, [r2, #0x32]
+ movs r0, #0xff
+ strh r0, [r3]
+_0803010C:
+ pop {pc}
+ .align 2, 0
+_08030110: .4byte gScreenTransition
+_08030114: .4byte gPlayerEntity
+
+ thumb_func_start sub_08030118
+sub_08030118: @ 0x08030118
+ push {lr}
+ adds r2, r0, #0
+ ldr r0, _0803013C @ =gScreenTransition
+ adds r0, #0xac
+ ldrh r0, [r0]
+ asrs r0, r2
+ movs r1, #1
+ ands r0, r1
+ cmp r0, #0
+ beq _08030140
+ movs r0, #0xc0
+ lsls r0, r0, #2
+ adds r1, r2, #0
+ adds r1, #0x67
+ bl SetLocalFlagByOffset
+ b _0803014C
+ .align 2, 0
+_0803013C: .4byte gScreenTransition
+_08030140:
+ movs r0, #0xc0
+ lsls r0, r0, #2
+ adds r1, r2, #0
+ adds r1, #0x67
+ bl ClearLocalFlagByOffset
+_0803014C:
+ pop {pc}
+ .align 2, 0
+
+ thumb_func_start sub_08030150
+sub_08030150: @ 0x08030150
+ push {r4, r5, lr}
+ mov ip, r0
+ ldr r2, _08030194 @ =gScreenTransition
+ adds r5, r2, #0
+ adds r5, #0xac
+ mov r3, ip
+ adds r3, #0x80
+ ldrb r4, [r3]
+ movs r0, #1
+ lsls r0, r4
+ ldrh r1, [r5]
+ bics r1, r0
+ mov r0, ip
+ adds r0, #0x84
+ ldr r0, [r0]
+ lsls r0, r4
+ orrs r1, r0
+ strh r1, [r5]
+ ldrb r0, [r3]
+ lsls r0, r0, #2
+ adds r2, #0x6c
+ adds r0, r0, r2
+ mov r4, ip
+ ldrh r1, [r4, #0x2e]
+ strh r1, [r0]
+ ldrb r0, [r3]
+ lsls r0, r0, #1
+ adds r0, #1
+ lsls r0, r0, #1
+ adds r0, r0, r2
+ ldrh r1, [r4, #0x32]
+ strh r1, [r0]
+ pop {r4, r5, pc}
+ .align 2, 0
+_08030194: .4byte gScreenTransition
diff --git a/asm/wizzrobeIce.s b/asm/wizzrobeIce.s
index 850e6675..c8cd1228 100644
--- a/asm/wizzrobeIce.s
+++ b/asm/wizzrobeIce.s
@@ -375,133 +375,4 @@ _080300A2:
adds r0, r4, #0
bl sub_0802F9C8
pop {r4, pc}
- .align 2, 0
-
- thumb_func_start sub_080300AC
-sub_080300AC: @ 0x080300AC
- push {r4, lr}
- ldr r4, _080300C0 @ =gUnk_0300110C
- adds r0, r4, #0
- movs r1, #0x44
- bl _DmaZero
- adds r4, #0x42
- movs r0, #0xff
- strh r0, [r4]
- pop {r4, pc}
- .align 2, 0
-_080300C0: .4byte gUnk_0300110C
-
- thumb_func_start sub_080300C4
-sub_080300C4: @ 0x080300C4
- push {lr}
- ldr r2, _080300E4 @ =gScreenTransition
- adds r0, r2, #0
- adds r0, #0xae
- ldrh r0, [r0]
- cmp r0, #0xff
- bne _080300E2
- adds r0, r2, #0
- adds r0, #0xac
- movs r1, #0
- strh r1, [r0]
- subs r0, #0x40
- movs r1, #0x40
- bl _DmaZero
-_080300E2:
- pop {pc}
- .align 2, 0
-_080300E4: .4byte gScreenTransition
-
- thumb_func_start sub_080300E8
-sub_080300E8: @ 0x080300E8
- push {lr}
- ldr r1, _08030110 @ =gScreenTransition
- adds r3, r1, #0
- adds r3, #0xae
- ldrh r0, [r3]
- cmp r0, #0xff
- beq _0803010C
- lsls r0, r0, #2
- adds r1, #0x6c
- adds r0, r0, r1
- ldr r2, _08030114 @ =gPlayerEntity
- ldrh r1, [r0]
- strh r1, [r2, #0x2e]
- ldrh r0, [r0, #2]
- adds r0, #0xc
- strh r0, [r2, #0x32]
- movs r0, #0xff
- strh r0, [r3]
-_0803010C:
- pop {pc}
- .align 2, 0
-_08030110: .4byte gScreenTransition
-_08030114: .4byte gPlayerEntity
-
- thumb_func_start sub_08030118
-sub_08030118: @ 0x08030118
- push {lr}
- adds r2, r0, #0
- ldr r0, _0803013C @ =gScreenTransition
- adds r0, #0xac
- ldrh r0, [r0]
- asrs r0, r2
- movs r1, #1
- ands r0, r1
- cmp r0, #0
- beq _08030140
- movs r0, #0xc0
- lsls r0, r0, #2
- adds r1, r2, #0
- adds r1, #0x67
- bl SetLocalFlagByOffset
- b _0803014C
- .align 2, 0
-_0803013C: .4byte gScreenTransition
-_08030140:
- movs r0, #0xc0
- lsls r0, r0, #2
- adds r1, r2, #0
- adds r1, #0x67
- bl ClearLocalFlagByOffset
-_0803014C:
- pop {pc}
- .align 2, 0
-
- thumb_func_start sub_08030150
-sub_08030150: @ 0x08030150
- push {r4, r5, lr}
- mov ip, r0
- ldr r2, _08030194 @ =gScreenTransition
- adds r5, r2, #0
- adds r5, #0xac
- mov r3, ip
- adds r3, #0x80
- ldrb r4, [r3]
- movs r0, #1
- lsls r0, r4
- ldrh r1, [r5]
- bics r1, r0
- mov r0, ip
- adds r0, #0x84
- ldr r0, [r0]
- lsls r0, r4
- orrs r1, r0
- strh r1, [r5]
- ldrb r0, [r3]
- lsls r0, r0, #2
- adds r2, #0x6c
- adds r0, r0, r2
- mov r4, ip
- ldrh r1, [r4, #0x2e]
- strh r1, [r0]
- ldrb r0, [r3]
- lsls r0, r0, #1
- adds r0, #1
- lsls r0, r0, #1
- adds r0, r0, r2
- ldrh r1, [r4, #0x32]
- strh r1, [r0]
- pop {r4, r5, pc}
- .align 2, 0
-_08030194: .4byte gScreenTransition
+ .align 2, 0 \ No newline at end of file
diff --git a/include/structures.h b/include/structures.h
index 32ae8d74..cc851489 100644
--- a/include/structures.h
+++ b/include/structures.h
@@ -83,6 +83,7 @@ typedef struct {
u16 field_0x4a;
u8 field_0x4c[0x60];
u16 field_0xac;
+ u16 field_0xae;
} ScreenTransition;
extern ScreenTransition gScreenTransition;
diff --git a/linker.ld b/linker.ld
index 56aabb33..0194cbca 100644
--- a/linker.ld
+++ b/linker.ld
@@ -370,6 +370,8 @@ SECTIONS {
asm/wizzrobeWind.o(.text);
asm/wizzrobeFire.o(.text);
asm/wizzrobeIce.o(.text);
+ src/code_080300AC.o(.text); /* ??? */
+ asm/code_080300AC.o(.text); /* ??? */
asm/armos.o(.text);
asm/eyegore.o(.text);
asm/rope.o(.text);
diff --git a/src/code_080300AC.c b/src/code_080300AC.c
new file mode 100644
index 00000000..785d0ca5
--- /dev/null
+++ b/src/code_080300AC.c
@@ -0,0 +1,25 @@
+#include "global.h"
+#include "entity.h"
+#include "functions.h"
+
+//extern void DmaZero(void*, u32);
+
+typedef struct {
+ u16 unk0;
+ u16 filler2[32];
+ u16 unk66;
+} struct_0300110C;
+
+extern struct_0300110C gUnk_0300110C;
+
+void sub_080300AC(void) {
+ _DmaZero(&gUnk_0300110C.unk0, 0x44);
+ gUnk_0300110C.unk66 = 0xff;
+}
+
+void sub_080300C4(void) {
+ if (gScreenTransition.field_0xae == 0xff) {
+ gScreenTransition.field_0xac = 0;
+ _DmaZero(&gScreenTransition.field_0x4c[32], 0x40);
+ }
+} \ No newline at end of file