3 ms·
It looks like so much Rust code to generate the simplest of 6502 code. No thanks.
by fallat 5y ago
It looks like so much Rust code to generate the simplest of 6502 code. No thanks.
- boomlinde 5y agoNo thanks indeed, but I completely agree with this sentiment from the article: > It is worth pointing out that the amazing thing about chirp8-c64 is not how well it works, but that it works at all.
- gergoerdi 5y agoDid you look at chirp8-engine, or only chirp8-c64? The value add is not in the parts that interface with the C64 internals; probably using C for that would make for nicer code. But I wanted to push as much into Rust as I could in the short amount of time I spent on this. The real advantage of using Rust is in the actual program logic. E.g. the instructions are decoded into an algebraic datatype (in https://github.com/gergoerdi/chirp8-engine/blob/7623353a8bf026ae02b1ac61628ba0762ade7b9c/src/opcodes.rs#L84 https://github.com/gergoerdi/chirp8-engine/blob/7623353a8bf0...) and then that is consumed in the virtual CPU (https://github.com/gergoerdi/chirp8-engine/blob/7623353a8bf026ae02b1ac61628ba0762ade7b9c/src/cpu.rs#L73 https://github.com/gergoerdi/chirp8-engine/blob/7623353a8bf0...). Rust's case-of-case optimization takes care of avoiding the intermediate data representation at runtime.