mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-25 03:32:01 +00:00
Limit to specific purpose.
This commit is contained in:
parent
040ac93042
commit
003162f710
@ -182,17 +182,25 @@ template <int cycle> void Chipset::output() {
|
|||||||
// TODO: this doesn't support dual playfields; use an alternative
|
// TODO: this doesn't support dual playfields; use an alternative
|
||||||
// palette table for that.
|
// palette table for that.
|
||||||
|
|
||||||
pixels_[0] = palette_[bitplane_pixels_ >> 120];
|
if(is_high_res_) {
|
||||||
bitplane_pixels_ <<= is_high_res_ * 8;
|
pixels_[0] = palette_[bitplane_pixels_.get()];
|
||||||
|
bitplane_pixels_.shift();
|
||||||
|
|
||||||
pixels_[1] = palette_[bitplane_pixels_ >> 120];
|
pixels_[1] = palette_[bitplane_pixels_.get()];
|
||||||
bitplane_pixels_ <<= 8;
|
bitplane_pixels_.shift();
|
||||||
|
|
||||||
pixels_[2] = palette_[bitplane_pixels_ >> 120];
|
pixels_[2] = palette_[bitplane_pixels_.get()];
|
||||||
bitplane_pixels_ <<= is_high_res_ * 8;
|
bitplane_pixels_.shift();
|
||||||
|
|
||||||
pixels_[3] = palette_[bitplane_pixels_ >> 120];
|
pixels_[3] = palette_[bitplane_pixels_.get()];
|
||||||
bitplane_pixels_ <<= 8;
|
bitplane_pixels_.shift();
|
||||||
|
} else {
|
||||||
|
pixels_[0] = pixels_[1] = palette_[bitplane_pixels_.get()];
|
||||||
|
bitplane_pixels_.shift();
|
||||||
|
|
||||||
|
pixels_[2] = pixels_[3] = palette_[bitplane_pixels_.get()];
|
||||||
|
bitplane_pixels_.shift();
|
||||||
|
}
|
||||||
|
|
||||||
pixels_ += 4;
|
pixels_ += 4;
|
||||||
}
|
}
|
||||||
@ -464,6 +472,12 @@ constexpr uint64_t expand_byte(uint8_t source) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A very small selection of test cases.
|
||||||
|
static_assert(expand_byte(0xff) == 0x01'01'01'01'01'01'01'01);
|
||||||
|
static_assert(expand_byte(0x55) == 0x00'01'00'01'00'01'00'01);
|
||||||
|
static_assert(expand_byte(0xaa) == 0x01'00'01'00'01'00'01'00);
|
||||||
|
static_assert(expand_byte(0x00) == 0x00'00'00'00'00'00'00'00);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Chipset::SixteenPixels::set(const BitplaneData &previous, const BitplaneData &next, int odd_delay, int even_delay) {
|
void Chipset::SixteenPixels::set(const BitplaneData &previous, const BitplaneData &next, int odd_delay, int even_delay) {
|
||||||
|
@ -220,15 +220,13 @@ class Chipset: private ClockingHint::Observer {
|
|||||||
int odd_delay,
|
int odd_delay,
|
||||||
int even_delay);
|
int even_delay);
|
||||||
|
|
||||||
SixteenPixels &operator <<= (int c) {
|
void shift() {
|
||||||
(*this)[1] = ((*this)[1] << c) | ((*this)[0] >> (64 - c));
|
(*this)[1] = ((*this)[1] << 8) | ((*this)[0] >> 56);
|
||||||
(*this)[0] <<= c;
|
(*this)[0] <<= 8;
|
||||||
return *this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int operator >> (int c) {
|
uint8_t get() {
|
||||||
assert(c >= 96);
|
return uint8_t((*this)[1] >> 56);
|
||||||
return int((*this)[1] >> (c - 64));
|
|
||||||
}
|
}
|
||||||
} bitplane_pixels_;
|
} bitplane_pixels_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user