cpu68k_map_set(m68k_read16_map, 0x900000, 0x900000 + rs - 1, Pico.rom + bank, 0);
elprintf(EL_32X, "bank %06x-%06x -> %06x", 0x900000, 0x900000 + rs - 1, bank);
-
-#ifdef EMU_F68K
- // setup FAME fetchmap
- for (rs = 0x90; rs < 0xa0; rs++)
- PicoCpuFM68k.Fetch[rs] = (unsigned long)Pico.rom + bank - 0x900000;
-#endif
}
// -----------------------------------------------------------------
cpu68k_map_set(s68k_write8_map, 0x080000, 0x0bffff, s68k_dec_write8[b0 ^ 1][m], 1);\r
cpu68k_map_set(s68k_write16_map, 0x080000, 0x0bffff, s68k_dec_write16[b0 ^ 1][m], 1);\r
}\r
-\r
-#ifdef EMU_F68K\r
- // update fetchmap..\r
- int i;\r
- if (!(r3 & 4))\r
- {\r
- for (i = M68K_FETCHBANK1*2/16; (i<<(24-FAMEC_FETCHBITS)) < 0x240000; i++)\r
- PicoCpuFM68k.Fetch[i] = (unsigned long)Pico_mcd->word_ram2M - 0x200000;\r
- }\r
- else\r
- {\r
- for (i = M68K_FETCHBANK1*2/16; (i<<(24-FAMEC_FETCHBITS)) < 0x220000; i++)\r
- PicoCpuFM68k.Fetch[i] = (unsigned long)Pico_mcd->word_ram1M[r3 & 1] - 0x200000;\r
- for (i = M68K_FETCHBANK1*0x0c/0x100; (i<<(24-FAMEC_FETCHBITS)) < 0x0e0000; i++)\r
- PicoCpuFS68k.Fetch[i] = (unsigned long)Pico_mcd->word_ram1M[(r3&1)^1] - 0x0c0000;\r
- }\r
-#endif\r
}\r
\r
void pcd_state_loaded_mem(void)\r
const void *func_or_mh, int is_func)\r
{\r
xmap_set(map, M68K_MEM_SHIFT, start_addr, end_addr, func_or_mh, is_func);\r
+#ifdef EMU_F68K\r
+ // setup FAME fetchmap\r
+ if (!is_func)\r
+ {\r
+ int shiftout = 24 - FAMEC_FETCHBITS;\r
+ int i = start_addr >> shiftout;\r
+ uptr base = (uptr)func_or_mh - (i << shiftout);\r
+ for (; i <= (end_addr >> shiftout); i++)\r
+ PicoCpuFM68k.Fetch[i] = base;\r
+ }\r
+#endif\r
}\r
\r
// more specialized/optimized function (does same as above)\r
addr >>= 1;\r
for (i = start_addr >> shift; i <= end_addr >> shift; i++)\r
r8map[i] = r16map[i] = w8map[i] = w16map[i] = addr;\r
+#ifdef EMU_F68K\r
+ // setup FAME fetchmap\r
+ {\r
+ M68K_CONTEXT *ctx = is_sub ? &PicoCpuFS68k : &PicoCpuFM68k;\r
+ int shiftout = 24 - FAMEC_FETCHBITS;\r
+ i = start_addr >> shiftout;\r
+ addr = (uptr)ptr - (i << shiftout);\r
+ for (; i <= (end_addr >> shiftout); i++)\r
+ ctx->Fetch[i] = addr;\r
+ }\r
+#endif\r
}\r
\r
static u32 m68k_unmapped_read8(u32 a)\r
{\r
int i;\r
// by default, point everything to first 64k of ROM\r
- for (i = 0; i < M68K_FETCHBANK1; i++)\r
+ for (i = 0; i < M68K_FETCHBANK1 * 0xe0 / 0x100; i++)\r
PicoCpuFM68k.Fetch[i] = (unsigned long)Pico.rom - (i<<(24-FAMEC_FETCHBITS));\r
// now real ROM\r
for (i = 0; i < M68K_FETCHBANK1 && (i<<(24-FAMEC_FETCHBITS)) < Pico.romsize; i++)\r
PicoCpuFM68k.Fetch[i] = (unsigned long)Pico.rom;\r
- // .. and RAM\r
- for (i = M68K_FETCHBANK1*14/16; i < M68K_FETCHBANK1; i++)\r
- PicoCpuFM68k.Fetch[i] = (unsigned long)Pico.ram - (i<<(24-FAMEC_FETCHBITS));\r
+ // RAM already set\r
}\r
#endif\r
#ifdef EMU_M68K\r