remy / vscode-nextbasic

VS Code tools for NextBASIC

Home Page:https://marketplace.visualstudio.com/items?itemName=remysharp.nextbasic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to run cspect from within vscode on linux

shifters67 opened this issue · comments

Hi Remy,

I am running Cspect 2.12.36 on latest ubuntu 20.04 (fully patched) and latest vscode (1.50.1). Latest mono installed as i use it for other things. Git cloned and compiled hdfmonkey and sudo installed it.

I have followed your video (which is nice, clear and to the point!) but when i try and run a basic sample 'hello world', cspect window pops up but is black with nothing happening in it (just black).

I can run cspect from a command line and it boots straight into the basic program as expected showing the compilation and injection process was fine and i can see the files in the next browser once i exit basic and they run as expected.

I use the following from the command line:

mono CSpect.exe -w3 -basickeys -zxnext -nextrom -mmc=./cspect-next-2gb.img

I have changed the nextbasic config as:

cspect path: /home/twri/Downloads/0.SpectrumNext/cspect/CSpect2_12_36/CSpect.exe

cspect options: -w3 -basickeys -zxnext -nextrom

(I tried your options which gave the same issue - black screen - so thought i would try my own that work from command line)

hdfmonkey: hdfmonkey (as its in path)

image path: /home/twri/Downloads/0.SpectrumNext/cspect/CSpect2_12_36/cspect-next-2gb.img

The example program is in a folder under /home/twri/Downloads/0.SpectrumNext/cspect/basictest/

thanks

Tom

Okay, going by your post, you've got a pretty firm grip on paths, etc - which is great.

What I'd like to do is check that your file is getting from VS Code to the Next image.

When you hit "run with cspect" in VS Code, what happens under the hood is this:

  • your file gets converted to a .bas file - called index.bas
  • hdfmonkey is used to send all your working project files across and then your new index.bas
  • a new autoexec.bas is sent that is used to load your code immediately.
  • finally cspect is launched

We know cspect is launching, but there might be something up with the launch flags - but we'll circle back to this.

First I want to check that the files are getting from vscode to your Next image.

There's two ways (both are worth checking):

  1. Are you able to mount the cspect-next-2gb.img file, and in there, you should find a directory called /devel and inside that there should be index.bas.
  2. Launch cspect manually from the command line, and using the NextOS browser, navigate to the /devel directory and hit enter on the index.bas file - it should launch your code.

Let me know how you get on with those two items - I'm expecting/hoping they're fine - and if that's the case, then we need to look at cspect and maybe reach out to it's author Mike Dailly to see if there's anything special about launching from linux within the extension (there's something that rings a bell and I'll check if I can find anything in the facebook groups too).

HI Remy,

running cspect after 'run with cspect in vscode' but from the command line, the autoexec is modified and the files are present in the devel directory - both test.bas.txt (my hello world file) and index.bas.

Starting cspect from the command line directly after the failed run above, and cspect does start and does auto run the basic file and it prints hello world until the screen is full. You can then press n to continue and see the files in the browser.

cheers

Tom

A bit late in replying - and I'm trying to turn up whether there's known answer to this, but in the mean time, can you try by adding the following flag to your cspect options: -tv so it reads -w3 -basickeys -zxnext -nextrom -tv

Hi Remy,
tried adding the -tv flag to the cspect options and still the same behaviour (black screen nothing happening)
I also tried it again following a vscode shutdown and reload - also the same behaviour
Thanks for looking in to this!
cheers
Tom

Grasping a bit at straws here, but found this on facebook - the important bit being making sure all the files are in the same directory:

C:\spec\CSpect2_12_29\CSpect.exe -w2 -zxnext -nextrom -basickeys -exit -brk -tv -mmc=.\cspect-next-2gb.img
Where the .img file is in the same directory as CSpect, and enNextZX.rom and enNxtmmc.rom (from the
version of the distro you are using) are in the same directory as the .img file.

Worth a try at least - or worth asking.

Hi Remy,
there were all in the same directory anyway but i retried with your command line options and still not working (no difference - black screen),

Running mono CSpect.exe -w2 -zxnext -nextrom -basickeys -exit -brk -tv from the command line works fine.

It is something to do with the way you are calling mono on linux?

cheers
Tom

Maybe its something to do with paths, i.e. if your running CSpect.exe with the full path - you are not in the directory where all the roms and img file are?

If i try running as:

mono /home/twri/Downloads/0.SpectrumNext/cspect/CSpect2_12_36/CSpect.exe -w2 -zxnext -nextrom -basickeys -exit -brk -tv -mmc=/home/twri/Downloads/0.SpectrumNext/cspect/CSpect2_12_36/cspect-next-2gb.img

from the command line it does work though (when not in the CSpect folder).

Sigh - out of ideas!
Tom

I'm doing more searches on the Facebook groups. The -tv flag comes up a lot (which you've tried).

One individual found that they had a black screen and it was resolved by installing openal. I don't know much about it, but it might be an avenue to try if it's a straight forward install (probably best to do a search for it on Google or duckduckgo

Hi Remy,
already had openal32.dll installed in the same folder as all the other files.

I tried removing it - no difference - and it still ran fine from the commandline.

Added it back again and tried again - no difference - and commandline still ran fine.
cheers
Tom

Just ran:
sudo apt-get install libopenal-dev

to install linux version of openal and tried again - no difference still blackscreen
cheers
Tom

commented

Late, but in case someone would find it useful: just ran into exactly the same issue (except running on Windows). Turned out I had to add -sound option to command line, then it started to work.