# SPDX-License-Identifier: MIT """The machine rows: Lynx I and Lynx II differ in data only. Default row: Lynx II (owner's decision 1, 2026-11-12). """ from __future__ import annotations from dataclasses import dataclass from w65c02_python import G65SC02, Lynx2Cell def _mapctl_lynx1(written: int) -> int: # TEST ROM (LT page-mode guide, lynx-tests page-mode/memio): Lynx I reads back what # was written ($83 -> $83). return written def _mapctl_lynx2(written: int) -> int: # TEST ROM (LT page-mode guide): Lynx II keeps bits 0-3, forces 4-6 high and inverts # bit 7: $03 -> $F3, $83 -> $73 (C3). return (written | 0x70) ^ 0x80 @dataclass(frozen=True) class Machine: name: str #: The CPU row (w65c02-python). DOC + TEST ROM: lynx-tests cpu test 7 and AtariAge 283383 #: (Lynx I = 65SC02 subset; Lynx II executes RMB/SMB/BBR/BBS). WAI/STP: no claim (C1). cpu: type mapctl_readback: object #: Lynx II has two audio outputs and MSTEREO (C8); Lynx I is mono. stereo: bool LYNX1 = Machine("lynx1", G65SC02, _mapctl_lynx1, stereo=False) LYNX2 = Machine("lynx2", Lynx2Cell, _mapctl_lynx2, stereo=True) MACHINES = {m.name: m for m in (LYNX1, LYNX2)} DEFAULT = LYNX2