A Gameboy Color Emulator written in Rust

Overview
Comments
  • Clarify buttons to press

    Clarify buttons to press

    Could you please add some kind of documentation which keyboard keys are responsible for which gameboy keys? Thanks! I love this emulator, but this makes it hard to recommend it to others. :)

    opened by jens1o 6
  • Get an explanation

    Get an explanation

    Hey,

    I'm trying learn more about emulators and how the things works on low level... I find this function on your code...

    fn alu_add16imm(&mut self, a: u16) -> u16 {
      let b = self.fetchbyte() as i8 as i16 as u16;
      self.reg.flag(N, false);
      self.reg.flag(Z, false);
      self.reg.flag(H, (a & 0x000F) + (b & 0x000F) > 0x000F);
      self.reg.flag(C, (a & 0x00FF) + (b & 0x00FF) > 0x00FF);
      return a.wrapping_add(b)
    }
    

    Why this can't add the b directly to a? Without make 3 casts to i8 -> i16 and finally u16?

    Thank you in advance 😉

    opened by gil0mendes 3
  • Noise length parameter not respected

    Noise length parameter not respected

    In sound.rs

     0xFF23 => {
                    self.length_enabled = v & 0x40 == 0x40;
                    if v & 0x80 == 0x80 {
    

    The self.length_enabled statement is missing. Adding this fixes annoying noise in a number of games including Zelda: Link's Awakening.

    Additionally, the enabled flag on the wave channel should be set like this:

       0xFF1A => {
                    self.enabled_flag = (v & 0x80) == 0x80;
    

    The Zelda: Oracle games needs this but seem to have other issues too.

    Just stuff I noticed when messing around with it :) (I've been using parts of the code to play with upscaling shaders).

    opened by hrydgard 2
  • Question about renderscan implementation

    Question about renderscan implementation

    I've been using your emulator as a reference while learning how to write an emulator. Thanks for sharing it!

    I had a question about how you implement the GPU's cycle.

    In do_cycle https://github.com/mvdnes/rboy/blob/master/src/gpu.rs#L110 it seems like you're emulating the advancement of the GPU's timing fairly accurately. I was expecting to see a mechanism for incrementally drawing graphics into a buffer (later to be output to the host's screen), pixel by pixel. But instead, it seems like you just draw it all at once at the beginning of switching to mode 1, calling self.renderscan() once.

    Could you confirm that is indeed what you're doing, and if you had any feedback on it? Was that for performance reasons? Is it because it doesn't affect some, most, or all games? My sense is that some games might want to do clever things depending on what column you're currently drawing to, but that's not possible if you draw it all in one shot and then emulate no-op cycles past that.

    Thank you!

    opened by ablakey 2
  • Add working link to mirror of pandocs

    Add working link to mirror of pandocs

    Add working link to mirror of pandocs, as the one in README (nocache.emubase.de) appears to be dead

    (Used this alternative for quite some time whilst developing another gameboy emulator and they produced BGB, so a fair resource to link to, I think)

    opened by MatthewJohn 1
  • Crash when enable audio on Windows 10

    Crash when enable audio on Windows 10

    Rust: rustc 1.47.0 (18bf6b4f0 2020-10-07) Windows 10 64bit

    thread 'main' panicked at 'OleInitialize failed! Result was: `RPC_E_CHANGED_MODE`. Make sure other crates are not using multithreaded COM library on the same thread or disable drag and drop support.', C:\Users\Shell\.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\winit-0.23.0\src\platform_impl\windows\window.rs:84:25
    stack backtrace:
       0: std::panicking::begin_panic<str*>
                 at C:\Users\Shell\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:497
       1: winit::platform_impl::platform::window::{{impl}}::new::{{closure}}<tuple<>>
                 at C:\Users\Shell\.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\winit-0.23.0\src\platform_impl\windows\window.rs:84
       2: core::result::Result<winit::platform_impl::platform::window::Window, winit::error::OsError>::map<winit::platform_impl::platform::window::Window,winit::error::OsError,winit::platform_impl::platform::window::Window,closure-0>
                 at C:\Users\Shell\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\result.rs:508
       3: winit::platform_impl::platform::window::Window::new<tuple<>>
                 at C:\Users\Shell\.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\winit-0.23.0\src\platform_impl\windows\window.rs:74
       4: winit::window::WindowBuilder::build<tuple<>>
                 at C:\Users\Shell\.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\winit-0.23.0\src\window.rs:333
       5: glutin::platform_impl::platform_impl::Context::new_windowed<tuple<>>
                 at C:\Users\Shell\.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\glutin-0.25.1\src\platform_impl\windows\mod.rs:55
       6: glutin::ContextBuilder<glutin::context::NotCurrent>::build_windowed<glutin::context::NotCurrent,tuple<>>
                 at C:\Users\Shell\.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\glutin-0.25.1\src\windowed.rs:360
       7: glium::backend::glutin::Display::new<glutin::context::NotCurrent,tuple<>>
                 at C:\Users\Shell\.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\glium-0.28.0\src\backend\glutin\mod.rs:75
       8: rboy::real_main
                 at .\src\main.rs:108
       9: rboy::main
                 at .\src\main.rs:26
      10: core::ops::function::FnOnce::call_once<fn(),tuple<>>
                 at C:\Users\Shell\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:227
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    error: process didn't exit successfully: `target\debug\rboy.exe -a D:\bittboy\roms\GB\WWF世界摔角联盟.gb` (exit code: 101)
    
    opened by asypost 0
  • write a remote gdb server

    write a remote gdb server

    Hello.

    I am looking for an accurate emulator for gameboy color with gdbserver feature. I want to implement it to rboy with gdbstub: https://github.com/daniel5151/gdbstub.

    Assign me to this issue please.

    opened by gogo2464 0
Owner
Mathijs van de Nes
Mathijs van de Nes
Bevy plugin to simulate and preview different types of Color Blindness.

Bevy Color Blindness Simulation Bevy plugin to simulate and preview different types of Color Blindness. This lets you ensure that your game is accessi

annie 29 Nov 22, 2022
Work-in-progress Nintendo Switch emulator, written in Rust and slightly less focused on gaming

pegasus Work-in-progress Nintendo Switch emulator, written in pure Rust and slightly less focused on gaming Information This project aims to be a diff

XorTroll 21 Nov 22, 2022
A chip-8 emulator in Rust, using raylib for graphics.

A chip-8 emulator in Rust, using raylib for graphics.

André Nogueira 2 Apr 16, 2022
A no-frills Tetris implementation written in Rust with the Piston game engine, and Rodio for music.

rustris A no-frills Tetris implementation written in Rust with the Piston game engine, and Rodio for music. (C) 2020 Ben Cantrick. This code is distri

Ben Cantrick 17 Aug 18, 2022
A tool to generate inbetweens for animated sprites, written in godot-rust

Bitmapflow is a tool to help you generate inbetweens for animated sprites. In other words, it makes your animations smoother. It uses optical flow to

null 411 Dec 21, 2022
Text Renderer written in Rust using HarfBuzz for shaping, FreeType for rasterization and OpenGL for rendering.

Provok Text Renderer written in Rust using HarfBuzz for shaping, FreeType for rasterization and OpenGL for rendering. Input Provok is fed with a JSON

Ossama Hjaji 67 Dec 10, 2022
Rustcraft is a simple Minecraft engine written in rust using wgpu.

Rustcraft is a simple Minecraft engine written in rust using wgpu.

Raphael Van Hoffelen 110 Dec 22, 2022
rpg-cli is a bare-bones JRPG-inspired terminal game written in Rust

rpg-cli is a bare-bones JRPG-inspired terminal game written in Rust. It can work as an alternative to cd where you randomly encounter enemies as you change directories.

Facundo Olano 660 May 27, 2021
Walleye is a chess engine written completely in rust.

Walleye is a UCI-compatible engine written using the classical alpha-beta style AI. It supports loading board positions from arbitrary FEN strings, Unicode pretty printing to the console, and UCI communication logs to help with debugging.

Mitchel Paulin 95 Dec 24, 2022
A interactive and fun to use memory game written in Rust

memg - Memory Game memg is a interactive and fun to use memory game written in rust Installation Make sure you have rust installed. Use this official

null 4 Sep 9, 2021
A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.

A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.

rg3d engine 5.4k Jan 4, 2023
Dwarf Fortress inspired frontend to Veloren, the multiplayer RPG voxel game written in Rust

velobracket ('veloren' + 'bracket-lib') velobracket is Dwarf Fortress inspired frontend to Veloren, the multiplayer RPG voxel game written in Rust. Us

Rodion Martynov 13 Dec 25, 2022
Game of life implementation written in Rust.

Game of life Game of life implementation written in Rust. Part of my journey in learning Rust. Pattern files The patterns are based on the example pat

Hashem Hashem 2 Nov 17, 2022
Creative Coding Framework based on Entity Component System (ECS) written in Rust

creativity creativity is Creative Coding Framework based on Entity Component System (ECS) written in Rust. Key Features TBA Quick Start TBA How To Con

Chris Ohk 9 Nov 6, 2021
Small game where you play a big spider chasing small spiders, written in Rust and Macroquad.

Ludum Dare #49 Compo entry - Procedural Spider Small game where you play a big spider chasing small spiders. Each spider you catch makes you bigger! C

Jakub Arnold 16 Sep 5, 2022
Ray Tracer written in Rust

Erena A Ray Tracer written in Rust. Erena is based on the Esena project, which is written in Scala. Here is the current rendered image: See The Ray Tr

Melvic Ybanez 11 Dec 7, 2021
Downdelving is an experimental roguelike written in Rust.

Downdelving Downdelving is an experimental roguelike written in Rust. It's built upon the base supplied by Bracket's Rust Roguelike Tutorial. It's a r

Nathan Douglas 1 Nov 6, 2021
Conway's game of life written in Rust.

This is my implementation of Conway's game of life to get my hands dirty with Rust. Rules of the game: Any live cell with two or three live neighbors

null 0 Apr 9, 2022
Blackmarlin is a chess engine fully written in Rust.

Blackmarlin WIP UCI Chess Engine Blackmarlin is a chess engine fully written in Rust. Make sure to compile the chess engine with cargo build --release

null 50 Oct 31, 2022