mirror of
https://github.com/holub/mame
synced 2025-07-03 17:08:39 +03:00
DRQ wasn't setted properly, now there are proper gd-rom command writes
This commit is contained in:
parent
5843797908
commit
0bb9376577
@ -11,12 +11,6 @@
|
|||||||
#include "gdrom.h"
|
#include "gdrom.h"
|
||||||
#include "debugger.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)
|
static void phys_frame_to_msf(int phys_frame, int *m, int *s, int *f)
|
||||||
{
|
{
|
||||||
*m = phys_frame / (60*75);
|
*m = phys_frame / (60*75);
|
||||||
@ -49,6 +43,15 @@ void gdrom_device::device_reset()
|
|||||||
{
|
{
|
||||||
scsihle_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;
|
is_file = TRUE;
|
||||||
cdrom = subdevice<cdrom_image_device>("image")->get_cdrom_file();
|
cdrom = subdevice<cdrom_image_device>("image")->get_cdrom_file();
|
||||||
if( !cdrom )
|
if( !cdrom )
|
||||||
@ -126,10 +129,12 @@ void gdrom_device::ExecCommand( int *transferLength )
|
|||||||
|
|
||||||
case 0x12: // INQUIRY
|
case 0x12: // INQUIRY
|
||||||
logerror("GDROM: REQUEST SENSE\n");
|
logerror("GDROM: REQUEST SENSE\n");
|
||||||
debugger_break(machine());
|
SetPhase( SCSI_PHASE_DATAOUT );
|
||||||
SetPhase( SCSI_PHASE_DATAIN );
|
//transferOffset = command[2];
|
||||||
transferOffset = command[2];
|
|
||||||
*transferLength = SCSILengthFromUINT8( &command[ 4 ] );
|
*transferLength = SCSILengthFromUINT8( &command[ 4 ] );
|
||||||
|
printf("SET_MODE %02x %02x\n",command[2],command[4]);
|
||||||
|
//for(int i=command[2];i<command[2]+command[4];i++)
|
||||||
|
// GDROM_Cmd11_Reply[i] = command[i];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x15: // MODE SELECT(6)
|
case 0x15: // MODE SELECT(6)
|
||||||
@ -273,7 +278,7 @@ void gdrom_device::ExecCommand( int *transferLength )
|
|||||||
|
|
||||||
SetPhase( SCSI_PHASE_DATAIN );
|
SetPhase( SCSI_PHASE_DATAIN );
|
||||||
*transferLength = length;
|
*transferLength = length;
|
||||||
debugger_break(machine());
|
//debugger_break(machine());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x45: // PLAY AUDIO(10)
|
case 0x45: // PLAY AUDIO(10)
|
||||||
|
@ -47,6 +47,7 @@ private:
|
|||||||
cdrom_file *cdrom;
|
cdrom_file *cdrom;
|
||||||
optional_device<cdda_device> m_cdda;
|
optional_device<cdda_device> m_cdda;
|
||||||
bool is_file;
|
bool is_file;
|
||||||
|
UINT8 GDROM_Cmd11_Reply[32];
|
||||||
};
|
};
|
||||||
|
|
||||||
// device type definition
|
// device type definition
|
||||||
|
@ -440,7 +440,9 @@ READ32_MEMBER(dc_cons_state::dc_mess_gdrom_r)
|
|||||||
|
|
||||||
if( atapi_xferlen == 0 )
|
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;
|
atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO;
|
||||||
gdrom_raise_irq();
|
gdrom_raise_irq();
|
||||||
}
|
}
|
||||||
@ -449,6 +451,7 @@ READ32_MEMBER(dc_cons_state::dc_mess_gdrom_r)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
data = 0;
|
data = 0;
|
||||||
|
printf("Read from empty SCSI queue\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
@ -504,7 +507,7 @@ WRITE32_MEMBER(dc_cons_state::dc_mess_gdrom_w )
|
|||||||
gdrom_raise_irq();
|
gdrom_raise_irq();
|
||||||
|
|
||||||
// not sure here, but clear DRQ at least?
|
// 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");
|
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);
|
//gdrom_set_status(ATAPI_STAT_SERVDSC,true);
|
||||||
/* Ok? */
|
/* 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_CMDSTATUS] = ATAPI_STAT_DRQ | ATAPI_STAT_SERVDSC | ATAPI_STAT_DRQ;
|
||||||
}
|
}
|
||||||
atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO;
|
atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO;
|
||||||
|
Loading…
Reference in New Issue
Block a user