Previous 15994 Revisions Next

r15235 Sunday 20th May, 2012 at 00:28:11 UTC by R. Belmont
New preliminary driver supporting Ensoniq VFX, Ensoniq EPS-16 Plus, and Ensoniq SQ-1. [R. Belmont, Parduz]
[src/mess]mess.lst mess.mak
[src/mess/drivers]esq5505.c*

src/mess/mess.lst
r15234r15235
171171d6800      // Dream 6800
172172
173173// Ensoniq
174enmirage // 1985 Mirage Digital Multi-Sampler
175esq1   // 1986 ESQ-1 Digital Wave Synthesizer
174enmirage    // 1985 Mirage Digital Multi-Sampler
175esq1        // 1986 ESQ-1 Digital Wave Synthesizer
176sq80        // 1988 SQ-80 Digital Wave Synthesizer
177vfx         // 1989 VFX
178eps16       // 1990 EPS-16 Plus
179sq1         // 1990 SQ-1
176180
177181// Fairchild
178182channelf  // Fairchild Channel F VES - 1976
src/mess/drivers/esq5505.c
r0r15235
1/***************************************************************************
2
3    esq5505.c - Ensoniq ES5505 + ES5510 based synthesizers
4
5    Ensoniq VFX, EPS-16 Plus, and SQ-1 (VFX-SD, SD-1, SQ-1 Plus, SQ-2,
6    and KS-32 are known to also be this architecture).
7 
8    The Taito sound system in taito_en.c is directly derived from the SQ-1.
9 
10    Driver by R. Belmont
11 
12    00 - harsh piano
13    01 - bells/chimes
14    04 - organ
15    13 - transwave brass
16    17 - slow string
17    18 - plucked string
18    19 - layered strings
19    20 - marimba
20    26 - Hammond
21    29 - slow organ
22    38 - nylon guitar
23    41 - layered strings
24    51/52 - RE-style slow strings
25    53 - RE-style fast strings
26    69 - orch hit
27    70 - organ
28    73 - orch hit with strings
29    74 - bell tone
30    80 - drums
31 
32***************************************************************************/
33
34#include "emu.h"
35#include "cpu/m68000/m68000.h"
36#include "sound/es5506.h"
37#include "machine/68681.h"
38
39#define KEYBOARD_HACK   (0)
40
41#if KEYBOARD_HACK
42static int program = 1;
43#endif
44
45class esq5505_state : public driver_device
46{
47public:
48   esq5505_state(const machine_config &mconfig, device_type type, const char *tag)
49   : driver_device(mconfig, type, tag),
50        m_maincpu(*this, "maincpu"),
51        m_duart(*this, "duart")
52    { }
53
54    required_device<device_t> m_maincpu;
55    required_device<device_t> m_duart;
56
57    virtual void machine_reset();
58
59    DECLARE_READ16_MEMBER(es5510_dsp_r);
60    DECLARE_WRITE16_MEMBER(es5510_dsp_w);
61    DECLARE_READ16_MEMBER(mc68681_r);
62    DECLARE_WRITE16_MEMBER(mc68681_w);
63
64private:
65    UINT16  es5510_dsp_ram[0x200];
66    UINT32  es5510_gpr[0xc0];
67    UINT32  es5510_dram[1<<24];
68    UINT32  es5510_dol_latch;
69    UINT32  es5510_dil_latch;
70    UINT32  es5510_dadr_latch;
71    UINT32  es5510_gpr_latch;
72    UINT8   es5510_ram_sel;
73};
74
75
76static VIDEO_START( esq5505 )
77{
78}
79
80static SCREEN_UPDATE_RGB32( esq5505 )
81{
82#if KEYBOARD_HACK
83    if( screen.machine().input().code_pressed_once( KEYCODE_Q ) )
84    {
85        program--;
86        if (program < 0)
87        {
88            program = 0;
89        }
90        printf("program to %d\n", program);
91    }
92   if( screen.machine().input().code_pressed_once( KEYCODE_W ) )
93    {
94        program++;
95        if (program > 127)
96        {
97            program = 127;
98        }
99        printf("program to %d\n", program);
100    }
101#endif
102   return 0;
103}
104
105void esq5505_state::machine_reset()
106{
107   UINT8 *ROM = machine().root_device().memregion("osrom")->base();
108   UINT8 *RAM = (UINT8 *)machine().root_device().memshare("osram")->ptr();
109
110    memcpy(RAM, ROM, 256);
111
112    // pick up the new vectors
113    m_maincpu->reset();
114}
115
116READ16_MEMBER(esq5505_state::es5510_dsp_r)
117{
118//  logerror("%06x: DSP read offset %04x (data is %04x)\n",cpu_get_pc(&space->device()),offset,es5510_dsp_ram[offset]);
119
120   switch(offset)
121   {
122      case 0x09: return (es5510_dil_latch >> 16) & 0xff;
123      case 0x0a: return (es5510_dil_latch >> 8) & 0xff;
124      case 0x0b: return (es5510_dil_latch >> 0) & 0xff; //TODO: docs says that this always returns 0
125   }
126
127   if (offset==0x12) return 0;
128
129   if (offset==0x16) return 0x27;
130
131   return es5510_dsp_ram[offset];
132}
133
134WRITE16_MEMBER(esq5505_state::es5510_dsp_w)
135{
136   UINT8 *snd_mem = (UINT8 *)space.machine().root_device().memregion("waverom")->base();
137
138   COMBINE_DATA(&es5510_dsp_ram[offset]);
139
140   switch (offset) {
141      case 0x00: es5510_gpr_latch=(es5510_gpr_latch&0x00ffff)|((data&0xff)<<16); break;
142      case 0x01: es5510_gpr_latch=(es5510_gpr_latch&0xff00ff)|((data&0xff)<< 8); break;
143      case 0x02: es5510_gpr_latch=(es5510_gpr_latch&0xffff00)|((data&0xff)<< 0); break;
144
145      /* 0x03 to 0x08 INSTR Register */
146      /* 0x09 to 0x0b DIL Register (r/o) */
147
148      case 0x0c: es5510_dol_latch=(es5510_dol_latch&0x00ffff)|((data&0xff)<<16); break;
149      case 0x0d: es5510_dol_latch=(es5510_dol_latch&0xff00ff)|((data&0xff)<< 8); break;
150      case 0x0e: es5510_dol_latch=(es5510_dol_latch&0xffff00)|((data&0xff)<< 0); break; //TODO: docs says that this always returns 0xff
151
152      case 0x0f:
153         es5510_dadr_latch=(es5510_dadr_latch&0x00ffff)|((data&0xff)<<16);
154         if(es5510_ram_sel)
155            es5510_dil_latch = es5510_dram[es5510_dadr_latch];
156         else
157            es5510_dram[es5510_dadr_latch] = es5510_dol_latch;
158         break;
159
160      case 0x10: es5510_dadr_latch=(es5510_dadr_latch&0xff00ff)|((data&0xff)<< 8); break;
161      case 0x11: es5510_dadr_latch=(es5510_dadr_latch&0xffff00)|((data&0xff)<< 0); break;
162
163      /* 0x12 Host Control */
164
165      case 0x14: es5510_ram_sel = data & 0x80; /* bit 6 is i/o select, everything else is undefined */break;
166
167      /* 0x16 Program Counter (test purpose, r/o?) */
168      /* 0x17 Internal Refresh counter (test purpose) */
169      /* 0x18 Host Serial Control */
170      /* 0x1f Halt enable (w) / Frame Counter (r) */
171
172      case 0x80: /* Read select - GPR + INSTR */
173   //      logerror("ES5510:  Read GPR/INSTR %06x (%06x)\n",data,es5510_gpr[data]);
174
175         /* Check if a GPR is selected */
176         if (data<0xc0) {
177            //es_tmp=0;
178            es5510_gpr_latch=es5510_gpr[data];
179         }// else es_tmp=1;
180         break;
181
182      case 0xa0: /* Write select - GPR */
183   //      logerror("ES5510:  Write GPR %06x %06x (0x%04x:=0x%06x\n",data,es5510_gpr_latch,data,snd_mem[es5510_gpr_latch>>8]);
184         if (data<0xc0)
185            es5510_gpr[data]=snd_mem[es5510_gpr_latch>>8];
186         break;
187
188      case 0xc0: /* Write select - INSTR */
189   //      logerror("ES5510:  Write INSTR %06x %06x\n",data,es5510_gpr_latch);
190         break;
191
192      case 0xe0: /* Write select - GPR + INSTR */
193   //      logerror("ES5510:  Write GPR/INSTR %06x %06x\n",data,es5510_gpr_latch);
194         break;
195   }
196}
197
198static ADDRESS_MAP_START( vfx_map, AS_PROGRAM, 16, esq5505_state )
199   AM_RANGE(0x000000, 0x03ffff) AM_RAM AM_SHARE("osram")
200   AM_RANGE(0x200000, 0x20001f) AM_DEVREADWRITE_LEGACY("ensoniq", es5505_r, es5505_w)
201   AM_RANGE(0x260000, 0x2601ff) AM_READWRITE(es5510_dsp_r, es5510_dsp_w)
202    AM_RANGE(0x280000, 0x28001f) AM_DEVREADWRITE8_LEGACY("duart", duart68681_r, duart68681_w, 0x00ff)
203    AM_RANGE(0xc00000, 0xc1ffff) AM_ROM AM_REGION("osrom", 0)
204    AM_RANGE(0xfc0000, 0xffffff) AM_RAM AM_SHARE("osram")
205ADDRESS_MAP_END
206
207static ADDRESS_MAP_START( eps16_map, AS_PROGRAM, 16, esq5505_state )
208   AM_RANGE(0x000000, 0x03ffff) AM_RAM AM_SHARE("osram")
209   AM_RANGE(0x200000, 0x20001f) AM_DEVREADWRITE_LEGACY("ensoniq", es5505_r, es5505_w)
210    AM_RANGE(0x280000, 0x28001f) AM_DEVREADWRITE8_LEGACY("duart", duart68681_r, duart68681_w, 0x00ff)
211    AM_RANGE(0x580000, 0x77ffff) AM_RAM         // sample RAM (2 MB max represented here)
212    AM_RANGE(0xc00000, 0xc0ffff) AM_ROM AM_REGION("osrom", 0)
213ADDRESS_MAP_END
214
215static void duart_irq_handler(device_t *device, int state, UINT8 vector)
216{
217    esq5505_state *esq5505 = device->machine().driver_data<esq5505_state>();
218
219//    printf("\nDUART IRQ: state %d vector %d\n", state, vector);
220    if (state == ASSERT_LINE)
221    {
222        device_set_input_line_vector(esq5505->m_maincpu, 1, vector);
223        device_set_input_line(esq5505->m_maincpu, 1, ASSERT_LINE);
224    }
225    else
226    {
227        device_set_input_line(esq5505->m_maincpu, 1, CLEAR_LINE);
228    }
229};
230
231static UINT8 duart_input(device_t *device)
232{
233   return 0;
234}
235
236static void duart_output(device_t *device, UINT8 data)
237{
238//    printf("DUART output: %02x\n", data);
239}
240
241static void duart_tx(device_t *device, int channel, UINT8 data)
242{
243    if (data >= 0x20 && data <= 0x7f)
244    {
245        printf("%c", data);
246    }
247    else
248    {
249        printf("[%02x]", data);
250    }
251}
252
253static const duart68681_config duart_config =
254{
255   duart_irq_handler,
256   duart_tx,
257   duart_input,
258   duart_output,
259
260   500000, 500000,   // IP3, IP4
261   1000000, 1000000, // IP5, IP6
262};
263
264static const es5505_interface es5505_config =
265{
266   "waverom",   /* Bank 0 */
267   "waverom",   /* Bank 1 */
268   NULL        /* irq */
269};
270
271static MACHINE_CONFIG_START( vfx, esq5505_state )
272   MCFG_CPU_ADD("maincpu", M68000, 16000000)
273   MCFG_CPU_PROGRAM_MAP(vfx_map)
274
275   MCFG_SCREEN_ADD("screen", RASTER)
276   MCFG_SCREEN_REFRESH_RATE(60)
277   MCFG_SCREEN_UPDATE_STATIC(esq5505)
278   MCFG_SCREEN_SIZE(320, 240)
279   MCFG_SCREEN_VISIBLE_AREA(0, 319, 1, 239)
280
281   MCFG_VIDEO_START(esq5505)
282
283   MCFG_DUART68681_ADD("duart", 2000000, duart_config)
284
285   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
286   MCFG_SOUND_ADD("ensoniq", ES5505, 30476100/2)
287   MCFG_SOUND_CONFIG(es5505_config)
288   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
289   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
290MACHINE_CONFIG_END
291
292static MACHINE_CONFIG_DERIVED(eps16, vfx)
293   MCFG_CPU_MODIFY( "maincpu" )
294   MCFG_CPU_PROGRAM_MAP(eps16_map)
295MACHINE_CONFIG_END
296
297#if KEYBOARD_HACK
298static INPUT_CHANGED( key_stroke )
299{
300   esq5505_state *state = device.machine().driver_data<esq5505_state>();
301
302    // send a MIDI Note On
303    if (oldval == 0 && newval == 1)
304    {
305        if ((UINT8)(FPTR)param == 0x40)
306        {
307            duart68681_rx_data(state->m_duart, 0, (UINT8)(FPTR)0xc0);   // program change
308            duart68681_rx_data(state->m_duart, 0, program);             // program
309        }
310        else
311        {
312            duart68681_rx_data(state->m_duart, 0, (UINT8)(FPTR)0x90);   // note on
313            duart68681_rx_data(state->m_duart, 0, (UINT8)(FPTR)param);
314            duart68681_rx_data(state->m_duart, 0, (UINT8)(FPTR)0x7f);
315        }
316    }
317    else if (oldval == 1 && newval == 0)
318    {
319        if ((UINT8)(FPTR)param != 0x40)
320        {
321            duart68681_rx_data(state->m_duart, 0, (UINT8)(FPTR)0x80);   // note off
322            duart68681_rx_data(state->m_duart, 0, (UINT8)(FPTR)param);
323            duart68681_rx_data(state->m_duart, 0, (UINT8)(FPTR)0x7f);
324        }
325    }
326}
327#endif
328
329static INPUT_PORTS_START( vfx )
330#if KEYBOARD_HACK
331   PORT_START("KEY0")
332   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') PORT_CHANGED(key_stroke, 0x40)
333   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') PORT_CHANGED(key_stroke, 0x41)
334   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') PORT_CHANGED(key_stroke, 0x42)
335   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') PORT_CHANGED(key_stroke, 0x43)
336   PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') PORT_CHANGED(key_stroke, 0x44)
337   PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') PORT_CHANGED(key_stroke, 0x45)
338   PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') PORT_CHANGED(key_stroke, 0x46)
339   PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') PORT_CHANGED(key_stroke, 0x47)
340   PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') PORT_CHANGED(key_stroke, 0x48)
341   PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') PORT_CHANGED(key_stroke, 0x49)
342   PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') PORT_CHANGED(key_stroke, 0x4a)
343   PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('e') PORT_CHAR('E') PORT_CHANGED(key_stroke, 0x4b)
344   PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('r') PORT_CHAR('R') PORT_CHANGED(key_stroke, 0x4c)
345   PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('t') PORT_CHAR('T') PORT_CHANGED(key_stroke, 0x4d)
346   PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('y') PORT_CHAR('Y') PORT_CHANGED(key_stroke, 0x4e)
347   PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('u') PORT_CHAR('U') PORT_CHANGED(key_stroke, 0x4f)
348#endif
349INPUT_PORTS_END
350
351ROM_START( vfx )
352    ROM_REGION(0x20000, "osrom", 0)
353    ROM_LOAD16_BYTE( "vfx210b-low.bin",  0x000000, 0x010000, CRC(c51b19cd) SHA1(2a125b92ffa02ae9d7fb88118d525491d785e87e) )
354    ROM_LOAD16_BYTE( "vfx210b-high.bin", 0x000001, 0x010000, CRC(59853be8) SHA1(8e07f69d53f80885d15f624e0b912aeaf3212ee4) )
355
356    ROM_REGION(0x200000, "waverom", ROMREGION_ERASE00)
357    ROM_LOAD( "vfx-waves-1.bin",  0x000000, 0x080000, NO_DUMP )
358    ROM_LOAD( "vfx-waves-2.bin",  0x100000, 0x080000, NO_DUMP )
359ROM_END
360
361ROM_START( sq1 )
362    ROM_REGION(0x20000, "osrom", 0)
363    ROM_LOAD16_BYTE( "esq5505lo.bin",    0x000000, 0x010000, CRC(b004cf05) SHA1(567b0dae2e35b06e39da108f9c041fd9bc38fa35) )
364    ROM_LOAD16_BYTE( "esq5505up.bin",    0x000001, 0x010000, CRC(2e927873) SHA1(06a948cb71fa254b23f4b9236f29035d10778da1) )
365
366    ROM_REGION(0x200000, "waverom", 0)
367    ROM_LOAD16_BYTE( "sq1-u25.bin",  0x000001, 0x080000, CRC(26312451) SHA1(9f947a11592fd8420fc581914bf16e7ade75390c) )
368    ROM_LOAD16_BYTE( "sq1-u26.bin",  0x100001, 0x080000, CRC(2edaa9dc) SHA1(72fead505c4f44e5736ff7d545d72dfa37d613e2) )
369ROM_END
370
371ROM_START( eps16 )
372    ROM_REGION(0x10000, "osrom", 0)
373    ROM_LOAD16_BYTE( "eps-l.bin",    0x000000, 0x008000, CRC(382beac1) SHA1(110e31edb03fcf7bbde3e17423b21929e5b32db2) )
374    ROM_LOAD16_BYTE( "eps-h.bin",    0x000001, 0x008000, CRC(d8747420) SHA1(460597751386eb5f08465699b61381c4acd78065) )
375
376    ROM_REGION(0x200000, "waverom", ROMREGION_ERASE00)      // did the EPS-16 have ROM sounds or is it a pure sampler?
377ROM_END
378
379CONS( 1989, vfx,   0, 0, vfx,   vfx, 0, "Ensoniq", "VFX", GAME_NOT_WORKING )
380CONS( 1990, sq1,   0, 0, vfx,   vfx, 0, "Ensoniq", "SQ-1", GAME_NOT_WORKING )
381CONS( 1990, eps16, 0, 0, eps16, vfx, 0, "Ensoniq", "EPS-16 Plus", GAME_NOT_WORKING )
382
src/mess/mess.mak
r15234r15235
183183SOUNDS += SAA1099
184184#SOUNDS += IREMGA20
185185SOUNDS += ES5503
186#SOUNDS += ES5505
187#SOUNDS += ES5506
186SOUNDS += ES5505
187SOUNDS += ES5506
188188#SOUNDS += BSMT2000
189189#SOUNDS += GAELCO_CG1V
190190#SOUNDS += GAELCO_GAE1
r15234r15235
10451045$(MESSOBJ)/ensoniq.a:         \
10461046   $(MESS_DRIVERS)/esq1.o      \
10471047   $(MESS_DRIVERS)/mirage.o    \
1048   $(MESS_DRIVERS)/esq5505.o   \
10481049
10491050$(MESSOBJ)/entex.a:            \
10501051   $(MESS_VIDEO)/advision.o   \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team