Mesen - NES Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: Mesen - NES Emulator

Post by unregistered »

:oops: Just loaded our game in .139 and the "lines" aren't present and all of the lua text on the screen is crystal clear. So, obviously, you had nothing to do with the changes that I've experienced. Changes I made before trying .164: I just changed a few outdated comments in the code and added the new mesen into the folder (and renamed the newest mesen I have "mesen.exe" and renamed the .139 mesen back to "MesenDevWin-0.9.5.139.exe"). God blessed our game again!! :mrgreen: Sorry for my bogus report to you Sour. Glad you are going to create 0.9.6. :)
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

No worries. FYI, the issue with the Lua text being unclear is usually caused by using blargg's NTSC filter. Due to the way things are internally, I have no simple way of making the text appear properly when using that one particular filter at the moment. I'm guessing that's probably what was causing issues on your end.
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: Mesen - NES Emulator

Post by Banshaku »

I finished to install Sierra/High sierra on a different partition and here's the result of my test

[Sierra]
- Windows version
- works but screen scaling issue
- debugger is sluggish
- SDL version (from link in thread)
- work with screen normal size, refresh seems sluggish
- debugger is slugish

[High sierra]
- Windows version
- works but screen scaling issue
- debugger seems more sluggish than sierra
- SDL version (from link in thread)
- work with screen normal size, refresh seems sluggish
- debugger seems more sluggish than sierra

The good news is that is it working on high sierra with wine 3.0.2, dotnet45 but it is slow. The bad news for me is that I cannot make it work on my main partition and I don't know why :lol:

I will keep both partition for now and can test some builds to see if it becomes faster. For now, in it current state, compared to when I'm using it on a latest machine with linux or a 10 years old pc on Windows, it's too slow to be usable. Only testing different build will allows us to figure out performance issues.

This ends my report.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

Thanks for taking the time to check all of this. Good to know it actually runs on your new installation, hopefully you can figure out what's causing it to crash on your regular setup.

I can reproduce essentially the same performance issues on Linux when I run the Windows SDL build using Wine, so that at least gives me a relatively decent way to figure out what's causing the slowdowns through trial and error. Is it mostly just the debugger tools that are slow on your end? I seem to recall the regular configuration dialogs working relatively well under Wine.
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: Mesen - NES Emulator

Post by Banshaku »

The normal version, since the scaling is broken, it is hard to judge if the speed is normal but on the SDL version, even though it shows 60 fps, the refresh is not smooth compared to other platform. If I can get the win version to work properly then I could confirm if the same problem occur.

I remember that you mentioned a parameter to start the emulator but I do not think it was for fixing that issue, isn't it? I cannot find it back in this thread (or was it in another thread).
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

Looking back at the code for the windows SDL version, I had set it to use software rendering because hardware rendering refused to work, but that might have been specific to my macOS VM. I'll have to try setting it to hardware rendering again to see. Although arguably it might be easier to try to fix the aspect ratio under Wine with the DX11 build (since it would be much easier for me in terms of code/maintenance)
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: Mesen - NES Emulator

Post by Banshaku »

I just don't know why it does that either on wine. I think on my linux pc I used mono with with the windows version and everything was fine. I was not able to run mono properly on the mac so I may try again since the performance was better on linux so hopefully I may see the same thing on the mac performance wise.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

I just released 0.9.6 earlier today. There are over 300 commits in this release, which probably makes it the largest release since 0.1.0 in terms of commits (so it's a bit hard to give a full list of everything that's been done). Debugger-wise, there's been a lot of small additions/improvements/bugfixes in a lot of the debugging tools. Linux-wise, this build should run the emulation ~20-30% faster than the official 0.9.5 release thanks to PGO, and a lot of debugger UI issues have been fixed, too.

Also, I've recently discovered that Mono has a tool to produce a native Linux binary from a .NET executable and it actually seems to work properly as far as Mesen goes. This means it would be possible to release a Linux-only 64-bit build that's only about 10-15mb in size and does not require Mono to be installed at all (its only dependency would be SDL2), which would make using Mesen easier for first time users (and would avoid forcing people to download the entire mono package)
Banshaku wrote:I think on my linux pc I used mono with with the windows version and everything was fine
The official build actually contains both windows & linux binaries - so running it on Mono on Linux will run the native Linux SDL build, rather than the DX11 build. The scaling issue is most likely a DX11 issue w/ Wine, but maybe I can find a workaround for it.
Mono Winforms on macOS is horribly broken as far as I can tell, so it's probably not worth the effort trying to get it to work on mono on macOS at the moment (until winforms support is fixed on macOS, if ever)
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: Mesen - NES Emulator

Post by Banshaku »

I see. I will try the new build on linux and see how fast it is.

As for Mono on mac, yep, they say it when you start an app about carbon version, 32 bits etc so I tried on both sierra version and it fails in both cases. I'm only using mac os because of bash and to backup the phone so I'm starting to get less and less interested in the os now that I'm not using it for work. I tried to remove homebrew, zap the wine folder, reinstall everything related and still doesn't work. I'm not in the mood to reinstall the os for now so I think I will just keep an extra partition to give feedback on how the latest version works on mac.

I could install linux on another partition but the keyboard layout is a pain, some part doesn't work (the camera wasn't years ago, maybe it works now) so unless I always use with an external keyboard, I don't know how comfortable it would be. But this is my personal problem, not really mesen related :lol:

It's butter smooth on and old core 2 duo so I may start to use windows with the linux subsystem for now.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Mesen - NES Emulator

Post by rainwarrior »

Crash report:

Open N163TEST.NES from this post: https://forums.nesdev.com/viewtopic.php ... 11#p222711

After it starts running, go to Debug menu and open Debugger. Will crash immediately.

A screenshot of the crash window is attached. After clicking OK Mesen is unresponsive and has to be force closed.
Attachments
N163TEST_debugger_crash.png
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

Thanks - this is because the NES 2.0 header gives it 128bytes of work ram, and Mesen only has 256-byte granularity on these sort of things. This ends up mapping null pointers to a section of ram and causes a crash in the debugger.

After changing the header to say no work ram (I thought a discussion a long time ago had concluded that the internal RAM for this mapper shouldn't be counted in the header? Unsure.), it boots, but then the ROM assumes that code will be available at $8000 without initializing the PRG banking register for it, so Mesen leaves that portion as open bus and doesn't boot properly. I guess I could change this to select random banks instead of open bus, but unless that test contains the same 8kb bank copied 4 times over, it won't work reliably still.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Mesen - NES Emulator

Post by tepples »

Sour wrote:it boots, but then the ROM assumes that code will be available at $8000 without initializing the PRG banking register for it, so Mesen leaves that portion as open bus and doesn't boot properly. I guess I could change this to select random banks instead of open bus
How do you boot games using mapper 66 (GNROM), 11 (Color Dreams), 34 (BNROM), or 7 (AOROM)?
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

Those will select a random bank and boot from there - but then that makes sense for those mappers. I guess you could argue that someone using the Namco 163 could set the reset vector to $8000 and copy the reset code to all banks (e.g like this rom most likely does), but in practice this potentially wastes a lot of PRG space, so I imagine nobody ever did this back then.

I usually kept these kinds of scenarios as open bus where possible to avoid homebrew devs forgetting to initialize the banking registers (or relying on a power on state that doesn't exist on hardware), but I guess I could just make them random instead.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Mesen - NES Emulator

Post by rainwarrior »

Sour wrote:I usually kept these kinds of scenarios as open bus where possible to avoid homebrew devs forgetting to initialize the banking registers (or relying on a power on state that doesn't exist on hardware), but I guess I could just make them random instead.
I thought it was already randomized if you used the Emulation > Advanced > "Randomize power-on state for mappers" option?
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

rainwarrior wrote:I thought it was already randomized if you used the Emulation > Advanced > "Randomize power-on state for mappers" option?
The current implementation only does it for some (~20) mappers - but now that I think about it, I could easily randomize all the banks that are currently left as open bus (whether that option is enabled or not). That would likely cover the vast majority of mappers (at least those likely to be used in homebrew dev or rom hacks), would technically be more accurate than leaving it as open bus, and would allow cases like this test rom to work properly.
Post Reply