define ENABLE_NMI_SUPPORT // Not used - so don't enable
| 399 | |
| 400 | //#define ENABLE_NMI_SUPPORT // Not used - so don't enable |
| 401 | static __forceinline bool NMI(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz) |
| 402 | { |
| 403 | #ifdef ENABLE_NMI_SUPPORT |
| 404 | if (!g_bNmiFlank) |
| 405 | return false; |
| 406 | |
| 407 | // NMI signals are only serviced once |
| 408 | g_bNmiFlank = FALSE; |
| 409 | #ifdef _DEBUG |
| 410 | g_nCycleIrqStart = g_nCumulativeCycles + uExecutedCycles; |
| 411 | #endif |
| 412 | if (GetIsMemCacheValid()) |
| 413 | { |
| 414 | _PUSH(regs.pc >> 8) |
| 415 | _PUSH(regs.pc & 0xFF) |
| 416 | EF_TO_AF |
| 417 | _PUSH(regs.ps & ~AF_BREAK) |
| 418 | regs.ps |= AF_INTERRUPT; |
| 419 | if (GetMainCpu() == CPU_65C02) // GH#1099 |
| 420 | regs.ps &= ~AF_DECIMAL; |
| 421 | regs.pc = *(WORD*)(mem + _6502_NMI_VECTOR); |
| 422 | } |
| 423 | else |
| 424 | { |
| 425 | _PUSH_ALT(regs.pc >> 8) |
| 426 | _PUSH_ALT(regs.pc & 0xFF) |
| 427 | EF_TO_AF |
| 428 | _PUSH_ALT(regs.ps & ~AF_BREAK) |
| 429 | regs.ps |= AF_INTERRUPT; |
| 430 | if (GetMainCpu() == CPU_65C02) // GH#1099 |
| 431 | regs.ps &= ~AF_DECIMAL; |
| 432 | regs.pc = READ_WORD_ALT(_6502_NMI_VECTOR); |
| 433 | } |
| 434 | UINT uExtraCycles = 0; // Needed for CYC(a) macro |
| 435 | CYC(7); |
| 436 | g_interruptInLastExecutionBatch = true; |
| 437 | return true; |
| 438 | #else |
| 439 | return false; |
| 440 | #endif |
| 441 | } |
| 442 | |
| 443 | static __forceinline void CheckSynchronousInterruptSources(UINT cycles, ULONG uExecutedCycles) |
| 444 | { |
no test coverage detected