X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=picodrive.git;a=blobdiff_plain;f=pico%2Fmemory.h;h=ae7ae50dad2ce115112f6314ac9da935f62e8268;hp=4260a35976bdc85bb51abcf6f009bf363e7ea22a;hb=0c7d1ba332b26f4ac67199e8ecbb826651f8512a;hpb=7feeb8806243f9f0bc6c3d6e957b97d12cecb7df diff --git a/pico/memory.h b/pico/memory.h index 4260a35..ae7ae50 100644 --- a/pico/memory.h +++ b/pico/memory.h @@ -133,17 +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; - a &= 0x00fffffe; v = m68k_read16_map[a >> M68K_MEM_SHIFT]; - if (map_flag_set(v)) - return NULL; + if (map_flag_set(v)) { + if (a >= Pico.romsize) // Rom + return NULL; + base = Pico.rom; + } else - return (void *)((v << 1) + a); + base = (void *)(v << 1); + return base + (a & 0xfe0000); } +#endif + // 32x typedef struct { uptr addr; // stores (membase >> 1) or ((handler >> 1) | (1<<31))