From c9aa6dc3a9b353685537beea97b31affbf35fcd8 Mon Sep 17 00:00:00 2001 From: TomW Date: Sun, 7 Jul 2013 13:26:46 +0100 Subject: [PATCH] Removed obsolete INT 13 hard disk emulation. --- src/Makefile.mingw | 2 +- src/harddisk.c | 155 --------------------------------------------- src/pc.c | 1 - 3 files changed, 1 insertion(+), 157 deletions(-) delete mode 100644 src/harddisk.c diff --git a/src/Makefile.mingw b/src/Makefile.mingw index 8015b65..4e39d18 100644 --- a/src/Makefile.mingw +++ b/src/Makefile.mingw @@ -4,7 +4,7 @@ CC = gcc.exe WINDRES = windres.exe CFLAGS = -O3 -march=i686 -fomit-frame-pointer OBJ = 386.o 808x.o acer386sx.o ali1429.o amstrad.o cdrom-ioctl.o \ - config.o cpu.o dac.o device.o dma.o ega.o fdc.o harddisk.o \ + config.o cpu.o dac.o device.o dma.o ega.o fdc.o \ headland.o i430vx.o ide.o io.o jim.o keyboard.o keyboard_amstrad.o keyboard_at.o \ keyboard_olim24.o keyboard_xt.o lpt.o mcr.o mem.o model.o \ mouse.o mouse_ps2.o mouse_serial.o neat.o nvr.o olivetti_m24.o \ diff --git a/src/harddisk.c b/src/harddisk.c deleted file mode 100644 index cef4b0d..0000000 --- a/src/harddisk.c +++ /dev/null @@ -1,155 +0,0 @@ -/*Due to the lack of a real hard disc BIOS (other than the WD ST-506 one in MESS), - I wrote this. It's better as it can handle bigger discs, but is (potentially) - less compatible.*/ -#include -#include -#include "ibm.h" - -extern int output; -void inithdc() -{ - return; - hdc[0].f=romfopen("hdc.img","rb+"); - if (!hdc[0].f) - { - hdc[0].f=romfopen("hdc.img","wb"); - putc(0,hdc[0].f); - fclose(hdc[0].f); - hdc[0].f=romfopen("hdc.img","rb+"); - } -// hdc[0].spt=16; -// hdc[0].hpc=5; -// hdc[0].tracks=977; - - hdc[1].f=romfopen("hdd.img","rb+"); - if (!hdc[1].f) - { - hdc[1].f=romfopen("hdd.img","wb"); - putc(0,hdc[1].f); - fclose(hdc[1].f); - hdc[1].f=romfopen("hdd.img","rb+"); - } -// hdc[1].spt=32; -// hdc[1].hpc=16; -// hdc[1].tracks=447; -} - -void int13hdc() -{ - int drv=DL&1; - int track,head,sector; - uint32_t addr; - int c,d; - uint8_t buf[512]; - fullspeed(); -// ram[0x475]=2; -// printf("INT 13 HDC %04X %04X %04X %04X %04X:%04X\n",AX,BX,CX,DX,CS,pc); - switch (AH) - { - case 0: /*Reset disk system*/ - AH=0; - flags&=~C_FLAG; - break; - case 2: /*Read sectors into memory*/ -// printf("Read %i sectors to %04X:%04X\n",AL,es>>4,BX); -// if (es==0xf940) output=3; - track=CH|((CL&0xC0)<<2); - sector=(CL&63)-1; - head=DH; - addr=((((track*hdc[drv].hpc)+head)*hdc[drv].spt)+sector)*512; -// printf("Read track %i head %i sector %i addr %08X HPC %i SPT %i %08X\n",track,head,sector,addr,hdc[drv].hpc,hdc[drv].spt,old8); - fseek(hdc[drv].f,addr,SEEK_SET); - for (c=0;c>2)&0xC0); -// printf("Drive params - %02X %02X %i %i\n",CL,CH,hdc[drv].tracks,hdc[drv].spt); - DH=hdc[drv].hpc-1; - DL=2; - flags&=~C_FLAG; - break; - case 0x10: /*Check drive ready*/ - AH=0; - flags&=~C_FLAG; - break; - case 0x18: /*Set media type*/ - AH=1; - flags|=C_FLAG; - break; - - default: - AH=1; - flags|=C_FLAG; -// printf("Bad HDC int 13 %04X\n",AX); -// dumpregs(); -// exit(-1); - } -} - -char tempbuf[512*63]; -void resizedrive(int drv) -{ - FILE *f; - int c,d,e; -// char temp[512*63]; - if (!drv) - { - fflush(hdc[0].f); - if (hdc[0].f) fclose(hdc[0].f); - f=romfopen("hdc.img","wb"); - } - else - { - fflush(hdc[1].f); - if (hdc[1].f) fclose(hdc[1].f); - f=romfopen("hdd.img","wb"); - } - memset(tempbuf,0,512*63); - for (c=0;c