SD image / HD transfer

The Speccy's spritely young offspring. Discuss everything from FPGA to ZX
Post Reply
User avatar
TMD2003
Rick Dangerous
Posts: 2047
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

SD image / HD transfer

Post by TMD2003 »

Congraturation! I partial sucsess. CSpect is working, and I can type in very rudimentary lines in the NextBASIC editor.

However, I have questions... although this is all I can remember right now.

(1)
I'm doing all this via a pre-made 2 GB SD card image that was downloaded from a location specified in the README file. The ROMs are working, and I've tested that I can save a short program and reload it - but only on the virtual SD image. So far I've tried to use the -sd2 switch to redirect to a folder called SDCARD2, but that only causes CSpect to lock up at startup - I think it's looking for another image file instead of a folder.
What I would like to be able to do is use a folder on the hard drive called SDCARD\ where all the contents of the SD card image can be stored - problem is, the only program I've found that can do that is HDFmonkey, and that's command-line-only and can't handle wildcards so EVERY file will have to be copied manually, one by one...

Is there a better way of extracting all the files from the SD card image?

(2)
As for real SD cards, I've found a 2 GB card kicking around doing nothing, that I used to use in a camera circa 2006. CSpect specifies that the card to use is 2 GB and "preferably under 16 GB". But it doesn't have a class mark on it. Despite its age, would a real Next be able to use this or should I get a newer card that can transfer data faster?
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
PeterJ
Site Admin
Posts: 6942
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: SD image / HD transfer

Post by PeterJ »

@TMD2003,

Try this. It's a front end for HDFmonkey.

http://zxbasic.uk/nextbuild/hdfmgooey/

There is a useful thread here on the restrictions:

viewtopic.php?p=101677&hilit=HDFmonkey#p101677

Regarding real SD cards have you followed these instructions? As long as Windows reads the card it should work fine. If it's a Class 4 card it will likely be slower than a virtual image:

Code: Select all

SDCARD setup

Download the latest SD card from https://www.specnext.com/category/downloads/
Copy onto an SD card (preferably between 2GB and 16GB as it's your Next HD for all your work - I use a 16GB image)
Copy the files "enNextZX.rom" and "enNxtmmc.rom" from this SD Card into the root of the CSpect folder
Download Win32DiskImager ( https://sourceforge.net/projects/win32diskimager/ )
make an image of the SD card
start CSpect with the command line...

"CSpect.exe -w3 -zxnext -nextrom -mmc=[sd_card_path]\sdcard.img"
User avatar
TMD2003
Rick Dangerous
Posts: 2047
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: SD image / HD transfer

Post by TMD2003 »

Right. I used SD Imager, and I've copied all the files in one go over to the 2 GB SD card, and then to a folder on my hard drive.

Problem is, there appears to be no obvious way to get CSpect to run with with either the SD card or all the files in the folder - only the .IMG file allows it to start with NextOS. I haven't moved the Next ROMs at all, they're still in the CSpect folder as I assume they should be; is this the root of the problem?
PeterJ wrote: Thu Jan 05, 2023 9:54 pm Regarding real SD cards have you followed these instructions?
...as much as I could understand them. There was about an hour of trial and error involved to get all the parameters right. Everything in the README file, though, was about setting the "mmc=" paramater to point to a file ending in .IMG, rather than a folder or a real SD card, and only the .IMG I've been able to make work so far. This is the least convenient of the three options available, and I'd rather use a folder on the HD if at all possible. Then, I can edit .BAS files in Notepad++ instead of having to use the NextBASIC editor.

As long as Windows reads the card it should work fine. If it's a Class 4 card it will likely be slower than a virtual image
Bah. I may need a new one. But is there such thing as a Class 10 2 GB card? Are they still available? Most modern tech (of which I have none) requires much higher capacity than that now.
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
PeterJ
Site Admin
Posts: 6942
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: SD image / HD transfer

Post by PeterJ »

@TMD2003,

Why do you want to run from an actual SD Card rather than an image? Is it just so you can easily access the files?

Having read those instructions again, it's actually for imaging an actual SD card and not accessing the actual SD card. My bad.

Also see this post from @Luzie on the new built-in file explorer for CSpect.

viewtopic.php?p=108464#p108464
User avatar
TMD2003
Rick Dangerous
Posts: 2047
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: SD image / HD transfer

Post by TMD2003 »

PeterJ wrote: Thu Jan 05, 2023 10:27 pm @TMD2003,
Why do you want to run from an actual SD Card rather than an image? Is it just so you can easily access the files?
Yes. Though, as I say, I'd rather be able to use a folder within the CSpect main folder. Now that I think of it, QemuLator can do both - the .IMG here is the equivalent of a QL .MDV file, but it's a lot easier to mount a folder to QemuLator and use that as the virtual microdrive instead.
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
Seven.FFF
Manic Miner
Posts: 753
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: SD image / HD transfer

Post by Seven.FFF »

The Next uses low level SD SPI commands to access the internal FAT32 and +3DOS disks. Operating systems like Windows/Linux/macos don’t expires that low level stuff?directly from the hardware, they use external SDIO drivers. It’s not even the same technology,

The reason other emulators can mount OS folders is that they trap select ROM calls at a higher level and provide separate implementations of file open/read/write/seek/close etc. CSpect can and does that do that too, and it works to a limited extent, but there’s a lot of SPI block-based operations NextZXOS does that can’t work that way.

Really, what CSpect needs is direct access to real
hardware like the Next has. Without any PC OS getting in the way, which is has done since the MSDOS days.

The way around needing low level block access like this is the same in every emulator - emulate the SPI bus and apply those SPI commands faithfully to an image file that exactly models the real hardware.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
PeterJ
Site Admin
Posts: 6942
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: SD image / HD transfer

Post by PeterJ »

@TMD2003,

If you want an example of how image files should be handled within emulators take a look at RVM:

viewtopic.php?p=108332#p108332

The ease of (or lack of) being able to access and manipulate image files easily is something I've moaned about for many years! RVM was a revelation for me.
Post Reply