mame/src/mess/machine/vic20std.c
Curt Coder 3722e8ff14 (MESS) vic20: Refactored VIC to a modern device. (nw)
(MESS) c64: Fixed IDE64 cartridge video corruption. (nw)
(MESS) Added paddles and light pen VCS control devices. [Curt Coder]
2012-09-06 15:16:03 +00:00

71 lines
2.0 KiB
C

/**********************************************************************
Commodore VIC-20 Standard 8K/16K ROM Cartridge emulation
Copyright MESS Team.
Visit http://mamedev.org for licensing and usage restrictions.
**********************************************************************/
#include "vic20std.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type VIC20_STD = &device_creator<vic20_standard_cartridge_device>;
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// vic20_standard_cartridge_device - constructor
//-------------------------------------------------
vic20_standard_cartridge_device::vic20_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, VIC20_STD, "VIC-20 Standard Cartridge", tag, owner, clock),
device_vic20_expansion_card_interface(mconfig, *this)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void vic20_standard_cartridge_device::device_start()
{
}
//-------------------------------------------------
// vic20_cd_r - cartridge data read
//-------------------------------------------------
UINT8 vic20_standard_cartridge_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3)
{
if (!blk1 && (m_blk1 != NULL))
{
data = m_blk1[offset];
}
else if (!blk2 && (m_blk2 != NULL))
{
data = m_blk2[offset];
}
else if (!blk3 && (m_blk3 != NULL))
{
data = m_blk3[offset];
}
else if (!blk5 && (m_blk5 != NULL))
{
data = m_blk5[offset];
}
return data;
}