Previous 199869 Revisions Next

r36412 Friday 13th March, 2015 at 22:52:57 UTC by David Haywood
note used addresses (nw)
[src/mame/audio]hng64.c
[src/mame/includes]hng64.h

trunk/src/mame/audio/hng64.c
r244923r244924
103103      // I guess it's only one of the bits, the commands are inverse of each other
104104      if (cmd==0x55AA)
105105      {
106         printf("soundcpu ON\n");
106         logerror("soundcpu ON\n");
107107         m_audiocpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
108108         m_audiocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
109109      }
110110      else if (cmd==0xAA55)
111111      {
112         printf("soundcpu OFF\n");
112         logerror("soundcpu OFF\n");
113113         m_audiocpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
114114         m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
115115      }
116116      else
117117      {
118         printf("unknown hng64_soundcpu_enable_w cmd %04x\n", cmd);
118         logerror("unknown hng64_soundcpu_enable_w cmd %04x\n", cmd);
119119      }
120120   }
121121
122122   if (mem_mask&0x0000ffff)
123123   {
124         printf("unknown hng64_soundcpu_enable_w %08x %08x\n", data, mem_mask);
124         logerror("unknown hng64_soundcpu_enable_w %08x %08x\n", data, mem_mask);
125125   }
126126}
127127
r244923r244924
180180
181181WRITE16_MEMBER(hng64_state::hng64_sound_port_0008_w)
182182{
183//   printf("hng64_sound_port_0008_w %04x %04x\n", data, mem_mask);
183//   logerror("hng64_sound_port_0008_w %04x %04x\n", data, mem_mask);
184184   // seems to one or more of the DMARQ on the V53, writes here when it expects DMA channel 3 to transfer ~0x20 bytes just after startup
185185
186186
r244923r244924
189189
190190}
191191
192READ16_MEMBER(hng64_state::hng64_sound_port_0004_r)
193{
194   // read in irq5
195   logerror("%08x: hng64_sound_port_0004_r mask (%04x)\n", space.device().safe_pc(), mem_mask);
196   return rand();
197}
198
199READ16_MEMBER(hng64_state::hng64_sound_port_0006_r)
200{
201   // read in irq5
202   logerror("%08x: hng64_sound_port_0006_r mask (%04x)\n", space.device().safe_pc(), mem_mask);
203   return rand();
204}
205
206READ16_MEMBER(hng64_state::hng64_sound_port_0008_r)
207{
208   // read in irq5
209   logerror("%08x: hng64_sound_port_0008_r mask (%04x)\n", space.device().safe_pc(), mem_mask);
210   return rand();
211}
212
192213WRITE16_MEMBER(hng64_state::hng64_sound_select_w)
193214{
194215   // seems to write values in the format xxyy where yy is 0x00-0x1f and xx is oten 00/01/0a
195216   // there are said to be 32 audio channels, so maybe the lower byte is the channel?
196217
197//   printf("hng64_sound_select_w")
218//   logerror("hng64_sound_select_w")
198219   COMBINE_DATA(&m_audiochannel);
199220}
200221
201222WRITE16_MEMBER(hng64_state::hng64_sound_data_02_w)
202223{
203224   m_audiodat[m_audiochannel].dat[2] = data;
204//   printf("write port 0x0002 chansel %04x data %04x (%04x%04x%04x)\n", m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]);
225//   logerror("write port 0x0002 chansel %04x data %04x (%04x%04x%04x)\n", m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]);
205226}
206227
207228WRITE16_MEMBER(hng64_state::hng64_sound_data_04_w)
208229{
209230   m_audiodat[m_audiochannel].dat[1] = data;
210//   printf("write port 0x0004 chansel %04x data %04x (%04x%04x%04x)\n", m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]);
231//   logerror("write port 0x0004 chansel %04x data %04x (%04x%04x%04x)\n", m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]);
211232}
212233WRITE16_MEMBER(hng64_state::hng64_sound_data_06_w)
213234{
214235   m_audiodat[m_audiochannel].dat[0] = data;
215//   printf("write port 0x0006 chansel %04x data %04x (%04x%04x%04x)\n", m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]);
236//   logerror("write port 0x0006 chansel %04x data %04x (%04x%04x%04x)\n", m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]);
216237}
217238
218239// but why not just use the V33/V53 XA mode??
219240WRITE16_MEMBER(hng64_state::hng64_sound_bank_w)
220241{
221   printf("%08x hng64_sound_bank_w? %02x %04x\n", space.device().safe_pc(), offset, data);
242   logerror("%08x hng64_sound_bank_w? %02x %04x\n", space.device().safe_pc(), offset, data);
222243   // buriki writes 0x3f to 0x200 before jumping to the low addresses..
223244   // where it expects to find data from 0x1f0000
224245
r244923r244924
247268
248269}
249270
271
272WRITE16_MEMBER(hng64_state::hng64_sound_port_000a_w)
273{
274   logerror("%08x: hng64_port hng64_sound_port_000a_w %04x mask (%04x)\n",  space.device().safe_pc(), data, mem_mask);
275}
276
277WRITE16_MEMBER(hng64_state::hng64_sound_port_000c_w)
278{
279   logerror("%08x: hng64_port hng64_sound_port_000c_w %04x mask (%04x)\n",  space.device().safe_pc(), data, mem_mask);
280}
281
282
250283WRITE16_MEMBER(hng64_state::hng64_sound_port_0102_w)
251284{
252   printf("hng64_port 0x0102 %04x\n", data);
285   logerror("hng64_port 0x0102 %04x\n", data);
253286}
254287
255288WRITE16_MEMBER(hng64_state::hng64_sound_port_0080_w)
256289{
257   printf("hng64_port 0x0080 %04x\n", data);
290   logerror("hng64_port 0x0080 %04x\n", data);
258291}
259292
293READ16_MEMBER(hng64_state::hng64_sound_port_0106_r)
294{
295   // read in irq5
296   logerror("%08x: hng64_sound_port_0106_r mask (%04x)\n", space.device().safe_pc(), mem_mask);
297   return rand();
298}
299
300WRITE16_MEMBER(hng64_state::hng64_sound_port_010a_w)
301{
302   logerror("%08x: hng64_port hng64_sound_port_010a_w %04x mask (%04x)\n",  space.device().safe_pc(), data, mem_mask);
303}
304
305WRITE16_MEMBER(hng64_state::hng64_sound_port_0108_w)
306{
307   logerror("%08x: hng64_port hng64_sound_port_0108_w %04x mask (%04x)\n",  space.device().safe_pc(), data, mem_mask);
308}
309
310
311WRITE16_MEMBER(hng64_state::hng64_sound_port_0100_w)
312{
313   logerror("%08x: hng64_port hng64_sound_port_0100_w %04x mask (%04x)\n",  space.device().safe_pc(), data, mem_mask);
314}
315
316READ16_MEMBER(hng64_state::hng64_sound_port_0104_r)
317{
318   // read in irq5
319   logerror("%08x: hng64_sound_port_0104_r mask (%04x)\n", space.device().safe_pc(), mem_mask);
320   return rand();
321}
322
260323static ADDRESS_MAP_START( hng_sound_io, AS_IO, 16, hng64_state )
261324   AM_RANGE(0x0000, 0x0001) AM_WRITE( hng64_sound_select_w )
262325   AM_RANGE(0x0002, 0x0003) AM_WRITE( hng64_sound_data_02_w )
263   AM_RANGE(0x0004, 0x0005) AM_WRITE( hng64_sound_data_04_w )
264   AM_RANGE(0x0006, 0x0007) AM_WRITE( hng64_sound_data_06_w )
265   AM_RANGE(0x0008, 0x0009) AM_WRITE( hng64_sound_port_0008_w )
266   // a 8 c used too?
326   AM_RANGE(0x0004, 0x0005) AM_READWRITE( hng64_sound_port_0004_r, hng64_sound_data_04_w )
327   AM_RANGE(0x0006, 0x0007) AM_READWRITE( hng64_sound_port_0006_r, hng64_sound_data_06_w )
328   AM_RANGE(0x0008, 0x0009) AM_READWRITE( hng64_sound_port_0008_r, hng64_sound_port_0008_w )
329   AM_RANGE(0x000a, 0x000b) AM_WRITE( hng64_sound_port_000a_w )
330   AM_RANGE(0x000c, 0x000d) AM_WRITE( hng64_sound_port_000c_w )
267331
268332   AM_RANGE(0x0080, 0x0081) AM_WRITE( hng64_sound_port_0080_w )
269333
270   AM_RANGE(0x0102, 0x0103) AM_WRITE( hng64_sound_port_0102_w )
334   AM_RANGE(0x0100, 0x0101) AM_WRITE( hng64_sound_port_0100_w )
335   AM_RANGE(0x0102, 0x0103) AM_WRITE( hng64_sound_port_0102_w ) // gets values of 0x0080 / 0x0081 / 0x0000 / 0x0001 depending on return from 0x0106 in irq5?
336   AM_RANGE(0x0104, 0x0105) AM_READ( hng64_sound_port_0104_r )
337   AM_RANGE(0x0106, 0x0107) AM_READ( hng64_sound_port_0106_r )
338   AM_RANGE(0x0108, 0x0109) AM_WRITE( hng64_sound_port_0108_w )
339   AM_RANGE(0x010a, 0x010b) AM_WRITE( hng64_sound_port_010a_w )
271340
272341   AM_RANGE(0x0200, 0x021f) AM_WRITE( hng64_sound_bank_w ) // ??
273342
r244923r244924
288357   // currently it reads a block of 0x20 '0x00' values from a very specific block of RAM where there is a 0x20 space in the data and transfers them repeatedly, I assume
289358   // this is some kind of buffer for the audio or DSP and eventually will be populated with other values...
290359   // if this comes to life maybe something interesting is happening!
291   if (data!=0x00) printf("dma_iow3_cb %02x\n", data);
360   if (data!=0x00) logerror("dma_iow3_cb %02x\n", data);
292361}
293362
294363WRITE_LINE_MEMBER(hng64_state::tcu_tm0_cb)
295364{
296365   // this goes high once near startup
297   printf("tcu_tm0_cb %02x\n", state);
366   logerror("tcu_tm0_cb %02x\n", state);
298367}
299368
300369WRITE_LINE_MEMBER(hng64_state::tcu_tm1_cb)
301370{
302371   // these are very active, maybe they feed back into the v53 via one of the IRQ pins?  TM2 toggles more rapidly than TM1
303//   printf("tcu_tm1_cb %02x\n", state);
304   m_audiocpu->set_input_line(0, state? ASSERT_LINE:CLEAR_LINE);
372//   logerror("tcu_tm1_cb %02x\n", state);
373   m_audiocpu->set_input_line(5, state? ASSERT_LINE:CLEAR_LINE); // not accurate, just so we have a trigger
305374}
306375
307376WRITE_LINE_MEMBER(hng64_state::tcu_tm2_cb)
308377{
309378   // these are very active, maybe they feed back into the v53 via one of the IRQ pins?  TM2 toggles more rapidly than TM1
310//   printf("tcu_tm2_cb %02x\n", state);
379//   logerror("tcu_tm2_cb %02x\n", state);
380   m_audiocpu->set_input_line(2, state? ASSERT_LINE:CLEAR_LINE); // not accurate, just so we have a trigger
311381}
312382
313383
trunk/src/mame/includes/hng64.h
r244923r244924
354354   int m_vertsrom_size;
355355   void reset_sound();
356356   void reset_net();
357   DECLARE_WRITE16_MEMBER(hng64_sound_port_0008_w);
358357
359358   DECLARE_WRITE_LINE_MEMBER(dma_hreq_cb);
360359   DECLARE_READ8_MEMBER(dma_memr_cb);
r244923r244924
375374   DECLARE_WRITE16_MEMBER(hng64_sound_data_02_w);
376375   DECLARE_WRITE16_MEMBER(hng64_sound_data_04_w);
377376   DECLARE_WRITE16_MEMBER(hng64_sound_data_06_w);
378   DECLARE_WRITE16_MEMBER(hng64_sound_bank_w);
379   DECLARE_WRITE16_MEMBER(hng64_sound_port_0102_w);
377
378   DECLARE_READ16_MEMBER(hng64_sound_port_0004_r);
379   DECLARE_READ16_MEMBER(hng64_sound_port_0006_r);
380
381   DECLARE_READ16_MEMBER(hng64_sound_port_0008_r);
382   DECLARE_WRITE16_MEMBER(hng64_sound_port_0008_w);
383
384   DECLARE_WRITE16_MEMBER(hng64_sound_port_000a_w);
385   DECLARE_WRITE16_MEMBER(hng64_sound_port_000c_w);
386
380387   DECLARE_WRITE16_MEMBER(hng64_sound_port_0080_w);
381388
389   DECLARE_WRITE16_MEMBER(hng64_sound_port_0100_w);
390   DECLARE_WRITE16_MEMBER(hng64_sound_port_0102_w);
391   DECLARE_READ16_MEMBER(hng64_sound_port_0104_r);
392   DECLARE_READ16_MEMBER(hng64_sound_port_0106_r);
393   DECLARE_WRITE16_MEMBER(hng64_sound_port_0108_w);
394   DECLARE_WRITE16_MEMBER(hng64_sound_port_010a_w);
382395
396   DECLARE_WRITE16_MEMBER(hng64_sound_bank_w);
383397};
384398


Previous 199869 Revisions Next


© 1997-2024 The MAME Team