Closed fcard closed 2 years ago
Took a peek at the s40v2 version from Dedomil (MD5: fd3f332ca1313f4c172a00eea904c294
)
The game crashes at m.a(InputStream), when loading an image via createImage from an (intentionally) null InputStream FreeJ2ME's current implementation of Image.createImage(InputStream) returns a null Image object on an error, which is later deferenced in the game causing the crash. The game appears to only expect an exception to be thrown on errors and assumes the object is valid otherwise. Moreover, the MIDP-2.0 javadocs mention that createImage should throw an IOException on any image reading/decoding issue, or a NullPointerException when the passed InputStream is null
Inserting a if (stream == null) {throw new NullPointerException();}
check after line 60 of javax/microedition/lcdui/Image.java appears to make the game work.
Also, I think if(t.isNull) { return (Image)null; }
could be changed with if(t.isNull) { throw new IOException(); }
to comply with the standard and completely cleaning out any chances of passing back a null pointer
I'm far from experienced with this 😅, so please point out if I'm missing something important!
That seems right to me. I'll be happy to merge that if you want to send a pull request.
I have access to two versions, one that says that it is for Samsung GT-E2120/E2121 phones, while the other only specifies that it's for Nokia Series 40 version 2 phones; upon loading them, both of them only give me a blank screen.
I have managed to completely play through both of them on the Kemulator emulator, so I assume they are not corrupted files.
s40v2 version: https://www.youtube.com/watch?v=2dpVea5N0Mk
E2121 version: https://www.youtube.com/watch?v=9gCWQ2Mjcm0
(I have managed to start and finish two 240x320 versions on freej2me, the Sony Ericsson K800i one and one for Series 40 version 3a phones, the sound is quite buggy in them and sonic likes to be upside down sometimes, but they are otherwise fine. I've also briefly tested a few other resolutions, and they all seem to start fine)