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 »

Gilbert wrote: Fri Apr 14, 2023 9:04 pm He had conducted some live sessions debugging his own games (mainly DQ3 atm) and I think he's using MESEN for this, as the memory viewer is identical to Mesen's:
That's neat! It's definitely the old mesen - I saw the yellow "current byte" marker at one point in one of his videos.

007 wrote: Sat Apr 15, 2023 4:36 am When you select mesen2 dir there are still files left behind in the documents dir.
Thanks, I was aware of this, but don't really have a super simple way of avoiding this entirely. I'd have to delete the files the next time Mesen is launched, which isn't a great solution either.
007 wrote: Sun Apr 16, 2023 7:01 pm What does Mesen stand for?
Nothing too special - it's just "NES Em[ulator]" backwards (and it's also a word in Japanese that roughly translates to "gaze", which is why the icon is an eye)

jadasse wrote: Sun Apr 16, 2023 7:25 pm When it comes to playing NSFes, will seeking (moving a slider, or skipping seconds) be implemented?
Due to the nature of NSF files (and everything like them), seeking ahead is not simple, since it would require emulating the entire song ahead of time, keeping save states for e.g every second, and then loading those save states to "seek". So if you loaded a 4 minute NSF track, it'd still take a good 20-30 seconds (during which a CPU core would have to run at 100%) until you could seek to the end portion of the track, etc. I'm not saying never, but it's probably not something that'll be added anytime soon.
007
Posts: 89
Joined: Mon May 02, 2016 5:55 am

Re: Mesen - Emulator

Post by 007 »

@Sour

The files being there arent a big deal just didnt know if you knew this was happening, assumed you did but reported in case.


Thanks for explaining NES-EM!!!
007
Posts: 89
Joined: Mon May 02, 2016 5:55 am

Re: Mesen - Emulator

Post by 007 »

@Sour just saw tour game express update. The pce had two game express cards. I never used that much but im told that 1.0 games ran on 1.0 and 1.1 and that 1.1 games run on 1.1 only.

Mesen will currently accept 1.1 or 1.0 for a given game. Is there a way to make mesen have both and allow selection?

After some reading and trying the best one to go with is the 32k one sha1=014881a959e045e00f4db8f52955200865d40280

It apparently contains everything the 16k one does plus more.

Mesen currently will allow either
007
Posts: 89
Joined: Mon May 02, 2016 5:55 am

Re: Mesen - Emulator

Post by 007 »

for anyone looking to deploy Mesen2 to a computer and have the firmwares preset so that the user wont get prompted and possibly confused.

I only think of this as I have a few people I had to do this for.

FOR BS-X SATELLAVIEW

Name: BS-X.bin
Size: 1048576 bytes (1024 KiB)
SHA1: 604556b2e62860af18db5a77f2956ebc75450020

FOR FUKUTAKE STUDYBOX

Name: StudyBox.bin
Size: 262144 bytes (256 KiB)
SHA1: 3a5683e8c417a07c3252e1db4a054effdf75cb6e

FOR SNES

Name: dsp1.rom
Size: 8192 bytes (8 KiB)
SHA1: 188d471fefea71eb53f0ee7064697ff0971b1014

Name: dsp1b.rom
Size: 8192 bytes (8 KiB)
SHA1: 78b724811f5f18d8c67669d9390397eb1a47a5e2

Name: dsp2.rom
Size: 8192 bytes (8 KiB)
SHA1: 198c4b1c3bfc6d69e734c5957af3dbfa26238dfb

Name: dsp3.rom
Size: 8192 bytes (8 KiB)
SHA1: 558da7cb3bd3876a6ca693661ffc6c110e948cf9

Name: dsp4.rom
Size: 8192 bytes (8 KiB)
SHA1: af6478aecb6f1b67177e79c82ca04c56250a8c72

Name: st010.rom
Size: 53248 bytes (52 KiB)
SHA1: 6472828403de3589433a906e2c3f3d274c0ff008

Name: st011.rom
Size: 53248 bytes (52 KiB)
SHA1: fecbae2cec76c710422486baa186ffa7ca1cf925

FOR GAMEBOY VIA SNES (SUPER GAMEBOY 1 &2)

Name: SGB1.sfc
Size: 262144 bytes (256 KiB)
SHA1: 973e10840db683cf3faf61bd443090786b3a9f04

Name: SGB2.sfc
Size: 524288 bytes (512 KiB)
SHA1: e5b2922ca137051059e4269b236d07a22c07bc84

OPTIONAL GAMEBOY (IF NOT PRESENT ALTERNATE CODE WILL STILL RUN THE GAMES)

Name: dmg_boot.bin
Size: 256 bytes
SHA1: 4ed31ec6b0b175bb109c0eb5fd3d193da823339f

Name: cgb_boot.bin
Size: 2304 bytes (2 KiB)
SHA1: 1293d68bf9643bc4f36954c1e80e38f39864528d

Name: sgb_boot.bin
Size: 256 bytes
SHA1: aa2f50a77dfb4823da96ba99309085a3c6278515

Name: sgb2_boot.bin
Size: 256 bytes
SHA1: 93407ea10d2f30ab96a314d8eca44fe160aea734

FOR NES USING FDS
Name: disksys.rom
Size: 8192 bytes (8 KiB)
SHA1: e4e41472c454f928e53eb10e0509bf7d1146ecc1

For PCE CD
Name: [BIOS] Super CD-ROM System (Japan) (v3.0).pce
Size: 262144 bytes (256 KiB)
SHA1: 79f5ff55dd10187c7fd7b8daab0b3ffbd1f56a2c

For PCE Game Express CD
Name: [BIOS] Games Express CD Card (Japan).pce
Size: 32768 bytes (32 KiB)
SHA1: 014881a959e045e00f4db8f52955200865d40280
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Mesen - Emulator

Post by Dwedit »

Hello, I have a feature request for the debugger.

The ability to hit the Semicolon key ";", and get a single-line-only comment editor. Just a text box, an OK and Cancel button.
You could start typing a single-line comment, then hit Enter to press the OK button and confirm the comment.
If there is already an existing single-line comment, populate the text box with that text. Completely erasing the text and pressing OK would remove the comment.
If there is an existing multi-line comment, open the full label editor instead, and move focus to the comment text box.
Unusual case, if there is an existing multi-line comment, but all the leading or trailing lines are pure whitespace, trim it off and treat it as a single-line comment. The whitespace was probably added by mistake and we don't want it. If the dialog is cancelled, don't change the comment text.

Having a shortcut key to directly type comments then press Enter would make it a lot easier to read disassembled code and document it within the debugger.

Yes, I know there is already the the label editor (F2). The text cursor does not start out in the Comment field, and the Comment field is multi-line. There is no keyboard shortcut to confirm the comment and dismiss the dialog.

I had written this before for the old Mesen. Normally I'd write it myself, but I don't have MSVC 2022 installed at the moment, and I'm not familiar with AvaloniaUI.

Additionally, it seems that in Game Boy Mode, you can't use Go To to get to a specific ROM address, it's restricted to 4 characters, and restricted to banks that are currently mapped into memory.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - Emulator

Post by Pokun »

Gilbert wrote: Fri Apr 14, 2023 9:04 pm Sorry for potentially drifting a bit off-topic.

I recently accidentally stumbled across Naitou Kan's* Youtube channel.
He had conducted some live sessions debugging his own games (mainly DQ3 atm) and I think he's using MESEN for this, as the memory viewer is identical to Mesen's:
https://youtu.be/ABx4tpX9G7k?t=562
(I don't know whether other debugging emulators use a similar arrangement, but last I looked at it this shouldn't be FCEUX.)

If this is really the case, congratulations! :beer:

* Chief programmer of the original Dragon Quest III and IV, and later co-found Climax which produced games such as Shining and the Darkness and Land Stalker.
Heh, I must say that it's immensely satisfying to see a programmer from back in the day of two of the best games for the Famicom using the same tools as we are and playing his own game. If this is really Mesen it would be great!
007
Posts: 89
Joined: Mon May 02, 2016 5:55 am

Re: Mesen - Emulator

Post by 007 »

@sour, will you eventually port to libretro?
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

007 wrote: Tue Apr 18, 2023 3:57 amIs there a way to make mesen have both and allow selection?
At the moment, no. Improving bios/firmware management was discussed in this thread a while ago, but it'll probably be a while before I can get around to adding a UI for this. The current system should hopefully work fine for the majority of users as-is.
007 wrote: Tue Apr 18, 2023 8:21 pm @sour, will you eventually port to libretro?
Eventually, probably (though I'd rather not make any promises on any future functionality in general) Right now I have my hands full fixing issues with the current UI, adding missing features, improving accuracy, etc. Creating a libretro port for all the cores would take a while, and maintaining/fixing bugs in the libretro port would also be fairly time consuming, especially at first. So priority-wise, I probably won't have the time to create a libretro port for a while still.

Dwedit wrote: Tue Apr 18, 2023 1:50 pm The ability to hit the Semicolon key ";", and get a single-line-only comment editor. Just a text box, an OK and Cancel button.
This is available in the latest dev build - the shortcut is customizable and defaults to semi-colon. It also allows editing multi-line comments (use shift-enter to add a new line)
Dwedit wrote: Tue Apr 18, 2023 1:50 pm Additionally, it seems that in Game Boy Mode, you can't use Go To to get to a specific ROM address, it's restricted to 4 characters, and restricted to banks that are currently mapped into memory.
Are you talking about viewing the disassembly for parts of the ROM that aren't visible to the CPU at that moment? This isn't possible, no version of mesen has ever allowed this. It's something I looked into adding several years ago for the NES, but I quickly gave up the idea when I realized how much code would have to be changed to allow this to work. I'd have to check again with the new codebase, but it's likely that this isn't something that can be added easily.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Mesen - Emulator

Post by Dwedit »

It took about 12 hours after your post before the Windows version actually updated to include the semicolon feature, but a big "Thank you" for adding this in!

Here's a minor bug report. Place a small game window at the upper-left corner of your monitor. Open "Settings" from the menu.
The Settings Window is centered over the parent window, but by doing that, the window is placed partially offscreen, and you can't easily move the window because the title bar is off the screen.

Then here's a problem from AvaloniaUI that doesn't happen with normal Windows programs: You can't press Alt+Spacebar to open the System Menu. (The "System Menu" is what appears when you single-click the icon in the upper-left corner of a title bar). Can't press Menu Key either. There's one obscure way to open the system menu and successfully move the window: Mouseover a program in your taskbar until a preview window appears, then right click on the preview window. That will open the System Menu. From there, you can pick "Move" and move the window back on to the screen.

If you want to include the code for correcting a Window's position, it would need to handle extended desktops (multiple monitors), and figure out the Work Area rectangle of the monitor.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
007
Posts: 89
Joined: Mon May 02, 2016 5:55 am

Re: Mesen - Emulator

Post by 007 »

Windows 10 and 11 x64 leaving in full screen running attract mode windows screensaver is able to activate. Just reporting


Attract mode of a game not the front end.


Fixed in latest dev build*. Thanks!
Last edited by 007 on Sun Apr 23, 2023 7:11 am, edited 1 time in total.
User avatar
NovaSquirrel
Posts: 483
Joined: Fri Feb 27, 2009 2:35 pm
Location: Fort Wayne, Indiana
Contact:

Re: Mesen - Emulator

Post by NovaSquirrel »

Minor bug I noticed: when a SNES game uses mode 7 and another mode at the same time, and you have the Tilemap Viewer set to display one of the non-mode 7 scanlines, and the scroll overlay is enabled, Mesen will still show the visualizer for the mode 7 effect if it's not cut off by being outside this smaller tilemap. You can reproduce this easily with the dizworld demo.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

Dwedit wrote: Thu Apr 20, 2023 3:43 pm It took about 12 hours after your post before the Windows version actually updated to include the semicolon feature
That's odd. Maybe the service I'm using to put the latest dev build link in the readme sometimes has a bit of a delay, I'm not sure. The builds you can download directly from the "Actions" tab should definitely be up-to-date as soon as the build is done running, though.

I tweaked the window positioning logic to try to make sure the windows appear inside the current monitor's bounds. Didn't actually test with multiple monitors, but it should be working properly in that scenario too.

NovaSquirrel wrote: Sat Apr 22, 2023 8:23 pm Minor bug I noticed
Thanks! This is fixed.
jadasse
Posts: 7
Joined: Mon Apr 03, 2023 9:23 pm

Re: Mesen - Emulator

Post by jadasse »

Sour wrote: Sun Apr 16, 2023 7:40 pm Due to the nature of NSF files (and everything like them), seeking ahead is not simple, since it would require emulating the entire song ahead of time, keeping save states for e.g every second, and then loading those save states to "seek". So if you loaded a 4 minute NSF track, it'd still take a good 20-30 seconds (during which a CPU core would have to run at 100%) until you could seek to the end portion of the track, etc. I'm not saying never, but it's probably not something that'll be added anytime soon.
I knew seeking wouldn't be easy with NSFs, but I asked if it would be possible with NSFEs, not NSFs.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Mesen - Emulator

Post by Dwedit »

Mesen is not a performance focused emulator. Features like NSF seeking are common in high performance emulators, where they can run 5000+FPS without breaking a sweat.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
gzip
Posts: 23
Joined: Sat Mar 13, 2021 2:29 pm
Contact:

Re: Mesen - Emulator

Post by gzip »

Ran into a few sync issues in Tilemap Viewer > Edit Tiles > 1x2/4x4 etc. If I edit the nametable/tilemap in PPU Memory, the already open Edit Tiles window does not reflect that change. I have to close it and open it again. Similarly, if I edit a tile in another Tile Editor window the change is not reflected in the first window (until I draw another pixel and then it updates).

If you're in there fixing things can you also add one more option to that menu for editing 8x8? I did find myself having to shift around the 4x4 section I was editing quite a bit.
Sour wrote: Tue Apr 11, 2023 9:06 pmFor the freeze, try to see if you can reproduce it in the latest build - it might be related to the freeze that others were getting a while ago...
I'm happy to report that I haven't had any freezes since updating. :D :beer: I did have one isolated crash when restoring a save state but haven't seen it again since.
Post Reply