bfirsh / jsnes

A JavaScript NES emulator.
https://jsnes.org
Apache License 2.0
6.11k stars 827 forks source link

Infinite loop when undefined opcode is read #24

Open isharacomix opened 11 years ago

isharacomix commented 11 years ago

When an undefined opcode is read, the .stop() method is called, which sets the running flag to false, but the FRAMELOOP in nes.js keeps running even when nes.running is false. I fixed this by changing the for loop to for (; this.running ;) and that seemed to work.

I tested this by running a blank ROM, which is just 0s for all of the PRG and CHR ROM. It locks up the browser and is very unpleasant.

bfirsh commented 6 years ago

In addition, the stop() method doesn’t even exist any longer. All the same problem.