Previous 199869 Revisions Next

r36845 Tuesday 31st March, 2015 at 19:58:56 UTC by Angelo Salese
Added proper sound comms for hng64 [Angelo Salese]
[src/emu/sound]l7a1045_l6028_dsp_a.c
[src/mame/audio]hng64.c
[src/mame/drivers]hng64.c
[src/mame/includes]hng64.h

trunk/src/emu/sound/l7a1045_l6028_dsp_a.c
r245356r245357
307307
308308
309309   }
310   return rand();
310   return 0;
311311}
312312
313313READ16_MEMBER(l7a1045_sound_device::l7a1045_sound_port_0006_r)
trunk/src/mame/audio/hng64.c
r245356r245357
205205{
206206   // read in irq5
207207   logerror("%08x: hng64_sound_port_0008_r mask (%04x)\n", space.device().safe_pc(), mem_mask);
208   return rand();
208   return 0;
209209}
210210
211211
r245356r245357
254254}
255255
256256
257WRITE16_MEMBER(hng64_state::hng64_sound_port_0102_w)
258{
259   logerror("hng64_port 0x0102 %04x\n", data);
260}
261
262257WRITE16_MEMBER(hng64_state::hng64_sound_port_0080_w)
263258{
264259   logerror("hng64_port 0x0080 %04x\n", data);
265260}
266261
267READ16_MEMBER(hng64_state::hng64_sound_port_0106_r)
268{
269   // read in irq5
270   logerror("%08x: hng64_sound_port_0106_r mask (%04x)\n", space.device().safe_pc(), mem_mask);
271   return rand();
272}
273262
274WRITE16_MEMBER(hng64_state::hng64_sound_port_010a_w)
263WRITE16_MEMBER(hng64_state::sound_comms_w)
275264{
276   logerror("%08x: hng64_port hng64_sound_port_010a_w %04x mask (%04x)\n",  space.device().safe_pc(), data, mem_mask);
265   switch(offset*2)
266   {
267      case 0x0:
268         COMBINE_DATA(&sound_latch[0]);
269         return;
270      case 0x2:
271         COMBINE_DATA(&sound_latch[1]);
272         return;
273      case 0xa:
274         /* correct? */
275         m_audiocpu->set_input_line(5, CLEAR_LINE);
276         if(data)
277            printf("IRQ ACK %02x?\n",data);
278         return; // intentional for log
279   }
280   
281   printf("SOUND W %02x %04x\n",offset*2,data);
277282}
278283
279WRITE16_MEMBER(hng64_state::hng64_sound_port_0108_w)
284READ16_MEMBER(hng64_state::sound_comms_r)
280285{
281   logerror("%08x: hng64_port hng64_sound_port_0108_w %04x mask (%04x)\n",  space.device().safe_pc(), data, mem_mask);
286   switch(offset*2)
287   {
288      case 0x04:
289         return main_latch[0];
290      case 0x06:
291         return main_latch[1];
292   }
293   printf("SOUND R %02x\n",offset*2);
294   
295   return 0;
282296}
283297
284
285WRITE16_MEMBER(hng64_state::hng64_sound_port_0100_w)
286{
287   logerror("%08x: hng64_port hng64_sound_port_0100_w %04x mask (%04x)\n",  space.device().safe_pc(), data, mem_mask);
288}
289
290READ16_MEMBER(hng64_state::hng64_sound_port_0104_r)
291{
292   // read in irq5
293   logerror("%08x: hng64_sound_port_0104_r mask (%04x)\n", space.device().safe_pc(), mem_mask);
294   return rand();
295}
296
297298static ADDRESS_MAP_START( hng_sound_io, AS_IO, 16, hng64_state )
298299   AM_RANGE(0x0000, 0x0007) AM_DEVREADWRITE("l7a1045", l7a1045_sound_device, l7a1045_sound_r, l7a1045_sound_w )
299300
r245356r245357
303304
304305   AM_RANGE(0x0080, 0x0081) AM_WRITE( hng64_sound_port_0080_w )
305306
306   AM_RANGE(0x0100, 0x0101) AM_WRITE( hng64_sound_port_0100_w )
307   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?
308   AM_RANGE(0x0104, 0x0105) AM_READ( hng64_sound_port_0104_r )
309   AM_RANGE(0x0106, 0x0107) AM_READ( hng64_sound_port_0106_r )
310   AM_RANGE(0x0108, 0x0109) AM_WRITE( hng64_sound_port_0108_w )
311   AM_RANGE(0x010a, 0x010b) AM_WRITE( hng64_sound_port_010a_w )
307   AM_RANGE(0x0100, 0x010f) AM_READWRITE( sound_comms_r,sound_comms_w )
312308
313309   AM_RANGE(0x0200, 0x021f) AM_WRITE( hng64_sound_bank_w ) // ??
314310
r245356r245357
342338{
343339   // these are very active, maybe they feed back into the v53 via one of the IRQ pins?  TM2 toggles more rapidly than TM1
344340//  logerror("tcu_tm1_cb %02x\n", state);
345   m_audiocpu->set_input_line(5, state? ASSERT_LINE:CLEAR_LINE); // not accurate, just so we have a trigger
341   //m_audiocpu->set_input_line(5, state? ASSERT_LINE:CLEAR_LINE); // not accurate, just so we have a trigger
346342}
347343
348344WRITE_LINE_MEMBER(hng64_state::tcu_tm2_cb)
r245356r245357
351347//  logerror("tcu_tm2_cb %02x\n", state);
352348
353349   // NOT ACCURATE, just so that all the interrupts get triggered for now.
354   static int i = 0;
355   m_audiocpu->set_input_line(i, state? ASSERT_LINE:CLEAR_LINE);
356   i++;
357   if (i == 3) i = 0;
350   //static int i = 0;
351   //m_audiocpu->set_input_line(i, state? ASSERT_LINE:CLEAR_LINE);
352   //i++;
353   //if (i == 3) i = 0;
358354}
359355
360356
trunk/src/mame/drivers/hng64.c
r245356r245357
922922   COMBINE_DATA(&m_videoregs[offset]);
923923}
924924
925READ16_MEMBER(hng64_state::main_sound_comms_r)
926{
927   switch(offset *2)
928   {
929      case 0x04:
930         return sound_latch[0];
931      case 0x06:
932         return sound_latch[1];
933      default:
934         printf("%08x R\n",offset*2);
935         break;
936   }
937   return 0;
938}
939
940WRITE16_MEMBER(hng64_state::main_sound_comms_w)
941{
942   switch(offset * 2)
943   {
944      case 0x00:
945         COMBINE_DATA(&main_latch[0]);
946         break;
947      case 0x02:
948         COMBINE_DATA(&main_latch[1]);
949         break;
950      case 0x08:
951         m_audiocpu->set_input_line(5, ASSERT_LINE);
952         if(data != 1)
953            printf("IRQ send %02x?\n",data);
954         break;
955      default:
956         printf("%02x %04x\n",offset*2,data);
957         break;
958   }
959}
960
961
925962static ADDRESS_MAP_START( hng_map, AS_PROGRAM, 32, hng64_state )
926963
927964   AM_RANGE(0x00000000, 0x00ffffff) AM_RAM AM_SHARE("mainram")
r245356r245357
9631000   AM_RANGE(0x60200000, 0x603fffff) AM_READWRITE(hng64_soundram_r, hng64_soundram_w)   // program + data for V53A gets uploaded here
9641001
9651002   // These are sound ports of some sort
966//  AM_RANGE(0x68000000, 0x68000003) AM_WRITENOP    // ??
967//  AM_RANGE(0x68000004, 0x68000007) AM_READNOP     // ??
968//  AM_RANGE(0x68000008, 0x6800000b) AM_WRITENOP    // ??
1003   AM_RANGE(0x68000000, 0x6800000f) AM_READWRITE16(main_sound_comms_r,main_sound_comms_w,0xffffffff)
9691004   AM_RANGE(0x6f000000, 0x6f000003) AM_WRITE(hng64_soundcpu_enable_w)
9701005
9711006   // Communications
trunk/src/mame/includes/hng64.h
r245356r245357
381381   DECLARE_WRITE16_MEMBER(hng64_sound_port_010a_w);
382382
383383   DECLARE_WRITE16_MEMBER(hng64_sound_bank_w);
384   DECLARE_READ16_MEMBER(main_sound_comms_r);
385   DECLARE_WRITE16_MEMBER(main_sound_comms_w);
386   DECLARE_READ16_MEMBER(sound_comms_r);
387   DECLARE_WRITE16_MEMBER(sound_comms_w);
388   UINT16 main_latch[2],sound_latch[2];
384389};


Previous 199869 Revisions Next


© 1997-2024 The MAME Team