|
|
| version 1.1, 2004/08/01 05:31:32 | version 1.5, 2004/08/11 13:53:54 |
|---|---|
| Line 11 | Line 11 |
| #include "parts.h" | #include "parts.h" |
| #include "z80core.h" | #include "z80core.h" |
| #include "z80c.h" | #include "z80c.h" |
| #include "x1_io.h" | |
| #include "z80c.mcr" | #include "z80c.mcr" |
| Line 149 void CPUCALL z80c_interrupt(REG8 vect) { | Line 148 void CPUCALL z80c_interrupt(REG8 vect) { |
| case 1: | case 1: |
| Z80_COUNT(11); | Z80_COUNT(11); |
| R_Z80SP -= 2; | R_Z80SP -= 2; |
| Z80_WRMEM_W(R_Z80SP, R_Z80PC); | mem_write16(R_Z80SP, R_Z80PC); |
| R_Z80PC = 0x38; | R_Z80PC = 0x38; |
| break; | break; |
| case 2: | case 2: |
| pc = Z80_RDMEM_W((R_Z80I << 8) + vect); | pc = mem_read16((R_Z80I << 8) + vect); |
| R_Z80SP -= 2; | R_Z80SP -= 2; |
| Z80_WRMEM_W(R_Z80SP, R_Z80PC); | mem_write16(R_Z80SP, R_Z80PC); |
| R_Z80PC = pc; | |
| break; | |
| } | |
| } | |
| void CPUCALL z80c_interrupt2(REG8 vect) { | |
| REG16 pc; | |
| if (Z80_IFF & (1 << IFF_HALT)) { | |
| Z80_IFF ^= (1 << IFF_HALT); | |
| R_Z80PC++; | |
| } | |
| Z80_IFF |= (1 << IFF_IFLAG); | |
| switch(R_Z80IM) { | |
| case 0: | |
| if ((vect != 0xdd) && (vect != 0xed) && (vect != 0xfd)) { | |
| Z80_COUNT(cycles_main[vect]); | |
| z80c_mainop[vect](); | |
| } | |
| break; | |
| case 1: | |
| Z80_COUNT(11); | |
| R_Z80SP -= 2; | |
| Z80_WRMEM_W(R_Z80SP, R_Z80PC); | |
| R_Z80PC = 0x38; | |
| break; | |
| case 2: | |
| pc = Z80_RDMEM_W((R_Z80I << 8) + vect); | |
| R_Z80SP -= 2; | |
| Z80_WRMEM_W(R_Z80SP, R_Z80PC); | |
| R_Z80PC = pc; | R_Z80PC = pc; |
| break; | break; |
| } | } |
| Line 204 void CPUCALL z80c_nonmaskedinterrupt(voi | Line 170 void CPUCALL z80c_nonmaskedinterrupt(voi |
| R_Z80PC++; | R_Z80PC++; |
| } | } |
| R_Z80SP -= 2; | R_Z80SP -= 2; |
| Z80_WRMEM_W(R_Z80SP, R_Z80PC); | mem_write16(R_Z80SP, R_Z80PC); |
| R_Z80PC = 0x66; | R_Z80PC = 0x66; |
| } | } |
| } | } |
| Line 213 void CPUCALL z80c_execute(void) { | Line 179 void CPUCALL z80c_execute(void) { |
| UINT op; | UINT op; |
| R_Z80R++; | do { |
| GET_PC_BYTE(op); | R_Z80R++; |
| Z80_COUNT(cycles_main[op]); | GET_PC_BYTE(op); |
| z80c_mainop[op](); | Z80_COUNT(cycles_main[op]); |
| z80c_mainop[op](); | |
| z80dmap(); | |
| } while(CPU_REMCLOCK > 0); | |
| } | |
| void CPUCALL z80c_step(void) { | |
| UINT op; | |
| R_Z80R++; | R_Z80R++; |
| GET_PC_BYTE(op); | GET_PC_BYTE(op); |
| Z80_COUNT(cycles_main[op]); | Z80_COUNT(cycles_main[op]); |
| z80c_mainop[op](); | z80c_mainop[op](); |
| z80dmap(); | |
| } | } |