X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fpsxdma.h;h=eaddb3889ee1b382541cd324a7db98b5f1a1089e;hp=28495fa879579482508fe41e118d5d70e28b9f21;hb=b4d5a91d406bde3c317893c62f3daf42d4dc64eb;hpb=90f98e7cf5ed4fdabf6b6ff16d6886fef9dc7bbc diff --git a/libpcsxcore/psxdma.h b/libpcsxcore/psxdma.h index 28495fa8..eaddb388 100644 --- a/libpcsxcore/psxdma.h +++ b/libpcsxcore/psxdma.h @@ -79,6 +79,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