Previously, this.graphical_mode and the "screen-set-mode" message was
set/sent when the miscellaneous output register was modified. Now that
the method of determining the video mode has changed, screen-set-mode
didn't get sent for the default mode.
This reverts commit 90aaf6b42d, and, in
addition, uses layers as the method of updating small portions of the
screen during svga modes. Instead of updating layers by sending a
separate bus message, the layers array is sent during the
screen-fill-buffer-end message.
Fixes wrong colors on some games. Some games/programs read the 8bit
color corresponding to the 4bit color to determine which 8bit color to
modify in the DAC palette.
dac_color_use_set was called with addr values outside the range
of the pixel buffer, and corrupted the linked list "root" pointers
Fixes the flashes of wrong color on some games.
Big Picture:
https://gist.github.com/ErnWong/7db67164224aaa3be5f6fcc2a6f5dd21Fixes#26, and fixes#179.
Implements:
- mode 4/5, x, and everything in between
- page flipping, panning, split screen
- transitions and animations that depend on changing dac_map and
vga256_palette.
- a linked list to keep track of what pixels have what color, so in
theory it doesn't need to redraw the entire buffer every time the
palettes are modified. Currently slow and incorrect.
- improved display-disable signal timing (port 3DA)
Changes:
- Add layering concept to ScreenAdapter. The idea is that using the
built-in drawImageData to handle the split screens, panning, and page
flipping would be more efficient than writing a loop to recopy pixels
one by one.
- All video modes are now handled by the same generalized pipeline, so
non-standard video modes and configurations such as Mode X will work.
- Video size and buffer size are now determined from register values.
- The code for converting the plane write data into pixel colors (also
known as the "shifting" or the "serializing" step) is deferred until the
next fill-buffer event. This appears to make programs (esp. games) run
smoother. See vga_replot
- Separate VGA redraw from SVGA 8 bpp redraw