diff options
Diffstat (limited to 'qtmips_machine/lcddisplay.cpp')
-rw-r--r-- | qtmips_machine/lcddisplay.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/qtmips_machine/lcddisplay.cpp b/qtmips_machine/lcddisplay.cpp index 1d96b9d..bd12b1c 100644 --- a/qtmips_machine/lcddisplay.cpp +++ b/qtmips_machine/lcddisplay.cpp @@ -38,6 +38,7 @@ using namespace machine; LcdDisplay::LcdDisplay() { + change_counter = 0; size_t need_bytes; fb_size = 0x4b000; fb_bpp = 16; @@ -88,12 +89,16 @@ bool LcdDisplay::wword(std::uint32_t address, std::uint32_t value) { printf("LcdDisplay::wword address 0x%08lx data 0x%08lx\n", (unsigned long)address, (unsigned long)value); #endif + if (value == rword(address, true)) + return false; fb_data[address + 0] = (value >> 24) & 0xff; fb_data[address + 1] = (value >> 16) & 0xff; fb_data[address + 2] = (value >> 8) & 0xff; fb_data[address + 3] = (value >> 0) & 0xff; + change_counter++; + y = address / fb_linesize; if (fb_bpp > 12) x = (address - y * fb_linesize) / ((fb_bpp + 7) >> 3); @@ -143,3 +148,7 @@ std::uint32_t LcdDisplay::rword(std::uint32_t address, bool debug_access) const return value; } + +std::uint32_t LcdDisplay::get_change_counter() const { + return change_counter; +} |