} \
}
+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))
*/\r
\r
#include "pico_int.h"\r
+#include "memory.h"\r
\r
int line_base_cycles;\r
extern const unsigned char hcounts_32[];\r
// if we have DmaHook, let it handle ROM because of possible DMA delay\r
if (PicoDmaHook && PicoDmaHook(source, len, &pd, &pdend));\r
else if (source<Pico.romsize) { // Rom\r
- pd=(u16 *)(Pico.rom+(source&~1));\r
+ pd=m68k_dma_source(source);\r
pdend=(u16 *)(Pico.rom+Pico.romsize);\r
}\r
- else {\r
+ if (!pd) {\r
elprintf(EL_VDPDMA|EL_ANOMALY, "DmaSlow[%i] %06x->%04x: invalid src", Pico.video.type, source, a);\r
return;\r
}\r