GithubHelp home page GithubHelp logo

rboy's Issues

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 ๐Ÿ˜‰

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

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. :)

Allow Device to load rom data

Allow Device to load by buffer instead of by rom path.

let data = fs::read(rom_name).unwrap(); //this will come from an external source
let a = Device::new_cgb_from_buffer(data,true);

I'd also like to extract the save data via Device.

I'm using rboy as a library and I want to have more control over where files save, etc.

Allow Device to attach Serial/Link Cable

I'd like to be able to connect Serial/Link Cables.

I'm imagining something like syncing this similarly to how the audio system works (you impl SerialConnection for LinkCable {?)

I can imagine if you don't have both of the Device's do_cycle's in sync this can cause some problems, since there doesn't seem to be a "buffer" system in the system.

At minimum, I'd like to make the printer output data buffers instead of to files. Device->Device connections might be too hard to be worth the time.

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!

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.