X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fmemory.h;h=eb440dd49ea03223dca6ac4c4a49fa63bb6baa0f;hb=48c9e01be8ad93a7902e22f9ad07aba4527e6572;hp=afca082690d1d1fd371bf339bb42b28d4ea1e8c1;hpb=9a1f192a146e9b9752ec1a760745b1261fe9bdec;p=picodrive.git diff --git a/pico/memory.h b/pico/memory.h index afca082..eb440dd 100644 --- a/pico/memory.h +++ b/pico/memory.h @@ -1,9 +1,11 @@ // memory map related stuff +#include "pico_port.h" + typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; -typedef unsigned long uptr; // unsigned pointer-sized int +typedef uintptr_t uptr; // unsigned pointer-sized int #define M68K_MEM_SHIFT 16 // minimum size we can map @@ -133,6 +135,25 @@ void name(u32 a, u32 d) \ } \ } +#ifdef NEED_DMA_SOURCE // meh + +static __inline void *m68k_dma_source(u32 a) +{ + u8 *base; + uptr v; + v = m68k_read16_map[a >> M68K_MEM_SHIFT]; + if (map_flag_set(v)) { + if (a >= Pico.romsize) // Rom + return NULL; + base = Pico.rom; + } + else + base = (void *)(v << 1); + return base + (a & 0xfe0000); +} + +#endif + // 32x typedef struct { uptr addr; // stores (membase >> 1) or ((handler >> 1) | (1<<31))