Komentar
Germanyhdc07 years ago

cheeseandcereal: The game uses some slightly modified code from d3denum.cpp from the DirectX 6 SDK samples to create a list of available graphics cards and display modes: First it enumerates all DirectDraw/Direct3D display "drivers", then it enumerates the "devices" for each driver and finally it enumerates the "modes" (resolution and bpp) for each device. In the first step (the enumeration of the drivers) the amount of video memory and other information is saved in a list for each driver. Later, when the display modes are enumerated, the video memory that would be needed if the user chose the currently enumerated display mode is calculated. If the current device is a "hardware device", the required amount of video memory for this mode is compared to the available video memory that was obtained in the first step. If the mode would need more memory than is available, it will be skipped. The problem is that for the comparison the unsigned 32-bit integer containing the available memory is cast to a ¤signed¤ integer. So if you have more than 2 GB (and less than 4 GB) of video memory, the comparison looks like this: "if <negative value> is less than <required video memory for this display mode>" and will always return "true". So all display modes look like they would consume too much memory and the list of available modes to choose from will be empty if you have more than 2 GB of video memory. Since the memory check is only performed for "hardware devices", it's sufficient to convert the "jz" (0x74) to a "jmp" (0xEB) instruction at the "hardware device" check, so the block containing the memory check is also skipped for hardware devices.

PeterAfro: This worked for me:

Germanyhdc07 years ago

Here are some more addresses:

0x49D910 is function that contains the main loop. It's directly called by WinMain.

0x49DBB2 is executed when a level is loaded: The int16 at 0x52AD8A is expected to contain the desired level ¤index¤. Then the lookup table at 0x50268C is used to get the level ¤number¤. It contains 16 int32 values and looks like this: http://pastebin.com/yLwUnz2e Then the function at 0x414720 is called with the level number as the only argument. It's crucial that the global level index variable corresponds to the level number that is passed to 0x414720. Otherwise the game will crash. There are at least two special level numbers: 0 is the main menu and 0x10 is level selection.

So if you want to start a certain level, set a breakpoint at 0x49DBB2, go to the level selection and start any level. When the breakpoint is hit, set 0x52AD8A to the index of the level you want to start and continue.

cheeseandcereal menyukai ini
Germanyhdc07 years ago

OK, so dgVoodoo is causing the DirectDrawCreate problem.

Anyway, I think I found out what you have to do in order to bypass the 2 GB error without using dgVoodoo. If you want to try it out, here are the instructions:

  • If DirectDrawTest.exe is still named toy2.exe, rename it back to DirectDrawTest.exe. Also rename the game exe back to toy2.exe
  • Make sure the game won't use dgVoodoo: Open C:\Program Files\Disney Interactive\Toy Story 2 in Windows Explorer and delete D3D8.dll, D3DImm.dll and DDraw.dll.
  • You can verify that dgVoodoo is not used by opening a command prompt in the game directory and running DirectDrawTest.exe: If it displays 0x00000000, dgVoodoo is not used. If it's still in use, 0x80004005 is shown.
  • Install HxD: https://mh-nexus.de/en/downloads.php?product=HxD
  • Run HxD as administrator and open C:\Program Files\Disney Interactive\Toy Story 2\toy2.exe in HxD
  • Double click Offset: 0 in the lower left corner
  • Enter ACAC2 and press OK
  • The value at the cursor should say 74
  • Type EB in order to overwrite the value
  • Save the file and close HxD
  • Test whether the game is working now
Germanyhdc07 years ago

The output looks good. So DirectDrawCreate works when it's not called from toy2.exe. Now could you move DirectDrawTest.bat and DirectDrawTest.exe to the directory that contains toy2.exe and post the results again? After that, rename toy2.exe to something else, rename DirectDrawTest.exe to toy2.exe and in the command prompt run toy2.exe. What's the output of the command?

Germanyhdc07 years ago

Yes, these addresses belong to the US version. I found some other addresses, but they are only related to the graphics setup.

Germanyhdc07 years ago

The locations of the code that will be executed when you collect certain things could be useful: 0x4A1297 Battery 0x4A12E2 Token 0x4A1339 Extra life 0x4A161E Green laser 0x4A165B Part of Mr. Potato Head

Germanyhdc07 years ago

Thanks for the log files.

PeterAfro: The "unable to enumerate a suitable device" error is normally caused by a bug in the part where the amount of available graphics memory is checked. However, on your machine the game fails even before the memory check, namely when calling the WinAPI function DirectDrawCreate. I made a small program that tests DirectDrawCreate and its DirectX 7 version, DirectDrawCreateEx, with different parameters. Could you run DirectDrawTest.bat and upload its output? You can write its output to a file by running it this way from the command prompt: DirectDrawTest.bat > DirectDrawTest.txt

https://github.com/hdc0/DirectDrawTest/releases/download/v1.0/DirectDrawTest.zip

Germanyhdc07 years ago

Could anyone who managed to bypass the "unable to enumerate a suitable device" bug by using dgVoodoo temporarily disable dgVoodoo, start toy2.exe with the -log option and post his toy2.log?

PeterAfro: Do you get the same output from Cheat Engine with and without dgVoodoo?

Germanyhdc07 years ago

PeterAfro: Could you try this? It won't fix the bug, but it will help to narrow down where the problem is. ¤ Start Cheat Engine ¤ Click File -> Open Process -> Create process and select Toy2.exe. ¤ Don't pass any parameters. ¤ Click Tools -> Lua Engine in the Memory Viewer window. ¤ Paste the contents of http://pastebin.com/vuWr0fYP and click Execute. Keep the Lua Engine window open. ¤ Click Debug -> Run in the Memory Viewer window. ¤ Post the text that was added to Output when you clicked Run.

Germanyhdc07 years ago

Hey,

I've added the command line options for toy2.exe to the wiki: http://pcgamingwiki.com/wiki/Toy_Story_2:_Buzz_Lightyear_to_the_Rescue#Command_line_arguments The -mpeg option could be useful for speedrunning.

Germanyhdc07 years ago

It seems your graphics card is too old: [quote]Warning: You need a strong iron hardware for dgVoodo 2 versions up to 2.2 Starting with that version I optimized a lot in the shaders so a 3-4 years old nVidia or ATI card will do in general.[/quote] http://dege.freeweb.hu/dgVoodoo2.html

Germanyhdc07 years ago

Is this the whole file? If not, please upload the part between "BEGIN EXAMINE MACHINE" and "END EXAMINE MACHINE" too.

Germanyhdc07 years ago

PeterAfro: If it still doesn't work, can you pass the "-log" parameter to toy2.exe and upload the contents of toy2.log to http://pastebin.com/ ?

Tentang hdc0
Bergabung
7 years ago
Daring
1 year ago
Jalanan
0