Mesen-S - SNES Emulator

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Helder
Posts: 16
Joined: Sun Feb 16, 2014 10:28 am
Location: Mass-USA

Re: Mesen-S - SNES Emulator

Post by Helder »

Not sure if it's been requested or not a but Ram search aka Pro Action Replay Cheat Search feature like in Geiger's SNES9x version or ZSNES would round out this awesome emulator's features.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Mesen-S - SNES Emulator

Post by Oziphantom »

Do you have any plans to add a simpler/other labels support format? CC65 DBG seems to be a incredibly dense binary format that isn't really documented or easy for something that hasn't come from C to build.
Sour
Posts: 890
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen-S - SNES Emulator

Post by Sour »

Helder wrote: Wed Dec 04, 2019 6:41 pmNot sure if it's been requested or not a but Ram search aka Pro Action Replay Cheat Search feature like in Geiger's SNES9x version or ZSNES would round out this awesome emulator's features.
It's something I want to get around to eventually - there's also an issue on github requesting it: https://github.com/SourMesen/Mesen-S/issues/88
Oziphantom wrote: Thu Jan 16, 2020 2:37 amDo you have any plans to add a simpler/other labels support format? CC65 DBG seems to be a incredibly dense binary format that isn't really documented or easy for something that hasn't come from C to build.
.dbg files are text files, but I agree they aren't exactly something you'd want to try generating via anything other than CA65/CC65. I do want to add support for a custom format (e.g like mesen's .mlb files) that matches 1:1 with the label system. If there are other formats you would like to have support for, let me know. (I know WLA has some symbol format that I will probably try adding support for, too)
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Mesen-S - SNES Emulator

Post by Oziphantom »

WLA-DX and 64tass would be what I would convert to it. I only looked at the source code for the cc65 format, as I don't use cc65, it looked like it was doing binary with its "extra table, lists" etc.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Mesen-S - SNES Emulator

Post by Oziphantom »

The Data/Code detection can't handle code jumping over data it seems
MESEN_codeblockfail.png
Source

Code: Select all

 jmp postData  
SpriteData
.EQU SD_StartXY $8078-$2010
@Stereo
	.DW SD_StartXY ; VH 0x68
	.DB 0  
I have unidentified areas show as data selected in the options.
Sour
Posts: 890
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen-S - SNES Emulator

Post by Sour »

Oziphantom wrote: Sat Feb 08, 2020 5:23 amThe Data/Code detection can't handle code jumping over data it seems
Can you try resetting the CDL log (via the file menu)? If you're recompiling the same file and running it over and over, the CDL log from the previous compilations is still used, which means regions that were marked as code before (and aren't anymore) will still end up being disassembled.

As far as I can tell from the code, the disassembler should be stopping its disassembly when it hits a $4C jump instruction, so the most likely culprit here would be the CDL log.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Mesen-S - SNES Emulator

Post by Oziphantom »

AHA, the code log persists. Is there an command line option to reset it.
I see that you want it to persists when hacking/reversing, but for dev not so much.
Sour
Posts: 890
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen-S - SNES Emulator

Post by Sour »

There's no automated way of deleting the log at the moment (the same is true w/ Mesen)

I've been meaning to add an option to automatically reset the CDL log whenever the ROM is changed, though.
Ice Man
Posts: 547
Joined: Fri Jul 04, 2014 2:34 pm

Re: Mesen-S - SNES Emulator

Post by Ice Man »

Will you ever add support for SPC7110 chip?
Momotarou Densetsu Happy nor Tengai Makyou Zero (original files) are not working yet.

Also noticed, games that have 1024KB of SRAM crash. Though it's probably hacks only, still worth mentioning.
Sour
Posts: 890
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen-S - SNES Emulator

Post by Sour »

Ice Man wrote: Fri Feb 14, 2020 8:57 amAlso noticed, games that have 1024KB of SRAM crash. Though it's probably hacks only, still worth mentioning.
SPC7110 support is now available as of the latest commit. It hasn't been thoroughly tested, though, so if you find issues with it, let me know.

As far as SRAM, I had limited it to 256KB to match what bsnes limits it to (iirc this fixed some prototype ROM that did not set the value in the header properly.) As far as I know, no licensed game uses more than this. What rom hacks specifically were you having trouble with? I can look into changing the limit again if it fixes them.
Ice Man
Posts: 547
Joined: Fri Jul 04, 2014 2:34 pm

Re: Mesen-S - SNES Emulator

Post by Ice Man »

Nice, thanks!

As for RAM, there's quite a few games using 512K, such as:
Dezaemon
Pebble Beach no Hatou - Tournament Edition (SA-1)
Marvelous (SA-1)
Harukanaru Augusta 3 (SA-1)
maybe more. :P

Also, the hacks I've tested are mainly SMW hacks:
https://www.smwcentral.net/?p=section&a ... s&id=14812
https://www.smwcentral.net/?p=section&a ... s&id=11254

Also Gradius III and Contra SA-1 hacks:
https://github.com/VitorVilela7/SA1-Root

Could be the fault of SMW hacks.
Since the music does break some emulators.
Though it works on snes9x.
Thanks for checking!
Near
Founder of higan project
Posts: 1553
Joined: Mon Mar 27, 2006 5:23 pm

Re: Mesen-S - SNES Emulator

Post by Near »

Kilobytes vs kilobits.

Dezaemon has 1024 kilobits, which is 128 kilobytes. That is the largest official size of any licensed game.

I allow up to 2048 kilobits or 256 kilobytes, because of homebrew titles.
Could be the fault of SMW hacks.
Since the music does break some emulators.
Older Addmusic-based SMW ROM hacks set echo buffer sizes that are so large they overwrite SPC700 program code and crash.

You have to emulate it like ZSNES and have a separate echo buffer that's not part of APURAM to run them. That and a few other things (no MUL/DIV wait states, etc.)

I don't know if Sour wants to get into ZSNES emulation or not, but it's all the rage these days.
Ice Man
Posts: 547
Joined: Fri Jul 04, 2014 2:34 pm

Re: Mesen-S - SNES Emulator

Post by Ice Man »

You're right. I might have gotten mixed it up.

As far as SMW hacks goes, don't emulate it like ZSNES.
Accuaracy > Bad programming.

I really like Mesen-S so far but it shouldn't aim too much on supporting broken games at all.
If they don't work on real hardware they certainly shouldn't be allowed to work on an emulator either.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Mesen-S - SNES Emulator

Post by tepples »

In before someone builds hardware that modifies the platform to use 128K ARAM, with the echo buffer in the top half.

Split to Hardware-implementable emulator inaccuracies.
Sour
Posts: 890
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen-S - SNES Emulator

Post by Sour »

Ice Man wrote: Mon Feb 17, 2020 2:08 amAlso, the hacks I've tested are
Thanks for the list!
It sounds like at least some of them should be working on hardware, from what I've read.
I ended up spending some time on the first one you linked, but while it boots in bsnes-plus, it doesn't appear to boot in current bsnes. The game appears to try writing to a SA1-only register from the S-CPU, which should fail as far as I know. Looking at bsnes-plus' code, I can't see anything that separates the SA1-only registers from those that are shared, so it appears to be more permissive than the hardware? (bsnes does limit this, which is probably why it fails to boot in bsnes, too) There's a video of the *8th* version of this hack supposedly running on a proper SA-1 board, but this appears to be the 9th version, so .. I don't know? :p

The contra one at the very least boots in bsnes, so it's pretty likely there's something wrong on my end (but I haven't checked anything beyond confirming it works in bsnes.) I'll try to take a look at all of them more in-depth when I have some more time.

And no worries about the kilobits vs kilobytes thing - I've tricked myself into believing a board had 1 megabyte of SRAM a couple of times because some websites list the values as kilobits instead of kilobytes, too.

As far as ZSNES emulation, I think I'll pass on that one :p At least for the foreseeable future. I'm ok with adding (optional) support for things that could be done inside the cartridge itself (e.g bigger rom/ram sizes, etc.) to accomodate homebrew, but something that just can't be done on an unmodified SNES is out of scope (e.g writing to VRAM in the middle of the rendering like zsnes apparently allows)
Post Reply