]> git.sur5r.net Git - cc65/blob - libsrc/pce/irq.s
60a7e22ba74a5123509de7141586481b3274f999
[cc65] / libsrc / pce / irq.s
1 ;
2 ; IRQ handling (PCE version)
3 ;
4
5         .export         initirq, doneirq, IRQStub
6
7         .import         __INTERRUPTOR_COUNT__, callirq_y
8
9         .include        "pce.inc"
10         .include        "extzp.inc"
11
12 ; ------------------------------------------------------------------------
13 .segment        "ONCE"
14
15 ; a constructor
16 ;
17 initirq:
18         rts
19
20 ; ------------------------------------------------------------------------
21 .code
22
23 ; a destructor
24 ;
25 doneirq:
26         rts
27
28 ; ------------------------------------------------------------------------
29
30 IRQStub:
31         phy
32
33 ; Save the display-source flags (and, release the interrupt).
34 ;
35         ldy     VDC_CTRL
36         sty     vdc_flags
37
38         ldy     #<(__INTERRUPTOR_COUNT__ * 2)
39         beq     @L1
40         phx
41         pha
42
43         jsr     callirq_y
44
45         pla
46         plx
47 @L1:    ply
48         rti