...etc...

[[Split portion of a mixed commit.]]
This commit is contained in:
zeromus 2006-07-18 06:35:48 +00:00
parent d5ffacea03
commit 7934852d9d
182 changed files with 17500 additions and 453 deletions

75
boards/01-222.c Normal file
View File

@ -0,0 +1,75 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2006 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 reg[4];
static SFORMAT StateRegs[]=
{
{reg, 4, "REGS"},
{0}
};
static void Sync(void)
{
setprg32(0x8000,(reg[2]>>2)&1);
setchr8(reg[2]&3);
}
static DECLFW(UNL22211WriteLo)
{
// FCEU_printf("bs %04x %02x\n",A,V);
reg[A&3]=V;
}
static DECLFW(UNL22211WriteHi)
{
// FCEU_printf("bs %04x %02x\n",A,V);
Sync();
}
static DECLFR(UNL22211ReadLo)
{
if(reg[3])
return reg[2];
else
return X.DB;
}
static void UNL22211Power(void)
{
Sync();
SetReadHandler(0x8000,0xFFFF,CartBR);
SetReadHandler(0x4100,0x4100,UNL22211ReadLo);
SetWriteHandler(0x4100,0x4103,UNL22211WriteLo);
SetWriteHandler(0x8000,0xFFFF,UNL22211WriteHi);
}
static void StateRestore(int version)
{
Sync();
}
void UNL22211_Init(CartInfo *info)
{
info->Power=UNL22211Power;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

92
boards/112.c Normal file
View File

@ -0,0 +1,92 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 reg[8];
static uint8 mirror, cmd;
static uint8 *WRAM=NULL;
static SFORMAT StateRegs[]=
{
{&cmd, 1, "CMD"},
{&mirror, 1, "MIRR"},
{reg, 8, "REGS"},
{0}
};
static void Sync(void)
{
setmirror(mirror^1);
setprg8(0x8000,reg[0]);
setprg8(0xA000,reg[1]);
setchr2(0x0000,reg[2]>>1);
setchr2(0x0800,reg[3]>>1);
setchr1(0x1000,reg[4]);
setchr1(0x1400,reg[5]);
setchr1(0x1800,reg[6]);
setchr1(0x1C00,reg[7]);
}
static DECLFW(M112Write)
{
// FCEU_printf("bs %04x %02x\n",A,V);
switch(A)
{
case 0xe000: mirror=V&1; Sync(); ;break;
case 0x8000: cmd=V&7; break;
case 0xa000: reg[cmd]=V; Sync(); break;
// default: FCEU_printf("bs %04x %02x\n",A,V);
}
}
static void M112Close(void)
{
if(WRAM)
FCEU_gfree(WRAM);
WRAM = NULL;
}
static void M112Power(void)
{
setprg16(0xC000,~0);
setprg8r(0x10,0x6000,0);
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,M112Write);
SetWriteHandler(0x4020,0x5FFF,M112Write);
SetReadHandler(0x6000,0x7FFF,CartBR);
SetWriteHandler(0x6000,0x7FFF,CartBW);
}
static void StateRestore(int version)
{
Sync();
}
void Mapper112_Init(CartInfo *info)
{
info->Power=M112Power;
info->Close=M112Close;
GameStateRestore=StateRestore;
WRAM=(uint8*)FCEU_gmalloc(8192);
SetupCartPRGMapping(0x10,WRAM,8192,1);
AddExState(WRAM, 8192, 0, "WRAM");
AddExState(&StateRegs, ~0, 0, 0);
}

101
boards/117.c Normal file
View File

@ -0,0 +1,101 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 prgreg[4], chrreg[8];
static uint8 IRQa, IRQCount, IRQLatch;
static SFORMAT StateRegs[]=
{
{&IRQa, 1, "IRQA"},
{&IRQCount, 1, "IRQC"},
{&IRQLatch, 1, "IRQL"},
{prgreg, 4, "PREGS"},
{chrreg, 8, "CREGS"},
{0}
};
static void Sync(void)
{
int i;
setprg8(0x8000,prgreg[0]);
setprg8(0xa000,prgreg[1]);
setprg8(0xc000,prgreg[2]);
setprg8(0xe000,prgreg[3]);
for(i=0; i<8; i++)
setchr1(i<<10,chrreg[i]);
}
static DECLFW(M117Write)
{
if(A<0x8004)
{
prgreg[A&3]=V;
Sync();
}
else if((A>=0xA000)&&(A<=0xA007))
{
chrreg[A&7]=V;
Sync();
}
else switch(A)
{
case 0xc001: IRQLatch=V; break;
case 0xc003: IRQCount=IRQLatch; IRQa|=2; break;
case 0xe000: IRQa&=~1; IRQa|=V&1; X6502_IRQEnd(FCEU_IQEXT); break;
case 0xc002: X6502_IRQEnd(FCEU_IQEXT); break;
}
}
static void M117Power(void)
{
prgreg[0]=~3; prgreg[1]=~2; prgreg[2]=~1; prgreg[3]=~0;
Sync();
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,M117Write);
}
static void M117IRQHook(void)
{
if(IRQa==3&&IRQCount)
{
IRQCount--;
if(!IRQCount)
{
IRQa&=1;
X6502_IRQBegin(FCEU_IQEXT);
}
}
}
static void StateRestore(int version)
{
Sync();
}
void Mapper117_Init(CartInfo *info)
{
info->Power=M117Power;
GameHBIRQHook=M117IRQHook;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

117
boards/164.c Normal file
View File

@ -0,0 +1,117 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 cmd;
static uint8 DRegs[8];
static SFORMAT StateRegs[]=
{
{&cmd, 1, "CMD"},
{DRegs, 8, "DREG"},
{0}
};
static void Sync(void)
{
setprg32(0x8000,(DRegs[0]<<4)|(DRegs[1]&0xF));
setchr8(0);
}
static void StateRestore(int version)
{
Sync();
}
static DECLFW(Write)
{
switch (A&0x7300)
{
case 0x5100: DRegs[0]=V; Sync(); break;
case 0x5000: DRegs[1]=V; Sync(); break;
}
}
static DECLFW(Write2)
{
// FCEU_printf("bs %04x %02x\n",A,V);
switch (A&0x7300)
{
case 0x5200: DRegs[0]=V; Sync(); break;
case 0x5000: DRegs[1]=V; Sync(); break;
}
}
static uint8 WRAM[8192];
static DECLFR(AWRAM)
{
return(WRAM[A-0x6000]);
}
static DECLFW(BWRAM)
{
WRAM[A-0x6000]=V;
}
static void Power(void)
{
memset(DRegs,0,8);
DRegs[1]=0xFF;
cmd=0;
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x4020,0xFFFF,Write);
SetReadHandler(0x6000,0x7FFF,AWRAM);
SetWriteHandler(0x6000,0x7FFF,BWRAM);
Sync();
}
static void M163HB(void)
{
if(scanline==127&&DRegs[1]&0x80)
setchr4(0x0000,1);
}
static void Power2(void)
{
memset(DRegs,0,8);
DRegs[1]=0xFF;
cmd=0;
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x4020,0xFFFF,Write2);
SetReadHandler(0x6000,0x7FFF,AWRAM);
SetWriteHandler(0x6000,0x7FFF,BWRAM);
Sync();
}
void Mapper164_Init(CartInfo *info)
{
info->Power=Power;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}
void Mapper163_Init(CartInfo *info)
{
info->Power=Power2;
GameHBIRQHook=M163HB;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

117
boards/183.c Normal file
View File

@ -0,0 +1,117 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Gimmick Bootleg
*/
#include "mapinc.h"
static uint8 prg[4];
static uint8 chr[8];
static uint8 IRQCount;
static uint8 IRQPre;
static uint8 IRQa;
static SFORMAT StateRegs[]=
{
{prg, 4, "PRG"},
{chr, 8, "CHR"},
{&IRQCount, 1, "IRQCOUNT"},
{&IRQPre, 1, "IRQPRE"},
{&IRQa, 1, "IRQA"},
{0}
};
static void SyncPrg(void)
{
setprg8(0x6000,0);
setprg8(0x8000,prg[0]);
setprg8(0xA000,prg[1]);
setprg8(0xC000,prg[2]);
setprg8(0xE000,~0);
}
static void SyncChr(void)
{
int i;
for(i=0; i<8; i++)
setchr1(i<<10,chr[i]);
}
static void StateRestore(int version)
{
SyncPrg();
SyncChr();
}
static DECLFW(M183Write)
{
if(((A&0xF80C)>=0xB000)&&((A&0xF80C)<=0xE00C))
{
uint8 index=(((A>>11)-6)|(A>>3))&7;
chr[index]=(chr[index]&(0xF0>>(A&4)))|((V&0x0F)<<(A&4));
SyncChr();
}
else switch (A&0xF80C)
{
case 0x8800: prg[0]=V; SyncPrg(); break;
case 0xA800: prg[1]=V; SyncPrg(); break;
case 0xA000: prg[2]=V; SyncPrg(); break;
case 0x9800: switch (V&3)
{
case 0: setmirror(MI_V); break;
case 1: setmirror(MI_H); break;
case 2: setmirror(MI_0); break;
case 3: setmirror(MI_1); break;
}
break;
case 0xF000: IRQCount=((IRQCount&0xF0)|(V&0xF)); break;
case 0xF004: IRQCount=((IRQCount&0x0F)|((V&0xF)<<4)); break;
case 0xF008: IRQa=V; if(!V)IRQPre=0; X6502_IRQEnd(FCEU_IQEXT); break;
case 0xF00C: IRQPre=16; break;
}
}
static void M183IRQCounter(void)
{
if(IRQa)
{
IRQCount++;
if((IRQCount-IRQPre)==238)
X6502_IRQBegin(FCEU_IQEXT);
}
}
static void M183Power(void)
{
IRQPre=IRQCount=IRQa=0;
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,M183Write);
SetReadHandler(0x6000,0x7FFF,CartBR);
SyncPrg();
SyncChr();
}
void Mapper183_Init(CartInfo *info)
{
info->Power=M183Power;
GameHBIRQHook=M183IRQCounter;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

115
boards/185.c Normal file
View File

@ -0,0 +1,115 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "mapinc.h"
static uint8 *DummyCHR=NULL;
static uint8 datareg;
static void(*Sync)(void);
static SFORMAT StateRegs[]=
{
{&datareg, 1, "DREG"},
{0}
};
// on off
//1 0x0F, 0xF0 - Bird Week
//2 0x33, 0x00 - B-Wings
//3 0x11, 0x00 - Mighty Bomb Jack
//4 0x22, 0x20 - Sansuu 1 Nen, Sansuu 2 Nen
//5 0xFF, 0x00 - Sansuu 3 Nen
//6 0x21, 0x13 - Spy vs Spy
//7 0x20, 0x21 - Seicross
static void Sync185(void)
{
// little dirty eh? ;_)
if((datareg&3)&&(datareg!=0x13)) // 1, 2, 3, 4, 5, 6
setchr8(0);
else
setchr8r(0x10,0);
}
static void Sync181(void)
{
if(!(datareg&1)) // 7
setchr8(0);
else
setchr8r(0x10,0);
}
static DECLFW(MWrite)
{
datareg=V;
Sync();
}
static void MPower(void)
{
datareg=0;
Sync();
setprg16(0x8000,0);
setprg16(0xC000,~0);
SetWriteHandler(0x8000,0xFFFF,MWrite);
SetReadHandler(0x8000,0xFFFF,CartBR);
}
static void MClose(void)
{
if(DummyCHR)
FCEU_gfree(DummyCHR);
DummyCHR=NULL;
}
static void MRestore(int version)
{
Sync();
}
void Mapper185_Init(CartInfo *info)
{
int x;
Sync=Sync185;
info->Power=MPower;
info->Close=MClose;
GameStateRestore=MRestore;
DummyCHR=(uint8*)FCEU_gmalloc(8192);
for(x=0;x<8192;x++)
DummyCHR[x]=0xff;
SetupCartCHRMapping(0x10,DummyCHR,8192,0);
AddExState(StateRegs, ~0, 0, 0);
}
void Mapper181_Init(CartInfo *info)
{
int x;
Sync=Sync181;
info->Power=MPower;
info->Close=MClose;
GameStateRestore=MRestore;
DummyCHR=(uint8*)FCEU_gmalloc(8192);
for(x=0;x<8192;x++)
DummyCHR[x]=0xff;
SetupCartCHRMapping(0x10,DummyCHR,8192,0);
AddExState(StateRegs, ~0, 0, 0);
}

104
boards/186.c Normal file
View File

@ -0,0 +1,104 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Family Study Box by Fukutake Shoten
*/
#include "mapinc.h"
static uint8 SWRAM[2816];
static uint8 *WRAM=NULL;
static uint8 regs[4];
static SFORMAT StateRegs[]=
{
{regs, 4, "DREG"},
{SWRAM, 2816, "SWRAM"},
{0}
};
static void Sync(void)
{
setprg8r(0x10,0x6000,regs[0]>>6);
setprg16(0x8000,regs[1]);
setprg16(0xc000,0);
}
static DECLFW(M186Write)
{
if(A&0x4203) regs[A&3]=V;
Sync();
}
static DECLFR(M186Read)
{
switch(A)
{
case 0x4200: return 0x00; break;
case 0x4201: return 0x00; break;
case 0x4202: return 0x40; break;
case 0x4203: return 0x00; break;
}
return 0xFF;
}
static DECLFR(ASWRAM)
{
return(SWRAM[A-0x4400]);
}
static DECLFW(BSWRAM)
{
SWRAM[A-0x4400]=V;
}
static void M186Power(void)
{
setchr8(0);
SetReadHandler(0x6000,0xFFFF,CartBR);
SetWriteHandler(0x6000,0xFFFF,CartBW);
SetReadHandler(0x4200,0x43FF,M186Read);
SetWriteHandler(0x4200,0x43FF,M186Write);
SetReadHandler(0x4400,0x4EFF,ASWRAM);
SetWriteHandler(0x4400,0x4EFF,BSWRAM);
regs[0]=regs[1]=regs[2]=regs[3];
Sync();
}
static void M186Close(void)
{
if(WRAM)
FCEU_gfree(WRAM);
WRAM=NULL;
}
static void M186Restore(int version)
{
Sync();
}
void Mapper186_Init(CartInfo *info)
{
info->Power=M186Power;
info->Close=M186Close;
GameStateRestore=M186Restore;
WRAM=(uint8*)FCEU_gmalloc(32768);
SetupCartPRGMapping(0x10,WRAM,32768,1);
AddExState(WRAM, 32768, 0, "WRAM");
AddExState(StateRegs, ~0, 0, 0);
}

105
boards/187.c Normal file
View File

@ -0,0 +1,105 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
#include "mmc3.h"
#include "../sound.h"
static void M187CW(uint32 A, uint8 V)
{
if((A&0x1000)==((MMC3_cmd&0x80)<<5))
setchr1(A,V|0x100);
else
setchr1(A,V);
}
static void M187PW(uint32 A, uint8 V)
{
if(EXPREGS[0]&0x80)
{
uint8 bank=EXPREGS[0]&0x1F;
if(EXPREGS[0]&0x20)
setprg32(0x8000,bank>>2);
else
{
setprg16(0x8000,bank);
setprg16(0xC000,bank);
}
}
else
setprg8(A,V&0x3F);
}
static DECLFW(M187Write8000)
{
EXPREGS[2]=1;
MMC3_CMDWrite(A,V);
}
static DECLFW(M187Write8001)
{
if(EXPREGS[2])
MMC3_CMDWrite(A,V);
}
static DECLFW(M187Write8003)
{
EXPREGS[2]=0;
if(V==0x28)setprg8(0xC000,0x17);
else if(V==0x2A)setprg8(0xA000,0x0F);
}
static DECLFW(M187WriteLo)
{
EXPREGS[1]=V;
if(A==0x5000)
{
EXPREGS[0]=V;
FixMMC3PRG(MMC3_cmd);
}
}
static uint8 prot_data[4] = { 0x83, 0x83, 0x42, 0x00 };
static DECLFR(M187Read)
{
return prot_data[EXPREGS[1]&3];
}
static void M187Power(void)
{
EXPREGS[0]=EXPREGS[1]=EXPREGS[2]=0;
GenMMC3Power();
Write_IRQFM(0x4017,0x40);
SetReadHandler(0x5000,0x5FFF,M187Read);
SetWriteHandler(0x5000,0x5FFF,M187WriteLo);
SetWriteHandler(0x8000,0x8000,M187Write8000);
SetWriteHandler(0x8001,0x8001,M187Write8001);
SetWriteHandler(0x8003,0x8003,M187Write8003);
}
void Mapper187_Init(CartInfo *info)
{
GenMMC3_Init(info, 256, 256, 0, 0);
pwrap=M187PW;
cwrap=M187CW;
info->Power=M187Power;
AddExState(EXPREGS, 3, 0, "EXPR");
}

48
boards/189.c Normal file
View File

@ -0,0 +1,48 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
#include "mmc3.h"
static void M189PW(uint32 A, uint8 V)
{
setprg32(0x8000,EXPREGS[0]&3);
}
static DECLFW(M189Write)
{
EXPREGS[0]=V|(V>>4); //actually, there is a two versions of 189 mapper with hi or lo bits bankswitching.
FixMMC3PRG(MMC3_cmd);
}
static void M189Power(void)
{
EXPREGS[0]=EXPREGS[1]=0;
GenMMC3Power();
SetWriteHandler(0x4120,0x7FFF,M189Write);
}
void Mapper189_Init(CartInfo *info)
{
GenMMC3_Init(info, 256, 256, 0, 0);
pwrap=M189PW;
info->Power=M189Power;
AddExState(EXPREGS, 2, 0, "EXPR");
}

95
boards/199.c Normal file
View File

@ -0,0 +1,95 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2006 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Dragon Ball Z 2 - Gekishin Freeza! (C)
* Dragon Ball Z Gaiden - Saiya Jin Zetsumetsu Keikaku (C)
* San Guo Zhi 2 (C)
*
*/
#include "mapinc.h"
#include "mmc3.h"
static void M199PW(uint32 A, uint8 V)
{
setprg8(A,V);
setprg8(0xC000,EXPREGS[0]);
setprg8(0xE000,EXPREGS[1]);
}
static void M199CW(uint32 A, uint8 V)
{
setchr1r((V<8)?0x10:0x00,A,V);
setchr1r((DRegBuf[0]<8)?0x10:0x00,0x0000,DRegBuf[0]);
setchr1r((EXPREGS[2]<8)?0x10:0x00,0x0400,EXPREGS[2]);
setchr1r((DRegBuf[1]<8)?0x10:0x00,0x0800,DRegBuf[1]);
setchr1r((EXPREGS[3]<8)?0x10:0x00,0x0c00,EXPREGS[3]);
}
static void M199MW(uint8 V)
{
// FCEU_printf("%02x\n",V);
switch(V&3)
{
case 0: setmirror(MI_V); break;
case 1: setmirror(MI_H); break;
case 2: setmirror(MI_0); break;
case 3: setmirror(MI_1); break;
}
}
static DECLFW(M199Write)
{
if((A==0x8001)&&(MMC3_cmd&8))
{
// FCEU_printf("%02x=>%02x\n",MMC3_cmd,V);
EXPREGS[MMC3_cmd&3]=V;
FixMMC3PRG(MMC3_cmd);
FixMMC3CHR(MMC3_cmd);
}
else
if(A<0xC000)
MMC3_CMDWrite(A,V);
else
MMC3_IRQWrite(A,V);
}
static void M199Power(void)
{
EXPREGS[0]=~1;
EXPREGS[1]=~0;
EXPREGS[2]=1;
EXPREGS[3]=3;
GenMMC3Power();
SetWriteHandler(0x8000,0xFFFF,M199Write);
}
void Mapper199_Init(CartInfo *info)
{
int CHRRAMSize=1024*8;
GenMMC3_Init(info, 512, 256, 8, info->battery);
cwrap=M199CW;
pwrap=M199PW;
mwrap=M199MW;
info->Power=M199Power;
CHRRAM=(uint8*)FCEU_gmalloc(CHRRAMSize);
SetupCartCHRMapping(0x10, CHRRAM, CHRRAMSize, 1);
AddExState(CHRRAM, CHRRAMSize, 0, "CHRR");
AddExState(EXPREGS, 4, 0, "EXPR");
}

83
boards/208.c Normal file
View File

@ -0,0 +1,83 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
#include "mmc3.h"
static uint8 lut[256]={
0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x59, 0x49, 0x19, 0x09, 0x59, 0x49, 0x19, 0x09,
0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x51, 0x41, 0x11, 0x01, 0x51, 0x41, 0x11, 0x01,
0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x59, 0x49, 0x19, 0x09, 0x59, 0x49, 0x19, 0x09,
0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x51, 0x41, 0x11, 0x01, 0x51, 0x41, 0x11, 0x01,
0x00, 0x10, 0x40, 0x50, 0x00, 0x10, 0x40, 0x50,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x08, 0x18, 0x48, 0x58, 0x08, 0x18, 0x48, 0x58,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x10, 0x40, 0x50, 0x00, 0x10, 0x40, 0x50,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x08, 0x18, 0x48, 0x58, 0x08, 0x18, 0x48, 0x58,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x58, 0x48, 0x18, 0x08, 0x58, 0x48, 0x18, 0x08,
0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x50, 0x40, 0x10, 0x00, 0x50, 0x40, 0x10, 0x00,
0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x58, 0x48, 0x18, 0x08, 0x58, 0x48, 0x18, 0x08,
0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x50, 0x40, 0x10, 0x00, 0x50, 0x40, 0x10, 0x00,
0x01, 0x11, 0x41, 0x51, 0x01, 0x11, 0x41, 0x51,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x19, 0x49, 0x59, 0x09, 0x19, 0x49, 0x59,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x11, 0x41, 0x51, 0x01, 0x11, 0x41, 0x51,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x19, 0x49, 0x59, 0x09, 0x19, 0x49, 0x59,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
static void M208PW(uint32 A, uint8 V)
{
setprg32(0x8000,EXPREGS[5]);
}
static DECLFW(M208Write)
{
EXPREGS[5]=(V&0x1)|((V>>3)&0x2);
FixMMC3PRG(MMC3_cmd);
}
static DECLFW(M208ProtWrite)
{
if(A<=0x57FF)
EXPREGS[4]=V;
else
EXPREGS[(A&0x03)]=V^lut[EXPREGS[4]];
}
static DECLFR(M208ProtRead)
{
return(EXPREGS[(A&0x3)]);
}
static void M208Power(void)
{
EXPREGS[5]=3;
GenMMC3Power();
SetWriteHandler(0x4800,0x4FFF,M208Write);
SetWriteHandler(0x5000,0x5fff,M208ProtWrite);
SetReadHandler(0x5800,0x5FFF,M208ProtRead);
SetReadHandler(0x8000,0xffff,CartBR);
}
void Mapper208_Init(CartInfo *info)
{
GenMMC3_Init(info, 128, 256, 0, 0);
pwrap=M208PW;
info->Power=M208Power;
AddExState(EXPREGS, 6, 0, "EXPR");
}

103
boards/222.c Normal file
View File

@ -0,0 +1,103 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "mapinc.h"
static uint8 IRQCount, IRQPre;
static uint8 IRQa;
static uint8 prg_reg[2];
static uint8 chr_reg[8];
static SFORMAT StateRegs[]=
{
{&IRQCount, 1, "IRQC"},
{&IRQa, 1, "IRQA"},
{prg_reg, 2, "PRG"},
{chr_reg, 8, "CHR"},
{0}
};
static void M222IRQ(void)
{
if(IRQa)
{
IRQCount++;
if((IRQCount)>=240)
{
X6502_IRQBegin(FCEU_IQEXT);
IRQa=0;
}
}
}
static void Sync(void)
{
int i;
setprg8(0x8000,prg_reg[0]);
setprg8(0xA000,prg_reg[1]);
for(i=0; i<8; i++)
setchr1(i<<10,chr_reg[i]);
}
static DECLFW(M222Write)
{
switch(A&0xF003)
{
case 0x8000: prg_reg[0]=V; break;
case 0xA000: prg_reg[1]=V; break;
case 0xB000: chr_reg[0]=V; break;
case 0xB002: chr_reg[1]=V; break;
case 0xC000: chr_reg[2]=V; break;
case 0xC002: chr_reg[3]=V; break;
case 0xD000: chr_reg[4]=V; break;
case 0xD002: chr_reg[5]=V; break;
case 0xE000: chr_reg[6]=V; break;
case 0xE002: chr_reg[7]=V; break;
// case 0xF000: FCEU_printf("%04x:%02x %d\n",A,V,scanline); IRQa=V; if(!V)IRQPre=0; X6502_IRQEnd(FCEU_IQEXT); break;
// / case 0xF001: FCEU_printf("%04x:%02x %d\n",A,V,scanline); IRQCount=V; break;
// case 0xF002: FCEU_printf("%04x:%02x %d\n",A,V,scanline); break;
// case 0xD001: IRQa=V; X6502_IRQEnd(FCEU_IQEXT); FCEU_printf("%04x:%02x %d\n",A,V,scanline); break;
case 0xC001: IRQPre=0; FCEU_printf("%04x:%02x %d\n",A,V,scanline); break;
case 0xF000: IRQPre=8; IRQCount=V; IRQa=V; X6502_IRQEnd(FCEU_IQEXT); FCEU_printf("%04x:%02x %d\n",A,V,scanline); break;
default: FCEU_printf("%04x:%02x %d\n",A,V,scanline);
}
Sync();
}
static void M222Power(void)
{
setprg16(0xC000,~0);
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,M222Write);
}
static void StateRestore(int version)
{
Sync();
}
void Mapper222_Init(CartInfo *info)
{
info->Power=M222Power;
GameHBIRQHook=M222IRQ;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

70
boards/235.c Normal file
View File

@ -0,0 +1,70 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint16 cmdreg;
static SFORMAT StateRegs[]=
{
{&cmdreg, 2, "CMDREG"},
{0}
};
static void Sync(void)
{
if(cmdreg&0x400)
setmirror(MI_0);
else
setmirror(((cmdreg>>13)&1)^1);
if(cmdreg&0x800)
{
setprg16(0x8000,((cmdreg&0x300)>>3)|((cmdreg&0x1F)<<1)|((cmdreg>>12)&1));
setprg16(0xC000,((cmdreg&0x300)>>3)|((cmdreg&0x1F)<<1)|((cmdreg>>12)&1));
}
else
setprg32(0x8000,((cmdreg&0x300)>>4)|(cmdreg&0x1F));
}
static DECLFW(M235Write)
{
cmdreg=A;
Sync();
}
static void M235Power(void)
{
setchr8(0);
SetWriteHandler(0x8000,0xFFFF,M235Write);
SetReadHandler(0x8000,0xFFFF,CartBR);
cmdreg=0;
Sync();
}
static void M235Restore(int version)
{
Sync();
}
void Mapper235_Init(CartInfo *info)
{
info->Power=M235Power;
GameStateRestore=M235Restore;
AddExState(&StateRegs, ~0, 0, 0);
}

91
boards/43.c Normal file
View File

@ -0,0 +1,91 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2006 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 reg;
static uint8 IRQCount, IRQa;
static SFORMAT StateRegs[]=
{
{&IRQCount, 1, "IRQC"},
{&IRQa, 1, "IRQA"},
{&reg, 1, "REG"},
{0}
};
static void Sync(void)
{
setprg4(0x5000,16);
setprg8(0x6000,2);
setprg8(0x8000,1);
setprg8(0xa000,0);
setprg8(0xc000,reg);
setprg8(0xe000,9);
setchr8(0);
}
static DECLFW(M43Write)
{
int transo[8]={4,3,4,4,4,7,5,6};
switch(A&0xf1ff)
{
case 0x4022: reg=transo[V&7]; Sync(); break;
case 0x8122: IRQa=V&1; IRQCount=0; break;
}
}
static void M43Power(void)
{
reg=0;
Sync();
// SetReadHandler(0x5000,0x5fff,CartBR);
SetReadHandler(0x5000,0xffff,CartBR);
SetWriteHandler(0x4020,0xffff,M43Write);
}
static void M43Reset(void)
{
}
static void FP_FASTAPASS(1) M43IRQHook(int a)
{
IRQCount+=a;
if(IRQa)
if(IRQCount>=4096)
{
IRQa=0;
X6502_IRQBegin(FCEU_IQEXT);
}
}
static void StateRestore(int version)
{
Sync();
}
void Mapper43_Init(CartInfo *info)
{
info->Reset=M43Reset;
info->Power=M43Power;
MapIRQHook=M43IRQHook;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

92
boards/57.c Normal file
View File

@ -0,0 +1,92 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "mapinc.h"
static uint8 prg_reg;
static uint8 chr_reg;
static uint8 hrd_flag;
static SFORMAT StateRegs[]=
{
{&hrd_flag, 1, "DIPSW"},
{&prg_reg, 1, "PRG"},
{&chr_reg, 1, "CHR"},
{0}
};
static void Sync(void)
{
if(prg_reg&0x80)
setprg32(0x8000,prg_reg>>6);
else
{
setprg16(0x8000,(prg_reg>>5)&3);
setprg16(0xC000,(prg_reg>>5)&3);
}
setmirror((prg_reg&8)>>3);
setchr8((chr_reg&3)|(prg_reg&7)|((prg_reg&0x10)>>1));
}
static DECLFR(M57Read)
{
return hrd_flag;
}
static DECLFW(M57Write)
{
if((A&0x8800)==0x8800)
prg_reg=V;
else
chr_reg=V;
Sync();
}
static void M57Power(void)
{
prg_reg=0;
chr_reg=0;
hrd_flag=0;
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,M57Write);
SetReadHandler(0x6000,0x6000,M57Read);
Sync();
}
static void M57Reset()
{
hrd_flag++;
hrd_flag&=3;
FCEU_printf("Select Register = %02x\n",hrd_flag);
}
static void StateRestore(int version)
{
Sync();
}
void Mapper57_Init(CartInfo *info)
{
info->Power=M57Power;
info->Reset=M57Reset;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

48
boards/603-5052.c Normal file
View File

@ -0,0 +1,48 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
#include "mmc3.h"
static uint8 lut[4] = { 0x00, 0x02, 0x02, 0x03 };
static DECLFW(UNL6035052ProtWrite)
{
EXPREGS[0]=lut[V&3];
}
static DECLFR(UNL6035052ProtRead)
{
return EXPREGS[0];
}
static void UNL6035052Power(void)
{
GenMMC3Power();
SetWriteHandler(0x4020,0x7FFF,UNL6035052ProtWrite);
SetReadHandler(0x4020,0x7FFF,UNL6035052ProtRead);
}
void UNL6035052_Init(CartInfo *info)
{
GenMMC3_Init(info, 128, 256, 0, 0);
info->Power=UNL6035052Power;
AddExState(EXPREGS, 6, 0, "EXPR");
}

81
boards/8157.c Normal file
View File

@ -0,0 +1,81 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint16 cmdreg;
static uint8 invalid_data;
static SFORMAT StateRegs[]=
{
{&invalid_data, 1, "INVD"},
{&cmdreg, 2, "CMDREG"},
{0}
};
static void Sync(void)
{
setprg16r((cmdreg&0x060)>>5,0x8000,(cmdreg&0x01C)>>2);
setprg16r((cmdreg&0x060)>>5,0xC000,(cmdreg&0x200)?(~0):0);
setmirror(((cmdreg&2)>>1)^1);
}
static DECLFR(UNL8157Read)
{
if(invalid_data&&cmdreg&0x100)
return 0xFF;
else
return CartBR(A);
}
static DECLFW(UNL8157Write)
{
cmdreg=A;
Sync();
}
static void UNL8157Power(void)
{
setchr8(0);
SetWriteHandler(0x8000,0xFFFF,UNL8157Write);
SetReadHandler(0x8000,0xFFFF,UNL8157Read);
cmdreg=0x200;
invalid_data=1;
Sync();
}
static void UNL8157Reset(void)
{
cmdreg=0;
invalid_data^=1;
Sync();
}
static void UNL8157Restore(int version)
{
Sync();
}
void UNL8157_Init(CartInfo *info)
{
info->Power=UNL8157Power;
info->Reset=UNL8157Reset;
GameStateRestore=UNL8157Restore;
AddExState(&StateRegs, ~0, 0, 0);
}

93
boards/8237.c Normal file
View File

@ -0,0 +1,93 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
#include "mmc3.h"
static uint8 cmdin;
static uint8 UNL8237_perm[8] = {0, 2, 6, 1, 7, 3, 4, 5};
static void UNL8237CW(uint32 A, uint8 V)
{
setchr1(A,((EXPREGS[1]&4)<<6)|V);
}
static void UNL8237PW(uint32 A, uint8 V)
{
if(EXPREGS[0]&0x80)
{
if(EXPREGS[0]&0x20)
setprg32(0x8000,(EXPREGS[0]&0xF)>>1);
else
{
setprg16(0x8000,(EXPREGS[0]&0x1F));
setprg16(0xC000,(EXPREGS[0]&0x1F));
}
}
else
setprg8(A,V&0x3F);
}
static DECLFW(UNL8237Write)
{
if((A&0xF000)==0xF000)
IRQCount=V;
else if((A&0xF000)==0xE000)
X6502_IRQEnd(FCEU_IQEXT);
else switch(A&0xE001)
{
case 0x8000: setmirror(((V|(V>>7))&1)^1); break;
case 0xA000: MMC3_CMDWrite(0x8000,(V&0xC0)|(UNL8237_perm[V&7])); cmdin=1; break;
case 0xC000: if(cmdin)
{
MMC3_CMDWrite(0x8001,V);
cmdin=0;
}
break;
}
}
static DECLFW(UNL8237ExWrite)
{
switch(A)
{
case 0x5000: EXPREGS[0]=V; FixMMC3PRG(MMC3_cmd); break;
case 0x5001: EXPREGS[1]=V; FixMMC3CHR(MMC3_cmd); break;
}
}
static void UNL8237Power(void)
{
IRQa=1;
EXPREGS[0]=EXPREGS[1]=0;
GenMMC3Power();
SetWriteHandler(0x8000,0xFFFF,UNL8237Write);
SetWriteHandler(0x5000,0x7FFF,UNL8237ExWrite);
}
void UNL8237_Init(CartInfo *info)
{
GenMMC3_Init(info, 256, 256, 0, 0);
cwrap=UNL8237CW;
pwrap=UNL8237PW;
info->Power=UNL8237Power;
AddExState(EXPREGS, 3, 0, "EXPR");
AddExState(&cmdin, 1, 0, "CMDIN");
}

87
boards/88.c Normal file
View File

@ -0,0 +1,87 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 reg[8];
static uint8 mirror, cmd, is154;
static SFORMAT StateRegs[]=
{
{&cmd, 1, "CMD"},
{&mirror, 1, "MIRR"},
{reg, 8, "REGS"},
{0}
};
static void Sync(void)
{
setchr2(0x0000,reg[0]>>1);
setchr2(0x0800,reg[1]>>1);
setchr1(0x1000,reg[2]|0x40);
setchr1(0x1400,reg[3]|0x40);
setchr1(0x1800,reg[4]|0x40);
setchr1(0x1C00,reg[5]|0x40);
setprg8(0x8000,reg[6]);
setprg8(0xA000,reg[7]);
}
static void MSync(void)
{
if(is154)setmirror(MI_0+(mirror&1));
}
static DECLFW(M88Write)
{
switch(A&0x8001)
{
case 0x8000: cmd=V&7; mirror=V>>6; MSync(); break;
case 0x8001: reg[cmd]=V; Sync(); break;
}
}
static void M88Power(void)
{
setprg16(0xC000,~0);
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,M88Write);
}
static void StateRestore(int version)
{
Sync();
MSync();
}
void Mapper88_Init(CartInfo *info)
{
is154=0;
info->Power=M88Power;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}
void Mapper154_Init(CartInfo *info)
{
is154=1;
info->Power=M88Power;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

512
boards/90.c Normal file
View File

@ -0,0 +1,512 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
#define DEBUG90
// Mapper 090 is simpliest mapper hardware and have not extended nametable control and latched chr banks in 4k mode
// Mapper 209 much compicated hardware with decribed above features disabled by default and switchable by command
// Mapper 211 the same mapper 209 but with forced nametable control
static int is209;
static int is211;
static uint8 IRQMode; // from $c001
static uint8 IRQPre; // from $c004
static uint8 IRQPreSize; // from $c007
static uint8 IRQCount; // from $c005
static uint8 IRQXOR; // Loaded from $C006
static uint8 IRQa; // $c002, $c003, and $c000
static uint8 mul[2];
static uint8 regie;
static uint8 regie2;
static uint8 tkcom[4];
static uint8 prgb[4];
static uint8 chrlow[8];
static uint8 chrhigh[8];
static uint8 chr[2];
static uint16 names[4];
static uint8 tekker;
static SFORMAT Tek_StateRegs[]={
{&IRQMode, 1, "IRQMODE"},
{&IRQPre, 1, "IRQPRE"},
{&IRQPreSize, 1, "IRQPRESIZE"},
{&IRQCount, 1, "IRQC"},
{&IRQXOR, 1, "IRQXOR"},
{&IRQa, 1, "IRQa"},
{mul, 2, "MUL"},
{&regie, 1, "REGI"},
{tkcom, 4, "TKCO"},
{prgb, 4, "PRGB"},
{chr, 2, "CHRLATCH"},
{chrlow, 4, "CHRL"},
{chrhigh, 8, "CHRH"},
{&names[0], 2|FCEUSTATE_RLSB, "NMS0"},
{&names[1], 2|FCEUSTATE_RLSB, "NMS1"},
{&names[2], 2|FCEUSTATE_RLSB, "NMS2"},
{&names[3], 2|FCEUSTATE_RLSB, "NMS3"},
{&tekker, 1, "TEKR"},
{0}
};
static void mira(void)
{
if((tkcom[0]&0x20&&is209)||is211)
{
int x;
if(tkcom[0]&0x40) // Name tables are ROM-only
{
for(x=0;x<4;x++)
setntamem(CHRptr[0]+(((names[x])&CHRmask1[0])<<10),0,x);
}
else // Name tables can be RAM or ROM.
{
for(x=0;x<4;x++)
{
if((tkcom[1]&0x80)==(names[x]&0x80)) // RAM selected.
setntamem(NTARAM+((names[x]&0x1)<<10),1,x);
else
setntamem(CHRptr[0]+(((names[x])&CHRmask1[0])<<10),0,x);
}
}
}
else
{
switch(tkcom[1]&3)
{
case 0: setmirror(MI_V); break;
case 1: setmirror(MI_H); break;
case 2: setmirror(MI_0); break;
case 3: setmirror(MI_1); break;
}
}
}
static void tekprom(void)
{
uint32 bankmode=((tkcom[3]&6)<<5);
switch(tkcom[0]&7)
{
case 00: if(tkcom[0]&0x80)
setprg8(0x6000,(((prgb[3]<<2)+3)&0x3F)|bankmode);
setprg32(0x8000,0x0F|((tkcom[3]&6)<<3));
break;
case 01: if(tkcom[0]&0x80)
setprg8(0x6000,(((prgb[3]<<1)+1)&0x3F)|bankmode);
setprg16(0x8000,(prgb[1]&0x1F)|((tkcom[3]&6)<<4));
setprg16(0xC000,0x1F|((tkcom[3]&6)<<4));
break;
case 03: // bit reversion
case 02: if(tkcom[0]&0x80)
setprg8(0x6000,(prgb[3]&0x3F)|bankmode);
setprg8(0x8000,(prgb[0]&0x3F)|bankmode);
setprg8(0xa000,(prgb[1]&0x3F)|bankmode);
setprg8(0xc000,(prgb[2]&0x3F)|bankmode);
setprg8(0xe000,0x3F|bankmode);
break;
case 04: if(tkcom[0]&0x80)
setprg8(0x6000,(((prgb[3]<<2)+3)&0x3F)|bankmode);
setprg32(0x8000,(prgb[3]&0x0F)|((tkcom[3]&6)<<3));
break;
case 05: if(tkcom[0]&0x80)
setprg8(0x6000,(((prgb[3]<<1)+1)&0x3F)|bankmode);
setprg16(0x8000,(prgb[1]&0x1F)|((tkcom[3]&6)<<4));
setprg16(0xC000,(prgb[3]&0x1F)|((tkcom[3]&6)<<4));
break;
case 07: // bit reversion
case 06: if(tkcom[0]&0x80)
setprg8(0x6000,(prgb[3]&0x3F)|bankmode);
setprg8(0x8000,(prgb[0]&0x3F)|bankmode);
setprg8(0xa000,(prgb[1]&0x3F)|bankmode);
setprg8(0xc000,(prgb[2]&0x3F)|bankmode);
setprg8(0xe000,(prgb[3]&0x3F)|bankmode);
break;
}
}
static void tekvrom(void)
{
int x, bank=0, mask=0xFFFF;
if(!(tkcom[3]&0x20))
{
bank=(tkcom[3]&1)|((tkcom[3]&0x18)>>2);
switch (tkcom[0]&0x18)
{
case 0x00: bank<<=5; mask=0x1F; break;
case 0x08: bank<<=6; mask=0x3F; break;
case 0x10: bank<<=7; mask=0x7F; break;
case 0x18: bank<<=8; mask=0xFF; break;
}
}
switch(tkcom[0]&0x18)
{
case 0x00: // 8KB
setchr8(((chrlow[0]|(chrhigh[0]<<8))&mask)|bank);
break;
case 0x08: // 4KB
// for(x=0;x<8;x+=4)
// setchr4(x<<10,((chrlow[x]|(chrhigh[x]<<8))&mask)|bank);
setchr4(0x0000,((chrlow[chr[0]]|(chrhigh[chr[0]]<<8))&mask)|bank);
setchr4(0x1000,((chrlow[chr[1]]|(chrhigh[chr[1]]<<8))&mask)|bank);
break;
case 0x10: // 2KB
for(x=0;x<8;x+=2)
setchr2(x<<10,((chrlow[x]|(chrhigh[x]<<8))&mask)|bank);
break;
case 0x18: // 1KB
for(x=0;x<8;x++)
setchr1(x<<10,((chrlow[x]|(chrhigh[x]<<8))&mask)|bank);
break;
}
}
static DECLFW(M90TekWrite)
{
FCEU_printf("bs %04x %02x\n",A,V);
switch(A&0x5805)
{
case 0x5800: mul[0]=V; break;
case 0x5801: mul[1]=V; break;
case 0x5803: regie=V; break;
// case 0x5803: regie2=V; break;
// default: regie=V; break;
}
}
static DECLFR(M90TekRead)
{
switch(A&0x5805)
{
case 0x5000: return tekker;
case 0x5800: return (mul[0]*mul[1]);
case 0x5801: return((mul[0]*mul[1])>>8);
case 0x5803: return (regie);
// case 0x5804: return (regie2);
}
return(0xff);
}
static DECLFW(M90PRGWrite)
{
FCEU_printf("bs %04x %02x\n",A,V);
prgb[A&3]=V;
tekprom();
}
static DECLFW(M90CHRlowWrite)
{
FCEU_printf("bs %04x %02x\n",A,V);
chrlow[A&7]=V;
tekvrom();
}
static DECLFW(M90CHRhiWrite)
{
FCEU_printf("bs %04x %02x\n",A,V);
chrhigh[A&7]=V;
tekvrom();
}
static DECLFW(M90NTWrite)
{
FCEU_printf("bs %04x %02x\n",A,V);
if(A&4)
{
names[A&3]&=0x00FF;
names[A&3]|=V<<8;
}
else
{
names[A&3]&=0xFF00;
names[A&3]|=V;
}
mira();
}
static DECLFW(M90IRQWrite)
{
FCEU_printf("bs %04x %02x\n",A,V);
switch(A&7)
{
case 00: //FCEU_printf("%s IRQ (C000)\n",V&1?"Enable":"Disable");
IRQa=V&1;if(!(V&1)) X6502_IRQEnd(FCEU_IQEXT);break;
case 02: //FCEU_printf("Disable IRQ (C002) scanline=%d\n", scanline);
IRQa=0;X6502_IRQEnd(FCEU_IQEXT);break;
case 03: //FCEU_printf("Enable IRQ (C003) scanline=%d\n", scanline);
IRQa=1;break;
case 01: IRQMode=V;
// FCEU_printf("IRQ Count method: ");
// switch (IRQMode&3)
// {
// case 00: FCEU_printf("M2 cycles\n");break;
// case 01: FCEU_printf("PPU A12 toggles\n");break;
// case 02: FCEU_printf("PPU reads\n");break;
// case 03: FCEU_printf("Writes to CPU space\n");break;
// }
// FCEU_printf("Counter prescaler size: %s\n",(IRQMode&4)?"3 bits":"8 bits");
// FCEU_printf("Counter prescaler size adjust: %s\n",(IRQMode&8)?"Used C007":"Normal Operation");
// if((IRQMode>>6)==2) FCEU_printf("Counter Down\n");
// else if((IRQMode>>6)==1) FCEU_printf("Counter Up\n");
// else FCEU_printf("Counter Stopped\n");
break;
case 04: //FCEU_printf("Pre Counter Loaded and Xored wiht C006: %d\n",V^IRQXOR);
IRQPre=V^IRQXOR;break;
case 05: //FCEU_printf("Main Counter Loaded and Xored wiht C006: %d\n",V^IRQXOR);
IRQCount=V^IRQXOR;break;
case 06: //FCEU_printf("Xor Value: %d\n",V);
IRQXOR=V;break;
case 07: //if(!(IRQMode&8)) FCEU_printf("C001 is clear, no effect applied\n");
// else if(V==0xFF) FCEU_printf("Prescaler is changed for 12bits\n");
// else FCEU_printf("Counter Stopped\n");
IRQPreSize=V;break;
}
}
static DECLFW(M90ModeWrite)
{
FCEU_printf("bs %04x %02x\n",A,V);
tkcom[A&3]=V;
tekprom();
tekvrom();
mira();
#ifdef DEBUG90
switch (A&3)
{
case 00: FCEU_printf("Main Control Register:\n");
FCEU_printf(" PGR Banking mode: %d\n",V&7);
FCEU_printf(" CHR Banking mode: %d\n",(V>>3)&3);
FCEU_printf(" 6000-7FFF addresses mapping: %s\n",(V&0x80)?"Yes":"No");
FCEU_printf(" Nametable control: %s\n",(V&0x20)?"Enabled":"Disabled");
if(V&0x20)
FCEU_printf(" Nametable can be: %s\n",(V&0x40)?"ROM Only":"RAM or ROM");
break;
case 01: FCEU_printf("Mirroring mode: ");
switch (V&3)
{
case 0: FCEU_printf("Vertical\n");break;
case 1: FCEU_printf("Horizontal\n");break;
case 2: FCEU_printf("Nametable 0 only\n");break;
case 3: FCEU_printf("Nametable 1 only\n");break;
}
FCEU_printf("Mirroring flag: %s\n",(V&0x80)?"On":"Off");
break;
case 02: if((((tkcom[0])>>5)&3)==1)
FCEU_printf("Nametable ROM/RAM select mode: %d\n",V>>7);
break;
case 03:
FCEU_printf("CHR Banking mode: %s\n",(V&0x20)?"Entire CHR ROM":"256Kb Switching mode");
if(!(V&0x20)) FCEU_printf("256K CHR bank number: %02x\n",(V&1)|((V&0x18)>>2));
FCEU_printf("512K PRG bank number: %d\n",(V&6)>>1);
FCEU_printf("CHR Bank mirroring: %s\n",(V&0x80)?"Swapped":"Normal operate");
}
#endif
}
static DECLFW(M90DummyWrite)
{
FCEU_printf("bs %04x %02x\n",A,V);
}
static void CCL(void)
{
if((IRQMode>>6) == 1) // Count Up
{
IRQCount++;
if((IRQCount == 0) && IRQa)
{
X6502_IRQBegin(FCEU_IQEXT);
}
}
else if((IRQMode>>6) == 2) // Count down
{
IRQCount--;
if((IRQCount == 0xFF) && IRQa)
{
X6502_IRQBegin(FCEU_IQEXT);
}
}
}
static void ClockCounter(void)
{
uint8 premask;
if(IRQMode & 0x4)
premask = 0x7;
else
premask = 0xFF;
if((IRQMode>>6) == 1) // Count up
{
IRQPre++;
if((IRQPre & premask) == 0) CCL();
}
else if((IRQMode>>6) == 2) // Count down
{
IRQPre--;
if((IRQPre & premask) == premask) CCL();
}
}
void FP_FASTAPASS(1) CPUWrap(int a)
{
int x;
if((IRQMode&3)==0) for(x=0;x<a;x++) ClockCounter();
}
static void SLWrap(void)
{
int x;
if((IRQMode&3)==1) for(x=0;x<8;x++) ClockCounter();
}
static uint32 lastread;
static void FP_FASTAPASS(1) M90PPU(uint32 A)
{
if((IRQMode&3)==2)
{
if(lastread!=A)
{
ClockCounter();
ClockCounter();
}
lastread=A;
}
if(is209)
{
uint8 l,h;
h=A>>8;
if(h<0x20&&((h&0x0F)==0xF))
{
l=A&0xF0;
if(l==0xD0)
{
chr[(h&0x10)>>4]=((h&0x10)>>2);
tekvrom();
}
else if(l==0xE0)
{
chr[(h&0x10)>>4]=((h&0x10)>>2)|2;
tekvrom();
}
}
}
else
{
chr[0]=0;
chr[1]=4;
}
}
static void togglie()
{
tekker+=0x40;
tekker&=0xC0;
FCEU_printf("tekker=%02x\n",tekker);
memset(tkcom,0x00,sizeof(tkcom));
memset(prgb,0xff,sizeof(prgb));
tekprom();
tekvrom();
}
static void M90Restore(int version)
{
tekprom();
tekvrom();
mira();
}
static void M90Power(void)
{
SetWriteHandler(0x5000,0x5fff,M90TekWrite);
SetWriteHandler(0x8000,0x8ff0,M90PRGWrite);
SetWriteHandler(0x9000,0x9fff,M90CHRlowWrite);
SetWriteHandler(0xA000,0xAfff,M90CHRhiWrite);
SetWriteHandler(0xB000,0xBfff,M90NTWrite);
SetWriteHandler(0xC000,0xCfff,M90IRQWrite);
SetWriteHandler(0xD000,0xD5ff,M90ModeWrite);
SetWriteHandler(0xE000,0xFfff,M90DummyWrite);
SetReadHandler(0x5000,0x5fff,M90TekRead);
SetReadHandler(0x6000,0xffff,CartBR);
mul[0]=mul[1]=regie=0xFF;
memset(tkcom,0x00,sizeof(tkcom));
memset(prgb,0xff,sizeof(prgb));
memset(chrlow,0xff,sizeof(chrlow));
memset(chrhigh,0xff,sizeof(chrhigh));
memset(names,0x00,sizeof(names));
if(is211)
tekker=0xC0;
else
tekker=0x00;
tekprom();
tekvrom();
}
void Mapper90_Init(CartInfo *info)
{
is211=0;
is209=0;
info->Reset=togglie;
info->Power=M90Power;
PPU_hook=M90PPU;
MapIRQHook=CPUWrap;
GameHBIRQHook2=SLWrap;
GameStateRestore=M90Restore;
AddExState(Tek_StateRegs, ~0, 0, 0);
}
void Mapper209_Init(CartInfo *info)
{
is211=0;
is209=1;
info->Reset=togglie;
info->Power=M90Power;
PPU_hook=M90PPU;
MapIRQHook=CPUWrap;
GameHBIRQHook2=SLWrap;
GameStateRestore=M90Restore;
AddExState(Tek_StateRegs, ~0, 0, 0);
}
void Mapper211_Init(CartInfo *info)
{
is211=1;
info->Reset=togglie;
info->Power=M90Power;
PPU_hook=M90PPU;
MapIRQHook=CPUWrap;
GameHBIRQHook2=SLWrap;
GameStateRestore=M90Restore;
AddExState(Tek_StateRegs, ~0, 0, 0);
}

125
boards/95.c Normal file
View File

@ -0,0 +1,125 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
#include "../ines.h"
static uint8 lastA;
static uint8 DRegs[8];
static uint8 cmd;
static uint8 MirCache[8];
static SFORMAT DB_StateRegs[]={
{DRegs, 8, "DREG"},
{&cmd, 1, "CMD"},
{&lastA, 1, "LAST"},
{0}
};
static void toot(void)
{
int x;
MirCache[0]=MirCache[1]=(DRegs[0]>>4)&1;
MirCache[2]=MirCache[3]=(DRegs[1]>>4)&1;
for(x=0;x<4;x++)
MirCache[4+x]=(DRegs[2+x]>>5)&1;
onemir(MirCache[lastA]);
}
static void Sync()
{
setchr2(0x0000,DRegs[0]&0x1F);
setchr2(0x0800,DRegs[1]&0x1F);
setchr1(0x1000,DRegs[2]&0x1F);
setchr1(0x1400,DRegs[3]&0x1F);
setchr1(0x1800,DRegs[4]&0x1F);
setchr1(0x1C00,DRegs[5]&0x1F);
setprg8(0x8000,DRegs[6]&0x1F);
setprg8(0xa000,DRegs[7]&0x1F);
toot();
}
static DECLFW(Mapper95_write)
{
switch(A&0xF001)
{
case 0x8000: cmd = V; break;
case 0x8001:
switch(cmd&0x07)
{
case 0: DRegs[0]=(V&0x3F)>>1; break;
case 1: DRegs[1]=(V&0x3F)>>1; break;
case 2: DRegs[2]=V&0x3F; break;
case 3: DRegs[3]=V&0x3F; break;
case 4: DRegs[4]=V&0x3F; break;
case 5: DRegs[5]=V&0x3F; break;
case 6: DRegs[6]=V&0x3F; break;
case 7: DRegs[7]=V&0x3F; break;
}
Sync();
}
}
static void FP_FASTAPASS(1) dragonbust_ppu(uint32 A)
{
static int last=-1;
static uint8 z;
if(A>=0x2000) return;
A>>=10;
lastA=A;
z=MirCache[A];
if(z!=last)
{
onemir(z);
last=z;
}
}
static void DBPower(void)
{
memset(DRegs,0x3F,8);
DRegs[0]=DRegs[1]=0x1F;
Sync();
setprg8(0xc000,0x3E);
setprg8(0xe000,0x3F);
SetReadHandler(0x8000,0xffff,CartBR);
SetWriteHandler(0x8000,0xffff,Mapper95_write);
}
static void StateRestore(int version)
{
Sync();
}
void Mapper95_Init(CartInfo *info)
{
info->Power=DBPower;
AddExState(DB_StateRegs, ~0, 0, 0);
PPU_hook=dragonbust_ppu;
GameStateRestore=StateRestore;
}

96
boards/__dummy_mapper.c Normal file
View File

@ -0,0 +1,96 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2006 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 reg[8];
/*
static uint8 *WRAM=NULL;
static uint32 WRAMSIZE;
static uint8 *CHRRAM=NULL;
static uint32 CHRRAMSIZE;
*/
static SFORMAT StateRegs[]=
{
{reg, 8, "REGS"},
{0}
};
static void Sync(void)
{
}
static DECLFW(MNNNWrite)
{
}
static void MNNNPower(void)
{
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,MNNNWrite);
}
static void MNNNReset(void)
{
}
/*
static void MNNNClose(void)
{
if(WRAM)
FCEU_gfree(WRAM);
if(CHRRAM)
FCEU_gfree(CHRRAM);
WRAM=CHRRAM=NULL;
}
*/
static void MNNNIRQHook(void)
{
X6502_IRQBegin(FCEU_IQEXT);
}
static void StateRestore(int version)
{
Sync();
}
void MapperNNN_Init(CartInfo *info)
{
info->Reset=MNNNReset;
info->Power=MNNNPower;
// info->Close=MNNNClose;
GameHBIRQHook=MNNNIRQHook;
GameStateRestore=StateRestore;
/*
CHRRAMSIZE=8192;
CHRRAM=(uint8*)FCEU_gmalloc(CHRRAMSIZE);
SetupCartPRGMapping(0x10,CHRRAM,CHRRAMSIZE,1);
AddExState(CHRRAM, CHRRAMSIZE, 0, "WRAM");
*/
/*
WRAMSIZE=8192;
WRAM=(uint8*)FCEU_gmalloc(WRAMSIZE);
SetupCartPRGMapping(0x10,WRAM,WRAMSIZE,1);
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
*/
AddExState(&StateRegs, ~0, 0, 0);
}

74
boards/a9711.c Normal file
View File

@ -0,0 +1,74 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
#include "mmc3.h"
static uint8 m_perm[8] = {0, 1, 0, 3, 0, 5, 6, 7};
static void UNLA9711PW(uint32 A, uint8 V)
{
if(EXPREGS[0]&0x20)
{
uint8 bank=EXPREGS[0]&0x1F;
if(EXPREGS[0]&0x20)
setprg32(0x8000,bank>>2);
else
{
// setprg16(0x8000,bank);
setprg16(0xC000,bank);
}
}
else
setprg8(A,V&0x3F);
}
static DECLFW(UNLA9711Write8000)
{
// FCEU_printf("bs %04x %02x\n",A,V);
// if(V&0x80)
// MMC3_CMDWrite(A,V);
// else
// MMC3_CMDWrite(A,m_perm[V&7]);
if(V!=0x86) MMC3_CMDWrite(A,V);
}
static DECLFW(UNLA9711WriteLo)
{
FCEU_printf("bs %04x %02x\n",A,V);
EXPREGS[0]=V;
FixMMC3PRG(MMC3_cmd);
}
static void UNLA9711Power(void)
{
EXPREGS[0]=EXPREGS[1]=EXPREGS[2]=0;
GenMMC3Power();
SetWriteHandler(0x5000,0x5FFF,UNLA9711WriteLo);
// SetWriteHandler(0x8000,0xbfff,UNLA9711Write8000);
}
void UNLA9711_Init(CartInfo *info)
{
GenMMC3_Init(info, 256, 256, 0, 0);
pwrap=UNLA9711PW;
info->Power=UNLA9711Power;
AddExState(EXPREGS, 3, 0, "EXPR");
}

151
boards/addrlatch.c Normal file
View File

@ -0,0 +1,151 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2006 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint16 latche, latcheinit;
static uint16 addrreg0, addrreg1;
static void(*WSync)(void);
static readfunc defread;
static DECLFW(LatchWrite)
{
// FCEU_printf("%04x:%02x\n",A,V);
latche=A;
WSync();
}
static void LatchPower(void)
{
latche=latcheinit;
WSync();
SetReadHandler(0x8000,0xFFFF,defread);
SetWriteHandler(addrreg0,addrreg1,LatchWrite);
}
static void StateRestore(int version)
{
WSync();
}
static void Latch_Init(CartInfo *info, void (*proc)(void), readfunc func, uint16 init, uint16 adr0, uint16 adr1)
{
latcheinit=init;
addrreg0=adr0;
addrreg1=adr1;
WSync=proc;
if(func)
defread=func;
else
defread=CartBR;
info->Power=LatchPower;
GameStateRestore=StateRestore;
AddExState(&latche, 2, 0, "LATC");
}
//------------------ UNLCC21 ---------------------------
static void UNLCC21Sync(void)
{
setprg32(0x8000,0);
setchr8(latche&1);
setmirror(MI_0+((latche&2)>>1));
}
void UNLCC21_Init(CartInfo *info)
{
Latch_Init(info, UNLCC21Sync, 0, 0, 0x8000, 0xFFFF);
}
//------------------ BMCD1038 ---------------------------
static uint8 dipswitch;
static void BMCD1038Sync(void)
{
if(latche&0x80)
{
setprg16(0x8000,(latche&0x70)>>4);
setprg16(0xC000,(latche&0x70)>>4);
}
else
setprg32(0x8000,(latche&0x60)>>5);
setchr8(latche&7);
setmirror(((latche&8)>>3)^1);
}
static DECLFR(BMCD1038Read)
{
if(latche&0x100)
return dipswitch;
else
return CartBR(A);
}
static void BMCD1038Reset(void)
{
dipswitch++;
dipswitch&=3;
}
void BMCD1038_Init(CartInfo *info)
{
Latch_Init(info, BMCD1038Sync, BMCD1038Read, 0, 0x8000, 0xFFFF);
info->Reset=BMCD1038Reset;
AddExState(&dipswitch, 1, 0, "DIPSW");
}
//------------------ Map 058 ---------------------------
static void BMCGK192Sync(void)
{
if(latche&0x40)
{
setprg16(0x8000,latche&7);
setprg16(0xC000,latche&7);
}
else
setprg32(0x8000,(latche>>1)&3);
setchr8((latche>>3)&7);
setmirror(((latche&0x80)>>7)^1);
}
void BMCGK192_Init(CartInfo *info)
{
Latch_Init(info, BMCGK192Sync, 0, 0, 0x8000, 0xFFFF);
}
//------------------ Map 200 ---------------------------
static void M200Sync(void)
{
// FCEU_printf("A\n");
setprg16(0x8000,latche&7);
setprg16(0xC000,latche&7);
setchr8(latche&7);
setmirror((latche&8)>>3);
}
void Mapper200_Init(CartInfo *info)
{
Latch_Init(info, M200Sync, 0, 0xff, 0x8000, 0xFFFF);
}

103
boards/bmc13in1jy110.c Normal file
View File

@ -0,0 +1,103 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* BMC 42-in-1 reset switch
*/
#include "mapinc.h"
static uint8 bank_mode;
static uint8 bank_value;
static uint8 prgb[4];
static SFORMAT StateRegs[]=
{
{0}
};
static void Sync(void)
{
FCEU_printf("%02x: %02x %02x\n", bank_mode, bank_value, prgb[0]);
switch(bank_mode&7)
{
case 0:
setprg32(0x8000,bank_value&7); break;
case 1:
setprg16(0x8000,((8+(bank_value&7))>>1)+prgb[1]);
setprg16(0xC000,(bank_value&7)>>1);
case 4:
setprg32(0x8000,8+(bank_value&7)); break;
case 5:
setprg16(0x8000,((8+(bank_value&7))>>1)+prgb[1]);
setprg16(0xC000,((8+(bank_value&7))>>1)+prgb[3]);
case 2:
setprg8(0x8000,prgb[0]>>2);
setprg8(0xa000,prgb[1]);
setprg8(0xc000,prgb[2]);
setprg8(0xe000,~0);
break;
case 3:
setprg8(0x8000,prgb[0]);
setprg8(0xa000,prgb[1]);
setprg8(0xc000,prgb[2]);
setprg8(0xe000,prgb[3]);
break;
}
}
static DECLFW(BMC13in1JY110Write)
{
FCEU_printf("%04x:%04x\n",A,V);
switch(A)
{
case 0x8000:
case 0x8001:
case 0x8002:
case 0x8003: prgb[A&3]=V; break;
case 0xD000: bank_mode=V; break;
case 0xD001: setmirror(V&3);
case 0xD002: break;
case 0xD003: bank_value=V; break;
}
Sync();
}
static void BMC13in1JY110Power(void)
{
prgb[0]=prgb[1]=prgb[2]=prgb[3]=0;
bank_mode=0;
bank_value=0;
setprg32(0x8000,0);
setchr8(0);
SetWriteHandler(0x8000,0xFFFF,BMC13in1JY110Write);
SetReadHandler(0x8000,0xFFFF,CartBR);
}
static void StateRestore(int version)
{
Sync();
}
void BMC13in1JY110_Init(CartInfo *info)
{
info->Power=BMC13in1JY110Power;
AddExState(&StateRegs, ~0, 0, 0);
GameStateRestore=StateRestore;
}

110
boards/bmc42in1r.c Normal file
View File

@ -0,0 +1,110 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* BMC 42-in-1 reset switch
*/
#include "mapinc.h"
extern uint32 ROM_size;
static uint8 hrd_sw;
static uint8 latche;
static SFORMAT StateRegs[]=
{
{&hrd_sw, 1, "DIPSW"},
{&latche, 1, "LATCHE"},
{&hrd_sw, 1, "HRDSW"},
{0}
};
static void Sync(void)
{
/* if(!(latche&0x02))
setprg32r(0,0x8000,(latche&0x3F)>>1);
else
{
setprg16r(0,0x8000,latche&0x3f);
setprg16r(0,0xC000,latche&0x3f);
}
*/
if(!(latche&0x20))
setprg32r(hrd_sw,0x8000,(latche>>1)&0x0f);
else
{
setprg16r(hrd_sw,0x8000,latche&0x1f);
setprg16r(hrd_sw,0xC000,latche&0x1f);
}
setmirror((latche>>6)&1);
}
static DECLFW(BMC42in1rWrite)
{
latche=V;
Sync();
}
static void BMC42in1rReset(void)
{
hrd_sw^=1;
Sync();
}
static void BMC42in1rPower(void)
{
latche=0;
hrd_sw=0;
setchr8(0);
Sync();
SetWriteHandler(0x8000,0xFFFF,BMC42in1rWrite);
SetReadHandler(0x8000,0xFFFF,CartBR);
}
static void StateRestore(int version)
{
Sync();
}
void BMC42in1r_Init(CartInfo *info)
{
info->Power=BMC42in1rPower;
info->Reset=BMC42in1rReset;
AddExState(&StateRegs, ~0, 0, 0);
GameStateRestore=StateRestore;
}
static void M226Power(void)
{
if(ROM_size==64)
SetupCartPRGMapping(1,PRGptr[0]+512*1024,512,0);
latche=0;
hrd_sw=0;
setchr8(0);
Sync();
SetWriteHandler(0x8000,0xFFFF,BMC42in1rWrite);
SetReadHandler(0x8000,0xFFFF,CartBR);
}
void Mapper226_Init(CartInfo *info)
{
info->Power=M226Power;
info->Reset=BMC42in1rReset;
AddExState(&StateRegs, ~0, 0, 0);
GameStateRestore=StateRestore;
}

93
boards/bmc64in1nr.c Normal file
View File

@ -0,0 +1,93 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* BMC 42-in-1 reset switch
*/
#include "mapinc.h"
static uint8 regs[4];
static SFORMAT StateRegs[]=
{
{regs, 4, "REGS"},
{0}
};
static void Sync(void)
{
if(regs[0]&0x80)
{
if(regs[1]&0x80)
setprg32(0x8000,regs[1]&0x1F);
else
{
int bank=((regs[1]&0x1f)<<1)|((regs[1]>>6)&1);
setprg16(0x8000,bank);
setprg16(0xC000,bank);
}
}
else
{
int bank=((regs[1]&0x1f)<<1)|((regs[1]>>6)&1);
setprg16(0xC000,bank);
}
if(regs[0]&0x20)
setmirror(MI_H);
else
setmirror(MI_V);
setchr8((regs[2]<<2)|((regs[0]>>1)&3));
}
static DECLFW(BMC64in1nrWriteLo)
{
regs[A&3]=V;
Sync();
}
static DECLFW(BMC64in1nrWriteHi)
{
regs[3]=V;
Sync();
}
static void BMC64in1nrPower(void)
{
regs[0]=0x80;
regs[1]=0x43;
regs[2]=regs[3]=0;
Sync();
SetWriteHandler(0x5000,0x5003,BMC64in1nrWriteLo);
SetWriteHandler(0x8000,0xFFFF,BMC64in1nrWriteHi);
SetReadHandler(0x8000,0xFFFF,CartBR);
}
static void StateRestore(int version)
{
Sync();
}
void BMC64in1nr_Init(CartInfo *info)
{
info->Power=BMC64in1nrPower;
AddExState(&StateRegs, ~0, 0, 0);
GameStateRestore=StateRestore;
}

130
boards/bmc70in1.c Normal file
View File

@ -0,0 +1,130 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 is_large_banks, hw_switch;
static uint8 large_bank;
static uint8 prg_bank;
static uint8 chr_bank;
static uint8 bank_mode;
static uint8 mirroring;
static SFORMAT StateRegs[]=
{
{&large_bank, 1, "LB"},
{&hw_switch, 1, "DIPSW"},
{&prg_bank, 1, "PRG"},
{&chr_bank, 1, "CHR"},
{&bank_mode, 1, "BM"},
{&mirroring, 1, "MIRR"},
{0}
};
static void Sync(void)
{
switch (bank_mode)
{
case 0x00:
case 0x10: setprg16(0x8000,large_bank|prg_bank);
setprg16(0xC000,large_bank|7);
break;
case 0x20: setprg32(0x8000,(large_bank|prg_bank)>>1);
break;
case 0x30: setprg16(0x8000,large_bank|prg_bank);
setprg16(0xC000,large_bank|prg_bank);
break;
}
setmirror(mirroring);
if(!is_large_banks)
setchr8(chr_bank);
}
static DECLFR(BMC70in1Read)
{
if(bank_mode==0x10)
// if(is_large_banks)
return CartBR((A&0xFFF0)|hw_switch);
// else
// return CartBR((A&0xFFF0)|hw_switch);
else
return CartBR(A);
}
static DECLFW(BMC70in1Write)
{
if(A&0x4000)
{
bank_mode=A&0x30;
prg_bank=A&7;
}
else
{
mirroring=((A&0x20)>>5)^1;
if(is_large_banks)
large_bank=(A&3)<<3;
else
chr_bank=A&7;
}
Sync();
}
static void BMC70in1Reset(void)
{
bank_mode=0;
large_bank=0;
Sync();
hw_switch++;
hw_switch&=0xf;
}
static void BMC70in1Power(void)
{
setchr8(0);
bank_mode=0;
large_bank=0;
Sync();
SetReadHandler(0x8000,0xFFFF,BMC70in1Read);
SetWriteHandler(0x8000,0xffff,BMC70in1Write);
}
static void StateRestore(int version)
{
Sync();
}
void BMC70in1_Init(CartInfo *info)
{
is_large_banks=0;
hw_switch=0xd;
info->Power=BMC70in1Power;
info->Reset=BMC70in1Reset;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}
void BMC70in1B_Init(CartInfo *info)
{
is_large_banks=1;
hw_switch=0x6;
info->Power=BMC70in1Power;
info->Reset=BMC70in1Reset;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

139
boards/bonza.c Normal file
View File

@ -0,0 +1,139 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 prg_reg;
static uint8 chr_reg;
static uint8 sim0reg, sim0bit, sim0byte, sim0parity, sim0bcnt;
static uint16 sim0data;
static uint8 sim0array[128] =
{
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xAA,
};
static SFORMAT StateRegs[]=
{
{&prg_reg, 1, "PREG"},
{&chr_reg, 1, "CREG"},
{0}
};
static void Sync(void)
{
setprg32(0x8000, prg_reg);
setchr8(chr_reg);
}
static void StateRestore(int version)
{
Sync();
}
static DECLFW(M216WriteHi)
{
// FCEU_printf("%04x:%04x\n",A,V);
prg_reg=A&1;
chr_reg=(A&0x0E)>>1;
Sync();
}
static DECLFW(M216Write5000)
{
// FCEU_printf("WRITE: %04x:%04x\n",A,V);
sim0reg=V;
if(!sim0reg)
{
sim0bit=sim0byte=sim0parity=0;
sim0data=sim0array[0];
sim0bcnt=0x80;
}
else if(sim0reg&0x20)
{
sim0bcnt=0x20;
}
}
static DECLFR(M216Read5000)
{
if(sim0reg&0x60)
{
sim0reg=(sim0reg^(sim0reg<<1))&0x40;
return sim0reg;
}
else
{
uint8 sim0out=0;
if(sim0bit<8)
{
// sim0data=((sim0array[sim0byte]<<(sim0bit))&0x80)>>1;
sim0out=(sim0data&1)<<6;
sim0data>>=1;
sim0bit++;
sim0parity+=sim0data;
}
else if(sim0bit==8)
{
sim0bit++;
sim0out=sim0parity&1;
}
else if(sim0bit==9)
{
if(sim0byte==sim0bcnt)
sim0out=0x60;
else
{
sim0bit=0;
sim0byte++;
sim0data=sim0array[sim0byte];
sim0out=0;
}
}
// FCEU_printf("READ: %04x (%04x-%02x,%04x)\n",A,X.PC,sim0out,sim0byte);
return sim0out;
}
}
static void Power(void)
{
prg_reg = 0;
chr_reg = 0;
Sync();
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,M216WriteHi);
SetWriteHandler(0x5000,0x5000,M216Write5000);
SetReadHandler(0x5000,0x5000,M216Read5000);
}
void Mapper216_Init(CartInfo *info)
{
info->Power=Power;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

350
boards/datalatch.c Normal file
View File

@ -0,0 +1,350 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 latche, latcheinit;
static uint16 addrreg0, addrreg1;
static void(*WSync)(void);
static DECLFW(LatchWrite)
{
// FCEU_printf("bs %04x %02x\n",A,V);
latche=V;
WSync();
}
static void LatchPower(void)
{
latche=latcheinit;
WSync();
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(addrreg0,addrreg1,LatchWrite);
}
static void StateRestore(int version)
{
WSync();
}
static void Latch_Init(CartInfo *info, void (*proc)(void), uint8 init, uint16 adr0, uint16 adr1)
{
latcheinit=init;
addrreg0=adr0;
addrreg1=adr1;
WSync=proc;
info->Power=LatchPower;
GameStateRestore=StateRestore;
AddExState(&latche, 1, 0, "LATC");
}
//------------------ CPROM ---------------------------
static void CPROMSync(void)
{
setchr4(0x0000,0);
setchr4(0x1000,latche&3);
setprg16(0x8000,0);
setprg16(0xC000,1);
}
void CPROM_Init(CartInfo *info)
{
Latch_Init(info, CPROMSync, 0, 0x8000, 0xFFFF);
}
//------------------ Map 184 ---------------------------
static void M184Sync(void)
{
setchr4(0x0000,latche);
setchr4(0x1000,latche>>4);
setprg16(0x8000,0);
setprg16(0xC000,1);
}
void Mapper184_Init(CartInfo *info)
{
Latch_Init(info, M184Sync, 0, 0x6000, 0x7FFF);
}
//------------------ CNROM ---------------------------
static void CNROMSync(void)
{
setchr8(latche&3);
setprg16(0x8000,0);
setprg16(0xC000,1);
}
void CNROM_Init(CartInfo *info)
{
Latch_Init(info, CNROMSync, 0, 0x8000, 0xFFFF);
}
//------------------ ANROM ---------------------------
static void ANROMSync()
{
setprg32(0x8000,latche&0xf);
setmirror(MI_0+((latche>>4)&1));
setchr8(0);
}
void ANROM_Init(CartInfo *info)
{
Latch_Init(info, ANROMSync, 0, 0x8000, 0xFFFF);
}
//------------------ Map 70 ---------------------------
static void M70Sync()
{
setprg16(0x8000,latche>>4);
setprg16(0xc000,~0);
setchr8(latche&0xf);
}
void Mapper70_Init(CartInfo *info)
{
Latch_Init(info, M70Sync, 0, 0x8000, 0xFFFF);
}
//------------------ Map 152 ---------------------------
static void M152Sync()
{
setprg16(0x8000,(latche>>4)&7);
setprg16(0xc000,~0);
setchr8(latche&0xf);
setmirror(MI_0+((latche>>7)&1)); /* Saint Seiya...hmm. */
}
void Mapper152_Init(CartInfo *info)
{
Latch_Init(info, M152Sync, 0, 0x8000, 0xFFFF);
}
//------------------ Map 78 ---------------------------
/* Should be two separate emulation functions for this "mapper". Sigh. URGE TO KILL RISING. */
static void M78Sync()
{
setprg16(0x8000,(latche&7));
setprg16(0xc000,~0);
setchr8(latche>>4);
setmirror(MI_0+((latche>>3)&1));
}
void Mapper78_Init(CartInfo *info)
{
Latch_Init(info, M78Sync, 0, 0x8000, 0xFFFF);
}
//------------------ MHROM ---------------------------
static void MHROMSync(void)
{
setprg32(0x8000,latche>>4);
setchr8(latche&0xf);
}
void MHROM_Init(CartInfo *info)
{
Latch_Init(info, MHROMSync, 0, 0x8000, 0xFFFF);
}
void Mapper140_Init(CartInfo *info)
{
Latch_Init(info, MHROMSync, 0, 0x6000, 0x7FFF);
}
void Mapper240_Init(CartInfo *info)
{
Latch_Init(info, MHROMSync, 0, 0x4020, 0x5FFF);
// need SRAM.
}
//------------------ Map 87 ---------------------------
static void M87Sync(void)
{
setprg16(0x8000,0);
setprg16(0xC000,1);
setchr8(latche>>1);
}
void Mapper87_Init(CartInfo *info)
{
Latch_Init(info, M87Sync, ~0, 0x6000, 0xFFFF);
}
//------------------ Map 11 ---------------------------
static void M11Sync(void)
{
setprg32(0x8000,latche&0xf);
setchr8(latche>>4);
}
void Mapper11_Init(CartInfo *info)
{
Latch_Init(info, M11Sync, 0, 0x8000, 0xFFFF);
}
void Mapper144_Init(CartInfo *info)
{
Latch_Init(info, M11Sync, 0, 0x8001, 0xFFFF);
}
//------------------ UNROM ---------------------------
static void UNROMSync(void)
{
setprg16(0x8000,latche);
setprg16(0xc000,~0);
setchr8(0);
}
void UNROM_Init(CartInfo *info)
{
Latch_Init(info, UNROMSync, 0, 0x8000, 0xFFFF);
}
//------------------ Map 93 ---------------------------
static void SSUNROMSync(void)
{
setprg16(0x8000,latche>>4);
setprg16(0xc000,~0);
setchr8(0);
}
void SUNSOFT_UNROM_Init(CartInfo *info)
{
Latch_Init(info, SSUNROMSync, 0, 0x8000, 0xFFFF);
}
//------------------ Map 94 ---------------------------
static void M94Sync(void)
{
setprg16(0x8000,latche>>2);
setprg16(0xc000,~0);
setchr8(0);
}
void Mapper94_Init(CartInfo *info)
{
Latch_Init(info, M94Sync, 0, 0x8000, 0xFFFF);
}
//------------------ Map 180 ---------------------------
static void M180Sync(void)
{
setprg16(0x8000,0);
setprg16(0xc000,latche);
setchr8(0);
}
void Mapper180_Init(CartInfo *info)
{
Latch_Init(info, M180Sync, 0, 0x8000, 0xFFFF);
}
//------------------ Map 107 ---------------------------
static void M107Sync(void)
{
setprg32(0x8000,(latche>>1)&3);
setchr8(latche&7);
}
void Mapper107_Init(CartInfo *info)
{
Latch_Init(info, M107Sync, ~0, 0x8000, 0xFFFF);
}
//------------------ Map 113 ---------------------------
static void M113Sync(void)
{
setprg32(0x8000,(latche>>3)&7);
setchr8(((latche>>3)&8)|(latche&7));
// setmirror(latche>>7); // only for HES 6in1
}
void Mapper113_Init(CartInfo *info)
{
Latch_Init(info, M113Sync, 0, 0x4100, 0x7FFF);
}
//------------------ A65AS ---------------------------
// actually, there is two cart in one... First have extra mirroring
// mode (one screen) and 32K bankswitching, second one have only
// 16 bankswitching mode and normal mirroring... But there is no any
// correlations between modes and they can be used in one mapper code.
static void BMCA65ASSync(void)
{
if(latche&0x40)
setprg32(0x8000,(latche>>1)&0x0F);
else
{
setprg16(0x8000,((latche&0x30)>>1)|(latche&7));
setprg16(0xC000,((latche&0x30)>>1)|7);
}
setchr8(0);
if(latche&0x80)
setmirror(MI_0+(((latche>>5)&1)));
else
setmirror(((latche>>3)&1)^1);
}
void BMCA65AS_Init(CartInfo *info)
{
Latch_Init(info, BMCA65ASSync, 0, 0x8000, 0xFFFF);
}
//------------------ NROM ---------------------------
#ifdef DEBUG_MAPPER
static DECLFW(WriteHandler)
{
FCEU_printf("bs %04x %02x\n",A,V);
}
#endif
static void NROMPower(void)
{
setprg16(0x8000,0);
setprg16(0xC000,~0);
setchr8(0);
SetReadHandler(0x8000,0xFFFF,CartBR);
#ifdef DEBUG_MAPPER
SetWriteHandler(0x4020,0xFFFF,WriteHandler);
#endif
}
void NROM_Init(CartInfo *info)
{
info->Power=NROMPower;
}

82
boards/deirom.c Normal file
View File

@ -0,0 +1,82 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 cmd;
static uint8 DRegs[8];
static SFORMAT DEI_StateRegs[]=
{
{&cmd, 1, "CMD"},
{DRegs, 8, "DREG"},
{0}
};
static void Sync(void)
{
int x;
setchr2(0x0000,DRegs[0]);
setchr2(0x0800,DRegs[1]);
for(x=0;x<4;x++)
setchr1(0x1000+(x<<10),DRegs[2+x]);
setprg8(0x8000,DRegs[6]);
setprg8(0xa000,DRegs[7]);
}
static void StateRestore(int version)
{
Sync();
}
static DECLFW(DEIWrite)
{
switch(A&0x8001)
{
case 0x8000: cmd=V&0x07; break;
case 0x8001: if(cmd<=0x05)
V&=0x3F;
else
V&=0x0F;
if(cmd<=0x01) V>>=1;
DRegs[cmd&0x07]=V;
Sync();
break;
}
}
static void DEIPower(void)
{
setprg8(0xc000,0xE);
setprg8(0xe000,0xF);
cmd=0;
memset(DRegs,0,8);
Sync();
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,DEIWrite);
}
void DEIROM_Init(CartInfo *info)
{
info->Power=DEIPower;
GameStateRestore=StateRestore;
AddExState(&DEI_StateRegs, ~0, 0, 0);
}

56
boards/dream.c Normal file
View File

@ -0,0 +1,56 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 latche;
static void Sync(void)
{
setprg16(0x8000,latche);
setprg16(0xC000,8);
}
static DECLFW(DREAMWrite)
{
latche=V&7;
Sync();
}
static void DREAMPower(void)
{
latche=0;
Sync();
setchr8(0);
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x5020,0x5020,DREAMWrite);
}
static void Restore(int version)
{
Sync();
}
void DreamTech01_Init(CartInfo *info)
{
GameStateRestore=Restore;
info->Power=DREAMPower;
AddExState(&latche, 1, 0, "LATCH");
}

81
boards/edu2000.c Normal file
View File

@ -0,0 +1,81 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2006 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "mapinc.h"
static uint8 *WRAM=NULL;
static uint8 reg;
static SFORMAT StateRegs[]=
{
{&reg, 1, "REG"},
{0}
};
static void Sync(void)
{
setchr8(0);
setprg8r(0x10,0x6000,(reg&0xC0)>>6);
setprg32(0x8000,reg&0x1F);
// setmirror(((reg&0x20)>>5));
}
static DECLFW(UNLEDU2000HiWrite)
{
// FCEU_printf("%04x:%02x\n",A,V);
reg=V;
Sync();
}
static void UNLEDU2000Power(void)
{
setmirror(MI_0);
SetReadHandler(0x6000,0xFFFF,CartBR);
SetWriteHandler(0x6000,0xFFFF,CartBW);
SetWriteHandler(0x8000,0xFFFF,UNLEDU2000HiWrite);
reg=0;
Sync();
}
static void UNLEDU2000Close(void)
{
if(WRAM)
FCEU_gfree(WRAM);
WRAM=NULL;
}
static void UNLEDU2000Restore(int version)
{
Sync();
}
void UNLEDU2000_Init(CartInfo *info)
{
info->Power=UNLEDU2000Power;
info->Close=UNLEDU2000Close;
GameStateRestore=UNLEDU2000Restore;
WRAM=(uint8*)FCEU_gmalloc(32768);
SetupCartPRGMapping(0x10,WRAM,32768,1);
info->SaveGame[0]=WRAM;
info->SaveGameLen[0]=32768;
AddExState(WRAM, 32768, 0, "WRAM");
AddExState(StateRegs, ~0, 0, 0);
}

127
boards/fk23c.c Normal file
View File

@ -0,0 +1,127 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2006 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
#include "mmc3.h"
static uint8 unromchr;
static uint8 dipswitch;
static void BMCFK23CCW(uint32 A, uint8 V)
{
if(EXPREGS[0]&0x40)
setchr8(EXPREGS[2]|unromchr);
else
{
uint16 base=(EXPREGS[2]&0x7F)<<3;
setchr1(A,V|base);
if(EXPREGS[3]&2)
{
setchr1(0x0400,EXPREGS[6]|base);
setchr1(0x0C00,EXPREGS[7]|base);
}
}
}
static void BMCFK23CPW(uint32 A, uint8 V)
{
if(EXPREGS[0]&4)
setprg32(0x8000,EXPREGS[1]>>1);
else
{
if(EXPREGS[0]&2)
setprg8(A,(V&(0x3F>>(EXPREGS[0]&3)))|(EXPREGS[1]<<1));
else
setprg8(A,V);
if(EXPREGS[3]&2)
{
setprg8(0xC000,EXPREGS[4]);
setprg8(0xE000,EXPREGS[5]);
}
}
}
static DECLFW(BMCFK23CHiWrite)
{
if(EXPREGS[0]&0x40)
{
if(EXPREGS[0]&0x20)
unromchr=0;
else
{
unromchr=V&3;
FixMMC3CHR(MMC3_cmd);
}
}
else
{
if((A==0x8001)&&(EXPREGS[3]&2&&MMC3_cmd&8))
{
EXPREGS[4|(MMC3_cmd&3)]=V;
FixMMC3PRG(MMC3_cmd);
FixMMC3CHR(MMC3_cmd);
}
else
if(A<0xC000)
MMC3_CMDWrite(A,V);
else
MMC3_IRQWrite(A,V);
}
}
static DECLFW(BMCFK23CWrite)
{
if(A&(1<<(dipswitch+4)))
{
EXPREGS[A&3]=V;
FixMMC3PRG(MMC3_cmd);
FixMMC3CHR(MMC3_cmd);
}
}
static void BMCFK23CReset(void)
{
dipswitch++;
dipswitch&=3;
EXPREGS[0]=EXPREGS[1]=EXPREGS[2]=EXPREGS[3]=0;
EXPREGS[4]=EXPREGS[5]=EXPREGS[6]=EXPREGS[7]=0xFF;
MMC3RegReset();
}
static void BMCFK23CPower(void)
{
EXPREGS[0]=EXPREGS[1]=EXPREGS[2]=EXPREGS[3]=0;
EXPREGS[4]=EXPREGS[5]=EXPREGS[6]=EXPREGS[7]=0xFF;
GenMMC3Power();
SetWriteHandler(0x5001,0x5fff,BMCFK23CWrite);
SetWriteHandler(0x8000,0xFFFF,BMCFK23CHiWrite);
}
void BMCFK23C_Init(CartInfo *info)
{
GenMMC3_Init(info, 512, 256, 8, 0);
cwrap=BMCFK23CCW;
pwrap=BMCFK23CPW;
info->Power=BMCFK23CPower;
info->Reset=BMCFK23CReset;
AddExState(EXPREGS, 8, 0, "EXPR");
AddExState(&unromchr, 1, 0, "UNCHR");
AddExState(&dipswitch, 1, 0, "DIPSW");
}

89
boards/h2288.c Normal file
View File

@ -0,0 +1,89 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
#include "mmc3.h"
extern uint8 m114_perm[8];
static void H2288PW(uint32 A, uint8 V)
{
if(EXPREGS[0]&0x40)
{
uint8 bank=(EXPREGS[0]&5)|((EXPREGS[0]&8)>>2)|((EXPREGS[0]&0x20)>>2);
if(EXPREGS[0]&2)
setprg32(0x8000,bank>>1);
else
{
setprg16(0x8000,bank);
setprg16(0xC000,bank);
}
}
else
setprg8(A,V&0x3F);
}
static DECLFW(H2288WriteHi)
{
switch (A&0x8001)
{
case 0x8000: MMC3_CMDWrite(0x8000,(V&0xC0)|(m114_perm[V&7])); break;
case 0x8001: MMC3_CMDWrite(0x8001,V); break;
}
}
static DECLFW(H2288WriteLo)
{
if(A&0x800)
{
if(A&1)
EXPREGS[1]=V;
else
EXPREGS[0]=V;
FixMMC3PRG(MMC3_cmd);
}
}
static DECLFR(H2288Read)
{
int bit;
bit=(A&1)^1;
bit&=((A>>8)&1);
bit^=1;
return((X.DB&0xFE)|bit);
}
static void H2288Power(void)
{
EXPREGS[0]=EXPREGS[1]=0;
GenMMC3Power();
SetReadHandler(0x5000,0x5FFF,H2288Read);
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x5000,0x5FFF,H2288WriteLo);
SetWriteHandler(0x8000,0x8FFF,H2288WriteHi);
}
void UNLH2288_Init(CartInfo *info)
{
GenMMC3_Init(info, 256, 256, 0, 0);
pwrap=H2288PW;
info->Power=H2288Power;
AddExState(EXPREGS, 2, 0, "EXPR");
}

71
boards/karaoke.c Normal file
View File

@ -0,0 +1,71 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
extern uint32 ROM_size;
static uint8 latche;
static void Sync(void)
{
if(latche)
{
if(latche&0x10)
setprg16(0x8000,(latche&7));
else
setprg16(0x8000,(latche&7)|8);
}
else
setprg16(0x8000,7+(ROM_size>>4));
}
static DECLFW(M188Write)
{
latche=V;
Sync();
}
static DECLFR(ExtDev)
{
return(3);
}
static void Power(void)
{
latche=0;
Sync();
setchr8(0);
setprg16(0xc000,0x7);
SetReadHandler(0x6000,0x7FFF,ExtDev);
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,M188Write);
}
static void StateRestore(int version)
{
Sync();
}
void Mapper188_Init(CartInfo *info)
{
info->Power=Power;
GameStateRestore=StateRestore;
AddExState(&latche, 1, 0, "LATCH");
}

50
boards/kof97.c Normal file
View File

@ -0,0 +1,50 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
#include "mmc3.h"
static DECLFW(UNLKOF97CMDWrite)
{
V=(V&0xD8)|((V&0x20)>>4)|((V&4)<<3)|((V&2)>>1)|((V&1)<<2); //76143502
if(A==0x9000) A=0x8001;
MMC3_CMDWrite(A,V);
}
static DECLFW(UNLKOF97IRQWrite)
{
V=(V&0xD8)|((V&0x20)>>4)|((V&4)<<3)|((V&2)>>1)|((V&1)<<2);
if(A==0xD000) A=0xC001;
else if(A==0xF000) A=0xE001;
MMC3_IRQWrite(A,V);
}
static void UNLKOF97Power(void)
{
GenMMC3Power();
SetWriteHandler(0x8000,0xA000,UNLKOF97CMDWrite);
SetWriteHandler(0xC000,0xF000,UNLKOF97IRQWrite);
}
void UNLKOF97_Init(CartInfo *info)
{
GenMMC3_Init(info, 128, 256, 0, 0);
info->Power=UNLKOF97Power;
}

128
boards/konami-qtai.c Normal file
View File

@ -0,0 +1,128 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* CAI Shogakko no Sansu
*/
#include "mapinc.h"
static uint8 *CHRRAM=NULL;
static uint8 SWRAM[4096];
static uint8 regs[16];
static uint8 WRAM[4096];
static SFORMAT StateRegs[]=
{
{&regs, 16, "REGS"},
{WRAM, 4096, "WRAM"},
{0}
};
static void Sync(void)
{
if(regs[5]&0x40)
{
setchr4r(0,0x1000,regs[5]&0x3F);
}
else
{
setchr4r(0x10,0x0000,regs[5]);
setchr4r(0x10,0x1000,regs[5]^1);
}
setprg8r((regs[2]>>6)&1,0x8000,(regs[2]&0x3F));
setprg8r((regs[3]>>6)&1,0xA000,(regs[3]&0x3F));
setprg8r((regs[4]>>6)&1,0xC000,(regs[4]&0x3F));
setprg8r(1,0xE000,~0);
setmirror((regs[0xA]&3));
}
static DECLFW(M190Write)
{
// FCEU_printf("write %04x:%04x %d, %d\n",A,V,scanline,timestamp);
regs[(A&0x0F00)>>8]=V;
Sync();
}
static DECLFR(M190Read)
{
// FCEU_printf("read %04x:%04x %d, %d\n",A,regs[(A&0x0F00)>>8],scanline,timestamp);
return regs[(A&0x0F00)>>8];
}
static DECLFR(AWRAM)
{
return(WRAM[A-0x7000]);
}
static DECLFW(BWRAM)
{
WRAM[A-0x7000]=V;
}
static DECLFR(ASWRAM)
{
return(SWRAM[A-0x6000]);
}
static DECLFW(BSWRAM)
{
SWRAM[A-0x6000]=V;
}
static void M190Power(void)
{
setvram8(CHRRAM);
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,M190Write);
// SetReadHandler(0xDA00,0xDA00,M190Read);
// SetReadHandler(0xDB00,0xDB00,M190Read);
SetReadHandler(0xDC00,0xDC00,M190Read);
SetReadHandler(0xDD00,0xDD00,M190Read);
SetReadHandler(0x7000,0x7FFF,AWRAM);
SetWriteHandler(0x7000,0x7FFF,BWRAM);
SetReadHandler(0x6000,0x6FFF,ASWRAM);
SetWriteHandler(0x6000,0x6FFF,BSWRAM);
Sync();
}
static void M190Close(void)
{
if(CHRRAM)
FCEU_gfree(CHRRAM);
CHRRAM=NULL;
}
static void StateRestore(int version)
{
Sync();
}
void Mapper190_Init(CartInfo *info)
{
info->Power=M190Power;
info->Close=M190Close;
if(info->battery)
{
info->SaveGame[0]=SWRAM;
info->SaveGameLen[0]=4096;
}
GameStateRestore=StateRestore;
CHRRAM=(uint8*)FCEU_gmalloc(8192);
SetupCartCHRMapping(0x10,CHRRAM,8192,1);
AddExState(CHRRAM, 8192, 0, "CHRRAM");
AddExState(&StateRegs, ~0, 0, 0);
}

41
boards/malee.c Normal file
View File

@ -0,0 +1,41 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 WRAM[2048];
static void MALEEPower(void)
{
setprg2r(0x10,0x7000,0);
SetReadHandler(0x8000,0xFFFF,CartBR);
SetReadHandler(0x6000,0x67FF,CartBR);
SetReadHandler(0x7000,0x77FF,CartBR);
setprg2r(1,0x6000,0);
setprg32(0x8000,0);
setchr8(0);
}
void MALEE_Init(CartInfo *info)
{
info->Power=MALEEPower;
SetupCartPRGMapping(0x10, WRAM, 2048, 1);
AddExState(WRAM, 2048, 0,"RAM");
}

11
boards/mapinc.h Normal file
View File

@ -0,0 +1,11 @@
#include "../types.h"
#include "../x6502.h"
#include "../fceu.h"
#include "../ppu.h"
#include "../memory.h"
#include "../sound.h"
#include "../state.h"
#include "../cart.h"
#include "../cheat.h"
#include "../unif.h"
#include <string.h>

423
boards/mmc1.c Normal file
View File

@ -0,0 +1,423 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 1998 BERO
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static void GenMMC1Power(void);
static void GenMMC1Init(CartInfo *info, int prg, int chr, int wram, int battery);
static uint8 DRegs[4];
static uint8 Buffer,BufferShift;
static int mmc1opts;
static void (*MMC1CHRHook4)(uint32 A, uint8 V);
static void (*MMC1PRGHook16)(uint32 A, uint8 V);
static uint8 *WRAM=NULL;
static uint8 *CHRRAM=NULL;
static int is155;
static DECLFW(MBWRAM)
{
if(!(DRegs[3]&0x10)||is155)
Page[A>>11][A]=V; // WRAM is enabled.
}
static DECLFR(MAWRAM)
{
if((DRegs[3]&0x10)&&!is155)
return X.DB; // WRAM is disabled
return(Page[A>>11][A]);
}
static void MMC1CHR(void)
{
if(mmc1opts&4)
{
if(DRegs[0]&0x10)
setprg8r(0x10,0x6000,(DRegs[1]>>4)&1);
else
setprg8r(0x10,0x6000,(DRegs[1]>>3)&1);
}
if(MMC1CHRHook4)
{
if(DRegs[0]&0x10)
{
MMC1CHRHook4(0x0000,DRegs[1]);
MMC1CHRHook4(0x1000,DRegs[2]);
}
else
{
MMC1CHRHook4(0x0000,(DRegs[1]&0xFE));
MMC1CHRHook4(0x1000,DRegs[1]|1);
}
}
else
{
if(DRegs[0]&0x10)
{
setchr4(0x0000,DRegs[1]);
setchr4(0x1000,DRegs[2]);
}
else
setchr8(DRegs[1]>>1);
}
}
static void MMC1PRG(void)
{
uint8 offs=DRegs[1]&0x10;
if(MMC1PRGHook16)
{
switch(DRegs[0]&0xC)
{
case 0xC: MMC1PRGHook16(0x8000,(DRegs[3]+offs));
MMC1PRGHook16(0xC000,0xF+offs);
break;
case 0x8: MMC1PRGHook16(0xC000,(DRegs[3]+offs));
MMC1PRGHook16(0x8000,offs);
break;
case 0x0:
case 0x4:
MMC1PRGHook16(0x8000,((DRegs[3]&~1)+offs));
MMC1PRGHook16(0xc000,((DRegs[3]&~1)+offs+1));
break;
}
}
else switch(DRegs[0]&0xC)
{
case 0xC: setprg16(0x8000,(DRegs[3]+offs));
setprg16(0xC000,0xF+offs);
break;
case 0x8: setprg16(0xC000,(DRegs[3]+offs));
setprg16(0x8000,offs);
break;
case 0x0:
case 0x4:
setprg16(0x8000,((DRegs[3]&~1)+offs));
setprg16(0xc000,((DRegs[3]&~1)+offs+1));
break;
}
}
static void MMC1MIRROR(void)
{
switch(DRegs[0]&3)
{
case 2: setmirror(MI_V); break;
case 3: setmirror(MI_H); break;
case 0: setmirror(MI_0); break;
case 1: setmirror(MI_1); break;
}
}
static uint64 lreset;
static DECLFW(MMC1_write)
{
int n=(A>>13)-4;
//FCEU_DispMessage("%016x",timestampbase+timestamp);
//printf("$%04x:$%02x, $%04x\n",A,V,X.PC);
//DumpMem("out",0xe000,0xffff);
/* The MMC1 is busy so ignore the write. */
/* As of version FCE Ultra 0.81, the timestamp is only
increased before each instruction is executed(in other words
precision isn't that great), but this should still work to
deal with 2 writes in a row from a single RMW instruction. */
if((timestampbase+timestamp)<(lreset+2)) return;
if(V&0x80)
{
DRegs[0]|=0xC;
BufferShift=Buffer=0;
MMC1PRG();
lreset=timestampbase+timestamp;
return;
}
Buffer|=(V&1)<<(BufferShift++);
if(BufferShift==5)
{
DRegs[n] = Buffer;
BufferShift = Buffer = 0;
switch(n)
{
case 0: MMC1MIRROR(); MMC1CHR(); MMC1PRG(); break;
case 1: MMC1CHR(); MMC1PRG(); break;
case 2: MMC1CHR(); break;
case 3: MMC1PRG(); break;
}
}
}
static void MMC1_Restore(int version)
{
MMC1MIRROR();
MMC1CHR();
MMC1PRG();
lreset=0; /* timestamp(base) is not stored in save states. */
}
static void MMC1CMReset(void)
{
int i;
for(i=0;i<4;i++)
DRegs[i]=0;
Buffer = BufferShift = 0;
DRegs[0]=0x1F;
DRegs[1]=0;
DRegs[2]=0; // Should this be something other than 0?
DRegs[3]=0;
MMC1MIRROR();
MMC1CHR();
MMC1PRG();
}
static int DetectMMC1WRAMSize(uint32 crc32)
{
switch(crc32)
{
case 0xc6182024: /* Romance of the 3 Kingdoms */
case 0x2225c20f: /* Genghis Khan */
case 0x4642dda6: /* Nobunaga's Ambition */
case 0x29449ba9: /* "" "" (J) */
case 0x2b11e0b0: /* "" "" (J) */
case 0xb8747abf: /* Best Play Pro Yakyuu Special (J) */
case 0xc9556b36: /* Final Fantasy I & II (J) [!] */
FCEU_printf(" >8KB external WRAM present. Use UNIF if you hack the ROM image.\n");
return(16);
break;
default:return(8);
}
}
static uint32 NWCIRQCount;
static uint8 NWCRec;
#define NWCDIP 0xE
static void FP_FASTAPASS(1) NWCIRQHook(int a)
{
if(!(NWCRec&0x10))
{
NWCIRQCount+=a;
if((NWCIRQCount|(NWCDIP<<25))>=0x3e000000)
{
NWCIRQCount=0;
X6502_IRQBegin(FCEU_IQEXT);
}
}
}
static void NWCCHRHook(uint32 A, uint8 V)
{
if((V&0x10)) // && !(NWCRec&0x10))
{
NWCIRQCount=0;
X6502_IRQEnd(FCEU_IQEXT);
}
NWCRec=V;
if(V&0x08)
MMC1PRG();
else
setprg32(0x8000,(V>>1)&3);
}
static void NWCPRGHook(uint32 A, uint8 V)
{
if(NWCRec&0x8)
setprg16(A,8|(V&0x7));
else
setprg32(0x8000,(NWCRec>>1)&3);
}
static void NWCPower(void)
{
GenMMC1Power();
setchr8r(0,0);
}
void Mapper105_Init(CartInfo *info)
{
GenMMC1Init(info, 256, 256, 8, 0);
MMC1CHRHook4=NWCCHRHook;
MMC1PRGHook16=NWCPRGHook;
MapIRQHook=NWCIRQHook;
info->Power=NWCPower;
}
static void GenMMC1Power(void)
{
lreset=0;
if(mmc1opts&1)
{
FCEU_CheatAddRAM(8,0x6000,WRAM);
if(mmc1opts&4)
FCEU_dwmemset(WRAM,0,8192)
else if(!(mmc1opts&2))
FCEU_dwmemset(WRAM,0,8192);
}
SetWriteHandler(0x8000,0xFFFF,MMC1_write);
SetReadHandler(0x8000,0xFFFF,CartBR);
if(mmc1opts&1)
{
SetReadHandler(0x6000,0x7FFF,MAWRAM);
SetWriteHandler(0x6000,0x7FFF,MBWRAM);
setprg8r(0x10,0x6000,0);
}
MMC1CMReset();
}
static void GenMMC1Close(void)
{
if(CHRRAM)
FCEU_gfree(CHRRAM);
if(WRAM)
FCEU_gfree(WRAM);
CHRRAM=WRAM=NULL;
}
static void GenMMC1Init(CartInfo *info, int prg, int chr, int wram, int battery)
{
is155=0;
info->Close=GenMMC1Close;
MMC1PRGHook16=MMC1CHRHook4=0;
mmc1opts=0;
PRGmask16[0]&=(prg>>14)-1;
CHRmask4[0]&=(chr>>12)-1;
CHRmask8[0]&=(chr>>13)-1;
if(wram)
{
WRAM=(uint8*)FCEU_gmalloc(wram*1024);
mmc1opts|=1;
if(wram>8) mmc1opts|=4;
SetupCartPRGMapping(0x10,WRAM,wram*1024,1);
AddExState(WRAM, wram*1024, 0, "WRAM");
if(battery)
{
mmc1opts|=2;
info->SaveGame[0]=WRAM+((mmc1opts&4)?8192:0);
info->SaveGameLen[0]=8192;
}
}
if(!chr)
{
CHRRAM=(uint8*)FCEU_gmalloc(8192);
SetupCartCHRMapping(0, CHRRAM, 8192, 1);
AddExState(CHRRAM, 8192, 0, "CHRR");
}
AddExState(DRegs, 4, 0, "DREG");
info->Power=GenMMC1Power;
GameStateRestore=MMC1_Restore;
AddExState(&lreset, 8, 1, "LRST");
}
void Mapper1_Init(CartInfo *info)
{
int ws=DetectMMC1WRAMSize(info->CRC32);
GenMMC1Init(info, 512, 256, ws, info->battery);
}
/* Same as mapper 1, without respect for WRAM enable bit. */
void Mapper155_Init(CartInfo *info)
{
GenMMC1Init(info,512,256,8,info->battery);
is155=1;
}
void SAROM_Init(CartInfo *info)
{
GenMMC1Init(info, 128, 64, 8, info->battery);
}
void SBROM_Init(CartInfo *info)
{
GenMMC1Init(info, 128, 64, 0, 0);
}
void SCROM_Init(CartInfo *info)
{
GenMMC1Init(info, 128, 128, 0, 0);
}
void SEROM_Init(CartInfo *info)
{
GenMMC1Init(info, 32, 64, 0, 0);
}
void SGROM_Init(CartInfo *info)
{
GenMMC1Init(info, 256, 0, 0, 0);
}
void SKROM_Init(CartInfo *info)
{
GenMMC1Init(info, 256, 64, 8, info->battery);
}
void SLROM_Init(CartInfo *info)
{
GenMMC1Init(info, 256, 128, 0, 0);
}
void SL1ROM_Init(CartInfo *info)
{
GenMMC1Init(info, 128, 128, 0, 0);
}
/* Begin unknown - may be wrong - perhaps they use different MMC1s from the
similarly functioning boards?
*/
void SL2ROM_Init(CartInfo *info)
{
GenMMC1Init(info, 256, 256, 0, 0);
}
void SFROM_Init(CartInfo *info)
{
GenMMC1Init(info, 256, 256, 0, 0);
}
void SHROM_Init(CartInfo *info)
{
GenMMC1Init(info, 256, 256, 0, 0);
}
/* End unknown */
/* */
/* */
void SNROM_Init(CartInfo *info)
{
GenMMC1Init(info, 256, 0, 8, info->battery);
}
void SOROM_Init(CartInfo *info)
{
GenMMC1Init(info, 256, 0, 16, info->battery);
}

1616
boards/mmc3.c Normal file

File diff suppressed because it is too large Load Diff

25
boards/mmc3.h Normal file
View File

@ -0,0 +1,25 @@
extern uint8 MMC3_cmd;
extern uint8 *WRAM;
extern uint8 *CHRRAM;
extern uint8 EXPREGS[8];
extern uint8 DRegBuf[8];
#undef IRQCount
#undef IRQLatch
#undef IRQa
extern uint8 IRQCount,IRQLatch,IRQa;
extern uint8 IRQReload;
extern void (*pwrap)(uint32 A, uint8 V);
extern void (*cwrap)(uint32 A, uint8 V);
extern void (*mwrap)(uint8 V);
void GenMMC3Power(void);
void GenMMC3Restore(int version);
void MMC3RegReset(void);
void FixMMC3PRG(int V);
void FixMMC3CHR(int V);
DECLFW(MMC3_CMDWrite);
DECLFW(MMC3_IRQWrite);
void GenMMC3_Init(CartInfo *info, int prg, int chr, int wram, int battery);

835
boards/mmc5.c Normal file
View File

@ -0,0 +1,835 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* None of this code should use any of the iNES bank switching wrappers. */
#include "mapinc.h"
static void (*sfun)(int P);
static void (*psfun)(void);
void MMC5RunSound(int Count);
void MMC5RunSoundHQ(void);
static INLINE void MMC5SPRVROM_BANK1(uint32 A,uint32 V)
{
if(CHRptr[0])
{
V&=CHRmask1[0];
MMC5SPRVPage[(A)>>10]=&CHRptr[0][(V)<<10]-(A);
}
}
static INLINE void MMC5BGVROM_BANK1(uint32 A,uint32 V) {if(CHRptr[0]){V&=CHRmask1[0];MMC5BGVPage[(A)>>10]=&CHRptr[0][(V)<<10]-(A);}}
static INLINE void MMC5SPRVROM_BANK2(uint32 A,uint32 V) {if(CHRptr[0]){V&=CHRmask2[0];MMC5SPRVPage[(A)>>10]=MMC5SPRVPage[((A)>>10)+1]=&CHRptr[0][(V)<<11]-(A);}}
static INLINE void MMC5BGVROM_BANK2(uint32 A,uint32 V) {if(CHRptr[0]){V&=CHRmask2[0];MMC5BGVPage[(A)>>10]=MMC5BGVPage[((A)>>10)+1]=&CHRptr[0][(V)<<11]-(A);}}
static INLINE void MMC5SPRVROM_BANK4(uint32 A,uint32 V) {if(CHRptr[0]){V&=CHRmask4[0];MMC5SPRVPage[(A)>>10]=MMC5SPRVPage[((A)>>10)+1]= MMC5SPRVPage[((A)>>10)+2]=MMC5SPRVPage[((A)>>10)+3]=&CHRptr[0][(V)<<12]-(A);}}
static INLINE void MMC5BGVROM_BANK4(uint32 A,uint32 V) {if(CHRptr[0]){V&=CHRmask4[0];MMC5BGVPage[(A)>>10]=MMC5BGVPage[((A)>>10)+1]=MMC5BGVPage[((A)>>10)+2]=MMC5BGVPage[((A)>>10)+3]=&CHRptr[0][(V)<<12]-(A);}}
static INLINE void MMC5SPRVROM_BANK8(uint32 V) {if(CHRptr[0]){V&=CHRmask8[0];MMC5SPRVPage[0]=MMC5SPRVPage[1]=MMC5SPRVPage[2]=MMC5SPRVPage[3]=MMC5SPRVPage[4]=MMC5SPRVPage[5]=MMC5SPRVPage[6]=MMC5SPRVPage[7]=&CHRptr[0][(V)<<13];}}
static INLINE void MMC5BGVROM_BANK8(uint32 V) {if(CHRptr[0]){V&=CHRmask8[0];MMC5BGVPage[0]=MMC5BGVPage[1]=MMC5BGVPage[2]=MMC5BGVPage[3]=MMC5BGVPage[4]=MMC5BGVPage[5]=MMC5BGVPage[6]=MMC5BGVPage[7]=&CHRptr[0][(V)<<13];}}
static uint8 PRGBanks[4];
static uint8 WRAMPage;
static uint8 CHRBanksA[8], CHRBanksB[4];
static uint8 WRAMMaskEnable[2];
static uint8 ABMode; /* A=0, B=1 */
static uint8 IRQScanline,IRQEnable;
static uint8 CHRMode, NTAMirroring, NTFill, ATFill;
static uint8 MMC5IRQR;
static uint8 MMC5LineCounter;
static uint8 mmc5psize, mmc5vsize;
static uint8 mul[2];
static uint8 *WRAM=NULL;
static uint8 *MMC5fill=NULL;
static uint8 *ExRAM=NULL;
static uint8 MMC5WRAMsize;
static uint8 MMC5WRAMIndex[8];
static uint8 MMC5ROMWrProtect[4];
static uint8 MMC5MemIn[5];
static void MMC5CHRA(void);
static void MMC5CHRB(void);
typedef struct __cartdata {
uint32 crc32;
uint8 size;
} cartdata;
// ETROM seems to have 16KB of WRAM, ELROM seems to have 8KB
// EWROM seems to have 32KB of WRAM
#define MMC5_NOCARTS 14
cartdata MMC5CartList[MMC5_NOCARTS]=
{
{0x9c18762b,2}, /* L'Empereur */
{0x26533405,2},
{0x6396b988,2},
{0xaca15643,2}, /* Uncharted Waters */
{0xfe3488d1,2}, /* Dai Koukai Jidai */
{0x15fe6d0f,2}, /* BKAC */
{0x39f2ce4b,2}, /* Suikoden */
{0x8ce478db,2}, /* Nobunaga's Ambition 2 */
{0xeee9a682,2},
{0x1ced086f,2}, /* Ishin no Arashi */
{0xf540677b,4}, /* Nobunaga...Bushou Fuuun Roku */
{0x6f4e4312,4}, /* Aoki Ookami..Genchou */
{0xf011e490,4}, /* Romance of the 3 Kingdoms 2 */
{0x184c2124,4}, /* Sangokushi 2 */
};
int DetectMMC5WRAMSize(uint32 crc32)
{
int x;
for(x=0;x<MMC5_NOCARTS;x++)
if(crc32==MMC5CartList[x].crc32)
{
FCEU_printf(" >8KB external WRAM present. Use UNIF if you hack the ROM image.\n");
return(MMC5CartList[x].size*8);
}
return(8);
}
static void BuildWRAMSizeTable(void)
{
int x;
for(x=0;x<8;x++)
{
switch(MMC5WRAMsize)
{
case 0: MMC5WRAMIndex[x]=255; break;
case 1: MMC5WRAMIndex[x]=(x>3)?255:0; break;
case 2: MMC5WRAMIndex[x]=(x&4)>>2; break;
case 4: MMC5WRAMIndex[x]=(x>3)?255:(x&3); break;
}
}
}
static void MMC5CHRA(void)
{
int x;
switch(mmc5vsize&3)
{
case 0: setchr8(CHRBanksA[7]);
MMC5SPRVROM_BANK8(CHRBanksA[7]);
break;
case 1: setchr4(0x0000,CHRBanksA[3]);
setchr4(0x1000,CHRBanksA[7]);
MMC5SPRVROM_BANK4(0x0000,CHRBanksA[3]);
MMC5SPRVROM_BANK4(0x1000,CHRBanksA[7]);
break;
case 2: setchr2(0x0000,CHRBanksA[1]);
setchr2(0x0800,CHRBanksA[3]);
setchr2(0x1000,CHRBanksA[5]);
setchr2(0x1800,CHRBanksA[7]);
MMC5SPRVROM_BANK2(0x0000,CHRBanksA[1]);
MMC5SPRVROM_BANK2(0x0800,CHRBanksA[3]);
MMC5SPRVROM_BANK2(0x1000,CHRBanksA[5]);
MMC5SPRVROM_BANK2(0x1800,CHRBanksA[7]);
break;
case 3: for(x=0;x<8;x++)
{
setchr1(x<<10,CHRBanksA[x]);
MMC5SPRVROM_BANK1(x<<10,CHRBanksA[x]);
}
break;
}
}
static void MMC5CHRB(void)
{
int x;
switch(mmc5vsize&3)
{
case 0: setchr8(CHRBanksB[3]);
MMC5BGVROM_BANK8(CHRBanksB[3]);
break;
case 1: setchr4(0x0000,CHRBanksB[3]);
setchr4(0x1000,CHRBanksB[3]);
MMC5BGVROM_BANK4(0x0000,CHRBanksB[3]);
MMC5BGVROM_BANK4(0x1000,CHRBanksB[3]);
break;
case 2: setchr2(0x0000,CHRBanksB[1]);
setchr2(0x0800,CHRBanksB[3]);
setchr2(0x1000,CHRBanksB[1]);
setchr2(0x1800,CHRBanksB[3]);
MMC5BGVROM_BANK2(0x0000,CHRBanksB[1]);
MMC5BGVROM_BANK2(0x0800,CHRBanksB[3]);
MMC5BGVROM_BANK2(0x1000,CHRBanksB[1]);
MMC5BGVROM_BANK2(0x1800,CHRBanksB[3]);
break;
case 3: for(x=0;x<8;x++)
{
setchr1(x<<10,CHRBanksB[x&3]);
MMC5BGVROM_BANK1(x<<10,CHRBanksB[x&3]);
}
break;
}
}
static void FASTAPASS(2) MMC5WRAM(uint32 A, uint32 V)
{
//printf("%02x\n",V);
V=MMC5WRAMIndex[V&7];
if(V!=255)
{
setprg8r(0x10,A,V);
MMC5MemIn[(A-0x6000)>>13]=1;
}
else
MMC5MemIn[(A-0x6000)>>13]=0;
}
static void MMC5PRG(void)
{
int x;
switch(mmc5psize&3)
{
case 0: MMC5ROMWrProtect[0]=MMC5ROMWrProtect[1]=
MMC5ROMWrProtect[2]=MMC5ROMWrProtect[3]=1;
setprg32(0x8000,((PRGBanks[1]&0x7F)>>2));
for(x=0;x<4;x++)
MMC5MemIn[1+x]=1;
break;
case 1: if(PRGBanks[1]&0x80)
{
MMC5ROMWrProtect[0]=MMC5ROMWrProtect[1]=1;
setprg16(0x8000,(PRGBanks[1]>>1));
MMC5MemIn[1]=MMC5MemIn[2]=1;
}
else
{
MMC5ROMWrProtect[0]=MMC5ROMWrProtect[1]=0;
MMC5WRAM(0x8000,PRGBanks[1]&7&0xFE);
MMC5WRAM(0xA000,(PRGBanks[1]&7&0xFE)+1);
}
MMC5MemIn[3]=MMC5MemIn[4]=1;
MMC5ROMWrProtect[2]=MMC5ROMWrProtect[3]=1;
setprg16(0xC000,(PRGBanks[3]&0x7F)>>1);
break;
case 2: if(PRGBanks[1]&0x80)
{
MMC5MemIn[1]=MMC5MemIn[2]=1;
MMC5ROMWrProtect[0]=MMC5ROMWrProtect[1]=1;
setprg16(0x8000,(PRGBanks[1]&0x7F)>>1);
}
else
{
MMC5ROMWrProtect[0]=MMC5ROMWrProtect[1]=0;
MMC5WRAM(0x8000,PRGBanks[1]&7&0xFE);
MMC5WRAM(0xA000,(PRGBanks[1]&7&0xFE)+1);
}
if(PRGBanks[2]&0x80)
{
MMC5ROMWrProtect[2]=1;
MMC5MemIn[3]=1;
setprg8(0xC000,PRGBanks[2]&0x7F);
}
else
{
MMC5ROMWrProtect[2]=0;
MMC5WRAM(0xC000,PRGBanks[2]&7);
}
MMC5MemIn[4]=1;
MMC5ROMWrProtect[3]=1;
setprg8(0xE000,PRGBanks[3]&0x7F);
break;
case 3: for(x=0;x<3;x++)
if(PRGBanks[x]&0x80)
{
MMC5ROMWrProtect[x]=1;
setprg8(0x8000+(x<<13),PRGBanks[x]&0x7F);
MMC5MemIn[1+x]=1;
}
else
{
MMC5ROMWrProtect[x]=0;
MMC5WRAM(0x8000+(x<<13),PRGBanks[x]&7);
}
MMC5MemIn[4]=1;
MMC5ROMWrProtect[3]=1;
setprg8(0xE000,PRGBanks[3]&0x7F);
break;
}
}
static DECLFW(Mapper5_write)
{
if(A>=0x5120&&A<=0x5127)
{
ABMode = 0;
CHRBanksA[A&7]=V;
MMC5CHRA();
}
else switch(A)
{
case 0x5105: {
int x;
for(x=0;x<4;x++)
{
switch((V>>(x<<1))&3)
{
case 0:PPUNTARAM|=1<<x;vnapage[x]=NTARAM;break;
case 1:PPUNTARAM|=1<<x;vnapage[x]=NTARAM+0x400;break;
case 2:PPUNTARAM|=1<<x;vnapage[x]=ExRAM;break;
case 3:PPUNTARAM&=~(1<<x);vnapage[x]=MMC5fill;break;
}
}
}
NTAMirroring=V;
break;
case 0x5113: WRAMPage=V;MMC5WRAM(0x6000,V&7);break;
case 0x5100: mmc5psize=V;MMC5PRG();break;
case 0x5101: mmc5vsize=V;
if(!ABMode)
{ MMC5CHRB();MMC5CHRA();}
else
{ MMC5CHRA();MMC5CHRB();}
break;
case 0x5114:
case 0x5115:
case 0x5116:
case 0x5117: PRGBanks[A&3]=V;MMC5PRG();break;
case 0x5128:
case 0x5129:
case 0x512a:
case 0x512b: ABMode=1;
CHRBanksB[A&3]=V;
MMC5CHRB();
break;
case 0x5102: WRAMMaskEnable[0]=V;break;
case 0x5103: WRAMMaskEnable[1]=V;break;
case 0x5104: CHRMode=V;MMC5HackCHRMode=V&3;break;
case 0x5106: if(V!=NTFill)
{
uint32 t;
t=V|(V<<8)|(V<<16)|(V<<24);
FCEU_dwmemset(MMC5fill,t,0x3c0);
}
NTFill=V;
break;
case 0x5107: if(V!=ATFill)
{
unsigned char moop;
uint32 t;
moop=V|(V<<2)|(V<<4)|(V<<6);
t=moop|(moop<<8)|(moop<<16)|(moop<<24);
FCEU_dwmemset(MMC5fill+0x3c0,t,0x40);
}
ATFill=V;
break;
case 0x5200: MMC5HackSPMode=V;break;
case 0x5201: MMC5HackSPScroll=(V>>3)&0x1F;break;
case 0x5202: MMC5HackSPPage=V&0x3F;break;
case 0x5203: X6502_IRQEnd(FCEU_IQEXT);IRQScanline=V;break;
case 0x5204: X6502_IRQEnd(FCEU_IQEXT);IRQEnable=V&0x80;break;
case 0x5205: mul[0]=V;break;
case 0x5206: mul[1]=V;break;
}
}
static DECLFR(MMC5_ReadROMRAM)
{
if(MMC5MemIn[(A-0x6000)>>13])
return Page[A>>11][A];
else
return X.DB;
}
static DECLFW(MMC5_WriteROMRAM)
{
if(A>=0x8000)
if(MMC5ROMWrProtect[(A-0x8000)>>13]) return;
if(MMC5MemIn[(A-0x6000)>>13])
if(((WRAMMaskEnable[0]&3)|((WRAMMaskEnable[1]&3)<<2)) == 6) Page[A>>11][A]=V;
}
static DECLFW(MMC5_ExRAMWr)
{
if(MMC5HackCHRMode!=3)
ExRAM[A&0x3ff]=V;
}
static DECLFR(MMC5_ExRAMRd)
{
/* Not sure if this is correct, so I'll comment it out for now. */
//if(MMC5HackCHRMode>=2)
return ExRAM[A&0x3ff];
//else
// return(X.DB);
}
static DECLFR(MMC5_read)
{
switch(A)
{
case 0x5204: X6502_IRQEnd(FCEU_IQEXT);
{
uint8 x;
x=MMC5IRQR;
if(!fceuindbg)
MMC5IRQR&=0x40;
return x;
}
case 0x5205: return (mul[0]*mul[1]);
case 0x5206: return ((mul[0]*mul[1])>>8);
}
return(X.DB);
}
void MMC5Synco(void)
{
int x;
MMC5PRG();
for(x=0;x<4;x++)
{
switch((NTAMirroring>>(x<<1))&3)
{
case 0:PPUNTARAM|=1<<x;vnapage[x]=NTARAM;break;
case 1:PPUNTARAM|=1<<x;vnapage[x]=NTARAM+0x400;break;
case 2:PPUNTARAM|=1<<x;vnapage[x]=ExRAM;break;
case 3:PPUNTARAM&=~(1<<x);vnapage[x]=MMC5fill;break;
}
}
MMC5WRAM(0x6000,WRAMPage&7);
if(!ABMode)
{
MMC5CHRB();
MMC5CHRA();
}
else
{
MMC5CHRA();
MMC5CHRB();
}
{
uint32 t;
t=NTFill|(NTFill<<8)|(NTFill<<16)|(NTFill<<24);
FCEU_dwmemset(MMC5fill,t,0x3c0);
}
{
unsigned char moop;
uint32 t;
moop=ATFill|(ATFill<<2)|(ATFill<<4)|(ATFill<<6);
t=moop|(moop<<8)|(moop<<16)|(moop<<24);
FCEU_dwmemset(MMC5fill+0x3c0,t,0x40);
}
X6502_IRQEnd(FCEU_IQEXT);
MMC5HackCHRMode=CHRMode&3;
}
void MMC5_hb(int scanline)
{
if(scanline==240)
{
MMC5LineCounter=0;
MMC5IRQR=0x40;
return;
}
if(MMC5LineCounter<240)
{
if(MMC5LineCounter==IRQScanline)
{
MMC5IRQR|=0x80;
if(IRQEnable&0x80)
X6502_IRQBegin(FCEU_IQEXT);
}
MMC5LineCounter++;
}
if(MMC5LineCounter==240)
MMC5IRQR=0;
}
void MMC5_StateRestore(int version)
{
MMC5Synco();
}
typedef struct {
uint16 wl[2];
uint8 env[2];
uint8 enable;
uint8 running;
uint8 raw;
uint8 rawcontrol;
int32 dcount[2];
int32 BC[3];
int32 vcount[2];
} MMC5APU;
static MMC5APU MMC5Sound;
static void Do5PCM()
{
int32 V;
int32 start,end;
start=MMC5Sound.BC[2];
end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
MMC5Sound.BC[2]=end;
if(!(MMC5Sound.rawcontrol&0x40) && MMC5Sound.raw)
for(V=start;V<end;V++)
Wave[V>>4]+=MMC5Sound.raw<<1;
}
static void Do5PCMHQ()
{
uint32 V; //mbg merge 7/17/06 made uint32
if(!(MMC5Sound.rawcontrol&0x40) && MMC5Sound.raw)
for(V=MMC5Sound.BC[2];V<SOUNDTS;V++)
WaveHi[V]+=MMC5Sound.raw<<5;
MMC5Sound.BC[2]=SOUNDTS;
}
static DECLFW(Mapper5_SW)
{
A&=0x1F;
GameExpSound.Fill=MMC5RunSound;
GameExpSound.HiFill=MMC5RunSoundHQ;
switch(A)
{
case 0x10:if(psfun) psfun();MMC5Sound.rawcontrol=V;break;
case 0x11:if(psfun) psfun();MMC5Sound.raw=V;break;
case 0x0:
case 0x4://printf("%04x:$%02x\n",A,V&0x30);
if(sfun) sfun(A>>2);
MMC5Sound.env[A>>2]=V;
break;
case 0x2:
case 0x6: if(sfun) sfun(A>>2);
MMC5Sound.wl[A>>2]&=~0x00FF;
MMC5Sound.wl[A>>2]|=V&0xFF;
break;
case 0x3:
case 0x7://printf("%04x:$%02x\n",A,V>>3);
MMC5Sound.wl[A>>2]&=~0x0700;
MMC5Sound.wl[A>>2]|=(V&0x07)<<8;
MMC5Sound.running|=1<<(A>>2);
break;
case 0x15:if(sfun)
{
sfun(0);
sfun(1);
}
MMC5Sound.running&=V;
MMC5Sound.enable=V;
//printf("%02x\n",V);
break;
}
}
static void Do5SQ(int P)
{
static int tal[4]={1,2,4,6};
int32 V,amp,rthresh,wl;
int32 start,end;
start=MMC5Sound.BC[P];
end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
MMC5Sound.BC[P]=end;
wl=MMC5Sound.wl[P]+1;
amp=(MMC5Sound.env[P]&0xF)<<4;
rthresh=tal[(MMC5Sound.env[P]&0xC0)>>6];
if(wl>=8 && (MMC5Sound.running&(P+1)))
{
int dc,vc;
wl<<=18;
dc=MMC5Sound.dcount[P];
vc=MMC5Sound.vcount[P];
for(V=start;V<end;V++)
{
if(dc<rthresh)
Wave[V>>4]+=amp;
vc-=nesincsize;
while(vc<=0)
{
vc+=wl;
dc=(dc+1)&7;
}
}
MMC5Sound.dcount[P]=dc;
MMC5Sound.vcount[P]=vc;
}
}
static void Do5SQHQ(int P)
{
static int tal[4]={1,2,4,6};
uint32 V; //mbg merge 7/17/06 made uint32
int32 amp,rthresh,wl;
wl=MMC5Sound.wl[P]+1;
amp=((MMC5Sound.env[P]&0xF)<<8);
rthresh=tal[(MMC5Sound.env[P]&0xC0)>>6];
if(wl>=8 && (MMC5Sound.running&(P+1)))
{
int dc,vc;
wl<<=1;
dc=MMC5Sound.dcount[P];
vc=MMC5Sound.vcount[P];
for(V=MMC5Sound.BC[P];V<SOUNDTS;V++)
{
if(dc<rthresh)
WaveHi[V]+=amp;
vc--;
if(vc<=0) /* Less than zero when first started. */
{
vc=wl;
dc=(dc+1)&7;
}
}
MMC5Sound.dcount[P]=dc;
MMC5Sound.vcount[P]=vc;
}
MMC5Sound.BC[P]=SOUNDTS;
}
void MMC5RunSoundHQ(void)
{
Do5SQHQ(0);
Do5SQHQ(1);
Do5PCMHQ();
}
void MMC5HiSync(int32 ts)
{
int x;
for(x=0;x<3;x++) MMC5Sound.BC[x]=ts;
}
void MMC5RunSound(int Count)
{
int x;
Do5SQ(0);
Do5SQ(1);
Do5PCM();
for(x=0;x<3;x++)
MMC5Sound.BC[x]=Count;
}
void Mapper5_ESI(void)
{
GameExpSound.RChange=Mapper5_ESI;
if(FSettings.SndRate)
{
if(FSettings.soundq>=1)
{
sfun=Do5SQHQ;
psfun=Do5PCMHQ;
}
else
{
sfun=Do5SQ;
psfun=Do5PCM;
}
}
else
{
sfun=0;
psfun=0;
}
memset(MMC5Sound.BC,0,sizeof(MMC5Sound.BC));
memset(MMC5Sound.vcount,0,sizeof(MMC5Sound.vcount));
GameExpSound.HiSync=MMC5HiSync;
}
void NSFMMC5_Init(void)
{
memset(&MMC5Sound,0,sizeof(MMC5Sound));
mul[0]=mul[1]=0;
ExRAM=(uint8*)FCEU_gmalloc(1024);
Mapper5_ESI();
SetWriteHandler(0x5c00,0x5fef,MMC5_ExRAMWr);
SetReadHandler(0x5c00,0x5fef,MMC5_ExRAMRd);
MMC5HackCHRMode=2;
SetWriteHandler(0x5000,0x5015,Mapper5_SW);
SetWriteHandler(0x5205,0x5206,Mapper5_write);
SetReadHandler(0x5205,0x5206,MMC5_read);
}
void NSFMMC5_Close(void)
{
FCEU_gfree(ExRAM);
ExRAM=0;
}
static void GenMMC5Reset(void)
{
int x;
for(x=0;x<4;x++) PRGBanks[x]=~0;
for(x=0;x<8;x++) CHRBanksA[x]=~0;
for(x=0;x<4;x++) CHRBanksB[x]=~0;
WRAMMaskEnable[0]=WRAMMaskEnable[1]=~0;
mmc5psize=mmc5vsize=3;
CHRMode=0;
NTAMirroring=NTFill=ATFill=0xFF;
MMC5Synco();
SetWriteHandler(0x4020,0x5bff,Mapper5_write);
SetReadHandler(0x4020,0x5bff,MMC5_read);
SetWriteHandler(0x5c00,0x5fff,MMC5_ExRAMWr);
SetReadHandler(0x5c00,0x5fff,MMC5_ExRAMRd);
SetWriteHandler(0x6000,0xFFFF,MMC5_WriteROMRAM);
SetReadHandler(0x6000,0xFFFF,MMC5_ReadROMRAM);
SetWriteHandler(0x5000,0x5015,Mapper5_SW);
SetWriteHandler(0x5205,0x5206,Mapper5_write);
SetReadHandler(0x5205,0x5206,MMC5_read);
//GameHBIRQHook=MMC5_hb;
FCEU_CheatAddRAM(8,0x6000,WRAM);
FCEU_CheatAddRAM(1,0x5c00,ExRAM);
}
static SFORMAT MMC5_StateRegs[]={
{ PRGBanks, 4, "PRGB"},
{ CHRBanksA, 8, "CHRA"},
{ CHRBanksB, 4, "CHRB"},
{ &WRAMPage, 1, "WRMP"},
{ WRAMMaskEnable, 2, "WRME"},
{ &ABMode, 1, "ABMD"},
{ &IRQScanline, 1, "IRQS"},
{ &IRQEnable, 1, "IRQE"},
{ &CHRMode, 1, "CHRM"},
{ &NTAMirroring, 1, "NTAM"},
{ &NTFill, 1, "NTFL"},
{ &ATFill, 1, "ATFL"},
{ &MMC5Sound.wl[0], 2|FCEUSTATE_RLSB, "SDW0"},
{ &MMC5Sound.wl[1], 2|FCEUSTATE_RLSB, "SDW1"},
{ MMC5Sound.env, 2, "SDEV"},
{ &MMC5Sound.enable, 1, "SDEN"},
{ &MMC5Sound.running, 1, "SDRU"},
{ &MMC5Sound.raw, 1, "SDRW"},
{ &MMC5Sound.rawcontrol, 1, "SDRC"},
{0}
};
static void GenMMC5_Init(CartInfo *info, int wsize, int battery)
{
if(wsize)
{
WRAM=(uint8*)FCEU_gmalloc(wsize*1024);
SetupCartPRGMapping(0x10,WRAM,wsize*1024,1);
AddExState(WRAM, wsize*1024, 0, "WRAM");
}
MMC5fill=(uint8*)FCEU_gmalloc(1024);
ExRAM=(uint8*)FCEU_gmalloc(1024);
AddExState(MMC5_StateRegs, ~0, 0, 0);
AddExState(WRAM, wsize*1024, 0, "WRAM");
AddExState(ExRAM, 1024, 0, "ERAM");
AddExState(&MMC5HackSPMode, 1, 0, "SPLM");
AddExState(&MMC5HackSPScroll, 1, 0, "SPLS");
AddExState(&MMC5HackSPPage, 1, 0, "SPLP");
MMC5WRAMsize=wsize/8;
BuildWRAMSizeTable();
GameStateRestore=MMC5_StateRestore;
info->Power=GenMMC5Reset;
if(battery)
{
info->SaveGame[0]=WRAM;
if(wsize<=16)
info->SaveGameLen[0]=8192;
else
info->SaveGameLen[0]=32768;
}
MMC5HackVROMMask=CHRmask4[0];
MMC5HackExNTARAMPtr=ExRAM;
MMC5Hack=1;
MMC5HackVROMPTR=CHRptr[0];
MMC5HackCHRMode=0;
MMC5HackSPMode=MMC5HackSPScroll=MMC5HackSPPage=0;
Mapper5_ESI();
}
void Mapper5_Init(CartInfo *info)
{
GenMMC5_Init(info, DetectMMC5WRAMSize(info->CRC32), info->battery);
}
// ELROM seems to have 0KB of WRAM
// EKROM seems to have 8KB of WRAM
// ETROM seems to have 16KB of WRAM
// EWROM seems to have 32KB of WRAM
// ETROM and EWROM are battery-backed, EKROM isn't.
void ETROM_Init(CartInfo *info)
{
GenMMC5_Init(info, 16,info->battery);
}
void ELROM_Init(CartInfo *info)
{
GenMMC5_Init(info,0,0);
}
void EWROM_Init(CartInfo *info)
{
GenMMC5_Init(info,32,info->battery);
}
void EKROM_Init(CartInfo *info)
{
GenMMC5_Init(info,8,info->battery);
}

108
boards/n-c22m.c Normal file
View File

@ -0,0 +1,108 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2006 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
//mbg merge 7/17/06 - TODO CaH4e3 / does it make sense to #include mmc3.h here? it uses some vars from it..
//also, CaH4e3, discuss with me whether this implies that 0xA000 and 0xE000 can have their own 8k banks (
#include "mmc3.h"
//mbg merge 7/17/06 we get these externs from mmc3.h
//uint8 IRQCount,IRQLatch,IRQa;
//uint8 IRQReload;
static uint8 reg[8];
static SFORMAT StateRegs[]=
{
{reg, 8, "REGS"},
{0}
};
static void Sync(void)
{
// FCEU_printf("(%02x, %02x)\n",reg[3],reg[4]);
setprg8(0x8000,reg[0]);
setprg8(0xA000,reg[1]);
setprg8(0xC000,reg[2]);
setprg8(0xE000,~0);
// setchr2(0x0000,reg[3]);
// setchr2(0x0800,reg[4]);
// setchr2(0x1000,reg[5]);
// setchr2(0x1800,reg[6]);
setchr2(0x0000,reg[3]);
setchr2(0x0800,reg[4]);
setchr2(0x1000,reg[5]);
setchr2(0x1800,reg[6]);
}
static DECLFW(MCN22MWrite)
{
FCEU_printf("bs %04x %02x\n",A,V);
switch(A)
{
case 0x8c00:
case 0x8c01:
case 0x8c02: reg[A&3]=V; break;
case 0x8d10: reg[3]=V; break;
case 0x8d11: reg[4]=V; break;
case 0x8d16: reg[5]=V; break;
case 0x8d17: reg[6]=V; break;
}
Sync();
}
static void MCN22MPower(void)
{
Sync();
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,MCN22MWrite);
}
/*
static void MCN22MIRQHook(void)
{
int count = IRQCount;
if(!count || IRQReload)
{
IRQCount = IRQLatch;
IRQReload = 0;
}
else
IRQCount--;
if(!IRQCount)
{
if(IRQa)
{
X6502_IRQBegin(FCEU_IQEXT);
}
}
}
*/
static void StateRestore(int version)
{
Sync();
}
void UNLCN22M_Init(CartInfo *info)
{
info->Power=MCN22MPower;
// GameHBIRQHook=MCN22MIRQHook;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

470
boards/n106.c Normal file
View File

@ -0,0 +1,470 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint16 IRQCount;
static uint8 IRQa;
static uint8 WRAM[8192];
static uint8 IRAM[128];
static DECLFR(AWRAM)
{
return(WRAM[A-0x6000]);
}
static DECLFW(BWRAM)
{
WRAM[A-0x6000]=V;
}
void Mapper19_ESI(void);
static uint8 NTAPage[4];
static uint8 dopol;
static uint8 gorfus;
static uint8 gorko;
static void NamcoSound(int Count);
static void NamcoSoundHack(void);
static void DoNamcoSound(int32 *Wave, int Count);
static void DoNamcoSoundHQ(void);
static void SyncHQ(int32 ts);
static int is210; /* Lesser mapper. */
static uint8 PRG[3];
static uint8 CHR[8];
static SFORMAT N106_StateRegs[]={
{PRG,3,"PRG"},
{CHR,8,"CHR"},
{NTAPage,4,"NTA"},
{0}
};
static void SyncPRG(void)
{
setprg8(0x8000,PRG[0]);
setprg8(0xa000,PRG[1]);
setprg8(0xc000,PRG[2]);
setprg8(0xe000,0x3F);
}
static void FP_FASTAPASS(1) NamcoIRQHook(int a)
{
if(IRQa)
{
IRQCount+=a;
if(IRQCount>=0x7FFF)
{
X6502_IRQBegin(FCEU_IQEXT);
IRQa=0;
IRQCount=0x7FFF; //7FFF;
}
}
}
static DECLFR(Namco_Read4800)
{
uint8 ret=IRAM[dopol&0x7f];
/* Maybe I should call NamcoSoundHack() here? */
if(!fceuindbg)
if(dopol&0x80)
dopol=(dopol&0x80)|((dopol+1)&0x7f);
return ret;
}
static DECLFR(Namco_Read5000)
{
return(IRQCount);
}
static DECLFR(Namco_Read5800)
{
return(IRQCount>>8);
}
static void FASTAPASS(2) DoNTARAMROM(int w, uint8 V)
{
NTAPage[w]=V;
if(V>=0xE0)
setntamem(NTARAM+((V&1)<<10), 1, w);
else
{
V&=CHRmask1[0];
setntamem(CHRptr[0]+(V<<10), 0, w);
}
}
static void FixNTAR(void)
{
int x;
for(x=0;x<4;x++)
DoNTARAMROM(x,NTAPage[x]);
}
static void FASTAPASS(2) DoCHRRAMROM(int x, uint8 V)
{
CHR[x]=V;
if(!is210 && !((gorfus>>((x>>2)+6))&1) && (V>=0xE0))
{
// printf("BLAHAHA: %d, %02x\n",x,V);
//setchr1r(0x10,x<<10,V&7);
}
else
setchr1(x<<10,V);
}
static void FixCRR(void)
{
int x;
for(x=0;x<8;x++)
DoCHRRAMROM(x,CHR[x]);
}
static DECLFW(Mapper19C0D8_write)
{
DoNTARAMROM((A-0xC000)>>11,V);
}
static uint32 FreqCache[8];
static uint32 EnvCache[8];
static uint32 LengthCache[8];
static void FixCache(int a,int V)
{
int w=(a>>3)&0x7;
switch(a&0x07)
{
case 0x00:FreqCache[w]&=~0x000000FF;FreqCache[w]|=V;break;
case 0x02:FreqCache[w]&=~0x0000FF00;FreqCache[w]|=V<<8;break;
case 0x04:FreqCache[w]&=~0x00030000;FreqCache[w]|=(V&3)<<16;
LengthCache[w]=(8-((V>>2)&7))<<2;
break;
case 0x07:EnvCache[w]=(double)(V&0xF)*576716;break;
}
}
static DECLFW(Mapper19_write)
{
A&=0xF800;
if(A>=0x8000 && A<=0xb800)
DoCHRRAMROM((A-0x8000)>>11,V);
else switch(A)
{
case 0x4800:
if(dopol&0x40)
{
if(FSettings.SndRate)
{
NamcoSoundHack();
GameExpSound.Fill=NamcoSound;
GameExpSound.HiFill=DoNamcoSoundHQ;
GameExpSound.HiSync=SyncHQ;
}
FixCache(dopol,V);
}
IRAM[dopol&0x7f]=V;
if(dopol&0x80)
dopol=(dopol&0x80)|((dopol+1)&0x7f);
break;
case 0xf800:
dopol=V;break;
case 0x5000:
IRQCount&=0xFF00;IRQCount|=V;X6502_IRQEnd(FCEU_IQEXT);break;
case 0x5800:
IRQCount&=0x00ff;IRQCount|=(V&0x7F)<<8;
IRQa=V&0x80;
X6502_IRQEnd(FCEU_IQEXT);
break;
case 0xE000:
gorko=V&0xC0;
PRG[0]=V&0x3F;
SyncPRG();
break;
case 0xE800:
gorfus=V&0xC0;
FixCRR();
PRG[1]=V&0x3F;
SyncPRG();
break;
case 0xF000:
PRG[2]=V&0x3F;
SyncPRG();
break;
}
}
static int dwave=0;
static void NamcoSoundHack(void)
{
int32 z,a;
if(FSettings.soundq>=1)
{
DoNamcoSoundHQ();
return;
}
z=((SOUNDTS<<16)/soundtsinc)>>4;
a=z-dwave;
if(a) DoNamcoSound(&Wave[dwave], a);
dwave+=a;
}
static void NamcoSound(int Count)
{
int32 z,a;
z=((SOUNDTS<<16)/soundtsinc)>>4;
a=z-dwave;
if(a) DoNamcoSound(&Wave[dwave], a);
dwave=0;
}
static uint32 PlayIndex[8];
static int32 vcount[8];
static int32 CVBC;
#define TOINDEX (16+1)
// 16:15
static void SyncHQ(int32 ts)
{
CVBC=ts;
}
/* Things to do:
1 Read freq low
2 Read freq mid
3 Read freq high
4 Read envelope
...?
*/
static INLINE uint32 FetchDuff(uint32 P, uint32 envelope)
{
uint32 duff;
duff=IRAM[((IRAM[0x46+(P<<3)]+(PlayIndex[P]>>TOINDEX))&0xFF)>>1];
if((IRAM[0x46+(P<<3)]+(PlayIndex[P]>>TOINDEX))&1)
duff>>=4;
duff&=0xF;
duff=(duff*envelope)>>16;
return(duff);
}
static void DoNamcoSoundHQ(void)
{
uint32 V; //mbg merge 7/17/06 made uint32
int32 P;
int32 cyclesuck=(((IRAM[0x7F]>>4)&7)+1)*15;
for(P=7;P>=(7-((IRAM[0x7F]>>4)&7));P--)
{
if((IRAM[0x44+(P<<3)]&0xE0) && (IRAM[0x47+(P<<3)]&0xF))
{
uint32 freq;
int32 vco;
uint32 duff2,lengo,envelope;
vco=vcount[P];
freq=FreqCache[P];
envelope=EnvCache[P];
lengo=LengthCache[P];
duff2=FetchDuff(P,envelope);
for(V=CVBC<<1;V<SOUNDTS<<1;V++)
{
WaveHi[V>>1]+=duff2;
if(!vco)
{
PlayIndex[P]+=freq;
while((PlayIndex[P]>>TOINDEX)>=lengo) PlayIndex[P]-=lengo<<TOINDEX;
duff2=FetchDuff(P,envelope);
vco=cyclesuck;
}
vco--;
}
vcount[P]=vco;
}
}
CVBC=SOUNDTS;
}
static void DoNamcoSound(int32 *Wave, int Count)
{
int P,V;
for(P=7;P>=7-((IRAM[0x7F]>>4)&7);P--)
{
if((IRAM[0x44+(P<<3)]&0xE0) && (IRAM[0x47+(P<<3)]&0xF))
{
int32 inc;
uint32 freq;
int32 vco;
uint32 duff,duff2,lengo,envelope;
vco=vcount[P];
freq=FreqCache[P];
envelope=EnvCache[P];
lengo=LengthCache[P];
if(!freq) {/*printf("Ack");*/ continue;}
{
int c=((IRAM[0x7F]>>4)&7)+1;
inc=(long double)(FSettings.SndRate<<15)/((long double)freq*21477272/((long double)0x400000*c*45));
}
duff=IRAM[(((IRAM[0x46+(P<<3)]+PlayIndex[P])&0xFF)>>1)];
if((IRAM[0x46+(P<<3)]+PlayIndex[P])&1)
duff>>=4;
duff&=0xF;
duff2=(duff*envelope)>>19;
for(V=0;V<Count*16;V++)
{
if(vco>=inc)
{
PlayIndex[P]++;
if(PlayIndex[P]>=lengo)
PlayIndex[P]=0;
vco-=inc;
duff=IRAM[(((IRAM[0x46+(P<<3)]+PlayIndex[P])&0xFF)>>1)];
if((IRAM[0x46+(P<<3)]+PlayIndex[P])&1)
duff>>=4;
duff&=0xF;
duff2=(duff*envelope)>>19;
}
Wave[V>>4]+=duff2;
vco+=0x8000;
}
vcount[P]=vco;
}
}
}
static void Mapper19_StateRestore(int version)
{
int x;
SyncPRG();
FixNTAR();
FixCRR();
for(x=0x40;x<0x80;x++)
FixCache(x,IRAM[x]);
}
static void M19SC(void)
{
if(FSettings.SndRate)
Mapper19_ESI();
}
void Mapper19_ESI(void)
{
GameExpSound.RChange=M19SC;
memset(vcount,0,sizeof(vcount));
memset(PlayIndex,0,sizeof(PlayIndex));
CVBC=0;
}
void NSFN106_Init(void)
{
SetWriteHandler(0xf800,0xffff,Mapper19_write);
SetWriteHandler(0x4800,0x4fff,Mapper19_write);
SetReadHandler(0x4800,0x4fff,Namco_Read4800);
Mapper19_ESI();
}
static int battery=0;
static void N106_Power(void)
{
int x;
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xffff,Mapper19_write);
SetWriteHandler(0x4020,0x5fff,Mapper19_write);
if(!is210)
{
SetWriteHandler(0xc000,0xdfff,Mapper19C0D8_write);
SetReadHandler(0x4800,0x4fff,Namco_Read4800);
SetReadHandler(0x5000,0x57ff,Namco_Read5000);
SetReadHandler(0x5800,0x5fff,Namco_Read5800);
NTAPage[0]=NTAPage[1]=NTAPage[2]=NTAPage[3]=0xFF;
FixNTAR();
}
SetReadHandler(0x6000,0x7FFF,AWRAM);
SetWriteHandler(0x6000,0x7FFF,BWRAM);
FCEU_CheatAddRAM(8,0x6000,WRAM);
gorfus=0xFF;
SyncPRG();
FixCRR();
if(!battery)
{
FCEU_dwmemset(WRAM,0,8192);
FCEU_dwmemset(IRAM,0,128);
}
for(x=0x40;x<0x80;x++)
FixCache(x,IRAM[x]);
}
void Mapper19_Init(CartInfo *info)
{
is210=0;
battery=info->battery;
info->Power=N106_Power;
MapIRQHook=NamcoIRQHook;
GameStateRestore=Mapper19_StateRestore;
GameExpSound.RChange=M19SC;
if(FSettings.SndRate)
Mapper19_ESI();
AddExState(WRAM, 8192, 0, "WRAM");
AddExState(IRAM, 128, 0, "WRAM");
AddExState(N106_StateRegs, ~0, 0, 0);
if(info->battery)
{
info->SaveGame[0]=WRAM;
info->SaveGameLen[0]=8192;
info->SaveGame[1]=IRAM;
info->SaveGameLen[1]=128;
}
}
static void Mapper210_StateRestore(int version)
{
SyncPRG();
FixCRR();
}
void Mapper210_Init(CartInfo *info)
{
is210=1;
GameStateRestore=Mapper210_StateRestore;
info->Power=N106_Power;
AddExState(WRAM, 8192, 0, "WRAM");
}

55
boards/novel.c Normal file
View File

@ -0,0 +1,55 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 latch;
static void DoNovel(void)
{
setprg32(0x8000,latch&3);
setchr8(latch&7);
}
static DECLFW(NovelWrite)
{
latch=A&0xFF;
DoNovel();
}
static void NovelReset(void)
{
SetWriteHandler(0x8000,0xFFFF,NovelWrite);
SetReadHandler(0x8000,0xFFFF,CartBR);
setprg32(0x8000,0);
setchr8(0);
}
static void NovelRestore(int version)
{
DoNovel();
}
void Novel_Init(CartInfo *info)
{
AddExState(&latch, 1, 0,"L1");
info->Power=NovelReset;
GameStateRestore=NovelRestore;
}

399
boards/sachen.c Normal file
View File

@ -0,0 +1,399 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 cmd;
static uint8 latch[8];
static void S74LS374MSync(uint8 mirr)
{
switch(mirr&3)
{
case 0:setmirror(MI_V);break;
case 1:setmirror(MI_H);break;
case 2:setmirrorw(0,1,1,1);break;
case 3:setmirror(MI_0);break;
}
}
static void S74LS374NSynco(void)
{
setprg32(0x8000,latch[0]);
setchr8(latch[1]|latch[3]|latch[4]);
S74LS374MSync(latch[2]);
}
static DECLFW(S74LS374NWrite)
{
A&=0x4101;
if(A==0x4100)
cmd=V&7;
else
{
switch(cmd)
{
case 2:latch[0]=V&1; latch[3]=(V&1)<<3;break;
case 4:latch[4]=(V&1)<<2;break;
case 5:latch[0]=V&7;break;
case 6:latch[1]=V&3;break;
case 7:latch[2]=V>>1;break;
}
S74LS374NSynco();
}
}
static DECLFR(S74LS374NRead)
{
uint8 ret;
if((A&0x4100)==0x4100)
// ret=(X.DB&0xC0)|((~cmd)&0x3F);
ret=~cmd&0x3F;
else
ret=X.DB;
return ret;
}
static void S74LS374NPower(void)
{
latch[0]=latch[1]=latch[2]=latch[3]=latch[4]=0;
S74LS374NSynco();
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x4100,0x7FFF,S74LS374NWrite);
SetReadHandler(0x4100,0x5fff,S74LS374NRead);
}
static void S74LS374NRestore(int version)
{
S74LS374NSynco();
}
void S74LS374N_Init(CartInfo *info)
{
info->Power=S74LS374NPower;
GameStateRestore=S74LS374NRestore;
AddExState(latch, 5, 0, "LATC");
AddExState(&cmd, 1, 0, "CMD");
}
static void S74LS374NASynco(void)
{
setprg32(0x8000,latch[0]);
setchr8(latch[1]);
S74LS374MSync(latch[2]);
}
static DECLFW(S74LS374NAWrite)
{
A&=0x4101;
if(A==0x4100)
cmd=V&7;
else
{
switch(cmd)
{
case 0:latch[0]=0;latch[1]=3;break;
case 2:latch[3]=(V&1)<<3;break;
case 4:latch[1]=(latch[1]&6)|(V&3);break;
case 5:latch[0]=V&1;break;
case 6:latch[1]=(latch[1]&1)|latch[3]|((V&3)<<1);break;
case 7:latch[2]=V&1;break;
}
S74LS374NASynco();
}
}
static void S74LS374NAPower(void)
{
latch[0]=latch[2]=latch[3]=latch[4]=0;
latch[1]=3;
S74LS374NASynco();
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x4100,0x7FFF,S74LS374NAWrite);
}
void S74LS374NA_Init(CartInfo *info)
{
info->Power=S74LS374NAPower;
GameStateRestore=S74LS374NRestore;
AddExState(latch, 5, 0, "LATC");
AddExState(&cmd, 1, 0, "CMD");
}
static int type;
static void S8259Synco(void)
{
int x;
setprg32(0x8000,latch[5]&7);
if(!UNIFchrrama) // No CHR RAM? Then BS'ing is ok.
{
for(x=0;x<4;x++)
{
int bank;
if(latch[7]&1)
bank=(latch[0]&0x7)|((latch[4]&7)<<3);
else
bank=(latch[x]&0x7)|((latch[4]&7)<<3);
switch (type)
{
case 00: bank=(bank<<1)|(x&1); setchr2(0x800*x,bank); break;
case 01: setchr2(0x800*x,bank); break;
case 02: bank=(bank<<2)|(x&3); setchr2(0x800*x,bank); break;
case 03: bank=latch[x]&7;
switch (x&3)
{
case 01: bank|=(latch[4]&1)<<4;break;
case 02: bank|=(latch[4]&2)<<3;break;
case 03: bank|=((latch[4]&4)<<2)|((latch[6]&1)<<3);break;
}
setchr1(0x400*x,bank);
setchr4(0x1000,~0);
break;
}
}
}
if(!(latch[7]&1))
S74LS374MSync(latch[7]>>1);
else
setmirror(MI_V);
}
static DECLFW(S8259Write)
{
A&=0x4101;
if(A==0x4100)
cmd=V;
else
{
latch[cmd&7]=V;
S8259Synco();
}
}
static void S8259Reset(void)
{
int x;
cmd=0;
for(x=0;x<8;x++) latch[x]=0;
setchr8(0);
S8259Synco();
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x4100,0x7FFF,S8259Write);
}
static void S8259Restore(int version)
{
S8259Synco();
}
void S8259A_Init(CartInfo *info) // Kevin's Horton 141 mapper
{
info->Power=S8259Reset;
GameStateRestore=S8259Restore;
AddExState(latch, 8, 0, "LATC");
AddExState(&cmd, 1, 0, "CMD");
type=0;
}
void S8259B_Init(CartInfo *info) // Kevin's Horton 138 mapper
{
info->Power=S8259Reset;
GameStateRestore=S8259Restore;
AddExState(latch, 8, 0, "LATC");
AddExState(&cmd, 1, 0, "CMD");
type=1;
}
void S8259C_Init(CartInfo *info) // Kevin's Horton 139 mapper
{
info->Power=S8259Reset;
GameStateRestore=S8259Restore;
AddExState(latch, 8, 0, "LATC");
AddExState(&cmd, 1, 0, "CMD");
type=2;
}
void S8259D_Init(CartInfo *info) // Kevin's Horton 137 mapper
{
info->Power=S8259Reset;
GameStateRestore=S8259Restore;
AddExState(latch, 8, 0, "LATC");
AddExState(&cmd, 1, 0, "CMD");
type=3;
}
static void(*WSync)(void);
static DECLFW(SAWrite)
{
if(A&0x100)
{
latch[0]=V;
WSync();
}
}
static void SAPower(void)
{
latch[0]=0;
WSync();
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x4100,0x5FFF,SAWrite);
}
static void SARestore(int version)
{
WSync();
}
static DECLFW(SADWrite)
{
latch[0]=V;
WSync();
}
static void SADPower(void)
{
latch[0]=0;
WSync();
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,SADWrite);
}
static void SA0161MSynco()
{
setprg32(0x8000,(latch[0]>>3)&1);
setchr8(latch[0]&7);
}
static void SA72007Synco()
{
setprg32(0x8000,0);
setchr8(latch[0]>>7);
}
static void SA72008Synco()
{
setprg32(0x8000,(latch[0]>>2)&1);
setchr8(latch[0]&3);
}
void SA0161M_Init(CartInfo *info)
{
WSync=SA0161MSynco;
GameStateRestore=SARestore;
info->Power=SAPower;
AddExState(&latch[0], 1, 0, "LATC");
}
void SA72007_Init(CartInfo *info)
{
WSync=SA72007Synco;
GameStateRestore=SARestore;
info->Power=SAPower;
AddExState(&latch[0], 1, 0, "LATC");
}
void SA72008_Init(CartInfo *info)
{
WSync=SA72008Synco;
GameStateRestore=SARestore;
info->Power=SAPower;
AddExState(&latch[0], 1, 0, "LATC");
}
void SA0036_Init(CartInfo *info)
{
WSync=SA72007Synco;
GameStateRestore=SARestore;
info->Power=SADPower;
AddExState(&latch[0], 1, 0, "LATC");
}
void SA0037_Init(CartInfo *info)
{
WSync=SA0161MSynco;
GameStateRestore=SARestore;
info->Power=SADPower;
AddExState(&latch[0], 1, 0, "LATC");
}
static void TCU01Synco()
{
setprg32(0x8000,(latch[0]>>2)&1);
setchr8((latch[0]>>3)&0xF);
}
static DECLFW(TCWrite)
{
if((A&0x103)==0x102)
{
latch[0]=V;
TCU01Synco();
}
}
static void TCU01Reset(void)
{
latch[0]=0;
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x4100,0xFFFF,TCWrite);
TCU01Synco();
}
static void TCU01Restore(int version)
{
TCU01Synco();
}
void TCU01_Init(CartInfo *info)
{
GameStateRestore=TCU01Restore;
info->Power=TCU01Reset;
AddExState(&latch[0], 1, 0, "LATC");
}
static DECLFR(TCA01Read)
{
uint8 ret;
if((A&0x4100)==0x4100)
ret=(X.DB&0xC0)|((~A)&0x3F);
else
ret=X.DB;
return ret;
}
static void TCA01Reset(void)
{
setprg16(0x8000,0);
setprg16(0xC000,1);
setchr8(0);
SetReadHandler(0x8000,0xFFFF,CartBR);
SetReadHandler(0x4100,0x5FFF,TCA01Read);
}
void TCA01_Init(CartInfo *info)
{
info->Power=TCA01Reset;
}

87
boards/sheroes.c Normal file
View File

@ -0,0 +1,87 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2006 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
#include "mmc3.h"
static uint8 *CHRRAM;
static uint8 tekker;
static void MSHCW(uint32 A, uint8 V)
{
if(EXPREGS[0]&0x40)
setchr8r(0x10,0);
else
{
if(A<0x800)
setchr1(A,V|((EXPREGS[0]&8)<<5));
else if(A<0x1000)
setchr1(A,V|((EXPREGS[0]&4)<<6));
else if(A<0x1800)
setchr1(A,V|((EXPREGS[0]&1)<<8));
else
setchr1(A,V|((EXPREGS[0]&2)<<7));
}
}
static DECLFW(MSHWrite)
{
EXPREGS[0]=V;
FixMMC3CHR(MMC3_cmd);
}
static DECLFR(MSHRead)
{
return(tekker);
}
static void MSHReset(void)
{
MMC3RegReset();
tekker^=0xFF;
}
static void MSHPower(void)
{
tekker=0x00;
GenMMC3Power();
SetWriteHandler(0x4100,0x4100,MSHWrite);
SetReadHandler(0x4100,0x4100,MSHRead);
}
static void MSHClose(void)
{
if(CHRRAM)
FCEU_gfree(CHRRAM);
CHRRAM=NULL;
}
void UNLSHeroes_Init(CartInfo *info)
{
GenMMC3_Init(info, 256, 512, 0, 0);
cwrap=MSHCW;
info->Power=MSHPower;
info->Reset=MSHReset;
info->Close=MSHClose;
CHRRAM = (uint8*)FCEU_gmalloc(8192);
SetupCartCHRMapping(0x10, CHRRAM, 8192, 1);
AddExState(EXPREGS, 4, 0, "EXPR");
AddExState(&tekker, 1, 0, "DIPSW");
}

112
boards/sl1632.c Normal file
View File

@ -0,0 +1,112 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
#include "mmc3.h"
static uint8 chrcmd[8], prg0, prg1, brk, mirr;
static SFORMAT StateRegs[]=
{
{chrcmd, 8, "CHRCMD"},
{&prg0, 1, "PRG0"},
{&prg1, 1, "PRG1"},
{&brk, 1, "BRK"},
{&mirr, 1, "MIRR"},
{0}
};
static void Sync(void)
{
int i;
setprg8(0x8000,prg0);
setprg8(0xA000,prg1);
setprg8(0xC000,~1);
setprg8(0xE000,~0);
for(i=0; i<8; i++)
setchr1(i<<10,chrcmd[i]);
setmirror(mirr^1);
}
static void UNLSL1632CW(uint32 A, uint8 V)
{
setchr1(A,V);
}
static DECLFW(UNLSL1632CMDWrite)
{
// FCEU_printf("bs %04x %02x %3d\n",A,V,scanline);
if((A&0xA131)==0xA131)
{
brk=V;
}
if(brk&2)
{
FixMMC3PRG(MMC3_cmd);
FixMMC3CHR(MMC3_cmd);
if(A<0xC000)
MMC3_CMDWrite(A,V);
else
MMC3_IRQWrite(A,V);
}
else
{
if((A>=0xB000)&&(A<=0xE003))
{
int ind=((((A&2)|(A>>10))>>1)+2)&7;
int sar=((A&1)<<2);
chrcmd[ind]=(chrcmd[ind]&(0xF0>>sar))|((V&0x0F)<<sar);
}
else
switch(A&0xF003)
{
case 0x8000: prg0=V; break;
case 0xA000: prg1=V; break;
case 0x9000: mirr=V&1; break;
}
Sync();
}
}
static void StateRestore(int version)
{
if(brk&2)
{
FixMMC3PRG(MMC3_cmd);
FixMMC3CHR(MMC3_cmd);
}
else
Sync();
}
static void UNLSL1632Power(void)
{
GenMMC3Power();
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,UNLSL1632CMDWrite);
}
void UNLSL1632_Init(CartInfo *info)
{
GenMMC3_Init(info, 256, 256, 0, 0);
cwrap=UNLSL1632CW;
info->Power=UNLSL1632Power;
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

79
boards/subor.c Normal file
View File

@ -0,0 +1,79 @@
#include "mapinc.h"
static uint8 mode;
static uint8 DRegs[4];
static SFORMAT StateRegs[]=
{
{DRegs, 4, "DREG"},
{0}
};
static void Sync(void)
{
int base, bank;
base = ((DRegs[0]^DRegs[1])&0x10)<<1;
bank = (DRegs[2]^DRegs[3])&0x1f;
if(DRegs[1]&0x08)
{
bank &= 0xfe;
if(mode==0)
{
setprg16(0x8000,base+bank+1);
setprg16(0xC000,base+bank+0);
}
else
{
setprg16(0x8000,base+bank+0);
setprg16(0xC000,base+bank+1);
}
}
else
{
if(DRegs[1]&0x04)
{
setprg16(0x8000,0x1f);
setprg16(0xC000,base+bank);
}
else
{
setprg16(0x8000,base+bank);
if(mode==0)
setprg16(0xC000,0x20);
else
setprg16(0xC000,0x07);
}
}
}
static DECLFW(Mapper167_write)
{
DRegs[(A>>13)&0x03]=V;
Sync();
}
static void StateRestore(int version)
{
Sync();
}
void Mapper166_init(void)
{
mode=1;
DRegs[0]=DRegs[1]=DRegs[2]=DRegs[3]=0;
Sync();
SetWriteHandler(0x8000,0xFFFF,Mapper167_write);
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}
void Mapper167_init(void)
{
mode=0;
DRegs[0]=DRegs[1]=DRegs[2]=DRegs[3]=0;
Sync();
SetWriteHandler(0x8000,0xFFFF,Mapper167_write);
GameStateRestore=StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

99
boards/super24.c Normal file
View File

@ -0,0 +1,99 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2005 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
#include "mmc3.h"
static uint8 *CHRRAM = NULL;
static int masko8[8]={63,31,15,1,3,0,0,0};
static void Super24PW(uint32 A, uint8 V)
{
uint32 NV=V&masko8[EXPREGS[0]&7];
NV|=(EXPREGS[1]<<1);
setprg8r((NV>>6)&0xF,A,NV);
}
static void Super24CW(uint32 A, uint8 V)
{
if(EXPREGS[0]&0x20)
setchr1r(0x10,A,V);
else
{
uint32 NV=V|(EXPREGS[2]<<3);
setchr1r((NV>>9)&0xF,A,NV);
}
}
static DECLFW(Super24Write)
{
switch(A)
{
case 0x5FF0: EXPREGS[0]=V;
FixMMC3PRG(MMC3_cmd);
FixMMC3CHR(MMC3_cmd);
break;
case 0x5FF1: EXPREGS[1]=V;
FixMMC3PRG(MMC3_cmd);
break;
case 0x5FF2: EXPREGS[2]=V;
FixMMC3CHR(MMC3_cmd);
break;
}
}
static void Super24Power(void)
{
EXPREGS[0]=0x24;
EXPREGS[1]=159;
EXPREGS[2]=0;
GenMMC3Power();
SetWriteHandler(0x5000,0x7FFF,Super24Write);
SetReadHandler(0x8000,0xFFFF,CartBR);
}
static void Super24Reset(void)
{
EXPREGS[0]=0x24;
EXPREGS[1]=159;
EXPREGS[2]=0;
MMC3RegReset();
}
static void Super24Close(void)
{
if(CHRRAM)
FCEU_gfree(CHRRAM);
CHRRAM = NULL;
}
void Super24_Init(CartInfo *info)
{
GenMMC3_Init(info, 128, 256, 0, 0);
info->Power=Super24Power;
info->Reset=Super24Reset;
info->Close=Super24Close;
cwrap=Super24CW;
pwrap=Super24PW;
CHRRAM=(uint8*)FCEU_gmalloc(8192);
SetupCartCHRMapping(0x10, CHRRAM, 8192, 1);
AddExState(CHRRAM, 8192, 0, "CHRR");
AddExState(EXPREGS, 3, 0, "BIG2");
}

74
boards/supervision.c Normal file
View File

@ -0,0 +1,74 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 cmd0, cmd1;
static void DoSuper(void)
{
setprg8r((cmd0&0xC)>>2,0x6000,((cmd0&0x3)<<4)|0xF);
if(cmd0&0x10)
{
setprg16r((cmd0&0xC)>>2,0x8000,((cmd0&0x3)<<3)|(cmd1&7));
setprg16r((cmd0&0xC)>>2,0xc000,((cmd0&0x3)<<3)|7);
}
else
setprg32r(4,0x8000,0);
setmirror(((cmd0&0x20)>>5)^1);
}
static DECLFW(SuperWrite)
{
if(!(cmd0&0x10))
{
cmd0=V;
DoSuper();
}
}
static DECLFW(SuperHi)
{
cmd1=V;
DoSuper();
}
static void SuperReset(void)
{
SetWriteHandler(0x6000,0x7FFF,SuperWrite);
SetWriteHandler(0x8000,0xFFFF,SuperHi);
SetReadHandler(0x6000,0xFFFF,CartBR);
cmd0=cmd1=0;
setprg32r(4,0x8000,0);
setchr8(0);
}
static void SuperRestore(int version)
{
DoSuper();
}
void Supervision16_Init(CartInfo *info)
{
AddExState(&cmd0, 1, 0,"L1");
AddExState(&cmd1, 1, 0,"L2");
info->Power=SuperReset;
GameStateRestore=SuperRestore;
}

84
boards/t-262.c Normal file
View File

@ -0,0 +1,84 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2006 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint16 addrreg;
static uint8 datareg;
static uint8 busy;
static SFORMAT StateRegs[]=
{
{&addrreg, 2, "ADDRREG"},
{&datareg, 1, "DATAREG"},
{&busy, 1, "BUSY"},
{0}
};
static void Sync(void)
{
uint16 base=((addrreg&0x60)>>2)|((addrreg&0x100)>>3);
setprg16(0x8000,(datareg&7)|base);
setprg16(0xC000,7|base);
setmirror(((addrreg&2)>>1)^1);
}
static DECLFW(BMCT262Write)
{
if(busy||(A==0x8000))
datareg=V;
else
{
addrreg=A;
busy=1;
}
Sync();
}
static void BMCT262Power(void)
{
setchr8(0);
SetWriteHandler(0x8000,0xFFFF,BMCT262Write);
SetReadHandler(0x8000,0xFFFF,CartBR);
busy=0;
addrreg=0;
datareg=0xff;
Sync();
}
static void BMCT262Reset(void)
{
busy=0;
addrreg=0;
datareg=0;
Sync();
}
static void BMCT262Restore(int version)
{
Sync();
}
void BMCT262_Init(CartInfo *info)
{
info->Power=BMCT262Power;
info->Reset=BMCT262Reset;
GameStateRestore=BMCT262Restore;
AddExState(&StateRegs, ~0, 0, 0);
}

199
boards/tengen.c Normal file
View File

@ -0,0 +1,199 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static uint8 cmd,mir,rmode,IRQmode;
static uint8 DRegs[11];
static uint8 IRQCount,IRQa,IRQLatch;
static SFORMAT Rambo_StateRegs[]={
{&cmd, 1, "CMD"},
{&mir, 1, "MIR"},
{&rmode, 1, "RMOD"},
{&IRQmode, 1, "IRQM"},
{&IRQCount, 1, "IRQC"},
{&IRQa, 1, "IRQA"},
{&IRQLatch, 1, "IRQL"},
{DRegs, 11, "DREG"},
{0}
};
static void FP_FASTAPASS(2) (*setchr1wrap)(unsigned int A, unsigned int V);
//static int nomirror;
static void FP_FASTAPASS(1) RAMBO1_IRQHook(int a)
{
static int smallcount;
if(!IRQmode) return;
smallcount+=a;
while(smallcount>=4)
{
smallcount-=4;
IRQCount--;
if(IRQCount==0xFF)
if(IRQa) X6502_IRQBegin(FCEU_IQEXT);
}
}
static void RAMBO1_hb(void)
{
if(IRQmode) return;
if(scanline==240) return; /* hmm. Maybe that should be an mmc3-only call in fce.c. */
rmode=0;
IRQCount--;
if(IRQCount==0xFF)
{
if(IRQa)
{
rmode = 1;
X6502_IRQBegin(FCEU_IQEXT);
}
}
}
static void Synco(void)
{
int x;
if(cmd&0x20)
{
setchr1wrap(0x0000,DRegs[0]);
setchr1wrap(0x0800,DRegs[1]);
setchr1wrap(0x0400,DRegs[8]);
setchr1wrap(0x0c00,DRegs[9]);
}
else
{
setchr1wrap(0x0000,(DRegs[0]&0xFE));
setchr1wrap(0x0400,(DRegs[0]&0xFE)|1);
setchr1wrap(0x0800,(DRegs[1]&0xFE));
setchr1wrap(0x0C00,(DRegs[1]&0xFE)|1);
}
for(x=0;x<4;x++)
setchr1wrap(0x1000+x*0x400,DRegs[2+x]);
setprg8(0x8000,DRegs[6]);
setprg8(0xA000,DRegs[7]);
setprg8(0xC000,DRegs[10]);
}
static DECLFW(RAMBO1_write)
{
switch(A&0xF001)
{
case 0xa000: mir=V&1;
// if(!nomirror)
setmirror(mir^1);
break;
case 0x8000: cmd = V;
break;
case 0x8001: if((cmd&0xF)<10)
DRegs[cmd&0xF]=V;
else if((cmd&0xF)==0xF)
DRegs[10]=V;
Synco();
break;
case 0xc000: IRQLatch=V;
if(rmode==1)
IRQCount=IRQLatch;
break;
case 0xc001: rmode=1;
IRQCount=IRQLatch;
IRQmode=V&1;
break;
case 0xE000: IRQa=0;
X6502_IRQEnd(FCEU_IQEXT);
if(rmode==1)
IRQCount=IRQLatch;
break;
case 0xE001: IRQa=1;
if(rmode==1)
IRQCount=IRQLatch;
break;
}
}
static void RAMBO1_Restore(int version)
{
Synco();
// if(!nomirror)
setmirror(mir^1);
}
static void RAMBO1_init(void)
{
int x;
for(x=0;x<11;x++)
DRegs[x]=~0;
cmd=mir=0;
// if(!nomirror)
setmirror(1);
Synco();
GameHBIRQHook=RAMBO1_hb;
MapIRQHook=RAMBO1_IRQHook;
GameStateRestore=RAMBO1_Restore;
SetWriteHandler(0x8000,0xffff,RAMBO1_write);
AddExState(Rambo_StateRegs, ~0, 0, 0);
}
static void FP_FASTAPASS(2) CHRWrap(unsigned int A, unsigned int V)
{
setchr1(A,V);
}
void Mapper64_init(void)
{
setchr1wrap=CHRWrap;
// nomirror=0;
RAMBO1_init();
}
/*
static int MirCache[8];
static unsigned int PPUCHRBus;
static void FP_FASTAPASS(2) MirWrap(unsigned int A, unsigned int V)
{
MirCache[A>>10]=(V>>7)&1;
if(PPUCHRBus==(A>>10))
setmirror(MI_0+((V>>7)&1));
setchr1(A,V);
}
static void FP_FASTAPASS(1) MirrorFear(uint32 A)
{
A&=0x1FFF;
A>>=10;
PPUCHRBus=A;
setmirror(MI_0+MirCache[A]);
}
void Mapper158_init(void)
{
setchr1wrap=MirWrap;
PPU_hook=MirrorFear;
nomirror=1;
RAMBO1_init();
}
*/

View File

@ -78,6 +78,7 @@ void FCEUI_DisableFourScore(int s);
#define SI_POWERPADA 3
#define SI_POWERPADB 4
#define SI_ARKANOID 5
#define SI_MOUSE 6 //mbg merge 7/17/06 added
#define SIFC_NONE 0
#define SIFC_ARKANOID 1

View File

@ -2896,8 +2896,8 @@ int hq2x_InitLUTs(void)
{
int i, j, k, r, g, b, Y, u, v;
if(!(LUT16to32 = malloc(65536*sizeof(int)))) return(0);
if(!(RGBtoYUV = malloc(65536*sizeof(int)))) { free(LUT16to32); return(0); }
if(!(LUT16to32 = (int*)malloc(65536*sizeof(int)))) return(0); //mbg merge 7/17/06 added cast
if(!(RGBtoYUV = (int*)malloc(65536*sizeof(int)))) { free(LUT16to32); return(0); } //mbg merge 7/17/06 added cast
for (i=0; i<65536; i++)
LUT16to32[i] = ((i & 0xF800) << 8) + ((i & 0x07E0) << 5) + ((i & 0x001F) << 3);

View File

@ -3836,8 +3836,8 @@ int hq3x_InitLUTs(void)
{
int i, j, k, r, g, b, Y, u, v;
if(!(LUT16to32 = malloc(65536*sizeof(int)))) return(0);
if(!(RGBtoYUV = malloc(65536*sizeof(int)))) { free(LUT16to32); return(0); }
if(!(LUT16to32 = (int*)malloc(65536*sizeof(int)))) return(0); //mbg merge 7/17/06
if(!(RGBtoYUV = (int*)malloc(65536*sizeof(int)))) { free(LUT16to32); return(0); } //mbg merge 7/17/06
for (i=0; i<65536; i++)
LUT16to32[i] = ((i & 0xF800) << 8) + ((i & 0x07E0) << 5) + ((i & 0x001F) << 3);

View File

@ -32,6 +32,7 @@
* - derivative works of the program are allowed.
*/
#include "../../types.h" //mbg merge 7/17/06 added to get rid of __restrict__ in msvc
#include "scale2x.h"
#include <assert.h>

View File

@ -32,6 +32,7 @@
* - derivative works of the program are allowed.
*/
#include "../../types.h" //mbg merge 7/17/06 added to get rid of __restrict__ in msvc
#include "scale3x.h"
#include <assert.h>

View File

@ -50,6 +50,7 @@
/**
* Apply the Scale2x effect on a group of rows. Used internally.
*/
//mbg merge 7/17/06 added a bunch of casts
static inline void stage_scale2x(void* dst0, void* dst1, const void* src0, const void* src1, const void* src2, unsigned pixel, unsigned pixel_per_row)
{
switch (pixel) {
@ -58,9 +59,9 @@ static inline void stage_scale2x(void* dst0, void* dst1, const void* src0, const
case 2 : scale2x_16_mmx(dst0, dst1, src0, src1, src2, pixel_per_row); break;
case 4 : scale2x_32_mmx(dst0, dst1, src0, src1, src2, pixel_per_row); break;
#else
case 1 : scale2x_8_def(dst0, dst1, src0, src1, src2, pixel_per_row); break;
case 2 : scale2x_16_def(dst0, dst1, src0, src1, src2, pixel_per_row); break;
case 4 : scale2x_32_def(dst0, dst1, src0, src1, src2, pixel_per_row); break;
case 1 : scale2x_8_def((scale2x_uint8*)dst0, (scale2x_uint8*)dst1, (scale2x_uint8*)src0, (scale2x_uint8*)src1, (scale2x_uint8*)src2, pixel_per_row); break;
case 2 : scale2x_16_def((scale2x_uint16*)dst0, (scale2x_uint16*)dst1, (scale2x_uint16*)src0, (scale2x_uint16*)src1, (scale2x_uint16*)src2, pixel_per_row); break;
case 4 : scale2x_32_def((scale2x_uint32*)dst0, (scale2x_uint32*)dst1, (scale2x_uint32*)src0, (scale2x_uint32*)src1, (scale2x_uint32*)src2, pixel_per_row); break;
#endif
}
}
@ -68,12 +69,13 @@ static inline void stage_scale2x(void* dst0, void* dst1, const void* src0, const
/**
* Apply the Scale3x effect on a group of rows. Used internally.
*/
//mbg merge 7/17/06 added a bunch of casts
static inline void stage_scale3x(void* dst0, void* dst1, void* dst2, const void* src0, const void* src1, const void* src2, unsigned pixel, unsigned pixel_per_row)
{
switch (pixel) {
case 1 : scale3x_8_def(dst0, dst1, dst2, src0, src1, src2, pixel_per_row); break;
case 2 : scale3x_16_def(dst0, dst1, dst2, src0, src1, src2, pixel_per_row); break;
case 4 : scale3x_32_def(dst0, dst1, dst2, src0, src1, src2, pixel_per_row); break;
case 1 : scale3x_8_def((scale2x_uint8*)dst0, (scale2x_uint8*)dst1, (scale2x_uint8*)dst2, (scale2x_uint8*)src0, (scale2x_uint8*)src1, (scale2x_uint8*)src2, pixel_per_row); break;
case 2 : scale3x_16_def((scale2x_uint16*)dst0, (scale2x_uint16*)dst1, (scale2x_uint16*)dst2, (scale2x_uint16*)src0, (scale2x_uint16*)src1, (scale2x_uint16*)src2, pixel_per_row); break;
case 4 : scale3x_32_def((scale2x_uint32*)dst0, (scale2x_uint32*)dst1, (scale2x_uint32*)dst2, (scale2x_uint32*)src0, (scale2x_uint32*)src1, (scale2x_uint32*)src2, pixel_per_row); break;
}
}

View File

@ -84,7 +84,7 @@ int InitBlitToHigh(int b, uint32 rmask, uint32 gmask, uint32 bmask, int efx, int
if(specfilt == 2) multi = 2 * 2;
else if(specfilt == 4) multi = 3 * 3;
specbuf8bpp = malloc(256*240*multi);
specbuf8bpp = (uint8*)malloc(256*240*multi); //mbg merge 7/17/06 added cast
}
else if(specfilt == 1 || specfilt == 3) // hq2x and hq3x
@ -119,8 +119,8 @@ int InitBlitToHigh(int b, uint32 rmask, uint32 gmask, uint32 bmask, int efx, int
// backshiftr[x] -= backshiftl[x];
// End iffy code
}
if(specfilt == 1) specbuf32bpp = malloc(256*240*4*sizeof(uint32));
else if(specfilt == 3) specbuf32bpp = malloc(256*240*9*sizeof(uint32));
if(specfilt == 1) specbuf32bpp = (uint32*)malloc(256*240*4*sizeof(uint32)); //mbg merge 7/17/06 added cast
else if(specfilt == 3) specbuf32bpp = (uint32*)malloc(256*240*9*sizeof(uint32)); //mbg merge 7/17/06 added cast
}
efx=0;
@ -134,7 +134,7 @@ int InitBlitToHigh(int b, uint32 rmask, uint32 gmask, uint32 bmask, int efx, int
else
hq2x_InitLUTs();
specbuf=malloc(256*240*sizeof(uint16));
specbuf=(uint16*)malloc(256*240*sizeof(uint16)); //mbg merge 7/17/06 added cast
}
silt = specfilt;

View File

@ -1,5 +0,0 @@
.res.o:
windres -o $@ $<
fceud_SOURCES = drivers/win/cheat.c drivers/win/debug.c drivers/win/input.c drivers/win/joystick.c drivers/win/keyboard.c drivers/win/log.c drivers/win/main.c drivers/win/netplay.c drivers/win/ppuview.c drivers/win/aviout.c drivers/win/memwatch.c drivers/win/basicbot.c drivers/win/res.res

View File

@ -22,7 +22,7 @@
char *ParseArgies(int argc, char *argv[])
{
int x;
//int x; //mbg merge 7/17/06 removed
static ARGPSTRUCT FCEUArgs[]={
{"-pal",0,&palyo,0},
{"-noicon",0,&status_icon,0},

View File

@ -186,7 +186,7 @@ static int avi_open(const char* filename, const BITMAPINFOHEADER* pbmih, const W
// get compression options
memset(&avi_file->compress_options[VIDEO_STREAM], 0, sizeof(AVICOMPRESSOPTIONS));
avi_file->compress_options_ptr[VIDEO_STREAM] = &avi_file->compress_options[0];
retryAviSaveOptions:
//retryAviSaveOptions: //mbg merge 7/17/06 removed
error = 0;
if(!AVISaveOptions(hAppWnd, 0, 1, &avi_file->streams[VIDEO_STREAM], &avi_file->compress_options_ptr[VIDEO_STREAM]))
break;

View File

@ -18,6 +18,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
//mbg merge 7/17/06 this code shouldnt be compiled unless we're doing this (i think)
#ifdef _USE_SHARED_MEMORY_
#include "common.h"
@ -931,3 +933,5 @@ void CreateBasicBot()
SetDlgItemText(hwndBasicBot, 1022, Formula[22]);
}
#endif

View File

@ -1,6 +1,7 @@
#include <stdio.h>
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h> //bbit edited:this line added //mbg merge 7/17/06 removing conditional compiles
#ifndef WIN32
#define WIN32
@ -15,6 +16,7 @@
#include "../../types.h"
#include "../../general.h"
#include "../../driver.h"
#include "../common/vidblit.h" //mbg merge 7/17/06 added
#include "../common/config.h"
/* Message logging(non-netplay messages, usually) for all. */

View File

@ -29,6 +29,7 @@
#include "input.h"
#include "keyboard.h"
#include "joystick.h"
#include "../../fceu.h" //mbg merge 7/17/06 added
#include "keyscan.h"
@ -48,7 +49,9 @@ int InitDInput(void)
{
HRESULT ddrval;
ddrval=DirectInputCreateEx(fceu_hInstance,DIRECTINPUT_VERSION,&IID_IDirectInput7,(LPVOID *)&lpDI,0);
//mbg merge 7/17/06 changed:
//ddrval=DirectInputCreateEx(fceu_hInstance,DIRECTINPUT_VERSION,&IID_IDirectInput7,(LPVOID *)&lpDI,0);
ddrval=DirectInputCreateEx(fceu_hInstance,DIRECTINPUT_VERSION,IID_IDirectInput7,(LPVOID *)&lpDI,0);
if(ddrval!=DI_OK)
{
FCEUD_PrintError("DirectInput: Error creating DirectInput object.");
@ -195,6 +198,25 @@ int GetAutoFireDesynch()
return DesynchAutoFire;
}
int DTestButton(ButtConfig *bc)
{
uint32 x;//mbg merge 7/17/06 changed to uint
for(x=0;x<bc->NumC;x++)
{
if(bc->ButtType[x]==BUTTC_KEYBOARD)
{
if(keys_nr[bc->ButtonNum[x]])
{
return(1);
}
}
}
if(DTestButtonJoy(bc)) return(1);
return(0);
}
void UpdateGamepad()
{
if(FCEUI_IsMovieActive()<0)
@ -308,6 +330,9 @@ static uint32 UpdatePPadData(int w)
static uint8 fkbkeys[0x48];
static uint8 suborkbkeys[0x60];
void KeyboardUpdateState(void); //mbg merge 7/17/06 yech had to add this
void GetMouseData(uint32 *md); //mbg merge 7/17/06 yech had to add this
void FCEUD_UpdateInput()
{
int x;
@ -641,27 +666,10 @@ ARGPSTRUCT InputArgs[]={
{0,0,0,0}
};
int DTestButton(ButtConfig *bc)
{
int x;
for(x=0;x<bc->NumC;x++)
{
if(bc->ButtType[x]==BUTTC_KEYBOARD)
{
if(keys_nr[bc->ButtonNum[x]])
{
return(1);
}
}
}
if(DTestButtonJoy(bc)) return(1);
return(0);
}
static char *MakeButtString(ButtConfig *bc)
{
int x;
uint32 x; //mbg merge 7/17/06 changed to uint
char tmpstr[512];
char *astr;
@ -708,7 +716,7 @@ static char *MakeButtString(ButtConfig *bc)
}
}
astr=malloc(strlen(tmpstr) + 1);
astr=(char*)malloc(strlen(tmpstr) + 1); //mbg merge 7/17/06 added cast
strcpy(astr,tmpstr);
return(astr);
}
@ -805,7 +813,7 @@ static BOOL CALLBACK DWBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
break;
case WM_INITDIALOG:
SetWindowText(hwndDlg, DWBText);
SetWindowText(hwndDlg, (char*)DWBText); //mbg merge 7/17/06 added cast
BeginJoyWait(hwndDlg);
SetTimer(hwndDlg,666,25,0); /* Every 25ms.*/
{
@ -881,6 +889,7 @@ int DWaitButton(HWND hParent, const uint8 *text, ButtConfig *bc)
}
EnableWindow(hParent, 1);
return 0; //mbg merge TODO 7/17/06 - had to add this return value--is it right?
}
int DWaitSimpleButton(HWND hParent, const uint8 *text)
@ -889,7 +898,7 @@ int DWaitSimpleButton(HWND hParent, const uint8 *text)
int ret = 0;
die = CreateDialog(fceu_hInstance, "DWBDIALOGSIMPLE", hParent, NULL);
SetWindowText(die, text);
SetWindowText(die, (char*)text); //mbg merge 7/17/06 added cast
EnableWindow(hParent, 0);
ShowWindow(die, 1);
@ -963,7 +972,7 @@ static BOOL CALLBACK DoTBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
char btext[128];
btext[0]=0;
GetDlgItemText(hwndDlg, b, btext, 128);
DWaitButton(hwndDlg, btext,&DoTBButtons[b - 300]);
DWaitButton(hwndDlg, (uint8*)btext,&DoTBButtons[b - 300]); //mbg merge 7/17/06 added cast
}
else switch(wParam&0xFFFF)
{
@ -985,12 +994,12 @@ static BOOL CALLBACK DoTBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
}
static void DoTBConfig(HWND hParent, const char *text, char *template, ButtConfig *buttons, int max)
static void DoTBConfig(HWND hParent, const char *text, char *_template, ButtConfig *buttons, int max)
{
DoTBTitle=text;
DoTBButtons = buttons;
DoTBMax = max;
DialogBox(fceu_hInstance,template,hParent,DoTBCallB);
DialogBox(fceu_hInstance,_template,hParent,DoTBCallB);
}
static BOOL CALLBACK InputConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
@ -1127,7 +1136,7 @@ static BOOL CALLBACK InputConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
char btext[128];
btext[0]=0;
GetDlgItemText(hwndDlg, 112, btext, 128);
int button = DWaitSimpleButton(hwndDlg, btext);
int button = DWaitSimpleButton(hwndDlg, (uint8*)btext); //mbg merge 7/17/06
if(button)
{
if(!GetKeyNameText(button<<16,btext,128))
@ -1145,7 +1154,7 @@ static BOOL CALLBACK InputConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
char btext[128];
btext[0]=0;
GetDlgItemText(hwndDlg, 114, btext, 128);
int button = DWaitSimpleButton(hwndDlg, btext);
int button = DWaitSimpleButton(hwndDlg, (uint8*)btext); //mbg merge 7/17/06 added cast
if(button)
{
if(!GetKeyNameText(button<<16,btext,128))
@ -1572,18 +1581,19 @@ static int* ConflictTable=0;
static int ShouldDisplayMapping(int mapn, int filter)
{
switch(filter)
{
case 0: return 1; /* No filter */
case 1 ... EMUCMDTYPE_MAX: return (FCEUI_CommandTable[mapn].type == filter-1); /* Filter by type */
case EMUCMDTYPE_MAX+1: return FCEUD_CommandMapping[mapn]; /* Assigned */
case EMUCMDTYPE_MAX+2: return !(FCEUD_CommandMapping[mapn]); /* Unassigned */
case EMUCMDTYPE_MAX+3: return ConflictTable[mapn]; /* Conflicts */
default:
break;
}
return 0;
//mbg merge 7/17/06 changed to if..elseif
if(filter==0) /* No filter */
return 1;
else if(filter <= EMUCMDTYPE_MAX) /* Filter by type */
return (FCEUI_CommandTable[mapn].type == filter-1);
else if(filter == EMUCMDTYPE_MAX+1) /* Assigned */
return FCEUD_CommandMapping[mapn];
else if(filter == EMUCMDTYPE_MAX+2) /* Unassigned */
return !(FCEUD_CommandMapping[mapn]);
else if(filter == EMUCMDTYPE_MAX+3) /* Conflicts */
return ConflictTable[mapn];
else
return 0;
}
static void PopulateMappingDisplay(HWND hwndDlg)
@ -1667,7 +1677,7 @@ static BOOL CALLBACK MapInputDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
{
HWND hwndListView = GetDlgItem(hwndDlg, 1003);
LVCOLUMN lv;
LVITEM lvi;
//LVITEM lvi; //mbg merge 7/17/06 removed
int i;
// Set full row select.

View File

@ -117,7 +117,7 @@ void UpdateJoysticks(void)
int DTestButtonJoy(ButtConfig *bc)
{
int x;
uint32 x; //mbg merge 7/17/06 changed to uint
for(x=0;x<bc->NumC;x++)
{
@ -332,7 +332,7 @@ int KillJoysticks (void)
void JoyClearBC(ButtConfig *bc)
{
int x;
uint32 x; //mbg merge 7/17/06 changed to uint
for(x=0; x<bc->NumC; x++)
if(bc->ButtType[x] == BUTTC_JOYSTICK)
bc->DeviceNum[x] = FindByGUID(bc->DeviceInstance[x]);
@ -342,7 +342,7 @@ static int GetARange(LPDIRECTINPUTDEVICE7 dev, LONG which, LONG *min, LONG *max)
{
HRESULT dival;
DIPROPRANGE diprg;
int r;
//int r; //mbg merge 7/17/06 removed
memset(&diprg,0,sizeof(DIPROPRANGE));
diprg.diph.dwSize=sizeof(DIPROPRANGE);
@ -362,10 +362,13 @@ static int GetARange(LPDIRECTINPUTDEVICE7 dev, LONG which, LONG *min, LONG *max)
static BOOL CALLBACK JoystickFound(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef)
{
HRESULT dival;
//HRESULT dival; //mbg merge 7/17/06 removed
int n = numjoysticks;
if(DI_OK != IDirectInput7_CreateDeviceEx(lpDI,&lpddi->guidInstance,&IID_IDirectInputDevice7,(LPVOID *)&Joysticks[n],0))
//mbg merge 7/17/06 changed:
if(DI_OK != IDirectInput7_CreateDeviceEx(lpDI,lpddi->guidInstance,IID_IDirectInputDevice7,(LPVOID *)&Joysticks[n],0))
//if(DI_OK != IDirectInput7_CreateDeviceEx(lpDI,&lpddi->guidInstance,&IID_IDirectInputDevice7,(LPVOID *)&Joysticks[n],0))
{
FCEU_printf("Device creation of a joystick failed during init.\n");
return(DIENUM_CONTINUE);

View File

@ -134,7 +134,9 @@ int KeyboardInitialize(void)
if(lpdid)
return(1);
ddrval=IDirectInput7_CreateDeviceEx(lpDI, &GUID_SysKeyboard,&IID_IDirectInputDevice7, (LPVOID *)&lpdid,0);
//mbg merge 7/17/06 changed:
ddrval=IDirectInput7_CreateDeviceEx(lpDI, GUID_SysKeyboard,IID_IDirectInputDevice7, (LPVOID *)&lpdid,0);
//ddrval=IDirectInput7_CreateDeviceEx(lpDI, &GUID_SysKeyboard,&IID_IDirectInputDevice7, (LPVOID *)&lpdid,0);
if(ddrval != DI_OK)
{
FCEUD_PrintError("DirectInput: Error creating keyboard device.");

View File

@ -71,7 +71,7 @@ void AddLogText(char *text,int newline)
t++;
}
if(!(logtext[logcount&63]=malloc(strlen(text)+1+x+newline*2)))
if(!(logtext[logcount&63]=(char*)malloc(strlen(text)+1+x+newline*2))) //mbg merge 7/17/06 added cast
return;
t=logtext[logcount&63];

View File

@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
//
#include "common.h"
@ -33,6 +33,8 @@
#include <shlobj.h> // For directories configuration dialog.
#undef uint8
#include "../../types.h" //mbg merge 7/17/06 added
#include "../../fceu.h" //mbg merge 7/17/06 added
#include "input.h"
#include "netplay.h"
#include "joystick.h"
@ -187,15 +189,13 @@ static int soundquality=0;
extern int autoHoldKey, autoHoldClearKey;
extern int frame_display, input_display;
//mbg merge 7/17/06 why did these have to be unsigned
//mbg merge 7/17/06 did these have to be unsigned?
static int srendline,erendline;
static int srendlinen=8;
static int erendlinen=231;
static int srendlinep=0;
static int erendlinep=239;
static unsigned int totallines;
static int totallines;
static void FixFL(void)
{
@ -222,10 +222,52 @@ void FCEUD_PrintError(char *s)
if(fullscreen)ShowCursorAbs(0);
}
//---------------------------
//mbg merge 6/29/06 - new aboutbox
//generate an msvc-compatible compiler version string if necessary
#ifdef MSVC
#ifdef _M_X64
#define _MSVC_ARCH "x64"
#else
#define _MSVC_ARCH "x86"
#endif
#ifdef _DEBUG
#define _MSVC_BUILD "debug"
#else
#define _MSVC_BUILD "release"
#endif
#define __COMPILER__STRING__ "msvc " _Py_STRINGIZE(_MSC_VER) " " _MSVC_ARCH " " _MSVC_BUILD
#define _Py_STRINGIZE(X) _Py_STRINGIZE1((X))
#define _Py_STRINGIZE1(X) _Py_STRINGIZE2 ## X
#define _Py_STRINGIZE2(X) #X
//re: http://72.14.203.104/search?q=cache:HG-okth5NGkJ:mail.python.org/pipermail/python-checkins/2002-November/030704.html+_msc_ver+compiler+version+string&hl=en&gl=us&ct=clnk&cd=5
#else
#define __COMPILER__STRING__ "gcc " __VERSION__
#endif
void ShowAboutBox(void)
{
sprintf(TempArray,"FCE Ultra "FCEU_VERSION"\n\nhttp://fceultra.sourceforge.net\nlukeg.50webs.com/fceu.html\n\n"__TIME__"\n"__DATE__"\n""gcc "__VERSION__);
MessageBox(hAppWnd,TempArray,"About FCE Ultra",MB_OK);
sprintf(TempArray,
"FCEUX "FCEU_VERSION_STRING"\n\
~CAST~\n\
FCE - Bero\n\
FCEU - Xodnizel\n\
FCEU XD - Bbitmaster & Parasyte\n\
FCEU XD SP - Sebastian Porst\n\
FCEU MM - CaH4e3\n\
FCEU TAS - blip & nitsuja\n\
FCEU TAS+ - Luke Gustafson\n\
\n\
"__TIME__"\n\
"__DATE__"\n\
" __COMPILER__STRING__
);
MessageBox(hAppWnd,TempArray,"About FCEUXD SP",MB_OK);
}
@ -593,8 +635,6 @@ void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count)
buffer is used.
*/
int skipthis = 0;
doagain: //mbg merge 6/30/06
if(!(eoptions&EO_NOTHROTTLE) || fps_scale != 256)
if(!NoWaiting)
@ -614,26 +654,9 @@ void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count)
skipcount++;
}
}
//mbg merge 6/30/06
if(userpause)
{
StopSound();
Sleep(50);
BlockingCheck();
goto doagain;
}
}
UpdateFCEUWindow();
FCEUD_UpdateInput();
PPUViewDoBlit();
//mbg merge 6/29/06
UpdateMemoryView(0);
UpdateCDLogger();
UpdateLogWindow();
NTViewDoBlit(0);
UpdateFCEUWindow();
FCEUD_UpdateInput();
} // end of !(old sound code) block
}

View File

@ -109,105 +109,13 @@ static void GetSettings(HWND hwndDlg)
}
if(buf[0])
{
*strs[x] = malloc(strlen(buf) + 1);
*strs[x] = (char*)malloc(strlen(buf) + 1); //mbg merge 7/17/06 added cast
strcpy(*strs[x], buf);
}
}
remotetport = GetDlgItemInt(hwndDlg,201,0,0);
netlocalplayers=1 + SendDlgItemMessage(hwndDlg,204,CB_GETCURSEL,0,(LPARAM)(LPSTR)0);
}
static BOOL CALLBACK NetCon(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_CLOSE:
GetSettings(hwndDlg);
DestroyWindow(hwndDlg);
netwin=0;
FCEUD_NetworkClose();
break;
case WM_COMMAND:
if(HIWORD(wParam)==BN_CLICKED)
{
switch(LOWORD(wParam))
{
case 250:
if(FCEUDnetplay)
{
FCEUD_NetworkClose();
SetDlgItemText(hwndDlg,250,"Connect");
FixCDis(hwndDlg,1);
}
else if(GI)
{
GetSettings(hwndDlg);
if(FCEUD_NetworkConnect())
{
SetDlgItemText(hwndDlg,250,"Disconnect");
FixCDis(hwndDlg,0);
}
}
break;
}
}
else if(HIWORD(wParam)==EN_CHANGE && Socket!=INVALID_SOCKET)
{
char buf[1024];
int t;
t=GetDlgItemText(hwndDlg,102,buf,1024);
buf[1023]=0;
if(strchr(buf,'\r'))
{
char *src,*dest;
src=dest=buf;
while(*src)
{
if(*src != '\n' && *src != '\r')
{
*dest = *src;
dest++;
}
src++;
}
*dest = 0;
FCEUI_NetplayText(buf);
SetDlgItemText(hwndDlg,102,"");
}
}
break;
case WM_INITDIALOG:
if(netplayhost)
SetDlgItemText(hwndDlg,200,netplayhost);
SetDlgItemInt(hwndDlg,201,remotetport,0);
if(netplaynick)
SetDlgItemText(hwndDlg,203,netplaynick);
if(netgamekey)
SetDlgItemText(hwndDlg,205,netgamekey);
if(netpassword)
SetDlgItemText(hwndDlg,206,netpassword);
{
int x;
char buf[8];
for(x=0;x<4;x++)
{
sprintf(buf,"%d",x+1);
SendDlgItemMessage(hwndDlg,204,CB_ADDSTRING,0,(LPARAM)(LPSTR)buf);
}
SendDlgItemMessage(hwndDlg,204,CB_SETCURSEL,netlocalplayers-1,(LPARAM)(LPSTR)0);
}
break;
}
return 0;
}
static void NetStatAdd(char *text)
{
@ -218,7 +126,7 @@ static void NetStatAdd(char *text)
if(!netwin) return;
if(netstattcount>=64) free(netstatt[netstattcount&63]);
if(!(netstatt[netstattcount&63]=malloc(strlen(text)+1)))
if(!(netstatt[netstattcount&63]=(char*)malloc(strlen(text)+1))) //mbg merge 7/17/06 added cast
return;
strcpy(netstatt[netstattcount&63],text);
netstattcount++;
@ -234,7 +142,7 @@ static void NetStatAdd(char *text)
}
totallen++; // NULL
textbuf = malloc(totallen);
textbuf = (char *)malloc(totallen); //mbg merge 7/17/06 added cast
textbuf[0] = 0;
for(x=netstattcount&63;;)
@ -254,7 +162,7 @@ static void NetStatAdd(char *text)
totallen += 2;
}
totallen++;
textbuf = malloc(totallen);
textbuf = (char*)malloc(totallen); //mbg merge 7/17/06 added cast
textbuf[0] = 0;
for(x=0;x<netstattcount;x++)
{
@ -270,13 +178,13 @@ static void NetStatAdd(char *text)
void FCEUD_NetplayText(uint8 *text)
{
NetStatAdd(text);
NetStatAdd((char*)text); //mbg merge 7/17/06 added cast
}
int FCEUD_NetworkConnect(void)
{
WSADATA WSAData;
SOCKADDR_IN sockin; /* I want to play with fighting robots. */
SOCKADDR_IN sockin; /* I want to play with fighting robots. */ /* clack clack clack razzzzzzzzzz */
SOCKET TSocket;
int netdivisor;
@ -341,7 +249,7 @@ int FCEUD_NetworkConnect(void)
uint32 sblen;
sblen = 4 + 16 + 16 + 64 + 1 + (netplaynick?strlen(netplaynick):0);
sendbuf = malloc(sblen);
sendbuf = (uint8*)malloc(sblen); //mbg merge 7/17/06 added cast
memset(sendbuf, 0, sblen);
en32(sendbuf, sblen - 4);
@ -353,7 +261,7 @@ int FCEUD_NetworkConnect(void)
md5_starts(&md5);
md5_update(&md5, GI->MD5, 16);
md5_update(&md5, netgamekey, strlen(netgamekey));
md5_update(&md5, (uint8*)netgamekey, strlen(netgamekey)); //mbg merge 7/17/06 added cast
md5_finish(&md5, md5out);
memcpy(sendbuf + 4, md5out, 16);
}
@ -366,7 +274,7 @@ int FCEUD_NetworkConnect(void)
uint8 md5out[16];
md5_starts(&md5);
md5_update(&md5, netpassword, strlen(netpassword));
md5_update(&md5, (uint8*)netpassword, strlen(netpassword)); //mbg merge 7/17/06 added cast
md5_finish(&md5, md5out);
memcpy(sendbuf + 4 + 16, md5out, 16);
}
@ -377,7 +285,7 @@ int FCEUD_NetworkConnect(void)
if(netplaynick)
memcpy(sendbuf + 4 + 16 + 16 + 64 + 1,netplaynick,strlen(netplaynick));
send(Socket, sendbuf, sblen, 0);
send(Socket, (char*)sendbuf, sblen, 0); //mbg merge 7/17/06 added cast
free(sendbuf);
recv_tcpwrap(buf, 1);
@ -390,7 +298,7 @@ int FCEUD_NetworkConnect(void)
NetStatAdd("*** Connection established.");
FCEUDnetplay = 1;
int tcpopt = 1;
char tcpopt = 1; //mbg merge 7/17/06 changed to char
if(setsockopt(TSocket, IPPROTO_TCP, TCP_NODELAY, &tcpopt, sizeof(int)))
puts("Nodelay fail");
@ -400,7 +308,7 @@ int FCEUD_NetworkConnect(void)
int FCEUD_SendData(void *data, uint32 len)
{
send(Socket, data, len ,0);
send(Socket, (char*)data, len ,0); //mbg merge 7/17/06 added cast
return(1);
}
@ -425,7 +333,7 @@ static int recv_tcpwrap(uint8 *buf, int len)
case SOCKET_ERROR:return(0);
}
t=recv(Socket,buf,len,0);
t=recv(Socket,(char*)buf,len,0); //mbg merge 7/17/06 added csat
if(t<=0) return(0);
len -= t;
buf += t;
@ -456,7 +364,7 @@ int FCEUD_RecvData(void *data, uint32 len)
if(FD_ISSET(Socket,&funfun))
{
if(recv_tcpwrap(data,len)>0)
if(recv_tcpwrap((uint8*)data,len)>0) //mbg merge 7/17/06 added cast
{
unsigned long beefie;
if(!ioctlsocket(Socket,FIONREAD,&beefie))
@ -473,12 +381,6 @@ int FCEUD_RecvData(void *data, uint32 len)
return 0;
}
void ShowNetplayConsole(void)
{
if(!netwin)
netwin=CreateDialog(fceu_hInstance,"NETMOO",0,NetCon);
}
CFGSTRUCT NetplayConfig[]={
AC(remotetport),
AC(netlocalplayers),
@ -488,3 +390,104 @@ CFGSTRUCT NetplayConfig[]={
ACS(netpassword),
ENDCFGSTRUCT
};
static BOOL CALLBACK NetCon(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_CLOSE:
GetSettings(hwndDlg);
DestroyWindow(hwndDlg);
netwin=0;
FCEUD_NetworkClose();
break;
case WM_COMMAND:
if(HIWORD(wParam)==BN_CLICKED)
{
switch(LOWORD(wParam))
{
case 250:
if(FCEUDnetplay)
{
FCEUD_NetworkClose();
SetDlgItemText(hwndDlg,250,"Connect");
FixCDis(hwndDlg,1);
}
else if(GI)
{
GetSettings(hwndDlg);
if(FCEUD_NetworkConnect())
{
SetDlgItemText(hwndDlg,250,"Disconnect");
FixCDis(hwndDlg,0);
}
}
break;
}
}
else if(HIWORD(wParam)==EN_CHANGE && Socket!=INVALID_SOCKET)
{
char buf[1024];
int t;
t=GetDlgItemText(hwndDlg,102,buf,1024);
buf[1023]=0;
if(strchr(buf,'\r'))
{
char *src,*dest;
src=dest=buf;
while(*src)
{
if(*src != '\n' && *src != '\r')
{
*dest = *src;
dest++;
}
src++;
}
*dest = 0;
FCEUI_NetplayText((uint8*)buf); //mbg merge 7/17/06 added cast
SetDlgItemText(hwndDlg,102,"");
}
}
break;
case WM_INITDIALOG:
if(netplayhost)
SetDlgItemText(hwndDlg,200,netplayhost);
SetDlgItemInt(hwndDlg,201,remotetport,0);
if(netplaynick)
SetDlgItemText(hwndDlg,203,netplaynick);
if(netgamekey)
SetDlgItemText(hwndDlg,205,netgamekey);
if(netpassword)
SetDlgItemText(hwndDlg,206,netpassword);
{
int x;
char buf[8];
for(x=0;x<4;x++)
{
sprintf(buf,"%d",x+1);
SendDlgItemMessage(hwndDlg,204,CB_ADDSTRING,0,(LPARAM)(LPSTR)buf);
}
SendDlgItemMessage(hwndDlg,204,CB_SETCURSEL,netlocalplayers-1,(LPARAM)(LPSTR)0);
}
break;
}
return 0;
}
void ShowNetplayConsole(void)
{
if(!netwin)
netwin=CreateDialog(fceu_hInstance,"NETMOO",0,NetCon);
}

950
drivers/win/res.rc Normal file
View File

@ -0,0 +1,950 @@
#include <windows.h>
#include <winuser.h>
LANGUAGE LANG_NEUTRAL, 0
ICON_1 ICON "res\\ICON_1.ico"
ICON_2 ICON "res\\ICON_2.ico"
FCEUMENU MENU
MOVEABLE PURE LOADONCALL DISCARDABLE
LANGUAGE LANG_NEUTRAL, 0
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&Open...", 100
MENUITEM "&Close", 101
MENUITEM "&Recent", 102
MENUITEM SEPARATOR
MENUITEM "Load State From...", 111
MENUITEM "Save State As...", 110
MENUITEM SEPARATOR
MENUITEM "Record Movie...", 141
MENUITEM "Replay Movie...", 142
MENUITEM "Stop Movie", 143
MENUITEM SEPARATOR
MENUITEM "Record AVI...", 151
MENUITEM "Stop AVI", 152
MENUITEM SEPARATOR
MENUITEM "Log &Sound As...", 120
MENUITEM SEPARATOR
MENUITEM "E&xit Alt+F4", 130
END
POPUP "&NES"
BEGIN
MENUITEM "&Reset", 200
MENUITEM "&Power", 201
MENUITEM SEPARATOR
MENUITEM "&Eject/Insert Disk", 40001
MENUITEM "&Switch Disk Side", 40026
MENUITEM SEPARATOR
MENUITEM "&Insert Coin", 40027
END
POPUP "&Tools"
BEGIN
MENUITEM "&Cheats...", 204
MENUITEM "&Debugger...", 203
MENUITEM "Memory &Viewer...", 40028
MENUITEM "&Memory Watch...", 205
MENUITEM "&Basic Bot...", 40002
MENUITEM SEPARATOR
POPUP "Autofire &Pattern"
BEGIN
MENUITEM "1 on, 1 off", 40004
MENUITEM "1 on, 2 off", 40005
MENUITEM "1 on, 3 off", 40006
MENUITEM "1 on, 4 off", 40007
MENUITEM "1 on, 5 off", 40008
MENUITEM "2 on, 1 off", 40009
MENUITEM "2 on, 2 off", 40010
MENUITEM "2 on, 3 off", 40011
MENUITEM "2 on, 4 off", 40012
MENUITEM "3 on, 1 off", 40013
MENUITEM "3 on, 2 off", 40014
MENUITEM "3 on, 3 off", 40015
MENUITEM "4 on, 1 off", 40022
MENUITEM "4 on, 2 off", 40023
MENUITEM "5 on, 1 off", 40024
END
POPUP "Autofire &Offset"
BEGIN
MENUITEM "0 frames", 40016
MENUITEM "1 frame", 40017
MENUITEM "2 frames", 40018
MENUITEM "3 frames", 40019
MENUITEM "4 frames", 40020
MENUITEM "5 frames", 40021
END
MENUITEM "&Alternate A and B", 40025
MENUITEM SEPARATOR
MENUITEM "Use &External Input", 40003
END
POPUP "&Config"
BEGIN
MENUITEM "Hide Menu", 300
MENUITEM "Show Status Icon", 303
MENUITEM "Enable Run in Background", 301
MENUITEM "Enable Background Input", 302
MENUITEM "Enable Rewind", 40029
MENUITEM SEPARATOR
MENUITEM "Game Genie", 310
MENUITEM "PAL Emulation", 311
MENUITEM SEPARATOR
MENUITEM "&Directories...", 320
MENUITEM "&GUI...", 327
MENUITEM "&Input...", 321
MENUITEM "&Network Play...", 323
MENUITEM "&Palette...", 324
MENUITEM "&Sound...", 325
MENUITEM "&Timing...", 322
MENUITEM "&Video...", 326
MENUITEM "&Map Hotkeys...", 328
END
POPUP "&Help"
BEGIN
MENUITEM "&Message Log...", 401
MENUITEM SEPARATOR
MENUITEM "&About...", 400
END
END
ADDCHEAT DIALOG 28, 53, 405, 239
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Add Cheat"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "",108,"LISTBOX",LBS_WANTKEYBOARDINPUT |LBS_NOINTEGRALHEIGHT |LBS_HASSTRINGS |LBS_NOTIFY |WS_CHILD |WS_BORDER |WS_VISIBLE ,9,30,56,202
CONTROL "V1:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_VISIBLE ,85,39,12,8
CONTROL "V2:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_VISIBLE ,136,39,12,8
CONTROL "",110,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,101,37,20,12
CONTROL "",111,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,152,37,20,12
CONTROL "&Reset Search",112,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,98,213,59,14
CONTROL "&Do Search",113,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,93,194,49,14
CONTROL "&Unhide Excluded",107,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,89,164,59,14
CONTROL "Set Original to Current",114,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,82,139,80,14
CONTROL "Cheat Search",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,5,17,172,219
CONTROL "Parameters",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,80,26,97,103
CONTROL "O==V1 &&&& C==V2",115,"Button",WS_CHILD |WS_VISIBLE |0x9,86,54,87,12
CONTROL "O==V1 &&&& |O-C|==V2",116,"Button",WS_CHILD |WS_VISIBLE |0x9,86,66,87,12
CONTROL "|O-C|==V2",117,"Button",WS_CHILD |WS_VISIBLE |0x9,86,102,48,12
CONTROL "O!=C",118,"Button",WS_CHILD |WS_VISIBLE |0x9,86,114,48,12
CONTROL "",120,"SCROLLBAR",SBS_VERT |WS_CHILD |WS_VISIBLE ,66,30,12,200
CONTROL "Close",106,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,317,218,81,14
CONTROL "Value decreased.",119,"Button",WS_CHILD |WS_VISIBLE |0x9,86,78,75,12
CONTROL "Value increased.",120,"Button",WS_CHILD |WS_VISIBLE |0x9,86,90,75,12
CONTROL "Name:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_VISIBLE ,300,31,23,8
CONTROL "",200,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,328,30,65,12
CONTROL "Address:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_VISIBLE ,304,47,31,8
CONTROL "",201,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,340,46,27,12
CONTROL "Value:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_VISIBLE ,309,63,26,8
CONTROL "",202,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,340,62,27,12
CONTROL "",203,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,340,78,27,12
CONTROL "Add",250,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,329,116,50,14
CONTROL "Cheats",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,182,17,217,188
CONTROL "Compare:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_VISIBLE ,306,80,30,8
CONTROL "Read Substitute",204,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,317,94,74,12
CONTROL "Update",251,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,326,158,58,14
CONTROL "",300,"LISTBOX",LBS_NOTIFY |WS_CHILD |WS_BORDER |WS_VSCROLL |WS_VISIBLE ,188,30,110,164
CONTROL "Delete",252,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,326,187,58,14
CONTROL "Add Game Genie",253,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,323,136,64,14
CONTROL "To add a Game Genie code, type the code into the \x22Name\x22 field, and hit \x22Add Game Genie\x22.",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,4,387,8
END
CREATEMOVIE DIALOG 0, 0, 371, 133
STYLE DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_SYSMENU |WS_CAPTION
CAPTION "Record Movie"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "OK",101,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,257,112,50,14
CONTROL "Cancel",102,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,314,112,50,14
CONTROL "",201,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,7,24,300,14
CONTROL "Movie File:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,7,13,132,10
CONTROL "Author Info:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,14,51,79,8
CONTROL "Record from:",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,7,74,103,31
CONTROL "Now",401,"Button",WS_CHILD |WS_GROUP |WS_VISIBLE |0x9,19,87,31,10
CONTROL "Reset",402,"Button",WS_CHILD |WS_VISIBLE |0x9,59,87,35,10
CONTROL "",301,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,100,51,264,14
CONTROL "Browse...",202,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,314,24,50,14
END
DEBUGGER DIALOG 6, 51, 380, 227
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Debugger"
FONT 8, "Fixedsys"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,319,206,56,14
CONTROL "",100,"LISTBOX",LBS_NOTIFY |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,2,6,187,220
CONTROL "",200,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,226,52,20,12
CONTROL "PC:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,206,54,15,8
CONTROL "",201,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,226,66,12,12
CONTROL "SP:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,206,69,15,8
CONTROL "",202,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,226,80,12,12
CONTROL "P:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,206,82,15,8
CONTROL "",210,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,351,53,12,12
CONTROL "A:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,331,54,15,8
CONTROL "X:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,331,67,15,8
CONTROL "",211,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,351,67,12,12
CONTROL "Y:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,331,81,15,8
CONTROL "",212,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,351,81,12,12
CONTROL "N V - - D I Z C",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,260,63,64,8
CONTROL "",407,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,259,73,8,12
CONTROL "",406,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,267,73,8,12
CONTROL "",403,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,291,73,8,12
CONTROL "",402,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,299,73,8,12
CONTROL "",401,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,307,73,8,12
CONTROL "",400,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,315,73,8,12
CONTROL "Flags:",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,252,54,81,35
CONTROL "&Run",301,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,208,25,40,14
CONTROL "R&eset",310,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,256,4,37,14
CONTROL "&Step",300,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,207,4,40,14
CONTROL "&NMI",302,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,344,26,30,14
CONTROL "&IRQ",303,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,344,6,30,14
CONTROL "",101,"SCROLLBAR",SBS_VERT |WS_CHILD |WS_VISIBLE ,190,5,9,212
CONTROL "&Memory...",311,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,243,204,51,14
CONTROL "BreakPoints",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,201,105,176,84
CONTROL "IRQ:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,296,9,16,8
CONTROL "",220,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,313,9,18,8
CONTROL "NMI:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,296,19,16,8
CONTROL "",221,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,313,19,18,8
CONTROL "Reset:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,285,29,27,8
CONTROL "",222,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,313,29,18,8
CONTROL "",510,"LISTBOX",LBS_NOTIFY |WS_CHILD |WS_BORDER |WS_VSCROLL |WS_VISIBLE ,205,114,100,51
CONTROL "Delete",540,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,207,168,34,14
CONTROL "",520,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,308,114,23,12
CONTROL "",521,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,341,114,23,12
CONTROL "Read",530,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,310,130,42,12
CONTROL "Write",531,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,310,152,36,12
CONTROL "PC Same",532,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,315,140,42,12
CONTROL "Add",541,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,337,168,36,14
CONTROL "Registers",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,201,42,171,54
CONTROL "-",65535,"STATIC",SS_CENTER |WS_CHILD |WS_GROUP |WS_VISIBLE ,332,116,7,8
END
DIRCONFIG DIALOGEX 63, 7, 280, 331, 0
EXSTYLE 0
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Directories Configuration"
FONT 8, "MS Sans Serif", 0, 0, 0
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,215,311,56,14,0x0,0
CONTROL "The settings in the \x22Individual Directory Overrides\x22 group will override the settings in the \x22Base Directory Override\x22 group. To delete an override, delete the text from the text edit control. Note that the directory the configuration file is in can not be overridden.",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,15,11,254,35,0x0,0
CONTROL "Cheats",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,21,110,235,32,0x0,0
CONTROL "",100,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,30,122,150,12,0x0,0
CONTROL "Browse...",200,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,191,121,56,14,0x0,0
CONTROL "Movies",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,21,145,235,32,0x0,0
CONTROL "",101,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,30,157,150,12,0x0,0
CONTROL "Browse...",201,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,191,156,56,14,0x0,0
CONTROL "Battery Saves",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,21,180,235,32,0x0,0
CONTROL "",102,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,30,192,150,12,0x0,0
CONTROL "Browse...",202,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,191,191,56,14,0x0,0
CONTROL "Save States",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,21,215,235,32,0x0,0
CONTROL "",103,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,30,227,150,12,0x0,0
CONTROL "Browse...",203,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,191,226,56,14,0x0,0
CONTROL "Screenshots",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,21,250,235,42,0x0,0
CONTROL "",104,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,30,262,150,12,0x0,0
CONTROL "Browse...",204,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,191,261,56,14,0x0,0
CONTROL "Individual Directory Overrides",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,11,96,257,205,0x0,0
CONTROL "Base Directory Override",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,11,57,235,32,0x0,0
CONTROL "",105,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,20,71,150,12,0x0,0
CONTROL "Browse...",205,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,182,70,56,14,0x0,0
CONTROL "Save screenshots as \x22<filebase>-<x>.png\x22.",300,"BUTTON",BS_AUTOCHECKBOX |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,36,277,198,12,0x0,0
END
DWBDIALOG DIALOG 33, 99, 250, 56
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "DWB!"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Text",100,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,7,9,237,8
CONTROL "Clear",200,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,64,32,50,14
CONTROL "Close",201,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,188,33,50,14
END
FKBDIALOG DIALOG 13, 72, 402, 194
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Family Keyboard Configuration"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,320,170,56,14
CONTROL "Remember to push the \x22Scroll Lock\x22 key during emulation to enable Family Keyboard input.",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,18,6,370,12
CONTROL "",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,11,22,380,133
CONTROL "F1",300,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,22,43,32,12
CONTROL "1",308,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,30,59,16,12
CONTROL "F2",301,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,60,43,32,12
CONTROL "F3",302,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,98,43,32,12
CONTROL "F4",303,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,136,43,32,12
CONTROL "F5",304,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,174,43,32,12
CONTROL "F6",305,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,212,43,32,12
CONTROL "F7",306,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,250,43,32,12
CONTROL "F8",307,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,288,43,32,12
CONTROL "2",309,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,49,59,16,12
CONTROL "3",310,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,68,59,16,12
CONTROL "4",311,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,87,59,16,12
CONTROL "5",312,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,106,59,16,12
CONTROL "6",313,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,125,59,16,12
CONTROL "7",314,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,144,59,16,12
CONTROL "8",315,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,163,59,16,12
CONTROL "9",316,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,182,59,16,12
CONTROL "0",317,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,201,59,16,12
CONTROL "-",318,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,220,59,16,12
CONTROL "^",319,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,239,59,16,12
CONTROL "\\",320,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,258,59,16,12
CONTROL "STP",321,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,277,59,16,12
CONTROL "ESC",322,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,22,75,16,12
CONTROL "Q",323,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,41,75,16,12
CONTROL "W",324,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,60,75,16,12
CONTROL "E",325,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,79,75,16,12
CONTROL "R",326,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,98,75,16,12
CONTROL "T",327,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,117,75,16,12
CONTROL "Y",328,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,136,75,16,12
CONTROL "U",329,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,155,75,16,12
CONTROL "I",330,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,174,75,16,12
CONTROL "O",331,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,193,75,16,12
CONTROL "P",332,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,212,75,16,12
CONTROL "@",333,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,231,75,16,12
CONTROL "[",334,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,250,75,16,12
CONTROL "RETURN",335,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,272,75,32,12
CONTROL "CTR",336,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,26,91,16,12
CONTROL "A",337,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,45,91,16,12
CONTROL "S",338,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,64,91,16,12
CONTROL "D",339,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,83,91,16,12
CONTROL "F",340,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,102,91,16,12
CONTROL "G",341,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,121,91,16,12
CONTROL "H",342,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,140,91,16,12
CONTROL "J",343,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,159,91,16,12
CONTROL "K",344,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,178,91,16,12
CONTROL "L",345,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,197,91,16,12
CONTROL ";",346,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,216,91,16,12
CONTROL ":",347,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,235,91,16,12
CONTROL "]",348,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,254,91,16,12
CONTROL "KANA",349,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,273,91,16,12
CONTROL "Z",351,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,55,107,16,12
CONTROL "X",352,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,74,107,16,12
CONTROL "C",353,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,93,107,16,12
CONTROL "V",354,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,112,107,16,12
CONTROL "B",355,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,131,107,16,12
CONTROL "N",356,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,150,107,16,12
CONTROL "M",357,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,169,107,16,12
CONTROL ",",358,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,188,107,16,12
CONTROL ".",359,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,207,107,16,12
CONTROL "/",360,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,226,107,16,12
CONTROL "",361,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,245,107,16,12
CONTROL "SHIFT",350,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,19,107,32,12
CONTROL "SHIFT",362,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,265,107,32,12
CONTROL "GRPH",363,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,74,123,16,12
CONTROL "SPACE",364,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,93,123,149,12
CONTROL "CLR",365,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,316,67,16,12
CONTROL "INS",366,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,335,67,16,12
CONTROL "DEL",367,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,354,67,16,12
CONTROL "UP",368,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,327,83,32,12
CONTROL "LEFT",369,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,310,99,32,12
CONTROL "RIGHT",370,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,346,99,32,12
CONTROL "DOWN",371,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,327,115,32,12
END
GAMEPADDIALOG DIALOG 4, 109, 243, 220
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Gamepad Configuration"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,173,196,56,14
CONTROL "",100,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,4,8,232,82
CONTROL "Up",304,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,35,27,24,12
CONTROL "Left",306,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,9,45,25,12
CONTROL "Right",307,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,60,45,24,12
CONTROL "Down",305,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,35,64,24,12
CONTROL "Select",302,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,91,45,26,12
CONTROL "Start",303,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,126,45,26,12
CONTROL "B",301,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,169,45,16,12
CONTROL "A",300,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,195,45,16,12
CONTROL "Turbo B",309,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,154,29,32,12
CONTROL "Turbo A",308,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,195,29,32,12
CONTROL "",101,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,4,101,232,82
CONTROL "Up",314,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,35,120,24,12
CONTROL "Left",316,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,9,138,25,12
CONTROL "Right",317,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,60,138,24,12
CONTROL "Down",315,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,35,157,24,12
CONTROL "Select",312,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,91,138,26,12
CONTROL "Start",313,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,126,138,26,12
CONTROL "B",311,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,169,138,16,12
CONTROL "A",310,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,195,138,16,12
CONTROL "Turbo B",319,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,154,122,32,12
CONTROL "Turbo A",318,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,195,122,32,12
CONTROL "Disable four-score emulation.",400,"Button",WS_CHILD |WS_VISIBLE |0x3,9,193,106,12
END
GUICONFIG DIALOG 16, 123, 216, 103
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "GUI Configuration"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,153,83,56,14
CONTROL "Load \x22File Open\x22 dialog when FCE Ultra starts.",102,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,16,10,198,12
CONTROL "Automatically hide menu on game load.",104,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,16,26,198,12
CONTROL "Ask confirmation on exit attempt.",110,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,16,42,146,12
CONTROL "Disable screen saver while game is loaded.",111,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,16,58,193,12
END
IDD_RECORDINP DIALOG 0, 0, 276, 113
STYLE DS_FIXEDSYS |DS_SETFONT |DS_MODALFRAME |DS_CENTER |WS_POPUP |WS_SYSMENU |WS_CAPTION
CAPTION "Record input"
FONT 8, "MS Shell Dlg"
LANGUAGE LANG_ENGLISH, 1
BEGIN
CONTROL "OK",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,219,97,50,14
CONTROL "",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,3,0,269,94
CONTROL "File:",65535,"STATIC",SS_CENTERIMAGE |SS_RIGHT |WS_CHILD |WS_VISIBLE ,26,10,24,10
CONTROL "Cancel",2,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,165,97,50,14
CONTROL "Author Info:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,29,40,8
CONTROL "",200,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,55,10,189,12
CONTROL "...",201,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,249,10,18,14
CONTROL "",300,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,55,29,189,37
CONTROL "",301,"COMBOBOX",CBS_DROPDOWNLIST |WS_CHILD |WS_VSCROLL |WS_TABSTOP |WS_VISIBLE ,55,73,189,154
CONTROL "Record From:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,7,73,43,8
END
IDD_REPLAYINP DIALOGEX 0, 0, 300, 181, 0
EXSTYLE 0
STYLE DS_FIXEDSYS |DS_SETFONT |DS_MODALFRAME |DS_CENTER |WS_POPUP |WS_SYSMENU |WS_CAPTION
CAPTION "Replay input"
FONT 8, "MS Shell Dlg", 0, 0, 0
LANGUAGE LANG_ENGLISH, 1
BEGIN
CONTROL "OK",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,245,165,50,14,0x0,0
CONTROL "",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,3,0,293,160,0x0,0
CONTROL "File:",65535,"STATIC",SS_CENTERIMAGE |SS_RIGHT |WS_CHILD |WS_VISIBLE ,8,11,24,10,0x0,0
CONTROL "",200,"COMBOBOX",CBS_DROPDOWNLIST |WS_CHILD |WS_VSCROLL |WS_TABSTOP |WS_VISIBLE ,35,10,257,128,0x0,0
CONTROL "Cancel",2,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,190,165,50,14,0x0,0
CONTROL "Length:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,55,59,8,0x0,0
CONTROL "Frames:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,63,59,8,0x0,0
CONTROL "Undo Count:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,71,59,8,0x0,0
CONTROL "Author Info:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,119,59,8,0x0,0
CONTROL "00:00:00",300,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,76,55,59,8,0x0,0
CONTROL "0",301,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,76,63,59,8,0x0,0
CONTROL "0",302,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,76,71,59,8,0x0,0
CONTROL "",303,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,76,119,190,37,0x0,0
CONTROL "Open &Read-Only",201,"BUTTON",BS_AUTOCHECKBOX |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,35,25,69,10,0x0,0
CONTROL "ROM Used:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,87,59,8,0x0,0
CONTROL "ROM Checksum:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,95,59,8,0x0,0
CONTROL "test.nes",304,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,76,87,187,8,0x0,0
CONTROL "63ef6f9b 927d0c2d 8ce7f8ae b34c7148",305,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,76,95,155,8,0x0,0
CONTROL "Recorded From:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,79,59,8,0x0,0
CONTROL "Reset",306,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,76,79,123,8,0x0,0
CONTROL "Emulator Used:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,111,59,8,0x0,0
CONTROL "FCEU 0.98.12",307,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,76,111,155,8,0x0,0
CONTROL "Current ROM Sum:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,103,59,8,0x0,0
CONTROL "63ef6f9b 927d0c2d 8ce7f8ae b34c7148",308,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,76,103,155,8,0x0,0
CONTROL "",1000,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE |WS_DISABLED ,196,25,32,12,0x0,0
CONTROL "",1001,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE |WS_DISABLED ,246,25,32,12,0x0,0
CONTROL "Offset:",2000,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,123,27,72,8,WS_EX_RIGHT ,0
CONTROL "from",2001,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,228,27,16,8,WS_EX_RIGHT ,0
CONTROL "Stop movie at frame",1002,"BUTTON",BS_AUTOCHECKBOX |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,35,40,79,10,0x0,0
CONTROL "",1003,"EDIT",ES_NUMBER |ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,115,40,35,12,0x0,0
END
INPUTCONFIG DIALOGEX 122, 105, 350, 222, 0
EXSTYLE 0
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Input Configuration"
FONT 8, "MS Sans Serif", 0, 0, 0
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,278,199,56,14,0x0,0
CONTROL "Select the device you want to be enabled on input ports 1 and 2, and the Famicom expansion port. You may configure the device listed above each drop-down list by pressing \x22Configure\x22, if applicable. The device currently being emulated on the each port is listed above the drop down list; loading certain games will override your settings, but only temporarily. If you select a device to be on the emulated Famicom Expansion Port, you should probably have emulated gamepads on the emulated NES-style input ports.",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,15,8,320,55,0x0,0
CONTROL "Port 1:",102,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,18,80,152,55,0x0,0
CONTROL "",104,"COMBOBOX",CBS_DROPDOWNLIST |WS_CHILD |WS_VSCROLL |WS_TABSTOP |WS_VISIBLE ,24,109,71,60,0x0,0
CONTROL "Configure",106,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,106,95,56,14,0x0,0
CONTROL "Port 2:",103,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,178,80,152,55,0x0,0
CONTROL "",105,"COMBOBOX",CBS_DROPDOWNLIST |WS_CHILD |WS_VSCROLL |WS_TABSTOP |WS_VISIBLE ,184,109,71,60,0x0,0
CONTROL "Configure",107,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,266,95,56,14,0x0,0
CONTROL "NES-style Input Ports",108,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,10,66,328,79,0x0,0
CONTROL "Famicom Expansion Port:",109,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,10,153,165,55,0x0,0
CONTROL "",110,"COMBOBOX",CBS_DROPDOWNLIST |WS_CHILD |WS_VSCROLL |WS_TABSTOP |WS_VISIBLE ,16,182,84,60,0x0,0
CONTROL "Configure",111,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,111,168,56,14,0x0,0
CONTROL "",65535,"STATIC",SS_BLACKFRAME |WS_CHILD |WS_VISIBLE ,24,93,71,12,0x0,0
CONTROL "",65535,"STATIC",SS_BLACKFRAME |WS_CHILD |WS_VISIBLE ,184,93,71,12,0x0,0
CONTROL "",65535,"STATIC",SS_BLACKFRAME |WS_CHILD |WS_VISIBLE ,16,166,84,12,0x0,0
CONTROL "",200,"STATIC",SS_CENTER |WS_CHILD |WS_GROUP |WS_VISIBLE ,27,94,65,10,0x0,0
CONTROL "",201,"STATIC",SS_CENTER |WS_CHILD |WS_GROUP |WS_VISIBLE ,187,94,65,10,0x0,0
CONTROL "",202,"STATIC",SS_CENTER |WS_CHILD |WS_GROUP |WS_VISIBLE ,19,167,78,10,0x0,0
CONTROL "Auto-Hold:",112,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,189,156,45,14,0x0,0
CONTROL "not assigned",115,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,241,159,92,8,0x0,0
CONTROL "Clear AH:",114,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,189,170,45,14,0x0,0
CONTROL "not assigned",116,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,241,172,89,8,0x0,0
END
MAHJONGDIALOG DIALOG -26, 106, 216, 91
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "mahjong"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,110,73,56,14
CONTROL "",302,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,8,8,200,55
CONTROL "1",300,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,72,40,16,12
CONTROL "2",301,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,94,40,16,12
CONTROL "3",302,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,116,40,16,12
CONTROL "4",303,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,138,40,16,12
CONTROL "5",304,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,160,40,16,12
CONTROL "6",305,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,182,40,16,12
END
MAPINPUT DIALOG 0, 0, 322, 293
STYLE DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_SYSMENU |WS_CAPTION
CAPTION "Hotkeys"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "OK",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,265,274,50,14
CONTROL "Cancel",2,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,209,274,50,14
CONTROL "List2",1003,"SysListView32",LVS_REPORT |LVS_ALIGNTOP |LVS_NOSORTHEADER |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,7,7,308,243
CONTROL "Restore Defaults",200,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,7,274,75,14
CONTROL "",300,"COMBOBOX",CBS_DROPDOWN |WS_CHILD |WS_VSCROLL |WS_TABSTOP |WS_VISIBLE ,32,255,283,193
CONTROL "Filter:",65535,"STATIC",SS_CENTERIMAGE |SS_RIGHT |WS_CHILD |WS_VISIBLE ,6,255,21,12
END
MEMVIEW DIALOG 48, 71, 263, 237
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_OVERLAPPED |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Memory Viewer"
FONT 8, "Fixedsys"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,200,218,56,14
CONTROL "",100,"EDIT",ES_READONLY |ES_MULTILINE |ES_CENTER |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,6,4,237,132
CONTROL "",200,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,14,167,19,12
CONTROL "",201,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,42,167,14,12
CONTROL "Poke Me!",202,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,68,156,42,14
CONTROL "Memory Poke",102,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,6,146,111,48
CONTROL "",103,"SCROLLBAR",SBS_VERT |WS_CHILD |WS_VISIBLE ,244,4,9,132
CONTROL "Memory File Dump",104,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,118,146,143,33
CONTROL "",210,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,133,160,19,12
CONTROL "",211,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,189,160,19,12
CONTROL "through",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,156,162,29,8
CONTROL "Dump Me!",212,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,213,159,42,14
CONTROL "Memory File Load",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,6,200,102,33
CONTROL "",220,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,21,213,19,12
CONTROL "Load!",222,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,56,211,42,14
CONTROL "HL Store",203,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,68,176,42,14
END
MESSAGELOG DIALOG 33, 38, 370, 184
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Message Log"
FONT 9, "Terminal"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,299,157,56,14
CONTROL "",100,"EDIT",ES_READONLY |ES_AUTOVSCROLL |ES_MULTILINE |ES_LEFT |WS_CHILD |WS_BORDER |WS_VSCROLL |WS_TABSTOP |WS_VISIBLE ,19,15,339,130
END
NETMOO DIALOG 44, 59, 350, 202
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_OVERLAPPED |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Network Play"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "",102,"EDIT",ES_WANTRETURN |ES_OEMCONVERT |ES_AUTOHSCROLL |ES_AUTOVSCROLL |ES_MULTILINE |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,0,129,350,12
CONTROL "",101,"EDIT",ES_READONLY |ES_AUTOVSCROLL |ES_MULTILINE |ES_LEFT |WS_CHILD |WS_BORDER |WS_VSCROLL |WS_TABSTOP |WS_VISIBLE ,0,0,350,130
CONTROL "Remote Host:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,3,157,48,8
CONTROL "",200,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,54,155,90,12
CONTROL "",201,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,145,155,27,12
CONTROL "Settings",100,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,0,145,350,55
CONTROL "Connect",250,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,290,153,56,14
CONTROL "",203,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,276,172,70,12
CONTROL "Local Players:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,181,157,46,8
CONTROL "Nickname:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,232,175,40,8
CONTROL "",204,"COMBOBOX",CBS_DROPDOWNLIST |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,232,155,28,51
CONTROL "Game Key:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,121,174,39,8
CONTROL "",205,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,163,172,67,12
CONTROL "Password:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,13,174,37,8
CONTROL "",206,"EDIT",ES_PASSWORD |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,54,172,67,12
END
NETPLAYCONFIG DIALOG 33, 49, 230, 200
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Netplay Configuration"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,163,173,56,14
CONTROL "Network play will commence when a new game is loaded.",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,5,211,20
CONTROL "",101,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,66,66,135,12
CONTROL "Client",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,9,34,198,66
CONTROL "",100,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,97,47,29,12
CONTROL "Enable network play.",300,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,12,170,102,12
CONTROL "Server",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,9,110,198,52
CONTROL "Listen on TCP port:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,15,125,68,8
CONTROL "",200,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,85,124,29,12
CONTROL "Local UDP port:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,16,49,62,8
CONTROL "Remote host:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,16,68,50,8
CONTROL "Remote TCP Port:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,101,84,61,8
CONTROL "",102,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,163,82,29,12
CONTROL "",302,"Button",WS_CHILD |WS_VISIBLE |0x9,5,34,9,8
CONTROL "",301,"Button",WS_CHILD |WS_VISIBLE |0x9,5,110,9,8
END
NEWINPUT DIALOG 0, 0, 186, 66
STYLE DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_SYSMENU |WS_CAPTION
CAPTION "Enter New Input"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Cancel",202,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,40,45,50,14
CONTROL "",100,"STATIC",SS_CENTER |WS_CHILD |WS_GROUP |WS_VISIBLE ,47,14,90,12
CONTROL "Clear",200,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,95,45,50,14
END
OPENMOVIE DIALOG 0, 0, 381, 183
STYLE DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_SYSMENU |WS_CAPTION
CAPTION "Replay Movie"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "OK",101,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,267,162,50,14
CONTROL "Cancel",102,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,324,162,50,14
CONTROL "",201,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,7,24,310,14
CONTROL "Movie File:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,7,13,132,10
CONTROL "Open as Read-Only",203,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,7,42,78,10
CONTROL "Number of Frames:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,14,70,79,8
CONTROL "Length:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,14,81,79,8
CONTROL "Re-record Count:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,14,92,79,8
CONTROL "Author Info:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,14,103,79,8
CONTROL "FRAMES",301,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,96,70,79,8
CONTROL "LENGTH",302,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,96,81,79,8
CONTROL "RERECORD",303,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,96,92,79,8
CONTROL "AUTHOR",304,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,96,103,278,8
CONTROL "Recorded from:",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,7,118,103,31
CONTROL "Now",401,"Button",WS_CHILD |WS_GROUP |WS_VISIBLE |0x9,19,132,31,10
CONTROL "Reset",402,"Button",WS_CHILD |WS_VISIBLE |0x9,59,132,35,10
CONTROL "Browse...",202,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,324,24,50,14
END
PALCONFIG DIALOG 16, 81, 216, 141
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Palette Configuration"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,151,122,56,14
CONTROL "The \x22NES Palette\x22 section's options will only affect NTSC NES games. NTSC Color Emulation will override any loaded custom palette.",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,5,6,207,28
CONTROL "NES Palette",302,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,1,37,102,81
CONTROL "&Load Palette...",200,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,12,55,58,14
CONTROL "&Reset to Default Palette",201,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,12,78,85,14
CONTROL "Enabled",100,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,113,51,87,12
CONTROL "Tint",500,"msctls_trackbar32",WS_CHILD |WS_TABSTOP |WS_VISIBLE ,111,73,91,11
CONTROL "NTSC Color Emulation",101,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,106,37,103,81
CONTROL "Hue",501,"msctls_trackbar32",WS_CHILD |WS_TABSTOP |WS_VISIBLE ,112,98,91,11
CONTROL "Hue",65535,"STATIC",SS_CENTER |WS_CHILD |WS_GROUP |WS_VISIBLE ,115,88,85,8
CONTROL "Tint",65535,"STATIC",SS_CENTER |WS_CHILD |WS_GROUP |WS_VISIBLE ,114,63,85,8
END
POWERPADDIALOG DIALOG 30, 123, 131, 119
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Power Pad Configuration"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,34,95,56,14
CONTROL "",302,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,8,10,114,74
CONTROL "1",300,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,21,23,16,12
CONTROL "2",301,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,43,23,16,12
CONTROL "3",302,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,70,23,16,12
CONTROL "4",303,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,91,23,16,12
CONTROL "5",304,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,21,41,16,12
CONTROL "6",305,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,43,41,16,12
CONTROL "7",306,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,70,41,16,12
CONTROL "8",307,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,91,41,16,12
CONTROL "9",308,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,21,59,16,12
CONTROL "10",309,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,43,59,16,12
CONTROL "11",310,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,70,59,16,12
CONTROL "12",311,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,91,59,16,12
END
QUIZKINGDIALOG DIALOG 30, 123, 160, 74
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "quiz king"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,54,56,56,14
CONTROL "Buzzers",302,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,8,7,144,39
CONTROL "1",300,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,16,23,16,12
CONTROL "2",301,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,38,23,16,12
CONTROL "3",302,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,60,23,16,12
CONTROL "4",303,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,82,23,16,12
CONTROL "5",304,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,104,23,16,12
CONTROL "6",305,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,126,23,16,12
END
SOUNDCONFIG DIALOGEX 8, 95, 371, 152, 0
EXSTYLE 0
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Sound Configuration"
FONT 8, "MS Sans Serif", 0, 0, 0
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,304,132,56,14,0x0,0
CONTROL "Set various sound options here. The default sound buffering length is rather conservative. Lower settings are probably possible and will reduce sound latency.",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,12,4,350,19,0x0,0
CONTROL "Output/Output Format:",302,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,12,30,130,97,0x0,0
CONTROL "Sound enabled.",126,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,20,48,117,12,0x0,0
CONTROL "Force 8-bit sound.",122,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,20,63,117,11,0x0,0
CONTROL "Rate:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,20,106,34,10,0x0,0
CONTROL "Hz",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,118,107,15,9,0x0,0
CONTROL "Buffering:",127,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,154,30,126,97,0x0,0
CONTROL "Use secondary sound buffer...",123,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,162,44,112,12,0x0,0
CONTROL "...with global focus.",124,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,170,56,100,12,0x0,0
CONTROL "Length of Sound to Buffer:",65535,"STATIC",SS_CENTER |WS_CHILD |WS_GROUP |WS_VISIBLE ,164,73,107,8,0x0,0
CONTROL "",128,"msctls_trackbar32",WS_CHILD |WS_TABSTOP |WS_VISIBLE ,164,98,107,13,0x0,0
CONTROL "Volume",125,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,298,29,58,86,0x0,0
CONTROL "",500,"msctls_trackbar32",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0xB,312,38,28,75,0x0,0
CONTROL "15 ms",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,161,112,20,8,0x0,0
CONTROL "200 ms",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,252,112,25,8,0x0,0
CONTROL "ms",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,217,86,19,8,0x0,0
CONTROL "",666,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,195,86,20,8,0x0,0
CONTROL "",200,"COMBOBOX",CBS_DROPDOWNLIST |WS_CHILD |WS_VSCROLL |WS_TABSTOP |WS_VISIBLE ,59,104,53,46,0x0,0
CONTROL "",129,"COMBOBOX",CBS_DROPDOWNLIST |WS_CHILD |WS_VSCROLL |WS_TABSTOP |WS_VISIBLE ,59,79,77,46,0x0,0
CONTROL "Quality:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,20,80,35,10,0x0,0
CONTROL "Mute frame advance.",130,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,20,134,117,11,0x0,0
CONTROL "Use old update code.",131,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,162,135,117,11,0x0,0
END
TIMINGCONFIG DIALOG 23, 157, 198, 78
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Timing Configuration"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,126,54,56,14
CONTROL "Disable speed throttling used when sound is disabled.",101,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,9,12,198,12
CONTROL "Set high-priority thread.",105,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,9,28,146,12
END
VIDEOCONFIG DIALOG -16, 76, 378, 296
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Video Configuration"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "For the custom video mode settings to be in effect, the \x22Custom\x22 video mode needs to be selected. If you select a sync method, and sound is disabled, you may want to disable speed throttling(in the \x22Timing\x22 window). If you use \x22wait for vblank\x22, you should use the \x22lazy\x22 form.\x0AAllowing more than 8 sprites per scanline can cause graphics corruption in some games, including \x22Solstice\x22.",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,11,4,347,43
CONTROL "Full Screen Settings",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,13,50,346,112
CONTROL "Full Screen",101,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,23,64,60,12
CONTROL "Enter full screen mode after file is loaded.",102,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,23,79,141,12
CONTROL "Sync Method:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,19,97,52,10
CONTROL "",105,"COMBOBOX",CBS_DROPDOWNLIST |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,76,94,89,50
CONTROL "Video Mode:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,19,113,42,10
CONTROL "",100,"COMBOBOX",CBS_DROPDOWNLIST |WS_CHILD |WS_VSCROLL |WS_TABSTOP |WS_VISIBLE ,64,112,101,52
CONTROL "Disable hardware acceleration.",131,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,20,142,147,12
CONTROL "Custom Video Mode",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,169,60,190,99
CONTROL "Mode:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,177,73,25,8
CONTROL "",200,"EDIT",ES_RIGHT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,205,71,27,12
CONTROL "by",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,236,73,11,8
CONTROL "",201,"EDIT",ES_RIGHT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,249,71,27,12
CONTROL "@",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,280,73,12,8
CONTROL "",202,"COMBOBOX",CBS_DROPDOWNLIST |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,292,70,35,60
CONTROL "bpp",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,332,72,24,8
CONTROL "Image Size Transform",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,175,97,170,60
CONTROL "Special scaler:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,183,112,60,8
CONTROL "",304,"COMBOBOX",CBS_DROPDOWNLIST |WS_CHILD |WS_VSCROLL |WS_TABSTOP |WS_VISIBLE ,286,109,49,46
CONTROL "Scale dimensions by:",300,"Button",WS_CHILD |WS_VISIBLE |0x9,184,127,85,12
CONTROL "Stretch to Fill Screen",301,"Button",WS_CHILD |WS_VISIBLE |0x9,184,142,88,12
CONTROL "X:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,273,130,10,8
CONTROL "",302,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,283,127,20,12
CONTROL "Y:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,307,130,11,8
CONTROL "",303,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,317,127,20,12
CONTROL "Windowed Settings",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,13,165,167,118
CONTROL "Size Multiplier:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,19,184,60,8
CONTROL "X:",65535,"STATIC",SS_CENTER |WS_CHILD |WS_GROUP |WS_VISIBLE ,81,172,29,8
CONTROL "Y:",65535,"STATIC",SS_CENTER |WS_CHILD |WS_GROUP |WS_VISIBLE ,125,172,31,8
CONTROL "",400,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,78,183,35,12
CONTROL "",401,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,122,183,35,12
CONTROL "Force integral scaling factors.",402,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,20,203,147,12
CONTROL "Force aspect ratio correction.",403,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,20,217,147,12
CONTROL "Sync Method:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,19,250,60,8
CONTROL "",104,"COMBOBOX",CBS_DROPDOWNLIST |WS_CHILD |WS_VSCROLL |WS_TABSTOP |WS_VISIBLE ,83,248,88,47
CONTROL "Disable hardware acceleration.",130,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,20,264,147,12
CONTROL "Drawing Area",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,184,165,172,74
CONTROL "First Line:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,201,189,39,8
CONTROL "Last Line:",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,201,209,43,8
CONTROL "NTSC",65535,"STATIC",SS_CENTER |WS_CHILD |WS_GROUP |WS_VISIBLE ,244,176,26,8
CONTROL "PAL",65535,"STATIC",SS_CENTER |WS_CHILD |WS_GROUP |WS_VISIBLE ,295,176,26,8
CONTROL "",500,"EDIT",ES_RIGHT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,246,188,27,12
CONTROL "",501,"EDIT",ES_RIGHT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,246,207,27,12
CONTROL "",502,"EDIT",ES_RIGHT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,296,188,27,12
CONTROL "",503,"EDIT",ES_RIGHT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,296,207,27,12
CONTROL "Clip left and right sides(8 columns on each).",106,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,195,224,157,12
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,321,282,56,14
CONTROL "Current Pixel Aspect Ratio:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,21,232,92,8
CONTROL "",404,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,120,231,23,12
CONTROL ":",65535,"STATIC",SS_CENTER |WS_CHILD |WS_GROUP |WS_VISIBLE ,145,233,8,8
CONTROL "",405,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,154,231,22,12
CONTROL "Allow more than 8 sprites per scanline.",600,"Button",WS_CHILD |WS_TABSTOP |WS_VISIBLE |0x3,194,256,136,11
CONTROL "Emulation",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_GROUP |WS_VISIBLE ,184,243,172,32
END
DWBDIALOGSIMPLE DIALOGEX 33, 99, 250, 39, 0
EXSTYLE 0
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "DWBS!"
FONT 8, "MS Sans Serif", 0, 0, 0
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Type a key, or press Escape to disable.",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,53,14,125,8,0x0,0
END
MEMWATCH DIALOG 0, 0, 262, 247
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Memory Watch"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "",1001,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,5,15,30,14
CONTROL "",1000,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,40,15,55,14
CONTROL "",1004,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,5,30,30,14
CONTROL "",1003,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,40,30,55,14
CONTROL "",1007,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,5,45,30,14
CONTROL "",1006,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,40,45,55,14
CONTROL "",1010,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,5,60,30,14
CONTROL "",1009,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,40,60,55,14
CONTROL "",1013,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,5,75,30,14
CONTROL "",1012,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,40,75,55,14
CONTROL "",1016,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,5,90,30,14
CONTROL "",1015,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,40,90,55,14
CONTROL "",1019,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,5,105,30,14
CONTROL "",1018,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,40,105,55,14
CONTROL "",1022,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,5,120,30,14
CONTROL "",1021,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,40,120,55,14
CONTROL "",1025,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,5,135,30,14
CONTROL "",1024,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,40,135,55,14
CONTROL "",1028,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,5,150,30,14
CONTROL "",1027,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,40,150,55,14
CONTROL "",1031,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,5,165,30,14
CONTROL "",1030,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,40,165,55,14
CONTROL "",1034,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,5,180,30,14
CONTROL "",1033,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,40,180,55,14
CONTROL "",1037,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,135,15,30,14
CONTROL "",1036,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,171,15,55,14
CONTROL "",1040,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,135,30,30,14
CONTROL "",1039,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,171,30,55,14
CONTROL "",1043,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,135,45,30,14
CONTROL "",1042,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,171,45,55,14
CONTROL "",1046,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,135,60,30,14
CONTROL "",1045,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,171,60,55,14
CONTROL "",1049,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,135,75,30,14
CONTROL "",1048,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,171,75,55,14
CONTROL "",1052,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,135,90,30,14
CONTROL "",1051,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,171,90,55,14
CONTROL "",1055,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,135,105,30,14
CONTROL "",1054,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,171,105,55,14
CONTROL "",1058,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,135,120,30,14
CONTROL "",1057,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,171,120,55,14
CONTROL "",1061,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,135,135,30,14
CONTROL "",1060,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,171,135,55,14
CONTROL "",1064,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,135,150,30,14
CONTROL "",1063,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,171,150,55,14
CONTROL "",1067,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,135,165,30,14
CONTROL "",1066,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,171,165,55,14
CONTROL "",1070,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,135,180,30,14
CONTROL "",1069,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,171,180,55,14
CONTROL "Clear",103,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,5,200,45,14
CONTROL "Save...",101,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,73,200,45,14
CONTROL "Load...",102,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,141,200,45,14
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,209,200,45,14
CONTROL "Name",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,40,5,20,8
CONTROL "Address",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,5,5,26,8
CONTROL "Value",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,100,5,19,8
CONTROL "",1002,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,100,15,25,14
CONTROL "",1005,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,100,30,25,14
CONTROL "",1008,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,100,45,25,14
CONTROL "",1011,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,100,60,25,14
CONTROL "",1014,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,100,75,25,14
CONTROL "",1017,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,100,90,25,14
CONTROL "",1020,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,100,105,25,14
CONTROL "",1023,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,100,120,25,14
CONTROL "",1026,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,100,135,25,14
CONTROL "",1029,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,100,150,25,14
CONTROL "",1032,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,100,165,25,14
CONTROL "",1035,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,100,180,25,14
CONTROL "",1038,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,231,15,25,14
CONTROL "",1041,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,231,30,25,14
CONTROL "",1044,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,231,45,25,14
CONTROL "",1047,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,231,60,25,14
CONTROL "",1050,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,231,75,25,14
CONTROL "",1053,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,231,90,25,14
CONTROL "",1056,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,231,105,25,14
CONTROL "",1059,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,231,120,25,14
CONTROL "",1062,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,231,135,25,14
CONTROL "",1065,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,231,150,25,14
CONTROL "",1068,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,231,165,25,14
CONTROL "",1071,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,231,180,25,14
CONTROL "Name",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,171,5,20,8
CONTROL "Address",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,135,5,26,8
CONTROL "Value",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,231,5,19,8
CONTROL "Use a prefix of '!' to watch 2 bytes, 'x' to view in hex, and 'X' to view a 2-byte value in hex.",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,5,222,250,18
END
BASICBOT DIALOG 0, 0, 372, 335
STYLE DS_3DLOOK |DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
CAPTION "Basic Bot"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
CONTROL "Close",1,"BUTTON",BS_DEFPUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,330,5,35,14
CONTROL "Player 1",2000,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,5,0,220,140
CONTROL "A",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,20,20,8
CONTROL "B",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,35,20,8
CONTROL "Select",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,50,20,8
CONTROL "Start",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,65,20,8
CONTROL "Up",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,80,20,8
CONTROL "Down",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,95,20,8
CONTROL "Left",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,110,20,8
CONTROL "Right",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,10,125,20,8
CONTROL "Probability (0 to 1000)",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,35,10,69,8
CONTROL "",1000,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,35,20,185,12
CONTROL "",1001,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,35,35,185,12
CONTROL "",1002,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,35,50,185,12
CONTROL "",1003,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,35,65,185,12
CONTROL "",1004,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,35,80,185,12
CONTROL "",1005,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,35,95,185,12
CONTROL "",1006,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,35,110,185,12
CONTROL "",1007,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,35,125,185,12
CONTROL "Edit Player 2",1008,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,170,5,50,14
CONTROL "End when:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,15,166,35,8
CONTROL "",1009,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,55,166,165,12
CONTROL "Maximize:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,21,195,32,8
CONTROL "",1010,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,55,195,165,12
CONTROL "Tiebreak 1:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,15,210,37,8
CONTROL "",1011,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,55,210,165,12
CONTROL "Tiebreak 2:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,15,225,37,8
CONTROL "",1012,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,55,225,165,12
CONTROL "Tiebreak 3:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,15,241,37,8
CONTROL "",1013,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,55,241,165,12
CONTROL "Goal",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,5,145,220,115
CONTROL "Save...",1014,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,280,5,40,14
CONTROL "Load...",1015,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,230,5,40,14
CONTROL "Result",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,230,80,135,180
CONTROL "Run!",1016,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,330,30,35,15
CONTROL "",1017,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_VISIBLE ,270,65,90,12
CONTROL "Clear",1036,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,230,30,40,14
CONTROL "",1037,"EDIT",ES_READONLY |ES_LEFT |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,270,50,90,12
CONTROL "",1018,"EDIT",ES_READONLY |ES_MULTILINE |ES_LEFT |WS_CHILD |WS_VISIBLE ,255,90,105,12
CONTROL "Probability (0 to 1000)",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,55,155,69,8
CONTROL "Function",65535,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,55,185,28,8
CONTROL "",1019,"EDIT",ES_WANTRETURN |ES_READONLY |ES_AUTOVSCROLL |ES_MULTILINE |ES_LEFT |WS_CHILD |WS_VSCROLL |WS_VISIBLE ,235,105,125,150
CONTROL "Attempts",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,235,50,30,8
CONTROL "Frames",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,235,65,30,8
CONTROL "Best:",65535,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,235,90,17,8
CONTROL "Play Best",1021,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,280,30,40,14
CONTROL "Extra Commands (executed before Goal, after Input)",65535,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,5,260,360,75
CONTROL "",1020,"EDIT",ES_WANTRETURN |ES_AUTOVSCROLL |ES_MULTILINE |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,10,270,350,30
CONTROL "",1022,"EDIT",ES_WANTRETURN |ES_AUTOVSCROLL |ES_MULTILINE |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,10,300,350,30
END

Binary file not shown.

BIN
drivers/win/res/ICON_1.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
drivers/win/res/ICON_2.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -81,7 +81,7 @@ void CheckDStatus(void)
}
}
static uint32_t RawCanWrite(void)
static uint32 RawCanWrite(void)
{
DWORD CurWritePos,CurPlayPos=0;
@ -99,14 +99,14 @@ static uint32_t RawCanWrite(void)
assume DirectSound has wrapped around.
*/
if(((int32_t)ToWritePos-(int32_t)CurWritePos) >= (DSBufferSize/2))
if(((int32)ToWritePos-(int32)CurWritePos) >= (DSBufferSize/2))
{
CurWritePos+=DSBufferSize;
//FCEU_printf("Fixit: %d,%d,%d\n",ToWritePos,CurWritePos,CurWritePos-DSBufferSize);
}
if(ToWritePos<CurWritePos)
{
int32_t howmuch=(int32_t)CurWritePos-(int32_t)ToWritePos;
int32 howmuch=(int32)CurWritePos-(int32)ToWritePos;
if(howmuch > BufHowMuch) /* Oopsie. Severe buffer overflow... */
{
//FCEU_printf("Ack");
@ -130,9 +130,9 @@ int32 GetMaxSound(void)
return( BufHowMuch >> bittage);
}
static int RawWrite(void *data, uint32_t len)
static int RawWrite(void *data, uint32 len)
{
uint32_t cw;
//uint32 cw; //mbg merge 7/17/06 removed
//printf("Pre: %d\n",SexyALI_DSound_RawCanWrite(device));
//fflush(stdout);
@ -148,7 +148,7 @@ static int RawWrite(void *data, uint32_t len)
{
VOID *LockPtr[2]={0,0};
DWORD LockLen[2]={0,0};
int32_t curlen;
uint32 curlen; //mbg merge 7/17/06 changed to uint
// THIS LIMITS THE EMULATION SPEED
if((!NoWaiting) || (soundoptions&SO_OLDUP))
@ -182,7 +182,7 @@ static int RawWrite(void *data, uint32_t len)
{
/* not mute */
memcpy(LockPtr[0],data,LockLen[0]);
memcpy(LockPtr[1],data+LockLen[0],len-LockLen[0]);
memcpy(LockPtr[1],(char*)data+LockLen[0],len-LockLen[0]); //mbg merge 7/17/06 added cast
}
}
else if(LockPtr[0])
@ -204,7 +204,7 @@ static int RawWrite(void *data, uint32_t len)
ToWritePos=(ToWritePos+curlen)%DSBufferSize;
len-=curlen;
(uint8_t *) data+=curlen;
data=(uint8 *)data+curlen; //mbg merge 7/17/06 reworked to be type proper
if(len && !NoWaiting && (fps_scale <= 256 || (soundoptions&SO_OLDUP)))
Sleep(1); // do some extra sleeping if we think there's time and we're not scaling up the FPS or in turbo mode

View File

@ -149,7 +149,9 @@ static int InitializeDDraw(int fs)
return 0;
}
ddrval = IDirectDraw_QueryInterface(lpDD,&IID_IDirectDraw7,(LPVOID *)&lpDD7);
//mbg merge 7/17/06 changed:
ddrval = IDirectDraw_QueryInterface(lpDD,IID_IDirectDraw7,(LPVOID *)&lpDD7);
//ddrval = IDirectDraw_QueryInterface(lpDD,&IID_IDirectDraw7,(LPVOID *)&lpDD7);
IDirectDraw_Release(lpDD);
if (ddrval != DD_OK)
@ -183,10 +185,11 @@ static int GetBPP(void)
if(ddpix.dwFlags&DDPF_RGB)
{
bpp=ddpix.DUMMYUNIONNAMEN(1).dwRGBBitCount;
CBM[0]=ddpix.DUMMYUNIONNAMEN(2).dwRBitMask;
CBM[1]=ddpix.DUMMYUNIONNAMEN(3).dwGBitMask;
CBM[2]=ddpix.DUMMYUNIONNAMEN(4).dwBBitMask;
//mbg merge 7/17/06 removed silly dummy union stuff now that we have c++
bpp=ddpix.dwRGBBitCount;
CBM[0]=ddpix.dwRBitMask;
CBM[1]=ddpix.dwGBitMask;
CBM[2]=ddpix.dwBBitMask;
}
else
{
@ -467,8 +470,7 @@ void FCEUD_BlitScreen(uint8 *XBuf)
static void FixPaletteHi(void)
{
int x;
SetPaletteBlitToHigh(color_palette);
SetPaletteBlitToHigh((uint8*)color_palette); //mbg merge 7/17/06 added cast
}
static void BlitScreenWindow(unsigned char *XBuf)
@ -505,8 +507,9 @@ static void BlitScreenWindow(unsigned char *XBuf)
return;
}
pitch=ddsdback.DUMMYUNIONNAMEN(1).lPitch;
ScreenLoc=ddsdback.lpSurface;
//mbg merge 7/17/06 removing dummyunion stuff
pitch=ddsdback.lPitch;
ScreenLoc=(unsigned char*)ddsdback.lpSurface; //mbg merge 7/17/06 added cst
if(veflags&1)
{
memset(ScreenLoc,0,pitch*240);
@ -531,8 +534,8 @@ static void BlitScreenFull(uint8 *XBuf)
{
static int pitch;
char *ScreenLoc;
unsigned long x;
uint8 y;
//unsigned long x; //mbg merge 7/17/06 removed
//uint8 y; //mbg merge 7/17/06 removed
RECT srect,drect;
LPDIRECTDRAWSURFACE7 lpDDSVPrimary;
int specmul; // Special scaler size multiplier
@ -573,8 +576,8 @@ static void BlitScreenFull(uint8 *XBuf)
if(ddrval==DDERR_SURFACELOST) RestoreDD(1);
return;
}
ScreenLoc=ddsdback.lpSurface;
pitch=ddsdback.DUMMYUNIONNAMEN(1).lPitch;
ScreenLoc=(char *)ddsdback.lpSurface; //mbg merge 7/17/06 added cast
pitch=ddsdback.lPitch; //mbg merge 7/17/06 removed dummyunion stuff
srect.top=0;
srect.left=0;
@ -605,8 +608,8 @@ static void BlitScreenFull(uint8 *XBuf)
return;
}
ScreenLoc=ddsd.lpSurface;
pitch=ddsd.DUMMYUNIONNAMEN(1).lPitch;
ScreenLoc=(char*)ddsd.lpSurface; //mbg merge 7/17/06 added cast
pitch=ddsd.lPitch; //mbg merge 7/17/06 removing dummyunion stuff
}
if(veflags&1)
@ -624,6 +627,8 @@ static void BlitScreenFull(uint8 *XBuf)
veflags&=~1;
}
//mbg 6/29/06 merge
#ifndef MSVC
if(vmod==5)
{
if(eoptions&EO_CLIPSIDES)
@ -723,6 +728,8 @@ static void BlitScreenFull(uint8 *XBuf)
}
}
else
#endif
//mbg 6/29/06 merge
{
if(!(vmodes[vmod].flags&VMDF_DXBLT))
{
@ -734,15 +741,15 @@ static void BlitScreenFull(uint8 *XBuf)
if(bpp>=16)
{
Blit8ToHigh(XBuf+srendline*256+VNSCLIP,ScreenLoc, VNSWID, totallines, pitch,specmul,specmul);
Blit8ToHigh(XBuf+srendline*256+VNSCLIP,(uint8*)ScreenLoc, VNSWID, totallines, pitch,specmul,specmul); //mbg merge 7/17/06 added cast
}
else
{
XBuf+=srendline*256+VNSCLIP;
if(vmodes[vmod].special)
Blit8To8(XBuf,ScreenLoc, VNSWID, totallines, pitch,vmodes[vmod].xscale,vmodes[vmod].yscale,0,vmodes[vmod].special);
Blit8To8(XBuf,(uint8*)ScreenLoc, VNSWID, totallines, pitch,vmodes[vmod].xscale,vmodes[vmod].yscale,0,vmodes[vmod].special); //mbg merge 7/17/06 added cast
else
Blit8To8(XBuf,ScreenLoc, VNSWID, totallines, pitch,1,1,0,0);
Blit8To8(XBuf,(uint8*)ScreenLoc, VNSWID, totallines, pitch,1,1,0,0); //mbg merge 7/17/06 added cast
}
}
@ -754,7 +761,7 @@ static void BlitScreenFull(uint8 *XBuf)
{
if(IDirectDrawSurface7_Lock(lpDDSVPrimary,NULL,&ddsd, 0, NULL)==DD_OK)
{
memset(ddsd.lpSurface,0,ddsd.DUMMYUNIONNAMEN(1).lPitch*vmodes[vmod].y);
memset(ddsd.lpSurface,0,ddsd.lPitch*vmodes[vmod].y); //mbg merge 7/17/06 removing dummyunion stuff
IDirectDrawSurface7_Unlock(lpDDSVPrimary, NULL);
veflags&=~2;
}
@ -895,7 +902,7 @@ BOOL SetDlgItemDouble(HWND hDlg, int item, double value)
{
char buf[8];
sprintf(buf,"%.6f",value);
SetDlgItemText(hDlg, item, buf);
return SetDlgItemText(hDlg, item, buf); //mbg merge 7/17/06 added this return value
}
double GetDlgItemDouble(HWND hDlg, int item)

View File

@ -213,7 +213,7 @@ void AddRecent(char *fn)
if(rfiles[9]) free(rfiles[9]);
for(x=9;x;x--) rfiles[x]=rfiles[x-1];
rfiles[0]=malloc(strlen(fn)+1);
rfiles[0]=(char*)malloc(strlen(fn)+1); //mbg merge 7/17/06 added cast
strcpy(rfiles[0],fn);
UpdateRMenu(recentmenu, rfiles, 102, 600);
}
@ -240,7 +240,7 @@ void AddRecentDir(char *fn)
if(rdirs[9]) free(rdirs[9]);
for(x=9;x;x--) rdirs[x]=rdirs[x-1];
rdirs[0]=malloc(strlen(fn)+1);
rdirs[0]=(char *)malloc(strlen(fn)+1); //mbg merge 7/17/06 added cast
strcpy(rdirs[0],fn);
UpdateRMenu(recentdmenu, rdirs, 103, 700);
}
@ -343,7 +343,7 @@ void LoadNewGamey(HWND hParent, char *initialdir)
{
char *tmpdir;
if((tmpdir=malloc(ofn.nFileOffset+1)))
if((tmpdir=(char *)malloc(ofn.nFileOffset+1))) //mbg merge 7/17/06 added cast
{
strncpy(tmpdir,ofn.lpstrFile,ofn.nFileOffset);
tmpdir[ofn.nFileOffset]=0;
@ -397,6 +397,11 @@ static int vchanged=0;
extern void RestartMovieOrReset(int pow);
int KeyboardSetBackgroundAccess(int on); //mbg merge 7/17/06 YECH had to add
void SetJoystickBackgroundAccess(int background); //mbg merge 7/17/06 YECH had to add
void ShowNetplayConsole(void); //mbg merge 7/17/06 YECH had to add
int FCEUMOV_IsPlaying(void); //mbg merge 7/17/06 YECH had to add
void MapInput(void);
@ -478,10 +483,10 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
UINT len;
char *ftmp;
len=DragQueryFile((HANDLE)wParam,0,0,0)+1;
if((ftmp=malloc(len)))
len=DragQueryFile((HDROP)wParam,0,0,0)+1; //mbg merge 7/17/06 changed (HANDLE) to (HDROP)
if((ftmp=(char*)malloc(len))) //mbg merge 7/17/06 added cast
{
DragQueryFile((HANDLE)wParam,0,ftmp,len);
DragQueryFile((HDROP)wParam,0,ftmp,len); //mbg merge 7/17/06 changed (HANDLE) to (HDROP)
ALoad(ftmp);
free(ftmp);
}
@ -648,7 +653,8 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
#endif
case 204:ConfigAddCheat(hWnd);break;
case 205:CreateMemWatch(hWnd);break;
//mbg merge TODO 7/17/06 - had to remove this
//case 205:CreateMemWatch(hWnd);break;
case 100:StopSound();
LoadNewGamey(hWnd, 0);
break;
@ -868,8 +874,8 @@ void FixWXY(int pref)
void UpdateFCEUWindow(void)
{
int w,h;
RECT wrect;
//int w,h; //mbg merge 7/17/06 removed
// RECT wrect; //mbg merge 7/17/06 removed
if(vchanged && !fullscreen && !changerecursive && !nofocus)
{
@ -922,7 +928,7 @@ int CreateMainWindow(void)
winclass.hIcon=LoadIcon(fceu_hInstance, "ICON_1");
winclass.hIconSm=LoadIcon(fceu_hInstance, "ICON_1");
winclass.hCursor=LoadCursor(NULL, IDC_ARROW);
winclass.hbrBackground=GetStockObject(BLACK_BRUSH);
winclass.hbrBackground=(HBRUSH)GetStockObject(BLACK_BRUSH); //mbg merge 7/17/06 added cast
//winclass.lpszMenuName="FCEUMENU";
winclass.lpszClassName="FCEULTRA";
@ -1295,7 +1301,7 @@ static BOOL CALLBACK DirConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
continue;
}
len++; // Add 1 for null character.
if(!(DOvers[x]=malloc(len)))
if(!(DOvers[x]=(char*)malloc(len))) //mbg merge 7/17/06 added cast
continue;
if(!GetDlgItemText(hwndDlg,100+x,DOvers[x],len))
{
@ -1692,7 +1698,7 @@ static BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
globBase[strlen(globBase)-5]='\0';
extern char FileBase[];
char szFindPath[512];
//char szFindPath[512]; //mbg merge 7/17/06 removed
WIN32_FIND_DATA wfd;
HANDLE hFind;
@ -1747,7 +1753,7 @@ static BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
{
if(fcm)
{
int k, count1=0, count2=0;
unsigned int k, count1=0, count2=0; //mbg merge 7/17/06 changed to uint
for(k=0;k<strlen(md51);k++) count1 += md51[k]-'0';
for(k=0;k<strlen(md52);k++) count2 += md52[k]-'0';
if(count1 && count2)
@ -1821,7 +1827,7 @@ static BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
char *pn=FCEU_GetPath(FCEUMKF_MOVIE);
char szFile[MAX_PATH]={0};
OPENFILENAME ofn;
int nRet;
//int nRet; //mbg merge 7/17/06 removed
memset(&ofn, 0, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
@ -1865,7 +1871,7 @@ static BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
// user had made their choice
// TODO: warn the user when they open a movie made with a different ROM
char* fn=GetReplayPath(hwndDlg);
char TempArray[16];
//char TempArray[16]; //mbg merge 7/17/06 removed
ReplayDialogReadOnlyStatus = (SendDlgItemMessage(hwndDlg, 201, BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0;
char offset1Str[32]={0};

419
ines.c
View File

@ -47,9 +47,11 @@
extern SFORMAT FCEUVSUNI_STATEINFO[];
static uint8 *trainerpoo=0;
static uint8 *ROM=NULL;
static uint8 *VROM=NULL;
//mbg merge 6/29/06 - these need to be global
uint8 *trainerpoo=0;
uint8 *ROM=NULL;
uint8 *VROM=NULL;
#ifdef _USE_SHARED_MEMORY_
HANDLE mapROM, mapVROM;
@ -64,6 +66,7 @@ uint8 iNESIRQa=0;
uint32 ROM_size=0;
uint32 VROM_size=0;
char LoadedRomFName[2048]; //mbg merge 7/17/06 added
static void iNESPower(void);
static int NewiNES_Init(int num);
@ -84,7 +87,7 @@ static DECLFR(TrainerRead)
return(trainerpoo[A&0x1FF]);
}
static void iNESGI(int h)
void iNESGI(int h) //bbit edited: removed static keyword
{
switch(h)
{
@ -227,6 +230,7 @@ static void SetInput(void)
{0x4318a2f8,-1,SI_ZAPPER,0}, /* Barker Bill's Trick Shooting */
{0x5ee6008e,-1,SI_ZAPPER,0}, /* Mechanized Attack */
{0x3e58a87e,-1,SI_ZAPPER,0}, /* Freedom Force */
{0xe9a7fe9e,-1,SI_MOUSE,0}, /* Educational Computer 2000 */ //mbg merge 7/17/06 added -- appears to be from newer MM build
{0x851eb9be,SI_GAMEPAD,SI_ZAPPER,0}, /* Shooting Range */
{0x74bea652,SI_GAMEPAD,SI_ZAPPER,0}, /* Supergun 3-in-1 */
{0x32fb0583,-1,SI_ARKANOID,0}, /* Arkanoid(NES) */
@ -694,6 +698,7 @@ int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode)
}
FCEU_LoadGameSave(&iNESCart);
strcpy(LoadedRomFName,name); //bbit edited: line added
GameInterface=iNESGI;
FCEU_printf("\n");
@ -713,6 +718,47 @@ int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode)
return 1;
}
//bbit edited: the whole function below was added
int iNesSave(){
FILE *fp;
char name[2048];
if(FCEUGameInfo->type != GIT_CART)return 0;
if(GameInterface!=iNESGI)return 0;
strcpy(name,LoadedRomFName);
if (strcmp(name+strlen(name)-4,".nes") != 0) { //para edit
strcat(name,".nes");
}
fp = fopen(name,"wb");
if(fwrite(&head,1,16,fp)!=16)return 0;
if(head.ROM_type&4) /* Trainer */
{
fwrite(trainerpoo,512,1,fp);
}
fwrite(ROM,0x4000,head.ROM_size,fp);
if(head.VROM_size)fwrite(VROM,0x2000,head.VROM_size,fp);
fclose(fp);
return 1;
}
//para edit: added function below
char *iNesShortFName() {
char *ret;
if (!(ret = strrchr(LoadedRomFName,'\\'))) {
if (!(ret = strrchr(LoadedRomFName,'/'))) return 0;
}
return ret+1;
}
void FASTAPASS(2) VRAM_BANK1(uint32 A, uint8 V)
{
V&=7;
@ -826,211 +872,263 @@ static void NONE_init(void)
else
setvram8(CHRRAM);
}
/*
void (*MapInitTab[256])(void)=
{
0,0,
// Mapper2_init,Mapper3_init,
0,0,
0,0,
Mapper6_init,Mapper7_init,Mapper8_init,Mapper9_init,
Mapper10_init,Mapper11_init,
0,
// Mapper13_init,
0,
0,
Mapper15_init,Mapper16_init,Mapper17_init,Mapper18_init,
0,0,
Mapper21_init,Mapper22_init,Mapper23_init,Mapper24_init,
Mapper25_init,Mapper26_init,Mapper27_init,
0,0,0,0,
Mapper32_init,Mapper33_init,Mapper34_init,
0,0,0,0,0,
Mapper40_init,Mapper41_init,Mapper42_init,Mapper43_init,
0,0,
Mapper46_init,
0,
Mapper48_init,
0,
Mapper50_init,Mapper51_init,
0,0,0,0,0,
Mapper57_init,Mapper58_init,Mapper59_init,Mapper60_init,
Mapper61_init,Mapper62_init,
0,
Mapper64_init,Mapper65_init,Mapper66_init,Mapper67_init,
Mapper68_init,Mapper69_init,Mapper70_init,Mapper71_init,
Mapper72_init,Mapper73_init,
0,
Mapper75_init,Mapper76_init,Mapper77_init,Mapper78_init,
Mapper79_init,Mapper80_init,
0,
Mapper82_init,Mapper83_init,
0,
Mapper85_init,Mapper86_init,Mapper87_init,Mapper88_init,
Mapper89_init,
0,
Mapper91_init,Mapper92_init,Mapper93_init,Mapper94_init,
0,
Mapper96_init,Mapper97_init,
0,
Mapper99_init,
0,0,0,0,0,0,0,
Mapper107_init,
0,0,0,0,
0,Mapper113_init,
0,0,0,
Mapper117_init,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
Mapper140_init,
0,0,0,
Mapper144_init,
0,0,0,0,0,0,
Mapper151_init,Mapper152_init,Mapper153_init,Mapper154_init,
0,
Mapper156_init,Mapper157_init,Mapper158_init,0,
0,0,0,0,0,0,
Mapper166_init,Mapper167_init,
0,0,0,0,0,0,0,0,0,0,0,0,
Mapper180_init,
0,0,0,
Mapper184_init,Mapper185_init,
0,0,0,
Mapper189_init,
0,
// Mapper191_init,
0, //Mapper2_init,
0, //Mapper3_init,
0,
0,
Mapper193_init,
0,0,0,0,0,0,
Mapper200_init,Mapper201_init,Mapper202_init,Mapper203_init,
Mapper204_init,
0,0,
Mapper207_init,
0,0,0,
Mapper211_init,Mapper212_init,Mapper213_init,Mapper214_init,
0,0,0,0,0,0,0,0,0,0,
Mapper225_init,Mapper226_init,Mapper227_init,Mapper228_init,
Mapper229_init,Mapper230_init,Mapper231_init,Mapper232_init,
0,
Mapper234_init,Mapper235_init,
0,0,0,0,
Mapper240_init,Mapper241_init,Mapper242_init,0,
Mapper244_init,
0,
Mapper246_init,
0,0,0,0,0,0,0,0,
Mapper255_init
};
*/
void (*MapInitTab[256])(void)=
{
0,0, //Mapper2_init,Mapper3_init,
0,0,
0,0,
Mapper6_init,
0,//Mapper7_init,
Mapper8_init,Mapper9_init,
Mapper8_init,
Mapper9_init,
Mapper10_init,
0, //Mapper11_init,
0,
0, //Mapper13_init,
0,
Mapper15_init,
Mapper16_init,
Mapper17_init,
Mapper18_init,
0,
0,
Mapper21_init,
Mapper22_init,
Mapper23_init,
Mapper24_init,
Mapper25_init,
Mapper26_init,
Mapper27_init,
0,
0,
0,
0,
Mapper32_init,
Mapper33_init,
Mapper34_init,
0,
0,
0,
0,
0,
Mapper40_init,
Mapper41_init,
Mapper42_init,
0, //Mapper43_init,
0,
0,
Mapper15_init,Mapper16_init,Mapper17_init,Mapper18_init,
0,0,
Mapper21_init,Mapper22_init,Mapper23_init,Mapper24_init,
Mapper25_init,Mapper26_init,Mapper27_init,
0,0,0,0,
Mapper32_init,Mapper33_init,Mapper34_init,
0,0,0,0,0,
Mapper40_init,Mapper41_init,Mapper42_init,Mapper43_init,
0,0,
Mapper46_init,
0,
Mapper48_init,
0,
Mapper50_init,Mapper51_init,
0,0,0,0,0,
Mapper50_init,
Mapper51_init,
0,
0,
0,
0,
0,
0,// Mapper57_init,
0,// Mapper58_init,
Mapper59_init,Mapper60_init,
Mapper61_init,Mapper62_init,
Mapper59_init,
0,// Mapper60_init,
Mapper61_init,
Mapper62_init,
0,
Mapper64_init,Mapper65_init,
Mapper64_init,
Mapper65_init,
0,//Mapper66_init,
Mapper67_init,
Mapper68_init,Mapper69_init,
Mapper68_init,
Mapper69_init,
0,//Mapper70_init,
Mapper71_init,
Mapper72_init,Mapper73_init,
Mapper72_init,
Mapper73_init,
0,
Mapper75_init,Mapper76_init,Mapper77_init,
Mapper75_init,
Mapper76_init,
Mapper77_init,
0, //Mapper78_init,
Mapper79_init,Mapper80_init,
Mapper79_init,
Mapper80_init,
0,
Mapper82_init,Mapper83_init,
Mapper82_init,
Mapper83_init,
0,
Mapper85_init,Mapper86_init,
Mapper85_init,
Mapper86_init,
0, //Mapper87_init,
0, //Mapper88_init,
Mapper89_init,
0,
Mapper91_init,Mapper92_init,
Mapper91_init,
Mapper92_init,
0, //Mapper93_init,
0, //Mapper94_init,
0,
Mapper96_init,Mapper97_init,
Mapper96_init,
Mapper97_init,
0,
Mapper99_init,
0,0,0,0,0,0,0,
0,
0,
0,
0,
0,
0,
0,
0, //Mapper107_init,
0,0,0,0,
0,Mapper113_init,
0,0,0,
0,
0,
0,
0,
0,
0, // Mapper113_init,
0,
0,
0, //Mapper116_init,
0, //Mapper117_init,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0, //Mapper140_init,
0,0,0,
0,
0,
0,
0, //Mapper144_init,
0,0,0,0,0,0,
0,
0,
0,
0,
0,
0,
Mapper151_init,
0, //Mapper152_init,
Mapper153_init,
0, //Mapper154_init,
0,
Mapper156_init,Mapper157_init,Mapper158_init,0,
0,0,0,0,0,0,
Mapper166_init,Mapper167_init,
0,0,0,0,0,0,0,0,0,0,0,0,
Mapper180_init,
0,0,0,
Mapper184_init,
Mapper156_init,
Mapper157_init,
0, //Mapper158_init, removed
0,
0,
0,
0,
0,
0,
0,
Mapper166_init,
Mapper167_init,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0, //Mapper180_init,
0,
0,
0,
0, //Mapper184_init,
0, //Mapper185_init,
0,0,0,
0,
0,
0,
0, //Mapper189_init,
0,
0,
0, //Mapper191_init,
0,
Mapper193_init,
0,0,0,0,0,0,
Mapper200_init,Mapper201_init,Mapper202_init,Mapper203_init,
0,
0,
0,
0,
0,
0,
0, //Mapper200_init,
Mapper201_init,
Mapper202_init,
Mapper203_init,
Mapper204_init,
0,0,
0,
0,
Mapper207_init,
0,0,0,
0,
0,
0,
0, //Mapper211_init,
Mapper212_init,Mapper213_init,Mapper214_init,
0,0,0,0,0,0,0,0,0,0,
Mapper225_init,Mapper226_init,Mapper227_init,Mapper228_init,
Mapper229_init,Mapper230_init,Mapper231_init,Mapper232_init,
Mapper212_init,
Mapper213_init,
Mapper214_init,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
Mapper225_init,
0, //Mapper226_init,
Mapper227_init,
Mapper228_init,
Mapper229_init,
Mapper230_init,
Mapper231_init,
Mapper232_init,
0,
Mapper234_init,
0, //Mapper235_init,
0,0,0,0,
Mapper240_init,Mapper241_init,Mapper242_init,0,
0,
0,
0,
0,
0, //Mapper240_init,
Mapper241_init,
Mapper242_init,
0,
Mapper244_init,
0,
Mapper246_init,
0,0,0,0,0,0,0,0,
0,
0,
0,
0,
0,
0,
0,
0,
Mapper255_init
};
@ -1215,7 +1313,7 @@ static BMAPPING bmap[] = {
};
*/
static BMAPPING bmap[] = {
{0, NROM_Init},
{0, NROM_Init},
{1, Mapper1_Init},
{2, UNROM_Init},
{3, CNROM_Init},
@ -1227,13 +1325,15 @@ static BMAPPING bmap[] = {
{13, CPROM_Init},
{19, Mapper19_Init},
{37, Mapper37_Init},
{43, Mapper43_Init},
{44, Mapper44_Init},
{45, Mapper45_Init},
{47, Mapper47_Init},
{49, Mapper49_Init},
{52, Mapper52_Init},
{57, Mapper57_Init},
{58, Mapper58_Init},
{58, BMCGK192_Init},
{60, BMCD1038_Init},
{66, MHROM_Init},
{70, Mapper70_Init},
{74, Mapper74_Init},
@ -1247,12 +1347,14 @@ static BMAPPING bmap[] = {
{105, Mapper105_Init},
{107, Mapper107_Init},
{112, Mapper112_Init},
{113, Mapper113_Init},
{114, Mapper114_Init},
{115, Mapper115_Init},
{116, Mapper116_Init},
{117, Mapper117_Init},
{118, Mapper118_Init},
{118, TKSROM_Init},
{119, Mapper119_Init},
{132, UNL22211_Init},
{133, SA72008_Init},
{137, S8259D_Init},
{138, S8259B_Init},
@ -1274,9 +1376,11 @@ static BMAPPING bmap[] = {
{163, Mapper163_Init},
{164, Mapper164_Init},
{165, Mapper165_Init},
{180, Mapper180_Init},
{181, Mapper181_Init},
{182, Mapper182_Init},
{183, Mapper183_Init},
{184, Mapper184_Init},
{185, Mapper185_Init},
{186, Mapper186_Init},
{187, Mapper187_Init},
@ -1285,8 +1389,10 @@ static BMAPPING bmap[] = {
{191, Mapper191_Init},
{192, Mapper192_Init},
{194, Mapper194_Init},
{195, Mapper195_Init},
{198, Mapper198_Init},
{199, Mapper199_Init},
{200, Mapper200_Init},
{205, Mapper205_Init},
{206, DEIROM_Init},
{208, Mapper208_Init},
@ -1296,11 +1402,16 @@ static BMAPPING bmap[] = {
{215, Mapper215_Init},
{216, Mapper216_Init},
{217, Mapper217_Init},
{218, UNLSonic_Init},
{218, UNLA9711_Init},
{219, UNLSL1632_Init},
// {220, Mapper220_Init},
{220, UNLCN22M_Init},
{221, BMCFK23C_Init},
{222, Mapper222_Init},
{226, Mapper226_Init},
{235, Mapper235_Init},
{240, Mapper240_Init},
{243, S74LS374NA_Init},
{245, Mapper245_Init},
{249, Mapper249_Init},

34
ines.h
View File

@ -64,6 +64,14 @@ extern uint8 iNESIRQa;
#else
#endif
//mbg merge 6/29/06
extern uint8 *ROM;
extern uint8 *VROM;
extern uint32 VROM_size;
extern uint32 ROM_size;
extern int iNesSave(); //bbit Edited: line added
extern char LoadedRomFName[2048]; //bbit Edited: line added
typedef struct {
char ID[4]; /*NES^Z*/
uint8 ROM_size;
@ -137,7 +145,7 @@ void Mapper39_init(void);
void Mapper40_init(void);
void Mapper41_init(void);
void Mapper42_init(void);
void Mapper43_init(void);
//void Mapper43_init(void);
void Mapper44_init(void);
void Mapper45_init(void);
void Mapper46_init(void);
@ -199,7 +207,7 @@ void Mapper108_init(void);
void Mapper109_init(void);
void Mapper110_init(void);
void Mapper111_init(void);
void Mapper113_init(void);
//void Mapper113_init(void);
void Mapper115_init(void);
void Mapper116_init(void);
//void Mapper117_init(void);
@ -232,7 +240,7 @@ void Mapper153_init(void);
void Mapper154_init(void);
void Mapper156_init(void);
void Mapper157_init(void);
void Mapper158_init(void);
//void Mapper158_init(void);
void Mapper159_init(void);
void Mapper160_init(void);
void Mapper161_init(void);
@ -251,20 +259,20 @@ void Mapper176_init(void);
void Mapper177_init(void);
void Mapper178_init(void);
void Mapper179_init(void);
void Mapper180_init(void);
//void Mapper180_init(void);
//void Mapper181_init(void);
void Mapper184_init(void);
//void Mapper184_init(void);
//void Mapper185_init(void);
//void Mapper189_init(void);
//void Mapper192_init(void);
void Mapper193_init(void);
//void Mapper194_init(void);
void Mapper195_init(void);
//void Mapper195_init(void);
void Mapper196_init(void);
void Mapper197_init(void);
//void Mapper198_init(void);
void Mapper199_init(void);
void Mapper200_init(void);
//void Mapper200_init(void);
void Mapper201_init(void);
void Mapper202_init(void);
void Mapper203_init(void);
@ -282,7 +290,7 @@ void Mapper221_init(void);
void Mapper223_init(void);
void Mapper224_init(void);
void Mapper225_init(void);
void Mapper226_init(void);
//void Mapper226_init(void);
void Mapper227_init(void);
void Mapper228_init(void);
void Mapper229_init(void);
@ -323,13 +331,14 @@ void Mapper11_Init(CartInfo *);
void Mapper12_Init(CartInfo *);
void Mapper19_Init(CartInfo *);
void Mapper37_Init(CartInfo *);
void Mapper43_Init(CartInfo *);
void Mapper44_Init(CartInfo *);
void Mapper45_Init(CartInfo *);
void Mapper47_Init(CartInfo *);
void Mapper49_Init(CartInfo *);
void Mapper52_Init(CartInfo *);
void Mapper57_Init(CartInfo *);
void Mapper58_Init(CartInfo *);
//void Mapper58_Init(CartInfo *);
void Mapper70_Init(CartInfo *);
void Mapper74_Init(CartInfo *);
void Mapper78_Init(CartInfo *);
@ -342,6 +351,7 @@ void Mapper95_Init(CartInfo *);
void Mapper105_Init(CartInfo *);
void Mapper107_Init(CartInfo *);
void Mapper112_Init(CartInfo *);
void Mapper113_Init(CartInfo *);
void Mapper114_Init(CartInfo *);
void Mapper115_Init(CartInfo *);
void Mapper116_Init(CartInfo *);
@ -357,9 +367,11 @@ void Mapper155_Init(CartInfo *);
void Mapper163_Init(CartInfo *);
void Mapper164_Init(CartInfo *);
void Mapper165_Init(CartInfo *);
void Mapper180_Init(CartInfo *);
void Mapper181_Init(CartInfo *);
void Mapper182_Init(CartInfo *);
void Mapper183_Init(CartInfo *);
void Mapper184_Init(CartInfo *);
void Mapper185_Init(CartInfo *);
void Mapper186_Init(CartInfo *);
void Mapper187_Init(CartInfo *);
@ -368,8 +380,10 @@ void Mapper189_Init(CartInfo *);
void Mapper191_Init(CartInfo *);
void Mapper192_Init(CartInfo *);
void Mapper194_Init(CartInfo *);
void Mapper195_Init(CartInfo *);
void Mapper198_Init(CartInfo *);
void Mapper199_Init(CartInfo *);
void Mapper200_Init(CartInfo *);
void Mapper205_Init(CartInfo *);
void Mapper208_Init(CartInfo *);
void Mapper209_Init(CartInfo *);
@ -380,9 +394,11 @@ void Mapper216_Init(CartInfo *);
void Mapper217_Init(CartInfo *);
void Mapper220_Init(CartInfo *);
void Mapper222_Init(CartInfo *);
void Mapper226_Init(CartInfo *);
void Mapper235_Init(CartInfo *);
void Mapper236_Init(CartInfo *);
void Mapper237_Init(CartInfo *);
void Mapper240_Init(CartInfo *);
void Mapper245_Init(CartInfo *);
void Mapper249_Init(CartInfo *);
void Mapper250_Init(CartInfo *);

View File

@ -60,8 +60,8 @@ static void FP_FASTAPASS(2) Update(void *data, int arg)
*(uint8 *)data=0;
seq=ptr=0;
have=1;
strcpy(bdata,(uint8 *)data+1);
strcpy(&bdata[13],"SUNSOFT");
strcpy((char*)bdata,(char *)data+1); //mbg merge 7/17/06 added casts
strcpy((char*)&bdata[13],"SUNSOFT"); //mbg merge 7/17/06 added cast
}
}

73
mappers/15.c Normal file
View File

@ -0,0 +1,73 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2003 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
static void Sync(void)
{
int x;
setmirror(((mapbyte1[0]>>6)&1)^1);
switch(mapbyte1[1]&0x3)
{
case 0x0:
for(x=0;x<4;x++)
setprg8(0x8000+x*8192,(((mapbyte1[0]&0x7F)<<1)+x)^(mapbyte1[0]>>7));
break;
case 0x2:
for(x=0;x<4;x++)
setprg8(0x8000+x*8192,((mapbyte1[0]&0x7F)<<1)+(mapbyte1[0]>>7));
break;
case 0x1:
case 0x3:
for(x=0;x<4;x++)
{
unsigned int b;
b=mapbyte1[0]&0x7F;
if(x>=2 && !(mapbyte1[1]&0x2))
b=0x7F;
setprg8(0x8000+x*8192,(x&1)+((b<<1)^(mapbyte1[0]>>7)));
}
break;
}
}
static DECLFW(Mapper15_write)
{
mapbyte1[0]=V;
mapbyte1[1]=A&3;
Sync();
}
static void StateRestore(int version)
{
Sync();
}
void Mapper15_init(void)
{
mapbyte1[0]=mapbyte1[1]=0;
Sync();
GameStateRestore=StateRestore;
SetWriteHandler(0x8000,0xFFFF,Mapper15_write);
}

41
mappers/151.c Normal file
View File

@ -0,0 +1,41 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mapinc.h"
DECLFW(Mapper151_write)
{
switch(A&0xF000)
{
case 0x8000:ROM_BANK8(0x8000,V);break;
case 0xA000:ROM_BANK8(0xA000,V);break;
case 0xC000:ROM_BANK8(0xC000,V);break;
case 0xe000:VROM_BANK4(0x0000,V);break;
case 0xf000:VROM_BANK4(0x1000,V);break;
}
}
void Mapper151_init(void)
{
SetWriteHandler(0x8000,0xffff,Mapper151_write);
}

Some files were not shown because too many files have changed in this diff Show More