From de9353adcbf2883e89dd644a25c44b8b49ec7f40 Mon Sep 17 00:00:00 2001 From: David Haywood Date: Thu, 29 Oct 2015 19:21:01 +0000 Subject: [PATCH] create derived CPU type so that code can be put in the correct place (nw) --- scripts/src/cpu.lua | 2 ++ src/devices/bus/vcs/harmony_melody.c | 2 +- src/devices/bus/vcs/harmony_melody.h | 2 +- src/devices/cpu/arm7/lpc210x.c | 53 ++++++++++++++++++++++++++++ src/devices/cpu/arm7/lpc210x.h | 44 +++++++++++++++++++++++ 5 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 src/devices/cpu/arm7/lpc210x.c create mode 100644 src/devices/cpu/arm7/lpc210x.h diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index 1a8f6f0b67d..3223db4a0ad 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -132,6 +132,8 @@ if (CPUS["ARM7"]~=null) then MAME_DIR .. "src/devices/cpu/arm7/arm7.h", MAME_DIR .. "src/devices/cpu/arm7/arm7thmb.c", MAME_DIR .. "src/devices/cpu/arm7/arm7ops.c", + MAME_DIR .. "src/devices/cpu/arm7/lpc210x.c", + MAME_DIR .. "src/devices/cpu/arm7/lpc210x.h", } end diff --git a/src/devices/bus/vcs/harmony_melody.c b/src/devices/bus/vcs/harmony_melody.c index 4b6b223ba27..917f1c9f8f0 100644 --- a/src/devices/bus/vcs/harmony_melody.c +++ b/src/devices/bus/vcs/harmony_melody.c @@ -120,7 +120,7 @@ static ADDRESS_MAP_START( harmony_arm7_map, AS_PROGRAM, 32, a26_rom_harmony_devi ADDRESS_MAP_END static MACHINE_CONFIG_FRAGMENT( a26_harmony ) - MCFG_CPU_ADD("arm", ARM7, 70000000) + MCFG_CPU_ADD("arm", LPC2103, 70000000) MCFG_CPU_PROGRAM_MAP(harmony_arm7_map) MACHINE_CONFIG_END diff --git a/src/devices/bus/vcs/harmony_melody.h b/src/devices/bus/vcs/harmony_melody.h index a232cf57222..c9b4550bac6 100644 --- a/src/devices/bus/vcs/harmony_melody.h +++ b/src/devices/bus/vcs/harmony_melody.h @@ -4,7 +4,7 @@ #define __VCS_HARMONY_H #include "rom.h" -#include "cpu/arm7/arm7.h" +#include "cpu/arm7/lpc210x.h" // ======================> a26_rom_harmony_device diff --git a/src/devices/cpu/arm7/lpc210x.c b/src/devices/cpu/arm7/lpc210x.c new file mode 100644 index 00000000000..6ae9ad0e889 --- /dev/null +++ b/src/devices/cpu/arm7/lpc210x.c @@ -0,0 +1,53 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood +/*************************************************************************** + + NXP (Phillips) LPC2103 series + covering LPC2101, LPC2102, LPC2103* + + *currently only LPC2103 + + these are based on an ARM7TDMI-S CPU + internal flash and integrated peripherals + +***************************************************************************/ + +#include "lpc210x.h" + +const device_type LPC2103 = &device_creator; + + +lpc210x_device::lpc210x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : arm7_cpu_device(mconfig, LPC2103, "LPC2103", tag, owner, clock, "lpc2103", __FILE__, 4, eARM_ARCHFLAGS_T, ENDIANNESS_LITTLE) +{ +} + + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void lpc210x_device::device_start() +{ + arm7_cpu_device::device_start(); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void lpc210x_device::device_reset() +{ + arm7_cpu_device::device_reset(); +} + + +static MACHINE_CONFIG_FRAGMENT( lpc210x ) +MACHINE_CONFIG_END + +machine_config_constructor lpc210x_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( lpc210x ); +} diff --git a/src/devices/cpu/arm7/lpc210x.h b/src/devices/cpu/arm7/lpc210x.h new file mode 100644 index 00000000000..45377881f50 --- /dev/null +++ b/src/devices/cpu/arm7/lpc210x.h @@ -0,0 +1,44 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood + +#pragma once + +#ifndef __LPC2103__ +#define __LPC2103__ + +#include "emu.h" +#include "arm7.h" +#include "arm7core.h" + +/*************************************************************************** + DEVICE CONFIGURATION MACROS +***************************************************************************/ + + +/*************************************************************************** + TYPE DEFINITIONS +***************************************************************************/ + +class lpc210x_device : public arm7_cpu_device +{ +public: + lpc210x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + + // static configuration helpers + +protected: + // device-level overrides + virtual machine_config_constructor device_mconfig_additions() const; + virtual void device_start(); + virtual void device_reset(); + + +private: +}; + + +// device type definition +extern const device_type LPC2103; + + +#endif /// __LPC2103__