https://github.com/mlund/mega65-adventure
Playground for MEGA65 programming
https://github.com/mlund/mega65-adventure
6502-assembly c64 mega65 retrocomputing
Last synced: 10 months ago
JSON representation
Playground for MEGA65 programming
- Host: GitHub
- URL: https://github.com/mlund/mega65-adventure
- Owner: mlund
- License: gpl-3.0
- Created: 2022-05-29T18:37:49.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-04-04T15:06:34.000Z (about 3 years ago)
- Last Synced: 2023-04-05T22:10:56.706Z (about 3 years ago)
- Topics: 6502-assembly, c64, mega65, retrocomputing
- Language: C
- Homepage:
- Size: 128 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MEGA65 Programming Playground
This is a playground for testing programming on the [MEGA65](https://mega65.org) 8-bit computer.
## Rust using llvm-mos
**Update**: _See the [`mos-hardware`](https://github.com/mlund/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](https://llvm-mos.org) from wrapped Rust code. It requires a working
Rust installation and the [llvm-mos-sdk](https://github.com/llvm-mos/llvm-mos-sdk#getting-started).
Compile and run on MEGA65 in c64 mode with:
~~~ bash
cd hello_rust
make
make run # emulate in xemu
~~~

### Things to do:
- [x] Added convenience `peek` and `poke`
- [x] 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](https://github.com/MEGA65/mega65-libc) to Rust?
- Build
- [ ] Use cargo
- [ ] Avoid c wrapper
### Useful links
- https://github.com/mlund/mos-hardware
- http://forum.6502.org/viewtopic.php?p=84048#p84048
- https://gergo.erdi.hu/blog/2021-09-18-rust_on_the_mos_6502__beyond_fibonacci/
- [Atari rust example](https://github.com/mrk-its/llvm-mos-ferris-demo)
### Why?
Because I like MEGA65 and I like Rust.