rolandshacks / vs64

C64 Development Environment for Visual Studio Code
Other
97 stars 16 forks source link

VICE launches and immediately closes, 6502 emulator not starting at all #67

Closed milzer closed 4 months ago

milzer commented 4 months ago

So as the title says, I can't figure out what's wrong. Using the fresh installation and the hello world project with CC65. First thing I noticed from the logs is that the command doesn't include the .prg file: D:\code\c64\SDL2VICE-3.8-win64\x64sc.exe +remotemonitor -binarymonitor -binarymonitoraddress ip4://127.0.0.1:6502 -autostartprgmode 1 -verbose -logfile vice.log

If I invoke that spell directly from the command line, the emulator stays open unlike when running from VS code, but no program is started (as one might expect). If I add the .prg file it starts correctly.

The build process and VICE do seem to work, so I'm assuming it's a configuration issue, As a side note, the 6502 emulator doesn't work either. Nothing happens and there are no errors anywhere.

Edit: I noticed if I start the emulator using the command above, then attach the process to it, the emulator resets and dies. Nothing in the logs about this.

Using Windows 10.

VS64 settings:

"vs64.showWelcome": false,
"vs64.emulatorExecutable": "D:\\code\\c64\\SDL2VICE-3.8-win64\\x64sc.exe",
"vs64.cc65InstallDir": "D:\\code\\c64\\cc65",
"vs64.loglevel": "trace",
"vs64.emulatorArgs": "-verbose -logfile vice.log",

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "vs64",
            "action": "build",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "label": "build project"
        }
    ]
}

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "vice",
            "request": "launch",
            "name": "Launch Vice",
            "preLaunchTask": "${defaultBuildTask}",
            "program": "${workspaceFolder}/build/hello.prg",
        },
        {
            "type": "vice",
            "request": "attach",
            "name": "Attach Vice",
            "hostname": "localhost",
            "port": 6502,
            "preLaunchTask": "${defaultBuildTask}"
        },
        {
            "type": "6502",
            "request": "launch",
            "name": "Launch 6502",
            "preLaunchTask": "${defaultBuildTask}"
        }
    ]
}
rolandshacks commented 4 months ago

Hi. I think this could be the same as here: https://github.com/rolandshacks/vs64/issues/49

It's a known issue of VICE-SDL on windows. Try using the GTK version of VICE.

For details, look here: https://github.com/rolandshacks/vs64/issues/68

About the built-in 6502 CPU emulator - you won't see anything as it's purely executing 6502 code, not custom chips, no output. But you can set breakpoints, step through your code, check the CPU registers and memory, etc...

Hope that helps!

PS. No need to set the "program" parameter, per default it will use the correct PRG from the build folder.

milzer commented 4 months ago

Thanks, that solved it. And I even googled first before to decide which one to use and several commenters said how much better SDL version would be on windows :) Might be worth mentioning it somewhere? In the marketplace description, FAQ or even in the settings?