summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/hexbus/hx5102.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/hexbus/hx5102.cpp')
-rw-r--r--src/devices/bus/hexbus/hx5102.cpp77
1 files changed, 40 insertions, 37 deletions
diff --git a/src/devices/bus/hexbus/hx5102.cpp b/src/devices/bus/hexbus/hx5102.cpp
index 65f59e0a18a..459157fc604 100644
--- a/src/devices/bus/hexbus/hx5102.cpp
+++ b/src/devices/bus/hexbus/hx5102.cpp
@@ -75,20 +75,20 @@
#include "hx5102.h"
#include "formats/ti99_dsk.h"
-#define LOG_HEXBUS (1U<<1) // Hexbus operation
-#define LOG_RESET (1U<<2) // Reset
-#define LOG_WARN (1U<<3) // Warnings
-#define LOG_READY (1U<<4) // READY
-#define LOG_SIGNALS (1U<<5) // IRQ/DRQ
-#define LOG_CRU (1U<<6) // CRU
-#define LOG_RAM (1U<<7) // RAM
-#define LOG_DMA (1U<<8) // DMA
-#define LOG_MOTOR (1U<<9) // Motor activity
-#define LOG_STATUS (1U<<10) // Main status register
-#define LOG_FIFO (1U<<11) // Data register
+#define LOG_HEXBUS (1U << 1) // Hexbus operation
+#define LOG_RESET (1U << 2) // Reset
+#define LOG_WARN (1U << 3) // Warnings
+#define LOG_READY (1U << 4) // READY
+#define LOG_SIGNALS (1U << 5) // IRQ/DRQ
+#define LOG_CRU (1U << 6) // CRU
+#define LOG_RAM (1U << 7) // RAM
+#define LOG_DMA (1U << 8) // DMA
+#define LOG_MOTOR (1U << 9) // Motor activity
+#define LOG_STATUS (1U << 10) // Main status register
+#define LOG_FIFO (1U << 11) // Data register
// Minimum log should be config and warnings
-#define VERBOSE ( LOG_GENERAL | LOG_WARN )
+#define VERBOSE (LOG_GENERAL | LOG_WARN)
#include "logmacro.h"
@@ -107,9 +107,9 @@
#define MOTOR_TIMER 1
#define UNDEF -1
-DEFINE_DEVICE_TYPE_NS(HX5102, bus::hexbus, hx5102_device, "ti_hx5102", "TI Hexbus Floppy Drive")
+DEFINE_DEVICE_TYPE(HX5102, bus::hexbus::hx5102_device, "ti_hx5102", "TI Hexbus Floppy Drive")
-namespace bus { namespace hexbus {
+namespace bus::hexbus {
void hx5102_device::memmap(address_map &map)
{
@@ -133,6 +133,7 @@ hx5102_device::hx5102_device(const machine_config &mconfig, const char *tag, dev
m_motor_on(false),
m_mspeed_on(false),
m_pending_int(false),
+ m_pending_drq(false),
m_dcs(false),
m_dack(false),
m_dacken(false),
@@ -299,7 +300,7 @@ void hx5102_device::write(offs_t offset, uint8_t data)
/*
Clock line from the CPU. Used to control wait state generation.
*/
-WRITE_LINE_MEMBER( hx5102_device::clock_out )
+void hx5102_device::clock_out(int state)
{
m_readyff->clock_w(state);
}
@@ -316,7 +317,7 @@ void hx5102_device::hexbus_value_changed(uint8_t data)
Propagate READY signals to the CPU. This is used to hold the CPU
during DMA accesses.
*/
-WRITE_LINE_MEMBER( hx5102_device::board_ready )
+void hx5102_device::board_ready(int state)
{
if (m_ready_old != state)
{
@@ -330,7 +331,7 @@ WRITE_LINE_MEMBER( hx5102_device::board_ready )
/*
Trigger RESET.
*/
-WRITE_LINE_MEMBER( hx5102_device::board_reset )
+void hx5102_device::board_reset(int state)
{
LOGMASKED(LOG_RESET, "Incoming RESET line = %d\n", state);
@@ -345,7 +346,7 @@ WRITE_LINE_MEMBER( hx5102_device::board_reset )
/*
Effect from the motor monoflop.
*/
-WRITE_LINE_MEMBER( hx5102_device::motor_w )
+void hx5102_device::motor_w(int state)
{
m_motor_on = (state==ASSERT_LINE);
LOGMASKED(LOG_MOTOR, "Motor %s\n", m_motor_on? "start" : "stop");
@@ -359,7 +360,7 @@ WRITE_LINE_MEMBER( hx5102_device::motor_w )
Effect from the speed monoflop. This is essentially a watchdog to
check whether the lock on the CPU must be released due to an error.
*/
-WRITE_LINE_MEMBER( hx5102_device::mspeed_w )
+void hx5102_device::mspeed_w(int state)
{
m_mspeed_on = (state==ASSERT_LINE);
LOGMASKED(LOG_READY, "Speedcheck %s\n", m_mspeed_on? "on" : "off");
@@ -448,7 +449,7 @@ void hx5102_device::hexbus_out(uint8_t data)
/*
Latch the HSK* to low.
*/
-WRITE_LINE_MEMBER(hx5102_device::hsklatch_out)
+void hx5102_device::hsklatch_out(int state)
{
LOGMASKED(LOG_HEXBUS, "Latching HSK*\n");
m_myvalue &= ~HEXBUS_LINE_HSK;
@@ -483,27 +484,27 @@ uint8_t hx5102_device::cruread(offs_t offset)
/*
CRU write access.
*/
-WRITE_LINE_MEMBER(hx5102_device::nocomp_w)
+void hx5102_device::nocomp_w(int state)
{
// unused right now
LOGMASKED(LOG_CRU, "Set precompensation = %d\n", state);
}
-WRITE_LINE_MEMBER(hx5102_device::diren_w)
+void hx5102_device::diren_w(int state)
{
LOGMASKED(LOG_CRU, "Set step direction = %d\n", state);
if (m_current_floppy != nullptr)
m_current_floppy->dir_w((state==0)? 1 : 0);
}
-WRITE_LINE_MEMBER(hx5102_device::dacken_w)
+void hx5102_device::dacken_w(int state)
{
if (state==1)
LOGMASKED(LOG_CRU, "Assert DACK*\n");
m_dacken = (state != 0);
}
-WRITE_LINE_MEMBER(hx5102_device::stepen_w)
+void hx5102_device::stepen_w(int state)
{
if (state==1)
LOGMASKED(LOG_CRU, "Step pulse\n");
@@ -511,7 +512,7 @@ WRITE_LINE_MEMBER(hx5102_device::stepen_w)
m_current_floppy->stp_w((state==0)? 1 : 0);
}
-WRITE_LINE_MEMBER(hx5102_device::ds1_w)
+void hx5102_device::ds1_w(int state)
{
LOGMASKED(LOG_CRU, "Set drive select 0 to %d\n", state);
if (state == 1)
@@ -521,7 +522,7 @@ WRITE_LINE_MEMBER(hx5102_device::ds1_w)
update_drive_select();
}
-WRITE_LINE_MEMBER(hx5102_device::ds2_w)
+void hx5102_device::ds2_w(int state)
{
LOGMASKED(LOG_CRU, "Set drive select 1 to %d\n", state);
if (state == 1)
@@ -531,25 +532,25 @@ WRITE_LINE_MEMBER(hx5102_device::ds2_w)
update_drive_select();
}
-WRITE_LINE_MEMBER(hx5102_device::ds3_w)
+void hx5102_device::ds3_w(int state)
{
// External drive; not implemented
LOGMASKED(LOG_CRU, "Set drive select 2 to %d\n", state);
}
-WRITE_LINE_MEMBER(hx5102_device::ds4_w)
+void hx5102_device::ds4_w(int state)
{
// External drive; not implemented
LOGMASKED(LOG_CRU, "Set drive select 3 to %d\n", state);
}
-WRITE_LINE_MEMBER(hx5102_device::aux_motor_w)
+void hx5102_device::aux_motor_w(int state)
{
// External drive; not implemented
LOGMASKED(LOG_CRU, "Set auxiliary motor line to %d\n", state);
}
-WRITE_LINE_MEMBER(hx5102_device::wait_w)
+void hx5102_device::wait_w(int state)
{
m_wait = (state!=0);
LOGMASKED(LOG_CRU, "READY circuit %s\n", m_wait? "active" : "inactive" );
@@ -602,7 +603,7 @@ void hx5102_device::device_reset()
Callbacks from the i8272A chip
Interrupt
*/
-WRITE_LINE_MEMBER( hx5102_device::fdc_irq_w )
+void hx5102_device::fdc_irq_w(int state)
{
line_state irq = state? ASSERT_LINE : CLEAR_LINE;
LOGMASKED(LOG_SIGNALS, "INTRQ callback = %d\n", irq);
@@ -614,7 +615,7 @@ WRITE_LINE_MEMBER( hx5102_device::fdc_irq_w )
Callbacks from the i8272A chip
DMA request
*/
-WRITE_LINE_MEMBER( hx5102_device::fdc_drq_w )
+void hx5102_device::fdc_drq_w(int state)
{
line_state drq = state? ASSERT_LINE : CLEAR_LINE;
LOGMASKED(LOG_SIGNALS, "DRQ callback = %d\n", drq);
@@ -625,10 +626,12 @@ WRITE_LINE_MEMBER( hx5102_device::fdc_drq_w )
/*
Define the floppy formats.
*/
-FLOPPY_FORMATS_MEMBER(hx5102_device::floppy_formats)
- FLOPPY_TI99_SDF_FORMAT,
- FLOPPY_TI99_TDF_FORMAT
-FLOPPY_FORMATS_END
+void hx5102_device::floppy_formats(format_registration &fr)
+{
+ fr.add_mfm_containers();
+ fr.add(FLOPPY_TI99_SDF_FORMAT);
+ fr.add(FLOPPY_TI99_TDF_FORMAT);
+}
/*
Only one fixed floppy drive in the device.
@@ -744,5 +747,5 @@ ioport_constructor hx5102_device::device_input_ports() const
return INPUT_PORTS_NAME( hx5102 );
}
-} } // end namespace bus::hexbus
+} // end namespace bus::hexbus