This project aims to transform LLVM IR into WLA DX (ASM 65c816), assemble the output and generate a SNES ROM. Please read the links below to further information on SNES and LLVM plataforms.
The wiki's homepage for general information on SNES architecture (65c816)
Install it locally:
cd </path/to/llvm-to-snes/>
makedir build-snes && cd build-snes
cmake -DLLVM_TARGETS_TO_BUILD=X86 . --build . -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SNES
make install
// it might take a while
Run: // please read observations below
clang your_filename.c -S -emit-llvm -o your_filename.ll
<path/to/llvm-to-snes>/build-snes/bin/llc -march=snes <your_filename>.(ll|bc)
You may test it with any language that compiles to llvm, or you might write it yourself by hand, as long as the file has LLVM extensions .ll
or .bc
.
SNES (65c816) has a 16-bit architecture and this project up-to-date does not support 32 or 64 bit. A good example for a file test would be:
// sum_file.c
short sum(short a, short b) {
return a + b;
}
You may find C files for testing under ./test/Examples/SNES`.
The files for this project can be found inside the folder ./lib/Target/SNES/. We have forked the whole LLVM because we have plans of using Docker containers in the future for such tasks.
We still have a lot of tasks before creating a first version of this project. All skill levels are welcome to accomplish tasks such as:
- Testing and reporting issues
- Creating test files
- Working on project documentation
- Creating libraries for LLVM frontend languages (such as C and Rust)
- Developing the backend (Check ./lib/Target/SNES/TODO.md)
- Many others