MahNES Library Released - Emulator using SDL_Audio now

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

HLorenzi
Posts: 23
Joined: Thu Jun 28, 2012 9:10 pm
Location: São Paulo, Brazil

Re: MahNES Library Released

Post by HLorenzi »

blargg wrote:A permissive license encourages voluntary collaboration among developers who use it. The others rely on forced collaboration and have involved terms which must be followed, which turns away some developers who prefer voluntary collaboration and simplicity. Neither will cause collaboration where there's lack of interest or potential; the best way to get people helping is to form a group of people who want to work on the software. The idea is to focus on making the software valuable, rather than on worrying about how others put it to use.
So you're saying it's "best" to use the strong copyleft, as noted above? The GNU Lesser just says proprietary software should distribute the library, if they change it. I didn't really understand your point, sorry. :)
User avatar
blargg
Posts: 3715
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Re: MahNES Library Released

Post by blargg »

I guess my point was to figure out why you wouldn't use a liberal license like the BSD family, and whether the costs of a more restrictive one are worth the benefits. If you haven't dealt with licensing before, then there's not a lot you can do besides do your best to choose one and then gain experience with how it is.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: MahNES Library Released

Post by Dwedit »

Can you build a x86 compatible version of the emulator? I'd like to test it out.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
HLorenzi
Posts: 23
Joined: Thu Jun 28, 2012 9:10 pm
Location: São Paulo, Brazil

Re: MahNES Library Released

Post by HLorenzi »

Dwedit wrote:Can you build a x86 compatible version of the emulator? I'd like to test it out.
I think the problem is just the DLL -- I'll try to find the 32-bit version. That OpenAL website is... really messy.

I could not verify what version the DLLs I found are, so I can only ask you to download the official installer, and hope that it detects 32-bit systems. http://connect.creativelabs.com/openal/ ... alinst.zip

I am also recompiling the source explicity as 32-bit (or, at least, I think it will), just to be sure. But it's a bit unstable now, freezes randomly when going to the gallery. But that's a problem with the program, not the emulation.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: MahNES Library Released

Post by Dwedit »

I already tried a different OpenAL32.dll, it was a slightly different version number, and the emulator crashed.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
HLorenzi
Posts: 23
Joined: Thu Jun 28, 2012 9:10 pm
Location: São Paulo, Brazil

Re: MahNES Library Released

Post by HLorenzi »

Dwedit wrote:I already tried a different OpenAL32.dll, it was a slightly different version number, and the emulator crashed.
OK, now I've been able to get rid of that OpenAL thing, and switched to SDL, which was even easier to set up (but I'm still getting used to it, so there may be sound crackling or whatever). I've also corrected the freezing bug in the emulator. Would you be so kind as to download it again? :)
blargg wrote:I guess my point was to figure out why you wouldn't use a liberal license like the BSD family, and whether the costs of a more restrictive one are worth the benefits. If you haven't dealt with licensing before, then there's not a lot you can do besides do your best to choose one and then gain experience with how it is.
So far I've changed it to a BSD license. I just want it to be as free as possible.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: MahNES Library Released - Emulator using SDL_Audio now

Post by Dwedit »

MahNES is crashing because you're calling fclose on a null pointer.
This happens if there is no existing file named "MahNES Settings.txt"
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
HLorenzi
Posts: 23
Joined: Thu Jun 28, 2012 9:10 pm
Location: São Paulo, Brazil

Re: MahNES Library Released - Emulator using SDL_Audio now

Post by HLorenzi »

Dwedit wrote:MahNES is crashing because you're calling fclose on a null pointer.
This happens if there is no existing file named "MahNES Settings.txt"
You know, I just love it when something works on my computer for who-knows-what reason, and when someone tries to run it, I look like a noob. I'm really sorry about this, fclose() was mistakenly just after I closed brackets... Hopefully there are no other errors now.

Also, that was spot-on. How did you find out...?
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: MahNES Library Released - Emulator using SDL_Audio now

Post by Dwedit »

Ollydbg is a powerful tool.
It reported the "access violation - read from address 000000C" from inside MSVCRT.DLL, and let me look down the stack to see the code that called the function. The code pointer sitting on the stack was 0040EFD5.
I saw that it was a call to fclose, so I set a breakpoint there, and restarted the program.
Then I saw it was trying to call fclose with a null pointer.
Then I looked at the debug window, and everything you need to know is right there:
ollydbg.png
ollydbg.png (10.99 KiB) Viewed 5653 times
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
blargg
Posts: 3715
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Re: MahNES Library Released - Emulator using SDL_Audio now

Post by blargg »

Since your code is portable, it should be easy to run with valgrind. That'll point right to the line of code where you do things like fclose(NULL).
Post Reply