1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Use redirected palette in bitmap modes.

This commit is contained in:
Thomas Harte 2023-02-26 13:59:17 -05:00
parent bfa167fcdf
commit 95fd5a52ba

View File

@ -441,9 +441,11 @@ void Base<personality>::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<personality>::palette_[
pixel_target_[c] = active_palette[
buffer.bitmap[c >> 1] >> ((((c & 1) ^ 1) << 2)) & 0xf
];
}
@ -451,7 +453,7 @@ void Base<personality>::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<personality>::palette_[
pixel_target_[c] = active_palette[
buffer.bitmap[c >> 2] >> ((((c & 3) ^ 3) << 1)) & 3
];
}