X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fpsxdma.h;h=5c0ab4e6b3684269f0cd1b05893a7334e4d21beb;hb=899d08bdfa1d222a9c0e73ee2604b96ff4287687;hp=28495fa879579482508fe41e118d5d70e28b9f21;hpb=9f8b032dc5074e29f2e93ce06651f6da3bb70a86;p=pcsx_rearmed.git diff --git a/libpcsxcore/psxdma.h b/libpcsxcore/psxdma.h index 28495fa8..5c0ab4e6 100644 --- a/libpcsxcore/psxdma.h +++ b/libpcsxcore/psxdma.h @@ -28,48 +28,7 @@ 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); \ -} - -#define CDRDMA_INT(eCycle) { \ - psxRegs.interrupt |= (1 << PSXINT_CDRDMA); \ - psxRegs.intCycle[PSXINT_CDRDMA].cycle = eCycle; \ - psxRegs.intCycle[PSXINT_CDRDMA].sCycle = psxRegs.cycle; \ - new_dyna_set_event(PSXINT_CDRDMA, eCycle); \ -} +#include "psxevents.h" void psxDma2(u32 madr, u32 bcr, u32 chcr); void psxDma3(u32 madr, u32 bcr, u32 chcr); @@ -79,6 +38,17 @@ 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