Fixed mapper 48 IRQ issues
This commit is contained in:
parent
ada46d8428
commit
f40a802e10
4 changed files with 3180 additions and 3164 deletions
|
@ -32,7 +32,7 @@ void GameDatabase::InitDatabase()
|
|||
continue;
|
||||
}
|
||||
vector<string> values = StringUtilities::Split(lineContent, ',');
|
||||
if(values.size() >= 15) {
|
||||
if(values.size() >= 16) {
|
||||
GameInfo gameInfo{
|
||||
(uint32_t)std::stoll(values[0], nullptr, 16),
|
||||
values[1],
|
||||
|
@ -48,7 +48,8 @@ void GameDatabase::InitDatabase()
|
|||
ToInt<uint32_t>(values[11]) == 0 ? false : true,
|
||||
values[12],
|
||||
values[13],
|
||||
values[14]
|
||||
values[14],
|
||||
values[15]
|
||||
};
|
||||
|
||||
if(gameInfo.MapperID == 65000) {
|
||||
|
@ -147,89 +148,92 @@ void GameDatabase::InitializeInputDevices(string inputType, GameSystem system)
|
|||
|
||||
uint8_t GameDatabase::GetSubMapper(GameInfo &info)
|
||||
{
|
||||
switch(info.MapperID) {
|
||||
case 1:
|
||||
if(info.Board.find("SEROM") != string::npos ||
|
||||
info.Board.find("SHROM") != string::npos ||
|
||||
info.Board.find("SH1ROM") != string::npos) {
|
||||
//SEROM, SHROM, SH1ROM have fixed PRG banking
|
||||
return 5;
|
||||
}
|
||||
break;
|
||||
if(!info.SubmapperID.empty()) {
|
||||
return ToInt<uint8_t>(info.SubmapperID);
|
||||
} else {
|
||||
switch(info.MapperID) {
|
||||
case 1:
|
||||
if(info.Board.find("SEROM") != string::npos ||
|
||||
info.Board.find("SHROM") != string::npos ||
|
||||
info.Board.find("SH1ROM") != string::npos) {
|
||||
//SEROM, SHROM, SH1ROM have fixed PRG banking
|
||||
return 5;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if(info.Board.compare("NES-CNROM") == 0) {
|
||||
//Enable bus conflicts for CNROM games
|
||||
//Fixes "Cybernoid - The Fighting Machine" which requires open bus behavior to work properly
|
||||
return 2;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if(info.Board.compare("ACCLAIM-MC-ACC") == 0) {
|
||||
return 3; //Acclaim MC-ACC (MMC3 clone)
|
||||
} else if(info.Chip.compare("MMC6B") == 0) {
|
||||
return 1; //MMC6 (Star Tropics)
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if(info.Board.compare("NES-CNROM") == 0) {
|
||||
//Enable bus conflicts for CNROM games
|
||||
//Fixes "Cybernoid - The Fighting Machine" which requires open bus behavior to work properly
|
||||
return 2;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if(info.Board.compare("ACCLAIM-MC-ACC") == 0) {
|
||||
return 3; //Acclaim MC-ACC (MMC3 clone)
|
||||
} else if(info.Chip.compare("MMC6B") == 0) {
|
||||
return 1; //MMC6 (Star Tropics)
|
||||
}
|
||||
break;
|
||||
|
||||
case 21:
|
||||
if(info.Pcb.compare("352398") == 0) {
|
||||
return 1; //VRC4a
|
||||
} else if(info.Pcb.compare("352889") == 0) {
|
||||
return 2; //VRC4c
|
||||
}
|
||||
break;
|
||||
case 21:
|
||||
if(info.Pcb.compare("352398") == 0) {
|
||||
return 1; //VRC4a
|
||||
} else if(info.Pcb.compare("352889") == 0) {
|
||||
return 2; //VRC4c
|
||||
}
|
||||
break;
|
||||
|
||||
case 23:
|
||||
if(info.Pcb.compare("352396") == 0) {
|
||||
return 2; //VRC4e
|
||||
} else if(info.Pcb.compare("350603") == 0 || info.Pcb.compare("350636") == 0 || info.Pcb.compare("350926") == 0 || info.Pcb.compare("351179") == 0 || info.Pcb.compare("LROG009-00") == 0) {
|
||||
return 3; //VRC2b
|
||||
}
|
||||
break;
|
||||
case 23:
|
||||
if(info.Pcb.compare("352396") == 0) {
|
||||
return 2; //VRC4e
|
||||
} else if(info.Pcb.compare("350603") == 0 || info.Pcb.compare("350636") == 0 || info.Pcb.compare("350926") == 0 || info.Pcb.compare("351179") == 0 || info.Pcb.compare("LROG009-00") == 0) {
|
||||
return 3; //VRC2b
|
||||
}
|
||||
break;
|
||||
|
||||
case 25:
|
||||
if(info.Pcb.compare("351406") == 0) {
|
||||
return 1; //VRC4b
|
||||
} else if(info.Pcb.compare("352400") == 0) {
|
||||
return 2; //VRC4d
|
||||
} else if(info.Pcb.compare("351948") == 0) {
|
||||
return 3; //VRC2c
|
||||
}
|
||||
break;
|
||||
case 25:
|
||||
if(info.Pcb.compare("351406") == 0) {
|
||||
return 1; //VRC4b
|
||||
} else if(info.Pcb.compare("352400") == 0) {
|
||||
return 2; //VRC4d
|
||||
} else if(info.Pcb.compare("351948") == 0) {
|
||||
return 3; //VRC2c
|
||||
}
|
||||
break;
|
||||
|
||||
case 32:
|
||||
if(info.Board.compare("IREM-G101-B") == 0) {
|
||||
return 1; //Major League
|
||||
}
|
||||
break;
|
||||
case 71:
|
||||
if(info.Board.compare("CAMERICA-BF9097") == 0) {
|
||||
return 1; //Fire Hawk
|
||||
}
|
||||
break;
|
||||
case 78:
|
||||
if(info.Board.compare("IREM-HOLYDIVER") == 0) {
|
||||
return 3; //Holy Diver
|
||||
}
|
||||
break;
|
||||
case 185:
|
||||
if(info.Crc == 0x0F05FF0A) {
|
||||
//Seicross (v2)
|
||||
//Not a real submapper, used to alter behavior specifically for this game
|
||||
//This is equivalent to FCEUX's mapper 181
|
||||
return 16;
|
||||
}
|
||||
break;
|
||||
case 210:
|
||||
if(info.Board.compare("NAMCOT-175") == 0) {
|
||||
return 1; //Namco 175
|
||||
} else if(info.Board.compare("NAMCOT-340") == 0) {
|
||||
return 2; //Namco 340
|
||||
}
|
||||
break;
|
||||
case 32:
|
||||
if(info.Board.compare("IREM-G101-B") == 0) {
|
||||
return 1; //Major League
|
||||
}
|
||||
break;
|
||||
case 71:
|
||||
if(info.Board.compare("CAMERICA-BF9097") == 0) {
|
||||
return 1; //Fire Hawk
|
||||
}
|
||||
break;
|
||||
case 78:
|
||||
if(info.Board.compare("IREM-HOLYDIVER") == 0) {
|
||||
return 3; //Holy Diver
|
||||
}
|
||||
break;
|
||||
case 185:
|
||||
if(info.Crc == 0x0F05FF0A) {
|
||||
//Seicross (v2)
|
||||
//Not a real submapper, used to alter behavior specifically for this game
|
||||
//This is equivalent to FCEUX's mapper 181
|
||||
return 16;
|
||||
}
|
||||
break;
|
||||
case 210:
|
||||
if(info.Board.compare("NAMCOT-175") == 0) {
|
||||
return 1; //Namco 175
|
||||
} else if(info.Board.compare("NAMCOT-340") == 0) {
|
||||
return 2; //Namco 340
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -281,6 +281,7 @@ struct GameInfo
|
|||
string Mirroring;
|
||||
string InputType;
|
||||
string BusConflicts;
|
||||
string SubmapperID;
|
||||
};
|
||||
|
||||
enum class RomFormat
|
||||
|
|
|
@ -7,6 +7,7 @@ class TaitoTc0690 : public MMC3
|
|||
{
|
||||
private:
|
||||
uint8_t _irqDelay;
|
||||
bool _isFlintstones;
|
||||
|
||||
protected:
|
||||
virtual void InitMapper() override
|
||||
|
@ -14,6 +15,10 @@ protected:
|
|||
_irqDelay = 0;
|
||||
SelectPRGPage(2, -2);
|
||||
SelectPRGPage(3, -1);
|
||||
|
||||
//This cart appears to behave differently (maybe not an identical mapper?)
|
||||
//IRQ seems to be triggered at a different timing (approx 100 cpu cycles before regular mapper 48 timings)
|
||||
_isFlintstones = _subMapperID == 255;
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving) override
|
||||
|
@ -25,8 +30,8 @@ protected:
|
|||
virtual void TriggerIrq() override
|
||||
{
|
||||
//"The IRQ seems to trip a little later than it does on MMC3. It looks like about a 4 CPU cycle delay from the normal MMC3 IRQ time."
|
||||
//A value of 5 removes the shaking from The Jetsons
|
||||
_irqDelay = 5;
|
||||
//A value of 6 removes the shaking from The Jetsons
|
||||
_irqDelay = _isFlintstones ? 19 : 6;
|
||||
}
|
||||
|
||||
void ProcessCpuClock() override
|
||||
|
@ -61,9 +66,15 @@ protected:
|
|||
break;
|
||||
|
||||
case 0xC000:
|
||||
_irqReloadValue = (0x100 - value) & 0xFF;
|
||||
//Flintstones expects either $C000 or $C001 to clear the irq flag
|
||||
CPU::ClearIRQSource(IRQSource::External);
|
||||
|
||||
_irqReloadValue = (value ^ 0xFF) + (_isFlintstones ? 0 : 1);
|
||||
break;
|
||||
case 0xC001:
|
||||
//Flintstones expects either $C000 or $C001 to clear the irq flag
|
||||
CPU::ClearIRQSource(IRQSource::External);
|
||||
|
||||
_irqCounter = 0;
|
||||
_irqReload = true;
|
||||
break;
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue