am8052: Skeleton device implementation (inadvertently omitted from 6a3e79f9a7, nw)

This commit is contained in:
AJR 2019-08-03 10:53:07 -04:00
parent 6a3e79f9a7
commit 33e71d9ae6
2 changed files with 106 additions and 0 deletions

View File

@ -0,0 +1,64 @@
// license:BSD-3-Clause
// copyright-holders:AJR
/**********************************************************************
AMD Am8052 Alphanumeric CRT Controller (CRTC)
Skeleton device.
**********************************************************************/
#include "emu.h"
#include "video/am8052.h"
//#include "screen.h"
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
// device type definition
DEFINE_DEVICE_TYPE(AM8052, am8052_device, "am8052", "Am8052 CRTC")
//**************************************************************************
// DEVICE IMPLEMENTATION
//**************************************************************************
//-------------------------------------------------
// am8052_device - constructor
//-------------------------------------------------
am8052_device::am8052_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, AM8052, tag, owner, clock)
, m_pointer(0xffff)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void am8052_device::device_start()
{
save_item(NAME(m_pointer));
}
//-------------------------------------------------
// pointer_w - set pointer register
//-------------------------------------------------
void am8052_device::pointer_w(u16 data)
{
m_pointer = data;
}
//-------------------------------------------------
// data_w - write to data register
//-------------------------------------------------
void am8052_device::data_w(u16 data)
{
logerror("%s: Register %04X = %04X\n", machine().describe_context(), m_pointer, data);
}

View File

@ -0,0 +1,42 @@
// license:BSD-3-Clause
// copyright-holders:AJR
/**********************************************************************
AMD Am8052 Alphanumeric CRT Controller (CRTC)
**********************************************************************/
#ifndef MAME_VIDEO_AM8052_H
#define MAME_VIDEO_AM8052_H
#pragma once
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> am8052_device
class am8052_device : public device_t
{
public:
// device constructor
am8052_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
// read/write handlers
void pointer_w(u16 data);
void data_w(u16 data);
protected:
// device-specific overrides
virtual void device_start() override;
private:
// internal state
u16 m_pointer;
};
// device type declarations
DECLARE_DEVICE_TYPE(AM8052, am8052_device)
#endif // MAME_VIDEO_AM8052_H