updated bords/mappers/stuff to 0.98.15, lots of them got broken, asmcore support...
[fceu.git] / mappers / 57.c
similarity index 64%
rename from mappers/249.c
rename to mappers/57.c
index 6225d49..b64d270 100644 (file)
@@ -1,7 +1,7 @@
 /* FCE Ultra - NES/Famicom Emulator
  *
  * Copyright notice for this file:
- *  Copyright (C) 2002 Ben Parnell
+ *  Copyright (C) 2002 Xodnizel
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 #include "mapinc.h"
 
-uint8 doh;
 
-static DECLFW(Mapper249_write)
+
+static DECLFW(Mapper57_write)
 {
- switch(A&0xe001)
+ A&=0x8800;
+ if(A==0x8800)
  {
-  case 0x8000:doh=V;break;
-  case 0x8001:switch(doh&7)
-               {
-                case 0:VROM_BANK2(0x0000,V>>1);break;
-                case 1:VROM_BANK2(0x0800,V>>1);break;
-                case 2:VROM_BANK1(0x1000,V);break;
-//              case 6:ROM_BANK8(0xa000,V);break;
-//              case 2:ROM_BANK8(0x8000,V);break;
-               }
+  mapbyte1[0]=V;
+  if(V&0x80)
+   ROM_BANK32(2|(V>>6));
+  else
+  {
+   ROM_BANK16(0x8000,(V>>5)&3);
+   ROM_BANK16(0xc000,(V>>5)&3);
+  }
+  MIRROR_SET((V&0x8)>>3);
  }
-// printf("$%04x:$%02x\n",A,V);
+ else
+  mapbyte1[1]=V;
+ VROM_BANK8((mapbyte1[1]&3)|(mapbyte1[0]&7)|((mapbyte1[0]&0x10)>>1));
+ //printf("$%04x:$%02x\n",A,V);
 }
 
-void Mapper249_init(void)
+void Mapper57_init(void)
 {
 SetWriteHandler(0x8000,0xffff,Mapper249_write);
SetWriteHandler(0x8000,0xffff,Mapper57_write);
 }
-