mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 01:25:20 +02:00
wrapping sub
This commit is contained in:
+1
-1
@@ -201,7 +201,7 @@ pub fn set_control_registers(device: &mut device::Device, index: u32, mut data:
|
||||
COP0_COMPARE_REG => {
|
||||
data &= 0xFFFFFFFF;
|
||||
let current_count = (device.cpu.cop0.regs[COP0_COUNT_REG as usize] >> 1) & 0xFFFFFFFF;
|
||||
let mut compare_event_diff = data as u32 - current_count as u32;
|
||||
let mut compare_event_diff = (data as u32).wrapping_sub(current_count as u32);
|
||||
|
||||
if compare_event_diff == 0 {
|
||||
compare_event_diff += !0 as u32;
|
||||
|
||||
Reference in New Issue
Block a user