Skip to content

nathanbacon/SwiftBoy-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftBoy

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.


               


        



Implementation

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(). screen shot 2018-11-07 at 22 47 45 screen shot 2018-11-07 at 22 47 29

Usage

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.

Resources

Official Game Boy Programming Manual

Unofficial Guide to the Game Boy CPU

LR35902 Opcode Table

Awesome resource for learning about drawing graphics among othter things

Blog about a Gameboy emulator written in Javascript

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published