summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2015-06-02 16:23:13 +0200
committer Dirk Best <mail@dirk-best.de>2015-06-02 16:23:34 +0200
commit0f170cfe31172324686886b8c1aedc01822681bc (patch)
tree46396ec201d94812cb03210ed87f301232cd1cdb /src
parent3aeb79cbc0b8a92b304a5bcb368c186b7958ff71 (diff)
rm380z: updated to use the new wd fdc
Diffstat (limited to 'src')
-rw-r--r--src/mess/drivers/rm380z.c20
-rw-r--r--src/mess/includes/rm380z.h10
-rw-r--r--src/mess/machine/rm380z.c39
3 files changed, 22 insertions, 47 deletions
diff --git a/src/mess/drivers/rm380z.c b/src/mess/drivers/rm380z.c
index 2765039f172..e14d6586a59 100644
--- a/src/mess/drivers/rm380z.c
+++ b/src/mess/drivers/rm380z.c
@@ -103,10 +103,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( rm380z_io , AS_IO, 8, rm380z_state)
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0xbf) AM_READWRITE(rm380z_portlow_r, rm380z_portlow_w)
- AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("wd1771", fd1771_device, status_r, command_w)
- AM_RANGE(0xc1, 0xc1) AM_DEVREADWRITE("wd1771", fd1771_device, track_r, track_w)
- AM_RANGE(0xc2, 0xc2) AM_DEVREADWRITE("wd1771", fd1771_device, sector_r, sector_w)
- AM_RANGE(0xc3, 0xc3) AM_DEVREADWRITE("wd1771", fd1771_device, data_r, data_w)
+ AM_RANGE(0xc0, 0xc3) AM_DEVREADWRITE("wd1771", fd1771_t, read, write)
AM_RANGE(0xc4, 0xc4) AM_WRITE(disk_0_control)
AM_RANGE(0xc5, 0xff) AM_READWRITE(rm380z_porthi_r, rm380z_porthi_w)
ADDRESS_MAP_END
@@ -120,12 +117,9 @@ INPUT_PORTS_END
//
//
-static const floppy_interface rm380z_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_SSSD,
- LEGACY_FLOPPY_OPTIONS_NAME(default),
- NULL
-};
+static SLOT_INTERFACE_START( rm380z_floppies )
+ SLOT_INTERFACE("sssd", FLOPPY_525_SSSD)
+SLOT_INTERFACE_END
UINT32 rm380z_state::screen_update_rm380z(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
@@ -157,10 +151,10 @@ static MACHINE_CONFIG_START( rm380z, rm380z_state )
MCFG_RAM_DEFAULT_SIZE("56K")
/* floppy disk */
- MCFG_DEVICE_ADD("wd1771", FD1771, 0)
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
+ MCFG_FD1771x_ADD("wd1771", XTAL_1MHz)
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(rm380z_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD("wd1771:0", rm380z_floppies, "sssd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("wd1771:1", rm380z_floppies, "sssd", floppy_image_device::default_floppy_formats)
/* keyboard */
MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0)
diff --git a/src/mess/includes/rm380z.h b/src/mess/includes/rm380z.h
index 394446daeca..b3b47a23bfd 100644
--- a/src/mess/includes/rm380z.h
+++ b/src/mess/includes/rm380z.h
@@ -14,7 +14,7 @@ Research Machines RM 380Z
#include "cpu/z80/z80.h"
#include "machine/ram.h"
#include "imagedev/flopdrv.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#include "machine/keyboard.h"
//
@@ -89,13 +89,17 @@ public:
required_device<cpu_device> m_maincpu;
required_device<ram_device> m_messram;
- optional_device<fd1771_device> m_fdc;
+ required_device<fd1771_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
rm380z_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, RM380Z_MAINCPU_TAG),
m_messram(*this, RAM_TAG),
- m_fdc(*this, "wd1771")
+ m_fdc(*this, "wd1771"),
+ m_floppy0(*this, "wd1771:0"),
+ m_floppy1(*this, "wd1771:1")
{
}
diff --git a/src/mess/machine/rm380z.c b/src/mess/machine/rm380z.c
index 4fb941b82b9..082dbf6ff75 100644
--- a/src/mess/machine/rm380z.c
+++ b/src/mess/machine/rm380z.c
@@ -210,41 +210,18 @@ WRITE8_MEMBER( rm380z_state::keyboard_put )
WRITE8_MEMBER( rm380z_state::disk_0_control )
{
- fd1771_device *fdc = machine().device<fd1771_device>("wd1771");
+ floppy_image_device *floppy = NULL;
- //printf("disk drive port0 write [%x]\n",data);
+ if (BIT(data, 0)) floppy = m_floppy0->get_device();
+ if (BIT(data, 1)) floppy = m_floppy1->get_device();
- // drive port0
- if (data&0x01)
- {
- // drive select bit 0
- fdc->set_drive(0);
- }
-
- if (data&0x02)
- {
- // drive select bit 1
- fdc->set_drive(1);
- }
-
- if (data&0x08)
- {
- // motor on
- }
-
- // "MSEL (dir/side select bit)"
- if (data&0x20)
- {
- fdc->set_side(1);
- }
- else
- {
- fdc->set_side(0);
- }
+ m_fdc->set_floppy(floppy);
- // set drive en- (?)
- if (data&0x40)
+ if (floppy)
{
+ // don't know how motor on is connected
+ floppy->mon_w(0);
+ floppy->ss_w(BIT(data, 5));
}
}