prb28 / vscode-amiga-assembly

Amiga Assembly extension for Visual Studio Code
GNU General Public License v3.0
178 stars 12 forks source link

Cannot launch example program in Linux #228

Closed cbmeeks closed 1 year ago

cbmeeks commented 2 years ago

It took me a while to figure out how to run the example setup on my Fedora system. But when I finally got around to launching a program I compiled, I'm getting a connection refused on FS_UAE.

image

Here is my launch.json:

  {
      "version": "0.2.0",
      "configurations": [
          {
              "type": "fs-uae",
              "request": "launch",
              "name": "FS-UAE Debug",
              "stopOnEntry": true,
              "serverName": "localhost",
              "serverPort": 6860,
              "trace": false,
              "startEmulator": true,
              "windows": {
                  "emulator": "${config:amiga-assembly.binDir}/fs-uae.exe"
              },
              "osx": {
                  "emulator": "${config:amiga-assembly.binDir}/fs-uae"
              },
              "linux": {
                  "emulator": "${config:amiga-assembly.binDir}/fs-uae"
              },
              "emulator": "${config:amiga-assembly.binDir}/fs-uae",
              "emulatorWorkingDir": "${config:amiga-assembly.binDir}",
              "program": "${workspaceFolder}/uae/dh0/Robocop",
              "options": [
                  "--chip_memory=2048",
                  "--hard_drive_0=${workspaceFolder}/uae/dh0",
                  "--joystick_port_1=none",
                  "--amiga_model=A1200",
                  "--remote_debugger=200",
                  "--use_remote_debugger=true",
                  "--automatic_input_grab=0"
              ],
              "preLaunchTask": "amigaassembly: build"
          },
          {
              "type": "uae-run",
              "request": "launch",
              "name": "FS-UAE Run",
              "windows": {
                  "emulator": "${config:amiga-assembly.binDir}/fs-uae.exe"
              },
              "osx": {
                  "emulator": "${config:amiga-assembly.binDir}/fs-uae"
              },
              "linux": {
                  "emulator": "${config:amiga-assembly.binDir}/fs-uae"
              },
              "emulator": "${config:amiga-assembly.binDir}/fs-uae",
              "emulatorWorkingDir": "${config:amiga-assembly.binDir}",
              "options": [
                  "--chip_memory=2048",
                  "--hard_drive_0=${workspaceFolder}/uae/dh0",
                  "--amiga_model=A1200",
                  "--automatic_input_grab=0"
              ],
              "preLaunchTask": "amigaassembly: build"
          }
      ]
  }

Here is my tasks.json:

  {
      "version": "2.0.0",
      "tasks": [
          {
              "type": "amigaassembly",
              "vasm": {
                  "enabled": true,
                  "command": "${config:amiga-assembly.binDir}/vasmm68k_mot",
                  "args": ["-m68000", "-Fhunk", "-linedebug"]
              },
              "vlink": {
                  "enabled": true,
                  "command": "${config:amiga-assembly.binDir}/vlink",
                  "includes": "*.{s,S,asm,ASM}",
                  "excludes": "",
                  "exefilename": "../uae/dh0/Robocop",
                  "entrypoint": "Robocop.s",
                  "args": ["-bamigahunk", "-Bstatic"]
              },
              "problemMatcher": [],
              "label": "amigaassembly: build",
              "group": {
                  "kind": "build",
                  "isDefault": true
              }
          },
          {
              "type": "amigaassembly",
              "vasm": {
                  "enabled": true,
                  "command": "${config:amiga-assembly.binDir}/vasmm68k_mot",
                  "args": ["-m68000", "-Fhunk", "-linedebug"]
              },
              "vlink": {
                  "enabled": true,
                  "command": "${config:amiga-assembly.binDir}/vlink",
                  "includes": "*.{s,S,asm,ASM}",
                  "excludes": "",
                  "createStartupSequence": true,
                  "createExeFileParentDir": true,
                  "exefilename": "../uae/dh0/Robocop",
                  "args": ["-bamigahunk", "-Bstatic"]
              },
              "problemMatcher": [],
              "label": "amigaassembly: build"
          }
      ]
  }

My system is Fedora 36 with GNOME 42 (Wayland). I can run FS_UAE Launcher just fine.

Any ideas what I'm doing wrong?

Thanks

prb28 commented 2 years ago

In the settings you'll find the path to the downloaded binary dir. Try to run fa-use in a shell from this directory.

cbmeeks commented 2 years ago

Launching from the bin folder seems to work.

image

prb28 commented 2 years ago

Ok, try to add the option emulatorStartDelay in the launch settings. Set it to 20000, it's in me so it will wait 20s. https://github.com/prb28/vscode-amiga-assembly/wiki/Debugging-emulator#parameters

cbmeeks commented 2 years ago

Seems to have no affect at all. In fact, the emulator starts up without any delay. I even changed it to 200,000 and nothing was different.

UPDATE:

After I build the project, I can manually launch FS-UAE at the terminal and point to the program and it works. I believe it's the remote debugging from VSCode over to FS-UAE that is being blocked (localhost:6860). So maybe it's Fedora blocking that port?

I tried disabling the remote debugger but no dice.

"--use_remote_debugger=false",
prb28 commented 2 years ago

Yes you may have to open the socket port on the firewall or change it because this port may be used or reserved. Try to set a 55555 port for the debugger and fs-uae.

cbmeeks commented 2 years ago

Same thing. Denied.

I looked at adding the 6860 port explicitly and was told it was already there:

image

Something I'm wondering...I never was able to get the "download binaries" to work. So what I did was take the FS-UAE binary folder I had already download previously and copy them into the "../bin" folder of the project.

Does FS-UAE have a separate bin for the debugger? Meaning, I may not even have the debugger version installed.

prb28 commented 2 years ago

I'm far from a computer for a couple of weeks, I'll try on a vm as soon as possible. Which version of fedora do you use ?

cbmeeks commented 2 years ago

Any help is appreciated.

image

prb28 commented 2 years ago

It works on a fresh install of fedora 36 in virtual box: image

I had to install openal to launch fs-uae (I don't think it's your issue): sudo dnf install openal

There is definitely something blocking port 6860 in your install, maybe a firewall or a service.

cbmeeks commented 1 year ago

FYI,

I don't know what changed but this is now working. On a whim I came back to this and created a new project and it worked first time.