Over-accuracy debate

Announce new emulators, discuss which games run best under each emulator, and much much more.

Moderator: General Mods

DataPath
Lurker
Posts: 128
Joined: Wed Jul 28, 2004 1:35 am
Contact:

Post by DataPath »

Sure, there's a lot of people vocal here. Why? Because the people reading the developer threads and posting here care. They care about the hardware itself. The people who just want to play games aren't participating in these conversations. They're just playing games.
Byuu got it exactly right there.

zsnes might be 98% (fictitious number) accurate. Additionally, the most popular games are probably going to be the ones made to work the best.

So 99.8% of everyone using zsnes will be happy with it and not posting on the boards about it. Why? Because they're out playing games. Because the games they care about work.

99.8%. That's a lot of people. That means that 2 out of every thousand people find its accuracy insufficient for them.

That 0.2% for whom zsnes is insufficient are going to be the ones interested in efforts at improving accuracy.

Like byuu said, people are here because they care. But there can be a lot of reasons why they care, and not all of them are purely related to the fun/nostalgia of playing SNES games.

To me, bsnes is a really cool engineering project - the perfect hybrid of software/hardware engineering type of problem. Accurately modeling hardware in software is a really cool idea to me. And his solutions to some of the difficult problems are absolutely fantastic.
Exophase
Hazed
Posts: 77
Joined: Mon Apr 28, 2008 10:54 pm

Post by Exophase »

Yeah, please split this thread. In the mean time I'm going to reply here.
byuu wrote:That's the same argument as saying Java does not necessarily run slower than hand-written assembler. Of course, it depends on how well it is utilized versus the other.
I don't think it's the same argument. There's a definite speed wall with Java that you can usually overcome with assembly coding. The analogy would be that a lower level emulator can be less accurate than a higher level one if it's poorly or incorrectly done. My argument is that in many cases a higher level of emulation can receive the same degree of accuracy as a lower level of one.
byuu wrote:I never said we had to get the internal state 100% exactly like hardware. If internally the chip increments X before decrementing Y, it only matters if that has an effect upon its external input or output. Internal state doesn't matter, so long as both chip input and output is 100% identical to hardware in all circumstances. That is when I will be happy. Bus perfect reads and writes under all circumstances.
What you said is that the to get the DSP emulation "right" it must be done at the instruction level. I said that this is not necessarily true (in fact, I would argue that it almost definitely doesn't have to be true). I wouldn't expect a SegaCD emulator to have to emulate the microcontroller in the CD-ROM unit at this level either.
byuu wrote:I find this comment highly condescending.

I'm not preaching theory here. If you can write a test that passes on hardware and fails in an emulator, there's a problem with the emulator. If you can pass the test without breaking something else, then I'm happy with that.
I didn't mean for it to be condescending, I was just trying to make a point that demanding a certain level of emulation based on the assumption that lower level emulation is advantageous for accuracy can be taken to this logical conclusion.
byuu wrote:Of course the games are what make it worthwhile. This is why I try so hard to preserve the hardware that they run on.
This comment in itself needs more substantiation. If the games DO run fine then what other problem is there? I understand that at some point some obscure tiny glitch may show up, and I understand that this will drive perfectionists insane. But in all practical terms this is often going well beyond the effort of preserving the essence of the games.
byuu wrote:That's a good thing! What if the final console fails (or they're so rare that testing rigs are out of reach of all emu devs), and a bug is later found in a game that invalidates our previous understanding? Now it will be impossible to ever know for sure that we've emulated this new behavior properly.
And I think this is something that most people will be able to live with. The emulators would eventually figure out something to make the game happy, or more importantly, the people playing it happy. Or you can all drive yourselves crazy for the rest of time because you don't know if that one scanline was supposed to be there on the original console or not.
byuu wrote:An established emulator author is in a much better position to continue making improvements, and understands the system a lot better. Whereas a new emulator author has to start from scratch, may have never even written an emu before, and has a good year or two of catching up to do on knowledge alone. There's only one excuse for an established emulator to fall behind, and that's apathy.

And it makes sense. You just can't keep at an emulator forever. You get tired of it after a few years and progress stalls. But saying it's bound to happen as though the new author has some sort of technical advantage ... I strongly disagree.
What about the newer reverse engineering results and documentation that are available to the new programmer? The source code of the existing emulators (even closed ones will often send their source out to other emu devs - the author of nullDC has the source to Chankast and even the next released Icarus)? Faster computers placing less of an emphasis on speed? More of a demand to do what the other emulators didn't instead of focusing on excelling at what they already do well? Better tools and compilers? There are several factors that often give newer emulator authors advantages, but I don't really have to back this up - a simple look at the history of emulators shows that previous "mature" emulators are often replaced by newer ones as the "standard", and yes, emulator authors almost ALWAYS get tired of what they're doing.
byuu wrote:Seriously, are you that far detached from the emulation scene?

Yes, I managed to get a half dozen people to care about SNES accuracy. It's very unfortunate that this attitude tends to put down other emulators. Even I've been guilty of that on occasion, and it's very shameful.

But seriously, you think that's the new popular trend? Are you kidding me? At least 98% of emulator users don't give a flying shit how an emulator works, so long as they can play their games on it. You see it with every new gaming system. There's a huge race to rig up new games to run before the competition can get there. By any means necessary. Even the SNES scene does it. Look at these pitiful graphics packs, for example.

Sure, there's a lot of people vocal here. Why? Because the people reading the developer threads and posting here care. They care about the hardware itself. The people who just want to play games aren't participating in these conversations. They're just playing games.
First of all, this is far from just you or a BSNES thing, although I do think BSNES has helped fuel the demand for "more accuracy, at any cost."

Second of all, it's far from just HERE, it's emutalk, NESdev, ROMhacking.net, even ngemu. Did you notice that mudlord has echoed my sentiments? And some people are really, really hostile about it. I know you already saw MooglyTwo's flaming rant on emutalk about trash N64 emulators.

Maybe by "detached from the emu scene" you mean I only spend time around people that are seriously involved in it, and not casual users. In which case I'd ask you to clarify exactly what it is you consider the emu scene.
byuu wrote:Unfortunately, there's too many variables (features, longevity, etc) that affect how popular an emulator is, so I can't prove this just by download counts alone.
It might surprise you to know that everywhere I see it mentioned BSNES is unequivocally considered the very best SNES emulator. It's kind of seen as the fine gourmet selection of SNES emulation - it's a little more expensive but it's a delicacy and anyone with REFINED tastes knows it's the best. This is the basic attitude surrounding it. Not that I'm saying it's not the best, but as you say there are far more variables that should be used in determining the "best" than just accuracy.

I for one want faster SNES emulators for handhelds.
byuu wrote:But you think that speed/feature oriented emulators are being unfairly attacked? Good lord, I really should start saving some of the discussions attacking my intellect just because other emulators are faster than mine. Nine out of ten threads in my referral logs have multiple people discrediting me. I'm absolutely flattered that people such as Clements defend me on these forums.
I've never once seen you get attacked for preferring accuracy, only praised, regularly. Of course you're going to see personal attacks directed towards you probably more than anyone, but I think - and I say this as a compliment - that you're much more generally respected than you realize.
byuu wrote:And for you to spin this like this Accuracy Cult is going around attacking all of these innocent minority speed-oriented emulators ... absolutely incredible.
My "spin" is that a lot of people these days don't even have a good understanding of what the accuracy they speak of IS but they demand it from emulators. I know you saw that OTHER thread about N64 emulation on emutalk where the guy kept demanding cycle accuracy and you came in to tell him it was pointless. Isn't this thread awfully similar too? People have always demanded things from emulators, this is just something new now that a lot of other demands have been met. "Cycle accuracy", whatever that is.
byuu wrote:Look, bottom line. We disagree on how an emulator should work, and discussing it won't change that.
We don't disagree nearly as much as you think. I don't like the attitude about accuracy that a lot of people have, that doesn't mean that I hate accuracy. In fact, in many ways my PCE emulator is more accurate than Ootake and Mednafen, I can't really speak for Magic Engine (at the least I'm actually trying to use VDC timing and CD seek variables based on tests done on hardware). I do care about accuracy, but I don't obsess over it and criticize others endlessly because of it. You're actually much more mild than some people, people who are unfortunately much less informed than you as well.
byuu wrote:Yes, I care about hardware behavior that doesn't affect any games. Because once the original console is gone, we won't have a way to ever determine how that works. Who are we to know what may or may not take advantage of that hardware in the future? Or what bugs we haven't discovered yet? How will we ever be 100% sure homebrew would work on real hardware 20 years from now if our emulators only care about getting known games working now?
Things that affect no games affect no games. The wonderful thing about homebrew is that if it has weird behavior it can be changed. Or if the hardware doesn't exist anymore then what difference does it make? Or do you mean to say that it would be a travesty if the game is supposed to have some bug on hardware that no longer exists? Maybe someone will pull out the last surviving SNES on display at a museum and plug in some amazing new work of homebrew just to find, to the audience's great shock and disappointment, that it doesn't work exactly the same (okay, now I'm being a little condescending)
byuu wrote:I think (read: this is a personal opinion) that accuracy is more important than speed. The former ensures a great experience for the future as machines continue to get faster, while the latter gives promise for today and is eclipsed with time (re: NESticle.) But both can exist at the same time! It's the best of both worlds!

Do I think speed-focused emulators that sacrifice accuracy of "unimportant" things are inferior? If you mean for playability, I think they are vastly superior. If you mean for preservation, yes. These aren't elitist comparisons. They're technically valid when you put the emotions aside. If someone says "I want to play Super Mario World", I tell them to use ZSNES. It's a truly fantastic emulator. If someone is developing a fan translation and lacks a copier, I ask that they use an emulator that supports hardware VRAM write limitations. ZSNES is not one of them.
I really don't get why you think I'm saying accuracy focused emulators are a bad thing and serve no purpose. I don't like the ATTITUDE of people, which often doesn't even represent what they really want. I strive to have both as much as possible. Don't take this as an insult, but I don't think BSNES makes as much of an effort towards efficiency as it could (yes, I've looked at the source...). I understand this is for more reasons than just accuracy as well, IE, "clean" code. Whatever the case, that's fine. I think the important thing is to have a good understanding of where the accuracy is and isn't - if accuracy is sacrificed for speed (such as introducing latency between interacting devices) then this should be a conscious effort, and ideally should be one that's optional at the source level.

Many people would actually recommend BSNES for playing SMW. If your computer isn't fast enough they may even recommend getting a faster one. I see this much more than I see "just use ZSNES, for this game it's fine." When it comes to homebrew development I would recommend using as both emulators (and SNES9x) and a real console, to ensure that as many people can play it as possible. But primarily develop on BSNES.
byuu wrote:Do I think a non-accurate emulator is worthless? Nothing is ever worthless, but you have to look at what value it provides today. Let's look at NESticle. It has been superseded in accuracy, compatibility, features and possibly even speed. About the only thing it is useful for today is as an ultra-low requirement emulator that can run on very, very, very old hardware (486es and such.) It's value has been seriously reduced through time. Nobody is arguing that it was bad when it came out, they're saying it isn't that great anymore. Big difference. It's also closed source, which does nobody any good.
The truth is that in time most emulators are superseded by another. NESticle was not good for preservation, but NESticle might have also contributed towards the development of other emulators (we have little way of knowing for sure). Of course it isn't great anymore, but people do constantly insult it - I don't see why it should be singled out compared to the other vast multitude of emulators that have been made obsolete. There are very often elitist strings attached to it (like, how not to do an emulator), but I understand that a lot of this is a reaction to other people using it far past its expiration date.

I do agree that in principle preserving games is a more far reaching and significant goal than allowing people to play them now, or play them on various platforms (such as handhelds). On the other hand, it's impossible to really know for sure. For some consoles there will be a span of time where they're popular, but afterwards interest may sharply decline. 100 years from now it may be the case that few want to play SNES games; although this is hard to imagine it will at the very least be long of after nostalgia has worn off.

I know you don't think "non-accurate" emulators are worthless. Other people do. They've said this.
byuu wrote:One thing that annoys me is that people insist on comparing speed-oriented emulators against accuracy-oriented emulators and putting down our work, and that's flat out wrong. Period. You and I both agree on that. They serve different purposes, and aren't meant to compete.

At the end of the day, it doesn't really matter. I'll do my thing, and you do yours. And let's all make a concentrated effort not to put down others for working on an emulator for free. End users can pick whichever approach they prefer and voice their opinions in a friendly manner.

One thing I agree upon is that end users aren't really prepared to gauge emulator accuracy. The only way to tell for them is based on game compatibility, which can be skewed both by game-specific and global hacks. The former can even be hidden in closed source applications, and we'd be none the wiser.
I think that we'd HAVE to eventually know that a closed source emulator is "cheating" or else it'd defeat a lot of what you're saying about preservation/accuracy, wouldn't it? Although a closed source emulator will only be preserved in other emulators anyway (but this should still be valid..)

Really, I'm not against what you do. I don't really know exactly how to say this, because I do respect you a lot and actually agree with you more than you may be aware. I'm sorry if you took this personally because it actually wasn't directed at you - and I think you've even responded to some of the people I do have issue with in a way similar to how I would have responded.

I don't think that I take an opposite stance to yours when it comes to how I want to do an emulator, although I do have speed goals from the beginning (that's the reason why I've started emulators, to be faster than others).
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

Exophase wrote:This comment in itself needs more substantiation. If the games DO run fine then what other problem is there? I understand that at some point some obscure tiny glitch may show up, and I understand that this will drive perfectionists insane. But in all practical terms this is often going well beyond the effort of preserving the essence of the games.
I think you're underestimating the people who know about the game inside+out. The perfectionists are one group that obsess, but the primarily the ones that give the most damn about the game are the first to notice these things. They are more likely to report them as bugs, and they should because they are generally legitimate ones for the system. Some of the obscure ones are intended behavior, and you can debate all you want on how irrelevent it is, but when a critical thing is not correctly emulated causes actual problems, this is where you simply can't trade accuracy for speed (or vice versa) here.

For those people, accuracy does have a greater value than speed.

Emulation in general always initially favors speed and compatibility over accuracy. Later on, accuracy becomes of vital importance (and hopefully general speed optimizations are done as result). The performance will always be lower (even if it is a slight difference, but eventually add up over time) as these details are researched further. This has always been the trend, and will continue to be that way. So if you truly value speed, you will always find people complaining about a small detail that has not been dealt with correctly. You will find these people, just as you may find them bashing such emus for the same reason.

In the end, people do care more about the games than anything else.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
Exophase
Hazed
Posts: 77
Joined: Mon Apr 28, 2008 10:54 pm

Post by Exophase »

Deathlike2 wrote:I think you're underestimating the people who know about the game inside+out. The perfectionists are one group that obsess, but the primarily the ones that give the most damn about the game are the first to notice these things. They are more likely to report them as bugs, and they should because they are generally legitimate ones for the system. Some of the obscure ones are intended behavior, and you can debate all you want on how irrelevent it is, but when a critical thing is not correctly emulated causes actual problems, this is where you simply can't trade accuracy for speed (or vice versa) here.

For those people, accuracy does have a greater value than speed.

Emulation in general always initially favors speed and compatibility over accuracy. Later on, accuracy becomes of vital importance (and hopefully general speed optimizations are done as result). The performance will always be lower (even if it is a slight difference, but eventually add up over time) as these details are researched further. This has always been the trend, and will continue to be that way. So if you truly value speed, you will always find people complaining about a small detail that has not been dealt with correctly. You will find these people, just as you may find them bashing such emus for the same reason.

In the end, people do care more about the games than anything else.
Basically, this is the approach I take: sometimes it's very likely that no game will rely on a particular behavior, a behavior that may be complex to emulate and at a high performance cost. If this kind of problem does come up then it can be rectified then. Until then emulator authors can keep their fingers crossed. The alternative approach (which many advocate, unfortunately many who aren't emulator authors as well) is to do things as accurately as possible from the beginning. Sometimes this involves modeling something that isn't based on correct information to begin with and actually ends up hurting accuracy more than it helps it (putting in any kind of cycle delays that are incorrect will almost always hurt you more than help, VBA has fallen into this trap before)

I don't think that faster computers is the only reason that an emulator like BSNES was started when it was as opposed to earlier on. I think that the bigger contributor is that it took a lot of time for the dust to settle on the details of the SNES for anyone to really be confident enough to even try for this level of acccuracy.

If someone tried to do a perfectly accurate XBox emulator right now they'd probably drive themselves insane with the complexity of getting the CPU timing right (which as far as I'm aware is not 100% publicly documented, unlike older CPUs). It would be very slow, but it'd also be very complex and most likely very unnecessary.

byuu himself has said this several times, but I'd may as well echo it: platforms like NES, SNES, and PC-Engine have games that rely on very fine grained accuracy much more than later platforms like PS1, N64, GBA, etc. One of the main reasons for this is because they have tiny hblank intervals (in terms of how many CPU instructions may be performed) where things must be done, and if these intervals are emulated too long/too short then there will be glitches. That's just one example, but I think it characterizes the demand for high cycle accuracy.
Dullaron
Lurker
Posts: 199
Joined: Mon Mar 10, 2008 11:36 pm

Post by Dullaron »

Where is your PCE emulator host? Care I try it out?
Window Vista Home Premium 32-bit / Intel Core 2 Quad Q6600 2.40Ghz / 3.00 GB RAM / Nvidia GeForce 8500 GT
ZH/Franky

Post by ZH/Franky »

You have to realise that cycle-exact emulation is only practical at least 10 years after the console is dead.

Noone could run bsnes 10 years ago, for example. They'd be using zsnes or something, since it's the only way to play at full speed.

Sure, cycle-exact psx emulation is possible now, but it won't run at full speed right now.

Plus, sometimes cycle accuracy is just silly. If you have a system with only 30 or so games for it, only half (or less) of the system probably needs emulating correctly, and you can just hack out the rest, and still have a very good emulator that is compatible with all games, no glitches whatsoever.
And the parts that need emulated correctly, probably don't need to be anywhere near perfect anyway.
Exophase wrote:If someone tried to do a perfectly accurate XBox emulator right now they'd probably drive themselves insane with the complexity of getting the CPU timing right (which as far as I'm aware is not 100% publicly documented, unlike older CPUs). It would be very slow, but it'd also be very complex and most likely very unnecessary.
Especially since the CPU in the Xbox is x86, like a PC. In fact, there's probably very little difference between an xbox and a pc.
byuu

Post by byuu »

The analogy would be that a lower level emulator can be less accurate than a higher level one if it's poorly or incorrectly done. My argument is that in many cases a higher level of emulation can receive the same degree of accuracy as a lower level of one.
My point exactly. "If poorly or incorrectly done."

With the SNES, we know the exact levels of precision needed to ensure that input and output always match.

S-CPU = ~10.5MHz
S-PPU = ~10.5MHz
S-SMP = ~1.024MHz
S-DSP = ~1.024MHz

Now you'll say, the S-CPU runs at ~21MHz, and the S-DSP at ~2.048MHz! Yes, but the CPU's minimum cycle length is 2, and the S-DSP always executes exactly two cycles before executing one S-SMP cycle. Anything less than this, and it's absolutely impossible to pass all edge cases. That's not theory.

Now if someone were to say, "no, you need to break the S-DSP down to 2.048MHz!", I'd probably scoff at that, too.
What you said is that the to get the DSP emulation "right" it must be done at the instruction level. I said that this is not necessarily true
It is for the S-DSP. You have to run it at 1.024MHz. Otherwise, games will fail. Koushien 2, for instance, writes to the echo data location register while echo writes are enabled. If you emulate it at the sample level, 32KHz, you'll end up writing echo data on top of program code and crashing the game.
If the games DO run fine then what other problem is there?
Basically, as you allude, perfectionism. Remember Puzzle Bobble or whatnot in MAME? They had simulated this logic chip or whatever, and it ended up causing very subtle changes in behavior of the game that nobody noticed.

I know that really doesn't matter to most. I know I'm neurotic about this. But you know, we have the knowledge, we have the ability, we have the technology ... why the hell not see what we can do? We already have speed-focused emulators. The alternative is to just stop trying because we already have all known games working. And that's lame :P
What about the newer reverse engineering results and documentation that are available to the new programmer? Faster computers placing less of an emphasis on speed? Better tools and compilers?
This is all available to existing emulator authors, too. They fall behind because they don't work as hard as the new guys. I'm tiring myself (though mostly from having nobody else to talk technical with). I hope someone surpasses me soon, too.
although I do think BSNES has helped fuel the demand for "more accuracy, at any cost."
I know, I pushed way too hard for way too long. As I said, shameful behavior. I learned a lot along the way, too. That decisions are not so clear cut, that there's no right way to do anything (just a lot of wrong ways.) The savestate issue, for instance. That was really tough. And splitting up a CPU to subcycle levels the normal way is absolutely painful beyond any normal person's imagination.
Second of all, it's far from just HERE, it's emutalk, NESdev, ROMhacking.net, even ngemu. Did you notice that mudlord has echoed my sentiments? And some people are really, really hostile about it. I know you already saw MooglyTwo's flaming rant on emutalk about trash N64 emulators.
NESdev is a given. That's the whole point of that site ;)

I don't so much agree with the other sites, from what I've seen personally. But then you've seen other stuff. I suppose it's true that we see more of what bugs us than what does not.

And we both agree that it's not cool to attack another freeware emulator for any reason.

But I'm forced to continue to disagree about the severity of people attacking speed-oriented emulators. I still think the tide is far from turned on that issue.

MooglyGuy -- in a lot of ways, he reminds me of the passion I had when I first started out. I think he'll calm down in time. But I shouldn't say too much, as I don't the guy at all. But both myself and him started off in scenes where accuracy was the absolute last thing on people's minds. When you're immediately backed against a wall, you tend to start swinging a lot faster.
In which case I'd ask you to clarify exactly what it is you consider the emu scene.
As you surmise, the casual users.
I've never once seen you get attacked for preferring accuracy, only praised, regularly.
I'm sorry that I don't keep thread post links handy (that'd honestly be a bit creepy). But I assure you this is not the case most of the time. Here and on RHDN? Yes, people are exceptionally nice to me. I'm extremely flattered by that. I also have a real presence on these sites to explain my actions.
My "spin" is that a lot of people these days don't even have a good understanding of what the accuracy they speak of IS but they demand it from emulators. I know you saw that OTHER thread about N64 emulation on emutalk where the guy kept demanding cycle accuracy and you came in to tell him it was pointless.
True, I actually meant to address that but the post was too long already. I've been over my feelings on this before, but I'll repeat them.

The faster a system gets, the less accuracy it needs. It's not even so much that we don't want that same degree of accuracy as it is that it's not really possible even if we did want it.

I would be absolutely floored if someone managed to successfully emulate all five pipelines stages of the N64 CPU. But even if he did, the system requirements would put it out of reach for casual gamers for decades to come.

These systems continue to get more and more complex, and fine grained precision becomes much harder, as well as less important. I guess if I had to define it, my goal is to do as much as possible, and be happy that it's all I could do.

Even I have to say "enough is enough" sometimes. It would take several months, or even years, of research to emulate hardware mul/div partial calculations resultant from reading the output registers too quickly. And zero commercial games do this, for the obvious reason that any game experiencing "bizarre" results would quickly find and fix their bug.

It doesn't mean I don't find it important. It doesn't mean I think it's pointless to try and emulate it. It just means I'm one person and I'm forced to allot my time to improve what I can. I choose to focus on the more important issues first.

And with the current state of N64 emulation, focusing on a cycle-accurate CPU core with full five-stage pipeline emulation is pretty low on the priority list.
We don't disagree nearly as much as you think.
I'm starting to see that. I apologize, you had so many comments on this massive accuracy push thing going on that it gave me the wrong impression.
Or do you mean to say that it would be a travesty if the game is supposed to have some bug on hardware that no longer exists?
I know we can never reach perfection. But I care enough to keep pushing forward and trying, where most others say "man, that's good enough." That's fine if you think it's good enough. Leave me be to keep going forward until I give up, too.
Don't take this as an insult, but I don't think BSNES makes as much of an effort towards efficiency as it could (yes, I've looked at the source...).
No, I agree, and have said as much. The CPU IRQ testing was based on being easy for me to work with. As it stands, that part of the code eats up over 40% of CPU time. It's very inefficient. Even the accuracy is a lot worse than it could be. I've also gone at length about that. The PPU renderer is such a joke that it's sad. But that at least boils down to lack of time more than lack of effort. Unfortunately, as a hobby, I still have to work a very demanding day job :/

I'm very upfront about the shortcomings, and I'm amazed people are as nice as they are. I really wish someone smarter than me would come along and show me up. I'm not looking to be the best, just to help push things forward.
I see this much more than I see "just use ZSNES, for this game it's fine."
Man. You know, I've been told that I've intentionally hacked a game to break in ZSNES, just to promote my emulator. Funny since the Japanese game has the same problem, but I digress. We certainly see very different things on the expansive internet.
I do agree that in principle preserving games is a more far reaching and significant goal than allowing people to play them now
That's just it. The goals co-exist! Work on an accurate emulator will tell you how the hardware really works. Now you can figure out the best way to create a faster emulator based on that knowledge. Both can exist at the same time! Like you said, worst case is you can comment it out in source code.

I look at current emulators that spend the better part of a decade patching bugs in games, which just cause new bugs in other games. And then timing changes end up breaking all the old hacks. And then you end up with hacks for games that don't need them. And you end up in this circle where you never make any real progress.

To me, it just seems like always sticking to hardware is best. To hell if your change is slow, and if it breaks a bunch of games. That's because something else is also wrong. Once you fix that, you'll get everything working in unison. No hacks, no guesswork.

From there, one can create an optimal emulator that runs on slower devices.
I know you don't think "non-accurate" emulators are worthless. Other people do. They've said this.
Yes, but people think slow emulators are worthless, too. You just have to ignore them, really. I know, much easier said than done. But there's always assholes in this world who can't do anything but insult someone for working their ass off to give them a product free of charge. Like me complaining about closed source emulators for instance. That's extremely annoying.

I don't know, maybe we have some sort of biological need to bitch about things that upset us. Where's that tcalludilig2 guy at when you need him? Need to get some Jung Psychology in here ;)
I think that we'd HAVE to eventually know that a closed source emulator is "cheating" or else it'd defeat a lot of what you're saying about preservation/accuracy, wouldn't it?
I don't know. Nobody knew SNESGT was soft-patching so many BS-X games. Most people were under the impression that it had vastly superior BS-X emulation. And hell, maybe it does. GIGO is an extremely intelligent guy. Can't tell without the source. But you can see the patching with the memory viewer if you know where to look.

But then, you really have no choice with the BS-X but to patch the games. There's really no other way to emulate a system like that; based on timed, real-life events, satellite transmissions; games that expired and games that could only be played during certain hours of the day. And games that are ridiculously rare. Not all are dumped, and many of those that are have been hacked for emulators already. I'm not at all faulting him for using hacks under these circumstances. It's just interesting how few know about them.
Really, I'm not against what you do. I don't really know exactly how to say this, because I do respect you a lot and actually agree with you more than you may be aware. I'm sorry if you took this personally because it actually wasn't directed at you - and I think you've even responded to some of the people I do have issue with in a way similar to how I would have responded.
Thank you. I didn't really take it too personally, no worries. I know I'm mostly responsible for the anti-hack push around the SNES scene, so I kind of take it upon myself to defend the other side here.
I don't think that I take an opposite stance to yours when it comes to how I want to do an emulator
That's cool. Look me up if you ever try an SNES handheld emulator. Perhaps I can be of some assistance.
Basically, this is the approach I take: sometimes it's very likely that no game will rely on a particular behavior, a behavior that may be complex to emulate and at a high performance cost. If this kind of problem does come up then it can be rectified then.
Well, if I understand how that behavior works, I'll add it even when no game (that we know of) relies on it. I've added a lot like that. IRQB timing, mode 7 extbg mosaic glitch, half-height OAM sprite glitch, etc etc.

But if I know it'll take too much time to figure out, and I know of nothing that relies on it, I will focus on more important issues before coming back to it. Not much choice, with limited resources you have to make painful compromises sometimes.
Sometimes this involves modeling something that isn't based on correct information to begin with and actually ends up hurting accuracy more than it helps it
And you learn it's incorrect by implementing it and seeing when it breaks something. That's just part of the process. The alternative is to ignore it and never get it right.

I had perceived 100% compatibility for months, yet I kept changing things that could potentially break games anyway. But in doing so, I've probably fixed some bugs that were just as-yet undiscovered.
I don't think that faster computers is the only reason that an emulator like BSNES was started when it was as opposed to earlier on.
The only reason I didn't start sooner was because I doubted myself too much. I didn't think I'd ever get a single commercial game playing. I seriously overestimated the difficulty of writing an emulator.
I think that the bigger contributor is that it took a lot of time for the dust to settle on the details of the SNES for anyone to really be confident enough to even try for this level of acccuracy.
I disagree. SNES memory access timings were figured out in 2003. DRAM refresh timing in 2001 or so. PPU long dots and the short scanline and such were known from the NES days. The cycle-level breakdown of the 65816 was documented by WDC back in 1997. Nobody tried adding them until 2005, perhaps because they were perceived to not be too important, or perhaps because they were thought to be too complex.

I think a lot of it was that the original SNES emu authors left (zsKnight, _Demo_, Jeremy Koot and Gary Henderson), and the new maintainers weren't too confident about ripping out the core of an emulator to replace it. And it'd defeat the purpose to start over.

But that's speculation, too. We can always ask them directly, can't we? ;)
If someone tried to do a perfectly accurate XBox emulator right now they'd probably drive themselves insane with the complexity of getting the CPU timing right (which as far as I'm aware is not 100% publicly documented, unlike older CPUs). It would be very slow, but it'd also be very complex and most likely very unnecessary.
Agreed completely. I honestly don't believe we'll ever see a perfectly accurate Xbox emulator. It's just too complex for the few people that get involved in writing emulators to ever figure out. People in the fifth generation and above need to realize this :/

We're really pushing it with the fourth generation as it is ... but I think it's doable with the SNES. I just don't think I can do it alone. And I'm deeply saddened that I appear to be the last one left working on it (sans blargg's recent breathtakingly awesome S-DSP research). Or at least, nobody else working on this is talking to me about it ...
Gil_Hamilton
Buzzkill Gil
Posts: 4294
Joined: Wed Jan 12, 2005 7:14 pm

Post by Gil_Hamilton »

Franky wrote:Plus, sometimes cycle accuracy is just silly. If you have a system with only 30 or so games for it, only half (or less) of the system probably needs emulating correctly, and you can just hack out the rest, and still have a very good emulator that is compatible with all games, no glitches whatsoever.
And the parts that need emulated correctly, probably don't need to be anywhere near perfect anyway.
And the fans would be very disappointed later on when they started trying to develop homebrew software and discovered their code wouldn't run on the real system.


BTW, you just described the Vectrex. For ages, DOS Vectrex Emulator was the only emulator around. And while a reasonably decent first emu(it even supported the light pen, and a few different ways to do 3D), no doubt benefitting greatly from the publically-released system documentation from the original creators, it had problems.

Sound was quite wrong.

While it DID run everything, there were some glaring glitches in some rather blatant locations.
Most visibly, the MineStorm game that was integrated into every Vectrex would invariably fail to seed the first stage properly.
Less visibly, Berzerk would crash as things got too busy(to be fair, the game behaves pretty ugly on a real system when things get busy, as the time needed for the hardware to draw a frame goes up with complexity, and Berzerk gets VERY choppy and flickery due to it).

And finally, the display was not emulated even remotely properly, leading to a rather lackluster experience.
But then, vector displays are almost never done right in emulation, so it's not fair to single DVE out for this when MAME doesn't do it a lot better.

No offense to the MAME guys. I'm quite aware it's outside the primary goal of the project, and you've all done an amazing job.
But it's still something I'd like to see.



I've got no idea how DVE fared as a dev platform, but I doubt it was particularly good. As far as I know, the Veccie homebrew activity has always been focused on EPROMs and real systems.




Where am I going, beyond "I love my Vectrex"?
If a job is worth doing, it's worth doing right.
If you think the system is worth emulating, expend the effort to get it reasonably accurate.
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

Exophase wrote: Game hardware is a means to an end, to allow us to run software that has been written for it. This is why we are comfortable with using emulators, which do not resemble the original hardware in any way. I believe that what you wish to preserve is the ability to run the software, and this means any software that ever has been or will be ran on it, with no discernible variation from the way it would run on original.
I think as new and crazier timing bugs kept getting found, even in popular games like Secret of Mana and R-Type III, achieving 100% perceived accuracy on a system with thousands of games by stopping short and resorting to game specific hacks would probably have been even more time consuming than being an accuracy whore. After all, isn't it true that the behavior of a hack can change as base code changes are made? How would a person check the integrity of each hack throughout code changes? That would be maddening. If you ever did something like this, it would have to be the last thing you did before stopping work entirely on the emulator, because it just isn't desirable to have during the process of writing it. I think there is a serious exception you have to take when it's an older system and when the system has thousands of games like the NES and SNES do.

Furthermore, most of the fixes that byuu has found ended up having no speed tradeoff - it was just some typo or previously unknown nuance in the hardware. I imagine stuff like this would have gotten hacked or unsolved on a lower level emulator as the author would be apt to blame it on the nature of low level emulation. Those are discoveries that can be backported to an opcode version if he ever makes one. It almost seems like the best strategy for both worlds, you get your high level first and then rewrite down, having found and understood things you hadn't before.
Last edited by FitzRoy on Wed Apr 30, 2008 1:26 am, edited 2 times in total.
Snark
Trooper
Posts: 376
Joined: Tue Oct 31, 2006 7:17 pm

Post by Snark »

byuu wrote:
If the games DO run fine then what other problem is there?
Basically, as you allude, perfectionism. Remember Puzzle Bobble or whatnot in MAME? They had simulated this logic chip or whatever, and it ended up causing very subtle changes in behavior of the game that nobody noticed.
Bubble Bobble /nitpick. And yes, it was the monster behaviors that differed slightly.
Exophase
Hazed
Posts: 77
Joined: Mon Apr 28, 2008 10:54 pm

Post by Exophase »

byuu wrote:My point exactly. "If poorly or incorrectly done."
Yes, this is what I was trying to say your point was, but I don't agree with it. I think that sometimes a higher level implementation may be as good or better than a correctly done lower level implementation, not just an incorrectly done one.
byuu wrote:With the SNES, we know the exact levels of precision needed to ensure that input and output always match.

S-CPU = ~10.5MHz
S-PPU = ~10.5MHz
S-SMP = ~1.024MHz
S-DSP = ~1.024MHz

Now you'll say, the S-CPU runs at ~21MHz, and the S-DSP at ~2.048MHz! Yes, but the CPU's minimum cycle length is 2, and the S-DSP always executes exactly two cycles before executing one S-SMP cycle. Anything less than this, and it's absolutely impossible to pass all edge cases. That's not theory.

Now if someone were to say, "no, you need to break the S-DSP down to 2.048MHz!", I'd probably scoff at that, too.
I personally emulate everything for PC-Engine in units of master cycles, and if I were emulating an SNES I'm certain I would do the same (even if it were never nearly as accurate as BSNES, which it probably couldn't be). If there are multiple clocks I would possibly try to operate at a common multiple of both (to as much precision as is necessary). Anyway, what I was trying to say with the DSP is not that the timing need not be absolutely correct to pass all tests, but that you don't necessarily need to emulate each instruction in the ROM in the same way you would the CPU instructions. Knowing what the actual instructions are and what they do would help a lot, but there are obvious means of optimizing this that would go well beyond even what static recompilation could do. This is what I believe to be the essence of HLE - precompiling behavior to a more efficient (but computational equal!) version that's more suitable for the platform where you're emulating it.
byuu wrote:It is for the S-DSP. You have to run it at 1.024MHz. Otherwise, games will fail. Koushien 2, for instance, writes to the echo data location register while echo writes are enabled. If you emulate it at the sample level, 32KHz, you'll end up writing echo data on top of program code and crashing the game.
Sorry, are walking about the same DSP here? I mean the DSP-1a/b through DSP-4 chips, not the audio DSP. I understand your point very well about emulating things at the right clock speed granularity though. As I'm sure you also understand, it's possible to do this with logging or "catch up" techniques as a means of optimization, since usually a game does not constantly change the state of the device (and even if it did the CPU is a major limiting factor preventing it from changing it at every clock cycle, the instructions are just way too slow). But this is of course an optimization, not a sacrifice in efficiency.
byuu wrote:Basically, as you allude, perfectionism. Remember Puzzle Bobble or whatnot in MAME? They had simulated this logic chip or whatever, and it ended up causing very subtle changes in behavior of the game that nobody noticed.

I know that really doesn't matter to most. I know I'm neurotic about this. But you know, we have the knowledge, we have the ability, we have the technology ... why the hell not see what we can do? We already have speed-focused emulators. The alternative is to just stop trying because we already have all known games working. And that's lame :P
If it makes you feel better, the remaining scanline bugs in my PCE emulator drive me crazy too. It was especially hard to deal with the more hardware verified numbers doing worse in some games than the numbers I cooked up from basically nowhere. There are hard to determine things which cause additional stalls, so it seems, but I felt much better when I found that the "real" numbers actually fixed several games that I did not personally test. I strongly felt like trying to fabricate something that would make all games happy, but after toying with it a bit I found that it was basically impossible and not worth it. Deep down I know I wouldn't have been happy with this. I'm not happy with using per-game hacks either (unless it's getting around weird, non-standard ROM dumps.. but let's not count that)
byuu wrote:This is all available to existing emulator authors, too. They fall behind because they don't work as hard as the new guys. I'm tiring myself (though mostly from having nobody else to talk technical with). I hope someone surpasses me soon, too.
Sorry, what I meant is that new emulator authors have advantages over people who did emulators but stopped years ago. In this particular example, pSX vs. ePSXe.
byuu wrote:I know, I pushed way too hard for way too long. As I said, shameful behavior. I learned a lot along the way, too. That decisions are not so clear cut, that there's no right way to do anything (just a lot of wrong ways.) The savestate issue, for instance. That was really tough. And splitting up a CPU to subcycle levels the normal way is absolutely painful beyond any normal person's imagination.
I can really only imagine. Although I'm sure you're happy with the deeper understanding it has given you of crafty CPUs ;D
byuu wrote:NESdev is a given. That's the whole point of that site ;)
Okay, here's the thing with NESdev, to try to illustrate what I mean. These guys have performed miracles with NES reverse engineering. And as far as I've ever seen, the people responsible for these miracles have always been reasonable towards other emulators. And some of them have pulled off some emulators that are both amazingly fast and accurate to boot.

What I don't like is the mentality surrounding the people who go there and do new NES emulators. I saw someone go there and mentioned that he was doing a line based emulator, only to have someone tell him that he isn't doing it right, that pixel accuracy is the "new standard" for NES emulation. As far as I'm concerned NES emulation is enough of a solved problem that unless you're working on something that does push forward accuracy more than the rest already have then you shouldn't be putting down an emulator for sacrificing a few percent of accuracy. Some of the people there aren't contributing towards improving understanding or preservation, they're just imitating what has already been done (and guides have even been written on how to do this). That's fine, but I don't think this warrants an elitist attitude.
byuu wrote:MooglyGuy -- in a lot of ways, he reminds me of the passion I had when I first started out. I think he'll calm down in time. But I shouldn't say too much, as I don't the guy at all. But both myself and him started off in scenes where accuracy was the absolute last thing on people's minds. When you're immediately backed against a wall, you tend to start swinging a lot faster.
I understand the guy's frustration with respect to lack of low level RSP emulation for N64. But some people put down the HLE technique as if it's a terrible thing that has cost a great deal. The truth is that if one so desired it should be entirely possible to use HLE only where it's known it'll work (not on a per-game hack kind of basis, but by looking at the code the game uploads) and falling back on LLE otherwise. This would have allowed for much greater acceptance, but I think that those interested find this to be too "impure." GBA emulators will usually HLE BIOSes, but can fall back on the real thing too - same principle (mine doesn't HLE BIOS but that's just because I'm lazy)
byuu wrote:As you surmise, the casual users.
I think I must be oblivious towards them by now, I've avoided a lot of them in a general kind of way for years. Except a large part of my own userbase who are probably even beneath that >_<
byuu wrote:Even I have to say "enough is enough" sometimes. It would take several months, or even years, of research to emulate hardware mul/div partial calculations resultant from reading the output registers too quickly. And zero commercial games do this, for the obvious reason that any game experiencing "bizarre" results would quickly find and fix their bug.

It doesn't mean I don't find it important. It doesn't mean I think it's pointless to try and emulate it. It just means I'm one person and I'm forced to allot my time to improve what I can. I choose to focus on the more important issues first.
I agree with you, but on the other hand I think a lot of the interest is rather academic. It's human nature to want to understand as much as possible.

I do think you've touched upon an interesting point. There are different classes of accuracy. When it comes to timing, potentially anything can be sensitive to it. I'm always scared to death that a bug will be timing related, because those are so difficult to determine. Fortunately in more complex systems these rarely show up at all unless the timing is way off (undercutting the real system tremendously).

The other class of accuracy is about support more deterministic things. Such as reads from "invalid" regions of memory, or branching into the middle of I/O registers, or certain hardware bugs. These are things that games will often just not do or rely on because there's no reason for them to, but some might anyway because they're broken and got lucky.
byuu wrote:Man. You know, I've been told that I've intentionally hacked a game to break in ZSNES, just to promote my emulator. Funny since the Japanese game has the same problem, but I digress. We certainly see very different things on the expansive internet.
I've been told so many ridiculous and disrespectful things by users of my emulator (on PSP, anyway, GP2X crowd is cool) that I've basically started tuning it out. Maybe this is the kind of crowd that's harrassing you ;)
byuu wrote:That's just it. The goals co-exist! Work on an accurate emulator will tell you how the hardware really works. Now you can figure out the best way to create a faster emulator based on that knowledge. Both can exist at the same time! Like you said, worst case is you can comment it out in source code.

I look at current emulators that spend the better part of a decade patching bugs in games, which just cause new bugs in other games. And then timing changes end up breaking all the old hacks. And then you end up with hacks for games that don't need them. And you end up in this circle where you never make any real progress.

To me, it just seems like always sticking to hardware is best. To hell if your change is slow, and if it breaks a bunch of games. That's because something else is also wrong. Once you fix that, you'll get everything working in unison. No hacks, no guesswork.
I agree. I think what I find myself going against is the notion that shooting for speed means disregarding accuracy.

What a lot of people don't realize is that per-game hacks are usually not speed hacks but are in there to get a game working because no one understands why it doesn't otherwise. Ootake is the only game that plays the cinemas in Popful Mail correctly. But it does this with the most elaborate hack I've ever seen. First, it overclocks the CPU so that every instruction takes only one cycle. Then it checks the CD access constantly and skews the timing if it's on a certain track. It does more as well, although I can't quite remember what. All of this actually makes the emulation significantly slower (there's even a disclaimer that this game will be more demanding than others). I am 95% confident that emulating the hardware correctly would be more efficient than this, but no one knows what's going on.

Like yourself, I would much rather have the game be broken (and for me, it is) than hack around it and forget about the problem, which may be affecting other games. Ootake is full of so many hacks that I can barely understand a lot of the source, much less depend on it as documentation of the system.
byuu wrote:Yes, but people think slow emulators are worthless, too. You just have to ignore them, really. I know, much easier said than done. But there's always assholes in this world who can't do anything but insult someone for working their ass off to give them a product free of charge. Like me complaining about closed source emulators for instance. That's extremely annoying.

I don't know, maybe we have some sort of biological need to bitch about things that upset us. Where's that tcalludilig2 guy at when you need him? Need to get some Jung Psychology in here ;)
The nice thing about slow emulators is that eventually hardware will catch up with them (usually) and no one will care anymore. Many people think VBA is a very fast emulator, but relatively speaking it just isn't. It just so happens that PCs were so much more powerful than GBA when GBA came out that it didn't need to work too hard to be fast enough. When it came to getting GBA running on handhelds, the situation changed entirely.
byuu wrote:I don't know. Nobody knew SNESGT was soft-patching so many BS-X games. Most people were under the impression that it had vastly superior BS-X emulation. And hell, maybe it does. GIGO is an extremely intelligent guy. Can't tell without the source. But you can see the patching with the memory viewer if you know where to look.

But then, you really have no choice with the BS-X but to patch the games. There's really no other way to emulate a system like that; based on timed, real-life events, satellite transmissions; games that expired and games that could only be played during certain hours of the day. And games that are ridiculously rare. Not all are dumped, and many of those that are have been hacked for emulators already. I'm not at all faulting him for using hacks under these circumstances. It's just interesting how few know about them.
In this case it's pretty gray, but I think that if an emulator hacked many games it'd either be known eventually, or it'd be making a case that accuracy was never that important (if you can't tell then can it matter?)
byuu wrote:That's cool. Look me up if you ever try an SNES handheld emulator. Perhaps I can be of some assistance.
I was hoping you'd write docs sometime.. ;D

I'd like to put out some PCE-CD docs myself. The embarrassing thing is that I never managed to write non-BIOS code on the actual thing that works :/ (just emulate it so that GAMES are okay with it)
byuu wrote:I disagree. SNES memory access timings were figured out in 2003. DRAM refresh timing in 2001 or so. PPU long dots and the short scanline and such were known from the NES days. The cycle-level breakdown of the 65816 was documented by WDC back in 1997. Nobody tried adding them until 2005, perhaps because they were perceived to not be too important, or perhaps because they were thought to be too complex.
I basically consider SNES emulation to have reached a "quite good" state by 1998, so I see a big gap before a lot of the finer details were out there. BSNES itself was started not that long after 2004, right? I think if the information was out there we might have seen more as early as 1999, because computers were already getting much faster than they needed to be for SNES emulation.
byuu wrote:We're really pushing it with the fourth generation as it is ... but I think it's doable with the SNES. I just don't think I can do it alone. And I'm deeply saddened that I appear to be the last one left working on it (sans blargg's recent breathtakingly awesome S-DSP research). Or at least, nobody else working on this is talking to me about it ...
I think it's definitely doable, because you've done it. Not to absolute perfection, but I'm not sure if any emulator will ever truly be perfect (granted, there are some that can handle everything they know about)
Exophase
Hazed
Posts: 77
Joined: Mon Apr 28, 2008 10:54 pm

Post by Exophase »

Dullaron wrote:Where is your PCE emulator host? Care I try it out?
It's made for GP2X so the Windows version isn't publicly available. If you really want it I can send it to you though.
Neo Kaiser
Veteran
Posts: 844
Joined: Thu Jul 29, 2004 3:56 am

Post by Neo Kaiser »

Windows users are stuck with Magic Engine and I really dislike that emulator from the gui to the control configuration. The other emulator is pure command line and 0 frontends....

About Nesticle we understand that it was part of the history and that's the only thing that is needed to know. Why I will use Nesticle when I can use Nestopia? If people are obsessed with absolute accuracy let them be and build emulators that focus on pure accuracy and drain a lot of CPU power because thanks to them the other emulators that are half speed and half accuracy will benefit from their research. BSNES is a research emulator like another one who's name escape my mind. ZSNES and SNES9x are for pure play.
Last edited by Neo Kaiser on Thu May 01, 2008 9:14 am, edited 1 time in total.
Yes I know that my grammar sucks!
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

Neo Kaiser wrote:The other emulator is pure command line and 0 frontends....
Oh please, write a batch file and run that. It's not sexy, but poor documentation/confusing command line help is worse. It is not as if Win9x/Linux was forced onto you.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
byuu

Post by byuu »

Sorry, are walking about the same DSP here? I mean the DSP-1a/b through DSP-4 chips, not the audio DSP.
Ah, a common mix-up. Actually, we do emulate those with HLE. Sadly, we don't emulate the timing. But the timing gets very complex, as it changes based upon the input parameters.

The problem is that we really can't emulate it at a lower level, because the program ROMs have yet to be dumped. And even if they were, then we'd have to figure out how to emulate the internal processor they use. But if we did, we'd hopefully have a free ride to getting all four DSPs perfect, both with timing and with input/output.

Now, will HLE work for these? Yes, and it's a great example. The only problem HLE will have is if you try reading the results before they are ready. If the hardware doesn't stop you, you'll end up reading partially computed results. It would be easier to emulate the hardware using LLE than to hack up HLE to support that.

And the obvious response, "but no game does that." Very true. And I really doubt homebrew will ever really take advantage of these chips, either.

Personally, I think it'd be nice to emulate them at the low level, and I would much prefer that. If only to get the timing exactly right. I'd do so if the program ROMs ever got dumped and it was feasible for me. But I may even choose to leave the HLE approaches if the speed hit was significant enough.

Anyway, the HLE I'm talking about is done in pure software math. The HLE I was saying was bad, was relying upon the video card to do the graphical effects for you, eg how some N64 drivers became dependent upon Glide, and now we have all of this wrapper bullshit abound. Of course, doing 3D rendering in software is ridiculously painful, so you have little choice.

In that case, I'd say it's best to implement it both ways. Understand the raw math. Maybe one day GPUs will be programmable enough to use those formulas outright. Or maybe CPUs will be fast enough for software rendering.
As far as I'm concerned NES emulation is enough of a solved problem that unless you're working on something that does push forward accuracy more than the rest already have then you shouldn't be putting down an emulator for sacrificing a few percent of accuracy. Some of the people there aren't contributing towards improving understanding or preservation, they're just imitating what has already been done (and guides have even been written on how to do this). That's fine, but I don't think this warrants an elitist attitude.
I agree for the most part. I actually did take note of that. A lot of it seems to be people mostly re-implementing the same things to pass tests provided by others. Which is good, I mean the accuracy is great. But I only see a very small number of people finding out new stuff, which seems to be a real shame to me. You set yourself up to never be better than the best emulator right from the start.

I guess you can say that they could have unique features, stronger optimizations for speed without sacrificing accuracy, enhanced portability, cleaner code and things like that.

Saying it's useless is just as bad as saying speed-based emulators are useless. Nothing is useless, there's just a lot of shades of value that differ from person to person.
I agree with you, but on the other hand I think a lot of the interest is rather academic.
Yes, it is. I don't dispute that. I find it a lot of fun to try wildly new ideas that nobody else has before. Even when they fail.
The other class of accuracy is about support more deterministic things. Such as reads from "invalid" regions of memory, or branching into the middle of I/O registers, or certain hardware bugs. These are things that games will often just not do or rely on because there's no reason for them to, but some might anyway because they're broken and got lucky.
I like to call these "building blocks." If you would, take a look at the bsnes dev forum. Specifically at the post on IRQB behavior.

Because I emulated things that games never used, such as reads from invalid memory and jumping into I/O registers, I was able to determine the proper behavior. Had I not done so in the past, it would have been impossible for me to determine what was going on.

In fact, a lot of my discoveries are like that. New findings are only made possible by implementing previous findings. If you choose to be selective of what you emulate, it could very well come back to haunt you later on when that ends up affecting something even more complex which relies on that older behavior as well.
I agree. I think what I find myself going against is the notion that shooting for speed means disregarding accuracy.
Actually, I think people who aim for speed with zero compromise to accuracy are the most impressive of all. The reason I don't do so is due to limited resources. It's easier for me to continue when the existing code is not optimized and easier to read.

I'm sorry, but:
r = (int8_t)regs.a.l + (int8_t)rd.l + regs.p.c;
bool overflow = r < -128 || r > 127;

Will always be clearer to me than:
~(regs.a.l ^ rd.l) & (regs.a.l ^ r) & 0x80;

Even though the latter is faster (as you have to compute the unsigned addition anyway.)

Likewise, it's much easier for me to debug and improve IRQs by testing them every single clock tick. Even though it's ridiculously slow. I spent at least a year trying to get that to work with range testing. And yet in a single week I had it working by giving up on optimizations.

Yes, I took the easy way out. I applaud people who don't.
What a lot of people don't realize is that per-game hacks are usually not speed hacks but are in there to get a game working because no one understands why it doesn't otherwise.
I know. I have a global hack like that for Uniracers. I can't stand it, I really can't. But we really don't have any better knowledge. I was going to leave it broken out of principle, but there's really no reason to. I had to pick some random address for OAM writes during active display to go to. Picking one that breaks Uniracers wouldn't do anything positive. We simply can't emulate it properly with a scanline-based renderer.

I was still going to block it anyway, but instead I asked for community opinion. They overwhelmingly said to fix the game. In a sense, we're emulating the only known example of hardware doing this. But that's a very disingenuous argument.

One thing I did was go out of my way to document this. Both in source code and on my website. I don't hide that it's there.
(if you can't tell then can it matter?)
For the sake of preservation? To me, yes. Again, that's kind of what makes me so neurotic about this.
I see a big gap before a lot of the finer details were out there.
Mostly because very few cared between then and ~2003. To be honest, my understanding is that it was Matthew Kendora who really stepped up to the plate first and pushed for accuracy. Unfortunately, he was apparently a lot like MooglyGuy (so I hear, I've never spoken to him.) What I do know is that he was incredibly unpopular for his views. To be honest, he probably made my appearance a whole lot easier. Just as I've hopefully made it easier for others in the future.

I know that with his pushing, and anomie's, neviksti's, Overload's, TRAC's, etc research, things started kicking into motion. The biggest problem was that the documentation went nowhere. "Okay, we know how this works. Now what?" And ... nothing. It was never really added to emulators. That's about where I came in. I wasn't even aware of the 2003 research for a long time, in fact.

I'm honestly really happy that accuracy is important enough that lots of people are talking about it around these parts now. Even if we're talking about it way too damn much (sacrilege!!). Better than not at all ;)
I think it's definitely doable, because you've done it.
I disagree. I will be happy when I get a cycle-based PPU renderer (doesn't even have to be perfect), remove the Uniracers hack, and get Mecarobot fixed.

Until then, I don't consider the emulator a success no matter how polite others are to me about it (and I do appreciate that.) But that's not all bad. Goals keep me motivated.

So motivated that I've talked about a cycle-based PPU 600 times in 40 different threads for the past two years, and haven't even started on it yet :P

At this rate, Duke Nukem Forever will come out before I start on this.
ZSNES and SNES9x are for pure play.
I worry about Snes9X at this point. I wonder who is left that can make the radical changes necessary to keep it in the "accuracy game."

But ZSNES v2.0 looks very promising indeed. A perfect synergy compromise between playability and accuracy. And if they block VRAM writes during active display so I can stop giving them shit about that ... that will be just fantastic :D

Then I'll only have to bug Super Sleuth and SNESGT about it.
mudlord
has wat u liek
Posts: 559
Joined: Tue Sep 11, 2007 2:54 pm
Location: Banland.

Post by mudlord »

Anyway, the HLE I'm talking about is done in pure software math. The HLE I was saying was bad, was relying upon the video card to do the graphical effects for you, eg how some N64 drivers became dependent upon Glide, and now we have all of this wrapper bullshit abound. Of course, doing 3D rendering in software is ridiculously painful, so you have little choice.
I know you are taking a swing at me here, but let me say this:

If you happen to see a nice video plugin, would you like to rewrite a entirely new piece of software that mimics the behaviour of what that previous software is? Which can take a couple of years. The main reason for this wrapper is:

* Gonetz likes Glide.
* Glide cards share many common things with N64 rendering.
* Most end users use cards that utilize OpenGL.
* Gonetz's work rocks.
* Gonetz does not want to port to OpenGL

So why is a wrapper such a big fucking deal? Do we need to say to the author, "Sorry, your card is old, update it because you are doing things WRONG".? That would be impolite to say the least.

Then you talk about the problem with replicating graphics effects with hardware. Isn't that the nature of HLE, or do you know some better approaches?

Or why don't we use a software renderer that goes < 20 FPS, and the general public yells at us for it due to quality and speed.

Bye.
Last edited by mudlord on Wed Apr 30, 2008 5:32 am, edited 1 time in total.
neo_bahamut1985
-Burninated-
Posts: 871
Joined: Mon Sep 10, 2007 11:33 pm
Location: Unspecified

Post by neo_bahamut1985 »

mudlord wrote:I know you are taking a swing at me here, but let me say this:

If you happen to see a nice video plugin, would you like to rewrite a entirely new piece of software that mimics the behaviour of what that previous software is? Which can take a couple of years. The main reason for this wrapper is:

* Gonetz likes Glide.
* Glide cards share many common things with N64 rendering.
* Most end users use cards that utilize OpenGL.
* Gonetz's work rocks.
* Gonetz does not want to port to OpenGL

Bye.
What should we do, post a comparison screenshot to show this guy just how hard Gonetz worked on this thing?
俺はテメエの倒す男だ! 宜しく! お前はもう死んでいる...
mudlord
has wat u liek
Posts: 559
Joined: Tue Sep 11, 2007 2:54 pm
Location: Banland.

Post by mudlord »

What should we do, post a comparison screenshot to show this guy just how hard Gonetz worked on this thing?
Good, question, but knowing some members on a forum, they won't give a shit since they think cycle accuracy = WIN && all else = phail. Even though HLE can give good results. Look at Glide64 currently: very little hacks yet it emulates the main Nintendo-written microcodes very well.

I certainly think HLE is badmouthed all too often, and I am sick of it. Especially when it comes from people who feel that thier emulation methods are superior to others (eg. MooglyGuy, smf, and co.)
Rashidi
Trooper
Posts: 515
Joined: Fri Aug 18, 2006 2:45 pm

Post by Rashidi »

mudlord wrote:Especially when it comes from people who feel that thier emulation methods are superior to others (eg. MooglyGuy, smf, and co.)
that comment remind me of certain old days (somewhere around 199x to early 200x) when: alegro-lib, snes9x, and certain snes emulator dev (which the name escapes me)....
Neo Kaiser
Veteran
Posts: 844
Joined: Thu Jul 29, 2004 3:56 am

Post by Neo Kaiser »

At least cycle accuracy is better implemented on NES emulators as almost any modern machine can run this type of emulator.
Yes I know that my grammar sucks!
powerspike
Regular
Posts: 236
Joined: Mon Nov 21, 2005 3:43 am

Post by powerspike »

Probably my only beef with N64 emulators is they don't have the slowdowns that the real system has. The most obvious is probably the Mario 64 head at the beginning. It spins slower on a real system. I wouldn't be surprised if it affected the way a game played compared to the real system. As far as coding practices go I don't care what people use as long as it gives nice results. I don't have a clue how an emulator even works anyway. Well I know as much as you need a binary dump of the game data, the emulator mimics said processors / timing of said system and it then outputs it to something the PC can understand. That's pretty damn broad and not very useful.
mudlord
has wat u liek
Posts: 559
Joined: Tue Sep 11, 2007 2:54 pm
Location: Banland.

Post by mudlord »

certain snes emulator dev (which the name escapes me)....
MK? I'm sorry if I sound agitated like this person, but this very topic is something I feel strongly about...I probably am acting like this person, and I apologise, I have been in a fairly rotten mood lately but that doesn't excuse how much anger I show :(.
adventure_of_link
Locksmith of Hyrule
Posts: 3634
Joined: Sun Aug 08, 2004 7:49 am
Location: 255.255.255.255
Contact:

Post by adventure_of_link »

mudlord, are there even *ANY* video cards made today that support Glide?
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
I.S.T.
Zealot
Posts: 1325
Joined: Tue Nov 27, 2007 7:03 am

Post by I.S.T. »

No, but I believe that's already been addressed by the wrapper, which is easy as hell to use.
neo_bahamut1985
-Burninated-
Posts: 871
Joined: Mon Sep 10, 2007 11:33 pm
Location: Unspecified

Post by neo_bahamut1985 »

I must say, that glide wrapper does a very good job emulating the Glide API. I'm way impressed on what the Glide 64 can do compared to the other N64 GPU plugins out there.
俺はテメエの倒す男だ! 宜しく! お前はもう死んでいる...
Post Reply