diff --git a/src/mame/machine/gdrom.c b/src/mame/machine/gdrom.c index 881a7d03a93..07535e9d7db 100644 --- a/src/mame/machine/gdrom.c +++ b/src/mame/machine/gdrom.c @@ -11,12 +11,6 @@ #include "gdrom.h" #include "debugger.h" -static const UINT8 GDROM_Cmd11_Reply[32] = -{ - 0x00, 0x00, 0x00, 0x00, 0x00, 0xB4, 0x19, 0x00, 0x00, 0x08, 0x53, 0x45, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x52, 0x65, 0x76, 0x20, 0x36, 0x2E, 0x34, 0x32, 0x39, 0x39, 0x30, 0x33, 0x31, 0x36 -}; - static void phys_frame_to_msf(int phys_frame, int *m, int *s, int *f) { *m = phys_frame / (60*75); @@ -49,6 +43,15 @@ void gdrom_device::device_reset() { scsihle_device::device_reset(); + static const UINT8 GDROM_Def_Cmd11_Reply[32] = + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0xB4, 0x19, 0x00, 0x00, 0x08, 0x53, 0x45, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x52, 0x65, 0x76, 0x20, 0x36, 0x2E, 0x34, 0x32, 0x39, 0x39, 0x30, 0x33, 0x31, 0x36 + }; + + for(int i = 0;i<32;i++) + GDROM_Cmd11_Reply[i] = GDROM_Def_Cmd11_Reply[i]; + is_file = TRUE; cdrom = subdevice("image")->get_cdrom_file(); if( !cdrom ) @@ -126,10 +129,12 @@ void gdrom_device::ExecCommand( int *transferLength ) case 0x12: // INQUIRY logerror("GDROM: REQUEST SENSE\n"); - debugger_break(machine()); - SetPhase( SCSI_PHASE_DATAIN ); - transferOffset = command[2]; + SetPhase( SCSI_PHASE_DATAOUT ); + //transferOffset = command[2]; *transferLength = SCSILengthFromUINT8( &command[ 4 ] ); + printf("SET_MODE %02x %02x\n",command[2],command[4]); + //for(int i=command[2];i m_cdda; bool is_file; + UINT8 GDROM_Cmd11_Reply[32]; }; // device type definition diff --git a/src/mess/machine/dccons.c b/src/mess/machine/dccons.c index 5bca7d4b763..4c15c24d528 100644 --- a/src/mess/machine/dccons.c +++ b/src/mess/machine/dccons.c @@ -440,7 +440,9 @@ READ32_MEMBER(dc_cons_state::dc_mess_gdrom_r) if( atapi_xferlen == 0 ) { - atapi_regs[ATAPI_REG_CMDSTATUS] = 0; + printf("Read from SCSI\n"); + //debugger_break(machine()); + gdrom_set_status(ATAPI_STAT_DRQ,false); atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO; gdrom_raise_irq(); } @@ -449,6 +451,7 @@ READ32_MEMBER(dc_cons_state::dc_mess_gdrom_r) else { data = 0; + printf("Read from empty SCSI queue\n"); } return data; @@ -504,7 +507,7 @@ WRITE32_MEMBER(dc_cons_state::dc_mess_gdrom_w ) gdrom_raise_irq(); // not sure here, but clear DRQ at least? - atapi_regs[ATAPI_REG_CMDSTATUS] = 0; + gdrom_set_status(ATAPI_STAT_DRQ,false); printf("cdata wait status\n"); } } @@ -560,7 +563,7 @@ WRITE32_MEMBER(dc_cons_state::dc_mess_gdrom_w ) { //gdrom_set_status(ATAPI_STAT_SERVDSC,true); /* Ok? */ - gdrom_set_status(ATAPI_STAT_DRQ,false); + gdrom_set_status(ATAPI_STAT_DRQ,true); //atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRQ | ATAPI_STAT_SERVDSC | ATAPI_STAT_DRQ; } atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO;