UNIF BMC-10-24-C-A1 - new dump 6-in-1 by ClusteR
UNIF COOLBOY - update from hardware tests by ClusteR UNIF OneBus - mirroring fix
This commit is contained in:
parent
5440ad057a
commit
4ec95b5b9b
|
@ -1,7 +1,7 @@
|
||||||
/* FCE Ultra - NES/Famicom Emulator
|
/* FCE Ultra - NES/Famicom Emulator
|
||||||
*
|
*
|
||||||
* Copyright notice for this file:
|
* Copyright notice for this file:
|
||||||
* Copyright (C) 2015 CaH4e3
|
* Copyright (C) 2015 CaH4e3, ClusteR
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -20,67 +20,96 @@
|
||||||
* CoolBoy 400-in-1 FK23C-mimic mapper 16Mb/32Mb PROM + 128K/256K CHR RAM, optional SRAM, optional NTRAM
|
* CoolBoy 400-in-1 FK23C-mimic mapper 16Mb/32Mb PROM + 128K/256K CHR RAM, optional SRAM, optional NTRAM
|
||||||
* only MMC3 mode
|
* only MMC3 mode
|
||||||
*
|
*
|
||||||
* 6000 (õõ76x210) | 0õÑ0
|
* 6000 (xx76x210) | 0xC0
|
||||||
* 6001 (õõõ354õõ)
|
* 6001 (xxx354x)
|
||||||
* 6002 = 0
|
* 6002 = 0
|
||||||
* 6003 = 0
|
* 6003 = 0
|
||||||
|
* 6003 = 0
|
||||||
*
|
*
|
||||||
|
* hardware tested logic, don't try to understand lol
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mapinc.h"
|
#include "mapinc.h"
|
||||||
#include "mmc3.h"
|
#include "mmc3.h"
|
||||||
|
|
||||||
static void COOLBOYCW(uint32 A, uint8 V) {
|
static void COOLBOYCW(uint32 A, uint8 V) {
|
||||||
if(EXPREGS[3] & 0x10)
|
uint32 mask = 0xFF ^ (EXPREGS[0] & 0x80);
|
||||||
setchr8(EXPREGS[2] & 0xF);
|
if (EXPREGS[3] & 0x10) {
|
||||||
else {
|
if (EXPREGS[3] & 0x40) { // Weird mode
|
||||||
uint32 mask = 0xFF;
|
int cbase = (MMC3_cmd & 0x80) << 5;
|
||||||
switch(EXPREGS[0] & 0xC0) {
|
switch (cbase ^ A) { // Don't even try do understand
|
||||||
case 0xC0:
|
case 0x0400:
|
||||||
mask = 0x7F;
|
case 0x0C00: V &= 0x7F; break;
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
setchr1(A, V & mask);
|
setchr8((((EXPREGS[2] & 0x0F) | ((V & 0x80) >> 3)) & (mask >> 3)) | ((((EXPREGS[0] & 0x08) << 4) & ~mask) >> 3));
|
||||||
|
} else {
|
||||||
|
if (EXPREGS[3] & 0x40) { // Weird mode, again
|
||||||
|
int cbase = (MMC3_cmd & 0x80) << 5;
|
||||||
|
switch (cbase ^ A) { // Don't even try do understand
|
||||||
|
case 0x0000: V = DRegBuf[0]; break;
|
||||||
|
case 0x0800: V = DRegBuf[1]; break;
|
||||||
|
case 0x0400:
|
||||||
|
case 0x0C00: V = 0; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setchr1(A, (V & mask) | (((EXPREGS[0] & 0x08) << 4) & (mask ^ 0xff)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void COOLBOYPW(uint32 A, uint8 V) {
|
static void COOLBOYPW(uint32 A, uint8 V) {
|
||||||
uint32 mask = 0x3F;
|
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);
|
uint32 base = ((EXPREGS[0] & 0x07) >> 0) | ((EXPREGS[1] & 0x10) >> 1) | ((EXPREGS[1] & 0x0C) << 2) | ((EXPREGS[0] & 0x30) << 2);
|
||||||
switch(EXPREGS[0] & 0xC0) {
|
|
||||||
case 0x80:
|
// Very weird mode
|
||||||
mask = 0x1F;
|
// Last banks are first in this mode, ignored when MMC3_cmd&0x40
|
||||||
break;
|
if ((EXPREGS[3] & 0x40) && (V >= 0xFE) && !((MMC3_cmd & 0x40) != 0)) {
|
||||||
case 0xC0:
|
switch (A & 0xE000) {
|
||||||
if(EXPREGS[3] & 0x10) {
|
case 0xA000:
|
||||||
mask = 0x01 | (EXPREGS[1] & 2);
|
if ((MMC3_cmd & 0x40) != 0) V = 0;
|
||||||
} else {
|
break;
|
||||||
mask = 0x0F;
|
case 0xC000:
|
||||||
|
if ((MMC3_cmd & 0x40) == 0) V = 0;
|
||||||
|
break;
|
||||||
|
case 0xE000:
|
||||||
|
V = 0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if(EXPREGS[3] & 0x10)
|
|
||||||
setprg8(A, (base << 4) | (V & mask) | ((EXPREGS[3] & (0x0E ^ (EXPREGS[1] & 2))) ));
|
// Regular MMC3 mode, internal ROM size can be up to 2048kb! Minimal is 64kb
|
||||||
else
|
if (!(EXPREGS[3] & 0x10))
|
||||||
setprg8(A, (base << 4) | (V & mask));
|
setprg8(A, (((base << 4) & ~mask)) | (V & mask));
|
||||||
|
else { // NROM mode
|
||||||
|
mask &= 0xF0;
|
||||||
|
uint8 emask;
|
||||||
|
if (!(EXPREGS[1] & 2)) // 4kb mode, 0xC000-0xFFFF is same as 0x8000-0xBFFF
|
||||||
|
emask = EXPREGS[3] & 0x0E;
|
||||||
|
else // 8kb mode, using second-last bank
|
||||||
|
emask = (EXPREGS[3] & 0x0C) | ((A >= 0xC000) ? 2 : 0);
|
||||||
|
emask |= (A >> 13) & 1; // does not depends on MMC3_cmd&0x40
|
||||||
|
setprg8(A, (((base << 4) & ~mask) | (V & mask) | emask));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static DECLFW(COOLBOYWrite) {
|
static DECLFW(COOLBOYWrite) {
|
||||||
if(A001B & 0x80)
|
if(A001B & 0x80)
|
||||||
CartBW(A,V);
|
CartBW(A,V);
|
||||||
else
|
|
||||||
if((EXPREGS[3] & 0x80) == 0) {
|
if((EXPREGS[3] & 0x80) == 0) {
|
||||||
EXPREGS[A & 3] = V;
|
EXPREGS[A & 3] = V;
|
||||||
FixMMC3PRG(MMC3_cmd);
|
FixMMC3PRG(MMC3_cmd);
|
||||||
FixMMC3CHR(MMC3_cmd);
|
FixMMC3CHR(MMC3_cmd);
|
||||||
uint32 base = ((EXPREGS[0] & 0x07) >> 0) | ((EXPREGS[1] & 0x10) >> 1) | ((EXPREGS[1] & 0x0C) << 2) | ((EXPREGS[0] & 0x30) << 2);
|
}
|
||||||
FCEU_printf("exp %02x %02x (base %03d)\n",A,V,base);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void COOLBOYReset(void) {
|
static void COOLBOYReset(void) {
|
||||||
MMC3RegReset();
|
MMC3RegReset();
|
||||||
EXPREGS[0] = EXPREGS[1] = EXPREGS[2] = EXPREGS[3] = 0;
|
EXPREGS[0] = EXPREGS[1] = EXPREGS[2] = EXPREGS[3] = 0;
|
||||||
|
// EXPREGS[0] = 0;
|
||||||
|
// EXPREGS[1] = 0x60;
|
||||||
|
// EXPREGS[2] = 0;
|
||||||
|
// EXPREGS[3] = 0;
|
||||||
FixMMC3PRG(MMC3_cmd);
|
FixMMC3PRG(MMC3_cmd);
|
||||||
FixMMC3CHR(MMC3_cmd);
|
FixMMC3CHR(MMC3_cmd);
|
||||||
}
|
}
|
||||||
|
@ -88,6 +117,10 @@ static void COOLBOYReset(void) {
|
||||||
static void COOLBOYPower(void) {
|
static void COOLBOYPower(void) {
|
||||||
GenMMC3Power();
|
GenMMC3Power();
|
||||||
EXPREGS[0] = EXPREGS[1] = EXPREGS[2] = EXPREGS[3] = 0;
|
EXPREGS[0] = EXPREGS[1] = EXPREGS[2] = EXPREGS[3] = 0;
|
||||||
|
// EXPREGS[0] = 0;
|
||||||
|
// EXPREGS[1] = 0x60;
|
||||||
|
// EXPREGS[2] = 0;
|
||||||
|
// EXPREGS[3] = 0;
|
||||||
FixMMC3PRG(MMC3_cmd);
|
FixMMC3PRG(MMC3_cmd);
|
||||||
FixMMC3CHR(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
|
||||||
|
@ -95,11 +128,10 @@ static void COOLBOYPower(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void COOLBOY_Init(CartInfo *info) {
|
void COOLBOY_Init(CartInfo *info) {
|
||||||
GenMMC3_Init(info, 512, 128, 8, 0);
|
GenMMC3_Init(info, 512, 256, 8, 0);
|
||||||
pwrap = COOLBOYPW;
|
pwrap = COOLBOYPW;
|
||||||
cwrap = COOLBOYCW;
|
cwrap = COOLBOYCW;
|
||||||
info->Power = COOLBOYPower;
|
info->Power = COOLBOYPower;
|
||||||
info->Reset = COOLBOYReset;
|
info->Reset = COOLBOYReset;
|
||||||
AddExState(EXPREGS, 4, 0, "EXPR");
|
AddExState(EXPREGS, 4, 0, "EXPR");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ static void CSync(void) {
|
||||||
setchr1(0x1800 ^ cswap, block | (bank6 & mask));
|
setchr1(0x1800 ^ cswap, block | (bank6 & mask));
|
||||||
setchr1(0x1c00 ^ cswap, block | (bank7 & mask));
|
setchr1(0x1c00 ^ cswap, block | (bank7 & mask));
|
||||||
|
|
||||||
setmirror(mirror & 1);
|
setmirror((mirror ^ 1) & 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Sync(void) {
|
static void Sync(void) {
|
||||||
|
@ -158,7 +158,7 @@ static DECLFW(UNLOneBusWriteMMC3) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0xa000: mirror = V ^ 1; CSync(); break;
|
case 0xa000: mirror = V; CSync(); break;
|
||||||
case 0xc000: IRQLatch = V & 0xfe; break;
|
case 0xc000: IRQLatch = V & 0xfe; break;
|
||||||
case 0xc001: IRQReload = 1; break;
|
case 0xc001: IRQReload = 1; break;
|
||||||
case 0xe000: X6502_IRQEnd(FCEU_IQEXT); IRQa = 0; break;
|
case 0xe000: X6502_IRQEnd(FCEU_IQEXT); IRQa = 0; break;
|
||||||
|
|
|
@ -344,6 +344,7 @@ static BMAPPING bmap[] = {
|
||||||
{ "BS-5", BMCBS5_Init, 0 },
|
{ "BS-5", BMCBS5_Init, 0 },
|
||||||
{ "CC-21", UNLCC21_Init, 0 },
|
{ "CC-21", UNLCC21_Init, 0 },
|
||||||
{ "CITYFIGHT", UNLCITYFIGHT_Init, 0 },
|
{ "CITYFIGHT", UNLCITYFIGHT_Init, 0 },
|
||||||
|
{ "10-24-C-A1", BMC1024CA1_Init, 0 },
|
||||||
{ "CNROM", CNROM_Init, 0 },
|
{ "CNROM", CNROM_Init, 0 },
|
||||||
{ "CPROM", CPROM_Init, BMCFLAG_16KCHRR },
|
{ "CPROM", CPROM_Init, BMCFLAG_16KCHRR },
|
||||||
{ "D1038", BMCD1038_Init, 0 },
|
{ "D1038", BMCD1038_Init, 0 },
|
||||||
|
|
|
@ -43,6 +43,7 @@ void BMCGhostbusters63in1_Init(CartInfo *info);
|
||||||
void BMCNTD03_Init(CartInfo *info);
|
void BMCNTD03_Init(CartInfo *info);
|
||||||
void BMCT2271_Init(CartInfo *info);
|
void BMCT2271_Init(CartInfo *info);
|
||||||
void BMCT262_Init(CartInfo *info);
|
void BMCT262_Init(CartInfo *info);
|
||||||
|
void BMC1024CA1_Init(CartInfo *info);
|
||||||
void CNROM_Init(CartInfo *info);
|
void CNROM_Init(CartInfo *info);
|
||||||
void CPROM_Init(CartInfo *info);
|
void CPROM_Init(CartInfo *info);
|
||||||
void DreamTech01_Init(CartInfo *info);
|
void DreamTech01_Init(CartInfo *info);
|
||||||
|
|
|
@ -315,6 +315,7 @@
|
||||||
<ClCompile Include="..\src\boards\cityfighter.cpp" />
|
<ClCompile Include="..\src\boards\cityfighter.cpp" />
|
||||||
<ClCompile Include="..\src\boards\coolboy.cpp" />
|
<ClCompile Include="..\src\boards\coolboy.cpp" />
|
||||||
<ClCompile Include="..\src\boards\dance2000.cpp" />
|
<ClCompile Include="..\src\boards\dance2000.cpp" />
|
||||||
|
<ClCompile Include="..\src\boards\et-100.cpp" />
|
||||||
<ClCompile Include="..\src\boards\famicombox.cpp" />
|
<ClCompile Include="..\src\boards\famicombox.cpp" />
|
||||||
<ClCompile Include="..\src\boards\ffe.cpp" />
|
<ClCompile Include="..\src\boards\ffe.cpp" />
|
||||||
<ClCompile Include="..\src\boards\ks7010.cpp" />
|
<ClCompile Include="..\src\boards\ks7010.cpp" />
|
||||||
|
|
|
@ -1054,6 +1054,9 @@
|
||||||
<ClCompile Include="..\src\boards\BMW8544.cpp">
|
<ClCompile Include="..\src\boards\BMW8544.cpp">
|
||||||
<Filter>boards</Filter>
|
<Filter>boards</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\src\boards\et-100.cpp">
|
||||||
|
<Filter>boards</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\src\drivers\common\args.h">
|
<ClInclude Include="..\src\drivers\common\args.h">
|
||||||
|
|
Loading…
Reference in New Issue