Subversion Repositories Kolibri OS

Rev

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

Rev 205 Rev 485
Line 15... Line 15...
15
                dd      0x1000                  ; required amount of memory
15
                dd      0x1000                  ; required amount of memory
16
                dd      0x1000                  ; esp = 0x7FFF0
16
                dd      0x1000                  ; esp = 0x7FFF0
17
                dd      0, 0
17
                dd      0, 0
Line 18... Line 18...
18
 
18
 
Line 19... Line 19...
19
 
19
 
Line 20... Line 20...
20
include 'macros.inc'
20
include '..\..\..\..\macros.inc'
Line 21... Line 21...
21
 
21
 
22
START:                          ; start of execution
22
START:                          ; start of execution
23
 
23
 
24
set_variables:
24
set_variables:
25
 
25
 
Line 26... Line 26...
26
    mov  eax,46           ; reserve ports 0x3f0 - 0x3ff
26
    mov  eax,46           ; reserve ports 0x3f0 - 0x3ff
27
    mov  ebx,0
27
    mov  ebx,0
28
    mov  ecx,0x3f0
28
    mov  ecx,0x3f0
29
    mov  edx,0x3ff
29
    mov  edx,0x3ff
Line 30... Line 30...
30
    int  0x40
30
    mcall
31
 
31
 
32
    mov  eax,45           ; reserve irq 4
32
    mov  eax,45           ; reserve irq 4
33
    mov  ebx,0
33
    mov  ebx,0
Line 34... Line 34...
34
    mov  ecx,4
34
    mov  ecx,4
Line 35... Line 35...
35
    int  0x40
35
    mcall
36
 
36
 
Line 65... Line 65...
65
        mov     al, 1
65
        mov     al, 1
66
        out     dx, al
66
        out     dx, al
Line 67... Line 67...
67
 
67
 
68
    mov  eax,5
68
    mov  eax,5
69
    mov  ebx,100
69
    mov  ebx,100
Line 70... Line 70...
70
    int  0x40
70
    mcall
71
 
71
 
72
        mov     dl, 0xf8
72
        mov     dl, 0xf8
Line 73... Line 73...
73
        mov     al, 'I'
73
        mov     al, 'I'
74
        out     dx, al
74
        out     dx, al
75
 
75
 
Line 76... Line 76...
76
    mov  eax,5
76
    mov  eax,5
77
    mov  ebx,10
77
    mov  ebx,10
Line 78... Line 78...
78
    int  0x40
78
    mcall
79
 
79
 
80
        mov     al, 'R'
80
        mov     al, 'R'
Line 81... Line 81...
81
        out     dx, al
81
        out     dx, al
82
 
82
 
Line 83... Line 83...
83
    mov  eax,40                                 ; get com 1 data with irq 4
83
    mov  eax,40                                 ; get com 1 data with irq 4
Line 84... Line 84...
84
    mov  ebx,0000000000010000b shl 16 + 101b
84
    mov  ebx,0000000000010000b shl 16 + 101b
85
    int  0x40
85
    mcall
86
 
86
 
87
red:
87
red:
88
        call    draw_window
88
        call    draw_window
89
 
89
 
90
still:
90
still:
Line 91... Line 91...
91
 
91
 
92
    mov  eax,10                 ; wait here for event
92
    mov  eax,10                 ; wait here for event
93
    int  0x40
93
    mcall
Line 94... Line 94...
94
        dec     eax
94
        dec     eax
Line 95... Line 95...
95
        jz      red
95
        jz      red
96
        dec     eax
96
        dec     eax
97
        dec     eax
97
        dec     eax
98
        jnz     readir
98
        jnz     readir
Line 99... Line 99...
99
 
99
 
100
  button:                       ; button
100
  button:                       ; button
101
    mov  al,17                  ; get id
101
    mov  al,17                  ; get id
102
    int  0x40
102
    mcall
103
 
103
 
Line 104... Line 104...
104
; we have only one button, close
104
; we have only one button, close
105
 
105
 
Line 106... Line 106...
106
    mov  eax,45                 ; free irq
106
    mov  eax,45                 ; free irq
Line 107... Line 107...
107
    mov  ebx,1
107
    mov  ebx,1
108
    mov  ecx,4
108
    mov  ecx,4
Line 128... Line 128...
128
        db      '/RD/1/CDP',0
128
        db      '/RD/1/CDP',0
Line 129... Line 129...
129
 
129
 
130
  readir:
130
  readir:
131
    mov  eax,42
131
    mov  eax,42
132
    mov  ebx,4
132
    mov  ebx,4
Line 133... Line 133...
133
    int  0x40
133
    mcall
134
 
134
 
Line 135... Line 135...
135
    cmp  ebx,80
135
    cmp  ebx,80
136
    jne  nocd
136
    jne  nocd
137
 
137
 
Line 138... Line 138...
138
    mov  eax,70
138
    mov  eax,70
Line 139... Line 139...
139
    mov  ebx,cdplayer
139
    mov  ebx,cdplayer
Line 154... Line 154...
154
    rep  movsb
154
    rep  movsb
155
    mov  eax,13
155
    mov  eax,13
156
    mov  ebx,20*65536+260
156
    mov  ebx,20*65536+260
157
    mov  ecx,22*65536+220
157
    mov  ecx,22*65536+220
158
    mov  edx,[wcolor]
158
    mov  edx,[wcolor]
159
    int  0x40
159
    mcall
160
    mov  eax,10*19+1
160
    mov  eax,10*19+1
161
  noeaxz:
161
  noeaxz:
162
    mov  [pos],eax
162
    mov  [pos],eax
163
    pop  ebx
163
    pop  ebx
164
    and  ebx,0xff
164
    and  ebx,0xff
Line 207... Line 207...
207
 
207
 
Line 208... Line 208...
208
draw_window:
208
draw_window:
209
 
209
 
210
    mov  eax,12                    ; function 12:tell os about windowdraw
210
    mov  eax,12                    ; function 12:tell os about windowdraw
Line 211... Line 211...
211
    mov  ebx,1                     ; 1, start of draw
211
    mov  ebx,1                     ; 1, start of draw
212
    int  0x40
212
    mcall
213
 
213
 
214
                                   ; DRAW WINDOW
214
                                   ; DRAW WINDOW
215
    mov  eax,0                     ; function 0 : define and draw window
215
    mov  eax,0                     ; function 0 : define and draw window
216
    mov  ebx,100*65536+300         ; [x start] *65536 + [x size]
216
    mov  ebx,100*65536+300         ; [x start] *65536 + [x size]
217
    mov  ecx,100*65536+250         ; [y start] *65536 + [y size]
217
    mov  ecx,100*65536+250         ; [y start] *65536 + [y size]
Line 218... Line 218...
218
    mov  edx,[wcolor]              ; color of work area RRGGBB,8->color
218
    mov  edx,[wcolor]              ; color of work area RRGGBB,8->color
219
    mov  edi,labelt                ; caption string
219
    mov  edi,labelt                ; caption string
220
    int  0x40
220
    mcall
221
 
221
 
222
;                                   ; WINDOW LABEL
222
;                                   ; WINDOW LABEL
223
;    mov  eax,4                     ; function 4 : write text to window
223
;    mov  eax,4                     ; function 4 : write text to window
224
;    mov  ebx,8*65536+8             ; [x start] *65536 + [y start]
224
;    mov  ebx,8*65536+8             ; [x start] *65536 + [y start]
Line 225... Line 225...
225
;    mov  ecx,0x00ffffff            ; color of text RRGGBB
225
;    mov  ecx,0x00ffffff            ; color of text RRGGBB
226
;    mov  edx,labelt                ; pointer to text beginning
226
;    mov  edx,labelt                ; pointer to text beginning
227
;    mov  esi,labellen-labelt       ; text length
227
;    mov  esi,labellen-labelt       ; text length
228
;    int  0x40
228
;    mcall
229
 
229
 
230
                                   ; CLOSE BUTTON
230
                                   ; CLOSE BUTTON
231
;    mov  eax,8                     ; function 8 : define and draw button
231
;    mov  eax,8                     ; function 8 : define and draw button
Line 232... Line 232...
232
;    mov  ebx,(300-19)*65536+12     ; [x start] *65536 + [x size]
232
;    mov  ebx,(300-19)*65536+12     ; [x start] *65536 + [x size]
Line 233... Line 233...
233
;    mov  ecx,5*65536+12            ; [y start] *65536 + [y size]
233
;    mov  ecx,5*65536+12            ; [y start] *65536 + [y size]
234
;    mov  edx,1                     ; button id
234
;    mov  edx,1                     ; button id
235
;    mov  esi,0x5599cc              ; button color RRGGBB
235
;    mov  esi,0x5599cc              ; button color RRGGBB
236
;    int  0x40
236
;    mcall
237
 
237
 
238
draw_text:
238
draw_text:
239
 
239
 
240
    mov  ebx,25*65536+35           ; draw info text with function 4
240
    mov  ebx,25*65536+35           ; draw info text with function 4
241
    mov  ecx,0xffffff
241
    mov  ecx,0xffffff
242
    mov  edx,text
242
    mov  edx,text
243
    mov  esi,40
243
    mov  esi,40
244
    mov  edi,20
244
    mov  edi,20
Line 245... Line 245...
245
  newline:
245
  newline:
246
    mov  eax,4
246
    mov  eax,4
247
    int  0x40
247
    mcall
Line 248... Line 248...
248
    add  ebx,10
248
    add  ebx,10
Line 249... Line 249...
249
    add  edx,esi
249
    add  edx,esi