Mesen - NES Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

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

Re: Mesen - NES Emulator

Post by tokumaru » Sat Sep 09, 2017 5:40 am

B00daW wrote:- I'll check now, but there have been some instances of mesen/debugger crashes with editing RAM in the memory viewer.
I had it crash on me several times when trying to use cheats. Apparently enabling any cheat crashes the emulator for me.

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

Re: Mesen - NES Emulator

Post by Sour » Sat Sep 09, 2017 6:01 am

B00daW wrote:- Holding joystick/controller inputs seems to affect keyboard inputs, like holding shift-f* to make a savestate.
- I'll check now, but there have been some instances of mesen/debugger crashes with editing RAM in the memory viewer. i'll report after more extensive usage in 0.9.3.

- Something that seems a bit out of the ordinary is that watch locations do not update in the debugger in real time like other emulators. Watch is nice for seeing addresses in realtime, grouped in a manner the user wishes, without having to scroll up and down through the memory viewer. I know there is logging too, but realtime is good for active gameplay/analysis.
I thought I had mostly taken care of regressions between the new shortcut system and the old one, but there are some cases where it requires you to hit exactly the shortcut and nothing else, if there are potential conflicts with other shortcuts (this logic might not be perfect atm)

The watch has any option to auto-refresh while running Options->Refresh watch while running - or is that option not doing what you are expecting?

Let me know if you find a way to reproduce any crashes, happy to fix them.
tokumaru wrote:I had it crash on me several times when trying to use cheats.
Are you talking about 0.9.2 or 0.9.3? 0.9.2 had a bug where opening the cheats window caused crashes pretty often. This is fixed in 0.9.3 - I just tried using cheats again to make sure, and it seems to be working normally on my end

tepples
Posts: 21841
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Mesen - NES Emulator

Post by tepples » Sat Sep 09, 2017 7:14 am

Here's how I'd handle input containing overlapping shortcuts:

There are two kinds of keys: modifier keys and letter keys. Modifier keys are Ctrl, Alt/Option, Shift, Super/⊞/⌘, and joystick buttons. Letter keys are all other keyboard keys, the mouse buttons, and directions on the mouse wheel. In a shortcut, the user would be expected to press modifier keys before the last letter key, such as Ctrl+S not S+Ctrl, or Shift+click not click+Shift.

Shortcut evaluation would follow these steps:
  1. If a shortcut contains a letter key, and the most recently pressed key is a modifier key, do not activate the shortcut's action.
  2. If all keys for a shortcut are pressed, and the shortcut contains a letter key, and there is no shortcut that consists of the currently held keys plus additional letter keys, activate the shortcut's action on key-down.
  3. If all keys for a shortcut are pressed, there is no shortcut that consists of the currently held keys plus additional keys, activate the shortcut's action on key-down.
  4. Otherwise, save the shortcut's action and activate it on key-up if there are no intervening key-downs.
For example, if someone defines Ctrl+R and Ctrl+Shift+R:
  1. Ctrl down: Ctrl is modifier key; no shortcuts match
  2. Ctrl and R down: R is letter key; Matches subset of Ctrl+R and Ctrl+Shift+R; matches all of Ctrl+R; Ctrl+R activated
If anyone else can think of a set of shortcut bindings that might conflict, I'll run them through this logic.

User avatar
B00daW
Posts: 584
Joined: Thu Jan 03, 2008 1:48 pm

Re: Mesen - NES Emulator

Post by B00daW » Sun Sep 10, 2017 10:21 am

Sour: Oh yeah I see the refreshing Watch list now. Great! However, if you have refresh watch list checked, you cannot remove a Watch by right-clicking while it's updating. It's greyed out and will not let you.

Also, is there a way to give an address in Watch a nickname? For example: [$17E] "Spawn Checkpoint" ?

Tried using a "Label" in the debugger. UI is a bit weird with it... Can only right-click and label something highlighted at times. Also after giving a label to something you can no longer search for the original address name; just in case you forgot your label.

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

Re: Mesen - NES Emulator

Post by Sour » Sun Sep 10, 2017 12:52 pm

The delete button being grayed out in the watch is a bug (because the auto-refresh feature is clearing out the list's selection on each refresh) - I'll fix it.

Right-clicking on an address to add a label seems to be working properly for me? Do you mean the "Edit Label" option is grayed out even though you right-clicked on an address?

You can also add labels by right-clicking the label list on the right and choosing "Add" - so in your example, if you set a label for InternalRam to $17E and call it Spawn_Checkpoint, then you can write [Spawn_Checkpoint] in the watch window instead of [$17E].

Good point about the search, not sure that there is any simple solution other than adding a "Disable all labels" toggle that would force the code window to ignore labels. On the other hand, you can sort the label list on the right by clicking on the columns, so it shouldn't be that hard to find the label matching a given address in most cases.

User avatar
B00daW
Posts: 584
Joined: Thu Jan 03, 2008 1:48 pm

Re: Mesen - NES Emulator

Post by B00daW » Sun Sep 10, 2017 2:59 pm

OK; cool... I tried the labels before, but the Watch didn't update the name once if was already labeled in the Watch section as the true address. It's a little awkward but as long as it works somehow. :)

Been noticing some strange things given the breakpoints when you right-click the breakpoint section in the debugger and add a range. For instance, I had a range of $5000-$5FFF (without adding the $ symbol of course.) Sometimes I got an "OK" button; other times it was greyed out. I had "execute" and "write" checked, and tried unchecking both; rechecking, etc. Only worked after I closed the window and tried again. Not sure what happens time to time... Seems intermittent.

Another thing is the Memory Editor. Worked on a game where I edited a RAM location and changed the nibbles in the byte. There was a specific routine that seemed to be on the very intimate to the main loop so it updated instantly on a nibble entered; and did not update to the desired effect. In that instance it needed a full byte value updated instantly. Would be good if the cursor jumped to and from bytes instead of nibbles and then waited for each character to be changed.

Love your work and I'm critical of the things I love... You're a gem.

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

Re: Mesen - NES Emulator

Post by Sour » Sun Sep 10, 2017 7:21 pm

It would be hard to update the watch expressions based on labels, given the complexity of the expressions that can be used - a simple find and replace wouldn't be reliable.

The breakpoint validation logic is pretty simple - if you had one of the types checked and your range made sense (e.g start < end), then the only thing left would be that you had a badly formed condition in the condition field. Next time it happens, take a screenshot of the window, would probably help figure out what is wrong.

Forcing whole bytes to be edited would be sort of annoying when you do only need to modify half of it, though (and keeping track of this state would require a fair bit of extra logic for the control) - I'd suggest just breaking the execution before making changes to memory if you need to do this.

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

Re: Mesen - NES Emulator

Post by tokumaru » Tue Sep 12, 2017 11:45 am

Sour wrote:
tokumaru wrote:I had it crash on me several times when trying to use cheats.
Are you talking about 0.9.2 or 0.9.3? 0.9.2 had a bug where opening the cheats window caused crashes pretty often. This is fixed in 0.9.3 - I just tried using cheats again to make sure, and it seems to be working normally on my end
It was 0.9.2, but I'm now using 0.9.3 and still getting errors when using the cheat finder. I got these after pressing the "reset" button:
mesen-cheats-1.png
mesen-cheats-2.png
Clicking "OK" just shows the same error window over and over.

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

Re: Mesen - NES Emulator

Post by Sour » Tue Sep 12, 2017 5:56 pm

Thanks for the report, was a small bug in the UI's code - it's fixed.

User avatar
nesrocks
Posts: 441
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Mesen - NES Emulator

Post by nesrocks » Tue Sep 12, 2017 9:58 pm

There is one thing that is bothering me a bit. I'm not sure if it's just on my PC, but when I pause the emulator, hold a button on the keyboard (X, which I configured to be the NES "A" button), and hit left control (which is my hotkey for "Run single frame"), the game doesn't advance a frame. In fact, it will only work if I'm not pressing any key while I press control, which kind of beats the purpose of pausing the emulator to test something specific in the game. Is this a setting or just how it is?
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!

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

Re: Mesen - NES Emulator

Post by tokumaru » Wed Sep 13, 2017 3:58 am

I don't know what the deal is with keyboard input interfering with other emulation controls, but doesn't the debugger have a virtual controller that you can use in situations like this?

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

Re: Mesen - NES Emulator

Post by Sour » Wed Sep 13, 2017 4:22 am

nesrocks wrote:In fact, it will only work if I'm not pressing any key while I press control, which kind of beats the purpose of pausing the emulator to test something specific in the game.
This is probably the same issue as the one mentioned a few posts back related to shortcuts - the whole shortcut handling changed drastically in 0.9.3, and there are still some minor issues with it that I need to fix. For now, try setting the "Run Single Frame" shortcut to use a key that is not used by any other shortcut - the behavior you're getting is most likely due to the Ctrl key being used in other shortcuts (e.g Ctrl-O)

And also, like tokumaru said, there is a virtual controller in the debugger as well as another unrelated "Execute single frame" option mapped to (I believe) F8, you could also try using that instead (although ideally both ways should work!).

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

Re: Mesen - NES Emulator

Post by Sour » Sun Dec 17, 2017 3:58 pm

In case someone is interested, AxlRocks used the HD pack support in Mesen to make 16-bit-like graphics for Megaman 1.
Personally, I think it looks pretty damn good. :)

Link: https://www.romhacking.net/forum/index. ... ic=25426.0

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

Re: Mesen - NES Emulator

Post by tokumaru » Sun Dec 17, 2017 5:08 pm

Uh... are those graphics copied from the Genesis port of the game? I don't really see the point if this is the case.

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

Re: Mesen - NES Emulator

Post by Sour » Fri Dec 22, 2017 8:46 pm

From the post on romhacking.net:
It's inspired by and takes a few graphics from Wily Wars, but with altered color palettes and most graphics are adaptations of the NES originals.
So it sounds like a lot/most of it was redrawn from scratch? Megaman's sprite is definitely not the same between both, for example.

Post Reply