trunk/src/mame/audio/hng64.c
r245356 | r245357 | |
205 | 205 | { |
206 | 206 | // read in irq5 |
207 | 207 | logerror("%08x: hng64_sound_port_0008_r mask (%04x)\n", space.device().safe_pc(), mem_mask); |
208 | | return rand(); |
| 208 | return 0; |
209 | 209 | } |
210 | 210 | |
211 | 211 | |
r245356 | r245357 | |
254 | 254 | } |
255 | 255 | |
256 | 256 | |
257 | | WRITE16_MEMBER(hng64_state::hng64_sound_port_0102_w) |
258 | | { |
259 | | logerror("hng64_port 0x0102 %04x\n", data); |
260 | | } |
261 | | |
262 | 257 | WRITE16_MEMBER(hng64_state::hng64_sound_port_0080_w) |
263 | 258 | { |
264 | 259 | logerror("hng64_port 0x0080 %04x\n", data); |
265 | 260 | } |
266 | 261 | |
267 | | READ16_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 | | } |
273 | 262 | |
274 | | WRITE16_MEMBER(hng64_state::hng64_sound_port_010a_w) |
| 263 | WRITE16_MEMBER(hng64_state::sound_comms_w) |
275 | 264 | { |
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); |
277 | 282 | } |
278 | 283 | |
279 | | WRITE16_MEMBER(hng64_state::hng64_sound_port_0108_w) |
| 284 | READ16_MEMBER(hng64_state::sound_comms_r) |
280 | 285 | { |
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; |
282 | 296 | } |
283 | 297 | |
284 | | |
285 | | WRITE16_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 | | |
290 | | READ16_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 | | |
297 | 298 | static ADDRESS_MAP_START( hng_sound_io, AS_IO, 16, hng64_state ) |
298 | 299 | AM_RANGE(0x0000, 0x0007) AM_DEVREADWRITE("l7a1045", l7a1045_sound_device, l7a1045_sound_r, l7a1045_sound_w ) |
299 | 300 | |
r245356 | r245357 | |
303 | 304 | |
304 | 305 | AM_RANGE(0x0080, 0x0081) AM_WRITE( hng64_sound_port_0080_w ) |
305 | 306 | |
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 ) |
312 | 308 | |
313 | 309 | AM_RANGE(0x0200, 0x021f) AM_WRITE( hng64_sound_bank_w ) // ?? |
314 | 310 | |
r245356 | r245357 | |
342 | 338 | { |
343 | 339 | // these are very active, maybe they feed back into the v53 via one of the IRQ pins? TM2 toggles more rapidly than TM1 |
344 | 340 | // 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 |
346 | 342 | } |
347 | 343 | |
348 | 344 | WRITE_LINE_MEMBER(hng64_state::tcu_tm2_cb) |
r245356 | r245357 | |
351 | 347 | // logerror("tcu_tm2_cb %02x\n", state); |
352 | 348 | |
353 | 349 | // 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; |
358 | 354 | } |
359 | 355 | |
360 | 356 | |
trunk/src/mame/drivers/hng64.c
r245356 | r245357 | |
922 | 922 | COMBINE_DATA(&m_videoregs[offset]); |
923 | 923 | } |
924 | 924 | |
| 925 | READ16_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 | |
| 940 | WRITE16_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 | |
925 | 962 | static ADDRESS_MAP_START( hng_map, AS_PROGRAM, 32, hng64_state ) |
926 | 963 | |
927 | 964 | AM_RANGE(0x00000000, 0x00ffffff) AM_RAM AM_SHARE("mainram") |
r245356 | r245357 | |
963 | 1000 | AM_RANGE(0x60200000, 0x603fffff) AM_READWRITE(hng64_soundram_r, hng64_soundram_w) // program + data for V53A gets uploaded here |
964 | 1001 | |
965 | 1002 | // 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) |
969 | 1004 | AM_RANGE(0x6f000000, 0x6f000003) AM_WRITE(hng64_soundcpu_enable_w) |
970 | 1005 | |
971 | 1006 | // Communications |