trunk/src/emu/cpu/spc700/spc700.c
| r26255 | r26256 | |
| 480 | 480 | ((!FLAG_Z) << 1) | \ |
| 481 | 481 | CFLAG_AS_1()) |
| 482 | 482 | |
| 483 | | /* Get Processor Status Register with B flag set (when executing BRK instruction) */ |
| 484 | | #define GET_REG_P_BRK() \ |
| 485 | | ((FLAG_N & 0x80) | \ |
| 486 | | ((FLAG_V & 0x80) >> 1) | \ |
| 487 | | (FLAG_P>>3) | \ |
| 488 | | FLAGPOS_B | \ |
| 489 | | (FLAG_H & HFLAG_SET) | \ |
| 490 | | FLAG_I | \ |
| 491 | | ((!FLAG_Z) << 1) | \ |
| 492 | | CFLAG_AS_1()) |
| 493 | | |
| 494 | | /* Get Processor Status Register with B flag cleared (when servicing an interrupt) */ |
| 495 | | #define GET_REG_P_INT() \ |
| 496 | | ((FLAG_N & 0x80) | \ |
| 497 | | ((FLAG_V & 0x80) >> 1) | \ |
| 498 | | (FLAG_P>>3) | \ |
| 499 | | (FLAG_H & HFLAG_SET) | \ |
| 500 | | FLAG_I | \ |
| 501 | | ((!FLAG_Z) << 1) | \ |
| 502 | | CFLAG_AS_1()) |
| 503 | | |
| 504 | 483 | INLINE void SET_FLAG_I(spc700i_cpu *cpustate, uint value); |
| 505 | 484 | |
| 506 | 485 | /* Set the Process Status Register */ |
| r26255 | r26256 | |
| 700 | 679 | #define OP_BRK(BCLK) \ |
| 701 | 680 | CLK(BCLK); \ |
| 702 | 681 | PUSH_16(cpustate, REG_PC); \ |
| 703 | | PUSH_8(cpustate, GET_REG_P_BRK()); \ |
| 682 | PUSH_8(cpustate, GET_REG_P()); \ |
| 704 | 683 | FLAG_B |= FLAGPOS_B; \ |
| 705 | 684 | FLAG_I = IFLAG_CLEAR; \ |
| 706 | 685 | JUMP(cpustate, read_16_VEC(VECTOR_BRK)) |
| r26255 | r26256 | |
| 1328 | 1307 | LINE_NMI = 1; |
| 1329 | 1308 | CLK(7); |
| 1330 | 1309 | PUSH_16(cpustate, REG_PC); |
| 1331 | | PUSH_8(cpustate, GET_REG_P_INT()); |
| 1310 | PUSH_8(cpustate, GET_REG_P()); |
| 1332 | 1311 | JUMP(cpustate, read_16_VEC(VECTOR_NMI)); |
| 1333 | 1312 | } |
| 1334 | 1313 | #endif /* SPC700_OPTIMIZE_SNES */ |