ReactOS 0.4.16-dev-258-g81860b4
vbe.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: GPLv2+ - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: subsystems/mvdm/ntvdm/bios/bios32/vbe.c
5 * PURPOSE: VDM VESA BIOS Extensions (for the Cirrus CL-GD5434 emulated card)
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include "ntvdm.h"
12
13#define NDEBUG
14#include <debug.h>
15
16#include "emulator.h"
17#include "cpu/cpu.h"
18#include "bios32p.h"
19#include "hardware/video/svga.h"
20
21#include "vbe.h"
22
23#include "io.h"
24
25/* PRIVATE VARIABLES **********************************************************/
26
28{
29 /* Attributes */
32 // | VBE_MODE_BIOS_SUPPORT
35
36 /* Window A attributes */
38 /* Window B attributes */
39 0,
40
41 16, /* Window granularity, in KB */
42 64, /* Window size, in KB */
43 0xA000, /* Window A segment, or zero if not supported */
44 0x0000, /* Window B segment, or zero if not supported */
45 0x00000000, /* Window position function pointer */
46 640, /* Bytes per scanline */
47 640, /* Width */
48 480, /* Height */
49 8, /* Character cell width */
50 16, /* Character cell height */
51 1, /* Number of memory planes */
52 8, /* Bits per pixel */
53 1, /* Number of banks */
54 VBE_MODEL_PACKED, /* Memory model */
55 0, /* Bank size */
56 11, /* Number of image pages */
57 0, /* Reserved field */
58 0, /* Red mask size */
59 0, /* Red field position */
60 0, /* Green mask size */
61 0, /* Green field position */
62 0, /* Blue mask size */
63 0, /* Blue field position */
64 0, /* Reserved mask size */
65 0, /* Reserved field position */
66 0, /* Direct color info */
67};
68
70{
71 /* Miscellaneous Register */
72 0x63,
73
74 /* Hidden Register */
75 0x00,
76
77 /* Sequencer Registers */
78 {
79 0x03, 0x21, 0x0F, 0x00, 0x0E, 0x00, 0x12, 0x11, 0x00, 0x00, 0x18, 0x58,
80 0x58, 0x58, 0x58, 0x98, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x20,
81 0x00, 0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x2D
82 },
83
84 /* CRTC Registers */
85 {
86 0x5F, 0x4F, 0x4F, 0x80, 0x52, 0x1E, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00,
87 0x00, 0x00, 0x00, 0x00, 0xEA, 0x2C, 0xDF, 0x50, 0x40, 0xDF, 0x0B, 0xC3,
88 0xFF, 0x00, 0x00, 0x22, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF,
89 0x80, 0x00, 0x20, 0xB8
90 },
91
92 /* GC Registers */
93 {
94 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, 0x00, 0x00, 0x20,
95 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
96 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
97 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
98 0x00, 0x00, 0x00, 0x00
99 },
100
101 /* AC Registers */
102 {
103 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
104 0x0C, 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00
105 }
106};
107
109{
110 /* Attributes */
113 // | VBE_MODE_BIOS_SUPPORT
116
117 /* Window A attributes */
119 /* Window B attributes */
120 0,
121
122 16, /* Window granularity, in KB */
123 64, /* Window size, in KB */
124 0xA000, /* Window A segment, or zero if not supported */
125 0x0000, /* Window B segment, or zero if not supported */
126 0x00000000, /* Window position function pointer */
127 800, /* Bytes per scanline */
128 800, /* Width */
129 600, /* Height */
130 8, /* Character cell width */
131 16, /* Character cell height */
132 1, /* Number of memory planes */
133 8, /* Bits per pixel */
134 1, /* Number of banks */
135 VBE_MODEL_PACKED, /* Memory model */
136 0, /* Bank size */
137 7, /* Number of image pages */
138 0, /* Reserved field */
139 0, /* Red mask size */
140 0, /* Red field position */
141 0, /* Green mask size */
142 0, /* Green field position */
143 0, /* Blue mask size */
144 0, /* Blue field position */
145 0, /* Reserved mask size */
146 0, /* Reserved field position */
147 0, /* Direct color info */
148};
149
151{
152 /* Miscellaneous Register */
153 0x63,
154
155 /* Hidden Register */
156 0x00,
157
158 /* Sequencer Registers */
159 {
160 0x03, 0x21, 0x0F, 0x00, 0x0E, 0x00, 0x12, 0x11, 0x00, 0x00, 0x18, 0x23,
161 0x23, 0x23, 0x23, 0x98, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x20,
162 0x00, 0x00, 0x00, 0x14, 0x14, 0x14, 0x14, 0x2D
163 },
164
165 /* CRTC Registers */
166 {
167 0x7D, 0x63, 0x63, 0x80, 0x6B, 0x1A, 0x98, 0xF0, 0x00, 0x60, 0x00, 0x00,
168 0x00, 0x00, 0x00, 0x00, 0x7D, 0x23, 0x57, 0x64, 0x40, 0x57, 0x98, 0xC3,
169 0xFF, 0x00, 0x00, 0x22, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF,
170 0x80, 0x00, 0x20, 0xB8
171 },
172
173 /* GC Registers */
174 {
175 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, 0x00, 0x00, 0x20,
176 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
177 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
178 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
179 0x00, 0x00, 0x00, 0x00
180 },
181
182 /* AC Registers */
183 {
184 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
185 0x0C, 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00
186 }
187};
188
190{
191 { 0x14, 0xFFFF, NULL , NULL /* TODO */ },
192 { 0x54, 0x10A , NULL /* TODO */ , NULL /* TODO */ },
193 { 0x55, 0x109 , NULL /* TODO */ , NULL /* TODO */ },
194 { 0x58, 0x102 , NULL /* TODO */ , NULL /* TODO */ },
196 { 0x5D, 0x104 , NULL /* TODO */ , NULL /* TODO */ },
197 { 0x5E, 0x100 , NULL /* TODO */ , NULL /* TODO */ },
199 { 0x60, 0x105 , NULL /* TODO */ , NULL /* TODO */ },
200 { 0x64, 0x111 , NULL /* TODO */ , NULL /* TODO */ },
201 { 0x65, 0x114 , NULL /* TODO */ , NULL /* TODO */ },
202 { 0x66, 0x110 , NULL /* TODO */ , NULL /* TODO */ },
203 { 0x67, 0x113 , NULL /* TODO */ , NULL /* TODO */ },
204 { 0x68, 0x116 , NULL /* TODO */ , NULL /* TODO */ },
205 { 0x69, 0x119 , NULL /* TODO */ , NULL /* TODO */ },
206 { 0x6C, 0x106 , NULL /* TODO */ , NULL /* TODO */ },
207 { 0x6D, 0x107 , NULL /* TODO */ , NULL /* TODO */ },
208 { 0x71, 0x112 , NULL /* TODO */ , NULL /* TODO */ },
209 { 0x72, 0xFFFF, NULL , NULL /* TODO */ },
210 { 0x73, 0xFFFF, NULL , NULL /* TODO */ },
211 { 0x74, 0x117 , NULL /* TODO */ , NULL /* TODO */ },
212 { 0x75, 0x11A , NULL /* TODO */ , NULL /* TODO */ },
213 { 0x76, 0xFFFF, NULL , NULL /* TODO */ },
214 { 0x78, 0x115 , NULL /* TODO */ , NULL /* TODO */ },
215 { 0x79, 0x118 , NULL /* TODO */ , NULL /* TODO */ },
216};
217
218/* PRIVATE FUNCTIONS **********************************************************/
219
221{
222 INT i;
223
224 Number &= 0x1FF;
225
226 /* Find the mode */
227 for (i = 0; i < VBE_MODE_COUNT; i++)
228 {
229 if ((!(Number & 0x100) && (Number == Modes[i].Number))
230 || ((Number & 0x100) && (Number== Modes[i].VesaNumber)))
231 {
232 return &Modes[i];
233 }
234 }
235
236 return NULL;
237}
238
239/* This function is based on VgaSetRegisters in vidbios.c */
241{
242 UINT i;
243
244 /* Disable interrupts */
245 BOOLEAN Interrupts = getIF();
246 setIF(0);
247
248 /*
249 * Set the CRT base address according to the selected mode,
250 * monochrome or color. The following macros:
251 * VGA_INSTAT1_READ, VGA_CRTC_INDEX and VGA_CRTC_DATA are then
252 * used to access the correct VGA I/O ports.
253 */
254 Bda->CrtBasePort = (Registers->Misc & 0x01) ? VGA_CRTC_INDEX_COLOR
256 /* Bit 1 indicates whether display is color (0) or monochrome (1) */
257 Bda->VGAOptions = (Bda->VGAOptions & 0xFD) | (!(Registers->Misc & 0x01) << 1);
258 Bda->CrtModeControl = (Bda->CrtModeControl & 0xFB) | (!(Registers->Misc & 0x01) << 1);
259
260 /* Update blink bit in BDA */
262 Bda->CrtModeControl |= (1 << 5);
263 else
264 Bda->CrtModeControl &= ~(1 << 5);
265
266 /* Turn the video off */
269
270 /* Write the misc register */
271 IOWriteB(VGA_MISC_WRITE, Registers->Misc);
272
273 /* Synchronous reset on */
276
277 /* Write the sequencer registers */
278 for (i = 1; i < SVGA_SEQ_MAX_REG; i++)
279 {
281 {
283 IOWriteB(VGA_SEQ_DATA , Registers->Sequencer[i]);
284 }
285 }
286
287 /* Synchronous reset off */
290
291 /* Unlock CRTC registers 0-7 */
296 // Make sure they remain unlocked
297 Registers->CRT[VGA_CRTC_END_HORZ_BLANKING_REG] |= 0x80;
298 Registers->CRT[VGA_CRTC_END_VERT_RETRACE_REG] &= ~0x80;
299
300 /* Write the CRTC registers */
301 for (i = 0; i < SVGA_CRTC_MAX_REG; i++)
302 {
303 if ((i < SVGA_CRTC_UNUSED0_REG || i > SVGA_CRTC_UNUSED6_REG) && i != SVGA_CRTC_UNUSED7_REG)
304 {
306 IOWriteB(VGA_CRTC_DATA , Registers->CRT[i]);
307 }
308 }
309
310 /* Write the GC registers */
311 for (i = 0; i < SVGA_GC_MAX_REG; i++)
312 {
314 && (i < SVGA_GC_UNUSED1_REG || i > SVGA_GC_UNUSED10_REG))
315 {
317 IOWriteB(VGA_GC_DATA , Registers->Graphics[i]);
318 }
319 }
320
321 /* Write the AC registers */
322 for (i = 0; i < VGA_AC_MAX_REG; i++)
323 {
324 /* Write the index */
325 IOReadB(VGA_INSTAT1_READ); // Put the AC register into index state
327
328 /* Write the data */
329 IOWriteB(VGA_AC_WRITE, Registers->Attribute[i]);
330 }
331
332 /* Perform 4 dummy reads from the DAC mask to access the hidden register */
333 for (i = 0; i < 4; i++) IOReadB(VGA_DAC_MASK);
334
335 /* Set the hidden register */
336 IOWriteB(VGA_DAC_MASK, Registers->Hidden);
337
338 /* Set the PEL mask */
339 IOWriteB(VGA_DAC_MASK, 0xFF);
340
341 /* Enable screen and disable palette access */
342 IOReadB(VGA_INSTAT1_READ); // Put the AC register into index state
343 IOWriteB(VGA_AC_INDEX, 0x20);
344
345 /* Turn the video on */
348
349 /* Restore interrupts */
350 setIF(Interrupts);
351}
352
353
354/* PUBLIC FUNCTIONS ***********************************************************/
355
357{
358 PCVBE_MODE Mode = VbeGetModeByNumber(ModeNumber);
359 if (Mode == NULL) return FALSE;
360
361 /* At this point, Mode->Registers shouldn't be NULL unless the mode is unimplemented */
362 if (Mode->Registers == NULL)
363 {
364 DPRINT1("Extended video mode %02X still UNIMPLEMENTED.\n", ModeNumber);
365 return FALSE;
366 }
367
368 /* Set the registers */
369 VbeSetExtendedRegisters(Mode->Registers);
370
371 /* Update the current video mode in the BDA */
372 Bda->VideoMode = ModeNumber;
373
374 /* Clear the screen */
376
377 return TRUE;
378}
379
381{
382 BYTE i;
383
384 /* Disable interrupts */
385 BOOLEAN Interrupts = getIF();
386 setIF(0);
387
388 /* Turn the video off */
391
392 /* Synchronous reset on */
395
396 /* Clear the extended sequencer registers, except for the VCLKs and MCLK */
398 {
400 && (i < SVGA_SEQ_VCLK0_NUMERATOR_REG || i > SVGA_SEQ_VCLK3_NUMERATOR_REG))
401 {
403 IOWriteB(VGA_SEQ_DATA, 0x00);
404 }
405 }
406
407 /* Reset the VCLKs */
409 IOWriteB(VGA_SEQ_DATA, 0x66);
411 IOWriteB(VGA_SEQ_DATA, 0x3B);
412
414 IOWriteB(VGA_SEQ_DATA, 0x5B);
416 IOWriteB(VGA_SEQ_DATA, 0x2F);
417
419 IOWriteB(VGA_SEQ_DATA, 0x45);
421 IOWriteB(VGA_SEQ_DATA, 0x30);
422
424 IOWriteB(VGA_SEQ_DATA, 0x7E);
426 IOWriteB(VGA_SEQ_DATA, 0x33);
427
428 /* Reset the MCLK */
430 IOWriteB(VGA_SEQ_DATA, 0x1C);
431
432 /* Synchronous reset off */
435
436 /* Reset the extended CRTC registers */
438 {
439 if ((i < SVGA_CRTC_UNUSED0_REG || i > SVGA_CRTC_UNUSED6_REG) && i != SVGA_CRTC_UNUSED7_REG)
440 {
442 IOWriteB(VGA_CRTC_DATA, 0x00);
443 }
444 }
445
446 /* Reset the extended GC registers */
448 {
450 && (i < SVGA_GC_UNUSED1_REG || i > SVGA_GC_UNUSED10_REG))
451 {
453 IOWriteB(VGA_GC_DATA, 0x00);
454 }
455 }
456
457 /*
458 * And finally, reset the hidden register. This requires 4 dummy reads from
459 * the DAC mask register.
460 */
461 for (i = 0; i < 4; i++) IOReadB(VGA_DAC_MASK);
462 IOWriteB(VGA_DAC_MASK, 0x00);
463
464 /* Turn the video on */
467
468 /* Restore interrupts */
469 setIF(Interrupts);
470}
471
473{
474 INT i;
475
476 switch (getAL())
477 {
478 /* Get VBE Information */
479 case 0x00:
480 {
482 PWORD Data = (PWORD)&Info;
483
484 /* Function recognized */
485 setAL(0x4F);
486
488 Info.Signature = 'ASEV';
489 Info.Version = 0x0102;
490 Info.OemName = OEM_NAME_PTR;
491 Info.Capabilities = 0;
492 Info.ModeList = MAKELONG(LOWORD(getDI()
493 + FIELD_OFFSET(VBE_INFORMATION, ModeListBuffer)),
494 getES());
495 Info.VideoMemory = HIWORD(SVGA_BANK_SIZE * VGA_NUM_BANKS);
496
497 /* Fill the mode list */
498 for (i = 0; i < VBE_MODE_COUNT; i++)
499 {
500 /* Some modes don't have VESA numbers */
501 if (Modes[i].VesaNumber != 0xFFFF)
502 {
503 Info.ModeListBuffer[i] = Modes[i].VesaNumber;
504 }
505 }
506
507 Info.ModeListBuffer[VBE_MODE_COUNT] = 0xFFFF;
508
509 /* Copy the data to the caller */
510 for (i = 0; i < sizeof(VBE_INFORMATION) / sizeof(WORD); i++)
511 {
512 *(PWORD)SEG_OFF_TO_PTR(getES(), LOWORD(getDI() + i * 2)) = Data[i];
513 }
514
515 setAH(0);
516 break;
517 }
518
519 /* Get VBE Mode Information */
520 case 0x01:
521 {
523 PWORD Data = NULL;
524
525 /* Function recognized */
526 setAL(0x4F);
527
528 if (Mode == NULL)
529 {
530 /* Mode not found */
531 setAH(1);
532 break;
533 }
534
535 Data = (PWORD)Mode->Info;
536 if (Data == NULL)
537 {
538 DPRINT1("WARNING: The mode information for mode %02X (%03X) is missing!\n",
539 Mode->Number,
540 Mode->VesaNumber);
541
542 setAH(1);
543 break;
544 }
545
546 /* Clear the buffer */
547 for (i = 0; i < 128; i++)
548 {
549 *(PWORD)SEG_OFF_TO_PTR(getES(), LOWORD(getDI() + i * 2)) = 0;
550 }
551
552 /* Copy the data to the caller */
553 for (i = 0; i < sizeof(VBE_MODE_INFO) / sizeof(WORD); i++)
554 {
555 *(PWORD)SEG_OFF_TO_PTR(getES(), LOWORD(getDI() + i * 2)) = Data[i];
556 }
557
558 setAH(0);
559 break;
560 }
561
562 /* Set VBE Mode */
563 case 0x02:
564 {
565 WORD VesaNumber = getBX();
566 setAL(0x4F);
567
568 if (VesaNumber <= BIOS_MAX_VIDEO_MODE)
569 {
570 /* Call the VGA BIOS */
571 setAH(0x00);
572 setAL(VesaNumber);
574
575 setAH(Bda->VideoMode != VesaNumber);
576 }
577 else
578 {
579 /* This is an extended video mode */
580 PCVBE_MODE Mode = VbeGetModeByNumber(VesaNumber);
581
582 if (Mode) setAH(!VbeSetExtendedVideoMode(Mode->Number));
583 else setAH(1);
584 }
585
586 break;
587 }
588
589 /* Get Current VBE Mode */
590 case 0x03:
591 {
593
594 setAL(0x4F);
595
596 if (Mode)
597 {
598 setBX(Mode->VesaNumber != 0xFFFF
599 ? Mode->VesaNumber : Mode->Number);
600 setAH(0);
601 }
602 else
603 {
604 setAH(1);
605 }
606
607 break;
608 }
609
610 /* CPU Video Memory Control */
611 case 0x05:
612 {
613 BYTE Window = getBL();
614 BYTE OldGcIndex = IOReadB(VGA_GC_INDEX);
615
616 switch (getBH())
617 {
618 /* Select Memory Window */
619 case 0:
620 {
621 setAL(0x4F);
622
623 if (getDH() != 0)
624 {
625 /* Offset too high */
626 setAH(1);
627 break;
628 }
629
632
633 setAH(0);
634 break;
635 }
636
637 /* Return Memory Window */
638 case 1:
639 {
642
643 setAX(0x004F);
644 break;
645 }
646
647 default:
648 {
649 DPRINT1("VESA INT 0x10, AL = 0x05, Unknown subfunction: 0x%02X\n", getBH());
650 }
651 }
652
653 IOWriteB(VGA_GC_INDEX, OldGcIndex);
654 break;
655 }
656
657 /* Get/Set Display Start */
658 case 0x07:
659 {
660 DWORD StartAddress;
661 BYTE Value;
663 BYTE OldCrtcIndex = IOReadB(VGA_CRTC_INDEX_COLOR);
664
665 if (getBL() & 0x80)
666 {
667 /* Wait for a vertical retrace */
669 {
670 setCF(1);
671 break;
672 }
673
674 setCF(0);
675 }
676
677 switch (getBL() & 0x7F)
678 {
679 /* Set Display Start */
680 case 0x00:
681 {
682 setAL(0x4F);
683
684 if (Mode == NULL || Mode->Info == NULL)
685 {
686 /* This is not a VBE mode */
687 // TODO: Support anyway, perhaps? It can be done.
688 setAH(0x01);
689 break;
690 }
691
692 StartAddress = getCX() + getDX() * Mode->Info->BytesPerScanline;
693
696 Value &= ~SVGA_CRTC_EXT_ADDR_BIT19;
697 Value |= (StartAddress >> 12) & SVGA_CRTC_EXT_ADDR_BIT19;
699
703 Value |= (StartAddress >> 16) & SVGA_CRTC_EXT_ADDR_BIT16;
704 Value |= (StartAddress >> 15) & SVGA_CRTC_EXT_ADDR_BITS1718;
706
708 IOWriteB(VGA_CRTC_DATA_COLOR, (StartAddress >> 8) & 0xFF);
710 IOWriteB(VGA_CRTC_DATA_COLOR, StartAddress & 0xFF);
711
712 setAH(0);
713 break;
714 }
715
716 /* Get Display Start */
717 case 0x01:
718 {
719 setAL(0x4F);
720 StartAddress = 0;
721
722 if (Mode == NULL || Mode->Info == NULL)
723 {
724 /* This is not a VBE mode */
725 // TODO: Support anyway, perhaps? It can be done.
726 setAH(0x01);
727 break;
728 }
729
731 StartAddress = (IOReadB(VGA_CRTC_DATA_COLOR) & SVGA_CRTC_EXT_ADDR_BIT19) << 12;
732
735 StartAddress |= (Value & SVGA_CRTC_EXT_ADDR_BIT16) << 16;
736 StartAddress |= (Value & SVGA_CRTC_EXT_ADDR_BITS1718) << 15;
737
739 StartAddress |= IOReadB(VGA_CRTC_DATA_COLOR) << 8;
741 StartAddress |= IOReadB(VGA_CRTC_DATA_COLOR);
742
743 setCX(StartAddress % Mode->Info->BytesPerScanline);
744 setDX(StartAddress / Mode->Info->BytesPerScanline);
745
746 setAH(0);
747 break;
748 }
749 }
750
751 IOWriteB(VGA_CRTC_INDEX_COLOR, OldCrtcIndex);
752 break;
753 }
754
755 default:
756 {
757 DPRINT1("VESA BIOS Extensions function %02Xh NOT IMPLEMENTED!\n", getAL());
758 break;
759 }
760 }
761}
762
764{
766 BYTE SeqIndex = IOReadB(VGA_SEQ_INDEX);
767
768 /* Store the OEM name */
770
771 /* Unlock SVGA extensions on the card */
774
775 /* Check if it worked */
777
778 IOWriteB(VGA_SEQ_INDEX, SeqIndex);
779 return Success;
780}
unsigned char BOOLEAN
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define DPRINT1
Definition: precomp.h:8
CALLBACK16 BiosContext
Definition: bios32.c:45
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define FAR_POINTER(x)
Definition: emulator.h:35
#define SEG_OFF_TO_PTR(seg, off)
Definition: emulator.h:32
@ Success
Definition: eventcreate.c:712
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_In_ ULONG Mode
Definition: hubbusif.h:303
VOID Int32Call(IN PCALLBACK16 Context, IN BYTE IntNumber)
Definition: int32.c:151
if(dx< 0)
Definition: linetemp.h:194
unsigned int UINT
Definition: ndis.h:50
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG _In_opt_ LONG volatile * Number
Definition: ntpoapi.h:207
#define LOWORD(l)
Definition: pedump.c:82
WORD * PWORD
Definition: pedump.c:67
BYTE CrtModeControl
Definition: bios.h:68
BYTE VideoMode
Definition: bios.h:59
WORD CrtBasePort
Definition: bios.h:67
BYTE VGAOptions
Definition: bios.h:91
Definition: window.c:28
UCHAR Sequencer[SVGA_SEQ_MAX_REG]
Definition: svga.h:379
UCHAR Hidden
Definition: svga.h:378
UCHAR CRT[SVGA_CRTC_MAX_REG]
Definition: svga.h:380
UCHAR Graphics[SVGA_GC_MAX_REG]
Definition: svga.h:381
UCHAR Misc
Definition: svga.h:377
UCHAR Attribute[VGA_AC_MAX_REG]
Definition: svga.h:382
Definition: vbe.h:98
WORD VesaNumber
Definition: vbe.h:100
PCVBE_MODE VbeGetModeByNumber(WORD Number)
Definition: vbe.c:220
VOID WINAPI VbeResetExtendedRegisters(VOID)
Definition: vbe.c:380
static SVGA_REGISTERS VbeMode_640x480x256_Registers
Definition: vbe.c:69
static VOID VbeSetExtendedRegisters(PSVGA_REGISTERS Registers)
Definition: vbe.c:240
static SVGA_REGISTERS VbeMode_800x600x256_Registers
Definition: vbe.c:150
BOOLEAN VbeInitialize(VOID)
Definition: vbe.c:763
BOOLEAN WINAPI VbeSetExtendedVideoMode(BYTE ModeNumber)
Definition: vbe.c:356
static const VBE_MODE_INFO VbeMode_640x480x256_Info
Definition: vbe.c:27
static const VBE_MODE Modes[VBE_MODE_COUNT]
Definition: vbe.c:189
static const VBE_MODE_INFO VbeMode_800x600x256_Info
Definition: vbe.c:108
VOID WINAPI VbeService(LPWORD Stack)
Definition: vbe.c:472
struct _VBE_MODE_INFO VBE_MODE_INFO
#define VBE_MODE_COLOR
Definition: vbe.h:25
#define OEM_NAME
Definition: vbe.h:16
#define VBE_MODE_COUNT
Definition: vbe.h:19
#define VBE_MODE_SUPPORTED
Definition: vbe.h:22
#define VBE_MODE_GRAPHICS
Definition: vbe.h:26
struct _VBE_INFORMATION VBE_INFORMATION
#define VBE_WINDOW_READABLE
Definition: vbe.h:30
#define VBE_WINDOW_WRITABLE
Definition: vbe.h:31
#define VBE_WINDOW_EXISTS
Definition: vbe.h:29
#define VBE_MODE_OPTIONAL_INFO
Definition: vbe.h:23
#define VBE_MODEL_PACKED
Definition: vbe.h:38
#define OEM_NAME_PTR
Definition: vbe.h:17
PBIOS_DATA_AREA Bda
Definition: bios.c:42
VOID IOWriteB(USHORT Port, UCHAR Buffer)
Definition: io.c:111
UCHAR IOReadB(USHORT Port)
Definition: io.c:64
VOID VgaClearMemory(VOID)
Definition: svga.c:2074
#define VGA_SEQ_DATA
Definition: svga.h:56
#define VGA_DAC_MASK
Definition: svga.h:58
#define VGA_GC_DATA
Definition: svga.h:69
#define VGA_INSTAT1_READ_COLOR
Definition: svga.h:45
#define VGA_SEQ_INDEX
Definition: svga.h:55
#define VGA_MISC_WRITE
Definition: svga.h:40
#define SVGA_CRTC_EXT_ADDR_BIT16
Definition: svga.h:193
#define VGA_STAT_VRETRACE
Definition: svga.h:92
#define VGA_AC_WRITE
Definition: svga.h:52
#define VGA_AC_INDEX
Definition: svga.h:51
#define VGA_CRTC_INDEX_COLOR
Definition: svga.h:65
@ SVGA_SEQ_MAX_REG
Definition: svga.h:163
@ SVGA_SEQ_VCLK1_DENOMINATOR_REG
Definition: svga.h:159
@ SVGA_SEQ_VCLK0_DENOMINATOR_REG
Definition: svga.h:158
@ SVGA_SEQ_VCLK2_NUMERATOR_REG
Definition: svga.h:144
@ SVGA_SEQ_EXT_MODE_REG
Definition: svga.h:138
@ VGA_SEQ_MAX_REG
Definition: svga.h:136
@ SVGA_SEQ_VCLK3_NUMERATOR_REG
Definition: svga.h:145
@ SVGA_SEQ_VCLK3_DENOMINATOR_REG
Definition: svga.h:161
@ SVGA_SEQ_MCLK_REG
Definition: svga.h:162
@ VGA_SEQ_CLOCK_REG
Definition: svga.h:132
@ VGA_SEQ_RESET_REG
Definition: svga.h:131
@ SVGA_SEQ_VCLK2_DENOMINATOR_REG
Definition: svga.h:160
@ SVGA_SEQ_VCLK0_NUMERATOR_REG
Definition: svga.h:142
@ SVGA_SEQ_VCLK1_NUMERATOR_REG
Definition: svga.h:143
@ SVGA_SEQ_UNLOCK_REG
Definition: svga.h:137
#define SVGA_CRTC_EXT_ADDR_BIT19
Definition: svga.h:199
#define VGA_CRTC_INDEX_MONO
Definition: svga.h:63
#define VGA_CRTC_DATA_COLOR
Definition: svga.h:66
@ VGA_CRTC_START_ADDR_LOW_REG
Definition: svga.h:216
@ VGA_CRTC_END_VERT_RETRACE_REG
Definition: svga.h:220
@ SVGA_CRTC_OVERLAY_REG
Definition: svga.h:233
@ SVGA_CRTC_INTERLACE_END_REG
Definition: svga.h:229
@ SVGA_CRTC_UNUSED7_REG
Definition: svga.h:242
@ SVGA_CRTC_MAX_REG
Definition: svga.h:244
@ VGA_CRTC_START_ADDR_HIGH_REG
Definition: svga.h:215
@ VGA_CRTC_END_HORZ_BLANKING_REG
Definition: svga.h:206
@ SVGA_CRTC_EXT_DISPLAY_REG
Definition: svga.h:231
@ SVGA_CRTC_UNUSED6_REG
Definition: svga.h:240
#define VGA_NUM_BANKS
Definition: svga.h:14
#define SVGA_BANK_SIZE
Definition: svga.h:31
@ VGA_AC_MAX_REG
Definition: svga.h:362
@ VGA_AC_CONTROL_REG
Definition: svga.h:357
@ SVGA_GC_MAX_REG
Definition: svga.h:321
@ SVGA_GC_UNUSED11_REG
Definition: svga.h:312
@ SVGA_GC_UNUSED0_REG
Definition: svga.h:284
@ SVGA_GC_OFFSET_0_REG
Definition: svga.h:278
@ SVGA_GC_OFFSET_1_REG
Definition: svga.h:279
@ SVGA_GC_UNUSED10_REG
Definition: svga.h:300
#define VGA_AC_CONTROL_BLINK
Definition: svga.h:334
#define SVGA_SEQ_UNLOCKED
Definition: svga.h:117
#define VGA_GC_INDEX
Definition: svga.h:68
#define VGA_SEQ_CLOCK_SD
Definition: svga.h:108
#define SVGA_CRTC_EXT_ADDR_BITS1718
Definition: svga.h:195
#define VGA_SEQ_RESET_SR
Definition: svga.h:101
#define VGA_SEQ_RESET_AR
Definition: svga.h:100
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
uint16_t * LPWORD
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define HIWORD(l)
Definition: typedefs.h:247
VOID WINAPI setBX(USHORT)
Definition: registers.c:177
UCHAR WINAPI getBH(VOID)
Definition: registers.c:184
VOID WINAPI setCX(USHORT)
Definition: registers.c:235
VOID WINAPI setDX(USHORT)
Definition: registers.c:293
USHORT WINAPI getBX(VOID)
Definition: registers.c:170
VOID WINAPI setAL(UCHAR)
Definition: registers.c:149
UCHAR WINAPI getAL(VOID)
Definition: registers.c:142
VOID WINAPI setCF(ULONG)
Definition: registers.c:573
VOID WINAPI setAH(UCHAR)
Definition: registers.c:135
USHORT WINAPI getCX(VOID)
Definition: registers.c:228
USHORT WINAPI getDX(VOID)
Definition: registers.c:286
VOID WINAPI setIF(ULONG)
Definition: registers.c:643
USHORT WINAPI getES(VOID)
Definition: registers.c:522
USHORT WINAPI getDI(VOID)
Definition: registers.c:434
UCHAR WINAPI getDL(VOID)
Definition: registers.c:314
UCHAR WINAPI getBL(VOID)
Definition: registers.c:198
VOID WINAPI setAX(USHORT)
Definition: registers.c:121
ULONG WINAPI getIF(VOID)
Definition: registers.c:636
UCHAR WINAPI getDH(VOID)
Definition: registers.c:300
#define BIOS_MAX_VIDEO_MODE
Definition: vidbios.h:20
#define VGA_INSTAT1_READ
Definition: vidbios.h:113
#define BIOS_VIDEO_INTERRUPT
Definition: vidbios.h:15
#define VGA_CRTC_DATA
Definition: vidbios.h:115
#define VGA_CRTC_INDEX
Definition: vidbios.h:114
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
#define ZeroMemory
Definition: winbase.h:1737
#define WINAPI
Definition: msvc.h:6
unsigned char BYTE
Definition: xxhash.c:193