# set aside unread (wave 2): expectations from Mesen2/MiSTer source def test_bus_timing_c7() -> None: class Mesen2Bus(HG51B): BUS_DELAY_EXTRA = 1 for core, pending in ((HG51B, 4), (Mesen2Bus, 5)): rig = Rig(core) rig.cx.r[0] = 0x0A8000 rig.place([0x6260, 0x612E, 0x1C00, 0xFC00]) rig.start() while rig.cx.instructions < 2: rig.cx.step() assert rig.cx.bus_pending == pending and rig.cx.owns_rom_bus before = rig.cx.clock rig.cx.step() # WAIT: 1 clock, then the rest of the access assert rig.cx.clock - before == pending and not rig.cx.bus_enabled