appleramdac: Add get_clut_entry_cb.

This commit is contained in:
joevt 2024-02-18 04:25:04 -08:00 committed by dingusdev
parent 9a26016ed4
commit 97f08f21b7
3 changed files with 10 additions and 0 deletions

View File

@ -64,6 +64,10 @@ PlatinumCtrl::PlatinumCtrl() : MemCtrlBase(), VideoCtrlBase(640, 480) {
// attach DACula RAMDAC
this->dacula = std::unique_ptr<AppleRamdac>(new AppleRamdac(DacFlavour::DACULA));
this->dacula->get_clut_entry_cb = [this](uint8_t index, uint8_t *colors) {
uint8_t a;
this->get_palette_color(index, colors[0], colors[1], colors[2], a);
};
this->dacula->set_clut_entry_cb = [this](uint8_t index, uint8_t *colors) {
this->set_palette_color(index, colors[0], colors[1], colors[2], 0xFF);
};

View File

@ -65,6 +65,7 @@ enum RamdacRegs : uint8_t {
}; // namespace RamdacRegs
typedef std::function<void(uint8_t index, uint8_t *colors)> GetClutEntryCallback;
typedef std::function<void(uint8_t index, uint8_t *colors)> SetClutEntryCallback;
typedef std::function<void(bool cursor_on)> CursorCtrlCallback;
@ -89,6 +90,7 @@ public:
void measure_hw_cursor(uint8_t *fb_ptr);
void draw_hw_cursor(uint8_t *src_buf, uint8_t *dst_buf, int dst_pitch);
GetClutEntryCallback get_clut_entry_cb = nullptr;
SetClutEntryCallback set_clut_entry_cb = nullptr;
CursorCtrlCallback cursor_ctrl_cb = nullptr;

View File

@ -94,6 +94,10 @@ ControlVideo::ControlVideo()
// attach RAMDAC
this->radacal = std::unique_ptr<AppleRamdac>(new AppleRamdac(DacFlavour::RADACAL));
this->radacal->get_clut_entry_cb = [this](uint8_t index, uint8_t *colors) {
uint8_t a;
this->get_palette_color(index, colors[0], colors[1], colors[2], a);
};
this->radacal->set_clut_entry_cb = [this](uint8_t index, uint8_t *colors) {
this->set_palette_color(index, colors[0], colors[1], colors[2], 0xFF);
};