Previous 15994 Revisions Next

r9169 Saturday 18th September, 2010 at 09:12:32 UTC by Angelo Salese
[PCE]: Fixed a bug with Audio CDs and fixed track displaying when it's bigger than 10
[src/mess/machine]pce.c

src/mess/machine/pce.c
r9168r9169
646646   pce_cd.current_frame = frame;
647647
648648   printf("Set Start %02x\n",pce_cd.command_buffer[1] & 0x03);
649   if(pce_cd.command_buffer[1] & 0x03)
649
650   if ( pce_cd.cdda_status == PCE_CD_CDDA_PAUSED )
650651   {
651      pce_cd.cdda_status = PCE_CD_CDDA_PLAYING;
652      pce_cd.end_frame = pce_cd.last_frame; //get the end of the CD
653      cdda_start_audio( machine->device( "cdda" ), pce_cd.current_frame, pce_cd.end_frame - pce_cd.current_frame );
654      pce_cd.cdda_play_mode = (pce_cd.command_buffer[1] & 0x02) ? 2 : 3; // mode 2 sets IRQ at end
655      pce_cd.end_mark =  (pce_cd.command_buffer[1] & 0x02) ? 1 : 0;
652      pce_cd.cdda_status = PCE_CD_CDDA_OFF;
653      cdda_stop_audio( machine->device( "cdda" ) );
654      pce_cd.end_frame = pce_cd.last_frame;
655      pce_cd.end_mark = 0;
656656   }
657657   else
658658   {
659      pce_cd.cdda_status = PCE_CD_CDDA_PLAYING;
660      pce_cd.end_frame = pce_cd.toc->tracks[ cdrom_get_track(pce_cd.cd, pce_cd.current_frame) + 1 ].physframeofs; //get the end of THIS track
661      cdda_start_audio( machine->device( "cdda" ), pce_cd.current_frame, pce_cd.end_frame - pce_cd.current_frame );
662      pce_cd.end_mark = 0;
663      pce_cd.cdda_play_mode = 3;
659      if(pce_cd.command_buffer[1] & 0x03)
660      {
661         pce_cd.cdda_status = PCE_CD_CDDA_PLAYING;
662         pce_cd.end_frame = pce_cd.last_frame; //get the end of the CD
663         cdda_start_audio( machine->device( "cdda" ), pce_cd.current_frame, pce_cd.end_frame - pce_cd.current_frame );
664         pce_cd.cdda_play_mode = (pce_cd.command_buffer[1] & 0x02) ? 2 : 3; // mode 2 sets IRQ at end
665         pce_cd.end_mark =  (pce_cd.command_buffer[1] & 0x02) ? 1 : 0;
666      }
667      else
668      {
669         pce_cd.cdda_status = PCE_CD_CDDA_PLAYING;
670         pce_cd.end_frame = pce_cd.toc->tracks[ cdrom_get_track(pce_cd.cd, pce_cd.current_frame) + 1 ].physframeofs; //get the end of THIS track
671         cdda_start_audio( machine->device( "cdda" ), pce_cd.current_frame, pce_cd.end_frame - pce_cd.current_frame );
672         pce_cd.end_mark = 0;
673         pce_cd.cdda_play_mode = 3;
674      }
664675   }
665676
666677   pce_cd_reply_status_byte( SCSI_STATUS_OK );
r9168r9169
798809   msf_rel = lba_to_msf( frame - cdrom_get_track_start( pce_cd.cd, track ) );
799810
800811   pce_cd.data_buffer[1] = 0;
801   pce_cd.data_buffer[2] = track+1;               /* track */
812   pce_cd.data_buffer[2] = dec_2_bcd( track+1 );      /* track */
802813   pce_cd.data_buffer[3] = 1;                     /* index */
803814   pce_cd.data_buffer[4] = ( msf_rel >> 16 ) & 0xFF;   /* M (relative) */
804815   pce_cd.data_buffer[5] = ( msf_rel >> 8 ) & 0xFF;   /* S (relative) */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team