项目
在 GitHub 查看
takahirox/nes-js
关于
JavaScript NES(Famicom) emulator
游戏与模拟器可以做什么
- iNES format rom image support
- Renders with Canvas
- Audio support with WebAudio
- Runs on browser
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文nes-js
This is JavaScript NES(Famicom) emulator which runs on browser.
Demo
Demo with Three.js (It has a performance issue!)
WebVR Demo with Three.js (It has a serious performance issue!)
AR Demo with Three.js and jsartoolkit5 (It has a performance issue!)
Screenshot


Features
- iNES format rom image support
- Renders with Canvas
- Audio support with WebAudio
- Runs on browser
Browser
How to use
<head>
<script type="text/javascript" src="https://cdn.rawgit.com/takahirox/nes-js/v0.0.1/build/nes.min.js"></script>
<script type="text/javascript" >
function init() {
var url = 'url to rom image';
var request = new XMLHttpRequest();
request.responseType = 'arraybuffer';
request.onload = function() {
var buffer = request.response;
var nes = new NesJs.Nes();
nes.setRom(new NesJs.Rom(buffer));
nes.setDisplay(new NesJs.Display(document.getElementById('gameCanvas')));
nes.setAudio(new NesJs.Audio());
window.onkeydown = function(e) { nes.handleKeyDown(e); };
window.onkeyup = function(e) { nes.handleKeyUp(e); };
nes.bootup();
nes.run();
};
request.open('GET', url, true);
request.send(null);
}
</script>
</head>
<body onload="init()">
<p>
<canvas id="gameCanvas" width="256" height="240"></canvas>
</p>
</body>
NPM
How to install
$ npm install nes-js
How to build
$ npm install
$ npm run all
Default key configuration
This table shows the key - joypad configuration set by
window.onkeydown = function(e) { nes.handleKeyDown(e); };
window.onkeyup = function(e) { nes.handleKeyUp(e); };
| key | joypad |
|---|---|
| enter | start |
| space | select |
| cursor-left | left |
| cursor-up | up |
| cursor-right | right |
| cursor-down | down |
| x | A |
| z | B |
APIs
T.B.D.
- NesJs
- Nes
- setRom()
- setDisplay()
- setAudio()
- bootup()
- run()
- handleKeyDown()
- handleKeyUp()
- Rom
- Display
- Audio
- Nes
TODO
- Performance optimization
- Support more many mappers
- Support unofficial CPU instructions
- Gamepad API support
Links
- Nes Dev
- VR/AR
探索相关项目
加载中…