LulzCop
u/LulzCop
Language hacking: crafting an enum with variants decided at compile-time
guiand.xyz/blog-posts/compile-time-unions.htmlSo for a while now, I've been trying to figure out how to create a bitfield macro that allows easy, ergonomic use. A few days ago, I found the solution, and now I've published bitutils to crates.io!
Some background
I've been working on and off on an emulator for the 3DS' security processor, as well as a test binary that I cross-compile to the ARM9 processor on the 3DS. Both are written in Rust, and both require heavy use of bitfields. I wanted a solution that allowed me to name the individual fields, and to be somewhat ergonomic (my previous solution required me to do bf!( reg.field1 = newval ) for instance).
First, the syntax
I defined a `bf!
PCSX2 is a pretty popular emulation project for the PS2, but it's suffering from a bad case of platform dependency. Its developers seem to have no time for the support of x86_64 or really any platforms other than 32-bit Linux and Windows. It's impossible to use on OSX, Android, and many 64-bit Linux distros even with multilib enabled.
Many of the talented developers of PCSX2 have left to work on other projects, and as such it has began to go stagnant.
What you can help with: if you find any code in the project that can be abstracted to work on multiple platforms (no matter how small), it would be an immense help towards the effort of someday using the emulator anywhere besides your Windo
