What's new

Xbox

OP
blueshogun96

blueshogun96

A lowdown dirty shame
More attachments. Couldn't attach them all in one post, stupid thing...

EDIT: Forgot to add AMD 768 chipset documentation
 
Last edited:

Danny

Programmer | Moderator
Great to see you back man :) I couldn't believe it when you left, you dont seem like the kinda guy who just gives up to me :)
 

Exophase

Emulator Developer
Welcome back blueshogun..

2. CPU: The most familiar component of the Xbox. It's just an Coppermine Intel Pentium III with a halved L2 cache (128KB). It also has a customized CPUID instruction. The average Xbox n00b will assume this is easy to emulate and makes the Xbox the easiest console to emulate of it's time. Very wrong frame of mind. At this time, it is impossible to emulate a Pentium III [accurately] because it (like all modern x86 CPUs) can excecute more than one instruction at a time and how it does that is unknown. So it's not like emulating a Z80 or even a MIPS.

The instruction timing accuracy doesn't really matter for these platforms, just so long as you don't give it too few CPU cycles - games will probably use OS functions to wait for events anyway.

4. GPU (NV2A): The hardest thing to emulate in the Xbox. It's basically an NVIDIA GeForce 3 with some GeForce 4 capabilities (cross between an NV20 and NV25). Sounds easy to emulate just because it's NVIDIA huh? Think again! the GeForce 3 series is the most mysterious of all NVIDIA GPUs (G7x and G8x aside) and the NV2A is alot worse. "But can't you just directly execute the NV2A instructions on another NVIDIA card?". No, I get alot of questions concerning this, and it is impossible. It's MMIO addresses are different and has some exclusive registers of it's own. Plus, in windows, we don't have ring 0 access anyway, so you all can scratch that idea now.

But, don't most games use DirectX? Assuming you can isolate the DirectX calls within the executable then you can HLE this to other native calls. Of course you might not be able to handle everything, I don't really know if it has a modified DirectX or not..

This would apply to some other hardware components as well.

Pure LLE emulation might be a decent goal, but it doesn't sound very feasible.


Can probably be HLE'd at the file system level.

6. Kernel: The Xbox uses a modified Win2000 kernel. Easy to emulate? No! It's far to different to be considered the same. Many functions are Xbox exclusive and not all of their uses are known still. See the attachment below.

But does the kernel itself need to be emulated, so to speak? Again, via HLE; only the system call functionality is interesting (and perhaps, only a subset that games actually use, at least to start out with)

If emulating with pure LLE then this won't come into play at all (neither will the BIOS), you'll just need the proper images.

7. MCPX: The MCPX is similar to the NVIDIA NForce 2 chipset, but not identical. It's components include the PCI bus, USB, Audio Codec, APU, Network Adapter, etc. The majority of these components are fairly easy to emulate except the Audio Codec.

HLE should also make these details irrelevant.

8. VGA: The Xbox's GPU is a VGA compatible.

Should only be relevant for emulating homebrew, probably.

9. Video Encoders: Instead of using a standard RAMDAC, the Xbox uses a VideoEncoder instead. The actual VideoEncoder varies from one Xbox version to the next.

I don't think that this will matter no matter how you emulate it.

10. Xbe: The Xbox's version of the .exe file. Documented by sir caustik.

Again probably not relevant for pure LLE.
 
OP
blueshogun96

blueshogun96

A lowdown dirty shame
Welcome back blueshogun..
Thanks.


The instruction timing accuracy doesn't really matter for these platforms, just so long as you don't give it too few CPU cycles - games will probably use OS functions to wait for events anyway.
What would you say is "too few cycles"?


But, don't most games use DirectX? Assuming you can isolate the DirectX calls within the executable then you can HLE this to other native calls. Of course you might not be able to handle everything, I don't really know if it has a modified DirectX or not..

This would apply to some other hardware components as well.

Pure LLE emulation might be a decent goal, but it doesn't sound very feasible.
Yeah, even though most [commercial] games use DirectX, I'd still say HLE'ing them would be a waste of time for multiple reasons. Depending on how you try to locate each DirectX call, you're going to have a nearly impossible task to complete. In order to HLE the DirectX calls, you need every XDK version ever released by microsoft, and there are lots of them and most of them are hard to get, others impossible unless you are M$. Then comes the daunting task of generating digital signatures for them all or looking in every XBE to locate them all. It's a great idea, but not worth it IMO. On top of that, it IS a superset of DirectX so not all of the APIs are the same, some are Xbox exclusive. There are also Xbox exclusive texture formats (dx9 can handle them just fine), and exclusive COM objects (i.e. IDirect3DPalette8) which are not found in PC DirectX. This is why I see that LLE is the way to go for ultimate compatibility.

I also want to emulate low level coded apps too (i.e. OpenXDK, XboxASM, non-xdk, custom xbes, Xbox-Linux, etc.). I want my emulator to be complete so that everything can be emulated. Another reason why I want to LLE the GPU is to help the open source linux NVIDIA drivers such as Nouveau. This way I can to those driver devs in return with possibly full support for GeForce 3 cards and contribute to the xbox homebrew app scene.

So either way you look at it, at this time whether you're using HLE or LLE, we're at a loss-loss situation, and I have chosen LLE (and I also wanted to be the first to do it).


Can probably be HLE'd at the file system level.
That's the plan.

But does the kernel itself need to be emulated, so to speak? Again, via HLE; only the system call functionality is interesting (and perhaps, only a subset that games actually use, at least to start out with)

If emulating with pure LLE then this won't come into play at all (neither will the BIOS), you'll just need the proper images.
Yes, the kernel needs to be emulated. There's alot of kernel functions and games use a million and one different combinations of them all. None of them can be ignored for comatibility's sake. And if you ask me, not all of them can be HLE'd properly.



HLE should also make these details irrelevant.
Yeah, but I want them LLE'd for certain reasons.



Should only be relevant for emulating homebrew, probably.
And BIOS emulation.



I don't think that this will matter no matter how you emulate it.
It does because every BIOS revision is specific to a certain Video Encoder.



Again probably not relevant for pure LLE.
VERY relevant for both HLE and LLE.
 

Doomulation

?????????????????????????
Hehehe, sounds like a lot to reverse engineer. Good luck on that emulator. I have a feeling you're going to need it :p
 

Exophase

Emulator Developer
Thanks.



What would you say is "too few cycles"?

Don't really know, but you can ballpark something that you know will be "enough." 1/3 cycles per instruction would definitely be enough, 1/2 would probably be too.


Yeah, even though most [commercial] games use DirectX, I'd still say HLE'ing them would be a waste of time for multiple reasons. Depending on how you try to locate each DirectX call, you're going to have a nearly impossible task to complete. In order to HLE the DirectX calls, you need every XDK version ever released by microsoft, and there are lots of them and most of them are hard to get, others impossible unless you are M$.

Can it be reversed to any extent from the games themselves? Especially if they have symbol tables...

Then comes the daunting task of generating digital signatures

If you have them (in binary form, of course), creating the signatures should be automated.

for them all or looking in every XBE to locate them all. It's a great idea, but not worth it IMO. On top of that, it IS a superset of DirectX so not all of the APIs are the same, some are Xbox exclusive. There are also Xbox exclusive texture formats (dx9 can handle them just fine), and exclusive COM objects (i.e. IDirect3DPalette8) which are not found in PC DirectX. This is why I see that LLE is the way to go for ultimate compatibility.

I'm sure those things can be emulated without a direct one to one correspondence to DirectX though.

I also want to emulate low level coded apps too (i.e. OpenXDK, XboxASM, non-xdk, custom xbes, Xbox-Linux, etc.). I want my emulator to be complete so that everything can be emulated. Another reason why I want to LLE the GPU is to help the open source linux NVIDIA drivers such as Nouveau. This way I can to those driver devs in return with possibly full support for GeForce 3 cards and contribute to the xbox homebrew app scene.

So either way you look at it, at this time whether you're using HLE or LLE, we're at a loss-loss situation, and I have chosen LLE (and I also wanted to be the first to do it).

Yes, but I think that overall you will have much more work ahead of you reverse engineering the video card than a few DirectX SDKs (which I doubt can be THAT much different from each other) and it probably won't be playable for a long long time.

Yes, the kernel needs to be emulated. There's alot of kernel functions and games use a million and one different combinations of them all. None of them can be ignored for comatibility's sake. And if you ask me, not all of them can be HLE'd properly.

I don't think you understand what I'm saying. If you are using pure LLE then you don't have to concern yourself with what it takes to emulate the kernel, you just run it. It'd be no different from any other software.

Granted, pure LLE is probably not a good idea.



Yeah, but I want them LLE'd for certain reasons.

And BIOS emulation.

It does because every BIOS revision is specific to a certain Video Encoder.

VERY relevant for both HLE and LLE.

Again, if you're using LLE then software issues like this don't come into play. Of course, you need a copy of the BIOS, but it's been like that for most emulators of PS1 era and newer consoles, hasn't it?
 
OP
blueshogun96

blueshogun96

A lowdown dirty shame
Hey exophase, I'm setting up an SVN so that you can get access to the source code whenever you need. Thanks for your help :)
 

Top