wow
This commit is contained in:
MallocNull 2015-01-22 15:32:46 -06:00
parent 662ac171ca
commit 5a9b22aedc
7 changed files with 96 additions and 1 deletions

View file

@ -3,8 +3,10 @@
<head lang="en"> <head lang="en">
<meta charset="UTF-8"> <meta charset="UTF-8">
<title></title> <title></title>
<script type="text/javascript" src="js/Byte.js"></script>
<script type="text/javascript" src="js/TI.js"></script>
</head> </head>
<body> <body onload="TI.Init();">
</body> </body>
</html> </html>

32
js/Byte.js Normal file
View file

@ -0,0 +1,32 @@
var Byte = (function () {
function Byte(init) {
if (typeof init === "undefined") { init = 0; }
this.value = init & 0xFF;
}
Byte.prototype.Add = function (val) {
var ret = new Byte(((this.value + val.Get()) & ~0xFF) >> 8);
this.value = (this.value + val.Get()) & 0xFF;
alert(this.value + val.Get());
return ret;
};
Byte.prototype.Sub = function (val) {
return this.Add(new Byte(-val.Get()));
};
Byte.prototype.Get = function () {
return this.value;
};
Byte.prototype.Set = function (val) {
this.value = val & 0xFF;
};
return Byte;
})();
var Word = (function () {
function Word() {
}
return Word;
})();
//# sourceMappingURL=Byte.js.map

1
js/Byte.js.map Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"Byte.js","sourceRoot":"","sources":["Byte.ts"],"names":["Byte","Byte.constructor","Byte.Add","Byte.Sub","Byte.Get","Byte.Set","Word","Word.constructor"],"mappings":"AAAA;IAGIA,cAAmBA,IAAgBA;QAAhBC,mCAAAA,IAAIA,GAAWA,CAACA;AAAAA,QAC/BA,IAAIA,CAACA,KAAKA,GAAGA,IAAIA,GAAGA,IAAIA;IAC5BA,CAACA;IAEDD,qBAAAA,UAAWA,GAASA;QAChBE,IAAIA,GAAGA,GAAGA,IAAIA,IAAIA,CAACA,CAACA,CAACA,IAAIA,CAACA,KAAKA,GAAGA,GAAGA,CAACA,GAAGA,CAACA,CAACA,CAACA,GAAGA,CAACA,IAAIA,CAACA,IAAIA,CAACA,CAACA;QAC3DA,IAAIA,CAACA,KAAKA,GAAGA,CAACA,IAAIA,CAACA,KAAKA,GAAGA,GAAGA,CAACA,GAAGA,CAACA,CAACA,CAACA,GAAGA,IAAIA;QAC5CA,KAAKA,CAACA,IAAIA,CAACA,KAAKA,GAAGA,GAAGA,CAACA,GAAGA,CAACA,CAACA,CAACA;QAC7BA,OAAOA,GAAGA;IACdA,CAACA;;IAEDF,qBAAAA,UAAWA,GAASA;QAChBG,OAAOA,IAAIA,CAACA,GAAGA,CAACA,IAAIA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA;IACzCA,CAACA;;IAEDH,qBAAAA;QACII,OAAOA,IAAIA,CAACA,KAAKA;IACrBA,CAACA;;IAEDJ,qBAAAA,UAAWA,GAAWA;QAClBK,IAAIA,CAACA,KAAKA,GAAGA,GAAGA,GAAGA,IAAIA;IAC3BA,CAACA;IACLL,YAACA;AAADA,CAACA,IAAA;;AAED;IAAAM;IAIAC,CAACA;AAAAD,IAADA,YAACA;AAADA,CAACA,IAAA"}

32
js/Byte.ts Normal file
View file

@ -0,0 +1,32 @@
class Byte {
private value: number;
public constructor(init: number = 0) {
this.value = init & 0xFF;
}
public Add(val: Byte): Byte {
var ret = new Byte(((this.value + val.Get()) & ~0xFF) >> 8);
this.value = (this.value + val.Get()) & 0xFF;
alert(this.value + val.Get());
return ret;
}
public Sub(val: Byte): Byte {
return this.Add(new Byte(-val.Get()));
}
public Get(): number {
return this.value;
}
public Set(val: number) {
this.value = val & 0xFF;
}
}
class Word {
private value: Byte[];
}

12
js/TI.js Normal file
View file

@ -0,0 +1,12 @@
/// <reference path="Byte.ts" />
var TI = (function () {
function TI() {
}
TI.Init = function () {
var a = new Byte(40);
var b = new Byte(40);
alert(a.Get());
};
return TI;
})();
//# sourceMappingURL=TI.js.map

1
js/TI.js.map Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"TI.js","sourceRoot":"","sources":["TI.ts"],"names":["TI","TI.constructor","TI.Init"],"mappings":"AAAA,gCAAgC;AAEhC;IAAAA;IAYAC,CAACA;AAAAD,IALGA,UAAAA;QACIE,IAAIA,CAACA,GAAGA,IAAIA,IAAIA,CAACA,EAAEA,CAACA;QACpBA,IAAIA,CAACA,GAAGA,IAAIA,IAAIA,CAACA,EAAEA,CAACA;QACpBA,KAAKA,CAACA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;IAClBA,CAACA;IACLF,UAACA;AAADA,CAACA,IAAA"}

15
js/TI.ts Normal file
View file

@ -0,0 +1,15 @@
/// <reference path="Byte.ts" />
class TI {
static rom: Byte[][];
static ram: Byte[][];
static mmap: any[];
static registers: any[];
static Init() {
var a = new Byte(40);
var b = new Byte(40);
alert(a.Get());
}
}