some dma improvements

no idea if anything needs this, shouldn't hurt either
This commit is contained in:
notaz 2017-09-24 01:27:31 +03:00
parent 7feeb88062
commit 0c7d1ba332
5 changed files with 156 additions and 148 deletions

View file

@ -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))