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
* Revert "Add VGA graphical text mode"
This reverts commit f92e6b4b55.
* started 2nd iteration of graphical text mode
* fixed eslint complaints
* include changes to main.js and cpu.js from f92e6b4, fix eslint error
* added new methods in ScreenAdapter to DummyScreenAdapter
* include changes to starter.js from f92e6b4
* changed text attribute BLINKING to FLAGS, introduced flags for BLINKING and FONT_PAGE_A
* added support for cursor and blinking, made ScreenAdapter.FLAGS_* visible for VGAScreen
* Variuos improvements and fixes.
- improved implementation of the three display modes in ScreenAdapter
- improved animation frame control (replaced "ScreenAdapter.stopped" with "cancelAnimationFrame()")
- added method ScreenAdapter.grab_text_content() with documentation
- fixed double-width (16px) font
- improved detecting font plane 2 write access in VGAScreen (still work in progress)
* fixed issues detected by eslint
* fixed classical text mode
* optimization: do not copy buffer to canvas when it's unmodified
* invalidate all text rows when entering graphical text mode
* Made sure that complete_redraw() is called whenever the state that put_char() depends on is modified.
Method VGAScreen.put_char() depends on:
1. screen-wide BLINK_ENABLE bit
2. screen-wide PAGE_AB_ENABLE bit
3. VGAScreen.vga256_palette[]
4. VGAScreen.dac_mask
5. VGAScreen.dac_map
For 1, 3 and 5 this was already the case.
Added call to VGAScreen.complete_redraw() when PAGE_AB_ENABLE is changed.
Added call to VGAScreen.complete_redraw() when VGAScreen.dac_map is changed.
Added logic to mask out most significant foreground color bit if screen-wide PAGE_AB_ENABLE is true.
* removed leftover comment
* added new VGAScreen state variable font_page_ab_enabled to state[]
* render internal font less often but more aggressively
* fixed bug in ScreenAdapter.set_font_bitmap()
* refactored ScreenAdapter
- moved declarations of constants, member variables and methods into separate groups
- moved scattered initialization code into init() method
- removed redundant members and initialization code
- refactored timer() method to simplify and clarify code
- made control flow depend on three-state variable "mode" only
* fixed bug in restoring state of graphical text: font_page was missing
* restored accidentally lost cleanup code from commit f92e6b4
* narrowed scope of some variables
* removed obsolete compatibility attributes from graphic_context
* removed redundant initialization call to ScreenAdapter.set_mode()
* allow overriding private member charmap[] to support external codepage mappings
Introduce support for externally defined codepage mappings wherever charmap[] is used.
- added member charmap_default[] with former content of charmap[]
- made charmap[] initially point to charmap_default[]
- added method set_charmap() to override or fall back to charmap_default[]
* merged grab_text_content() into get_text_row()/get_text_screen()
* removed comment as suggested
* replaced boolean options.disable_autoscale with number options.scale
options.scale defines the initial value for ScreenAdapter.scale_x and ScreenAdapter.scale_y.
If undefined, options.scale defaults to 1.
If options.scale is set to 0, 2x-upscale, scale_x, scale_y and HiDPI-adaption (window.devicePixelRatio) are all disabled in all three modes, they are in the responsibilty of host applications that define options.scale to be 0.
* changed render_font_bitmap() to return void, reduced reallocation of font_bitmap[]
* added guard to ensure that set_font_bitmap() is only called in text mode
* changed text rendering method to glyph-blitting using canvas.drawImage()
- replaced pixel-drawing with glyph-blitting
- removed graphical_text_buffer
- added 3 OffscreenCanvas objects for font bitmap, screen canvas and row helper
- left state of canvas context ScreenAdapter.graphic_context untouched
* improved cursor rendering
* improved foreground color handling
* minor changes
* improved rendering of invisible glyphs
An invisible glyph could be an ASCII Space (0x20) or Null (0x0) character, or any other empty glyph loaded into the VGA's font memory.
Invisible glyphs (which are not rare) are currently drawn to the canvas exactly like regular glyphs, this patch handles that more efficiently.
- added array with per-glyph visibility attribute
- added invisible glyph detection in render_font_bitmap()
- instead of drawing invisible glyphs in render_changed_rows(), now erase whole row buffer once per row and just skip invisible glyphs
- removed one nested loop from render_font_bitmap()
Characters hidden on screem caused by their blink attribute (rare) are also treated as invisible.
* improved vga bit handling readabilty
- create query parameters for memory size, mute, acpi, boot order and networking proxy
- allow overwriting memory size, boot and acpi order for profiles
- stop using bus for internal calls
- replace emulator.automatically with emulator.wait_until_vga_screen_contains
- remove stats
- remove graphical_mode_is_linear (unused)
Emulate a networking stack, intercept HTTP requests, serve
them with fetch(). Enable by setting networking_proxy=fetch
Somewhat fixes#198
Just enough networking for http to work for package managers and
net-boot. The networking stack just reflects the macaddress of
packets it receives, so shouldnt be bothered by mac address
changes. Services include:
- ARP replies by establishing the gateways IP
- DHCP server sending gateway, dns, and client-ip
- Gateway: 192.168.86.1
- Client: 192.168.86.100
- Netmask: 255.255.255.0
- UDP DNS server, all addresses resolve to: 192.168.87.1
- NTP Server, giving out the current time from Date()
- Replies to ICMP pings to any IP address
- UDP echo server on port 8
Limitations:
- Request are limited by CORS rules, but CORS-proxies can work around
this.
- Redirects are handled transparently by fetch. The upside is sites that
force an http->https upgrade appear to the VM to work over http.
Future Work:
- Allow HTTP requests from browser to be served by VM.
- HTTPS support (maybe with help of a rust based TLS stack in WASM)
- Support for POSTing binary data
* Run devices tests in CI
* Allow multiple Ne2k adapters
Co-authored-by: Fabian <copy@copy.sh>