|
|
|
|
|
by FemmeAndroid
1735 days ago
|
|
For those looking to see an example of the match expressions: https://github.com/mvdnes/rboy/blob/9f6b3bc47311ba687326bfff... This process of matching on opcode and doing a marginally different version of the same basic few operations on one of a set of registers is something that is _much_ easier to do when you're able to see all the opcodes and activities in a densely packed set of lines like this. (The start of the opcodes that I linked are not the best example of this, but they get more regular the further down the file you go. See https://github.com/mvdnes/rboy/blob/9f6b3bc47311ba687326bfff... ) Beyond knowing that they exist, I haven't explored macros in rust, but I'm curious if they could be of help here. But using cargo fmt, and spreading each of those lines into 3-10 lines would be awful, and would definitely lead to me making mistakes and not noticing typos. |
|
[1] https://git.musuka.dev/paoda/gb/src/branch/main/src/instruct...