From 77d092f4593e50102411a91b14a27c508c9dd08d Mon Sep 17 00:00:00 2001 From: malloc Date: Fri, 3 Aug 2018 09:58:08 -0500 Subject: [PATCH] purified the sons of levi --- index.html | 18 ---- js/Byte.js | 164 ----------------------------------- js/Byte.js.map | 1 - js/Byte.ts | 194 ------------------------------------------ js/LCD.js | 147 -------------------------------- js/LCD.js.map | 1 - js/LCD.ts | 136 ----------------------------- js/Memory.js | 36 -------- js/Memory.js.map | 1 - js/Memory.ts | 41 --------- js/Registers.js | 73 ---------------- js/Registers.js.map | 1 - js/Registers.ts | 61 ------------- js/TI.js | 29 ------- js/TI.js.map | 1 - js/TI.ts | 34 -------- js/ops/0x0.js | 110 ------------------------ js/ops/0x0.js.map | 1 - js/ops/0x0.ts | 109 ------------------------ js/ops/0x1.js | 34 -------- js/ops/0x1.js.map | 1 - js/ops/0x1.ts | 34 -------- js/ops/generic.js | 21 ----- js/ops/generic.js.map | 1 - js/ops/generic.ts | 21 ----- style.css | 20 ----- 26 files changed, 1290 deletions(-) delete mode 100644 index.html delete mode 100644 js/Byte.js delete mode 100644 js/Byte.js.map delete mode 100644 js/Byte.ts delete mode 100644 js/LCD.js delete mode 100644 js/LCD.js.map delete mode 100644 js/LCD.ts delete mode 100644 js/Memory.js delete mode 100644 js/Memory.js.map delete mode 100644 js/Memory.ts delete mode 100644 js/Registers.js delete mode 100644 js/Registers.js.map delete mode 100644 js/Registers.ts delete mode 100644 js/TI.js delete mode 100644 js/TI.js.map delete mode 100644 js/TI.ts delete mode 100644 js/ops/0x0.js delete mode 100644 js/ops/0x0.js.map delete mode 100644 js/ops/0x0.ts delete mode 100644 js/ops/0x1.js delete mode 100644 js/ops/0x1.js.map delete mode 100644 js/ops/0x1.ts delete mode 100644 js/ops/generic.js delete mode 100644 js/ops/generic.js.map delete mode 100644 js/ops/generic.ts delete mode 100644 style.css diff --git a/index.html b/index.html deleted file mode 100644 index e657a2e..0000000 --- a/index.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - Basilio - - - - - - - - - - -
- - \ No newline at end of file diff --git a/js/Byte.js b/js/Byte.js deleted file mode 100644 index cab47e0..0000000 --- a/js/Byte.js +++ /dev/null @@ -1,164 +0,0 @@ -var Byte = (function () { - function Byte(init) { - if (typeof init === "undefined") { init = 0; } - this.value = init & 0xFF | (init < 0 ? 0x80 : 0); - } - Byte.prototype.Add = function (val) { - val = typeof val == "number" ? new Byte(val) : val; - var hold = this.value + val.Get(); - this.value = hold & 0xFF; - return new Byte(hold > 255 ? hold - 255 : 0); - }; - - Byte.prototype.Sub = function (val) { - val = typeof val == "number" ? new Byte(val) : val; - return this.Add(val.Neg()); - }; - - Byte.prototype.Get = function () { - return this.value; - }; - - Byte.prototype.Set = function (val) { - this.value = typeof val == "number" ? val & 0xFF : val.Get(); - }; - - Byte.prototype.Neg = function (bind) { - if (typeof bind === "undefined") { bind = false; } - var tmp = new Byte(~this.value + 1); - this.value = bind ? tmp.Get() : this.value; - return tmp; - }; - - Byte.prototype.And = function (val) { - val = typeof val == "number" ? new Byte(val) : val; - this.value = this.value & val.Get(); - }; - - Byte.prototype.Or = function (val) { - val = typeof val == "number" ? new Byte(val) : val; - this.value = this.value | val.Get(); - }; - - Byte.prototype.Xor = function (val) { - val = typeof val == "number" ? new Byte(val) : val; - this.value = this.value ^ val.Get(); - }; - - Byte.prototype.Not = function () { - this.value = ~this.value; - }; - - Byte.prototype.Bit = function (pos, val) { - pos = pos % 8; - this.Set(val ? (this.value | Math.pow(2, pos)) : (this.value & ~Math.pow(2, pos))); - }; - - Byte.prototype.Test = function (pos) { - pos = pos % 8; - return (this.value & Math.pow(2, pos)) != 0; - }; - - Byte.prototype.ShiftLeft = function (carry, value) { - if (typeof carry === "undefined") { carry = false; } - if (typeof value === "undefined") { value = false; } - var ret = (this.value & 0x80) != 0; - this.Set(this.value << 1); - this.Bit(0, carry ? ret : value); - return ret; - }; - - Byte.prototype.ShiftRight = function (carry, value) { - if (typeof carry === "undefined") { carry = false; } - if (typeof value === "undefined") { value = false; } - var ret = (this.value & 0x80) != 0; - this.Set(this.value >>> 1); - this.Bit(7, carry ? ret : value); - return ret; - }; - return Byte; -})(); - -var Word = (function () { - function Word(high, low) { - this.Set(high, low); - } - Word.prototype.Get = function () { - return (this.value[0].Get() << 8) | this.value[1].Get(); - }; - - Word.prototype.High = function () { - return this.value[0]; - }; - - Word.prototype.Low = function () { - return this.value[1]; - }; - - Word.prototype.Set = function (high, low) { - this.value = typeof high == "number" ? [new Byte((high & ~0xFF) >> 8), new Byte(high & 0xFF)] : [high, low]; - }; - - Word.prototype.SetHigh = function (value) { - this.value[0] = typeof value == "number" ? new Byte(value) : value; - }; - - Word.prototype.SetLow = function (value) { - this.value[1] = typeof value == "number" ? new Byte(value) : value; - }; - - Word.prototype.Add = function (value) { - value = typeof value == "number" ? new Word(value) : value; - var hold = this.Get() + value.Get(); - this.Set(hold); - return new Word(hold > 0xFFFF ? hold - 0xFFFF : 0); - //var overflow = [this.value[0].Add(value.High()), this.value[1].Add(value.Low())]; - //return new Word(overflow[0].Get() + this.value[0].Add(overflow[1]).Get()); - }; - - Word.prototype.Sub = function (value) { - value = typeof value == "number" ? new Word(value) : value; - return this.Add(value.Neg()); - }; - - Word.prototype.AddByte = function (value, signed) { - if (typeof signed === "undefined") { signed = false; } - value = typeof value != "number" ? new Word((value.Test(7) && signed ? 0xFF00 : 0x0000) | value.Get()) : new Word(value); - return this.Add(value); - }; - - Word.prototype.SubByte = function (value) { - value = typeof value != "number" ? new Byte(value) : value; - return this.AddByte(value.Neg(), true); - }; - - Word.prototype.Not = function () { - this.value[0].Not(); - this.value[1].Not(); - }; - - Word.prototype.And = function (value) { - value = typeof value == "number" ? new Word(value) : value; - this.value[0].And(value.High()); - this.value[1].And(value.Low()); - }; - - Word.prototype.Or = function (value) { - value = typeof value == "number" ? new Word(value) : value; - this.value[0].Or(value.High()); - this.value[1].Or(value.Low()); - }; - - Word.prototype.Xor = function (value) { - value = typeof value == "number" ? new Word(value) : value; - this.value[0].Xor(value.High()); - this.value[1].Xor(value.Low()); - }; - - Word.prototype.Neg = function () { - this.Not(); - this.Add(1); - }; - return Word; -})(); -//# sourceMappingURL=Byte.js.map diff --git a/js/Byte.js.map b/js/Byte.js.map deleted file mode 100644 index 64bb37a..0000000 --- a/js/Byte.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Byte.js","sourceRoot":"","sources":["Byte.ts"],"names":["Byte","Byte.constructor","Byte.Add","Byte.Sub","Byte.Get","Byte.Set","Byte.Neg","Byte.And","Byte.Or","Byte.Xor","Byte.Not","Byte.Bit","Byte.Test","Byte.ShiftLeft","Byte.ShiftRight","Word","Word.constructor","Word.Get","Word.High","Word.Low","Word.Set","Word.SetHigh","Word.SetLow","Word.Add","Word.Sub","Word.AddByte","Word.SubByte","Word.Not","Word.And","Word.Or","Word.Xor","Word.Neg"],"mappings":"AAAA;IAGIA,cAAmBA,IAAgBA;QAAhBC,mCAAAA,IAAIA,GAAWA,CAACA;AAAAA,QAC/BA,IAAIA,CAACA,KAAKA,GAAGA,IAAIA,GAAGA,IAAIA,GAAGA,CAACA,IAAIA,GAAGA,CAACA,GAAGA,IAAIA,GAAGA,CAACA,CAACA;IACpDA,CAACA;IAIDD,qBAAAA,UAAWA,GAAQA;QACfE,GAAGA,GAAGA,OAAOA,GAAGA,IAAIA,QAAQA,GAAGA,IAAIA,IAAIA,CAACA,GAAGA,CAACA,GAAGA,GAAGA;QAClDA,IAAIA,IAAIA,GAAGA,IAAIA,CAACA,KAAKA,GAAGA,GAAGA,CAACA,GAAGA,CAACA,CAACA;QACjCA,IAAIA,CAACA,KAAKA,GAAGA,IAAIA,GAAGA,IAAIA;QACxBA,OAAOA,IAAIA,IAAIA,CAACA,IAAIA,GAAGA,GAAGA,GAAGA,IAAIA,GAAGA,GAAGA,GAAGA,CAACA,CAACA;IAChDA,CAACA;;IAIDF,qBAAAA,UAAWA,GAAQA;QACfG,GAAGA,GAAGA,OAAOA,GAAGA,IAAIA,QAAQA,GAA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,CAACA,KAAKA,CAACA,CAACA,CAACA,CAACA,EAAEA,CAACA,KAAKA,CAACA,IAAIA,CAACA,CAACA,CAACA;QAC9BA,IAAIA,CAACA,KAAKA,CAACA,CAACA,CAACA,CAACA,EAAEA,CAACA,KAAKA,CAACA,GAAGA,CAACA,CAACA,CAACA;IACjCA,CAACA;;IAIDd,qBAAAA,UAAWA,KAAUA;QACjBe,KAAKA,GAAGA,OAAOA,KAAKA,IAAIA,QAAQA,GAAGA,IAAIA,IAAIA,CAACA,KAAKA,CAACA,GAAGA,KAAKA;QAC1DA,IAAIA,CAACA,KAAKA,CAACA,CAACA,CAACA,CAACA,GAAGA,CAACA,KAAKA,CAACA,IAAIA,CAACA,CAACA,CAACA;QAC/BA,IAAIA,CAACA,KAAKA,CAACA,CAACA,CAACA,CAACA,GAAGA,CAACA,KAAKA,CAACA,GAAGA,CAACA,CAACA,CAACA;IAClCA,CAACA;;IAEDf,qBAAAA;QACIgB,IAAIA,CAACA,GAAGA,CAACA,CAACA;QACVA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA;IACfA,CAACA;IACLhB,YAACA;AAADA,CAACA,IAAA"} \ No newline at end of file diff --git a/js/Byte.ts b/js/Byte.ts deleted file mode 100644 index df081f4..0000000 --- a/js/Byte.ts +++ /dev/null @@ -1,194 +0,0 @@ -class Byte { - private value: number; - - public constructor(init: number = 0) { - this.value = init & 0xFF | (init < 0 ? 0x80 : 0); - } - - public Add(val: Byte): Byte; - public Add(val: number): Byte; - public Add(val: any): Byte { - val = typeof val == "number" ? new Byte(val) : val; - var hold = this.value + val.Get(); - this.value = hold & 0xFF; - return new Byte(hold > 255 ? hold - 255 : 0); - } - - public Sub(val: Byte): Byte; - public Sub(val: number): Byte; - public Sub(val: any): Byte { - val = typeof val == "number" ? new Byte(val) : val; - return this.Add(val.Neg()); - } - - public Get(): number { - return this.value; - } - - public Set(val: Byte); - public Set(val: number); - public Set(val: any) { - this.value = typeof val == "number" ? val & 0xFF : val.Get(); - } - - public Neg(bind: boolean = false) { - var tmp = new Byte(~this.value + 1); - this.value = bind ? tmp.Get() : this.value; - return tmp; - } - - public And(val: Byte); - public And(val: number); - public And(val: any) { - val = typeof val == "number" ? new Byte(val) : val; - this.value = this.value & val.Get(); - } - - public Or(val: Byte); - public Or(val: number); - public Or(val: any) { - val = typeof val == "number" ? new Byte(val) : val; - this.value = this.value | val.Get(); - } - - public Xor(val: Byte); - public Xor(val: number); - public Xor(val: any) { - val = typeof val == "number" ? new Byte(val) : val; - this.value = this.value ^ val.Get(); - } - - public Not() { - this.value = ~this.value; - } - - public Bit(pos: number, val: boolean) { - pos = pos % 8; - this.Set(val ? (this.value | Math.pow(2, pos)) : (this.value & ~Math.pow(2, pos))); - } - - public Test(pos: number): boolean { - pos = pos % 8; - return (this.value & Math.pow(2, pos)) != 0; - } - - public ShiftLeft(carry: boolean = false, value: boolean = false): boolean { - var ret = (this.value & 0x80) != 0; - this.Set(this.value << 1); - this.Bit(0, carry ? ret : value); - return ret; - } - - public ShiftRight(carry: boolean = false, value: boolean = false): boolean { - var ret = (this.value & 0x80) != 0; - this.Set(this.value >>> 1); - this.Bit(7, carry ? ret : value); - return ret; - } -} - -class Word { - private value: Byte[]; - - public constructor(high: number); - public constructor(high: Byte, low: Byte); - public constructor(high: any, low?: Byte) { - this.Set(high, low); - } - - public Get(): number { - return (this.value[0].Get() << 8) | this.value[1].Get(); - } - - public High(): Byte { - return this.value[0]; - } - - public Low(): Byte { - return this.value[1]; - } - - public Set(high: number); - public Set(high: Byte, low: Byte); - public Set(high: any, low?: Byte) { - this.value = typeof high == "number" ? [new Byte((high & ~0xFF) >> 8), new Byte(high & 0xFF)] : [high, low]; - } - - public SetHigh(value: number); - public SetHigh(value: Byte); - public SetHigh(value: any) { - this.value[0] = typeof value == "number" ? new Byte(value) : value; - } - - public SetLow(value: number); - public SetLow(value: Byte); - public SetLow(value: any) { - this.value[1] = typeof value == "number" ? new Byte(value) : value; - } - - public Add(value: number): Word; - public Add(value: Word): Word; - public Add(value: any): Word { - value = typeof value == "number" ? new Word(value) : value; - var hold = this.Get() + value.Get(); - this.Set(hold); - return new Word(hold > 0xFFFF ? hold - 0xFFFF : 0); - //var overflow = [this.value[0].Add(value.High()), this.value[1].Add(value.Low())]; - //return new Word(overflow[0].Get() + this.value[0].Add(overflow[1]).Get()); - } - - public Sub(value: number): Word; - public Sub(value: Word): Word; - public Sub(value: any): Word { - value = typeof value == "number" ? new Word(value) : value; - return this.Add(value.Neg()); - } - - public AddByte(value: number, signed: boolean): Word; - public AddByte(value: Byte, signed: boolean): Word; - public AddByte(value: any, signed: boolean = false): Word { - value = typeof value != "number" ? new Word((value.Test(7) && signed ? 0xFF00 : 0x0000) | value.Get()) : new Word(value); - return this.Add(value); - } - - public SubByte(value: number): Word; - public SubByte(value: Byte): Word; - public SubByte(value: any): Word { - value = typeof value != "number" ? new Byte(value) : value; - return this.AddByte(value.Neg(), true); - } - - public Not() { - this.value[0].Not(); - this.value[1].Not(); - } - - public And(value: number); - public And(value: Word); - public And(value: any) { - value = typeof value == "number" ? new Word(value) : value; - this.value[0].And(value.High()); - this.value[1].And(value.Low()); - } - - public Or(value: number); - public Or(value: Word); - public Or(value: any) { - value = typeof value == "number" ? new Word(value) : value; - this.value[0].Or(value.High()); - this.value[1].Or(value.Low()); - } - - public Xor(value: number); - public Xor(value: Word); - public Xor(value: any) { - value = typeof value == "number" ? new Word(value) : value; - this.value[0].Xor(value.High()); - this.value[1].Xor(value.Low()); - } - - public Neg() { - this.Not(); - this.Add(1); - } -} \ No newline at end of file diff --git a/js/LCD.js b/js/LCD.js deleted file mode 100644 index f0f1f90..0000000 --- a/js/LCD.js +++ /dev/null @@ -1,147 +0,0 @@ -/// -var Direction; -(function (Direction) { - Direction[Direction["UP"] = 0] = "UP"; - Direction[Direction["RIGHT"] = 1] = "RIGHT"; - Direction[Direction["DOWN"] = 2] = "DOWN"; - Direction[Direction["LEFT"] = 3] = "LEFT"; -})(Direction || (Direction = {})); - -var LCD = (function () { - function LCD() { - } - LCD.Init = function () { - LCD.screen = document.getElementById("lcd"); - for (var y = 0; y < 64; y++) { - var row = LCD.screen.insertRow(0); - for (var x = 0; x < 120; x++) { - var cell = row.insertCell(x); - cell.style.backgroundPosition = "-" + (LCD.contrast * 2) + "px 0px"; - if (x == 95) - cell.style.borderRight = "4px solid white"; - } - - LCD.vram[y] = []; - for (var x = 0; x < 15; x++) - LCD.vram[y][x] = new Byte(0); - } - }; - - LCD.GetCell = function (x, y) { - return LCD.screen.rows[y % 64].cells[x % 120]; - }; - - LCD.SetCellX = function (cell, x) { - cell.style.backgroundPosition = -x + "px " + cell.style.backgroundPosition.split(" ")[1]; - }; - - LCD.SetCellY = function (cell, y) { - cell.style.backgroundPosition = cell.style.backgroundPosition.split(" ")[0] + " " + -y + "px"; - }; - - LCD.SetPixel = function (x, y, value) { - if (typeof value === "undefined") { value = true; } - if (LCD.enabled) - LCD.SetCellY(LCD.GetCell(x, y), value ? 2 : 0); - }; - - LCD.IncrementCursor = function () { - switch (LCD.inc) { - case 0 /* UP */: - LCD.cursor[0] = (LCD.cursor[0] - 1) % 64; - break; - case 2 /* DOWN */: - LCD.cursor[0] = (LCD.cursor[0] + 1) % 64; - break; - case 1 /* RIGHT */: - LCD.cursor[1] = (LCD.cursor[1] + 1) % (LCD.cursor[1] < (LCD.mode ? 15 : 20) ? (LCD.mode ? 15 : 20) : 32); - break; - case 3 /* LEFT */: - LCD.cursor[1] = LCD.cursor[1] > 0 ? LCD.cursor[1] - 1 : (LCD.mode ? 14 : 19); - break; - } - }; - - LCD.SetContrast = function (value) { - LCD.contrast = Math.floor((value % 64) * (23 / 64)); - for (var y = 0; y < 64; y++) { - for (var x = 0; x < 120; x++) - LCD.SetCellX(LCD.GetCell(x, y), LCD.contrast * 2); - } - }; - - LCD.Disable = function () { - LCD.enabled = false; - - for (var y = 0; y < 64; y++) { - for (var x = 0; x < 120; x++) - LCD.SetCellY(LCD.GetCell(x, y), 4); - } - }; - - LCD.Enable = function () { - LCD.enabled = true; - - for (var y = 0; y < 64; y++) { - for (var x = 0; x < 15; x++) { - for (var bit = 0; bit < 8; bit++) - LCD.SetPixel(x * 8 + (bit), y, LCD.vram[y][x].Test(7 - bit)); - } - } - }; - - LCD.Read = function () { - var value = new Byte(0); - if ((LCD.mode && LCD.cursor[1] < 15) || (!LCD.mode && LCD.cursor[1] < 20)) { - if (LCD.mode) - value = LCD.vram[LCD.cursor[0]][LCD.cursor[1]]; - else { - value = new Byte(0); - for (var bit = 0; bit < 6; bit++) - value.Bit(5 - bit, LCD.vram[LCD.cursor[0]][Math.floor((6 * LCD.cursor[1] + bit) / 8)].Test(7 - ((6 * LCD.cursor[1] + bit) % 8))); - } - } - LCD.IncrementCursor(); - return value; - }; - - LCD.Write = function (value) { - if ((LCD.mode && LCD.cursor[1] < 15) || (!LCD.mode && LCD.cursor[1] < 20)) { - if (LCD.mode) { - LCD.vram[LCD.cursor[0]][LCD.cursor[1]] = value; - for (var bit = 0; bit < 8; bit++) - LCD.SetPixel(8 * LCD.cursor[1] + bit, LCD.cursor[0], value.Test(7 - bit)); - } else { - for (var bit = 0; bit < 6; bit++) { - LCD.SetPixel(6 * LCD.cursor[1] + bit, LCD.cursor[0], value.Test(5 - bit)); - LCD.vram[LCD.cursor[0]][Math.floor((6 * LCD.cursor[1] + bit) / 8)].Bit(7 - ((6 * LCD.cursor[1] + bit) % 8), value.Test(5 - bit)); - } - } - } - LCD.IncrementCursor(); - }; - - LCD.SetRow = function (row) { - LCD.cursor[0] = row % 64; - }; - - LCD.SetColumn = function (col) { - LCD.cursor[1] = col % 32; - }; - - LCD.SetMode = function (mode) { - LCD.mode = mode; - }; - - LCD.SetDirection = function (dir) { - LCD.inc = dir; - }; - LCD.contrast = 12; - LCD.vram = []; - LCD.cursor = [0, 0]; - LCD.mode = true; - LCD.inc = 2 /* DOWN */; - LCD.enabled = true; - return LCD; -})(); -//# sourceMappingURL=LCD.js.map diff --git a/js/LCD.js.map b/js/LCD.js.map deleted file mode 100644 index 1287702..0000000 --- a/js/LCD.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"LCD.js","sourceRoot":"","sources":["LCD.ts"],"names":["Direction","LCD","LCD.constructor","LCD.Init","LCD.GetCell","LCD.SetCellX","LCD.SetCellY","LCD.SetPixel","LCD.IncrementCursor","LCD.SetContrast","LCD.Disable","LCD.Enable","LCD.Read","LCD.Write","LCD.SetRow","LCD.SetColumn","LCD.SetMode","LCD.SetDirection"],"mappings":"AAAA,gCAAgC;AAEhC,IAAK,SAAS;AAA0B,CAAxC,UAAK,SAAS;IAAGA,qCAAEA;IAAEA,2CAAKA;IAAEA,yCAAIA;IAAEA,yCAAIA;kCAAE;;AAExC;IAAAC;IAmIAC,CAACA;AAAAD,IA1HGA,WAAAA;QACIE,GAAGA,CAACA,MAAMA,GAAqBA,QAAQA,CAACA,cAAcA,CAACA,KAAKA,CAACA;QAC7DA,KAAIA,IAAIA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,EAAEA,EAAEA,CAACA,EAAEA,CAAEA;YACxBA,IAAIA,GAAGA,GAAwBA,GAAGA,CAACA,MAAMA,CAACA,SAASA,CAACA,CAACA,CAACA;YAClDA,KAAIA,IAAIA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,EAAEA,CAAEA;gBAC7BA,IAAIA,IAAIA,GAAGA,GAAGA,CAACA,UAAUA,CAACA,CAACA,CAACA;gBAC5BA,IAAIA,CAACA,KAAKA,CAACA,kBAAkBA,GAAGA,GAAGA,GAAEA,CAACA,GAAGA,CAACA,QAAQA,GAAGA,CAACA,CAACA,GAAEA,QAAQA;gBACjEA,IAAGA,CAACA,IAAIA,EAAEA;oBAAEA,IAAIA,CAACA,KAAKA,CAACA,WAAWA,GAAGA,iBAAiBA,CAACA;aAC1DA;;YAEDA,GAAGA,CAACA,IAAIA,CAACA,CAACA,CAACA,GAAGA,EAAEA;YAChBA,KAAIA,IAAIA,CAACA,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AGA,CAACA,CAACA,CAACA,GAAGA,GAAGA,CAACA,MAAMA,CAACA,CAACA,CAACA,GAAGA,GAAGA,CAACA,GAAGA,CAACA,CAACA,EAAEA,KAAKA,CAACA,IAAIA,CAACA,CAACA,GAAGA,GAAGA,CAACA,CAACA;iBACnIA;aACJA;SACJA;QACDA,GAAGA,CAACA,eAAeA,CAACA,CAACA;IACzBA,CAACA;;IAEDZ,aAAAA,UAAqBA,GAAWA;QAC5Ba,GAAGA,CAACA,MAAMA,CAACA,CAACA,CAACA,GAAGA,GAAGA,GAAGA,EAAEA;IAC5BA,CAACA;;IAEDb,gBAAAA,UAAwBA,GAAWA;QAC/Bc,GAAGA,CAACA,MAAMA,CAACA,CAACA,CAACA,GAAGA,GAAGA,GAAGA,EAAEA;IAC5BA,CAACA;;IAEDd,cAAAA,UAAsBA,IAAaA;QAC/Be,GAAGA,CAACA,IAAIA,GAAGA,IAAIA;IACnBA,CAACA;;IAEDf,mBAAAA,UAA2BA,GAAcA;QACrCgB,GAAGA,CAACA,GAAGA,GAAGA,GAAGA;IACjBA,CAACA;IAhIDhB,eAAkCA,EAAEA;IACpCA,WAAgCA,EAAEA;IAClCA,aAAkCA,CAACA,CAACA,EAACA,CAACA,CAACA;IACvCA,WAA+BA,IAAIA;IACnCA,UAAgCA,YAAcA;IAC9CA,cAAkCA,IAAIA;IA4H1CA,WAACA;AAADA,CAACA,IAAA"} \ No newline at end of file diff --git a/js/LCD.ts b/js/LCD.ts deleted file mode 100644 index 3e9f8df..0000000 --- a/js/LCD.ts +++ /dev/null @@ -1,136 +0,0 @@ -/// - -enum Direction { UP, RIGHT, DOWN, LEFT } - -class LCD { - private static screen: HTMLTableElement; - private static contrast: number = 12; - private static vram: Byte[][] = []; - private static cursor: number[] = [0,0]; // row ; column - private static mode: boolean = true; // false: 6 bit ; true: 8 bit - private static inc: Direction = Direction.DOWN; - private static enabled: boolean = true; - - static Init() { - LCD.screen = document.getElementById("lcd"); - for(var y = 0; y < 64; y++) { - var row = LCD.screen.insertRow(0); - for(var x = 0; x < 120; x++) { - var cell = row.insertCell(x); - cell.style.backgroundPosition = "-"+ (LCD.contrast * 2) +"px 0px"; - if(x == 95) cell.style.borderRight = "4px solid white"; - } - - LCD.vram[y] = []; - for(var x = 0; x < 15; x++) - LCD.vram[y][x] = new Byte(0); - } - } - - private static GetCell(x: number, y: number): HTMLTableCellElement { - return (LCD.screen.rows[y % 64]).cells[x % 120]; - } - - private static SetCellX(cell: HTMLTableCellElement, x: number) { - cell.style.backgroundPosition = -x +"px "+ cell.style.backgroundPosition.split(" ")[1]; - } - - private static SetCellY(cell: HTMLTableCellElement, y: number) { - cell.style.backgroundPosition = cell.style.backgroundPosition.split(" ")[0] +" "+ -y +"px"; - } - - private static SetPixel(x: number, y: number, value: boolean = true) { - if(LCD.enabled) LCD.SetCellY(LCD.GetCell(x, y), value ? 2 : 0); - } - - private static IncrementCursor() { - switch(LCD.inc) { - case Direction.UP: - LCD.cursor[0] = (LCD.cursor[0] - 1) % 64; - break; - case Direction.DOWN: - LCD.cursor[0] = (LCD.cursor[0] + 1) % 64; - break; - case Direction.RIGHT: - LCD.cursor[1] = (LCD.cursor[1] + 1) % (LCD.cursor[1] < (LCD.mode ? 15 : 20) ? (LCD.mode ? 15 : 20) : 32); - break; - case Direction.LEFT: - LCD.cursor[1] = LCD.cursor[1] > 0 ? LCD.cursor[1] - 1 : (LCD.mode ? 14 : 19); - break; - } - } - - public static SetContrast(value: number) { - LCD.contrast = Math.floor((value % 64) * (23/64)); - for(var y = 0; y < 64; y++) { - for(var x = 0; x < 120; x++) - LCD.SetCellX(LCD.GetCell(x, y), LCD.contrast * 2); - } - } - - public static Disable() { - LCD.enabled = false; - - for(var y = 0; y < 64; y++) { - for(var x = 0; x < 120; x++) - LCD.SetCellY(LCD.GetCell(x, y), 4); - } - } - - public static Enable() { - LCD.enabled = true; - - for(var y = 0; y < 64; y++) { - for(var x = 0; x < 15; x++) { - for(var bit = 0; bit < 8; bit++) - LCD.SetPixel(x*8 + (bit), y, LCD.vram[y][x].Test(7-bit)); - } - } - } - - public static Read(): Byte { - var value = new Byte(0); - if((LCD.mode && LCD.cursor[1] < 15) || (!LCD.mode && LCD.cursor[1] < 20)) { - if (LCD.mode) value = LCD.vram[LCD.cursor[0]][LCD.cursor[1]]; - else { - value = new Byte(0); - for (var bit = 0; bit < 6; bit++) - value.Bit(5 - bit, LCD.vram[LCD.cursor[0]][Math.floor((6 * LCD.cursor[1] + bit) / 8)].Test(7 - ((6 * LCD.cursor[1] + bit) % 8))); - } - } - LCD.IncrementCursor(); - return value; - } - - public static Write(value: Byte) { - if((LCD.mode && LCD.cursor[1] < 15) || (!LCD.mode && LCD.cursor[1] < 20)) { - if (LCD.mode) { - LCD.vram[LCD.cursor[0]][LCD.cursor[1]] = value; - for (var bit = 0; bit < 8; bit++) - LCD.SetPixel(8 * LCD.cursor[1] + bit, LCD.cursor[0], value.Test(7 - bit)); - } else { - for (var bit = 0; bit < 6; bit++) { - LCD.SetPixel(6 * LCD.cursor[1] + bit, LCD.cursor[0], value.Test(5 - bit)); - LCD.vram[LCD.cursor[0]][Math.floor((6 * LCD.cursor[1] + bit) / 8)].Bit(7 - ((6 * LCD.cursor[1] + bit) % 8), value.Test(5 - bit)); - } - } - } - LCD.IncrementCursor(); - } - - public static SetRow(row: number) { - LCD.cursor[0] = row % 64; - } - - public static SetColumn(col: number) { - LCD.cursor[1] = col % 32; - } - - public static SetMode(mode: boolean) { - LCD.mode = mode; - } - - public static SetDirection(dir: Direction) { - LCD.inc = dir; - } -} \ No newline at end of file diff --git a/js/Memory.js b/js/Memory.js deleted file mode 100644 index 62774ae..0000000 --- a/js/Memory.js +++ /dev/null @@ -1,36 +0,0 @@ -/// -var Bank = (function () { - function Bank(fill) { - if (typeof fill === "undefined") { fill = 0; } - this.data = []; - } - return Bank; -})(); - -var MemoryMap = (function () { - function MemoryMap(type, index) { - this.Set(type, index); - } - MemoryMap.prototype.Set = function (type, index) { - this.type = type; - this.index = index; - }; - return MemoryMap; -})(); - -var Memory = (function () { - function Memory() { - } - Memory.Init = function () { - }; - - Memory.Get = function (location) { - return new Byte(0); - }; - - Memory.Set = function (location, value) { - }; - Memory.romLock = true; - return Memory; -})(); -//# sourceMappingURL=Memory.js.map diff --git a/js/Memory.js.map b/js/Memory.js.map deleted file mode 100644 index bcc4e2c..0000000 --- a/js/Memory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Memory.js","sourceRoot":"","sources":["Memory.ts"],"names":["Bank","Bank.constructor","MemoryMap","MemoryMap.constructor","MemoryMap.Set","Memory","Memory.constructor","Memory.Init","Memory.Get","Memory.Set"],"mappings":"AAAA,gCAAgC;AAEhC;IAGIA,cAAmBA,IAAgBA;QAAhBC,mCAAAA,IAAIA,GAAWA,CAACA;AAAAA,QAFnCA,KAAOA,IAAIA,GAAWA,EAAEA,CAACA;IAIzBA,CAACA;IACLD,YAACA;AAADA,CAACA,IAAA;;AAED;IASIE,mBAAmBA,IAAaA,EAAEA,KAAaA;QAC3CC,IAAIA,CAACA,GAAGA,CAACA,IAAIA,EAAEA,KAAKA,CAACA;IACzBA,CAACA;IAPDD,0BAAAA,UAAWA,IAAaA,EAAEA,KAAaA;QACnCE,IAAIA,CAACA,IAAIA,GAAGA,IAAIA;QAChBA,IAAIA,CAACA,KAAKA,GAAGA,KAAKA;IACtBA,CAACA;IAKLF,iBAACA;AAADA,CAACA,IAAA;;AAED;IAAAG;IAgBAC,CAACA;AAAAD,IAXGA,cAAAA;IAEAE,CAACA;;IAEDF,aAAAA,UAAWA,QAAcA;QACrBG,OAAOA,IAAIA,IAAIA,CAACA,CAACA,CAACA;IACtBA,CAACA;;IAEDH,aAAAA,UAAWA,QAAcA,EAAEA,KAAWA;IAEtCI,CAACA;IAZDJ,iBAA0BA,IAAIA;IAalCA,cAACA;AAADA,CAACA,IAAA"} \ No newline at end of file diff --git a/js/Memory.ts b/js/Memory.ts deleted file mode 100644 index 89d9ba0..0000000 --- a/js/Memory.ts +++ /dev/null @@ -1,41 +0,0 @@ -/// - -class Bank { - public data: Byte[] = []; - - public constructor(fill: number = 0) { - - } -} - -class MemoryMap { - public type: boolean; // false - ROM ; true - RAM - public index: number; // page index - - public Set(type: boolean, index: number) { - this.type = type; - this.index = index; - } - - public constructor(type: boolean, index: number) { - this.Set(type, index); - } -} - -class Memory { - static rom: Bank[]; - static ram: Bank[]; - static romLock: boolean = true; - - static Init() { - - } - - static Get(location: Word): Byte { - return new Byte(0); - } - - static Set(location: Word, value: Byte) { - - } -} \ No newline at end of file diff --git a/js/Registers.js b/js/Registers.js deleted file mode 100644 index 99d7ddf..0000000 --- a/js/Registers.js +++ /dev/null @@ -1,73 +0,0 @@ -/// -var Flags; -(function (Flags) { - Flags[Flags["CARRY"] = 0] = "CARRY"; - Flags[Flags["ADDSUB"] = 1] = "ADDSUB"; - Flags[Flags["PARITY"] = 2] = "PARITY"; - Flags[Flags["UNUSED1"] = 3] = "UNUSED1"; - Flags[Flags["HALF"] = 4] = "HALF"; - Flags[Flags["UNUSED2"] = 5] = "UNUSED2"; - Flags[Flags["ZERO"] = 6] = "ZERO"; - Flags[Flags["SIGN"] = 7] = "SIGN"; -})(Flags || (Flags = {})); - -var Registers = (function () { - function Registers() { - } - Registers.Init = function () { - Registers.byteRegisters["IXH"] = new Byte(0); - Registers.byteRegisters["IXL"] = new Byte(0); - Registers.byteRegisters["IYH"] = new Byte(0); - Registers.byteRegisters["IYL"] = new Byte(0); - - var tmp = "ABCDEFHLIR"; - for (var i; i < tmp.length; i++) - Registers.byteRegisters[tmp[i]] = new Byte(0); - - Registers.shadowRegisters["AF"] = new Word(0); - Registers.shadowRegisters["BC"] = new Word(0); - Registers.shadowRegisters["DE"] = new Word(0); - Registers.shadowRegisters["HL"] = new Word(0); - }; - - Registers.GenerateWord = function (high, low) { - return new Word(Registers.byteRegisters[high], Registers.byteRegisters[low]); - }; - - Registers.SetFlag = function (flag, value) { - if (flag != 3 /* UNUSED1 */ && flag != 5 /* UNUSED2 */) - Registers.byteRegisters["F"].Bit(flag, value); - }; - - Registers.GetFlag = function (flag) { - return Registers.byteRegisters["F"].Test(flag); - }; - - Registers.ExchangeAFShadow = function () { - var tmp = Registers.shadowRegisters["AF"]; - Registers.shadowRegisters["AF"].Set(Registers.byteRegisters["A"], Registers.byteRegisters["F"]); - Registers.byteRegisters["A"] = tmp.High(); - Registers.byteRegisters["F"] = tmp.Low(); - }; - - Registers.ExchangeShadow = function () { - var regs = ["BC", "DE", "HL"]; - for (var reg in regs) { - var tmp = Registers.shadowRegisters[regs[reg]]; - Registers.shadowRegisters[regs[reg]].Set(Registers.byteRegisters[regs[reg][0]], Registers.byteRegisters[regs[reg][1]]); - Registers.byteRegisters[regs[reg][0]] = tmp.High(); - Registers.byteRegisters[regs[reg][1]] = tmp.Low(); - } - }; - - Registers.SetRegisterPair = function (pair, value) { - Registers.byteRegisters[pair[0]] = value.High(); - Registers.byteRegisters[pair[1]] = value.Low(); - }; - Registers.byteRegisters = []; - Registers.shadowRegisters = []; - Registers.programCounter = new Word(0); - Registers.stackPointer = new Word(0); - return Registers; -})(); -//# sourceMappingURL=Registers.js.map diff --git a/js/Registers.js.map b/js/Registers.js.map deleted file mode 100644 index d93b4f5..0000000 --- a/js/Registers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Registers.js","sourceRoot":"","sources":["Registers.ts"],"names":["Flags","Registers","Registers.constructor","Registers.Init","Registers.GenerateWord","Registers.SetFlag","Registers.GetFlag","Registers.ExchangeAFShadow","Registers.ExchangeShadow","Registers.SetRegisterPair"],"mappings":"AAAA,gCAAgC;AAEhC,IAAK,KAAK;AAA8D,CAAxE,UAAK,KAAK;IAAGA,mCAAKA;IAAEA,qCAAMA;IAAEA,qCAAMA;IAAEA,uCAAOA;IAAEA,iCAAIA;IAAEA,uCAAOA;IAAEA,iCAAIA;IAAEA,iCAAIA;0BAAE;;AAExE;IAAAC;IAwDAC,CAACA;AAAAD,IAlDGA,iBAAAA;QACIE,SA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ACA,GAAGA,GAAGA,CAACA,IAAIA,CAACA,CAACA;YAClDA,SAASA,CAACA,aAAaA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,GAAGA,CAACA,GAAGA,CAACA,CAACA;SACpDA;IACLA,CAACA;;IAEDP,4BAAAA,UAA8BA,IAAYA,EAAEA,KAAWA;QACnDQ,SAASA,CAACA,aAAaA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA,GAAGA,KAAKA,CAACA,IAAIA,CAACA,CAACA;QAC/CA,SAASA,CAACA,aAAaA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA,GAAGA,KAAKA,CAACA,GAAGA,CAACA,CAACA;IAClDA,CAACA;IAtDDR,0BAAsCA,EAAEA;IACxCA,4BAAwCA,EAAEA;IAC1CA,2BAAqCA,IAAIA,IAAIA,CAACA,CAACA,CAACA;IAChDA,yBAAmCA,IAAIA,IAAIA,CAACA,CAACA,CAACA;IAoDlDA,iBAACA;AAADA,CAACA,IAAA"} \ No newline at end of file diff --git a/js/Registers.ts b/js/Registers.ts deleted file mode 100644 index 08e01ab..0000000 --- a/js/Registers.ts +++ /dev/null @@ -1,61 +0,0 @@ -/// - -enum Flags { CARRY, ADDSUB, PARITY, UNUSED1, HALF, UNUSED2, ZERO, SIGN } - -class Registers { - public static byteRegisters: Byte[] = []; - public static shadowRegisters: Word[] = []; - public static programCounter: Word = new Word(0); - public static stackPointer: Word = new Word(0); - - public static Init() { - Registers.byteRegisters["IXH"] = new Byte(0); - Registers.byteRegisters["IXL"] = new Byte(0); - Registers.byteRegisters["IYH"] = new Byte(0); - Registers.byteRegisters["IYL"] = new Byte(0); - - var tmp = "ABCDEFHLIR"; - for(var i; i < tmp.length; i++) - Registers.byteRegisters[tmp[i]] = new Byte(0); - - Registers.shadowRegisters["AF"] = new Word(0); - Registers.shadowRegisters["BC"] = new Word(0); - Registers.shadowRegisters["DE"] = new Word(0); - Registers.shadowRegisters["HL"] = new Word(0); - } - - public static GenerateWord(high: string, low: string): Word { - return new Word(Registers.byteRegisters[high], Registers.byteRegisters[low]); - } - - public static SetFlag(flag: Flags, value: boolean) { - if(flag != Flags.UNUSED1 && flag != Flags.UNUSED2) - Registers.byteRegisters["F"].Bit(flag, value); - } - - public static GetFlag(flag: Flags): boolean { - return Registers.byteRegisters["F"].Test(flag); - } - - public static ExchangeAFShadow() { - var tmp = Registers.shadowRegisters["AF"]; - Registers.shadowRegisters["AF"].Set(Registers.byteRegisters["A"], Registers.byteRegisters["F"]); - Registers.byteRegisters["A"] = tmp.High(); - Registers.byteRegisters["F"] = tmp.Low(); - } - - public static ExchangeShadow() { - var regs = ["BC", "DE", "HL"]; - for(var reg in regs) { - var tmp = Registers.shadowRegisters[regs[reg]]; - Registers.shadowRegisters[regs[reg]].Set(Registers.byteRegisters[regs[reg][0]], Registers.byteRegisters[regs[reg][1]]); - Registers.byteRegisters[regs[reg][0]] = tmp.High(); - Registers.byteRegisters[regs[reg][1]] = tmp.Low(); - } - } - - public static SetRegisterPair(pair: string, value: Word) { - Registers.byteRegisters[pair[0]] = value.High(); - Registers.byteRegisters[pair[1]] = value.Low(); - } -} \ No newline at end of file diff --git a/js/TI.js b/js/TI.js deleted file mode 100644 index 47723f0..0000000 --- a/js/TI.js +++ /dev/null @@ -1,29 +0,0 @@ -/// -/// -/// -/// -/// - -var TI = (function () { - function TI() { - } - TI.PerformOperation = function (data) { - this.Opcodes[data[0].Get()](data); - }; - - TI.Init = function () { - Registers.Init(); - LCD.Init(); - Memory.Init(); - var a = new Byte(0xF0); - var b = new Byte(10); - - //a.Sub(b); - //alert(a.Get()); - a.ShiftLeft(true); - //alert(a.Get()); - }; - TI.Opcodes = []; - return TI; -})(); -//# sourceMappingURL=TI.js.map diff --git a/js/TI.js.map b/js/TI.js.map deleted file mode 100644 index 09c9081..0000000 --- a/js/TI.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TI.js","sourceRoot":"","sources":["TI.ts"],"names":["TI","TI.constructor","TI.PerformOperation","TI.Init"],"mappings":"AAAA,gCAAgC;AAChC,+BAA+B;AAC/B,kCAAkC;AAClC,qCAAqC;AACrC,mCAAmC;;AAUnC;IAAAA;IAkBAC,CAACA;AAAAD,IAfGA,sBAAAA,UAAwBA,IAAYA;QAChCE,IAAIA,CAACA,OAAOA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,IAAIA,CAACA;IACrCA,CAACA;;IAEDF,UAAAA;QACIG,SAASA,CAACA,IAAIA,CAACA,CAACA;QAChBA,GAAGA,CAACA,IAAIA,CAACA,CAACA;QACVA,MAAMA,CAACA,IAAIA,CAACA,CAACA;QACbA,IAAIA,CAACA,GAAGA,IAAIA,IAAIA,CAACA,IAAIA,CAACA;QACtBA,IAAIA,CAACA,GAAGA,IAAIA,IAAIA,CAACA,EAAEA,CAACA;;QACpBA,WAAWA;QACXA,iBAAiBA;QACjBA,CAACA,CAACA,SAASA,CAACA,IAAIA,CAACA;QACjBA,iBAAiBA;IACrBA,CAACA;IAhBDH,aAAkCA,EAAEA;IAiBxCA,UAACA;AAADA,CAACA,IAAA"} \ No newline at end of file diff --git a/js/TI.ts b/js/TI.ts deleted file mode 100644 index e4cf2d2..0000000 --- a/js/TI.ts +++ /dev/null @@ -1,34 +0,0 @@ -/// -/// -/// -/// -/// - -interface opcode { - (args: Byte[]): number[]; - // opcodes receive an array of four bytes from memory starting at the point of the program counter - // opcodes return an array, - // first value is the program counter increment (size of instruction) - // second value is the number of T-States taken by the instruction -} - -class TI { - public static Opcodes: opcode[] = []; - - static PerformOperation(data: Byte[]) { - this.Opcodes[data[0].Get()](data); - } - - static Init() { - Registers.Init(); - LCD.Init(); - Memory.Init(); - var a = new Byte(0xF0); - var b = new Byte(10); - //a.Sub(b); - //alert(a.Get()); - a.ShiftLeft(true); - //alert(a.Get()); - } -} - diff --git a/js/ops/0x0.js b/js/ops/0x0.js deleted file mode 100644 index 32247e6..0000000 --- a/js/ops/0x0.js +++ /dev/null @@ -1,110 +0,0 @@ -/// -/// -/// -/// -/// -TI.Opcodes[0x00] = function (args) { - return [1, 4]; -}; - -TI.Opcodes[0x01] = function (args) { - Registers.SetRegisterPair("BC", new Word(args[2], args[1])); - return [3, 10]; -}; - -TI.Opcodes[0x02] = function (args) { - Memory.Set(Registers.GenerateWord("B", "C"), Registers.byteRegisters["A"]); - return [1, 7]; -}; - -TI.Opcodes[0x03] = function (args) { - var tmp = Registers.GenerateWord("B", "C"); - tmp.Add(1); - Registers.SetRegisterPair("BC", tmp); - return [1, 6]; -}; - -TI.Opcodes[0x04] = function (args) { - var tmp = Registers.byteRegisters["B"]; - var over = Registers.byteRegisters["B"].Add(1); - Registers.SetFlag(1 /* ADDSUB */, false); - Registers.SetFlag(6 /* ZERO */, over.Get() != 0); - Registers.SetFlag(2 /* PARITY */, tmp.Test(7) == false && Registers.byteRegisters["B"].Test(7) == true); - Registers.SetFlag(4 /* HALF */, (tmp.Get() & 0x0F) == 0x0F); - Registers.SetFlag(7 /* SIGN */, Registers.byteRegisters["B"].Test(7)); - return [1, 4]; -}; - -TI.Opcodes[0x05] = function (args) { - // dec b - return [1, 4]; -}; - -TI.Opcodes[0x06] = function (args) { - Registers.byteRegisters["B"] = args[1]; - return [1, 7]; -}; - -TI.Opcodes[0x07] = function (args) { - Registers.SetFlag(0 /* CARRY */, Registers.byteRegisters["A"].ShiftLeft(true)); - Registers.SetFlag(1 /* ADDSUB */, false); - Registers.SetFlag(4 /* HALF */, false); - return [1, 4]; -}; - -TI.Opcodes[0x08] = function (args) { - Registers.ExchangeAFShadow(); - return [1, 4]; -}; - -TI.Opcodes[0x09] = function (args) { - var tmp = [Registers.GenerateWord("H", "L"), Registers.GenerateWord("B", "C")]; - var overflow = tmp[0].Add(tmp[1]); - Registers.SetRegisterPair("HL", tmp[0]); - Registers.SetFlag(1 /* ADDSUB */, false); - Registers.SetFlag(0 /* CARRY */, overflow.Get() != 0); - - // todo check if flags are set correctly - return [1, 11]; -}; - -TI.Opcodes[0x0A] = function (args) { - Registers.byteRegisters["A"] = Memory.Get(Registers.GenerateWord("B", "C")); - return [1, 7]; -}; - -TI.Opcodes[0x0B] = function (args) { - var tmp = Registers.GenerateWord("B", "C"); - tmp.Sub(1); - Registers.SetRegisterPair("BC", tmp); - return [1, 6]; -}; - -TI.Opcodes[0x0C] = function (args) { - var tmp = Registers.byteRegisters["C"]; - var over = Registers.byteRegisters["C"].Add(1); - Registers.SetFlag(1 /* ADDSUB */, false); - Registers.SetFlag(6 /* ZERO */, over.Get() != 0); - Registers.SetFlag(2 /* PARITY */, tmp.Test(7) == false && Registers.byteRegisters["C"].Test(7) == true); - Registers.SetFlag(4 /* HALF */, (tmp.Get() & 0x0F) == 0x0F); - Registers.SetFlag(7 /* SIGN */, Registers.byteRegisters["C"].Test(7)); - return [1, 4]; -}; - -TI.Opcodes[0x0D] = function (args) { - // dec c - return [1, 4]; -}; - -TI.Opcodes[0x0E] = function (args) { - Registers.byteRegisters["A"] = args[1]; - return [2, 7]; -}; - -TI.Opcodes[0x0F] = function (args) { - Registers.SetFlag(0 /* CARRY */, Registers.byteRegisters["A"].ShiftRight(true)); - Registers.SetFlag(1 /* ADDSUB */, false); - Registers.SetFlag(4 /* HALF */, false); - return [1, 4]; -}; -//# sourceMappingURL=0x0.js.map diff --git a/js/ops/0x0.js.map b/js/ops/0x0.js.map deleted file mode 100644 index d839bf7..0000000 --- a/js/ops/0x0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"0x0.js","sourceRoot":"","sources":["0x0.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,kCAAkC;AAClC,qCAAqC;AACrC,wCAAwC;AACxC,iCAAiC;AAEjC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,UAAS,IAAY;IACpC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;AACjB,CAAC;;AAED,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,U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line at end of file diff --git a/js/ops/0x0.ts b/js/ops/0x0.ts deleted file mode 100644 index 162bbfd..0000000 --- a/js/ops/0x0.ts +++ /dev/null @@ -1,109 +0,0 @@ -/// -/// -/// -/// -/// - -TI.Opcodes[0x00] = function(args: Byte[]): number[] { - return [1, 4]; -}; - -TI.Opcodes[0x01] = function(args: Byte[]): number[] { - Registers.SetRegisterPair("BC", new Word(args[2], args[1])); - return [3, 10]; -}; - -TI.Opcodes[0x02] = function(args: Byte[]): number[] { - Memory.Set(Registers.GenerateWord("B","C"), Registers.byteRegisters["A"]); - return [1, 7]; -}; - -TI.Opcodes[0x03] = function(args: Byte[]): number[] { - var tmp = Registers.GenerateWord("B", "C"); - tmp.Add(1); - Registers.SetRegisterPair("BC", tmp); - return [1, 6]; -}; - -TI.Opcodes[0x04] = function(args: Byte[]): number[] { - var tmp = Registers.byteRegisters["B"]; - var over = Registers.byteRegisters["B"].Add(1); - Registers.SetFlag(Flags.ADDSUB, false); - Registers.SetFlag(Flags.ZERO, over.Get() != 0); - Registers.SetFlag(Flags.PARITY, tmp.Test(7) == false && Registers.byteRegisters["B"].Test(7) == true); - Registers.SetFlag(Flags.HALF, (tmp.Get() & 0x0F) == 0x0F); - Registers.SetFlag(Flags.SIGN, Registers.byteRegisters["B"].Test(7)); - return [1, 4]; -}; - -TI.Opcodes[0x05] = function(args: Byte[]): number[] { - // dec b - return [1, 4]; -}; - -TI.Opcodes[0x06] = function(args: Byte[]): number[] { - Registers.byteRegisters["B"] = args[1]; - return [1, 7]; -}; - -TI.Opcodes[0x07] = function(args: Byte[]): number[] { - Registers.SetFlag(Flags.CARRY, Registers.byteRegisters["A"].ShiftLeft(true)); - Registers.SetFlag(Flags.ADDSUB, false); - Registers.SetFlag(Flags.HALF, false); - return [1, 4]; -}; - -TI.Opcodes[0x08] = function(args: Byte[]): number[] { - Registers.ExchangeAFShadow(); - return [1,4]; -}; - -TI.Opcodes[0x09] = function(args: Byte[]): number[] { - var tmp = [Registers.GenerateWord("H", "L"), Registers.GenerateWord("B","C")]; - var overflow = tmp[0].Add(tmp[1]); - Registers.SetRegisterPair("HL", tmp[0]); - Registers.SetFlag(Flags.ADDSUB, false); - Registers.SetFlag(Flags.CARRY, overflow.Get() != 0); - // todo check if flags are set correctly - return [1, 11]; -}; - -TI.Opcodes[0x0A] = function(args: Byte[]): number[] { - Registers.byteRegisters["A"] = Memory.Get(Registers.GenerateWord("B","C")); - return [1, 7]; -}; - -TI.Opcodes[0x0B] = function(args: Byte[]): number[] { - var tmp = Registers.GenerateWord("B", "C"); - tmp.Sub(1); - Registers.SetRegisterPair("BC", tmp); - return [1, 6]; -}; - -TI.Opcodes[0x0C] = function(args: Byte[]): number[] { - var tmp = Registers.byteRegisters["C"]; - var over = Registers.byteRegisters["C"].Add(1); - Registers.SetFlag(Flags.ADDSUB, false); - Registers.SetFlag(Flags.ZERO, over.Get() != 0); - Registers.SetFlag(Flags.PARITY, tmp.Test(7) == false && Registers.byteRegisters["C"].Test(7) == true); - Registers.SetFlag(Flags.HALF, (tmp.Get() & 0x0F) == 0x0F); - Registers.SetFlag(Flags.SIGN, Registers.byteRegisters["C"].Test(7)); - return [1, 4]; -}; - -TI.Opcodes[0x0D] = function(args: Byte[]): number[] { - // dec c - return [1, 4]; -}; - -TI.Opcodes[0x0E] = function(args: Byte[]): number[] { - Registers.byteRegisters["A"] = args[1]; - return [2, 7]; -}; - -TI.Opcodes[0x0F] = function(args: Byte[]): number[] { - Registers.SetFlag(Flags.CARRY, Registers.byteRegisters["A"].ShiftRight(true)); - Registers.SetFlag(Flags.ADDSUB, false); - Registers.SetFlag(Flags.HALF, false); - return [1, 4]; -}; \ No newline at end of file diff --git a/js/ops/0x1.js b/js/ops/0x1.js deleted file mode 100644 index 7840f15..0000000 --- a/js/ops/0x1.js +++ /dev/null @@ -1,34 +0,0 @@ -/// -/// -/// -/// -/// -TI.Opcodes[0x10] = function (args) { - Registers.byteRegisters["B"].Sub(1); - if (Registers.byteRegisters["B"].Get() != 0) { - Registers.programCounter.AddByte(args[1], true); - return [0, 13]; - } else - return [2, 8]; -}; - -TI.Opcodes[0x11] = function (args) { - Registers.SetRegisterPair("DE", new Word(args[2], args[1])); - return [3, 10]; -}; - -TI.Opcodes[0x12] = function (args) { - Memory.Set(Registers.GenerateWord("D", "E"), Registers.byteRegisters["A"]); - return [1, 7]; -}; - -TI.Opcodes[0x13] = function (args) { - var tmp = Registers.GenerateWord("D", "E"); - tmp.Add(1); - Registers.SetRegisterPair("DE", tmp); - return [1, 6]; -}; - -TI.Opcodes[0x13] = function (args) { -}; -//# sourceMappingURL=0x1.js.map diff --git a/js/ops/0x1.js.map b/js/ops/0x1.js.map deleted file mode 100644 index 91c8f25..0000000 --- a/js/ops/0x1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"0x1.js","sourceRoot":"","sources":["0x1.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,kCAAkC;AAClC,qCAAqC;AACrC,wCAAwC;AACxC,iCAAiC;AAEjC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,UAAS,IAAY;IACpC,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,IAAG,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAE;QACxC,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;QAC/C,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC;KACjB;QAAM,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACzB,CAAC;;AAED,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,UAAS,IAAY;IACpC,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC;AAClB,CAAC;;AAED,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,UAAS,IAAY;IACpC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC1E,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;AACjB,CAAC;;AAED,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,UAAS,IAAY;IACpC,IAAI,GAAG,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,EAAC,GAAG,CAAC;IACzC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACV,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC;IACpC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;AACjB,CAAC;;AAED,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,UAAS,IAAY;AAExC,CAAC"} \ No newline at end of file diff --git a/js/ops/0x1.ts b/js/ops/0x1.ts deleted file mode 100644 index 9cfb2f9..0000000 --- a/js/ops/0x1.ts +++ /dev/null @@ -1,34 +0,0 @@ -/// -/// -/// -/// -/// - -TI.Opcodes[0x10] = function(args: Byte[]): number[] { - Registers.byteRegisters["B"].Sub(1); - if(Registers.byteRegisters["B"].Get() != 0) { - Registers.programCounter.AddByte(args[1], true); - return [0, 13]; - } else return [2, 8]; -}; - -TI.Opcodes[0x11] = function(args: Byte[]): number[] { - Registers.SetRegisterPair("DE", new Word(args[2], args[1])); - return [3, 10]; -}; - -TI.Opcodes[0x12] = function(args: Byte[]): number[] { - Memory.Set(Registers.GenerateWord("D", "E"), Registers.byteRegisters["A"]); - return [1, 7]; -}; - -TI.Opcodes[0x13] = function(args: Byte[]): number[] { - var tmp = Registers.GenerateWord("D","E"); - tmp.Add(1); - Registers.SetRegisterPair("DE", tmp); - return [1, 6]; -}; - -TI.Opcodes[0x13] = function(args: Byte[]): number[] { - -}; \ No newline at end of file diff --git a/js/ops/generic.js b/js/ops/generic.js deleted file mode 100644 index 10ea2ad..0000000 --- a/js/ops/generic.js +++ /dev/null @@ -1,21 +0,0 @@ -/// -/// -/// -/// -/// -function IncrementRegister(reg) { - if (reg.length == 1) { - var tmp = Registers.byteRegisters[reg]; - var over = Registers.byteRegisters[reg].Add(1); - Registers.SetFlag(1 /* ADDSUB */, false); - Registers.SetFlag(6 /* ZERO */, over.Get() != 0); - Registers.SetFlag(2 /* PARITY */, tmp.Test(7) == false && Registers.byteRegisters[reg].Test(7) == true); - Registers.SetFlag(4 /* HALF */, (tmp.Get() & 0x0F) == 0x0F); - Registers.SetFlag(7 /* SIGN */, Registers.byteRegisters[reg].Test(7)); - } else { - var tmp = Registers.GenerateWord(reg[0], reg[1]); - tmp.Add(1); - Registers.SetRegisterPair(reg, tmp); - } -} -//# sourceMappingURL=generic.js.map diff --git a/js/ops/generic.js.map b/js/ops/generic.js.map deleted file mode 100644 index 61628b2..0000000 --- a/js/ops/generic.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"generic.js","sourceRoot":"","sources":["generic.ts"],"names":["IncrementRegister"],"mappings":"AAAA,mCAAmC;AACnC,kCAAkC;AAClC,qCAAqC;AACrC,wCAAwC;AACxC,iCAAiC;AAEjC,SAAS,iBAAiB,CAAC,GAAW;IAClCA,IAAGA,GAAGA,CAACA,MAAMA,IAAIA,CAACA,CAAEA;QAChBA,IAAIA,GAAGA,GAAGA,SAASA,CAACA,aAAaA,CAACA,GAAGA,CAACA;QACtCA,IAAIA,IAAIA,GAAGA,SAASA,CAACA,aAAaA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;QAC9CA,SAASA,CAACA,OAAOA,CAACA,cAAYA,EAAEA,KAAKA,CAACA;QACtCA,SAASA,CAACA,OAAOA,CAACA,YAAUA,EAAEA,IAAIA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA;QAC9CA,SAASA,CAACA,OAAOA,CAACA,cAAYA,EAAEA,GAAGA,CAACA,IAAIA,CAACA,CAACA,CAACA,IAAIA,KAAKA,IAAIA,SAASA,CAACA,aAAaA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA,IAAIA,IAAIA,CAACA;QACrGA,SAASA,CAACA,OAAOA,CAACA,YAAUA,EAAEA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,IAAIA,CAACA;QACzDA,SAASA,CAACA,OAAOA,CAACA,YAAUA,EAAEA,SAASA,CAACA,aAAaA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;KACtEA,KAAMA;QACHA,IAAIA,GAAGA,GAAGA,SAASA,CAACA,YAAYA,CAACA,GAAGA,CAACA,CAACA,CAACA,EAACA,GAAGA,CAACA,CAACA,CAACA,CAACA;QAC/CA,GAAGA,CAACA,GAAGA,CAACA,CAACA,CAACA;QACVA,SAASA,CAACA,eAAeA,CAACA,GAAGA,EAAEA,GAAGA,CAACA;KACtCA;AACLA,CAACA"} \ No newline at end of file diff --git a/js/ops/generic.ts b/js/ops/generic.ts deleted file mode 100644 index e5c1e91..0000000 --- a/js/ops/generic.ts +++ /dev/null @@ -1,21 +0,0 @@ -/// -/// -/// -/// -/// - -function IncrementRegister(reg: string) { - if(reg.length == 1) { - var tmp = Registers.byteRegisters[reg]; - var over = Registers.byteRegisters[reg].Add(1); - Registers.SetFlag(Flags.ADDSUB, false); - Registers.SetFlag(Flags.ZERO, over.Get() != 0); - Registers.SetFlag(Flags.PARITY, tmp.Test(7) == false && Registers.byteRegisters[reg].Test(7) == true); - Registers.SetFlag(Flags.HALF, (tmp.Get() & 0x0F) == 0x0F); - Registers.SetFlag(Flags.SIGN, Registers.byteRegisters[reg].Test(7)); - } else { - var tmp = Registers.GenerateWord(reg[0],reg[1]); - tmp.Add(1); - Registers.SetRegisterPair(reg, tmp); - } -} \ No newline at end of file diff --git a/style.css b/style.css deleted file mode 100644 index 568b253..0000000 --- a/style.css +++ /dev/null @@ -1,20 +0,0 @@ -#lcd { - border-spacing: 0; - border-collapse: collapse; -} - -#lcd tr { - height: 2px; - padding: 0; - margin: 0; - border: 0; -} - -#lcd td { - width: 2px; - height: 2px; - padding: 0; - margin: 0; - border: 0; - background: url(img/pixel.png); -} \ No newline at end of file