Subversion Repositories Kolibri OS

Rev

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

Rev 1980 Rev 2288
Line 40... Line 40...
40
	mcall	49,0x0000,,0x5300
40
        mcall   49,0x0000,,0x5300
41
	jnc	@f
41
        jnc     @f
42
	mcall	4,10*65536+3,0x80000000,text.4
42
        mcall   4,10*65536+3,0x80000000,text.4
43
	bts	[flags],1
43
        bts     [flags], 1
44
	jmp	.end
44
        jmp     .end
-
 
45
    @@:
45
    @@: cmp	al,0
46
        cmp     al, 0
46
	jne	@f
47
        jne     @f
47
	mov	edx,text.1
48
        mov     edx, text.1
48
	jmp	.0
49
        jmp     .0
-
 
50
    @@:
49
    @@: cmp	al,1
51
        cmp     al, 1
50
	jne	@f
52
        jne     @f
51
	mov	edx,text.2
53
        mov     edx, text.2
52
	jmp	.0
54
        jmp     .0
-
 
55
    @@:
53
    @@: mov	edx,text.3
56
        mov     edx, text.3
-
 
57
    .0:
54
    .0: push	edx
58
        push    edx
55
	mcall	4,169*65536+3,0x80dddddd,text.0
59
        mcall   4,169*65536+3,0x80dddddd,text.0
56
	pop	edx
60
        pop     edx
57
	add	ebx,47*65536
61
        add     ebx, 47*65536
58
	mcall
62
        mcall
59
	mcall	49,0x0001,,0x530a
63
        mcall   49,0x0001,,0x530a
Line 63... Line 67...
63
				;AC line status
67
                                ;AC line status
64
	cmp	bh,0
68
        cmp     bh, 0
65
	jne	@f
69
        jne     @f
66
	mov	edx,text.01
70
        mov     edx, text.01
67
	jmp	.1
71
        jmp     .1
-
 
72
    @@:
68
    @@: cmp	bh,1
73
        cmp     bh, 1
69
	jne	@f
74
        jne     @f
70
	mov	edx,text.02
75
        mov     edx, text.02
71
	jmp	.1
76
        jmp     .1
-
 
77
    @@:
72
    @@: cmp	bh,2
78
        cmp     bh, 2
73
	jne	@f
79
        jne     @f
74
	mov	edx,text.03
80
        mov     edx, text.03
75
	jmp	.1
81
        jmp     .1
-
 
82
    @@:
76
    @@: mov	edx,text.04
83
        mov     edx, text.04
-
 
84
   .1:
77
   .1:	push	edx
85
        push    edx
78
	mcall	4,10*65536+10,0x80000000,text.00
86
        mcall   4,10*65536+10,0x80000000,text.00
79
	pop	edx
87
        pop     edx
80
	mcall	,100*65536+10,;0x80000000
88
        mcall   ,100*65536+10,;0x80000000
Line 81... Line 89...
81
 
89
 
82
				;battery status
90
                                ;battery status
83
	pop	bx
91
        pop     bx
84
	cmp	bl,0
92
        cmp     bl, 0
85
	jne	@f
93
        jne     @f
86
	mov	edx,text.11
94
        mov     edx, text.11
-
 
95
        jmp     .2
87
	jmp	.2
96
    @@:
88
    @@: cmp	bl,1
97
        cmp     bl, 1
89
	jne	@f
98
        jne     @f
90
	mov	edx,text.12
99
        mov     edx, text.12
-
 
100
        jmp     .2
91
	jmp	.2
101
    @@:
92
    @@: cmp	bl,2
102
        cmp     bl, 2
93
	jne	@f
103
        jne     @f
94
	mov	edx,text.13
104
        mov     edx, text.13
-
 
105
        jmp     .2
95
	jmp	.2
106
    @@:
96
    @@: cmp	bl,3
107
        cmp     bl, 3
97
	jne	@f
108
        jne     @f
98
	mov	edx,text.14
109
        mov     edx, text.14
-
 
110
        jmp     .2
99
	jmp	.2
111
    @@:
-
 
112
        mov     edx, text.04
100
    @@: mov	edx,text.04
113
   .2:
101
   .2:	push	edx
114
        push    edx
102
	mcall	4,10*65536+20,0x80000000,text.10
115
        mcall   4,10*65536+20,0x80000000,text.10
103
	pop	edx
116
        pop     edx
Line 104... Line 117...
104
	mcall	,100*65536+20,
117
        mcall   ,100*65536+20,
Line 109... Line 122...
109
	cmp	cl,0xff
122
        cmp     cl, 0xff
110
	jne	@f
123
        jne     @f
111
	mcall	,100*65536+30,0x80000000,text.04
124
        mcall   ,100*65536+30,0x80000000,text.04
112
	pop	eax
125
        pop     eax
113
	jmp	.end
126
        jmp     .end
-
 
127
    @@:
114
    @@: shl	ecx,24
128
        shl     ecx, 24
115
	shr	ecx,24
129
        shr     ecx, 24
116
	mcall	47,0x80030000,,100*65536+30,0x347636
130
        mcall   47,0x80030000,,100*65536+30,0x347636
-
 
131
    .3:
117
    .3: mcall	4,115*65536+30,0x80000000,text.15
132
        mcall   4,115*65536+30,0x80000000,text.15
118
	mov	dx,[esp]
133
        mov     dx, [esp]
119
	shl	edx,17
134
        shl     edx, 17
120
	shr	edx,17
135
        shr     edx, 17
121
	mov	ecx,edx
136
        mov     ecx, edx
122
	mcall	47,0x80030000,,140*65536+30
137
        mcall   47,0x80030000,,140*65536+30
123
	pop	cx
138
        pop     cx
124
	mov	edx,text.21
139
        mov     edx, text.21
125
	bt	cx,15
140
        bt      cx, 15
126
	jc	@f
141
        jc      @f
127
	mov	edx,text.22
142
        mov     edx, text.22
-
 
143
    @@:
128
    @@: mcall	4,160*65536+30,0x80000000
144
        mcall   4,160*65536+30,0x80000000
129
	pop	si
145
        pop     si
130
  .error:
146
  .error:
131
  .end:
147
  .end:
132
	;buttons
148
        ;buttons
133
	mcall	8,148*65536+16,45*65536+15,3,0x00677ab0
149
        mcall   8,148*65536+16,45*65536+15,3,0x00677ab0
Line 135... Line 151...
135
	mcall	,184*65536+16,,5,
151
        mcall   ,184*65536+16,,5,
136
	mcall	,202*65536+16,,6,
152
        mcall   ,202*65536+16,,6,
137
	bt	[flags],1
153
        bt      [flags], 1
138
	jc	@f
154
        jc      @f
139
	mcall	,65*65536+45,,2,
155
        mcall   ,65*65536+45,,2,
-
 
156
  @@:
140
  @@:	mcall	4,10*65536+50,0x80564242,text.30
157
        mcall   4,10*65536+50,0x80564242,text.30
141
	mcall	12,2
158
        mcall   12,2
Line 142... Line 159...
142
 
159
 
143
still:
160
still:
144
;        mcall   10
161
;        mcall   10
Line 165... Line 182...
165
	mcall	17
182
        mcall   17
166
	cmp	ah,1
183
        cmp     ah, 1
167
	jne	@f
184
        jne     @f
168
	mcall	-1
185
        mcall   -1
Line -... Line 186...
-
 
186
 
169
 
187
  @@:
170
  @@:	cmp	ah,2
188
        cmp     ah, 2
171
	jne	@f
189
        jne     @f
172
	mcall	5,50
190
        mcall   5,50
173
	mcall	49,0x0001,0x0001,0x5307
191
        mcall   49,0x0001,0x0001,0x5307
Line -... Line 192...
-
 
192
        jmp     redraw
174
	jmp	redraw
193
 
175
 
194
  @@:
176
  @@:	cmp	ah,4
195
        cmp     ah, 4
177
	jg	@f
196
        jg      @f
178
	mov	edx,0x01f7	 ;primary chan.
197
        mov     edx, 0x01f7      ;primary chan.
179
	call	reserv_ports
198
        call    reserv_ports
-
 
199
        jc      redraw
180
	jc	redraw
200
        sub     bh, 3
181
	sub	bh,3
201
  .1:
182
  .1:	call	set_drive
202
        call    set_drive
183
	btc	[flags],2
203
        btc     [flags], 2
184
	jnc	.2
204
        jnc     .2
-
 
205
        call    device_reset
185
	call	device_reset
206
        jmp     .3
-
 
207
  .2:
186
	jmp	.3
208
        call    standby_hdd
187
  .2:	call	standby_hdd
209
  .3:
Line -... Line 210...
-
 
210
        call    free_ports
188
  .3:	call	free_ports
211
        jmp     redraw
189
	jmp	redraw
212
 
190
 
213
  @@:
191
  @@:	cmp	ah,6
214
        cmp     ah, 6
192
	jg	redraw
215
        jg      redraw
193
	mov	edx,0x0177	 ;secondary chan.
216
        mov     edx, 0x0177      ;secondary chan.
Line 200... Line 223...
200
	dec	dx
223
        dec     dx
201
	in	al,dx
224
        in      al, dx
202
	test	bh,bh
225
        test    bh, bh
203
	jnz	@f
226
        jnz     @f
204
	btr	ax,4
227
        btr     ax, 4
-
 
228
.1:
205
.1:	out	dx,al
229
        out     dx, al
206
	inc	dx
230
        inc     dx
207
	ret
231
        ret
-
 
232
@@:
208
@@:	bts	ax,4
233
        bts     ax, 4
209
	jmp	.1
234
        jmp     .1
Line 210... Line 235...
210
 
235
 
211
 
236
 
Line 215... Line 240...
215
; 96h E2h nondata       standby
240
; 96h E2h nondata       standby
216
; 97h E3h nondata       idle
241
; 97h E3h nondata       idle
217
; 98h E5h nondata       check power mode
242
; 98h E5h nondata       check power mode
218
; 99h E6h nondata       set sleep mode
243
; 99h E6h nondata       set sleep mode
219
	xor	ecx,ecx
244
        xor     ecx, ecx
-
 
245
    @@:
220
    @@: in	al,dx
246
        in      al, dx
221
	dec	cx
247
        dec     cx
222
	jz	@f
248
        jz      @f
223
	bt	ax,6
249
        bt      ax, 6
224
	jnc	@b
250
        jnc     @b
225
	mov	al,0x96
251
        mov     al, 0x96
Line 237... Line 263...
237
	test	al,al
263
        test    al, al
238
	jnz	@f
264
        jnz     @f
239
	pop	bx
265
        pop     bx
240
	clc
266
        clc
241
	ret
267
        ret
-
 
268
@@:
242
@@:	pop	bx
269
        pop     bx
243
	stc
270
        stc
244
ret
271
        ret
Line 245... Line 272...
245
 
272
 
246
device_reset:
273
device_reset:
-
 
274
        xor     ecx, ecx
247
	xor	ecx,ecx
275
    @@:
248
    @@: in	al,dx
276
        in      al, dx
249
	dec	cx
277
        dec     cx
250
	jz	@f
278
        jz      @f
251
	bt	ax,6
279
        bt      ax, 6
252
	jnc	@b
280
        jnc     @b
Line 265... Line 293...
265
; „€›… Žƒ€ŒŒ›
293
; „€›… Žƒ€ŒŒ›
266
title db '',0
294
title db '',0
267
flags dw 0
295
flags dw 0
Line 268... Line 296...
268
 
296
 
-
 
297
text:
269
text:
298
.0:
-
 
299
    db 'APM v.1.',0
270
.0: db 'APM v.1.',0
300
.1:
-
 
301
    db '0',0
271
.1: db '0',0
302
.2:
-
 
303
    db '1',0
272
.2: db '1',0
304
.3:
-
 
305
    db '2',0
273
.3: db '2',0
306
.4:
274
.4: db 'APM not supported',0
307
    db 'APM not supported',0
-
 
308
 
275
 
309
.00:
-
 
310
     db 'power status:',0
276
.00: db 'power status:',0
311
.01:
-
 
312
     db 'off-line',0
277
.01: db 'off-line',0
313
.02:
-
 
314
     db 'on-line',0
278
.02: db 'on-line',0
315
.03:
-
 
316
     db 'on backup power',0
279
.03: db 'on backup power',0
317
.04:
280
.04: db 'unknown',0
318
     db 'unknown',0
-
 
319
 
281
 
320
.10:
-
 
321
     db 'battery flag:',0
282
.10: db 'battery flag:',0
322
.11:
-
 
323
     db 'high',0
283
.11: db 'high',0
324
.12:
-
 
325
     db 'low',0
284
.12: db 'low',0
326
.13:
-
 
327
     db 'critical',0
285
.13: db 'critical',0
328
.14:
-
 
329
     db 'charging',0
286
.14: db 'charging',0
330
.15:
287
.15: db ' % ,',0
331
     db ' % ,',0
-
 
332
 
288
 
333
.20:
-
 
334
     db 'battery life:',0
289
.20: db 'battery life:',0
335
.21:
-
 
336
     db 'min',0
290
.21: db 'min',0
337
.22:
Line -... Line 338...
-
 
338
     db 'sec',0
291
.22: db 'sec',0
339
 
Line 292... Line 340...
292
 
340
.30: