Subversion Repositories Kolibri OS

Rev

Rev 317 | Rev 551 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 317 Rev 485
Line 3... Line 3...
3
;
3
;
4
;   Compile with FASM for Menuet
4
;   Compile with FASM for Menuet
5
;
5
;
Line 6... Line 6...
6
 
6
 
7
include "lang.inc"
7
include "lang.inc"
Line 8... Line 8...
8
include "macros.inc"
8
include "..\..\..\macros.inc"
9
 
9
 
Line 10... Line 10...
10
    use32
10
    use32
Line 21... Line 21...
21
START:                 ; start of execution
21
START:                 ; start of execution
Line 22... Line 22...
22
 
22
 
23
    mov  eax,66    ; keyboard mode definitions
23
    mov  eax,66    ; keyboard mode definitions
24
    mov  ebx,1     ; set
24
    mov  ebx,1     ; set
25
    mov  ecx,1     ; return scancodes
25
    mov  ecx,1     ; return scancodes
Line 26... Line 26...
26
    int  0x40
26
    mcall
27
 
27
 
28
    mov  eax,26    ; get setup for keyboard
28
    mov  eax,26    ; get setup for keyboard
29
    mov  ebx,2
29
    mov  ebx,2
-
 
30
    mov  ecx,1     ; base keymap
-
 
31
    mov  edx,keymap
-
 
32
    mcall
30
    mov  ecx,1     ; base keymap
33
 
-
 
34
    mov  eax, 48                   ; GET SYSTEM COLORS
-
 
35
    mov  ebx, 3
-
 
36
    mov  ecx, sc
-
 
37
    mov  edx, sizeof.system_colors
31
    mov  edx,keymap
38
    mcall
32
    int  0x40
39
 
Line 33... Line 40...
33
  red:
40
  red:
Line 34... Line 41...
34
    call draw_window
41
    call draw_window
35
 
42
 
Line 36... Line 43...
36
still:
43
still:
37
 
44
 
38
    mov  eax,10                 ; wait here for event
45
    mov  eax,10                 ; wait here for event
39
    int  0x40
46
    mcall
Line 48... Line 55...
48
    jmp  still
55
    jmp  still
Line 49... Line 56...
49
 
56
 
50
 
57
 
51
  key:                          ; key
58
  key:                          ; key
Line 52... Line 59...
52
    mov  eax,2                  ; just read it and ignore
59
    mov  eax,2                  ; just read it and ignore
53
    int  0x40
60
    mcall
54
 
61
 
55
    mov  esi,scan_codes+1
62
    mov  esi,scan_codes+1
Line 133... Line 140...
133
 
140
 
134
 
141
 
135
 
142
 
Line 136... Line 143...
136
  button:                       ; button
143
  button:                       ; button
Line 145... Line 152...
145
;   *********************************************
152
;   *********************************************
Line 146... Line 153...
146
 
153
 
Line 147... Line -...
147
 
-
 
148
draw_window:
-
 
149
 
-
 
150
    mov  eax, 48                   ; GET SYSTEM COLORS
-
 
151
    mov  ebx, 3
-
 
Line 152... Line 154...
152
    mov  ecx, sc
154
 
153
    mov  edx, sizeof.system_colors
155
draw_window:
154
    int  0x40
156
 
Line 155... Line 157...
155
 
157
 
156
    mov  eax,12                    ; function 12:tell os about windowdraw
158
    mov  eax,12                    ; function 12:tell os about windowdraw
157
    mov  ebx,1                     ; 1, start of draw
159
    mov  ebx,1                     ; 1, start of draw
158
    int  0x40
160
    mcall
159
 
161
 
160
                                   ; DRAW WINDOW
162
                                   ; DRAW WINDOW
161
    mov  eax, 0                    ; function 0 : define and draw window
163
    mov  eax, 0                    ; function 0 : define and draw window
162
    mov  ebx, 100*65536+200        ; [x start] *65536 + [x size]
164
    mov  ebx, 100*65536+200        ; [x start] *65536 + [x size]
Line 163... Line 165...
163
    mov  ecx, 100*65536+275        ; [y start] *65536 + [y size]
165
    mov  ecx, 100*65536+275        ; [y start] *65536 + [y size]
164
    mov  edx, [sc.work]            ; color of work area RRGGBB,8->color gl
166
    mov  edx, [sc.work]            ; color of work area RRGGBB,8->color gl
165
    or   edx, 0x33000000
167
    or   edx, 0x33000000
166
    mov  edi, header               ; WINDOW LABEL
168
    mov  edi, title                ; WINDOW LABEL
167
    int  0x40
169
    mcall
168
                                   
170
                                   
Line 169... Line 171...
169
    mov  eax, 4
171
    mov  eax, 4
Line 170... Line 172...
170
    mov  ebx, 15*65536+10
172
    mov  ebx, 15*65536+10
171
    xor  ecx, ecx
173
    xor  ecx, ecx
172
    mov  edx, text
174
    mov  edx, text
Line 173... Line 175...
173
    mov  esi, text.len
175
    mov  esi, text.len
Line 174... Line 176...
174
    int  0x40
176
    mcall
Line 195... Line 197...
195
    shl  ecx,16
197
    shl  ecx,16
196
    add  ecx,10
198
    add  ecx,10
197
    mov  eax,13   ; filled rectangle
199
    mov  eax,13   ; filled rectangle
198
    mov  ebx,15*65536+160
200
    mov  ebx,15*65536+160
199
    mov  edx,[sc.work]
201
    mov  edx,[sc.work]
200
    int  0x40
202
    mcall
201
    popa
203
    popa
202
    pusha
204
    pusha
203
    mov  ebx,edx
205
    mov  ebx,edx
204
    add  ebx,70*65536
206
    add  ebx,70*65536
205
    mov  eax,4    ; text
207
    mov  eax,4    ; text
206
    mov  ecx,[sc.work_text]
208
    mov  ecx,[sc.work_text]
207
    mov  edx,key_codes
209
    mov  edx,key_codes
208
    imul edi,12
210
    imul edi,12
209
    add  edx,edi
211
    add  edx,edi
210
    mov  esi,12
212
    mov  esi,12
211
    int  0x40
213
    mcall
212
    popa
214
    popa
213
    movzx  ecx,byte [scan_codes+edi]
215
    movzx  ecx,byte [scan_codes+edi]
214
    int  0x40     ; number
216
    mcall     ; number
215
    inc  ecx
217
    inc  ecx
216
    add  edx,12
218
    add  edx,12
217
    inc  edi
219
    inc  edi
218
    cmp  edi,16
220
    cmp  edi,16
219
    jne  newscan
221
    jne  newscan
Line 289... Line 291...
289
if lang eq ru
291
if lang eq ru
290
  text:
292
  text:
291
      db '‘—ˆ’›‚€ž „€›… ‘ Š‹€‚ˆ€’“›'
293
      db '‘—ˆ’›‚€ž „€›… ‘ Š‹€‚ˆ€’“›'
292
  .len = $ - text
294
  .len = $ - text
Line 293... Line 295...
293
 
295
 
294
  header      db   '‘Š€ŠŽ„› Š‹€‚ˆ€’“›',0
296
  title      db   '‘Š€ŠŽ„› Š‹€‚ˆ€’“›',0
295
else
297
else
296
  text:
298
  text:
297
      db 'READING RAW SCANCODE DATA'
299
      db 'READING RAW SCANCODE DATA'
Line 298... Line 300...
298
  .len = $ - text
300
  .len = $ - text
299
 
301
 
Line 300... Line 302...
300
  header      db   'KEYBOARD SCANCODES',0
302
  title      db   'KEYBOARD SCANCODES',0
301
end if
303
end if