Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video settings are not saved #160

Open
JayFoxRox opened this issue May 25, 2018 · 2 comments
Open

Video settings are not saved #160

JayFoxRox opened this issue May 25, 2018 · 2 comments
Labels
bug A problem which should not exist

Comments

@JayFoxRox
Copy link
Member

When quitting after changing video settings; then restarting the game, the previous video settings are not restored. Instead, they are returned to the initial state they were before making any changes.

This probably happens because of crashes while exiting the game:

Unknown function!

Stack at 0xC07FFE78; returning EAX: 0x0DDE1000
 463142 Emulation at 484A17 ('IA3dListener__2') from 484A17

openswe1r: /home/fox/Data/Projects/OpenSWE1R/main.c:3682: UnknownImport: Assertion `false' failed.

The video config might not have been written at this point.

@JayFoxRox JayFoxRox added the bug A problem which should not exist label May 25, 2018
@firodj
Copy link

firodj commented Aug 26, 2018

IA3dListener__2 is IA3dListener::Release, and IA3d4__2 is IA3d4::Release. I think it may use the stub to avoid the assert(false).

diff --git a/com/a3d.c b/com/a3d.c
index 5cdf154..375581e 100644
--- a/com/a3d.c
+++ b/com/a3d.c
@@ -232,6 +232,13 @@ HACKY_COM_BEGIN(IA3d4, 0)
   esp += 3 * 4;
 HACKY_COM_END()
 
+// IA3d4 -> STDMETHOD_(ULONG,Release)       (THIS) PURE; //2
+HACKY_COM_BEGIN(IA3d4, 2)
+  hacky_printf("p 0x%" PRIX32 "\n", stack[1]);
+  eax = 0; // FIXME: No idea what this expects to return..
+  esp += 1 * 4;
+HACKY_COM_END()
+
 // IA3d4 -> STDMETHOD(GetHardwareCaps)                         (THIS_ LPA3DCAPS_HARDWARE) PURE; // 11
 HACKY_COM_BEGIN(IA3d4, 11)
   hacky_printf("GetHardwareCaps\n");
@@ -666,6 +673,13 @@ HACKY_COM_END()
 
 
 
+// IA3dListener -> STDMETHOD_(ULONG,Release)       (THIS) PURE; //2
+HACKY_COM_BEGIN(IA3dListener, 2)
+  hacky_printf("p 0x%" PRIX32 "\n", stack[1]);
+  eax = 0; // FIXME: No idea what this expects to return..
+  esp += 1 * 4;
+HACKY_COM_END()
+
 // IA3dListener -> STDMETHOD(SetPosition3f)            (THIS_ A3DVAL, A3DVAL, A3DVAL) PURE; // 3
 HACKY_COM_BEGIN(IA3dListener, 3)
   hacky_printf("SetPosition3f\n");

@JayFoxRox
Copy link
Member Author

If you want to submit changes, please send a PR. For something minor like this I'll probably just hit merge.
Review of existing PRs by other people is also welcome.

Note that there's also a WIP branch which includes this fix: JayFoxRox#16
However, I don't have time or motivation for coding, reviewing or testing larger changes for OpenSWE1R right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A problem which should not exist
Projects
None yet
Development

No branches or pull requests

2 participants