summary refs log tree commit diff stats
path: root/hw/display/vga_int.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-12-29 14:48:14 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2024-01-18 10:43:13 +0100
commit973a724eb006f674301a0c45f34b3c08dee0fe49 (patch)
tree62c9aabc2a8c2f447232327f13167335dbcf8145 /hw/display/vga_int.h
parent9b53b95a1c3b46e5a54734a46f37790460c9265e (diff)
downloadfocaccia-qemu-973a724eb006f674301a0c45f34b3c08dee0fe49.tar.gz
focaccia-qemu-973a724eb006f674301a0c45f34b3c08dee0fe49.zip
vga: implement horizontal pel panning in graphics modes
This implements smooth scrolling, as used for example by Commander Keen
and Second Reality.

Unfortunately, this is not enough to avoid tearing in Commander Keen,
because sometimes the wrong start address is used for a frame.
On real EGA, the panning register is sampled on every line, while
the display start is latched for the next frame at the start of the
vertical retrace.  On real VGA, the panning register is also latched,
but at the end of the vertical retrace.  It looks like Keen exploits
this by only waiting for horizontal retrace when setting the display
start, but implementing it breaks the 256-color Keen games...

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/display/vga_int.h')
-rw-r--r--hw/display/vga_int.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h
index 6be61e0428..876a1d3697 100644
--- a/hw/display/vga_int.h
+++ b/hw/display/vga_int.h
@@ -60,6 +60,8 @@ typedef struct VGADisplayParams {
     uint32_t line_offset;
     uint32_t start_addr;
     uint32_t line_compare;
+    uint8_t  hpel;
+    bool     hpel_split;
 } VGADisplayParams;
 
 typedef struct VGACommonState {
@@ -111,6 +113,7 @@ typedef struct VGACommonState {
     /* display refresh support */
     QemuConsole *con;
     uint32_t font_offsets[2];
+    uint8_t *panning_buf;
     int graphic_mode;
     uint8_t shift_control;
     uint8_t double_scan;