diff --git a/src/emucore/tia/core_6502ts/TIA.cxx b/src/emucore/tia/core_6502ts/TIA.cxx index 1ba0d63da..9fb901156 100644 --- a/src/emucore/tia/core_6502ts/TIA.cxx +++ b/src/emucore/tia/core_6502ts/TIA.cxx @@ -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);