Re: miniSphere 4.5.11
Reply #1609 –
I was curious about the error DaVince pointed out.
I worked my way through the JS to try and find the trigger(s):
The cause of the hard crash was apparently using OpenFile with a file name ending in ".lng" - removing the ".lng" from the document name and at the same time removing it from the function call resulted in the crash no longer occurring.
However there was another crash - in the start of the game function there is the following:
for (var i = 0; i < game.arguments.length; i++)
{
if (game.arguments[i] == "-d") debug = true;
}
In minisphere game.arguments is not defined and hence this causes a JS error (not a miniSphere hard crash though)
after commenting out this and changing the name above the game starts without crashing but it doesn't seem to do anything - it loads a screen with some moving clouds but doesn't then seem to take any input - not sure if this is intentional or another incompatibility I haven't found.
Edit: I've also spent a little time looking at miniSphere source to try and work out why the hard crash above occurs, I can't work it out for sure, as I don't quite follow the logic (my C skills are rather limited) but it looks to me like the function kev_open line 16 and on of Kevfile.c defines a variable slurp_size but never gives it a value - this variable is then supplied to al_open_memfile as a parameter if a certain condition is met - I cannot work out the logic of the condition - but at a guess it's if sfs_fslurp line 462 of spherefs.c fails to read the file, I can't see what the ".lng" extension has to do with this but; hopefully that's a useful start.
EDIT 2: I was wrong with the ".lng" extension point - the issue was not that at all; instead the issue was that the file was 0 bytes - changing the name somehow made it 1 byte instead of 0; the issue is also fixed if you open the file with a text editor and add some content of any kind to it.