webretro icon indicating copy to clipboard operation
webretro copied to clipboard

Not Loading a Game

Open EntitledParent opened this issue 2 years ago • 10 comments

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.

EntitledParent avatar Feb 02 '23 16:02 EntitledParent

Try the same rom on a personal computer, and check the devtools console output.

BinBashBanana avatar Feb 02 '23 17:02 BinBashBanana

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?

EntitledParent avatar Feb 02 '23 22:02 EntitledParent

Yes. Chances are the school computer ran out of memory.

BinBashBanana avatar Feb 02 '23 23:02 BinBashBanana

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.

EntitledParent avatar Feb 03 '23 15:02 EntitledParent

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;
}

nenge123 avatar Feb 17 '23 15:02 nenge123

How you be able to fix this in a chromebook?

RottenEggNog avatar Mar 21 '23 18:03 RottenEggNog

probably the easiest way is:

  • make your own fork
  • fix it there
  • deploy that version to your own github page

RuralAnemone avatar Mar 21 '23 18:03 RuralAnemone

i explained how to here https://github.com/BinBashBanana/webretro/issues/75#issuecomment-1412213953

foxsouns avatar Mar 21 '23 19:03 foxsouns

^

RuralAnemone avatar Mar 21 '23 19:03 RuralAnemone

i explained how to here #75 (comment)

This worked. Thanks

RottenEggNog avatar Mar 23 '23 19:03 RottenEggNog