src/mess/drivers/cdi.c
| r6115 | r6116 | |
| 45 | 45 | |
| 46 | 46 | #define ENABLE_UART_PRINTING (0) |
| 47 | 47 | |
| 48 | | #define VERBOSE_LEVEL (6) |
| 48 | #define VERBOSE_LEVEL (11) |
| 49 | 49 | |
| 50 | | #define ENABLE_VERBOSE_LOG (1) |
| 50 | #define ENABLE_VERBOSE_LOG (0) |
| 51 | 51 | |
| 52 | 52 | #if ENABLE_VERBOSE_LOG |
| 53 | 53 | INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt, ...) |
| r6115 | r6116 | |
| 1165 | 1165 | FILE* temp_adpcm = fopen("temp_adpcm.bin","ab"); |
| 1166 | 1166 | |
| 1167 | 1167 | fseek(temp_adpcm, 0, SEEK_END); |
| 1168 | | printf( "%02x\n", hdr[2] & 0x3f ); |
| 1168 | //printf( "%02x\n", hdr[2] & 0x3f ); |
| 1169 | 1169 | switch(hdr[2] & 0x3f) // ignore emphasis and reserved bits |
| 1170 | 1170 | { |
| 1171 | 1171 | case 0: |
| r6115 | r6116 | |
| 1225 | 1225 | switch(bits) |
| 1226 | 1226 | { |
| 1227 | 1227 | case 4: |
| 1228 | | cdic_decode_xa_mono(hdr, samples); |
| 1228 | cdic_decode_xa_mono(hdr + 4, samples); |
| 1229 | 1229 | for(index = 18*28*8 - 1; index >= 0; index--) |
| 1230 | 1230 | { |
| 1231 | 1231 | samples[index*2 + 1] = samples[index]; |
| r6115 | r6116 | |
| 1233 | 1233 | } |
| 1234 | 1234 | break; |
| 1235 | 1235 | case 8: |
| 1236 | | cdic_decode_xa_mono8(hdr, samples); |
| 1236 | cdic_decode_xa_mono8(hdr + 4, samples); |
| 1237 | 1237 | //fwrite(samples, 1, 18*28*4, temp_adpcm); |
| 1238 | 1238 | for(index = 18*28*8 - 1; index >= 0; index--) |
| 1239 | 1239 | { |
| r6115 | r6116 | |
| 1247 | 1247 | switch(bits) |
| 1248 | 1248 | { |
| 1249 | 1249 | case 4: |
| 1250 | | cdic_decode_xa_stereo(hdr, samples); |
| 1250 | cdic_decode_xa_stereo(hdr + 4, samples); |
| 1251 | 1251 | break; |
| 1252 | 1252 | case 8: |
| 1253 | 1253 | // Something is seriously wrong somewhere with this |
| 1254 | | cdic_decode_xa_stereo8(hdr, samples); |
| 1254 | cdic_decode_xa_stereo8(hdr + 4, samples); |
| 1255 | 1255 | for(index = 18*28*8 - 1; index >= 0; index--) |
| 1256 | 1256 | { |
| 1257 | 1257 | samples[index*2 + 1] = samples[index]; |
| r6115 | r6116 | |
| 1347 | 1347 | } |
| 1348 | 1348 | } |
| 1349 | 1349 | |
| 1350 | //printf( "%02x\n", buffer[CDIC_SECTOR_SUBMODE2] ); |
| 1350 | 1351 | if(((buffer[CDIC_SECTOR_SUBMODE2] & (CDIC_SUBMODE_FORM | CDIC_SUBMODE_DATA | CDIC_SUBMODE_AUDIO | CDIC_SUBMODE_VIDEO)) == (CDIC_SUBMODE_FORM | CDIC_SUBMODE_AUDIO)) && |
| 1351 | 1352 | (cdic_regs.channel & cdic_regs.audio_channel & (1 << buffer[CDIC_SECTOR_CHAN2]))) |
| 1352 | 1353 | { |
| r6115 | r6116 | |
| 1421 | 1422 | cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE); |
| 1422 | 1423 | } |
| 1423 | 1424 | |
| 1424 | | //if(!(buffer[CDIC_SECTOR_SUBMODE2] & CDIC_SUBMODE_EOF)) |
| 1425 | | //{ |
| 1425 | if(!(buffer[CDIC_SECTOR_SUBMODE2] & CDIC_SUBMODE_EOF)) |
| 1426 | { |
| 1426 | 1427 | timer_adjust_oneshot(cdic_regs.interrupt_timer, ATTOTIME_IN_HZ(75), 0); // 75Hz = 1x CD-ROM speed |
| 1427 | | //} |
| 1428 | | //else |
| 1429 | | //{ |
| 1430 | | //cdic_regs.command = 0; |
| 1431 | | //} |
| 1428 | } |
| 1429 | else |
| 1430 | { |
| 1431 | cdic_regs.command = 0; |
| 1432 | } |
| 1432 | 1433 | |
| 1433 | 1434 | break; |
| 1434 | 1435 | } |