This is a Gameboy emulator built using Swift. I built it out of an interest in how computers work and how emulators are built. It currently targets iOS but I plan to also target MacOS. It uses the Metal API for graphics.
It's built as Swiftly as I could muster, with a procedurally generated jump table for decoding instructions. This is accomplished by Swift's functional capabilities, which allow instructions to be declared at a high level and then corresponding functions can be generated from the declaration. This isn't the most CPU efficient paradigm but it definitely one of the fastest to program and is uniquely Swifty.
Here's a sample of how the jump table is declared and generated by the function I().
This isn't so user friendly at the moment. You have to add your rom to the project directory and enter it's name to the Gameboy class' initializer. I've only tested this with Pokemon Blue at the moment.
Official Game Boy Programming Manual
Unofficial Guide to the Game Boy CPU
Awesome resource for learning about drawing graphics among othter things