Rev 1700 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1700 | Rev 1703 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 1700 $ |
8 | $Revision: 1703 $ |
9 | 9 | ||
10 | struc VBE_VGAInfo { |
10 | struc VBE_VGAInfo { |
11 | .VESASignature dd ? ; char |
11 | .VESASignature dd ? ; char |
Line 110... | Line 110... | ||
110 | @@: or al,0x30 |
110 | @@: or al,0x30 |
111 | mov [es:di],al |
111 | mov [es:di],al |
112 | inc di |
112 | inc di |
113 | ret |
113 | ret |
Line 114... | Line -... | ||
114 | - | ||
115 | ;------------------------------------------------------- |
- | |
116 | ;Write message about incorrect v_mode and write message about jmp on swith v_mode |
- | |
117 | v_mode_error: |
- | |
118 | _setcursor 19,2 |
- | |
119 | mov si, fatalsel |
- | |
120 | call printplain |
- | |
121 | _setcursor 20,2 |
- | |
122 | mov si,pres_key |
- | |
123 | call printplain |
- | |
124 | xor eax,eax |
- | |
125 | int 16h |
- | |
126 | jmp cfgmanager.d |
- | |
127 | ;------------------------------------------------------- |
- | |
128 | ; |
- | |
129 | - | ||
Line 130... | Line 114... | ||
130 | 114 | ||
131 | 115 | ||
132 | ;------------------------------------------------------- |
116 | ;------------------------------------------------------- |
Line 142... | Line 126... | ||
142 | mov [es:vi.VESASignature],'VESA' |
126 | mov [es:vi.VESASignature],'VESA' |
143 | mov ax,$4F00 |
127 | mov ax,$4F00 |
144 | mov di,vi |
128 | mov di,vi |
145 | int 0x10 |
129 | int 0x10 |
146 | or ah,ah |
130 | or ah,ah |
147 | jnz .exit |
131 | jnz $ |
148 | @@: |
132 | @@: |
149 | cmp [es:vi.VESASignature],'VESA' |
133 | cmp [es:vi.VESASignature],'VESA' |
150 | jne .exit |
134 | jne $ |
151 | cmp [es:vi.VESAVersion],0x0100 |
135 | cmp [es:vi.VESAVersion],0x0100 |
152 | jb .exit |
- | |
153 | jmp .vesaok2 |
- | |
154 | - | ||
155 | .exit: |
136 | jb $ |
156 | mov si,novesa |
- | |
157 | call printplain |
- | |
158 | ret |
- | |
Line 159... | Line 137... | ||
159 | 137 | ||
160 | .vesaok2: |
138 | .vesaok2: |
161 | mov ax,[es:vi.VESAVersion] |
139 | mov ax,[es:vi.VESAVersion] |
Line 239... | Line 217... | ||
239 | mov word[es:bx],-1 ;end video table |
217 | mov word[es:bx],-1 ;end video table |
240 | mov word[end_cursor],bx ;save end cursor position |
218 | mov word[end_cursor],bx ;save end cursor position |
241 | popad |
219 | popad |
242 | ret |
220 | ret |
Line 243... | Line -... | ||
243 | - | ||
244 | ;----------------------------------------------------------------------------- |
- | |
245 | - | ||
246 | ;draw_current_vmode: |
- | |
247 | ; push 0 |
- | |
248 | ; pop es |
- | |
249 | - | ||
250 | ; mov si,word [cursor_pos] |
- | |
251 | - | ||
252 | ; cmp word [es:si+6],0x12 |
- | |
253 | ; je .no_vesa_0x12 |
- | |
254 | - | ||
255 | ; cmp word [es:si+6],0x13 |
- | |
256 | ; je .no_vesa_0x13 |
- | |
257 | - | ||
258 | ; mov di,loader_block_error |
- | |
259 | ; movzx eax,word[es:si+0] |
- | |
260 | ; mov ecx,10 |
- | |
261 | ; call int2strnz |
- | |
262 | ; mov byte[es:di],'x' |
- | |
263 | ; inc di |
- | |
264 | ; movzx eax,word[es:si+2] |
- | |
265 | ; call int2strnz |
- | |
266 | ; mov byte[es:di],'x' |
- | |
267 | ; inc di |
- | |
268 | ; movzx eax,word[es:si+8] |
- | |
269 | ; call int2strnz |
- | |
270 | ; mov dword[es:di],0x00000d0a |
- | |
271 | ; mov si,loader_block_error |
- | |
272 | ; push ds |
- | |
273 | ; push es |
- | |
274 | ; pop ds |
- | |
275 | ; call printplain |
- | |
276 | ; pop ds |
- | |
277 | ; ret |
- | |
278 | ;.no_vesa_0x13: |
- | |
279 | ; mov si,mode0 |
- | |
280 | ; jmp .print |
- | |
281 | ;.no_vesa_0x12: |
- | |
282 | ; mov si,mode9 |
- | |
283 | ;.print: |
- | |
284 | ; call printplain |
- | |
285 | ; ret |
- | |
286 | ;----------------------------------------------------------------------------- |
221 | |
287 | check_first_parm: |
222 | check_first_parm: |
288 | mov si,word [preboot_graph] |
223 | mov si,word [preboot_graph] |
289 | test si,si |
224 | test si,si |
290 | jnz .no_zero ;if no zero |
225 | jnz .no_zero ;if no zero |
291 | .zerro: |
- | |
292 | ; mov ax,modes_table |
- | |
293 | ; mov word [cursor_pos],ax |
- | |
294 | ; mov word [home_cursor],ax |
- | |
295 | ; mov word [preboot_graph],ax |
- | |
Line 296... | Line 226... | ||
296 | ;SET default video of mode first probe will fined a move of work 1024x768@32 |
226 | .zerro: |
297 | 227 | ||
298 | mov ax,1024 |
228 | mov ax,1024 |
299 | mov bx,768 |
229 | mov bx,768 |
Line 363... | Line 293... | ||
363 | ret |
293 | ret |
364 | .exit: or ax,-1 |
294 | .exit: or ax,-1 |
365 | ret |
295 | ret |
Line 366... | Line -... | ||
366 | - | ||
367 | - | ||
368 | ;----------------------------------------------------------------------------- |
- | |
369 | - | ||
370 | ;default_vmode: |
- | |
371 | - | ||
372 | ;----------------------------------------------------------------------------- |
- | |
373 | draw_vmodes_table: |
- | |
374 | ; _setcursor 9, 2 |
- | |
375 | ; mov si,gr_mode |
- | |
376 | ; call printplain |
- | |
377 | - | ||
378 | ; mov si,_st |
- | |
379 | ; call printplain |
- | |
380 | - | ||
381 | ; push word [cursor_pos] |
- | |
382 | ; pop ax |
- | |
383 | ; push word [home_cursor] |
- | |
384 | ; pop si |
- | |
385 | ; mov cx,si |
- | |
386 | - | ||
387 | ; cmp ax,si |
- | |
388 | ; je .ok |
- | |
389 | ; jb .low |
- | |
390 | - | ||
391 | - | ||
392 | ; add cx,size_of_step*long_v_table |
- | |
393 | - | ||
394 | ; cmp ax,cx |
- | |
395 | ; jb .ok |
- | |
396 | - | ||
397 | ; sub cx,size_of_step*long_v_table |
- | |
398 | ; add cx,size_of_step |
- | |
399 | ; cmp cx,word[end_cursor] |
- | |
400 | ; jae .ok |
- | |
401 | ; add si,size_of_step |
- | |
402 | ; push si |
- | |
403 | ; pop word [home_cursor] |
- | |
404 | ; jmp .ok |
- | |
405 | - | ||
406 | - | ||
407 | ;.low: sub cx,size_of_step |
- | |
408 | ; cmp cx,modes_table |
- | |
409 | ; jb .ok |
- | |
410 | ; push cx |
- | |
411 | ; push cx |
- | |
412 | ; pop word [home_cursor] |
- | |
413 | ; pop si |
- | |
414 | - | ||
415 | - | ||
416 | ;.ok: |
- | |
417 | ; calculate scroll position |
- | |
418 | ; push si |
- | |
419 | ; mov ax, [end_cursor] |
- | |
420 | ; sub ax, modes_table |
- | |
421 | ; mov bx, size_of_step |
- | |
422 | ; cwd |
- | |
423 | ; div bx |
- | |
424 | ; mov si, ax ; si = size of list |
- | |
425 | ; mov ax, [home_cursor] |
- | |
426 | ; sub ax, modes_table |
- | |
427 | ; cwd |
- | |
428 | ; div bx |
- | |
429 | ; mov di, ax |
- | |
430 | ; mov ax, scroll_area_size*long_v_table |
- | |
431 | ; cwd |
- | |
432 | ; div si |
- | |
433 | ; test ax, ax |
- | |
434 | ; jnz @f |
- | |
435 | ; inc ax |
- | |
436 | ;@@: |
- | |
437 | ; cmp al, scroll_area_size |
- | |
438 | ; jb @f |
- | |
439 | ; mov al, scroll_area_size |
- | |
440 | ;@@: |
- | |
441 | ; mov cx, ax |
- | |
442 | ; cx = scroll height |
- | |
443 | ; calculate scroll pos |
- | |
444 | ; xor bx, bx ; initialize scroll pos |
- | |
445 | ; sub al, scroll_area_size+1 |
- | |
446 | ; neg al |
- | |
447 | ; sub si, long_v_table-1 |
- | |
448 | ; jbe @f |
- | |
449 | ; mul di |
- | |
450 | ; div si |
- | |
451 | ; mov bx, ax |
- | |
452 | ;@@: |
- | |
453 | ; inc bx |
- | |
454 | ; imul ax, bx, size_of_step |
- | |
455 | ; add ax, [home_cursor] |
- | |
456 | ; mov [scroll_start], ax |
- | |
457 | ; imul cx, size_of_step |
- | |
458 | ; add ax, cx |
- | |
459 | ; mov [scroll_end], ax |
- | |
460 | ; pop si |
- | |
461 | ; mov bp,long_v_table ;show rows |
- | |
462 | ;.@@_next_bit: |
- | |
463 | ;clear cursor |
- | |
464 | ; mov ax,' ' |
- | |
465 | ; mov word[ds:_r1+21],ax |
- | |
466 | ; mov word[ds:_r1+50],ax |
- | |
467 | - | ||
468 | ; mov word[ds:_r2+21],ax |
- | |
469 | ; mov word[ds:_r2+45],ax |
- | |
470 | - | ||
471 | ; mov word[ds:_rs+21],ax |
- | |
472 | ; mov word[ds:_rs+46],ax |
- | |
473 | ; draw string |
- | |
474 | ; cmp word [es:si+6],0x12 |
- | |
475 | ; je .show_0x12 |
- | |
476 | ; cmp word [es:si+6],0x13 |
- | |
477 | ; je .show_0x13 |
- | |
478 | - | ||
479 | ; movzx eax,word[es:si] |
- | |
480 | ; cmp ax,-1 |
- | |
481 | ; je .@@_end |
- | |
482 | ; mov di,_rs+23 |
- | |
483 | ; mov ecx,10 |
- | |
484 | ; mov bl,4 |
- | |
485 | ; call int2str |
- | |
486 | ; movzx eax,word[es:si+2] |
- | |
487 | ; inc di |
- | |
488 | ; mov bl,4 |
- | |
489 | ; call int2str |
- | |
490 | - | ||
491 | ; movzx eax,word[es:si+8] |
- | |
492 | ; inc di |
- | |
493 | ; mov bl,2 |
- | |
494 | ; call int2str |
- | |
495 | - | ||
496 | ; cmp si, word [cursor_pos] |
- | |
497 | ; jne .next |
- | |
498 | ;draw cursor |
- | |
499 | ; mov word[ds:_rs+21],'>>' |
- | |
500 | ; mov word[ds:_rs+46],'<<' |
- | |
501 | - | ||
502 | - | ||
503 | - | ||
504 | ;.next: |
- | |
505 | ; push si |
- | |
506 | ; mov si,_rs |
- | |
507 | ;.@@_sh: |
- | |
508 | ; add to the string pseudographics for scrollbar |
- | |
509 | ; pop bx |
- | |
510 | ; push bx |
- | |
511 | ; mov byte [si+53], ' ' |
- | |
512 | ; cmp bx, [scroll_start] |
- | |
513 | ; jb @f |
- | |
514 | ; cmp bx, [scroll_end] |
- | |
515 | ; jae @f |
- | |
516 | ; mov byte [si+53], 0xDB ; filled bar |
- | |
517 | ;@@: |
- | |
518 | ; push bx |
- | |
519 | ; add bx, size_of_step |
- | |
520 | ; cmp bx, [end_cursor] |
- | |
521 | ; jnz @f |
- | |
522 | ; mov byte [si+53], 31 ; 'down arrow' symbol |
- | |
523 | ;@@: |
- | |
524 | ; sub bx, [home_cursor] |
- | |
525 | ; cmp bx, size_of_step*long_v_table |
- | |
526 | ; jnz @f |
- | |
527 | ; mov byte [si+53], 31 ; 'down arrow' symbol |
- | |
528 | ;@@: |
- | |
529 | ; pop bx |
- | |
530 | ; cmp bx, [home_cursor] |
- | |
531 | ; jnz @f |
- | |
532 | ; mov byte [si+53], 30 ; 'up arrow' symbol |
- | |
533 | ;@@: |
- | |
534 | ; call printplain |
- | |
535 | ; pop si |
- | |
536 | ; add si,size_of_step |
- | |
537 | - | ||
538 | ; dec bp |
- | |
539 | ; jnz .@@_next_bit |
- | |
540 | - | ||
541 | ;.@@_end: |
- | |
542 | ; mov si,_bt |
- | |
543 | ; call printplain |
- | |
544 | ret |
- | |
545 | ;.show_0x13: |
- | |
546 | ; push si |
- | |
547 | - | ||
548 | ; cmp si, word [cursor_pos] |
- | |
549 | ; jne @f |
- | |
550 | ; mov word[ds:_r1+21],'>>' |
- | |
551 | ; mov word[ds:_r1+50],'<<' |
- | |
552 | ;@@: |
- | |
553 | ; mov si,_r1 |
- | |
554 | ; jmp .@@_sh |
- | |
555 | ;.show_0x12: |
- | |
556 | ; push si |
- | |
557 | ; cmp si, word [cursor_pos] |
- | |
558 | ; jne @f |
- | |
559 | - | ||
560 | ; mov word[ds:_r2+21],'>>' |
- | |
561 | ; mov word[ds:_r2+45],'<<' |
- | |
562 | ;@@: |
- | |
Line 563... | Line 296... | ||
563 | ; mov si,_r2 |
296 | |
564 | ; jmp .@@_sh |
297 | |
565 | 298 | ||
566 | ;----------------------------------------------------------------------------- |
299 | ;----------------------------------------------------------------------------- |
567 | ;Clear area of current video page (0xb800) |
300 | ;Clear area of current video page (0xb800) |
568 | clear_vmodes_table: |
301 | ;clear_vmodes_table: |
569 | pusha |
302 | ; pusha |
570 | ; draw frames |
303 | ; draw frames |
571 | push es |
304 | ; push es |
572 | push 0xb800 |
305 | ; push 0xb800 |
573 | pop es |
306 | ; pop es |
574 | mov di,1444 |
307 | ; mov di,1444 |
575 | xor ax,ax |
308 | ; xor ax,ax |
576 | mov ah, 1*16+15 |
309 | ; mov ah, 1*16+15 |
577 | mov cx,70 |
310 | ; mov cx,70 |
578 | mov bp,12 |
311 | ; mov bp,12 |
579 | .loop_start: |
312 | ;.loop_start: |
580 | rep stosw |
313 | ; rep stosw |
581 | mov cx,70 |
314 | ; mov cx,70 |
582 | add di,20 |
315 | ; add di,20 |
583 | dec bp |
316 | ; dec bp |
584 | jns .loop_start |
317 | ; jns .loop_start |
Line 585... | Line 318... | ||
585 | pop es |
318 | ; pop es |
Line 586... | Line 319... | ||
586 | popa |
319 | ; popa |
587 | ret |
320 | ; ret |