More musings on #Rust:
I wonder if it would be possible to write an #SNES #ROM in Rust. It seems like exactly the kind of resource-constrained system that would be a prime candidate for that sort of thing. Unfortunately, it seems that the SNES used a custom processor, so it's very possible that I won't be able to specify it as a compile target. A quick search reveals that many people have made SNES emulators in Rust, but at a glace, I see nothing about writing ROMS.
I believe the original NES used an off-the-shelf processor (6502 if memory serves?). Perhaps that's more likely to be supported, but that may be a little too resource constrained.
I shall have to dig deeper into this idea. I love the idea of building a custom ROM rather than just pirating something off the internet.
Has anyone done anything like this? Links to any relevant resources would be very much appreciated.
like this
reshared this
DocRekd
in reply to Jonathan Lamothe • • •This sound like a "write a custom #llvm backend problem"
llvm.org/docs/WritingAnLLVMBac…
Writing an LLVM Backend — LLVM 19.0.0git documentation
llvm.orgJonathan Lamothe likes this.
Jonathan Lamothe
in reply to DocRekd • •github.com/luizperes/llvm-to-s…
Jonathan Lamothe
in reply to Jonathan Lamothe • •Isaac Ji Kuo
in reply to Jonathan Lamothe • • •The SNES CPU is based on the WDC 65C816, which is indeed able to run 6502 code but it also has 16-bit mode instructions with much larger memory address space.
I think the only general purpose computer to use this CPU was the Apple IIGS, so maybe look around to see if there's any Rust port to Apple IIGS.
Eugene
in reply to Jonathan Lamothe • • •this folks have ported llvm to MOS6502: llvm-mos.org/wiki/Welcome
You can try to link rustc to that fork and add a new rustc target.
It will be a very long journey, but it is possible.