# SPDX-License-Identifier: MIT """2600 mode: the hand-off of SALLY, the TIA and the RIOT to a2600-python's board. The full gates (die traces, timer ROMs, the smoke group, the #699 tables) run from ``scripts/gates_2600.py``; here a short lockstep and the BIOS path. """ from __future__ import annotations import pytest from a2600_python import gates from a2600_python.machine import NTSC_7800 from a2600_python.system import System from conftest import A2600, read_zip from a7800_python.machine import NTSC, PAL from a7800_python.mode2600 import System2600, make_system def test_direct_start_is_the_2600_board_cycle_for_cycle(): rom = read_zip(A2600 / "Combat (Europe).zip") agreed, difference = gates.lockstep(rom, system_factory=make_system, machine=NTSC_7800, cycles=60_000) # fmt: skip assert difference is None and agreed >= 60_000 def test_the_chips_are_the_same_objects(): system = System2600.from_rom(read_zip(A2600 / "Combat (Europe).zip"), NTSC) assert isinstance(system, System) # the gates' SystemFactory type, held (issue 0001) assert system.cpu is system.system.cpu # SALLY adopted, not a fresh 6507 assert system.board.tia is system.system.board.tia assert system.board.riot is system.system.board.riot @pytest.mark.slow @pytest.mark.parametrize("machine", [NTSC, PAL], ids=["ntsc", "pal"]) def test_bios_hands_a_2600_cartridge_over(machine): system = System2600.from_rom(read_zip(A2600 / "Combat (Europe).zip"), machine, start="bios") assert system.board.cycles == system.system.board.periods system.run_frames(5) assert system.board.tia.frame >= 5