// SPDX-License-Identifier: MIT //! a2600-rust-fast's own tests: corners of the fork's shortcuts that the //! lockstep's case table does not reach. Each asserts what the inherited //! (reference) rule does on that corner, so a shortcut that skips the rule //! there fails here (scripts/seeded_faults.py names the fault each one catches). use a2600::tia::TIA; /// A RESMPx lock holds the missile's ring in H@1 and sets its pending clear /// even on a step that clocks nothing (HBLANK, no HMOVE): the quiet-step /// shortcut must not skip the object sections while a lock holds. The lockstep /// misses this (a lock that starts and ends inside one HBLANK, with no object /// clock in between, is in no case), so it is tested here. #[test] fn a_resmp_lock_holds_the_ring_on_a_step_that_clocks_nothing() { for player in 0..2 { let mut tia = TIA::default(); assert!(tia.hblank && !tia.motion_running && tia.merge_4 == 0); let missile = 2 + player; tia.counters[missile].ring = 3; tia.counters[missile].pending = false; tia.players[player].scan = 1; tia.players[player].copy_flag = false; tia.resmp[player] = true; tia.step(None); assert_eq!(tia.counters[missile].ring, 1, "player {player}'s missile ring"); assert!(tia.counters[missile].pending, "player {player}'s missile pending"); } }