Coder Social home page Coder Social logo

gb_emulator's Introduction

GB Emulator

This is a small GameBoy emulator I made as a side project to get into the world of emulation.

Although it doesn't implement some quirks or bugs found in real hardware, it is a complete emulator capable of running some of the most complex ROMs. I decided not to make it more accurate to keep the scope small, as I intended this to be a quick side project.

It features keyboard and Xbox controller support through Xinput, and memory bank controllers 1, 2, 3 and 5, including RTC clock emulation and battery-backed RAM. The emulator periodically saves the battery-backed RAM banks to a .sav file whenever the ROM writes to them.

Usage

To open a ROM file, either drag it to the built exe file or pass the path as the first parameter in the command line, like

> gb_emulator.exe MyRom.gb

You can use either the keyboard or an xbox controller as input. Keyboard controls:

  • Arrow keys: D-Pad
  • Z: A button
  • X: B button
  • C: Start button
  • V: Select button

The xbox controller maps the obvious buttons to the GB ones (D-Pad/Left Joystick -> D-Pad, A button -> A button, etc.)

Build

To build it, run premake in the root directory to generate files for your preferred build system. I personally use Visual Studio, for which I run 'premake.exe vs2022'. The generated build files will be inside the 'build/' folder, and the compiled binaries in 'build/bin'

Shader effects

You might notice that the shader the emulator uses is a text HLSL file inside the 'shader/' folder. This is a deliberate choice. This shader gets built at runtime by the emulator, so you can edit it to create your own post-processing or fullscreen effects without recompiling.

gb_emulator's People

Contributors

yordrar 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.