From 35b65418d57dedea473583370568578ad5d6f569 Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Mon, 14 Apr 2014 05:35:45 +0000 Subject: [PATCH] smc92x4: updated to use inline configs. nw. --- src/emu/bus/ti99_peb/hfdc.c | 8 ++------ src/emu/machine/smc92x4.c | 7 ++----- src/emu/machine/smc92x4.h | 24 ++++++++++-------------- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/src/emu/bus/ti99_peb/hfdc.c b/src/emu/bus/ti99_peb/hfdc.c index 3900856f20d..a0228023989 100644 --- a/src/emu/bus/ti99_peb/hfdc.c +++ b/src/emu/bus/ti99_peb/hfdc.c @@ -430,19 +430,15 @@ void myarc_hfdc_device::device_timer(emu_timer &timer, device_timer_id id, int p if (VERBOSE>6) LOG("hfdc: motor off\n"); } -const smc92x4_interface ti99_smc92x4_interface = -{ - FALSE, /* do not use the full track layout */ -}; - MACHINE_CONFIG_FRAGMENT( ti99_hfdc ) - MCFG_SMC92X4_ADD(FDC_TAG, ti99_smc92x4_interface ) + MCFG_DEVICE_ADD(FDC_TAG, SMC92X4, 0) MCFG_SMC92X4_INTRQ_CALLBACK(WRITELINE(myarc_hfdc_device, intrq_w)) MCFG_SMC92X4_DIP_CALLBACK(WRITELINE(myarc_hfdc_device, dip_w)) MCFG_SMC92X4_AUXBUS_OUT_CALLBACK(WRITE8(myarc_hfdc_device, auxbus_out)) MCFG_SMC92X4_AUXBUS_IN_CALLBACK(READ8(myarc_hfdc_device, auxbus_in)) MCFG_SMC92X4_DMA_IN_CALLBACK(READ8(myarc_hfdc_device, read_buffer)) MCFG_SMC92X4_DMA_OUT_CALLBACK(WRITE8(myarc_hfdc_device, write_buffer)) + MCFG_SMC92X4_FULL_TRACK_LAYOUT(FALSE) /* do not use the full track layout */ MCFG_DEVICE_ADD(CLOCK_TAG, MM58274C, 0) MCFG_MM58274C_MODE24(1) // 24 hour diff --git a/src/emu/machine/smc92x4.c b/src/emu/machine/smc92x4.c index 72a663e8736..7de574d68b7 100644 --- a/src/emu/machine/smc92x4.c +++ b/src/emu/machine/smc92x4.c @@ -194,7 +194,8 @@ smc92x4_device::smc92x4_device(const machine_config &mconfig, const char *tag, d m_out_auxbus(*this), m_in_auxbus(*this), m_in_dma(*this), - m_out_dma(*this) + m_out_dma(*this), + m_full_track_layout(FALSE) { } @@ -1951,8 +1952,6 @@ WRITE8_MEMBER( smc92x4_device::write ) void smc92x4_device::device_start() { - const smc92x4_interface *intf = reinterpret_cast(static_config()); - m_out_intrq.resolve_safe(); m_out_dip.resolve_safe(); m_out_auxbus.resolve_safe(); @@ -1960,8 +1959,6 @@ void smc92x4_device::device_start() m_out_dma.resolve_safe(); m_in_dma.resolve_safe(0); - m_full_track_layout = intf->full_track_layout; - // allocate timers // m_timer_data = timer_alloc(DATA_TIMER); m_timer_rs = timer_alloc(READ_TIMER); diff --git a/src/emu/machine/smc92x4.h b/src/emu/machine/smc92x4.h index 48e774e289b..e451f8590f5 100644 --- a/src/emu/machine/smc92x4.h +++ b/src/emu/machine/smc92x4.h @@ -66,16 +66,14 @@ extern const device_type SMC92X4; #define MCFG_SMC92X4_DMA_OUT_CALLBACK(_write) \ devcb = &smc92x4_device::set_dma_wr_callback(*device, DEVCB2_##_write); -struct smc92x4_interface -{ - // Disk format support. This flag allows to choose between the full - // FM/MFM format and an abbreviated track layout. The difference results - // from legal variations of the layout. This is not part of - // the smc92x4 specification, but it allows to keep the image format - // simple without too much case checking. Should be removed as soon as - // the respective disk formats support the full format. - int full_track_layout; -}; +// Disk format support. This flag allows to choose between the full +// FM/MFM format and an abbreviated track layout. The difference results +// from legal variations of the layout. This is not part of +// the smc92x4 specification, but it allows to keep the image format +// simple without too much case checking. Should be removed as soon as +// the respective disk formats support the full format. +#define MCFG_SMC92X4_FULL_TRACK_LAYOUT(_lay) \ + smc92x4_device::set_full_track_layout(*device, _lay); class smc92x4_device : public device_t @@ -90,6 +88,8 @@ public: template static devcb2_base &set_dma_rd_callback(device_t &device, _Object object) { return downcast(device).m_in_dma.set_callback(object); } template static devcb2_base &set_dma_wr_callback(device_t &device, _Object object) { return downcast(device).m_out_dma.set_callback(object); } + static void set_full_track_layout(device_t &device, bool lay) { downcast(device).m_full_track_layout = lay; } + DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -226,8 +226,4 @@ private: mfm_harddisk_device *m_harddisk; }; -#define MCFG_SMC92X4_ADD(_tag, _intrf) \ - MCFG_DEVICE_ADD(_tag, SMC92X4, 0) \ - MCFG_DEVICE_CONFIG(_intrf) - #endif