djhackersdev / segatools

Loaders and hardware emulators for SEGA games that run on the Nu and ALLS platforms
The Unlicense
60 stars 7 forks source link

Fix warnings and build failures from !30 - [merged] #60

Closed icex2 closed 1 year ago

icex2 commented 3 years ago

In GitLab by @Felix on Jun 16, 2021, 19:57

Merges fix-warnings -> master

I got a few warnings and an undefined reference on Direct3DCreate9 when building from the latest master. This MR fixes these minor issues.

icex2 commented 3 years ago

Dumb question, but did you test this? Just did a quick Google on the warning you mention in your OP and it sounds like we are missing linking to d3d9.lib. Which, I would assume, will crash during runtime when trying to resolve references.

icex2 commented 3 years ago

In GitLab by @Felix on Jun 16, 2021, 21:59

Project DIVA and Initial D Zero do not use Direct3D 9. Project DIVA uses OpenGL. Initial D Zero uses Direct3D 11. If they used Direct3D 9, then we would be using hooklib/gfx.c but since they do not use Direct3D 9 we do not "link" to that, which causes the undefined reference error.

icex2 commented 3 years ago

In GitLab by @Felix on Jun 16, 2021, 22:00

This is why chunihook successfully compiles.

icex2 commented 3 years ago

But we are including the hooklib/gfx.c module apparently because otherwise, why would the compiler print the warning?

Do we even need that module for the games you listed?

Reference search on code base: https://dev.s-ul.net/search?utf8=%E2%9C%93&search=Direct3DCreate9&group_id=86&project_id=204&scope=&search_code=true&snippets=false&repository_ref=master&nav_source=navbar

icex2 commented 3 years ago

In GitLab by @Felix on Jun 16, 2021, 22:03

We don't need it for those two games which is why I removed the export definition for that function since it isn't defined because gfx.c is not being linked into the hook DLL for those two games.

Are you referring to the warning about resolving _Direct3DCreate9 by linking to _Direct3DCreate9@4? If so, that warning is caused by stdcall function name mangling.

icex2 commented 3 years ago

approved this merge request

icex2 commented 3 years ago

unapproved this merge request

icex2 commented 3 years ago

In GitLab by @Felix on Jun 16, 2021, 22:34

added 1 commit

Compare with previous version

icex2 commented 3 years ago

approved this merge request

icex2 commented 3 years ago

In GitLab by @Felix on Jun 17, 2021, 03:39

resolved all threads

icex2 commented 3 years ago

In GitLab by @Felix on Jun 17, 2021, 03:40

added 5 commits

Compare with previous version