isa_hdc: implement WRITESBUFF command

This commit is contained in:
Sergey Svishchev 2014-10-26 22:06:33 +03:00
parent e8df241b7b
commit f6e07e235a
2 changed files with 57 additions and 2 deletions

View File

@ -426,6 +426,26 @@ void isa8_hdc_device::pc_hdc_dack_w(int data)
void isa8_hdc_device::pc_hdc_dack_ws(int data)
{
*(hdcdma_dst++) = data;
if( --hdcdma_write == 0 )
{
hdcdma_write = 512;
hdcdma_size -= 512;
hdcdma_dst = hdcdma_data;
}
if (!no_dma())
{
m_isa->drq3_w(hdcdma_size ? 1 : 0);
if(!hdcdma_size) pc_hdc_result(1);
}
}
void isa8_hdc_device::execute_read()
{
hard_disk_file *disk = NULL;
@ -485,6 +505,28 @@ void isa8_hdc_device::execute_write()
void isa8_hdc_device::execute_writesbuff()
{
hdcdma_dst = hdcdma_data;
hdcdma_write = 512;
hdcdma_size = 512;
if (no_dma())
{
do
{
pc_hdc_dack_ws(buffer[data_cnt++]);
}
while (hdcdma_write || hdcdma_size);
}
else
{
m_isa->drq3_w(1);
}
}
void isa8_hdc_device::get_drive()
{
drv = (buffer[1] >> 5) & 1;
@ -595,6 +637,15 @@ void isa8_hdc_device::hdc_command()
execute_write();
break;
case CMD_WRITESBUFF:
if (LOG_HDC_STATUS)
{
logerror("%s hdc write sector buffer\n", machine().describe_context());
}
execute_writesbuff();
break;
case CMD_SETPARAM:
get_chsn();
cylinders[drv] = ((buffer[6]&3)<<8) | buffer[7];
@ -609,7 +660,6 @@ void isa8_hdc_device::hdc_command()
break;
case CMD_READSBUFF:
case CMD_WRITESBUFF:
case CMD_RAMDIAG:
case CMD_INTERNDIAG:
break;
@ -852,5 +902,8 @@ UINT8 isa8_hdc_device::dack_r(int line)
void isa8_hdc_device::dack_w(int line,UINT8 data)
{
pc_hdc_dack_w(data);
if (buffer[0] == CMD_WRITESBUFF)
pc_hdc_dack_ws(data);
else
pc_hdc_dack_w(data);
}

View File

@ -82,8 +82,10 @@ protected:
int get_lbasector();
int pc_hdc_dack_r();
void pc_hdc_dack_w(int data);
void pc_hdc_dack_ws(int data);
void execute_read();
void execute_write();
void execute_writesbuff();
void get_drive();
void get_chsn();
int test_ready();