mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-12-25 03:29:38 +00:00
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:
parent
6c3715cc32
commit
503ee92528
@ -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)) {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user