提交 156bdf37 编写于 作者: P Pengan Zhou

Add some games

上级 b443d748
......@@ -10,30 +10,6 @@
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' />
<script type="application/javascript">
var recover = [
{ "from": "subor/suborv6.html", "to": "http://www.dnbwg.com/emularity.html?machine=subor486" },
{ "from": "mame/ceci.html", "to": "http://www.dnbwg.com/emularity.html?machine=ceci" },
{ "from": "mame/cecidisk.html", "to": "http://www.dnbwg.com/emularity.html?machine=cecidisk" },
{ "from": "mame/maciici.html", "to": "http://www.dnbwg.com/emularity.html?machine=maciici" },
{ "from": "mame/maciicichs.html", "to": "http://www.dnbwg.com/emularity.html?machine=maciicichs" },
{ "from": "pce-mac/index.html", "to": "http://www.dnbwg.com/emularity.html?machine=macplus" },
{ "from": "pce-mac-chs/index.html", "to": "http://www.dnbwg.com/emularity.html?machine=macpluschs" },
{ "from": "emdosbox/pal.html", "to": "http://www.dnbwg.com/emularity.html?machine=xianjianpal" },
{ "from": "emdosbox/jinyong.html", "to": "http://www.dnbwg.com/emularity.html?machine=jinyong" },
{ "from": "emdosbox/doom.html", "to": "http://www.dnbwg.com/emularity.html?machine=doom" },
{ "from": "emdosbox/dosbox.html", "to": "http://www.dnbwg.com/emularity.html?machine=ucdos" },
{ "from": "emdosbox/executor.html", "to": "http://www.dnbwg.com/emularity.html?machine=executor" },
{ "from": "atarist-emutos/index.html", "to": "http://www.dnbwg.com/emularity.html?machine=emutos" },
{ "from": "atarist-pce-mono/index.html", "to": "http://www.dnbwg.com/emularity.html?machine=ataristmono" },
{ "from": "atarist-pcejs/index.html", "to": "http://www.dnbwg.com/emularity.html?machine=atarist" },
{ "from": "v86/win95.html", "to": "http://www.dnbwg.com/player.html?machine=netscape" },
{ "from": "apple2js.html", "to": "http://www.dnbwg.com/player.html?machine=apple2" },
{ "from": "apple2jse.html", "to": "http://www.dnbwg.com/player.html?machine=apple2e" },
{ "from": "jswqx", "to": "http://www.dnbwg.com/player.html?machine=ggvnc1020" },
{ "from": "jsspeccy", "to": "http://www.dnbwg.com/player.html?machine=zxspectrum" },
{ "from": "elkjs", "to": "http://www.dnbwg.com/player.html?machine=acornelectron" },
{ "from": "pcjs/example4.html", "to": "http://localhost:8080/player.html?machine=pc5150cga" },
{ "from": "pcjs/example3a.html", "to": "http://localhost:8080/player.html?machine=pc5150mda" },
{ "from": "jsbeeb", "to": "http://www.dnbwg.com/player.html?machine=bbcmicro" },
];
var newUrl = null;
for (var i = 0; i < recover.length; i++) {
......@@ -75,7 +51,7 @@
<div id="mainContent">
<p class="text-center"><img src="https://dnbwg.oss-cn-hongkong.aliyuncs.com/404.jpg" /></p>
<p class="text-center">错误404 - 找不到文件或目录,一定是神偷卡门偷走了它!</p>
<p class="text-center"><a id="recover-link" href="http://www.dnbwg.com">网页里的电脑博物馆</a> 找找看</p>
<p class="text-center"><a id="recover-link" href="http://www.famicn.com">网页里的电脑博物馆</a> 找找看</p>
</div>
</body>
......
......@@ -45,7 +45,14 @@
<button id="toggleKeyboard" onclick="toggleMobileKeyboard()">显示键盘</button>
<button id="toggleKeyboard" onclick="resizeCanvas()">调整屏幕</button>
</div>
<div id="introduction" class="markdown-body"></div>
<div id="introduction" class="markdown-body">
操作指南:
方向键<br>
1 - Start<br>
5 - Select<br>
A - Alt<br>
B - Ctrl
</div>
<script>
</script>
</body>
......
......@@ -10,15 +10,15 @@ function getUrlVars() {
function runMAME(cart) {
var emulator = new Emulator(document.querySelector("#emularity-canvas"),
postRun,
new JSMESSLoader(JSMESSLoader.driver("iq501"),
new JSMESSLoader(JSMESSLoader.driver("nespal"),
JSMESSLoader.nativeResolution(640, 480),
JSMESSLoader.emulatorJS("mamenes.js"),
JSMESSLoader.emulatorWASM("mamenes.wasm"),
JSMESSLoader.mountFile(cart,
JSMESSLoader.emulatorJS("http://dnbwg.cdn.bcebos.com/emularity-common/emulators/jsmess/mamenes_wasm.js"),
JSMESSLoader.emulatorWASM("http://dnbwg.cdn.bcebos.com/emularity-common/emulators/jsmess/mamenes_wasm.wasm"),
JSMESSLoader.mountFile("game.nes",
JSMESSLoader.fetchFile("Game File",
cart)),
JSMESSLoader.peripheral("cart", cart)))
JSMESSLoader.peripheral("cart", "game.nes")))
emulator.setScale(3).start({ waitAfterDownloading: true });
}
......@@ -45,9 +45,9 @@ function resizeCanvas() {
$(document).ready(function () {
console.log("ready!");
var cart = getUrlVars()["cart"];
var gameBaseUrl = "http://dnbwg3.cdn.bcebos.com/NES-China/"
var game = getUrlVars()["game"];
var cart = gameBaseUrl + game + ".nes"
runMAME(cart);
});
\ No newline at end of file
此差异已折叠。
......@@ -8,7 +8,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-css-only@4.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="base.css" />
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<script src="baidu-stat.js"></script>
<script src="index.js"></script>
<meta charset="UTF-8">
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' />
......@@ -44,7 +44,7 @@
</div>
</div>
<div style="display: none;">
<img src="title.png">
<img src="cart.gif">
</div>
</body>
......
function processJson(data) {
console.log(data);
var machineList = data.machines;
var machineList = data;
machineList = splitArrayByTime(machineList);
var base = $("#base-cell");
var machineListContainer = $("#machine-list");
for (i = 0; i < machineList.length; i++) {
var machine = machineList[i];
var clone = base.clone();
var title = machine.name + " - " + machine.year;
var playerlink = "player.html?machine=" + machine.id;
if (machine.emularity){
playerlink = "emularity.html?machine=" + machine.id;
}
var title = machine.name + " - " + machine.vendor;
var playerlink = "famiclone.html?game=" + encodeURI(machine.filename);
clone.show();
clone.attr("id", machine.id);
clone.find("a").attr("href", playerlink);
clone.find("figcaption").text(title)
if (!machine.image) {
machine.image = "cart.gif"
}
clone.find(".figure-img").attr("src", machine.image)
machineListContainer.append(clone);
}
}
function splitArrayByTime(someArray) {
var date = new Date();
var timestamp = date.getTime();
var timetoken = Math.round(timestamp / (600 * 1000));
var position = timetoken % someArray.length;
console.log(position);
var first = someArray.slice(0, position);
var second = someArray.slice(position + 1);
return second.concat(first);
}
$(document).ready(function () {
console.log("ready!");
$.getJSON("machines.json", processJson);
$.getJSON("games.json", processJson);
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册