crosire / d3d8to9

A D3D8 pseudo-driver which converts API calls and bytecode shaders to equivalent D3D9 ones.
BSD 2-Clause "Simplified" License
875 stars 77 forks source link

Hydorah improper window sizing? #76

Closed MrBlastman closed 6 years ago

MrBlastman commented 6 years ago

So a free game by Locomalito - Hydorah, does not size the game's window properly when using d3d8.dll + Reshade's d3d9.dll. What happens is only a quarter of the screen is visible in the game window--zoomed way in, while the rest is cut off and you can't see it.

Very strange.

It shouldn't be doing this? The game supports multiple screen sizing modes, and every single one of them behaves the same way, no matter the window size, be it small or fullscreen.

Remove d3d8.dll and reshade, everything is fine again. Hydorah is dx 8.

elishacloud commented 6 years ago

I have seen a similar issue with Port Royale. But that issue happens with or without d3d8to9. It could be an issue with the device creation or how the game handles windows.

For now you could try using dxwrapper. I added a fullscreen feature to that project. It also has d3d8to9 in it. I have attached the latest build: d3d8.zip

MrBlastman commented 6 years ago

Thanks!

I tried it though, and the game is still behaving as before. It is almost as if the game or wrapper is defaulting to 320x200 or whatever, as even the reshade overlay is massively zoomed in.

elishacloud commented 6 years ago

Interesting. I downloaded the game and will need to take a look at what it is doing.

MrBlastman commented 6 years ago

Awesome! Thanks.

elishacloud commented 6 years ago

Try this one: d3d8.zip

This game has a few issues. The first call to BeginScene and EndScene seems to have been done at the wrong time. Also this game causes issues with PIX.

However, the core issue is that Direct3D8 and Direct3D9 handle SetViewport differently. This game calls SetViewport three times for each frame. Direct3D8 handles this correctly, but with Direct3D9 each call to SetViewport changes the viewport and expands the image on screen. This makes it look like the "overlay is massively zoomed in".

I put in a change to only allow it to call SetViewport once per frame. This worked for my tests, but I am not sure if this change will work for all Direct3D9 games or not. If anyone has suggestions here let me know!

elishacloud commented 6 years ago

The Direct3D9 issue with SetViewport only seems to happen when SetTransform is called using D3DTS_VIEW.

MrBlastman commented 6 years ago

Hi, Still seems to be doing the same thing as before with the new .dll. Perhaps I'm not installing it right? Thanks for all your efforts for this.

Edit:

Nevermind, seems to be working, but the reshade box still thinks it is 320x240 while the game does not. Very curious.

elishacloud commented 6 years ago

Nevermind, seems to be working, but the reshade box still thinks it is 320x240 while the game does not.

Glad you got it working with this update! I am not quite sure what ReShade is doing. However, Hydorah seems to be running internally at 320x240 and simply projects that 320x240 image onto the screen. That is why everything looks so blocky in the game.

Even if ReShade sees it as 320x240 it should still work with this game now that it is using Direct3D9. If you are having an issue with ReShade you can open an issue here.