Skip to content

fix startup crash#309

Open
m-i-k-e-e wants to merge 3 commits intojsm174:masterfrom
m-i-k-e-e:patch/elvira
Open

fix startup crash#309
m-i-k-e-e wants to merge 3 commits intojsm174:masterfrom
m-i-k-e-e:patch/elvira

Conversation

@m-i-k-e-e
Copy link
Contributor

assuming int as boolean was not working

@francisdb
Copy link
Contributor

@jsm174
Copy link
Owner

jsm174 commented Jun 11, 2024

@francisdb - have we seen this issue before? I thought people do checks like this all the time.

@m-i-k-e-e - This looks wrong, no space between the 0 and Then

Screenshot 2024-06-11 at 7 37 17 AM

@francisdb
Copy link
Contributor

vpmColourised is actually "" and vbscript does not support If "" Then. Values like "0" or "true" work

Controller.Games(cGameName).Settings.Value("dmd_colorize") on windows returns 0 because vpinmame comes with some default settings

Not sure I picked the correct locations but pretty sure these are set up by default

https://github.com/vpinball/pinmame/blob/7bb409ec08cf9e4221a1463f58defcfb4e558437/src/win32com/VPinMAMEConfig.cpp#L81-L91

https://github.com/vpinball/pinmame/blob/7bb409ec08cf9e4221a1463f58defcfb4e558437/src/unix/config.c#L78-L87

@jsm174 is this something you would want to add to standalone?

@francisdb
Copy link
Contributor

francisdb commented Jun 11, 2024

@m-i-k-e-e a rebase should fix the build checks, but not a big deal as this was a known issue

@francisdb
Copy link
Contributor

I wonder if all the other recent bigus tables have this issue.

@jsm174
Copy link
Owner

jsm174 commented Mar 27, 2025

@m-i-k-e-e - Hello, I think this issue could be related to something that was just fixed in standalone branch and 10.8.1/master thanks to @francisdb: vpinball/vpinball#2268

Could you please check again?

@francisdb
Copy link
Contributor

now fails on one of the next lines

vpm33Percent = Controller.Games(cGameName).Settings.Value("dmd_perc33") / 100

Looks like these dmd_perc33 / dmd_perc66 / dmd_perc0 and dmd_colorize settings should be added in standalone?

@jsm174
Copy link
Owner

jsm174 commented Mar 27, 2025

I feel like we should take care of this:

STDMETHODIMP VPinMAMEGameSettings::put_Value(BSTR sName, VARIANT newVal)
{
   mINI::INIStructure ini;
   mINI::INIFile file(m_pController->GetIniPath() + ((VPinMAMEGame*)m_pGame)->GetName() + ".ini");
   file.read(ini);

   string szName = MakeString(sName);
   BSTR bstr = BstrFromVariant(&newVal, 0x409);
   string szValue = MakeString(bstr);
   ini["settings"][szName] = MakeString(bstr);
   SysFreeString(bstr);

   file.write(ini);

   PLOGD.printf("name=%s, value=%s", szName.c_str(), szValue.c_str());

   return S_OK;
}

Could this be a parens issue?

@francisdb
Copy link
Contributor

francisdb commented Mar 27, 2025

INFO  [2959323] [DebuggerModule::Print@4279] Script.Print 'dmd_perc0 = '
INFO  [2959323] [DebuggerModule::Print@4279] Script.Print 'dmd_perc33 = '
INFO  [2959323] [DebuggerModule::Print@4279] Script.Print 'dmd_perc66 = '

These values are "" and should have defaults from pinmame?

https://github.com/vpinball/pinmame/blob/06702fdafcc33bebfd249b1b63cbda564824dbf3/src/unix/config.c#L85C1-L87C105

@jsm174
Copy link
Owner

jsm174 commented Mar 27, 2025

none of that is actually supported in libpinmame, so it's kind of faked in the controller.

@francisdb
Copy link
Contributor

Faking is ok I guess, as long as the table does not crash

@jsm174
Copy link
Owner

jsm174 commented Mar 27, 2025

is it an app crash or a vbscript crash?

@francisdb
Copy link
Contributor

francisdb commented Mar 27, 2025

vbscript crash because the app returns "" instead of the default numbers the table expects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants