pofo: Added skeleton for PCD3311T sound chip. (nw)

This commit is contained in:
Curt Coder 2016-08-10 13:05:14 +03:00
parent d37c65b787
commit 8bf6e9ebb5
6 changed files with 163 additions and 20 deletions

View File

@ -1352,6 +1352,7 @@ if (SOUNDS["UPD1771"]~=null) then
MAME_DIR .. "src/devices/sound/upd1771.h", MAME_DIR .. "src/devices/sound/upd1771.h",
} }
end end
--------------------------------------------------- ---------------------------------------------------
-- GB_SOUND -- GB_SOUND
--@src/devices/sound/gb.h,SOUNDS["GB_SOUND"] = true --@src/devices/sound/gb.h,SOUNDS["GB_SOUND"] = true
@ -1363,3 +1364,15 @@ if (SOUNDS["GB_SOUND"]~=null) then
MAME_DIR .. "src/devices/sound/gb.h", MAME_DIR .. "src/devices/sound/gb.h",
} }
end end
---------------------------------------------------
-- PCD3311
--@src/devices/sound/gb.h,SOUNDS["PCD3311"] = true
---------------------------------------------------
if (SOUNDS["PCD3311"]~=null) then
files {
MAME_DIR .. "src/devices/sound/pcd3311.cpp",
MAME_DIR .. "src/devices/sound/pcd3311.h",
}
end

View File

@ -260,6 +260,8 @@ SOUNDS["ESQPUMP"] = true
SOUNDS["VRC6"] = true SOUNDS["VRC6"] = true
SOUNDS["UPD1771"] = true SOUNDS["UPD1771"] = true
SOUNDS["GB_SOUND"] = true SOUNDS["GB_SOUND"] = true
SOUNDS["PCD3311"] = true
-------------------------------------------------- --------------------------------------------------
-- specify available video cores -- specify available video cores
-------------------------------------------------- --------------------------------------------------

View File

@ -0,0 +1,56 @@
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/**********************************************************************
PCD3311 DTMF/modem/musical tone generator emulation
**********************************************************************/
#include "pcd3311.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type PCD3311 = &device_creator<pcd3311_t>;
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// pcd3311_t - constructor
//-------------------------------------------------
pcd3311_t::pcd3311_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, PCD3311, "PCD3311", tag, owner, clock, "pcd3311", __FILE__),
device_sound_interface(mconfig, *this)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void pcd3311_t::device_start()
{
save_item(NAME(m_a0));
save_item(NAME(m_mode));
save_item(NAME(m_strobe));
save_item(NAME(m_data));
}
//-------------------------------------------------
// sound_stream_update - handle update requests for
// our sound stream
//-------------------------------------------------
void pcd3311_t::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
}

View File

@ -0,0 +1,67 @@
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/**********************************************************************
PCD3311 DTMF/modem/musical tone generator emulation
**********************************************************************
_____ _____
OSCI 1 |* \_/ | 16 Vdd
OSCO 2 | | 15 Vss
MODE 3 | | 14 D4
D5 4 | PCD3311T | 13 N/C
N/C 5 | | 12 D3
STROBE 6 | | 11 D2
TONE 7 | | 10 D1/SDA
A0 8 |_____________| 9 D0/SCL
**********************************************************************/
#pragma once
#ifndef __PCD3311__
#define __PCD3311__
#include "emu.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> pcd3311_t
class pcd3311_t : public device_t,
public device_sound_interface
{
public:
// construction/destruction
pcd3311_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
DECLARE_WRITE8_MEMBER( write ) { m_data = data; }
DECLARE_WRITE_LINE_MEMBER( strobe_w ) { m_strobe = state; }
DECLARE_WRITE_LINE_MEMBER( mode_w ) { m_mode = state; }
DECLARE_WRITE_LINE_MEMBER( a0_w ) { m_a0 = state; }
protected:
// device-level overrides
virtual void device_start() override;
// internal callbacks
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
private:
int m_a0;
int m_mode;
int m_strobe;
UINT8 m_data;
};
// device type definition
extern const device_type PCD3311;
#endif

View File

@ -60,6 +60,7 @@ enum
XTAL_3_12MHz = 3120000, /* SP0250 clock on Gottlieb games */ XTAL_3_12MHz = 3120000, /* SP0250 clock on Gottlieb games */
XTAL_3_5MHz = 3500000, /* Reported by Commodore 65 document, true xtal unchecked on PCB */ XTAL_3_5MHz = 3500000, /* Reported by Commodore 65 document, true xtal unchecked on PCB */
XTAL_3_52128MHz = 3521280, /* RCA COSMAC VIP */ XTAL_3_52128MHz = 3521280, /* RCA COSMAC VIP */
XTAL_3_57864MHz = 3578640, /* Atari Portfolio PCD3311T */
XTAL_3_579545MHz = 3579545, /* NTSC color subcarrier, extremely common, used on 100's of PCBs (Keytronic custom part #48-300-010 is equivalent) */ XTAL_3_579545MHz = 3579545, /* NTSC color subcarrier, extremely common, used on 100's of PCBs (Keytronic custom part #48-300-010 is equivalent) */
XTAL_3_6864MHz = 3686400, /* CPS3 */ XTAL_3_6864MHz = 3686400, /* CPS3 */
XTAL_4MHz = 4000000, XTAL_4MHz = 4000000,

View File

@ -40,7 +40,7 @@
#include "bus/pofo/exp.h" #include "bus/pofo/exp.h"
#include "machine/nvram.h" #include "machine/nvram.h"
#include "machine/ram.h" #include "machine/ram.h"
#include "sound/speaker.h" #include "sound/pcd3311.h"
#include "video/hd61830.h" #include "video/hd61830.h"
@ -53,6 +53,7 @@
#define M80C88A_TAG "u1" #define M80C88A_TAG "u1"
#define HD61830_TAG "hd61830" #define HD61830_TAG "hd61830"
#define PCD3311T_TAG "pcd3311t"
#define TIMER_TICK_TAG "tick" #define TIMER_TICK_TAG "tick"
#define SCREEN_TAG "screen" #define SCREEN_TAG "screen"
@ -71,7 +72,7 @@ public:
driver_device(mconfig, type, tag), driver_device(mconfig, type, tag),
m_maincpu(*this, M80C88A_TAG), m_maincpu(*this, M80C88A_TAG),
m_lcdc(*this, HD61830_TAG), m_lcdc(*this, HD61830_TAG),
m_speaker(*this, "speaker"), m_dtmf(*this, PCD3311T_TAG),
m_ccm(*this, PORTFOLIO_MEMORY_CARD_SLOT_A_TAG), m_ccm(*this, PORTFOLIO_MEMORY_CARD_SLOT_A_TAG),
m_exp(*this, PORTFOLIO_EXPANSION_SLOT_TAG), m_exp(*this, PORTFOLIO_EXPANSION_SLOT_TAG),
m_timer_tick(*this, TIMER_TICK_TAG), m_timer_tick(*this, TIMER_TICK_TAG),
@ -93,7 +94,7 @@ public:
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_device<hd61830_device> m_lcdc; required_device<hd61830_device> m_lcdc;
required_device<speaker_sound_device> m_speaker; required_device<pcd3311_t> m_dtmf;
required_device<portfolio_memory_card_slot_t> m_ccm; required_device<portfolio_memory_card_slot_t> m_ccm;
required_device<portfolio_expansion_slot_t> m_exp; required_device<portfolio_expansion_slot_t> m_exp;
required_device<timer_device> m_timer_tick; required_device<timer_device> m_timer_tick;
@ -146,7 +147,7 @@ public:
DECLARE_READ8_MEMBER( counter_r ); DECLARE_READ8_MEMBER( counter_r );
DECLARE_WRITE8_MEMBER( irq_mask_w ); DECLARE_WRITE8_MEMBER( irq_mask_w );
DECLARE_WRITE8_MEMBER( speaker_w ); DECLARE_WRITE8_MEMBER( dtmf_w );
DECLARE_WRITE8_MEMBER( power_w ); DECLARE_WRITE8_MEMBER( power_w );
DECLARE_WRITE8_MEMBER( select_w ); DECLARE_WRITE8_MEMBER( select_w );
DECLARE_WRITE8_MEMBER( counter_w ); DECLARE_WRITE8_MEMBER( counter_w );
@ -356,33 +357,36 @@ READ8_MEMBER( portfolio_state::keyboard_r )
//************************************************************************** //**************************************************************************
// INTERNAL SPEAKER // SOUND
//************************************************************************** //**************************************************************************
//------------------------------------------------- //-------------------------------------------------
// speaker_w - internal speaker output // dtmf_w -
//------------------------------------------------- //-------------------------------------------------
WRITE8_MEMBER( portfolio_state::speaker_w ) WRITE8_MEMBER( portfolio_state::dtmf_w )
{ {
/* /*
bit description bit description
0 0 PCD3311T D0
1 1 PCD3311T D1
2 2 PCD3311T D2
3 3 PCD3311T D3
4 4 PCD3311T D4
5 5 PCD3311T D5
6 6 PCD3311T STROBE
7 speaker level 7 PCD3311T VDD,MODE,A0
*/ */
if (LOG) logerror("%s %s SPEAKER %02x\n", machine().time().as_string(), machine().describe_context(), data); if (LOG) logerror("%s %s DTMF %02x\n", machine().time().as_string(), machine().describe_context(), data);
m_speaker->level_w(!BIT(data, 7)); m_dtmf->mode_w(!BIT(data, 7));
m_dtmf->a0_w(!BIT(data, 7));
m_dtmf->write(space, 0, data & 0x3f);
m_dtmf->strobe_w(BIT(data, 6));
} }
@ -735,7 +739,7 @@ WRITE8_MEMBER( portfolio_state::io_w )
break; break;
case 2: case 2:
speaker_w(space, 0, data); dtmf_w(space, 0, data);
break; break;
case 3: case 3:
@ -1041,7 +1045,7 @@ static MACHINE_CONFIG_START( portfolio, portfolio_state )
// sound hardware // sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) MCFG_SOUND_ADD(PCD3311T_TAG, PCD3311, XTAL_3_57864MHz)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
// devices // devices
@ -1096,4 +1100,4 @@ ROM_END
//************************************************************************** //**************************************************************************
// YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS // YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS
COMP( 1989, pofo, 0, 0, portfolio, portfolio, driver_device, 0, "Atari", "Portfolio", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) COMP( 1989, pofo, 0, 0, portfolio, portfolio, driver_device, 0, "Atari", "Portfolio", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )