VirtualBox

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

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

Devices/Graphics/BIOS-new: adjust licence comments to the default style

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

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