/[projet1]/public/atari/tools/rembrandt/DIVERS/KEYBOARD.S
Defence Force logotype

Contents of /public/atari/tools/rembrandt/DIVERS/KEYBOARD.S

Parent Directory Parent Directory | Revision Log Revision Log


Revision 67 - (show annotations)
Sat Apr 25 18:10:46 2009 UTC (10 years, 7 months ago) by dbug
File size: 4306 byte(s)
Added Rembrandt and Forgotten Bits
1 ;
2 ; Routine clavier/souris pour Rembrandt.
3 ;
4 ; Doit g‚rer:
5 ; - La souris
6 ; - Vitesse variable
7 ; - Inversion des boutons pour les gauchers
8 ;
9 ; - Le clavier
10 ; - Appui+Relachement des touches
11 ; - R‚p‚tition clavier
12 ; - Gestion des touches mortes
13 ; - D‚tection d'appuis multiple
14 ; - Combinaisons sp‚ciales (RESET...)
15 ;
16 affichage=1
17
18 col2=0
19 col4=1
20 col16=2
21 col256=3
22 coltc=4
23
24 l40=0
25 l80=8
26
27 tv=0
28 vga=16
29 pal=32
30 overscan=64
31 st=128
32 interlace=256
33
34 mode=coltc+l40+tv+pal
35
36 move.l #ecran+4,d0
37 and.b #252,d0
38 move.l d0,‚cran
39
40 ifne affichage
41 move #-1,-(sp)
42 move #88,-(sp)
43 trap #14
44 addq #4,sp
45 move d0,sauve_rez
46
47 move #2,-(sp)
48 trap #14
49 addq #2,sp
50 move.l d0,sauve_physique
51
52 move #3,-(sp)
53 trap #14
54 addq #2,sp
55 move.l d0,sauve_logique
56
57 move #mode,-(sp)
58 move #3,-(sp)
59 move.l ‚cran,-(sp)
60 move.l ‚cran,-(sp)
61 move #5,-(sp)
62 trap #14
63 add #14,sp
64 endc
65
66 pea main(pc)
67 move #$26,-(sp)
68 trap #14
69 addq #6,sp
70
71 * move #1,-(sp)
72 * trap #1
73 * addq #2,sp
74
75 ifne affichage
76 move sauve_rez,-(sp)
77 move #3,-(sp)
78 move.l sauve_physique,-(sp)
79 move.l sauve_logique,-(sp)
80 move #5,-(sp)
81 trap #14
82 add #14,sp
83 endc
84
85 clr -(sp)
86 trap #1
87
88
89
90 main
91 pea data_kybd
92 move #3-1,-(sp)
93 move #25,-(sp)
94 trap #14
95 addq #8,sp
96
97
98 move #$2700,sr
99 move.l $118.w,sauve_118
100 move.l #routine_118,$118.w
101 move #$2300,sr
102
103 move #160,mousex
104 move #100,mousey
105
106 loop
107 move #37,-(sp)
108 trap #14
109 addq #2,sp
110
111 cmp.b #$39,code_touche
112 beq end_loop
113
114 move.l ‚cran,a0
115 move mousex,d0
116 move x_offset,d1
117 asr #2,d1
118 add d1,d0
119 * clr x_offset
120 and #255,d0
121 add d0,d0
122 add d0,a0
123 move mousey,d0
124 move y_offset,d1
125 asr #2,d1
126 add d1,d0
127 * clr y_offset
128 and #127,d0
129 mulu #640,d0
130 add.l d0,a0
131
132 tst boutons
133 beq.s .no_draw
134 move cpt,(a0)
135 .no_draw
136 addq #8,cpt
137
138 * move.l #-1,$ffff9800.w
139 tst.b flag_touche_press‚e
140 beq.s .touche_relach‚e
141 nop
142 * move.l #$ff000000,$ffff9800.w
143 .touche_relach‚e
144
145 bra loop
146 end_loop
147
148 move #$2700,sr
149 move.l sauve_118,$118.w
150 move #$2300,sr
151 rts
152
153
154
155 routine_118
156 move.l #$ff000000,$ffff9800.w
157 move.l d0,-(sp)
158 move.l d1,-(sp)
159 move.l d2,-(sp)
160 moveq #0,d0
161 moveq #0,d1
162 debut
163 move.b $fffffc00.w,d0
164 btst #7,d0
165 beq.s fin_2 ; -> si le bit 7 est nul,alors pas d'interrupt clavier.
166
167 btst #0,d0
168 beq.s fin_1 ; -> si le bit 0 est nul,alors pas d'octet en attente.
169
170 tst.b longueur_pack
171 bne.s lecture_pack
172
173 move.b $fffffc02.w,d1
174 bmi gŠre_code_n‚gatif
175 move.b d1,code_touche
176 st flag_touche_press‚e
177 fin_1
178 and.b #$20,d0
179 beq.s fin_2
180 move.b $fffffc02.w,d0
181 fin_2
182 btst #4,$fffffa01.w
183 beq.s debut
184 bclr #6,$fffffa11.w
185 move.l (sp)+,d2
186 move.l (sp)+,d1
187 move.l (sp)+,d0
188 move.l #-1,$ffff9800.w
189 rte
190
191 lecture_pack
192 jsr ([routine_lecture_pack])
193 subq.b #1,longueur_pack
194 bra fin_2
195
196 routine_lecture_pack dc.l routine_dummy
197
198 routine_dummy
199 move.b $fffffc02.w,d1
200 rts
201
202 routine_lecture_x
203 move.b $fffffc02.w,d1
204 ext d1
205 add d1,x_offset
206 move.l #routine_lecture_y,routine_lecture_pack
207 rts
208
209 routine_lecture_y
210 move.b $fffffc02.w,d1
211 ext d1
212 add d1,y_offset
213 move.l #routine_dummy,routine_lecture_pack
214 rts
215
216 gŠre_code_n‚gatif
217 cmp #$f8,d1
218 beq.s gŠre_header_1
219 cmp #$f9,d1
220 beq.s gŠre_header_1
221 cmp #$fa,d1
222 beq.s gŠre_header_1
223 cmp #$fb,d1
224 beq.s gŠre_header_1
225 gŠre_code_relachement
226 sf flag_touche_press‚e
227 bra fin_2
228
229 gŠre_header_1
230 move.b d1,num‚ro_header
231 and #%11,d1
232 move.b d1,boutons
233 move.l #routine_lecture_x,routine_lecture_pack
234 move.b #2,longueur_pack
235 bra fin_2
236
237 gŠre_header_2
238 move.b #3,longueur_pack
239 bra fin_2
240
241 * f6 -> lecture m‚moire
242
243 * f7 -> souris absolue
244
245 * f8 -> souris relative
246 * f9 ->
247 * fa ->
248 * fb ->
249
250 * fc -> valeur de l'horloge
251
252 * fd ->
253
254 * fe -> joy 0
255 * ff -> joy 1
256
257 DATA
258
259
260 data_kybd
261 dc.b $0b,1,1,0
262
263
264 BSS
265 even
266
267 sauve_rez ds.w 1
268 sauve_logique ds.l 1
269 sauve_physique ds.l 1
270 ‚cran ds.l 1
271 ecran ds.l 256000/4
272
273 sauve_118 ds.l 1
274
275 cpt ds.w 1
276
277 mousex ds.w 1
278 mousey ds.w 1
279 boutons ds.b 1
280
281 x_offset ds.w 1
282 y_offset ds.w 1
283
284 code_touche ds.b 1
285 flag_touche_press‚e ds.b 1
286 longueur_pack ds.b 1
287 num‚ro_header ds.b 1
288
289 END
290

  ViewVC Help
Powered by ViewVC 1.1.26