@@ -248,33 +248,33 @@ floppy_image_device *floppy_connector::get_device()
248248// floppy_image_device - constructor
249249// -------------------------------------------------
250250
251- floppy_image_device::floppy_image_device (const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
252- : device_t(mconfig, type, tag, owner, clock),
253- device_image_interface(mconfig, *this ),
254- m_input_format(nullptr ),
255- m_output_format(nullptr ),
256- m_image(),
257- m_index_timer(nullptr ),
258- m_tracks(0 ),
259- m_sides(0 ),
260- m_form_factor(0 ),
261- m_sectoring_type(floppy_image::SOFT),
262- m_motor_always_on(false ),
263- m_dskchg_writable(false ),
264- m_has_trk00_sensor(true ),
265- m_dir(0 ), m_stp(0 ), m_wtg(0 ), m_mon(0 ), m_ss(0 ), m_ds(-1 ), m_idx(0 ), m_wpt(0 ), m_rdy(0 ), m_dskchg(0 ),
266- m_ready(false ),
267- m_rpm(0 ),
268- m_angular_speed(0 ),
269- m_revolution_count(0 ),
270- m_cyl(0 ),
271- m_subcyl(0 ),
272- m_amplifier_freakout_time(attotime::from_usec(16 )),
273- m_image_dirty(false ),
274- m_track_dirty(false ),
275- m_ready_counter(0 ),
276- m_make_sound(true ), // MESSUI, Robbbert, default floppy sound on
277- m_sound_out(nullptr )
251+ floppy_image_device::floppy_image_device (const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
252+ device_t(mconfig, type, tag, owner, clock),
253+ device_image_interface(mconfig, *this ),
254+ m_input_format(nullptr ),
255+ m_output_format(nullptr ),
256+ m_image(),
257+ m_index_timer(nullptr ),
258+ m_tracks(0 ),
259+ m_sides(0 ),
260+ m_form_factor(0 ),
261+ m_sectoring_type(floppy_image::SOFT),
262+ m_motor_always_on(false ),
263+ m_dskchg_writable(false ),
264+ m_has_trk00_sensor(true ),
265+ m_dir(0 ), m_stp(0 ), m_wtg(0 ), m_mon(1 ), m_ss(0 ), m_ds(-1 ), m_idx(0 ), m_wpt(0 ), m_rdy(0 ), m_dskchg(0 ),
266+ m_ready(false ),
267+ m_rpm(0 ),
268+ m_angular_speed(0 ),
269+ m_revolution_count(0 ),
270+ m_cyl(0 ),
271+ m_subcyl(0 ),
272+ m_amplifier_freakout_time(attotime::from_usec(16 )),
273+ m_image_dirty(false ),
274+ m_track_dirty(false ),
275+ m_ready_counter(0 ),
276+ m_make_sound(true ), // MESSUI, Robbbert, default floppy sound on
277+ m_sound_out(nullptr )
278278{
279279 m_extension_list[0 ] = ' \0 ' ;
280280}
@@ -528,7 +528,7 @@ void floppy_image_device::device_start()
528528
529529 m_cyl = 0 ;
530530 m_subcyl = 0 ;
531- m_ss = 0 ;
531+ m_ss = 0 ;
532532 m_actual_ss = 0 ;
533533 m_ds = -1 ;
534534 m_stp = 1 ;
@@ -540,7 +540,6 @@ void floppy_image_device::device_start()
540540 m_ready_counter = 0 ;
541541 m_phases = 0 ;
542542
543-
544543 if (m_make_sound) m_sound_out = subdevice<floppy_sound_device>(FLOPSND_TAG);
545544
546545 save_item (NAME (m_dir));
@@ -656,9 +655,9 @@ std::pair<std::error_condition, std::string> floppy_image_device::call_load()
656655 const floppy_image_format_t *best_format = nullptr ;
657656 for (const floppy_image_format_t *format : m_fif_list) {
658657 int score = format->identify (*io, m_form_factor, m_variants);
659- if (score && format->extension_matches (filename ()))
658+ if (score && format->extension_matches (filename ()))
660659 score |= floppy_image_format_t ::FIFID_EXT;
661- if (score > best) {
660+ if (score > best) {
662661 best = score;
663662 best_format = format;
664663 }
@@ -672,6 +671,11 @@ std::pair<std::error_condition, std::string> floppy_image_device::call_load()
672671 m_image.reset ();
673672 return std::make_pair (image_error::INVALIDIMAGE, " Incompatible image file format or corrupted data" );
674673 }
674+
675+ char const *const wp = get_feature (" write_protected" );
676+ if (wp && !std::strcmp (wp, " true" ))
677+ make_readonly ();
678+
675679 m_output_format = is_readonly () ? nullptr : best_format;
676680
677681 m_image_dirty = false ;
0 commit comments