src/mess/drivers/cdi.c
| r6141 | r6142 | |
| 45 | 45 | |
| 46 | 46 | #define ENABLE_UART_PRINTING (0) |
| 47 | 47 | |
| 48 | | #define VERBOSE_LEVEL (5) |
| 48 | #define VERBOSE_LEVEL (11) |
| 49 | 49 | |
| 50 | 50 | #define ENABLE_VERBOSE_LOG (0) |
| 51 | 51 | |
| r6141 | r6142 | |
| 1353 | 1353 | cdic_regs.audio_buffer |= 0x8000; |
| 1354 | 1354 | } |
| 1355 | 1355 | |
| 1356 | | // Set the CDIC interrupt line |
| 1357 | | verboselog(machine, 0, "Setting CDIC interrupt line for soundmap decode\n" ); |
| 1358 | | cpu_set_input_line_vector(cputag_get_cpu(machine, "maincpu"), M68K_IRQ_4, 128); |
| 1359 | | cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE); |
| 1360 | | |
| 1361 | 1356 | if(CDIC_IS_VALID_SAMPLE_BUF(cdic_regs.z_buffer & 0x3ffe)) |
| 1362 | 1357 | { |
| 1363 | 1358 | attotime period; |
| 1364 | 1359 | |
| 1365 | 1360 | verboselog(machine, 0, "Hit audio_sample_trigger, with cdic_regs.z_buffer == %04x, calling cdic_decode_audio_sector\n", cdic_regs.z_buffer ); |
| 1366 | 1361 | |
| 1362 | // Set the CDIC interrupt line |
| 1363 | verboselog(machine, 0, "Setting CDIC interrupt line for soundmap decode\n" ); |
| 1364 | cpu_set_input_line_vector(cputag_get_cpu(machine, "maincpu"), M68K_IRQ_4, 128); |
| 1365 | cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE); |
| 1366 | |
| 1367 | 1367 | // Decode the data at Z+4, the same offset as a normal CD sector. |
| 1368 | 1368 | cdic_decode_audio_sector(machine, ((UINT8*)cdram) + (cdic_regs.z_buffer & 0x3ffe) + 4, 1); |
| 1369 | 1369 | |
| r6141 | r6142 | |
| 1385 | 1385 | } |
| 1386 | 1386 | else |
| 1387 | 1387 | { |
| 1388 | // Swap buffer positions to indicate our new buffer position at the next read |
| 1388 | 1389 | cdic_regs.z_buffer &= 0xfffe; |
| 1390 | cdic_regs.z_buffer += 0xa00; |
| 1391 | if(cdic_regs.z_buffer == 0x3c00) |
| 1392 | { |
| 1393 | cdic_regs.z_buffer = 0x2800; |
| 1394 | } |
| 1395 | |
| 1396 | cdic_regs.z_buffer &= 0xfffe; |
| 1389 | 1397 | verboselog(machine, 0, "Data is not valid, stopping playback\n" ); |
| 1390 | 1398 | timer_adjust_oneshot(cdic_regs.audio_sample_timer, attotime_never, 0); |
| 1391 | 1399 | } |
| r6141 | r6142 | |
| 1647 | 1655 | //printf("Clearing CDIC interrupt line\n" ); |
| 1648 | 1656 | } |
| 1649 | 1657 | cdic_regs.data_buffer &= ~0x4000; |
| 1658 | if(cdic_regs.data_buffer & 0x8000) |
| 1659 | { |
| 1660 | if(cdic_regs.command == 0x2c) |
| 1661 | { |
| 1662 | cdic_regs.data_buffer &= ~0x8000; |
| 1663 | } |
| 1664 | } |
| 1650 | 1665 | return temp; |
| 1651 | 1666 | } |
| 1652 | 1667 | default: |
| r6141 | r6142 | |
| 1776 | 1791 | break; |
| 1777 | 1792 | case 0x2c: // Seek |
| 1778 | 1793 | cdic_regs.data_buffer &= 0x7fff; |
| 1779 | | //cdic_regs.x_buffer |= 0x8000; |
| 1780 | 1794 | break; |
| 1781 | 1795 | default: |
| 1782 | 1796 | verboselog(space->machine, 0, "Unknown CDIC command: %02x\n", cdic_regs.command ); |
| r6141 | r6142 | |
| 2954 | 2968 | { |
| 2955 | 2969 | int x = 0; |
| 2956 | 2970 | |
| 2957 | | static int latched_rf0 = 1; |
| 2958 | | static int latched_rf1 = 1; |
| 2971 | static int latched_rf0 = 0; |
| 2972 | static int latched_rf1 = 0; |
| 2959 | 2973 | static int latched_wfa = 0; |
| 2960 | 2974 | static int latched_wfb = 0; |
| 2961 | 2975 | latched_wfa = mcd212.channel[0].weight_factor_a[0]; |
| r6141 | r6142 | |
| 3514 | 3528 | plane_enable_a = mcd212.region_flag_1[x]; |
| 3515 | 3529 | break; |
| 3516 | 3530 | case 5: |
| 3517 | | plane_enable_a = (plane_a_r_cur != transparent_color_a_r || plane_a_g_cur != transparent_color_a_g || plane_a_b_cur != transparent_color_a_b || mcd212.region_flag_0[x] == 0); |
| 3531 | plane_enable_a = (plane_a_r_cur != transparent_color_a_r || plane_a_g_cur != transparent_color_a_g || plane_a_b_cur != transparent_color_a_b || mcd212.region_flag_0[x] == 1); |
| 3518 | 3532 | break; |
| 3519 | 3533 | case 6: |
| 3520 | | plane_enable_a = (plane_a_r_cur != transparent_color_a_r || plane_a_g_cur != transparent_color_a_g || plane_a_b_cur != transparent_color_a_b || mcd212.region_flag_1[x] == 1); |
| 3534 | plane_enable_a = (plane_a_r_cur != transparent_color_a_r || plane_a_g_cur != transparent_color_a_g || plane_a_b_cur != transparent_color_a_b || mcd212.region_flag_1[x] == 0); |
| 3521 | 3535 | break; |
| 3522 | 3536 | case 8: |
| 3523 | 3537 | plane_enable_a = 1; |