mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-12-22 15:29:58 +00:00
appleramdac: Allow read from CLUT.
This commit is contained in:
parent
7c203b40c8
commit
2d1616894d
@ -49,6 +49,16 @@ uint16_t AppleRamdac::iodev_read(uint32_t address) {
|
||||
this->name.c_str(), this->dac_addr);
|
||||
}
|
||||
break;
|
||||
case RamdacRegs::CLUT_DATA:
|
||||
if (this->comp_index == 0) {
|
||||
this->get_clut_entry_cb(this->dac_addr, this->clut_color);
|
||||
}
|
||||
this->comp_index++;
|
||||
if (this->comp_index >= 3) {
|
||||
this->dac_addr++; // auto-increment CLUT address
|
||||
this->comp_index = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LOG_F(WARNING, "%s: read from unsupported register at 0x%X",
|
||||
this->name.c_str(), address);
|
||||
@ -117,6 +127,9 @@ void AppleRamdac::iodev_write(uint32_t address, uint16_t value) {
|
||||
}
|
||||
break;
|
||||
case RamdacRegs::CLUT_DATA:
|
||||
if (this->comp_index == 0) {
|
||||
this->get_clut_entry_cb(this->dac_addr, this->clut_color);
|
||||
}
|
||||
this->clut_color[this->comp_index++] = value;
|
||||
if (this->comp_index >= 3) {
|
||||
this->set_clut_entry_cb(this->dac_addr, this->clut_color);
|
||||
|
Loading…
Reference in New Issue
Block a user