Code Monkey home page Code Monkey logo

Comments (11)

xTibor avatar xTibor commented on June 6, 2024

I did a valgrind run, doesn't reveal more than the gdb backtrace. Valgrind also shows that the yaml crate used by the emulator is unsound, but that's out of the scope of this issue.

from rustboyadvance-ng.

xTibor avatar xTibor commented on June 6, 2024

It's crashing on trying to read BIOS address 00950209.

from rustboyadvance-ng.

michelhe avatar michelhe commented on June 6, 2024

Could be open-bus related ?

from rustboyadvance-ng.

xTibor avatar xTibor commented on June 6, 2024

I tested it, open-bus seems to solve this one too with that new if addr > 0x3fff check.

from rustboyadvance-ng.

michelhe avatar michelhe commented on June 6, 2024

So I guess that it will be solved after #109 is merged

from rustboyadvance-ng.

xTibor avatar xTibor commented on June 6, 2024

Looks like there are still segfaults in other places after open-bus (crashing 16-bit writes to iodev). I think I'll investigate them later in an another issue.

from rustboyadvance-ng.

michelhe avatar michelhe commented on June 6, 2024

For starters, we could replace all get_unchecked to get sensible panics instead of segfaults.
(I only put these to avoid size checks at runtime)

from rustboyadvance-ng.

xTibor avatar xTibor commented on June 6, 2024

Or change them conditionally with #[cfg(debug_assertions)] so release builds doesn't get a performance hit.

from rustboyadvance-ng.

xTibor avatar xTibor commented on June 6, 2024

Well I found out why I was getting segfaults on the open-bus branch. I was an idiot and forgot to call gba.init(); in my test bench. Everything works flawlessly when things are initialized. The constructor of GameBoyAdvance could benefit from some more defensive approach to initialization to avoid mistakes like that (builder pattern or calling .init() in ::new(), etc.).

from rustboyadvance-ng.

michelhe avatar michelhe commented on June 6, 2024

Oh yeah, that's what I meant that the branch isn't polished. the .init() thing is a dirty hack I'll get around when I merge this.

Since moving to pointer territory I get reminded why I hate modern compilers.

Calling Gba::init (which basically passes its pointer to SysBus) inside Gba::new isn't working (at least in windows), since the compiler moves the Gba allocation after returning from Gba::new, so the pointer is made stale.

Is there a way to pass weak references to owned structs in rust that doesn't involve completely redesigning the project?

from rustboyadvance-ng.

michelhe avatar michelhe commented on June 6, 2024

fixed in c8d5094

from rustboyadvance-ng.

Related Issues (20)

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.