Make sure all machines support JSON-encoded resources with either 'longs' or 'data' arrays

This commit is contained in:
Jeff Parsons 2017-02-28 16:20:49 -08:00 committed by Jeff Parsons
commit 51274c1a30
9 changed files with 25 additions and 13 deletions

View file

@ -205,7 +205,11 @@ ROM.prototype.doneLoad = function(sURL, sROMData, nErrorCode)
*/
var rom = eval("(" + sROMData + ")");
var ab = rom['bytes'];
var adw = rom['data'];
/*
* Resource 'longs' should always be 32-bit DWORD values, whereas 'data' bit lengths
* will vary according to the machine architecture for which the resource was designed.
*/
var adw = rom['longs'] || rom['data'];
if (ab) {
this.abROM = ab;