diff --git a/.vscode/settings.json b/.vscode/settings.json
index 4ed7c27..0694373 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,4 +1,7 @@
{
"rust-analyzer.check.allTargets": false,
- "rust-analyzer.cargo.target": "wasm32-unknown-unknown"
+ "rust-analyzer.cargo.target": "wasm32-unknown-unknown",
+ "rust-analyzer.cargo.features": [
+ "tsify",
+ ]
}
diff --git a/Cargo.lock b/Cargo.lock
index 3bc6add..d1c9b09 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -119,7 +119,7 @@ checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
]
[[package]]
@@ -130,14 +130,14 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
]
[[package]]
name = "autocfg"
-version = "1.2.0"
+version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80"
+checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
[[package]]
name = "backtrace"
@@ -156,9 +156,9 @@ dependencies = [
[[package]]
name = "base64"
-version = "0.21.7"
+version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
+checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "bitflags"
@@ -167,10 +167,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
-name = "bumpalo"
-version = "3.15.4"
+name = "bitflags"
+version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa"
+checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
+
+[[package]]
+name = "bumpalo"
+version = "3.16.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]]
name = "bytes"
@@ -200,9 +206,9 @@ dependencies = [
[[package]]
name = "cc"
-version = "1.0.90"
+version = "1.0.97"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5"
+checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4"
[[package]]
name = "cfg-if"
@@ -212,15 +218,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
-version = "0.4.37"
+version = "0.4.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e"
+checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
dependencies = [
"android-tzdata",
"iana-time-zone",
"num-traits",
"serde",
- "windows-targets 0.52.4",
+ "windows-targets 0.52.5",
]
[[package]]
@@ -254,7 +260,7 @@ dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
]
[[package]]
@@ -263,6 +269,33 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce"
+[[package]]
+name = "color-eyre"
+version = "0.6.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5"
+dependencies = [
+ "backtrace",
+ "color-spantrace",
+ "eyre",
+ "indenter",
+ "once_cell",
+ "owo-colors",
+ "tracing-error",
+]
+
+[[package]]
+name = "color-spantrace"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2"
+dependencies = [
+ "once_cell",
+ "owo-colors",
+ "tracing-core",
+ "tracing-error",
+]
+
[[package]]
name = "colorchoice"
version = "1.0.0"
@@ -321,7 +354,7 @@ dependencies = [
"proc-macro2",
"quote",
"strsim 0.10.0",
- "syn 2.0.57",
+ "syn 2.0.77",
]
[[package]]
@@ -332,7 +365,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f"
dependencies = [
"darling_core",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
]
[[package]]
@@ -342,7 +375,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856"
dependencies = [
"cfg-if",
- "hashbrown 0.14.3",
+ "hashbrown 0.14.5",
"lock_api",
"once_cell",
"parking_lot_core",
@@ -370,6 +403,16 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
+[[package]]
+name = "eyre"
+version = "0.6.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec"
+dependencies = [
+ "indenter",
+ "once_cell",
+]
+
[[package]]
name = "fnv"
version = "1.0.7"
@@ -441,7 +484,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
]
[[package]]
@@ -493,6 +536,19 @@ version = "0.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
+[[package]]
+name = "gloo-utils"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "037fcb07216cb3a30f7292bd0176b050b7b9a052ba830ef7d5d65f6dc64ba58e"
+dependencies = [
+ "js-sys",
+ "serde",
+ "serde_json",
+ "wasm-bindgen",
+ "web-sys",
+]
+
[[package]]
name = "hashbrown"
version = "0.12.3"
@@ -501,9 +557,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "hashbrown"
-version = "0.14.3"
+version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
+checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
[[package]]
name = "heck"
@@ -562,35 +618,49 @@ dependencies = [
name = "ic10emu"
version = "0.2.3"
dependencies = [
+ "color-eyre",
"const-crc32",
- "convert_case",
"getrandom",
"itertools",
+ "macro_rules_attribute",
+ "paste",
"phf 0.11.2",
- "phf_codegen",
"rand",
"regex",
"serde",
+ "serde_derive",
+ "serde_json",
"serde_with",
+ "stationeers_data",
"strum",
"strum_macros",
"thiserror",
"time",
+ "tracing",
+ "tsify",
+ "wasm-bindgen",
]
[[package]]
name = "ic10emu_wasm"
version = "0.2.3"
dependencies = [
+ "color-eyre",
"console_error_panic_hook",
"ic10emu",
"itertools",
"js-sys",
"serde",
"serde-wasm-bindgen 0.6.5",
+ "serde_derive",
+ "serde_ignored",
+ "serde_json",
+ "serde_path_to_error",
"serde_with",
- "strum",
+ "stationeers_data",
"thiserror",
+ "tracing",
+ "tracing-wasm",
"tsify",
"wasm-bindgen",
"wasm-bindgen-futures",
@@ -625,6 +695,8 @@ dependencies = [
"js-sys",
"tokio",
"tower-lsp",
+ "tracing",
+ "tracing-wasm",
"wasm-bindgen",
"wasm-bindgen-futures",
"wasm-streams",
@@ -647,6 +719,12 @@ dependencies = [
"unicode-normalization",
]
+[[package]]
+name = "indenter"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
+
[[package]]
name = "indexmap"
version = "1.9.3"
@@ -665,15 +743,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
dependencies = [
"equivalent",
- "hashbrown 0.14.3",
+ "hashbrown 0.14.5",
"serde",
]
[[package]]
name = "itertools"
-version = "0.12.1"
+version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
+checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
dependencies = [
"either",
]
@@ -693,6 +771,12 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "lazy_static"
+version = "1.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
+
[[package]]
name = "libc"
version = "0.2.153"
@@ -701,9 +785,9 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
[[package]]
name = "lock_api"
-version = "0.4.11"
+version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
+checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
dependencies = [
"autocfg",
"scopeguard",
@@ -721,13 +805,29 @@ version = "0.94.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c66bfd44a06ae10647fe3f8214762e9369fd4248df1350924b4ef9e770a85ea1"
dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
"serde",
"serde_json",
"serde_repr",
"url",
]
+[[package]]
+name = "macro_rules_attribute"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a82271f7bc033d84bbca59a3ce3e4159938cb08a9c3aebbe54d215131518a13"
+dependencies = [
+ "macro_rules_attribute-proc_macro",
+ "paste",
+]
+
+[[package]]
+name = "macro_rules_attribute-proc_macro"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b8dd856d451cc0da70e2ef2ce95a18e39a93b7558bedf10201ad28503f918568"
+
[[package]]
name = "memchr"
version = "2.7.2"
@@ -754,6 +854,39 @@ dependencies = [
"windows-sys 0.48.0",
]
+[[package]]
+name = "num"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23"
+dependencies = [
+ "num-bigint",
+ "num-complex",
+ "num-integer",
+ "num-iter",
+ "num-rational",
+ "num-traits",
+]
+
+[[package]]
+name = "num-bigint"
+version = "0.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7"
+dependencies = [
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-complex"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
+dependencies = [
+ "num-traits",
+]
+
[[package]]
name = "num-conv"
version = "0.1.0"
@@ -761,10 +894,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
[[package]]
-name = "num-traits"
-version = "0.2.18"
+name = "num-integer"
+version = "0.1.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a"
+checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
+dependencies = [
+ "num-traits",
+]
+
+[[package]]
+name = "num-iter"
+version = "0.1.45"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf"
+dependencies = [
+ "autocfg",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-rational"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
+dependencies = [
+ "num-bigint",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-traits"
+version = "0.2.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
@@ -804,10 +968,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]]
-name = "parking_lot"
-version = "0.12.1"
+name = "owo-colors"
+version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
+checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f"
+
+[[package]]
+name = "parking_lot"
+version = "0.12.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb"
dependencies = [
"lock_api",
"parking_lot_core",
@@ -815,17 +985,23 @@ dependencies = [
[[package]]
name = "parking_lot_core"
-version = "0.9.9"
+version = "0.9.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e"
+checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"smallvec",
- "windows-targets 0.48.5",
+ "windows-targets 0.52.5",
]
+[[package]]
+name = "paste"
+version = "1.0.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
+
[[package]]
name = "percent-encoding"
version = "2.3.1"
@@ -907,7 +1083,7 @@ dependencies = [
"phf_shared 0.11.2",
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
]
[[package]]
@@ -945,7 +1121,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
]
[[package]]
@@ -972,6 +1148,16 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
+[[package]]
+name = "prettyplease"
+version = "0.2.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e"
+dependencies = [
+ "proc-macro2",
+ "syn 2.0.77",
+]
+
[[package]]
name = "proc-macro-hack"
version = "0.5.20+deprecated"
@@ -980,18 +1166,18 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
[[package]]
name = "proc-macro2"
-version = "1.0.79"
+version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
+checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
-version = "1.0.35"
+version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
+checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
dependencies = [
"proc-macro2",
]
@@ -1028,11 +1214,11 @@ dependencies = [
[[package]]
name = "redox_syscall"
-version = "0.4.1"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
+checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e"
dependencies = [
- "bitflags",
+ "bitflags 2.5.0",
]
[[package]]
@@ -1066,9 +1252,9 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56"
[[package]]
name = "rustc-demangle"
-version = "0.1.23"
+version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
+checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
[[package]]
name = "rustversion"
@@ -1078,9 +1264,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
[[package]]
name = "ryu"
-version = "1.0.17"
+version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1"
+checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
[[package]]
name = "scopeguard"
@@ -1090,9 +1276,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "serde"
-version = "1.0.197"
+version = "1.0.203"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2"
+checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094"
dependencies = [
"serde_derive",
]
@@ -1121,13 +1307,13 @@ dependencies = [
[[package]]
name = "serde_derive"
-version = "1.0.197"
+version = "1.0.203"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
+checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
]
[[package]]
@@ -1138,20 +1324,39 @@ checksum = "e578a843d40b4189a4d66bba51d7684f57da5bd7c304c64e14bd63efbef49509"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
+]
+
+[[package]]
+name = "serde_ignored"
+version = "0.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8e319a36d1b52126a0d608f24e93b2d81297091818cd70625fcf50a15d84ddf"
+dependencies = [
+ "serde",
]
[[package]]
name = "serde_json"
-version = "1.0.115"
+version = "1.0.117"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd"
+checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3"
dependencies = [
"itoa",
"ryu",
"serde",
]
+[[package]]
+name = "serde_path_to_error"
+version = "0.1.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6"
+dependencies = [
+ "itoa",
+ "serde",
+]
+
[[package]]
name = "serde_repr"
version = "0.1.18"
@@ -1160,14 +1365,14 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
]
[[package]]
name = "serde_with"
-version = "3.7.0"
+version = "3.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a"
+checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20"
dependencies = [
"base64",
"chrono",
@@ -1183,21 +1388,30 @@ dependencies = [
[[package]]
name = "serde_with_macros"
-version = "3.7.0"
+version = "3.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655"
+checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2"
dependencies = [
"darling",
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
+]
+
+[[package]]
+name = "sharded-slab"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6"
+dependencies = [
+ "lazy_static",
]
[[package]]
name = "signal-hook-registry"
-version = "1.4.1"
+version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1"
+checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1"
dependencies = [
"libc",
]
@@ -1225,14 +1439,29 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]]
name = "socket2"
-version = "0.5.6"
+version = "0.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871"
+checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c"
dependencies = [
"libc",
"windows-sys 0.52.0",
]
+[[package]]
+name = "stationeers_data"
+version = "0.2.3"
+dependencies = [
+ "const-crc32",
+ "num-integer",
+ "phf 0.11.2",
+ "serde",
+ "serde_derive",
+ "serde_with",
+ "strum",
+ "tsify",
+ "wasm-bindgen",
+]
+
[[package]]
name = "strsim"
version = "0.10.0"
@@ -1265,7 +1494,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustversion",
- "syn 2.0.57",
+ "syn 2.0.77",
]
[[package]]
@@ -1281,9 +1510,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.57"
+version = "2.0.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11a6ae1e52eb25aab8f3fb9fca13be982a373b8f1157ca14b897a825ba4a2d35"
+checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed"
dependencies = [
"proc-macro2",
"quote",
@@ -1291,30 +1520,46 @@ dependencies = [
]
[[package]]
-name = "thiserror"
-version = "1.0.58"
+name = "textwrap"
+version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297"
+checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9"
+
+[[package]]
+name = "thiserror"
+version = "1.0.61"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.58"
+version = "1.0.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
+checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
+]
+
+[[package]]
+name = "thread_local"
+version = "1.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c"
+dependencies = [
+ "cfg-if",
+ "once_cell",
]
[[package]]
name = "time"
-version = "0.3.34"
+version = "0.3.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749"
+checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
dependencies = [
"deranged",
"itoa",
@@ -1336,9 +1581,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
[[package]]
name = "time-macros"
-version = "0.2.17"
+version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774"
+checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
dependencies = [
"num-conv",
"time-core",
@@ -1386,7 +1631,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
]
[[package]]
@@ -1455,7 +1700,7 @@ checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
]
[[package]]
@@ -1483,7 +1728,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
]
[[package]]
@@ -1493,6 +1738,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
dependencies = [
"once_cell",
+ "valuable",
+]
+
+[[package]]
+name = "tracing-error"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e"
+dependencies = [
+ "tracing",
+ "tracing-subscriber",
+]
+
+[[package]]
+name = "tracing-subscriber"
+version = "0.3.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b"
+dependencies = [
+ "sharded-slab",
+ "thread_local",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-wasm"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4575c663a174420fa2d78f4108ff68f65bf2fbb7dd89f33749b6e826b3626e07"
+dependencies = [
+ "tracing",
+ "tracing-subscriber",
+ "wasm-bindgen",
]
[[package]]
@@ -1542,8 +1820,10 @@ version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6b26cf145f2f3b9ff84e182c448eaf05468e247f148cf3d2a7d67d78ff023a0"
dependencies = [
+ "gloo-utils",
"serde",
"serde-wasm-bindgen 0.5.0",
+ "serde_json",
"tsify-macros",
"wasm-bindgen",
]
@@ -1557,7 +1837,17 @@ dependencies = [
"proc-macro2",
"quote",
"serde_derive_internals",
- "syn 2.0.57",
+ "syn 2.0.77",
+]
+
+[[package]]
+name = "uneval"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "63cc5d2fd8648d7e2be86098f60c9ece7045cc710b3c1e226910e2f37d11dc73"
+dependencies = [
+ "serde",
+ "thiserror",
]
[[package]]
@@ -1605,6 +1895,12 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
+[[package]]
+name = "valuable"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
+
[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
@@ -1632,7 +1928,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
"wasm-bindgen-shared",
]
@@ -1667,7 +1963,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.57",
+ "syn 2.0.77",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -1707,7 +2003,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
- "windows-targets 0.52.4",
+ "windows-targets 0.52.5",
]
[[package]]
@@ -1725,7 +2021,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
- "windows-targets 0.52.4",
+ "windows-targets 0.52.5",
]
[[package]]
@@ -1745,17 +2041,18 @@ dependencies = [
[[package]]
name = "windows-targets"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b"
+checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
dependencies = [
- "windows_aarch64_gnullvm 0.52.4",
- "windows_aarch64_msvc 0.52.4",
- "windows_i686_gnu 0.52.4",
- "windows_i686_msvc 0.52.4",
- "windows_x86_64_gnu 0.52.4",
- "windows_x86_64_gnullvm 0.52.4",
- "windows_x86_64_msvc 0.52.4",
+ "windows_aarch64_gnullvm 0.52.5",
+ "windows_aarch64_msvc 0.52.5",
+ "windows_i686_gnu 0.52.5",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc 0.52.5",
+ "windows_x86_64_gnu 0.52.5",
+ "windows_x86_64_gnullvm 0.52.5",
+ "windows_x86_64_msvc 0.52.5",
]
[[package]]
@@ -1766,9 +2063,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]]
name = "windows_aarch64_gnullvm"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9"
+checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
[[package]]
name = "windows_aarch64_msvc"
@@ -1778,9 +2075,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]]
name = "windows_aarch64_msvc"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675"
+checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
[[package]]
name = "windows_i686_gnu"
@@ -1790,9 +2087,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]]
name = "windows_i686_gnu"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3"
+checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
[[package]]
name = "windows_i686_msvc"
@@ -1802,9 +2105,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]]
name = "windows_i686_msvc"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02"
+checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
[[package]]
name = "windows_x86_64_gnu"
@@ -1814,9 +2117,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]]
name = "windows_x86_64_gnu"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03"
+checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
[[package]]
name = "windows_x86_64_gnullvm"
@@ -1826,9 +2129,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]]
name = "windows_x86_64_gnullvm"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177"
+checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
[[package]]
name = "windows_x86_64_msvc"
@@ -1838,14 +2141,35 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "windows_x86_64_msvc"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
+checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
[[package]]
name = "xtask"
version = "0.2.3"
dependencies = [
"clap",
+ "color-eyre",
+ "convert_case",
+ "indexmap 2.2.6",
+ "num",
+ "num-integer",
+ "phf_codegen",
+ "prettyplease",
+ "proc-macro2",
+ "quote",
+ "regex",
+ "serde",
+ "serde_derive",
+ "serde_ignored",
+ "serde_json",
+ "serde_path_to_error",
+ "serde_with",
+ "stationeers_data",
+ "syn 2.0.77",
+ "textwrap",
"thiserror",
+ "tracing",
+ "uneval",
]
diff --git a/Cargo.toml b/Cargo.toml
index 7c969c9..24b1af4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,11 @@
[workspace]
-members = ["ic10lsp_wasm", "ic10emu_wasm", "ic10emu", "xtask"]
+members = [
+ "ic10lsp_wasm",
+ "stationeers_data",
+ "ic10emu",
+ "ic10emu_wasm",
+ "xtask",
+]
resolver = "2"
[workspace.package]
diff --git a/cspell.json b/cspell.json
index ec86b48..e8f8295 100644
--- a/cspell.json
+++ b/cspell.json
@@ -1 +1,222 @@
-{"language":"en","flagWords":[],"version":"0.2","words":["Astroloy","Autolathe","bapal","bapz","bapzal","batchmode","batchmodes","bdns","bdnsal","bdse","bdseal","beqal","beqz","beqzal","bgeal","bgez","bgezal","bgtal","bgtz","bgtzal","bindgen","bleal","blez","blezal","bltal","bltz","bltzal","bnaal","bnan","bnaz","bnazal","bneal","bnez","bnezal","brap","brapz","brdns","brdse","breq","breqz","brge","brgez","brgt","brgtz","brle","brlez","brlt","brltz","brna","brnan","brnaz","brne","brnez","Circuitboard","codegen","conv","cstyle","endpos","getd","Hardsuit","hashables","inext","inextp","infile","itertools","jetpack","kbshortcutmenu","Keybind","lbns","logicable","logictype","logictypes","lzma","Mineables","mscorlib","MSEED","ninf","nomatch","oprs","overcolumn","Overlength","pedia","peekable","prec","preproc","putd","QUICKFIX","reagentmode","reagentmodes","repr","retval","rocketstation","sapz","sattellite","sdns","sdse","searchbox","searchbtn","seqz","serde","settingsmenu","sgez","sgtz","slez","slotlogic","slotlogicable","slotlogictype","slotlogictypes","slottype","sltz","snan","snanz","snaz","snez","splitn","Stationeers","stationpedia","stdweb","thiserror","tokentype","trunc","Tsify","whos","Depressurising","Pressurising","logicslottypes","lparen","rparen","hstack","dylib"]}
+{
+ "language": "en",
+ "flagWords": [],
+ "version": "0.2",
+ "words": [
+ "Agrizero",
+ "aliasable",
+ "Analyizer",
+ "Analyser",
+ "arn't",
+ "Astroloy",
+ "Asura",
+ "Atmo",
+ "autoignition",
+ "Autolathe",
+ "Autominer",
+ "Autotagged",
+ "bapal",
+ "bapz",
+ "bapzal",
+ "batchmode",
+ "batchmodes",
+ "bdns",
+ "bdnsal",
+ "bdse",
+ "bdseal",
+ "beqal",
+ "beqz",
+ "beqzal",
+ "bgeal",
+ "bgez",
+ "bgezal",
+ "bgtal",
+ "bgtz",
+ "bgtzal",
+ "bindgen",
+ "bleal",
+ "blez",
+ "blezal",
+ "bltal",
+ "bltz",
+ "bltzal",
+ "bnaal",
+ "bnan",
+ "bnaz",
+ "bnazal",
+ "bneal",
+ "bnez",
+ "bnezal",
+ "bools",
+ "brap",
+ "brapz",
+ "brdns",
+ "brdse",
+ "breq",
+ "breqz",
+ "brge",
+ "brgez",
+ "brgt",
+ "brgtz",
+ "brle",
+ "brlez",
+ "brlt",
+ "brltz",
+ "brna",
+ "brnan",
+ "brnaz",
+ "brne",
+ "brnez",
+ "Cannifier",
+ "cannister",
+ "Carrage",
+ "CHAC",
+ "Circuitboard",
+ "Clrd",
+ "codegen",
+ "columnated",
+ "composter",
+ "conv",
+ "Cryo",
+ "cstyle",
+ "Darga",
+ "Datalink",
+ "Depressurising",
+ "desync",
+ "dylib",
+ "endpos",
+ "Espaciais",
+ "Exgress",
+ "Faily",
+ "Fenoxitone",
+ "Frida",
+ "fromstr",
+ "getd",
+ "glowstick",
+ "glowy",
+ "Hardsuit",
+ "Harvie",
+ "hashables",
+ "Hastelloy",
+ "headcrabs",
+ "hstack",
+ "Huxi",
+ "Idents",
+ "iface",
+ "impls",
+ "Inconel",
+ "indexmap",
+ "inext",
+ "inextp",
+ "infile",
+ "Instructable",
+ "insts",
+ "intf",
+ "itertools",
+ "Jenk",
+ "jetpack",
+ "kbshortcutmenu",
+ "Keybind",
+ "Larre",
+ "lbns",
+ "logicable",
+ "LogicSlotType",
+ "logicslottypes",
+ "LogicSlotTypes",
+ "logictype",
+ "logictypes",
+ "lparen",
+ "lzma",
+ "Mineables",
+ "MKII",
+ "moondust",
+ "Mothership",
+ "mscorlib",
+ "MSEED",
+ "Murtons",
+ "ninf",
+ "Nitrice",
+ "nomatch",
+ "nops",
+ "Norsec",
+ "offworld",
+ "Omni",
+ "onsreen",
+ "oprs",
+ "overcolumn",
+ "Overlength",
+ "Padi",
+ "parentable",
+ "pedia",
+ "peekable",
+ "prec",
+ "preproc",
+ "Pressurising",
+ "prettyplease",
+ "PRNG",
+ "putd",
+ "QUICKFIX",
+ "reagentmode",
+ "reagentmodes",
+ "reborrow",
+ "Recurso",
+ "repr",
+ "Respawn",
+ "retval",
+ "Rmap",
+ "rocketstation",
+ "rparen",
+ "sapz",
+ "sattellite",
+ "sdns",
+ "sdse",
+ "searchbox",
+ "searchbtn",
+ "seqz",
+ "serde",
+ "settingsmenu",
+ "sgez",
+ "sgtz",
+ "Sinotai",
+ "slez",
+ "slotlogic",
+ "slotlogicable",
+ "slottype",
+ "sltz",
+ "snan",
+ "snanz",
+ "snaz",
+ "snez",
+ "spacepack",
+ "spalling",
+ "splitn",
+ "stablizer",
+ "Starck",
+ "Stationeer",
+ "Stationeers",
+ "stationpedia",
+ "stdweb",
+ "stopo",
+ "Stuppen",
+ "superalloys",
+ "tbody",
+ "tepratures",
+ "thiserror",
+ "tokentype",
+ "toolbelt",
+ "Topo",
+ "trunc",
+ "Tsify",
+ "undarkens",
+ "uneval",
+ "unparse",
+ "unpowered",
+ "WASD",
+ "whos",
+ "Wirecutters",
+ "Xigo",
+ "xtask",
+ "Zoomer",
+ "Zrilian"
+ ]
+}
diff --git a/data/instruction_help_patches.json b/data/instruction_help_patches.json
new file mode 100644
index 0000000..16a9ae5
--- /dev/null
+++ b/data/instruction_help_patches.json
@@ -0,0 +1,12 @@
+{
+ "bapz": "Branch to line c if abs(a) <= max(b * abs(a), float.epsilon * 8)",
+ "bapzal": "Branch to line c if abs(a) <= max(b * abs(a), float.epsilon * 8) and store next line number in ra",
+ "bnaz": "Branch to line c if abs(a) > max (b * abs(a), float.epsilon * 8)",
+ "bnazal": "Branch to line c if abs(a) > max (b * abs(a), float.epsilon * 8) and store next line number in ra",
+ "brapz": "Relative branch to line c if abs(a) <= max(b * abs(a), float.epsilon * 8)",
+ "brnaz": "Relative branch to line c if abs(a) > max(b * abs(a), float.epsilon * 8)",
+ "sapz": "Register = 1 if abs(a) <= max(b * abs(a), float.epsilon * 8), otherwise 0",
+ "snaz": "Register = 1 if abs(a) > max(b * abs(a), float.epsilon), otherwise 0",
+ "log": "Register = base e log(a) or ln(a)",
+ "exp": "Register = exp(a) or e^a"
+}
diff --git a/ic10emu/Cargo.toml b/ic10emu/Cargo.toml
index 60d5dbc..2dcc9b0 100644
--- a/ic10emu/Cargo.toml
+++ b/ic10emu/Cargo.toml
@@ -10,33 +10,53 @@ crate-type = ["lib", "cdylib"]
[dependencies]
+stationeers_data = { path = "../stationeers_data" }
const-crc32 = "1.3.0"
-itertools = "0.12.1"
-phf = "0.11.2"
+itertools = "0.13.0"
+macro_rules_attribute = "0.2.0"
+paste = "1.0.15"
+phf = { version = "0.11.2", features = ["macros"] }
rand = "0.8.5"
-regex = "1.10.3"
-serde = { version = "1.0.197", features = ["derive"] }
-serde_with = "3.7.0"
+regex = "1.10.4"
+serde = "1.0.202"
+serde_derive = "1.0.202"
+serde_with = "3.8.1"
strum = { version = "0.26.2", features = ["derive", "phf", "strum_macros"] }
strum_macros = "0.26.2"
-thiserror = "1.0.58"
-time = { version = "0.3.34", features = [
+thiserror = "1.0.61"
+time = { version = "0.3.36", features = [
"formatting",
+ "parsing",
"serde",
"local-offset",
] }
+tsify = { version = "0.4.5", optional = true, features = ["js"] }
+wasm-bindgen = { version = "0.2.92", optional = true }
+tracing = "0.1.40"
[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
-time = { version = "0.3.34", features = [
+time = { version = "0.3.36", features = [
"formatting",
"serde",
"local-offset",
"wasm-bindgen",
] }
+[dev-dependencies]
+color-eyre = "0.6.3"
+serde_json = "1.0.117"
-[build-dependencies]
-convert_case = "0.6.0"
-phf_codegen = "0.11.2"
-regex = "1.10.3"
+# Self dev dependency to enable prefab_database feature for tests
+# ic10emu = { path = ".", features = ["prefab_database"] }
+
+[features]
+default = []
+tsify = ["dep:tsify", "dep:wasm-bindgen", "stationeers_data/tsify"]
+prefab_database = [
+ "stationeers_data/prefab_database",
+] # compile with the prefab database enabled
+
+reagent_database = [
+ "stationeers_data/reagent_database",
+] # compile with the prefab database enabled
diff --git a/ic10emu/build.rs b/ic10emu/build.rs
deleted file mode 100644
index 5dd8cec..0000000
--- a/ic10emu/build.rs
+++ /dev/null
@@ -1,392 +0,0 @@
-use convert_case::{Case, Casing};
-use std::{
- collections::BTreeSet,
- env,
- fmt::Display,
- fs::{self, File},
- io::{BufWriter, Write},
- path::Path,
- str::FromStr,
-};
-
-struct EnumVariant
-where
- P: Display + FromStr,
-{
- pub aliases: Vec,
- pub value: Option,
- pub deprecated: bool,
-}
-
-fn write_repr_enum<'a, T: std::io::Write, I, P>(
- writer: &mut BufWriter,
- name: &str,
- variants: I,
- use_phf: bool,
-) where
- P: Display + FromStr + 'a,
- I: IntoIterator- )>,
-{
- let additional_strum = if use_phf { "#[strum(use_phf)]\n" } else { "" };
- write!(
- writer,
- "#[derive(Debug, Display, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, EnumString, AsRefStr, EnumProperty, EnumIter, Serialize, Deserialize)]\n\
- {additional_strum}\
- pub enum {name} {{\n"
- )
- .unwrap();
- for (name, variant) in variants {
- let variant_name = name.replace('.', "").to_case(Case::Pascal);
- let mut serialize = vec![name.clone()];
- serialize.extend(variant.aliases.iter().cloned());
- let serialize_str = serialize
- .into_iter()
- .map(|s| format!("serialize = \"{s}\""))
- .collect::>()
- .join(", ");
- let mut props = Vec::new();
- if variant.deprecated {
- props.push("deprecated = \"true\"".to_owned());
- }
- if let Some(val) = &variant.value {
- props.push(format!("value = \"{val}\""));
- }
- let props_str = if !props.is_empty() {
- format!(", props( {} )", props.join(", "))
- } else {
- "".to_owned()
- };
- writeln!(
- writer,
- " #[strum({serialize_str}{props_str})] {variant_name},"
- )
- .unwrap();
- }
- writeln!(writer, "}}").unwrap();
-}
-
-fn write_logictypes() {
- let out_dir = env::var_os("OUT_DIR").unwrap();
-
- let dest_path = Path::new(&out_dir).join("logictypes.rs");
- let output_file = File::create(dest_path).unwrap();
- let mut writer = BufWriter::new(&output_file);
-
- let mut logictypes: Vec<(String, EnumVariant)> = Vec::new();
- let l_infile = Path::new("data/logictypes.txt");
- let l_contents = fs::read_to_string(l_infile).unwrap();
-
- for line in l_contents.lines().filter(|l| !l.trim().is_empty()) {
- let mut it = line.splitn(3, ' ');
- let name = it.next().unwrap();
- let val_str = it.next().unwrap();
- let val: Option = val_str.parse().ok();
- let docs = it.next();
- let deprecated = docs
- .map(|docs| docs.trim().to_uppercase() == "DEPRECATED")
- .unwrap_or(false);
-
- if let Some(val) = val {
- if let Some((_other_name, variant)) = logictypes
- .iter_mut()
- .find(|(_, variant)| variant.value == Some(val))
- {
- variant.aliases.push(name.to_string());
- variant.deprecated = deprecated;
- } else {
- logictypes.push((
- name.to_string(),
- EnumVariant {
- aliases: Vec::new(),
- value: Some(val),
- deprecated,
- },
- ));
- }
- } else {
- logictypes.push((
- name.to_string(),
- EnumVariant {
- aliases: Vec::new(),
- value: val,
- deprecated,
- },
- ));
- }
- }
-
- let mut slotlogictypes: Vec<(String, EnumVariant)> = Vec::new();
- let sl_infile = Path::new("data/slotlogictypes.txt");
- let sl_contents = fs::read_to_string(sl_infile).unwrap();
-
- for line in sl_contents.lines().filter(|l| !l.trim().is_empty()) {
- let mut it = line.splitn(3, ' ');
- let name = it.next().unwrap();
- let val_str = it.next().unwrap();
- let val: Option = val_str.parse().ok();
- let docs = it.next();
- let deprecated = docs
- .map(|docs| docs.trim().to_uppercase() == "DEPRECATED")
- .unwrap_or(false);
-
- if let Some(val) = val {
- if let Some((_other_name, variant)) = slotlogictypes
- .iter_mut()
- .find(|(_, variant)| variant.value == Some(val))
- {
- variant.aliases.push(name.to_string());
- variant.deprecated = deprecated;
- } else {
- slotlogictypes.push((
- name.to_string(),
- EnumVariant {
- aliases: Vec::new(),
- value: Some(val),
- deprecated,
- },
- ));
- }
- } else {
- slotlogictypes.push((
- name.to_string(),
- EnumVariant {
- aliases: Vec::new(),
- value: val,
- deprecated,
- },
- ));
- }
- }
-
- write_repr_enum(&mut writer, "LogicType", &logictypes, true);
-
- println!("cargo:rerun-if-changed=data/logictypes.txt");
-
- write_repr_enum(&mut writer, "SlotLogicType", &slotlogictypes, true);
-
- println!("cargo:rerun-if-changed=data/slotlogictypes.txt");
-}
-
-fn write_enums() {
- let out_dir = env::var_os("OUT_DIR").unwrap();
-
- let dest_path = Path::new(&out_dir).join("enums.rs");
- let output_file = File::create(dest_path).unwrap();
- let mut writer = BufWriter::new(&output_file);
-
- let mut enums_map: Vec<(String, EnumVariant)> = Vec::new();
- let e_infile = Path::new("data/enums.txt");
- let e_contents = fs::read_to_string(e_infile).unwrap();
-
- for line in e_contents.lines().filter(|l| !l.trim().is_empty()) {
- let mut it = line.splitn(3, ' ');
- let name = it.next().unwrap();
- let val_str = it.next().unwrap();
- let val: Option = val_str.parse().ok();
- let docs = it.next();
- let deprecated = docs
- .map(|docs| docs.trim().to_uppercase() == "DEPRECATED")
- .unwrap_or(false);
-
- enums_map.push((
- name.to_string(),
- EnumVariant {
- aliases: Vec::new(),
- value: val,
- deprecated,
- },
- ));
- }
-
- write_repr_enum(&mut writer, "LogicEnums", &enums_map, true);
-
- println!("cargo:rerun-if-changed=data/enums.txt");
-}
-
-fn write_modes() {
- let out_dir = env::var_os("OUT_DIR").unwrap();
-
- let dest_path = Path::new(&out_dir).join("modes.rs");
- let output_file = File::create(dest_path).unwrap();
- let mut writer = BufWriter::new(&output_file);
-
- let mut batchmodes: Vec<(String, EnumVariant)> = Vec::new();
- let b_infile = Path::new("data/batchmodes.txt");
- let b_contents = fs::read_to_string(b_infile).unwrap();
-
- for line in b_contents.lines().filter(|l| !l.trim().is_empty()) {
- let mut it = line.splitn(3, ' ');
- let name = it.next().unwrap();
- let val_str = it.next().unwrap();
- let val: Option = val_str.parse().ok();
-
- if let Some(val) = val {
- if let Some((_other_name, variant)) = batchmodes
- .iter_mut()
- .find(|(_, variant)| variant.value == Some(val))
- {
- variant.aliases.push(name.to_string());
- } else {
- batchmodes.push((
- name.to_string(),
- EnumVariant {
- aliases: Vec::new(),
- value: Some(val),
- deprecated: false,
- },
- ));
- }
- } else {
- batchmodes.push((
- name.to_string(),
- EnumVariant {
- aliases: Vec::new(),
- value: val,
- deprecated: false,
- },
- ));
- }
- }
-
- let mut reagentmodes: Vec<(String, EnumVariant)> = Vec::new();
- let r_infile = Path::new("data/reagentmodes.txt");
- let r_contents = fs::read_to_string(r_infile).unwrap();
-
- for line in r_contents.lines().filter(|l| !l.trim().is_empty()) {
- let mut it = line.splitn(3, ' ');
- let name = it.next().unwrap();
- let val_str = it.next().unwrap();
- let val: Option = val_str.parse().ok();
-
- if let Some(val) = val {
- if let Some((_other_name, variant)) = reagentmodes
- .iter_mut()
- .find(|(_, variant)| variant.value == Some(val))
- {
- variant.aliases.push(name.to_string());
- } else {
- reagentmodes.push((
- name.to_string(),
- EnumVariant {
- aliases: Vec::new(),
- value: Some(val),
- deprecated: false,
- },
- ));
- }
- } else {
- reagentmodes.push((
- name.to_string(),
- EnumVariant {
- aliases: Vec::new(),
- value: val,
- deprecated: false,
- },
- ));
- }
- }
-
- write_repr_enum(&mut writer, "BatchMode", &batchmodes, false);
-
- println!("cargo:rerun-if-changed=data/batchmodes.txt");
-
- write_repr_enum(&mut writer, "ReagentMode", &reagentmodes, false);
-
- println!("cargo:rerun-if-changed=data/reagentmodes.txt");
-}
-
-fn write_constants() {
- let out_dir = env::var_os("OUT_DIR").unwrap();
-
- let dest_path = Path::new(&out_dir).join("constants.rs");
- let output_file = File::create(dest_path).unwrap();
- let mut writer = BufWriter::new(&output_file);
-
- let mut constants_lookup_map_builder = ::phf_codegen::Map::new();
- let infile = Path::new("data/constants.txt");
- let contents = fs::read_to_string(infile).unwrap();
-
- for line in contents.lines().filter(|l| !l.trim().is_empty()) {
- let mut it = line.splitn(3, ' ');
- let name = it.next().unwrap();
- let constant = it.next().unwrap();
-
- constants_lookup_map_builder.entry(name, constant);
- }
-
- writeln!(
- &mut writer,
- "#[allow(clippy::approx_constant)] pub(crate) const CONSTANTS_LOOKUP: phf::Map<&'static str, f64> = {};",
- constants_lookup_map_builder.build()
- )
- .unwrap();
- println!("cargo:rerun-if-changed=data/constants.txt");
-}
-
-fn write_instructions_enum() {
- let out_dir = env::var_os("OUT_DIR").unwrap();
-
- let dest_path = Path::new(&out_dir).join("instructions.rs");
- let output_file = File::create(dest_path).unwrap();
- let mut writer = BufWriter::new(&output_file);
-
- let mut instructions = BTreeSet::new();
- let infile = Path::new("data/instructions.txt");
- let contents = fs::read_to_string(infile).unwrap();
-
- for line in contents.lines() {
- let mut it = line.split(' ');
- let instruction = it.next().unwrap();
- instructions.insert(instruction.to_string());
- }
-
- write!(
- &mut writer,
- "#[derive(Debug, Display, PartialEq, Eq, Clone, Copy, Serialize, Deserialize)]\n\
- pub enum InstructionOp {{\n\
- "
- )
- .unwrap();
-
- writeln!(&mut writer, " Nop,").unwrap();
-
- for typ in &instructions {
- writeln!(&mut writer, " {},", typ.to_case(Case::Pascal)).unwrap();
- }
- writeln!(&mut writer, "}}").unwrap();
-
- write!(
- &mut writer,
- "impl FromStr for InstructionOp {{\n \
- type Err = ParseError;\n \
- fn from_str(s: &str) -> Result {{\n \
- let end = s.len();\n \
- match s {{\n"
- )
- .unwrap();
-
- for typ in &instructions {
- let name = typ.to_case(Case::Pascal);
- writeln!(&mut writer, " \"{typ}\" => Ok(Self::{name}),").unwrap();
- }
- write!(
- &mut writer,
- " _ => Err(crate::grammar::ParseError {{ line: 0, start: 0, end, msg: format!(\"Unknown instruction '{{}}'\", s) }})\n \
- }}\n \
- }}\n\
- }}"
- )
- .unwrap();
-
- println!("cargo:rerun-if-changed=data/instructions.txt");
-}
-
-fn main() {
- // write_instructions();
- write_logictypes();
- write_modes();
- write_constants();
- write_enums();
-
- write_instructions_enum();
-}
diff --git a/ic10emu/data/Enums.json b/ic10emu/data/Enums.json
deleted file mode 100644
index 2cbd544..0000000
--- a/ic10emu/data/Enums.json
+++ /dev/null
@@ -1 +0,0 @@
-{"LogicType":{"None":0,"Power":1,"Open":2,"Mode":3,"Error":4,"Pressure":5,"Temperature":6,"PressureExternal":7,"PressureInternal":8,"Activate":9,"Lock":10,"Charge":11,"Setting":12,"Reagents":13,"RatioOxygen":14,"RatioCarbonDioxide":15,"RatioNitrogen":16,"RatioPollutant":17,"RatioVolatiles":18,"RatioWater":19,"Horizontal":20,"Vertical":21,"SolarAngle":22,"Maximum":23,"Ratio":24,"PowerPotential":25,"PowerActual":26,"Quantity":27,"On":28,"ImportQuantity":29,"ImportSlotOccupant":30,"ExportQuantity":31,"ExportSlotOccupant":32,"RequiredPower":33,"HorizontalRatio":34,"VerticalRatio":35,"PowerRequired":36,"Idle":37,"Color":38,"ElevatorSpeed":39,"ElevatorLevel":40,"RecipeHash":41,"ExportSlotHash":42,"ImportSlotHash":43,"PlantHealth1":44,"PlantHealth2":45,"PlantHealth3":46,"PlantHealth4":47,"PlantGrowth1":48,"PlantGrowth2":49,"PlantGrowth3":50,"PlantGrowth4":51,"PlantEfficiency1":52,"PlantEfficiency2":53,"PlantEfficiency3":54,"PlantEfficiency4":55,"PlantHash1":56,"PlantHash2":57,"PlantHash3":58,"PlantHash4":59,"RequestHash":60,"CompletionRatio":61,"ClearMemory":62,"ExportCount":63,"ImportCount":64,"PowerGeneration":65,"TotalMoles":66,"Volume":67,"Plant":68,"Harvest":69,"Output":70,"PressureSetting":71,"TemperatureSetting":72,"TemperatureExternal":73,"Filtration":74,"AirRelease":75,"PositionX":76,"PositionY":77,"PositionZ":78,"VelocityMagnitude":79,"VelocityRelativeX":80,"VelocityRelativeY":81,"VelocityRelativeZ":82,"RatioNitrousOxide":83,"PrefabHash":84,"ForceWrite":85,"SignalStrength":86,"SignalID":87,"TargetX":88,"TargetY":89,"TargetZ":90,"SettingInput":91,"SettingOutput":92,"CurrentResearchPodType":93,"ManualResearchRequiredPod":94,"MineablesInVicinity":95,"MineablesInQueue":96,"NextWeatherEventTime":97,"Combustion":98,"Fuel":99,"ReturnFuelCost":100,"CollectableGoods":101,"Time":102,"Bpm":103,"EnvironmentEfficiency":104,"WorkingGasEfficiency":105,"PressureInput":106,"TemperatureInput":107,"RatioOxygenInput":108,"RatioCarbonDioxideInput":109,"RatioNitrogenInput":110,"RatioPollutantInput":111,"RatioVolatilesInput":112,"RatioWaterInput":113,"RatioNitrousOxideInput":114,"TotalMolesInput":115,"PressureInput2":116,"TemperatureInput2":117,"RatioOxygenInput2":118,"RatioCarbonDioxideInput2":119,"RatioNitrogenInput2":120,"RatioPollutantInput2":121,"RatioVolatilesInput2":122,"RatioWaterInput2":123,"RatioNitrousOxideInput2":124,"TotalMolesInput2":125,"PressureOutput":126,"TemperatureOutput":127,"RatioOxygenOutput":128,"RatioCarbonDioxideOutput":129,"RatioNitrogenOutput":130,"RatioPollutantOutput":131,"RatioVolatilesOutput":132,"RatioWaterOutput":133,"RatioNitrousOxideOutput":134,"TotalMolesOutput":135,"PressureOutput2":136,"TemperatureOutput2":137,"RatioOxygenOutput2":138,"RatioCarbonDioxideOutput2":139,"RatioNitrogenOutput2":140,"RatioPollutantOutput2":141,"RatioVolatilesOutput2":142,"RatioWaterOutput2":143,"RatioNitrousOxideOutput2":144,"TotalMolesOutput2":145,"CombustionInput":146,"CombustionInput2":147,"CombustionOutput":148,"CombustionOutput2":149,"OperationalTemperatureEfficiency":150,"TemperatureDifferentialEfficiency":151,"PressureEfficiency":152,"CombustionLimiter":153,"Throttle":154,"Rpm":155,"Stress":156,"InterrogationProgress":157,"TargetPadIndex":158,"SizeX":160,"SizeY":161,"SizeZ":162,"MinimumWattsToContact":163,"WattsReachingContact":164,"Channel0":165,"Channel1":166,"Channel2":167,"Channel3":168,"Channel4":169,"Channel5":170,"Channel6":171,"Channel7":172,"LineNumber":173,"Flush":174,"SoundAlert":175,"SolarIrradiance":176,"RatioLiquidNitrogen":177,"RatioLiquidNitrogenInput":178,"RatioLiquidNitrogenInput2":179,"RatioLiquidNitrogenOutput":180,"RatioLiquidNitrogenOutput2":181,"VolumeOfLiquid":182,"RatioLiquidOxygen":183,"RatioLiquidOxygenInput":184,"RatioLiquidOxygenInput2":185,"RatioLiquidOxygenOutput":186,"RatioLiquidOxygenOutput2":187,"RatioLiquidVolatiles":188,"RatioLiquidVolatilesInput":189,"RatioLiquidVolatilesInput2":190,"RatioLiquidVolatilesOutput":191,"RatioLiquidVolatilesOutput2":192,"RatioSteam":193,"RatioSteamInput":194,"RatioSteamInput2":195,"RatioSteamOutput":196,"RatioSteamOutput2":197,"ContactTypeId":198,"RatioLiquidCarbonDioxide":199,"RatioLiquidCarbonDioxideInput":200,"RatioLiquidCarbonDioxideInput2":201,"RatioLiquidCarbonDioxideOutput":202,"RatioLiquidCarbonDioxideOutput2":203,"RatioLiquidPollutant":204,"RatioLiquidPollutantInput":205,"RatioLiquidPollutantInput2":206,"RatioLiquidPollutantOutput":207,"RatioLiquidPollutantOutput2":208,"RatioLiquidNitrousOxide":209,"RatioLiquidNitrousOxideInput":210,"RatioLiquidNitrousOxideInput2":211,"RatioLiquidNitrousOxideOutput":212,"RatioLiquidNitrousOxideOutput2":213,"Progress":214,"DestinationCode":215,"Acceleration":216,"ReferenceId":217,"AutoShutOff":218,"Mass":219,"DryMass":220,"Thrust":221,"Weight":222,"ThrustToWeight":223,"TimeToDestination":224,"BurnTimeRemaining":225,"AutoLand":226,"ForwardX":227,"ForwardY":228,"ForwardZ":229,"Orientation":230,"VelocityX":231,"VelocityY":232,"VelocityZ":233,"PassedMoles":234,"ExhaustVelocity":235,"FlightControlRule":236,"ReEntryAltitude":237,"Apex":238,"EntityState":239,"DrillCondition":240,"Index":241,"CelestialHash":242,"AlignmentError":243,"DistanceAu":244,"OrbitPeriod":245,"Inclination":246,"Eccentricity":247,"SemiMajorAxis":248,"DistanceKm":249,"CelestialParentHash":250,"TrueAnomaly":251,"RatioHydrogen":252,"RatioLiquidHydrogen":253,"RatioPollutedWater":254,"Discover":255,"Chart":256,"Survey":257,"NavPoints":258,"ChartedNavPoints":259,"Sites":260,"CurrentCode":261,"Density":262,"Richness":263,"Size":264,"TotalQuantity":265,"MinedQuantity":266},"LogicSlotType":{"None":0,"Occupied":1,"OccupantHash":2,"Quantity":3,"Damage":4,"Efficiency":5,"Health":6,"Growth":7,"Pressure":8,"Temperature":9,"Charge":10,"ChargeRatio":11,"Class":12,"PressureWaste":13,"PressureAir":14,"MaxQuantity":15,"Mature":16,"PrefabHash":17,"Seeding":18,"LineNumber":19,"Volume":20,"Open":21,"On":22,"Lock":23,"SortingClass":24,"FilterType":25,"ReferenceId":26},"LogicBatchMethod":{"Average":0,"Sum":1,"Minimum":2,"Maximum":3},"LogicReagentMode":{"Contents":0,"Required":1,"Recipe":2,"TotalContents":3},"Enums":{"LogicType.None":0,"LogicType.Power":1,"LogicType.Open":2,"LogicType.Mode":3,"LogicType.Error":4,"LogicType.Pressure":5,"LogicType.Temperature":6,"LogicType.PressureExternal":7,"LogicType.PressureInternal":8,"LogicType.Activate":9,"LogicType.Lock":10,"LogicType.Charge":11,"LogicType.Setting":12,"LogicType.Reagents":13,"LogicType.RatioOxygen":14,"LogicType.RatioCarbonDioxide":15,"LogicType.RatioNitrogen":16,"LogicType.RatioPollutant":17,"LogicType.RatioVolatiles":18,"LogicType.RatioWater":19,"LogicType.Horizontal":20,"LogicType.Vertical":21,"LogicType.SolarAngle":22,"LogicType.Maximum":23,"LogicType.Ratio":24,"LogicType.PowerPotential":25,"LogicType.PowerActual":26,"LogicType.Quantity":27,"LogicType.On":28,"LogicType.ImportQuantity":29,"LogicType.ImportSlotOccupant":30,"LogicType.ExportQuantity":31,"LogicType.ExportSlotOccupant":32,"LogicType.RequiredPower":33,"LogicType.HorizontalRatio":34,"LogicType.VerticalRatio":35,"LogicType.PowerRequired":36,"LogicType.Idle":37,"LogicType.Color":38,"LogicType.ElevatorSpeed":39,"LogicType.ElevatorLevel":40,"LogicType.RecipeHash":41,"LogicType.ExportSlotHash":42,"LogicType.ImportSlotHash":43,"LogicType.PlantHealth1":44,"LogicType.PlantHealth2":45,"LogicType.PlantHealth3":46,"LogicType.PlantHealth4":47,"LogicType.PlantGrowth1":48,"LogicType.PlantGrowth2":49,"LogicType.PlantGrowth3":50,"LogicType.PlantGrowth4":51,"LogicType.PlantEfficiency1":52,"LogicType.PlantEfficiency2":53,"LogicType.PlantEfficiency3":54,"LogicType.PlantEfficiency4":55,"LogicType.PlantHash1":56,"LogicType.PlantHash2":57,"LogicType.PlantHash3":58,"LogicType.PlantHash4":59,"LogicType.RequestHash":60,"LogicType.CompletionRatio":61,"LogicType.ClearMemory":62,"LogicType.ExportCount":63,"LogicType.ImportCount":64,"LogicType.PowerGeneration":65,"LogicType.TotalMoles":66,"LogicType.Volume":67,"LogicType.Plant":68,"LogicType.Harvest":69,"LogicType.Output":70,"LogicType.PressureSetting":71,"LogicType.TemperatureSetting":72,"LogicType.TemperatureExternal":73,"LogicType.Filtration":74,"LogicType.AirRelease":75,"LogicType.PositionX":76,"LogicType.PositionY":77,"LogicType.PositionZ":78,"LogicType.VelocityMagnitude":79,"LogicType.VelocityRelativeX":80,"LogicType.VelocityRelativeY":81,"LogicType.VelocityRelativeZ":82,"LogicType.RatioNitrousOxide":83,"LogicType.PrefabHash":84,"LogicType.ForceWrite":85,"LogicType.SignalStrength":86,"LogicType.SignalID":87,"LogicType.TargetX":88,"LogicType.TargetY":89,"LogicType.TargetZ":90,"LogicType.SettingInput":91,"LogicType.SettingOutput":92,"LogicType.CurrentResearchPodType":93,"LogicType.ManualResearchRequiredPod":94,"LogicType.MineablesInVicinity":95,"LogicType.MineablesInQueue":96,"LogicType.NextWeatherEventTime":97,"LogicType.Combustion":98,"LogicType.Fuel":99,"LogicType.ReturnFuelCost":100,"LogicType.CollectableGoods":101,"LogicType.Time":102,"LogicType.Bpm":103,"LogicType.EnvironmentEfficiency":104,"LogicType.WorkingGasEfficiency":105,"LogicType.PressureInput":106,"LogicType.TemperatureInput":107,"LogicType.RatioOxygenInput":108,"LogicType.RatioCarbonDioxideInput":109,"LogicType.RatioNitrogenInput":110,"LogicType.RatioPollutantInput":111,"LogicType.RatioVolatilesInput":112,"LogicType.RatioWaterInput":113,"LogicType.RatioNitrousOxideInput":114,"LogicType.TotalMolesInput":115,"LogicType.PressureInput2":116,"LogicType.TemperatureInput2":117,"LogicType.RatioOxygenInput2":118,"LogicType.RatioCarbonDioxideInput2":119,"LogicType.RatioNitrogenInput2":120,"LogicType.RatioPollutantInput2":121,"LogicType.RatioVolatilesInput2":122,"LogicType.RatioWaterInput2":123,"LogicType.RatioNitrousOxideInput2":124,"LogicType.TotalMolesInput2":125,"LogicType.PressureOutput":126,"LogicType.TemperatureOutput":127,"LogicType.RatioOxygenOutput":128,"LogicType.RatioCarbonDioxideOutput":129,"LogicType.RatioNitrogenOutput":130,"LogicType.RatioPollutantOutput":131,"LogicType.RatioVolatilesOutput":132,"LogicType.RatioWaterOutput":133,"LogicType.RatioNitrousOxideOutput":134,"LogicType.TotalMolesOutput":135,"LogicType.PressureOutput2":136,"LogicType.TemperatureOutput2":137,"LogicType.RatioOxygenOutput2":138,"LogicType.RatioCarbonDioxideOutput2":139,"LogicType.RatioNitrogenOutput2":140,"LogicType.RatioPollutantOutput2":141,"LogicType.RatioVolatilesOutput2":142,"LogicType.RatioWaterOutput2":143,"LogicType.RatioNitrousOxideOutput2":144,"LogicType.TotalMolesOutput2":145,"LogicType.CombustionInput":146,"LogicType.CombustionInput2":147,"LogicType.CombustionOutput":148,"LogicType.CombustionOutput2":149,"LogicType.OperationalTemperatureEfficiency":150,"LogicType.TemperatureDifferentialEfficiency":151,"LogicType.PressureEfficiency":152,"LogicType.CombustionLimiter":153,"LogicType.Throttle":154,"LogicType.Rpm":155,"LogicType.Stress":156,"LogicType.InterrogationProgress":157,"LogicType.TargetPadIndex":158,"LogicType.SizeX":160,"LogicType.SizeY":161,"LogicType.SizeZ":162,"LogicType.MinimumWattsToContact":163,"LogicType.WattsReachingContact":164,"LogicType.Channel0":165,"LogicType.Channel1":166,"LogicType.Channel2":167,"LogicType.Channel3":168,"LogicType.Channel4":169,"LogicType.Channel5":170,"LogicType.Channel6":171,"LogicType.Channel7":172,"LogicType.LineNumber":173,"LogicType.Flush":174,"LogicType.SoundAlert":175,"LogicType.SolarIrradiance":176,"LogicType.RatioLiquidNitrogen":177,"LogicType.RatioLiquidNitrogenInput":178,"LogicType.RatioLiquidNitrogenInput2":179,"LogicType.RatioLiquidNitrogenOutput":180,"LogicType.RatioLiquidNitrogenOutput2":181,"LogicType.VolumeOfLiquid":182,"LogicType.RatioLiquidOxygen":183,"LogicType.RatioLiquidOxygenInput":184,"LogicType.RatioLiquidOxygenInput2":185,"LogicType.RatioLiquidOxygenOutput":186,"LogicType.RatioLiquidOxygenOutput2":187,"LogicType.RatioLiquidVolatiles":188,"LogicType.RatioLiquidVolatilesInput":189,"LogicType.RatioLiquidVolatilesInput2":190,"LogicType.RatioLiquidVolatilesOutput":191,"LogicType.RatioLiquidVolatilesOutput2":192,"LogicType.RatioSteam":193,"LogicType.RatioSteamInput":194,"LogicType.RatioSteamInput2":195,"LogicType.RatioSteamOutput":196,"LogicType.RatioSteamOutput2":197,"LogicType.ContactTypeId":198,"LogicType.RatioLiquidCarbonDioxide":199,"LogicType.RatioLiquidCarbonDioxideInput":200,"LogicType.RatioLiquidCarbonDioxideInput2":201,"LogicType.RatioLiquidCarbonDioxideOutput":202,"LogicType.RatioLiquidCarbonDioxideOutput2":203,"LogicType.RatioLiquidPollutant":204,"LogicType.RatioLiquidPollutantInput":205,"LogicType.RatioLiquidPollutantInput2":206,"LogicType.RatioLiquidPollutantOutput":207,"LogicType.RatioLiquidPollutantOutput2":208,"LogicType.RatioLiquidNitrousOxide":209,"LogicType.RatioLiquidNitrousOxideInput":210,"LogicType.RatioLiquidNitrousOxideInput2":211,"LogicType.RatioLiquidNitrousOxideOutput":212,"LogicType.RatioLiquidNitrousOxideOutput2":213,"LogicType.Progress":214,"LogicType.DestinationCode":215,"LogicType.Acceleration":216,"LogicType.ReferenceId":217,"LogicType.AutoShutOff":218,"LogicType.Mass":219,"LogicType.DryMass":220,"LogicType.Thrust":221,"LogicType.Weight":222,"LogicType.ThrustToWeight":223,"LogicType.TimeToDestination":224,"LogicType.BurnTimeRemaining":225,"LogicType.AutoLand":226,"LogicType.ForwardX":227,"LogicType.ForwardY":228,"LogicType.ForwardZ":229,"LogicType.Orientation":230,"LogicType.VelocityX":231,"LogicType.VelocityY":232,"LogicType.VelocityZ":233,"LogicType.PassedMoles":234,"LogicType.ExhaustVelocity":235,"LogicType.FlightControlRule":236,"LogicType.ReEntryAltitude":237,"LogicType.Apex":238,"LogicType.EntityState":239,"LogicType.DrillCondition":240,"LogicType.Index":241,"LogicType.CelestialHash":242,"LogicType.AlignmentError":243,"LogicType.DistanceAu":244,"LogicType.OrbitPeriod":245,"LogicType.Inclination":246,"LogicType.Eccentricity":247,"LogicType.SemiMajorAxis":248,"LogicType.DistanceKm":249,"LogicType.CelestialParentHash":250,"LogicType.TrueAnomaly":251,"LogicType.RatioHydrogen":252,"LogicType.RatioLiquidHydrogen":253,"LogicType.RatioPollutedWater":254,"LogicType.Discover":255,"LogicType.Chart":256,"LogicType.Survey":257,"LogicType.NavPoints":258,"LogicType.ChartedNavPoints":259,"LogicType.Sites":260,"LogicType.CurrentCode":261,"LogicType.Density":262,"LogicType.Richness":263,"LogicType.Size":264,"LogicType.TotalQuantity":265,"LogicType.MinedQuantity":266,"LogicSlotType.None":0,"LogicSlotType.Occupied":1,"LogicSlotType.OccupantHash":2,"LogicSlotType.Quantity":3,"LogicSlotType.Damage":4,"LogicSlotType.Efficiency":5,"LogicSlotType.Health":6,"LogicSlotType.Growth":7,"LogicSlotType.Pressure":8,"LogicSlotType.Temperature":9,"LogicSlotType.Charge":10,"LogicSlotType.ChargeRatio":11,"LogicSlotType.Class":12,"LogicSlotType.PressureWaste":13,"LogicSlotType.PressureAir":14,"LogicSlotType.MaxQuantity":15,"LogicSlotType.Mature":16,"LogicSlotType.PrefabHash":17,"LogicSlotType.Seeding":18,"LogicSlotType.LineNumber":19,"LogicSlotType.Volume":20,"LogicSlotType.Open":21,"LogicSlotType.On":22,"LogicSlotType.Lock":23,"LogicSlotType.SortingClass":24,"LogicSlotType.FilterType":25,"LogicSlotType.ReferenceId":26,"Sound.None":0,"Sound.Alarm2":1,"Sound.Alarm3":2,"Sound.Alarm4":3,"Sound.Alarm5":4,"Sound.Alarm6":5,"Sound.Alarm7":6,"Sound.Music1":7,"Sound.Music2":8,"Sound.Music3":9,"Sound.Alarm8":10,"Sound.Alarm9":11,"Sound.Alarm10":12,"Sound.Alarm11":13,"Sound.Alarm12":14,"Sound.Danger":15,"Sound.Warning":16,"Sound.Alert":17,"Sound.StormIncoming":18,"Sound.IntruderAlert":19,"Sound.Depressurising":20,"Sound.Pressurising":21,"Sound.AirlockCycling":22,"Sound.PowerLow":23,"Sound.SystemFailure":24,"Sound.Welcome":25,"Sound.MalfunctionDetected":26,"Sound.HaltWhoGoesThere":27,"Sound.FireFireFire":28,"Sound.One":29,"Sound.Two":30,"Sound.Three":31,"Sound.Four":32,"Sound.Five":33,"Sound.Floor":34,"Sound.RocketLaunching":35,"Sound.LiftOff":36,"Sound.TraderIncoming":37,"Sound.TraderLanded":38,"Sound.PressureHigh":39,"Sound.PressureLow":40,"Sound.TemperatureHigh":41,"Sound.TemperatureLow":42,"Sound.PollutantsDetected":43,"Sound.HighCarbonDioxide":44,"Sound.Alarm1":45,"TransmitterMode.Passive":0,"TransmitterMode.Active":1,"ElevatorMode.Stationary":0,"ElevatorMode.Upward":1,"ElevatorMode.Downward":2,"Color.Blue":0,"Color.Gray":1,"Color.Green":2,"Color.Orange":3,"Color.Red":4,"Color.Yellow":5,"Color.White":6,"Color.Black":7,"Color.Brown":8,"Color.Khaki":9,"Color.Pink":10,"Color.Purple":11,"EntityState.Alive":0,"EntityState.Dead":1,"EntityState.Unconscious":2,"EntityState.Decay":3,"AirControl.None":0,"AirControl.Offline":1,"AirControl.Pressure":2,"AirControl.Draught":4,"DaylightSensorMode.Default":0,"DaylightSensorMode.Horizontal":1,"DaylightSensorMode.Vertical":2,"Equals":0,"Greater":1,"Less":2,"NotEquals":3,"AirCon.Cold":0,"AirCon.Hot":1,"Vent.Outward":0,"Vent.Inward":1,"PowerMode.Idle":0,"PowerMode.Discharged":1,"PowerMode.Discharging":2,"PowerMode.Charging":3,"PowerMode.Charged":4,"RobotMode.None":0,"RobotMode.Follow":1,"RobotMode.MoveToTarget":2,"RobotMode.Roam":3,"RobotMode.Unload":4,"RobotMode.PathToTarget":5,"RobotMode.StorageFull":6,"SortingClass.Default":0,"SortingClass.Kits":1,"SortingClass.Tools":2,"SortingClass.Resources":3,"SortingClass.Food":4,"SortingClass.Clothing":5,"SortingClass.Appliances":6,"SortingClass.Atmospherics":7,"SortingClass.Storage":8,"SortingClass.Ores":9,"SortingClass.Ices":10,"SlotClass.None":0,"SlotClass.Helmet":1,"SlotClass.Suit":2,"SlotClass.Back":3,"SlotClass.GasFilter":4,"SlotClass.GasCanister":5,"SlotClass.Motherboard":6,"SlotClass.Circuitboard":7,"SlotClass.DataDisk":8,"SlotClass.Organ":9,"SlotClass.Ore":10,"SlotClass.Plant":11,"SlotClass.Uniform":12,"SlotClass.Entity":13,"SlotClass.Battery":14,"SlotClass.Egg":15,"SlotClass.Belt":16,"SlotClass.Tool":17,"SlotClass.Appliance":18,"SlotClass.Ingot":19,"SlotClass.Torpedo":20,"SlotClass.Cartridge":21,"SlotClass.AccessCard":22,"SlotClass.Magazine":23,"SlotClass.Circuit":24,"SlotClass.Bottle":25,"SlotClass.ProgrammableChip":26,"SlotClass.Glasses":27,"SlotClass.CreditCard":28,"SlotClass.DirtCanister":29,"SlotClass.SensorProcessingUnit":30,"SlotClass.LiquidCanister":31,"SlotClass.LiquidBottle":32,"SlotClass.Wreckage":33,"SlotClass.SoundCartridge":34,"SlotClass.DrillHead":35,"SlotClass.ScanningHead":36,"SlotClass.Flare":37,"SlotClass.Blocked":38,"GasType.Undefined":0,"GasType.Oxygen":1,"GasType.Nitrogen":2,"GasType.CarbonDioxide":4,"GasType.Volatiles":8,"GasType.Pollutant":16,"GasType.Water":32,"GasType.NitrousOxide":64,"GasType.LiquidNitrogen":128,"GasType.LiquidOxygen":256,"GasType.LiquidVolatiles":512,"GasType.Steam":1024,"GasType.LiquidCarbonDioxide":2048,"GasType.LiquidPollutant":4096,"GasType.LiquidNitrousOxide":8192,"GasType.Hydrogen":16384,"GasType.LiquidHydrogen":32768,"GasType.PollutedWater":65536}}
\ No newline at end of file
diff --git a/ic10emu/data/batchmodes.txt b/ic10emu/data/batchmodes.txt
deleted file mode 100644
index b57b772..0000000
--- a/ic10emu/data/batchmodes.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Average 0 Average of all read values
-Maximum 3 Highest of all read values
-Minimum 2 Lowest of all read values
-Sum 1 All read values added together
diff --git a/ic10emu/data/constants.txt b/ic10emu/data/constants.txt
deleted file mode 100644
index 3dfa33d..0000000
--- a/ic10emu/data/constants.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-nan f64::NAN A constant representing 'not a number'. This constants technically provides a 'quiet' NaN, a signal NaN from some instructions will result in an exception and halt execution
-pinf f64::INFINITY A constant representing a positive infinite value
-ninf f64::NEG_INFINITY A constant representing a negative infinite value
-pi 3.141592653589793f64 \nA constant representing the ratio of the circumference of a circle to its diameter, provided in double percision
-deg2rad 0.0174532923847437f64 \nDegrees to radians conversion constant
-rad2deg 57.2957801818848f64 \nRadians to degrees conversion constant
-epsilon f64::EPSILON A constant representing the smallest value representable in double precision
diff --git a/ic10emu/data/enums.txt b/ic10emu/data/enums.txt
deleted file mode 100644
index 46ef9b3..0000000
--- a/ic10emu/data/enums.txt
+++ /dev/null
@@ -1,455 +0,0 @@
-AirCon.Cold 0
-AirCon.Hot 1
-AirControl.Draught 4
-AirControl.None 0
-AirControl.Offline 1
-AirControl.Pressure 2
-Color.Black 7 Black
-Color.Blue 0 Blue
-Color.Brown 8 Brown
-Color.Gray 1 Gray
-Color.Green 2 Green
-Color.Khaki 9 Khaki
-Color.Orange 3 Orange
-Color.Pink 10 Pink
-Color.Purple 11 Purple
-Color.Red 4 Red
-Color.White 6 White
-Color.Yellow 5 Yellow
-DaylightSensorMode.Default 0
-DaylightSensorMode.Horizontal 1
-DaylightSensorMode.Vertical 2
-ElevatorMode.Downward 2
-ElevatorMode.Stationary 0
-ElevatorMode.Upward 1
-EntityState.Alive 0
-EntityState.Dead 1
-EntityState.Decay 3
-EntityState.Unconscious 2
-Equals 0
-GasType.CarbonDioxide 4
-GasType.Hydrogen 16384
-GasType.LiquidCarbonDioxide 2048
-GasType.LiquidHydrogen 32768
-GasType.LiquidNitrogen 128
-GasType.LiquidNitrousOxide 8192
-GasType.LiquidOxygen 256
-GasType.LiquidPollutant 4096
-GasType.LiquidVolatiles 512
-GasType.Nitrogen 2
-GasType.NitrousOxide 64
-GasType.Oxygen 1
-GasType.Pollutant 16
-GasType.PollutedWater 65536
-GasType.Steam 1024
-GasType.Undefined 0
-GasType.Volatiles 8
-GasType.Water 32
-Greater 1
-Less 2
-LogicSlotType.Charge 10 returns current energy charge the slot occupant is holding
-LogicSlotType.ChargeRatio 11 returns current energy charge the slot occupant is holding as a ratio between 0 and 1 of its maximum
-LogicSlotType.Class 12 returns integer representing the class of object
-LogicSlotType.Damage 4 returns the damage state of the item in the slot
-LogicSlotType.Efficiency 5 returns the growth efficiency of the plant in the slot
-LogicSlotType.FilterType 25
-LogicSlotType.Growth 7 returns the current growth state of the plant in the slot
-LogicSlotType.Health 6 returns the health of the plant in the slot
-LogicSlotType.LineNumber 19
-LogicSlotType.Lock 23
-LogicSlotType.Mature 16 returns 1 if the plant in this slot is mature, 0 when it isn't
-LogicSlotType.MaxQuantity 15 returns the max stack size of the item in the slot
-LogicSlotType.None 0 No description
-LogicSlotType.OccupantHash 2 returns the has of the current occupant, the unique identifier of the thing
-LogicSlotType.Occupied 1 returns 0 when slot is not occupied, 1 when it is
-LogicSlotType.On 22
-LogicSlotType.Open 21
-LogicSlotType.PrefabHash 17 returns the hash of the structure in the slot
-LogicSlotType.Pressure 8 returns pressure of the slot occupants internal atmosphere
-LogicSlotType.PressureAir 14 returns pressure in the air tank of the jetpack in this slot
-LogicSlotType.PressureWaste 13 returns pressure in the waste tank of the jetpack in this slot
-LogicSlotType.Quantity 3 returns the current quantity, such as stack size, of the item in the slot
-LogicSlotType.ReferenceId 26
-LogicSlotType.Seeding 18 Whether a plant is seeding (ready to harvest seeds from). Returns 1 if seeding or 0 if not.
-LogicSlotType.SortingClass 24
-LogicSlotType.Temperature 9 returns temperature of the slot occupants internal atmosphere
-LogicSlotType.Volume 20
-LogicType.Acceleration 216 Change in velocity. Rockets that are deccelerating when landing will show this as negative value.
-LogicType.Activate 9 1 if device is activated (usually means running), otherwise 0
-LogicType.AirRelease 75 The current state of the air release system, for example AirRelease = 1 for a Hardsuit sets Air Release to On
-LogicType.AlignmentError 243
-LogicType.Apex 238
-LogicType.AutoLand 226 Engages the automatic landing algorithm. The rocket will automatically throttle and turn on and off its engines to achieve a smooth landing.
-LogicType.AutoShutOff 218 Turns off all devices in the rocket upon reaching destination
-LogicType.Bpm 103 Bpm
-LogicType.BurnTimeRemaining 225 Estimated time in seconds until fuel is depleted. Calculated based on current fuel usage.
-LogicType.CelestialHash 242
-LogicType.CelestialParentHash 250
-LogicType.Channel0 165
-LogicType.Channel1 166
-LogicType.Channel2 167
-LogicType.Channel3 168
-LogicType.Channel4 169
-LogicType.Channel5 170
-LogicType.Channel6 171
-LogicType.Channel7 172
-LogicType.Charge 11 The current charge the device has
-LogicType.Chart 256
-LogicType.ChartedNavPoints 259
-LogicType.ClearMemory 62 When set to 1, clears the counter memory (e.g. ExportCount). Will set itself back to 0 when actioned
-LogicType.CollectableGoods 101
-LogicType.Color 38 \n Whether driven by concerns for clarity, safety or simple aesthetics, {LINK:Stationeers;Stationeers} have access to a small rainbow of colors for their constructions. These are the color setting for devices, represented as an integer.\n\n0: Blue\n1: Grey\n2: Green\n3: Orange\n4: Red\n5: Yellow\n6: White\n7: Black\n8: Brown\n9: Khaki\n10: Pink\n11: Purple\n\n It is an unwavering universal law that anything higher than 11 will be purple. The {LINK:ODA;ODA} is powerless to change this. Similarly, anything lower than 0 will be Blue.\n
-LogicType.Combustion 98 The assess atmosphere is on fire. Returns 1 if atmosphere is on fire, 0 if not.
-LogicType.CombustionInput 146 The assess atmosphere is on fire. Returns 1 if device's input network is on fire, 0 if not.
-LogicType.CombustionInput2 147 The assess atmosphere is on fire. Returns 1 if device's Input2 network is on fire, 0 if not.
-LogicType.CombustionLimiter 153 Retards the rate of combustion inside the machine (range: 0-100), with 0 being the slowest rate of combustion and 100 being the fastest
-LogicType.CombustionOutput 148 The assess atmosphere is on fire. Returns 1 if device's Output network is on fire, 0 if not.
-LogicType.CombustionOutput2 149 The assess atmosphere is on fire. Returns 1 if device's Output2 network is on fire, 0 if not.
-LogicType.CompletionRatio 61 How complete the current production is for this device, between 0 and 1
-LogicType.ContactTypeId 198 The type id of the contact.
-LogicType.CurrentCode 261
-LogicType.CurrentResearchPodType 93
-LogicType.Density 262
-LogicType.DestinationCode 215 Unique identifier code for a destination on the space map.
-LogicType.Discover 255
-LogicType.DistanceAu 244
-LogicType.DistanceKm 249
-LogicType.DrillCondition 240
-LogicType.DryMass 220 The Mass in kilograms of the rocket excluding fuel. The more massive the rocket the more fuel will be required to move to a new location in space.
-LogicType.Eccentricity 247
-LogicType.ElevatorLevel 40 Level the elevator is currently at
-LogicType.ElevatorSpeed 39 Current speed of the elevator
-LogicType.EntityState 239
-LogicType.EnvironmentEfficiency 104 The Environment Efficiency reported by the machine, as a float between 0 and 1
-LogicType.Error 4 1 if device is in error state, otherwise 0
-LogicType.ExhaustVelocity 235
-LogicType.ExportCount 63 How many items exported since last ClearMemory
-LogicType.ExportQuantity 31 Total quantity of items exported by the device
-LogicType.ExportSlotHash 42 DEPRECATED
-LogicType.ExportSlotOccupant 32 DEPRECATED
-LogicType.Filtration 74 The current state of the filtration system, for example Filtration = 1 for a Hardsuit sets filtration to On
-LogicType.FlightControlRule 236
-LogicType.Flush 174 Set to 1 to activate the flush function on the device
-LogicType.ForceWrite 85 Forces Logic Writer devices to rewrite value
-LogicType.ForwardX 227
-LogicType.ForwardY 228
-LogicType.ForwardZ 229
-LogicType.Fuel 99
-LogicType.Harvest 69 Performs the harvesting action for any plant based machinery
-LogicType.Horizontal 20 Horizontal setting of the device
-LogicType.HorizontalRatio 34 Radio of horizontal setting for device
-LogicType.Idle 37 Returns 1 if the device is currently idle, otherwise 0
-LogicType.ImportCount 64 How many items imported since last ClearMemory
-LogicType.ImportQuantity 29 Total quantity of items imported by the device
-LogicType.ImportSlotHash 43 DEPRECATED
-LogicType.ImportSlotOccupant 30 DEPRECATED
-LogicType.Inclination 246
-LogicType.Index 241
-LogicType.InterrogationProgress 157 Progress of this sattellite dish's interrogation of its current target, as a ratio from 0-1
-LogicType.LineNumber 173 The line number of current execution for an integrated circuit running on this device. While this number can be written, use with caution
-LogicType.Lock 10 1 if device is locked, otherwise 0, can be set in most devices and prevents the user from access the values
-LogicType.ManualResearchRequiredPod 94
-LogicType.Mass 219 The total Mass of the rocket in kilograms including fuel and cargo. The more massive the rocket the more fuel will be required to move to a new location in space.
-LogicType.Maximum 23 Maximum setting of the device
-LogicType.MineablesInQueue 96
-LogicType.MineablesInVicinity 95
-LogicType.MinedQuantity 266
-LogicType.MinimumWattsToContact 163
-LogicType.Mode 3 Integer for mode state, different devices will have different mode states available to them
-LogicType.NavPoints 258
-LogicType.NextWeatherEventTime 97
-LogicType.None 0 No description
-LogicType.On 28 The current state of the device, 0 for off, 1 for on
-LogicType.Open 2 1 if device is open, otherwise 0
-LogicType.OperationalTemperatureEfficiency 150 How the input pipe's temperature effects the machines efficiency
-LogicType.OrbitPeriod 245
-LogicType.Orientation 230
-LogicType.Output 70 The output operation for a sort handling device, such as a stacker or sorter, when in logic mode the device will only action one repetition when set zero or above and then back to -1 and await further instructions
-LogicType.PassedMoles 234
-LogicType.Plant 68 Performs the planting action for any plant based machinery
-LogicType.PlantEfficiency1 52 DEPRECATED
-LogicType.PlantEfficiency2 53 DEPRECATED
-LogicType.PlantEfficiency3 54 DEPRECATED
-LogicType.PlantEfficiency4 55 DEPRECATED
-LogicType.PlantGrowth1 48 DEPRECATED
-LogicType.PlantGrowth2 49 DEPRECATED
-LogicType.PlantGrowth3 50 DEPRECATED
-LogicType.PlantGrowth4 51 DEPRECATED
-LogicType.PlantHash1 56 DEPRECATED
-LogicType.PlantHash2 57 DEPRECATED
-LogicType.PlantHash3 58 DEPRECATED
-LogicType.PlantHash4 59 DEPRECATED
-LogicType.PlantHealth1 44 DEPRECATED
-LogicType.PlantHealth2 45 DEPRECATED
-LogicType.PlantHealth3 46 DEPRECATED
-LogicType.PlantHealth4 47 DEPRECATED
-LogicType.PositionX 76 The current position in X dimension in world coordinates
-LogicType.PositionY 77 The current position in Y dimension in world coordinates
-LogicType.PositionZ 78 The current position in Z dimension in world coordinates
-LogicType.Power 1 Can be read to return if the device is correctly powered or not, set via the power system, return 1 if powered and 0 if not
-LogicType.PowerActual 26 How much energy the device or network is actually using
-LogicType.PowerGeneration 65 Returns how much power is being generated
-LogicType.PowerPotential 25 How much energy the device or network potentially provides
-LogicType.PowerRequired 36 Power requested from the device and/or network
-LogicType.PrefabHash 84 The hash of the structure
-LogicType.Pressure 5 The current pressure reading of the device
-LogicType.PressureEfficiency 152 How the pressure of the input pipe and waste pipe effect the machines efficiency
-LogicType.PressureExternal 7 Setting for external pressure safety, in KPa
-LogicType.PressureInput 106 The current pressure reading of the device's Input Network
-LogicType.PressureInput2 116 The current pressure reading of the device's Input2 Network
-LogicType.PressureInternal 8 Setting for internal pressure safety, in KPa
-LogicType.PressureOutput 126 The current pressure reading of the device's Output Network
-LogicType.PressureOutput2 136 The current pressure reading of the device's Output2 Network
-LogicType.PressureSetting 71 The current setting for the internal pressure of the object (e.g. the Hardsuit Air release), in KPa
-LogicType.Progress 214 Progress of the rocket to the next node on the map expressed as a value between 0-1.
-LogicType.Quantity 27 Total quantity on the device
-LogicType.Ratio 24 Context specific value depending on device, 0 to 1 based ratio
-LogicType.RatioCarbonDioxide 15 The ratio of {GAS:CarbonDioxide} in device atmosphere
-LogicType.RatioCarbonDioxideInput 109 The ratio of {GAS:CarbonDioxide} in device's input network
-LogicType.RatioCarbonDioxideInput2 119 The ratio of {GAS:CarbonDioxide} in device's Input2 network
-LogicType.RatioCarbonDioxideOutput 129 The ratio of {GAS:CarbonDioxide} in device's Output network
-LogicType.RatioCarbonDioxideOutput2 139 The ratio of {GAS:CarbonDioxide} in device's Output2 network
-LogicType.RatioHydrogen 252 The ratio of {GAS:Hydrogen} in device's Atmopshere
-LogicType.RatioLiquidCarbonDioxide 199 The ratio of {GAS:LiquidCarbonDioxide} in device's Atmosphere
-LogicType.RatioLiquidCarbonDioxideInput 200 The ratio of {GAS:LiquidCarbonDioxide} in device's Input Atmosphere
-LogicType.RatioLiquidCarbonDioxideInput2 201 The ratio of {GAS:LiquidCarbonDioxide} in device's Input2 Atmosphere
-LogicType.RatioLiquidCarbonDioxideOutput 202 The ratio of {GAS:LiquidCarbonDioxide} in device's device's Output Atmosphere
-LogicType.RatioLiquidCarbonDioxideOutput2 203 The ratio of {GAS:LiquidCarbonDioxide} in device's Output2 Atmopshere
-LogicType.RatioLiquidHydrogen 253 The ratio of {GAS:LiquidHydrogen} in device's Atmopshere
-LogicType.RatioLiquidNitrogen 177 The ratio of {GAS:LiquidNitrogen} in device atmosphere
-LogicType.RatioLiquidNitrogenInput 178 The ratio of {GAS:LiquidNitrogen} in device's input network
-LogicType.RatioLiquidNitrogenInput2 179 The ratio of {GAS:LiquidNitrogen} in device's Input2 network
-LogicType.RatioLiquidNitrogenOutput 180 The ratio of {GAS:LiquidNitrogen} in device's Output network
-LogicType.RatioLiquidNitrogenOutput2 181 The ratio of {GAS:LiquidNitrogen} in device's Output2 network
-LogicType.RatioLiquidNitrousOxide 209 The ratio of {GAS:LiquidNitrousOxide} in device's Atmosphere
-LogicType.RatioLiquidNitrousOxideInput 210 The ratio of {GAS:LiquidNitrousOxide} in device's Input Atmosphere
-LogicType.RatioLiquidNitrousOxideInput2 211 The ratio of {GAS:LiquidNitrousOxide} in device's Input2 Atmosphere
-LogicType.RatioLiquidNitrousOxideOutput 212 The ratio of {GAS:LiquidNitrousOxide} in device's device's Output Atmosphere
-LogicType.RatioLiquidNitrousOxideOutput2 213 The ratio of {GAS:LiquidNitrousOxide} in device's Output2 Atmopshere
-LogicType.RatioLiquidOxygen 183 The ratio of {GAS:LiquidOxygen} in device's Atmosphere
-LogicType.RatioLiquidOxygenInput 184 The ratio of {GAS:LiquidOxygen} in device's Input Atmosphere
-LogicType.RatioLiquidOxygenInput2 185 The ratio of {GAS:LiquidOxygen} in device's Input2 Atmosphere
-LogicType.RatioLiquidOxygenOutput 186 The ratio of {GAS:LiquidOxygen} in device's device's Output Atmosphere
-LogicType.RatioLiquidOxygenOutput2 187 The ratio of {GAS:LiquidOxygen} in device's Output2 Atmopshere
-LogicType.RatioLiquidPollutant 204 The ratio of {GAS:LiquidPollutant} in device's Atmosphere
-LogicType.RatioLiquidPollutantInput 205 The ratio of {GAS:LiquidPollutant} in device's Input Atmosphere
-LogicType.RatioLiquidPollutantInput2 206 The ratio of {GAS:LiquidPollutant} in device's Input2 Atmosphere
-LogicType.RatioLiquidPollutantOutput 207 The ratio of {GAS:LiquidPollutant} in device's device's Output Atmosphere
-LogicType.RatioLiquidPollutantOutput2 208 The ratio of {GAS:LiquidPollutant} in device's Output2 Atmopshere
-LogicType.RatioLiquidVolatiles 188 The ratio of {GAS:LiquidVolatiles} in device's Atmosphere
-LogicType.RatioLiquidVolatilesInput 189 The ratio of {GAS:LiquidVolatiles} in device's Input Atmosphere
-LogicType.RatioLiquidVolatilesInput2 190 The ratio of {GAS:LiquidVolatiles} in device's Input2 Atmosphere
-LogicType.RatioLiquidVolatilesOutput 191 The ratio of {GAS:LiquidVolatiles} in device's device's Output Atmosphere
-LogicType.RatioLiquidVolatilesOutput2 192 The ratio of {GAS:LiquidVolatiles} in device's Output2 Atmopshere
-LogicType.RatioNitrogen 16 The ratio of nitrogen in device atmosphere
-LogicType.RatioNitrogenInput 110 The ratio of nitrogen in device's input network
-LogicType.RatioNitrogenInput2 120 The ratio of nitrogen in device's Input2 network
-LogicType.RatioNitrogenOutput 130 The ratio of nitrogen in device's Output network
-LogicType.RatioNitrogenOutput2 140 The ratio of nitrogen in device's Output2 network
-LogicType.RatioNitrousOxide 83 The ratio of {GAS:NitrousOxide} in device atmosphere
-LogicType.RatioNitrousOxideInput 114 The ratio of {GAS:NitrousOxide} in device's input network
-LogicType.RatioNitrousOxideInput2 124 The ratio of {GAS:NitrousOxide} in device's Input2 network
-LogicType.RatioNitrousOxideOutput 134 The ratio of {GAS:NitrousOxide} in device's Output network
-LogicType.RatioNitrousOxideOutput2 144 The ratio of {GAS:NitrousOxide} in device's Output2 network
-LogicType.RatioOxygen 14 The ratio of oxygen in device atmosphere
-LogicType.RatioOxygenInput 108 The ratio of oxygen in device's input network
-LogicType.RatioOxygenInput2 118 The ratio of oxygen in device's Input2 network
-LogicType.RatioOxygenOutput 128 The ratio of oxygen in device's Output network
-LogicType.RatioOxygenOutput2 138 The ratio of oxygen in device's Output2 network
-LogicType.RatioPollutant 17 The ratio of pollutant in device atmosphere
-LogicType.RatioPollutantInput 111 The ratio of pollutant in device's input network
-LogicType.RatioPollutantInput2 121 The ratio of pollutant in device's Input2 network
-LogicType.RatioPollutantOutput 131 The ratio of pollutant in device's Output network
-LogicType.RatioPollutantOutput2 141 The ratio of pollutant in device's Output2 network
-LogicType.RatioPollutedWater 254 The ratio of polluted water in device atmosphere
-LogicType.RatioSteam 193 The ratio of {GAS:Steam} in device's Atmosphere
-LogicType.RatioSteamInput 194 The ratio of {GAS:Steam} in device's Input Atmosphere
-LogicType.RatioSteamInput2 195 The ratio of {GAS:Steam} in device's Input2 Atmosphere
-LogicType.RatioSteamOutput 196 The ratio of {GAS:Steam} in device's device's Output Atmosphere
-LogicType.RatioSteamOutput2 197 The ratio of {GAS:Steam} in device's Output2 Atmopshere
-LogicType.RatioVolatiles 18 The ratio of volatiles in device atmosphere
-LogicType.RatioVolatilesInput 112 The ratio of volatiles in device's input network
-LogicType.RatioVolatilesInput2 122 The ratio of volatiles in device's Input2 network
-LogicType.RatioVolatilesOutput 132 The ratio of volatiles in device's Output network
-LogicType.RatioVolatilesOutput2 142 The ratio of volatiles in device's Output2 network
-LogicType.RatioWater 19 The ratio of water in device atmosphere
-LogicType.RatioWaterInput 113 The ratio of water in device's input network
-LogicType.RatioWaterInput2 123 The ratio of water in device's Input2 network
-LogicType.RatioWaterOutput 133 The ratio of water in device's Output network
-LogicType.RatioWaterOutput2 143 The ratio of water in device's Output2 network
-LogicType.ReEntryAltitude 237
-LogicType.Reagents 13 Total number of reagents recorded by the device
-LogicType.RecipeHash 41 Current hash of the recipe the device is set to produce
-LogicType.ReferenceId 217
-LogicType.RequestHash 60 When set to the unique identifier, requests an item of the provided type from the device
-LogicType.RequiredPower 33 Idle operating power quantity, does not necessarily include extra demand power
-LogicType.ReturnFuelCost 100
-LogicType.Richness 263
-LogicType.Rpm 155 The number of revolutions per minute that the device's spinning mechanism is doing
-LogicType.SemiMajorAxis 248
-LogicType.Setting 12 A variable setting that can be read or written, depending on the device
-LogicType.SettingInput 91
-LogicType.SettingOutput 92
-LogicType.SignalID 87 Returns the contact ID of the strongest signal from this Satellite
-LogicType.SignalStrength 86 Returns the degree offset of the strongest contact
-LogicType.Sites 260
-LogicType.Size 264
-LogicType.SizeX 160 Size on the X (right) axis of the object in largeGrids (a largeGrid is 2meters)
-LogicType.SizeY 161 Size on the Y(Up) axis of the object in largeGrids (a largeGrid is 2meters)
-LogicType.SizeZ 162 Size on the Z(Forward) axis of the object in largeGrids (a largeGrid is 2meters)
-LogicType.SolarAngle 22 Solar angle of the device
-LogicType.SolarIrradiance 176
-LogicType.SoundAlert 175 Plays a sound alert on the devices speaker
-LogicType.Stress 156 Machines get stressed when working hard. When Stress reaches 100 the machine will automatically shut down
-LogicType.Survey 257
-LogicType.TargetPadIndex 158 The index of the trader landing pad on this devices data network that it will try to call a trader in to land
-LogicType.TargetX 88 The target position in X dimension in world coordinates
-LogicType.TargetY 89 The target position in Y dimension in world coordinates
-LogicType.TargetZ 90 The target position in Z dimension in world coordinates
-LogicType.Temperature 6 The current temperature reading of the device
-LogicType.TemperatureDifferentialEfficiency 151 How the difference between the input pipe and waste pipe temperatures effect the machines efficiency
-LogicType.TemperatureExternal 73 The temperature of the outside of the device, usually the world atmosphere surrounding it
-LogicType.TemperatureInput 107 The current temperature reading of the device's Input Network
-LogicType.TemperatureInput2 117 The current temperature reading of the device's Input2 Network
-LogicType.TemperatureOutput 127 The current temperature reading of the device's Output Network
-LogicType.TemperatureOutput2 137 The current temperature reading of the device's Output2 Network
-LogicType.TemperatureSetting 72 The current setting for the internal temperature of the object (e.g. the Hardsuit A/C)
-LogicType.Throttle 154 Increases the rate at which the machine works (range: 0-100)
-LogicType.Thrust 221 Total current thrust of all rocket engines on the rocket in Newtons.
-LogicType.ThrustToWeight 223 Ratio of thrust to weight of rocket. Weight is effected by local body gravity. A rocket with a low thrust to weight will expend more fuel during launch and landing.
-LogicType.Time 102 Time
-LogicType.TimeToDestination 224 Estimated time in seconds until rocket arrives at target destination.
-LogicType.TotalMoles 66 Returns the total moles of the device
-LogicType.TotalMolesInput 115 Returns the total moles of the device's Input Network
-LogicType.TotalMolesInput2 125 Returns the total moles of the device's Input2 Network
-LogicType.TotalMolesOutput 135 Returns the total moles of the device's Output Network
-LogicType.TotalMolesOutput2 145 Returns the total moles of the device's Output2 Network
-LogicType.TotalQuantity 265
-LogicType.TrueAnomaly 251
-LogicType.VelocityMagnitude 79 The current magnitude of the velocity vector
-LogicType.VelocityRelativeX 80 The current velocity X relative to the forward vector of this
-LogicType.VelocityRelativeY 81 The current velocity Y relative to the forward vector of this
-LogicType.VelocityRelativeZ 82 The current velocity Z relative to the forward vector of this
-LogicType.VelocityX 231
-LogicType.VelocityY 232
-LogicType.VelocityZ 233
-LogicType.Vertical 21 Vertical setting of the device
-LogicType.VerticalRatio 35 Radio of vertical setting for device
-LogicType.Volume 67 Returns the device atmosphere volume
-LogicType.VolumeOfLiquid 182 The total volume of all liquids in Liters in the atmosphere
-LogicType.WattsReachingContact 164 The amount of watts actually hitting the contact. This is effected by the power of the dish and how far off-axis the dish is from the contact vector
-LogicType.Weight 222 Weight of Rocket in Newtons (Including fuel and cargo). Weight is effected by local body gravity.
-LogicType.WorkingGasEfficiency 105 The Working Gas Efficiency reported by the machine, as a float between 0 and 1
-NotEquals 3
-PowerMode.Charged 4
-PowerMode.Charging 3
-PowerMode.Discharged 1
-PowerMode.Discharging 2
-PowerMode.Idle 0
-RobotMode.Follow 1
-RobotMode.MoveToTarget 2
-RobotMode.None 0
-RobotMode.PathToTarget 5
-RobotMode.Roam 3
-RobotMode.StorageFull 6
-RobotMode.Unload 4
-SlotClass.AccessCard 22
-SlotClass.Appliance 18
-SlotClass.Back 3
-SlotClass.Battery 14
-SlotClass.Belt 16
-SlotClass.Blocked 38
-SlotClass.Bottle 25
-SlotClass.Cartridge 21
-SlotClass.Circuit 24
-SlotClass.Circuitboard 7
-SlotClass.CreditCard 28
-SlotClass.DataDisk 8
-SlotClass.DirtCanister 29
-SlotClass.DrillHead 35
-SlotClass.Egg 15
-SlotClass.Entity 13
-SlotClass.Flare 37
-SlotClass.GasCanister 5
-SlotClass.GasFilter 4
-SlotClass.Glasses 27
-SlotClass.Helmet 1
-SlotClass.Ingot 19
-SlotClass.LiquidBottle 32
-SlotClass.LiquidCanister 31
-SlotClass.Magazine 23
-SlotClass.Motherboard 6
-SlotClass.None 0
-SlotClass.Ore 10
-SlotClass.Organ 9
-SlotClass.Plant 11
-SlotClass.ProgrammableChip 26
-SlotClass.ScanningHead 36
-SlotClass.SensorProcessingUnit 30
-SlotClass.SoundCartridge 34
-SlotClass.Suit 2
-SlotClass.Tool 17
-SlotClass.Torpedo 20
-SlotClass.Uniform 12
-SlotClass.Wreckage 33
-SortingClass.Appliances 6
-SortingClass.Atmospherics 7
-SortingClass.Clothing 5
-SortingClass.Default 0
-SortingClass.Food 4
-SortingClass.Ices 10
-SortingClass.Kits 1
-SortingClass.Ores 9
-SortingClass.Resources 3
-SortingClass.Storage 8
-SortingClass.Tools 2
-Sound.AirlockCycling 22
-Sound.Alarm1 45
-Sound.Alarm10 12
-Sound.Alarm11 13
-Sound.Alarm12 14
-Sound.Alarm2 1
-Sound.Alarm3 2
-Sound.Alarm4 3
-Sound.Alarm5 4
-Sound.Alarm6 5
-Sound.Alarm7 6
-Sound.Alarm8 10
-Sound.Alarm9 11
-Sound.Alert 17
-Sound.Danger 15
-Sound.Depressurising 20
-Sound.FireFireFire 28
-Sound.Five 33
-Sound.Floor 34
-Sound.Four 32
-Sound.HaltWhoGoesThere 27
-Sound.HighCarbonDioxide 44
-Sound.IntruderAlert 19
-Sound.LiftOff 36
-Sound.MalfunctionDetected 26
-Sound.Music1 7
-Sound.Music2 8
-Sound.Music3 9
-Sound.None 0
-Sound.One 29
-Sound.PollutantsDetected 43
-Sound.PowerLow 23
-Sound.PressureHigh 39
-Sound.PressureLow 40
-Sound.Pressurising 21
-Sound.RocketLaunching 35
-Sound.StormIncoming 18
-Sound.SystemFailure 24
-Sound.TemperatureHigh 41
-Sound.TemperatureLow 42
-Sound.Three 31
-Sound.TraderIncoming 37
-Sound.TraderLanded 38
-Sound.Two 30
-Sound.Warning 16
-Sound.Welcome 25
-TransmitterMode.Active 1
-TransmitterMode.Passive 0
-Vent.Inward 1
-Vent.Outward 0
diff --git a/ic10emu/data/instruction_help_patches.json b/ic10emu/data/instruction_help_patches.json
deleted file mode 100644
index f2186ad..0000000
--- a/ic10emu/data/instruction_help_patches.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "english": {
- "bapz": "Branch to line c if abs(a) <= max(b * abs(a), float.epsilon * 8)",
- "bapzal": "Branch to line c if abs(a) <= max(b * abs(a), float.epsilon * 8) and store next line number in ra",
- "bnaz": "Branch to line c if abs(a) > max (b * abs(a), float.epsilon * 8)",
- "bnazal": "Branch to line c if abs(a) > max (b * abs(a), float.epsilon * 8) and store next line number in ra",
- "brapz": "Relative branch to line c if abs(a) <= max(b * abs(a), float.epsilon * 8)",
- "brnaz": "Relative branch to line c if abs(a) > max(b * abs(a), float.epsilon * 8)",
- "sapz": "Register = 1 if abs(a) <= max(b * abs(a), float.epsilon * 8), otherwise 0",
- "snaz": "Register = 1 if abs(a) > max(b * abs(a), float.epsilon), otherwise 0",
- "log": "Register = base e log(a) or ln(a)",
- "exp": "Register = exp(a) or e^a"
- }
-}
diff --git a/ic10emu/data/instructions.txt b/ic10emu/data/instructions.txt
deleted file mode 100644
index de0552b..0000000
--- a/ic10emu/data/instructions.txt
+++ /dev/null
@@ -1,140 +0,0 @@
-abs REGISTER VALUE
-acos REGISTER VALUE
-add REGISTER VALUE VALUE
-alias NAME REGISTER_DEVICE
-and REGISTER VALUE VALUE
-asin REGISTER VALUE
-atan REGISTER VALUE
-atan2 REGISTER VALUE VALUE
-bap VALUE VALUE VALUE VALUE
-bapal VALUE VALUE VALUE VALUE
-bapz VALUE VALUE VALUE
-bapzal VALUE VALUE VALUE
-bdns DEVICE VALUE
-bdnsal DEVICE VALUE
-bdse DEVICE VALUE
-bdseal DEVICE VALUE
-beq VALUE VALUE VALUE
-beqal VALUE VALUE VALUE
-beqz VALUE VALUE
-beqzal VALUE VALUE
-bge VALUE VALUE VALUE
-bgeal VALUE VALUE VALUE
-bgez VALUE VALUE
-bgezal VALUE VALUE
-bgt VALUE VALUE VALUE
-bgtal VALUE VALUE VALUE
-bgtz VALUE VALUE
-bgtzal VALUE VALUE
-ble VALUE VALUE VALUE
-bleal VALUE VALUE VALUE
-blez VALUE VALUE
-blezal VALUE VALUE
-blt VALUE VALUE VALUE
-bltal VALUE VALUE VALUE
-bltz VALUE VALUE
-bltzal VALUE VALUE
-bna VALUE VALUE VALUE VALUE
-bnaal VALUE VALUE VALUE VALUE
-bnan VALUE VALUE
-bnaz VALUE VALUE VALUE
-bnazal VALUE VALUE VALUE
-bne VALUE VALUE VALUE
-bneal VALUE VALUE VALUE
-bnez VALUE VALUE
-bnezal VALUE VALUE
-brap VALUE VALUE VALUE VALUE
-brapz VALUE VALUE VALUE
-brdns DEVICE VALUE
-brdse DEVICE VALUE
-breq VALUE VALUE VALUE
-breqz VALUE VALUE
-brge VALUE VALUE VALUE
-brgez VALUE VALUE
-brgt VALUE VALUE VALUE
-brgtz VALUE VALUE
-brle VALUE VALUE VALUE
-brlez VALUE VALUE
-brlt VALUE VALUE VALUE
-brltz VALUE VALUE
-brna VALUE VALUE VALUE VALUE
-brnan VALUE VALUE
-brnaz VALUE VALUE VALUE
-brne VALUE VALUE VALUE
-brnez VALUE VALUE
-ceil REGISTER VALUE
-cos REGISTER VALUE
-define NAME NUMBER
-div REGISTER VALUE VALUE
-exp REGISTER VALUE
-floor REGISTER VALUE
-get REGISTER DEVICE ADDRESS
-getd REGISTER DEVICE_ID ADDRESS
-hcf
-j VALUE
-jal VALUE
-jr VALUE
-l REGISTER DEVICE LOGIC_TYPE
-lb REGISTER DEVICE_TYPE LOGIC_TYPE BATCH_MODE
-lbn REGISTER DEVICE_TYPE DEVICE_NAME LOGIC_TYPE BATCH_MODE
-lbns REGISTER DEVICE_TYPE DEVICE_NAME INDEX SLOT_LOGIC_TYPE BATCH_MODE
-lbs REGISTER DEVICE_TYPE INDEX SLOT_LOGIC_TYPE BATCH_MODE
-ld REGISTER DEVICE_ID LOGIC_TYPE
-log REGISTER VALUE
-lr REGISTER DEVICE REAGENT_MODE VALUE
-ls REGISTER DEVICE VALUE SLOT_LOGIC_TYPE
-max REGISTER VALUE VALUE
-min REGISTER VALUE VALUE
-mod REGISTER VALUE VALUE
-move REGISTER VALUE
-mul REGISTER VALUE VALUE
-nor REGISTER VALUE VALUE
-not REGISTER VALUE
-or REGISTER VALUE VALUE
-peek REGISTER
-poke ADDRESS VALUE
-pop REGISTER
-push VALUE
-put DEVICE ADDRESS VALUE
-putd DEVICE_ID ADDRESS VALUE
-rand REGISTER
-round REGISTER VALUE
-s DEVICE LOGIC_TYPE VALUE
-sap REGISTER VALUE VALUE VALUE
-sapz REGISTER VALUE VALUE
-sb DEVICE_TYPE LOGIC_TYPE VALUE
-sbn DEVICE_TYPE DEVICE_NAME LOGIC_TYPE VALUE
-sbs DEVICE_TYPE INDEX SLOT_LOGIC_TYPE VALUE
-sd DEVICE_ID LOGIC_TYPE VALUE
-sdns REGISTER DEVICE
-sdse REGISTER DEVICE
-select REGISTER VALUE VALUE VALUE
-seq REGISTER VALUE VALUE
-seqz REGISTER VALUE
-sge REGISTER VALUE VALUE
-sgez REGISTER VALUE
-sgt REGISTER VALUE VALUE
-sgtz REGISTER VALUE
-sin REGISTER VALUE
-sla REGISTER VALUE VALUE
-sle REGISTER VALUE VALUE
-sleep VALUE
-slez REGISTER VALUE
-sll REGISTER VALUE VALUE
-slt REGISTER VALUE VALUE
-sltz REGISTER VALUE
-sna REGISTER VALUE VALUE VALUE
-snan REGISTER VALUE
-snanz REGISTER VALUE
-snaz REGISTER VALUE VALUE
-sne REGISTER VALUE VALUE
-snez REGISTER VALUE
-sqrt REGISTER VALUE
-sra REGISTER VALUE VALUE
-srl REGISTER VALUE VALUE
-ss DEVICE VALUE SLOT_LOGIC_TYPE REGISTER
-sub REGISTER VALUE VALUE
-tan REGISTER VALUE
-trunc REGISTER VALUE
-xor REGISTER VALUE VALUE
-yield
diff --git a/ic10emu/data/instructions_help.txt b/ic10emu/data/instructions_help.txt
deleted file mode 100644
index ea7f53c..0000000
--- a/ic10emu/data/instructions_help.txt
+++ /dev/null
@@ -1,136 +0,0 @@
-abs Register = the absolute value of a
-acos Returns the angle (radians) whos cosine is the specified value
-add Register = a + b.
-alias Labels register or device reference with name, device references also affect what shows on the screws on the IC base.
-and Performs a bitwise logical AND operation on the binary representation of two values. Each bit of the result is determined by evaluating the corresponding bits of the input values. If both bits are 1, the resulting bit is set to 1. Otherwise the resulting bit is set to 0.
-asin Returns the angle (radians) whos sine is the specified value
-atan Returns the angle (radians) whos tan is the specified value
-atan2 Returns the angle (radians) whose tangent is the quotient of two specified values: a (y) and b (x)
-bap Branch to line d if abs(a - b) <= max(c * max(abs(a), abs(b)), float.epsilon * 8)
-bapal Branch to line d if abs(a - b) <= max(c * max(abs(a), abs(b)), float.epsilon * 8) and store next line number in ra
-bapz Branch to line c if abs(a) <= max(b * abs(a), float.epsilon * 8)
-bapzal Branch to line c if abs(a) <= max(b * abs(a), float.epsilon * 8) and store next line number in ra
-bdns Branch to line a if device d isn't set
-bdnsal Jump execution to line a and store next line number if device is not set
-bdse Branch to line a if device d is set
-bdseal Jump execution to line a and store next line number if device is set
-beq Branch to line c if a == b
-beqal Branch to line c if a == b and store next line number in ra
-beqz Branch to line b if a == 0
-beqzal Branch to line b if a == 0 and store next line number in ra
-bge Branch to line c if a >= b
-bgeal Branch to line c if a >= b and store next line number in ra
-bgez Branch to line b if a >= 0
-bgezal Branch to line b if a >= 0 and store next line number in ra
-bgt Branch to line c if a > b
-bgtal Branch to line c if a > b and store next line number in ra
-bgtz Branch to line b if a > 0
-bgtzal Branch to line b if a > 0 and store next line number in ra
-ble Branch to line c if a <= b
-bleal Branch to line c if a <= b and store next line number in ra
-blez Branch to line b if a <= 0
-blezal Branch to line b if a <= 0 and store next line number in ra
-blt Branch to line c if a < b
-bltal Branch to line c if a < b and store next line number in ra
-bltz Branch to line b if a < 0
-bltzal Branch to line b if a < 0 and store next line number in ra
-bna Branch to line d if abs(a - b) > max(c * max(abs(a), abs(b)), float.epsilon * 8)
-bnaal Branch to line d if abs(a - b) <= max(c * max(abs(a), abs(b)), float.epsilon * 8) and store next line number in ra
-bnan Branch to line b if a is not a number (NaN)
-bnaz Branch to line c if abs(a) > max (b * abs(a), float.epsilon * 8)
-bnazal Branch to line c if abs(a) > max (b * abs(a), float.epsilon * 8) and store next line number in ra
-bne Branch to line c if a != b
-bneal Branch to line c if a != b and store next line number in ra
-bnez branch to line b if a != 0
-bnezal Branch to line b if a != 0 and store next line number in ra
-brap Relative branch to line d if abs(a - b) <= max(c * max(abs(a), abs(b)), float.epsilon * 8)
-brapz Relative branch to line c if abs(a) <= max(b * abs(a), float.epsilon * 8)
-brdns Relative jump to line a if device is not set
-brdse Relative jump to line a if device is set
-breq Relative branch to line c if a == b
-breqz Relative branch to line b if a == 0
-brge Relative jump to line c if a >= b
-brgez Relative branch to line b if a >= 0
-brgt relative jump to line c if a > b
-brgtz Relative branch to line b if a > 0
-brle Relative jump to line c if a <= b
-brlez Relative branch to line b if a <= 0
-brlt Relative jump to line c if a < b
-brltz Relative branch to line b if a < 0
-brna Relative branch to line d if abs(a - b) > max(c * max(abs(a), abs(b)), float.epsilon * 8)
-brnan Relative branch to line b if a is not a number (NaN)
-brnaz Relative branch to line c if abs(a) > max(b * abs(a), float.epsilon * 8)
-brne Relative branch to line c if a != b
-brnez Relative branch to line b if a != 0
-ceil Register = smallest integer greater than a
-cos Returns the cosine of the specified angle (radians)
-define Creates a label that will be replaced throughout the program with the provided value.
-div Register = a / b
-exp Register = exp(a) or e^a
-floor Register = largest integer less than a
-hcf Halt and catch fire
-j Jump execution to line a
-jal Jump execution to line a and store next line number in ra
-jr Relative jump to line a
-l Loads device LogicType to register by housing index value.
-label DEPRECATED
-lb Loads LogicType from all output network devices with provided type hash using the provide batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number.
-lbn Loads LogicType from all output network devices with provided type and name hashes using the provide batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number.
-lbns Loads LogicSlotType from slotIndex from all output network devices with provided type and name hashes using the provide batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number.
-lbs Loads LogicSlotType from slotIndex from all output network devices with provided type hash using the provide batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number.
-ld Loads device LogicType to register by direct ID reference.
-log Register = base e log(a) or ln(a)
-lr Loads reagent of device's ReagentMode where a hash of the reagent type to check for. ReagentMode can be either Contents (0), Required (1), Recipe (2). Can use either the word, or the number.
-ls Loads slot LogicSlotType on device to register.
-max Register = max of a or b
-min Register = min of a or b
-mod Register = a mod b (note: NOT a % b)
-move Register = provided num or register value.
-mul Register = a * b
-nor Performs a bitwise logical NOR (NOT OR) operation on the binary representation of two values. Each bit of the result is determined by evaluating the corresponding bits of the input values. If both bits are 0, the resulting bit is set to 1. Otherwise, if at least one bit is 1, the resulting bit is set to 0.
-not Performs a bitwise logical NOT operation flipping each bit of the input value, resulting in a binary complement. If a bit is 1, it becomes 0, and if a bit is 0, it becomes 1.
-or Performs a bitwise logical OR operation on the binary representation of two values. Each bit of the result is determined by evaluating the corresponding bits of the input values. If either bit is 1, the resulting bit is set to 1. If both bits are 0, the resulting bit is set to 0.
-peek Register = the value at the top of the stack
-pop Register = the value at the top of the stack and decrements sp
-push Pushes the value of a to the stack at sp and increments sp
-rand Register = a random value x with 0 <= x < 1
-round Register = a rounded to nearest integer
-s Stores register value to LogicType on device by housing index value.
-sap Register = 1 if abs(a - b) <= max(c * max(abs(a), abs(b)), float.epsilon * 8), otherwise 0
-sapz Register = 1 if abs(a) <= max(b * abs(a), float.epsilon * 8), otherwise 0
-sb Stores register value to LogicType on all output network devices with provided type hash.
-sbn Stores register value to LogicType on all output network devices with provided type hash and name.
-sbs Stores register value to LogicSlotType on all output network devices with provided type hash in the provided slot.
-sd Stores register value to LogicType on device by direct ID reference.
-sdns Register = 1 if device is not set, otherwise 0
-sdse Register = 1 if device is set, otherwise 0.
-select Register = b if a is non-zero, otherwise c
-seq Register = 1 if a == b, otherwise 0
-seqz Register = 1 if a == 0, otherwise 0
-sge Register = 1 if a >= b, otherwise 0
-sgez Register = 1 if a >= 0, otherwise 0
-sgt Register = 1 if a > b, otherwise 0
-sgtz Register = 1 if a > 0, otherwise 0
-sin Returns the sine of the specified angle (radians)
-sla Performs a bitwise arithmetic left shift operation on the binary representation of a value. It shifts the bits to the left and fills the vacated rightmost bits with a copy of the sign bit (the most significant bit).
-sle Register = 1 if a <= b, otherwise 0
-sleep Pauses execution on the IC for a seconds
-slez Register = 1 if a <= 0, otherwise 0
-sll Performs a bitwise logical left shift operation on the binary representation of a value. It shifts the bits to the left and fills the vacated rightmost bits with zeros.
-slt Register = 1 if a < b, otherwise 0
-sltz Register = 1 if a < 0, otherwise 0
-sna Register = 1 if abs(a - b) > max(c * max(abs(a), abs(b)), float.epsilon * 8), otherwise 0
-snan Register = 1 if a is NaN, otherwise 0
-snanz Register = 0 if a is NaN, otherwise 1
-snaz Register = 1 if abs(a) > max(b * abs(a), float.epsilon), otherwise 0
-sne Register = 1 if a != b, otherwise 0
-snez Register = 1 if a != 0, otherwise 0
-sqrt Register = square root of a
-sra Performs a bitwise arithmetic right shift operation on the binary representation of a value. It shifts the bits to the right and fills the vacated leftmost bits with a copy of the sign bit (the most significant bit).
-srl Performs a bitwise logical right shift operation on the binary representation of a value. It shifts the bits to the right and fills the vacated leftmost bits with zeros
-ss Stores register value to device stored in a slot LogicSlotType on device.
-sub Register = a - b.
-tan Returns the tan of the specified angle (radians)
-trunc Register = a with fractional part removed
-xor Performs a bitwise logical XOR (exclusive OR) operation on the binary representation of two values. Each bit of the result is determined by evaluating the corresponding bits of the input values. If the bits are different (one bit is 0 and the other is 1), the resulting bit is set to 1. If the bits are the same (both 0 or both 1), the resulting bit is set to 0.
-yield Pauses execution for 1 tick
diff --git a/ic10emu/data/logictypes.txt b/ic10emu/data/logictypes.txt
deleted file mode 100644
index e363bdc..0000000
--- a/ic10emu/data/logictypes.txt
+++ /dev/null
@@ -1,269 +0,0 @@
-Acceleration 216 Change in velocity. Rockets that are deccelerating when landing will show this as negative value.
-Activate 9 1 if device is activated (usually means running), otherwise 0
-AirRelease 75 The current state of the air release system, for example AirRelease = 1 for a Hardsuit sets Air Release to On
-AlignmentError 243
-Apex 238
-AutoLand 226 Engages the automatic landing algorithm. The rocket will automatically throttle and turn on and off its engines to achieve a smooth landing.
-AutoShutOff 218 Turns off all devices in the rocket upon reaching destination
-Bpm 103 Bpm
-BurnTimeRemaining 225 Estimated time in seconds until fuel is depleted. Calculated based on current fuel usage.
-CelestialHash 242
-CelestialParentHash 250
-Channel0 165 Channel 0 on a cable network which should be considered volatile
-Channel1 166 Channel 1 on a cable network which should be considered volatile
-Channel2 167 Channel 2 on a cable network which should be considered volatile
-Channel3 168 Channel 3 on a cable network which should be considered volatile
-Channel4 169 Channel 4 on a cable network which should be considered volatile
-Channel5 170 Channel 5 on a cable network which should be considered volatile
-Channel6 171 Channel 6 on a cable network which should be considered volatile
-Channel7 172 Channel 7 on a cable network which should be considered volatile
-Charge 11 The current charge the device has
-Chart 256
-ChartedNavPoints 259
-ClearMemory 62 When set to 1, clears the counter memory (e.g. ExportCount). Will set itself back to 0 when actioned
-CollectableGoods 101
-Color 38 \n Whether driven by concerns for clarity, safety or simple aesthetics, {LINK:Stationeers;Stationeers} have access to a small rainbow of colors for their constructions. These are the color setting for devices, represented as an integer.\n\n0: Blue\n1: Grey\n2: Green\n3: Orange\n4: Red\n5: Yellow\n6: White\n7: Black\n8: Brown\n9: Khaki\n10: Pink\n11: Purple\n\n It is an unwavering universal law that anything higher than 11 will be purple. The {LINK:ODA;ODA} is powerless to change this. Similarly, anything lower than 0 will be Blue.\n
-Combustion 98 The assess atmosphere is on fire. Returns 1 if atmosphere is on fire, 0 if not.
-CombustionInput 146 The assess atmosphere is on fire. Returns 1 if device's input network is on fire, 0 if not.
-CombustionInput2 147 The assess atmosphere is on fire. Returns 1 if device's Input2 network is on fire, 0 if not.
-CombustionLimiter 153 Retards the rate of combustion inside the machine (range: 0-100), with 0 being the slowest rate of combustion and 100 being the fastest
-CombustionOutput 148 The assess atmosphere is on fire. Returns 1 if device's Output network is on fire, 0 if not.
-CombustionOutput2 149 The assess atmosphere is on fire. Returns 1 if device's Output2 network is on fire, 0 if not.
-CompletionRatio 61 How complete the current production is for this device, between 0 and 1
-ContactTypeId 198 The type id of the contact.
-CurrentCode 261
-CurrentResearchPodType 93
-Density 262
-DestinationCode 215 Unique identifier code for a destination on the space map.
-Discover 255
-DistanceAu 244
-DistanceKm 249
-DrillCondition 240
-DryMass 220 The Mass in kilograms of the rocket excluding fuel. The more massive the rocket the more fuel will be required to move to a new location in space.
-Eccentricity 247
-ElevatorLevel 40 Level the elevator is currently at
-ElevatorSpeed 39 Current speed of the elevator
-EntityState 239
-EnvironmentEfficiency 104 The Environment Efficiency reported by the machine, as a float between 0 and 1
-Error 4 1 if device is in error state, otherwise 0
-ExhaustVelocity 235
-ExportCount 63 How many items exported since last ClearMemory
-ExportQuantity 31 Total quantity of items exported by the device
-ExportSlotHash 42 DEPRECATED
-ExportSlotOccupant 32 DEPRECATED
-Filtration 74 The current state of the filtration system, for example Filtration = 1 for a Hardsuit sets filtration to On
-FlightControlRule 236
-Flush 174 Set to 1 to activate the flush function on the device
-ForceWrite 85 Forces Logic Writer devices to rewrite value
-ForwardX 227
-ForwardY 228
-ForwardZ 229
-Fuel 99
-Harvest 69 Performs the harvesting action for any plant based machinery
-Horizontal 20 Horizontal setting of the device
-HorizontalRatio 34 Radio of horizontal setting for device
-Idle 37 Returns 1 if the device is currently idle, otherwise 0
-ImportCount 64 How many items imported since last ClearMemory
-ImportQuantity 29 Total quantity of items imported by the device
-ImportSlotHash 43 DEPRECATED
-ImportSlotOccupant 30 DEPRECATED
-Inclination 246
-Index 241
-InterrogationProgress 157 Progress of this sattellite dish's interrogation of its current target, as a ratio from 0-1
-LineNumber 173 The line number of current execution for an integrated circuit running on this device. While this number can be written, use with caution
-Lock 10 1 if device is locked, otherwise 0, can be set in most devices and prevents the user from access the values
-ManualResearchRequiredPod 94
-Mass 219 The total Mass of the rocket in kilograms including fuel and cargo. The more massive the rocket the more fuel will be required to move to a new location in space.
-Maximum 23 Maximum setting of the device
-MinWattsToContact 163 Minimum required amount of watts from the dish hitting the target trader contact to start interrogating the contact
-MineablesInQueue 96
-MineablesInVicinity 95
-MinedQuantity 266
-MinimumWattsToContact 163 Minimum required amount of watts from the dish hitting the target trader contact to start interrogating the contact
-Mode 3 Integer for mode state, different devices will have different mode states available to them
-NavPoints 258
-NextWeatherEventTime 97
-None 0 No description
-On 28 The current state of the device, 0 for off, 1 for on
-Open 2 1 if device is open, otherwise 0
-OperationalTemperatureEfficiency 150 How the input pipe's temperature effects the machines efficiency
-OrbitPeriod 245
-Orientation 230
-Output 70 The output operation for a sort handling device, such as a stacker or sorter, when in logic mode the device will only action one repetition when set zero or above and then back to -1 and await further instructions
-PassedMoles 234
-Plant 68 Performs the planting action for any plant based machinery
-PlantEfficiency1 52 DEPRECATED
-PlantEfficiency2 53 DEPRECATED
-PlantEfficiency3 54 DEPRECATED
-PlantEfficiency4 55 DEPRECATED
-PlantGrowth1 48 DEPRECATED
-PlantGrowth2 49 DEPRECATED
-PlantGrowth3 50 DEPRECATED
-PlantGrowth4 51 DEPRECATED
-PlantHash1 56 DEPRECATED
-PlantHash2 57 DEPRECATED
-PlantHash3 58 DEPRECATED
-PlantHash4 59 DEPRECATED
-PlantHealth1 44 DEPRECATED
-PlantHealth2 45 DEPRECATED
-PlantHealth3 46 DEPRECATED
-PlantHealth4 47 DEPRECATED
-PositionX 76 The current position in X dimension in world coordinates
-PositionY 77 The current position in Y dimension in world coordinates
-PositionZ 78 The current position in Z dimension in world coordinates
-Power 1 Can be read to return if the device is correctly powered or not, set via the power system, return 1 if powered and 0 if not
-PowerActual 26 How much energy the device or network is actually using
-PowerGeneration 65 Returns how much power is being generated
-PowerPotential 25 How much energy the device or network potentially provides
-PowerRequired 36 Power requested from the device and/or network
-PrefabHash 84 The hash of the structure
-Pressure 5 The current pressure reading of the device
-PressureEfficiency 152 How the pressure of the input pipe and waste pipe effect the machines efficiency
-PressureExternal 7 Setting for external pressure safety, in KPa
-PressureInput 106 The current pressure reading of the device's Input Network
-PressureInput2 116 The current pressure reading of the device's Input2 Network
-PressureInternal 8 Setting for internal pressure safety, in KPa
-PressureOutput 126 The current pressure reading of the device's Output Network
-PressureOutput2 136 The current pressure reading of the device's Output2 Network
-PressureSetting 71 The current setting for the internal pressure of the object (e.g. the Hardsuit Air release), in KPa
-Progress 214 Progress of the rocket to the next node on the map expressed as a value between 0-1.
-Quantity 27 Total quantity on the device
-Ratio 24 Context specific value depending on device, 0 to 1 based ratio
-RatioCarbonDioxide 15 The ratio of {GAS:CarbonDioxide} in device atmosphere
-RatioCarbonDioxideInput 109 The ratio of {GAS:CarbonDioxide} in device's input network
-RatioCarbonDioxideInput2 119 The ratio of {GAS:CarbonDioxide} in device's Input2 network
-RatioCarbonDioxideOutput 129 The ratio of {GAS:CarbonDioxide} in device's Output network
-RatioCarbonDioxideOutput2 139 The ratio of {GAS:CarbonDioxide} in device's Output2 network
-RatioHydrogen 252 The ratio of {GAS:Hydrogen} in device's Atmopshere
-RatioLiquidCarbonDioxide 199 The ratio of {GAS:LiquidCarbonDioxide} in device's Atmosphere
-RatioLiquidCarbonDioxideInput 200 The ratio of {GAS:LiquidCarbonDioxide} in device's Input Atmosphere
-RatioLiquidCarbonDioxideInput2 201 The ratio of {GAS:LiquidCarbonDioxide} in device's Input2 Atmosphere
-RatioLiquidCarbonDioxideOutput 202 The ratio of {GAS:LiquidCarbonDioxide} in device's device's Output Atmosphere
-RatioLiquidCarbonDioxideOutput2 203 The ratio of {GAS:LiquidCarbonDioxide} in device's Output2 Atmopshere
-RatioLiquidHydrogen 253 The ratio of {GAS:LiquidHydrogen} in device's Atmopshere
-RatioLiquidNitrogen 177 The ratio of {GAS:LiquidNitrogen} in device atmosphere
-RatioLiquidNitrogenInput 178 The ratio of {GAS:LiquidNitrogen} in device's input network
-RatioLiquidNitrogenInput2 179 The ratio of {GAS:LiquidNitrogen} in device's Input2 network
-RatioLiquidNitrogenOutput 180 The ratio of {GAS:LiquidNitrogen} in device's Output network
-RatioLiquidNitrogenOutput2 181 The ratio of {GAS:LiquidNitrogen} in device's Output2 network
-RatioLiquidNitrousOxide 209 The ratio of {GAS:LiquidNitrousOxide} in device's Atmosphere
-RatioLiquidNitrousOxideInput 210 The ratio of {GAS:LiquidNitrousOxide} in device's Input Atmosphere
-RatioLiquidNitrousOxideInput2 211 The ratio of {GAS:LiquidNitrousOxide} in device's Input2 Atmosphere
-RatioLiquidNitrousOxideOutput 212 The ratio of {GAS:LiquidNitrousOxide} in device's device's Output Atmosphere
-RatioLiquidNitrousOxideOutput2 213 The ratio of {GAS:LiquidNitrousOxide} in device's Output2 Atmopshere
-RatioLiquidOxygen 183 The ratio of {GAS:LiquidOxygen} in device's Atmosphere
-RatioLiquidOxygenInput 184 The ratio of {GAS:LiquidOxygen} in device's Input Atmosphere
-RatioLiquidOxygenInput2 185 The ratio of {GAS:LiquidOxygen} in device's Input2 Atmosphere
-RatioLiquidOxygenOutput 186 The ratio of {GAS:LiquidOxygen} in device's device's Output Atmosphere
-RatioLiquidOxygenOutput2 187 The ratio of {GAS:LiquidOxygen} in device's Output2 Atmopshere
-RatioLiquidPollutant 204 The ratio of {GAS:LiquidPollutant} in device's Atmosphere
-RatioLiquidPollutantInput 205 The ratio of {GAS:LiquidPollutant} in device's Input Atmosphere
-RatioLiquidPollutantInput2 206 The ratio of {GAS:LiquidPollutant} in device's Input2 Atmosphere
-RatioLiquidPollutantOutput 207 The ratio of {GAS:LiquidPollutant} in device's device's Output Atmosphere
-RatioLiquidPollutantOutput2 208 The ratio of {GAS:LiquidPollutant} in device's Output2 Atmopshere
-RatioLiquidVolatiles 188 The ratio of {GAS:LiquidVolatiles} in device's Atmosphere
-RatioLiquidVolatilesInput 189 The ratio of {GAS:LiquidVolatiles} in device's Input Atmosphere
-RatioLiquidVolatilesInput2 190 The ratio of {GAS:LiquidVolatiles} in device's Input2 Atmosphere
-RatioLiquidVolatilesOutput 191 The ratio of {GAS:LiquidVolatiles} in device's device's Output Atmosphere
-RatioLiquidVolatilesOutput2 192 The ratio of {GAS:LiquidVolatiles} in device's Output2 Atmopshere
-RatioNitrogen 16 The ratio of nitrogen in device atmosphere
-RatioNitrogenInput 110 The ratio of nitrogen in device's input network
-RatioNitrogenInput2 120 The ratio of nitrogen in device's Input2 network
-RatioNitrogenOutput 130 The ratio of nitrogen in device's Output network
-RatioNitrogenOutput2 140 The ratio of nitrogen in device's Output2 network
-RatioNitrousOxide 83 The ratio of {GAS:NitrousOxide} in device atmosphere
-RatioNitrousOxideInput 114 The ratio of {GAS:NitrousOxide} in device's input network
-RatioNitrousOxideInput2 124 The ratio of {GAS:NitrousOxide} in device's Input2 network
-RatioNitrousOxideOutput 134 The ratio of {GAS:NitrousOxide} in device's Output network
-RatioNitrousOxideOutput2 144 The ratio of {GAS:NitrousOxide} in device's Output2 network
-RatioOxygen 14 The ratio of oxygen in device atmosphere
-RatioOxygenInput 108 The ratio of oxygen in device's input network
-RatioOxygenInput2 118 The ratio of oxygen in device's Input2 network
-RatioOxygenOutput 128 The ratio of oxygen in device's Output network
-RatioOxygenOutput2 138 The ratio of oxygen in device's Output2 network
-RatioPollutant 17 The ratio of pollutant in device atmosphere
-RatioPollutantInput 111 The ratio of pollutant in device's input network
-RatioPollutantInput2 121 The ratio of pollutant in device's Input2 network
-RatioPollutantOutput 131 The ratio of pollutant in device's Output network
-RatioPollutantOutput2 141 The ratio of pollutant in device's Output2 network
-RatioPollutedWater 254 The ratio of polluted water in device atmosphere
-RatioSteam 193 The ratio of {GAS:Steam} in device's Atmosphere
-RatioSteamInput 194 The ratio of {GAS:Steam} in device's Input Atmosphere
-RatioSteamInput2 195 The ratio of {GAS:Steam} in device's Input2 Atmosphere
-RatioSteamOutput 196 The ratio of {GAS:Steam} in device's device's Output Atmosphere
-RatioSteamOutput2 197 The ratio of {GAS:Steam} in device's Output2 Atmopshere
-RatioVolatiles 18 The ratio of volatiles in device atmosphere
-RatioVolatilesInput 112 The ratio of volatiles in device's input network
-RatioVolatilesInput2 122 The ratio of volatiles in device's Input2 network
-RatioVolatilesOutput 132 The ratio of volatiles in device's Output network
-RatioVolatilesOutput2 142 The ratio of volatiles in device's Output2 network
-RatioWater 19 The ratio of water in device atmosphere
-RatioWaterInput 113 The ratio of water in device's input network
-RatioWaterInput2 123 The ratio of water in device's Input2 network
-RatioWaterOutput 133 The ratio of water in device's Output network
-RatioWaterOutput2 143 The ratio of water in device's Output2 network
-ReEntryAltitude 237
-Reagents 13 Total number of reagents recorded by the device
-RecipeHash 41 Current hash of the recipe the device is set to produce
-ReferenceId 217
-RequestHash 60 When set to the unique identifier, requests an item of the provided type from the device
-RequiredPower 33 Idle operating power quantity, does not necessarily include extra demand power
-ReturnFuelCost 100
-Richness 263
-Rpm 155 The number of revolutions per minute that the device's spinning mechanism is doing
-SemiMajorAxis 248
-Setting 12 A variable setting that can be read or written, depending on the device
-SettingInput 91
-SettingInputHash 91 The input setting for the device
-SettingOutput 92
-SettingOutputHash 91 The output setting for the device
-SignalID 87 Returns the contact ID of the strongest signal from this Satellite
-SignalStrength 86 Returns the degree offset of the strongest contact
-Sites 260
-Size 264
-SizeX 160 Size on the X (right) axis of the object in largeGrids (a largeGrid is 2meters)
-SizeY 161 Size on the Y(Up) axis of the object in largeGrids (a largeGrid is 2meters)
-SizeZ 162 Size on the Z(Forward) axis of the object in largeGrids (a largeGrid is 2meters)
-SolarAngle 22 Solar angle of the device
-SolarIrradiance 176
-SoundAlert 175 Plays a sound alert on the devices speaker
-Stress 156 Machines get stressed when working hard. When Stress reaches 100 the machine will automatically shut down
-Survey 257
-TargetPadIndex 158 The index of the trader landing pad on this devices data network that it will try to call a trader in to land
-TargetX 88 The target position in X dimension in world coordinates
-TargetY 89 The target position in Y dimension in world coordinates
-TargetZ 90 The target position in Z dimension in world coordinates
-Temperature 6 The current temperature reading of the device
-TemperatureDifferentialEfficiency 151 How the difference between the input pipe and waste pipe temperatures effect the machines efficiency
-TemperatureExternal 73 The temperature of the outside of the device, usually the world atmosphere surrounding it
-TemperatureInput 107 The current temperature reading of the device's Input Network
-TemperatureInput2 117 The current temperature reading of the device's Input2 Network
-TemperatureOutput 127 The current temperature reading of the device's Output Network
-TemperatureOutput2 137 The current temperature reading of the device's Output2 Network
-TemperatureSetting 72 The current setting for the internal temperature of the object (e.g. the Hardsuit A/C)
-Throttle 154 Increases the rate at which the machine works (range: 0-100)
-Thrust 221 Total current thrust of all rocket engines on the rocket in Newtons.
-ThrustToWeight 223 Ratio of thrust to weight of rocket. Weight is effected by local body gravity. A rocket with a low thrust to weight will expend more fuel during launch and landing.
-Time 102 Time
-TimeToDestination 224 Estimated time in seconds until rocket arrives at target destination.
-TotalMoles 66 Returns the total moles of the device
-TotalMolesInput 115 Returns the total moles of the device's Input Network
-TotalMolesInput2 125 Returns the total moles of the device's Input2 Network
-TotalMolesOutput 135 Returns the total moles of the device's Output Network
-TotalMolesOutput2 145 Returns the total moles of the device's Output2 Network
-TotalQuantity 265
-TrueAnomaly 251
-VelocityMagnitude 79 The current magnitude of the velocity vector
-VelocityRelativeX 80 The current velocity X relative to the forward vector of this
-VelocityRelativeY 81 The current velocity Y relative to the forward vector of this
-VelocityRelativeZ 82 The current velocity Z relative to the forward vector of this
-VelocityX 231
-VelocityY 232
-VelocityZ 233
-Vertical 21 Vertical setting of the device
-VerticalRatio 35 Radio of vertical setting for device
-Volume 67 Returns the device atmosphere volume
-VolumeOfLiquid 182 The total volume of all liquids in Liters in the atmosphere
-WattsReachingContact 164 The amount of watts actually hitting the contact. This is effected by the power of the dish and how far off-axis the dish is from the contact vector
-Weight 222 Weight of Rocket in Newtons (Including fuel and cargo). Weight is effected by local body gravity.
-WorkingGasEfficiency 105 The Working Gas Efficiency reported by the machine, as a float between 0 and 1
diff --git a/ic10emu/data/reagentmodes.txt b/ic10emu/data/reagentmodes.txt
deleted file mode 100644
index c727f52..0000000
--- a/ic10emu/data/reagentmodes.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Contents 0 The amount of this Reagent present in the machine
-Recipe 2 The amount of this Reagent required by the Machine's current recipe
-Required 1 The amount of this Reagent needed to complete the Machine's current recipe after subtracting the amount currently present
-TotalContents 3
diff --git a/ic10emu/data/slotlogictypes.txt b/ic10emu/data/slotlogictypes.txt
deleted file mode 100644
index abd2d70..0000000
--- a/ic10emu/data/slotlogictypes.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-Charge 10 returns current energy charge the slot occupant is holding
-ChargeRatio 11 returns current energy charge the slot occupant is holding as a ratio between 0 and 1 of its maximum
-Class 12 returns integer representing the class of object
-Damage 4 returns the damage state of the item in the slot
-Efficiency 5 returns the growth efficiency of the plant in the slot
-FilterType 25
-Growth 7 returns the current growth state of the plant in the slot
-Health 6 returns the health of the plant in the slot
-LineNumber 19
-Lock 23
-Mature 16 returns 1 if the plant in this slot is mature, 0 when it isn't
-MaxQuantity 15 returns the max stack size of the item in the slot
-None 0 No description
-OccupantHash 2 returns the has of the current occupant, the unique identifier of the thing
-Occupied 1 returns 0 when slot is not occupied, 1 when it is
-On 22
-Open 21
-PrefabHash 17 returns the hash of the structure in the slot
-Pressure 8 returns pressure of the slot occupants internal atmosphere
-PressureAir 14 returns pressure in the air tank of the jetpack in this slot
-PressureWaste 13 returns pressure in the waste tank of the jetpack in this slot
-Quantity 3 returns the current quantity, such as stack size, of the item in the slot
-ReferenceId 26
-Seeding 18 Whether a plant is seeding (ready to harvest seeds from). Returns 1 if seeding or 0 if not.
-SortingClass 24
-Temperature 9 returns temperature of the slot occupants internal atmosphere
-Volume 20
diff --git a/ic10emu/data/stationpedia.txt b/ic10emu/data/stationpedia.txt
deleted file mode 100644
index 9250587..0000000
--- a/ic10emu/data/stationpedia.txt
+++ /dev/null
@@ -1,1731 +0,0 @@
--1330388999 AccessCardBlack Access Card (Black)
--1411327657 AccessCardBlue Access Card (Blue)
-1412428165 AccessCardBrown Access Card (Brown)
--1339479035 AccessCardGray Access Card (Gray)
--374567952 AccessCardGreen Access Card (Green)
-337035771 AccessCardKhaki Access Card (Khaki)
--332896929 AccessCardOrange Access Card (Orange)
-431317557 AccessCardPink Access Card (Pink)
-459843265 AccessCardPurple Access Card (Purple)
--1713748313 AccessCardRed Access Card (Red)
-2079959157 AccessCardWhite Access Card (White)
-568932536 AccessCardYellow Access Card (Yellow)
-1565803737 Alcohol Alcohol
--1686269127 ApplianceBobbleHeadBasicSuit Bobble Head (Basic Suit)
--38993607 ApplianceBobbleHeadHardSuit Bobble Head (Hard Suit)
-1365789392 ApplianceChemistryStation Chemistry Station
--1683849799 ApplianceDeskLampLeft Appliance Desk Lamp Left
-1174360780 ApplianceDeskLampRight Appliance Desk Lamp Right
--1136173965 ApplianceMicrowave Microwave
--749191906 AppliancePackagingMachine Basic Packaging Machine
--1339716113 AppliancePaintMixer Paint Mixer
--1303038067 AppliancePlantGeneticAnalyzer Plant Genetic Analyzer
--1094868323 AppliancePlantGeneticSplicer Plant Genetic Splicer
-871432335 AppliancePlantGeneticStabilizer Plant Genetic Stabilizer
-1260918085 ApplianceReagentProcessor Reagent Processor
-142831994 ApplianceSeedTray Appliance Seed Tray
-1853941363 ApplianceTabletDock Tablet Dock
--1493155787 Astroloy Astroloy
-221058307 AutolathePrinterMod Autolathe Printer Mod
--462415758 Battery_Wireless_cell Battery Wireless Cell
--41519077 Battery_Wireless_cell_Big Battery Wireless Cell (Big)
-925270362 Biomass Biomass
-724717025 BodyPartAstronautFemaleArmL Body Part Astronaut Female Arm
--784502654 BodyPartAstronautFemaleArmR Body Part Astronaut Female Arm R
--699183000 BodyPartAstronautFemaleHead Body Part Astronaut Female Head
-987678787 BodyPartAstronautFemaleLegL Body Part Astronaut Female Leg L
--1059982048 BodyPartAstronautFemaleLegR Body Part Astronaut Female Leg R
--1644287450 BodyPartAstronautFemaleTorso Body Part Astronaut Female Torso
--2049263135 BodyPartAstronautMaleArmL Body Part Astronaut Male Arm L
-2144699522 BodyPartAstronautMaleArmR Body Part Astronaut Male Arm R
-2025563240 BodyPartAstronautMaleHead Body Part Astronaut Male Head
--1808384957 BodyPartAstronautMaleLegL Body Part Astronaut Male Leg)
-1849229600 BodyPartAstronautMaleLegR Body Part Astronaut Male Leg R
--331537198 BodyPartAstronautTorso Body Part Astronaut Torso
-1488426674 BodyPartChickBody Body Part Chick Body
-619473820 BodyPartChickHead Body Part Chick Head
--933104713 BodyPartChickLegL Body Part Chick Leg)
-846122708 BodyPartChickLegR Body Part Chick Leg R
--14145187 BodyPartChickTail Body Part Chick Tail
--589137369 BodyPartChickWingL Body Part Chick Wing)
-653084484 BodyPartChickWingR Body Part Chick Wing R
--1241112004 BodyPartChickenBrownBody Body Part Chicken Brown Body
--899817710 BodyPartChickenBrownHead Body Part Chicken Brown Head
-651183929 BodyPartChickenBrownLegL Body Part Chicken Brown Leg)
--589333926 BodyPartChickenBrownLegR Body Part Chicken Brown Leg R
-295280083 BodyPartChickenBrownTail Body Part Chicken Brown Tail
--703830604 BodyPartChickenBrownWingL Body Part Chicken Brown Wing)
-738416855 BodyPartChickenBrownWingR Body Part Chicken Brown Wing R
-801013348 BodyPartChickenWhiteBody Body Part Chicken White Body
-1407550282 BodyPartChickenWhiteHead Body Part Chicken White Head
--1083696287 BodyPartChickenWhiteLegL Body Part Chicken White Leg)
-1164387842 BodyPartChickenWhiteLegR Body Part Chicken White Leg R
--2011053685 BodyPartChickenWhiteTail Body Part Chicken White Tail
--1289419730 BodyPartChickenWhiteWingL Body Part Chicken White Wing)
-1227503949 BodyPartChickenWhiteWingR Body Part Chicken White Wing R
--815465419 BodyPartGraylienArmL Body Part Graylien Arm L
-896254294 BodyPartGraylienArmR Body Part Graylien Arm R
-1314790546 BodyPartGraylienBody Body Part Graylien Body
-839246268 BodyPartGraylienHead Body Part Graylien Head
--561481321 BodyPartGraylienLegL Body Part Graylien Leg L
-612844788 BodyPartGraylienLegR Body Part Graylien Leg R
--1579496195 BodyPartGraylienPelvis Body Part Graylien Pelvis
-54192919 BodyPartRoosterBlackBody Body Part Rooster Black Body
-2137069113 BodyPartRoosterBlackHead Body Part Rooster Black Head
--1813213678 BodyPartRoosterBlackLegL Body Part Rooster Black Leg)
-1776530289 BodyPartRoosterBlackLegR Body Part Rooster Black Leg R
--1532668680 BodyPartRoosterBlackTail Body Part Rooster Black Tail
-2047189053 BodyPartRoosterBlackWingL Body Part Rooster Black Wing)
--2146788002 BodyPartRoosterBlackWingR Body Part Rooster Black Wing R
-1788050606 BodyPartRoosterBrownBody Body Part Rooster Brown Body
-382239104 BodyPartRoosterBrownHead Body Part Rooster Brown Head
--96134741 BodyPartRoosterBrownLegL Body Part Rooster Brown Leg)
-4859080 BodyPartRoosterBrownLegR Body Part Rooster Brown Leg R
--854801599 BodyPartRoosterBrownTail Body Part Rooster Brown Tail
--925826430 BodyPartRoosterBrownWingL Body Part Rooster Brown Wing)
-853426145 BodyPartRoosterBrownWingR Body Part Rooster Brown Wing R
-1582746610 Carbon Carbon
--1976947556 CardboardBox Cardboard Box
--1634532552 CartridgeAccessController Cartridge (Access Controller)
--1550278665 CartridgeAtmosAnalyser Atmos Analyzer
--932136011 CartridgeConfiguration Configuration
--1462180176 CartridgeElectronicReader eReader
--1957063345 CartridgeGPS GPS
-872720793 CartridgeGuide Guide
--1116110181 CartridgeMedicalAnalyser Medical Analyzer
-1606989119 CartridgeNetworkAnalyser Network Analyzer
--1768732546 CartridgeOreScanner Ore Scanner
-1738236580 CartridgeOreScannerColor Ore Scanner (Color)
-1101328282 CartridgePlantAnalyser Cartridge Plant Analyser
-81488783 CartridgeTracker Tracker
-294335127 Character Character
-1633663176 CircuitboardAdvAirlockControl Advanced Airlock
-725140769 CircuitboardAdvancedAirlockControl Advanced Airlock
-1618019559 CircuitboardAirControl Air Control
-912176135 CircuitboardAirlockControl Airlock
--412104504 CircuitboardCameraDisplay Camera Display
-855694771 CircuitboardDoorControl Door Control
--82343730 CircuitboardGasDisplay Gas Display
-1344368806 CircuitboardGraphDisplay Graph Display
-1633074601 CircuitboardHashDisplay Hash Display
--1134148135 CircuitboardModeControl Mode Control
--1923778429 CircuitboardPowerControl Power Control
--2044446819 CircuitboardShipDisplay Ship Display
-2020180320 CircuitboardSolarControl Solar Control
-1702246124 Cobalt Cobalt
-557517660 ColorBlue Blue Coloring
-2129955242 ColorGreen Green Coloring
-1728153015 ColorOrange Orange Coloring
-667001276 ColorRed Red Coloring
--1430202288 ColorYellow Yellow Coloring
-917709227 CompositeFloorGrating1 Composite Floor Grating (Type 1)
--1346736111 CompositeFloorGrating2 Composite Floor Grating (Type 2)
-1228794916 CompositeRollCover Composite Roll Cover
--1399197262 CompositeWallPanelling1 Composite Wall Panelling
--786918288 CompositeWallPanelling10 Composite Wall Panelling 10
--1507875610 CompositeWallPanelling11 Composite Wall Panelling 11
-1058469212 CompositeWallPanelling12 Composite Wall Panelling 12
-1209124298 CompositeWallPanelling13 Composite Wall Panelling 13
--696954775 CompositeWallPanelling14 Composite Wall Panelling 14
--1586339585 CompositeWallPanelling15 Composite Wall Panelling 15
-947597637 CompositeWallPanelling16 Composite Wall Panelling 16
-1333526995 CompositeWallPanelling17 Composite Wall Panelling 17
--540861374 CompositeWallPanelling18 Composite Wall Panelling 18
--1463538476 CompositeWallPanelling19 Composite Wall Panelling 19
-898670600 CompositeWallPanelling2 Composite Wall Panelling 2
--97138765 CompositeWallPanelling20 Composite Wall Panelling 20
--1926039771 CompositeWallPanelling21 Composite Wall Panelling 21
-1117229214 CompositeWallPanelling3 Composite Wall Panelling 3
--588053187 CompositeWallPanelling4 Composite Wall Panelling 4
--1410058837 CompositeWallPanelling5 Composite Wall Panelling 5
-855467025 CompositeWallPanelling6 Composite Wall Panelling 6
-1174033543 CompositeWallPanelling7 Composite Wall Panelling 7
--716879594 CompositeWallPanelling8 Composite Wall Panelling 8
--1572701824 CompositeWallPanelling9 Composite Wall Panelling 9
-1731241392 Constantan Constantan
--1172078909 Copper Copper
-1550709753 Corn Corn
-1259154447 Corner1 Corner
-8709219 CrateMkII Crate Mk II
--1865671034 Cube Cube
-1531087544 DecayedFood Decayed Food
--1844430312 DeviceLfoVolume Low frequency oscillator
-1762696475 DeviceStepUnit Device Step Unit
-519913639 DynamicAirConditioner Portable Air Conditioner
-1941079206 DynamicCrate Dynamic Crate
-1404648592 DynamicCrateBuildingSupplies Crate (Building Supplies)
--746362430 DynamicCrateCableSupplies Crate (Cabling Supplies)
-166707648 DynamicCrateConveyorSupplies Crate (Conveyor Supplies)
--282237045 DynamicCratePipeSupplies Crate (Pipe Supplies)
--2085885850 DynamicGPR Ground Penetrating Radar (GPR)
--1713611165 DynamicGasCanisterAir Portable Gas Tank (Air)
--322413931 DynamicGasCanisterCarbonDioxide Portable Gas Tank (CO2)
--1741267161 DynamicGasCanisterEmpty Portable Gas Tank
--817051527 DynamicGasCanisterFuel Portable Gas Tank (Fuel)
-121951301 DynamicGasCanisterNitrogen Portable Gas Tank (Nitrogen)
-30727200 DynamicGasCanisterNitrousOxide Portable Gas Tank (Nitrous Oxide)
-1360925836 DynamicGasCanisterOxygen Portable Gas Tank (Oxygen)
-396065382 DynamicGasCanisterPollutants Portable Gas Tank (Pollutants)
--8883951 DynamicGasCanisterRocketFuel Dynamic Gas Canister Rocket Fuel
-108086870 DynamicGasCanisterVolatiles Portable Gas Tank (Volatiles)
-197293625 DynamicGasCanisterWater Portable Liquid Tank (Water)
--386375420 DynamicGasTankAdvanced Gas Tank Mk II
--1264455519 DynamicGasTankAdvancedOxygen Portable Gas Tank Mk II (Oxygen)
-1637373684 DynamicGasTankAdvancedWater Portable Liquid Tank Mk II (Water)
--82087220 DynamicGenerator Portable Generator
-587726607 DynamicHydroponics Portable Hydroponics
--21970188 DynamicLight Portable Light
--1199074750 DynamicLightNetworkTest Dynamic Light Network Test
--1939209112 DynamicLiquidCanisterEmpty Portable Liquid Tank
-2130739600 DynamicMKIILiquidCanisterEmpty Portable Liquid Tank Mk II
--319510386 DynamicMKIILiquidCanisterWater Portable Liquid Tank Mk II (Water)
--1842190124 DynamicPortal Dynamic Portal
-755048589 DynamicScrubber Portable Air Scrubber
-106953348 DynamicSkeleton Skeleton
-1275592521 EffectSplatEgg Effect Splat Egg
-1887084450 Egg Egg
--311170652 ElectronicPrinterMod Electronic Printer Mod
-478264742 Electrum Electrum
--110788403 ElevatorCarrage Elevator
--1263359062 EntityAlien Entity Alien
-1730165908 EntityChick Entity Chick
-334097180 EntityChickenBrown Entity Chicken Brown
-1010807532 EntityChickenWhite Entity Chicken White
--1536144399 EntityGraylien Entity Graylien
-966959649 EntityRoosterBlack Entity Rooster Black
--583103395 EntityRoosterBrown Entity Rooster Brown
--865687737 Fenoxitone Fenoxitone
-1517856652 Fertilizer Fertilizer
--86315541 FireArmSMG Fire Arm SMG
-1845441951 Flag_ODA_10m Flag (ODA 10m)
-1159126354 Flag_ODA_4m Flag (ODA 4m)
-1998634960 Flag_ODA_6m Flag (ODA 6m)
--375156130 Flag_ODA_8m Flag (ODA 8m)
-118685786 FlareGun Flare Gun
--811006991 Flour Flour
-1122161317 GasRocketEngineBasic Gas Rocket Engine Basic
-1397815367 GasTankAir Gas Tank (Air)
--409226641 Gold Gold
-1840108251 H2Combustor H2 Combustor
-247238062 Handgun Handgun
-1254383185 HandgunMagazine Handgun Magazine
-2019732679 Hastelloy Hastelloy
--857713709 HumanSkull Human Skull
-2003628602 Hydrocarbon Hydrocarbon
--73796547 ImGuiCircuitboardAirlockControl Airlock (Experimental)
--586072179 Inconel Inconel
--1905065374 InsulatedLiquidPipeCorner Insulated Liquid Pipe Corner
-1778779251 InsulatedLiquidPipeCrossJunction Insulated Liquid Pipe Cross Junction
--1531664359 InsulatedLiquidPipeCrossJunction3 Insulated Liquid Pipe Cross Junction3
-986725818 InsulatedLiquidPipeCrossJunction4 Insulated Liquid Pipe Cross Junction4
-1305939244 InsulatedLiquidPipeCrossJunction5 Insulated Liquid Pipe Cross Junction5
--723624810 InsulatedLiquidPipeCrossJunction6 Insulated Liquid Pipe Cross Junction6
-415264035 InsulatedLiquidPipeJunction Insulated Liquid Pipe Junction
--916909854 InsulatedLiquidPipeStraight Insulated Liquid Pipe Straight
--626453759 Invar Invar
--666742878 Iron Iron
--842048328 ItemActiveVent Kit (Active Vent)
-1722785341 ItemAdvancedTablet Advanced Tablet
-176446172 ItemAlienMushroom Alien Mushroom
--9559091 ItemAmmoBox Ammo Box
-201215010 ItemAngleGrinder Angle Grinder
-1385062886 ItemArcWelder Arc Welder
-1757673317 ItemAreaPowerControl Kit (Power Controller)
-412924554 ItemAstroloyIngot Ingot (Astroloy)
--1662476145 ItemAstroloySheets Astroloy Sheets
-789015045 ItemAuthoringTool Authoring Tool
--1731627004 ItemAuthoringToolRocketNetwork
--1262580790 ItemBasketBall Basket Ball
-700133157 ItemBatteryCell Battery Cell (Small)
--459827268 ItemBatteryCellLarge Battery Cell (Large)
-544617306 ItemBatteryCellNuclear Battery Cell (Nuclear)
--1866880307 ItemBatteryCharger Kit (Battery Charger)
-1008295833 ItemBatteryChargerSmall Battery Charger Small
--869869491 ItemBeacon Tracking Beacon
--831480639 ItemBiomass Biomass
-954141841 ItemBook Book
-893514943 ItemBreadLoaf Bread Loaf
--1792787349 ItemCableAnalyser Kit (Cable Analyzer)
--466050668 ItemCableCoil Cable Coil
-2060134443 ItemCableCoilHeavy Cable Coil (Heavy)
-195442047 ItemCableFuse Kit (Cable Fuses)
--2104175091 ItemCannedCondensedMilk Canned Condensed Milk
--999714082 ItemCannedEdamame Canned Edamame
--1344601965 ItemCannedMushroom Canned Mushroom
-1161510063 ItemCannedPowderedEggs Canned Powdered Eggs
--1185552595 ItemCannedRicePudding Canned Rice Pudding
-791746840 ItemCerealBar Cereal Bar
-252561409 ItemCharcoal Charcoal
--772542081 ItemChemLightBlue Chem Light (Blue)
--597479390 ItemChemLightGreen Chem Light (Green)
--525810132 ItemChemLightRed Chem Light (Red)
-1312166823 ItemChemLightWhite Chem Light (White)
-1224819963 ItemChemLightYellow Chem Light (Yellow)
--869697826 ItemClothingBagOveralls_Aus Overalls (Australia)
-611886665 ItemClothingBagOveralls_Brazil Overalls (Brazil)
-1265354377 ItemClothingBagOveralls_Canada Overalls (Canada)
--271773907 ItemClothingBagOveralls_China Overalls (China)
-1969872429 ItemClothingBagOveralls_EU Overalls (EU)
-670416861 ItemClothingBagOveralls_France Overalls (France)
-1858014029 ItemClothingBagOveralls_Germany Overalls (Germany)
--1694123145 ItemClothingBagOveralls_Japan Overalls (Japan)
--1309808369 ItemClothingBagOveralls_Korea Overalls (Korea)
-102898295 ItemClothingBagOveralls_NZ Overalls (NZ)
-520003812 ItemClothingBagOveralls_Russia Overalls (Russia)
--265868019 ItemClothingBagOveralls_SouthAfrica Overalls (South Africa)
--979046113 ItemClothingBagOveralls_UK Overalls (UK)
--691508919 ItemClothingBagOveralls_US Overalls (US)
--198158955 ItemClothingBagOveralls_Ukraine Overalls (Ukraine)
-1724793494 ItemCoalOre Ore (Coal)
--1778339150 ItemCobaltIngot Ingot (Cobalt)
--983091249 ItemCobaltOre Ore (Cobalt)
-1800622698 ItemCoffeeMug Coffee Mug
--954489473 ItemCompositeFloorGrating Composite Floor Grating
-1058547521 ItemConstantanIngot Ingot (Constantan)
-1715917521 ItemCookedCondensedMilk Condensed Milk
-1344773148 ItemCookedCorn Cooked Corn
--1076892658 ItemCookedMushroom Cooked Mushroom
--1712264413 ItemCookedPowderedEggs Powdered Eggs
-1849281546 ItemCookedPumpkin Cooked Pumpkin
-2013539020 ItemCookedRice Cooked Rice
-1353449022 ItemCookedSoybean Cooked Soybean
--709086714 ItemCookedTomato Cooked Tomato
--404336834 ItemCopperIngot Ingot (Copper)
--707307845 ItemCopperOre Ore (Copper)
-258339687 ItemCorn Corn
-545034114 ItemCornSoup Corn Soup
--1756772618 ItemCreditCard Credit Card
-215486157 ItemCropHay Hay
-856108234 ItemCrowbar Crowbar
-1005843700 ItemDataDisk Data Disk
--1958662275 ItemDecorFern Decorative Fern
-902565329 ItemDirtCanister Dirt Canister
-789388065 ItemDirtCannister Dirt Cannister
--1234745580 ItemDirtyOre Dirty Ore
--2124435700 ItemDisposableBatteryCharger Disposable Battery Charger
-2009673399 ItemDrill Hand Drill
--1943134693 ItemDuctTape Duct Tape
-1072914031 ItemDynamicAirCon Kit (Portable Air Conditioner)
--971920158 ItemDynamicScrubber Kit (Portable Scrubber)
--1202955052 ItemDynamite Dynamite
--873909936 ItemEgg Egg
-682727744 ItemEggBottom Egg Bottom
--524289310 ItemEggCarton Egg Carton
-1436756543 ItemEggTop Egg Top
-731250882 ItemElectronicParts Electronic Parts
-502280180 ItemElectrumIngot Ingot (Electrum)
--351438780 ItemEmergencyAngleGrinder Emergency Angle Grinder
--1056029600 ItemEmergencyArcWelder Emergency Arc Welder
-976699731 ItemEmergencyCrowbar Emergency Crowbar
--2052458905 ItemEmergencyDrill Emergency Drill
-1791306431 ItemEmergencyEvaSuit Emergency Eva Suit
-350596352 ItemEmergencyHelmet Emergency Helmet
--1061510408 ItemEmergencyPickaxe Emergency Pickaxe
-266099983 ItemEmergencyScrewdriver Emergency Screwdriver
-205916793 ItemEmergencySpaceHelmet Emergency Space Helmet
-1661941301 ItemEmergencyToolBelt Emergency Tool Belt
-2102803952 ItemEmergencyWireCutters Emergency Wire Cutters
-162553030 ItemEmergencyWrench Emergency Wrench
-1013818348 ItemEmptyCan Empty Can
-1677018918 ItemEvaSuit Eva Suit
-235361649 ItemExplosive Remote Explosive
--233482317 ItemExplosiveBasic Explosive Basic
-892110467 ItemFern Fern
--383972371 ItemFertilizedEgg Egg
-266654416 ItemFilterFern Darga Fern
-1578288856 ItemFireExtinguisher Fire Extinguisher
-2011191088 ItemFlagSmall Kit (Small Flag)
--2107840748 ItemFlashingLight Kit (Flashing Light)
--838472102 ItemFlashlight Flashlight
--665995854 ItemFlour Flour
--1573623434 ItemFlowerBlue Flower (Blue)
--1513337058 ItemFlowerGreen Flower (Green)
--1411986716 ItemFlowerOrange Flower (Orange)
--81376085 ItemFlowerRed Flower (Red)
-1712822019 ItemFlowerYellow Flower (Yellow)
--57608687 ItemFrenchFries Canned French Fries
-1371786091 ItemFries French Fries
--767685874 ItemGasCanisterCarbonDioxide Canister (CO2)
-42280099 ItemGasCanisterEmpty Canister
--1014695176 ItemGasCanisterFuel Canister (Fuel)
-2145068424 ItemGasCanisterNitrogen Canister (Nitrogen)
--1712153401 ItemGasCanisterNitrousOxide Gas Canister (Sleeping)
--1152261938 ItemGasCanisterOxygen Canister (Oxygen)
--1552586384 ItemGasCanisterPollutants Canister (Pollutants)
--668314371 ItemGasCanisterSmart Gas Canister (Smart)
--472094806 ItemGasCanisterVolatiles Canister (Volatiles)
--1854861891 ItemGasCanisterWater Liquid Canister (Water)
-1635000764 ItemGasFilterCarbonDioxide Filter (Carbon Dioxide)
--185568964 ItemGasFilterCarbonDioxideInfinite Catalytic Filter (Carbon Dioxide)
-1876847024 ItemGasFilterCarbonDioxideL Heavy Filter (Carbon Dioxide)
-416897318 ItemGasFilterCarbonDioxideM Medium Filter (Carbon Dioxide)
-632853248 ItemGasFilterNitrogen Filter (Nitrogen)
-152751131 ItemGasFilterNitrogenInfinite Catalytic Filter (Nitrogen)
--1387439451 ItemGasFilterNitrogenL Heavy Filter (Nitrogen)
--632657357 ItemGasFilterNitrogenM Medium Filter (Nitrogen)
--1247674305 ItemGasFilterNitrousOxide Filter (Nitrous Oxide)
--123934842 ItemGasFilterNitrousOxideInfinite Catalytic Filter (Nitrous Oxide)
-465267979 ItemGasFilterNitrousOxideL Heavy Filter (Nitrous Oxide)
-1824284061 ItemGasFilterNitrousOxideM Medium Filter (Nitrous Oxide)
--721824748 ItemGasFilterOxygen Filter (Oxygen)
--1055451111 ItemGasFilterOxygenInfinite Catalytic Filter (Oxygen)
--1217998945 ItemGasFilterOxygenL Heavy Filter (Oxygen)
--1067319543 ItemGasFilterOxygenM Medium Filter (Oxygen)
-1915566057 ItemGasFilterPollutants Filter (Pollutant)
--503738105 ItemGasFilterPollutantsInfinite Catalytic Filter (Pollutants)
-1959564765 ItemGasFilterPollutantsL Heavy Filter (Pollutants)
-63677771 ItemGasFilterPollutantsM Medium Filter (Pollutants)
-15011598 ItemGasFilterVolatiles Filter (Volatiles)
--1916176068 ItemGasFilterVolatilesInfinite Catalytic Filter (Volatiles)
-1255156286 ItemGasFilterVolatilesL Heavy Filter (Volatiles)
-1037507240 ItemGasFilterVolatilesM Medium Filter (Volatiles)
--1993197973 ItemGasFilterWater Filter (Water)
--1678456554 ItemGasFilterWaterInfinite Catalytic Filter (Water)
-2004969680 ItemGasFilterWaterL Heavy Filter (Water)
-8804422 ItemGasFilterWaterM Medium Filter (Water)
-1717593480 ItemGasSensor Kit (Gas Sensor)
--2113012215 ItemGasTankStorage Kit (Canister Storage)
-1588896491 ItemGlassSheets Glass Sheets
--1068925231 ItemGlasses Glasses
-226410516 ItemGoldIngot Ingot (Gold)
--1348105509 ItemGoldOre Ore (Gold)
-1544275894 ItemGrenade Hand Grenade
-470636008 ItemHEMDroidRepairKit HEMDroid Repair Kit
-745978059 ItemHandSanitizer Hand Sanitizer
-374891127 ItemHardBackpack Hardsuit Backpack
--412551656 ItemHardJetpack Hardsuit Jetpack
-900366130 ItemHardMiningBackPack Hard Mining Backpack
--1758310454 ItemHardSuit Hardsuit
--84573099 ItemHardsuitHelmet Hardsuit Helmet
-1579842814 ItemHastelloyIngot Ingot (Hastelloy)
-299189339 ItemHat Hat
--1075983932 ItemHealPill Heal Pill
-998653377 ItemHighVolumeGasCanisterEmpty High Volume Gas Canister
--1117581553 ItemHorticultureBelt Horticulture Belt
--1193543727 ItemHydroponicTray Kit (Hydroponic Tray)
--1555582482 ItemIcarusHelmet Icarus Helmet
--2112405954 ItemIcarusSuit Icarus Suit
-1217489948 ItemIce Ice (Water)
-890106742 ItemIgniter Kit (Igniter)
--787796599 ItemInconelIngot Ingot (Inconel)
--299044195 ItemInsulatedTankConnector Insulated (Tank Connector)
--122188311 ItemInsulatedTankConnectorLiquid Kit (Insulated Tank Connector Liquid)
-897176943 ItemInsulation Insulation
--744098481 ItemIntegratedCircuit10 Integrated Circuit (IC10)
--297990285 ItemInvarIngot Ingot (Invar)
-1225836666 ItemIronFrames Iron Frames
--1301215609 ItemIronIngot Ingot (Iron)
-1758427767 ItemIronOre Ore (Iron)
--487378546 ItemIronSheets Iron Sheets
-1969189000 ItemJetpackBasic Jetpack Basic
-496830914 ItemKitAIMeE Kit (AIMeE)
-513258369 ItemKitAccessBridge Kit (Access Bridge)
--1431998347 ItemKitAdvancedComposter Kit (Advanced Composter)
--616758353 ItemKitAdvancedFurnace Kit (Advanced Furnace)
--598545233 ItemKitAdvancedPackagingMachine Kit (Advanced Packaging Machine)
-964043875 ItemKitAirlock Kit (Airlock)
-682546947 ItemKitAirlockGate Kit (Hangar Door)
--98995857 ItemKitArcFurnace Kit (Arc Furnace)
-1222286371 ItemKitAtmospherics Kit (Atmospherics)
--1985198635 ItemKitAutoMiner Kit (Auto Miner)
-1668815415 ItemKitAutoMinerSmall Kit (Autominer Small)
--1753893214 ItemKitAutolathe Kit (Autolathe)
--1931958659 ItemKitAutomatedOven Kit (Automated Oven)
-148305004 ItemKitBasket Kit (Basket)
-1406656973 ItemKitBattery Kit (Battery)
--21225041 ItemKitBatteryLarge Kit (Battery Large)
-249073136 ItemKitBeacon Kit (Beacon)
--1241256797 ItemKitBeds Kit (Beds)
--1755116240 ItemKitBlastDoor Kit (Blast Door)
-578182956 ItemKitCentrifuge Kit (Centrifuge)
--1394008073 ItemKitChairs Kit (Chairs)
-1025254665 ItemKitChute Kit (Basic Chutes)
--876560854 ItemKitChuteUmbilical Kit (Chute Umbilical)
--1470820996 ItemKitCompositeCladding Kit (Cladding)
-1182412869 ItemKitCompositeFloorGrating Kit (Floor Grating)
-1990225489 ItemKitComputer Kit (Computer)
--1241851179 ItemKitConsole Kit (Consoles)
--581253863 ItemKitConveyor Kit (Conveyors)
-429365598 ItemKitCrate Kit (Crate)
--1585956426 ItemKitCrateMkII Kit (Crate Mk II)
--551612946 ItemKitCrateMount Kit (Container Mount)
--545234195 ItemKitCryoTube Kit (Cryo Tube)
--1340655007 ItemKitCube Kit (Cube)
--1825913764 ItemKitDebug Kit (Debug)
--1935075707 ItemKitDeepMiner Kit (Deep Miner)
-77421200 ItemKitDockingPort Kit (Docking Port)
-168615924 ItemKitDoor Kit (Door)
--1743663875 ItemKitDrinkingFountain Kit (Drinking Fountain)
-1584075627 ItemKitDuct Kit (Duct)
--1061945368 ItemKitDynamicCanister Kit (Portable Gas Tank)
-1533501495 ItemKitDynamicGasTankAdvanced Kit (Portable Gas Tank Mk II)
--732720413 ItemKitDynamicGenerator Kit (Portable Generator)
--1861154222 ItemKitDynamicHydroponics Kit (Portable Hydroponics)
-375541286 ItemKitDynamicLiquidCanister Kit (Portable Liquid Tank)
--638019974 ItemKitDynamicMKIILiquidCanister Kit (Portable Liquid Tank Mk II)
-1603046970 ItemKitElectricUmbilical Kit (Power Umbilical)
--1181922382 ItemKitElectronicsPrinter Kit (Electronics Printer)
--945806652 ItemKitElevator Kit (Elevator)
--1036468582 ItemKitEngine Kit (Engines)
-755302726 ItemKitEngineLarge Kit (Engine Large)
-1969312177 ItemKitEngineMedium Kit (Engine Medium)
-19645163 ItemKitEngineSmall Kit (Engine Small)
-1587787610 ItemKitEvaporationChamber Kit (Phase Change Device)
-750443106 ItemKitFabrication Kit (Fabrication)
-1500664489 ItemKitFabricator Kit (Fabricator)
-1701764190 ItemKitFlagODA Kit (ODA Flag)
--1168199498 ItemKitFridgeBig Kit (Fridge Large)
-1661226524 ItemKitFridgeSmall Kit (Fridge Small)
--806743925 ItemKitFurnace Kit (Furnace)
-1162905029 ItemKitFurniture Kit (Furniture)
--366262681 ItemKitFuselage Kit (Fuselage)
-1438837103 ItemKitFuselageTypeA Kit (Fuselage Type A)
--859064107 ItemKitFuselageTypeB Kit (Fuselage Type B)
--1144223677 ItemKitFuselageTypeC Kit (Fuselage Type C)
-631774688 ItemKitFuselageTypeD Kit (Fuselage Type D)
-377745425 ItemKitGasGenerator Kit (Gas Fuel Generator)
--1867280568 ItemKitGasUmbilical Kit (Gas Umbilical)
--375184378 ItemKitGenerator Kit (Generator)
-206848766 ItemKitGovernedGasRocketEngine Kit (Pumped Gas Rocket Engine)
-1354070388 ItemKitGovernedLiquidRocketEngine Kit (Pumped Liquid Rocket Engine)
--2140672772 ItemKitGroundTelescope Kit (Telescope)
-341030083 ItemKitGrowLight Kit (Grow Light)
-180482893 ItemKitGyroscope Kit (Gyroscope)
--1022693454 ItemKitHarvie Kit (Harvie)
--1710540039 ItemKitHeatExchanger Kit Heat Exchanger
-844391171 ItemKitHorizontalAutoMiner Kit (OGRE)
--2098556089 ItemKitHydraulicPipeBender Kit (Hydraulic Pipe Bender)
--927931558 ItemKitHydroponicAutomated Kit (Automated Hydroponics)
-2057179799 ItemKitHydroponicStation Kit (Hydroponic Station)
-288111533 ItemKitIceCrusher Kit (Ice Crusher)
-2067655311 ItemKitInsulatedLiquidPipe Kit (Insulated Liquid Pipe)
-452636699 ItemKitInsulatedPipe Kit (Insulated Pipe)
--1708400347 ItemKitInsulatedWaterPipe Insulated Water Pipe Kit
-1935945891 ItemKitInteriorDoors Kit (Interior Doors)
-489494578 ItemKitLadder Kit (Ladder)
--1793485995 ItemKitLandingPad Kit (Landing Pad)
-1817007843 ItemKitLandingPadAtmos Kit (Landing Pad Atmospherics)
-293581318 ItemKitLandingPadBasic Kit (Landing Pad Basic)
--1267511065 ItemKitLandingPadWaypoint Kit (Landing Pad Runway)
-450164077 ItemKitLargeDirectHeatExchanger Kit (Large Direct Heat Exchanger)
-847430620 ItemKitLargeExtendableRadiator Kit (Large Extendable Radiator)
--2039971217 ItemKitLargeSatelliteDish Kit (Large Satellite Dish)
--1854167549 ItemKitLaunchMount Kit (Launch Mount)
--1791423603 ItemKitLaunchPad Kit (Launch Pad)
--174523552 ItemKitLaunchTower Kit (Rocket Launch Tower)
-1951126161 ItemKitLiquidRegulator Kit (Liquid Regulator)
--799849305 ItemKitLiquidTank Kit (Liquid Tank)
-617773453 ItemKitLiquidTankInsulated Kit (Insulated Liquid Tank)
--1805020897 ItemKitLiquidTurboVolumePump Kit (Turbo Volume Pump - Liquid)
-1571996765 ItemKitLiquidUmbilical Kit (Liquid Umbilical)
-882301399 ItemKitLocker Kit (Locker)
-724972630 ItemKitLogic Kit (Logic Unit)
-1512322581 ItemKitLogicCircuit Kit (IC Housing)
-1997293610 ItemKitLogicInputOutput Kit (Logic I/O)
--2098214189 ItemKitLogicMemory Kit (Logic Memory)
-220644373 ItemKitLogicProcessor Kit (Logic Processor)
-124499454 ItemKitLogicSwitch Kit (Logic Switch)
-1005397063 ItemKitLogicTransmitter Kit (Logic Transmitter)
-1709456101 ItemKitLowVolumeLiquidPipes Kit (Low Volume Liquid Pipe)
--94545890 ItemKitLowVolumePipes Kit (Low Volume Pipe)
--344968335 ItemKitMotherShipCore Kit (Mothership)
--2038889137 ItemKitMusicMachines Kit (Music Machines)
-313966123 ItemKitOrganicsPrinter Kit (Organics Printer)
--559068873 ItemKitPassiveLargeRadiator Kit (Medium Radiator)
--1752768283 ItemKitPassiveLargeRadiatorGas Kit (Medium Radiator)
-1453961898 ItemKitPassiveLargeRadiatorLiquid Kit (Medium Radiator Liquid)
-1546379588 ItemKitPassiveVent Kit (Passive Vent)
-636112787 ItemKitPassthroughHeatExchanger Kit (CounterFlow Heat Exchanger)
--2062364768 ItemKitPictureFrame Kit Picture Frame
--1619793705 ItemKitPipe Kit (Pipe)
--1166461357 ItemKitPipeLiquid Kit (Liquid Pipe)
--827125300 ItemKitPipeOrgan Kit (Pipe Organ)
-920411066 ItemKitPipeRadiator Kit (Pipe Radiator)
--1697302609 ItemKitPipeRadiatorLiquid Kit (Pipe Radiator Liquid)
-1934508338 ItemKitPipeUtility Kit (Pipe Utility Gas)
-595478589 ItemKitPipeUtilityLiquid Kit (Pipe Utility Liquid)
-2146152113 ItemKitPipeValve Kit (Pipe Valve)
-119096484 ItemKitPlanter Kit (Planter)
-1041148999 ItemKitPortablesConnector Kit (Portables Connector)
-291368213 ItemKitPowerTransmitter Kit (Power Transmitter)
--831211676 ItemKitPowerTransmitterOmni Kit (Power Transmitter Omni)
-2015439334 ItemKitPoweredVent Kit (Powered Vent)
--121514007 ItemKitPressureFedGasEngine Kit (Pressure Fed Gas Engine)
--99091572 ItemKitPressureFedLiquidEngine Kit (Pressure Fed Liquid Engine)
-123504691 ItemKitPressurePlate Kit (Trigger Plate)
-1921918951 ItemKitPumpedLiquidEngine Kit (Pumped Liquid Engine)
-750176282 ItemKitRailing Kit (Railing)
-849148192 ItemKitRecycler Kit (Recycler)
-1181371795 ItemKitRegulator Kit (Pressure Regulator)
-1459985302 ItemKitReinforcedWindows Kit (Reinforced Windows)
-724776762 ItemKitResearchMachine Kit Research Machine
-1574688481 ItemKitRespawnPointWallMounted Kit (Respawn)
-1396305045 ItemKitRocketAvionics Kit (Avionics)
--314072139 ItemKitRocketBattery Kit (Rocket Battery)
-479850239 ItemKitRocketCargoStorage Kit (Rocket Cargo Storage)
--303008602 ItemKitRocketCelestialTracker Kit (Rocket Celestial Tracker)
-721251202 ItemKitRocketCircuitHousing Kit (Rocket Circuit Housing)
--1256996603 ItemKitRocketDatalink Kit (Rocket Datalink)
--1811652578 ItemKitRocketFuelTanks Kit (Rocket Fuel Tanks)
--1629347579 ItemKitRocketGasFuelTank Kit (Rocket Gas Fuel Tank)
--368220577 ItemKitRocketLaunchPad Kit (Rocket Launch Pad)
-2032027950 ItemKitRocketLiquidFuelTank Kit (Rocket Liquid Fuel Tank)
--636127860 ItemKitRocketManufactory Kit (Rocket Manufactory)
--867969909 ItemKitRocketMiner Kit (Rocket Miner)
--1603934523 ItemKitRocketParts Rocket Internal Parts
-1753647154 ItemKitRocketScanner Kit (Rocket Scanner)
--932335800 ItemKitRocketTransformerSmall Kit (Transformer Small (Rocket))
-1647730352 ItemKitRockets Rocket External Parts
-1827215803 ItemKitRoverFrame Kit (Rover Frame)
-197243872 ItemKitRoverMKI Kit (Rover Mk I)
-323957548 ItemKitSDBHopper Kit (SDB Hopper)
-178422810 ItemKitSatelliteDish Kit (Medium Satellite Dish)
-578078533 ItemKitSecurityPrinter Kit (Security Printer)
--1776897113 ItemKitSensor Kit (Sensors)
-735858725 ItemKitShower Kit (Shower)
-529996327 ItemKitSign Kit (Sign)
-326752036 ItemKitSleeper Kit (Sleeper)
--1332682164 ItemKitSmallDirectHeatExchanger Kit (Small Direct Heat Exchanger)
-1960952220 ItemKitSmallSatelliteDish Kit (Small Satellite Dish)
--1924492105 ItemKitSolarPanel Kit (Solar Panel)
-844961456 ItemKitSolarPanelBasic Kit (Solar Panel Basic)
--528695432 ItemKitSolarPanelBasicReinforced Kit (Solar Panel Basic Heavy)
--364868685 ItemKitSolarPanelReinforced Kit (Solar Panel Heavy)
-1293995736 ItemKitSolidGenerator Kit (Solid Generator)
-969522478 ItemKitSorter Kit (Sorter)
--126038526 ItemKitSpeaker Kit (Speaker)
-1013244511 ItemKitStacker Kit (Stacker)
-170878959 ItemKitStairs Kit (Stairs)
--1868555784 ItemKitStairwell Kit (Stairwell)
-2133035682 ItemKitStandardChute Kit (Powered Chutes)
--134410934 ItemKitStellarAnchor Kit (Stellar Anchor)
--1821571150 ItemKitStirlingEngine Kit (Stirling Engine)
--679276969 ItemKitStorage Kit (Storage)
--1538229217 ItemKitStructureLaunchPad Kit (Launch Pad)
--347156845 ItemKitStructureModularRocketCargo01 Kit (Modular Rocket Cargo)
--34763297 ItemKitStructureModularRocketEngine01 Kit (Modular Rocket Engine)
--1838947287 ItemKitStructureModularRocketFueltank01 Kit (Modular Rocket Fueltank)
-1088892825 ItemKitSuitStorage Kit (Suit Storage)
--1361598922 ItemKitTables Kit (Tables)
-771439840 ItemKitTank Kit (Tank)
-1021053608 ItemKitTankInsulated Kit (Tank Insulated)
-529137748 ItemKitToolManufactory Kit (Tool Manufactory)
--655661931 ItemKitTorpedoTube Kit (Torpedo Launcher)
--453039435 ItemKitTransformer Kit (Transformer Large)
-665194284 ItemKitTransformerSmall Kit (Transformer Small)
--1590715731 ItemKitTurbineGenerator Kit (Turbine Generator)
--1248429712 ItemKitTurboVolumePump Kit (Turbo Volume Pump - Gas)
--479012046 ItemKitTurret Kit (Turret)
--1798044015 ItemKitUprightWindTurbine Kit (Upright Wind Turbine)
--2038384332 ItemKitVendingMachine Kit (Vending Machine)
--1867508561 ItemKitVendingMachineRefrigerated Kit (Vending Machine Refrigerated)
--1826855889 ItemKitWall Kit (Wall)
-1625214531 ItemKitWallArch Kit (Arched Wall)
--846838195 ItemKitWallFlat Kit (Flat Wall)
--784733231 ItemKitWallGeometry Kit (Geometric Wall)
--524546923 ItemKitWallIron Kit (Iron Wall)
--821868990 ItemKitWallPadded Kit (Padded Wall)
--210898273 ItemKitWallPanels Kit (Wall Panels)
-159886536 ItemKitWaterBottleFiller Kit (Water Bottle Filler)
-611181283 ItemKitWaterPurifier Kit (Water Purifier)
-337505889 ItemKitWeatherStation Kit (Weather Station)
--868916503 ItemKitWindTurbine Kit (Wind Turbine)
-1779979754 ItemKitWindowShutter Kit (Window Shutter)
--743968726 ItemLabeller Labeller
-141535121 ItemLaptop Laptop
-2134647745 ItemLeadIngot Ingot (Lead)
--190236170 ItemLeadOre Ore (Lead)
-1949076595 ItemLightSword Light Sword
--185207387 ItemLiquidCanisterEmpty Liquid Canister
-777684475 ItemLiquidCanisterSmart Liquid Canister (Smart)
-2036225202 ItemLiquidDrain Kit (Liquid Drain)
-226055671 ItemLiquidPipeAnalyzer Kit (Liquid Pipe Analyzer)
--248475032 ItemLiquidPipeHeater Pipe Heater Kit (Liquid)
--2126113312 ItemLiquidPipeValve Kit (Liquid Pipe Valve)
--2106280569 ItemLiquidPipeVolumePump Kit (Liquid Volume Pump)
-2037427578 ItemLiquidTankStorage Kit (Liquid Canister Storage)
-240174650 ItemMKIIAngleGrinder Mk II Angle Grinder
--2061979347 ItemMKIIArcWelder Mk II Arc Welder
-1440775434 ItemMKIICrowbar Mk II Crowbar
-324791548 ItemMKIIDrill Mk II Drill
-388774906 ItemMKIIDuctTape Mk II Duct Tape
--1875271296 ItemMKIIMiningDrill Mk II Mining Drill
--2015613246 ItemMKIIScrewdriver Mk II Screwdriver
--178893251 ItemMKIIWireCutters Mk II Wire Cutters
-1862001680 ItemMKIIWrench Mk II Wrench
-1399098998 ItemMarineBodyArmor Marine Armor
-1073631646 ItemMarineHelmet Marine Helmet
-1327248310 ItemMilk Milk
--1650383245 ItemMiningBackPack Mining Backpack
--676435305 ItemMiningBelt Mining Belt
-1471707059 ItemMiningBeltAdvanced Mining Belt MK II
-1470787934 ItemMiningBeltMKII Mining Belt MK II
-15829510 ItemMiningCharge Mining Charge
-1055173191 ItemMiningDrill Mining Drill
--1663349918 ItemMiningDrillHeavy Mining Drill (Heavy)
-1258187304 ItemMiningDrillPneumatic Pneumatic Mining Drill
-1467558064 ItemMkIIToolbelt Tool Belt MK II
--1864982322 ItemMuffin Muffin
-2044798572 ItemMushroom Mushroom
-982514123 ItemNVG Night Vision Goggles
--1406385572 ItemNickelIngot Ingot (Nickel)
-1830218956 ItemNickelOre Ore (Nickel)
--1499471529 ItemNitrice Ice (Nitrice)
--1805394113 ItemOxite Ice (Oxite)
-238631271 ItemPassiveVent Passive Vent
--1397583760 ItemPassiveVentInsulated Kit (Insulated Passive Vent)
-2042955224 ItemPeaceLily Peace Lily
--913649823 ItemPickaxe Pickaxe
-1118069417 ItemPillHeal Pill (Medical)
-418958601 ItemPillStun Pill (Paralysis)
--767597887 ItemPipeAnalyizer Kit (Pipe Analyzer)
--453870153 ItemPipeCorner Kit (Pipe Corner)
--38898376 ItemPipeCowl Pipe Cowl
--1315694144 ItemPipeCrossJunction Kit (Pipe Cross Junction)
--167258062 ItemPipeCrossJunction3 Kit (Pipe 3-Way Junction)
-526679303 ItemPipeCrossJunction5 Kit (Pipe 5-Way Junction)
--2039665475 ItemPipeCrossJunction6 Kit (Pipe 6-Way Junction)
--1532448832 ItemPipeDigitalValve Kit (Digital Valve)
--1134459463 ItemPipeGasMixer Kit (Gas Mixer)
--1751627006 ItemPipeHeater Pipe Heater Kit (Gas)
-1366030599 ItemPipeIgniter Kit (Pipe Igniter)
-391769637 ItemPipeLabel Kit (Pipe Label)
--906521320 ItemPipeLiquidRadiator Kit (Liquid Radiator)
-1207939683 ItemPipeMeter Kit (Pipe Meter)
--1796655088 ItemPipeRadiator Kit (Radiator)
--173267052 ItemPipeStraight Kit (Pipe Straight)
--274679544 ItemPipeTJunction Kit (Pipe T Junction)
-799323450 ItemPipeValve Kit (Pipe Valve)
--1766301997 ItemPipeVolumePump Kit (Volume Pump)
--1159179557 ItemPlantEndothermic_Creative Endothermic Plant Creative
-851290561 ItemPlantEndothermic_Genepool1 Winterspawn (Alpha variant)
--1414203269 ItemPlantEndothermic_Genepool2 Winterspawn (Beta variant)
-173023800 ItemPlantSampler Plant Sampler
--532672323 ItemPlantSwitchGrass Switch Grass
--1208890208 ItemPlantThermogenic_Creative Thermogenic Plant Creative
--177792789 ItemPlantThermogenic_Genepool1 Hades Flower (Alpha strain)
-1819167057 ItemPlantThermogenic_Genepool2 Hades Flower (Beta strain)
-662053345 ItemPlasticSheets Plastic Sheets
-1929046963 ItemPotato Potato
--2111886401 ItemPotatoBaked Baked Potato
-1305806506 ItemPowderedeggs Powdered Eggs
-839924019 ItemPowerConnector Kit (Power Connector)
-616428336 ItemPoweredEggs Powered Eggs
-1277828144 ItemPumpkin Pumpkin
-62768076 ItemPumpkinPie Pumpkin Pie
-1277979876 ItemPumpkinSoup Pumpkin Soup
--1616308158 ItemPureIce Pure Ice Water
--1251009404 ItemPureIceCarbonDioxide Pure Ice Carbon Dioxide
-944530361 ItemPureIceHydrogen Pure Ice Hydrogen
--1715945725 ItemPureIceLiquidCarbonDioxide Pure Ice Liquid Carbon Dioxide
--1044933269 ItemPureIceLiquidHydrogen Pure Ice Liquid Hydrogen
-1674576569 ItemPureIceLiquidNitrogen Pure Ice Liquid Nitrogen
-1428477399 ItemPureIceLiquidNitrous Pure Ice Liquid Nitrous
-541621589 ItemPureIceLiquidOxygen Pure Ice Liquid Oxygen
--1748926678 ItemPureIceLiquidPollutant Pure Ice Liquid Pollutant
--1306628937 ItemPureIceLiquidVolatiles Pure Ice Liquid Volatiles
--1708395413 ItemPureIceNitrogen Pure Ice Nitrogen
-386754635 ItemPureIceNitrous Pure Ice NitrousOxide
--1150448260 ItemPureIceOxygen Pure Ice Oxygen
--1755356 ItemPureIcePollutant Pure Ice Pollutant
--2073202179 ItemPureIcePollutedWater Pure Ice Polluted Water
--874791066 ItemPureIceSteam Pure Ice Steam
--633723719 ItemPureIceVolatiles Pure Ice Volatiles
-495305053 ItemRTG Kit (Creative RTG)
-1817645803 ItemRTGSurvival Kit (RTG)
--1641500434 ItemReagentMix Reagent Mix
-678483886 ItemRemoteDetonator Remote Detonator
-819096942 ItemResearchCapsule Research Capsule Blue
--1352732550 ItemResearchCapsuleGreen Research Capsule Green
-954947943 ItemResearchCapsuleRed Research Capsule Red
-750952701 ItemResearchCapsuleYellow Research Capsule Yellow
--1773192190 ItemReusableFireExtinguisher Fire Extinguisher (Reusable)
-658916791 ItemRice Rice
-871811564 ItemRoadFlare Road Flare
-2109945337 ItemRocketMiningDrillHead Mining-Drill Head (Basic)
-1530764483 ItemRocketMiningDrillHeadDurable Mining-Drill Head (Durable)
-653461728 ItemRocketMiningDrillHeadHighSpeedIce Mining-Drill Head (High Speed Ice)
-1440678625 ItemRocketMiningDrillHeadHighSpeedMineral Mining-Drill Head (High Speed Mineral)
--380904592 ItemRocketMiningDrillHeadIce Mining-Drill Head (Ice)
--684020753 ItemRocketMiningDrillHeadLongTerm Mining-Drill Head (Long Term)
-1083675581 ItemRocketMiningDrillHeadMineral Mining-Drill Head (Mineral)
--1198702771 ItemRocketScanningHead Rocket Scanner Head
-1661270830 ItemScanner Handheld Scanner
-687940869 ItemScrewdriver Screwdriver
--1981101032 ItemSecurityCamera Security Camera
--1176140051 ItemSensorLenses Sensor Lenses
--1154200014 ItemSensorProcessingUnitCelestialScanner Sensor Processing Unit (Celestial Scanner)
--1730464583 ItemSensorProcessingUnitMesonScanner Sensor Processing Unit (T-Ray Scanner)
--1219128491 ItemSensorProcessingUnitOreScanner Sensor Processing Unit (Ore Scanner)
--290196476 ItemSiliconIngot Ingot (Silicon)
-1103972403 ItemSiliconOre Ore (Silicon)
--929742000 ItemSilverIngot Ingot (Silver)
--916518678 ItemSilverOre Ore (Silver)
--82508479 ItemSolderIngot Ingot (Solder)
--365253871 ItemSolidFuel Solid Fuel (Hydrocarbon)
--1883441704 ItemSoundCartridgeBass Sound Cartridge Bass
--1901500508 ItemSoundCartridgeDrums Sound Cartridge Drums
--1174735962 ItemSoundCartridgeLeads Sound Cartridge Leads
--1971419310 ItemSoundCartridgeSynth Sound Cartridge Synth
-1387403148 ItemSoyOil Soy Oil
-1924673028 ItemSoybean Soybean
--1737666461 ItemSpaceCleaner Space Cleaner
-714830451 ItemSpaceHelmet Space Helmet
-675686937 ItemSpaceIce Space Ice
-2131916219 ItemSpaceOre Dirty Ore
--1260618380 ItemSpacepack Spacepack
--688107795 ItemSprayCanBlack Spray Paint (Black)
--498464883 ItemSprayCanBlue Spray Paint (Blue)
-845176977 ItemSprayCanBrown Spray Paint (Brown)
--1880941852 ItemSprayCanGreen Spray Paint (Green)
--1645266981 ItemSprayCanGrey Spray Paint (Grey)
-1918456047 ItemSprayCanKhaki Spray Paint (Khaki)
--158007629 ItemSprayCanOrange Spray Paint (Orange)
-1344257263 ItemSprayCanPink Spray Paint (Pink)
-30686509 ItemSprayCanPurple Spray Paint (Purple)
-1514393921 ItemSprayCanRed Spray Paint (Red)
-498481505 ItemSprayCanWhite Spray Paint (White)
-995468116 ItemSprayCanYellow Spray Paint (Yellow)
-1289723966 ItemSprayGun Spray Gun
--1448105779 ItemSteelFrames Steel Frames
--654790771 ItemSteelIngot Ingot (Steel)
-38555961 ItemSteelSheets Steel Sheets
--2038663432 ItemStelliteGlassSheets Stellite Glass Sheets
--1897868623 ItemStelliteIngot Ingot (Stellite)
--1335056202 ItemSugarCane Sugar Cane
-318109626 ItemSuitStorage Kit (Suit Storage)
--229808600 ItemTablet Handheld Tablet
--1782380726 ItemTankConnector Kit (Tank Connector)
--1579112308 ItemTankConnectorLiquid Kit (Liquid Tank Connector)
-111280987 ItemTerrainManipulator Terrain Manipulator
--998592080 ItemTomato Tomato
-688734890 ItemTomatoSoup Tomato Soup
--355127880 ItemToolBelt Tool Belt
--800947386 ItemTropicalPlant Tropical Lily
--1516581844 ItemUraniumOre Ore (Uranium)
-1253102035 ItemVolatiles Ice (Volatiles)
-1707117569 ItemVoxelTool Voxel Tool
--1567752627 ItemWallCooler Kit (Wall Cooler)
-1880134612 ItemWallHeater Kit (Wall Heater)
-1108423476 ItemWallLight Kit (Lights)
-156348098 ItemWaspaloyIngot Ingot (Waspaloy)
-1798764247 ItemWasteIngot Ingot (Waste)
-107741229 ItemWaterBottle Water Bottle
--1542288894 ItemWaterBottleFiller Water Bottle Filler
-309693520 ItemWaterPipeDigitalValve Kit (Liquid Digital Valve)
--1404370810 ItemWaterPipeHeater Pipe Heater Kit (Liquid)
--90898877 ItemWaterPipeMeter Kit (Liquid Pipe Meter)
--1721846327 ItemWaterWallCooler Kit (Liquid Wall Cooler)
--598730959 ItemWearLamp Headlamp
--2066892079 ItemWeldingTorch Welding Torch
--1057658015 ItemWheat Wheat
-1535854074 ItemWireCutters Wire Cutters
--504717121 ItemWirelessBatteryCellExtraLarge Wireless Battery Cell Extra Large
--777592237 ItemWreckage1 Wreckage
-1219474409 ItemWreckage2 Wreckage
-1068008319 ItemWreckage3 Wreckage
--1580460324 ItemWreckage4 Wreckage
-1443414563 ItemWreckageActiveVent1 Wreckage Active Vent
--1826023284 ItemWreckageAirConditioner1 Wreckage Air Conditioner
-169888054 ItemWreckageAirConditioner2 Wreckage Air Conditioner
--486036403 ItemWreckageAirlock1 Wreckage Airlock
-2047802871 ItemWreckageAirlock2 Wreckage Airlock
-479890266 ItemWreckageArcFurnace1 Wreckage Arc Furnace
--2053907744 ItemWreckageArcFurnace2 Wreckage Arc Furnace
--225121674 ItemWreckageArcFurnace3 Wreckage Arc Furnace
--1542823944 ItemWreckageAreaPowerControl1 Wreckage Area Power Control
-1023610434 ItemWreckageAreaPowerControl2 Wreckage Area Power Control
-1990336561 ItemWreckageAreaPowerControlReversed1 Wreckage Area Power Control Reversed
--273976949 ItemWreckageAreaPowerControlReversed2 Wreckage Area Power Control Reversed
--1207279124 ItemWreckageAutolathe1 Wreckage Autolathe
-553857110 ItemWreckageAutolathe2 Wreckage Autolathe
-1443102912 ItemWreckageAutolathe3 Wreckage Autolathe
--933194397 ItemWreckageAutolathe4 Wreckage Autolathe
--1083726347 ItemWreckageAutolathe5 Wreckage Autolathe
-644805711 ItemWreckageAutolathe6 Wreckage Autolathe
-1365886169 ItemWreckageAutolathe7 Wreckage Autolathe
--1509194433 ItemWreckageBlastDoor1 Wreckage Blast Door
-1057150085 ItemWreckageBlastDoor2 Wreckage Blast Door
--208145314 ItemWreckageCentrifuge1 Wreckage Centrifuge
-1788782052 ItemWreckageCentrifuge2 Wreckage Centrifuge
-496604530 ItemWreckageCentrifuge3 Wreckage Centrifuge
--2080571183 ItemWreckageCentrifuge4 Wreckage Centrifuge
--184930233 ItemWreckageCentrifuge5 Wreckage Centrifuge
-50205563 ItemWreckageCoalGenerator1 Wreckage Coal Generator
--1678294335 ItemWreckageCoalGenerator2 Wreckage Coal Generator
--319786409 ItemWreckageCoalGenerator3 Wreckage Coal Generator
-2077142147 ItemWreckageCompositeDoor1 Wreckage Composite Door
--490209991 ItemWreckageCompositeDoor2 Wreckage Composite Door
--1782526545 ItemWreckageCompositeDoor3 Wreckage Composite Door
-1635489893 ItemWreckageCompositeDoorGlass1 Wreckage Composite Door Glass
--126694945 ItemWreckageCompositeDoorGlass2 Wreckage Composite Door Glass
--1109808524 ItemWreckageConstructor Debug Wreckage Constructor
-2053466622 ItemWreckageElectrolysis1 Wreckage Electrolysis
--479446972 ItemWreckageElectrolysis2 Wreckage Electrolysis
--299987533 ItemWreckageElectronicsPrinter1 Wreckage Electronics Printer1
-1998052361 ItemWreckageElectronicsPrinter2 Wreckage Electronics Printer2
-1109151 ItemWreckageElectronicsPrinter3 Wreckage Electronics Printer3
--1636533956 ItemWreckageElectronicsPrinter4 Wreckage Electronics Printer4
--378320470 ItemWreckageElectronicsPrinter5 Wreckage Electronics Printer5
-1887049744 ItemWreckageElectronicsPrinter6 Wreckage Electronics Printer6
-807820730 ItemWreckageElevatorLevelFront1 Wreckage Elevator Level Front
--1456534528 ItemWreckageElevatorLevelFront2 Wreckage Elevator Level Front
--441091249 ItemWreckageElevatorShaftIndustrial1 Wreckage Elevator Shaft Industrial
-2092706549 ItemWreckageElevatorShaftIndustrial2 Wreckage Elevator Shaft Industrial
-196811363 ItemWreckageElevatorShaftIndustrial3 Wreckage Elevator Shaft Industrial
--690094117 ItemWreckageFlashingLight1 Wreckage Flashing Light
-1339338337 ItemWreckageFlashingLight2 Wreckage Flashing Light
-1504810883 ItemWreckageGasGenerator1 Wreckage Gas Generator
--1061632455 ItemWreckageGasGenerator2 Wreckage Gas Generator
--2111000740 ItemWreckageH2Combustor1 Wreckage H2 Combustor
-697994371 ItemWreckageHydroponicsAutomatic1 Wreckage Hydroponics Automatic
--1332486855 ItemWreckageHydroponicsAutomatic2 Wreckage Hydroponics Automatic
--946541137 ItemWreckageHydroponicsAutomatic3 Wreckage Hydroponics Automatic
--978136707 ItemWreckageHydroponicsStation1 Wreckage Hydroponics Station
-1555792071 ItemWreckageHydroponicsStation2 Wreckage Hydroponics Station
--310178617 ItemWreckageHydroponicsTray1 Wreckage Hydroponics Tray
--997763 ItemWreckageLargeExtendableRadiator01 Wreckage Large Extendable Radiator
-1494744304 ItemWreckageLight1 Wreckage Light
--1071731382 ItemWreckageLight2 Wreckage Light
--1932417031 ItemWreckageLightLongAngled1 Wreckage Light Long Angled
-366540355 ItemWreckageLightLongAngled2 Wreckage Light Long Angled
-512740782 ItemWreckageLightLongWide1 Wreckage Light Long Wide
--2021221356 ItemWreckageLightLongWide2 Wreckage Light Long Wide
--378382939 ItemWreckagePassiveVent1 Wreckage Passive Vent
--1755613692 ItemWreckageRecycler1 Wreckage Recycler
-240265150 ItemWreckageRecycler2 Wreckage Recycler
-2035619624 ItemWreckageRecycler3 Wreckage Recycler
--416185717 ItemWreckageRecycler4 Wreckage Recycler
--1875463651 ItemWreckageRecycler5 Wreckage Recycler
-155181991 ItemWreckageRecycler6 Wreckage Recycler
-514013016 ItemWreckageSDBSilo1 Wreckage SDB Silo
--2018875678 ItemWreckageSDBSilo2 Wreckage SDB Silo
--257075596 ItemWreckageSDBSilo3 Wreckage SDB Silo
-1858716631 ItemWreckageSDBSilo4 Wreckage SDB Silo
-432993089 ItemWreckageSDBSilo5 Wreckage SDB Silo
--1312888309 ItemWreckageSatelliteDish1 Wreckage Medium Satellite Dish
-683129777 ItemWreckageSatelliteDish2 Wreckage Medium Satellite Dish
-1605405479 ItemWreckageSatelliteDish3 Wreckage Medium Satellite Dish
--875253743 ItemWreckageSecurityPrinter1 Wreckage Security Printer
-1390272939 ItemWreckageSecurityPrinter2 Wreckage Security Printer
-635097405 ItemWreckageSecurityPrinter3 Wreckage Security Printer
--1145158498 ItemWreckageSecurityPrinter4 Wreckage Security Printer
--860261368 ItemWreckageSecurityPrinter5 Wreckage Security Printer
-1437607346 ItemWreckageSecurityPrinter6 Wreckage Security Printer
--1847771550 ItemWreckageShuttleLandingPad1 Wreckage Shuttle Landing Pad
-148139992 ItemWreckageShuttleLandingPad2 Wreckage Shuttle Landing Pad
-2144558926 ItemWreckageShuttleLandingPad3 Wreckage Shuttle Landing Pad
--508048659 ItemWreckageShuttleLandingPad4 Wreckage Shuttle Landing Pad
--1766786437 ItemWreckageShuttleLandingPad5 Wreckage Shuttle Landing Pad
--1796898215 ItemWreckageSolarPanel1 Wreckage Solar Panel
-233624547 ItemWreckageSolarPanel2 Wreckage Solar Panel
-2062279541 ItemWreckageSolarPanel3 Wreckage Solar Panel
-391453348 ItemWreckageStructureRTG1 Wreckage Structure RTG
--834664349 ItemWreckageStructureWeatherStation001 Wreckage Structure Weather Station
-1464424921 ItemWreckageStructureWeatherStation002 Wreckage Structure Weather Station
-542009679 ItemWreckageStructureWeatherStation003 Wreckage Structure Weather Station
--1104478996 ItemWreckageStructureWeatherStation004 Wreckage Structure Weather Station
--919745414 ItemWreckageStructureWeatherStation005 Wreckage Structure Weather Station
-1344576960 ItemWreckageStructureWeatherStation006 Wreckage Structure Weather Station
-656649558 ItemWreckageStructureWeatherStation007 Wreckage Structure Weather Station
--1214467897 ItemWreckageStructureWeatherStation008 Wreckage Structure Weather Station
-594559972 ItemWreckageTransformer1 Wreckage Transformer
--1166470562 ItemWreckageTransformer2 Wreckage Transformer
--123047854 ItemWreckageTransformerMedium1 Wreckage Transformer Medium
-1638081000 ItemWreckageTransformerMedium2 Wreckage Transformer Medium
-114353662 ItemWreckageTransformerSmall1 Wreckage Transformer Small
--1613122492 ItemWreckageTransformerSmall2 Wreckage Transformer Small
--1662394403 ItemWreckageTurbineGenerator1 Wreckage Turbine Generator
-98602599 ItemWreckageTurbineGenerator2 Wreckage Turbine Generator
-1927790321 ItemWreckageTurbineGenerator3 Wreckage Turbine Generator
-989049177 ItemWreckageVendingMachine1 Wreckage Vending Machine
--1543839517 ItemWreckageVendingMachine2 Wreckage Vending Machine
--721563531 ItemWreckageVendingMachine3 Wreckage Vending Machine
-1251558870 ItemWreckageVendingMachine4 Wreckage Vending Machine
-608007229 ItemWreckageVent1 Wreckage Vent
--1682930158 ItemWreckageWallCooler1 Wreckage Wall Cooler
-45733800 ItemWreckageWallCooler2 Wreckage Wall Cooler
-1989858879 ItemWreckageWallLightBatteryPowered1 Wreckage Wall Light Battery Powered
--275544187 ItemWreckageWallLightBatteryPowered2 Wreckage Wall Light Battery Powered
-1039364844 ItemWreckageWindTurbine001 Wreckage Wind Turbine
--1527110826 ItemWreckageWindTurbine002 Wreckage Wind Turbine
--738389056 ItemWreckageWindTurbine003 Wreckage Wind Turbine
-1301907043 ItemWreckageWindTurbine004 Wreckage Wind Turbine
-983480053 ItemWreckageWindTurbine005 Wreckage Wind Turbine
--1886261558 ItemWrench Wrench
--1959031919 KitPlanter Kit Planter
-1932952652 KitSDBSilo Kit (SDB Silo)
-231903234 KitStructureCombustionCentrifuge Kit (Combustion Centrifuge)
--1427415566 KitchenTableShort Kitchen Table (Short)
--78099334 KitchenTableSimpleShort Kitchen Table (Simple Short)
--1068629349 KitchenTableSimpleTall Kitchen Table (Simple Tall)
--1386237782 KitchenTableTall Kitchen Table (Tall)
-1605130615 Lander Lander
--1295222317 Landingpad_2x2CenterPiece01 Landingpad 2x2 Center Piece
-912453390 Landingpad_BlankPiece Landingpad
-1070143159 Landingpad_CenterPiece01 Landingpad Center
-1101296153 Landingpad_CrossPiece Landingpad Cross
--2066405918 Landingpad_DataConnectionPiece Landingpad Data And Power
-977899131 Landingpad_DiagonalPiece01 Landingpad Diagonal
-817945707 Landingpad_GasConnectorInwardPiece Landingpad Gas Input
--1100218307 Landingpad_GasConnectorOutwardPiece Landingpad Gas Output
-170818567 Landingpad_GasCylinderTankPiece Landingpad Gas Storage
--1216167727 Landingpad_LiquidConnectorInwardPiece Landingpad Liquid Input
--1788929869 Landingpad_LiquidConnectorOutwardPiece Landingpad Liquid Output
--976273247 Landingpad_StraightPiece01 Landingpad Straight
--1872345847 Landingpad_TaxiPieceCorner Landingpad Taxi Corner
-146051619 Landingpad_TaxiPieceHold Landingpad Taxi Hold
--1477941080 Landingpad_TaxiPieceStraight Landingpad Taxi Straight
--1514298582 Landingpad_ThreshholdPiece Landingpad Threshhold
--2002530571 Lead Lead
--1748149715 LiquidRocketEngineBasic Liquid Rocket Engine Basic
-1531272458 LogicStepSequencer8 Logic Step Sequencer
--1650443378 ManualGetResearchPodsRequired PodTypeToSearchFor
--99064335 Meteorite Meteorite
-471085864 Milk Milk
-96856935 ModularRocketCargo01 Rocket Cargo
-762107604 ModularRocketCommand01Lander Rocket Command Lander
--1667675295 MonsterEgg
--337075633 MotherboardComms Communications Motherboard
-502555944 MotherboardLogic Logic Motherboard
-296034716 MotherboardManufacturing Manufacturing Motherboard
--127121474 MotherboardMissionControl
--161107071 MotherboardProgrammableChip IC Editor Motherboard
--806986392 MotherboardRockets Rocket Control Motherboard
--1908268220 MotherboardSorter Sorter Motherboard
--1930442922 MothershipCore Mothership Core
-516242109 Mushroom Mushroom
--369148816 NPCDummyCharacter NPC Character
-556601662 Nickel Nickel
-155856647 NpcChick Chick
-399074198 NpcChicken Chicken
--561574140 NpcGrounder Npc Grounder
-1958538866 Oil Oil
-593101129 OrganBrain Human Brain
--144408069 OrganLungs Human Lungs
--2096246323 OrganLungsChicken Organ Lungs Chicken
-248893646 PassiveSpeaker Passive Speaker
-393296429 Phobos Phobos
-443947415 PipeBenderMod Pipe Bender Mod
-791382247 Plastic Plastic
--1958705204 PortableComposter Portable Composter
-2043318949 PortableSolarPanel Portable Solar Panel
--1657266385 Potato Potato
--1250164309 Pumpkin Pumpkin
--1514425813 QuarryDrillBitBasic Quarry Drill Bit Basic
-399661231 RailingElegant01 Railing Elegant (Type 1)
--1898247915 RailingElegant02 Railing Elegant (Type 2)
--2072792175 RailingIndustrial02 Railing Industrial (Type 2)
-1343512922 ReagentCarbon Carbon Powder
-1798609988 ReagentCobalt Cobalt Powder
-980054869 ReagentColorBlue Color Dye (Blue)
-120807542 ReagentColorGreen Color Dye (Green)
--400696159 ReagentColorOrange Color Dye (Orange)
-1998377961 ReagentColorRed Color Dye (Red)
-635208006 ReagentColorYellow Color Dye (Yellow)
-1281150963 ReagentElectrum Electrum Powder
--1247719781 ReagentFenoxitone Fenoxitone Powder
--867172244 ReagentGold Gold Powder
-1133218057 ReagentInvar Invar Powder
--1085822177 ReagentPotassiumIodide Potassium Iodide Powder
-649443269 ReagentSilver Silver Powder
--788672929 RespawnPoint Respawn Point
--491247370 RespawnPointWallMounted Respawn Point (Mounted)
-1951286569 Rice Rice
-434786784 Robot AIMeE Bot
-350726273 RoverCargo Rover (Cargo)
--2049946335 Rover_MkI Rover MkI
-861674123 Rover_MkI_build_states Rover MKI
--256607540 SMGMagazine SMG Magazine
--2086114347 SalicylicAcid Salicylic Acid
--1290755415 SeedBag_Corn Corn Seeds
--1990600883 SeedBag_Fern Fern Seeds
-311593418 SeedBag_Mushroom Mushroom Seeds
-1005571172 SeedBag_Potato Potato Seeds
-1423199840 SeedBag_Pumpkin Pumpkin Seeds
--1691151239 SeedBag_Rice Rice Seeds
-1783004244 SeedBag_Soybean Soybean Seeds
-488360169 SeedBag_Switchgrass Switchgrass Seed
--1922066841 SeedBag_Tomato Tomato Seeds
--654756733 SeedBag_Wheet Wheat Seeds
--1195893171 Silicon Silicon
-687283565 Silver Silver
--1206542381 Solder Solder
-1510471435 Soy Soy
--1991297271 SpaceShuttle Space Shuttle
--163799681 SpawnPoint Spawn Point
-1547278694 SpecialBlocks Special Blocks
-1331613335 Steel Steel
--500544800 Stellite Stellite
--1527229051 StopWatch Stop Watch
-1298920475 StructureAccessBridge Access Bridge
--1129453144 StructureActiveVent Active Vent
-446212963 StructureAdvancedComposter Advanced Composter
-545937711 StructureAdvancedFurnace Advanced Furnace
--463037670 StructureAdvancedPackagingMachine Advanced Packaging Machine
--2087593337 StructureAirConditioner Air Conditioner
--2105052344 StructureAirlock Airlock
-1736080881 StructureAirlockGate Small Hangar Door
-1811979158 StructureAngledBench Bench (Angled)
--247344692 StructureArcFurnace Arc Furnace
-1999523701 StructureAreaPowerControl Area Power Control
--1032513487 StructureAreaPowerControlReversed Area Power Control
-7274344 StructureAutoMinerSmall Autominer (Small)
-336213101 StructureAutolathe Autolathe
--1672404896 StructureAutomatedOven Automated Oven
-2099900163 StructureBackLiquidPressureRegulator Liquid Back Volume Regulator
--1149857558 StructureBackPressureRegulator Back Pressure Regulator
--1613497288 StructureBasketHoop Basket Hoop
--400115994 StructureBattery Station Battery
-1945930022 StructureBatteryCharger Battery Cell Charger
--761772413 StructureBatteryChargerSmall Battery Charger Small
--1388288459 StructureBatteryLarge Station Battery (Large)
--1125305264 StructureBatteryMedium Battery (Medium)
--2123455080 StructureBatterySmall Auxiliary Rocket Battery
--188177083 StructureBeacon Beacon
--2042448192 StructureBench Powered Bench
-406745009 StructureBench1 Bench (Counter Style)
--2127086069 StructureBench2 Bench (High Tech Style)
--164622691 StructureBench3 Bench (Frame Style)
-1750375230 StructureBench4 Bench (Workbench Style)
-337416191 StructureBlastDoor Blast Door
-697908419 StructureBlockBed Block Bed
-378084505 StructureBlocker Blocker
-1036015121 StructureCableAnalysizer Cable Analyzer
--889269388 StructureCableCorner Cable (Corner)
-980469101 StructureCableCorner3 Cable (3-Way Corner)
-318437449 StructureCableCorner3Burnt Burnt Cable (3-Way Corner)
-2393826 StructureCableCorner3HBurnt
--1542172466 StructureCableCorner4 Cable (4-Way Corner)
-268421361 StructureCableCorner4Burnt Burnt Cable (4-Way Corner)
--981223316 StructureCableCorner4HBurnt Burnt Heavy Cable (4-Way Corner)
--177220914 StructureCableCornerBurnt Burnt Cable (Corner)
--39359015 StructureCableCornerH Heavy Cable (Corner)
--1843379322 StructureCableCornerH3 Heavy Cable (3-Way Corner)
-205837861 StructureCableCornerH4 Heavy Cable (4-Way Corner)
-1931412811 StructureCableCornerHBurnt Burnt Cable (Corner)
-281380789 StructureCableFuse100k Fuse (100kW)
--1103727120 StructureCableFuse1k Fuse (1kW)
--349716617 StructureCableFuse50k Fuse (50kW)
--631590668 StructureCableFuse5k Fuse (5kW)
--175342021 StructureCableJunction Cable (Junction)
-1112047202 StructureCableJunction4 Cable (4-Way Junction)
--1756896811 StructureCableJunction4Burnt Burnt Cable (4-Way Junction)
--115809132 StructureCableJunction4HBurnt Burnt Cable (4-Way Junction)
-894390004 StructureCableJunction5 Cable (5-Way Junction)
-1545286256 StructureCableJunction5Burnt Burnt Cable (5-Way Junction)
--1404690610 StructureCableJunction6 Cable (6-Way Junction)
--628145954 StructureCableJunction6Burnt Burnt Cable (6-Way Junction)
-1854404029 StructureCableJunction6HBurnt Burnt Cable (6-Way Junction)
--1620686196 StructureCableJunctionBurnt Burnt Cable (Junction)
-469451637 StructureCableJunctionH Heavy Cable (3-Way Junction)
--742234680 StructureCableJunctionH4 Heavy Cable (4-Way Junction)
--1530571426 StructureCableJunctionH5 Heavy Cable (5-Way Junction)
-1701593300 StructureCableJunctionH5Burnt Burnt Heavy Cable (5-Way Junction)
-1036780772 StructureCableJunctionH6 Heavy Cable (6-Way Junction)
--341365649 StructureCableJunctionHBurnt Burnt Cable (Junction)
-605357050 StructureCableStraight Cable (Straight)
--1196981113 StructureCableStraightBurnt Burnt Cable (Straight)
--146200530 StructureCableStraightH Heavy Cable (Straight)
-2085762089 StructureCableStraightHBurnt Burnt Cable (Straight)
--342072665 StructureCamera Camera
-1063087964 StructureCapsuleTank Capsule Tank
--1385712131 StructureCapsuleTankGas Gas Capsule Tank Small
-1415396263 StructureCapsuleTankLiquid Liquid Capsule Tank Small
-1151864003 StructureCargoStorageMedium Cargo Storage (Medium)
--1493672123 StructureCargoStorageSmall Cargo Storage (Small)
-690945935 StructureCentrifuge Centrifuge
-1167659360 StructureChair Chair
-1944858936 StructureChairBacklessDouble Chair (Backless Double)
-1672275150 StructureChairBacklessSingle Chair (Backless Single)
--367720198 StructureChairBoothCornerLeft Chair (Booth Corner Left)
--1436813933 StructureChairBoothCornerRight Chair (Booth Corner Right)
-1640720378 StructureChairBoothMiddle Chair (Booth Middle)
--1152812099 StructureChairRectangleDouble Chair (Rectangle Double)
--1425428917 StructureChairRectangleSingle Chair (Rectangle Single)
--1245724402 StructureChairThickDouble Chair (Thick Double)
--1510009608 StructureChairThickSingle Chair (Thick Single)
--850484480 StructureChuteBin Chute Bin
-1360330136 StructureChuteCorner Chute (Corner)
--810874728 StructureChuteDigitalFlipFlopSplitterLeft Chute Digital Flip Flop Splitter Left
-163728359 StructureChuteDigitalFlipFlopSplitterRight Chute Digital Flip Flop Splitter Right
-648608238 StructureChuteDigitalValveLeft Chute Digital Valve Left
--1337091041 StructureChuteDigitalValveRight Chute Digital Valve Right
--1446854725 StructureChuteFlipFlopSplitter Chute Flip Flop Splitter
--1469588766 StructureChuteInlet Chute Inlet
--611232514 StructureChuteJunction Chute (Junction)
--1022714809 StructureChuteOutlet Chute Outlet
-225377225 StructureChuteOverflow Chute Overflow
-168307007 StructureChuteStraight Chute (Straight)
--1918892177 StructureChuteUmbilicalFemale Umbilical Socket (Chute)
--659093969 StructureChuteUmbilicalFemaleSide Umbilical Socket Angle (Chute)
--958884053 StructureChuteUmbilicalMale Umbilical (Chute)
-434875271 StructureChuteValve Chute Valve
--607241919 StructureChuteWindow Chute (Window)
--128473777 StructureCircuitHousing IC Housing
-1238905683 StructureCombustionCentrifuge Combustion Centrifuge
--1513030150 StructureCompositeCladdingAngled Composite Cladding (Angled)
--69685069 StructureCompositeCladdingAngledCorner Composite Cladding (Angled Corner)
--1841871763 StructureCompositeCladdingAngledCornerInner Composite Cladding (Angled Corner Inner)
--1417912632 StructureCompositeCladdingAngledCornerInnerLong Composite Cladding (Angled Corner Inner Long)
-947705066 StructureCompositeCladdingAngledCornerInnerLongL Composite Cladding (Angled Corner Inner Long L)
--1032590967 StructureCompositeCladdingAngledCornerInnerLongR Composite Cladding (Angled Corner Inner Long R)
-850558385 StructureCompositeCladdingAngledCornerLong Composite Cladding (Long Angled Corner)
--348918222 StructureCompositeCladdingAngledCornerLongR Composite Cladding (Long Angled Mirrored Corner)
--387546514 StructureCompositeCladdingAngledLong Composite Cladding (Long Angled)
-212919006 StructureCompositeCladdingCylindrical Composite Cladding (Cylindrical)
-1077151132 StructureCompositeCladdingCylindricalPanel Composite Cladding (Cylindrical Panel)
-1997436771 StructureCompositeCladdingPanel Composite Cladding (Panel)
--259357734 StructureCompositeCladdingRounded Composite Cladding (Rounded)
-1951525046 StructureCompositeCladdingRoundedCorner Composite Cladding (Rounded Corner)
-110184667 StructureCompositeCladdingRoundedCornerInner Composite Cladding (Rounded Corner Inner)
-139107321 StructureCompositeCladdingSpherical Composite Cladding (Spherical)
-534213209 StructureCompositeCladdingSphericalCap Composite Cladding (Spherical Cap)
-1751355139 StructureCompositeCladdingSphericalCorner Composite Cladding (Spherical Corner)
--793837322 StructureCompositeDoor Composite Door
-324868581 StructureCompositeFloorGrating Composite Floor Grating
--895027741 StructureCompositeFloorGrating2 Composite Floor Grating (Type 2)
--1113471627 StructureCompositeFloorGrating3 Composite Floor Grating (Type 3)
-600133846 StructureCompositeFloorGrating4 Composite Floor Grating (Type 4)
-2109695912 StructureCompositeFloorGratingOpen Composite Floor Grating Open
-882307910 StructureCompositeFloorGratingOpenRotated Composite Floor Grating Open Rotated
-1237302061 StructureCompositeWall Composite Wall (Type 1)
-718343384 StructureCompositeWall02 Composite Wall (Type 2)
-1574321230 StructureCompositeWall03 Composite Wall (Type 3)
--1011701267 StructureCompositeWall04 Composite Wall (Type 4)
--11567609 StructureCompositeWallPanelling1 Composite Wall Panelling
-414493311 StructureCompositeWallRound Composite Wall Round
-481880519 StructureCompositeWallType1 Composite Wall (Type 1)
--2051950467 StructureCompositeWallType2 Composite Wall (Type 2)
--222918421 StructureCompositeWallType3 Composite Wall (Type 3)
-1825709384 StructureCompositeWallType4 Composite Wall (Type 4)
-1782004613 StructureCompositeWallWindow Composite Window
--2060571986 StructureCompositeWindow Composite Window
--688284639 StructureCompositeWindowIron Iron Window
--626563514 StructureComputer Computer
-1420719315 StructureCondensationChamber Condensation Chamber
--965741795 StructureCondensationValve Condensation Valve
-235638270 StructureConsole Console
--722284333 StructureConsoleDual Console Dual
--53151617 StructureConsoleLED1x2 LED Display (Medium)
--1949054743 StructureConsoleLED1x3 LED Display (Large)
--815193061 StructureConsoleLED5 LED Display (Small)
--1414618258 StructureConsoleLED5Large LED Display (Medium)
-389066928 StructureConsoleLED8Large LED Display (Large)
-801677497 StructureConsoleMonitor Console Monitor
--1961153710 StructureControlChair Control Chair
-1095344176 StructureConveyorCorner Conveyor (Corner)
-1539241770 StructureConveyorRiser Conveyor (Riser)
-2030838474 StructureConveyorStraight Conveyor (Straight)
-1022368814 StructureConveyorStraightLong Conveyor (Straight Long)
-277877682 StructureConveyorStraightShort Conveyor (Straight Short)
--1968255729 StructureCornerLocker Corner Locker
--733500083 StructureCrateMount Container Mount
-1938254586 StructureCryoTube CryoTube
-1443059329 StructureCryoTubeHorizontal Cryo Tube Horizontal
--1381321828 StructureCryoTubeVertical Cryo Tube Vertical
-1076425094 StructureDaylightSensor Daylight Sensor
-265720906 StructureDeepMiner Deep Miner
--1280984102 StructureDigitalValve Digital Valve
-1944485013 StructureDiode LED
-576516101 StructureDiodeSlide Diode Slide
--137465079 StructureDockPortSide Dock (Port Side)
-544677628 StructureDockShipSide Dock Ship Side
-1968371847 StructureDrinkingFountain
--1027802654 StructureDuctCorner Duct Corner
-667066324 StructureDuctCrossJunction Duct Cross Junction
--330605879 StructureDuctCrossJunction3 Duct Cross Junction3
-1915735914 StructureDuctCrossJunction4 Duct Cross Junction4
-86573052 StructureDuctCrossJunction5 Duct Cross Junction5
--1675514298 StructureDuctCrossJunction6 Duct Cross Junction6
--659165198 StructureDuctStraight Duct Straight
-1264346285 StructureDuctTJunction Duct T Junction
--1668992663 StructureElectrolyzer Electrolyzer
-1307165496 StructureElectronicsPrinter Electronics Printer
--827912235 StructureElevatorLevelFront Elevator Level (Cabled)
-2060648791 StructureElevatorLevelIndustrial Elevator Level
-826144419 StructureElevatorShaft Elevator Shaft (Cabled)
-1998354978 StructureElevatorShaftIndustrial Elevator Shaft
-1668452680 StructureEmergencyButton Important Button
--1725252354 StructureEngineFuselage1x1 Engine Fuselage
-2035781224 StructureEngineMountTypeA1 Engine Mount (Type A1)
--530653230 StructureEngineMountTypeA2 Engine Mount (Type A2)
--1755713724 StructureEngineMountTypeA3 Engine Mount (Type A3)
-155024103 StructureEngineMountTypeA4 Engine Mount (Type A4)
-1383783851 StructureEngineMountTypeB1 Engine Mount (Type B1)
--881619951 StructureEngineMountTypeB2 Engine Mount (Type B2)
--1133200249 StructureEngineMountTypeB3 Engine Mount (Type B3)
-571484452 StructureEngineMountTypeB4 Engine Mount (Type B4)
-1264708842 StructureEngineMountTypeC1 Engine Mount (Type C1)
--764887728 StructureEngineMountTypeC2 Engine Mount (Type C2)
--1519415866 StructureEngineMountTypeC3 Engine Mount (Type C3)
-990582885 StructureEngineMountTypeC4 Engine Mount (Type C4)
-69237293 StructureEngineMountTypeD1 Engine Mount (Type D1)
--1658246249 StructureEngineMountTypeD2 Engine Mount (Type D2)
--366077183 StructureEngineMountTypeD3 Engine Mount (Type D3)
-1951043234 StructureEngineMountTypeD4 Engine Mount (Type D4)
--1429782576 StructureEvaporationChamber Evaporation Chamber
-195298587 StructureExpansionValve Expansion Valve
-1378546186 StructureFabricator Fabricator
-1622567418 StructureFairingTypeA1 Fairing (Type A1)
--104908736 StructureFairingTypeA2 Fairing (Type A2)
--1900541738 StructureFairingTypeA3 Fairing (Type A3)
-1268464185 StructureFairingTypeB1 Fairing (Type B1)
--762156157 StructureFairingTypeB2 Fairing (Type B2)
-1384123256 StructureFairingTypeC1 Fairing (Type C1)
--880190782 StructureFairingTypeC2 Fairing (Type C2)
-499228095 StructureFairingTypeD1 Fairing (Type D1)
--2067215355 StructureFairingTypeD2 Fairing (Type D2)
--348054045 StructureFiltration Filtration
--1529819532 StructureFlagSmall Small Flag
--1535893860 StructureFlashingLight Flashing Light
-839890807 StructureFlatBench Bench (Flat)
-1048813293 StructureFloorDrain Passive Liquid Inlet
-1432512808 StructureFrame Steel Frame
--2112390778 StructureFrameCorner Steel Frame (Corner)
-271315669 StructureFrameCornerCut Steel Frame (Corner Cut)
--1240951678 StructureFrameIron Iron Frame
--302420053 StructureFrameSide Steel Frame (Side)
-958476921 StructureFridgeBig Fridge (Large)
-751887598 StructureFridgeSmall Fridge Small
-1947944864 StructureFurnace Furnace
-1677968143 StructureFuselage1x1 Fuselage
-1033024712 StructureFuselageTypeA1 Fuselage (Type A1)
--1533287054 StructureFuselageTypeA2 Fuselage (Type A2)
--744696348 StructureFuselageTypeA3 Fuselage (Type A3)
-1308115015 StructureFuselageTypeA4 Fuselage (Type A4)
-381675275 StructureFuselageTypeB1 Fuselage (Type B1)
--1883851087 StructureFuselageTypeB2 Fuselage (Type B2)
--122583513 StructureFuselageTypeB3 Fuselage (Type B3)
-1725240196 StructureFuselageTypeB4 Fuselage (Type B4)
-262461002 StructureFuselageTypeC1 Fuselage (Type C1)
--1767012368 StructureFuselageTypeC2 Fuselage (Type C2)
--508905626 StructureFuselageTypeC3 Fuselage (Type C3)
-2144215749 StructureFuselageTypeC4 Fuselage (Type C4)
-147395155 StructureFuselageTypeC5 Fuselage (Type C5)
--1849670679 StructureFuselageTypeC6 Fuselage (Type C6)
-1088766093 StructureFuselageTypeD1 Fuselage (Type D1)
--638840521 StructureFuselageTypeD2 Fuselage (Type D2)
--1360322143 StructureFuselageTypeD3 Fuselage (Type D3)
-814724098 StructureFuselageTypeD4 Fuselage (Type D4)
-1200129172 StructureFuselageTypeD5 Fuselage (Type D5)
--561916626 StructureFuselageTypeD6 Fuselage (Type D6)
-1165997963 StructureGasGenerator Gas Fuel Generator
-2104106366 StructureGasMixer Gas Mixer
--1252983604 StructureGasSensor Gas Sensor
-1632165346 StructureGasTankStorage Gas Tank Storage
--1680477930 StructureGasUmbilicalFemale Umbilical Socket (Gas)
--648683847 StructureGasUmbilicalFemaleSide Umbilical Socket Angle (Gas)
--1814939203 StructureGasUmbilicalMale Umbilical (Gas)
--324331872 StructureGlassDoor Glass Door
--214232602 StructureGovernedGasEngine Pumped Gas Engine
--619745681 StructureGroundBasedTelescope Telescope
--1758710260 StructureGrowLight Grow Light
-1053578886 StructureGunTurret Gun Emplacement
--1984007806 StructureGyroscope Gyroscope
-643057382 StructureH2Combustor H2 Combustor
-958056199 StructureHarvie Harvie
--271480358 StructureHarvieReversed Harvie
--1310204724 StructureHeatExchangeLiquidAndGas Heat Exchange Liquid And Gas
-944685608 StructureHeatExchangeLiquidtoGas Heat Exchanger - Liquid + Gas
-21266291 StructureHeatExchangerGastoGas Heat Exchanger - Gas
--613784254 StructureHeatExchangerLiquidtoLiquid Heat Exchanger - Liquid
-1070427573 StructureHorizontalAutoMiner OGRE
--1888248335 StructureHydraulicPipeBender Hydraulic Pipe Bender
-1812780450 StructureHydroponicsAutomated Automated Hydroponics
-1441767298 StructureHydroponicsStation Hydroponics Station
-1464854517 StructureHydroponicsTray Hydroponics Tray
--1841632400 StructureHydroponicsTrayData Hydroponics Device
-443849486 StructureIceCrusher Ice Crusher
-1005491513 StructureIgniter Igniter
--1693382705 StructureInLineTankGas1x1 In-Line Tank Small Gas
-35149429 StructureInLineTankGas1x2 In-Line Tank Gas
-543645499 StructureInLineTankLiquid1x1 In-Line Tank Small Liquid
--1183969663 StructureInLineTankLiquid1x2 In-Line Tank Liquid
--1967711059 StructureInsulatedPipeCorner Insulated Pipe (Corner)
--92778058 StructureInsulatedPipeCrossJunction Insulated Pipe (Cross Junction)
-1328210035 StructureInsulatedPipeCrossJunction3 Insulated Pipe (3-Way Junction)
--783387184 StructureInsulatedPipeCrossJunction4 Insulated Pipe (4-Way Junction)
--1505147578 StructureInsulatedPipeCrossJunction5 Insulated Pipe (5-Way Junction)
-1061164284 StructureInsulatedPipeCrossJunction6 Insulated Pipe (6-Way Junction)
-1713710802 StructureInsulatedPipeLiquidCorner Insulated Liquid Pipe (Corner)
-1926651727 StructureInsulatedPipeLiquidCrossJunction Insulated Liquid Pipe (3-Way Junction)
-363303270 StructureInsulatedPipeLiquidCrossJunction4 Insulated Liquid Pipe (4-Way Junction)
-1654694384 StructureInsulatedPipeLiquidCrossJunction5 Insulated Liquid Pipe (5-Way Junction)
--72748982 StructureInsulatedPipeLiquidCrossJunction6 Insulated Liquid Pipe (6-Way Junction)
-295678685 StructureInsulatedPipeLiquidStraight Insulated Liquid Pipe (Straight)
--532384855 StructureInsulatedPipeLiquidTJunction Insulated Liquid Pipe (T Junction)
-2134172356 StructureInsulatedPipeStraight Insulated Pipe (Straight)
--2076086215 StructureInsulatedPipeTJunction Insulated Pipe (T Junction)
--31273349 StructureInsulatedTankConnector Insulated Tank Connector
--1602030414 StructureInsulatedTankConnectorLiquid Insulated Tank Connector Liquid
--2096421875 StructureInteriorDoorGlass Interior Door Glass
-847461335 StructureInteriorDoorPadded Interior Door Padded
-1981698201 StructureInteriorDoorPaddedThin Interior Door Padded Thin
--1182923101 StructureInteriorDoorTriangle Interior Door Triangle
--828056979 StructureKlaxon Klaxon Speaker
--415420281 StructureLadder Ladder
-1541734993 StructureLadderEnd Ladder End
--1230658883 StructureLargeDirectHeatExchangeGastoGas Large Direct Heat Exchanger - Gas + Gas
-1412338038 StructureLargeDirectHeatExchangeGastoLiquid Large Direct Heat Exchanger - Gas + Liquid
-792686502 StructureLargeDirectHeatExchangeLiquidtoLiquid Large Direct Heat Exchange - Liquid + Liquid
--566775170 StructureLargeExtendableRadiator Large Extendable Radiator
--1351081801 StructureLargeHangerDoor Large Hangar Door
-1913391845 StructureLargeSatelliteDish Large Satellite Dish
--558953231 StructureLaunchMount Launch Mount
-535711669 StructureLaunchPadCenter Launch Pad Center
-1396343481 StructureLaunchPadModule Launch Pad Module
-1160134233 StructureLaunchPadTower Launch Pad Tower
--1641770018 StructureLaunchPadTowerScaffolding Launch Pad Tower Scaffolding
-797794350 StructureLightLong Wall Light (Long)
-1847265835 StructureLightLongAngled Wall Light (Long Angled)
-555215790 StructureLightLongWide Wall Light (Long Wide)
-1514476632 StructureLightRound Light Round
-1592905386 StructureLightRoundAngled Light Round (Angled)
-1436121888 StructureLightRoundSmall Light Round (Small)
-1687692899 StructureLiquidDrain Active Liquid Outlet
--2113838091 StructureLiquidPipeAnalyzer Liquid Pipe Analyzer
--287495560 StructureLiquidPipeHeater Pipe Heater (Liquid)
--782453061 StructureLiquidPipeOneWayValve One Way Valve (Liquid)
-2072805863 StructureLiquidPipeRadiator Liquid Pipe Convection Radiator
-482248766 StructureLiquidPressureRegulator Liquid Volume Regulator
-1098900430 StructureLiquidTankBig Liquid Tank Big
--1430440215 StructureLiquidTankBigInsulated Insulated Liquid Tank Big
-1988118157 StructureLiquidTankSmall Liquid Tank Small
-608607718 StructureLiquidTankSmallInsulated Insulated Liquid Tank Small
-1691898022 StructureLiquidTankStorage Liquid Tank Storage
--1051805505 StructureLiquidTurboVolumePump Turbo Volume Pump (Liquid)
-1734723642 StructureLiquidUmbilicalFemale Umbilical Socket (Liquid)
-1220870319 StructureLiquidUmbilicalFemaleSide Umbilical Socket Angle (Liquid)
--1798420047 StructureLiquidUmbilicalMale Umbilical (Liquid)
-1849974453 StructureLiquidValve Liquid Valve
--454028979 StructureLiquidVolumePump Liquid Volume Pump
--830017182 StructureLocker Locker
--647164662 StructureLockerSmall Locker (Small)
-264413729 StructureLogicBatchReader Batch Reader
-436888930 StructureLogicBatchSlotReader Batch Slot Reader
-1415443359 StructureLogicBatchWriter Batch Writer
-491845673 StructureLogicButton Button
--1489728908 StructureLogicCompare Logic Compare
-554524804 StructureLogicDial Dial
--1983222432 StructureLogicDisplay5 LED Display (Small)
-1942143074 StructureLogicGate Logic Gate
-2077593121 StructureLogicHashGen Logic Hash Generator
-1657691323 StructureLogicMath Logic Math
--1160020195 StructureLogicMathUnary Math Unary
--851746783 StructureLogicMemory Logic Memory
-929022276 StructureLogicMinMax Logic Min/Max
-2096189278 StructureLogicMirror Logic Mirror
--345383640 StructureLogicReader Logic Reader
--124308857 StructureLogicReagentReader Reagent Reader
-876108549 StructureLogicRocketDownlink Logic Rocket Downlink
-546002924 StructureLogicRocketUplink Logic Uplink
-1822736084 StructureLogicSelect Logic Select
--767867194 StructureLogicSlotReader Slot Reader
-1220484876 StructureLogicSwitch Lever
-321604921 StructureLogicSwitch2 Switch
--693235651 StructureLogicTransmitter Logic Transmitter
-391271589 StructureLogicUnit Logic Unit
--1326019434 StructureLogicWriter Logic Writer
--1321250424 StructureLogicWriterSwitch Logic Writer Switch
--1909140125 StructureLowVolumeLiquidPipeCorner Low Volume Liquid Pipe (Corner)
-697935625 StructureLowVolumeLiquidPipeCrossJunction Low Volume Liquid Pipe (Cross Junction)
-338145176 StructureLowVolumeLiquidPipeCrossJunction3 Low Volume Liquid Pipe (3-Way Junction)
--1975305669 StructureLowVolumeLiquidPipeCrossJunction4 Low Volume Liquid Pipe (4-Way Junction)
--45872467 StructureLowVolumeLiquidPipeCrossJunction5 Low Volume Liquid Pipe (5-Way Junction)
-1682791191 StructureLowVolumeLiquidPipeCrossJunction6 Low Volume Liquid Pipe (6-Way Junction)
--923441517 StructureLowVolumeLiquidPipeStraight Low Volume Liquid Pipe (Straight)
-1912174058 StructureLowVolumeLiquidPipeTJunction Low Volume Liquid Pipe (T Junction)
--1442601681 StructureLowVolumePipeCorner Low Volume Pipe (Corner)
--1656624838 StructureLowVolumePipeCrossJunction Low Volume Pipe (Cross Junction)
--1421666624 StructureLowVolumePipeCrossJunction3 Low Volume Pipe (3-Way Junction)
-891781987 StructureLowVolumePipeCrossJunction4 Low Volume Pipe (4-Way Junction)
-1109439477 StructureLowVolumePipeCrossJunction5 Low Volume Pipe (5-Way Junction)
--618012081 StructureLowVolumePipeCrossJunction6 Low Volume Pipe (6-Way Junction)
--1002687599 StructureLowVolumePipeStraight Low Volume Pipe (Straight)
--1610883693 StructureLowVolumePipeTJunction Low Volume Pipe (T Junction)
--1808154199 StructureManualHatch Manual Hatch
--1918215845 StructureMediumConvectionRadiator Medium Convection Radiator
--1169014183 StructureMediumConvectionRadiatorLiquid Medium Convection Radiator Liquid
--566348148 StructureMediumHangerDoor Medium Hangar Door
--975966237 StructureMediumRadiator Medium Radiator
--1141760613 StructureMediumRadiatorLiquid Medium Radiator Liquid
--1093860567 StructureMediumRocketGasFuelTank Gas Capsule Tank Medium
-1143639539 StructureMediumRocketLiquidFuelTank Liquid Capsule Tank Medium
--1713470563 StructureMotionSensor Motion Sensor
-1898243702 StructureNitrolyzer Nitrolyzer
-790511747 StructureNosecone1x1 Nosecone
-322782515 StructureOccupancySensor Occupancy Sensor
--744355143 StructureOneWayValve One Way Valve (Gas)
--385751893 StructureOrganicsPrinter Organics Printer
--1794932560 StructureOverheadShortCornerLocker Overhead Corner Locker
-1468249454 StructureOverheadShortLocker Overhead Locker
--56441216 StructurePassiveLargeRadiator Medium Convection Radiator
-2066977095 StructurePassiveLargeRadiatorGas Medium Convection Radiator
-24786172 StructurePassiveLargeRadiatorLiquid Medium Convection Radiator Liquid
-1812364811 StructurePassiveLiquidDrain Passive Liquid Drain
-335498166 StructurePassiveVent Passive Vent
-1363077139 StructurePassiveVentInsulated Insulated Passive Vent
--1674187440 StructurePassthroughHeatExchangerGasToGas CounterFlow Heat Exchanger - Gas + Gas
-1928991265 StructurePassthroughHeatExchangerGasToLiquid CounterFlow Heat Exchanger - Gas + Liquid
--1472829583 StructurePassthroughHeatExchangerLiquidToLiquid CounterFlow Heat Exchanger - Liquid + Liquid
--1434523206 StructurePictureFrameThickLandscapeLarge Picture Frame Thick Landscape Large
--2041566697 StructurePictureFrameThickLandscapeSmall Picture Frame Thick Landscape Small
-950004659 StructurePictureFrameThickMountLandscapeLarge Picture Frame Thick Landscape Large
-347154462 StructurePictureFrameThickMountLandscapeSmall Picture Frame Thick Landscape Small
--1459641358 StructurePictureFrameThickMountPortraitLarge Picture Frame Thick Mount Portrait Large
--2066653089 StructurePictureFrameThickMountPortraitSmall Picture Frame Thick Mount Portrait Small
--1686949570 StructurePictureFrameThickPortraitLarge Picture Frame Thick Portrait Large
--1218579821 StructurePictureFrameThickPortraitSmall Picture Frame Thick Portrait Small
--1418288625 StructurePictureFrameThinLandscapeLarge Picture Frame Thin Landscape Large
--2024250974 StructurePictureFrameThinLandscapeSmall Picture Frame Thin Landscape Small
--1146760430 StructurePictureFrameThinMountLandscapeLarge Picture Frame Thin Landscape Large
--1752493889 StructurePictureFrameThinMountLandscapeSmall Picture Frame Thin Landscape Small
-1094895077 StructurePictureFrameThinMountPortraitLarge Picture Frame Thin Portrait Large
-1835796040 StructurePictureFrameThinMountPortraitSmall Picture Frame Thin Portrait Small
-1212777087 StructurePictureFrameThinPortraitLarge Picture Frame Thin Portrait Large
-1684488658 StructurePictureFrameThinPortraitSmall Picture Frame Thin Portrait Small
-435685051 StructurePipeAnalysizer Pipe Analyzer
--1785673561 StructurePipeCorner Pipe (Corner)
-465816159 StructurePipeCowl Pipe Cowl
--1405295588 StructurePipeCrossJunction Pipe (Cross Junction)
-2038427184 StructurePipeCrossJunction3 Pipe (3-Way Junction)
--417629293 StructurePipeCrossJunction4 Pipe (4-Way Junction)
--1877193979 StructurePipeCrossJunction5 Pipe (5-Way Junction)
-152378047 StructurePipeCrossJunction6 Pipe (6-Way Junction)
--419758574 StructurePipeHeater Pipe Heater (Gas)
-1286441942 StructurePipeIgniter Pipe Igniter
--2068497073 StructurePipeInsulatedLiquidCrossJunction Insulated Liquid Pipe (Cross Junction)
--999721119 StructurePipeLabel Pipe Label
--1856720921 StructurePipeLiquidCorner Liquid Pipe (Corner)
-1848735691 StructurePipeLiquidCrossJunction Liquid Pipe (Cross Junction)
-1628087508 StructurePipeLiquidCrossJunction3 Liquid Pipe (3-Way Junction)
--9555593 StructurePipeLiquidCrossJunction4 Liquid Pipe (4-Way Junction)
--2006384159 StructurePipeLiquidCrossJunction5 Liquid Pipe (5-Way Junction)
-291524699 StructurePipeLiquidCrossJunction6 Liquid Pipe (6-Way Junction)
-667597982 StructurePipeLiquidStraight Liquid Pipe (Straight)
-262616717 StructurePipeLiquidTJunction Liquid Pipe (T Junction)
--1798362329 StructurePipeMeter Pipe Meter
-1580412404 StructurePipeOneWayValve One Way Valve (Gas)
-1305252611 StructurePipeOrgan Pipe Organ
-1696603168 StructurePipeRadiator Pipe Convection Radiator
--399883995 StructurePipeRadiatorFlat Pipe Radiator
-2024754523 StructurePipeRadiatorFlatLiquid Pipe Radiator Liquid
-73728932 StructurePipeStraight Pipe (Straight)
--913817472 StructurePipeTJunction Pipe (T Junction)
--1125641329 StructurePlanter Planter
-1559586682 StructurePlatformLadderOpen Ladder Platform
-34040217 StructurePlatformLadderOpenRotated Ladder Platform Rotated
-989835703 StructurePlinth Plinth
--899013427 StructurePortablesConnector Portables Connector
--782951720 StructurePowerConnector Power Connector
--65087121 StructurePowerTransmitter Microwave Power Transmitter
--327468845 StructurePowerTransmitterOmni Power Transmitter Omni
-1195820278 StructurePowerTransmitterReceiver Microwave Power Receiver
-101488029 StructurePowerUmbilicalFemale Umbilical Socket (Power)
-1922506192 StructurePowerUmbilicalFemaleSide Umbilical Socket Angle (Power)
-1529453938 StructurePowerUmbilicalMale Umbilical (Power)
-938836756 StructurePoweredVent Powered Vent
--785498334 StructurePoweredVentLarge Powered Vent Large
-23052817 StructurePressurantValve Pressurant Valve
--624011170 StructurePressureFedGasEngine Pressure Fed Gas Engine
-379750958 StructurePressureFedLiquidEngine Pressure Fed Liquid Engine
--2008706143 StructurePressurePlateLarge Trigger Plate (Large)
-1269458680 StructurePressurePlateMedium Trigger Plate (Medium)
--1536471028 StructurePressurePlateSmall Trigger Plate (Small)
-209854039 StructurePressureRegulator Pressure Regulator
-568800213 StructureProximitySensor Proximity Sensor
--2031440019 StructurePumpedLiquidEngine Pumped Liquid Engine
--737232128 StructurePurgeValve Purge Valve
--44928532 StructureRTG Creative RTG
-1905352762 StructureRTGSurvival RTG
--1756913871 StructureRailing Railing Industrial (Type 1)
--1633947337 StructureRecycler Recycler
--1577831321 StructureRefrigeratedVendingMachine Refrigerated Vending Machine
-2027713511 StructureReinforcedCompositeWindow Reinforced Window (Composite)
--816454272 StructureReinforcedCompositeWindowSteel Reinforced Window (Composite Steel)
-1939061729 StructureReinforcedWallPaddedWindow Reinforced Window (Padded)
-158502707 StructureReinforcedWallPaddedWindowThin Reinforced Window (Thin)
--796627526 StructureResearchMachine Research Machine
--2786426 StructureReverseElectrolyzer Reverse Electrolyzer
-808389066 StructureRocketAvionics Rocket Avionics
-997453927 StructureRocketCelestialTracker Rocket Celestial Tracker
-1977688565 StructureRocketChuteStorage Rocket Chute Storage
-150135861 StructureRocketCircuitHousing Rocket Circuit Housing
-177639794 StructureRocketEngine Rocket Engine
-1234268097 StructureRocketEngineDestroyed Rocket Engine (Destroyed)
-823909553 StructureRocketEngineSmall Rocket Engine (Small)
-178472613 StructureRocketEngineTiny Rocket Engine (Tiny)
-1781051034 StructureRocketManufactory Rocket Manufactory
--2087223687 StructureRocketMiner Rocket Miner
-407081452 StructureRocketPlaceHolderMiner Rocket Place Holder Miner
-2014252591 StructureRocketScanner Rocket Scanner
--654619479 StructureRocketTower Launch Tower
-518925193 StructureRocketTransformerSmall Transformer Small (Rocket)
-806513938 StructureRover Rover Frame
--1875856925 StructureSDBHopper SDB Hopper
-467225612 StructureSDBHopperAdvanced SDB Hopper Advanced
-1155865682 StructureSDBSilo SDB Silo
-439026183 StructureSatelliteDish Medium Satellite Dish
--641491515 StructureSecurityPrinter Security Printer
-1172114950 StructureShelf Shelf
-182006674 StructureShelfMedium Shelf Medium
-1330754486 StructureShortCornerLocker Short Corner Locker
--554553467 StructureShortLocker Short Locker
--775128944 StructureShower Shower
--1081797501 StructureShowerPowered Shower (Powered)
--1309237526 StructureShuttleLandingPad Landing Pad
-879058460 StructureSign1x1 Sign 1x1
-908320837 StructureSign2x1 Sign 2x1
--492611 StructureSingleBed Single Bed
--1467449329 StructureSleeper Sleeper
-1213495833 StructureSleeperLeft Sleeper Left
--1812330717 StructureSleeperRight Sleeper Right
--1300059018 StructureSleeperVertical Sleeper Vertical
-1382098999 StructureSleeperVerticalDroid Droid Sleeper Vertical
-1310303582 StructureSmallDirectHeatExchangeGastoGas Small Direct Heat Exchanger - Gas + Gas
-1825212016 StructureSmallDirectHeatExchangeLiquidtoGas Small Direct Heat Exchanger - Liquid + Gas
--507770416 StructureSmallDirectHeatExchangeLiquidtoLiquid Small Direct Heat Exchanger - Liquid + Liquid
--2138748650 StructureSmallSatelliteDish Small Satellite Dish
--1633000411 StructureSmallTableBacklessDouble Small (Table Backless Double)
--1897221677 StructureSmallTableBacklessSingle Small (Table Backless Single)
-1260651529 StructureSmallTableDinnerSingle Small (Table Dinner Single)
--660451023 StructureSmallTableRectangleDouble Small (Table Rectangle Double)
--924678969 StructureSmallTableRectangleSingle Small (Table Rectangle Single)
--19246131 StructureSmallTableThickDouble Small (Table Thick Double)
--291862981 StructureSmallTableThickSingle Small Table (Thick Single)
--2045627372 StructureSolarPanel Solar Panel
--1554349863 StructureSolarPanel45 Solar Panel (Angled)
-930865127 StructureSolarPanel45Reinforced Solar Panel (Heavy Angled)
--539224550 StructureSolarPanelDual Solar Panel (Dual)
--1545574413 StructureSolarPanelDualReinforced Solar Panel (Heavy Dual)
-1968102968 StructureSolarPanelFlat Solar Panel (Flat)
-1697196770 StructureSolarPanelFlatReinforced Solar Panel (Heavy Flat)
--775884649 StructureSolarPanelFused Solar Panel
--934345724 StructureSolarPanelReinforced Solar Panel (Heavy)
-813146305 StructureSolidFuelGenerator Generator (Solid Fuel)
--1009150565 StructureSorter Sorter
-192735066 StructureSpawnPoint Spawn Point
--947062903 StructureSphericalTank Spherical Tank
--2020231820 StructureStacker Stacker
-1585641623 StructureStackerReverse Stacker
-1405018945 StructureStairs4x2 Stairs
-155214029 StructureStairs4x2RailL Stairs with Rail (Left)
--212902482 StructureStairs4x2RailR Stairs with Rail (Right)
--1088008720 StructureStairs4x2Rails Stairs with Rails
-505924160 StructureStairwellBackLeft Stairwell (Back Left)
--862048392 StructureStairwellBackPassthrough Stairwell (Back Passthrough)
--2128896573 StructureStairwellBackRight Stairwell (Back Right)
--37454456 StructureStairwellFrontLeft Stairwell (Front Left)
--1625452928 StructureStairwellFrontPassthrough Stairwell (Front Passthrough)
-340210934 StructureStairwellFrontRight Stairwell (Front Right)
-2049879875 StructureStairwellNoDoors Stairwell (No Doors)
--411792553 StructureStellarAnchor Stellar Anchor
--260316435 StructureStirlingEngine Stirling Engine
--793623899 StructureStorageLocker Locker
-255034731 StructureSuitStorage Suit Storage
--1606848156 StructureTankBig Large Tank
-1280378227 StructureTankBigInsulated Tank Big (Insulated)
--1276379454 StructureTankConnector Tank Connector
-1331802518 StructureTankConnectorLiquid Liquid Tank Connector
-1013514688 StructureTankSmall Small Tank
-955744474 StructureTankSmallAir Small Tank (Air)
-2102454415 StructureTankSmallFuel Small Tank (Fuel)
-272136332 StructureTankSmallInsulated Tank Small (Insulated)
--465741100 StructureToolManufactory Tool Manufactory
-1473807953 StructureTorpedoRack Torpedo Rack
--1757426073 StructureTorpedoTube Torpedo Launcher
-1570931620 StructureTraderWaypoint Trader Waypoint
--1423212473 StructureTransformer Transformer (Large)
--1065725831 StructureTransformerMedium Transformer (Medium)
--771036757 StructureTransformerMedium(Reversed) Transformer Reversed (Medium)
-833912764 StructureTransformerMediumReversed Transformer Reversed (Medium)
--890946730 StructureTransformerSmall Transformer (Small)
-1054059374 StructureTransformerSmallReversed Transformer Reversed (Small)
-1282191063 StructureTurbineGenerator Turbine Generator
-1310794736 StructureTurboVolumePump Turbo Volume Pump (Gas)
-750118160 StructureUnloader Unloader
--1892095368 StructureUnpoweredHatch Unpowered Hatch
-1622183451 StructureUprightWindTurbine Upright Wind Turbine
--692036078 StructureValve Valve
--443130773 StructureVendingMachine Vending Machine
--321403609 StructureVolumePump Volume Pump
--858143148 StructureWallArch Wall (Arch)
-1649708822 StructureWallArchArrow Wall (Arch Arrow)
-1794588890 StructureWallArchCornerRound Wall (Arch Corner Round)
--1963016580 StructureWallArchCornerSquare Wall (Arch Corner Square)
-1281911841 StructureWallArchCornerTriangle Wall (Arch Corner Triangle)
-1182510648 StructureWallArchPlating Wall (Arch Plating)
-782529714 StructureWallArchTwoTone Wall (Arch Two Tone)
--739292323 StructureWallCooler Wall Cooler
-1635864154 StructureWallFlat Wall (Flat)
-898708250 StructureWallFlatCornerRound Wall (Flat Corner Round)
-298130111 StructureWallFlatCornerSquare Wall (Flat Corner Square)
-2097419366 StructureWallFlatCornerTriangle Wall (Flat Corner Triangle)
--1161662836 StructureWallFlatCornerTriangleFlat Wall (Flat Corner Triangle Flat)
-1979212240 StructureWallGeometryCorner Wall (Geometry Corner)
-1049735537 StructureWallGeometryStreight Wall (Geometry Straight)
-1602758612 StructureWallGeometryT Wall (Geometry T)
--1427845483 StructureWallGeometryTMirrored Wall (Geometry T Mirrored)
-24258244 StructureWallHeater Wall Heater
-1287324802 StructureWallIron Iron Wall (Type 1)
-1485834215 StructureWallIron02 Iron Wall (Type 2)
-798439281 StructureWallIron03 Iron Wall (Type 3)
--1309433134 StructureWallIron04 Iron Wall (Type 4)
-1492930217 StructureWallLargePanel Wall (Large Panel)
--776581573 StructureWallLargePanelArrow Wall (Large Panel Arrow)
--1860064656 StructureWallLight Wall Light
--1306415132 StructureWallLightBattery Wall Light (Battery)
-1590330637 StructureWallPaddedArch Wall (Padded Arch)
--1126688298 StructureWallPaddedArchCorner Wall (Padded Arch Corner)
-1171987947 StructureWallPaddedArchLightFittingTop Wall (Padded Arch Light Fitting Top)
--1546743960 StructureWallPaddedArchLightsFittings Wall (Padded Arch Lights Fittings)
--155945899 StructureWallPaddedCorner Wall (Padded Corner)
-1183203913 StructureWallPaddedCornerThin Wall (Padded Corner Thin)
-8846501 StructureWallPaddedNoBorder Wall (Padded No Border)
-179694804 StructureWallPaddedNoBorderCorner Wall (Padded No Border Corner)
--1611559100 StructureWallPaddedThinNoBorder Wall (Padded Thin No Border)
-1769527556 StructureWallPaddedThinNoBorderCorner Wall (Padded Thin No Border Corner)
-2087628940 StructureWallPaddedWindow Wall (Padded Window)
--37302931 StructureWallPaddedWindowThin Wall (Padded Window Thin)
-635995024 StructureWallPadding Wall (Padding)
--1243329828 StructureWallPaddingArchVent Wall (Padding Arch Vent)
-2024882687 StructureWallPaddingLightFitting Wall (Padding Light Fitting)
--1102403554 StructureWallPaddingThin Wall (Padding Thin)
-26167457 StructureWallPlating Wall (Plating)
--1302523785 StructureWallSimple Wall (Simple)
--825106501 StructureWallSmallPanels Wall (Small Panels)
-619828719 StructureWallSmallPanelsAndHatch Wall (Small Panels And Hatch)
--639306697 StructureWallSmallPanelsArrow Wall (Small Panels Arrow)
-386820253 StructureWallSmallPanelsMonoChrome Wall (Small Panels Mono Chrome)
--1407480603 StructureWallSmallPanelsOpen Wall (Small Panels Open)
-1709994581 StructureWallSmallPanelsTwoTone Wall (Small Panels Two Tone)
--1177469307 StructureWallVent Wall Vent
--1178961954 StructureWaterBottleFiller Water Bottle Filler
-1433754995 StructureWaterBottleFillerBottom Water Bottle Filler Bottom
--756587791 StructureWaterBottleFillerPowered Waterbottle Filler
-1986658780 StructureWaterBottleFillerPoweredBottom Waterbottle Filler
--517628750 StructureWaterDigitalValve Liquid Digital Valve
--1687126443 StructureWaterPipeHeater Pipe Heater (Gas)
-433184168 StructureWaterPipeMeter Liquid Pipe Meter
-887383294 StructureWaterPurifier Water Purifier
--1369060582 StructureWaterWallCooler Liquid Wall Cooler
-1997212478 StructureWeatherStation Weather Station
--2082355173 StructureWindTurbine Wind Turbine
-2056377335 StructureWindowShutter Window Shutter
-328180977 StrutureDrinkingFountain Drinking Fountain
-733496620 Tomato Tomato
-1700018136 ToolPrinterMod Tool Printer Mod
-94730034 ToyLuna Toy Luna
--820692038 TriggerZone Trigger Zone
--2083426457 UniformCommander Uniform Commander
--48342840 UniformMarine Marine Uniform
-810053150 UniformOrangeJumpSuit Jump Suit (Orange)
--208860272 Uranium Uranium
-1134509928 WallFrameCornerCut Steel Frame (Corner Cut)
-1787814293 Waspaloy Waspaloy
-789494694 WeaponEnergy Weapon Energy
--385323479 WeaponPistolEnergy Energy Pistol
-1154745374 WeaponRifleEnergy Energy Rifle
--1102977898 WeaponTorpedo Torpedo
--686695134 Wheat Wheat
diff --git a/ic10emu/generate_data.py b/ic10emu/generate_data.py
index 187bd7e..afece3d 100644
--- a/ic10emu/generate_data.py
+++ b/ic10emu/generate_data.py
@@ -210,7 +210,7 @@ def extract_data(install_path: Path, data_path: Path, language: str):
continue
key = key.text
value = value.text
- if key is None:
+ if key is None or any(bad in key for bad in "(){}|[]") :
continue
crc_u = binascii.crc32(key.encode('utf-8'))
crc_i: int = struct.unpack("i", struct.pack("I", crc_u))[0]
diff --git a/ic10emu/src/device.rs b/ic10emu/src/device.rs
deleted file mode 100644
index 205a984..0000000
--- a/ic10emu/src/device.rs
+++ /dev/null
@@ -1,994 +0,0 @@
-use crate::{
- grammar::{LogicType, ReagentMode, SlotLogicType},
- interpreter::{ICError, ICState},
- network::{CableConnectionType, Connection},
- vm::VM,
-};
-use std::{collections::BTreeMap, ops::Deref};
-
-use itertools::Itertools;
-
-use serde::{Deserialize, Serialize};
-use strum_macros::{AsRefStr, EnumIter, EnumString};
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
-pub enum FieldType {
- Read,
- Write,
- ReadWrite,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct LogicField {
- pub field_type: FieldType,
- pub value: f64,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct SlotOccupant {
- pub id: u32,
- pub prefab_hash: i32,
- pub quantity: u32,
- pub max_quantity: u32,
- pub sorting_class: SortingClass,
- pub damage: f64,
- fields: BTreeMap,
-}
-
-impl SlotOccupant {
- pub fn from_template(template: SlotOccupantTemplate, id_fn: F) -> Self
- where
- F: FnOnce() -> u32,
- {
- let mut fields = template.fields;
- SlotOccupant {
- id: template.id.unwrap_or_else(id_fn),
- prefab_hash: fields
- .remove(&SlotLogicType::PrefabHash)
- .map(|field| field.value as i32)
- .unwrap_or(0),
- quantity: fields
- .remove(&SlotLogicType::Quantity)
- .map(|field| field.value as u32)
- .unwrap_or(1),
- max_quantity: fields
- .remove(&SlotLogicType::MaxQuantity)
- .map(|field| field.value as u32)
- .unwrap_or(1),
- damage: fields
- .remove(&SlotLogicType::Damage)
- .map(|field| field.value)
- .unwrap_or(0.0),
- sorting_class: fields
- .remove(&SlotLogicType::SortingClass)
- .map(|field| (field.value as u32).into())
- .unwrap_or(SortingClass::Default),
- fields,
- }
- }
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct SlotOccupantTemplate {
- pub id: Option,
- pub fields: BTreeMap,
-}
-
-impl SlotOccupant {
- pub fn new(id: u32, prefab_hash: i32) -> Self {
- SlotOccupant {
- id,
- prefab_hash,
- quantity: 1,
- max_quantity: 1,
- damage: 0.0,
- sorting_class: SortingClass::Default,
- fields: BTreeMap::new(),
- }
- }
-
- /// chainable constructor
- pub fn with_quantity(mut self, quantity: u32) -> Self {
- self.quantity = quantity;
- self
- }
-
- /// chainable constructor
- pub fn with_max_quantity(mut self, max_quantity: u32) -> Self {
- self.max_quantity = max_quantity;
- self
- }
-
- /// chainable constructor
- pub fn with_damage(mut self, damage: f64) -> Self {
- self.damage = damage;
- self
- }
-
- /// chainable constructor
- pub fn with_fields(mut self, fields: BTreeMap) -> Self {
- self.fields.extend(fields);
- self
- }
-
- /// chainable constructor
- pub fn get_fields(&self) -> BTreeMap {
- let mut copy = self.fields.clone();
- copy.insert(
- SlotLogicType::PrefabHash,
- LogicField {
- field_type: FieldType::Read,
- value: self.prefab_hash as f64,
- },
- );
- copy.insert(
- SlotLogicType::SortingClass,
- LogicField {
- field_type: FieldType::Read,
- value: self.sorting_class as u32 as f64,
- },
- );
- copy.insert(
- SlotLogicType::Quantity,
- LogicField {
- field_type: FieldType::Read,
- value: self.quantity as f64,
- },
- );
- copy.insert(
- SlotLogicType::MaxQuantity,
- LogicField {
- field_type: FieldType::Read,
- value: self.max_quantity as f64,
- },
- );
- copy.insert(
- SlotLogicType::Damage,
- LogicField {
- field_type: FieldType::Read,
- value: self.damage,
- },
- );
- copy
- }
-
- pub fn set_field(&mut self, typ: SlotLogicType, val: f64, force: bool) -> Result<(), ICError> {
- if (typ == SlotLogicType::Quantity) && force {
- self.quantity = val as u32;
- Ok(())
- } else if (typ == SlotLogicType::MaxQuantity) && force {
- self.max_quantity = val as u32;
- Ok(())
- } else if (typ == SlotLogicType::Damage) && force {
- self.damage = val;
- Ok(())
- } else if let Some(logic) = self.fields.get_mut(&typ) {
- match logic.field_type {
- FieldType::ReadWrite | FieldType::Write => {
- logic.value = val;
- Ok(())
- }
- _ => {
- if force {
- logic.value = val;
- Ok(())
- } else {
- Err(ICError::ReadOnlyField(typ.to_string()))
- }
- }
- }
- } else if force {
- self.fields.insert(
- typ,
- LogicField {
- field_type: FieldType::ReadWrite,
- value: val,
- },
- );
- Ok(())
- } else {
- Err(ICError::ReadOnlyField(typ.to_string()))
- }
- }
-
- pub fn can_logic_read(&self, field: SlotLogicType) -> bool {
- if let Some(logic) = self.fields.get(&field) {
- matches!(logic.field_type, FieldType::Read | FieldType::ReadWrite)
- } else {
- false
- }
- }
-
- pub fn can_logic_write(&self, field: SlotLogicType) -> bool {
- if let Some(logic) = self.fields.get(&field) {
- matches!(logic.field_type, FieldType::Write | FieldType::ReadWrite)
- } else {
- false
- }
- }
-}
-
-#[derive(Debug, Default, Clone, Serialize, Deserialize)]
-pub struct Slot {
- pub typ: SlotType,
- pub occupant: Option,
-}
-
-#[derive(Debug, Default, Clone, Serialize, Deserialize)]
-pub struct SlotTemplate {
- pub typ: SlotType,
- pub occupant: Option,
-}
-
-impl Slot {
- pub fn new(typ: SlotType) -> Self {
- Slot {
- typ,
- occupant: None,
- }
- }
- pub fn with_occupant(typ: SlotType, occupant: SlotOccupant) -> Self {
- Slot {
- typ,
- occupant: Some(occupant),
- }
- }
-
- pub fn get_fields(&self) -> BTreeMap {
- let mut copy = self
- .occupant
- .as_ref()
- .map(|occupant| occupant.get_fields())
- .unwrap_or_default();
- copy.insert(
- SlotLogicType::Occupied,
- LogicField {
- field_type: FieldType::Read,
- value: if self.occupant.is_some() { 1.0 } else { 0.0 },
- },
- );
- copy.insert(
- SlotLogicType::OccupantHash,
- LogicField {
- field_type: FieldType::Read,
- value: self
- .occupant
- .as_ref()
- .map(|occupant| occupant.prefab_hash as f64)
- .unwrap_or(0.0),
- },
- );
- copy.insert(
- SlotLogicType::Quantity,
- LogicField {
- field_type: FieldType::Read,
- value: self
- .occupant
- .as_ref()
- .map(|occupant| occupant.quantity as f64)
- .unwrap_or(0.0),
- },
- );
- copy.insert(
- SlotLogicType::Damage,
- LogicField {
- field_type: FieldType::Read,
- value: self
- .occupant
- .as_ref()
- .map(|occupant| occupant.damage)
- .unwrap_or(0.0),
- },
- );
- copy.insert(
- SlotLogicType::Class,
- LogicField {
- field_type: FieldType::Read,
- value: self.typ as u32 as f64,
- },
- );
- copy.insert(
- SlotLogicType::MaxQuantity,
- LogicField {
- field_type: FieldType::Read,
- value: self
- .occupant
- .as_ref()
- .map(|occupant| occupant.max_quantity as f64)
- .unwrap_or(0.0),
- },
- );
- copy.insert(
- SlotLogicType::PrefabHash,
- LogicField {
- field_type: FieldType::Read,
- value: self
- .occupant
- .as_ref()
- .map(|occupant| occupant.prefab_hash as f64)
- .unwrap_or(0.0),
- },
- );
- copy.insert(
- SlotLogicType::SortingClass,
- LogicField {
- field_type: FieldType::Read,
- value: self
- .occupant
- .as_ref()
- .map(|occupant| occupant.sorting_class as u32 as f64)
- .unwrap_or(0.0),
- },
- );
- copy.insert(
- SlotLogicType::ReferenceId,
- LogicField {
- field_type: FieldType::Read,
- value: self
- .occupant
- .as_ref()
- .map(|occupant| occupant.id as f64)
- .unwrap_or(0.0),
- },
- );
- copy
- }
-
- pub fn get_field(&self, field: SlotLogicType) -> f64 {
- let fields = self.get_fields();
- fields
- .get(&field)
- .map(|field| match field.field_type {
- FieldType::Read | FieldType::ReadWrite => field.value,
- _ => 0.0,
- })
- .unwrap_or(0.0)
- }
-
- pub fn can_logic_read(&self, field: SlotLogicType) -> bool {
- match field {
- SlotLogicType::Pressure | SlotLogicType::Temperature | SlotLogicType::Volume => {
- matches!(
- self.typ,
- SlotType::GasCanister | SlotType::LiquidCanister | SlotType::LiquidBottle
- )
- }
- SlotLogicType::Charge | SlotLogicType::ChargeRatio => {
- matches!(self.typ, SlotType::Battery)
- }
- SlotLogicType::Open => matches!(
- self.typ,
- SlotType::Helmet | SlotType::Tool | SlotType::Appliance
- ),
- SlotLogicType::Lock => matches!(self.typ, SlotType::Helmet),
- SlotLogicType::FilterType => matches!(self.typ, SlotType::GasFilter),
- _ => {
- if let Some(occupant) = self.occupant.as_ref() {
- occupant.can_logic_read(field)
- } else {
- false
- }
- }
- }
- }
-
- pub fn can_logic_write(&self, field: SlotLogicType) -> bool {
- match field {
- SlotLogicType::Open => matches!(
- self.typ,
- SlotType::Helmet
- | SlotType::GasCanister
- | SlotType::LiquidCanister
- | SlotType::LiquidBottle
- ),
- SlotLogicType::On => matches!(
- self.typ,
- SlotType::Helmet | SlotType::Tool | SlotType::Appliance
- ),
- SlotLogicType::Lock => matches!(self.typ, SlotType::Helmet),
- _ => {
- if let Some(occupant) = self.occupant.as_ref() {
- occupant.can_logic_write(field)
- } else {
- false
- }
- }
- }
- }
-
- pub fn set_field(&mut self, typ: SlotLogicType, val: f64, force: bool) -> Result<(), ICError> {
- if matches!(
- typ,
- SlotLogicType::Occupied
- | SlotLogicType::OccupantHash
- | SlotLogicType::Class
- | SlotLogicType::PrefabHash
- | SlotLogicType::SortingClass
- | SlotLogicType::ReferenceId
- ) {
- return Err(ICError::ReadOnlyField(typ.to_string()));
- }
- if let Some(occupant) = self.occupant.as_mut() {
- occupant.set_field(typ, val, force)
- } else {
- Err(ICError::SlotNotOccupied)
- }
- }
-}
-
-#[derive(
- Debug,
- Default,
- Clone,
- Copy,
- PartialEq,
- Eq,
- Hash,
- strum_macros::Display,
- EnumString,
- EnumIter,
- AsRefStr,
- Serialize,
- Deserialize,
-)]
-#[strum(serialize_all = "PascalCase")]
-pub enum SortingClass {
- #[default]
- Default = 0,
- Kits = 1,
- Tools = 2,
- Resources,
- Food = 4,
- Clothing,
- Appliances,
- Atmospherics,
- Storage = 8,
- Ores,
- Ices,
-}
-
-impl From for SortingClass {
- fn from(value: u32) -> Self {
- match value {
- 1 => Self::Kits,
- 2 => Self::Tools,
- 3 => Self::Resources,
- 4 => Self::Food,
- 5 => Self::Clothing,
- 6 => Self::Appliances,
- 7 => Self::Atmospherics,
- 8 => Self::Storage,
- 9 => Self::Ores,
- 10 => Self::Ices,
- _ => Self::Default,
- }
- }
-}
-
-#[derive(
- Debug,
- Default,
- Clone,
- Copy,
- PartialEq,
- Eq,
- Hash,
- strum_macros::Display,
- EnumString,
- EnumIter,
- AsRefStr,
- Serialize,
- Deserialize,
-)]
-#[strum(serialize_all = "PascalCase")]
-pub enum SlotType {
- Helmet = 1,
- Suit = 2,
- Back,
- GasFilter = 4,
- GasCanister,
- MotherBoard,
- Circuitboard,
- DataDisk = 8,
- Organ,
- Ore,
- Plant,
- Uniform,
- Entity,
- Battery,
- Egg,
- Belt = 16,
- Tool,
- Appliance,
- Ingot,
- Torpedo,
- Cartridge,
- AccessCard,
- Magazine,
- Circuit = 24,
- Bottle,
- ProgrammableChip,
- Glasses,
- CreditCard,
- DirtCanister,
- SensorProcessingUnit,
- LiquidCanister,
- LiquidBottle = 32,
- Wreckage,
- SoundCartridge,
- DrillHead,
- ScanningHead,
- Flare,
- Blocked,
- #[default]
- None = 0,
-}
-
-#[derive(Debug, Default, Clone, Serialize, Deserialize)]
-pub struct Prefab {
- pub name: String,
- pub hash: i32,
-}
-
-impl Prefab {
- pub fn new(name: &str) -> Self {
- Prefab {
- name: name.to_owned(),
- hash: const_crc32::crc32(name.as_bytes()) as i32,
- }
- }
-}
-
-#[derive(Debug, Default)]
-pub struct Device {
- pub id: u32,
- pub name: Option,
- pub name_hash: Option,
- pub prefab: Option,
- pub slots: Vec,
- pub reagents: BTreeMap>,
- pub ic: Option,
- pub connections: Vec,
- fields: BTreeMap,
-}
-
-impl Device {
- pub fn new(id: u32) -> Self {
- Device {
- id,
- name: None,
- name_hash: None,
- prefab: None,
- fields: BTreeMap::new(),
- slots: Vec::new(),
- reagents: BTreeMap::new(),
- ic: None,
- connections: vec![Connection::CableNetwork {
- net: None,
- typ: CableConnectionType::default(),
- }],
- }
- }
-
- pub fn with_ic(id: u32, ic: u32) -> Self {
- let mut device = Device::new(id);
- device.ic = Some(ic);
- device.connections = vec![
- Connection::CableNetwork {
- net: None,
- typ: CableConnectionType::Data,
- },
- Connection::CableNetwork {
- net: None,
- typ: CableConnectionType::Power,
- },
- ];
- device.prefab = Some(Prefab::new("StructureCircuitHousing"));
- device.fields.extend(vec![
- (
- LogicType::Setting,
- LogicField {
- field_type: FieldType::ReadWrite,
- value: 0.0,
- },
- ),
- (
- LogicType::RequiredPower,
- LogicField {
- field_type: FieldType::Read,
- value: 0.0,
- },
- ),
- (
- LogicType::PrefabHash,
- LogicField {
- field_type: FieldType::Read,
- value: -128473777.0,
- },
- ),
- ]);
- let occupant = SlotOccupant::new(ic, -744098481);
- device.slots.push(Slot::with_occupant(
- SlotType::ProgrammableChip,
- // -744098481 = ItemIntegratedCircuit10
- occupant,
- ));
-
- device
- }
-
- pub fn get_fields(&self, vm: &VM) -> BTreeMap {
- let mut copy = self.fields.clone();
- if let Some(ic_id) = &self.ic {
- let ic = vm.ics.get(ic_id).expect("our own ic to exist").borrow();
- copy.insert(
- LogicType::LineNumber,
- LogicField {
- field_type: FieldType::ReadWrite,
- value: ic.ip() as f64,
- },
- );
- copy.insert(
- LogicType::Error,
- LogicField {
- field_type: FieldType::Read,
- value: match *ic.state.borrow() {
- ICState::Error(_) => 1.0,
- _ => 0.0,
- },
- },
- );
- }
- if self.has_power_state() {
- copy.insert(
- LogicType::Power,
- LogicField {
- field_type: FieldType::Read,
- value: if self.has_power_connection() {
- 1.0
- } else {
- 0.0
- },
- },
- );
- }
- copy.insert(
- LogicType::ReferenceId,
- LogicField {
- field_type: FieldType::Read,
- value: self.id as f64,
- },
- );
- copy
- }
-
- pub fn get_network_id(&self, connection: usize) -> Result {
- if connection >= self.connections.len() {
- Err(ICError::ConnectionIndexOutOfRange(
- connection,
- self.connections.len(),
- ))
- } else if let Connection::CableNetwork {
- net: network_id, ..
- } = self.connections[connection]
- {
- if let Some(network_id) = network_id {
- Ok(network_id)
- } else {
- Err(ICError::NetworkNotConnected(connection))
- }
- } else {
- Err(ICError::NotACableConnection(connection))
- }
- }
-
- pub fn can_logic_read(&self, field: LogicType) -> bool {
- match field {
- LogicType::ReferenceId => true,
- LogicType::LineNumber | LogicType::Error if self.ic.is_some() => true,
- LogicType::Power if self.has_power_state() => true,
- _ => {
- if let Some(logic) = self.fields.get(&field) {
- matches!(logic.field_type, FieldType::Read | FieldType::ReadWrite)
- } else {
- false
- }
- }
- }
- }
-
- pub fn can_logic_write(&self, field: LogicType) -> bool {
- match field {
- LogicType::ReferenceId => false,
- LogicType::LineNumber if self.ic.is_some() => true,
- _ => {
- if let Some(logic) = self.fields.get(&field) {
- matches!(logic.field_type, FieldType::Write | FieldType::ReadWrite)
- } else {
- false
- }
- }
- }
- }
-
- pub fn can_slot_logic_read(&self, field: SlotLogicType, slot: usize) -> bool {
- if self.slots.is_empty() {
- return false;
- }
- let Some(slot) = self.slots.get(slot) else {
- return false;
- };
- slot.can_logic_read(field)
- }
-
- pub fn can_slot_logic_write(&self, field: SlotLogicType, slot: usize) -> bool {
- if self.slots.is_empty() {
- return false;
- }
- let Some(slot) = self.slots.get(slot) else {
- return false;
- };
- slot.can_logic_write(field)
- }
-
- pub fn get_field(&self, typ: LogicType, vm: &VM) -> Result {
- if typ == LogicType::LineNumber && self.ic.is_some() {
- let ic = vm
- .ics
- .get(&self.ic.unwrap())
- .ok_or_else(|| ICError::UnknownDeviceID(self.ic.unwrap() as f64))?
- .borrow();
- Ok(ic.ip() as f64)
- } else if let Some(field) = self.get_fields(vm).get(&typ) {
- if field.field_type == FieldType::Read || field.field_type == FieldType::ReadWrite {
- Ok(field.value)
- } else {
- Err(ICError::WriteOnlyField(typ.to_string()))
- }
- } else {
- Err(ICError::DeviceHasNoField(typ.to_string()))
- }
- }
-
- pub fn set_field(
- &mut self,
- typ: LogicType,
- val: f64,
- vm: &VM,
- force: bool,
- ) -> Result<(), ICError> {
- if typ == LogicType::ReferenceId
- || (typ == LogicType::Error && self.ic.is_some())
- || (typ == LogicType::Power && self.has_power_state())
- {
- Err(ICError::ReadOnlyField(typ.to_string()))
- } else if typ == LogicType::LineNumber && self.ic.is_some() {
- let ic = vm
- .ics
- .get(&self.ic.unwrap())
- .ok_or_else(|| ICError::UnknownDeviceID(self.ic.unwrap() as f64))?
- .borrow();
- ic.set_ip(val as u32);
- Ok(())
- } else if let Some(field) = self.fields.get_mut(&typ) {
- if field.field_type == FieldType::Write
- || field.field_type == FieldType::ReadWrite
- || force
- {
- field.value = val;
- Ok(())
- } else {
- Err(ICError::ReadOnlyField(typ.to_string()))
- }
- } else if force {
- self.fields.insert(
- typ,
- LogicField {
- field_type: FieldType::ReadWrite,
- value: val,
- },
- );
- Ok(())
- } else {
- Err(ICError::DeviceHasNoField(typ.to_string()))
- }
- }
-
- pub fn get_slot_field(&self, index: f64, typ: SlotLogicType, vm: &VM) -> Result {
- let slot = self
- .slots
- .get(index as usize)
- .ok_or(ICError::SlotIndexOutOfRange(index))?;
- if slot.typ == SlotType::ProgrammableChip
- && slot.occupant.is_some()
- && self.ic.is_some()
- && typ == SlotLogicType::LineNumber
- {
- let ic = vm
- .ics
- .get(&self.ic.unwrap())
- .ok_or_else(|| ICError::UnknownDeviceID(self.ic.unwrap() as f64))?
- .borrow();
- Ok(ic.ip() as f64)
- } else {
- Ok(slot.get_field(typ))
- }
- }
-
- pub fn get_slot_fields(
- &self,
- index: f64,
- vm: &VM,
- ) -> Result, ICError> {
- let slot = self
- .slots
- .get(index as usize)
- .ok_or(ICError::SlotIndexOutOfRange(index))?;
- let mut fields = slot.get_fields();
- if slot.typ == SlotType::ProgrammableChip && slot.occupant.is_some() && self.ic.is_some() {
- let ic = vm
- .ics
- .get(&self.ic.unwrap())
- .ok_or_else(|| ICError::UnknownDeviceID(self.ic.unwrap() as f64))?
- .borrow();
- fields.insert(
- SlotLogicType::LineNumber,
- LogicField {
- field_type: FieldType::ReadWrite,
- value: ic.ip() as f64,
- },
- );
- }
- Ok(fields)
- }
-
- pub fn set_slot_field(
- &mut self,
- index: f64,
- typ: SlotLogicType,
- val: f64,
- _vm: &VM,
- force: bool,
- ) -> Result<(), ICError> {
- let slot = self
- .slots
- .get_mut(index as usize)
- .ok_or(ICError::SlotIndexOutOfRange(index))?;
- slot.set_field(typ, val, force)
- }
-
- pub fn get_slot(&self, index: f64) -> Result<&Slot, ICError> {
- self.slots
- .get(index as usize)
- .ok_or(ICError::SlotIndexOutOfRange(index))
- }
-
- pub fn get_reagent(&self, rm: &ReagentMode, reagent: f64) -> f64 {
- if let Some(mode) = self.reagents.get(rm) {
- if let Some(val) = mode.get(&(reagent as i32)) {
- return *val;
- }
- }
- 0.0
- }
-
- pub fn set_name(&mut self, name: &str) {
- self.name_hash = Some(const_crc32::crc32(name.as_bytes()) as i32);
- self.name = Some(name.to_owned());
- }
-
- pub fn has_power_state(&self) -> bool {
- self.connections.iter().any(|conn| {
- matches!(
- conn,
- Connection::CableNetwork {
- typ: CableConnectionType::Power | CableConnectionType::PowerAndData,
- ..
- }
- )
- })
- }
-
- pub fn has_power_connection(&self) -> bool {
- self.connections.iter().any(|conn| {
- matches!(
- conn,
- Connection::CableNetwork {
- net: Some(_),
- typ: CableConnectionType::Power | CableConnectionType::PowerAndData,
- }
- )
- })
- }
-}
-
-#[derive(Debug, Default, Clone, Serialize, Deserialize)]
-pub struct DeviceTemplate {
- pub id: Option,
- pub name: Option,
- pub prefab_name: Option,
- pub slots: Vec,
- // pub reagents: BTreeMap>,
- pub connections: Vec,
- pub fields: BTreeMap,
-}
-
-impl Device {
- /// create a devive from a template and return the device, does not create it's own IC
- pub fn from_template(template: DeviceTemplate, mut id_fn: F) -> Self
- where
- F: FnMut() -> u32,
- {
- // id_fn *must* be captured not moved
- #[allow(clippy::redundant_closure)]
- let device_id = template.id.unwrap_or_else(|| id_fn());
- let name_hash = template
- .name
- .as_ref()
- .map(|name| const_crc32::crc32(name.as_bytes()) as i32);
-
- #[allow(clippy::redundant_closure)]
- let slots = template
- .slots
- .into_iter()
- .map(|slot| Slot {
- typ: slot.typ,
- occupant: slot
- .occupant
- .map(|occupant| SlotOccupant::from_template(occupant, || id_fn())),
- })
- .collect_vec();
-
- let ic = slots
- .iter()
- .find_map(|slot| {
- if slot.typ == SlotType::ProgrammableChip && slot.occupant.is_some() {
- Some(slot.occupant.clone()).flatten()
- } else {
- None
- }
- })
- .map(|occupant| occupant.id);
-
- let fields = template.fields;
-
- Device {
- id: device_id,
- name: template.name,
- name_hash,
- prefab: template.prefab_name.map(|name| Prefab::new(&name)),
- slots,
- // reagents: template.reagents,
- reagents: BTreeMap::new(),
- ic,
- connections: template.connections,
- fields,
- }
- }
-}
-
-impl From for DeviceTemplate
-where
- T: Deref,
-{
- fn from(device: T) -> Self {
- DeviceTemplate {
- id: Some(device.id),
- name: device.name.clone(),
- prefab_name: device.prefab.as_ref().map(|prefab| prefab.name.clone()),
- slots: device
- .slots
- .iter()
- .map(|slot| SlotTemplate {
- typ: slot.typ,
- occupant: slot.occupant.as_ref().map(|occupant| SlotOccupantTemplate {
- id: Some(occupant.id),
- fields: occupant.get_fields(),
- }),
- })
- .collect_vec(),
- connections: device.connections.clone(),
- fields: device.fields.clone(),
- }
- }
-}
diff --git a/ic10emu/src/errors.rs b/ic10emu/src/errors.rs
new file mode 100644
index 0000000..a4e0af7
--- /dev/null
+++ b/ic10emu/src/errors.rs
@@ -0,0 +1,297 @@
+use crate::vm::{
+ instructions::enums::InstructionOp,
+ object::{
+ errors::{LogicError, MemoryError},
+ templates::Prefab,
+ ObjectID,
+ },
+};
+use serde_derive::{Deserialize, Serialize};
+use stationeers_data::templates::ObjectTemplate;
+use std::error::Error as StdError;
+use std::fmt::Display;
+use thiserror::Error;
+#[cfg(feature = "tsify")]
+use tsify::Tsify;
+#[cfg(feature = "tsify")]
+use wasm_bindgen::prelude::*;
+
+#[derive(Error, Debug, Serialize, Deserialize)]
+#[cfg_attr(feature = "tsify", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))]
+pub enum VMError {
+ #[error("device with id '{0}' does not exist")]
+ UnknownId(ObjectID),
+ #[error("ic with id '{0}' does not exist")]
+ UnknownIcId(ObjectID),
+ #[error("ic encountered an error: {0}")]
+ ICError(#[from] ICError),
+ #[error("ic encountered an error: {0}")]
+ LineError(#[from] LineError),
+ #[error("invalid network id {0}")]
+ InvalidNetwork(ObjectID),
+ #[error("device {0} not visible to device {1} (not on the same networks)")]
+ DeviceNotVisible(u32, u32),
+ #[error("a device with id {0} already exists")]
+ IdInUse(u32),
+ #[error("device(s) with ids {0:?} already exist")]
+ IdsInUse(Vec),
+ #[error("attempt to use a set of id's with duplicates: id(s) {0:?} exist more than once")]
+ DuplicateIds(Vec),
+ #[error("object {0} is not a device")]
+ NotADevice(ObjectID),
+ #[error("device object {0} has no pins")]
+ NoDevicePins(ObjectID),
+ #[error("object {0} has no slots")]
+ NotStorage(ObjectID),
+ #[error("object {0} is not an item")]
+ NotAnItem(ObjectID),
+ #[error("object {0} is not programmable")]
+ NotProgrammable(ObjectID),
+ #[error("object {0} is not memory writable")]
+ NotMemoryWritable(ObjectID),
+ #[error("object {0} is not a circuit holder or programmable")]
+ NotCircuitHolderOrProgrammable(ObjectID),
+ #[error("object {0} is not a circuit holder or memory writable")]
+ NotCircuitHolderOrMemoryWritable(ObjectID),
+ #[error("object {0} is a circuit holder but there is no programmable ic present")]
+ NoIC(ObjectID),
+ #[error("{0}")]
+ TemplateError(#[from] TemplateError),
+ #[error("missing child object {0}")]
+ MissingChild(ObjectID),
+ #[error("object {0} is not parentable")]
+ NotParentable(ObjectID),
+ #[error("object {0} is not logicable")]
+ NotLogicable(ObjectID),
+ #[error("network object {0} is not a network")]
+ NonNetworkNetwork(ObjectID),
+}
+
+#[derive(Error, Debug, Serialize, Deserialize)]
+#[cfg_attr(feature = "tsify", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))]
+pub enum TemplateError {
+ #[error("object id {0} has a non conforming set of interfaces")]
+ NonConformingObject(ObjectID),
+ #[error("object id {0} is missing from the VM")]
+ MissingVMObject(ObjectID),
+ #[error("database has no template for prefab {0}")]
+ NoTemplateForPrefab(Prefab),
+ #[error("no prefab provided")]
+ MissingPrefab,
+ #[error("incorrect template for concrete impl {0} from prefab {1}: {2:?}")]
+ IncorrectTemplate(String, Prefab, ObjectTemplate),
+ #[error("frozen memory size error: {0} is not {1}")]
+ MemorySize(usize, usize),
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[cfg_attr(feature = "tsify", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))]
+pub struct LineError {
+ pub error: ICError,
+ pub line: u32,
+ pub msg: String,
+}
+
+impl Display for LineError {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ write!(f, "Error on line {}: {}", self.line, self.error)
+ }
+}
+
+impl StdError for LineError {}
+
+#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
+#[cfg_attr(feature = "tsify", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))]
+pub struct ParseError {
+ pub line: usize,
+ pub start: usize,
+ pub end: usize,
+ pub msg: String,
+}
+
+impl Display for ParseError {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ write!(
+ f,
+ "{} at line {} {}:{}",
+ self.msg, self.line, self.start, self.end
+ )
+ }
+}
+
+impl StdError for ParseError {}
+
+impl ParseError {
+ /// Offset the ParseError in it's line, adding the passed values to it's `start` and `end`
+ #[must_use]
+ pub fn offset(self, offset: usize) -> Self {
+ ParseError {
+ start: self.start + offset,
+ end: self.end + offset,
+ ..self
+ }
+ }
+
+ /// Offset the ParseError line, adding the passed value to it's `line`
+ #[must_use]
+ pub fn offset_line(self, offset: usize) -> Self {
+ ParseError {
+ line: self.line + offset,
+ start: self.start,
+ ..self
+ }
+ }
+
+ /// Mark the parse error as extending 'length' bytes from `start`
+ #[must_use]
+ pub fn span(self, length: usize) -> Self {
+ ParseError {
+ start: self.start,
+ end: self.start + length,
+ ..self
+ }
+ }
+}
+
+#[derive(Debug, Error, Clone, Serialize, Deserialize)]
+#[serde(tag = "typ")]
+#[cfg_attr(feature = "tsify", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))]
+pub enum ICError {
+ #[error("error compiling code: {0}")]
+ ParseError(#[from] ParseError),
+ #[error("{0}")]
+ LogicError(#[from] LogicError),
+ #[error("{0}")]
+ MemoryError(#[from] MemoryError),
+ #[error("duplicate label {label}: first encountered on line {source_line}")]
+ DuplicateLabel {
+ label: String,
+ line: u32,
+ source_line: u32,
+ },
+ #[error("instruction pointer out of range: '{0}'")]
+ InstructionPointerOutOfRange(usize),
+ #[error("register pointer out of range: '{0}'")]
+ RegisterIndexOutOfRange(f64),
+ #[error("device pointer out of range: '{0}'")]
+ DeviceIndexOutOfRange(f64),
+ #[error("stack index out of range: '{0}'")]
+ StackIndexOutOfRange(f64),
+ #[error("slot index out of range: '{0}'")]
+ SlotIndexOutOfRange(f64),
+ #[error("pin index {0} out of range 0-6")]
+ PinIndexOutOfRange(usize),
+ #[error("connection index {index} out of range {range}")]
+ ConnectionIndexOutOfRange { index: usize, range: usize },
+ #[error("unknown device ID '{0}'")]
+ UnknownDeviceID(f64),
+ #[error("too few operands!: provide: '{provided}', desired: '{desired}'")]
+ TooFewOperands { provided: u32, desired: u32 },
+ #[error("too many operands!: provide: '{provided}', desired: '{desired}'")]
+ TooManyOperands { provided: u32, desired: u32 },
+ #[error("incorrect operand type for instruction `{inst}` operand {index}, not a {desired} ")]
+ IncorrectOperandType {
+ inst: InstructionOp,
+ index: usize,
+ desired: String,
+ },
+ #[error("unknown identifier {0}")]
+ UnknownIdentifier(String),
+ #[error("device Not Set")]
+ DeviceNotSet,
+ #[error("shift Underflow i64(signed long)")]
+ ShiftUnderflowI64,
+ #[error("shift Overflow i64(signed long)")]
+ ShiftOverflowI64,
+ #[error("shift underflow i32(signed int)")]
+ ShiftUnderflowI32,
+ #[error("shift overflow i32(signed int)")]
+ ShiftOverflowI32,
+ #[error("duplicate define '{0}'")]
+ DuplicateDefine(String),
+ #[error("read only field '{0}'")]
+ ReadOnlyField(String),
+ #[error("write only field '{0}'")]
+ WriteOnlyField(String),
+ #[error("device has no field '{0}'")]
+ DeviceHasNoField(String),
+ #[error("device has no ic")]
+ DeviceHasNoIC,
+ #[error("unknown device '{0}'")]
+ UnknownDeviceId(f64),
+ #[error("unknown logic type '{0}'")]
+ UnknownLogicType(f64),
+ #[error("unknown slot logic type '{0}'")]
+ UnknownLogicSlotType(f64),
+ #[error("unknown batch mode '{0}'")]
+ UnknownBatchMode(f64),
+ #[error("unknown reagent mode '{0}'")]
+ UnknownReagentMode(f64),
+ #[error("type value not known")]
+ TypeValueNotKnown,
+ #[error("empty device list")]
+ EmptyDeviceList,
+ #[error("connection specifier missing")]
+ MissingConnectionSpecifier,
+ #[error("no data network on connection '{0}'")]
+ NotACableConnection(usize),
+ #[error("network not connected on connection '{0}'")]
+ NetworkNotConnected(usize),
+ #[error("bad network Id '{0}'")]
+ BadNetworkId(u32),
+ #[error("channel index out of range '{0}'")]
+ ChannelIndexOutOfRange(usize),
+ #[error("slot has no occupant")]
+ SlotNotOccupied,
+ #[error("generated Enum {0} has no value attached. Report this error.")]
+ NoGeneratedValue(String),
+ #[error(
+ "generated Enum {enum_name}'s value does not parse as {parse_type} . Report this error."
+ )]
+ BadGeneratedValueParse {
+ enum_name: String,
+ parse_type: String,
+ },
+ #[error("IC with id {0} is not slotted into a circuit holder")]
+ NoCircuitHolder(ObjectID),
+ #[error("IC with id {0} is slotted into a circuit holder with no logic interface?")]
+ CircuitHolderNotLogicable(ObjectID),
+ #[error("object {0} is not slot writeable")]
+ NotSlotWriteable(ObjectID),
+ #[error("object {0} does not use reagents ")]
+ NotReagentReadable(ObjectID),
+ #[error("object {0} is not slot logicable")]
+ NotLogicable(ObjectID),
+ #[error("{0} is not a valid number of sleep seconds")]
+ SleepDurationError(f64),
+ #[error("{duration} can not be added to {time} ")]
+ SleepAdditionError {
+ duration: time::Duration,
+ #[cfg_attr(feature = "tsify", tsify(type = "Date"))]
+ time: time::OffsetDateTime,
+ },
+}
+
+impl ICError {
+ pub const fn too_few_operands(provided: usize, desired: u32) -> Self {
+ ICError::TooFewOperands {
+ provided: provided as u32,
+ desired,
+ }
+ }
+
+ pub const fn too_many_operands(provided: usize, desired: u32) -> Self {
+ ICError::TooManyOperands {
+ provided: provided as u32,
+ desired,
+ }
+ }
+
+ pub const fn mismatch_operands(provided: usize, desired: u32) -> Self {
+ if provided < desired as usize {
+ ICError::too_few_operands(provided, desired)
+ } else {
+ ICError::too_many_operands(provided, desired)
+ }
+ }
+}
diff --git a/ic10emu/src/grammar.rs b/ic10emu/src/grammar.rs
index 027dc14..2d4272f 100644
--- a/ic10emu/src/grammar.rs
+++ b/ic10emu/src/grammar.rs
@@ -1,144 +1,19 @@
-use crate::interpreter::{self, ICError};
-use crate::tokens::{SplitConsecutiveIndicesExt, SplitConsecutiveWithIndices};
+use crate::{
+ errors::ParseError,
+ interpreter,
+ tokens::{SplitConsecutiveIndicesExt, SplitConsecutiveWithIndices},
+ vm::instructions::{
+ enums::InstructionOp,
+ operands::{Device, DeviceSpec, Identifier, Number, Operand, RegisterSpec},
+ Instruction, CONSTANTS_LOOKUP,
+ },
+};
use itertools::Itertools;
-use std::error::Error;
-use std::fmt::Display;
-use std::str::FromStr;
-use strum::EnumProperty;
-
-pub mod generated {
- use super::ParseError;
- use crate::interpreter::ICError;
- use serde::{Deserialize, Serialize};
- use std::str::FromStr;
- use strum::AsRefStr;
- use strum::Display;
- use strum::EnumIter;
- use strum::EnumProperty;
- use strum::EnumString;
- use strum::IntoEnumIterator;
-
- include!(concat!(env!("OUT_DIR"), "/instructions.rs"));
- include!(concat!(env!("OUT_DIR"), "/logictypes.rs"));
- include!(concat!(env!("OUT_DIR"), "/modes.rs"));
- include!(concat!(env!("OUT_DIR"), "/constants.rs"));
- include!(concat!(env!("OUT_DIR"), "/enums.rs"));
-
- impl TryFrom for LogicType {
- type Error = ICError;
- fn try_from(value: f64) -> Result>::Error> {
- if let Some(lt) = LogicType::iter().find(|lt| {
- lt.get_str("value")
- .map(|val| val.parse::().unwrap() as f64 == value)
- .unwrap_or(false)
- }) {
- Ok(lt)
- } else {
- Err(crate::interpreter::ICError::UnknownLogicType(value))
- }
- }
- }
-
- impl TryFrom for SlotLogicType {
- type Error = ICError;
- fn try_from(value: f64) -> Result>::Error> {
- if let Some(slt) = SlotLogicType::iter().find(|lt| {
- lt.get_str("value")
- .map(|val| val.parse::().unwrap() as f64 == value)
- .unwrap_or(false)
- }) {
- Ok(slt)
- } else {
- Err(crate::interpreter::ICError::UnknownSlotLogicType(value))
- }
- }
- }
-
- impl TryFrom for BatchMode {
- type Error = ICError;
- fn try_from(value: f64) -> Result>::Error> {
- if let Some(bm) = BatchMode::iter().find(|lt| {
- lt.get_str("value")
- .map(|val| val.parse::().unwrap() as f64 == value)
- .unwrap_or(false)
- }) {
- Ok(bm)
- } else {
- Err(crate::interpreter::ICError::UnknownBatchMode(value))
- }
- }
- }
-
- impl TryFrom for ReagentMode {
- type Error = ICError;
- fn try_from(value: f64) -> Result>::Error> {
- if let Some(rm) = ReagentMode::iter().find(|lt| {
- lt.get_str("value")
- .map(|val| val.parse::().unwrap() as f64 == value)
- .unwrap_or(false)
- }) {
- Ok(rm)
- } else {
- Err(crate::interpreter::ICError::UnknownReagentMode(value))
- }
- }
- }
-}
-
-pub use generated::*;
-use serde::{Deserialize, Serialize};
-
-#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
-pub struct ParseError {
- pub line: usize,
- pub start: usize,
- pub end: usize,
- pub msg: String,
-}
-
-impl Display for ParseError {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- write!(
- f,
- "{} at line {} {}:{}",
- self.msg, self.line, self.start, self.end
- )
- }
-}
-
-impl Error for ParseError {}
-
-impl ParseError {
- /// Offset the ParseError in it's line, adding the passed values to it's `start` and `end`
- #[must_use]
- pub fn offset(self, offset: usize) -> Self {
- ParseError {
- start: self.start + offset,
- end: self.end + offset,
- ..self
- }
- }
-
- /// Offset the ParseError line, adding the passed value to it's `line`
- #[must_use]
- pub fn offset_line(self, offset: usize) -> Self {
- ParseError {
- line: self.line + offset,
- start: self.start,
- ..self
- }
- }
-
- /// Mark the parse error as extending 'length' bytes from `start`
- #[must_use]
- pub fn span(self, length: usize) -> Self {
- ParseError {
- start: self.start,
- end: self.start + length,
- ..self
- }
- }
-}
+use stationeers_data::enums::{
+ basic::BasicEnum,
+ script::{LogicBatchMethod, LogicReagentMode, LogicSlotType, LogicType},
+};
+use std::{fmt::Display, str::FromStr};
pub fn parse(code: &str) -> Result, ParseError> {
code.lines()
@@ -148,7 +23,7 @@ pub fn parse(code: &str) -> Result, ParseError> {
}
/// Like `parse` but can return Code::Invalid for some lines
-pub fn parse_with_invlaid(code: &str) -> Vec {
+pub fn parse_with_invalid(code: &str) -> Vec {
code.lines()
.enumerate()
.map(|(n, l)| Line::from_str_with_invalid(n, l))
@@ -249,12 +124,6 @@ impl FromStr for Comment {
}
}
-#[derive(PartialEq, Debug, Clone, Serialize, Deserialize)]
-pub struct Instruction {
- pub instruction: InstructionOp,
- pub operands: Vec,
-}
-
impl FromStr for Instruction {
type Err = ParseError;
/// parse a non-empty string for an instruction and it's operands
@@ -262,9 +131,16 @@ impl FromStr for Instruction {
let mut tokens_iter = s.split_consecutive_with_indices(&[' ', '\t'][..]);
let instruction: InstructionOp = {
if let Some((index, token)) = tokens_iter.next() {
- token
- .parse::()
- .map_err(|e| e.offset(index).span(token.len()))
+ token.parse::().map_err(|_e| {
+ ParseError {
+ line: 0,
+ start: 0,
+ end: 0,
+ msg: format!("unknown instruction '{token}'"),
+ }
+ .offset(index)
+ .span(token.len())
+ })
} else {
Err(ParseError {
line: 0,
@@ -323,290 +199,6 @@ fn get_operand_tokens<'a>(
operand_tokens
}
-#[derive(PartialEq, Eq, Debug, Clone, Copy, Serialize, Deserialize)]
-pub enum Device {
- Db,
- Numbered(u32),
- Indirect { indirection: u32, target: u32 },
-}
-
-#[derive(PartialEq, Debug, Clone, Serialize, Deserialize)]
-pub struct RegisterSpec {
- pub indirection: u32,
- pub target: u32,
-}
-
-#[derive(PartialEq, Debug, Clone, Serialize, Deserialize)]
-pub struct DeviceSpec {
- pub device: Device,
- pub connection: Option,
-}
-
-#[derive(PartialEq, Debug, Clone, Serialize, Deserialize)]
-pub enum Operand {
- RegisterSpec(RegisterSpec),
- DeviceSpec(DeviceSpec),
- Number(Number),
- Type {
- logic_type: Option,
- slot_logic_type: Option,
- batch_mode: Option,
- reagent_mode: Option,
- identifier: Identifier,
- },
- Identifier(Identifier),
-}
-
-impl Operand {
- pub fn as_value(
- &self,
- ic: &interpreter::IC,
- inst: InstructionOp,
- index: u32,
- ) -> Result {
- match self.translate_alias(ic) {
- Operand::RegisterSpec(RegisterSpec {
- indirection,
- target,
- }) => ic.get_register(indirection, target),
- Operand::Number(num) => Ok(num.value()),
- Operand::Type {
- logic_type,
- slot_logic_type,
- batch_mode,
- reagent_mode,
- identifier: _,
- } => {
- if let Some(lt) = logic_type {
- Ok(lt
- .get_str("value")
- .ok_or_else(|| ICError::NoGeneratedValue(lt.to_string()))?
- .parse::()
- .map_err(|_| {
- ICError::BadGeneratedValueParse(lt.to_string(), "u16".to_owned())
- })? as f64)
- } else if let Some(slt) = slot_logic_type {
- Ok(slt
- .get_str("value")
- .ok_or_else(|| ICError::NoGeneratedValue(slt.to_string()))?
- .parse::()
- .map_err(|_| {
- ICError::BadGeneratedValueParse(slt.to_string(), "u8".to_owned())
- })? as f64)
- } else if let Some(bm) = batch_mode {
- Ok(bm
- .get_str("value")
- .ok_or_else(|| ICError::NoGeneratedValue(bm.to_string()))?
- .parse::()
- .map_err(|_| {
- ICError::BadGeneratedValueParse(bm.to_string(), "u8".to_owned())
- })? as f64)
- } else if let Some(rm) = reagent_mode {
- Ok(rm
- .get_str("value")
- .ok_or_else(|| ICError::NoGeneratedValue(rm.to_string()))?
- .parse::()
- .map_err(|_| {
- ICError::BadGeneratedValueParse(rm.to_string(), "u8".to_owned())
- })? as f64)
- } else {
- Err(interpreter::ICError::TypeValueNotKnown)
- }
- }
- Operand::Identifier(id) => {
- Err(interpreter::ICError::UnknownIdentifier(id.name.to_string()))
- }
- Operand::DeviceSpec { .. } => Err(interpreter::ICError::IncorrectOperandType {
- inst,
- index,
- desired: "Value".to_owned(),
- }),
- }
- }
-
- pub fn as_value_i64(
- &self,
- ic: &interpreter::IC,
- signed: bool,
- inst: InstructionOp,
- index: u32,
- ) -> Result {
- match self {
- Self::Number(num) => Ok(num.value_i64(signed)),
- _ => {
- let val = self.as_value(ic, inst, index)?;
- if val < -9.223_372_036_854_776E18 {
- Err(interpreter::ICError::ShiftUnderflowI64)
- } else if val <= 9.223_372_036_854_776E18 {
- Ok(interpreter::f64_to_i64(val, signed))
- } else {
- Err(interpreter::ICError::ShiftOverflowI64)
- }
- }
- }
- }
- pub fn as_value_i32(
- &self,
- ic: &interpreter::IC,
- signed: bool,
- inst: InstructionOp,
- index: u32,
- ) -> Result {
- match self {
- Self::Number(num) => Ok(num.value_i64(signed) as i32),
- _ => {
- let val = self.as_value(ic, inst, index)?;
- if val < -2147483648.0 {
- Err(interpreter::ICError::ShiftUnderflowI32)
- } else if val <= 2147483647.0 {
- Ok(val as i32)
- } else {
- Err(interpreter::ICError::ShiftOverflowI32)
- }
- }
- }
- }
-
- pub fn as_register(
- &self,
- ic: &interpreter::IC,
- inst: InstructionOp,
- index: u32,
- ) -> Result {
- match self.translate_alias(ic) {
- Operand::RegisterSpec(reg) => Ok(reg),
- Operand::Identifier(id) => {
- Err(interpreter::ICError::UnknownIdentifier(id.name.to_string()))
- }
- _ => Err(interpreter::ICError::IncorrectOperandType {
- inst,
- index,
- desired: "Register".to_owned(),
- }),
- }
- }
-
- pub fn as_device(
- &self,
- ic: &interpreter::IC,
- inst: InstructionOp,
- index: u32,
- ) -> Result<(Option, Option), interpreter::ICError> {
- match self.translate_alias(ic) {
- Operand::DeviceSpec(DeviceSpec { device, connection }) => match device {
- Device::Db => Ok((Some(ic.device), connection)),
- Device::Numbered(p) => {
- let dp = ic
- .pins
- .borrow()
- .get(p as usize)
- .ok_or(interpreter::ICError::DeviceIndexOutOfRange(p as f64))
- .copied()?;
- Ok((dp, connection))
- }
- Device::Indirect {
- indirection,
- target,
- } => {
- let val = ic.get_register(indirection, target)?;
- let dp = ic
- .pins
- .borrow()
- .get(val as usize)
- .ok_or(interpreter::ICError::DeviceIndexOutOfRange(val))
- .copied()?;
- Ok((dp, connection))
- }
- },
- Operand::Identifier(id) => {
- Err(interpreter::ICError::UnknownIdentifier(id.name.to_string()))
- }
- _ => Err(interpreter::ICError::IncorrectOperandType {
- inst,
- index,
- desired: "Value".to_owned(),
- }),
- }
- }
-
- pub fn as_logic_type(
- &self,
- ic: &interpreter::IC,
- inst: InstructionOp,
- index: u32,
- ) -> Result {
- match &self {
- Operand::Type {
- logic_type: Some(lt),
- ..
- } => Ok(*lt),
- _ => LogicType::try_from(self.as_value(ic, inst, index)?),
- }
- }
-
- pub fn as_slot_logic_type(
- &self,
- ic: &interpreter::IC,
- inst: InstructionOp,
- index: u32,
- ) -> Result {
- match &self {
- Operand::Type {
- slot_logic_type: Some(slt),
- ..
- } => Ok(*slt),
- _ => SlotLogicType::try_from(self.as_value(ic, inst, index)?),
- }
- }
-
- pub fn as_batch_mode(
- &self,
- ic: &interpreter::IC,
- inst: InstructionOp,
- index: u32,
- ) -> Result {
- match &self {
- Operand::Type {
- batch_mode: Some(bm),
- ..
- } => Ok(*bm),
- _ => BatchMode::try_from(self.as_value(ic, inst, index)?),
- }
- }
-
- pub fn as_reagent_mode(
- &self,
- ic: &interpreter::IC,
- inst: InstructionOp,
- index: u32,
- ) -> Result {
- match &self {
- Operand::Type {
- reagent_mode: Some(rm),
- ..
- } => Ok(*rm),
- _ => ReagentMode::try_from(self.as_value(ic, inst, index)?),
- }
- }
-
- pub fn translate_alias(&self, ic: &interpreter::IC) -> Self {
- match &self {
- Operand::Identifier(id) | Operand::Type { identifier: id, .. } => {
- if let Some(alias) = ic.aliases.borrow().get(&id.name) {
- alias.clone()
- } else if let Some(define) = ic.defines.borrow().get(&id.name) {
- Operand::Number(Number::Float(*define))
- } else if let Some(label) = ic.program.borrow().labels.get(&id.name) {
- Operand::Number(Number::Float(*label as f64))
- } else {
- self.clone()
- }
- }
- _ => self.clone(),
- }
- }
-}
-
impl FromStr for Operand {
type Err = ParseError;
/// Parse a str containing an single instruction operand
@@ -877,15 +469,13 @@ impl FromStr for Operand {
}
} else if let Some(val) = CONSTANTS_LOOKUP.get(s) {
Ok(Operand::Number(Number::Constant(*val)))
- } else if let Ok(val) = LogicEnums::from_str(s) {
- Ok(Operand::Number(Number::Enum(
- val.get_str("value").unwrap().parse().unwrap(),
- )))
+ } else if let Ok(val) = BasicEnum::from_str(s) {
+ Ok(Operand::Number(Number::Enum(val.get_value() as f64)))
} else {
let lt = LogicType::from_str(s).ok();
- let slt = SlotLogicType::from_str(s).ok();
- let bm = BatchMode::from_str(s).ok();
- let rm = ReagentMode::from_str(s).ok();
+ let slt = LogicSlotType::from_str(s).ok();
+ let bm = LogicBatchMethod::from_str(s).ok();
+ let rm = LogicReagentMode::from_str(s).ok();
let identifier = Identifier::from_str(s)?;
if lt.is_some() || slt.is_some() || bm.is_some() || rm.is_some() {
Ok(Operand::Type {
@@ -1010,11 +600,6 @@ impl FromStr for Label {
}
}
-#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
-pub struct Identifier {
- pub name: String,
-}
-
impl FromStr for Identifier {
type Err = ParseError;
fn from_str(s: &str) -> Result {
@@ -1060,16 +645,6 @@ impl Display for Identifier {
}
}
-#[derive(PartialEq, Debug, Clone, Serialize, Deserialize)]
-pub enum Number {
- Float(f64),
- Binary(i64),
- Hexadecimal(i64),
- Constant(f64),
- String(String),
- Enum(f64),
-}
-
impl Number {
pub fn value(&self) -> f64 {
match self {
@@ -1081,7 +656,9 @@ impl Number {
}
pub fn value_i64(&self, signed: bool) -> i64 {
match self {
- Number::Enum(val) | Number::Float(val) | Number::Constant(val) => interpreter::f64_to_i64(*val, signed),
+ Number::Enum(val) | Number::Float(val) | Number::Constant(val) => {
+ interpreter::f64_to_i64(*val, signed)
+ }
Number::Binary(val) | Number::Hexadecimal(val) => *val,
Number::String(s) => const_crc32::crc32(s.as_bytes()) as i32 as i64,
}
@@ -1090,10 +667,22 @@ impl Number {
#[cfg(test)]
mod tests {
+ use color_eyre::eyre::Ok;
+ use strum::EnumProperty;
+
use super::*;
+ static INIT: std::sync::Once = std::sync::Once::new();
+
+ fn setup() {
+ INIT.call_once(|| {
+ let _ = color_eyre::install();
+ })
+ }
+
#[test]
- fn parse_register() {
+ fn parse_register() -> color_eyre::Result<()> {
+ setup();
let op = "requestingot".parse::();
assert_eq!(
op.unwrap(),
@@ -1101,10 +690,12 @@ mod tests {
name: "requestingot".to_owned()
})
);
+ Ok(())
}
#[test]
- fn successful_parse() {
+ fn successful_parse() -> color_eyre::Result<()> {
+ setup();
let parsed = parse("s d0 Setting 0 # This is a comment\n");
dbg!(&parsed);
assert_eq!(
@@ -1152,10 +743,12 @@ mod tests {
comment: None,
},],
);
+ Ok(())
}
#[test]
- fn parse_code_chunk() {
+ fn parse_code_chunk() -> color_eyre::Result<()> {
+ setup();
let code = "# This is a comment\n\
define a_def 10\n\
define a_hash HASH(\"This is a String\")\n\
@@ -1250,7 +843,7 @@ mod tests {
}),
Operand::Type {
logic_type: Some(LogicType::On),
- slot_logic_type: Some(SlotLogicType::On),
+ slot_logic_type: Some(LogicSlotType::On),
batch_mode: None,
reagent_mode: None,
identifier: Identifier {
@@ -1425,15 +1018,19 @@ mod tests {
},
],
);
+ Ok(())
}
#[test]
- fn test_operand_display() {
+ fn test_operand_display() -> color_eyre::Result<()> {
+ setup();
+
#[track_caller]
fn test_roundtrip(s: &str) {
let o: Operand = s.parse().expect("test string should parse with FromStr");
assert_eq!(o.to_string(), s);
}
+
test_roundtrip("r0");
test_roundtrip("r15");
test_roundtrip("rr4");
@@ -1459,9 +1056,9 @@ mod tests {
test_roundtrip("1.2345");
test_roundtrip("-1.2345");
test_roundtrip(LogicType::Pressure.as_ref());
- test_roundtrip(SlotLogicType::Occupied.as_ref());
- test_roundtrip(BatchMode::Average.as_ref());
- test_roundtrip(ReagentMode::Recipe.as_ref());
+ test_roundtrip(LogicSlotType::Occupied.as_ref());
+ test_roundtrip(LogicBatchMethod::Average.as_ref());
+ test_roundtrip(LogicReagentMode::Recipe.as_ref());
test_roundtrip("pi");
test_roundtrip("pinf");
test_roundtrip("ninf");
@@ -1469,48 +1066,58 @@ mod tests {
test_roundtrip(r#"HASH("StructureFurnace")"#);
test_roundtrip("$abcd");
test_roundtrip("%1001");
+ Ok(())
}
#[test]
- fn all_generated_enums_have_value() {
+ fn all_generated_enums_have_value() -> color_eyre::Result<()> {
+ setup();
use strum::IntoEnumIterator;
for lt in LogicType::iter() {
println!("testing LogicType.{lt}");
let value = lt.get_str("value");
assert!(value.is_some());
assert!(value.unwrap().parse::().is_ok());
+ assert_eq!(lt as u16, value.unwrap().parse::().unwrap());
}
- for slt in SlotLogicType::iter() {
- println!("testing SlotLogicType.{slt}");
+ for slt in LogicSlotType::iter() {
+ println!("testing LogicSlotType.{slt}");
let value = slt.get_str("value");
assert!(value.is_some());
assert!(value.unwrap().parse::().is_ok());
+ assert_eq!(slt as u8, value.unwrap().parse::().unwrap());
}
- for bm in BatchMode::iter() {
+ for bm in LogicReagentMode::iter() {
println!("testing BatchMode.{bm}");
let value = bm.get_str("value");
assert!(value.is_some());
assert!(value.unwrap().parse::().is_ok());
+ assert_eq!(bm as u8, value.unwrap().parse::().unwrap());
}
- for rm in ReagentMode::iter() {
+ for rm in LogicReagentMode::iter() {
println!("testing ReagentMode.{rm}");
let value = rm.get_str("value");
assert!(value.is_some());
assert!(value.unwrap().parse::().is_ok());
+ assert_eq!(rm as u8, value.unwrap().parse::().unwrap());
}
- for le in LogicEnums::iter() {
- println!("testing Enum.{le}");
+ for le in BasicEnum::iter() {
+ println!("testing BasicEnum {le}");
let value = le.get_str("value");
assert!(value.is_some());
assert!(value.unwrap().parse::().is_ok());
+ assert_eq!(le.get_value(), value.unwrap().parse::().unwrap());
}
+ Ok(())
}
#[test]
- fn bad_parse_does_not_panic() {
+ fn bad_parse_does_not_panic() -> color_eyre::Result<()> {
+ setup();
let code = "move foo -";
let parsed = parse(code);
assert!(parsed.is_err());
println!("{}", parsed.unwrap_err());
+ Ok(())
}
}
diff --git a/ic10emu/src/interpreter.rs b/ic10emu/src/interpreter.rs
index 1094b51..70ec601 100644
--- a/ic10emu/src/interpreter.rs
+++ b/ic10emu/src/interpreter.rs
@@ -1,167 +1,54 @@
use core::f64;
-use serde::{Deserialize, Serialize};
-use std::{
- cell::{Cell, RefCell},
- ops::Deref,
- string::ToString,
-};
+use serde_derive::{Deserialize, Serialize};
use std::{
collections::{BTreeMap, HashSet},
- error::Error,
fmt::Display,
u32,
};
use itertools::Itertools;
+#[cfg(feature = "tsify")]
+use tsify::Tsify;
+#[cfg(feature = "tsify")]
+use wasm_bindgen::prelude::*;
use time::format_description;
use crate::{
- device::SlotType,
- grammar::{self, LogicType, ParseError, SlotLogicType},
- vm::VM,
+ errors::{ICError, LineError},
+ grammar,
+ vm::instructions::{enums::InstructionOp, operands::Operand, Instruction},
};
-use serde_with::serde_as;
-
-use thiserror::Error;
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct LineError {
- error: ICError,
- line: u32,
-}
-
-impl Display for LineError {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- write!(f, "Error on line {}: {}", self.line, self.error)
- }
-}
-
-impl Error for LineError {}
-
-#[derive(Debug, Error, Clone, Serialize, Deserialize)]
-pub enum ICError {
- #[error("error compiling code: {0}")]
- ParseError(#[from] ParseError),
- #[error("duplicate label {0}")]
- DuplicateLabel(String),
- #[error("instruction pointer out of range: '{0}'")]
- InstructionPointerOutOfRange(u32),
- #[error("register pointer out of range: '{0}'")]
- RegisterIndexOutOfRange(f64),
- #[error("device pointer out of range: '{0}'")]
- DeviceIndexOutOfRange(f64),
- #[error("stack index out of range: '{0}'")]
- StackIndexOutOfRange(f64),
- #[error("slot index out of range: '{0}'")]
- SlotIndexOutOfRange(f64),
- #[error("pin index {0} out of range 0-6")]
- PinIndexOutOfRange(usize),
- #[error("connection index {0} out of range {1}")]
- ConnectionIndexOutOfRange(usize, usize),
- #[error("unknown device ID '{0}'")]
- UnknownDeviceID(f64),
- #[error("too few operands!: provide: '{provided}', desired: '{desired}'")]
- TooFewOperands { provided: u32, desired: u32 },
- #[error("too many operands!: provide: '{provided}', desired: '{desired}'")]
- TooManyOperands { provided: u32, desired: u32 },
- #[error("incorrect operand type for instruction `{inst}` operand {index}, not a {desired} ")]
- IncorrectOperandType {
- inst: grammar::InstructionOp,
- index: u32,
- desired: String,
- },
- #[error("unknown identifier {0}")]
- UnknownIdentifier(String),
- #[error("device Not Set")]
- DeviceNotSet,
- #[error("shift Underflow i64(signed long)")]
- ShiftUnderflowI64,
- #[error("shift Overflow i64(signed long)")]
- ShiftOverflowI64,
- #[error("shift underflow i32(signed int)")]
- ShiftUnderflowI32,
- #[error("shift overflow i32(signed int)")]
- ShiftOverflowI32,
- #[error("stack underflow")]
- StackUnderflow,
- #[error("stack overflow")]
- StackOverflow,
- #[error("duplicate define '{0}'")]
- DuplicateDefine(String),
- #[error("read only field '{0}'")]
- ReadOnlyField(String),
- #[error("write only field '{0}'")]
- WriteOnlyField(String),
- #[error("device has no field '{0}'")]
- DeviceHasNoField(String),
- #[error("device has not ic")]
- DeviceHasNoIC,
- #[error("unknown device '{0}'")]
- UnknownDeviceId(f64),
- #[error("unknown logic type '{0}'")]
- UnknownLogicType(f64),
- #[error("unknown slot logic type '{0}'")]
- UnknownSlotLogicType(f64),
- #[error("unknown batch mode '{0}'")]
- UnknownBatchMode(f64),
- #[error("unknown reagent mode '{0}'")]
- UnknownReagentMode(f64),
- #[error("type value not known")]
- TypeValueNotKnown,
- #[error("empty device list")]
- EmptyDeviceList,
- #[error("connection specifier missing")]
- MissingConnectionSpecifier,
- #[error("no data network on connection '{0}'")]
- NotACableConnection(usize),
- #[error("network not connected on connection '{0}'")]
- NetworkNotConnected(usize),
- #[error("bad network Id '{0}'")]
- BadNetworkId(u32),
- #[error("channel index out of range '{0}'")]
- ChannelIndexOutOfRange(usize),
- #[error("slot has no occupant")]
- SlotNotOccupied,
- #[error("generated Enum {0} has no value attached. Report this error.")]
- NoGeneratedValue(String),
- #[error("generated Enum {0}'s value does not parse as {1} . Report this error.")]
- BadGeneratedValueParse(String, String),
-}
-
-impl ICError {
- pub const fn too_few_operands(provided: usize, desired: u32) -> Self {
- ICError::TooFewOperands {
- provided: provided as u32,
- desired,
- }
- }
-
- pub const fn too_many_operands(provided: usize, desired: u32) -> Self {
- ICError::TooManyOperands {
- provided: provided as u32,
- desired,
- }
- }
-
- pub const fn mismatch_operands(provided: usize, desired: u32) -> Self {
- if provided < desired as usize {
- ICError::too_few_operands(provided, desired)
- } else {
- ICError::too_many_operands(provided, desired)
- }
- }
-}
+pub mod instructions;
#[derive(Debug, Clone, Serialize, Deserialize)]
+#[cfg_attr(feature = "tsify", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))]
pub enum ICState {
Start,
Running,
Yield,
- Sleep(time::OffsetDateTime, f64),
- HasCaughtFire,
+ Sleep(
+ #[cfg_attr(feature = "tsify", tsify(type = "string"))]
+ #[serde(with = "time::serde::rfc3339")]
+ time::OffsetDateTime,
+ f64,
+ ),
Error(LineError),
+ HasCaughtFire,
+ Ended,
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize)]
+#[cfg_attr(feature = "tsify", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))]
+pub struct ICInfo {
+ pub instruction_pointer: u32,
+ pub registers: Vec,
+ pub aliases: BTreeMap,
+ pub defines: BTreeMap,
+ pub labels: BTreeMap,
+ pub state: ICState,
+ pub yield_instruction_count: u16,
}
impl Display for ICState {
@@ -169,7 +56,7 @@ impl Display for ICState {
let out = match self {
ICState::Start => "Not Run".to_owned(),
ICState::Running => "Running".to_owned(),
- ICState::Yield => "Ic has yielded, Resume on next tick".to_owned(),
+ ICState::Yield => "IC has yielded, Resume on next tick".to_owned(),
ICState::Sleep(then, sleep_for) => {
let format = format_description::parse("[hour]:[minute]:[second]").unwrap();
let resume = *then + time::Duration::new(*sleep_for as i64, 0);
@@ -180,91 +67,16 @@ impl Display for ICState {
}
ICState::Error(err) => format!("{err}"),
ICState::HasCaughtFire => "IC has caught fire! this is not a joke!".to_owned(),
+ ICState::Ended => "Program has reached the end of exacution".to_owned(),
};
write!(f, "{out}")
}
}
-#[derive(Debug)]
-pub struct IC {
- pub device: u32,
- pub id: u32,
- pub registers: RefCell<[f64; 18]>,
- /// Instruction Pointer
- pub ip: Cell,
- /// Instruction Count since last yield
- pub ic: Cell,
- pub stack: RefCell<[f64; 512]>,
- pub aliases: RefCell>,
- pub defines: RefCell>,
- pub pins: RefCell<[Option; 6]>,
- pub code: RefCell,
- pub program: RefCell,
- pub state: RefCell,
-}
-
-#[serde_as]
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct FrozenIC {
- pub device: u32,
- pub id: u32,
- pub registers: [f64; 18],
- /// Instruction Pointer
- pub ip: u32,
- /// Instruction Count since last yield
- pub ic: u16,
- #[serde_as(as = "[_; 512]")]
- pub stack: [f64; 512],
- pub aliases: BTreeMap,
- pub defines: BTreeMap,
- pub pins: [Option; 6],
- pub state: ICState,
- pub code: String,
-}
-
-impl From for FrozenIC
-where
- T: Deref,
-{
- fn from(ic: T) -> Self {
- FrozenIC {
- device: ic.device,
- id: ic.id,
- registers: *ic.registers.borrow(),
- ip: ic.ip.get(),
- ic: ic.ic.get(),
- stack: *ic.stack.borrow(),
- aliases: ic.aliases.borrow().clone(),
- defines: ic.defines.borrow().clone(),
- pins: *ic.pins.borrow(),
- state: ic.state.borrow().clone(),
- code: ic.code.borrow().clone(),
- }
- }
-}
-
-impl From for IC {
- fn from(value: FrozenIC) -> Self {
- IC {
- device: value.device,
- id: value.id,
- registers: RefCell::new(value.registers),
- ip: Cell::new(value.ip),
- ic: Cell::new(value.ic),
- stack: RefCell::new(value.stack),
- aliases: RefCell::new(value.aliases),
- defines: RefCell::new(value.defines),
- pins: RefCell::new(value.pins),
- state: RefCell::new(value.state),
- code: RefCell::new(value.code.clone()),
- program: RefCell::new(Program::from_code_with_invalid(&value.code)),
- }
- }
-}
-
#[derive(Debug, Clone, Serialize, Deserialize)]
+#[cfg_attr(feature = "tsify", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))]
pub struct Program {
- pub instructions: Vec,
+ pub instructions: Vec,
pub errors: Vec,
pub labels: BTreeMap,
}
@@ -284,6 +96,15 @@ impl Program {
}
}
+ pub fn len(&self) -> usize {
+ self.instructions.len()
+ }
+
+ #[must_use]
+ pub fn is_empty(&self) -> bool {
+ self.len() == 0
+ }
+
pub fn try_from_code(code: &str) -> Result {
let parse_tree = grammar::parse(code)?;
let mut labels_set = HashSet::new();
@@ -293,19 +114,25 @@ impl Program {
.into_iter()
.enumerate()
.map(|(line_number, line)| match line.code {
- None => Ok(grammar::Instruction {
- instruction: grammar::InstructionOp::Nop,
+ None => Ok(Instruction {
+ instruction: InstructionOp::Nop,
operands: vec![],
}),
Some(code) => match code {
grammar::Code::Label(label) => {
if labels_set.contains(&label.id.name) {
- Err(ICError::DuplicateLabel(label.id.name))
+ let source_line =
+ labels.get(&label.id.name).copied().unwrap_or_default();
+ Err(ICError::DuplicateLabel {
+ label: label.id.name,
+ line: line_number as u32,
+ source_line,
+ })
} else {
labels_set.insert(label.id.name.clone());
labels.insert(label.id.name, line_number as u32);
- Ok(grammar::Instruction {
- instruction: grammar::InstructionOp::Nop,
+ Ok(Instruction {
+ instruction: InstructionOp::Nop,
operands: vec![],
})
}
@@ -323,7 +150,7 @@ impl Program {
}
pub fn from_code_with_invalid(code: &str) -> Self {
- let parse_tree = grammar::parse_with_invlaid(code);
+ let parse_tree = grammar::parse_with_invalid(code);
let mut labels_set = HashSet::new();
let mut labels = BTreeMap::new();
let mut errors = Vec::new();
@@ -331,28 +158,34 @@ impl Program {
.into_iter()
.enumerate()
.map(|(line_number, line)| match line.code {
- None => grammar::Instruction {
- instruction: grammar::InstructionOp::Nop,
+ None => Instruction {
+ instruction: InstructionOp::Nop,
operands: vec![],
},
Some(code) => match code {
grammar::Code::Label(label) => {
if labels_set.contains(&label.id.name) {
- errors.push(ICError::DuplicateLabel(label.id.name));
+ let source_line =
+ labels.get(&label.id.name).copied().unwrap_or_default();
+ errors.push(ICError::DuplicateLabel {
+ label: label.id.name,
+ line: line_number as u32,
+ source_line,
+ });
} else {
labels_set.insert(label.id.name.clone());
labels.insert(label.id.name, line_number as u32);
}
- grammar::Instruction {
- instruction: grammar::InstructionOp::Nop,
+ Instruction {
+ instruction: InstructionOp::Nop,
operands: vec![],
}
}
grammar::Code::Instruction(instruction) => instruction,
grammar::Code::Invalid(err) => {
errors.push(err.into());
- grammar::Instruction {
- instruction: grammar::InstructionOp::Nop,
+ Instruction {
+ instruction: InstructionOp::Nop,
operands: vec![],
}
}
@@ -366,2247 +199,14 @@ impl Program {
}
}
- pub fn get_line(&self, line: u32) -> Result<&grammar::Instruction, ICError> {
+ pub fn get_line(&self, line: usize) -> Result {
self.instructions
- .get(line as usize)
+ .get(line)
+ .cloned()
.ok_or(ICError::InstructionPointerOutOfRange(line))
}
}
-impl IC {
- pub fn new(id: u32, device: u32) -> Self {
- IC {
- device,
- id,
- ip: Cell::new(0),
- ic: Cell::new(0),
- registers: RefCell::new([0.0; 18]),
- stack: RefCell::new([0.0; 512]),
- pins: RefCell::new([None; 6]),
- program: RefCell::new(Program::new()),
- code: RefCell::new(String::new()),
- aliases: RefCell::new(BTreeMap::new()),
- defines: RefCell::new(BTreeMap::new()),
- state: RefCell::new(ICState::Start),
- }
- }
-
- pub fn reset(&self) {
- self.ip.replace(0);
- self.ic.replace(0);
- self.registers.replace([0.0; 18]);
- self.stack.replace([0.0; 512]);
- self.aliases.replace(BTreeMap::new());
- self.defines.replace(BTreeMap::new());
- self.state.replace(ICState::Start);
- }
-
- /// Set program code if it's valid
- pub fn set_code(&self, code: &str) -> Result<(), ICError> {
- let prog = Program::try_from_code(code)?;
- self.program.replace(prog);
- self.code.replace(code.to_string());
- Ok(())
- }
-
- /// Set program code and translate invalid lines to Nop, collecting errors
- pub fn set_code_invalid(&mut self, code: &str) {
- let prog = Program::from_code_with_invalid(code);
- self.program.replace(prog);
- self.code.replace(code.to_string());
- }
-
- pub fn get_real_target(&self, indirection: u32, target: u32) -> Result {
- let mut i = indirection;
- let mut t = target as f64;
- while i > 0 {
- if let Some(new_t) = self.registers.borrow().get(t as usize) {
- t = *new_t;
- } else {
- return Err(ICError::RegisterIndexOutOfRange(t));
- }
- i -= 1;
- }
- Ok(t)
- }
-
- pub fn get_register(&self, indirection: u32, target: u32) -> Result {
- let t = self.get_real_target(indirection, target)?;
- self.registers
- .borrow()
- .get(t as usize)
- .ok_or(ICError::RegisterIndexOutOfRange(t))
- .copied()
- }
-
- /// sets a register thorough, recursing through provided indirection, returns value previously
- pub fn set_register(&self, indirection: u32, target: u32, val: f64) -> Result {
- let t = self.get_real_target(indirection, target)?;
- let mut registers = self.registers.borrow_mut();
- let old_val = registers
- .get(t as usize)
- .ok_or(ICError::RegisterIndexOutOfRange(t))
- .copied()?;
- registers[t as usize] = val;
- Ok(old_val)
- }
-
- /// save ip to 'ra' or register 18
- fn al(&self) {
- self.registers.borrow_mut()[17] = self.ip() as f64 + 1.0;
- }
-
- pub fn push(&self, val: f64) -> Result {
- let mut registers = self.registers.borrow_mut();
- let mut stack = self.stack.borrow_mut();
- let sp = (registers[16].round()) as i32;
- if sp < 0 {
- Err(ICError::StackUnderflow)
- } else if sp >= 512 {
- Err(ICError::StackOverflow)
- } else {
- let last = stack[sp as usize];
- stack[sp as usize] = val;
- registers[16] += 1.0;
- Ok(last)
- }
- }
-
- pub fn pop(&self) -> Result {
- let mut registers = self.registers.borrow_mut();
- registers[16] -= 1.0;
- let sp = (registers[16].round()) as i32;
- if sp < 0 {
- Err(ICError::StackUnderflow)
- } else if sp >= 512 {
- Err(ICError::StackOverflow)
- } else {
- let last = self.stack.borrow()[sp as usize];
- Ok(last)
- }
- }
-
- pub fn poke(&self, address: f64, val: f64) -> Result {
- let sp = address.round() as i32;
- if !(0..512).contains(&sp) {
- Err(ICError::StackIndexOutOfRange(address))
- } else {
- let mut stack = self.stack.borrow_mut();
- let last = stack[sp as usize];
- stack[sp as usize] = val;
- Ok(last)
- }
- }
-
- pub fn peek(&self) -> Result {
- let sp = (self.registers.borrow()[16] - 1.0).round() as i32;
- if sp < 0 {
- Err(ICError::StackUnderflow)
- } else if sp >= 512 {
- Err(ICError::StackOverflow)
- } else {
- let last = self.stack.borrow()[sp as usize];
- Ok(last)
- }
- }
-
- pub fn peek_addr(&self, addr: f64) -> Result {
- let sp = (addr) as i32;
- if sp < 0 {
- Err(ICError::StackUnderflow)
- } else if sp >= 512 {
- Err(ICError::StackOverflow)
- } else {
- let last = self.stack.borrow()[sp as usize];
- Ok(last)
- }
- }
-
- pub fn propgate_line_number(&self, vm: &VM) {
- if let Some(device) = vm.devices.get(&self.device) {
- let mut device_ref = device.borrow_mut();
- let _ = device_ref.set_field(LogicType::LineNumber, self.ip.get() as f64, vm, true);
- if let Some(slot) = device_ref
- .slots
- .iter_mut()
- .find(|slot| slot.typ == SlotType::ProgrammableChip)
- {
- let _ = slot.set_field(SlotLogicType::LineNumber, self.ip.get() as f64, true);
- }
- }
- }
-
- /// processes one line of the contained program
- pub fn step(&self, vm: &VM, advance_ip_on_err: bool) -> Result {
- // TODO: handle sleep
- self.state.replace(ICState::Running);
- let line = self.ip();
- let result = self.internal_step(vm, advance_ip_on_err);
- if let Err(error) = result {
- let error = LineError { error, line };
- self.state.replace(ICState::Error(error.clone()));
- Err(error)
- } else {
- Ok(true)
- }
- }
-
- pub fn ip(&self) -> u32 {
- self.ip.get()
- }
-
- pub fn set_ip(&self, val: u32) {
- self.ip.replace(val);
- }
-
- fn internal_step(&self, vm: &VM, advance_ip_on_err: bool) -> Result<(), ICError> {
- use grammar::*;
- use ICError::*;
-
- let mut next_ip = self.ip() + 1;
- // XXX: This closure should be replaced with a try block
- // https://github.com/rust-lang/rust/issues/31436
- let mut process_op = |this: &Self| -> Result<(), ICError> {
- use grammar::InstructionOp::*;
-
- // force the program borrow to drop
- let line = {
- let prog = this.program.borrow();
- prog.get_line(this.ip())?.clone()
- };
- let operands = &line.operands;
- let inst = line.instruction;
- match inst {
- Nop => Ok(()),
- Hcf => Ok(()), // TODO
- Sleep => match &operands[..] {
- [a] => {
- let a = a.as_value(this, inst, 1)?;
- let now = time::OffsetDateTime::now_local()
- .unwrap_or_else(|_| time::OffsetDateTime::now_utc());
- this.state.replace(ICState::Sleep(now, a));
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 1)),
- }, // TODO
- Yield => match &operands[..] {
- [] => {
- this.state.replace(ICState::Yield);
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 0)),
- },
- Define => match &operands[..] {
- [name, number] => {
- let &Operand::Identifier(ident) = &name else {
- return Err(IncorrectOperandType {
- inst: line.instruction,
- index: 1,
- desired: "Name".to_owned(),
- });
- };
- let &Operand::Number(num) = &number else {
- return Err(IncorrectOperandType {
- inst: line.instruction,
- index: 2,
- desired: "Number".to_owned(),
- });
- };
- let mut defines = this.defines.borrow_mut();
- if defines.contains_key(&ident.name) {
- Err(DuplicateDefine(ident.name.clone()))
- } else {
- defines.insert(ident.name.clone(), num.value());
- Ok(())
- }
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Alias => match &operands[..] {
- [name, device_reg] => {
- let &Operand::Identifier(ident) = &name else {
- return Err(IncorrectOperandType {
- inst: line.instruction,
- index: 1,
- desired: "Name".to_owned(),
- });
- };
- let alias = match &device_reg {
- Operand::RegisterSpec(RegisterSpec {
- indirection,
- target,
- }) => Operand::RegisterSpec(RegisterSpec {
- indirection: *indirection,
- target: *target,
- }),
- Operand::DeviceSpec(DeviceSpec { device, connection }) => {
- Operand::DeviceSpec(DeviceSpec {
- device: *device,
- connection: *connection,
- })
- }
- _ => {
- return Err(IncorrectOperandType {
- inst: line.instruction,
- index: 2,
- desired: "Device Or Register".to_owned(),
- })
- }
- };
- this.aliases.borrow_mut().insert(ident.name.clone(), alias);
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Move => match &operands[..] {
- [reg, val] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, line.instruction, 1)?;
-
- let val = val.as_value(this, inst, 2)?;
- this.set_register(indirection, target, val)?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
-
- Beq => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a == b { c as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Beqal => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a == b { c as u32 } else { next_ip };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Breq => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a == b {
- (this.ip() as f64 + c) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Beqz => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a == 0.0 { b as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Beqzal => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a == 0.0 { b as u32 } else { next_ip };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Breqz => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a == 0.0 {
- (this.ip() as f64 + b) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Bne => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a != b { c as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Bneal => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a != b { c as u32 } else { next_ip };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Brne => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a != b {
- (this.ip() as f64 + c) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Bnez => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a != 0.0 { b as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Bnezal => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a != 0.0 { b as u32 } else { next_ip };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Brnez => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a != 0.0 {
- (this.ip() as f64 + b) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Blt => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a < b { c as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Bltal => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a < b { c as u32 } else { next_ip };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Brlt => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a < b {
- (this.ip() as f64 + c) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Ble => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a <= b { c as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Bleal => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a <= b { c as u32 } else { next_ip };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Brle => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a <= b {
- (this.ip() as f64 + c) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Blez => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a <= 0.0 { b as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Blezal => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a <= 0.0 { b as u32 } else { next_ip };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Brlez => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a <= 0.0 {
- (this.ip() as f64 + b) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Bltz => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a < 0.0 { b as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Bltzal => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a < 0.0 { b as u32 } else { next_ip };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Brltz => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a < 0.0 {
- (this.ip() as f64 + b) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Bgt => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a > b { c as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Bgtal => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a > b { c as u32 } else { next_ip };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Brgt => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a > b {
- (this.ip() as f64 + c) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Bgtz => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a > 0.0 { b as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Bgtzal => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a > 0.0 { b as u32 } else { next_ip };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Brgtz => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a > 0.0 {
- (this.ip() as f64 + b) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Bge => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a >= b { c as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Bgeal => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a >= b { c as u32 } else { next_ip };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Brge => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a >= b {
- (this.ip() as f64 + c) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Bgez => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a >= 0.0 { b as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Bgezal => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a >= 0.0 { b as u32 } else { next_ip };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Brgez => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a >= 0.0 {
- (this.ip() as f64 + b) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Bap => match &operands[..] {
- [a, b, c, d] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- let d = d.as_value(this, inst, 4)?;
- next_ip = if f64::abs(a - b)
- <= f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0)
- {
- d as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 4)),
- },
- Bapal => match &operands[..] {
- [a, b, c, d] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- let d = d.as_value(this, inst, 4)?;
- next_ip = if f64::abs(a - b)
- <= f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0)
- {
- d as u32
- } else {
- next_ip
- };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 4)),
- },
- Brap => match &operands[..] {
- [a, b, c, d] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- let d = d.as_value(this, inst, 4)?;
- next_ip = if f64::abs(a - b)
- <= f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0)
- {
- (this.ip() as f64 + d) as u32
- } else {
- next_ip
- };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 4)),
- },
- Bapz => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a.abs() <= f64::max(b * a.abs(), f64::EPSILON * 8.0) {
- c as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Bapzal => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a.abs() <= f64::max(b * a.abs(), f64::EPSILON * 8.0) {
- c as u32
- } else {
- next_ip
- };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Brapz => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a.abs() <= f64::max(b * a.abs(), f64::EPSILON * 8.0) {
- (this.ip() as f64 + c) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Bna => match &operands[..] {
- [a, b, c, d] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- let d = d.as_value(this, inst, 4)?;
- next_ip = if f64::abs(a - b)
- > f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0)
- {
- d as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 4)),
- },
- Bnaal => match &operands[..] {
- [a, b, c, d] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- let d = d.as_value(this, inst, 4)?;
- next_ip = if f64::abs(a - b)
- > f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0)
- {
- d as u32
- } else {
- next_ip
- };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 4)),
- },
- Brna => match &operands[..] {
- [a, b, c, d] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- let d = d.as_value(this, inst, 4)?;
- next_ip = if f64::abs(a - b)
- > f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0)
- {
- (this.ip() as f64 + d) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 4)),
- },
- Bnaz => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a.abs() > f64::max(b * a.abs(), f64::EPSILON * 8.0) {
- c as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Bnazal => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a.abs() > f64::max(b * a.abs(), f64::EPSILON * 8.0) {
- c as u32
- } else {
- next_ip
- };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Brnaz => match &operands[..] {
- [a, b, c] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- let c = c.as_value(this, inst, 3)?;
- next_ip = if a.abs() > f64::max(b * a.abs(), f64::EPSILON * 8.0) {
- (this.ip() as f64 + c) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Bdse => match &operands[..] {
- [d, a] => {
- let (device, _connection) = d.as_device(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- next_ip = if device.is_some() { a as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Bdseal => match &operands[..] {
- [d, a] => {
- let (device, _connection) = d.as_device(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- next_ip = if device.is_some() { a as u32 } else { next_ip };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Brdse => match &operands[..] {
- [d, a] => {
- let (device, _connection) = d.as_device(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- next_ip = if device.is_some() {
- (this.ip() as f64 + a) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Bdns => match &operands[..] {
- [d, a] => {
- let (device, _connection) = d.as_device(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- next_ip = if device.is_none() { a as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Bdnsal => match &operands[..] {
- [d, a] => {
- let (device, _connection) = d.as_device(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- next_ip = if device.is_none() { a as u32 } else { next_ip };
- this.al();
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Brdns => match &operands[..] {
- [d, a] => {
- let (device, _connection) = d.as_device(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- next_ip = if device.is_none() {
- (this.ip() as f64 + a) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Bnan => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a.is_nan() { b as u32 } else { next_ip };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Brnan => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- next_ip = if a.is_nan() {
- (this.ip() as f64 + b) as u32
- } else {
- next_ip
- };
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
-
- J => match &operands[..] {
- [a] => {
- let a = a.as_value(this, inst, 1)?;
- next_ip = a as u32;
- Ok(())
- }
- oprs => Err(ICError::too_many_operands(oprs.len(), 1)),
- },
- Jal => match &operands[..] {
- [a] => {
- let a = a.as_value(this, inst, 1)?;
- next_ip = a as u32;
- this.al();
- Ok(())
- }
- oprs => Err(ICError::too_many_operands(oprs.len(), 1)),
- },
- Jr => match &operands[..] {
- [a] => {
- let a = a.as_value(this, inst, 1)?;
- next_ip = (this.ip() as f64 + a) as u32;
- Ok(())
- }
- oprs => Err(ICError::too_many_operands(oprs.len(), 1)),
- },
-
- Seq => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(indirection, target, if a == b { 1.0 } else { 0.0 })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Seqz => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, if a == 0.0 { 1.0 } else { 0.0 })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sne => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(indirection, target, if a != b { 1.0 } else { 0.0 })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Snez => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, if a != 0.0 { 1.0 } else { 0.0 })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Slt => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(indirection, target, if a < b { 1.0 } else { 0.0 })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sltz => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, if a < 0.0 { 1.0 } else { 0.0 })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sle => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(indirection, target, if a <= b { 1.0 } else { 0.0 })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Slez => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, if a <= 0.0 { 1.0 } else { 0.0 })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sgt => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(indirection, target, if a > b { 1.0 } else { 0.0 })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sgtz => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, if a > 0.0 { 1.0 } else { 0.0 })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sge => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(indirection, target, if a >= b { 1.0 } else { 0.0 })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sgez => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, if a >= 0.0 { 1.0 } else { 0.0 })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sap => match &operands[..] {
- [reg, a, b, c] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- let c = c.as_value(this, inst, 4)?;
- this.set_register(
- indirection,
- target,
- if f64::abs(a - b)
- <= f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0)
- {
- 1.0
- } else {
- 0.0
- },
- )?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sapz => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(
- indirection,
- target,
- if a.abs() <= f64::max(b * a.abs(), f64::EPSILON * 8.0) {
- 1.0
- } else {
- 0.0
- },
- )?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sna => match &operands[..] {
- [reg, a, b, c] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- let c = c.as_value(this, inst, 4)?;
- this.set_register(
- indirection,
- target,
- if f64::abs(a - b)
- > f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0)
- {
- 1.0
- } else {
- 0.0
- },
- )?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 4)),
- },
- Snaz => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(
- indirection,
- target,
- if a.abs() > f64::max(b * a.abs(), f64::EPSILON * 8.0) {
- 1.0
- } else {
- 0.0
- },
- )?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sdse => match &operands[..] {
- [reg, device] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let (device, _connection) = device.as_device(this, inst, 2)?;
- this.set_register(
- indirection,
- target,
- if device.is_some() { 1.0 } else { 0.0 },
- )?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Sdns => match &operands[..] {
- [reg, device] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let (device, _connection) = device.as_device(this, inst, 2)?;
- this.set_register(
- indirection,
- target,
- if device.is_none() { 1.0 } else { 0.0 },
- )?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Snan => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, if a.is_nan() { 1.0 } else { 0.0 })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Snanz => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, if a.is_nan() { 0.0 } else { 1.0 })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
-
- Select => match &operands[..] {
- [reg, a, b, c] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- let c = c.as_value(this, inst, 4)?;
- this.set_register(indirection, target, if a != 0.0 { b } else { c })?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 4)),
- },
-
- Add => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(indirection, target, a + b)?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sub => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(indirection, target, a - b)?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Mul => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(indirection, target, a * b)?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Div => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(indirection, target, a / b)?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Mod => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 1)?;
- let mut m = a % b;
- if m < 0.0 {
- m += b;
- }
- this.set_register(indirection, target, m)?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Exp => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, f64::exp(a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Log => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, f64::ln(a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Sqrt => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, f64::sqrt(a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
-
- Max => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(indirection, target, f64::max(a, b))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Min => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(indirection, target, f64::min(a, b))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Ceil => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, f64::ceil(a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Floor => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, f64::floor(a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Abs => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, f64::abs(a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Round => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, f64::round(a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Trunc => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, f64::trunc(a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
-
- Rand => match &operands[..] {
- [reg] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let val = vm.random_f64();
- this.set_register(indirection, target, val)?;
- Ok(())
- }
- oprs => Err(ICError::too_many_operands(oprs.len(), 1)),
- },
-
- Sin => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, f64::sin(a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Cos => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, f64::cos(a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Tan => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, f64::tan(a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Asin => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, f64::asin(a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Acos => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, f64::acos(a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Atan => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- this.set_register(indirection, target, f64::atan(a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Atan2 => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value(this, inst, 2)?;
- let b = b.as_value(this, inst, 3)?;
- this.set_register(indirection, target, f64::atan2(a, b))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
-
- Sll | Sla => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value_i64(this, true, inst, 2)?;
- let b = b.as_value_i32(this, true, inst, 3)?;
- this.set_register(indirection, target, i64_to_f64(a << b))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Srl => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value_i64(this, false, inst, 2)?;
- let b = b.as_value_i32(this, true, inst, 3)?;
- this.set_register(indirection, target, i64_to_f64((a as u64 >> b) as i64))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sra => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value_i64(this, true, inst, 2)?;
- let b = b.as_value_i32(this, true, inst, 3)?;
- this.set_register(indirection, target, i64_to_f64(a >> b))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
-
- And => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value_i64(this, true, inst, 2)?;
- let b = b.as_value_i64(this, true, inst, 3)?;
- this.set_register(indirection, target, i64_to_f64(a & b))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Or => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value_i64(this, true, inst, 2)?;
- let b = b.as_value_i64(this, true, inst, 3)?;
- this.set_register(indirection, target, i64_to_f64(a | b))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Xor => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value_i64(this, true, inst, 2)?;
- let b = b.as_value_i64(this, true, inst, 3)?;
- this.set_register(indirection, target, i64_to_f64(a ^ b))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Nor => match &operands[..] {
- [reg, a, b] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value_i64(this, true, inst, 2)?;
- let b = b.as_value_i64(this, true, inst, 3)?;
- this.set_register(indirection, target, i64_to_f64(!(a | b)))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Not => match &operands[..] {
- [reg, a] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let a = a.as_value_i64(this, true, inst, 2)?;
- this.set_register(indirection, target, i64_to_f64(!a))?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
-
- Push => match &operands[..] {
- [a] => {
- let a = a.as_value(this, inst, 1)?;
- this.push(a)?;
- Ok(())
- }
- oprs => Err(ICError::too_many_operands(oprs.len(), 1)),
- },
- Pop => match &operands[..] {
- [reg] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let val = this.pop()?;
- this.set_register(indirection, target, val)?;
- Ok(())
- }
- oprs => Err(ICError::too_many_operands(oprs.len(), 1)),
- },
- Poke => match &operands[..] {
- [a, b] => {
- let a = a.as_value(this, inst, 1)?;
- let b = b.as_value(this, inst, 2)?;
- this.poke(a, b)?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 2)),
- },
- Peek => match &operands[..] {
- [reg] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let val = this.peek()?;
- this.set_register(indirection, target, val)?;
- Ok(())
- }
- oprs => Err(ICError::too_many_operands(oprs.len(), 1)),
- },
-
- Get => match &operands[..] {
- [reg, dev_id, addr] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let (Some(device_id), _connection) = dev_id.as_device(this, inst, 2)?
- else {
- return Err(DeviceNotSet);
- };
- let device = vm.get_device_same_network(this.device, device_id);
- match device {
- Some(device) => match device.borrow().ic.as_ref() {
- Some(ic_id) => {
- let addr = addr.as_value(this, inst, 3)?;
- let val = {
- if ic_id == &this.id {
- this.peek_addr(addr)
- } else {
- let ic = vm.ics.get(ic_id).unwrap().borrow();
- ic.peek_addr(addr)
- }
- }?;
- this.set_register(indirection, target, val)?;
- Ok(())
- }
- None => Err(DeviceHasNoIC),
- },
- None => Err(UnknownDeviceID(device_id as f64)),
- }
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Getd => match &operands[..] {
- [reg, dev_id, addr] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let (Some(device_id), _connection) = dev_id.as_device(this, inst, 2)?
- else {
- return Err(DeviceNotSet);
- };
- let device = vm.get_device_same_network(this.device, device_id);
- match device {
- Some(device) => match device.borrow().ic.as_ref() {
- Some(ic_id) => {
- let addr = addr.as_value(this, inst, 3)?;
- let val = {
- if ic_id == &this.id {
- this.peek_addr(addr)
- } else {
- let ic = vm.ics.get(ic_id).unwrap().borrow();
- ic.peek_addr(addr)
- }
- }?;
- this.set_register(indirection, target, val)?;
- Ok(())
- }
- None => Err(DeviceHasNoIC),
- },
- None => Err(UnknownDeviceID(device_id as f64)),
- }
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Put => match &operands[..] {
- [dev_id, addr, val] => {
- let (Some(device_id), _connection) = dev_id.as_device(this, inst, 1)?
- else {
- return Err(DeviceNotSet);
- };
- let device = vm.get_device_same_network(this.device, device_id);
- match device {
- Some(device) => match device.borrow().ic.as_ref() {
- Some(ic_id) => {
- let addr = addr.as_value(this, inst, 2)?;
- let val = val.as_value(this, inst, 3)?;
- if ic_id == &this.id {
- this.poke(addr, val)?;
- } else {
- let ic = vm.ics.get(ic_id).unwrap().borrow();
- ic.poke(addr, val)?;
- }
- vm.set_modified(device_id);
- Ok(())
- }
- None => Err(DeviceHasNoIC),
- },
- None => Err(UnknownDeviceID(device_id as f64)),
- }
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Putd => match &operands[..] {
- [dev_id, addr, val] => {
- let device_id = dev_id.as_value(this, inst, 1)?;
- if device_id >= u16::MAX as f64 || device_id < u16::MIN as f64 {
- return Err(DeviceIndexOutOfRange(device_id));
- }
- let device = vm.get_device_same_network(this.device, device_id as u32);
- match device {
- Some(device) => match device.borrow().ic.as_ref() {
- Some(ic_id) => {
- let addr = addr.as_value(this, inst, 2)?;
- let val = val.as_value(this, inst, 3)?;
- if ic_id == &this.id {
- this.poke(addr, val)?;
- } else {
- let ic = vm.ics.get(ic_id).unwrap().borrow();
- ic.poke(addr, val)?;
- }
- vm.set_modified(device_id as u32);
- Ok(())
- }
- None => Err(DeviceHasNoIC),
- },
- None => Err(UnknownDeviceID(device_id)),
- }
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
-
- S => match &operands[..] {
- [dev, lt, val] => {
- let (Some(device_id), connection) = dev.as_device(this, inst, 1)? else {
- return Err(DeviceNotSet);
- };
- let lt = lt.as_logic_type(this, inst, 2)?;
- if CHANNEL_LOGIC_TYPES.contains(<) {
- let channel = lt.as_channel().unwrap();
- let Some(connection) = connection else {
- return Err(MissingConnectionSpecifier);
- };
- let network_id = vm
- .get_device_same_network(this.device, device_id)
- .map(|device| device.borrow().get_network_id(connection))
- .unwrap_or(Err(UnknownDeviceID(device_id as f64)))?;
- let val = val.as_value(this, inst, 3)?;
- vm.set_network_channel(network_id, channel, val)?;
- return Ok(());
- }
- let device = vm.get_device_same_network(this.device, device_id);
- match device {
- Some(device) => {
- let val = val.as_value(this, inst, 1)?;
- device.borrow_mut().set_field(lt, val, vm, false)?;
- vm.set_modified(device_id);
- Ok(())
- }
- None => Err(UnknownDeviceID(device_id as f64)),
- }
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sd => match &operands[..] {
- [dev, lt, val] => {
- let device_id = dev.as_value(this, inst, 1)?;
- if device_id >= u16::MAX as f64 || device_id < u16::MIN as f64 {
- return Err(DeviceIndexOutOfRange(device_id));
- }
- let device = vm.get_device_same_network(this.device, device_id as u32);
- match device {
- Some(device) => {
- let lt = lt.as_logic_type(this, inst, 2)?;
- let val = val.as_value(this, inst, 3)?;
- device.borrow_mut().set_field(lt, val, vm, false)?;
- vm.set_modified(device_id as u32);
- Ok(())
- }
- None => Err(UnknownDeviceID(device_id)),
- }
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Ss => match &operands[..] {
- [dev, index, slt, val] => {
- let (Some(device_id), _connection) = dev.as_device(this, inst, 1)? else {
- return Err(DeviceNotSet);
- };
- let device = vm.get_device_same_network(this.device, device_id);
- match device {
- Some(device) => {
- let index = index.as_value(this, inst, 2)?;
- let slt = slt.as_slot_logic_type(this, inst, 3)?;
- let val = val.as_value(this, inst, 4)?;
- device
- .borrow_mut()
- .set_slot_field(index, slt, val, vm, false)?;
- vm.set_modified(device_id);
- Ok(())
- }
- None => Err(UnknownDeviceID(device_id as f64)),
- }
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 4)),
- },
- Sb => match &operands[..] {
- [prefab, lt, val] => {
- let prefab = prefab.as_value(this, inst, 1)?;
- let lt = lt.as_logic_type(this, inst, 2)?;
- let val = val.as_value(this, inst, 3)?;
- vm.set_batch_device_field(this.device, prefab, lt, val, false)?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Sbs => match &operands[..] {
- [prefab, index, slt, val] => {
- let prefab = prefab.as_value(this, inst, 1)?;
- let index = index.as_value(this, inst, 2)?;
- let slt = slt.as_slot_logic_type(this, inst, 3)?;
- let val = val.as_value(this, inst, 4)?;
- vm.set_batch_device_slot_field(
- this.device,
- prefab,
- index,
- slt,
- val,
- false,
- )?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 4)),
- },
- Sbn => match &operands[..] {
- [prefab, name, lt, val] => {
- let prefab = prefab.as_value(this, inst, 1)?;
- let name = name.as_value(this, inst, 2)?;
- let lt = lt.as_logic_type(this, inst, 3)?;
- let val = val.as_value(this, inst, 4)?;
- vm.set_batch_name_device_field(this.device, prefab, name, lt, val, false)?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 4)),
- },
-
- L => match &operands[..] {
- [reg, dev, lt] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let (Some(device_id), connection) = dev.as_device(this, inst, 2)? else {
- return Err(DeviceNotSet);
- };
- let lt = lt.as_logic_type(this, inst, 3)?;
- if CHANNEL_LOGIC_TYPES.contains(<) {
- let channel = lt.as_channel().unwrap();
- let Some(connection) = connection else {
- return Err(MissingConnectionSpecifier);
- };
- let network_id = vm
- .get_device_same_network(this.device, device_id)
- .map(|device| device.borrow().get_network_id(connection))
- .unwrap_or(Err(UnknownDeviceID(device_id as f64)))?;
- let val = vm.get_network_channel(network_id, channel)?;
- this.set_register(indirection, target, val)?;
- return Ok(());
- }
- if lt == LogicType::LineNumber && this.device == device_id {
- // HACK: we can't use device.get_field as that will try to reborrow our
- // ic which will panic
- this.set_register(indirection, target, this.ip() as f64)?;
- Ok(())
- } else {
- let device = vm.get_device_same_network(this.device, device_id);
- match device {
- Some(device) => {
- let val = device.borrow().get_field(lt, vm)?;
- this.set_register(indirection, target, val)?;
- Ok(())
- }
- None => Err(UnknownDeviceID(device_id as f64)),
- }
- }
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Ld => match &operands[..] {
- [reg, dev, lt] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let device_id = dev.as_value(this, inst, 2)?;
- if device_id >= u16::MAX as f64 || device_id < u16::MIN as f64 {
- return Err(DeviceIndexOutOfRange(device_id));
- }
- let lt = lt.as_logic_type(this, inst, 3)?;
- if lt == LogicType::LineNumber && this.device == device_id as u32 {
- // HACK: we can't use device.get_field as that will try to reborrow our
- // ic which will panic
- this.set_register(indirection, target, this.ip() as f64)?;
- Ok(())
- } else {
- let device = vm.get_device_same_network(this.device, device_id as u32);
- match device {
- Some(device) => {
- let val = device.borrow().get_field(lt, vm)?;
- this.set_register(indirection, target, val)?;
- Ok(())
- }
- None => Err(UnknownDeviceID(device_id)),
- }
- }
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 3)),
- },
- Ls => match &operands[..] {
- [reg, dev, index, slt] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let (Some(device_id), _connection) = dev.as_device(this, inst, 2)? else {
- return Err(DeviceNotSet);
- };
- let slt = slt.as_slot_logic_type(this, inst, 4)?;
- if slt == SlotLogicType::LineNumber && this.device == device_id {
- // HACK: we can't use device.get_slot_field as that will try to reborrow our
- // ic which will panic
- this.set_register(indirection, target, this.ip() as f64)?;
- Ok(())
- } else {
- let device = vm.get_device_same_network(this.device, device_id);
- match device {
- Some(device) => {
- let index = index.as_value(this, inst, 3)?;
- let val = device.borrow().get_slot_field(index, slt, vm)?;
- this.set_register(indirection, target, val)?;
- Ok(())
- }
- None => Err(UnknownDeviceID(device_id as f64)),
- }
- }
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 4)),
- },
- Lr => match &operands[..] {
- [reg, dev, rm, name] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let (Some(device_id), _connection) = dev.as_device(this, inst, 2)? else {
- return Err(DeviceNotSet);
- };
- let device = vm.get_device_same_network(this.device, device_id);
- match device {
- Some(device) => {
- let rm = rm.as_reagent_mode(this, inst, 3)?;
- let name = name.as_value(this, inst, 4)?;
- let val = device.borrow().get_reagent(&rm, name);
- this.set_register(indirection, target, val)?;
- Ok(())
- }
- None => Err(UnknownDeviceID(device_id as f64)),
- }
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 4)),
- },
- Lb => match &operands[..] {
- [reg, prefab, lt, bm] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let prefab = prefab.as_value(this, inst, 2)?;
- let lt = lt.as_logic_type(this, inst, 3)?;
- let bm = bm.as_batch_mode(this, inst, 4)?;
- let val = vm.get_batch_device_field(this.device, prefab, lt, bm)?;
- this.set_register(indirection, target, val)?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 4)),
- },
- Lbn => match &operands[..] {
- [reg, prefab, name, lt, bm] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let prefab = prefab.as_value(this, inst, 2)?;
- let name = name.as_value(this, inst, 3)?;
- let lt = lt.as_logic_type(this, inst, 4)?;
- let bm = bm.as_batch_mode(this, inst, 5)?;
- let val =
- vm.get_batch_name_device_field(this.device, prefab, name, lt, bm)?;
- this.set_register(indirection, target, val)?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 5)),
- },
- Lbns => match &operands[..] {
- [reg, prefab, name, index, slt, bm] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let prefab = prefab.as_value(this, inst, 2)?;
- let name = name.as_value(this, inst, 3)?;
- let index = index.as_value(this, inst, 4)?;
- let slt = slt.as_slot_logic_type(this, inst, 5)?;
- let bm = bm.as_batch_mode(this, inst, 6)?;
- let val = vm.get_batch_name_device_slot_field(
- this.device,
- prefab,
- name,
- index,
- slt,
- bm,
- )?;
- this.set_register(indirection, target, val)?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 6)),
- },
- Lbs => match &operands[..] {
- [reg, prefab, index, slt, bm] => {
- let RegisterSpec {
- indirection,
- target,
- } = reg.as_register(this, inst, 1)?;
- let prefab = prefab.as_value(this, inst, 2)?;
- let index = index.as_value(this, inst, 3)?;
- let slt = slt.as_slot_logic_type(this, inst, 4)?;
- let bm = bm.as_batch_mode(this, inst, 5)?;
- let val =
- vm.get_batch_device_slot_field(this.device, prefab, index, slt, bm)?;
- this.set_register(indirection, target, val)?;
- Ok(())
- }
- oprs => Err(ICError::mismatch_operands(oprs.len(), 5)),
- },
- }
- };
- let result = process_op(self);
- if result.is_ok() || advance_ip_on_err {
- self.ic.set(self.ic.get() + 1);
- self.set_ip(next_ip);
- self.propgate_line_number(vm);
- }
- result
- }
-}
-
-#[allow(dead_code)]
-const CHANNEL_LOGIC_TYPES: [grammar::LogicType; 8] = [
- grammar::LogicType::Channel0,
- grammar::LogicType::Channel1,
- grammar::LogicType::Channel2,
- grammar::LogicType::Channel3,
- grammar::LogicType::Channel4,
- grammar::LogicType::Channel5,
- grammar::LogicType::Channel6,
- grammar::LogicType::Channel7,
-];
-
-trait LogicTypeExt {
- fn as_channel(&self) -> Option;
-}
-impl LogicTypeExt for grammar::LogicType {
- fn as_channel(&self) -> Option {
- match self {
- grammar::LogicType::Channel0 => Some(0),
- grammar::LogicType::Channel1 => Some(1),
- grammar::LogicType::Channel2 => Some(2),
- grammar::LogicType::Channel3 => Some(3),
- grammar::LogicType::Channel4 => Some(4),
- grammar::LogicType::Channel5 => Some(5),
- grammar::LogicType::Channel6 => Some(6),
- grammar::LogicType::Channel7 => Some(7),
- _ => None,
- }
- }
-}
-
pub fn f64_to_i64(f: f64, signed: bool) -> i64 {
let mut num: i64 = (f % (1i64 << 53) as f64) as i64;
if !signed {
@@ -2626,48 +226,103 @@ pub fn i64_to_f64(i: i64) -> f64 {
#[cfg(test)]
mod tests {
- use crate::vm::VMError;
+ use std::rc::Rc;
- use super::*;
+ use stationeers_data::enums::prefabs::StationpediaPrefab;
+
+ use crate::vm::{
+ object::{
+ templates::{FrozenObject, ObjectInfo, Prefab},
+ ObjectID,
+ },
+ VM,
+ };
+
+ static INIT: std::sync::Once = std::sync::Once::new();
+
+ fn setup() -> color_eyre::Result<(Rc, ObjectID, ObjectID)> {
+ INIT.call_once(|| {
+ let _ = color_eyre::install();
+ });
+
+ println!("building VM");
+ let vm = VM::new();
+
+ println!("VM built");
+
+ let frozen_ic = FrozenObject {
+ obj_info: ObjectInfo::with_prefab(Prefab::Name(
+ StationpediaPrefab::ItemIntegratedCircuit10.to_string(),
+ )),
+ database_template: true,
+ template: None,
+ };
+
+ println!("Adding IC");
+ let ic = vm.add_object_frozen(frozen_ic)?;
+ let frozen_circuit_holder = FrozenObject {
+ obj_info: ObjectInfo::with_prefab(Prefab::Name(
+ StationpediaPrefab::StructureCircuitHousing.to_string(),
+ )),
+ database_template: true,
+ template: None,
+ };
+ println!("Adding circuit holder");
+ let ch = vm.add_object_frozen(frozen_circuit_holder)?;
+ println!("socketing ic into circuit holder");
+ vm.set_slot_occupant(ch, 0, Some(ic), 1)?;
+ Ok((vm, ch, ic))
+ }
#[test]
- fn batch_modes() -> Result<(), VMError> {
- let mut vm = VM::new();
- let ic = vm.add_ic(None).unwrap();
- let ic_id = {
- let device = vm.devices.get(&ic).unwrap();
- let device_ref = device.borrow();
- device_ref.ic.unwrap()
- };
- let ic_chip = vm.ics.get(&ic_id).unwrap().borrow();
+ fn batch_modes() -> color_eyre::Result<()> {
+ let (vm, ch, ic) = setup()?;
+ eprintln!("Beginning batch mode test");
+ let ic_chip = vm.get_object(ic).unwrap();
+ let circuit_holder = vm.get_object(ch).unwrap();
+ eprintln!("IC Chip: {ic_chip:?}");
+ eprintln!("Circuit Holder: {circuit_holder:?}");
vm.set_code(
ic,
r#"lb r0 HASH("ItemActiveVent") On Sum
lb r1 HASH("ItemActiveVent") On Maximum
lb r2 HASH("ItemActiveVent") On Minimum"#,
)?;
- vm.step_ic(ic, false)?;
- let r0 = ic_chip.get_register(0, 0).unwrap();
+ vm.step_programmable(ic, false)?;
+ let r0 = ic_chip
+ .borrow()
+ .as_integrated_circuit()
+ .unwrap()
+ .get_register(0, 0)
+ .unwrap();
assert_eq!(r0, 0.0);
- vm.step_ic(ic, false)?;
- let r1 = ic_chip.get_register(0, 1).unwrap();
+ vm.step_programmable(ic, false)?;
+ let r1 = ic_chip
+ .borrow()
+ .as_integrated_circuit()
+ .unwrap()
+ .get_register(0, 1)
+ .unwrap();
assert_eq!(r1, f64::NEG_INFINITY);
- vm.step_ic(ic, false)?;
- let r2 = ic_chip.get_register(0, 2).unwrap();
+ vm.step_programmable(ic, false)?;
+ let r2 = ic_chip
+ .borrow()
+ .as_integrated_circuit()
+ .unwrap()
+ .get_register(0, 2)
+ .unwrap();
assert_eq!(r2, f64::INFINITY);
Ok(())
}
#[test]
- fn stack() -> Result<(), VMError> {
- let mut vm = VM::new();
- let ic = vm.add_ic(None).unwrap();
- let ic_id = {
- let device = vm.devices.get(&ic).unwrap();
- let device_ref = device.borrow();
- device_ref.ic.unwrap()
- };
- let ic_chip = vm.ics.get(&ic_id).unwrap().borrow();
+ fn stack() -> color_eyre::Result<()> {
+ let (vm, ch, ic) = setup()?;
+ eprintln!("Beginning stack test");
+ let ic_chip = vm.get_object(ic).unwrap();
+ let circuit_holder = vm.get_object(ch).unwrap();
+ eprintln!("IC Chip: {ic_chip:?}");
+ eprintln!("Circuit Holder: {circuit_holder:?}");
vm.set_code(
ic,
r#"push 100
@@ -2679,26 +334,57 @@ mod tests {
pop r2
"#,
)?;
- vm.step_ic(ic, false)?;
- let stack0 = ic_chip.peek_addr(0.0)?;
+ vm.step_programmable(ic, false)?;
+ let stack0 = ic_chip
+ .borrow()
+ .as_integrated_circuit()
+ .unwrap()
+ .get_stack(0.0)?;
assert_eq!(stack0, 100.0);
- vm.step_ic(ic, false)?;
- let stack1 = ic_chip.peek_addr(1.0)?;
+ vm.step_programmable(ic, false)?;
+ let stack1 = ic_chip
+ .borrow()
+ .as_integrated_circuit()
+ .unwrap()
+ .get_stack(1.0)?;
assert_eq!(stack1, 10.0);
- vm.step_ic(ic, false)?;
- let r0 = ic_chip.get_register(0, 0).unwrap();
+ vm.step_programmable(ic, false)?;
+ let r0 = ic_chip
+ .borrow()
+ .as_integrated_circuit()
+ .unwrap()
+ .get_register(0, 0)
+ .unwrap();
assert_eq!(r0, 10.0);
- vm.step_ic(ic, false)?;
- let stack1 = ic_chip.peek_addr(1.0)?;
+ vm.step_programmable(ic, false)?;
+ let stack1 = ic_chip
+ .borrow()
+ .as_integrated_circuit()
+ .unwrap()
+ .get_stack(1.0)?;
assert_eq!(stack1, 1000.0);
- vm.step_ic(ic, false)?;
- let r1 = ic_chip.get_register(0, 1).unwrap();
+ vm.step_programmable(ch, false)?;
+ let r1 = ic_chip
+ .borrow()
+ .as_integrated_circuit()
+ .unwrap()
+ .get_register(0, 1)
+ .unwrap();
assert_eq!(r1, 1000.0);
- vm.step_ic(ic, false)?;
- let stack1 = ic_chip.peek_addr(1.0)?;
+ vm.step_programmable(ch, false)?;
+ let stack1 = ic_chip
+ .borrow()
+ .as_integrated_circuit()
+ .unwrap()
+ .get_stack(1.0)?;
assert_eq!(stack1, 20.0);
- vm.step_ic(ic, false)?;
- let r2 = ic_chip.get_register(0, 2).unwrap();
+ vm.step_programmable(ch, false)?;
+ let r2 = ic_chip
+ .borrow()
+ .as_integrated_circuit()
+ .unwrap()
+ .get_register(0, 2)
+ .unwrap();
assert_eq!(r2, 20.0);
Ok(())
}
diff --git a/ic10emu/src/interpreter/instructions.rs b/ic10emu/src/interpreter/instructions.rs
new file mode 100644
index 0000000..6322378
--- /dev/null
+++ b/ic10emu/src/interpreter/instructions.rs
@@ -0,0 +1,2756 @@
+use crate::{
+ errors::ICError,
+ interpreter::{i64_to_f64, ICState},
+ vm::{
+ instructions::{
+ operands::{InstOperand, RegisterSpec},
+ traits::*,
+ },
+ object::{
+ errors::{LogicError, MemoryError},
+ traits::*,
+ ObjectID,
+ },
+ },
+};
+use stationeers_data::enums::script::LogicReagentMode;
+pub trait IC10Marker: IntegratedCircuit {}
+
+impl SleepInstruction for T {
+ /// sleep a(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let now =
+ time::OffsetDateTime::now_local().unwrap_or_else(|_| time::OffsetDateTime::now_utc());
+ self.set_state(ICState::Sleep(now, a));
+ Ok(())
+ }
+}
+
+impl YieldInstruction for T {
+ /// yield
+ fn execute_inner(&mut self) -> Result<(), ICError> {
+ self.set_state(ICState::Yield);
+ Ok(())
+ }
+}
+
+impl DefineInstruction for T {
+ /// define str num
+ fn execute_inner(&mut self, string: &InstOperand, num: &InstOperand) -> Result<(), ICError> {
+ let ident = string.as_ident()?;
+ let num = num.as_number()?;
+ if self.get_defines().contains_key(&ident.name) {
+ Err(ICError::DuplicateDefine(ident.name.clone()))
+ } else {
+ self.get_defines_mut()
+ .insert(ident.name.clone(), num.value());
+ Ok(())
+ }
+ }
+}
+
+impl AliasInstruction for T {
+ /// alias str r?|d?
+ fn execute_inner(&mut self, string: &InstOperand, r: &InstOperand) -> Result<(), ICError> {
+ let ident = string.as_ident()?;
+ let alias = r.as_aliasable()?;
+ self.get_aliases_mut().insert(ident.name.clone(), alias);
+ Ok(())
+ }
+}
+
+impl MoveInstruction for T {
+ /// move r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+
+ let val = a.as_value(self)?;
+ self.set_register(indirection, target, val)?;
+ Ok(())
+ }
+}
+
+impl BeqInstruction for T {
+ /// beq a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a == b {
+ self.set_next_instruction(c);
+ }
+ Ok(())
+ }
+}
+impl BeqalInstruction for T {
+ /// beqal a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a == b {
+ self.set_next_instruction(c);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BreqInstruction for T {
+ /// breq a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a == b {
+ self.set_next_instruction_relative(c);
+ }
+ Ok(())
+ }
+}
+
+impl BeqzInstruction for T {
+ /// beqz a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a == 0.0 {
+ self.set_next_instruction(b)
+ }
+ Ok(())
+ }
+}
+
+impl BeqzalInstruction for T {
+ /// beqzal a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a == 0.0 {
+ self.set_next_instruction(b);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BreqzInstruction for T {
+ /// breqz a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a == 0.0 {
+ self.set_next_instruction_relative(b);
+ }
+ Ok(())
+ }
+}
+
+impl BneInstruction for T {
+ /// bne a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a != b {
+ self.set_next_instruction(c);
+ }
+ Ok(())
+ }
+}
+
+impl BnealInstruction for T {
+ /// bneal a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a != b {
+ self.set_next_instruction(c);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BrneInstruction for T {
+ /// brne a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a != b {
+ self.set_next_instruction_relative(c);
+ }
+ Ok(())
+ }
+}
+
+impl BnezInstruction for T {
+ /// bnez a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a != 0.0 {
+ self.set_next_instruction(b)
+ }
+ Ok(())
+ }
+}
+
+impl BnezalInstruction for T {
+ /// bnezal a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a != 0.0 {
+ self.set_next_instruction(b);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BrnezInstruction for T {
+ /// brnez a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a != 0.0 {
+ self.set_next_instruction_relative(b)
+ }
+ Ok(())
+ }
+}
+
+impl BltInstruction for T {
+ /// blt a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a < b {
+ self.set_next_instruction(c);
+ }
+ Ok(())
+ }
+}
+
+impl BltalInstruction for T {
+ /// bltal a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a < b {
+ self.set_next_instruction(c);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BrltInstruction for T {
+ /// brlt a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a < b {
+ self.set_next_instruction_relative(c);
+ }
+ Ok(())
+ }
+}
+
+impl BltzInstruction for T {
+ /// bltz a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a < 0.0 {
+ self.set_next_instruction(b);
+ }
+ Ok(())
+ }
+}
+
+impl BltzalInstruction for T {
+ /// bltzal a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a < 0.0 {
+ self.set_next_instruction(b);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BrltzInstruction for T {
+ /// brltz a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a < 0.0 {
+ self.set_next_instruction_relative(b);
+ }
+ Ok(())
+ }
+}
+
+impl BleInstruction for T {
+ /// ble a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a <= b {
+ self.set_next_instruction(c);
+ }
+ Ok(())
+ }
+}
+impl BlealInstruction for T {
+ /// bleal a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a <= b {
+ self.set_next_instruction(c);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BrleInstruction for T {
+ /// brle a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a <= b {
+ self.set_next_instruction_relative(c);
+ }
+ Ok(())
+ }
+}
+
+impl BlezInstruction for T {
+ /// blez a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a <= 0.0 {
+ self.set_next_instruction(b);
+ }
+ Ok(())
+ }
+}
+
+impl BlezalInstruction for T {
+ /// blezal a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a <= 0.0 {
+ self.set_next_instruction(b);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BrlezInstruction for T {
+ /// brlez a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a <= 0.0 {
+ self.set_next_instruction_relative(b);
+ }
+ Ok(())
+ }
+}
+
+impl BgtInstruction for T {
+ /// bgt a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a > b {
+ self.set_next_instruction(c);
+ }
+ Ok(())
+ }
+}
+impl BgtalInstruction for T {
+ /// bgtal a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a > b {
+ self.set_next_instruction(c);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BrgtInstruction for T {
+ /// brgt a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a > b {
+ self.set_next_instruction_relative(c);
+ }
+ Ok(())
+ }
+}
+
+impl BgtzInstruction for T {
+ /// bgtz a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a > 0.0 {
+ self.set_next_instruction(b);
+ }
+ Ok(())
+ }
+}
+
+impl BgtzalInstruction for T {
+ /// bgtzal a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a > 0.0 {
+ self.set_next_instruction(b);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BrgtzInstruction for T {
+ /// brgtz a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a > 0.0 {
+ self.set_next_instruction_relative(b);
+ }
+ Ok(())
+ }
+}
+
+impl BgeInstruction for T {
+ /// bge a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a >= b {
+ self.set_next_instruction(c);
+ }
+ Ok(())
+ }
+}
+
+impl BgealInstruction for T {
+ /// bgeal a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a >= b {
+ self.set_next_instruction(c);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BrgeInstruction for T {
+ /// brge a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a >= b {
+ self.set_next_instruction_relative(c);
+ }
+ Ok(())
+ }
+}
+
+impl BgezInstruction for T {
+ /// bgez a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a >= 0.0 {
+ self.set_next_instruction(b);
+ }
+ Ok(())
+ }
+}
+
+impl BgezalInstruction for T {
+ /// bgezal a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a >= 0.0 {
+ self.set_next_instruction(b);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BrgezInstruction for T {
+ /// brgez a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a >= 0.0 {
+ self.set_next_instruction_relative(b);
+ }
+ Ok(())
+ }
+}
+
+impl BapInstruction for T {
+ /// bap a(r?|num) b(r?|num) c(r?|num) d(r?|num)
+ fn execute_inner(
+ &mut self,
+
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ d: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ let d = d.as_value(self)?;
+ if f64::abs(a - b) <= f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0) {
+ self.set_next_instruction(d);
+ }
+ Ok(())
+ }
+}
+
+impl BapalInstruction for T {
+ /// bapal a(r?|num) b(r?|num) c(r?|num) d(r?|num)
+ fn execute_inner(
+ &mut self,
+
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ d: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ let d = d.as_value(self)?;
+ if f64::abs(a - b) <= f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0) {
+ self.set_next_instruction(d);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BrapInstruction for T {
+ /// brap a(r?|num) b(r?|num) c(r?|num) d(r?|num)
+ fn execute_inner(
+ &mut self,
+
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ d: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ let d = d.as_value(self)?;
+ if f64::abs(a - b) <= f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0) {
+ self.set_next_instruction_relative(d);
+ }
+ Ok(())
+ }
+}
+
+impl BapzInstruction for T {
+ /// bapz a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a.abs() <= f64::max(b * a.abs(), f64::EPSILON * 8.0) {
+ } else {
+ self.set_next_instruction(c);
+ }
+ Ok(())
+ }
+}
+
+impl BapzalInstruction for T {
+ /// bapzal a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a.abs() <= f64::max(b * a.abs(), f64::EPSILON * 8.0) {
+ } else {
+ self.set_next_instruction(c);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BrapzInstruction for T {
+ /// brapz a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a.abs() <= f64::max(b * a.abs(), f64::EPSILON * 8.0) {
+ } else {
+ self.set_next_instruction_relative(c);
+ }
+ Ok(())
+ }
+}
+
+impl BnaInstruction for T {
+ /// bna a(r?|num) b(r?|num) c(r?|num) d(r?|num)
+ fn execute_inner(
+ &mut self,
+
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ d: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ let d = d.as_value(self)?;
+ if f64::abs(a - b) > f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0) {
+ self.set_next_instruction(d);
+ }
+ Ok(())
+ }
+}
+impl BnaalInstruction for T {
+ /// bnaal a(r?|num) b(r?|num) c(r?|num) d(r?|num)
+ fn execute_inner(
+ &mut self,
+
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ d: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ let d = d.as_value(self)?;
+ if f64::abs(a - b) > f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0) {
+ self.set_next_instruction(d);
+ self.al();
+ }
+ Ok(())
+ }
+}
+impl BrnaInstruction for T {
+ /// brna a(r?|num) b(r?|num) c(r?|num) d(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ d: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ let d = d.as_value(self)?;
+ if f64::abs(a - b) > f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0) {
+ self.set_next_instruction_relative(d);
+ }
+ Ok(())
+ }
+}
+
+impl BnazInstruction for T {
+ /// bnaz a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a.abs() > f64::max(b * a.abs(), f64::EPSILON * 8.0) {
+ self.set_next_instruction(c);
+ }
+ Ok(())
+ }
+}
+impl BnazalInstruction for T {
+ /// bnazal a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a.abs() > f64::max(b * a.abs(), f64::EPSILON * 8.0) {
+ self.set_next_instruction(c);
+ self.al();
+ }
+ Ok(())
+ }
+}
+impl BrnazInstruction for T {
+ /// brnaz a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ if a.abs() > f64::max(b * a.abs(), f64::EPSILON * 8.0) {
+ self.set_next_instruction_relative(c);
+ }
+ Ok(())
+ }
+}
+impl BdseInstruction for T {
+ /// bdse d? a(r?|num)
+ fn execute_inner(&mut self, d: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let (device, connection) = d.as_device(self)?;
+ let a = a.as_value(self)?;
+ if self
+ .get_circuit_holder()
+ .ok_or(ICError::NoCircuitHolder(*self.get_id()))?
+ .borrow()
+ .as_circuit_holder()
+ .ok_or(ICError::CircuitHolderNotLogicable(*self.get_id()))?
+ .get_logicable_from_index(device, connection)
+ .is_some()
+ {
+ self.set_next_instruction(a);
+ }
+ Ok(())
+ }
+}
+
+impl BdsealInstruction for T {
+ /// bdseal d? a(r?|num)
+ fn execute_inner(&mut self, d: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let (device, connection) = d.as_device(self)?;
+ let a = a.as_value(self)?;
+ if self
+ .get_circuit_holder()
+ .ok_or(ICError::NoCircuitHolder(*self.get_id()))?
+ .borrow()
+ .as_circuit_holder()
+ .ok_or(ICError::CircuitHolderNotLogicable(*self.get_id()))?
+ .get_logicable_from_index(device, connection)
+ .is_some()
+ {
+ self.set_next_instruction(a);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BrdseInstruction for T {
+ /// brdse d? a(r?|num)
+ fn execute_inner(&mut self, d: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let (device, connection) = d.as_device(self)?;
+ let a = a.as_value(self)?;
+ if self
+ .get_circuit_holder()
+ .ok_or(ICError::NoCircuitHolder(*self.get_id()))?
+ .borrow()
+ .as_circuit_holder()
+ .ok_or(ICError::CircuitHolderNotLogicable(*self.get_id()))?
+ .get_logicable_from_index(device, connection)
+ .is_some()
+ {
+ self.set_next_instruction_relative(a);
+ }
+ Ok(())
+ }
+}
+
+impl BdnsInstruction for T {
+ /// bdns d? a(r?|num)
+ fn execute_inner(&mut self, d: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let (device, connection) = d.as_device(self)?;
+ let a = a.as_value(self)?;
+ if self
+ .get_circuit_holder()
+ .ok_or(ICError::NoCircuitHolder(*self.get_id()))?
+ .borrow()
+ .as_circuit_holder()
+ .ok_or(ICError::CircuitHolderNotLogicable(*self.get_id()))?
+ .get_logicable_from_index(device, connection)
+ .is_none()
+ {
+ self.set_next_instruction(a);
+ }
+ Ok(())
+ }
+}
+
+impl BdnsalInstruction for T {
+ /// bdnsal d? a(r?|num)
+ fn execute_inner(&mut self, d: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let (device, connection) = d.as_device(self)?;
+ let a = a.as_value(self)?;
+ if self
+ .get_circuit_holder()
+ .ok_or(ICError::NoCircuitHolder(*self.get_id()))?
+ .borrow()
+ .as_circuit_holder()
+ .ok_or(ICError::CircuitHolderNotLogicable(*self.get_id()))?
+ .get_logicable_from_index(device, connection)
+ .is_none()
+ {
+ self.set_next_instruction(a);
+ self.al();
+ }
+ Ok(())
+ }
+}
+
+impl BrdnsInstruction for T {
+ /// brdns d? a(r?|num)
+ fn execute_inner(&mut self, d: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let (device, connection) = d.as_device(self)?;
+ let a = a.as_value(self)?;
+ if self
+ .get_circuit_holder()
+ .ok_or(ICError::NoCircuitHolder(*self.get_id()))?
+ .borrow()
+ .as_circuit_holder()
+ .ok_or(ICError::CircuitHolderNotLogicable(*self.get_id()))?
+ .get_logicable_from_index(device, connection)
+ .is_none()
+ {
+ self.set_next_instruction_relative(a);
+ }
+ Ok(())
+ }
+}
+
+impl BnanInstruction for T {
+ /// bnan a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a.is_nan() {
+ self.set_next_instruction(b);
+ }
+ Ok(())
+ }
+}
+
+impl BrnanInstruction for T {
+ /// brnan a(r?|num) b(r?|num)
+ fn execute_inner(&mut self, a: &InstOperand, b: &InstOperand) -> Result<(), ICError> {
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ if a.is_nan() {
+ self.set_next_instruction_relative(b);
+ }
+ Ok(())
+ }
+}
+
+impl JInstruction for T {
+ /// j int
+ fn execute_inner(&mut self, int: &InstOperand) -> Result<(), ICError> {
+ let int = int.as_value(self)?;
+ self.set_next_instruction(int);
+ Ok(())
+ }
+}
+impl JalInstruction for T {
+ /// jal int
+ fn execute_inner(&mut self, int: &InstOperand) -> Result<(), ICError> {
+ let int = int.as_value(self)?;
+ self.set_next_instruction(int);
+ self.al();
+ Ok(())
+ }
+}
+impl JrInstruction for T {
+ /// jr int
+ fn execute_inner(&mut self, int: &InstOperand) -> Result<(), ICError> {
+ let int = int.as_value(self)?;
+ self.set_next_instruction_relative(int);
+ Ok(())
+ }
+}
+impl SeqInstruction for T {
+ /// seq r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(indirection, target, if a == b { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+
+impl SeqzInstruction for T {
+ /// seqz r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, if a == 0.0 { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+
+impl SneInstruction for T {
+ /// sne r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(indirection, target, if a != b { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+
+impl SnezInstruction for T {
+ /// snez r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, if a != 0.0 { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+
+impl SltInstruction for T {
+ /// slt r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(indirection, target, if a < b { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+
+impl SltzInstruction for T {
+ /// sltz r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, if a < 0.0 { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+
+impl SleInstruction for T {
+ /// sle r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(indirection, target, if a <= b { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+impl SlezInstruction for T {
+ /// slez r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, if a <= 0.0 { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+
+impl SgtInstruction for T {
+ /// sgt r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(indirection, target, if a > b { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+
+impl SgtzInstruction for T {
+ /// sgtz r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, if a > 0.0 { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+
+impl SgeInstruction for T {
+ /// sge r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(indirection, target, if a >= b { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+
+impl SgezInstruction for T {
+ /// sgez r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, if a >= 0.0 { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+
+impl SapInstruction for T {
+ /// sap r? a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ self.set_register(
+ indirection,
+ target,
+ if f64::abs(a - b) <= f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0) {
+ 1.0
+ } else {
+ 0.0
+ },
+ )?;
+ Ok(())
+ }
+}
+
+impl SapzInstruction for T {
+ /// sapz r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(
+ indirection,
+ target,
+ if a.abs() <= f64::max(b * a.abs(), f64::EPSILON * 8.0) {
+ 1.0
+ } else {
+ 0.0
+ },
+ )?;
+ Ok(())
+ }
+}
+
+impl SnaInstruction for T {
+ /// sna r? a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ self.set_register(
+ indirection,
+ target,
+ if f64::abs(a - b) > f64::max(c * f64::max(a.abs(), b.abs()), f64::EPSILON * 8.0) {
+ 1.0
+ } else {
+ 0.0
+ },
+ )?;
+ Ok(())
+ }
+}
+
+impl SnazInstruction for T {
+ /// snaz r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(
+ indirection,
+ target,
+ if a.abs() > f64::max(b * a.abs(), f64::EPSILON * 8.0) {
+ 1.0
+ } else {
+ 0.0
+ },
+ )?;
+ Ok(())
+ }
+}
+
+impl SdseInstruction for T {
+ /// sdse r? d?
+ fn execute_inner(&mut self, r: &InstOperand, d: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let (device, connection) = d.as_device(self)?;
+ let is_some = {
+ self.get_circuit_holder()
+ .ok_or(ICError::NoCircuitHolder(*self.get_id()))?
+ .borrow()
+ .as_circuit_holder()
+ .ok_or(ICError::CircuitHolderNotLogicable(*self.get_id()))?
+ .get_logicable_from_index(device, connection)
+ .is_some()
+ };
+ self.set_register(indirection, target, if is_some { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+impl SdnsInstruction for T {
+ /// sdns r? d?
+ fn execute_inner(&mut self, r: &InstOperand, d: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let (device, connection) = d.as_device(self)?;
+ let is_none = {
+ self.get_circuit_holder()
+ .ok_or(ICError::NoCircuitHolder(*self.get_id()))?
+ .borrow()
+ .as_circuit_holder()
+ .ok_or(ICError::CircuitHolderNotLogicable(*self.get_id()))?
+ .get_logicable_from_index(device, connection)
+ .is_none()
+ };
+ self.set_register(indirection, target, if is_none { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+
+impl SnanInstruction for T {
+ /// snan r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, if a.is_nan() { 1.0 } else { 0.0 })?;
+ Ok(())
+ }
+}
+
+impl SnanzInstruction for T {
+ /// snanz r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, if a.is_nan() { 0.0 } else { 1.0 })?;
+ Ok(())
+ }
+}
+
+impl SelectInstruction for T {
+ /// select r? a(r?|num) b(r?|num) c(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ c: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let c = c.as_value(self)?;
+ self.set_register(indirection, target, if a != 0.0 { b } else { c })?;
+ Ok(())
+ }
+}
+
+impl AddInstruction for T {
+ /// add r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(indirection, target, a + b)?;
+ Ok(())
+ }
+}
+
+impl SubInstruction for T {
+ /// sub r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(indirection, target, a - b)?;
+ Ok(())
+ }
+}
+impl MulInstruction for T {
+ /// mul r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(indirection, target, a * b)?;
+ Ok(())
+ }
+}
+impl DivInstruction for T {
+ /// div r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(indirection, target, a / b)?;
+ Ok(())
+ }
+}
+
+impl ModInstruction for T {
+ /// mod r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ let mut m = a % b;
+ if m < 0.0 {
+ m += b;
+ }
+ self.set_register(indirection, target, m)?;
+ Ok(())
+ }
+}
+
+impl ExpInstruction for T {
+ /// exp r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, f64::exp(a))?;
+ Ok(())
+ }
+}
+
+impl LogInstruction for T {
+ /// log r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, f64::ln(a))?;
+ Ok(())
+ }
+}
+
+impl SqrtInstruction for T {
+ /// sqrt r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, f64::sqrt(a))?;
+ Ok(())
+ }
+}
+
+impl MaxInstruction for T {
+ /// max r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(indirection, target, f64::max(a, b))?;
+ Ok(())
+ }
+}
+
+impl MinInstruction for T {
+ /// min r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(indirection, target, f64::min(a, b))?;
+ Ok(())
+ }
+}
+impl CeilInstruction for T {
+ /// ceil r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, f64::ceil(a))?;
+ Ok(())
+ }
+}
+
+impl FloorInstruction for T {
+ /// floor r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, f64::floor(a))?;
+ Ok(())
+ }
+}
+
+impl AbsInstruction for T {
+ /// abs r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, f64::abs(a))?;
+ Ok(())
+ }
+}
+
+impl RoundInstruction for T {
+ /// round r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, f64::round(a))?;
+ Ok(())
+ }
+}
+
+impl TruncInstruction for T {
+ /// trunc r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, f64::trunc(a))?;
+ Ok(())
+ }
+}
+
+impl RandInstruction for T {
+ /// rand r?
+ fn execute_inner(&mut self, r: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let val = self.get_vm().random_f64();
+ self.set_register(indirection, target, val)?;
+ Ok(())
+ }
+}
+impl SinInstruction for T {
+ /// sin r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, f64::sin(a))?;
+ Ok(())
+ }
+}
+impl CosInstruction for T {
+ /// cos r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, f64::cos(a))?;
+ Ok(())
+ }
+}
+impl TanInstruction for T {
+ /// tan r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, f64::tan(a))?;
+ Ok(())
+ }
+}
+impl AsinInstruction for T {
+ /// asin r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, f64::asin(a))?;
+ Ok(())
+ }
+}
+impl AcosInstruction for T {
+ /// acos r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, f64::acos(a))?;
+ Ok(())
+ }
+}
+impl AtanInstruction for T {
+ /// atan r? a(r?|num)
+ fn execute_inner(&mut self, r: &InstOperand, a: &InstOperand) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ self.set_register(indirection, target, f64::atan(a))?;
+ Ok(())
+ }
+}
+impl Atan2Instruction for T {
+ /// atan2 r? a(r?|num) b(r?|num)
+ fn execute_inner(
+ &mut self,
+
+ r: &InstOperand,
+ a: &InstOperand,
+ b: &InstOperand,
+ ) -> Result<(), ICError> {
+ let RegisterSpec {
+ indirection,
+ target,
+ } = r.as_register(self)?;
+ let a = a.as_value(self)?;
+ let b = b.as_value(self)?;
+ self.set_register(indirection, target, f64::atan2(a, b))?;
+ Ok(())
+ }
+}
+
+impl