Mesen - Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
kongmao45678
Posts: 4
Joined: Sat Feb 18, 2023 5:27 pm

Re: Mesen - Emulator

Post by kongmao45678 »

1、On the OSD display, I guess it is because of the font library, some Chinese characters cannot be displayed correctly, can this problem be fixed, thank you.
2、If the file name of the compressed package is in Chinese, use mesen2 to open it, and the game name displayed on the top of the window will be garbled characters.
3、The problem with the cheat library: when using the cheat function, when selecting each cheat function, the multi-selection box in front will not be selected.
Last edited by kongmao45678 on Sun Feb 19, 2023 7:39 pm, edited 1 time in total.
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

SNES:

There are two SNES games that are flickering a little bit. I can't see anything with ares' pixel accuracy mode. One is "Pocky and Rocky (USA)", the other is "Screet Racer (USA)": https://streamable.com/kutggy

Tests that were published after you stopped working on Mesen-S. Could be helpful to improve emulation:

OAM behavior:
https://github.com/MiSTer-devel/SNES_MiSTer/issues/69

Mode 7 M7VOFS latching:
https://github.com/MiSTer-devel/SNES_MiSTer/issues/274

Writing $4203 twice too fast gives erroneous result (not emulated):
viewtopic.php?t=24087

SuperFX Speed test
https://github.com/MiSTer-devel/SNES_MiSTer/issues/340

Errors with INIDISP
viewtopic.php?p=265225#p265225
https://sd2snes.de/blog/archives/1116
https://twitter.com/UnDisbeliever/statu ... 6168286209



UI

If you reduce the latency in the audio settings, you should get a warning (at least this was the case in the old mesen version). It's no longer present in the new version, but the text ist still there. Not a big deal, but I wanted to bring it to your attention. https://github.com/SourMesen/Mesen2/blo ... en.xml#L35

A lot of sliders are a bit too close to the text. Example: https://imgur.com/a/g2UfBoi

Netplay: "connect to server" and "start server" windows are so small that you can't read the text in the title bar: https://imgur.com/a/UkVP51a

When the "game selection screen" is disabled and you have the menu open, it will not close when you click outside in the back window. if it's enabled it does work and closes: https://streamable.com/sb9fn2

When you switch to full screen mode, you can still see the menu bar for a short time at the top of the screen. This is not happening in the old mesen version.

If a game was running and you double-clicked with the mouse in the middle of the window, it changed to fullscreen mode in the old mesen version. You can't do that anymore.


I have to say that for redesigning everything, there are not a lot of bugs in the UI. I mean... the ones mentioned above are pretty trivial. Everything else seems to work pretty good. Well done! ^^
Last edited by bklD on Sun Feb 19, 2023 3:28 pm, edited 1 time in total.
infidelity
Posts: 490
Joined: Fri Mar 01, 2013 4:46 am

Re: Mesen - Emulator

Post by infidelity »

Hello everyone. NovaSquirrel over at Twitter directed me here, with some issues I was hoping that would be resolved within Mesen2's entire Memory Viewer.

*have the ability to undo hex changes with ctrl/z

*have the edited hex values typed in, have their own unique color, indicating its a modified value.

I hope these will be taken into consideration. I've moved on from other snes debugging emulators, and this one is incredible, but if these 2 requests of mine can be made, I would be extremely thankful!

Thank you all!

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

Re: Mesen - Emulator

Post by Sour »

ISSOtm wrote: Sat Feb 18, 2023 6:59 am This turns out to only happen when "resuming" the ROM from the main menu, and reloading the ROM fixed it. I'm not sure why.
So far the only way I've managed to break something is to load the rom in GB mode, power off, set it to GBC mode and restore the state (you end up with a fully black palette and nothing is visible), but that doesn't sound like what you were describing.

kongmao45678 wrote: Sat Feb 18, 2023 5:31 pm 1、On the OSD display, I guess it is because of the font library, some Chinese characters cannot be displayed correctly, can this problem be fixed, thank you.
2、If the file name of the compressed package is in Chinese, use mesen2 to open it, and the game name displayed on the top of the window will be garbled characters.
Neither of these are easy to fix, unfortunately. Japanese characters (and so some Chinese characters) work because I've embedded a free bitmap font with most common Japanese kanji in Mesen, but the font does not contain Chinese characters (and the author of the font did not make a matching Chinese font, either)
For 2), ZIP files don't have a standard way of encoding file names, so this is usually the result of the ZIP filenames being encoded in an encoding that's neither UTF-8 nor Windows' current default encoding (which are the 2 encodings that Mesen will try to use)

bklD wrote: Sun Feb 19, 2023 9:19 amSNES:
Thanks, I was aware of some of these, but not all of them. At the moment I'm trying to focus on fixing bugs/crashes, so it'll be a while before I can take a look at any of these. If my memory is correct, Pocky & Rocky is meant to have a bit of flickering there, you can see it in some recordings done on hardware, iirc. The flickering isn't identical to what Mesen produces, though.
bklD wrote: Sun Feb 19, 2023 9:19 amUI
Thanks, most of these are fixed now. The double-click is another mouse-input-related limitation that I can't easily work around at the moment. The menu being shown for a fraction of a second when turning on fullscreen mode is also not fixed, it doesn't look like it can easily be fixed, as far as I can tell, and I don't think it's important enough to look into it further.

infidelity wrote: Sun Feb 19, 2023 11:38 am *have the ability to undo hex changes with ctrl/z
Thanks for the requests. This is on my list of items to implement in the future, but I can't say when I'll get around it. It's one of the few features from the original Mesen that are missing at the moment.
User avatar
kongmao45678
Posts: 4
Joined: Sat Feb 18, 2023 5:27 pm

Re: Mesen - Emulator

Post by kongmao45678 »

1、The problem with the cheat library: when using the cheat function, when selecting each cheat function, the multi-selection box in front will not be selected.
2、In addition, the Chinese name of the compressed package is garbled. It is normal to use mesen1, but garbled characters will appear when using mesen2.
creaothceann
Posts: 611
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: Mesen - Emulator

Post by creaothceann »

Sour wrote: Sun Feb 19, 2023 6:02 pm
kongmao45678 wrote: Sat Feb 18, 2023 5:31 pm On the OSD display, I guess it is because of the font library, some Chinese characters cannot be displayed correctly
Japanese characters (and so some Chinese characters) work because I've embedded a free bitmap font with most common Japanese kanji in Mesen, but the font does not contain Chinese characters (and the author of the font did not make a matching Chinese font, either)
Perhaps the text could optionally be rendered with default OS fonts on the window itself, instead of the virtual framebuffer? As a side effect this would also help when a Gameboy ROM is loaded and "Settings window | Preferences | Advanced | Show debug information" is enabled.

Minor issues:
  • "Settings window | Preferences | Shortcut Keys" could perhaps have the online help's text "To clear a key binding, right-click on the button." appear directly in the window (or a popup hint when hovering over a button).
  • There's a shortcut to toggle the display of the lag counter, but none for resetting it (workaround: leaving the Settings window open).
  • FPS, game timer, frame counter and lag counter are displayed on top of the debug info.
    Perhaps the on-screen text could use the higher resolution when "Settings window | SNES | Video | Use fixed output resolution" is enabled.
  • "menu | Options" could probably be renamed to "menu | Settings", since that's the name of the window that pops up.
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

Sour wrote: Sun Feb 19, 2023 6:02 pm UI: Fixed layout issues with sliders
- This broke sliders of history viewer: https://imgur.com/a/Cju0qKs
- The memory viewer does not save the selected video size, if you close it and open it again
- A created SNES save state with memory viewer cannot be loaded again ("invalid save state file")
- Memory viewer menu not closing as expected here as well when window is clicked (at least not always)
- Memory viewer: When the game is paused "resume gameplay" does not resume the game
Sour wrote: Sun Feb 19, 2023 6:02 pm UI: Add low latency warning in audio config
You can't lower the latency with the button anymore (or at least there is just like one pixel that you can click).
Sour wrote: Sun Feb 19, 2023 6:02 pm UI: Fixed menu not closing as expected when game selection screen is disabled and window is clicked
It's working, but I've noticed another possibility where it does not work. Start mesen with default settings (= game selection screen is "Enabled resume from save state") and try the same with the menus. Due to the fact that no game has been started yet, the screen is black as well and the menu is not closing when you do it.


- Enable "Pause when in menu and config dialogs", start a game, go to the menu "Game" -> there is the text "Pause", but it should be "Resume", because the game is paused already.

- Enable "Pause when in menu and config dialogs", start a game -> you can't access "Load State Menu" or "Save State Menu" anymore

- SNES/NES/maybe others as well, Debug: Tilemap Viewer, Tile Viewer, Sprite Viewer: Edit a file and you will crash Mesen: https://streamable.com/8ckb5d
(it looks like it happens because I leave the window with the mouse button still pressed)

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

Re: Mesen - Emulator

Post by Sour »

bklD wrote: Mon Feb 20, 2023 11:22 am - Memory viewer: When the game is paused "resume gameplay" does not resume the game
This is normal, this loads a save on the main window, if the main window is paused, it stays paused (I'd rather not force it to unpause because it might be useful to keep it paused for debugging purposes, etc.)

Everything else should be fixed, thanks!

creaothceann wrote: Mon Feb 20, 2023 12:02 am "Settings window | Preferences | Shortcut Keys" could perhaps have the online help's text "To clear a key binding, right-click on the button." appear directly in the window (or a popup hint when hovering over a button).
There's a shortcut to toggle the display of the lag counter, but none for resetting it (workaround: leaving the Settings window open).
Thanks, I added a tooltip that says "Right-click to clear binding" on the buttons (this is simpler than trying to add an information box on each tab/window where these binding buttons are. Also added a shortcut to reset the lag counter.

For "options" vs "settings", at this point I'm very used to seeing "Options" up there since it's been that way since the first mesen release, but I tend to agree, there's a mix of "options" and "settings in the application atm, but "settings" is used far more often, so I should probably change all "options" to "settings" (there's 10-15 of them)

The FPS counters/etc. could probably be rendered smaller, I think I could add an option for this fairly easily. It would affect the controller input display, too. They're not rendered over the game screen directly, so the game's resolution doesn't have an impact on this. This wouldn't fix the issue of the "debugger information" not displaying correctly for the GB, though (I don't think I have a simple fix for that one at the moment, but it's not really a major issue)

Rendering text over the window with the OS is not a simple change. Avalonia (the UI toolkit) does not allow me to display anything over the DirectX/SDL surface, for one. And even if I had a way to render the OS fonts to a framebuffer, this would require OS-specific code, etc. It's probably not worth the amount of effort it would take - some characters not being shown is a fairly minor issue (and it already works better than the original mesen did)

kongmao45678 wrote: Sun Feb 19, 2023 7:50 pm The problem with the cheat library: when using the cheat function, when selecting each cheat function, the multi-selection box in front will not be selected.
Thanks, this should be fixed.

I can't reproduce the problem you're having with the filenames not being shown correctly in a way that worked in the old version but not in the new one. Everything I've tried so far seems to display the same in both versions (either broken in both, or working in both)
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

- On-screen messages like "state #1 saved" or "state #1 loaded" will not be displayed if you load/save a game by "save state menu" or "load state menu" or "load from file"/"save to file"

- History Viewer: There is still a chance that the menu doesn't close itself if you click in this area (and sometimes at the bottom): https://imgur.com/a/OKEazCb

- History Viewer: You can see the length of the entire track, but not the running one and the slider stays in one position.

- History Viewer: Volume being reset at the same position each time the window is opened and doesn't save a different position.

- Debugger: Tile Viewer -> hover over tiles for a ~10 seconds -> Mesen will crash

- Sound: Something isn't quite right if you unpause a game. A noticeable disturbing noise can sometimes be heard for a while and there is also a little sound interruption everytime you enable the equalizer/memory viewer/load a game/click on the menu or go to event viewer when a game is running: https://streamable.com/ltogsb (sound crackling right at the beginning, when I unpause the game).

In Mesen 0.9.9 you can here a little bit crackling when you enable the equalizer but definitely not when the memory viewer gets enabled, you unpause the game/click on the menu or start event viewer.

Edit: Looks like there is not as much/no crackling with the NES, PC Engine or Gameboy core.



Not an issue, more like a suggestion regarding overclocking: For someone who doesn't know what... let's say ~300 scanlines before/after NMI does with the clockrate, it was very helpful to see at least a percentage how how much I overclock, like in Mesen 0.9.9.

All other issues are now fixed, thank you very much!
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

bklD wrote: Tue Feb 21, 2023 12:43 pm - History Viewer: There is still a chance that the menu doesn't close itself if you click in this area (and sometimes at the bottom): https://imgur.com/a/OKEazCb
I couldn't reproduce this, but I don't think it's problematic enough to spend more time on this, at this point.
bklD wrote: Tue Feb 21, 2023 12:43 pm - Debugger: Tile Viewer -> hover over tiles for a ~10 seconds -> Mesen will crash
I can't reproduce this, either. Could you post a screenshot of your tile viewer window + tell me which game(s) you're getting this with?

RE: the sound crackling, I'm not sure there's much I can do. Odds are pausing/opening debug tools/etc. is causing the audio buffer to empty itself just enough that it runs out of samples to play when the emulation resumes. e.g each time you pause, the audio buffer probably gets a few extra milliseconds during which it's still playing before it gets paused, when the emulation resumes, this can end up causing the buffer to run out of samples before the emulation core can produce more. I'll try to see if the SNES core is doing something differently, but it shouldn't be.
bklD wrote: Tue Feb 21, 2023 12:43 pm Not an issue, more like a suggestion regarding overclocking: For someone who doesn't know what... let's say ~300 scanlines before/after NMI does with the clockrate, it was very helpful to see at least a percentage how how much I overclock, like in Mesen 0.9.9.
I'd actually prefer to not add this back - it gives the false impression that both settings are equivalent (e.g they both overclock the CPU), but this isn't the case.

The other issues should be fixed, thanks!

creaothceann wrote: Mon Feb 20, 2023 12:02 am FPS, game timer, frame counter and lag counter are displayed on top of the debug info.
Perhaps the on-screen text could use the higher resolution when "Settings window | SNES | Video | Use fixed output resolution" is enabled.
"menu | Options" could probably be renamed to "menu | Settings", since that's the name of the window that pops up.
Most instances of "Options" were renamed to "Settings", with a couple of exceptions.
Also added a "HUD display size" setting in preferences->advanced that lets you pick between a fixed-size HUD (new default behavior), or the old behavior (HUD scales with the game). This allows the HUD to take up a lot less space when the game window is set to a scale bigger than 2x (which helps with the overlap on the debug info, etc.)
creaothceann
Posts: 611
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: Mesen - Emulator

Post by creaothceann »

Thanks!
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

Sour wrote: Tue Feb 21, 2023 6:51 pm
bklD wrote: Tue Feb 21, 2023 12:43 pm - Debugger: Tile Viewer -> hover over tiles for a ~10 seconds -> Mesen will crash
I can't reproduce this, either. Could you post a screenshot of your tile viewer window + tell me which game(s) you're getting this with?
It looks like it doesn't matter which game/emulation core is booted but here's a video how to trigger the crash with Super Mario Bros. 3 (USA), NES: https://streamable.com/wwl8vx

Sour wrote: Tue Feb 21, 2023 6:51 pm RE: the sound crackling, I'm not sure there's much I can do. Odds are pausing/opening debug tools/etc. is causing the audio buffer to empty itself just enough that it runs out of samples to play when the emulation resumes. e.g each time you pause, the audio buffer probably gets a few extra milliseconds during which it's still playing before it gets paused, when the emulation resumes, this can end up causing the buffer to run out of samples before the emulation core can produce more. I'll try to see if the SNES core is doing something differently, but it shouldn't be.
That's a pity. It is just a little bit weird that the SNES core has these hickups when I'm just in the settings etc. If you enable debug information and start and pause/close history viewer, you will see red spikes that don't go away either (you have to reload the rom). The delay on the snes core when you click something seems to be way higher as well. But... if you can't improve it further, that's fine too. It was just something that caught my eye...

Edit:
Debugger: Event Viewer doesn't update the whole PPU view anymore (auto-refresh function)
Sour wrote: Tue Feb 21, 2023 6:51 pm The other issues should be fixed, thanks!
Everything seems to work! Thank you for looking at my issues (it's not something I take for granted!) and sorry that some were pretty trivial.
Last edited by bklD on Thu Feb 23, 2023 5:24 am, edited 12 times in total.
User avatar
kongmao45678
Posts: 4
Joined: Sat Feb 18, 2023 5:27 pm

Re: Mesen - Emulator

Post by kongmao45678 »

Sour wrote: Mon Feb 20, 2023 6:58 pm I can't reproduce the problem you're having with the filenames not being shown correctly in a way that worked in the old version but not in the new one. Everything I've tried so far seems to display the same in both versions (either broken in both, or working in both)
QQ截图20230223083734.png
The picture shows the display after opening the Chinese name compressed package with mesen2 and mesen1 respectively, and the display of mesen1 on the right is normal.

[mod edit: attached image to post instead of linking to google drive]
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

bklD wrote: Wed Feb 22, 2023 10:57 amIt looks like it doesn't matter which game/emulation core is booted but here's a video how to trigger the crash with Super Mario Bros. 3 (USA), NES: https://streamable.com/wwl8vx
Still can't reproduce this on my end atm, unfortunately. Tested on Linux too without any problems, and asked someone else to see if they could reproduce it, and it didn't look like they could, either.

The red spike after opening the history viewer was a bug caused by the history viewer and unrelated to the SNES core (or any other sound crackling issue you might be hearing) - this is fixed now. I'm not sure what you're referring to exactly when you say "the delay when you click something" - do you mean opening debug tools? Something else? Opening up debug tools on SNES might be a little bit slower, but there shouldn't be a huge difference.

I can't reproduce any issue with the event viewer - what's not refreshing on your end? Unchecking auto-refresh stops the refresh and lets the user refresh whenever they want to refresh using the refresh button, but that's the expected behavior. Re-checking starts refreshing automatically again.

Could I ask you to not edit the text of your posts so much? :p
You added entirely new bug reports in the middle of a post I had already read a few times now, which makes it harder for me to notice them. I get no notification for edits, so I have to manually re-read the entire post multiple times to see if something new was added (especially since the "last edited on" message/counter does not appear/change until someone else posts in the thread)

kongmao45678 wrote: Wed Feb 22, 2023 5:44 pm The picture shows the display after opening the Chinese name compressed package with mesen2 and mesen1 respectively, and the display of mesen1 on the right is normal.
Thanks for the screenshot, I'll have to try to find files that cause the issue on my end. Just to confirm, this happens when you're loading a rom that's in a .zip file, right? And it doesn't happen for .7z files?
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

Sour wrote: Thu Feb 23, 2023 6:56 am
bklD wrote: Wed Feb 22, 2023 10:57 amIt looks like it doesn't matter which game/emulation core is booted but here's a video how to trigger the crash with Super Mario Bros. 3 (USA), NES: https://streamable.com/wwl8vx
Still can't reproduce this on my end atm, unfortunately. Tested on Linux too without any problems, and asked someone else to see if they could reproduce it, and it didn't look like they could, either.
Sour wrote: Thu Feb 23, 2023 6:56 am I can't reproduce any issue with the event viewer - what's not refreshing on your end? Unchecking auto-refresh stops the refresh and lets the user refresh whenever they want to refresh using the refresh button, but that's the expected behavior. Re-checking starts refreshing automatically again.
I know that unchecking auto-refresh stops the refresh. It's about the activated auto-refresh function. It doesn't seem to work (at least on my end on Windows 10 pro). I have to hover over it for the window to update: https://streamable.com/t8pz6h

But I did some research. Both issues (event viewer not updating and hovering over tiles results in a crash) were introduced in this build: https://github.com/SourMesen/Mesen2/act ... 4218456864 It does work with https://github.com/SourMesen/Mesen2/act ... 4214399987.
Sour wrote: Thu Feb 23, 2023 6:56 am The red spike after opening the history viewer was a bug caused by the history viewer and unrelated to the SNES core (or any other sound crackling issue you might be hearing) - this is fixed now. I'm not sure what you're referring to exactly when you say "the delay when you click something" - do you mean opening debug tools? Something else? Opening up debug tools on SNES might be a little bit slower, but there shouldn't be a huge difference.
I mean opening debug tools, yes. Opening these is not as fast as the other cores and I don't have any/only a few sound interruptions with them. But like I said, that's not really an issue.
Sour wrote: Thu Feb 23, 2023 6:56 am Could I ask you to not edit the text of your posts so much? :p
I'm sorry.
Post Reply