3
3
#include "taito_en.h"
5
5
static int counter,vector_reg,imr_status;
6
static UINT16 es5510_dsp_ram[0x200];
6
static UINT16 es5510_dsp_ram[0x200];
7
7
static UINT32 es5510_gpr[0xc0];
8
static UINT32 es5510_dram[1<<24];
9
static UINT32 es5510_dol_latch;
10
static UINT32 es5510_dil_latch;
11
static UINT32 es5510_dadr_latch;
8
12
static UINT32 es5510_gpr_latch;
13
static UINT8 es5510_ram_sel;
9
14
static int timer_mode,m68681_imr;
10
static UINT32 *f3_shared_ram;
15
static UINT32 *f3_shared_ram;
12
17
//static int es_tmp=1;
59
64
es5505_voice_bank_w(space->machine().device("ensoniq"),offset,data<<20);
62
static WRITE16_HANDLER( f3_volume_w )
67
static WRITE8_HANDLER( f3_volume_w )
64
// static UINT16 channel[8],last_l,last_r;
67
// if (offset==0) latch=(data>>8)&0x7;
68
// if (offset==1) channel[latch]=data>>8;
70
// if (channel[7]!=last_l) mixer_set_volume(0, (int)((float)channel[7]*1.58)); /* Left master volume */
71
// if (channel[6]!=last_r) mixer_set_volume(1, (int)((float)channel[6]*1.58)); /* Right master volume */
69
static UINT8 latch,ch[8];
80
ch_vol = (double)(ch[latch] & 0x3f);
83
/* Left/Right panning trusted with Arabian Magic Sound Test menu. */
84
es5505_set_channel_volume(space->machine().device("ensoniq"),(latch & 1) ^ 1,ch_vol);
88
//popmessage("%02x %02x %02x %02x %02x %02x %02x %02x",ch[0],ch[1],ch[2],ch[3],ch[4],ch[5],ch[6],ch[7]);
75
90
/* Channel 5 - Left Aux? Always set to volume, but never used for panning */
76
91
/* Channel 4 - Right Aux? Always set to volume, but never used for panning */
77
92
/* Channels 0, 1, 2, 3 - Unused */
80
96
static TIMER_DEVICE_CALLBACK( taito_en_timer_callback )
190
206
//if (offset<7 && es5510_dsp_ram[0]!=0xff) return space->machine().rand()%0xffff;
210
case 0x09: return (es5510_dil_latch >> 16) & 0xff;
211
case 0x0a: return (es5510_dil_latch >> 8) & 0xff;
212
case 0x0b: return (es5510_dil_latch >> 0) & 0xff; //TODO: docs says that this always returns 0
192
215
if (offset==0x12) return 0;
207
230
COMBINE_DATA(&es5510_dsp_ram[offset]);
209
232
switch (offset) {
210
case 0x00: es5510_gpr_latch=(es5510_gpr_latch&0x00ffff)|((data&0xff)<<16);
211
case 0x01: es5510_gpr_latch=(es5510_gpr_latch&0xff00ff)|((data&0xff)<< 8);
212
case 0x02: es5510_gpr_latch=(es5510_gpr_latch&0xffff00)|((data&0xff)<< 0);
233
case 0x00: es5510_gpr_latch=(es5510_gpr_latch&0x00ffff)|((data&0xff)<<16); break;
234
case 0x01: es5510_gpr_latch=(es5510_gpr_latch&0xff00ff)|((data&0xff)<< 8); break;
235
case 0x02: es5510_gpr_latch=(es5510_gpr_latch&0xffff00)|((data&0xff)<< 0); break;
237
/* 0x03 to 0x08 INSTR Register */
238
/* 0x09 to 0x0b DIL Register (r/o) */
240
case 0x0c: es5510_dol_latch=(es5510_dol_latch&0x00ffff)|((data&0xff)<<16); break;
241
case 0x0d: es5510_dol_latch=(es5510_dol_latch&0xff00ff)|((data&0xff)<< 8); break;
242
case 0x0e: es5510_dol_latch=(es5510_dol_latch&0xffff00)|((data&0xff)<< 0); break; //TODO: docs says that this always returns 0xff
245
es5510_dadr_latch=(es5510_dadr_latch&0x00ffff)|((data&0xff)<<16);
247
es5510_dil_latch = es5510_dram[es5510_dadr_latch];
249
es5510_dram[es5510_dadr_latch] = es5510_dol_latch;
252
case 0x10: es5510_dadr_latch=(es5510_dadr_latch&0xff00ff)|((data&0xff)<< 8); break;
253
case 0x11: es5510_dadr_latch=(es5510_dadr_latch&0xffff00)|((data&0xff)<< 0); break;
255
/* 0x12 Host Control */
257
case 0x14: es5510_ram_sel = data & 0x80; /* bit 6 is i/o select, everything else is undefined */break;
259
/* 0x16 Program Counter (test purpose, r/o?) */
260
/* 0x17 Internal Refresh counter (test purpose) */
261
/* 0x18 Host Serial Control */
262
/* 0x1f Halt enable (w) / Frame Counter (r) */
215
264
case 0x80: /* Read select - GPR + INSTR */
216
265
// logerror("ES5510: Read GPR/INSTR %06x (%06x)\n",data,es5510_gpr[data]);
245
294
AM_RANGE(0x260000, 0x2601ff) AM_READWRITE(es5510_dsp_r, es5510_dsp_w)
246
295
AM_RANGE(0x280000, 0x28001f) AM_READWRITE(f3_68681_r, f3_68681_w)
247
296
AM_RANGE(0x300000, 0x30003f) AM_WRITE(f3_es5505_bank_w)
248
AM_RANGE(0x340000, 0x340003) AM_WRITE(f3_volume_w) /* 8 channel volume control */
297
AM_RANGE(0x340000, 0x340003) AM_WRITE8(f3_volume_w,0xff00) /* 8 channel volume control */
249
298
AM_RANGE(0xc00000, 0xc1ffff) AM_ROMBANK("bank1")
250
299
AM_RANGE(0xc20000, 0xc3ffff) AM_ROMBANK("bank2")
251
300
AM_RANGE(0xc40000, 0xc7ffff) AM_ROMBANK("bank3")