From 515459d151bcc9b4f046a93a77e8e9412a2f2ca4 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 13 Nov 2017 01:04:31 -0500 Subject: [PATCH] through sub_800B4C0 --- asm/link.s | 46 ---------------------------------------------- src/link.c | 30 +++++++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 49 deletions(-) diff --git a/asm/link.s b/asm/link.s index 9a617995f..6c7b3ff4a 100644 --- a/asm/link.s +++ b/asm/link.s @@ -5,52 +5,6 @@ .text - thumb_func_start sub_800B488 -sub_800B488: @ 800B488 - push {lr} - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - bne _0800B498 - ldr r1, =gWirelessCommType - movs r0, 0x1 - strb r0, [r1] -_0800B498: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B488 - - thumb_func_start sub_800B4A4 -sub_800B4A4: @ 800B4A4 - push {lr} - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r1, [r0] - cmp r1, 0 - bne _0800B4B2 - ldr r0, =gWirelessCommType - strb r1, [r0] -_0800B4B2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B4A4 - - thumb_func_start sub_800B4C0 -sub_800B4C0: @ 800B4C0 - push {lr} - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r1, [r0] - cmp r1, 0 - bne _0800B4CE - ldr r0, =gWirelessCommType - strb r1, [r0] -_0800B4CE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B4C0 - thumb_func_start sub_800B4DC sub_800B4DC: @ 800B4DC push {lr} diff --git a/src/link.c b/src/link.c index ecaeafd97..44d96937e 100644 --- a/src/link.c +++ b/src/link.c @@ -151,9 +151,9 @@ static void sub_800AE30(void); static void sub_800AE5C(void); static void sub_800AEB4(void); static void sub_800B1A0(void); -u8 sub_800B2F8(void); +static bool8 sub_800B2F8(void); u32 sub_800B638(bool8 *shouldAdvanceLinkState, u16 *sendCmd, u16 (*recvCmds)[8]); -void sub_800B4A4(void); +static void sub_800B4A4(void); void DisableSerial(void); void EnableSerial(void); @@ -1767,7 +1767,7 @@ bool8 sub_800B2E8(void) return (REG_SIOCNT & 0x04) != 0; } -bool8 sub_800B2F8(void) +static bool8 sub_800B2F8(void) { return (REG_SIOCNT & 0x8) && !(REG_SIOCNT & 0x04); } @@ -1842,3 +1842,27 @@ bool8 HandleLinkConnection(void) } return FALSE; } + +void sub_800B488(void) +{ + if (gReceivedRemoteLinkPlayers == 0) + { + gWirelessCommType = 1; + } +} + +static void sub_800B4A4(void) +{ + if (gReceivedRemoteLinkPlayers == 0) + { + gWirelessCommType = 0; + } +} + +void sub_800B4C0(void) +{ + if (gReceivedRemoteLinkPlayers == 0) + { + gWirelessCommType = 0; + } +}