Mesen - Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Guest9584

Re: Mesen - Emulator

Post by Guest9584 »

tepples wrote: Fri Mar 22, 2024 6:05 am It might have something to do with the fact that Sour uses this topic as Mesen 2's issue tracker instead of using the issue tracker provided by GitHub.
That would be correct. Although, feel free to remove them if they do not belong here
theodude
Posts: 2
Joined: Tue Mar 26, 2024 3:33 pm

Re: Mesen - Emulator

Post by theodude »

So... I have been trying to get the Dev builds of Mesen2 working on my Windows machine for a while now, with no success.
I have gotten as far as a blank white window popping in for a second, then crashing immediately with this exception:

Code: Select all

Application: Mesen.exe
CoreCLR Version: 6.0.21.52210
.NET Version: 6.0.0
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException: Value cannot be null. (Parameter 'name')
   at Avalonia.Media.FontFamily..ctor(Uri baseUri, String name)
   at Avalonia.Media.Fonts.SystemFontCollection.GetEnumerator()+MoveNext()
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1 other)
   at System.Collections.Generic.HashSet`1..ctor(IEnumerable`1 collection, IEqualityComparer`1 comparer)
   at Mesen.Config.Configuration.GetValidFontFamily(String requestedFont, Boolean preferMonoFont)
   at Mesen.Config.PreferencesConfig.UpdateFonts()
   at Mesen.Config.PreferencesConfig.ApplyFontOptions()
   at Mesen.Config.PreferencesConfig.InitializeFontDefaults()
   at Mesen.App.OnFrameworkInitializationCompleted()
   at Avalonia.AppBuilder.SetupUnsafe()
   at Avalonia.AppBuilder.Setup()
   at Avalonia.AppBuilder.SetupWithLifetime(IApplicationLifetime lifetime)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, ShutdownMode shutdownMode)
   at Mesen.Program.Main(String[] args)
Sour
Posts: 893
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

Sorry for the late responses!

Fugus wrote: Sat Jan 13, 2024 2:33 pm If that isn't possible currently, would be a nice feature to include in a future update.

Also, it is possible to change out the crosshair? I looked but couldn't find one and the one that is there is pretty small.

Edit: Also the ability to have game saves sorted into subfolders based on the system it is for.
I don't think you can change the controllers via the command line at the moment, but I think it's probably something I could add without too much trouble, I'll add it to the todo list. I'd have to look into changing the crosshair, at the moment it just uses the crosshair system mouse icon, so it's not something I've picked specifically. I'd have to look if it's possible to easily change this (and if it's doable in a cross-platform way, too.)

I agree about having subfolders to split the data for each system. Playing 2 different games with the same filename on 2 different consoles would currently overwrite the save data and save states, which isn't great.

Colmines92 wrote: Mon Jan 15, 2024 12:55 pm I think it would be a good addition to Mesen2 to implement a lua command that allows loading a custom font to draw texts on the screen, and also display accents and diacritical marks characters as well.
Unfortunately, this essentially involves being able to parse font files, which is pretty complex, and then rendering them would probably also be pretty slow. At the moment the scripts supports ascii characters and japanese. Support for more characters (within reason) could be added if needed, but finding fonts that can be integrated easily (in terms of both licensing and simplicity) is not always simple.

KuroRaiden wrote: Mon Jan 29, 2024 8:32 am Would it be possible to implement GGPO rollback netcode
The netplay in Mesen has been pretty much unchanged since I first implemented it in ~2015. Rollback netplay has been requested before, and it might be something I add eventually, but it's unlikely to be added anytime soon.

Chipsum wrote: Sat Mar 23, 2024 8:04 pm That would be correct. Although, feel free to remove them if they do not belong here
The icon in v2 was drawn by someone else in the community a few years ago (FrankenGraphics) and I personally like the design more than the old versions. Thanks for the spending to make these, but I prefer to keep the current icon for now, sorry!

theodude wrote: Tue Mar 26, 2024 3:47 pm So... I have been trying to get the Dev builds of Mesen2 working on my Windows machine for a while now, with no success.
Thanks for the report! It sounds like there might be a font installed on your PC that's somehow causing a crash in Avalonia (the UI toolkit mesen used). I've committed a potential fix to try to work around the issue, but I'm not sure if it'll actually fix the problem, or just crash somewhere else. Try grabbing the latest dev build again and see if it helps (check the about window to make sure the build is dated today after redownloading it, sometimes the links seem to take a little bit to update to the latest build properly)
theodude
Posts: 2
Joined: Tue Mar 26, 2024 3:33 pm

Re: Mesen - Emulator

Post by theodude »

Thanks for the report! It sounds like there might be a font installed on your PC that's somehow causing a crash in Avalonia (the UI toolkit mesen used). I've committed a potential fix to try to work around the issue, but I'm not sure if it'll actually fix the problem, or just crash somewhere else. Try grabbing the latest dev build again and see if it helps (check the about window to make sure the build is dated today after redownloading it, sometimes the links seem to take a little bit to update to the latest build properly)
That fixed it, thank you!
Sour
Posts: 893
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

The latest dev build adds GBA support. It should (hopefully) be pretty stable and the accuracy should be fairly decent.

It only supports the base system for now, so things like the RTC, solar sensor, the e-reader, etc. aren't supported yet.
Debugger-wise, it has the same tools as all the other cores, except there's no assembler (yet)

It's only been tested by a few people so far, so there's definitely going to be some bugs left - if you find any, please let me know.
Pokun
Posts: 2714
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - Emulator

Post by Pokun »

Looks very good so far, even Famicom Mini games works although they are a bit flickery. I'm looking forward to support for e-reader, link cables etc.

There is one thing I can't find when running a Game Boy game and that is a viewer for the 16 byte Waveform RAM used for the Sound 3 wavetable channel, and I can't find it when running a GBA game either, which is supposed to have doubled the Waveform RAM in GBA mode.
Since it is part of the CPU address space on the GB it can still be viewed in the memory viewer by looking in CPU Memory at $FF30 to $FF3F, but I have no idea where the corresponding 32 byte Waveform RAM can be seen on GBA in GBA mode which uses another address space.
bklD
Posts: 37
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

Sour wrote: Sat Mar 30, 2024 5:52 am It's only been tested by a few people so far, so there's definitely going to be some bugs left - if you find any, please let me know.
It is working great already! One thing I noticed is that when you play Mario & Luigi - Superstar Saga (Europe) (En,Fr,De,Es,It) and you can open the menu with SELECT (on Bowsers ship pretty much at the beginning), there is a crackling sound. I can't hear this with mgba (see video).

https://streamable.com/48oew4

It's really fantastic that you're supporting GBA. Thank you! :D
Guest9584

Re: Mesen - Emulator

Post by Guest9584 »

Sour wrote: Wed Mar 27, 2024 6:22 am The icon in v2 was drawn by someone else in the community a few years ago (FrankenGraphics) and I personally like the design more than the old versions. Thanks for the spending to make these, but I prefer to keep the current icon for now, sorry!
I know, I kind of wanted to pass along the idea of adding more colors to the icon to indicate that Mesen2 has evolved into a multi-system emulator.
The colors also serve to symbolize the letter X, which stands for the variable X = unknown or systems emulated.
I realize that everyone is probably wondering what the stupid concept is, and because I am obviously stupid, I just wanted to share.
Warm regards, M.Bibaud. :D
Veraxity
Posts: 3
Joined: Thu Mar 28, 2024 11:24 am

Re: Mesen - Emulator

Post by Veraxity »

Mesen was a fine emulator when I tried it but one problem I had with it was that I couldn't use keyboard input instead of controller input so In using FCEUX instead cuz I don't want to spend 10€+Tax/Shipping on a controller, so if that is a feature that is missing I suggest adding it. (I'm Finnish and the best I could find for a reasonable price was a remanufactured one sold on a general online store: not a major one btw) :idea: :roll: :?:
User avatar
tokumaru
Posts: 12434
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Mesen - Emulator

Post by tokumaru »

I don't know what's happening on your end, but Mesen most definitely can be used with a keyboard, as that's how I've always used it.
Sour
Posts: 893
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

Pokun wrote: Sat Mar 30, 2024 1:35 pm Since it is part of the CPU address space on the GB it can still be viewed in the memory viewer by looking in CPU Memory at $FF30 to $FF3F, but I have no idea where the corresponding 32 byte Waveform RAM can be seen on GBA in GBA mode which uses another address space.
The wave ram is at 4000090-400009F, but there are 2 banks and only one is visible to the CPU at a time, so you can't see all of it at once. I have a general todo item to add a way to display this kind of wave data in general (e.g maybe in the register viewer somehow), since there's a number of things that use them (e.g FDS, GB, etc.)

bklD wrote: Sat Mar 30, 2024 2:43 pm One thing I noticed is that when you play Mario & Luigi - Superstar Saga (Europe) (En,Fr,De,Es,It) and you can open the menu with SELECT (on Bowsers ship pretty much at the beginning), there is a crackling sound. I can't hear this with mgba (see video).
Thanks for the report - I haven't looked into it yet, but will once I get a chance.

Veraxity wrote: Tue Apr 02, 2024 6:49 am one problem I had with it was that I couldn't use keyboard input instead of controller input
I'm not sure what you've tried, but like tokumaru said, Mesen does support keyboard input. I've never had anybody else say that keyboard input did not work for them until now. Have you tried rebinding the keys for either controllers or shortcuts? If so, does it not work? If it doesn't work, what does it do when you press a key while trying to rebind them? Nothing? What OS are you using?
User avatar
dink
Posts: 161
Joined: Sun Jan 12, 2020 8:42 pm

Re: Mesen - Emulator

Post by dink »

Hi, I have a question regarding Color Math using Mode 5 or 6:
Is it possible, and, are there any tests available for this? :)

I heard its possible to use fixed color w/Color Math @ Mode 5,6, but .. after searching for ages, I can't get a solid answer. I noticed in Mesen2's SNES PPU, it does do color math with the main screen to subscreen and then the subscreen to main, what kinda tests or game uses this mode? Or info/wiki to document the proper behavior? I'm very curious! :)

best regards,
- dink
Pokun
Posts: 2714
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - Emulator

Post by Pokun »

Sour wrote: Thu Apr 04, 2024 1:59 am The wave ram is at 4000090-400009F, but there are 2 banks and only one is visible to the CPU at a time, so you can't see all of it at once. I have a general todo item to add a way to display this kind of wave data in general (e.g maybe in the register viewer somehow), since there's a number of things that use them (e.g FDS, GB, etc.)
I see thanks.
So like a waveform visualizer to go along with a numeric display? That would be pretty cool for the Namco 163 and PC Engine wavetable channels too. :)


Veraxity wrote: Tue Apr 02, 2024 6:49 am Mesen was a fine emulator when I tried it but one problem I had with it was that I couldn't use keyboard input instead of controller input so In using FCEUX instead cuz I don't want to spend 10€+Tax/Shipping on a controller, so if that is a feature that is missing I suggest adding it. (I'm Finnish and the best I could find for a reasonable price was a remanufactured one sold on a general online store: not a major one btw) :idea: :roll: :?:
Mesen even supports mapping multiple keyboard and joystick mappings to each controller, very useful.
I'd advise against getting any cheap USB controller they are always crap, you may as well throw your money in a lake. IBM PC joypads has always been utter crap until 8bitdo started to make quality controllers. Before I always used various adapters with real controllers from various consoles like SNES. New console controllers like Switch Controller Pro can also connect via bluetooth without a special adapter (as long as you have a bluetooth card), but you may need a special driver instead.
I recommend one of the 8bitdo controllers though, they should work with anything using d-input or x-input (like Mesen).
creaothceann
Posts: 628
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: Mesen - Emulator

Post by creaothceann »

dink wrote: Thu Apr 04, 2024 9:21 am I heard its possible to use fixed color w/Color Math @ Mode 5,6, but .. after searching for ages, I can't get a solid answer
https://problemkaputt.de/fullsnes.htm#snesppucolormath wrote: Hires and Pseudo 3-Layer Math
In Hires modes (BG Mode 5,6 and Pseudo Hires via SETINI), the main/sub screen pixels are rendered as half-pixels of the high-resolution image. The TV picture is so blurry, that the result will look quite similar to Color Addition with Div2 - some games (Jurassic Park and Kirby's Dream Land 3) are actually using it for that purpose; the advantage is that one can additionally apply COLDATA addition to (both) main/sub-screen layers, ie. the result looks like "(main+sub)/2+coldata".
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
User avatar
dink
Posts: 161
Joined: Sun Jan 12, 2020 8:42 pm

Re: Mesen - Emulator

Post by dink »

creaothceann wrote: Thu Apr 04, 2024 2:39 pm
https://problemkaputt.de/fullsnes.htm#snesppucolormath wrote: Hires and Pseudo 3-Layer Math
In Hires modes (BG Mode 5,6 and Pseudo Hires via SETINI), the main/sub screen pixels are rendered as half-pixels of the high-resolution image. The TV picture is so blurry, that the result will look quite similar to Color Addition with Div2 - some games (Jurassic Park and Kirby's Dream Land 3) are actually using it for that purpose; the advantage is that one can additionally apply COLDATA addition to (both) main/sub-screen layers, ie. the result looks like "(main+sub)/2+coldata".
Thanks! :)

Last question, what causes the partial 'B', sprite #127 @ 0,0 to not be displayed on Might Morphin Power Rangers - The Movie's intro? In the PPU reg's, I don't see a clip window enabled.

best regards,
- dink
Attachments
mmprm.png
Post Reply