Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Auto-Resume and Auto-Type Improvements

Compare
Choose a tag to compare
@jeffpar jeffpar released this 27 Jun 18:47
· 1903 commits to master since this release

Obviously, I don't do enough regression testing. I need to have a talk with all my clones.

The Computer interface getMachineParm() is great for obtaining machine properties from multiple sources (eg, the XML file, the web page, or the URL), but in the case of the state property, any state file setting was only supposed to override the machine's resume setting if state was set expressly via URL, not when it was set as the normal part of a machine's configuration. I've fixed that now, so you can once again stop and resume a DONKEY.BAS game to your heart's content.

While we're on the subject of "resume": I finally tracked down and fixed an annoying resume bug in the original MDA and CGA configurations. If any of those configurations set the resume property AND you reset the machine, the cursor's "blink state" state might not be properly initialized, so you would no longer see a cursor. Another video regression involved the failure of MDA/CGA machines to display their screen immediately after a restore; this was due to some EGA/VGA changes that were probably made a year or more ago, now fixed.

Also, if you're impatient, like I sometimes am, and you switched away from a page before any machines on that page finished loading, you could get spurious errors. Well, maybe spurious is the wrong word: the errors were legitimate, but they were basically all "don't care." And these errors could occur both on the "shutdown" of the machine as well as the "startup", if the machine's resume property was set.

I've tried to eliminate most of those "don't care" notices by 1) adding an "unloading" flag that indicates when a machine is unloading and suppressing notices when that flag is set; 2) suppressing notices whenever the resume property is AUTO (1); and 3) suppressing notices whenever an XmlHttpRequest failed due to an unknown error (usually an indication that the error is simply the result of the user cancelling the page load, not because of any problem with the server).

To properly set the "unloading" flag on iOS devices, I also had to change my 'exit' page handler to rely on the browser's "pagehide" event rather than the traditional "unload" or "beforeunload" events. In fact, the PCjs resume feature wasn't working on iOS devices AT ALL until I made this change. This used to work, but as Apple Documentation explains, "unload" has been deprecated in favor of "pagehide". Now, of course, deprecated doesn't mean unsupported (yet), but perhaps that documentation is out-of-date and Apple finally decided to pull some plug.

In other news, autoType support has been improved: autoType strings no longer need to use double-backslashes to encode \r, \n, \t, or \x sequences, and some new replacement variables ($date and $time) can now be used to auto-type your way through the traditional DOS date and time prompts.

There have also been a few site-related changes, like the addition of a default background color for all machines, and changing most machine XML files on the site to specify "default". Since most of a machine's appearance is its "screen", this mainly affects a machine's border and control panel region (if any).