1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
// license:BSD-3-Clause
// copyright-holders:hap
/******************************************************************************
Easi-Speech cartridge (R.Amy, 1987)
The program adds a hook to 0xfd29, usage appears to be something like this:
defusr0=&hfd29
a$=usr0("hello")
******************************************************************************/
#include "emu.h"
#include "easi_speech.h"
DEFINE_DEVICE_TYPE(MSX_CART_EASISPEECH, msx_cart_easispeech_device, "msx_cart_easispeech", "MSX Cartridge - Easi-Speech")
msx_cart_easispeech_device::msx_cart_easispeech_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock)
: device_t(mconfig, MSX_CART_EASISPEECH, tag, owner, clock)
, msx_cart_interface(mconfig, *this)
, m_speech(*this, "speech")
{
}
ROM_START( msx_cart_easispeech )
ROM_REGION( 0x10000, "speech", 0 )
ROM_LOAD( "sp0256a-al2", 0x1000, 0x0800, CRC(b504ac15) SHA1(e60fcb5fa16ff3f3b69d36c7a6e955744d3feafc) )
ROM_END
const tiny_rom_entry *msx_cart_easispeech_device::device_rom_region() const
{
return ROM_NAME( msx_cart_easispeech );
}
void msx_cart_easispeech_device::device_add_mconfig(machine_config &config)
{
SP0256(config, m_speech, XTAL::u(3120000)); // frequency unknown
m_speech->add_route(ALL_OUTPUTS, ":speaker", 1.00);
}
uint8_t msx_cart_easispeech_device::read_cart(offs_t offset)
{
// standard ROM
if (offset >= 0x4000 && offset < 0x8000)
return get_rom_base()[offset & 0x1fff];
// d7: SP0256 LRQ
if (offset == 0x8000)
return m_speech->lrq_r() << 7;
return 0xff;
}
void msx_cart_easispeech_device::write_cart(offs_t offset, uint8_t data)
{
// d2-d7: SP0256 A
if (offset == 0x8000)
m_speech->ald_w(bitswap<6>(data,3,5,7,6,4,2));
}
|