- function text_update() prepared for new features. New structure

'bx_vga_tminfo_t' replaces variable 'cursor_state'.
This commit is contained in:
Volker Ruppert 2003-05-07 19:15:47 +00:00
parent d01a789269
commit 5ab9786871
14 changed files with 58 additions and 44 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: amigaos.cc,v 1.16 2003-04-08 17:56:45 nicholai Exp $
// $Id: amigaos.cc,v 1.17 2003-05-07 19:15:45 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2000 MandrakeSoft S.A.
@ -443,7 +443,7 @@ bx_amigaos_gui_c::clear_screen(void)
void
bx_amigaos_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
unsigned long cursor_x, unsigned long cursor_y,
Bit16u cursor_state, unsigned nrows)
bx_vga_tminfo_t tm_info, unsigned nrows)
{
int i;
int cursori;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: beos.cc,v 1.22 2002-11-22 15:14:39 bdenney Exp $
// $Id: beos.cc,v 1.23 2003-05-07 19:15:45 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -346,7 +346,7 @@ bx_beos_gui_c::clear_screen(void)
void
bx_beos_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
unsigned long cursor_x, unsigned long cursor_y,
Bit16u cursor_state, unsigned nrows)
bx_vga_tminfo_t tm_info, unsigned nrows)
{
unsigned i, x, y;
BPoint point;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: carbon.cc,v 1.17 2002-11-19 05:47:44 bdenney Exp $
// $Id: carbon.cc,v 1.18 2003-05-07 19:15:45 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -1068,7 +1068,7 @@ void bx_carbon_gui_c::clear_screen(void)
void bx_carbon_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
unsigned long cursor_x, unsigned long cursor_y,
Bit16u cursor_state, unsigned nrows)
bx_vga_tminfo_t tm_info, unsigned nrows)
{
int i;
unsigned char achar;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: gui.h,v 1.36 2002-12-12 06:21:43 yakovlev Exp $
// $Id: gui.h,v 1.37 2003-05-07 19:15:46 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -24,6 +24,16 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
typedef struct bx_vga_tminfo_t {
Bit8u cs_start;
Bit8u cs_end;
Bit16u line_offset;
Bit16u line_compare;
Bit8u h_panning;
Bit8u v_panning;
};
BOCHSAPI extern class bx_gui_c *bx_gui;
@ -39,7 +49,7 @@ public:
unsigned x_tilesize, unsigned y_tilesize, unsigned header_bar_y) = 0;
virtual void text_update(Bit8u *old_text, Bit8u *new_text,
unsigned long cursor_x, unsigned long cursor_y,
Bit16u cursor_state, unsigned rows) = 0;
bx_vga_tminfo_t tm_info, unsigned rows) = 0;
virtual void graphics_tile_update(Bit8u *snapshot, unsigned x, unsigned y) = 0;
virtual void handle_events(void) = 0;
virtual void flush(void) = 0;
@ -139,7 +149,7 @@ protected:
unsigned header_bar_y); \
virtual void text_update(Bit8u *old_text, Bit8u *new_text, \
unsigned long cursor_x, unsigned long cursor_y, \
Bit16u cursor_state, unsigned rows); \
bx_vga_tminfo_t tm_info, unsigned rows); \
virtual void graphics_tile_update(Bit8u *snapshot, unsigned x, unsigned y); \
virtual void handle_events(void); \
virtual void flush(void); \

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: macintosh.cc,v 1.18 2002-12-12 15:29:01 cbothamy Exp $
// $Id: macintosh.cc,v 1.19 2003-05-07 19:15:46 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -811,7 +811,7 @@ void bx_macintosh_gui_c::clear_screen(void)
void bx_macintosh_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
unsigned long cursor_x, unsigned long cursor_y,
Bit16u cursor_state, unsigned nrows)
bx_vga_tminfo_t tm_info, unsigned nrows)
{
int i;
unsigned char achar;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: nogui.cc,v 1.18 2002-10-25 11:44:37 bdenney Exp $
// $Id: nogui.cc,v 1.19 2003-05-07 19:15:46 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -149,13 +149,13 @@ bx_nogui_gui_c::clear_screen(void)
void
bx_nogui_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
unsigned long cursor_x, unsigned long cursor_y,
Bit16u cursor_state, unsigned nrows)
bx_vga_tminfo_t tm_info, unsigned nrows)
{
UNUSED(old_text);
UNUSED(new_text);
UNUSED(cursor_x);
UNUSED(cursor_y);
UNUSED(cursor_state);
UNUSED(tm_info);
UNUSED(nrows);
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: rfb.cc,v 1.20 2002-11-19 05:47:44 bdenney Exp $
// $Id: rfb.cc,v 1.21 2003-05-07 19:15:46 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2000 Psyon.Org!
@ -539,7 +539,7 @@ void bx_rfb_gui_c::clear_screen(void)
// cursor_x: new x location of cursor
// cursor_y: new y location of cursor
void bx_rfb_gui_c::text_update(Bit8u *old_text, Bit8u *new_text, unsigned long cursor_x, unsigned long cursor_y, Bit16u cursor_state, unsigned nrows)
void bx_rfb_gui_c::text_update(Bit8u *old_text, Bit8u *new_text, unsigned long cursor_x, unsigned long cursor_y, bx_vga_tminfo_t tm_info, unsigned nrows)
{
unsigned char cChar;
unsigned int nchars;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: sdl.cc,v 1.32 2002-12-28 11:49:16 vruppert Exp $
// $Id: sdl.cc,v 1.33 2003-05-07 19:15:46 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -269,7 +269,7 @@ void bx_sdl_gui_c::text_update(
Bit8u *new_text,
unsigned long cursor_x,
unsigned long cursor_y,
Bit16u cursor_state,
bx_vga_tminfo_t tm_info,
unsigned rows)
{
unsigned char font_row, *pfont_row;
@ -284,8 +284,8 @@ void bx_sdl_gui_c::text_update(
Bit8u cs_start, cs_end, cs_line, mask;
bx_bool invert, forceUpdate;
cs_start = (cursor_state >> 8) & 0x3f;
cs_end = cursor_state & 0x1f;
cs_start = tm_info.cs_start;
cs_end = tm_info.cs_end;
forceUpdate = 0;
if(charmap_updated)

View File

@ -129,7 +129,7 @@ void bx_svga_gui_c::text_update(
Bit8u *new_text,
unsigned long cursor_x,
unsigned long cursor_y,
Bit16u cursor_state,
bx_vga_tminfo_t tm_info,
unsigned rows)
{
unsigned x, y, i;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: term.cc,v 1.25 2002-11-20 12:23:40 bdenney Exp $
// $Id: term.cc,v 1.26 2003-05-07 19:15:46 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2000 MandrakeSoft S.A.
@ -518,9 +518,9 @@ get_term_char(Bit8u vga_char[])
void
bx_term_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
unsigned long cursor_x, unsigned long cursor_y,
Bit16u cursor_state, unsigned nrows)
bx_vga_tminfo_t tm_info, unsigned nrows)
{
UNUSED(cursor_state);
UNUSED(tm_info);
chtype ch;
unsigned ncols = 4000/nrows/2;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: win32.cc,v 1.52 2003-05-04 16:03:23 vruppert Exp $
// $Id: win32.cc,v 1.53 2003-05-07 19:15:46 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -944,7 +944,7 @@ void bx_win32_gui_c::clear_screen(void) {
void bx_win32_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
unsigned long cursor_x, unsigned long cursor_y,
Bit16u cursor_state, unsigned nrows) {
bx_vga_tminfo_t tm_info, unsigned nrows) {
HDC hdc;
unsigned char cChar;
unsigned i, x, y;
@ -967,8 +967,8 @@ void bx_win32_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
charmap_updated = 0;
}
cs_start = (cursor_state >> 8) & 0x3f;
cs_end = cursor_state & 0x1f;
cs_start = tm_info.cs_start;
cs_end = tm_info.cs_end;
if (!stInfo.UIinited) return;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////
// $Id: wx.cc,v 1.54 2002-12-28 11:49:16 vruppert Exp $
// $Id: wx.cc,v 1.55 2003-05-07 19:15:46 vruppert Exp $
/////////////////////////////////////////////////////////////////
//
// wxWindows VGA display for Bochs. wx.cc implements a custom
@ -974,14 +974,14 @@ DrawBochsBitmap(int x, int y, int width, int height, char *bmap, char color, int
void bx_wx_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
unsigned long cursor_x, unsigned long cursor_y,
Bit16u cursor_state, unsigned nrows)
bx_vga_tminfo_t tm_info, unsigned nrows)
{
IFDBG_VGA(wxLogDebug (wxT ("text_update")));
//static Bit32u counter = 0;
//BX_INFO (("text_update executed %d times", ++counter));
Bit8u cs_start = (cursor_state >> 8) & 0x3f;
Bit8u cs_end = cursor_state & 0x1f;
Bit8u cs_start = tm_info.cs_start;
Bit8u cs_end = tm_info.cs_end;
unsigned char cChar;
unsigned int ncols = wxScreenX / 8;
unsigned int nchars = ncols * nrows;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: x.cc,v 1.62 2003-04-28 12:28:08 cbothamy Exp $
// $Id: x.cc,v 1.63 2003-05-07 19:15:47 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -1067,7 +1067,7 @@ bx_x_gui_c::clear_screen(void)
void
bx_x_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
unsigned long cursor_x, unsigned long cursor_y,
Bit16u cursor_state, unsigned nrows)
bx_vga_tminfo_t tm_info, unsigned nrows)
{
unsigned i, x, y, curs;
unsigned new_foreground, new_background;
@ -1107,8 +1107,8 @@ bx_x_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
charmap_updated = 0;
}
cs_start = (cursor_state >> 8) & 0x3f;
cs_end = cursor_state & 0x1f;
cs_start = tm_info.cs_start;
cs_end = tm_info.cs_end;
// Number of characters on screen, variable number of rows
nchars = columns*nrows;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: vga.cc,v 1.72 2003-05-06 17:10:13 vruppert Exp $
// $Id: vga.cc,v 1.73 2003-05-07 19:15:47 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -1629,9 +1629,16 @@ bx_vga_c::update(void)
else { // text mode
unsigned long start_address;
unsigned long cursor_address, cursor_x, cursor_y;
Bit16u cursor_state;
bx_vga_tminfo_t tm_info;
tm_info.cs_start = BX_VGA_THIS s.CRTC.reg[0x0a] & 0x3f;
tm_info.cs_end = BX_VGA_THIS s.CRTC.reg[0x0b] & 0x1f;
tm_info.line_offset = BX_VGA_THIS s.CRTC.reg[0x13] << 2;
tm_info.line_compare = BX_VGA_THIS s.line_compare;
tm_info.h_panning = BX_VGA_THIS s.attribute_ctrl.horiz_pel_panning & 0x0f;
tm_info.v_panning = BX_VGA_THIS s.CRTC.reg[0x08] & 0x1f;
switch (BX_VGA_THIS s.graphics_ctrl.memory_mapping) {
case 0: // 128K @ A0000
case 1: // 64K @ A0000
@ -1656,10 +1663,9 @@ bx_vga_c::update(void)
cursor_x = ((cursor_address - start_address)/2) % 80;
cursor_y = ((cursor_address - start_address)/2) / 80;
}
cursor_state = (BX_VGA_THIS s.CRTC.reg[0x0a] << 8) | BX_VGA_THIS s.CRTC.reg[0x0b];
bx_gui->text_update(BX_VGA_THIS s.text_snapshot,
&BX_VGA_THIS s.vga_memory[start_address],
cursor_x, cursor_y, cursor_state, 25);
cursor_x, cursor_y, tm_info, 25);
// screen updated, copy new VGA memory contents into text snapshot
memcpy(BX_VGA_THIS s.text_snapshot,
&BX_VGA_THIS s.vga_memory[start_address],
@ -1689,10 +1695,9 @@ bx_vga_c::update(void)
cursor_x = ((cursor_address - start_address)/2) % 80;
cursor_y = ((cursor_address - start_address)/2) / 80;
}
cursor_state = (BX_VGA_THIS s.CRTC.reg[0x0a] << 8) | BX_VGA_THIS s.CRTC.reg[0x0b];
bx_gui->text_update(BX_VGA_THIS s.text_snapshot,
&BX_VGA_THIS s.vga_memory[start_address],
cursor_x, cursor_y, cursor_state, 25);
cursor_x, cursor_y, tm_info, 25);
// screen updated, copy new VGA memory contents into text snapshot
memcpy(BX_VGA_THIS s.text_snapshot,
&BX_VGA_THIS s.vga_memory[start_address],
@ -1743,10 +1748,9 @@ bx_vga_c::update(void)
cursor_x = ((cursor_address - start_address)/2) % (iWidth/8);
cursor_y = ((cursor_address - start_address)/2) / (iWidth/8);
}
cursor_state = (BX_VGA_THIS s.CRTC.reg[0x0a] << 8) | BX_VGA_THIS s.CRTC.reg[0x0b];
bx_gui->text_update(BX_VGA_THIS s.text_snapshot,
&BX_VGA_THIS s.vga_memory[start_address],
cursor_x, cursor_y, cursor_state, rows);
cursor_x, cursor_y, tm_info, rows);
// screen updated, copy new VGA memory contents into text snapshot
memcpy(BX_VGA_THIS s.text_snapshot,
&BX_VGA_THIS s.vga_memory[start_address],