tc8830f skeleton

This commit is contained in:
Michaël Banaan Ananas 2012-05-09 14:52:29 +00:00
parent 50f4c7f5e9
commit 60641b72ed
7 changed files with 148 additions and 0 deletions

2
.gitattributes vendored
View file

@ -1264,6 +1264,8 @@ src/emu/sound/st0016.c svneol=native#text/plain
src/emu/sound/st0016.h svneol=native#text/plain
src/emu/sound/t6w28.c svneol=native#text/plain
src/emu/sound/t6w28.h svneol=native#text/plain
src/emu/sound/tc8830f.c svneol=native#text/plain
src/emu/sound/tc8830f.h svneol=native#text/plain
src/emu/sound/tiaintf.c svneol=native#text/plain
src/emu/sound/tiaintf.h svneol=native#text/plain
src/emu/sound/tiasound.c svneol=native#text/plain

View file

@ -442,6 +442,7 @@ SOUNDOBJS += $(SOUNDOBJ)/rf5c400.o
endif
#-------------------------------------------------
# S2636 wave generator
#-------------------------------------------------
@ -450,6 +451,8 @@ ifneq ($(filter S2636,$(SOUNDS)),)
SOUNDOBJS += $(SOUNDOBJ)/s2636.o
endif
#-------------------------------------------------
# Sega custom sound chips
#-------------------------------------------------
@ -474,6 +477,7 @@ $(SOUNDOBJ)/scsp.o: $(SOUNDSRC)/scsplfo.c
$(SOUNDOBJ)/aica.o: $(SOUNDSRC)/aicalfo.c
#-------------------------------------------------
# Seta custom sound chips
#-------------------------------------------------
@ -562,6 +566,8 @@ ifneq ($(filter S14001A,$(SOUNDS)),)
SOUNDOBJS += $(SOUNDOBJ)/s14001a.o
endif
#-------------------------------------------------
# Texas Instruments SN76477 analog chip
#-------------------------------------------------
@ -618,6 +624,17 @@ $(SOUNDOBJ)/tms5110.o: $(SOUNDSRC)/tms5110r.c
$(SOUNDOBJ)/tms5220.o: $(SOUNDSRC)/tms5220r.c
#-------------------------------------------------
# Toshiba TC8830F sample player/recorder
#-------------------------------------------------
ifneq ($(filter TC8830F,$(SOUNDS)),)
SOUNDOBJS += $(SOUNDOBJ)/tc8830f.o
endif
#-------------------------------------------------
# VLM5030 speech synthesizer
#-------------------------------------------------

60
src/emu/sound/tc8830f.c Normal file
View file

@ -0,0 +1,60 @@
/***************************************************************************
tc8830f.c - Toshiba TC8830F, CMOS voice recording/reproducing LSI
Very preliminary...
TODO:
- remaining commands
- cpu manual mode
- status read
- RAM
- recording
***************************************************************************/
#include "emu.h"
#include "tc8830f.h"
// device type definition
const device_type TC8830F = &device_creator<tc8830f_device>;
tc8830f_device::tc8830f_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, TC8830F, "TC8830F", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
}
void tc8830f_device::device_start()
{
// create the stream
m_stream = machine().sound().stream_alloc(*this, 0, 1, clock() / 0x10, this);
m_mem_base = (UINT8 *)device().machine().root_device().memregion(":tc8830f")->base();
m_mem_mask = device().machine().root_device().memregion(":tc8830f")->bytes() - 1;
reset();
}
void tc8830f_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
for (int i = 0; i < samples; i++)
{
outputs[0][i] = 0;
}
}
void tc8830f_device::reset()
{
;
}
void tc8830f_device::write_p(UINT8 data)
{
m_stream->update();
}

55
src/emu/sound/tc8830f.h Normal file
View file

@ -0,0 +1,55 @@
/***************************************************************************
tc8830f.h - Toshiba TC8830F, CMOS voice recording/reproducing LSI
***************************************************************************/
#pragma once
#ifndef __TC8830F_H__
#define __TC8830F_H__
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_I5000_SND_ADD(_tag, _clock) \
MCFG_DEVICE_ADD(_tag, TC8830F, _clock)
#define MCFG_I5000_SND_REPLACE(_tag, _clock) \
MCFG_DEVICE_REPLACE(_tag, TC8830F, _clock)
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
class tc8830f_device : public device_t,
public device_sound_interface
{
public:
// construction/destruction
tc8830f_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
void reset();
void write_p(UINT8 data);
sound_stream *m_stream;
protected:
// device-level overrides
virtual void device_start();
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
UINT8 *m_mem_base;
UINT32 m_mem_mask;
};
// device type definition
extern const device_type TC8830F;
#endif /* __TC8830F_H__ */

View file

@ -96,11 +96,17 @@ READ8_MEMBER(timeplt_state::psurge_protection_r)
// chkun has access to an extra soundchip via ay2 port a
static WRITE8_DEVICE_HANDLER(chkun_sound_w)
{
timeplt_state *state = device->machine().driver_data<timeplt_state>();
// d0-d3: P0-P3
// d5: /R (unused?)
// d6: /W
if (data & 0x40)
state->m_tc8830f->write_p(data);
// d4 (or d7?): /ACL
if (~data & 0x10)
state->m_tc8830f->reset();
}
static const ay8910_interface chkun_ay2_interface =
@ -508,6 +514,9 @@ static MACHINE_CONFIG_DERIVED( chkun, bikkuric )
/* sound hardware */
MCFG_SOUND_MODIFY("ay2")
MCFG_SOUND_CONFIG(chkun_ay2_interface)
MCFG_I5000_SND_ADD("tc8830f", 500000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END

View file

@ -4,12 +4,15 @@
***************************************************************************/
#include "sound/tc8830f.h"
class timeplt_state : public driver_device
{
public:
timeplt_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_tc8830f(*this, "tc8830f"),
m_colorram(*this, "colorram"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
@ -17,6 +20,7 @@ public:
{ }
required_device<cpu_device> m_maincpu;
optional_device<tc8830f_device> m_tc8830f;
/* memory pointers */
required_shared_ptr<UINT8> m_colorram;

View file

@ -182,6 +182,7 @@ SOUNDS += OKIM6376
SOUNDS += OKIM9810
SOUNDS += UPD7759
SOUNDS += HC55516
SOUNDS += TC8830F
SOUNDS += K005289
SOUNDS += K007232
SOUNDS += K051649