Mesen - Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
Yave Yu
Posts: 66
Joined: Sun Jan 19, 2014 6:15 pm

Re: Mesen - Emulator

Post by Yave Yu »

Sour wrote: Sat Feb 11, 2023 10:03 am Thanks, I would never have noticed this! This is fixed now in the latest dev build.
Nice, I will try it.
Sour wrote: Sat Feb 11, 2023 10:03 amFor the audio volume, this is normal. 100% in v2 is meant to be equivalent to 25% in v1 (this is the default volume setting for both emulators)
v1 lets you increase the volume up to 4x the base level, but this can cause audio clipping when other audio effects are turned on, etc.
The idea is to try to make all 4 consoles roughly the same volume to avoid having to change the volume constantly - if 100% in v2 was as loud as 100% in v1, then the SNES would sound very quiet in comparison to the NES, etc.
I see, that's a smart idea, but some SNES game I feel louder than NES, such as Rockman & Forte, Idea no Hi. I still think NES could slightly louder, increase to 30%?
creaothceann
Posts: 611
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: Mesen - Emulator

Post by creaothceann »

Maybe there could be a hierarchy:

- global settings (lowest priority)
- console-specific settings
- game-specific settings (highest priority)
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

ISSOtm wrote: Sat Feb 11, 2023 3:51 pmFwiw, when that time comes, I'd like to mention that some people prefer to use boot ROMs that are not the official ones; principally SameBoot, which is 1) free, non-copyrighted software, and 2) faster to skip through than the originals.
So my advice is not to treat checksum mismatches as a hard error, but rather a one-time warning.
FYI, the SameBoy boot roms are already what's used at the moment, when no boot rom is added in the firmware folder. The checksums in the code are only there to warn the user when they pick something different, but aren't enforced - the code will load any file you put in the firmware folder (if it has the right size, at least)
ISSOtm wrote: Sat Feb 11, 2023 3:51 pmI also have a bug to report: the sym file parser seems to have a problem, as WRAM symbols are tagged as "CPU Addr: <unavailable>". I attached the ROM, sym, and map files. I will also point you at the sym file spec, which has been published somewhat recently, and tries to define a uniform way of processing sym files.
Thanks, this was caused by a silly typo in the code that caused some WRAM labels to be interpreted as save/cart ram labels instead. I haven't had the time to review the entire sym file spec. At the moment the code contains 3 different implementations of a sym file loader (wla-dx, bass, rgbds) - for GB, if the file contains a line with the tag "[labels]", it assumes it's a WLA-DX sym file (and tries to use source file mappings, etc.), otherwise it loads it as a RGBDS sym file.

Yave Yu wrote: Sat Feb 11, 2023 5:33 pm but some SNES game I feel louder than NES, such as Rockman & Forte, Idea no Hi.
I'll have to do some tests, each game on each console can arbitrarily make its volume higher or lower than other games, so it's a bit hard to find a perfect balance for all of them.

creaothceann wrote: Sun Feb 12, 2023 2:25 am Maybe there could be a hierarchy:
Ideally, yes, the challenge is mostly building a UI that allows this while also being user-friendly (and without duplicating the same UI in different locations.) I think as it is right now it's usable enough, but I agree it could be improved. At the moment, the only game-specific setting that can be configured is the overscan size, mostly because NES games are all over the place when it comes to having broken graphics on the edges of the screen.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - Emulator

Post by Pokun »

Regarding internal ROMs, I now understand how to change them like I want. Having to rename it to the standard name is a bit clunky (for example if you need to use PC-Engine System Card V 1.0 you still have to rename it to "[BIOS] Super CD-ROM System (Japan) (v3.0).pce"), but it's manageable. If a UI is coming later that would probably take care of that.

I tried loading a bunch of SNES co-processors and everything seems to work. It seems the Cx4 ROM is built-in like in the SD2SNES.
I guess the ST-018 isn't supported yet. It was never asked for and Hayazashi Nidan Morita Shogi 2 doesn't seem to work, just a black screen saying "TRANSMIT WAIT", adding the st-018.rom manually doesn't help (I know it's an ARM MPU so it's understandable if it isn't emulated).

On the PC-Engine it's common to switch system cards if you have a game that requires a specific version (like a certain version of the CD-version of Juuouki which requires v1.0 or it will crash) or you want the English BRAM menu or something, so I find it a bit strange that it complains if you try to use anything other than the Japanese Super System Card v3.0 for the PC-Engine CD bios, but as long as you can actually switch cards it's fine by me.

The fact that it doesn't accept internal ROMs of other sizes is a real problem however, since it refuses to load the Game Express CD card just because it's 32 kB. No High-Leg Fantasy for us.
Last edited by Pokun on Mon Feb 13, 2023 4:04 pm, edited 1 time in total.
User avatar
ISSOtm
Posts: 58
Joined: Fri Jan 04, 2019 5:31 pm
Location: France, right of a pile of consoles
Contact:

Re: Mesen - Emulator

Post by ISSOtm »

Sour wrote: Sun Feb 12, 2023 9:31 am The checksums in the code are only there to warn the user when they pick something different, but aren't enforced - the code will load any file you put in the firmware folder (if it has the right size, at least)
Perfect!
Sour wrote: Sun Feb 12, 2023 9:31 am I haven't had the time to review the entire sym file spec. At the moment the code contains 3 different implementations of a sym file loader (wla-dx, bass, rgbds) - for GB, if the file contains a line with the tag "[labels]", it assumes it's a WLA-DX sym file (and tries to use source file mappings, etc.), otherwise it loads it as a RGBDS sym file.
The sym spec only covers RGBDS sym files. It's also largely a codification of what people have been doing thus far, but setting in stone details like "where are comments allowed", "is leading / trailing whitespace allowed", "what counts as whitespace", etc.

It seems like "reload ROM" needs to be used twice to have an effect? It seems to behave like a reset the first time, but normally if I use it again.
The French Lord of Laziness (and a huge Legend of Zelda fan)
https://github.com/ISSOtm
ASMu is laifu <3
jonn233
Posts: 3
Joined: Wed Feb 01, 2023 2:26 am

Re: Mesen - Emulator

Post by jonn233 »

Hi Sour,

I want to report more bugs:

- In the current Mesen "About" screen, copyright runs until 2022 instead of 2023.

- PC Engine CD & TurboGrafx CD displays "Load error" with translated/hacked images.
Load_error.png
e.g.:

Lords of Thunder (Sega CD OST)
Castlevania - Rondo of Blood (T-En)

Random games not booting:
Summer Carnival '93 - NEXZR Special (Japan)
Akumajou Dracula X - Chi no Rondo (Japan) -> plays the intro, but then freezes with black screen

- Furthermore examples of how the broken scanlines in Mesen2 currently look like with various settings. With the hope that these get fixed soon.

Reference image:
Reference.png
Currently in Mesen2:
MesenNoFilter.png
MesenNoFilter.png (10.66 KiB) Viewed 1241 times
MesenBlarggWindowed.png
MesenBlarggWindowed.png (37.18 KiB) Viewed 1241 times
MesenBlarggFullscreen.png
As you can see in MesenBlarggFullscreen, the thickness of the scanlines even increases in fullscreen. This is simply wrong.
Last edited by jonn233 on Sun Feb 12, 2023 2:47 pm, edited 1 time in total.
jonn233
Posts: 3
Joined: Wed Feb 01, 2023 2:26 am

Re: Mesen - Emulator

Post by jonn233 »

As an example how the end result should look like in Mesen2, I made a screenshot in MAME with HLSL set up:
MameHLSL.png
I think this just looks incredibly beautiful and "accurate" to the real thing. The scanlines cleanly separate the pixels per line.

Keep up the great work! :)
User avatar
jeffythedragonslayer
Posts: 344
Joined: Thu Dec 09, 2021 12:29 pm

Re: Mesen - Emulator

Post by jeffythedragonslayer »

In NesPpu.cpp:

Code: Select all

//When a $2006 address update lands on the Y or X increment, the written value is bugged and is ANDed with the incremented value
This isn't talking about INX or INY, but the dot clock going to the next pixel/scanline, right?
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Mesen - Emulator

Post by Dwedit »

jeffythedragonslayer wrote: Sun Feb 12, 2023 4:42 pm In NesPpu.cpp:

Code: Select all

//When a $2006 address update lands on the Y or X increment, the written value is bugged and is ANDed with the incremented value
This isn't talking about INX or INY, but the dot clock going to the next pixel/scanline, right?
X and Y refer to coordinates there. I think this is about that thing that makes glitchy scanlines appear in SMB1 randomly.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Mesen - Emulator

Post by lidnariq »

No, this one is the one that causes glitchy split scrolling in LoZ.
viewtopic.php?t=18092
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

Pokun wrote: Sun Feb 12, 2023 9:49 amOn the PC-Engine it's common to switch system cards if you have a game that requires a specific version (like a certain version of the CD-version of Juuooki which requires v1.0 or it will crash) or you want the English BRAM menu or something, so I find it a bit strange that it complains if you try to use anything other than the Japanese Super System Card v3.0 for the PC-Engine CD bios, but as long as you can actually switch cards it's fine by me.

The fact that it doesn't accept internal ROMs of other sizes is a real problem however, since it refuses to load the Game Express CD card just because it's 32 kB. No High-Leg Fantasy for us.
I'm generally not familiar with any of the PC Engine library (or even how other PC engine emulators handle these things in general). I'll look into adding an option to pick which bios revision to use (and prompt if the one selected isn't in the firmware folder, etc.)

ISSOtm wrote: Sun Feb 12, 2023 2:16 pm It seems like "reload ROM" needs to be used twice to have an effect? It seems to behave like a reset the first time, but normally if I use it again.
I can't reproduce this as far as I can tell. If it really is only doing a reset (fyi, on GB "reset" is the same as "power cycle"), I suspect it's the fact the default shortcuts overlap (Ctrl+R vs Ctrl+Shift+R) and that might be causing an issue somehow on your end? (I can't reproduce it)
Does it show e.g "[NTSC] [rom name]" on the screen when you say it's only resetting - this is only shown when reloading the rom. What's making you say it didn't reload, is it the rom content itself that didn't update to match changes you did to the rom, or is it e.g the labels/etc. in the debugger that didn't get reloaded?

jonn233 wrote: Sun Feb 12, 2023 2:40 pm - PC Engine CD & TurboGrafx CD displays "Load error" with translated/hacked images.
e.g.:
Lords of Thunder (Sega CD OST)
Castlevania - Rondo of Blood (T-En)

Random games not booting:
Summer Carnival '93 - NEXZR Special (Japan)
Akumajou Dracula X - Chi no Rondo (Japan) -> plays the intro, but then freezes with black screen
It's pretty hard for me to judge whether broken romhacks/translations are an issue or not, unless there is evidence of them working correctly on hardware.
The fact you're listing the original Japanese version of chi no rondo as freezing is suspicious though, it works on my end - it's probably the one game I've loaded the most as far as cd-rom games go. So the question would be why isn't it working for you - it could be the specific files you're using (e.g the way the cd image is built, or the cue sheet, etc.) or some options you've changed, etc.
jonn233 wrote: Sun Feb 12, 2023 2:40 pm Furthermore examples of how the broken scanlines in Mesen2 currently look like with various settings. With the hope that these get fixed soon.
The scanline effect is meant to be a very basic graphical effect and not meant to rival shaders, etc. At the moment, I don't really have any plans to improve it any time soon (same for adding shaders), there are too many other things to get done that are higher priority for now.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Mesen - Emulator

Post by rainwarrior »

The "select preset" dropdowns in the input setup panels seem to be disabled/greyed-out now.

Minor request: is there a way to toggle input display with a keyboard shortcut? It's something I want to turn on and off very frequently, but it's a couple layers deep in the settings menus. I thought "Toggle OSD" might do it, but it seems not.

Edit: relatedly, I'm also noticing that I can't get the input overlay to appear in the video recorder anymore? Did this work before and was removed? I often wanted to do so as a visual demonstration of button inputs. (...and I just as often want to turn it off.)

Edit: when recording video from SNES, if interlacing enables mid-recording the video recorder just silently terminates the video (though the UI says its still recording) and nothing is recorded past the change. Is there any way to get the 512x240 version of the picture so that it can carry through?

Version git hash: b655966
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Mesen - Emulator

Post by rainwarrior »

The window size for quick integer scaling Alt+2 appears to be off by 1? In this screenshot I just pressed Alt+2 and the actual visible resolution is 511 pixels wide instead of 512. You can see the missing column of pixels clearly in the middle of the screen, squishing Ayla's face. Alt+3 and Alt+4 also seem to have a similar problem. (Not sure about Alt+1.)

This seems to also be a problem if the scale is set from the menu bar, and if I resize the window it's still doing the incorrect scaling, just with black borders added. Mesen-S does not appear to have had this issue.
Attachments
window_size_off.png
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - Emulator

Post by Pokun »

Sour wrote: Mon Feb 13, 2023 2:18 pm I'm generally not familiar with any of the PC Engine library (or even how other PC engine emulators handle these things in general). I'll look into adding an option to pick which bios revision to use (and prompt if the one selected isn't in the firmware folder, etc.)
Honestly the way Mednafen handles it is a bit clunky, but it's mainly because you need to edit a config file to change system cards (and most other settings). Magic Engine (which is GUI-driven) allowed you to set 5 ROMs for the system cards (for version v1, v2, Super, Arcade and Games Express I think) so that you could quickly switch between several versions. You would still need to change them to use v2.1 for example though IIRC.

Alright here is a summary of all system cards (except some homebrew cards like the CD Stupid Card):

Code: Select all

PC Engine System Cards

The system cards are HuCards inserted to the PC-Engine's HuCard slot when
a CD system is connected. They contain the BIOS used by CD games and some RAM.
All official system cards has a data management menu for the 2 kB BRAM (which
comes built-in to all CD systems).

BRAM Data Management Menu:
Pressing SELECT on the BIOS screen accesses the save data management menu.
The following options are shown on a menu (top to bottom) Delete, Format, End
Delete is used to delete individual files, while format is used to delete all
files and reformat the memory. Format needs to be used if the BRAM has become
corrupt before saving works again.

The original CD-ROM^2 has no built-in BIOS and must always have a system card
to play CD games. The Super System Card v3.0 is needed to play Super CD games
on it as it temporarily "upgrades" it to a Super CD-ROM^2.
The Super CD-ROM^2 (including the Duo models which contains a built-in Super
CD-ROM^2) has the v3.0 BIOS and RAM built-in and doesn't require a card to
play CD-ROM^2 and Super CD-ROM^2 games, but it can also use any system card
which will override its internal system card BIOS. This can be used to
"downgrade" it to a CD-ROM^2 by inserting any earlier system card (system card
error screens can be seen this way).

CD systems and CD games are all region-free, and any console of any region can
use any system card with the right adapter and CD unit to play any CD game.

------------------------------------------------------------------------------
System Card 1.0

* Bundled with the debut CD-ROM^2 system release (no US release).
* Also sold separately.
* Contains system v1.0 and plays CD-ROM^2 games.
* BIOS has memory manager and debugger.
  (Hold I + II + UP + RIGHT then press SELECT.)
* Due to a bug in Juuouki CD version (HA10817) the game will hang if another
  card than v1.0 is used. Version HA10109 of the game appears to be fixed.


System Card 2.0

* Bundled with the debut US CD-ROM^2 system release.
* Sold separately in Japan.
* Contains system v2.0 and plays CD-ROM^2 games.
* CD+G support added.
* Debug function removed.


System Card 2.1

* Only sold separately.
* Contains system v2.1 and plays CD-ROM^2 games.
* CD Auto Disc Change added.


Super System Card

* Sold separately for upgrading CD-ROM^2 for Super CD-ROM^2 games.
* Contains system v3.0 and plays CD-ROM^2 and Super CD-ROM^2 games.
* Adds 192 kB RAM. With the 64 kB RAM in the CD-ROM^2 this becomes a total of
  256 kB RAM needed for Super CD-ROM^2 games.
* BIOS and RAM already built-in to Super CD-ROM^2 so this card is only needed
  for the regular CD-ROM^2.
* Some games relies on the Japanese system v3.0 BIOS and will not work on a
  US Super System Card:
  A-Ressha de Ikou III - Breaks the rules and jumps into the BIOS directly
  instead of using the vectors at the beginning of the ROM. The US version has
  different addresses for things so it breaks.
  Bonanza Bros - Checks version number and excpects v3.0. The US version
  returns v3.1 and will not work.
  Alshark - Unknown problem.


Arcade Card Duo

* Japan-exclusive system card.
* Only sold separately for upgrading Super CD-ROM^2 for Arcade CD-ROM^2 games.
* It does not contain any BIOS as system v3.0 is already built-in to Super
  CD-ROM^2 systems. It plays CD-ROM^2, Super CD-ROM^2, Arcade CD-ROM^2 and
  Arcade CD-ROM^2 enhanced games.
* Adds 2 MB DRAM (though not in the CPU address space unlike the normal 256 kB
  Super CD SRAM) as needed for Arcade CD-ROM^2 games.
* Requires a Super CD-ROM^2, can not be used with CD-ROM^2 as there is not
  enough RAM. It's named Duo after the Duo systems but is relevant for any
  system with a Super CD-ROM^2 connected.


Arcade Card Pro

* Japan-exclusive system card.
* Only sold separately for upgrading CD-ROM^2 for Arcade CD-ROM^2 games.
* Contains system v3.0 (same BIOS as the Super System Card) and plays
  CD-ROM^2, Super CD-ROM^2, Arcade CD-ROM^2 and Arcade CD-ROM^2 enhanced
  games.
* Adds 192 kB RAM just like the Super System Card, turning it to a full Super
  CD-ROM^2 system.
* Adds 2 MB DRAM (though not in the CPU address space unlike the normal 256 kB
  Super CD SRAM) as needed for Arcade CD-ROM^2 games.
* It is basically a Super System Card and Arcade Card Duo in one.
* Works in a Super CD-ROM^2 as well but NEC recommends against it.


Games Express Card 1.0

* Japan-exclusive unlicensed system card.
* Contains unlicensed Games Express system v1.0 required to play the
  unlicensed games by Games Express (formerly Hacker International).
* Can only access the 64 kB RAM that is built into all CD units so later
  Games Express games like High-Leg Fantasy are not playable.
* Does not contain any RAM.


Games Express card 1.1

* Japan-exclusive unlicensed system card.
* Contains unlicensed Games Express system v1.0 required to play the
  unlicensed games by Games Express (formerly Hacker International).
* Is able to access the full 256 kB Super CD-ROM^2 RAM space. This requires a
  Super CD-ROM^2 unit though since there are no on-board RAM.
* Does not contain any RAM.

Note: Games Express cards comes in green and blue but it does not seem to be
any differences. Version 1.1 may come in either color.

------------------------------------------------------------------------------
Some useful links:
PC-Engine FAQ - Is in Japanese and answers many general questions about everything PC-Engine.
PC-Engine hardware - Good source of pictures and information about the many PC-Engine peripherals and console models.
Famicom World PC-Engine Thread - A quick general PC-Engine guide I wrote a few years ago. All basic peripherals and their uses are explained in the first post.


Sour wrote: Mon Feb 13, 2023 2:18 pm GB "reset" is the same as "power cycle"
Neither the Game Boy nor the PC-Engine has a physical RESET button but both has a RESET signal in the cartridge port which some flashcarts uses for adding a physical RESET button. Just an idea to support it.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

rainwarrior wrote: Mon Feb 13, 2023 5:38 pm The "select preset" dropdowns in the input setup panels seem to be disabled/greyed-out now.
This was fixed yesterday, should work correctly in the latest dev build.

There's no way to toggle the input display with a shortcut, atm. I'll add it to the request list.

The HUD/OSD isn't saved in AVIs anymore, no. This has always been the case in the new version (and in the old versions, it was recorded automatically if it was shown on the screen). Adding an option to record it is probably possible but requires some effort since the screen and hud/osd are rendered in separate buffers in this version. I'll add it to the request list, too

For the SNES switching resolution during avi recording issue, I'd have to see, but I don't think AVIs can support the resolution changing during the video itself, so it's not a super simple fix. Although, I think if you use the NTSC filter, the output resolution should be identical (e.g always 2x scale) during gameplay, which might let you record it (with all the disadvantages this implies)
Afaik, Mesen-S had the same limitation. I'll at least fix the recording to properly stop when the resolution changes (instead of breaking the UI like it does now) and see about making it work properly later on.
rainwarrior wrote: Mon Feb 13, 2023 6:07 pm The window size for quick integer scaling Alt+2 appears to be off by 1?
This looks like a rounding issue - if you set the overscan back to 7 (top) and 8 (bottom), it should size itself properly. The issue appears/disappears depending on the overscan settings on my end, I'll take a look.

Pokun wrote: Mon Feb 13, 2023 6:29 pm Alright here is a summary of all system cards
Thanks for the info/links! I'll take a look and try to come up with a decent way of picking different versions.

Also did not know that the GB & PCE had a reset pin in the cartridge port, thanks for the info!
Post Reply