Giter VIP home page Giter VIP logo

tcx_tools's Introduction

TCX-Tools

This is set of simple python scripts, to analyze, convert and manipulate data in TCX, XEX and CAS file formats. This file formats can be used on 8-bit Atari machines, and it's emulators or peripherals emulators.

At this moment it is just two simple python scripts, but in future probably I add more tools. All those was created for archiving files from images of old cassettes recorded with Turbo Copy 3 or Turbo Copy 4 program for 8-bit Atari machines.

I have hope that this can help people from polish Atari community to preserve their historic tape resources, from the '80 and '90.

This is very simple & lame python code, I never programmed in Python so this is an experiment form me, maybe it can learn me something new? ;)

Turbo Copy 3 & Turbo Copy 4

Turbo Copy 3/4 was a program for 8-bit Atari machines that can copy plain Atari DOS executable files to tape. The copy program also protests the saved file by generating non-standard shorter record (only 6 bytes length) before the rest of data records, so that's kind of generated recordings can't be copied by any standard copy program. The saved data records is compressed by the simple RLE algorithm, simple XOR-based cipher is also can enabled for the data stream.

Because files was generated by Turbo Copy 3/4, so I decided the file extension TCX will be good selection for those kind of files.

Technical Info

tcx_rle_decoder.py is Turbo Copy 3/Turbo Copy 4 data stream analyzer & decoder. This simple script was created to to extract files from old tape images, that was recovered and shared by various people on "atari.area" and "atarionnlie" forums.

The data structure is "guessed" from loader code, I'm not sure this will be correct for all cases, because I have only a few example files.

The data stream generated by the Turbo Copy 3/4 can be also encrypted by simple XOR function (all data stream is XOR-ed by single byte cipher-key). The data stream is also compressed by simple RLE algorithm with use of two escape codes 0xBF, 0xCF. If the 0xBF byte is found in input data stream then the loader gets next byte that is number of repetition of zero byte in output stream. When 0xCF byte is found by the loader in the input stream, then loader gets next two bytes, one is number of repetitions, and the second one is repeated byte.

This simple python script can decompress that type of stream, and can decipher the stream. If data-stream is encrypted, the XOR key value is detected and used to decode the data. Normally the XOR key is stored in loader code, but TCX files don't include the original loader body. That's because the cipher key can be easily calculated from header of input stream data).

Some example files that I have from people also have some garbage at the end of file, also some file have malformed header-blocks, or missing data (the files is just corrupted). Script try to detects it and remove any garbage data, but not in all cases this can be done automatically. That;s why the script prints all the information about the structure of the data file, so user can eventually fix the data file manually.

The example files can't be added to this repository, because I don't want violate any copyrights rights. It can be easily found on the the network.

chkxex.py is as simple Atari DOS binary files analyzer, it can be used to verify the correctness of generated files or to analyze the structure of any other Atari DOS binary files.

Running the code

Code is written in Python. I used 3.7.3 under Debian/Linux, and the 3.8.2 version under Windows 7 to test, run those scripts. To run just type python3 tcx_rle_decoder.py input_filename from command line, or python3 chkxex.py input_filename

Thanks & Greetings

Many thanks to QTZ, Krap, Dely and other people from atari.area forum for sharing their memories, files, and information from the past. Also big thanks for Stryker for providing many example files in his cas-archive collection.

TODO

  • add the disassembled source code of loader (need some code cleanup and add some comments)
  • write a copy program for 8-bit Atari that can copy the protected files and save plain Atari DOS file.
  • try recover the Turbo Copy 3/Turbo Copy 4 original program from 5.25" floppy disk (the program have copy protection)
  • write a CAS <--> TCX file converter (at this moment a8cas software must be used to extract data from .CAS file)

Poetic License

This work 'as-is' we provide.

No warranty express or implied.

We've done our best,

to debug and test.

Liability for damages denied.

Permission is granted hereby,

to copy, share, and modify.

Use as is fit,

free or for profit.

These rights, on this notice, rely.

tcx_tools's People

Contributors

seban-slt avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.