X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fmemory.h;h=ae7ae50dad2ce115112f6314ac9da935f62e8268;hb=0c7d1ba332b26f4ac67199e8ecbb826651f8512a;hp=afca082690d1d1fd371bf339bb42b28d4ea1e8c1;hpb=9a1f192a146e9b9752ec1a760745b1261fe9bdec;p=picodrive.git diff --git a/pico/memory.h b/pico/memory.h index afca082..ae7ae50 100644 --- a/pico/memory.h +++ b/pico/memory.h @@ -133,6 +133,25 @@ void name(u32 a, u32 d) \ } \ } +#ifdef NEED_DMA_SOURCE // meh + +static __inline void *m68k_dma_source(u32 a) +{ + u8 *base; + uptr v; + v = m68k_read16_map[a >> M68K_MEM_SHIFT]; + if (map_flag_set(v)) { + if (a >= Pico.romsize) // Rom + return NULL; + base = Pico.rom; + } + else + base = (void *)(v << 1); + return base + (a & 0xfe0000); +} + +#endif + // 32x typedef struct { uptr addr; // stores (membase >> 1) or ((handler >> 1) | (1<<31))