Support for encoding 8-bit text into Unicode strings exists in ScreenAdapter but is missing in DummyScreenAdapter.
- Moved and rewrote the CP437-related code in src/browser/screen.js to src/lib.js.
- Added support for codepages other than CP437.
- Made the active codepage configurable in the V86 constructor in options.screen.encoding.
src/lib.js
- Added public function get_charmap(encoding)
Returns the charmap of type Array<number> for given encoding string.
Supported encodings: "cp437", "cp858" and "ascii", more can be added easily from
https://github.com/chschnell/v86-i18n/blob/main/codepage-tables/codepage_tables.js
- Added public function to_unicode(text_8bit, charmap)
Returns the Unicode string representation of given 8-bit text and charmap.
Supported types for text_8bit are Array<number>, Uint8Array and number.
src/browser/dummy_screen.js
- Added options argument to DummyScreenAdapter constructor (same as for ScreenAdapter).
- Uses options.encoding argument for user-defined encoding, defaults to "cp437".
- DummyScreenAdapter.get_text_row() now uses to_unicode() for string encoding.
src/browser/screen.js
- Uses options.encoding argument for user-defined encoding, defaults to "cp437".
- DummyScreenAdapter.get_text_row() now uses to_unicode() for string encoding.
- Removed CP437 table, no longer needed.
src/browser/starter.js
- Added options argument to DummyScreenAdapter constructor call.
- Removed unneeded assignment to settings.screen_options, this gets overwritten
a couple of dozen lines below.
- handle mmap access and port io directly in rust
- call handle_irqs after port/memory writes, rather than from the
interrupt hw directly; this makes it more obvious that handle_irqs is
dangerous as it can change control flow
state images produced by this version are not backwards-compatible (older stage images will still be working)