trunk/src/mame/audio/hng64.c
| r244923 | r244924 | |
| 103 | 103 | // I guess it's only one of the bits, the commands are inverse of each other |
| 104 | 104 | if (cmd==0x55AA) |
| 105 | 105 | { |
| 106 | | printf("soundcpu ON\n"); |
| 106 | logerror("soundcpu ON\n"); |
| 107 | 107 | m_audiocpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); |
| 108 | 108 | m_audiocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); |
| 109 | 109 | } |
| 110 | 110 | else if (cmd==0xAA55) |
| 111 | 111 | { |
| 112 | | printf("soundcpu OFF\n"); |
| 112 | logerror("soundcpu OFF\n"); |
| 113 | 113 | m_audiocpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); |
| 114 | 114 | m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
| 115 | 115 | } |
| 116 | 116 | else |
| 117 | 117 | { |
| 118 | | printf("unknown hng64_soundcpu_enable_w cmd %04x\n", cmd); |
| 118 | logerror("unknown hng64_soundcpu_enable_w cmd %04x\n", cmd); |
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (mem_mask&0x0000ffff) |
| 123 | 123 | { |
| 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); |
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |
| r244923 | r244924 | |
| 180 | 180 | |
| 181 | 181 | WRITE16_MEMBER(hng64_state::hng64_sound_port_0008_w) |
| 182 | 182 | { |
| 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); |
| 184 | 184 | // 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 |
| 185 | 185 | |
| 186 | 186 | |
| r244923 | r244924 | |
| 189 | 189 | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | READ16_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 | |
| 199 | READ16_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 | |
| 206 | READ16_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 | |
| 192 | 213 | WRITE16_MEMBER(hng64_state::hng64_sound_select_w) |
| 193 | 214 | { |
| 194 | 215 | // seems to write values in the format xxyy where yy is 0x00-0x1f and xx is oten 00/01/0a |
| 195 | 216 | // there are said to be 32 audio channels, so maybe the lower byte is the channel? |
| 196 | 217 | |
| 197 | | // printf("hng64_sound_select_w") |
| 218 | // logerror("hng64_sound_select_w") |
| 198 | 219 | COMBINE_DATA(&m_audiochannel); |
| 199 | 220 | } |
| 200 | 221 | |
| 201 | 222 | WRITE16_MEMBER(hng64_state::hng64_sound_data_02_w) |
| 202 | 223 | { |
| 203 | 224 | 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]); |
| 205 | 226 | } |
| 206 | 227 | |
| 207 | 228 | WRITE16_MEMBER(hng64_state::hng64_sound_data_04_w) |
| 208 | 229 | { |
| 209 | 230 | 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]); |
| 211 | 232 | } |
| 212 | 233 | WRITE16_MEMBER(hng64_state::hng64_sound_data_06_w) |
| 213 | 234 | { |
| 214 | 235 | 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]); |
| 216 | 237 | } |
| 217 | 238 | |
| 218 | 239 | // but why not just use the V33/V53 XA mode?? |
| 219 | 240 | WRITE16_MEMBER(hng64_state::hng64_sound_bank_w) |
| 220 | 241 | { |
| 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); |
| 222 | 243 | // buriki writes 0x3f to 0x200 before jumping to the low addresses.. |
| 223 | 244 | // where it expects to find data from 0x1f0000 |
| 224 | 245 | |
| r244923 | r244924 | |
| 247 | 268 | |
| 248 | 269 | } |
| 249 | 270 | |
| 271 | |
| 272 | WRITE16_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 | |
| 277 | WRITE16_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 | |
| 250 | 283 | WRITE16_MEMBER(hng64_state::hng64_sound_port_0102_w) |
| 251 | 284 | { |
| 252 | | printf("hng64_port 0x0102 %04x\n", data); |
| 285 | logerror("hng64_port 0x0102 %04x\n", data); |
| 253 | 286 | } |
| 254 | 287 | |
| 255 | 288 | WRITE16_MEMBER(hng64_state::hng64_sound_port_0080_w) |
| 256 | 289 | { |
| 257 | | printf("hng64_port 0x0080 %04x\n", data); |
| 290 | logerror("hng64_port 0x0080 %04x\n", data); |
| 258 | 291 | } |
| 259 | 292 | |
| 293 | READ16_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 | |
| 300 | WRITE16_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 | |
| 305 | WRITE16_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 | |
| 311 | WRITE16_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 | |
| 316 | READ16_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 | |
| 260 | 323 | static ADDRESS_MAP_START( hng_sound_io, AS_IO, 16, hng64_state ) |
| 261 | 324 | AM_RANGE(0x0000, 0x0001) AM_WRITE( hng64_sound_select_w ) |
| 262 | 325 | 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 ) |
| 267 | 331 | |
| 268 | 332 | AM_RANGE(0x0080, 0x0081) AM_WRITE( hng64_sound_port_0080_w ) |
| 269 | 333 | |
| 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 ) |
| 271 | 340 | |
| 272 | 341 | AM_RANGE(0x0200, 0x021f) AM_WRITE( hng64_sound_bank_w ) // ?? |
| 273 | 342 | |
| r244923 | r244924 | |
| 288 | 357 | // 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 |
| 289 | 358 | // this is some kind of buffer for the audio or DSP and eventually will be populated with other values... |
| 290 | 359 | // 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); |
| 292 | 361 | } |
| 293 | 362 | |
| 294 | 363 | WRITE_LINE_MEMBER(hng64_state::tcu_tm0_cb) |
| 295 | 364 | { |
| 296 | 365 | // this goes high once near startup |
| 297 | | printf("tcu_tm0_cb %02x\n", state); |
| 366 | logerror("tcu_tm0_cb %02x\n", state); |
| 298 | 367 | } |
| 299 | 368 | |
| 300 | 369 | WRITE_LINE_MEMBER(hng64_state::tcu_tm1_cb) |
| 301 | 370 | { |
| 302 | 371 | // 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 |
| 305 | 374 | } |
| 306 | 375 | |
| 307 | 376 | WRITE_LINE_MEMBER(hng64_state::tcu_tm2_cb) |
| 308 | 377 | { |
| 309 | 378 | // 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 |
| 311 | 381 | } |
| 312 | 382 | |
| 313 | 383 | |