News for hackers. Stuff that matters.
Re:The Adventures of Writing a CHIP8 Emulator by plandis on Tuesday June 13, 2023 @11:17AM (#36311504)
I’ve written a chip 8 emulator in both C and Rust and the Rust one is definitely more clear, and with destructured pattern matching you can really cleanly decode the opcodes in Rust: https://github.com/plan-x64/chip8/blob/master/chip8-core/src...

Normally I’d do something like a simple prefix lookup table with function pointers in C for this but chip8 opcodes require parsing the postfix to fully determine the operation (I.e. 8xy[0..e], where x and y are registers) which requires further parsing than a simple lookup table based on prefix.

There are no comments on this comment yet.