summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--Jakefile3
-rw-r--r--README.markdown23
-rw-r--r--index.html18
-rw-r--r--jake.yml27
-rw-r--r--source/cpu.js (renamed from js/cpu.js)0
-rw-r--r--source/header.js17
-rw-r--r--source/keyboard.js (renamed from js/keyboard.js)0
-rw-r--r--source/mappers.js (renamed from js/mappers.js)0
-rw-r--r--source/nes.js (renamed from js/nes.js)5
-rw-r--r--source/papu.js (renamed from js/papu.js)0
-rw-r--r--source/ppu.js (renamed from js/ppu.js)0
-rw-r--r--source/rom.js (renamed from js/rom.js)0
-rw-r--r--source/ui.js (renamed from js/ui.js)0
-rw-r--r--source/utils.js (renamed from js/utils.js)0
15 files changed, 84 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore
index 3e099f8..46a9548 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
-roms/
+/build/
+/roms/
jsnes.tmproj
._*
.DS_Store
diff --git a/Jakefile b/Jakefile
new file mode 100644
index 0000000..89cec30
--- /dev/null
+++ b/Jakefile
@@ -0,0 +1,3 @@
+jake_helper :version do
+ return (`git rev-list HEAD | head -1 | cut -c-20`).strip
+end
diff --git a/README.markdown b/README.markdown
new file mode 100644
index 0000000..2e09b56
--- /dev/null
+++ b/README.markdown
@@ -0,0 +1,23 @@
+JSNES
+=====
+
+A JavaScript NES emulator.
+
+Build
+-----
+
+To build a distribution, you will need jake:
+
+ $ sudo gem install jake
+
+Then run:
+
+ $ jake
+
+This will create ``jsnes-min.js`` and ``jsnes-src.js`` in ``build/``.
+
+Benchmark
+---------
+
+The benchmark in ``test/benchmark.js`` is intended for testing JavaScript
+engines. It does not depend on a DOM or Canvas element etc.
diff --git a/index.html b/index.html
index fce637b..f1163b4 100644
--- a/index.html
+++ b/index.html
@@ -11,15 +11,15 @@ charset="utf-8">
<script src="lib/jquery-1.4.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="lib/dynamicaudio-min.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/nes.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/utils.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/cpu.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/keyboard.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/mappers.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/papu.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/ppu.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/rom.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/ui.js" type="text/javascript" charset="utf-8"></script>
+ <script src="source/nes.js" type="text/javascript" charset="utf-8"></script>
+ <script src="source/utils.js" type="text/javascript" charset="utf-8"></script>
+ <script src="source/cpu.js" type="text/javascript" charset="utf-8"></script>
+ <script src="source/keyboard.js" type="text/javascript" charset="utf-8"></script>
+ <script src="source/mappers.js" type="text/javascript" charset="utf-8"></script>
+ <script src="source/papu.js" type="text/javascript" charset="utf-8"></script>
+ <script src="source/ppu.js" type="text/javascript" charset="utf-8"></script>
+ <script src="source/rom.js" type="text/javascript" charset="utf-8"></script>
+ <script src="source/ui.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
var nes;
$(function() {
diff --git a/jake.yml b/jake.yml
new file mode 100644
index 0000000..b8a3593
--- /dev/null
+++ b/jake.yml
@@ -0,0 +1,27 @@
+---
+source_directory: source
+build_directory: build
+
+layout: together
+
+builds:
+ src:
+ packer: false
+ min:
+ shrink_vars: true
+ private: true
+
+packages:
+ jsnes:
+ header: header.js
+ files:
+ - nes
+ - utils
+ - cpu
+ - keyboard
+ - mappers
+ - papu
+ - ppu
+ - rom
+ - ui
+
diff --git a/js/cpu.js b/source/cpu.js
index e59a0c2..e59a0c2 100644
--- a/js/cpu.js
+++ b/source/cpu.js
diff --git a/source/header.js b/source/header.js
new file mode 100644
index 0000000..9cf092d
--- /dev/null
+++ b/source/header.js
@@ -0,0 +1,17 @@
+/*
+JSNES, based on Jamie Sanders' vNES
+Copyright (C) 2010 Ben Firshman
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
diff --git a/js/keyboard.js b/source/keyboard.js
index 6342b2b..6342b2b 100644
--- a/js/keyboard.js
+++ b/source/keyboard.js
diff --git a/js/mappers.js b/source/mappers.js
index 58d979a..58d979a 100644
--- a/js/mappers.js
+++ b/source/mappers.js
diff --git a/js/nes.js b/source/nes.js
index 0d07662..95332d5 100644
--- a/js/nes.js
+++ b/source/nes.js
@@ -51,8 +51,9 @@ var JSNES = function(opts) {
this.ui.updateStatus("Ready to load a ROM.");
};
-
-
+
+JSNES.VERSION = "<%= version %>";
+
JSNES.prototype = {
isRunning: false,
fpsFrameCount: 0,
diff --git a/js/papu.js b/source/papu.js
index 50d7225..50d7225 100644
--- a/js/papu.js
+++ b/source/papu.js
diff --git a/js/ppu.js b/source/ppu.js
index 64cfa8b..64cfa8b 100644
--- a/js/ppu.js
+++ b/source/ppu.js
diff --git a/js/rom.js b/source/rom.js
index 928873f..928873f 100644
--- a/js/rom.js
+++ b/source/rom.js
diff --git a/js/ui.js b/source/ui.js
index cbb7e69..cbb7e69 100644
--- a/js/ui.js
+++ b/source/ui.js
diff --git a/js/utils.js b/source/utils.js
index 5afc5e3..5afc5e3 100644
--- a/js/utils.js
+++ b/source/utils.js