Live data from Hacker News

Experimental Nintendo Switch Emulator written in C#

github.com

91–100 of 172 posts

Re: Experimental Nintendo Switch Emulator written in C#

#91
post #85

Is there a way to intercept data between the Switch and online Fortnite services? I recently bought a Switch and have been playing Fortnite online...noticed more and more "online gamers" have been behaving like bots, so I'd like to take a look at the data if possible (to see if I'm playing against actual people)

https://www.nintendolife.com/news/2019/09/epic_is_adding_bot...

It looks like that might be deliberate?

Re: Experimental Nintendo Switch Emulator written in C#

#92
post #90

I have mixed feelings about emulating current-gen consoles. I think there's a very strong ethical case for emulating consoles whose games are no longer made (despite Nintendo's best efforts to shut that down too). But emulating something whose games can still be bought new would tend to encourage piracy, I expect. Edit: "cracking" -> "piracy", for clarity

> I think there's a very strong ethical case for emulating consoles whose games are no longer made (despite Nintendo's best efforts to shut that down too). Do you differentiate between games being “made” and “sold”? If not, which consoles specifically are thinking of as ethical to emulate? Nintendo still sells NES, SNES, N64, etc. games via Virtual Console.

I personally would not emulate a game that Nintendo is currently selling in a readily-playable form (unless I owned it already). Used games don't count, because those a) don't send any money to the original devs and b) become increasingly scarce over time.

The problem is that in practice Nintendo only makes a very small portion of their back catalog available for purchase at any given time. The only Zelda games from previous generations that I can play on my Switch are Zelda 1, and (soon) Skyward Sword. No others are available.

If Nintendo made their whole catalog available for digital purchase (or even better, as part of a subscription) then I wouldn't emulate any of it.

Re: Experimental Nintendo Switch Emulator written in C#

#93
post #81
post #75

Earlier quoted context omitted.

That's not a thought experiment! That's using a false, unlikely example that goes against all evidence to scarecrow.

Let me try to spell it out for you. ddevault: > Even with all of that said, I support piracy. Information wants to be free, and games are made of information. No one has lost anything when a game is copied. "Information wants to be free, and games are made of information" is a defense of piracy that has nothing whatsoever to do with the consequences of piracy. The argument is that copyright claims are morally invalid…

Your argument strikes me as tautological in that you've created a hypothetical sad situation and are arguing that because it is sad we should change our behavior. I think it's probably worthwhile to think about if the situation could actually occur in our world.

Otherwise, why not construct the absurd thought experiment: what if the intern that got laid off won a bunch of money and didn't have to work? Piracy is obviously moral and great because the intern is now rich.

Obviously this wouldn't happen to most interns given how the world works (losing your job is bad). Thus it is a bad thought experiment.

Similarly, if having a game pirated leads to an increase in sales, this is a bad thought experiment.

Re: Experimental Nintendo Switch Emulator written in C#

#94

What made C# a good choice for this?

C# is the fastest GCed language and emulators are not just about performance, a high level language increase both productivity and the number of contributors, hence the number/depth of optimizations + features and correctness. C# has C++ interop if ever needed.

Re: Experimental Nintendo Switch Emulator written in C#

#95
post #52

Earlier quoted context omitted.

There are many reasons to use an emulator. You could play your own games on a new platform, or without having to pay for the hardware (a gaming PC which can run an current-gen emulator is expensive enough!). You could use it to play or develop homebrew software, or to research commercial software. You can use it to bypass region locks, which I would argue are quite unethical in their own right. Even with all of that…

> No one has lost anything when a game is copied. Suppose an indie developer working alone hires an intern. They release a game developed together for a console. Suddenly the console becomes possible to emulate, and most of the people who would have bought the game play a cracked and pirated version on an emulator instead. Because of the unexpected lack of sales, the developer has to fire the intern. The intern no lo…

No one has a right to a viable business model. There are other ways to make money.

I also oppose companies like Nestle monopolizing water supplies to sell back to communities at a premium. If they're not allowed to do that, then their employees will have to find something else to do, or they won't be able to feed their family and their children will go hungry. Naturally, we'll not speak of any of the benefits which might be possible if we eliminated their business model. The only consequence of any import is that their employee's family will starve and die.

This is clearly a false argument. Intellectual property is based on an artificial scarcity and has no basis in the tangible value of goods and services. It's a kind of intellectual rent. It should not be granted special status in law.

Re: Experimental Nintendo Switch Emulator written in C#

#96
post #4

Impressive! Is this the first modern console emulator written in a GCed language, or even a language other than C++?

The problems with GC'd languages are very exaggerated. I'm not surprised at all that this is performant in C#.

C#, or more specifically the .NET VM (goes for F# and VB too) has a lot more features that make it a lot easier to avoid GC events than in the past. Managing memory especially across interop with Span support means a lot less copying from managed to unmanaged memory as an example which would help a lot with games that often need to invoke operating system libs/drivers.

Re: Experimental Nintendo Switch Emulator written in C#

#98

Earlier quoted context omitted.

Or as a “Look, you can do X in language Y, a lot of people assumed this was not possible.” Situation. Seen that a few times.

In my opinion this is the exact reason C# was picked. Almost everything C# is either Windows-only or Console/Server app. This is neither and that's what's interesting to me.

Many video games are written in c#. This includes pretty much all games written using unity (the most popular 3d game engine) and fna (a very popular 2d framework).

Re: Experimental Nintendo Switch Emulator written in C#

#99
post #78

> The CPU emulator, ARMeilleure, emulates an ARMv8 CPU and currently has support for most 64-bit ARMv8 and some of the ARMv7 (and older) instructions, including partial 32-bit support. It translates the ARM code to a custom IR, performs a few optimizations, and turns that into x86 code. Interesting... since .Net is cross-platform and can run on ARM, if it's running on an ARM processor does it just run the instruction…

> if it's running on an ARM processor does it just run the instructions directly? You can't just run random instructions like that. That code is compiled with the assumption that there's the Switch's OS and hardware underneath, which means it will do all kinds of things, like calling directly into the kernel and assuming a particular address space layout, that would crash it under a different OS. ARM has hardware vir…

I think it does beg the question though, of whether it might be possible to dump the Switch OS and firmware and run it on some alternative ARM hardware (with some modifications for redirecting weird custom chips). IIRC the Switch is running an overclocked Tegra (X1?)

IANAL, but in the US at least, I think every person would need to buy their own Switch and dump the software themselves for it to be even remotely legal.

Re: Experimental Nintendo Switch Emulator written in C#

#100
post #59

Earlier quoted context omitted.

The problems with GC'd languages are very exaggerated. I'm not surprised at all that this is performant in C#.

For game dev (and emulators!), the non-deterministic behavior of GCs can cause a lot of trouble, mainly because you have a fixed frame budget. That’s why it’s usually easier to just use a language where you can finely control when and where allocations take place. I’m sure there are techniques to work around this, but you’d then usually have to leave behind the “idiomatic” area of the language you’re using.

Yes, In C# you have to leave the idiomatic side somewhat to get the most performance. Though this is getting better in latter versions of C#, in which you get more low level coding features. But for me the fun part is doing exactly that. Coding as close to the metal as possible, leaving the "safe" side of C# but still using the Quality of Life features that C# offers compared to C++. That for me makes C# my favorite language ever.
Post reply on HN