|
|
| version 1.8, 2004/03/04 15:20:13 | version 1.10, 2005/02/07 14:46:09 |
|---|---|
| Line 29 void newdisk_fdd(const char *fname, REG8 | Line 29 void newdisk_fdd(const char *fname, REG8 |
| static BOOL writezero(FILEH fh, UINT size) { | static BOOL writezero(FILEH fh, UINT size) { |
| BYTE work[256]; | UINT8 work[256]; |
| UINT wsize; | UINT wsize; |
| ZeroMemory(work, sizeof(work)); | ZeroMemory(work, sizeof(work)); |
| Line 45 static BOOL writezero(FILEH fh, UINT siz | Line 45 static BOOL writezero(FILEH fh, UINT siz |
| static BOOL writehddipl(FILEH fh, UINT ssize, UINT32 tsize) { | static BOOL writehddipl(FILEH fh, UINT ssize, UINT32 tsize) { |
| BYTE work[1024]; | UINT8 work[1024]; |
| UINT size; | UINT size; |
| ZeroMemory(work, sizeof(work)); | ZeroMemory(work, sizeof(work)); |
| Line 74 static BOOL writehddipl(FILEH fh, UINT s | Line 74 static BOOL writehddipl(FILEH fh, UINT s |
| void newdisk_thd(const char *fname, UINT hddsize) { | void newdisk_thd(const char *fname, UINT hddsize) { |
| FILEH fh; | FILEH fh; |
| BYTE work[256]; | UINT8 work[256]; |
| UINT size; | UINT size; |
| BOOL r; | BOOL r; |
| Line 116 void newdisk_nhd(const char *fname, UINT | Line 116 void newdisk_nhd(const char *fname, UINT |
| ZeroMemory(&nhd, sizeof(nhd)); | ZeroMemory(&nhd, sizeof(nhd)); |
| CopyMemory(&nhd.sig, sig_nhd, 15); | CopyMemory(&nhd.sig, sig_nhd, 15); |
| STOREINTELDWORD(nhd.headersize, sizeof(nhd)); | STOREINTELDWORD(nhd.headersize, sizeof(nhd)); |
| size = hddsize * 16; | size = hddsize * 15; |
| STOREINTELDWORD(nhd.cylinders, size); | STOREINTELDWORD(nhd.cylinders, size); |
| STOREINTELWORD(nhd.surfaces, 8); | STOREINTELWORD(nhd.surfaces, 8); |
| #if 0 | STOREINTELWORD(nhd.sectors, 17); |
| STOREINTELWORD(nhd.sectors, 32); | |
| STOREINTELWORD(nhd.sectorsize, 256); | |
| #else | |
| STOREINTELWORD(nhd.sectors, 16); | |
| STOREINTELWORD(nhd.sectorsize, 512); | STOREINTELWORD(nhd.sectorsize, 512); |
| #endif | |
| r = (file_write(fh, &nhd, sizeof(nhd)) != sizeof(nhd)); | r = (file_write(fh, &nhd, sizeof(nhd)) != sizeof(nhd)); |
| r |= writehddipl(fh, 256, size * 8 * 32 * 256); | r |= writehddipl(fh, 512, size * 8 * 17 * 512); |
| file_close(fh); | file_close(fh); |
| if (r) { | if (r) { |
| file_delete(fname); | file_delete(fname); |