add a hack for Decap Attack
[picodrive.git] / pico / memory.c
index c633c89..a46760d 100644 (file)
@@ -270,7 +270,12 @@ static NOINLINE u32 port_read(int i)
   u32 in, out;\r
 \r
   out = data_reg & ctrl_reg;\r
-  out |= 0x7f & ~ctrl_reg; // pull-ups\r
+\r
+  // pull-ups: should be 0x7f, but Decap Attack has a bug where it temp.\r
+  // disables output before doing TH-low read, so don't emulate it for TH.\r
+  // Decap Attack reportedly doesn't work on Nomad but works on must\r
+  // other MD revisions (different pull-up strength?).\r
+  out |= 0x3f & ~ctrl_reg;\r
 \r
   in = port_readers[i](i, out);\r
 \r
@@ -832,10 +837,10 @@ PICO_INTERNAL void PicoMemSetup(void)
     int i;\r
     // by default, point everything to first 64k of ROM\r
     for (i = 0; i < M68K_FETCHBANK1 * 0xe0 / 0x100; i++)\r
-      PicoCpuFM68k.Fetch[i] = (unsigned long)Pico.rom - (i<<(24-FAMEC_FETCHBITS));\r
+      PicoCpuFM68k.Fetch[i] = (uptr)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
+      PicoCpuFM68k.Fetch[i] = (uptr)Pico.rom;\r
     // RAM already set\r
   }\r
 #endif\r