vic20: Emulated the PPP SpeakEasy (Votrax SC-01-A) cartridge. [Curt Coder]

This commit is contained in:
Curt Coder 2017-02-01 20:03:45 +02:00
parent 9f76ddc78a
commit e4be985024
4 changed files with 161 additions and 0 deletions

View File

@ -1425,6 +1425,8 @@ if (BUSES["VIC20"]~=null) then
MAME_DIR .. "src/devices/bus/vic20/vic1112.h",
MAME_DIR .. "src/devices/bus/vic20/vic1210.cpp",
MAME_DIR .. "src/devices/bus/vic20/vic1210.h",
MAME_DIR .. "src/devices/bus/vic20/speakeasy.cpp",
MAME_DIR .. "src/devices/bus/vic20/speakeasy.h",
MAME_DIR .. "src/devices/bus/vic20/user.cpp",
MAME_DIR .. "src/devices/bus/vic20/user.h",
MAME_DIR .. "src/devices/bus/vic20/4cga.cpp",

View File

@ -202,6 +202,7 @@ void vic20_expansion_slot_device::cd_w(address_space &space, offs_t offset, uint
#include "vic1111.h"
#include "vic1112.h"
#include "vic1210.h"
#include "speakeasy.h"
SLOT_INTERFACE_START( vic20_expansion_cards )
SLOT_INTERFACE("exp", VIC1010)
@ -209,6 +210,7 @@ SLOT_INTERFACE_START( vic20_expansion_cards )
SLOT_INTERFACE("8k", VIC1110)
SLOT_INTERFACE("16k", VIC1111)
SLOT_INTERFACE("fe3", VIC20_FE3)
SLOT_INTERFACE("speakeasy", VIC20_SPEAKEASY)
// the following need ROMs from the software list
SLOT_INTERFACE_INTERNAL("standard", VIC20_STD)

View File

@ -0,0 +1,103 @@
// license:BSD-3-Clause
// copyright-holders:smf
/**********************************************************************
Personal Peripheral Products SpeakEasy cartridge emulation
**********************************************************************/
#include "speakeasy.h"
//**************************************************************************
// MACROS/CONSTANTS
//**************************************************************************
#define SC01A_TAG "sc01a"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type VIC20_SPEAKEASY = &device_creator<vic20_speakeasy_t>;
//-------------------------------------------------
// MACHINE_DRIVER( speakeasy )
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( speakeasy )
MCFG_SPEAKER_ADD("mono", 0.0, 0.0, 1.0)
MCFG_SOUND_ADD(SC01A_TAG, VOTRAX_SC01, 720000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.85)
MACHINE_CONFIG_END
//-------------------------------------------------
// machine_config_additions - device-specific
// machine configurations
//-------------------------------------------------
machine_config_constructor vic20_speakeasy_t::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( speakeasy );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// vic20_speakeasy_t - constructor
//-------------------------------------------------
vic20_speakeasy_t::vic20_speakeasy_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, VIC20_SPEAKEASY, "SpeakEasy", tag, owner, clock, "speakeasy", __FILE__),
device_vic20_expansion_card_interface(mconfig, *this),
m_votrax(*this, SC01A_TAG)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void vic20_speakeasy_t::device_start()
{
}
//-------------------------------------------------
// vic20_cd_r - cartridge data read
//-------------------------------------------------
uint8_t vic20_speakeasy_t::vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3)
{
if (!io2)
{
return m_votrax->request() << 7;
}
return data;
}
//-------------------------------------------------
// vic20_cd_w - cartridge data write
//-------------------------------------------------
void vic20_speakeasy_t::vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3)
{
if (!io2)
{
m_votrax->write(space, 0, data & 0x3f);
m_votrax->inflection_w(space, 0, data >> 6);
}
}

View File

@ -0,0 +1,54 @@
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/**********************************************************************
Personal Peripheral Products SpeakEasy cartridge emulation
**********************************************************************/
#pragma once
#ifndef __VIC20_SPEAKEASY__
#define __VIC20_SPEAKEASY__
#include "emu.h"
#include "exp.h"
#include "sound/votrax.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> vic20_speakeasy_t
class vic20_speakeasy_t : public device_t,
public device_vic20_expansion_card_interface
{
public:
// construction/destruction
vic20_speakeasy_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const override;
protected:
// device-level overrides
virtual void device_start() override;
// device_vic20_expansion_card_interface overrides
virtual uint8_t vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override;
virtual void vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override;
private:
required_device<votrax_sc01_device> m_votrax;
};
// device type definition
extern const device_type VIC20_SPEAKEASY;
#endif