SVGA video RAM is no longer dumped on fatal; READ MULTIPLE command with block size 0 no longer fatals but instead aborts with Abort Command error per the official ATA reference.

This commit is contained in:
OBattler
2016-08-02 02:36:07 +02:00
parent 4ecfcf4018
commit f77c53510e
3 changed files with 16 additions and 15 deletions

View File

@@ -518,7 +518,6 @@ chdir(pcempath);
/* f=fopen("rram3.dmp","wb");
for (c=0;c<0x8000000;c++) putc(readmemb(c+0x10000000),f);
fclose(f);*/
svga_dump_vram();
f=fopen("ram.dmp","wb");
fwrite(ram,mem_size*1024,1,f);
fclose(f);

View File

@@ -1084,8 +1084,14 @@ void writeide(int ide_board, uint16_t addr, uint8_t val)
return;
case WIN_READ_MULTIPLE:
if (!ide->blocksize && (ide->type != IDE_CDROM))
fatal("READ_MULTIPLE - blocksize = 0\n");
/* Fatal removed in accordance with the official ATAPI reference:
If the Read Multiple command is attempted before the Set Multiple Mode
command has been executed or when Read Multiple commands are
disabled, the Read Multiple operation is rejected with an Aborted Com-
mand error. */
/* if (!ide->blocksize && (ide->type != IDE_CDROM))
fatal("READ_MULTIPLE - blocksize = 0\n"); */
#if 0
if (ide->lba) pclog("Read Multiple %i sectors from LBA addr %07X\n",ide->secount,ide->lba_addr);
else pclog("Read Multiple %i sectors from sector %i cylinder %i head %i %i\n",ide->secount,ide->sector,ide->cylinder,ide->head,ins);
@@ -1544,9 +1550,16 @@ void callbackide(int ide_board)
return;
case WIN_READ_MULTIPLE:
if (IDE_DRIVE_IS_CDROM(ide)) {
/* According to the official ATAPI reference:
If the Read Multiple command is attempted before the Set Multiple Mode
command has been executed or when Read Multiple commands are
disabled, the Read Multiple operation is rejected with an Aborted Com-
mand error. */
if (IDE_DRIVE_IS_CDROM(ide) || !ide->blocksize) {
goto abort_cmd;
}
addr = ide_get_sector(ide) * 512;
// pclog("Read multiple from %08X %i (%i) %i\n", addr, ide->blockcount, ide->blocksize, ide->secount);
fseeko64(ide->hdfile, addr, SEEK_SET);

View File

@@ -1631,15 +1631,4 @@ void svga_add_status_info(char *s, int max_len, void *p)
sprintf(temps, "SVGA DAC in %i-bit mode\n", (svga->attrregs[0x10] & 0x80) ? 8 : 6);
strncat(s, temps, max_len);
}
void svga_dump_vram()
{
FILE *f;
f = fopen("svga_ram.dmp", "wb");
fwrite(svga_pointer->vram, svga_pointer->vrammask + 1, 1, f);
fclose(f);
f = fopen("svga_pal.dmp", "wb");
fwrite(svga_pointer->pallook, 256, 1, f);
fclose(f);
}