Fix a regression in collision handling -> fixes Sky Skipper.

This commit is contained in:
Christian Speckner 2018-08-06 23:25:07 +02:00
parent 78cb878c29
commit 163b5ca999
5 changed files with 24 additions and 7 deletions

View File

@ -66,7 +66,7 @@ void Ball::enabl(uInt8 value)
updateEnabled();
collision = (myIsVisible && myIsEnabled) ? myCollisionMaskEnabled : myCollisionMaskDisabled;
myTIA->updateCollision();
myTIA->scheduleCollisionUpdate();
}
}
@ -245,7 +245,7 @@ void Ball::updateEnabled()
myIsEnabled = !myIsSuppressed && (myIsDelaying ? myIsEnabledOld : myIsEnabledNew);
collision = (myIsVisible && myIsEnabled) ? myCollisionMaskEnabled : myCollisionMaskDisabled;
myTIA->updateCollision();
myTIA->scheduleCollisionUpdate();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -260,7 +260,7 @@ void Missile::updateEnabled()
myIsEnabled = !myIsSuppressed && myEnam && !myResmp;
collision = (myIsVisible && myIsEnabled) ? myCollisionMaskEnabled : myCollisionMaskDisabled;
myTIA->updateCollision();
myTIA->scheduleCollisionUpdate();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -385,7 +385,7 @@ void Player::updatePattern()
if (myIsRendering && myRenderCounter >= myRenderCounterTripPoint) {
collision = (myPattern & (1 << mySampleCounter)) ? myCollisionMaskEnabled : myCollisionMaskDisabled;
myTIA->updateCollision();
myTIA->scheduleCollisionUpdate();
}
}

View File

@ -266,6 +266,7 @@ bool TIA::save(Serializer& out) const
out.putInt(myXAtRenderingStart);
out.putBool(myCollisionUpdateRequired);
out.putBool(myCollisionUpdateScheduled);
out.putInt(myCollisionMask);
out.putInt(myMovementClock);
@ -337,6 +338,7 @@ bool TIA::load(Serializer& in)
myXAtRenderingStart = in.getInt();
myCollisionUpdateRequired = in.getBool();
myCollisionUpdateScheduled = in.getBool();
myCollisionMask = in.getInt();
myMovementClock = in.getInt();
@ -1216,7 +1218,8 @@ void TIA::cycle(uInt32 colorClocks)
[this] (uInt8 address, uInt8 value) {delayedWrite(address, value);}
);
myCollisionUpdateRequired = false;
myCollisionUpdateRequired = myCollisionUpdateScheduled;
myCollisionUpdateScheduled = false;
if (myLinesSinceChange < 2) {
tickMovement();
@ -1351,6 +1354,12 @@ void TIA::cloneLastLine()
memcpy(buffer + y * 160, buffer + (y-1) * 160, 160);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::scheduleCollisionUpdate()
{
myCollisionUpdateScheduled = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::updateCollision()
{

View File

@ -448,9 +448,9 @@ class TIA : public Device
void flushLineCache();
/**
* Update the collision bitfield.
Schedule a collision update
*/
void updateCollision();
void scheduleCollisionUpdate();
/**
Create a new delayQueueIterator for the debugger.
@ -543,6 +543,11 @@ class TIA : public Device
*/
void tickHframe();
/**
* Update the collision bitfield.
*/
void updateCollision();
/**
* Execute a RSYNC.
*/
@ -815,6 +820,9 @@ class TIA : public Device
bool myEnableJitter;
uInt8 myJitterFactor;
// Force schedule a collision update
bool myCollisionUpdateScheduled;
#ifdef DEBUGGER_SUPPORT
// The arrays containing information about every byte of TIA
// indicating whether and how (RW) it is used.