From ba58065da8a4da99557e2b9e38b5b851c35a0d40 Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Thu, 7 Feb 2002 19:04:30 +0000 Subject: [PATCH] - call dimension_update() only after a dimension change (patch from Dave Poirier ) --- bochs/iodev/vga.cc | 61 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/bochs/iodev/vga.cc b/bochs/iodev/vga.cc index a49bf6753..370e4bbe2 100644 --- a/bochs/iodev/vga.cc +++ b/bochs/iodev/vga.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: vga.cc,v 1.22 2002-02-04 20:31:35 vruppert Exp $ +// $Id: vga.cc,v 1.23 2002-02-07 19:04:30 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -41,6 +41,8 @@ bx_vga_c bx_vga; #define this (&bx_vga) #endif +unsigned old_iHeight = 0, old_iWidth = 0; + bx_vga_c::bx_vga_c(void) { BX_VGA_THIS s.vga_mem_updated = 0; @@ -962,7 +964,12 @@ BX_VGA_THIS s.sequencer.bit1 = (value >> 1) & 0x01; { unsigned iHeight, iWidth; determine_screen_dimensions(&iHeight, &iWidth); - bx_gui.dimension_update(iWidth, iHeight); + if( (iWidth != old_iWidth) || (iHeight != old_iHeight) ) + { + bx_gui.dimension_update(iWidth, iHeight); + old_iWidth = iWidth; + old_iHeight = iHeight; + } } needs_update = bx_gui.palette_change(BX_VGA_THIS s.pel.write_data_register, @@ -1142,6 +1149,7 @@ bx_vga_c::timer(void) void bx_vga_c::update(void) { + unsigned iHeight, iWidth; // fields that effect the way video memory is serialized into screen output: // GRAPHICS CONTROLLER: // BX_VGA_THIS s.graphics_ctrl.shift_reg: @@ -1163,7 +1171,6 @@ bx_vga_c::update(void) Bit8u color; unsigned bit_no, r, c; unsigned long byte_offset; - unsigned xti, yti; @@ -1173,7 +1180,6 @@ bx_vga_c::update(void) // (unsigned) BX_VGA_THIS s.graphics_ctrl.memory_mapping); switch ( BX_VGA_THIS s.graphics_ctrl.shift_reg ) { - unsigned iHeight, iWidth; case 0: // output data in serial fashion with each display plane // output on its associated serial output. Standard EGA/VGA format @@ -1182,7 +1188,12 @@ bx_vga_c::update(void) determine_screen_dimensions(&iHeight, &iWidth); //BX_DEBUG(("update(): Mode 12h: 640x480x16colors")); - bx_gui.dimension_update(iWidth, iHeight); + if( (iWidth != old_iWidth) || (iHeight != old_iHeight) ) + { + bx_gui.dimension_update(iWidth, iHeight); + old_iWidth = iWidth; + old_iHeight = iHeight; + } for (yti=0; yti BX_MAX_TEXT_LINES) BX_PANIC(("text rows>%d: %d",BX_MAX_TEXT_LINES,rows)); - bx_gui.dimension_update(8*80, 16*rows); // ??? should use font size + iWidth = 8*80; // TODO: should use font size + iHeight = 16*rows; + if( (iWidth != old_iWidth) || (iHeight != old_iHeight) ) + { + bx_gui.dimension_update(iWidth, iHeight); + old_iWidth = iWidth; + old_iHeight = iHeight; + } // pass old text snapshot & new VGA memory contents start_address = 2*((BX_VGA_THIS s.CRTC.reg[12] << 8) + BX_VGA_THIS s.CRTC.reg[13]); cursor_address = 2*((BX_VGA_THIS s.CRTC.reg[0x0e] << 8) |