VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/BIOS/clext.c@ 37636

Last change on this file since 37636 was 33656, checked in by vboxsync, 14 years ago

*: rebrand Sun (L)GPL disclaimers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 29.0 KB
Line 
1//
2// QEMU Cirrus CLGD 54xx VGABIOS Extension.
3//
4// Copyright (c) 2004 Makoto Suzuki (suzu)
5//
6// This library is free software; you can redistribute it and/or
7// modify it under the terms of the GNU Lesser General Public
8// License as published by the Free Software Foundation; either
9// version 2 of the License, or (at your option) any later version.
10//
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// Lesser General Public License for more details.
15//
16// You should have received a copy of the GNU Lesser General Public
17// License along with this library; if not, write to the Free Software
18// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19//
20
21
22/*
23 * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
24 * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
25 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
26 * a choice of LGPL license versions is made available with the language indicating
27 * that LGPLv2 or any later version may be used, or where a choice of which version
28 * of the LGPL is applied is otherwise unspecified.
29 */
30
31//#define CIRRUS_VESA3_PMINFO
32#ifdef VBE
33#undef CIRRUS_VESA3_PMINFO
34#endif
35
36#define PM_BIOSMEM_CURRENT_MODE 0x449
37#define PM_BIOSMEM_CRTC_ADDRESS 0x463
38#define PM_BIOSMEM_VBE_MODE 0x4BA
39
40typedef struct
41{
42 /* + 0 */
43 unsigned short mode;
44 unsigned short width;
45 unsigned short height;
46 unsigned short depth;
47 /* + 8 */
48 unsigned short hidden_dac; /* 0x3c6 */
49 unsigned short *seq; /* 0x3c4 */
50 unsigned short *graph; /* 0x3ce */
51 unsigned short *crtc; /* 0x3d4 */
52 /* +16 */
53 unsigned char bitsperpixel;
54 unsigned char vesacolortype;
55 unsigned char vesaredmask;
56 unsigned char vesaredpos;
57 unsigned char vesagreenmask;
58 unsigned char vesagreenpos;
59 unsigned char vesabluemask;
60 unsigned char vesabluepos;
61 /* +24 */
62 unsigned char vesareservedmask;
63 unsigned char vesareservedpos;
64} cirrus_mode_t;
65#define CIRRUS_MODE_SIZE 26
66
67
68/* For VESA BIOS 3.0 */
69#define CIRRUS_PM16INFO_SIZE 20
70
71/* VGA */
72unsigned short cseq_vga[] = {0x0007,0xffff};
73unsigned short cgraph_vga[] = {0x0009,0x000a,0x000b,0xffff};
74unsigned short ccrtc_vga[] = {0x001a,0x001b,0x001d,0xffff};
75
76/* extensions */
77unsigned short cgraph_svgacolor[] = {
780x0000,0x0001,0x0002,0x0003,0x0004,0x4005,0x0506,0x0f07,0xff08,
790x0009,0x000a,0x000b,
800xffff
81};
82/* 640x480x8 */
83unsigned short cseq_640x480x8[] = {
840x0300,0x2101,0x0f02,0x0003,0x0e04,0x1107,
850x580b,0x580c,0x580d,0x580e,
860x0412,0x0013,0x2017,
870x331b,0x331c,0x331d,0x331e,
880xffff
89};
90unsigned short ccrtc_640x480x8[] = {
910x2c11,
920x5f00,0x4f01,0x4f02,0x8003,0x5204,0x1e05,0x0b06,0x3e07,
930x4009,0x000c,0x000d,
940xea10,0xdf12,0x5013,0x4014,0xdf15,0x0b16,0xc317,0xff18,
950x001a,0x221b,0x001d,
960xffff
97};
98/* 640x480x16 */
99unsigned short cseq_640x480x16[] = {
1000x0300,0x2101,0x0f02,0x0003,0x0e04,0x1707,
1010x580b,0x580c,0x580d,0x580e,
1020x0412,0x0013,0x2017,
1030x331b,0x331c,0x331d,0x331e,
1040xffff
105};
106unsigned short ccrtc_640x480x16[] = {
1070x2c11,
1080x5f00,0x4f01,0x4f02,0x8003,0x5204,0x1e05,0x0b06,0x3e07,
1090x4009,0x000c,0x000d,
1100xea10,0xdf12,0xa013,0x4014,0xdf15,0x0b16,0xc317,0xff18,
1110x001a,0x221b,0x001d,
1120xffff
113};
114/* 640x480x24 */
115unsigned short cseq_640x480x24[] = {
1160x0300,0x2101,0x0f02,0x0003,0x0e04,0x1507,
1170x580b,0x580c,0x580d,0x580e,
1180x0412,0x0013,0x2017,
1190x331b,0x331c,0x331d,0x331e,
1200xffff
121};
122unsigned short ccrtc_640x480x24[] = {
1230x2c11,
1240x5f00,0x4f01,0x4f02,0x8003,0x5204,0x1e05,0x0b06,0x3e07,
1250x4009,0x000c,0x000d,
1260xea10,0xdf12,0x0013,0x4014,0xdf15,0x0b16,0xc317,0xff18,
1270x001a,0x321b,0x001d,
1280xffff
129};
130/* 800x600x8 */
131unsigned short cseq_800x600x8[] = {
1320x0300,0x2101,0x0f02,0x0003,0x0e04,0x1107,
1330x230b,0x230c,0x230d,0x230e,
1340x0412,0x0013,0x2017,
1350x141b,0x141c,0x141d,0x141e,
1360xffff
137};
138unsigned short ccrtc_800x600x8[] = {
1390x2311,0x7d00,0x6301,0x6302,0x8003,0x6b04,0x1a05,0x9806,0xf007,
1400x6009,0x000c,0x000d,
1410x7d10,0x5712,0x6413,0x4014,0x5715,0x9816,0xc317,0xff18,
1420x001a,0x221b,0x001d,
1430xffff
144};
145/* 800x600x16 */
146unsigned short cseq_800x600x16[] = {
1470x0300,0x2101,0x0f02,0x0003,0x0e04,0x1707,
1480x230b,0x230c,0x230d,0x230e,
1490x0412,0x0013,0x2017,
1500x141b,0x141c,0x141d,0x141e,
1510xffff
152};
153unsigned short ccrtc_800x600x16[] = {
1540x2311,0x7d00,0x6301,0x6302,0x8003,0x6b04,0x1a05,0x9806,0xf007,
1550x6009,0x000c,0x000d,
1560x7d10,0x5712,0xc813,0x4014,0x5715,0x9816,0xc317,0xff18,
1570x001a,0x221b,0x001d,
1580xffff
159};
160/* 800x600x24 */
161unsigned short cseq_800x600x24[] = {
1620x0300,0x2101,0x0f02,0x0003,0x0e04,0x1507,
1630x230b,0x230c,0x230d,0x230e,
1640x0412,0x0013,0x2017,
1650x141b,0x141c,0x141d,0x141e,
1660xffff
167};
168unsigned short ccrtc_800x600x24[] = {
1690x2311,0x7d00,0x6301,0x6302,0x8003,0x6b04,0x1a05,0x9806,0xf007,
1700x6009,0x000c,0x000d,
1710x7d10,0x5712,0x2c13,0x4014,0x5715,0x9816,0xc317,0xff18,
1720x001a,0x321b,0x001d,
1730xffff
174};
175/* 1024x768x8 */
176unsigned short cseq_1024x768x8[] = {
1770x0300,0x2101,0x0f02,0x0003,0x0e04,0x1107,
1780x760b,0x760c,0x760d,0x760e,
1790x0412,0x0013,0x2017,
1800x341b,0x341c,0x341d,0x341e,
1810xffff
182};
183unsigned short ccrtc_1024x768x8[] = {
1840x2911,0xa300,0x7f01,0x7f02,0x8603,0x8304,0x9405,0x2406,0xf507,
1850x6009,0x000c,0x000d,
1860x0310,0xff12,0x8013,0x4014,0xff15,0x2416,0xc317,0xff18,
1870x001a,0x221b,0x001d,
1880xffff
189};
190/* 1024x768x16 */
191unsigned short cseq_1024x768x16[] = {
1920x0300,0x2101,0x0f02,0x0003,0x0e04,0x1707,
1930x760b,0x760c,0x760d,0x760e,
1940x0412,0x0013,0x2017,
1950x341b,0x341c,0x341d,0x341e,
1960xffff
197};
198unsigned short ccrtc_1024x768x16[] = {
1990x2911,0xa300,0x7f01,0x7f02,0x8603,0x8304,0x9405,0x2406,0xf507,
2000x6009,0x000c,0x000d,
2010x0310,0xff12,0x0013,0x4014,0xff15,0x2416,0xc317,0xff18,
2020x001a,0x321b,0x001d,
2030xffff
204};
205/* 1024x768x24 */
206unsigned short cseq_1024x768x24[] = {
2070x0300,0x2101,0x0f02,0x0003,0x0e04,0x1507,
2080x760b,0x760c,0x760d,0x760e,
2090x0412,0x0013,0x2017,
2100x341b,0x341c,0x341d,0x341e,
2110xffff
212};
213unsigned short ccrtc_1024x768x24[] = {
2140x2911,0xa300,0x7f01,0x7f02,0x8603,0x8304,0x9405,0x2406,0xf507,
2150x6009,0x000c,0x000d,
2160x0310,0xff12,0x8013,0x4014,0xff15,0x2416,0xc317,0xff18,
2170x001a,0x321b,0x001d,
2180xffff
219};
220/* 1280x1024x8 */
221unsigned short cseq_1280x1024x8[] = {
2220x0300,0x2101,0x0f02,0x0003,0x0e04,0x1107,
2230x760b,0x760c,0x760d,0x760e,
2240x0412,0x0013,0x2017,
2250x341b,0x341c,0x341d,0x341e,
2260xffff
227};
228unsigned short ccrtc_1280x1024x8[] = {
2290x2911,0xc300,0x9f01,0x9f02,0x8603,0x8304,0x9405,0x2406,0xf707,
2300x6009,0x000c,0x000d,
2310x0310,0xff12,0xa013,0x4014,0xff15,0x2416,0xc317,0xff18,
2320x001a,0x221b,0x001d,
2330xffff
234};
235
236
237cirrus_mode_t cirrus_modes[] =
238{
239 {0x5f,640,480,8,0x00,
240 cseq_640x480x8,cgraph_svgacolor,ccrtc_640x480x8,8,
241 4,0,0,0,0,0,0,0,0},
242 {0x64,640,480,16,0xe1,
243 cseq_640x480x16,cgraph_svgacolor,ccrtc_640x480x16,16,
244 6,5,11,6,5,5,0,0,0},
245 {0x66,640,480,15,0xf0,
246 cseq_640x480x16,cgraph_svgacolor,ccrtc_640x480x16,16,
247 6,5,10,5,5,5,0,1,15},
248 {0x71,640,480,24,0xe5,
249 cseq_640x480x24,cgraph_svgacolor,ccrtc_640x480x24,24,
250 6,8,16,8,8,8,0,0,0},
251
252 {0x5c,800,600,8,0x00,
253 cseq_800x600x8,cgraph_svgacolor,ccrtc_800x600x8,8,
254 4,0,0,0,0,0,0,0,0},
255 {0x65,800,600,16,0xe1,
256 cseq_800x600x16,cgraph_svgacolor,ccrtc_800x600x16,16,
257 6,5,11,6,5,5,0,0,0},
258 {0x67,800,600,15,0xf0,
259 cseq_800x600x16,cgraph_svgacolor,ccrtc_800x600x16,16,
260 6,5,10,5,5,5,0,1,15},
261
262 {0x60,1024,768,8,0x00,
263 cseq_1024x768x8,cgraph_svgacolor,ccrtc_1024x768x8,8,
264 4,0,0,0,0,0,0,0,0},
265 {0x74,1024,768,16,0xe1,
266 cseq_1024x768x16,cgraph_svgacolor,ccrtc_1024x768x16,16,
267 6,5,11,6,5,5,0,0,0},
268 {0x68,1024,768,15,0xf0,
269 cseq_1024x768x16,cgraph_svgacolor,ccrtc_1024x768x16,16,
270 6,5,10,5,5,5,0,1,15},
271
272 {0x78,800,600,24,0xe5,
273 cseq_800x600x24,cgraph_svgacolor,ccrtc_800x600x24,24,
274 6,8,16,8,8,8,0,0,0},
275 {0x79,1024,768,24,0xe5,
276 cseq_1024x768x24,cgraph_svgacolor,ccrtc_1024x768x24,24,
277 6,8,16,8,8,8,0,0,0},
278
279 {0x6d,1280,1024,8,0x00,
280 cseq_1280x1024x8,cgraph_svgacolor,ccrtc_1280x1024x8,8,
281 4,0,0,0,0,0,0,0,0},
282
283 {0xfe,0,0,0,0,cseq_vga,cgraph_vga,ccrtc_vga,0,
284 0xff,0,0,0,0,0,0,0,0},
285 {0xff,0,0,0,0,0,0,0,0,
286 0xff,0,0,0,0,0,0,0,0},
287};
288
289unsigned char cirrus_id_table[] = {
290 // 5430
291 0xA0, 0x32,
292 // 5446
293 0xB8, 0x39,
294
295 0xff, 0xff
296};
297
298
299unsigned short cirrus_vesa_modelist[] = {
300// 640x480x8
301 0x101, 0x5f,
302// 640x480x15
303 0x110, 0x66,
304// 640x480x16
305 0x111, 0x64,
306// 640x480x24
307 0x112, 0x71,
308// 800x600x8
309 0x103, 0x5c,
310// 800x600x15
311 0x113, 0x67,
312// 800x600x16
313 0x114, 0x65,
314// 800x600x24
315 0x115, 0x78,
316// 1024x768x8
317 0x105, 0x60,
318// 1024x768x15
319 0x116, 0x68,
320// 1024x768x16
321 0x117, 0x74,
322// 1024x768x24
323//0x118, 0x79,
324// 1280x1024x8
325 0x107, 0x6d,
326// invalid
327 0xffff,0xffff
328};
329
330
331ASM_START
332
333cirrus_installed:
334.ascii "cirrus-compatible VGA is detected"
335.byte 0x0d,0x0a
336.byte 0x0d,0x0a,0x00
337
338cirrus_not_installed:
339.ascii "cirrus-compatible VGA is not detected"
340.byte 0x0d,0x0a
341.byte 0x0d,0x0a,0x00
342
343cirrus_vesa_vendorname:
344cirrus_vesa_productname:
345cirrus_vesa_oemname:
346.ascii "VGABIOS Cirrus extension"
347.byte 0
348cirrus_vesa_productrevision:
349.ascii "1.0"
350.byte 0
351
352cirrus_init:
353 call cirrus_check
354 jnz no_cirrus
355 SET_INT_VECTOR(0x10, #0xC000, #cirrus_int10_handler)
356 mov al, #0x0f ; memory setup
357 mov dx, #0x3C4
358 out dx, al
359 inc dx
360 in al, dx
361 and al, #0x18
362 mov ah, al
363 mov al, #0x0a
364 dec dx
365 out dx, ax
366 mov ax, #0x0007 ; set vga mode
367 out dx, ax
368 mov ax, #0x0431 ; reset bitblt
369 mov dx, #0x3CE
370 out dx, ax
371 mov ax, #0x0031
372 out dx, ax
373no_cirrus:
374 ret
375
376cirrus_display_info:
377 push ds
378 push si
379 push cs
380 pop ds
381 call cirrus_check
382 mov si, #cirrus_not_installed
383 jnz cirrus_msgnotinstalled
384 mov si, #cirrus_installed
385
386cirrus_msgnotinstalled:
387 call _display_string
388 pop si
389 pop ds
390 ret
391
392cirrus_check:
393 push ax
394 push dx
395 mov ax, #0x9206
396 mov dx, #0x3C4
397 out dx, ax
398 inc dx
399 in al, dx
400 cmp al, #0x12
401 pop dx
402 pop ax
403 ret
404
405
406cirrus_int10_handler:
407 pushf
408 push bp
409 cmp ah, #0x00 ;; set video mode
410 jz cirrus_set_video_mode
411 cmp ah, #0x12 ;; cirrus extension
412 jz cirrus_extbios
413 cmp ah, #0x4F ;; VESA extension
414 jz cirrus_vesa
415
416cirrus_unhandled:
417 pop bp
418 popf
419 jmp vgabios_int10_handler
420
421cirrus_return:
422#ifdef CIRRUS_DEBUG
423 call cirrus_debug_dump
424#endif
425 pop bp
426 popf
427 iret
428
429cirrus_set_video_mode:
430#ifdef CIRRUS_DEBUG
431 call cirrus_debug_dump
432#endif
433 push si
434 push ax
435 push bx
436 push ds
437#ifdef CIRRUS_VESA3_PMINFO
438 db 0x2e ;; cs:
439 mov si, [cirrus_vesa_sel0000_data]
440#else
441 xor si, si
442#endif
443 mov ds, si
444 xor bx, bx
445 mov [PM_BIOSMEM_VBE_MODE], bx
446 pop ds
447 pop bx
448 call cirrus_get_modeentry
449 jnc cirrus_set_video_mode_extended
450 mov al, #0xfe
451 call cirrus_get_modeentry_nomask
452 call cirrus_switch_mode
453 pop ax
454 pop si
455 jmp cirrus_unhandled
456
457cirrus_extbios:
458#ifdef CIRRUS_DEBUG
459 call cirrus_debug_dump
460#endif
461 cmp bl, #0x80
462 jb cirrus_unhandled
463 cmp bl, #0xAF
464 ja cirrus_unhandled
465 push bx
466 and bx, #0x7F
467 shl bx, 1
468 db 0x2e ;; cs:
469 mov bp, cirrus_extbios_handlers[bx]
470 pop bx
471 push #cirrus_return
472 push bp
473 ret
474
475cirrus_vesa:
476#ifdef CIRRUS_DEBUG
477 call cirrus_debug_dump
478#endif
479 cmp al, #0x0F
480 ja cirrus_vesa_not_handled
481 push bx
482 xor bx, bx
483 mov bl, al
484 shl bx, 1
485 db 0x2e ;; cs:
486 mov bp, cirrus_vesa_handlers[bx]
487 pop bx
488 push #cirrus_return
489 push bp
490 ret
491
492cirrus_vesa_not_handled:
493 mov ax, #0x014F ;; not implemented
494 jmp cirrus_return
495
496#ifdef CIRRUS_DEBUG
497cirrus_debug_dump:
498 push es
499 push ds
500 pusha
501 push cs
502 pop ds
503 call _cirrus_debugmsg
504 popa
505 pop ds
506 pop es
507 ret
508#endif
509
510cirrus_set_video_mode_extended:
511 call cirrus_switch_mode
512 pop ax ;; mode
513 and al, #0x7f
514
515 push ds
516#ifdef CIRRUS_VESA3_PMINFO
517 db 0x2e ;; cs:
518 mov si, [cirrus_vesa_sel0000_data]
519#else
520 xor si, si
521#endif
522 mov ds, si
523 mov [PM_BIOSMEM_CURRENT_MODE], al
524 pop ds
525
526 mov al, #0x20
527
528 pop si
529 jmp cirrus_return
530
531cirrus_vesa_pmbios_init:
532 retf
533cirrus_vesa_pmbios_entry:
534 pushf
535 push bp
536 cmp ah, #0x4F
537 jnz cirrus_vesa_pmbios_unimplemented
538 cmp al, #0x0F
539 ja cirrus_vesa_pmbios_unimplemented
540 push bx
541 xor bx, bx
542 mov bl, al
543 shl bx, 1
544 db 0x2e ;; cs:
545 mov bp, cirrus_vesa_handlers[bx]
546 pop bx
547 push #cirrus_vesa_pmbios_return
548 push bp
549 ret
550cirrus_vesa_pmbios_unimplemented:
551 mov ax, #0x014F
552cirrus_vesa_pmbios_return:
553 pop bp
554 popf
555 retf
556
557; in si:mode table
558cirrus_switch_mode:
559 push ds
560 push bx
561 push dx
562 push cs
563 pop ds
564
565 mov bx, [si+10] ;; seq
566 mov dx, #0x3c4
567 mov ax, #0x1206
568 out dx, ax ;; Unlock cirrus special
569 call cirrus_switch_mode_setregs
570
571 mov bx, [si+12] ;; graph
572 mov dx, #0x3ce
573 call cirrus_switch_mode_setregs
574
575 mov bx, [si+14] ;; crtc
576 call cirrus_get_crtc
577 call cirrus_switch_mode_setregs
578
579 mov dx, #0x3c6
580 mov al, #0x00
581 out dx, al
582 in al, dx
583 in al, dx
584 in al, dx
585 in al, dx
586 mov al, [si+8] ;; hidden dac
587 out dx, al
588 mov al, #0xff
589 out dx, al
590
591 mov al, #0x00
592 mov bl, [si+17] ;; memory model
593 or bl, bl
594 jz is_text_mode
595 mov al, #0x01
596 cmp bl, #0x03
597 jnz is_text_mode
598 or al, #0x40
599is_text_mode:
600 mov bl, #0x10
601 call biosfn_get_single_palette_reg
602 and bh, #0xfe
603 or bh, al
604 call biosfn_set_single_palette_reg
605
606 pop dx
607 pop bx
608 pop ds
609 ret
610
611cirrus_enable_16k_granularity:
612 push ax
613 push dx
614 mov dx, #0x3ce
615 mov al, #0x0b
616 out dx, al
617 inc dx
618 in al, dx
619 or al, #0x20 ;; enable 16k
620 out dx, al
621 pop dx
622 pop ax
623 ret
624
625cirrus_switch_mode_setregs:
626csms_1:
627 mov ax, [bx]
628 cmp ax, #0xffff
629 jz csms_2
630 out dx, ax
631 add bx, #0x2
632 jmp csms_1
633csms_2:
634 ret
635
636cirrus_extbios_80h:
637 push dx
638 call cirrus_get_crtc
639 mov al, #0x27
640 out dx, al
641 inc dx
642 in al, dx
643 mov bx, #_cirrus_id_table
644c80h_1:
645 db 0x2e ;; cs:
646 mov ah, [bx]
647 cmp ah, al
648 jz c80h_2
649 cmp ah, #0xff
650 jz c80h_2
651 inc bx
652 inc bx
653 jmp c80h_1
654c80h_2:
655 db 0x2e ;; cs:
656 mov al, 0x1[bx]
657 pop dx
658 mov ah, #0x00
659 xor bx, bx
660 ret
661
662cirrus_extbios_81h:
663 mov ax, #0x100 ;; XXX
664 ret
665cirrus_extbios_82h:
666 push dx
667 call cirrus_get_crtc
668 xor ax, ax
669 mov al, #0x27
670 out dx, al
671 inc dx
672 in al, dx
673 and al, #0x03
674 mov ah, #0xAF
675 pop dx
676 ret
677
678cirrus_extbios_85h:
679 push cx
680 push dx
681 mov dx, #0x3C4
682 mov al, #0x0f ;; get DRAM band width
683 out dx, al
684 inc dx
685 in al, dx
686 ;; al = 4 << bandwidth
687 mov cl, al
688 shr cl, #0x03
689 and cl, #0x03
690 cmp cl, #0x03
691 je c85h2
692 mov al, #0x04
693 shl al, cl
694 jmp c85h3
695c85h2:
696;; 4MB or 2MB
697 and al, #0x80
698 mov al, #0x20 ;; 2 MB
699 je c85h3
700 mov al, #0x40 ;; 4 MB
701c85h3:
702 pop dx
703 pop cx
704 ret
705
706cirrus_extbios_9Ah:
707 mov ax, #0x4060
708 mov cx, #0x1132
709 ret
710
711cirrus_extbios_A0h:
712 call cirrus_get_modeentry
713 mov ah, #0x01
714 sbb ah, #0x00
715 mov bx, cirrus_extbios_A0h_callback
716 mov si, #0xffff
717 mov di, bx
718 mov ds, bx
719 mov es, bx
720 ret
721
722cirrus_extbios_A0h_callback:
723 ;; fatal: not implemented yet
724 cli
725 hlt
726 retf
727
728cirrus_extbios_A1h:
729 mov bx, #0x0E00 ;; IBM 8512/8513, color
730 ret
731
732cirrus_extbios_A2h:
733 mov al, #0x07 ;; HSync 31.5 - 64.0 kHz
734 ret
735
736cirrus_extbios_AEh:
737 mov al, #0x01 ;; High Refresh 75Hz
738 ret
739
740cirrus_extbios_unimplemented:
741 ret
742
743cirrus_vesa_00h:
744 push ds
745 push si
746 mov bp, di
747 push es
748 pop ds
749 cld
750 mov ax, [di]
751 cmp ax, #0x4256 ;; VB
752 jnz cv00_1
753 mov ax, [di+2]
754 cmp ax, #0x3245 ;; E2
755 jnz cv00_1
756 ;; VBE2
757 lea di, 0x14[bp]
758 mov ax, #0x0100 ;; soft ver.
759 stosw
760 mov ax, # cirrus_vesa_vendorname
761 stosw
762 mov ax, cs
763 stosw
764 mov ax, # cirrus_vesa_productname
765 stosw
766 mov ax, cs
767 stosw
768 mov ax, # cirrus_vesa_productrevision
769 stosw
770 mov ax, cs
771 stosw
772cv00_1:
773 mov di, bp
774 mov ax, #0x4556 ;; VE
775 stosw
776 mov ax, #0x4153 ;; SA
777 stosw
778 mov ax, #0x0200 ;; v2.00
779 stosw
780 mov ax, # cirrus_vesa_oemname
781 stosw
782 mov ax, cs
783 stosw
784 xor ax, ax ;; caps
785 stosw
786 stosw
787 lea ax, 0x40[bp]
788 stosw
789 mov ax, es
790 stosw
791 call cirrus_extbios_85h ;; vram in 64k
792 mov ah, #0x00
793 stosw
794
795 push cs
796 pop ds
797 lea di, 0x40[bp]
798 mov si, #_cirrus_vesa_modelist
799cv00_2:
800 lodsw
801 stosw
802 add si, #2
803 cmp ax, #0xffff
804 jnz cv00_2
805
806 mov ax, #0x004F
807 mov di, bp
808 pop si
809 pop ds
810 ret
811
812cirrus_vesa_01h:
813 mov ax, cx
814 and ax, #0x3fff
815 call cirrus_vesamode_to_mode
816 cmp ax, #0xffff
817 jnz cirrus_vesa_01h_1
818 jmp cirrus_vesa_unimplemented
819cirrus_vesa_01h_1:
820 push ds
821 push si
822 push cx
823 push dx
824 push bx
825 mov bp, di
826 cld
827 push cs
828 pop ds
829 call cirrus_get_modeentry_nomask
830
831 push di
832 xor ax, ax
833 mov cx, #0x80
834 rep
835 stosw ;; clear buffer
836 pop di
837
838 mov ax, #0x003b ;; mode
839 stosw
840 mov ax, #0x0007 ;; attr
841 stosw
842 mov ax, #0x0010 ;; granularity =16K
843 stosw
844 mov ax, #0x0040 ;; size =64K
845 stosw
846 mov ax, #0xA000 ;; segment A
847 stosw
848 xor ax, ax ;; no segment B
849 stosw
850 mov ax, #cirrus_vesa_05h_farentry
851 stosw
852 mov ax, cs
853 stosw
854 call cirrus_get_line_offset_entry
855 stosw ;; bytes per scan line
856 mov ax, [si+2] ;; width
857 stosw
858 mov ax, [si+4] ;; height
859 stosw
860 mov ax, #0x08
861 stosb
862 mov ax, #0x10
863 stosb
864 mov al, #1 ;; count of planes
865 stosb
866 mov al, [si+6] ;; bpp
867 stosb
868 mov al, #0x1 ;; XXX number of banks
869 stosb
870 mov al, [si+17]
871 stosb ;; memory model
872 mov al, #0x0 ;; XXX size of bank in K
873 stosb
874 call cirrus_get_line_offset_entry
875 mov bx, [si+4]
876 mul bx ;; dx:ax=vramdisp
877 or ax, ax
878 jz cirrus_vesa_01h_3
879 inc dx
880cirrus_vesa_01h_3:
881 call cirrus_extbios_85h ;; al=vram in 64k
882 mov ah, #0x00
883 mov cx, dx
884 xor dx, dx
885 div cx
886 dec ax
887 stosb ;; number of image pages = vramtotal/vramdisp-1
888 mov al, #0x00
889 stosb
890
891 ;; v1.2+ stuffs
892 push si
893 add si, #18
894 movsw
895 movsw
896 movsw
897 movsw
898 pop si
899
900 mov ah, [si+16]
901 mov al, #0x0
902 sub ah, #9
903 rcl al, #1 ; bit 0=palette flag
904 stosb ;; direct screen mode info
905
906 ;; v2.0+ stuffs
907 ;; 32-bit LFB address
908 xor ax, ax
909 stosw
910 call cirrus_get_lfb_addr
911 stosw
912 or ax, ax
913 jz cirrus_vesa_01h_4
914 push di
915 mov di, bp
916 db 0x26 ;; es:
917 mov ax, [di]
918 or ax, #0x0080 ;; mode bit 7:LFB
919 stosw
920 pop di
921cirrus_vesa_01h_4:
922
923 xor ax, ax
924 stosw ; reserved
925 stosw ; reserved
926 stosw ; reserved
927
928 mov ax, #0x004F
929 mov di, bp
930 pop bx
931 pop dx
932 pop cx
933 pop si
934 pop ds
935
936 test cx, #0x4000 ;; LFB flag
937 jz cirrus_vesa_01h_5
938 push cx
939 db 0x26 ;; es:
940 mov cx, [di]
941 cmp cx, #0x0080 ;; is LFB supported?
942 jnz cirrus_vesa_01h_6
943 mov ax, #0x014F ;; error - no LFB
944cirrus_vesa_01h_6:
945 pop cx
946cirrus_vesa_01h_5:
947 ret
948
949cirrus_vesa_02h:
950 ;; XXX support CRTC registers
951 test bx, #0x3e00
952 jnz cirrus_vesa_02h_2 ;; unknown flags
953 mov ax, bx
954 and ax, #0x1ff ;; bit 8-0 mode
955 cmp ax, #0x100 ;; legacy VGA mode
956 jb cirrus_vesa_02h_legacy
957 call cirrus_vesamode_to_mode
958 cmp ax, #0xffff
959 jnz cirrus_vesa_02h_1
960cirrus_vesa_02h_2:
961 jmp cirrus_vesa_unimplemented
962cirrus_vesa_02h_legacy:
963#ifdef CIRRUS_VESA3_PMINFO
964 db 0x2e ;; cs:
965 cmp byte ptr [cirrus_vesa_is_protected_mode], #0
966 jnz cirrus_vesa_02h_2
967#endif // CIRRUS_VESA3_PMINFO
968 int #0x10
969 mov ax, #0x004F
970 ret
971cirrus_vesa_02h_1:
972 push si
973 push ax
974 call cirrus_get_modeentry_nomask
975 call cirrus_switch_mode
976 test bx, #0x4000 ;; LFB
977 jnz cirrus_vesa_02h_3
978 call cirrus_enable_16k_granularity
979cirrus_vesa_02h_3:
980 pop ax
981 push ds
982#ifdef CIRRUS_VESA3_PMINFO
983 db 0x2e ;; cs:
984 mov si, [cirrus_vesa_sel0000_data]
985#else
986 xor si, si
987#endif
988 mov ds, si
989 mov [PM_BIOSMEM_CURRENT_MODE], al
990 mov [PM_BIOSMEM_VBE_MODE], bx
991 pop ds
992 pop si
993 mov ax, #0x004F
994 ret
995
996cirrus_vesa_03h:
997 push ds
998#ifdef CIRRUS_VESA3_PMINFO
999 db 0x2e ;; cs:
1000 mov ax, [cirrus_vesa_sel0000_data]
1001#else
1002 xor ax, ax
1003#endif
1004 mov ds, ax
1005 mov bx, # PM_BIOSMEM_VBE_MODE
1006 mov ax, [bx]
1007 mov bx, ax
1008 test bx, bx
1009 jnz cirrus_vesa_03h_1
1010 mov bx, # PM_BIOSMEM_CURRENT_MODE
1011 mov al, [bx]
1012 mov bl, al
1013 xor bh, bh
1014cirrus_vesa_03h_1:
1015 mov ax, #0x004f
1016 pop ds
1017 ret
1018
1019cirrus_vesa_05h_farentry:
1020 call cirrus_vesa_05h
1021 retf
1022
1023cirrus_vesa_05h:
1024 cmp bl, #0x01
1025 ja cirrus_vesa_05h_1
1026 cmp bh, #0x00
1027 jz cirrus_vesa_05h_setmempage
1028 cmp bh, #0x01
1029 jz cirrus_vesa_05h_getmempage
1030cirrus_vesa_05h_1:
1031 jmp cirrus_vesa_unimplemented
1032cirrus_vesa_05h_setmempage:
1033 or dh, dh ; address must be < 0x100
1034 jnz cirrus_vesa_05h_1
1035 push dx
1036 mov al, bl ;; bl=bank number
1037 add al, #0x09
1038 mov ah, dl ;; dx=window address in granularity
1039 mov dx, #0x3ce
1040 out dx, ax
1041 pop dx
1042 mov ax, #0x004F
1043 ret
1044cirrus_vesa_05h_getmempage:
1045 mov al, bl ;; bl=bank number
1046 add al, #0x09
1047 mov dx, #0x3ce
1048 out dx, al
1049 inc dx
1050 in al, dx
1051 xor dx, dx
1052 mov dl, al ;; dx=window address in granularity
1053 mov ax, #0x004F
1054 ret
1055
1056cirrus_vesa_06h:
1057 mov ax, cx
1058 cmp bl, #0x01
1059 je cirrus_vesa_06h_3
1060 cmp bl, #0x02
1061 je cirrus_vesa_06h_2
1062 jb cirrus_vesa_06h_1
1063 mov ax, #0x0100
1064 ret
1065cirrus_vesa_06h_1:
1066 call cirrus_get_bpp_bytes
1067 mov bl, al
1068 xor bh, bh
1069 mov ax, cx
1070 mul bx
1071cirrus_vesa_06h_2:
1072 call cirrus_set_line_offset
1073cirrus_vesa_06h_3:
1074 call cirrus_get_bpp_bytes
1075 mov bl, al
1076 xor bh, bh
1077 xor dx, dx
1078 call cirrus_get_line_offset
1079 push ax
1080 div bx
1081 mov cx, ax
1082 pop bx
1083 call cirrus_extbios_85h ;; al=vram in 64k
1084 xor dx, dx
1085 mov dl, al
1086 xor ax, ax
1087 div bx
1088 mov dx, ax
1089 mov ax, #0x004f
1090 ret
1091
1092cirrus_vesa_07h:
1093 cmp bl, #0x80
1094 je cirrus_vesa_07h_1
1095 cmp bl, #0x01
1096 je cirrus_vesa_07h_2
1097 jb cirrus_vesa_07h_1
1098 mov ax, #0x0100
1099 ret
1100cirrus_vesa_07h_1:
1101 push dx
1102 call cirrus_get_bpp_bytes
1103 mov bl, al
1104 xor bh, bh
1105 mov ax, cx
1106 mul bx
1107 pop bx
1108 push ax
1109 call cirrus_get_line_offset
1110 mul bx
1111 pop bx
1112 add ax, bx
1113 jnc cirrus_vesa_07h_3
1114 inc dx
1115cirrus_vesa_07h_3:
1116 push dx
1117 and dx, #0x0003
1118 mov bx, #0x04
1119 div bx
1120 pop dx
1121 shr dx, #2
1122 call cirrus_set_start_addr
1123 mov ax, #0x004f
1124 ret
1125cirrus_vesa_07h_2:
1126 call cirrus_get_start_addr
1127 shl dx, #2
1128 push dx
1129 mov bx, #0x04
1130 mul bx
1131 pop bx
1132 or dx, bx
1133 push ax
1134 call cirrus_get_line_offset
1135 mov bx, ax
1136 pop ax
1137 div bx
1138 push ax
1139 push dx
1140 call cirrus_get_bpp_bytes
1141 mov bl, al
1142 xor bh, bh
1143 pop ax
1144 xor dx, dx
1145 div bx
1146 mov cx, ax
1147 pop dx
1148 mov ax, #0x004f
1149 ret
1150
1151cirrus_vesa_unimplemented:
1152 mov ax, #0x014F ;; not implemented
1153 ret
1154
1155
1156;; in ax:vesamode, out ax:cirrusmode
1157cirrus_vesamode_to_mode:
1158 push ds
1159 push cx
1160 push si
1161 push cs
1162 pop ds
1163 mov cx, #0xffff
1164 mov si, #_cirrus_vesa_modelist
1165cvtm_1:
1166 cmp [si],ax
1167 jz cvtm_2
1168 cmp [si],cx
1169 jz cvtm_2
1170 add si, #4
1171 jmp cvtm_1
1172cvtm_2:
1173 mov ax,[si+2]
1174 pop si
1175 pop cx
1176 pop ds
1177 ret
1178
1179 ; cirrus_get_crtc
1180 ;; NOTE - may be called in protected mode
1181cirrus_get_crtc:
1182 push ds
1183 push ax
1184 mov dx, #0x3cc
1185 in al, dx
1186 and al, #0x01
1187 shl al, #5
1188 mov dx, #0x3b4
1189 add dl, al
1190 pop ax
1191 pop ds
1192 ret
1193
1194;; in - al:mode, out - cflag:result, si:table, ax:destroyed
1195cirrus_get_modeentry:
1196 and al, #0x7f
1197cirrus_get_modeentry_nomask:
1198 mov si, #_cirrus_modes
1199cgm_1:
1200 db 0x2e ;; cs:
1201 mov ah, [si]
1202 cmp al, ah
1203 jz cgm_2
1204 cmp ah, #0xff
1205 jz cgm_4
1206 add si, # CIRRUS_MODE_SIZE
1207 jmp cgm_1
1208cgm_4:
1209 xor si, si
1210 stc ;; video mode is not supported
1211 jmp cgm_3
1212cgm_2:
1213 clc ;; video mode is supported
1214cgm_3:
1215 ret
1216
1217 ; get LFB address
1218 ; out - ax:LFB address (high 16 bit)
1219 ;; NOTE - may be called in protected mode
1220cirrus_get_lfb_addr:
1221 push cx
1222 push dx
1223 push eax
1224 xor cx, cx
1225 mov dl, #0x00
1226 call cirrus_pci_read
1227 cmp ax, #0xffff
1228 jz cirrus_get_lfb_addr_5
1229 cirrus_get_lfb_addr_3:
1230 mov dl, #0x00
1231 call cirrus_pci_read
1232 cmp ax, #0x1013 ;; cirrus
1233 jz cirrus_get_lfb_addr_4
1234 add cx, #0x8
1235 cmp cx, #0x200 ;; search bus #0 and #1
1236 jb cirrus_get_lfb_addr_3
1237 cirrus_get_lfb_addr_5:
1238 xor dx, dx ;; no LFB
1239 jmp cirrus_get_lfb_addr_6
1240 cirrus_get_lfb_addr_4:
1241 mov dl, #0x10 ;; I/O space #0
1242 call cirrus_pci_read
1243 test ax, #0xfff1
1244 jnz cirrus_get_lfb_addr_5
1245 shr eax, #16
1246 mov dx, ax ;; LFB address
1247 cirrus_get_lfb_addr_6:
1248 pop eax
1249 mov ax, dx
1250 pop dx
1251 pop cx
1252 ret
1253
1254cirrus_pci_read:
1255 mov eax, #0x00800000
1256 mov ax, cx
1257 shl eax, #8
1258 mov al, dl
1259 mov dx, #0xcf8
1260 out dx, eax
1261 add dl, #4
1262 in eax, dx
1263 ret
1264
1265;; out - al:bytes per pixel
1266cirrus_get_bpp_bytes:
1267 push dx
1268 mov dx, #0x03c4
1269 mov al, #0x07
1270 out dx, al
1271 inc dx
1272 in al, dx
1273 and al, #0x0e
1274 cmp al, #0x06
1275 jne cirrus_get_bpp_bytes_1
1276 and al, #0x02
1277cirrus_get_bpp_bytes_1:
1278 shr al, #1
1279 cmp al, #0x04
1280 je cirrus_get_bpp_bytes_2
1281 inc al
1282cirrus_get_bpp_bytes_2:
1283 pop dx
1284 ret
1285
1286;; in - ax: new line offset
1287cirrus_set_line_offset:
1288 shr ax, #3
1289 push ax
1290 call cirrus_get_crtc
1291 mov al, #0x13
1292 out dx, al
1293 inc dx
1294 pop ax
1295 out dx, al
1296 dec dx
1297 mov al, #0x1b
1298 out dx, al
1299 inc dx
1300 shl ah, #4
1301 in al, dx
1302 and al, #0xef ; @@@AH 20040817 a hex marker was missing
1303 or al, ah
1304 out dx, al
1305 ret
1306
1307;; out - ax: active line offset
1308cirrus_get_line_offset:
1309 push dx
1310 push bx
1311 call cirrus_get_crtc
1312 mov al, #0x13
1313 out dx, al
1314 inc dx
1315 in al, dx
1316 mov bl, al
1317 dec dx
1318 mov al, #0x1b
1319 out dx, al
1320 inc dx
1321 in al, dx
1322 mov ah, al
1323 shr ah, #4
1324 and ah, #0x01
1325 mov al, bl
1326 shl ax, #3
1327 pop bx
1328 pop dx
1329 ret
1330
1331;; in - si: table
1332;; out - ax: line offset for mode
1333cirrus_get_line_offset_entry:
1334 push bx
1335 mov bx, [si+14] ;; crtc table
1336 push bx
1337offset_loop1:
1338 mov ax, [bx]
1339 cmp al, #0x13
1340 je offset_found1
1341 inc bx
1342 inc bx
1343 jnz offset_loop1
1344offset_found1:
1345 xor al, al
1346 shr ax, #5
1347 pop bx
1348 push ax
1349offset_loop2:
1350 mov ax, [bx]
1351 cmp al, #0x1b
1352 je offset_found2
1353 inc bx
1354 inc bx
1355 jnz offset_loop2
1356offset_found2:
1357 pop bx
1358 and ax, #0x1000
1359 shr ax, #1
1360 or ax, bx
1361 pop bx
1362 ret
1363
1364;; in - new address in DX:AX
1365cirrus_set_start_addr:
1366 push bx
1367 push dx
1368 push ax
1369 call cirrus_get_crtc
1370 mov al, #0x0d
1371 out dx, al
1372 inc dx
1373 pop ax
1374 out dx, al
1375 dec dx
1376 mov al, #0x0c
1377 out dx, al
1378 inc dx
1379 mov al, ah
1380 out dx, al
1381 dec dx
1382 mov al, #0x1d
1383 out dx, al
1384 inc dx
1385 in al, dx
1386 and al, #0x7f
1387 pop bx
1388 mov ah, bl
1389 shl bl, #4
1390 and bl, #0x80
1391 or al, bl
1392 out dx, al
1393 dec dx
1394 mov bl, ah
1395 and ah, #0x01
1396 shl bl, #1
1397 and bl, #0x0c
1398 or ah, bl
1399 mov al, #0x1b
1400 out dx, al
1401 inc dx
1402 in al, dx
1403 and al, #0xf2
1404 or al, ah
1405 out dx, al
1406 pop bx
1407 ret
1408
1409;; out - current address in DX:AX
1410cirrus_get_start_addr:
1411 push bx
1412 call cirrus_get_crtc
1413 mov al, #0x0c
1414 out dx, al
1415 inc dx
1416 in al, dx
1417 mov ah, al
1418 dec dx
1419 mov al, #0x0d
1420 out dx, al
1421 inc dx
1422 in al, dx
1423 push ax
1424 dec dx
1425 mov al, #0x1b
1426 out dx, al
1427 inc dx
1428 in al, dx
1429 dec dx
1430 mov bl, al
1431 and al, #0x01
1432 and bl, #0x0c
1433 shr bl, #1
1434 or bl, al
1435 mov al, #0x1d
1436 out dx, al
1437 inc dx
1438 in al, dx
1439 and al, #0x80
1440 shr al, #4
1441 or bl, al
1442 mov dl, bl
1443 xor dh, dh
1444 pop ax
1445 pop bx
1446 ret
1447
1448cirrus_extbios_handlers:
1449 ;; 80h
1450 dw cirrus_extbios_80h
1451 dw cirrus_extbios_81h
1452 dw cirrus_extbios_82h
1453 dw cirrus_extbios_unimplemented
1454 ;; 84h
1455 dw cirrus_extbios_unimplemented
1456 dw cirrus_extbios_85h
1457 dw cirrus_extbios_unimplemented
1458 dw cirrus_extbios_unimplemented
1459 ;; 88h
1460 dw cirrus_extbios_unimplemented
1461 dw cirrus_extbios_unimplemented
1462 dw cirrus_extbios_unimplemented
1463 dw cirrus_extbios_unimplemented
1464 ;; 8Ch
1465 dw cirrus_extbios_unimplemented
1466 dw cirrus_extbios_unimplemented
1467 dw cirrus_extbios_unimplemented
1468 dw cirrus_extbios_unimplemented
1469 ;; 90h
1470 dw cirrus_extbios_unimplemented
1471 dw cirrus_extbios_unimplemented
1472 dw cirrus_extbios_unimplemented
1473 dw cirrus_extbios_unimplemented
1474 ;; 94h
1475 dw cirrus_extbios_unimplemented
1476 dw cirrus_extbios_unimplemented
1477 dw cirrus_extbios_unimplemented
1478 dw cirrus_extbios_unimplemented
1479 ;; 98h
1480 dw cirrus_extbios_unimplemented
1481 dw cirrus_extbios_unimplemented
1482 dw cirrus_extbios_9Ah
1483 dw cirrus_extbios_unimplemented
1484 ;; 9Ch
1485 dw cirrus_extbios_unimplemented
1486 dw cirrus_extbios_unimplemented
1487 dw cirrus_extbios_unimplemented
1488 dw cirrus_extbios_unimplemented
1489 ;; A0h
1490 dw cirrus_extbios_A0h
1491 dw cirrus_extbios_A1h
1492 dw cirrus_extbios_A2h
1493 dw cirrus_extbios_unimplemented
1494 ;; A4h
1495 dw cirrus_extbios_unimplemented
1496 dw cirrus_extbios_unimplemented
1497 dw cirrus_extbios_unimplemented
1498 dw cirrus_extbios_unimplemented
1499 ;; A8h
1500 dw cirrus_extbios_unimplemented
1501 dw cirrus_extbios_unimplemented
1502 dw cirrus_extbios_unimplemented
1503 dw cirrus_extbios_unimplemented
1504 ;; ACh
1505 dw cirrus_extbios_unimplemented
1506 dw cirrus_extbios_unimplemented
1507 dw cirrus_extbios_AEh
1508 dw cirrus_extbios_unimplemented
1509
1510cirrus_vesa_handlers:
1511 ;; 00h
1512 dw cirrus_vesa_00h
1513 dw cirrus_vesa_01h
1514 dw cirrus_vesa_02h
1515 dw cirrus_vesa_03h
1516 ;; 04h
1517 dw cirrus_vesa_unimplemented
1518 dw cirrus_vesa_05h
1519 dw cirrus_vesa_06h
1520 dw cirrus_vesa_07h
1521 ;; 08h
1522 dw cirrus_vesa_unimplemented
1523 dw cirrus_vesa_unimplemented
1524 dw cirrus_vesa_unimplemented
1525 dw cirrus_vesa_unimplemented
1526 ;; 0Ch
1527 dw cirrus_vesa_unimplemented
1528 dw cirrus_vesa_unimplemented
1529 dw cirrus_vesa_unimplemented
1530 dw cirrus_vesa_unimplemented
1531
1532
1533
1534ASM_END
1535
1536#ifdef CIRRUS_VESA3_PMINFO
1537ASM_START
1538cirrus_vesa_pminfo:
1539 /* + 0 */
1540 .byte 0x50,0x4d,0x49,0x44 ;; signature[4]
1541 /* + 4 */
1542 dw cirrus_vesa_pmbios_entry ;; entry_bios
1543 dw cirrus_vesa_pmbios_init ;; entry_init
1544 /* + 8 */
1545cirrus_vesa_sel0000_data:
1546 dw 0x0000 ;; sel_00000
1547cirrus_vesa_selA000_data:
1548 dw 0xA000 ;; sel_A0000
1549 /* +12 */
1550cirrus_vesa_selB000_data:
1551 dw 0xB000 ;; sel_B0000
1552cirrus_vesa_selB800_data:
1553 dw 0xB800 ;; sel_B8000
1554 /* +16 */
1555cirrus_vesa_selC000_data:
1556 dw 0xC000 ;; sel_C0000
1557cirrus_vesa_is_protected_mode:
1558 ;; protected mode flag and checksum
1559 dw (~((0xf2 + (cirrus_vesa_pmbios_entry >> 8) + (cirrus_vesa_pmbios_entry) \
1560 + (cirrus_vesa_pmbios_init >> 8) + (cirrus_vesa_pmbios_init)) & 0xff) << 8) + 0x01
1561ASM_END
1562#endif // CIRRUS_VESA3_PMINFO
1563
1564
1565#ifdef CIRRUS_DEBUG
1566static void cirrus_debugmsg(DI, SI, BP, SP, BX, DX, CX, AX, DS, ES, FLAGS)
1567 Bit16u DI, SI, BP, SP, BX, DX, CX, AX, ES, DS, FLAGS;
1568{
1569 if((GET_AH()!=0x0E)&&(GET_AH()!=0x02)&&(GET_AH()!=0x09)&&(AX!=0x4F05))
1570 printf("vgabios call ah%02x al%02x bx%04x cx%04x dx%04x\n",GET_AH(),GET_AL(),BX,CX,DX);
1571}
1572#endif
Note: See TracBrowser for help on using the repository browser.

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