- Timestamp:
- Oct 13, 2010 9:26:53 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r33089 r33091 4679 4679 4680 4680 /** 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 */ 4688 static 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 /** 4681 4719 * Info handler, device version. Dumps VGA memory formatted as 4682 4720 * ASCII text, no attributes. Only looks at the first page. … … 4705 4743 uint32_t offStart; 4706 4744 uint32_t uLineCompareIgn; 4745 uint32_t uVDisp; 4746 uint32_t uCharHeight; 4747 uint32_t uLines; 4748 4707 4749 vga_get_offsets(pThis, &cbLine, &offStart, &uLineCompareIgn); 4708 4750 if (!cbLine) 4709 4751 cbLine = 80 * 8; 4710 4752 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; 4712 4760 uint32_t cCols = cbLine / 8; 4713 4761 if (cRows * cCols * 8 <= pThis->vram_size) … … 6743 6791 * Register debugger info callbacks. 6744 6792 */ 6793 PDMDevHlpDBGFInfoRegister(pDevIns, "vga", "Display basic VGA state.", vgaInfoState); 6745 6794 PDMDevHlpDBGFInfoRegister(pDevIns, "vgatext", "Display VGA memory formatted as text.", vgaInfoText); 6746 6795 PDMDevHlpDBGFInfoRegister(pDevIns, "vgacr", "Dump VGA CRTC registers.", vgaInfoCR);
Note:
See TracChangeset
for help on using the changeset viewer.