Monotonic: This flag is being deprecated soon, switch it for bool

This commit is contained in:
2023-04-29 18:20:49 -05:00
parent a16d7fe732
commit ea357be477
5 changed files with 6 additions and 9 deletions

View File

@@ -23,8 +23,8 @@ pub struct Flags {
pub mode: Mode,
/// Represents the set of emulator [Quirks] to enable, independent of the [Mode]
pub quirks: Quirks,
/// Represents the number of instructions to run per tick of the internal timer
pub monotonic: Option<usize>,
/// Set when the interpreter should increase the cycle count during a pause
pub monotonic: bool,
}
impl Flags {

View File

@@ -27,7 +27,6 @@ fn setup_environment() -> (CPU, Bus) {
flags: Flags {
debug: true,
pause: false,
monotonic: Some(8),
..Default::default()
},
..CPU::default()
@@ -1076,8 +1075,8 @@ mod behavior {
#[test]
fn delay() {
let (mut cpu, mut bus) = setup_environment();
cpu.flags.monotonic = None;
cpu.delay = 10.0;
cpu.flags.monotonic = false;
for _ in 0..2 {
cpu.multistep(&mut bus, 8)
.expect("Running valid instructions should always succeed");
@@ -1102,7 +1101,7 @@ mod behavior {
#[test]
fn vbi_wait() {
let (mut cpu, mut bus) = setup_environment();
cpu.flags.monotonic = None; // disable monotonic timing
cpu.flags.monotonic = false; // disable monotonic timing
cpu.flags.draw_wait = true;
for _ in 0..2 {
cpu.multistep(&mut bus, 8)