Commit graph

117 commits

Author SHA1 Message Date
Fabian cf61ac635a vga: correctly advertise the latest bochs version, and make it r/w (fix #768) 2022-11-26 14:11:19 -06:00
Fabian 52163a1fdf vga: set pci revision to 0 to avoid falsely advertising mmio registers (for serenityos, #299) 2022-08-02 21:40:57 +09:00
Fabian f13136b9c1 minor 2022-07-11 12:36:55 +09:00
pixelsuft‮ cbe5e63201
DAC Fix for Win9x bootlogo progressbar (#693) 2022-06-23 05:38:02 +02:00
pixelsuft‮ 77a1cc47cf
Add dac_mask to fix text mode color (#655) 2022-05-17 13:42:53 +02:00
Fabian 7f37fcfccb Fix vga virtual screen size handling (#628) 2022-03-10 21:46:57 +01:00
Fabian dec8fa0b59 Fix svga not rendering pixels at bottom of changed buffer (#628) 2022-03-10 21:46:57 +01:00
Fabian 06df7cc265 Fix 2048 MB memory size 2022-03-10 21:46:57 +01:00
Fabian d1a949d881 Fix consider svga_offset for putImageData 2022-02-24 00:36:58 +01:00
Fabian 4eb1e5035e Optimised putImageData 2022-02-22 00:39:05 +01:00
Fabian 52ccc6a03c Port svga rendering to rust 2022-02-22 00:39:05 +01:00
Fabian 4cc3f8adc7 vga: pass buffer from emulator to frontend, remove tell-buffer, avoid storing layers in state (call update_layers in set_state instead) 2022-02-17 17:38:00 +01:00
Fabian 74dd588b75 vga: dac color index wrap-around 2021-04-10 17:19:40 -05:00
Fabian 69e0a319b6 vga: Mask byte 2021-01-03 03:22:22 -06:00
Fabian 18bbe45814 vga: Implement svga offset 2021-01-03 03:22:22 -06:00
Fabian 497f618cab Merge branch 'wasm' into master 2021-01-03 02:07:20 -06:00
Fabian 659729aed1 Disable xterm.js logging 2020-12-31 19:14:31 -06:00
Fabian ab46037014 Update vga ID to fit new bios 2020-12-31 19:14:29 -06:00
Ernest Wong 3dd4d1d603 Return correct CRTC index value in 3D4 read (VGA)
Fixes #190
2018-02-14 11:12:46 -06:00
Ernest Wong d32d677d0c Revert bpp removal, and update screen events docs
`bpp` was depended by main.js for the runtime info display
2018-01-23 11:36:45 -06:00
Ernest Wong 282207ff53 Display initial graphical/text mode info
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.
2018-01-23 11:36:45 -06:00
Ernest Wong b222aac117 Use screen_width/height. Update size only when needed
The states svga_width/height are left to represent actual svga
registers.

The derived states are not saved and restored.
2018-01-23 11:36:45 -06:00
Ernest Wong 0d1079c274 Remove unnecessary passing of bpp in set-size 2018-01-23 11:36:45 -06:00
Ernest Wong 1a16c1802a Fix typo: restore correct svga bpp 2018-01-23 11:36:45 -06:00
Ernest Wong de51de8843 Update the very last svga row of pixels
Fences and fence posts. It happened again :)
2018-01-23 11:36:45 -06:00
Ernest Wong 10fc566e43 Tidyup spacing 2018-01-23 11:36:45 -06:00
Ernest Wong 36cf671961 Replace min/max with layers for update_buffer
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.
2018-01-23 11:36:45 -06:00
Ernest Wong 68deda6a66 Draw between min and max within layers
This isn't fully functional yet because it doesn't redraw the layer
boundaries and modified layers.
2018-01-23 11:36:45 -06:00
Ernest Wong 1af8a32c8c Clear screen only when needed 2018-01-23 11:36:45 -06:00
Ernest Wong 9b9cb8e4cb Clear layers on reset, and update svga layers
Renames/repurposes/extends the update_vga_panning function to also
update svga layers.
2018-01-23 11:36:45 -06:00
Ernest Wong 0726a99897 Remove unbeneficial vga linked list code
For reference: https://github.com/copy/v86/pull/178#discussion_r161622764
2018-01-23 11:36:45 -06:00
Ernest Wong ab1e42438e Ignore last two bits of vga dac palette data write
Otherwise, the last two bits will cause the 255/63 converted number
to exceed 255 and lead to incorrect / blank color values
2018-01-23 11:36:45 -06:00
Ernest Wong f455aebeff Fix typo: vga reading dac index should translate back 2018-01-23 11:36:45 -06:00
Ernest Wong ba71287216 DAC linked list: Tell screen adapter to update 2018-01-23 11:36:45 -06:00
Ernest Wong 25da2e80ac Tidyup: vga comments, and panning update code 2018-01-23 11:36:45 -06:00
Ernest Wong eaa90a8c89 Tidyup: screen adapter layer update code 2018-01-23 11:36:45 -06:00
Ernest Wong 2397608a2b Fix typo: vga internal palette read condition
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.
2018-01-23 11:36:45 -06:00
Ernest Wong 02b7314858 Implement more vga dac read ports
Attempt to fix wrong colors on some programs. No effect.
2018-01-23 11:36:45 -06:00
Ernest Wong 2b5d3ff692 Update state restore for vga & fix undefined states 2018-01-23 11:36:45 -06:00
Ernest Wong e995d1f5ed Tidyup: update_vga_graphical also handles text 2018-01-23 11:36:45 -06:00
Ernest Wong 81018ce07b Implement screen disable / blanking 2018-01-23 11:36:45 -06:00
Ernest Wong 3c72863846 Fix vga palette partial redraw bug 2018-01-23 11:36:45 -06:00
Ernest Wong 0766da0fa0 Only use vga color linked list for small changes 2018-01-23 11:36:45 -06:00
Ernest Wong 0cc9b3651f Tidyup: use double quotes 2018-01-23 11:36:45 -06:00
Ernest Wong 868834974b Fix vga color use linked list corrupted values
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.
2018-01-23 11:36:45 -06:00
Ernest Wong 465dd6fc94 Tidy up: remove unnecessary comment, add semicolon 2018-01-23 11:36:45 -06:00
Ernest Wong 964691eaa5 Toggle vga 3DA value manually during text mode
Fixes some infinite loops on some programs
2018-01-23 11:36:45 -06:00
Ernest Wong 1abb0895c8 Tidy: comments, unused code, naming convention 2018-01-23 11:36:45 -06:00
Ernest Wong 2a74c9d5af Implement generalized vga pipeline
Big Picture:
https://gist.github.com/ErnWong/7db67164224aaa3be5f6fcc2a6f5dd21

Fixes #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
2018-01-23 11:36:45 -06:00
Ernest Wong c5d178a4d5 Copy the very last byte of modified video memory 2018-01-23 11:36:45 -06:00