|
rgwan
初级用户
 
积分 22
发帖 8
注册 2018-3-19
状态 离线
|
|
2018-3-20 00:22 |
|
|
LoggerVick
中级用户
  
积分 365
发帖 212
注册 2018-1-27
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
不过可能你的附件会很少有人下载,我先顶一下。
But maybe few people will download your attachment. I'll give it a bump first.
|

很少上线的游客前来。 |
|
2018-3-20 00:31 |
|
|
LoggerVick
中级用户
  
积分 365
发帖 212
注册 2018-1-27
状态 离线
|
|
2018-3-20 00:36 |
|
|
rgwan
初级用户
 
积分 22
发帖 8
注册 2018-3-19
状态 离线
|
|
2018-3-20 08:46 |
|
|
crshen
中级用户
  
积分 447
发帖 126
注册 2004-2-10
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
程序不错,英文语句稍有点不统一,前面是decompress,后面是Decode,两者有点区别的。
另外提个小建议,这种DOS程序最好使用TC或者BC,DOS文本格式,GCC对很多初入门者有点复杂。C99标准比较晚,而程序中只用了stdint.h中的数据类型,如果改成老标准C89更方便大家学习。
The program is good, but the English sentences are a bit inconsistent. Earlier it's decompress, later it's Decode, there's a bit of a difference between the two. Also, I have a small suggestion. For such DOS programs, it's best to use TC or BC, in DOS text format. GCC is a bit complicated for many beginners. The C99 standard is relatively late, and the program only uses the data types in stdint.h. If it's changed to the older standard C89, it's more convenient for everyone to learn.
|

从来不用别人的东西,要用,也先改成自己的再说! |
|
2018-3-20 12:19 |
|
|
crshen
中级用户
  
积分 447
发帖 126
注册 2004-2-10
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
刚转换到TC2.0,编译后DOS下测试发现严重问题,看来对hd-copy的img格式分析还不全面。确认为hd-copy 2.0a的img居然解压不出,只写出个32k的头。再测试gcc编译版本,完全不支持DOS,cmd下可以运行,但是解压img却出错退出。
Just switched to TC2.0, and serious problems were found during testing under DOS after compilation. It seems that the analysis of the img format of hd-copy is not comprehensive. The img confirmed to be of hd-copy 2.0a cannot be extracted, only a 32k header is written. Then tested the gcc-compiled version, which is completely incompatible with DOS, can run under cmd, but exits with an error when extracting the img.
|

从来不用别人的东西,要用,也先改成自己的再说! |
|
2018-3-20 13:25 |
|
|
crshen
中级用户
  
积分 447
发帖 126
注册 2004-2-10
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
既然源码是牛X的WTFPL开源协议,我就乱改了
DOS版源码请看后面第14楼层,下载地址在15楼。
Last edited by crshen on 2018-3-21 at 16:24 ]
Since the source code is under the awesome WTFPL open source license, I just modified it randomly.
The DOS version source code can be seen in the 14th floor below, and the download address is on the 15th floor.
Last edited by crshen on 2018-3-21 at 16:24 ]
|

从来不用别人的东西,要用,也先改成自己的再说! |
|
2018-3-20 13:38 |
|
|
rgwan
初级用户
 
积分 22
发帖 8
注册 2018-3-19
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
能否将出错的Image发给我?另外的,这个程序其实并不运行在DOS环境下。设计上是配合Windows/Linux,给虚拟机使用的。
此外,我做了一些修复,不知对于您的Image是否奏效。
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
int main(int argc, char *argv)
{
FILE *fp;
uint8_t *hdcopy;
uint8_t *plain;
uint32_t length;
uint32_t fit_size = 0;
int i, j, k, r;
if(argc != 3 && argc != 4)
{
fprintf(stderr, "Usage: %s <HD-COPY Image> <IMA plain floppy image> \n\n", argv);
fprintf(stderr, "This small tool can decompress HD-COPY image to plain floppy image.\n");
fprintf(stderr, "It can help you to use old HD-COPY image on modern PC,\nespecially on Virtual Machine to test out old-school softwares.\n\n");
fprintf(stderr, "Zhiyuan Wan <h@iloli.bid> 2018, License WTFPL.\nAlgorithm analyze from <https://github.com/ciel-yu/devnotes>. Thanks him!\n");
exit(-1);
}
if(argc == 4)
{
fit_size = atoi(argv);
}
fp = fopen(argv, "rb");
if(!fp)
{
fprintf(stderr, "Can't open source HD-COPY image!\n");
exit(-1);
}
fseek(fp, 0, SEEK_END);
length = ftell(fp);
hdcopy = malloc(length);
plain = malloc(0x168000);
fseek(fp, 0, SEEK_SET);
fread(hdcopy, length, 1, fp);
printf("Decompressing HD-COPY Image\nInput size = %d\n", length);
fclose(fp);
uint8_t *actualimage;
uint8_t *payload;
if(hdcopy == 0xff && hdcopy == 0x18)
{
printf("That is an HD-COPY 2.0 Image\n");
actualimage = hdcopy + 0x0e; /* 跳过标有卷标的文件头 */
payload = actualimage + 2 + 168; /* 载荷段 */
}
else
{
printf("That is an HD-COPY 1.7 Image\n");
actualimage = hdcopy;
payload = actualimage + 2 + 164;
}
/* 开始解码 */
int maxTrackCount = actualimage;
int secPerTrack = actualimage;
printf("maxTrackCount = %d, secPerTrack = %d\n", maxTrackCount, secPerTrack);
uint8_t *dataTrack = actualimage + 2; /* 有数据的磁道表 */
uint8_t *decomp_p = plain;
memset(plain, 0x00, 0x168000);
for(i = 0; i < maxTrackCount; i++)
{
for(j = 0; j < 2; j++)
{
if(dataTrack != 0x01)
{
decomp_p += 512 * secPerTrack;
continue;
}
int dataLen = payload + (payload << 8);
payload += 2;
uint8_t escByte; /* RLE 压缩 */
for(k = 0; k < dataLen; k++)
{
if(k == 0)
{
escByte = payload;
}
else
{
if(payload == escByte)
{
k++;
uint8_t repeatByte = payload;
int repeat = payload;
for(r = 0; r < repeat; r++)
{
*(decomp_p++) = repeatByte;
}
}
else
{
*(decomp_p++) = payload;
}
}
}
payload += dataLen;
}
}
uint16_t secCount = plain + (plain << 8);
printf("Floppy sector count = %d, fitting to %d bytes\n",
secCount, fit_size > 0 ? fit_size : secCount * 512);
printf("Decompress operation completed, write it to file\n");
fp = fopen(argv, "wb+");
if(!fp)
{
fprintf(stderr, "Can't save plain floppy image!\n");
goto deal;
}
fseek(fp, 0, SEEK_SET);
fwrite(plain, fit_size > 0 ? fit_size : (secCount * 512 > 0 ? secCount * 512 : 0x168000), 1, fp);
fclose(fp);
deal:
free(hdcopy);
free(plain);
return 0;
}
Last edited by rgwan on 2018-3-20 at 19:01 ]
Can you send me the faulty Image? Additionally, this program doesn't actually run in a DOS environment. It's designed to work with Windows/Linux and for use in virtual machines.
Also, I made some fixes, not sure if they work for your Image.
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
int main(int argc, char *argv)
{
FILE *fp;
uint8_t *hdcopy;
uint8_t *plain;
uint32_t length;
uint32_t fit_size = 0;
int i, j, k, r;
if(argc != 3 && argc != 4)
{
fprintf(stderr, "Usage: %s <HD-COPY Image> <IMA plain floppy image> \n\n", argv);
fprintf(stderr, "This small tool can decompress HD-COPY image to plain floppy image.\n");
fprintf(stderr, "It can help you to use old HD-COPY image on modern PC,\nespecially on Virtual Machine to test out old-school softwares.\n\n");
fprintf(stderr, "Zhiyuan Wan <h@iloli.bid> 2018, License WTFPL.\nAlgorithm analyze from <https://github.com/ciel-yu/devnotes>. Thanks him!\n");
exit(-1);
}
if(argc == 4)
{
fit_size = atoi(argv);
}
fp = fopen(argv, "rb");
if(!fp)
{
fprintf(stderr, "Can't open source HD-COPY image!\n");
exit(-1);
}
fseek(fp, 0, SEEK_END);
length = ftell(fp);
hdcopy = malloc(length);
plain = malloc(0x168000);
fseek(fp, 0, SEEK_SET);
fread(hdcopy, length, 1, fp);
printf("Decompressing HD-COPY Image\nInput size = %d\n", length);
fclose(fp);
uint8_t *actualimage;
uint8_t *payload;
if(hdcopy == 0xff && hdcopy == 0x18)
{
printf("That is an HD-COPY 2.0 Image\n");
actualimage = hdcopy + 0x0e; /* Skip the file header with volume label */
payload = actualimage + 2 + 168; /* Payload segment */
}
else
{
printf("That is an HD-COPY 1.7 Image\n");
actualimage = hdcopy;
payload = actualimage + 2 + 164;
}
/* Start decoding */
int maxTrackCount = actualimage;
int secPerTrack = actualimage;
printf("maxTrackCount = %d, secPerTrack = %d\n", maxTrackCount, secPerTrack);
uint8_t *dataTrack = actualimage + 2; /* Track table with data */
uint8_t *decomp_p = plain;
memset(plain, 0x00, 0x168000);
for(i = 0; i < maxTrackCount; i++)
{
for(j = 0; j < 2; j++)
{
if(dataTrack != 0x01)
{
decomp_p += 512 * secPerTrack;
continue;
}
int dataLen = payload + (payload << 8);
payload += 2;
uint8_t escByte; /* RLE compression */
for(k = 0; k < dataLen; k++)
{
if(k == 0)
{
escByte = payload;
}
else
{
if(payload == escByte)
{
k++;
uint8_t repeatByte = payload;
int repeat = payload;
for(r = 0; r < repeat; r++)
{
*(decomp_p++) = repeatByte;
}
}
else
{
*(decomp_p++) = payload;
}
}
}
payload += dataLen;
}
}
uint16_t secCount = plain + (plain << 8);
printf("Floppy sector count = %d, fitting to %d bytes\n",
secCount, fit_size > 0 ? fit_size : secCount * 512);
printf("Decompress operation completed, write it to file\n");
fp = fopen(argv, "wb+");
if(!fp)
{
fprintf(stderr, "Can't save plain floppy image!\n");
goto deal;
}
fseek(fp, 0, SEEK_SET);
fwrite(plain, fit_size > 0 ? fit_size : (secCount * 512 > 0 ? secCount * 512 : 0x168000), 1, fp);
fclose(fp);
deal:
free(hdcopy);
free(plain);
return 0;
}
Last edited by rgwan on 2018-3-20 at 19:01 ]
|
|
2018-3-20 18:59 |
|
|
LoggerVick
中级用户
  
积分 365
发帖 212
注册 2018-1-27
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
Originally posted by rgwan at 2018-3-20 18:59:
能否将出错的Image发给我?另外的,这个程序其实并不运行在DOS环境下。设计上是配合Windows/Linux,给虚拟机使用的。
此外,我做了一些修复,不知对 ...
他qq不加好友,你加入群可以搜索一下crshen然后他看到就能给你。
Originally posted by rgwan at 2018-3-20 18:59:
Can you send me the faulty Image? Additionally, this program does not actually run in a DOS environment. It is designed to work with Windows/Linux for use with virtual machines.
Furthermore, I have made some fixes, not sure about ...
He doesn't add QQ friends, you can join the group and search for crshen then he will see and can send it to you.
|

很少上线的游客前来。 |
|
2018-3-20 22:11 |
|
|
LoggerVick
中级用户
  
积分 365
发帖 212
注册 2018-1-27
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
或者试试新dos时代纪念光盘crshen留的email
Or try the new DOS era commemorative CD, the email left by crshen
|

很少上线的游客前来。 |
|
2018-3-20 22:38 |
|
|
LoggerVick
中级用户
  
积分 365
发帖 212
注册 2018-1-27
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
crshen:@[论坛]Willard 知道,我今天单位夜班,没法回他,一晚不睡,明天要睡一天,估计明下午4点后回复他吧。
crshen:@Willard knows that I'm on night shift at work today and can't reply to him. I won't sleep all night, and I'll need to sleep the whole day tomorrow. I estimate I'll reply to him after 4 PM tomorrow.
|

很少上线的游客前来。 |
|
2018-3-20 23:06 |
|
|
crshen
中级用户
  
积分 447
发帖 126
注册 2004-2-10
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
回复rgwan:
经测试,程序已基本能解压HD-copy的img,但是源码中存在些瑕疵:
1、i 的 for 循环明显错误,查看img格式文档,byte tracks; // total tracks - 1,这里是以0起计数的,80道显示为79,故要改for (i = 0; i <= maxTrackCount; i++),否则在一些比较满的磁盘会缺一个磁道数据。
2、对 for(k = 0; k < dataLen; k++) 中k==0的判断,几乎每个磁道将进行上万次,影响效率,可改:
escByte = payload[0];
for (k = 1; k < dataLen; k++){}
Reply to rgwan:
After testing, the program can basically decompress the img of HD - copy, but there are some flaws in the source code:
1. The for loop of i is obviously wrong. Looking at the img format document, byte tracks; // total tracks - 1, here it is counted from 0, 80 tracks are displayed as 79, so it is necessary to change for (i = 0; i <= maxTrackCount; i++) to otherwise, some relatively full disks will lack one track of data.
2. For the judgment of k == 0 in for (k = 0; k < dataLen; k++), it will be carried out tens of thousands of times for almost each track, which affects the efficiency. It can be changed to:
escByte = payload;
for (k = 1; k < dataLen; k++){}
|

从来不用别人的东西,要用,也先改成自己的再说! |
|
2018-3-21 15:36 |
|
|
crshen
中级用户
  
积分 447
发帖 126
注册 2004-2-10
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
软件测试环境:
1、Ubuntu 16.04 ,gcc编译,命令行下运行正常;
2、Win7 x64 + CodeBlocks 17.12 mingw,cmd环境运行正常;
3、XP + cfree5.0默认gcc3.45,cmd环境运行正常;
4、DOS 6.22 + Turbo C 2.0,运行正常,拷贝到win98,command下运行正常。
测试方法:
1、磁盘映像,选用mys的起步DOS网站下10个HD-COPY img,包括1.44M和1.2M;
2、单命令行执行;
3、批处理执行:for %i in (dir *.img) do dehd.exe %i dest\%i (将当前目录下所有HD-COPY格式img 转换到 标准格式img,保存至dest目录下同名文件)。
Software testing environment:
1. Ubuntu 16.04, compiled with gcc, runs normally in the command line;
2. Win7 x64 + CodeBlocks 17.12 mingw, runs normally in the cmd environment;
3. XP + cfree5.0 default gcc3.45, runs normally in the cmd environment;
4. DOS 6.22 + Turbo C 2.0, runs normally, copied to win98, runs normally under command.
Testing methods:
1. Disk image, select 10 HD-COPY img from the starting DOS website of mys, including 1.44M and 1.2M;
2. Execute with a single command line;
3. Execute with a batch script: for %i in (dir *.img) do dehd.exe %i dest\%i (convert all HD-COPY format img in the current directory to standard format img, and save to the same name file in the dest directory).
|

从来不用别人的东西,要用,也先改成自己的再说! |
|
2018-3-21 15:44 |
|
|
crshen
中级用户
  
积分 447
发帖 126
注册 2004-2-10
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
首先感谢rgwan分享源码,这里是我修改的DOS版本,可用TC2.0或BC3.1编译。
由于DOS内存限制,不可能像保护模式下那样直接申请一个大内存,故数据解码需频繁进行文件读写,磁盘IO速度自然比不上内存,效率较CMD版要差些。
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv)
{
FILE *fpin, *fpout;
unsigned char *buffer, *hdcopy, *plain, *pnDataTrkMap;
int nTrackCount, nSecPerTrack, nBytesPerTrack, nActualImgAddr, nImgDataAddr, escByte, repeatByte, repeat;
unsigned int nDataLen;
unsigned long nFinPos;
int i, j, k, r;
if (argc != 3)
{
fprintf(stderr, "Usage: %s <HD-COPY Image> <IMA plain floppy image>\n\n", argv);
fprintf(stderr, "This small tool decompress HD-COPY image to plain floppy image.\n");
fprintf(stderr, "Therefore, you can use old HD-COPY img on modern PC or Virtual Machine.\n\n");
fprintf(stderr, "Zhiyuan Wan <h@iloli.bid> 2018, License WTFPL.\nAlgorithm analyze from <https://github.com/ciel-yu/devnotes>. Thanks him!\n");
fprintf(stderr, "Modified to suit old DOS by crshen <crshen@qq.com>.\n\n");
exit(-1);
}
fpin = fopen(argv, "rb");
if (!fpin)
{
fprintf(stderr, "Can't open source HD-COPY image!\n");
exit(-1);
}
fpout = fopen(argv, "wb+");
if (!fpout)
{
fprintf(stderr, "Can't save plain floppy image!\n");
exit(-1);
}
buffer = malloc(2);
fseek(fpin, 0, SEEK_SET);
fread(buffer, 2, 1, fpin);
if (buffer == 0xff && buffer == 0x18)
{
printf("Source img is an HD-COPY 2.0 Image\n");
nActualImgAddr = 14; /* 跳过标有卷标的文件头 */
nImgDataAddr = nActualImgAddr + 2 + 168; /* 磁道数据起始 */
}
else
{
printf("Source img may be an HD-COPY 1.7 Image\n");
nActualImgAddr = 0;
nImgDataAddr = nActualImgAddr + 2 + 164;
}
fseek(fpin, nActualImgAddr, SEEK_SET);
fread(buffer, 2, 1, fpin);
nTrackCount = buffer; /* total tracks - 1 */
nSecPerTrack = buffer;
nBytesPerTrack = 512 * nSecPerTrack;
printf("nTrackCount = %d, nSecPerTrack = %d\n", nTrackCount, nSecPerTrack);
pnDataTrkMap = malloc(2 * (nTrackCount + 1));
fseek(fpin, nActualImgAddr + 2, SEEK_SET); /* tracks_map */
fread(pnDataTrkMap, 2 * (nTrackCount + 1), 1, fpin);
plain = malloc(nBytesPerTrack); /* 一个标准磁道容量 */
hdcopy = malloc(nBytesPerTrack); /* 存放压缩磁道数据 */
nFinPos = nImgDataAddr;
printf("Working hard,please wait...\n");
fseek(fpout, 0, SEEK_SET);
for (i = 0; i <= nTrackCount; i++)
{
for (j = 0; j < 2; j++)
{
if (pnDataTrkMap != 0x01) /* 映射为空磁道 */
{
memset(plain, 0x00, nBytesPerTrack);
fwrite(plain, nBytesPerTrack, 1, fpout);
continue;
}
fseek(fpin, nFinPos, SEEK_SET);
fread(buffer, 2, 1, fpin);
nDataLen = buffer + (buffer << 8); /* little endian */
memset(hdcopy, 0x00, nBytesPerTrack);
fread(hdcopy, nDataLen, 1, fpin);
nFinPos = nFinPos + 2 + nDataLen;
escByte = hdcopy;
for (k = 1; k < nDataLen; k++) /* RLE压缩的磁道内容解压 */
{
if (hdcopy == escByte)
{
k++;
repeatByte = hdcopy;
repeat = hdcopy;
for (r = 0; r < repeat; r++)
{
*(plain++) = repeatByte;
}
}
else
{
*(plain++) = hdcopy;
}
}
plain -= nBytesPerTrack;
fwrite(plain, nBytesPerTrack, 1, fpout);
}
}
fclose(fpin);
fclose(fpout);
free(hdcopy);
free(buffer);
free(pnDataTrkMap);
free(plain);
printf("Decompress operation completed.\n");
return 0;
}
Last edited by crshen on 2018-3-21 at 16:27 ]
First, thank rgwan for sharing the source code. Here is the DOS version I modified, which can be compiled with TC2.0 or BC3.1.
Due to the memory limitations of DOS, it's impossible to directly apply for a large amount of memory like in protected mode. Therefore, data decoding needs to frequently perform file reads and writes. The disk IO speed is naturally not as fast as memory, and the efficiency is worse than the CMD version.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv)
{
FILE *fpin, *fpout;
unsigned char *buffer, *hdcopy, *plain, *pnDataTrkMap;
int nTrackCount, nSecPerTrack, nBytesPerTrack, nActualImgAddr, nImgDataAddr, escByte, repeatByte, repeat;
unsigned int nDataLen;
unsigned long nFinPos;
int i, j, k, r;
if (argc != 3)
{
fprintf(stderr, "Usage: %s <HD-COPY Image> <IMA plain floppy image>\n\n", argv);
fprintf(stderr, "This small tool decompress HD-COPY image to plain floppy image.\n");
fprintf(stderr, "Therefore, you can use old HD-COPY img on modern PC or Virtual Machine.\n\n");
fprintf(stderr, "Zhiyuan Wan <h@iloli.bid> 2018, License WTFPL.\nAlgorithm analyze from <https://github.com/ciel-yu/devnotes>. Thanks him!\n");
fprintf(stderr, "Modified to suit old DOS by crshen <crshen@qq.com>.\n\n");
exit(-1);
}
fpin = fopen(argv, "rb");
if (!fpin)
{
fprintf(stderr, "Can't open source HD-COPY image!\n");
exit(-1);
}
fpout = fopen(argv, "wb+");
if (!fpout)
{
fprintf(stderr, "Can't save plain floppy image!\n");
exit(-1);
}
buffer = malloc(2);
fseek(fpin, 0, SEEK_SET);
fread(buffer, 2, 1, fpin);
if (buffer == 0xff && buffer == 0x18)
{
printf("Source img is an HD-COPY 2.0 Image\n");
nActualImgAddr = 14; /* Skip the file header marked with the volume label */
nImgDataAddr = nActualImgAddr + 2 + 168; /* Start of track data */
}
else
{
printf("Source img may be an HD-COPY 1.7 Image\n");
nActualImgAddr = 0;
nImgDataAddr = nActualImgAddr + 2 + 164;
}
fseek(fpin, nActualImgAddr, SEEK_SET);
fread(buffer, 2, 1, fpin);
nTrackCount = buffer; /* total tracks - 1 */
nSecPerTrack = buffer;
nBytesPerTrack = 512 * nSecPerTrack;
printf("nTrackCount = %d, nSecPerTrack = %d\n", nTrackCount, nSecPerTrack);
pnDataTrkMap = malloc(2 * (nTrackCount + 1));
fseek(fpin, nActualImgAddr + 2, SEEK_SET); /* tracks_map */
fread(pnDataTrkMap, 2 * (nTrackCount + 1), 1, fpin);
plain = malloc(nBytesPerTrack); /* Capacity of a standard track */
hdcopy = malloc(nBytesPerTrack); /* Store compressed track data */
nFinPos = nImgDataAddr;
printf("Working hard,please wait...\n");
fseek(fpout, 0, SEEK_SET);
for (i = 0; i <= nTrackCount; i++)
{
for (j = 0; j < 2; j++)
{
if (pnDataTrkMap != 0x01) /* The mapping is an empty track */
{
memset(plain, 0x00, nBytesPerTrack);
fwrite(plain, nBytesPerTrack, 1, fpout);
continue;
}
fseek(fpin, nFinPos, SEEK_SET);
fread(buffer, 2, 1, fpin);
nDataLen = buffer + (buffer << 8); /* little endian */
memset(hdcopy, 0x00, nBytesPerTrack);
fread(hdcopy, nDataLen, 1, fpin);
nFinPos = nFinPos + 2 + nDataLen;
escByte = hdcopy;
for (k = 1; k < nDataLen; k++) /* Decompress the track content compressed by RLE */
{
if (hdcopy == escByte)
{
k++;
repeatByte = hdcopy;
repeat = hdcopy;
for (r = 0; r < repeat; r++)
{
*(plain++) = repeatByte;
}
}
else
{
*(plain++) = hdcopy;
}
}
plain -= nBytesPerTrack;
fwrite(plain, nBytesPerTrack, 1, fpout);
}
}
fclose(fpin);
fclose(fpout);
free(hdcopy);
free(buffer);
free(pnDataTrkMap);
free(plain);
printf("Decompress operation completed.\n");
return 0;
}
Last edited by crshen on 2018-3-21 at 16:27 ]
|

从来不用别人的东西,要用,也先改成自己的再说! |
|
2018-3-21 15:51 |
|
|
crshen
中级用户
  
积分 447
发帖 126
注册 2004-2-10
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
源码文件和已经预编译的程序可到百度网盘下载:
DOS软件共享\解压HD-COPY映像到标准img.rar
pan.baidu.com/s/1toVeHvm1PHUL1d-dstROmA
密码:b5n5
或者加 QQ群:中華DOS聯盟(8393170),到群文件中下载。
Last edited by crshen on 2018-3-21 at 16:25 ]
The source code files and pre-compiled programs can be downloaded from Baidu Netdisk:
DOS Software Sharing\Extract HD-COPY image to standard img.rar
pan.baidu.com/s/1toVeHvm1PHUL1d-dstROmA
Password: b5n5
Or join the QQ group: Zhonghua DOS Union (8393170) and download from the group files.
Last edited by crshen on 2018-3-21 at 16:25 ]
|

从来不用别人的东西,要用,也先改成自己的再说! |
|
2018-3-21 16:08 |
|
|