mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-18 01:14:19 +01:00
Merge pull request #1414 from ProjectRevoTPP/rfu_NI_stopReceivingData
fix rfu_NI_stopReceivingData fakematching; i guess it aint over yet cowboy
This commit is contained in:
commit
8dd6af1db1
@ -1550,21 +1550,20 @@ u16 rfu_changeSendTarget(u8 connType, u8 slotStatusIndex, u8 bmNewTgtSlot)
|
||||
|
||||
u16 rfu_NI_stopReceivingData(u8 slotStatusIndex)
|
||||
{
|
||||
struct NIComm *NI_comm;
|
||||
u16 imeBak;
|
||||
struct NIComm *NI_comm;
|
||||
|
||||
if (slotStatusIndex >= RFU_CHILD_MAX)
|
||||
return ERR_SLOT_NO;
|
||||
NI_comm = &gRfuSlotStatusNI[slotStatusIndex]->recv;
|
||||
imeBak = REG_IME;
|
||||
++imeBak; --imeBak; // fix imeBak, NI_comm register swap
|
||||
REG_IME = 0;
|
||||
if (gRfuSlotStatusNI[slotStatusIndex]->recv.state & SLOT_BUSY_FLAG)
|
||||
if (NI_comm->state & SLOT_BUSY_FLAG)
|
||||
{
|
||||
if (gRfuSlotStatusNI[slotStatusIndex]->recv.state == SLOT_STATE_RECV_LAST)
|
||||
gRfuSlotStatusNI[slotStatusIndex]->recv.state = SLOT_STATE_RECV_SUCCESS_AND_SENDSIDE_UNKNOWN;
|
||||
if (NI_comm->state == SLOT_STATE_RECV_LAST)
|
||||
NI_comm->state = SLOT_STATE_RECV_SUCCESS_AND_SENDSIDE_UNKNOWN;
|
||||
else
|
||||
gRfuSlotStatusNI[slotStatusIndex]->recv.state = SLOT_STATE_RECV_FAILED;
|
||||
NI_comm->state = SLOT_STATE_RECV_FAILED;
|
||||
gRfuLinkStatus->recvSlotNIFlag &= ~(1 << slotStatusIndex);
|
||||
rfu_STC_releaseFrame(slotStatusIndex, 1, NI_comm);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user