From 8bb0621312dded50c85c6ae40804b0631ac1ac03 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 11 Oct 2024 16:21:06 -0300 Subject: [PATCH 1/6] Replace 86F spec with v2.12 --- dev/formats/86f.rst | 168 ++++++++++++++++++++++++++++---------------- 1 file changed, 107 insertions(+), 61 deletions(-) diff --git a/dev/formats/86f.rst b/dev/formats/86f.rst index 024358b..fd0eb72 100644 --- a/dev/formats/86f.rst +++ b/dev/formats/86f.rst @@ -3,69 +3,115 @@ A floppy disk surface image format which stores data in FM- or MFM-encoded transitions. -Preliminary specification for v2.20 ------------------------------------ +Specification for v2.12 +----------------------- -All offsets are in hexadecimal. This specification is subject to change before its final release. +All offsets are in hexadecimal. .. code-block:: none - 00000000: Magic 4 bytes ("86BF") - 00000004: Minor version (0x14) - 00000005: Major version (0x02) - 00000006: Disk flags (16-bit) - Bit 0 Has surface description data (1 = yes, 0 = no) - This data indicates if the corresponding bit on the FM/MFM encoded surface - is a normal bit or a special bit (weak bit or hole, depending on the other bit): - 0 = The corresponding FM/MFM encoded surface bit is normal - 1 = The corresponding FM/MFM encoded surface bit is either a weak bit or a hole: - Corresponding FM/MFM encoded bit is 0: Hole (noise on read, not overwritable) - Corresponding FM/MFM encoded bit is 1: Weak bit (noise on read, overwritable) - Bits 2, 1 Hole (3 = ED + 2000 kbps, 2 = ED, 1 = HD, 0 = DD) - Bit 3 Sides (1 = 2 sides, 0 = 1 side) - Bit 4 Write protect (1 = yes, 0 = no) - Bit 5 Bitcell mode (1 = Extra bitcells count specified after - disk flags, 0 = No extra bitcells) - The maximum number of extra bitcells is 1024 (which - after decoding translates to 64 bytes) - Bit 6 Revolutions (0 = one revolution, 1 track has 16-bit number of revolutions) - 00000008: Offsets of tracks - Note that thick-track (eg. 360k) disks will have (tracks * 2) tracks, with each pair of tracks - being identical to each other. - Each side of each track is stored as its own track, in order (so, track 0 side 0, track 0 side 1, - track 1 side 0, track 1 side 0, etc.). - The table of the offsets of tracks is 2048 bytes long, each track offset is an unigned 32-bit - integer. An offset of 00000000 indicates the track is not present in the file. - As an example, an 86F representing a disk with 80 thin tracks and 2 sides per track, where all - the tracks are present in the file, would have the first 160 offsets filled in, same for a disk - with 40 thick tracks and 2 sides. Same with only 1 side but only the offsets at 0000000, 0000008, - etc. (so every second offset) would be filled in. - - Track offset + 00000000: Track flags (16-bit) - Bits 4, 3 Encoding - 00 = FM - 01 = MFM - 10 = M2FM - 11 = GCR - Bits 2, 1, 0 Bit rate, if encoding is MFM: - 000 = 500 kbps - 001 = 300 kbps - 010 = 250 kbps - 011 = 1000 kbps - 101 = 2000 kbps - If encoding is FM, the bit rate is half that. - The RPM is determined from track length and data rate. - Track offset + 00000002: Total bit cells count (32-bit) - Track offset + 00000006: Bit cell where index hole is (32-bit) - Track offset + 0000000A: FM/MFM/M2FM/GCR-encoded data (track length bytes) - Track offset + 0000000A + track length: Surface description data if present (track length bytes) +00000000: Magic 4 bytes ("86BF") +00000004: Minor version (0C) +00000005: Major version (02) +00000006: Disk flags (16-bit) + Bit 0 Has surface description data (1 = yes, 0 = no) + This data indicates if the corresponding bit on the FM/MFM + encoded surface is a normal bit or a special bit (weak bit + or hole, depending on the other bit): + 0 = The corresponding FM/MFM encoded surface bit is normal + 1 = The corresponding FM/MFM encoded surface bit is either + a weak bit or a hole: + Corresponding FM/MFM encoded bit is 0: + Hole (noise on read, not overwritable) + Corresponding FM/MFM encoded bit is 1: + Weak bit (noise on read, overwritable) + Bits 2, 1 Hole (3 = ED + 2000 kbps, 2 = ED, 1 = HD, 0 = DD) + Bit 3 Sides (1 = 2 sides, 0 = 1 side) + Bit 4 Write protect (1 = yes, 0 = no) + Bits 6, 5 RPM slowdown (3 = 2%, 2 = 1.5%, 1 = 1%, 0 = 0%) + Bit 7 Bitcell mode (1 = Extra bitcells count specified after + disk flags, 0 = No extra bitcells) + The maximum number of extra bitcells is 1024 (which + after decoding translates to 64 bytes) + Bit 8 Disk type (1 = Zoned, 0 = Fixed RPM) + Bits 10, 9 Zone type (3 = Commodore 64 zoned, 2 = Apple zoned, + 1 = Pre-Apple zoned #2, 0 = Pre-Apple zoned #1) + Ignore if disk type is 0 (fixed RPM) + Bit 11 Data and surface bits are stored in reverse byte endianness + Bit 12 If set: + If bits 6, 5 are not 0, they specify % of speedup instead + of slowdown; + If bits 6, 5 are 0, and bit 7 is 1, the extra bitcell count + specifies the entire bitcell count + For converting other stuff to 86F, I recommend to set this bit + and bit 7 and clear bits 6 and 5, + and just specify the entire bitcell count. +00000008: Offsets of tracks + Note that thick-track (eg. 360k) disks will have (tracks * 2) tracks, with each + pair of tracks being identical to each other. + Each side of each track is stored as its own track, in order (so, track 0 side 0, + track 0 side 1, track 1 side 0, track 1 side 0, etc.). - If this is a multi-revolution 86F, then track offset + 00000000 has a 16-bit number of track revolutions, - and the track header + data appears for each revolution, while surface description data, if present, - can appear any number of times, but only once per encoding + bit rate combination. - This needs work to properly make surface data work with flexible multi-revolution support. - - Track lengths: - The total bit cells count is always present. - The track is stored as (bit cells >> 8) bytes, with one extra bit cells if the number of bit cells - is not divisible by 8. +Track offset + 00000000: Track flags (16-bit) + Bits 7, 6, 5 RPM: + 000 = 300 rpm + 001 = 360 rpm + Bits 4, 3 Encoding: + 00 = FM + 01 = MFM + 10 = M2FM + 11 = GCR + Bits 2, 1, 0 Bit rate, if encoding is MFM: + 000 = 500 kbps + 001 = 300 kbps + 010 = 250 kbps + 011 = 1000 kbps + 101 = 2000 kbps + If encoding is FM, the bit rate is half that. +If the bitcell count is present: + Track offset + 00000002: Extra (or total, depending on disk flags) bit cells count (32-bit) + If this specifies extra bit cells rather than total, it is a signed + integer, and when negative, makes the track smaller. + Track offset + 00000006: Bit cell where index hole is (32-bit) + Track offset + 0000000A: FM/MFM/M2FM/GCR-encoded data (track length bytes) + Track offset + 0000000A + track length: Surface description data if present (track length bytes) +Else: + Track offset + 00000002: Bit cell where index hole is (32-bit) + Track offset + 00000006: FM/MFM/M2FM/GCR-encoded data (track length bytes) + Track offset + 00000006 + track length: Surface description data if present (track length bytes) + +Track lengths if the bitcell count is not present or it does not represent total bit cells: + Hole 0 (DD) or 1 (HD): + 2.0% RPM slowdown: 12750 words + 1.5% RPM slowdown: 12687 words + 1.0% RPM slowdown: 12625 words + 0.0% RPM slowdown/speedup: 12500 words + 1.0% RPM speedup : 12376 words + 1.5% RPM speedup : 12315 words + 2.0% RPM speedup : 12254 words + Hole 2 (ED): + 2.0% RPM slowdown: 25250 words + 1.5% RPM slowdown: 25375 words + 1.0% RPM slowdown: 25250 words + 0.0% RPM slowdown/speedup: 25000 words + 1.0% RPM speedup : 24752 words + 1.5% RPM speedup : 24630 words + 2.0% RPM speedup : 24509 words + Hole 3 (ED + 2000 kbps): + 2.0% RPM slowdown: 51000 words + 1.5% RPM slowdown: 50750 words + 1.0% RPM slowdown: 50500 words + 0.0% RPM slowdown/speedup: 50000 words + 1.0% RPM speedup : 49504 words + 1.5% RPM speedup : 49261 words + 2.0% RPM speedup : 49019 words + 1 word = 2 bytes (so 16 bits) + If extra bit cells count is present and it indicates extra bit cells count: + Track length = (Track length << 4) + Extra bitcells count + If (Track length & 15) + Track length + (Track length >> 4) + 1 + Else + Track length + (Track length >> 4) + If extra bit cells count is present and it indicates total bit cells count, + then the total bit cells count become the track length, padded upwards to the + nearest word in the file. From 6385ec6a44495ab97c93fc6de774721cce16d2ec Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sun, 15 Dec 2024 19:28:33 -0300 Subject: [PATCH 2/6] Fix inaccurate residfp credit --- settings/sound.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/sound.rst b/settings/sound.rst index b8cee23..d4b9ce2 100644 --- a/settings/sound.rst +++ b/settings/sound.rst @@ -50,7 +50,7 @@ Innovation SSI-2001 Emulate the **Innovation SSI-2001** ISA sound card, based on the MOS Technology 6581 chip (commonly known as the Commodore SID) and supported by a limited number of games. -SID emulation is provided by the `reSID `_ library. +SID emulation is provided by the reSIDfp component of the `libsidplayfp `_ library. CMS / Game Blaster ------------------ From a1027f899eef25a4ba8ee6cdf19e34e599357f89 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sun, 30 Mar 2025 18:47:07 -0300 Subject: [PATCH 3/6] Add note about 3-button mouse release --- settings/input.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/settings/input.rst b/settings/input.rst index 2fcd136..d850568 100644 --- a/settings/input.rst +++ b/settings/input.rst @@ -11,11 +11,15 @@ Mouse Emulate a pointing device. The following mouse types are supported: * **Bus mouse:** ISA expansion card with a mouse interface. The I/O port and IRQ used by the card are configurable. -* **Serial mouse:** connected to the serial port of your choosing. The selected serial port must be enabled on the :ref:`Ports tab `. +* **Serial mouse:** connected to the serial port of your choosing. * **PS/2 mouse:** connected to the PS/2 port. Only available on machines with a PS/2 mouse port. The *Configure* button opens a new window with settings specific to the selected mouse type, such as the number of buttons, or the serial port for a serial mouse. +.. note:: + * Serial pointing devices require the configured serial port to be enabled on the :ref:`Ports page `. + * The middle button cannot be used to release mouse capture when emulating a mouse with 3 or more buttons. + Joystick -------- From 8a2580eb8529eb9b274b5c315a62ea20fd7fadbc Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sun, 13 Apr 2025 10:01:37 -0300 Subject: [PATCH 4/6] Backport environment updates from v4.3 --- .readthedocs.yaml | 10 +++++++++- conf.py | 4 ++-- requirements.txt | 5 +++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index a6bc2c2..aec4fdc 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,7 +1,15 @@ version: 2 -formats: all +build: + os: "ubuntu-24.04" + tools: + python: "3.13" python: install: - requirements: requirements.txt + +sphinx: + configuration: conf.py + +formats: all diff --git a/conf.py b/conf.py index f628c57..865927a 100644 --- a/conf.py +++ b/conf.py @@ -3,7 +3,7 @@ # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html -import sphinx_rtd_theme +import sphinx_rtd_theme, time # -- Path setup -------------------------------------------------------------- @@ -19,7 +19,7 @@ import sphinx_rtd_theme # -- Project information ----------------------------------------------------- project = '86Box' -copyright = '2020-2022, 86Box Project' +copyright = f'2020-{time.strftime("%Y")}, 86Box Project' author = '86Box Project' diff --git a/requirements.txt b/requirements.txt index e75e102..d0d58e7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ -Sphinx==4.3.0 -sphinx-rtd-theme==1.0.0 +Sphinx==7.4.7 +sphinx-rtd-theme==3.0.2 +linuxdoc==20240924 From ee0ff496e26285b35b8ede86d704f2e4acf02da5 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sun, 13 Apr 2025 10:57:47 -0300 Subject: [PATCH 5/6] Backport Sphinx 8 upgrade --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d0d58e7..47ed188 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -Sphinx==7.4.7 +Sphinx==8.2.3 sphinx-rtd-theme==3.0.2 linuxdoc==20240924 From d6ff6959f71c7658995b9239d59db369baa9e942 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 16 Apr 2025 17:27:21 -0300 Subject: [PATCH 6/6] Status bar priority stuff from later versions --- usage/statusbar.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usage/statusbar.rst b/usage/statusbar.rst index ffb9bc7..cc567bf 100644 --- a/usage/statusbar.rst +++ b/usage/statusbar.rst @@ -96,4 +96,4 @@ POST card The leftmost hexadecimal value is the most recent POST code reported, while the rightmost value is the second most recent code, like on a real dual-display POST card. A value of ``--`` indicates that no POST code has been reported yet. -.. note:: The additional information area can only be used by one component at a time. If both the ISABugger and the POST card are enabled simultaneously, the POST card takes over whenever a POST code is reported, and the ISABugger takes over whenever one of its registers is written to. The *Monitor in sleep mode* message is high-priority and will override all other components. +.. note:: The additional information area can only be used by one component at a time. The monitor sleep mode message takes priority over the ISABugger and POST card, which have the same priority (taking over whenever they're written to).