From: notaz Date: Thu, 21 Sep 2017 23:16:15 +0000 (+0300) Subject: make dma honour banking X-Git-Tag: v1.92~35 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=picodrive.git;a=commitdiff_plain;h=7feeb8806243f9f0bc6c3d6e957b97d12cecb7df make dma honour banking I was sure I had it done before, turns out not. --- diff --git a/pico/memory.h b/pico/memory.h index afca082..4260a35 100644 --- a/pico/memory.h +++ b/pico/memory.h @@ -133,6 +133,17 @@ void name(u32 a, u32 d) \ } \ } +static __inline void *m68k_dma_source(u32 a) +{ + uptr v; + a &= 0x00fffffe; + v = m68k_read16_map[a >> M68K_MEM_SHIFT]; + if (map_flag_set(v)) + return NULL; + else + return (void *)((v << 1) + a); +} + // 32x typedef struct { uptr addr; // stores (membase >> 1) or ((handler >> 1) | (1<<31)) diff --git a/pico/videoport.c b/pico/videoport.c index 9ddc167..35ece48 100644 --- a/pico/videoport.c +++ b/pico/videoport.c @@ -8,6 +8,7 @@ */ #include "pico_int.h" +#include "memory.h" int line_base_cycles; extern const unsigned char hcounts_32[]; @@ -134,10 +135,10 @@ static void DmaSlow(int len) // if we have DmaHook, let it handle ROM because of possible DMA delay if (PicoDmaHook && PicoDmaHook(source, len, &pd, &pdend)); else if (source%04x: invalid src", Pico.video.type, source, a); return; }