mirror of
https://github.com/holub/mame
synced 2025-06-25 13:54:37 +03:00
floppy: Created floppies need to be initialized the same way as loaded floppies
This commit is contained in:
parent
7d4452b0f9
commit
650ec0fe13
@ -400,6 +400,31 @@ floppy_image_format_t *floppy_image_device::identify(std::string filename)
|
|||||||
return best_format;
|
return best_format;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void floppy_image_device::init_floppy_load(bool write_supported)
|
||||||
|
{
|
||||||
|
revolution_start_time = mon ? attotime::never : machine().time();
|
||||||
|
revolution_count = 0;
|
||||||
|
|
||||||
|
index_resync();
|
||||||
|
|
||||||
|
wpt = 1; // disk sleeve is covering the sensor
|
||||||
|
if (!cur_wpt_cb.isnull())
|
||||||
|
cur_wpt_cb(this, wpt);
|
||||||
|
|
||||||
|
wpt = is_readonly() || (!write_supported);
|
||||||
|
if (!cur_wpt_cb.isnull())
|
||||||
|
cur_wpt_cb(this, wpt);
|
||||||
|
|
||||||
|
if (motor_always_on) {
|
||||||
|
// When disk is inserted, start motor
|
||||||
|
mon_w(0);
|
||||||
|
} else if(!mon)
|
||||||
|
ready_counter = 2;
|
||||||
|
|
||||||
|
if (dskchg_writable)
|
||||||
|
dskchg = 1;
|
||||||
|
}
|
||||||
|
|
||||||
image_init_result floppy_image_device::call_load()
|
image_init_result floppy_image_device::call_load()
|
||||||
{
|
{
|
||||||
io_generic io;
|
io_generic io;
|
||||||
@ -434,32 +459,13 @@ image_init_result floppy_image_device::call_load()
|
|||||||
}
|
}
|
||||||
output_format = is_readonly() ? nullptr : best_format;
|
output_format = is_readonly() ? nullptr : best_format;
|
||||||
|
|
||||||
revolution_start_time = mon ? attotime::never : machine().time();
|
|
||||||
revolution_count = 0;
|
|
||||||
|
|
||||||
index_resync();
|
|
||||||
image_dirty = false;
|
image_dirty = false;
|
||||||
|
|
||||||
wpt = 1; // disk sleeve is covering the sensor
|
init_floppy_load(output_format != nullptr);
|
||||||
if (!cur_wpt_cb.isnull())
|
|
||||||
cur_wpt_cb(this, wpt);
|
|
||||||
|
|
||||||
wpt = is_readonly() || (output_format == nullptr);
|
|
||||||
if (!cur_wpt_cb.isnull())
|
|
||||||
cur_wpt_cb(this, wpt);
|
|
||||||
|
|
||||||
if (!cur_load_cb.isnull())
|
if (!cur_load_cb.isnull())
|
||||||
return cur_load_cb(this);
|
return cur_load_cb(this);
|
||||||
|
|
||||||
if (motor_always_on) {
|
|
||||||
// When disk is inserted, start motor
|
|
||||||
mon_w(0);
|
|
||||||
} else if(!mon)
|
|
||||||
ready_counter = 2;
|
|
||||||
|
|
||||||
if (dskchg_writable)
|
|
||||||
dskchg = 1;
|
|
||||||
|
|
||||||
return image_init_result::PASS;
|
return image_init_result::PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -519,9 +525,7 @@ image_init_result floppy_image_device::call_create(int format_type, util::option
|
|||||||
return image_init_result::FAIL;
|
return image_init_result::FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (motor_always_on)
|
init_floppy_load(output_format != nullptr);
|
||||||
// When disk is inserted, start motor
|
|
||||||
mon_w(0);
|
|
||||||
|
|
||||||
return image_init_result::PASS;
|
return image_init_result::PASS;
|
||||||
}
|
}
|
||||||
@ -2355,4 +2359,3 @@ void ibm_6360::handled_variants(uint32_t *variants, int &var_count) const
|
|||||||
var_count = 0;
|
var_count = 0;
|
||||||
variants[var_count++] = floppy_image::SSSD;
|
variants[var_count++] = floppy_image::SSSD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,6 +162,8 @@ protected:
|
|||||||
|
|
||||||
virtual void setup_characteristics() = 0;
|
virtual void setup_characteristics() = 0;
|
||||||
|
|
||||||
|
void init_floppy_load(bool write_supported);
|
||||||
|
|
||||||
floppy_image_format_t *input_format;
|
floppy_image_format_t *input_format;
|
||||||
floppy_image_format_t *output_format;
|
floppy_image_format_t *output_format;
|
||||||
floppy_image *image;
|
floppy_image *image;
|
||||||
|
Loading…
Reference in New Issue
Block a user