Can C# access USB2SNES WRAM?

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
Eatitup86
Posts: 10
Joined: Wed Sep 21, 2016 12:29 pm

Can C# access USB2SNES WRAM?

Post by Eatitup86 » Mon Feb 04, 2019 5:12 pm

I am wondering if the USB2SNES interface allows for direct access to the WRAM on a running game?

I know you can read and alter the data within the included Memory Viewer application but everything I have seen that interfaces with it uses some janky web connection socket that often results in erratic behavior from the application itself.

Ideally directly accessing the WRAM during runtime using C# would be wonderful.

I am hoping to create an auto-updating A Link to the Super Metroid tracker but I want to make sure it doesn't crash any time it is moved (like the one included with Magic2SNES) and that it is fairly responsive.

Additionally I would love to work on an implementation with RetroAchievements to allow players to use real hardware to do the achievements bypassing the emulator issues I have seen many complain about in the past.

User avatar
koitsu
Posts: 4218
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Can C# access USB2SNES WRAM?

Post by koitsu » Mon Feb 04, 2019 8:11 pm

I wish I could help, but I don't quite understand what USB2SNES is. I'm wanting to assume it's client software for the USB interface on an SD2SNES, but I'm unsure. I'm having a hard time comprehending it because:

https://github.com/saturnu/usb2snes seems to be called USB2SNES, except,
https://krikzz.com/forum/index.php?topi ... 0#msg50820 indicates a guy named RedGuy came along and improved on it, calling it usb2snesw, based on this post, which is centred around firmware updating and not so much the debugger (maybe I'm wrong?)

If it is the USB interface to the SD2SNES, then think it's more a question as to whether or not the SD2SNES supports snooping on WRAM regions.

Have you tried contacting RedGuy directly? Or possibly filing a GitHub Issue to ask? If not, why not? If so, what'd he say?

You might also try asking Krizz himself, since he's the SD2SNES inventor and could certainly tell you what types of debugger features are possible.

I own an SD2SNES, but I never bothered with the USB interface because I was told it was one of those in-flux-development type of features.

Finally, when you say WRAM, are you talking about:

a) Literal work RAM, i.e. $0000-1FFF of bank $00 (and some other banks (depends on mode 20 vs. 21)),
b) Region $7E0000-7FFFFF as a whole (of which Item (a) is part of),
c) Battery-backed SRAM (e.g. $6000-7FFF)?

Sadly the acronyms are sometimes misused, so it's always best to clarify.

calima
Posts: 1326
Joined: Tue Oct 06, 2015 10:16 am

Re: Can C# access USB2SNES WRAM?

Post by calima » Tue Feb 05, 2019 1:42 am

Just noting, Krikzz did not invent the sd2snes, he's just manufacturing it.

User avatar
koitsu
Posts: 4218
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Can C# access USB2SNES WRAM?

Post by koitsu » Tue Feb 05, 2019 2:03 am

calima wrote:Just noting, Krikzz did not invent the sd2snes, he's just manufacturing it.
Oh, I didn't know that. I was under the impression he designed/invented it, and offloaded manufacturing of the works onto whomever took up the job (for example I think mine was assembled somewhere in Russia or Ukraine). Sorry for getting this piece of information wrong.

qwertymodo
Posts: 775
Joined: Mon Jul 02, 2012 7:46 am

Re: Can C# access USB2SNES WRAM?

Post by qwertymodo » Wed Feb 06, 2019 2:52 pm

Yes, the USB2SNES interface can access the entire SNES memory map. Check out https://github.com/KatDevsGames/connectorlib for a C# library that interfaces with it (through the WebSocket tray app, so you need to have that running, it doesn't interface directly with the virtual serial port).

Post Reply