Live data from Hacker News

Xenia - An Xbox 360 emulator

github.com

61–70 of 74 posts

Re: Xenia - An Xbox 360 emulator

#61
post #41

Author here. Yeah, the readme is meant to scare off people. Even with it I still get people on IRC or email asking me if they can play game X or where they can get a copy. The note about no downloads is for all those who download 360 emulators from shady YouTube links and such - there's a surprising number of fakes packed with malware and viruses floating around. Status of the project is that it's coming along well,…

How many C&D have you gotten from Microsoft's well funded lawyers yet?

Hopefully you are not in US but they are pretty embedded in every country at this point.

Re: Xenia - An Xbox 360 emulator

#62
post #59

One thing I've wondered... And this is somewhat unrelated, is why the Xbox One doesn't run 360 games. One of the core features of it's OS is the fact that everything is running in a modified Hyper-V environment. So why couldn't MS have emulated the 360 on the hypervisor?! Will be cool to see this project progress and hopefully running on an Xbox One dev kit.

Unlike most of the replies made to your question, I don't think the big problem for Microsoft was emulating PowerPC on an x86 platform to make emulation happen. The real problem with emulating both the PS3 and Xbox 360 is that they were the first consoles with an incredibly complex GPU. The GameCube and PS2 already have chips that are incredibly hard to emulate, and you need a high end PC to do it. The Xbox 360 GPU i…

> The real problem with emulating both the PS3 and Xbox 360 is that they were the first consoles with an incredibly complex GPU

i kind of agree and disagree...

i agree with the idea that the GPU is a big problem, but i dont think the implementation of features on hardware like EDRAM, memexport, half-float textures etc. are especially problematic vs. the general case of the unified memory architecture...

most of those unique features like the EDRAM and memexport were relevant to hardware specific optimisations at the time - modern GPUs can produce equivalent functionality by ignoring the performance characteristics and relying on their horsepower. EDRAM is a very good example of something that you just don't need an equivalent for - you can emulate all that functionality with regular VRAM just fine.

memexport and similar functionality relying on the unified memory architecture is a little more tricky. the real problem i'd imagine would come from the the resulting 'tricks' used for performance and flexibility when feeding the GPU from the CPU side - e.g. being able to memcpy into a vertex buffer or blob of shader parameters instead of going through the DX like interface, which was a genuine and useful optimisation. although iirc MS put some limits on this by failing your cert if you did anything outside of their approved list of workarounds for DirectX performance issues... something which is theoretically very easy to check for in many cases

i can't really see how to workaround that with creating a quite complicated and expensive layer around the memory emulation. for the other features (including memexport) workarounds are possible - if unperformant. memexport is only 'easy' because it is an optimisation provided to do something you could already do but in a much faster way... (and something which is now 'standard' since SM4)

also, as an aside, i think its worth remembering that whilst the PPC CPUs had lots of advantages for fast execution the memory read/write performance was abysmal compared to contemporaneous Intel PC CPUs and many features like branch prediction (always true iirc) and out-of-order execution were also quite far behind the Intel PC counterparts of the time. Today that gap is even larger - although it is certainly true that other things have become slower, these were never the bottleneck in my experience... it was almost always memory and the poor size and performance of the cache.

Re: Xenia - An Xbox 360 emulator

#63
post #12

One thing I've wondered... And this is somewhat unrelated, is why the Xbox One doesn't run 360 games. One of the core features of it's OS is the fact that everything is running in a modified Hyper-V environment. So why couldn't MS have emulated the 360 on the hypervisor?! Will be cool to see this project progress and hopefully running on an Xbox One dev kit.

The 360 ran a PowerPC instruction set while the Original Xbox and Xbox One run x86 architecture. The game would have to be rewritten to run on Xbox One. I'd assume this makes it difficult.

its not very hard actually - you can map the PPC instruction set to the x86 one with a bit of framework around it. more trivially you can write a C program to perform the same functionality as the original CPU. what this means is that you don't have to re-write the game at all - you run the original compiled code, just not on hardware.

I did this many years ago when I learned about the existence of the x86 instruction set as a stepping stone towards understanding/making interpreters, virtual machines and compilers. I recommend anyone do it as a learning exercise.

This stuff is incredibly simple at its core but there is a common misconception because it is 'low level' that is is some how hard or complicated...

Once i knew it was just simple instructions, registers and a few flags coupled with a memory model it was obvious how to achieve... you write C functions for the various flavours of ADD, SUB, LEA, MOV, FSTP, ADDPS etc. by iterating through the stream of bytes and interpreting them in the same way as the CPU (this is always described in the CPU manual in my experience) you can call the right ones in the right sequence. you use some appropriate blob of memory for your registers, flags and other CPU state and some big array of bytes for your emulated memory...

this is what an emulator is at the simplest level, an interpreter for CPU instructions. (of course making the implementation of instructions might necessitate that you do more - e.g. emulating memory, BIOS or more...)

Re: Xenia - An Xbox 360 emulator

#64
post #58

Earlier quoted context omitted.

It's not difficult to believe, it's just funny. Devoting an enormous amount of time and energy to understanding and reproducing a device whose only purpose is to play video games while insisting that you're not interested in video games is a pretty funny thing to do. I mean, I obsess over odd stuff too, I'd guess most of us do, but it's important to keep a sense of humor about it.

Oh, for sure. I thought you were implying that I only was doing it to play/steal/etc games (as many people assume). I've got a pile of awesome Japanese import games I picked up the last time I was there that I'd love to play, but the region locking on the real consoles prevents me. If I had an emulator, that wouldn't be a problem. Not the only reason I'm doing this, of course (I could just buy a Japanese console), bu…

Might such a comment be used against you? Just curious.

Re: Xenia - An Xbox 360 emulator

#65
post #64
post #58

Earlier quoted context omitted.

Oh, for sure. I thought you were implying that I only was doing it to play/steal/etc games (as many people assume). I've got a pile of awesome Japanese import games I picked up the last time I was there that I'd love to play, but the region locking on the real consoles prevents me. If I had an emulator, that wouldn't be a problem. Not the only reason I'm doing this, of course (I could just buy a Japanese console), bu…

Might such a comment be used against you? Just curious.

It's fair use. If a book is not available for sale in the US I can travel to the UK and buy a copy and bring it back with me and read it. It may not be what the publisher wanted, but it's a legally purchased good used in a legit way.

Re: Xenia - An Xbox 360 emulator

#66

Earlier quoted context omitted.

That's the whole point of a VM right? OS X could run PowerPC apps with Rosetta when they went Intel. I just assumed that we could do the same since the Xbox One has a beastly processor compared to the aged 360 one.

Most VMs aren't full architecture emulation. Instead they use a trap to prevent some instructions from executing, but the rest are passed through as native instructions. Breaking out of this virtualized environment could potentially pose a security risk, and it is possible to detect that you are in a virtualized host because timing wasn't as exact as for these intercepted calls as they are on actual hardware. Intel a…

> Most VMs aren't full architecture emulation.

But many are. E.g. QEMU can emulate PPC on x86.

Re: Xenia - An Xbox 360 emulator

#67
post #50

Earlier quoted context omitted.

Most VMs aren't full architecture emulation. Instead they use a trap to prevent some instructions from executing, but the rest are passed through as native instructions. Breaking out of this virtualized environment could potentially pose a security risk, and it is possible to detect that you are in a virtualized host because timing wasn't as exact as for these intercepted calls as they are on actual hardware. Intel a…

Nope on Connectix VGS not emulating the CPU - PSX and PS2 both used MIPS CPUs, vs. PowerPC in Mac. It very much was the exact same thing as PCSX or derivates. The only platform a PSX emulator might have not done full dynarec/interpretation would have been the PSP, and that's unlikely to actually exist for various reasons.

you mean like the POPS emulator that the PSP used to run PlayStation 1 games (to correct the common mistake, the PSX was a completely different Japanese console, which only had the PlayStation as one of its parts).

Re: Xenia - An Xbox 360 emulator

#68

Earlier quoted context omitted.

It isn't necessary to purely emulate every instruction, you can cache translated code segments like a JIT compiler does. It has been done before for fast x86 emulation on a VLIW chipset: http://en.wikipedia.org/wiki/Code_Morphing_Software More details: http://en.wikipedia.org/wiki/Binary_translation#Dynamic_bina...

It's not just about translating instructions. Console games are extremely optimized and fine tuned for the processor they run on. A block of 40 PowerPC instructions may take 40 clock cycles to run on a PowerPC Processor, but 120 clock cycles to run on an x86 processor once they're blindly emulated. Programmers (and compilers) will change the type of instructions they're using to best fit the situation and the instruc…

I'm surprised the 360 used big-endian mode (almost all PPC implementations are bi-endian, after all!), given the prior Windows NT PPC release was one of the few to use little-endian for the OS (note that one could change endianness on a per-thread basis! — anyone know if anyone did this on the 360?), and using big-endian makes it inconsistent with everything else Windows.

Re: Xenia - An Xbox 360 emulator

#69
post #41

Author here. Yeah, the readme is meant to scare off people. Even with it I still get people on IRC or email asking me if they can play game X or where they can get a copy. The note about no downloads is for all those who download 360 emulators from shady YouTube links and such - there's a surprising number of fakes packed with malware and viruses floating around. Status of the project is that it's coming along well,…

I was just looking at the readme and it says R9 cards and up are required for mantle. Mantle only requires a GCN card and HD 77xx-79xx work fine.

Re: Xenia - An Xbox 360 emulator

#70

Earlier quoted context omitted.

You'll see a lot of technical answers, all of which are valid; but the overriding reason is that if you're playing your old 360 games, you're not buying new Xbone games. Microsoft takes a loss on every console sold; if you're not regularly purchasing new games at retail prices, they're not interested in serving you.

I don't think Microsoft and Sony think that way. Look at the extraordinary lengths Microsoft and Sony went to in the previous generation to provide back compat -- Microsoft wrote an amazing Xbox emulator, Sony build a whole expensive mini version of the PS2 into early models of the PS3. And this generation it seems that Sony is trying to provide PS3 emulation using their cloud gaming system. Some of the benefits of b…

>And this generation it seems that Sony is trying to provide PS3 emulation using their cloud gaming system.

In other words, it's a way to get you to pay for games you already own but can't play on your new console

Post reply on HN