Mesen - Emulator
Moderator: Moderators
Mesen - Emulator
As some of you already know, I've been working on an updated version of Mesen for a pretty long time, and it's mostly ready.
This rewrites the UI completely, among other things. The emulation code is mostly the same as before, with minor improvements, refactoring and some optimizations. The new UI runs on .NET 6 and should run a lot more smoothly than the old WinForms UI, especially on Linux.
This also merges both Mesen and Mesen-S into a single emulator, which supports the NES, SNES, GB(C) and PC Engine.
PC Engine emulation was added and CD-ROM games are also supported. Some PCE emulation issues still exist, but it should generally be pretty decent.
Debug tools are essentially identical for all consoles and for the most part are similar to what was available in Mesen/Mesen-S. Everything that Mesen/Mesen-S supported should be available (excluding some fairly minor features/options), along with some new features and improvements.
This is still a preview and not quite finished (although all the features I intended to include in the first release have been implemented)
Please don't expect subsequent updates to be fully compatible with this build (e.g your settings might be lost, save states/movies might not be compatible, etc.)
On Windows, you'll need to install the .NET 6 Runtime (and I don't think it's been tested on anything other than Windows 10)
On Linux and macOS, you'll need the .NET 6 runtime and SDL2. (Mono is no longer used/needed, just launch the executable directly after installing .NET 6)
Code is here: https://www.github.com/SourMesen/Mesen2
Dev builds for Windows/Linux are linked in the readme: https://github.com/SourMesen/Mesen2#development-builds
(for macOS, you'll need to build it yourself)
Please report issues here if (when) you find any.
This has only been tested by a handful of people over the last few months, and there are definitely features/options that haven't been tested since they've been implemented, so I fully expect there will be some fairly silly bugs found once more people use it.
To stay focused on completing what's left (and not get 100 issues about missing mappers in the NES core in the meantime), the issues tab on the repository is disabled, for now.
For the same reason, I'm not going to be accepting/reviewing any pull requests, either.
The main goal at the moment is to fix bugs/crashes in the new version. Any feedback about the UI is welcome, too.
Emulation accuracy fixes will have to wait until later down the road, unless they're regressions vs the old versions or very simple to fix.
Feature/change requests will also have to wait (unless they're obvious improvements and easy to implement)
This rewrites the UI completely, among other things. The emulation code is mostly the same as before, with minor improvements, refactoring and some optimizations. The new UI runs on .NET 6 and should run a lot more smoothly than the old WinForms UI, especially on Linux.
This also merges both Mesen and Mesen-S into a single emulator, which supports the NES, SNES, GB(C) and PC Engine.
PC Engine emulation was added and CD-ROM games are also supported. Some PCE emulation issues still exist, but it should generally be pretty decent.
Debug tools are essentially identical for all consoles and for the most part are similar to what was available in Mesen/Mesen-S. Everything that Mesen/Mesen-S supported should be available (excluding some fairly minor features/options), along with some new features and improvements.
This is still a preview and not quite finished (although all the features I intended to include in the first release have been implemented)
Please don't expect subsequent updates to be fully compatible with this build (e.g your settings might be lost, save states/movies might not be compatible, etc.)
On Windows, you'll need to install the .NET 6 Runtime (and I don't think it's been tested on anything other than Windows 10)
On Linux and macOS, you'll need the .NET 6 runtime and SDL2. (Mono is no longer used/needed, just launch the executable directly after installing .NET 6)
Code is here: https://www.github.com/SourMesen/Mesen2
Dev builds for Windows/Linux are linked in the readme: https://github.com/SourMesen/Mesen2#development-builds
(for macOS, you'll need to build it yourself)
Please report issues here if (when) you find any.
This has only been tested by a handful of people over the last few months, and there are definitely features/options that haven't been tested since they've been implemented, so I fully expect there will be some fairly silly bugs found once more people use it.
To stay focused on completing what's left (and not get 100 issues about missing mappers in the NES core in the meantime), the issues tab on the repository is disabled, for now.
For the same reason, I'm not going to be accepting/reviewing any pull requests, either.
The main goal at the moment is to fix bugs/crashes in the new version. Any feedback about the UI is welcome, too.
Emulation accuracy fixes will have to wait until later down the road, unless they're regressions vs the old versions or very simple to fix.
Feature/change requests will also have to wait (unless they're obvious improvements and easy to implement)
Last edited by Sour on Thu Feb 02, 2023 9:56 pm, edited 1 time in total.
Re: Mesen - Emulator
This.Is.Just.Great!Sour wrote: ↑Wed Jan 25, 2023 8:08 pm This also merges both Mesen and Mesen-S into a single emulator, which supports the NES, SNES, GB(C) and PC Engine.
PC Engine emulation was added and CD-ROM games are also supported. Some PCE emulation issues still exist, but it should generally be pretty decent.
Will download it now.
Re: Mesen - Emulator
Can't wait to try it! Thanks for your awesome work, man!
- Vectrex2809
- Posts: 102
- Joined: Mon Jul 14, 2014 6:05 am
- Location: Tokyo, Japan
Re: Mesen - Emulator
PC Engine on a familiar UI?! THANK YOU SO MUCH!!! Looks like it's finally time to give PCEdev a shot
Re: Mesen - Emulator
As Microsoft used to tell the Firefox team: "Congratulations on shipping!"
Things I noticed that are improvements:
1. MUCH faster than Winforms-based Mesen.
Things I noticed that may need investigation:
1. Help > Report a bug points to a 404 (you may want to change this once a new site goes live)
2. NES: Assigning a key to microphone and pressing that key doesn't trigger the microphone (ROM: 240p Test Suite pre-0.23 > Input test > FC controllers & mic)
3. GB: Joypad interrupt on Super Game Boy isn't issued at all (ROM: Telling LYs)
4. GB: Joypad interrupt on Game Boy and Game Boy Color is always issued on the same scanline (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)
7. GB: Possible inconsistency with initial value of NR52 ($FF26) across power cycle and reload ROM, which I may characterize later (this can affect tuning in LSDJ)
8. GB: Load ROM in GB mode then switch to SGB mode and Reset, Power Cycle, or Reload ROM, and occasionally the ding is heard and the screen doesn't appear
Things I noticed that are improvements:
1. MUCH faster than Winforms-based Mesen.
Things I noticed that may need investigation:
1. Help > Report a bug points to a 404 (you may want to change this once a new site goes live)
2. NES: Assigning a key to microphone and pressing that key doesn't trigger the microphone (ROM: 240p Test Suite pre-0.23 > Input test > FC controllers & mic)
3. GB: Joypad interrupt on Super Game Boy isn't issued at all (ROM: Telling LYs)
4. GB: Joypad interrupt on Game Boy and Game Boy Color is always issued on the same scanline (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)
7. GB: Possible inconsistency with initial value of NR52 ($FF26) across power cycle and reload ROM, which I may characterize later (this can affect tuning in LSDJ)
8. GB: Load ROM in GB mode then switch to SGB mode and Reset, Power Cycle, or Reload ROM, and occasionally the ding is heard and the screen doesn't appear
Re: Mesen - Emulator
Great news. It's also nice to see another take on emulating the PCE.
- jeffythedragonslayer
- Posts: 344
- Joined: Thu Dec 09, 2021 12:29 pm
Re: Mesen - Emulator
I do have source view setup now in Mesen2, and I found the line responsible for not allowing me to set breakpoints in it: SourceViewView.axaml.cs:86
Not sure why these are null...
Code: Select all
IsEnabled = () => ActionLocation.RelAddress != null || ActionLocation.AbsAddress != null,
- jeffythedragonslayer
- Posts: 344
- Joined: Thu Dec 09, 2021 12:29 pm
Re: Mesen - Emulator
I fixed most of my issues with both the Disassembly and Source views. I can now see my comments, labels, variable names, set breakpoints - all in both. This block in UI\Debugger\Integration\DbgImporter.cs turned out to be the culprit:
It thought my stuff was in ARAM this whole time! When I hacked my .dbg file to make the segs be type=r instead of type=rw, things got a lot better.
Code: Select all
if(row.Contains("type=rw")) {
//TODOv2 fix this
//Assume a RW segment inside the .sfc file is SPC code
isRam = true;
memType = MemoryType.SpcRam;
}
- Reaper_Man
- Posts: 51
- Joined: Sat Jun 17, 2006 2:31 pm
- Location: Bogota, Colombia
Re: Mesen - Emulator
Rise from your grave...
This is excellent news! I'm looking forward to giving it a spin later.did you ever figure out what was causing the AVI desync issues when rewinding or loading a savestate while recording? That's probably one of the first things I'm going to test.
EDIT: bug seems to still exist, unfortunately. Video can be found here (ZMBV codec). Savestate is loaded 60 times and you can hear that the sound is a second or so behind the video.
Re: Mesen - Emulator
Great to hear about the updates. Do you have any long term plans on the enhancement pack (or HD Pack) side of things? When you mentioned features would have to wait, I assume enhancement packs would fall under that category. I know there are a couple of packs that have been in development for a year or two now that have relied on the mkwong98 fork. That variant added a few features such as a pack loading notification. It also added an "addition" condition that allows pack authors to add artwork beyond native sprite boxes. It's been crucial for a pack I have been working on for quite a while.
Re: Mesen - Emulator
Fantastic to have you back!
I remember you did Game Boy as part of Super Game Boy in Mesen-S, but to think PC-Engine would also be emulated and have the same great debugging tools is absolutely marvelous! It runs some of my homebrew that didn't run correctly on older emulators, so I can tell it's already more accurate than Magic Engine at least. Good job! I can see it stealing Mednafen's place as the best PCE emulator for both developers and gamers some time in the future.
I remember you did Game Boy as part of Super Game Boy in Mesen-S, but to think PC-Engine would also be emulated and have the same great debugging tools is absolutely marvelous! It runs some of my homebrew that didn't run correctly on older emulators, so I can tell it's already more accurate than Magic Engine at least. Good job! I can see it stealing Mednafen's place as the best PCE emulator for both developers and gamers some time in the future.
Re: Mesen - Emulator
It's fantastic to see a new release. Since nobody else has called it out yet, I think the Mode 7 perspective visualization is really neat, nice work! Mesen was the sole thing making me stay on Windows (all the other WIndows-only programs I use can run acceptably in a VM), so I'll definitely be checking out the Linux version.
Re: Mesen - Emulator
I just tested out Game Boy emulation, my basic test cases were Prehistorik Man and GBC games which used high color modes, and they worked perfectly. Demotronic refuses to run though. (No Boy! No Demo!)
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Re: Mesen - Emulator
Thanks for all the feedback!
Thanks, 2 & 3 should be fixed with the latest code. 4-7 will probably have to wait for now.
I just did some changes that should fix the desync when loading a state, and another desync that occurred when pausing/resuming the emulation. Rewind is tougher and I haven't been able to figure out where the extra frames are coming from exactly, this will most likely have to wait until later.Reaper_Man wrote: ↑Thu Jan 26, 2023 10:58 amdid you ever figure out what was causing the AVI desync issues when rewinding or loading a savestate while recording? That's probably one of the first things I'm going to test.
I don't really have long term plans in general, period. :p More seriously though, I'm not familiar with most of the changes that were done on forks, I know some changes were done to hd packs, but not what they were exactly. Assuming nothing was done that impacted a lot of code outside of the hd pack stuff and that it doesn't have negative impacts on performance, it should probably be ok to merge them in eventually, but it'll probably be a little while until I can take a proper look.
This is entirely rainwarrior's idea, I just implemented essentially the same thing after he made a proof of concept for it on a fork of Mesen-S :p
Thanks, I'll add it to my list of things to look at. Game boy emulation is something I added to Mesen-S ~3 years ago just before I stopped working on it, so there's still a fair amount of accuracy issues with it that need to be fixed.
Re: Mesen - Emulator
Sour, our lord and savior Been using mesen-s extensively for digging in snes games. Its debugging capabilities have definitely made me spoiled lol, going over to mame feels so clunky, and let's not even get started on mega drive debugging! What a nightmare.
I'll start using mesen2 and see how it goes!
Edit: The added memory search is much appreciated! This finally obsoletes the need for having bizhawk on the side!
I'll start using mesen2 and see how it goes!
Edit: The added memory search is much appreciated! This finally obsoletes the need for having bizhawk on the side!