create derived CPU type so that code can be put in the correct place (nw)

This commit is contained in:
David Haywood 2015-10-29 19:21:01 +00:00
parent 7793b9af43
commit de9353adcb
5 changed files with 101 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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::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 );
}

View File

@ -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__