1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-18 03:05:35 +00:00
8bitworkshop/gen/chunk-JC7DT6V7.js.map

8 lines
69 KiB
Plaintext
Raw Normal View History

{
"version": 3,
"sources": ["../src/common/util.ts", "../src/common/vlist.ts", "../src/common/emu.ts"],
"sourcesContent": ["\nexport function lpad(s:string, n:number):string {\n s += ''; // convert to string\n while (s.length<n) s=\" \"+s;\n return s;\n}\n\nexport function rpad(s:string, n:number):string {\n s += ''; // convert to string\n while (s.length<n) s+=\" \";\n return s;\n}\n\nexport function byte2signed(b:number):number {\n b &= 0xff;\n return (b < 0x80) ? b : -(256-b);\n}\n\nexport function getFilenameForPath(s:string):string {\n var toks = s.split('/');\n return toks[toks.length-1];\n}\n\nexport function getFolderForPath(s:string):string {\n return s.substring(0, s.lastIndexOf('/'));\n}\n\nexport function getFilenamePrefix(s:string):string {\n var pos = s.lastIndexOf('.');\n return (pos > 0) ? s.substr(0, pos) : s;\n}\n\nexport function hex(v:number, nd?:number) {\n if (!nd) nd = 2;\n if (nd == 8) {\n return hex((v>>16)&0xffff,4) + hex(v&0xffff,4);\n } else {\n return toradix(v,nd,16);\n }\n}\n\nexport function tobin(v:number, nd?:number) {\n if (!nd) nd = 8;\n return toradix(v,nd,2);\n}\n\nexport function toradix(v:number, nd:number, radix:number) {\n try {\n var s = v.toString(radix).toUpperCase();\n while (s.length < nd)\n s = \"0\" + s;\n return s;\n } catch (e) {\n return v+\"\";\n }\n}\n\nexport function arrayCompare(a:ArrayLike<any>, b:ArrayLike<any>):boolean {\n if (a == null && b == null) return true;\n if (a == null) return false;\n if (b == null) return false;\n if (a.length != b.length) return false;\n for (var i=0; i<a.length; i++)\n if (a[i] != b[i])\n return false;\n return true;\n}\n\nexport function invertMap(m:{}):{} {\n var r = {};\n if (m) {\n for (var k in m) r[m[k]] = k;\n }\n return r;\n}\n\nexport function highlightDifferences(s1:string, s2:string):string {\n var split1 = s1.split(/(\\S+\\s+)/).filter(function(n) {return n});\n var split2 = s2.split(/(\\S+\\s+)/).filter(function(n) {return n});\n var i = 0;\n var j = 0;\n var result = \"\";\n while (i < split1.length && j < split2.length) {\n var w1 = split1[i];\n var w2 = split2[j];\n if (w2 && w2.indexOf(\"\\n\") >= 0) {\n while (i < s1.length && split1[i].indexOf(\"\\n\") < 0)\n i++;\n }\n if (w1 != w2) {\n w2 = '<span class=\"hilite\">' + w2 + '</span>';\n }\n result += w2;\n i++;\n j++;\n }\n while (j < split2.length) {\n result += split2[j++];\n }\n return result;\n}\n\nexport function lzgmini() {\n\n // Constants\n var LZG_HEADER_SIZE = 16;\n var LZG_METHOD_COPY = 0;\n var LZG_METHOD_LZG1 = 1;\n\n // LUT for decoding the copy length parameter\n var LZG_LENGTH_DECODE_LUT = [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,\n 20,21,22,23,24,25,26,27,28,29,35,48,72,128];\n\n // Decoded data (produced by the decode() method)\n var outdata = null;\n\n // Calculate the checksum\n var calcChecksum = function(data) {\n var a = 1;\n var b = 0;\n var i = LZG_HEADER_SIZE;\n while (i < data.length)\n {\n a = (a + (data[i] & 0xff)) & 0xffff;\n b = (b + a) & 0xffff;\n i++;\n }\n return (b << 16) | a;\n }\n\n // Decode LZG coded data. The function returns the size of the decoded data.\n // Use any of the get* methods to retrieve the decoded data.\n this.decode = function(data:number[]):number[] {\n // Start by clearing the decompressed array in this object\n outdata = null;\n\n // Check magic ID\n if ((data.length < LZG_HEADER_SIZE) || (data[0] != 76) ||\n (data[1] != 90) || (data[2] != 71))\n {\n return null;\n }\n \n // what's the length?\n var uncomplen = data[6] | (data[5]<<8) | (data[4]<<16) | (data[3]<<24);\n\n // Calculate & check the checksum\n var checksum = ((data[11] & 0xff) << 24) |\n ((data[12] & 0xff) << 16) |\n ((data[13] & 0xff) << 8) |\n (data[14] & 0xff);\n if (calcChecksum(data) != checksum)\n {\n return null;\n }\n\n var dst = new Array();\n // Check which method to use\n var method = data[15] & 0xff;\n
"mappings": "AACO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