mirror of
https://github.com/gopher64/gopher64.git
synced 2026-11-12 09:09:01 +01:00
fix translate_events bug (#1354)
This commit is contained in:
1 parent
27d21f2535
commit
cebfadef36
1 file changed
+1
-1
@@ -95,7 +95,7 @@ fn set_next_event(device: &mut device::Device) {
|
||||
pub fn translate_events(device: &mut device::Device, old_count: u64, new_count: u64) {
|
||||
for i in device.cpu.events.iter_mut() {
|
||||
if i.enabled {
|
||||
i.count = i.count.wrapping_sub(old_count).wrapping_add(new_count);
|
||||
i.count = new_count + i.count.saturating_sub(old_count);
|
||||
}
|
||||
}
|
||||
set_next_event(device);
|
||||
|
||||
Reference in new issue
Block a user