DisableSerial

This commit is contained in:
PikalaxALT 2017-11-13 01:20:38 -05:00
parent fcb8c8cf32
commit 910c39d4ef
3 changed files with 13 additions and 37 deletions

View File

@ -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}

View File

@ -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

View File

@ -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));
}