From 28108a27b98bad1b266971ff1432be1710e47a2e Mon Sep 17 00:00:00 2001 From: MetalliC <0vetal0@gmail.com> Date: Tue, 2 Jun 2020 13:58:57 +0300 Subject: [PATCH] wd_fdc.cpp honor write protection (nw) --- src/devices/machine/wd_fdc.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/devices/machine/wd_fdc.cpp b/src/devices/machine/wd_fdc.cpp index 94bd7a1cdb7..4111c09d6a9 100644 --- a/src/devices/machine/wd_fdc.cpp +++ b/src/devices/machine/wd_fdc.cpp @@ -784,6 +784,12 @@ void wd_fdc_device_base::write_track_continue() case SETTLE_DONE: LOGSTATE("SETTLE_DONE\n"); + if (floppy && floppy->wpt_r()) { + LOGSTATE("WRITE_PROT\n"); + status |= S_WP; + command_end(); + return; + } set_drq(); sub_state = DATA_LOAD_WAIT; delay_cycles(t_gen, 192); @@ -890,6 +896,12 @@ void wd_fdc_device_base::write_sector_continue() case SETTLE_DONE: LOGSTATE("SETTLE_DONE\n"); + if (floppy && floppy->wpt_r()) { + LOGSTATE("WRITE_PROT\n"); + status |= S_WP; + command_end(); + return; + } sub_state = SCAN_ID; counter = 0; live_start(SEARCH_ADDRESS_MARK_HEADER);