1, 2, 3, 4, 5  Next
csnes 
Author Message
User avatar

Joined: 2014-09-25 13:52
Posts: 8294
 csnes
csnes is a new emulator that I've recently written (mostly) from scratch.

It is intended to be a product for commercial use, focusing on performance and reasonable (though not excessive) accuracy.

Currently, here's some benchmarks for Zelda 3's title screen:

[Core i7-2600k @ 3.4GHz]
higan: 104fps
bsnes: 249fps
csnes: 439fps

[Celeron 2957U @ 1.4GHz]
bsnes v106.48: 90fps
bsnes/higan v098-performance: 106fps
csnes: 146fps

So, how do we get these numbers? Here's the thing: bsnes/higan were always constrained by the requirements of writing clean, portable code and being able to support the maximum level of accuracy. That meant that the fastest possible cores were limited by needing to be compatible with the most accurate cores and the overall architecture of the emulation framework.

csnes is written from scratch, and so unlike bsnes, it doesn't have to follow any conventions of higan. However, the converse side is that it cannot be a shared core anymore. It can be (and is) wrapped by Emulator::Interface, so it could be exposed as a core to the bsnes or higan GUIs, however as a separate core, it'd be no different than offering Snes9X in these interfaces. Any improvements to one emulator have to be ported to the other, so it is in effect a hard fork, unlike the old profiles system of past releases, or the new bsnes/higan split of new releases.

Generally speaking, the changes are design decisions that I feel are counter to how I want to design and work on emulators. But they're essential in order to produce an emulator that can run on low-power hardware. For the most part, the changes either won't affect accuracy, or will only affect it in very extreme edge cases.

I don't want to explain the entire architecture of the emulator, but just as an idea ... say you're going to perform a 24-bit jump. The odds are extremely slim that the SNES CPU is going to be fetching from somewhere that might change if the SMP or PPU is allowed to be ahead of the CPU then. It would have to be fetching the operands from $2100-217f in order for that to be the case, and, really, how often are you executing CPU code out of those registers? Further, you might as well do {read(3), step(3)} instead of {readLo(), step(1), readMid(), step(1), readHi(), step(1)}, right? Chances are very good the jump address read isn't going to cross from work RAM $801fff to (open bus) $802000, or (open bus) $807fff to ROM $808000.

Or as a last example ... there's not a single commercial game that breaks if you immediately compute the results of CPU MUL/DIV operations, and it saves you having to check and advance the ALU every single opcode cycle edge, which is a hot area of code. Every officially released game is going to honor those delays, and none are going to rely on partially computed results that have been read out too soon.

The basic idea is to use my knowledge of writing an SNES emulator and fixing every bug reported for over a decade to know what games are finnicky about what behaviors and limitations, and apply intelligent shortcut optimizations that will have little to no effect on compatibility.

But as you can see ... these limitations make it a bad emulator for homebrew development, and the code being out there is not of any real benefit. Snes9X already does most of the same stuff, and is currently still faster ... although my hope is to keep closing that gap, I have no desire to compete against Snes9X for the speed crown. Maybe if Snes9X wanted to discontinue and take over on this codebase, but the world just doesn't need two Snes9X equivalents.

The point of this project again, is to allow companies to have an option to re-release games they hold licenses to in a commercial setting, which is something that cannot be done with ZSNES (well, x86 only and as GPLv2 -- eg the Rock 'n' Roll Racing game) or Snes9X.

But we'll see how things go. It's still early days.

Lastly, work on csnes has already exposed areas in need of improvement in bsnes/higan, and has given me new ideas for them. So you can expect this work to have public merit.

_________________
What the hell's going on? Can someone tell me please?
Why I'm switching faster than the channels on TV.
I'm black, then I'm white. No, something isn't right.
My enemy's invisible, I don't know how to fight.


2018-07-18 21:38

Joined: 2014-10-29 21:19
Posts: 36
 Re: csnes
Nice, go for it.


2018-07-19 00:07
User avatar

Joined: 2014-09-27 09:26
Posts: 2599
 Re: csnes
Nice. I like the name, too. Obviously it was made after bsnes; it's also the third emulator by byuu (higan, bsnes) and c could stand for commercial (use).

_________________
"Better to Remain Spoony and Be Thought a Bard than to Sing and Remove All Doubt."


2018-07-19 00:14
User avatar

Joined: 2014-09-27 09:38
Posts: 898
Location: New York, NY, USA
 Re: csnes
In before c++snes

_________________
Apollolux Digital Designs :: website development
Alex Rosario Type :: typeface and font design and development
President, ACM - CUNY Hunter College chapter
:: A student at Hunter? Interested in tech? Find us!


2018-07-19 03:08

Joined: 2018-07-05 12:07
Posts: 53
 Re: csnes
Hopefully people dont attack me on the next few words I am going to write. But if csnes is faster and as compatible as bsnes and your intent on it is having a commercial emulator that you dont plan to release to the public maybe you can make it purchasable?

I think people would buy it.

Yes there are free emulators.

But this is a case where you have a proven track record, and people who have already gotten to use your work for free and want something that is a little faster might pay for it.

Others will pay for it just to show support.

If you did make a pay version maybe make it as plug and play as possible.

Make it the simple anyone can use emulator.

xinput fixed controllers etc.


Maybe.


Im just thinking.

I just find your snes emulators exciting.


2018-07-19 12:14
User avatar

Joined: 2014-09-27 09:32
Posts: 851
Location: Moses Lake, WA
 Re: csnes
007, I hope you don't consider this an attack so much as a counterpoint, but...

The success of other commercial (sold directly to end-user) or semi-commercial (patreon) emulators has always been predicated on the lack of a decent alternative. I don't think anyone would deny that Cemu is making good money on Patreon, but would it still if there were already another Wii U emulator that plays the most popular games with few-to-no obvious bugs? Will its income stream keep up once it reaches a high enough level of compatibility, accuracy, and features that new releases aren't so exciting anymore? I kinda doubt it.

csnes is in the unique position of being in a field that's already well-covered, by Snes9x for speed and bsnes for accuracy. People mostly want to play Mario, Zelda, maybe a few other popular games, and they absolutely already can. While I'm sure there would be a few people who would gladly pay for csnes depending on the price (myself included, even), I simply can't imagine the market for a paid SNES emulator is really very big.

_________________
Shoot the unstompable
Burn the untouchable!
ROW! ROW! FIRE FLOWER!


2018-07-19 16:08
User avatar

Joined: 2014-09-27 09:56
Posts: 1688
 Re: csnes
Also not at attack, but there's also just something about the idea of byuu making two separate emulators, one free and one paid, both aimed at the same target market, that would really bother me. I know conflict of interest isn't actually the right term for this situation, but it's something similar to that. I say this as a Patreon supporter, I'm willing to pay for the amazing things that people like byuu are willing to create for free, but I don't like the idea of seeing csnes as some kind of competitor to bsnes or higan. I think trying to break into the commercial emulation market is great though, I'm not ragging on csnes for that reason at all.

_________________
byuu wrote:
Surely I can unite the vi vs emacs crowd like I have the ZSNES vs Snes9X crowd :)



higan WIP builds available here


2018-07-19 17:41
User avatar

Joined: 2014-09-27 09:32
Posts: 851
Location: Moses Lake, WA
 Re: csnes
qwertymodo wrote:
I think trying to break into the commercial emulation market is great though, I'm not ragging on csnes for that reason at all.

Gah, I realized after reading this that maybe I wasn't so clear with my use of "commercial" in my own post, because it can mean different things by context. Edited for clarity; commerical-to-companies is a wonderful thing that SNES emulation needed. Selling directly to users (or development supported by Patreon) not so much, not in the current SNES landscape.

_________________
Shoot the unstompable
Burn the untouchable!
ROW! ROW! FIRE FLOWER!


2018-07-19 17:47

Joined: 2014-09-27 09:29
Posts: 719
 Re: csnes
As I understood it (could be wrong, obviously), csnes isn't really intended to do anything groundbreaking in an overall sense. That is, it may be a little more accurate than Snes9x (which is already much more accurate than it was just a couple of years ago) and roughly the same speed (eventually/hopefully), with the major difference being that it's legal for companies to license and sell.

In that context, there's not really much point in releasing it to the public insofar as it's not going to push community SNES emulation forward in any meaningful way. bsnes/higan already documents the SNES nicely and provides top accuracy, it's just not conducive to bargain-basement hardware. Snes9x already does its thing quite well, it's just not legal to sell it, even though lots of people do. csnes just makes selling SNES games legal for IP-holders and puts the resulting money into their and byuu's pockets instead of those of sleazy software contractors who are just rebranding Snes9x.

Likewise, releasing it under GPL is a nonstarter since many companies would just take it and sell it themselves, cutting byuu out entirely, while releasing it in source form even with a dual comm-for-pay/non-comm-for-individual-use license or similar would just invite those same unscrupulous actors who currently sell Snes9x to sell csnes instead/as well.

@byuu
Am I getting that right?


2018-07-19 19:21

Joined: 2018-07-05 12:07
Posts: 53
 Re: csnes
All points understood and I agree. However seeing he is working on a commercial emulator we will never see and exisits I was thinking for those of us willing to pay he could sell it to us.

Maybe Im wrong I dont know. Currently with what we havefrom byuu and from the snes9x team we dont NEED anything I get that.However if byuu or anyone whos work Ive used was selling an emulator at a realistic cost Ide most likely buy it just because.

But all this being said all points above make sense maybe I had a dumb idea lol


Magic Engine PCE/TG16/SGX emulator. People bought it even though it doesnt even perform sprite limit which breaks many games.

Mind you it also got pirated like crazy so maybe a very bad example.

I just get excited when I see emulators of my favorite systems in development.


2018-07-19 19:31
1, 2, 3, 4, 5  Next