Skip to content

Commit be9c0d6

Browse files
committed
Added support for building distribution packages with Jake
1 parent 3afbd7a commit be9c0d6

15 files changed

+84
-12
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
roms/
1+
/build/
2+
/roms/
23
jsnes.tmproj
34
._*
45
.DS_Store

Jakefile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
jake_helper :version do
2+
return (`git rev-list HEAD | head -1 | cut -c-20`).strip
3+
end

README.markdown

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
JSNES
2+
=====
3+
4+
A JavaScript NES emulator.
5+
6+
Build
7+
-----
8+
9+
To build a distribution, you will need jake:
10+
11+
$ sudo gem install jake
12+
13+
Then run:
14+
15+
$ jake
16+
17+
This will create ``jsnes-min.js`` and ``jsnes-src.js`` in ``build/``.
18+
19+
Benchmark
20+
---------
21+
22+
The benchmark in ``test/benchmark.js`` is intended for testing JavaScript
23+
engines. It does not depend on a DOM or Canvas element etc.

index.html

+9-9
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111

1212
<script src="lib/jquery-1.4.2.min.js" type="text/javascript" charset="utf-8"></script>
1313
<script src="lib/dynamicaudio-min.js" type="text/javascript" charset="utf-8"></script>
14-
<script src="js/nes.js" type="text/javascript" charset="utf-8"></script>
15-
<script src="js/utils.js" type="text/javascript" charset="utf-8"></script>
16-
<script src="js/cpu.js" type="text/javascript" charset="utf-8"></script>
17-
<script src="js/keyboard.js" type="text/javascript" charset="utf-8"></script>
18-
<script src="js/mappers.js" type="text/javascript" charset="utf-8"></script>
19-
<script src="js/papu.js" type="text/javascript" charset="utf-8"></script>
20-
<script src="js/ppu.js" type="text/javascript" charset="utf-8"></script>
21-
<script src="js/rom.js" type="text/javascript" charset="utf-8"></script>
22-
<script src="js/ui.js" type="text/javascript" charset="utf-8"></script>
14+
<script src="source/nes.js" type="text/javascript" charset="utf-8"></script>
15+
<script src="source/utils.js" type="text/javascript" charset="utf-8"></script>
16+
<script src="source/cpu.js" type="text/javascript" charset="utf-8"></script>
17+
<script src="source/keyboard.js" type="text/javascript" charset="utf-8"></script>
18+
<script src="source/mappers.js" type="text/javascript" charset="utf-8"></script>
19+
<script src="source/papu.js" type="text/javascript" charset="utf-8"></script>
20+
<script src="source/ppu.js" type="text/javascript" charset="utf-8"></script>
21+
<script src="source/rom.js" type="text/javascript" charset="utf-8"></script>
22+
<script src="source/ui.js" type="text/javascript" charset="utf-8"></script>
2323
<script type="text/javascript" charset="utf-8">
2424
var nes;
2525
$(function() {

jake.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
source_directory: source
3+
build_directory: build
4+
5+
layout: together
6+
7+
builds:
8+
src:
9+
packer: false
10+
min:
11+
shrink_vars: true
12+
private: true
13+
14+
packages:
15+
jsnes:
16+
header: header.js
17+
files:
18+
- nes
19+
- utils
20+
- cpu
21+
- keyboard
22+
- mappers
23+
- papu
24+
- ppu
25+
- rom
26+
- ui
27+

js/cpu.js source/cpu.js

File renamed without changes.

source/header.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
JSNES, based on Jamie Sanders' vNES
3+
Copyright (C) 2010 Ben Firshman
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/

js/keyboard.js source/keyboard.js

File renamed without changes.

js/mappers.js source/mappers.js

File renamed without changes.

js/nes.js source/nes.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ var JSNES = function(opts) {
5151

5252
this.ui.updateStatus("Ready to load a ROM.");
5353
};
54-
55-
54+
55+
JSNES.VERSION = "<%= version %>";
56+
5657
JSNES.prototype = {
5758
isRunning: false,
5859
fpsFrameCount: 0,

js/papu.js source/papu.js

File renamed without changes.

js/ppu.js source/ppu.js

File renamed without changes.

js/rom.js source/rom.js

File renamed without changes.

js/ui.js source/ui.js

File renamed without changes.

js/utils.js source/utils.js

File renamed without changes.

0 commit comments

Comments
 (0)