lynx: fix complete system hang at about 15k frames in every time

This commit is contained in:
goyuken 2014-09-29 20:40:19 +00:00
parent 9897e9016b
commit a806aa15e3
2 changed files with 18 additions and 20 deletions

View File

@ -1587,30 +1587,28 @@ void CMikie::CheckWrap()
// To stop problems with cycle count wrap we will check and then correct the // To stop problems with cycle count wrap we will check and then correct the
// cycle counter. // cycle counter.
// //
#define DEC(X) do { if((X)) { (X) -= 0x80000000; } } while (0)
if(mSystem.gSystemCycleCount>0xf0000000) if(mSystem.gSystemCycleCount>0xf0000000)
{ {
mSystem.gSystemCycleCount-=0x80000000; DEC(mSystem.gSystemCycleCount);
mTIM_0_LAST_COUNT-=0x80000000; DEC(mTIM_0_LAST_COUNT);
mTIM_1_LAST_COUNT-=0x80000000; DEC(mTIM_1_LAST_COUNT);
mTIM_2_LAST_COUNT-=0x80000000; DEC(mTIM_2_LAST_COUNT);
mTIM_3_LAST_COUNT-=0x80000000; DEC(mTIM_3_LAST_COUNT);
mTIM_4_LAST_COUNT-=0x80000000; DEC(mTIM_4_LAST_COUNT);
mTIM_5_LAST_COUNT-=0x80000000; DEC(mTIM_5_LAST_COUNT);
mTIM_6_LAST_COUNT-=0x80000000; DEC(mTIM_6_LAST_COUNT);
mTIM_7_LAST_COUNT-=0x80000000; DEC(mTIM_7_LAST_COUNT);
mAUDIO_LAST_COUNT[0]-=0x80000000; DEC(mAUDIO_LAST_COUNT[0]);
mAUDIO_LAST_COUNT[1]-=0x80000000; DEC(mAUDIO_LAST_COUNT[1]);
mAUDIO_LAST_COUNT[2]-=0x80000000; DEC(mAUDIO_LAST_COUNT[2]);
mAUDIO_LAST_COUNT[3]-=0x80000000; DEC(mAUDIO_LAST_COUNT[3]);
startTS -= 0x80000000; DEC(startTS);
// Only correct if sleep is active DEC(mSystem.gSuzieDoneTime);
if(mSystem.gSuzieDoneTime) DEC(mSystem.gNextTimerEvent);
{
mSystem.gSuzieDoneTime-=0x80000000;
}
} }
#undef DEC
} }
void CMikie::Update() void CMikie::Update()

Binary file not shown.