add ability for CNROM games to choose whether they have bus conflicts (fixes Colorful Dragon (Unl) (Sachen), since it flakes out if bus conflicts are emulated)

This commit is contained in:
zeromus 2012-06-24 17:28:52 +00:00
parent dfc148cfb4
commit f121662ad9
4 changed files with 19 additions and 6 deletions

View File

@ -174,7 +174,7 @@ static void Sync(void)
static DECLFW(UNLSL12ModeWrite)
{
// FCEU_printf("%04X:%02X\n",A,V);
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
@ -194,7 +194,11 @@ static DECLFW(UNLSL12ModeWrite)
static DECLFW(UNLSL12Write)
{
// FCEU_printf("%04X:%02X\n",A,V);
printf("%04X:%02X\n",A,V);
if(A==0xA123)
{
int zzz=9;
}
switch(mode & 3) {
case 0: {
if((A>=0xB000)&&(A<=0xE003))

View File

@ -19,6 +19,7 @@
*/
#include "mapinc.h"
#include "ines.h"
static uint8 latche, latcheinit, bus_conflict;
static uint16 addrreg0, addrreg1;
@ -133,7 +134,8 @@ static void CNROMSync(void)
void CNROM_Init(CartInfo *info)
{
Latch_Init(info, CNROMSync, 0, 0x8000, 0xFFFF, 1, 1);
bool busc = MasterRomInfoParams.ContainsKey("busc");
Latch_Init(info, CNROMSync, 0, 0x8000, 0xFFFF, 1, busc?1:0);
}
//------------------ ANROM ---------------------------

View File

@ -311,9 +311,10 @@ static const TMasterRomInfo sMasterRomInfo[] = {
{ 0x8bb48490d8d22711LL, "bonus=0" }, //4-in-1 (FK23C8033)[p1][!].nes
{ 0xc75888d7b48cd378LL, "bonus=0" }, //4-in-1 (FK23C8043)[p1][!].nes
{ 0xf81a376fa54fdd69LL, "bonus=0" }, //4-in-1 (FK23Cxxxx, S-0210A PCB)[p1][!].nes
{ 0x164eea6097a1e313LL, "busc=1" }, //Cybernoid - The Fighting Machine (U)[!].nes -- needs bus conflict emulation
};
const TMasterRomInfo* MasterRomInfo;
std::map<std::string,std::string> MasterRomInfoParams;
TMasterRomInfoParams MasterRomInfoParams;
static void CheckHInfo(void)
{
@ -393,7 +394,7 @@ static void CheckHInfo(void)
CheckBad(partialmd5);
MasterRomInfo = NULL;
MasterRomInfoParams = std::map<std::string,std::string>();
MasterRomInfoParams = TMasterRomInfoParams();
for(int i=0;i<ARRAY_SIZE(sMasterRomInfo);i++)
{
const TMasterRomInfo& info = sMasterRomInfo[i];

View File

@ -74,6 +74,12 @@ struct TMasterRomInfo
uint64 md5lower;
const char* params;
};
class TMasterRomInfoParams : public std::map<std::string,std::string>
{
public:
bool ContainsKey(const std::string& key) { return find(key) != end(); }
};
//mbg merge 6/29/06
extern uint8 *ROM;
@ -84,7 +90,7 @@ extern int iNesSave(); //bbit Edited: line added
extern int iNesSaveAs(char* name);
extern char LoadedRomFName[2048]; //bbit Edited: line added
extern const TMasterRomInfo* MasterRomInfo;
extern std::map<std::string,std::string> MasterRomInfoParams;
extern TMasterRomInfoParams MasterRomInfoParams;
//mbg merge 7/19/06 changed to c++ decl format
struct iNES_HEADER {