VirtualBox

Changeset 7774 in vbox


Ignore:
Timestamp:
Apr 7, 2008 3:07:29 PM (17 years ago)
Author:
vboxsync
Message:

Moved the LOGO_* defines and LOGOHDR to a common header instead of keeping duplicates around the place.

Location:
trunk
Files:
1 added
4 edited

Legend:

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

    r7760 r7774  
    9393#include <VBox/VBoxGuest.h>
    9494#include <VBox/VBoxVideo.h>
     95#include <VBox/bioslogo.h>
    9596
    9697#if defined(VBE_NEW_DYN_LIST) && defined(IN_RING3) && !defined(VBOX_DEVICE_STRUCT_TESTCASE)
     
    108109*******************************************************************************/
    109110/* "Press F12 to select boot device." bitmap. */
    110 static const uint8_t g_abLogoF12BootText[] = 
     111static const uint8_t g_abLogoF12BootText[] =
    111112{
    112113    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     
    53815382     * Register I/O Port for the BIOS Logo.
    53825383     */
    5383     rc = PDMDevHlpIOPortRegister(pDevIns, VBE_LOGO_PORT, 1, NULL, vbeIOPortWriteCMDLogo, vbeIOPortReadCMDLogo, NULL, NULL, "BIOS Logo");
     5384    rc = PDMDevHlpIOPortRegister(pDevIns, LOGO_IO_PORT, 1, NULL, vbeIOPortWriteCMDLogo, vbeIOPortReadCMDLogo, NULL, NULL, "BIOS Logo");
    53845385    if (VBOX_FAILURE(rc))
    53855386        return rc;
     
    53885389     * Construct the logo header.
    53895390     */
    5390     LOGOHDR LogoHdr = { LOGO_HDR_MAGIC, 0, 0, 0, 0, 0 };
    5391 
    5392     rc = CFGMR3QueryU8(pCfgHandle, "FadeIn", &LogoHdr.u8FadeIn);
     5391    LOGOHDR LogoHdr = { LOGO_HDR_MAGIC, 0, 0, 0, 0, 0, 0 };
     5392
     5393    rc = CFGMR3QueryU8(pCfgHandle, "FadeIn", &LogoHdr.fu8FadeIn);
    53935394    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    5394         LogoHdr.u8FadeIn = 1;
     5395        LogoHdr.fu8FadeIn = 1;
    53955396    else if (VBOX_FAILURE(rc))
    53965397        return PDMDEV_SET_ERROR(pDevIns, rc,
    53975398                                N_("Configuration error: Querying \"FadeIn\" as integer failed"));
    53985399
    5399     rc = CFGMR3QueryU8(pCfgHandle, "FadeOut", &LogoHdr.u8FadeOut);
     5400    rc = CFGMR3QueryU8(pCfgHandle, "FadeOut", &LogoHdr.fu8FadeOut);
    54005401    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    5401         LogoHdr.u8FadeOut = 1;
     5402        LogoHdr.fu8FadeOut = 1;
    54025403    else if (VBOX_FAILURE(rc))
    54035404        return PDMDEV_SET_ERROR(pDevIns, rc,
     
    54115412                                N_("Configuration error: Querying \"LogoTime\" as integer failed"));
    54125413
    5413     rc = CFGMR3QueryU8(pCfgHandle, "ShowBootMenu", &LogoHdr.u8ShowBootMenu);
     5414    rc = CFGMR3QueryU8(pCfgHandle, "ShowBootMenu", &LogoHdr.fu8ShowBootMenu);
    54145415    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    5415         LogoHdr.u8ShowBootMenu = 0;
     5416        LogoHdr.fu8ShowBootMenu = 0;
    54165417    else if (VBOX_FAILURE(rc))
    54175418        return PDMDEV_SET_ERROR(pDevIns, rc,
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r7760 r7774  
    385385#endif /* VBE_NEW_DYN_LIST */
    386386
    387 /** The extra port which is used to show the BIOS logo.
    388  * @remark duplicated in logo.c. */
    389 #define VBE_LOGO_PORT        0x3b8
    390 
    391 /** The BIOS logo fade in/fade out steps.
    392  * @remark duplicated in logo.c. */
    393 #define LOGO_SHOW_STEPS      64
    394 
    395 /** The BIOS boot menu text position. */
    396 #define LOGO_F12TEXT_X       340
    397 #define LOGO_F12TEXT_Y       455
    398 
    399 /** Width and height of the "Press F12 to select boot device." bitmap.
    400     Anything that exceeds the limit of F12BootText below is filled with
    401     background. */
    402 #define LOGO_F12TEXT_WIDTH   286
    403 #define LOGO_F12TEXT_HEIGHT  12
    404 
    405 /** The BIOS logo commands.
    406  * @remark duplicated in logo.c. */
    407 #define LOGO_IMAGE_DEFAULT   0
    408 #define LOGO_IMAGE_EXTERNAL  1
    409 
    410 #define LOGO_MAX_WIDTH       640
    411 #define LOGO_MAX_HEIGHT      480
    412 
    413 #define LOGO_CMD_NOP         0
    414 #define LOGO_CMD_SET_OFFSET  0x100
    415 #define LOGO_CMD_SET_X       0x200
    416 #define LOGO_CMD_SET_Y       0x300
    417 #define LOGO_CMD_SET_WIDTH   0x400
    418 #define LOGO_CMD_SET_HEIGHT  0x500
    419 #define LOGO_CMD_SET_DEPTH   0x600
    420 #define LOGO_CMD_SET_PALSIZE 0x700
    421 #define LOGO_CMD_SET_DEFAULT 0x800
    422 #define LOGO_CMD_SET_PAL     0x900
    423 #define LOGO_CMD_SHOW_BMP    0xA00
    424 #define LOGO_CMD_SHOW_TEXT   0xB00
    425 #define LOGO_CMD_CLS         0xC00
    426 
    427 /**
    428  * PC Bios logo data structure.
    429  */
    430 #pragma pack(2) /* pack(2) is important! (seems that bios compiled with pack(2)...) */ /** @todo r=bird: add 3 uint8_t's before cbLogo and it'll be just fine. */
    431 typedef struct LOGOHDR
    432 {
    433     /** Signature (LOGO_HDR_MAGIC/0x66BB). */
    434     uint16_t        u16Signature;
    435     /** Fade in - boolean. */
    436     uint8_t         u8FadeIn;
    437     /** Fade out - boolean. */
    438     uint8_t         u8FadeOut;
    439     /** Logo time (msec). */
    440     uint16_t        u16LogoMillies;
    441     /** Show setup - boolean. */
    442     uint8_t         u8ShowBootMenu;
    443     /** Logo file size. */
    444     uint32_t        cbLogo;
    445 } LOGOHDR, *PLOGOHDR;
    446 #pragma pack()
    447 
    448 /** The value of the LOGOHDR::u16Signature field. */
    449 #define LOGO_HDR_MAGIC      0x66BB
    450 
    451 /** The value which will switch you the default logo. */
    452 #define LOGO_DEFAULT_LOGO   0xFFFF
    453 
    454387#if !defined(VBOX) || defined(IN_RING3)
    455388static inline int c6_to_8(int v)
  • trunk/src/VBox/Devices/PC/BIOS/Makefile.kmk

    r7759 r7774  
    6161
    6262# 1. precompile rombios.c
    63 $(PATH_TARGET)/_rombios_.c: $(PATH_SUB_CURRENT)/rombios.c $(PATH_SUB_CURRENT)/logo.c $(PATH_SUB_CURRENT)/apmbios.S $(PATH_SUB_CURRENT)/../DevPcBios.h | $(call DIRDEP,$(TARGET_PATH))
     63$(PATH_TARGET)/_rombios_.c: $(PATH_SUB_CURRENT)/rombios.c $(PATH_SUB_CURRENT)/logo.c $(PATH_SUB_CURRENT)/apmbios.S \
     64                $(PATH_SUB_CURRENT)/../DevPcBios.h $(PATH_ROOT)/include/VBox/bioslogo.h | $(call DIRDEP,$(TARGET_PATH))
    6465        $(call MSG_TOOL,cpp,PcBiosBin,$<,$@)
    65         $(QUIET)$(TOOL_$(VBOX_GCC_TOOL)_CC) -E -I$(PATH_TARGET) -I$(VBOX_PATH_DEVICES_SRC)/PC -I$(PATH_ROOT)/include -I$(PATH_OUT) -DBX_SMP_PROCESSORS=1 -DVBOX $(addprefix -D,$(DEFS) $(DEFS.$(BUILD_TYPE))) -P -o $@ $<
     66        $(QUIET)$(TOOL_$(VBOX_GCC_TOOL)_CC) -E -I$(PATH_TARGET) -I$(VBOX_PATH_DEVICES_SRC)/PC -I$(PATH_ROOT)/include -I$(PATH_OUT) -DBX_SMP_PROCESSORS=1 -DVBOX -DVBOX_PC_BIOS $(addprefix -D,$(DEFS) $(DEFS.$(BUILD_TYPE))) -P -o $@ $<
    6667
    6768# 2. compile to intermediate asm file - tempfile clashes, make sure it's built alone.
  • trunk/src/VBox/Devices/PC/BIOS/logo.c

    r7759 r7774  
    1313#define F12_WAIT_TIME        (3 * WAIT_HZ)   /* 3 seconds. Used only if logo disabled. */
    1414
    15 #define LOGO_SHOW_STEPS      64
    16 
    17 #define LOGO_IMAGE_DEFAULT   0
    18 #define LOGO_IMAGE_EXTERNAL  1
    19 
    20 #define LOGO_CMD_NOP         0
    21 #define LOGO_CMD_SET_OFFSET  0x100
    22 #define LOGO_CMD_SET_X       0x200
    23 #define LOGO_CMD_SET_Y       0x300
    24 #define LOGO_CMD_SET_WIDTH   0x400
    25 #define LOGO_CMD_SET_HEIGHT  0x500
    26 #define LOGO_CMD_SET_DEPTH   0x600
    27 #define LOGO_CMD_SET_PALSIZE 0x700
    28 #define LOGO_CMD_SET_DEFAULT 0x800
    29 #define LOGO_CMD_SET_PAL     0x900
    30 #define LOGO_CMD_SHOW_BMP    0xA00
    31 #define LOGO_CMD_SHOW_TEXT   0xB00
    32 #define LOGO_CMD_CLS         0xC00
    33 
    34 #define LOGO_IO_PORT         0x3b8
     15#define uint8_t    Bit8u
     16#define uint16_t   Bit16u
     17#define uint32_t   Bit32u
     18#include <VBox/bioslogo.h>
    3519
    3620typedef struct
     
    10185} WINHDR;
    10286
    103 // Logo settings header
    104 typedef struct
    105 {
    106     Bit16u Signature;
    107     Bit8u  FadeIn;
    108     Bit8u  FadeOut;
    109     Bit16u LogoTime;
    110     Bit8u  ShowBootMenu;
    111     Bit32u LogoSize;
    112 
    113 } LOGOHDR;
    114 
    11587
    11688static unsigned char get_mode();
     
    561533
    562534    // Get main signature
    563     tmp = read_logo_word(&logo_hdr->Signature);
     535    tmp = read_logo_word(&logo_hdr->u16Signature);
    564536    if (tmp != 0x66BB)
    565537        goto done;
    566538
    567539    // Get options
    568     is_fade_in = read_logo_byte(&logo_hdr->FadeIn);
    569     is_fade_out = read_logo_byte(&logo_hdr->FadeOut);
    570     logo_time = read_logo_word(&logo_hdr->LogoTime);
    571     uBootMenu = read_logo_byte(&logo_hdr->ShowBootMenu);
     540    is_fade_in = read_logo_byte(&logo_hdr->fu8FadeIn);
     541    is_fade_out = read_logo_byte(&logo_hdr->fu8FadeOut);
     542    logo_time = read_logo_word(&logo_hdr->u16LogoMillies);
     543    uBootMenu = read_logo_byte(&logo_hdr->fu8ShowBootMenu);
    572544
    573545    // Is Logo disabled?
     
    702674                if (uBootMenu == 2)
    703675                    show_boot_text(i);
    704    
     676
    705677                wait(16 / WAIT_MS, 0);
    706678            }
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