import unittest from h8536.emulator import MemoryMap from h8536.emulator.peripherals import LCD_E_CLOCK_DATA, LCD_E_CLOCK_STATUS class EmulatorLcdBusTest(unittest.TestCase): def test_status_read_reports_ready_even_after_command_write(self): memory = MemoryMap(b"\x00" * 4) memory.write8(LCD_E_CLOCK_STATUS, 0x80) self.assertEqual(memory.read8(LCD_E_CLOCK_STATUS), 0x00) def test_data_read_returns_data_latch_defaulting_to_zero(self): memory = MemoryMap(b"\x00" * 4) self.assertEqual(memory.read8(LCD_E_CLOCK_DATA), 0x00) memory.write8(LCD_E_CLOCK_DATA, 0x41) self.assertEqual(memory.read8(LCD_E_CLOCK_DATA), 0x41) if __name__ == "__main__": unittest.main()