Releases: jeffpar/pcjs.v1
Rollup of minor changes
This release rolls up all the changes made since v1.18.1, including:
- Some support for the IBM VGA (still a work-in-progress)
- Some new Debugger commands (stack trace, INT3 breakpoint control)
- Multi-monitor support (demo)
Some bugs were squashed as well, mostly in the Video component:
- Fixed 9th dot replication in 8-dot characters
- Fixed EGA scrolling for modes 0x0D and 0x0E
- Fixed Read Mode 1 (Color Compare)
- Added support for horizontal pixel panning
More generally:
- Improved Full-screen support (for the browsers that support it)
Regarding the new Debugger commands, use "k" to display a stack trace, and use "m int on;m halt on" to halt execution on embedded INT3 opcodes ("g" will continue).
Quick fix for CGA configurations
In my efforts to clean up Video component initialization, I inadvertently broke video configs that don't specify a model. Those configs rely instead on the Chipset "monitor type" switch settings to determine whether the video card should initialize as an MDA or a CGA. You can imagine such machines as having both cards installed, and the switches determine which card is attached to your primary (only) display.
Going forward, video configs should always specify a model (one of: "mda", "cga", "ega" or "vga"), especially in "dual display" configurations. It's still OK to rely on switch settings -- and you can still toggle the "monitor type" switches, reset the machine, and change the video config on the fly -- but only when using exactly one of the older cards (ie, MDA or CGA).
Enabled 80386 support
This is the first release that includes 80386 support in the compiled PCjs code.
Don't get too excited though. 80386 support is dormant until enabled by a machine configuration that specifies model="80386" in the <cpu> component; to be usable, the machine should also specify buswidth="32" in the <computer> component.
Because PCjs started as an IBM PC simulation, and because I have no interest (yet) in emulating PS/2 machines, that rules out IBM's first 80386-based machine: the PS/2 Model 80.
So for now, the first and perhaps only 80386-based machine that PCjs will support is the Compaq DeskPro 386. I've obtained DeskPro 386-16 and 386-25 motherboards, dumped their ROMs, and placed JSON-encoded copies of them in the /devices/pc/bios/compaq folder. I also have ROMs from early Compaq EGA and Compaq VGA boards, but for preliminary VGA testing, I'm starting with an IBM VGA ROM -- unless I run into unexpected hardware dependencies, in which case I'll switch to the earliest Compaq VGA ROM I have, dated 10/27/87.
PCjs DeskPro 386 machine configurations have successfully booted 80386-enabled versions of DOS (eg, FreeDOS), and have passed some very minimal 32-bit instruction and paging tests, but more work and testing remains.
PCjs v1.18.0 also includes some 80286 fixes (eg, task-switching, TSS updates, and 8042 port delays), which make it possible to boot an old 1986 version of Unix from Microport.
Compaq DeskPro 386 ROM BIOS Boots
This is the first release that can successfully boot an 80386-based machine into real-mode using a Compaq DeskPro 386 ROM BIOS. It doesn't boot flawlessly yet (I still need to improve A20 compatibility and fix hard disk controller support), but this is an important milestone on the way to full 80386 support.
More details are available here.
Improved PC-AT Keyboard Handling
Some apps (eg, BASICA) hook the keyboard hardware interrupt vector (0x09), read the scan code from port 0x60, and then pass the interrupt on to the next handler in the chain (eg, the ROM). Each handler will also want to read the scan code from port 0x60. Unfortunately, when a series of keys is typed rapidly, multiple scan codes may be queued up in the keyboard's internal scan code buffer, and as a result, each port 0x60 read could return a different scan code, instead of the one that originally triggered the interrupt.
So, keyboard scan codes are now "throttled"; i.e., the keyboard component will not deliver a subsequent scan code until the 8042 keyboard controller has been disabled and re-enabled (or reset). This is how the IBM PC-AT ROMs behave.
Now, it's possible that some applications will attempt to service certain keyboard interrupts entirely on their own, without dispatching them to the ROM. If such applications don't disable/re-enable the 8042 controller in the same manner, then a different "throttling" mechanism may be required.
This release also includes a fix in the SerialPort component to work around a problem with serial mouse interrupts being delivered too fast and overrunning the client stack. For example, the Window v1.01 serial mouse driver re-enables serial interrupts long before it has finished processing the current interrupt, relying on the fact that a properly configured serial mouse (running at 1200 baud) won't generate another interrupt for many milliseconds.
However, your host mouse could have a much higher sample rate, and unfortunately, the Mouse and SerialPort components were turning mouse events into serial port interrupts as fast as they arrived, without regard for the emulated serial port's programmed baud rate. And even if you had a "slow" mouse, this bug could still be reproduced by enabling mouse and serial port messages in the PCjs Debugger, slowing the virtual machine down to the point where interrupts could still overrun the machine's stack.
Honoring the serial port's baud rate (ie, throttling serial port interrupts based on the programmed baud rate) is still on the TODO list. For now, the work-around is a hard-coded delay in the SerialPort's setIRR() call, which defers recognition of the next serial port interrupt long enough for the current interrupt to finish -- at least for the original Windows serial mouse driver. More testing will be required for other mouse drivers.
Improved Flag Handling for Future 32-bit Support
PCjs CPU flag management for arithmetic and logical operations was revamped in advance of 32-bit CPU support. No change in functionality, and hopefully no regressions.
This was necessitated by JavaScript's truncation of all bit-wise expressions to 32 bits, making it a "bit" more challenging (and slightly less efficient) to detect carries and overflows from 32-bit CPU calculations.
Improved AudioContext Support
A recent version of Chrome (perhaps v41) dropped support for some deprecated AudioContext interfaces, requiring some changes to the PCjs chipset component.
It would be nice if the Chrome Developer Tools could give developers a heads-up on these kinds of changes. I appreciate the need to eventually remove deprecated and/or obsolete interfaces, but there's got to be a better way than simply breaking web pages. Developers will eventually notice and fix the problems, but in the meantime, users have no idea what's going on.
Minor AutoStart, DiskDump and Control Panel tweaks
This is a very minor release that attempts to resolve some autostart issues (machines with autostart='true' were not always automatically starting).
There was also a bug in the DiskDump module that failed to properly return the disk image for the contents of a folder or specified set of files.
And finally, there were a few more tweaks to the new Control Panel, including support for vertical text labels.
Full Screen and Pointer Locking Support
Machine configurations can now include controls that enable Full Screen and Pointer Locking modes.
Machines can also specify auto-locking, so that when you click on the machine's display, the mouse pointer is automatically locked. Both of these modes are cancelled with Esc key, so for convenience, PCjs temporarily remaps your keyboard's Backquote key to the machine's Esc key, so that you have a way of typing that key without canceling the mode.
Not all browsers support these modes. Chrome is probably your best choice. Firefox is a good second choice, only because its JavaScript performance tends to be much slower than Chrome's. Firefox may be focusing too much on asm.js performance and not enough on conventional JavaScript.
Safari doesn't support Pointer Locking mode, but it does support Full Screen mode. Unfortunately, Safari has deliberately crippled Full Screen mode by disabling all alphanumeric keyboard input for "security reasons." Whatever Apple's security concerns are, Chrome and Firefox don't share them. This is unfortunate, because Safari's JavaScript performance is otherwise excellent -- on par with Chrome.
This release also includes a smattering of performance improvements, as well as groundwork for future control panels and processors -- specifically, the 80386; however, full support for that processor is still a long way off.
The New Year's Release
Aside from updating the year in (hopefully) all the copyright messages, this release also includes:
- BACKTRACK support for port-based disk I/O (eg, the ATC disk controller)
- An operational command-line (Node) version of PCjs (again)
The command-line version of PCjs seems destined to break at least once every month or two, because I simply don't use/test it enough. I still have high hopes for the command-line version, including using it to perform a series of emulation unit tests, but there's still too much feature-work to do.