mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
through sub_8010A70
This commit is contained in:
parent
95d77c25f3
commit
ef412145d0
101
asm/link_rfu.s
101
asm/link_rfu.s
@ -5,107 +5,6 @@
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_80109E8
|
||||
sub_80109E8: @ 80109E8
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 16
|
||||
lsrs r2, r0, 16
|
||||
movs r1, 0
|
||||
movs r5, 0x1
|
||||
ldr r4, =gUnknown_03005000+0xCDE
|
||||
movs r3, 0
|
||||
_080109F6:
|
||||
adds r0, r2, 0
|
||||
asrs r0, r1
|
||||
ands r0, r5
|
||||
cmp r0, 0
|
||||
beq _08010A04
|
||||
adds r0, r1, r4
|
||||
strb r3, [r0]
|
||||
_08010A04:
|
||||
adds r1, 0x1
|
||||
cmp r1, 0x3
|
||||
ble _080109F6
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80109E8
|
||||
|
||||
thumb_func_start sub_8010A14
|
||||
sub_8010A14: @ 8010A14
|
||||
push {r4-r7,lr}
|
||||
adds r2, r0, 0
|
||||
ldr r1, =gUnknown_03005000
|
||||
ldrb r0, [r2, 0xF]
|
||||
strb r0, [r1, 0xD]
|
||||
movs r4, 0
|
||||
ldr r0, =0x00000cde
|
||||
adds r5, r1, r0
|
||||
adds r3, r2, 0
|
||||
adds r3, 0x10
|
||||
_08010A28:
|
||||
adds r0, r4, r5
|
||||
adds r1, r3, r4
|
||||
ldrb r1, [r1]
|
||||
strb r1, [r0]
|
||||
adds r4, 0x1
|
||||
cmp r4, 0x3
|
||||
ble _08010A28
|
||||
adds r6, r2, 0
|
||||
ldr r5, =gLinkPlayers
|
||||
movs r4, 0x4
|
||||
_08010A3C:
|
||||
adds r0, r5, 0
|
||||
adds r1, r6, 0
|
||||
adds r1, 0x14
|
||||
ldm r1!, {r2,r3,r7}
|
||||
stm r0!, {r2,r3,r7}
|
||||
ldm r1!, {r2,r3,r7}
|
||||
stm r0!, {r2,r3,r7}
|
||||
ldr r1, [r1]
|
||||
str r1, [r0]
|
||||
adds r0, r5, 0
|
||||
bl sub_800B524
|
||||
adds r6, 0x1C
|
||||
adds r5, 0x1C
|
||||
subs r4, 0x1
|
||||
cmp r4, 0
|
||||
bge _08010A3C
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8010A14
|
||||
|
||||
thumb_func_start sub_8010A70
|
||||
sub_8010A70: @ 8010A70
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x4
|
||||
adds r4, r0, 0
|
||||
ldr r0, =gUnknown_082ED7EC
|
||||
adds r1, r4, 0
|
||||
bl strcmp
|
||||
adds r5, r0, 0
|
||||
cmp r5, 0
|
||||
bne _08010A9C
|
||||
adds r0, r4, 0
|
||||
bl sub_8010A14
|
||||
mov r0, sp
|
||||
strh r5, [r0]
|
||||
ldr r2, =0x0100007e
|
||||
adds r1, r4, 0
|
||||
bl CpuSet
|
||||
movs r0, 0
|
||||
bl ResetBlockReceivedFlag
|
||||
_08010A9C:
|
||||
add sp, 0x4
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8010A70
|
||||
|
||||
thumb_func_start sub_8010AAC
|
||||
sub_8010AAC: @ 8010AAC
|
||||
push {r4-r7,lr}
|
||||
|
@ -203,6 +203,14 @@ struct UnkRfuStruct_2 {
|
||||
/* 0xcee */ u8 unk_cee[4];
|
||||
}; // size = 0xcf4
|
||||
|
||||
struct UnkRfuStruct_8010A14 {
|
||||
char unk_00[15];
|
||||
u8 unk_0f;
|
||||
u8 unk_10[4];
|
||||
struct LinkPlayer unk_14[4];
|
||||
u8 fill_84[0x78];
|
||||
};
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
extern struct UnkRfuStruct_1 gUnknown_03004140;
|
||||
|
@ -26,8 +26,8 @@
|
||||
#include "sound.h"
|
||||
#include "trade.h"
|
||||
#include "battle.h"
|
||||
#include "link_rfu.h"
|
||||
#include "link.h"
|
||||
#include "link_rfu.h"
|
||||
|
||||
// Static type declarations
|
||||
|
||||
|
@ -4280,3 +4280,37 @@ void sub_801084C(u8 taskId)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80109E8(u16 a0)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if ((a0 >> i) & 1)
|
||||
gUnknown_03005000.unk_cde[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8010A14(const struct UnkRfuStruct_8010A14 *a0)
|
||||
{
|
||||
int i;
|
||||
gUnknown_03005000.playerCount = a0->unk_0f;
|
||||
for (i = 0; i < 4; i++)
|
||||
gUnknown_03005000.unk_cde[i] = a0->unk_10[i];
|
||||
for (i = 0; i < MAX_RFU_PLAYERS; i++)
|
||||
{
|
||||
gLinkPlayers[i] = a0->unk_14[i];
|
||||
sub_800B524(gLinkPlayers + i);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8010A70(void *a0)
|
||||
{
|
||||
if (strcmp(gUnknown_082ED7EC, a0) == 0)
|
||||
{
|
||||
sub_8010A14(a0);
|
||||
CpuFill16(0, a0, sizeof(struct UnkRfuStruct_8010A14));
|
||||
ResetBlockReceivedFlag(0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user