Previous 15994 Revisions Next

r6116 Saturday 17th October, 2009 at 20:52:33 UTC by Harmony
[CDI] Corrected decoding offsets; streaming CD-i audio is now almost perfect, minus some very slight static in the right channel.
[src/mess/drivers]cdi.c

src/mess/drivers/cdi.c
r6115r6116
4545
4646#define ENABLE_UART_PRINTING (0)
4747
48#define VERBOSE_LEVEL   (6)
48#define VERBOSE_LEVEL   (11)
4949
50#define ENABLE_VERBOSE_LOG (1)
50#define ENABLE_VERBOSE_LOG (0)
5151
5252#if ENABLE_VERBOSE_LOG
5353INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt, ...)
r6115r6116
11651165   FILE* temp_adpcm = fopen("temp_adpcm.bin","ab");
11661166
11671167   fseek(temp_adpcm, 0, SEEK_END);
1168   printf( "%02x\n", hdr[2] & 0x3f );
1168   //printf( "%02x\n", hdr[2] & 0x3f );
11691169   switch(hdr[2] & 0x3f)   // ignore emphasis and reserved bits
11701170   {
11711171      case 0:
r6115r6116
12251225         switch(bits)
12261226         {
12271227            case 4:
1228               cdic_decode_xa_mono(hdr, samples);
1228               cdic_decode_xa_mono(hdr + 4, samples);
12291229               for(index = 18*28*8 - 1; index >= 0; index--)
12301230               {
12311231                  samples[index*2 + 1] = samples[index];
r6115r6116
12331233               }
12341234               break;
12351235            case 8:
1236               cdic_decode_xa_mono8(hdr, samples);
1236               cdic_decode_xa_mono8(hdr + 4, samples);
12371237               //fwrite(samples, 1, 18*28*4, temp_adpcm);
12381238               for(index = 18*28*8 - 1; index >= 0; index--)
12391239               {
r6115r6116
12471247         switch(bits)
12481248         {
12491249            case 4:
1250               cdic_decode_xa_stereo(hdr, samples);
1250               cdic_decode_xa_stereo(hdr + 4, samples);
12511251               break;
12521252            case 8:
12531253               // Something is seriously wrong somewhere with this
1254               cdic_decode_xa_stereo8(hdr, samples);
1254               cdic_decode_xa_stereo8(hdr + 4, samples);
12551255               for(index = 18*28*8 - 1; index >= 0; index--)
12561256               {
12571257                  samples[index*2 + 1] = samples[index];
r6115r6116
13471347            }
13481348         }
13491349
1350         //printf( "%02x\n", buffer[CDIC_SECTOR_SUBMODE2] );
13501351         if(((buffer[CDIC_SECTOR_SUBMODE2] & (CDIC_SUBMODE_FORM | CDIC_SUBMODE_DATA | CDIC_SUBMODE_AUDIO | CDIC_SUBMODE_VIDEO)) == (CDIC_SUBMODE_FORM | CDIC_SUBMODE_AUDIO)) &&
13511352            (cdic_regs.channel & cdic_regs.audio_channel & (1 << buffer[CDIC_SECTOR_CHAN2])))
13521353         {
r6115r6116
14211422            cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
14221423         }
14231424
1424         //if(!(buffer[CDIC_SECTOR_SUBMODE2] & CDIC_SUBMODE_EOF))
1425         //{
1425         if(!(buffer[CDIC_SECTOR_SUBMODE2] & CDIC_SUBMODE_EOF))
1426         {
14261427            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         }
14321433
14331434         break;
14341435      }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team