Monday, November 2, 2009

Panzer Dragoon ORTA: More progress!

Okay, I got around to trying to get Panzer Dragoon ORTA a bit more stable in Cxbx. It's not perfect yet, but it's getting there. Panzer and Windows Vista don't get along at all, so it makes thing a bit more frustrating. Nothing I can't handle (I hope).

So, what's new? Okay, Panzer Dragoon ORTA is finally showing some REAL in-game progress. It's still not considered playable at this point (still some bugs to work out). TBH, I still don't think I'll remove the "asterisk" yet, but like I always say, you can't complain about what little progress comes by, because in this neglected area of emulation, some is better than none!

New functions added:
  • IDirect3DDevice8_SetPixelShaderConstant (4928 - 5344) (implimented only for 4928)
  • IDirect3DDevice8_SetRenderState_TwoSidedLighting (4627 - 4928)
  • IDirect3DDevice8_GetTexture2 (4627 - 4928)

New deferred texture states added:

Current issues: There may be a problem with my implementation of IDirect3DDevice8_GetTexture2. Since no one else did it, I had to write my own. It's a bit more complex than you might think, but here's my current approach.

// Since this function does not specify any texture stages,
// I guess we can assume it's just the first one. According
// to the XDK documentation, this function should also add
// to the reference count.
// TODO: Verify texture?

pTexture = EmuD3DActiveTexture[0];

EmuSwapFS(); // Xbox FS
EmuSwapFS(); // Win2k/XP FS

Another idea I had was this:

hRet = g_pD3DDevice8->GetTexture(0, pTexture->EmuBaseTexture8);

What happens is that Panzer does an unusual act of getting the current texture, setting to some stage, then releasing that copy of the texture. Not 100% sure if it's my implementation of this function, but Cxbx crashes when releasing the texture. I'll try implementation #2 later on, because it's late and I'm tired!

What's the deal with no 3D graphics? It's too early to say right now, but so far I've narrowed it down to two possibilities:

1. Incomplete PushBuffer simulation. This was a problem in Turok (and still is occasionally).
2. RenderTarget problems. Cxbx continuously informs us that it's setting the render target fails.

Upgrading to Direct3D9 or better yet, OpenGL, may do use some good. That's for a later date though...


1 comment: