Rev 796 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
716 | lvd | 1 | #pragma once |
2 | |||
3 | Z80INLINE void handle_int(Z80 *cpu, unsigned char vector) |
||
4 | { |
||
5 | unsigned intad; |
||
6 | if (cpu->im < 2) { |
||
7 | intad = 0x38; |
||
8 | } else { // im2 |
||
9 | unsigned vec = vector + cpu->i*0x100; |
||
10 | intad = cpu->MemIf->rm(vec) + 0x100*cpu->MemIf->rm(vec+1); |
||
11 | } |
||
12 | |||
796 | DimkaM | 13 | cpu->last_branch = u16(cpu->pc); |
716 | lvd | 14 | if(cpu->MemIf->rm(cpu->pc) == 0x76) // int on halt command |
15 | cpu->pc++; |
||
16 | |||
17 | cpu->t += (cpu->im < 2) ? 13 : 19; |
||
18 | cpu->MemIf->wm(--cpu->sp, cpu->pch); |
||
19 | cpu->MemIf->wm(--cpu->sp, cpu->pcl); |
||
20 | cpu->pc = intad; |
||
21 | cpu->memptr = intad; |
||
22 | cpu->halted = 0; |
||
23 | cpu->iff1 = cpu->iff2 = 0; |
||
24 | cpu->int_pend = false; |
||
25 | } |