Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RP6502 VSCode Scaffolding for LLVM-MOS

This is scaffolding for a new Picocomputer 6502 software project.

LLVM PATH notes

LLVM-MOS must be in your PATH. However, this may conflict with other LLVM installations, like the one that comes with your operating system. In that case, you can adjust the path for only CMake with a VSCode setting. Add a file .vscode/settings.json with the following contents. Adjust the path for where you installed LLVM-MOS.

{
    "cmake.environment": {
        "PATH": "~/llvm-mos/bin:${env:PATH}"
    }
}

Linux Tools Install:

  • VSCode. This has its own installer.
  • An install of LLVM-MOS. See PATH notes above.
  • The following tools installed from your package manager:
    • sudo apt install cmake python3 git build-essential

Windows Tools Install:

  • winget install -e --id Microsoft.VisualStudioCode
  • winget install -e --id Git.Git
  • winget install -e --id Kitware.CMake
  • winget install -e --id GnuWin32.Make. Add "C:\Program Files (x86)\GnuWin32\bin" to your path.
  • An install of LLVM-MOS. See PATH notes above.
  • Install python by typing python3 which will launch the Microsoft Store where you start the install. If python runs, this has already been done, exit python with Ctrl-Z plus Return.

Getting Started:

Go to the GitHub template and select "Use this template" then "Create a new repository". GitHub will make a clean project for you to start with. Then you can download the repository and open the files.

$ git clone [path_to_github]
$ cd [to_where_it_cloned]
$ code .

Install the recommended extensions when VS Code prompts you, choosing the default or obvious choice for any other prompts. The tools we use in VS Code are constantly improving and have their own documentation. The first problem you might encounter is that no kit is configured, so begin by reading this and choosing the [Unspecified] kit: https://code.visualstudio.com/docs/cpp/cmake-linux The full documentation for the CMake plugin is here: https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/README.md

"Start Debugging" (F5) offers two launch configurations:

  • RP6502 (Emulator) is the default. It builds your project and runs it with source-level debugging in the rp6502 emulator.
  • RP6502 (Hardware) builds your project and runs it on a Picocomputer 6502. Connect with telnet or a USB cable plugged into the RP6502-VGA USB port.

Both read .rp6502 in the project root. This file is created the first time you "Start Debugging" and is ignored by git.

For the emulator, the emulator setting must point to the rp6502-emu executable (a bare name is searched on your PATH).

For hardware, set device to the serial port. If you get a Python error about the communications device not being found, edit device in .rp6502. You may also connect over telnet by instead providing a hostname for the device and setting the key.

Once the program is running, a debug console becomes available on the terminal tab. It will say "Python Debug Console" because the rp6502.py tool is Python. Ctrl-A then X will exit. Ctrl-A then B will send a break.

Edit CMakeLists.txt to add new source and asset files. From here on, it's standard C/C++/assembly development for the 6502 platform.

About

New Project Template for LLVM-MOS

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages