From 7feeb8806243f9f0bc6c3d6e957b97d12cecb7df Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 22 Sep 2017 02:16:15 +0300 Subject: [PATCH] make dma honour banking I was sure I had it done before, turns out not. --- pico/memory.h | 11 +++++++++++ pico/videoport.c | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pico/memory.h b/pico/memory.h index afca0826..4260a359 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 9ddc1679..35ece480 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; } -- 2.39.5