4 ms·
The juxtaposition between this and https://github.com/pcwalton/sprocketnes https://github.com/pcwalton/sprocketnes is neat. E.g. https://github.com/pcwalton/sp
by kodablah 14y ago
The juxtaposition between this and https://github.com/pcwalton/sprocketnes https://github.com/pcwalton/sprocketnes is neat.
E.g. https://github.com/pcwalton/sprocketnes/blob/master/audio.rs https://github.com/pcwalton/sprocketnes/blob/master/audio.rs compared to https://github.com/scottferg/Fergulator/blob/master/audio.go https://github.com/scottferg/Fergulator/blob/master/audio.go or https://github.com/pcwalton/sprocketnes/blob/master/disasm.rs https://github.com/pcwalton/sprocketnes/blob/master/disasm.r... compared to https://github.com/scottferg/Fergulator/blob/master/disassembler.go https://github.com/scottferg/Fergulator/blob/master/disassem...
- voidlogic 14y agoIt is interesting to read and compare both, but I would avoid a simple LOC comparison as the Go versions have a lot of extra lines (newlines, unneeded selects, redundant case statements) that could easily be eliminated.
- pcwalton 14y agoEw, my audio code. :( I hacked the SDL audio bindings together with no regard to proper Rust idioms; hence the unsafe everywhere. The Go code reads far better. 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.
- ferg 14y agoThe audio bindings are due to the excellent Go-SDL package. Nevermind my own fork, that was just to remove some unneeded stuff to fix compilation on OSX.