summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--scripts/src/bus.lua2
-rw-r--r--src/devices/bus/fp1000/fp1000_exp.cpp9
-rw-r--r--src/devices/bus/fp1000/fp1020fd.cpp91
-rw-r--r--src/devices/bus/fp1000/fp1020fd.h43
-rw-r--r--src/devices/bus/fp1000/fp1030_rampack.cpp2
-rw-r--r--src/devices/bus/fp1000/fp1060io.cpp12
-rw-r--r--src/devices/bus/fp1000/fp1060io_exp.cpp5
7 files changed, 155 insertions, 9 deletions
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua
index 990b5305c47..42f42068be0 100644
--- a/scripts/src/bus.lua
+++ b/scripts/src/bus.lua
@@ -1424,6 +1424,8 @@ if (BUSES["FP1000"]~=null) then
files {
MAME_DIR .. "src/devices/bus/fp1000/fp1000_exp.cpp",
MAME_DIR .. "src/devices/bus/fp1000/fp1000_exp.h",
+ MAME_DIR .. "src/devices/bus/fp1000/fp1020fd.cpp",
+ MAME_DIR .. "src/devices/bus/fp1000/fp1020fd.h",
MAME_DIR .. "src/devices/bus/fp1000/fp1030_rampack.cpp",
MAME_DIR .. "src/devices/bus/fp1000/fp1030_rampack.h",
MAME_DIR .. "src/devices/bus/fp1000/fp1060io.cpp",
diff --git a/src/devices/bus/fp1000/fp1000_exp.cpp b/src/devices/bus/fp1000/fp1000_exp.cpp
index 5e154d56cab..7f7c7ef5e4b 100644
--- a/src/devices/bus/fp1000/fp1000_exp.cpp
+++ b/src/devices/bus/fp1000/fp1000_exp.cpp
@@ -4,6 +4,10 @@
#include "emu.h"
#include "fp1000_exp.h"
+#define VERBOSE 1
+//#define LOG_OUTPUT_FUNC osd_printf_info
+#include "logmacro.h"
+
DEFINE_DEVICE_TYPE(FP1000_EXP_SLOT, fp1000_exp_slot_device, "fp1000_exp_slot", "FP-1000/FP-1100 Expansion Slot")
fp1000_exp_slot_device::fp1000_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
@@ -45,7 +49,6 @@ void device_fp1000_exp_interface::interface_pre_start()
void device_fp1000_exp_interface::interface_post_start()
{
-// m_slot->install_io_device(*this, &device_fp1000_exp_interface::io_map);
m_slot->select_w(false);
}
@@ -53,13 +56,13 @@ void fp1000_exp_slot_device::remap_cb()
{
if (!m_main_enable || m_dev == nullptr)
{
- logerror("%s: unmap\n", machine().describe_context());
+ LOG("%s: unmap\n", machine().describe_context());
m_iospace->unmap_readwrite(0x0000, 0xfeff);
m_iospace->unmap_readwrite(0xff00, 0xff7f);
}
else
{
- logerror("%s: map\n", machine().describe_context());
+ LOG("%s: map\n", machine().describe_context());
m_iospace->install_readwrite_handler(0xff00, 0xff7f, read8sm_delegate(*m_dev, FUNC(device_fp1000_exp_interface::id_r)), write8sm_delegate(*this, FUNC(fp1000_exp_slot_device::main_cs_w)));
m_dev->remap_cb();
}
diff --git a/src/devices/bus/fp1000/fp1020fd.cpp b/src/devices/bus/fp1000/fp1020fd.cpp
new file mode 100644
index 00000000000..6426cf1a88c
--- /dev/null
+++ b/src/devices/bus/fp1000/fp1020fd.cpp
@@ -0,0 +1,91 @@
+// license:BSD-3-Clause
+// copyright-holders:Angelo Salese
+
+#include "emu.h"
+#include "fp1020fd.h"
+
+#define VERBOSE 1
+//#define LOG_OUTPUT_FUNC osd_printf_info
+#include "logmacro.h"
+
+DEFINE_DEVICE_TYPE(FP1020FD, fp1020fd_device, "fp1020fd", "FP-1020FD FDCPACK")
+
+fp1020fd_device::fp1020fd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : fp1060io_exp_device(mconfig, FP1020FD, tag, owner, clock)
+ , m_fdc(*this, "fdc")
+ , m_floppy(*this, "fdc:%u", 0)
+{
+}
+
+void fp1020fd_device::io_map(address_map &map)
+{
+ map(0x0000, 0x0000).mirror(0xfef9).unmapr().lw8(
+ NAME([this](offs_t offset, u8 data) {
+ (void)data;
+ for (auto floppy : m_floppy)
+ {
+ floppy_image_device *fl = floppy->get_device();
+ fl->mon_w(0);
+ }
+
+ m_motor_timer->adjust(attotime::from_seconds(60));
+ })
+ );
+ map(0x0002, 0x0002).mirror(0xfef9).unmapr().lw8(
+ NAME([this](offs_t offset, u8 data) {
+ (void)data;
+ m_fdc->tc_w(true);
+ m_fdc->tc_w(false);
+ })
+ );
+ map(0x0004, 0x0004).mirror(0xfef8).r(m_fdc, FUNC(upd765a_device::msr_r));
+ map(0x0005, 0x0005).mirror(0xfef8).rw(m_fdc, FUNC(upd765a_device::fifo_r), FUNC(upd765a_device::fifo_w));
+ map(0x0006, 0x0006).mirror(0xfef8).rw(m_fdc, FUNC(upd765a_device::dma_r), FUNC(upd765a_device::dma_w));
+ map(0x0007, 0x0007).mirror(0xfef8).unmaprw();
+}
+
+
+
+static void fd1020fd_floppies(device_slot_interface &device)
+{
+ device.option_add("525dsdd", FLOPPY_525_DD);
+}
+
+void fp1020fd_device::intrq_w(int state)
+{
+ LOG("intrq_w %d\n",state);
+}
+
+void fp1020fd_device::drq_w(int state)
+{
+ LOG("drq_w %d\n",state);
+}
+
+void fp1020fd_device::device_add_mconfig(machine_config &config)
+{
+ // UPD765AC
+ // TODO: verify clock and parameters
+ UPD765A(config, m_fdc, 8'000'000, true, true);
+ m_fdc->intrq_wr_callback().set(FUNC(fp1020fd_device::intrq_w));
+ m_fdc->drq_wr_callback().set(FUNC(fp1020fd_device::drq_w));
+ FLOPPY_CONNECTOR(config, "fdc:0", fd1020fd_floppies, "525dsdd", floppy_image_device::default_mfm_floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, "fdc:1", fd1020fd_floppies, "525dsdd", floppy_image_device::default_mfm_floppy_formats).enable_sound(true);
+}
+
+void fp1020fd_device::device_start()
+{
+ m_motor_timer = timer_alloc(FUNC(fp1020fd_device::motor_timeout_cb), this);
+}
+
+void fp1020fd_device::device_reset()
+{
+}
+
+TIMER_CALLBACK_MEMBER(fp1020fd_device::motor_timeout_cb)
+{
+ for (auto floppy : m_floppy)
+ {
+ floppy_image_device *fl = floppy->get_device();
+ fl->mon_w(1);
+ }
+}
diff --git a/src/devices/bus/fp1000/fp1020fd.h b/src/devices/bus/fp1000/fp1020fd.h
new file mode 100644
index 00000000000..c3a2fb0aa7a
--- /dev/null
+++ b/src/devices/bus/fp1000/fp1020fd.h
@@ -0,0 +1,43 @@
+// license:BSD-3-Clause
+// copyright-holders:Angelo Salese
+
+#ifndef MAME_BUS_FP1020FD_H
+#define MAME_BUS_FP1020FD_H
+
+#pragma once
+
+#include "fp1060io_exp.h"
+#include "imagedev/floppy.h"
+#include "machine/timer.h"
+#include "machine/upd765.h"
+
+class fp1020fd_device : public fp1060io_exp_device
+{
+public:
+ fp1020fd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ virtual void io_map(address_map &map) override;
+ virtual u8 get_id() override { return 0x04; };
+
+
+protected:
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+private:
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ required_device<upd765a_device> m_fdc;
+ required_device_array<floppy_connector, 2> m_floppy;
+
+ TIMER_CALLBACK_MEMBER(motor_timeout_cb);
+ emu_timer *m_motor_timer;
+
+ void intrq_w(int state);
+ void drq_w(int state);
+};
+
+DECLARE_DEVICE_TYPE(FP1020FD, fp1020fd_device)
+
+
+#endif // MAME_BUS_FP1020FD_H
diff --git a/src/devices/bus/fp1000/fp1030_rampack.cpp b/src/devices/bus/fp1000/fp1030_rampack.cpp
index 49cf214b983..a0df5d048f2 100644
--- a/src/devices/bus/fp1000/fp1030_rampack.cpp
+++ b/src/devices/bus/fp1000/fp1030_rampack.cpp
@@ -7,6 +7,7 @@ FP-1030 RAMPACK
FILES"PACK<x>:" where <x> is the designated slot number 0-7
LOAD"PACKx:<filename>"
RUN
+FORMAT"PACK<x>:" to use it in BASIC as a writable buffer
**************************************************************************************************/
@@ -23,6 +24,7 @@ fp1030_rampack_device::fp1030_rampack_device(const machine_config &mconfig, cons
void fp1030_rampack_device::io_map(address_map &map)
{
+ // TODO: verify mirror/unmap
map(0x0000, 0x3fff).lrw8(
NAME([this](offs_t offset) { return m_nvram_ptr[offset & 0x3fff]; }),
NAME([this](offs_t offset, uint8_t data) { m_nvram_ptr[offset & 0x3fff] = data; })
diff --git a/src/devices/bus/fp1000/fp1060io.cpp b/src/devices/bus/fp1000/fp1060io.cpp
index bbdf70bd5aa..9ad5116b904 100644
--- a/src/devices/bus/fp1000/fp1060io.cpp
+++ b/src/devices/bus/fp1000/fp1060io.cpp
@@ -4,6 +4,10 @@
#include "emu.h"
#include "fp1060io.h"
+#define VERBOSE 1
+//#define LOG_OUTPUT_FUNC osd_printf_info
+#include "logmacro.h"
+
DEFINE_DEVICE_TYPE(FP1060IO, fp1060io_device, "fp1060io", "FP-1060I/O Expansion Box")
fp1060io_device::fp1060io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
@@ -32,11 +36,11 @@ void fp1060io_device::device_reset()
u8 fp1060io_device::id_r(offs_t offset)
{
- logerror("%s: ID select %02x\n", machine().describe_context(), m_slot_select);
+ LOG("ID select %02x\n", m_slot_select);
if (m_slot_select & 0xc)
return 0xff;
const auto dev = m_subslot[m_slot_select]->m_dev;
- //logerror("\texists: %d\n", dev != nullptr);
+ //LOG("\texists: %d\n", dev != nullptr);
if (dev == nullptr)
return 0xff;
@@ -51,13 +55,13 @@ void fp1060io_device::cs_w(offs_t offset, u8 data)
void fp1060io_device::remap_cb()
{
- logerror("%s: remap_cb %02x\n", machine().describe_context(), m_slot_select);
+ LOG("remap_cb %02x\n", m_slot_select);
if (m_slot_select & 0xc)
m_slot->iospace().unmap_readwrite(0x0000, 0xfeff);
else
{
const auto dev = m_subslot[m_slot_select]->m_dev;
- //logerror("\texists %d\n", dev != nullptr);
+ //LOG("\texists %d\n", dev != nullptr);
if (dev == nullptr)
m_slot->iospace().unmap_readwrite(0x0000, 0xfeff);
else
diff --git a/src/devices/bus/fp1000/fp1060io_exp.cpp b/src/devices/bus/fp1000/fp1060io_exp.cpp
index 891546ab54e..99ba9976412 100644
--- a/src/devices/bus/fp1000/fp1060io_exp.cpp
+++ b/src/devices/bus/fp1000/fp1060io_exp.cpp
@@ -62,8 +62,7 @@ void device_fp1060io_exp_interface::interface_pre_start()
void device_fp1060io_exp_interface::interface_post_start()
{
-// m_slot->install_io_device(*this, &device_fp1000_exp_interface::io_map);
-// m_slot->select_w(false);
+ // Dynamic mapping, shouldn't need anything from here
}
fp1060io_exp_device::fp1060io_exp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
@@ -78,10 +77,12 @@ void fp1060io_exp_device::device_start()
}
+#include "fp1020fd.h"
#include "fp1030_rampack.h"
void fp1060io_slot_devices(device_slot_interface &device)
{
+ device.option_add("fdcpack", FP1020FD);
device.option_add("rampack", FP1030_RAMPACK);
}