Jump to content

How To: Create an SD Card Image


TomXP411
 Share

Recommended Posts

Here's how to create a VHD file that you can mount as an SD image for the Commander X16 emulator:

This method requires Windows 10, and the resulting VHD file will be mountable on a Windows 10 computer by just double-clicking it. (Remember to "Eject" it from File Explorer before trying to run the emulator.)

  • Open Computer Management (click start and type the name)
  • Select Disk Management on the left side
  • Pull down Action and select Create VHD
  • Enter the location and filename in the box. 
  • Select VHD (not VHDX) and Fixed Size
  • Make the file at least 40MB. 
  • This will create the VHD and attach it as a drive in the list on the bottom half of the Disk Management window.
  • Right click in the box on the left column for that new disk.
  • Select Initialize. 
  • Select MBR and click OK
  • Now right click on the RIGHT side (the 40MB Unallocated side) and select New Simple Volume
  • Use the defaults on the first page and second page of the wizard (click Next twice)
  • In the third page, select Format the volume with the following settings
    • File System: FAT32
    • Allocation unit size: Default
    • Volume label: whatever you want
    • Perform a quick format
  • Click Next

You should now have a new drive letter. Copy files in, then eject it by right-clicking the drive letter in File Explorer and selecting Eject. (You can't mount it in the emulator until you eject it from Windows.)

I have also attached a 40MB SD card image. You can just download that and use it, if you want:

Here is the command line I use to mount it:

x16emu -sdcard cx16.vhd -scale 2 -echo

cx16.zip

Edited by TomXP411
  • Like 1
  • Thanks 2
Link to comment
Share on other sites

  • 2 weeks later...
On 2/9/2021 at 11:53 AM, svenvandevelde said:

Thank you. This is a great help. Such a simple solution.

Is there a way to automatically start a prg from an sdcard when you load the emulator? Or is this not possible?

Yes, that is entirely possible. Either use the -prg <path/to/program> and -run flag, in case you just want to start a program; actually, it will then not load the program from the sdcard but from the host's file system. Or, if you want to start a program and subsequently send some input in the form of keystrokes to the program, then use the -bas <path/to/textfile> flag with a text file containing PETSCII or ISO (depending on the X16 mode) Basic commands (in this case a LOAD"prg" and a RUN) plus whatever keys you want to send to the program.

In https://github.com/pzembrod/cc64/blob/master/emulator/run-in-x16emu.sh you can look at an example of this. The "just run" variant is in line 28 (autostart="-prg ${x16filesdir}/${executable} -run"), and the "load, run and type input" variant is from line 45 where a script is put together, converted to PETSCII and passed in with -bas.

Incidentally, since we had a recipe in the opening post on how to create an SD card in Windows (IIUC), here's a link to a script that does the same on Linux, using sfdisk and the mformat tool from mtools:

https://github.com/pzembrod/cc64/blob/master/emulator/mk-sdcard.sh

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

Please review our Terms of Use