Previous 199869 Revisions Next

r36812 Monday 30th March, 2015 at 20:08:15 UTC by David Haywood
document used register read/writes (nw)
[src/emu/sound]l7a1045_l6028_dsp_a.c l7a1045_l6028_dsp_a.h
[src/mame/audio]hng64.c

trunk/src/emu/sound/l7a1045_l6028_dsp_a.c
r245323r245324
5252
5353   Registers are not yet understood.
5454
55   probably sample start, end, loop positions, panning etc.
56   like CPS3, Qsound etc.
57
58   case 0x00:
59   case 0x01:
60   case 0x02:
61   case 0x03: // 00003fffffff (startup only?)
62   case 0x04: // doesn't use 6
63   case 0x05: // 00003fffffff (mostly, often)
64   case 0x06: // 00007ff0ffff mostly
65   case 0x07: // 0000000f0708 etc. (low values)
66   case 0x08: // doesn't write to 2/4/6 with this set??
67   case 0x09: // doesn't write to 2/4/6 with this set??
68   case 0x0a: // random looking values
69
5570   Some of the other ports on the HNG64 sound CPU may also be tied
5671   to this chip, this isn't yet clear.
5772
r245323r245324
148163   // ---- ---- 000c cccc
149164   // c = channel
150165
151   if (data & 0x00e0) printf("%08x: l7a1045_sound_select_w unknown channel %02x\n", space.device().safe_pc(), data & 0x00ff);
166   if (ACCESSING_BITS_0_7)
167   {
168      m_audiochannel = data;
169      if (m_audiochannel & 0xe0) printf("%08x: l7a1045_sound_select_w unknown channel %01x\n", space.device().safe_pc(), m_audiochannel & 0xff);
170      m_audiochannel &= 0x1f;
171   }
152172
153   UINT8 command = data >> 8;
173   if (ACCESSING_BITS_8_15)
174   {
175      m_audioregister = (data >> 8);
176      if (m_audioregister >0x0a) printf("%08x: l7a1045_sound_select_w unknown register %01x\n", space.device().safe_pc(), m_audioregister & 0xff);
177      m_audioregister &= 0x0f;
178   }
154179
155   switch (command)
180}
181
182WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_02_w) // upper? word of various registers?
183{
184   m_audiodat[m_audioregister][m_audiochannel].dat[2] = data;
185
186   // write with registers 00, 01, 04, 06, 05, 03, 07, 02 on startup
187   // groups writes of register 0a per channel
188
189   // register 08 / 09 not written?
190   switch (m_audioregister)
156191   {
192   default:
193
194   case 0x08:
195   case 0x09:
196      printf("%08x: unexpected write port 0x0002 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]);
197      break;
198
157199   case 0x00:
158200   case 0x01:
201   case 0x04:
202   case 0x06:
203   case 0x05:
204   case 0x03:
159205   case 0x02:
160   case 0x03: // 00003fffffff (startup only?)
161   case 0x04: // doesn't use 6
162   case 0x05: // 00003fffffff (mostly, often)
163   case 0x06: // 00007ff0ffff mostly
164   case 0x07: // 0000000f0708 etc. (low values)
165   case 0x08: // doesn't write to 2/4/6 with this set??
166   case 0x09: // doesn't write to 2/4/6 with this set??
167   case 0x0a: // random looking values
206   case 0x07:
168207
208   case 0x0a:
209   //   printf("%08x: write port 0x0002 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]);
169210      break;
170211
171   default:
172      printf("%08x: l7a1045_sound_select_w unrecognized command %02x\n", space.device().safe_pc(), command);
173      break;
174212   }
175213
176   COMBINE_DATA(&m_audiochannel);
177214}
178215
179WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_02_w)
216WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_04_w) // lower? word of various registers?
180217{
181   m_audiodat[m_audiochannel].dat[2] = data;
218   m_audiodat[m_audioregister][m_audiochannel].dat[1] = data;
182219
183//  if ((m_audiochannel & 0xff00) == 0x0a00)
184//      printf("%08x: write port 0x0002 chansel %04x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]);
185}
220   // write with registers 00, 04, 06, 05, 03, 07, 02, 01 on startup
221   // groups writes of register 0a per channel
186222
187WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_04_w)
188{
189   m_audiodat[m_audiochannel].dat[1] = data;
223   // register 08 / 09 not written?
190224
191//  if ((m_audiochannel & 0xff00) == 0x0a00)
192//      printf("%08x: write port 0x0004 chansel %04x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]);
225   switch (m_audioregister)
226   {
227   default:
228
229   case 0x08:
230   case 0x09:
231      printf("%08x: unexpected write port 0x0004 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]);
232      break;
233
234   case 0x00:
235   case 0x04:
236   case 0x06:
237   case 0x05:
238   case 0x03:
239   case 0x07:
240   case 0x01:
241   case 0x02:
242
243   case 0x0a:
244      //printf("%08x: write port 0x0004 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]);
245      break;
246   }
247
193248}
194WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_06_w)
249WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_06_w) // other part? of various registers.. less used than 02/04, maybe flags?
195250{
196   m_audiodat[m_audiochannel].dat[0] = data;
251   // 00 / 01 written at startup
252   // nothing else used?
197253
198//  if ((m_audiochannel & 0xff00) == 0x0a00)
199//      printf("%08x: write port 0x0006 chansel %04x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]);
254   m_audiodat[m_audioregister][m_audiochannel].dat[0] = data;
255   switch (m_audioregister)
256   {
257   default:
258
259   case 0x02:
260   case 0x03:
261   case 0x04:
262   case 0x05:
263   case 0x06:
264   case 0x07:
265   case 0x08:
266   case 0x09:
267   case 0x0a:
268      printf("%08x: unexpected write port 0x0006 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]);
269      break;
270
271   case 0x00:
272   case 0x01:
273      //printf("%08x: unexpected write port 0x0006 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]);
274      break;
275
276   }
200277}
201278
202279
203280READ16_MEMBER(l7a1045_sound_device::l7a1045_sound_port_0004_r)
204281{
205282   // it writes the channel select before reading this.. so either it works on channels, or the command..
206   // read in irq5
207   printf("%08x: l7a1045_sound_port_0004_r mask (%04x) chn %04x\n", space.device().safe_pc(), mem_mask, m_audiochannel);
283
284   // buriki reads registers 03/05/00 these at the moment, others don't
285   // also reads 06
286
287   switch (m_audioregister)
288   {
289   default:
290
291   case 0x01:
292   case 0x02:
293   case 0x04:
294   case 0x07:
295   case 0x08:
296   case 0x09:
297   case 0x0a:
298      printf("%08x: unexpected read port 0x0004 register %02x chansel %02x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]);
299      break;
300
301   case 0x03:
302   case 0x05:
303   case 0x00:
304   case 0x06:
305      //printf("%08x: read port 0x0004 register %02x chansel %02x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]);
306      break;
307
308
309   }
208310   return rand();
209311}
210312
211313READ16_MEMBER(l7a1045_sound_device::l7a1045_sound_port_0006_r)
212314{
213315   // it writes the channel select before reading this.. so either it works on channels, or the command..
214   // read in irq5
215   printf("%08x: l7a1045_sound_port_0006_r mask (%04x)  chn %04x\n", space.device().safe_pc(), mem_mask, m_audiochannel);
316
317   // buriki reads register 00
318
319   switch (m_audioregister)
320   {
321   default:
322
323   case 0x01:
324   case 0x02:
325   case 0x03:
326   case 0x04:
327   case 0x05:
328   case 0x06:
329   case 0x07:
330   case 0x08:
331   case 0x09:
332   case 0x0a:
333      printf("%08x: unexpected read port 0x0006 register %02x chansel %02x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]);
334      break;
335
336   case 0x00:
337      //printf("%08x: read port 0x0006 register %02x chansel %02x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]);
338      break;
339   }
216340   return rand();
217341}
trunk/src/emu/sound/l7a1045_l6028_dsp_a.h
r245323r245324
4545//   UINT16     m_key;
4646//   INT8*      m_base;
4747
48   UINT16 m_audiochannel;
48   UINT8 m_audiochannel;
49   UINT8 m_audioregister;
4950
5051   struct l7a1045_48bit_data {
5152      UINT16 dat[3];
5253   };
5354
54   l7a1045_48bit_data m_audiodat[0x10000];
55   l7a1045_48bit_data m_audiodat[0x10][0x20];
5556
5657   DECLARE_WRITE16_MEMBER(l7a1045_sound_select_w);
5758   DECLARE_WRITE16_MEMBER(l7a1045_sound_data_02_w);
trunk/src/mame/audio/hng64.c
r245323r245324
371371   MCFG_V53_TCU_OUT1_HANDLER(WRITELINE(hng64_state, tcu_tm1_cb))
372372   MCFG_V53_TCU_OUT2_HANDLER(WRITELINE(hng64_state, tcu_tm2_cb))
373373
374   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
375
374376   MCFG_SOUND_ADD("l7a1045", L7A1045, 16000000 ) // ??
375377   MCFG_SOUND_ROUTE(1, "lspeaker", 1.0)
376378   MCFG_SOUND_ROUTE(0, "rspeaker", 1.0)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team