From 31323e7bf18ae451502cea520c234c2021ec464a Mon Sep 17 00:00:00 2001 From: dingusdev <52434309+dingusdev@users.noreply.github.com> Date: Wed, 4 Dec 2024 07:48:38 -0700 Subject: [PATCH] Fix compiling errors for MON_ID_SENSE (platinum) --- devices/memctrl/platinum.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/devices/memctrl/platinum.cpp b/devices/memctrl/platinum.cpp index 2729b37..5620222 100644 --- a/devices/memctrl/platinum.cpp +++ b/devices/memctrl/platinum.cpp @@ -211,6 +211,9 @@ void PlatinumCtrl::write(uint32_t rgn_start, uint32_t offset, uint32_t value, in { static uint8_t vid_enable_seq[] = {3, 2, 0}; + uint8_t mon_dirs = 0; + uint8_t mon_levels = 0; + if (rgn_start == VRAM_REGION_BASE) { if (offset < this->vram_size) write_mem(&this->vram_ptr[offset], value, size); @@ -268,10 +271,11 @@ void PlatinumCtrl::write(uint32_t rgn_start, uint32_t offset, uint32_t value, in break; case PlatinumReg::MON_ID_SENSE: value &= 7; - uint8_t dirs = value ^ 7; - uint8_t levels = (this->fb_test >> SENSE_LINE_OUTPUT_DATA_pos) & 7; - levels = (levels & dirs) | (dirs ^ 7); - this->mon_sense = (dirs << 3) | (this->display_id->read_monitor_sense(levels, dirs) ^ 7); + mon_dirs = value ^ 7; + mon_levels = (this->fb_test >> SENSE_LINE_OUTPUT_DATA_pos) & 7; + mon_levels = (mon_levels & mon_dirs) | (mon_dirs ^ 7); + this->mon_sense = (mon_dirs << 3) | + (this->display_id->read_monitor_sense(mon_levels, mon_dirs) ^ 7); break; case PlatinumReg::FB_RESET: if (value == 7 && this->crtc_on) {