Anybody know what program can:

edited April 2007 in Development
Does anybody know of a PC program (or a "set") that can scan through a BASIC program, and replace "D*, D1 or D2" with two spaces. Then, save that scanned BASIC program as a TZX or TAP file?

On the Spectrum, DT Toolkit does exactly this, but adds silly beeps to the start or end of the file, and wheras I could live with that, it doesn't actually help too much as I still then have to save the altered file to the PC anyway.

To explain better what I need, I'll explain what I want to use it for. Pretty things like menus would be nice, but not necessary.

First, I want to scan a basic loader program and remove the +D loading syntax and replace with tape loading syntax. This is as easy as simply removing all occurances of D*, D1 or D2. Rather than alter the file length, I replace these two characters with spaces. I then compare filenames, as tape IS case sensitive, +D floppy isn't. I simply make sure they match. I then resave this file to +D floppy. Then I load Transit and copy the BASIC, screen and main file block to the PC running Cool Edit. Then I TZX the wav files and load them into Spectaculator AND a real Spectrum to test them. If they pass I save them to the proper folder on my hard drive. I then update my (as yet unpublished) website accordingly.

If I could do this on the PC, it would save so much time, but no emulator I know of can either handle +D floppies or save files as TZX/TAP. RealSpec comes close, it's just really too difficult to get to grips with.
Post edited by DEATH on
Oh bugger!<br>

Comments

  • edited April 2007
    BASin can do this for you. Save the program as a snap and load it into BASin - or try loading the program from TZX directly into BASin - and then either use the search/replace functions to do the job, or save it as a .bas and open it in your favourite text editor.

    Edit: Can you not create +D disk images and put those up on the web? It's not as if the +D isn't widely supported.

    D.
  • domdom
    edited April 2007
    I've now got a compile of that +D disc dumper for windows that seems to work. Any use for you?
  • edited April 2007
    Dunny wrote: »
    BASin can do this for you. Save the program as a snap and load it into BASin - or try loading the program from TZX directly into BASin - and then either use the search/replace functions to do the job, or save it as a .bas and open it in your favourite text editor.

    Edit: Can you not create +D disk images and put those up on the web? It's not as if the +D isn't widely supported.

    D.

    Hmmm, but it doesn't seem to be supported widely enough. There's nothing I can find that will read and write directly to a +D floppy (in the A: drive f a PC) Now if SAMDISK could extract all the files from an image or real floppy, then that would be half of what I need. Taper (and maybe Tapir) could do the rest.

    Paul, sorry mate, I sound so ungrateful - I'd use BASin if it would save me some time, but I don't think it will.

    BASin does everything except work directly with MGT images - so I have to tap/tzx the files I want to convert in the first place, which involves sampling. I may as well manually alter the loading syntax before I sample it.
    Oh bugger!<br>
  • edited April 2007
    dom wrote: »
    I've now got a compile of that +D disc dumper for windows that seems to work. Any use for you?

    Dom, I've seen you post before. I don't suppose you are Mr M are you?

    Anyway, what does your program do? If it dumps off all the files from a +D disk (or image), then yes, that would be very useful indeed - I can then use BASin as Paul suggested to alter the loading syntax. Can I put files back onto a disk/into an image file?
    Oh bugger!<br>
  • domdom
    edited April 2007
    Well Dr M :) It basically saves all the files on a +D disc to individual .TAP files which can then be joined together hacked/whatever is wanted. The disc image is a raw dump of the disc (either through a linux like dd if=/dev/fd0 or extracted from a .TD0 using wteledsk)

    It doesn't support saving files to the disc image but give me a couple of years and I'll get around to adding it! :) If it's helpful, download it from http://www.rst38.org.uk/spectrum/pdread.zip
  • edited April 2007
    Dr? Well, I know it's been a while and you've never used the title to my knowledge before - I assume it's recently aquired?

    I still use DiscDOS even today! It's good to see you on here Dom.



    Lloyd.
    Oh bugger!<br>
  • edited April 2007
    Could you load the .MGT file into a hex editor and do a search and replace?
  • oboobo
    edited April 2007
    DEATH wrote: »
    There's nothing I can find that will read and write directly to a +D floppy (in the A: drive f a PC)
    The Windows version of RealSpec (RS32) can deal with real +D floppies, if you can do what you need with that? Or just create a disk image of them (less than a minute in SamDisk) and use another utility to do whatever.
    Now if SAMDISK could extract all the files from an image or real floppy, then that would be half of what I need.
    I've been concentrating on the image side of it, but since SamDisk/dir a: shows MGT files, it would be useful to have a feature to bulk-extract them too. I probably won't have anything for adding files to existing images for quite a while, but there are a number other solutions for that...

    I still use Disk Image Manager for adding/removing individual files from disks, though it'll give tokenised BASIC blobs rather than text, which might not be what you want. It does have real disk support, but only for Win9x. You also need to rename your .mgt images to have a .dsk extension before the program will let you open them, to match what the old-style SAM images used.

    Si
  • edited April 2007
    I've always found RealSpec to be cumbersome and difficult to use, and do the "by hand" method in preference to using it.

    Dom sent a link that would rip the files off a disk, and that's half the battle. I can use Dunny's program to edit the Basic bits and then maybe TAPIR to make a single TZX of all the files that make up a particular game. Since it all gets done on a PC, it should be faster. :)

    Thanks to all those who helped, assuming things go to plan, my problem should be solved :)
    Oh bugger!<br>
  • edited April 2007
    dekh wrote: »
    Could you load the .MGT file into a hex editor and do a search and replace?

    Now that's an idea!

    I wonder if there would be a checksium or something error....

    Only one way to find out!
    Oh bugger!<br>
  • oboobo
    edited April 2007
    DEATH wrote: »
    I wonder if there would be a checksium or something error....
    There are no checksums to worry about, so the replacement shouldn't break anything.

    You may have to take care of the (unlikely) cases where the string you're searching for is split across a sector boundary. The final 2 bytes in most MGT sectors hold the track+sector for the next block, and it's possible the "D1" is split across that. I suppose you could still bulk-extract and then do the search and replace on the BASIC files.

    Si
  • edited April 2007
    IIRC The +MGT format is a byte for byte image of the data on the disc it doesn't have any sector markings that I remember.

    Is there a published spec for the format? Have I asked this before? The RealSpectrum site has a fair bit of info on the PlusD.

    When a basic prog is saved to disk is it similar to saving to tape in that you get two copies of the program, 1 that is the bytes in memory that are actually interpreted when run and 1 that is the ytes displayed when the prog is listed?

    Have you tried zxspin's support of the PlusD yet? that might help speed up testing after a search and replace.

    I also find RealSpec difficult to use (not impossible) but it also seems to mess with that files if they are overwritten in the disc images, but I can't pin that down just yet.
  • oboobo
    edited April 2007
    dekh wrote: »
    IIRC The +MGT format is a byte for byte image of the data on the disc it doesn't have any sector markings that I remember.
    MGT is a raw sector dump, but the track+sector chaining values are present on the original disks too - only 510 bytes of each sector are used for data with most file types. "SPECIAL" and "OPENTYPE" files use the entire sector, so you have to rely on the allocation table bits in the order they're set.

    Si
  • edited April 2007
    Well, Paul, Dom, Andy and Si - cheers guys, I think I have the problem sorted out now. I had to grab a hex editor and ended up with Cygnus Hex ed. Seems to work just great! Andy, your idea was a stroke of genius!

    I've done a small test on Utils disk 1 from the library, and so far, all the files want to load from tape - which is EXACTLY how I want them. I still have to get them over to the PC, but Dom's program will save me having to send them via tape.

    I appreciate the help guys, if ya ever get a duff Speccy, you know where to send it......


    Lloyd.
    Oh bugger!<br>
  • edited April 2007
    Speccy Heaven?

    On a small wooden raft?

    Burning in a blaze of glory?

    The util we need here is one which can lift the code from the disk and drop it straight into a .tzx...

    Wasn't there a post earlier today about something similar?
  • edited April 2007
    DEATH wrote: »
    There's nothing I can find that will read and write directly to a +D floppy (in the A: drive f a PC)
    try 'plus d tools' its a set of command line tools to convert images to real disks and vice versa
  • edited April 2007
    Isn't there a utility in the library called REPLACER? I definetly used something like that to replace d1 with d* one more than one occasion.
  • edited April 2007
    Na, it's DT Toolkit you're thinking of - replaces the d* with two spaces then saves to tape. Has an annoying beep though that sometimes screws up the conversion process and still takes just as long as doingthings by hand.

    Thanks to an idea by Dekh and software by (among others) Dunny, Woody and Simon, the process is now very much speeded up as it's done on the PC. Only now use the Spectrum to test :) I also have somebody helping now too, with ready to run TZX files. All I do is test!
    Oh bugger!<br>
Sign In or Register to comment.