Giter Club home page Giter Club logo

yagb's Introduction

Yet Another GameBoy Emulator

What?

Emulates the GameBoy (monochrome only) pretty decently. All major features are implemented and plenty of games and demoscene releases run.

Supported features

  • GameBoy CPU core (Z80-like)
  • LCD controller
    • Tiled primary background & the window (a secondary BG layer)
    • Background scrolling
    • IRQs for VBlank & raster position
    • Sprites & sprite DMA
  • Sound
    • 2 square wave channels
    • Wave channel
    • Noise channel
  • Joypad (+ IRQ)
  • Timer (+ IRQ)
  • Dummy serial port (+ IRQ)
    • Some weird games use the transmit IRQ for timing purposes...
  • MMC memory mappers + battery-backed save RAM
  • VRAM debug viewer
  • Save states

What's missing

  • Frequency sweep on the 1st square wave channel
  • Real Time Clock in the MMC3
  • Non-Nintendo mappers

And of course, plenty of bugs/emulation inaccuracies, see GitHub issues for some details.

Compiling & running

You'll need a C++11 compiler, Qt5 headers, and an OpenGL-capable machine. Compile with make. Run with:

./yagb [-t] path/to/rom/file.gb

Use -t to print a trace of all executed instructions and memory accesses made by the CPU or sprite DMA. For example:

[mem rd (CPU)] 0x0100: 00
[insn 00332/153/00000404] 0x0100:       00 => NOP                              A: 0x01 | BC: 0x0013 | DE: 0x00d8 | HL: 0x014d | SP: 0xfffe | Flags: Z-HC. | Cycles: 4
[mem rd (CPU)] 0x0101: c3
[mem rd (CPU)] 0x0102: 50
[mem rd (CPU)] 0x0103: 01
[insn 00332/153/00000408] 0x0101: C3 50 01 => JP 0x0150                        A: 0x01 | BC: 0x0013 | DE: 0x00d8 | HL: 0x014d | SP: 0xfffe | Flags: Z-HC. | Cycles: 16
[mem rd (CPU)] 0x0150: f3
[insn 00332/153/00000424] 0x0150:       F3 => DI                               A: 0x01 | BC: 0x0013 | DE: 0x00d8 | HL: 0x014d | SP: 0xfffe | Flags: Z-HC. | Cycles: 4

yagb's People

Contributors

dezgeg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

yagb's Issues

Demo-specific emulation issues:

  • 20y: side-to-side scanline moving in first part isn't visible (intra-scanline timing?)
  • gejmboj: twisting part before the dog part is broken (intra-scanline timing?)
  • jml-we: crashes on gambatte?
  • mc-mrder: screen stays black & tileram stops updating very soon, music keeps playing ok
  • oh: side-to-side scanline moving in the last part isn't visible (intra-scanline timing?)
  • qt-tsu: gambatte displays some screen garbage in plasma scene
  • yup-demonblood: arrow doesn't move in arrow scene

Game-specific emulation bugs

  • Alleyway: raster effects are off by one scanline
  • Super Mario Land 2: won't go past title screen
    • Most likely root cause: vblank irq gets pending while screen is off => not expected by game at (0x0259)
      • Not a problem at (0x0259). But:
        • at (0x2BBF): ROM bank is switched to 0x1b, also saved to (0xa24e)
        • at (0x2BD3): ROM bank is switched to 0x0c, but (0xa24e) is NOT updated
        • VBlank IRQ occurs (LCD is off)
        • at (0x01D6): IRQ handler restores bank from (0xa24e) to 0x1b, which is incorrect
  • Pokemon: Wave music notes sound crappy
  • Sprite renderer needs rewrite
    • Metroid 2, Zelda, Super Mario Land 2: asserts in sprite code
    • Pokemon: incorrect priority in title screen
  • Multiple SaveRAM banks broken

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.