From 95fd5a52ba5f2361241ad1053c8a1af5211b20ad Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 26 Feb 2023 13:59:17 -0500 Subject: [PATCH] Use redirected palette in bitmap modes. --- Components/9918/Implementation/Draw.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Components/9918/Implementation/Draw.hpp b/Components/9918/Implementation/Draw.hpp index 8c42dbfc9..85b7efc40 100644 --- a/Components/9918/Implementation/Draw.hpp +++ b/Components/9918/Implementation/Draw.hpp @@ -441,9 +441,11 @@ void Base::draw_yamaha(LineBuffer &buffer, int start, int end) { // TODO: Many other graphics modes. // TODO: much smarter loops. Duff plus a tail? + const auto active_palette = palette(); + if constexpr (mode == ScreenMode::YamahaGraphics4) { for(int c = start >> 2; c < end >> 2; c++) { - pixel_target_[c] = Storage::palette_[ + pixel_target_[c] = active_palette[ buffer.bitmap[c >> 1] >> ((((c & 1) ^ 1) << 2)) & 0xf ]; } @@ -451,7 +453,7 @@ void Base::draw_yamaha(LineBuffer &buffer, int start, int end) { if constexpr (mode == ScreenMode::YamahaGraphics5) { for(int c = start >> 1; c < end >> 1; c++) { - pixel_target_[c] = Storage::palette_[ + pixel_target_[c] = active_palette[ buffer.bitmap[c >> 2] >> ((((c & 3) ^ 3) << 1)) & 3 ]; }