Mesen - Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

creaothceann
Posts: 611
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: Mesen - Emulator

Post by creaothceann »

Controllerhead wrote: Tue Feb 28, 2023 5:34 pm 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.
I think Total Commander handles that by storing its position, layout, font size etc. for each encountered mix of (desktop* width, desktop height, DPI setting).

(*desktop being the virtual area that is the combination of all monitors)
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

ISSOtm wrote: Mon Feb 27, 2023 2:16 pmI 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.
If you mean you're clicking on the rom's icon in the main window that normally resumes gameplay where you left off, this is probably normal. Changing the ROM might make the emulation resume somewhere completely different from where it left off if the code moved, etc. You can make it so clicking on these icons always resumes from power on instead of from a save state (in preferences->advanced->game selection screen).

If you mean you're clicking on e.g file->recent files->[rom name] and it does this, though, that's unexpected (and I'm not sure how that would be possible)

Controllerhead wrote: Tue Feb 28, 2023 5:34 pm 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.
This is actually something I implemented a long time ago, and apparently it's also been broken for a while now. Just fixed it, it should auto-move any off-screen windows back to your main monitor. Thanks!
ZReport
Posts: 21
Joined: Thu May 31, 2018 11:57 pm

Re: Mesen - Emulator

Post by ZReport »

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.

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.
Aha! That might be it! I do believe I will go on and have fun making some palettes then. Thanks so much ! You're doing amazing work. :beer:
User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Mesen - Emulator

Post by nesrocks »

I have a list of features that I would find useful or to be improvements to usability. It mostly relates to how I have used Fceux for reverse engineering games for years so they go hand in hand with how I find Mesen a bit confusing when transitioning from that. It could be because I don't see how Mesen's method is better (I believe it may be), so it causes a bit of confusion. Anyway:

1 - Memory type: ROM in the Memory Viewer. View the entire ROM. I guess hiding the header could be good but maybe optional (addresses update accordingly). Being able to view only the PRG ROM or CHR ROM is cool, but why not an option to view the loaded file as it is in reality?
2 - Make "stop/resume" and "clear" buttons for the code data logger, ready to use somewhere in the interface. Floating window maybe. Actually, there's no stop/resume logging even, I think? I use these a lot for reverse engineering. How would someone not use these a billion times? Hidden under a menu makes it difficult for me to use such a frequent feature. I know there's an assignable hotkey for the clear CDL, but the brain can only remember so many hotkeys.
3 - Bookmarks? I see that "Functions" almost works like bookmarks, but it doesn't allow me to mark any arbitrary address in the ROM.
4 - When Mesen is run I'd like it to automatically open windows that were open when I last closed Mesen and in their last positions + sizes. Things like Tile Viewer, Debugger, Memory Editor (in the memory type that it was in), Memory Search, etc.
5 - A toggleable option to enable clicking any Mesen window to bring all Mesen windows to the front. Or at least clicking the main window if not possible on clicking any window.
6 - Some text is a bit hard to read on the dark theme. Text written in black over dark grey. Text should be light grey I think. Mostly the column names under the Labels, Functions, Watch, Breakpoints and Call Stack groups in the debugger for example. The same problem happens in other windows for that same UI element type.

I think that's it. Mesen has come a long way, thanks for all the work. I'll try harder to adapt, but if some of these seem reasonable maybe add them to the bottom of the todo stack.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - Emulator

Post by Pokun »

For 1) I think that option should be called "image file" or something like that to make it clear that it's the ROM image file and not the actual ROM chip. If you just say ROM I automatically think of the ROM cartridge itself, pretending that this is a real Famicom or NES which can't see the header, merged PRG & CHR ROMs or whatever else might be specific to a particular media image format which wouldn't necessarily work with the console's address space.
I can see that both types of ROM view may be useful however.

For 4) I too think this would be very useful. When I'm testing my own, to having to keep open up all those PPU/APU/memory viewers, debuggers and other tools are things that hinders productivity.
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: Mesen - Emulator

Post by unregistered »

Pokun wrote: Tue Mar 14, 2023 4:51 pm For 1) I think that option should be called "image file" or something like that to make it clear that it's the ROM image file and not the actual ROM chip.
how about “emu ROM”? It’s the ROM image that’s useful for emulators.

Edit: emu’s ROM?
Last edited by unregistered on Thu Mar 23, 2023 4:14 pm, edited 1 time in total.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - Emulator

Post by Pokun »

But the ROM image can also be used on real hardware using a flashcart, not only emulators. "ROM image file" is as accurate as it gets and makes it clear that you are talking about the file rather than the memory location.
gzip
Posts: 23
Joined: Sat Mar 13, 2021 2:29 pm
Contact:

Re: Mesen - Emulator

Post by gzip »

Hi Sour,

Came across a few bugs and other issues...

The first one is some kind of rendering corruption in the Labels/Results tab. One of the items tends to get stuck in it's position and will overlay the others. I haven't been able to nail down the exact scenario where this happens but it's fairly frequent. I also haven't found a way to clear it once it happens.
find_corruption.png

The second one is a duplication of search results. Again, not always reproducible but it seems to happen more often than not.
find_duplication.png

Another issue is that the label overlay in Memory Viewer doesn't show the offset for multibyte labels like it used to. This makes it much harder to navigate large blocks of data.
memory_overlay.png

Also noticed a difference in breakpoint notification with the older Mesen. There used to be a prominent yellow overlay in the Dissasembly window. It took me a while to notice that the notification moved to the bottom left corner of the window. Definitely prefer the older behavior.
breakpoint.png

Here are also a number of feature requests that would improve ease of use, mainly around memory navigation.
  • In Watch window allow View in Memory Viewer for the evaluated pointer, e.g. {$11E0} would have an additional option to jump to the address stored at $11E0 instead of just jumping to memory location $11E0.
  • Similar to above, in Memory Viewer allow a jump to the memory pointer under the current cursor position (the tooltip already displays it under Value).
  • In the Breakpoints window add an option to go to the breakpoint memory location (View in Memory Viewer).
  • In the Breakpoints window change the behavior of double click to View in Memory Viewer if R/W and Go to Location if X (current behavior is to edit the breakpoint).
  • In Memory Viewer remember the last location you were at for the selected memory type. Say I'm open to a location in PRG ROM then I select View in Memory Viewer in Tile Viewer which takes me to PPU Memory in the same window; when I then select PRG ROM again in the Memory Type drop down I want to go back to the location I was at rather than $0000.
  • In the Debugger allow Memory Viewer, Tile Viewer etc. to be opened directly with their keyboard shortcuts rather than have to go back to the main window first to be able to use the shortcut.
  • Allow items in the Breakpoints and Watch windows to be rearranged.
  • In Tile Viewer provide a way to highlight unused tiles.
Keep up the great work!
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

nesrocks wrote: Mon Mar 13, 2023 7:42 pm I have a list of features that I would find useful or to be improvements to usability
I replied to this on Discord a while ago, but just to re-iterate for anybody else reading this:
1 is a bit more complex than it might sound, and not really something I want to get into at the moment.
3/4/5 are on my list of future ideas, although 3 overlaps a lot with another request to be able to name/etc breakpoints.
6 is fixed.
gzip wrote: Wed Mar 29, 2023 3:52 pm Hi Sour,
Came across a few bugs and other issues...
Thanks for the reports/requests!

The first bug is something that I've been aware of for a while (list elements appearing when they shouldn't be, etc.), but everything I've tried to attempt to fix the problem so far hasn't worked out - I think it might be an Avalonia bug, but I'm not entirely sure.

The breakpoint notification was changed for simplicity for the most part. The old version also disappeared as soon as you clicked anything, which was inconvenient (and keeping it visible at all times is equally as bad, which is part of why I stopped trying to overlay it). I'll try to see if there's a better way to display this.

Re: double-click behavior on breakpoints, this could be an option (e.g a way of picking what the double-click does on each list), which is something that's already on my list of future ideas, but until configuring the behavior is possible, it's best to have the same behavior for all lists (e.g double click to open/edit the element)

Rearranging watch entries was possible at one point, but it caused issues and didn't work properly and in the end I decided it was not worth the time investment at the moment. The breakpoint list at the moment is sortable, so being able to rearrange them manually would be a bit of an issue, as-is.

I'll take a look at the bugs and the simpler requests when I get a chance.
gzip
Posts: 23
Joined: Sat Mar 13, 2021 2:29 pm
Contact:

Re: Mesen - Emulator

Post by gzip »

nesrocks wrote: Mon Mar 13, 2023 7:42 pm3 - Bookmarks? I see that "Functions" almost works like bookmarks, but it doesn't allow me to mark any arbitrary address in the ROM.
Labels are very much like bookmarks. The only clunky part is that you have to go between Debugger and Memory Viewer to access them. Adding a Labels menu (or pane) in Memory Viewer might cover the use case, especially if you could type to find an entry like in the Debugger Labels pane.

Another use case for bookmarks would be in Tile Viewer. For games that use CHR-RAM (without compression) select Source: PRG ROM, go to the label/bookmark, make edits, then soft reset to see the changes in game. Zelda 1 is a good example where tiles data is strewn around the ROM. Bookmarks would probably also be useful for games with a lot of CHR-ROM. So if Memory Viewer got a Labels menu/pane then maybe Tile Viewer would as well.
gzip
Posts: 23
Joined: Sat Mar 13, 2021 2:29 pm
Contact:

Re: Mesen - Emulator

Post by gzip »

Sour wrote: Wed Mar 29, 2023 5:05 pmRearranging watch entries was possible at one point, but it caused issues and didn't work properly and in the end I decided it was not worth the time investment at the moment.
Actually I now notice that this is still in place in the context menu: Move Up and Move Down. (Build Mar 10, 2023)
Sour wrote: Wed Mar 29, 2023 5:05 pmThe breakpoint list at the moment is sortable, so being able to rearrange them manually would be a bit of an issue, as-is.
I didn't notice that they are already sortable. Would it be possible to move label to a separate column that is sortable? That would most likely meet my use case.
Last edited by gzip on Wed Mar 29, 2023 11:03 pm, edited 1 time in total.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

gzip wrote: Wed Mar 29, 2023 9:30 pmAdding a Labels menu (or pane) in Memory Viewer might cover the use case, especially if you could type to find an entry like in the Debugger Labels pane.
In case you didn't know, you can go to a specific label in the memory viewer fairly easily by using "go to all" (ctrl+comma by default) which pops up a search window that lets you type in any label and easily navigate to it. This is also available in the debugger window.
gzip wrote: Wed Mar 29, 2023 9:34 pm Would it be possible to move label to a separate column that is sortable?
A label column would probably end up being empty in a lot of typical use cases, though.. At the moment columns can't be reordered/hidden, either, so I need to be a bit careful here since this would take up more horizontal space, esp. when considering the other feature request to be able to give e.g a name/description to a breakpoint.
gzip
Posts: 23
Joined: Sat Mar 13, 2021 2:29 pm
Contact:

Re: Mesen - Emulator

Post by gzip »

Sour wrote: Wed Mar 29, 2023 9:46 pm
gzip wrote: Wed Mar 29, 2023 9:30 pmAdding a Labels menu (or pane) in Memory Viewer might cover the use case, especially if you could type to find an entry like in the Debugger Labels pane.
In case you didn't know, you can go to a specific label in the memory viewer fairly easily by using "go to all" (ctrl+comma by default) which pops up a search window that lets you type in any label and easily navigate to it. This is also available in the debugger window.
Ah, wasn't aware of this, very nice. That's pretty much bookmarks afaic. Maybe it should be renamed Go to Label then? Not sure if that would meet nesrocks' use case. Maybe just a consideration for Tile Viewer then.
Sour wrote: Wed Mar 29, 2023 9:46 pm
gzip wrote: Wed Mar 29, 2023 9:34 pm Would it be possible to move label to a separate column that is sortable?
A label column would probably end up being empty in a lot of typical use cases, though.. At the moment columns can't be reordered/hidden, either, so I need to be a bit careful here since this would take up more horizontal space, esp. when considering the other feature request to be able to give e.g a name/description to a breakpoint.
Any unused columns can at least be sized down. At the moment I have the Address column sized wide enough to see the label as well. It takes up more than half the pane width. Hide columns would be nice, particularly for the M column which I almost never use but often click on accident instead of E. In the older Mesen I had M hidden by sizing it all the way down. Can't do that anymore.
User avatar
Controllerhead
Posts: 314
Joined: Tue Nov 13, 2018 4:58 am
Location: $4016
Contact:

Re: Mesen - Emulator

Post by Controllerhead »

I am not sure how the SNES mouse behaves on real hardware, you may be right about your intrepretation, but, there are different hardware adjustments, and slow speed seems to advance 1 pixel at a time, medium 2, and fast 3 pixels on your emulator. If you are on fast speed, it is impossible to advance the cursor less than 3 pixels at a time. SNES9x seems to advance it much more gradually. You may be right about the real thing, but, i will have real hardware soon, is this really how it is?!

I have a retro game shop around me with a bunch of SNES mice lying around, i'm gonna pick a few of them soon, i am willing to pay the postage and whatever to send you a real one and get it right.

Here is the Nintendo test program i used to verify that, rename the .BIN to .SMC to get it chuggin:
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 »

PCE Final Soldier

Planet on title screen shakes. Just like emuhawk.

Does not shake on Mednafen, Ootake or real hardware.
Post Reply