-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build with latest nightly (mostly) #14
Conversation
Since sprocketnes is a binary and not a library it makes sense to ship with Cargo.lock
I just found out that @nukep did the same thing back in november... I integrated his commit for the audio workaround, unfortunately I encounter a new error that doesn't make any sense to me or anybody on IRC:
Need help. |
Well, that's bizarre. callback: Some(nes_audio_callback
as extern "C" fn
(userdata: *const c_void,
stream: *const uint8_t,
len: c_int)), There's no way that this is the way it's supposed to be done, though. It has to either be a regression in rustc, or there's simply a better way without casting. With all that said, direct use of |
Agreed but I wonder if an issue should be opened on the rust bugtracker? That looks fishy to me. |
Ah, this seems to be the reason: rust-lang/rust#19891 Explicit casting to a fn pointer seems to be the only option right now, until there's a (possible) fix. :( |
Thanks for taking the time to look that up! I fixed it in the latest commit. The only thing that remains is this weird warning:
It's weird because while the color is not used to discriminate between the matches but just to bind it to a local variable. On the other hand the match is pretty complex so maybe I'm missing something. |
Also, the games are still super slow, is there a regression? |
I wanted to steal some code for my gameboy emulator but I realized that this code hadn't been updated in a while so I decided to give it a try.
Most of the breakage was due to changes in rust syntax (nampespaced enums, no automatic Copy etc...) however the audio interface to SDL2 seems to have changed quite a lot which means that the current code is completely broken.
In particular rust won't let me declare a static
AudioDevice
anymore because it implements Drop. I'm not sure how to fix that particular issue without rewriting a big chunk of code so I left it commented for now. If you have any clue what to do I can look into it some more.But besides that it builds correctly with only one warning left that I can't quite figure out (it looks bogus to me but I might be missing something).
When I tried to run it with mario bros the game seemed very slow even though it wouldn't take all of my CPU, maybe there's a timing issue, I'm not sure (and since I never ran this emulator before I'm not sure how it's supposed to look like).
So, it's not finished but hopefully it'll be useful.