- reduced clutter and made control flow more comprehensible
- moved initial delay of 100ms to expect(), needed for keyboard buffer "cooldown" in between commands
- changed return value of V86.wait_until_vga_screen_contains() to boolean with true:success and false:timeout
- removed "throw" and "finally" statements in V86.wait_until_vga_screen_contains()
- removed "finally" statements in exec_test() to simplify cleanup code
- removed "export" statements (forgotten leftovers from a silly experiment)
- simplified parsing of options.timeout_msec in V86.wait_until_vga_screen_contains()
- changed line-matching function to string.startsWith()
- switched from Element.innerHTML to Element.textContent in html assignments
- relaxed rules for handling of command in expected[] in expect()
- removed unused argument "fdc" from FloppyDrive constructor
- renamed variable "tm_end" to "end"
Moved tests using optional image files
/images/freedos-fds/freedos.boot.disk.160K.img
/images/freedos-fds/freedos.boot.disk.180K.img
/images/freedos-fds/freedos.boot.disk.320K.img
/images/freedos-fds/freedos.boot.disk.360K.img
/images/freedos-fds/freedos.boot.disk.640K.img
/images/freedos-fds/freedos.boot.disk.1200K.img
from tests/api/floppy.js to tests/full/run.js.
Dropped redundant 720K and 1440K FreeDOS boot floppies, these formats are already covered in tests/full/run.js.
If the command string passed to expect() is non-empty it is also used as the first expected response line, but it must be matched against the screen line using .endsWith() because any text preceding the command (usually the shell prompt) is unknown. All other response lines must now match exactly their respective screen lines.
- added log message for missing FreeDOS boot image files
- simplified array construction using spread (...) syntax
- removed deprecated comment about linux test failure
Async methods V86.set_fda/set_fdb() were not awaiting URL-based file downloads.
This fixed a bug in the state snapshot tests, removed now uneeded call to pause(1000) after loading the image URL.
- added floppy format test to MS-DOS and Linux tests
- added RegExp support to expect() and support to capture its command output
- improved emulator setup and teardown
- removed most of the calls to pause()
- activated FreeDOS boot floppy tests, but conditional (they depend on image file existence on the test host)
- improved documentation of expect() function
- removed unused test with TinyCore 4.7.7, using TinyCore 11 instead
- added fda state snapshot test by using delayed keyboard input for MS-DOS 6.22 (10ms inter-character delay)
- added fda floppy test using Core 4.7.7 Linux
Reverted to the original method of expanding any image to its closest fitting geometry if its exact size cannot be matched. This now includes images with a size smaller or equal to 512 bytes which are expanded to the smallest known geometry of 160K.
This is the most robust method, loading an image will now only fail if the given image is larger than any known geometry.
- added floppy command code to debug output of unimplemented command
- replaced call to .forEach() with regular for() loop
- removed unused members FloppyDrive.fdc and FloppyDrive.cpu
- auto-expand images to minimum floppy disk size of 160 kB (5"1/4, CHS=40/1/8)
- images larger than the minimum size must match one of the predefined disk geometries
Changed web UI HTML element type of empty floppy size fields from INPUT to SELECT.
The INPUT element allowed any value between 160 and 3840 (KB), even though only a strict subset is actually supported.
Using the SELECT element we can present a meaningful set of valid floppy disk sizes in a human readable format. This prevents faulty user input and is self-documenting.
Changes in index.html and debug.html:
- added fdb image selector
- added empty disk options for fda and fdb (constrained to 160..3840 KB, default: 1440 KB)
- added insert/eject button for fdb
Revised floppy controller API in starter.js (and main.js):
- V86.set_fda(file)
- V86.set_fdb(file) // new
- V86.eject_fda()
- V86.eject_fdb() // new
- V86.get_disk_fda() // new, return disk buffer or null if drive is empty
- V86.get_disk_fdb() // new
- changed to strict disk format detection with the exception of images smaller than 512 bytes
- images smaller than 512 are extended with zeros at the end to 512 bytes
- also reworked length calculation in FloppyController.start_read_write()
Changes:
- rewrote floppy controller to make it more compatible with the Intel 82078
- now supports optional second drive fdb (enabled by default)
- now supports write-protected media and configurable drive types
- added configuration object to FloppyController constructor
- added a few registers and rewrote their read/write handlers
- added explicit command phases and reimplemented all floppy commands
- added controller runtime state as needed by registers and commands
- split off class FloppyDrive from FloppyController to support mulitple drives
- rewrote drive and disk format detection
- get/set_state() now includes the drive's image buffer (hopefully got that right)
- improved code readability by using named instead of literal constants, added comments where needed
- improved log output readability
The Intel 82078 (44-Pin) manual and fdc.c from qemu were used for reference material.
Known issues:
- hwinfo under linux reports read errors when no floppy disk is inserted into a drive