home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.sys.tandy      Life is dandy cuz you're gettin a Tandy!      5,684 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,536 of 5,684   
   tim lindner to dado   
   Re: coco2 and bin files   
   13 May 07 09:19:21   
   
   From: fake@example.com   
      
   dado  wrote:   
      
   > HI.   
   > How to conwert .bin games to wav or mp3 and load in coco2 ?   
   > Thanks   
      
   The bin file is most likely RSDOS binary files. RSDOS supports   
   segemented binaries and the Color BASIC cassette format does not.   
      
   So to determine if it is possible do this conversion, you need to   
   determine if the bin file has more that one segment.   
      
   Lets look at the format for a bin file:   
      
   Preamble Block:   
     Offset   Size                 Meaning   
     0        1                    00 - Preamble flag   
     1        2                    Length of data block   
     3        2                    Load Address   
      
   Data Block:   
     Offset   Size                 Meaning   
     0        taken from preamble  data to be stored in RAM   
      
   [additional preamble and data blocks as necessary]   
      
   Postamble Block:   
     Offset  Size                  Meaning   
     0       1                     FF - Postamble flag   
     1       2                     0000 - reserved   
     3       2                     Execution address   
      
   So determine if your bin files has multiple data blocks. If so, then you   
   can't convert it into a single Color BASIC cassette file.   
      
   Next you'll need to determine if the program code requires Disk BASIC.   
   You'll want to disasemble the data blocks and look for things like:   
      
     Jumps into ROM at $C000-$EFFF (Disk BASIC ROM)   
     Reads and writes to $FF40, and $FF48-$FF4B (Disk controller I/O)   
      
   No point of converting the file if it needs hardware you don't have.   
      
   Now to make the Color BASIC cassette file. The file is make up of a   
   sinusoildal wave of 1200 hertz representating a zero bit and 2400 hertz   
   representating a one bit. A byte is recorded (little end first) by using   
   these wave forms in series.   
      
       Asside:   
         My measurements suggest the actualy frequency values are   
         1094.68085106384 and 2004.54545454545 hertz.   
      
   The Color BASIC cassette file is also made up of blocks, a key   
   difference is the blocks have a maximum size.   
      
   The first block is called a leader it is 128 bytes of value $55. Leader   
   blocks are always inserted into the stream if a gap between 2 block   
   required the tape drive motor to be stopped. This happens between files   
   and even between blocks in the same file if long computation was   
   required before writing the next block.   
      
   Color BASIC uses the leader for timing purposes.   
      
   The next block is a header block:   
      
     Offset  Size            Meaning   
     0       2               553C - Block start   
     2       1               00 - Header block flag   
     3       1               0F - Header blck size (in bytes)   
     4       8               Filename   
     12      1               File type - 0 BASIC, 1 DATA, 2 M/L Binary   
     13      1               Data Type - 0 binary, FF ASCII   
     14      1               Gap Flag - 0 no gaps, FF gaps   
     15      2               Start Address   
     17      2               Execution Address   
     19      1               Checksum from offset 2 thru 18, init with zero   
     20      1               55 - End ID   
      
   After the header block Color BASIC needs a half second to process the   
   data, then another leader block.   
      
   Now a series of data blocks:   
      
     Offset  Size           Meaning   
     0       2              553C - Block start   
     2       1              01 - Data Block flag   
     3       1              Block size   
     4       X              Data bytes   
     4+X     1              Checksum from offset 2 thru X, init with zero   
     5+x     1              55 - End ID   
      
   I measured about 0.003 seconds between each data block, with no leader   
   if the the motor is not stopped.   
      
   Finally an End of File block:   
      
     Offset  Size           Meaning   
     0       2              553C - Block start   
     2       1              FF - EOF Block flag   
     3       1              00 - Size   
     4       1              checksum from offsets 2 thru 3, init with zero   
     5       1              55 - End ID   
      
   Recently I added a utility called makewav to the Toolshed project on   
   SourceForge. Normally makewav take S Records as input, but I just added   
   a raw binary option. You can use this raw option to put extracted data   
   from the bin file into a wav file.   
      
   Later, I may add direct support of converting Disk BASIC bin files to   
   Color BASIC casette files.   
      
   Toolshed is suppilied only as source, no executable binaries. The build   
   files for unix and Mac OS X are up to date. But Windows build file are   
   not, it'll take a porter to bring them up to date.   
      
   --   
   The ears are too length.   
   --------------------------------------------------------------   
   tim lindner:        First initial last name at macmess dot org   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca