Skip to content

pixel-clover/ocelot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Ocelot Logo

Ocelot

Tests Lints Code Coverage License Play Online
Docker Release

A Nintendo Game Boy and Game Boy Color emulator in Haskell λ


Download the latest desktop version of Ocelot from here or try Ocelot in your web browser.

Footage of Ocelot running a few games:

TLZ demo
The Legend of Zelda: Link's Awakening
AI demo
Adventure Island
FFA demo
Final Fantasy Adventure
TLZ DX demo
The Legend of Zelda: Link's Awakening DX
WL3 demo
Wario Land 3
SMBDl demo
Super Mario Bros. Deluxe

Key Features

  • Accurate Game Boy and Game Boy Color emulation
  • Very portable; run on Linux and macOS, and also in the browser via WebAssembly (Windows support is currently source-build only)
  • Very configurable, including gameplay input, frontend hotkeys, and rendering settings
  • Has a permissive license that allows commercial use

See ROADMAP.md for the list of implemented and planned features.

Important

This project is still in early development, so compatibility is not perfect. Bugs and breaking changes are also expected. Please use the issues page to report bugs or request features.


Quickstart

Download the Latest Release

A. Desktop

You can download the latest pre-built desktop binaries (Linux and macOS) from the project's release page.

B. Web

You can download and use the latest pre-built Docker image for the web version of Ocelot from GHCR:

docker run -d -p 8085:80 --rm ghcr.io/pixel-clover/ocelot-web:latest

Then open http://localhost:8085 in your browser.

Build Ocelot from Source

Alternatively, you can build the emulator from source by following the steps below.

1. Clone the repository
git clone --depth=1 https://github.com/pixel-clover/ocelot.git
cd ocelot

Note

If you want to run the tests and develop Ocelot further, you need to clone the repository with git clone --recursive https://github.com/pixel-clover/ocelot.git. Test ROMs can then be fetched with make test-roms.

2. Build the Ocelot Binary
# This can take some time
make release

If the build is successful, you can find the built binary at $(stack path --local-install-root)/bin/ocelot.

Using Nix

If you use Nix, the repository provides a development shell:

nix develop
stack build
stack run -- play [/path/to/rom.gbc]

Run the Emulator

Run the play command to start the emulator GUI:

ocelot play [/path/to/rom.gbc]

Help menu while the emulator is running:

Ocelot Screenshot

Run ocelot --help to see the list of available command-line options.

Example output:

Ocelot 0.1.0.0 (develop@0a0be9e) - Game Boy (DMG) and Game Boy Color (CGB) emulator in Haskell

Usage: ocelot [-V|--version] COMMAND

Available options:
  -h,--help                Show this help text
  -V,--version             Print the version and exit

Available commands:
  play                     Run the ROM in the SDL frontend (default mode). Pass
                           --boot-rom to start from a DMG/CGB boot ROM instead
                           of the post-boot register state.
  headless                 Step the CPU for a fixed number of instructions and
                           dump the final state (registers, serial output,
                           disassembly, memory hex dump, VRAM tile preview,
                           framebuffer) to the terminal.
  audio-test               Play a 440 Hz sine tone for 2 seconds via SDL. No ROM
                           needed; verifies the SDL audio path.
  info                     Print the ROM's cartridge header and exit.

SDL key bindings (play): S=A, A=B, Enter=Start, RShift=Select, Arrows=D-pad,
Space=pause/resume, F1=help overlay, .=frame step, Tab=fast-fwd (held), F5=save
state, F6=cycle slot (1-5), F7=load state, F11=fullscreen, F12=screenshot,
Shift+F12=record GIF, P=perf overlay, O=open ROM, R=reset, Escape=quit.

Contributing

See CONTRIBUTING.md for details on how to make a contribution.

License

Ocelot is licensed under the MIT License (see LICENSE).

Acknowledgements

Reference Implementations

Ocelot's implementation logic was checked with the following reference material for finding errors and verifying correctness:

Sponsor this project

 

Packages

 
 
 

Contributors