- changes in the text update interface code

- changed argument for the text mode info structure to a pointer
  - added attribute controller palette to bx_vga_tminfo_t and removed the
    previous implementation
  - carbon.cc: attempt to fix the text mode colors (untested)
- x.cc: fixed warnings
This commit is contained in:
Volker Ruppert 2012-01-22 12:22:03 +00:00
parent 63ab13fe09
commit a34cf1bcd5
18 changed files with 203 additions and 208 deletions

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2000-2009 The Bochs Project
// Copyright (C) 2000-2012 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -419,7 +419,7 @@ void 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,
bx_vga_tminfo_t tm_info)
bx_vga_tminfo_t *tm_info)
{
int i;
int cursori;

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2009 The Bochs Project
// Copyright (C) 2001-2012 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -1137,7 +1137,7 @@ void bx_carbon_gui_c::clear_screen(void)
// new_text: array of character/attributes making up the current
// contents, which should now be displayed. See below
//
// format of old_text & new_text: each is tm_info.line_offset*text_rows
// format of old_text & new_text: each is tm_info->line_offset*text_rows
// bytes long. Each character consists of 2 bytes. The first by is
// the character value, the second is the attribute byte.
//
@ -1148,7 +1148,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,
bx_vga_tminfo_t tm_info)
bx_vga_tminfo_t *tm_info)
{
unsigned char cAttr, cChar;
Rect destRect;
@ -1158,18 +1158,19 @@ void bx_carbon_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
GrafPtr winGrafPtr = GetWindowPort(win);
OSErr theError;
Bit8u *old_line, *new_line;
unsigned int curs, hchars, offset, rows, x, xc, y, yc;
unsigned int curs, hchars, offset, rows, x, xc, y, yc, i;
bx_bool forceUpdate = 0, blink_mode, blink_state;
static unsigned prev_cursor_x=0;
static unsigned prev_cursor_y=0;
char text_palette[16];
screen_state = TEXT_MODE;
// first check if the screen needs to be redrawn completely
blink_mode = (tm_info.blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info.blink_flags & BX_TEXT_BLINK_STATE) > 0;
blink_mode = (tm_info->blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info->blink_flags & BX_TEXT_BLINK_STATE) > 0;
if (blink_mode) {
if (tm_info.blink_flags & BX_TEXT_BLINK_TOGGLE)
if (tm_info->blink_flags & BX_TEXT_BLINK_TOGGLE)
forceUpdate = 1;
}
if (charmap_updated == 1) {
@ -1178,14 +1179,18 @@ void bx_carbon_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
forceUpdate = 1;
}
for (i = 0; i < 16; i++) {
text_palette[i] = tm_info->actl_palette[i];
}
// invalidate character at previous and new cursor location
if((prev_cursor_y < text_rows) && (prev_cursor_x < text_cols)) {
curs = prev_cursor_y * tm_info.line_offset + prev_cursor_x * 2;
curs = prev_cursor_y * tm_info->line_offset + prev_cursor_x * 2;
old_text[curs] = ~new_text[curs];
}
if((tm_info.cs_start <= tm_info.cs_end) && (tm_info.cs_start < font_height) &&
if((tm_info->cs_start <= tm_info->cs_end) && (tm_info->cs_start < font_height) &&
(cursor_y < text_rows) && (cursor_x < text_cols)) {
curs = cursor_y * tm_info.line_offset + cursor_x * 2;
curs = cursor_y * tm_info->line_offset + cursor_x * 2;
old_text[curs] = ~new_text[curs];
} else {
curs = 0xffff;
@ -1202,7 +1207,7 @@ void bx_carbon_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
new_line = new_text;
old_line = old_text;
x = 0;
offset = y * tm_info.line_offset;
offset = y * tm_info->line_offset;
do {
if (forceUpdate || (old_text[0] != new_text[0])
|| (old_text[1] != new_text[1])) {
@ -1216,20 +1221,20 @@ void bx_carbon_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
}
if (offset == curs) {
cAttr = (cAttr >> 4) | (cAttr << 4);
}
}
if (SIM->get_param_bool(BXPN_PRIVATE_COLORMAP)->get()) {
PmForeColor(new_text[1] & 0x0F);
PmForeColor(text_palette[cAttr & 0x0F]);
if (blink_mode) {
PmBackColor((new_text[1] & 0x70) >> 4);
if (!blink_state && (new_text[1] & 0x80))
PmForeColor((new_text[1] & 0x70) >> 4);
PmBackColor(text_palette[(cAttr & 0x70) >> 4]);
if (!blink_state && (cAttr & 0x80))
PmForeColor(text_palette[(cAttr & 0x70) >> 4]);
} else {
PmBackColor((new_text[1] & 0xF0) >> 4);
PmBackColor(text_palette[(cAttr & 0xF0) >> 4]);
}
} else {
fgColor = (**gCTable).ctTable[new_text[1] & 0x0F].rgb;
bgColor = (**gCTable).ctTable[(new_text[1] & 0xF0) >> 4].rgb;
fgColor = (**gCTable).ctTable[text_palette[cAttr & 0x0F]].rgb;
bgColor = (**gCTable).ctTable[text_palette[(cAttr & 0xF0) >> 4]].rgb;
RGBForeColor(&fgColor);
RGBBackColor(&bgColor);
@ -1253,8 +1258,8 @@ void bx_carbon_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
offset+=2;
} while (--hchars);
y++;
new_text = new_line + tm_info.line_offset;
old_text = old_line + tm_info.line_offset;
new_text = new_line + tm_info->line_offset;
old_text = old_line + tm_info->line_offset;
} while (--rows);
//previous cursor position

View File

@ -64,6 +64,7 @@ typedef struct {
bx_bool line_graphics;
bx_bool split_hpanning;
Bit8u blink_flags;
Bit8u actl_palette[16];
} bx_vga_tminfo_t;
typedef struct {
@ -94,7 +95,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,
bx_vga_tminfo_t tm_info) = 0;
bx_vga_tminfo_t *tm_info) = 0;
virtual void graphics_tile_update(Bit8u *snapshot, unsigned x, unsigned y) = 0;
virtual bx_svga_tileinfo_t *graphics_tile_info(bx_svga_tileinfo_t *info);
virtual Bit8u *graphics_tile_get(unsigned x, unsigned y, unsigned *w, unsigned *h);
@ -237,7 +238,7 @@ virtual void specific_init(int argc, char **argv, \
unsigned header_bar_y); \
virtual void text_update(Bit8u *old_text, Bit8u *new_text, \
unsigned long cursor_x, unsigned long cursor_y, \
bx_vga_tminfo_t tm_info); \
bx_vga_tminfo_t *tm_info); \
virtual void graphics_tile_update(Bit8u *snapshot, unsigned x, unsigned y); \
virtual void handle_events(void); \
virtual void flush(void); \

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2009 The Bochs Project
// Copyright (C) 2001-2012 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -870,7 +870,7 @@ void bx_macintosh_gui_c::clear_screen(void)
// new_text: array of character/attributes making up the current
// contents, which should now be displayed. See below
//
// format of old_text & new_text: each is tm_info.line_offset*text_rows
// format of old_text & new_text: each is tm_info->line_offset*text_rows
// bytes long. Each character consists of 2 bytes. The first by is
// the character value, the second is the attribute byte.
//
@ -881,7 +881,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,
bx_vga_tminfo_t tm_info)
bx_vga_tminfo_t *tm_info)
{
int i;
unsigned char achar;

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2009 The Bochs Project
// Copyright (C) 2001-2012 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -130,7 +130,7 @@ void bx_nogui_gui_c::clear_screen(void)
// new_text: array of character/attributes making up the current
// contents, which should now be displayed. See below
//
// format of old_text & new_text: each is tm_info.line_offset*text_rows
// format of old_text & new_text: each is tm_info->line_offset*text_rows
// bytes long. Each character consists of 2 bytes. The first by is
// the character value, the second is the attribute byte.
//
@ -141,7 +141,7 @@ void 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,
bx_vga_tminfo_t tm_info)
bx_vga_tminfo_t *tm_info)
{
UNUSED(old_text);
UNUSED(new_text);

View File

@ -720,7 +720,7 @@ void bx_rfb_gui_c::clear_screen(void)
// new_text: array of character/attributes making up the current
// contents, which should now be displayed. See below
//
// format of old_text & new_text: each is tm_info.line_offset*text_rows
// format of old_text & new_text: each is tm_info->line_offset*text_rows
// bytes long. Each character consists of 2 bytes. The first by is
// the character value, the second is the attribute byte.
//
@ -729,17 +729,17 @@ void bx_rfb_gui_c::clear_screen(void)
// tm_info: this structure contains information for additional
// features in text mode (cursor shape, line offset,...)
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)
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)
{
Bit8u *old_line, *new_line;
Bit8u cAttr, cChar;
unsigned int curs, hchars, offset, rows, x, y, xc, yc;
bx_bool force_update=0, gfxchar, blink_state, blink_mode;
blink_mode = (tm_info.blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info.blink_flags & BX_TEXT_BLINK_STATE) > 0;
blink_mode = (tm_info->blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info->blink_flags & BX_TEXT_BLINK_STATE) > 0;
if (blink_mode) {
if (tm_info.blink_flags & BX_TEXT_BLINK_TOGGLE)
if (tm_info->blink_flags & BX_TEXT_BLINK_TOGGLE)
force_update = 1;
}
if(charmap_updated) {
@ -749,12 +749,12 @@ void bx_rfb_gui_c::text_update(Bit8u *old_text, Bit8u *new_text, unsigned long c
// first invalidate character at previous and new cursor location
if ((rfbCursorY < text_rows) && (rfbCursorX < text_cols)) {
curs = rfbCursorY * tm_info.line_offset + rfbCursorX * 2;
curs = rfbCursorY * tm_info->line_offset + rfbCursorX * 2;
old_text[curs] = ~new_text[curs];
}
if((tm_info.cs_start <= tm_info.cs_end) && (tm_info.cs_start < font_height) &&
if((tm_info->cs_start <= tm_info->cs_end) && (tm_info->cs_start < font_height) &&
(cursor_y < text_rows) && (cursor_x < text_cols)) {
curs = cursor_y * tm_info.line_offset + cursor_x * 2;
curs = cursor_y * tm_info->line_offset + cursor_x * 2;
old_text[curs] = ~new_text[curs];
} else {
curs = 0xffff;
@ -766,7 +766,7 @@ void bx_rfb_gui_c::text_update(Bit8u *old_text, Bit8u *new_text, unsigned long c
hchars = text_cols;
new_line = new_text;
old_line = old_text;
offset = y * tm_info.line_offset;
offset = y * tm_info->line_offset;
yc = y * font_height + rfbHeaderbarY;
x = 0;
do {
@ -780,7 +780,7 @@ void bx_rfb_gui_c::text_update(Bit8u *old_text, Bit8u *new_text, unsigned long c
} else {
cAttr = new_text[1];
}
gfxchar = tm_info.line_graphics && ((cChar & 0xE0) == 0xC0);
gfxchar = tm_info->line_graphics && ((cChar & 0xE0) == 0xC0);
xc = x * font_width;
DrawChar(xc, yc, font_width, font_height, 0, (char *)&vga_charmap[cChar<<5], cAttr, gfxchar);
if(yc < rfbUpdateRegion.y) rfbUpdateRegion.y = yc;
@ -790,8 +790,8 @@ void bx_rfb_gui_c::text_update(Bit8u *old_text, Bit8u *new_text, unsigned long c
rfbUpdateRegion.updated = true;
if (offset == curs) {
cAttr = ((cAttr >> 4) & 0xF) + ((cAttr & 0xF) << 4);
DrawChar(xc, yc + tm_info.cs_start, font_width, tm_info.cs_end - tm_info.cs_start + 1,
tm_info.cs_start, (char *)&vga_charmap[cChar<<5], cAttr, gfxchar);
DrawChar(xc, yc + tm_info->cs_start, font_width, tm_info->cs_end - tm_info->cs_start + 1,
tm_info->cs_start, (char *)&vga_charmap[cChar<<5], cAttr, gfxchar);
}
}
x++;
@ -800,8 +800,8 @@ void bx_rfb_gui_c::text_update(Bit8u *old_text, Bit8u *new_text, unsigned long c
offset+=2;
} while (--hchars);
y++;
new_text = new_line + tm_info.line_offset;
old_text = old_line + tm_info.line_offset;
new_text = new_line + tm_info->line_offset;
old_text = old_line + tm_info->line_offset;
} while (--rows);
rfbCursorX = cursor_x;

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2009 The Bochs Project
// Copyright (C) 2002-2012 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -435,7 +435,7 @@ void bx_sdl_gui_c::statusbar_setitem_specific(int element, bx_bool active, bx_bo
void bx_sdl_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
unsigned long cursor_x,
unsigned long cursor_y,
bx_vga_tminfo_t tm_info)
bx_vga_tminfo_t *tm_info)
{
Bit8u *pfont_row, *old_line, *new_line, *text_base;
unsigned int cs_y, i, x, y;
@ -452,10 +452,10 @@ void bx_sdl_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
Uint32 text_palette[16];
forceUpdate = 0;
blink_mode = (tm_info.blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info.blink_flags & BX_TEXT_BLINK_STATE) > 0;
blink_mode = (tm_info->blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info->blink_flags & BX_TEXT_BLINK_STATE) > 0;
if (blink_mode) {
if (tm_info.blink_flags & BX_TEXT_BLINK_TOGGLE)
if (tm_info->blink_flags & BX_TEXT_BLINK_TOGGLE)
forceUpdate = 1;
}
if (charmap_updated) {
@ -463,16 +463,16 @@ void bx_sdl_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
charmap_updated = 0;
}
for (i=0; i<16; i++) {
text_palette[i] = palette[DEV_vga_get_actl_pal_idx(i)];
text_palette[i] = palette[tm_info->actl_palette[i]];
}
if ((tm_info.h_panning != h_panning) || (tm_info.v_panning != v_panning)) {
if ((tm_info->h_panning != h_panning) || (tm_info->v_panning != v_panning)) {
forceUpdate = 1;
h_panning = tm_info.h_panning;
v_panning = tm_info.v_panning;
h_panning = tm_info->h_panning;
v_panning = tm_info->v_panning;
}
if (tm_info.line_compare != line_compare) {
if (tm_info->line_compare != line_compare) {
forceUpdate = 1;
line_compare = tm_info.line_compare;
line_compare = tm_info->line_compare;
}
if (sdl_screen) {
disp = sdl_screen->pitch/4;
@ -483,12 +483,12 @@ void bx_sdl_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
}
// first invalidate character at previous and new cursor location
if ((prev_cursor_y < text_rows) && (prev_cursor_x < text_cols)) {
curs = prev_cursor_y * tm_info.line_offset + prev_cursor_x * 2;
curs = prev_cursor_y * tm_info->line_offset + prev_cursor_x * 2;
old_text[curs] = ~new_text[curs];
}
cursor_visible = ((tm_info.cs_start <= tm_info.cs_end) && (tm_info.cs_start < fontheight));
cursor_visible = ((tm_info->cs_start <= tm_info->cs_end) && (tm_info->cs_start < fontheight));
if((cursor_visible) && (cursor_y < text_rows) && (cursor_x < text_cols)) {
curs = cursor_y * tm_info.line_offset + cursor_x * 2;
curs = cursor_y * tm_info->line_offset + cursor_x * 2;
old_text[curs] = ~new_text[curs];
} else {
curs = 0xffff;
@ -498,7 +498,7 @@ void bx_sdl_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
if (v_panning) rows++;
y = 0;
cs_y = 0;
text_base = new_text - tm_info.start_address;
text_base = new_text - tm_info->start_address;
if (line_compare < res_y) {
split_textrow = (line_compare + v_panning) / fontheight;
split_fontrows = ((line_compare + v_panning) % fontheight) + 1;
@ -544,7 +544,7 @@ void bx_sdl_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
new_line = new_text;
old_line = old_text;
x = 0;
offset = cs_y * tm_info.line_offset;
offset = cs_y * tm_info->line_offset;
do
{
cfwidth = fontwidth;
@ -574,7 +574,7 @@ void bx_sdl_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
bgcolor = text_palette[(new_text[1] >> 4) & 0x0F];
}
invert = ((offset == curs) && (cursor_visible));
gfxcharw9 = ((tm_info.line_graphics) && ((new_text[0] & 0xE0) == 0xC0));
gfxcharw9 = ((tm_info->line_graphics) && ((new_text[0] & 0xE0) == 0xC0));
// Display this one char
fontrows = cfheight;
@ -604,7 +604,7 @@ void bx_sdl_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
font_row <<= h_panning;
}
fontpixels = cfwidth;
if ((invert) && (fontline >= tm_info.cs_start) && (fontline <= tm_info.cs_end))
if ((invert) && (fontline >= tm_info->cs_start) && (fontline <= tm_info->cs_end))
mask = 0x100;
else
mask = 0x00;
@ -644,19 +644,19 @@ void bx_sdl_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
new_text = text_base;
forceUpdate = 1;
cs_y = 0;
if (tm_info.split_hpanning) h_panning = 0;
if (tm_info->split_hpanning) h_panning = 0;
rows = ((res_y - line_compare + fontheight - 2) / fontheight) + 1;
split_screen = 1;
}
else
{
new_text = new_line + tm_info.line_offset;
old_text = old_line + tm_info.line_offset;
new_text = new_line + tm_info->line_offset;
old_text = old_line + tm_info->line_offset;
cs_y++;
y++;
}
} while(--rows);
h_panning = tm_info.h_panning;
h_panning = tm_info->h_panning;
prev_cursor_x = cursor_x;
prev_cursor_y = cursor_y;
}

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2009 The Bochs Project
// Copyright (C) 2009-2012 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -144,7 +144,7 @@ void bx_svga_gui_c::text_update(
Bit8u *new_text,
unsigned long cursor_x,
unsigned long cursor_y,
bx_vga_tminfo_t tm_info)
bx_vga_tminfo_t *tm_info)
{
Bit8u *old_line, *new_line;
unsigned int curs, hchars, i, j, offset, rows, x, y;
@ -154,10 +154,10 @@ void bx_svga_gui_c::text_update(
int text_palette[16];
// first check if the screen needs to be redrawn completely
blink_mode = (tm_info.blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info.blink_flags & BX_TEXT_BLINK_STATE) > 0;
blink_mode = (tm_info->blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info->blink_flags & BX_TEXT_BLINK_STATE) > 0;
if (blink_mode) {
if (tm_info.blink_flags & BX_TEXT_BLINK_TOGGLE)
if (tm_info->blink_flags & BX_TEXT_BLINK_TOGGLE)
force_update = 1;
}
if (charmap_updated) {
@ -176,17 +176,17 @@ void bx_svga_gui_c::text_update(
charmap_updated = 0;
}
for (i=0; i<16; i++) {
text_palette[i] = DEV_vga_get_actl_pal_idx(i);
text_palette[i] = tm_info->actl_palette[i];
}
// invalidate character at previous and new cursor location
if((prev_cursor_y < text_rows) && (prev_cursor_x < text_cols)) {
curs = prev_cursor_y * tm_info.line_offset + prev_cursor_x * 2;
curs = prev_cursor_y * tm_info->line_offset + prev_cursor_x * 2;
old_text[curs] = ~new_text[curs];
}
if((tm_info.cs_start <= tm_info.cs_end) && (tm_info.cs_start < fontheight) &&
if((tm_info->cs_start <= tm_info->cs_end) && (tm_info->cs_start < fontheight) &&
(cursor_y < text_rows) && (cursor_x < text_cols)) {
curs = cursor_y * tm_info.line_offset + cursor_x * 2;
curs = cursor_y * tm_info->line_offset + cursor_x * 2;
old_text[curs] = ~new_text[curs];
} else {
curs = 0xffff;
@ -199,7 +199,7 @@ void bx_svga_gui_c::text_update(
new_line = new_text;
old_line = old_text;
x = 0;
offset = y * tm_info.line_offset;
offset = y * tm_info->line_offset;
do {
if (force_update || (old_text[0] != new_text[0])
|| (old_text[1] != new_text[1])) {
@ -225,8 +225,8 @@ void bx_svga_gui_c::text_update(
offset+=2;
} while (--hchars);
y++;
new_text = new_line + tm_info.line_offset;
old_text = old_line + tm_info.line_offset;
new_text = new_line + tm_info->line_offset;
old_text = old_line + tm_info->line_offset;
} while (--rows);
prev_cursor_x = cursor_x;

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2000-2009 The Bochs Project
// Copyright (C) 2000-2012 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -545,7 +545,7 @@ chtype get_term_char(Bit8u vga_char[])
// new_text: array of character/attributes making up the current
// contents, which should now be displayed. See below
//
// format of old_text & new_text: each is tm_info.line_offset*text_rows
// format of old_text & new_text: each is tm_info->line_offset*text_rows
// bytes long. Each character consists of 2 bytes. The first by is
// the character value, the second is the attribute byte.
//
@ -556,7 +556,7 @@ chtype 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,
bx_vga_tminfo_t tm_info)
bx_vga_tminfo_t *tm_info)
{
unsigned char *old_line, *new_line, *new_start;
unsigned char cAttr;
@ -595,25 +595,25 @@ void bx_term_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
old_text+=2;
} while (--hchars);
y++;
new_text = new_line + tm_info.line_offset;
old_text = old_line + tm_info.line_offset;
new_text = new_line + tm_info->line_offset;
old_text = old_line + tm_info->line_offset;
} while (--rows);
if ((cursor_x<text_cols) && (cursor_y<text_rows)
&& (tm_info.cs_start <= tm_info.cs_end)) {
&& (tm_info->cs_start <= tm_info->cs_end)) {
if(cursor_x>0)
cursor_x--;
else {
cursor_x=COLS-1;
cursor_y--;
}
cAttr = new_start[cursor_y*tm_info.line_offset+cursor_x*2+1];
cAttr = new_start[cursor_y*tm_info->line_offset+cursor_x*2+1];
#if BX_HAVE_COLOR_SET
if (has_colors()) {
color_set(get_color_pair(cAttr), NULL);
}
#endif
ch = get_term_char(&new_start[cursor_y*tm_info.line_offset+cursor_x*2]);
ch = get_term_char(&new_start[cursor_y*tm_info->line_offset+cursor_x*2]);
if ((cAttr & 0x08) > 0) ch |= A_BOLD;
if ((cAttr & 0x80) > 0) ch |= A_REVERSE;
mvaddch(cursor_y, cursor_x, ch);

View File

@ -1516,7 +1516,7 @@ void bx_win32_gui_c::clear_screen(void)
// new_text: array of character/attributes making up the current
// contents, which should now be displayed. See below
//
// format of old_text & new_text: each is tm_info.line_offset*text_rows
// format of old_text & new_text: each is tm_info->line_offset*text_rows
// bytes long. Each character consists of 2 bytes. The first by is
// the character value, the second is the attribute byte.
//
@ -1527,7 +1527,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,
bx_vga_tminfo_t tm_info)
bx_vga_tminfo_t *tm_info)
{
HDC hdc;
unsigned char data[64];
@ -1545,17 +1545,17 @@ void bx_win32_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
EnterCriticalSection(&stInfo.drawCS);
blink_mode = (tm_info.blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info.blink_flags & BX_TEXT_BLINK_STATE) > 0;
blink_mode = (tm_info->blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info->blink_flags & BX_TEXT_BLINK_STATE) > 0;
if (blink_mode) {
if (tm_info.blink_flags & BX_TEXT_BLINK_TOGGLE)
if (tm_info->blink_flags & BX_TEXT_BLINK_TOGGLE)
forceUpdate = 1;
}
if (charmap_updated) {
for (unsigned c = 0; c<256; c++) {
if (char_changed[c]) {
memset(data, 0, sizeof(data));
BOOL gfxchar = tm_info.line_graphics && ((c & 0xE0) == 0xC0);
BOOL gfxchar = tm_info->line_graphics && ((c & 0xE0) == 0xC0);
for (i=0; i<(unsigned)yChar; i++) {
data[i*2] = vga_charmap[c*32+i];
if (gfxchar) {
@ -1570,29 +1570,29 @@ void bx_win32_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
charmap_updated = 0;
}
for (i=0; i<16; i++) {
text_pal_idx[i] = DEV_vga_get_actl_pal_idx(i);
text_pal_idx[i] = tm_info->actl_palette[i];
}
hdc = GetDC(stInfo.simWnd);
if((tm_info.h_panning != h_panning) || (tm_info.v_panning != v_panning)) {
if((tm_info->h_panning != h_panning) || (tm_info->v_panning != v_panning)) {
forceUpdate = 1;
h_panning = tm_info.h_panning;
v_panning = tm_info.v_panning;
h_panning = tm_info->h_panning;
v_panning = tm_info->v_panning;
}
if(tm_info.line_compare != line_compare) {
if(tm_info->line_compare != line_compare) {
forceUpdate = 1;
line_compare = tm_info.line_compare;
line_compare = tm_info->line_compare;
}
// first invalidate character at previous and new cursor location
if((prev_cursor_y < text_rows) && (prev_cursor_x < text_cols)) {
curs = prev_cursor_y * tm_info.line_offset + prev_cursor_x * 2;
curs = prev_cursor_y * tm_info->line_offset + prev_cursor_x * 2;
old_text[curs] = ~new_text[curs];
}
if((tm_info.cs_start <= tm_info.cs_end) && (tm_info.cs_start < yChar) &&
if((tm_info->cs_start <= tm_info->cs_end) && (tm_info->cs_start < yChar) &&
(cursor_y < text_rows) && (cursor_x < text_cols)) {
curs = cursor_y * tm_info.line_offset + cursor_x * 2;
curs = cursor_y * tm_info->line_offset + cursor_x * 2;
old_text[curs] = ~new_text[curs];
} else {
curs = 0xffff;
@ -1602,7 +1602,7 @@ void bx_win32_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
if (v_panning) rows++;
y = 0;
cs_y = 0;
text_base = new_text - tm_info.start_address;
text_base = new_text - tm_info->start_address;
if (line_compare < dimension_y) {
split_textrow = (line_compare + v_panning) / yChar;
split_fontrows = ((line_compare + v_panning) % yChar) + 1;
@ -1648,7 +1648,7 @@ void bx_win32_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
new_line = new_text;
old_line = old_text;
x = 0;
offset = cs_y * tm_info.line_offset;
offset = cs_y * tm_info->line_offset;
do {
if (h_panning) {
if (hchars > text_cols) {
@ -1683,18 +1683,18 @@ void bx_win32_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
font_row, SRCCOPY, cAttr);
if (offset == curs) {
if (font_row == 0) {
yc2 = yc + tm_info.cs_start;
font_row2 = tm_info.cs_start;
cfheight2 = tm_info.cs_end - tm_info.cs_start + 1;
yc2 = yc + tm_info->cs_start;
font_row2 = tm_info->cs_start;
cfheight2 = tm_info->cs_end - tm_info->cs_start + 1;
} else {
if (v_panning > tm_info.cs_start) {
if (v_panning > tm_info->cs_start) {
yc2 = yc;
font_row2 = font_row;
cfheight2 = tm_info.cs_end - v_panning + 1;
cfheight2 = tm_info->cs_end - v_panning + 1;
} else {
yc2 = yc + tm_info.cs_start - v_panning;
font_row2 = tm_info.cs_start;
cfheight2 = tm_info.cs_end - tm_info.cs_start + 1;
yc2 = yc + tm_info->cs_start - v_panning;
font_row2 = tm_info->cs_start;
cfheight2 = tm_info->cs_end - tm_info->cs_start + 1;
}
}
cAttr = ((cAttr >> 4) & 0xF) + ((cAttr & 0xF) << 4);
@ -1711,18 +1711,18 @@ void bx_win32_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
new_text = text_base;
forceUpdate = 1;
cs_y = 0;
if (tm_info.split_hpanning) h_panning = 0;
if (tm_info->split_hpanning) h_panning = 0;
rows = ((dimension_y - line_compare + yChar - 2) / yChar) + 1;
split_screen = 1;
} else {
y++;
cs_y++;
new_text = new_line + tm_info.line_offset;
old_text = old_line + tm_info.line_offset;
new_text = new_line + tm_info->line_offset;
old_text = old_line + tm_info->line_offset;
}
} while (--rows);
h_panning = tm_info.h_panning;
h_panning = tm_info->h_panning;
prev_cursor_x = cursor_x;
prev_cursor_y = cursor_y;

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////
//
// Copyright (C) 2009 The Bochs Project
// Copyright (C) 2002-2012 The Bochs Project
//
// wxWidgets VGA display for Bochs. wx.cc implements a custom
// wxPanel called a MyPanel, which has methods to display
@ -1149,13 +1149,11 @@ static void UpdateScreen(unsigned char *newBits, int x, int y, int width, int he
}
}
static void DrawBochsBitmap(int x, int y, int width, int height, char *bmap, char color, int fontx, int fonty, bx_bool gfxchar)
static void DrawBochsBitmap(int x, int y, int width, int height, char *bmap, char fgcolor, char bgcolor, int fontx, int fonty, bx_bool gfxchar)
{
static unsigned char newBits[9 * 32];
unsigned char mask;
int bytes = width * height;
char bgcolor = DEV_vga_get_actl_pal_idx((color >> 4) & 0xF);
char fgcolor = DEV_vga_get_actl_pal_idx(color & 0xF);
if (y > wxScreenY) return;
@ -1189,7 +1187,7 @@ static void DrawBochsBitmap(int x, int y, int width, int height, char *bmap, cha
// new_text: array of character/attributes making up the current
// contents, which should now be displayed. See below
//
// format of old_text & new_text: each is tm_info.line_offset*text_rows
// format of old_text & new_text: each is tm_info->line_offset*text_rows
// bytes long. Each character consists of 2 bytes. The first by is
// the character value, the second is the attribute byte.
//
@ -1199,47 +1197,52 @@ static void DrawBochsBitmap(int x, int y, int width, int height, char *bmap, cha
// features in text mode (cursor shape, line offset,...)
void bx_wx_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 long cursor_x, unsigned long cursor_y,
bx_vga_tminfo_t *tm_info)
{
IFDBG_VGA(wxLogDebug (wxT ("text_update")));
Bit8u *old_line, *new_line, *text_base;
Bit8u cAttr, cChar;
unsigned int curs, hchars, offset, rows, x, y, xc, yc, yc2, cs_y;
unsigned int curs, hchars, offset, rows, x, y, xc, yc, yc2, cs_y, i;
Bit8u cfwidth, cfheight, cfheight2, font_col, font_row, font_row2;
Bit8u split_textrow, split_fontrows;
bx_bool forceUpdate = 0, gfxchar, split_screen, blink_state, blink_mode;
Bit8u text_pal_idx[16];
char bgcolor, fgcolor;
// first check if the screen needs to be redrawn completely
blink_mode = (tm_info.blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info.blink_flags & BX_TEXT_BLINK_STATE) > 0;
blink_mode = (tm_info->blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info->blink_flags & BX_TEXT_BLINK_STATE) > 0;
if (blink_mode) {
if (tm_info.blink_flags & BX_TEXT_BLINK_TOGGLE)
if (tm_info->blink_flags & BX_TEXT_BLINK_TOGGLE)
forceUpdate = 1;
}
if(charmap_updated) {
forceUpdate = 1;
charmap_updated = 0;
}
if((tm_info.h_panning != h_panning) || (tm_info.v_panning != v_panning)) {
forceUpdate = 1;
h_panning = tm_info.h_panning;
v_panning = tm_info.v_panning;
for (i = 0; i < 16; i++) {
text_pal_idx[i] = tm_info->actl_palette[i];
}
if(tm_info.line_compare != line_compare) {
if((tm_info->h_panning != h_panning) || (tm_info->v_panning != v_panning)) {
forceUpdate = 1;
line_compare = tm_info.line_compare;
h_panning = tm_info->h_panning;
v_panning = tm_info->v_panning;
}
if(tm_info->line_compare != line_compare) {
forceUpdate = 1;
line_compare = tm_info->line_compare;
}
// invalidate character at previous and new cursor location
if((wxCursorY < text_rows) && (wxCursorX < text_cols)) {
curs = wxCursorY * tm_info.line_offset + wxCursorX * 2;
curs = wxCursorY * tm_info->line_offset + wxCursorX * 2;
old_text[curs] = ~new_text[curs];
}
if((tm_info.cs_start <= tm_info.cs_end) && (tm_info.cs_start < wxFontY) &&
if((tm_info->cs_start <= tm_info->cs_end) && (tm_info->cs_start < wxFontY) &&
(cursor_y < text_rows) && (cursor_x < text_cols)) {
curs = cursor_y * tm_info.line_offset + cursor_x * 2;
curs = cursor_y * tm_info->line_offset + cursor_x * 2;
old_text[curs] = ~new_text[curs];
} else {
curs = 0xffff;
@ -1249,7 +1252,7 @@ void bx_wx_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
if (v_panning) rows++;
y = 0;
cs_y = 0;
text_base = new_text - tm_info.start_address;
text_base = new_text - tm_info->start_address;
if (line_compare < wxScreenY) {
split_textrow = (line_compare + v_panning) / wxFontY;
split_fontrows = ((line_compare + v_panning) % wxFontY) + 1;
@ -1295,7 +1298,7 @@ void bx_wx_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
new_line = new_text;
old_line = old_text;
x = 0;
offset = cs_y * tm_info.line_offset;
offset = cs_y * tm_info->line_offset;
do {
if (h_panning) {
if (hchars > text_cols) {
@ -1326,28 +1329,29 @@ void bx_wx_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
} else {
cAttr = new_text[1];
}
gfxchar = tm_info.line_graphics && ((cChar & 0xE0) == 0xC0);
gfxchar = tm_info->line_graphics && ((cChar & 0xE0) == 0xC0);
bgcolor = text_pal_idx[(cAttr >> 4) & 0xF];
fgcolor = text_pal_idx[cAttr & 0xF];
DrawBochsBitmap(xc, yc, cfwidth, cfheight, (char *)&vga_charmap[cChar<<5],
cAttr, font_col, font_row, gfxchar);
fgcolor, bgcolor, font_col, font_row, gfxchar);
if (offset == curs) {
if (font_row == 0) {
yc2 = yc + tm_info.cs_start;
font_row2 = tm_info.cs_start;
cfheight2 = tm_info.cs_end - tm_info.cs_start + 1;
yc2 = yc + tm_info->cs_start;
font_row2 = tm_info->cs_start;
cfheight2 = tm_info->cs_end - tm_info->cs_start + 1;
} else {
if (v_panning > tm_info.cs_start) {
if (v_panning > tm_info->cs_start) {
yc2 = yc;
font_row2 = font_row;
cfheight2 = tm_info.cs_end - v_panning + 1;
cfheight2 = tm_info->cs_end - v_panning + 1;
} else {
yc2 = yc + tm_info.cs_start - v_panning;
font_row2 = tm_info.cs_start;
cfheight2 = tm_info.cs_end - tm_info.cs_start + 1;
yc2 = yc + tm_info->cs_start - v_panning;
font_row2 = tm_info->cs_start;
cfheight2 = tm_info->cs_end - tm_info->cs_start + 1;
}
}
cAttr = ((cAttr >> 4) & 0xF) + ((cAttr & 0xF) << 4);
DrawBochsBitmap(xc, yc2, cfwidth, cfheight2, (char *)&vga_charmap[cChar<<5],
cAttr, font_col, font_row2, gfxchar);
bgcolor, fgcolor, font_col, font_row2, gfxchar);
}
}
x++;
@ -1359,18 +1363,18 @@ void bx_wx_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
new_text = text_base;
forceUpdate = 1;
cs_y = 0;
if (tm_info.split_hpanning) h_panning = 0;
if (tm_info->split_hpanning) h_panning = 0;
rows = ((wxScreenY - line_compare + wxFontY - 2) / wxFontY) + 1;
split_screen = 1;
} else {
y++;
cs_y++;
new_text = new_line + tm_info.line_offset;
old_text = old_line + tm_info.line_offset;
new_text = new_line + tm_info->line_offset;
old_text = old_line + tm_info->line_offset;
}
} while (--rows);
h_panning = tm_info.h_panning;
h_panning = tm_info->h_panning;
wxCursorX = cursor_x;
wxCursorY = cursor_y;

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2011 The Bochs Project
// Copyright (C) 2001-2012 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -311,8 +311,6 @@ static void xkeypress(KeySym keysym, int press_release);
unsigned long col_vals[MAX_VGA_COLORS]; // 256 VGA colors
unsigned curr_foreground, curr_background;
static unsigned x_tilesize, y_tilesize;
BxEvent *x11_notify_callback (void *unused, BxEvent *event);
static bxevent_handler old_callback = NULL;
static void *old_callback_arg = NULL;
@ -379,8 +377,8 @@ void bx_x_gui_c::specific_init(int argc, char **argv, unsigned tilewidth, unsign
put("XGUI");
x_tilesize = tilewidth;
y_tilesize = tileheight;
UNUSED(tilewidth);
UNUSED(tileheight);
bx_headerbar_y = headerbar_y;
progname = argv[0];
@ -1228,7 +1226,7 @@ void 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,
bx_vga_tminfo_t tm_info)
bx_vga_tminfo_t *tm_info)
{
Bit8u *old_line, *new_line, *text_base;
Bit8u cChar;
@ -1241,10 +1239,10 @@ void bx_x_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
unsigned char cell[64];
unsigned long text_palette[16];
blink_mode = (tm_info.blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info.blink_flags & BX_TEXT_BLINK_STATE) > 0;
blink_mode = (tm_info->blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info->blink_flags & BX_TEXT_BLINK_STATE) > 0;
if (blink_mode) {
if (tm_info.blink_flags & BX_TEXT_BLINK_TOGGLE)
if (tm_info->blink_flags & BX_TEXT_BLINK_TOGGLE)
forceUpdate = 1;
}
if (charmap_updated) {
@ -1252,7 +1250,7 @@ void bx_x_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
for (unsigned c = 0; c<256; c++) {
if (char_changed[c]) {
XFreePixmap(bx_x_display, vgafont[c]);
bx_bool gfxchar = tm_info.line_graphics && ((c & 0xE0) == 0xC0);
bx_bool gfxchar = tm_info->line_graphics && ((c & 0xE0) == 0xC0);
j = 0;
memset(cell, 0, sizeof(cell));
for(i=0; i<font_height*2; i+=2) {
@ -1281,27 +1279,27 @@ void bx_x_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
charmap_updated = 0;
}
for (i=0; i<16; i++) {
text_palette[i] = col_vals[DEV_vga_get_actl_pal_idx(i)];
text_palette[i] = col_vals[tm_info->actl_palette[i]];
}
if((tm_info.h_panning != h_panning) || (tm_info.v_panning != v_panning)) {
if((tm_info->h_panning != h_panning) || (tm_info->v_panning != v_panning)) {
forceUpdate = 1;
h_panning = tm_info.h_panning;
v_panning = tm_info.v_panning;
h_panning = tm_info->h_panning;
v_panning = tm_info->v_panning;
}
if(tm_info.line_compare != line_compare) {
if(tm_info->line_compare != line_compare) {
forceUpdate = 1;
line_compare = tm_info.line_compare;
line_compare = tm_info->line_compare;
}
// first invalidate character at previous and new cursor location
if ((prev_cursor_y < text_rows) && (prev_cursor_x < text_cols)) {
curs = prev_cursor_y * tm_info.line_offset + prev_cursor_x * 2;
curs = prev_cursor_y * tm_info->line_offset + prev_cursor_x * 2;
old_text[curs] = ~new_text[curs];
}
if((tm_info.cs_start <= tm_info.cs_end) && (tm_info.cs_start < font_height) &&
if((tm_info->cs_start <= tm_info->cs_end) && (tm_info->cs_start < font_height) &&
(cursor_y < text_rows) && (cursor_x < text_cols)) {
curs = cursor_y * tm_info.line_offset + cursor_x * 2;
curs = cursor_y * tm_info->line_offset + cursor_x * 2;
old_text[curs] = ~new_text[curs];
} else {
curs = 0xffff;
@ -1311,7 +1309,7 @@ void bx_x_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
if (v_panning) rows++;
y = 0;
cs_y = 0;
text_base = new_text - tm_info.start_address;
text_base = new_text - tm_info->start_address;
if (line_compare < dimension_y) {
split_textrow = (line_compare + v_panning) / font_height;
split_fontrows = ((line_compare + v_panning) % font_height) + 1;
@ -1357,7 +1355,7 @@ void bx_x_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
new_line = new_text;
old_line = old_text;
x = 0;
offset = cs_y * tm_info.line_offset;
offset = cs_y * tm_info->line_offset;
do {
if (h_panning) {
if (hchars > text_cols) {
@ -1399,21 +1397,21 @@ void bx_x_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
XSetForeground(bx_x_display, gc, text_palette[new_background]);
XSetBackground(bx_x_display, gc, text_palette[new_foreground]);
if (font_row == 0) {
yc2 = yc + tm_info.cs_start;
font_row2 = tm_info.cs_start;
cfheight2 = tm_info.cs_end - tm_info.cs_start + 1;
yc2 = yc + tm_info->cs_start;
font_row2 = tm_info->cs_start;
cfheight2 = tm_info->cs_end - tm_info->cs_start + 1;
if ((yc2 + cfheight2) > (dimension_y + bx_headerbar_y)) {
cfheight2 = dimension_y + bx_headerbar_y - yc2;
}
} else {
if (v_panning > tm_info.cs_start) {
if (v_panning > tm_info->cs_start) {
yc2 = yc;
font_row2 = font_row;
cfheight2 = tm_info.cs_end - v_panning + 1;
cfheight2 = tm_info->cs_end - v_panning + 1;
} else {
yc2 = yc + tm_info.cs_start - v_panning;
font_row2 = tm_info.cs_start;
cfheight2 = tm_info.cs_end - tm_info.cs_start + 1;
yc2 = yc + tm_info->cs_start - v_panning;
font_row2 = tm_info->cs_start;
cfheight2 = tm_info->cs_end - tm_info->cs_start + 1;
}
}
if (yc2 < (dimension_y + bx_headerbar_y)) {
@ -1431,18 +1429,18 @@ void bx_x_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
new_text = text_base;
forceUpdate = 1;
cs_y = 0;
if (tm_info.split_hpanning) h_panning = 0;
if (tm_info->split_hpanning) h_panning = 0;
rows = ((dimension_y - line_compare + font_height - 2) / font_height) + 1;
split_screen = 1;
} else {
y++;
cs_y++;
new_text = new_line + tm_info.line_offset;
old_text = old_line + tm_info.line_offset;
new_text = new_line + tm_info->line_offset;
old_text = old_line + tm_info->line_offset;
}
} while (--rows);
h_panning = tm_info.h_panning;
h_panning = tm_info->h_panning;
prev_cursor_x = cursor_x;
prev_cursor_y = cursor_y;

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2011 The Bochs Project
// Copyright (C) 2002-2012 The Bochs Project
//
// I/O port handlers API Copyright (C) 2003 by Frank Cornelis
//
@ -264,9 +264,6 @@ public:
virtual void trigger_timer(void *this_ptr) {
STUBFUNC(vga, trigger_timer);
}
virtual Bit8u get_actl_palette_idx(Bit8u index) {
return 0;
}
virtual bx_bool vbe_set_base_addr(Bit32u *addr, Bit8u *pci_conf) {
return 0;
}

View File

@ -888,11 +888,6 @@ Bit64s bx_svga_cirrus_c::svga_param_handler(bx_param_c *param, int set, Bit64s v
return val;
}
Bit8u bx_svga_cirrus_c::get_actl_palette_idx(Bit8u index)
{
return BX_CIRRUS_THIS bx_vga_c::get_actl_palette_idx(index);
}
Bit32u bx_svga_cirrus_c::svga_read_handler(void *this_ptr, Bit32u address, unsigned io_len)
{
#if !BX_USE_CIRRUS_SMF

View File

@ -82,7 +82,6 @@ public:
virtual Bit32u get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_ptr,
unsigned *iHeight, unsigned *iWidth, unsigned *iDepth);
virtual void trigger_timer(void *this_ptr);
virtual Bit8u get_actl_palette_idx(Bit8u index);
virtual void register_state(void);
virtual void after_restore_state(void);

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2011 The Bochs Project
// Copyright (C) 2002-2012 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -2119,6 +2119,9 @@ void bx_vga_c::update(void)
} else {
tm_info.h_panning &= 0x07;
}
for (int index = 0; index < 16; index++) {
tm_info.actl_palette[index] = BX_VGA_THIS s.attribute_ctrl.palette_reg[index];
}
// Verticle Display End: find out how many lines are displayed
VDE = BX_VGA_THIS s.vertical_display_end;
@ -2164,7 +2167,7 @@ void bx_vga_c::update(void)
}
bx_gui->text_update(BX_VGA_THIS s.text_snapshot,
&BX_VGA_THIS s.memory[start_address],
cursor_x, cursor_y, tm_info);
cursor_x, cursor_y, &tm_info);
if (BX_VGA_THIS s.vga_mem_updated) {
// screen updated, copy new VGA memory contents into text snapshot
memcpy(BX_VGA_THIS s.text_snapshot,
@ -2876,11 +2879,6 @@ Bit32u bx_vga_c::get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_ptr,
}
}
Bit8u bx_vga_c::get_actl_palette_idx(Bit8u index)
{
return BX_VGA_THIS s.attribute_ctrl.palette_reg[index];
}
#if BX_DEBUGGER
void bx_vga_c::debug_dump(void)
{

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2011 The Bochs Project
// Copyright (C) 2002-2012 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -140,7 +140,6 @@ public:
unsigned *txWidth);
virtual Bit32u get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_ptr,
unsigned *iHeight, unsigned *iWidth, unsigned *iDepth);
virtual Bit8u get_actl_palette_idx(Bit8u index);
virtual void init_vga_extension(void);
static void timer_handler(void *);

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2011 The Bochs Project
// Copyright (C) 2002-2012 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -222,7 +222,6 @@ extern "C" {
(bx_devices.pluginVgaDevice->get_gfx_snapshot(rawsnap, palette, height, width, depth))
#define DEV_vga_refresh() \
(bx_devices.pluginVgaDevice->trigger_timer(bx_devices.pluginVgaDevice))
#define DEV_vga_get_actl_pal_idx(index) (bx_devices.pluginVgaDevice->get_actl_palette_idx(index))
#define DEV_vga_debug_dump() (bx_devices.pluginVgaDevice->debug_dump())
#define DEV_vbe_set_base_addr(a,b) (bx_devices.pluginVgaDevice->vbe_set_base_addr(a,b))