Taos: properly handle color mode changes.

This commit is contained in:
Maxim Poliakovski 2024-07-11 02:19:54 +02:00
parent 40b537767d
commit 378965cc3d
2 changed files with 16 additions and 2 deletions

View File

@ -120,7 +120,10 @@ void TaosVideo::write(uint32_t rgn_start, uint32_t offset, uint32_t value, int s
this->row_words = value;
break;
case COLOR_MODE:
this->color_mode = value;
if (this->color_mode != value) {
this->color_mode = value;
enable_display();
}
break;
case VIDEO_MODE:
this->video_mode = value >> 30;
@ -129,6 +132,8 @@ void TaosVideo::write(uint32_t rgn_start, uint32_t offset, uint32_t value, int s
if (bit_changed(this->crt_ctrl, value, ENABLE_VIDEO_OUT)) {
if (bit_set(value, ENABLE_VIDEO_OUT))
enable_display();
else
disable_display();
}
this->crt_ctrl = value;
break;
@ -218,7 +223,15 @@ void TaosVideo::enable_display() {
this->start_refresh_task();
this->blank_on = false;
this->crtc_on = true;
this->crtc_on = true;
}
void TaosVideo::disable_display() {
this->stop_refresh_task();
this->blank_display();
this->blank_on = true;
this->crtc_on = false;
}
void TaosVideo::convert_frame_15bpp_indexed(uint8_t *dst_buf, int dst_pitch) {

View File

@ -174,6 +174,7 @@ public:
private:
void enable_display();
void disable_display();
void convert_frame_15bpp_indexed(uint8_t *dst_buf, int dst_pitch);
std::unique_ptr<AthensClocks> clk_gen = nullptr;