Tips for using sd2iec

It’s been already a while since I got the uIEC – one of the available hardware running the sd2iec firmware. I did some experimenting with it on how to make the best use of it if the nicely accompanying JiffyDOS is not present. I posted my experiences at Lemon64 forums, but I thought it would be nice to share them here as well. Still, you might want to read that instead for shorter, less detailed description.

Note that I’m describing sd2iec-firmware being used on uIEC/SD-hardware with Commodore 64. Many different hardware combinations are possible.

The principle

With sd2iec loading files from the SD card’s root folder is like loading files from a floppy disk. The very basic loading procedure is exactly the same – except that the default device number is not 8 but 10. So LOAD”$”,10 or LOAD”GAME”,10,1 works just like one would expect.

Things get more complicated if you want anything more. Something like to enter a directory on the SD card or to mount a .d64 disk image. A real Commodore disk drive wasn’t designed for such things so you don’t even have the commands for something like that. Since uIEC is connected only to the serial port of C64 it can be interfaced only using the IEC bus. Enter the command channel! Everything like directory navigation, disk image mounting and device configuration is done by sending drive commands over the command channel.

The Drive Commands and Command Channel

The standard drive command syntax is:

OPEN 1,[device id],15,”[command]”:CLOSE 1

where [device id] is the device number of uIEC and [command] is the command for sd2iec. The sd2iec user manual and a list of commands can be found here, on the sd2iec project page.

Using the standard syntax is very awkward – you don’t want that. Instead, you’ll be happy with DOS Wedge. With DOS Wedge you are able to use the much nicer syntax that is simply:

@[command]

DOS Wedge

DOS Wedge is a command extension software that originally came with 1541 demo disk. I copied the DOS Wedge files “C-64 WEDGE” and “DOS 5.1” to the root of the SD card from the demo disk. If you use PC for copying the files from e.g. a disk image you might want to remove the .prg file extension from the files. Otherwise sd2iec will include the file extension as part of the file name on the C64.

When DOS Wedge is on the SD card you are able to load it from there. Note that the DOS Wedge is set to work with device number 8 by default. Without modification it will fail operating with any other device number. To resolve this, the C-64 WEDGE can be modified to match the device number of uIEC. The file “C-64 WEDGE” is just a simple BASIC program that loads the actual software from the file called “DOS 5.1”. It’s easy to do the needed modification if you have even the slightest understanding of BASIC. On the C-64 WEDGE program listing at the end of line 10 it reads LOAD”DOS 5.1″,8,1. Edit this loading command to match your uIEC device number. Then save your modified program.

Editing C-64 WEDGE BASIC program

If you like things made ready for you, look at the end of this post for bonus download with already modified files.

Many utility and fastload cartridges also have the DOS Wedge command set or similar built-in. For example Action Replay is very useful even though its fastloader is not supported by sd2iec. Loading does work with Action Replay fastloader activated, but the loading reverts to kernal routine speeds. You still have all the Action Replay’s single-stroke directory listing and program loading and execution shortcuts and you can send drive commands using the @[command] method.

Speeding up loading times

DOS Wedge makes the using of sd2iec device much more convenient, but it won’t help the loading speed. A sd2iec device is practically as slow as a real disk drive because of the very, very slow standard data transfer protocol. If JiffyDOS were installed on the C64, the loading would be much faster. But when it’s not, a software implementation of the JiffyDOS transfer protocol comes into aid: SJLOAD.

Loading with SJLOAD from sd2iec device is very fast! Check the SJLOAD C64 DTV Hacking Wiki page for usage instructions. Especially note the command:

LOAD”!*PROGRAM”,[device id],1

As it says on the Wiki page, this loading command autostarts SJLOAD and then fast-loads the given program! A very nice shortcut. The SJLOAD program file “!” has to be in same folder as the program to load this way though. You can also first load the SJLOAD alone and then start browsing the SD card. When SJLOAD is activated the command channel syntax is a little different. It’s VERIFY”[command]”. So changing into a directory would be VERIFY”CD:GAMES”. Also SJLOAD assumes the device number to be 8. This can be worked around in most cases by adding the right device number at the end of the command. Examples using the device number 10:

LOAD”!”,10,1 //load and autostart SJLOAD
VERIFY”CD:GAMES”,10 //change into directory GAMES
VERIFY”$”,10 //display directory
LOAD”PROGRAM”,10 //load file called PROGRAM

According to sd2iec documentation there are various other supported software fastloaders. Non-supported fastloaders will fail.

It is also worth mentioning that some cartridge fastloaders and also KERNAL fastloaders other than JiffyDOS are supported by sd2iec. Compatible cartridges include The Final Cartridge III (as noted by Andreas in the comments) and Epyx Fastload Cartridge. Other KERNAL fastloaders that will work are e.g. EXOS V3 and The Beast System.

File browsers

The easiest way to browse the SD card and run programs is to use CBM FileBrowser or some similar program. CBM FileBrowser or other available file browsers make it really convenient to browse the SD card contents and launch the programs. But the slow loading speed remains.

Use SJLOAD with DOS Wedge or CBM FileBrowser

Things get really swift if you combine the usability of DOS wedge or CBM FileBrowser with the loading speed of SJLOAD. Here’s how you do it for DOS Wedge:

  1. Load and run DOS Wedge
  2. Load SJLOAD (can be simply done by entering “%!”)

Now you can use DOS Wedge as usual, but the only drawback is that you have to use the traditional loading command LOAD”PROGRAM”,[device id],1. The nearly instant loading speed should make it up though.

And for CBM FileBrowser & SJLOAD combination, enter the following (with appropriate device id):

  1. LOAD”!*FB64″,10,1
  2. RUN

Now you can browse the SD card with CBM FileBrowser as usual, but loading happens nearly instantly. If you only want to launch games etc. from your memory card, this method will surely not fall much behind from JiffyDOS equipped C64.

Other utilities

For copying between sd card and a real commodore disk drive or transferring disk images I’d suggest trying CBM-Command or DraCopy.

Bonus download

Here is a pack of files that you can directly put into your sd2iec device’s SD card and you’re off with the above mentioned things. These files are SJLOAD (!), CBM FileBrowser C64 (fb64) and DOS Wedge loader for different device numbers (WEDGEn, n=device ID). The same files are also included in .d64 disk image. For DOS Wedge you will need the file DOS 5.1 from 1541 Demo Disk. I did not include it because it is copyrighted piece of software.

Bonus pack (zip, 6 kb)

I’m glad if you will find these tips useful for your C64 retro computing pleasure!

26 Responses to Tips for using sd2iec

  1. Chris says:

    Great article, thanks! How easy is it to switch between disk images once a game is up and running though? I assume you can’t get into the Filebrowser at that point.

  2. ilesj says:

    File browser can not be accessed, but two possibilities comes to my mind:

    At least with uIEC and its daughter card it’s very easy with some preparations. One of the buttons in the daughter card can be used for disk change. This requires a swap list file on the folder that is currently in use. Search for chapter “Changing Disk Images” in sd2iec readme file (link in article).

    The other way I can think of is with the help of a freezer cartridge. Freeze the game, and if there is a way to enter drive commands in the freezer menu, you should be able to change disk images or what ever :)

  3. xdr says:

    I found a couple of problems with using these on sd2iec, namely the sjload wont start, it just resets c64. Maybe this one is for uIEC only or device #10?
    With recent updates there is two buttons you can use to switch disks, next and previous.

  4. ilesj says:

    It’s hard to tell what causes the SJLOAD to reset your C64, but it should work with both SD2IEC and uIEC as they run the same firmware. It’s definetely not uIEC only, as SJLOAD can be used also with JiffyDOS equipped floppy drive.

    SJLOAD itself can be of course loaded from any device number and it works with any device number in most cases.

    Everything else works OK and you can load other files with your SD2IEC?

  5. […] anything like me, you’ll probably insert it upside down. Like I did. But bloggers like Ilesj are helpful, and I wanted to do something similar. Please comment if you find any mistakes or have […]

  6. Andreas says:

    Very interesting article, but from own experiences with my SD2IEC i knew the most things before. One thing you should mention too – when using, for example a SD2IEC, together with the Final-Cartridge-3, then the fastloader of the cartridge also stay alive, when using SD2BRWSE or CBM-Filebrowser. Which makes it very easy to use, when renaming the filebrowser then to “00” and copying it in every folder on the SD-Card. Because then this is always the first file in every folder and can be loaded with a simple click on F5, where the FC3 has the command “load”*”,8,1″.So this is perfect solution. No more typing anyway, just turn on C64, press one time F5 and CBM-Browser is loaded, then press F3 to run it. And now you have Filebrowser with active FC3-Fastloader. Start a game – when you want to play the next – make Reset on FC3-Cartridge, click F5 then F3 and Browser is ready again for the next game. In my opinion, the perfect solution to wirk with SD2IE. You just need a good cartridge with a compatible fastloader, like for example the Final-Cartridge-3.

    • ilesj says:

      Thanks, those are good points. I added a mentioning about compatible cartridge and kernal fast laoders to the article.

  7. Andreas says:

    One thing i forgot in my post above – that the thing with the F5-loading works, you must let a file-sorter over your SD-Card before, because only then the files are sorted alphabetically. Otherwise the SD2IEC sort the files on the date of origin.

  8. Tuksu says:

    The date of origin approach does not seem to work, at least for me. Can somebody recommend a file-sorter that would run on a Windows-PC or a Mac? Ubuntu would do as well.

  9. Mr. Bróg says:

    Will SJLOAD improve load times on directory listings aswell? A directory with hundreds of files takes ages to read, at least in the cbm filebrowser.

  10. Andreas says:

    Tuksu look here, this works perfect as a file-sorter: http://filetrip.net/others-downloads/dingoo-systems/start-dingoo-file-organizing-tool-10-f9735.html
    This windows-program was actually written to sort files on a SD-Card for the Dingoo-Handheld, but it works for every hardware which dont sort files alphabetically. Let this program run over your SD2IEC-SD-Card and use “subfolder on” mode. It will need a little bit, when you have lots of files on it, but after this, all files are sorted alphabetically and then you can do, what i describe above with the renaming of the sd2brwse-browser to 00. Then a simple click on F5 on your C64 and the file-browser was loaded and FC3-fastloader is on. Perfect using of SD2IEC.

  11. RickR says:

    This is awesome. Thanks for writing this and providing the bonus pack. I’m using these commands on an sd2iec:

    LOAD”!*FB64″,8,1
    RUN

    And everything is loading FAST. Finally, I can enjoy the 64 without getting aggravated at the slow load times. THANK YOU.

  12. Andreas says:

    Yes RickR, you use SJLOAD, which can be seen on the ! in your load-commando. SLOAD is a very fast and good fastloader. The only bad thing is, that it is still only a programm and you must still type commandos. When using a hardware-cartridge together with the SD2IEC, like for example the FC3, then no more typing is necessary to start a browser and you always have the FC3-fastloader active.

  13. […] GitHUB do Projeto Página do Retrocomputaria sobre o CBM-1541 Wikipedia sobre o CBM-1541 Pinagem dos conectores do Commodore 64 Dicas e Truques para usar a SD2IEC ( Leia! Vale à pena ) […]

  14. Anonymous says:

    I can use My uiec SD but there are issues with recognizing some filetypes that the uiec cannot recognize. I have noticed this with copying floppy disks into their own directories, then sometimes I get this error: this filetype cannot be written to SD. What would cause this?

    • ilesj says:

      The error message seems self explanatory. Afaik some CBM-DOS file types require a container (e.g. a .d64 file) until they can be written to a different file system. If you are copying or backing up complete disks, I would recommend writing them into disk images instead. Check CBM-COmmand for example https://cbmcommand.codeplex.com/

  15. Olga Machslochoff says:

    The newer firmware-versions of the SD2IEC dont support m2i-files anymore, so those files must be converted to another format, like for example p00-Files. Many SD2IEC-users have big m2i-file-archives on their SD-card. First this convertion was only possible by using the command-line tool m2i2pc64, now this is also possible by using the newest beta-version of 64Copy. m2i is now integrated into 64Copy and files can be easily converted in d81 or p00 (PC64 files) by using the nice GUI of the program. Look here at the entry from 01.Feb.2016:
    http://forum.gp2x.de/viewtopic.php?f=85&t=14996&start=75

    Here is the side english-translated:
    https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fforum.gp2x.de%2Fviewtopic.php%3Ff%3D85%26t%3D14996%26start%3D75&edit-text=

  16. Lasse Samenström says:

    Great news this 64Copy update. Converted my big m2i-collection in one hour with this GUI. Now i am finally ready to update to the newest SD2IEC firmware.

  17. Günni Kologe says:

    Great to hear that m2i-Format was integrated inside 64Copy.

  18. Pedro says:

    Thanks, these are really good news. Here i have about 300 m2i files, which dont worked anymore in newer SD2IEC-firmwares. This was the reason, why i never updated and still used firmware 0.10.3 until this day. I hated the old m2i-p00 command-line tool and all the typing which comes with it. But now i can finally transform all my files with 64copy 4.46 and then update to the newest SD2IEC firmware.

  19. Uri N. Stein says:

    Hey, this works great!!! Thanks for the information. Now i am ready for updating to newest SD2IEC firmware. Finally!

  20. Gesa Menspenden says:

    Good thing that m2i files can now be loaded in 64Copy. It´s a great program and i used it since years for C64 file-convertion and things like that. Now i hope, that tap-file support will also come in 64Copy. That would be superb.

  21. Prinz Hairy IV. says:

    Great. There are only very few tools that supports m2i format. So good to hear, that 64Copy can be used to convert my m2i`s into other format. And this is necessary, because newer SD2IEC firmwares sadly can not handle m2i`s anymore. The format was taken out of support.

  22. Isolde Wieda-Maduschen, 43 says:

    The upper link for the version 4.46b of the tool “64Copy” seems to be no longer available. But here is an new link for the file, because it was uploaded to the CSDB by somebody in the meanwhile:
    https://csdb.dk/release/?id=194769

  23. Olga Machslochoff says:

    Found out, that the old link above, that i gave some years ago, to the “64Copy V4.46b” version is no longer valid, because this gp2x-forum moved to another website and is integrated now in another forum. But all files are still there and i have found the new link to this file now. Look here:

    https://pyra-handheld.com/boards/attachments/64copy-v4-46-beta-zip.35144/

Leave a comment