From f77c53510eb030e18760d1a6e32ee13e8e40cf3c Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 2 Aug 2016 02:36:07 +0200 Subject: [PATCH] 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. --- src/808x.c | 1 - src/ide.c | 19 ++++++++++++++++--- src/vid_svga.c | 11 ----------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/808x.c b/src/808x.c index 95e1f86bb..4034e90dd 100644 --- a/src/808x.c +++ b/src/808x.c @@ -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); diff --git a/src/ide.c b/src/ide.c index f4cbb2d47..fcbd9360a 100644 --- a/src/ide.c +++ b/src/ide.c @@ -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); diff --git a/src/vid_svga.c b/src/vid_svga.c index c650b2de0..a487405f4 100644 --- a/src/vid_svga.c +++ b/src/vid_svga.c @@ -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); } \ No newline at end of file