Skip to content

AltairZ80: wd179x: Better support for 5.25-inch floppies.#484

Merged
pkoning2 merged 1 commit intoopen-simh:masterfrom
hharte:for-upstream
May 3, 2026
Merged

AltairZ80: wd179x: Better support for 5.25-inch floppies.#484
pkoning2 merged 1 commit intoopen-simh:masterfrom
hharte:for-upstream

Conversation

@hharte
Copy link
Copy Markdown
Contributor

@hharte hharte commented Aug 17, 2025

AltairZ80: wd179x: Better support for 5.25-inch floppies.

Summary

Allow wd179x to support both 360 RPM (8") and 300 RPM (5.25") drives.

Compiled with:

  • VS 2022 17.14.12 - vcxproj
  • MSVC 19.44.35214.0 - CMake
  • MacOS (x64) clang-1700.0.13.5
  • Linux gcc 12.2.0-14

Automated tests:

SIMH running on Windows, Linux (ARM), MacOS (x64):

CompuPro CP/M-80
CompuPro CP/M-86
SCP 86-DOS
MS-DOS 2.11 - Builds MS-DOS 2.11 from source.
CompuPro CP/M-68K v1.3 (68000 and 68010 versions)
CP/M-68K v1.2
Advanced Digital Super-Six CP/M 2.2
Advanced Digital Super-Six CP/M 3.0
DIGITEX CP/M 2.2
DIGITEX CP/M 3.0
DIGITEX OASIS multi-user version 5.6
MultiStar: IBC OASIS multi-user version 5.6
MegaStar: IBC OASIS multi-user version 5.6
CP/M-80 (Altair) ZEXALL Z80 instruction set test.
CP/M 3 (Altair) Banked Memory Test.

FYI, @psco, @deltecent

@markpizz
Copy link
Copy Markdown
Contributor

@psco does this look good to you?

@psco
Copy link
Copy Markdown
Contributor

psco commented Aug 31, 2025

Thank you Howard, this looks fine and can be merged.

@deltecent
Copy link
Copy Markdown
Contributor

@hharte would you please remind me how to do those automated tests? I have PR coming that also changes wd179x.c.

@deltecent
Copy link
Copy Markdown
Contributor

Found it! altairz80-tests.

@pkoning2 pkoning2 merged commit 9e1cb61 into open-simh:master May 3, 2026
14 of 19 checks passed
@pmetzger
Copy link
Copy Markdown

pmetzger commented May 3, 2026

I'm also putting this into ZIMH, along with a bunch of tests. Thanks for the changes!

@pmetzger
Copy link
Copy Markdown

pmetzger commented May 3, 2026

FYI, in your patch, wd179x_set_rpm() checks if (wd179x_info->sel_drive > WD179X_MAX_DRIVES) and then writes to drive[sel_drive & 3].

Since valid drives are 0..WD179X_MAX_DRIVES - 1, the guard should reject sel_drive >= WD179X_MAX_DRIVES. As written,sel_drive == WD179X_MAX_DRIVES is accepted and wrapped to drive 0 by & 3, and larger invalid values are also masked if they pass future changes. The setter should either return on >= WD179X_MAX_DRIVES and index with sel_drive.

I've fixed this in my fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants