-void m68k_write_memory_16(unsigned int address, unsigned int value)\r
-{\r
- if (PicoMCD&1) PicoWriteCD16w(address,(u16)value); else PicoWrite16(address,(u16)value);\r
-}\r
-\r
-void m68k_write_memory_32(unsigned int address, unsigned int value)\r
-{\r
- if (PicoMCD&1) PicoWriteCD32w(address, value); else PicoWrite32(address, value);\r
+/* it appears that Musashi doesn't always mask the unused bits */\r
+unsigned int m68k_read_memory_8 (unsigned int address) { return pm68k_read_memory_8 (address) & 0xff; }\r
+unsigned int m68k_read_memory_16(unsigned int address) { return pm68k_read_memory_16(address) & 0xffff; }\r
+unsigned int m68k_read_memory_32(unsigned int address) { return pm68k_read_memory_32(address); }\r
+void m68k_write_memory_8 (unsigned int address, unsigned int value) { pm68k_write_memory_8 (address, (u8)value); }\r
+void m68k_write_memory_16(unsigned int address, unsigned int value) { pm68k_write_memory_16(address,(u16)value); }\r
+void m68k_write_memory_32(unsigned int address, unsigned int value) { pm68k_write_memory_32(address, value); }\r
+#endif // !EMU_CORE_DEBUG\r
+\r
+static void m68k_mem_setup(void)\r
+{\r
+ pm68k_read_memory_8 = PicoRead8;\r
+ pm68k_read_memory_16 = PicoRead16;\r
+ pm68k_read_memory_32 = PicoRead32;\r
+ pm68k_write_memory_8 = PicoWrite8;\r
+ pm68k_write_memory_16 = PicoWrite16;\r
+ pm68k_write_memory_32 = PicoWrite32;\r
+ pm68k_read_memory_pcr_8 = m68k_read_memory_pcr_8;\r
+ pm68k_read_memory_pcr_16 = m68k_read_memory_pcr_16;\r
+ pm68k_read_memory_pcr_32 = m68k_read_memory_pcr_32;\r