OSDN Git Service

[*nix] Update installer.
[csp-qt/common_source_project-fm7.git] / source / tool / mz2500 / create_hd.cpp
1 /*
2         hdd image creater for EmuZ-2500
3         
4         Author : Takeda.Toshiya
5         Date   : 2004.09.10 -
6 */
7
8 #include <stdio.h>
9
10 // variable scope of 'for' loop (for microsoft visual c++ 6.0)
11 #define for if(0);else for
12 // type definition
13 typedef unsigned char uint8_t;
14
15 //#define HDD_SIZE (20*1024*1024)
16 #define HDD_SIZE 22437888
17
18 void main()
19 {
20         uint8_t header[0x30] = {
21                 0x4d,0x5a,0x2d,0x32,0x35,0x30,0x30,0x20,0x48,0x44,0x20,0x73,0x79,0x73,0x74,0x65,
22                 0x6d,0x20,0x62,0x79,0x20,0x53,0x48,0x41,0x52,0x50,0x20,0x43,0x6f,0x72,0x70,0x2e,
23                 0x20,0x20,0x56,0x31,0x2e,0x30,0x41,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20
24         };
25         
26         FILE* fp = fopen("HDD1.DAT", "wb");
27         fwrite(header, sizeof(header), 1, fp);
28         for(int i = 0; i < 0xd0; i++)
29                 fputc(0x20, fp);
30         for(int i = 0; i < 0x100; i++)
31                 fputc(0xff, fp);
32         for(int i = 0; i < HDD_SIZE - 0x200; i++)
33                 fputc(0, fp);
34         fclose(fp);
35         
36         fp = fopen("HDD2.DAT", "wb");
37         fwrite(header, sizeof(header), 1, fp);
38         for(int i = 0; i < 0xd0; i++)
39                 fputc(0x20, fp);
40         for(int i = 0; i < 0x100; i++)
41                 fputc(0xff, fp);
42         for(int i = 0; i < HDD_SIZE - 0x200; i++)
43                 fputc(0, fp);
44         fclose(fp);
45 }
46