/[projet1]/public/oric/demos/OricTech/code/irq.s
Defence Force logotype

Contents of /public/oric/demos/OricTech/code/irq.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1283 - (show annotations)
Sun May 31 12:03:16 2015 UTC (4 years, 5 months ago) by dbug
File size: 1937 byte(s)
Added the source code (as is) for the OricTech VIP 2015 demo.
1
2
3 #define via_portb $0300
4 #define via_t1cl $0304
5 #define via_t1ch $0305
6 #define via_t1ll $0306
7 #define via_t1lh $0307
8 #define via_t2ll $0308
9 #define via_t2ch $0309
10 #define via_sr $030A
11 #define via_acr $030b
12 #define via_pcr $030c
13 #define via_ifr $030D
14 #define via_ier $030E
15 #define via_porta $030f
16
17
18 .zero
19
20 _VblCounter .dsb 1
21 vsync_save_a .dsb 1
22
23 .text
24
25 _System_InstallIRQ_SimpleVbl
26 .(
27 sei
28 // Set the VIA parameters
29 lda #<19966 ; 20000
30 sta $306
31 lda #>19966 ; 20000
32 sta $307
33
34 lda #0
35 sta _VblCounter
36
37 ; Install interrupt (this works only if overlay ram is accessible)
38 lda $FFFE
39 sta _auto_restore_irq_low+1
40 lda #<_50Hz_InterruptHandler
41 sta $FFFE
42
43 lda $FFFF
44 sta _auto_restore_irq_high+1
45 lda #>_50Hz_InterruptHandler
46 sta $FFFF
47
48 cli
49 rts
50 .)
51
52 _System_RestoreIRQ
53 .(
54 +_auto_restore_irq_low
55 lda #$00
56 sta $FFFE
57 +_auto_restore_irq_high
58 lda #$00
59 sta $FFFF
60 rts
61 .)
62
63
64 _VSync
65 sta vsync_save_a
66 lda _VblCounter
67 beq _VSync
68 lda #0
69 sta _VblCounter
70 _DoNothing
71 lda vsync_save_a
72 rts
73
74
75 _50Hz_InterruptHandler
76 bit $304
77 inc _VblCounter
78
79 pha
80 txa
81 pha
82 tya
83 pha
84
85 _InterruptCallBack_1 ; Used by the transition animation that shows the name of the authors
86 jsr _DoNothing ; Transformed to "jsr _PrintDescriptionCallback"
87
88 _InterruptCallBack_2 ; Used by the scrolling code
89 jsr _DoNothing ; Transformed to "jsr _ScrollerDisplay" -> 15675 cycles -> 15062
90
91 _InterruptCallBack_3 ; Used by the music player
92 jsr _DoNothing ; Transformed to "jsr _Mym_PlayFrame" -> 12 cycles
93
94 pla
95 tay
96 pla
97 tax
98 pla
99
100 rti
101
102

  ViewVC Help
Powered by ViewVC 1.1.26