This repo contains a mixed C# and C codebase for working with the Cornerstone virtual machine. It includes:
- C# tools for assembling, inspecting, running, disassembling, and repackaging Cornerstone images.
- Native runtimes for Commodore 128, Atari ST, Amiga, and POSIX hosts.
- Bundled sample data.
Cornerstone/- install Cornerstone here before running the test suite.data/- shared instruction grammar used by the assembler and C# interpreter.DB/- database files used for testing.src/Chisel/- C# assembler that turns.cassource into.objand.mmeimages.src/Linchpin/- C# interpreter and disassembler for Cornerstone images.src/LP128Pack/- C# bundler that packages.mme+.objinto a.csbbundle for the C128 runtime.src/Linchpin128/- C runtime for POSIX and Commodore 128 targets.src/LinchpinST/- C runtime for POSIX, Atari ST, and Amiga targets.test/Linchpin.ToolTests/- MSTest suite for the C# tools.test/Linchpin.TestCaseTool/- helper for creating interpreter-based test cases.
Assembler for the Cornerstone VM. It reads .cas source and produces .obj and .mme output files.
Example source files are under src/Chisel/examples/.
Interpreter and disassembler for Cornerstone images. Main commands:
run- execute the VM.inspect- print image metadata and an entrypoint preview.disassemble- emit reconstructed assembler source.
Packs a Cornerstone .mme and .obj pair into a .csb bundle for the Linchpin128 runtime.
Native runtime for the Cornerstone VM.
make posixbuilds a POSIX-hosted executable.make c128builds a Commodore 128 program withllvm-mos.make c128-d64,make c128-d71, andmake c128-d81also create disk images.
The C128 disk-image targets use VICE c1541.exe from WSL and can optionally embed a .csb bundle.
Native runtime for multiple classic targets.
make posixbuilds a POSIX-hosted executable.make atari/make atari-tosbuild Atari binaries.make atari-diskbuilds an Atari ST disk image.make amiga,make amiga-adf, andmake amiga-hdfbuild Amiga binaries and disk images.make amiga-fpuand related targets build the 68040/FPU Amiga variant.
src/LinchpinST/LinchpinST.proj is an MSBuild wrapper that calls wsl make, but the actual native compilation still happens inside WSL.
- Visual Studio or Build Tools with MSBuild support.
- .NET SDK 10.0 for the C# projects.
- WSL for all native C builds.
At minimum:
makegccfor POSIX buildspython3for the Commodore 128 launcher generator
Additional target-specific tools:
llvm-mosforsrc/Linchpin128Commodore 128 builds- VICE
c1541.exereachable from WSL for Commodore disk-image targets m68k-atari-mintelf-gccorm68k-atari-mint-gccfor Atari buildsdosfstoolsandmtoolsfor Atari disk-image generationm68k-amigaos-gccfor Amiga buildsamitools(xdftool) for Amiga ADF/HDF image generation
Build the solution:
dotnet build linchpin.slnxBuild an individual project:
dotnet build src\Linchpin\Linchpin.csproj
dotnet build src\Chisel\Chisel.csproj
dotnet build src\LP128Pack\LP128Pack.csprojIf you are invoking the build from Windows, run these commands inside WSL.
POSIX builds:
cd src/LinchpinST
wsl make clean
wsl makeTarget-specific examples:
# Build Linchpin128 as a Commodore 128 disk image
# with a bundled bytecode program
cd src/Linchpin128
make c128-d81 BUNDLE=path/to/bundle.csb
# Build LinchpinST as an Atari ST disk image
cd src/LinchpinST
make atari-disk
# Build LinchpinST as an Amiga disk image
cd src/LinchpinST
make amiga-adfInspect an image:
Linchpin inspect --mme path/to/image.mmeRun an image with a database directory, enabling writes:
Linchpin run --mme path/to/image.mme --data YourDB --host-write-filesDisassemble an image to a file:
Linchpin disassemble --mme path/to/image.mme --output path/to/image.casAssemble an example source file:
Chisel assemble src/Chisel/examples/hello-world.cas --mme hello-world.mmePackage an assembled image into a bundle for use with the Linchpin128 build:
LP128Pack --mme hello-world.mme --obj hello-world.obj --output hello-world.csbRun the test suite with:
dotnet test