Skip to content

A Swift package for interpreting Chip-8 ROMs

License

Notifications You must be signed in to change notification settings

acwright/Chip8Kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chip8Kit

A Swift package for interpreting Chip-8 ROMs

Usage

// ROM
let rom: [Byte] = [...]

// Initialize Chip8 with ROM data loaded at address 0x200
let chip8 = Chip8(rom: rom)

// Or load ROM data at specific address
let address: Word = 0x0200

chip8.load(rom: rom, address: address)

// Reset and erase the RAM
chip8.reset()

// Reset without erasing the RAM
chip8.reset(soft: true)

// Emulate one CPU cycle
chip8.cycle()

// Emulate one timer tick
chip8.tick()

Implementation

Implementation of the main loop is purposely left for the consuming application. The consuming application (presumably a GUI) will need to handle key presses, set up screen redrawing, and create timing for delay and sound.

More Info

About

A Swift package for interpreting Chip-8 ROMs

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages