Page 1 of 1
SD2IEC Support?
Posted: Wed Oct 12, 2022 11:41 am
by Caldor
Has anyone tried to implement SD2IEC support in the C64 or other Commodore cores?
I found this, which I think explains the hardware:
https://rebelion.digital/2017/08/25/bui ... n-english/
Re: SD2IEC Support?
Posted: Wed Oct 12, 2022 2:06 pm
by akeley
Re: SD2IEC Support?
Posted: Wed Oct 12, 2022 7:00 pm
by kevind
I had looked into it briefly, although I didn’t have the time to follow through. I believe it wouldn’t be too difficult overall given that the sd2iec software is open source at
https://sd2iec.de/ and handling/translating the commands is a big portion of the battle.
I feel it could be handled much like the ao486 IDE support, but I haven’t dug too deeply to see how things are currently mapped in the core.
Re: SD2IEC Support?
Posted: Wed Oct 12, 2022 7:57 pm
by venice
Caldor wrote: ↑Wed Oct 12, 2022 11:41 am
Has anyone tried to implement SD2IEC support in the C64 or other Commodore cores?
It works, but you need a SNAC2IEC adapter which you already have, I think.
See here for Adapter Details:
viewtopic.php?t=4469
The Adapter works also with the PI1541 and some other
real CBM Hardware and MiSTer Cores (C128/C16).
Some Videos:
viewtopic.php?p=61014#p61014
Re: SD2IEC Support?
Posted: Thu Oct 13, 2022 9:15 am
by Caldor
venice wrote: ↑Wed Oct 12, 2022 7:57 pm
Caldor wrote: ↑Wed Oct 12, 2022 11:41 am
Has anyone tried to implement SD2IEC support in the C64 or other Commodore cores?
It works, but you need a SNAC2IEC adapter which you already have, I think.
See here for Adapter Details:
viewtopic.php?t=4469
The Adapter works also with the PI1541 and some other
real CBM Hardware and MiSTer Cores (C128/C16).
Some Videos:
viewtopic.php?p=61014#p61014
Yes, and I have that and I have problems with it. Which is why I want to see an FPGA implementation of it instead that would allow just selecting a folder as the SD2IEC folder a bit like you can with the Ultimate 64... but on the Ultimate 64 it does not support the full DOS command set and therefore does not work with C64 OS.
But the MiSTer already has MiSTer filesystem solutions implemented for AO486 and the Amiga core, so this could work similarly but for the C64 core.
Re: SD2IEC Support?
Posted: Thu Oct 13, 2022 1:17 pm
by Hackshed_Carl
Forgive my ignorance but what advantage would there be to implementing SD2IEC over the existing MiSTer disk / tape / cart handling methods?
I've never actually used an SD2IEC though so don't have anything to compare the two
Re: SD2IEC Support?
Posted: Fri Oct 14, 2022 11:06 am
by Caldor
Hackshed_Carl wrote: ↑Thu Oct 13, 2022 1:17 pm
Forgive my ignorance but what advantage would there be to implementing SD2IEC over the existing MiSTer disk / tape / cart handling methods?
I've never actually used an SD2IEC though so don't have anything to compare the two
Storage capacity. C64OS is one of few apps that actually uses it, otherwise SD2IEC is just used to store floppy disks and such. This can give you access to several gigabyte of data, while disk, tapes carts are limited to... a tape might be able to hold 8mb or something and a floppy is 300kb per side maybe? And they need to be flipped manually. Cars I am not certain, I guess they can hold quite a bit of data, but... its still something like 1-2MB I think. With a tape, it does not help much that it can hold a lot of data, given how that data is loaded. It does not have an index that can look through what data is on the tape and find it.
Before C64OS, SD2IEC was just used to load a floppy from the SD card as a floppy and you would load that floppy a bit like it was a folder on the SD2IEC and it would then work as a regular floppy drive for that floppy, and it can load PRGs directly and such. Its also faster.
Re: SD2IEC Support?
Posted: Fri Oct 14, 2022 6:29 pm
by Hackshed_Carl
Thanks for the explanation.
So before C64OS came out, SD2IEC wouldn't improve much on MiSTers file handling but C64OS can make use of the additional storage space?
Re: SD2IEC Support?
Posted: Fri Oct 14, 2022 7:28 pm
by LamerDeluxe
I have some cartridges for the VIC-20 that take advantage of the SD2IEC to make loading games much easier. With the VIC, you have to set the correct memory expansion configuration per game, or it won't work. Also, when loading cartridge images (one cartridge is often two files), they have to be loaded into the correct memory blocks.
I have a cartridge that allows you to define a short script per game, which sets the correct memory blocks and executes the right commands to load and run a game. If the MiSTer could emulate an SD2IEC device, you should be able to attach this cartridge image and utilize this system. Another way to achieve this would be to add similar capabilities to the core directly.
Re: SD2IEC Support?
Posted: Sat Oct 15, 2022 6:29 pm
by venice
Caldor wrote: ↑Thu Oct 13, 2022 9:15 am
Yes, and I have that and I have problems with it…
Is your SD2IEC not working at all with your SNAC2IEC Adapter or do you have your problems only with the C64OS?
Re: SD2IEC Support?
Posted: Sun Oct 16, 2022 8:17 am
by Caldor
venice wrote: ↑Sat Oct 15, 2022 6:29 pm
Caldor wrote: ↑Thu Oct 13, 2022 9:15 am
Yes, and I have that and I have problems with it…
Is your SD2IEC not working at all with your SNAC2IEC Adapter or do you have your problems only with the C64OS?
It is working, I have not yet tried it out in depth. Just that C64OS consistently stops at a certain point when loading C64OS. I do not know why, I tried another SD card, but that did not help. It might be something with the adapter, or the fact that my SD2IEC is very old, more than 5 years. But when I connect the same SD2IEC to my Ultimate 64 it works... today I will test it with my Turbo Chameleon 64 to see if it works. I expect it will, but if it has the same problem as the MiSTer, that would help me figure out what the issue here is.
Because C64OS does work with the MiSTer and with the SNAC2IEC adapter. There are already at least two different videos from different MiSTer owners running C64OS this way.
Re: SD2IEC Support?
Posted: Sun Oct 16, 2022 8:36 am
by venice
Could you post a video link please, thx.
And do you use an real sd2iec or the sdrive device from the other thread?
Re: SD2IEC Support?
Posted: Sun Oct 16, 2022 10:44 pm
by Caldor
venice wrote: ↑Sun Oct 16, 2022 8:36 am
Could you post a video link please, thx.
And do you use an real sd2iec or the sdrive device from the other thread?
It is the Sdrive device, but that is just one of many SD2IEC devices. I also tested it with the Ultimate 64 and the Turbo Chameleon 64, works with both of those. For some reason it wont fully load on the MiSTer.
Not sure what to show in a video. I could go over the settings and such I guess.
But software SD2IEC support would be quite useful either way I think. Well, a mix of FPGA and MiSTer support. Before C64OS, there might not have been much use for it, but since its out that changes this. Now it would add something for the C64 core to have built in sd2iec support.
Re: SD2IEC Support?
Posted: Mon Oct 17, 2022 4:06 am
by venice
Sorry, i meant links to the videos you wrote about.
There are already at least two different videos from different MiSTer owners running C64OS this way.
Maybe the sdrive is not 100% compatible to the sd2iec because of a different Firmware?!
Just an Idea.
Re: SD2IEC Support?
Posted: Mon Oct 17, 2022 8:31 am
by Caldor
venice wrote: ↑Mon Oct 17, 2022 4:06 am
Sorry, i meant links to the videos you wrote about.
There are already at least two different videos from different MiSTer owners running C64OS this way.
Maybe the sdrive is not 100% compatible to the sd2iec because of a different Firmware?!
Just an Idea.
That was my thought to begin with... but given how it works just fine with both my Turbo Chameleon 64 and my Ultimate 64, I am guessing that is not the case or the problem should have been for all 3 devices when they used the SDrive to load C64OS. But its only on the MiSTer that it locks up just before loading the desktop.
I think I will try to test it more in depth, seeing if maybe it has issues with disk swapping or other features when using it with a regular 1541 drive or when using the SD2IEC to load floppy disk images and such.
Re: SD2IEC Support?
Posted: Mon Oct 17, 2022 9:55 pm
by Caldor
I got C64OS to run on my MiSTer
Not sure what the problem was, but it might have been DolphinDOS. Pretty sure I had tried without it though. Might have been because I now disabled the clock.
Still, this thread is about whether it would be possible to get SD2IEC support added to the MiSTer inherently as part of the core, using the MiSTers own file system, making it a bit like the MiSTer filesystem drivers for AO486 and the Minimig cores.
Re: SD2IEC Support?
Posted: Wed Oct 19, 2022 6:58 am
by Caldor
I got JiffyDOS working for my MiSTer, but found it was too fast or incompatible with my SD2IEC, the problem probably bring its only running firmware version 0.10.3, but more problematic is that its bootloader does not support automatically updating the firmware.
It can probably be updated if I update the bootloader or firmware directly on the ROM chips... but not sure if my EPRom reader/writer supports this type.
Looking through the SD2IEC options, they seem to cost at least 70 USD. Well, some might be 40-50 USD without casing. I am thinking if I am to get new hardware, it might be worth it looking into the IDE64, but I guess that might not work with the MiSTer.
It might be more relevant for the MiSTer C64 core to support though. IDE support for the C64:
https://ide64.org
You can even connect a CD drive to it with this and it seems it might be faster than SD2IEC.
Re: SD2IEC Support?
Posted: Wed Oct 19, 2022 8:33 am
by Caldor
venice wrote: ↑Wed Oct 12, 2022 7:57 pm
Caldor wrote: ↑Wed Oct 12, 2022 11:41 am
Has anyone tried to implement SD2IEC support in the C64 or other Commodore cores?
It works, but you need a SNAC2IEC adapter which you already have, I think.
See here for Adapter Details:
viewtopic.php?t=4469
The Adapter works also with the PI1541 and some other
real CBM Hardware and MiSTer Cores (C128/C16).
Some Videos:
viewtopic.php?p=61014#p61014
I did not realize that the Pi1541 actually has SD2IEC support as a "mode". I think this will be what I will get, because I found my SD2IEC has an old bootloader and does not support updating its firmware, so its running version 0.10.3 and that does not seem to be compatible with JiffyDOS.
I might be able to update the ROM chips manually with an EPROM reader /writer like I have done with Amiga ROMs, but I do not want to open it.
But would be very nice if SD2IEC was just a native feature FPGA devices running C64 cores. The Ultimate 64 does have some SD2IEC support, but it lacks support for the full DOS command set.
Seems the Pi1541 also lacks the full SD2IEC command set
https://cbm-pi1541.firebaseapp.com
Re: SD2IEC Support?
Posted: Wed Oct 19, 2022 10:12 am
by Caldor
I found some source code for the Pi1541 and its iec commands implementation which might help develop SD2IEC for the MiSTer.
Its not fully implemented though so it does not have all the SD2IEC commands:
This file handles the Pi1541 modes:
https://github.com/pi1541/Pi1541/blob/m ... c/main.cpp
And one of the modes is the SD2IEC mode and the commands are in:
https://github.com/pi1541/Pi1541/blob/m ... commands.h
It has some IEC commands documentation here:
https://github.com/pi1541/Pi1541/blob/m ... ommands.md
And it refers to
https://www.sd2iec.de as inspiration for them, it is the site that hosts the newest versions of the SD2IEC firmware and bootloaders.
Looking a bit further, this seems to be the source for sd2iec and it seems to go over all the supported commands:
https://github.com/rkrajnc/sd2iec
But this is 10 years old, it seems the newest source is on the sd2iec site, rather than github, but still a git link:
http://www.sd2iec.de/sd2iec.git
Re: SD2IEC Support?
Posted: Thu Oct 20, 2022 5:33 am
by ericgus09
While I get adding SD2IEC to the mister Commodores 8 bits makes some sense .. in reality there isn't much actual benefit over whats there now aside from letting people run C64OS and honestly its not that impressive .. maybe I just don't get it but it seems like a neat tech demo novelty that wont have much long term value .. While I wouldnt ever take anyone's fun away .. Im not entire sure if this is a good use of a developers time to just do this work for one program thats, right now, a bit limited and more of a demo .. Im struggling to see what unique and value-add features C64OS brings to the table and coming up short .. Maybe if a dev is in there doing some other updates to the 1541 vhdl may make sense to look to adding features like sd2iec but just to support c64os .. IDK .. again im not knocking it, if you love it great.. and its another neat thing we have to our community.. Its just not personally for me .. at least in its current state.
Is there anything else that might benefit from having sd2iec support in the 8 Bit commodore systems? I can't think of anything that jumps out at me .. at least nothing that the current implementation doesn't already provide a functional analog of.. If perhaps there were a few applications that can use sd2iec beyond c64os then sure would certainly be a good thing to add..
Re: SD2IEC Support?
Posted: Thu Oct 20, 2022 6:49 am
by Caldor
On its own SD2IEC does do things that help. GEOS has supported it for a while, making it possible to have one big GEOS disk instead of several.
There are a whole bunch of games that got converted for IDE64, and they can also be run with SD2IEC. Multidisk games and such that with this works pretty much like a cartridge but it should also be able to do savegames, which cartridges sometimes do not support. Many of these games use a SEQ file to run and you can even use these from C64OS directly as well. But otherwise you can use CBM Filebrowser, its designed for SD2IEC devices.
IDE64 is pretty much impossible to get hold of these days and if you find one it will probably be quite expensive, while there are several SD2IEC options and you can even make your own because its completely open source.
Re: SD2IEC Support?
Posted: Thu Oct 20, 2022 9:00 pm
by ericgus09
Yea, I can see IDE64 emulation .. there are a few use cases for that one for sure.. if it could be implemented.
It just makes a better proposition/argument if you can state a benefit for multiple reasons then one limited audience program..
Just trying to look for a justification that gives reason beyond what analog features are already there .. eg the flash loading of a prg file direct to memory via the menu ..
Re: SD2IEC Support?
Posted: Fri Oct 21, 2022 8:38 am
by Caldor
ericgus09 wrote: ↑Thu Oct 20, 2022 9:00 pm
Yea, I can see IDE64 emulation .. there are a few use cases for that one for sure.. if it could be implemented.
It just makes a better proposition/argument if you can state a benefit for multiple reasons then one limited audience program..
Just trying to look for a justification that gives reason beyond what analog features are already there .. eg the flash loading of a prg file direct to memory via the menu ..
Loading a PRG file into memory like that is very useful. Could also be useful if the core support opening a D64 and could select a PRG on it to load directly into memory while also mounting that D64. The U64 supports that.
With SD2IEC you get a lot of these features though, where you might not be able to launch from the UI, but there is the CBM Filebrowser 1.6 which supports SD2IEC and can mount D64 files, maybe even DNP and launch games from them, selecting a specific prg instead of just doing a 'LOAD"*",8,1' or mounting it and doing nothing.
The reason C64OS uses this file system is because its a modern filesystem, while C64 floppy disks do not support directories or sub directories. So you can have directories with games instead of just D64 files with multi-file games. C64OS then supports having games added to a desktop that you can click and launch, it can even mount D64 files. It ends up being a bit like having WHDLoad or some game launcher on the Amiga, but for the C64, without being limited by a cartridge and how much it can hold.
Already new games often support IDE64 or SD2IEC, but imagine if they were designed for it? some of the largest C64 games now are almost 500kb in size, but if based on this they could easily be made as 5MB games. Already there is Sams Journey which is a 700kb game and it does have an IDE64 version I think. Cartridges are also useful, but now that I know its possible, I hope to look into making a C64 game launcher, a bit like how you can make EasyFlash CRT game collections, but now without all the trouble, you can just have all kinds of games in folders.
The Pi1541 I do hope to figure out a way to get more IEC commands, because that seems to make for the cheapest IEC device, and it has support for D64, D81, G64 and more. With full SD2IEC it could be even more powerful. I never had much interest in it because I thought it was just a floppy drive emulator. The developer was even close to removing the simple SD2IEC support it currently has. Ultimate 64 and Ultimate 1541 II+ both have some simple software SD2IEC support that can mount some folder on the SD card. But it lacks most commands... might have even fewer commands than the Pi1541 because it can only mount one folder and I do not think it supports sub-folders. I played around with it a bit and I think I could not get it to run IDE64 games so I stopped looking into it. I did not realize my SD2IEC was capable of running IDE64 games, so I have not tested my collection of IDE64 games much yet.
Re: SD2IEC Support?
Posted: Fri Oct 21, 2022 4:22 pm
by ericgus09
Oh I know what SD2IEC does and why C64OS needs it, im just trying to see if there are other programs/uses cases beyond just the one "c64os" to help build a case for why it should be added and what benefits it would bring beyond what we got now.
Re: SD2IEC Support?
Posted: Sat Oct 22, 2022 2:44 pm
by Caldor
ericgus09 wrote: ↑Fri Oct 21, 2022 4:22 pm
Oh I know what SD2IEC does and why C64OS needs it, im just trying to see if there are other programs/uses cases beyond just the one "c64os" to help build a case for why it should be added and what benefits it would bring beyond what we got now.
That is what I just explained. There are several IDE64 games, versions of games that used to require several floppy discs running from a folder on SD2IEC where you can save to it and everything, no longer being limited by the space of a floppy. Several apps support it also. GEOS supports it as well.
With SD2IEC you can also mount DNP images and it has not only support for D64/D71/D81/M2I files but also supports swap lists, making it easier and faster to swap floppies if the game you are playing is a floppy disk game, and with the CBM Filebrowser you can open each floppy image and launch a specific file on the floppy, while with the MiSTer C64 core you still only have the option to mount the floppy, not to select a specific file on the floppy to load into memory directly.
SD2IEC also supports more fastloaders and its faster than floppies:
https://www.c64-wiki.com/wiki/sd2iec_(firmware)
The reason C64OS is based on it, is because its the best and fastest filesystem there is for the C64. More and more C64 apps have been getting support for it. SIDPlay, NovaText and several file managers.
With Castle Master I could just take the files, but them in a folder on the SD card, remove their .PRG extension, launch the game and saving would just create save files on the SD card. So no space limitation on those save files.
The only reason I mentioned C64 OS in relation to IDE64 games, is that it can then act as a launcher for them. You can also launch them using DOS commands or FB64 (CBM Filebrowser 1.6) to find the folder and launch the game.
A benefit to having SD2IEC built into the MiSTer over having an external device is then also that you can FTP to the MiSTer and manage the files while its running, adding more files to it and such.
Re: SD2IEC Support?
Posted: Sat Oct 22, 2022 5:01 pm
by Caldor
The Ultimate 1541 / Ultimate 64 devices already have a software IEC feature. It gives it minimal SD2IEC support. I think it limits it to one folder and its not enough for C64 OS.
But I looked over its code and it is software IEC because its fully done on the software side. No FPGA logic used. So on the MiSTer it should be possible to do the same, adding software IEC support in MiSTer Main alone.
Here is a commit to the Ultimate 1541 git that adds improvements to the software IEC module:
https://github.com/GideonZ/1541ultimate ... 59d2e07b0d
I will try to see if I can figure out a way to add this feature to MiSTer Main.
Re: SD2IEC Support?
Posted: Sun Oct 23, 2022 2:19 am
by ericgus09
Oh if its done on the mister linux side alone (eg not in the fpga) then it should be a much simpler affair..
Re: SD2IEC Support?
Posted: Sun Oct 23, 2022 9:46 am
by Caldor
ericgus09 wrote: ↑Sun Oct 23, 2022 2:19 am
Oh if its done on the mister linux side alone (eg not in the fpga) then it should be a much simpler affair..
Yup... but I looked into it some more and currently all drives the C64 uses are FPGA logic based, so to make this work I would need to add a software driven drive and that ends up being too complicated for me I think. I do not have a deep enough understanding of MiSTer Main. I think the core also might to change a bit to get the options added to select a software IEC drive, and then it needs to be possible to select a folder and such.
Then the MiSTer Main will need to be able to respond to signals to the drive from the core and software emulate an SD2IEC. Doing it this way will not make it possible to use the SD2IEC firmware I think, so every command and such will need to be added manually, converted from the ROM implementation and such.
A very good start would be to have this software IEC with minimal IEC commands ported from the Ultimate 1541/64 source. But I wont be able to do it on my own.