mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
Don't need a trampoline for these and added bare-bones SCI
This commit is contained in:
parent
f6ad513ab0
commit
1c12f1f20d
@ -150,20 +150,10 @@ void sh7604_bus_device::device_reset()
|
||||
// READ/WRITE HANDLERS
|
||||
//**************************************************************************
|
||||
|
||||
inline void sh7604_bus_device::writeword(offs_t address, UINT16 data)
|
||||
{
|
||||
space().write_word(address, data);
|
||||
}
|
||||
|
||||
inline UINT16 sh7604_bus_device::readword(offs_t address)
|
||||
{
|
||||
return space().read_word(address);
|
||||
}
|
||||
|
||||
READ32_MEMBER( sh7604_bus_device::read )
|
||||
{
|
||||
// 16 bit access only, TODO
|
||||
return readword(offset);
|
||||
return space.read_word(offset) & 0xffff;
|
||||
}
|
||||
|
||||
WRITE32_MEMBER( sh7604_bus_device::write )
|
||||
@ -177,5 +167,5 @@ WRITE32_MEMBER( sh7604_bus_device::write )
|
||||
throw emu_fatalerror("%s: making bus write with ID signature = %04x!\n", tag(),data >> 16);
|
||||
}
|
||||
|
||||
writeword(offset,data & 0xffff);
|
||||
space.write_word(offset,data & 0xffff);
|
||||
}
|
||||
|
@ -61,8 +61,6 @@ protected:
|
||||
private:
|
||||
bool m_is_slave;
|
||||
const address_space_config m_space_config;
|
||||
void writeword(offs_t address, UINT16 data);
|
||||
UINT16 readword(offs_t address);
|
||||
|
||||
UINT16 m_bcr1;
|
||||
UINT16 m_bcr2;
|
||||
|
78
src/devices/cpu/sh2/sh7604_sci.cpp
Normal file
78
src/devices/cpu/sh2/sh7604_sci.cpp
Normal file
@ -0,0 +1,78 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:<author_name>
|
||||
/***************************************************************************
|
||||
|
||||
Template for skeleton device
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "sh7604_sci.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
// device type definition
|
||||
const device_type SH7604_SCI = &device_creator<sh7604_sci_device>;
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
static ADDRESS_MAP_START( sci_regs, AS_0, 8, sh7604_sci_device )
|
||||
|
||||
ADDRESS_MAP_END
|
||||
|
||||
//-------------------------------------------------
|
||||
// sh7604_sci_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
sh7604_sci_device::sh7604_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, SH7604_SCI, "sh7604_sci_longname", tag, owner, clock, "sh7604_sci", __FILE__),
|
||||
device_memory_interface(mconfig, *this),
|
||||
m_space_config("regs", ENDIANNESS_BIG, 8, 4, 0, nullptr, *ADDRESS_MAP_NAME(sci_regs))
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
const address_space_config *sh7604_sci_device::memory_space_config(address_spacenum spacenum) const
|
||||
{
|
||||
return (spacenum == AS_0) ? &m_space_config : nullptr;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void sh7604_sci_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void sh7604_sci_device::device_reset()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// READ/WRITE HANDLERS
|
||||
//**************************************************************************
|
||||
|
||||
READ8_MEMBER( sh7604_sci_device::read )
|
||||
{
|
||||
return space.read_byte(offset);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( sh7604_sci_device::write )
|
||||
{
|
||||
space.write_byte(offset,data);
|
||||
}
|
62
src/devices/cpu/sh2/sh7604_sci.h
Normal file
62
src/devices/cpu/sh2/sh7604_sci.h
Normal file
@ -0,0 +1,62 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:<author_name>
|
||||
/***************************************************************************
|
||||
|
||||
Template for skeleton device
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __SH7604_SCIDEV_H__
|
||||
#define __SH7604_SCIDEV_H__
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INTERFACE CONFIGURATION MACROS
|
||||
//**************************************************************************
|
||||
|
||||
#define MCFG_SH7604_SCI_ADD(_tag,_freq) \
|
||||
MCFG_DEVICE_ADD(_tag, SH7604_SCI, _freq)
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> sh7604_sci_device
|
||||
|
||||
class sh7604_sci_device : public device_t,
|
||||
public device_memory_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
sh7604_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// I/O operations
|
||||
DECLARE_WRITE8_MEMBER( write );
|
||||
DECLARE_READ8_MEMBER( read );
|
||||
|
||||
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override;
|
||||
protected:
|
||||
// device-level overrides
|
||||
// virtual void device_validity_check(validity_checker &valid) const;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
private:
|
||||
const address_space_config m_space_config;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type SH7604_SCI;
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user