Skip to content

Commit

Permalink
Allow scheduling for all cycle timings
Browse files Browse the repository at this point in the history
  • Loading branch information
Grarak committed Jan 17, 2025
1 parent 73307ae commit 90753aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/cycle_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::core::CpuType::{ARM7, ARM9};
use crate::linked_list::{LinkedList, LinkedListAllocator, LinkedListEntry};
use bilge::prelude::*;
use std::alloc::{GlobalAlloc, Layout, System};
use std::cmp::max;
use std::intrinsics::unlikely;
use std::{mem, ptr};

Expand Down Expand Up @@ -150,8 +151,7 @@ impl CycleManager {
}

pub fn schedule(&mut self, in_cycles: u32, event_type: EventType, arg: u16) {
debug_assert_ne!(in_cycles, 0);
let event_cycle = self.cycle_count + in_cycles as u64;
let event_cycle = self.cycle_count + max(in_cycles, 1) as u64;

let mut current_node = self.events.root;
while !current_node.is_null() {
Expand Down

0 comments on commit 90753aa

Please sign in to comment.