Skip to content

luizperes/llvm-to-snes

Repository files navigation

LLVM IR to the SNES plataform

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)

How to test it

Install it locally:

  • cd </path/to/llvm-to-snes/>
  • mkdir 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)
Obs.1

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.

Obs.2

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;
}
Obs.3

You may find C files for testing under ./test/Examples/SNES`.

Obs.4

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.

How to help

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

About

LLVM IR → WLA DX (ASM 65c816) → SNES Rom

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published