Fixed mapper 48 IRQ issues

This commit is contained in:
Souryo 2017-05-18 22:43:21 -04:00
parent ada46d8428
commit f40a802e10
4 changed files with 3180 additions and 3164 deletions

View file

@ -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,6 +148,9 @@ void GameDatabase::InitializeInputDevices(string inputType, GameSystem system)
uint8_t GameDatabase::GetSubMapper(GameInfo &info)
{
if(!info.SubmapperID.empty()) {
return ToInt<uint8_t>(info.SubmapperID);
} else {
switch(info.MapperID) {
case 1:
if(info.Board.find("SEROM") != string::npos ||
@ -229,7 +233,7 @@ uint8_t GameDatabase::GetSubMapper(GameInfo &info)
}
break;
}
}
return 0;
}

View file

@ -281,6 +281,7 @@ struct GameInfo
string Mirroring;
string InputType;
string BusConflicts;
string SubmapperID;
};
enum class RomFormat

View file

@ -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