X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fpsxmem.h;h=a5c6c4a10231aa40c3146f3dd863366205c40b52;hp=222e6fbff213d41fce900b28ca61f9d14e710fb2;hb=96d9fde1230e5ae6de069ff9e4a0f16185650ab5;hpb=ae602c19f527fbc1f44cdb744cf824d04b8eceb1 diff --git a/libpcsxcore/psxmem.h b/libpcsxcore/psxmem.h index 222e6fbf..a5c6c4a1 100644 --- a/libpcsxcore/psxmem.h +++ b/libpcsxcore/psxmem.h @@ -138,16 +138,17 @@ void psxMemWrite16(u32 mem, u16 value); void psxMemWrite32(u32 mem, u32 value); void *psxMemPointer(u32 mem); -extern u32 event_cycles[6]; +extern u32 event_cycles[7]; 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_; \ } \ }