Mesen - NES Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
za909
Posts: 206
Joined: Fri Jan 24, 2014 9:05 am
Location: Hungary

Re: Mesen - NES Emulator

Post by za909 » Mon May 04, 2020 11:28 pm

Sour wrote:
Sun May 03, 2020 4:39 pm
za909 wrote:
Sun May 03, 2020 4:24 pm
CHR-ROM is used instead of RAM
This is most likely the cause - Mesen defaults to using the NINA-001 mapper (which is also mapper 34) when there is CHR ROM in the cart (because all commercial BNROM games use CHR RAM.)

You can force mapper 34 to use BNROM by using a NES 2.0 header and specifying a submapper:
http://wiki.nesdev.com/w/index.php/NES_ ... F_NINA-001
Thank you! I have "upgraded" the header to 2.0 and it works perfectly. This emulator has already allowed me to see issues that I would've never known existed in my projects (like incorrect metasprite definitions resulting in extra sprites that were hidden behind other sprites, which the sprite viewer allowed me to discover) or IRQ congestion from OAM DMA... I am in awe and seriously considering supporting this emulator.

Paul_Atreides
Posts: 9
Joined: Mon Apr 13, 2020 5:24 am

Re: Mesen - NES Emulator

Post by Paul_Atreides » Tue May 05, 2020 11:03 pm

This is a very general question and I'd appreciate it if someone took the time to answer.

I'm working on an emulator core and can already correctly emulate some mapper0 games.
I'm using OLC's pixel game engine for rendering the frames, but want to progress to something more powerful.

I want to integrate the emulator's video in a GUI which allows menu items, buttons, and your typical GUI elements. I can see MESEN uses C# with WindowsForms for that.

My question: what technology / library is used by MESEN to render the game's frames?
How's this integrated in the WindowsForms main window (frmMain.cs)?

I came across the SDL library, but it's complicated to integrate into good-looking GUIs, and you have to use a number of alternative solutions, not WFs.

Sour
Posts: 796
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour » Wed May 06, 2020 6:49 pm

za909 wrote:
Mon May 04, 2020 11:28 pm
Thank you! I have "upgraded" the header to 2.0 and it works perfectly.
No problem, happy to hear you got it working!
Paul_Atreides wrote:
Tue May 05, 2020 11:03 pm
what technology / library is used by MESEN to render the game's frames?
On Windows, Mesen uses DirectX11, on Linux, it uses SDL2. Any graphic library should just let you specify any control as its rendering "window", but I don't really have too much experience there. I wouldn't necessarily recommend going the DX11 route - it's a lot more code to get something on the screen compared to SDL2, in my experience.

User avatar
Jarhmander
Formerly ~J-@D!~
Posts: 495
Joined: Sun Mar 12, 2006 12:36 am
Location: Rive nord de Montréal

Re: Mesen - NES Emulator

Post by Jarhmander » Thu May 07, 2020 4:50 am

Simple question: why is SDL not used on Windows? Is it because it's harder to integrate into window controls? I ask because SDL should be usable on Windows and there would be no need to maintain 2 different rendering codes.
((λ (x) (x x)) (λ (x) (x x)))

Sour
Posts: 796
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour » Thu May 07, 2020 3:21 pm

Jarhmander wrote:
Thu May 07, 2020 4:50 am
Simple question: why is SDL not used on Windows?
There are a few reasons. Mesen did not have a Linux port for its first 2.5 years of development, for one. I also want to keep both distribution and compilation as simple as possible, so it's easier to rely on Windows APIs that are available on all modern Windows PCs, without requiring external stuff. Plus, it all currently seems to work well for the vast majority of users, so I'm not too keen on changing anything video/audio/input related and risk making something worse for some PCs, and there's virtually no maintenance cost to keeping DX11, as it is all code that I barely ever touch at this point.

mkwong98
Posts: 226
Joined: Mon May 30, 2011 9:01 pm

Re: Mesen - NES Emulator

Post by mkwong98 » Sat May 23, 2020 4:04 am

Hi Sour, several people working with HD packs find it useful to have one of these:
set loop points in the music track in the hires.txt file
set two music files as a single track with one as introduction and one as looping
use specific tags in the ogg file as loop points info like https://rpgmaker.net/tutorials/1341/
Please have a look when you have time. Thanks.

Post Reply