memory refactoring (mostly for cd) + ARM mem asm update
[picodrive.git] / pico / memory.h
index 63c5163..ec7873f 100644 (file)
@@ -5,6 +5,9 @@ typedef unsigned short u16;
 typedef unsigned int   u32;
 
 #define M68K_MEM_SHIFT 16
+// minimum size we can map
+#define M68K_BANK_SIZE (1 << M68K_MEM_SHIFT)
+#define M68K_BANK_MASK (M68K_BANK_SIZE - 1)
 
 extern unsigned long m68k_read8_map  [0x1000000 >> M68K_MEM_SHIFT];
 extern unsigned long m68k_read16_map [0x1000000 >> M68K_MEM_SHIFT];
@@ -17,9 +20,9 @@ extern unsigned long s68k_write8_map [0x1000000 >> M68K_MEM_SHIFT];
 extern unsigned long s68k_write16_map[0x1000000 >> M68K_MEM_SHIFT];
 
 void z80_map_set(unsigned long *map, int start_addr, int end_addr,
-    void *func_or_mh, int is_func);
+    const void *func_or_mh, int is_func);
 void cpu68k_map_set(unsigned long *map, int start_addr, int end_addr,
-    void *func_or_mh, int is_func);
+    const void *func_or_mh, int is_func);
 void cpu68k_map_all_ram(int start_addr, int end_addr, void *ptr, int is_sub);
 void m68k_map_unmap(int start_addr, int end_addr);