summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/link.s35
-rw-r--r--include/link.h4
-rw-r--r--src/link.c11
3 files changed, 13 insertions, 37 deletions
diff --git a/asm/link.s b/asm/link.s
index c1e8a4904..68b29166c 100644
--- a/asm/link.s
+++ b/asm/link.s
@@ -5,41 +5,6 @@
.text
- thumb_func_start DisableSerial
-DisableSerial: @ 800B53C
- push {lr}
- sub sp, 0x4
- movs r0, 0xC0
- bl DisableInterrupts
- ldr r1, =0x04000128
- movs r2, 0x80
- lsls r2, 6
- adds r0, r2, 0
- strh r0, [r1]
- ldr r0, =0x0400010e
- movs r2, 0
- strh r2, [r0]
- adds r1, 0xDA
- movs r0, 0xC0
- strh r0, [r1]
- ldr r0, =0x0400012a
- strh r2, [r0]
- ldr r2, =0x04000120
- movs r0, 0
- movs r1, 0
- str r0, [r2]
- str r1, [r2, 0x4]
- str r0, [sp]
- ldr r1, =gLink
- ldr r2, =0x050003f0
- mov r0, sp
- bl CpuSet
- add sp, 0x4
- pop {r0}
- bx r0
- .pool
- thumb_func_end DisableSerial
-
thumb_func_start EnableSerial
EnableSerial: @ 800B594
push {r4,r5,lr}
diff --git a/include/link.h b/include/link.h
index edbf0be38..38c2f1388 100644
--- a/include/link.h
+++ b/include/link.h
@@ -95,9 +95,9 @@ struct LinkPlayer
struct LinkPlayerBlock
{
- u8 magic1[16];
+ char magic1[16];
struct LinkPlayer linkPlayer;
- u8 magic2[16];
+ char magic2[16];
};
// circular queues
diff --git a/src/link.c b/src/link.c
index 266c7109d..3839a0194 100644
--- a/src/link.c
+++ b/src/link.c
@@ -1895,3 +1895,14 @@ void sub_800B524(struct LinkPlayer *player)
player->name[10] = player->name[8];
ConvertInternationalString(player->name, player->language);
}
+
+void DisableSerial(void)
+{
+ DisableInterrupts(INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL);
+ REG_SIOCNT = SIO_MULTI_MODE;
+ REG_TMCNT_H(3) = 0;
+ REG_IF = INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL;
+ REG_SIOMLT_SEND = 0;
+ REG_SIOMLT_RECV = 0;
+ CpuFill32(0, &gLink, sizeof(gLink));
+}