Auto-start CSpect!

 


Hello again!
In my last post "Z80 Environment Final Edition", I set up my final development environment and was quite pleased with how it was working. There was one niggling issue which I wanted to sort, but wasn't sure how to do it.

Here is what I wrote as a reminder:

"Of note, there is one more thing I would like to work out, but haven't yet (if possible) and that is how to automate the process of running the NEX file on the SD card image. I know it's only a minor thing but once CSpect has loaded with the SD image, it's a bit of a chore to have to go through the menu and select the NEX file to run. It would be good if there was a setting/flag in CSpect to do this, something like "-mmc=/sdcard.mmc -start=/main.nex".
Maybe it's possible but I haven't seen how to do this. Let me know if you have any details."

Well I'm please to say that I've got it sorted and it works really well. The good news is that you don't have to do anything further to the json file or mess with any more settings in vscode. As long as you have all the same set up as I have and have the .nex file saved to the SD card as main.nex, you will be all good to go!

SD Card

So basically it's back to the SD card to put a file in the nextzxos folder called autoexec.bas.
Find your sd card image in CSpect and mount it using the previously mentioned OSF Mount software. This will let you see the contents of the image file in Windows and makes it much easier to just drag and drop the autoexec.bas file to it, that we are going to create.

Next go to Remy Sharp's website to use the Speccy Next tools:

You will see an area on the screen where you can type Next Basic code. Delete the test code that is in there and then copy the code below to the screen:
#autostart
10 CLS
20 a$="C:/"
30 b$="MAIN.NEX"
40 CD a$
50 .$ nexload b$
Then press the button to download it as a .bas file using "+3DOS .BAS". Call the file "autoexec" but leave off the .bas, as it does this automatically.

Once the file "autoexec.bas" has downloaded, drag it over to your SD card image, putting it in the "nextzxos" folder and unmount the SD card.

And that's all folks! If you have followed along with my previous post's, then when you run some of your code from VSCode, it will build and save the main.nex file to the SD image and run CSpect and because you now have this autoexec.bas file, when CSpect starts, it will auto run the main.nex without having to find it in the menu!!!


Well only a short post, but I thought it was worth the mention for a smooth development environment............... Have fun 👾

Comments

Popular posts from this blog

Platypus Next Peril - Sprites!

Spectrum Next Z80 dev environment

Welcome to Pandapus