mirror of
https://gitlab.com/octospacc/Web-Archives-Misc
synced 2025-06-05 22:09:28 +02:00
DeSmuME: Fix fix-introduced bug
This commit is contained in:
@ -53,6 +53,15 @@ function $id(id) {
|
|||||||
return document.getElementById(id);
|
return document.getElementById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://stackoverflow.com/a/48178043
|
||||||
|
function waitFor(condition, callback) {
|
||||||
|
if(!condition()) {
|
||||||
|
window.setTimeout(waitFor.bind(null, condition, callback), 100);
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
var optScaleMode = 0
|
var optScaleMode = 0
|
||||||
var uiCurrentMode = 'welcome'
|
var uiCurrentMode = 'welcome'
|
||||||
var plugins = {}
|
var plugins = {}
|
||||||
@ -1748,8 +1757,7 @@ const LoadRomFromUrl = _ => {
|
|||||||
Req.open('GET', RomUrl, true);
|
Req.open('GET', RomUrl, true);
|
||||||
Req.responseType = 'blob';
|
Req.responseType = 'blob';
|
||||||
Req.onload = function() {
|
Req.onload = function() {
|
||||||
while (!EngineIsReady) {};
|
waitFor(() => (EngineIsReady == true), () => tryLoadROM(Req.response));
|
||||||
tryLoadROM(Req.response);
|
|
||||||
};
|
};
|
||||||
Req.send();
|
Req.send();
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user