1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-23 20:29:42 +00:00

Flip bit deserialisation order.

This commit is contained in:
Thomas Harte 2021-09-28 22:12:13 -04:00
parent 140e24ef15
commit 0b9ebafc0f
2 changed files with 31 additions and 31 deletions

View File

@ -164,40 +164,40 @@ template <int cycle> 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;
}

View File

@ -156,13 +156,13 @@ class Chipset {
void flush_output();
struct BitplaneData: public std::array<uint16_t, 6> {
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;
}
};