VirtualBox

Changeset 44844 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Feb 27, 2013 1:30:51 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
83988
Message:

DevVGA: cleanup of the custom BIOS image loading code; doc/manual: added some more words about the image format

File:
1 edited

Legend:

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

    r44528 r44844  
    37173717
    37183718            default:
    3719                 AssertMsgFailed(("Unsupported bitmap header.\n"));
     3719                AssertLogRelMsgFailedReturn(("Unsupported bitmap header size %u.\n", pWinHdr->Size),
     3720                                            VERR_INVALID_PARAMETER);
    37203721                break;
    37213722        }
    37223723
    3723         if (pThis->cxLogo > LOGO_MAX_WIDTH || pThis->cyLogo > LOGO_MAX_HEIGHT)
    3724         {
    3725             AssertMsgFailed(("Bitmap %ux%u is too big.\n", pThis->cxLogo, pThis->cyLogo));
    3726             return VERR_INVALID_PARAMETER;
    3727         }
    3728 
    3729         if (pThis->cLogoPlanes != 1)
    3730         {
    3731             AssertMsgFailed(("Bitmap planes %u != 1.\n", pThis->cLogoPlanes));
    3732             return VERR_INVALID_PARAMETER;
    3733         }
    3734 
    3735         if (pThis->cLogoBits != 4 && pThis->cLogoBits != 8 && pThis->cLogoBits != 24)
    3736         {
    3737             AssertMsgFailed(("Unsupported %u depth.\n", pThis->cLogoBits));
    3738             return VERR_INVALID_PARAMETER;
    3739         }
    3740 
    3741         if (pThis->cLogoUsedColors > 256)
    3742         {
    3743             AssertMsgFailed(("Unsupported %u colors.\n", pThis->cLogoUsedColors));
    3744             return VERR_INVALID_PARAMETER;
    3745         }
    3746 
    3747         if (pThis->LogoCompression != BMP_COMPRESS_NONE)
    3748         {
    3749             AssertMsgFailed(("Unsupported %u compression.\n", pThis->LogoCompression));
    3750             return VERR_INVALID_PARAMETER;
    3751         }
     3724        AssertLogRelMsgReturn(pThis->cxLogo <= LOGO_MAX_WIDTH && pThis->cyLogo <= LOGO_MAX_HEIGHT,
     3725                              ("Bitmap %ux%u is too big.\n", pThis->cxLogo, pThis->cyLogo),
     3726                              VERR_INVALID_PARAMETER);
     3727
     3728        AssertLogRelMsgReturn(pThis->cLogoPlanes == 1,
     3729                              ("Bitmap planes %u != 1.\n", pThis->cLogoPlanes),
     3730                              VERR_INVALID_PARAMETER);
     3731
     3732        AssertLogRelMsgReturn(pThis->cLogoBits == 4 || pThis->cLogoBits == 8 || pThis->cLogoBits == 24,
     3733                              ("Unsupported %u depth.\n", pThis->cLogoBits),
     3734                              VERR_INVALID_PARAMETER);
     3735
     3736        AssertLogRelMsgReturn(pThis->cLogoUsedColors <= 256,
     3737                              ("Unsupported %u colors.\n", pThis->cLogoUsedColors),
     3738                              VERR_INVALID_PARAMETER);
     3739
     3740        AssertLogRelMsgReturn(pThis->LogoCompression == BMP_COMPRESS_NONE,
     3741                               ("Unsupported %u compression.\n", pThis->LogoCompression),
     3742                               VERR_INVALID_PARAMETER);
    37523743
    37533744        /*
     
    65716562         * Write the logo bitmap.
    65726563         */
     6564        rc = VINF_SUCCESS;
    65736565        if (pThis->pszLogoFile)
     6566            rc = RTFileRead(FileLogo, pLogoHdr + 1, LogoHdr.cbLogo, NULL);
     6567
     6568        if (RT_SUCCESS(rc))
     6569            rc = vbeParseBitmap(pThis);
     6570
     6571        if (   RT_FAILURE(rc)
     6572            && pThis->pszLogoFile)
    65746573        {
    6575             rc = RTFileRead(FileLogo, pLogoHdr + 1, LogoHdr.cbLogo, NULL);
    6576             if (RT_FAILURE(rc))
    6577             {
    6578                 AssertMsgFailed(("RTFileRead(,,%d,NULL) -> %Rrc\n", LogoHdr.cbLogo, rc));
    6579                 pLogoHdr->cbLogo = LogoHdr.cbLogo = g_cbVgaDefBiosLogo;
    6580                 memcpy(pLogoHdr + 1, g_abVgaDefBiosLogo, LogoHdr.cbLogo);
    6581             }
    6582         }
    6583         else
    6584             memcpy(pLogoHdr + 1, g_abVgaDefBiosLogo, LogoHdr.cbLogo);
    6585 
    6586         rc = vbeParseBitmap(pThis);
    6587         if (RT_FAILURE(rc))
    6588         {
    6589             AssertMsgFailed(("vbeParseBitmap() -> %Rrc\n", rc));
     6574            LogRel(("Error %Rrc reading logo file '%s', using internal logo\n",
     6575                    rc, pThis->pszLogoFile));
    65906576            pLogoHdr->cbLogo = LogoHdr.cbLogo = g_cbVgaDefBiosLogo;
    65916577            memcpy(pLogoHdr + 1, g_abVgaDefBiosLogo, LogoHdr.cbLogo);
    6592         }
    6593 
    6594         rc = vbeParseBitmap(pThis);
     6578            rc = vbeParseBitmap(pThis);
     6579        }
     6580
    65956581        if (RT_FAILURE(rc))
    6596             AssertReleaseMsgFailed(("Internal bitmap failed! vbeParseBitmap() -> %Rrc\n", rc));
     6582            AssertReleaseMsgFailed(("Parsing of internal bitmap failed! vbeParseBitmap() -> %Rrc\n", rc));
    65976583
    65986584        rc = VINF_SUCCESS;
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