Started rewrite of the gui code to make the graphics snapshot independent from
the display adapter code. When ready, the common gui code should handle it completely. The snapshot handler should set a flag 'snapshot_mode' and then it should force a display update. The graphics update code should be redirected to some code that 'draws' to a snapshot buffer. These first steps are done: - store some guest display settings in the gui code (text / graphics switch, x / y resolution and bpp) - split 8 bpp palette update code in a common and a specific part and store the palette values in the gui code
This commit is contained in:
parent
75908a2985
commit
1fd6745aea
@ -585,7 +585,7 @@ int bx_amigaos_gui_c::set_clipboard_text(char *text_snapshot, Bit32u len)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bx_bool bx_amigaos_gui_c::palette_change(unsigned index, unsigned red, unsigned green, unsigned blue)
|
bx_bool bx_amigaos_gui_c::palette_change(Bit8u index, Bit8u red, Bit8u green, Bit8u blue)
|
||||||
{
|
{
|
||||||
Bit8u *ptr = (Bit8u *)(cmap+index);
|
Bit8u *ptr = (Bit8u *)(cmap+index);
|
||||||
|
|
||||||
@ -625,10 +625,14 @@ void bx_amigaos_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight
|
|||||||
if (bpp > 8) {
|
if (bpp > 8) {
|
||||||
BX_PANIC(("%d bpp graphics mode not supported yet", bpp));
|
BX_PANIC(("%d bpp graphics mode not supported yet", bpp));
|
||||||
}
|
}
|
||||||
|
guest_textmode = (fheight > 0);
|
||||||
|
guest_xres = x;
|
||||||
|
guest_yres = y;
|
||||||
|
guest_bpp = bpp;
|
||||||
|
|
||||||
int xdiff = w - x;
|
int xdiff = w - x;
|
||||||
|
|
||||||
if (fheight > 0) {
|
if (guest_textmode) {
|
||||||
text_cols = x / fwidth;
|
text_cols = x / fwidth;
|
||||||
text_rows = y / fheight;
|
text_rows = y / fheight;
|
||||||
if (fwidth != 8) {
|
if (fwidth != 8) {
|
||||||
|
@ -136,7 +136,7 @@ unsigned width, height, gMinTop, gMaxTop, gLeft;
|
|||||||
GWorldPtr gOffWorld;
|
GWorldPtr gOffWorld;
|
||||||
Ptr gMyBuffer;
|
Ptr gMyBuffer;
|
||||||
ProcessSerialNumber gProcessSerNum;
|
ProcessSerialNumber gProcessSerNum;
|
||||||
static unsigned vga_bpp=8;
|
static unsigned disp_bpp=8;
|
||||||
static EventModifiers oldMods = 0;
|
static EventModifiers oldMods = 0;
|
||||||
static unsigned int text_rows=25, text_cols=80;
|
static unsigned int text_rows=25, text_cols=80;
|
||||||
|
|
||||||
@ -569,13 +569,12 @@ void CreateTile(void)
|
|||||||
CGrafPtr savePort;
|
CGrafPtr savePort;
|
||||||
OSErr err;
|
OSErr err;
|
||||||
unsigned long p_f;
|
unsigned long p_f;
|
||||||
long theRowBytes = ((((long) (vga_bpp==24?32:(((vga_bpp+1)>>1)<<1)) * ((long) (srcTileRect.right-srcTileRect.left)) + 31) >> 5) << 2);
|
long theRowBytes = ((((long) (disp_bpp==24?32:(((disp_bpp+1)>>1)<<1)) * ((long) (srcTileRect.right-srcTileRect.left)) + 31) >> 5) << 2);
|
||||||
|
|
||||||
// if (SIM->get_param_bool(BXPN_PRIVATE_COLORMAP)->get())
|
// if (SIM->get_param_bool(BXPN_PRIVATE_COLORMAP)->get())
|
||||||
// {
|
// {
|
||||||
GetGWorld(&savePort, &saveDevice);
|
GetGWorld(&savePort, &saveDevice);
|
||||||
switch(vga_bpp)
|
switch (disp_bpp) {
|
||||||
{
|
|
||||||
case 1:
|
case 1:
|
||||||
p_f = k1MonochromePixelFormat;
|
p_f = k1MonochromePixelFormat;
|
||||||
break;
|
break;
|
||||||
@ -604,7 +603,7 @@ void CreateTile(void)
|
|||||||
|
|
||||||
BX_ASSERT((gMyBuffer = (Ptr)malloc(theRowBytes * (srcTileRect.bottom - srcTileRect.top))) != NULL);
|
BX_ASSERT((gMyBuffer = (Ptr)malloc(theRowBytes * (srcTileRect.bottom - srcTileRect.top))) != NULL);
|
||||||
err = NewGWorldFromPtr(&gOffWorld, p_f,
|
err = NewGWorldFromPtr(&gOffWorld, p_f,
|
||||||
&srcTileRect, vga_bpp>8 ? NULL : gCTable, NULL, keepLocal, gMyBuffer, theRowBytes);
|
&srcTileRect, disp_bpp>8 ? NULL : gCTable, NULL, keepLocal, gMyBuffer, theRowBytes);
|
||||||
if (err != noErr || gOffWorld == NULL)
|
if (err != noErr || gOffWorld == NULL)
|
||||||
BX_PANIC(("mac: can't create gOffWorld; err=%hd", err));
|
BX_PANIC(("mac: can't create gOffWorld; err=%hd", err));
|
||||||
|
|
||||||
@ -1314,7 +1313,7 @@ int bx_carbon_gui_c::set_clipboard_text(char *text_snapshot, Bit32u len)
|
|||||||
// returns: 0=no screen update needed (color map change has direct effect)
|
// returns: 0=no screen update needed (color map change has direct effect)
|
||||||
// 1=screen updated needed (redraw using current colormap)
|
// 1=screen updated needed (redraw using current colormap)
|
||||||
|
|
||||||
bx_bool bx_carbon_gui_c::palette_change(unsigned index, unsigned red, unsigned green, unsigned blue)
|
bx_bool bx_carbon_gui_c::palette_change(Bit8u index, Bit8u red, Bit8u green, Bit8u blue)
|
||||||
{
|
{
|
||||||
PaletteHandle thePal, oldpal;
|
PaletteHandle thePal, oldpal;
|
||||||
GDHandle saveDevice;
|
GDHandle saveDevice;
|
||||||
@ -1405,22 +1404,19 @@ void bx_carbon_gui_c::graphics_tile_update(Bit8u *tile, unsigned x0, unsigned y0
|
|||||||
BX_PANIC(("mac: LockPortBits returned %hd", theError));
|
BX_PANIC(("mac: LockPortBits returned %hd", theError));
|
||||||
if ((theBaseAddr = GetPixBaseAddr(gTile)) == NULL)
|
if ((theBaseAddr = GetPixBaseAddr(gTile)) == NULL)
|
||||||
BX_PANIC(("mac: gTile has NULL baseAddr (offscreen buffer purged)"));
|
BX_PANIC(("mac: gTile has NULL baseAddr (offscreen buffer purged)"));
|
||||||
else if (vga_bpp == 24 || vga_bpp == 32)
|
else if (disp_bpp == 24 || disp_bpp == 32) {
|
||||||
{
|
for (unsigned iY = 0; iY < (srcTileRect.bottom-srcTileRect.top); iY++) {
|
||||||
for (unsigned iY = 0; iY < (srcTileRect.bottom-srcTileRect.top); iY++)
|
|
||||||
{
|
|
||||||
Bit8u *iA = ((Bit8u *)theBaseAddr) + iY * GetPixRowBytes(gTile);
|
Bit8u *iA = ((Bit8u *)theBaseAddr) + iY * GetPixRowBytes(gTile);
|
||||||
for (unsigned iX = 0; iX < (srcTileRect.right-srcTileRect.left); iX++)
|
for (unsigned iX = 0; iX < (srcTileRect.right-srcTileRect.left); iX++) {
|
||||||
{
|
iA[iX*4 + 3] = tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*(disp_bpp>>3)];
|
||||||
iA[iX*4 + 3] = tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*(vga_bpp>>3)];
|
iA[iX*4 + 2] = tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*(disp_bpp>>3) + 1];
|
||||||
iA[iX*4 + 2] = tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*(vga_bpp>>3) + 1];
|
iA[iX*4 + 1] = tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*(disp_bpp>>3) + 2];
|
||||||
iA[iX*4 + 1] = tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*(vga_bpp>>3) + 2];
|
iA[iX*4] = disp_bpp == 24 ? 0 : tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*4 + 3];
|
||||||
iA[iX*4] = vga_bpp == 24 ? 0 : tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*4 + 3];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
BlockMoveData(tile, theBaseAddr, (srcTileRect.bottom-srcTileRect.top) * GetPixRowBytes(gTile));
|
BlockMoveData(tile, theBaseAddr, (srcTileRect.bottom-srcTileRect.top) * GetPixRowBytes(gTile));
|
||||||
|
}
|
||||||
if ((theError = UnlockPortBits(gOffWorld)) != noErr)
|
if ((theError = UnlockPortBits(gOffWorld)) != noErr)
|
||||||
BX_ERROR(("mac: UnlockPortBits returned %hd", theError));
|
BX_ERROR(("mac: UnlockPortBits returned %hd", theError));
|
||||||
RGBForeColor(&black);
|
RGBForeColor(&black);
|
||||||
@ -1454,17 +1450,20 @@ void bx_carbon_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight,
|
|||||||
if ((bpp != 1) && (bpp != 2) && (bpp != 4) && (bpp != 8) && (bpp != 15) && (bpp != 16) && (bpp != 24) && (bpp != 32)) {
|
if ((bpp != 1) && (bpp != 2) && (bpp != 4) && (bpp != 8) && (bpp != 15) && (bpp != 16) && (bpp != 24) && (bpp != 32)) {
|
||||||
BX_PANIC(("%d bpp graphics mode not supported yet", bpp));
|
BX_PANIC(("%d bpp graphics mode not supported yet", bpp));
|
||||||
}
|
}
|
||||||
if (bpp != vga_bpp)
|
guest_textmode = (fheight > 0);
|
||||||
{
|
guest_xres = x;
|
||||||
|
guest_yres = y;
|
||||||
|
guest_bpp = bpp;
|
||||||
|
if (bpp != disp_bpp) {
|
||||||
free(gMyBuffer);
|
free(gMyBuffer);
|
||||||
DisposeGWorld(gOffWorld);
|
DisposeGWorld(gOffWorld);
|
||||||
if ((gCTable == NULL) || (*gCTable == NULL) || (*gCTable == (void *)-1))
|
if ((gCTable == NULL) || (*gCTable == NULL) || (*gCTable == (void *)-1))
|
||||||
gCTable = GetCTable(128);
|
gCTable = GetCTable(128);
|
||||||
vga_bpp = bpp;
|
disp_bpp = bpp;
|
||||||
CreateTile();
|
CreateTile();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fheight > 0) {
|
if (guest_textmode) {
|
||||||
text_cols = x / fwidth;
|
text_cols = x / fwidth;
|
||||||
text_rows = y / fheight;
|
text_rows = y / fheight;
|
||||||
if(fwidth != font_width || fheight != font_height) {
|
if(fwidth != font_width || fheight != font_height) {
|
||||||
|
@ -99,6 +99,11 @@ bx_gui_c::bx_gui_c(void): disp_mode(DISP_MODE_SIM)
|
|||||||
statusitem_count = 0;
|
statusitem_count = 0;
|
||||||
led_timer_index = BX_NULL_TIMER_HANDLE;
|
led_timer_index = BX_NULL_TIMER_HANDLE;
|
||||||
framebuffer = NULL;
|
framebuffer = NULL;
|
||||||
|
guest_textmode = 1;
|
||||||
|
guest_xres = 640;
|
||||||
|
guest_yres = 480;
|
||||||
|
guest_bpp = 8;
|
||||||
|
memset(palette, 0, sizeof(palette));
|
||||||
}
|
}
|
||||||
|
|
||||||
bx_gui_c::~bx_gui_c()
|
bx_gui_c::~bx_gui_c()
|
||||||
@ -410,8 +415,8 @@ void bx_gui_c::copy_handler(void)
|
|||||||
Bit32u len;
|
Bit32u len;
|
||||||
char *text_snapshot;
|
char *text_snapshot;
|
||||||
|
|
||||||
if (DEV_vga_get_snapshot_mode() == BX_GUI_SNAPSHOT_TXT) {
|
if (BX_GUI_THIS guest_textmode) {
|
||||||
make_text_snapshot (&text_snapshot, &len);
|
make_text_snapshot(&text_snapshot, &len);
|
||||||
if (!BX_GUI_THIS set_clipboard_text(text_snapshot, len)) {
|
if (!BX_GUI_THIS set_clipboard_text(text_snapshot, len)) {
|
||||||
// platform specific code failed, use portable code instead
|
// platform specific code failed, use portable code instead
|
||||||
FILE *fp = fopen("copy.txt", "w");
|
FILE *fp = fopen("copy.txt", "w");
|
||||||
@ -420,7 +425,7 @@ void bx_gui_c::copy_handler(void)
|
|||||||
}
|
}
|
||||||
free(text_snapshot);
|
free(text_snapshot);
|
||||||
} else {
|
} else {
|
||||||
BX_ERROR(("copy button failed, mode not implemented"));
|
BX_ERROR(("copy button failed, graphics mode not implemented"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -428,16 +433,14 @@ void bx_gui_c::copy_handler(void)
|
|||||||
void bx_gui_c::snapshot_handler(void)
|
void bx_gui_c::snapshot_handler(void)
|
||||||
{
|
{
|
||||||
int fd, i, j, mode, pitch;
|
int fd, i, j, mode, pitch;
|
||||||
Bit8u *snapshot_ptr = NULL, *palette_ptr = NULL;
|
Bit8u *snapshot_ptr = NULL;
|
||||||
Bit8u *row_buffer, *pixel_ptr, *row_ptr;
|
Bit8u *row_buffer, *pixel_ptr, *row_ptr;
|
||||||
Bit8u bmp_header[54], iBits, b1, b2;
|
Bit8u bmp_header[54], iBits, b1, b2;
|
||||||
Bit32u ilen, len, rlen;
|
Bit32u ilen, len, rlen;
|
||||||
char filename[BX_PATHNAME_LEN];
|
char filename[BX_PATHNAME_LEN];
|
||||||
unsigned iHeight, iWidth, iDepth;
|
|
||||||
|
|
||||||
mode = DEV_vga_get_snapshot_mode();
|
if (BX_GUI_THIS guest_textmode) {
|
||||||
if (mode == BX_GUI_SNAPSHOT_TXT) {
|
make_text_snapshot((char**)&snapshot_ptr, &len);
|
||||||
make_text_snapshot ((char**)&snapshot_ptr, &len);
|
|
||||||
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_SNAPSHOT) {
|
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_SNAPSHOT) {
|
||||||
int ret = SIM->ask_filename (filename, sizeof(filename),
|
int ret = SIM->ask_filename (filename, sizeof(filename),
|
||||||
"Save snapshot as...", "snapshot.txt",
|
"Save snapshot as...", "snapshot.txt",
|
||||||
@ -458,10 +461,11 @@ void bx_gui_c::snapshot_handler(void)
|
|||||||
fwrite(snapshot_ptr, 1, len, fp);
|
fwrite(snapshot_ptr, 1, len, fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
free(snapshot_ptr);
|
free(snapshot_ptr);
|
||||||
} else if (mode == BX_GUI_SNAPSHOT_GFX) {
|
} else {
|
||||||
ilen = DEV_vga_get_gfx_snapshot(&snapshot_ptr, &palette_ptr, &iHeight, &iWidth, &iDepth);
|
ilen = DEV_vga_get_gfx_snapshot(&snapshot_ptr);
|
||||||
if (ilen > 0) {
|
if (ilen > 0) {
|
||||||
BX_INFO(("GFX snapshot: %u x %u x %u bpp (%u bytes)", iWidth, iHeight, iDepth, ilen));
|
BX_INFO(("GFX snapshot: %u x %u x %u bpp (%u bytes)", BX_GUI_THIS guest_xres,
|
||||||
|
BX_GUI_THIS guest_yres, BX_GUI_THIS guest_bpp, ilen));
|
||||||
} else {
|
} else {
|
||||||
BX_ERROR(("snapshot button failed: cannot allocate memory"));
|
BX_ERROR(("snapshot button failed: cannot allocate memory"));
|
||||||
return;
|
return;
|
||||||
@ -471,7 +475,6 @@ void bx_gui_c::snapshot_handler(void)
|
|||||||
"Save snapshot as...", "snapshot.bmp",
|
"Save snapshot as...", "snapshot.bmp",
|
||||||
bx_param_string_c::SAVE_FILE_DIALOG);
|
bx_param_string_c::SAVE_FILE_DIALOG);
|
||||||
if (ret < 0) { // cancelled
|
if (ret < 0) { // cancelled
|
||||||
if (palette_ptr != NULL) free(palette_ptr);
|
|
||||||
free(snapshot_ptr);
|
free(snapshot_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -486,14 +489,13 @@ void bx_gui_c::snapshot_handler(void)
|
|||||||
);
|
);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
BX_ERROR(("snapshot button failed: cannot create BMP file"));
|
BX_ERROR(("snapshot button failed: cannot create BMP file"));
|
||||||
if (palette_ptr != NULL) free(palette_ptr);
|
|
||||||
free(snapshot_ptr);
|
free(snapshot_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
iBits = (iDepth == 8) ? 8 : 24;
|
iBits = (BX_GUI_THIS guest_bpp == 8) ? 8 : 24;
|
||||||
rlen = (iWidth * (iBits >> 3) + 3) & ~3;
|
rlen = (BX_GUI_THIS guest_xres * (iBits >> 3) + 3) & ~3;
|
||||||
len = rlen * iHeight + 54;
|
len = rlen * BX_GUI_THIS guest_yres + 54;
|
||||||
if ((iDepth == 8) && (palette_ptr != NULL)) {
|
if (BX_GUI_THIS guest_bpp == 8) {
|
||||||
len += (256 * 4);
|
len += (256 * 4);
|
||||||
}
|
}
|
||||||
memset(bmp_header, 0, 54);
|
memset(bmp_header, 0, 54);
|
||||||
@ -504,34 +506,34 @@ void bx_gui_c::snapshot_handler(void)
|
|||||||
bmp_header[4] = (len >> 16) & 0xff;
|
bmp_header[4] = (len >> 16) & 0xff;
|
||||||
bmp_header[5] = (len >> 24) & 0xff;
|
bmp_header[5] = (len >> 24) & 0xff;
|
||||||
bmp_header[10] = 54;
|
bmp_header[10] = 54;
|
||||||
if ((iDepth == 8) && (palette_ptr != NULL)) {
|
if (BX_GUI_THIS guest_bpp == 8) {
|
||||||
bmp_header[11] = 4;
|
bmp_header[11] = 4;
|
||||||
}
|
}
|
||||||
bmp_header[14] = 40;
|
bmp_header[14] = 40;
|
||||||
bmp_header[18] = iWidth & 0xff;
|
bmp_header[18] = BX_GUI_THIS guest_xres & 0xff;
|
||||||
bmp_header[19] = (iWidth >> 8) & 0xff;
|
bmp_header[19] = (BX_GUI_THIS guest_xres >> 8) & 0xff;
|
||||||
bmp_header[22] = iHeight & 0xff;
|
bmp_header[22] = BX_GUI_THIS guest_yres & 0xff;
|
||||||
bmp_header[23] = (iHeight >> 8) & 0xff;
|
bmp_header[23] = (BX_GUI_THIS guest_yres >> 8) & 0xff;
|
||||||
bmp_header[26] = 1;
|
bmp_header[26] = 1;
|
||||||
bmp_header[28] = iBits;
|
bmp_header[28] = iBits;
|
||||||
write(fd, bmp_header, 54);
|
write(fd, bmp_header, 54);
|
||||||
if ((iDepth == 8) && (palette_ptr != NULL)) {
|
if (BX_GUI_THIS guest_bpp == 8) {
|
||||||
write(fd, palette_ptr, 256 * 4);
|
write(fd, bx_gui->palette, 256 * 4);
|
||||||
}
|
}
|
||||||
pitch = iWidth * ((iDepth + 1) >> 3);
|
pitch = BX_GUI_THIS guest_xres * ((BX_GUI_THIS guest_bpp + 1) >> 3);
|
||||||
row_buffer = (Bit8u*)malloc(rlen);
|
row_buffer = (Bit8u*)malloc(rlen);
|
||||||
row_ptr = snapshot_ptr + ((iHeight - 1) * pitch);
|
row_ptr = snapshot_ptr + ((BX_GUI_THIS guest_yres - 1) * pitch);
|
||||||
for (i = iHeight; i > 0; i--) {
|
for (i = BX_GUI_THIS guest_yres; i > 0; i--) {
|
||||||
memset(row_buffer, 0, rlen);
|
memset(row_buffer, 0, rlen);
|
||||||
if ((iDepth == 8) || (iDepth == 24)) {
|
if ((BX_GUI_THIS guest_bpp == 8) || (BX_GUI_THIS guest_bpp == 24)) {
|
||||||
memcpy(row_buffer, row_ptr, pitch);
|
memcpy(row_buffer, row_ptr, pitch);
|
||||||
} else if ((iDepth == 15) || (iDepth == 16)) {
|
} else if ((BX_GUI_THIS guest_bpp == 15) || (BX_GUI_THIS guest_bpp == 16)) {
|
||||||
pixel_ptr = row_ptr;
|
pixel_ptr = row_ptr;
|
||||||
for (j = 0; j < (int)(iWidth * 3); j+=3) {
|
for (j = 0; j < (int)(BX_GUI_THIS guest_xres * 3); j+=3) {
|
||||||
b1 = *(pixel_ptr++);
|
b1 = *(pixel_ptr++);
|
||||||
b2 = *(pixel_ptr++);
|
b2 = *(pixel_ptr++);
|
||||||
*(row_buffer+j) = (b1 << 3);
|
*(row_buffer+j) = (b1 << 3);
|
||||||
if (iDepth == 15) {
|
if (BX_GUI_THIS guest_bpp == 15) {
|
||||||
*(row_buffer+j+1) = ((b1 & 0xe0) >> 2) | (b2 << 6);
|
*(row_buffer+j+1) = ((b1 & 0xe0) >> 2) | (b2 << 6);
|
||||||
*(row_buffer+j+2) = (b2 & 0x7c) << 1;
|
*(row_buffer+j+2) = (b2 & 0x7c) << 1;
|
||||||
} else {
|
} else {
|
||||||
@ -539,9 +541,9 @@ void bx_gui_c::snapshot_handler(void)
|
|||||||
*(row_buffer+j+2) = (b2 & 0xf8);
|
*(row_buffer+j+2) = (b2 & 0xf8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (iDepth == 32) {
|
} else if (BX_GUI_THIS guest_bpp == 32) {
|
||||||
pixel_ptr = row_ptr;
|
pixel_ptr = row_ptr;
|
||||||
for (j = 0; j < (int)(iWidth * 3); j+=3) {
|
for (j = 0; j < (int)(BX_GUI_THIS guest_xres * 3); j+=3) {
|
||||||
*(row_buffer+j) = *(pixel_ptr++);
|
*(row_buffer+j) = *(pixel_ptr++);
|
||||||
*(row_buffer+j+1) = *(pixel_ptr++);
|
*(row_buffer+j+1) = *(pixel_ptr++);
|
||||||
*(row_buffer+j+2) = *(pixel_ptr++);
|
*(row_buffer+j+2) = *(pixel_ptr++);
|
||||||
@ -553,10 +555,7 @@ void bx_gui_c::snapshot_handler(void)
|
|||||||
}
|
}
|
||||||
free(row_buffer);
|
free(row_buffer);
|
||||||
close(fd);
|
close(fd);
|
||||||
if (palette_ptr != NULL) free(palette_ptr);
|
|
||||||
free(snapshot_ptr);
|
free(snapshot_ptr);
|
||||||
} else {
|
|
||||||
BX_ERROR(("snapshot button failed: unsupported VGA mode"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -926,6 +925,14 @@ void bx_gui_c::graphics_tile_update_in_place(unsigned x0, unsigned y0,
|
|||||||
delete [] tile;
|
delete [] tile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bx_bool bx_gui_c::palette_change_common(Bit8u index, Bit8u red, Bit8u green, Bit8u blue)
|
||||||
|
{
|
||||||
|
palette[index].red = red;
|
||||||
|
palette[index].green = green;
|
||||||
|
palette[index].blue = blue;
|
||||||
|
return palette_change(index, red, green, blue);
|
||||||
|
}
|
||||||
|
|
||||||
void bx_gui_c::show_ips(Bit32u ips_count)
|
void bx_gui_c::show_ips(Bit32u ips_count)
|
||||||
{
|
{
|
||||||
#if BX_SHOW_IPS
|
#if BX_SHOW_IPS
|
||||||
|
@ -48,11 +48,6 @@
|
|||||||
#define BX_GUI_MT_F12 (BX_MT_KEY_F12)
|
#define BX_GUI_MT_F12 (BX_MT_KEY_F12)
|
||||||
#define BX_GUI_MT_CTRL_ALT (BX_MT_KEY_CTRL | BX_MT_KEY_ALT)
|
#define BX_GUI_MT_CTRL_ALT (BX_MT_KEY_CTRL | BX_MT_KEY_ALT)
|
||||||
|
|
||||||
// snapshot feature
|
|
||||||
#define BX_GUI_SNAPSHOT_UNSUP 0
|
|
||||||
#define BX_GUI_SNAPSHOT_TXT 1
|
|
||||||
#define BX_GUI_SNAPSHOT_GFX 2
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Bit16u start_address;
|
Bit16u start_address;
|
||||||
Bit8u cs_start;
|
Bit8u cs_start;
|
||||||
@ -102,7 +97,7 @@ public:
|
|||||||
virtual void handle_events(void) = 0;
|
virtual void handle_events(void) = 0;
|
||||||
virtual void flush(void) = 0;
|
virtual void flush(void) = 0;
|
||||||
virtual void clear_screen(void) = 0;
|
virtual void clear_screen(void) = 0;
|
||||||
virtual bx_bool palette_change(unsigned index, unsigned red, unsigned green, unsigned blue) = 0;
|
virtual bx_bool palette_change(Bit8u index, Bit8u red, Bit8u green, Bit8u blue) = 0;
|
||||||
virtual void dimension_update(unsigned x, unsigned y, unsigned fheight=0, unsigned fwidth=0, unsigned bpp=8) = 0;
|
virtual void dimension_update(unsigned x, unsigned y, unsigned fheight=0, unsigned fwidth=0, unsigned bpp=8) = 0;
|
||||||
virtual unsigned create_bitmap(const unsigned char *bmap, unsigned xdim, unsigned ydim) = 0;
|
virtual unsigned create_bitmap(const unsigned char *bmap, unsigned xdim, unsigned ydim) = 0;
|
||||||
virtual unsigned headerbar_bitmap(unsigned bmap_id, unsigned alignment, void (*f)(void)) = 0;
|
virtual unsigned headerbar_bitmap(unsigned bmap_id, unsigned alignment, void (*f)(void)) = 0;
|
||||||
@ -148,6 +143,7 @@ public:
|
|||||||
void init(int argc, char **argv, unsigned max_xres, unsigned max_yres,
|
void init(int argc, char **argv, unsigned max_xres, unsigned max_yres,
|
||||||
unsigned x_tilesize, unsigned y_tilesize);
|
unsigned x_tilesize, unsigned y_tilesize);
|
||||||
void cleanup(void);
|
void cleanup(void);
|
||||||
|
bx_bool palette_change_common(Bit8u index, Bit8u red, Bit8u green, Bit8u blue);
|
||||||
void update_drive_status_buttons(void);
|
void update_drive_status_buttons(void);
|
||||||
static void mouse_enabled_changed(bx_bool val);
|
static void mouse_enabled_changed(bx_bool val);
|
||||||
int register_statusitem(const char *text, bx_bool auto_off=0);
|
int register_statusitem(const char *text, bx_bool auto_off=0);
|
||||||
@ -162,7 +158,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// And these are defined and used privately in gui.cc
|
// And these are defined and used privately in gui.cc
|
||||||
static void make_text_snapshot (char **snapshot, Bit32u *length);
|
// header bar button handers
|
||||||
static void floppyA_handler(void);
|
static void floppyA_handler(void);
|
||||||
static void floppyB_handler(void);
|
static void floppyB_handler(void);
|
||||||
static void cdrom1_handler(void);
|
static void cdrom1_handler(void);
|
||||||
@ -174,10 +170,13 @@ protected:
|
|||||||
static void config_handler(void);
|
static void config_handler(void);
|
||||||
static void userbutton_handler(void);
|
static void userbutton_handler(void);
|
||||||
static void save_restore_handler(void);
|
static void save_restore_handler(void);
|
||||||
|
// text snapshot helper function
|
||||||
|
static void make_text_snapshot(char **snapshot, Bit32u *length);
|
||||||
|
// status bar LED timer
|
||||||
static void led_timer_handler(void *);
|
static void led_timer_handler(void *);
|
||||||
void led_timer(void);
|
void led_timer(void);
|
||||||
|
|
||||||
|
// header bar buttons
|
||||||
bx_bool floppyA_status;
|
bx_bool floppyA_status;
|
||||||
bx_bool floppyB_status;
|
bx_bool floppyB_status;
|
||||||
bx_bool cdrom1_status;
|
bx_bool cdrom1_status;
|
||||||
@ -193,11 +192,11 @@ protected:
|
|||||||
unsigned mouse_bmap_id, nomouse_bmap_id, mouse_hbar_id;
|
unsigned mouse_bmap_id, nomouse_bmap_id, mouse_hbar_id;
|
||||||
unsigned user_bmap_id, user_hbar_id;
|
unsigned user_bmap_id, user_hbar_id;
|
||||||
unsigned save_restore_bmap_id, save_restore_hbar_id;
|
unsigned save_restore_bmap_id, save_restore_hbar_id;
|
||||||
|
// text charmap
|
||||||
unsigned char vga_charmap[0x2000];
|
unsigned char vga_charmap[0x2000];
|
||||||
bx_bool charmap_updated;
|
bx_bool charmap_updated;
|
||||||
bx_bool char_changed[256];
|
bx_bool char_changed[256];
|
||||||
|
// status bar items
|
||||||
unsigned statusitem_count;
|
unsigned statusitem_count;
|
||||||
int led_timer_index;
|
int led_timer_index;
|
||||||
struct {
|
struct {
|
||||||
@ -207,22 +206,38 @@ protected:
|
|||||||
bx_bool auto_off;
|
bx_bool auto_off;
|
||||||
Bit8u counter;
|
Bit8u counter;
|
||||||
} statusitem[BX_MAX_STATUSITEMS];
|
} statusitem[BX_MAX_STATUSITEMS];
|
||||||
|
// display mode
|
||||||
disp_mode_t disp_mode;
|
disp_mode_t disp_mode;
|
||||||
|
// new graphics API (with compatibility mode)
|
||||||
bx_bool new_gfx_api;
|
bx_bool new_gfx_api;
|
||||||
Bit16u host_xres;
|
Bit16u host_xres;
|
||||||
Bit16u host_yres;
|
Bit16u host_yres;
|
||||||
Bit16u host_pitch;
|
Bit16u host_pitch;
|
||||||
Bit8u host_bpp;
|
Bit8u host_bpp;
|
||||||
|
Bit8u *framebuffer;
|
||||||
|
// maximum guest display size and tile size
|
||||||
unsigned max_xres;
|
unsigned max_xres;
|
||||||
unsigned max_yres;
|
unsigned max_yres;
|
||||||
unsigned x_tilesize;
|
unsigned x_tilesize;
|
||||||
unsigned y_tilesize;
|
unsigned y_tilesize;
|
||||||
Bit8u *framebuffer;
|
// current guest display settings
|
||||||
Bit32u dialog_caps;
|
bx_bool guest_textmode;
|
||||||
|
unsigned guest_xres;
|
||||||
|
unsigned guest_yres;
|
||||||
|
unsigned guest_bpp;
|
||||||
|
// current palette (for graphics snapshot
|
||||||
|
struct {
|
||||||
|
Bit8u red;
|
||||||
|
Bit8u green;
|
||||||
|
Bit8u blue;
|
||||||
|
Bit8u reserved;
|
||||||
|
} palette[256];
|
||||||
|
// mouse toggle setup
|
||||||
Bit8u toggle_method;
|
Bit8u toggle_method;
|
||||||
Bit32u toggle_keystate;
|
Bit32u toggle_keystate;
|
||||||
char mouse_toggle_text[20];
|
char mouse_toggle_text[20];
|
||||||
|
// gui dialog capabilities
|
||||||
|
Bit32u dialog_caps;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -245,8 +260,8 @@ virtual void graphics_tile_update(Bit8u *snapshot, unsigned x, unsigned y); \
|
|||||||
virtual void handle_events(void); \
|
virtual void handle_events(void); \
|
||||||
virtual void flush(void); \
|
virtual void flush(void); \
|
||||||
virtual void clear_screen(void); \
|
virtual void clear_screen(void); \
|
||||||
virtual bx_bool palette_change(unsigned index, \
|
virtual bx_bool palette_change(Bit8u index, Bit8u red, Bit8u green, \
|
||||||
unsigned red, unsigned green, unsigned blue); \
|
Bit8u blue); \
|
||||||
virtual void dimension_update(unsigned x, unsigned y, unsigned fheight=0, \
|
virtual void dimension_update(unsigned x, unsigned y, unsigned fheight=0, \
|
||||||
unsigned fwidth=0, unsigned bpp=8); \
|
unsigned fwidth=0, unsigned bpp=8); \
|
||||||
virtual unsigned create_bitmap(const unsigned char *bmap, \
|
virtual unsigned create_bitmap(const unsigned char *bmap, \
|
||||||
|
@ -129,7 +129,7 @@ Point prevPt;
|
|||||||
unsigned width, height, gMinTop, gMaxTop, gLeft;
|
unsigned width, height, gMinTop, gMaxTop, gLeft;
|
||||||
GWorldPtr gOffWorld;
|
GWorldPtr gOffWorld;
|
||||||
Ptr gMyBuffer;
|
Ptr gMyBuffer;
|
||||||
static unsigned vga_bpp=8;
|
static unsigned disp_bpp=8;
|
||||||
static EventModifiers oldMods = 0;
|
static EventModifiers oldMods = 0;
|
||||||
static unsigned int text_rows=25, text_cols=80;
|
static unsigned int text_rows=25, text_cols=80;
|
||||||
|
|
||||||
@ -247,14 +247,13 @@ void CreateTile(void)
|
|||||||
CGrafPtr savePort;
|
CGrafPtr savePort;
|
||||||
OSErr err;
|
OSErr err;
|
||||||
unsigned long p_f;
|
unsigned long p_f;
|
||||||
long theRowBytes = ((((long) (vga_bpp==24?32:(((vga_bpp+1)>>1)<<1)) * ((long) (srcTileRect.right-srcTileRect.left)) + 31) >> 5) << 2);
|
long theRowBytes = ((((long) (disp_bpp==24?32:(((disp_bpp+1)>>1)<<1)) * ((long) (srcTileRect.right-srcTileRect.left)) + 31) >> 5) << 2);
|
||||||
|
|
||||||
//if (SIM->get_param_bool(BXPN_PRIVATE_COLORMAP)->get())
|
//if (SIM->get_param_bool(BXPN_PRIVATE_COLORMAP)->get())
|
||||||
//{
|
//{
|
||||||
|
|
||||||
GetGWorld(&savePort, &saveDevice);
|
GetGWorld(&savePort, &saveDevice);
|
||||||
switch(vga_bpp)
|
switch (disp_bpp) {
|
||||||
{
|
|
||||||
case 1:
|
case 1:
|
||||||
p_f = k1MonochromePixelFormat;
|
p_f = k1MonochromePixelFormat;
|
||||||
break;
|
break;
|
||||||
@ -283,7 +282,7 @@ void CreateTile(void)
|
|||||||
|
|
||||||
BX_ASSERT((gMyBuffer = (Ptr)malloc(theRowBytes * (srcTileRect.bottom - srcTileRect.top))) != NULL);
|
BX_ASSERT((gMyBuffer = (Ptr)malloc(theRowBytes * (srcTileRect.bottom - srcTileRect.top))) != NULL);
|
||||||
err = QTNewGWorldFromPtr(&gOffWorld, p_f,
|
err = QTNewGWorldFromPtr(&gOffWorld, p_f,
|
||||||
&srcTileRect, vga_bpp>8 ? NULL : gCTable, NULL, keepLocal, gMyBuffer, theRowBytes);
|
&srcTileRect, disp_bpp>8 ? NULL : gCTable, NULL, keepLocal, gMyBuffer, theRowBytes);
|
||||||
if (err != noErr || gOffWorld == NULL)
|
if (err != noErr || gOffWorld == NULL)
|
||||||
BX_PANIC(("mac: can't create gOffWorld; err=%hd", err));
|
BX_PANIC(("mac: can't create gOffWorld; err=%hd", err));
|
||||||
|
|
||||||
@ -967,7 +966,7 @@ int bx_macintosh_gui_c::set_clipboard_text(char *text_snapshot, Bit32u len)
|
|||||||
// returns: 0=no screen update needed (color map change has direct effect)
|
// returns: 0=no screen update needed (color map change has direct effect)
|
||||||
// 1=screen updated needed (redraw using current colormap)
|
// 1=screen updated needed (redraw using current colormap)
|
||||||
|
|
||||||
bx_bool bx_macintosh_gui_c::palette_change(unsigned index, unsigned red, unsigned green, unsigned blue)
|
bx_bool bx_macintosh_gui_c::palette_change(Bit8u index, Bit8u red, Bit8u green, Bit8u blue)
|
||||||
{
|
{
|
||||||
PaletteHandle thePal, oldpal;
|
PaletteHandle thePal, oldpal;
|
||||||
GDHandle saveDevice;
|
GDHandle saveDevice;
|
||||||
@ -1051,22 +1050,19 @@ void bx_macintosh_gui_c::graphics_tile_update(Bit8u *tile, unsigned x0, unsigned
|
|||||||
//(**gTile).baseAddr = (Ptr)tile;
|
//(**gTile).baseAddr = (Ptr)tile;
|
||||||
if ((theBaseAddr = GetPixBaseAddr(gTile)) == NULL)
|
if ((theBaseAddr = GetPixBaseAddr(gTile)) == NULL)
|
||||||
BX_PANIC(("mac: gTile has NULL baseAddr (offscreen buffer purged)"));
|
BX_PANIC(("mac: gTile has NULL baseAddr (offscreen buffer purged)"));
|
||||||
else if (vga_bpp == 24 || vga_bpp == 32)
|
else if (disp_bpp == 24 || disp_bpp == 32) {
|
||||||
{
|
for (unsigned iY = 0; iY < (srcTileRect.bottom-srcTileRect.top); iY++) {
|
||||||
for (unsigned iY = 0; iY < (srcTileRect.bottom-srcTileRect.top); iY++)
|
|
||||||
{
|
|
||||||
Bit8u *iA = ((Bit8u *)theBaseAddr) + iY * GetPixRowBytes(gTile);
|
Bit8u *iA = ((Bit8u *)theBaseAddr) + iY * GetPixRowBytes(gTile);
|
||||||
for (unsigned iX = 0; iX < (srcTileRect.right-srcTileRect.left); iX++)
|
for (unsigned iX = 0; iX < (srcTileRect.right-srcTileRect.left); iX++) {
|
||||||
{
|
iA[iX*4 + 3] = tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*(disp_bpp>>3)];
|
||||||
iA[iX*4 + 3] = tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*(vga_bpp>>3)];
|
iA[iX*4 + 2] = tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*(disp_bpp>>3) + 1];
|
||||||
iA[iX*4 + 2] = tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*(vga_bpp>>3) + 1];
|
iA[iX*4 + 1] = tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*(disp_bpp>>3) + 2];
|
||||||
iA[iX*4 + 1] = tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*(vga_bpp>>3) + 2];
|
iA[iX*4] = disp_bpp == 24 ? 0 : tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*4 + 3];
|
||||||
iA[iX*4] = vga_bpp == 24 ? 0 : tile[((srcTileRect.right-srcTileRect.left)*iY+iX)*4 + 3];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
BlockMoveData(tile, theBaseAddr, (srcTileRect.bottom-srcTileRect.top) * GetPixRowBytes(gTile));
|
BlockMoveData(tile, theBaseAddr, (srcTileRect.bottom-srcTileRect.top) * GetPixRowBytes(gTile));
|
||||||
|
}
|
||||||
RGBForeColor(&black);
|
RGBForeColor(&black);
|
||||||
RGBBackColor(&white);
|
RGBBackColor(&white);
|
||||||
CopyBits(GetPortBitMapForCopyBits(gOffWorld), &WINBITMAP(win),
|
CopyBits(GetPortBitMapForCopyBits(gOffWorld), &WINBITMAP(win),
|
||||||
@ -1095,16 +1091,19 @@ void bx_macintosh_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheig
|
|||||||
if ((bpp != 1) && (bpp != 2) && (bpp != 4) && (bpp != 8) && (bpp != 15) && (bpp != 16) && (bpp != 24) && (bpp != 32)) {
|
if ((bpp != 1) && (bpp != 2) && (bpp != 4) && (bpp != 8) && (bpp != 15) && (bpp != 16) && (bpp != 24) && (bpp != 32)) {
|
||||||
BX_PANIC(("%d bpp graphics mode not supported yet", bpp));
|
BX_PANIC(("%d bpp graphics mode not supported yet", bpp));
|
||||||
}
|
}
|
||||||
if (bpp != vga_bpp)
|
guest_textmode = (fheight > 0);
|
||||||
{
|
guest_xres = x;
|
||||||
|
guest_yres = y;
|
||||||
|
guest_bpp = bpp;
|
||||||
|
if (bpp != disp_bpp) {
|
||||||
free(gMyBuffer);
|
free(gMyBuffer);
|
||||||
if ((**gTile).pixelType == RGBDirect)
|
if ((**gTile).pixelType == RGBDirect)
|
||||||
gCTable = GetCTable(128);
|
gCTable = GetCTable(128);
|
||||||
DisposeGWorld(gOffWorld);
|
DisposeGWorld(gOffWorld);
|
||||||
vga_bpp = bpp;
|
disp_bpp = bpp;
|
||||||
CreateTile();
|
CreateTile();
|
||||||
}
|
}
|
||||||
if (fheight > 0) {
|
if (guest_textmode) {
|
||||||
text_cols = x / fwidth;
|
text_cols = x / fwidth;
|
||||||
text_rows = y / fheight;
|
text_rows = y / fheight;
|
||||||
if (fwidth != 8) {
|
if (fwidth != 8) {
|
||||||
|
@ -177,7 +177,7 @@ int bx_nogui_gui_c::set_clipboard_text(char *text_snapshot, Bit32u len)
|
|||||||
// returns: 0=no screen update needed (color map change has direct effect)
|
// returns: 0=no screen update needed (color map change has direct effect)
|
||||||
// 1=screen updated needed (redraw using current colormap)
|
// 1=screen updated needed (redraw using current colormap)
|
||||||
|
|
||||||
bx_bool bx_nogui_gui_c::palette_change(unsigned index, unsigned red, unsigned green, unsigned blue)
|
bx_bool bx_nogui_gui_c::palette_change(Bit8u index, Bit8u red, Bit8u green, Bit8u blue)
|
||||||
{
|
{
|
||||||
UNUSED(index);
|
UNUSED(index);
|
||||||
UNUSED(red);
|
UNUSED(red);
|
||||||
@ -224,11 +224,11 @@ void bx_nogui_gui_c::graphics_tile_update(Bit8u *tile, unsigned x0, unsigned y0)
|
|||||||
|
|
||||||
void bx_nogui_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, unsigned fwidth, unsigned bpp)
|
void bx_nogui_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, unsigned fwidth, unsigned bpp)
|
||||||
{
|
{
|
||||||
UNUSED(x);
|
guest_textmode = (fheight > 0);
|
||||||
UNUSED(y);
|
guest_xres = x;
|
||||||
UNUSED(fheight);
|
guest_yres = y;
|
||||||
|
guest_bpp = bpp;
|
||||||
UNUSED(fwidth);
|
UNUSED(fwidth);
|
||||||
UNUSED(bpp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -857,7 +857,7 @@ int bx_rfb_gui_c::set_clipboard_text(char *text_snapshot, Bit32u len)
|
|||||||
// returns: 0=no screen update needed (color map change has direct effect)
|
// returns: 0=no screen update needed (color map change has direct effect)
|
||||||
// 1=screen updated needed (redraw using current colormap)
|
// 1=screen updated needed (redraw using current colormap)
|
||||||
|
|
||||||
bx_bool bx_rfb_gui_c::palette_change(unsigned index, unsigned red, unsigned green, unsigned blue)
|
bx_bool bx_rfb_gui_c::palette_change(Bit8u index, Bit8u red, Bit8u green, Bit8u blue)
|
||||||
{
|
{
|
||||||
rfbPalette[index] = (((red * 7 + 127) / 255) << 0) | (((green * 7 + 127) / 255) << 3) | (((blue * 3 + 127) / 255) << 6);
|
rfbPalette[index] = (((red * 7 + 127) / 255) << 0) | (((green * 7 + 127) / 255) << 3) | (((blue * 3 + 127) / 255) << 6);
|
||||||
return(1);
|
return(1);
|
||||||
@ -968,7 +968,11 @@ void bx_rfb_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, un
|
|||||||
if (bpp > 8) {
|
if (bpp > 8) {
|
||||||
BX_ERROR(("%d bpp graphics mode not supported yet", bpp));
|
BX_ERROR(("%d bpp graphics mode not supported yet", bpp));
|
||||||
}
|
}
|
||||||
if (fheight > 0) {
|
guest_textmode = (fheight > 0);
|
||||||
|
guest_xres = x;
|
||||||
|
guest_yres = y;
|
||||||
|
guest_bpp = bpp;
|
||||||
|
if (guest_textmode) {
|
||||||
font_height = fheight;
|
font_height = fheight;
|
||||||
font_width = fwidth;
|
font_width = fwidth;
|
||||||
text_cols = x / fwidth;
|
text_cols = x / fwidth;
|
||||||
|
@ -108,9 +108,9 @@ static unsigned int text_rows = 25, text_cols = 80;
|
|||||||
Bit8u h_panning = 0, v_panning = 0;
|
Bit8u h_panning = 0, v_panning = 0;
|
||||||
Bit16u line_compare = 1023;
|
Bit16u line_compare = 1023;
|
||||||
int fontwidth = 8, fontheight = 16;
|
int fontwidth = 8, fontheight = 16;
|
||||||
static unsigned vga_bpp=8;
|
static unsigned disp_bpp=8;
|
||||||
unsigned char menufont[256][8];
|
unsigned char menufont[256][8];
|
||||||
Uint32 palette[256];
|
Uint32 sdl_palette[256];
|
||||||
Uint32 headerbar_fg, headerbar_bg;
|
Uint32 headerbar_fg, headerbar_bg;
|
||||||
Bit8u old_mousebuttons=0, new_mousebuttons=0;
|
Bit8u old_mousebuttons=0, new_mousebuttons=0;
|
||||||
int old_mousex=0, new_mousex=0;
|
int old_mousex=0, new_mousex=0;
|
||||||
@ -483,7 +483,7 @@ void bx_sdl_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
|
|||||||
charmap_updated = 0;
|
charmap_updated = 0;
|
||||||
}
|
}
|
||||||
for (i=0; i<16; i++) {
|
for (i=0; i<16; i++) {
|
||||||
text_palette[i] = palette[tm_info->actl_palette[i]];
|
text_palette[i] = sdl_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;
|
forceUpdate = 1;
|
||||||
@ -581,11 +581,9 @@ void bx_sdl_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
|
|||||||
}
|
}
|
||||||
// check if char needs to be updated
|
// check if char needs to be updated
|
||||||
if(forceUpdate || (old_text[0] != new_text[0])
|
if(forceUpdate || (old_text[0] != new_text[0])
|
||||||
|| (old_text[1] != new_text[1]))
|
|| (old_text[1] != new_text[1])) {
|
||||||
{
|
// Get Foreground/Background pixel colors
|
||||||
|
fgcolor = text_palette[new_text[1] & 0x0F];
|
||||||
// Get Foreground/Background pixel colors
|
|
||||||
fgcolor = text_palette[new_text[1] & 0x0F];
|
|
||||||
if (blink_mode) {
|
if (blink_mode) {
|
||||||
bgcolor = text_palette[(new_text[1] >> 4) & 0x07];
|
bgcolor = text_palette[(new_text[1] >> 4) & 0x07];
|
||||||
if (!blink_state && (new_text[1] & 0x80))
|
if (!blink_state && (new_text[1] & 0x80))
|
||||||
@ -712,24 +710,21 @@ void bx_sdl_gui_c::graphics_tile_update(Bit8u *snapshot, unsigned x, unsigned y)
|
|||||||
if(i + y > res_y) i = res_y - y;
|
if(i + y > res_y) i = res_y - y;
|
||||||
|
|
||||||
// FIXME
|
// FIXME
|
||||||
if(i<=0) return;
|
if (i<=0) return;
|
||||||
|
|
||||||
switch (vga_bpp)
|
switch (disp_bpp) {
|
||||||
{
|
|
||||||
case 8: /* 8 bpp */
|
case 8: /* 8 bpp */
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
buf_row = buf;
|
buf_row = buf;
|
||||||
j = x_tilesize;
|
j = x_tilesize;
|
||||||
do
|
do {
|
||||||
{
|
*buf++ = sdl_palette[*snapshot++];
|
||||||
*buf++ = palette[*snapshot++];
|
|
||||||
} while(--j);
|
} while(--j);
|
||||||
buf = buf_row + disp;
|
buf = buf_row + disp;
|
||||||
} while(--i);
|
} while(--i);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BX_PANIC(("%u bpp modes handled by new graphics API", vga_bpp));
|
BX_PANIC(("%u bpp modes handled by new graphics API", disp_bpp));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1233,18 +1228,12 @@ void bx_sdl_gui_c::clear_screen(void)
|
|||||||
SDL_UpdateRect(sdl_fullscreen,0,0,res_x,res_y);
|
SDL_UpdateRect(sdl_fullscreen,0,0,res_x,res_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
bx_bool bx_sdl_gui_c::palette_change(unsigned index, unsigned red, unsigned green, unsigned blue)
|
bx_bool bx_sdl_gui_c::palette_change(Bit8u index, Bit8u red, Bit8u green, Bit8u blue)
|
||||||
{
|
{
|
||||||
unsigned char palred = red & 0xFF;
|
if (sdl_screen)
|
||||||
unsigned char palgreen = green & 0xFF;
|
sdl_palette[index] = SDL_MapRGB(sdl_screen->format, red, green, blue);
|
||||||
unsigned char palblue = blue & 0xFF;
|
else if (sdl_fullscreen)
|
||||||
|
sdl_palette[index] = SDL_MapRGB(sdl_fullscreen->format, red, green, blue);
|
||||||
if(index > 255) return 0;
|
|
||||||
|
|
||||||
if(sdl_screen)
|
|
||||||
palette[index] = SDL_MapRGB(sdl_screen->format, palred, palgreen, palblue);
|
|
||||||
else if(sdl_fullscreen)
|
|
||||||
palette[index] = SDL_MapRGB(sdl_fullscreen->format, palred, palgreen, palblue);
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1253,14 +1242,14 @@ void bx_sdl_gui_c::dimension_update(unsigned x, unsigned y,
|
|||||||
unsigned fheight, unsigned fwidth, unsigned bpp)
|
unsigned fheight, unsigned fwidth, unsigned bpp)
|
||||||
{
|
{
|
||||||
if (bpp == 8 || bpp == 15 || bpp == 16 || bpp == 24 || bpp == 32) {
|
if (bpp == 8 || bpp == 15 || bpp == 16 || bpp == 24 || bpp == 32) {
|
||||||
vga_bpp = bpp;
|
disp_bpp = guest_bpp = bpp;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
BX_PANIC(("%d bpp graphics mode not supported", bpp));
|
BX_PANIC(("%d bpp graphics mode not supported", bpp));
|
||||||
}
|
}
|
||||||
if(fheight > 0)
|
guest_textmode = (fheight > 0);
|
||||||
{
|
guest_xres = x;
|
||||||
|
guest_yres = y;
|
||||||
|
if (guest_textmode) {
|
||||||
fontheight = fheight;
|
fontheight = fheight;
|
||||||
fontwidth = fwidth;
|
fontwidth = fwidth;
|
||||||
text_cols = x / fontwidth;
|
text_cols = x / fontwidth;
|
||||||
|
@ -438,19 +438,13 @@ void bx_svga_gui_c::clear_screen(void)
|
|||||||
gl_clearscreen(0);
|
gl_clearscreen(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bx_bool bx_svga_gui_c::palette_change(
|
bx_bool bx_svga_gui_c::palette_change(Bit8u index, Bit8u red, Bit8u green, Bit8u blue)
|
||||||
unsigned index,
|
|
||||||
unsigned red,
|
|
||||||
unsigned green,
|
|
||||||
unsigned blue)
|
|
||||||
{
|
{
|
||||||
if(index > 255) return 0;
|
|
||||||
|
|
||||||
// without VGA_CLUT8 extension we have only 6 bits for each r,g,b value
|
// without VGA_CLUT8 extension we have only 6 bits for each r,g,b value
|
||||||
if (!clut8 && (red > 63 || green > 63 || blue > 63)) {
|
if (!clut8 && (red > 63 || green > 63 || blue > 63)) {
|
||||||
red = red >> 2;
|
red = red >> 2;
|
||||||
green = green >> 2;
|
green = green >> 2;
|
||||||
blue = blue >> 2;
|
blue = blue >> 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
vga_setpalette(index, red, green, blue);
|
vga_setpalette(index, red, green, blue);
|
||||||
@ -471,8 +465,11 @@ void bx_svga_gui_c::dimension_update(
|
|||||||
if (bpp > 8) {
|
if (bpp > 8) {
|
||||||
BX_PANIC(("%d bpp graphics mode not supported yet", bpp));
|
BX_PANIC(("%d bpp graphics mode not supported yet", bpp));
|
||||||
}
|
}
|
||||||
if(fheight > 0)
|
guest_textmode = (fheight > 0);
|
||||||
{
|
guest_xres = x;
|
||||||
|
guest_yres = y;
|
||||||
|
guest_bpp = bpp;
|
||||||
|
if (guest_textmode) {
|
||||||
text_cols = x / fwidth;
|
text_cols = x / fwidth;
|
||||||
text_rows = y / fheight;
|
text_rows = y / fheight;
|
||||||
fontheight = fheight;
|
fontheight = fheight;
|
||||||
|
@ -637,7 +637,7 @@ int bx_term_gui_c::set_clipboard_text(char *text_snapshot, Bit32u len)
|
|||||||
// returns: 0=no screen update needed (color map change has direct effect)
|
// returns: 0=no screen update needed (color map change has direct effect)
|
||||||
// 1=screen updated needed (redraw using current colormap)
|
// 1=screen updated needed (redraw using current colormap)
|
||||||
|
|
||||||
bx_bool bx_term_gui_c::palette_change(unsigned index, unsigned red, unsigned green, unsigned blue)
|
bx_bool bx_term_gui_c::palette_change(Bit8u index, Bit8u red, Bit8u green, Bit8u blue)
|
||||||
{
|
{
|
||||||
BX_DEBUG(("color pallete request (%d,%d,%d,%d) ignored", index,red,green,blue));
|
BX_DEBUG(("color pallete request (%d,%d,%d,%d) ignored", index,red,green,blue));
|
||||||
return(0);
|
return(0);
|
||||||
@ -680,7 +680,11 @@ void bx_term_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, u
|
|||||||
if (bpp > 8) {
|
if (bpp > 8) {
|
||||||
BX_PANIC(("%d bpp graphics mode not supported", bpp));
|
BX_PANIC(("%d bpp graphics mode not supported", bpp));
|
||||||
}
|
}
|
||||||
if (fheight > 0) {
|
guest_textmode = (fheight > 0);
|
||||||
|
guest_xres = x;
|
||||||
|
guest_yres = y;
|
||||||
|
guest_bpp = bpp;
|
||||||
|
if (guest_textmode) {
|
||||||
text_cols = x / fwidth;
|
text_cols = x / fwidth;
|
||||||
text_rows = y / fheight;
|
text_rows = y / fheight;
|
||||||
#if BX_HAVE_COLOR_SET
|
#if BX_HAVE_COLOR_SET
|
||||||
|
@ -166,7 +166,6 @@ bx_bool SB_ActiveW[BX_MAX_STATUSITEMS];
|
|||||||
static unsigned dimension_x, dimension_y, current_bpp;
|
static unsigned dimension_x, dimension_y, current_bpp;
|
||||||
static unsigned stretched_x, stretched_y;
|
static unsigned stretched_x, stretched_y;
|
||||||
static unsigned stretch_factor=1;
|
static unsigned stretch_factor=1;
|
||||||
static BOOL BxTextMode = TRUE;
|
|
||||||
static BOOL fix_size = FALSE;
|
static BOOL fix_size = FALSE;
|
||||||
#if BX_DEBUGGER && BX_DEBUGGER_GUI
|
#if BX_DEBUGGER && BX_DEBUGGER_GUI
|
||||||
static BOOL gui_debug = FALSE;
|
static BOOL gui_debug = FALSE;
|
||||||
@ -1789,8 +1788,8 @@ int bx_win32_gui_c::set_clipboard_text(char *text_snapshot, Bit32u len)
|
|||||||
// returns: 0=no screen update needed (color map change has direct effect)
|
// returns: 0=no screen update needed (color map change has direct effect)
|
||||||
// 1=screen updated needed (redraw using current colormap)
|
// 1=screen updated needed (redraw using current colormap)
|
||||||
|
|
||||||
bx_bool bx_win32_gui_c::palette_change(unsigned index, unsigned red,
|
bx_bool bx_win32_gui_c::palette_change(Bit8u index, Bit8u red, Bit8u green,
|
||||||
unsigned green, unsigned blue) {
|
Bit8u blue) {
|
||||||
if ((current_bpp == 16) && (index < 3)) {
|
if ((current_bpp == 16) && (index < 3)) {
|
||||||
cmap_index[256+index].rgbRed = red;
|
cmap_index[256+index].rgbRed = red;
|
||||||
cmap_index[256+index].rgbBlue = blue;
|
cmap_index[256+index].rgbBlue = blue;
|
||||||
@ -1857,29 +1856,30 @@ void bx_win32_gui_c::graphics_tile_update(Bit8u *tile, unsigned x0, unsigned y0)
|
|||||||
|
|
||||||
void bx_win32_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, unsigned fwidth, unsigned bpp)
|
void bx_win32_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, unsigned fwidth, unsigned bpp)
|
||||||
{
|
{
|
||||||
BxTextMode = (fheight > 0);
|
guest_textmode = (fheight > 0);
|
||||||
if (BxTextMode) {
|
guest_xres = x;
|
||||||
|
guest_yres = y;
|
||||||
|
if (guest_textmode) {
|
||||||
text_cols = x / fwidth;
|
text_cols = x / fwidth;
|
||||||
text_rows = y / fheight;
|
text_rows = y / fheight;
|
||||||
xChar = fwidth;
|
xChar = fwidth;
|
||||||
yChar = fheight;
|
yChar = fheight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x==dimension_x && y==dimension_y && bpp==current_bpp)
|
if (x == dimension_x && y == dimension_y && bpp == current_bpp)
|
||||||
return;
|
return;
|
||||||
dimension_x = x;
|
dimension_x = x;
|
||||||
dimension_y = y;
|
dimension_y = y;
|
||||||
stretched_x = dimension_x;
|
stretched_x = dimension_x;
|
||||||
stretched_y = dimension_y;
|
stretched_y = dimension_y;
|
||||||
stretch_factor = 1;
|
stretch_factor = 1;
|
||||||
if (BxTextMode && (stretched_x<400)) {
|
if (guest_textmode && (stretched_x<400)) {
|
||||||
stretched_x *= 2;
|
stretched_x *= 2;
|
||||||
stretch_factor *= 2;
|
stretch_factor *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
bitmap_info->bmiHeader.biBitCount = bpp;
|
bitmap_info->bmiHeader.biBitCount = bpp;
|
||||||
if (bpp == 16)
|
if (bpp == 16) {
|
||||||
{
|
|
||||||
bitmap_info->bmiHeader.biCompression = BI_BITFIELDS;
|
bitmap_info->bmiHeader.biCompression = BI_BITFIELDS;
|
||||||
static RGBQUAD red_mask = {0x00, 0xF8, 0x00, 0x00};
|
static RGBQUAD red_mask = {0x00, 0xF8, 0x00, 0x00};
|
||||||
static RGBQUAD green_mask = {0xE0, 0x07, 0x00, 0x00};
|
static RGBQUAD green_mask = {0xE0, 0x07, 0x00, 0x00};
|
||||||
@ -1890,22 +1890,18 @@ void bx_win32_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight,
|
|||||||
bitmap_info->bmiColors[0] = red_mask;
|
bitmap_info->bmiColors[0] = red_mask;
|
||||||
bitmap_info->bmiColors[1] = green_mask;
|
bitmap_info->bmiColors[1] = green_mask;
|
||||||
bitmap_info->bmiColors[2] = blue_mask;
|
bitmap_info->bmiColors[2] = blue_mask;
|
||||||
}
|
} else {
|
||||||
else
|
if (current_bpp == 16) {
|
||||||
{
|
|
||||||
if (current_bpp == 16)
|
|
||||||
{
|
|
||||||
bitmap_info->bmiColors[0] = bitmap_info->bmiColors[256];
|
bitmap_info->bmiColors[0] = bitmap_info->bmiColors[256];
|
||||||
bitmap_info->bmiColors[1] = bitmap_info->bmiColors[257];
|
bitmap_info->bmiColors[1] = bitmap_info->bmiColors[257];
|
||||||
bitmap_info->bmiColors[2] = bitmap_info->bmiColors[258];
|
bitmap_info->bmiColors[2] = bitmap_info->bmiColors[258];
|
||||||
}
|
}
|
||||||
bitmap_info->bmiHeader.biCompression = BI_RGB;
|
bitmap_info->bmiHeader.biCompression = BI_RGB;
|
||||||
if (bpp == 15)
|
if (bpp == 15) {
|
||||||
{
|
|
||||||
bitmap_info->bmiHeader.biBitCount = 16;
|
bitmap_info->bmiHeader.biBitCount = 16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
current_bpp = bpp;
|
current_bpp = guest_bpp = bpp;
|
||||||
|
|
||||||
resize_main_window();
|
resize_main_window();
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ static unsigned long wxFontY = 0;
|
|||||||
static unsigned int text_rows=25, text_cols=80;
|
static unsigned int text_rows=25, text_cols=80;
|
||||||
static Bit8u h_panning = 0, v_panning = 0;
|
static Bit8u h_panning = 0, v_panning = 0;
|
||||||
static Bit16u line_compare = 1023;
|
static Bit16u line_compare = 1023;
|
||||||
static unsigned vga_bpp=8;
|
static unsigned disp_bpp = 8;
|
||||||
static struct {
|
static struct {
|
||||||
unsigned char red;
|
unsigned char red;
|
||||||
unsigned char green;
|
unsigned char green;
|
||||||
@ -1160,7 +1160,7 @@ static void UpdateScreen(unsigned char *newBits, int x, int y, int width, int he
|
|||||||
wxCriticalSectionLocker lock(wxScreen_lock);
|
wxCriticalSectionLocker lock(wxScreen_lock);
|
||||||
IFDBG_VGA(wxLogDebug (wxT ("MyPanel::UpdateScreen got lock. wxScreen=%p", wxScreen)));
|
IFDBG_VGA(wxLogDebug (wxT ("MyPanel::UpdateScreen got lock. wxScreen=%p", wxScreen)));
|
||||||
if(wxScreen != NULL) {
|
if(wxScreen != NULL) {
|
||||||
switch (vga_bpp) {
|
switch (disp_bpp) {
|
||||||
case 8: /* 8 bpp */
|
case 8: /* 8 bpp */
|
||||||
for(int i = 0; i < height; i++) {
|
for(int i = 0; i < height; i++) {
|
||||||
char *pwxScreen = &wxScreen[(y * wxScreenX * 3) + (x * 3)];
|
char *pwxScreen = &wxScreen[(y * wxScreenX * 3) + (x * 3)];
|
||||||
@ -1176,7 +1176,7 @@ static void UpdateScreen(unsigned char *newBits, int x, int y, int width, int he
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BX_PANIC(("%u bpp modes handled by new graphics API", vga_bpp));
|
BX_PANIC(("%u bpp modes handled by new graphics API", disp_bpp));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1423,7 +1423,7 @@ void bx_wx_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
|
|||||||
// returns: 0=no screen update needed (color map change has direct effect)
|
// returns: 0=no screen update needed (color map change has direct effect)
|
||||||
// 1=screen update needed (redraw using current colormap)
|
// 1=screen update needed (redraw using current colormap)
|
||||||
|
|
||||||
bx_bool bx_wx_gui_c::palette_change(unsigned index, unsigned red, unsigned green, unsigned blue)
|
bx_bool bx_wx_gui_c::palette_change(Bit8u index, Bit8u red, Bit8u green, Bit8u blue)
|
||||||
{
|
{
|
||||||
IFDBG_VGA(wxLogDebug (wxT ("palette_change")));
|
IFDBG_VGA(wxLogDebug (wxT ("palette_change")));
|
||||||
wxBochsPalette[index].red = red;
|
wxBochsPalette[index].red = red;
|
||||||
@ -1528,13 +1528,14 @@ void bx_wx_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, uns
|
|||||||
BX_INFO (("dimension update x=%d y=%d fontheight=%d fontwidth=%d bpp=%d", x, y, fheight, fwidth, bpp));
|
BX_INFO (("dimension update x=%d y=%d fontheight=%d fontwidth=%d bpp=%d", x, y, fheight, fwidth, bpp));
|
||||||
if ((bpp == 8) || (bpp == 15) || (bpp == 16) || (bpp == 24) || (bpp == 32)) {
|
if ((bpp == 8) || (bpp == 15) || (bpp == 16) || (bpp == 24) || (bpp == 32)) {
|
||||||
if (bpp == 32) BX_INFO(("wxWidgets ignores bit 24..31 in 32bpp mode"));
|
if (bpp == 32) BX_INFO(("wxWidgets ignores bit 24..31 in 32bpp mode"));
|
||||||
vga_bpp = bpp;
|
disp_bpp = guest_bpp = bpp;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
BX_PANIC(("%d bpp graphics mode not supported", bpp));
|
BX_PANIC(("%d bpp graphics mode not supported", bpp));
|
||||||
}
|
}
|
||||||
if (fheight > 0) {
|
guest_textmode = (fheight > 0);
|
||||||
|
guest_xres = x;
|
||||||
|
guest_yres = y;
|
||||||
|
if (guest_textmode) {
|
||||||
wxFontX = fwidth;
|
wxFontX = fwidth;
|
||||||
wxFontY = fheight;
|
wxFontY = fheight;
|
||||||
text_cols = x / wxFontX;
|
text_cols = x / wxFontX;
|
||||||
|
@ -104,7 +104,6 @@ static unsigned prev_cursor_y=0;
|
|||||||
static Window win;
|
static Window win;
|
||||||
static GC gc, gc_inv, gc_headerbar, gc_headerbar_inv;
|
static GC gc, gc_inv, gc_headerbar, gc_headerbar_inv;
|
||||||
static unsigned dimension_x=0, dimension_y=0;
|
static unsigned dimension_x=0, dimension_y=0;
|
||||||
static unsigned vga_bpp=8;
|
|
||||||
|
|
||||||
static XImage *ximage = NULL;
|
static XImage *ximage = NULL;
|
||||||
static unsigned imDepth, imWide, imBPP;
|
static unsigned imDepth, imWide, imBPP;
|
||||||
@ -1490,7 +1489,7 @@ void bx_x_gui_c::graphics_tile_update(Bit8u *tile, unsigned x0, unsigned y0)
|
|||||||
} else {
|
} else {
|
||||||
y_size = y_tilesize;
|
y_size = y_tilesize;
|
||||||
}
|
}
|
||||||
switch (vga_bpp) {
|
switch (guest_bpp) {
|
||||||
case 8: // 8 bits per pixel
|
case 8: // 8 bits per pixel
|
||||||
for (y=0; y<y_size; y++) {
|
for (y=0; y<y_size; y++) {
|
||||||
for (x=0; x<x_tilesize; x++) {
|
for (x=0; x<x_tilesize; x++) {
|
||||||
@ -1557,7 +1556,7 @@ void bx_x_gui_c::graphics_tile_update(Bit8u *tile, unsigned x0, unsigned y0)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BX_PANIC(("X_graphics_tile_update: bits_per_pixel %u handled by new graphics API",
|
BX_PANIC(("X_graphics_tile_update: bits_per_pixel %u handled by new graphics API",
|
||||||
(unsigned) vga_bpp));
|
(unsigned) guest_bpp));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
XPutImage(bx_x_display, win, gc, ximage, 0, 0, x0, y0+bx_headerbar_y,
|
XPutImage(bx_x_display, win, gc, ximage, 0, 0, x0, y0+bx_headerbar_y,
|
||||||
@ -1667,7 +1666,7 @@ void bx_x_gui_c::graphics_tile_update_in_place(unsigned x0, unsigned y0,
|
|||||||
x0, y0+bx_headerbar_y, w, h);
|
x0, y0+bx_headerbar_y, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
bx_bool bx_x_gui_c::palette_change(unsigned index, unsigned red, unsigned green, unsigned blue)
|
bx_bool bx_x_gui_c::palette_change(Bit8u index, Bit8u red, Bit8u green, Bit8u blue)
|
||||||
{
|
{
|
||||||
// returns: 0=no screen update needed (color map change has direct effect)
|
// returns: 0=no screen update needed (color map change has direct effect)
|
||||||
// 1=screen updated needed (redraw using current colormap)
|
// 1=screen updated needed (redraw using current colormap)
|
||||||
@ -1694,11 +1693,14 @@ bx_bool bx_x_gui_c::palette_change(unsigned index, unsigned red, unsigned green,
|
|||||||
void bx_x_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, unsigned fwidth, unsigned bpp)
|
void bx_x_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, unsigned fwidth, unsigned bpp)
|
||||||
{
|
{
|
||||||
if ((bpp == 8) || (bpp == 15) || (bpp == 16) || (bpp == 24) || (bpp == 32)) {
|
if ((bpp == 8) || (bpp == 15) || (bpp == 16) || (bpp == 24) || (bpp == 32)) {
|
||||||
vga_bpp = bpp;
|
guest_bpp = bpp;
|
||||||
} else {
|
} else {
|
||||||
BX_PANIC(("%d bpp graphics mode not supported", bpp));
|
BX_PANIC(("%d bpp graphics mode not supported", bpp));
|
||||||
}
|
}
|
||||||
if (fheight > 0) {
|
guest_textmode = (fheight > 0);
|
||||||
|
guest_xres = x;
|
||||||
|
guest_yres = y;
|
||||||
|
if (guest_textmode) {
|
||||||
font_height = fheight;
|
font_height = fheight;
|
||||||
font_width = fwidth;
|
font_width = fwidth;
|
||||||
text_cols = x / font_width;
|
text_cols = x / font_width;
|
||||||
|
@ -464,9 +464,9 @@ void bx_svga_cirrus_c::after_restore_state(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
for (unsigned i=0; i<256; i++) {
|
for (unsigned i=0; i<256; i++) {
|
||||||
bx_gui->palette_change(i, BX_CIRRUS_THIS s.pel.data[i].red<<2,
|
bx_gui->palette_change_common(i, BX_CIRRUS_THIS s.pel.data[i].red<<2,
|
||||||
BX_CIRRUS_THIS s.pel.data[i].green<<2,
|
BX_CIRRUS_THIS s.pel.data[i].green<<2,
|
||||||
BX_CIRRUS_THIS s.pel.data[i].blue<<2);
|
BX_CIRRUS_THIS s.pel.data[i].blue<<2);
|
||||||
}
|
}
|
||||||
BX_CIRRUS_THIS svga_needs_update_mode = 1;
|
BX_CIRRUS_THIS svga_needs_update_mode = 1;
|
||||||
BX_CIRRUS_THIS svga_update();
|
BX_CIRRUS_THIS svga_update();
|
||||||
@ -825,32 +825,19 @@ void bx_svga_cirrus_c::mem_write(bx_phy_address addr, Bit8u value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int bx_svga_cirrus_c::get_snapshot_mode()
|
|
||||||
{
|
|
||||||
if ((BX_CIRRUS_THIS sequencer.reg[0x07] & 0x01) == CIRRUS_SR7_BPP_VGA) {
|
|
||||||
return BX_CIRRUS_THIS bx_vgacore_c::get_snapshot_mode();
|
|
||||||
} else {
|
|
||||||
return BX_GUI_SNAPSHOT_GFX;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void bx_svga_cirrus_c::get_text_snapshot(Bit8u **text_snapshot,
|
void bx_svga_cirrus_c::get_text_snapshot(Bit8u **text_snapshot,
|
||||||
unsigned *txHeight, unsigned *txWidth)
|
unsigned *txHeight, unsigned *txWidth)
|
||||||
{
|
{
|
||||||
BX_CIRRUS_THIS bx_vgacore_c::get_text_snapshot(text_snapshot,txHeight,txWidth);
|
BX_CIRRUS_THIS bx_vgacore_c::get_text_snapshot(text_snapshot,txHeight,txWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
Bit32u bx_svga_cirrus_c::get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_ptr,
|
Bit32u bx_svga_cirrus_c::get_gfx_snapshot(Bit8u **snapshot_ptr)
|
||||||
unsigned *iHeight, unsigned *iWidth, unsigned *iDepth)
|
|
||||||
{
|
{
|
||||||
Bit32u len, len1;
|
Bit32u len, len1;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
Bit8u *dst_ptr, *src_ptr;
|
Bit8u *dst_ptr, *src_ptr;
|
||||||
|
|
||||||
if ((BX_CIRRUS_THIS sequencer.reg[0x07] & 0x01) != CIRRUS_SR7_BPP_VGA) {
|
if ((BX_CIRRUS_THIS sequencer.reg[0x07] & 0x01) != CIRRUS_SR7_BPP_VGA) {
|
||||||
*iHeight = BX_CIRRUS_THIS svga_yres;
|
|
||||||
*iWidth = BX_CIRRUS_THIS svga_xres;
|
|
||||||
*iDepth = BX_CIRRUS_THIS svga_dispbpp;
|
|
||||||
len1 = BX_CIRRUS_THIS svga_xres * (BX_CIRRUS_THIS svga_bpp >> 3);
|
len1 = BX_CIRRUS_THIS svga_xres * (BX_CIRRUS_THIS svga_bpp >> 3);
|
||||||
len = len1 * BX_CIRRUS_THIS svga_yres;
|
len = len1 * BX_CIRRUS_THIS svga_yres;
|
||||||
*snapshot_ptr = (Bit8u*)malloc(len);
|
*snapshot_ptr = (Bit8u*)malloc(len);
|
||||||
@ -863,12 +850,9 @@ Bit32u bx_svga_cirrus_c::get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_
|
|||||||
src_ptr += BX_CIRRUS_THIS svga_pitch;
|
src_ptr += BX_CIRRUS_THIS svga_pitch;
|
||||||
dst_ptr += len1;
|
dst_ptr += len1;
|
||||||
}
|
}
|
||||||
if (*iDepth == 8) {
|
|
||||||
BX_CIRRUS_THIS get_dac_palette(palette_ptr, 2);
|
|
||||||
}
|
|
||||||
return len;
|
return len;
|
||||||
} else {
|
} else {
|
||||||
return BX_CIRRUS_THIS bx_vgacore_c::get_gfx_snapshot(snapshot_ptr, palette_ptr, iHeight, iWidth, iDepth);
|
return BX_CIRRUS_THIS bx_vgacore_c::get_gfx_snapshot(snapshot_ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,11 +73,9 @@ public:
|
|||||||
unsigned width, unsigned height);
|
unsigned width, unsigned height);
|
||||||
virtual Bit8u mem_read(bx_phy_address addr);
|
virtual Bit8u mem_read(bx_phy_address addr);
|
||||||
virtual void mem_write(bx_phy_address addr, Bit8u value);
|
virtual void mem_write(bx_phy_address addr, Bit8u value);
|
||||||
virtual int get_snapshot_mode(void);
|
|
||||||
virtual void get_text_snapshot(Bit8u **text_snapshot,
|
virtual void get_text_snapshot(Bit8u **text_snapshot,
|
||||||
unsigned *txHeight, unsigned *txWidth);
|
unsigned *txHeight, unsigned *txWidth);
|
||||||
virtual Bit32u get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_ptr,
|
virtual Bit32u get_gfx_snapshot(Bit8u **snapshot_ptr);
|
||||||
unsigned *iHeight, unsigned *iWidth, unsigned *iDepth);
|
|
||||||
virtual void register_state(void);
|
virtual void register_state(void);
|
||||||
virtual void after_restore_state(void);
|
virtual void after_restore_state(void);
|
||||||
|
|
||||||
|
@ -764,26 +764,13 @@ void bx_vga_c::mem_write(bx_phy_address addr, Bit8u value)
|
|||||||
bx_vgacore_c::mem_write(addr, value);
|
bx_vgacore_c::mem_write(addr, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bx_vga_c::get_snapshot_mode()
|
Bit32u bx_vga_c::get_gfx_snapshot(Bit8u **snapshot_ptr)
|
||||||
{
|
|
||||||
if ((BX_VGA_THIS vbe.enabled) && (BX_VGA_THIS vbe.bpp >= 8)) {
|
|
||||||
return BX_GUI_SNAPSHOT_GFX;
|
|
||||||
} else {
|
|
||||||
return bx_vgacore_c::get_snapshot_mode();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Bit32u bx_vga_c::get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_ptr,
|
|
||||||
unsigned *iHeight, unsigned *iWidth, unsigned *iDepth)
|
|
||||||
{
|
{
|
||||||
Bit32u len, len1;
|
Bit32u len, len1;
|
||||||
unsigned i, shift;
|
unsigned i, shift;
|
||||||
Bit8u *dst_ptr, *src_ptr;
|
Bit8u *dst_ptr, *src_ptr;
|
||||||
|
|
||||||
if ((BX_VGA_THIS vbe.enabled) && (BX_VGA_THIS vbe.bpp >= 8)) {
|
if ((BX_VGA_THIS vbe.enabled) && (BX_VGA_THIS vbe.bpp >= 8)) {
|
||||||
*iHeight = BX_VGA_THIS vbe.yres;
|
|
||||||
*iWidth = BX_VGA_THIS vbe.xres;
|
|
||||||
*iDepth = BX_VGA_THIS vbe.bpp;
|
|
||||||
len1 = BX_VGA_THIS vbe.xres * BX_VGA_THIS vbe.bpp_multiplier;
|
len1 = BX_VGA_THIS vbe.xres * BX_VGA_THIS vbe.bpp_multiplier;
|
||||||
len = len1 * BX_VGA_THIS vbe.yres;
|
len = len1 * BX_VGA_THIS vbe.yres;
|
||||||
*snapshot_ptr = (Bit8u*)malloc(len);
|
*snapshot_ptr = (Bit8u*)malloc(len);
|
||||||
@ -796,17 +783,9 @@ Bit32u bx_vga_c::get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_ptr,
|
|||||||
src_ptr += BX_VGA_THIS s.line_offset;
|
src_ptr += BX_VGA_THIS s.line_offset;
|
||||||
dst_ptr += len1;
|
dst_ptr += len1;
|
||||||
}
|
}
|
||||||
if (*iDepth == 8) {
|
|
||||||
if (BX_VGA_THIS vbe.dac_8bit) {
|
|
||||||
shift = 0;
|
|
||||||
} else {
|
|
||||||
shift = 2;
|
|
||||||
}
|
|
||||||
BX_VGA_THIS get_dac_palette(palette_ptr, shift);
|
|
||||||
}
|
|
||||||
return len;
|
return len;
|
||||||
} else {
|
} else {
|
||||||
return bx_vgacore_c::get_gfx_snapshot(snapshot_ptr, palette_ptr, iHeight, iWidth, iDepth);
|
return bx_vgacore_c::get_gfx_snapshot(snapshot_ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,9 +104,7 @@ public:
|
|||||||
virtual void redraw_area(unsigned x0, unsigned y0,
|
virtual void redraw_area(unsigned x0, unsigned y0,
|
||||||
unsigned width, unsigned height);
|
unsigned width, unsigned height);
|
||||||
|
|
||||||
virtual int get_snapshot_mode(void);
|
virtual Bit32u get_gfx_snapshot(Bit8u **snapshot_ptr);
|
||||||
virtual Bit32u get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_ptr,
|
|
||||||
unsigned *iHeight, unsigned *iWidth, unsigned *iDepth);
|
|
||||||
virtual void init_vga_extension(void);
|
virtual void init_vga_extension(void);
|
||||||
|
|
||||||
static void timer_handler(void *);
|
static void timer_handler(void *);
|
||||||
|
@ -376,9 +376,9 @@ void bx_vgacore_c::register_state(bx_list_c *parent)
|
|||||||
void bx_vgacore_c::after_restore_state(void)
|
void bx_vgacore_c::after_restore_state(void)
|
||||||
{
|
{
|
||||||
for (unsigned i=0; i<256; i++) {
|
for (unsigned i=0; i<256; i++) {
|
||||||
bx_gui->palette_change(i, BX_VGA_THIS s.pel.data[i].red << BX_VGA_THIS s.dac_shift,
|
bx_gui->palette_change_common(i, BX_VGA_THIS s.pel.data[i].red << BX_VGA_THIS s.dac_shift,
|
||||||
BX_VGA_THIS s.pel.data[i].green << BX_VGA_THIS s.dac_shift,
|
BX_VGA_THIS s.pel.data[i].green << BX_VGA_THIS s.dac_shift,
|
||||||
BX_VGA_THIS s.pel.data[i].blue << BX_VGA_THIS s.dac_shift);
|
BX_VGA_THIS s.pel.data[i].blue << BX_VGA_THIS s.dac_shift);
|
||||||
}
|
}
|
||||||
bx_gui->set_text_charmap(&BX_VGA_THIS s.memory[0x20000 + BX_VGA_THIS s.charmap_address]);
|
bx_gui->set_text_charmap(&BX_VGA_THIS s.memory[0x20000 + BX_VGA_THIS s.charmap_address]);
|
||||||
BX_VGA_THIS calculate_retrace_timing();
|
BX_VGA_THIS calculate_retrace_timing();
|
||||||
@ -1074,7 +1074,7 @@ void bx_vgacore_c::write(Bit32u address, Bit32u value, unsigned io_len, bx_bool
|
|||||||
case 2:
|
case 2:
|
||||||
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].blue = value;
|
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].blue = value;
|
||||||
|
|
||||||
needs_update |= bx_gui->palette_change(BX_VGA_THIS s.pel.write_data_register,
|
needs_update |= bx_gui->palette_change_common(BX_VGA_THIS s.pel.write_data_register,
|
||||||
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].red << BX_VGA_THIS s.dac_shift,
|
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].red << BX_VGA_THIS s.dac_shift,
|
||||||
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].green << BX_VGA_THIS s.dac_shift,
|
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].green << BX_VGA_THIS s.dac_shift,
|
||||||
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].blue << BX_VGA_THIS s.dac_shift);
|
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].blue << BX_VGA_THIS s.dac_shift);
|
||||||
@ -2283,20 +2283,6 @@ void bx_vgacore_c::mem_write(bx_phy_address addr, Bit8u value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int bx_vgacore_c::get_snapshot_mode()
|
|
||||||
{
|
|
||||||
if (!BX_VGA_THIS s.graphics_ctrl.graphics_alpha) {
|
|
||||||
return BX_GUI_SNAPSHOT_TXT;
|
|
||||||
} else if ((BX_VGA_THIS s.graphics_ctrl.shift_reg == 0) &&
|
|
||||||
((BX_VGA_THIS s.CRTC.reg[0x17] & 1) != 0)) {
|
|
||||||
return BX_GUI_SNAPSHOT_GFX;
|
|
||||||
} else if (BX_VGA_THIS s.graphics_ctrl.shift_reg == 2) {
|
|
||||||
return BX_GUI_SNAPSHOT_GFX;
|
|
||||||
} else {
|
|
||||||
return BX_GUI_SNAPSHOT_UNSUP;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void bx_vgacore_c::get_text_snapshot(Bit8u **text_snapshot, unsigned *txHeight,
|
void bx_vgacore_c::get_text_snapshot(Bit8u **text_snapshot, unsigned *txHeight,
|
||||||
unsigned *txWidth)
|
unsigned *txWidth)
|
||||||
{
|
{
|
||||||
@ -2314,34 +2300,13 @@ void bx_vgacore_c::get_text_snapshot(Bit8u **text_snapshot, unsigned *txHeight,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bx_bool bx_vgacore_c::get_dac_palette(Bit8u **palette_ptr, Bit8u shift)
|
Bit32u bx_vgacore_c::get_gfx_snapshot(Bit8u **snapshot_ptr)
|
||||||
{
|
|
||||||
unsigned i;
|
|
||||||
Bit8u *dst_ptr;
|
|
||||||
|
|
||||||
*palette_ptr = (Bit8u*)malloc(256 * 4);
|
|
||||||
if (palette_ptr == NULL) return 0;
|
|
||||||
dst_ptr = *palette_ptr;
|
|
||||||
for (i = 0; i < 256; i++) {
|
|
||||||
*(dst_ptr++) = (BX_VGA_THIS s.pel.data[i].blue << shift);
|
|
||||||
*(dst_ptr++) = (BX_VGA_THIS s.pel.data[i].green << shift);
|
|
||||||
*(dst_ptr++) = (BX_VGA_THIS s.pel.data[i].red << shift);
|
|
||||||
*(dst_ptr++) = 0;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
Bit32u bx_vgacore_c::get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_ptr,
|
|
||||||
unsigned *iHeight, unsigned *iWidth, unsigned *iDepth)
|
|
||||||
{
|
{
|
||||||
Bit32u len;
|
Bit32u len;
|
||||||
unsigned line_compare, start_addr, x, y;
|
unsigned line_compare, start_addr, x, y;
|
||||||
unsigned byte_offset, px, py;
|
unsigned byte_offset, px, py;
|
||||||
Bit8u *dst_ptr, *plane[4];
|
Bit8u *dst_ptr, *plane[4];
|
||||||
|
|
||||||
*iHeight = BX_VGA_THIS s.last_yres;
|
|
||||||
*iWidth = BX_VGA_THIS s.last_xres;
|
|
||||||
*iDepth = 8;
|
|
||||||
len = (BX_VGA_THIS s.last_xres * BX_VGA_THIS s.last_yres);
|
len = (BX_VGA_THIS s.last_xres * BX_VGA_THIS s.last_yres);
|
||||||
*snapshot_ptr = (Bit8u*)malloc(len);
|
*snapshot_ptr = (Bit8u*)malloc(len);
|
||||||
if (snapshot_ptr == NULL)
|
if (snapshot_ptr == NULL)
|
||||||
@ -2361,7 +2326,6 @@ Bit32u bx_vgacore_c::get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_ptr,
|
|||||||
*(dst_ptr++) = BX_VGA_THIS get_vga_pixel(x, y, start_addr, line_compare, 0, plane);
|
*(dst_ptr++) = BX_VGA_THIS get_vga_pixel(x, y, start_addr, line_compare, 0, plane);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BX_VGA_THIS get_dac_palette(palette_ptr, BX_VGA_THIS s.dac_shift);
|
|
||||||
return len;
|
return len;
|
||||||
} else if (BX_VGA_THIS s.graphics_ctrl.shift_reg == 2) {
|
} else if (BX_VGA_THIS s.graphics_ctrl.shift_reg == 2) {
|
||||||
for (y = 0; y < BX_VGA_THIS s.last_yres; y++) {
|
for (y = 0; y < BX_VGA_THIS s.last_yres; y++) {
|
||||||
@ -2379,12 +2343,8 @@ Bit32u bx_vgacore_c::get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_ptr,
|
|||||||
*(dst_ptr++) = plane[px % 4][byte_offset];
|
*(dst_ptr++) = plane[px % 4][byte_offset];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BX_VGA_THIS get_dac_palette(palette_ptr, 2);
|
|
||||||
return len;
|
return len;
|
||||||
} else {
|
} else {
|
||||||
*iHeight = 0;
|
|
||||||
*iWidth = 0;
|
|
||||||
*iDepth = 0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,11 +70,9 @@ public:
|
|||||||
virtual void redraw_area(unsigned x0, unsigned y0,
|
virtual void redraw_area(unsigned x0, unsigned y0,
|
||||||
unsigned width, unsigned height);
|
unsigned width, unsigned height);
|
||||||
|
|
||||||
virtual int get_snapshot_mode(void);
|
|
||||||
virtual void get_text_snapshot(Bit8u **text_snapshot, unsigned *txHeight,
|
virtual void get_text_snapshot(Bit8u **text_snapshot, unsigned *txHeight,
|
||||||
unsigned *txWidth);
|
unsigned *txWidth);
|
||||||
virtual Bit32u get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_ptr,
|
virtual Bit32u get_gfx_snapshot(Bit8u **snapshot_ptr);
|
||||||
unsigned *iHeight, unsigned *iWidth, unsigned *iDepth);
|
|
||||||
virtual void init_vga_extension(void) {}
|
virtual void init_vga_extension(void) {}
|
||||||
|
|
||||||
static void timer_handler(void *);
|
static void timer_handler(void *);
|
||||||
@ -93,7 +91,6 @@ protected:
|
|||||||
void write(Bit32u address, Bit32u value, unsigned io_len, bx_bool no_log);
|
void write(Bit32u address, Bit32u value, unsigned io_len, bx_bool no_log);
|
||||||
|
|
||||||
Bit8u get_vga_pixel(Bit16u x, Bit16u y, Bit16u saddr, Bit16u lc, bx_bool bs, Bit8u **plane);
|
Bit8u get_vga_pixel(Bit16u x, Bit16u y, Bit16u saddr, Bit16u lc, bx_bool bs, Bit8u **plane);
|
||||||
bx_bool get_dac_palette(Bit8u **palette_ptr, Bit8u shift);
|
|
||||||
void update(void);
|
void update(void);
|
||||||
void determine_screen_dimensions(unsigned *piHeight, unsigned *piWidth);
|
void determine_screen_dimensions(unsigned *piHeight, unsigned *piWidth);
|
||||||
void calculate_retrace_timing(void);
|
void calculate_retrace_timing(void);
|
||||||
|
@ -251,16 +251,11 @@ public:
|
|||||||
virtual void mem_write(bx_phy_address addr, Bit8u value) {
|
virtual void mem_write(bx_phy_address addr, Bit8u value) {
|
||||||
STUBFUNC(vga, mem_write);
|
STUBFUNC(vga, mem_write);
|
||||||
}
|
}
|
||||||
virtual int get_snapshot_mode(void) {
|
|
||||||
STUBFUNC(vga, get_snapshot_mode);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
virtual void get_text_snapshot(Bit8u **text_snapshot,
|
virtual void get_text_snapshot(Bit8u **text_snapshot,
|
||||||
unsigned *txHeight, unsigned *txWidth) {
|
unsigned *txHeight, unsigned *txWidth) {
|
||||||
STUBFUNC(vga, get_text_snapshot);
|
STUBFUNC(vga, get_text_snapshot);
|
||||||
}
|
}
|
||||||
virtual Bit32u get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_ptr,
|
virtual Bit32u get_gfx_snapshot(Bit8u **snapshot_ptr) {
|
||||||
unsigned *iHeight, unsigned *iWidth, unsigned *iDepth) {
|
|
||||||
STUBFUNC(vga, get_gfx_snapshot);
|
STUBFUNC(vga, get_gfx_snapshot);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -214,11 +214,10 @@ extern "C" {
|
|||||||
#define DEV_vga_mem_write(addr, val) (bx_devices.pluginVgaDevice->mem_write(addr, val))
|
#define DEV_vga_mem_write(addr, val) (bx_devices.pluginVgaDevice->mem_write(addr, val))
|
||||||
#define DEV_vga_redraw_area(left, top, right, bottom) \
|
#define DEV_vga_redraw_area(left, top, right, bottom) \
|
||||||
(bx_devices.pluginVgaDevice->redraw_area(left, top, right, bottom))
|
(bx_devices.pluginVgaDevice->redraw_area(left, top, right, bottom))
|
||||||
#define DEV_vga_get_snapshot_mode() bx_devices.pluginVgaDevice->get_snapshot_mode()
|
|
||||||
#define DEV_vga_get_text_snapshot(rawsnap, height, width) \
|
#define DEV_vga_get_text_snapshot(rawsnap, height, width) \
|
||||||
(bx_devices.pluginVgaDevice->get_text_snapshot(rawsnap, height, width))
|
(bx_devices.pluginVgaDevice->get_text_snapshot(rawsnap, height, width))
|
||||||
#define DEV_vga_get_gfx_snapshot(rawsnap, palette, height, width, depth) \
|
#define DEV_vga_get_gfx_snapshot(rawsnap) \
|
||||||
(bx_devices.pluginVgaDevice->get_gfx_snapshot(rawsnap, palette, height, width, depth))
|
(bx_devices.pluginVgaDevice->get_gfx_snapshot(rawsnap))
|
||||||
#define DEV_vga_refresh() \
|
#define DEV_vga_refresh() \
|
||||||
(bx_devices.pluginVgaDevice->trigger_timer(bx_devices.pluginVgaDevice))
|
(bx_devices.pluginVgaDevice->trigger_timer(bx_devices.pluginVgaDevice))
|
||||||
#define DEV_vga_set_override(a) (bx_devices.pluginVgaDevice->set_override(a))
|
#define DEV_vga_set_override(a) (bx_devices.pluginVgaDevice->set_override(a))
|
||||||
|
Loading…
Reference in New Issue
Block a user