A Gameboy Emulator in Rust

Related tags

Emulators rboy
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
Cycle-accurate Gameboy Color emulator in Rust

Description Currently intended only for personal research, this is a WIP cycle-accurate GB/C emulator written in Rust. Building If you wish to build f

Luke Stadem 3 May 5, 2022
GameBoy emulator.

yobemag GameBoy emulator. WIP for now :) General knowledge ROM This is the read-only memory, it's also called "cartridge" and holds the data of the ga

Federico Guerinoni 4 Aug 31, 2022
Gameboy Advance emulator.

Clementine - A collaborative approach to GBA emulation Welcome to the first ripsters' project. Our goal is to understand how GameBoy Advance works and

RIPsters 32 Dec 14, 2022
Nes-emulator - A NES emulator made to learn the Rust programming language

nes-emulator Building $ rustc --version rustc 1.32.0 (9fda7c223 2019-01-16) $ cargo --version cargo 1.32.0 (8610973aa 2019-01-02) $ cargo build --rel

Michael Burge 225 Dec 23, 2022
NES emulator written in Rust to learn Rust

OxideNES A NES emulator in Rust. CPU should be accurate, PPU is mostly accurate, timing between the 2 is off for some corner cases and hardware qui

null 37 Nov 7, 2022
Chip8 emulator written in pure rust, using rust-sdl2 for graphics

Rust-8 chip8 emulator written in rust, using rust-sdl2 for graphics. Features Fully implemented all 35 original chip8 opcodes. This emulator does NOT

Chris Hinson 7 Dec 28, 2022
Commodore 64 emulator written in Rust

Rust64 - a C64 emulator written in Rust This is my attempt to study the Rust programming language and have fun at the same time. The goal is to presen

Krzysztof Kondrak 214 Dec 27, 2022
A Flash Player emulator written in Rust

website | demo | nightly builds | wiki Ruffle Ruffle is an Adobe Flash Player emulator written in the Rust programming language. Ruffle targets both t

Ruffle 11.2k Jan 8, 2023
A Game Boy research project and emulator written in Rust

Mooneye GB Mooneye GB is a Game Boy research project and emulator written in Rust. The main goals of this project are accuracy and documentation. Some

Joonas Javanainen 802 Dec 28, 2022
RGB (Rust Game Boy) is a simple emulator for the original game boy

RGB RGB (Rust Game Boy) is a simple emulator for the original game boy and the color game boy. Warning: This no longer compiles in the latest versions

Niven Achenjang 18 Dec 2, 2022
RustBoyAdvance-NG is a Nintendo™ Game Boy Advance emulator and debugger, written in the rust programming language.

RustBoyAdvance-NG Nintendo GameBoy Advance ™ emulator and debugger, written in rust. WebAssembly Demo: https://michelhe.github.io/rustboyadvance-ng/ P

MishMish 510 Dec 30, 2022
An NES emulator written in Rust

Pinky Pinky is an NES emulator written in Rust completely from scratch based only on publicly available documentation. You can run it in your Web brow

Koute 709 Dec 23, 2022
NES emulator written in Rust

sprocketnes is an emulator for the Nintendo Entertainment System written in the Rust programming language. Its purpose is to serve as a technology dem

Patrick Walton 725 Dec 27, 2022
NES emulator in rust

NES emulator in Rust plastic is a NES emulator built from scratch using Rust. This is a personal project for fun and to experience emulating hardware

Amjad Alsharafi 27 Dec 15, 2022
ZX Spectrum emulator written in Rust

rustzx ZX Spectrum emulator which I writing in rust. I develop this project just for fun and for learning the basics of computer architecture. License

Vladislav Nikonov 162 Dec 27, 2022
Intel 8080 cpu emulator by Rust

i8080 i8080 is a emulator for Intel 8080 cpu. 8080 Programmers Manual 8080 opcodes [dependencies] i8080 = { git = "https://github.com/mohanson/i8080"

Mohanson 83 Dec 27, 2022
CHIP-8 emulator written in Rust

CHIP-8 emulator written in Rust. This is intended to be a project for gaining experience writing emulators and practice Rust.

Pedro Rodrigues 4 May 21, 2021
A CHIP-8 emulator for Rust in ~350 LOC

chip8 An implementation of the CHIP-8 for Rust in ~350 lines of code. What is CHIP-8? CHIP-8 is a virtual machine (along with a supporting programming

Daniel Gatis 8 Apr 23, 2022
Rudroid - Writing the World's worst Android Emulator in Rust 🦀

Rudroid - Writing the World's worst Android Emulator in Rust ?? Introduction Rudroid - this might arguably be one of the worst Android emulators possi

Chaithu 102 Dec 23, 2022