Changeset 7914 in vbox
- Timestamp:
- Apr 11, 2008 1:08:11 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 29543
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r7888 r7914 187 187 #define BMP_ID 0x4D42 188 188 189 /** BMP compressions. */ 189 /** @name BMP compressions. 190 * @{ */ 190 191 #define BMP_COMPRESS_NONE 0 191 192 #define BMP_COMPRESS_RLE8 1 192 193 #define BMP_COMPRESS_RLE4 2 193 194 /** BMP header sizes. */ 194 /** @} */ 195 196 /** @name BMP header sizes. 197 * @{ */ 195 198 #define BMP_HEADER_OS21 12 196 199 #define BMP_HEADER_OS22 64 197 200 #define BMP_HEADER_WIN3 40 201 /** @} */ 198 202 199 203 /** The BIOS boot menu text position, X. */ … … 2851 2855 2852 2856 /** 2853 * Parse the logo bitmap data.2854 *2855 * @returns VBox status code.2856 *2857 * @param pDevIns The device instance.2858 */2859 PDMBOTHCBDECL(int) vbeParseBitmap(PVGASTATE pData)2860 {2861 uint16_t i;2862 PBMPINFO bmpInfo;2863 POS2HDR os2Hdr;2864 POS22HDR os22Hdr;2865 PWINHDR winHdr;2866 2867 /*2868 * Get bitmap header data2869 */2870 bmpInfo = (PBMPINFO)(pData->pu8Logo + sizeof(LOGOHDR));2871 winHdr = (PWINHDR)(pData->pu8Logo + sizeof(LOGOHDR) + sizeof(BMPINFO));2872 2873 if (bmpInfo->Type == BMP_ID)2874 {2875 switch (winHdr->Size)2876 {2877 case BMP_HEADER_OS21:2878 os2Hdr = (POS2HDR)winHdr;2879 pData->cbWidth = os2Hdr->Width;2880 pData->cbHeight = os2Hdr->Height;2881 pData->cbPlanes = os2Hdr->Planes;2882 pData->cbBitCount = os2Hdr->BitCount;2883 pData->Compression = BMP_COMPRESS_NONE;2884 pData->cbClrUsed = 0;2885 break;2886 2887 case BMP_HEADER_OS22:2888 os22Hdr = (POS22HDR)winHdr;2889 pData->cbWidth = os22Hdr->Width;2890 pData->cbHeight = os22Hdr->Height;2891 pData->cbPlanes = os22Hdr->Planes;2892 pData->cbBitCount = os22Hdr->BitCount;2893 pData->Compression = os22Hdr->Compression;2894 pData->cbClrUsed = os22Hdr->ClrUsed;2895 break;2896 2897 case BMP_HEADER_WIN3:2898 pData->cbWidth = winHdr->Width;2899 pData->cbHeight = winHdr->Height;2900 pData->cbPlanes = winHdr->Planes;2901 pData->cbBitCount = winHdr->BitCount;2902 pData->Compression = winHdr->Compression;2903 pData->cbClrUsed = winHdr->ClrUsed;2904 break;2905 2906 default:2907 AssertMsgFailed(("Unsupported bitmap header.\n"));2908 break;2909 }2910 2911 if (pData->cbWidth > LOGO_MAX_WIDTH || pData->cbHeight > LOGO_MAX_HEIGHT)2912 {2913 AssertMsgFailed(("Bitmap %dx%d is too big.\n", pData->cbWidth, pData->cbHeight));2914 return VERR_INVALID_PARAMETER;2915 }2916 2917 if (pData->cbPlanes != 1)2918 {2919 AssertMsgFailed(("Bitmap planes %d != 1.\n", pData->cbPlanes));2920 return VERR_INVALID_PARAMETER;2921 }2922 2923 if (pData->cbBitCount != 4 && pData->cbBitCount != 8 && pData->cbBitCount != 24)2924 {2925 AssertMsgFailed(("Unsupported %d depth.\n", pData->cbBitCount));2926 return VERR_INVALID_PARAMETER;2927 }2928 2929 if (pData->cbClrUsed > 256)2930 {2931 AssertMsgFailed(("Unsupported %d colors.\n", pData->cbClrUsed));2932 return VERR_INVALID_PARAMETER;2933 }2934 2935 if (pData->Compression != BMP_COMPRESS_NONE)2936 {2937 AssertMsgFailed(("Unsupported %d compression.\n", pData->Compression));2938 return VERR_INVALID_PARAMETER;2939 }2940 2941 /*2942 * Read bitmap palette2943 */2944 if (!pData->cbClrUsed)2945 pData->cbPal = 1 << (pData->cbPlanes * pData->cbBitCount);2946 else2947 pData->cbPal = pData->cbClrUsed;2948 2949 if (pData->cbPal)2950 {2951 uint8_t *pu8Pal = (uint8_t *)(pData->pu8Logo + sizeof(LOGOHDR) + sizeof(BMPINFO) + winHdr->Size);2952 2953 for (i = 0; i <= pData->cbPal; i++)2954 {2955 uint16_t j;2956 uint32_t u32Pal = 0;2957 2958 for (j = 0; j < 3; j++)2959 {2960 uint8_t b = *pu8Pal++;2961 u32Pal <<= 8;2962 u32Pal |= b;2963 }2964 2965 pu8Pal++; /* skip unused byte */2966 pData->au32Palette[i] = u32Pal;2967 }2968 }2969 2970 /*2971 * Bitmap data offset2972 */2973 pData->pu8Bitmap = (pData->pu8Logo + sizeof(LOGOHDR) + bmpInfo->Offset);2974 }2975 2976 return VINF_SUCCESS;2977 }2978 2979 2980 /**2981 * Show logo bitmap data.2982 *2983 * @returns VBox status code.2984 *2985 * @param cbDepth Logo depth.2986 * @param xLogo Logo X position.2987 * @param yLogo Logo Y position.2988 * @param cbWidth Logo width.2989 * @param cbHeight Logo height.2990 * @param cbStep Fade in/fade out step.2991 * @param pu32Palette Palette data.2992 * @param pu8Src Source buffer.2993 * @param pu8Dst Destination buffer.2994 */2995 void vbeShowBitmap(uint16_t cbDepth, uint16_t xLogo, uint16_t yLogo, uint16_t cbWidth, uint16_t cbHeight, uint8_t cbStep, uint32_t *pu32Palette, const uint8_t *pu8Src, uint8_t *pu8Dst)2996 {2997 uint16_t i;2998 size_t cbPadBytes = 0;2999 size_t cbLineDst = LOGO_MAX_WIDTH * 4;3000 uint16_t cyLeft = cbHeight;3001 3002 pu8Dst += xLogo * 4 + yLogo * cbLineDst;3003 3004 switch (cbDepth)3005 {3006 case 1:3007 pu8Dst += cbHeight * cbLineDst;3008 cbPadBytes = 0;3009 break;3010 3011 case 4:3012 if (((cbWidth % 8) == 0) || ((cbWidth % 8) > 6))3013 cbPadBytes = 0;3014 else if ((cbWidth % 8) <= 2)3015 cbPadBytes = 3;3016 else if ((cbWidth % 8) <= 4)3017 cbPadBytes = 2;3018 else3019 cbPadBytes = 1;3020 break;3021 3022 case 8:3023 cbPadBytes = ((cbWidth % 4) == 0) ? 0 : (4 - (cbWidth % 4));3024 break;3025 3026 case 24:3027 cbPadBytes = cbWidth % 4;3028 break;3029 }3030 3031 uint8_t j = 0, c = 0;3032 3033 while (cyLeft-- > 0)3034 {3035 uint8_t *pu8TmpPtr = pu8Dst;3036 3037 if (cbDepth != 1)3038 j = 0;3039 3040 for (i = 0; i < cbWidth; i++)3041 {3042 uint8_t pix;3043 3044 switch (cbDepth)3045 {3046 case 1:3047 {3048 if (!j)3049 c = *pu8Src++;3050 3051 pix = (c & 1) ? 0xFF : 0;3052 c >>= 1;3053 3054 *pu8TmpPtr++ = pix * cbStep / LOGO_SHOW_STEPS;3055 *pu8TmpPtr++ = pix * cbStep / LOGO_SHOW_STEPS;3056 *pu8TmpPtr++ = pix * cbStep / LOGO_SHOW_STEPS;3057 *pu8TmpPtr++;3058 3059 j = (j + 1) % 8;3060 break;3061 }3062 3063 case 4:3064 {3065 if (!j)3066 c = *pu8Src++;3067 3068 pix = (c >> 4) & 0xF;3069 c <<= 4;3070 3071 uint32_t u32Pal = pu32Palette[pix];3072 3073 pix = (u32Pal >> 16) & 0xFF;3074 *pu8TmpPtr++ = pix * cbStep / LOGO_SHOW_STEPS;3075 pix = (u32Pal >> 8) & 0xFF;3076 *pu8TmpPtr++ = pix * cbStep / LOGO_SHOW_STEPS;3077 pix = u32Pal & 0xFF;3078 *pu8TmpPtr++ = pix * cbStep / LOGO_SHOW_STEPS;3079 *pu8TmpPtr++;3080 3081 j = (j + 1) % 2;3082 break;3083 }3084 3085 case 8:3086 {3087 uint32_t u32Pal = pu32Palette[*pu8Src++];3088 3089 pix = (u32Pal >> 16) & 0xFF;3090 *pu8TmpPtr++ = pix * cbStep / LOGO_SHOW_STEPS;3091 pix = (u32Pal >> 8) & 0xFF;3092 *pu8TmpPtr++ = pix * cbStep / LOGO_SHOW_STEPS;3093 pix = u32Pal & 0xFF;3094 *pu8TmpPtr++ = pix * cbStep / LOGO_SHOW_STEPS;3095 *pu8TmpPtr++;3096 break;3097 }3098 3099 case 24:3100 *pu8TmpPtr++ = *pu8Src++ * cbStep / LOGO_SHOW_STEPS;3101 *pu8TmpPtr++ = *pu8Src++ * cbStep / LOGO_SHOW_STEPS;3102 *pu8TmpPtr++ = *pu8Src++ * cbStep / LOGO_SHOW_STEPS;3103 *pu8TmpPtr++;3104 break;3105 }3106 }3107 3108 pu8Dst -= cbLineDst;3109 pu8Src += cbPadBytes;3110 }3111 }3112 3113 3114 /**3115 2857 * Port I/O Handler for VGA OUT operations. 3116 2858 * … … 3926 3668 3927 3669 3670 /** 3671 * Parse the logo bitmap data at init time. 3672 * 3673 * @returns VBox status code. 3674 * 3675 * @param pData The VGA instance data. 3676 */ 3677 static int vbeParseBitmap(PVGASTATE pData) 3678 { 3679 uint16_t i; 3680 PBMPINFO bmpInfo; 3681 POS2HDR pOs2Hdr; 3682 POS22HDR pOs22Hdr; 3683 PWINHDR pWinHdr; 3684 3685 /* 3686 * Get bitmap header data 3687 */ 3688 bmpInfo = (PBMPINFO)(pData->pu8Logo + sizeof(LOGOHDR)); 3689 pWinHdr = (PWINHDR)(pData->pu8Logo + sizeof(LOGOHDR) + sizeof(BMPINFO)); 3690 3691 if (bmpInfo->Type == BMP_ID) 3692 { 3693 switch (pWinHdr->Size) 3694 { 3695 case BMP_HEADER_OS21: 3696 pOs2Hdr = (POS2HDR)pWinHdr; 3697 pData->cxLogo = pOs2Hdr->Width; 3698 pData->cyLogo = pOs2Hdr->Height; 3699 pData->cLogoPlanes = pOs2Hdr->Planes; 3700 pData->cLogoBits = pOs2Hdr->BitCount; 3701 pData->LogoCompression = BMP_COMPRESS_NONE; 3702 pData->cLogoUsedColors = 0; 3703 break; 3704 3705 case BMP_HEADER_OS22: 3706 pOs22Hdr = (POS22HDR)pWinHdr; 3707 pData->cxLogo = pOs22Hdr->Width; 3708 pData->cyLogo = pOs22Hdr->Height; 3709 pData->cLogoPlanes = pOs22Hdr->Planes; 3710 pData->cLogoBits = pOs22Hdr->BitCount; 3711 pData->LogoCompression = pOs22Hdr->Compression; 3712 pData->cLogoUsedColors = pOs22Hdr->ClrUsed; 3713 break; 3714 3715 case BMP_HEADER_WIN3: 3716 pData->cxLogo = pWinHdr->Width; 3717 pData->cyLogo = pWinHdr->Height; 3718 pData->cLogoPlanes = pWinHdr->Planes; 3719 pData->cLogoBits = pWinHdr->BitCount; 3720 pData->LogoCompression = pWinHdr->Compression; 3721 pData->cLogoUsedColors = pWinHdr->ClrUsed; 3722 break; 3723 3724 default: 3725 AssertMsgFailed(("Unsupported bitmap header.\n")); 3726 break; 3727 } 3728 3729 if (pData->cxLogo > LOGO_MAX_WIDTH || pData->cyLogo > LOGO_MAX_HEIGHT) 3730 { 3731 AssertMsgFailed(("Bitmap %ux%u is too big.\n", pData->cxLogo, pData->cyLogo)); 3732 return VERR_INVALID_PARAMETER; 3733 } 3734 3735 if (pData->cLogoPlanes != 1) 3736 { 3737 AssertMsgFailed(("Bitmap planes %u != 1.\n", pData->cLogoPlanes)); 3738 return VERR_INVALID_PARAMETER; 3739 } 3740 3741 if (pData->cLogoBits != 4 && pData->cLogoBits != 8 && pData->cLogoBits != 24) 3742 { 3743 AssertMsgFailed(("Unsupported %u depth.\n", pData->cLogoBits)); 3744 return VERR_INVALID_PARAMETER; 3745 } 3746 3747 if (pData->cLogoUsedColors > 256) 3748 { 3749 AssertMsgFailed(("Unsupported %u colors.\n", pData->cLogoUsedColors)); 3750 return VERR_INVALID_PARAMETER; 3751 } 3752 3753 if (pData->LogoCompression != BMP_COMPRESS_NONE) 3754 { 3755 AssertMsgFailed(("Unsupported %u compression.\n", pData->LogoCompression)); 3756 return VERR_INVALID_PARAMETER; 3757 } 3758 3759 /* 3760 * Read bitmap palette 3761 */ 3762 if (!pData->cLogoUsedColors) 3763 pData->cLogoPalEntries = 1 << (pData->cLogoPlanes * pData->cLogoBits); 3764 else 3765 pData->cLogoPalEntries = pData->cLogoUsedColors; 3766 3767 if (pData->cLogoPalEntries) 3768 { 3769 const uint8_t *pu8Pal = pData->pu8Logo + sizeof(LOGOHDR) + sizeof(BMPINFO) + pWinHdr->Size; /* ASSUMES Size location (safe) */ 3770 3771 for (i = 0; i <= pData->cLogoPalEntries; i++) 3772 { 3773 uint16_t j; 3774 uint32_t u32Pal = 0; 3775 3776 for (j = 0; j < 3; j++) 3777 { 3778 uint8_t b = *pu8Pal++; 3779 u32Pal <<= 8; 3780 u32Pal |= b; 3781 } 3782 3783 pu8Pal++; /* skip unused byte */ 3784 pData->au32LogoPalette[i] = u32Pal; 3785 } 3786 } 3787 3788 /* 3789 * Bitmap data offset 3790 */ 3791 pData->pu8LogoBitmap = pData->pu8Logo + sizeof(LOGOHDR) + bmpInfo->Offset; 3792 } 3793 3794 return VINF_SUCCESS; 3795 } 3796 3797 3798 /** 3799 * Show logo bitmap data. 3800 * 3801 * @returns VBox status code. 3802 * 3803 * @param cbDepth Logo depth. 3804 * @param xLogo Logo X position. 3805 * @param yLogo Logo Y position. 3806 * @param cxLogo Logo width. 3807 * @param cyLogo Logo height. 3808 * @param iStep Fade in/fade out step. 3809 * @param pu32Palette Palette data. 3810 * @param pu8Src Source buffer. 3811 * @param pu8Dst Destination buffer. 3812 */ 3813 static void vbeShowBitmap(uint16_t cBits, uint16_t xLogo, uint16_t yLogo, uint16_t cxLogo, uint16_t cyLogo, uint8_t iStep, 3814 const uint32_t *pu32Palette, const uint8_t *pu8Src, uint8_t *pu8Dst) 3815 { 3816 uint16_t i; 3817 size_t cbPadBytes = 0; 3818 size_t cbLineDst = LOGO_MAX_WIDTH * 4; 3819 uint16_t cyLeft = cyLogo; 3820 3821 pu8Dst += xLogo * 4 + yLogo * cbLineDst; 3822 3823 switch (cBits) 3824 { 3825 case 1: 3826 pu8Dst += cyLogo * cbLineDst; 3827 cbPadBytes = 0; 3828 break; 3829 3830 case 4: 3831 if (((cxLogo % 8) == 0) || ((cxLogo % 8) > 6)) 3832 cbPadBytes = 0; 3833 else if ((cxLogo % 8) <= 2) 3834 cbPadBytes = 3; 3835 else if ((cxLogo % 8) <= 4) 3836 cbPadBytes = 2; 3837 else 3838 cbPadBytes = 1; 3839 break; 3840 3841 case 8: 3842 cbPadBytes = ((cxLogo % 4) == 0) ? 0 : (4 - (cxLogo % 4)); 3843 break; 3844 3845 case 24: 3846 cbPadBytes = cxLogo % 4; 3847 break; 3848 } 3849 3850 uint8_t j = 0, c = 0; 3851 3852 while (cyLeft-- > 0) 3853 { 3854 uint8_t *pu8TmpPtr = pu8Dst; 3855 3856 if (cBits != 1) 3857 j = 0; 3858 3859 for (i = 0; i < cxLogo; i++) 3860 { 3861 uint8_t pix; 3862 3863 switch (cBits) 3864 { 3865 case 1: 3866 { 3867 if (!j) 3868 c = *pu8Src++; 3869 3870 pix = (c & 1) ? 0xFF : 0; 3871 c >>= 1; 3872 3873 *pu8TmpPtr++ = pix * iStep / LOGO_SHOW_STEPS; 3874 *pu8TmpPtr++ = pix * iStep / LOGO_SHOW_STEPS; 3875 *pu8TmpPtr++ = pix * iStep / LOGO_SHOW_STEPS; 3876 *pu8TmpPtr++; 3877 3878 j = (j + 1) % 8; 3879 break; 3880 } 3881 3882 case 4: 3883 { 3884 if (!j) 3885 c = *pu8Src++; 3886 3887 pix = (c >> 4) & 0xF; 3888 c <<= 4; 3889 3890 uint32_t u32Pal = pu32Palette[pix]; 3891 3892 pix = (u32Pal >> 16) & 0xFF; 3893 *pu8TmpPtr++ = pix * iStep / LOGO_SHOW_STEPS; 3894 pix = (u32Pal >> 8) & 0xFF; 3895 *pu8TmpPtr++ = pix * iStep / LOGO_SHOW_STEPS; 3896 pix = u32Pal & 0xFF; 3897 *pu8TmpPtr++ = pix * iStep / LOGO_SHOW_STEPS; 3898 *pu8TmpPtr++; 3899 3900 j = (j + 1) % 2; 3901 break; 3902 } 3903 3904 case 8: 3905 { 3906 uint32_t u32Pal = pu32Palette[*pu8Src++]; 3907 3908 pix = (u32Pal >> 16) & 0xFF; 3909 *pu8TmpPtr++ = pix * iStep / LOGO_SHOW_STEPS; 3910 pix = (u32Pal >> 8) & 0xFF; 3911 *pu8TmpPtr++ = pix * iStep / LOGO_SHOW_STEPS; 3912 pix = u32Pal & 0xFF; 3913 *pu8TmpPtr++ = pix * iStep / LOGO_SHOW_STEPS; 3914 *pu8TmpPtr++; 3915 break; 3916 } 3917 3918 case 24: 3919 *pu8TmpPtr++ = *pu8Src++ * iStep / LOGO_SHOW_STEPS; 3920 *pu8TmpPtr++ = *pu8Src++ * iStep / LOGO_SHOW_STEPS; 3921 *pu8TmpPtr++ = *pu8Src++ * iStep / LOGO_SHOW_STEPS; 3922 *pu8TmpPtr++; 3923 break; 3924 } 3925 } 3926 3927 pu8Dst -= cbLineDst; 3928 pu8Src += cbPadBytes; 3929 } 3930 } 3931 3932 3933 3928 3934 3929 3935 /** … … 3951 3957 switch (u32 & 0xFF00) 3952 3958 { 3953 int i, j;3954 3959 case LOGO_CMD_SET_OFFSET: 3955 3960 pData->offLogoData = u32 & 0xFF; … … 3958 3963 case LOGO_CMD_SHOW_BMP: 3959 3964 { 3960 uint8_t cbStep = u32 & 0xFF; 3961 3962 const uint8_t *pu8Src = pData->pu8Bitmap; 3965 uint8_t iStep = u32 & 0xFF; 3966 const uint8_t *pu8Src = pData->pu8LogoBitmap; 3963 3967 uint8_t *pu8Dst; 3964 3968 PLOGOHDR pLogoHdr = (PLOGOHDR)pData->pu8Logo; 3965 uint16_t xLogo, yLogo;3966 3969 uint32_t offDirty = 0; 3967 3968 xLogo = (LOGO_MAX_WIDTH - pData->cbWidth) / 2; 3969 yLogo = LOGO_MAX_HEIGHT - (LOGO_MAX_HEIGHT - pData->cbHeight) / 2; 3970 uint16_t xLogo = (LOGO_MAX_WIDTH - pData->cxLogo) / 2; 3971 uint16_t yLogo = LOGO_MAX_HEIGHT - (LOGO_MAX_HEIGHT - pData->cyLogo) / 2; 3970 3972 3971 3973 if (pData->vram_size >= LOGO_MAX_SIZE * 2) 3972 pu8Dst = (uint8_t *)pData->vram_ptrHC + LOGO_MAX_SIZE;3974 pu8Dst = pData->vram_ptrHC + LOGO_MAX_SIZE; 3973 3975 else 3974 pu8Dst = (uint8_t *)pData->vram_ptrHC;3975 3976 /* Clear screen */3977 if (!pData->f ClearScreen)3976 pu8Dst = pData->vram_ptrHC; 3977 3978 /* Clear screen - except on power on... */ 3979 if (!pData->fLogoClearScreen) 3978 3980 { 3979 uint32_t *pu32TmpPtr; 3980 pu32TmpPtr = (uint32_t *)pu8Dst; 3981 uint32_t *pu32TmpPtr = (uint32_t *)pu8Dst; 3981 3982 3982 3983 /* Clear vram */ 3983 for (i = 0; i < LOGO_MAX_WIDTH; i++)3984 for (int i = 0; i < LOGO_MAX_WIDTH; i++) 3984 3985 { 3985 for ( j = 0; j < LOGO_MAX_HEIGHT; j++)3986 for (int j = 0; j < LOGO_MAX_HEIGHT; j++) 3986 3987 *pu32TmpPtr++ = 0; 3987 3988 } 3988 pData->f ClearScreen = true;3989 pData->fLogoClearScreen = true; 3989 3990 } 3990 3991 3991 /* Show bitmap*/3992 vbeShowBitmap(pData->c bBitCount, xLogo, yLogo,3993 pData->c bWidth, pData->cbHeight,3994 cbStep, (uint32_t *)&pData->au32Palette[0],3992 /* Show the bitmap. */ 3993 vbeShowBitmap(pData->cLogoBits, xLogo, yLogo, 3994 pData->cxLogo, pData->cyLogo, 3995 iStep, &pData->au32LogoPalette[0], 3995 3996 pu8Src, pu8Dst); 3996 3997 3997 /* Show 'Press F12...' text*/3998 /* Show the 'Press F12...' text. */ 3998 3999 if (pLogoHdr->fu8ShowBootMenu == 2) 3999 {4000 4000 vbeShowBitmap(1, LOGO_F12TEXT_X, LOGO_F12TEXT_Y, 4001 4001 LOGO_F12TEXT_WIDTH, LOGO_F12TEXT_HEIGHT, 4002 cbStep, (uint32_t *)&pData->au32Palette[0],4002 iStep, &pData->au32LogoPalette[0], 4003 4003 &g_abLogoF12BootText[0], pu8Dst); 4004 } 4005 4006 /* Blit offscreen buffer */ 4004 4005 /* Blit the offscreen buffer. */ 4007 4006 if (pData->vram_size >= LOGO_MAX_SIZE * 2) 4008 4007 { 4009 4008 uint32_t *pu32TmpDst = (uint32_t *)pData->vram_ptrHC; 4010 uint32_t *pu32TmpSrc = (uint32_t *) pData->vram_ptrHC + LOGO_MAX_SIZE / 4;4011 for (i = 0; i < LOGO_MAX_WIDTH; i++)4009 uint32_t *pu32TmpSrc = (uint32_t *)(pData->vram_ptrHC + LOGO_MAX_SIZE); 4010 for (int i = 0; i < LOGO_MAX_WIDTH; i++) 4012 4011 { 4013 for ( j = 0; j < LOGO_MAX_HEIGHT; j++)4012 for (int j = 0; j < LOGO_MAX_HEIGHT; j++) 4014 4013 *pu32TmpDst++ = *pu32TmpSrc++; 4015 4014 } 4016 } 4017 4018 /* Set dirty flags*/4015 } 4016 4017 /* Set the dirty flags. */ 4019 4018 while (offDirty <= LOGO_MAX_SIZE) 4020 4019 { -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r7890 r7914 326 326 R3PTRTYPE(char *) pszLogoFile; 327 327 /** Bitmap image data. */ 328 R3PTRTYPE(uint8_t *) pu8Bitmap; 329 /** Clear screen flag. */ 330 uint8_t fClearScreen; 331 uint8_t Padding8; /**< Alignment padding. */ 328 R3PTRTYPE(uint8_t *) pu8LogoBitmap; 332 329 /** Current logo command. */ 333 330 uint16_t LogoCommand; 334 331 /** Bitmap width. */ 335 uint16_t c bWidth;332 uint16_t cxLogo; 336 333 /** Bitmap height. */ 337 uint16_t c bHeight;334 uint16_t cyLogo; 338 335 /** Bitmap planes. */ 339 uint16_t c bPlanes;336 uint16_t cLogoPlanes; 340 337 /** Bitmap depth. */ 341 uint16_t c bBitCount;338 uint16_t cLogoBits; 342 339 /** Bitmap compression. */ 343 uint16_t Compression;340 uint16_t LogoCompression; 344 341 /** Bitmap colors used. */ 345 uint16_t c bClrUsed;342 uint16_t cLogoUsedColors; 346 343 /** Palette size. */ 347 uint16_t cbPal; 348 uint8_t Padding9[6]; /**< Alignment padding. */ 344 uint16_t cLogoPalEntries; 345 /** Clear screen flag. */ 346 uint8_t fLogoClearScreen; 347 uint8_t Padding8[7]; /**< Alignment padding. */ 349 348 /** Palette data. */ 350 uint32_t au32 Palette[256];349 uint32_t au32LogoPalette[256]; 351 350 #endif /* VBOX */ 352 351 } VGAState;
Note:
See TracChangeset
for help on using the changeset viewer.