Mesen - NES Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: Mesen - NES Emulator

Post by lidnariq »

We've recently seen the release of a bunch of brand new emulators (Any-Yes, Mesen, Nintaco), all of which were (I believe?) developed against our modern set of tests, so should be pretty accurate.
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Mesen - NES Emulator

Post by rainwarrior »

BaconIsGood16 wrote:why is it not mentioned on TASVideos's NES Accuracy Test Chart?
Because that chart is years out of date and Mesen is a relatively new emulator.
niconii
Posts: 219
Joined: Sun Mar 27, 2016 7:56 pm

Re: Mesen - NES Emulator

Post by niconii »

The debugger in Mesen is very well done, but there are some features it doesn't seem to have that would be helpful for me.

When the debugger is open, Pause is disabled in the main emulator window. This makes things difficult if I want to break while something is happening on-screen, as I have to quickly switch to the debugger window, open the Debug menu, and choose Break. It would be nice if Pause caused the debugger to break instead when it's open. It'd also be nice to have an option to break whenever the debugger window becomes active.

Controller buttons can't be set to a certain state in the debugger, so there seems to be no way to, for example, keep the A button held while debugging. Something like checkboxes representing each button would work, at least for normal controllers.

Values in the Watch pane are only updated while breaking. It'd be nice to have it update every frame while the game is running too, or have an option for that.

It'd be nice if blocks in the debugger could be explicitly marked as data bytes or words, and show up as .db or .dw lines in the debugger even when "Show Only Disassembled Code" is checked.

Related to that, though this is a bit niche in comparison: the FDS BIOS has several functions that take pointer arguments inline after the jsr. Though you have the labels already, it'd be nice if it could actually show up as jsr LoadFiles / .dw $1234, $5678 and so on automatically.
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: Mesen - NES Emulator

Post by lidnariq »

Nicole wrote:Related to that, though this is a bit niche in comparison: the FDS BIOS has several functions that take pointer arguments inline after the jsr. Though you have the labels already, it'd be nice if it could actually show up as jsr LoadFiles / .dw $1234, $5678 and so on automatically.
There are a bunch of places throughout NES-land that do function parameters that way. nescom's clever-disasm calls it a TrailerParamRoutine.
Sour
Posts: 890
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

Thanks for the feedback!

Breaking when trying to pause would make a lot of sense - I'll add that. Breaking on debugger focus too (as an option).

Being able to set the controller's input is something someone else has asked for, too. It's mostly a matter of coming up with a proper UI and finding space to fit it in, too - I can't really add too much to the main debugger window if I want to keep it usable on lower resolution laptops. It would probably need to be some sort of separate tool window.
Also, if you turn on the "Allow input when in the background" option, you can use a gamepad to hold down keys while in the debugger (won't work with a keyboard). It's far from ideal, but it's a workaround for that limitation atm.

An option to automatically update the watch should be fairly easy - initially I hadn't done that for performance concerns, but a lot has been done to speed up the expression evaluator since then, so it should be fine to update it once a frame or so (assuming there aren't hundreds of watch expressions)

Forcing specific blocks to show as bytes or words might be a bit tricky since there are already so many other options to control what is shown or not. Maybe the best way would be a general option to "Always show verified data" that would work with the other disassembly options + 3 actions: "Mark as data (bytes)", "Mark as data (words)" and "Clear data flag"? Would that be flexible enough for what you need to do?

As for arguments after JSR, I guess I could add some options to labels that would allow you to configure those (e.g name & size of each parameter)?
uVSthem
Posts: 40
Joined: Thu Feb 26, 2015 2:37 am

Re: Mesen - NES Emulator

Post by uVSthem »

Is there a way to turn off the Recent Game Selection feature?
Sour
Posts: 890
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

uVSthem wrote:Is there a way to turn off the Recent Game Selection feature?
No, there isn't. Is there any reason you would need to turn this off?
uVSthem
Posts: 40
Joined: Thu Feb 26, 2015 2:37 am

Re: Mesen - NES Emulator

Post by uVSthem »

It's a feature I never use. I'm not a save state kind of guy. I would rather turn it off and save a few writes to my drive.
Sour
Posts: 890
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

uVSthem wrote:It's a feature I never use. I'm not a save state kind of guy. I would rather turn it off and save a few writes to my drive.
I doubt it'll have much of an impact on even an SSD's longevity (an hour of internet browsing most likely writes more cache data on a disk than Mesen would if you used it daily for a year), but I added an option to disable the screen (and turn off the disk reads/writes associated with it) along with another option to reset the game instead of resuming where you left off when clicking on a game (which is something other people have requested).
uVSthem
Posts: 40
Joined: Thu Feb 26, 2015 2:37 am

Re: Mesen - NES Emulator

Post by uVSthem »

Thank you.
Sour wrote:
uVSthem wrote:It's a feature I never use. I'm not a save state kind of guy. I would rather turn it off and save a few writes to my drive.
I doubt it'll have much of an impact on even an SSD's longevity (an hour of internet browsing most likely writes more cache data on a disk than Mesen would if you used it daily for a year), but I added an option to disable the screen (and turn off the disk reads/writes associated with it) along with another option to reset the game instead of resuming where you left off when clicking on a game (which is something other people have requested).
Sour
Posts: 890
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

I just released 0.9.1.

0.9.1 contains a number of improvements and new features related to HD Packs (including a tool to dump graphics into PNG files, new additions to the HDNes format that support conditional tile replacements, etc.)

On the debugger side of things (which might be what's most interesting to people here), some new features:
-A "Step Back" action that allows you to step backwards into the execution and rewind time, 1 CPU instruction at a time. (thanks to thefox for the idea!)

-The ability to setup controller input from the debugger's main window:
DebuggerInput.png
DebuggerInput.png (8.46 KiB) Viewed 4832 times
You just need to click the buttons on the controller's image to activate/deactivate buttons. If any button is turned on via the debugger, the emulator will ignore all regular input for that player.

-Filtering in the trace logger via conditions - which means you can use the conditional expressions the debugger supports for breakpoints/etc to filter the trace log's output. e.g, if you wanted to log any writes for $8000-$FFFF, you could type in "IsWrite && Address >= $8000" to get only those:
TraceLogger.png
I also realized the Trace Logger's UI had terrible performance on Linux under Mono (at least on my VM), so I scrapped the standard textbox I was using for it and replaced it with the custom control I use for the code window. It should be at least an order of magnitude faster than before, and now supports auto-refresh (at 300ms intervals) with 30k instructions shown in the list (which was impossible even on Windows before).

On top of those, I implemented a few of the options that were asked by Nicole some posts above (e.g option to refresh the watch window while the game is running, option to break the debugger on focus, and allow breaking the debugger by using the Pause shortcut from the main window)

It also includes a number of bug fixes for the debugger in general and the emulation should run faster than before with the debugger attached (10-15% improvement).

If you find any issues or have any suggestions (for the debugger or otherwise), let me know!
Pokun
Posts: 2675
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - NES Emulator

Post by Pokun »

There's one fundamental thing I still can't find anywhere in Mesen. Controller II microphone input used in Raid on Bungeling Bay, Japanese Zelda, Paluthena etc.

List of known games that uses or requires the mic

If possible I'd request to make it possible to assign the mic to its own separate input, not like in FCEUX where it replaces the controller II START button when enabled. Makes it hard to test both inputs at the same time in my game.

Or is it already supported and I'm just blind?
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Mesen - NES Emulator

Post by tepples »

No authentic console has both the microphone and player 2 Start. The RF, Twin, Titler, and TV models have player 4 Start (bit 1 of fourth read of $4017), but you can map that separately in (for example) FCEUX for Windows by enabling the Famicom 4-player adapter. The AV Famicom lacks a mic.

Or are you referring to famiclones that have both a mic jack and detachable controllers, such as the Analogue Nt mini?
Pokun
Posts: 2675
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - NES Emulator

Post by Pokun »

I know there's no official Famicom or NES that have both, but for an emulator I see no reason to not have it all. It's convenient for developing purposes, allows testing setups that's not as easy to do on real hardware and I really see no problems with it. Nestopia has it.

Of course it's bad design for compatibility reasons to make a game that requires the use of either the mic or the controller II START/SELECT buttons, and I don't intend to do that.


Not sure what you mean by having 4-player adapter though? I do have that enabled in FCEUX and I still can't use the mic and con II Start at the same time.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Mesen - NES Emulator

Post by tepples »

Map a key to player 4 Start instead of player 2 Start, and use a controller reading routine that effectively ORs together the bits from controllers 1 and 3 and from controllers 2 and 4. That way, your game logic sees both the mic and player 2 Start.
Post Reply