protection and more mapper support for new mem code
[picodrive.git] / pico / memory.c
index 2eaac2a..da73961 100644 (file)
@@ -317,93 +317,6 @@ static void ctl_write_z80reset(u32 d)
   }\r
 }\r
 \r
-\r
-// for nonstandard reads\r
-// TODO: mv to carthw\r
-u32 OtherRead16End(u32 a, int realsize)\r
-{\r
-  u32 d=0;\r
-\r
-  // 32x test\r
-/*\r
-  if      (a == 0xa130ec) { d = 0x4d41; goto end; } // MA\r
-  else if (a == 0xa130ee) { d = 0x5253; goto end; } // RS\r
-  else if (a == 0xa15100) { d = 0x0080; goto end; }\r
-  else\r
-*/\r
-\r
-  // for games with simple protection devices, discovered by Haze\r
-  // some dumb detection is used, but that should be enough to make things work\r
-  if ((a>>22) == 1 && Pico.romsize >= 512*1024) {\r
-    if      (*(int *)(Pico.rom+0x123e4) == 0x00550c39 && *(int *)(Pico.rom+0x123e8) == 0x00000040) { // Super Bubble Bobble (Unl) [!]\r
-      if      (a == 0x400000) { d=0x55<<8; goto end; }\r
-      else if (a == 0x400002) { d=0x0f<<8; goto end; }\r
-    }\r
-    else if (*(int *)(Pico.rom+0x008c4) == 0x66240055 && *(int *)(Pico.rom+0x008c8) == 0x00404df9) { // Smart Mouse (Unl)\r
-      if      (a == 0x400000) { d=0x55<<8; goto end; }\r
-      else if (a == 0x400002) { d=0x0f<<8; goto end; }\r
-      else if (a == 0x400004) { d=0xaa<<8; goto end; }\r
-      else if (a == 0x400006) { d=0xf0<<8; goto end; }\r
-    }\r
-    else if (*(int *)(Pico.rom+0x00404) == 0x00a90600 && *(int *)(Pico.rom+0x00408) == 0x6708b013) { // King of Fighters '98, The (Unl) [!]\r
-      if      (a == 0x480000 || a == 0x4800e0 || a == 0x4824a0 || a == 0x488880) { d=0xaa<<8; goto end; }\r
-      else if (a == 0x4a8820) { d=0x0a<<8; goto end; }\r
-      // there is also a read @ 0x4F8820 which needs 0, but that is returned in default case\r
-    }\r
-    else if (*(int *)(Pico.rom+0x01b24) == 0x004013f9 && *(int *)(Pico.rom+0x01b28) == 0x00ff0000) { // Mahjong Lover (Unl) [!]\r
-      if      (a == 0x400000) { d=0x90<<8; goto end; }\r
-      else if (a == 0x401000) { d=0xd3<<8; goto end; } // this one doesn't seem to be needed, the code does 2 comparisons and only then\r
-                                                       // checks the result, which is of the above one. Left it just in case.\r
-    }\r
-    else if (*(int *)(Pico.rom+0x05254) == 0x0c3962d0 && *(int *)(Pico.rom+0x05258) == 0x00400055) { // Elf Wor (Unl)\r
-      if      (a == 0x400000) { d=0x55<<8; goto end; }\r
-      else if (a == 0x400004) { d=0xc9<<8; goto end; } // this check is done if the above one fails\r
-      else if (a == 0x400002) { d=0x0f<<8; goto end; }\r
-      else if (a == 0x400006) { d=0x18<<8; goto end; } // similar to above\r
-    }\r
-    // our default behaviour is to return whatever was last written a 0x400000-0x7fffff range (used by Squirrel King (R) [!])\r
-    // Lion King II, The (Unl) [!]  writes @ 400000 and wants to get that val @ 400002 and wites another val\r
-    // @ 400004 which is expected @ 400006, so we really remember 2 values here\r
-///    d = Pico.m.prot_bytes[(a>>2)&1]<<8;\r
-  }\r
-  else if (a == 0xa13000 && Pico.romsize >= 1024*1024) {\r
-    if      (*(int *)(Pico.rom+0xc8af0) == 0x30133013 && *(int *)(Pico.rom+0xc8af4) == 0x000f0240) { // Rockman X3 (Unl) [!]\r
-      d=0x0c; goto end;\r
-    }\r
-    else if (*(int *)(Pico.rom+0x28888) == 0x07fc0000 && *(int *)(Pico.rom+0x2888c) == 0x4eb94e75) { // Bug's Life, A (Unl) [!]\r
-      d=0x28; goto end; // does the check from RAM\r
-    }\r
-    else if (*(int *)(Pico.rom+0xc8778) == 0x30133013 && *(int *)(Pico.rom+0xc877c) == 0x000f0240) { // Super Mario Bros. (Unl) [!]\r
-      d=0x0c; goto end; // seems to be the same code as in Rockman X3 (Unl) [!]\r
-    }\r
-    else if (*(int *)(Pico.rom+0xf20ec) == 0x30143013 && *(int *)(Pico.rom+0xf20f0) == 0x000f0200) { // Super Mario 2 1998 (Unl) [!]\r
-      d=0x0a; goto end;\r
-    }\r
-  }\r
-  else if (a == 0xa13002) { // Pocket Monsters (Unl)\r
-    d=0x01; goto end;\r
-  }\r
-  else if (a == 0xa1303E) { // Pocket Monsters (Unl)\r
-    d=0x1f; goto end;\r
-  }\r
-  else if (a == 0x30fe02) {\r
-    // Virtua Racing - just for fun\r
-    // this seems to be some flag that SVP is ready or something similar\r
-    d=1; goto end;\r
-  }\r
-\r
-end:\r
-  elprintf(EL_UIO, "strange r%i: [%06x] %04x @%06x", realsize, a&0xffffff, d, SekPc);\r
-  return d;\r
-}\r
-\r
-void OtherWrite8End(u32 a,u32 d,int realsize)\r
-{\r
-  // for games with simple protection devices, discovered by Haze\r
-  if ((a>>22) == 1)\r
-;///    Pico.m.prot_bytes[(a>>2)&1] = (u8)d;\r
-}\r
-\r
 // -----------------------------------------------------------------\r
 \r
 // cart (save) RAM area (usually 0x200000 - ...)\r