--- /dev/null
+/* FCE Ultra - NES/Famicom Emulator\r
+ *\r
+ * Copyright notice for this file:\r
+ * Copyright (C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ *\r
+ * FDS Conversion\r
+ *\r
+ */\r
+\r
+#include "mapinc.h"\r
+\r
+static uint8 chr;\r
+static SFORMAT StateRegs[]=\r
+{\r
+ {&chr, 1, "CHR"},\r
+ {0}\r
+};\r
+\r
+static void Sync(void)\r
+{\r
+ setprg2r(0,0xE000,0);\r
+ setprg2r(0,0xE800,0);\r
+ setprg2r(0,0xF000,0);\r
+ setprg2r(0,0xF800,0);\r
+\r
+ setprg8r(1,0x6000,3);\r
+ setprg8r(1,0x8000,0);\r
+ setprg8r(1,0xA000,1);\r
+ setprg8r(1,0xC000,2);\r
+\r
+ setchr8(chr & 1);\r
+ setmirror(MI_V);\r
+}\r
+\r
+static DECLFW(LE05Write)\r
+{\r
+ chr = V;\r
+ Sync();\r
+}\r
+\r
+static void LE05Power(void)\r
+{\r
+ Sync();\r
+ SetReadHandler(0x6000,0xFFFF,CartBR);\r
+ SetWriteHandler(0x8000,0xFFFF,LE05Write);\r
+}\r
+\r
+void LE05_Init(CartInfo *info)\r
+{\r
+ info->Power=LE05Power;\r
+ AddExState(&StateRegs, ~0, 0, 0);\r
+}\r