Code: Select all
import dfs
image = dfs.ssd()
image.set_title('Cool stuff')
image.add_file('$.!BOOT', "*BASIC\rCHAIN "MENU"\r", load=0x0000, exec=0x0000, locked=False)
image.add_file("$.MENU", open("menu.bas", "rb").read(), load=0x0000, exec=0x0000, locked=False)
open('myprog.ssd', 'wb').write(image.get())

I found https://github.com/rcook/ssdtools which looks as though I could turn it into what I want, but it's not directly applicable as it's more of a command line tool. So before I start with that, I thought I'd ask if anyone has already done this.
I really need this to be under some kind of open source licence as well, I'm afraid. I'm building a command line driver for PLASMA and I'd like it to be able to take PLASMA source as input and emit an emulator-ready SSD at the other end, so I'd want to put the code in the PLASMA repository on github.
Sorry if this already exists and my searching powers were weak...
ETA: Not sure if this should be in the "utilities" forum instead, I'll leave it up to the moderators to advise...