tool to upload data to a SuperCharger cartridge
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

409 lines
18KB

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