Merge pull request #167 from retro-wertz/undo_cpp_comments

Undo cpp comments
This commit is contained in:
Twinaphex
2017-10-16 01:38:59 +02:00
committed by GitHub
112 changed files with 1097 additions and 1007 deletions

View File

@@ -46,29 +46,31 @@ static SFORMAT StateRegs[] =
static void Sync(void) {
setprg32(0x8000, (reg[2] >> 2) & 1);
if (is172)
setchr8((((cmd ^ reg[2]) >> 3) & 2) | (((cmd ^ reg[2]) >> 5) & 1)); // 1991 DU MA Racing probably CHR bank sequence is WRONG, so it is possible to
// rearrange CHR banks for normal UNIF board and mapper 172 is unneccessary
setchr8((((cmd ^ reg[2]) >> 3) & 2) | (((cmd ^ reg[2]) >> 5) & 1)); /* 1991 DU MA Racing probably CHR bank sequence is WRONG, so it is possible to
* rearrange CHR banks for normal UNIF board and mapper 172 is unneccessary */
else
setchr8(reg[2] & 3);
}
static DECLFW(UNL22211WriteLo) {
// FCEU_printf("bs %04x %02x\n",A,V);
/* FCEU_printf("bs %04x %02x\n",A,V); */
reg[A & 3] = V;
}
static DECLFW(UNL22211WriteHi) {
// FCEU_printf("bs %04x %02x\n",A,V);
/* FCEU_printf("bs %04x %02x\n",A,V); */
cmd = V;
Sync();
}
static DECLFR(UNL22211ReadLo) {
return (reg[1] ^ reg[2]) | (is173 ? 0x01 : 0x40);
// if(reg[3])
// return reg[2];
// else
// return X.DB;
#if 0
if(reg[3])
return reg[2];
else
return X.DB;
#endif
}
static void UNL22211Power(void) {

View File

@@ -76,7 +76,7 @@ static void UNLSMB2JPower(void) {
static void FP_FASTAPASS(1) UNLSMB2JIRQHook(int a) {
if (IRQa)
{
if (IRQCount < 5750) // completely by guess
if (IRQCount < 5750) /* completely by guess */
IRQCount += a;
else {
IRQa = 0;

View File

@@ -49,8 +49,8 @@ static void M108Power(void) {
Sync();
SetReadHandler(0x6000, 0x7FFF, CartBR);
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x8000, 0x8FFF, M108Write); // regular 108
SetWriteHandler(0xF000, 0xFFFF, M108Write); // simplified Kaiser BB Hack
SetWriteHandler(0x8000, 0x8FFF, M108Write); /* regular 108 */
SetWriteHandler(0xF000, 0xFFFF, M108Write); /* simplified Kaiser BB Hack */
}
static void StateRestore(int version) {

View File

@@ -163,15 +163,16 @@ static void Sync(void) {
}
static DECLFW(UNLSL12ModeWrite) {
// FCEU_printf("%04X:%02X\n",A,V);
/* FCEU_printf("%04X:%02X\n",A,V); */
if ((A & 0x4100) == 0x4100) {
mode = V;
if (A & 1) { // hacky hacky, there are two configuration modes on SOMARI HUANG-1 PCBs
// Solder pads with P1/P2 shorted called SOMARI P,
// Solder pads with W1/W2 shorted called SOMARI W
// Both identical 3-in-1 but W wanted MMC1 registers
// to be reset when switch to MMC1 mode P one - doesn't
// There is issue with W version of Somari at starting copyrights
if (A & 1) { /* hacky hacky, there are two configuration modes on SOMARI HUANG-1 PCBs
* Solder pads with P1/P2 shorted called SOMARI P,
* Solder pads with W1/W2 shorted called SOMARI W
* Both identical 3-in-1 but W wanted MMC1 registers
* to be reset when switch to MMC1 mode P one - doesn't
* There is issue with W version of Somari at starting copyrights
*/
mmc1_regs[0] = 0xc;
mmc1_regs[3] = 0;
mmc1_buffer = 0;
@@ -182,7 +183,7 @@ static DECLFW(UNLSL12ModeWrite) {
}
static DECLFW(UNLSL12Write) {
// FCEU_printf("%04X:%02X\n",A,V);
/* FCEU_printf("%04X:%02X\n",A,V); */
switch (mode & 3) {
case 0: {
if ((A >= 0xB000) && (A <= 0xE003)) {
@@ -285,7 +286,7 @@ static void UNLSL12Power(void) {
vrc2_chr[0] = ~0;
vrc2_chr[1] = ~0;
vrc2_chr[2] = ~0;
vrc2_chr[3] = ~0; // W conf. of Somari wanted CHR3 has to be set to BB bank (or similar), but doesn't do that directly
vrc2_chr[3] = ~0; /* W conf. of Somari wanted CHR3 has to be set to BB bank (or similar), but doesn't do that directly */
vrc2_chr[4] = 4;
vrc2_chr[5] = 5;
vrc2_chr[6] = 6;

View File

@@ -45,7 +45,7 @@ static void Sync() {
}
static void M121CW(uint32 A, uint8 V) {
if (PRGsize[0] == CHRsize[0]) { // A9713 multigame extension hack!
if (PRGsize[0] == CHRsize[0]) { /* A9713 multigame extension hack! */
setchr1(A, V | ((EXPREGS[3] & 0x80) << 1));
} else {
if ((A & 0x1000) == ((MMC3_cmd & 0x80) << 5))
@@ -57,37 +57,37 @@ static void M121CW(uint32 A, uint8 V) {
static void M121PW(uint32 A, uint8 V) {
if (EXPREGS[5] & 0x3F) {
// FCEU_printf("prot banks: %02x %02x %02x %02x\n",V,EXPREGS[2],EXPREGS[1],EXPREGS[0]);
/* FCEU_printf("prot banks: %02x %02x %02x %02x\n",V,EXPREGS[2],EXPREGS[1],EXPREGS[0]); */
setprg8(A, (V & 0x1F) | ((EXPREGS[3] & 0x80) >> 2));
setprg8(0xE000, (EXPREGS[0]) | ((EXPREGS[3] & 0x80) >> 2));
setprg8(0xC000, (EXPREGS[1]) | ((EXPREGS[3] & 0x80) >> 2));
setprg8(0xA000, (EXPREGS[2]) | ((EXPREGS[3] & 0x80) >> 2));
} else {
// FCEU_printf("gen banks: %04x %02x\n",A,V);
/* FCEU_printf("gen banks: %04x %02x\n",A,V); */
setprg8(A, (V & 0x1F) | ((EXPREGS[3] & 0x80) >> 2));
}
}
static DECLFW(M121Write) {
// FCEU_printf("write: %04x:%04x\n",A&0xE003,V);
/* FCEU_printf("write: %04x:%04x\n",A&0xE003,V); */
switch (A & 0xE003) {
case 0x8000:
// EXPREGS[5] = 0;
// FCEU_printf("gen: %02x\n",V);
/* EXPREGS[5] = 0; */
/* FCEU_printf("gen: %02x\n",V); */
MMC3_CMDWrite(A, V);
FixMMC3PRG(MMC3_cmd);
break;
case 0x8001:
EXPREGS[6] = ((V & 1) << 5) | ((V & 2) << 3) | ((V & 4) << 1) | ((V & 8) >> 1) | ((V & 0x10) >> 3) | ((V & 0x20) >> 5);
// FCEU_printf("bank: %02x (%02x)\n",V,EXPREGS[6]);
/* FCEU_printf("bank: %02x (%02x)\n",V,EXPREGS[6]); */
if (!EXPREGS[7]) Sync();
MMC3_CMDWrite(A, V);
FixMMC3PRG(MMC3_cmd);
break;
case 0x8003:
EXPREGS[5] = V;
// EXPREGS[7] = 0;
// FCEU_printf("prot: %02x\n",EXPREGS[5]);
/* EXPREGS[7] = 0; */
/* FCEU_printf("prot: %02x\n",EXPREGS[5]); */
Sync();
MMC3_CMDWrite(0x8000, V);
FixMMC3PRG(MMC3_cmd);
@@ -97,17 +97,17 @@ static DECLFW(M121Write) {
static uint8 prot_array[16] = { 0x83, 0x83, 0x42, 0x00 };
static DECLFW(M121LoWrite) {
EXPREGS[4] = prot_array[V & 3]; // 0x100 bit in address seems to be switch arrays 0, 2, 2, 3 (Contra Fighter)
if ((A & 0x5180) == 0x5180) { // A9713 multigame extension
EXPREGS[4] = prot_array[V & 3]; /* 0x100 bit in address seems to be switch arrays 0, 2, 2, 3 (Contra Fighter) */
if ((A & 0x5180) == 0x5180) { /* A9713 multigame extension */
EXPREGS[3] = V;
FixMMC3PRG(MMC3_cmd);
FixMMC3CHR(MMC3_cmd);
}
// FCEU_printf("write: %04x:%04x\n",A,V);
/* FCEU_printf("write: %04x:%04x\n",A,V); */
}
static DECLFR(M121Read) {
// FCEU_printf("read: %04x->\n",A,EXPREGS[0]);
/* FCEU_printf("read: %04x->\n",A,EXPREGS[0]); */
return EXPREGS[4];
}

View File

@@ -37,8 +37,8 @@ static void Sync(void) {
setchr4(0x0000, (prgchr[0] >> 3) | (bank << 2));
setchr4(0x1000, (prgchr[1] >> 3) | (bank << 2));
if (ctrl & 8) {
setprg16(0x8000, bank | (prgchr[0] & 6) | 0); // actually, both 0 and 1 registers used, but they will switch each PA12 transition
setprg16(0xc000, bank | (prgchr[0] & 6) | 1); // if bits are different for both registers, so they must be programmed strongly the same!
setprg16(0x8000, bank | (prgchr[0] & 6) | 0); /* actually, both 0 and 1 registers used, but they will switch each PA12 transition */
setprg16(0xc000, bank | (prgchr[0] & 6) | 1); /* if bits are different for both registers, so they must be programmed strongly the same! */
} else {
setprg16(0x8000, bank | (prgchr[0] & 7));
setprg16(0xc000, bank | 7 );

View File

@@ -29,9 +29,9 @@ static uint8 lut[8] = { 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0F, 0x00 };
static void UNL158BPW(uint32 A, uint8 V) {
if (EXPREGS[0] & 0x80) {
uint32 bank = EXPREGS[0] & 7;
if(EXPREGS[0] & 0x20) { // 32Kb mode
if(EXPREGS[0] & 0x20) { /* 32Kb mode */
setprg32(0x8000, bank >> 1);
} else { // 16Kb mode
} else { /* 16Kb mode */
setprg16(0x8000, bank);
setprg16(0xC000, bank);
}
@@ -67,5 +67,5 @@ void UNL158B_Init(CartInfo *info) {
GenMMC3_Init(info, 128, 128, 0, 0);
pwrap = UNL158BPW;
info->Power = UNL158BPower;
AddExState(EXPREGS, 6, 0, "EXPR");
AddExState(EXPREGS, 8, 0, "EXPR");
}

View File

@@ -137,7 +137,7 @@ static DECLFW(Write2) {
trigger ^= 1;
}
laststrobe = V;
} else if (A == 0x5100 && V == 6) /* damn thoose protected games */
} else if (A == 0x5100 && V == 6) /* damn those protected games */
setprg32(0x8000, 3);
else
switch (A & 0x7300) {

View File

@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* RacerMate Chalenge II
* RacerMate Challenge II
*
*/
@@ -58,7 +58,7 @@ static void M168Power(void) {
SetReadHandler(0x8000, 0xFFFF, CartBR);
}
static void MNNNClose(void) {
static void M168Close(void) {
if (CHRRAM)
FCEU_gfree(CHRRAM);
CHRRAM = NULL;
@@ -70,7 +70,7 @@ static void StateRestore(int version) {
void Mapper168_Init(CartInfo *info) {
info->Power = M168Power;
info->Close = MNNNClose;
info->Close = M168Close;
GameStateRestore = StateRestore;
AddExState(&StateRegs, ~0, 0, 0);

View File

@@ -29,7 +29,7 @@ static uint8 reg[4];
static uint8 *WRAM = NULL;
static uint32 WRAMSIZE;
// SND Registers
/* SND Registers */
static uint8 pcm_enable = 0;
static int16 pcm_latch = 0x3F6, pcm_clock = 0x3F6;
static writefunc pcmwrite;
@@ -46,13 +46,13 @@ static int16 step_size[49] = {
107, 118, 130, 143, 157, 173, 190, 209, 230, 253,
279, 307, 337, 371, 408, 449, 494, 544, 598, 658,
724, 796, 876, 963, 1060, 1166, 1282, 1411, 1552
}; //49 items
}; /* 49 items */
static int32 step_adj[16] = { -1, -1, -1, -1, 2, 5, 7, 9, -1, -1, -1, -1, 2, 5, 7, 9 };
//decode stuff
/* decode stuff */
static int32 jedi_table[16 * 49];
static int32 acc = 0; //ADPCM accumulator, initial condition must be 0
static int32 decstep = 0; //ADPCM decoding step, initial condition must be 0
static int32 acc = 0; /* ADPCM accumulator, initial condition must be 0 */
static int32 decstep = 0; /* ADPCM decoding step, initial condition must be 0 */
static void jedi_table_init() {
int step, nib;
@@ -67,7 +67,7 @@ static void jedi_table_init() {
static uint8 decode(uint8 code) {
acc += jedi_table[decstep + code];
if ((acc & ~0x7ff) != 0) // acc is > 2047
if ((acc & ~0x7ff) != 0) /* acc is > 2047 */
acc |= ~0xfff;
else acc &= 0xfff;
decstep += step_adj[code & 7] * 16;
@@ -81,13 +81,13 @@ static void Sync(void) {
uint32 bbank = reg[2];
setchr8(0);
setprg8r(0x10, 0x6000, reg[3] & 3);
if (reg[0] & 2) { // UNROM mode
if (reg[0] & 2) { /* UNROM mode */
setprg16(0x8000, (bbank << 3) | sbank);
if (reg[0] & 4)
setprg16(0xC000, (bbank << 3) | 6 | (reg[1] & 1));
else
setprg16(0xC000, (bbank << 3) | 7);
} else { // NROM mode
} else { /* NROM mode */
uint32 bank = (bbank << 3) | sbank;
if (reg[0] & 4) {
setprg16(0x8000, bank);
@@ -100,7 +100,7 @@ static void Sync(void) {
static DECLFW(M178Write) {
reg[A & 3] = V;
// FCEU_printf("cmd %04x:%02x\n", A, V);
/* FCEU_printf("cmd %04x:%02x\n", A, V); */
Sync();
}
@@ -108,7 +108,7 @@ static DECLFW(M178WriteSnd) {
if (A == 0x5800) {
if (V & 0xF0) {
pcm_enable = 1;
// pcmwrite(0x4011, (V & 0xF) << 3);
/* pcmwrite(0x4011, (V & 0xF) << 3); */
pcmwrite(0x4011, decode(V & 0xf));
} else
pcm_enable = 0;

View File

@@ -32,25 +32,26 @@ static SFORMAT StateRegs[] =
{ 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
/* 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
/* 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
if (!(datareg & 1)) /* 7 */
setchr8(0);
else
setchr8r(0x10, 0);

View File

@@ -39,7 +39,7 @@ static void M187PW(uint32 A, uint8 V) {
if (EXPREGS[0] & 0x40)
setprg32(0x8000, bank >> 2);
else
setprg32(0x8000, bank >> 1); // hacky hacky! two mappers in one! need real hw carts to test
setprg32(0x8000, bank >> 1); /* hacky hacky! two mappers in one! need real hw carts to test */
} else {
setprg16(0x8000, bank);
setprg16(0xC000, bank);

View File

@@ -26,7 +26,7 @@ static void M189PW(uint32 A, uint8 V) {
}
static DECLFW(M189Write) {
EXPREGS[0] = V | (V >> 4); //actually, there is a two versions of 189 mapper with hi or lo bits bankswitching.
EXPREGS[0] = V | (V >> 4); /* actually, there is a two versions of 189 mapper with hi or lo bits bankswitching. */
FixMMC3PRG(MMC3_cmd);
}

View File

@@ -44,7 +44,7 @@ static void M199CW(uint32 A, uint8 V) {
}
static void M199MW(uint8 V) {
// FCEU_printf("%02x\n",V);
/* FCEU_printf("%02x\n",V); */
switch (V & 3) {
case 0: setmirror(MI_V); break;
case 1: setmirror(MI_H); break;

View File

@@ -23,7 +23,7 @@
#include "mapinc.h"
static uint8 IRQCount; //, IRQPre;
static uint8 IRQCount; /*, IRQPre; */
static uint8 IRQa;
static uint8 prg_reg[2];
static uint8 chr_reg[8];
@@ -44,7 +44,7 @@ static void M222IRQ(void) {
IRQCount++;
if (IRQCount >= 238) {
X6502_IRQBegin(FCEU_IQEXT);
// IRQa=0;
/* IRQa=0; */
}
}
}
@@ -71,11 +71,13 @@ static DECLFW(M222Write) {
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=16; FCEU_printf("%04x:%02x %d\n",A,V,scanline); break;
#if 0
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=16; FCEU_printf("%04x:%02x %d\n",A,V,scanline); break;
#endif
case 0xF000: IRQa = IRQCount = V; if (scanline < 240) IRQCount -= 8; else IRQCount += 4; X6502_IRQEnd(FCEU_IQEXT); break;
}
Sync();

View File

@@ -29,11 +29,12 @@ static SFORMAT StateRegs[] =
};
static void Sync(void) {
// uint32 bbank = (bank & 0x18) >> 1;
uint32 bbank = ((bank & 0x10) >> 2) | (bank & 8); // some dumps have bbanks swapped, if swap commands,
// then all roms can be played, but with some swapped
// games in menu. if not, some dumps are unplayable
// make hard dump for both cart types to check
/* uint32 bbank = (bank & 0x18) >> 1; */
uint32 bbank = ((bank & 0x10) >> 2) | (bank & 8); /* some dumps have bbanks swapped, if swap commands,
* then all roms can be played, but with some swapped
* games in menu. if not, some dumps are unplayable
* make hard dump for both cart types to check
*/
setprg16(0x8000, bbank | (preg & 3));
setprg16(0xC000, bbank | 3);
setchr8(0);

View File

@@ -41,7 +41,7 @@ static DECLFW(M36Write) {
}
static DECLFR(M36Read) {
return latche; // Need by Strike Wolf, being simplified mapper, this cart still uses some TCX mapper features andrely on it
return latche; /* Need by Strike Wolf, being simplified mapper, this cart still uses some TCX mapper features andrely on it */
}
static void M36Power(void) {
@@ -49,7 +49,7 @@ static void M36Power(void) {
Sync();
SetReadHandler(0x4100, 0x4100, M36Read);
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x8000, 0xFFFE, M36Write); // Actually, BUS conflict there preventing from triggering the wrong banks
SetWriteHandler(0x8000, 0xFFFE, M36Write); /* Actually, BUS conflict there preventing from triggering the wrong banks */
}
static void M36Restore(int version) {

View File

@@ -38,15 +38,15 @@ static void Sync(void) {
setchr8(0);
}
//#define Count 0x1800
/* #define Count 0x1800 */
#define Pause 0x010
static DECLFW(UNL3DBlockWrite) {
switch (A) {
//4800 32
//4900 37
//4a00 01
//4e00 18
/* 4800 32 */
/* 4900 37 */
/* 4a00 01 */
/* 4e00 18 */
case 0x4800: reg[0] = V; break;
case 0x4900: reg[1] = V; break;
case 0x4a00: reg[2] = V; break;

View File

@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
// actually cart ID is 811120-C, sorry ;) K-3094 - another ID
/* actually cart ID is 811120-C, sorry ;) K-3094 - another ID */
#include "mapinc.h"
#include "mmc3.h"

View File

@@ -54,7 +54,7 @@ static DECLFW(M42Write) {
static void M42Power(void) {
preg = 0;
mirr = 1; // Ai Senshi Nicol actually has fixed mirroring, but mapper forcing it's default value now
mirr = 1; /* Ai Senshi Nicol actually has fixed mirroring, but mapper forcing it's default value now */
Sync();
SetReadHandler(0x6000, 0xffff, CartBR);
SetWriteHandler(0x6000, 0xffff, M42Write);

View File

@@ -36,26 +36,27 @@ static SFORMAT StateRegs[] =
};
static void Sync(void) {
setprg4(0x5000, 8 << 1); // Only YS-612 advanced version
setprg4(0x5000, 8 << 1); /* Only YS-612 advanced version */
setprg8(0x6000, swap?0:2);
setprg8(0x8000, 1);
setprg8(0xa000, 0);
setprg8(0xc000, reg);
setprg8(0xe000, swap?8:9); // hard dump for mr.Mary is 128K,
// bank 9 is the last 2K ok bank 8 repeated 4 times, then till the end of 128K
// instead used bank A, containing some CHR data, ines rom have unused banks removed,
// and bank A moved to the bank 9 place for compatibility with other crappy dumps
setprg8(0xe000, swap?8:9); /* hard dump for mr.Mary is 128K,
* bank 9 is the last 2K ok bank 8 repeated 4 times, then till the end of 128K
* instead used bank A, containing some CHR data, ines rom have unused banks removed,
* and bank A moved to the bank 9 place for compatibility with other crappy dumps
*/
setchr8(0);
}
static DECLFW(M43Write) {
// int transo[8]={4,3,4,4,4,7,5,6};
int transo[8] = { 4, 3, 5, 3, 6, 3, 7, 3 }; // According to hardware tests
/* int transo[8]={4,3,4,4,4,7,5,6}; */
int transo[8] = { 4, 3, 5, 3, 6, 3, 7, 3 }; /* According to hardware tests */
switch (A & 0xf1ff) {
case 0x4022: reg = transo[V & 7]; Sync(); break;
case 0x4120: swap = V & 1; Sync(); break;
case 0x8122: // hacked version
case 0x4122: IRQa = V & 1; X6502_IRQEnd(FCEU_IQEXT); IRQCount = 0; break; // original version
case 0x8122: /* hacked version */
case 0x4122: IRQa = V & 1; X6502_IRQEnd(FCEU_IQEXT); IRQCount = 0; break; /* original version */
}
}

View File

@@ -40,8 +40,9 @@ static void Sync(void) {
setprg16(0x8000, (prg_reg >> 5) & 7);
setprg16(0xC000, (prg_reg >> 5) & 7);
}
// Mirroring (0=Vert, 1=Horz)
// https://wiki.nesdev.com/w/index.php/INES_Mapper_057
/* Mirroring (0=Vert, 1=Horz)
* https://wiki.nesdev.com/w/index.php/INES_Mapper_057
*/
setmirror((prg_reg & 8) ? MI_H : MI_V);
setchr8((chr_reg & 7) | (prg_reg & 7) | ((chr_reg & 0x40) >> 3));
}

View File

@@ -95,7 +95,7 @@ static DECLFW(M69Write1) {
}
}
// SUNSOFT-5/FME-7 Sound
/* SUNSOFT-5/FME-7 Sound */
static void AYSound(int Count);
static void AYSoundHQ(void);
@@ -218,7 +218,7 @@ void Mapper69_ESI(void) {
AddExState(&SStateRegs, ~0, 0, 0);
}
// SUNSOFT-5/FME-7 Sound
/* SUNSOFT-5/FME-7 Sound */
static void M69Power(void) {
cmdreg = sndcmd = 0;

View File

@@ -39,7 +39,7 @@ static void Sync(void) {
static DECLFW(M71Write) {
if ((A & 0xF000) == 0x9000)
mirr = MI_0 + ((V >> 4) & 1); // 2-in-1, some carts are normal hardwire V/H mirror, some uses mapper selectable 0/1 mirror
mirr = MI_0 + ((V >> 4) & 1); /* 2-in-1, some carts are normal hardwire V/H mirror, some uses mapper selectable 0/1 mirror */
else
preg = V;
Sync();

View File

@@ -37,7 +37,7 @@ static void Sync(void) {
uint32 bank = (cmdreg & 0x01C) >> 2;
uint32 lbank = (cmdreg & 0x200) ? 7 : ((cmdreg & 0x80) ? bank : 0);
if (PRGptr[1]) {
setprg16r(base >> 3, 0x8000, bank); // for versions with split ROMs
setprg16r(base >> 3, 0x8000, bank); /* for versions with split ROMs */
setprg16r(base >> 3, 0xC000, lbank);
} else {
setprg16(0x8000, base | bank);

View File

@@ -67,7 +67,7 @@ static void M82Power(void) {
Sync();
SetReadHandler(0x6000, 0xffff, CartBR);
SetWriteHandler(0x6000, 0x7fff, CartBW);
SetWriteHandler(0x7ef0, 0x7efc, M82Write); // external WRAM might end at $73FF
SetWriteHandler(0x7ef0, 0x7efc, M82Write); /* external WRAM might end at $73FF */
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
}

View File

@@ -31,24 +31,24 @@ static uint8 regperm[8][8] =
{
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 0, 2, 6, 1, 7, 3, 4, 5 },
{ 0, 5, 4, 1, 7, 2, 6, 3 }, // unused
{ 0, 5, 4, 1, 7, 2, 6, 3 }, /* unused */
{ 0, 6, 3, 7, 5, 2, 4, 1 },
{ 0, 2, 5, 3, 6, 1, 7, 4 },
{ 0, 1, 2, 3, 4, 5, 6, 7 }, // empty
{ 0, 1, 2, 3, 4, 5, 6, 7 }, // empty
{ 0, 1, 2, 3, 4, 5, 6, 7 }, // empty
{ 0, 1, 2, 3, 4, 5, 6, 7 }, /* empty */
{ 0, 1, 2, 3, 4, 5, 6, 7 }, /* empty */
{ 0, 1, 2, 3, 4, 5, 6, 7 }, /* empty */
};
static uint8 adrperm[8][8] =
{
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 3, 2, 0, 4, 1, 5, 6, 7 },
{ 0, 1, 2, 3, 4, 5, 6, 7 }, // unused
{ 0, 1, 2, 3, 4, 5, 6, 7 }, /* unused */
{ 5, 0, 1, 2, 3, 7, 6, 4 },
{ 3, 1, 0, 5, 2, 4, 6, 7 },
{ 0, 1, 2, 3, 4, 5, 6, 7 }, // empty
{ 0, 1, 2, 3, 4, 5, 6, 7 }, // empty
{ 0, 1, 2, 3, 4, 5, 6, 7 }, // empty
{ 0, 1, 2, 3, 4, 5, 6, 7 }, /* empty */
{ 0, 1, 2, 3, 4, 5, 6, 7 }, /* empty */
{ 0, 1, 2, 3, 4, 5, 6, 7 }, /* empty */
};
static void UNL8237CW(uint32 A, uint8 V) {
@@ -98,30 +98,30 @@ static void UNL8237APW(uint32 A, uint8 V) {
if (EXPREGS[0] & 0x80) {
uint8 bank = ((EXPREGS[1] & 3) << 4) | ((EXPREGS[1] & 8) << 3) | (EXPREGS[0] & 0x7) | (sbank >> 1);
if (EXPREGS[0] & 0x20) {
// FCEU_printf("8000:%02X\n",bank>>1);
/* FCEU_printf("8000:%02X\n",bank>>1); */
setprg32(0x8000, bank >> 1);
} else {
// FCEU_printf("8000-C000:%02X\n",bank);
/* FCEU_printf("8000-C000:%02X\n",bank); */
setprg16(0x8000, bank);
setprg16(0xC000, bank);
}
} else {
// FCEU_printf("%04x:%02X\n",A,((EXPREGS[1]&3)<<5)|((EXPREGS[1]&8)<<4)|(V&0x0F)|sbank);
/* FCEU_printf("%04x:%02X\n",A,((EXPREGS[1]&3)<<5)|((EXPREGS[1]&8)<<4)|(V&0x0F)|sbank); */
setprg8(A, ((EXPREGS[1] & 3) << 5) | ((EXPREGS[1] & 8) << 4) | (V & 0x0F) | sbank);
}
} else {
if (EXPREGS[0] & 0x80) {
uint8 bank = ((EXPREGS[1] & 3) << 4) | ((EXPREGS[1] & 8) << 3) | (EXPREGS[0] & 0xF);
if (EXPREGS[0] & 0x20) {
// FCEU_printf("8000:%02X\n",(bank>>1)&0x07);
/* FCEU_printf("8000:%02X\n",(bank>>1)&0x07); */
setprg32(0x8000, bank >> 1);
} else {
// FCEU_printf("8000-C000:%02X\n",bank&0x0F);
/* FCEU_printf("8000-C000:%02X\n",bank&0x0F); */
setprg16(0x8000, bank);
setprg16(0xC000, bank);
}
} else {
// FCEU_printf("%04X:%02X\n",A,(((EXPREGS[1]&3)<<5)|((EXPREGS[1]&8)<<4)|(V&0x1F))&0x1F);
/* FCEU_printf("%04X:%02X\n",A,(((EXPREGS[1]&3)<<5)|((EXPREGS[1]&8)<<4)|(V&0x1F))&0x1F); */
setprg8(A, ((EXPREGS[1] & 3) << 5) | ((EXPREGS[1] & 8) << 4) | (V & 0x1F));
}
}

View File

@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
// M-022 MMC3 based 830118C T-106 4M + 4M
/* M-022 MMC3 based 830118C T-106 4M + 4M */
#include "mapinc.h"
#include "mmc3.h"

View File

@@ -32,7 +32,7 @@ static void BMC8IN1CW(uint32 A, uint8 V) {
}
static void BMC8IN1PW(uint32 A, uint8 V) {
if(EXPREGS[0] & 0x10) { // MMC3 mode
if(EXPREGS[0] & 0x10) { /* MMC3 mode */
setprg8(A, ((EXPREGS[0] & 0xC) << 2) | (V & 0xF));
} else {
setprg32(0x8000, EXPREGS[0] & 0xF);

View File

@@ -20,21 +20,22 @@
*/
#include "mapinc.h"
//#define DEBUG90
/* #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
/* 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 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;
@@ -74,12 +75,12 @@ static SFORMAT Tek_StateRegs[] = {
static void mira(void) {
if ((tkcom[0] & 0x20 && is209) || is211) {
int x;
if (tkcom[0] & 0x40) { // Name tables are ROM-only
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.
} else { /* Name tables can be RAM or ROM. */
for (x = 0; x < 4; x++) {
if ((tkcom[1] & 0x80) == (names[x] & 0x80)) // RAM selected.
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);
@@ -109,7 +110,7 @@ static void tekprom(void) {
setprg16(0x8000, (prgb[1] & 0x1F) | ((tkcom[3] & 6) << 4));
setprg16(0xC000, 0x1F | ((tkcom[3] & 6) << 4));
break;
case 03: // bit reversion
case 03: /* bit reversion */
case 02:
if (tkcom[0] & 0x80)
setprg8(0x6000, (prgb[3] & 0x3F) | bankmode);
@@ -129,7 +130,7 @@ static void tekprom(void) {
setprg16(0x8000, (prgb[1] & 0x1F) | ((tkcom[3] & 6) << 4));
setprg16(0xC000, (prgb[3] & 0x1F) | ((tkcom[3] & 6) << 4));
break;
case 07: // bit reversion
case 07: /* bit reversion */
case 06:
if (tkcom[0] & 0x80)
setprg8(0x6000, (prgb[3] & 0x3F) | bankmode);
@@ -153,20 +154,22 @@ static void tekvrom(void) {
}
}
switch (tkcom[0] & 0x18) {
case 0x00: // 8KB
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);
case 0x08: /* 4KB */
#if 0
for(x=0;x<8;x+=4)
setchr4(x<<10,((chrlow[x]|(chrhigh[x]<<8))&mask)|bank);
#endif
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
case 0x10: /* 2KB */
for (x = 0; x < 8; x += 2)
setchr2(x << 10, ((chrlow[x] | (chrhigh[x] << 8)) & mask) | bank);
break;
case 0x18: // 1KB
case 0x18: /* 1KB */
for (x = 0; x < 8; x++)
setchr1(x << 10, ((chrlow[x] | (chrhigh[x] << 8)) & mask) | bank);
break;
@@ -192,25 +195,25 @@ static DECLFR(M90TekRead) {
}
static DECLFW(M90PRGWrite) {
// FCEU_printf("bs %04x %02x\n",A,V);
/* FCEU_printf("bs %04x %02x\n",A,V); */
prgb[A & 3] = V;
tekprom();
}
static DECLFW(M90CHRlowWrite) {
// FCEU_printf("bs %04x %02x\n",A,V);
/* FCEU_printf("bs %04x %02x\n",A,V); */
chrlow[A & 7] = V;
tekvrom();
}
static DECLFW(M90CHRhiWrite) {
// FCEU_printf("bs %04x %02x\n",A,V);
/* FCEU_printf("bs %04x %02x\n",A,V); */
chrhigh[A & 7] = V;
tekvrom();
}
static DECLFW(M90NTWrite) {
// FCEU_printf("bs %04x %02x\n",A,V);
/* FCEU_printf("bs %04x %02x\n",A,V); */
if (A & 4) {
names[A & 3] &= 0x00FF;
names[A & 3] |= V << 8;
@@ -222,25 +225,26 @@ static DECLFW(M90NTWrite) {
}
static DECLFW(M90IRQWrite) {
// FCEU_printf("bs %04x %02x\n",A,V);
/* FCEU_printf("bs %04x %02x\n",A,V); */
switch (A & 7) {
case 00:
// FCEU_printf("%s IRQ (C000)\n",V&1?"Enable":"Disable");
/* 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);
/* 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);
/* FCEU_printf("Enable IRQ (C003) scanline=%d\n", scanline); */
IRQa = 1;
break;
case 01:
IRQMode = V;
/*FCEU_printf("IRQ Count method: ");
#if 0
FCEU_printf("IRQ Count method: ");
switch (IRQMode&3)
{
case 00: FCEU_printf("M2 cycles\n");break;
@@ -252,31 +256,34 @@ static DECLFW(M90IRQWrite) {
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");*/
else FCEU_printf("Counter Stopped\n");
#endif
break;
case 04:
// FCEU_printf("Pre Counter Loaded and Xored wiht C006: %d\n",V^IRQXOR);
/* 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);
/* 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);
/* 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");
#if 0
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");
#endif
IRQPreSize = V;
break;
}
}
static DECLFW(M90ModeWrite) {
// FCEU_printf("bs %04x %02x\n",A,V);
/* FCEU_printf("bs %04x %02x\n",A,V); */
tkcom[A & 3] = V;
tekprom();
tekvrom();
@@ -317,16 +324,16 @@ static DECLFW(M90ModeWrite) {
}
static DECLFW(M90DummyWrite) {
// FCEU_printf("bs %04x %02x\n",A,V);
/* FCEU_printf("bs %04x %02x\n",A,V); */
}
static void CCL(void) {
if ((IRQMode >> 6) == 1) { // Count Up
if ((IRQMode >> 6) == 1) { /* Count Up */
IRQCount++;
if ((IRQCount == 0) && IRQa) {
X6502_IRQBegin(FCEU_IQEXT);
}
} else if ((IRQMode >> 6) == 2) { // Count down
} else if ((IRQMode >> 6) == 2) { /* Count down */
IRQCount--;
if ((IRQCount == 0xFF) && IRQa) {
X6502_IRQBegin(FCEU_IQEXT);
@@ -341,10 +348,10 @@ static void ClockCounter(void) {
premask = 0x7;
else
premask = 0xFF;
if ((IRQMode >> 6) == 1) { // Count up
if ((IRQMode >> 6) == 1) { /* Count up */
IRQPre++;
if ((IRQPre & premask) == 0) CCL();
} else if ((IRQMode >> 6) == 2) { // Count down
} else if ((IRQMode >> 6) == 2) { /* Count down */
IRQPre--;
if ((IRQPre & premask) == premask) CCL();
}

View File

@@ -28,8 +28,10 @@
static void UNLBMW8544PW(uint32 A, uint8 V) {
if(A == 0x8000)
setprg8(A,EXPREGS[0] & 0x1F); // the real hardware has this bank overrided with it's own register,
else // but MMC3 prg swap still works and you can actually change bank C000 at the same time if use 0x46 cmd
setprg8(A,EXPREGS[0] & 0x1F); /* the real hardware has this bank overrided with it's own register,
* but MMC3 prg swap still works and you can actually change bank C000 at the same time if use 0x46 cmd
*/
else
setprg8(A,V);
}
@@ -54,12 +56,12 @@ static DECLFR(UNLBMW8544ProtRead) {
if(!fceuindbg) {
if(!(A & 1)) {
if((EXPREGS[0] & 0xE0) == 0xC0) {
EXPREGS[1] = ARead[0x6a](0x6a); // program can latch some data from the BUS, but I can't say how exactly,
} else { // without more euipment and skills ;) probably here we can try to get any write
EXPREGS[2] = ARead[0xff](0xff); // before the read operation
EXPREGS[1] = ARead[0x6a](0x6a); /* program can latch some data from the BUS, but I can't say how exactly, */
} else { /* without more equipment and skills ;) probably here we can try to get any write */
EXPREGS[2] = ARead[0xff](0xff); /* before the read operation */
}
FixMMC3CHR(MMC3_cmd & 0x7F); // there are more different behaviour of the board isn't used by game itself, so unimplemented here and
} // actually will break the current logic ;)
FixMMC3CHR(MMC3_cmd & 0x7F); /* there are more different behaviour of the board that's not used by game itself, so unimplemented here and */
} /* actually will break the current logic ;) */
}
return 0;
}

View File

@@ -40,7 +40,7 @@ static void Sync(void) {
}
static DECLFW(UNLKS7012Write) {
// FCEU_printf("bs %04x %02x\n",A,V);
/* FCEU_printf("bs %04x %02x\n",A,V); */
switch (A) {
case 0xE0A0: reg = 0; Sync(); break;
case 0xEE36: reg = 1; Sync(); break;

View File

@@ -45,7 +45,7 @@ static void Sync(void) {
}
static DECLFW(UNLKS7017Write) {
// FCEU_printf("bs %04x %02x\n",A,V);
/* FCEU_printf("bs %04x %02x\n",A,V); */
if ((A & 0xFF00) == 0x4A00) {
reg = ((A >> 2) & 3) | ((A >> 4) & 4);
} else if ((A & 0xFF00) == 0x5100) {

View File

@@ -45,9 +45,10 @@ static void Sync(void) {
setprg4(0xc800, 8 + reg1);
}
// 6000 - 6BFF - RAM
// 6C00 - 6FFF - BANK 1K REG1
// 7000 - 7FFF - BANK 4K REG0
/* 6000 - 6BFF - RAM
* 6C00 - 6FFF - BANK 1K REG1
* 7000 - 7FFF - BANK 4K REG0
*/
static DECLFW(UNLKS7030RamWrite0) {
if ((A >= 0x6000) && A <= 0x6BFF) {
@@ -70,9 +71,10 @@ static DECLFR(UNLKS7030RamRead0) {
return 0;
}
// B800 - BFFF - RAM
// C000 - CBFF - BANK 3K
// CC00 - D7FF - RAM
/* B800 - BFFF - RAM
* C000 - CBFF - BANK 3K
* CC00 - D7FF - RAM
*/
static DECLFW(UNLKS7030RamWrite1) {
if ((A >= 0xB800) && A <= 0xBFFF) {

View File

@@ -45,9 +45,9 @@ static void Sync(void) {
}
static DECLFW(UNLKS7032Write) {
// FCEU_printf("bs %04x %02x\n",A,V);
/* FCEU_printf("bs %04x %02x\n",A,V); */
switch (A & 0xF000) {
// case 0x8FFF: reg[4]=V; Sync(); break;
/* case 0x8FFF: reg[4]=V; Sync(); break; */
case 0x8000: X6502_IRQEnd(FCEU_IQEXT); IRQCount = (IRQCount & 0x000F) | (V & 0x0F); isirqused = 1; break;
case 0x9000: X6502_IRQEnd(FCEU_IQEXT); IRQCount = (IRQCount & 0x00F0) | ((V & 0x0F) << 4); isirqused = 1; break;
case 0xA000: X6502_IRQEnd(FCEU_IQEXT); IRQCount = (IRQCount & 0x0F00) | ((V & 0x0F) << 8); isirqused = 1; break;

View File

@@ -46,8 +46,8 @@ static DECLFW(MNNNWrite) {
}
static void MNNNPower(void) {
// SetReadHandler(0x6000, 0x7fff, CartBR);
// SetWriteHandler(0x6000, 0x7fff, CartBW);
/* SetReadHandler(0x6000, 0x7fff, CartBR); */
/* SetWriteHandler(0x6000, 0x7fff, CartBW); */
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x8000, 0xFFFF, MNNNWrite);
}
@@ -76,16 +76,15 @@ static void StateRestore(int version) {
void MapperNNN_Init(CartInfo *info) {
info->Reset = MNNNReset;
info->Power = MNNNPower;
// info->Close = MNNNClose;
/* info->Close = MNNNClose; */
GameHBIRQHook = MNNNIRQHook;
GameStateRestore = StateRestore;
/*
#if 0
CHRRAMSIZE = 8192;
CHRRAM = (uint8*)FCEU_gmalloc(CHRRAMSIZE);
SetupCartCHRMapping(0x10, CHRRAM, CHRRAMSIZE, 1);
AddExState(CHRRAM, CHRRAMSIZE, 0, "CRAM");
*/
/*
WRAMSIZE = 8192;
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
@@ -94,6 +93,6 @@ void MapperNNN_Init(CartInfo *info) {
info->SaveGame[0] = WRAM;
info->SaveGameLen[0] = WRAMSIZE;
}
*/
#endif
AddExState(&StateRegs, ~0, 0, 0);
}

View File

@@ -2,7 +2,7 @@
#if defined(_WIN32) && !defined(_XBOX) && !defined(__LIBRETRO__)
HANDLE SerialPort = NULL; // Handle of SerialPort itself.
HANDLE SerialPort = NULL; /* Handle of SerialPort itself. */
BOOL SerialOpen(int port, int baud) {
HANDLE Comport;
@@ -15,24 +15,24 @@ BOOL SerialOpen(int port, int baud) {
else
sprintf(str, "COM%d", port);
// Open the serial port
/* Open the serial port */
if ((Comport = CreateFile(str, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
return FALSE;
// Configure Serial port (Setup Comm)
/* Configure Serial port (Setup Comm) */
// Buffer sizes
/* Buffer sizes */
if (!SetupComm(Comport, 128, 128))
return FALSE;
// Setup DCB using current values
/* Setup DCB using current values */
if (!GetCommState(Comport, &myDCB))
return FALSE;
myDCB.fInX = FALSE; // Turn off xon/xoff handler
myDCB.fInX = FALSE; /* Turn off xon/xoff handler */
myDCB.fOutX = FALSE;
myDCB.fOutxDsrFlow = FALSE;
myDCB.fOutxCtsFlow = FALSE; // no hardware flow control.
myDCB.fOutxCtsFlow = FALSE; /* no hardware flow control. */
myDCB.BaudRate = baud;
myDCB.DCBlength = sizeof(DCB);
myDCB.fBinary = 1;
@@ -52,12 +52,12 @@ BOOL SerialOpen(int port, int baud) {
if (!SetCommState(Comport, &myDCB))
return FALSE;
// Set timeouts
/* Set timeouts */
CTout.ReadIntervalTimeout = 0xffffffff;
CTout.ReadTotalTimeoutMultiplier = 0;
CTout.ReadTotalTimeoutConstant = 0;
CTout.WriteTotalTimeoutMultiplier = 0;
CTout.WriteTotalTimeoutConstant = 5000; // don't hang if CTS is locked, for example
CTout.WriteTotalTimeoutConstant = 5000; /* don't hang if CTS is locked, for example */
SetCommTimeouts(Comport, &CTout);
EscapeCommFunction(Comport, SETDTR);

View File

@@ -22,7 +22,7 @@
#include "mmc3.h"
static DECLFW(UNLA9746Write) {
// FCEU_printf("write raw %04x:%02x\n",A,V);
/* FCEU_printf("write raw %04x:%02x\n",A,V); */
switch (A & 0xE003) {
case 0x8000: EXPREGS[1] = V; EXPREGS[0] = 0; break;
case 0x8002: EXPREGS[0] = V; EXPREGS[1] = 0; break;

View File

@@ -45,10 +45,10 @@ static DECLFW(AC08Mirr) {
}
static DECLFW(AC08Write) {
if (A == 0x8001) // Green Berret bank switching is only 100x xxxx xxxx xxx1 mask
if (A == 0x8001) /* Green Berret bank switching is only 100x xxxx xxxx xxx1 mask */
reg = (V >> 1) & 0xf;
else
reg = V & 0xf; // Sad But True, 2-in-1 mapper, Green Berret need value shifted left one byte, Castlevania doesn't
reg = V & 0xf; /* Sad But True, 2-in-1 mapper, Green Berret need value shifted left one byte, Castlevania doesn't */
Sync();
}

View File

@@ -86,7 +86,7 @@ static void Latch_Init(CartInfo *info, void (*proc)(void), readfunc func, uint16
AddExState(&latche, 2, 0, "LATC");
}
//------------------ BMCD1038 ---------------------------
/*------------------ BMCD1038 ---------------------------*/
static void BMCD1038Sync(void) {
if (latche & 0x80) {
@@ -116,8 +116,8 @@ void BMCD1038_Init(CartInfo *info) {
AddExState(&dipswitch, 1, 0, "DIPSW");
}
//------------------ UNL43272 ---------------------------
// mapper much complex, including 16K bankswitching
/*------------------ UNL43272 ---------------------------*/
/* mapper much complex, including 16K bankswitching */
static void UNL43272Sync(void) {
if ((latche & 0x81) == 0x81) {
setprg32(0x8000, (latche & 0x38) >> 3);
@@ -145,7 +145,7 @@ void UNL43272_Init(CartInfo *info) {
AddExState(&dipswitch, 1, 0, "DIPSW");
}
//------------------ Map 058 ---------------------------
/*------------------ Map 058 ---------------------------*/
static void BMCGK192Sync(void) {
if (latche & 0x40) {
@@ -161,8 +161,8 @@ void BMCGK192_Init(CartInfo *info) {
Latch_Init(info, BMCGK192Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 059 ---------------------------
// One more forgotten mapper
/*------------------ Map 059 ---------------------------*/
/* One more forgotten mapper */
static void M59Sync(void) {
setprg32(0x8000, (latche >> 4) & 7);
setchr8(latche & 0x7);
@@ -180,7 +180,7 @@ void Mapper59_Init(CartInfo *info) {
Latch_Init(info, M59Sync, M59Read, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 061 ---------------------------
/*------------------ Map 061 ---------------------------*/
static void M61Sync(void) {
if (((latche & 0x10) << 1) ^ (latche & 0x20)) {
setprg16(0x8000, ((latche & 0xF) << 1) | (((latche & 0x20) >> 4)));
@@ -195,11 +195,12 @@ void Mapper61_Init(CartInfo *info) {
Latch_Init(info, M61Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 092 ---------------------------
// Another two-in-one mapper, two Jaleco carts uses similar
// hardware, but with different wiring.
// Original code provided by LULU
// Additionally, PCB contains DSP extra sound chip, used for voice samples (unemulated)
/*------------------ Map 092 ---------------------------*/
/* Another two-in-one mapper, two Jaleco carts uses similar
* hardware, but with different wiring.
* Original code provided by LULU
* Additionally, PCB contains DSP extra sound chip, used for voice samples (unemulated)
*/
static void M92Sync(void) {
uint8 reg = latche & 0xF0;
@@ -221,7 +222,7 @@ void Mapper92_Init(CartInfo *info) {
Latch_Init(info, M92Sync, NULL, 0x80B0, 0x8000, 0xFFFF, 0);
}
//------------------ Map 200 ---------------------------
/*------------------ Map 200 ---------------------------*/
static void M200Sync(void) {
setprg16(0x8000, latche & 7);
@@ -234,7 +235,7 @@ void Mapper200_Init(CartInfo *info) {
Latch_Init(info, M200Sync, NULL, 0xFFFF, 0x8000, 0xFFFF, 0);
}
//------------------ Map 201 ---------------------------
/*------------------ Map 201 ---------------------------*/
static void M201Sync(void) {
if (latche & 8) {
@@ -250,10 +251,10 @@ void Mapper201_Init(CartInfo *info) {
Latch_Init(info, M201Sync, NULL, 0xFFFF, 0x8000, 0xFFFF, 0);
}
//------------------ Map 202 ---------------------------
/*------------------ Map 202 ---------------------------*/
static void M202Sync(void) {
// According to more carefull hardware tests and PCB study
/* According to more carefull hardware tests and PCB study */
int32 mirror = latche & 1;
int32 bank = (latche >> 1) & 0x7;
int32 select = (mirror & (bank >> 2));
@@ -267,7 +268,7 @@ void Mapper202_Init(CartInfo *info) {
Latch_Init(info, M202Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 204 ---------------------------
/*------------------ Map 204 ---------------------------*/
static void M204Sync(void) {
int32 tmp2 = latche & 0x6;
@@ -282,7 +283,7 @@ void Mapper204_Init(CartInfo *info) {
Latch_Init(info, M204Sync, NULL, 0xFFFF, 0x8000, 0xFFFF, 0);
}
//------------------ Map 212 ---------------------------
/*------------------ Map 212 ---------------------------*/
static DECLFR(M212Read) {
uint8 ret = CartBROB(A);
@@ -306,7 +307,7 @@ void Mapper212_Init(CartInfo *info) {
Latch_Init(info, M212Sync, M212Read, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 213 ---------------------------
/*------------------ Map 213 ---------------------------*/
static void M213Sync(void) {
setprg32(0x8000, (latche >> 1) & 3);
@@ -317,7 +318,7 @@ void Mapper213_Init(CartInfo *info) {
Latch_Init(info, M213Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 214 ---------------------------
/*------------------ Map 214 ---------------------------*/
static void M214Sync(void) {
setprg16(0x8000, (latche >> 2) & 3);
@@ -329,7 +330,7 @@ void Mapper214_Init(CartInfo *info) {
Latch_Init(info, M214Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 217 ---------------------------
/*------------------ Map 217 ---------------------------*/
static void M217Sync(void) {
setprg32(0x8000, (latche >> 2) & 3);
@@ -340,7 +341,7 @@ void Mapper217_Init(CartInfo *info) {
Latch_Init(info, M217Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 227 ---------------------------
/*------------------ Map 227 ---------------------------*/
static void M227Sync(void) {
uint32 S = latche & 1;
@@ -383,7 +384,7 @@ void Mapper227_Init(CartInfo *info) {
Latch_Init(info, M227Sync, NULL, 0x0000, 0x8000, 0xFFFF, 1);
}
//------------------ Map 229 ---------------------------
/*------------------ Map 229 ---------------------------*/
static void M229Sync(void) {
setchr8(latche);
@@ -400,7 +401,7 @@ void Mapper229_Init(CartInfo *info) {
Latch_Init(info, M229Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 231 ---------------------------
/*------------------ Map 231 ---------------------------*/
static void M231Sync(void) {
setchr8(0);
@@ -417,7 +418,7 @@ void Mapper231_Init(CartInfo *info) {
Latch_Init(info, M231Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 242 ---------------------------
/*------------------ Map 242 ---------------------------*/
static void M242Sync(void) {
setchr8(0);
@@ -430,7 +431,7 @@ void Mapper242_Init(CartInfo *info) {
Latch_Init(info, M242Sync, NULL, 0x0000, 0x8000, 0xFFFF, 1);
}
//------------------ 190in1 ---------------------------
/*------------------ 190in1 ---------------------------*/
static void BMC190in1Sync(void) {
setprg16(0x8000, (latche >> 2) & 7);
@@ -443,7 +444,7 @@ void BMC190in1_Init(CartInfo *info) {
Latch_Init(info, BMC190in1Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//-------------- BMC810544-C-A1 ------------------------
/*-------------- BMC810544-C-A1 ------------------------*/
static void BMC810544CA1Sync(void) {
uint32 bank = latche >> 7;
@@ -461,13 +462,14 @@ void BMC810544CA1_Init(CartInfo *info) {
Latch_Init(info, BMC810544CA1Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//-------------- BMCNTD-03 ------------------------
/*-------------- BMCNTD-03 ------------------------*/
static void BMCNTD03Sync(void) {
// 1PPP Pmcc spxx xccc
// 1000 0000 0000 0000 v
// 1001 1100 0000 0100 h
// 1011 1010 1100 0100
/* 1PPP Pmcc spxx xccc
* 1000 0000 0000 0000 v
* 1001 1100 0000 0100 h
* 1011 1010 1100 0100
*/
uint32 prg = ((latche >> 10) & 0x1e);
uint32 chr = ((latche & 0x0300) >> 5) | (latche & 7);
if (latche & 0x80) {
@@ -483,15 +485,15 @@ void BMCNTD03_Init(CartInfo *info) {
Latch_Init(info, BMCNTD03Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//-------------- BMCG-146 ------------------------
/*-------------- BMCG-146 ------------------------*/
static void BMCG146Sync(void) {
setchr8(0);
if (latche & 0x800) { // UNROM mode
if (latche & 0x800) { /* UNROM mode */
setprg16(0x8000, (latche & 0x1F) | (latche & ((latche & 0x40) >> 6)));
setprg16(0xC000, (latche & 0x18) | 7);
} else {
if (latche & 0x40) { // 16K mode
if (latche & 0x40) { /* 16K mode */
setprg16(0x8000, latche & 0x1F);
setprg16(0xC000, latche & 0x1F);
} else {

View File

@@ -22,7 +22,7 @@
#include "mapinc.h"
static uint8 IRQCount; //, IRQPre;
static uint8 IRQCount; /*, IRQPre; */
static uint8 IRQa;
static uint8 prg_reg[2];
static uint8 chr_reg[8];
@@ -38,16 +38,17 @@ static SFORMAT StateRegs[] =
{ 0 }
};
/*
#if 0
static void UNLAX5705IRQ(void) {
if(IRQa) {
IRQCount++;
if(IRQCount>=238) {
X6502_IRQBegin(FCEU_IQEXT);
// IRQa=0;
/* IRQa=0; */
}
}
}*/
}
#endif
static void Sync(void) {
int i;
@@ -61,14 +62,16 @@ static void Sync(void) {
}
static DECLFW(UNLAX5705Write) {
// if((A>=0xA008)&&(A<=0xE003)) {
// int ind=(((A>>11)-6)|(A&1))&7;
// int sar=((A&2)<<1);
// chr_reg[ind]=(chr_reg[ind]&(0xF0>>sar))|((V&0x0F)<<sar);
// SyncChr();
// } else
#if 0
if((A>=0xA008)&&(A<=0xE003)) {
int ind=(((A>>11)-6)|(A&1))&7;
int sar=((A&2)<<1);
chr_reg[ind]=(chr_reg[ind]&(0xF0>>sar))|((V&0x0F)<<sar);
SyncChr();
} else
#endif
switch (A & 0xF00F) {
case 0x8000: prg_reg[0] = ((V & 2) << 2) | ((V & 8) >> 2) | (V & 5); break; // EPROM dump have mixed PRG and CHR banks, data lines to mapper seems to be mixed
case 0x8000: prg_reg[0] = ((V & 2) << 2) | ((V & 8) >> 2) | (V & 5); break; /* EPROM dump have mixed PRG and CHR banks, data lines to mapper seems to be mixed */
case 0x8008: mirr = V & 1; break;
case 0xA000: prg_reg[1] = ((V & 2) << 2) | ((V & 8) >> 2) | (V & 5); break;
case 0xA008: chr_reg[0] = (chr_reg[0] & 0xF0) | (V & 0x0F); break;
@@ -87,8 +90,10 @@ static DECLFW(UNLAX5705Write) {
case 0xE001: chr_reg[6] = (chr_reg[6] & 0x0F) | ((((V & 4) >> 1) | ((V & 2) << 1) | (V & 0x09)) << 4); break;
case 0xE002: chr_reg[7] = (chr_reg[7] & 0xF0) | (V & 0x0F); break;
case 0xE003: chr_reg[7] = (chr_reg[7] & 0x0F) | ((((V & 4) >> 1) | ((V & 2) << 1) | (V & 0x09)) << 4); break;
// case 0x800A: X6502_IRQEnd(FCEU_IQEXT); IRQa=0; break;
// case 0xE00B: X6502_IRQEnd(FCEU_IQEXT); IRQa=IRQCount=V; /*if(scanline<240) IRQCount-=8; else IRQCount+=4;*/ break;
#if 0
case 0x800A: X6502_IRQEnd(FCEU_IQEXT); IRQa=0; break;
case 0xE00B: X6502_IRQEnd(FCEU_IQEXT); IRQa=IRQCount=V; /*if(scanline<240) IRQCount-=8; else IRQCount+=4;*/ break;
#endif
}
Sync();
}
@@ -105,7 +110,7 @@ static void StateRestore(int version) {
void UNLAX5705_Init(CartInfo *info) {
info->Power = UNLAX5705Power;
// GameHBIRQHook=UNLAX5705IRQ;
/* GameHBIRQHook=UNLAX5705IRQ; */
GameStateRestore = StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

View File

@@ -36,11 +36,11 @@ static SFORMAT StateRegs[] =
{ reg, 16, "REGS" },
{ &IRQa, 1, "IRQA" },
{ &IRQCount, 2, "IRQC" },
{ &IRQLatch, 2, "IRQL" }, // need for Famicom Jump II - Saikyou no 7 Nin (J) [!]
{ &IRQLatch, 2, "IRQL" }, /* need for Famicom Jump II - Saikyou no 7 Nin (J) [!] */
{ 0 }
};
// x24C0x interface
/* x24C0x interface */
#define X24C0X_STANDBY 0
#define X24C0X_ADDRESS 1
@@ -77,26 +77,26 @@ static void x24c0x_write(uint8 data) {
x24c0x_oe = (data >> 7);
if(x24c0x_scl && scl) {
if(x24c0x_sda && !sda) { // START
if(x24c0x_sda && !sda) { /* START */
x24c0x_state = X24C0X_ADDRESS;
x24c0x_bitcount = 0;
x24c0x_addr = 0;
} else if(!x24c0x_sda && sda) { //STOP
} else if(!x24c0x_sda && sda) { /* STOP */
x24c0x_state = X24C0X_STANDBY;
}
} else if(!x24c0x_scl && scl) { // RISING EDGE
} else if(!x24c0x_scl && scl) { /* RISING EDGE */
switch(x24c0x_state) {
case X24C0X_ADDRESS:
if(x24c0x_bitcount < 7) {
x24c0x_addr <<= 1;
x24c0x_addr |= sda;
} else {
if(!x24c02) // X24C01 mode
if(!x24c02) /* X24C01 mode */
x24c0x_word = x24c0x_addr;
if(sda) { // READ COMMAND
if(sda) { /* READ COMMAND */
x24c0x_state = X24C0X_READ;
} else { // WRITE COMMAND
if(x24c02) // X24C02 mode
} else { /* WRITE COMMAND */
if(x24c02) /* X24C02 mode */
x24c0x_state = X24C0X_WORD;
else
x24c0x_state = X24C0X_WRITE;
@@ -105,13 +105,13 @@ static void x24c0x_write(uint8 data) {
x24c0x_bitcount++;
break;
case X24C0X_WORD:
if(x24c0x_bitcount == 8) { // ACK
if(x24c0x_bitcount == 8) { /* ACK */
x24c0x_word = 0;
x24c0x_out = 0;
} else { // WORD ADDRESS INPUT
} else { /* WORD ADDRESS INPUT */
x24c0x_word <<= 1;
x24c0x_word |= sda;
if(x24c0x_bitcount == 16) { // END OF ADDRESS INPUT
if(x24c0x_bitcount == 16) { /* END OF ADDRESS INPUT */
x24c0x_bitcount = 7;
x24c0x_state = X24C0X_WRITE;
}
@@ -119,11 +119,11 @@ static void x24c0x_write(uint8 data) {
x24c0x_bitcount++;
break;
case X24C0X_READ:
if (x24c0x_bitcount == 8) { // ACK
if (x24c0x_bitcount == 8) { /* ACK */
x24c0x_out = 0;
x24c0x_latch = x24c0x_data[x24c0x_word];
x24c0x_bitcount = 0;
} else { // REAL OUTPUT
} else { /* REAL OUTPUT */
x24c0x_out = x24c0x_latch >> 7;
x24c0x_latch <<= 1;
x24c0x_bitcount++;
@@ -134,11 +134,11 @@ static void x24c0x_write(uint8 data) {
}
break;
case X24C0X_WRITE:
if (x24c0x_bitcount == 8) { // ACK
if (x24c0x_bitcount == 8) { /* ACK */
x24c0x_out = 0;
x24c0x_latch = 0;
x24c0x_bitcount = 0;
} else { // REAL INPUT
} else { /* REAL INPUT */
x24c0x_latch <<= 1;
x24c0x_latch |= sda;
x24c0x_bitcount++;
@@ -160,8 +160,6 @@ static uint8 x24c0x_read() {
return x24c0x_out << 4;
}
//
static void Sync(void) {
if (is153) {
int base = (reg[0] & 1) << 4;
@@ -256,12 +254,13 @@ void Mapper159_Init(CartInfo *info) {
AddExState(&StateRegs, ~0, 0, 0);
}
// Famicom jump 2:
// 0-7: Lower bit of data selects which 256KB PRG block is in use.
// This seems to be a hack on the developers' part, so I'll make emulation
// of it a hack(I think the current PRG block would depend on whatever the
// lowest bit of the CHR bank switching register that corresponds to the
// last CHR address read).
/* Famicom jump 2:
* 0-7: Lower bit of data selects which 256KB PRG block is in use.
* This seems to be a hack on the developers' part, so I'll make emulation
* of it a hack(I think the current PRG block would depend on whatever the
* lowest bit of the CHR bank switching register that corresponds to the
* last CHR address read).
*/
static void M153Power(void) {
Sync();
@@ -300,7 +299,7 @@ void Mapper153_Init(CartInfo *info) {
AddExState(&StateRegs, ~0, 0, 0);
}
// Datach Barcode Battler
/* Datach Barcode Battler */
static uint8 BarcodeData[256];
static int BarcodeReadPos;

View File

@@ -44,7 +44,7 @@ static DECLFW(UNLBBWrite) {
if ((A & 0x9000) == 0x8000)
reg = chr = V;
else
chr = V & 1; // hacky hacky, ProWres simplified FDS conversion 2-in-1 mapper
chr = V & 1; /* hacky hacky, ProWres simplified FDS conversion 2-in-1 mapper */
Sync();
}

View File

@@ -34,7 +34,7 @@ static SFORMAT StateRegs[] =
};
static void Sync(void) {
// FCEU_printf("%02x: %02x %02x\n", bank_mode, bank_value, prgb[0]);
/* FCEU_printf("%02x: %02x %02x\n", bank_mode, bank_value, prgb[0]); */
switch (bank_mode & 7) {
case 0:
setprg32(0x8000, bank_value & 7); break;
@@ -62,7 +62,7 @@ static void Sync(void) {
}
static DECLFW(BMC13in1JY110Write) {
// FCEU_printf("%04x:%04x\n",A,V);
/* FCEU_printf("%04x:%04x\n",A,V); */
switch (A) {
case 0x8000:
case 0x8001:

View File

@@ -59,10 +59,12 @@ static void Sync(void) {
static DECLFR(BMC70in1Read) {
if (bank_mode == 0x10)
// if(is_large_banks)
/* if(is_large_banks) */
return CartBR((A & 0xFFF0) | hw_switch);
// else
// return CartBR((A&0xFFF0)|hw_switch);
#if 0
else
return CartBR((A&0xFFF0)|hw_switch);
#endif
else
return CartBR(A);
}

View File

@@ -82,9 +82,9 @@ _MANAGE_CHANNEL: .BYTE 0,$70, 0, 0, 8
byte_8CE5: .BYTE 0,$74, 0, 0,$12
byte_8C29: .BYTE 0,$76, 0, 0, 8
byte_8CC6: .BYTE 0,$78, 0, 0,$12
#endif
#if 0 /* Silenced since unused */
static uint8 sim0reset[0x1F] = {
0x3B, 0xE9, 0x00, 0xFF, 0xC1, 0x10, 0x31, 0xFE,
0x55, 0xC8, 0x10, 0x20, 0x55, 0x47, 0x4F, 0x53,

View File

@@ -55,7 +55,7 @@ static void Sync(void) {
}
static DECLFW(UNLCITYFIGHTWrite) {
//FCEU_printf("%04x %02x",A,V);
/* FCEU_printf("%04x %02x",A,V); */
switch (A & 0xF00C) {
case 0x9000: prg_reg = V & 0xC; mirr = V & 3; break;
case 0x9004:

View File

@@ -34,31 +34,32 @@
static void COOLBOYCW(uint32 A, uint8 V) {
uint32 mask = 0xFF ^ (EXPREGS[0] & 0x80);
if (EXPREGS[3] & 0x10) {
if (EXPREGS[3] & 0x40) { // Weird mode
if (EXPREGS[3] & 0x40) { /* Weird mode */
int cbase = (MMC3_cmd & 0x80) << 5;
switch (cbase ^ A) { // Don't even try do understand
switch (cbase ^ A) { /* Don't even try to understand */
case 0x0400:
case 0x0C00: V &= 0x7F; break;
}
}
// Highest bit goes from MMC3 registers when EXPREGS[3]&0x80==0 or from EXPREGS[0]&0x08 otherwise
/* Highest bit goes from MMC3 registers when EXPREGS[3]&0x80==0 or from EXPREGS[0]&0x08 otherwise */
setchr1(A,
(V & 0x80 & mask) | ((((EXPREGS[0] & 0x08) << 4) & ~mask)) // 7th bit
| ((EXPREGS[2] & 0x0F) << 3) // 6-3 bits
| ((A >> 10) & 7) // 2-0 bits
(V & 0x80 & mask) | ((((EXPREGS[0] & 0x08) << 4) & ~mask)) /* 7th bit */
| ((EXPREGS[2] & 0x0F) << 3) /* 6-3 bits */
| ((A >> 10) & 7) /* 2-0 bits */
);
} else {
if (EXPREGS[3] & 0x40) { // Weird mode, again
if (EXPREGS[3] & 0x40) { /* Weird mode, again */
int cbase = (MMC3_cmd & 0x80) << 5;
switch (cbase ^ A) { // Don't even try do understand
switch (cbase ^ A) { /* Don't even try to understand */
case 0x0000: V = DRegBuf[0]; break;
case 0x0800: V = DRegBuf[1]; break;
case 0x0400:
case 0x0C00: V = 0; break;
}
}
// Simple MMC3 mode
// Highest bit goes from MMC3 registers when EXPREGS[3]&0x80==0 or from EXPREGS[0]&0x08 otherwise
/* Simple MMC3 mode
* Highest bit goes from MMC3 registers when EXPREGS[3]&0x80==0 or from EXPREGS[0]&0x08 otherwise
*/
setchr1(A, (V & mask) | (((EXPREGS[0] & 0x08) << 4) & ~mask));
}
}
@@ -67,8 +68,9 @@ static void COOLBOYPW(uint32 A, uint8 V) {
uint32 mask = ((0x3F | (EXPREGS[1] & 0x40) | ((EXPREGS[1] & 0x20) << 2)) ^ ((EXPREGS[0] & 0x40) >> 2)) ^ ((EXPREGS[1] & 0x80) >> 2);
uint32 base = ((EXPREGS[0] & 0x07) >> 0) | ((EXPREGS[1] & 0x10) >> 1) | ((EXPREGS[1] & 0x0C) << 2) | ((EXPREGS[0] & 0x30) << 2);
// Very weird mode
// Last banks are first in this mode, ignored when MMC3_cmd&0x40
/* Very weird mode
* Last banks are first in this mode, ignored when MMC3_cmd&0x40
*/
if ((EXPREGS[3] & 0x40) && (V >= 0xFE) && !((MMC3_cmd & 0x40) != 0)) {
switch (A & 0xE000) {
case 0xA000:
@@ -83,20 +85,20 @@ static void COOLBOYPW(uint32 A, uint8 V) {
}
}
// Regular MMC3 mode, internal ROM size can be up to 2048kb!
/* Regular MMC3 mode, internal ROM size can be up to 2048kb! */
if (!(EXPREGS[3] & 0x10))
setprg8(A, (((base << 4) & ~mask)) | (V & mask));
else { // NROM mode
else { /* NROM mode */
uint8 emask;
mask &= 0xF0;
if ((((EXPREGS[1] & 2) != 0))) // 32kb mode
if ((((EXPREGS[1] & 2) != 0))) /* 32kb mode */
emask = (EXPREGS[3] & 0x0C) | ((A & 0x4000) >> 13);
else // 16kb mode
else /* 16kb mode */
emask = EXPREGS[3] & 0x0E;
setprg8(A, ((base << 4) & ~mask) // 7-4 bits are from base (see below)
| (V & mask) // ... or from MM3 internal regs, depends on mask
| emask // 3-1 (or 3-2 when (EXPREGS[3]&0x0C is set) from EXPREGS[3]
| ((A & 0x2000) >> 13)); // 0th just as is
setprg8(A, ((base << 4) & ~mask) /* 7-4 bits are from base (see below) */
| (V & mask) /* ... or from MM3 internal regs, depends on mask */
| emask /* 3-1 (or 3-2 when (EXPREGS[3]&0x0C is set) from EXPREGS[3] */
| ((A & 0x2000) >> 13)); /* 0th just as is */
}
}
@@ -104,7 +106,7 @@ static DECLFW(COOLBOYWrite) {
if(A001B & 0x80)
CartBW(A,V);
// Deny any further writes when 7th bit is 1 AND 4th is 0
/* Deny any further writes when 7th bit is 1 AND 4th is 0 */
if ((EXPREGS[3] & 0x90) != 0x80) {
EXPREGS[A & 3] = V;
FixMMC3PRG(MMC3_cmd);
@@ -115,10 +117,12 @@ static DECLFW(COOLBOYWrite) {
static void COOLBOYReset(void) {
MMC3RegReset();
EXPREGS[0] = EXPREGS[1] = EXPREGS[2] = EXPREGS[3] = 0;
// EXPREGS[0] = 0;
// EXPREGS[1] = 0x60;
// EXPREGS[2] = 0;
// EXPREGS[3] = 0;
#if 0
EXPREGS[0] = 0;
EXPREGS[1] = 0x60;
EXPREGS[2] = 0;
EXPREGS[3] = 0;
#endif
FixMMC3PRG(MMC3_cmd);
FixMMC3CHR(MMC3_cmd);
}
@@ -126,13 +130,15 @@ static void COOLBOYReset(void) {
static void COOLBOYPower(void) {
GenMMC3Power();
EXPREGS[0] = EXPREGS[1] = EXPREGS[2] = EXPREGS[3] = 0;
// EXPREGS[0] = 0;
// EXPREGS[1] = 0x60;
// EXPREGS[2] = 0;
// EXPREGS[3] = 0;
#if 0
EXPREGS[0] = 0;
EXPREGS[1] = 0x60;
EXPREGS[2] = 0;
EXPREGS[3] = 0;
#endif
FixMMC3PRG(MMC3_cmd);
FixMMC3CHR(MMC3_cmd);
SetWriteHandler(0x5000, 0x5fff, CartBW); // some games access random unmapped areas and crashes because of KT-008 PCB hack in MMC3 source lol
SetWriteHandler(0x5000, 0x5fff, CartBW); /* some games access random unmapped areas and crashes because of KT-008 PCB hack in MMC3 source lol */
SetWriteHandler(0x6000, 0x7fff, COOLBOYWrite);
}

View File

@@ -28,7 +28,7 @@ static uint32 WRAMSIZE;
static void (*WSync)(void);
static DECLFW(LatchWrite) {
// FCEU_printf("bs %04x %02x\n",A,V);
/* FCEU_printf("bs %04x %02x\n",A,V); */
if (bus_conflict)
latche = V & CartBR(A);
else
@@ -82,7 +82,7 @@ static void Latch_Init(CartInfo *info, void (*proc)(void), uint8 init, uint16 ad
AddExState(&bus_conflict, 1, 0, "BUSC");
}
//------------------ Map 0 ---------------------------
/*------------------ Map 0 ---------------------------*/
#ifdef DEBUG_MAPPER
static DECLFW(NROMWrite) {
@@ -92,7 +92,7 @@ static DECLFW(NROMWrite) {
#endif
static void NROMPower(void) {
setprg8r(0x10, 0x6000, 0); // Famili BASIC (v3.0) need it (uses only 4KB), FP-BASIC uses 8KB
setprg8r(0x10, 0x6000, 0); /* Famili BASIC (v3.0) need it (uses only 4KB), FP-BASIC uses 8KB */
setprg16(0x8000, 0);
setprg16(0xC000, ~0);
setchr8(0);
@@ -122,16 +122,18 @@ void NROM_Init(CartInfo *info) {
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
}
//------------------ Map 2 ---------------------------
/*------------------ Map 2 ---------------------------*/
static void UNROMSync(void) {
// static uint32 mirror_in_use = 0;
// if (PRGsize[0] <= 128 * 1024) {
// setprg16(0x8000, latche & 0x7);
// if ((latche & 0xF8) == 0x08) mirror_in_use = 1;
// if (mirror_in_use)
// setmirror(((latche >> 3) & 1) ^ 1); // Higway Star Hacked mapper to be redefined to another mapper
// } else
#if 0
static uint32 mirror_in_use = 0;
if (PRGsize[0] <= 128 * 1024) {
setprg16(0x8000, latche & 0x7);
if ((latche & 0xF8) == 0x08) mirror_in_use = 1;
if (mirror_in_use)
setmirror(((latche >> 3) & 1) ^ 1); /* Higway Star Hacked mapper to be redefined to another mapper */
} else
#endif
setprg16(0x8000, latche);
setprg16(0xc000, ~0);
setchr8(0);
@@ -141,37 +143,37 @@ void UNROM_Init(CartInfo *info) {
Latch_Init(info, UNROMSync, 0, 0x8000, 0xFFFF, 0, 1);
}
//------------------ Map 3 ---------------------------
/*------------------ Map 3 ---------------------------*/
static void CNROMSync(void) {
setchr8(latche);
setprg32(0x8000, 0);
setprg8r(0x10, 0x6000, 0); // Hayauchy IGO uses 2Kb or RAM
setprg8r(0x10, 0x6000, 0); /* Hayauchy IGO uses 2Kb or RAM */
}
void CNROM_Init(CartInfo *info) {
//TODO: move these to extended database when implemented.
/* TODO: move these to extended database when implemented. */
int _busc, x;
uint64 partialmd5 = 0;
_busc = 1;
for (x = 0; x < 8; x++)
partialmd5 |= (uint64)info->MD5[15 - x] << (x * 8);
if (partialmd5 == 0x117181328eb1ad23LL) //75 Bingo (Sachen-English) [U].unf
if (partialmd5 == 0x117181328eb1ad23LL) /* 75 Bingo (Sachen-English) [U].unf */
_busc = 0;
else
switch (info->CRC32) {
case 0xf283cf58: // Colorful Dragon (Asia) (PAL) (Unl).nes
case 0x2915faf0: // Incantation (Asia) (Unl).nes
case 0xebd0644d: // Dao Shuai (Asia) (Unl).nes
case 0x8f154a0d: // Pu Ke Jing Ling (China) (Unl).nes
case 0xd04a40e6: // Bingo 75 (Asia) (Unl).nes
case 0xf283cf58: /* Colorful Dragon (Asia) (PAL) (Unl).nes */
case 0x2915faf0: /* Incantation (Asia) (Unl).nes */
case 0xebd0644d: /* Dao Shuai (Asia) (Unl).nes */
case 0x8f154a0d: /* Pu Ke Jing Ling (China) (Unl).nes */
case 0xd04a40e6: /* Bingo 75 (Asia) (Unl).nes */
_busc = 0;
break;
}
Latch_Init(info, CNROMSync, 0, 0x8000, 0xFFFF, 1, _busc);
}
//------------------ Map 7 ---------------------------
/*------------------ Map 7 ---------------------------*/
static void ANROMSync() {
setprg32(0x8000, latche & 0xF);
@@ -183,7 +185,7 @@ void ANROM_Init(CartInfo *info) {
Latch_Init(info, ANROMSync, 0, 0x4020, 0xFFFF, 0, 0);
}
//------------------ Map 8 ---------------------------
/*------------------ Map 8 ---------------------------*/
static void M8Sync() {
setprg16(0x8000, latche >> 3);
@@ -195,7 +197,7 @@ void Mapper8_Init(CartInfo *info) {
Latch_Init(info, M8Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 11 ---------------------------
/*------------------ Map 11 ---------------------------*/
static void M11Sync(void) {
setprg32(0x8000, latche & 0xF);
@@ -210,7 +212,7 @@ void Mapper144_Init(CartInfo *info) {
Latch_Init(info, M11Sync, 0, 0x8001, 0xFFFF, 0, 0);
}
//------------------ Map 13 ---------------------------
/*------------------ Map 13 ---------------------------*/
static void CPROMSync(void) {
setchr4(0x0000, 0);
@@ -222,7 +224,7 @@ void CPROM_Init(CartInfo *info) {
Latch_Init(info, CPROMSync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 38 ---------------------------
/*------------------ Map 38 ---------------------------*/
static void M38Sync(void) {
setprg32(0x8000, latche & 3);
@@ -233,7 +235,7 @@ void Mapper38_Init(CartInfo *info) {
Latch_Init(info, M38Sync, 0, 0x7000, 0x7FFF, 0, 0);
}
//------------------ Map 66 ---------------------------
/*------------------ Map 66 ---------------------------*/
static void MHROMSync(void) {
setprg32(0x8000, latche >> 4);
@@ -244,7 +246,7 @@ void MHROM_Init(CartInfo *info) {
Latch_Init(info, MHROMSync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 70 ---------------------------
/*------------------ Map 70 ---------------------------*/
static void M70Sync() {
setprg16(0x8000, latche >> 4);
@@ -256,7 +258,7 @@ void Mapper70_Init(CartInfo *info) {
Latch_Init(info, M70Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 78 ---------------------------
/*------------------ Map 78 ---------------------------*/
/* Should be two separate emulation functions for this "mapper". Sigh. URGE TO KILL RISING. */
static void M78Sync() {
setprg16(0x8000, (latche & 7));
@@ -269,7 +271,7 @@ void Mapper78_Init(CartInfo *info) {
Latch_Init(info, M78Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 86 ---------------------------
/*------------------ Map 86 ---------------------------*/
static void M86Sync(void) {
setprg32(0x8000, (latche >> 4) & 3);
@@ -280,7 +282,7 @@ void Mapper86_Init(CartInfo *info) {
Latch_Init(info, M86Sync, ~0, 0x6000, 0x6FFF, 0, 0);
}
//------------------ Map 87 ---------------------------
/*------------------ Map 87 ---------------------------*/
static void M87Sync(void) {
setprg32(0x8000, 0);
@@ -291,7 +293,7 @@ void Mapper87_Init(CartInfo *info) {
Latch_Init(info, M87Sync, ~0, 0x6000, 0xFFFF, 0, 0);
}
//------------------ Map 89 ---------------------------
/*------------------ Map 89 ---------------------------*/
static void M89Sync(void) {
setprg16(0x8000, (latche >> 4) & 7);
@@ -304,7 +306,7 @@ void Mapper89_Init(CartInfo *info) {
Latch_Init(info, M89Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 93 ---------------------------
/*------------------ Map 93 ---------------------------*/
static void SSUNROMSync(void) {
setprg16(0x8000, latche >> 4);
@@ -316,7 +318,7 @@ void SUNSOFT_UNROM_Init(CartInfo *info) {
Latch_Init(info, SSUNROMSync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 94 ---------------------------
/*------------------ Map 94 ---------------------------*/
static void M94Sync(void) {
setprg16(0x8000, latche >> 2);
@@ -328,7 +330,7 @@ void Mapper94_Init(CartInfo *info) {
Latch_Init(info, M94Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 97 ---------------------------
/*------------------ Map 97 ---------------------------*/
static void M97Sync(void) {
setchr8(0);
@@ -347,7 +349,7 @@ void Mapper97_Init(CartInfo *info) {
Latch_Init(info, M97Sync, ~0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 101 ---------------------------
/*------------------ Map 101 ---------------------------*/
static void M101Sync(void) {
setprg32(0x8000, 0);
@@ -358,7 +360,7 @@ void Mapper101_Init(CartInfo *info) {
Latch_Init(info, M101Sync, ~0, 0x6000, 0x7FFF, 0, 0);
}
//------------------ Map 107 ---------------------------
/*------------------ Map 107 ---------------------------*/
static void M107Sync(void) {
setprg32(0x8000, (latche >> 1) & 3);
@@ -369,25 +371,25 @@ void Mapper107_Init(CartInfo *info) {
Latch_Init(info, M107Sync, ~0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 113 ---------------------------
/*------------------ Map 113 ---------------------------*/
static void M113Sync(void) {
setprg32(0x8000, (latche >> 3) & 7);
setchr8(((latche >> 3) & 8) | (latche & 7));
// setmirror(latche>>7); // only for HES 6in1
/* setmirror(latche>>7);*/ /* only for HES 6in1 */
}
void Mapper113_Init(CartInfo *info) {
Latch_Init(info, M113Sync, 0, 0x4100, 0x7FFF, 0, 0);
}
//------------------ Map 140 ---------------------------
/*------------------ Map 140 ---------------------------*/
void Mapper140_Init(CartInfo *info) {
Latch_Init(info, MHROMSync, 0, 0x6000, 0x7FFF, 0, 0);
}
//------------------ Map 152 ---------------------------
/*------------------ Map 152 ---------------------------*/
static void M152Sync() {
setprg16(0x8000, (latche >> 4) & 7);
@@ -400,7 +402,7 @@ void Mapper152_Init(CartInfo *info) {
Latch_Init(info, M152Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 180 ---------------------------
/*------------------ Map 180 ---------------------------*/
static void M180Sync(void) {
setprg16(0x8000, 0);
@@ -412,7 +414,7 @@ void Mapper180_Init(CartInfo *info) {
Latch_Init(info, M180Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 184 ---------------------------
/*------------------ Map 184 ---------------------------*/
static void M184Sync(void) {
setchr4(0x0000, latche);
@@ -424,7 +426,7 @@ void Mapper184_Init(CartInfo *info) {
Latch_Init(info, M184Sync, 0, 0x6000, 0x7FFF, 0, 0);
}
//------------------ Map 203 ---------------------------
/*------------------ Map 203 ---------------------------*/
static void M203Sync(void) {
setprg16(0x8000, (latche >> 2) & 3);
@@ -436,7 +438,7 @@ void Mapper203_Init(CartInfo *info) {
Latch_Init(info, M203Sync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 240 ---------------------------
/*------------------ Map 240 ---------------------------*/
static void M240Sync(void) {
setprg8r(0x10, 0x6000, 0);
@@ -448,15 +450,16 @@ void Mapper240_Init(CartInfo *info) {
Latch_Init(info, M240Sync, 0, 0x4020, 0x5FFF, 1, 0);
}
//------------------ Map 241 ---------------------------
// Mapper 7 mostly, but with SRAM or maybe prot circuit
// figure out, which games do need 5xxx area reading
/*------------------ Map 241 ---------------------------*/
/* Mapper 7 mostly, but with SRAM or maybe prot circuit
* figure out, which games do need 5xxx area reading
*/
static void M241Sync(void) {
setchr8(0);
setprg8r(0x10, 0x6000, 0);
if (latche & 0x80)
setprg32(0x8000, latche | 8); // no 241 actually, but why not afterall?
setprg32(0x8000, latche | 8); /* no 241 actually, but why not afterall? */
else
setprg32(0x8000, latche);
}
@@ -465,12 +468,13 @@ void Mapper241_Init(CartInfo *info) {
Latch_Init(info, M241Sync, 0, 0x8000, 0xFFFF, 1, 0);
}
//------------------ A65AS ---------------------------
/* ------------------ 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.
/* 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)
@@ -490,8 +494,8 @@ void BMCA65AS_Init(CartInfo *info) {
Latch_Init(info, BMCA65ASSync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ BMC-11160 ---------------------------
// Simple BMC discrete mapper by TXC
/*------------------ BMC-11160 ---------------------------*/
/* Simple BMC discrete mapper by TXC */
static void BMC11160Sync(void) {
uint32 bank = (latche >> 4) & 7;

View File

@@ -34,11 +34,11 @@ static void Sync(void) {
setchr8(0);
setprg8r(0x10, 0x6000, (reg & 0xC0) >> 6);
setprg32(0x8000, reg & 0x1F);
// setmirror(((reg&0x20)>>5));
/* setmirror(((reg&0x20)>>5)); */
}
static DECLFW(UNLEDU2000HiWrite) {
// FCEU_printf("%04x:%02x\n",A,V);
/* FCEU_printf("%04x:%02x\n",A,V); */
reg = V;
Sync();
}

View File

@@ -40,28 +40,33 @@ static void Sync(void) {
setchr8(0);
}
//static DECLFW(SSSNROMWrite)
//{
// CartBW(A,V);
//}
#if 0
static DECLFW(SSSNROMWrite)
{
CartBW(A,V);
}
#endif
static DECLFW(SSSNROMWrite) {
// FCEU_printf("write %04x %02x\n",A,V);
// regs[A&7] = V;
#if 0
FCEU_printf("write %04x %02x\n",A,V);
regs[A&7] = V;
#endif
}
static DECLFR(SSSNROMRead) {
// FCEU_printf("read %04x\n",A);
/* FCEU_printf("read %04x\n",A); */
switch (A & 7) {
case 0: return regs[0] = 0xff; // clear all exceptions
case 2: return 0xc0; // DIP selftest + freeplay
case 3: return 0x00; // 0, 1 - attract
// 2
// 4 - menu
// 8 - self check and game casette check
// 10 - lock?
// 20 - game title & count display
case 7: return 0x22; // TV type, key not turned, relay B
case 0: return regs[0] = 0xff; /* clear all exceptions */
case 2: return 0xc0; /* DIP selftest + freeplay */
case 3: return 0x00; /* 0, 1 - attract
* 2
* 4 - menu
* 8 - self check and game casette check
* 10 - lock?
* 20 - game title & count display
*/
case 7: return 0x22; /* TV type, key not turned, relay B */
default: return 0;
}
}
@@ -71,7 +76,7 @@ static void SSSNROMPower(void) {
regs[7] = 0xff;
Sync();
memset(WRAM, 0x00, WRAMSIZE);
// SetWriteHandler(0x0000,0x1FFF,SSSNROMRamWrite);
/* SetWriteHandler(0x0000,0x1FFF,SSSNROMRamWrite); */
SetReadHandler(0x0800, 0x1FFF, CartBR);
SetWriteHandler(0x0800, 0x1FFF, CartBW);
SetReadHandler(0x5000, 0x5FFF, SSSNROMRead);
@@ -93,7 +98,7 @@ static void SSSNROMClose(void) {
}
static void SSSNROMIRQHook(void) {
// X6502_IRQBegin(FCEU_IQEXT);
/* X6502_IRQBegin(FCEU_IQEXT); */
}
static void StateRestore(int version) {

View File

@@ -100,7 +100,7 @@ static uint64 CartList[] =
0
};
int DetectPRGbonus(CartInfo *tmp) {
static int DetectPRGbonus(CartInfo *tmp) {
int x, i = 0;
uint64 partialmd5 = 0;

View File

@@ -49,7 +49,7 @@ static void Sync(void) {
static DECLFW(BMCGhostbusters63in1Write) {
reg[A & 1] = V;
bank = ((reg[0] & 0x80) >> 7) | ((reg[1] & 1) << 1);
// FCEU_printf("reg[0]=%02x, reg[1]=%02x, bank=%02x\n",reg[0],reg[1],bank);
/* FCEU_printf("reg[0]=%02x, reg[1]=%02x, bank=%02x\n",reg[0],reg[1],bank); */
Sync();
}
@@ -86,7 +86,7 @@ void BMCGhostbusters63in1_Init(CartInfo *info) {
info->Power = BMCGhostbusters63in1Power;
info->Close = BMCGhostbusters63in1Close;
CHRROMSIZE = 8192; // dummy CHRROM, VRAM disable
CHRROMSIZE = 8192; /* dummy CHRROM, VRAM disable */
CHRROM = (uint8*)FCEU_gmalloc(CHRROMSIZE);
SetupCartPRGMapping(0x10, CHRROM, CHRROMSIZE, 0);
AddExState(CHRROM, CHRROMSIZE, 0, "CROM");

View File

@@ -56,7 +56,7 @@ static DECLFW(H2288WriteLo) {
static void H2288Power(void) {
EXPREGS[0] = EXPREGS[1] = 0;
GenMMC3Power();
// SetReadHandler(0x5000,0x5FFF,H2288Read);
/* SetReadHandler(0x5000,0x5FFF,H2288Read); */
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x5000, 0x5FFF, H2288WriteLo);
SetWriteHandler(0x8000, 0x9FFF, H2288WriteHi);

View File

@@ -22,7 +22,7 @@
#include "mmc3.h"
static DECLFW(UNLKOF97CMDWrite) {
V = (V & 0xD8) | ((V & 0x20) >> 4) | ((V & 4) << 3) | ((V & 2) >> 1) | ((V & 1) << 2); //76143502
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);
}

View File

@@ -48,16 +48,16 @@ static DECLFW(UNLKS7016Write) {
switch(A & 0xD943) {
case 0xD943: {
if(mask == 0x30) {
preg = 8 | 3; // or A, or no bus (all FF)
preg = 8 | 3; /* or A, or no bus (all FF) */
} else {
preg = (A >> 2) & 0xF; // can be anything but C-F
preg = (A >> 2) & 0xF; /* can be anything but C-F */
}
Sync();
break;
}
case 0xD903: { // this case isn't usedby the game, but addressing does this as a side effect
case 0xD903: { /* this case isn't usedby the game, but addressing does this as a side effect */
if(mask == 0x30) {
preg = 8 | ((A >> 2) & 3); // also masked C-F from output
preg = 8 | ((A >> 2) & 3); /* also masked C-F from output */
} else {
preg = 8 | 3;
}

View File

@@ -34,7 +34,7 @@ static void Sync(void) {
setchr4(0x0000, latche & 1);
setchr4(0x1000, latche & 1);
} else {
setchr8(latche & 1); // actually, my bad, overdumped roms, the real CHR size if 8K
setchr8(latche & 1); /* actually, my bad, overdumped roms, the real CHR size if 8K */
}
setmirror(MI_0 + (latche & 1));
}
@@ -54,7 +54,7 @@ static void UNLCC21Power(void) {
Sync();
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x8001, 0xFFFF, UNLCC21Write1);
SetWriteHandler(0x8000, 0x8000, UNLCC21Write2); // another one many-in-1 mapper, there is a lot of similar carts with little different wirings
SetWriteHandler(0x8000, 0x8000, UNLCC21Write2); /* another one many-in-1 mapper, there is a lot of similar carts with little different wirings */
}
static void StateRestore(int version) {

View File

@@ -38,12 +38,12 @@ static int is155, is171;
static DECLFW(MBWRAM) {
if (!(DRegs[3] & 0x10) || is155)
Page[A >> 11][A] = V; // WRAM is enabled.
Page[A >> 11][A] = V; /* WRAM is enabled. */
}
static DECLFR(MAWRAM) {
if ((DRegs[3] & 0x10) && !is155)
return X.DB; // WRAM is disabled
return X.DB; /* WRAM is disabled */
return(Page[A >> 11][A]);
}
@@ -131,7 +131,7 @@ static DECLFW(MMC1_write) {
*/
if ((timestampbase + timestamp) < (lreset + 2))
return;
// FCEU_printf("Write %04x:%02x\n",A,V);
/* FCEU_printf("Write %04x:%02x\n",A,V); */
if (V & 0x80) {
DRegs[0] |= 0xC;
BufferShift = Buffer = 0;
@@ -143,7 +143,7 @@ static DECLFW(MMC1_write) {
Buffer |= (V & 1) << (BufferShift++);
if (BufferShift == 5) {
// FCEU_printf("REG[%d]=%02x\n",n,Buffer);
/* FCEU_printf("REG[%d]=%02x\n",n,Buffer); */
DRegs[n] = Buffer;
BufferShift = Buffer = 0;
switch (n) {
@@ -159,7 +159,7 @@ static void MMC1_Restore(int version) {
MMC1MIRROR();
MMC1CHR();
MMC1PRG();
lreset = 0; // timestamp(base) is not stored in save states.
lreset = 0; /* timestamp(base) is not stored in save states. */
}
static void MMC1CMReset(void) {
@@ -171,7 +171,7 @@ static void MMC1CMReset(void) {
DRegs[0] = 0x1F;
DRegs[1] = 0;
DRegs[2] = 0; // Should this be something other than 0?
DRegs[2] = 0; /* Should this be something other than 0? */
DRegs[3] = 0;
MMC1MIRROR();
@@ -214,7 +214,7 @@ static void NWCIRQHook(int a) {
}
static void NWCCHRHook(uint32 A, uint8 V) {
if ((V & 0x10)) { // && !(NWCRec&0x10))
if ((V & 0x10)) { /* && !(NWCRec&0x10)) */
NWCIRQCount = 0;
X6502_IRQEnd(FCEU_IQEXT);
}

View File

@@ -69,9 +69,10 @@ void FixMMC3CHR(int V);
void GenMMC3_Init(CartInfo *info, int prg, int chr, int wram, int battery);
// ----------------------------------------------------------------------
// ------------------------- Generic MM3 Code ---------------------------
// ----------------------------------------------------------------------
/* ----------------------------------------------------------------------
* ------------------------- Generic MM3 Code ---------------------------
* ----------------------------------------------------------------------
*/
void FixMMC3PRG(int V) {
if (V & 0x40) {
@@ -118,7 +119,7 @@ void MMC3RegReset(void) {
}
DECLFW(MMC3_CMDWrite) {
// FCEU_printf("bs %04x %02x\n",A,V);
/* FCEU_printf("bs %04x %02x\n",A,V); */
switch (A & 0xE001) {
case 0x8000:
if ((V & 0x40) != (MMC3_cmd & 0x40))
@@ -174,7 +175,7 @@ DECLFW(MMC3_CMDWrite) {
}
DECLFW(MMC3_IRQWrite) {
// FCEU_printf("%04x:%04x\n",A,V);
/* FCEU_printf("%04x:%04x\n",A,V); */
switch (A & 0xE001) {
case 0xC000: IRQLatch = V; break;
case 0xC001: IRQReload = 1; break;
@@ -183,14 +184,14 @@ DECLFW(MMC3_IRQWrite) {
}
}
// KT-008 boards hack 2-in-1, TODO assign to new ines mapper, most dump of KT-boards on the net are mapper 4, so need database or goodnes fix support
/* KT-008 boards hack 2-in-1, TODO assign to new ines mapper, most dump of KT-boards on the net are mapper 4, so need database or goodnes fix support */
DECLFW(KT008HackWrite) {
// FCEU_printf("%04x:%04x\n",A,V);
/* FCEU_printf("%04x:%04x\n",A,V); */
switch (A & 3) {
case 0: kt_extra = V; FixMMC3PRG(MMC3_cmd); break;
case 1: break; // unk
case 2: break; // unk
case 3: break; // unk
case 1: break; /* unk */
case 2: break; /* unk */
case 3: break; /* unk */
}
}
@@ -228,14 +229,15 @@ void GenMMC3Restore(int version) {
}
static void GENCWRAP(uint32 A, uint8 V) {
setchr1(A, V); // Business Wars NEEDS THIS for 8K CHR-RAM
setchr1(A, V); /* Business Wars NEEDS THIS for 8K CHR-RAM */
}
static void GENPWRAP(uint32 A, uint8 V) {
// [NJ102] Mo Dao Jie (C) has 1024Mb MMC3 BOARD, maybe something other will be broken
// also HengGe BBC-2x boards enables this mode as default board mode at boot up
/* [NJ102] Mo Dao Jie (C) has 1024Mb MMC3 BOARD, maybe something other will be broken
* also HengGe BBC-2x boards enables this mode as default board mode at boot up
*/
setprg8(A, (V & 0x7F) | ((kt_extra & 4) << 4));
// KT-008 boards hack 2-in-1, TODO assign to new ines mapper, most dump of KT-boards on the net are mapper 4, so need database or goodnes fix support
/* KT-008 boards hack 2-in-1, TODO assign to new ines mapper, most dump of KT-boards on the net are mapper 4, so need database or goodnes fix support */
}
static void GENMWRAP(uint8 V) {
@@ -262,7 +264,7 @@ void GenMMC3Power(void) {
SetWriteHandler(0xC000, 0xFFFF, MMC3_IRQWrite);
SetReadHandler(0x8000, 0xFFFF, CartBR);
// KT-008 boards hack 2-in-1, TODO assign to new ines mapper, most dump of KT-boards on the net are mapper 4, so need database or goodnes fix support
/* KT-008 boards hack 2-in-1, TODO assign to new ines mapper, most dump of KT-boards on the net are mapper 4, so need database or goodnes fix support */
SetWriteHandler(0x5000,0x5FFF, KT008HackWrite);
A001B = A000B = 0;
@@ -318,7 +320,7 @@ void GenMMC3_Init(CartInfo *info, int prg, int chr, int wram, int battery) {
info->SaveGameLen[0] = WRAMSIZE;
}
// KT-008 boards hack 2-in-1, TODO assign to new ines mapper, most dump of KT-boards on the net are mapper 4, so need database or goodnes fix support
/* KT-008 boards hack 2-in-1, TODO assign to new ines mapper, most dump of KT-boards on the net are mapper 4, so need database or goodnes fix support */
AddExState(&kt_extra, 1, 0, "KTEX");
AddExState(MMC3_StateRegs, ~0, 0, 0);
@@ -326,22 +328,23 @@ void GenMMC3_Init(CartInfo *info, int prg, int chr, int wram, int battery) {
info->Reset = MMC3RegReset;
info->Close = GenMMC3Close;
if (info->CRC32 == 0x5104833e) // Kick Master
if (info->CRC32 == 0x5104833e) /* Kick Master */
GameHBIRQHook = MMC3_hb_KickMasterHack;
else if (info->CRC32 == 0x5a6860f1 || info->CRC32 == 0xae280e20)// Shougi Meikan '92/'93
else if (info->CRC32 == 0x5a6860f1 || info->CRC32 == 0xae280e20) /* Shougi Meikan '92/'93 */
GameHBIRQHook = MMC3_hb_KickMasterHack;
else if (info->CRC32 == 0xfcd772eb) // PAL Star Wars, similar problem as Kick Master.
else if (info->CRC32 == 0xfcd772eb) /* PAL Star Wars, similar problem as Kick Master. */
GameHBIRQHook = MMC3_hb_PALStarWarsHack;
else
GameHBIRQHook = MMC3_hb;
GameStateRestore = GenMMC3Restore;
}
// ----------------------------------------------------------------------
// -------------------------- MMC3 Based Code ---------------------------
// ----------------------------------------------------------------------
/* ----------------------------------------------------------------------
* -------------------------- MMC3 Based Code ---------------------------
* ----------------------------------------------------------------------
*/
// ---------------------------- Mapper 4 --------------------------------
/* ---------------------------- Mapper 4 -------------------------------- */
static int hackm4 = 0; /* For Karnov, maybe others. BLAH. Stupid iNES format.*/
@@ -366,7 +369,7 @@ void Mapper4_Init(CartInfo *info) {
hackm4 = info->mirror;
}
// ---------------------------- Mapper 12 -------------------------------
/* ---------------------------- Mapper 12 ------------------------------- */
static void M12CW(uint32 A, uint8 V) {
setchr1(A, (EXPREGS[(A & 0x1000) >> 12] << 8) + V);
@@ -383,7 +386,7 @@ static DECLFR(M12Read) {
static void M12Power(void) {
EXPREGS[0] = EXPREGS[1] = 0;
EXPREGS[2] = 1; // chinese is default
EXPREGS[2] = 1; /* chinese is default */
GenMMC3Power();
SetWriteHandler(0x4100, 0x5FFF, M12Write);
SetReadHandler(0x4100, 0x5FFF, M12Read);
@@ -405,7 +408,7 @@ void Mapper12_Init(CartInfo *info) {
AddExState(EXPREGS, 2, 0, "EXPR");
}
// ---------------------------- Mapper 37 -------------------------------
/* ---------------------------- Mapper 37 ------------------------------- */
static void M37PW(uint32 A, uint8 V) {
if (EXPREGS[0] != 2)
@@ -449,7 +452,7 @@ void Mapper37_Init(CartInfo *info) {
AddExState(EXPREGS, 1, 0, "EXPR");
}
// ---------------------------- Mapper 44 -------------------------------
/* ---------------------------- Mapper 44 ------------------------------- */
static void M44PW(uint32 A, uint8 V) {
uint32 NV = V;
@@ -489,7 +492,7 @@ void Mapper44_Init(CartInfo *info) {
AddExState(EXPREGS, 1, 0, "EXPR");
}
// ---------------------------- Mapper 45 -------------------------------
/* ---------------------------- Mapper 45 ------------------------------- */
static void M45CW(uint32 A, uint8 V) {
if (!UNIFchrrama) {
@@ -498,11 +501,11 @@ static void M45CW(uint32 A, uint8 V) {
NV &= (1 << ((EXPREGS[2] & 7) + 1)) - 1;
else
if (EXPREGS[2])
NV &= 0; // hack ;( don't know exactly how it should be
NV &= 0; /* hack ;( don't know exactly how it should be */
NV |= EXPREGS[0] | ((EXPREGS[2] & 0xF0) << 4);
setchr1(A, NV);
} else
// setchr8(0); // i don't know what cart need this, but a new one need other lol
/* setchr8(0); */ /* i don't know what cart need this, but a new one need other lol */
setchr1(A, V);
}
@@ -512,7 +515,7 @@ static void M45PW(uint32 A, uint8 V) {
if(UNIFchrrama)
MV |= ((EXPREGS[2] & 0x40) << 2);
setprg8(A, MV);
// FCEU_printf("1:%02x 2:%02x 3:%02x A=%04x V=%03x\n",EXPREGS[1],EXPREGS[2],EXPREGS[3],A,MV);
/* FCEU_printf("1:%02x 2:%02x 3:%02x A=%04x V=%03x\n",EXPREGS[1],EXPREGS[2],EXPREGS[3],A,MV); */
}
static DECLFW(M45Write) {
@@ -557,7 +560,7 @@ void Mapper45_Init(CartInfo *info) {
AddExState(EXPREGS, 5, 0, "EXPR");
}
// ---------------------------- Mapper 47 -------------------------------
/* ---------------------------- Mapper 47 ------------------------------- */
static void M47PW(uint32 A, uint8 V) {
V &= 0xF;
@@ -582,7 +585,7 @@ static void M47Power(void) {
EXPREGS[0] = 0;
GenMMC3Power();
SetWriteHandler(0x6000, 0x7FFF, M47Write);
// SetReadHandler(0x6000,0x7FFF,0);
/* SetReadHandler(0x6000,0x7FFF,0); */
}
void Mapper47_Init(CartInfo *info) {
@@ -593,7 +596,7 @@ void Mapper47_Init(CartInfo *info) {
AddExState(EXPREGS, 1, 0, "EXPR");
}
// ---------------------------- Mapper 49 -------------------------------
/* ---------------------------- Mapper 49 ------------------------------- */
static void M49PW(uint32 A, uint8 V) {
if (EXPREGS[0] & 1) {
@@ -640,7 +643,7 @@ void Mapper49_Init(CartInfo *info) {
AddExState(EXPREGS, 1, 0, "EXPR");
}
// ---------------------------- Mapper 52 -------------------------------
/* ---------------------------- Mapper 52 ------------------------------- */
static void M52PW(uint32 A, uint8 V) {
uint32 mask = 0x1F ^ ((EXPREGS[0] & 8) << 1);
uint32 bank = ((EXPREGS[0] & 6) | ((EXPREGS[0] >> 3) & EXPREGS[0] & 1)) << 4;
@@ -649,8 +652,8 @@ static void M52PW(uint32 A, uint8 V) {
static void M52CW(uint32 A, uint8 V) {
uint32 mask = 0xFF ^ ((EXPREGS[0] & 0x40) << 1);
// uint32 bank = (((EXPREGS[0]>>3)&4)|((EXPREGS[0]>>1)&2)|((EXPREGS[0]>>6)&(EXPREGS[0]>>4)&1))<<7;
uint32 bank = (((EXPREGS[0] >> 4) & 2) | (EXPREGS[0] & 4) | ((EXPREGS[0] >> 6) & (EXPREGS[0] >> 4) & 1)) << 7; // actually 256K CHR banks index bits is inverted!
/* uint32 bank = (((EXPREGS[0]>>3)&4)|((EXPREGS[0]>>1)&2)|((EXPREGS[0]>>6)&(EXPREGS[0]>>4)&1))<<7; */
uint32 bank = (((EXPREGS[0] >> 4) & 2) | (EXPREGS[0] & 4) | ((EXPREGS[0] >> 6) & (EXPREGS[0] >> 4) & 1)) << 7; /* actually 256K CHR banks index bits is inverted! */
setchr1(A, bank | (V & mask));
}
@@ -685,7 +688,7 @@ void Mapper52_Init(CartInfo *info) {
AddExState(EXPREGS, 2, 0, "EXPR");
}
// ---------------------------- Mapper 76 -------------------------------
/* ---------------------------- Mapper 76 ------------------------------- */
static void M76CW(uint32 A, uint8 V) {
if (A >= 0x1000)
@@ -697,10 +700,10 @@ void Mapper76_Init(CartInfo *info) {
cwrap = M76CW;
}
// ---------------------------- Mapper 74 -------------------------------
/* ---------------------------- Mapper 74 ------------------------------- */
static void M74CW(uint32 A, uint8 V) {
if ((V == 8) || (V == 9)) //Di 4 Ci - Ji Qi Ren Dai Zhan (As).nes, Ji Jia Zhan Shi (As).nes
if ((V == 8) || (V == 9)) /* Di 4 Ci - Ji Qi Ren Dai Zhan (As).nes, Ji Jia Zhan Shi (As).nes */
setchr1r(0x10, A, V);
else
setchr1r(0, A, V);
@@ -715,18 +718,18 @@ void Mapper74_Init(CartInfo *info) {
AddExState(CHRRAM, CHRRAMSIZE, 0, "CHRR");
}
// ---------------------------- Mapper 114 ------------------------------
/* ---------------------------- Mapper 114 ------------------------------ */
static uint8 cmdin;
uint8 m114_perm[8] = { 0, 3, 1, 5, 6, 7, 2, 4 };
static void M114PWRAP(uint32 A, uint8 V) {
if (EXPREGS[0] & 0x80) {
// FCEU_printf("8000-C000:%02X\n",EXPREGS[0]&0xF);
/* FCEU_printf("8000-C000:%02X\n",EXPREGS[0]&0xF); */
setprg16(0x8000, EXPREGS[0] & 0xF);
setprg16(0xC000, EXPREGS[0] & 0xF);
} else {
// FCEU_printf("%04X:%02X\n",A,V&0x3F);
/* FCEU_printf("%04X:%02X\n",A,V&0x3F); */
setprg8(A, V & 0x3F);
}
}
@@ -771,12 +774,12 @@ void Mapper114_Init(CartInfo *info) {
AddExState(&cmdin, 1, 0, "CMDI");
}
// ---------------------------- Mapper 115 KN-658 board ------------------------------
/* ---------------------------- Mapper 115 KN-658 board ------------------------------ */
static void M115PW(uint32 A, uint8 V) {
if (EXPREGS[0] & 0x80) {
if (EXPREGS[0] & 0x20)
setprg32(0x8000, (EXPREGS[0] & 0x0F) >> 1); // real hardware tests, info 100% now lol
setprg32(0x8000, (EXPREGS[0] & 0x0F) >> 1); /* real hardware tests, info 100% now lol */
else {
setprg16(0x8000, (EXPREGS[0] & 0x0F));
setprg16(0xC000, (EXPREGS[0] & 0x0F));
@@ -791,7 +794,7 @@ static void M115CW(uint32 A, uint8 V) {
static DECLFW(M115Write) {
if (A == 0x5080)
EXPREGS[2] = V; // Extra prot hardware 2-in-1 mode
EXPREGS[2] = V; /* Extra prot hardware 2-in-1 mode */
else if (A == 0x6000)
EXPREGS[0] = V;
else if (A == 0x6001)
@@ -817,7 +820,7 @@ void Mapper115_Init(CartInfo *info) {
AddExState(EXPREGS, 3, 0, "EXPR");
}
// ---------------------------- Mapper 118 ------------------------------
/* ---------------------------- Mapper 118 ------------------------------ */
static uint8 PPUCHRBus;
static uint8 TKSMIR[8];
@@ -836,7 +839,7 @@ static void TKSWRAP(uint32 A, uint8 V) {
setmirror(MI_0 + (V >> 7));
}
// ---------------------------- Mapper 119 ------------------------------
/* ---------------------------- Mapper 119 ------------------------------ */
static void TQWRAP(uint32 A, uint8 V) {
setchr1r((V & 0x40) >> 2, A, V & 0x3F);
@@ -851,7 +854,7 @@ void Mapper119_Init(CartInfo *info) {
AddExState(CHRRAM, CHRRAMSIZE, 0, "CHRR");
}
// ---------------------------- Mapper 134 ------------------------------
/* ---------------------------- Mapper 134 ------------------------------ */
static void M134PW(uint32 A, uint8 V) {
setprg8(A, (V & 0x1F) | ((EXPREGS[0] & 2) << 4));
@@ -887,7 +890,7 @@ void Mapper134_Init(CartInfo *info) {
AddExState(EXPREGS, 4, 0, "EXPR");
}
// ---------------------------- Mapper 165 ------------------------------
/* ---------------------------- Mapper 165 ------------------------------ */
static void M165CW(uint32 A, uint8 V) {
if (V == 0)
@@ -944,7 +947,7 @@ void Mapper165_Init(CartInfo *info) {
AddExState(EXPREGS, 4, 0, "EXPR");
}
// ---------------------------- Mapper 191 ------------------------------
/* ---------------------------- Mapper 191 ------------------------------ */
static void M191CW(uint32 A, uint8 V) {
setchr1r((V & 0x80) >> 3, A, V);
@@ -959,11 +962,12 @@ void Mapper191_Init(CartInfo *info) {
AddExState(CHRRAM, CHRRAMSIZE, 0, "CHRR");
}
// ---------------------------- Mapper 192 -------------------------------
/* ---------------------------- Mapper 192 ------------------------------- */
static void M192CW(uint32 A, uint8 V) {
//Ying Lie Qun Xia Zhuan (Chinese),
//You Ling Xing Dong (China) (Unl) [this will be mistakenly headered as m074 sometimes]
/* Ying Lie Qun Xia Zhuan (Chinese),
* You Ling Xing Dong (China) (Unl) [this will be mistakenly headered as m074 sometimes]
*/
if ((V == 8) || (V == 9) || (V == 0xA) || (V == 0xB))
setchr1r(0x10, A, V);
else
@@ -979,10 +983,10 @@ void Mapper192_Init(CartInfo *info) {
AddExState(CHRRAM, CHRRAMSIZE, 0, "CHRR");
}
// ---------------------------- Mapper 194 -------------------------------
/* ---------------------------- Mapper 194 ------------------------------- */
static void M194CW(uint32 A, uint8 V) {
if (V <= 1) //Dai-2-Ji - Super Robot Taisen (As).nes
if (V <= 1) /* Dai-2-Ji - Super Robot Taisen (As).nes */
setchr1r(0x10, A, V);
else
setchr1r(0, A, V);
@@ -997,9 +1001,9 @@ void Mapper194_Init(CartInfo *info) {
AddExState(CHRRAM, CHRRAMSIZE, 0, "CHRR");
}
// ---------------------------- Mapper 195 -------------------------------
/* ---------------------------- Mapper 195 ------------------------------- */
static void M195CW(uint32 A, uint8 V) {
if (V <= 3) // Crystalis (c).nes, Captain Tsubasa Vol 2 - Super Striker (C)
if (V <= 3) /* Crystalis (c).nes, Captain Tsubasa Vol 2 - Super Striker (C) */
setchr1r(0x10, A, V);
else
setchr1r(0, A, V);
@@ -1022,11 +1026,12 @@ void Mapper195_Init(CartInfo *info) {
AddExState(CHRRAM, CHRRAMSIZE, 0, "CHRR");
}
// ---------------------------- Mapper 196 -------------------------------
// MMC3 board with optional command address line connection, allows to
// make three-four different wirings to IRQ address lines and separately to
// CMD address line, Mali Boss additionally check if wiring are correct for
// game
/* ---------------------------- Mapper 196 ------------------------------- */
/* MMC3 board with optional command address line connection, allows to
* make three-four different wirings to IRQ address lines and separately to
* CMD address line, Mali Boss additionally check if wiring are correct for
* game
*/
static void M196PW(uint32 A, uint8 V) {
if (EXPREGS[0])
@@ -1064,10 +1069,11 @@ void Mapper196_Init(CartInfo *info) {
info->Power = Mapper196Power;
}
// ---------------------------- Mali Splash Bomb----------------------------
// The same board as for 196 mapper games, but with additional data bit swap
// Also, it is impossible to work on the combined 196 mapper source with
// all data bits merged, because it's using one of them as 8000 reg...
/* ---------------------------- Mali Splash Bomb---------------------------- */
/* The same board as for 196 mapper games, but with additional data bit swap
* Also, it is impossible to work on the combined 196 mapper source with
* all data bits merged, because it's using one of them as 8000 reg...
*/
static void UNLMaliSBPW(uint32 A, uint8 V) {
setprg8(A, (V & 3) | ((V & 8) >> 1) | ((V & 4) << 1));
@@ -1099,7 +1105,7 @@ void UNLMaliSB_Init(CartInfo *info) {
info->Power = UNLMaliSBPower;
}
// ---------------------------- Mapper 197 -------------------------------
/* ---------------------------- Mapper 197 ------------------------------- */
static void M197CW(uint32 A, uint8 V) {
if (A == 0x0000)
@@ -1115,10 +1121,10 @@ void Mapper197_Init(CartInfo *info) {
cwrap = M197CW;
}
// ---------------------------- Mapper 198 -------------------------------
/* ---------------------------- Mapper 198 ------------------------------- */
static void M198PW(uint32 A, uint8 V) {
if (V >= 0x50) // Tenchi o Kurau II - Shokatsu Koumei Den (J) (C).nes
if (V >= 0x50) /* Tenchi o Kurau II - Shokatsu Koumei Den (J) (C).nes */
setprg8(A, V & 0x4F);
else
setprg8(A, V);
@@ -1130,16 +1136,16 @@ void Mapper198_Init(CartInfo *info) {
info->Power = M195Power;
}
// ---------------------------- Mapper 205 ------------------------------
// GN-45 BOARD
/* ---------------------------- Mapper 205 ------------------------------ */
/* GN-45 BOARD */
static void M205PW(uint32 A, uint8 V) {
// GN-30A - íà÷àëüíàÿ ìàñêà äîëæíà áûòü 1F + àïïàðàòíûé ïåðåêëþ÷àòåëü íà øèíå àäðåñà
/* GN-30A - \ED\E0\F7\E0\EB\FC\ED\E0\FF \EC\E0\F1\EA\E0 \E4\EE\EB\E6\ED\E0 \E1\FB\F2\FC 1F + \E0\EF\EF\E0\F0\E0\F2\ED\FB\E9 \EF\E5\F0\E5\EA\EB\FE\F7\E0\F2\E5\EB\FC \ED\E0 \F8\E8\ED\E5 \E0\E4\F0\E5\F1\E0 */
setprg8(A, (V & 0x0f) | EXPREGS[0]);
}
static void M205CW(uint32 A, uint8 V) {
// GN-30A - íà÷àëüíàÿ ìàñêà äîëæíà áûòü FF
/* GN-30A - \ED\E0\F7\E0\EB\FC\ED\E0\FF \EC\E0\F1\EA\E0 \E4\EE\EB\E6\ED\E0 \E1\FB\F2\FC FF */
setchr1(A, (V & 0x7F) | (EXPREGS[0] << 3));
}
@@ -1170,7 +1176,7 @@ static void M205Reset(void) {
static void M205Power(void) {
GenMMC3Power();
SetWriteHandler(0x6000, 0x6fff, M205Write0);
SetWriteHandler(0x7000, 0x7fff, M205Write1); // OK-411 boards, the same logic, but data latched, 2-in-1 frankenstein
SetWriteHandler(0x7000, 0x7fff, M205Write1); /* OK-411 boards, the same logic, but data latched, 2-in-1 frankenstein */
}
void Mapper205_Init(CartInfo *info) {
@@ -1182,10 +1188,10 @@ void Mapper205_Init(CartInfo *info) {
AddExState(EXPREGS, 1, 0, "EXPR");
}
// ---------------------------- Mapper 245 ------------------------------
/* ---------------------------- Mapper 245 ------------------------------ */
static void M245CW(uint32 A, uint8 V) {
if (!UNIFchrrama) // Yong Zhe Dou E Long - Dragon Quest VI (As).nes NEEDS THIS for RAM cart
if (!UNIFchrrama) /* Yong Zhe Dou E Long - Dragon Quest VI (As).nes NEEDS THIS for RAM cart */
setchr1(A, V & 7);
EXPREGS[0] = V;
FixMMC3PRG(MMC3_cmd);
@@ -1208,7 +1214,7 @@ void Mapper245_Init(CartInfo *info) {
AddExState(EXPREGS, 1, 0, "EXPR");
}
// ---------------------------- Mapper 249 ------------------------------
/* ---------------------------- Mapper 249 ------------------------------ */
static void M249PW(uint32 A, uint8 V) {
if (EXPREGS[0] & 0x2) {
@@ -1248,7 +1254,7 @@ void Mapper249_Init(CartInfo *info) {
AddExState(EXPREGS, 1, 0, "EXPR");
}
// ---------------------------- Mapper 250 ------------------------------
/* ---------------------------- Mapper 250 ------------------------------ */
static DECLFW(M250Write) {
MMC3_CMDWrite((A & 0xE000) | ((A & 0x400) >> 10), A & 0xFF);
@@ -1269,7 +1275,7 @@ void Mapper250_Init(CartInfo *info) {
info->Power = M250_Power;
}
// ---------------------------- Mapper 254 ------------------------------
/* ---------------------------- Mapper 254 ------------------------------ */
static DECLFR(MR254WRAM) {
if (EXPREGS[0])
@@ -1298,7 +1304,7 @@ void Mapper254_Init(CartInfo *info) {
AddExState(EXPREGS, 2, 0, "EXPR");
}
// ---------------------------- UNIF Boards -----------------------------
/* ---------------------------- UNIF Boards ----------------------------- */
void TBROM_Init(CartInfo *info) {
GenMMC3_Init(info, 64, 64, 0, 0);

View File

@@ -93,8 +93,8 @@ static uint8 *WRAM = NULL;
static uint8 *MMC5fill = NULL;
static uint8 *ExRAM = NULL;
static uint8 MMC5WRAMsize; //configuration, not state
static uint8 MMC5WRAMIndex[8]; //configuration, not state
static uint8 MMC5WRAMsize; /* configuration, not state */
static uint8 MMC5WRAMIndex[8]; /* configuration, not state */
static uint8 MMC5ROMWrProtect[4];
static uint8 MMC5MemIn[5];
@@ -154,11 +154,11 @@ static void BuildWRAMSizeTable(void) {
int x;
for (x = 0; x < 8; x++) {
switch (MMC5WRAMsize) {
case 0: MMC5WRAMIndex[x] = 255; break; //X,X,X,X,X,X,X,X
case 1: MMC5WRAMIndex[x] = (x > 3) ? 255 : 0; break; //0,0,0,0,X,X,X,X
case 2: MMC5WRAMIndex[x] = (x & 4) >> 2; break; //0,0,0,0,1,1,1,1
case 4: MMC5WRAMIndex[x] = (x > 3) ? 255 : (x & 3); break; //0,1,2,3,X,X,X,X
case 8: MMC5WRAMIndex[x] = x; break; //0,1,2,3,4,5,6,7
case 0: MMC5WRAMIndex[x] = 255; break; /* X,X,X,X,X,X,X,X */
case 1: MMC5WRAMIndex[x] = (x > 3) ? 255 : 0; break; /* 0,0,0,0,X,X,X,X */
case 2: MMC5WRAMIndex[x] = (x & 4) >> 2; break; /* 0,0,0,0,1,1,1,1 */
case 4: MMC5WRAMIndex[x] = (x > 3) ? 255 : (x & 3); break; /* 0,1,2,3,X,X,X,X */
case 8: MMC5WRAMIndex[x] = x; break; /* 0,1,2,3,4,5,6,7 */
}
}
}
@@ -458,7 +458,7 @@ void MMC5Synco(void) {
MMC5CHRB();
}
//in case the fill register changed, we need to overwrite the fill buffer
/* in case the fill register changed, we need to overwrite the fill buffer */
FCEU_dwmemset(MMC5fill, NTFill | (NTFill << 8) | (NTFill << 16) | (NTFill << 24), 0x3c0);
{
unsigned char moop = ATFill | (ATFill << 2) | (ATFill << 4) | (ATFill << 6);
@@ -467,21 +467,23 @@ void MMC5Synco(void) {
MMC5HackCHRMode = CHRMode & 3;
//zero 17-apr-2013 - why the heck should this happen here? anything in a `synco` should be depending on the state.
//im going to leave it commented out to see what happens
//X6502_IRQEnd(FCEU_IQEXT);
/* zero 17-apr-2013 - why the heck should this happen here? anything in a `synco` should be depending on the state.
* im going to leave it commented out to see what happens
*/
/* X6502_IRQEnd(FCEU_IQEXT); */
}
void MMC5_hb(int scanline) {
//zero 24-jul-2014 - revised for newer understanding, to fix metal slader glory credits. see r7371 in bizhawk
/* zero 24-jul-2014 - revised for newer understanding, to fix metal slader glory credits. see r7371 in bizhawk */
int sl = scanline + 1;
int ppuon = (PPU[1] & 0x18);
if (!ppuon || sl >= 241)
{
// whenever rendering is off for any reason (vblank or forced disable
// the irq counter resets, as well as the inframe flag (easily verifiable from software)
/* whenever rendering is off for any reason (vblank or forced disable
* the irq counter resets, as well as the inframe flag (easily verifiable from software)
*/
MMC5IRQR &= ~0x40;
MMC5IRQR &= ~0x80;
MMC5LineCounter = 0;
@@ -744,8 +746,8 @@ static void GenMMC5Reset(void) {
SetWriteHandler(0x5205, 0x5206, Mapper5_write);
SetReadHandler(0x5205, 0x5206, MMC5_read);
// GameHBIRQHook=MMC5_hb;
// FCEU_CheatAddRAM(8, 0x6000, WRAM);
/* GameHBIRQHook=MMC5_hb; */
/* FCEU_CheatAddRAM(8, 0x6000, WRAM); */
FCEU_CheatAddRAM(1, 0x5c00, ExRAM);
}
@@ -763,7 +765,7 @@ static SFORMAT MMC5_StateRegs[] = {
{ &NTFill, 1, "NTFL" },
{ &ATFill, 1, "ATFL" },
//zero 17-apr-2013 - added
/* zero 17-apr-2013 - added */
{ &MMC5IRQR, 1, "IRQR" },
{ &MMC5LineCounter, 1, "LCTR" },
{ &mmc5psize, 1, "PSIZ" },
@@ -780,7 +782,7 @@ static SFORMAT MMC5_StateRegs[] = {
{ &MMC5Sound.raw, 1, "SDRW" },
{ &MMC5Sound.rawcontrol, 1, "SDRC" },
//zero 17-apr-2013 - added
/* zero 17-apr-2013 - added */
{ &MMC5Sound.dcount[0], 4 | FCEUSTATE_RLSB, "DCT0" },
{ &MMC5Sound.dcount[1], 4 | FCEUSTATE_RLSB, "DCT1" },
{ &MMC5Sound.BC[0], 4 | FCEUSTATE_RLSB, "BC00" },
@@ -835,10 +837,11 @@ void Mapper5_Init(CartInfo *info) {
GenMMC5_Init(info, WRAMSIZE, info->battery);
}
// ELROM seems to have 0KB of WRAM
// EKROM seems to have 8KB of WRAM, battery-backed
// ETROM seems to have 16KB of WRAM, battery-backed
// EWROM seems to have 32KB of WRAM, battery-backed
/* ELROM seems to have 0KB of WRAM
* EKROM seems to have 8KB of WRAM, battery-backed
* ETROM seems to have 16KB of WRAM, battery-backed
* EWROM seems to have 32KB of WRAM, battery-backed
*/
void ELROM_Init(CartInfo *info) {
GenMMC5_Init(info, 0, 0);

View File

@@ -73,7 +73,7 @@ static void FP_FASTAPASS(1) NamcoIRQHook(int a) {
if (IRQCount >= 0x7FFF) {
X6502_IRQBegin(FCEU_IQEXT);
IRQa = 0;
IRQCount = 0x7FFF; //7FFF;
IRQCount = 0x7FFF;
}
}
}
@@ -116,8 +116,8 @@ static void FixNTAR(void) {
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);
/* printf("BLAHAHA: %d, %02x\n",x,V); */
/* setchr1r(0x10,x<<10,V&7); */
} else
setchr1(x << 10, V);
}
@@ -224,7 +224,7 @@ static int32 CVBC;
#define TOINDEX (16 + 1)
// 16:15
/* 16:15 */
static void SyncHQ(int32 ts) {
CVBC = ts;
}
@@ -264,7 +264,7 @@ static void DoNamcoSoundHQ(void) {
lengo = LengthCache[P];
duff2 = FetchDuff(P, envelope);
for (V = CVBC << 1; V < SOUNDTS << 1; V++) {
for (V = CVBC << 1; V < (int)SOUNDTS << 1; V++) {
WaveHi[V >> 1] += duff2;
if (!vco) {
PlayIndex[P] += freq;

View File

@@ -27,20 +27,21 @@
#include "mapinc.h"
// General Purpose Registers
/* General Purpose Registers */
static uint8 cpu410x[16], ppu201x[16], apu40xx[64];
// IRQ Registers
/* IRQ Registers */
static uint8 IRQCount, IRQa, IRQReload;
#define IRQLatch cpu410x[0x1] // accc cccc, a = 0, AD12 switching, a = 1, HSYNC switching
#define IRQLatch cpu410x[0x1] /* accc cccc, a = 0, AD12 switching, a = 1, HSYNC switching */
// MMC3 Registers
static uint8 inv_hack = 0; // some OneBus Systems have swapped PRG reg commans in MMC3 inplementation,
// trying to autodetect unusual behavior, due not to add a new mapper.
#define mmc3cmd cpu410x[0x5] // pcv- ----, p - program swap, c - video swap, v - internal VRAM enable
#define mirror cpu410x[0x6] // ---- ---m, m = 0 - H, m = 1 - V
/* MMC3 Registers */
static uint8 inv_hack = 0; /* some OneBus Systems have swapped PRG reg commans in MMC3 inplementation,
* trying to autodetect unusual behavior, due not to add a new mapper.
*/
#define mmc3cmd cpu410x[0x5] /* pcv- ----, p - program swap, c - video swap, v - internal VRAM enable */
#define mirror cpu410x[0x6] /* ---- ---m, m = 0 - H, m = 1 - V */
// APU Registers
/* APU Registers */
static uint8 pcm_enable = 0, pcm_irq = 0;
static int16 pcm_addr, pcm_size, pcm_latch, pcm_clock = 0xE1;
@@ -70,22 +71,24 @@ static void PSync(void) {
uint32 block = ((cpu410x[0x0] & 0xf0) << 4) + (cpu410x[0xa] & (~mask));
uint32 pswap = (mmc3cmd & 0x40) << 8;
// uint8 bank0 = (cpu410x[0xb] & 0x40)?(~1):(cpu410x[0x7]);
// uint8 bank1 = cpu410x[0x8];
// uint8 bank2 = (cpu410x[0xb] & 0x40)?(cpu410x[0x9]):(~1);
// uint8 bank3 = ~0;
#if 0
uint8 bank0 = (cpu410x[0xb] & 0x40)?(~1):(cpu410x[0x7]);
uint8 bank1 = cpu410x[0x8];
uint8 bank2 = (cpu410x[0xb] & 0x40)?(cpu410x[0x9]):(~1);
uint8 bank3 = ~0;
#endif
uint8 bank0 = cpu410x[0x7 ^ inv_hack];
uint8 bank1 = cpu410x[0x8 ^ inv_hack];
uint8 bank2 = (cpu410x[0xb] & 0x40) ? (cpu410x[0x9]) : (~1);
uint8 bank3 = ~0;
// FCEU_printf(" PRG: %04x [%02x]",0x8000^pswap,block | (bank0 & mask));
/* FCEU_printf(" PRG: %04x [%02x]",0x8000^pswap,block | (bank0 & mask)); */
setprg8(0x8000 ^ pswap, block | (bank0 & mask));
// FCEU_printf(" %04x [%02x]",0xa000^pswap,block | (bank1 & mask));
/* FCEU_printf(" %04x [%02x]",0xa000^pswap,block | (bank1 & mask)); */
setprg8(0xa000, block | (bank1 & mask));
// FCEU_printf(" %04x [%02x]",0xc000^pswap,block | (bank2 & mask));
/* FCEU_printf(" %04x [%02x]",0xc000^pswap,block | (bank2 & mask)); */
setprg8(0xc000 ^ pswap, block | (bank2 & mask));
// FCEU_printf(" %04x [%02x]\n",0xe000^pswap,block | (bank3 & mask));
/* FCEU_printf(" %04x [%02x]\n",0xe000^pswap,block | (bank3 & mask)); */
setprg8(0xe000, block | (bank3 & mask));
}
@@ -122,9 +125,9 @@ static void Sync(void) {
}
static DECLFW(UNLOneBusWriteCPU410X) {
// FCEU_printf("CPU %04x:%04x\n",A,V);
/* FCEU_printf("CPU %04x:%04x\n",A,V); */
switch (A & 0xf) {
case 0x1: IRQLatch = V & 0xfe; break; // íå ïî äàòàøèòó
case 0x1: IRQLatch = V & 0xfe; break; /* íå ïî äàòàøèòó */
case 0x2: IRQReload = 1; break;
case 0x3: X6502_IRQEnd(FCEU_IQEXT); IRQa = 0; break;
case 0x4: IRQa = 1; break;
@@ -135,13 +138,13 @@ static DECLFW(UNLOneBusWriteCPU410X) {
}
static DECLFW(UNLOneBusWritePPU201X) {
// FCEU_printf("PPU %04x:%04x\n",A,V);
/* FCEU_printf("PPU %04x:%04x\n",A,V); */
ppu201x[A & 0x0f] = V;
Sync();
}
static DECLFW(UNLOneBusWriteMMC3) {
// FCEU_printf("MMC %04x:%04x\n",A,V);
/* FCEU_printf("MMC %04x:%04x\n",A,V); */
switch (A & 0xe001) {
case 0x8000: mmc3cmd = (mmc3cmd & 0x38) | (V & 0xc7); Sync(); break;
case 0x8001:
@@ -180,7 +183,7 @@ static void UNLOneBusIRQHook(void) {
}
static DECLFW(UNLOneBusWriteAPU40XX) {
// if(((A & 0x3f)!=0x16) && ((apu40xx[0x30] & 0x10) || ((A & 0x3f)>0x17)))FCEU_printf("APU %04x:%04x\n",A,V);
/* if(((A & 0x3f)!=0x16) && ((apu40xx[0x30] & 0x10) || ((A & 0x3f)>0x17)))FCEU_printf("APU %04x:%04x\n",A,V); */
apu40xx[A & 0x3f] = V;
switch (A & 0x3f) {
case 0x12:
@@ -211,7 +214,7 @@ static DECLFW(UNLOneBusWriteAPU40XX) {
static DECLFR(UNLOneBusReadAPU40XX) {
uint8 result = defapuread[A & 0x3f](A);
// FCEU_printf("read %04x, %02x\n",A,result);
/* FCEU_printf("read %04x, %02x\n",A,result); */
switch (A & 0x3f) {
case 0x15:
if (apu40xx[0x30] & 0x10) {
@@ -286,7 +289,7 @@ void UNLOneBus_Init(CartInfo *info) {
info->Power = UNLOneBusPower;
info->Reset = UNLOneBusReset;
if (((*(uint32*)&(info->MD5)) == 0x305fcdc3) || // PowerJoy Supermax Carts
if (((*(uint32*)&(info->MD5)) == 0x305fcdc3) || /* PowerJoy Supermax Carts */
((*(uint32*)&(info->MD5)) == 0x6abfce8e))
inv_hack = 0xf;

View File

@@ -33,14 +33,14 @@ static SFORMAT StateRegs[] =
};
static uint8 bs_tbl[128] = {
0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, // 00
0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, // 10
0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, // 20
0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, // 30
0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, // 40
0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, // 50
0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x00, 0x10, 0x20, 0x30, // 60
0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, // 70
0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, /* 00 */
0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, /* 10 */
0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, /* 20 */
0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, /* 30 */
0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, /* 40 */
0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, /* 50 */
0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x00, 0x10, 0x20, 0x30, /* 60 */
0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, /* 70 */
};
static uint8 br_tbl[16] = {
@@ -71,12 +71,12 @@ static void Sync(void) {
static DECLFW(UNLPEC586Write) {
reg[(A & 0x700) >> 8] = V;
PEC586Hack = (reg[0] & 0x80) >> 7;
// FCEU_printf("bs %04x %02x\n", A, V);
/* FCEU_printf("bs %04x %02x\n", A, V); */
Sync();
}
static DECLFR(UNLPEC586Read) {
// FCEU_printf("read %04x\n", A);
/* FCEU_printf("read %04x\n", A); */
return (X.DB & 0xD8) | br_tbl[reg[4] >> 4];
}

View File

@@ -28,10 +28,12 @@
#include "mapinc.h"
static DECLFR(UNLRT01Read) {
// u16 i, prot_areas[2][2] = {
// { 0x8E80, 0x8EFF },
// { 0xFE80, 0xFEFF },
// };
#if 0
u16 i, prot_areas[2][2] = {
{ 0x8E80, 0x8EFF },
{ 0xFE80, 0xFEFF },
};
#endif
if(((A >= 0xCE80) && (A < 0xCF00)) ||
((A >= 0xFE80) && (A < 0xFF00))) {
return 0xF2 | (rand() & 0x0D);

View File

@@ -57,7 +57,7 @@ static DECLFW(S74LS374NWrite) {
static DECLFR(S74LS374NRead) {
uint8 ret;
if ((A & 0x4100) == 0x4100)
// ret=(X.DB&0xC0)|((~cmd)&0x3F);
/* ret=(X.DB&0xC0)|((~cmd)&0x3F); */
ret = ((~cmd) & 0x3F) ^ dip;
else
ret = X.DB;
@@ -135,7 +135,7 @@ static void S8259Synco(void) {
int x;
setprg32(0x8000, latch[5] & 7);
if (!UNIFchrrama) { // No CHR RAM? Then BS'ing is ok.
if (!UNIFchrrama) { /* No CHR RAM? Then BS'ing is ok. */
for (x = 0; x < 4; x++) {
int bank;
if (latch[7] & 1)
@@ -191,7 +191,7 @@ static void S8259Restore(int version) {
S8259Synco();
}
void S8259A_Init(CartInfo *info) { // Kevin's Horton 141 mapper
void S8259A_Init(CartInfo *info) { /* Kevin's Horton 141 mapper */
info->Power = S8259Reset;
GameStateRestore = S8259Restore;
AddExState(latch, 8, 0, "LATC");
@@ -199,7 +199,7 @@ void S8259A_Init(CartInfo *info) { // Kevin's Horton 141 mapper
type = 0;
}
void S8259B_Init(CartInfo *info) { // Kevin's Horton 138 mapper
void S8259B_Init(CartInfo *info) { /* Kevin's Horton 138 mapper */
info->Power = S8259Reset;
GameStateRestore = S8259Restore;
AddExState(latch, 8, 0, "LATC");
@@ -207,7 +207,7 @@ void S8259B_Init(CartInfo *info) { // Kevin's Horton 138 mapper
type = 1;
}
void S8259C_Init(CartInfo *info) { // Kevin's Horton 139 mapper
void S8259C_Init(CartInfo *info) { /* Kevin's Horton 139 mapper */
info->Power = S8259Reset;
GameStateRestore = S8259Restore;
AddExState(latch, 8, 0, "LATC");
@@ -215,7 +215,7 @@ void S8259C_Init(CartInfo *info) { // Kevin's Horton 139 mapper
type = 2;
}
void S8259D_Init(CartInfo *info) { // Kevin's Horton 137 mapper
void S8259D_Init(CartInfo *info) { /* Kevin's Horton 137 mapper */
info->Power = S8259Reset;
GameStateRestore = S8259Restore;
AddExState(latch, 8, 0, "LATC");
@@ -317,7 +317,7 @@ void SA0037_Init(CartInfo *info) {
AddExState(&latch[0], 1, 0, "LATC");
}
// -----------------------------------------------
/* ----------------------------------------------- */
static void TCU01Synco() {
setprg32(0x8000, ((latch[0] & 0x80) >> 6) | ((latch[0] >> 2) & 1));
@@ -348,7 +348,7 @@ void TCU01_Init(CartInfo *info) {
AddExState(&latch[0], 1, 0, "LATC");
}
//-----------------------------------------------
/* ----------------------------------------------- */
static void TCU02Synco() {
setprg32(0x8000, 0);
@@ -384,7 +384,7 @@ void TCU02_Init(CartInfo *info) {
AddExState(&latch[0], 1, 0, "LATC");
}
// ---------------------------------------------
/* --------------------------------------------- */
static DECLFR(TCA01Read) {
uint8 ret;

View File

@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
// T-227-1, 820632, MMC3 based, multimenu, 60000in1 (0010) dip switches
/* T-227-1, 820632, MMC3 based, multimenu, 60000in1 (0010) dip switches */
#include "mapinc.h"
#include "mmc3.h"

View File

@@ -65,15 +65,15 @@ static void Sync(void) {
setchr8(0);
else {
uint8 i;
if (!weirdo)
/* if (!weirdo) */
for (i = 0; i < 8; i++)
setchr1(i << 10, (chrhi[i] | chrreg[i]) >> is22);
else {
/* else {
setchr1(0x0000, 0xFC);
setchr1(0x0400, 0xFD);
setchr1(0x0800, 0xFF);
weirdo--;
}
} */
}
switch (mirr & 0x3) {
case 0: setmirror(MI_V); break;

View File

@@ -24,8 +24,8 @@
#include "mapinc.h"
static uint8 preg;
static uint8 IRQx; //autoenable
static uint8 IRQm; //mode
static uint8 IRQx; /* autoenable */
static uint8 IRQm; /* mode */
static uint8 IRQa;
static uint16 IRQReload, IRQCount;
static uint8 *WRAM = NULL;
@@ -90,7 +90,7 @@ static void M73IRQHook(int a) {
IRQCount |= temp;
}
} else {
//16 bit mode
/* 16 bit mode */
if (IRQCount == 0xFFFF) {
IRQCount = IRQReload;
X6502_IRQBegin(FCEU_IQEXT);

View File

@@ -154,7 +154,7 @@ static void StateRestore(int version) {
Sync();
}
// VRC6 Sound
/* VRC6 Sound */
static void DoSQV1(void);
static void DoSQV2(void);
@@ -340,7 +340,7 @@ static void VRC6_ESI(void) {
AddExState(&SStateRegs, ~0, 0, 0);
}
// VRC6 Sound
/* VRC6 Sound */
void Mapper24_Init(CartInfo *info) {
is26 = 0;

View File

@@ -19,7 +19,10 @@
*/
#include "mapinc.h"
#include "emu2413.h"
static int32 dwave = 0;
static OPLL *VRC7Sound = NULL;
static uint8 vrc7idx, preg[3], creg[8], mirr;
static uint8 IRQLatch, IRQa, IRQd;
static int32 IRQCount, CycleCount;
@@ -40,12 +43,7 @@ static SFORMAT StateRegs[] =
{ 0 }
};
// VRC7 Sound
#include "emu2413.h"
static int32 dwave = 0;
static OPLL *VRC7Sound = NULL;
/* VRC7 Sound */
void DoVRC7Sound(void) {
int32 z, a;
@@ -89,7 +87,7 @@ static void VRC7_ESI(void) {
OPLL_reset(VRC7Sound);
}
// VRC7 Sound
/* VRC7 Sound */
static void Sync(void) {
uint8 i;
@@ -117,7 +115,7 @@ static DECLFW(VRC7SW) {
}
static DECLFW(VRC7Write) {
A |= (A & 8) << 1; // another two-in-oooone
A |= (A & 8) << 1; /* another two-in-oooone */
if (A >= 0xA000 && A <= 0xDFFF) {
A &= 0xF010;
creg[((A >> 4) & 1) | ((A - 0xA000) >> 11)] = V;

View File

@@ -71,7 +71,7 @@ static void UNLYOKOSync(void) {
}
static void M83Sync(void) {
switch (mode & 3) { // check if it is truth
switch (mode & 3) { /* check if it is true */
case 0: setmirror(MI_V); break;
case 1: setmirror(MI_H); break;
case 2: setmirror(MI_0); break;
@@ -89,7 +89,7 @@ static void M83Sync(void) {
}
setprg8r(0x10, 0x6000, 0);
if (mode & 0x40) {
setprg16(0x8000, (bank & 0x3F)); // DBZ Party [p1]
setprg16(0x8000, (bank & 0x3F)); /* DBZ Party [p1] */
setprg16(0xC000, (bank & 0x30) | 0xF);
} else {
setprg8(0x8000, reg[8]);
@@ -118,9 +118,9 @@ static DECLFW(UNLYOKOWrite) {
static DECLFW(M83Write) {
switch (A) {
case 0x8000: is2kbank = 1;
case 0xB000: // Dragon Ball Z Party [p1] BMC
case 0xB0FF: // Dragon Ball Z Party [p1] BMC
case 0xB1FF: bank = V; mode |= 0x40; M83Sync(); break; // Dragon Ball Z Party [p1] BMC
case 0xB000: /* Dragon Ball Z Party [p1] BMC */
case 0xB0FF: /* Dragon Ball Z Party [p1] BMC */
case 0xB1FF: bank = V; mode |= 0x40; M83Sync(); break; /* Dragon Ball Z Party [p1] BMC */
case 0x8100: mode = V | (mode & 0x40); M83Sync(); break;
case 0x8200: IRQCount &= 0xFF00; IRQCount |= V; X6502_IRQEnd(FCEU_IQEXT); break;
case 0x8201: IRQa = mode & 0x80; IRQCount &= 0xFF; IRQCount |= V << 8; break;
@@ -171,7 +171,7 @@ static void M83Power(void) {
SetReadHandler(0x5100, 0x5103, UNLYOKOReadLow);
SetWriteHandler(0x5100, 0x5103, UNLYOKOWriteLow);
SetReadHandler(0x6000, 0x7fff, CartBR);
SetWriteHandler(0x6000, 0x7fff, CartBW);// Pirate Dragon Ball Z Party [p1] used if for saves instead of seraial EEPROM
SetWriteHandler(0x6000, 0x7fff, CartBW);/* Pirate Dragon Ball Z Party [p1] used if for saves instead of seraial EEPROM */
SetReadHandler(0x8000, 0xffff, CartBR);
SetWriteHandler(0x8000, 0xffff, M83Write);
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);

View File

@@ -136,7 +136,7 @@ DECLFR(CartBR) {
}
DECLFW(CartBW) {
//printf("Ok: %04x:%02x, %d\n",A,V,PRGIsRAM[A>>11]);
/* printf("Ok: %04x:%02x, %d\n",A,V,PRGIsRAM[A>>11]); */
if (PRGIsRAM[A >> 11] && Page[A >> 11])
Page[A >> 11][A] = V;
}
@@ -439,7 +439,7 @@ static readfunc GenieBackup[3];
static DECLFR(GenieFix1) {
uint8 r = GenieBackup[0](A);
if ((modcon >> 1) & 1) // No check
if ((modcon >> 1) & 1) /* No check */
return genieval[0];
else if (r == geniech[0])
return genieval[0];
@@ -450,7 +450,7 @@ static DECLFR(GenieFix1) {
static DECLFR(GenieFix2) {
uint8 r = GenieBackup[1](A);
if ((modcon >> 2) & 1) // No check
if ((modcon >> 2) & 1) /* No check */
return genieval[1];
else if (r == geniech[1])
return genieval[1];
@@ -461,7 +461,7 @@ static DECLFR(GenieFix2) {
static DECLFR(GenieFix3) {
uint8 r = GenieBackup[2](A);
if ((modcon >> 3) & 1) // No check
if ((modcon >> 3) & 1) /* No check */
return genieval[2];
else if (r == geniech[2])
return genieval[2];
@@ -480,7 +480,7 @@ void FixGenieMap(void) {
VPageR = VPage;
FlushGenieRW();
//printf("Rightyo\n");
/* printf("Rightyo\n"); */
for (x = 0; x < 3; x++)
if ((modcon >> (4 + x)) & 1) {
readfunc tmp[3] = { GenieFix1, GenieFix2, GenieFix3 };

View File

@@ -2,25 +2,27 @@
#define _FCEU_CART_H
typedef struct {
// Set by mapper/board code:
/* Set by mapper/board code: */
void (*Power)(void);
void (*Reset)(void);
void (*Close)(void);
uint8 *SaveGame[4]; // Pointers to memory to save/load.
uint32 SaveGameLen[4]; // How much memory to save/load.
uint8 *SaveGame[4]; /* Pointers to memory to save/load. */
uint32 SaveGameLen[4]; /* How much memory to save/load. */
// Set by iNES/UNIF loading code.
int mirror; // As set in the header or chunk.
// iNES/UNIF specific. Intended
// to help support games like "Karnov"
// that are not really MMC3 but are
// set to mapper 4.
int battery; // Presence of an actual battery.
/* Set by iNES/UNIF loading code. */
int mirror; /* As set in the header or chunk.
* iNES/UNIF specific. Intended
* to help support games like "Karnov"
* that are not really MMC3 but are
* set to mapper 4.
*/
int battery; /* Presence of an actual battery. */
int vram_size;
uint8 MD5[16];
uint32 CRC32; // Should be set by the iNES/UNIF loading
// code, used by mapper/board code, maybe
// other code in the future.
uint32 CRC32; /* Should be set by the iNES/UNIF loading
* code, used by mapper/board code, maybe
* other code in the future.
*/
} CartInfo;
extern uint8 *Page[32], *VPage[8], *MMC5SPRVPage[8], *MMC5BGVPage[8];

View File

@@ -114,7 +114,7 @@ void RebuildSubCheats(void) {
if (c->type == 1 && c->status) {
if (GetReadHandler(c->addr) == SubCheatsRead) {
/* Prevent a catastrophe by this check. */
//FCEU_DispMessage("oops");
/* FCEU_DispMessage("oops"); */
} else {
SubCheats[numsubcheats].PrevRead = GetReadHandler(c->addr);
SubCheats[numsubcheats].addr = c->addr;
@@ -224,27 +224,27 @@ int FCEUI_DelCheat(uint32 which) {
uint32 x = 0;
for (prev = 0, cur = cheats;; ) {
if (x == which) { // Remove this cheat.
if (prev) { // Update pointer to this cheat.
if (cur->next) // More cheats.
if (x == which) { /* Remove this cheat. */
if (prev) { /* Update pointer to this cheat. */
if (cur->next) /* More cheats. */
prev->next = cur->next;
else { // No more.
else { /* No more. */
prev->next = 0;
cheatsl = prev; // Set the previous cheat as the last cheat.
cheatsl = prev; /* Set the previous cheat as the last cheat. */
}
} else {// This is the first cheat.
if (cur->next) // More cheats
} else {/* This is the first cheat. */
if (cur->next) /* More cheats */
cheats = cur->next;
else
cheats = cheatsl = 0; // No (more) cheats.
cheats = cheatsl = 0; /* No (more) cheats. */
}
free(cur->name);// Now that all references to this cheat are removed,
free(cur); // free the memory.
free(cur->name);/* Now that all references to this cheat are removed, */
free(cur); /* free the memory. */
break;
} // *END REMOVE THIS CHEAT*
} /* *END REMOVE THIS CHEAT* */
if (!cur->next) // No more cheats to go through(this shouldn't ever happen...)
if (!cur->next) /* No more cheats to go through(this shouldn't ever happen...) */
return(0);
prev = cur;
cur = prev->next;
@@ -341,7 +341,7 @@ int FCEUI_DecodeGG(const char *str, uint16 *a, uint8 *v, int *c) {
t = GGtobin(*str++);
A |= (t & 0x07) << 4;
//if(t&0x08) return(0); /* 8-character code?! */
/* if(t&0x08) return(0); */ /* 8-character code?! */
t = GGtobin(*str++);
A |= (t & 0x07) << 12;
@@ -579,41 +579,41 @@ void FCEUI_CheatSearchEnd(int type, uint8 v1, uint8 v2) {
}
if (!type) {// Change to a specific value.
if (!type) {/* Change to a specific value. */
for (x = 0; x < 0x10000; x++)
if (!(CheatComp[x] & CHEATC_NOSHOW)) {
if (CheatComp[x] == v1 && CheatRPtrs[x >> 10][x] == v2) {
} else
CheatComp[x] |= CHEATC_EXCLUDED;
}
} else if (type == 1) { // Search for relative change(between values).
} else if (type == 1) { /* Search for relative change(between values). */
for (x = 0; x < 0x10000; x++)
if (!(CheatComp[x] & CHEATC_NOSHOW)) {
if (CheatComp[x] == v1 && CAbs(CheatComp[x] - CheatRPtrs[x >> 10][x]) == v2) {
} else
CheatComp[x] |= CHEATC_EXCLUDED;
}
} else if (type == 2) { // Purely relative change.
} else if (type == 2) { /* Purely relative change. */
for (x = 0x000; x < 0x10000; x++)
if (!(CheatComp[x] & CHEATC_NOSHOW)) {
if (CAbs(CheatComp[x] - CheatRPtrs[x >> 10][x]) == v2) {
} else
CheatComp[x] |= CHEATC_EXCLUDED;
}
} else if (type == 3) { // Any change.
} else if (type == 3) { /* Any change. */
for (x = 0; x < 0x10000; x++)
if (!(CheatComp[x] & CHEATC_NOSHOW)) {
if (CheatComp[x] != CheatRPtrs[x >> 10][x]) {
} else
CheatComp[x] |= CHEATC_EXCLUDED;
}
} else if (type == 4) { // Value decreased.
} else if (type == 4) { /* Value decreased. */
for (x = 0; x < 0x10000; x++)
if (!(CheatComp[x] & CHEATC_NOSHOW)) {
if (!(CheatRPtrs[x >> 10][x] < CheatComp[x]))
CheatComp[x] |= CHEATC_EXCLUDED;
}
} else if (type == 5) { // Value increased.
} else if (type == 5) { /* Value increased. */
for (x = 0; x < 0x10000; x++)
if (!(CheatComp[x] & CHEATC_NOSHOW)) {
if (!(CheatRPtrs[x >> 10][x] > CheatComp[x]))

View File

@@ -70,17 +70,17 @@ void FCEUI_LoadMem(const char *fname, uint32 start, int hl) {
static char *fstrings[12] =
{
"#$%02X", // immediate
"$%04X", // RELATIVE(jump)
"$%02X", // Z
"$%02X,X", // Z,x
"$%02X,Y", // Z,y
"$%04X", //ABS
"$%04X,X", // ABS,x
"$%04X,Y", // ABS,y
"($%04X)", // IND
"($%02X,X)", // INX
"($%02X),Y", // INY
"#$%02X", /* immediate */
"$%04X", /* RELATIVE(jump) */
"$%02X", /* Z */
"$%02X,X", /* Z,x */
"$%02X,Y", /* Z,y */
"$%04X", /*ABS */
"$%04X,X", /* ABS,x */
"$%04X,Y", /* ABS,y */
"($%04X)", /* IND */
"($%02X,X)", /* INX */
"($%02X),Y", /* INY */
""
};
static int flengths[12] = { 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 0 };

View File

@@ -254,7 +254,7 @@ void FCEUI_GetIVectors(uint16 *reset, uint16 *irq, uint16 *nmi);
uint32 FCEUI_CRC32(uint32 crc, uint8 *buf, uint32 len);
//void FCEUI_ToggleTileView(void);
/* void FCEUI_ToggleTileView(void); */
void FCEUI_SetLowPass(int q);
void FCEUI_NSFSetVis(int mode);

View File

@@ -31,8 +31,8 @@
#include "video.c"
#include "vsuni.c"
//#include "x6502.c"
//#include "ines.c"
//#include "unif.c"
/* #include "x6502.c" */
/* #include "ines.c" */
/* #include "unif.c" */
#endif

View File

@@ -216,7 +216,7 @@ typedef uint64_t uintmax_t;
#ifndef WCHAR_MIN /* [ */
# define WCHAR_MIN 0
#endif /* WCHAR_MIN ] */
#ifndef WCHAR_MAX // [
#ifndef WCHAR_MAX /* [ */
# define WCHAR_MAX _UI16_MAX
#endif /* WCHAR_MAX ] */

View File

@@ -87,8 +87,6 @@ unsigned sndquality = 0;
unsigned sndvolume = 150;
unsigned swapDuty = 0;
static volatile int nofocus = 0;
static int32_t *sound = 0;
static uint32_t JSReturn = 0;
static uint32_t MouseData[3];

View File

@@ -42,10 +42,12 @@ typedef long long int64;
#elif MSVC
typedef __int64 int64;
typedef unsigned __int64 uint64;
#define GINLINE // Can't declare a function INLINE
// and global in MSVC. Bummer.
#define PSS_STYLE 2 // Does MSVC compile for anything
// other than Windows/DOS targets?
#define GINLINE /* Can't declare a function INLINE
* and global in MSVC. Bummer.
*/
#define PSS_STYLE 2 /* Does MSVC compile for anything
* other than Windows/DOS targets?
*/
#else
typedef unsigned long long uint64;
typedef long long int64;

View File

@@ -284,7 +284,7 @@ endlseq:
}
FCEU_ResetPalette();
FCEU_ResetMessages(); // Save state, status messages, etc.
FCEU_ResetMessages(); /* Save state, status messages, etc. */
return(GameInfo);
}
@@ -327,7 +327,7 @@ FCEUGI *FCEUI_CopyFamiStart(void)
}
FCEU_ResetPalette();
FCEU_ResetMessages(); // Save state, status messages, etc.
FCEU_ResetMessages(); /* Save state, status messages, etc. */
return(GameInfo);
}
@@ -385,13 +385,15 @@ void FCEU_MemoryRand(uint8 *ptr, uint32 size)
{
int x = 0;
while (size) {
// *ptr = (x & 4) ? 0xFF : 0x00; // Huang Di DEBUG MODE enabled by default
// Cybernoid NO MUSIC by default
// *ptr = (x & 4) ? 0x7F : 0x00; // Huang Di DEBUG MODE enabled by default
// Minna no Taabou no Nakayoshi Daisakusen DOESN'T BOOT
// Cybernoid NO MUSIC by default
// *ptr = (x & 1) ? 0x55 : 0xAA; // F-15 Sity War HISCORE is screwed...
// 1942 SCORE/HISCORE is screwed...
#if 0
*ptr = (x & 4) ? 0xFF : 0x00; /* Huang Di DEBUG MODE enabled by default */
/* Cybernoid NO MUSIC by default */
*ptr = (x & 4) ? 0x7F : 0x00; /* Huang Di DEBUG MODE enabled by default */
/* Minna no Taabou no Nakayoshi Daisakusen DOESN'T BOOT */
/* Cybernoid NO MUSIC by default */
*ptr = (x & 1) ? 0x55 : 0xAA; /* F-15 Sity War HISCORE is screwed... */
/* 1942 SCORE/HISCORE is screwed... */
#endif
*ptr = 0xFF;
x++;
size--;
@@ -551,7 +553,7 @@ void FCEUI_SetSnapName(int a)
int32 FCEUI_GetDesiredFPS(void)
{
if (PAL || dendy)
return(838977920); // ~50.007
return(838977920); /* ~50.007 */
else
return(1008307711); // ~60.1
return(1008307711); /* ~60.1 */
}

View File

@@ -85,12 +85,13 @@ typedef struct {
int SoundVolume;
int GameGenie;
// Current first and last rendered scanlines.
/* Current first and last rendered scanlines. */
int FirstSLine;
int LastSLine;
// Driver code(user)-specified first and last rendered scanlines.
// Usr*SLine[0] is for NTSC, Usr*SLine[1] is for PAL.
/* Driver code(user)-specified first and last rendered scanlines.
* Usr*SLine[0] is for NTSC, Usr*SLine[1] is for PAL.
*/
int UsrFirstSLine[2];
int UsrLastSLine[2];
int SnapName;

View File

@@ -34,10 +34,11 @@
#include "cart.h"
#include "md5.h"
// TODO: Add code to put a delay in between the time a disk is inserted
// and the when it can be successfully read/written to. This should
// prevent writes to wrong places OR add code to prevent disk ejects
// when the virtual motor is on(mmm...virtual motor).
/* TODO: Add code to put a delay in between the time a disk is inserted
* and the when it can be successfully read/written to. This should
* prevent writes to wrong places OR add code to prevent disk ejects
* when the virtual motor is on(mmm...virtual motor).
*/
static DECLFR(FDSRead4030);
static DECLFR(FDSRead4031);
@@ -115,9 +116,9 @@ static void FDSInit(void) {
lastDiskPtrRead = lastDiskPtrWrite = writeskip = DiskPtr = DiskSeekIRQ = 0;
setmirror(1);
setprg8(0xE000, 0); // BIOS
setprg32r(1, 0x6000, 0); // 32KB RAM
setchr8(0); // 8KB CHR RAM
setprg8(0xE000, 0); /* BIOS */
setprg32r(1, 0x6000, 0); /* 32KB RAM */
setchr8(0); /* 8KB CHR RAM */
MapIRQHook = FDSFix;
GameStateRestore = FDSStateRestore;
@@ -230,7 +231,7 @@ static DECLFR(FDSRead4032) {
}
static DECLFR(FDSRead4033) {
return 0x80; // battery
return 0x80; /* battery */
}
/* Begin FDS sound */
@@ -238,21 +239,21 @@ static DECLFR(FDSRead4033) {
#define FDSClock (1789772.7272727272727272 / 2)
typedef struct {
int64 cycles; // Cycles per PCM sample
int64 count; // Cycle counter
int64 envcount; // Envelope cycle counter
int64 cycles; /* Cycles per PCM sample */
int64 count; /* Cycle counter */
int64 envcount; /* Envelope cycle counter */
uint32 b19shiftreg60;
uint32 b24adder66;
uint32 b24latch68;
uint32 b17latch76;
int32 clockcount; // Counter to divide frequency by 8.
uint8 b8shiftreg88; // Modulation register.
uint8 amplitude[2]; // Current amplitudes.
int32 clockcount; /* Counter to divide frequency by 8. */
uint8 b8shiftreg88; /* Modulation register. */
uint8 amplitude[2]; /* Current amplitudes. */
uint8 speedo[2];
uint8 mwcount;
uint8 mwstart;
uint8 mwave[0x20]; // Modulation waveform
uint8 cwave[0x40]; // Game-defined waveform(carrier)
uint8 mwave[0x20]; /* Modulation waveform */
uint8 cwave[0x40]; /* Game-defined waveform(carrier) */
uint8 SPSG[0xB];
} FDSSOUND;
@@ -318,13 +319,14 @@ static DECLFW(FDSSWrite) {
SPSG[A] = V;
}
// $4080 - Fundamental wave amplitude data register 92
// $4082 - Fundamental wave frequency data register 58
// $4083 - Same as $4082($4083 is the upper 4 bits).
// $4084 - Modulation amplitude data register 78
// $4086 - Modulation frequency data register 72
// $4087 - Same as $4086($4087 is the upper 4 bits)
/* $4080 - Fundamental wave amplitude data register 92
* $4082 - Fundamental wave frequency data register 58
* $4083 - Same as $4082($4083 is the upper 4 bits).
*
* $4084 - Modulation amplitude data register 78
* $4086 - Modulation frequency data register 72
* $4087 - Same as $4086($4087 is the upper 4 bits)
*/
static void DoEnv() {
@@ -413,7 +415,7 @@ static INLINE int32 FDSDoSound(void) {
}
if (fdso.count >= 32768) goto dogk;
// Might need to emulate applying the amplitude to the waveform a bit better...
/* Might need to emulate applying the amplitude to the waveform a bit better... */
{
int k = amplitude[0];
if (k > 0x20) k = 0x20;
@@ -438,7 +440,7 @@ static void RenderSound(void) {
uint32 t = FDSDoSound();
t += t >> 1;
t >>= 4;
Wave[x >> 4] += t; //(t>>2)-(t>>3); //>>3;
Wave[x >> 4] += t; /* (t>>2)-(t>>3); */ /* >>3; */
}
}
@@ -449,7 +451,7 @@ static void RenderSoundHQ(void) {
for (x = FBC; x < SOUNDTS; x++) {
uint32 t = FDSDoSound();
t += t >> 1;
WaveHi[x] += t; //(t<<2)-(t<<1);
WaveHi[x] += t; /* (t<<2)-(t<<1); */
}
FBC = SOUNDTS;
}

View File

@@ -13,9 +13,9 @@ typedef struct {
#ifdef __LIBRETRO__
MEMWRAP *fp;
#else
void *fp; // FILE* or ptr to ZIPWRAP
void *fp; /* FILE* or ptr to ZIPWRAP */
#endif
uint32 type; // 0=normal file, 1=gzip, 2=zip
uint32 type; /* 0=normal file, 1=gzip, 2=zip */
} FCEUFILE;
#ifdef __LIBRETRO__

View File

@@ -22,7 +22,7 @@ void SexyFilter2(int32 *in, int32 count) {
p = ((double)2 - cos(x)) - sqrt(pow((double)2 - cos(x), 2) - 1);
c = p * 0x100000;
//printf("%f\n",(double)c/0x100000);
/* printf("%f\n",(double)c/0x100000); */
#endif
static int64 acc = 0;
@@ -33,9 +33,11 @@ void SexyFilter2(int32 *in, int32 count) {
acc += dropcurrent;
*in = acc >> 16;
in++;
//acc=((int64)0x100000-c)* *in + ((c*acc)>>20);
//*in=acc>>20;
//in++;
#if 0
acc=((int64)0x100000-c)* *in + ((c*acc)>>20);
*in=acc>>20;
in++;
#endif
}
}
@@ -56,11 +58,11 @@ void SexyFilter(int32 *in, int32 *out, int32 count) {
int64 ino = (int64) * in * vmul;
acc1 += ((ino - acc1) * mul1) >> 16;
acc2 += ((ino - acc1 - acc2) * mul2) >> 16;
//printf("%d ",*in);
/* printf("%d ",*in); */
*in = 0;
{
int32 t = (acc1 - ino + acc2) >> 16;
//if(t>32767 || t<-32768) printf("Flow: %d\n",t);
/* if(t>32767 || t<-32768) printf("Flow: %d\n",t); */
if (t > 32767) t = 32767;
if (t < -32768) t = -32768;
*out = t;
@@ -76,7 +78,7 @@ void SexyFilter(int32 *in, int32 *out, int32 count) {
from the end of in to the beginning of in.
*/
//static uint32 mva=1000;
/* static uint32 mva=1000; */
/* This filtering code assumes that almost all input values stay below 32767.
Do not adjust the volume in the wlookup tables and the expansion sound
@@ -89,10 +91,12 @@ int32 NeoFilterSound(int32 *in, int32 *out, uint32 inlen, int32 *leftover) {
int32 *outsave = out;
int32 count = 0;
// for(x=0;x<inlen;x++)
// {
// if(in[x]>mva) { mva=in[x]; printf("%ld\n",in[x]);}
// }
#if 0
for(x=0;x<inlen;x++)
{
if(in[x]>mva) { mva=in[x]; printf("%ld\n",in[x]);}
}
#endif
max = (inlen - 1) << 16;
if (FSettings.soundq == 2)

View File

@@ -60,7 +60,7 @@ void FCEUI_SetSaveDirectory(char *sav_dir)
SaveDirectory[2047] = 0;
}
static char *odirs[FCEUIOD__COUNT] = { 0, 0, 0, 0, 0, 0 }; // odirs, odors. ^_^
static char *odirs[FCEUIOD__COUNT] = { 0, 0, 0, 0, 0, 0 }; /* odirs, odors. ^_^ */
void FCEUI_SetDirOverride(int which, char *n)
{

View File

@@ -129,73 +129,73 @@ struct INPSEL {
static void SetInput(void) {
static struct INPSEL moo[] =
{
{0x19b0a9f1, SI_GAMEPAD, SI_ZAPPER, SIFC_NONE }, // 6-in-1 (MGC-023)(Unl)[!]
{0x29de87af, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERB }, // Aerobics Studio
{0xd89e5a67, SI_UNSET, SI_UNSET, SIFC_ARKANOID }, // Arkanoid (J)
{0x0f141525, SI_UNSET, SI_UNSET, SIFC_ARKANOID }, // Arkanoid 2(J)
{0x32fb0583, SI_UNSET, SI_ARKANOID, SIFC_NONE }, // Arkanoid(NES)
{0x60ad090a, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERA }, // Athletic World
{0x48ca0ee1, SI_GAMEPAD, SI_GAMEPAD, SIFC_BWORLD }, // Barcode World
{0x4318a2f8, SI_UNSET, SI_ZAPPER, SIFC_NONE }, // Barker Bill's Trick Shooting
{0x6cca1c1f, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERB }, // Dai Undoukai
{0x24598791, SI_UNSET, SI_ZAPPER, SIFC_NONE }, // Duck Hunt
{0xd5d6eac4, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, // Edu (As)
{0xe9a7fe9e, SI_UNSET, SI_MOUSE, SIFC_NONE }, // Educational Computer 2000
{0x8f7b1669, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, // FP BASIC 3.3 by maxzhou88
{0xf7606810, SI_UNSET, SI_UNSET, SIFC_FKB }, // Family BASIC 2.0A
{0x895037bc, SI_UNSET, SI_UNSET, SIFC_FKB }, // Family BASIC 2.1a
{0xb2530afc, SI_UNSET, SI_UNSET, SIFC_FKB }, // Family BASIC 3.0
{0xea90f3e2, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERB }, // Family Trainer: Running Stadium
{0xbba58be5, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERB }, // Family Trainer: Manhattan Police
{0x3e58a87e, SI_UNSET, SI_ZAPPER, SIFC_NONE }, // Freedom Force
{0xd9f45be9, SI_GAMEPAD, SI_GAMEPAD, SIFC_QUIZKING }, // Gimme a Break ...
{0x1545bd13, SI_GAMEPAD, SI_GAMEPAD, SIFC_QUIZKING }, // Gimme a Break ... 2
{0x4e959173, SI_UNSET, SI_ZAPPER, SIFC_NONE }, // Gotcha! - The Sport!
{0xbeb8ab01, SI_UNSET, SI_ZAPPER, SIFC_NONE }, // Gumshoe
{0xff24d794, SI_UNSET, SI_ZAPPER, SIFC_NONE }, // Hogan's Alley
{0x21f85681, SI_GAMEPAD, SI_GAMEPAD, SIFC_HYPERSHOT }, // Hyper Olympic (Gentei Ban)
{0x980be936, SI_GAMEPAD, SI_GAMEPAD, SIFC_HYPERSHOT }, // Hyper Olympic
{0x915a53a7, SI_GAMEPAD, SI_GAMEPAD, SIFC_HYPERSHOT }, // Hyper Sports
{0x9fae4d46, SI_GAMEPAD, SI_GAMEPAD, SIFC_MAHJONG }, // Ide Yousuke Meijin no Jissen Mahjong
{0x7b44fb2a, SI_GAMEPAD, SI_GAMEPAD, SIFC_MAHJONG }, // Ide Yousuke Meijin no Jissen Mahjong 2
{0x2f128512, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERA }, // Jogging Race
{0xbb33196f, SI_UNSET, SI_UNSET, SIFC_FKB }, // Keyboard Transformer
{0x8587ee00, SI_UNSET, SI_UNSET, SIFC_FKB }, // Keyboard Transformer
{0x543ab532, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, // LIKO Color Lines
{0x368c19a8, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, // LIKO Study Cartridge
{0x5ee6008e, SI_UNSET, SI_ZAPPER, SIFC_NONE }, // Mechanized Attack
{0x370ceb65, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERB }, // Meiro Dai Sakusen
{0x3a1694f9, SI_GAMEPAD, SI_GAMEPAD, SIFC_4PLAYER }, // Nekketsu Kakutou Densetsu
{0x9d048ea4, SI_GAMEPAD, SI_GAMEPAD, SIFC_OEKAKIDS }, // Oeka Kids
{0x2a6559a1, SI_UNSET, SI_ZAPPER, SIFC_NONE }, // Operation Wolf (J)
{0xedc3662b, SI_UNSET, SI_ZAPPER, SIFC_NONE }, // Operation Wolf
{0x912989dc, SI_UNSET, SI_UNSET, SIFC_FKB }, // Playbox BASIC
{0x9044550e, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERA }, // Rairai Kyonshizu
{0xea90f3e2, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERB }, // Running Stadium
{0x851eb9be, SI_GAMEPAD, SI_ZAPPER, SIFC_NONE }, // Shooting Range
{0x6435c095, SI_GAMEPAD, SI_POWERPADB, SIFC_UNSET }, // Short Order/Eggsplode
{0xc043a8df, SI_UNSET, SI_MOUSE, SIFC_NONE }, // Shu Qi Yu - Shu Xue Xiao Zhuan Yuan (Ch)
{0x2cf5db05, SI_UNSET, SI_MOUSE, SIFC_NONE }, // Shu Qi Yu - Zhi Li Xiao Zhuan Yuan (Ch)
{0xad9c63e2, SI_GAMEPAD, SI_UNSET, SIFC_SHADOW }, // Space Shadow
{0x61d86167, SI_GAMEPAD, SI_POWERPADB, SIFC_UNSET }, // Street Cop
{0xabb2f974, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, // Study and Game 32-in-1
{0x41ef9ac4, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, // Subor
{0x8b265862, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, // Subor
{0x82f1fb96, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, // Subor 1.0 Russian
{0x9f8f200a, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERA }, // Super Mogura Tataki!! - Pokkun Moguraa
{0xd74b2719, SI_GAMEPAD, SI_POWERPADB, SIFC_UNSET }, // Super Team Games
{0x74bea652, SI_GAMEPAD, SI_ZAPPER, SIFC_NONE }, // Supergun 3-in-1
{0x5e073a1b, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, // Supor English (Chinese)
{0x589b6b0d, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, // SuporV20
{0x41401c6d, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, // SuporV40
{0x23d17f5e, SI_GAMEPAD, SI_ZAPPER, SIFC_NONE }, // The Lone Ranger
{0xc3c0811d, SI_GAMEPAD, SI_GAMEPAD, SIFC_OEKAKIDS }, // The two "Oeka Kids" games
{0xde8fd935, SI_UNSET, SI_ZAPPER, SIFC_NONE }, // To the Earth
{0x47232739, SI_GAMEPAD, SI_GAMEPAD, SIFC_TOPRIDER }, // Top Rider
{0x8a12a7d9, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERB }, // Totsugeki Fuuun Takeshi Jou
{0xb8b9aca3, SI_UNSET, SI_ZAPPER, SIFC_NONE }, // Wild Gunman
{0x5112dc21, SI_UNSET, SI_ZAPPER, SIFC_NONE }, // Wild Gunman
{0xaf4010ea, SI_GAMEPAD, SI_POWERPADB, SIFC_UNSET }, // World Class Track Meet
{0x19b0a9f1, SI_GAMEPAD, SI_ZAPPER, SIFC_NONE }, /* 6-in-1 (MGC-023)(Unl)[!] */
{0x29de87af, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERB }, /* Aerobics Studio */
{0xd89e5a67, SI_UNSET, SI_UNSET, SIFC_ARKANOID }, /* Arkanoid (J) */
{0x0f141525, SI_UNSET, SI_UNSET, SIFC_ARKANOID }, /* Arkanoid 2(J) */
{0x32fb0583, SI_UNSET, SI_ARKANOID, SIFC_NONE }, /* Arkanoid(NES) */
{0x60ad090a, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERA }, /* Athletic World */
{0x48ca0ee1, SI_GAMEPAD, SI_GAMEPAD, SIFC_BWORLD }, /* Barcode World */
{0x4318a2f8, SI_UNSET, SI_ZAPPER, SIFC_NONE }, /* Barker Bill's Trick Shooting */
{0x6cca1c1f, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERB }, /* Dai Undoukai */
{0x24598791, SI_UNSET, SI_ZAPPER, SIFC_NONE }, /* Duck Hunt */
{0xd5d6eac4, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, /* Edu (As) */
{0xe9a7fe9e, SI_UNSET, SI_MOUSE, SIFC_NONE }, /* Educational Computer 2000 */
{0x8f7b1669, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, /* FP BASIC 3.3 by maxzhou88 */
{0xf7606810, SI_UNSET, SI_UNSET, SIFC_FKB }, /* Family BASIC 2.0A */
{0x895037bc, SI_UNSET, SI_UNSET, SIFC_FKB }, /* Family BASIC 2.1a */
{0xb2530afc, SI_UNSET, SI_UNSET, SIFC_FKB }, /* Family BASIC 3.0 */
{0xea90f3e2, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERB }, /* Family Trainer: Running Stadium */
{0xbba58be5, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERB }, /* Family Trainer: Manhattan Police */
{0x3e58a87e, SI_UNSET, SI_ZAPPER, SIFC_NONE }, /* Freedom Force */
{0xd9f45be9, SI_GAMEPAD, SI_GAMEPAD, SIFC_QUIZKING }, /* Gimme a Break ... */
{0x1545bd13, SI_GAMEPAD, SI_GAMEPAD, SIFC_QUIZKING }, /* Gimme a Break ... 2 */
{0x4e959173, SI_UNSET, SI_ZAPPER, SIFC_NONE }, /* Gotcha! - The Sport! */
{0xbeb8ab01, SI_UNSET, SI_ZAPPER, SIFC_NONE }, /* Gumshoe */
{0xff24d794, SI_UNSET, SI_ZAPPER, SIFC_NONE }, /* Hogan's Alley */
{0x21f85681, SI_GAMEPAD, SI_GAMEPAD, SIFC_HYPERSHOT }, /* Hyper Olympic (Gentei Ban) */
{0x980be936, SI_GAMEPAD, SI_GAMEPAD, SIFC_HYPERSHOT }, /* Hyper Olympic */
{0x915a53a7, SI_GAMEPAD, SI_GAMEPAD, SIFC_HYPERSHOT }, /* Hyper Sports */
{0x9fae4d46, SI_GAMEPAD, SI_GAMEPAD, SIFC_MAHJONG }, /* Ide Yousuke Meijin no Jissen Mahjong */
{0x7b44fb2a, SI_GAMEPAD, SI_GAMEPAD, SIFC_MAHJONG }, /* Ide Yousuke Meijin no Jissen Mahjong 2 */
{0x2f128512, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERA }, /* Jogging Race */
{0xbb33196f, SI_UNSET, SI_UNSET, SIFC_FKB }, /* Keyboard Transformer */
{0x8587ee00, SI_UNSET, SI_UNSET, SIFC_FKB }, /* Keyboard Transformer */
{0x543ab532, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, /* LIKO Color Lines */
{0x368c19a8, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, /* LIKO Study Cartridge */
{0x5ee6008e, SI_UNSET, SI_ZAPPER, SIFC_NONE }, /* Mechanized Attack */
{0x370ceb65, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERB }, /* Meiro Dai Sakusen */
{0x3a1694f9, SI_GAMEPAD, SI_GAMEPAD, SIFC_4PLAYER }, /* Nekketsu Kakutou Densetsu */
{0x9d048ea4, SI_GAMEPAD, SI_GAMEPAD, SIFC_OEKAKIDS }, /* Oeka Kids */
{0x2a6559a1, SI_UNSET, SI_ZAPPER, SIFC_NONE }, /* Operation Wolf (J) */
{0xedc3662b, SI_UNSET, SI_ZAPPER, SIFC_NONE }, /* Operation Wolf */
{0x912989dc, SI_UNSET, SI_UNSET, SIFC_FKB }, /* Playbox BASIC */
{0x9044550e, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERA }, /* Rairai Kyonshizu */
{0xea90f3e2, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERB }, /* Running Stadium */
{0x851eb9be, SI_GAMEPAD, SI_ZAPPER, SIFC_NONE }, /* Shooting Range */
{0x6435c095, SI_GAMEPAD, SI_POWERPADB, SIFC_UNSET }, /* Short Order/Eggsplode */
{0xc043a8df, SI_UNSET, SI_MOUSE, SIFC_NONE }, /* Shu Qi Yu - Shu Xue Xiao Zhuan Yuan (Ch) */
{0x2cf5db05, SI_UNSET, SI_MOUSE, SIFC_NONE }, /* Shu Qi Yu - Zhi Li Xiao Zhuan Yuan (Ch) */
{0xad9c63e2, SI_GAMEPAD, SI_UNSET, SIFC_SHADOW }, /* Space Shadow */
{0x61d86167, SI_GAMEPAD, SI_POWERPADB, SIFC_UNSET }, /* Street Cop */
{0xabb2f974, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, /* Study and Game 32-in-1 */
{0x41ef9ac4, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, /* Subor */
{0x8b265862, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, /* Subor */
{0x82f1fb96, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, /* Subor 1.0 Russian */
{0x9f8f200a, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERA }, /* Super Mogura Tataki!! - Pokkun Moguraa */
{0xd74b2719, SI_GAMEPAD, SI_POWERPADB, SIFC_UNSET }, /* Super Team Games */
{0x74bea652, SI_GAMEPAD, SI_ZAPPER, SIFC_NONE }, /* Supergun 3-in-1 */
{0x5e073a1b, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, /* Supor English (Chinese) */
{0x589b6b0d, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, /* SuporV20 */
{0x41401c6d, SI_UNSET, SI_UNSET, SIFC_SUBORKB }, /* SuporV40 */
{0x23d17f5e, SI_GAMEPAD, SI_ZAPPER, SIFC_NONE }, /* The Lone Ranger */
{0xc3c0811d, SI_GAMEPAD, SI_GAMEPAD, SIFC_OEKAKIDS }, /* The two "Oeka Kids" games */
{0xde8fd935, SI_UNSET, SI_ZAPPER, SIFC_NONE }, /* To the Earth */
{0x47232739, SI_GAMEPAD, SI_GAMEPAD, SIFC_TOPRIDER }, /* Top Rider */
{0x8a12a7d9, SI_GAMEPAD, SI_GAMEPAD, SIFC_FTRAINERB }, /* Totsugeki Fuuun Takeshi Jou */
{0xb8b9aca3, SI_UNSET, SI_ZAPPER, SIFC_NONE }, /* Wild Gunman */
{0x5112dc21, SI_UNSET, SI_ZAPPER, SIFC_NONE }, /* Wild Gunman */
{0xaf4010ea, SI_GAMEPAD, SI_POWERPADB, SIFC_UNSET }, /* World Class Track Meet */
{0x00000000, SI_UNSET, SI_UNSET, SIFC_UNSET }
};
int x = 0;
@@ -397,7 +397,7 @@ static BMAPPINGLocal bmap[] = {
{(uint8_t*)"MMC5", 5, Mapper5_Init},
{(uint8_t*)"FFE Rev. A", 6, Mapper6_Init},
{(uint8_t*)"ANROM", 7, ANROM_Init},
{(uint8_t*)"", 8, Mapper8_Init}, // Nogaems, it's worthless
{(uint8_t*)"", 8, Mapper8_Init}, /* Nogaems, it's worthless */
{(uint8_t*)"MMC2", 9, Mapper9_Init},
{(uint8_t*)"MMC4", 10, Mapper10_Init},
{(uint8_t*)"Color Dreams", 11, Mapper11_Init},
@@ -407,28 +407,28 @@ static BMAPPINGLocal bmap[] = {
{(uint8_t*)"100-in-1", 15, Mapper15_Init},
{(uint8_t*)"BANDAI 24C02", 16, Mapper16_Init},
{(uint8_t*)"FFE Rev. B", 17, Mapper17_Init},
{(uint8_t*)"JALECO SS880006", 18, Mapper18_Init}, // JF-NNX (EB89018-30007) boards
{(uint8_t*)"JALECO SS880006", 18, Mapper18_Init}, /* JF-NNX (EB89018-30007) boards */
{(uint8_t*)"Namcot 106", 19, Mapper19_Init},
// {(uint8_t*)"", 20, Mapper20_Init},
/* {(uint8_t*)"", 20, Mapper20_Init}, */
{(uint8_t*)"Konami VRC2/VRC4 A", 21, Mapper21_Init},
{(uint8_t*)"Konami VRC2/VRC4 B", 22, Mapper22_Init},
{(uint8_t*)"Konami VRC2/VRC4 C", 23, Mapper23_Init},
{(uint8_t*)"Konami VRC6 Rev. A", 24, Mapper24_Init},
{(uint8_t*)"Konami VRC2/VRC4 D", 25, Mapper25_Init},
{(uint8_t*)"Konami VRC6 Rev. B", 26, Mapper26_Init},
{(uint8_t*)"CC-21 MI HUN CHE", 27, UNLCC21_Init}, // Former dupe for VRC2/VRC4 mapper, redefined with crc to mihunche boards
// {(uint8_t*)"", 28, Mapper28_Init}, // Custom Multidiscrete mapper for PDs
// {(uint8_t*)"", 29, Mapper29_Init},
{(uint8_t*)"CC-21 MI HUN CHE", 27, UNLCC21_Init}, /* Former dupe for VRC2/VRC4 mapper, redefined with crc to mihunche boards */
/* {(uint8_t*)"", 28, Mapper28_Init}, */ /* Custom Multidiscrete mapper for PDs */
/* {(uint8_t*)"", 29, Mapper29_Init}, */
{(uint8_t*)"UNROM 512", 30, UNROM512_Init},
// {(uint8_t*)"", 31, Mapper31_Init},
/* {(uint8_t*)"", 31, Mapper31_Init}, */
{(uint8_t*)"IREM G-101", 32, Mapper32_Init},
{(uint8_t*)"TC0190FMC/TC0350FMR", 33, Mapper33_Init},
{(uint8_t*)"IREM I-IM/BNROM", 34, Mapper34_Init},
{(uint8_t*)"Wario Land 2", 35, UNLSC127_Init},
{(uint8_t*)"TXC Policeman", 36, Mapper36_Init},
{(uint8_t*)"PAL-ZZ SMB/TETRIS/NWC",37, Mapper37_Init},
{(uint8_t*)"Bit Corp.", 38, Mapper38_Init}, // Crime Busters
// {(uint8_t*)"", 39, Mapper39_Init},
{(uint8_t*)"Bit Corp.", 38, Mapper38_Init}, /* Crime Busters */
/* {(uint8_t*)"", 39, Mapper39_Init}, */
{(uint8_t*)"SMB2j FDS", 40, Mapper40_Init},
{(uint8_t*)"CALTRON 6-in-1", 41, Mapper41_Init},
{(uint8_t*)"BIO MIRACLE FDS", 42, Mapper42_Init},
@@ -440,19 +440,19 @@ static BMAPPINGLocal bmap[] = {
{(uint8_t*)"TAITO TCxxx", 48, Mapper48_Init},
{(uint8_t*)"MMC3 BMC PIRATE C", 49, Mapper49_Init},
{(uint8_t*)"SMB2j FDS Rev. A", 50, Mapper50_Init},
{(uint8_t*)"11-in-1 BALL SERIES", 51, Mapper51_Init}, // 1993 year version
{(uint8_t*)"11-in-1 BALL SERIES", 51, Mapper51_Init}, /* 1993 year version */
{(uint8_t*)"MMC3 BMC PIRATE D", 52, Mapper52_Init},
{(uint8_t*)"SUPERVISION 16-in-1", 53, Supervision16_Init},
// {(uint8_t*)"", 54, Mapper54_Init},
// {(uint8_t*)"", 55, Mapper55_Init},
// {(uint8_t*)"", 56, Mapper56_Init},
/* {(uint8_t*)"", 54, Mapper54_Init}, */
/* {(uint8_t*)"", 55, Mapper55_Init}, */
/* {(uint8_t*)"", 56, Mapper56_Init}, */
{(uint8_t*)"SIMBPLE BMC PIRATE A", 57, Mapper57_Init},
{(uint8_t*)"SIMBPLE BMC PIRATE B", 58, BMCGK192_Init},
{(uint8_t*)"", 59, Mapper59_Init}, // Check this out
{(uint8_t*)"", 59, Mapper59_Init}, /* Check this out */
{(uint8_t*)"SIMBPLE BMC PIRATE C", 60, BMCD1038_Init},
{(uint8_t*)"20-in-1 KAISER Rev. A",61, Mapper61_Init},
{(uint8_t*)"700-in-1", 62, Mapper62_Init},
// {(uint8_t*)"", 63, Mapper63_Init},
/* {(uint8_t*)"", 63, Mapper63_Init}, */
{(uint8_t*)"TENGEN RAMBO1", 64, Mapper64_Init},
{(uint8_t*)"IREM-H3001", 65, Mapper65_Init},
{(uint8_t*)"MHROM", 66, MHROM_Init},
@@ -470,37 +470,37 @@ static BMAPPINGLocal bmap[] = {
{(uint8_t*)"Irem 74HC161/32", 78, Mapper78_Init},
{(uint8_t*)"AVE/C&E/TXC BOARD", 79, Mapper79_Init},
{(uint8_t*)"TAITO X1-005 Rev. A", 80, Mapper80_Init},
// {(uint8_t*)"", 81, Mapper81_Init},
/* {(uint8_t*)"", 81, Mapper81_Init}, */
{(uint8_t*)"TAITO X1-017", 82, Mapper82_Init},
{(uint8_t*)"YOKO VRC Rev. B", 83, Mapper83_Init},
// {(uint8_t*)"", 84, Mapper84_Init},
/* {(uint8_t*)"", 84, Mapper84_Init}, */
{(uint8_t*)"KONAMI VRC7", 85, Mapper85_Init},
{(uint8_t*)"JALECO JF-13", 86, Mapper86_Init},
{(uint8_t*)"74*139/74 DISCRETE", 87, Mapper87_Init},
{(uint8_t*)"NAMCO 3433", 88, Mapper88_Init},
{(uint8_t*)"SUNSOFT-3", 89, Mapper89_Init}, // SUNSOFT-2 mapper
{(uint8_t*)"SUNSOFT-3", 89, Mapper89_Init}, /* SUNSOFT-2 mapper */
{(uint8_t*)"HUMMER/JY BOARD", 90, Mapper90_Init},
{(uint8_t*)"EARLY HUMMER/JY BOARD",91, Mapper91_Init},
{(uint8_t*)"JALECO JF-19", 92, Mapper92_Init},
{(uint8_t*)"SUNSOFT-3R", 93, SUNSOFT_UNROM_Init},// SUNSOFT-2 mapper with VRAM, different wiring
{(uint8_t*)"SUNSOFT-3R", 93, SUNSOFT_UNROM_Init},/* SUNSOFT-2 mapper with VRAM, different wiring */
{(uint8_t*)"HVC-UN1ROM", 94, Mapper94_Init},
{(uint8_t*)"NAMCOT 108 Rev. B", 95, Mapper95_Init},
{(uint8_t*)"BANDAI OEKAKIDS", 96, Mapper96_Init},
{(uint8_t*)"IREM TAM-S1", 97, Mapper97_Init},
// {(uint8_t*)"", 98, Mapper98_Init},
/* {(uint8_t*)"", 98, Mapper98_Init}, */
{(uint8_t*)"VS Uni/Dual- system", 99, Mapper99_Init},
// {(uint8_t*)"", 100, Mapper100_Init},
/* {(uint8_t*)"", 100, Mapper100_Init}, */
{(uint8_t*)"", 101, Mapper101_Init},
// {(uint8_t*)"", 102, Mapper102_Init},
/* {(uint8_t*)"", 102, Mapper102_Init}, */
{(uint8_t*)"FDS DOKIDOKI FULL", 103, Mapper103_Init},
{(uint8_t*)"CAMERICA GOLDENFIVE", 104, Mapper104_Init},
{(uint8_t*)"NES-EVENT NWC1990", 105, Mapper105_Init},
{(uint8_t*)"SMB3 PIRATE A", 106, Mapper106_Init},
{(uint8_t*)"MAGIC CORP A", 107, Mapper107_Init},
{(uint8_t*)"FDS UNROM BOARD", 108, Mapper108_Init},
// {(uint8_t*)"", 109, Mapper109_Init},
// {(uint8_t*)"", 110, Mapper110_Init},
// {(uint8_t*)"", 111, Mapper111_Init},
/* {(uint8_t*)"", 109, Mapper109_Init}, */
/* {(uint8_t*)"", 110, Mapper110_Init}, */
/* {(uint8_t*)"", 111, Mapper111_Init}, */
{(uint8_t*)"ASDER/NTDEC BOARD", 112, Mapper112_Init},
{(uint8_t*)"HACKER/SACHEN BOARD", 113, Mapper113_Init},
{(uint8_t*)"MMC3 SG PROT. A", 114, Mapper114_Init},
@@ -511,20 +511,20 @@ static BMAPPINGLocal bmap[] = {
{(uint8_t*)"NES-TQROM", 119, Mapper119_Init},
{(uint8_t*)"FDS TOBIDASE", 120, Mapper120_Init},
{(uint8_t*)"MMC3 PIRATE PROT. A", 121, Mapper121_Init},
// {(uint8_t*)"", 122, Mapper122_Init},
/* {(uint8_t*)"", 122, Mapper122_Init}, */
{(uint8_t*)"MMC3 PIRATE H2288", 123, UNLH2288_Init},
// {(uint8_t*)"", 124, Mapper124_Init},
/* {(uint8_t*)"", 124, Mapper124_Init}, */
{(uint8_t*)"FDS LH32", 125, LH32_Init},
// {(uint8_t*)"", 126, Mapper126_Init},
// {(uint8_t*)"", 127, Mapper127_Init},
// {(uint8_t*)"", 128, Mapper128_Init},
// {(uint8_t*)"", 129, Mapper129_Init},
// {(uint8_t*)"", 130, Mapper130_Init},
// {(uint8_t*)"", 131, Mapper131_Init},
/* {(uint8_t*)"", 126, Mapper126_Init}, */
/* {(uint8_t*)"", 127, Mapper127_Init}, */
/* {(uint8_t*)"", 128, Mapper128_Init}, */
/* {(uint8_t*)"", 129, Mapper129_Init}, */
/* {(uint8_t*)"", 130, Mapper130_Init}, */
/* {(uint8_t*)"", 131, Mapper131_Init}, */
{(uint8_t*)"TXC/MGENIUS 22111", 132, UNL22211_Init},
{(uint8_t*)"SA72008", 133, SA72008_Init},
{(uint8_t*)"MMC3 BMC PIRATE", 134, Mapper134_Init},
// {(uint8_t*)"", 135, Mapper135_Init},
/* {(uint8_t*)"", 135, Mapper135_Init}, */
{(uint8_t*)"TCU02", 136, TCU02_Init},
{(uint8_t*)"S8259D", 137, S8259D_Init},
{(uint8_t*)"S8259B", 138, S8259B_Init},
@@ -542,15 +542,15 @@ static BMAPPINGLocal bmap[] = {
{(uint8_t*)"S74LS374N", 150, S74LS374N_Init},
{(uint8_t*)"", 151, Mapper151_Init},
{(uint8_t*)"", 152, Mapper152_Init},
{(uint8_t*)"BANDAI SRAM", 153, Mapper153_Init}, // Bandai board 16 with SRAM instead of EEPROM
{(uint8_t*)"BANDAI SRAM", 153, Mapper153_Init}, /* Bandai board 16 with SRAM instead of EEPROM */
{(uint8_t*)"", 154, Mapper154_Init},
{(uint8_t*)"", 155, Mapper155_Init},
{(uint8_t*)"", 156, Mapper156_Init},
{(uint8_t*)"BANDAI BARCODE", 157, Mapper157_Init},
{(uint8_t*)"TENGEN 800037", 158, Mapper158_Init},
{(uint8_t*)"BANDAI 24C01", 159, Mapper159_Init}, // Different type of EEPROM on the bandai board
{(uint8_t*)"BANDAI 24C01", 159, Mapper159_Init}, /* Different type of EEPROM on the bandai board */
{(uint8_t*)"SA009", 160, SA009_Init},
// {(uint8_t*)"", 161, Mapper161_Init},
/* {(uint8_t*)"", 161, Mapper161_Init}, */
{(uint8_t*)"", 162, UNLFS304_Init},
{(uint8_t*)"", 163, Mapper163_Init},
{(uint8_t*)"", 164, Mapper164_Init},
@@ -558,20 +558,20 @@ static BMAPPINGLocal bmap[] = {
{(uint8_t*)"SUBOR Rev. A", 166, Mapper166_Init},
{(uint8_t*)"SUBOR Rev. B", 167, Mapper167_Init},
{(uint8_t*)"", 168, Mapper168_Init},
// {(uint8_t*)"", 169, Mapper169_Init},
/* {(uint8_t*)"", 169, Mapper169_Init}, */
{(uint8_t*)"", 170, Mapper170_Init},
{(uint8_t*)"", 171, Mapper171_Init},
{(uint8_t*)"", 172, Mapper172_Init},
{(uint8_t*)"", 173, Mapper173_Init},
// {(uint8_t*)"", 174, Mapper174_Init},
/* {(uint8_t*)"", 174, Mapper174_Init}, */
{(uint8_t*)"", 175, Mapper175_Init},
{(uint8_t*)"BMCFK23C", 176, BMCFK23C_Init}, // zero 26-may-2012 - well, i have some WXN junk games that use 176 for instance ????. i dont know what game uses this BMCFK23C as mapper 176. we'll have to make a note when we find it.
{(uint8_t*)"BMCFK23C", 176, BMCFK23C_Init}, /* zero 26-may-2012 - well, i have some WXN junk games that use 176 for instance ????. i dont know what game uses this BMCFK23C as mapper 176. we'll have to make a note when we find it. */
{(uint8_t*)"", 177, Mapper177_Init},
{(uint8_t*)"", 178, Mapper178_Init},
// {(uint8_t*)"", 179, Mapper179_Init},
/* {(uint8_t*)"", 179, Mapper179_Init}, */
{(uint8_t*)"", 180, Mapper180_Init},
{(uint8_t*)"", 181, Mapper181_Init},
// {(uint8_t*)"", 182, Mapper182_Init}, // Deprecated, dupe
/* {(uint8_t*)"", 182, Mapper182_Init}, */ /* Deprecated, dupe */
{(uint8_t*)"", 183, Mapper183_Init},
{(uint8_t*)"", 184, Mapper184_Init},
{(uint8_t*)"", 185, Mapper185_Init},
@@ -582,7 +582,7 @@ static BMAPPINGLocal bmap[] = {
{(uint8_t*)"", 190, Mapper190_Init},
{(uint8_t*)"", 191, Mapper191_Init},
{(uint8_t*)"TW MMC3+VRAM Rev. B", 192, Mapper192_Init},
{(uint8_t*)"NTDEC TC-112", 193, Mapper193_Init}, // War in the Gulf
{(uint8_t*)"NTDEC TC-112", 193, Mapper193_Init}, /* War in the Gulf */
{(uint8_t*)"TW MMC3+VRAM Rev. C", 194, Mapper194_Init},
{(uint8_t*)"TW MMC3+VRAM Rev. D", 195, Mapper195_Init},
{(uint8_t*)"", 196, Mapper196_Init},
@@ -595,7 +595,7 @@ static BMAPPINGLocal bmap[] = {
{(uint8_t*)"", 203, Mapper203_Init},
{(uint8_t*)"", 204, Mapper204_Init},
{(uint8_t*)"", 205, Mapper205_Init},
{(uint8_t*)"NAMCOT 108 Rev. C", 206, Mapper206_Init}, // Deprecated, Used to be "DEIROM" whatever it means, but actually simple version of MMC3
{(uint8_t*)"NAMCOT 108 Rev. C", 206, Mapper206_Init}, /* Deprecated, Used to be "DEIROM" whatever it means, but actually simple version of MMC3 */
{(uint8_t*)"TAITO X1-005 Rev. B", 207, Mapper207_Init},
{(uint8_t*)"", 208, Mapper208_Init},
{(uint8_t*)"HUMMER/JY BOARD", 209, Mapper209_Init},
@@ -606,14 +606,14 @@ static BMAPPINGLocal bmap[] = {
{(uint8_t*)"", 214, Mapper214_Init},
{(uint8_t*)"", 215, UNL8237_Init},
{(uint8_t*)"", 216, Mapper216_Init},
{(uint8_t*)"", 217, Mapper217_Init}, // Redefined to a new Discrete BMC mapper
// {(uint8_t*)"", 218, Mapper218_Init},
{(uint8_t*)"", 217, Mapper217_Init}, /* Redefined to a new Discrete BMC mapper */
/* {(uint8_t*)"", 218, Mapper218_Init}, */
{(uint8_t*)"UNLA9746", 219, UNLA9746_Init},
{(uint8_t*)"Debug Mapper", 220, UNLKS7057_Init},
{(uint8_t*)"UNLN625092", 221, UNLN625092_Init},
{(uint8_t*)"", 222, Mapper222_Init},
// {(uint8_t*)"", 223, Mapper223_Init},
// {(uint8_t*)"", 224, Mapper224_Init},
/* {(uint8_t*)"", 223, Mapper223_Init}, */
/* {(uint8_t*)"", 224, Mapper224_Init}, */
{(uint8_t*)"", 225, Mapper225_Init},
{(uint8_t*)"BMC 22+20-in-1", 226, Mapper226_Init},
{(uint8_t*)"", 227, Mapper227_Init},
@@ -625,10 +625,10 @@ static BMAPPINGLocal bmap[] = {
{(uint8_t*)"BMC 22+20-in-1 RST", 233, Mapper233_Init},
{(uint8_t*)"BMC MAXI", 234, Mapper234_Init},
{(uint8_t*)"", 235, Mapper235_Init},
// {(uint8_t*)"", 236, Mapper236_Init},
// {(uint8_t*)"", 237, Mapper237_Init},
/* {(uint8_t*)"", 236, Mapper236_Init}, */
/* {(uint8_t*)"", 237, Mapper237_Init}, */
{(uint8_t*)"UNL6035052", 238, UNL6035052_Init},
// {(uint8_t*)"", 239, Mapper239_Init},
/* {(uint8_t*)"", 239, Mapper239_Init}, */
{(uint8_t*)"", 240, Mapper240_Init},
{(uint8_t*)"", 241, Mapper241_Init},
{(uint8_t*)"", 242, Mapper242_Init},
@@ -636,15 +636,15 @@ static BMAPPINGLocal bmap[] = {
{(uint8_t*)"DECATHLON", 244, Mapper244_Init},
{(uint8_t*)"", 245, Mapper245_Init},
{(uint8_t*)"FONG SHEN BANG", 246, Mapper246_Init},
// {(uint8_t*)"", 247, Mapper247_Init},
// {(uint8_t*)"", 248, Mapper248_Init},
/* {(uint8_t*)"", 247, Mapper247_Init}, */
/* {(uint8_t*)"", 248, Mapper248_Init}, */
{(uint8_t*)"", 249, Mapper249_Init},
{(uint8_t*)"", 250, Mapper250_Init},
// {(uint8_t*)"", 251, Mapper251_Init}, // No good dumps for this mapper, use UNIF version
/* {(uint8_t*)"", 251, Mapper251_Init}, */ /* No good dumps for this mapper, use UNIF version */
{(uint8_t*)"SAN GUO ZHI PIRATE", 252, Mapper252_Init},
{(uint8_t*)"DRAGON BALL PIRATE", 253, Mapper253_Init},
{(uint8_t*)"", 254, Mapper254_Init},
// {(uint8_t*)"", 255, Mapper255_Init}, // No good dumps for this mapper
/* {(uint8_t*)"", 255, Mapper255_Init}, */ /* No good dumps for this mapper */
{(uint8_t*)"", 0, NULL}
};
@@ -774,7 +774,7 @@ int iNESLoad(const char *name, FCEUFILE *fp) {
FCEU_VSUniCheck(partialmd5, &MapperNo, &Mirroring);
}
/* Must remain here because above functions might change value of
VROM_size and free(VROM).
* VROM_size and free(VROM).
*/
if (VROM_size)
SetupCartCHRMapping(0, VROM, VROM_size * 0x2000, 0);
@@ -825,9 +825,9 @@ static int iNES_Init(int num) {
while (tmp->init) {
if (num == tmp->number) {
UNIFchrrama = 0; // need here for compatibility with UNIF mapper code
UNIFchrrama = 0; /* need here for compatibility with UNIF mapper code */
if (!VROM_size) {
switch (num) { // FIXME, mapper or game data base with the board parameters and ROM/RAM sizes
switch (num) { /* FIXME, mapper or game data base with the board parameters and ROM/RAM sizes */
case 13: CHRRAMSize = 16 * 1024; break;
case 6:
case 30:

View File

@@ -57,7 +57,7 @@ void Mapper23_Init(CartInfo *);
void Mapper24_Init(CartInfo *);
void Mapper25_Init(CartInfo *);
void Mapper26_Init(CartInfo *);
void UNROM512_Init(CartInfo *); // Mapper #30
void UNROM512_Init(CartInfo *); /* Mapper #30 */
void Mapper32_Init(CartInfo *);
void Mapper33_Init(CartInfo *);
void Mapper34_Init(CartInfo *);

View File

@@ -44,7 +44,7 @@ static uint8 FP_FASTAPASS(2) Read(int w, uint8 ret) {
}
static void FP_FASTAPASS(1) Write(uint8 V) {
//printf("%02x\n",V);
/* printf("%02x\n",V); */
}
static void FP_FASTAPASS(2) Update(void *data, int arg) {

View File

@@ -35,7 +35,7 @@ static uint8 FP_FASTAPASS(2) FT_Read(int w, uint8 ret) {
static void FP_FASTAPASS(1) FT_Write(uint8 V) {
FTValR = 0;
//printf("%08x\n",FTVal);
/* printf("%08x\n",FTVal); */
if (!(V & 0x1))
FTValR = (FTVal >> 8);
else if (!(V & 0x2))

View File

@@ -25,9 +25,9 @@ static uint32 MReal, MRet;
static uint8 FP_FASTAPASS(2) MJ_Read(int w, uint8 ret) {
if (w) {
// ret|=(MRet&1)<<1;
/* ret|=(MRet&1)<<1; */
ret |= ((MRet & 0x80) >> 6) & 2;
// MRet>>=1;
/* MRet>>=1; */
#ifdef FCEUDEF_DEBUGGER
if (!fceuindbg)
#endif
@@ -48,19 +48,19 @@ static void FP_FASTAPASS(1) MJ_Write(uint8 v) {
if (v == 3) {
MRet = (MReal >> 14) & 0x7F;
//MRet=((MRet&0x1F) |((MRet&0x40)>>1)|((MRet&0x20)<<1)) <<1; //(MReal>>13)&0x7F;
/* MRet=((MRet&0x1F) |((MRet&0x40)>>1)|((MRet&0x20)<<1)) <<1; */ /* (MReal>>13)&0x7F; */
} else if (v == 2) {
MRet = MReal & 0xFF;
} else if (v == 1) {
MRet = (MReal >> 8) & 0x3F;
}
// HSValR=HSVal<<1;
/* HSValR=HSVal<<1; */
}
static void FP_FASTAPASS(2) MJ_Update(void *data, int arg) {
MReal = *(uint32*)data;
//printf("%08x\n",MReal>>13);
//HSVal=*(uint8*)data;
/* printf("%08x\n",MReal>>13); */
/* HSVal=*(uint8*)data; */
}
static INPUTCFC Mahjong = { MJ_Read, MJ_Write, 0, MJ_Update, 0, 0 };

View File

@@ -36,7 +36,7 @@ static void FP_FASTAPASS(1) OK_Write(uint8 V) {
if (!(V & 0x1)) {
int32 vx, vy;
//puts("Redo");
/* puts("Redo"); */
OKValR = OKData = 0;
if (OKB) OKData |= 1;
@@ -66,7 +66,7 @@ static void FP_FASTAPASS(1) OK_Write(uint8 V) {
}
static void FP_FASTAPASS(2) OK_Update(void *data, int arg) {
//puts("Sync");
/* puts("Sync"); */
OKX = ((uint32*)data)[0];
OKY = ((uint32*)data)[1];
OKB = ((uint32*)data)[2];

View File

@@ -28,7 +28,7 @@ static uint8 bufit[0x66];
static uint8 kspos, kstrobe;
static uint8 ksindex;
//TODO: check all keys, some of the are wrong
/* TODO: check all keys, some of the are wrong */
static uint16 matrix[13][8] =
{
@@ -79,8 +79,9 @@ static uint8 FP_FASTAPASS(2) PEC586KB_Read(int w, uint8 ret) {
}
static void PEC586KB_Strobe(void) {
// kstrobe = 0;
// ksindex = 0;
/* kstrobe = 0;
ksindex = 0;
*/
}
static void FP_FASTAPASS(2) PEC586KB_Update(void *data, int arg) {

View File

@@ -26,16 +26,18 @@ static uint8 FunkyMode;
static uint8 FP_FASTAPASS(2) QZ_Read(int w, uint8 ret) {
if (w) {
//if(X.PC==0xdc7d) return(0xFF);
//printf("Blah: %04x\n",X.PC);
//FCEUI_DumpMem("dmp2",0xc000,0xffff);
/* if(X.PC==0xdc7d) return(0xFF);
printf("Blah: %04x\n",X.PC);
FCEUI_DumpMem("dmp2",0xc000,0xffff);
*/
ret |= (QZValR & 0x7) << 2;
QZValR = QZValR >> 3;
if (FunkyMode) {
//ret=0x14;
//puts("Funky");
/*ret=0x14;
puts("Funky");
*/
QZValR |= 0x28;
} else {
QZValR |= 0x38;
@@ -46,11 +48,11 @@ static uint8 FP_FASTAPASS(2) QZ_Read(int w, uint8 ret) {
static void QZ_Strobe(void) {
QZValR = QZVal;
//puts("Strobe");
/* puts("Strobe"); */
}
static void FP_FASTAPASS(1) QZ_Write(uint8 V) {
//printf("Wr: %02x\n",V);
/* printf("Wr: %02x\n",V); */
FunkyMode = V & 4;
}

View File

@@ -37,7 +37,7 @@ static void FP_FASTAPASS(3) ZapperFrapper(uint8 * bg, uint8 * spr, uint32 linets
int xs, xe;
int zx, zy;
if (!bg) { // New line, so reset stuff.
if (!bg) { /* New line, so reset stuff. */
ZD.zappo = 0;
return;
}

View File

@@ -38,7 +38,7 @@ static uint16 matrix[13][2][4] =
{ { AK(7), AK(Y), AK(K), AK(M) }, { AK(F4), AK(U), AK(8), AK(J) } },
{ { AK(MINUS), AK(SEMICOLON), AK(APOSTROPHE), AK(SLASH) }, { AK(F6), AK(P), AK(EQUALS), AK(LSHIFT) } },
{ { AK(T), AK(H), AK(N), AK(SPACE) }, { AK(F3), AK(R), AK(6), AK(B) } },
{ { AK(NUMPAD6), AK(GRETURN), AK(NUMPAD4), AK(NUMPAD8) }, { AK(NUMPAD2), 0, 0, 0 } }, // baibaidino actually uses diferent layot
{ { AK(NUMPAD6), AK(GRETURN), AK(NUMPAD4), AK(NUMPAD8) }, { AK(NUMPAD2), 0, 0, 0 } }, /* baibaidino actually uses diferent layout */
{ { AK(LMENU), AK(NUMPAD4), AK(NUMPAD7), AK(F11) }, { AK(F12), AK(NUMPAD1), AK(NUMPAD2), AK(NUMPAD8) } },
{ { AK(SUBTRACT), AK(ADD), AK(MULTIPLY), AK(NUMPAD9) }, { AK(F10), AK(NUMPAD5), AK(DIVIDE), AK(NUMLOCK) } },
{ { AK(GRAVE), AK(NUMPAD6), AK(PAUSE), AK(SPACE) }, { AK(F9), AK(NUMPAD3), AK(DECIMAL), AK(NUMPAD0) } },

View File

@@ -37,7 +37,7 @@ static void FP_FASTAPASS(3) ZapperFrapper(int w, uint8 * bg, uint8 * spr, uint32
int xs, xe;
int zx, zy;
if (!bg) { // New line, so reset stuff.
if (!bg) { /* New line, so reset stuff. */
ZD[w].zappo = 0;
return;
}

View File

@@ -104,17 +104,17 @@ void NSFGI(int h) {
free(ExWRAM); ExWRAM = 0;
}
if (NSFHeader.SoundChip & 1) {
// NSFVRC6_Init();
/* NSFVRC6_Init(); */
} else if (NSFHeader.SoundChip & 2) {
// NSFVRC7_Init();
/* NSFVRC7_Init(); */
} else if (NSFHeader.SoundChip & 4) {
// FDSSoundReset();
/* FDSSoundReset(); */
} else if (NSFHeader.SoundChip & 8) {
NSFMMC5_Close();
} else if (NSFHeader.SoundChip & 0x10) {
// NSFN106_Init();
/* NSFN106_Init(); */
} else if (NSFHeader.SoundChip & 0x20) {
// NSFAY_Init();
/* NSFAY_Init(); */
}
break;
case GI_RESETM2:
@@ -122,7 +122,7 @@ void NSFGI(int h) {
}
}
// First 32KB is reserved for sound chip emulation in the iNES mapper code.
/* First 32KB is reserved for sound chip emulation in the iNES mapper code. */
static INLINE void BANKSET(uint32 A, uint32 bank) {
bank &= NSFMaxBank;

View File

@@ -22,7 +22,7 @@
#define _FCEU_NSF_H
typedef struct {
char ID[5]; // NESM^Z
char ID[5]; /* NESM^Z */
uint8 Version;
uint8 TotalSongs;
uint8 StartingSong;
@@ -35,9 +35,9 @@ typedef struct {
uint8 SongName[32];
uint8 Artist[32];
uint8 Copyright[32];
uint8 NTSCspeed[2]; // Unused
uint8 NTSCspeed[2]; /* Unused */
uint8 BankSwitch[8];
uint8 PALspeed[2]; // Unused
uint8 PALspeed[2]; /* Unused */
uint8 VideoSystem;
uint8 SoundChip;
uint8 Expansion[4];

View File

@@ -322,8 +322,8 @@ case 0x50: JR(!(_P&V_FLAG)); break;
/* BVS */
case 0x70: JR(_P&V_FLAG); break;
//default: printf("Bad %02x at $%04x\n",b1,X.PC);break;
//ifdef moo
/* default: printf("Bad %02x at $%04x\n",b1,X.PC);break; */
/* ifdef moo */
/* Here comes the undocumented instructions block. Note that this implementation
may be "wrong". If so, please tell me.
*/
@@ -485,6 +485,5 @@ case 0xFC: LD_ABX(;);
/* XAA - BIG QUESTION MARK HERE */
case 0x8B: _A|=0xEE; _A&=_X; LD_IM(AND);
//endif
//
/* endif */
#endif

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