1
0

LCD emulation

This commit is contained in:
Aiden
2026-05-25 21:33:19 +10:00
parent e141f3b30d
commit 191b72d418
7 changed files with 113 additions and 11 deletions

View File

@@ -20,6 +20,29 @@ class EmulatorLcdBusTest(unittest.TestCase):
self.assertEqual(memory.read8(LCD_E_CLOCK_DATA), 0x41)
def test_command_sets_ddram_cursor_and_data_updates_display_text(self):
memory = MemoryMap(b"\x00" * 4)
memory.write8(LCD_E_CLOCK_STATUS, 0x80)
for value in b"CONNECT: NOT ACT":
memory.write8(LCD_E_CLOCK_DATA, value)
self.assertEqual(memory.lcd.line_text(0), "CONNECT: NOT ACT")
def test_rom_line_mapping_matches_16x4_lcd_addresses(self):
memory = MemoryMap(b"\x00" * 4)
memory.write8(LCD_E_CLOCK_STATUS, 0xC0)
memory.write8(LCD_E_CLOCK_DATA, ord("1"))
memory.write8(LCD_E_CLOCK_STATUS, 0x90)
memory.write8(LCD_E_CLOCK_DATA, ord("2"))
memory.write8(LCD_E_CLOCK_STATUS, 0xD0)
memory.write8(LCD_E_CLOCK_DATA, ord("3"))
self.assertTrue(memory.lcd.line_text(1).startswith("1"))
self.assertTrue(memory.lcd.line_text(2).startswith("2"))
self.assertTrue(memory.lcd.line_text(3).startswith("3"))
if __name__ == "__main__":
unittest.main()