Author Topic: DSK2CDT2DISC - get disc images onto your CPC via... a tape?!  (Read 7521 times)

0 Members and 2 Guests are viewing this topic.

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 590
  • Country: au
    • index.php?action=treasury
  • Liked: 298
  • Likes Given: 172

Here's the initial release of my silly disc imaging tool, DSK2CDT2DISC.


Given a disc image, it'll give you a tape image that writes the disc to your A drive when you load it on your CPC.

pelrun/dsk2cdt2disc ยท GitHub


I'm sure it might be of use to somebody. :D


PS: it uses high baud rates to reduce the time taken to spool out the disc image, so it'll probably not work if you record it to an actual tape. But playback from your PC or tapdancer should work.


PPS: I haven't actually tested it outside an emulator yet  :laugh:

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 590
  • Country: au
    • index.php?action=treasury
  • Liked: 298
  • Likes Given: 172
Maybe next I should write the inverse - a program that dumps a dsk image out to tape.  :P

Offline jrodriguezv

  • CPC664
  • ***
  • Posts: 53
  • Country: es
  • Liked: 15
  • Likes Given: 19
Thanks for this tool! Good work!!

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.451
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3084
  • Likes Given: 5675
In what scenarios would that be of use? Only thing I can think is if you load the tape image through a mp3 tape or other audio output/input and you have a disk drive but no way to transfer a dsk onto a real disk?

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 590
  • Country: au
    • index.php?action=treasury
  • Liked: 298
  • Likes Given: 172
You pretty much answered your question. Also because I could, and it was kinda funny. :D

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.451
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3084
  • Likes Given: 5675
Ha, actually the second part was the first that came to mind :D

Be it as it may, I think some will find it useful!

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2261
  • Likes Given: 3478
In what scenarios would that be of use? Only thing I can think is if you load the tape image through a mp3 tape or other audio output/input and you have a disk drive but no way to transfer a dsk onto a real disk?

Exactly e.g.

1. You have a CPC6128 with no 3.5" drive.
2. You have a CPC with a 3" or 3.5" drive but you don't have a PC with a 3.5" drive (e.g. a new pc).
3. You have a 3.5" USB drive on the PC but you want to write a copy protected cpc disc.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline jbaudrand

  • CPC6128
  • ****
  • Posts: 171
  • Country: fr
  • Liked: 19
  • Likes Given: 16
I haven't cable to test it, but I'm curious: is it working with original dsk? like strange copy protected format (defender of the crow...) If yes it can be worthing restore my original disc...

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 590
  • Country: au
    • index.php?action=treasury
  • Liked: 298
  • Likes Given: 172
I've had mixed results on my actual CPC (compared to the emulator), although that's largely because there's still a few bugs in it.


There will be formats that it can't write; it's limited by what the CPC can do (e.g. those 8k sector discs that an unmodified CPC can't write successfully.)

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 590
  • Country: au
    • index.php?action=treasury
  • Liked: 298
  • Likes Given: 172
Aaaand it looks like at least one of the dumps of Defender of the Crown on CPC Power uses 8k sectors. Yuck.

Offline ralferoo

  • Supporter
  • 6128 Plus
  • *
  • Posts: 969
  • Country: gb
  • Liked: 581
  • Likes Given: 222
In what scenarios would that be of use? Only thing I can think is if you load the tape image through a mp3 tape or other audio output/input and you have a disk drive but no way to transfer a dsk onto a real disk?
This would be exactly why I'd find it useful. I have one working 6128 but no easy way to get data onto the disk.

Also, tape is awesome, obviously! :)

Offline steve

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.263
  • Country: gb
  • Liked: 178
  • Likes Given: 210

Also, tape is awesome, obviously! :)


Sony have developed a way of putting 185TB of data onto a cassette tape. (special tape and drive, obviously) ;D .

Sony Crams 3,700 Blu-Rays' Worth of Storage in a Single Cassette Tape
Sony Crams 3,700 Blu-Rays' Worth of Storage in a Single Cassette Tape
« Last Edit: 04:01, 05 May 14 by steve »

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.451
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3084
  • Likes Given: 5675
Also, tape is awesome, obviously! :)


Amen to that!


* Gryzor loves his tapes

Offline cngsoft

  • CPC664
  • ***
  • Posts: 144
  • Country: es
  • Liked: 527
  • Likes Given: 356
Maybe next I should write the inverse - a program that dumps a dsk image out to tape.  :P
Someday, once I'm done with the final exams and papers, I'll have to write the counterpart to CALLBCA1: CALLBC9E, the firmware-compatible tape saver; and so you'll have the code required to dump discs on tape at 4000 baud.
(if you can't see the banner right now my server is currently offline)

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.451
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3084
  • Likes Given: 5675
For real??

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 590
  • Country: au
    • index.php?action=treasury
  • Liked: 298
  • Likes Given: 172
I just got alerted that the download on the github page was creating bogus CDTs; turns out the CPC wants dos line endings when loading ASCII basic files! When I built dsk2cdt locally (under windows) it was fine, but the online download was built on a linux box, and the loader program got checked out with unix line endings. Whoops!


(I guess nobody was using it, since this has been broken for everyone but me for a couple of years. But it's fixed now!)

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.768
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1016
  • Likes Given: 1724



(I guess nobody was using it, since this has been broken for everyone but me for a couple of years. But it's fixed now!)


Sadly there's always a risk of writing something that no-one may use 


But the idea is interesting.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline khaz

  • 464 Plus
  • *****
  • Posts: 490
  • Country: fr
  • Liked: 252
  • Likes Given: 69
No that's cool, I'm trying it right now.

DSK2CDT2DISC
Ok, I get the DSK2CDT part, I have a side1.cdt. But CDT2DISC? I still need to use a CDT to WAV and an audio player now.

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 590
  • Country: au
    • index.php?action=treasury
  • Liked: 298
  • Likes Given: 172
I didn't think it was that confusing - if you load that cdt it'll write the disc image to the A drive.

This is only a niche tool that I wrote as a joke - it's useful if you don't have any other way of getting images into discs, but that's about it.

Offline khaz

  • 464 Plus
  • *****
  • Posts: 490
  • Country: fr
  • Liked: 252
  • Likes Given: 69
Oh ok. I thought it would automatically convert that cdt to wav and play it. That would have been neat actually.

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.768
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1016
  • Likes Given: 1724
I didn't think it was that confusing - if you load that cdt it'll write the disc image to the A drive.


So the 1st program to load would be a Transfer to Disc program like the one found when AA first had regular monthly Covertapes, I think the 1st tape to have that was Tape 3 which had Spindizzy & Wizards Lair on it.



I recall a similar sort of program being published in the AA type-ins around that time called Archiver (in AA65), but I think it was very specific in what operations it would carry out.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 590
  • Country: au
    • index.php?action=treasury
  • Liked: 298
  • Likes Given: 172
Now I'm getting confused. This has nothing to do with existing tape software. This is just a way to get disc images from the PC over to the CPC if all you have is a tape cable.

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.768
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1016
  • Likes Given: 1724
Now I'm getting confused. This has nothing to do with existing tape software. This is just a way to get disc images from the PC over to the CPC if all you have is a tape cable.


Yep, so your program takes a DSK image, makes a CDT, the CDT can be loaded on the CPC, so the 1st file on the CDT will take the remaining Files and transfer to Disc?
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 590
  • Country: au
    • index.php?action=treasury
  • Liked: 298
  • Likes Given: 172
Ah now I understand - I thought you were talking about using other tape utilities  :picard:


You're pretty much correct - but the tape doesn't contain the files from the dsk image, it contains the compressed image itself.

Offline khaz

  • 464 Plus
  • *****
  • Posts: 490
  • Country: fr
  • Liked: 252
  • Likes Given: 69
Here is a small windows batch script that converts a dsk into a cdt, then into a wav, then plays it, and close. Just drag and drop the dsk on it, or use the command line.
It's using powershell to play the sound, so Windows 7 and onwards by default. For older Windows, you need to install it, or modify the script to use your favourite player, like vlc.exe --play-and-exit side1.wav or the small command-line sounder.exe.

Code: [Select]
dsk2cdt.exe %1
TZX2WAV.EXE side1.cdt
powershell -c (New-Object Media.SoundPlayer side1.wav).PlaySync();
DEL side1.*
IF EXIST side2.cdt (
TZX2WAV.EXE side2.cdt
ECHO SIDE 2 is about to play. Is your CPC ready?
PAUSE
powershell -c (New-Object Media.SoundPlayer side2.wav).PlaySync();
DEL side2.*
)
(Can't wait for cmd.exe to be deprecated in favour of bash)

software used:
- Downloads | dsk2cdt2disc
- http://www.worldofspectrum.org/pub/sinclair/tools/pc/TZX2WAV_02b.zip
optional
- VideoLAN - Official page for VLC media player, the Open Source video framework!
- sounder.exe - play a wav file from the command line