Browse Source

stripped off all carrige returns

master
Sven Oliver Moll 1 month ago
parent
commit
5691147d8d
8 changed files with 2057 additions and 2057 deletions
  1. 9
    9
      Makefile
  2. 60
    60
      find.c
  3. 21
    21
      find.h
  4. 1113
    1113
      makewav.c
  5. 372
    372
      makewav.h
  6. 378
    378
      makewav.txt
  7. 93
    93
      queue.c
  8. 11
    11
      queue.h

+ 9
- 9
Makefile View File

@@ -1,9 +1,9 @@
1
-.SUFFIXES: .exe .o .c .pc
2
-
3
-all:makewav
4
-
5
-queue.o:
6
-	gcc -c queue.c
7
-
8
-makewav: queue.o
9
-	gcc -lm -DLINUX -O queue.o -o makewav makewav.c
1
+.SUFFIXES: .exe .o .c .pc
2
+
3
+all:makewav
4
+
5
+queue.o:
6
+	gcc -c queue.c
7
+
8
+makewav: queue.o
9
+	gcc -lm -DLINUX -O queue.o -o makewav makewav.c

+ 60
- 60
find.c View File

@@ -1,61 +1,61 @@
1
-/* FFIND.C: This program uses the 32-bit _find functions to print
2
- * a list of all files (and their attributes) with a .C extension
3
- * in the current directory.
4
- */
5
-
6
-#include <stdio.h>
7
-#include <string.h>
8
-#include <io.h>
9
-#include <time.h>
10
-#include <stdlib.h>
11
-#include "queue.h"
12
-#include "find.h"
13
-
14
-int myGlob( char *globString, struct qnode **fileNameQ, int *fileCount )
15
-{
16
-    struct FINDDATA_TYPE c_file;
17
-    long hFile;
18
-    char full_path_buffer[_MAX_DRIVE+_MAX_DIR+_MAX_FNAME+_MAX_EXT];
19
-    char drive[_MAX_DRIVE];
20
-    char dir[_MAX_DIR];
21
-    char fname[_MAX_FNAME];
22
-    char ext[_MAX_EXT];
23
-
24
-    if (strchr(globString,'+') != NULL)
25
-    {
26
-        *fileNameQ = addq(*fileNameQ, globString, fileCount);
27
-        return 0;
28
-    }
29
-    _splitpath( globString, drive, dir, fname, ext );
30
-#ifdef _WIN32
31
-    if( (hFile = _findfirst( globString, &c_file )) == -1L )
32
-#else
33
-    if( (hFile = findfirst( globString, &c_file, 0 )) == -1L )
34
-#endif
35
-       printf( "No files matching %s in current directory!\n", globString );
36
-   else
37
-   {
38
-            if (!(c_file.FFATTRIB & FA_DIREC))
39
-                sprintf(full_path_buffer,"%s%s%s",drive,dir,c_file.FFNAME);
40
-                *fileNameQ = addq(*fileNameQ, full_path_buffer, fileCount);
41
-/*              printf( " %-12s\n", c_file.FFNAME); */
42
-
43
-            /* Find the rest of the .c files */
44
-#ifdef _WIN32
45
-            while( _findnext( hFile, &c_file ) == 0 )
46
-#else
47
-            while( findnext( &c_file ) == 0 )
48
-#endif
49
-            {
50
-                if (!(c_file.FFATTRIB & FA_DIREC))
51
-                    sprintf(full_path_buffer,"%s%s%s",drive,dir,c_file.FFNAME);
52
-                    *fileNameQ = addq(*fileNameQ, full_path_buffer, fileCount);
53
-/*                  printf( " %-12s\n", c_file.FFNAME);*/
54
-            }
55
-#ifdef _WIN32
56
-       _findclose( hFile );
57
-#endif
58
-/*     qprint(fileNameQ); */
59
-   }
60
-   return 0;
1
+/* FFIND.C: This program uses the 32-bit _find functions to print
2
+ * a list of all files (and their attributes) with a .C extension
3
+ * in the current directory.
4
+ */
5
+
6
+#include <stdio.h>
7
+#include <string.h>
8
+#include <io.h>
9
+#include <time.h>
10
+#include <stdlib.h>
11
+#include "queue.h"
12
+#include "find.h"
13
+
14
+int myGlob( char *globString, struct qnode **fileNameQ, int *fileCount )
15
+{
16
+    struct FINDDATA_TYPE c_file;
17
+    long hFile;
18
+    char full_path_buffer[_MAX_DRIVE+_MAX_DIR+_MAX_FNAME+_MAX_EXT];
19
+    char drive[_MAX_DRIVE];
20
+    char dir[_MAX_DIR];
21
+    char fname[_MAX_FNAME];
22
+    char ext[_MAX_EXT];
23
+
24
+    if (strchr(globString,'+') != NULL)
25
+    {
26
+        *fileNameQ = addq(*fileNameQ, globString, fileCount);
27
+        return 0;
28
+    }
29
+    _splitpath( globString, drive, dir, fname, ext );
30
+#ifdef _WIN32
31
+    if( (hFile = _findfirst( globString, &c_file )) == -1L )
32
+#else
33
+    if( (hFile = findfirst( globString, &c_file, 0 )) == -1L )
34
+#endif
35
+       printf( "No files matching %s in current directory!\n", globString );
36
+   else
37
+   {
38
+            if (!(c_file.FFATTRIB & FA_DIREC))
39
+                sprintf(full_path_buffer,"%s%s%s",drive,dir,c_file.FFNAME);
40
+                *fileNameQ = addq(*fileNameQ, full_path_buffer, fileCount);
41
+/*              printf( " %-12s\n", c_file.FFNAME); */
42
+
43
+            /* Find the rest of the .c files */
44
+#ifdef _WIN32
45
+            while( _findnext( hFile, &c_file ) == 0 )
46
+#else
47
+            while( findnext( &c_file ) == 0 )
48
+#endif
49
+            {
50
+                if (!(c_file.FFATTRIB & FA_DIREC))
51
+                    sprintf(full_path_buffer,"%s%s%s",drive,dir,c_file.FFNAME);
52
+                    *fileNameQ = addq(*fileNameQ, full_path_buffer, fileCount);
53
+/*                  printf( " %-12s\n", c_file.FFNAME);*/
54
+            }
55
+#ifdef _WIN32
56
+       _findclose( hFile );
57
+#endif
58
+/*     qprint(fileNameQ); */
59
+   }
60
+   return 0;
61 61
 }

+ 21
- 21
find.h View File

@@ -1,22 +1,22 @@
1
-#ifdef _WIN32
2
-    #define FINDDATA_TYPE _finddata_t
3
-    #define FFATTRIB attrib
4
-    #define FFNAME name
5
-    #define FA_DIREC _A_SUBDIR
6
-#else
7
-    #include <dir.h>
8
-
9
-    #define FINDDATA_TYPE ffblk
10
-    #define FFATTRIB      ff_attrib
11
-    #define _findfirst    findfirst
12
-    #define _makepath     fnmerge
13
-    #define _splitpath    fnsplit
14
-    #define FFNAME        ff_name
15
-    #define _MAX_DRIVE    MAXDRIVE
16
-    #define _MAX_PATH     MAXPATH
17
-    #define _MAX_DIR      MAXDIR
18
-    #define _MAX_FNAME    MAXFILE
19
-    #define _MAX_EXT      MAXEXT
20
-#endif
21
-
1
+#ifdef _WIN32
2
+    #define FINDDATA_TYPE _finddata_t
3
+    #define FFATTRIB attrib
4
+    #define FFNAME name
5
+    #define FA_DIREC _A_SUBDIR
6
+#else
7
+    #include <dir.h>
8
+
9
+    #define FINDDATA_TYPE ffblk
10
+    #define FFATTRIB      ff_attrib
11
+    #define _findfirst    findfirst
12
+    #define _makepath     fnmerge
13
+    #define _splitpath    fnsplit
14
+    #define FFNAME        ff_name
15
+    #define _MAX_DRIVE    MAXDRIVE
16
+    #define _MAX_PATH     MAXPATH
17
+    #define _MAX_DIR      MAXDIR
18
+    #define _MAX_FNAME    MAXFILE
19
+    #define _MAX_EXT      MAXEXT
20
+#endif
21
+
22 22
 int myGlob( char *globString, struct qnode **fileNameQ, int *fileCount );

+ 1113
- 1113
makewav.c
File diff suppressed because it is too large
View File


+ 372
- 372
makewav.h View File

@@ -1,372 +1,372 @@
1
-#define BSM_2K       0
2
-#define BSM_CV       1
3
-#define BSM_4K       2
4
-#define BSM_28SC	 3
5
-#define BSM_F8SC     4
6
-#define BSM_28		 5
7
-#define BSM_F8       6
8
-#define BSM_FE       7
9
-#define BSM_3F       8
10
-#define BSM_E0       9
11
-#define BSM_FA	    10
12
-#define BSM_2A	    11
13
-#define BSM_3A	    12
14
-#define BSM_FANR    13
15
-#define BSM_2ANR    14
16
-#define BSM_3ANR    15
17
-#define BSM_46SC    16
18
-#define BSM_F6SC    17
19
-#define BSM_26SC    18
20
-#define BSM_36SC    19
21
-#define BSM_46      20
22
-#define BSM_F6      21
23
-#define BSM_26      22
24
-#define BSM_36      23
25
-#define BSM_E7      24
26
-#define BSM_E7NR    25
27
-#define BSM_F4SC    26
28
-#define BSM_24SC    27
29
-#define BSM_34SC    28
30
-#define BSM_44SC    29
31
-#define BSM_F4	    30
32
-#define BSM_24		31
33
-#define BSM_34		32
34
-#define BSM_44		33
35
-#define BSM_MB      34
36
-#define FMT_22KHZ_8BIT_MONO 0
37
-#define FMT_44KHZ_8BIT_MONO 1
38
-#define FMT_44KHZ_16BIT_STEREO 2
39
-
40
-#define METER_LENGTH 32
41
-
42
-#define DISPLAY_NOTHING  0
43
-#define DISPLAY_FILENAME 1
44
-#define DISPLAY_SUMMARY  2
45
-#define DISPLAY_DETAILS  3
46
-
47
-#ifdef __linux__
48
-    #define _MAX_FNAME 256
49
-    #define _MAX_PATH  256
50
-    #define _MAX_DIR   256
51
-    #define _MAX_DRIVE 256
52
-    #define _MAX_EXT   256
53
-#else
54
-    #include "find.h"
55
-#endif
56
-
57
-typedef unsigned long int   dd;
58
-typedef unsigned short int  dw;
59
-typedef int                 db;
60
-
61
-
62
-struct parmFlags
63
-{
64
-    int     dflag;
65
-    int     fflag;
66
-    int     kflag;
67
-    int     wflag;
68
-    int     stereoFlag;
69
-    int     mflag;
70
-    int     pflag;
71
-    int     sflag;
72
-    int     vflag;
73
-    char    tflag;
74
-    int     zeroBitLength;
75
-    int     oneBitLength;
76
-    int     control;
77
-    int     createMode;
78
-    int     binFileCount;
79
-    int     bankSwitchMode;
80
-    float   headerSeconds;
81
-    float   clearingSeconds;
82
-    float   hlength;
83
-    char    wavFileName[_MAX_FNAME];
84
-    char    fullPath[_MAX_PATH];
85
-
86
-    struct   qnode *binFileQ;
87
-    unsigned int  multi;
88
-    unsigned int  volume;
89
-    unsigned char startHi;
90
-    unsigned char startLo;
91
-};
92
-
93
-char bankSwitchList[][5] =
94
-    {"2K",  "CV",   "4K",	"28SC", "F8SC",	"28",	"F8",   "FE",
95
-     "3F",	"E0",   "FA",	"2A",	"3A",	"FANR",	"2ANR",	"3ANR",
96
-	 "46SC","F6SC",	"26SC",	"36SC",	"46",	"F6",	"26",	"36",
97
-     "E7",  "E7NR", "F4SC", "24SC",	"34SC",	"44SC",	"F4",	"24",
98
-	 "34",	"44",	"MB",   ""};
99
-
100
-unsigned int controlByteList[] =
101
-    {0xCA,  0xEA,   0xC8,   0xF6,	0xE6,	0xD6,   0xC6,   0xCC,
102
-     0xCE,  0xC1,   0xE0,   0xF0,   0x60,	0xC0,	0xD0,	0x40,
103
-	 0x74,	0xE4,	0xF4,	0x64,	0x54,	0xC4,	0xD4,	0x44,
104
-     0xE3,  0xC3,   0xE2,   0xF2,	0x62,	0x72,	0xC2,	0xD2,
105
-	 0x42,	0x52,	0xC9,   0x00};
106
-
107
-int fileSizeList[] =
108
-    {2048,  2048,   4096,   8192,	8192,	8192,   8192,   8192,
109
-     8192,  8192,   12288,  12288,  12288,	12288,	12288,	12288,
110
-	 16384, 16384,	16384,	16384,	16384,	16384,	16384,	16384,
111
-     16384, 16384,  32768,  32768,  32768,	32768,	32768,	32768,
112
-	 32768,	32768,	65536,  0};
113
-
114
-int startPageList[] =
115
-    {7,     7,      15,     31,		15,     31,		15,     15,
116
-     31,    31,     15,     31,		47,		15,     31,		47,
117
-	 63,	15,		31,		47,		63,		15,		31,		47,
118
-     63,    63,     15,		31,		47,		63,     15,		31,
119
-     47,	63,		15,     0};
120
-
121
-int clearingToneLength[2] = {26, 51};
122
-unsigned char clearingTone[256];
123
-
124
-int zeroBitLength,
125
-    oneBitLength;
126
-
127
-unsigned char zeroBit[256],
128
-              oneBit[256];
129
-
130
-/* speed, khz, bit */
131
-int bitLength[5][2][2] =
132
-{
133
-    {{5,9},{15,21}},
134
-    {{3,7},{ 6,10}},
135
-    {{3,5},{ 5, 8}},
136
-    {{3,5},{ 4, 8}},
137
-    {{3,5},{ 4, 7}}
138
-};
139
-
140
-unsigned char header[3][80]=
141
-    {
142
-        {'R','I','F','F',0x80,0x80,0x80,0x80,   /* RIFF TAG */
143
-            'W','A','V','E',                    /* WAV TAG */
144
-                'f','m','t',' ',0x10,0,0,0,     /* FMT TAG */
145
-                    1,0,                        /* format (WAVE_FORMAT_PCM) */
146
-                    1,0,                        /* CHANNELS */
147
-                    0x22,0x56,0,0,              /* SamplesPerSec */
148
-                    0x22,0x56,0,0,              /* BytesPerSec */
149
-                    1,0,                        /* Block align */
150
-                    8,0,                        /* Bits per sample */
151
-                    'd','a','t','a',0,0,0,0,'\0'/* DATA TAG */
152
-        },
153
-        {'R','I','F','F',0x80,0x80,0x80,0x80,   /* RIFF TAG */
154
-            'W','A','V','E',                    /* WAV TAG */
155
-                'f','m','t',' ',0x10,0,0,0,     /* FMT TAG */
156
-                    1,0,                        /* format (WAVE_FORMAT_PCM) */
157
-                    1,0,                        /* CHANNELS */
158
-                    0x44,0xac,0,0,              /* SamplesPerSec */
159
-                    0x44,0xac,0,0,              /* BytesPerSec */
160
-                    1,0,                        /* Block align */
161
-                    8,0,                        /* Bits per sample */
162
-                    'd','a','t','a',0,0,0,0,'\0'/* DATA TAG */
163
-        },
164
-        {'R','I','F','F',0x80,0x80,0x80,0x80,   /* RIFF TAG */
165
-            'W','A','V','E',                    /* WAV TAG */
166
-                'f','m','t',' ',0x10,0,0,0,     /* FMT TAG */
167
-                    1,0,                        /* format (WAVE_FORMAT_PCM) */
168
-                    2,0,                        /* CHANNELS */
169
-                    0x44,0xac,0,0,              /* SamplesPerSec */
170
-                    0x10,0xb1,2,0,              /* BytesPerSec */
171
-                    4,0,                        /* Block align */
172
-                    0x10,0,                     /* Bits per sample */
173
-                    'd','a','t','a',0,0,0,0,'\0'/* DATA TAG */
174
-        }
175
-    };
176
-
177
-dd  BS_1[] = {
178
-    0x34ae2945, /* Magicard (CommaVid).bin */
179
-/*  0x30eb4f7a,    Video Life (4K).BIN */
180
-/*  0x9afa761f,    Magicard (Life).bin */
181
-    0x266bd1b6, /* Video Life (CommaVid).bin */
182
-	0xa0899305, /* Video Life (alternative 2K) */
183
-    -1
184
-};
185
-
186
-char BS_1_DESC[][25] = {
187
-    "Magicard (CommaVid)",
188
-    "Video Life (CommaVid)",
189
-	"Video Life (CommaVid)",
190
-    -1
191
-};
192
-
193
-dd  BS_3[] = {
194
-    0x2843d776, /* Frogger II - Threedeep!.bin */
195
-    0x690ada72, /* Gyruss [b].bin */
196
-    0x525ee7e9, /* Gyruss.bin */
197
-    0x95da4070, /* James Bond 007 [b].bin */
198
-    0x3216c1bb, /* James Bond 007.bin */
199
-    0xae4114d8, /* Montezuma's Revenge.bin */
200
-    0x00e44527, /* Mr. Do!'s Castle.bin */
201
-    0xf723b8a6, /* Popeye.bin */
202
-    0xe44c244e, /* Q-bert's Qubes [a].bin */
203
-    0xb8f2dca6, /* Q-bert's Qubes.bin */
204
-    0xe77f6742, /* Star Wars - Death Star Battle (Parker Bros).bin */
205
-    0xce09fcd4, /* Star Wars - The Arcade Game (Parker Bros).bin */
206
-    0xdd85f0e7, /* Super Cobra [b].bin */
207
-    0x8d372730, /* Super Cobra.bin */
208
-    0xd9088807, /* Tooth Protectors (DSD-Camelot).bin */
209
-    0x7eed7362, /* Tutankham.bin */
210
-    0xc87fc312, /* Popeye_(eks).bin */
211
-    0xef3ec01e, /* Super Cobra_(eks).bin */
212
-    0x84a101d4, /* Star Wars - Death Star Battle_(eks).bin */
213
-    0x2fc06cb0, /* Tutankham_(eks).bin */
214
-    0xab50bf11, /* Star Wars - The Arcade Game (proto).BIN */
215
-    0x549a1b6b, /* Star Wars - The Arcade Game (PAL) */
216
-    0x36910e4d, /* Frogger II - Threedeep! (PAL) */
217
-    0xb8bb2361, /* Gyruss (PAL) */
218
-	0xd3669372, /* Star Wars: Ewok Adventure (PAL) (proto) */
219
-	0x70db5cca, /* Star Wars: Ewok Adventure (T Jentzsch PAL to NTSC Conversion) */
220
-	0x6400d110, /* Lord of the Rings (proto) */
221
-    -1
222
-};
223
-
224
-char BS_3_DESC[][50] = {
225
-    "Frogger II - Threedeep!",
226
-    "Gyruss [b]",
227
-    "Gyruss",
228
-    "James Bond 007 [b]",
229
-    "James Bond 007",
230
-    "Montezuma's Revenge",
231
-    "Mr. Do!'s Castle",
232
-    "Popeye",
233
-    "Q-bert's Qubes [a]",
234
-    "Q-bert's Qubes",
235
-    "Star Wars - Death Star Battle (Parker Bros)",
236
-    "Star Wars - The Arcade Game (Parker Bros)",
237
-    "Super Cobra [b]",
238
-    "Super Cobra",
239
-    "Tooth Protectors (DSD-Camelot)",
240
-    "Tutankham",
241
-    "Popeye_(eks)",
242
-    "Super Cobra_(eks)",
243
-    "Star Wars - Death Star Battle_(eks)",
244
-    "Tutankham_(eks)",
245
-    "Star Wars - The Arcade Game (proto)",
246
-    "Star Wars - The Arcade Game (PAL)",
247
-    "Frogger II - Threedeep! (PAL)",
248
-    "Gyruss (PAL)",
249
-	"Star Wars - Ewok Adventure (proto) (PAL)",
250
-	"Star Wars - Ewok Adv. T Jentzsch PAL->NTSC (proto)",
251
-	"Lord of the Rings (proto)",
252
-    ""
253
-};
254
-
255
-dd  BS_4[] = {
256
-    0x584f6777, /* Espial [b].bin */
257
-    0x8d70fa42, /* Espial.bin */
258
-    0x8beb03d4, /* Miner 2049er [b1].bin */
259
-    0x33f2856f, /* Miner 2049er [b2].bin */
260
-    0xf859122e, /* Miner 2049er Vol. 2 [b1].bin */
261
-    0x281a1ca1, /* Miner 2049er Vol. 2 [b2].bin */
262
-    0x350c63ba, /* Miner 2049er Vol. 2.bin */
263
-    0x728b941c, /* Miner 2049er.bin */
264
-    0x13bf2da3, /* Polaris [b].bin */
265
-    0x7ce5312e, /* Polaris.bin */
266
-    0x40706361, /* River Patrol (Tigervision).bin */
267
-    0x2c34898f, /* Springer.bin */
268
-    0x09a71583, /* Miner 2049er PAL */
269
-    0xd5645294, /* Miner Volume 2 NTSC */
270
-	0x52630ec9, /* Polaris T. Jentzsch PAL to NTSC conversion*/
271
-    -1
272
-};
273
-
274
-char BS_4_DESC[][30] = {
275
-    "Espial [b]",
276
-    "Espial",
277
-    "Miner 2049er [b1]",
278
-    "Miner 2049er [b2]",
279
-    "Miner 2049er Vol. 2 (PAL)[b1]",
280
-    "Miner 2049er Vol. 2 (PAL)[b2]",
281
-    "Miner 2049er Vol. 2 (PAL)",
282
-    "Miner 2049er",
283
-    "Polaris [b] (PAL)",
284
-    "Polaris (PAL)",
285
-    "River Patrol (Tigervision)",
286
-    "Springer",
287
-	"Miner 2049er PAL",
288
-	"Miner 2049er Vol. 2",
289
-	"Polaris (T Jentzsch NTSC->PAL)",
290
-    -1
291
-};
292
-
293
-dd  BS_5[] = {
294
-    0x7d23e780, /* Decathlon.bin */
295
-    0xa51c0236, /* Robot Tank.bin */
296
-    0xd8ecf576, /* Decathlon (PAL) */
297
-    0x0e8757b0, /* Robot Tank (PAL) */
298
-    0x94e8df6b, /* Space Shuttle (PAL) */
299
-	0xf3a4363c,	/* Thwocker prototype */
300
-    -1
301
-};
302
-
303
-char BS_5_DESC[][25] = {
304
-    "Decathlon",
305
-    "Robot Tank",
306
-    "Decathlon (PAL)",
307
-    "Robot Tank (PAL)",
308
-    "Space Shuttle (PAL)",
309
-	"Thwocker (proto)",
310
-    -1
311
-};
312
-
313
-dd	BS_9[] = {
314
-	0x6a31beac,	/* Private Eye (CCE).bin */
315
-	0x3fa749c0,	/* Private Eye [b].bin */
316
-	0x33242242,	/* Private Eye.bin */
317
-	-1
318
-};
319
-
320
-char BS_9_DESC[][20] = {
321
-    "Private Eye (CCE)",
322
-    "Private Eye [b]",
323
-    "Private Eye",
324
-    -1
325
-};
326
-
327
-
328
-dd  BS_6[] = {
329
-    0xa972c32b, /* Dig Dug.bin */
330
-    0x66cdb94b, /* Off the Wall [o].bin */
331
-    0xbd75d92b, /* Off the Wall.bin */
332
-    -1
333
-};
334
-
335
-char BS_6_DESC[][20] = {
336
-    "Dig Dug.bin",
337
-    "Off the Wall [o]",
338
-    "Off the Wall",
339
-    -1
340
-};
341
-
342
-dd  BS_7[] = {
343
-    0x8eed6b02, /* Bump n Jump [b].bin */
344
-    0xd523e776, /* Bump n Jump.bin */
345
-    0x24c35820, /* Burgertime.bin */
346
-    0x5c161fe4, /* Masters of the Universe - The Power of He-Man.bin */
347
-    -1
348
-};
349
-
350
-char BS_7_DESC[][50] = {
351
-    "Bump n Jump [b].bin",
352
-    "Bump n Jump.bin",
353
-    "Burgertime.bin",
354
-    "Masters of the Universe - The Power of He-Man",
355
-    -1
356
-};
357
-
358
-/*
359
-dd  BS_8[] = {
360
-        0xbe1047cf,      Fatal Run (PAL).bin
361
-    -1
362
-};
363
-*/
364
-
365
-dd crc;         /* holds accumulated CRC */
366
-dd crctab[256];     /* table to help CRC calculation */
367
-
368
-#define CRC16_REV 0xA001    /* CRC-16 polynomial reversed */
369
-#define CRC32_REV 0xA0000001    /* CRC-32 polynomial reversed */
370
-#define SQUARE_WAVE 0
371
-#define SINE_WAVE   1
372
-void make16BitStereo(char *sineWave, int *sineWaveLength);
1
+#define BSM_2K       0
2
+#define BSM_CV       1
3
+#define BSM_4K       2
4
+#define BSM_28SC	 3
5
+#define BSM_F8SC     4
6
+#define BSM_28		 5
7
+#define BSM_F8       6
8
+#define BSM_FE       7
9
+#define BSM_3F       8
10
+#define BSM_E0       9
11
+#define BSM_FA	    10
12
+#define BSM_2A	    11
13
+#define BSM_3A	    12
14
+#define BSM_FANR    13
15
+#define BSM_2ANR    14
16
+#define BSM_3ANR    15
17
+#define BSM_46SC    16
18
+#define BSM_F6SC    17
19
+#define BSM_26SC    18
20
+#define BSM_36SC    19
21
+#define BSM_46      20
22
+#define BSM_F6      21
23
+#define BSM_26      22
24
+#define BSM_36      23
25
+#define BSM_E7      24
26
+#define BSM_E7NR    25
27
+#define BSM_F4SC    26
28
+#define BSM_24SC    27
29
+#define BSM_34SC    28
30
+#define BSM_44SC    29
31
+#define BSM_F4	    30
32
+#define BSM_24		31
33
+#define BSM_34		32
34
+#define BSM_44		33
35
+#define BSM_MB      34
36
+#define FMT_22KHZ_8BIT_MONO 0
37
+#define FMT_44KHZ_8BIT_MONO 1
38
+#define FMT_44KHZ_16BIT_STEREO 2
39
+
40
+#define METER_LENGTH 32
41
+
42
+#define DISPLAY_NOTHING  0
43
+#define DISPLAY_FILENAME 1
44
+#define DISPLAY_SUMMARY  2
45
+#define DISPLAY_DETAILS  3
46
+
47
+#ifdef __linux__
48
+    #define _MAX_FNAME 256
49
+    #define _MAX_PATH  256
50
+    #define _MAX_DIR   256
51
+    #define _MAX_DRIVE 256
52
+    #define _MAX_EXT   256
53
+#else
54
+    #include "find.h"
55
+#endif
56
+
57
+typedef unsigned long int   dd;
58
+typedef unsigned short int  dw;
59
+typedef int                 db;
60
+
61
+
62
+struct parmFlags
63
+{
64
+    int     dflag;
65
+    int     fflag;
66
+    int     kflag;
67
+    int     wflag;
68
+    int     stereoFlag;
69
+    int     mflag;
70
+    int     pflag;
71
+    int     sflag;
72
+    int     vflag;
73
+    char    tflag;
74
+    int     zeroBitLength;
75
+    int     oneBitLength;
76
+    int     control;
77
+    int     createMode;
78
+    int     binFileCount;
79
+    int     bankSwitchMode;
80
+    float   headerSeconds;
81
+    float   clearingSeconds;
82
+    float   hlength;
83
+    char    wavFileName[_MAX_FNAME];
84
+    char    fullPath[_MAX_PATH];
85
+
86
+    struct   qnode *binFileQ;
87
+    unsigned int  multi;
88
+    unsigned int  volume;
89
+    unsigned char startHi;
90
+    unsigned char startLo;
91
+};
92
+
93
+char bankSwitchList[][5] =
94
+    {"2K",  "CV",   "4K",	"28SC", "F8SC",	"28",	"F8",   "FE",
95
+     "3F",	"E0",   "FA",	"2A",	"3A",	"FANR",	"2ANR",	"3ANR",
96
+	 "46SC","F6SC",	"26SC",	"36SC",	"46",	"F6",	"26",	"36",
97
+     "E7",  "E7NR", "F4SC", "24SC",	"34SC",	"44SC",	"F4",	"24",
98
+	 "34",	"44",	"MB",   ""};
99
+
100
+unsigned int controlByteList[] =
101
+    {0xCA,  0xEA,   0xC8,   0xF6,	0xE6,	0xD6,   0xC6,   0xCC,
102
+     0xCE,  0xC1,   0xE0,   0xF0,   0x60,	0xC0,	0xD0,	0x40,
103
+	 0x74,	0xE4,	0xF4,	0x64,	0x54,	0xC4,	0xD4,	0x44,
104
+     0xE3,  0xC3,   0xE2,   0xF2,	0x62,	0x72,	0xC2,	0xD2,
105
+	 0x42,	0x52,	0xC9,   0x00};
106
+
107
+int fileSizeList[] =
108
+    {2048,  2048,   4096,   8192,	8192,	8192,   8192,   8192,
109
+     8192,  8192,   12288,  12288,  12288,	12288,	12288,	12288,
110
+	 16384, 16384,	16384,	16384,	16384,	16384,	16384,	16384,
111
+     16384, 16384,  32768,  32768,  32768,	32768,	32768,	32768,
112
+	 32768,	32768,	65536,  0};
113
+
114
+int startPageList[] =
115
+    {7,     7,      15,     31,		15,     31,		15,     15,
116
+     31,    31,     15,     31,		47,		15,     31,		47,
117
+	 63,	15,		31,		47,		63,		15,		31,		47,
118
+     63,    63,     15,		31,		47,		63,     15,		31,
119
+     47,	63,		15,     0};
120
+
121
+int clearingToneLength[2] = {26, 51};
122
+unsigned char clearingTone[256];
123
+
124
+int zeroBitLength,
125
+    oneBitLength;
126
+
127
+unsigned char zeroBit[256],
128
+              oneBit[256];
129
+
130
+/* speed, khz, bit */
131
+int bitLength[5][2][2] =
132
+{
133
+    {{5,9},{15,21}},
134
+    {{3,7},{ 6,10}},
135
+    {{3,5},{ 5, 8}},
136
+    {{3,5},{ 4, 8}},
137
+    {{3,5},{ 4, 7}}
138
+};
139
+
140
+unsigned char header[3][80]=
141
+    {
142
+        {'R','I','F','F',0x80,0x80,0x80,0x80,   /* RIFF TAG */
143
+            'W','A','V','E',                    /* WAV TAG */
144
+                'f','m','t',' ',0x10,0,0,0,     /* FMT TAG */
145
+                    1,0,                        /* format (WAVE_FORMAT_PCM) */
146
+                    1,0,                        /* CHANNELS */
147
+                    0x22,0x56,0,0,              /* SamplesPerSec */
148
+                    0x22,0x56,0,0,              /* BytesPerSec */
149
+                    1,0,                        /* Block align */
150
+                    8,0,                        /* Bits per sample */
151
+                    'd','a','t','a',0,0,0,0,'\0'/* DATA TAG */
152
+        },
153
+        {'R','I','F','F',0x80,0x80,0x80,0x80,   /* RIFF TAG */
154
+            'W','A','V','E',                    /* WAV TAG */
155
+                'f','m','t',' ',0x10,0,0,0,     /* FMT TAG */
156
+                    1,0,                        /* format (WAVE_FORMAT_PCM) */
157
+                    1,0,                        /* CHANNELS */
158
+                    0x44,0xac,0,0,              /* SamplesPerSec */
159
+                    0x44,0xac,0,0,              /* BytesPerSec */
160
+                    1,0,                        /* Block align */
161
+                    8,0,                        /* Bits per sample */
162
+                    'd','a','t','a',0,0,0,0,'\0'/* DATA TAG */
163
+        },
164
+        {'R','I','F','F',0x80,0x80,0x80,0x80,   /* RIFF TAG */
165
+            'W','A','V','E',                    /* WAV TAG */
166
+                'f','m','t',' ',0x10,0,0,0,     /* FMT TAG */
167
+                    1,0,                        /* format (WAVE_FORMAT_PCM) */
168
+                    2,0,                        /* CHANNELS */
169
+                    0x44,0xac,0,0,              /* SamplesPerSec */
170
+                    0x10,0xb1,2,0,              /* BytesPerSec */
171
+                    4,0,                        /* Block align */
172
+                    0x10,0,                     /* Bits per sample */
173
+                    'd','a','t','a',0,0,0,0,'\0'/* DATA TAG */
174
+        }
175
+    };
176
+
177
+dd  BS_1[] = {
178
+    0x34ae2945, /* Magicard (CommaVid).bin */
179
+/*  0x30eb4f7a,    Video Life (4K).BIN */
180
+/*  0x9afa761f,    Magicard (Life).bin */
181
+    0x266bd1b6, /* Video Life (CommaVid).bin */
182
+	0xa0899305, /* Video Life (alternative 2K) */
183
+    -1
184
+};
185
+
186
+char BS_1_DESC[][25] = {
187
+    "Magicard (CommaVid)",
188
+    "Video Life (CommaVid)",
189
+	"Video Life (CommaVid)",
190
+    -1
191
+};
192
+
193
+dd  BS_3[] = {
194
+    0x2843d776, /* Frogger II - Threedeep!.bin */
195
+    0x690ada72, /* Gyruss [b].bin */
196
+    0x525ee7e9, /* Gyruss.bin */
197
+    0x95da4070, /* James Bond 007 [b].bin */
198
+    0x3216c1bb, /* James Bond 007.bin */
199
+    0xae4114d8, /* Montezuma's Revenge.bin */
200
+    0x00e44527, /* Mr. Do!'s Castle.bin */
201
+    0xf723b8a6, /* Popeye.bin */
202
+    0xe44c244e, /* Q-bert's Qubes [a].bin */
203
+    0xb8f2dca6, /* Q-bert's Qubes.bin */
204
+    0xe77f6742, /* Star Wars - Death Star Battle (Parker Bros).bin */
205
+    0xce09fcd4, /* Star Wars - The Arcade Game (Parker Bros).bin */
206
+    0xdd85f0e7, /* Super Cobra [b].bin */
207
+    0x8d372730, /* Super Cobra.bin */
208
+    0xd9088807, /* Tooth Protectors (DSD-Camelot).bin */
209
+    0x7eed7362, /* Tutankham.bin */
210
+    0xc87fc312, /* Popeye_(eks).bin */
211
+    0xef3ec01e, /* Super Cobra_(eks).bin */
212
+    0x84a101d4, /* Star Wars - Death Star Battle_(eks).bin */
213
+    0x2fc06cb0, /* Tutankham_(eks).bin */
214
+    0xab50bf11, /* Star Wars - The Arcade Game (proto).BIN */
215
+    0x549a1b6b, /* Star Wars - The Arcade Game (PAL) */
216
+    0x36910e4d, /* Frogger II - Threedeep! (PAL) */
217
+    0xb8bb2361, /* Gyruss (PAL) */
218
+	0xd3669372, /* Star Wars: Ewok Adventure (PAL) (proto) */
219
+	0x70db5cca, /* Star Wars: Ewok Adventure (T Jentzsch PAL to NTSC Conversion) */
220
+	0x6400d110, /* Lord of the Rings (proto) */
221
+    -1
222
+};
223
+
224
+char BS_3_DESC[][50] = {
225
+    "Frogger II - Threedeep!",
226
+    "Gyruss [b]",
227
+    "Gyruss",
228
+    "James Bond 007 [b]",
229
+    "James Bond 007",
230
+    "Montezuma's Revenge",
231
+    "Mr. Do!'s Castle",
232
+    "Popeye",
233
+    "Q-bert's Qubes [a]",
234
+    "Q-bert's Qubes",
235
+    "Star Wars - Death Star Battle (Parker Bros)",
236
+    "Star Wars - The Arcade Game (Parker Bros)",
237
+    "Super Cobra [b]",
238
+    "Super Cobra",
239
+    "Tooth Protectors (DSD-Camelot)",
240
+    "Tutankham",
241
+    "Popeye_(eks)",
242
+    "Super Cobra_(eks)",
243
+    "Star Wars - Death Star Battle_(eks)",
244
+    "Tutankham_(eks)",
245
+    "Star Wars - The Arcade Game (proto)",
246
+    "Star Wars - The Arcade Game (PAL)",
247
+    "Frogger II - Threedeep! (PAL)",
248
+    "Gyruss (PAL)",
249
+	"Star Wars - Ewok Adventure (proto) (PAL)",
250
+	"Star Wars - Ewok Adv. T Jentzsch PAL->NTSC (proto)",
251
+	"Lord of the Rings (proto)",
252
+    ""
253
+};
254
+
255
+dd  BS_4[] = {
256
+    0x584f6777, /* Espial [b].bin */
257
+    0x8d70fa42, /* Espial.bin */
258
+    0x8beb03d4, /* Miner 2049er [b1].bin */
259
+    0x33f2856f, /* Miner 2049er [b2].bin */
260
+    0xf859122e, /* Miner 2049er Vol. 2 [b1].bin */
261
+    0x281a1ca1, /* Miner 2049er Vol. 2 [b2].bin */
262
+    0x350c63ba, /* Miner 2049er Vol. 2.bin */
263
+    0x728b941c, /* Miner 2049er.bin */
264
+    0x13bf2da3, /* Polaris [b].bin */
265
+    0x7ce5312e, /* Polaris.bin */
266
+    0x40706361, /* River Patrol (Tigervision).bin */
267
+    0x2c34898f, /* Springer.bin */
268
+    0x09a71583, /* Miner 2049er PAL */
269
+    0xd5645294, /* Miner Volume 2 NTSC */
270
+	0x52630ec9, /* Polaris T. Jentzsch PAL to NTSC conversion*/
271
+    -1
272
+};
273
+
274
+char BS_4_DESC[][30] = {
275
+    "Espial [b]",
276
+    "Espial",
277
+    "Miner 2049er [b1]",
278
+    "Miner 2049er [b2]",
279
+    "Miner 2049er Vol. 2 (PAL)[b1]",
280
+    "Miner 2049er Vol. 2 (PAL)[b2]",
281
+    "Miner 2049er Vol. 2 (PAL)",
282
+    "Miner 2049er",
283
+    "Polaris [b] (PAL)",
284
+    "Polaris (PAL)",
285
+    "River Patrol (Tigervision)",
286
+    "Springer",
287
+	"Miner 2049er PAL",
288
+	"Miner 2049er Vol. 2",
289
+	"Polaris (T Jentzsch NTSC->PAL)",
290
+    -1
291
+};
292
+
293
+dd  BS_5[] = {
294
+    0x7d23e780, /* Decathlon.bin */
295
+    0xa51c0236, /* Robot Tank.bin */
296
+    0xd8ecf576, /* Decathlon (PAL) */
297
+    0x0e8757b0, /* Robot Tank (PAL) */
298
+    0x94e8df6b, /* Space Shuttle (PAL) */
299
+	0xf3a4363c,	/* Thwocker prototype */
300
+    -1
301
+};
302
+
303
+char BS_5_DESC[][25] = {
304
+    "Decathlon",
305
+    "Robot Tank",
306
+    "Decathlon (PAL)",
307
+    "Robot Tank (PAL)",
308
+    "Space Shuttle (PAL)",
309
+	"Thwocker (proto)",
310
+    -1
311
+};
312
+
313
+dd	BS_9[] = {
314
+	0x6a31beac,	/* Private Eye (CCE).bin */
315
+	0x3fa749c0,	/* Private Eye [b].bin */
316
+	0x33242242,	/* Private Eye.bin */
317
+	-1
318
+};
319
+
320
+char BS_9_DESC[][20] = {
321
+    "Private Eye (CCE)",
322
+    "Private Eye [b]",
323
+    "Private Eye",
324
+    -1
325
+};
326
+
327
+
328
+dd  BS_6[] = {
329
+    0xa972c32b, /* Dig Dug.bin */
330
+    0x66cdb94b, /* Off the Wall [o].bin */
331
+    0xbd75d92b, /* Off the Wall.bin */
332
+    -1
333
+};
334
+
335
+char BS_6_DESC[][20] = {
336
+    "Dig Dug.bin",
337
+    "Off the Wall [o]",
338
+    "Off the Wall",
339
+    -1
340
+};
341
+
342
+dd  BS_7[] = {
343
+    0x8eed6b02, /* Bump n Jump [b].bin */
344
+    0xd523e776, /* Bump n Jump.bin */
345
+    0x24c35820, /* Burgertime.bin */
346
+    0x5c161fe4, /* Masters of the Universe - The Power of He-Man.bin */
347
+    -1
348
+};
349
+
350
+char BS_7_DESC[][50] = {
351
+    "Bump n Jump [b].bin",
352
+    "Bump n Jump.bin",
353
+    "Burgertime.bin",
354
+    "Masters of the Universe - The Power of He-Man",
355
+    -1
356
+};
357
+
358
+/*
359
+dd  BS_8[] = {
360
+        0xbe1047cf,      Fatal Run (PAL).bin
361
+    -1
362
+};
363
+*/
364
+
365
+dd crc;         /* holds accumulated CRC */
366
+dd crctab[256];     /* table to help CRC calculation */
367
+
368
+#define CRC16_REV 0xA001    /* CRC-16 polynomial reversed */
369
+#define CRC32_REV 0xA0000001    /* CRC-32 polynomial reversed */
370
+#define SQUARE_WAVE 0
371
+#define SINE_WAVE   1
372
+void make16BitStereo(char *sineWave, int *sineWaveLength);

+ 378
- 378
makewav.txt View File

@@ -1,378 +1,378 @@
1
-                           M A K E W A V    4 . 2
2
-
3
-    Makewav converts ROM images for the Atari 2600 into .wav files that
4
-can be transfered into a Cuttle Cart or Supercharger for play on an original
5
-Atari 2600.
6
-
7
-    For the Supercharger:
8
-            It can convert Supercharger ROM images (6k, 8448 bytes and 32k)
9
-        into .wav files for use with the Supercharger.  It can also convert
10
-        2k and 4k ROM images that were never intended to be played on the
11
-        Supercharger.  The 2k and 4k images may not work with an unmodified
12
-        Supercharger.
13
-
14
-    For the Cuttle Cart:
15
-            It can convert almost every ROM image ever made for the Atari
16
-        2600 (the single known exception being Pitfall II) into .wav files
17
-        for use with the Cuttle Cart.
18
-
19
-    Version 4.2 of makewav has been heavily enhanced from the previous
20
-major version (3.1).  If you are familiar with a previous version of makewav,
21
-you should read this document in full before attempting to use this version.
22
-
23
-New to version 4.2:
24
-
25
-- Bug Fix
26
-
27
-Suggested command line to create game.wav:
28
-
29
-  Cuttle Cart:
30
-
31
-     makewav game.bin
32
-
33
-  Supercharger:
34
-     
35
-     makewav -ts game.bin
36
-
37
-Advanced Features:
38
-  
39
-  Converting multiple files:
40
-      You can convert multiple files by listing each game separated by a
41
-    space.  The ROM files to be converted to .wav files should be listed
42
-    after all option flags. An example to convert game1.bin, game2.bin
43
-    and game3.bin to game1.wav, game2.wav and game3.wav respectively for
44
-    use with the Supercharger follows:
45
-      
46
-      makewav -ts game1.bin game2.bin game3.bin
47
-
48
-  Multi-load .wav files:
49
-    
50
-      It is possible to create .wav files that contain multiple loads.
51
-    If you are familiar with the original Supercharger games, you will
52
-    recall that the audio tape contained all of the loads strung together
53
-    on the tape with no audio gaps between the loads.  This can be
54
-    accomplished with makewav by listing the files to string together
55
-    separated by a "+" (plus sign). An example follows:
56
-
57
-          makewav -omultiload.wav load1.bin+load2.bin+load3.bin
58
-
59
-      The command line above will create a .wav file named "multiload.wav"
60
-    containing load1.bin, load2.bin, load3.bin with a 1 second header tone,
61
-    a 1.5 second tone between each load and a .25 seconde trailer tone.
62
-    Note that the -o flag was used to designate the name of the output
63
-    file.  If the -o flag were ommitted, the .wav file would be named
64
-    "load1.wav" by using the name of the first ROM image.
65
-
66
-  WildCards:
67
-
68
-      Batch conversion is now possible with the use of wildcards in the
69
-    filename.  Including b*.bin would convert all ROM images in the
70
-    current directory starting with "b" to .wav files.
71
-
72
-
73
-Option Flags:
74
-
75
-    Flags can be used to modify the way makewav creates a .wav file.  If
76
-  multiple .wav files are created, the flags affect all of them.  The
77
-  details of each available flag follows.
78
-
79
-  Flag  (Default)
80
-        Description
81
-
82
-  -b -> (default is to have value automatically determined)
83
-        Sets the bankswitch mode to use for the .wav file.  The possible
84
-        values are:  2K, CV, 4K, F8SC, F8, FE, 3F, E0, FANR, FA, F6SC,
85
-                     F6, E7, E7NR, F4SC, F4 and MB
86
-  
87
-  -c -> (default is to have value automatically determined)
88
-        The -c must be followed by a 2 digit hex number (e.g. -c0d not -cd).
89
-        If this flag is used in conjunction with the -b flag, the value
90
-        provided will override the control byte value associated with the
91
-        bankswitch mode chosen.  It also overrides the control byte stored
92
-        in the Supercharger ROM images.
93
-
94
-        The Cuttle Cart manual provides a detailed description of the
95
-        control byte values necessary for the Cuttle Cart.
96
-
97
-        For the Supercharger the number is generated as described below.
98
-
99
-             Bits                Function
100
-             ------              --------
101
-             D7-D5               Write Pulse Delay (Set to 0)
102
-             D4-D2               RAM/ROM Configuration
103
-
104
-                                 D4 D3 D2      $f000     $f800
105
-                                 --------      -----     -----
106
-                                  0  0  0        3        ROM
107
-                                  0  0  1        1        ROM
108
-                                  0  1  0        3         1
109
-                                  0  1  1        1         3
110
-                                  1  0  0        3        ROM
111
-                                  1  0  1        2        ROM
112
-                                  1  1  0        3         2
113
-                                  1  1  1        2         3
114
-
115
-             D1                   If 0 RAM is Write PROTECTED
116
-                                  If 1 RAM is Write ENABLED
117
-
118
-             D0                   If 0 ROM power is ON
119
-                                  If 1 ROM power is OFF
120
-
121
-             (Note: Make sure to power ROM off if you are converting
122
-              a .bin file that is running on a modified Supercharger.
123
-              This activates the modification so that games that don't
124
-              work on unmodified Superchargers will not crash!)
125
-
126
-  -d -> (default = 1)
127
-        This flag causes detailed information about the .bin file being
128
-        converted to be displayed.
129
-        
130
-        Value   Information
131
-        -----   -------------------------------------------------------
132
-          0     None
133
-          1     Number of files being created, frequency, header tone
134
-                length (in seconds), the bit length (see -0 and -1
135
-                flags) and the name of each ROM image being converted.
136
-          2     All above information plus bankswitch type, file size,
137
-                start address, multi-load byte, page count, control byte
138
-                and the number of blank pages in the Rom image.
139
-          3     All above information plus, for each page, bank #, page#,
140
-                bank&page byte and checksum.
141
-       
142
-                File Page #    - The page # of the .bin file
143
-                                 (256 bytes/page).
144
-                Bank #         - The bank this page will be loaded into.
145
-                Page #         - The page # of the bank this page will
146
-                                 load into.
147
-                page&bank byte - The value used by the Supercharger to
148
-                                 determine the bank and page number to
149
-                                 load the current page from the .bin file
150
-                                 into.  This is determined by
151
-                                 (page * 4) + bank, where banks range from
152
-                                 0-2 and pages range from 0-7.
153
-                Checksum byte  - The value of the checksum for the current
154
-                                 page.
155
-
156
-        What follows is a sample output from Makewav while converting
157
-        Suicid23.bin (a cut down 8448 byte version even though the original
158
-        32k version will work too) from the Supercharger CD.  The command
159
-        line used was:
160
-
161
-        makewav -d3 -ts suicid23.bin
162
-
163
-        Converting 1 file for use with the Supercharger:
164
-          Using 44khz .wav format with a 1.00 second header tone
165
-          (zero bit/one bit) lengths = (6/10)
166
-        SUICID23.BIN 
167
-          Bankswitch type   = Supercharger
168
-          File size         = 8448   Start address     = $fe00
169
-          Multi-Load byte   = $00    Page count        = $13
170
-          Control-byte      = $0f    Blank pages       = $05
171
-         - bank 00, page 00, page&bank byte 00, checksum 07
172
-         - bank 00, page 01, page&bank byte 04, checksum 82
173
-         - bank 00, page 02, page&bank byte 08, checksum 81
174
-         - bank 00, page 03, page&bank byte 0c, checksum 00
175
-         - bank 00, page 04, page&bank byte 10, checksum bb
176
-         - bank 00, page 05, page&bank byte 14, checksum 21
177
-         - bank 00, page 06, page&bank byte 18, checksum 2a
178
-         - bank 00, page 07, page&bank byte 1c, checksum eb
179
-         - bank 01, page 00, page&bank byte 01, checksum 44
180
-         - bank 01, page 01, page&bank byte 05, checksum d0
181
-         - bank 01, page 02, page&bank byte 09, checksum 65
182
-         - bank 01, page 03, page&bank byte 0d, checksum 8a
183
-         - bank 01, page 04, page&bank byte 11, checksum e6
184
-         - bank 01, page 05, page&bank byte 15, checksum 13
185
-         - bank 01, page 06, page&bank byte 19, checksum 9c
186
-         - bank 01, page 07, page&bank byte 1d, checksum 5e
187
-         - bank 02, page 00, page&bank byte 02, checksum a0
188
-         - bank 02, page 06, page&bank byte 1a, checksum 81
189
-         - bank 02, page 07, page&bank byte 1e, checksum 17
190
-
191
-        As you can see, bank $02, pages $01 - $05 are blank, so they were
192
-        left out.  This doesn't cause a problem with this game, the blank
193
-        pages are just the area that represent the "bitmapped" area of RAM
194
-        in the game.  It is possible that some games may not work right
195
-        when a page is left out.  You can fix this by using the -p flag.
196
-
197
-  -f -> (default = 2)
198
-        This flag allows you to change the speed of the tranfer.  The valid
199
-        range is 0-4 and the higher the number the faster the load.  Don't
200
-        be surprised if the faster transfers are not reliable, they are
201
-        really pushing the limits of the audio circuitry.  Suggested values
202
-        for various media are:  Audio Cassette = 0, CD = 1 or 2,
203
-        Computer = 2, 3, or 4.
204
-
205
-  -h -> (default = 1)
206
-        Allows you to set the length of the header tone in seconds.  The
207
-        default length is 1 second.  Values between 0.5 and 10 inclusive
208
-        are valid.  This flag is useful if you are going to make a tape
209
-        or CD track and need a little bit longer header.  This also
210
-        affects the length of the tones between any chained loads.  A tone
211
-        between chained loads is 2 times as long as the header tone.  The
212
-        footer tone is always 0.5 times as long as the header tone.
213
-
214
-  -i -> (default = 0.1)
215
-        Sets the length of the clearing tone.  This tone clears the audio
216
-        circuits of the Supercharger and Cuttle Cart.  Modifying the length
217
-        of this tone can aid getting the faster .wav files to load properly.
218
-        Generally you should not need to use this flag.
219
-
220
-  -k -> (default = 1)
221
-        Sets the .wav file format to use.  Format 0 is 8-bit mono 22khz,
222
-        format 1 is 8-bit mono 44khz, format 2 is 16-bit stereo 44khz.  You
223
-        really don't need to use format 2 unless you are creating a CD and
224
-        you recording software insists on having a 16-bit stereo 44khz .wav
225
-        file.  The format 2 files are much larger than the other formats and
226
-        do not provide any increase in quality over format 1 files.
227
-
228
-  -m -> (default = 00 for non-Supercharger games and values stored in ROM
229
-         image for Supercharger games)
230
-        The -m must be followed by a 2 digit hex number (e.g. -m0d not -md).
231
-        This number is used to indicate a unique load number.  If the code
232
-        is looking for load $0d and load $0f is transfered to it, the
233
-        Supercharger will return to either a black screen (if there is
234
-        a header tone between the loads) or to the "Press Play" screen and
235
-        wait until load $0d is played.  This overrides the multi-load byte
236
-        in the 8448 byte .bin files and those in Supercharger ROM images.
237
-
238
-  -o -> (default = romfile.wav where romfile is the name of the ROM file)
239
-        The file name of the .wav file created.  This flag should contain
240
-        the name of the output file when only one .wav file will be created
241
-        by makewav (Including a single multi-load .wav file, where the default
242
-        is the name of the first ROM file of the multi-load game).  If more
243
-        than one .wav file is being created, the flag should contain the
244
-        path of the destination files.
245
-
246
-  -p -> (not set by default)
247
-        Turns "blank page packing" OFF.  Makewav by default looks for pages
248
-        of the ROM image in which all of the bytes are the same value.  This
249
-        usually indicates "filler" in the .bin file and can be eliminated
250
-        most of the time.  If a particular game does not work, and you notice
251
-        that when using the -d flag that there are "blank" pages, try using
252
-        the -p flag.
253
-
254
-  -r -> (not set by default)
255
-        Causes a raw binary image of the data to be created instead of a
256
-        .wav file.  This includes the header tone (a series of $55's if the
257
-        raw file is viewed with a hex editor),the 8-byte game header, the
258
-        page headers, and the footer tone.  This does not include the
259
-        clearing tone since that doesn't represent any digital data.  This
260
-        is not only useful for debugging makewav, but also for creating
261
-        precalculated data for possibly a dedicated device that plays the
262
-        tones necessary to load games into the Supercharger or the Cuttle
263
-        Cart.
264
-
265
-  -s -> (default is to have value automatically determined)
266
-        Forces a starting address for the code.  The address must be a
267
-        2 byte, 4 digit hex number (e.g. -sf123 not -s123) in hi/lo format.
268
-        This will override all start addresses, including those in the
269
-        8448 byte .bin files and the .bin files on the Supercharger CD.
270
-
271
-  -t -> (default = c)
272
-        Determines which device the .wav files are created for.  For the
273
-        Cuttle Cart the value is "c" and for the Supercharger the value is
274
-        "s".
275
-
276
-  -v -> (default = 10)
277
-        Sets the volume or amplitude of the .wav file.  This was added
278
-        because there was concern that some .wav players didn't like the
279
-        .wav having the max values in the waveforms.  Valid values are 1-10
280
-        inclusive.  The defualt volume is 10, so there should be no reason
281
-        to ever actually use 10 :)
282
-
283
-  -w -> (default = 0)
284
-        Sets the type of wave form to use.  0 (zero) is for square-waves,
285
-        1 (one) is for sine-waves.  The control tone is always sent as a
286
-        sine-wave.
287
-
288
-  -0 -> (default determined by the -f and -k flags)
289
-        The number of bytes that make up the sine waveform that represents
290
-        a zero bit in the .wav file.  The valid range is 1 - 80.  The larger
291
-        the number the slower the .wav file will load.  Additionally, the
292
-        ratio of the 0 bit length to the 1 bit length should be approximately
293
-        0.5 to 0.75.
294
-
295
-  -1 -> (default determined by the -f and -k flags)
296
-        The number of bytes that make up the sine waveform that represents
297
-        a one bit in the .wav file.  The valid range is 1 - 80.  The larger
298
-        the number the slower the .wav file will load.  Additionally, the
299
-        ratio of the 0 bit length to the 1 bit length should be approximately
300
-        0.5 to 0.75.
301
-
302
-    The .wav files are generally fairly large, but they pack very well,
303
-sometimes to 6k or so.  This is because of the repetition involved.  Each
304
-"one bit" is the same as every other "one bit" and the same with the
305
-"zero bits".
306
-
307
-    Well, have fun, and if you make any cool games, drop me an e-mail!
308
-(heck, even if you make a lame game I'd like to see it).
309
-
310
-        Now for the boring stuff:  I hereby place this program into the
311
-public domain.  I am not responsible for any damage this program may cause.
312
-I am not liable for any misuse, intentional or otherwise, of this program.
313
-There is no warranty, written or implied, on this program.  The user uses
314
-this program at his or her own risk!
315
-
316
-                                
317
-                                        Bob Colbert
318
-                                        CEO of RetroWare
319
-                                        rcolbert@oasis.novia.net
320
-                                        http://www.novia.net/~rcolbert
321
-
322
-
323
-Version History:
324
-
325
-New to version 4.2:
326
-
327
-- Bug fix
328
-
329
-New to version 4.1:
330
-
331
-- Compiles in Linux.
332
-- Creates 16-bit Stereo 44khz .wav files (-k3 flag) which are requireded by
333
-  some CD authoring software.
334
-- Ability to choose Sine Wave Waveforms (-w1 flag).
335
-- Rewrote waveform generating routine to create sine waves.
336
-- Square wave "polarity" no longer inverted when compared to the clearing
337
-  tone.
338
-
339
-New to version 4.0:
340
-
341
-- Creates Cuttle Cart compatible .wav files!
342
-- Automatic bankswitching recognition for all methods supported by the Cuttle
343
-  Cart.
344
-- Wildcard recognition!  Now you can convert an entire directory of ROM images
345
-  into .wav files with one command.
346
-- Lightning mode!  Even faster loads than the fastest loads in the previous
347
-  version.
348
-
349
-New to version 3.1:
350
-
351
-- 'v' flag added that allows you to set the volume of the .wav file, some
352
-  people were concerned that their .wav player didn't like having the .wav
353
-  with the maximum volume level set.
354
-- 'r' flag added which causes a raw data file to be created instead of a
355
-  .wav file.  This raw file is the byte stream that the Supercharger reads
356
-  from the tape.
357
-- Games can now be "chained" together.  This allows you to recreate your
358
-  Supercharger tapes!  Each load is seperated by a tone with no silence
359
-  gap.
360
-- Restructured the way the header and footer tones are written for a more
361
-  straight-forward program flow.
362
-
363
-New to version 3.0:
364
-
365
-- multi-load byte command flag now works correctly (-m flag).
366
-- Correctly handles all .bin files on the Supercharger CD.
367
-- 'd' flag added that shows detailed debugging information about
368
-  the .bin file.
369
-- Makewav now determines that a page (256 byte chunk) of the .bin file is
370
-  empty if all of the bytes in that page are identical.  It automatically
371
-  leaves this page out of the .wav file.  This is great if you are developing
372
-  a game and have a very small piece of code!  This can be overridden with
373
-  the -p flag, which will force Makewav to include every page in the .wav
374
-  file.
375
-
376
-Below version 3.0
377
-
378
-- version history was not kept prior to version 3.0
1
+                           M A K E W A V    4 . 2
2
+
3
+    Makewav converts ROM images for the Atari 2600 into .wav files that
4
+can be transfered into a Cuttle Cart or Supercharger for play on an original
5
+Atari 2600.
6
+
7
+    For the Supercharger:
8
+            It can convert Supercharger ROM images (6k, 8448 bytes and 32k)
9
+        into .wav files for use with the Supercharger.  It can also convert
10
+        2k and 4k ROM images that were never intended to be played on the
11
+        Supercharger.  The 2k and 4k images may not work with an unmodified
12
+        Supercharger.
13
+
14
+    For the Cuttle Cart:
15
+            It can convert almost every ROM image ever made for the Atari
16
+        2600 (the single known exception being Pitfall II) into .wav files
17
+        for use with the Cuttle Cart.
18
+
19
+    Version 4.2 of makewav has been heavily enhanced from the previous
20
+major version (3.1).  If you are familiar with a previous version of makewav,
21
+you should read this document in full before attempting to use this version.
22
+
23
+New to version 4.2:
24
+
25
+- Bug Fix
26
+
27
+Suggested command line to create game.wav:
28
+
29
+  Cuttle Cart:
30
+
31
+     makewav game.bin
32
+
33
+  Supercharger:
34
+     
35
+     makewav -ts game.bin
36
+
37
+Advanced Features:
38
+  
39
+  Converting multiple files:
40
+      You can convert multiple files by listing each game separated by a
41
+    space.  The ROM files to be converted to .wav files should be listed
42
+    after all option flags. An example to convert game1.bin, game2.bin
43
+    and game3.bin to game1.wav, game2.wav and game3.wav respectively for
44
+    use with the Supercharger follows:
45
+      
46
+      makewav -ts game1.bin game2.bin game3.bin
47
+
48
+  Multi-load .wav files:
49
+    
50
+      It is possible to create .wav files that contain multiple loads.
51
+    If you are familiar with the original Supercharger games, you will
52
+    recall that the audio tape contained all of the loads strung together
53
+    on the tape with no audio gaps between the loads.  This can be
54
+    accomplished with makewav by listing the files to string together
55
+    separated by a "+" (plus sign). An example follows:
56
+
57
+          makewav -omultiload.wav load1.bin+load2.bin+load3.bin
58
+
59
+      The command line above will create a .wav file named "multiload.wav"
60
+    containing load1.bin, load2.bin, load3.bin with a 1 second header tone,
61
+    a 1.5 second tone between each load and a .25 seconde trailer tone.
62
+    Note that the -o flag was used to designate the name of the output
63
+    file.  If the -o flag were ommitted, the .wav file would be named
64
+    "load1.wav" by using the name of the first ROM image.
65
+
66
+  WildCards:
67
+
68
+      Batch conversion is now possible with the use of wildcards in the
69
+    filename.  Including b*.bin would convert all ROM images in the
70
+    current directory starting with "b" to .wav files.
71
+
72
+
73
+Option Flags:
74
+
75
+    Flags can be used to modify the way makewav creates a .wav file.  If
76
+  multiple .wav files are created, the flags affect all of them.  The
77
+  details of each available flag follows.
78
+
79
+  Flag  (Default)
80
+        Description
81
+
82
+  -b -> (default is to have value automatically determined)
83
+        Sets the bankswitch mode to use for the .wav file.  The possible
84
+        values are:  2K, CV, 4K, F8SC, F8, FE, 3F, E0, FANR, FA, F6SC,
85
+                     F6, E7, E7NR, F4SC, F4 and MB
86
+  
87
+  -c -> (default is to have value automatically determined)
88
+        The -c must be followed by a 2 digit hex number (e.g. -c0d not -cd).
89
+        If this flag is used in conjunction with the -b flag, the value
90
+        provided will override the control byte value associated with the
91
+        bankswitch mode chosen.  It also overrides the control byte stored
92
+        in the Supercharger ROM images.
93
+
94
+        The Cuttle Cart manual provides a detailed description of the
95
+        control byte values necessary for the Cuttle Cart.
96
+
97
+        For the Supercharger the number is generated as described below.
98
+
99
+             Bits                Function
100
+             ------              --------
101
+             D7-D5               Write Pulse Delay (Set to 0)
102
+             D4-D2               RAM/ROM Configuration
103
+
104
+                                 D4 D3 D2      $f000     $f800
105
+                                 --------      -----     -----
106
+                                  0  0  0        3        ROM
107
+                                  0  0  1        1        ROM
108
+                                  0  1  0        3         1
109
+                                  0  1  1        1         3
110
+                                  1  0  0        3        ROM
111
+                                  1  0  1        2        ROM
112
+                                  1  1  0        3         2
113
+                                  1  1  1        2         3
114
+
115
+             D1                   If 0 RAM is Write PROTECTED
116
+                                  If 1 RAM is Write ENABLED
117
+
118
+             D0                   If 0 ROM power is ON
119
+                                  If 1 ROM power is OFF
120
+
121
+             (Note: Make sure to power ROM off if you are converting
122
+              a .bin file that is running on a modified Supercharger.
123
+              This activates the modification so that games that don't
124
+              work on unmodified Superchargers will not crash!)
125
+
126
+  -d -> (default = 1)
127
+        This flag causes detailed information about the .bin file being
128
+        converted to be displayed.
129
+        
130
+        Value   Information
131
+        -----   -------------------------------------------------------
132
+          0     None
133
+          1     Number of files being created, frequency, header tone
134
+                length (in seconds), the bit length (see -0 and -1
135
+                flags) and the name of each ROM image being converted.
136
+          2     All above information plus bankswitch type, file size,
137
+                start address, multi-load byte, page count, control byte
138
+                and the number of blank pages in the Rom image.
139
+          3     All above information plus, for each page, bank #, page#,
140
+                bank&page byte and checksum.
141
+       
142
+                File Page #    - The page # of the .bin file
143
+                                 (256 bytes/page).
144
+                Bank #         - The bank this page will be loaded into.
145
+                Page #         - The page # of the bank this page will
146
+                                 load into.
147
+                page&bank byte - The value used by the Supercharger to
148
+                                 determine the bank and page number to
149
+                                 load the current page from the .bin file
150
+                                 into.  This is determined by
151
+                                 (page * 4) + bank, where banks range from
152
+                                 0-2 and pages range from 0-7.
153
+                Checksum byte  - The value of the checksum for the current
154
+                                 page.
155
+
156
+        What follows is a sample output from Makewav while converting
157
+        Suicid23.bin (a cut down 8448 byte version even though the original
158
+        32k version will work too) from the Supercharger CD.  The command
159
+        line used was:
160
+
161
+        makewav -d3 -ts suicid23.bin
162
+
163
+        Converting 1 file for use with the Supercharger:
164
+          Using 44khz .wav format with a 1.00 second header tone
165
+          (zero bit/one bit) lengths = (6/10)
166
+        SUICID23.BIN 
167
+          Bankswitch type   = Supercharger
168
+          File size         = 8448   Start address     = $fe00
169
+          Multi-Load byte   = $00    Page count        = $13
170
+          Control-byte      = $0f    Blank pages       = $05
171
+         - bank 00, page 00, page&bank byte 00, checksum 07
172
+         - bank 00, page 01, page&bank byte 04, checksum 82
173
+         - bank 00, page 02, page&bank byte 08, checksum 81
174
+         - bank 00, page 03, page&bank byte 0c, checksum 00
175
+         - bank 00, page 04, page&bank byte 10, checksum bb
176
+         - bank 00, page 05, page&bank byte 14, checksum 21
177
+         - bank 00, page 06, page&bank byte 18, checksum 2a
178
+         - bank 00, page 07, page&bank byte 1c, checksum eb
179
+         - bank 01, page 00, page&bank byte 01, checksum 44
180
+         - bank 01, page 01, page&bank byte 05, checksum d0
181
+         - bank 01, page 02, page&bank byte 09, checksum 65
182
+         - bank 01, page 03, page&bank byte 0d, checksum 8a
183
+         - bank 01, page 04, page&bank byte 11, checksum e6
184
+         - bank 01, page 05, page&bank byte 15, checksum 13
185
+         - bank 01, page 06, page&bank byte 19, checksum 9c
186
+         - bank 01, page 07, page&bank byte 1d, checksum 5e
187
+         - bank 02, page 00, page&bank byte 02, checksum a0
188
+         - bank 02, page 06, page&bank byte 1a, checksum 81
189
+         - bank 02, page 07, page&bank byte 1e, checksum 17
190
+
191
+        As you can see, bank $02, pages $01 - $05 are blank, so they were
192
+        left out.  This doesn't cause a problem with this game, the blank
193
+        pages are just the area that represent the "bitmapped" area of RAM
194
+        in the game.  It is possible that some games may not work right
195
+        when a page is left out.  You can fix this by using the -p flag.
196
+
197
+  -f -> (default = 2)
198
+        This flag allows you to change the speed of the tranfer.  The valid
199
+        range is 0-4 and the higher the number the faster the load.  Don't
200
+        be surprised if the faster transfers are not reliable, they are
201
+        really pushing the limits of the audio circuitry.  Suggested values
202
+        for various media are:  Audio Cassette = 0, CD = 1 or 2,
203
+        Computer = 2, 3, or 4.
204
+
205
+  -h -> (default = 1)
206
+        Allows you to set the length of the header tone in seconds.  The
207
+        default length is 1 second.  Values between 0.5 and 10 inclusive
208
+        are valid.  This flag is useful if you are going to make a tape
209
+        or CD track and need a little bit longer header.  This also
210
+        affects the length of the tones between any chained loads.  A tone
211
+        between chained loads is 2 times as long as the header tone.  The
212
+        footer tone is always 0.5 times as long as the header tone.
213
+
214
+  -i -> (default = 0.1)
215
+        Sets the length of the clearing tone.  This tone clears the audio
216
+        circuits of the Supercharger and Cuttle Cart.  Modifying the length
217
+        of this tone can aid getting the faster .wav files to load properly.
218
+        Generally you should not need to use this flag.
219
+
220
+  -k -> (default = 1)
221
+        Sets the .wav file format to use.  Format 0 is 8-bit mono 22khz,
222
+        format 1 is 8-bit mono 44khz, format 2 is 16-bit stereo 44khz.  You
223
+        really don't need to use format 2 unless you are creating a CD and
224
+        you recording software insists on having a 16-bit stereo 44khz .wav
225
+        file.  The format 2 files are much larger than the other formats and
226
+        do not provide any increase in quality over format 1 files.
227
+
228
+  -m -> (default = 00 for non-Supercharger games and values stored in ROM
229
+         image for Supercharger games)
230
+        The -m must be followed by a 2 digit hex number (e.g. -m0d not -md).
231
+        This number is used to indicate a unique load number.  If the code
232
+        is looking for load $0d and load $0f is transfered to it, the
233
+        Supercharger will return to either a black screen (if there is
234
+        a header tone between the loads) or to the "Press Play" screen and
235
+        wait until load $0d is played.  This overrides the multi-load byte
236
+        in the 8448 byte .bin files and those in Supercharger ROM images.
237
+
238
+  -o -> (default = romfile.wav where romfile is the name of the ROM file)
239
+        The file name of the .wav file created.  This flag should contain
240
+        the name of the output file when only one .wav file will be created
241
+        by makewav (Including a single multi-load .wav file, where the default
242
+        is the name of the first ROM file of the multi-load game).  If more
243
+        than one .wav file is being created, the flag should contain the
244
+        path of the destination files.
245
+
246
+  -p -> (not set by default)
247
+        Turns "blank page packing" OFF.  Makewav by default looks for pages
248
+        of the ROM image in which all of the bytes are the same value.  This
249
+        usually indicates "filler" in the .bin file and can be eliminated
250
+        most of the time.  If a particular game does not work, and you notice
251
+        that when using the -d flag that there are "blank" pages, try using
252
+        the -p flag.
253
+
254
+  -r -> (not set by default)
255
+        Causes a raw binary image of the data to be created instead of a
256
+        .wav file.  This includes the header tone (a series of $55's if the
257
+        raw file is viewed with a hex editor),the 8-byte game header, the
258
+        page headers, and the footer tone.  This does not include the
259
+        clearing tone since that doesn't represent any digital data.  This
260
+        is not only useful for debugging makewav, but also for creating
261
+        precalculated data for possibly a dedicated device that plays the
262
+        tones necessary to load games into the Supercharger or the Cuttle
263
+        Cart.
264
+
265
+  -s -> (default is to have value automatically determined)
266
+        Forces a starting address for the code.  The address must be a
267
+        2 byte, 4 digit hex number (e.g. -sf123 not -s123) in hi/lo format.
268
+        This will override all start addresses, including those in the
269
+        8448 byte .bin files and the .bin files on the Supercharger CD.
270
+
271
+  -t -> (default = c)
272
+        Determines which device the .wav files are created for.  For the
273
+        Cuttle Cart the value is "c" and for the Supercharger the value is
274
+        "s".
275
+
276
+  -v -> (default = 10)
277
+        Sets the volume or amplitude of the .wav file.  This was added
278
+        because there was concern that some .wav players didn't like the
279
+        .wav having the max values in the waveforms.  Valid values are 1-10
280
+        inclusive.  The defualt volume is 10, so there should be no reason
281
+        to ever actually use 10 :)
282
+
283
+  -w -> (default = 0)
284
+        Sets the type of wave form to use.  0 (zero) is for square-waves,
285
+        1 (one) is for sine-waves.  The control tone is always sent as a
286
+        sine-wave.
287
+
288
+  -0 -> (default determined by the -f and -k flags)
289
+        The number of bytes that make up the sine waveform that represents
290
+        a zero bit in the .wav file.  The valid range is 1 - 80.  The larger
291
+        the number the slower the .wav file will load.  Additionally, the
292
+        ratio of the 0 bit length to the 1 bit length should be approximately
293
+        0.5 to 0.75.
294
+
295
+  -1 -> (default determined by the -f and -k flags)
296
+        The number of bytes that make up the sine waveform that represents
297
+        a one bit in the .wav file.  The valid range is 1 - 80.  The larger
298
+        the number the slower the .wav file will load.  Additionally, the
299
+        ratio of the 0 bit length to the 1 bit length should be approximately
300
+        0.5 to 0.75.
301
+
302
+    The .wav files are generally fairly large, but they pack very well,
303
+sometimes to 6k or so.  This is because of the repetition involved.  Each
304
+"one bit" is the same as every other "one bit" and the same with the
305
+"zero bits".
306
+
307
+    Well, have fun, and if you make any cool games, drop me an e-mail!
308
+(heck, even if you make a lame game I'd like to see it).
309
+
310
+        Now for the boring stuff:  I hereby place this program into the
311
+public domain.  I am not responsible for any damage this program may cause.
312
+I am not liable for any misuse, intentional or otherwise, of this program.
313
+There is no warranty, written or implied, on this program.  The user uses
314
+this program at his or her own risk!
315
+
316
+                                
317
+                                        Bob Colbert
318
+                                        CEO of RetroWare
319
+                                        rcolbert@oasis.novia.net
320
+                                        http://www.novia.net/~rcolbert
321
+
322
+
323
+Version History:
324
+
325
+New to version 4.2:
326
+
327
+- Bug fix
328
+
329
+New to version 4.1:
330
+
331
+- Compiles in Linux.
332
+- Creates 16-bit Stereo 44khz .wav files (-k3 flag) which are requireded by
333
+  some CD authoring software.
334
+- Ability to choose Sine Wave Waveforms (-w1 flag).
335
+- Rewrote waveform generating routine to create sine waves.
336
+- Square wave "polarity" no longer inverted when compared to the clearing
337
+  tone.
338
+
339
+New to version 4.0:
340
+
341
+- Creates Cuttle Cart compatible .wav files!
342
+- Automatic bankswitching recognition for all methods supported by the Cuttle
343
+  Cart.
344
+- Wildcard recognition!  Now you can convert an entire directory of ROM images
345
+  into .wav files with one command.
346
+- Lightning mode!  Even faster loads than the fastest loads in the previous
347
+  version.
348
+
349
+New to version 3.1:
350
+
351
+- 'v' flag added that allows you to set the volume of the .wav file, some
352
+  people were concerned that their .wav player didn't like having the .wav
353
+  with the maximum volume level set.
354
+- 'r' flag added which causes a raw data file to be created instead of a
355
+  .wav file.  This raw file is the byte stream that the Supercharger reads
356
+  from the tape.
357
+- Games can now be "chained" together.  This allows you to recreate your
358
+  Supercharger tapes!  Each load is seperated by a tone with no silence
359
+  gap.
360
+- Restructured the way the header and footer tones are written for a more
361
+  straight-forward program flow.
362
+
363
+New to version 3.0:
364
+
365
+- multi-load byte command flag now works correctly (-m flag).
366
+- Correctly handles all .bin files on the Supercharger CD.
367
+- 'd' flag added that shows detailed debugging information about
368
+  the .bin file.
369
+- Makewav now determines that a page (256 byte chunk) of the .bin file is
370
+  empty if all of the bytes in that page are identical.  It automatically
371
+  leaves this page out of the .wav file.  This is great if you are developing
372
+  a game and have a very small piece of code!  This can be overridden with
373
+  the -p flag, which will force Makewav to include every page in the .wav
374
+  file.
375
+
376
+Below version 3.0
377
+
378
+- version history was not kept prior to version 3.0

+ 93
- 93
queue.c View File

@@ -1,93 +1,93 @@
1
-/* queue.c */
2
-
3
-#include <stdio.h>
4
-#include <ctype.h>
5
-#include <string.h>
6
-#include <stdlib.h>
7
-#include "queue.h"
8
-/* allocates enough memory to store 1 q node */
9
-
10
-struct qnode *qalloc(void) {
11
-        return (struct qnode *) malloc(sizeof(struct qnode));
12
-}
13
-
14
-/* returns pointer to duplicate of s */
15
-
16
-struct qnode *qdup(struct qnode *s, int *fileCount)
17
-{
18
-        struct qnode *temp, *p;
19
-        p = NULL;
20
-        temp = s;
21
-        while (temp != NULL) {
22
-                p = addq(p,temp->fileName, fileCount);
23
-                temp = temp->next;
24
-        }
25
-        return p;
26
-}
27
-
28
-/* adds q node to tail of p - use form 'p = addq(p,w,t)' */
29
-
30
-struct qnode *addq(struct qnode *p, char *fileName, int *fileCount)
31
-{
32
-        if (p == NULL) {
33
-                p = qalloc();
34
-                strcpy(p->fileName, fileName);
35
-                p->next = NULL;
36
-                (*fileCount)++;
37
-        }
38
-        else if (strcmp(p->fileName, fileName))
39
-          p->next = addq(p->next, fileName, fileCount);
40
-        return p;        
41
-}
42
-
43
-/* remove node from head of p - use form 'p = delq(p)' */
44
-/* frees memory previously used by node deleted            */
45
-
46
-struct qnode *delq(struct qnode *p)
47
-{
48
-        struct qnode *t;
49
-        
50
-        t = p;
51
-        
52
-        if (p != NULL) {
53
-          t = p->next;
54
-          free(p);
55
-        }
56
-        
57
-        return t;
58
-} 
59
-
60
-/* deletes all nodes from queue pointed to by p */
61
-
62
-void clearq(struct qnode *p)
63
-{
64
-        while (p != NULL)
65
-                p = delq(p);
66
-}
67
-        
68
-/* prints all bursts in a q - used for debugging */
69
-
70
-void qprint(struct qnode *p)
71
-{
72
-        if (p != NULL) {
73
-                printf("FileName: %s\n",p->fileName);
74
-                qprint(p->next);
75
-        }
76
-}
77
-
78
-/*
79
-main()
80
-{
81
-    struct qnode *addresses;
82
-
83
-    addresses = NULL;
84
-
85
-    addresses = addq(addresses,0xfeac);
86
-    addresses = addq(addresses,0xfbba);
87
-    qprint(addresses);
88
-    printf("--\n");
89
-    printf("%0.4X\n",addresses->address);
90
-    addresses = delq(addresses);
91
-    printf("%0.4x\n",addresses->address);
92
-}
93
-*/
1
+/* queue.c */
2
+
3
+#include <stdio.h>
4
+#include <ctype.h>
5
+#include <string.h>
6
+#include <stdlib.h>
7
+#include "queue.h"
8
+/* allocates enough memory to store 1 q node */
9
+
10
+struct qnode *qalloc(void) {
11
+        return (struct qnode *) malloc(sizeof(struct qnode));
12
+}
13
+
14
+/* returns pointer to duplicate of s */
15
+
16
+struct qnode *qdup(struct qnode *s, int *fileCount)
17
+{
18
+        struct qnode *temp, *p;
19
+        p = NULL;
20
+        temp = s;
21
+        while (temp != NULL) {
22
+                p = addq(p,temp->fileName, fileCount);
23
+                temp = temp->next;
24
+        }
25
+        return p;
26
+}
27
+
28
+/* adds q node to tail of p - use form 'p = addq(p,w,t)' */
29
+
30
+struct qnode *addq(struct qnode *p, char *fileName, int *fileCount)
31
+{
32
+        if (p == NULL) {
33
+                p = qalloc();
34
+                strcpy(p->fileName, fileName);
35
+                p->next = NULL;
36
+                (*fileCount)++;
37
+        }
38
+        else if (strcmp(p->fileName, fileName))
39
+          p->next = addq(p->next, fileName, fileCount);
40
+        return p;        
41
+}
42
+
43
+/* remove node from head of p - use form 'p = delq(p)' */
44
+/* frees memory previously used by node deleted            */
45
+
46
+struct qnode *delq(struct qnode *p)
47
+{
48
+        struct qnode *t;
49
+        
50
+        t = p;
51
+        
52
+        if (p != NULL) {
53
+          t = p->next;
54
+          free(p);
55
+        }
56
+        
57
+        return t;
58
+} 
59
+
60
+/* deletes all nodes from queue pointed to by p */
61
+
62
+void clearq(struct qnode *p)
63
+{
64
+        while (p != NULL)
65
+                p = delq(p);
66
+}
67
+        
68
+/* prints all bursts in a q - used for debugging */
69
+
70
+void qprint(struct qnode *p)
71
+{
72
+        if (p != NULL) {
73
+                printf("FileName: %s\n",p->fileName);
74
+                qprint(p->next);
75
+        }
76
+}
77
+
78
+/*
79
+main()
80
+{
81
+    struct qnode *addresses;
82
+
83
+    addresses = NULL;
84
+
85
+    addresses = addq(addresses,0xfeac);
86
+    addresses = addq(addresses,0xfbba);
87
+    qprint(addresses);
88
+    printf("--\n");
89
+    printf("%0.4X\n",addresses->address);
90
+    addresses = delq(addresses);
91
+    printf("%0.4x\n",addresses->address);
92
+}
93
+*/

+ 11
- 11
queue.h View File

@@ -1,11 +1,11 @@
1
-/* structure to hold list of fileNames */
2
-
3
-struct qnode {
4
-    char   fileName[256];
5
-    struct qnode *next;
6
-};
7
-
8
-struct qnode *addq(struct qnode *, char *, int *);
9
-struct qnode *delq(struct qnode *);
10
-void qprint(struct qnode *);
11
-
1
+/* structure to hold list of fileNames */
2
+
3
+struct qnode {
4
+    char   fileName[256];
5
+    struct qnode *next;
6
+};
7
+
8
+struct qnode *addq(struct qnode *, char *, int *);
9
+struct qnode *delq(struct qnode *);
10
+void qprint(struct qnode *);
11
+

Loading…
Cancel
Save