35 lines
1.3 KiB
HTML
35 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<title>Super Mario Bros. (World)</title>
|
|
<script src="webxdc.js"></script>
|
|
<script src="jsnes.min.js"></script>
|
|
<script src="nes-embed.js"></script>
|
|
</head>
|
|
<body style="margin: 0;">
|
|
<!--
|
|
<input id="input" type="text"/>
|
|
<a href="" onclick="sendMsg(); return false;">Send</a>
|
|
<p id="output"></p>
|
|
<script>
|
|
function sendMsg() {
|
|
msg = document.getElementById("input").value;
|
|
window.webxdc.sendUpdate({payload: {name: window.webxdc.selfName, msg: msg}}, 'someone typed "'+msg+'"');
|
|
}
|
|
|
|
function receiveUpdate(update) {
|
|
document.getElementById('output').innerHTML += "<strong><" + update.payload.name + "></strong> " + update.payload.msg + "<br>";
|
|
}
|
|
|
|
window.webxdc.setUpdateListener(receiveUpdate, 0);
|
|
</script>
|
|
-->
|
|
<canvas id="nes-canvas" width="256" height="240" style="width: 100vw; height: 100vh; margin: 0; object-fit: contain;"/>
|
|
<p>DPad: Arrow keys<br/>Start: Return, Select: Tab<br/>A Button: A, B Button: S</p>
|
|
<script>
|
|
nes_load_url("nes-canvas", "Super Mario Bros. (World).nes");
|
|
</script>
|
|
</body>
|
|
</html>
|