]> git.sur5r.net Git - cc65/blob - libsrc/atari/irq.s
move CHARGEN_RELOC enabling to Makefile.inc
[cc65] / libsrc / atari / irq.s
1 ;
2 ; IRQ handling (ATARI version)
3 ;
4
5         .export         initirq, doneirq
6         .import         callirq
7
8         .include        "atari.inc"
9
10 ; ------------------------------------------------------------------------
11
12 .segment        "INIT"
13
14 initirq:
15         lda     VVBLKI
16         ldx     VVBLKI+1
17         sta     IRQInd+1
18         stx     IRQInd+2
19         lda     #6
20         ldy     #<IRQStub
21         ldx     #>IRQStub
22         jsr     SETVBV
23         rts
24
25 ; ------------------------------------------------------------------------
26
27 .code
28
29 doneirq:
30         lda     #6
31         ldy     IRQInd+1
32         ldx     IRQInd+2
33         jsr     SETVBV
34         rts
35
36 ; ------------------------------------------------------------------------
37
38 .segment        "LOWCODE"
39
40 IRQStub:
41         cld                             ; Just to be sure
42 .ifdef __ATARIXL__
43         pha
44         lda     PORTB
45         pha
46         and     #$fe
47         sta     PORTB                   ; disable ROM  @@@ TODO: update CHARGEN
48 .endif
49         jsr     callirq                 ; Call the functions
50 .ifdef __ATARIXL__
51         pla
52         sta     PORTB
53         pla
54 .endif
55         jmp     IRQInd                  ; Jump to the saved IRQ vector
56
57 ; ------------------------------------------------------------------------
58
59 .data
60
61 IRQInd: jmp     $0000