nesbox / emulator

Emulator of NES, Super Nintendo, Sega Mega Drive, GameBoy video consoles
http://nesbox.com/emulator/
MIT License
590 stars 247 forks source link

[SOLVED]Stuck in loading emulator screen / Nesbox doesn't work on local html! #100

Closed Strike-9344 closed 4 years ago

Strike-9344 commented 4 years ago

Problem: Stuck in the "loading emulator 100% screen"

I'm one week away from finishing my programming course in my school, and my final project was a gaming site that the visitors could run old games on-line. So, right now, I only have one week to make this work, however, nesbox isn't working and the situation is pretty desperate because I don't understand why things aren't working at all.

First, I'm not sure if in the presentation day, students will have internet, so the site is local. Right now, I'm trying to place nesbox in the site, which is the most important part of the project.

However, even though I'm only changing in the code nesbox.swf location path and the flashvars variable, it still doesn't work.

Before I'm implement nesbox on the project's site, I'm testing it on a isolated html first to make sure it works. Here it is:

`<!doctype html>

NESBOX

To play this game, please, download the latest Flash player!


Get Adobe Flash player

`

When I downloaded emulator-master.zip, I just extracted the zip and put the html file inside, so Nesbox.swf is in the bin folder and the game is in the roms folder(That I created, btw).

Even though all the paths are correct, it's still not working. The only reason I could think is that nesbox doesn't work with local file-paths, but I'm not sure because the emulator does run, however, it still stuck in the "loading emulator 100%" screen.

image

Here's the code in txt in case you may need. All you need to do is save in html to run. nesbox test.txt

nesbox commented 4 years ago

Do you see any errors in the browser console?

Strike-9344 commented 4 years ago

Do you see any errors in the browser console?

Only a "file not found" about a Adobe Flash Player image that appears when someone doesn't allow Flash or doesn't have Flash installed in their computer. But I'm using chrome, so flash comes with the browser so it's probably not related to the problem.

image

Strike-9344 commented 4 years ago

Do you see any errors in the browser console?

Only a "file not found" about a Adobe Flash Player image that appears when someone doesn't allow Flash or doesn't have Flash installed in their computer. But I'm using chrome, so flash comes with the browser so it's probably not related to the problem.

image

Here's the address of the image that's been not found: file://www.adobe.com/images/shared/download_buttons/get_adobe_flash_player.png

image

Strike-9344 commented 4 years ago

And now the only error in the browser console is gone because almost every src in the original code has "//" in the start of the source-path, so chrome doesn't recognize it as a web-address(It recognizes as a "file://" address), so I have to put "http:" for the image to work(Same thing happened with the script src links - Which is why, at the first run, the emulator wasn't even visible).

image

Strike-9344 commented 4 years ago

I just found out what the problem exactly was. Nesbox doesn't run in local html pages.

I installed XAMPP and ran the nesboxteste.html with the localhost address and it worked. image

I tried other javascript emulators and had the same problem and now all of them are working. So, every javascript/flash emulator doesn't work in html local pages.

I suggest @nesbox to put an warning in the readme file about that(Like: warning: only work in servers/doesn't work in local files), because I really wasn't expecting this kind of problem.