by kodablah · 13y ago · 0 comments
E.g. https://github.com/pcwalton/sprocketnes/blob/master/audio.rs compared to https://github.com/scottferg/Fergulator/blob/master/audio.go or https://github.com/pcwalton/sprocketnes/blob/master/disasm.r... compared to https://github.com/scottferg/Fergulator/blob/master/disassem...
The disassembler is nicer though—it demonstrates macros and traits well. The macros and AddressingMode trait help avoid duplicating the instruction decode logic between the CPU interpreter and disassembler, with no overhead at runtime.