X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fpsxdma.h;h=ce10d9d327526df13db1fc0ad4a99c542bb1ff7b;hb=HEAD;hp=e21353f884f9784a96c73f7791ff7e4046c69ab6;hpb=57a757cedcc7928894aaf957565adfa95f1caab5;p=pcsx_rearmed.git diff --git a/libpcsxcore/psxdma.h b/libpcsxcore/psxdma.h index e21353f8..ce10d9d3 100644 --- a/libpcsxcore/psxdma.h +++ b/libpcsxcore/psxdma.h @@ -28,50 +28,28 @@ extern "C" { #include "r3000a.h" #include "psxhw.h" #include "psxmem.h" - -#define GPUDMA_INT(eCycle) { \ - psxRegs.interrupt |= (1 << PSXINT_GPUDMA); \ - psxRegs.intCycle[PSXINT_GPUDMA].cycle = eCycle; \ - psxRegs.intCycle[PSXINT_GPUDMA].sCycle = psxRegs.cycle; \ - new_dyna_set_event(PSXINT_GPUDMA, eCycle); \ -} - -#define SPUDMA_INT(eCycle) { \ - psxRegs.interrupt |= (1 << PSXINT_SPUDMA); \ - psxRegs.intCycle[PSXINT_SPUDMA].cycle = eCycle; \ - psxRegs.intCycle[PSXINT_SPUDMA].sCycle = psxRegs.cycle; \ - new_dyna_set_event(PSXINT_SPUDMA, eCycle); \ -} - -#define MDECOUTDMA_INT(eCycle) { \ - psxRegs.interrupt |= (1 << PSXINT_MDECOUTDMA); \ - psxRegs.intCycle[PSXINT_MDECOUTDMA].cycle = eCycle; \ - psxRegs.intCycle[PSXINT_MDECOUTDMA].sCycle = psxRegs.cycle; \ - new_dyna_set_event(PSXINT_MDECOUTDMA, eCycle); \ -} - -#define MDECINDMA_INT(eCycle) { \ - psxRegs.interrupt |= (1 << PSXINT_MDECINDMA); \ - psxRegs.intCycle[PSXINT_MDECINDMA].cycle = eCycle; \ - psxRegs.intCycle[PSXINT_MDECINDMA].sCycle = psxRegs.cycle; \ - new_dyna_set_event(PSXINT_MDECINDMA, eCycle); \ -} - -#define GPUOTCDMA_INT(eCycle) { \ - psxRegs.interrupt |= (1 << PSXINT_GPUOTCDMA); \ - psxRegs.intCycle[PSXINT_GPUOTCDMA].cycle = eCycle; \ - psxRegs.intCycle[PSXINT_GPUOTCDMA].sCycle = psxRegs.cycle; \ - new_dyna_set_event(PSXINT_GPUOTCDMA, eCycle); \ -} +#include "psxevents.h" void psxDma2(u32 madr, u32 bcr, u32 chcr); void psxDma3(u32 madr, u32 bcr, u32 chcr); void psxDma4(u32 madr, u32 bcr, u32 chcr); void psxDma6(u32 madr, u32 bcr, u32 chcr); +void psxAbortDma2(); 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 } #endif