Previous 15994 Revisions Next

r3846 Tuesday 16th December, 2008 at 16:33:17 UTC by Wilbert Pol
Removed deprecat.h from machine/matsucd.
[src/mess/machine]amigacd.c matsucd.c matsucd.h

src/mess/machine/matsucd.c
r3845r3846
1313
1414
1515#include "driver.h"
16#include "deprecat.h"
1716#include "devices/chd_cd.h"
1817#include "sound/cdda.h"
1918#include "machine/matsucd.h"
r3845r3846
263262   update_status_changed( 1 );
264263}
265264
266static void matsucd_set_status( UINT8 status )
265static void matsucd_set_status( running_machine *machine, UINT8 status )
267266{
268267   if ( status != cd.status )
269268   {
r3845r3846
272271      if ( cd.stch_signal != 0 )
273272      {
274273         update_status_changed( 0 );
275         timer_set(Machine,  ATTOTIME_IN_MSEC(1), NULL, 0, matsucd_set_status_end );
274         timer_set(machine,  ATTOTIME_IN_MSEC(1), NULL, 0, matsucd_set_status_end );
276275      }
277276   }
278277}
r3845r3846
305304         newstatus &= ~MATSU_STATUS_PLAYING;
306305      }
307306
308      matsucd_set_status( newstatus );
307      matsucd_set_status( machine, newstatus );
309308   }
310309}
311310
312static void matsucd_command_error( void )
311static void matsucd_command_error( running_machine *machine )
313312{
314313   UINT8   newstatus = cd.status;
315314
316315   newstatus &= ~MATSU_STATUS_SUCCESS;
317316   newstatus |= MATSU_STATUS_ERROR;
318317
319   matsucd_set_status( newstatus );
318   matsucd_set_status( machine, newstatus );
320319}
321320
322static void matsucd_complete_cmd( UINT8 len )
321static void matsucd_complete_cmd( running_machine *machine, UINT8 len )
323322{
324323   UINT8   newstatus = cd.status;
325324
r3845r3846
330329   newstatus &= ~MATSU_STATUS_ERROR;
331330   newstatus |= MATSU_STATUS_SUCCESS;
332331
333   matsucd_set_status( newstatus );
332   matsucd_set_status( machine, newstatus );
334333
335334   update_status_enable( 1 );
336335   update_status_enable( 0 );
r3845r3846
349348   return v;
350349}
351350
352void matsucd_command_w( UINT8 data )
351void matsucd_command_w( running_machine *machine, UINT8 data )
353352{
354353   UINT8   cmd;
355354
r3845r3846
386385         cd.motor = 1;
387386
388387         memset( cd.output, 0, 6 );
389         matsucd_complete_cmd( 0 );
388         matsucd_complete_cmd( machine, 0 );
390389      }
391390      break;
392391
r3845r3846
417416         if (!cdrom_read_data(cd.cdrom, cd.lba, cd.sector_buffer, matsucd_getsector_type()))
418417         {
419418            logerror( "MATSUCD - Warning: Read error on CD!\n" );
420            matsucd_command_error();
419            matsucd_command_error( machine );
421420            return;
422421         }
423422
424423         cd.motor = 1;
425424
426425         memset( cd.output, 0, 6 );
427         matsucd_complete_cmd( 0 );
426         matsucd_complete_cmd( machine, 0 );
428427      }
429428      break;
430429
r3845r3846
436435         cd.motor = 1;
437436
438437         memset( cd.output, 0, 6 );
439         matsucd_complete_cmd( 0 );
438         matsucd_complete_cmd( machine, 0 );
440439      }
441440      break;
442441
r3845r3846
451450         cd.motor = 0;
452451
453452         memset( cd.output, 0, 6 );
454         matsucd_complete_cmd( 0 );
453         matsucd_complete_cmd( machine, 0 );
455454      }
456455      break;
457456
r3845r3846
479478         cd.motor = 1;
480479
481480         memset( cd.output, 0, 6 );
482         matsucd_complete_cmd( 0 );
481         matsucd_complete_cmd( machine, 0 );
483482      }
484483      break;
485484
r3845r3846
522521         }
523522
524523         memset( cd.output, 0, 6 );
525         matsucd_complete_cmd( 0 );
524         matsucd_complete_cmd( machine, 0 );
526525      }
527526      break;
528527
r3845r3846
560559         }
561560
562561         memset( cd.output, 0, 6 );
563         matsucd_complete_cmd( 0 );
562         matsucd_complete_cmd( machine, 0 );
564563      }
565564      break;
566565
r3845r3846
581580
582581         cd.output[0] = newstatus;
583582
584         matsucd_set_status( newstatus );
583         matsucd_set_status( machine, newstatus );
585584
586         matsucd_complete_cmd( 1 );
585         matsucd_complete_cmd( machine, 1 );
587586      }
588587      break;
589588
r3845r3846
593592            return;
594593
595594         memset( cd.output, 0, 6 );
596         matsucd_complete_cmd( 6 );
595         matsucd_complete_cmd( machine, 6 );
597596      }
598597      break;
599598
r3845r3846
607606         cd.sector_size |= cd.input[3];
608607
609608         memset( cd.output, 0, 6 );
610         matsucd_complete_cmd( 0 );
609         matsucd_complete_cmd( machine, 0 );
611610      }
612611      break;
613612
r3845r3846
657656            cd.output[12] = 0;
658657         }
659658
660         matsucd_complete_cmd( 13 );
659         matsucd_complete_cmd( machine, 13 );
661660      }
662661      break;
663662
r3845r3846
679678         cd.output[3] = (end >> 8) & 0xff;
680679         cd.output[4] = (end) & 0xff;
681680
682         matsucd_complete_cmd( 5 );
681         matsucd_complete_cmd( machine, 5 );
683682      }
684683      break;
685684
r3845r3846
701700         if ( cd.cdrom == NULL )
702701         {
703702            logerror( "MATSUCD - Warning: Reading TOC without a CD!\n" );
704            matsucd_command_error();
703            matsucd_command_error( machine );
705704            return;
706705         }
707706
708707         if ( track > cdrom_get_last_track(cd.cdrom) )
709708         {
710709            logerror( "MATSUCD - Warning: Reading invalid track entry from TOC!\n" );
711            matsucd_command_error();
710            matsucd_command_error( machine );
712711            return;
713712         }
714713
r3845r3846
727726
728727         cd.motor = 1;
729728
730         matsucd_complete_cmd( 8 );
729         matsucd_complete_cmd( machine, 8 );
731730      }
732731      break;
733732
r3845r3846
738737
739738         matsucd_cdda_pause( (cd.input[1] == 0) ? 1 : 0 );
740739         memset( cd.output, 0, 7 );
741         matsucd_complete_cmd( 0 );
740         matsucd_complete_cmd( machine, 0 );
742741      }
743742      break;
744743
r3845r3846
750749         /* TODO: ??? */
751750
752751         memset( cd.output, 0, 7 );
753         matsucd_complete_cmd( 0 );
752         matsucd_complete_cmd( machine, 0 );
754753      }
755754      break;
756755
src/mess/machine/matsucd.h
r3845r3846
2525extern int matsucd_get_next_byte( UINT8 *data );
2626
2727/* main command interface */
28extern void matsucd_command_w( UINT8 data );
28extern void matsucd_command_w( running_machine *machine, UINT8 data );
2929extern UINT8 matsucd_response_r( void );
src/mess/machine/amigacd.c
r3845r3846
319319      case 0x50:
320320      {
321321         LOG(( "DMAC: PC=%08x - CDROM CMD Write - data = %04x\n", cpu_get_pc(space->cpu), data ));
322         matsucd_command_w( data );
322         matsucd_command_w( space->machine, data );
323323      }
324324      break;
325325

Previous 15994 Revisions Next


© 1998-2018 The MESS Team