From b42437c458b71a8519860a2592a15370c6a1b34f Mon Sep 17 00:00:00 2001 From: joevt Date: Wed, 24 Jan 2024 00:55:40 -0800 Subject: [PATCH] control: Mask unmodifiable bits. --- devices/video/control.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devices/video/control.cpp b/devices/video/control.cpp index 5bc4623..c9b3db0 100644 --- a/devices/video/control.cpp +++ b/devices/video/control.cpp @@ -337,6 +337,7 @@ void ControlVideo::write(uint32_t rgn_start, uint32_t offset, uint32_t value, in LOG_F(WARNING, "%s: CNTTST set to 0x%X", this->name.c_str(), value); break; case ControlRegs::SWATCH_CTRL: + value &= 0x7FF; if ((this->swatch_ctrl ^ value) & DISABLE_TIMING) { this->swatch_ctrl = value; this->strobe_counter = 0; @@ -375,7 +376,7 @@ void ControlVideo::write(uint32_t rgn_start, uint32_t offset, uint32_t value, in this->blank_display(); } } - this->enables = value; + this->enables = value & 0xFFF; if (this->enables & FB_ENDIAN_LITTLE) ABORT_F("%s: little-endian framebuffer is not implemented yet", this->name.c_str());