VirtualBox

Changeset 82196 in vbox


Ignore:
Timestamp:
Nov 25, 2019 8:05:28 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
135010
Message:

VGABIOS: Improved IBM compatibility with static table updates and fixes to dynamic state query.

Location:
trunk/src/VBox/Devices/Graphics/BIOS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/BIOS/vgabios.c

    r82154 r82196  
    17951795static void biosfn_read_state_info(uint16_t BX, uint16_t ES, uint16_t DI)
    17961796{
     1797 uint16_t   pg_sz;
     1798 uint16_t   scans;
     1799 uint8_t    mode;
     1800 uint8_t    mctl;
     1801 uint8_t    temp;
     1802
     1803 mode  = read_byte(BIOSMEM_SEG,BIOSMEM_CURRENT_MODE);
     1804 pg_sz = read_word(BIOSMEM_SEG,BIOSMEM_PAGE_SIZE);
    17971805 // Address of static functionality table
    17981806 write_dword(ES,DI+0x00, (uint32_t)(void __far *)static_functionality);
    17991807
    1800  // Hard coded copy from BIOS area. Should it be cleaner ?
    1801  memcpyb(ES,DI+0x04,BIOSMEM_SEG,0x49,30);
    1802  memcpyb(ES,DI+0x22,BIOSMEM_SEG,0x84,3);
     1808 // A lot is a straight copy from the BDA. Note that the number
     1809 // of character rows in the BDA is zero-based but one-based in
     1810 // the dynamic state area
     1811 memcpyb(ES,DI+0x04,BIOSMEM_SEG,BIOSMEM_CURRENT_MODE,30);
     1812 write_byte(ES,DI+0x22,read_byte(BIOSMEM_SEG,BIOSMEM_NB_ROWS)+1);
     1813 memcpyb(ES,DI+0x23,BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT,2);
    18031814
    18041815 write_byte(ES,DI+0x25,read_byte(BIOSMEM_SEG,BIOSMEM_DCC_INDEX));
    1805  write_byte(ES,DI+0x26,0);
    1806  write_byte(ES,DI+0x27,16);
    1807  write_byte(ES,DI+0x28,0);
    1808  write_byte(ES,DI+0x29,8);
    1809  write_byte(ES,DI+0x2a,2);
    1810  write_byte(ES,DI+0x2b,0);
    1811  write_byte(ES,DI+0x2c,0);
    1812  write_byte(ES,DI+0x31,3);
    1813  write_byte(ES,DI+0x32,0);
     1816 write_byte(ES,DI+0x26,0);  // Alternate display code
     1817 write_word(ES,DI+0x27,16); // Number of colors
     1818 write_byte(ES,DI+0x29,8);  // Number of pages
     1819 write_byte(ES,DI+0x2a,2);  // Vertical resolution specifier
     1820 write_byte(ES,DI+0x2b,0);  // Primary font block
     1821 write_byte(ES,DI+0x2c,0);  // Secondary font block
     1822 write_byte(ES,DI+0x2d,0x21);
     1823 write_byte(ES,DI+0x31,3);  // 256K video RAM
     1824 write_byte(ES,DI+0x32,0);  // Save pointer state information
     1825
     1826 mctl = read_byte(BIOSMEM_SEG,BIOSMEM_MODESET_CTL);
     1827
     1828 /* Extract and write the vertical resolution specifier bits. */
     1829 scans = ((mctl & 0x80) >> 6) | ((mctl & 0x10) >> 4);
     1830 switch (scans) {
     1831 case 0:    temp = 1;   break;  /* 350 lines */
     1832 case 1:    temp = 2;   break;  /* 400 lines */
     1833 default:
     1834 case 2:    temp = 0;   break;  /* 200 lines */
     1835 }
     1836 write_byte(ES,DI+0x2a,temp);
     1837
     1838 /* Patch up the data for graphics modes. */
     1839 if (mode >= 0x0E && mode <= 0x12) {
     1840     if (pg_sz)
     1841         write_byte(ES,DI+0x29,16384/(pg_sz >> 2));
     1842 } else if (mode == 0x13) {
     1843     write_byte(ES,DI+0x29,1);      /* Just one page due to chaining */
     1844     write_word(ES,DI+0x27,256);    /* But 256!! colors!!! */
     1845 } else if (mode >= 4 && mode <= 6) {
     1846     /* CGA modes. */
     1847     if (pg_sz)
     1848         write_byte(ES,DI+0x29,16384/pg_sz);
     1849     write_word(ES,DI+0x27,4);
     1850 }
     1851 if (mode == 6 || mode == 0x11)
     1852     write_word(ES,DI+0x27,2);  /* 2-color modes. */
     1853
     1854 if ((mode >= 4) && (mode != 7)) {
     1855     write_byte(ES,DI+0x2d,0x01);
     1856     scans = (read_byte(BIOSMEM_SEG,BIOSMEM_NB_ROWS)+1) * read_byte(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT);
     1857     switch (scans) {
     1858     case 200:  temp = 0;   break;
     1859     case 350:  temp = 1;   break;
     1860     case 400:  temp = 2;   break;
     1861     default:
     1862     case 480:  temp = 3;   break;
     1863     }
     1864     write_byte(ES,DI+0x2a,temp);
     1865 }
    18141866
    18151867 memsetb(ES,DI+0x33,0,13);
  • trunk/src/VBox/Devices/Graphics/BIOS/vgatables.h

    r82133 r82196  
    136136{
    137137 /* index=0x04 vga mode 0x04 */
    138  40, 24, 8, 0x00, 0x08, /* tw, th-1, ch, slength */
     138 40, 24, 8, 0x00, 0x40, /* tw, th-1, ch, slength */
    139139 0x09, 0x03, 0x00, 0x02, /* sequ_regs */
    140140 0x63, /* miscreg */
     
    150150{
    151151 /* index=0x05 vga mode 0x05 */
    152  40, 24, 8, 0x00, 0x08, /* tw, th-1, ch, slength */
     152 40, 24, 8, 0x00, 0x40, /* tw, th-1, ch, slength */
    153153 0x09, 0x03, 0x00, 0x02, /* sequ_regs */
    154154 0x63, /* miscreg */
     
    164164{
    165165 /* index=0x06 vga mode 0x06 */
    166  80, 24, 8, 0x00, 0x10, /* tw, th-1, ch, slength */
     166 80, 24, 8, 0x00, 0x40, /* tw, th-1, ch, slength */
    167167 0x01, 0x01, 0x00, 0x06, /* sequ_regs */
    168168 0x63, /* miscreg */
     
    414414{
    415415 /* index=0x1a vga mode 0x11 */
    416  80, 29, 16, 0x00, 0x00, /* tw, th-1, ch, slength */
     416 80, 29, 16, 0x00, 0xa0, /* tw, th-1, ch, slength */
    417417 0x01, 0x0f, 0x00, 0x06, /* sequ_regs */
    418418 0xe3, /* miscreg */
     
    428428{
    429429 /* index=0x1b vga mode 0x12 */
    430  80, 29, 16, 0x00, 0x00, /* tw, th-1, ch, slength */
     430 80, 29, 16, 0x00, 0xa0, /* tw, th-1, ch, slength */
    431431 0x01, 0x0f, 0x00, 0x06, /* sequ_regs */
    432432 0xe3, /* miscreg */
     
    442442{
    443443 /* index=0x1c vga mode 0x13 */
    444  40, 24, 8, 0x00, 0x00, /* tw, th-1, ch, slength */
     444 40, 24, 8, 0x00, 0x20, /* tw, th-1, ch, slength */
    445445 0x01, 0x0f, 0x00, 0x0e, /* sequ_regs */
    446446 0x63, /* miscreg */
Note: See TracChangeset for help on using the changeset viewer.

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