1
0
mirror of https://github.com/mist-devel/mist-board.git synced 2026-02-26 08:14:07 +00:00

Added tzx to wav tool for csw1 generation

This commit is contained in:
harbaum
2014-08-12 09:55:59 +00:00
parent 7089faa464
commit 0f3f91a4e3
5 changed files with 2790 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
APP=tzx2wav
../$(APP): $(APP).c hardware.h
gcc -o $@ $< -lz

View File

@@ -0,0 +1,224 @@
/////////////////////////////////////////////////////////////////////
// TZX to VAV Converter v0.2 for Bloodshed Dev-C++ compiler //
// (C) 2006 Francisco Javier Crespo <tzx2wav@ya.com> //
// //
// Hardware description header file //
/////////////////////////////////////////////////////////////////////
// Hardware Type entries
const char hwtype_01[] = "Computer";
const char hwtype_02[] = "External Storage";
const char hwtype_03[] = "ROM/RAM Type Add-On";
const char hwtype_04[] = "Sound Device";
const char hwtype_05[] = "Joystick";
const char hwtype_06[] = "Mouse";
const char hwtype_07[] = "Other Controller";
const char hwtype_08[] = "Serial Port";
const char hwtype_09[] = "Parallel Port";
const char hwtype_10[] = "Printer";
const char hwtype_11[] = "Modem";
const char hwtype_12[] = "Digitiser";
const char hwtype_13[] = "Network Adapter";
const char hwtype_14[] = "Keyboard or Keypad";
const char hwtype_15[] = "AD/DA Converter";
const char hwtype_16[] = "EPROM Programmer";
// Computer entries
const char hwid_01_01[] = "ZX Spectrum 16k";
const char hwid_01_02[] = "ZX Spectrum 48k, Plus";
const char hwid_01_03[] = "ZX Spectrum 48k Issue 1";
const char hwid_01_04[] = "ZX Spectrum 128k (Sinclair)";
const char hwid_01_05[] = "ZX Spectrum 128k +2 (Grey case)";
const char hwid_01_06[] = "ZX Spectrum 128k +2A, +3";
const char hwid_01_07[] = "Timex Sinclair TC-2048";
const char hwid_01_08[] = "Timex Sinclair TS-2068";
const char hwid_01_09[] = "Pentagon 128";
const char hwid_01_10[] = "Sam Coupe";
const char hwid_01_11[] = "Didaktik M";
const char hwid_01_12[] = "Didaktik Gama";
const char hwid_01_13[] = "ZX-81 with 1k RAM";
const char hwid_01_14[] = "ZX-81 with 16k RAM or more";
const char hwid_01_15[] = "ZX Spectrum 128k, Spanish version";
const char hwid_01_16[] = "ZX Spectrum, Arabic version";
const char hwid_01_17[] = "TK 90-X";
const char hwid_01_18[] = "TK 95";
const char hwid_01_19[] = "Byte";
const char hwid_01_20[] = "Elwro";
const char hwid_01_21[] = "ZS Scorpion";
const char hwid_01_22[] = "Amstrad CPC 464";
const char hwid_01_23[] = "Amstrad CPC 664";
const char hwid_01_24[] = "Amstrad CPC 6128";
const char hwid_01_25[] = "Amstrad CPC 464+";
const char hwid_01_26[] = "Amstrad CPC 6128+";
const char hwid_01_27[] = "Jupiter ACE";
const char hwid_01_28[] = "Enterprise";
const char hwid_01_29[] = "Commodore 64";
const char hwid_01_30[] = "Commodore 128";
const char *hwids_01[30] =
{hwid_01_01, hwid_01_02, hwid_01_03, hwid_01_04, hwid_01_05, hwid_01_06,
hwid_01_07, hwid_01_08, hwid_01_09, hwid_01_10, hwid_01_11, hwid_01_12,
hwid_01_13, hwid_01_14, hwid_01_15, hwid_01_16, hwid_01_17, hwid_01_18,
hwid_01_19, hwid_01_20, hwid_01_21, hwid_01_22, hwid_01_23, hwid_01_24,
hwid_01_25, hwid_01_26, hwid_01_27, hwid_01_28, hwid_01_29, hwid_01_30};
// External Storage entries
const char hwid_02_01[] = "Microdrive";
const char hwid_02_02[] = "Opus Discovery";
const char hwid_02_03[] = "Disciple";
const char hwid_02_04[] = "Plus-D";
const char hwid_02_05[] = "Rotronics Wafadrive";
const char hwid_02_06[] = "TR-DOS (BetaDisk)";
const char hwid_02_07[] = "Byte Drive";
const char hwid_02_08[] = "Watsford";
const char hwid_02_09[] = "FIZ";
const char hwid_02_10[] = "Radofin";
const char hwid_02_11[] = "Didaktik disk drives";
const char hwid_02_12[] = "BS-DOS (MB-02)";
const char hwid_02_13[] = "ZX Spectrum +3 disk drive";
const char hwid_02_14[] = "JLO (Oliger) disk interface";
const char hwid_02_15[] = "FDD3000";
const char hwid_02_16[] = "Zebra disk drive";
const char hwid_02_17[] = "Ramex Millenia";
const char hwid_02_18[] = "Larken";
const char *hwids_02[18] =
{hwid_02_01, hwid_02_02, hwid_02_03, hwid_02_04, hwid_02_05, hwid_02_06,
hwid_02_07, hwid_02_08, hwid_02_09, hwid_02_10, hwid_02_11, hwid_02_12,
hwid_02_13, hwid_02_14, hwid_02_15, hwid_02_16, hwid_02_17, hwid_02_18};
// ROM/RAM Type Add-On entries
const char hwid_03_01[] = "Sam Ram";
const char hwid_03_02[] = "Multiface";
const char hwid_03_03[] = "Multiface 128k";
const char hwid_03_04[] = "Multiface +3";
const char hwid_03_05[] = "MultiPrint";
const char hwid_03_06[] = "MB-02 ROM/RAM expansion";
const char *hwids_03[6] =
{hwid_03_01, hwid_03_02, hwid_03_03, hwid_03_04, hwid_03_05, hwid_03_06};
// Sound Device entries
const char hwid_04_01[] = "Classic AY hardware (compatible with 128k ZXs)";
const char hwid_04_02[] = "Fuller Box AY sound hardware";
const char hwid_04_03[] = "Currah microSpeech";
const char hwid_04_04[] = "SpecDrum";
const char hwid_04_05[] = "AY ACB stereo; Melodik";
const char hwid_04_06[] = "AY ABC stereo";
const char *hwids_04[6] =
{hwid_04_01, hwid_04_02, hwid_04_03, hwid_04_04, hwid_04_05, hwid_04_06};
// Joystick entries
const char hwid_05_01[] = "Kempston";
const char hwid_05_02[] = "Cursor, Protek, AGF";
const char hwid_05_03[] = "Sinclair 2 Left";
const char hwid_05_04[] = "Sinclair 1 Right";
const char hwid_05_05[] = "Fuller";
const char *hwids_05[5] =
{hwid_05_01, hwid_05_02, hwid_05_03, hwid_05_04, hwid_05_05};
// Mouse entries
const char hwid_06_01[] = "AMX Mouse";
const char hwid_06_02[] = "Kempston mouse";
const char *hwids_06[2] = {hwid_06_01, hwid_06_02};
// Other Controller entries
const char hwid_07_01[] = "Trickstick";
const char hwid_07_02[] = "ZX Light Gun";
const char hwid_07_03[] = "Zebra Graphics Tablet";
const char *hwids_07[3] = {hwid_07_01, hwid_07_02, hwid_07_03};
// Serial Port entries
const char hwid_08_01[] = "ZX Interface 1";
const char hwid_08_02[] = "ZX Spectrum 128k";
const char *hwids_08[2] = {hwid_08_01, hwid_08_02};
// Parallel Port entries
const char hwid_09_01[] = "Kempston S";
const char hwid_09_02[] = "Kempston E";
const char hwid_09_03[] = "ZX Spectrum +3";
const char hwid_09_04[] = "Tasman";
const char hwid_09_05[] = "DK'Tronics";
const char hwid_09_06[] = "Hilderbay";
const char hwid_09_07[] = "INES Printerface";
const char hwid_09_08[] = "ZX LPrint Interface 3";
const char hwid_09_09[] = "MultiPrint";
const char hwid_09_10[] = "Opus Discovery";
const char hwid_09_11[] = "Standard 8255 chip";
const char *hwids_09[11] =
{hwid_09_01, hwid_09_02, hwid_09_03, hwid_09_04, hwid_09_05, hwid_09_06,
hwid_09_07, hwid_09_08, hwid_09_09, hwid_09_10, hwid_09_11};
// Printer entries
const char hwid_10_01[] = "ZX Printer, Alphacom 32 & Compatibles";
const char hwid_10_02[] = "Generic Printer";
const char hwid_10_03[] = "EPSON Compatible";
const char *hwids_10[3] = {hwid_10_01, hwid_10_02, hwid_10_03};
// Modem entries
const char hwid_11_01[] = "VTX 5000";
const char hwid_11_02[] = "T/S 2050 or Westridge 2050";
const char *hwids_11[2] = {hwid_11_01, hwid_11_02};
// Digitiser entries
const char hwid_12_01[] = "RD Digital Tracer";
const char hwid_12_02[] = "DK'Tronics Light Pen";
const char hwid_12_03[] = "British MicroGraph Pad";
const char *hwids_12[3] = {hwid_12_01, hwid_12_02, hwid_12_03};
// Network Adapter entries
const char hwid_13_01[] = "ZX interface 1";
const char *hwids_13[1] = {hwid_13_01};
// Keyboard or Keypad entries
const char hwid_14_01[] = "Keypad for ZX Spectrum 128k";
const char *hwids_14[1] = {hwid_14_01};
// AD/DA Converter entries
const char hwid_15_01[] = "Harley Systems ADC 8.2";
const char hwid_15_02[] = "Blackboard Electronics";
const char *hwids_15[2] = {hwid_15_01, hwid_15_02};
// EPROM Programmer entries
const char hwid_16_01[] = "Orme Electronics";
const char *hwids_16[1] = {hwid_16_01};
// Variables used in main program
const char *hwtypes[16] =
{hwtype_01, hwtype_02, hwtype_03, hwtype_04, hwtype_05, hwtype_06, hwtype_07, hwtype_08,
hwtype_09, hwtype_10, hwtype_11, hwtype_12, hwtype_13, hwtype_14, hwtype_15, hwtype_16};
const char **hwids[16] =
{hwids_01, hwids_02, hwids_03, hwids_04, hwids_05, hwids_06, hwids_07, hwids_08,
hwids_09, hwids_10, hwids_11, hwids_12, hwids_13, hwids_14, hwids_15, hwids_16};

File diff suppressed because it is too large Load Diff

BIN
tools/tzx2wav/tzx2wav.exe Normal file

Binary file not shown.

146
tools/tzx2wav/tzx2wav.txt Normal file
View File

@@ -0,0 +1,146 @@
/////////////////////////////////////////////////////////////////////
// TZX to VAV Converter v0.2 for Bloodshed Dev-C++ compiler //
// (C) 2005-2006 Francisco Javier Crespo <tzx2wav@ya.com> //
// //
// Originally based on source code from these works: //
// PLAYTZX v0.60b for Watcom C compiler (C) 1997-2004 Tomaz Kac //
// PLAYTZX Unix v0.12b (C) 2003 Tero Turtiainen / Fredrick Meunier //
/////////////////////////////////////////////////////////////////////
TZX2WAV is an utility mainly designed to generate audio WAV files from TZX
data files used in 8-bit computers emulators. A lot of people were demanding a
way to create Audio CD tracks that could be hooked with their real ZX Spectrum
at the highest fidelity.
TZX2WAV is based on Tomaz Kac's PlayTZX 0.60b, an original tool to replay
TZX through an ISA SoundBlaster card. When PlayTZX was conceived and designed,
the normal operating systems were MS-DOS and Windows 95, and CDROM burners
were a expensive luxury. Now Windows 2000 and XP are the common environments,
and I felt the best way to achieve our aim, was a tool to create standard WAV
files that could be easily imported into any CD burning program.
These are the only requirements for the supplied executable of TZX2WAV:
- Win32 compatible environment (W95, W98, WMe, NT, W2K, WXP and maybe Wine)
- Enough storage (Hard Drive, Memory Sticks or whatever) for the output file
This version of TZX2WAV is able to handle TZX Revision 1.13 files. The next
release will be compatible with TZX Revision 1.20 Draft, which will support
some encoding methods not available in the current specification.
Mono WAV files generated by this version should work with all emulators.
I have tested them with R80, EmuZWin, SPIN, RealSpectrum and Spectaculator.
TZX2WAV 0.2b is able to create both CSW 1.01 (RLE compression) and CSW 2.00
(ZLIB compression) files so they should work in all CSW-aware emulators.
All data blocks (10-14) should work fine. "Direct Recording" block should
work OK if you use the sampling rate that is the same, or a multiply of the
original sampling rate that was used to create the "Direct Recording" block
(i.e. if was created using 11025 Hz, you may use 22050 or 44100 Hz). Also the
"Pause" and "Stop the tape" commands work just fine and can be used.
TZX2WAV can display information on internal TZX file structure, instead of
creating any output file, using "-i" switch. A verbosely extended information
is available using "-v" switch, for those interested in the inners of TZX.
By default, the groups are not displayed expanded, i.e. only the group name
is shown and not what is inside that group. If you would like to expand the
groups, then use the "-x" switch. This is only relevant when displaying info
one line per block (or converting the TZX tape). In verbose mode, ALL blocks
are always displayed.
Some Amstrad CPC, SAM Coupe and Commodore 64 files are identified with
specific "Hardware Info" block. Some internal header names in these platforms
are able to be displayed if recognized. Non-standard loaders will just be
represented by the length of the block and names won't be displayed on screen,
but correct WAV/CSW files will be created.
If no output file is given, then the program will use the same filename as
the .TZX one, and change the extension to .WAV or .CSW accordingly.
If you don't want to convert or see all blocks then you can specify the
starting and ending block with "-b" and "-e" switches.
-----------------------------------------------------------------------------
Command Line Syntax: TZX2WAV [switches] FILE.TZX [FILE.WAV|CSW]
-f n : This will set the sampling frequency to n Hz. The default sampling
frequency for WAV conversion is 44100 Hz, so it doesn't need to be
resampled for CD Audio, but if you wish higher fidelity or even
storage for DVD, you can generate 48000 Hz or any other rate.
-s : This NEW switch will automatically generate STEREO WAV files that
can be directly imported into any burning CD program without any
further processing, or channel duplication.
-r : This will reverse the signal of the whole wave data. If a C64 tape
does not work on the C64, then try using this switch !
-c1 : This will create a .CSW file instead generating a .WAV mono file.
CSW v1.01 was the first specification of these format. The highest
frequency that can be used here is 65535 Hz (16-bit counter).
-c2 : This will create a .CSW file instead generating a .WAV mono file.
CSW v2.00 offers far more compression than CSW v1.01 format.
When converting extremely high-speed loading files, it's suggested to
use 96000 Hz sampling frequency with CSW 2.00, as size won't increase.
-i : This will show ONE line of information per block, just displaying the
same output when in normal operation, but the WAV/CWS files will NOT
be created. The starting byte (in hexadecimal format) of each block
is written after the block number.
-v : This will show very extensive information about all the blocks within
the TZX file. Some blocks have not yet been tested (such as Snapshot,
or Custom Info) but they *should* work OK anyway. The starting byte
of each block is also written in the () brackets.
-x : Will expand the tape groups. By default the groups are displayed in
collapsed mode (i.e. only the group name is displayed and not the
blocks in it) but with this switch ALL blocks will be displayed.
-b n : Start conversion of the tape at block n. The first block got the
number 1. ALL blocks (including Info, group,...) are numbered.
-e n : Stop conversion of the tape AFTER block n. Block n will be played.
(i.e. if you use -b 3 -e 5 then blocks 3, 4 and 5 will be played)
-p : This NEW switch changes its meaning. Now when used, the pause value of
the last block in TZX file is overridden and set to zero, in order to
deal with some malformed TZX files. Anyway, TZX2WAV will *always* add
200 milliseconds of silence at the end of the wave file.
-128 : This will activate 128K mode. Only relevant if the TZX file has any
"Stop the tape if in 48K mode" special block. If enabled, this
switch will ignore all these blocks. Otherwise 5 seconds of silence.
will be generated in the wave file.
-----------------------------------------------------------------------------
* TZX2WAV 0.2 Beta (25th February 2006)
- Stereo WAV files can be created for direct import into CD burning tools.
- CSW 2.0 ZLIB comppresed files can be generated with "-c2" switch.
- We can override the pause information of the last block with "p" switch.
- The program C source has been optimized and severely reorganized.
* TZX2WAV 0.1 Beta (15th January 2005)
- First Public release based on PLAYTZX 0.60b
Source code is provided with the official archive release, just in case you
would like to port this utility to some other computer or operating system.
The zlib library source MUST be downloaded separately from http://www.zlib.net
Do not hesitate to contact me at the address on top of this document for
bug report or other kind of feedback.
The latest revision of TZX2WAV, the TZX format docs and other TZX utilities
amongst other TZX game files, should be available at "World of Spectrum" web,
which is mantained by Martijn van der Heide:
http://www.worldofspectrum.org/
-----------------------------------------------------------------------------
Francisco Javier "Black Hole" Crespo
Madrid @ Spain - 2006