X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fpsxdma.h;h=28495fa879579482508fe41e118d5d70e28b9f21;hp=b73781fc9b84604a2f0fecec1ea6b5e2bd13a2a7;hb=HEAD;hpb=d28b54b1d1d161b3f3acc3299c43106a022451e6 diff --git a/libpcsxcore/psxdma.h b/libpcsxcore/psxdma.h index b73781fc..ce10d9d3 100644 --- a/libpcsxcore/psxdma.h +++ b/libpcsxcore/psxdma.h @@ -28,34 +28,27 @@ 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); \ -} +#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 }