mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
DisableSerial
This commit is contained in:
parent
fcb8c8cf32
commit
910c39d4ef
35
asm/link.s
35
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}
|
||||
|
@ -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
|
||||
|
11
src/link.c
11
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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user