summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/audio/hng64.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/audio/hng64.c')
-rw-r--r--src/mame/audio/hng64.c114
1 files changed, 92 insertions, 22 deletions
diff --git a/src/mame/audio/hng64.c b/src/mame/audio/hng64.c
index 1f5eb542f48..8003b14b492 100644
--- a/src/mame/audio/hng64.c
+++ b/src/mame/audio/hng64.c
@@ -103,25 +103,25 @@ WRITE32_MEMBER( hng64_state::hng64_soundcpu_enable_w )
// I guess it's only one of the bits, the commands are inverse of each other
if (cmd==0x55AA)
{
- printf("soundcpu ON\n");
+ logerror("soundcpu ON\n");
m_audiocpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
m_audiocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
}
else if (cmd==0xAA55)
{
- printf("soundcpu OFF\n");
+ logerror("soundcpu OFF\n");
m_audiocpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
}
else
{
- printf("unknown hng64_soundcpu_enable_w cmd %04x\n", cmd);
+ logerror("unknown hng64_soundcpu_enable_w cmd %04x\n", cmd);
}
}
if (mem_mask&0x0000ffff)
{
- printf("unknown hng64_soundcpu_enable_w %08x %08x\n", data, mem_mask);
+ logerror("unknown hng64_soundcpu_enable_w %08x %08x\n", data, mem_mask);
}
}
@@ -180,7 +180,7 @@ ADDRESS_MAP_END
WRITE16_MEMBER(hng64_state::hng64_sound_port_0008_w)
{
-// printf("hng64_sound_port_0008_w %04x %04x\n", data, mem_mask);
+// logerror("hng64_sound_port_0008_w %04x %04x\n", data, mem_mask);
// 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
@@ -189,36 +189,57 @@ WRITE16_MEMBER(hng64_state::hng64_sound_port_0008_w)
}
+READ16_MEMBER(hng64_state::hng64_sound_port_0004_r)
+{
+ // read in irq5
+ logerror("%08x: hng64_sound_port_0004_r mask (%04x)\n", space.device().safe_pc(), mem_mask);
+ return rand();
+}
+
+READ16_MEMBER(hng64_state::hng64_sound_port_0006_r)
+{
+ // read in irq5
+ logerror("%08x: hng64_sound_port_0006_r mask (%04x)\n", space.device().safe_pc(), mem_mask);
+ return rand();
+}
+
+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();
+}
+
WRITE16_MEMBER(hng64_state::hng64_sound_select_w)
{
// seems to write values in the format xxyy where yy is 0x00-0x1f and xx is oten 00/01/0a
// there are said to be 32 audio channels, so maybe the lower byte is the channel?
-// printf("hng64_sound_select_w")
+// logerror("hng64_sound_select_w")
COMBINE_DATA(&m_audiochannel);
}
WRITE16_MEMBER(hng64_state::hng64_sound_data_02_w)
{
m_audiodat[m_audiochannel].dat[2] = data;
-// 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]);
+// 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]);
}
WRITE16_MEMBER(hng64_state::hng64_sound_data_04_w)
{
m_audiodat[m_audiochannel].dat[1] = data;
-// 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]);
+// 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]);
}
WRITE16_MEMBER(hng64_state::hng64_sound_data_06_w)
{
m_audiodat[m_audiochannel].dat[0] = data;
-// 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]);
+// 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]);
}
// but why not just use the V33/V53 XA mode??
WRITE16_MEMBER(hng64_state::hng64_sound_bank_w)
{
- printf("%08x hng64_sound_bank_w? %02x %04x\n", space.device().safe_pc(), offset, data);
+ logerror("%08x hng64_sound_bank_w? %02x %04x\n", space.device().safe_pc(), offset, data);
// buriki writes 0x3f to 0x200 before jumping to the low addresses..
// where it expects to find data from 0x1f0000
@@ -247,27 +268,75 @@ WRITE16_MEMBER(hng64_state::hng64_sound_bank_w)
}
+
+WRITE16_MEMBER(hng64_state::hng64_sound_port_000a_w)
+{
+ logerror("%08x: hng64_port hng64_sound_port_000a_w %04x mask (%04x)\n", space.device().safe_pc(), data, mem_mask);
+}
+
+WRITE16_MEMBER(hng64_state::hng64_sound_port_000c_w)
+{
+ logerror("%08x: hng64_port hng64_sound_port_000c_w %04x mask (%04x)\n", space.device().safe_pc(), data, mem_mask);
+}
+
+
WRITE16_MEMBER(hng64_state::hng64_sound_port_0102_w)
{
- printf("hng64_port 0x0102 %04x\n", data);
+ logerror("hng64_port 0x0102 %04x\n", data);
}
WRITE16_MEMBER(hng64_state::hng64_sound_port_0080_w)
{
- printf("hng64_port 0x0080 %04x\n", data);
+ logerror("hng64_port 0x0080 %04x\n", data);
+}
+
+READ16_MEMBER(hng64_state::hng64_sound_port_0106_r)
+{
+ // read in irq5
+ logerror("%08x: hng64_sound_port_0106_r mask (%04x)\n", space.device().safe_pc(), mem_mask);
+ return rand();
+}
+
+WRITE16_MEMBER(hng64_state::hng64_sound_port_010a_w)
+{
+ 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();
}
static ADDRESS_MAP_START( hng_sound_io, AS_IO, 16, hng64_state )
AM_RANGE(0x0000, 0x0001) AM_WRITE( hng64_sound_select_w )
AM_RANGE(0x0002, 0x0003) AM_WRITE( hng64_sound_data_02_w )
- AM_RANGE(0x0004, 0x0005) AM_WRITE( hng64_sound_data_04_w )
- AM_RANGE(0x0006, 0x0007) AM_WRITE( hng64_sound_data_06_w )
- AM_RANGE(0x0008, 0x0009) AM_WRITE( hng64_sound_port_0008_w )
- // a 8 c used too?
+ AM_RANGE(0x0004, 0x0005) AM_READWRITE( hng64_sound_port_0004_r, hng64_sound_data_04_w )
+ AM_RANGE(0x0006, 0x0007) AM_READWRITE( hng64_sound_port_0006_r, hng64_sound_data_06_w )
+ AM_RANGE(0x0008, 0x0009) AM_READWRITE( hng64_sound_port_0008_r, hng64_sound_port_0008_w )
+ AM_RANGE(0x000a, 0x000b) AM_WRITE( hng64_sound_port_000a_w )
+ AM_RANGE(0x000c, 0x000d) AM_WRITE( hng64_sound_port_000c_w )
AM_RANGE(0x0080, 0x0081) AM_WRITE( hng64_sound_port_0080_w )
- AM_RANGE(0x0102, 0x0103) AM_WRITE( hng64_sound_port_0102_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(0x0200, 0x021f) AM_WRITE( hng64_sound_bank_w ) // ??
@@ -288,26 +357,27 @@ WRITE8_MEMBER(hng64_state::dma_iow3_cb)
// 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
// this is some kind of buffer for the audio or DSP and eventually will be populated with other values...
// if this comes to life maybe something interesting is happening!
- if (data!=0x00) printf("dma_iow3_cb %02x\n", data);
+ if (data!=0x00) logerror("dma_iow3_cb %02x\n", data);
}
WRITE_LINE_MEMBER(hng64_state::tcu_tm0_cb)
{
// this goes high once near startup
- printf("tcu_tm0_cb %02x\n", state);
+ logerror("tcu_tm0_cb %02x\n", state);
}
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
-// printf("tcu_tm1_cb %02x\n", state);
- m_audiocpu->set_input_line(0, state? ASSERT_LINE:CLEAR_LINE);
+// 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
}
WRITE_LINE_MEMBER(hng64_state::tcu_tm2_cb)
{
// these are very active, maybe they feed back into the v53 via one of the IRQ pins? TM2 toggles more rapidly than TM1
-// printf("tcu_tm2_cb %02x\n", state);
+// logerror("tcu_tm2_cb %02x\n", state);
+ m_audiocpu->set_input_line(2, state? ASSERT_LINE:CLEAR_LINE); // not accurate, just so we have a trigger
}