summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/ti99/peb/bwg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/ti99/peb/bwg.cpp')
-rw-r--r--src/devices/bus/ti99/peb/bwg.cpp64
1 files changed, 33 insertions, 31 deletions
diff --git a/src/devices/bus/ti99/peb/bwg.cpp b/src/devices/bus/ti99/peb/bwg.cpp
index 055e926aec2..4787df88964 100644
--- a/src/devices/bus/ti99/peb/bwg.cpp
+++ b/src/devices/bus/ti99/peb/bwg.cpp
@@ -50,22 +50,22 @@
// ----------------------------------
// Flags for debugging
-#define LOG_WARN (1U<<1) // Warnings
-#define LOG_RW (1U<<2) // Read and write accesses
-#define LOG_CRU (1U<<3) // Show CRU bit accesses
-#define LOG_CRUD (1U<<4) // Show CRU bit accesses (details)
-#define LOG_READY (1U<<5) // Show ready line activity
-#define LOG_SIGNALS (1U<<6) // Show detailed signal activity
-#define LOG_ADDRESS (1U<<7) // Show address bus operations
-#define LOG_MOTOR (1U<<8) // Show motor operations
-#define LOG_CONFIG (1U<<9) // Configuration
-
-#define VERBOSE ( LOG_CONFIG | LOG_WARN )
+#define LOG_WARN (1U << 1) // Warnings
+#define LOG_RW (1U << 2) // Read and write accesses
+#define LOG_CRU (1U << 3) // Show CRU bit accesses
+#define LOG_CRUD (1U << 4) // Show CRU bit accesses (details)
+#define LOG_READY (1U << 5) // Show ready line activity
+#define LOG_SIGNALS (1U << 6) // Show detailed signal activity
+#define LOG_ADDRESS (1U << 7) // Show address bus operations
+#define LOG_MOTOR (1U << 8) // Show motor operations
+#define LOG_CONFIG (1U << 9) // Configuration
+
+#define VERBOSE (LOG_CONFIG | LOG_WARN)
#include "logmacro.h"
-DEFINE_DEVICE_TYPE_NS(TI99_BWG, bus::ti99::peb, snug_bwg_device, "ti99_bwg", "SNUG BwG Floppy Controller")
+DEFINE_DEVICE_TYPE(TI99_BWG, bus::ti99::peb::snug_bwg_device, "ti99_bwg", "SNUG BwG Floppy Controller")
-namespace bus { namespace ti99 { namespace peb {
+namespace bus::ti99::peb {
// ----------------------------------
@@ -123,7 +123,7 @@ void snug_bwg_device::operate_ready_line()
/*
Callbacks from the WD1773 chip
*/
-WRITE_LINE_MEMBER( snug_bwg_device::fdc_irq_w )
+void snug_bwg_device::fdc_irq_w(int state)
{
LOGMASKED(LOG_SIGNALS, "set intrq = %d\n", state);
m_IRQ = (line_state)state;
@@ -132,7 +132,7 @@ WRITE_LINE_MEMBER( snug_bwg_device::fdc_irq_w )
operate_ready_line();
}
-WRITE_LINE_MEMBER( snug_bwg_device::fdc_drq_w )
+void snug_bwg_device::fdc_drq_w(int state)
{
LOGMASKED(LOG_SIGNALS, "set drq = %d\n", state);
m_DRQ = (line_state)state;
@@ -390,19 +390,19 @@ void snug_bwg_device::cruwrite(offs_t offset, uint8_t data)
}
}
-WRITE_LINE_MEMBER(snug_bwg_device::den_w)
+void snug_bwg_device::den_w(int state)
{
// (De)select the card. Indicated by a LED on the board.
m_selected = state;
LOGMASKED(LOG_CRU, "Map DSR (bit 0) = %d\n", m_selected);
}
-WRITE_LINE_MEMBER(snug_bwg_device::mop_w)
+void snug_bwg_device::mop_w(int state)
{
m_motormf->b_w(state);
}
-WRITE_LINE_MEMBER(snug_bwg_device::waiten_w)
+void snug_bwg_device::waiten_w(int state)
{
/* Set disk ready/hold (bit 2) */
// 0: ignore IRQ and DRQ
@@ -412,29 +412,29 @@ WRITE_LINE_MEMBER(snug_bwg_device::waiten_w)
LOGMASKED(LOG_CRU, "Arm wait state logic (bit 2) = %d\n", state);
}
-WRITE_LINE_MEMBER(snug_bwg_device::hlt_w)
+void snug_bwg_device::hlt_w(int state)
{
// Load disk heads (HLT pin) (bit 3). Not implemented.
LOGMASKED(LOG_CRU, "Set head load (bit 3) = %d\n", state);
}
/* Drive selects */
-WRITE_LINE_MEMBER(snug_bwg_device::dsel1_w)
+void snug_bwg_device::dsel1_w(int state)
{
select_drive(1, state);
}
-WRITE_LINE_MEMBER(snug_bwg_device::dsel2_w)
+void snug_bwg_device::dsel2_w(int state)
{
select_drive(2, state);
}
-WRITE_LINE_MEMBER(snug_bwg_device::dsel3_w)
+void snug_bwg_device::dsel3_w(int state)
{
select_drive(3, state);
}
-WRITE_LINE_MEMBER(snug_bwg_device::dsel4_w)
+void snug_bwg_device::dsel4_w(int state)
{
select_drive(4, state);
}
@@ -472,7 +472,7 @@ void snug_bwg_device::select_drive(int n, int state)
}
}
-WRITE_LINE_MEMBER(snug_bwg_device::sidsel_w)
+void snug_bwg_device::sidsel_w(int state)
{
// Select side of disk (bit 7)
if (m_sel_floppy != 0)
@@ -482,7 +482,7 @@ WRITE_LINE_MEMBER(snug_bwg_device::sidsel_w)
}
}
-WRITE_LINE_MEMBER(snug_bwg_device::dden_w)
+void snug_bwg_device::dden_w(int state)
{
/* double density enable (active low) */
LOGMASKED(LOG_CRU, "Set density (bit 10) = %d (%s)\n", state, (state!=0)? "single" : "double");
@@ -492,7 +492,7 @@ WRITE_LINE_MEMBER(snug_bwg_device::dden_w)
/*
All floppy motors are operated by the same line.
*/
-WRITE_LINE_MEMBER(snug_bwg_device::motorona_w)
+void snug_bwg_device::motorona_w(int state)
{
m_MOTOR_ON = state;
LOGMASKED(LOG_MOTOR, "Motor %s\n", state? "on" : "off");
@@ -588,10 +588,12 @@ INPUT_PORTS_START( bwg_fdc )
PORT_DIPSETTING( 0x03, "DSK1-DSK4")
INPUT_PORTS_END
-FLOPPY_FORMATS_MEMBER(snug_bwg_device::floppy_formats)
- FLOPPY_TI99_SDF_FORMAT,
- FLOPPY_TI99_TDF_FORMAT
-FLOPPY_FORMATS_END
+void snug_bwg_device::floppy_formats(format_registration &fr)
+{
+ fr.add_mfm_containers();
+ fr.add(FLOPPY_TI99_SDF_FORMAT);
+ fr.add(FLOPPY_TI99_TDF_FORMAT);
+}
static void bwg_floppies(device_slot_interface &device)
{
@@ -653,4 +655,4 @@ const tiny_rom_entry *snug_bwg_device::device_rom_region() const
return ROM_NAME( bwg_fdc );
}
-} } } // end namespace bus::ti99::peb
+} // end namespace bus::ti99::peb