diff options
author | neauoire <[email protected]> | 2020-01-30 12:15:16 -0500 |
---|---|---|
committer | neauoire <[email protected]> | 2020-01-30 12:15:16 -0500 |
commit | 9630077eff807b0ba3713e82e62e1e7562e0a272 (patch) | |
tree | 3e8541868b21cae479f49c29c49548469b5f9350 | |
parent | 4b75983f775a148000ba6b56306ad51e093dec87 (diff) | |
download | Orca-9630077eff807b0ba3713e82e62e1e7562e0a272.tar.gz Orca-9630077eff807b0ba3713e82e62e1e7562e0a272.zip |
Removed nonblocking bang ports
-rw-r--r-- | desktop/package-lock.json | 70 | ||||
-rw-r--r-- | desktop/package.json | 2 | ||||
-rw-r--r-- | desktop/sources/scripts/client.js | 6 | ||||
-rw-r--r-- | desktop/sources/scripts/core/library.js | 36 | ||||
-rw-r--r-- | desktop/sources/scripts/core/operator.js | 16 | ||||
-rw-r--r-- | examples/benchmarks/families.orca | 24 |
6 files changed, 70 insertions, 84 deletions
diff --git a/desktop/package-lock.json b/desktop/package-lock.json index c347221..37c0b63 100644 --- a/desktop/package-lock.json +++ b/desktop/package-lock.json @@ -36,9 +36,9 @@ } }, "@types/node": { - "version": "12.12.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.25.tgz", - "integrity": "sha512-nf1LMGZvgFX186geVZR1xMZKKblJiRfiASTHw85zED2kI1yDKHDwTKMdkaCbTlXoRKlGKaDfYywt+V0As30q3w==", + "version": "12.12.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.26.tgz", + "integrity": "sha512-UmUm94/QZvU5xLcUlNR8hA7Ac+fGpO1EG/a8bcWVz0P0LqtxFmun9Y2bbtuckwGboWJIT70DoWq1r3hb56n3DA==", "dev": true }, "asar": { @@ -71,7 +71,7 @@ "base64-js": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", + "integrity": "sha1-WOzoy3XdB+ce0IxzarxfrE2/jfE=", "dev": true }, "binpack": { @@ -95,7 +95,7 @@ "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -105,7 +105,7 @@ "buffer-alloc": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "integrity": "sha1-iQ3ZDZI6hz4I4Q5f1RpX5bfM4Ow=", "dev": true, "requires": { "buffer-alloc-unsafe": "^1.1.0", @@ -115,7 +115,7 @@ "buffer-alloc-unsafe": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "integrity": "sha1-vX3CauKXLQ7aJTvgYdupkjScGfA=", "dev": true }, "buffer-fill": { @@ -186,7 +186,7 @@ "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "integrity": "sha1-/UhehMA+tIgcIHIrpIA16FMa6zM=", "dev": true }, "compare-version": { @@ -317,9 +317,9 @@ "dev": true }, "electron": { - "version": "7.1.10", - "resolved": "https://registry.npmjs.org/electron/-/electron-7.1.10.tgz", - "integrity": "sha512-UDpS2CfBN3yufCrbET5Ozw1XrLhuANHn+Zs8Vgl/BcBT/MoNbkY79nRFcyxj6pCFrEde9IoNOf+DgNp6altNxw==", + "version": "7.1.11", + "resolved": "https://registry.npmjs.org/electron/-/electron-7.1.11.tgz", + "integrity": "sha512-YDXfnovKY+8iZ5ISQh1kRqYIRKbpOSxGXCx2WVxPFPutEQ7Q/Xzr3h4GePEY25/NXMytMfhKaAZAYjtWUm3r9Q==", "dev": true, "requires": { "@electron/get": "^1.0.1", @@ -354,7 +354,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { "ms": "2.0.0" @@ -424,7 +424,7 @@ "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "integrity": "sha1-tKxAZIEH/c3PriQvQovqihTU8b8=", "dev": true, "requires": { "is-arrayish": "^0.2.1" @@ -494,7 +494,7 @@ "flora-colossus": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/flora-colossus/-/flora-colossus-1.0.1.tgz", - "integrity": "sha512-d+9na7t9FyH8gBJoNDSi28mE4NgQVGGvxQ4aHtFRetjyh5SXjuus+V5EZaxFmFdXVemSOrx0lsgEl/ZMjnOWJA==", + "integrity": "sha1-q6GYQlqBhTQeZPnSpqlv2aPL25M=", "dev": true, "requires": { "debug": "^4.1.1", @@ -504,7 +504,7 @@ "fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "integrity": "sha1-TxicRKoSO4lfcigE9V6iPq3DSOk=", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -579,7 +579,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { "ms": "2.0.0" @@ -683,7 +683,7 @@ "hosted-git-info": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", - "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", + "integrity": "sha1-dZz88sTRVq3lmwst+r3cQqa5xww=", "dev": true }, "http-cache-semantics": { @@ -705,7 +705,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=", "dev": true }, "ini": { @@ -730,7 +730,7 @@ "isbinaryfile": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.3.tgz", - "integrity": "sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==", + "integrity": "sha1-XW3vPt6/boyoyunDAYOoBLX4voA=", "dev": true, "requires": { "buffer-alloc": "^1.2.0" @@ -846,7 +846,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -870,7 +870,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", "dev": true }, "node-osc": { @@ -885,7 +885,7 @@ "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "integrity": "sha1-5m2xg4sgDB38IzIl0SyzZSDiNKg=", "dev": true, "requires": { "hosted-git-info": "^2.1.4", @@ -952,7 +952,7 @@ "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "integrity": "sha1-uGvV8MJWkJEcdZD8v8IBDVSzzLg=", "dev": true, "requires": { "p-try": "^1.0.0" @@ -1006,7 +1006,7 @@ "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "integrity": "sha1-1i27VnlAXXLEc37FhgDp3c8G0kw=", "dev": true }, "path-type": { @@ -1042,7 +1042,7 @@ "plist": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.1.tgz", - "integrity": "sha512-GpgvHHocGRyQm74b6FWEZZVRroHKE1I0/BTjAmySaohK+cUn+hZpbqXkc3KWgW3gQYkqcQej35FohcT0FRlkRQ==", + "integrity": "sha1-qbkx0XwwTokS7wujvdYYK68uH4w=", "dev": true, "requires": { "base64-js": "^1.2.3", @@ -1142,7 +1142,7 @@ "rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "integrity": "sha1-NXl/E6f9rcVmFCwp1PB8ytSD4+w=", "dev": true, "requires": { "glob": "^7.1.3" @@ -1172,7 +1172,7 @@ "sanitize-filename": { "version": "1.6.3", "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz", - "integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==", + "integrity": "sha1-dV69dSBFkxl34wsgJdNA18kJA3g=", "dev": true, "requires": { "truncate-utf8-bytes": "^1.0.0" @@ -1204,7 +1204,7 @@ "spdx-correct": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "integrity": "sha1-+4PlBERSaPFUsHTiGMh8ADzTHfQ=", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -1214,13 +1214,13 @@ "spdx-exceptions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "integrity": "sha1-LqRQrudPKom/uUUZwH/Nb0EyKXc=", "dev": true }, "spdx-expression-parse": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "integrity": "sha1-meEZt6XaAOBUkcn6M4t5BII7QdA=", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -1230,7 +1230,7 @@ "spdx-license-ids": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "integrity": "sha1-NpS1gEVnpFjTyARYQqY1hjL2JlQ=", "dev": true }, "sprintf-js": { @@ -1267,7 +1267,7 @@ "tmp": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", - "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==", + "integrity": "sha1-7kNKTiJUMILilLpiAdzG6v76KHc=", "dev": true, "requires": { "rimraf": "^2.6.3" @@ -1276,7 +1276,7 @@ "tmp-promise": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-1.1.0.tgz", - "integrity": "sha512-8+Ah9aB1IRXCnIOxXZ0uFozV1nMU5xiu7hhFVUSxZ3bYu+psD4TzagCzVbexUCgNNGJnsmNDQlS4nG3mTyoNkw==", + "integrity": "sha1-u5JNI5ApFXubwdUGpqo0H4sT5kw=", "dev": true, "requires": { "bluebird": "^3.5.0", @@ -1321,7 +1321,7 @@ "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "integrity": "sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=", "dev": true }, "url-parse-lax": { @@ -1348,7 +1348,7 @@ "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "integrity": "sha1-/JH2uce6FchX9MssXe/uw51PQQo=", "dev": true, "requires": { "spdx-correct": "^3.0.0", diff --git a/desktop/package.json b/desktop/package.json index e3e2a40..049da30 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -19,7 +19,7 @@ "push": "npm run build ; npm run push_osx ; npm run push_linux ; npm run push_win ; npm run clean ; npm run status" }, "devDependencies": { - "electron": "^7.1.10", + "electron": "^7.1.11", "electron-packager": "^14.2.0" }, "dependencies": { diff --git a/desktop/sources/scripts/client.js b/desktop/sources/scripts/client.js index f482f06..d1580a5 100644 --- a/desktop/sources/scripts/client.js +++ b/desktop/sources/scripts/client.js @@ -273,10 +273,10 @@ function Client () { if (type === 6) { return { fg: this.theme.active.b_inv } } // Invisible if (type === 7) { return {} } - // Reader + // Output Bang if (type === 8) { return { bg: this.theme.active.b_low, fg: this.theme.active.f_high } } // Output Reader - if (type === 9) { return { bg: this.theme.active.b_inv, fg: this.theme.active.f_high } } + if (type === 9) { return { bg: this.theme.active.b_inv, fg: this.theme.active.background } } // Reader+Background if (type === 10) { return { bg: this.theme.active.background, fg: this.theme.active.f_high } } // Clock(yellow fg) @@ -312,9 +312,7 @@ function Client () { const isLocked = this.orca.lockAt(x, y) if (selection === glyph && isLocked === false && selection !== '.') { return 6 } if (glyph === '*' && isLocked === false) { return 2 } - const port = this.ports[this.orca.indexAt(x, y)] - if (port) { return port[2] } if (isLocked === true) { return 5 } return 20 diff --git a/desktop/sources/scripts/core/library.js b/desktop/sources/scripts/core/library.js index 1889062..fca1cac 100644 --- a/desktop/sources/scripts/core/library.js +++ b/desktop/sources/scripts/core/library.js @@ -13,7 +13,7 @@ library.a = function OperatorA (orca, x, y, passive) { this.ports.a = { x: -1, y: 0 } this.ports.b = { x: 1, y: 0 } - this.ports.output = { x: 0, y: 1, sensitive: true } + this.ports.output = { x: 0, y: 1, sensitive: true, output: true } this.operation = function (force = false) { const a = this.listen(this.ports.a, true) @@ -30,7 +30,7 @@ library.b = function OperatorL (orca, x, y, passive) { this.ports.a = { x: -1, y: 0 } this.ports.b = { x: 1, y: 0 } - this.ports.output = { x: 0, y: 1, sensitive: true } + this.ports.output = { x: 0, y: 1, sensitive: true, output: true } this.operation = function (force = false) { const a = this.listen(this.ports.a, true) @@ -47,7 +47,7 @@ library.c = function OperatorC (orca, x, y, passive) { this.ports.rate = { x: -1, y: 0, clamp: { min: 1 } } this.ports.mod = { x: 1, y: 0, default: '8' } - this.ports.output = { x: 0, y: 1, sensitive: true } + this.ports.output = { x: 0, y: 1, sensitive: true, output: true } this.operation = function (force = false) { const rate = this.listen(this.ports.rate, true) @@ -65,7 +65,7 @@ library.d = function OperatorD (orca, x, y, passive) { this.ports.rate = { x: -1, y: 0, clamp: { min: 1 } } this.ports.mod = { x: 1, y: 0, default: '8' } - this.ports.output = { x: 0, y: 1, bang: true } + this.ports.output = { x: 0, y: 1, bang: true, output: true } this.operation = function (force = false) { const rate = this.listen(this.ports.rate, true) @@ -96,7 +96,7 @@ library.f = function OperatorF (orca, x, y, passive) { this.ports.a = { x: -1, y: 0 } this.ports.b = { x: 1, y: 0 } - this.ports.output = { x: 0, y: 1, bang: true } + this.ports.output = { x: 0, y: 1, bang: true, output: true } this.operation = function (force = false) { const a = this.listen(this.ports.a) @@ -136,7 +136,7 @@ library.h = function OperatorH (orca, x, y, passive) { this.name = 'halt' this.info = 'Halts southward operand' - this.ports.output = { x: 0, y: 1, reader: true } + this.ports.output = { x: 0, y: 1, reader: true, output: true } this.operation = function (force = false) { orca.lock(this.x + this.ports.output.x, this.y + this.ports.output.y) @@ -152,7 +152,7 @@ library.i = function OperatorI (orca, x, y, passive) { this.ports.step = { x: -1, y: 0, default: '1' } this.ports.mod = { x: 1, y: 0 } - this.ports.output = { x: 0, y: 1, sensitive: true, reader: true } + this.ports.output = { x: 0, y: 1, sensitive: true, reader: true, output: true } this.operation = function (force = false) { const step = this.listen(this.ports.step, true) @@ -169,7 +169,7 @@ library.j = function OperatorJ (orca, x, y, passive) { this.info = 'Outputs northward operand' this.ports.val = { x: 0, y: -1 } - this.ports.output = { x: 0, y: 1 } + this.ports.output = { x: 0, y: 1, output: true } this.operation = function (force = false) { orca.lock(this.x, this.y + 1) @@ -209,7 +209,7 @@ library.l = function OperatorL (orca, x, y, passive) { this.ports.a = { x: -1, y: 0 } this.ports.b = { x: 1, y: 0 } - this.ports.output = { x: 0, y: 1, sensitive: true } + this.ports.output = { x: 0, y: 1, sensitive: true, output: true } this.operation = function (force = false) { const a = this.listen(this.ports.a) @@ -226,7 +226,7 @@ library.m = function OperatorM (orca, x, y, passive) { this.ports.a = { x: -1, y: 0 } this.ports.b = { x: 1, y: 0 } - this.ports.output = { x: 0, y: 1, sensitive: true } + this.ports.output = { x: 0, y: 1, sensitive: true, output: true } this.operation = function (force = false) { const a = this.listen(this.ports.a, true) @@ -256,7 +256,7 @@ library.o = function OperatorO (orca, x, y, passive) { this.ports.x = { x: -2, y: 0 } this.ports.y = { x: -1, y: 0 } - this.ports.output = { x: 0, y: 1 } + this.ports.output = { x: 0, y: 1, output: true } this.operation = function (force = false) { const x = this.listen(this.ports.x, true) @@ -282,7 +282,7 @@ library.p = function OperatorP (orca, x, y, passive) { for (let offset = 0; offset < len; offset++) { orca.lock(this.x + offset, this.y + 1) } - this.ports.output = { x: (key % len), y: 1 } + this.ports.output = { x: (key % len), y: 1, output: true } return this.listen(this.ports.val) } } @@ -320,7 +320,7 @@ library.r = function OperatorR (orca, x, y, passive) { this.ports.min = { x: -1, y: 0 } this.ports.max = { x: 1, y: 0 } - this.ports.output = { x: 0, y: 1, sensitive: true } + this.ports.output = { x: 0, y: 1, sensitive: true, output: true } this.operation = function (force = false) { const min = this.listen(this.ports.min, true) @@ -351,7 +351,7 @@ library.t = function OperatorT (orca, x, y, passive) { this.ports.key = { x: -2, y: 0 } this.ports.len = { x: -1, y: 0, clamp: { min: 1 } } - this.ports.output = { x: 0, y: 1 } + this.ports.output = { x: 0, y: 1, output: true } this.operation = function (force = false) { const len = this.listen(this.ports.len, true) @@ -372,7 +372,7 @@ library.u = function OperatorU (orca, x, y, passive) { this.ports.step = { x: -1, y: 0, clamp: { min: 0 }, default: '1' } this.ports.max = { x: 1, y: 0, clamp: { min: 1 }, default: '8' } - this.ports.output = { x: 0, y: 1, bang: true } + this.ports.output = { x: 0, y: 1, bang: true, output: true } this.operation = function (force = false) { const step = this.listen(this.ports.step, true) @@ -431,7 +431,7 @@ library.x = function OperatorX (orca, x, y, passive) { this.operation = function (force = false) { const x = this.listen(this.ports.x, true) const y = this.listen(this.ports.y, true) + 1 - this.addPort('output', { x: x, y: y }) + this.addPort('output', { x: x, y: y, output: true }) return this.listen(this.ports.val) } } @@ -443,7 +443,7 @@ library.y = function OperatorY (orca, x, y, passive) { this.info = 'Outputs westward operand' this.ports.val = { x: -1, y: 0 } - this.ports.output = { x: 1, y: 0 } + this.ports.output = { x: 1, y: 0, output: true } this.operation = function (force = false) { orca.lock(this.x + 1, this.y) @@ -459,7 +459,7 @@ library.z = function OperatorZ (orca, x, y, passive) { this.ports.rate = { x: -1, y: 0, default: '1' } this.ports.target = { x: 1, y: 0 } - this.ports.output = { x: 0, y: 1, sensitive: true, reader: true } + this.ports.output = { x: 0, y: 1, sensitive: true, reader: true, output: true } this.operation = function (force = false) { const rate = this.listen(this.ports.rate, true) diff --git a/desktop/sources/scripts/core/operator.js b/desktop/sources/scripts/core/operator.js index 8cfe4b1..ac61c9a 100644 --- a/desktop/sources/scripts/core/operator.js +++ b/desktop/sources/scripts/core/operator.js @@ -32,8 +32,7 @@ function Operator (orca, x, y, glyph = '.', passive = false) { this.bang = function (b) { if (!this.ports.output) { console.warn(this.name, 'Trying to bang, but no port'); return } - if (b === false) { return } - orca.write(this.x + this.ports.output.x, this.y + this.ports.output.y, '*') + orca.write(this.x + this.ports.output.x, this.y + this.ports.output.y, b ? '*' : '.') orca.lock(this.x + this.ports.output.x, this.y + this.ports.output.y) } @@ -113,23 +112,12 @@ function Operator (orca, x, y, glyph = '.', passive = false) { if (!this.passive) { return a } for (const id in this.ports) { const port = this.ports[id] - const type = this.getPortType(id) + const type = port.output ? 3 : port.x < 0 || port.y < 0 ? 1 : 2 a.push([this.x + port.x, this.y + port.y, type, `${this.glyph}-${id}`]) } return a } - this.getPortType = function (id) { - const port = this.ports[id] - if (port.output || id === 'output') { - return port.reader || port.bang ? 8 : 3 - } - if (port.x < 0 || port.y < 0) { - return 1 - } - return 2 - } - this.shouldUpperCase = function (ports = this.ports) { if (!this.ports.output || !this.ports.output.sensitive) { return false } const value = this.listen({ x: 1, y: 0 }) diff --git a/examples/benchmarks/families.orca b/examples/benchmarks/families.orca index 7d72d17..426c376 100644 --- a/examples/benchmarks/families.orca +++ b/examples/benchmarks/families.orca @@ -1,25 +1,25 @@ ................................................. -.#.READING.OUTPUT.#.....#.READERS.#.............. +.#.READING.OUTPUT.#....#.READERS.#............... ................................................. -...I...Z...H...F..........O...G...T.............. -...p...0......................................... +...I....Z....H....F......O....G....T............. +...4....0.........*.............................. ................................................. -.#.CLOCKS.#.............#.WRITERS.#.............. +.#.CLOCKS.#............#.WRITERS..#.............. ................................................. -...D...U...C...R..........X...Q...P.............. -...........1...x................................. +...D....U....C....R......X....Q....P............. +.............7....g.............................. ................................................. -.#.MATHS.#..............#.VARIABLES.#............ +.#.MATHS.#.............#.VARIABLES.#............. ................................................. -...A...B...L...M..........V...K.................. -...0...0...0...0................................. +...A....B....L....M......V....K.................. +...0....0.........0.............................. ................................................. -.#.JUMPERS.#............#.CARDINAL.#............. +.#.JUMPERS.#...........#.CARDINAL.#.............. +................................................. +...J....Y..............#.NESW.#.................. ................................................. -...J...Y................#.NESW.#................. ................................................. ................................................. ................................................. ................................................. ................................................. -.................................................
\ No newline at end of file |