*\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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
*\r
- * BMC 42-in-1\r
- * it seems now, mapper not reset-based,\r
- * tested on real hardware and it does menus switch by pressing just Select, not Reset\r
- * new registers behaviour proven this too\r
+ * BMC 42-in-1 "reset switch" + "select switch"\r
*\r
*/\r
\r
#include "mapinc.h"\r
\r
-static uint8 latche[2];\r
+static uint8 isresetbased = 0;\r
+static uint8 latche[2], reset;\r
static SFORMAT StateRegs[]=\r
{\r
- {&latche, sizeof(latche), "LATCHE"},\r
+ {&reset, 1, "RST"},\r
+ {latche, 2, "LATC"},\r
{0}\r
};\r
\r
static void Sync(void)\r
{\r
- uint8 bank = (latche[0]&0x1f)|((latche[0]&0x80)>>2)|((latche[1]&1))<<6;\r
+ uint8 bank;\r
+ if(isresetbased)\r
+ bank = (latche[0]&0x1f)|(reset<<5)|((latche[1]&1)<<6);\r
+ else\r
+ bank = (latche[0]&0x1f)|((latche[0]&0x80)>>2)|((latche[1]&1)<<6);\r
if(!(latche[0] & 0x20))\r
setprg32(0x8000,bank >> 1);\r
else\r
\r
static void M226Power(void)\r
{\r
- latche[0] = latche[1] = 0;\r
+ latche[0] = latche[1] = reset = 0;\r
Sync();\r
SetWriteHandler(0x8000,0xFFFF,M226Write);\r
SetReadHandler(0x8000,0xFFFF,CartBR);\r
\r
void Mapper226_Init(CartInfo *info)\r
{\r
+ isresetbased = 0;\r
info->Power=M226Power;\r
AddExState(&StateRegs, ~0, 0, 0);\r
GameStateRestore=StateRestore;\r
}\r
\r
+static void BMC42in1Reset(void)\r
+{\r
+ reset ^= 1;\r
+ Sync();\r
+}\r
+\r
+void BMC42in1r_Init(CartInfo *info)\r
+{\r
+ isresetbased = 1;\r
+ info->Power=M226Power;\r
+ info->Reset=BMC42in1Reset;\r
+ AddExState(&StateRegs, ~0, 0, 0);\r
+ GameStateRestore=StateRestore;\r
+}\r