ruffle icon indicating copy to clipboard operation
ruffle copied to clipboard

Error on http://extratoxic.com/_shared/Nintendo/06_NDO_013_MissionInSnowdriftland/

Open thatsprettygood opened this issue 4 years ago • 7 comments

The console was spammed with these messages in this order.

Object method onLoading is not callable core.ruffle.js:1:30473
Object method getBytesLoaded is not callable core.ruffle.js:1:30473
Object method getBytesTotal is not callable core.ruffle.js:1:30473

The game stays on a white screen. They did not stop until I closed the page.

thatsprettygood avatar Dec 25 '20 05:12 thatsprettygood

Started looking for this after Nick's video

deoxal avatar Dec 25 '20 20:12 deoxal

The latter 2 errors are because the XML class does not have implementations for getBytesLoaded and getBytesTotal

https://github.com/ruffle-rs/ruffle/blob/ed4d51dfc1b28e2547925e927a94fffabcdb994f/core/src/avm1/globals/xml.rs#L1061

gyroninja avatar Dec 26 '20 12:12 gyroninja

onLoading appears to be a function defined by the game which acts as a callback that is called after resources are done loading.

After adding a basic implementation for getByteLoaded and getBytesTotal that are hard coded to 5 and 10 respectively, none of the other errors went away, nor did the game appear to get any further in loading (visually).

There are also some other warnings in the console when trying to load the game. Sprites 1, 2, 3, 7, 13, 14, and 15 cause a Avm1::pop: Stack underflow warning.

There is another warning saying that onLoad is not callable for an instance of a XMLObject (the same thing which needed getByteLoaded and getBytesTotal). According to #286 onLoad should be implemented, so further investigation is needed.

gyroninja avatar Dec 26 '20 13:12 gyroninja

Changing getBytesLoaded and getBytesTotal to return the same value gets the game to load farther. It then runs into an issue with how the XML is being parsed. ~~Ruffle is treating the <?xml version="1.0" encoding="UTF-8"?> at the start of the xml file as the first child where Flash skips that and returns the next tag. Deleting this line in the file gets the game to progress to the level select.~~ Edit: It's rather the \r\n after the xml decleration that is messing it up. The text node is being treated as the first in ruffle, but not flash.

gyroninja avatar Dec 27 '20 11:12 gyroninja

Ruffle is missing handling for the ignoreWhite property for xml objects which is what I was running into.

gyroninja avatar Dec 28 '20 02:12 gyroninja

After adding support for ignoreWhite, it did not seem to get any further into loading into the game. Upon inspection it seems like Ruffle is having issues loading the ad images which are jpg images. It looks like ruffle assume movie_clip.loadMovie(url) points to a swf file where flash allows either a swf or an jpg, gif, or png file. Edit: Replacing the game files that are images with dummy swf files lets the game get past the loading modal, but the game itself stayed a black screen. This will be about as far as I'm going to investigate into this.

gyroninja avatar Dec 28 '20 11:12 gyroninja

Still not working as of today; all that displays is a white screen and this error is shown repeatedly in the console: Avm1::pop: Stack underflow

n0samu avatar Sep 21 '22 04:09 n0samu

I think the root cause of this issue is https://github.com/ruffle-rs/ruffle/issues/6552.

artnFe avatar Feb 25 '23 10:02 artnFe

The game isn't even reaching a point where it tries to load an image in Ruffle, so I don't think so. I think there may still be an issue parsing the XML file. Or maybe getBytesLoaded and getBytesTotal are still not returning the right values for XML files.

n0samu avatar Feb 25 '23 21:02 n0samu

It seems like XML.getBytesLoaded and XML.getBytesTotal are still not implemented in Ruffle (not even as stubs).

By the way, the provided link is dead (404) but a ZIP file with the archive can be downloaded here: https://archive.org/details/06-ndo-013-mission-in-snowdriftland_202101

Toad06 avatar Mar 19 '23 19:03 Toad06