X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fpsxdma.h;h=5c0ab4e6b3684269f0cd1b05893a7334e4d21beb;hb=26665bc5cb481a2087beb78793b3bef1be7c1597;hp=6736cdb22b19107295d2c46ccb418f28dd8d73bf;hpb=654e8cfb205bebc40b26761a900db354b4920931;p=pcsx_rearmed.git diff --git a/libpcsxcore/psxdma.h b/libpcsxcore/psxdma.h index 6736cdb2..5c0ab4e6 100644 --- a/libpcsxcore/psxdma.h +++ b/libpcsxcore/psxdma.h @@ -28,27 +28,7 @@ extern "C" { #include "r3000a.h" #include "psxhw.h" #include "psxmem.h" - -#define GPUDMA_INT(eCycle) { \ - psxRegs.interrupt |= 0x01000000; \ - psxRegs.intCycle[3 + 24 + 1] = eCycle; \ - psxRegs.intCycle[3 + 24] = psxRegs.cycle; \ - new_dyna_set_event(3, eCycle); \ -} - -#define SPUDMA_INT(eCycle) { \ - psxRegs.interrupt |= 0x04000000; \ - psxRegs.intCycle[1 + 24 + 1] = eCycle; \ - psxRegs.intCycle[1 + 24] = psxRegs.cycle; \ - new_dyna_set_event(5, eCycle); \ -} - -#define MDECOUTDMA_INT(eCycle) { \ - psxRegs.interrupt |= 0x02000000; \ - psxRegs.intCycle[5 + 24 + 1] = eCycle; \ - psxRegs.intCycle[5 + 24] = psxRegs.cycle; \ - new_dyna_set_event(4, eCycle); \ -} +#include "psxevents.h" void psxDma2(u32 madr, u32 bcr, u32 chcr); void psxDma3(u32 madr, u32 bcr, u32 chcr); @@ -56,6 +36,18 @@ void psxDma4(u32 madr, u32 bcr, u32 chcr); void psxDma6(u32 madr, u32 bcr, u32 chcr); void gpuInterrupt(); void spuInterrupt(); +void gpuotcInterrupt(); + +static inline void *getDmaRam(u32 madr, u32 *max_words) +{ + // this should wrap instead of limit + if (!(madr & 0x800000)) { + madr &= 0x1ffffc; + *max_words = (0x200000 - madr) / 4; + return psxM + madr; + } + return INVALID_PTR; +} #ifdef __cplusplus }