summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/imagedev/flopdrv.h
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2014-05-02 12:10:55 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2014-05-02 12:10:55 +0000
commit0ac942c9b80ead41b72e4e1dda77e775b6ffc7fa (patch)
tree97d15907bfe8909184259cc3ce3613967dd2709c /src/emu/imagedev/flopdrv.h
parent2d68fa308fec368614a89f276964356e06b4db81 (diff)
Cleanup of image device interfaces (nw)
Diffstat (limited to 'src/emu/imagedev/flopdrv.h')
-rw-r--r--src/emu/imagedev/flopdrv.h23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/emu/imagedev/flopdrv.h b/src/emu/imagedev/flopdrv.h
index 94a3520d5bb..2b197573bc4 100644
--- a/src/emu/imagedev/flopdrv.h
+++ b/src/emu/imagedev/flopdrv.h
@@ -62,17 +62,9 @@ struct floppy_type_t
struct floppy_interface
{
- devcb_write_line out_idx_func; /* index */
- devcb_read_line in_mon_func; /* motor on */
- devcb_write_line out_tk00_func; /* track 00 */
- devcb_write_line out_wpt_func; /* write protect */
- devcb_write_line out_rdy_func; /* ready */
-// devcb_write_line out_dskchg_func; /* disk changed */
-
floppy_type_t floppy_type;
const struct FloppyFormat *formats;
const char *interface;
- device_image_display_info_func device_displayinfo;
};
struct chrn_id
@@ -90,6 +82,8 @@ struct chrn_id
/* set if index has just occurred */
#define FLOPPY_DRIVE_INDEX 0x0020
+#define MCFG_LEGACY_FLOPPY_IDX_CB(_devcb) \
+ devcb = &legacy_floppy_image_device::set_out_idx_func(*device, DEVCB2_##_devcb);
class legacy_floppy_image_device : public device_t,
public device_image_interface
@@ -100,11 +94,12 @@ public:
legacy_floppy_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
~legacy_floppy_image_device();
+ template<class _Object> static devcb2_base &set_out_idx_func(device_t &device, _Object object) { return downcast<legacy_floppy_image_device &>(device).m_out_idx_func.set_callback(object); }
+
virtual bool call_load();
virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) { return load_software(swlist, swname, start_entry); }
virtual bool call_create(int format_type, option_resolution *format_options);
virtual void call_unload();
- virtual void call_display_info();
virtual iodevice_t image_type() const { return IO_FLOPPY; }
@@ -132,7 +127,6 @@ public:
void floppy_install_load_proc(void (*proc)(device_image_interface &image));
void floppy_install_unload_proc(void (*proc)(device_image_interface &image));
void floppy_drive_set_index_pulse_callback(void (*callback)(device_t *controller,device_t *image, int state));
- void floppy_drive_set_ready_state_change_callback(void (*callback)(device_t *controller,device_t *img, int state));
int floppy_drive_get_current_track();
UINT64 floppy_drive_get_current_track_size(int head);
void floppy_drive_set_rpm(float rpm);
@@ -175,12 +169,7 @@ protected:
virtual void device_start();
/* callbacks */
- devcb_resolved_write_line m_out_idx_func;
- devcb_resolved_read_line m_in_mon_func;
- devcb_resolved_write_line m_out_tk00_func;
- devcb_resolved_write_line m_out_wpt_func;
- devcb_resolved_write_line m_out_rdy_func;
- devcb_resolved_write_line m_out_dskchg_func;
+ devcb2_write_line m_out_idx_func;
/* state of input lines */
int m_drtn; /* direction */
@@ -218,8 +207,6 @@ protected:
/* rotation per minute => gives index pulse frequency */
float m_rpm;
- void (*m_ready_state_change_callback)(device_t *controller,device_t *img, int state);
-
int m_id_index;
device_t *m_controller;