X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fpsxmem.h;h=b4096034efbd79b43e8ac74fa8d00a8c4c263c2a;hp=222e6fbff213d41fce900b28ca61f9d14e710fb2;hb=654e8cfb205bebc40b26761a900db354b4920931;hpb=a327967e78393018a9f2a7edb38bc3af657e597a diff --git a/libpcsxcore/psxmem.h b/libpcsxcore/psxmem.h index 222e6fbf..b4096034 100644 --- a/libpcsxcore/psxmem.h +++ b/libpcsxcore/psxmem.h @@ -142,12 +142,13 @@ extern u32 event_cycles[6]; extern u32 next_interupt; #define new_dyna_set_event(e, c) { \ - u32 c_ = c; \ - event_cycles[e] = c_; \ - if (c_ < next_interupt) { \ - /*printf("%u: next_interupt %d -> %d\n", psxRegs.cycle, \ - next_interupt - psxRegs.cycle, c_ - psxRegs.cycle);*/ \ - next_interupt = c_; \ + s32 c_ = c; \ + u32 abs_ = psxRegs.cycle + c_; \ + s32 odi_ = next_interupt - psxRegs.cycle; \ + event_cycles[e] = abs_; \ + if (c_ < odi_) { \ + /*printf("%u: next_interupt %d -> %d (%u)\n", psxRegs.cycle, odi_, c_, abs_);*/ \ + next_interupt = abs_; \ } \ }