mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
Revert "vga: add some optional CGA compatibility hacks"
This reverts commit 482f7bf86b
.
Signed-off-by: malc <av1474@comtv.ru>
This commit is contained in:
parent
4f213879f3
commit
df8002103c
4 changed files with 8 additions and 74 deletions
4
hw/pc.h
4
hw/pc.h
|
@ -176,10 +176,6 @@ enum vga_retrace_method {
|
||||||
|
|
||||||
extern enum vga_retrace_method vga_retrace_method;
|
extern enum vga_retrace_method vga_retrace_method;
|
||||||
|
|
||||||
#define VGA_CGA_HACK_PALETTE_BLANKING (1<<0)
|
|
||||||
#define VGA_CGA_HACK_FONT_HEIGHT (1<<1)
|
|
||||||
extern int vga_cga_hacks;
|
|
||||||
|
|
||||||
static inline DeviceState *isa_vga_init(ISABus *bus)
|
static inline DeviceState *isa_vga_init(ISABus *bus)
|
||||||
{
|
{
|
||||||
ISADevice *dev;
|
ISADevice *dev;
|
||||||
|
|
36
hw/vga.c
36
hw/vga.c
|
@ -547,31 +547,14 @@ void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
|
||||||
printf("vga: write CR%x = 0x%02x\n", s->cr_index, val);
|
printf("vga: write CR%x = 0x%02x\n", s->cr_index, val);
|
||||||
#endif
|
#endif
|
||||||
/* handle CR0-7 protection */
|
/* handle CR0-7 protection */
|
||||||
if (s->cr[VGA_CRTC_V_SYNC_END] & VGA_CR11_LOCK_CR0_CR7) {
|
if ((s->cr[VGA_CRTC_V_SYNC_END] & VGA_CR11_LOCK_CR0_CR7) &&
|
||||||
if (s->cr_index <= VGA_CRTC_OVERFLOW) {
|
s->cr_index <= VGA_CRTC_OVERFLOW) {
|
||||||
/* can always write bit 4 of CR7 */
|
/* can always write bit 4 of CR7 */
|
||||||
if (s->cr_index == VGA_CRTC_OVERFLOW) {
|
if (s->cr_index == VGA_CRTC_OVERFLOW) {
|
||||||
s->cr[VGA_CRTC_OVERFLOW] =
|
s->cr[VGA_CRTC_OVERFLOW] = (s->cr[VGA_CRTC_OVERFLOW] & ~0x10) |
|
||||||
(s->cr[VGA_CRTC_OVERFLOW] & ~0x10) | (val & 0x10);
|
(val & 0x10);
|
||||||
}
|
|
||||||
return;
|
|
||||||
} else if ((vga_cga_hacks & VGA_CGA_HACK_FONT_HEIGHT) &&
|
|
||||||
!(s->sr[VGA_SEQ_CLOCK_MODE] & VGA_SR01_CHAR_CLK_8DOTS)) {
|
|
||||||
/* extra CGA compatibility hacks (not in standard VGA) */
|
|
||||||
if (s->cr_index == VGA_CRTC_MAX_SCAN &&
|
|
||||||
val == 7 &&
|
|
||||||
(s->cr[VGA_CRTC_MAX_SCAN] & 0xf) == 0xf) {
|
|
||||||
return;
|
|
||||||
} else if (s->cr_index == VGA_CRTC_CURSOR_START &&
|
|
||||||
val == 6 &&
|
|
||||||
(s->cr[VGA_CRTC_MAX_SCAN] & 0xf) == 0xf) {
|
|
||||||
val = 0xd;
|
|
||||||
} else if (s->cr_index == VGA_CRTC_CURSOR_END &&
|
|
||||||
val == 7 &&
|
|
||||||
(s->cr[VGA_CRTC_MAX_SCAN] & 0xf) == 0xf) {
|
|
||||||
val = 0xe;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
s->cr[s->cr_index] = val;
|
s->cr[s->cr_index] = val;
|
||||||
|
|
||||||
|
@ -1903,10 +1886,7 @@ static void vga_update_display(void *opaque)
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
} else {
|
} else {
|
||||||
full_update = 0;
|
full_update = 0;
|
||||||
if (!(s->ar_index & 0x20) &&
|
if (!(s->ar_index & 0x20)) {
|
||||||
/* extra CGA compatibility hacks (not in standard VGA */
|
|
||||||
(!(vga_cga_hacks & VGA_CGA_HACK_PALETTE_BLANKING) ||
|
|
||||||
(s->ar_index != 0 && s->ar_flip_flop))) {
|
|
||||||
graphic_mode = GMODE_BLANK;
|
graphic_mode = GMODE_BLANK;
|
||||||
} else {
|
} else {
|
||||||
graphic_mode = s->gr[VGA_GFX_MISC] & VGA_GR06_GRAPHICS_MODE;
|
graphic_mode = s->gr[VGA_GFX_MISC] & VGA_GR06_GRAPHICS_MODE;
|
||||||
|
|
|
@ -975,25 +975,6 @@ Valid optional properties are
|
||||||
@item retrace=dumb|precise
|
@item retrace=dumb|precise
|
||||||
Select dumb (default) or precise VGA retrace logic, useful for some
|
Select dumb (default) or precise VGA retrace logic, useful for some
|
||||||
DOS games/demos.
|
DOS games/demos.
|
||||||
@item cga_hacks=@var{hack1}[+@var{hack2},[...]]
|
|
||||||
Enable various extra CGA compatibility hacks for programs that are
|
|
||||||
trying to directly set CGA modes without BIOS assistance nor
|
|
||||||
real knowledge of EGA/VGA. These might only work with -vga std.
|
|
||||||
Valid hacks are
|
|
||||||
@table @option
|
|
||||||
@item palette_blanking
|
|
||||||
Wait to blank the screen until palette registers seem to actually be
|
|
||||||
modified, instead of blanking it as soon as the palette address bit (0x10)
|
|
||||||
of the attribute address register (0x3c0) is cleared.
|
|
||||||
@item font_height
|
|
||||||
Ignore attempts to change the VGA font height (index 9),
|
|
||||||
cursor start (index 10), and cursor end (index 11) of the CRTC control
|
|
||||||
registers (0x3d5) if trying to set them to the default for CGA fonts
|
|
||||||
instead of VGA fonts.
|
|
||||||
@item all
|
|
||||||
Enable all CGA hacks. More CGA hacks may be added in future versions
|
|
||||||
of qemu.
|
|
||||||
@end table
|
|
||||||
@end table
|
@end table
|
||||||
ETEXI
|
ETEXI
|
||||||
|
|
||||||
|
|
23
vl.c
23
vl.c
|
@ -179,7 +179,6 @@ int main(int argc, char **argv)
|
||||||
static const char *data_dir;
|
static const char *data_dir;
|
||||||
const char *bios_name = NULL;
|
const char *bios_name = NULL;
|
||||||
enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
|
enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
|
||||||
int vga_cga_hacks = 0;
|
|
||||||
DisplayType display_type = DT_DEFAULT;
|
DisplayType display_type = DT_DEFAULT;
|
||||||
int display_remote = 0;
|
int display_remote = 0;
|
||||||
const char* keyboard_layout = NULL;
|
const char* keyboard_layout = NULL;
|
||||||
|
@ -1749,28 +1748,6 @@ static void select_vgahw (const char *p)
|
||||||
else if (strstart(opts, "precise", &nextopt))
|
else if (strstart(opts, "precise", &nextopt))
|
||||||
vga_retrace_method = VGA_RETRACE_PRECISE;
|
vga_retrace_method = VGA_RETRACE_PRECISE;
|
||||||
else goto invalid_vga;
|
else goto invalid_vga;
|
||||||
} else if (strstart(opts, ",cga_hacks=", &nextopt)) {
|
|
||||||
opts = nextopt;
|
|
||||||
while (*opts) {
|
|
||||||
if (strstart(opts, "all", &nextopt)) {
|
|
||||||
opts = nextopt;
|
|
||||||
vga_cga_hacks |= ~0;
|
|
||||||
} else if (strstart(opts, "palette_blanking", &nextopt)) {
|
|
||||||
opts = nextopt;
|
|
||||||
vga_cga_hacks |= VGA_CGA_HACK_PALETTE_BLANKING;
|
|
||||||
} else if (strstart(opts, "font_height", &nextopt)) {
|
|
||||||
opts = nextopt;
|
|
||||||
vga_cga_hacks |= VGA_CGA_HACK_FONT_HEIGHT;
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (*opts == '+') {
|
|
||||||
opts++;
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else goto invalid_vga;
|
} else goto invalid_vga;
|
||||||
opts = nextopt;
|
opts = nextopt;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue