Skip to content

mlund/mega65-adventure

Repository files navigation

MEGA65 Programming Playground

This is a playground for testing programming on the MEGA65 8-bit computer.

Rust using llvm-mos

Update: See the mos-hardware crate for using Rust on C64 inspired computers!

Amazingly, most core Rust features (no_std only) seem to work, including iterators and functional style programming. The hello_rust directory contains a simple example that compiles to a C64 .prg using llvm-mos from wrapped Rust code. It requires a working Rust installation and the llvm-mos-sdk. Compile and run on MEGA65 in c64 mode with:

cd hello_rust
make
make run # emulate in xemu

Things to do:

  • Added convenience peek and poke
  • Begin mega66 rust module with hardware registers (see e.g. KickC headers)
  • Inline assembler? core::arch::asm seem to work but unknown upcodes
  • Start in MEGA65 mode
  • Wrap mega65-libc to Rust?
  • Build
    • Use cargo
    • Avoid c wrapper

Useful links

Why?

Because I like MEGA65 and I like Rust.