Added some IRQ-related code (commented out for now) from MAME findings. May incorporate in the future when investigating IRQs and timing again.

This commit is contained in:
Bart Trzynadlowski 2016-05-10 03:08:03 +00:00
parent 34c81eabee
commit 8c082abab9
2 changed files with 19 additions and 1 deletions

View file

@ -813,8 +813,18 @@ void CModel3::WriteSystemRegister(unsigned reg, UINT8 data)
DebugLog("IRQ ENABLE=%02X\n", data);
break;
case 0x18: // IRQ acknowledge
DebugLog("IRQ SETTING! %02X=%02X\n", reg, data);
{
// MAME: Clear bits are ack. Reverse order from other IRQ regs.
//uint8_t ack = 0;
//for (int bit = 0; bit < 8; bit++)
//{
// if (!(data & (1 << bit)))
// ack |= (1 << (7-bit));
//}
//IRQ.Deassert(ack);
DebugLog("IRQ ACK? %02X=%02X\n", reg, data);
break;
}
case 0x0C: // JTAG Test Access Port
GPU.WriteTAP((data>>6)&1,(data>>2)&1,(data>>5)&1,(data>>7)&1); // TCK, TMS, TDI, TRST
break;
@ -2116,6 +2126,12 @@ void CModel3::RunMainBoardFrame(void)
// Run the PowerPC for the active display part of the frame
ppc_execute(dispCycles);
// MAME believes 0x0C should occur on every scanline
//for (int i = 0; i < 384; i++)
//{
// ppc_execute(dispCycles / 384);
// IRQ.Assert(0x0C);
//}
//printf("PC=%08X LR=%08X\n", ppc_get_pc(), ppc_get_lr());
timings.ppcTicks = CThread::GetTicks() - start;

View file

@ -396,6 +396,8 @@ void CTileGen::WriteRegister(unsigned reg, UINT32 data)
break;
case 0x10: // IRQ acknowledge
IRQ->Deassert(data&0xFF);
// MAME believes only lower 4 bits should be cleared
//IRQ->Deassert(data & 0x0F);
break;
default:
DebugLog("Tile Generator reg %02X = %08X\n", reg, data);