Browse Source

stripped off all carrige returns

master
Sven Oliver Moll 3 months 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 @@
.SUFFIXES: .exe .o .c .pc
all:makewav
queue.o:
gcc -c queue.c
makewav: queue.o
gcc -lm -DLINUX -O queue.o -o makewav makewav.c
.SUFFIXES: .exe .o .c .pc
all:makewav
queue.o:
gcc -c queue.c
makewav: queue.o
gcc -lm -DLINUX -O queue.o -o makewav makewav.c

+ 60
- 60
find.c View File

@@ -1,61 +1,61 @@
/* FFIND.C: This program uses the 32-bit _find functions to print
* a list of all files (and their attributes) with a .C extension
* in the current directory.
*/
#include <stdio.h>
#include <string.h>
#include <io.h>
#include <time.h>
#include <stdlib.h>
#include "queue.h"
#include "find.h"
int myGlob( char *globString, struct qnode **fileNameQ, int *fileCount )
{
struct FINDDATA_TYPE c_file;
long hFile;
char full_path_buffer[_MAX_DRIVE+_MAX_DIR+_MAX_FNAME+_MAX_EXT];
char drive[_MAX_DRIVE];
char dir[_MAX_DIR];
char fname[_MAX_FNAME];
char ext[_MAX_EXT];
if (strchr(globString,'+') != NULL)
{
*fileNameQ = addq(*fileNameQ, globString, fileCount);
return 0;
}
_splitpath( globString, drive, dir, fname, ext );
#ifdef _WIN32
if( (hFile = _findfirst( globString, &c_file )) == -1L )
#else
if( (hFile = findfirst( globString, &c_file, 0 )) == -1L )
#endif
printf( "No files matching %s in current directory!\n", globString );
else
{
if (!(c_file.FFATTRIB & FA_DIREC))
sprintf(full_path_buffer,"%s%s%s",drive,dir,c_file.FFNAME);
*fileNameQ = addq(*fileNameQ, full_path_buffer, fileCount);
/* printf( " %-12s\n", c_file.FFNAME); */
/* Find the rest of the .c files */
#ifdef _WIN32
while( _findnext( hFile, &c_file ) == 0 )
#else
while( findnext( &c_file ) == 0 )
#endif
{
if (!(c_file.FFATTRIB & FA_DIREC))
sprintf(full_path_buffer,"%s%s%s",drive,dir,c_file.FFNAME);
*fileNameQ = addq(*fileNameQ, full_path_buffer, fileCount);
/* printf( " %-12s\n", c_file.FFNAME);*/
}
#ifdef _WIN32
_findclose( hFile );
#endif
/* qprint(fileNameQ); */
}
return 0;
/* FFIND.C: This program uses the 32-bit _find functions to print
* a list of all files (and their attributes) with a .C extension
* in the current directory.
*/
#include <stdio.h>
#include <string.h>
#include <io.h>
#include <time.h>
#include <stdlib.h>
#include "queue.h"
#include "find.h"
int myGlob( char *globString, struct qnode **fileNameQ, int *fileCount )
{
struct FINDDATA_TYPE c_file;
long hFile;
char full_path_buffer[_MAX_DRIVE+_MAX_DIR+_MAX_FNAME+_MAX_EXT];
char drive[_MAX_DRIVE];
char dir[_MAX_DIR];
char fname[_MAX_FNAME];
char ext[_MAX_EXT];
if (strchr(globString,'+') != NULL)
{
*fileNameQ = addq(*fileNameQ, globString, fileCount);
return 0;
}
_splitpath( globString, drive, dir, fname, ext );
#ifdef _WIN32
if( (hFile = _findfirst( globString, &c_file )) == -1L )
#else
if( (hFile = findfirst( globString, &c_file, 0 )) == -1L )
#endif
printf( "No files matching %s in current directory!\n", globString );
else
{
if (!(c_file.FFATTRIB & FA_DIREC))
sprintf(full_path_buffer,"%s%s%s",drive,dir,c_file.FFNAME);
*fileNameQ = addq(*fileNameQ, full_path_buffer, fileCount);
/* printf( " %-12s\n", c_file.FFNAME); */
/* Find the rest of the .c files */
#ifdef _WIN32
while( _findnext( hFile, &c_file ) == 0 )
#else
while( findnext( &c_file ) == 0 )
#endif
{
if (!(c_file.FFATTRIB & FA_DIREC))
sprintf(full_path_buffer,"%s%s%s",drive,dir,c_file.FFNAME);
*fileNameQ = addq(*fileNameQ, full_path_buffer, fileCount);
/* printf( " %-12s\n", c_file.FFNAME);*/
}
#ifdef _WIN32
_findclose( hFile );
#endif
/* qprint(fileNameQ); */
}
return 0;
}

+ 21
- 21
find.h View File

@@ -1,22 +1,22 @@
#ifdef _WIN32
#define FINDDATA_TYPE _finddata_t
#define FFATTRIB attrib
#define FFNAME name
#define FA_DIREC _A_SUBDIR
#else
#include <dir.h>
#define FINDDATA_TYPE ffblk
#define FFATTRIB ff_attrib
#define _findfirst findfirst
#define _makepath fnmerge
#define _splitpath fnsplit
#define FFNAME ff_name
#define _MAX_DRIVE MAXDRIVE
#define _MAX_PATH MAXPATH
#define _MAX_DIR MAXDIR
#define _MAX_FNAME MAXFILE
#define _MAX_EXT MAXEXT
#endif
#ifdef _WIN32
#define FINDDATA_TYPE _finddata_t
#define FFATTRIB attrib
#define FFNAME name
#define FA_DIREC _A_SUBDIR
#else
#include <dir.h>
#define FINDDATA_TYPE ffblk
#define FFATTRIB ff_attrib
#define _findfirst findfirst
#define _makepath fnmerge
#define _splitpath fnsplit
#define FFNAME ff_name
#define _MAX_DRIVE MAXDRIVE
#define _MAX_PATH MAXPATH
#define _MAX_DIR MAXDIR
#define _MAX_FNAME MAXFILE
#define _MAX_EXT MAXEXT
#endif
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 @@
#define BSM_2K 0
#define BSM_CV 1
#define BSM_4K 2
#define BSM_28SC 3
#define BSM_F8SC 4
#define BSM_28 5
#define BSM_F8 6
#define BSM_FE 7
#define BSM_3F 8
#define BSM_E0 9
#define BSM_FA 10
#define BSM_2A 11
#define BSM_3A 12
#define BSM_FANR 13
#define BSM_2ANR 14
#define BSM_3ANR 15
#define BSM_46SC 16
#define BSM_F6SC 17
#define BSM_26SC 18
#define BSM_36SC 19
#define BSM_46 20
#define BSM_F6 21
#define BSM_26 22
#define BSM_36 23
#define BSM_E7 24
#define BSM_E7NR 25
#define BSM_F4SC 26
#define BSM_24SC 27
#define BSM_34SC 28
#define BSM_44SC 29
#define BSM_F4 30
#define BSM_24 31
#define BSM_34 32
#define BSM_44 33
#define BSM_MB 34
#define FMT_22KHZ_8BIT_MONO 0
#define FMT_44KHZ_8BIT_MONO 1
#define FMT_44KHZ_16BIT_STEREO 2
#define METER_LENGTH 32
#define DISPLAY_NOTHING 0
#define DISPLAY_FILENAME 1
#define DISPLAY_SUMMARY 2
#define DISPLAY_DETAILS 3
#ifdef __linux__
#define _MAX_FNAME 256
#define _MAX_PATH 256
#define _MAX_DIR 256
#define _MAX_DRIVE 256
#define _MAX_EXT 256
#else
#include "find.h"
#endif
typedef unsigned long int dd;
typedef unsigned short int dw;
typedef int db;
struct parmFlags
{
int dflag;
int fflag;
int kflag;
int wflag;
int stereoFlag;
int mflag;
int pflag;
int sflag;
int vflag;
char tflag;
int zeroBitLength;
int oneBitLength;
int control;
int createMode;
int binFileCount;
int bankSwitchMode;
float headerSeconds;
float clearingSeconds;
float hlength;
char wavFileName[_MAX_FNAME];
char fullPath[_MAX_PATH];
struct qnode *binFileQ;
unsigned int multi;
unsigned int volume;
unsigned char startHi;
unsigned char startLo;
};
char bankSwitchList[][5] =
{"2K", "CV", "4K", "28SC", "F8SC", "28", "F8", "FE",
"3F", "E0", "FA", "2A", "3A", "FANR", "2ANR", "3ANR",
"46SC","F6SC", "26SC", "36SC", "46", "F6", "26", "36",
"E7", "E7NR", "F4SC", "24SC", "34SC", "44SC", "F4", "24",
"34", "44", "MB", ""};
unsigned int controlByteList[] =
{0xCA, 0xEA, 0xC8, 0xF6, 0xE6, 0xD6, 0xC6, 0xCC,
0xCE, 0xC1, 0xE0, 0xF0, 0x60, 0xC0, 0xD0, 0x40,
0x74, 0xE4, 0xF4, 0x64, 0x54, 0xC4, 0xD4, 0x44,
0xE3, 0xC3, 0xE2, 0xF2, 0x62, 0x72, 0xC2, 0xD2,
0x42, 0x52, 0xC9, 0x00};
int fileSizeList[] =
{2048, 2048, 4096, 8192, 8192, 8192, 8192, 8192,
8192, 8192, 12288, 12288, 12288, 12288, 12288, 12288,
16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
16384, 16384, 32768, 32768, 32768, 32768, 32768, 32768,
32768, 32768, 65536, 0};
int startPageList[] =
{7, 7, 15, 31, 15, 31, 15, 15,
31, 31, 15, 31, 47, 15, 31, 47,
63, 15, 31, 47, 63, 15, 31, 47,
63, 63, 15, 31, 47, 63, 15, 31,
47, 63, 15, 0};
int clearingToneLength[2] = {26, 51};
unsigned char clearingTone[256];
int zeroBitLength,
oneBitLength;
unsigned char zeroBit[256],
oneBit[256];
/* speed, khz, bit */
int bitLength[5][2][2] =
{
{{5,9},{15,21}},
{{3,7},{ 6,10}},
{{3,5},{ 5, 8}},
{{3,5},{ 4, 8}},
{{3,5},{ 4, 7}}
};
unsigned char header[3][80]=
{
{'R','I','F','F',0x80,0x80,0x80,0x80, /* RIFF TAG */
'W','A','V','E', /* WAV TAG */
'f','m','t',' ',0x10,0,0,0, /* FMT TAG */
1,0, /* format (WAVE_FORMAT_PCM) */
1,0, /* CHANNELS */
0x22,0x56,0,0, /* SamplesPerSec */
0x22,0x56,0,0, /* BytesPerSec */
1,0, /* Block align */
8,0, /* Bits per sample */
'd','a','t','a',0,0,0,0,'\0'/* DATA TAG */
},
{'R','I','F','F',0x80,0x80,0x80,0x80, /* RIFF TAG */
'W','A','V','E', /* WAV TAG */
'f','m','t',' ',0x10,0,0,0, /* FMT TAG */
1,0, /* format (WAVE_FORMAT_PCM) */
1,0, /* CHANNELS */
0x44,0xac,0,0, /* SamplesPerSec */
0x44,0xac,0,0, /* BytesPerSec */
1,0, /* Block align */
8,0, /* Bits per sample */
'd','a','t','a',0,0,0,0,'\0'/* DATA TAG */
},
{'R','I','F','F',0x80,0x80,0x80,0x80, /* RIFF TAG */
'W','A','V','E', /* WAV TAG */
'f','m','t',' ',0x10,0,0,0, /* FMT TAG */
1,0, /* format (WAVE_FORMAT_PCM) */
2,0, /* CHANNELS */
0x44,0xac,0,0, /* SamplesPerSec */
0x10,0xb1,2,0, /* BytesPerSec */
4,0, /* Block align */
0x10,0, /* Bits per sample */
'd','a','t','a',0,0,0,0,'\0'/* DATA TAG */
}
};
dd BS_1[] = {
0x34ae2945, /* Magicard (CommaVid).bin */
/* 0x30eb4f7a, Video Life (4K).BIN */
/* 0x9afa761f, Magicard (Life).bin */
0x266bd1b6, /* Video Life (CommaVid).bin */
0xa0899305, /* Video Life (alternative 2K) */
-1
};
char BS_1_DESC[][25] = {
"Magicard (CommaVid)",
"Video Life (CommaVid)",
"Video Life (CommaVid)",
-1
};
dd BS_3[] = {
0x2843d776, /* Frogger II - Threedeep!.bin */
0x690ada72, /* Gyruss [b].bin */
0x525ee7e9, /* Gyruss.bin */
0x95da4070, /* James Bond 007 [b].bin */
0x3216c1bb, /* James Bond 007.bin */
0xae4114d8, /* Montezuma's Revenge.bin */
0x00e44527, /* Mr. Do!'s Castle.bin */
0xf723b8a6, /* Popeye.bin */
0xe44c244e, /* Q-bert's Qubes [a].bin */
0xb8f2dca6, /* Q-bert's Qubes.bin */
0xe77f6742, /* Star Wars - Death Star Battle (Parker Bros).bin */
0xce09fcd4, /* Star Wars - The Arcade Game (Parker Bros).bin */
0xdd85f0e7, /* Super Cobra [b].bin */
0x8d372730, /* Super Cobra.bin */
0xd9088807, /* Tooth Protectors (DSD-Camelot).bin */
0x7eed7362, /* Tutankham.bin */
0xc87fc312, /* Popeye_(eks).bin */
0xef3ec01e, /* Super Cobra_(eks).bin */
0x84a101d4, /* Star Wars - Death Star Battle_(eks).bin */
0x2fc06cb0, /* Tutankham_(eks).bin */
0xab50bf11, /* Star Wars - The Arcade Game (proto).BIN */
0x549a1b6b, /* Star Wars - The Arcade Game (PAL) */
0x36910e4d, /* Frogger II - Threedeep! (PAL) */
0xb8bb2361, /* Gyruss (PAL) */
0xd3669372, /* Star Wars: Ewok Adventure (PAL) (proto) */
0x70db5cca, /* Star Wars: Ewok Adventure (T Jentzsch PAL to NTSC Conversion) */
0x6400d110, /* Lord of the Rings (proto) */
-1
};
char BS_3_DESC[][50] = {
"Frogger II - Threedeep!",
"Gyruss [b]",
"Gyruss",
"James Bond 007 [b]",
"James Bond 007",
"Montezuma's Revenge",
"Mr. Do!'s Castle",
"Popeye",
"Q-bert's Qubes [a]",
"Q-bert's Qubes",
"Star Wars - Death Star Battle (Parker Bros)",
"Star Wars - The Arcade Game (Parker Bros)",
"Super Cobra [b]",
"Super Cobra",
"Tooth Protectors (DSD-Camelot)",
"Tutankham",
"Popeye_(eks)",
"Super Cobra_(eks)",
"Star Wars - Death Star Battle_(eks)",
"Tutankham_(eks)",
"Star Wars - The Arcade Game (proto)",
"Star Wars - The Arcade Game (PAL)",
"Frogger II - Threedeep! (PAL)",
"Gyruss (PAL)",
"Star Wars - Ewok Adventure (proto) (PAL)",
"Star Wars - Ewok Adv. T Jentzsch PAL->NTSC (proto)",
"Lord of the Rings (proto)",
""
};
dd BS_4[] = {
0x584f6777, /* Espial [b].bin */
0x8d70fa42, /* Espial.bin */
0x8beb03d4, /* Miner 2049er [b1].bin */
0x33f2856f, /* Miner 2049er [b2].bin */
0xf859122e, /* Miner 2049er Vol. 2 [b1].bin */
0x281a1ca1, /* Miner 2049er Vol. 2 [b2].bin */
0x350c63ba, /* Miner 2049er Vol. 2.bin */
0x728b941c, /* Miner 2049er.bin */
0x13bf2da3, /* Polaris [b].bin */
0x7ce5312e, /* Polaris.bin */
0x40706361, /* River Patrol (Tigervision).bin */
0x2c34898f, /* Springer.bin */
0x09a71583, /* Miner 2049er PAL */
0xd5645294, /* Miner Volume 2 NTSC */
0x52630ec9, /* Polaris T. Jentzsch PAL to NTSC conversion*/
-1
};
char BS_4_DESC[][30] = {
"Espial [b]",
"Espial",
"Miner 2049er [b1]",
"Miner 2049er [b2]",
"Miner 2049er Vol. 2 (PAL)[b1]",
"Miner 2049er Vol. 2 (PAL)[b2]",
"Miner 2049er Vol. 2 (PAL)",
"Miner 2049er",
"Polaris [b] (PAL)",
"Polaris (PAL)",
"River Patrol (Tigervision)",
"Springer",
"Miner 2049er PAL",
"Miner 2049er Vol. 2",
"Polaris (T Jentzsch NTSC->PAL)",
-1
};
dd BS_5[] = {
0x7d23e780, /* Decathlon.bin */
0xa51c0236, /* Robot Tank.bin */
0xd8ecf576, /* Decathlon (PAL) */
0x0e8757b0, /* Robot Tank (PAL) */
0x94e8df6b, /* Space Shuttle (PAL) */
0xf3a4363c, /* Thwocker prototype */
-1
};
char BS_5_DESC[][25] = {
"Decathlon",
"Robot Tank",
"Decathlon (PAL)",
"Robot Tank (PAL)",
"Space Shuttle (PAL)",
"Thwocker (proto)",
-1
};
dd BS_9[] = {
0x6a31beac, /* Private Eye (CCE).bin */
0x3fa749c0, /* Private Eye [b].bin */
0x33242242, /* Private Eye.bin */
-1
};
char BS_9_DESC[][20] = {
"Private Eye (CCE)",
"Private Eye [b]",
"Private Eye",
-1
};
dd BS_6[] = {
0xa972c32b, /* Dig Dug.bin */
0x66cdb94b, /* Off the Wall [o].bin */
0xbd75d92b, /* Off the Wall.bin */
-1
};
char BS_6_DESC[][20] = {
"Dig Dug.bin",
"Off the Wall [o]",
"Off the Wall",
-1
};
dd BS_7[] = {
0x8eed6b02, /* Bump n Jump [b].bin */
0xd523e776, /* Bump n Jump.bin */
0x24c35820, /* Burgertime.bin */
0x5c161fe4, /* Masters of the Universe - The Power of He-Man.bin */
-1
};
char BS_7_DESC[][50] = {
"Bump n Jump [b].bin",
"Bump n Jump.bin",
"Burgertime.bin",
"Masters of the Universe - The Power of He-Man",
-1
};
/*
dd BS_8[] = {
0xbe1047cf, Fatal Run (PAL).bin
-1
};
*/
dd crc; /* holds accumulated CRC */
dd crctab[256]; /* table to help CRC calculation */
#define CRC16_REV 0xA001 /* CRC-16 polynomial reversed */
#define CRC32_REV 0xA0000001 /* CRC-32 polynomial reversed */
#define SQUARE_WAVE 0
#define SINE_WAVE 1
void make16BitStereo(char *sineWave, int *sineWaveLength);
#define BSM_2K 0
#define BSM_CV 1
#define BSM_4K 2
#define BSM_28SC 3
#define BSM_F8SC 4
#define BSM_28 5
#define BSM_F8 6
#define BSM_FE 7
#define BSM_3F 8
#define BSM_E0 9
#define BSM_FA 10
#define BSM_2A 11
#define BSM_3A 12
#define BSM_FANR 13
#define BSM_2ANR 14
#define BSM_3ANR 15
#define BSM_46SC 16
#define BSM_F6SC 17
#define BSM_26SC 18
#define BSM_36SC 19
#define BSM_46 20
#define BSM_F6 21
#define BSM_26 22
#define BSM_36 23
#define BSM_E7 24
#define BSM_E7NR 25
#define BSM_F4SC 26
#define BSM_24SC 27
#define BSM_34SC 28
#define BSM_44SC 29
#define BSM_F4 30
#define BSM_24 31
#define BSM_34 32
#define BSM_44 33
#define BSM_MB 34
#define FMT_22KHZ_8BIT_MONO 0
#define FMT_44KHZ_8BIT_MONO 1
#define FMT_44KHZ_16BIT_STEREO 2
#define METER_LENGTH 32
#define DISPLAY_NOTHING 0
#define DISPLAY_FILENAME 1
#define DISPLAY_SUMMARY 2
#define DISPLAY_DETAILS 3
#ifdef __linux__
#define _MAX_FNAME 256
#define _MAX_PATH 256
#define _MAX_DIR 256
#define _MAX_DRIVE 256
#define _MAX_EXT 256
#else
#include "find.h"
#endif
typedef unsigned long int dd;
typedef unsigned short int dw;
typedef int db;
struct parmFlags
{
int dflag;
int fflag;
int kflag;
int wflag;
int stereoFlag;
int mflag;
int pflag;
int sflag;
int vflag;
char tflag;
int zeroBitLength;
int oneBitLength;
int control;
int createMode;
int binFileCount;
int bankSwitchMode;
float headerSeconds;
float clearingSeconds;
float hlength;
char wavFileName[_MAX_FNAME];
char fullPath[_MAX_PATH];
struct qnode *binFileQ;
unsigned int multi;
unsigned int volume;
unsigned char startHi;
unsigned char startLo;
};
char bankSwitchList[][5] =
{"2K", "CV", "4K", "28SC", "F8SC", "28", "F8", "FE",
"3F", "E0", "FA", "2A", "3A", "FANR", "2ANR", "3ANR",
"46SC","F6SC", "26SC", "36SC", "46", "F6", "26", "36",
"E7", "E7NR", "F4SC", "24SC", "34SC", "44SC", "F4", "24",
"34", "44", "MB", ""};
unsigned int controlByteList[] =
{0xCA, 0xEA, 0xC8, 0xF6, 0xE6, 0xD6, 0xC6, 0xCC,
0xCE, 0xC1, 0xE0, 0xF0, 0x60, 0xC0, 0xD0, 0x40,
0x74, 0xE4, 0xF4, 0x64, 0x54, 0xC4, 0xD4, 0x44,
0xE3, 0xC3, 0xE2, 0xF2, 0x62, 0x72, 0xC2, 0xD2,
0x42, 0x52, 0xC9, 0x00};
int fileSizeList[] =
{2048, 2048, 4096, 8192, 8192, 8192, 8192, 8192,
8192, 8192, 12288, 12288, 12288, 12288, 12288, 12288,
16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
16384, 16384, 32768, 32768, 32768, 32768, 32768, 32768,
32768, 32768, 65536, 0};
int startPageList[] =
{7, 7, 15, 31, 15, 31, 15, 15,
31, 31, 15, 31, 47, 15, 31, 47,
63, 15, 31, 47, 63, 15, 31, 47,
63, 63, 15, 31, 47, 63, 15, 31,
47, 63, 15, 0};
int clearingToneLength[2] = {26, 51};
unsigned char clearingTone[256];
int zeroBitLength,
oneBitLength;
unsigned char zeroBit[256],
oneBit[256];
/* speed, khz, bit */
int bitLength[5][2][2] =
{
{{5,9},{15,21}},
{{3,7},{ 6,10}},
{{3,5},{ 5, 8}},
{{3,5},{ 4, 8}},
{{3,5},{ 4, 7}}
};
unsigned char header[3][80]=
{
{'R','I','F','F',0x80,0x80,0x80,0x80, /* RIFF TAG */
'W','A','V','E', /* WAV TAG */
'f','m','t',' ',0x10,0,0,0, /* FMT TAG */
1,0, /* format (WAVE_FORMAT_PCM) */
1,0, /* CHANNELS */
0x22,0x56,0,0, /* SamplesPerSec */
0x22,0x56,0,0, /* BytesPerSec */
1,0, /* Block align */
8,0, /* Bits per sample */
'd','a','t','a',0,0,0,0,'\0'/* DATA TAG */
},
{'R','I','F','F',0x80,0x80,0x80,0x80, /* RIFF TAG */
'W','A','V','E', /* WAV TAG */
'f','m','t',' ',0x10,0,0,0, /* FMT TAG */
1,0, /* format (WAVE_FORMAT_PCM) */
1,0, /* CHANNELS */
0x44,0xac,0,0, /* SamplesPerSec */
0x44,0xac,0,0, /* BytesPerSec */
1,0, /* Block align */
8,0, /* Bits per sample */
'd','a','t','a',0,0,0,0,'\0'/* DATA TAG */
},
{'R','I','F','F',0x80,0x80,0x80,0x80, /* RIFF TAG */
'W','A','V','E', /* WAV TAG */
'f','m','t',' ',0x10,0,0,0, /* FMT TAG */
1,0, /* format (WAVE_FORMAT_PCM) */
2,0, /* CHANNELS */
0x44,0xac,0,0, /* SamplesPerSec */
0x10,0xb1,2,0, /* BytesPerSec */
4,0, /* Block align */
0x10,0, /* Bits per sample */
'd','a','t','a',0,0,0,0,'\0'/* DATA TAG */
}
};
dd BS_1[] = {
0x34ae2945, /* Magicard (CommaVid).bin */
/* 0x30eb4f7a, Video Life (4K).BIN */
/* 0x9afa761f, Magicard (Life).bin */
0x266bd1b6, /* Video Life (CommaVid).bin */
0xa0899305, /* Video Life (alternative 2K) */
-1
};
char BS_1_DESC[][25] = {
"Magicard (CommaVid)",
"Video Life (CommaVid)",
"Video Life (CommaVid)",
-1
};
dd BS_3[] = {
0x2843d776, /* Frogger II - Threedeep!.bin */
0x690ada72, /* Gyruss [b].bin */
0x525ee7e9, /* Gyruss.bin */
0x95da4070, /* James Bond 007 [b].bin */
0x3216c1bb, /* James Bond 007.bin */
0xae4114d8, /* Montezuma's Revenge.bin */
0x00e44527, /* Mr. Do!'s Castle.bin */
0xf723b8a6, /* Popeye.bin */
0xe44c244e, /* Q-bert's Qubes [a].bin */
0xb8f2dca6, /* Q-bert's Qubes.bin */
0xe77f6742, /* Star Wars - Death Star Battle (Parker Bros).bin */
0xce09fcd4, /* Star Wars - The Arcade Game (Parker Bros).bin */
0xdd85f0e7, /* Super Cobra [b].bin */
0x8d372730, /* Super Cobra.bin */
0xd9088807, /* Tooth Protectors (DSD-Camelot).bin */
0x7eed7362, /* Tutankham.bin */
0xc87fc312, /* Popeye_(eks).bin */
0xef3ec01e, /* Super Cobra_(eks).bin */
0x84a101d4, /* Star Wars - Death Star Battle_(eks).bin */
0x2fc06cb0, /* Tutankham_(eks).bin */
0xab50bf11, /* Star Wars - The Arcade Game (proto).BIN */
0x549a1b6b, /* Star Wars - The Arcade Game (PAL) */
0x36910e4d, /* Frogger II - Threedeep! (PAL) */
0xb8bb2361, /* Gyruss (PAL) */
0xd3669372, /* Star Wars: Ewok Adventure (PAL) (proto) */
0x70db5cca, /* Star Wars: Ewok Adventure (T Jentzsch PAL to NTSC Conversion) */
0x6400d110, /* Lord of the Rings (proto) */
-1
};
char BS_3_DESC[][50] = {
"Frogger II - Threedeep!",
"Gyruss [b]",
"Gyruss",
"James Bond 007 [b]",
"James Bond 007",
"Montezuma's Revenge",
"Mr. Do!'s Castle",
"Popeye",
"Q-bert's Qubes [a]",
"Q-bert's Qubes",
"Star Wars - Death Star Battle (Parker Bros)",
"Star Wars - The Arcade Game (Parker Bros)",
"Super Cobra [b]",
"Super Cobra",
"Tooth Protectors (DSD-Camelot)",
"Tutankham",
"Popeye_(eks)",
"Super Cobra_(eks)",
"Star Wars - Death Star Battle_(eks)",
"Tutankham_(eks)",
"Star Wars - The Arcade Game (proto)",
"Star Wars - The Arcade Game (PAL)",
"Frogger II - Threedeep! (PAL)",
"Gyruss (PAL)",
"Star Wars - Ewok Adventure (proto) (PAL)",
"Star Wars - Ewok Adv. T Jentzsch PAL->NTSC (proto)",
"Lord of the Rings (proto)",
""
};
dd BS_4[] = {
0x584f6777, /* Espial [b].bin */
0x8d70fa42, /* Espial.bin */
0x8beb03d4, /* Miner 2049er [b1].bin */
0x33f2856f, /* Miner 2049er [b2].bin */
0xf859122e, /* Miner 2049er Vol. 2 [b1].bin */
0x281a1ca1, /* Miner 2049er Vol. 2 [b2].bin */
0x350c63ba, /* Miner 2049er Vol. 2.bin */
0x728b941c, /* Miner 2049er.bin */
0x13bf2da3, /* Polaris [b].bin */
0x7ce5312e, /* Polaris.bin */
0x40706361, /* River Patrol (Tigervision).bin */
0x2c34898f, /* Springer.bin */
0x09a71583, /* Miner 2049er PAL */
0xd5645294, /* Miner Volume 2 NTSC */
0x52630ec9, /* Polaris T. Jentzsch PAL to NTSC conversion*/
-1
};
char BS_4_DESC[][30] = {
"Espial [b]",
"Espial",
"Miner 2049er [b1]",
"Miner 2049er [b2]",
"Miner 2049er Vol. 2 (PAL)[b1]",
"Miner 2049er Vol. 2 (PAL)[b2]",
"Miner 2049er Vol. 2 (PAL)",
"Miner 2049er",
"Polaris [b] (PAL)",
"Polaris (PAL)",
"River Patrol (Tigervision)",
"Springer",
"Miner 2049er PAL",
"Miner 2049er Vol. 2",
"Polaris (T Jentzsch NTSC->PAL)",
-1
};
dd BS_5[] = {
0x7d23e780, /* Decathlon.bin */
0xa51c0236, /* Robot Tank.bin */
0xd8ecf576, /* Decathlon (PAL) */
0x0e8757b0, /* Robot Tank (PAL) */
0x94e8df6b, /* Space Shuttle (PAL) */
0xf3a4363c, /* Thwocker prototype */
-1
};
char BS_5_DESC[][25] = {
"Decathlon",
"Robot Tank",
"Decathlon (PAL)",
"Robot Tank (PAL)",
"Space Shuttle (PAL)",
"Thwocker (proto)",
-1
};
dd BS_9[] = {
0x6a31beac, /* Private Eye (CCE).bin */
0x3fa749c0, /* Private Eye [b].bin */
0x33242242, /* Private Eye.bin */
-1
};
char BS_9_DESC[][20] = {
"Private Eye (CCE)",
"Private Eye [b]",
"Private Eye",
-1
};
dd BS_6[] = {
0xa972c32b, /* Dig Dug.bin */
0x66cdb94b, /* Off the Wall [o].bin */
0xbd75d92b, /* Off the Wall.bin */
-1
};
char BS_6_DESC[][20] = {
"Dig Dug.bin",
"Off the Wall [o]",
"Off the Wall",
-1
};
dd BS_7[] = {
0x8eed6b02, /* Bump n Jump [b].bin */
0xd523e776, /* Bump n Jump.bin */
0x24c35820, /* Burgertime.bin */
0x5c161fe4, /* Masters of the Universe - The Power of He-Man.bin */
-1
};
char BS_7_DESC[][50] = {
"Bump n Jump [b].bin",
"Bump n Jump.bin",
"Burgertime.bin",
"Masters of the Universe - The Power of He-Man",
-1
};
/*
dd BS_8[] = {
0xbe1047cf, Fatal Run (PAL).bin
-1
};
*/
dd crc; /* holds accumulated CRC */
dd crctab[256]; /* table to help CRC calculation */
#define CRC16_REV 0xA001 /* CRC-16 polynomial reversed */
#define CRC32_REV 0xA0000001 /* CRC-32 polynomial reversed */
#define SQUARE_WAVE 0
#define SINE_WAVE 1
void make16BitStereo(char *sineWave, int *sineWaveLength);

+ 378
- 378
makewav.txt View File

@@ -1,378 +1,378 @@
M A K E W A V 4 . 2
Makewav converts ROM images for the Atari 2600 into .wav files that
can be transfered into a Cuttle Cart or Supercharger for play on an original
Atari 2600.
For the Supercharger:
It can convert Supercharger ROM images (6k, 8448 bytes and 32k)
into .wav files for use with the Supercharger. It can also convert
2k and 4k ROM images that were never intended to be played on the
Supercharger. The 2k and 4k images may not work with an unmodified
Supercharger.
For the Cuttle Cart:
It can convert almost every ROM image ever made for the Atari
2600 (the single known exception being Pitfall II) into .wav files
for use with the Cuttle Cart.
Version 4.2 of makewav has been heavily enhanced from the previous
major version (3.1). If you are familiar with a previous version of makewav,
you should read this document in full before attempting to use this version.
New to version 4.2:
- Bug Fix
Suggested command line to create game.wav:
Cuttle Cart:
makewav game.bin
Supercharger:
makewav -ts game.bin
Advanced Features:
Converting multiple files:
You can convert multiple files by listing each game separated by a
space. The ROM files to be converted to .wav files should be listed
after all option flags. An example to convert game1.bin, game2.bin
and game3.bin to game1.wav, game2.wav and game3.wav respectively for
use with the Supercharger follows:
makewav -ts game1.bin game2.bin game3.bin
Multi-load .wav files:
It is possible to create .wav files that contain multiple loads.
If you are familiar with the original Supercharger games, you will
recall that the audio tape contained all of the loads strung together
on the tape with no audio gaps between the loads. This can be
accomplished with makewav by listing the files to string together
separated by a "+" (plus sign). An example follows:
makewav -omultiload.wav load1.bin+load2.bin+load3.bin
The command line above will create a .wav file named "multiload.wav"
containing load1.bin, load2.bin, load3.bin with a 1 second header tone,
a 1.5 second tone between each load and a .25 seconde trailer tone.
Note that the -o flag was used to designate the name of the output
file. If the -o flag were ommitted, the .wav file would be named
"load1.wav" by using the name of the first ROM image.
WildCards:
Batch conversion is now possible with the use of wildcards in the
filename. Including b*.bin would convert all ROM images in the
current directory starting with "b" to .wav files.
Option Flags:
Flags can be used to modify the way makewav creates a .wav file. If
multiple .wav files are created, the flags affect all of them. The
details of each available flag follows.
Flag (Default)
Description
-b -> (default is to have value automatically determined)
Sets the bankswitch mode to use for the .wav file. The possible
values are: 2K, CV, 4K, F8SC, F8, FE, 3F, E0, FANR, FA, F6SC,
F6, E7, E7NR, F4SC, F4 and MB
-c -> (default is to have value automatically determined)
The -c must be followed by a 2 digit hex number (e.g. -c0d not -cd).
If this flag is used in conjunction with the -b flag, the value
provided will override the control byte value associated with the
bankswitch mode chosen. It also overrides the control byte stored
in the Supercharger ROM images.
The Cuttle Cart manual provides a detailed description of the
control byte values necessary for the Cuttle Cart.
For the Supercharger the number is generated as described below.
Bits Function
------ --------
D7-D5 Write Pulse Delay (Set to 0)
D4-D2 RAM/ROM Configuration
D4 D3 D2 $f000 $f800
-------- ----- -----
0 0 0 3 ROM
0 0 1 1 ROM
0 1 0 3 1
0 1 1 1 3
1 0 0 3 ROM
1 0 1 2 ROM
1 1 0 3 2
1 1 1 2 3
D1 If 0 RAM is Write PROTECTED
If 1 RAM is Write ENABLED
D0 If 0 ROM power is ON
If 1 ROM power is OFF
(Note: Make sure to power ROM off if you are converting
a .bin file that is running on a modified Supercharger.
This activates the modification so that games that don't
work on unmodified Superchargers will not crash!)
-d -> (default = 1)
This flag causes detailed information about the .bin file being
converted to be displayed.
Value Information
----- -------------------------------------------------------
0 None
1 Number of files being created, frequency, header tone
length (in seconds), the bit length (see -0 and -1
flags) and the name of each ROM image being converted.
2 All above information plus bankswitch type, file size,
start address, multi-load byte, page count, control byte
and the number of blank pages in the Rom image.
3 All above information plus, for each page, bank #, page#,
bank&page byte and checksum.
File Page # - The page # of the .bin file
(256 bytes/page).
Bank # - The bank this page will be loaded into.
Page # - The page # of the bank this page will
load into.
page&bank byte - The value used by the Supercharger to
determine the bank and page number to
load the current page from the .bin file
into. This is determined by
(page * 4) + bank, where banks range from
0-2 and pages range from 0-7.
Checksum byte - The value of the checksum for the current
page.
What follows is a sample output from Makewav while converting
Suicid23.bin (a cut down 8448 byte version even though the original
32k version will work too) from the Supercharger CD. The command
line used was:
makewav -d3 -ts suicid23.bin
Converting 1 file for use with the Supercharger:
Using 44khz .wav format with a 1.00 second header tone
(zero bit/one bit) lengths = (6/10)
SUICID23.BIN
Bankswitch type = Supercharger
File size = 8448 Start address = $fe00
Multi-Load byte = $00 Page count = $13
Control-byte = $0f Blank pages = $05
- bank 00, page 00, page&bank byte 00, checksum 07
- bank 00, page 01, page&bank byte 04, checksum 82
- bank 00, page 02, page&bank byte 08, checksum 81
- bank 00, page 03, page&bank byte 0c, checksum 00
- bank 00, page 04, page&bank byte 10, checksum bb
- bank 00, page 05, page&bank byte 14, checksum 21
- bank 00, page 06, page&bank byte 18, checksum 2a
- bank 00, page 07, page&bank byte 1c, checksum eb
- bank 01, page 00, page&bank byte 01, checksum 44
- bank 01, page 01, page&bank byte 05, checksum d0
- bank 01, page 02, page&bank byte 09, checksum 65
- bank 01, page 03, page&bank byte 0d, checksum 8a
- bank 01, page 04, page&bank byte 11, checksum e6
- bank 01, page 05, page&bank byte 15, checksum 13
- bank 01, page 06, page&bank byte 19, checksum 9c
- bank 01, page 07, page&bank byte 1d, checksum 5e
- bank 02, page 00, page&bank byte 02, checksum a0
- bank 02, page 06, page&bank byte 1a, checksum 81
- bank 02, page 07, page&bank byte 1e, checksum 17
As you can see, bank $02, pages $01 - $05 are blank, so they were
left out. This doesn't cause a problem with this game, the blank
pages are just the area that represent the "bitmapped" area of RAM
in the game. It is possible that some games may not work right
when a page is left out. You can fix this by using the -p flag.
-f -> (default = 2)
This flag allows you to change the speed of the tranfer. The valid
range is 0-4 and the higher the number the faster the load. Don't
be surprised if the faster transfers are not reliable, they are
really pushing the limits of the audio circuitry. Suggested values
for various media are: Audio Cassette = 0, CD = 1 or 2,
Computer = 2, 3, or 4.
-h -> (default = 1)
Allows you to set the length of the header tone in seconds. The
default length is 1 second. Values between 0.5 and 10 inclusive
are valid. This flag is useful if you are going to make a tape
or CD track and need a little bit longer header. This also
affects the length of the tones between any chained loads. A tone
between chained loads is 2 times as long as the header tone. The
footer tone is always 0.5 times as long as the header tone.
-i -> (default = 0.1)
Sets the length of the clearing tone. This tone clears the audio
circuits of the Supercharger and Cuttle Cart. Modifying the length
of this tone can aid getting the faster .wav files to load properly.
Generally you should not need to use this flag.
-k -> (default = 1)
Sets the .wav file format to use. Format 0 is 8-bit mono 22khz,
format 1 is 8-bit mono 44khz, format 2 is 16-bit stereo 44khz. You
really don't need to use format 2 unless you are creating a CD and
you recording software insists on having a 16-bit stereo 44khz .wav
file. The format 2 files are much larger than the other formats and
do not provide any increase in quality over format 1 files.
-m -> (default = 00 for non-Supercharger games and values stored in ROM
image for Supercharger games)
The -m must be followed by a 2 digit hex number (e.g. -m0d not -md).
This number is used to indicate a unique load number. If the code
is looking for load $0d and load $0f is transfered to it, the
Supercharger will return to either a black screen (if there is
a header tone between the loads) or to the "Press Play" screen and
wait until load $0d is played. This overrides the multi-load byte
in the 8448 byte .bin files and those in Supercharger ROM images.
-o -> (default = romfile.wav where romfile is the name of the ROM file)
The file name of the .wav file created. This flag should contain
the name of the output file when only one .wav file will be created
by makewav (Including a single multi-load .wav file, where the default
is the name of the first ROM file of the multi-load game). If more
than one .wav file is being created, the flag should contain the
path of the destination files.
-p -> (not set by default)
Turns "blank page packing" OFF. Makewav by default looks for pages
of the ROM image in which all of the bytes are the same value. This
usually indicates "filler" in the .bin file and can be eliminated
most of the time. If a particular game does not work, and you notice
that when using the -d flag that there are "blank" pages, try using
the -p flag.
-r -> (not set by default)
Causes a raw binary image of the data to be created instead of a
.wav file. This includes the header tone (a series of $55's if the
raw file is viewed with a hex editor),the 8-byte game header, the
page headers, and the footer tone. This does not include the
clearing tone since that doesn't represent any digital data. This
is not only useful for debugging makewav, but also for creating
precalculated data for possibly a dedicated device that plays the
tones necessary to load games into the Supercharger or the Cuttle
Cart.
-s -> (default is to have value automatically determined)
Forces a starting address for the code. The address must be a
2 byte, 4 digit hex number (e.g. -sf123 not -s123) in hi/lo format.
This will override all start addresses, including those in the
8448 byte .bin files and the .bin files on the Supercharger CD.
-t -> (default = c)
Determines which device the .wav files are created for. For the
Cuttle Cart the value is "c" and for the Supercharger the value is
"s".
-v -> (default = 10)
Sets the volume or amplitude of the .wav file. This was added
because there was concern that some .wav players didn't like the
.wav having the max values in the waveforms. Valid values are 1-10
inclusive. The defualt volume is 10, so there should be no reason
to ever actually use 10 :)
-w -> (default = 0)
Sets the type of wave form to use. 0 (zero) is for square-waves,
1 (one) is for sine-waves. The control tone is always sent as a
sine-wave.
-0 -> (default determined by the -f and -k flags)
The number of bytes that make up the sine waveform that represents
a zero bit in the .wav file. The valid range is 1 - 80. The larger
the number the slower the .wav file will load. Additionally, the
ratio of the 0 bit length to the 1 bit length should be approximately
0.5 to 0.75.
-1 -> (default determined by the -f and -k flags)
The number of bytes that make up the sine waveform that represents
a one bit in the .wav file. The valid range is 1 - 80. The larger
the number the slower the .wav file will load. Additionally, the
ratio of the 0 bit length to the 1 bit length should be approximately
0.5 to 0.75.
The .wav files are generally fairly large, but they pack very well,
sometimes to 6k or so. This is because of the repetition involved. Each
"one bit" is the same as every other "one bit" and the same with the
"zero bits".
Well, have fun, and if you make any cool games, drop me an e-mail!
(heck, even if you make a lame game I'd like to see it).
Now for the boring stuff: I hereby place this program into the
public domain. I am not responsible for any damage this program may cause.
I am not liable for any misuse, intentional or otherwise, of this program.
There is no warranty, written or implied, on this program. The user uses
this program at his or her own risk!
Bob Colbert
CEO of RetroWare
rcolbert@oasis.novia.net
http://www.novia.net/~rcolbert
Version History:
New to version 4.2:
- Bug fix
New to version 4.1:
- Compiles in Linux.
- Creates 16-bit Stereo 44khz .wav files (-k3 flag) which are requireded by
some CD authoring software.
- Ability to choose Sine Wave Waveforms (-w1 flag).
- Rewrote waveform generating routine to create sine waves.
- Square wave "polarity" no longer inverted when compared to the clearing
tone.
New to version 4.0:
- Creates Cuttle Cart compatible .wav files!
- Automatic bankswitching recognition for all methods supported by the Cuttle
Cart.
- Wildcard recognition! Now you can convert an entire directory of ROM images
into .wav files with one command.
- Lightning mode! Even faster loads than the fastest loads in the previous
version.
New to version 3.1:
- 'v' flag added that allows you to set the volume of the .wav file, some
people were concerned that their .wav player didn't like having the .wav
with the maximum volume level set.
- 'r' flag added which causes a raw data file to be created instead of a
.wav file. This raw file is the byte stream that the Supercharger reads
from the tape.
- Games can now be "chained" together. This allows you to recreate your
Supercharger tapes! Each load is seperated by a tone with no silence
gap.
- Restructured the way the header and footer tones are written for a more
straight-forward program flow.
New to version 3.0:
- multi-load byte command flag now works correctly (-m flag).
- Correctly handles all .bin files on the Supercharger CD.
- 'd' flag added that shows detailed debugging information about
the .bin file.
- Makewav now determines that a page (256 byte chunk) of the .bin file is
empty if all of the bytes in that page are identical. It automatically
leaves this page out of the .wav file. This is great if you are developing
a game and have a very small piece of code! This can be overridden with
the -p flag, which will force Makewav to include every page in the .wav
file.
Below version 3.0
- version history was not kept prior to version 3.0
M A K E W A V 4 . 2
Makewav converts ROM images for the Atari 2600 into .wav files that
can be transfered into a Cuttle Cart or Supercharger for play on an original
Atari 2600.
For the Supercharger:
It can convert Supercharger ROM images (6k, 8448 bytes and 32k)
into .wav files for use with the Supercharger. It can also convert
2k and 4k ROM images that were never intended to be played on the
Supercharger. The 2k and 4k images may not work with an unmodified
Supercharger.
For the Cuttle Cart:
It can convert almost every ROM image ever made for the Atari
2600 (the single known exception being Pitfall II) into .wav files
for use with the Cuttle Cart.
Version 4.2 of makewav has been heavily enhanced from the previous
major version (3.1). If you are familiar with a previous version of makewav,
you should read this document in full before attempting to use this version.
New to version 4.2:
- Bug Fix
Suggested command line to create game.wav:
Cuttle Cart:
makewav game.bin
Supercharger:
makewav -ts game.bin
Advanced Features:
Converting multiple files:
You can convert multiple files by listing each game separated by a
space. The ROM files to be converted to .wav files should be listed
after all option flags. An example to convert game1.bin, game2.bin
and game3.bin to game1.wav, game2.wav and game3.wav respectively for
use with the Supercharger follows:
makewav -ts game1.bin game2.bin game3.bin
Multi-load .wav files:
It is possible to create .wav files that contain multiple loads.
If you are familiar with the original Supercharger games, you will
recall that the audio tape contained all of the loads strung together
on the tape with no audio gaps between the loads. This can be
accomplished with makewav by listing the files to string together
separated by a "+" (plus sign). An example follows:
makewav -omultiload.wav load1.bin+load2.bin+load3.bin
The command line above will create a .wav file named "multiload.wav"
containing load1.bin, load2.bin, load3.bin with a 1 second header tone,
a 1.5 second tone between each load and a .25 seconde trailer tone.
Note that the -o flag was used to designate the name of the output
file. If the -o flag were ommitted, the .wav file would be named
"load1.wav" by using the name of the first ROM image.
WildCards:
Batch conversion is now possible with the use of wildcards in the
filename. Including b*.bin would convert all ROM images in the
current directory starting with "b" to .wav files.
Option Flags:
Flags can be used to modify the way makewav creates a .wav file. If
multiple .wav files are created, the flags affect all of them. The
details of each available flag follows.
Flag (Default)
Description
-b -> (default is to have value automatically determined)
Sets the bankswitch mode to use for the .wav file. The possible
values are: 2K, CV, 4K, F8SC, F8, FE, 3F, E0, FANR, FA, F6SC,
F6, E7, E7NR, F4SC, F4 and MB
-c -> (default is to have value automatically determined)
The -c must be followed by a 2 digit hex number (e.g. -c0d not -cd).
If this flag is used in conjunction with the -b flag, the value
provided will override the control byte value associated with the
bankswitch mode chosen. It also overrides the control byte stored
in the Supercharger ROM images.
The Cuttle Cart manual provides a detailed description of the
control byte values necessary for the Cuttle Cart.
For the Supercharger the number is generated as described below.
Bits Function
------ --------
D7-D5 Write Pulse Delay (Set to 0)
D4-D2 RAM/ROM Configuration
D4 D3 D2 $f000 $f800
-------- ----- -----
0 0 0 3 ROM
0 0 1 1 ROM
0 1 0 3 1
0 1 1 1 3
1 0 0 3 ROM
1 0 1 2 ROM
1 1 0 3 2
1 1 1 2 3
D1 If 0 RAM is Write PROTECTED
If 1 RAM is Write ENABLED
D0 If 0 ROM power is ON
If 1 ROM power is OFF
(Note: Make sure to power ROM off if you are converting
a .bin file that is running on a modified Supercharger.
This activates the modification so that games that don't
work on unmodified Superchargers will not crash!)
-d -> (default = 1)
This flag causes detailed information about the .bin file being
converted to be displayed.
Value Information
----- -------------------------------------------------------
0 None
1 Number of files being created, frequency, header tone
length (in seconds), the bit length (see -0 and -1
flags) and the name of each ROM image being converted.
2 All above information plus bankswitch type, file size,
start address, multi-load byte, page count, control byte
and the number of blank pages in the Rom image.
3 All above information plus, for each page, bank #, page#,
bank&page byte and checksum.
File Page # - The page # of the .bin file
(256 bytes/page).
Bank # - The bank this page will be loaded into.
Page # - The page # of the bank this page will
load into.
page&bank byte - The value used by the Supercharger to
determine the bank and page number to
load the current page from the .bin file
into. This is determined by
(page * 4) + bank, where banks range from
0-2 and pages range from 0-7.
Checksum byte - The value of the checksum for the current
page.
What follows is a sample output from Makewav while converting
Suicid23.bin (a cut down 8448 byte version even though the original
32k version will work too) from the Supercharger CD. The command
line used was:
makewav -d3 -ts suicid23.bin
Converting 1 file for use with the Supercharger:
Using 44khz .wav format with a 1.00 second header tone
(zero bit/one bit) lengths = (6/10)
SUICID23.BIN
Bankswitch type = Supercharger
File size = 8448 Start address = $fe00
Multi-Load byte = $00 Page count = $13
Control-byte = $0f Blank pages = $05
- bank 00, page 00, page&bank byte 00, checksum 07
- bank 00, page 01, page&bank byte 04, checksum 82
- bank 00, page 02, page&bank byte 08, checksum 81
- bank 00, page 03, page&bank byte 0c, checksum 00
- bank 00, page 04, page&bank byte 10, checksum bb
- bank 00, page 05, page&bank byte 14, checksum 21
- bank 00, page 06, page&bank byte 18, checksum 2a
- bank 00, page 07, page&bank byte 1c, checksum eb
- bank 01, page 00, page&bank byte 01, checksum 44
- bank 01, page 01, page&bank byte 05, checksum d0
- bank 01, page 02, page&bank byte 09, checksum 65
- bank 01, page 03, page&bank byte 0d, checksum 8a
- bank 01, page 04, page&bank byte 11, checksum e6
- bank 01, page 05, page&bank byte 15, checksum 13
- bank 01, page 06, page&bank byte 19, checksum 9c
- bank 01, page 07, page&bank byte 1d, checksum 5e
- bank 02, page 00, page&bank byte 02, checksum a0
- bank 02, page 06, page&bank byte 1a, checksum 81
- bank 02, page 07, page&bank byte 1e, checksum 17
As you can see, bank $02, pages $01 - $05 are blank, so they were
left out. This doesn't cause a problem with this game, the blank
pages are just the area that represent the "bitmapped" area of RAM
in the game. It is possible that some games may not work right
when a page is left out. You can fix this by using the -p flag.
-f -> (default = 2)
This flag allows you to change the speed of the tranfer. The valid
range is 0-4 and the higher the number the faster the load. Don't
be surprised if the faster transfers are not reliable, they are
really pushing the limits of the audio circuitry. Suggested values
for various media are: Audio Cassette = 0, CD = 1 or 2,
Computer = 2, 3, or 4.
-h -> (default = 1)
Allows you to set the length of the header tone in seconds. The
default length is 1 second. Values between 0.5 and 10 inclusive
are valid. This flag is useful if you are going to make a tape
or CD track and need a little bit longer header. This also
affects the length of the tones between any chained loads. A tone
between chained loads is 2 times as long as the header tone. The
footer tone is always 0.5 times as long as the header tone.
-i -> (default = 0.1)
Sets the length of the clearing tone. This tone clears the audio
circuits of the Supercharger and Cuttle Cart. Modifying the length
of this tone can aid getting the faster .wav files to load properly.
Generally you should not need to use this flag.
-k -> (default = 1)
Sets the .wav file format to use. Format 0 is 8-bit mono 22khz,
format 1 is 8-bit mono 44khz, format 2 is 16-bit stereo 44khz. You
really don't need to use format 2 unless you are creating a CD and
you recording software insists on having a 16-bit stereo 44khz .wav
file. The format 2 files are much larger than the other formats and
do not provide any increase in quality over format 1 files.
-m -> (default = 00 for non-Supercharger games and values stored in ROM
image for Supercharger games)
The -m must be followed by a 2 digit hex number (e.g. -m0d not -md).
This number is used to indicate a unique load number. If the code
is looking for load $0d and load $0f is transfered to it, the
Supercharger will return to either a black screen (if there is
a header tone between the loads) or to the "Press Play" screen and
wait until load $0d is played. This overrides the multi-load byte
in the 8448 byte .bin files and those in Supercharger ROM images.
-o -> (default = romfile.wav where romfile is the name of the ROM file)
The file name of the .wav file created. This flag should contain
the name of the output file when only one .wav file will be created
by makewav (Including a single multi-load .wav file, where the default
is the name of the first ROM file of the multi-load game). If more
than one .wav file is being created, the flag should contain the
path of the destination files.
-p -> (not set by default)
Turns "blank page packing" OFF. Makewav by default looks for pages
of the ROM image in which all of the bytes are the same value. This
usually indicates "filler" in the .bin file and can be eliminated
most of the time. If a particular game does not work, and you notice
that when using the -d flag that there are "blank" pages, try using
the -p flag.
-r -> (not set by default)
Causes a raw binary image of the data to be created instead of a
.wav file. This includes the header tone (a series of $55's if the
raw file is viewed with a hex editor),the 8-byte game header, the
page headers, and the footer tone. This does not include the
clearing tone since that doesn't represent any digital data. This
is not only useful for debugging makewav, but also for creating
precalculated data for possibly a dedicated device that plays the
tones necessary to load games into the Supercharger or the Cuttle
Cart.
-s -> (default is to have value automatically determined)
Forces a starting address for the code. The address must be a
2 byte, 4 digit hex number (e.g. -sf123 not -s123) in hi/lo format.
This will override all start addresses, including those in the
8448 byte .bin files and the .bin files on the Supercharger CD.
-t -> (default = c)
Determines which device the .wav files are created for. For the
Cuttle Cart the value is "c" and for the Supercharger the value is
"s".
-v -> (default = 10)
Sets the volume or amplitude of the .wav file. This was added
because there was concern that some .wav players didn't like the
.wav having the max values in the waveforms. Valid values are 1-10
inclusive. The defualt volume is 10, so there should be no reason
to ever actually use 10 :)
-w -> (default = 0)
Sets the type of wave form to use. 0 (zero) is for square-waves,
1 (one) is for sine-waves. The control tone is always sent as a
sine-wave.
-0 -> (default determined by the -f and -k flags)
The number of bytes that make up the sine waveform that represents
a zero bit in the .wav file. The valid range is 1 - 80. The larger
the number the slower the .wav file will load. Additionally, the
ratio of the 0 bit length to the 1 bit length should be approximately
0.5 to 0.75.
-1 -> (default determined by the -f and -k flags)
The number of bytes that make up the sine waveform that represents
a one bit in the .wav file. The valid range is 1 - 80. The larger
the number the slower the .wav file will load. Additionally, the
ratio of the 0 bit length to the 1 bit length should be approximately
0.5 to 0.75.
The .wav files are generally fairly large, but they pack very well,
sometimes to 6k or so. This is because of the repetition involved. Each
"one bit" is the same as every other "one bit" and the same with the
"zero bits".
Well, have fun, and if you make any cool games, drop me an e-mail!
(heck, even if you make a lame game I'd like to see it).
Now for the boring stuff: I hereby place this program into the
public domain. I am not responsible for any damage this program may cause.
I am not liable for any misuse, intentional or otherwise, of this program.
There is no warranty, written or implied, on this program. The user uses
this program at his or her own risk!
Bob Colbert
CEO of RetroWare
rcolbert@oasis.novia.net
http://www.novia.net/~rcolbert
Version History:
New to version 4.2:
- Bug fix
New to version 4.1:
- Compiles in Linux.
- Creates 16-bit Stereo 44khz .wav files (-k3 flag) which are requireded by
some CD authoring software.
- Ability to choose Sine Wave Waveforms (-w1 flag).
- Rewrote waveform generating routine to create sine waves.
- Square wave "polarity" no longer inverted when compared to the clearing
tone.
New to version 4.0:
- Creates Cuttle Cart compatible .wav files!
- Automatic bankswitching recognition for all methods supported by the Cuttle
Cart.
- Wildcard recognition! Now you can convert an entire directory of ROM images
into .wav files with one command.
- Lightning mode! Even faster loads than the fastest loads in the previous
version.
New to version 3.1:
- 'v' flag added that allows you to set the volume of the .wav file, some
people were concerned that their .wav player didn't like having the .wav
with the maximum volume level set.
- 'r' flag added which causes a raw data file to be created instead of a
.wav file. This raw file is the byte stream that the Supercharger reads
from the tape.
- Games can now be "chained" together. This allows you to recreate your
Supercharger tapes! Each load is seperated by a tone with no silence
gap.
- Restructured the way the header and footer tones are written for a more
straight-forward program flow.
New to version 3.0:
- multi-load byte command flag now works correctly (-m flag).
- Correctly handles all .bin files on the Supercharger CD.
- 'd' flag added that shows detailed debugging information about
the .bin file.
- Makewav now determines that a page (256 byte chunk) of the .bin file is
empty if all of the bytes in that page are identical. It automatically
leaves this page out of the .wav file. This is great if you are developing
a game and have a very small piece of code! This can be overridden with
the -p flag, which will force Makewav to include every page in the .wav
file.
Below version 3.0
- version history was not kept prior to version 3.0

+ 93
- 93
queue.c View File

@@ -1,93 +1,93 @@
/* queue.c */
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include "queue.h"
/* allocates enough memory to store 1 q node */
struct qnode *qalloc(void) {
return (struct qnode *) malloc(sizeof(struct qnode));
}
/* returns pointer to duplicate of s */
struct qnode *qdup(struct qnode *s, int *fileCount)
{
struct qnode *temp, *p;
p = NULL;
temp = s;
while (temp != NULL) {
p = addq(p,temp->fileName, fileCount);
temp = temp->next;
}
return p;
}
/* adds q node to tail of p - use form 'p = addq(p,w,t)' */
struct qnode *addq(struct qnode *p, char *fileName, int *fileCount)
{
if (p == NULL) {
p = qalloc();
strcpy(p->fileName, fileName);
p->next = NULL;
(*fileCount)++;
}
else if (strcmp(p->fileName, fileName))
p->next = addq(p->next, fileName, fileCount);
return p;
}
/* remove node from head of p - use form 'p = delq(p)' */
/* frees memory previously used by node deleted */
struct qnode *delq(struct qnode *p)
{
struct qnode *t;
t = p;
if (p != NULL) {
t = p->next;
free(p);
}
return t;
}
/* deletes all nodes from queue pointed to by p */
void clearq(struct qnode *p)
{
while (p != NULL)
p = delq(p);
}
/* prints all bursts in a q - used for debugging */
void qprint(struct qnode *p)
{
if (p != NULL) {
printf("FileName: %s\n",p->fileName);
qprint(p->next);
}
}
/*
main()
{
struct qnode *addresses;
addresses = NULL;
addresses = addq(addresses,0xfeac);
addresses = addq(addresses,0xfbba);
qprint(addresses);
printf("--\n");
printf("%0.4X\n",addresses->address);
addresses = delq(addresses);
printf("%0.4x\n",addresses->address);
}
*/
/* queue.c */
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include "queue.h"
/* allocates enough memory to store 1 q node */
struct qnode *qalloc(void) {
return (struct qnode *) malloc(sizeof(struct qnode));
}
/* returns pointer to duplicate of s */
struct qnode *qdup(struct qnode *s, int *fileCount)
{
struct qnode *temp, *p;
p = NULL;
temp = s;
while (temp != NULL) {
p = addq(p,temp->fileName, fileCount);
temp = temp->next;
}
return p;
}
/* adds q node to tail of p - use form 'p = addq(p,w,t)' */
struct qnode *addq(struct qnode *p, char *fileName, int *fileCount)
{
if (p == NULL) {
p = qalloc();
strcpy(p->fileName, fileName);
p->next = NULL;
(*fileCount)++;
}
else if (strcmp(p->fileName, fileName))
p->next = addq(p->next, fileName, fileCount);
return p;
}
/* remove node from head of p - use form 'p = delq(p)' */
/* frees memory previously used by node deleted */
struct qnode *delq(struct qnode *p)
{
struct qnode *t;
t = p;
if (p != NULL) {
t = p->next;
free(p);
}
return t;
}
/* deletes all nodes from queue pointed to by p */
void clearq(struct qnode *p)
{
while (p != NULL)
p = delq(p);
}
/* prints all bursts in a q - used for debugging */
void qprint(struct qnode *p)
{
if (p != NULL) {
printf("FileName: %s\n",p->fileName);
qprint(p->next);
}
}
/*
main()
{
struct qnode *addresses;
addresses = NULL;
addresses = addq(addresses,0xfeac);
addresses = addq(addresses,0xfbba);
qprint(addresses);
printf("--\n");
printf("%0.4X\n",addresses->address);
addresses = delq(addresses);
printf("%0.4x\n",addresses->address);
}
*/

+ 11
- 11
queue.h View File

@@ -1,11 +1,11 @@
/* structure to hold list of fileNames */
struct qnode {
char fileName[256];
struct qnode *next;
};
struct qnode *addq(struct qnode *, char *, int *);
struct qnode *delq(struct qnode *);
void qprint(struct qnode *);
/* structure to hold list of fileNames */
struct qnode {
char fileName[256];
struct qnode *next;
};
struct qnode *addq(struct qnode *, char *, int *);
struct qnode *delq(struct qnode *);
void qprint(struct qnode *);

Loading…
Cancel
Save