Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
56 lines (54 sloc) 1.19 KB
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>AppleToo.js</title>
<script src="otrail.js"></script>
<script src="appletoo.js"></script>
<script src="disk2.js"></script>
<style type="text/css" media="screen">
canvas {
border: 1px solid #DDD;
margin: 0 auto;
display: block;
}
body {
background-color: #536EE4; /*#222;*/
}
</style>
<script type="text/javascript" charset="utf-8">
window.onload = function(){
var appleScreen = document.getElementById("screen");
a = new AppleToo({compatibility: false});
appleScreen.width = a.char_w * 40;
appleScreen.height = a.char_h * 24;
document.onkeypress = function(e) {
console.log(e);
a._write_memory(0xC000, e.charCode + 128);
};
document.onkeydown = function(e) {
var value = 0;
switch (e.keyCode) {
case 37:
value = 8;
break;
case 38:
value = 11;
break;
case 39:
value = 21;
break;
case 40:
value = 10;
break;
}
if (e.keyCode > 36 && e.keyCode < 41){
a._write_memory(0xC000, value + 128);
}
};
};
</script>
</head>
<body>
<canvas id="screen"></canvas>
</body>
</html>