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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1099 - (show annotations)
Sun Feb 2 12:27:33 2014 UTC (5 years, 9 months ago) by dbug
File size: 2255 byte(s)
Complete source code and assets for Pushing The Envelope 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
22 .text
23
24 _System_InstallIRQ_SimpleVbl
25 .(
26 sei
27 // Set the VIA parameters
28 lda #<19966 ; 20000
29 sta $306
30 lda #>19966 ; 20000
31 sta $307
32
33 lda #0
34 sta _VblCounter
35
36 ; Install interrupt (this works only if overlay ram is accessible)
37 lda #<_50Hz_InterruptHandler
38 sta $FFFE
39 lda #>_50Hz_InterruptHandler
40 sta $FFFF
41
42 cli
43 rts
44 .)
45
46
47 _VSync
48 lda _VblCounter
49 beq _VSync
50 lda #0
51 sta _VblCounter
52 _DoNothing
53 rts
54
55
56 _50Hz_InterruptHandler
57 bit $304
58 inc _VblCounter
59
60 pha
61 txa
62 pha
63 tya
64 pha
65
66 _InterruptCallBack_1 ; Used by the transition animation that shows the name of the authors
67 jsr _DoNothing ; Transformed to "jsr _PrintDescriptionCallback"
68
69 _InterruptCallBack_2 ; Used by the scrolling code
70 jsr _DoNothing ; Transformed to "jsr _ScrollerDisplay" -> 15675 cycles -> 15062
71
72 _InterruptCallBack_3 ; Used by the music player
73 jsr _DoNothing ; Transformed to "jsr _Mym_PlayFrame" -> 12 cycles
74
75 jsr MiniScrollLoading ; -> 338 cycles
76
77 pla
78 tay
79 pla
80 tax
81 pla
82
83 rti
84
85
86
87 LoadingDataBitmap
88 .(
89 .dsb 8*2
90 ; 58 pixels bitmap + 8 +8 = 74
91 #include "loading_data.s"
92 .dsb 8*2
93 .)
94
95 MiniScrollColorCycle
96 .byt 1,3,7,6,4,4,5,1
97 .byt 1,3,7,6,4,4,5,1
98
99 MiniScrollYPos .byt 1
100
101 MiniScrollLoading
102 .(
103 ldy MiniScrollYPos
104 dey
105 bne no_reset
106 ldy #74
107 no_reset
108 sty MiniScrollYPos
109
110 tya
111 and #7
112 tax
113 lda MiniScrollColorCycle,x
114 stx $bb80+40*26+38
115 inx
116 lda MiniScrollColorCycle,x
117 stx $bb80+40*27+38
118
119 ldx #0
120 loop
121 lda LoadingDataBitmap,y
122 sta $9800+126*8,x
123 iny
124 inx
125 cpx #16
126 bne loop
127 rts
128 .)

  ViewVC Help
Powered by ViewVC 1.1.26