v86/src/config.js
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

71 lines
1.2 KiB
JavaScript

"use strict";
/*
* Compile time configuration, some only relevant for debug mode
*/
/**
* @define {boolean}
* Overridden for production by closure compiler
*/
var DEBUG = true;
/** @const */
var LOG_TO_FILE = false;
/**
* @const
* Enables logging all IO port reads and writes. Very verbose
*/
var LOG_ALL_IO = false;
/**
* @const
* Enables logging of page faults, quite verbose
*/
var LOG_PAGE_FAULTS = false;
var LOG_LEVEL = LOG_ALL & ~LOG_PS2 & ~LOG_PIT & ~LOG_VIRTIO & ~LOG_9P & ~LOG_PIC &
~LOG_DMA & ~LOG_SERIAL & ~LOG_NET & ~LOG_FLOPPY & ~LOG_DISK;
/**
* @const
* Draws entire buffer and visualizes the layers that would be drawn
*/
var DEBUG_SCREEN_LAYERS = DEBUG && false;
/** @const */
var ENABLE_HPET = DEBUG && false;
/** @const */
var ENABLE_ACPI = false;
/**
* @const
* How many cycles the CPU does at a time before running hardware timers
*/
var LOOP_COUNTER = 11001;
/**
* @const
* How often, in milliseconds, to yield to the browser for rendering and
* running events
*/
var TIME_PER_FRAME = 1;
/**
* @const
* How many ticks the TSC does per millisecond
*/
var TSC_RATE = 8 * 1024;
/** @const */
var APIC_TIMER_FREQ = TSC_RATE;
/** @const */
var VMWARE_HYPERVISOR_PORT = true;