summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/a2bus/agat_fdc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/a2bus/agat_fdc.cpp')
-rw-r--r--src/devices/bus/a2bus/agat_fdc.cpp46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/devices/bus/a2bus/agat_fdc.cpp b/src/devices/bus/a2bus/agat_fdc.cpp
index bc995dde0bb..dc88c7ea39e 100644
--- a/src/devices/bus/a2bus/agat_fdc.cpp
+++ b/src/devices/bus/a2bus/agat_fdc.cpp
@@ -63,10 +63,11 @@ ROM_END
// device_add_mconfig - add device configuration
//-------------------------------------------------
-FLOPPY_FORMATS_MEMBER( a2bus_agat_fdc_device::floppy_formats )
- FLOPPY_DS9_FORMAT,
- FLOPPY_AIM_FORMAT
-FLOPPY_FORMATS_END
+void a2bus_agat_fdc_device::floppy_formats(format_registration &fr)
+{
+ fr.add(FLOPPY_DS9_FORMAT);
+ fr.add(FLOPPY_AIM_FORMAT);
+}
static void agat_floppies(device_slot_interface &device)
{
@@ -139,8 +140,8 @@ void a2bus_agat_fdc_device::device_start()
m_mxcs = MXCSR_SYNC;
- m_timer_lss = timer_alloc(TIMER_ID_LSS);
- m_timer_motor = timer_alloc(TIMER_ID_MOTOR);
+ m_timer_lss = timer_alloc(FUNC(a2bus_agat_fdc_device::lss_sync), this);
+ m_timer_motor = timer_alloc(FUNC(a2bus_agat_fdc_device::motor_off), this);
m_seektime = 6; // ms, per es5323.txt
m_waittime = 32; // us - 16 bits x 2 us
@@ -161,19 +162,10 @@ void a2bus_agat_fdc_device::device_reset()
m_timer_lss->adjust(attotime::from_msec(10), 0, attotime::from_msec(10));
}
-void a2bus_agat_fdc_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+TIMER_CALLBACK_MEMBER(a2bus_agat_fdc_device::motor_off)
{
- switch (id)
- {
- case TIMER_ID_LSS:
- lss_sync();
- break;
-
- case TIMER_ID_MOTOR:
- active = 0;
- floppy->mon_w(1);
- break;
- }
+ active = 0;
+ floppy->mon_w(1);
}
uint64_t a2bus_agat_fdc_device::time_to_cycles(const attotime &tm)
@@ -198,7 +190,7 @@ void a2bus_agat_fdc_device::lss_start()
bits = 8;
}
-void a2bus_agat_fdc_device::lss_sync()
+TIMER_CALLBACK_MEMBER(a2bus_agat_fdc_device::lss_sync)
{
if(!active)
return;
@@ -300,7 +292,7 @@ uint8_t a2bus_agat_fdc_device::read_c0nx(uint8_t offset)
{
u8 data;
- lss_sync();
+ lss_sync(0);
switch (offset)
{
@@ -327,7 +319,7 @@ uint8_t a2bus_agat_fdc_device::read_c0nx(uint8_t offset)
void a2bus_agat_fdc_device::write_c0nx(uint8_t offset, uint8_t data)
{
- lss_sync();
+ lss_sync(0);
switch (offset)
{
@@ -384,7 +376,7 @@ uint8_t a2bus_agat_fdc_device::read_cnxx(uint8_t offset)
*/
uint8_t a2bus_agat_fdc_device::d14_i_b()
{
- u8 data = 0x3;
+ u8 data = 0x0;
// all signals active low
if (floppy)
@@ -421,6 +413,16 @@ void a2bus_agat_fdc_device::d14_o_c(uint8_t data)
{
m_unit = BIT(data, 3);
+ switch (m_unit)
+ {
+ case 0:
+ floppy = floppy0 ? floppy0->get_device() : nullptr;
+ break;
+ case 1:
+ floppy = floppy1 ? floppy1->get_device() : nullptr;
+ break;
+ }
+
if (floppy)
{
floppy->dir_w(!BIT(data, 2));