vga: use latches in odd/even mode too
commit3f83435042af241ea8773d04ef3726ce4146bfca
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 30 Dec 2014 21:42:06 +0000 (30 22:42 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 18 Jan 2024 09:43:14 +0000 (18 10:43 +0100)
treee843167e964f5c7e513a569f1b22def455f82ba9
parentae9d71a003c8cfd2f035c8f768341a40bcef8ed4
vga: use latches in odd/even mode too

Jazz Jackrabbit uses odd/even mode with 256-color graphics.  This is
probably so that it can do very fast blitting with a decent resolution
(two pixels, compared to four pixels for "regular" mode X).

Accesses still use all planes (reads go to the latches and the game uses
read mode 1 so that the CPU always gets 0xFF; writes use the plane mask
register because the game sets bit 2 of the sequencer's memory mode
register).  For this to work, QEMU needs to use the code for latched
memory accesses in odd/even mode.  The only difference between odd/even
mode and "regular" planar mode is how the plane is computed in read mode
0, and how the planes are masked if the aforementioned bit 2 is reset.

It is almost enough to fix the game.  You also need to honor byte/word
mode selection, which is done in the next patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/display/vga.c