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

Captures the attach flag and observes activation rule.

This commit is contained in:
Thomas Harte 2021-10-22 11:21:58 -07:00
parent e67de90ad0
commit c5e8b547af
2 changed files with 4 additions and 0 deletions

View File

@ -911,16 +911,19 @@ void Chipset::Bitplanes::set_control(uint16_t control) {
void Chipset::Sprite::set_start_position(uint16_t value) {
v_start_ = (v_start_ & 0xff00) | (value >> 8);
h_start_ = (h_start_ & 0xff00) | ((value & 0xff));
active_ = false;
}
void Chipset::Sprite::set_stop_and_control(uint16_t value) {
h_start_ = uint16_t((h_start_ & 0x00ff) | ((value & 0x01) << 8));
v_stop_ = uint16_t((value >> 8) | ((value & 0x02) << 7));
v_start_ = uint16_t((v_start_ & 0x00ff) | ((value & 0x04) << 6));
attached_ = value & 0x80;
}
void Chipset::Sprite::set_image_data(int slot, uint16_t value) {
data_[slot] = value;
active_ |= slot == 0;
}
// MARK: - Disk.

View File

@ -137,6 +137,7 @@ class Chipset: private ClockingHint::Observer {
private:
uint16_t v_start_ = 0, h_start_ = 0, v_stop_ = 0;
uint16_t data_[2]{};
bool active_ = false, attached_ = false;
} sprites_[8];
// MARK: - Raster position and state.