mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 19:54:21 +01:00
through sub_800B524
This commit is contained in:
parent
515459d151
commit
fcb8c8cf32
57
asm/link.s
57
asm/link.s
@ -5,63 +5,6 @@
|
|||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
thumb_func_start sub_800B4DC
|
|
||||||
sub_800B4DC: @ 800B4DC
|
|
||||||
push {lr}
|
|
||||||
ldr r0, =gWirelessCommType
|
|
||||||
ldrb r0, [r0]
|
|
||||||
cmp r0, 0
|
|
||||||
bne _0800B4FC
|
|
||||||
ldr r0, =gLink
|
|
||||||
ldr r1, =0x00000fbd
|
|
||||||
adds r0, r1
|
|
||||||
ldrb r0, [r0]
|
|
||||||
b _0800B500
|
|
||||||
.pool
|
|
||||||
_0800B4FC:
|
|
||||||
bl sub_80124D4
|
|
||||||
_0800B500:
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
thumb_func_end sub_800B4DC
|
|
||||||
|
|
||||||
thumb_func_start sub_800B504
|
|
||||||
sub_800B504: @ 800B504
|
|
||||||
push {lr}
|
|
||||||
bl sub_800B4DC
|
|
||||||
cmp r0, 0x2
|
|
||||||
bhi _0800B512
|
|
||||||
movs r0, 0
|
|
||||||
b _0800B514
|
|
||||||
_0800B512:
|
|
||||||
movs r0, 0x1
|
|
||||||
_0800B514:
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
thumb_func_end sub_800B504
|
|
||||||
|
|
||||||
thumb_func_start sub_800B518
|
|
||||||
sub_800B518: @ 800B518
|
|
||||||
ldr r0, =gWirelessCommType
|
|
||||||
ldrb r0, [r0]
|
|
||||||
bx lr
|
|
||||||
.pool
|
|
||||||
thumb_func_end sub_800B518
|
|
||||||
|
|
||||||
thumb_func_start sub_800B524
|
|
||||||
sub_800B524: @ 800B524
|
|
||||||
push {lr}
|
|
||||||
ldrb r1, [r0, 0x10]
|
|
||||||
strb r1, [r0, 0x12]
|
|
||||||
adds r2, r0, 0
|
|
||||||
adds r2, 0x8
|
|
||||||
ldrb r1, [r0, 0x1A]
|
|
||||||
adds r0, r2, 0
|
|
||||||
bl ConvertInternationalString
|
|
||||||
pop {r0}
|
|
||||||
bx r0
|
|
||||||
thumb_func_end sub_800B524
|
|
||||||
|
|
||||||
thumb_func_start DisableSerial
|
thumb_func_start DisableSerial
|
||||||
DisableSerial: @ 800B53C
|
DisableSerial: @ 800B53C
|
||||||
push {lr}
|
push {lr}
|
||||||
|
@ -104,9 +104,9 @@ struct LinkPlayerBlock
|
|||||||
|
|
||||||
struct SendQueue
|
struct SendQueue
|
||||||
{
|
{
|
||||||
u16 data[CMD_LENGTH][QUEUE_CAPACITY];
|
/* 0x000 */ u16 data[CMD_LENGTH][QUEUE_CAPACITY];
|
||||||
u8 pos;
|
/* 0x320 */ u8 pos;
|
||||||
u8 count;
|
/* 0x321 */ u8 count;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RecvQueue
|
struct RecvQueue
|
||||||
@ -118,29 +118,29 @@ struct RecvQueue
|
|||||||
|
|
||||||
struct Link
|
struct Link
|
||||||
{
|
{
|
||||||
u8 isMaster; // 0: slave, 8: master
|
/* 0x000 */ u8 isMaster; // 0: slave, 8: master
|
||||||
u8 state;
|
/* 0x001 */ u8 state;
|
||||||
u8 localId; // local multi-player ID
|
/* 0x002 */ u8 localId; // local multi-player ID
|
||||||
u8 playerCount;
|
/* 0x003 */ u8 playerCount;
|
||||||
u16 tempRecvBuffer[4];
|
/* 0x004 */ u16 tempRecvBuffer[4];
|
||||||
bool8 receivedNothing;
|
/* 0x00c */ bool8 receivedNothing;
|
||||||
s8 serialIntrCounter;
|
/* 0x00d */ s8 serialIntrCounter;
|
||||||
bool8 handshakeAsMaster;
|
/* 0x00e */ bool8 handshakeAsMaster;
|
||||||
u8 link_field_F;
|
/* 0x00f */ u8 link_field_F;
|
||||||
|
|
||||||
// error conditions
|
// error conditions
|
||||||
bool8 hardwareError; // hardware reported an error
|
/* 0x010 */ bool8 hardwareError; // hardware reported an error
|
||||||
bool8 badChecksum; // checksum didn't match between devices
|
/* 0x011 */ bool8 badChecksum; // checksum didn't match between devices
|
||||||
u8 queueFull; // send or recv queue out of space
|
/* 0x012 */ u8 queueFull; // send or recv queue out of space
|
||||||
u8 lag; // connection is lagging
|
/* 0x013 */ u8 lag; // connection is lagging
|
||||||
|
|
||||||
u16 checksum;
|
/* 0x014 */ u16 checksum;
|
||||||
|
|
||||||
u8 sendCmdIndex;
|
/* 0x016 */ u8 sendCmdIndex;
|
||||||
u8 recvCmdIndex;
|
/* 0x017 */ u8 recvCmdIndex;
|
||||||
|
|
||||||
struct SendQueue sendQueue;
|
/* 0x018 */ struct SendQueue sendQueue;
|
||||||
struct RecvQueue recvQueue;
|
/* 0x33c */ struct RecvQueue recvQueue;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BlockRequest
|
struct BlockRequest
|
||||||
|
@ -30,5 +30,6 @@ void sub_800E6D0(void);
|
|||||||
bool32 sub_8010EC0(void);
|
bool32 sub_8010EC0(void);
|
||||||
bool32 sub_8010F1C(void);
|
bool32 sub_8010F1C(void);
|
||||||
bool32 sub_800F0B8(void);
|
bool32 sub_800F0B8(void);
|
||||||
|
u32 sub_80124D4(void);
|
||||||
|
|
||||||
#endif //GUARD_LINK_RFU_H
|
#endif //GUARD_LINK_RFU_H
|
||||||
|
29
src/link.c
29
src/link.c
@ -1866,3 +1866,32 @@ void sub_800B4C0(void)
|
|||||||
gWirelessCommType = 0;
|
gWirelessCommType = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u32 sub_800B4DC(void)
|
||||||
|
{
|
||||||
|
if (gWirelessCommType != 0)
|
||||||
|
{
|
||||||
|
return sub_80124D4();
|
||||||
|
}
|
||||||
|
return gLink.recvQueue.count;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool8 sub_800B504(void)
|
||||||
|
{
|
||||||
|
if (sub_800B4DC() > 2)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
u8 sub_800B518(void)
|
||||||
|
{
|
||||||
|
return gWirelessCommType;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_800B524(struct LinkPlayer *player)
|
||||||
|
{
|
||||||
|
player->name[10] = player->name[8];
|
||||||
|
ConvertInternationalString(player->name, player->language);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user