Commit graph

4766 commits

Author SHA1 Message Date
Christian Schnell
47fb4e1dd2 final cleanup and alignments with the V86 codebase
- 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"
2025-08-23 10:14:32 -06:00
Christian Schnell
e16ce249fe replaced use of RegExp.escape() with own function
RegExp.escape() is available since the May 2025 Baseline which is not yet supported at github CI, replaced with a helper function.
2025-08-23 10:14:32 -06:00
Christian Schnell
00203987f4 moved text matching code from expect() to V86.wait_until_vga_screen_contains()
All changes to V86.wait_until_vga_screen_contains() are backward compatible.
2025-08-23 10:14:32 -06:00
Christian Schnell
b91afaa821 moved FreeDOS boot floppy tests to tests/full/run.js
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.
2025-08-23 10:14:32 -06:00
Christian Schnell
26ae4dc019 removed Space Invaders boot test, already covered in tests/full/run.js 2025-08-23 10:14:32 -06:00
Christian Schnell
200219335b deactivated Space Invaders test until image file is available on github
Maybe I'm assuming the wrong file name "images/asm-space-invaders.img"?
2025-08-23 10:14:32 -06:00
Christian Schnell
e8235c5f3e added custom floppy size test using Space Invaders (~2K) 2025-08-23 10:14:32 -06:00
Christian Schnell
d7e9c64975 minor optimization 2025-08-23 10:14:32 -06:00
Christian Schnell
51998355ed reduced usage of string.endsWith() in expect() to minimum
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.
2025-08-23 10:14:32 -06:00
Christian Schnell
ed3f083d50 simplified floppy size label formatting for web UI 2025-08-23 10:14:32 -06:00
Christian Schnell
0a3a406f69 fixed minor issues
- added log message for missing FreeDOS boot image files
- simplified array construction using spread (...) syntax
- removed deprecated comment about linux test failure
2025-08-23 10:14:32 -06:00
Christian Schnell
f2d8ee7334 attempt to fix the linux-test bug at github CI 2025-08-23 10:14:32 -06:00
Christian Schnell
30cd26ca58 fixed missing awaits within V86.set_fda() and V86.set_fdb()
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.
2025-08-23 10:14:32 -06:00
Christian Schnell
4a22c44bce fixed async calls to V86.set_fda() and V86.set_fdb() 2025-08-23 10:14:32 -06:00
Christian Schnell
8b13c70470 disabled Linux format command test 2025-08-23 10:14:32 -06:00
Christian Schnell
0541e3bc9b added pause command to Linux format test 2025-08-23 10:14:32 -06:00
Christian Schnell
57fb799328 added two floppy format tests, general improvements and cleanup
- 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
2025-08-23 10:14:32 -06:00
Christian Schnell
b909cfe802 added tests for 8 FreeDOS boot disks of different sizes 2025-08-23 10:14:32 -06:00
Christian Schnell
8f536c090c added support for 3"1/2 640 kB floppy images (C/H/S=80/2/8) 2025-08-23 10:14:32 -06:00
Christian Schnell
fc1b204d50 moved Linux test from Core-4.7.7.iso to TinyCore-11.0.iso 2025-08-23 10:14:32 -06:00
Christian Schnell
6f891de57d added two more floppy tests
- 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
2025-08-23 10:14:32 -06:00
Christian Schnell
5d94c6bf7b added two floppy drive tests
- renamed floppy-insert-eject.js to floppy.js
- merged and reactivated test from floppy-insert-eject.js
- added fdb test using hda guest MSDOS-6.22
2025-08-23 10:14:32 -06:00
Christian Schnell
be3d6c169b further relaxed disk geometry detection from image size
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.
2025-08-23 10:14:32 -06:00
Christian Schnell
46629ecfd2 three minor fixes
- 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
2025-08-23 10:14:32 -06:00
Christian Schnell
415a65a5c6 renamed img_buffer to buffer, removed fdc_config.img_buffer 2025-08-23 10:14:32 -06:00
Christian Schnell
b1c1b8bc76 raised minimum floppy image size from 512 to 163840 bytes (160K)
- 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
2025-08-23 10:14:32 -06:00
Christian Schnell
23c25c0131 fixed license text 2025-08-23 10:14:32 -06:00
Christian Schnell
8b01980b9b replaced empty floppy size range field with dropdown list
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.
2025-08-23 10:14:32 -06:00
Christian Schnell
196001e956 integrated new floppy features into v86 web ui
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
2025-08-23 10:14:32 -06:00
Christian Schnell
90ccbcd9ee resolved qemu license issue 2025-08-23 10:14:32 -06:00
Christian Schnell
3cf1e89556 Changed default fdb drive type from 2.88M to 1.44M (3"1/2). 2025-08-23 10:14:32 -06:00
Christian Schnell
5332e7ba6b changed disk format detection
- 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()
2025-08-23 10:14:32 -06:00
Christian Schnell
c22a8f1d4c rewrote class FloppyController
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
2025-08-23 10:14:32 -06:00
SuperMaxusa
2482a9957a fix keyboard input in mobile browsers
fix onclick handler, phone_keyboard follows text mode cursor
always show phone keyboard
2025-08-19 16:29:56 -06:00
Oskari Alaranta
51bf5a63dc fix PIT single byte access order 2025-07-22 19:34:16 +07:00
Fabian
6c5fe0f40c replace some transmutes with from_bits/to_bits/from_le_bytes/to_le_bytes 2025-07-02 16:30:28 +07:00
Fabian
45d190548a use unadjustedMovement for requestPointerLock 2025-07-02 15:01:19 +07:00
Fabian
ef25dbf95f add typescript definitions 2025-07-02 15:01:19 +07:00
Fabian
066d5efd23 (breaking change) rename set_{mouse,keyboard}_status to set_{mouse,keyboard}_enabled 2025-07-02 15:01:19 +07:00
Fabian
27e6994abb refactor old debug code, make sure there's no require calls to capstone/wabt (#631) 2025-07-02 15:01:19 +07:00
Fabian
ccdc7b6b14 haiku beta4 only boots reliably with acpi 2025-07-02 15:01:19 +07:00
Fabian
be8530cf05 mention ISO 9660 generator 2025-07-02 15:01:19 +07:00
Fabian
9af729f56c simplify mouse speed code: don't modify deltas 2025-07-02 15:01:19 +07:00
Fabian
5831d23fe3 add missing LOG_VGA 2025-07-02 15:01:19 +07:00
Fabian
fe3757fe5b smsw: mask (triggers assertion otherwise) 2025-07-02 15:01:19 +07:00
Fabian
1ab04fe419 SMC: log written value 2025-07-02 15:01:19 +07:00
Fabian
80917ab8b9 rewrite some assertions to speed up port io in debug mode 2025-07-02 15:01:19 +07:00
Fabian
8daade0267 minor: remove export 2025-07-02 15:01:19 +07:00
Fabian
0eec29652b hide change cdrom button if no cdrom 2025-06-12 19:40:09 +07:00
Fabian
0d627a22f3 update reactos (#1321)
thanks @SuperMaxusa
2025-06-12 19:40:09 +07:00