mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
make dma honour banking
I was sure I had it done before, turns out not.
This commit is contained in:
parent
6a47c2d4fb
commit
7feeb88062
2 changed files with 14 additions and 2 deletions
|
@ -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))
|
||||
|
|
|
@ -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<Pico.romsize) { // Rom
|
||||
pd=(u16 *)(Pico.rom+(source&~1));
|
||||
pd=m68k_dma_source(source);
|
||||
pdend=(u16 *)(Pico.rom+Pico.romsize);
|
||||
}
|
||||
else {
|
||||
if (!pd) {
|
||||
elprintf(EL_VDPDMA|EL_ANOMALY, "DmaSlow[%i] %06x->%04x: invalid src", Pico.video.type, source, a);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue