appleramdac: Always change cursor position.

Tests in Open Firmware confirm that writing to CURSOR_POS_LO will change the cursor position even if a write to CURSOR_POS_HI doesn't happen.
This commit is contained in:
joevt 2024-02-18 05:13:55 -08:00 committed by dingusdev
parent 6c3715cc32
commit 503ee92528
2 changed files with 15 additions and 1 deletions

View File

@ -87,10 +87,23 @@ void AppleRamdac::iodev_write(uint32_t address, uint16_t value) {
case RamdacRegs::MULTI:
switch (this->dac_addr) {
case RamdacRegs::CURSOR_POS_HI:
if (this->cursor_timer_id) {
TimerManager::get_instance()->cancel_timer(this->cursor_timer_id);
cursor_timer_id = 0;
}
this->cursor_xpos = (value << 8) | this->cursor_pos_lo;
break;
case RamdacRegs::CURSOR_POS_LO:
this->cursor_pos_lo = value;
if (this->cursor_timer_id) {
TimerManager::get_instance()->cancel_timer(this->cursor_timer_id);
this->cursor_xpos = (this->cursor_xpos & 0xff00) | (this->cursor_pos_lo & 0x00ff);
cursor_timer_id = 0;
}
this->cursor_pos_lo = value;
this->cursor_timer_id = TimerManager::get_instance()->add_oneshot_timer(
1000000000 / 60, [this]() {
this->cursor_xpos = (this->cursor_xpos & 0xff00) | (this->cursor_pos_lo & 0x00ff);
});
break;
case RamdacRegs::MISC_CTRL:
if (bit_changed(this->dac_cr, value, 1)) {

View File

@ -118,6 +118,7 @@ protected:
int video_width = 0;
int video_height = 0;
uint32_t fb_pitch = 0;
uint32_t cursor_timer_id = 0;
};
#endif // APPLE_RAMDAC_H