merge mapper code from FCEUX
[fceu.git] / boards / 603-5052.c
diff --git a/boards/603-5052.c b/boards/603-5052.c
new file mode 100644 (file)
index 0000000..43b4e0a
--- /dev/null
@@ -0,0 +1,48 @@
+/* FCE Ultra - NES/Famicom Emulator\r
+ *\r
+ * Copyright notice for this file:\r
+ *  Copyright (C) 2005 CaH4e3\r
+ *\r
+ * This program is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\r
+ */\r
+\r
+#include "mapinc.h"\r
+#include "mmc3.h"\r
+\r
+static uint8 lut[4] = { 0x00, 0x02, 0x02, 0x03 };\r
+\r
+static DECLFW(UNL6035052ProtWrite)\r
+{\r
+  EXPREGS[0]=lut[V&3];  \r
+}\r
+\r
+static DECLFR(UNL6035052ProtRead)\r
+{\r
+  return EXPREGS[0];\r
+}\r
+\r
+static void UNL6035052Power(void)\r
+{\r
+  GenMMC3Power();\r
+  SetWriteHandler(0x4020,0x7FFF,UNL6035052ProtWrite);\r
+  SetReadHandler(0x4020,0x7FFF,UNL6035052ProtRead);\r
+}\r
+\r
+void UNL6035052_Init(CartInfo *info)\r
+{\r
+  GenMMC3_Init(info, 128, 256, 0, 0);\r
+  info->Power=UNL6035052Power;\r
+  AddExState(EXPREGS, 6, 0, "EXPR");\r
+}\r