X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fpsxhw.h;h=e83939f269817ec7fbccbf433e63bed0529a38d0;hp=cd4e928c58b4b4e54f174a1819b0fe6ac3c2f99e;hb=ba10822d813767632c528102055e3eeb54730b2c;hpb=ef79bbde537d6b9c745a7d86cb9df1d04c35590d diff --git a/libpcsxcore/psxhw.h b/libpcsxcore/psxhw.h index cd4e928c..e83939f2 100644 --- a/libpcsxcore/psxhw.h +++ b/libpcsxcore/psxhw.h @@ -57,11 +57,21 @@ extern "C" { #define HW_DMA_PCR (psxHu32ref(0x10f0)) #define HW_DMA_ICR (psxHu32ref(0x10f4)) -#define DMA_INTERRUPT(n) \ - if (SWAPu32(HW_DMA_ICR) & (1 << (16 + n))) { \ - HW_DMA_ICR |= SWAP32(1 << (24 + n)); \ - psxHu32ref(0x1070) |= SWAP32(8); \ - } +#define HW_DMA_ICR_BUS_ERROR (1<<15) +#define HW_DMA_ICR_GLOBAL_ENABLE (1<<23) +#define HW_DMA_ICR_IRQ_SENT (1<<31) + +#define DMA_INTERRUPT(n) { \ + u32 icr = SWAPu32(HW_DMA_ICR); \ + if (icr & (1 << (16 + n))) { \ + icr |= 1 << (24 + n); \ + if (icr & HW_DMA_ICR_GLOBAL_ENABLE && !(icr & HW_DMA_ICR_IRQ_SENT)) { \ + psxHu32ref(0x1070) |= SWAP32(8); \ + icr |= HW_DMA_ICR_IRQ_SENT; \ + } \ + HW_DMA_ICR = SWAP32(icr); \ + } \ +} void psxHwReset(); u8 psxHwRead8(u32 add); @@ -70,7 +80,7 @@ u32 psxHwRead32(u32 add); void psxHwWrite8(u32 add, u8 value); void psxHwWrite16(u32 add, u16 value); void psxHwWrite32(u32 add, u32 value); -int psxHwFreeze(gzFile f, int Mode); +int psxHwFreeze(void *f, int Mode); #ifdef __cplusplus }