Simplify priority logic in score mode.

This commit is contained in:
Christian Speckner 2016-11-26 13:37:19 +01:00
parent 1924013daf
commit 92ec526d68
1 changed files with 15 additions and 24 deletions

View File

@ -838,7 +838,7 @@ void TIA::renderPixel(uInt32 x, uInt32 y, bool lineNotCached)
switch (myPriority)
{
// Playfield has priority so ScoreBit isn't used
// Priority from highest to lowest:
// Priority from highest to lowest:
// BL/PF => P0/M0 => P1/M1 => BK
case Priority::pfp: // CTRLPF D2=1, D1=ignored
color = myMissile1.getPixel(color);
@ -850,31 +850,22 @@ void TIA::renderPixel(uInt32 x, uInt32 y, bool lineNotCached)
break;
case Priority::score: // CTRLPF D2=0, D1=1
// Score mode left half
if (x < 80) {
// Priority from highest to lowest:
// PF/P0/M0 => P1/M1 => BL => BK
color = myBall.getPixel(color);
color = myMissile1.getPixel(color);
color = myPlayer1.getPixel(color);
color = myMissile0.getPixel(color);
color = myPlayer0.getPixel(color);
color = myPlayfield.getPixel(color);
}
else // Score mode right half
{
// Priority from highest to lowest:
// P0/M0 => PF/P1/M1 => BL => BK
color = myBall.getPixel(color);
color = myMissile1.getPixel(color);
color = myPlayer1.getPixel(color);
color = myPlayfield.getPixel(color);
color = myMissile0.getPixel(color);
color = myPlayer0.getPixel(color);
}
// Formally we have (priority from highest to lowest)
// PF/P0/M0 => P1/M1 => BL => BK
// for the first half and
// P0/M0 => PF/P1/M1 => BL => BK
// for the second half. However, the first ordering is equivalent
// to the second (PF has the same color as P0/M0), so we can just
// write
color = myBall.getPixel(color);
color = myMissile1.getPixel(color);
color = myPlayer1.getPixel(color);
color = myPlayfield.getPixel(color);
color = myMissile0.getPixel(color);
color = myPlayer0.getPixel(color);
break;
// Priority from highest to lowest:
// Priority from highest to lowest:
// P0/M0 => P1/M1 => BL/PF => BK
case Priority::normal: // CTRLPF D2=0, D1=0
color = myPlayfield.getPixel(color);