X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fpsxdma.h;h=eaddb3889ee1b382541cd324a7db98b5f1a1089e;hb=d3f0cb2bbea928854c0e05fcc43f9447a01c71c6;hp=28495fa879579482508fe41e118d5d70e28b9f21;hpb=9f8b032dc5074e29f2e93ce06651f6da3bb70a86;p=pcsx_rearmed.git 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