25 |
#include <config.h> |
#include <config.h> |
26 |
#endif |
#endif |
27 |
|
|
28 |
#ifdef _WIN32_ |
#ifdef WIN32 |
29 |
#define _WIN32_WINNT 0x0500 |
#define _WIN32_WINNT 0x0500 |
30 |
|
|
31 |
#include <windows.h> |
#include <windows.h> |
37 |
|
|
38 |
static void PrintLastError(char* file, int line) |
static void PrintLastError(char* file, int line) |
39 |
{ |
{ |
40 |
#ifdef _WIN32_ |
#ifdef WIN32 |
41 |
LPVOID lpMsgBuf; |
LPVOID lpMsgBuf; |
42 |
FormatMessage( |
FormatMessage( |
43 |
FORMAT_MESSAGE_ALLOCATE_BUFFER | |
FORMAT_MESSAGE_ALLOCATE_BUFFER | |
64 |
#define SHOWERROR PrintLastError(__FILE__,__LINE__) |
#define SHOWERROR PrintLastError(__FILE__,__LINE__) |
65 |
|
|
66 |
static void printUsage() { |
static void printUsage() { |
67 |
#ifdef _WIN32_ |
#ifdef WIN32 |
68 |
printf( |
printf( |
69 |
"akaidump <source-drive-letter>: <destination-filename>\n" |
"akaidump <source-drive-letter>: <destination-filename>\n" |
70 |
"by Sebastien Métrot (meeloo@meeloo.net)\n\n" |
"by Sebastien Métrot (meeloo@meeloo.net)\n\n" |
131 |
|
|
132 |
// open input source |
// open input source |
133 |
DiskImage* pImage = NULL; |
DiskImage* pImage = NULL; |
134 |
#ifdef _WIN32_ |
#ifdef WIN32 |
135 |
char drive = toupper(*(argv[1]))-'A'; |
char drive = toupper(*(argv[1]))-'A'; |
136 |
printf("opening drive %c:\n",drive+'a'); |
printf("opening drive %c:\n",drive+'a'); |
137 |
pImage = new DiskImage(drive); |
pImage = new DiskImage(drive); |