VirtualBox

Changeset 67766 in vbox


Ignore:
Timestamp:
Jul 4, 2017 8:04:57 AM (8 years ago)
Author:
vboxsync
Message:

VGA: Implemented address wraparound for 16-color VGA modes.

Location:
trunk/src/VBox/Devices/Graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r67624 r67766  
    24872487    linesize = pDrv->cbScanline;
    24882488
     2489    if (!(pThis->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED))
     2490        pThis->vga_addr_mask = 0x3ffff;
     2491    else
     2492        pThis->vga_addr_mask = UINT32_MAX;
     2493
    24892494    y1 = 0;
    24902495    y2 = pThis->cr[0x09] & 0x1F;    /* starting row scan count */
     
    25002505            addr = (addr & ~(1 << 16)) | ((y1 & 2) << 15);
    25012506        }
     2507        addr &= pThis->vga_addr_mask;
    25022508        page0 = addr & ~PAGE_OFFSET_MASK;
    25032509        page1 = (addr + bwidth - 1) & ~PAGE_OFFSET_MASK;
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r65381 r67766  
    255255    uint8_t padding1[2];
    256256    uint32_t line_offset;
     257    uint32_t vga_addr_mask;
     258    uint32_t padding1a;
    257259    uint32_t line_compare;
    258260    uint32_t start_addr;
  • trunk/src/VBox/Devices/Graphics/DevVGATmpl.h

    r62514 r67766  
    263263                                              const uint8_t *s, int width)
    264264{
    265     uint32_t plane_mask, data, v, *palette;
     265    uint32_t plane_mask, data, v, *palette, vram_ofs;
    266266    int x;
    267267
     268    vram_ofs = s - s1->vram_ptrR3;
    268269    palette = s1->last_palette;
    269270    plane_mask = mask16[s1->ar[0x12] & 0xf];
    270271    width >>= 3;
    271272    for(x = 0; x < width; x++) {
     273        s = s1->vram_ptrR3 + (vram_ofs & s1->vga_addr_mask);
    272274        data = ((uint32_t *)s)[0];
    273275        data &= plane_mask;
     
    285287        ((PIXEL_TYPE *)d)[7] = palette[(v >> 0) & 0xf];
    286288        d += BPP * 8;
    287         s += 4;
     289        vram_ofs += 4;
    288290    }
    289291}
Note: See TracChangeset for help on using the changeset viewer.

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