From 0b9ebafc0fc6899f4cb8dc7e96fe691dd714ccc1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 28 Sep 2021 22:12:13 -0400 Subject: [PATCH] Flip bit deserialisation order. --- Machines/Amiga/Chipset.cpp | 48 +++++++++++++++++++------------------- Machines/Amiga/Chipset.hpp | 14 +++++------ 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Machines/Amiga/Chipset.cpp b/Machines/Amiga/Chipset.cpp index b0c78254b..58e92cc31 100644 --- a/Machines/Amiga/Chipset.cpp +++ b/Machines/Amiga/Chipset.cpp @@ -164,40 +164,40 @@ template void Chipset::output() { // planar-to-chunky up front into 8-bit pockets, and just shift that. pixels_[0] = palette_[ - ((current_bitplanes_[0]&1) << 0) | - ((current_bitplanes_[1]&1) << 1) | - ((current_bitplanes_[2]&1) << 2) | - ((current_bitplanes_[3]&1) << 3) | - ((current_bitplanes_[4]&1) << 4) + ((current_bitplanes_[0]&0x8000) >> 15) | + ((current_bitplanes_[1]&0x8000) >> 14) | + ((current_bitplanes_[2]&0x8000) >> 13) | + ((current_bitplanes_[3]&0x8000) >> 12) | + ((current_bitplanes_[4]&0x8000) >> 11) ]; - current_bitplanes_ >>= is_high_res_; + current_bitplanes_ <<= is_high_res_; pixels_[1] = palette_[ - ((current_bitplanes_[0]&1) << 0) | - ((current_bitplanes_[1]&1) << 1) | - ((current_bitplanes_[2]&1) << 2) | - ((current_bitplanes_[3]&1) << 3) | - ((current_bitplanes_[4]&1) << 4) + ((current_bitplanes_[0]&0x8000) >> 15) | + ((current_bitplanes_[1]&0x8000) >> 14) | + ((current_bitplanes_[2]&0x8000) >> 13) | + ((current_bitplanes_[3]&0x8000) >> 12) | + ((current_bitplanes_[4]&0x8000) >> 11) ]; - current_bitplanes_ >>= 1; + current_bitplanes_ <<= 1; pixels_[2] = palette_[ - ((current_bitplanes_[0]&1) << 0) | - ((current_bitplanes_[1]&1) << 1) | - ((current_bitplanes_[2]&1) << 2) | - ((current_bitplanes_[3]&1) << 3) | - ((current_bitplanes_[4]&1) << 4) + ((current_bitplanes_[0]&0x8000) >> 15) | + ((current_bitplanes_[1]&0x8000) >> 14) | + ((current_bitplanes_[2]&0x8000) >> 13) | + ((current_bitplanes_[3]&0x8000) >> 12) | + ((current_bitplanes_[4]&0x8000) >> 11) ]; - current_bitplanes_ >>= is_high_res_; + current_bitplanes_ <<= is_high_res_; pixels_[3] = palette_[ - ((current_bitplanes_[0]&1) << 0) | - ((current_bitplanes_[1]&1) << 1) | - ((current_bitplanes_[2]&1) << 2) | - ((current_bitplanes_[3]&1) << 3) | - ((current_bitplanes_[4]&1) << 4) + ((current_bitplanes_[0]&0x8000) >> 15) | + ((current_bitplanes_[1]&0x8000) >> 14) | + ((current_bitplanes_[2]&0x8000) >> 13) | + ((current_bitplanes_[3]&0x8000) >> 12) | + ((current_bitplanes_[4]&0x8000) >> 11) ]; - current_bitplanes_ >>= 1; + current_bitplanes_ <<= 1; pixels_ += 4; } diff --git a/Machines/Amiga/Chipset.hpp b/Machines/Amiga/Chipset.hpp index 37aa66944..5998a67b7 100644 --- a/Machines/Amiga/Chipset.hpp +++ b/Machines/Amiga/Chipset.hpp @@ -156,13 +156,13 @@ class Chipset { void flush_output(); struct BitplaneData: public std::array { - BitplaneData &operator >>= (int c) { - (*this)[0] >>= c; - (*this)[1] >>= c; - (*this)[2] >>= c; - (*this)[3] >>= c; - (*this)[4] >>= c; - (*this)[5] >>= c; + BitplaneData &operator <<= (int c) { + (*this)[0] <<= c; + (*this)[1] <<= c; + (*this)[2] <<= c; + (*this)[3] <<= c; + (*this)[4] <<= c; + (*this)[5] <<= c; return *this; } };