through sub_800B3A4

This commit is contained in:
PikalaxALT 2017-11-13 00:31:27 -05:00
parent 8904f62cc8
commit abec2b9340
2 changed files with 27 additions and 86 deletions

View File

@ -5,92 +5,6 @@
.text
thumb_func_start sub_800B348
sub_800B348: @ 800B348
push {r4-r6,lr}
bl InitLocalLinkPlayer
ldr r1, =gLocalLinkPlayerBlock
adds r2, r1, 0
adds r2, 0x10
ldr r0, =gLocalLinkPlayer
ldm r0!, {r3-r5}
stm r2!, {r3-r5}
ldm r0!, {r3,r4,r6}
stm r2!, {r3,r4,r6}
ldr r0, [r0]
str r0, [r2]
ldr r3, =gASCIIGameFreakInc
adds r2, r1, 0
adds r0, r3, 0
ldm r0!, {r4-r6}
stm r2!, {r4-r6}
ldrh r4, [r0]
strh r4, [r2]
ldrb r0, [r0, 0x2]
strb r0, [r2, 0x2]
adds r0, r1, 0
adds r0, 0x2C
ldm r3!, {r2,r5,r6}
stm r0!, {r2,r5,r6}
ldrh r2, [r3]
strh r2, [r0]
ldrb r2, [r3, 0x2]
strb r2, [r0, 0x2]
ldr r0, =gBlockSendBuffer
movs r2, 0x3C
bl memcpy
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_800B348
thumb_func_start sub_800B3A4
sub_800B3A4: @ 800B3A4
push {r4-r6,lr}
lsls r0, 24
lsrs r0, 24
lsls r2, r0, 8
ldr r1, =gBlockRecvBuffer
adds r4, r2, r1
lsls r2, r0, 3
subs r2, r0
lsls r2, 2
ldr r0, =gLinkPlayers
adds r2, r0
adds r1, r2, 0
adds r0, r4, 0
adds r0, 0x10
ldm r0!, {r3,r5,r6}
stm r1!, {r3,r5,r6}
ldm r0!, {r3,r5,r6}
stm r1!, {r3,r5,r6}
ldr r0, [r0]
str r0, [r1]
adds r0, r2, 0
bl sub_800B524
ldr r5, =gASCIIGameFreakInc
adds r0, r4, 0
adds r1, r5, 0
bl strcmp
cmp r0, 0
bne _0800B3EE
adds r0, r4, 0
adds r0, 0x2C
adds r1, r5, 0
bl strcmp
cmp r0, 0
beq _0800B3F4
_0800B3EE:
ldr r0, =CB2_LinkError
bl SetMainCallback2
_0800B3F4:
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_800B3A4
thumb_func_start HandleLinkConnection
HandleLinkConnection: @ 800B40C
push {r4,r5,lr}

View File

@ -1785,3 +1785,30 @@ bool8 sub_800B33C(void)
{
return gLinkErrorOccurred;
}
void sub_800B348(void)
{
struct LinkPlayerBlock *block;
InitLocalLinkPlayer();
block = &gLocalLinkPlayerBlock;
block->linkPlayer = gLocalLinkPlayer;
memcpy(block->magic1, gASCIIGameFreakInc, sizeof(block->magic1) - 1);
memcpy(block->magic2, gASCIIGameFreakInc, sizeof(block->magic2) - 1);
memcpy(gBlockSendBuffer, block, sizeof(*block));
}
void sub_800B3A4(u8 who)
{
struct LinkPlayerBlock *block;
struct LinkPlayer *player;
block = (struct LinkPlayerBlock *)gBlockRecvBuffer[who];
player = &gLinkPlayers[who];
*player = block->linkPlayer;
sub_800B524(player);
if (strcmp(block->magic1, gASCIIGameFreakInc) != 0 || strcmp(block->magic2, gASCIIGameFreakInc) != 0)
{
SetMainCallback2(CB2_LinkError);
}
}