+10
-10
@@ -1425,35 +1425,35 @@ static u16 rfu_STC_setSendData_org(u8 ni_or_uni, u8 bmSendSlot, u8 subFrameSize,
|
|||||||
sending = ni_or_uni & 0x20;
|
sending = ni_or_uni & 0x20;
|
||||||
if (sending || ni_or_uni == 0x40)
|
if (sending || ni_or_uni == 0x40)
|
||||||
{
|
{
|
||||||
u8 *dataType_p; // a hack to swap instructions
|
|
||||||
|
|
||||||
slotStatus_NI = gRfuSlotStatusNI[bm_slot_id];
|
slotStatus_NI = gRfuSlotStatusNI[bm_slot_id];
|
||||||
slotStatus_UNI = NULL;
|
slotStatus_UNI = NULL;
|
||||||
slotStatus_NI->send.errorCode = 0;
|
slotStatus_NI->send.errorCode = 0;
|
||||||
*slotStatus_NI->send.now_p = dataType_p = &slotStatus_NI->send.dataType;
|
slotStatus_NI->send.now_p[0] = &slotStatus_NI->send.dataType;
|
||||||
slotStatus_NI->send.remainSize = 7;
|
slotStatus_NI->send.remainSize = 7;
|
||||||
slotStatus_NI->send.bmSlotOrg = bmSendSlot;
|
slotStatus_NI->send.bmSlotOrg = bmSendSlot;
|
||||||
slotStatus_NI->send.bmSlot = bmSendSlot;
|
slotStatus_NI->send.bmSlot = bmSendSlot;
|
||||||
slotStatus_NI->send.payloadSize = subFrameSize - frameSize;
|
slotStatus_NI->send.payloadSize = subFrameSize - frameSize;
|
||||||
if (sending != 0)
|
if (sending != 0)
|
||||||
*dataType_p = 0;
|
slotStatus_NI->send.dataType = 0;
|
||||||
else
|
else
|
||||||
*dataType_p = 1;
|
slotStatus_NI->send.dataType = 1;
|
||||||
slotStatus_NI->send.dataSize = dataSize;
|
slotStatus_NI->send.dataSize = dataSize;
|
||||||
slotStatus_NI->send.src = src;
|
slotStatus_NI->send.src = src;
|
||||||
slotStatus_NI->send.ack = 0;
|
slotStatus_NI->send.ack = 0;
|
||||||
slotStatus_NI->send.phase = 0;
|
slotStatus_NI->send.phase = 0;
|
||||||
#ifndef NONMATCHING // to fix r2, r3, r4, r5 register roulette
|
|
||||||
asm("":::"r2");
|
|
||||||
#endif
|
|
||||||
for (i = 0; i < WINDOW_COUNT; ++i)
|
for (i = 0; i < WINDOW_COUNT; ++i)
|
||||||
{
|
{
|
||||||
slotStatus_NI->send.recvAckFlag[i] = 0;
|
slotStatus_NI->send.recvAckFlag[i] = 0;
|
||||||
slotStatus_NI->send.n[i] = 1;
|
slotStatus_NI->send.n[i] = 1;
|
||||||
}
|
}
|
||||||
for (bm_slot_id = 0; bm_slot_id < RFU_CHILD_MAX; ++bm_slot_id)
|
for (bm_slot_id = 0; bm_slot_id < RFU_CHILD_MAX; ++bm_slot_id)
|
||||||
if ((bmSendSlot >> bm_slot_id) & 1)
|
{
|
||||||
gRfuSlotStatusNI[bm_slot_id]->send.failCounter = 0;
|
do
|
||||||
|
{
|
||||||
|
if ((bmSendSlot >> bm_slot_id) & 1)
|
||||||
|
gRfuSlotStatusNI[bm_slot_id]->send.failCounter = 0;
|
||||||
|
} while (0);
|
||||||
|
}
|
||||||
gRfuLinkStatus->sendSlotNIFlag |= bmSendSlot;
|
gRfuLinkStatus->sendSlotNIFlag |= bmSendSlot;
|
||||||
*llFrameSize_p -= subFrameSize;
|
*llFrameSize_p -= subFrameSize;
|
||||||
slotStatus_NI->send.state = SLOT_STATE_SEND_START;
|
slotStatus_NI->send.state = SLOT_STATE_SEND_START;
|
||||||
|
|||||||
+2
-11
@@ -501,7 +501,7 @@ void GetTrainerTowerOpponentLoseText(u8 *dest, u8 opponentIdx)
|
|||||||
TT_ConvertEasyChatMessageToString(sTrainerTowerOpponent->speechLose2, dest);
|
TT_ConvertEasyChatMessageToString(sTrainerTowerOpponent->speechLose2, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SetUpTrainerTowerDataStruct(void) // fakematching
|
static void SetUpTrainerTowerDataStruct(void)
|
||||||
{
|
{
|
||||||
u32 challengeType = gSaveBlock1Ptr->towerChallengeId;
|
u32 challengeType = gSaveBlock1Ptr->towerChallengeId;
|
||||||
s32 r4;
|
s32 r4;
|
||||||
@@ -519,16 +519,7 @@ static void SetUpTrainerTowerDataStruct(void) // fakematching
|
|||||||
r7 = gUnknown_84827B4[challengeType];
|
r7 = gUnknown_84827B4[challengeType];
|
||||||
for (r4 = 0; r4 < MAX_TRAINER_TOWER_FLOORS; r4++)
|
for (r4 = 0; r4 < MAX_TRAINER_TOWER_FLOORS; r4++)
|
||||||
{
|
{
|
||||||
#ifndef NONMATCHING
|
*(sTrainerTowerState->unk_0004.floors + r4) = *(r7[r4]); // manual pointer arithmetic needed to match
|
||||||
void * r5;
|
|
||||||
register void * r0 asm("r0") = sTrainerTowerState;
|
|
||||||
r5 = (void *)(r4 * sizeof(struct TrainerTowerFloor));
|
|
||||||
r0 = r5 + (uintptr_t)r0;
|
|
||||||
r0 += offsetof(struct UnkStruct_203F458, unk_0004.floors);
|
|
||||||
memcpy(r0, r7[r4], sizeof(struct TrainerTowerFloor));
|
|
||||||
#else
|
|
||||||
memcpy(&sTrainerTowerState->unk_0004.floors[r4], r7[r4], sizeof(struct TrainerTowerFloor));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
sTrainerTowerState->unk_0004.checksum = CalcByteArraySum((void *)sTrainerTowerState->unk_0004.floors, sizeof(sTrainerTowerState->unk_0004.floors));
|
sTrainerTowerState->unk_0004.checksum = CalcByteArraySum((void *)sTrainerTowerState->unk_0004.floors, sizeof(sTrainerTowerState->unk_0004.floors));
|
||||||
ValidateOrResetCurTrainerTowerRecord();
|
ValidateOrResetCurTrainerTowerRecord();
|
||||||
|
|||||||
Reference in New Issue
Block a user