Commit graph

4877 commits

Author SHA1 Message Date
Fabian
fd80637976 make debug_dump_code more ergonomic 2025-08-25 15:03:48 -06:00
Fabian
c7a3b8b050 cursed css things to turn table rows into links 2025-08-25 15:03:48 -06:00
Fabian
e27e89877c update filesystem docs 2025-08-25 15:02:43 -06:00
Fabian
318003f117 clean up 2025-08-25 15:02:43 -06:00
Jeff Lindsay
88aff1091f updating the filesystem docs with all the ways it can be used 2025-08-25 15:02:43 -06:00
Jeff Lindsay
1acdbbe785 update implementation based on feedback and added a pre-made websocket proxy 2025-08-25 15:02:43 -06:00
Jeff Lindsay
f020b016f5 add support for custom 9p request handler 2025-08-25 15:02:43 -06:00
SuperMaxusa
137ab1f9ad refactor: extract code into functions 2025-08-23 10:57:57 -06:00
SuperMaxusa
a25e7181d5 forEach -> for, fit to viewport when the virtual keyboard is displayed 2025-08-23 10:57:57 -06:00
SuperMaxusa
519480d4cd add theatre mode 2025-08-23 10:57:57 -06:00
Christian Schnell
92ba111d92 refactored V86.wait_until_vga_screen_contains()
- reduced clutter and made control flow more comprehensible
- moved initial delay of 100ms to expect(), needed for keyboard buffer "cooldown" in between commands
2025-08-23 10:14:32 -06:00
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