From 5fb832ed245de1d5739aea4b0d6ee40115cc8d5d Mon Sep 17 00:00:00 2001 From: Sergey Svishchev Date: Fri, 25 Nov 2016 23:28:47 +0300 Subject: [PATCH 1/3] imagedev/floppy: add 'dskchg_writable' property (for Sony Microfloppy drives) --- src/devices/imagedev/floppy.cpp | 12 ++++++++++-- src/devices/imagedev/floppy.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp index 6ed29cda026..241483c7696 100644 --- a/src/devices/imagedev/floppy.cpp +++ b/src/devices/imagedev/floppy.cpp @@ -180,6 +180,7 @@ floppy_image_device::floppy_image_device(const machine_config &mconfig, device_t sides(0), form_factor(0), motor_always_on(false), + dskchg_writable(false), dir(0), stp(0), wtg(0), mon(0), ss(0), idx(0), wpt(0), rdy(0), dskchg(0), ready(false), rpm(0), @@ -314,6 +315,7 @@ void floppy_image_device::device_start() { rpm = 0; motor_always_on = false; + dskchg_writable = false; idx = 0; @@ -450,6 +452,9 @@ image_init_result floppy_image_device::call_load() } else if(!mon) ready_counter = 2; + if (dskchg_writable) + dskchg = 1; + return image_init_result::PASS; } @@ -651,7 +656,7 @@ void floppy_image_device::stp_w(int state) if (m_make_sound) m_sound_out->step(cyl*5/tracks); } /* Update disk detection if applicable */ - if (exists()) + if (exists() && !dskchg_writable) { if (dskchg==0) dskchg = 1; } @@ -696,7 +701,7 @@ void floppy_image_device::seek_phase_w(int phases) logerror("%s: track %d.%d\n", tag(), cyl, subcyl); /* Update disk detection if applicable */ - if (exists()) + if (exists() && !dskchg_writable) if (dskchg==0) dskchg = 1; } @@ -2040,6 +2045,7 @@ void sony_oa_d31v::setup_characteristics() form_factor = floppy_image::FF_35; tracks = 70; sides = 1; + dskchg_writable = true; set_rpm(600); } @@ -2075,6 +2081,7 @@ void sony_oa_d32w::setup_characteristics() form_factor = floppy_image::FF_35; tracks = 80; sides = 2; + dskchg_writable = true; set_rpm(600); } @@ -2111,6 +2118,7 @@ void sony_oa_d32v::setup_characteristics() form_factor = floppy_image::FF_35; tracks = 80; sides = 1; + dskchg_writable = true; set_rpm(600); } diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h index b6e01fe5286..5e03708c409 100644 --- a/src/devices/imagedev/floppy.h +++ b/src/devices/imagedev/floppy.h @@ -124,6 +124,7 @@ public: void dir_w(int state) { dir = state; } void ss_w(int state) { ss = state; } void inuse_w(int state) { } + void dskchg_w(int state) { if (dskchg_writable) dskchg = state; } void index_resync(); attotime time_next_index(); @@ -162,6 +163,7 @@ protected: int sides; /* number of heads */ uint32_t form_factor; /* 3"5, 5"25, etc */ bool motor_always_on; + bool dskchg_writable; /* state of input lines */ int dir; /* direction */ From 62363c0c219222926fdf858db0b950cb528665f7 Mon Sep 17 00:00:00 2001 From: Sergey Svishchev Date: Wed, 11 Jan 2017 02:15:49 +0300 Subject: [PATCH 2/3] imagedev/floppy: add has_trk00 property, initially for IBM 6360 8-inch drives --- src/devices/imagedev/floppy.cpp | 5 +++-- src/devices/imagedev/floppy.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp index 241483c7696..f22c1616970 100644 --- a/src/devices/imagedev/floppy.cpp +++ b/src/devices/imagedev/floppy.cpp @@ -181,6 +181,7 @@ floppy_image_device::floppy_image_device(const machine_config &mconfig, device_t form_factor(0), motor_always_on(false), dskchg_writable(false), + has_trk00_sensor(true), dir(0), stp(0), wtg(0), mon(0), ss(0), idx(0), wpt(0), rdy(0), dskchg(0), ready(false), rpm(0), @@ -316,6 +317,7 @@ void floppy_image_device::device_start() rpm = 0; motor_always_on = false; dskchg_writable = false; + has_trk00_sensor = true; idx = 0; @@ -2283,14 +2285,13 @@ ibm_6360::~ibm_6360() { } -//ol ibm_6360::trk00_r() { return true; } - void ibm_6360::setup_characteristics() { form_factor = floppy_image::FF_8; tracks = 77; sides = 1; motor_always_on = true; + has_trk00_sensor = false; set_rpm(360); } diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h index 5e03708c409..a099d1ad5b2 100644 --- a/src/devices/imagedev/floppy.h +++ b/src/devices/imagedev/floppy.h @@ -113,7 +113,7 @@ public: bool wpt_r() { return wpt; } int dskchg_r() { return dskchg; } - bool trk00_r() { return cyl != 0; } + bool trk00_r() { return (has_trk00_sensor ? (cyl != 0) : 1); } int idx_r() { return idx; } int mon_r() { return mon; } bool ss_r() { return ss; } @@ -164,6 +164,7 @@ protected: uint32_t form_factor; /* 3"5, 5"25, etc */ bool motor_always_on; bool dskchg_writable; + bool has_trk00_sensor; /* state of input lines */ int dir; /* direction */ From 89b7801ebe654466a5ddb32fe5c11e2c9bba52dc Mon Sep 17 00:00:00 2001 From: Sergey Svishchev Date: Fri, 13 Jan 2017 00:25:47 +0300 Subject: [PATCH 3/3] formats/wd177x_dsk: allow override of build_sector_description, like nec765_dsk --- src/lib/formats/wd177x_dsk.cpp | 6 +++--- src/lib/formats/wd177x_dsk.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/formats/wd177x_dsk.cpp b/src/lib/formats/wd177x_dsk.cpp index 52e8db2f1f2..fe6c9db2535 100644 --- a/src/lib/formats/wd177x_dsk.cpp +++ b/src/lib/formats/wd177x_dsk.cpp @@ -55,7 +55,7 @@ int wd177x_format::compute_track_size(const format &f) const return track_size; } -void wd177x_format::build_sector_description(const format &f, uint8_t *sectdata, desc_s *sectors) const +void wd177x_format::build_sector_description(const format &f, uint8_t *sectdata, desc_s *sectors, int track, int head) const { if(f.sector_base_id == -1) { for(int i=0; i &candidates); void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head); };