diff --git a/src/boards/mmc3.cpp b/src/boards/mmc3.cpp index e4f1a9e2..880a607b 100644 --- a/src/boards/mmc3.cpp +++ b/src/boards/mmc3.cpp @@ -1363,3 +1363,30 @@ void TQROM_Init(CartInfo *info) { void HKROM_Init(CartInfo *info) { GenMMC3_Init(info, 512, 512, 1, info->battery); } + +// -------------------------------- iNES 2.0 ---------------------------- + +// ---------------------------- Mapper 406 ------------------------------ + +static DECLFW(M406CMDWrite) { + MMC3_CMDWrite((A & 0xFFFE) | ((A & 2) >> 1), V); +} + +static DECLFW(M406IRQWrite) { + MMC3_IRQWrite((A & 0xFFFE) | ((A & 2) >> 1), V); +} + +static DECLFW(M406Write) { +} + +static void M406_Power(void) { + GenMMC3Power(); + // TODO : FLASH + SetWriteHandler(0x8000, 0xBFFF, M406CMDWrite); + SetWriteHandler(0xC000, 0xFFFF, M406IRQWrite); +} + +void Mapper406_Init(CartInfo *info) { + GenMMC3_Init(info, 512, 256, 0, 0); + info->Power = M406_Power; +} diff --git a/src/boards/n106.cpp b/src/boards/n106.cpp index 76c93405..1d126721 100644 --- a/src/boards/n106.cpp +++ b/src/boards/n106.cpp @@ -157,7 +157,10 @@ static void FixCache(int a, int V) { case 0x02: FreqCache[w] &= ~0x0000FF00; FreqCache[w] |= V << 8; break; case 0x04: FreqCache[w] &= ~0x00030000; FreqCache[w] |= (V & 3) << 16; - LengthCache[w] = (8 - ((V >> 2) & 7)) << 2; +// something wrong here http://www.romhacking.net/forum/index.php?topic=21907.msg306903#msg306903 +// LengthCache[w] = (8 - ((V >> 2) & 7)) << 2; +// fix be like in https://github.com/SourMesen/Mesen/blob/cda0a0bdcb5525480784f4b8c71de6fc7273b570/Core/Namco163Audio.h#L61 + LengthCache[w] = 256 - (V & 0xFC); break; case 0x07: EnvCache[w] = (double)(V & 0xF) * 576716; break; } diff --git a/src/ines-correct.h b/src/ines-correct.h index b47dbf34..e9e0002a 100644 --- a/src/ines-correct.h +++ b/src/ines-correct.h @@ -281,4 +281,6 @@ {0x4d4a0e1b, 260|0x1000,-1}, {0xb6dd2c9d, 260|0x1000,-1}, + {0xb02fcb57, 406|0x1000,-1}, /* Haradius Zero ver 1.2a 2019 */ + {0x00000000, -1, -1} diff --git a/src/ines.cpp b/src/ines.cpp index 5111f481..bac442c0 100644 --- a/src/ines.cpp +++ b/src/ines.cpp @@ -725,6 +725,9 @@ BMAPPINGLocal bmap[] = { {"F-15 MMC3 Based", 259, BMCF15_Init}, {"HP10xx/H20xx Boards", 260, BMCHPxx_Init}, {"810544-CA-1", 261, BMC810544CA1_Init}, + + {"Impact Soft MMC3 Flash Board", 406, Mapper406_Init }, + {"KONAMI QTAi Board", 547, QTAi_Init }, {"", 0, NULL} diff --git a/src/ines.h b/src/ines.h index a32db278..f82f7a86 100644 --- a/src/ines.h +++ b/src/ines.h @@ -267,6 +267,7 @@ void Mapper250_Init(CartInfo *); void Mapper252_Init(CartInfo *); void Mapper253_Init(CartInfo *); void Mapper254_Init(CartInfo *); +void Mapper406_Init(CartInfo *); typedef struct { char *name; diff --git a/src/sound.cpp b/src/sound.cpp index 307b01ce..ac27188f 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -181,6 +181,7 @@ void LogDPCM(int romaddress, int dpcmsize){ for (int dpcmstart = i; dpcmstart < (i + dpcmsize); dpcmstart++) { if(!(cdloggerdata[dpcmstart] & 0x40)) { cdloggerdata[dpcmstart] |= 0x40; + cdloggerdata[dpcmstart] |= (romaddress >> 11) & 0x0c; if(!(cdloggerdata[dpcmstart] & 2)){ datacount++;