eeTools / SimulIDE-dev

SimulIDE Circuit Simulator.
https://simulide.com
GNU Affero General Public License v3.0
80 stars 20 forks source link

Bug in SSD1306 scrolling (with fix) #16

Closed adenton0 closed 2 months ago

adenton0 commented 2 months ago

https://github.com/Arcachofo/SimulIDE-dev/blame/74e5996741c599992146caa3b85643025b63d2b2/src/components/outputs/displays/ssd1306.cpp#L181

When scrolling, pixels are messed up on one side when scrolling RIGHT. Problem is ssd1306.cpp lines 181 + 182: if( c < 127 ) m_aDispRam[c][row] = m_aDispRam[c-1][row]; if( col == 0 ) m_aDispRam[0][row] = end; Both lines have incorrect tests in the if(). CHANGE BOTH AS FOLLOWS: if( c > 0 ) m_aDispRam[c][row] = m_aDispRam[c-1][row]; if( c == 0 ) m_aDispRam[0][row] = end; // or just use else i.e. L181: test should be c>0 not <127 L182: test should use 'c' not 'col' (and could entirely be replaced with 'else')

Adam.

Arcachofo commented 2 months ago

Thank you. Solved at 1a360a3.