Closed barbudreadmon closed 7 years ago
I will try to take a look when I will have time
I took a look, it segfault on :
strncpy(dip_value->friendly_name, dip_value->bdi.szText, sizeof(dip_value->friendly_name));
because dip_value->bdi.szText is null
Adding :
if (dip_value->bdi.szText == NULL) continue;
seems to solve the issue.
@AkimanBengus : Do you think it's okay ?
I pushed this commit : https://github.com/libretro/fbalpha/commit/db69226913551e1468f460fdb0152c49f3085354
It seems we are supposed to use them :
Those are the default dip settings, for when a game starts that hasn't been started before. Check your parser against ours in burner/win32/inpdipsw.cpp. {0x14, 0xff, 0xff, 0x7f, NULL }, 0x14 is the position # of DrvDips variable in the input structure. one of the next 0xff's is to tell the parser that its the default dips, and one of them is the bitmask (check the struct to be sure), the 0x7f is the actual default dip settings. The description field is usually left NULL for default settings. If you remove this, chances are the game will break. delete config/games/actfancr.ini so it uses the defaults and reload your game and see what I mean.
Well, games are launching, but i don't think dipswitches for those games are working
Hello,
I don't think it's correct if I understand good the segfault is causing by the NULL in the dip_value->bdi.szText
string when we are parsing the default value.
And this is normal that this string is NULL with the pgi
representing the default value.
So the line strncpy(dip_value->friendly_name, dip_value->bdi.szText, sizeof(dip_value->friendly_name));
is not necessary for the pgi
default value.
But with your code, I think you are skipping the initialisation of the default value So I would do just like this under this code
I'm sorry but I don't think I will have time to this.
if (is_default_value)
{
dipswitch_core_option_value *default_dip_value = &dip_option->values[0];
default_dip_value->bdi = dip_value->bdi;
default_dip_value->pgi = dip_value->pgi;
snprintf(default_dip_value->friendly_name, sizeof(default_dip_value->friendly_name), "%s %s", "(Default)", default_dip_value->bdi.szText);
}
else
{
strncpy(dip_value->friendly_name, dip_value->bdi.szText, sizeof(dip_value->friendly_name));
}
Same thing, games are launching, but there are still issues with dipswitches values, pretty obvious in a game like armwrest where "Service mode" became a value for "Rematches".
I wanted to use their code in burner/win32/inpdipsw.cpp to understand how it works, but the amount of windows specific function make it hard to understand for me.
Well, at least for now, those games are playable, and i don't think it breaks dipswitch support in games which worked previously, so i'll wait for some clean fix when you've got some time :).
My bad, it seems your code is actually the good fix, i see the same values for armwrest dipswitches in fba standalone. Thanks again, i close :).
I'm reopening this, actually there are still missing dipswitches and wrong default values compared to fba standalone.
There is more to this issue than i thought : with the fix, alcon still segfault on dipswitches.
I took a look at the stand alone version for the game 'armwrest' and there is also a problem with the dipswitch 'Rematches' but also with the 'Difficulty'. Is it possible that this issue can come from the code representing the dipswitch in the file 'd_punchout.cpp'
Can you tell me which game is good in fba stand alone and not in libretro ? When I will have time I will look at this game.
When I coded the dipswitch I did know nothing about it. It was only a reverse engineering from the code of the stand alone version. And I'm sure that there still some bugs due to the misunderstanding of the BurnDIPInfo and its values
I tried a few games up to "C" letter
Games still crashing :
Games launching but dipswitches seems different from standalone :
Also, i asked a few questions to "dink" upstream, perhaps you should ask some too, here is the topic : http://neosource.1emulation.com/forums/index.php?topic=2693.msg22503#msg22503
Hi @barbudreadmon
I adapted the parser of the DipSwitches to handle some errors present in the BurnDIPInfo description. I corrected the BurnDIPInfo description of the games you provided me. You can see what kind of errors exist by looking at my second commit. I also added some logs to detect all the errors I know, it's possible that there is still unknown things
It will be good to show this to dink to reflect the correction in the upstream.
dink said thanks :). He also provided more fixes for those drivers.
You are welcome :-) I hope that for now it will not segfault anymore ! It would be great to be able to launch fbalpha in a batch with all the drivers to see which remain incorrect
I can, here is the list of dipswitch errors i collect when i run every game in batch mode : http://pastebin.com/raw/iixAc50n Do i submit this list upstream or do you want to check it first ?
This is not that I don't want, but I haven't many times for this. And I prefer that he look because maybe he will see other errors which I don't know.
About the log, it's important to know that:
I'm worry about this one:
I'm closing, games affected by this issue aren't supposed to crash anymore in fbalpha. Also, dispswitch error logs were sent to upstream and dealt with, .40 will contain the fixes.
Seems to me this game crash while reading dipswitches, i'm not familiar with this part of the code so it would be really nice if @AkimanBengus could take a look at this issue.
Edit : seems to me like some other games like "armwrest" are suffering the same issue.