Mesen - NES Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Jiggers
Posts: 4
Joined: Mon Mar 19, 2018 12:44 pm

Re: Mesen - NES Emulator

Post by Jiggers » Wed Mar 21, 2018 8:08 pm

Sour wrote:Here's another build with a few tweaks: download

Changes:
-Added an option to ignore the hash checks when loading a save state (Preferences->Save Data). This will only work with states that were saved with this build (because I kept a restriction that the save state must be for a game with the same mapper ID, which should be fine for homebrew, and prevent potential crashes)
Hooray! Thank you!

I wonder now... So my game project is actually a Final Fantasy 1 hack, upgraded to use the MMC5 mapper. Why does this emulator save/load SRAM saves, and FCEUX doesn't?

http://www.romhacking.net/forum/index.p ... #msg343988 - this is the post with the main mapper changes that would have affected how the saving works. There's a link to the project files in my second to last post in the thread. I'm not asking for help or anything, just supplying information about the changes made, if it helps answer the question of why Mesen works so much better...!

mkwong98
Posts: 221
Joined: Mon May 30, 2011 9:01 pm

Re: Mesen - NES Emulator

Post by mkwong98 » Wed Mar 21, 2018 8:32 pm

Sour wrote:Mesen already has a global option for this: Emulation -> Advanced -> "Automatically re-enable sprite limit as needed to prevent graphical glitches when possible".

It will re-enable the sprite limit on a per-scanline basis based on certain heuristics - it works with the majority of games that abuse the sprite limit to hide sprites.
Nice! :D

Sour
Posts: 739
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour » Thu Mar 22, 2018 6:29 pm

Jiggers wrote:Why does this emulator save/load SRAM saves, and FCEUX doesn't?
Are you bankswitching the save ram or only using 8kb of it? FCEUX might be defaulting to 8kb of sram for MMC5 (haven't checked), which could explain your problem. Mesen emulates 64kb sram for all MMC5 games (since that's what the wiki recommended).

User avatar
rainwarrior
Posts: 7667
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Mesen - NES Emulator

Post by rainwarrior » Thu Mar 22, 2018 6:55 pm

Sour wrote:Mesen emulates 64kb sram for all MMC5 games (since that's what the wiki recommended).
I think that 64k suggestion is maybe aimed toward a more limited emulation environment (e.g. flash cart?). It's just saying that for basic compatibility you could treat it as 64k always.

No games actually had 64k (though fingers crossed for NES SimCity), the reason for using the 64k superset is just because different banking bits were used on the 16k game boards than 32k boards.

If you want accurate emulation instead of mere compatibility you probably want to emulate the wiring and mirroring actual carts hard.

Jiggers
Posts: 4
Joined: Mon Mar 19, 2018 12:44 pm

Re: Mesen - NES Emulator

Post by Jiggers » Fri Mar 23, 2018 12:25 pm

Sour wrote:
Jiggers wrote:Why does this emulator save/load SRAM saves, and FCEUX doesn't?
Are you bankswitching the save ram or only using 8kb of it? FCEUX might be defaulting to 8kb of sram for MMC5 (haven't checked), which could explain your problem. Mesen emulates 64kb sram for all MMC5 games (since that's what the wiki recommended).
I figured it out! Disch suggested writing $04 to register $5113. That was making the save data appear in the 8000 range in the save file Mesen produced. FCEUX's save file ends before getting there. Solved it by writing $00 to the register instead! Now all the save data goes to the top of the file.

I noticed that Mesen is no longer disabling the menu when I load a game now, though. Before, I'd load up, and just start pressing keyboard buttons to do stuff in the game; now when I use the arrow keys, I start scrolling through the menu... while still playing the game. So I have to click on the game section of the window to stop that.

Sour
Posts: 739
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour » Fri Mar 23, 2018 3:16 pm

rainwarrior wrote:If you want accurate emulation instead of mere compatibility you probably want to emulate the wiring and mirroring actual carts hard.
The NES 2.0 spec doesn't have any way of specifying the wiring, though, I think. I could hardcode the mirroring for 8kb/16kb/32kb/64kb and emulate the proper sizes based on the game DB or NES 2.0 headers, but I'd still have to fallback to emulating 64kb for everything else (or risk breaking rom hacks, etc.)
Jiggers wrote:I noticed that Mesen is no longer disabling the menu when I load a game now, though.
Thanks, not quite sure what could have caused this - I'll take a look.

Sour
Posts: 739
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour » Sun Mar 25, 2018 7:23 pm

Jiggers wrote:I noticed that Mesen is no longer disabling the menu when I load a game now, though.
This should be fixed in this build: download

Sour
Posts: 739
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour » Sat Mar 31, 2018 1:39 pm

Just released 0.9.5, which contains a ton of debugger improvements/fixes (thanks for all the feedback/testing!).
It also adds new features to HD Packs and improves their performance in some scenarios.
Beyond that, there's been a few bug fixes and some new options, but nothing too major.

The documentation can also be downloaded for offline use starting with this version (download link)

User avatar
tokumaru
Posts: 11465
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Mesen - NES Emulator

Post by tokumaru » Thu Apr 05, 2018 10:21 pm

Just noticed that the new version is out. Thanks for all the cool stuff you added recently!

User avatar
gauauu
Posts: 646
Joined: Sat Jan 09, 2016 9:21 pm
Location: Central Illinois, USA
Contact:

Re: Mesen - NES Emulator

Post by gauauu » Fri Apr 06, 2018 5:42 am

I need to do some more experimenting before I file a bug on GitHub, but I can't seem to use F9 to set a breakpoint anymore on Linux. I have to use the menu instead.

(But like Tokumaru said, we're thankful for your hard work that provides such a great tool for the community!)

Sour
Posts: 739
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour » Fri Apr 06, 2018 6:05 am

Does the context menu properly list the toggle breakpoint item as having the F9 shortcut? If not, the key bindings might be wrong for some reason (you can customize them in Options->Configure shortcut keys). If it says F9 though and doesn't work, do other shortcuts work? What if you remap it to something other than F9?

Also, you can click on the left-most part of the margin to toggle a breakpoint for that line (probably a bit faster than using the menu)
tokumaru wrote:Just noticed that the new version is out. Thanks for all the cool stuff you added recently!
You're welcome!

User avatar
gauauu
Posts: 646
Joined: Sat Jan 09, 2016 9:21 pm
Location: Central Illinois, USA
Contact:

Re: Mesen - NES Emulator

Post by gauauu » Fri Apr 06, 2018 7:10 am

Sour wrote:Does the context menu properly list the toggle breakpoint item as having the F9 shortcut? If not, the key bindings might be wrong for some reason (you can customize them in Options->Configure shortcut keys). If it says F9 though and doesn't work, do other shortcuts work? What if you remap it to something other than F9?
It listed F9, but F9 didn't work. (it did in the previous version though, so I don't think it's an issue of my window manager stealing the key). I changed to it something else and it worked fine. So it's definitely not a show-stopper for me, I'll leave it up to you whether it's worth investigating further :-)
Also, you can click on the left-most part of the margin to toggle a breakpoint for that line (probably a bit faster than using the menu)
Oh, huh. I guess I had been clicking the wrong spot, because I didn't think that worked. But it does. Yeah, that's faster.


Also, one other thing ... is there an option to disable the little tooltip popups that appear when I mouse over an instruction/opcode? Once one appears, my mouse wheel scrolling stops working until I click back in the code window, which make it painful to scroll around. I realize that's probably a weird fluke of mono's UI stuff, but if there's just a way to turn off those popups (I couldn't find an option in the menu to do it), I could work around it.

Either way, again, thanks!

Sour
Posts: 739
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour » Fri Apr 06, 2018 7:23 am

gauauu wrote:Also, one other thing ... is there an option to disable the little tooltip popups that appear when I mouse over an instruction/opcode?
You should be able to disable this in Options->Show->Show OP Code Info Tooltips. I tend to add options to disable any new feature that is potentially annoying, since some people might like the old behavior better :p

I'll try to reproduce the F9 issue in my Ubuntu VM, if I get the same problem it should be fairly straightforward to fix.

User avatar
gauauu
Posts: 646
Joined: Sat Jan 09, 2016 9:21 pm
Location: Central Illinois, USA
Contact:

Re: Mesen - NES Emulator

Post by gauauu » Fri Apr 06, 2018 8:01 am

Sour wrote:
gauauu wrote:Also, one other thing ... is there an option to disable the little tooltip popups that appear when I mouse over an instruction/opcode?
You should be able to disable this in Options->Show->Show OP Code Info Tooltips. I tend to add options to disable any new feature that is potentially annoying, since some people might like the old behavior better :p
Ah, that works for removing the opcode popup, but is there another option that prevents the popup for labels?

Sour
Posts: 739
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour » Fri Apr 06, 2018 11:49 am

There's no option for it - but maybe it would make more sense to add an option to make it require a certain key to be held down + mouse over to see the popup? e.g hold down shift + mouse over to see the popup, instead of just mouse over. Otherwise you would have to toggle that setting each time you do want to check the popup.


Also, completely unrelated, but kya just released a HD Pack for Castlevania 1 that uses 2x normal resolution and replaces the sound track with ogg files. It looks and sounds pretty neat - although some people might argue it doesn't feel like a NES game at this point.
Link: https://www.romhacking.net/forum/index.php?topic=26114

Post Reply