webretro
webretro copied to clipboard
Not Loading a Game
I forked the repo and added it to a page of my own because the official one is blocked, however, when I loaded up the game I wanted to play, which was a patched version of 1636 - Pokemon Fire Red (U) (Squirrels) to include the rom hack Pokemon Radical Red, the game doesn't load. If I pause it and then unpause it, the page goes white and unresponsive. However, the file itself can't be the problem because on another emulator, gbajs2, it runs fine. I'm not sure what the actual error is but something is causing it to not work, and it's specific to the emulator.
Try the same rom on a personal computer, and check the devtools console output.
I used same website, same file, worked on a personal computer but still not the school computer. What do you mean by devtools console output, like the thing in inspect element?
Yes. Chances are the school computer ran out of memory.
I'm not 100% sure that's the case because the same emulator, on the official website, that is the one in the description, was working perfectly fine. I tried it like a week ago, and it worked. There was no like computer update that could have changed anything.
Yes. Chances are the school computer ran out of memory.
this error is the RA (sound) stop! RA.context.state != "running"
The current fix is:
function _RWebAudioStart() {}
change
function _RWebAudioStart() {
Module.pauseMainLoop();
if(RA.context && RA.context.state != "running") return mobileAudioRun(RA);
}
var ElmRA;
function mobileAudioRun(RA){
if(!ElmRA){
ElmRA = document.createElement('div');
ElmRA.style.cssText = `
position: fixed;
left: 0px;
right: 0px;
top: 0px;
bottom: 0px;
`;
ElmRA.innerHTML = `<h1 style="position: absolute;margin:auto;width:200px;60px">click run</h1>`;
ElmRA.addEventListener('pointerdown',e=>{
ElmRA.hidden = true;
if (RA.context) RA.context.resume();
if (!RA.context || RA.context.state != 'running') {
RA.bufIndex = 0;
RA.bufOffset = 0
var ac = window["AudioContext"] || window["webkitAudioContext"];
if (RA.context) {
RA.context.close();
delete RA.context;
}
RA.context = new ac;
RA.numBuffers = M.latency * RA.context.sampleRate / (1e3 * RA.BUFFER_SIZE) | 0;
if (RA.numBuffers < 2) RA.numBuffers = 2;
for (var i = 0; i < RA.numBuffers; i++) {
RA.buffers[i] = RA.context.createBuffer(2, RA.BUFFER_SIZE, RA.context.sampleRate);
RA.buffers[i].endTime = 0
}
RA.nonblock = false;
RA.startTime = 0;
RA.context.createGain();
RA.setStartTime();
RA.context.resume();
}
Module.resumeMainLoop();
})
}
ElmRA.hidden = false;
}
How you be able to fix this in a chromebook?
probably the easiest way is:
- make your own fork
- fix it there
- deploy that version to your own github page
i explained how to here https://github.com/BinBashBanana/webretro/issues/75#issuecomment-1412213953
^