diff --git a/src/emu/sound/l7a1045_l6028_dsp_a.c b/src/emu/sound/l7a1045_l6028_dsp_a.c index f845435caae..13df8251c37 100644 --- a/src/emu/sound/l7a1045_l6028_dsp_a.c +++ b/src/emu/sound/l7a1045_l6028_dsp_a.c @@ -307,7 +307,7 @@ READ16_MEMBER(l7a1045_sound_device::l7a1045_sound_port_0004_r) } - return rand(); + return 0; } READ16_MEMBER(l7a1045_sound_device::l7a1045_sound_port_0006_r) diff --git a/src/mame/audio/hng64.c b/src/mame/audio/hng64.c index c09258d3539..b1e1be7ff9a 100644 --- a/src/mame/audio/hng64.c +++ b/src/mame/audio/hng64.c @@ -205,7 +205,7 @@ READ16_MEMBER(hng64_state::hng64_sound_port_0008_r) { // read in irq5 logerror("%08x: hng64_sound_port_0008_r mask (%04x)\n", space.device().safe_pc(), mem_mask); - return rand(); + return 0; } @@ -254,44 +254,45 @@ WRITE16_MEMBER(hng64_state::hng64_sound_port_000c_w) } -WRITE16_MEMBER(hng64_state::hng64_sound_port_0102_w) -{ - logerror("hng64_port 0x0102 %04x\n", data); -} - WRITE16_MEMBER(hng64_state::hng64_sound_port_0080_w) { logerror("hng64_port 0x0080 %04x\n", data); } -READ16_MEMBER(hng64_state::hng64_sound_port_0106_r) + +WRITE16_MEMBER(hng64_state::sound_comms_w) { - // read in irq5 - logerror("%08x: hng64_sound_port_0106_r mask (%04x)\n", space.device().safe_pc(), mem_mask); - return rand(); + switch(offset*2) + { + case 0x0: + COMBINE_DATA(&sound_latch[0]); + return; + case 0x2: + COMBINE_DATA(&sound_latch[1]); + return; + case 0xa: + /* correct? */ + m_audiocpu->set_input_line(5, CLEAR_LINE); + if(data) + printf("IRQ ACK %02x?\n",data); + return; // intentional for log + } + + printf("SOUND W %02x %04x\n",offset*2,data); } -WRITE16_MEMBER(hng64_state::hng64_sound_port_010a_w) +READ16_MEMBER(hng64_state::sound_comms_r) { - logerror("%08x: hng64_port hng64_sound_port_010a_w %04x mask (%04x)\n", space.device().safe_pc(), data, mem_mask); -} - -WRITE16_MEMBER(hng64_state::hng64_sound_port_0108_w) -{ - logerror("%08x: hng64_port hng64_sound_port_0108_w %04x mask (%04x)\n", space.device().safe_pc(), data, mem_mask); -} - - -WRITE16_MEMBER(hng64_state::hng64_sound_port_0100_w) -{ - logerror("%08x: hng64_port hng64_sound_port_0100_w %04x mask (%04x)\n", space.device().safe_pc(), data, mem_mask); -} - -READ16_MEMBER(hng64_state::hng64_sound_port_0104_r) -{ - // read in irq5 - logerror("%08x: hng64_sound_port_0104_r mask (%04x)\n", space.device().safe_pc(), mem_mask); - return rand(); + switch(offset*2) + { + case 0x04: + return main_latch[0]; + case 0x06: + return main_latch[1]; + } + printf("SOUND R %02x\n",offset*2); + + return 0; } static ADDRESS_MAP_START( hng_sound_io, AS_IO, 16, hng64_state ) @@ -303,12 +304,7 @@ static ADDRESS_MAP_START( hng_sound_io, AS_IO, 16, hng64_state ) AM_RANGE(0x0080, 0x0081) AM_WRITE( hng64_sound_port_0080_w ) - AM_RANGE(0x0100, 0x0101) AM_WRITE( hng64_sound_port_0100_w ) - 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? - AM_RANGE(0x0104, 0x0105) AM_READ( hng64_sound_port_0104_r ) - AM_RANGE(0x0106, 0x0107) AM_READ( hng64_sound_port_0106_r ) - AM_RANGE(0x0108, 0x0109) AM_WRITE( hng64_sound_port_0108_w ) - AM_RANGE(0x010a, 0x010b) AM_WRITE( hng64_sound_port_010a_w ) + AM_RANGE(0x0100, 0x010f) AM_READWRITE( sound_comms_r,sound_comms_w ) AM_RANGE(0x0200, 0x021f) AM_WRITE( hng64_sound_bank_w ) // ?? @@ -342,7 +338,7 @@ WRITE_LINE_MEMBER(hng64_state::tcu_tm1_cb) { // these are very active, maybe they feed back into the v53 via one of the IRQ pins? TM2 toggles more rapidly than TM1 // logerror("tcu_tm1_cb %02x\n", state); - m_audiocpu->set_input_line(5, state? ASSERT_LINE:CLEAR_LINE); // not accurate, just so we have a trigger + //m_audiocpu->set_input_line(5, state? ASSERT_LINE:CLEAR_LINE); // not accurate, just so we have a trigger } WRITE_LINE_MEMBER(hng64_state::tcu_tm2_cb) @@ -351,10 +347,10 @@ WRITE_LINE_MEMBER(hng64_state::tcu_tm2_cb) // logerror("tcu_tm2_cb %02x\n", state); // NOT ACCURATE, just so that all the interrupts get triggered for now. - static int i = 0; - m_audiocpu->set_input_line(i, state? ASSERT_LINE:CLEAR_LINE); - i++; - if (i == 3) i = 0; + //static int i = 0; + //m_audiocpu->set_input_line(i, state? ASSERT_LINE:CLEAR_LINE); + //i++; + //if (i == 3) i = 0; } diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c index 7046dccd0c6..d3e9a96b7b7 100644 --- a/src/mame/drivers/hng64.c +++ b/src/mame/drivers/hng64.c @@ -922,6 +922,43 @@ WRITE32_MEMBER(hng64_state::hng64_vregs_w) COMBINE_DATA(&m_videoregs[offset]); } +READ16_MEMBER(hng64_state::main_sound_comms_r) +{ + switch(offset *2) + { + case 0x04: + return sound_latch[0]; + case 0x06: + return sound_latch[1]; + default: + printf("%08x R\n",offset*2); + break; + } + return 0; +} + +WRITE16_MEMBER(hng64_state::main_sound_comms_w) +{ + switch(offset * 2) + { + case 0x00: + COMBINE_DATA(&main_latch[0]); + break; + case 0x02: + COMBINE_DATA(&main_latch[1]); + break; + case 0x08: + m_audiocpu->set_input_line(5, ASSERT_LINE); + if(data != 1) + printf("IRQ send %02x?\n",data); + break; + default: + printf("%02x %04x\n",offset*2,data); + break; + } +} + + static ADDRESS_MAP_START( hng_map, AS_PROGRAM, 32, hng64_state ) AM_RANGE(0x00000000, 0x00ffffff) AM_RAM AM_SHARE("mainram") @@ -963,9 +1000,7 @@ static ADDRESS_MAP_START( hng_map, AS_PROGRAM, 32, hng64_state ) AM_RANGE(0x60200000, 0x603fffff) AM_READWRITE(hng64_soundram_r, hng64_soundram_w) // program + data for V53A gets uploaded here // These are sound ports of some sort -// AM_RANGE(0x68000000, 0x68000003) AM_WRITENOP // ?? -// AM_RANGE(0x68000004, 0x68000007) AM_READNOP // ?? -// AM_RANGE(0x68000008, 0x6800000b) AM_WRITENOP // ?? + AM_RANGE(0x68000000, 0x6800000f) AM_READWRITE16(main_sound_comms_r,main_sound_comms_w,0xffffffff) AM_RANGE(0x6f000000, 0x6f000003) AM_WRITE(hng64_soundcpu_enable_w) // Communications diff --git a/src/mame/includes/hng64.h b/src/mame/includes/hng64.h index 9970a7b3fc5..9ae7d6d034b 100644 --- a/src/mame/includes/hng64.h +++ b/src/mame/includes/hng64.h @@ -381,4 +381,9 @@ public: DECLARE_WRITE16_MEMBER(hng64_sound_port_010a_w); DECLARE_WRITE16_MEMBER(hng64_sound_bank_w); + DECLARE_READ16_MEMBER(main_sound_comms_r); + DECLARE_WRITE16_MEMBER(main_sound_comms_w); + DECLARE_READ16_MEMBER(sound_comms_r); + DECLARE_WRITE16_MEMBER(sound_comms_w); + UINT16 main_latch[2],sound_latch[2]; };