roean78 / texmod

Automatically exported from code.google.com/p/texmod
0 stars 0 forks source link

Touhou sky arena crashes #17

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The game crashes on loading screen (all three methods).

I have attached the log where D3D release issue is shown.

With uMod1, the game loads correctly and I am able to extract the textures.

I'll check the difference on it.

Original issue reported on code.google.com by Evil.Lo...@gmail.com on 22 Aug 2012 at 8:56

Attachments:

GoogleCodeExporter commented 8 years ago
I have fixed some fatal bugs. I uploaded the new binaries right now. Does 
Touhou Sky Arena works with the (r53) version?

Original comment by c...@koerner-de.net on 23 Aug 2012 at 6:58

GoogleCodeExporter commented 8 years ago
Hi and thanks for the hard work! :)

Tried with the r53 but still crashing.

Attached the log.

Original comment by Evil.Lo...@gmail.com on 23 Aug 2012 at 7:10

Attachments:

GoogleCodeExporter commented 8 years ago
I guess I found the problem, I still don't know where exactly the bug is, but I 
have coded a workaround. I attach the dll with logging mode enabled. Please try 
them and if it crashes again provide me the log files ;)

In more detail:
Both log files have similar lines
13 = uMod_IDirect3DDevice9::Release(): 02838038
Error in uMod_IDirect3DDevice9::Release(): 0!=13

That means, that uMod counts the release counter to zero and thus delete 
everything although the original device is not released and the game tries to 
access the device further. But because a the uMod_Client object was deleted the 
game crashes on further calls where the uMod_Client object is used.

Original comment by c...@koerner-de.net on 23 Aug 2012 at 7:39

Attachments:

GoogleCodeExporter commented 8 years ago
Now it works.

Thanks again!

So not knowing yet where the count reference is missing, the workaround relies 
to not delete the object even the count is zero, isn't it?

Original comment by Evil.Lo...@gmail.com on 23 Aug 2012 at 8:01

GoogleCodeExporter commented 8 years ago
The main problem is that sprites, fonts and textures must be deleted before the 
device is destroyed. But if I don't have counter, I recognize the last release 
of the device, if the device returns 0 on the call of Release(), but than it is 
to late ;)

I need to delete:
- font (for message in the upper left corner)
- sprite (for texture in the upper left corner)
- green single texture (also the cube and volume version)

Normally also each loaded fake-texture should be deleted, but these are 
deleted, in the moment their game texture counterparts are deleted. So if the 
game deletes all of its textures, also each fake texture is deleted.

Now I implement it that way:
If my own reference drops down to zero or even less (previously only if equal): 
delete the 3 points. If the game continues working, all 3 points get created 
again automatically.

But the uMod_Cliet gets now only deleted if the original device return  zero on 
calling Release(). This client was previously also deleted in the same moment 
as the 3 points, but this client is VERY important and function of it gets 
called very often. So the next rendering of scene crashes the game if the 
client is not present.

In uMod 1 this bug also exist, but there where more secure condition if the 
uMod_Client is unequal to NULL, but this seemed to me senseless because it 
should not be NULL.

So in short:
Everything is deleted, but it is important what must be deleted before the 
device is destroyed and what can be deleted afterwards.

Original comment by c...@koerner-de.net on 25 Aug 2012 at 4:49