mirror of
https://github.com/fail0verflow/mini.git
synced 2024-11-28 06:04:19 +01:00
Add dma_addr to convert pointers to DMA addresses
This commit is contained in:
parent
5b14f07ea2
commit
e463cdea43
19
memory.c
19
memory.c
@ -229,6 +229,25 @@ void mem_setswap(int enable)
|
||||
|
||||
}
|
||||
|
||||
u32 dma_addr(void *p)
|
||||
{
|
||||
u32 addr = (u32)p;
|
||||
|
||||
switch(addr>>20) {
|
||||
case 0xfff:
|
||||
case 0x0d4:
|
||||
case 0x0dc:
|
||||
if(read32(HW_MEMMIRR) & 0x20) {
|
||||
addr ^= 0x10000;
|
||||
}
|
||||
addr &= 0x0001FFFF;
|
||||
addr |= 0x0d400000;
|
||||
break;
|
||||
}
|
||||
//gecko_printf("DMA to %p: address %08x\n", p, addr);
|
||||
return addr;
|
||||
}
|
||||
|
||||
#define SECTION 0x012
|
||||
|
||||
#define NONBUFFERABLE 0x000
|
||||
|
Loading…
Reference in New Issue
Block a user