Mesen - Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

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

Re: Mesen - Emulator

Post by rainwarrior »

Sour wrote: Thu Feb 02, 2023 10:00 pm
rainwarrior wrote: Wed Feb 01, 2023 6:20 pm I'd kinda not recommend having them be a default
These have actually been the default shortcuts for rewind/fast-forward in all Mesen versions since 2017, so I'm mostly leaning towards keeping this as-is. It hasn't really been something that's been reported as an issue before, that I can recall. I'm a bit biased here since I use this fairly often (and since I inevitably end up breaking/resetting my settings constantly during dev, I'd need to re-configure these constantly if they weren't the default)
I think it's actually something that has been bothering me for years but I couldn't put my finger on what the cause was because it happened infrequently. Since switching to a different controller recently it's been happening a lot more.

So, as an alternative request, it would be very good to have by default a visual indicator (like the pause indicator) for rewind and fast-forward.

The biggest problem I had with it is that I didn't know the cause. When I'm testing my game and a weird blip like this happens, I don't know if I've had a bug or not. I do remember sometimes seeing something strange like this happen and spending time trying to figure it out, but just seemed to go away when under observation. The reason I was able to report it this time was because I had several cases in one day of something "impossible" happening and I could tell for certain the emulator was doing it.

At least if there was a visual indicator that I had fast forwarded, I would have a chance to realize it wasn't a bug, and also it would help me understand how to turn it off.
User avatar
jeffythedragonslayer
Posts: 344
Joined: Thu Dec 09, 2021 12:29 pm

Re: Mesen - Emulator

Post by jeffythedragonslayer »

rainwarrior wrote: Thu Feb 02, 2023 10:48 pm At least if there was a visual indicator that I had fast forwarded, I would have a chance to realize it wasn't a bug, and also it would help me understand how to turn it off.
This hasn't happened to me, but I agree. Even if it's just in the title bar.
User avatar
jeffythedragonslayer
Posts: 344
Joined: Thu Dec 09, 2021 12:29 pm

Re: Mesen - Emulator

Post by jeffythedragonslayer »

Sour wrote: Thu Feb 02, 2023 10:00 pm
jeffythedragonslayer wrote: Wed Feb 01, 2023 4:25 am Highlight raster beam position is a feature I'd find super useful as well.
This is already highlighted in the event viewer (and the numerical values are written in the debugger & register viewer)
Ooh thanks. BTW, I noticed several of the View->Zoom {in, out} menu items don't work with the numpad + and -.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

rainwarrior wrote: Thu Feb 02, 2023 10:48 pmSo, as an alternative request, it would be very good to have by default a visual indicator (like the pause indicator) for rewind and fast-forward.
That's a good idea - would also be similar to the record/play icons that show up when playing/recording movies.
jeffythedragonslayer wrote: Fri Feb 03, 2023 7:01 amI noticed several of the View->Zoom {in, out} menu items don't work with the numpad + and -.
This is normal, the numpad keys are considered as different keys for the purpose of keybindings. e.g you can do "Alt+2" to set the scale to 2x, but you can't use the 2 key from the numpad (you would have to rebind it to use the numpad, and then the shortcut would be listed as "Alt+Numpad 2" in the bindings instead of "Alt+2")
Cartesius
Posts: 3
Joined: Fri Feb 03, 2023 7:26 am

Re: Mesen - Emulator

Post by Cartesius »

Hey, congrats on the release. I've been playing around with a bunch in the last couple of days and it's been a joy. I have one bug I'd like to report along with some general observations. Keep in mind that I have never used other versions of Mesen, so this is my first contact with the emulator.

Bug:
In the music player, if you select a SPC track that is inside a zip file, the count of the total number of tracks will not increase
So if you haven't loaded any tracks and then you load one from a zip, it will show as "1/0" (playing track 1 from a total of 0)
And then if you click to go to the next track or if the track run its course and ends, it crashes

The experience using Mesen has been mostly positive and I'm ready to switch to it as my main SNES emulator. The one thing that is worse than my current main emulator (Snes9x) is rewind. On Snes9x rewind is very smooth and natural and works extremely well. On Mesen it's still incomprehensible to me and feels extremely weird. I want to ask if you mind explaining how exactly does rewind work on Mesen. I've been trying to make sense of it but it's strange because it seems like the rewind shows some things that didn't happen (?)

Another thing I wanted to ask is why can you use the savestate functions in Lua scripts only in 'exec' memory callbacks?

Anyway, fantastic piece of software you got here. I've been having a blast
Last edited by Cartesius on Fri Feb 03, 2023 8:10 am, edited 1 time in total.
User avatar
jeffythedragonslayer
Posts: 344
Joined: Thu Dec 09, 2021 12:29 pm

Re: Mesen - Emulator

Post by jeffythedragonslayer »

Sour wrote: Fri Feb 03, 2023 7:33 am
jeffythedragonslayer wrote: Fri Feb 03, 2023 7:01 amI noticed several of the View->Zoom {in, out} menu items don't work with the numpad + and -.
This is normal, the numpad keys are considered as different keys for the purpose of keybindings. e.g you can do "Alt+2" to set the scale to 2x, but you can't use the 2 key from the numpad (you would have to rebind it to use the numpad, and then the shortcut would be listed as "Alt+Numpad 2" in the bindings instead of "Alt+2")
Not sure I'm following... I don't see anything called "Zoom" in Options->Settings->Preferences->Shortcut Keys. These viewers appear to be hardcoded to use the Ctrl +/- near backspace. I'm not actually trying to use the digit keys themselves - still using the plus and minus keys, just on the numpad.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - Emulator

Post by Pokun »

Sour wrote: Fri Feb 03, 2023 7:33 am the numpad keys are considered as different keys for the purpose of keybindings. e.g you can do "Alt+2" to set the scale to 2x, but you can't use the 2 key from the numpad (you would have to rebind it to use the numpad, and then the shortcut would be listed as "Alt+Numpad 2" in the bindings instead of "Alt+2")
I very much like that, it makes it more powerful to handle different keys separately and I hate when I can't do key mappings as I want them to be. Since you can map multiple keys to the same function you can have the best of both worlds.

I think we had this discussion before that both SHIFT keys would be handled like the same key which was bad for Family BASIC keyboard mapping which has two SHIFT keys with separate key codes. I opted to use the menu key for the right SHIFT which wasn't exactly ideal, but the new Mesen can handle the two SHIFT keys separately fine.

It still sometimes has the problem that Alt enables the menu (as discussed here for the old Mesen) and AltGr doesn't seem to work at when binding it as an alternate GRAPH key.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

Cartesius wrote: Fri Feb 03, 2023 8:09 amHey, congrats on the release. I've been playing around with a bunch in the last couple of days and it's been a joy.
Thanks for the comments/feedback!
It took me a couple of minutes, but I finally remembered that rewind is broken in the preview I uploaded to github. It was fixed a week or so ago - you can grab the latest build here (assuming you're on windows): https://nightly.link/SourMesen/Mesen2/w ... ows%29.zip
This should fix rewind and make it behave like what you'd expect.

Playing a SPC file from a zip is probably something I've never tested, I'll take a look, thanks!

As for the Lua limitation, it's because when you're in the middle of a read or write (or the "endFrame" event, etc.) the CPU is in the middle of executing an instruction, which is not a state that it can "resume" from, so any save state taken wouldn't work as expected when loaded afterwards. The "exec" callback pauses the execution in-between 2 separate instructions, which is supported by the save states and works correctly.

jeffythedragonslayer wrote: Fri Feb 03, 2023 8:49 am I don't see anything called "Zoom" in Options->Settings->Preferences->Shortcut Keys.
The shortcuts in the preferences are for everything that is not a debug tool. All shortcuts for the debug tools are separate and found in Debug->Settings->Shortcuts, you'll find the zoom in/out shortcuts there.

Pokun wrote: Fri Feb 03, 2023 8:53 am It still sometimes has the problem that Alt enables the menu (as discussed here for the old Mesen) and AltGr doesn't seem to work at when binding it as an alternate GRAPH key.
You mean when the left or right alt keys are set as a binding on their own, without any additional key? I can't think of a simple way of preventing the menu from activating in that scenario (the shortcuts are processed by the core, not the UI directly, which makes this a bit more complex than it would otherwise be). Similarly, if e.g you bind a shortcut to Alt+F, that'll end up opening the file menu as well as triggering the shortcut.
By "AltGr" do you mean the key that shows up as "Right alt" in the bindings? It seems to work as I'd expect for regular bindings, but it's possible the famicom keyboard doesn't work properly with it, I'll have to check.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - Emulator

Post by Pokun »

Yeah the left Alt key triggers the menu, but works fine when used as a modifier key together with another key except when there is a shortcut such as Alt+F like you said.
And yes AltGr (AKA Alt Graph) is indeed just labeled Right Alt in Mesen. On some keyboards it's just called Alt just like the left Alt key, I don't know how your keyboard looks like. It doesn't seem to work at all for what I bound it to and triggers the menu right away. I could be without AltGr as there is enough keys for the full Family BASIC keyboard anyway (and the left Alt matches the location of the Family BASIC GRAPH key more), I just wanted to report that it acts weirdly.

Could the user-configured shortcuts be disabled? They interfere with control codes in Family BASIC, for example CTR+D reinitializes background and sprites in BASIC but also opens the Mesen debugger and pauses the emulation. The bindings could of course be manually removed, but they are useful when not working in BASIC.

Another thing, it would be nice if the SNES mouse was available for the Famicom expansion port (controller 3 and 4 configurations). Currently it can only connect to the controller ports which isn't so easy on the original Famicom. Makimura made a mouse program expecting this here.
User avatar
Controllerhead
Posts: 314
Joined: Tue Nov 13, 2018 4:58 am
Location: $4016
Contact:

Re: Mesen - Emulator

Post by Controllerhead »

Very happy to see you back Sour! :mrgreen:
Sour wrote: Mon Jan 30, 2023 7:38 pm [*]Re: importing debugger data from the old mesen: While not necessarily impossible to do, it's not a goal at the moment ... Are you asking because you have a large amount of debugger data for a variety of games you've reverse-engineered? This is basically the only scenario where I could see why you would want to do this.
Yeahhhhhh so that's kind of where i'm at... my vote is for supporting legacy import wherever possible, perhaps with a prompt for converting legacy workspace data to the new format(s)
Sour wrote: Mon Jan 30, 2023 9:48 pm In theory, if you export your old workspace labels to .mlb in the old Mesen, and then replace the first part of each row as follows:

Code: Select all

G:   ->   NesMemory:
P:   ->   NesPrgRom:
R:   ->   NesInternalRam:
S:   ->   NesSaveRam:
W:   ->   NesWorkRam:
Since this broke ASM6F .mlb label export, i've fixed and updated it to support both types:
-m for new style labels
-M for old style labels

https://github.com/NESblast/asm6f

asm6f-win-newMLB.zip
(77.54 KiB) Downloaded 8 times
Image
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

Is it possible to give dev versions their own version numbers? Could be useful when someone want's to report bugs. ^^

Speaking of bugs, one little thing that caught my eye: If a game is running (windows 10) and you move the mouse into the mesen window from the outside there is a possibility that the resize cursor doesn't go away:

https://imgur.com/gallery/Hklxw99

As if you are still at the edge of the window to resize it.
Cartesius
Posts: 3
Joined: Fri Feb 03, 2023 7:26 am

Re: Mesen - Emulator

Post by Cartesius »

Sour wrote: Fri Feb 03, 2023 3:17 pm
Cartesius wrote: Fri Feb 03, 2023 8:09 amHey, congrats on the release. I've been playing around with a bunch in the last couple of days and it's been a joy.
Thanks for the comments/feedback!
I have some other things that I forgot to mention:
  • The dark theme is broken in the script editor. The documentation popup is white and illegible
    Image
  • Is there any technical reason as to why when I press the key to start rewinding it takes a bit of time before it actually starts as opposed to just start rewinding immediately?
  • Is there any reason why changing emulation speed isn't possible via Lua scripting or you just didn't want to implement that? Being more general, do you plan to expand the Lua API in any way?
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

SPC7110 games don't work anymore, Sour.

- Far East of Eden Zero (Tengai Makyou Zero)
- Momotaro Dentetsu Happy
- Super Power League 4
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

Pokun wrote: Fri Feb 03, 2023 7:33 pm Could the user-configured shortcuts be disabled?
I thought I already made it so that all shortcuts are disabled when the familybasic keyboard is connected, but it's been like a year and hasn't been tested since, so it might be broken.
Pokun wrote: Fri Feb 03, 2023 7:33 pm it would be nice if the SNES mouse was available for the Famicom expansion port (controller 3 and 4 configurations).
If you pick the "2-Player Adapter (Famicom)" expansion device, it should let you connect the SNES mouse to port 3/4. The 4-player adapter (e.g 6 controllers total) isn't compatible with the SNES mouse, afaik, which is why you can't connect the mouse to it.

Controllerhead wrote: Fri Feb 03, 2023 9:10 pmmy vote is for supporting legacy import wherever possible
I've added support for the .mlb files produced by Mesen 0.9.x and Mesen-S, but that's about as far as I can go. Supporting settings, save states, movies, or debugger workspaces from Mesen 0.9.x/Mesen-S would require far too much time/effort.

bklD wrote: Sat Feb 04, 2023 7:02 am there is a possibility that the resize cursor doesn't go away
This is a limitation of how the main window's rendering works within Avalonia, the cursor only gets stuck as a resize icon while the mesen window isn't in the foreground (there's already code to reduce the effects of this issue, otherwise the issue happens when in the foreground, too)
bklD wrote: Sat Feb 04, 2023 6:00 pm SPC7110 games don't work anymore
Thanks, this is fixed.

Cartesius wrote: Sat Feb 04, 2023 3:04 pm The documentation popup is white and illegible
Thanks, this is fixed.
Rewind takes a little bit of time to start because the emulator has to load the previous save state, and emulate 1 second worth of gameplay before it can start displaying the video in reverse (because the rewind data only keeps 1 save state per second to reduce memory usage), that's why there's a little delay before it starts.
The Lua API atm is basically the same as its always been in Mesen/Mesen-S. It could be expanded later on, though I don't have any specific plans for it, and for now my focus is mostly on bugs. Although, in this specific case, changing the speed implies altering the user's configuration which is controlled by the UI (C#) side of things, so allowing Lua scripts to modify this isn't as straightforward as it may sound.
Cartesius
Posts: 3
Joined: Fri Feb 03, 2023 7:26 am

Re: Mesen - Emulator

Post by Cartesius »

Sour wrote: Sat Feb 04, 2023 7:02 pm Rewind takes a little bit of time to start because the emulator has to load the previous save state, and emulate 1 second worth of gameplay before it can start displaying the video in reverse (because the rewind data only keeps 1 save state per second to reduce memory usage), that's why there's a little delay before it starts.
Could it be possible to keep every frame from the last like 2 or 3 seconds so that you don't have to emulate these first seconds and thus not have the little delay? Not a huge deal either way, just wondering
Post Reply