mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-31 16:30:00 +01:00
through sub_800B3A4
This commit is contained in:
parent
8904f62cc8
commit
abec2b9340
86
asm/link.s
86
asm/link.s
@ -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}
|
||||
|
27
src/link.c
27
src/link.c
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user