From ebca2248d09c6410cf94a7a6f96a22f8e97b7e32 Mon Sep 17 00:00:00 2001 From: retro-wertz Date: Sun, 15 Oct 2017 02:07:42 +0800 Subject: [PATCH] Start undoing C++ comments --- src/boards/01-222.c | 18 ++-- src/boards/09-034a.c | 2 +- src/boards/108.c | 4 +- src/boards/116.c | 19 ++-- src/boards/121.c | 26 ++--- src/boards/12in1.c | 4 +- src/boards/158B.c | 4 +- src/boards/178.c | 20 ++-- src/boards/185.c | 23 ++--- src/boards/187.c | 2 +- src/boards/189.c | 2 +- src/boards/199.c | 2 +- src/boards/222.c | 16 ++-- src/boards/232.c | 11 ++- src/boards/36.c | 4 +- src/boards/3d-block.c | 10 +- src/boards/411120-c.c | 2 +- src/boards/42.c | 2 +- src/boards/43.c | 19 ++-- src/boards/57.c | 5 +- src/boards/69.c | 4 +- src/boards/71.c | 2 +- src/boards/8157.c | 2 +- src/boards/82.c | 2 +- src/boards/8237.c | 28 +++--- src/boards/830118C.c | 2 +- src/boards/8in1.c | 2 +- src/boards/90.c | 93 +++++++++--------- src/boards/BMW8544.c | 16 ++-- src/boards/KS7012.c | 2 +- src/boards/KS7017.c | 2 +- src/boards/KS7030.c | 14 +-- src/boards/KS7032.c | 4 +- src/boards/__dummy_mapper.c | 13 ++- src/boards/a9746.c | 2 +- src/boards/ac-08.c | 4 +- src/boards/addrlatch.c | 72 +++++++------- src/boards/ax5705.c | 33 ++++--- src/boards/bandai.c | 49 +++++----- src/boards/bb.c | 2 +- src/boards/bmc13in1jy110.c | 4 +- src/boards/bmc70in1.c | 8 +- src/boards/cityfighter.c | 2 +- src/boards/coolboy.c | 66 +++++++------ src/boards/datalatch.c | 114 +++++++++++----------- src/boards/edu2000.c | 4 +- src/boards/famicombox.c | 41 ++++---- src/boards/ghostbusters63in1.c | 4 +- src/boards/h2288.c | 2 +- src/boards/kof97.c | 2 +- src/boards/ks7016.c | 8 +- src/boards/mihunche.c | 4 +- src/boards/mmc1.c | 14 +-- src/boards/mmc3.c | 168 +++++++++++++++++---------------- src/boards/mmc5.c | 47 ++++----- src/boards/n106.c | 8 +- src/boards/onebus.c | 45 ++++----- src/boards/pec-586.c | 20 ++-- src/boards/rt-01.c | 10 +- src/boards/sachen.c | 18 ++-- src/boards/t-227-1.c | 2 +- src/boards/vrc3.c | 6 +- src/boards/vrc6.c | 4 +- src/boards/vrc7.c | 6 +- src/boards/yoko.c | 12 +-- src/input/bworld.c | 2 +- src/input/ftrainer.c | 2 +- src/input/mahjong.c | 12 +-- src/input/oekakids.c | 4 +- src/input/pec586kb.c | 7 +- src/input/quiz.c | 16 ++-- src/input/shadow.c | 2 +- src/input/suborkb.c | 2 +- src/input/zapper.c | 2 +- src/palettes/palettes.h | 12 +-- 75 files changed, 641 insertions(+), 582 deletions(-) diff --git a/src/boards/01-222.c b/src/boards/01-222.c index 64d2c96..ea60589 100644 --- a/src/boards/01-222.c +++ b/src/boards/01-222.c @@ -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) { diff --git a/src/boards/09-034a.c b/src/boards/09-034a.c index 1609a81..fb8cc3f 100644 --- a/src/boards/09-034a.c +++ b/src/boards/09-034a.c @@ -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; diff --git a/src/boards/108.c b/src/boards/108.c index a8eda01..0e437d8 100644 --- a/src/boards/108.c +++ b/src/boards/108.c @@ -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) { diff --git a/src/boards/116.c b/src/boards/116.c index b3efed8..b45d924 100644 --- a/src/boards/116.c +++ b/src/boards/116.c @@ -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; diff --git a/src/boards/121.c b/src/boards/121.c index aa4e5c2..c9b3393 100644 --- a/src/boards/121.c +++ b/src/boards/121.c @@ -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]; } diff --git a/src/boards/12in1.c b/src/boards/12in1.c index add67cc..f6abf08 100644 --- a/src/boards/12in1.c +++ b/src/boards/12in1.c @@ -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 ); diff --git a/src/boards/158B.c b/src/boards/158B.c index e7fd684..b33410c 100644 --- a/src/boards/158B.c +++ b/src/boards/158B.c @@ -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); } diff --git a/src/boards/178.c b/src/boards/178.c index 775fece..64ae5f3 100644 --- a/src/boards/178.c +++ b/src/boards/178.c @@ -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; diff --git a/src/boards/185.c b/src/boards/185.c index 26aaf08..a0b18d1 100644 --- a/src/boards/185.c +++ b/src/boards/185.c @@ -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); diff --git a/src/boards/187.c b/src/boards/187.c index 1507ae9..6231dc4 100644 --- a/src/boards/187.c +++ b/src/boards/187.c @@ -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); diff --git a/src/boards/189.c b/src/boards/189.c index e0b541d..5b5026d 100644 --- a/src/boards/189.c +++ b/src/boards/189.c @@ -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); } diff --git a/src/boards/199.c b/src/boards/199.c index 2a8ad05..f8c9486 100644 --- a/src/boards/199.c +++ b/src/boards/199.c @@ -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; diff --git a/src/boards/222.c b/src/boards/222.c index 9361f43..da3cccb 100644 --- a/src/boards/222.c +++ b/src/boards/222.c @@ -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(); diff --git a/src/boards/232.c b/src/boards/232.c index 86bb0d0..a42a02f 100644 --- a/src/boards/232.c +++ b/src/boards/232.c @@ -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); diff --git a/src/boards/36.c b/src/boards/36.c index f4a3cfd..f342b00 100644 --- a/src/boards/36.c +++ b/src/boards/36.c @@ -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) { diff --git a/src/boards/3d-block.c b/src/boards/3d-block.c index 34b9eda..f8513b4 100644 --- a/src/boards/3d-block.c +++ b/src/boards/3d-block.c @@ -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; diff --git a/src/boards/411120-c.c b/src/boards/411120-c.c index ccc490e..6bc821f 100644 --- a/src/boards/411120-c.c +++ b/src/boards/411120-c.c @@ -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" diff --git a/src/boards/42.c b/src/boards/42.c index 7018dc9..a4e1620 100644 --- a/src/boards/42.c +++ b/src/boards/42.c @@ -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); diff --git a/src/boards/43.c b/src/boards/43.c index 4d7f8e4..f45bb03 100644 --- a/src/boards/43.c +++ b/src/boards/43.c @@ -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 */ } } diff --git a/src/boards/57.c b/src/boards/57.c index 112148e..bb93c37 100644 --- a/src/boards/57.c +++ b/src/boards/57.c @@ -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)); } diff --git a/src/boards/69.c b/src/boards/69.c index 4a2dfb6..26831bc 100644 --- a/src/boards/69.c +++ b/src/boards/69.c @@ -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; diff --git a/src/boards/71.c b/src/boards/71.c index 6a79211..a709a1f 100644 --- a/src/boards/71.c +++ b/src/boards/71.c @@ -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(); diff --git a/src/boards/8157.c b/src/boards/8157.c index 287be08..0d46287 100644 --- a/src/boards/8157.c +++ b/src/boards/8157.c @@ -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); diff --git a/src/boards/82.c b/src/boards/82.c index f810753..ff63e97 100644 --- a/src/boards/82.c +++ b/src/boards/82.c @@ -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); } diff --git a/src/boards/8237.c b/src/boards/8237.c index e67d29c..93b4513 100644 --- a/src/boards/8237.c +++ b/src/boards/8237.c @@ -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)); } } diff --git a/src/boards/830118C.c b/src/boards/830118C.c index f04d9db..ba464d7 100644 --- a/src/boards/830118C.c +++ b/src/boards/830118C.c @@ -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" diff --git a/src/boards/8in1.c b/src/boards/8in1.c index a03d667..554f5e6 100644 --- a/src/boards/8in1.c +++ b/src/boards/8in1.c @@ -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); diff --git a/src/boards/90.c b/src/boards/90.c index c629ab5..1d401f6 100644 --- a/src/boards/90.c +++ b/src/boards/90.c @@ -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(); } diff --git a/src/boards/BMW8544.c b/src/boards/BMW8544.c index 6db8a80..0ace160 100644 --- a/src/boards/BMW8544.c +++ b/src/boards/BMW8544.c @@ -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 euipment 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 isn't used by game itself, so unimplemented here and */ + } /* actually will break the current logic ;) */ } return 0; } diff --git a/src/boards/KS7012.c b/src/boards/KS7012.c index c9de10c..326dc14 100644 --- a/src/boards/KS7012.c +++ b/src/boards/KS7012.c @@ -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; diff --git a/src/boards/KS7017.c b/src/boards/KS7017.c index d0d5c0c..686f3cb 100644 --- a/src/boards/KS7017.c +++ b/src/boards/KS7017.c @@ -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) { diff --git a/src/boards/KS7030.c b/src/boards/KS7030.c index 8e6a592..5c661e5 100644 --- a/src/boards/KS7030.c +++ b/src/boards/KS7030.c @@ -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) { diff --git a/src/boards/KS7032.c b/src/boards/KS7032.c index 743efb4..e732e3d 100644 --- a/src/boards/KS7032.c +++ b/src/boards/KS7032.c @@ -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; diff --git a/src/boards/__dummy_mapper.c b/src/boards/__dummy_mapper.c index 70793ef..2f4e7d9 100644 --- a/src/boards/__dummy_mapper.c +++ b/src/boards/__dummy_mapper.c @@ -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); } diff --git a/src/boards/a9746.c b/src/boards/a9746.c index 321ac8a..b7bea21 100644 --- a/src/boards/a9746.c +++ b/src/boards/a9746.c @@ -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; diff --git a/src/boards/ac-08.c b/src/boards/ac-08.c index 154fe5f..1507c8b 100644 --- a/src/boards/ac-08.c +++ b/src/boards/ac-08.c @@ -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(); } diff --git a/src/boards/addrlatch.c b/src/boards/addrlatch.c index b18ac2d..6c752f2 100644 --- a/src/boards/addrlatch.c +++ b/src/boards/addrlatch.c @@ -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 { diff --git a/src/boards/ax5705.c b/src/boards/ax5705.c index 0484109..d208278 100644 --- a/src/boards/ax5705.c +++ b/src/boards/ax5705.c @@ -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)<=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)<> 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); } diff --git a/src/boards/bandai.c b/src/boards/bandai.c index 856ba9d..79adbd7 100644 --- a/src/boards/bandai.c +++ b/src/boards/bandai.c @@ -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; diff --git a/src/boards/bb.c b/src/boards/bb.c index 53554a5..7f42455 100644 --- a/src/boards/bb.c +++ b/src/boards/bb.c @@ -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(); } diff --git a/src/boards/bmc13in1jy110.c b/src/boards/bmc13in1jy110.c index f419045..36dea97 100644 --- a/src/boards/bmc13in1jy110.c +++ b/src/boards/bmc13in1jy110.c @@ -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: diff --git a/src/boards/bmc70in1.c b/src/boards/bmc70in1.c index 95c3437..3a73568 100644 --- a/src/boards/bmc70in1.c +++ b/src/boards/bmc70in1.c @@ -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); } diff --git a/src/boards/cityfighter.c b/src/boards/cityfighter.c index 0ae4ef9..9064065 100644 --- a/src/boards/cityfighter.c +++ b/src/boards/cityfighter.c @@ -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: diff --git a/src/boards/coolboy.c b/src/boards/coolboy.c index 97f59c5..90413cf 100644 --- a/src/boards/coolboy.c +++ b/src/boards/coolboy.c @@ -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); } diff --git a/src/boards/datalatch.c b/src/boards/datalatch.c index 1fe77fd..c71af0b 100644 --- a/src/boards/datalatch.c +++ b/src/boards/datalatch.c @@ -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; diff --git a/src/boards/edu2000.c b/src/boards/edu2000.c index 36f1ad1..2a66a14 100644 --- a/src/boards/edu2000.c +++ b/src/boards/edu2000.c @@ -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(); } diff --git a/src/boards/famicombox.c b/src/boards/famicombox.c index a47823f..f72916b 100644 --- a/src/boards/famicombox.c +++ b/src/boards/famicombox.c @@ -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) { diff --git a/src/boards/ghostbusters63in1.c b/src/boards/ghostbusters63in1.c index c4ca48a..82568a7 100644 --- a/src/boards/ghostbusters63in1.c +++ b/src/boards/ghostbusters63in1.c @@ -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"); diff --git a/src/boards/h2288.c b/src/boards/h2288.c index 1fb72af..5ac8fa4 100644 --- a/src/boards/h2288.c +++ b/src/boards/h2288.c @@ -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); diff --git a/src/boards/kof97.c b/src/boards/kof97.c index eb6c484..1306b1a 100644 --- a/src/boards/kof97.c +++ b/src/boards/kof97.c @@ -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); } diff --git a/src/boards/ks7016.c b/src/boards/ks7016.c index fc14d7a..c7f5ff8 100644 --- a/src/boards/ks7016.c +++ b/src/boards/ks7016.c @@ -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; } diff --git a/src/boards/mihunche.c b/src/boards/mihunche.c index 512aa0f..6eec579 100644 --- a/src/boards/mihunche.c +++ b/src/boards/mihunche.c @@ -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) { diff --git a/src/boards/mmc1.c b/src/boards/mmc1.c index 0115ad9..0a294b0 100644 --- a/src/boards/mmc1.c +++ b/src/boards/mmc1.c @@ -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); } diff --git a/src/boards/mmc3.c b/src/boards/mmc3.c index 6aa2a4f..d2d3369 100644 --- a/src/boards/mmc3.c +++ b/src/boards/mmc3.c @@ -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); diff --git a/src/boards/mmc5.c b/src/boards/mmc5.c index 7867c3c..2e0998c 100644 --- a/src/boards/mmc5.c +++ b/src/boards/mmc5.c @@ -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); diff --git a/src/boards/n106.c b/src/boards/n106.c index 45805f5..0a5116c 100644 --- a/src/boards/n106.c +++ b/src/boards/n106.c @@ -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; } diff --git a/src/boards/onebus.c b/src/boards/onebus.c index 7cd23d7..7edbd68 100644 --- a/src/boards/onebus.c +++ b/src/boards/onebus.c @@ -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 -// 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. +/* 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; diff --git a/src/boards/pec-586.c b/src/boards/pec-586.c index 0eac60c..fce3883 100644 --- a/src/boards/pec-586.c +++ b/src/boards/pec-586.c @@ -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]; } diff --git a/src/boards/rt-01.c b/src/boards/rt-01.c index ee3e5e5..866bb92 100644 --- a/src/boards/rt-01.c +++ b/src/boards/rt-01.c @@ -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); diff --git a/src/boards/sachen.c b/src/boards/sachen.c index ec7da2c..b236db1 100644 --- a/src/boards/sachen.c +++ b/src/boards/sachen.c @@ -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; diff --git a/src/boards/t-227-1.c b/src/boards/t-227-1.c index ca99b6f..cc13960 100644 --- a/src/boards/t-227-1.c +++ b/src/boards/t-227-1.c @@ -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" diff --git a/src/boards/vrc3.c b/src/boards/vrc3.c index 315cad8..3dae047 100644 --- a/src/boards/vrc3.c +++ b/src/boards/vrc3.c @@ -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); diff --git a/src/boards/vrc6.c b/src/boards/vrc6.c index 79a0bdc..ee7660a 100644 --- a/src/boards/vrc6.c +++ b/src/boards/vrc6.c @@ -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; diff --git a/src/boards/vrc7.c b/src/boards/vrc7.c index 8e2f2c8..5ab7292 100644 --- a/src/boards/vrc7.c +++ b/src/boards/vrc7.c @@ -40,7 +40,7 @@ static SFORMAT StateRegs[] = { 0 } }; -// VRC7 Sound +/* VRC7 Sound */ #include "emu2413.h" @@ -89,7 +89,7 @@ static void VRC7_ESI(void) { OPLL_reset(VRC7Sound); } -// VRC7 Sound +/* VRC7 Sound */ static void Sync(void) { uint8 i; @@ -117,7 +117,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; diff --git a/src/boards/yoko.c b/src/boards/yoko.c index e0fc504..175b1b7 100644 --- a/src/boards/yoko.c +++ b/src/boards/yoko.c @@ -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 truth */ 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); diff --git a/src/input/bworld.c b/src/input/bworld.c index 16e861d..95339be 100644 --- a/src/input/bworld.c +++ b/src/input/bworld.c @@ -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) { diff --git a/src/input/ftrainer.c b/src/input/ftrainer.c index b6c71ac..46bafe6 100644 --- a/src/input/ftrainer.c +++ b/src/input/ftrainer.c @@ -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)) diff --git a/src/input/mahjong.c b/src/input/mahjong.c index 9c4c383..1f9472d 100644 --- a/src/input/mahjong.c +++ b/src/input/mahjong.c @@ -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 }; diff --git a/src/input/oekakids.c b/src/input/oekakids.c index e806f15..19ed512 100644 --- a/src/input/oekakids.c +++ b/src/input/oekakids.c @@ -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]; diff --git a/src/input/pec586kb.c b/src/input/pec586kb.c index 356d837..938bc3e 100644 --- a/src/input/pec586kb.c +++ b/src/input/pec586kb.c @@ -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) { diff --git a/src/input/quiz.c b/src/input/quiz.c index d20305d..6775828 100644 --- a/src/input/quiz.c +++ b/src/input/quiz.c @@ -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; } diff --git a/src/input/shadow.c b/src/input/shadow.c index 3d74402..8f9d767 100644 --- a/src/input/shadow.c +++ b/src/input/shadow.c @@ -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; } diff --git a/src/input/suborkb.c b/src/input/suborkb.c index 2102d55..abf02c7 100644 --- a/src/input/suborkb.c +++ b/src/input/suborkb.c @@ -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) } }, diff --git a/src/input/zapper.c b/src/input/zapper.c index 0553a82..07c6b4b 100644 --- a/src/input/zapper.c +++ b/src/input/zapper.c @@ -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; } diff --git a/src/palettes/palettes.h b/src/palettes/palettes.h index c7ee95d..6bf38be 100644 --- a/src/palettes/palettes.h +++ b/src/palettes/palettes.h @@ -18,12 +18,12 @@ pal rp2c03[64] = { }; pal unvpalette[7] = { - { 0x00 << 2, 0x00 << 2, 0x00 << 2 }, // Black - { 0x3F << 2, 0x3F << 2, 0x34 << 2 }, // White - { 0x00 << 2, 0x00 << 2, 0x00 << 2 }, // Black - { 0x1d << 2, 0x1d << 2, 0x24 << 2 }, // Greyish - { 190, 0, 0 }, // Redish - { 51, 255, 51 }, // Bright green + { 0x00 << 2, 0x00 << 2, 0x00 << 2 }, /* Black */ + { 0x3F << 2, 0x3F << 2, 0x34 << 2 }, /* White */ + { 0x00 << 2, 0x00 << 2, 0x00 << 2 }, /* Black */ + { 0x1d << 2, 0x1d << 2, 0x24 << 2 }, /* Greyish */ + { 190, 0, 0 }, /* Redish */ + { 51, 255, 51 }, /* Bright green */ { 49, 14, 200 }, };