Show HN: Cross-Platform Apple IIe Emulator Written in Go
octalyzer.com
octalyzer.com
It features both the 2D and the 3D engine (with a full software rasterizer with poly-fillers generated through go generate). It's highly concurrent (each graphic layer is drawn in a different goroutine and then mixed together). The ARM interpreter is also generated via go generate.
I'll add some screenshots at some point.
This means that goroutines synchronize 263*60 times per second, which is something. I measure a high contention, so I'm not even sure it was worth in the end, but I thought it was a good experiment to attempt :)
Another Go-related thing I did was using struct tags to configure memory-mapped registers in a declarative way. See for instance: https://github.com/rasky/ndsemu/blob/master/irq.go#L13
where I configure the memory-mapped registers of the interrupt controller; "wcb" / "rcb" tags stand for write/read callbacks, which means that specific callbacks (with names matching the register names) will be called for each read/write operation; this is all achieved through reflection. The same applies to mapping the whole register bank, which is done here: https://github.com/rasky/ndsemu/blob/master/nds9.go#L69
The memory subsystem handling these and more features is in emu/hwio, and I'm actually pretty proud of it. For the memory mapping itself, a radix tree is built which is quite quick to lookup and doesn't require much barcoding.
In fact, the whole "emu" package is a generic framework for emulators in Go, and I plan to reuse it in the future :)
A lot of these retro games don't look so authentic on LCD screens because things like blur and shadow masking were actually used by the designers of the original games.
http://filthypants.blogspot.com/2015/04/more-crt-shaders.htm...
[0]: http://www.aaronbell.com/secret-colours-of-the-commodore-64/
[1]: http://nerdlypleasures.blogspot.fr/2015/03/the-case-for-comp...
https://www.youtube.com/watch?v=p3QZqhp67l8 http://manpages.ubuntu.com/manpages/trusty/man6/apple2.6x.ht...
Also, a single binary file download without even a checksum (let alone the source)??? No thank you.
- posted from my totally secure Firefox
Even when C like performance is required, C++ is actually used instead.
The three major C compilers (gcc, clang and VC) are all written in C++ nowadays.
In the enterprise world Java did that - even high frequency trading applications have been Java based for quite some time. Compared to 20years ago, there is significantly less C code nowadays.