Skip to content
StephenDev0Public

About

A cycle-accurate NES emulator in Swift, with a Metal renderer and a libretro core.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Bismuth

A cycle-accurate NES emulator in Swift, with a Metal renderer and a libretro core.

Requires Swift 6 (Xcode 16+). No ROMs are included.

Install

.package(url: "https://github.com/StephenDev0/Bismuth.git", branch: "main")

Products: NESCore, NESMetal, NESAchievements.

Usage

import NESCore

let nes = try NESConsole(rom: romBytes)
nes.setButtons([.start], player: 0)
nes.runFrame()
nes.renderARGB(into: pixels)      // 256x240
let audio = nes.drainAudio()      // stereo Int16, 48 kHz
let state = nes.saveState()
try nes.loadState(state)
import NESMetal

NESScreen(console: nes)           // SwiftUI view; runs and draws one frame per refresh

libretro core

Scripts/build-libretro.sh         # macOS, iOS, iOS simulator and tvOS builds in dist/

Command line

swift run -c release bismuth-cli run game.nes --frames 600 --png shot.png

Tests

swift test

License

Bismuth License (MIT, Non-Commercial). Not affiliated with Nintendo.

About

A cycle-accurate NES emulator in Swift, with a Metal renderer and a libretro core.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages