Git Product home page Git Product logo

gamelin's Introduction

Gamelin

A Gameboy (Color) emulator written in Kotlin, able to run on desktop/JVM (with LibGDX + VisUI) and in browser (with Bootstrap and KorAU).

Status

The emulator is in a good and usable state. Both DMG and CGB emulation is complete and quite accurate, enough to make most commercial games run perfectly.

Desktop Version

Features
  • Upscaling with HQ2X, HQ3X and HQ4X
  • .sav game saving compatible with most other emulators (BGB, VBA, ...)
  • Save states with "undo last load" function
  • Live rewinding of games for up to 60 seconds
  • Fast-forwarding at any integer multiplier (with hold and toggle hotkeys)
  • Basic gamepad/controller support
  • Debugger with:
    • Emulator halting / Line-by-line debugging
    • PC and write breakpoints
    • Memory, register and stack view
    • Tileset and BG Map Viewers
    • Cartridge Info Viewer
    • Per-instruction CPU/register state logging
    • Instruction Set Viewer
Playing Pokemon Silver with HQ4X upscaling

Desktop version playing Pokemon Silver

Pokemon Pinball with running debugger and memory viewer

Desktop version playing Pokemon Silver

TLoZ: Oracle of Ages with some visual debugging tools open

Desktop version playing Oracle of Ages

Web Version - gamelin.kjs

  • Entire emulator working fully
  • Full game saving and RTC support (into browser local storage)

Missing console features

  • Some MBC3 controllers have a built-in RTC for keeping track of time; Gamelin implements it, but in a very simple format incompatible with other emulators that has a high chance of not working with most games (it was tested with Pokemon Crystal and successfully kept time after turning the game off overnight - needs more testing).

Tested games

Here's a non-exhaustive list of games I've tested. Results might sometimes be outdated. All games that support both DMG/GB and CGB/GBC were tested in GBC mode.

Perfect with no observable issues

  • Pokemon Blue (Global, 1996, Game Freak)
    • Tested until Viridian Forest
  • Pokemon Yellow (Global, Game Freak)
    • Played until reaching the end of Route 1
  • Pokemon Silver (Global, 2000, Game Freak)
    • Played until first GYM, including Bellsprout Tower
  • Pokemon Crystal (Global, 2001, Game Freak)
    • Played until reaching Bellsprout Tower
  • Dr. Mario (Global version, 1990, Nintendo)
  • Tetris (JP and Global versions, 1989, Nintendo)
  • Tetris DX (Global, 1998, Nintendo)
  • Pokemon Pinball (Global, 1999, Jupiter)
  • Super Mario Land (Global, Nintendo)
    • Played until 2-1
  • Super Mario Land 2 (Global, 1992, Nintendo)
    • Played the first level
  • Super Mario Bros. Deluxe (Global, 1999, Nintendo)
    • Played until 1-3, other modes also briefly tested
  • Wario Land 3 (Global, 2000, Nintendo)
    • Played the first level
  • The Legend of Zelda: Link's Awakening (Global, 1993, Nintendo)
    • Played until shortly after obtaining your sword at the shore
  • The Legend of Zelda: Link's Awakening DX (Global, 1998, Nintendo)
    • Played until finding the toadstool in the mysterious woods
  • The Legend of Zelda: Oracle of Ages (Global, 2001, Nintendo)
    • Played until receiving the wooden sword
  • Kirby's Dream Land (Global, Nintendo/HAL)
    • Played until middle of stage 2
  • Donkey Kong (Global, 1994, Nintendo)
  • Donkey Kong Land (Global, 1995, Nintendo/RARE)
    • Tested for the first 2 levels
  • Donkey Kong Country (Global, 2000, RARE)
    • Played the first level
  • Yoshi (Global, 1992, Nintendo)
  • Tic-Tac-Toe (1996, Norman Nithman)

Goals

The main goals of this emulator is to both learn more about emulation of real-world hardware as well as creating a nice-to-use emulator with many comfort features that should be able to run well in the browser. Accuracy is only a goal when it fixes issues encountered by actual games; implementing complex but ultimately useless hardware details that aren't used by games (like the OAM bug or MBC1 multicarts) is not a goal of this emulator, particularly considering the speed requirements needed to make it work in the browser.

Build

# Run on desktop
./gradlew run

# Create jarfile
./gradlew dist

# Create web build in web/
./gradlew distJs

Testing

Blargg, mooneye and acid2 ROMs can be run automatically using gradle:

gradle jvmTest

Note that by default, only passing tests are run to allow easily catching regressions. To run all tests, change TEST_ALL in src/jvmTest/xyz/angm/gamelin/tests/ProjectConfig.kt to true.

Blargg test results

  • cpu_instrs, mem_timing, mem_timing-2, instr_timing, interrupt_time: Pass
  • dmg_sound: 8/12 pass (07, 09, 10, 12 fail)
  • cgb_sound: 7/12 pass (07, 08, 09, 11, 12 fail)
  • oam_bug: Everything but 3 and 6 fail (OAM bug won't be implemented)

Mooneye test results

  • acceptance: 27 out of 75 pass
  • emulator-only: All pass (except MBC1 multicart; will not be supported)

Acid2

Both the dmg-acid2 and cgb-acid2 test written by Matt Currie pass (CGB in DMG mode untested). Thank you to @mattcurrie for creating them!

Thanks To

gamelin's People

Contributors

aurelilia avatar

Stargazers

Larson T. avatar Max H. avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.