VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/BIOS-new/vgarom.asm@ 43257

最後變更 在這個檔案從43257是 43152,由 vboxsync 提交於 13 年 前

VGABIOS: Allow building with DEBUG_VGA again.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 19.9 KB
 
1;; ============================================================================================
2;;
3;; Copyright (C) 2001,2002 the LGPL VGABios developers Team
4;;
5;; This library is free software; you can redistribute it and/or
6;; modify it under the terms of the GNU Lesser General Public
7;; License as published by the Free Software Foundation; either
8;; version 2 of the License, or (at your option) any later version.
9;;
10;; This library is distributed in the hope that it will be useful,
11;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13;; Lesser General Public License for more details.
14;;
15;; You should have received a copy of the GNU Lesser General Public
16;; License along with this library; if not, write to the Free Software
17;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18;;
19;; ============================================================================================
20;;
21;; This VGA Bios is specific to the plex86/bochs Emulated VGA card.
22;; You can NOT drive any physical vga card with it.
23;;
24;; ============================================================================================
25;;
26
27
28; Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
29; other than GPL or LGPL is available it will apply instead, Oracle elects to use only
30; the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
31; a choice of LGPL license versions is made available with the language indicating
32; that LGPLv2 or any later version may be used, or where a choice of which version
33; of the LGPL is applied is otherwise unspecified.
34
35include vgadefs.inc
36
37public vgabios_int10_handler
38
39VGAROM segment public 'CODE'
40
41; Implemented in C
42extrn _int10_func:near
43extrn _vgabios_init_func:near
44
45ifdef VBE
46; Implemented in separate assembly module
47extrn vbe_biosfn_return_current_mode:near
48extrn vbe_biosfn_display_window_control:near
49extrn vbe_biosfn_set_get_logical_scan_line_length:near
50extrn vbe_biosfn_set_get_display_start:near
51extrn vbe_biosfn_set_get_dac_palette_format:near
52extrn vbe_biosfn_set_get_palette_data:near
53extrn vbe_biosfn_return_protected_mode_interface:near
54endif
55
56ifdef VGA_DEBUG
57extrn _int10_debugmsg:near
58extrn _printf:near
59extrn _unimplemented:near
60extrn _unknown:near
61endif
62
63vgabios_start:
64
65db 055h, 0AAh ; ROM signature, required for expansion ROMs
66db 40h ; ROM module length in units of 512 bytes */
67
68
69vgabios_entry_point:
70
71 jmp _vgabios_init_func
72
73 org 1Eh
74
75 db 'IBM',0
76
77;;
78;; int10 handled here
79;;
80
81.286
82
83vgabios_int10_handler:
84 pushf
85ifdef VGA_DEBUG
86 push es
87 push ds
88 pusha
89 mov bx, 0C000h
90 mov ds, bx
91 call _int10_debugmsg
92 popa
93 pop ds
94 pop es
95endif
96 cmp ah, 0Fh
97 jne int10_test_1A
98 call biosfn_get_video_mode
99 jmp int10_end
100int10_test_1A:
101 cmp ah, 1Ah
102 jne int10_test_0B
103 call biosfn_group_1A
104 jmp int10_end
105int10_test_0B:
106 cmp ah, 0Bh
107 jne int10_test_1103
108 call biosfn_group_0B
109 jmp int10_end
110int10_test_1103:
111 cmp ax, 1103h
112 jne int10_test_12
113 call biosfn_set_text_block_specifier
114 jmp int10_end
115int10_test_12:
116 cmp ah, 12h
117 jne int10_test_101B
118 cmp bl, 10h
119 jne int10_test_BL30
120 call biosfn_get_ega_info
121 jmp int10_end
122int10_test_BL30:
123 cmp bl, 30h
124 jne int10_test_BL31
125 call biosfn_select_vert_res
126 jmp int10_end
127int10_test_BL31:
128 cmp bl, 31h
129 jne int10_test_BL32
130 call biosfn_enable_default_palette_loading
131 jmp int10_end
132int10_test_BL32:
133 cmp bl, 32h
134 jne int10_test_BL33
135 call biosfn_enable_video_addressing
136 jmp int10_end
137int10_test_BL33:
138 cmp bl, 33h
139 jne int10_test_BL34
140 call biosfn_enable_grayscale_summing
141 jmp int10_end
142int10_test_BL34:
143 cmp bl, 34h
144 jne int10_normal
145 call biosfn_enable_cursor_emulation
146 jmp int10_end
147int10_test_101B:
148 cmp ax, 101Bh
149 je int10_normal
150 cmp ah, 10h
151ifndef VBE
152 jne int10_normal
153else
154 jne int10_test_4F
155endif
156 call biosfn_group_10
157 jmp int10_end
158ifdef VBE
159int10_test_4F:
160 cmp ah, 4Fh
161 jne int10_normal
162 cmp al, 3
163 jne int10_test_vbe_05
164 call vbe_biosfn_return_current_mode
165 jmp int10_end
166int10_test_vbe_05:
167 cmp al, 5
168 jne int10_test_vbe_06
169 call vbe_biosfn_display_window_control
170 jmp int10_end
171int10_test_vbe_06:
172 cmp al, 6
173 jne int10_test_vbe_07
174 call vbe_biosfn_set_get_logical_scan_line_length
175 jmp int10_end
176int10_test_vbe_07:
177 cmp al, 7
178 jne int10_test_vbe_08
179 call vbe_biosfn_set_get_display_start
180 jmp int10_end
181int10_test_vbe_08:
182 cmp al, 8
183 jne int10_test_vbe_09
184 call vbe_biosfn_set_get_dac_palette_format
185 jmp int10_end
186int10_test_vbe_09:
187 cmp al, 9
188 jne int10_test_vbe_0A
189 call vbe_biosfn_set_get_palette_data
190 jmp int10_end
191int10_test_vbe_0A:
192 cmp al, 0Ah
193 jne int10_normal
194 call vbe_biosfn_return_protected_mode_interface
195 jmp int10_end
196endif
197
198int10_normal:
199 push es
200 push ds
201 pusha
202
203;; We have to set ds to access the right data segment
204 mov bx, 0C000h
205 mov ds, bx
206 call _int10_func
207
208 popa
209 pop ds
210 pop es
211int10_end:
212 popf
213 iret
214
215;;--------------------------------------------------------------------------------------------
216
217biosfn_group_0B:
218 cmp bh, 0
219 je biosfn_set_border_color
220 cmp bh, 1
221 je biosfn_set_palette
222ifdef VGA_DEBUG
223 call _unknown
224endif
225 ret
226biosfn_set_border_color:
227 push ax
228 push bx
229 push cx
230 push dx
231 mov dx, VGAREG_ACTL_RESET
232 in al, dx
233 mov dx, VGAREG_ACTL_ADDRESS
234 mov al, 00h
235 out dx, al
236 mov al, bl
237 and al, 0Fh
238 test al, 08h
239 jz set_low_border
240 add al, 08h
241set_low_border:
242 out dx, al
243 mov cl, 1
244 and bl, 10h
245set_intensity_loop:
246 mov dx, VGAREG_ACTL_ADDRESS
247 mov al, cl
248 out dx, al
249 mov dx, VGAREG_ACTL_READ_DATA
250 in al, dx
251 and al, 0EFh
252 or al, bl
253 mov dx, VGAREG_ACTL_ADDRESS
254 out dx, al
255 inc cl
256 cmp cl, 4
257 jne set_intensity_loop
258 mov al, 20h
259 out dx, al
260ifdef VBOX
261 mov dx, VGAREG_ACTL_RESET
262 in al, dx
263endif ; VBOX
264 pop dx
265 pop cx
266 pop bx
267 pop ax
268 ret
269biosfn_set_palette:
270 push ax
271 push bx
272 push cx
273 push dx
274 mov dx, VGAREG_ACTL_RESET
275 in al, dx
276 mov cl, 01
277 and bl, 01
278set_cga_palette_loop:
279 mov dx, VGAREG_ACTL_ADDRESS
280 mov al, cl
281 out dx, al
282 mov dx, VGAREG_ACTL_READ_DATA
283 in al, dx
284 and al, 0FEh
285 or al, bl
286 mov dx, VGAREG_ACTL_ADDRESS
287 out dx, al
288 inc cl
289 cmp cl, 4
290 jne set_cga_palette_loop
291 mov al, 20h
292 out dx, al
293ifdef VBOX
294 mov dx, VGAREG_ACTL_RESET
295 in al, dx
296endif ; VBOX
297 pop dx
298 pop cx
299 pop bx
300 pop ax
301 ret
302
303;;--------------------------------------------------------------------------------------------
304
305biosfn_get_video_mode:
306 push ds
307 mov ax, BIOSMEM_SEG
308 mov ds, ax
309 push bx
310 mov bx, BIOSMEM_CURRENT_PAGE
311 mov al, [bx]
312 pop bx
313 mov bh, al
314 push bx
315 mov bx, BIOSMEM_VIDEO_CTL
316 mov ah, [bx]
317 and ah, 80h
318 mov bx, BIOSMEM_CURRENT_MODE
319 mov al, [bx]
320 or al, ah
321 mov bx, BIOSMEM_NB_COLS
322 mov ah, [bx]
323 pop bx
324 pop ds
325 ret
326
327;--------------------------------------------------------------------------------------------
328
329biosfn_group_10:
330 cmp al, 0
331 jne int10_test_1001
332 jmp biosfn_set_single_palette_reg
333int10_test_1001:
334 cmp al, 1
335 jne int10_test_1002
336 jmp biosfn_set_overscan_border_color
337int10_test_1002:
338 cmp al, 2
339 jne int10_test_1003
340 jmp biosfn_set_all_palette_reg
341int10_test_1003:
342 cmp al, 3
343 jne int10_test_1007
344 jmp biosfn_toggle_intensity
345int10_test_1007:
346 cmp al, 7
347 jne int10_test_1008
348 jmp biosfn_get_single_palette_reg
349int10_test_1008:
350 cmp al, 8
351 jne int10_test_1009
352 jmp biosfn_read_overscan_border_color
353int10_test_1009:
354 cmp al, 9
355 jne int10_test_1010
356 jmp biosfn_get_all_palette_reg
357int10_test_1010:
358 cmp al, 10h
359 jne int10_test_1012
360 jmp biosfn_set_single_dac_reg
361int10_test_1012:
362 cmp al, 12h
363 jne int10_test_1013
364 jmp biosfn_set_all_dac_reg
365int10_test_1013:
366 cmp al, 13h
367 jne int10_test_1015
368 jmp biosfn_select_video_dac_color_page
369int10_test_1015:
370 cmp al, 15h
371 jne int10_test_1017
372 jmp biosfn_read_single_dac_reg
373int10_test_1017:
374 cmp al, 17h
375 jne int10_test_1018
376 jmp biosfn_read_all_dac_reg
377int10_test_1018:
378 cmp al, 18h
379 jne int10_test_1019
380 jmp biosfn_set_pel_mask
381int10_test_1019:
382 cmp al, 19h
383 jne int10_test_101A
384 jmp biosfn_read_pel_mask
385int10_test_101A:
386 cmp al, 1Ah
387 jne int10_group_10_unknown
388 jmp biosfn_read_video_dac_state
389int10_group_10_unknown:
390ifdef VGA_DEBUG
391 call _unknown
392endif
393 ret
394
395biosfn_set_single_palette_reg:
396 cmp bl, 14h
397 ja no_actl_reg1
398 push ax
399 push dx
400 mov dx, VGAREG_ACTL_RESET
401 in al, dx
402 mov dx, VGAREG_ACTL_ADDRESS
403 mov al, bl
404 out dx, al
405 mov al, bh
406 out dx, al
407 mov al, 20h
408 out dx, al
409ifdef VBOX
410 mov dx, VGAREG_ACTL_RESET
411 in al, dx
412endif ; VBOX
413 pop dx
414 pop ax
415no_actl_reg1:
416 ret
417
418;--------------------------------------------------------------------------------------------
419
420biosfn_set_overscan_border_color:
421 push bx
422 mov bl, 11h
423 call biosfn_set_single_palette_reg
424 pop bx
425 ret
426
427;--------------------------------------------------------------------------------------------
428
429biosfn_set_all_palette_reg:
430 push ax
431 push bx
432 push cx
433 push dx
434 mov bx, dx
435 mov dx, VGAREG_ACTL_RESET
436 in al, dx
437 mov cl, 0
438 mov dx, VGAREG_ACTL_ADDRESS
439set_palette_loop:
440 mov al, cl
441 out dx, al
442 mov al, es:[bx]
443 out dx, al
444 inc bx
445 inc cl
446 cmp cl, 10h
447 jne set_palette_loop
448 mov al, 11h
449 out dx, al
450 mov al, es:[bx]
451 out dx, al
452 mov al, 20h
453 out dx, al
454ifdef VBOX
455 mov dx, VGAREG_ACTL_RESET
456 in al, dx
457endif ; VBOX
458 pop dx
459 pop cx
460 pop bx
461 pop ax
462 ret
463
464;;--------------------------------------------------------------------------------------------
465
466biosfn_toggle_intensity:
467 push ax
468 push bx
469 push dx
470 mov dx, VGAREG_ACTL_RESET
471 in al, dx
472 mov dx, VGAREG_ACTL_ADDRESS
473 mov al, 10h
474 out dx, al
475 mov dx, VGAREG_ACTL_READ_DATA
476 in al, dx
477 and al, 0F7h
478 and bl, 01
479 shl bl, 3
480 or al, bl
481 mov dx, VGAREG_ACTL_ADDRESS
482 out dx, al
483 mov al, 20h
484 out dx, al
485ifdef VBOX
486 mov dx, VGAREG_ACTL_RESET
487 in al, dx
488endif ; VBOX
489 pop dx
490 pop bx
491 pop ax
492 ret
493
494;;--------------------------------------------------------------------------------------------
495
496biosfn_get_single_palette_reg:
497 cmp bl, 14h
498 ja no_actl_reg2
499 push ax
500 push dx
501 mov dx, VGAREG_ACTL_RESET
502 in al, dx
503 mov dx, VGAREG_ACTL_ADDRESS
504 mov al, bl
505 out dx, al
506 mov dx, VGAREG_ACTL_READ_DATA
507 in al, dx
508 mov bh, al
509 mov dx, VGAREG_ACTL_RESET
510 in al, dx
511 mov dx, VGAREG_ACTL_ADDRESS
512 mov al, 20h
513 out dx, al
514ifdef VBOX
515 mov dx, VGAREG_ACTL_RESET
516 in al, dx
517endif ; VBOX
518 pop dx
519 pop ax
520no_actl_reg2:
521 ret
522
523;;--------------------------------------------------------------------------------------------
524
525biosfn_read_overscan_border_color:
526 push ax
527 push bx
528 mov bl, 11h
529 call biosfn_get_single_palette_reg
530 mov al, bh
531 pop bx
532 mov bh, al
533 pop ax
534 ret
535
536;;--------------------------------------------------------------------------------------------
537
538biosfn_get_all_palette_reg:
539 push ax
540 push bx
541 push cx
542 push dx
543 mov bx, dx
544 mov cl, 0
545get_palette_loop:
546 mov dx, VGAREG_ACTL_RESET
547 in al, dx
548 mov dx, VGAREG_ACTL_ADDRESS
549 mov al, cl
550 out dx, al
551 mov dx, VGAREG_ACTL_READ_DATA
552 in al, dx
553 mov es:[bx], al
554 inc bx
555 inc cl
556 cmp cl, 10h
557 jne get_palette_loop
558 mov dx, VGAREG_ACTL_RESET
559 in al, dx
560 mov dx, VGAREG_ACTL_ADDRESS
561 mov al, 11h
562 out dx, al
563 mov dx, VGAREG_ACTL_READ_DATA
564 in al, dx
565 mov es:[bx], al
566 mov dx, VGAREG_ACTL_RESET
567 in al, dx
568 mov dx, VGAREG_ACTL_ADDRESS
569 mov al, 20h
570 out dx, al
571ifdef VBOX
572 mov dx, VGAREG_ACTL_RESET
573 in al, dx
574endif ; VBOX
575 pop dx
576 pop cx
577 pop bx
578 pop ax
579 ret
580
581;;--------------------------------------------------------------------------------------------
582
583biosfn_set_single_dac_reg:
584 push ax
585 push dx
586 mov dx, VGAREG_DAC_WRITE_ADDRESS
587 mov al, bl
588 out dx, al
589 mov dx, VGAREG_DAC_DATA
590 pop ax
591 push ax
592 mov al, ah
593 out dx, al
594 mov al, ch
595 out dx, al
596 mov al, cl
597 out dx, al
598 pop dx
599 pop ax
600 ret
601
602;;--------------------------------------------------------------------------------------------
603
604biosfn_set_all_dac_reg:
605 push ax
606 push bx
607 push cx
608 push dx
609 mov dx, VGAREG_DAC_WRITE_ADDRESS
610 mov al, bl
611 out dx, al
612 pop dx
613 push dx
614 mov bx, dx
615 mov dx, VGAREG_DAC_DATA
616set_dac_loop:
617 mov al, es:[bx]
618 out dx, al
619 inc bx
620 mov al, es:[bx]
621 out dx, al
622 inc bx
623 mov al, es:[bx]
624 out dx, al
625 inc bx
626 dec cx
627 jnz set_dac_loop
628 pop dx
629 pop cx
630 pop bx
631 pop ax
632 ret
633
634;;--------------------------------------------------------------------------------------------
635
636biosfn_select_video_dac_color_page:
637 push ax
638 push bx
639 push dx
640 mov dx, VGAREG_ACTL_RESET
641 in al, dx
642 mov dx, VGAREG_ACTL_ADDRESS
643 mov al, 10h
644 out dx, al
645 mov dx, VGAREG_ACTL_READ_DATA
646 in al, dx
647 and bl, 01
648 jnz set_dac_page
649 and al, 07Fh
650 shl bh, 7
651 or al, bh
652 mov dx, VGAREG_ACTL_ADDRESS
653 out dx, al
654 jmp set_actl_normal
655set_dac_page:
656 push ax
657 mov dx, VGAREG_ACTL_RESET
658 in al, dx
659 mov dx, VGAREG_ACTL_ADDRESS
660 mov al, 14h
661 out dx, al
662 pop ax
663 and al, 80h
664 jnz set_dac_16_page
665 shl bh, 2
666set_dac_16_page:
667 and bh, 0Fh
668 mov al, bh
669 out dx, al
670set_actl_normal:
671 mov al, 20h
672 out dx, al
673ifdef VBOX
674 mov dx, VGAREG_ACTL_RESET
675 in al, dx
676endif ; VBOX
677 pop dx
678 pop bx
679 pop ax
680 ret
681
682;;--------------------------------------------------------------------------------------------
683
684biosfn_read_single_dac_reg:
685 push ax
686 push dx
687 mov dx, VGAREG_DAC_READ_ADDRESS
688 mov al, bl
689 out dx, al
690 pop ax
691 mov ah, al
692 mov dx, VGAREG_DAC_DATA
693 in al, dx
694 xchg al, ah
695 push ax
696 in al, dx
697 mov ch, al
698 in al, dx
699 mov cl, al
700 pop dx
701 pop ax
702 ret
703
704;;--------------------------------------------------------------------------------------------
705
706biosfn_read_all_dac_reg:
707 push ax
708 push bx
709 push cx
710 push dx
711 mov dx, VGAREG_DAC_READ_ADDRESS
712 mov al, bl
713 out dx, al
714 pop dx
715 push dx
716 mov bx, dx
717 mov dx, VGAREG_DAC_DATA
718read_dac_loop:
719 in al, dx
720 mov es:[bx], al
721 inc bx
722 in al, dx
723 mov es:[bx], al
724 inc bx
725 in al, dx
726 mov es:[bx], al
727 inc bx
728 dec cx
729 jnz read_dac_loop
730 pop dx
731 pop cx
732 pop bx
733 pop ax
734 ret
735
736;;--------------------------------------------------------------------------------------------
737
738biosfn_set_pel_mask:
739 push ax
740 push dx
741 mov dx, VGAREG_PEL_MASK
742 mov al, bl
743 out dx, al
744 pop dx
745 pop ax
746 ret
747
748;;--------------------------------------------------------------------------------------------
749
750biosfn_read_pel_mask:
751 push ax
752 push dx
753 mov dx, VGAREG_PEL_MASK
754 in al, dx
755 mov bl, al
756 pop dx
757 pop ax
758 ret
759
760;;--------------------------------------------------------------------------------------------
761
762biosfn_read_video_dac_state:
763 push ax
764 push dx
765 mov dx, VGAREG_ACTL_RESET
766 in al, dx
767 mov dx, VGAREG_ACTL_ADDRESS
768 mov al, 10h
769 out dx, al
770 mov dx, VGAREG_ACTL_READ_DATA
771 in al, dx
772 mov bl, al
773 shr bl, 7
774 mov dx, VGAREG_ACTL_RESET
775 in al, dx
776 mov dx, VGAREG_ACTL_ADDRESS
777 mov al, 14h
778 out dx, al
779 mov dx, VGAREG_ACTL_READ_DATA
780 in al, dx
781 mov bh, al
782 and bh, 0Fh
783 test bl, 01
784 jnz get_dac_16_page
785 shr bh, 2
786get_dac_16_page:
787 mov dx, VGAREG_ACTL_RESET
788 in al, dx
789 mov dx, VGAREG_ACTL_ADDRESS
790 mov al, 20h
791 out dx, al
792ifdef VBOX
793 mov dx, VGAREG_ACTL_RESET
794 in al, dx
795endif ; VBOX
796 pop dx
797 pop ax
798 ret
799
800;;--------------------------------------------------------------------------------------------
801
802biosfn_set_text_block_specifier:
803 push ax
804 push dx
805 mov dx, VGAREG_SEQU_ADDRESS
806 mov ah, bl
807 mov al, 03
808 out dx, ax
809 pop dx
810 pop ax
811 ret
812
813;;--------------------------------------------------------------------------------------------
814
815biosfn_get_ega_info:
816 push ds
817 push ax
818 mov ax, BIOSMEM_SEG
819 mov ds, ax
820 xor ch, ch
821 mov bx, BIOSMEM_SWITCHES
822 mov cl, [bx]
823 and cl, 0Fh
824 mov bx, BIOSMEM_CRTC_ADDRESS
825 mov ax, [bx]
826 mov bx, 0003h
827 cmp ax, VGAREG_MDA_CRTC_ADDRESS
828 jne mode_ega_color
829 mov bh, 01
830mode_ega_color:
831 pop ax
832 pop ds
833 ret
834
835;;--------------------------------------------------------------------------------------------
836
837biosfn_select_vert_res:
838
839; res : 00 200 lines, 01 350 lines, 02 400 lines
840
841 push ds
842 push bx
843 push dx
844 mov dl, al
845 mov ax, BIOSMEM_SEG
846 mov ds, ax
847 mov bx, BIOSMEM_MODESET_CTL
848 mov al, [bx]
849 mov bx, BIOSMEM_SWITCHES
850 mov ah, [bx]
851 cmp dl, 1
852 je vert_res_350
853 jb vert_res_200
854 cmp dl, 2
855 je vert_res_400
856ifdef VGA_DEBUG
857 mov al, dl
858 xor ah, ah
859 push ax
860 mov bx, msg_vert_res
861 push bx
862 call _printf
863 add sp, 4
864endif
865 jmp set_retcode
866vert_res_400:
867
868 ; reset modeset ctl bit 7 and set bit 4
869 ; set switches bit 3-0 to 09
870
871 and al, 07Fh
872 or al, 010h
873 and ah, 0F0h
874 or ah, 009h
875 jnz set_vert_res
876vert_res_350:
877
878 ; reset modeset ctl bit 7 and bit 4
879 ; set switches bit 3-0 to 09
880
881 and al, 06Fh
882 and ah, 0F0h
883 or ah, 009h
884 jnz set_vert_res
885vert_res_200:
886
887 ; set modeset ctl bit 7 and reset bit 4
888 ; set switches bit 3-0 to 08
889
890 and al, 0EFh
891 or al, 080h
892 and ah, 0F0h
893 or ah, 008h
894set_vert_res:
895 mov bx, BIOSMEM_MODESET_CTL
896 mov [bx], al
897 mov bx, BIOSMEM_SWITCHES
898 mov [bx], ah
899set_retcode:
900 mov ax, 1212h
901 pop dx
902 pop bx
903 pop ds
904 ret
905
906ifdef VGA_DEBUG
907msg_vert_res:
908db "Select vert res (%02x) was discarded", 13, 10, 0
909endif
910
911
912biosfn_enable_default_palette_loading:
913 push ds
914 push bx
915 push dx
916 mov dl, al
917 and dl, 01
918 shl dl, 3
919 mov ax, BIOSMEM_SEG
920 mov ds, ax
921 mov bx, BIOSMEM_MODESET_CTL
922 mov al, [bx]
923 and al, 0F7h
924 or al, dl
925 mov [bx], al
926 mov ax, 1212h
927 pop dx
928 pop bx
929 pop ds
930 ret
931
932
933biosfn_enable_video_addressing:
934 push bx
935 push dx
936 mov bl, al
937 and bl, 01
938 xor bl, 01
939 shl bl, 1
940 mov dx, VGAREG_READ_MISC_OUTPUT
941 in al, dx
942 and al, 0FDh
943 or al, bl
944 mov dx, VGAREG_WRITE_MISC_OUTPUT
945 out dx, al
946 mov ax, 1212h
947 pop dx
948 pop bx
949 ret
950
951
952biosfn_enable_grayscale_summing:
953 push ds
954 push bx
955 push dx
956 mov dl, al
957 and dl, 01h
958 xor dl, 01h
959 shl dl, 1
960 mov ax, BIOSMEM_SEG
961 mov ds, ax
962 mov bx, BIOSMEM_MODESET_CTL
963 mov al, [bx]
964 and al, 0FDh
965 or al, dl
966 mov [bx], al
967 mov ax, 1212h
968 pop dx
969 pop bx
970 pop ds
971 ret
972
973
974biosfn_enable_cursor_emulation:
975 push ds
976 push bx
977 push dx
978 mov dl, al
979 and dl, 01
980 xor dl, 01
981 mov ax, BIOSMEM_SEG
982 mov ds, ax
983 mov bx, BIOSMEM_MODESET_CTL
984 mov al, [bx]
985 and al, 0FEh
986 or al, dl
987 mov [bx], al
988 mov ax, 1212h
989 pop dx
990 pop bx
991 pop ds
992 ret
993
994;;--------------------------------------------------------------------------------------------
995
996biosfn_group_1A:
997 cmp al, 0
998 je biosfn_read_display_code
999 cmp al, 1
1000 je biosfn_set_display_code
1001ifdef VGA_DEBUG
1002 call _unknown
1003endif
1004 ret
1005biosfn_read_display_code:
1006 push ds
1007 push ax
1008 mov ax, BIOSMEM_SEG
1009 mov ds, ax
1010 mov bx, BIOSMEM_DCC_INDEX
1011 mov al, [bx]
1012 mov bl, al
1013 xor bh, bh
1014 pop ax
1015 mov al, ah
1016 pop ds
1017 ret
1018biosfn_set_display_code:
1019 push ds
1020 push ax
1021 push bx
1022 mov ax, BIOSMEM_SEG
1023 mov ds, ax
1024 mov ax, bx
1025 mov bx, BIOSMEM_DCC_INDEX
1026 mov [bx], al
1027ifdef VGA_DEBUG
1028 mov al, ah
1029 xor ah, ah
1030 push ax
1031 mov bx, msg_alt_dcc
1032 push bx
1033 call _printf
1034 add sp, 4
1035endif
1036 pop bx
1037 pop ax
1038 mov al, ah
1039 pop ds
1040 ret
1041
1042ifdef VGA_DEBUG
1043msg_alt_dcc:
1044db "Alternate Display code (%02x) was discarded", 13, 10, 0
1045endif
1046
1047VGAROM ends
1048
1049 end
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette