static void ExecCmdFormatTrack() { /* NOTE: simplified procedure; dma not used */ t_nubit8 fillbyte; /* load parameters*/ vfdd.head = GetHDS(vfdc.cmd[1]); vfdd.sector = 0x01; vfdd.nbyte = GetBPS(vfdc.cmd[2]); vfdd.nsector = vfdc.cmd[3]; vfdd.gaplen = vfdc.cmd[4]; fillbyte = vfdc.cmd[5]; vfddSetPointer; /* execute format track*/ vfddFormatTrack(fillbyte); /* finish transaction */ SetST0; SetST1; SetST2; vfdc.ret[0] = vfdc.st0; vfdc.ret[1] = vfdc.st1; vfdc.ret[2] = vfdc.st2; vfdc.ret[3] = 0x00; vfdc.ret[4] = 0x00; vfdc.ret[5] = 0x00; vfdc.ret[6] = 0x00; if (GetENRQ(vfdc.dor)) { vpicSetIRQ(0x06); vfdc.flagintr = 1; } SetMSRReadyRead; }
static void ExecCmdFormatTrack() { /* NOTE: simplified procedure; dma not used */ t_nubit8 fillByte; /* load parameters*/ vfdd.data.head = GetBit(vfdc.data.cmd[1], VFDC_CMD_FormatTrack1_HD); vfdd.data.sector = 0x01; vfdd.data.nbyte = VFDC_GetBPS(vfdc.data.cmd[2]); vfdd.data.nsector = vfdc.data.cmd[3]; vfdd.data.gpl = vfdc.data.cmd[4]; fillByte = vfdc.data.cmd[5]; vfddSetPointer; /* execute format track*/ vfddFormatTrack(fillByte); /* finish transaction */ SetST0; SetST1; SetST2; vfdc.data.ret[0] = vfdc.data.st0; vfdc.data.ret[1] = vfdc.data.st1; vfdc.data.ret[2] = vfdc.data.st2; vfdc.data.ret[3] = Zero8; vfdc.data.ret[4] = Zero8; vfdc.data.ret[5] = Zero8; vfdc.data.ret[6] = Zero8; if (GetBit(vfdc.data.dor, VFDC_DOR_ENRQ)) { vpicSetIRQ(0x06); vfdc.data.flagINTR = True; } SetMSRReadyRead; }
static void ExecCmdSeek() { vfdd.data.head = GetBit(vfdc.data.cmd[1], VFDC_CMD_Seek1_HD); vfdd.data.cyl = vfdc.data.cmd[2]; vfdd.data.sector = 1; vfddSetPointer; SetST0; SetBit(vfdc.data.st0, VFDC_ST0_SEEK_END); if (GetBit(vfdc.data.dor, VFDC_DOR_ENRQ)) { vpicSetIRQ(0x06); vfdc.data.flagINTR = True; } SetMSRReadyWrite; }
static void ExecCmdRecalibrate() { vfdd.data.cyl = 0; vfdd.data.head = 0; vfdd.data.sector = 1; vfddSetPointer; SetST0; SetBit(vfdc.data.st0, VFDC_ST0_SEEK_END); if (GetBit(vfdc.data.dor, VFDC_DOR_ENRQ)) { vpicSetIRQ(0x06); vfdc.data.flagINTR = True; } SetMSRReadyWrite; }
static void ExecCmdSeek() { vfdd.head = GetHDS(vfdc.cmd[1]); vfdd.cyl = vfdc.cmd[2]; vfdd.sector = 0x01; vfddSetPointer; SetST0; vfdc.st0 |= 0x20; if (GetENRQ(vfdc.dor)) { vpicSetIRQ(0x06); vfdc.flagintr = 1; } SetMSRReadyWrite; }
static void ExecCmdRecalibrate() { vfdd.cyl = 0x00; vfdd.head = 0x00; vfdd.sector = 0x01; vfddSetPointer; SetST0; vfdc.st0 |= 0x20; if (GetENRQ(vfdc.dor)) { vpicSetIRQ(0x06); vfdc.flagintr = 1; } SetMSRReadyWrite; }
void vfdcTransFinal() { /* NOTE: being called by DMA/PIO */ SetST0; SetST1; SetST2; vfdc.ret[0] = vfdc.st0; vfdc.ret[1] = vfdc.st1; vfdc.ret[2] = vfdc.st2; vfdc.ret[3] = (t_nubit8)vfdd.cyl; vfdc.ret[4] = (t_nubit8)vfdd.head; vfdc.ret[5] = (t_nubit8)vfdd.sector; vfdc.ret[6] = GetBPSC(vfdd.nbyte); if (GetENRQ(vfdc.dor)) { vpicSetIRQ(0x06); vfdc.flagintr = 1; } SetMSRReadyRead; }
static void transFinal() { /* NOTE: being called by DMA/PIO */ SetST0; SetST1; SetST2; vfdc.data.ret[0] = vfdc.data.st0; vfdc.data.ret[1] = vfdc.data.st1; vfdc.data.ret[2] = vfdc.data.st2; vfdc.data.ret[3] = GetMax8(vfdd.data.cyl); vfdc.data.ret[4] = GetMax8(vfdd.data.head); vfdc.data.ret[5] = GetMax8(vfdd.data.sector); vfdc.data.ret[6] = VFDC_GetBPSC(vfdd.data.nbyte); if (GetBit(vfdc.data.dor, VFDC_DOR_ENRQ)) { vpicSetIRQ(0x06); vfdc.data.flagINTR = True; } SetMSRReadyRead; }
void vpitIntSystemTimer() {vpicSetIRQ(0x00);}