2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PC-98 フロッピーIPL作成ツール

Last updated at Posted at 2018-08-13

MASM32などで作ったIPL用comファイルから2HDフロッピー(ベタ形式)を作る。PC-98エミュレータ Neko Project II で読み込み可能。

iplfd.cpp
/*
	Visual Studio Community 2017 / Visual C++
*/

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
	// セクタサイズ * セクタ数 * ヘッド数 * シリンダ数
	static char buf[1024 * 8 * 2 * 77];

	if (argc != 2) {
		fprintf(stderr, "usage: iplfd filename\n");
		return 1;
	}
	char *path_in = argv[1];
	char path_out[_MAX_PATH];
	sprintf_s(path_out, "%s.dup", path_in);

	FILE *file_in;
	if (fopen_s(&file_in, path_in, "rb")) {
		perror(path_in);
		exit(1);
	}
	fread(buf, 1, sizeof buf, file_in);

	FILE *file_out;
	if (fopen_s(&file_out, path_out, "wb")) {
		perror(path_out);
		exit(1);
	}
	fwrite(buf, 1, sizeof buf, file_out);

	_fcloseall();
	return 0;
}
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?