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.
User avatar
SusiKette
Posts: 147
Joined: Fri Mar 16, 2018 1:52 pm
Location: Finland

Re: Mesen-S - SNES Emulator

Post by SusiKette »

I was looking through Super Metroid's code and I came across BRK #$9C. To my understanding BRK shouldn't have an operand, so is this a disassembly error in the debugger or is there another reason why it is displayed this way?

Also, would it be possible to add options in the debugger to hide RAM and mirror areas to make the overall length of the disassembly window shorter. If I remember correctly on LoROM simply hiding mirrors would already shorten the length almost 50% shorter since the $80:0000 - $FF:FFFF region mostly is mirrored to $00:0000 - $7F:FFFF, the only exception might be the work RAM and SRAM since they don't mirror (probably). I'm not sure if the entire $00:0000 - $FF:FFFF is displayed on the debugger, but also hiding areas that aren't mapped to anything could shorten the list a good amount as well.

EDIT: By the way, does Mesen-S have a display for how much of the ROM is logged as code, data, graphics, etc. ? I'm pretty sure Mesen did have that feature on the debugger.
Avatar is pixel art of Noah Prime from Astral Chain
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Mesen-S - SNES Emulator

Post by Oziphantom »

BRK has an param and adds 2 to the return address. Thus brk can be used to skip a byte if needed and you have an RTI BRK handler. It does nothing with said byte and it won't read it, so its a 1 byte instruction with an immediate param ;)
User avatar
SusiKette
Posts: 147
Joined: Fri Mar 16, 2018 1:52 pm
Location: Finland

Re: Mesen-S - SNES Emulator

Post by SusiKette »

I don't really get the point, but it can still cause incorrectly displayed code if the "BRK operand" is actually the next opcode. In this case a branch jumps over the BRK instruction. The BRK code itself is a JML instruction pointing to itself. I guess the debugger needs a check to see if the byte after BRK is executed an use that to judge how the code should be displayed.
Avatar is pixel art of Noah Prime from Astral Chain
aj7596
Posts: 2
Joined: Sat Aug 22, 2020 12:02 pm

Re: Mesen-S - SNES Emulator

Post by aj7596 »

Mesen-S github repository is now archived.
https://github.com/SourMesen
creaothceann
Posts: 611
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: Mesen-S - SNES Emulator

Post by creaothceann »

SusiKette wrote: Sun Oct 04, 2020 7:02 am I don't really get the point
6502 was designed to do as much as possible with a very limited transistor count. As a result it sometimes appears inefficient or confusing.
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Mesen-S - SNES Emulator

Post by Oziphantom »

No this time BRK is very intentionally doing it, I'm fairly convinced.

If you have a EPROM that starts set and is programmed "lo" this allows you to patch about a byte or instruction by re programming all bits to 0. Saving lots of time and money back when it really mattered. In 2020 yeah pointless, 1975 quality of life feature through a through.

also software interuppts are a common paradigm for sys calls. i.e the IBM BIOS has INT 10h and INT 21h etc to do graphics, allocate memory, load files etc so if you want to use that system on a 6502 you can do

BRK #$21

and then you read the byte after BRK by doing a stack lookup and then fetch the byte. Some Assemblers back in the day added "software opcode" and extensions that used BRK Dispatch.

However 99% of the time you would disassemble it as a single byte. And the BRK #XX feature was "replaced" with the COP #XX on the 65816.
User avatar
FitzRoy
Posts: 144
Joined: Wed Oct 22, 2008 9:27 pm
Contact:

Re: Mesen-S - SNES Emulator

Post by FitzRoy »

It's a real shame that the quitting happened so suddenly and we didn't get a final 0.5.0 release. There were a lot of fixes since 0.4.0, and the latest dev build has a rather nasty regression that affects a lot of titles including SMW, Super Metroid, and Chrono Trigger.
User avatar
NovaSquirrel
Posts: 483
Joined: Fri Feb 27, 2009 2:35 pm
Location: Fort Wayne, Indiana
Contact:

Re: Mesen-S - SNES Emulator

Post by NovaSquirrel »

FitzRoy wrote: Sun Oct 18, 2020 11:42 am It's a real shame that the quitting happened so suddenly and we didn't get a final 0.5.0 release. There were a lot of fixes since 0.4.0, and the latest dev build has a rather nasty regression that affects a lot of titles including SMW, Super Metroid, and Chrono Trigger.
Sour mentioned on Reddit that he could still end up doing a "final" release that packages up the dev build fixes. He also mentioned on Discord that I could get my own improvements into the final release as well.
ansarya
Posts: 6
Joined: Mon Jul 29, 2019 10:42 pm

Re: Mesen-S - SNES Emulator

Post by ansarya »

Hamtaro126 wrote: Fri Aug 28, 2020 9:56 pm
thewhitedragon69 wrote: Fri Aug 28, 2020 9:25 pm Where can I get ROMs for the Mesen-S? I love Mesen and have a bunch of games, but can't find game ROMs for SNES anywhere (just bogus malware sites). Anyone know where good, safe ROMs are?
Sorry, it's illegal to tell someone where ROMs are on the internet, There are search engines for this, I perfer DuckDuckGo!!!

Even then, You need to have common sense, Do NOT download unless you own the games itself, If you own the game cartridges, the Images can be extracted from your own ROM (Advanced soldering and equipment knowledge required!!!) or can be downloaded (If a good place can be found)!!!
That is complete nonsense. It is NOT illegal to tell someone where they can get ROMs and it is NOT illegal to download and play those ROMs, although it is illegal in the US to upload those files to someone else. So you can receive them but you can't give them. Same with movies and mp3s, it's the sharing that causes problems, not the getting.

But Nintendo (and Sony, et al) has lots of lawyers and websites/forums like this one do not have the resources to resist the harassment that they can unleash so they bend to the pressure and disallow sharing of this information.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Mesen-S - SNES Emulator

Post by tepples »

As Wikipedia's policy on linking to infringing copies explains, courts have found contributory infringement in hyperlinks. See Intellectual Reserve v. Utah Lighthouse Ministry (US, 2000) and GS Media v Sanoma (EU, 2016).
User avatar
Hamtaro126
Posts: 818
Joined: Thu Jan 19, 2006 5:08 pm

Re: Mesen-S - SNES Emulator

Post by Hamtaro126 »

ansarya wrote: Fri Apr 16, 2021 7:37 am That is complete nonsense. It is NOT illegal to tell someone where they can get ROMs and it is NOT illegal to download and play those ROMs, although it is illegal in the US to upload those files to someone else. So you can receive them but you can't give them. Same with movies and mp3s, it's the sharing that causes problems, not the getting.

But Nintendo (and Sony, et al) has lots of lawyers and websites/forums like this one do not have the resources to resist the harassment that they can unleash so they bend to the pressure and disallow sharing of this information.
You are completely wasting your time whining, so Quit it and follow the rules!!!

To quote tepples said, about infringing links and asking for them:
tepples wrote: Fri Apr 16, 2021 8:10 am As Wikipedia's policy on linking to infringing copies explains, courts have found contributory infringement in hyperlinks. See Intellectual Reserve v. Utah Lighthouse Ministry (US, 2000) and GS Media v Sanoma (EU, 2016).
AKA SmilyMZX/AtariHacker.
Bag of Magic Food
Posts: 5
Joined: Sat Nov 28, 2020 12:40 pm

Re: Mesen-S - SNES Emulator

Post by Bag of Magic Food »

bklD wrote: Wed Aug 05, 2020 5:11 am
Pennywise wrote: Fri Jul 31, 2020 7:30 am Is this emulator also a standalone GB emulator? I've tried loading GB games, but they aren't recognized and I can't seem to find anything in the documentation that sheds light on the subject.
You have to use the development build: https://ci.appveyor.com/project/Sour/me ... /artifacts
Is there a way to download that anymore, or do I have to grab a lot of files from GitHub and run some compiler on them because the "Artifact" expired? I was highly interested in a Game Boy Mesen for the ability to view memory values mid-frame, but I'm not terribly code-savvy in general.
User avatar
NovaSquirrel
Posts: 483
Joined: Fri Feb 27, 2009 2:35 pm
Location: Fort Wayne, Indiana
Contact:

Re: Mesen-S - SNES Emulator

Post by NovaSquirrel »

Bag of Magic Food wrote: Sun Jan 02, 2022 10:03 am
bklD wrote: Wed Aug 05, 2020 5:11 am
Pennywise wrote: Fri Jul 31, 2020 7:30 am Is this emulator also a standalone GB emulator? I've tried loading GB games, but they aren't recognized and I can't seem to find anything in the documentation that sheds light on the subject.
You have to use the development build: https://ci.appveyor.com/project/Sour/me ... /artifacts
Is there a way to download that anymore, or do I have to grab a lot of files from GitHub and run some compiler on them because the "Artifact" expired? I was highly interested in a Game Boy Mesen for the ability to view memory values mid-frame, but I'm not terribly code-savvy in general.
I've got builds over on my fork - I guess I should go and do a release too so there's an updated version that isn't going to expire.
ansarya
Posts: 6
Joined: Mon Jul 29, 2019 10:42 pm

Re: Mesen-S - SNES Emulator

Post by ansarya »

What emulator are we using for romhacking now? Mesen-S got discontinued because a bunch of people whose entire hobby is based on stealing other people's code canceled it because he used someone else's code (hypocrites) while it was rapidly becoming the best debug/hack platform for SNES.

So what do we use now?
Fiskbit
Posts: 891
Joined: Sat Nov 18, 2017 9:15 pm

Re: Mesen-S - SNES Emulator

Post by Fiskbit »

Sour has been hard at work making a new version of Mesen with support for both NES and SNES. It's not ready just yet, but you can expect it in the not too distant future.
Post Reply