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 »

bklD wrote: Thu Feb 23, 2023 9:05 am 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.
Thanks, with that I'm pretty sure I know what caused this, I'll revert that change later tonight, it's not worth the problems it seems to be causing.

I'll take a look re: snes opening more slowly for tools, but it's likely that it's just a combination of larger rom/ram compared to other systems + slower emulation core that put together makes it slower.

Re: the edits, don't worry about - if you need to make an edit it's fine, but if you're adding new bug reports to it, try to add them at the bottom with "Edit:" or something added so that it's easier for me to notice, thanks!
User avatar
Controllerhead
Posts: 314
Joined: Tue Nov 13, 2018 4:58 am
Location: $4016
Contact:

Re: Mesen - Emulator

Post by Controllerhead »

Another DPI related bug:

In the Lua API, emu.getMouseState() will not detect the bottom right of the screen when the DPI is over 100%, it will return as -1, -1. It works fine at 100% DPI.

Image

Also, older Mesen was able to detect mouse movement when the main window lacked focus; newer Mesen does not. Not a deal breaker, but, this was helpful for my project and i'm wondering if it's possible to restore this.

Thanks for everything! :mrgreen:
Image
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

Controllerhead wrote: Thu Feb 23, 2023 11:15 am Another DPI related bug:
Oh! It looks like this is the real issue for these two debugger bugs, Sour. At 100% DPI the event viewer is updating and hovering over tiles does not trigger a crash, but from 150% onwards it happens consistent.

Also, do you remember that the history viewer menu sometimes didn't close for me despite your tweaks? That works at 100% dpi as well. I don't now why this build I have mentioned introduced the bug in a way, but even if I revert that change, it is still not fixed. So the real bug seems to have to do with the windows 10 dpi settings and how it affects mesen.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

Controllerhead wrote: Thu Feb 23, 2023 11:15 am Another DPI related bug:
Thanks, this is fixed now. The mouse should also be processed while the window isn't in focus. This also fixes the issue of the "resize" cursor staying active while the mouse is over the window if the window focused (this bit is only fixed on Windows atm, not Linux)

bklD wrote: Thu Feb 23, 2023 11:37 am At 100% DPI the event viewer is updating and hovering over tiles does not trigger a crash, but from 150% onwards it happens consistent.
I was able to fix the history viewer issue with the menu not closing as expected & the event viewer (other viewers had issues at over 100% DPI, too, because of one of my recent changes)

I haven't been able to reproduce the freeze in the tile viewer at any DPI setting on my end, so I don't actually know if it'll be fixed by these changes (it's unlikely it will, but we'll see). Let me know if you're able to reproduce the crash again with the latest dev build.
User avatar
kongmao45678
Posts: 4
Joined: Sat Feb 18, 2023 5:27 pm

Re: Mesen - Emulator

Post by kongmao45678 »

Sour wrote: Thu Feb 23, 2023 6:56 am

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?


Yes, 7Z format is normal,.zip only has problems
ZReport
Posts: 21
Joined: Thu May 31, 2018 11:57 pm

Re: Mesen - Emulator

Post by ZReport »

Welcome back Sour! Been a big fan of your work for quite a long time.

I think the palette loading feature for the PC Engine isn't working. I've been trying to load the "Raw RGB" palette that Kitrinx compiled on Mesen2 to no avail.

https://github.com/Kitrinx/TG16_Palette

Keep up the amazing work my man! Mesen is Godtier. 8-)
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 amI haven't tried reproduce the "wrong ROM reload" yet, sorry.
This should be fixed in the latest dev build - only happened on PCE/GB, and only if debug tools were opened, which is why I wasn't able to reproduce it initially.

ZReport wrote: Thu Feb 23, 2023 9:36 pmI think the palette loading feature for the PC Engine isn't working. I've been trying to load the "Raw RGB" palette that Kitrinx compiled on Mesen2 to no avail.
It seems to be working on my end. I think what might be confusing you is that the default PCE palette in Mesen *is* the palette made by Kitrinx. So even if you load "palette.pal" from that repo, the colors shouldn't change at all.
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

Sour wrote: Thu Feb 23, 2023 6:52 pm
Controllerhead wrote: Thu Feb 23, 2023 11:15 am Another DPI related bug:
Thanks, this is fixed now. The mouse should also be processed while the window isn't in focus. This also fixes the issue of the "resize" cursor staying active while the mouse is over the window if the window focused (this bit is only fixed on Windows atm, not Linux)
Cool. :) There is one thing I have noticed: If your windows dpi is 200% (that's my default setting), start Mario Paint, enable SNES mouse with controller 1 and click on the game window, the cursor goes in the upper left corner and you can't control the mouse anymore in the game. This is not happening with windows dpi scale 100% - 175%. Really weird.
Sour wrote: Thu Feb 23, 2023 6:52 pm
bklD wrote: Thu Feb 23, 2023 11:37 am At 100% DPI the event viewer is updating and hovering over tiles does not trigger a crash, but from 150% onwards it happens consistent.
I was able to fix the history viewer issue with the menu not closing as expected & the event viewer (other viewers had issues at over 100% DPI, too, because of one of my recent changes)

I haven't been able to reproduce the freeze in the tile viewer at any DPI setting on my end, so I don't actually know if it'll be fixed by these changes (it's unlikely it will, but we'll see). Let me know if you're able to reproduce the crash again with the latest dev build.
Unfortunately, I can still reproduce the Tile Viewer freeze very consistent. It feels like the higher your dpi is set, the faster it happens (and I can't reproduce the crash with 100% dpi).

BUT: The other DPI issues are fixed, so that is very nice. Thank you. =)

Edit:
- If "automatically hide menu" is enabled and you hover at the top of the screen while you're in a game, the menu bar gets very fast enabled/disabled again and again. It does not open anymore.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

bklD wrote: Fri Feb 24, 2023 1:43 am Unfortunately, I can still reproduce the Tile Viewer freeze very consistent. It feels like the higher your dpi is set, the faster it happens (and I can't reproduce the crash with 100% dpi).
Managed to reproduce this on another PC - I think the key is that the PC has to be relatively slow to be able to trigger this. Since running at higher DPIs will cause the UI to take more time to update, that's probably why increasing the DPI setting was causing the problem for you. This should hopefully be fixed now, let me know if you can still reproduce it.

The mouse input issues at 200%+ DPI and the auto-hide menu option should both be fixed, too. Thanks!
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

Sour wrote: Fri Feb 24, 2023 4:02 pm
bklD wrote: Fri Feb 24, 2023 1:43 am Unfortunately, I can still reproduce the Tile Viewer freeze very consistent. It feels like the higher your dpi is set, the faster it happens (and I can't reproduce the crash with 100% dpi).
Managed to reproduce this on another PC - I think the key is that the PC has to be relatively slow to be able to trigger this. Since running at higher DPIs will cause the UI to take more time to update, that's probably why increasing the DPI setting was causing the problem for you. This should hopefully be fixed now, let me know if you can still reproduce it.

The mouse input issues at 200%+ DPI and the auto-hide menu option should both be fixed, too. Thanks!
Ah, I see. So this was the reason you couldn't reproduce this issue. Every bug I've reported is fixed now! =)

I tried to trigger more UI related bugs, but everything is extremely polished. Thank you very much, Sour! This will definitely be the emulator I will use for NES, SNES and Game Boy games in the future.
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

Your latest changes broke something with the video size and it's dpi related again. Set the DPI scaling to 125%, start mesen, click video size 6x, close mesen and start it again, you will see that suddenly 5x is checked. And the thing is, it looks like it is still 6x, but the thumbnails on game selection screen are arranged differently. They get re-arranged when you click 6x again. No issues with 100%.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

tepples wrote: Wed Jan 25, 2023 10:32 pm 3. GB: Joypad interrupt on Super Game Boy isn't issued at all (ROM: Telling LYs)
5. GB: INC HL with H=$FE during mode 2 (OAM scan) on pre-GBC models doesn't corrupt OAM (this is GB's counterpart to NES $2003 foolery)
6. GB: Wave RAM can be read while a note is playing (ROM: Demotronic by Megaboys)
These should be fixed as of the latest dev build. I spent some time fixing a few test roms, mostly OAM/DMA related fixes, including implementing the OAM corruption bug. Just need to fix a few APU-related issues and all of blargg's tests should pass (finally)

bklD wrote: Sat Feb 25, 2023 4:07 pm Your latest changes broke something with the video size and it's dpi related again. Set the DPI scaling to 125%, start mesen, click video size 6x, close mesen and start it again, you will see that suddenly 5x is checked. And the thing is, it looks like it is still 6x, but the thumbnails on game selection screen are arranged differently. They get re-arranged when you click 6x again. No issues with 100%.
I'll have to check, but I think at least part of this is probably normal/expected at the moment. The "scale" value isn't saved, the only thing that's saved is the window's size. When open the emulator, it uses the SNES resolution/overscan to determine the current scale value, so if you were running a game that's not a SNES game, close the emulator and re-open it, it won't list the correct scale, and hitting the scale shortcut again will resize it based on SNES dimensions, etc. This happens regardless of DPI settings, at the moment, and isn't new.

Thanks for all the testing you've done!
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

Sour wrote: Sun Feb 26, 2023 10:12 pm
bklD wrote: Sat Feb 25, 2023 4:07 pm Your latest changes broke something with the video size and it's dpi related again. Set the DPI scaling to 125%, start mesen, click video size 6x, close mesen and start it again, you will see that suddenly 5x is checked. And the thing is, it looks like it is still 6x, but the thumbnails on game selection screen are arranged differently. They get re-arranged when you click 6x again. No issues with 100%.
I'll have to check, but I think at least part of this is probably normal/expected at the moment. The "scale" value isn't saved, the only thing that's saved is the window's size. When open the emulator, it uses the SNES resolution/overscan to determine the current scale value, so if you were running a game that's not a SNES game, close the emulator and re-open it, it won't list the correct scale, and hitting the scale shortcut again will resize it based on SNES dimensions, etc. This happens regardless of DPI settings, at the moment, and isn't new.
Oh, this makes sense. So I just never noticed that. ^^; Sounds like a problem that is difficult to solve.
Sour wrote: Sun Feb 26, 2023 10:12 pm Thanks for all the testing you've done!
You don't have to thank me for that. You put so much time and effort into this project... I just wanted to help at least a little bit. :)

Edit: Now I know why I didn't notice this issue. You are right that the scale value is never saved, but at least the scale menu check box and the amount of thumbnails are correct/the same if you restart mesen with 100% and 200% (just SNES games). But as soon as you start with 125%, 175%, 225%, etc, thumbnails and check box changes in addition to the scale issue. Looks like something is still not dpi aware. But yeah, it's just a visual inconsistency and not really a big deal.
User avatar
ISSOtm
Posts: 58
Joined: Fri Jan 04, 2019 5:31 pm
Location: France, right of a pile of consoles
Contact:

Re: Mesen - Emulator

Post by ISSOtm »

Sour wrote: Thu Feb 23, 2023 10:15 pm
ISSOtm wrote: Sat Feb 18, 2023 6:59 amI haven't tried reproduce the "wrong ROM reload" yet, sorry.
This should be fixed in the latest dev build - only happened on PCE/GB, and only if debug tools were opened, which is why I wasn't able to reproduce it initially.
Excellent, thank you!

I have also reproduced the "bad ROM load from menu"; it seems to occur when opening a ROM in Mesen, quitting, modifying the ROM (`make`, in my case), and then opening Mesen and loading the ROM from the menu. I'm assuming that Mesen is loading a save state incompatible with the new ROM, in that case.
The French Lord of Laziness (and a huge Legend of Zelda fan)
https://github.com/ISSOtm
ASMu is laifu <3
User avatar
Controllerhead
Posts: 314
Joined: Tue Nov 13, 2018 4:58 am
Location: $4016
Contact:

Re: Mesen - Emulator

Post by Controllerhead »

Silly bug, but probably worth mentioning:

I use a laptop, and sometimes i have a second display plugged in, sometimes i don't. Mesen remembers where it was when you close and reopen it. If i closed Mesen on a 2nd display that i no longer have plugged in, it will try and resurrect itself on a display that does not exist and not appear on my monitor.

You can easily workaround this by Right Click -> Maximize on the taskbar and redragging the header to a display that does exist, but, i figured i would report it anyway.

Keep up the awesome work! :mrgreen:
Image
Post Reply