summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author arbee <rb6502@users.noreply.github.com>2019-07-03 20:56:10 -0400
committer arbee <rb6502@users.noreply.github.com>2019-07-03 20:56:10 -0400
commit515bbedaf33aa39869d918580713f7d2589ed4fd (patch)
treef5e0ae2d71d7327a75a57cb51a4687cc9c1c8952
parent30970c8e9301d7288158eda2a0eedd4ae989fffa (diff)
f2mc16: add MB90610A and MB90611A microcontrollers. [R. Belmont]
-rw-r--r--scripts/src/cpu.lua2
-rw-r--r--src/devices/cpu/f2mc16/f2mc16.cpp9
-rw-r--r--src/devices/cpu/f2mc16/mb9061x.cpp95
-rw-r--r--src/devices/cpu/f2mc16/mb9061x.h64
-rw-r--r--src/mame/drivers/tomy_princ.cpp6
5 files changed, 170 insertions, 6 deletions
diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua
index 8df322f3e9f..c77f74ff90f 100644
--- a/scripts/src/cpu.lua
+++ b/scripts/src/cpu.lua
@@ -2924,6 +2924,8 @@ if (CPUS["F2MC16"]~=null) then
files {
MAME_DIR .. "src/devices/cpu/f2mc16/f2mc16.cpp",
MAME_DIR .. "src/devices/cpu/f2mc16/f2mc16.h",
+ MAME_DIR .. "src/devices/cpu/f2mc16/mb9061x.cpp",
+ MAME_DIR .. "src/devices/cpu/f2mc16/mb9061x.h",
}
end
diff --git a/src/devices/cpu/f2mc16/f2mc16.cpp b/src/devices/cpu/f2mc16/f2mc16.cpp
index b27607acdbd..5e2eb49f44b 100644
--- a/src/devices/cpu/f2mc16/f2mc16.cpp
+++ b/src/devices/cpu/f2mc16/f2mc16.cpp
@@ -3,11 +3,15 @@
/***************************************************************************
Fujitsu Micro F2MC-16 series
+ Emulation by R. Belmont
From 50,000 feet these chips look a lot like a 65C816 with no index
registers. As you get closer, you can see the banking includes some
concepts from 8086 segmentation, and the interrupt handling is 68000-like.
+ There are two main branches: F and L. They appear to be compatible with
+ each other as far as their extentions to the base ISA not conflicting.
+
***************************************************************************/
#include "emu.h"
@@ -62,8 +66,8 @@ void f2mc16_device::device_start()
state_add(STATE_GENPC, "GENPC", m_temp).callimport().callexport().noshow();
state_add(STATE_GENPCBASE, "CURPC", m_temp).callimport().callexport().noshow();
state_add(F2MC16_PS, "PS", m_ps).formatstr("%04X");
- state_add(F2MC16_PCB, "DTB", m_dtb).formatstr("%02X");
- state_add(F2MC16_PCB, "ADB", m_adb).formatstr("%02X");
+ state_add(F2MC16_DTB, "DTB", m_dtb).formatstr("%02X");
+ state_add(F2MC16_ADB, "ADB", m_adb).formatstr("%02X");
state_add(F2MC16_ACC, "AL", m_acc).formatstr("%08X");
state_add(F2MC16_USB, "USB", m_usb).formatstr("%02X");
state_add(F2MC16_USP, "USP", m_usp).formatstr("%04X");
@@ -113,7 +117,6 @@ void f2mc16_device::state_export(const device_state_entry &entry)
void f2mc16_device::execute_run()
{
debugger_instruction_hook((m_pcb<<16) | m_pc);
- printf("Debug hook: %06x\n", (m_pcb<<16) | m_pc);
m_icount = 0;
}
diff --git a/src/devices/cpu/f2mc16/mb9061x.cpp b/src/devices/cpu/f2mc16/mb9061x.cpp
new file mode 100644
index 00000000000..42bd555dba5
--- /dev/null
+++ b/src/devices/cpu/f2mc16/mb9061x.cpp
@@ -0,0 +1,95 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*
+ Fujitsu Micro MB9061x Microcontroller Family
+ Emulation by R. Belmont
+*/
+
+#include "emu.h"
+#include "mb9061x.h"
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(MB90610A, mb90610_device, "mb90610a", "Fujitsu MB90610A")
+DEFINE_DEVICE_TYPE(MB90611A, mb90611_device, "mb90611a", "Fujitsu MB90611A")
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// mb9061x_device - constructor
+//-------------------------------------------------
+mb9061x_device::mb9061x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal_map) :
+ f2mc16_device(mconfig, type, tag, owner, clock),
+ m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0, internal_map)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void mb9061x_device::device_start()
+{
+ f2mc16_device::device_start();
+}
+
+
+device_memory_interface::space_config_vector mb9061x_device::memory_space_config() const
+{
+ return space_config_vector {
+ std::make_pair(AS_PROGRAM, &m_program_config)
+ };
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void mb9061x_device::device_reset()
+{
+ f2mc16_device::device_reset();
+}
+
+void mb9061x_device::execute_set_input(int inputnum, int state)
+{
+}
+
+/* MB90610 - "Evaluation device" with extra RAM */
+void mb90610_device::mb90610_map(address_map &map)
+{
+ map(0x0100, 0x10ff).ram(); // 4K of internal RAM from 0x100 to 0x1100
+}
+
+mb90610_device::mb90610_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ mb90610_device(mconfig, MB90610A, tag, owner, clock)
+{
+}
+
+mb90610_device::mb90610_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+ mb9061x_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(mb90610_device::mb90610_map), this))
+{
+}
+
+/* MB90611 - Production version of this series */
+void mb90611_device::mb90611_map(address_map &map)
+{
+ map(0x0100, 0x04ff).ram(); // 1K of internal RAM from 0x100 to 0x500
+}
+
+mb90611_device::mb90611_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ mb90611_device(mconfig, MB90611A, tag, owner, clock)
+{
+}
+
+mb90611_device::mb90611_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+ mb9061x_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(mb90611_device::mb90611_map), this))
+{
+}
diff --git a/src/devices/cpu/f2mc16/mb9061x.h b/src/devices/cpu/f2mc16/mb9061x.h
new file mode 100644
index 00000000000..7a463577402
--- /dev/null
+++ b/src/devices/cpu/f2mc16/mb9061x.h
@@ -0,0 +1,64 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+#ifndef MAME_CPU_F2MC16_MB9061X_H
+#define MAME_CPU_F2MC16_MB9061X_H
+
+#pragma once
+
+#include "f2mc16.h"
+
+//**************************************************************************
+// CONSTANTS
+//**************************************************************************
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> m5074x_device
+
+class mb9061x_device : public f2mc16_device
+{
+ friend class mb90610_device;
+ friend class mb90611_device;
+
+public:
+ const address_space_config m_program_config;
+
+protected:
+ // construction/destruction
+ mb9061x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal_map);
+
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+ virtual void execute_set_input(int inputnum, int state) override;
+ virtual space_config_vector memory_space_config() const override;
+
+private:
+};
+
+class mb90610_device : public mb9061x_device
+{
+public:
+ mb90610_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ void mb90610_map(address_map &map);
+protected:
+ mb90610_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+};
+
+class mb90611_device : public mb9061x_device
+{
+public:
+ mb90611_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ void mb90611_map(address_map &map);
+protected:
+ mb90611_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+};
+
+DECLARE_DEVICE_TYPE(MB90610A, mb90610_device)
+DECLARE_DEVICE_TYPE(MB90611A, mb90611_device)
+
+#endif // MAME_CPU_F2MC16_MB9061X_H
diff --git a/src/mame/drivers/tomy_princ.cpp b/src/mame/drivers/tomy_princ.cpp
index ae8b4fb67a5..704cf4fbf2b 100644
--- a/src/mame/drivers/tomy_princ.cpp
+++ b/src/mame/drivers/tomy_princ.cpp
@@ -10,7 +10,7 @@
#include "emu.h"
#include "screen.h"
#include "speaker.h"
-#include "cpu/f2mc16/f2mc16.h"
+#include "cpu/f2mc16/mb9061x.h"
#include "bus/generic/slot.h"
#include "bus/generic/carts.h"
@@ -54,8 +54,8 @@ INPUT_PORTS_END
void tomy_princ_state::tomy_princ(machine_config &config)
{
- // F2MC-16L based CPU
- F2MC16(config, m_maincpu, 16_MHz_XTAL);
+ // MB90611A microcontroller, F2MC-16L architecture
+ MB90611A(config, m_maincpu, 16_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &tomy_princ_state::princ_map);
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);