summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2014-04-12 12:34:53 +0000
committer Nathan Woods <npwoods@mess.org>2014-04-12 12:34:53 +0000
commit7a14765f7239ab4208582fca5b272af373cc8186 (patch)
treebbeb77f3f8435fbcbf314ed07b9c10edc1ae6cc0
parent85719e37bc9234fa5db99424fa7b3f3fffc053c5 (diff)
parent5589fea164b2551fd75e7b090aea7bda0a0c40be (diff)
Merge branch 'master' of ssh://mess.org/mame into new_menus
-rw-r--r--src/emu/bus/centronics/image.c11
-rw-r--r--src/emu/bus/iq151/staper.c2
-rw-r--r--src/emu/bus/midi/midiinport.c8
-rw-r--r--src/emu/imagedev/midiin.c16
-rw-r--r--src/emu/imagedev/midiin.h22
-rw-r--r--src/emu/imagedev/printer.c24
-rw-r--r--src/emu/imagedev/printer.h21
-rw-r--r--src/emu/machine/8042kbdc.c58
-rw-r--r--src/emu/machine/8042kbdc.h56
-rw-r--r--src/emu/machine/8257dma.c185
-rw-r--r--src/emu/machine/8257dma.h105
-rw-r--r--src/emu/machine/aakart.c1
-rw-r--r--src/emu/machine/roc10937.c69
-rw-r--r--src/emu/machine/roc10937.h9
-rw-r--r--src/emu/sound/tms36xx.c20
-rw-r--r--src/emu/sound/tms36xx.h63
-rw-r--r--src/lib/util/corefile.c4
-rw-r--r--src/mame/audio/segag80r.c11
-rw-r--r--src/mame/drivers/bfm_sc1.c6
-rw-r--r--src/mame/drivers/bfmsys85.c19
-rw-r--r--src/mame/drivers/bladestl.c2
-rw-r--r--src/mame/drivers/dkong.c32
-rw-r--r--src/mame/drivers/globalfr.c22
-rw-r--r--src/mame/drivers/jpmimpct.c19
-rw-r--r--src/mame/drivers/jpmsys5.c21
-rw-r--r--src/mame/drivers/maygay1b.c18
-rw-r--r--src/mame/drivers/model2.c175
-rw-r--r--src/mame/drivers/mpu3.c17
-rw-r--r--src/mame/drivers/mpu4hw.c18
-rw-r--r--src/mame/drivers/naughtyb.c28
-rw-r--r--src/mame/drivers/phoenix.c31
-rw-r--r--src/mame/drivers/pinkiri8.c24
-rw-r--r--src/mame/drivers/proconn.c14
-rw-r--r--src/mame/includes/archimds.h11
-rw-r--r--src/mame/includes/maygay1b.h1
-rw-r--r--src/mame/includes/model2.h2
-rw-r--r--src/mame/includes/mpu4.h2
-rw-r--r--src/mame/layout/mpu4.lay64
-rw-r--r--src/mame/layout/mpu4ext.lay64
-rw-r--r--src/mame/layout/mpu4plasma.lay32
-rw-r--r--src/mame/machine/archimds.c105
-rw-r--r--src/mame/machine/bfm_bd1.c43
-rw-r--r--src/mame/machine/bfm_bd1.h8
-rw-r--r--src/mame/machine/pcshare.c24
-rw-r--r--src/mame/video/archimds.c2
-rw-r--r--src/mess/drivers/a310.c66
-rw-r--r--src/mess/drivers/apogee.c6
-rw-r--r--src/mess/drivers/apple3.c27
-rw-r--r--src/mess/drivers/bebox.c18
-rw-r--r--src/mess/drivers/digel804.c12
-rw-r--r--src/mess/drivers/dragon.c2
-rw-r--r--src/mess/drivers/fanucspmg.c15
-rw-r--r--src/mess/drivers/hec2hrp.c12
-rw-r--r--src/mess/drivers/interact.c4
-rw-r--r--src/mess/drivers/ip22.c15
-rw-r--r--src/mess/drivers/mc10.c4
-rw-r--r--src/mess/drivers/mikrosha.c6
-rw-r--r--src/mess/drivers/partner.c8
-rw-r--r--src/mess/drivers/pc8001.c38
-rw-r--r--src/mess/drivers/ql.c2
-rw-r--r--src/mess/drivers/radio86.c6
-rw-r--r--src/mess/drivers/unior.c18
-rw-r--r--src/mess/drivers/vg5k.c2
-rw-r--r--src/mess/drivers/x07.c2
-rw-r--r--src/mess/includes/apple3.h16
-rw-r--r--src/mess/includes/partner.h1
-rw-r--r--src/mess/includes/radio86.h3
-rw-r--r--src/mess/machine/apple3.c153
-rw-r--r--src/mess/machine/partner.c13
-rw-r--r--src/mess/machine/radio86.c11
70 files changed, 1144 insertions, 805 deletions
diff --git a/src/emu/bus/centronics/image.c b/src/emu/bus/centronics/image.c
index 9005bcce212..10fe3306fe6 100644
--- a/src/emu/bus/centronics/image.c
+++ b/src/emu/bus/centronics/image.c
@@ -8,17 +8,10 @@
// device type definition
const device_type CENTRONICS_PRINTER_IMAGE = &device_creator<centronics_printer_image_device>;
-/*****************************************************************************
- PRINTER INTERFACE
-*****************************************************************************/
-const struct printer_interface centronics_printer_config =
-{
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, centronics_printer_image_device, printer_online)
-};
static MACHINE_CONFIG_FRAGMENT( centronics_printer )
- MCFG_PRINTER_ADD("printer")
- MCFG_DEVICE_CONFIG(centronics_printer_config)
+ MCFG_DEVICE_ADD("printer", PRINTER, 0)
+ MCFG_PRINTER_ONLINE_CB(WRITELINE(centronics_printer_image_device, printer_online))
MACHINE_CONFIG_END
diff --git a/src/emu/bus/iq151/staper.c b/src/emu/bus/iq151/staper.c
index 7cdedd77e25..e9f11d6ade4 100644
--- a/src/emu/bus/iq151/staper.c
+++ b/src/emu/bus/iq151/staper.c
@@ -34,7 +34,7 @@ static I8255_INTERFACE( iq151_staper_ppi_intf )
static MACHINE_CONFIG_FRAGMENT( iq151_staper )
MCFG_I8255A_ADD("ppi8255", iq151_staper_ppi_intf)
- MCFG_PRINTER_ADD("printer")
+ MCFG_DEVICE_ADD("printer", PRINTER, 0)
MACHINE_CONFIG_END
//**************************************************************************
diff --git a/src/emu/bus/midi/midiinport.c b/src/emu/bus/midi/midiinport.c
index 906a183e7b4..525736f1969 100644
--- a/src/emu/bus/midi/midiinport.c
+++ b/src/emu/bus/midi/midiinport.c
@@ -17,13 +17,9 @@ midiin_port_device::midiin_port_device(const machine_config &mconfig, const char
{
}
-static midiin_config midiin_port_image_config =
-{
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, midiin_port_device, read)
-};
-
static MACHINE_CONFIG_FRAGMENT(midiin_port_config)
- MCFG_MIDIIN_ADD("midiinimg", midiin_port_image_config)
+ MCFG_DEVICE_ADD("midiinimg", MIDIIN, 0)
+ MCFG_MIDIIN_INPUT_CB(WRITELINE(midiin_port_device, read))
MACHINE_CONFIG_END
machine_config_constructor midiin_port_device::device_mconfig_additions() const
diff --git a/src/emu/imagedev/midiin.c b/src/emu/imagedev/midiin.c
index bbd959bd617..8f0f14dd2e1 100644
--- a/src/emu/imagedev/midiin.c
+++ b/src/emu/imagedev/midiin.c
@@ -22,7 +22,8 @@ const device_type MIDIIN = &device_creator<midiin_device>;
midiin_device::midiin_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, MIDIIN, "MIDI In image device", tag, owner, clock, "midiin", __FILE__),
device_image_interface(mconfig, *this),
- device_serial_interface(mconfig, *this)
+ device_serial_interface(mconfig, *this),
+ m_input_cb(*this)
{
}
@@ -32,7 +33,7 @@ midiin_device::midiin_device(const machine_config &mconfig, const char *tag, dev
void midiin_device::device_start()
{
- m_input_func.resolve(m_input_callback, *this);
+ m_input_cb.resolve_safe();
m_timer = timer_alloc(0);
m_midi = NULL;
m_timer->enable(false);
@@ -55,15 +56,6 @@ void midiin_device::device_reset()
void midiin_device::device_config_complete(void)
{
- const midiin_config *intf = reinterpret_cast<const midiin_config *>(static_config());
- if(intf != NULL)
- {
- *static_cast<midiin_config *>(this) = *intf;
- }
- else
- {
- memset(&m_input_callback, 0, sizeof(m_input_callback));
- }
update_names();
}
@@ -152,7 +144,7 @@ void midiin_device::tra_complete()
void midiin_device::tra_callback()
{
int bit = transmit_register_get_data_bit();
- m_input_func(bit);
+ m_input_cb(bit);
}
void midiin_device::xmit_char(UINT8 data)
diff --git a/src/emu/imagedev/midiin.h b/src/emu/imagedev/midiin.h
index 6deae720968..efa47f2d1ff 100644
--- a/src/emu/imagedev/midiin.h
+++ b/src/emu/imagedev/midiin.h
@@ -10,19 +10,8 @@
#define __MIDIIN_H__
-/***************************************************************************
- CONSTANTS
-***************************************************************************/
-
-struct midiin_config
-{
- /* callback to driver */
- devcb_write_line m_input_callback;
-};
-
-#define MCFG_MIDIIN_ADD(_tag, _config) \
- MCFG_DEVICE_ADD(_tag, MIDIIN, 0) \
- MCFG_DEVICE_CONFIG(_config)
+#define MCFG_MIDIIN_INPUT_CB(_devcb) \
+ devcb = &midiin_device::set_input_callback(*device, DEVCB2_##_devcb);
/***************************************************************************
@@ -31,13 +20,14 @@ struct midiin_config
class midiin_device : public device_t,
public device_image_interface,
- public device_serial_interface,
- public midiin_config
+ public device_serial_interface
{
public:
// construction/destruction
midiin_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ template<class _Object> static devcb2_base &set_input_callback(device_t &device, _Object object) { return downcast<midiin_device &>(device).m_input_cb.set_callback(object); }
+
// image-level overrides
virtual bool call_load();
virtual void call_unload();
@@ -72,7 +62,7 @@ private:
osd_midi_device *m_midi;
emu_timer *m_timer;
- devcb_resolved_write_line m_input_func;
+ devcb2_write_line m_input_cb;
UINT8 m_xmitring[XMIT_RING_SIZE];
int m_xmit_read, m_xmit_write;
bool m_tx_busy;
diff --git a/src/emu/imagedev/printer.c b/src/emu/imagedev/printer.c
index cbfdd2da93c..5c4dfff9317 100644
--- a/src/emu/imagedev/printer.c
+++ b/src/emu/imagedev/printer.c
@@ -19,7 +19,8 @@ const device_type PRINTER = &device_creator<printer_image_device>;
printer_image_device::printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, PRINTER, "Printer", tag, owner, clock, "printer_image", __FILE__),
- device_image_interface(mconfig, *this)
+ device_image_interface(mconfig, *this),
+ m_online_cb(*this)
{
}
@@ -39,17 +40,6 @@ printer_image_device::~printer_image_device()
void printer_image_device::device_config_complete()
{
- // inherit a copy of the static data
- const printer_interface *intf = reinterpret_cast<const printer_interface *>(static_config());
- if (intf != NULL)
- *static_cast<printer_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_online, 0, sizeof(m_online));
- }
-
// set brief and instance name
update_names();
}
@@ -61,7 +51,7 @@ void printer_image_device::device_config_complete()
void printer_image_device::device_start()
{
- m_online_func.resolve(m_online, *this);
+ m_online_cb.resolve();
}
/***************************************************************************
@@ -107,8 +97,8 @@ bool printer_image_device::call_create(int format_type, option_resolution *forma
bool printer_image_device::call_load()
{
/* send notify that the printer is now online */
- if (!m_online_func.isnull())
- m_online_func(TRUE);
+ if (!m_online_cb.isnull())
+ m_online_cb(TRUE);
/* we don't need to do anything special */
return IMAGE_INIT_PASS;
@@ -121,6 +111,6 @@ bool printer_image_device::call_load()
void printer_image_device::call_unload()
{
/* send notify that the printer is now offline */
- if (!m_online_func.isnull())
- m_online_func(FALSE);
+ if (!m_online_cb.isnull())
+ m_online_cb(FALSE);
}
diff --git a/src/emu/imagedev/printer.h b/src/emu/imagedev/printer.h
index cfc79877cde..c2d73f409b1 100644
--- a/src/emu/imagedev/printer.h
+++ b/src/emu/imagedev/printer.h
@@ -10,27 +10,25 @@
#define __PRINTER_H__
+#define MCFG_PRINTER_ONLINE_CB(_devcb) \
+ devcb = &printer_image_device::set_online_callback(*device, DEVCB2_##_devcb);
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
-// ======================> printer_interface
-
-struct printer_interface
-{
- devcb_write_line m_online;
-};
-
// ======================> printer_image_device
class printer_image_device : public device_t,
- public printer_interface,
public device_image_interface
{
public:
// construction/destruction
printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~printer_image_device();
+
+ template<class _Object> static devcb2_base &set_online_callback(device_t &device, _Object object) { return downcast<printer_image_device &>(device).m_online_cb.set_callback(object); }
// image-level overrides
virtual bool call_load();
@@ -56,17 +54,14 @@ public:
void output(UINT8 data);
protected:
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
+ virtual void device_config_complete();
- devcb_resolved_write_line m_online_func;
+ devcb2_write_line m_online_cb;
};
// device type definition
extern const device_type PRINTER;
-
-#define MCFG_PRINTER_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, PRINTER, 0)
#endif /* __PRINTER_H__ */
diff --git a/src/emu/machine/8042kbdc.c b/src/emu/machine/8042kbdc.c
index c3e1fc917c7..0d4662bd096 100644
--- a/src/emu/machine/8042kbdc.c
+++ b/src/emu/machine/8042kbdc.c
@@ -197,6 +197,11 @@ const device_type KBDC8042 = &device_creator<kbdc8042_device>;
kbdc8042_device::kbdc8042_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, KBDC8042, "Keyboard Controller 8042", tag, owner, clock, "kbdc8042", __FILE__)
, m_keyboard_dev(*this, "at_keyboard")
+ , m_system_reset_cb(*this)
+ , m_gate_a20_cb(*this)
+ , m_input_buffer_full_cb(*this)
+ , m_output_buffer_empty_cb(*this)
+ , m_speaker_cb(*this)
{
}
@@ -209,33 +214,6 @@ machine_config_constructor kbdc8042_device::device_mconfig_additions() const
return MACHINE_CONFIG_NAME( keyboard );
}
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void kbdc8042_device::device_config_complete()
-{
- // inherit a copy of the static data
- const kbdc8042_interface *intf = reinterpret_cast<const kbdc8042_interface *>(static_config());
-
- if (intf != NULL)
- {
- *static_cast<kbdc8042_interface *>(this) = *intf;
- }
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_system_reset_cb, 0, sizeof(m_system_reset_cb));
- memset(&m_gate_a20_cb, 0, sizeof(m_gate_a20_cb));
- memset(&m_input_buffer_full_func, 0, sizeof(m_input_buffer_full_func));
- memset(&m_output_buffer_empty_cb, 0, sizeof(m_output_buffer_empty_cb));
- memset(&m_speaker_cb, 0, sizeof(m_speaker_cb));
- }
-}
-
/*-------------------------------------------------
device_start - device-specific startup
-------------------------------------------------*/
@@ -243,11 +221,11 @@ void kbdc8042_device::device_config_complete()
void kbdc8042_device::device_start()
{
// resolve callbacks
- m_system_reset_func.resolve(m_system_reset_cb, *this);
- m_gate_a20_func.resolve(m_gate_a20_cb, *this);
- m_input_buffer_full_func.resolve(m_input_buffer_full_cb, *this);
- m_output_buffer_empty_func.resolve(m_output_buffer_empty_cb, *this);
- m_speaker_func.resolve(m_speaker_cb, *this);
+ m_system_reset_cb.resolve_safe();
+ m_gate_a20_cb.resolve();
+ m_input_buffer_full_cb.resolve();
+ m_output_buffer_empty_cb.resolve_safe();
+ m_speaker_cb.resolve();
m_operation_write_state = 0; /* first write to 0x60 might occur before anything can set this */
}
@@ -271,8 +249,8 @@ void kbdc8042_device::at_8042_set_outport(UINT8 data, int initial)
m_outport = data;
if (change & 0x02)
{
- if (!m_gate_a20_func.isnull())
- m_gate_a20_func(data & 0x02 ? 1 : 0);
+ if (!m_gate_a20_cb.isnull())
+ m_gate_a20_cb(data & 0x02 ? 1 : 0);
}
}
@@ -286,7 +264,7 @@ TIMER_CALLBACK_MEMBER( kbdc8042_device::kbdc8042_clr_int )
{
/* Lets 8952's timers do their job before clear the interrupt line, */
/* else Keyboard interrupt never happens. */
- m_input_buffer_full_func(0);
+ m_input_buffer_full_cb(0);
}
void kbdc8042_device::at_8042_receive(UINT8 data)
@@ -297,9 +275,9 @@ void kbdc8042_device::at_8042_receive(UINT8 data)
m_data = data;
m_keyboard.received = 1;
- if (!m_input_buffer_full_func.isnull())
+ if (!m_input_buffer_full_cb.isnull())
{
- m_input_buffer_full_func(1);
+ m_input_buffer_full_cb(1);
/* Lets 8952's timers do their job before clear the interrupt line, */
/* else Keyboard interrupt never happens. */
machine().scheduler().timer_set(attotime::from_usec(2), timer_expired_delegate(FUNC(kbdc8042_device::kbdc8042_clr_int),this));
@@ -515,8 +493,8 @@ WRITE8_MEMBER(kbdc8042_device::data_w)
case 1:
m_speaker = data;
- if (!m_speaker_func.isnull())
- m_speaker_func(0, m_speaker);
+ if (!m_speaker_cb.isnull())
+ m_speaker_cb((offs_t)0, m_speaker);
break;
@@ -617,7 +595,7 @@ WRITE8_MEMBER(kbdc8042_device::data_w)
* the bits low set in the command byte. The only pulse that has
* an effect currently is bit 0, which pulses the CPU's reset line
*/
- m_system_reset_func(PULSE_LINE);
+ m_system_reset_cb(PULSE_LINE);
at_8042_set_outport(m_outport | 0x02, 0);
break;
}
diff --git a/src/emu/machine/8042kbdc.h b/src/emu/machine/8042kbdc.h
index 81f2d63a323..c7e14ec1609 100644
--- a/src/emu/machine/8042kbdc.h
+++ b/src/emu/machine/8042kbdc.h
@@ -24,39 +24,44 @@ enum kbdc8042_type_t
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_KBDC8042_ADD(_tag, _interface) \
- MCFG_DEVICE_ADD(_tag, KBDC8042, 0) \
- MCFG_DEVICE_CONFIG(_interface)
+#define MCFG_KBDC8042_KEYBOARD_TYPE(_kbdt) \
+ kbdc8042_device::set_keyboard_type(*device, _kbdt);
+#define MCFG_KBDC8042_SYSTEM_RESET_CB(_devcb) \
+ devcb = &kbdc8042_device::set_system_reset_callback(*device, DEVCB2_##_devcb);
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
+#define MCFG_KBDC8042_GATE_A20_CB(_devcb) \
+ devcb = &kbdc8042_device::set_gate_a20_callback(*device, DEVCB2_##_devcb);
-// ======================> kbdc8042_interface
+#define MCFG_KBDC8042_INPUT_BUFFER_FULL_CB(_devcb) \
+ devcb = &kbdc8042_device::set_input_buffer_full_callback(*device, DEVCB2_##_devcb);
-struct kbdc8042_interface
-{
- kbdc8042_type_t m_keybtype;
- // interface to the host pc
- devcb_write_line m_system_reset_cb;
- devcb_write_line m_gate_a20_cb;
- devcb_write_line m_input_buffer_full_cb;
- devcb_write_line m_output_buffer_empty_cb;
+#define MCFG_KBDC8042_OUTPUT_BUFFER_EMPTY_CB(_devcb) \
+ devcb = &kbdc8042_device::set_output_buffer_empty_callback(*device, DEVCB2_##_devcb);
- devcb_write8 m_speaker_cb;
-};
+#define MCFG_KBDC8042_SPEAKER_CB(_devcb) \
+ devcb = &kbdc8042_device::set_speaker_callback(*device, DEVCB2_##_devcb);
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
// ======================> kbdc8042_device
-class kbdc8042_device : public device_t,
- public kbdc8042_interface
+class kbdc8042_device : public device_t
{
public:
// construction/destruction
kbdc8042_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual machine_config_constructor device_mconfig_additions() const;
+
+ static void set_keyboard_type(device_t &device, kbdc8042_type_t keybtype) { downcast<kbdc8042_device &>(device).m_keybtype = keybtype; }
+ template<class _Object> static devcb2_base &set_system_reset_callback(device_t &device, _Object object) { return downcast<kbdc8042_device &>(device).m_system_reset_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_gate_a20_callback(device_t &device, _Object object) { return downcast<kbdc8042_device &>(device).m_gate_a20_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_input_buffer_full_callback(device_t &device, _Object object) { return downcast<kbdc8042_device &>(device).m_input_buffer_full_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_output_buffer_empty_callback(device_t &device, _Object object) { return downcast<kbdc8042_device &>(device).m_output_buffer_empty_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_speaker_callback(device_t &device, _Object object) { return downcast<kbdc8042_device &>(device).m_speaker_cb.set_callback(object); }
DECLARE_READ8_MEMBER( data_r );
DECLARE_WRITE8_MEMBER( data_w );
@@ -74,7 +79,6 @@ protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
- virtual void device_config_complete();
UINT8 m_inport, m_outport, m_data, m_command;
@@ -104,12 +108,14 @@ protected:
required_device<at_keyboard_device> m_keyboard_dev;
- devcb_resolved_write_line m_system_reset_func;
- devcb_resolved_write_line m_gate_a20_func;
- devcb_resolved_write_line m_input_buffer_full_func;
- devcb_resolved_write_line m_output_buffer_empty_func;
+ kbdc8042_type_t m_keybtype;
+
+ devcb2_write_line m_system_reset_cb;
+ devcb2_write_line m_gate_a20_cb;
+ devcb2_write_line m_input_buffer_full_cb;
+ devcb2_write_line m_output_buffer_empty_cb;
- devcb_resolved_write8 m_speaker_func;
+ devcb2_write8 m_speaker_cb;
};
// device type definition
diff --git a/src/emu/machine/8257dma.c b/src/emu/machine/8257dma.c
index 0a7ccaa6e8f..784d2cfde8d 100644
--- a/src/emu/machine/8257dma.c
+++ b/src/emu/machine/8257dma.c
@@ -60,6 +60,19 @@ const device_type I8257 = &device_creator<i8257_device>;
i8257_device::i8257_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, I8257, "DMA8257", tag, owner, clock, "i8257", __FILE__),
+ m_out_hrq_cb(*this),
+ m_out_tc_cb(*this),
+ m_out_mark_cb(*this),
+ m_in_memr_cb(*this),
+ m_out_memw_cb(*this),
+ m_in_ior_0_cb(*this),
+ m_in_ior_1_cb(*this),
+ m_in_ior_2_cb(*this),
+ m_in_ior_3_cb(*this),
+ m_out_iow_0_cb(*this),
+ m_out_iow_1_cb(*this),
+ m_out_iow_2_cb(*this),
+ m_out_iow_3_cb(*this),
m_mode(0),
m_rr(0),
m_msb(0),
@@ -72,42 +85,6 @@ i8257_device::i8257_device(const machine_config &mconfig, const char *tag, devic
memset(m_rwmode, 0, sizeof(m_rwmode));
}
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void i8257_device::device_config_complete()
-{
- // inherit a copy of the static data
- const i8257_interface *intf = reinterpret_cast<const i8257_interface *>(static_config());
- if (intf != NULL)
- {
- *static_cast<i8257_interface *>(this) = *intf;
- }
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_hrq_cb, 0, sizeof(m_out_hrq_cb));
- memset(&m_out_tc_cb, 0, sizeof(m_out_tc_cb));
- memset(&m_out_mark_cb, 0, sizeof(m_out_mark_cb));
- memset(&m_in_memr_cb, 0, sizeof(m_in_memr_cb));
- memset(&m_out_memw_cb, 0, sizeof(m_out_memw_cb));
- memset(&m_in_ior_cb[0], 0, sizeof(m_in_ior_cb[0]));
- memset(&m_in_ior_cb[1], 0, sizeof(m_in_ior_cb[1]));
- memset(&m_in_ior_cb[2], 0, sizeof(m_in_ior_cb[2]));
- memset(&m_in_ior_cb[3], 0, sizeof(m_in_ior_cb[3]));
- memset(&m_out_iow_cb[0], 0, sizeof(m_out_iow_cb[0]));
- memset(&m_out_iow_cb[1], 0, sizeof(m_out_iow_cb[1]));
- memset(&m_out_iow_cb[2], 0, sizeof(m_out_iow_cb[2]));
- memset(&m_out_iow_cb[3], 0, sizeof(m_out_iow_cb[3]));
- }
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -118,18 +95,20 @@ void i8257_device::device_start()
assert(this != NULL);
/* resolve callbacks */
- m_out_hrq_func.resolve(m_out_hrq_cb, *this);
- m_out_tc_func.resolve(m_out_tc_cb, *this);
- m_out_mark_func.resolve(m_out_mark_cb, *this);
- m_in_memr_func.resolve(m_in_memr_cb, *this);
- m_out_memw_func.resolve(m_out_memw_cb, *this);
-
- for (int i = 0; i < I8257_NUM_CHANNELS; i++)
- {
- m_in_ior_func[i].resolve(m_in_ior_cb[i], *this);
- m_out_iow_func[i].resolve(m_out_iow_cb[i], *this);
- }
-
+ m_out_hrq_cb.resolve_safe();
+ m_out_tc_cb.resolve_safe();
+ m_out_mark_cb.resolve_safe();
+ m_in_memr_cb.resolve();
+ m_out_memw_cb.resolve();
+ m_in_ior_0_cb.resolve();
+ m_in_ior_1_cb.resolve();
+ m_in_ior_2_cb.resolve();
+ m_in_ior_3_cb.resolve();
+ m_out_iow_0_cb.resolve();
+ m_out_iow_1_cb.resolve();
+ m_out_iow_2_cb.resolve();
+ m_out_iow_3_cb.resolve();
+
/* set initial values */
m_timer = timer_alloc(TIMER_OPERATION);
m_msbflip_timer = timer_alloc(TIMER_MSBFLIP);
@@ -162,33 +141,53 @@ void i8257_device::device_reset()
int i8257_device::i8257_do_operation(int channel)
{
int done;
- UINT8 data;
+ UINT8 data = 0;
UINT8 mode = m_rwmode[channel];
if (m_count[channel] == 0x0000)
{
m_status |= (0x01 << channel);
- m_out_tc_func(ASSERT_LINE);
+ m_out_tc_cb(ASSERT_LINE);
}
- switch(mode) {
+
+ switch(mode)
+ {
case 1:
- if (!m_in_memr_func.isnull())
- {
- data = m_in_memr_func(m_address[channel]);
- }
+ if (!m_in_memr_cb.isnull())
+ data = m_in_memr_cb(m_address[channel]);
else
{
data = 0;
logerror("8257: No memory read function defined.\n");
}
- if (!m_out_iow_func[channel].isnull())
- {
- m_out_iow_func[channel](m_address[channel], data);
- }
- else
+
+ switch (channel)
{
- logerror("8257: No channel write function for channel %d defined.\n",channel);
+ case 0:
+ if (!m_out_iow_0_cb.isnull())
+ m_out_iow_0_cb((offs_t)m_address[channel], data);
+ else
+ logerror("8257: No channel write function for channel %d defined.\n", channel);
+ break;
+ case 1:
+ if (!m_out_iow_1_cb.isnull())
+ m_out_iow_1_cb((offs_t)m_address[channel], data);
+ else
+ logerror("8257: No channel write function for channel %d defined.\n", channel);
+ break;
+ case 2:
+ if (!m_out_iow_2_cb.isnull())
+ m_out_iow_2_cb((offs_t)m_address[channel], data);
+ else
+ logerror("8257: No channel write function for channel %d defined.\n", channel);
+ break;
+ case 3:
+ if (!m_out_iow_3_cb.isnull())
+ m_out_iow_3_cb((offs_t)m_address[channel], data);
+ else
+ logerror("8257: No channel write function for channel %d defined.\n", channel);
+ break;
}
m_address[channel]++;
@@ -197,37 +196,67 @@ int i8257_device::i8257_do_operation(int channel)
break;
case 2:
- if (!m_in_ior_func[channel].isnull())
- {
- data = m_in_ior_func[channel](m_address[channel]);
- }
- else
+ switch (channel)
{
- data = 0;
- logerror("8257: No channel read function for channel %d defined.\n",channel);
+ case 0:
+ if (!m_in_ior_0_cb.isnull())
+ data = m_in_ior_0_cb((offs_t)m_address[channel]);
+ else
+ {
+ data = 0;
+ logerror("8257: No channel read function for channel %d defined.\n", channel);
+ }
+ break;
+ case 1:
+ if (!m_in_ior_1_cb.isnull())
+ data = m_in_ior_1_cb((offs_t)m_address[channel]);
+ else
+ {
+ data = 0;
+ logerror("8257: No channel read function for channel %d defined.\n", channel);
+ }
+ break;
+ case 2:
+ if (!m_in_ior_2_cb.isnull())
+ data = m_in_ior_2_cb((offs_t)m_address[channel]);
+ else
+ {
+ data = 0;
+ logerror("8257: No channel read function for channel %d defined.\n", channel);
+ }
+ break;
+ case 3:
+ if (!m_in_ior_3_cb.isnull())
+ data = m_in_ior_3_cb((offs_t)m_address[channel]);
+ else
+ {
+ data = 0;
+ logerror("8257: No channel read function for channel %d defined.\n", channel);
+ }
+ break;
}
- if (!m_out_memw_func.isnull())
- {
- m_out_memw_func(m_address[channel], data);
- }
+ if (!m_out_memw_cb.isnull())
+ m_out_memw_cb((offs_t)m_address[channel], data);
else
- {
logerror("8257: No memory write function defined.\n");
- }
+
m_address[channel]++;
m_count[channel]--;
- done = (m_count[channel] == 0xFFFF);
+ done = (m_count[channel] == 0xffff);
break;
+
case 0: /* verify */
m_address[channel]++;
m_count[channel]--;
- done = (m_count[channel] == 0xFFFF);
+ done = (m_count[channel] == 0xffff);
break;
+
default:
fatalerror("i8257_do_operation: invalid mode!\n");
break;
}
+
if (done)
{
if ((channel==2) && DMA_MODE_AUTOLOAD(m_mode))
@@ -238,7 +267,7 @@ int i8257_device::i8257_do_operation(int channel)
m_registers[5] = m_registers[7];
}
- m_out_tc_func(CLEAR_LINE);
+ m_out_tc_cb(CLEAR_LINE);
}
return done;
}
@@ -337,7 +366,7 @@ void i8257_device::i8257_update_status()
}
/* set the halt line */
- m_out_hrq_func(pending_transfer ? ASSERT_LINE : CLEAR_LINE);
+ m_out_hrq_cb(pending_transfer ? ASSERT_LINE : CLEAR_LINE);
}
diff --git a/src/emu/machine/8257dma.h b/src/emu/machine/8257dma.h
index 42b8cb6480d..7f524b21b58 100644
--- a/src/emu/machine/8257dma.h
+++ b/src/emu/machine/8257dma.h
@@ -40,54 +40,86 @@
#include "emu.h"
+#define I8257_NUM_CHANNELS (4)
+
/***************************************************************************
DEVICE CONFIGURATION MACROS
***************************************************************************/
-#define MCFG_I8257_ADD(_tag, _clock, _config) \
- MCFG_DEVICE_ADD(_tag, I8257, _clock) \
- MCFG_DEVICE_CONFIG(_config)
+#define MCFG_I8257_OUT_HRQ_CB(_devcb) \
+ devcb = &i8257_device::set_out_hrq_callback(*device, DEVCB2_##_devcb);
-#define I8257_INTERFACE(_name) \
- const i8257_interface (_name) =
+#define MCFG_I8257_OUT_TC_CB(_devcb) \
+ devcb = &i8257_device::set_out_tc_callback(*device, DEVCB2_##_devcb);
-#define I8257_NUM_CHANNELS (4)
+#define MCFG_I8257_OUT_MARK_CB(_devcb) \
+ devcb = &i8257_device::set_out_mark_callback(*device, DEVCB2_##_devcb);
-/***************************************************************************
- TYPE DEFINITIONS
-***************************************************************************/
+#define MCFG_I8257_IN_MEMR_CB(_devcb) \
+ devcb = &i8257_device::set_in_memr_callback(*device, DEVCB2_##_devcb);
+#define MCFG_I8257_OUT_MEMW_CB(_devcb) \
+ devcb = &i8257_device::set_out_memw_callback(*device, DEVCB2_##_devcb);
-// ======================> i8257_interface
-struct i8257_interface
-{
- devcb_write_line m_out_hrq_cb;
- devcb_write_line m_out_tc_cb;
- devcb_write_line m_out_mark_cb;
+#define MCFG_I8257_IN_IOR_0_CB(_devcb) \
+ devcb = &i8257_device::set_in_ior_0_callback(*device, DEVCB2_##_devcb);
- /* accessors to main memory */
- devcb_read8 m_in_memr_cb; // TODO m_in_memr_cb[I8257_NUM_CHANNELS];
- devcb_write8 m_out_memw_cb; // TODO m_out_memw_cb[I8257_NUM_CHANNELS];
+#define MCFG_I8257_IN_IOR_1_CB(_devcb) \
+ devcb = &i8257_device::set_in_ior_1_callback(*device, DEVCB2_##_devcb);
+
+#define MCFG_I8257_IN_IOR_2_CB(_devcb) \
+ devcb = &i8257_device::set_in_ior_2_callback(*device, DEVCB2_##_devcb);
+
+#define MCFG_I8257_IN_IOR_3_CB(_devcb) \
+ devcb = &i8257_device::set_in_ior_3_callback(*device, DEVCB2_##_devcb);
- /* channel accesors */
- devcb_read8 m_in_ior_cb[I8257_NUM_CHANNELS];
- devcb_write8 m_out_iow_cb[I8257_NUM_CHANNELS];
-};
+#define MCFG_I8257_OUT_IOW_0_CB(_devcb) \
+ devcb = &i8257_device::set_out_iow_0_callback(*device, DEVCB2_##_devcb);
+
+#define MCFG_I8257_OUT_IOW_1_CB(_devcb) \
+ devcb = &i8257_device::set_out_iow_1_callback(*device, DEVCB2_##_devcb);
+
+#define MCFG_I8257_OUT_IOW_2_CB(_devcb) \
+ devcb = &i8257_device::set_out_iow_2_callback(*device, DEVCB2_##_devcb);
+
+#define MCFG_I8257_OUT_IOW_3_CB(_devcb) \
+ devcb = &i8257_device::set_out_iow_3_callback(*device, DEVCB2_##_devcb);
+
+
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
// ======================> i8257_device
-class i8257_device : public device_t,
- public i8257_interface
+class i8257_device : public device_t
{
public:
// construction/destruction
i8257_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ template<class _Object> static devcb2_base &set_out_hrq_callback(device_t &device, _Object object) { return downcast<i8257_device &>(device).m_out_hrq_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_out_tc_callback(device_t &device, _Object object) { return downcast<i8257_device &>(device).m_out_tc_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_out_mark_callback(device_t &device, _Object object) { return downcast<i8257_device &>(device).m_out_mark_cb.set_callback(object); }
+
+ template<class _Object> static devcb2_base &set_in_memr_callback(device_t &device, _Object object) { return downcast<i8257_device &>(device).m_in_memr_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_out_memw_callback(device_t &device, _Object object) { return downcast<i8257_device &>(device).m_out_memw_cb.set_callback(object); }
+
+ template<class _Object> static devcb2_base &set_in_ior_0_callback(device_t &device, _Object object) { return downcast<i8257_device &>(device).m_in_ior_0_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_in_ior_1_callback(device_t &device, _Object object) { return downcast<i8257_device &>(device).m_in_ior_1_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_in_ior_2_callback(device_t &device, _Object object) { return downcast<i8257_device &>(device).m_in_ior_2_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_in_ior_3_callback(device_t &device, _Object object) { return downcast<i8257_device &>(device).m_in_ior_3_cb.set_callback(object); }
+
+ template<class _Object> static devcb2_base &set_out_iow_0_callback(device_t &device, _Object object) { return downcast<i8257_device &>(device).m_out_iow_0_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_out_iow_1_callback(device_t &device, _Object object) { return downcast<i8257_device &>(device).m_out_iow_1_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_out_iow_2_callback(device_t &device, _Object object) { return downcast<i8257_device &>(device).m_out_iow_2_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_out_iow_3_callback(device_t &device, _Object object) { return downcast<i8257_device &>(device).m_out_iow_3_cb.set_callback(object); }
+
/* register access */
DECLARE_READ8_MEMBER( i8257_r );
DECLARE_WRITE8_MEMBER( i8257_w );
@@ -107,7 +139,6 @@ public:
protected:
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -121,13 +152,23 @@ private:
void i8257_update_status();
void i8257_prepare_msb_flip();
- devcb_resolved_write_line m_out_hrq_func;
- devcb_resolved_write_line m_out_tc_func;
- devcb_resolved_write_line m_out_mark_func;
- devcb_resolved_read8 m_in_memr_func;
- devcb_resolved_write8 m_out_memw_func;
- devcb_resolved_read8 m_in_ior_func[I8257_NUM_CHANNELS];
- devcb_resolved_write8 m_out_iow_func[I8257_NUM_CHANNELS];
+ devcb2_write_line m_out_hrq_cb;
+ devcb2_write_line m_out_tc_cb;
+ devcb2_write_line m_out_mark_cb;
+
+ /* accessors to main memory */
+ devcb2_read8 m_in_memr_cb;
+ devcb2_write8 m_out_memw_cb;
+
+ /* channel accesors */
+ devcb2_read8 m_in_ior_0_cb;
+ devcb2_read8 m_in_ior_1_cb;
+ devcb2_read8 m_in_ior_2_cb;
+ devcb2_read8 m_in_ior_3_cb;
+ devcb2_write8 m_out_iow_0_cb;
+ devcb2_write8 m_out_iow_1_cb;
+ devcb2_write8 m_out_iow_2_cb;
+ devcb2_write8 m_out_iow_3_cb;
emu_timer *m_timer;
emu_timer *m_msbflip_timer;
diff --git a/src/emu/machine/aakart.c b/src/emu/machine/aakart.c
index 9f8db26a74d..e6884107f05 100644
--- a/src/emu/machine/aakart.c
+++ b/src/emu/machine/aakart.c
@@ -149,7 +149,6 @@ void aakart_device::device_timer(emu_timer &timer, device_timer_id id, int param
m_keyb_state = 0;
}
-
break;
case 0xfd:
m_rx = 0xfd;
diff --git a/src/emu/machine/roc10937.c b/src/emu/machine/roc10937.c
index f476ff9b0cd..2c4ad64fc0e 100644
--- a/src/emu/machine/roc10937.c
+++ b/src/emu/machine/roc10937.c
@@ -95,7 +95,7 @@ static const UINT16 roc10937charset[]=
// -.
0x2001, // 0010 0000 0000 0001 -
// /.
- 0x2430, // 0010 0010 0011 0000 <.
+ 0x2230, // 0010 0010 0011 0000 <.
0x4430, // 0100 0100 0011 0000 =.
0x8830, // 1000 1000 0011 0000 >.
0x1407, // 0001 0100 0000 0111 ?.
@@ -150,6 +150,8 @@ void rocvfd_t::device_start()
save_item(NAME(m_outputs));
save_item(NAME(m_brightness));
save_item(NAME(m_count));
+ save_item(NAME(m_sclk));
+ save_item(NAME(m_data));
save_item(NAME(m_duty));
save_item(NAME(m_disp));
@@ -168,6 +170,8 @@ void rocvfd_t::device_reset()
m_count=0;
m_duty=31;
m_disp = 0;
+ m_sclk = 0;
+ m_data = 0;
memset(m_chars, 0, sizeof(m_chars));
memset(m_outputs, 0, sizeof(m_outputs));
@@ -183,35 +187,60 @@ UINT32 rocvfd_t::set_display(UINT32 segin)
///////////////////////////////////////////////////////////////////////////
void rocvfd_t::device_post_load()
{
- for (int i =0; i<16; i++)
- {
- output_set_indexed_value("vfd", (m_port_val*16) + i, m_outputs[i]);
- }
+ update_display();
}
-//Display on Rockwell chips is naturally backwards, due to the way it is wired. We emulate this by flipping the display at update time
void rocvfd_t::update_display()
{
for (int i =0; i<16; i++)
{
- m_outputs[i] = set_display(m_chars[15-i]);
+ m_outputs[i] = set_display(m_chars[i]);
output_set_indexed_value("vfd", (m_port_val*16) + i, m_outputs[i]);
}
}
-void rocvfd_t::shift_data(int data)
+WRITE_LINE_MEMBER( rocvfd_t::sclk )
+{
+ shift_clock(state);
+}
+
+WRITE_LINE_MEMBER( rocvfd_t::data )
+{
+ m_data = state;
+}
+
+WRITE_LINE_MEMBER( rocvfd_t::por )
{
- m_shift_data <<= 1;
+ //If line goes low, reset mode is engaged, until such a time as it goes high again.
+ if (!state)
+ {
+ reset();
+ }
+}
- if ( !data ) m_shift_data |= 1;
- if ( ++m_shift_count >= 8 )
+void rocvfd_t::shift_clock(int state)
+{
+ if (m_sclk != state)
{
- write_char(m_shift_data);
- m_shift_count = 0;
- m_shift_data = 0;
+ //Clock data on FALLING edge
+ if (!m_sclk)
+ {
+ m_shift_data <<= 1;
+
+ if ( m_data ) m_shift_data |= 1;
+
+ if ( ++m_shift_count >= 8 )
+ {
+ write_char(m_shift_data);
+ m_shift_count = 0;
+ m_shift_data = 0;
+ }
+ update_display();
+
+ }
}
- update_display();
+ m_sclk = state;
}
///////////////////////////////////////////////////////////////////////////
@@ -355,13 +384,3 @@ s16lf01_t::s16lf01_t(const machine_config &mconfig, const char *tag, device_t *o
{
m_port_val=0;
}
-
-//Samsung chips fix the issue with the reversal of the drive.
-void s16lf01_t::update_display()
-{
- for (int i =0; i<16; i++)
- {
- m_outputs[i] = set_display(m_chars[i]);
- output_set_indexed_value("vfd", (m_port_val*16) + i, m_outputs[i]);
- }
-}
diff --git a/src/emu/machine/roc10937.h b/src/emu/machine/roc10937.h
index 538771c783c..120cd33bddb 100644
--- a/src/emu/machine/roc10937.h
+++ b/src/emu/machine/roc10937.h
@@ -54,10 +54,13 @@ public:
virtual void update_display();
UINT8 m_port_val;
void blank(int data);
- void shift_data(int data);
+ void shift_clock(int data);
void write_char(int data);
void setdata(int segdata, int data);
UINT32 set_display(UINT32 segin);
+ DECLARE_WRITE_LINE_MEMBER( sclk );
+ DECLARE_WRITE_LINE_MEMBER( data );
+ DECLARE_WRITE_LINE_MEMBER( por );
protected:
@@ -68,8 +71,10 @@ protected:
int m_pcursor_pos;
int m_brightness;
int m_count;
+ int m_data;
int m_duty;
int m_disp;
+ int m_sclk;
UINT8 m_cursor;
UINT32 m_chars[16];
UINT32 m_outputs[16];
@@ -109,8 +114,6 @@ protected:
class s16lf01_t : public rocvfd_t {
public:
s16lf01_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
- virtual void update_display();
protected:
};
diff --git a/src/emu/sound/tms36xx.c b/src/emu/sound/tms36xx.c
index dcf728b59f8..ac05910bfda 100644
--- a/src/emu/sound/tms36xx.c
+++ b/src/emu/sound/tms36xx.c
@@ -5,9 +5,6 @@
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
-#define VMIN 0x0000
-#define VMAX 0x7fff
-
/* the frequencies are later adjusted by "* clock / FSCALE" */
#define FSCALE 1024
@@ -338,8 +335,7 @@ tms36xx_device::tms36xx_device(const machine_config &mconfig, const char *tag, d
m_enable(0),
m_tune_num(0),
m_tune_ofs(0),
- m_tune_max(0),
- m_intf(NULL)
+ m_tune_max(0)
{
memset(m_vol, 0, sizeof(int)*12);
memset(m_vol_counter, 0, sizeof(int)*12);
@@ -355,24 +351,20 @@ tms36xx_device::tms36xx_device(const machine_config &mconfig, const char *tag, d
void tms36xx_device::device_start()
{
- int j;
- int enable;
-
- m_intf = (const tms36xx_interface *)static_config();
+ int enable = 0;
m_channel = stream_alloc(0, 1, clock() * 64);
m_samplerate = clock() * 64;
m_basefreq = clock();
- enable = 0;
- for (j = 0; j < 6; j++)
+
+ for (int j = 0; j < 6; j++)
{
- if( m_intf->decay[j] > 0 )
+ if (m_decay_time[j] > 0)
{
- m_decay[j+0] = m_decay[j+6] = VMAX / m_intf->decay[j];
+ m_decay[j+0] = m_decay[j+6] = VMAX / m_decay_time[j];
enable |= 0x41 << j;
}
}
- m_speed = (m_intf->speed > 0) ? VMAX / m_intf->speed : VMAX;
tms3617_enable(enable);
LOG(("TMS36xx samplerate %d\n", m_samplerate));
diff --git a/src/emu/sound/tms36xx.h b/src/emu/sound/tms36xx.h
index fc4c7c9bac6..d618fa50d9c 100644
--- a/src/emu/sound/tms36xx.h
+++ b/src/emu/sound/tms36xx.h
@@ -12,6 +12,15 @@
#define MCFG_TMS36XX_REPLACE(_tag, _clock) \
MCFG_DEVICE_REPLACE(_tag, TMS36XX, _clock)
+#define MCFG_TMS36XX_TYPE(_type) \
+ tms36xx_device::set_subtype(*device, _type);
+
+#define MCFG_TMS36XX_DECAY_TIMES(_dec0, _dec1, _dec2, _dec3, _dec4, _dec5) \
+ tms36xx_device::set_decays(*device, _dec0, _dec1, _dec2, _dec3, _dec4, _dec5);
+
+#define MCFG_TMS36XX_TUNE_SPEED(_speed) \
+ tms36xx_device::set_tune_speed(*device, _speed);
+
//**************************************************************************
// TYPE DEFINITIONS
@@ -22,15 +31,8 @@
#define TMS3615 15 // Naughty Boy, Pleiads (13 notes, one output)
#define TMS3617 17 // Monster Bash (13 notes, six outputs)
-
-// ======================> tms36xx_interface
-
-struct tms36xx_interface
-{
- int subtype;
- double decay[6]; // decay times for the six harmonic notes
- double speed; // tune speed (meaningful for the TMS3615 only)
-};
+#define VMIN 0x0000
+#define VMAX 0x7fff
// ======================> tms36xx_device
@@ -42,6 +44,40 @@ public:
tms36xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~tms36xx_device() { }
+ static void set_subtype(device_t &device, int type)
+ {
+ tms36xx_device &dev = downcast<tms36xx_device &>(device);
+ switch (type)
+ {
+ case MM6221AA:
+ dev.m_subtype = "MM6221AA";
+ break;
+ case TMS3615:
+ dev.m_subtype = "TMS3615";
+ break;
+ case TMS3617:
+ dev.m_subtype = "TMS3617";
+ break;
+ default:
+ fatalerror("Invalid TMS36XX type: %d\n", type);
+ break;
+ }
+ }
+ static void set_tune_speed(device_t &device, double speed)
+ {
+ downcast<tms36xx_device &>(device).m_speed = (speed > 0) ? VMAX / speed : VMAX;
+ }
+ static void set_decays(device_t &device, double decay_0, double decay_1, double decay_2, double decay_3, double decay_4, double decay_5)
+ {
+ tms36xx_device &dev = downcast<tms36xx_device &>(device);
+ dev.m_decay_time[0] = decay_0;
+ dev.m_decay_time[1] = decay_1;
+ dev.m_decay_time[2] = decay_2;
+ dev.m_decay_time[3] = decay_3;
+ dev.m_decay_time[4] = decay_4;
+ dev.m_decay_time[5] = decay_5;
+ }
+
protected:
// device-level overrides
virtual void device_start();
@@ -63,8 +99,9 @@ private:
void tms36xx_reset_counters();
void tms3617_enable(int enable);
-private:
- char *m_subtype; // subtype name MM6221AA, TMS3615 or TMS3617
+ double m_decay_time[6]; // decay times for the six harmonic notes
+
+ const char *m_subtype; // subtype name MM6221AA, TMS3615 or TMS3617
sound_stream *m_channel; // returned by stream_create()
int m_samplerate; // output sample rate
@@ -80,7 +117,7 @@ private:
int m_shift; // shift toggles between 0 and 6 to allow decaying voices
int m_vol[12]; // (decaying) volume of harmonics notes
int m_vol_counter[12];// volume adjustment counter
- int m_decay[12]; // volume adjustment rate - dervied from decay
+ int m_decay[12]; // volume adjustment rate - derived from m_intf_decay
int m_counter[12]; // tone frequency counter
int m_frequency[12]; // tone frequency
@@ -90,8 +127,6 @@ private:
int m_tune_num; // tune currently playing
int m_tune_ofs; // note currently playing
int m_tune_max; // end of tune
-
- const tms36xx_interface *m_intf;
};
extern const device_type TMS36XX;
diff --git a/src/lib/util/corefile.c b/src/lib/util/corefile.c
index 7c4c2630be1..70c3e706a3c 100644
--- a/src/lib/util/corefile.c
+++ b/src/lib/util/corefile.c
@@ -410,7 +410,7 @@ UINT32 core_fread(core_file *file, void *buffer, UINT32 length)
file->back_char_tail = 0;
/* handle real files */
- if (file->data == NULL)
+ if (file->length && file->data == NULL)
{
/* if we're within the buffer, consume that first */
if (file->offset >= file->bufferbase && file->offset < file->bufferbase + file->bufferbytes)
@@ -657,7 +657,7 @@ const void *core_fbuffer(core_file *file)
UINT32 read_length;
/* if we already have data, just return it */
- if (file->data != NULL)
+ if (file->data != NULL || !file->length)
return file->data;
/* allocate some memory */
diff --git a/src/mame/audio/segag80r.c b/src/mame/audio/segag80r.c
index b48a7f12732..9cc65bbd33a 100644
--- a/src/mame/audio/segag80r.c
+++ b/src/mame/audio/segag80r.c
@@ -711,14 +711,6 @@ static const samples_interface monsterb_samples_interface =
};
-static const tms36xx_interface monsterb_tms3617_interface =
-{
- TMS3617,
- {0.5,0.5,0.5,0.5,0.5,0.5} /* decay times of voices */
-};
-
-
-
/*************************************
*
* N7751 memory maps
@@ -769,7 +761,8 @@ MACHINE_CONFIG_FRAGMENT( monsterb_sound_board )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MCFG_TMS36XX_ADD("music", 247)
- MCFG_SOUND_CONFIG(monsterb_tms3617_interface)
+ MCFG_TMS36XX_TYPE(TMS3617)
+ MCFG_TMS36XX_DECAY_TIMES(0.5, 0.5, 0.5, 0.5, 0.5, 0.5)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MCFG_DAC_ADD("dac")
diff --git a/src/mame/drivers/bfm_sc1.c b/src/mame/drivers/bfm_sc1.c
index 1a4360a3cdf..02ed624a78b 100644
--- a/src/mame/drivers/bfm_sc1.c
+++ b/src/mame/drivers/bfm_sc1.c
@@ -355,7 +355,7 @@ READ8_MEMBER(bfm_sc1_state::nec_r)
WRITE8_MEMBER(bfm_sc1_state::vfd_w)
{
- int changed = m_vfd_latch ^ data;
+/* int changed = m_vfd_latch ^ data;
m_vfd_latch = data;
@@ -376,6 +376,10 @@ WRITE8_MEMBER(bfm_sc1_state::vfd_w)
}
}
}
+*/
+ m_vfd0->por(!(data & VFD_RESET));
+ m_vfd0->data(data & VFD_DATA);
+ m_vfd0->sclk(data & VFD_CLOCK1);
}
/////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mame/drivers/bfmsys85.c b/src/mame/drivers/bfmsys85.c
index 521d6b44a7a..c689dc614d4 100644
--- a/src/mame/drivers/bfmsys85.c
+++ b/src/mame/drivers/bfmsys85.c
@@ -259,22 +259,9 @@ WRITE8_MEMBER(bfmsys85_state::vfd_w)
{
//reset 0x20, clock 0x80, data 0x40
- if (data & 0x20)//inverted?
- {
- if (m_alpha_clock != (data & 0x80))
- {
- if (m_alpha_clock)//rising edge
- {
- m_vfd->shift_data(data & 0x40?1:0);
- }
- }
- m_alpha_clock = (data & 0x80);
- }
- else
- {
- m_vfd->reset();
- }
-
+ m_vfd->por(data & 0x20);//inverted?
+ m_vfd->sclk(data & 0x80);
+ m_vfd->data(data&0x40);
}
//////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mame/drivers/bladestl.c b/src/mame/drivers/bladestl.c
index 4f5738ee25a..78dd7099766 100644
--- a/src/mame/drivers/bladestl.c
+++ b/src/mame/drivers/bladestl.c
@@ -53,7 +53,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(bladestl_state::bladestl_scanline)
READ8_MEMBER(bladestl_state::trackball_r)
{
- static const char *const port[] = { "TRACKBALL_P1_1", "TRACKBALL_P1_2", "TRACKBALL_P2_1", "TRACKBALL_P1_2" };
+ static const char *const port[] = { "TRACKBALL_P1_1", "TRACKBALL_P1_2", "TRACKBALL_P2_1", "TRACKBALL_P2_2" };
int curr, delta;
curr = ioport(port[offset])->read();
diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c
index 74057de0e6a..515c1f6bba0 100644
--- a/src/mame/drivers/dkong.c
+++ b/src/mame/drivers/dkong.c
@@ -370,28 +370,6 @@ static Z80DMA_INTERFACE( dk3_dma )
DEVCB_NULL
};
-static I8257_INTERFACE( dk_dma )
-{
- DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_HALT),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_MEMBER(dkong_state, memory_read_byte),
- DEVCB_DRIVER_MEMBER(dkong_state, memory_write_byte),
- { DEVCB_NULL, DEVCB_DRIVER_MEMBER(dkong_state,p8257_ctl_r), DEVCB_NULL, DEVCB_NULL },
- { DEVCB_DRIVER_MEMBER(dkong_state,p8257_ctl_w), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }
-};
-
-static I8257_INTERFACE( hb_dma )
-{
- DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_HALT),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_MEMBER(dkong_state, hb_dma_read_byte),
- DEVCB_DRIVER_MEMBER(dkong_state, hb_dma_write_byte),
- { DEVCB_NULL, DEVCB_DRIVER_MEMBER(dkong_state,p8257_ctl_r), DEVCB_NULL, DEVCB_NULL },
- { DEVCB_DRIVER_MEMBER(dkong_state,p8257_ctl_w), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }
-};
-
/*************************************
*
* VBLANK and IRQ generation
@@ -1657,7 +1635,12 @@ static MACHINE_CONFIG_START( dkong_base, dkong_state )
MCFG_MACHINE_START_OVERRIDE(dkong_state,dkong2b)
MCFG_MACHINE_RESET_OVERRIDE(dkong_state,dkong)
- MCFG_I8257_ADD("dma8257", CLOCK_1H, dk_dma)
+ MCFG_DEVICE_ADD("dma8257", I8257, CLOCK_1H)
+ MCFG_I8257_OUT_HRQ_CB(INPUTLINE("maincpu", INPUT_LINE_HALT))
+ MCFG_I8257_IN_MEMR_CB(READ8(dkong_state, memory_read_byte))
+ MCFG_I8257_OUT_MEMW_CB(WRITE8(dkong_state, memory_write_byte))
+ MCFG_I8257_IN_IOR_1_CB(READ8(dkong_state, p8257_ctl_r))
+ MCFG_I8257_OUT_IOW_0_CB(WRITE8(dkong_state, p8257_ctl_w))
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1784,7 +1767,8 @@ static MACHINE_CONFIG_DERIVED( s2650, dkong2b )
MCFG_CPU_VBLANK_INT_DRIVER("screen", dkong_state, s2650_interrupt)
MCFG_DEVICE_MODIFY("dma8257")
- MCFG_DEVICE_CONFIG(hb_dma)
+ MCFG_I8257_IN_MEMR_CB(READ8(dkong_state, hb_dma_read_byte))
+ MCFG_I8257_OUT_MEMW_CB(WRITE8(dkong_state, hb_dma_write_byte))
MCFG_MACHINE_START_OVERRIDE(dkong_state,s2650)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/globalfr.c b/src/mame/drivers/globalfr.c
index 27c2078042c..a81a562adb3 100644
--- a/src/mame/drivers/globalfr.c
+++ b/src/mame/drivers/globalfr.c
@@ -7,7 +7,8 @@
Motherboard contains very few major components
Missing sound roms? (or is sound data in the program roms?)
- NOTE: VFD is guessed as Samsung 16 segment, need to know more
+ NOTE: VFD is guessed as Samsung 16 segment, like other Global products
+ need to know more
*******************************************************************************/
@@ -31,7 +32,6 @@ public:
optional_device<s16lf01_t> m_vfd;
// serial vfd
- int m_alpha_clock;
DECLARE_WRITE16_MEMBER(vfd_w);
@@ -41,23 +41,11 @@ public:
WRITE16_MEMBER(globalfr_state::vfd_w)
{
-// if(!(data & 0x20)) need to find reset
+// m_vfd->(data & 0x20) need to find reset
{
- int clock = (data & 0x40) != 0;
- int datline = (data & 0x80);
- if (m_alpha_clock != clock)
- {
- if (!m_alpha_clock)
- {
- m_vfd->shift_data(datline?1:0);
- }
- }
- m_alpha_clock = clock;
+ m_vfd->sclk((data&0x40));
+ m_vfd->data(!(data&0x80));
}
-// else
-// {
-// m_vfd->reset();
-// }
}
static ADDRESS_MAP_START( globalfr_map, AS_PROGRAM, 16, globalfr_state )
diff --git a/src/mame/drivers/jpmimpct.c b/src/mame/drivers/jpmimpct.c
index c1646475908..279f813ef94 100644
--- a/src/mame/drivers/jpmimpct.c
+++ b/src/mame/drivers/jpmimpct.c
@@ -957,22 +957,9 @@ WRITE8_MEMBER(jpmimpct_state::payen_a_w)
WRITE8_MEMBER(jpmimpct_state::display_c_w)
{
//Reset 0x04, data 0x02, clock 0x01
- if(data & 0x04)
- {
- int alpha_data = (data & 0x02)?0:1;
- if (m_alpha_clock != (data & 0x01))
- {
- if (!m_alpha_clock)//falling edge
- {
- m_vfd->shift_data(alpha_data);
- }
- }
- m_alpha_clock = (data & 0x01);
- }
- else
- {
- m_vfd->reset();
- }
+ m_vfd->por(data & 0x04);
+ m_vfd->data(data & 0x02);
+ m_vfd->sclk(data & 0x01);
}
static I8255_INTERFACE (ppi8255_intf)
diff --git a/src/mame/drivers/jpmsys5.c b/src/mame/drivers/jpmsys5.c
index ffdd04f2651..ee09dbcfd11 100644
--- a/src/mame/drivers/jpmsys5.c
+++ b/src/mame/drivers/jpmsys5.c
@@ -238,23 +238,10 @@ WRITE16_MEMBER(jpmsys5_state::jpm_upd7759_w)
}
case 1:
{
- //Reset 0x04, data 0x02, clock 0x01
- if(data & 0x04)
- {
- int alpha_data = (data & 0x02)?0:1;
- if (m_alpha_clock != (data & 0x01))
- {
- if (!m_alpha_clock)//falling edge
- {
- m_vfd->shift_data(alpha_data);
- }
- }
- m_alpha_clock = (data & 0x01);
- }
- else
- {
- m_vfd->reset();
- }
+ //Reset 0x04, data 0x02, clock
+ m_vfd->por(data & 0x04);
+ m_vfd->data(data & 0x02);
+ m_vfd->sclk(data & 0x01);
break;
}
case 2:
diff --git a/src/mame/drivers/maygay1b.c b/src/mame/drivers/maygay1b.c
index 6f398462edc..76d40392df5 100644
--- a/src/mame/drivers/maygay1b.c
+++ b/src/mame/drivers/maygay1b.c
@@ -147,21 +147,9 @@ WRITE8_MEMBER(maygay1b_state::m1_pia_porta_w)
{
// printf("m1_pia_porta_w %02x\n",data);
- if((data & 0x40))
- {
- if (m_alpha_clock != (data & 0x20))
- {
- if (!m_alpha_clock)
- {
- m_vfd->shift_data((data & 0x10)?0:1);
- }
- }
- m_alpha_clock = (data & 0x20);
- }
- else
- {
- m_vfd->reset();
- }
+ m_vfd->por(!data & 0x40);
+ m_vfd->data(data & 0x10);
+ m_vfd->sclk(data & 0x20);
}
WRITE8_MEMBER(maygay1b_state::m1_pia_portb_w)
diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c
index 38f1b847033..29955de2ea8 100644
--- a/src/mame/drivers/model2.c
+++ b/src/mame/drivers/model2.c
@@ -969,13 +969,18 @@ READ32_MEMBER(model2_state::daytona_unk_r)
return 0x00400000;
}
+#if 0
READ32_MEMBER(model2_state::desert_unk_r)
{
+ static UINT8 test;
+
+ test ^= 8;
// vcop needs bit 3 clear (infinite loop otherwise)
// desert needs other bits set (not sure which specifically)
// daytona needs the MSW to return ff
- return 0x00ff00f7;
+ return 0x00f700ff | (test << 16);
}
+#endif
READ32_MEMBER(model2_state::model2_irq_r)
{
@@ -1000,6 +1005,14 @@ WRITE32_MEMBER(model2_state::model2_irq_w)
}
m_intreq &= data;
+ UINT32 irq_ack = data ^ 0xffffffff;
+
+ if(irq_ack & 1<<0)
+ m_maincpu->set_input_line(I960_IRQ0, CLEAR_LINE);
+
+ if(irq_ack & 1<<10)
+ m_maincpu->set_input_line(I960_IRQ3, CLEAR_LINE);
+
}
READ32_MEMBER(model2_state::model2_serial_r)
@@ -1392,6 +1405,37 @@ static ADDRESS_MAP_START( model2_base_mem, AS_PROGRAM, 32, model2_state )
AM_RANGE(0x11680000, 0x116fffff) AM_RAM AM_SHARE("share1") // FB mirror
ADDRESS_MAP_END
+READ8_MEMBER(model2_state::virtuacop_lightgun_r)
+{
+ static const char *const ports[] = { "P1_Y", "P1_X", "P2_Y", "P2_X" };
+ UINT8 res;
+
+ res = (ioport(ports[offset >> 1])->read_safe(0) >> ((offset & 1)*8)) & 0xff;
+
+ return res;
+}
+
+/* handles offscreen gun trigger detection here */
+READ8_MEMBER(model2_state::virtuacop_lightgun_offscreen_r)
+{
+ UINT16 special_res = 0xfffc;
+ UINT16 p1x,p1y,p2x,p2y;
+
+ p1x = ioport("P1_X")->read_safe(0);
+ p1y = ioport("P1_Y")->read_safe(0);
+ p2x = ioport("P2_X")->read_safe(0);
+ p2y = ioport("P2_Y")->read_safe(0);
+
+ /* TODO: might be better, supposedly user has to calibrate guns in order to make these settings to work ... */
+ if(p1x <= 0x28 || p1x >= 0x3e0 || p1y <= 0x40 || p1y >= 0x3c0)
+ special_res |= 1;
+
+ if(p2x <= 0x28 || p2x >= 0x3e0 || p2y <= 0x40 || p2y >= 0x3c0)
+ special_res |= 2;
+
+ return (special_res >> ((offset & 1)*8)) & 0xff;
+}
+
/* original Model 2 overrides */
static ADDRESS_MAP_START( model2o_mem, AS_PROGRAM, 32, model2_state )
AM_RANGE(0x00200000, 0x0021ffff) AM_RAM
@@ -1415,8 +1459,10 @@ static ADDRESS_MAP_START( model2o_mem, AS_PROGRAM, 32, model2_state )
AM_RANGE(0x01c00004, 0x01c00007) AM_READ_PORT("1c00004")
AM_RANGE(0x01c00010, 0x01c00013) AM_READ_PORT("1c00010")
AM_RANGE(0x01c00014, 0x01c00017) AM_READ_PORT("1c00014")
- AM_RANGE(0x01c0001c, 0x01c0001f) AM_READ(desert_unk_r )
+ AM_RANGE(0x01c0001c, 0x01c0001f) AM_READ_PORT("1c0001c")
AM_RANGE(0x01c00040, 0x01c00043) AM_READ(daytona_unk_r )
+ AM_RANGE(0x01c00100, 0x01c0010f) AM_READ8(virtuacop_lightgun_r,0x00ff00ff)
+ AM_RANGE(0x01c00110, 0x01c00113) AM_READ8(virtuacop_lightgun_offscreen_r,0x00ff00ff)
AM_RANGE(0x01c00200, 0x01c002ff) AM_RAM AM_SHARE("backup2")
AM_RANGE(0x01c80000, 0x01c80003) AM_READWRITE(model2_serial_r, model2o_serial_w )
@@ -1584,6 +1630,10 @@ static INPUT_PORTS_START( desert )
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN2")
PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_START("1c0001c")
+ PORT_BIT( 0xfff7ffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
+
PORT_START("IN0")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_COIN2 )
@@ -1614,6 +1664,107 @@ static INPUT_PORTS_START( desert )
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(1)
INPUT_PORTS_END
+static INPUT_PORTS_START( vcop )
+ PORT_START("1c00000")
+ PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNKNOWN )
+
+ PORT_START("1c00004")
+ PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNKNOWN )
+
+ PORT_START("1c00010")
+ PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN0")
+ PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN1")
+
+ PORT_START("1c00014")
+ PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN2")
+ PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNKNOWN )
+
+ PORT_START("1c0001c")
+ PORT_BIT( 0xfff7ffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
+
+ PORT_START("IN0")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1 )
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_COIN2 )
+ PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1 )
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_START2 )
+ PORT_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("IN1")
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Trigger")
+ PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Trigger")
+ PORT_BIT( 0xfffc, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("IN2")
+ PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) // <- one bit here enables "debug mode"
+
+ PORT_START("TEST")
+ PORT_DIPNAME( 0x01, 0x00, "SYSA" )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x01, DEF_STR( On ) )
+ PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x02, DEF_STR( On ) )
+ PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x04, DEF_STR( On ) )
+ PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x08, DEF_STR( On ) )
+ PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x10, DEF_STR( On ) )
+ PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x20, DEF_STR( On ) )
+ PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x40, DEF_STR( On ) )
+ PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x80, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0100, 0x00, "SYSA" )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0100, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0200, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0200, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0400, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0400, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0800, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0800, DEF_STR( On ) )
+ PORT_DIPNAME( 0x1000, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x1000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x2000, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x2000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x4000, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x4000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x8000, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x8000, DEF_STR( On ) )
+
+ PORT_START("P1_X")
+ PORT_BIT( 0x3ff, 0x200, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX( 0, 0x3ff ) PORT_SENSITIVITY( 50 ) PORT_KEYDELTA( 15 ) PORT_PLAYER(1)
+
+ PORT_START("P1_Y")
+ PORT_BIT( 0x3ff, 0x200, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX( 0, 0x3ff ) PORT_SENSITIVITY( 50 ) PORT_KEYDELTA( 15 ) PORT_PLAYER(1)
+
+ PORT_START("P2_X")
+ PORT_BIT( 0x3ff, 0x200, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX( 0, 0x3ff ) PORT_SENSITIVITY( 50 ) PORT_KEYDELTA( 15 ) PORT_PLAYER(2)
+
+ PORT_START("P2_Y")
+ PORT_BIT( 0x3ff, 0x200, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX( 0, 0x3ff ) PORT_SENSITIVITY( 50 ) PORT_KEYDELTA( 15 ) PORT_PLAYER(2)
+INPUT_PORTS_END
+
static INPUT_PORTS_START( daytona )
PORT_START("1c00000")
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "STEER")
@@ -1631,6 +1782,11 @@ static INPUT_PORTS_START( daytona )
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN2")
PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_START("1c0001c")
+ PORT_BIT( 0xfff7ffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
+
+
PORT_START("IN0")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_COIN2 )
@@ -1784,14 +1940,14 @@ TIMER_DEVICE_CALLBACK_MEMBER(model2_state::model2_interrupt)
{
int scanline = param;
- if(scanline == 0) // 384
+ if(scanline == 384) // 384
{
m_intreq |= (1<<10);
if (m_intena & (1<<10))
m_maincpu->set_input_line(I960_IRQ3, ASSERT_LINE);
}
- if(scanline == 384/2)
+ if(scanline == 0)
{
m_intreq |= (1<<0);
if (m_intena & (1<<0))
@@ -1961,11 +2117,8 @@ static MACHINE_CONFIG_START( model2o, model2_state )
MCFG_S24TILE_DEVICE_PALETTE("palette")
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK )
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(62*8, 48*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 62*8-1, 0*8, 48*8-1)
+ MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
+ MCFG_SCREEN_RAW_PARAMS(25000000/2, 496+16, 0, 496, 384+16, 0, 384) // not accurate
MCFG_SCREEN_UPDATE_DRIVER(model2_state, screen_update_model2)
MCFG_PALETTE_ADD("palette", 8192)
@@ -5483,8 +5636,8 @@ GAME( 1993, daytonat, daytona, model2o, daytona, driver_device, 0, ROT0,
GAME( 1993, daytonata, daytona, model2o, daytona, driver_device, 0, ROT0, "Sega", "Daytona USA (Japan, Turbo hack, set 2)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
GAME( 1993, daytonam, daytona, model2o, daytona, model2_state, daytonam,ROT0, "Sega", "Daytona USA (Japan, To The MAXX)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
GAME( 1994, desert, 0, model2o, desert, driver_device, 0, ROT0, "Sega / Martin Marietta", "Desert Tank", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, vcop, 0, model2o, daytona, driver_device, 0, ROT0, "Sega", "Virtua Cop (Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, vcopa, 0, model2o, daytona, driver_device, 0, ROT0, "Sega", "Virtua Cop (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
+GAME( 1994, vcop, 0, model2o, vcop, driver_device, 0, ROT0, "Sega", "Virtua Cop (Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
+GAME( 1994, vcopa, 0, model2o, vcop, driver_device, 0, ROT0, "Sega", "Virtua Cop (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
// Model 2A-CRX (TGPs, SCSP sound board)
GAME( 1995, manxtt, 0, manxttdx,model2, driver_device, 0, ROT0, "Sega", "Manx TT Superbike - DX (Revision D)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
diff --git a/src/mame/drivers/mpu3.c b/src/mame/drivers/mpu3.c
index 8b6d4966a79..cc591d4cd31 100644
--- a/src/mame/drivers/mpu3.c
+++ b/src/mame/drivers/mpu3.c
@@ -136,8 +136,6 @@ public:
optional_device<roc10937_t> m_vfd;
-int m_alpha_data_line;
-int m_alpha_clock;
int m_triac_ic3;
int m_triac_ic4;
int m_triac_ic5;
@@ -595,18 +593,9 @@ READ8_MEMBER(mpu3_state::pia_ic6_portb_r)
WRITE8_MEMBER(mpu3_state::pia_ic6_porta_w)
{
LOG(("%s: IC6 PIA Port A Set to %2x (Alpha)\n", machine().describe_context(),data));
- if ( data & 0x08 ) m_vfd->reset();
-
- m_alpha_data_line = ((data & 0x20) >> 5);
-
- if (m_alpha_clock != ((data & 0x10) >>4))
- {
- if (!m_alpha_clock)//falling edge
- {
- m_vfd->shift_data(m_alpha_data_line?1:0);
- }
- }
- m_alpha_clock = (data & 0x10) >>4;
+ m_vfd->por((!data&0x08));
+ m_vfd->data((data & 0x20) >> 5);
+ m_vfd->sclk((data & 0x10) >>4);
}
WRITE8_MEMBER(mpu3_state::pia_ic6_portb_w)
diff --git a/src/mame/drivers/mpu4hw.c b/src/mame/drivers/mpu4hw.c
index 89507609517..6595149dd7b 100644
--- a/src/mame/drivers/mpu4hw.c
+++ b/src/mame/drivers/mpu4hw.c
@@ -645,8 +645,7 @@ WRITE8_MEMBER(mpu4_state::pia_ic3_portb_w)
WRITE_LINE_MEMBER(mpu4_state::pia_ic3_ca2_w)
{
LOG_IC3(("%s: IC3 PIA Write CA2 (alpha data), %02X\n", machine().describe_context(),state));
-
- m_alpha_data_line = state;
+ m_vfd->data(state);
}
@@ -654,10 +653,7 @@ WRITE_LINE_MEMBER(mpu4_state::pia_ic3_cb2_w)
{
LOG_IC3(("%s: IC3 PIA Write CB (alpha reset), %02X\n",machine().describe_context(),state));
// DM Data pin A
- if ( !state )
- {
- m_vfd->reset();
- }
+ m_vfd->por(state);
}
@@ -1346,14 +1342,8 @@ WRITE_LINE_MEMBER(mpu4_state::pia_ic8_cb2_w)
LOG_IC8(("%s: IC8 PIA write CB2 (alpha clock) %02X\n", machine().describe_context(), state & 0xFF));
// DM Data pin B
- if (m_alpha_clock != state)
- {
- if (!m_alpha_clock)//falling edge
- {
- m_vfd->shift_data(m_alpha_data_line?0:1);
- }
- }
- m_alpha_clock = state;
+
+ m_vfd->sclk(!state);
}
// universal sampled sound program card PCB 683077
diff --git a/src/mame/drivers/naughtyb.c b/src/mame/drivers/naughtyb.c
index 4ad810addec..6ae78ec3a09 100644
--- a/src/mame/drivers/naughtyb.c
+++ b/src/mame/drivers/naughtyb.c
@@ -402,22 +402,6 @@ static GFXDECODE_START( naughtyb )
GFXDECODE_END
-
-static const tms36xx_interface tms3615_interface =
-{
- TMS3615, /* TMS36xx subtype */
- /*
- * Decay times of the voices; NOTE: it's unknown if
- * the the TMS3615 mixes more than one voice internally.
- * A wav taken from Pop Flamer sounds like there
- * are at least no 'odd' harmonics (5 1/3' and 2 2/3')
- */
- {0.15,0.20,0,0,0,0}
-
-};
-
-
-
static MACHINE_CONFIG_START( naughtyb, naughtyb_state )
/* basic machine hardware */
@@ -442,7 +426,11 @@ static MACHINE_CONFIG_START( naughtyb, naughtyb_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_TMS36XX_ADD("tms", 350)
- MCFG_SOUND_CONFIG(tms3615_interface)
+ MCFG_TMS36XX_TYPE(TMS3615)
+ MCFG_TMS36XX_DECAY_TIMES(0.15, 0.20, 0, 0, 0, 0)
+ // NOTE: it's unknown if the TMS3615 mixes more than one voice internally.
+ // A wav taken from Pop Flamer sounds like there are at least no 'odd'
+ // harmonics (5 1/3' and 2 2/3')
MCFG_SOUND_ROUTE(0, "mono", 0.60)
MCFG_SOUND_ADD("naughtyb_custom", NAUGHTYB, 0)
@@ -475,7 +463,11 @@ static MACHINE_CONFIG_START( popflame, naughtyb_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_TMS36XX_ADD("tms", 350)
- MCFG_SOUND_CONFIG(tms3615_interface)
+ MCFG_TMS36XX_TYPE(TMS3615)
+ MCFG_TMS36XX_DECAY_TIMES(0.15, 0.20, 0, 0, 0, 0)
+ // NOTE: it's unknown if the TMS3615 mixes more than one voice internally.
+ // A wav taken from Pop Flamer sounds like there are at least no 'odd'
+ // harmonics (5 1/3' and 2 2/3')
MCFG_SOUND_ROUTE(0, "mono", 0.60)
MCFG_SOUND_ADD("popflame_custom", POPFLAME, 0)
diff --git a/src/mame/drivers/phoenix.c b/src/mame/drivers/phoenix.c
index 738de91e1c5..f3c8183312c 100644
--- a/src/mame/drivers/phoenix.c
+++ b/src/mame/drivers/phoenix.c
@@ -411,25 +411,6 @@ static GFXDECODE_START( pleiads )
GFXDECODE_END
-static const tms36xx_interface phoenix_tms36xx_interface =
-{
- MM6221AA, /* TMS36xx subtype(s) */
- {0.50,0,0,1.05,0,0}, /* decay times of voices */
- 0.21 /* tune speed (time between beats) */
-};
-
-static const tms36xx_interface pleiads_tms36xx_interface =
-{
- TMS3615, /* TMS36xx subtype(s) */
- /*
- * Decay times of the voices; NOTE: it's unknown if
- * the the TMS3615 mixes more than one voice internally.
- * A wav taken from Pop Flamer sounds like there
- * are at least no 'odd' harmonics (5 1/3' and 2 2/3')
- */
- {0.33,0.33,0,0.33,0,0.33}
-};
-
static const ay8910_interface survival_ay8910_interface =
{
AY8910_LEGACY_OUTPUT,
@@ -471,8 +452,10 @@ static MACHINE_CONFIG_START( phoenix, phoenix_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_TMS36XX_ADD("tms", 372)
- MCFG_SOUND_CONFIG(phoenix_tms36xx_interface)
+ MCFG_TMS36XX_ADD("tms", 372)
+ MCFG_TMS36XX_TYPE(MM6221AA)
+ MCFG_TMS36XX_DECAY_TIMES(0.50, 0, 0, 1.05, 0, 0)
+ MCFG_TMS36XX_TUNE_SPEED(0.21)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
MCFG_SOUND_ADD("cust", PHOENIX, 0)
@@ -498,7 +481,11 @@ static MACHINE_CONFIG_DERIVED( pleiads, phoenix )
/* sound hardware */
MCFG_TMS36XX_REPLACE("tms", 247)
- MCFG_SOUND_CONFIG(pleiads_tms36xx_interface)
+ MCFG_TMS36XX_TYPE(TMS3615)
+ MCFG_TMS36XX_DECAY_TIMES(0.33, 0.33, 0, 0.33, 0, 0.33)
+ // NOTE: it's unknown if the TMS3615 mixes more than one voice internally.
+ // A wav taken from Pop Flamer sounds like there are at least no 'odd'
+ // harmonics (5 1/3' and 2 2/3')
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
MCFG_DEVICE_REMOVE("cust")
diff --git a/src/mame/drivers/pinkiri8.c b/src/mame/drivers/pinkiri8.c
index 398ff7e2f93..aa1d7d25ac2 100644
--- a/src/mame/drivers/pinkiri8.c
+++ b/src/mame/drivers/pinkiri8.c
@@ -46,15 +46,15 @@ class pinkiri8_state : public driver_device
public:
pinkiri8_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_janshi_back_vram(*this, "back_vram"),
- m_janshi_vram1(*this, "vram1"),
- m_janshi_unk1(*this, "unk1"),
- m_janshi_widthflags(*this, "widthflags"),
- m_janshi_unk2(*this, "unk2"),
- m_janshi_vram2(*this, "vram2"),
- m_janshi_paletteram(*this, "paletteram"),
- m_janshi_paletteram2(*this, "paletteram2"),
- m_janshi_crtc_regs(*this, "crtc_regs"),
+ m_janshi_back_vram(*this, "janshivdp:back_vram"),
+ m_janshi_vram1(*this, "janshivdp:vram1"),
+ m_janshi_unk1(*this, "janshivdp:unk1"),
+ m_janshi_widthflags(*this, "janshivdp:widthflags"),
+ m_janshi_unk2(*this, "janshivdp:unk2"),
+ m_janshi_vram2(*this, "janshivdp:vram2"),
+ m_janshi_paletteram(*this, "janshivdp:paletteram"),
+ m_janshi_paletteram2(*this, "janshivdp:paletteram2"),
+ m_janshi_crtc_regs(*this, "janshivdp:crtc_regs"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
@@ -102,6 +102,7 @@ class janshi_vdp_device : public device_t,
{
public:
janshi_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ DECLARE_ADDRESS_MAP(map, 8);
protected:
virtual void device_config_complete();
virtual void device_validity_check(validity_checker &valid) const;
@@ -112,8 +113,7 @@ protected:
};
-static ADDRESS_MAP_START( janshi_vdp_map8, AS_0, 8, janshi_vdp_device )
-
+DEVICE_ADDRESS_MAP_START( map, 8, janshi_vdp_device )
AM_RANGE(0xfc0000, 0xfc1fff) AM_RAM AM_SHARE("back_vram") // bg tilemap?
AM_RANGE(0xfc2000, 0xfc2fff) AM_RAM AM_SHARE("vram1") // xpos, colour, tile number etc.
@@ -134,7 +134,7 @@ const device_type JANSHIVDP = &device_creator<janshi_vdp_device>;
janshi_vdp_device::janshi_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, JANSHIVDP, "JANSHIVDP", tag, owner, clock, "janshi_vdp", __FILE__),
device_memory_interface(mconfig, *this),
- m_space_config("janshi_vdp", ENDIANNESS_LITTLE, 8,24, 0, NULL, *ADDRESS_MAP_NAME(janshi_vdp_map8))
+ m_space_config("janshi_vdp", ENDIANNESS_LITTLE, 8,24, 0, address_map_delegate(FUNC(janshi_vdp_device::map), this))
{
}
diff --git a/src/mame/drivers/proconn.c b/src/mame/drivers/proconn.c
index 212f52d651d..c1951395197 100644
--- a/src/mame/drivers/proconn.c
+++ b/src/mame/drivers/proconn.c
@@ -332,18 +332,20 @@ static Z80CTC_INTERFACE( ctc_intf )
WRITE16_MEMBER(proconn_state::serial_transmit)
{
//Don't like the look of this, should be a clock somewhere
-// if (offset == 0)
-// m_vfd->write_char( data );
-
+
// should probably be in the pios above
- for (int i=0; i<8;i++)
+ if (offset == 0)
{
- m_vfd->shift_data( (data & (1<<i))?0:1 );
+ for (int i=0; i<8;i++)
+ {
+ m_vfd->data(data & (1<<i));
+ m_vfd->sclk(1);
+ m_vfd->sclk(0);
+ }
}
}
-
READ16_MEMBER(proconn_state::serial_receive)
{
logerror("proconn serial receive read %x",offset);
diff --git a/src/mame/includes/archimds.h b/src/mame/includes/archimds.h
index 66a963bd7ae..d7c622c0677 100644
--- a/src/mame/includes/archimds.h
+++ b/src/mame/includes/archimds.h
@@ -10,7 +10,7 @@
#include "machine/aakart.h"
#include "sound/dac.h"
#include "machine/i2cmem.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
// interrupt definitions. these are for the real Archimedes computer - arcade
// and gambling knockoffs likely are a bit different.
@@ -47,7 +47,9 @@ public:
m_kart(*this, "kart"),
m_maincpu(*this, "maincpu"),
m_i2cmem(*this, "i2cmem"),
- m_wd1772(*this, "wd1772"),
+ m_fdc(*this, "fdc"),
+ m_floppy0(*this, "fdc:0"),
+ m_floppy1(*this, "fdc:1"),
m_region_maincpu(*this, "maincpu"),
m_region_vram(*this, "vram"),
m_screen(*this, "screen"),
@@ -92,7 +94,9 @@ public:
protected:
required_device<cpu_device> m_maincpu;
optional_device<i2cmem_device> m_i2cmem;
- optional_device<wd1772_device> m_wd1772;
+ optional_device<wd1772_t> m_fdc;
+ optional_device<floppy_connector> m_floppy0;
+ optional_device<floppy_connector> m_floppy1;
required_memory_region m_region_maincpu;
required_memory_region m_region_vram;
required_device<screen_device> m_screen;
@@ -126,6 +130,7 @@ private:
UINT8 m_video_dma_on,m_audio_dma_on;
UINT8 m_vidc_pixel_clk;
UINT8 m_vidc_stereo_reg[8];
+ bool m_cursor_enabled;
emu_timer *m_timer[4], *m_snd_timer, *m_vid_timer;
emu_timer *m_vbl_timer;
};
diff --git a/src/mame/includes/maygay1b.h b/src/mame/includes/maygay1b.h
index fe4ea7d6e7c..39f76311ef0 100644
--- a/src/mame/includes/maygay1b.h
+++ b/src/mame/includes/maygay1b.h
@@ -60,7 +60,6 @@ public:
int m_old_lamp_strobe;
int m_lamp_strobe2;
int m_old_lamp_strobe2;
- int m_alpha_clock;
int m_RAMEN;
int m_ALARMEN;
int m_PSUrelay;
diff --git a/src/mame/includes/model2.h b/src/mame/includes/model2.h
index 3f13e68056c..d462e71cc87 100644
--- a/src/mame/includes/model2.h
+++ b/src/mame/includes/model2.h
@@ -196,6 +196,8 @@ public:
DECLARE_READ_LINE_MEMBER(copro_tgp_fifoin_pop_ok);
DECLARE_READ32_MEMBER(copro_tgp_fifoin_pop);
DECLARE_WRITE32_MEMBER(copro_tgp_fifoout_push);
+ DECLARE_READ8_MEMBER(virtuacop_lightgun_r);
+ DECLARE_READ8_MEMBER(virtuacop_lightgun_offscreen_r);
};
/*----------- defined in video/model2.c -----------*/
diff --git a/src/mame/includes/mpu4.h b/src/mame/includes/mpu4.h
index b807eb1e104..b44b1430bc1 100644
--- a/src/mame/includes/mpu4.h
+++ b/src/mame/includes/mpu4.h
@@ -250,8 +250,6 @@ protected:
int m_mod_number;
int m_mmtr_data;
- int m_alpha_data_line;
- int m_alpha_clock;
int m_ay8913_address;
int m_serial_data;
int m_signal_50hz;
diff --git a/src/mame/layout/mpu4.lay b/src/mame/layout/mpu4.lay
index dfc1e2097c6..7f22426d174 100644
--- a/src/mame/layout/mpu4.lay
+++ b/src/mame/layout/mpu4.lay
@@ -458,102 +458,102 @@
<backdrop name="digit7" element="digit" state="0">
<bounds x="356" y="200" width="8" height="10"/>
</backdrop>
- <backdrop name="vfd0" element="vfd0" state="0">
+ <backdrop name="vfd15" element="vfd0" state="0">
<bounds x="17" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd1" element="vfd0" state="0">
+ <backdrop name="vfd14" element="vfd0" state="0">
<bounds x="24" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd2" element="vfd0" state="0">
+ <backdrop name="vfd13" element="vfd0" state="0">
<bounds x="31" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd3" element="vfd0" state="0">
+ <backdrop name="vfd12" element="vfd0" state="0">
<bounds x="38" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd4" element="vfd0" state="0">
+ <backdrop name="vfd11" element="vfd0" state="0">
<bounds x="45" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd5" element="vfd0" state="0">
+ <backdrop name="vfd10" element="vfd0" state="0">
<bounds x="52" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd6" element="vfd0" state="0">
+ <backdrop name="vfd9" element="vfd0" state="0">
<bounds x="59" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd7" element="vfd0" state="0">
+ <backdrop name="vfd8" element="vfd0" state="0">
<bounds x="66" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd8" element="vfd0" state="0">
+ <backdrop name="vfd7" element="vfd0" state="0">
<bounds x="73" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd9" element="vfd0" state="0">
+ <backdrop name="vfd6" element="vfd0" state="0">
<bounds x="80" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd10" element="vfd0" state="0">
+ <backdrop name="vfd5" element="vfd0" state="0">
<bounds x="87" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd11" element="vfd0" state="0">
+ <backdrop name="vfd4" element="vfd0" state="0">
<bounds x="94" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd12" element="vfd0" state="0">
+ <backdrop name="vfd3" element="vfd0" state="0">
<bounds x="101" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd13" element="vfd0" state="0">
+ <backdrop name="vfd2" element="vfd0" state="0">
<bounds x="108" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd14" element="vfd0" state="0">
+ <backdrop name="vfd1" element="vfd0" state="0">
<bounds x="115" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd15" element="vfd0" state="0">
+ <backdrop name="vfd0" element="vfd0" state="0">
<bounds x="122" y="280" width="7" height="24"/>
</backdrop>
</view>
<view name="VFD Display Output Only">
- <bezel name="vfd0" element="vfd0" state="0">
+ <bezel name="vfd15" element="vfd0" state="0">
<bounds x="10" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd1" element="vfd0" state="0">
+ <bezel name="vfd14" element="vfd0" state="0">
<bounds x="19" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd2" element="vfd0" state="0">
+ <bezel name="vfd13" element="vfd0" state="0">
<bounds x="28" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd3" element="vfd0" state="0">
+ <bezel name="vfd12" element="vfd0" state="0">
<bounds x="37" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd4" element="vfd0" state="0">
+ <bezel name="vfd11" element="vfd0" state="0">
<bounds x="46" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd5" element="vfd0" state="0">
+ <bezel name="vfd10" element="vfd0" state="0">
<bounds x="55" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd6" element="vfd0" state="0">
+ <bezel name="vfd9" element="vfd0" state="0">
<bounds x="64" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd7" element="vfd0" state="0">
+ <bezel name="vfd8" element="vfd0" state="0">
<bounds x="73" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd8" element="vfd0" state="0">
+ <bezel name="vfd7" element="vfd0" state="0">
<bounds x="82" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd9" element="vfd0" state="0">
+ <bezel name="vfd6" element="vfd0" state="0">
<bounds x="91" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd10" element="vfd0" state="0">
+ <bezel name="vfd5" element="vfd0" state="0">
<bounds x="100" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd11" element="vfd0" state="0">
+ <bezel name="vfd4" element="vfd0" state="0">
<bounds x="109" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd12" element="vfd0" state="0">
+ <bezel name="vfd3" element="vfd0" state="0">
<bounds x="118" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd13" element="vfd0" state="0">
+ <bezel name="vfd2" element="vfd0" state="0">
<bounds x="127" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd14" element="vfd0" state="0">
+ <bezel name="vfd1" element="vfd0" state="0">
<bounds x="136" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd15" element="vfd0" state="0">
+ <bezel name="vfd0" element="vfd0" state="0">
<bounds x="145" y="200" width="9" height="17"/>
</bezel>
</view>
diff --git a/src/mame/layout/mpu4ext.lay b/src/mame/layout/mpu4ext.lay
index fe53b1a7d05..ff9afde6d0b 100644
--- a/src/mame/layout/mpu4ext.lay
+++ b/src/mame/layout/mpu4ext.lay
@@ -845,102 +845,102 @@
<backdrop name="digit39" element="digit" state="0">
<bounds x="356" y="244" width="8" height="10"/>
</backdrop>
- <backdrop name="vfd0" element="vfd0" state="0">
+ <backdrop name="vfd15" element="vfd0" state="0">
<bounds x="17" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd1" element="vfd0" state="0">
+ <backdrop name="vfd14" element="vfd0" state="0">
<bounds x="24" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd2" element="vfd0" state="0">
+ <backdrop name="vfd13" element="vfd0" state="0">
<bounds x="31" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd3" element="vfd0" state="0">
+ <backdrop name="vfd12" element="vfd0" state="0">
<bounds x="38" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd4" element="vfd0" state="0">
+ <backdrop name="vfd11" element="vfd0" state="0">
<bounds x="45" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd5" element="vfd0" state="0">
+ <backdrop name="vfd10" element="vfd0" state="0">
<bounds x="52" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd6" element="vfd0" state="0">
+ <backdrop name="vfd9" element="vfd0" state="0">
<bounds x="59" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd7" element="vfd0" state="0">
+ <backdrop name="vfd8" element="vfd0" state="0">
<bounds x="66" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd8" element="vfd0" state="0">
+ <backdrop name="vfd7" element="vfd0" state="0">
<bounds x="73" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd9" element="vfd0" state="0">
+ <backdrop name="vfd6" element="vfd0" state="0">
<bounds x="80" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd10" element="vfd0" state="0">
+ <backdrop name="vfd5" element="vfd0" state="0">
<bounds x="87" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd11" element="vfd0" state="0">
+ <backdrop name="vfd4" element="vfd0" state="0">
<bounds x="94" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd12" element="vfd0" state="0">
+ <backdrop name="vfd3" element="vfd0" state="0">
<bounds x="101" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd13" element="vfd0" state="0">
+ <backdrop name="vfd2" element="vfd0" state="0">
<bounds x="108" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd14" element="vfd0" state="0">
+ <backdrop name="vfd1" element="vfd0" state="0">
<bounds x="115" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd15" element="vfd0" state="0">
+ <backdrop name="vfd0" element="vfd0" state="0">
<bounds x="122" y="280" width="7" height="24"/>
</backdrop>
</view>
<view name="VFD Display Output Only">
- <bezel name="vfd0" element="vfd0" state="0">
+ <bezel name="vfd15" element="vfd0" state="0">
<bounds x="10" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd1" element="vfd0" state="0">
+ <bezel name="vfd14" element="vfd0" state="0">
<bounds x="19" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd2" element="vfd0" state="0">
+ <bezel name="vfd13" element="vfd0" state="0">
<bounds x="28" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd3" element="vfd0" state="0">
+ <bezel name="vfd12" element="vfd0" state="0">
<bounds x="37" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd4" element="vfd0" state="0">
+ <bezel name="vfd11" element="vfd0" state="0">
<bounds x="46" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd5" element="vfd0" state="0">
+ <bezel name="vfd10" element="vfd0" state="0">
<bounds x="55" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd6" element="vfd0" state="0">
+ <bezel name="vfd9" element="vfd0" state="0">
<bounds x="64" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd7" element="vfd0" state="0">
+ <bezel name="vfd8" element="vfd0" state="0">
<bounds x="73" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd8" element="vfd0" state="0">
+ <bezel name="vfd7" element="vfd0" state="0">
<bounds x="82" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd9" element="vfd0" state="0">
+ <bezel name="vfd6" element="vfd0" state="0">
<bounds x="91" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd10" element="vfd0" state="0">
+ <bezel name="vfd5" element="vfd0" state="0">
<bounds x="100" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd11" element="vfd0" state="0">
+ <bezel name="vfd4" element="vfd0" state="0">
<bounds x="109" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd12" element="vfd0" state="0">
+ <bezel name="vfd3" element="vfd0" state="0">
<bounds x="118" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd13" element="vfd0" state="0">
+ <bezel name="vfd2" element="vfd0" state="0">
<bounds x="127" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd14" element="vfd0" state="0">
+ <bezel name="vfd1" element="vfd0" state="0">
<bounds x="136" y="200" width="9" height="17"/>
</bezel>
- <bezel name="vfd15" element="vfd0" state="0">
+ <bezel name="vfd0" element="vfd0" state="0">
<bounds x="145" y="200" width="9" height="17"/>
</bezel>
</view>
diff --git a/src/mame/layout/mpu4plasma.lay b/src/mame/layout/mpu4plasma.lay
index aa8fa9b53ce..a53348153af 100644
--- a/src/mame/layout/mpu4plasma.lay
+++ b/src/mame/layout/mpu4plasma.lay
@@ -458,52 +458,52 @@
<backdrop name="digit7" element="digit" state="0">
<bounds x="356" y="200" width="8" height="10"/>
</backdrop>
- <backdrop name="vfd0" element="vfd0" state="0">
+ <backdrop name="vfd15" element="vfd0" state="0">
<bounds x="17" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd1" element="vfd0" state="0">
+ <backdrop name="vfd14" element="vfd0" state="0">
<bounds x="24" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd2" element="vfd0" state="0">
+ <backdrop name="vfd13" element="vfd0" state="0">
<bounds x="31" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd3" element="vfd0" state="0">
+ <backdrop name="vfd12" element="vfd0" state="0">
<bounds x="38" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd4" element="vfd0" state="0">
+ <backdrop name="vfd11" element="vfd0" state="0">
<bounds x="45" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd5" element="vfd0" state="0">
+ <backdrop name="vfd10" element="vfd0" state="0">
<bounds x="52" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd6" element="vfd0" state="0">
+ <backdrop name="vfd9" element="vfd0" state="0">
<bounds x="59" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd7" element="vfd0" state="0">
+ <backdrop name="vfd8" element="vfd0" state="0">
<bounds x="66" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd8" element="vfd0" state="0">
+ <backdrop name="vfd7" element="vfd0" state="0">
<bounds x="73" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd9" element="vfd0" state="0">
+ <backdrop name="vfd6" element="vfd0" state="0">
<bounds x="80" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd10" element="vfd0" state="0">
+ <backdrop name="vfd5" element="vfd0" state="0">
<bounds x="87" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd11" element="vfd0" state="0">
+ <backdrop name="vfd4" element="vfd0" state="0">
<bounds x="94" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd12" element="vfd0" state="0">
+ <backdrop name="vfd3" element="vfd0" state="0">
<bounds x="101" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd13" element="vfd0" state="0">
+ <backdrop name="vfd2" element="vfd0" state="0">
<bounds x="108" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd14" element="vfd0" state="0">
+ <backdrop name="vfd1" element="vfd0" state="0">
<bounds x="115" y="280" width="7" height="24"/>
</backdrop>
- <backdrop name="vfd15" element="vfd0" state="0">
+ <backdrop name="vfd0" element="vfd0" state="0">
<bounds x="122" y="280" width="7" height="24"/>
</backdrop>
diff --git a/src/mame/machine/archimds.c b/src/mame/machine/archimds.c
index e586b901e5f..ae24ee9e329 100644
--- a/src/mame/machine/archimds.c
+++ b/src/mame/machine/archimds.c
@@ -58,7 +58,7 @@ void archimedes_state::archimedes_request_irq_b(int mask)
if (m_ioc_regs[IRQ_STATUS_B] & m_ioc_regs[IRQ_MASK_B])
{
- generic_pulse_irq_line(m_maincpu, ARM_IRQ_LINE, 1);
+ m_maincpu->set_input_line(ARM_IRQ_LINE, HOLD_LINE);
}
}
@@ -66,9 +66,11 @@ void archimedes_state::archimedes_request_fiq(int mask)
{
m_ioc_regs[FIQ_STATUS] |= mask;
+ //printf("STATUS:%02x IRQ:%02x MASK:%02x\n",m_ioc_regs[FIQ_STATUS],mask,m_ioc_regs[FIQ_MASK]);
+
if (m_ioc_regs[FIQ_STATUS] & m_ioc_regs[FIQ_MASK])
{
- generic_pulse_irq_line(m_maincpu, ARM_FIRQ_LINE, 1);
+ m_maincpu->set_input_line(ARM_FIRQ_LINE, HOLD_LINE);
}
}
@@ -81,13 +83,13 @@ void archimedes_state::archimedes_clear_irq_a(int mask)
void archimedes_state::archimedes_clear_irq_b(int mask)
{
m_ioc_regs[IRQ_STATUS_B] &= ~mask;
- archimedes_request_irq_b(0);
+ //archimedes_request_irq_b(0);
}
void archimedes_state::archimedes_clear_fiq(int mask)
{
m_ioc_regs[FIQ_STATUS] &= ~mask;
- archimedes_request_fiq(0);
+ //archimedes_request_fiq(0);
}
void archimedes_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
@@ -138,10 +140,11 @@ void archimedes_state::vidc_video_tick()
offset_ptr = m_vidc_vidstart;
}
- size = m_vidc_vidend-m_vidc_vidstart+0x10;
-
- for(m_vidc_ccur = 0;m_vidc_ccur < 0x200;m_vidc_ccur++)
- m_cursor_vram[m_vidc_ccur] = (space.read_byte(m_vidc_cinit+m_vidc_ccur));
+ if(m_cursor_enabled == true)
+ {
+ for(m_vidc_ccur = 0;m_vidc_ccur < 0x200;m_vidc_ccur++)
+ m_cursor_vram[m_vidc_ccur] = (space.read_byte(m_vidc_cinit+m_vidc_ccur));
+ }
if(m_video_dma_on)
{
@@ -276,7 +279,7 @@ void archimedes_state::archimedes_reset()
}
m_ioc_regs[IRQ_STATUS_A] = 0x10 | 0x80; //set up POR (Power On Reset) and Force IRQ at start-up
- m_ioc_regs[IRQ_STATUS_B] = 0x02; //set up IL[1] On
+ m_ioc_regs[IRQ_STATUS_B] = 0x00; //set up IL[1] On
m_ioc_regs[FIQ_STATUS] = 0x80; //set up Force FIQ
m_ioc_regs[CONTROL] = 0xff;
}
@@ -685,9 +688,18 @@ READ32_MEMBER(archimedes_state::archimedes_ioc_r)
{
case 0: return ioc_ctrl_r(space,offset,mem_mask);
case 1:
- if (m_wd1772) {
- logerror("17XX: R @ addr %x mask %08x\n", offset*4, mem_mask);
- return m_wd1772->data_r(space, offset&0xf);
+ if (m_fdc)
+ {
+ //printf("17XX: R @ addr %x mask %08x\n", offset*4, mem_mask);
+ switch(ioc_addr & 0xc)
+ {
+ case 0x00: return m_fdc->status_r();
+ case 0x04: return m_fdc->track_r();
+ case 0x08: return m_fdc->sector_r();
+ case 0x0c: return m_fdc->data_r();
+ }
+
+ return 0;
} else {
logerror("Read from FDC device?\n");
return 0;
@@ -702,14 +714,21 @@ READ32_MEMBER(archimedes_state::archimedes_ioc_r)
logerror("IOC: Internal Podule Read\n");
return 0xffff;
case 5:
- if (m_wd1772) {
+ if (m_fdc)
+ {
switch(ioc_addr & 0xfffc)
{
+ case 0x18: return 0xff; // FDC latch B
+ case 0x40: return 0xff; // FDC latch A
case 0x50: return 0; //fdc type, new model returns 5 here
+ case 0x70: return 0x0F;
+ case 0x74: return 0xFF; // unknown
+// case 0x78: /* joystick */
+// case 0x7c:
}
}
- logerror("IOC: Internal Latches Read %08x\n",ioc_addr);
+ //printf("IOC: Internal Latches Read %08x\n",ioc_addr);
return 0xffff;
}
@@ -740,10 +759,30 @@ WRITE32_MEMBER(archimedes_state::archimedes_ioc_w)
{
case 0: ioc_ctrl_w(space,offset,data,mem_mask); return;
case 1:
- if (m_wd1772) {
- logerror("17XX: %x to addr %x mask %08x\n", data, offset*4, mem_mask);
- m_wd1772->data_w(space, offset&0xf, data&0xff);
- } else {
+ if (m_fdc)
+ {
+ //printf("17XX: %x to addr %x mask %08x\n", data, offset*4, mem_mask);
+ switch(ioc_addr & 0xc)
+ {
+ case 0x00:
+ m_fdc->cmd_w(data);
+ return;
+
+ case 0x04:
+ m_fdc->track_w(data);
+ return;
+
+ case 0x08:
+ m_fdc->sector_w(data);
+ return;
+
+ case 0x0c:
+ m_fdc->data_w(data);
+ return;
+ }
+ }
+ else
+ {
logerror("Write to FDC device?\n");
}
return;
@@ -757,23 +796,34 @@ WRITE32_MEMBER(archimedes_state::archimedes_ioc_w)
logerror("IOC: Internal Podule Write\n");
return;
case 5:
- if (m_wd1772) {
+ if (m_fdc)
+ {
switch(ioc_addr & 0xfffc)
{
case 0x18: // latch B
- m_wd1772->dden_w(BIT(data, 1));
+ m_fdc->dden_w(BIT(data, 1));
return;
case 0x40: // latch A
- if (data & 1) { m_wd1772->set_drive(0); }
- if (data & 2) { m_wd1772->set_drive(1); }
- if (data & 4) { m_wd1772->set_drive(2); }
- if (data & 8) { m_wd1772->set_drive(3); }
+ floppy_image_device *floppy = NULL;
- m_wd1772->set_side((data & 0x10)>>4);
+ if (!(data & 1)) { floppy = m_floppy0->get_device(); }
+ if (!(data & 2)) { floppy = m_floppy1->get_device(); }
+ if (!(data & 4)) { floppy = NULL; } // floppy 2
+ if (!(data & 8)) { floppy = NULL; } // floppy 3
+
+ m_fdc->set_floppy(floppy);
+
+ if(floppy)
+ {
+ floppy->mon_w(BIT(data, 5));
+ floppy->ss_w(!(BIT(data, 4)));
+ }
//bit 5 is motor on
return;
}
+
+ //printf("%08x\n",ioc_addr);
}
break;
}
@@ -920,6 +970,7 @@ WRITE32_MEMBER(archimedes_state::archimedes_vidc_w)
//#ifdef MAME_DEBUG
+ if(1)
logerror("VIDC: %s = %d\n", vrnames[(reg-0x80)/4], m_vidc_regs[reg]);
//#endif
@@ -953,6 +1004,7 @@ WRITE32_MEMBER(archimedes_state::archimedes_memc_w)
switch ((data >> 17) & 7)
{
case 0: /* video init */
+ m_cursor_enabled = false;
m_vidc_vidinit = ((data>>2)&0x7fff)*16;
//printf("MEMC: VIDINIT %08x\n",m_vidc_vidinit);
break;
@@ -968,8 +1020,9 @@ WRITE32_MEMBER(archimedes_state::archimedes_memc_w)
break;
case 3: /* cursor init */
+ //m_cursor_enabled = true;
m_vidc_cinit = 0x2000000 | (((data>>2)&0x7fff)*16);
- //printf("MEMC: CURSOR %08x\n",((data>>2)&0x7fff)*16);
+ //printf("MEMC: CURSOR INIT %08x\n",((data>>2)&0x7fff)*16);
break;
case 4: /* sound start */
diff --git a/src/mame/machine/bfm_bd1.c b/src/mame/machine/bfm_bd1.c
index 9c6cff33a12..635d7f43f0b 100644
--- a/src/mame/machine/bfm_bd1.c
+++ b/src/mame/machine/bfm_bd1.c
@@ -130,6 +130,8 @@ void bfm_bd1_t::device_start()
save_item(NAME(m_outputs));
save_item(NAME(m_user_data)); // user defined character data (16 bit)
save_item(NAME(m_user_def)); // user defined character state
+ save_item(NAME(m_sclk));
+ save_item(NAME(m_data));
device_reset();
}
@@ -150,6 +152,8 @@ void bfm_bd1_t::device_reset()
m_flash_control = 0;
m_user_data = 0;
m_user_def = 0;
+ m_sclk = 0;
+ m_data = 0;
memset(m_chars, 0, sizeof(m_chars));
memset(m_outputs, 0, sizeof(m_outputs));
@@ -163,10 +167,7 @@ UINT16 bfm_bd1_t::set_display(UINT16 segin)
void bfm_bd1_t::device_post_load()
{
- for (int i =0; i<16; i++)
- {
- output_set_indexed_value("vfd", (m_port_val*16) + i, m_outputs[i]);
- }
+ update_display();
}
void bfm_bd1_t::update_display()
@@ -535,16 +536,36 @@ void bfm_bd1_t::setdata(int segdata, int data)
}
}
-void bfm_bd1_t::shift_data(int data)
+void bfm_bd1_t::shift_clock(int state)
{
- m_shift_data <<= 1;
+ if (m_sclk != state)
+ {
+ if (!m_sclk)
+ {
+ m_shift_data <<= 1;
+
+ if ( !m_data ) m_shift_data |= 1;
- if ( !data ) m_shift_data |= 1;
+ if ( ++m_shift_count >= 8 )
+ {
+ write_char(m_shift_data);
+ m_shift_count = 0;
+ m_shift_data = 0;
+ }
+ update_display();
+
+ }
+ }
+ m_sclk = state;
+}
- if ( ++m_shift_count >= 8 )
+WRITE_LINE_MEMBER( bfm_bd1_t::sclk ) { shift_clock(state); }
+WRITE_LINE_MEMBER( bfm_bd1_t::data ) { m_data = state; }
+
+WRITE_LINE_MEMBER( bfm_bd1_t::por )
+{
+ if (!state)
{
- write_char(m_shift_data);
- m_shift_count = 0;
- m_shift_data = 0;
+ reset();
}
}
diff --git a/src/mame/machine/bfm_bd1.h b/src/mame/machine/bfm_bd1.h
index ae40cae1e5a..212fac803de 100644
--- a/src/mame/machine/bfm_bd1.h
+++ b/src/mame/machine/bfm_bd1.h
@@ -23,9 +23,12 @@ public:
UINT8 m_port_val;
void blank(int data);
- void shift_data(int data);
+ void shift_clock(int state);
void setdata(int segdata, int data);
UINT16 set_display(UINT16 segin);
+ DECLARE_WRITE_LINE_MEMBER( sclk );
+ DECLARE_WRITE_LINE_MEMBER( data );
+ DECLARE_WRITE_LINE_MEMBER( por );
protected:
static const UINT8 AT_NORMAL = 0x00;
@@ -44,6 +47,9 @@ protected:
int m_display_mode;
int m_flash_rate;
int m_flash_control;
+ int m_sclk;
+ int m_data;
+
UINT8 m_cursor;
UINT16 m_chars[16];
UINT16 m_outputs[16];
diff --git a/src/mame/machine/pcshare.c b/src/mame/machine/pcshare.c
index 9d0c5bfd412..636889e861a 100644
--- a/src/mame/machine/pcshare.c
+++ b/src/mame/machine/pcshare.c
@@ -164,24 +164,8 @@ WRITE_LINE_MEMBER( pcat_base_state::at_pit8254_out2_changed )
m_kbdc->write_out2(state);
}
-/*************************************************************
- *
- * Keyboard
- *
- *************************************************************/
-static const struct kbdc8042_interface at8042 =
-{
- KBDC8042_AT386,
- DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_RESET),
- DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_A20),
- DEVCB_DEVICE_LINE_MEMBER("pic8259_1", pic8259_device, ir1_w),
- DEVCB_NULL,
-
- DEVCB_NULL
-};
-
-ADDRESS_MAP_START( pcat32_io_common, AS_IO, 32, pcat_base_state )
+ ADDRESS_MAP_START( pcat32_io_common, AS_IO, 32, pcat_base_state )
AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8("dma8237_1", am9517a_device, read, write, 0xffffffff)
AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE8("pic8259_1", pic8259_device, read, write, 0xffffffff)
AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8("pit8254", pit8254_device, read, write, 0xffffffff)
@@ -209,5 +193,9 @@ MACHINE_CONFIG_FRAGMENT(pcat_common)
MCFG_MC146818_IRQ_HANDLER(DEVWRITELINE("pic8259_2", pic8259_device, ir0_w))
MCFG_MC146818_CENTURY_INDEX(0x32)
- MCFG_KBDC8042_ADD("kbdc", at8042)
+ MCFG_DEVICE_ADD("kbdc", KBDC8042, 0)
+ MCFG_KBDC8042_KEYBOARD_TYPE(KBDC8042_AT386)
+ MCFG_KBDC8042_SYSTEM_RESET_CB(INPUTLINE("maincpu", INPUT_LINE_RESET))
+ MCFG_KBDC8042_GATE_A20_CB(INPUTLINE("maincpu", INPUT_LINE_A20))
+ MCFG_KBDC8042_INPUT_BUFFER_FULL_CB(DEVWRITELINE("pic8259_1", pic8259_device, ir1_w))
MACHINE_CONFIG_END
diff --git a/src/mame/video/archimds.c b/src/mame/video/archimds.c
index 757b864a79f..ed203f0b44f 100644
--- a/src/mame/video/archimds.c
+++ b/src/mame/video/archimds.c
@@ -176,7 +176,7 @@ UINT32 archimedes_state::screen_update(screen_device &screen, bitmap_rgb32 &bitm
}
- if(0)
+ if(m_cursor_enabled == true)
{
count = 0;
for(y=0;y<16;y++)
diff --git a/src/mess/drivers/a310.c b/src/mess/drivers/a310.c
index fa67bde4a1d..a3fb724afdb 100644
--- a/src/mess/drivers/a310.c
+++ b/src/mess/drivers/a310.c
@@ -15,6 +15,7 @@
* \- some subtle memory paging fault
* \- missing RAM max size
* \- ARM bug?
+ * - 38776b8
*
*
=======================================================================================
@@ -58,14 +59,14 @@
#include "emu.h"
-#include "machine/wd17xx.h"
-#include "imagedev/flopdrv.h"
#include "cpu/arm/arm.h"
#include "sound/dac.h"
#include "includes/archimds.h"
#include "machine/i2cmem.h"
//#include "machine/aakart.h"
#include "machine/ram.h"
+#include "machine/wd_fdc.h"
+#include "formats/applix_dsk.h"
class a310_state : public archimedes_state
@@ -87,6 +88,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
DECLARE_INPUT_CHANGED_MEMBER(key_stroke);
+ DECLARE_FLOPPY_FORMATS( floppy_formats );
protected:
@@ -96,16 +98,22 @@ protected:
WRITE_LINE_MEMBER(a310_state::a310_wd177x_intrq_w)
{
+ printf("%d IRQ\n",state);
if (state)
+ {
archimedes_request_fiq(ARCHIMEDES_FIQ_FLOPPY);
+ }
else
archimedes_clear_fiq(ARCHIMEDES_FIQ_FLOPPY);
}
WRITE_LINE_MEMBER(a310_state::a310_wd177x_drq_w)
{
+ printf("%d DRQ\n",state);
if (state)
+ {
archimedes_request_fiq(ARCHIMEDES_FIQ_FLOPPY_DRQ);
+ }
else
archimedes_clear_fiq(ARCHIMEDES_FIQ_FLOPPY_DRQ);
}
@@ -202,7 +210,7 @@ static INPUT_PORTS_START( a310 )
PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("= +") PORT_CODE(KEYCODE_EQUALS) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x1c) PORT_IMPULSE(1)
PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("` ~") PORT_CODE(KEYCODE_TILDE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x10) PORT_IMPULSE(1)
PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("BACK SPACE") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x1e) PORT_IMPULSE(1)
- PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB)
+ PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x26) PORT_IMPULSE(1)
PORT_START("key2") /* KEY ROW 2 */
PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("q Q") PORT_CODE(KEYCODE_Q) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x27) PORT_IMPULSE(1)
@@ -221,7 +229,7 @@ static INPUT_PORTS_START( a310 )
PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("] }") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x32) PORT_IMPULSE(1)
PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x47) PORT_IMPULSE(1)
PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("DEL") PORT_CODE(KEYCODE_DEL)
- PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL)
+ PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x61) PORT_IMPULSE(1)
PORT_BIT(0x80, 0x80, IPT_KEYBOARD) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE
PORT_START("key4") /* KEY ROW 4 */
@@ -252,11 +260,11 @@ static INPUT_PORTS_START( a310 )
PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x55) PORT_IMPULSE(1)
PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x56) PORT_IMPULSE(1)
PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("/ ?") PORT_CODE(KEYCODE_SLASH) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x23) PORT_IMPULSE(1)
- PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("SHIFT (R)") PORT_CODE(KEYCODE_RSHIFT)
+ PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("SHIFT (R)") PORT_CODE(KEYCODE_RSHIFT) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x58) PORT_IMPULSE(1)
PORT_START("key7") /* KEY ROW 7 */
PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("LINE FEED")
- PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x26) PORT_IMPULSE(1)
+ PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x5f) PORT_IMPULSE(1)
PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("- (KP)") PORT_CODE(KEYCODE_MINUS_PAD)
PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME(", (KP)") PORT_CODE(KEYCODE_PLUS_PAD)
PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("ENTER (KP)") PORT_CODE(KEYCODE_ENTER_PAD)
@@ -279,6 +287,27 @@ static INPUT_PORTS_START( a310 )
PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("*") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x24) PORT_IMPULSE(1) // (KP?)
PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("#") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x25) PORT_IMPULSE(1) // (KP?)
+ PORT_START("keya")
+ PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x01) PORT_IMPULSE(1)
+ PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x02) PORT_IMPULSE(1)
+ PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x03) PORT_IMPULSE(1)
+ PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x04) PORT_IMPULSE(1)
+ PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x05) PORT_IMPULSE(1)
+ PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_F6) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x06) PORT_IMPULSE(1)
+ PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x07) PORT_IMPULSE(1)
+ PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("F8") PORT_CODE(KEYCODE_F8) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x08) PORT_IMPULSE(1)
+
+ PORT_START("keyb")
+ PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("F9") PORT_CODE(KEYCODE_F9) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x09) PORT_IMPULSE(1)
+ PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("F10") PORT_CODE(KEYCODE_F10) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x0a) PORT_IMPULSE(1)
+ PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("F11") PORT_CODE(KEYCODE_F11) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x0b) PORT_IMPULSE(1)
+ PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("F12") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x0c) PORT_IMPULSE(1)
+// PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x05) PORT_IMPULSE(1)
+// PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_F6) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x06) PORT_IMPULSE(1)
+// PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x07) PORT_IMPULSE(1)
+// PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("F8") PORT_CODE(KEYCODE_F8) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x08) PORT_IMPULSE(1)
+
+
PORT_START("via1a") /* VIA #1 PORT A */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START) PORT_PLAYER(1)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START) PORT_PLAYER(2)
@@ -296,13 +325,13 @@ static INPUT_PORTS_START( a310 )
PORT_BIT (0xf8, 0x80, IPT_UNUSED)
INPUT_PORTS_END
-static const wd17xx_interface a310_wd17xx_interface =
-{
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(a310_state, a310_wd177x_intrq_w),
- DEVCB_DRIVER_LINE_MEMBER(a310_state, a310_wd177x_drq_w),
- {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
-};
+FLOPPY_FORMATS_MEMBER( a310_state::floppy_formats )
+ FLOPPY_APPLIX_FORMAT
+FLOPPY_FORMATS_END
+
+static SLOT_INTERFACE_START( a310_floppies )
+ SLOT_INTERFACE( "35dd", FLOPPY_35_DD )
+SLOT_INTERFACE_END
WRITE_LINE_MEMBER( archimedes_state::a310_kart_tx_w )
{
@@ -331,13 +360,14 @@ static ARM_INTERFACE( a310_config )
ARM_COPRO_TYPE_VL86C020
};
+
static MACHINE_CONFIG_START( a310, a310_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", ARM, 8000000) /* 8 MHz */
MCFG_CPU_PROGRAM_MAP(a310_mem)
MCFG_CPU_CONFIG(a310_config)
- MCFG_AAKART_ADD("kart", 8000000/256, kart_interface) // TODO: frequency
+ MCFG_AAKART_ADD("kart", 8000000/256, kart_interface)
MCFG_I2CMEM_ADD("i2cmem")
MCFG_I2CMEM_DATA_SIZE(0x100)
@@ -356,9 +386,11 @@ static MACHINE_CONFIG_START( a310, a310_state )
MCFG_RAM_DEFAULT_SIZE("2M")
MCFG_RAM_EXTRA_OPTIONS("512K, 1M, 4M, 8M, 16M")
- MCFG_WD1772_ADD("wd1772", a310_wd17xx_interface )
-
- //MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(a310_floppy_interface)
+ MCFG_WD1772x_ADD("fdc", 8000000 / 1) // TODO: frequency
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE( a310_state, a310_wd177x_intrq_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(a310_state, a310_wd177x_drq_w))
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", a310_floppies, "35dd", a310_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", a310_floppies, "35dd", a310_state::floppy_formats)
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("dac0", DAC, 0)
diff --git a/src/mess/drivers/apogee.c b/src/mess/drivers/apogee.c
index f4ca10519a5..0327c493e18 100644
--- a/src/mess/drivers/apogee.c
+++ b/src/mess/drivers/apogee.c
@@ -237,7 +237,11 @@ static MACHINE_CONFIG_START( apogee, apogee_state )
MCFG_SOUND_CONFIG(apogee_speaker_interface)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
- MCFG_I8257_ADD("dma8257", XTAL_16MHz / 9, radio86_dma)
+ MCFG_DEVICE_ADD("dma8257", I8257, XTAL_16MHz / 9)
+ MCFG_I8257_OUT_HRQ_CB(WRITELINE(radio86_state, hrq_w))
+ MCFG_I8257_IN_MEMR_CB(READ8(radio86_state, memory_read_byte))
+ MCFG_I8257_OUT_MEMW_CB(WRITE8(radio86_state, memory_write_byte))
+ MCFG_I8257_OUT_IOW_2_CB(DEVWRITE8("i8275", i8275_device, dack_w))
MCFG_CASSETTE_ADD( "cassette", apogee_cassette_interface )
MCFG_SOFTWARE_LIST_ADD("cass_list","apogee")
diff --git a/src/mess/drivers/apple3.c b/src/mess/drivers/apple3.c
index 59b2ad0adb9..407abb861fd 100644
--- a/src/mess/drivers/apple3.c
+++ b/src/mess/drivers/apple3.c
@@ -121,11 +121,14 @@ static MACHINE_CONFIG_START( apple3, apple3_state )
MCFG_RS232_DSR_HANDLER(DEVWRITELINE("acia", mos6551_device, write_dsr))
// TODO: remove cts kludge from machine/apple3.c and come up with a good way of coping with pull up resistors.
+ /* paddle */
+ MCFG_TIMER_DRIVER_ADD("pdltimer", apple3_state, paddle_timer);
+
/* rtc */
MCFG_DEVICE_ADD("rtc", MM58167, XTAL_32_768kHz)
/* via */
- MCFG_DEVICE_ADD("via6522_0", VIA6522, 1000000)
+ MCFG_DEVICE_ADD("via6522_0", VIA6522, 2000000)
MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(apple3_state, apple3_via_0_out_a))
MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(apple3_state, apple3_via_0_out_b))
MCFG_VIA6522_IRQ_HANDLER(WRITELINE(apple3_state, apple3_via_0_irq_func))
@@ -313,6 +316,28 @@ static INPUT_PORTS_START( apple3 )
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Open Apple") PORT_CODE(KEYCODE_LALT)
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Solid Apple") PORT_CODE(KEYCODE_RALT)
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET") PORT_CODE(KEYCODE_F12)
+
+ PORT_START("joy_1_x") /* Joystick 1 X Axis */
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_NAME("P1 Joystick X")
+ PORT_MINMAX(0, 0xff) PORT_PLAYER(1)
+
+ PORT_START("joy_1_y") /* Joystick 1 Y Axis */
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_NAME("P1 Joystick Y")
+ PORT_MINMAX(0,0xff) PORT_PLAYER(1)
+
+ PORT_START("joy_2_x") /* Joystick 2 X Axis */
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_NAME("P2 Joystick X")
+ PORT_MINMAX(0,0xff) PORT_PLAYER(2)
+
+ PORT_START("joy_2_y") /* Joystick 2 Y Axis */
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_NAME("P2 Joystick Y")
+ PORT_MINMAX(0,0xff) PORT_PLAYER(2)
+
+ PORT_START("joy_buttons")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1) PORT_NAME("Joystick 1 Button 1")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_PLAYER(1) PORT_NAME("Joystick 1 Button 2")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(2) PORT_NAME("Joystick 2 Button 1")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_PLAYER(2) PORT_NAME("Joystick 2 Button 2")
INPUT_PORTS_END
ROM_START(apple3)
diff --git a/src/mess/drivers/bebox.c b/src/mess/drivers/bebox.c
index 86565c34a01..daa63ded323 100644
--- a/src/mess/drivers/bebox.c
+++ b/src/mess/drivers/bebox.c
@@ -21,7 +21,6 @@
#include "bus/pci/pci.h"
#include "machine/am9517a.h"
#include "machine/pckeybrd.h"
-#include "machine/8042kbdc.h"
#include "machine/idectrl.h"
#include "bus/pci/mpc105.h"
#include "machine/intelfsh.h"
@@ -155,17 +154,6 @@ WRITE_LINE_MEMBER(bebox_state::bebox_keyboard_interrupt)
m_pic8259_1->ir1_w(state);
}
-static const struct kbdc8042_interface bebox_8042_interface =
-{
- KBDC8042_STANDARD,
- DEVCB_CPU_INPUT_LINE("ppc1", INPUT_LINE_RESET),
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(bebox_state,bebox_keyboard_interrupt),
- DEVCB_NULL,
-
- DEVCB_NULL
-};
-
static SLOT_INTERFACE_START( pci_devices )
SLOT_INTERFACE_INTERNAL("mpc105", MPC105)
SLOT_INTERFACE("cirrus", CIRRUS)
@@ -235,7 +223,11 @@ static MACHINE_CONFIG_START( bebox, bebox_state )
MCFG_MC146818_ADD( "rtc", XTAL_32_768kHz )
- MCFG_KBDC8042_ADD("kbdc", bebox_8042_interface)
+ MCFG_DEVICE_ADD("kbdc", KBDC8042, 0)
+ MCFG_KBDC8042_KEYBOARD_TYPE(KBDC8042_STANDARD)
+ MCFG_KBDC8042_SYSTEM_RESET_CB(INPUTLINE("ppc1", INPUT_LINE_RESET))
+ MCFG_KBDC8042_INPUT_BUFFER_FULL_CB(WRITELINE(bebox_state, bebox_keyboard_interrupt))
+
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("32M")
diff --git a/src/mess/drivers/digel804.c b/src/mess/drivers/digel804.c
index 8806e28265d..f433d52db6e 100644
--- a/src/mess/drivers/digel804.c
+++ b/src/mess/drivers/digel804.c
@@ -117,8 +117,6 @@ public:
DECLARE_WRITE8_MEMBER( acia_control_w );
DECLARE_WRITE_LINE_MEMBER( da_w );
DECLARE_INPUT_CHANGED_MEMBER(mode_change);
- // vfd helper stuff for port 44, should be unnecessary after 10937 gets a proper device
- UINT8 m_vfd_sclk;
// current speaker state for port 45
UINT8 m_speaker_state;
// ram stuff for banking
@@ -164,7 +162,6 @@ DRIVER_INIT_MEMBER(digel804_state,digel804)
void digel804_state::machine_reset()
{
m_vfd->reset();
- m_vfd_sclk = 0;
}
READ8_MEMBER( digel804_state::ip40 ) // eprom data bus read
@@ -288,12 +285,9 @@ WRITE8_MEMBER( digel804_state::op44 ) // state write
#ifdef PORT44_W_VERBOSE
logerror("Digel804: port 0x44 vfd/state control had %02x written to it!\n", data);
#endif
- // latch vfd data on falling edge of clock only; this should really be part of the 10937 device, not here!
- if (m_vfd_sclk && ((data&1)==0))
- {
- m_vfd->shift_data((data & 0x80) ? 0 : 1);
- }
- m_vfd_sclk = data & 1;
+ m_vfd->por(!(data&0x04));
+ m_vfd->data(data&0x80);
+ m_vfd->sclk(data&1);
}
WRITE8_MEMBER( digel804_state::op45 ) // speaker write
diff --git a/src/mess/drivers/dragon.c b/src/mess/drivers/dragon.c
index 7041896cd9a..003118016cc 100644
--- a/src/mess/drivers/dragon.c
+++ b/src/mess/drivers/dragon.c
@@ -162,7 +162,7 @@ static MACHINE_CONFIG_START( dragon_base, dragon_state )
MCFG_SAM6883_ADD(SAM_TAG, XTAL_4_433619MHz, dragon_state::sam6883_config)
MCFG_SAM6883_RES_CALLBACK(READ8(dragon_state, sam_read))
MCFG_CASSETTE_ADD("cassette", dragon_state::coco_cassette_interface)
- MCFG_PRINTER_ADD(PRINTER_TAG)
+ MCFG_DEVICE_ADD(PRINTER_TAG, PRINTER, 0)
// video hardware
MCFG_SCREEN_MC6847_PAL_ADD(SCREEN_TAG, VDG_TAG)
diff --git a/src/mess/drivers/fanucspmg.c b/src/mess/drivers/fanucspmg.c
index 8192f1f5455..6dbffdbc998 100644
--- a/src/mess/drivers/fanucspmg.c
+++ b/src/mess/drivers/fanucspmg.c
@@ -710,17 +710,6 @@ WRITE8_MEMBER(fanucspmg_state::memory_write_byte)
return prog_space.write_byte(offset, data);
}
-I8257_INTERFACE( fanucspmg_dma )
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_MEMBER(fanucspmg_state, memory_read_byte),
- DEVCB_DRIVER_MEMBER(fanucspmg_state, memory_write_byte),
- { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL },
- { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }
-};
-
static MC6845_UPDATE_ROW( fanuc_update_row )
{
fanucspmg_state *state = downcast<fanucspmg_state *>(device->owner());
@@ -819,7 +808,9 @@ static MACHINE_CONFIG_START( fanucspmg, fanucspmg_state )
MCFG_PIT8253_CLK1(XTAL_15MHz/12)
MCFG_PIT8253_CLK2(XTAL_15MHz/12)
- MCFG_I8257_ADD(DMAC_TAG, XTAL_15MHz / 5, fanucspmg_dma)
+ MCFG_DEVICE_ADD(DMAC_TAG, I8257, XTAL_15MHz / 5)
+ MCFG_I8257_IN_MEMR_CB(READ8(fanucspmg_state, memory_read_byte))
+ MCFG_I8257_OUT_MEMW_CB(WRITE8(fanucspmg_state, memory_write_byte))
MCFG_PIC8259_ADD(PIC0_TAG, INPUTLINE("maincpu", 0), VCC, NULL)
MCFG_PIC8259_ADD(PIC1_TAG, INPUTLINE("maincpu", 0), VCC, NULL)
diff --git a/src/mess/drivers/hec2hrp.c b/src/mess/drivers/hec2hrp.c
index 3762346ba04..303fdc2c983 100644
--- a/src/mess/drivers/hec2hrp.c
+++ b/src/mess/drivers/hec2hrp.c
@@ -466,7 +466,7 @@ static MACHINE_CONFIG_START( hec2hr, hec2hrp_state )
MCFG_CASSETTE_ADD( "cassette", hector_cassette_interface )
/* printer */
- MCFG_PRINTER_ADD("printer")
+ MCFG_DEVICE_ADD("printer", PRINTER, 0)
MACHINE_CONFIG_END
@@ -510,7 +510,7 @@ static MACHINE_CONFIG_START( hec2hrp, hec2hrp_state )
MCFG_CASSETTE_ADD( "cassette", hector_cassette_interface )
/* printer */
- MCFG_PRINTER_ADD("printer")
+ MCFG_DEVICE_ADD("printer", PRINTER, 0)
MACHINE_CONFIG_END
@@ -568,7 +568,7 @@ static MACHINE_CONFIG_START( hec2mx40, hec2hrp_state )
MCFG_CASSETTE_ADD( "cassette", hector_cassette_interface )
/* printer */
- MCFG_PRINTER_ADD("printer")
+ MCFG_DEVICE_ADD("printer", PRINTER, 0)
MACHINE_CONFIG_END
/*****************************************************************************/
@@ -621,7 +621,7 @@ static MACHINE_CONFIG_START( hec2hrx, hec2hrp_state )
MCFG_CASSETTE_ADD( "cassette", hector_cassette_interface )
/* printer */
- MCFG_PRINTER_ADD("printer")
+ MCFG_DEVICE_ADD("printer", PRINTER, 0)
MACHINE_CONFIG_END
/*****************************************************************************/
@@ -670,7 +670,7 @@ static MACHINE_CONFIG_START( hec2mdhrx, hec2hrp_state )
MCFG_CASSETTE_ADD( "cassette", hector_cassette_interface )
/* printer */
- MCFG_PRINTER_ADD("printer")
+ MCFG_DEVICE_ADD("printer", PRINTER, 0)
MACHINE_CONFIG_END
@@ -724,7 +724,7 @@ static MACHINE_CONFIG_START( hec2mx80, hec2hrp_state )
MCFG_CASSETTE_ADD( "cassette", hector_cassette_interface )
/* printer */
- MCFG_PRINTER_ADD("printer")
+ MCFG_DEVICE_ADD("printer", PRINTER, 0)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/interact.c b/src/mess/drivers/interact.c
index e48e6998634..425ab6a98fa 100644
--- a/src/mess/drivers/interact.c
+++ b/src/mess/drivers/interact.c
@@ -176,7 +176,7 @@ static MACHINE_CONFIG_START( interact, interact_state )
MCFG_SOFTWARE_LIST_ADD("cass_list","interact")
/* printer */
- MCFG_PRINTER_ADD("printer")
+ MCFG_DEVICE_ADD("printer", PRINTER, 0)
MACHINE_CONFIG_END
@@ -218,7 +218,7 @@ static MACHINE_CONFIG_START( hector1, interact_state )
MCFG_CASSETTE_ADD( "cassette", interact_cassette_interface )
/* printer */
- MCFG_PRINTER_ADD("printer")
+ MCFG_DEVICE_ADD("printer", PRINTER, 0)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/ip22.c b/src/mess/drivers/ip22.c
index cadaa249d24..1d26ea90d37 100644
--- a/src/mess/drivers/ip22.c
+++ b/src/mess/drivers/ip22.c
@@ -1488,17 +1488,6 @@ void ip22_state::machine_start()
machine().device<nvram_device>("nvram")->set_base(m_RTC.nRAM, 0x200);
}
-static const struct kbdc8042_interface at8042 =
-{
- KBDC8042_STANDARD,
- DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_RESET),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
-
- DEVCB_NULL
-};
-
DRIVER_INIT_MEMBER(ip22_state,ip225015)
{
// IP22 uses 2 pieces of PC-compatible hardware: the 8042 PS/2 keyboard/mouse
@@ -1643,7 +1632,9 @@ static MACHINE_CONFIG_START( ip225015, ip22_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "^^^lspeaker", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "^^^rspeaker", 1.0)
- MCFG_KBDC8042_ADD("kbdc", at8042)
+ MCFG_DEVICE_ADD("kbdc", KBDC8042, 0)
+ MCFG_KBDC8042_KEYBOARD_TYPE(KBDC8042_STANDARD)
+ MCFG_KBDC8042_SYSTEM_RESET_CB(INPUTLINE("maincpu", INPUT_LINE_RESET))
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( ip224613, ip225015 )
diff --git a/src/mess/drivers/mc10.c b/src/mess/drivers/mc10.c
index 782721d1a29..011a5cbc67f 100644
--- a/src/mess/drivers/mc10.c
+++ b/src/mess/drivers/mc10.c
@@ -520,7 +520,7 @@ static MACHINE_CONFIG_START( mc10, mc10_state )
MCFG_CASSETTE_ADD("cassette", mc10_cassette_interface)
/* printer */
- MCFG_PRINTER_ADD("printer")
+ MCFG_DEVICE_ADD("printer", PRINTER, 0)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@@ -555,7 +555,7 @@ static MACHINE_CONFIG_START( alice32, mc10_state )
MCFG_CASSETTE_ADD("cassette", alice32_cassette_interface)
/* printer */
- MCFG_PRINTER_ADD("printer")
+ MCFG_DEVICE_ADD("printer", PRINTER, 0)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/mikrosha.c b/src/mess/drivers/mikrosha.c
index 8c4d3857813..f28550e679a 100644
--- a/src/mess/drivers/mikrosha.c
+++ b/src/mess/drivers/mikrosha.c
@@ -209,7 +209,11 @@ static MACHINE_CONFIG_START( mikrosha, mikrosha_state )
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_I8257_ADD("dma8257", XTAL_16MHz / 9, radio86_dma)
+ MCFG_DEVICE_ADD("dma8257", I8257, XTAL_16MHz / 9)
+ MCFG_I8257_OUT_HRQ_CB(WRITELINE(radio86_state, hrq_w))
+ MCFG_I8257_IN_MEMR_CB(READ8(radio86_state, memory_read_byte))
+ MCFG_I8257_OUT_MEMW_CB(WRITE8(radio86_state, memory_write_byte))
+ MCFG_I8257_OUT_IOW_2_CB(DEVWRITE8("i8275", i8275_device, dack_w))
MCFG_CASSETTE_ADD( "cassette", mikrosha_cassette_interface )
MCFG_SOFTWARE_LIST_ADD("cass_list","mikrosha")
diff --git a/src/mess/drivers/partner.c b/src/mess/drivers/partner.c
index b69af591e30..2fbeedc7fde 100644
--- a/src/mess/drivers/partner.c
+++ b/src/mess/drivers/partner.c
@@ -215,7 +215,13 @@ static MACHINE_CONFIG_START( partner, partner_state )
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_I8257_ADD("dma8257", XTAL_16MHz / 9, partner_dma)
+ MCFG_DEVICE_ADD("dma8257", I8257, XTAL_16MHz / 9)
+ MCFG_I8257_OUT_HRQ_CB(WRITELINE(partner_state, hrq_w))
+ MCFG_I8257_IN_MEMR_CB(READ8(radio86_state, memory_read_byte))
+ MCFG_I8257_OUT_MEMW_CB(WRITE8(radio86_state, memory_write_byte))
+ MCFG_I8257_IN_IOR_0_CB(READ8(partner_state, partner_fdc_r))
+ MCFG_I8257_OUT_IOW_0_CB(WRITE8(partner_state, partner_fdc_w))
+ MCFG_I8257_OUT_IOW_2_CB(DEVWRITE8("i8275", i8275_device, dack_w))
MCFG_CASSETTE_ADD( "cassette", partner_cassette_interface )
MCFG_SOFTWARE_LIST_ADD("cass_list","partner_cass")
diff --git a/src/mess/drivers/pc8001.c b/src/mess/drivers/pc8001.c
index 287b824de84..56f1422dca5 100644
--- a/src/mess/drivers/pc8001.c
+++ b/src/mess/drivers/pc8001.c
@@ -444,16 +444,6 @@ WRITE8_MEMBER( pc8001_state::dma_io_w )
program.write_byte(offset, data);
}
-static I8257_INTERFACE( dmac_intf )
-{
- DEVCB_DRIVER_LINE_MEMBER(pc8001_state, hrq_w),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_MEMBER(pc8001_state, dma_mem_w),
- { DEVCB_DRIVER_MEMBER(pc8001_state, dma_io_r), DEVCB_DRIVER_MEMBER(pc8001_state, dma_io_r), DEVCB_DRIVER_MEMBER(pc8001_state, dma_io_r), DEVCB_DRIVER_MEMBER(pc8001_state, dma_io_r) },
- { DEVCB_DRIVER_MEMBER(pc8001_state, dma_io_w), DEVCB_DRIVER_MEMBER(pc8001_state, dma_io_w), DEVCB_DRIVER_MEMBER(pc8001_state, dma_io_w), DEVCB_DRIVER_MEMBER(pc8001_state, dma_io_w) },
-};
/* Machine Initialization */
@@ -545,7 +535,19 @@ static MACHINE_CONFIG_START( pc8001, pc8001_state )
MCFG_DEVICE_ADD(I8251_TAG, I8251, 0)
MCFG_I8255A_ADD(I8255A_TAG, ppi_intf)
- MCFG_I8257_ADD(I8257_TAG, 4000000, dmac_intf)
+
+ MCFG_DEVICE_ADD(I8257_TAG, I8257, 4000000)
+ MCFG_I8257_OUT_HRQ_CB(WRITELINE(pc8001_state, hrq_w))
+ MCFG_I8257_OUT_MEMW_CB(WRITE8(pc8001_state, dma_mem_w))
+ MCFG_I8257_IN_IOR_0_CB(READ8(pc8001_state, dma_io_r))
+ MCFG_I8257_IN_IOR_1_CB(READ8(pc8001_state, dma_io_r))
+ MCFG_I8257_IN_IOR_2_CB(READ8(pc8001_state, dma_io_r))
+ MCFG_I8257_IN_IOR_3_CB(READ8(pc8001_state, dma_io_r))
+ MCFG_I8257_OUT_IOW_0_CB(WRITE8(pc8001_state, dma_io_w))
+ MCFG_I8257_OUT_IOW_1_CB(WRITE8(pc8001_state, dma_io_w))
+ MCFG_I8257_OUT_IOW_2_CB(WRITE8(pc8001_state, dma_io_w))
+ MCFG_I8257_OUT_IOW_3_CB(WRITE8(pc8001_state, dma_io_w))
+
MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, NULL, NULL)
MCFG_DEVICE_ADD(UPD3301_TAG, UPD3301, 14318180)
@@ -589,7 +591,19 @@ static MACHINE_CONFIG_START( pc8001mk2, pc8001mk2_state )
MCFG_DEVICE_ADD(I8251_TAG, I8251, 0)
MCFG_I8255A_ADD(I8255A_TAG, ppi_intf)
- MCFG_I8257_ADD(I8257_TAG, 4000000, dmac_intf)
+
+ MCFG_DEVICE_ADD(I8257_TAG, I8257, 4000000)
+ MCFG_I8257_OUT_HRQ_CB(WRITELINE(pc8001_state, hrq_w))
+ MCFG_I8257_OUT_MEMW_CB(WRITE8(pc8001_state, dma_mem_w))
+ MCFG_I8257_IN_IOR_0_CB(READ8(pc8001_state, dma_io_r))
+ MCFG_I8257_IN_IOR_1_CB(READ8(pc8001_state, dma_io_r))
+ MCFG_I8257_IN_IOR_2_CB(READ8(pc8001_state, dma_io_r))
+ MCFG_I8257_IN_IOR_3_CB(READ8(pc8001_state, dma_io_r))
+ MCFG_I8257_OUT_IOW_0_CB(WRITE8(pc8001_state, dma_io_w))
+ MCFG_I8257_OUT_IOW_1_CB(WRITE8(pc8001_state, dma_io_w))
+ MCFG_I8257_OUT_IOW_2_CB(WRITE8(pc8001_state, dma_io_w))
+ MCFG_I8257_OUT_IOW_3_CB(WRITE8(pc8001_state, dma_io_w))
+
MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, NULL, NULL)
MCFG_DEVICE_ADD(UPD3301_TAG, UPD3301, 14318180)
diff --git a/src/mess/drivers/ql.c b/src/mess/drivers/ql.c
index 88e0f436576..e69b0ddd144 100644
--- a/src/mess/drivers/ql.c
+++ b/src/mess/drivers/ql.c
@@ -1175,7 +1175,7 @@ static MACHINE_CONFIG_START( ql, ql_state )
MCFG_RAM_EXTRA_OPTIONS("192K,256K,384K,640K,896K")
// Parallel printer port on Sandy disk interface
- MCFG_PRINTER_ADD(PRINTER_TAG)
+ MCFG_DEVICE_ADD(PRINTER_TAG, PRINTER, 0)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/radio86.c b/src/mess/drivers/radio86.c
index a658efccb6a..b6d95e8736c 100644
--- a/src/mess/drivers/radio86.c
+++ b/src/mess/drivers/radio86.c
@@ -372,7 +372,11 @@ static MACHINE_CONFIG_START( radio86, radio86_state )
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_I8257_ADD("dma8257", XTAL_16MHz / 9, radio86_dma)
+ MCFG_DEVICE_ADD("dma8257", I8257, XTAL_16MHz / 9)
+ MCFG_I8257_OUT_HRQ_CB(WRITELINE(radio86_state, hrq_w))
+ MCFG_I8257_IN_MEMR_CB(READ8(radio86_state, memory_read_byte))
+ MCFG_I8257_OUT_MEMW_CB(WRITE8(radio86_state, memory_write_byte))
+ MCFG_I8257_OUT_IOW_2_CB(DEVWRITE8("i8275", i8275_device, dack_w))
MCFG_CASSETTE_ADD( "cassette", radio86_cassette_interface )
MCFG_SOFTWARE_LIST_ADD("cass_list","radio86")
diff --git a/src/mess/drivers/unior.c b/src/mess/drivers/unior.c
index 61a80ba1217..d66f3579d3a 100644
--- a/src/mess/drivers/unior.c
+++ b/src/mess/drivers/unior.c
@@ -393,17 +393,6 @@ READ8_MEMBER(unior_state::dma_r)
return m_p_vram[offset & 0x7ff];
}
-static I8257_INTERFACE( dma_intf )
-{
- DEVCB_CPU_INPUT_LINE("maincpu", I8085_HALT),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_MEMBER("crtc", i8275_device, dack_w),
- { DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(unior_state, dma_r), DEVCB_NULL },
- { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL },
-};
-
WRITE8_MEMBER( unior_state::cpu_status_callback )
{
m_dma->i8257_hlda_w(BIT(data, 3));
@@ -462,7 +451,12 @@ static MACHINE_CONFIG_START( unior, unior_state )
MCFG_I8255_ADD( "ppi0", ppi0_intf )
MCFG_I8255_ADD( "ppi1", ppi1_intf )
- MCFG_I8257_ADD("dma", XTAL_20MHz / 9, dma_intf) // unknown clock
+
+ MCFG_DEVICE_ADD("dma", I8257, XTAL_20MHz / 9) // unknown clock
+ MCFG_I8257_OUT_HRQ_CB(INPUTLINE("maincpu", I8085_HALT))
+ MCFG_I8257_OUT_MEMW_CB(DEVWRITE8("crtc", i8275_device, dack_w))
+ MCFG_I8257_IN_IOR_2_CB(READ8(unior_state, dma_r))
+
MCFG_I8275_ADD("crtc", crtc_intf)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/vg5k.c b/src/mess/drivers/vg5k.c
index ea277f938a1..eb038162877 100644
--- a/src/mess/drivers/vg5k.c
+++ b/src/mess/drivers/vg5k.c
@@ -405,7 +405,7 @@ static MACHINE_CONFIG_START( vg5k, vg5k_state )
MCFG_CASSETTE_ADD( "cassette", vg5k_cassette_interface )
/* printer */
- MCFG_PRINTER_ADD("printer")
+ MCFG_DEVICE_ADD("printer", PRINTER, 0)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/x07.c b/src/mess/drivers/x07.c
index 1fff1614aec..76608eae342 100644
--- a/src/mess/drivers/x07.c
+++ b/src/mess/drivers/x07.c
@@ -1495,7 +1495,7 @@ static MACHINE_CONFIG_START( x07, x07_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
/* printer */
- MCFG_PRINTER_ADD("printer")
+ MCFG_DEVICE_ADD("printer", PRINTER, 0)
MCFG_TIMER_DRIVER_ADD_PERIODIC("blink_timer", x07_state, blink_timer, attotime::from_msec(300))
diff --git a/src/mess/includes/apple3.h b/src/mess/includes/apple3.h
index 257f39b5f90..31772bf70c8 100644
--- a/src/mess/includes/apple3.h
+++ b/src/mess/includes/apple3.h
@@ -50,7 +50,13 @@ public:
m_speaker(*this, SPEAKER_TAG),
m_dac(*this, DAC_TAG),
m_kbspecial(*this, "keyb_special"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_joy1x(*this, "joy_1_x"),
+ m_joy1y(*this, "joy_1_y"),
+ m_joy2x(*this, "joy_2_x"),
+ m_joy2y(*this, "joy_2_y"),
+ m_joybuttons(*this, "joy_buttons"),
+ m_pdltimer(*this, "pdltimer")
{
}
@@ -67,6 +73,8 @@ public:
required_device<dac_device> m_dac;
required_ioport m_kbspecial;
required_device<palette_device> m_palette;
+ required_ioport m_joy1x, m_joy1y, m_joy2x, m_joy2y, m_joybuttons;
+ required_device<timer_device> m_pdltimer;
DECLARE_READ8_MEMBER(apple3_memory_r);
DECLARE_WRITE8_MEMBER(apple3_memory_w);
@@ -107,6 +115,8 @@ public:
DECLARE_READ_LINE_MEMBER(ay3600_control_r);
DECLARE_WRITE_LINE_MEMBER(ay3600_data_ready_w);
void apple3_postload();
+ TIMER_DEVICE_CALLBACK_MEMBER(paddle_timer);
+ void pdl_handler(int offset);
// these need to be public for now
UINT32 m_flags;
@@ -137,6 +147,10 @@ private:
int m_c040_time;
UINT16 m_lastchar, m_strobe;
UINT8 m_transchar;
+
+ int m_analog_sel;
+ bool m_ramp_active;
+ int m_pdl_charge;
};
diff --git a/src/mess/includes/partner.h b/src/mess/includes/partner.h
index 9d34642b0b0..2efc3c67b57 100644
--- a/src/mess/includes/partner.h
+++ b/src/mess/includes/partner.h
@@ -47,7 +47,6 @@ public:
/*----------- defined in machine/partner.c -----------*/
-extern const i8257_interface partner_dma;
extern const wd17xx_interface partner_wd17xx_interface;
#endif /* partner_H_ */
diff --git a/src/mess/includes/radio86.h b/src/mess/includes/radio86.h
index 429f5991189..b233c730c24 100644
--- a/src/mess/includes/radio86.h
+++ b/src/mess/includes/radio86.h
@@ -133,9 +133,6 @@ extern const i8275_interface partner_i8275_interface;
extern const i8275_interface mikrosha_i8275_interface;
extern const i8275_interface apogee_i8275_interface;
-extern const i8257_interface radio86_dma;
-
-
extern void radio86_init_keyboard(running_machine &machine);
diff --git a/src/mess/machine/apple3.c b/src/mess/machine/apple3.c
index e169a9788cf..2637e632045 100644
--- a/src/mess/machine/apple3.c
+++ b/src/mess/machine/apple3.c
@@ -39,7 +39,7 @@
bits 0-5: 6-bit audio DAC output
bit 6: screen blank
bit 7: OR of NMI from slots
-
+
***************************************************************************/
#include "emu.h"
@@ -150,12 +150,40 @@ READ8_MEMBER(apple3_state::apple3_c0xx_r)
m_flags &= ~(1 << ((offset - 0x50) / 2));
break;
- case 0x60: case 0x61: case 0x62: case 0x63:
- case 0x64: case 0x65: case 0x66: case 0x67:
- case 0x68: case 0x69: case 0x6A: case 0x6B:
- case 0x6C: case 0x6D: case 0x6E: case 0x6F:
- /* unsure what these are */
- result = 0x00;
+ case 0x58:
+ case 0x59:
+ case 0x5a:
+ case 0x5b:
+ case 0x5c:
+ case 0x5d:
+ case 0x5e:
+ case 0x5f:
+ pdl_handler(offset);
+ break;
+
+ case 0x60: // joystick switch 0
+ case 0x68:
+ result = (m_joybuttons->read() & 1) ? 0x80 : 0x00;
+ break;
+
+ case 0x61: // joystick switch 1 (margin switch for Silentype)
+ case 0x69:
+ result = (m_joybuttons->read() & 4) ? 0x80 : 0x00;
+ break;
+
+ case 0x62: // joystick switch 2
+ case 0x6a:
+ result = (m_joybuttons->read() & 2) ? 0x80 : 0x00;
+ break;
+
+ case 0x63: // joystick switch 3 (serial clock for silentype)
+ case 0x6b:
+ result = (m_joybuttons->read() & 8) ? 0x80 : 0x00;
+ break;
+
+ case 0x66: // paddle A/D conversion done (bit 7 = 1 while counting, 0 when done)
+ case 0x6e:
+ return m_ramp_active ? 0x80 : 0x00;
break;
case 0x70: case 0x71: case 0x72: case 0x73:
@@ -287,6 +315,16 @@ WRITE8_MEMBER(apple3_state::apple3_c0xx_w)
m_flags &= ~(1 << ((offset - 0x50) / 2));
break;
+ case 0x58:
+ case 0x59:
+ case 0x5a:
+ case 0x5b:
+ case 0x5c:
+ case 0x5d:
+ case 0x5e:
+ case 0x5f:
+ pdl_handler(offset);
+ break;
case 0x70: case 0x71: case 0x72: case 0x73:
case 0x74: case 0x75: case 0x76: case 0x77:
@@ -582,6 +620,8 @@ MACHINE_RESET_MEMBER(apple3_state,apple3)
m_lastchar = 0x0d;
m_rom_has_been_disabled = false;
m_cnxx_slot = -1;
+ m_analog_sel = 0;
+ m_ramp_active = false;
}
@@ -715,6 +755,9 @@ DRIVER_INIT_MEMBER(apple3_state,apple3)
save_item(NAME(m_transchar));
save_item(NAME(m_flags));
save_item(NAME(m_char_mem));
+ save_item(NAME(m_analog_sel));
+ save_item(NAME(m_ramp_active));
+ save_item(NAME(m_pdl_charge));
machine().save().register_postload(save_prepost_delegate(FUNC(apple3_state::apple3_postload), this));
}
@@ -1152,3 +1195,99 @@ WRITE_LINE_MEMBER(apple3_state::ay3600_data_ready_w)
}
}
}
+
+void apple3_state::pdl_handler(int offset)
+{
+ UINT8 pdlread;
+
+ switch (offset)
+ {
+ case 0x58:
+ m_analog_sel &= ~1;
+ break;
+
+ case 0x59:
+ m_analog_sel |= 1;
+ break;
+
+ case 0x5a:
+ m_analog_sel &= ~4;
+ break;
+
+ case 0x5b:
+ m_analog_sel |= 4;
+ break;
+
+ case 0x5c:
+ m_ramp_active = false;
+ m_pdl_charge = 0;
+ m_pdltimer->adjust(attotime::from_hz(1000000.0));
+ break;
+
+ case 0x5d:
+ switch (m_analog_sel)
+ {
+ case 1:
+ pdlread = m_joy1x->read();
+ break;
+
+ case 2:
+ pdlread = m_joy1y->read();
+ break;
+
+ case 4:
+ pdlread = m_joy2x->read();
+ break;
+
+ case 5:
+ pdlread = m_joy2y->read();
+ break;
+
+ default:
+ pdlread = 127;
+ break;
+ }
+
+ // help the ROM self-test
+ if (m_pdl_charge > 82)
+ {
+ m_pdl_charge += (pdlread*4);
+ m_pdl_charge -= 93;
+ }
+ m_pdltimer->adjust(attotime::from_hz(1000000.0));
+ m_ramp_active = true;
+ break;
+
+ case 0x5e:
+ m_analog_sel &= ~2;
+ break;
+
+ case 0x5f:
+ m_analog_sel |= 2;
+ break;
+ }
+}
+
+TIMER_DEVICE_CALLBACK_MEMBER(apple3_state::paddle_timer)
+{
+ if (m_ramp_active)
+ {
+ m_pdl_charge--;
+
+ if (m_pdl_charge > 0)
+ {
+ m_pdltimer->adjust(attotime::from_hz(1000000.0));
+ }
+ else
+ {
+ m_pdltimer->adjust(attotime::never);
+ m_ramp_active = false;
+ }
+ }
+ else
+ {
+ m_pdl_charge++;
+ m_pdltimer->adjust(attotime::from_hz(1000000.0));
+ }
+}
+
diff --git a/src/mess/machine/partner.c b/src/mess/machine/partner.c
index 9f07f149d23..6f896573bf0 100644
--- a/src/mess/machine/partner.c
+++ b/src/mess/machine/partner.c
@@ -362,23 +362,12 @@ READ8_MEMBER(partner_state::partner_fdc_r)
{
return m_fdc->data_r(space,offset);
}
+
WRITE8_MEMBER(partner_state::partner_fdc_w)
{
m_fdc->data_w(space,offset,data);
}
-I8257_INTERFACE( partner_dma )
-{
- DEVCB_DRIVER_LINE_MEMBER(partner_state,hrq_w),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_MEMBER(radio86_state, memory_read_byte),
- DEVCB_DRIVER_MEMBER(radio86_state, memory_write_byte),
- { DEVCB_DRIVER_MEMBER(partner_state, partner_fdc_r), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL },
- { DEVCB_DRIVER_MEMBER(partner_state, partner_fdc_w), DEVCB_NULL, DEVCB_DEVICE_MEMBER("i8275", i8275_device, dack_w), DEVCB_NULL }
-};
-
-
MACHINE_RESET_MEMBER(partner_state,partner)
{
m_mem_page = 0;
diff --git a/src/mess/machine/radio86.c b/src/mess/machine/radio86.c
index 448b4f1322b..52e34f19f04 100644
--- a/src/mess/machine/radio86.c
+++ b/src/mess/machine/radio86.c
@@ -146,17 +146,6 @@ WRITE8_MEMBER(radio86_state::memory_write_byte)
return prog_space.write_byte(offset, data);
}
-I8257_INTERFACE( radio86_dma )
-{
- DEVCB_DRIVER_LINE_MEMBER(radio86_state,hrq_w),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_MEMBER(radio86_state, memory_read_byte),
- DEVCB_DRIVER_MEMBER(radio86_state, memory_write_byte),
- { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL },
- { DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_MEMBER("i8275", i8275_device, dack_w), DEVCB_NULL }
-};
-
void radio86_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
switch (id)