VirtualBox

Changeset 33091 in vbox for trunk/src


Ignore:
Timestamp:
Oct 13, 2010 9:26:53 AM (14 years ago)
Author:
vboxsync
Message:

VGA: Dump more state information.

File:
1 edited

Legend:

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

    r33089 r33091  
    46794679
    46804680/**
     4681 * Info handler, device version. Dumps several interesting bits of the
     4682 * VGA state that are difficult to decode from the registers.
     4683 *
     4684 * @param   pDevIns     Device instance which registered the info.
     4685 * @param   pHlp        Callback functions for doing output.
     4686 * @param   pszArgs     Argument string. Optional and specific to the handler.
     4687 */
     4688static DECLCALLBACK(void) vgaInfoState(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
     4689{
     4690    PVGASTATE   s = PDMINS_2_DATA(pDevIns, PVGASTATE);
     4691    int         is_graph;
     4692    int         w, h, char_height;
     4693    int         val;
     4694
     4695    is_graph = s->gr[6] & 1;
     4696    pHlp->pfnPrintf(pHlp, "double scanning %s\n", s->cr[9] & 0x80 ? "on" : "off");
     4697    val = s->cr[0] + 5;
     4698    pHlp->pfnPrintf(pHlp, "htotal: %d px (%d cclk)\n", val * 8, val);
     4699    val = s->cr[6] + ((s->cr[7] & 1) << 8) + ((s->cr[7] & 0x20) << 4) + 2;
     4700    pHlp->pfnPrintf(pHlp, "vtotal: %d px\n", val);
     4701    val = s->cr[1] + 1;
     4702    w   = val * 8;
     4703    pHlp->pfnPrintf(pHlp, "hdisp : %d px (%d cclk)\n", w, val);
     4704    val = s->cr[0x12] + ((s->cr[7] & 2) << 7) + ((s->cr[7] & 0x40) << 4) + 1;
     4705    h   = val;
     4706    pHlp->pfnPrintf(pHlp, "vdisp : %d px\n", val);
     4707    val = (s->cr[0xc] << 8) + s->cr[0xd];
     4708    pHlp->pfnPrintf(pHlp, "start : %#x\n", val);
     4709    if (!is_graph)
     4710    {   
     4711        val = (s->cr[9] & 0x1f) + 1;
     4712        char_height = val;
     4713        pHlp->pfnPrintf(pHlp, "char height %d\n", val);
     4714        pHlp->pfnPrintf(pHlp, "text mode %dx%d\n", w / 8, h / char_height);
     4715    }
     4716}
     4717
     4718/**
    46814719 * Info handler, device version. Dumps VGA memory formatted as
    46824720 * ASCII text, no attributes. Only looks at the first page.
     
    47054743            uint32_t offStart;
    47064744            uint32_t uLineCompareIgn;
     4745            uint32_t uVDisp;
     4746            uint32_t uCharHeight;
     4747            uint32_t uLines;
     4748
    47074749            vga_get_offsets(pThis, &cbLine, &offStart, &uLineCompareIgn);
    47084750            if (!cbLine)
    47094751                cbLine = 80 * 8;
    47104752
    4711             uint32_t cRows = offStart / cbLine + 25;
     4753            uVDisp = pThis->cr[0x12] + ((pThis->cr[7] & 2) << 7) + ((pThis->cr[7] & 0x40) << 4) + 1;
     4754            uCharHeight = (pThis->cr[9] & 0x1f) + 1;
     4755            uLines = uVDisp / uCharHeight;
     4756            if (uLines < 25)
     4757                uLines = 25;
     4758
     4759            uint32_t cRows = offStart / cbLine + uLines;
    47124760            uint32_t cCols = cbLine / 8;
    47134761            if (cRows * cCols * 8 <= pThis->vram_size)
     
    67436791     * Register debugger info callbacks.
    67446792     */
     6793    PDMDevHlpDBGFInfoRegister(pDevIns, "vga", "Display basic VGA state.", vgaInfoState);
    67456794    PDMDevHlpDBGFInfoRegister(pDevIns, "vgatext", "Display VGA memory formatted as text.", vgaInfoText);
    67466795    PDMDevHlpDBGFInfoRegister(pDevIns, "vgacr", "Dump VGA CRTC registers.", vgaInfoCR);
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