Cxbx-Reloaded / Cxbx-Reloaded

Xbox (Original) Emulator
https://cxbx-reloaded.co.uk
GNU General Public License v2.0
2.19k stars 257 forks source link

Rayman Arena - broken graphics in the menu and an exception after that #236

Closed furrya closed 7 years ago

furrya commented 7 years ago

Rayman Arena has broken graphics menu after loading screen screenshot_1 screenshot_5 screenshot_4 And sometimes screenshot_6

And XBE Dump Below Xbe.txt

furrya commented 7 years ago

EmuCR-Cxbx-Reloaded-20170316 .. Hmm now the exception code appeared and nothing else screenshot_8 KrnlDebug.txt

LukeUsher commented 7 years ago

Can you upload a KrnlDebug.txt for the version it was showing graphics on?

PatrickvL commented 7 years ago

Showing the build number is paying off!

furrya commented 7 years ago

@LukeUsher Hmm. Very strange behaviour of the appearing exception code i see right now, Sometimes it is appeared from start launching the game and occasionally the game shows the intro and Rayman can reach the menu like that

And KrnlDebug.txt with graphics below KrnlDebug.txt screenshot_10

furrya commented 7 years ago

Now it"s regressed at the loading screen screenshot_1 KrnlDebug.txt

LukeUsher commented 7 years ago

I'm sorry about that, any change in the XDK signatures that allows new titles to work has potential to cause other titles to regress... We hope to have an automated testing platform to catch things like this fairly soon, we should see more stable results after that.

jarupxx commented 7 years ago

This seems to crash with 54be6c85. Creation VertexBuffer has failed. One old commit 201313b4 works well. 54be6c85 generates following logs.

[0x1F58] EmuD3D8: EmuIDirect3DResource8_Register
(
   pThis               : 0x046BA5D0 (->Data : 0x00000000)
   pBase               : 0x800390CC
);
[0x1F58] EmuIDirect3DResource8_Register : Creating VertexBuffer...
[0x1F58] MemoryManager.cpp: QueryAllocationSize(
   block                : 800390CC
);
[0x1F58] MemoryManager.cpp: IsAllocated(
   block                : 800390CC
);
[0x1F58] MemoryManager.cpp: IsAllocated returns 0
[0x1F58] EmuWarn: MemoryManager: Attempted to query memory that was not allocated via MemoryManager
[0x1F58] MemoryManager.cpp: QueryAllocationSize returns 0
[0x1F58] EmuWarn: CreateVertexBuffer Failed!

VB Size = 0x0

Error: 
Desc: 
[0x1F58] EmuD3D8: EmuIDirect3DVertexBuffer8_Lock2
(
   ppVertexBuffer      : 0x046BA5C0
   Flags               : 0x00000020
);
[0x1F58] EmuWarn: ppVertexBuffer->EmuVertexBuffer8 == NULL!
[0x1F58] EmuWarn: EmuX86_Write32(0x00000008, 0x00000000) [Unknown address]
[0x1F58] EmuWarn: EmuX86_Write32(0x0000000C, 0x3F7FFF58) [Unknown address]

54be6c85-Trace.txt 201313b4-Trace.txt

PatrickvL commented 7 years ago

"Attempted to query memory that was not allocated via MemoryManager" is a side-effect of the new memory-manager that's currently lacking a feature (the ability to query within a pre-allocated memory block)

PatrickvL commented 7 years ago

We're aware of this issue though - see https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/issues/283 I'm trying to improve upon it, but I don't expect a quick fix is possible at the moment.

PatrickvL commented 7 years ago

@jarupxx Has PR #283 restored previous behaviour for this title?

jarupxx commented 7 years ago

@PatrickvL Unfortunately no. I tested cdc5d5cd still crashed.

PatrickvL commented 7 years ago

Bummer. Then the regression is probably caused by an OOVPA lookup mismatch - we should compare old with new and see which one(s) is/are different.

EDIT : I've compared https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/files/881526/201313b4-Trace.txt with https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/files/881527/54be6c85-Trace.txt but OOVPA HLE detections are identical. However, the memory manager logs something weird :

[0x1F58] MemoryManager.cpp: Allocate(
   size                 : 0x38
);
[0x1F58] MemoryManager.cpp: Allocate returns 0B6E5AD0
[0x1F58] MemoryManager.cpp: Free(
   block                : 0B6E5AD0
);
[0x1F58] MemoryManager.cpp: IsAllocated(
   block                : 0B6E5AD0
);
[0x1F58] MemoryManager.cpp: IsAllocated returns 1

Obviously, IsAllocated shouldn't return 1 after Free - EDIT : Oh, wait - Free calls IsAllocated and then you'd expect it to initially return 1. So there's something else going on here...

LukeUsher commented 7 years ago

Ooh that's interesting, I'll fix this today

Edit: Or not, Patrick is right, something else is going on here

PatrickvL commented 7 years ago

Ah, found the first real difference :

Old :

[0x18E8] EmuD3D8: EmuIDirect3DResource8_Register
(
   pThis               : 0x0BB1A5B0 (->Data : 0x00000000)
   pBase               : 0x0CB6BB84
);
[0x18E8] EmuIDirect3DResource8_Register : Creating VertexBuffer...
[0x18E8] EmuIDirect3DResource8_Register : Successfully Created VertexBuffer (0x06E109A0)

New :

[0x1F58] EmuD3D8: EmuIDirect3DResource8_Register
(
   pThis               : 0x046BA5B0 (->Data : 0x00000000)
   pBase               : 0x8001BC04
);
[0x1F58] EmuIDirect3DResource8_Register : Creating VertexBuffer...
[0x1F58] MemoryManager.cpp: QueryAllocationSize(
   block                : 8001BC04
);
[0x1F58] MemoryManager.cpp: IsAllocated(
   block                : 8001BC04
);
[0x1F58] MemoryManager.cpp: IsAllocated returns 0
[0x1F58] EmuWarn: MemoryManager: Attempted to query memory that was not allocated via MemoryManager
[0x1F58] MemoryManager.cpp: QueryAllocationSize returns 0
[0x1F58] EmuWarn: CreateVertexBuffer Failed!

Before that, the newer build logs:

[0x1F58] EmuKrnlMm.cpp: MmAllocateContiguousMemoryEx(
   NumberOfBytes        : 1177600
   LowestAcceptableAddress : 0
   HighestAcceptableAddress : 134217727
   Alignment            : 4
   ProtectionType       : (PROTECTION_TYPE)0x404 = PAGE_READWRITE|PAGE_WRITECOMBINE
);
[0x1F58] MemoryManager.cpp: AllocateContiguous(
   size                 : 0x11F800
   alignment            : 0x1000
);
[0x1F58] MemoryManager.cpp: AllocateContiguous returns 80010080
[0x1F58] MemoryManager.cpp: MmAllocateContiguousMemoryEx returns 80010080
[0x1F58] EmuD3D8: EmuIDirect3DResource8_Register
(
   pThis               : 0x046BA5A0 (->Data : 0x00000000)
   pBase               : 0x80010080
);
[0x1F58] EmuIDirect3DResource8_Register : Creating VertexBuffer...
[0x1F58] MemoryManager.cpp: QueryAllocationSize(
   block                : 80010080
);
[0x1F58] MemoryManager.cpp: IsAllocated(
   block                : 80010080
);
[0x1F58] MemoryManager.cpp: IsAllocated returns 1
[0x1F58] MemoryManager.cpp: QueryAllocationSize returns 1183744
[0x1F58] EmuIDirect3DResource8_Register : Successfully Created VertexBuffer (0x06D43440)

So the registered vertex buffer resides somewhere in this first (1150 KB large) allocated block... (Actually, that log must be from a build before the alignment was fixed, as alignment on 0x1000 can never lead to an address ending on 0x080)

PatrickvL commented 7 years ago

@jarupxx Can this be re-tested once PR #301 is merged in?

jarupxx commented 7 years ago

Improvement to creation VertexBuffer succeeded in cf4ff0cc, but crashed. cf4ff0cc Edit: Attach log cf4ff0cc-Trace.txt Note: This game will crash in the XMV library when running in the debug build, so I renamed videos\intro.xmv to work around this problem. I should be explained it first, I'm sorry.

If you need a log containing the intro movie, please check it. cf4ff0cc-fulllog.txt

jarupxx commented 7 years ago

Fixed in e250b1f8. Reached the menu! It crashes before going to the game. rayman arena KrnlDebug.txt

furrya commented 7 years ago

Cxbx-Reloaded Version 9173d4ab (May 3 2017) - the game crashes at loading screen now KrnlDebug.txt

screenshot_5

furrya commented 7 years ago

The Rayman Arena warning, after that warning the game crashes immediately. Cxbx Reloaded 488db560. screenshot_1 KrnlDebug.txt

RadWolfie commented 7 years ago

I... am unable to produce it since I am stuck with the same previous error crash you're having. "0x000F99F2(=timeKillEvent+0x8c64)". If you are able to reproduce it every time you boot up the game, then I will work on it if I can get past the crash I mention recently.

furrya commented 7 years ago

@RadWolfie Oh, Ok. Thank you. I looked more closely when happens that error while loading. Hm, and yes - sometimes another error has to appear Edit: it's very strange behavior - the timeKillEvent error appears more often then DirectSoundBuffer Lock Failed warning appears screenshot_1 KrnlDebug.txt

RadWolfie commented 7 years ago

No worry, I have discover 3 other titles has regress for "DirectSoundBuffer Lock Failed!" error. I'll try to find a fix and create new pull request within 12 hours from this post.

PatrickvL commented 7 years ago

This issue was moved to Cxbx-Reloaded/game-compatibility#183