Dolphin, the GameCube and Wii emulator - Forums

Full Version: HLE or LLE
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
(07-10-2013, 04:34 PM)fagoatse Wrote: [ -> ]What's the point of this discussion?

Shoober420 will say a bunch of stuff, then 3 or 4 people will tell him that he's wrong, then he will attempt to justify how wrong he is by making stuff up and using that as an argument.
shoober420 Wrote:Only at simple things like BIOS.

You keep ignoring the examples of complex things (specific processors) being emulated via HLE with bit-for-bit accuracy. You keep saying "only simple things can be HLE'd" without ever providing in-depth reasons, at least not anything more than "this emulator uses HLE, so look how inaccurate it is." That's not an answer. What is it specifically about complex hardware that prevents it from being HLE'd? (Hint: I've given you some clues if you want to make this argument, look at my previous posts).

shoober420 Wrote:Saying bit for bit is very misleading, and down right wrong. LLE will always emulate those things you mention more accurately then HLE, but not even LLE can emulate bit for bit, let alone HLE.

What's misleading is to say that LLE will always emulate those things more accurately. The ones I just posted are proven cases where HLE and LLE can emulate features on par with one another. If you want to say that things can't be emulated bit-for-bit, feel free to argue byuu himself:

byuu Wrote:only the DSP-1 and DSP-2 were considered to be emulated bit-perfectly (meaning: feed in X, get exactly Y value out.)

Notice how byuu said HLE was not going to be possible for the other co-processors found in the SNES. The article doesn't say things like "you can only HLE simple things", it provides specific information on why HLE is not ideal for certain hardware, chiefly the amount of effort needed to reverse engineer it:

Quote:The Super FX and SA-1 were (relatively) easy to reverse-engineer, but the DSPs were proprietary chips, making their architecture and code all but impenetrable.

And Ars Technica explains it further:

Quote:Often, these processors are so segregated from the host processor that it is possible to implement them using high-level emulation (HLE). This isn't unique to the SNES coprocessors; you also see it in N64 video microcode emulation, among other areas.

The idea here is to not think of individual instructions, but about what an entire group of them do together. In other words, think about a program in terms of functions like "render a triangle at these points" or "rotate this sprite by N degrees." It is then possible to simulate these operations with virtually no overhead. Unfortunately, this approach also discards all timing information required for the execution of each individual instruction. And worst of all, it's usually anything but perfect: minor edge cases, quirks, and flaws in the original implementations are lost, resulting in subtly different operation.

This is the kind of reasoning and level of examples that I've been asking for you to demonstate when trying to prove that you can only HLE simple things. These themselves quotes don't demonstrate that complex things can't be HLE'd (because, again, we have examples of complex hardware being HLE'd). What it does prove is that, in addition to being able to reliably reproduce the large-scale behavior, the hardware has to be thoroughly reverse-engineered and understood. You haven't proven how we can't reliably reproduce the large-scale behavior of complex hardware or that we can't thoroughly reverse-engineer complex hardware (because we've already done both). The quotes prove why we can't HLE specific complex hardware, but doesn't prove why we can never HLE any complex hardware.

shoober420 Wrote:HLE uses shortcuts, which is why the shadow goes missing.

And I explained a method that uses HLE to manually draw the shadow. Again, technically explain how this specific HLE method won't work.

shoober420 Wrote:Maybe 90% at the most, but emulation can't 100% replicate original hardware, no matter how hard you try. Although I would say the BIOS is replicated 99%, not 100%. Nothing can be emulation with 100% accuracy. Its emulation after, not replication. It will never be 100% accurate.

You've never even studied the GB BIOS, much less even looked at the assembly that composes it. You haven't any standing to say that. The BIOS is a 256-byte program that runs on startup. We have the exact, byte-for-byte instructions that the GB runs for the BIOS, hence we know exactly what it's doing at any given time. This is like saying you wouldn't know what a program does 100% even when the source code is available and it's been reviewed by dozens of people. It's not a law in computer science that emulation can never be 100% accurate. It depends on what the original hardware is and what it does. With some hardware it's likely that we might not see 100% emulation, but other hardware might be a different story. Let's not forget that when there's money to be made, the original hardware vendors themselves do step up to make (as far as we know) 100% accurate emulators for older systems, a la Sony and Nintendo. The Virtual Console version of Mario Tennis absolutely beats any N64 emulator I've tried.

shoober420 Wrote:That is not the definition of upsclaing. That is your made up definition. According to wikipedia, it states:

Wikipedia Wrote:A video scaler is a device for converting video signals from one size or resolution to another: usually "upscaling" or "upconverting" a video signal from a low resolution (e.g. standard definition) to one of higher resolution (e.g. high definition television).

Did you read what you quoted from Wikipedia thoroughly? It's talking about a hardware device (called a video scaler) that's responsible for doing the upscaling. How do you think a video scaler converts the video signals from one size or resolution to another. I'll give you a hint.

Upscaling doesn't use interpolation as if it were a tool in its overall process. Interpolation perfectly defines the entire process of upscaling on a broad mathematical level because interpolation is the very process that directly resizes an image. Upscaling happens to be a very specific form of interpolation to enlarge images.

shoober420 Wrote:You're a hypocrite, because you can't show it yourself. You just copy and paste code to a non-programmer and expect him to be able to find it. Since you are the programmer, you should easily be able to show proof that HLE isn't being used on the PPU. All SNES emulators prior to bsnes/higan couldn't emulate Air Strike Patrol correctly, and since bsnes/higan uses LLE, is that just a coincidence that its because of LLE? I don't think so.

Could you try to keep up with the points I've been making? Seriously, all the text is there, just read it. I've been trying to explain to you HLE doesn't have to be the reason for graphical glitches of that sort. I've already demonstrated to you that flawed or incomplete LLE implementations can be just as culpable (again refer to the gbemulator example) as HLE, therefore you can't just assume the glitch is outright caused by HLE. My point was that even if an SNES emulator used LLE, if they had a flawed implementation of mid-scanline rendering in the PPU, they'd still have issues. The point isn't about HLE or LLE, it's about getting mid-scanline rendering to work correctly. If you screw up your code or don't understand mid-scanline rendering well enough, it won't matter if the underlying code uses HLE or LLE. Both can be just as guilty. byuu and higan, avoided this by getting the implementation right. That says nothing about whether other emulators used LLE but didn't correctly implement mid-scanline rendering.

shoober420 Wrote:The reason it emulates correctly is because of LLE, something all the other emulators prior to bsnes/higan didn't implement on the CPU.

That's ridiculous, since you couldn't prove anything in the code of SNES9x's CPU used HLE, even though RachelB apparently examined it and thinks it uses LLE. I know from experience that using HLE in the CPU is an exceedingly rare occassion; most of the time it just isn't possible. This is due to the large-scale behavior (essentially running instructions based on random input, i.e. game code) and due to the fact that most of the instructions a CPU does are basic math operations that can't be broken down, shortened, or skipped. It's pretty hard to HLE one-off math operations such as XORing a single register, shifting another register right, or resetting various CPU flags. If you wanted to settle this for yourself, just ask the developers over at SNES9x (they're active as far as I can tell) and they should be able to answer you.

shoober420 Wrote:Talk is cheap. Until you are able to create the very first true LLE emulator to increase internal resolution, you have no say and are wrong.

There's that fallacy again. Just because something doesn't yet exist doesn't mean it can't ever exist. You know, before I started working on my Game Boy Enhanced, there weren't any other GB emulators that could utilize custom sprites (that is, replacing sprites and background tiles on-the-fly, without altering the ROM, much like Dolphin's Load Custom Textures). That didn't stop Game Boy Enhanced from doing it, or being the first to do it.

shoober420 Wrote:Since upscaling uses different types of interpolation, that can conclude that upscaling isn't at all interpolation, but that it uses interpolation. Not that it IS interpolation

That's not logical at all. The whole process of upscaling is interpolation (it fits the definition). Upscaling itself can be achieved through numerous methods (nearest-neighbor, bilinear, HQ2X), but that hardly means that those methods aren't interpolation (they are according to Wikipedia) and that hardly means that upscaling isn't interpolation (which it is, as has been explained and demonstrated to you countlessly).

shoober420 Wrote:Oh that's very on topic bro. If the CPU uses an LLE interpreter, but the emulator itself is HLE, it still uses HLE on the CPU in some form, making it not a true LLE CPU emulator (unlike MESS which is).

Go back to where this was introduced in your other thread. We were talking about the z64 LLE plugin for Mupen64Plus:

shoober420 Wrote:That's because it uses HLE for the CPU. If there wasn't some form of HLE, it wouldn't allow you to increase the internal resolution at all.

Which caused us to debate on whether or not N64 emulators use HLE on the CPU. We then looked at some code from Mupen64Plus for the emulated CPU, and I detailed how it's LLE'd. Now you're saying how Mupen64Plus is derived from Mupen64 and saying that it's not a full "true" LLE emulator. What does the fact that it's not an LLE emulator matter? You said it used HLE on the CPU, and that's wrong. I get the feeling that you think if HLE is used in one area, it will affect other parts of the emulator even if they are LLE'd, which is probably why you're bringing up the fact that Mupen64Plus isn't an LLE emulator.

The inaccuracy of, say, an HLE'd GPU (Glide64 for example) wouldn't affect the accuracy of an LLE'd CPU, although it obviously affects the overall accuracy of the emulator. Say the Glide64 plugin is raising an interrupt at the wrong time; the interrupt get processed by the CPU, but it causes it to crash since it read from memory that wasn't available yet. Since the CPU is accurate as far as LLE is concerned, it's doing everything it's supposed to, just like real hardware (we'll assume real hardware would crash as well from trying to read unavailable memory). It's the graphics emulation that's the culprit, but the behavior of the CPU stays true to the N64. I've done this a few times myself when I took shortcuts with sprite rendering in early versions of Game Boy Enhanced. The underlying CPU was doing everything it was supposed to (it was LLE'd of course), bit-for-bit, it was just that my sprite rendering wasn't working correctly (it was somewhat HLE'd at the time, just trying to get things drawn on the screen).

In short, using HLE in one department doesn't somehow mean everything else is suddenly using HLE or even affected by the parts that do use HLE. It just doesn't work like that.

fagoatse Wrote:See mednafen's psx core thats low-level and uses software rendering while being relatively easy on resources(2.0 GHz dual core required

What's this? Someone else who sees the glory of Mednafen? Big Grin I was surprised when I first ran it on my laptop (T3400 @ 2.16 GHz) and it ran smooth as butter and more accurate (read: less issues) than the other PSX emulators that'd I'd been using. Anyway, this is a continuation of the "Wii Backwards Compatibility" thread in General Discussion, just without posts going towards our post counts now.
(07-10-2013, 04:48 PM)Starscream Wrote: [ -> ]Shoober420 will say a bunch of stuff, then 3 or 4 people will tell him that he's wrong, then he will attempt to justify how wrong he is by making stuff up and using that as an argument.

Yeah, because SNES9s is HLE, Upscaling is interpolation, and Mupen64Plus is LLE... ROFL

I can't believe you people actually think this stuff is true, and you are all "experts".

(07-10-2013, 02:16 PM)garrlker Wrote: [ -> ]LLE won't always emulate things more accurately. There can be bugs in LLE emulators just as there can be in HLE emulators. He's only saying that in those examples the HLE emulators match the LLE emulators in accuracy.

If the bugs are there is LLE, they will most definitely be there with HLE. HLE will never match LLE in terms of accuracy. Never.

(07-10-2013, 02:16 PM)garrlker Wrote: [ -> ]I know you don't keep up with stuff here, but he literally coded his own gameboy emulator. In this sense he actually knows every detail on the subject.

He he knows so much, he would know that LLE is superior in terms of accuracy to HLE.

(07-10-2013, 02:16 PM)garrlker Wrote: [ -> ]He's saying how does that video prove it. I did a google search and yes. You are right, Snez9x uses HLE. Big whoop. Do you realize that the emulators were created with different goals in mind? Snes9x was created to be able to play snes games on low end systems. Where as the creator of bsnes wanted it to be as accurate as possible. Different goals man.

No one is going to deliberately title there video incorrectly and say SNES9x is HLE when it isn't. SNES9x is most definitely a HLE emulator. Anyone who argues against this is ignorant and stubborn.

(07-10-2013, 02:16 PM)garrlker Wrote: [ -> ]He's saying the definition fits, read every word please. Going off of your definition and his, it does fit.

No it doesn't, at all. Just because upscaling USES interpolation to resize a given resolution, doesn't mean that it IS interpolation. Its the most absurd thing I've ever had to argue about.

(07-10-2013, 02:16 PM)garrlker Wrote: [ -> ]I got this far and just gave up. With your post/logic there's no need for me to even try explaining anything else. You truly are a dense person. What you say is what you think is absolutely right. Even with all of the members on this forum, who almost all program, you still don't believe them. NatrualViolence is basically the forums local tech expert and a computer science major, Shonumi has programmed on the gecko emulator(another gamecube emulator) and even coded his own gameboy emulator. Rachelb is a current dolphin emulator developer, but forget all those coding backgrounds. You're totally correct on everything you've said. Seriously, why do all of your topics end with you arguing with people? Can you not accept that you aren't right about everything or what? Please start replying more mature. The forum as a whole would appreciate it.

The thing is, these "experts" are saying things that aren't true. Like if they are such experts, they should already know SNES9x is HLE. Only a fool would argue against it, just as upscaling is resizing a resolution, not interpolation it self. Okay, I'm going to use upscaling on some textures to smooth them out, since upscaling is interpolation right? Oh wait, I can't, upscaling doesn't smooth out textures, becuase upscaling isn't interpolation.
Shonumi Wrote:Notice how byuu said HLE was not going to be possible for the other co-processors found in the SNES. The article doesn't say things like "you can only HLE simple things", it provides specific information on why HLE is not ideal for certain hardware, chiefly the amount of effort needed to reverse engineer it

Here is the definition of HLE from Wikipedia:

Wikipedia Wrote:High-level emulation (HLE) is an approach for construction of emulators, especially for video game consoles, which attempts to simulate the response of the system rather than accurately recreating its internal design.

If he would of LLE'd those chips instead, I bet you they would be more accurate then the HLE implementation. Bit for bit is impossible and very subjective. I don't even agree with byuu there. This is emulation, not replication. Emulation can never be bit for bit perfect, even with LLE (unless its something simple).

Shonumi Wrote:You haven't proven how we can't reliably reproduce the large-scale behavior of complex hardware or that we can't thoroughly reverse-engineer complex hardware (because we've already done both). The quotes prove why we can't HLE specific complex hardware, but doesn't prove why we can never HLE any complex hardware.

I never said complex hardware can't be HLE'd, I was simply trying to say that LLE will more accurately emulate the complex hardware (and the simple hardware).

Shonumi Wrote:And I explained a method that uses HLE to manually draw the shadow. Again, technically explain how this specific HLE method won't work.

Oh that would work, it just wouldn't be accurate, which is the whole thing I'm trying to explain to you. LLE is more accurate then HLE.

Shonumi Wrote:With some hardware it's likely that we might not see 100% emulation, but other hardware might be a different story. Let's not forget that when there's money to be made, the original hardware vendors themselves do step up to make (as far as we know) 100% accurate emulators for older systems, a la Sony and Nintendo. The Virtual Console version of Mario Tennis absolutely beats any N64 emulator I've tried.

Okay, maybe on the simple things you might be able to emulate it 100%, but on the complex things its not going to happen, not even with LLE.

Shonumi Wrote:Did you read what you quoted from Wikipedia thoroughly? It's talking about a hardware device (called a video scaler) that's responsible for doing the upscaling. How do you think a video scaler converts the video signals from one size or resolution to another. I'll give you a hint.

I know that, it uses interpolation to upscale. Just because something uses something, it doesn't become what it uses.

Shonumi Wrote:Upscaling doesn't use interpolation as if it were a tool in its overall process.

Yes it does.

Shonumi Wrote:My point was that even if an SNES emulator used LLE, if they had a flawed implementation of mid-scanline rendering in the PPU, they'd still have issues. The point isn't about HLE or LLE, it's about getting mid-scanline rendering to work correctly. If you screw up your code or don't understand mid-scanline rendering well enough, it won't matter if the underlying code uses HLE or LLE. Both can be just as guilty. byuu and higan, avoided this by getting the implementation right. That says nothing about whether other emulators used LLE but didn't correctly implement mid-scanline rendering.

HLE can't accurately replicate mid-scanline rendering in the PPU, which is why it happens in the first place.

Shonumi Wrote:That's ridiculous, since you couldn't prove anything in the code of SNES9x's CPU used HLE, even though RachelB apparently examined it and thinks it uses LLE.

Tell her to examine it again, because SNES9x is not LLE.

Shonumi Wrote:I know from experience that using HLE in the CPU is an exceedingly rare occassion; most of the time it just isn't possible. This is due to the large-scale behavior (essentially running instructions based on random input, i.e. game code) and due to the fact that most of the instructions a CPU does are basic math operations that can't be broken down, shortened, or skipped. It's pretty hard to HLE one-off math operations such as XORing a single register, shifting another register right, or resetting various CPU flags. If you wanted to settle this for yourself, just ask the developers over at SNES9x (they're active as far as I can tell) and they should be able to answer you.

So you knew this whole time that the CPU isn't HLE'd, but were trying arguing against it with me this whole time? Wow, you're a real big jerk bro.

Shonumi Wrote:There's that fallacy again. Just because something doesn't yet exist doesn't mean it can't ever exist. You know, before I started working on my Game Boy Enhanced, there weren't any other GB emulators that could utilize custom sprites (that is, replacing sprites and background tiles on-the-fly, without altering the ROM, much like Dolphin's Load Custom Textures). That didn't stop Game Boy Enhanced from doing it, or being the first to do it.

Talk is cheap. DO IT.


Shonumi Wrote:That's not logical at all. The whole process of upscaling is interpolation (it fits the definition).

Just because something is involved in the process, doesn't mean that it becomes the process it uses. Saying upscaling is interpolation is like saying upscaling uses its own special form of interpolation, which is not true. It also is saying that interpolation can't be used without some form of upscaling, which also isn't true.

Shonumi Wrote:We then looked at some code from Mupen64Plus for the emulated CPU, and I detailed how it's LLE'd. Now you're saying how Mupen64Plus is derived from Mupen64 and saying that it's not a full "true" LLE emulator. What does the fact that it's not an LLE emulator matter? You said it used HLE on the CPU, and that's wrong. I get the feeling that you think if HLE is used in one area, it will affect other parts of the emulator even if they are LLE'd, which is probably why you're bringing up the fact that Mupen64Plus isn't an LLE emulator.

If the emulator is HLE, but uses LLE interpreters, its not truly LLE. It is still using some form of HLE on the CPU. Its just an interpreter after all. If the emulator was actually true LLE, it wouldn't alloow you to increase the internal resolution.

Shonumi Wrote:In short, using HLE in one department doesn't somehow mean everything else is suddenly using HLE or even affected by the parts that do use HLE. It just doesn't work like that.

When the core of the emulator is built upon HLE, then yes it does.
Quote:Bit for bit is impossible and very subjective.
Serious question: Are you retarded?
(07-11-2013, 01:34 AM)RachelB Wrote: [ -> ]Serious question: Are you retarded?

Hey, I'm not the one who thought SNES9x was LLE.
Do you not understand that something can have HLE and LLE code even after multiple people have explained it to you several times?

And yes that statement you made that she quoted is extremely stupid and appears to be pulled out of thin air
Snes9x uses (imperfect, non-cycle-accurate) LLE for the SNES CPU and PPU. It only uses HLE for certain chips embedded in certain game cartridges, and that's mostly because they had no other choice but to try to reverse-engineer them (read: poke at them with a stick from outside to try to figure out how they work) until those chips were decapped and analyzed/dumped/whatever by a guy working with the bsnes crew.

Lemme link these two highly-relevant things again, they're written by the author of bsnes himself.
http://web.archive.org/web/20130121234914/http://byuu.org/articles/emulation/decap
http://web.archive.org/web/20130121234850/http://byuu.org/articles/emulation/snes-coprocessors

Also, the source you linked that said Snes9x was HLE *probably* didn't know exactly what that meant and *probably* didn't know, let alone specify, exactly *what parts are being HLE'd*.
(07-11-2013, 05:32 AM)shoober420 Wrote: [ -> ]
(07-11-2013, 01:34 AM)RachelB Wrote: [ -> ]Serious question: Are you retarded?

Hey, I'm not the one who thought SNES9x was LLE.
Well from what i've seen of the source code, it is. At least the CPU emulation is. I'm sure if you actually looked at it, you'd see the same thing.

It amazes me though that you think comparing numbers is subjective.
(07-11-2013, 01:29 AM)shoober420 Wrote: [ -> ]
Wikipedia Wrote:High-level emulation (HLE) is an approach for construction of emulators, especially for video game consoles, which attempts to simulate the response of the system rather than accurately recreating its internal design.

If he would of LLE'd those chips instead, I bet you they would be more accurate then the HLE implementation. Bit for bit is impossible and very subjective. I don't even agree with byuu there. This is emulation, not replication. Emulation can never be bit for bit perfect, even with LLE (unless its something simple).

This says it doesn't accurately replicate the hardware's internal design, but it doesn't say that it doesn't accurately replicate the hardware's overall behaviour. The two are very different.



I'm going to come up with a hypothetical chip which you will be able to emulate in HLE, or in LLE, but you'll always get the same result either way.

What this chip does is:

Quote:It takes in two integers, A and B.

It stores number A in one register (R1), and number B in another (R2). It also has a third register (R3) which starts out blank.

Firstly it puts the value 0 into R3.

Next it enters a repeating loop. This loop does the following:

Quote:Adds A to the value in R3

Takes 1 off the value in R2

If the value in R2 is zero, exits the loop
After this loop, it then outputs the value stored in R3.

If you look at this algorithm carefully, you'll notice the value outputted will always be A times B. You could HLE this whole chip by simply taking these two numbers, and multiplying them together. You'd then wait until the rest of the system requested the result, and then give it to it.

Alternatively, you could write code to do each of the steps the actual chip did. This would be slower than simply using a single multiply operation, but would show the people of the future exactly how the chip did what it did. It also would be no more accurate then HLE, and because more has to be done, there are more opportunities for something to go wrong (eg a step being missed out, two things being put in the wrong order, an extra step being added for no reason) and introduce bugs and inaccuracy, especially if the developer wasn't exactly sure how the chip worked himself.
Pages: 1 2 3 4