PeterJ wrote: ↑Sun Apr 08, 2018 1:31 pm
I have looked at Microsoft Visual Code. It looks promising as it runs on both Linux and Windows. I did try and read the bit about calling external commands to make build calls but I got thoroughly confused! Is there any chance you could expand on this with some examples?
Sure - VS Code is a bit bare-bones when it comes to config, it expects you to be happy editing .json files so it's not quite as user-friendly as some. The good news is that once you've set them up you don't need to touch them again.
You need to select a folder where your source will live. Once there, choose 'configure default build task' from the Tasks menu (it will appear when you hit alt if it's not visible by default) and then choose 'create tasks.json file from template' from the pop-up that opens and then select 'others' (because we're going to feed it a script file). That'll make a file for you with practically nothing in it, like this:
Code: Select all
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "echo Hello"
}
]
}
I replaced the contents of that file with a configuration like this (most of which was ripped from Internet examples), which sets up both the build and the test/run tasks:
Code: Select all
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "pasmo",
"command": ".\\make.cmd CosmicJanitor",
"type": "shell",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared"
}
},
{
"label": "test",
"command": "c:\\games\\emulators\\spectrum\\specemu\\specemu.exe",
"args": [
"c:\\dropbox\\code\\speccy\\CosmicJanitor\\CosmicJanitor.tap"
],
"type": "shell",
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": [],
"presentation": {
"echo": false,
"reveal": "never",
"focus": false,
"panel": "shared"
}
}
]
}
Most of the options in there you won't need to worry about, but the bits which are custom to building Speccy code should stand out pretty well. The build task runs a Windows batch file called make.cmd and feeds it the game name as a parameter. That file lives in the root of the folder we selected at the start and looks like this (but yours could look like anything you like, obviously):
Code: Select all
@echo off
setlocal
set PASMODIR=C:\Dropbox\Code\Speccy\_Tools\Pasmo
"%PASMODIR%\pasmo" --alocal --tapbas --name CosmicJanitor %1.asm %1.tap %1.symbol
endlocal
The test task is even simpler - it basically locates and runs SpecEmu and feeds it the .tap file that Pasmo generates as an argument.
With the tasks.json file saved, I can now hit CTRL/Shift-B to run a build. CTRL/Shift-P opens the tasks menu, and you should find that 'run test task' is the first entry in there - selecting it should run SpecEmu and fire up the .tap file.
This config persists just for this project, so if you set up a new one in a new folder you'd need to copy the file across or generate a new one.
Hopefully that makes some sense - please ask if anything seems weird or unclear. It might seem a bit unfriendly (and it is) but literally it's the only bit of config I've done apart from installing the Pasmo plug-in - everything else is 'out of the box'.