Skip to content

Commit

Permalink
Merge pull request #147 from pau1ie/master
Browse files Browse the repository at this point in the history
Allow loading of remote tape images
  • Loading branch information
mattgodbolt committed Jun 19, 2017
2 parents 3bfff88 + 83f15d6 commit 6f86253
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions main.js
Expand Up @@ -657,6 +657,18 @@ require(['jquery', 'utils', 'video', 'soundchip', 'ddnoise', 'debug', '6502', 'c
processor.acia.setTape(tapes.loadTapeFromData(tapeImage, image));
});
}

if (schema === "http" || schema === "https") {
return utils.loadData(schema + "://" + tapeImage).then(function (tapeData) {
if (/\.zip/i.test(tapeImage)) {
var unzipped = utils.unzipDiscImage(tapeData);
tapeData = unzipped.data;
tapeImage = unzipped.name;
}
processor.acia.setTape(tapes.loadTapeFromData(tapeImage, tapeData));
});
}

return tapes.loadTape("tapes/" + tapeImage).then(function (tape) {
processor.acia.setTape(tape);
});
Expand Down

0 comments on commit 6f86253

Please sign in to comment.