summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/esqasr.cpp
blob: 890748050b046f78394afc9cd85733a71efa04b0 (plain) (blame)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
// license:BSD-3-Clause
// copyright-holders:R. Belmont
/***************************************************************************

    esqasr.c - Ensoniq ASR-10 and ASR-X

    Skeleton driver by R. Belmont

    ASR-10 hardware:
        CPU: 68302 MCU
        Sound: ES5506
        Effects: ES5510
        FDC: NEC uPD72069
        DUART: 2681

    Memory map:
    0x000000-0x03ffff   OS ROM
    0xfb0000-0xfcffff   OS RAM


    ASR-X hardware:
        CPU: 68340 MCU
        Sound: ES5506
        Effects: ES5511
        FDC: NEC uPD72069

    http://www.gweep.net/~shifty/music/asrxhack/

    Memory map:
    0x00000000-0x000fffff   OS ROM
    0x00800000-0x008000ff   ESP2 5511?
    0x00f00000-0x00f007ff   Unknown
    0x08000000-0x08200000   RAM
    0x0be00000-0x0befffff   RAM (size unknown)

    These may want to be separated when they run more.

***************************************************************************/

#include "emu.h"

#include "cpu/es5510/es5510.h"
#include "machine/68340.h"
#include "machine/esqvfd.h"
#include "machine/upd765.h"
#include "sound/es5506.h"
#include "sound/esqpump.h"

#include "speaker.h"


class esqasr_state : public driver_device
{
public:
	esqasr_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag)
		, m_maincpu(*this, "maincpu")
		, m_esp(*this, "esp")
		, m_pump(*this, "pump")
		, m_sq1vfd(*this, "sq1vfd")
	{ }

	void asrx(machine_config &config);
	void asr(machine_config &config);

	void init_asr();

private:
	required_device<cpu_device> m_maincpu;
	optional_device<es5510_device> m_esp;
	optional_device<esq_5505_5510_pump_device> m_pump;
	required_device<esq2x40_sq1_device> m_sq1vfd;

	virtual void machine_start() override;
	virtual void machine_reset() override;

	DECLARE_WRITE_LINE_MEMBER(esq5506_otto_irq);
	DECLARE_READ16_MEMBER(esq5506_read_adc);
	void es5506_clock_changed(u32 data);

	void asr_map(address_map &map);
	void asrx_map(address_map &map);
};

void esqasr_state::machine_start()
{
}

void esqasr_state::machine_reset()
{
}

void esqasr_state::asr_map(address_map &map)
{
	map(0x000000, 0x0fffff).rom().region("maincpu", 0);
	map(0xf00000, 0xffffff).ram();
}

void esqasr_state::asrx_map(address_map &map)
{
	map(0x00000000, 0x000fffff).rom().region("maincpu", 0);
	map(0x08000000, 0x081fffff).ram();
	map(0x0be00000, 0x0befffff).ram();
}

WRITE_LINE_MEMBER(esqasr_state::esq5506_otto_irq)
{
}

READ16_MEMBER(esqasr_state::esq5506_read_adc)
{
	return 0;
}

void esqasr_state::es5506_clock_changed(u32 data)
{
	m_pump->set_unscaled_clock(data);
}

void esqasr_state::asr(machine_config &config)
{
	M68000(config, m_maincpu, XTAL(16'000'000)); // actually MC68302
	m_maincpu->set_addrmap(AS_PROGRAM, &esqasr_state::asr_map);

	ES5510(config, m_esp, XTAL(10'000'000));
	m_esp->set_disable();

	ESQ2X40_SQ1(config, m_sq1vfd, 60);

	SPEAKER(config, "lspeaker").front_left();
	SPEAKER(config, "rspeaker").front_right();

	ESQ_5505_5510_PUMP(config, m_pump, XTAL(16'000'000) / (16 * 32));
	m_pump->set_esp(m_esp);
	m_pump->add_route(0, "lspeaker", 1.0);
	m_pump->add_route(1, "rspeaker", 1.0);

	es5506_device &ensoniq(ES5506(config, "ensoniq", XTAL(16'000'000)));
	ensoniq.sample_rate_changed().set(FUNC(esqasr_state::es5506_clock_changed));
	ensoniq.set_region0("waverom");  /* Bank 0 */
	ensoniq.set_region1("waverom2"); /* Bank 1 */
	ensoniq.set_region2("waverom3"); /* Bank 0 */
	ensoniq.set_region3("waverom4"); /* Bank 1 */
	ensoniq.set_channels(4);         /* channels, Not verified from real hardware */
	ensoniq.irq_cb().set(FUNC(esqasr_state::esq5506_otto_irq)); /* irq */
	ensoniq.read_port_cb().set(FUNC(esqasr_state::esq5506_read_adc));
	ensoniq.add_route(0, "pump", 1.0, 0);
	ensoniq.add_route(1, "pump", 1.0, 1);
	ensoniq.add_route(2, "pump", 1.0, 2);
	ensoniq.add_route(3, "pump", 1.0, 3);
	ensoniq.add_route(4, "pump", 1.0, 4);
	ensoniq.add_route(5, "pump", 1.0, 5);
	ensoniq.add_route(6, "pump", 1.0, 6);
	ensoniq.add_route(7, "pump", 1.0, 7);
}

void esqasr_state::asrx(machine_config &config)
{
	M68340(config, m_maincpu, XTAL(16'000'000));
	m_maincpu->set_addrmap(AS_PROGRAM, &esqasr_state::asrx_map);

	ES5510(config, m_esp, XTAL(10'000'000)); // Actually ES5511
	m_esp->set_disable();

	ESQ2X40_SQ1(config, m_sq1vfd, 60);

	SPEAKER(config, "lspeaker").front_left();
	SPEAKER(config, "rspeaker").front_right();

	ESQ_5505_5510_PUMP(config, m_pump, XTAL(16'000'000) / (16 * 32)); // Actually ES5511
	m_pump->set_esp(m_esp);
	m_pump->add_route(0, "lspeaker", 1.0);
	m_pump->add_route(1, "rspeaker", 1.0);

	es5506_device &ensoniq(ES5506(config, "ensoniq", XTAL(16'000'000)));
	ensoniq.sample_rate_changed().set(FUNC(esqasr_state::es5506_clock_changed));
	ensoniq.set_region0("waverom");  /* Bank 0 */
	ensoniq.set_region1("waverom2"); /* Bank 1 */
	ensoniq.set_region2("waverom3"); /* Bank 0 */
	ensoniq.set_region3("waverom4"); /* Bank 1 */
	ensoniq.set_channels(4);         /* channels, Not verified from real hardware */
	ensoniq.irq_cb().set(FUNC(esqasr_state::esq5506_otto_irq)); /* irq */
	ensoniq.read_port_cb().set(FUNC(esqasr_state::esq5506_read_adc));
	ensoniq.add_route(0, "pump", 1.0, 0);
	ensoniq.add_route(1, "pump", 1.0, 1);
	ensoniq.add_route(2, "pump", 1.0, 2);
	ensoniq.add_route(3, "pump", 1.0, 3);
	ensoniq.add_route(4, "pump", 1.0, 4);
	ensoniq.add_route(5, "pump", 1.0, 5);
	ensoniq.add_route(6, "pump", 1.0, 6);
	ensoniq.add_route(7, "pump", 1.0, 7);
}

static INPUT_PORTS_START( asr )
INPUT_PORTS_END

ROM_START( asr10 )
	ROM_REGION(0x100000, "maincpu", 0)
	ROM_LOAD16_BYTE( "asr-648c-lo-1.5b.bin", 0x000001, 0x020000, CRC(8e437843) SHA1(418f042acbc5323f5b59cbbd71fdc8b2d851f7d0) )
	ROM_LOAD16_BYTE( "asr-65e0-hi-1.5b.bin", 0x000000, 0x020000, CRC(b37cd3b6) SHA1(c4371848428a628b5e5a50e99be602d7abfc7904) )

	ROM_REGION(0x200000, "waverom", ROMREGION_ERASE00)
	ROM_REGION(0x200000, "waverom2", ROMREGION_ERASE00)
	ROM_REGION(0x200000, "waverom3", ROMREGION_ERASE00)
	ROM_REGION(0x200000, "waverom4", ROMREGION_ERASE00)
ROM_END

ROM_START( asrx )
	ROM_REGION(0x100000, "maincpu", 0)
	ROM_LOAD16_BYTE( "asr267lo.bin", 0x000001, 0x080000, CRC(7408d441) SHA1(0113f84b6d224bf1423ad62c173f32a0c95ca715) )
	ROM_LOAD16_BYTE( "asr267hi.bin", 0x000000, 0x080000, CRC(7df14ea7) SHA1(895b99013c0f924edb52612eb93c3e6babb9f053) )

	ROM_REGION(0x200000, "waverom", ROMREGION_ERASE00)
	ROM_REGION(0x200000, "waverom2", ROMREGION_ERASE00)
	ROM_REGION(0x200000, "waverom3", ROMREGION_ERASE00)
	ROM_REGION(0x200000, "waverom4", ROMREGION_ERASE00)
ROM_END

void esqasr_state::init_asr()
{
}

CONS( 1992, asr10, 0, 0, asr, asr, esqasr_state, init_asr, "Ensoniq", "ASR-10", MACHINE_NOT_WORKING )
CONS( 1997, asrx,  0, 0, asrx,asr, esqasr_state, init_asr, "Ensoniq", "ASR-X",  MACHINE_NOT_WORKING )