summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Robbbert <robbbert@users.noreply.github.com>2013-12-15 05:33:35 +0000
committer Robbbert <robbbert@users.noreply.github.com>2013-12-15 05:33:35 +0000
commit098d8d7d189fa3230c6956a0f935026021107d97 (patch)
tree7f03be65161d36f625d636d860c7c5de4b95e89f /src
parentad44f27ff973707a3325e4d4d06f66edeab190dc (diff)
(MESS) v6809 : added fdc
Diffstat (limited to 'src')
-rw-r--r--src/mess/drivers/v6809.c50
1 files changed, 44 insertions, 6 deletions
diff --git a/src/mess/drivers/v6809.c b/src/mess/drivers/v6809.c
index a45af03eca5..f0cba64b587 100644
--- a/src/mess/drivers/v6809.c
+++ b/src/mess/drivers/v6809.c
@@ -31,14 +31,20 @@ M modify memory (. to exit)
ToDo:
-- Colours (a photo shows colours but the schematic doesn't
+ - Colours (a photo shows colours but the schematic doesn't
have any ram for colours).
-- Connect the devices (RTC, FDC).
+ - Connect the RTC.
-- Find the missing character generator rom.
+ - Find the missing character generator rom.
-- Add sound. Pressing BEL character issues commands to the timer chip.
+ - Add sound. Pressing BEL character issues commands to the timer chip.
+
+ - Schematic is almost useless, riddled with omissions and errors.
+ All documents are in French, so no help there. The parts list
+ only has half of the parts.
+
+ - Need software
****************************************************************************/
@@ -51,6 +57,7 @@ ToDo:
#include "machine/6850acia.h"
#include "machine/keyboard.h"
#include "sound/speaker.h"
+#include "machine/wd_fdc.h"
@@ -63,9 +70,12 @@ public:
, m_pia0(*this, "pia0")
, m_maincpu(*this, "maincpu")
, m_crtc(*this, "crtc")
+ , m_fdc(*this, "fdc")
+ , m_floppy0(*this, "fdc:0")
{ }
DECLARE_READ8_MEMBER(pb_r);
+ DECLARE_WRITE8_MEMBER(pa_w);
DECLARE_WRITE8_MEMBER(videoram_w);
DECLARE_WRITE8_MEMBER(v6809_address_w);
DECLARE_WRITE8_MEMBER(v6809_register_w);
@@ -81,6 +91,8 @@ private:
required_device<pia6821_device> m_pia0;
required_device<cpu_device> m_maincpu;
required_device<mc6845_device> m_crtc;
+ required_device<mb8876_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
};
@@ -94,7 +106,7 @@ static ADDRESS_MAP_START(v6809_mem, AS_PROGRAM, 8, v6809_state)
AM_RANGE(0xf505, 0xf505) AM_MIRROR(0x36) AM_DEVREADWRITE("acia0", acia6850_device, data_read, data_write)
AM_RANGE(0xf50c, 0xf50c) AM_MIRROR(0x36) AM_DEVREADWRITE("acia1", acia6850_device, status_read, control_write) // printer
AM_RANGE(0xf50d, 0xf50d) AM_MIRROR(0x36) AM_DEVREADWRITE("acia1", acia6850_device, data_read, data_write)
- //AM_RANGE(0xf600, 0xf603) AM_MIRROR(0x3c) disk controller
+ AM_RANGE(0xf600, 0xf603) AM_MIRROR(0x3c) AM_DEVREADWRITE("fdc", mb8876_t, read, write)
//AM_RANGE(0xf640, 0xf64f) AM_MIRROR(0x30) real time clock
AM_RANGE(0xf680, 0xf683) AM_MIRROR(0x3c) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
AM_RANGE(0xf6c8, 0xf6cf) AM_MIRROR(0x08) AM_DEVREADWRITE("ptm", ptm6840_device, read, write)
@@ -239,6 +251,26 @@ READ8_MEMBER( v6809_state::pb_r )
return ret;
}
+// can support 4 drives
+WRITE8_MEMBER( v6809_state::pa_w )
+{
+ floppy_image_device *floppy = NULL;
+ if ((data & 3) == 0) floppy = m_floppy0->get_device();
+ //if ((data & 3) == 1) floppy = m_floppy1->get_device();
+ //if ((data & 3) == 2) floppy = m_floppy2->get_device();
+ //if ((data & 3) == 3) floppy = m_floppy3->get_device();
+
+ m_fdc->set_floppy(floppy);
+
+// Bits 2 and 3 go to the floppy connector but are not documented
+
+ if (floppy)
+ {
+ floppy->mon_w(0);
+ m_fdc->dden_w(BIT(data, 4));
+ }
+}
+
// port A = drive select and 2 control lines ; port B = keyboard
static const pia6821_interface pia0_intf =
{
@@ -248,7 +280,7 @@ static const pia6821_interface pia0_intf =
DEVCB_NULL, /* CB1 input */
DEVCB_NULL, /* CA2 input */
DEVCB_NULL, /* CB2 input */
- DEVCB_NULL, /* port A output */
+ DEVCB_DRIVER_MEMBER(v6809_state, pa_w), /* port A output */
DEVCB_NULL, /* port B output */
DEVCB_NULL, /* CA2 output */
DEVCB_NULL, /* CB2 output */
@@ -295,6 +327,10 @@ static ACIA6850_INTERFACE( mc6850_intf )
DEVCB_NULL
};
+static SLOT_INTERFACE_START( v6809_floppies )
+ SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
+SLOT_INTERFACE_END
+
// *** Machine ****
static MACHINE_CONFIG_START( v6809, v6809_state )
@@ -328,6 +364,8 @@ static MACHINE_CONFIG_START( v6809, v6809_state )
MCFG_PTM6840_ADD("ptm", mc6840_intf)
MCFG_ACIA6850_ADD("acia0", mc6850_intf)
MCFG_ACIA6850_ADD("acia1", mc6850_intf)
+ MCFG_MB8876x_ADD("fdc", XTAL_16MHz / 16)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", v6809_floppies, "525dd", floppy_image_device::default_floppy_formats)
MACHINE_CONFIG_END
/* ROM definition */