4 ms·
If you were to convert the nes asm into javascript how much faster would it run?
by icefox 16y ago
If you were to convert the nes asm into javascript how much faster would it run?
- earcar 16y agoIt depends on how aggressively you optimize. In the worst case scenario (the compiler just copies the code that the interpreter would run) you end up with the same performance as the interpreter.
- icefox 16y agoFound a paper http://www.jordansmind.com/files/Laughy-DBT.pdf http://www.jordansmind.com/files/Laughy-DBT.pdf last night titled "Implementation of a Dynamic Binary Translator for the Nintendo Entertainment System (NES) console" Converting had a ten time speedup. Given that the js engines we have today determining the best way to convert the nes asm to js seems like it would be a very interesting project.
- daeken 16y agoInsanely, insanely fast. I created a fork of http://6502asm.com/ http://6502asm.com/ that dynarec'd 6502 machine code to Javascript and cached the functions; the speedup was on the order of 25-100x, depending on the code in question. I used to have it hosted, but it's since disappeared; let me go throw it on github. Edit: It's up at http://github.com/daeken/Dyna6502Asm http://github.com/daeken/Dyna6502Asm now. If someone could actually host it so that people can test it out, I'd greatly appreciate it. I'm writing up a small document on how it works, for those who are curious; it'll be in the repo in a few minutes. Oh, and I believe that this was the first dynarec'd emulator for Javascript; this was back in December 2008. Edit #2: Strategy document is up, here: http://github.com/daeken/Dyna6502Asm/blob/master/strategy.md http://github.com/daeken/Dyna6502Asm/blob/master/strategy.md. The same exact mechanisms should work just fine with this emulator, if someone is so inclined. One thing you ought to do, though, that I never got around to, is adding a simple checksum to the code cache. When you attempt to execute a block, check to make sure that the code in memory is the same as the one in the code cache; if it's different, then the code has been modified and needs to be recompiled. Edit #3: Thanks to icefox, I now know how to host on github! http://daeken.github.com/Dyna6502Asm/ http://daeken.github.com/Dyna6502Asm/
- icefox 16y agoon github simply name your branch gh-pages and then it will be 'hosted' on http://daeken.github.com/Dyna6502Asm/ http://daeken.github.com/Dyna6502Asm/
- bfirsh 16y agoThat's AWESOME. I think I remember seeing this last time JSNES had some exposure. I'm going write support for this right now...
- daeken 16y agoLet me know how it goes. If you run into anything, shoot me an email or hit me up on IRC: Daeken on freenode.