Mesen - Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

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

Re: Mesen - Emulator

Post by Sour »

Controllerhead wrote: Thu Mar 30, 2023 7:34 pm I am not sure how the SNES mouse behaves on real hardware, you may be right about your intrepretation
The SNES mouse is something I implemented for the NES years ago and never really looked at since. It looks like there's already some information on what the sensitivity settings do here: https://snes.nesdev.org/wiki/Mouse#Sensitivity
My code doesn't implement this logic at all, at the moment.

007 wrote: Thu Mar 30, 2023 7:38 pm PCE Final Soldier

Planet on title screen shakes. Just like emuhawk.

Does not shake on Mednafen, Ootake or real hardware.
Thanks, this looks pretty similar to the Jackie Chan game's issue, which also shakes - I've taken a look at that one before but haven't been able to find a proper solution yet. I'll add this one to my list of PCE games to look at, too.
The PCE core in general definitely still needs some work, there are still a good amount of games with issues, particularly CD-ROM games.
007
Posts: 89
Joined: Mon May 02, 2016 5:55 am

Re: Mesen - Emulator

Post by 007 »

So exciting to see mesen and mesen-s combined and now pce added! 3 of my 4 favourite systems of all time covered!

Thanks for this.
User avatar
Controllerhead
Posts: 314
Joined: Tue Nov 13, 2018 4:58 am
Location: $4016
Contact:

Re: Mesen - Emulator

Post by Controllerhead »

Sour wrote: Thu Mar 30, 2023 8:27 pm It looks like there's already some information on what the sensitivity settings do here: https://snes.nesdev.org/wiki/Mouse#Sensitivity
I purchased an SNES mouse yesterday and i am happy to report that my SNES mouse behaves exactly as described. :D
Sour wrote: Thu Mar 30, 2023 8:27 pm My code doesn't implement this logic at all, at the moment.
Welp, so i dun went into your emulator and took a crack at it :mrgreen:

The results are ...accurate, but honestly, they do not feel that great lol. The solution i came up with truly feels like an SNES mouse side to side ...with the caveat of default Mesen mouse speed settings, on my machine, with my resolution, with my Logitech optical mouse, with my Windows mouse speed settings, etc. There are also Windows settings such as Enhance Pointer Precision that affect pointer behavior, this should be disabled to get the "True SNES Mouse Experience".

Image

Now, i guess the question really is, should the SNES Mouse in Mesen truly feel like an SNES mouse, for better or worse? For development sake, i would absolutely argue yes, it is helpful to have a peripheral that approximates the real thing. How about for just playing games though? ...well that is certainly debatable, i'm sure some puritans would argue yes, but, it is honestly a clunky experience by modern standards.

What i propose (and can't code without knowing more about your codebase) is an "SNES Accurate Mouse" checkbox in the mouse settings, i would suggest keeping it unchecked by default honestly, but the option would be nice.

Image

Anyway, i made a pull request to your codebase and did all of the heavy lifting as far as making an accurately emulated SNES mouse, to the best of my abilities anyway. There is also a bool waiting for this UI option to actually exist.

Thanks again for your wonderful emulator and everything you do :mrgreen:
Image
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

007 wrote: Thu Mar 30, 2023 7:38 pm PCE Final Soldier

Planet on title screen shakes.
Finally figured this one out, it's fixed in the latest dev build. The same change fixes the issue in the Jackie Chan game, too.

Controllerhead wrote: Sat Apr 01, 2023 11:05 am Welp, so i dun went into your emulator and took a crack at it
Thanks for the PR! For now I changed it to remove the old behavior entirely (if there's really a reason why this needs to be kept, I can look into adding it back). For the scaling, there's already an option in the input settings for this so I removed that bit, too. Was this because the mouse sensitivity option doesn't allow you to get more or less the sensitivity you'd expect as-is? If so, I could probably add more levels of sensitivity in the options, to make the mouse slower/faster.
User avatar
Controllerhead
Posts: 314
Joined: Tue Nov 13, 2018 4:58 am
Location: $4016
Contact:

Re: Mesen - Emulator

Post by Controllerhead »

Sour wrote: Sat Apr 01, 2023 4:34 pm For the scaling ... Was this because the mouse sensitivity option doesn't allow you to get more or less the sensitivity you'd expect as-is? If so, I could probably add more levels of sensitivity in the options, to make the mouse slower/faster.
Yes. It felt like a "real" SNES mouse (to me) at a factor of 1 SNES pixel for every 4 actual pixels, the current scale slider doesn't go that low. I would assume some machines / people would want it lower or higher than that 1/4 value, but i'd wager it a fairly safe and accurate default value.

I was also keeping track of and adding the "subpixels" from the previous frame, so say, from zero: If you moved 2 pixels the first frame and 3 pixels the second frame, it would move 1 SNES pixel on the second frame and keep track of that extra 1/4 pixel for future movement smoothness.
Sour wrote: Sat Apr 01, 2023 4:34 pm Thanks for the PR!
I'm more than happy to help! :mrgreen:
Image
007
Posts: 89
Joined: Mon May 02, 2016 5:55 am

Re: Mesen - Emulator

Post by 007 »

Sour wrote: Sat Apr 01, 2023 4:34 pm
007 wrote: Thu Mar 30, 2023 7:38 pm PCE Final Soldier

Planet on title screen shakes.
Finally figured this one out, it's fixed in the latest dev build. The same change fixes the issue in the Jackie Chan game, too.


Wow that was fast, was just reporting for future didnt expect a fix that fast!

Nice thanks.

Mesen has been since you left my go to for NES and was using latest dev build from when you left for snes. Now its gonna be my pce as well it looks like. Thanks for this wonderful piece of software!
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

Controllerhead wrote: Sat Apr 01, 2023 5:38 pm Yes. It felt like a "real" SNES mouse (to me) at a factor of 1 SNES pixel for every 4 actual pixels, the current scale slider doesn't go that low. I would assume some machines / people would want it lower or higher than that 1/4 value, but i'd wager it a fairly safe and accurate default value.
I've expanded the mouse speed setting to go from 0.25x to 4x speed (instead of 1x to 4x like before), so if you set it to the slowest speed now, you should get the same result as what you had originally coded, I think.

007 wrote: Sat Apr 01, 2023 7:12 pm Nice thanks.
No problem!
User avatar
Controllerhead
Posts: 314
Joined: Tue Nov 13, 2018 4:58 am
Location: $4016
Contact:

Re: Mesen - Emulator

Post by Controllerhead »

Sour wrote: Sun Apr 02, 2023 8:23 am the mouse
This is great! Thank you!

I PR'd one final hardware quirk of the mouse: it will maintain and report its previous direction in the Up and Left flags. I don't know if any games utilized this information, but it might fix something... somewhere... who knows :roll:

Thanks for your time and attention :mrgreen:
Image
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - Emulator

Post by Pokun »

I might be a puritan but I honestly think the accurate mouse emulation should be used by default. Us who are familiar with the emulator can easily check that option when we need it, but more casual players would probably just be upset that Gnat Attack is too easy and doesn't play as it's supposed to and not know that you need to check this box.

But anyway thanks for fixing the SNES mouse accuracy both of you!
User avatar
Controllerhead
Posts: 314
Joined: Tue Nov 13, 2018 4:58 am
Location: $4016
Contact:

Re: Mesen - Emulator

Post by Controllerhead »

Pokun wrote: Sun Apr 02, 2023 2:28 pm I might be a puritan but I honestly think the accurate mouse emulation should be used by default.
It is, and fortunately, the "slow" hardware speed of the mouse just happens to be uncapped 1:1. The "Default SNES Mouse" should feel an awful lot like your mouse.

However, if you want the True SNES Mouse Expreience™ i'd suggest disabling Enhance Pointer Precision in Windows and turning the emulator mouse speed down until it feels ...snail paced :mrgreen:

If you rename this program from .bin to .smc you can get a good feel for it with the different hardware speed settings, as well as see the registers printed on screen in motion:
https://snescentral.com/1/2/4/1240/mouse_check.zip
Image
007
Posts: 89
Joined: Mon May 02, 2016 5:55 am

Re: Mesen - Emulator

Post by 007 »

Turbo Grafx aka PCE

Darius Alpha (Japan)
Darius Plus (Japan)

these are standard PCE hu cards that run on PCE but will run enhanced on SGX.

Is there a way to know which mode they use when in mesen? And a way to force them in one mode or the other?


These are the only games released that do this.


the Other 5 supergrax titles were supergrafx only.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

Pokun wrote: Sun Apr 02, 2023 2:28 pm I might be a puritan but I honestly think the accurate mouse emulation should be used by default.
Accurate is the only option atm - I didn't add an option to use the old behavior.
007 wrote: Mon Apr 03, 2023 8:06 am Is there a way to know which mode they use when in mesen? And a way to force them in one mode or the other?
The "Console type" option in PC Engine->General lets you control this. The default is automatic. Automatic will use supergrafx for the 5 supergrafx-only games (if the ROM matches the expected checksum). When in auto mode, if the rom's extension is .sgx, it'll also load as a supergrafx, regardless of the rom checksum. And then you can also force it to always run in supergrafx mode by picking that in the dropdown instead of auto (which will run PCE games too, but it'll fast forward a lot slower in supergrafx mode)
007
Posts: 89
Joined: Mon May 02, 2016 5:55 am

Re: Mesen - Emulator

Post by 007 »

Sour wrote: Mon Apr 03, 2023 1:40 pm
Pokun wrote: Sun Apr 02, 2023 2:28 pm I might be a puritan but I honestly think the accurate mouse emulation should be used by default.
Accurate is the only option atm - I didn't add an option to use the old behavior.
007 wrote: Mon Apr 03, 2023 8:06 am Is there a way to know which mode they use when in mesen? And a way to force them in one mode or the other?
The "Console type" option in PC Engine->General lets you control this. The default is automatic. Automatic will use supergrafx for the 5 supergrafx-only games (if the ROM matches the expected checksum). When in auto mode, if the rom's extension is .sgx, it'll also load as a supergrafx, regardless of the rom checksum. And then you can also force it to always run in supergrafx mode by picking that in the dropdown instead of auto (which will run PCE games too, but it'll fast forward a lot slower in supergrafx mode)
Thanks for the insight still getting use to the emulator. Will be using it alot to help test.
jadasse
Posts: 7
Joined: Mon Apr 03, 2023 9:23 pm

Re: Mesen - Emulator

Post by jadasse »

Since Mesen-X is deprecated, are there any updates on integrating the changes from Mesen-X into Mesen2, such as EPSM?
007
Posts: 89
Joined: Mon May 02, 2016 5:55 am

Re: Mesen - Emulator

Post by 007 »

jadasse wrote: Mon Apr 03, 2023 9:26 pm Since Mesen-X is deprecated, are there any updates on integrating the changes from Mesen-X into Mesen2, such as EPSM?

Not trying to be mean but mesen-x was forked and modified by a third party. I dont think real mesen was looking at altered mesen
Post Reply