mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
through sub_800E604
This commit is contained in:
parent
0b58905eea
commit
92fd61d6f2
188
asm/link_rfu.s
188
asm/link_rfu.s
@ -5,194 +5,6 @@
|
||||
|
||||
.text
|
||||
|
||||
@ file boundary?
|
||||
|
||||
thumb_func_start sub_800E540
|
||||
sub_800E540: @ 800E540
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
mov r9, r1
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
mov r8, r0
|
||||
movs r7, 0
|
||||
ldr r6, =gSaveBlock1Ptr
|
||||
ldr r4, =0x00003b98
|
||||
movs r5, 0
|
||||
_0800E558:
|
||||
ldr r0, [r6]
|
||||
adds r0, r4
|
||||
adds r0, 0x4
|
||||
mov r1, r9
|
||||
bl StringCompare
|
||||
cmp r0, 0
|
||||
bne _0800E584
|
||||
ldr r0, [r6]
|
||||
ldr r1, =0x00003b98
|
||||
adds r0, r1
|
||||
adds r0, r5
|
||||
ldr r0, [r0]
|
||||
cmp r0, r8
|
||||
bne _0800E584
|
||||
movs r0, 0x1
|
||||
b _0800E59E
|
||||
.pool
|
||||
_0800E584:
|
||||
ldr r0, [r6]
|
||||
adds r0, r4
|
||||
adds r0, 0x4
|
||||
bl sub_800E388
|
||||
cmp r0, 0
|
||||
beq _0800E59C
|
||||
adds r4, 0xC
|
||||
adds r5, 0xC
|
||||
adds r7, 0x1
|
||||
cmp r7, 0x13
|
||||
ble _0800E558
|
||||
_0800E59C:
|
||||
movs r0, 0
|
||||
_0800E59E:
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_800E540
|
||||
|
||||
thumb_func_start sub_800E5AC
|
||||
sub_800E5AC: @ 800E5AC
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, 0x4
|
||||
ldr r0, =0x00003b98
|
||||
mov r8, r0
|
||||
movs r7, 0
|
||||
mov r6, r8
|
||||
movs r5, 0
|
||||
movs r4, 0x13
|
||||
_0800E5C0:
|
||||
ldr r0, =gSaveBlock1Ptr
|
||||
ldr r1, [r0]
|
||||
mov r2, r8
|
||||
adds r0, r1, r2
|
||||
adds r0, r5
|
||||
str r7, [r0]
|
||||
mov r0, sp
|
||||
strh r7, [r0]
|
||||
adds r1, r6
|
||||
adds r1, 0x4
|
||||
ldr r2, =0x01000004
|
||||
bl CpuSet
|
||||
adds r6, 0xC
|
||||
adds r5, 0xC
|
||||
subs r4, 0x1
|
||||
cmp r4, 0
|
||||
bge _0800E5C0
|
||||
add sp, 0x4
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_800E5AC
|
||||
|
||||
@ file boundary?
|
||||
|
||||
thumb_func_start nullsub_5
|
||||
nullsub_5: @ 800E5FC
|
||||
bx lr
|
||||
thumb_func_end nullsub_5
|
||||
|
||||
thumb_func_start nullsub_13
|
||||
nullsub_13: @ 800E600
|
||||
bx lr
|
||||
thumb_func_end nullsub_13
|
||||
|
||||
thumb_func_start sub_800E604
|
||||
sub_800E604: @ 800E604
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
sub sp, 0x8
|
||||
ldr r6, =gUnknown_03005000
|
||||
adds r5, r6, 0
|
||||
adds r5, 0xEE
|
||||
ldrb r4, [r5]
|
||||
mov r0, sp
|
||||
movs r7, 0
|
||||
strh r7, [r0]
|
||||
ldr r2, =0x0100067a
|
||||
adds r1, r6, 0
|
||||
bl CpuSet
|
||||
ldrb r0, [r5]
|
||||
strb r4, [r5]
|
||||
movs r0, 0xFF
|
||||
strb r0, [r6, 0xC]
|
||||
ldrb r0, [r5]
|
||||
cmp r0, 0x4
|
||||
beq _0800E636
|
||||
ldrb r0, [r5]
|
||||
strb r7, [r5]
|
||||
_0800E636:
|
||||
mov r7, sp
|
||||
adds r7, 0x2
|
||||
add r0, sp, 0x4
|
||||
mov r8, r0
|
||||
movs r0, 0x6
|
||||
add r0, sp
|
||||
mov r9, r0
|
||||
adds r5, r6, 0
|
||||
adds r5, 0x80
|
||||
movs r4, 0x4
|
||||
_0800E64A:
|
||||
adds r0, r5, 0
|
||||
bl sub_800FCC4
|
||||
adds r5, 0x14
|
||||
subs r4, 0x1
|
||||
cmp r4, 0
|
||||
bge _0800E64A
|
||||
movs r5, 0
|
||||
ldr r4, =gUnknown_03005000+0x6C
|
||||
adds r0, r4, 0
|
||||
bl sub_800FCC4
|
||||
adds r0, r4, 0
|
||||
adds r0, 0xB8
|
||||
bl sub_800D6C8
|
||||
ldr r0, =0x0000097c
|
||||
adds r4, r0
|
||||
adds r0, r4, 0
|
||||
bl sub_800D724
|
||||
strh r5, [r7]
|
||||
ldr r1, =gSendCmd
|
||||
ldr r2, =0x01000008
|
||||
adds r0, r7, 0
|
||||
bl CpuSet
|
||||
mov r0, r8
|
||||
strh r5, [r0]
|
||||
ldr r1, =gRecvCmds
|
||||
ldr r2, =0x01000028
|
||||
bl CpuSet
|
||||
mov r0, r9
|
||||
strh r5, [r0]
|
||||
ldr r1, =gLinkPlayers
|
||||
ldr r2, =0x01000046
|
||||
bl CpuSet
|
||||
add sp, 0x8
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_800E604
|
||||
|
||||
thumb_func_start sub_800E6D0
|
||||
sub_800E6D0: @ 800E6D0
|
||||
push {r4-r6,lr}
|
||||
|
@ -191,7 +191,7 @@ extern u16 gLinkType;
|
||||
extern u32 gLinkStatus;
|
||||
extern u16 gBlockRecvBuffer[MAX_RFU_PLAYERS][BLOCK_BUFFER_SIZE / 2];
|
||||
extern u16 gSendCmd[CMD_LENGTH];
|
||||
extern struct LinkPlayer gLinkPlayers[];
|
||||
extern struct LinkPlayer gLinkPlayers[5];
|
||||
extern u16 word_3002910[];
|
||||
extern bool8 gReceivedRemoteLinkPlayers;
|
||||
extern bool8 gWirelessCommType;
|
||||
|
@ -81,6 +81,17 @@ struct UnkRfuStruct_1 {
|
||||
/* 0x048 */ u8 filler_48[0xe78];
|
||||
};
|
||||
|
||||
struct UnkRfuStruct_2_Sub_6c {
|
||||
/* 0x00 */ u16 unk_00;
|
||||
/* 0x02 */ u16 unk_02;
|
||||
/* 0x04 */ u32 unk_04;
|
||||
/* 0x08 */ u32 unk_08;
|
||||
/* 0x0c */ u8 filler_0c[4];
|
||||
/* 0x10 */ u8 unk_10;
|
||||
/* 0x11 */ u8 unk_11;
|
||||
/* 0x12 */ u8 unk_12;
|
||||
};
|
||||
|
||||
struct UnkRfuStruct_2_Sub_124 {
|
||||
/* 0x000 */ u8 unk_00[32][70];
|
||||
/* 0x8c0 */ vu8 unk_8c0;
|
||||
@ -113,16 +124,21 @@ struct UnkRfuStruct_Sub_Unused {
|
||||
};
|
||||
|
||||
struct UnkRfuStruct_2 {
|
||||
/* 0x000 */ u8 filler_00[13];
|
||||
/* 0x000 */ u8 filler_00[12];
|
||||
/* 0x00c */ u8 unk_0c;
|
||||
/* 0x00d */ u8 playerCount;
|
||||
/* 0x00e */ u8 filler_0e[0x5e];
|
||||
/* 0x06c */ u8 filler_6c[0xb8];
|
||||
/* 0x06c */ struct UnkRfuStruct_2_Sub_6c unk_6c;
|
||||
/* 0x080 */ struct UnkRfuStruct_2_Sub_6c unk_80[5];
|
||||
/* 0x0e4 */ u8 filler_e4[10];
|
||||
/* 0x0ee */ vu8 unk_ee;
|
||||
/* 0x0ef */ u8 filler_ef[0x35];
|
||||
/* 0x124 */ struct UnkRfuStruct_2_Sub_124 unk_124;
|
||||
/* 0x9e8 */ struct UnkRfuStruct_2_Sub_9e8 unk_9e8;
|
||||
/* 0xc1c */ struct UnkRfuStruct_2_Sub_c1c unk_c1c;
|
||||
/* 0xc3c */ u8 filler_c3c[3];
|
||||
/* 0xc3f */ u8 filler_c3f[0xb9];
|
||||
}; // size = 0xcf8
|
||||
/* 0xc3f */ u8 filler_c3f[0xb5];
|
||||
}; // size = 0xcf4
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
|
@ -46,6 +46,7 @@ static void sub_800D434(void);
|
||||
static void sub_800D610(void);
|
||||
void sub_800D630(void);
|
||||
bool8 sub_800DAC8(struct UnkRfuStruct_2_Sub_c1c *q1, u8 *q2);
|
||||
void sub_800FCC4(struct UnkRfuStruct_2_Sub_6c *data);
|
||||
bool32 sub_8010454(u16 a0);
|
||||
u8 sub_8011A74(void);
|
||||
u8 sub_8012224(void);
|
||||
@ -2292,3 +2293,65 @@ void sub_800E3A8(void)
|
||||
free(sp14);
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_800E540(u16 id, u8 *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
if (StringCompare(gSaveBlock1Ptr->unk_3B98[i].trainerName, name) == 0 && gSaveBlock1Ptr->unk_3B98[i].trainerId == id)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
if (!sub_800E388(gSaveBlock1Ptr->unk_3B98[i].trainerName))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_800E5AC(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
gSaveBlock1Ptr->unk_3B98[i].trainerId = 0;
|
||||
CpuFill16(0, gSaveBlock1Ptr->unk_3B98[i].trainerName, 8);
|
||||
}
|
||||
}
|
||||
|
||||
void nullsub_5(void *unused_0, u8 unused_1, u8 unused_2)
|
||||
{
|
||||
// debug?
|
||||
}
|
||||
|
||||
void nullsub_13(u8 unused_0, u8 unused_1, u8 unused_2, u8 unused_3)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void sub_800E604(void)
|
||||
{
|
||||
int i;
|
||||
u8 unk_ee_bak = gUnknown_03005000.unk_ee;
|
||||
CpuFill16(0, &gUnknown_03005000, sizeof gUnknown_03005000);
|
||||
gUnknown_03005000.unk_ee = unk_ee_bak;
|
||||
gUnknown_03005000.unk_0c = 0xFF;
|
||||
if (gUnknown_03005000.unk_ee != 4)
|
||||
{
|
||||
gUnknown_03005000.unk_ee = 0;
|
||||
}
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
sub_800FCC4(gUnknown_03005000.unk_80 + i);
|
||||
}
|
||||
sub_800FCC4(&gUnknown_03005000.unk_6c);
|
||||
sub_800D6C8(&gUnknown_03005000.unk_124);
|
||||
sub_800D724(&gUnknown_03005000.unk_9e8);
|
||||
CpuFill16(0, gSendCmd, sizeof gSendCmd);
|
||||
CpuFill16(0, gRecvCmds, sizeof gRecvCmds);
|
||||
CpuFill16(0, gLinkPlayers, sizeof gLinkPlayers)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user