From 27585d64409532a1d2f17557f626d3800c83d8fd Mon Sep 17 00:00:00 2001 From: Steins7 Date: Sat, 2 Mar 2024 23:09:32 +0100 Subject: [PATCH] Migrated display to custom crate Things still need to be ironed out, mainly in the display crate, but the system is working --- Cargo.lock | 1698 ++++++++++++++++++++++------------- Cargo.toml | 7 +- src/bus.rs | 16 +- src/cpu.rs | 84 +- src/main.rs | 325 ++++--- src/peripherals/ppu.rs | 22 +- src/utils/display_buffer.rs | 22 +- 7 files changed, 1378 insertions(+), 796 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 16c86f4..b24605d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,34 +4,93 @@ version = 3 [[package]] name = "ab_glyph_rasterizer" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a13739d7177fbd22bb0ed28badfff9f372f8bef46c863db4e1c6248f6b223b6e" +checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] -name = "andrew" -version = "0.3.1" +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" dependencies = [ - "bitflags", - "rusttype", - "walkdir", - "xdg", - "xml-rs 0.8.4", + "cfg-if 1.0.0", + "once_cell", + "version_check", + "zerocopy", ] [[package]] -name = "android_glue" -version = "0.2.3" +name = "allocator-api2" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "ash" +version = "0.37.3+1.3.251" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" +dependencies = [ + "libloading 0.7.4", +] [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" @@ -39,6 +98,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + [[package]] name = "block" version = "0.1.6" @@ -46,20 +111,74 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] -name = "calloop" -version = "0.6.5" +name = "bumpalo" +version = "3.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" +checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" + +[[package]] +name = "bytemuck" +version = "1.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "calloop" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf2eec61efe56aa1e813f5126959296933cf0700030e4314786c48779a66ab82" dependencies = [ "log", - "nix 0.18.0", + "nix 0.22.3", +] + +[[package]] +name = "canvas" +version = "0.1.0" +source = "git+https://git.steins7.ovh/Steins7/canvas.git?branch=dev#f0ab184ea8fa9d40b086dc646b19d7b9a01c00c2" +dependencies = [ + "bitflags 1.3.2", + "bytemuck", + "cgmath", + "chrono", + "fern", + "fontdue", + "image", + "log", + "pollster", + "raw-window-handle", + "wgpu", + "wgpu-core", + "wgpu-hal", + "wgpu-types", + "winit", ] [[package]] name = "cc" -version = "1.0.72" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" +checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" [[package]] name = "cfg-if" @@ -74,53 +193,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "cgl" -version = "0.3.2" +name = "cfg_aliases" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "cgmath" +version = "0.18.0" dependencies = [ - "libc", + "approx", + "bytemuck", + "num-traits", ] [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ - "libc", - "num-integer", + "android-tzdata", + "iana-time-zone", + "js-sys", "num-traits", - "time", - "winapi 0.3.9", + "wasm-bindgen", + "windows-targets 0.52.4", ] [[package]] name = "cocoa" -version = "0.23.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54201c07dcf3a5ca33fececb8042aed767ee4bfd5a0235a8ceabcda956044b2" +checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "block", "cocoa-foundation", - "core-foundation 0.9.2", - "core-graphics 0.22.3", - "foreign-types", - "libc", - "objc", -] - -[[package]] -name = "cocoa" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" -dependencies = [ - "bitflags", - "block", - "cocoa-foundation", - "core-foundation 0.9.2", + "core-foundation 0.9.4", "core-graphics 0.22.3", "foreign-types", "libc", @@ -129,19 +239,51 @@ dependencies = [ [[package]] name = "cocoa-foundation" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" +checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" dependencies = [ - "bitflags", + "bitflags 1.3.2", "block", - "core-foundation 0.9.2", + "core-foundation 0.9.4", "core-graphics-types", - "foreign-types", "libc", "objc", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "colored" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f741c91823341bebf717d4c71bda820630ce065443b58bd1b7451af008355" +dependencies = [ + "is-terminal", + "lazy_static", + "winapi", +] + +[[package]] +name = "copyless" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" + [[package]] name = "core-foundation" version = "0.7.0" @@ -154,11 +296,11 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ - "core-foundation-sys 0.8.3", + "core-foundation-sys 0.8.6", "libc", ] @@ -170,9 +312,9 @@ checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core-graphics" @@ -180,7 +322,7 @@ version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation 0.7.0", "foreign-types", "libc", @@ -192,8 +334,8 @@ version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" dependencies = [ - "bitflags", - "core-foundation 0.9.2", + "bitflags 1.3.2", + "core-foundation 0.9.4", "core-graphics-types", "foreign-types", "libc", @@ -201,13 +343,12 @@ dependencies = [ [[package]] name = "core-graphics-types" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ - "bitflags", - "core-foundation 0.9.2", - "foreign-types", + "bitflags 1.3.2", + "core-foundation 0.9.4", "libc", ] @@ -224,6 +365,15 @@ dependencies = [ "objc", ] +[[package]] +name = "crc32fast" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +dependencies = [ + "cfg-if 1.0.0", +] + [[package]] name = "cty" version = "0.2.2" @@ -231,135 +381,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] -name = "darling" -version = "0.10.2" +name = "d3d12" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +checksum = "827914e1f53b1e0e025ecd3d967a7836b7bcb54520f90e21ef8df7b4d88a2759" dependencies = [ - "darling_core 0.10.2", - "darling_macro 0.10.2", + "bitflags 1.3.2", + "libloading 0.7.4", + "winapi", ] [[package]] name = "darling" -version = "0.12.4" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f2c43f534ea4b0b049015d00269734195e6d3f0f6635cb692251aca6f9f8b3c" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ - "darling_core 0.12.4", - "darling_macro 0.12.4", + "darling_core", + "darling_macro", ] [[package]] name = "darling_core" -version = "0.10.2" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.9.3", - "syn", -] - -[[package]] -name = "darling_core" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e91455b86830a1c21799d94524df0845183fa55bafd9aa137b01c7d1065fa36" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn", + "strsim", + "syn 1.0.109", ] [[package]] name = "darling_macro" -version = "0.10.2" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ - "darling_core 0.10.2", + "darling_core", "quote", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" -dependencies = [ - "darling_core 0.12.4", - "quote", - "syn", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "derive_builder" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d13202debe11181040ae9063d739fa32cfcaaebe2275fe387703460ae2365b30" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66e616858f6187ed828df7c64a6d71720d83767a7f19740b2d1b6fe6327b36e5" -dependencies = [ - "darling 0.12.4", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "derive_builder_macro" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58a94ace95092c5acb1e97a7e846b310cfbd499652f72297da7493f618a98d73" -dependencies = [ - "derive_builder_core", - "syn", -] - -[[package]] -name = "dirs" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" -dependencies = [ - "libc", - "redox_users", - "winapi 0.3.9", + "syn 1.0.109", ] [[package]] @@ -370,20 +434,11 @@ checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" [[package]] name = "dlib" -version = "0.4.2" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.6.7", -] - -[[package]] -name = "dlib" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" -dependencies = [ - "libloading 0.7.3", + "libloading 0.8.2", ] [[package]] @@ -393,20 +448,56 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] -name = "fern" -version = "0.6.0" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9a4820f0ccc8a7afd67c39a0f1a0f4b07ca1725164271a64939d7aeb9af065" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "fdeflate" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" dependencies = [ + "simd-adler32", +] + +[[package]] +name = "fern" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f0c14694cbd524c8720dd69b0e3179344f04ebb5f90f2e4a440c6ea3b2f1ee" +dependencies = [ + "colored", "log", ] +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "fontdue" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0793f5137567643cf65ea42043a538804ff0fbf288649e2141442b602d81f9bc" +dependencies = [ + "hashbrown 0.13.2", + "ttf-parser", +] + [[package]] name = "foreign-types" version = "0.3.2" @@ -423,133 +514,123 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] -name = "fuchsia-zircon" -version = "0.3.3" +name = "fxhash" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" dependencies = [ - "bitflags", - "fuchsia-zircon-sys", + "byteorder", ] [[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" +name = "glow" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] [[package]] -name = "getrandom" +name = "gpu-alloc" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22beaafc29b38204457ea030f6fb7a84c9e4dd1b86e311ba0542533453d87f62" +dependencies = [ + "bitflags 1.3.2", + "gpu-alloc-types", +] + +[[package]] +name = "gpu-alloc-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "gpu-descriptor" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi", + "bitflags 2.4.2", + "gpu-descriptor-types", + "hashbrown 0.14.3", ] [[package]] -name = "gl" -version = "0.10.0" +name = "gpu-descriptor-types" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81457bb802910ad5b535eb48541c51830a761804aa5b7087adbc9d049aa57aca" +checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" dependencies = [ - "gl_generator 0.9.0", + "bitflags 2.4.2", ] [[package]] -name = "gl_generator" -version = "0.9.0" +name = "hashbrown" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a795170cbd85b5a7baa58d6d7525cae6a03e486859860c220f7ebbbdd379d0a" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "khronos_api 2.2.0", - "log", - "xml-rs 0.7.0", + "ahash", ] [[package]] -name = "gl_generator" -version = "0.14.0" +name = "hashbrown" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "khronos_api 3.1.0", - "log", - "xml-rs 0.8.4", + "ahash", + "allocator-api2", ] [[package]] -name = "glutin" -version = "0.26.0" +name = "hermit-abi" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ae1cbb9176b9151c4ce03f012e3cd1c6c18c4be79edeaeb3d99f5d8085c5fa3" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ - "android_glue", - "cgl", - "cocoa 0.23.0", - "core-foundation 0.9.2", - "glutin_egl_sys", - "glutin_emscripten_sys", - "glutin_gles2_sys", - "glutin_glx_sys", - "glutin_wgl_sys", - "lazy_static", - "libloading 0.6.7", - "log", - "objc", - "osmesa-sys", - "parking_lot", - "wayland-client", - "wayland-egl", - "winapi 0.3.9", - "winit", + "android_system_properties", + "core-foundation-sys 0.8.6", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", ] [[package]] -name = "glutin_egl_sys" -version = "0.1.5" +name = "iana-time-zone-haiku" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2abb6aa55523480c4adc5a56bbaa249992e2dddb2fc63dc96e04a3355364c211" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "gl_generator 0.14.0", - "winapi 0.3.9", -] - -[[package]] -name = "glutin_emscripten_sys" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80de4146df76e8a6c32b03007bc764ff3249dcaeb4f675d68a06caf1bac363f1" - -[[package]] -name = "glutin_gles2_sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094e708b730a7c8a1954f4f8a31880af00eb8a1c5b5bf85d28a0a3c6d69103" -dependencies = [ - "gl_generator 0.14.0", - "objc", -] - -[[package]] -name = "glutin_glx_sys" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e393c8fc02b807459410429150e9c4faffdb312d59b8c038566173c81991351" -dependencies = [ - "gl_generator 0.14.0", - "x11-dl", -] - -[[package]] -name = "glutin_wgl_sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da5951a1569dbab865c6f2a863efafff193a93caf05538d193e9e3816d21696" -dependencies = [ - "gl_generator 0.14.0", + "cc", ] [[package]] @@ -558,6 +639,46 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "image" +version = "0.24.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "jpeg-decoder", + "num-traits", + "png", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", +] + +[[package]] +name = "inplace_it" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e567468c50f3d4bc7397702e09b380139f9b9288b4e909b070571007f8b5bf78" + [[package]] name = "instant" version = "0.1.12" @@ -565,15 +686,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] -name = "iovec" -version = "0.1.4" +name = "is-terminal" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ + "hermit-abi", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -583,26 +709,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] -name = "kernel32-sys" -version = "0.2.2" +name = "jpeg-decoder" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" + +[[package]] +name = "js-sys" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ - "winapi 0.2.8", - "winapi-build", + "wasm-bindgen", ] [[package]] -name = "khronos_api" -version = "2.2.0" +name = "khronos-egl" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037ab472c33f67b5fbd3e9163a2645319e5356fcd355efa6d4eb7fff4bbcb554" - -[[package]] -name = "khronos_api" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" +checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" +dependencies = [ + "libc", + "libloading 0.7.4", + "pkg-config", +] [[package]] name = "lazy_static" @@ -610,55 +740,47 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" -version = "0.2.116" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "565dbd88872dbe4cc8a46e527f26483c1d1f7afa6b884a3bd6cd893d4f98da74" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" -version = "0.6.7" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ "cfg-if 1.0.0", - "winapi 0.3.9", + "winapi", ] [[package]] name = "libloading" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +checksum = "2caa5afb8bf9f3a2652760ce7d4f62d21c4d5a423e68466fca30df82f2330164" dependencies = [ "cfg-if 1.0.0", - "winapi 0.3.9", + "windows-targets 0.52.4", ] [[package]] name = "lock_api" -version = "0.4.6" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ + "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.14" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "malloc_buf" @@ -671,86 +793,91 @@ dependencies = [ [[package]] name = "memchr" -version = "2.4.1" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memmap2" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" +checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357" dependencies = [ "libc", ] [[package]] -name = "mini_gl_fb" -version = "0.9.0" +name = "memoffset" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b4b4abf05d039848cc65143e36706574d332c8a2d222d412a963bb98d9f4399" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ - "derive_builder", - "gl", - "glutin", - "rustic_gl", + "autocfg", ] [[package]] -name = "minimal-lexical" -version = "0.2.1" +name = "metal" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", + "simd-adler32", +] [[package]] name = "mio" -version = "0.6.23" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", "libc", "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", + "wasi", + "windows-sys 0.48.0", ] [[package]] -name = "mio-extras" -version = "2.0.6" +name = "naga" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" +checksum = "5f50357e1167a3ab92d6b3c7f4bf5f7fd13fde3f4b28bf0d5ea07b5100fdb6c0" dependencies = [ - "lazycell", + "bit-set", + "bitflags 1.3.2", + "codespan-reporting", + "hexf-parse", + "indexmap 1.9.3", "log", - "mio", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", + "num-traits", + "rustc-hash", + "spirv", + "termcolor", + "thiserror", + "unicode-xid", ] [[package]] name = "ndk" -version = "0.2.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eb167c1febed0a496639034d0c76b3b74263636045db5489eee52143c246e73" +checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" dependencies = [ + "bitflags 1.3.2", "jni-sys", "ndk-sys", "num_enum", @@ -758,30 +885,37 @@ dependencies = [ ] [[package]] -name = "ndk-glue" -version = "0.2.1" +name = "ndk-context" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf399b8b7a39c6fb153c4ec32c72fd5fe789df24a647f229c239aa7adb15241" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-glue" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71bee8ea72d685477e28bd004cfe1bf99c754d688cd78cad139eae4089484d4" dependencies = [ "lazy_static", "libc", "log", "ndk", + "ndk-context", "ndk-macro", "ndk-sys", ] [[package]] name = "ndk-macro" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" dependencies = [ - "darling 0.10.2", + "darling", "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -794,100 +928,67 @@ checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" name = "nes_emulator" version = "0.1.0" dependencies = [ - "bitflags", + "bitflags 1.3.2", + "canvas", "chrono", "fern", "log", - "mini_gl_fb", "rusttype", - "winit", -] - -[[package]] -name = "net2" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", ] [[package]] name = "nix" -version = "0.18.0" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" +checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" dependencies = [ - "bitflags", - "cc", - "cfg-if 0.1.10", - "libc", -] - -[[package]] -name = "nix" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" -dependencies = [ - "bitflags", + "bitflags 1.3.2", "cc", "cfg-if 1.0.0", "libc", + "memoffset", ] [[package]] -name = "nom" -version = "7.1.0" +name = "nix" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ - "memchr", - "minimal-lexical", - "version_check", -] - -[[package]] -name = "num-integer" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" -dependencies = [ - "autocfg", - "num-traits", + "bitflags 1.3.2", + "cfg-if 1.0.0", + "libc", + "memoffset", ] [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] [[package]] name = "num_enum" -version = "0.4.3" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca565a7df06f3d4b485494f25ba05da1435950f4dc263440eda7a6fa9b8e36e4" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" dependencies = [ - "derivative", "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.4.3" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffa5a33ddddfee04c0283a7653987d634e880347e96b5b2ed64de07efb59db9d" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -897,28 +998,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" dependencies = [ "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", ] [[package]] name = "once_cell" -version = "1.9.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" - -[[package]] -name = "osmesa-sys" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" -dependencies = [ - "shared_library", -] +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "owned_ttf_parser" -version = "0.6.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" +checksum = "05e6affeb1632d6ff6a23d2cd40ffed138e82f1532571a26f527c8a284bb2fbb" dependencies = [ "ttf-parser", ] @@ -931,192 +1033,227 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core", + "parking_lot_core 0.8.6", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.9", ] [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", - "winapi 0.3.9", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.4.1", + "smallvec", + "windows-targets 0.48.5", ] [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pkg-config" -version = "0.3.24" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "png" +version = "0.17.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "pollster" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7" [[package]] name = "proc-macro-crate" -version = "0.1.5" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "toml", + "once_cell", + "toml_edit", ] [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] -name = "quote" +name = "profiling" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] [[package]] -name = "raw-window-handle" -version = "0.3.4" +name = "range-alloc" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28f55143d0548dad60bb4fbdc835a3d7ac6acc3324506450c5fdd6e42903a76" -dependencies = [ - "libc", - "raw-window-handle 0.4.2", -] +checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" [[package]] name = "raw-window-handle" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba75eee94a9d5273a68c9e1e105d9cffe1ef700532325788389e5a83e2522b7" +checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" dependencies = [ "cty", ] [[package]] name = "redox_syscall" -version = "0.2.10" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] -name = "redox_users" -version = "0.4.0" +name = "redox_syscall" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "getrandom", - "redox_syscall", + "bitflags 1.3.2", ] [[package]] -name = "rustic_gl" -version = "0.3.2" +name = "renderdoc-sys" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "098d36b4663285a8e819d9965a88cd4efcc76b2ae3e3c15c5b35956a9d737813" -dependencies = [ - "gl", -] +checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rusttype" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" +checksum = "3ff8374aa04134254b7995b63ad3dc41c7f7236f69528b28553da7d72efaa967" dependencies = [ "ab_glyph_rasterizer", "owned_ttf_parser", ] -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - [[package]] name = "scoped-tls" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "serde" -version = "1.0.136" +name = "simd-adler32" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] -name = "shared_library" -version = "0.1.9" +name = "slotmap" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" dependencies = [ - "lazy_static", - "libc", + "version_check", ] -[[package]] -name = "slab" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" - [[package]] name = "smallvec" -version = "1.8.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "smithay-client-toolkit" -version = "0.12.3" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4750c76fd5d3ac95fa3ed80fe667d6a3d8590a960e5b575b98eea93339a80b80" +checksum = "8a28f16a97fa0e8ce563b2774d1e732dd5d4025d2772c5dba0a41a0f90a29da3" dependencies = [ - "andrew", - "bitflags", + "bitflags 1.3.2", "calloop", - "dlib 0.4.2", + "dlib", "lazy_static", "log", "memmap2", - "nix 0.18.0", + "nix 0.22.3", + "pkg-config", "wayland-client", "wayland-cursor", "wayland-protocols", ] [[package]] -name = "strsim" -version = "0.9.3" +name = "spirv" +version = "0.2.0+1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" +checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" +dependencies = [ + "bitflags 1.3.2", + "num-traits", +] [[package]] name = "strsim" @@ -1126,66 +1263,95 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.86" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.52", ] [[package]] -name = "time" -version = "0.1.44" +name = "toml_datetime" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" -dependencies = [ - "libc", - "wasi", - "winapi 0.3.9", -] +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] -name = "toml" -version = "0.5.8" +name = "toml_edit" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "serde", + "indexmap 2.2.5", + "toml_datetime", + "winnow", ] [[package]] name = "ttf-parser" -version = "0.6.2" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" +checksum = "7b3e06c9b9d80ed6b745c7159c40b311ad2916abb34a49e9be2653b90db0d8dd" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-width" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "version_check" @@ -1194,32 +1360,87 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "walkdir" -version = "2.3.2" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ - "same-file", - "winapi 0.3.9", - "winapi-util", + "cfg-if 1.0.0", + "wasm-bindgen-macro", ] [[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" +name = "wasm-bindgen-backend" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.52", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "wayland-client" -version = "0.28.6" +version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ab332350e502f159382201394a78e3cc12d0f04db863429260164ea40e0355" +checksum = "3f3b068c05a039c9f755f881dc50f01732214f5685e379829759088967c46715" dependencies = [ - "bitflags", + "bitflags 1.3.2", "downcast-rs", "libc", - "nix 0.20.0", + "nix 0.24.3", "scoped-tls", "wayland-commons", "wayland-scanner", @@ -1228,11 +1449,11 @@ dependencies = [ [[package]] name = "wayland-commons" -version = "0.28.6" +version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21817947c7011bbd0a27e11b17b337bfd022e8544b071a2641232047966fbda" +checksum = "8691f134d584a33a6606d9d717b95c4fa20065605f798a3f350d78dced02a902" dependencies = [ - "nix 0.20.0", + "nix 0.24.3", "once_cell", "smallvec", "wayland-sys", @@ -1240,32 +1461,22 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.28.6" +version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be610084edd1586d45e7bdd275fe345c7c1873598caa464c4fb835dee70fa65a" +checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661" dependencies = [ - "nix 0.20.0", + "nix 0.24.3", "wayland-client", "xcursor", ] -[[package]] -name = "wayland-egl" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ba1ab1e18756b23982d36f08856d521d7df45015f404a2d7c4f0b2d2f66956" -dependencies = [ - "wayland-client", - "wayland-sys", -] - [[package]] name = "wayland-protocols" -version = "0.28.6" +version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "286620ea4d803bacf61fa087a4242ee316693099ee5a140796aaba02b29f861f" +checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "wayland-client", "wayland-commons", "wayland-scanner", @@ -1273,31 +1484,129 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.28.6" +version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce923eb2deb61de332d1f356ec7b6bf37094dc5573952e1c8936db03b54c03f1" +checksum = "8f4303d8fa22ab852f789e75a967f0a2cdc430a607751c0499bada3e451cbd53" dependencies = [ "proc-macro2", "quote", - "xml-rs 0.8.4", + "xml-rs", ] [[package]] name = "wayland-sys" -version = "0.28.6" +version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d841fca9aed7febf9bed2e9796c49bf58d4152ceda8ac949ebe00868d8f0feb8" +checksum = "be12ce1a3c39ec7dba25594b97b42cb3195d54953ddb9d3d95a7c3902bc6e9d4" dependencies = [ - "dlib 0.5.0", + "dlib", "lazy_static", "pkg-config", ] [[package]] -name = "winapi" -version = "0.2.8" +name = "web-sys" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wgpu" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "277e967bf8b7820a76852645a6bce8bbd31c32fda2042e82d8e3ea75fda8892d" +dependencies = [ + "arrayvec", + "js-sys", + "log", + "naga", + "parking_lot 0.12.1", + "raw-window-handle", + "smallvec", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b92788dec9d0c1bed849a1b83f01b2ee12819bf04a79c90f68e4173f7b5ba2" +dependencies = [ + "arrayvec", + "bit-vec", + "bitflags 1.3.2", + "cfg_aliases", + "codespan-reporting", + "copyless", + "fxhash", + "log", + "naga", + "parking_lot 0.12.1", + "profiling", + "raw-window-handle", + "smallvec", + "thiserror", + "web-sys", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-hal" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cbdfc3d0637dba3d5536b93adef3d26023a0b96f0e1ee5ee9560a401d9f646" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bit-set", + "bitflags 1.3.2", + "block", + "core-graphics-types", + "d3d12", + "foreign-types", + "fxhash", + "glow", + "gpu-alloc", + "gpu-descriptor", + "inplace_it", + "js-sys", + "khronos-egl", + "libloading 0.7.4", + "log", + "metal", + "naga", + "objc", + "parking_lot 0.12.1", + "profiling", + "range-alloc", + "raw-window-handle", + "renderdoc-sys", + "thiserror", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "winapi", +] + +[[package]] +name = "wgpu-types" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f762cbc08e1a51389859cf9c199c7aef544789cf3510889aab12c607f701604" +dependencies = [ + "bitflags 1.3.2", +] [[package]] name = "winapi" @@ -1309,12 +1618,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -1323,11 +1626,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1337,14 +1640,155 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "winit" -version = "0.24.0" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da4eda6fce0eb84bd0a33e3c8794eb902e1033d0a1d5a31bc4f19b1b4bbff597" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "bitflags", - "cocoa 0.24.0", - "core-foundation 0.9.2", + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +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", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + +[[package]] +name = "winit" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b43cc931d58b99461188607efd7acb2a093e65fc621f54cad78517a6063e73a" +dependencies = [ + "bitflags 1.3.2", + "cocoa", + "core-foundation 0.9.4", "core-graphics 0.22.3", "core-video-sys", "dispatch", @@ -1353,70 +1797,70 @@ dependencies = [ "libc", "log", "mio", - "mio-extras", "ndk", "ndk-glue", "ndk-sys", "objc", - "parking_lot", + "parking_lot 0.11.2", "percent-encoding", - "raw-window-handle 0.3.4", + "raw-window-handle", "smithay-client-toolkit", + "wasm-bindgen", "wayland-client", - "winapi 0.3.9", + "wayland-protocols", + "web-sys", + "winapi", "x11-dl", ] [[package]] -name = "ws2_32-sys" -version = "0.2.1" +name = "winnow" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ - "winapi 0.2.8", - "winapi-build", + "memchr", ] [[package]] name = "x11-dl" -version = "2.19.1" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" dependencies = [ - "lazy_static", "libc", + "once_cell", "pkg-config", ] [[package]] name = "xcursor" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" -dependencies = [ - "nom", -] - -[[package]] -name = "xdg" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a23fe958c70412687039c86f578938b4a0bb50ec788e96bce4d6ab00ddd5803" -dependencies = [ - "dirs", -] +checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" [[package]] name = "xml-rs" -version = "0.7.0" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c1cb601d29fe2c2ac60a2b2e5e293994d87a1f6fa9687a31a15270f909be9c2" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ - "bitflags", + "zerocopy-derive", ] [[package]] -name = "xml-rs" -version = "0.8.4" +name = "zerocopy-derive" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] diff --git a/Cargo.toml b/Cargo.toml index e58b6c2..a455712 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,8 +9,11 @@ edition = "2021" log = "0.4.14" chrono = "0.4.19" fern = "0.6.0" -winit = "0.24.0" -mini_gl_fb = "0.9.0" bitflags = "1.3.2" rusttype = "0.9.2" +canvas = "0.1.0" + +[patch.crates-io] +canvas = { git = "https://git.steins7.ovh/Steins7/canvas.git", branch = "dev" } +cgmath = { path = "cgmath" } diff --git a/src/bus.rs b/src/bus.rs index b55f406..40b751d 100644 --- a/src/bus.rs +++ b/src/bus.rs @@ -28,7 +28,7 @@ impl fmt::Debug for Bus { impl Peripheral for Bus { fn read_addr(&self, addr: u16) -> u8 { - + match addr { 0x0000..=0x1FFF => self.ram.read_addr(addr % 0x0800), //RAM is mirrored 3 times 0x2000..=0x3FFF => self.ppu.read_addr(addr % 0x8), //PPU is mirrored every 8 bytes @@ -38,11 +38,11 @@ impl Peripheral for Bus { } fn write_addr(&mut self, addr: u16, data: u8) { - + match addr { - 0x0000..=0x1FFF => self.ram.write_addr(addr % 0x0800, data), + 0x0000..=0x1FFF => self.ram.write_addr(addr % 0x0800, data), 0x2000..=0x3FFF => self.ppu.write_addr(addr % 0x8, data), - 0x4000..=0x401F => self.apu.write_addr(addr, data), + 0x4000..=0x401F => self.apu.write_addr(addr, data), 0x4020..=0xFFFF => self.cartridge.borrow_mut().write_addr(addr, data), }; } @@ -51,7 +51,7 @@ impl Peripheral for Bus { impl Bus { pub fn new(mapper: Rc>, - screen: Rc>, + screen: Rc>, pattern_table: Rc>) -> Self { @@ -60,7 +60,7 @@ impl Bus { //TODO temporary for instruction tests ram.buffer[0x01] = 0xE9; //sbc ram.buffer[0x02] = (-3 as i8) as u8; - ram.buffer[0x03] = 0x09; + ram.buffer[0x03] = 0x09; ram.buffer[0x04] = 0x00; ram.buffer[0x05] = 0xA9; //lda ram.buffer[0x06] = 0x01; @@ -106,7 +106,7 @@ impl Bus { ram.buffer[0x01FF] = 0x01; ram.buffer[0x02FF] = 0xFF; //boundary ram.buffer[0x0300] = 0x03; - + // ptr to test ram.buffer[0x030F] = 0xFF; ram.buffer[0x0310] = 0x03; @@ -123,7 +123,7 @@ impl Bus { } pub fn tick(&mut self) { - self.ppu.tick(); + self.ppu.tick(); } } diff --git a/src/cpu.rs b/src/cpu.rs index 002e0f5..b57ac60 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -89,7 +89,7 @@ struct MemoryValExtra { } impl Input for MemoryValExtra { - fn get_cycles(&self) -> u32 { + fn get_cycles(&self) -> u32 { match self.extra_cycle { false => self.cycles, true => self.cycles + 1, @@ -154,7 +154,7 @@ pub struct Cpu { } impl fmt::Debug for Cpu { - + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("Cpu") .field("acc", &format_args!("0x{:0>2X}", self.a)) @@ -171,20 +171,20 @@ impl fmt::Debug for Cpu { impl Cpu { - pub fn new(mapper: Rc>, - screen: Rc>, - pattern_table: Rc>) + pub fn new(mapper: Rc>, + screen: Rc>, + pattern_table: Rc>) -> Self { - + // read initial PC value from reset vector let bus = Bus::new(mapper, screen, pattern_table); let pc_lo = bus.read_addr(0xFFFC) as u16; - let pc_hi = bus.read_addr(0xFFFD) as u16; + let pc_hi = bus.read_addr(0xFFFD) as u16; Cpu { a: 0, - x: 0, - y: 0, + x: 0, + y: 0, pc: (pc_lo | (pc_hi << 8)) + 3, s: 0xFD, p: StatusReg::from_bits(0x34).unwrap(), @@ -194,7 +194,7 @@ impl Cpu { pub fn tick(&mut self) { - self.execute(); + self.execute(); self.bus.tick(); } @@ -207,7 +207,7 @@ impl Cpu { // if (self.pc-1) != 0x36D8 { // println!("0x{:0>4X}: {:0>2X}", self.pc-1, opcode); // } - + let cycles = parse_opcode!(self, opcode, 0x69 => adc(mode_immediate), 0x65 => adc(mode_zero_page), @@ -266,7 +266,7 @@ impl Cpu { 0xE0 => cpx(mode_immediate), 0xE4 => cpx(mode_zero_page), 0xEC => cpx(mode_absolute), - + 0xC0 => cpy(mode_immediate), 0xC4 => cpy(mode_zero_page), 0xCC => cpy(mode_absolute), @@ -343,13 +343,13 @@ impl Cpu { 0x08 => php(mode_implicit), 0x68 => pla(mode_implicit), 0x28 => plp(mode_implicit), - + 0x2A => rol(mode_accumulator), 0x26 => rol(mode_zero_page), 0x36 => rol(mode_zero_page_x), 0x2E => rol(mode_absolute), 0x3E => rol(mode_absolute_x), - + 0x6A => ror(mode_accumulator), 0x66 => ror(mode_zero_page), 0x76 => ror(mode_zero_page_x), @@ -397,7 +397,7 @@ impl Cpu { ); } - /// Implicit mode + /// Implicit mode /// instructions that use implied mode don't need inputs fn mode_implicit(&self) -> () {} @@ -408,7 +408,7 @@ impl Cpu { data: self.read_pc_addr(), } } - + /// Immediate mode "#v": /// use 8bit operand as signed offset for PC fn mode_relative(&mut self) -> Data { @@ -470,7 +470,7 @@ impl Cpu { let addr_lo = self.read_pc_addr() as u16; let addr_hi = self.read_pc_addr() as u16; let mut addr = addr_lo | (addr_hi << 8); - + // compute index let extra_cycle = (addr_lo + (self.x as u16)) & 0xFF00 != 0; addr += self.x as u16; @@ -486,12 +486,12 @@ impl Cpu { /// Fetch value from anywhere in memory, indexed on Y register /// val = PEEK(arg + Y) fn mode_absolute_y(&mut self) -> MemoryValExtra { - + // compute full address let addr_lo = self.read_pc_addr() as u16; let addr_hi = self.read_pc_addr() as u16; let mut addr = addr_lo | (addr_hi << 8); - + // compute index let extra_cycle = (addr_lo + (self.y as u16)) & 0xFF00 != 0; addr += self.y as u16; @@ -513,7 +513,7 @@ impl Cpu { let addr_ind_lo = self.read_pc_addr() as u16; let addr_ind_hi = self.read_pc_addr() as u16; let addr_ind = addr_ind_lo | (addr_ind_hi << 8); - + // fetch indirect addr to jump to let addr_lo = self.bus.read_addr(addr_ind) as u16; //note: bug of the 6502, the carry isn't applied when incrementing the indirect address @@ -527,13 +527,13 @@ impl Cpu { } /// Indirect mode "(d.x)" - /// Fetch value from anywhere in memory using an address table built by the user and stored in + /// Fetch value from anywhere in memory using an address table built by the user and stored in /// zero page, indexed on X /// val = PEEK(PEEK((arg + X) & 0xFF) + PEEK((arg + X + 1) & 0xFF) << 8) fn mode_indirect_x(&mut self) -> MemoryVal { let addr_ind = self.read_pc_addr() as u16 + self.x as u16; - + // fetch indirect addr to jump to let addr_lo = self.bus.read_addr(addr_ind & 0xFF) as u16; let addr_hi = self.bus.read_addr((addr_ind + 1) & 0xFF) as u16; @@ -551,7 +551,7 @@ impl Cpu { fn mode_indirect_y(&mut self) -> MemoryValExtra { let addr_ind = self.read_pc_addr() as u16; - + // fetch indirect addr to jump to let addr_lo = self.bus.read_addr(addr_ind) as u16; let addr_hi = self.bus.read_addr((addr_ind + 1) & 0xFF) as u16; @@ -599,7 +599,7 @@ impl Cpu { fn adc(&mut self, input: I) -> u32 { let val = input.read(&self.a, &self.bus); - + // add acc and value let prev_a = self.a as u16; let mut a = self.a as u16; @@ -640,7 +640,7 @@ impl Cpu { fn asl(&mut self, mut input: I) -> u32 { let mut target = input.read(&self.a, &self.bus) as u16; - + // shift target one bit left target = target << 1; @@ -663,7 +663,7 @@ impl Cpu { let old_pc = self.pc; self.pc = self.pc.wrapping_add(offset as u16); match old_pc & 0xFF00 == self.pc & 0xFF00 { - true => input.get_cycles() + 1, + true => input.get_cycles() + 1, false => input.get_cycles() + 2, } } @@ -714,7 +714,7 @@ impl Cpu { let pc = self.pc.wrapping_add(1); self.push_stack((pc >> 8) as u8); self.push_stack(pc as u8); - + // store status register self.p.set(StatusReg::B | StatusReg::U, true); self.push_stack(self.p.bits() as u8); @@ -759,7 +759,7 @@ impl Cpu { } fn compute_cmp(&mut self, reg: u8, input: I) -> u32 { - let val = input.read(&self.a, &self.bus) as u8; + let val = input.read(&self.a, &self.bus) as u8; self.p.set(StatusReg::C, reg >= val); self.p.set(StatusReg::Z, reg == val); @@ -787,7 +787,7 @@ impl Cpu { val = val.wrapping_sub(1); self.p.set(StatusReg::Z, val == 0); self.p.set(StatusReg::N, (val & (0x1 << 7)) != 0); - + // store result input.write(&mut self.a, &mut self.bus, val); input.get_cycles() + 2 @@ -799,7 +799,7 @@ impl Cpu { self.x = self.x.wrapping_sub(1); self.p.set(StatusReg::Z, self.x == 0); self.p.set(StatusReg::N, (self.x & (0x1 << 7)) != 0); - + 2 } @@ -809,7 +809,7 @@ impl Cpu { self.y = self.y.wrapping_sub(1); self.p.set(StatusReg::Z, self.y == 0); self.p.set(StatusReg::N, (self.y & (0x1 << 7)) != 0); - + 2 } @@ -836,7 +836,7 @@ impl Cpu { input.write(&mut self.a, &mut self.bus, val); input.get_cycles() + 2 } - + fn inx(&mut self, _: ()) -> u32 { // compute @@ -937,7 +937,7 @@ impl Cpu { self.p.set(StatusReg::N, (self.a & (0x1 << 7)) != 0); input.get_cycles() - } + } fn pha(&mut self, _: ()) -> u32 { self.push_stack(self.a); @@ -968,7 +968,7 @@ impl Cpu { fn rol(&mut self, mut input: I) -> u32 { let mut val = input.read(&self.a, &self.bus); - + // store bit 7 and compute let carry = val & (0x1 << 7) != 0; val = val << 1; @@ -987,10 +987,10 @@ impl Cpu { input.write(&mut self.a, &mut self.bus, val); input.get_cycles() + 2 } - + fn ror(&mut self, mut input: I) -> u32 { let mut val = input.read(&self.a, &self.bus); - + // store bit 0 and compute let carry = val & (0x1 << 0) != 0; val = val >> 1; @@ -1011,11 +1011,11 @@ impl Cpu { } fn rti(&mut self, _: ()) -> u32 { - + // load status register (B is cleared and I overrided) self.p = StatusReg::from_bits_truncate(self.pop_stack()); self.p.set(StatusReg::B | StatusReg::U, false); - + // load pc let pc_lo = self.pop_stack() as u16; let pc_hi = self.pop_stack() as u16; @@ -1025,7 +1025,7 @@ impl Cpu { } fn rts(&mut self, _: ()) -> u32 { - + // load pc let pc_lo = self.pop_stack() as u16; let pc_hi = self.pop_stack() as u16; @@ -1037,7 +1037,7 @@ impl Cpu { fn sbc(&mut self, input: I) -> u32 { let val = input.read(&self.a, &self.bus); - + // sub acc and value let prev_a = self.a as u16; let mut a = self.a as u16; @@ -1089,7 +1089,7 @@ impl Cpu { input.write(&mut self.a, &mut self.bus, x); input.get_cycles() } - + fn sty(&mut self, mut input: I) -> u32 { let y = self.y; input.write(&mut self.a, &mut self.bus, y); @@ -1113,7 +1113,7 @@ impl Cpu { 2 } - + fn tsx(&mut self, _: ()) -> u32 { self.x = self.s; diff --git a/src/main.rs b/src/main.rs index eceea0b..844413f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,121 +1,242 @@ #[allow(unused_imports)] use log::{debug, error, info, trace, warn}; +use std::{ + rc::Rc, + cell::RefCell, + time::Instant, + fmt::Write, +}; + mod cpu; use cpu::Cpu; mod bus; mod peripherals; +use peripherals::mapper::Nrom128; + mod utils; -fn main() -> Result<(), &'static str> { - use utils::{Pixel, PixelBuffer, FontRenderer, DisplayBuffer}; - use winit::{ - event_loop::EventLoop, - dpi::LogicalSize, - }; - use mini_gl_fb::config; - use std::{ - fmt::Write, - rc::Rc, - cell::RefCell, - time::Instant, - }; - use peripherals::mapper::Nrom128; +use canvas::{ + Application, + Canvas, + sprite::{Sprite, TextureSprite, TextSprite, Center}, + utils::{Size, Color, Position}, +}; +use utils::DisplayBuffer; - // setup - setup_logger().map_err(|_| "Failed to setup logger")?; +struct EmulatorState { + pub screen: Rc>, + pub screen_sprite: TextureSprite, - let mut event_loop = EventLoop::new(); - let config = config! { - window_title: "Test".to_string(), - window_size: LogicalSize::new(1280.0, 720.0), - invert_y: false, - }; - let mut fb = mini_gl_fb::get_fancy(config, &event_loop); - let mut buffer = PixelBuffer::new(1280, 720); - let mut renderer = FontRenderer::new(20.0, [0u8, 0, 0]); + pub pattern_table: Rc>, + pub pattern_sprite: TextureSprite, - // first image - let mapper = Rc::new(RefCell::new(Nrom128::new(false))); - let mut screen = Rc::new(RefCell::new(DisplayBuffer::new(256, 240))); - let pattern_table = Rc::new(RefCell::new(DisplayBuffer::new(256, 128))); - let mut cpu = Cpu::new(mapper, screen.clone(), pattern_table.clone()); - let mut debug_str = String::new(); - //write!(debug_str, "{:#?}", cpu).unwrap(); - buffer.fill([0, 0], [1280, 720], Pixel::rgba(255, 255, 255, 255)); - //renderer.draw(&mut buffer, &debug_str, [20, 20], [760, 560]); + pub fps_text: TextSprite, + pub debug_text: TextSprite, - let vec: Vec<[u8; 4]> = (&buffer).into(); - fb.update_buffer(&vec); - let mut update = false; - let mut refresh = true; - let mut start = Instant::now(); + pub cpu: Cpu, - // event loop - fb.glutin_handle_basic_input(&mut event_loop, |fb, input| { - use winit::event::VirtualKeyCode; - - // wait for input before updating - - // close if escape is pressed - if input.key_pressed(VirtualKeyCode::Escape) { - return false - } - - // execute next cpu instruction (step mode) - if input.key_pressed(VirtualKeyCode::S) { - cpu.tick(); - refresh = true; - } - - if input.key_pressed(VirtualKeyCode::R) { - update = true; - } - - if input.key_pressed(VirtualKeyCode::C) { - update = false; - refresh = true; - } - - if update { - cpu.tick(); - - if screen.borrow_mut().is_ready { - screen.borrow_mut().is_ready = false; - refresh = true; - } - - input.wait = false; - } else { - input.wait = true; - } - - if refresh { - refresh = false; - - let frame_time = start.elapsed().as_secs_f32(); - start = Instant::now(); - - let mut debug_str = String::new(); - buffer.fill([0, 0], [1280, 720], Pixel::rgba(255, 255, 255, 255)); - write!(debug_str, "{} fps", 1.0/frame_time); - renderer.draw(&mut buffer, &debug_str, [1, 1], [20, 20]); - debug_str = String::new(); - write!(debug_str, "{:#?}", cpu).unwrap(); - renderer.draw(&mut buffer, &debug_str, [600, 20], [760, 560]); - buffer.embbed([20, 20], &screen.borrow().buffer, 2); - - let vec: Vec<[u8; 4]> = (&buffer).into(); - fb.update_buffer(&vec); - } - - true - }); - - Ok(()) + pub start: Instant, } +struct NesEmulator {} + +impl Application for NesEmulator { + + fn init(canvas: &mut Canvas) -> Result { + + let start = Instant::now(); + + let screen_texture = canvas + .create_texture(Size {w: 256, h: 240}, Some(Color::RED.into())) + .unwrap(); + let mut screen_sprite = canvas.create_texture_sprite(Size {w: 256 * 2, h: 240 * 2}); + screen_sprite.set_texture(screen_texture.clone(), None, 0.5); + screen_sprite.set_center(Center::BotLeft); + screen_sprite.set_position(Position {x: 100, y: 200}); + let screen = Rc::new(RefCell::new(DisplayBuffer::from_texture(screen_texture))); + + let pattern_texture = canvas + .create_texture(Size {w: 256, h: 128}, Some(Color::BLUE.into())) + .unwrap(); + let mut pattern_sprite = canvas.create_texture_sprite(Size {w: 256, h: 128}); + pattern_sprite.set_texture(pattern_texture.clone(), None, 1.0); + pattern_sprite.set_center(Center::BotLeft); + pattern_sprite.set_position(Position {x: 100, y: 50}); + let pattern_table = Rc::new(RefCell::new(DisplayBuffer::from_texture(pattern_texture))); + + let mut fps_text = canvas.create_text_sprite("00", Size {w: 20, h: 20}, 20.0); + fps_text.set_center(Center::TopLeft); + fps_text.set_position(Position {x:0, y:720}); + + let mut debug_text = canvas.create_text_sprite("00", Size {w: 300, h: 600}, 20.0); + debug_text.set_center(Center::BotLeft); + debug_text.set_position(Position {x:700, y:50}); + + let mapper = Rc::new(RefCell::new(Nrom128::new(false))); + let cpu = Cpu::new(mapper, screen.clone(), pattern_table.clone()); + + canvas.clear(); + canvas.update(); + + Ok(EmulatorState { + screen, + screen_sprite, + pattern_table, + pattern_sprite, + fps_text, + debug_text, + cpu, + start, + }) + } + + fn tick(state: &mut EmulatorState, canvas: &mut Canvas) -> Result<(), &'static str> { + + let frame_time = state.start.elapsed().as_secs_f32(); + state.start = Instant::now(); + canvas.clear(); + state.cpu.tick(); + + if state.screen.borrow_mut().is_ready { + state.screen.borrow_mut().is_ready = false; + } + + canvas.draw(&mut state.screen_sprite); + canvas.draw(&mut state.pattern_sprite); + + let mut fps_str = String::new(); + write!(fps_str, "{} fps", 1.0/frame_time).unwrap(); + state.fps_text.set_text(&fps_str); + canvas.draw(&mut state.fps_text); + + let mut debug_str = String::new(); + write!(debug_str, "{:#?}", state.cpu).unwrap(); + state.debug_text.set_text(&debug_str); + canvas.draw(&mut state.debug_text); + + canvas.update(); + + Ok(()) + } +} + +fn main() -> Result<(), &'static str> { + + setup_logger() + .map_err(|_| "Failed to setup logger")?; + canvas::run_canvas("NES emulator", Size {w: 1280, h: 720}, NesEmulator {}); +} + +// use utils::{Pixel, PixelBuffer, FontRenderer, DisplayBuffer}; +// use glutin::{ +// dpi::LogicalSize, +// event_loop::EventLoop, +// }; +// use mini_gl_fb::config; +// use std::{ +// fmt::Write, +// rc::Rc, +// cell::RefCell, +// time::Instant, +// }; +// use peripherals::mapper::Nrom128; +// use std::ops::Deref; +// +// // setup +// setup_logger().map_err(|_| "Failed to setup logger")?; +// +// let mut event_loop = EventLoop::new(); +// let config = config! { +// window_title: "Test".to_string(), +// window_size: LogicalSize::new(1280.0, 720.0), +// invert_y: false, +// }; +// let mut fb = mini_gl_fb::get_fancy(config, event_loop.deref()); +// let mut buffer = PixelBuffer::new(1280, 720); +// let mut renderer = FontRenderer::new(20.0, [0u8, 0, 0]); +// +// // first image +// let mapper = Rc::new(RefCell::new(Nrom128::new(false))); +// let mut screen = Rc::new(RefCell::new(DisplayBuffer::new(256, 240))); +// let pattern_table = Rc::new(RefCell::new(DisplayBuffer::new(256, 128))); +// let mut cpu = Cpu::new(mapper, screen.clone(), pattern_table.clone()); +// let mut debug_str = String::new(); +// //write!(debug_str, "{:#?}", cpu).unwrap(); +// buffer.fill([0, 0], [1280, 720], Pixel::rgba(255, 255, 255, 255)); +// //renderer.draw(&mut buffer, &debug_str, [20, 20], [760, 560]); +// +// let vec: Vec<[u8; 4]> = (&buffer).into(); +// fb.update_buffer(&vec); +// let mut update = false; +// let mut refresh = true; +// let mut start = Instant::now(); +// +// // event loop +// fb.glutin_handle_basic_input(&mut event_loop, |fb, input| { +// use glutin::event::VirtualKeyCode; +// +// // wait for input before updating +// +// // close if escape is pressed +// if input.key_pressed(VirtualKeyCode::Escape) { +// return false +// } +// +// // execute next cpu instruction (step mode) +// if input.key_pressed(VirtualKeyCode::S) { +// cpu.tick(); +// refresh = true; +// } +// +// if input.key_pressed(VirtualKeyCode::R) { +// update = true; +// } +// +// if input.key_pressed(VirtualKeyCode::C) { +// update = false; +// refresh = true; +// } +// +// if update { +// cpu.tick(); +// +// if screen.borrow_mut().is_ready { +// screen.borrow_mut().is_ready = false; +// refresh = true; +// } +// +// input.wait = false; +// } else { +// input.wait = true; +// } +// +// if refresh { +// refresh = false; +// +// let frame_time = start.elapsed().as_secs_f32(); +// start = Instant::now(); +// +// let mut debug_str = String::new(); +// buffer.fill([0, 0], [1280, 720], Pixel::rgba(255, 255, 255, 255)); +// write!(debug_str, "{} fps", 1.0/frame_time); +// renderer.draw(&mut buffer, &debug_str, [1, 1], [20, 20]); +// debug_str = String::new(); +// write!(debug_str, "{:#?}", cpu).unwrap(); +// renderer.draw(&mut buffer, &debug_str, [600, 20], [760, 560]); +// buffer.embbed([20, 20], &screen.borrow().buffer, 2); +// +// let vec: Vec<[u8; 4]> = (&buffer).into(); +// fb.update_buffer(&vec); +// } +// +// true +// }); +// +// Ok(()) +//} + fn setup_logger() -> Result<(), fern::InitError> { fern::Dispatch::new() @@ -129,7 +250,7 @@ fn setup_logger() -> Result<(), fern::InitError> { message )) }) - .level(log::LevelFilter::Debug) + .level(log::LevelFilter::Error) .chain(std::io::stdout()) .chain(fern::log_file("output.log")?) .apply()?; diff --git a/src/peripherals/ppu.rs b/src/peripherals/ppu.rs index 2dae3b3..0e9e2a6 100644 --- a/src/peripherals/ppu.rs +++ b/src/peripherals/ppu.rs @@ -71,23 +71,23 @@ pub struct Ppu { } impl Peripheral for Ppu { - + fn read_addr(&self, _addr: u16) -> u8 { unimplemented!(); } fn write_addr(&mut self, addr: u16, data: u8) { - unimplemented!(); + unimplemented!(); } } impl Ppu { - pub fn new(mapper: Rc>, - screen: Rc>, - pattern_table: Rc>) + pub fn new(mapper: Rc>, + screen: Rc>, + pattern_table: Rc>) -> Self { - + Self { vbus: mapper, ppu_ctrl: PpuCtrl::from_bits(0).unwrap(), @@ -122,16 +122,16 @@ impl Ppu { use crate::utils::Pixel; self.screen.borrow_mut() - .buffer.put_pixel( - self.dot.into(), - self.line.into(), + .set_pixel( + self.dot.into(), + self.line.into(), Pixel::rgba(self.data.into(), 0, 0, 255)); self.execute(); } fn execute(&mut self) { - + match self.line { 0..=239 => self.render_frame(), 241 => { @@ -163,7 +163,7 @@ impl Ppu { } fn render_frame(&mut self) { - + match self.dot { 0 => (), 33..=40 => (), diff --git a/src/utils/display_buffer.rs b/src/utils/display_buffer.rs index 3664294..f9045a8 100644 --- a/src/utils/display_buffer.rs +++ b/src/utils/display_buffer.rs @@ -1,19 +1,33 @@ -use super::PixelBuffer; +use super::Pixel; + +use canvas::texture::TextureHandle; //-------------------------------------------------------------------------------------------------- pub struct DisplayBuffer { - pub buffer: PixelBuffer, pub is_ready: bool, + + texture: TextureHandle, } impl DisplayBuffer { - pub fn new(w: usize, h: usize) -> Self { + pub fn from_texture(texture: TextureHandle) -> Self { Self { - buffer: PixelBuffer::new(w, h), + texture, is_ready: false, } } + + pub fn set_pixel(&mut self, x: usize, y: usize, pixel: Pixel) { + self.texture.set_pixel( + canvas::utils::Position {x: x.try_into().unwrap(), y: y.try_into().unwrap()}, + canvas::utils::Pixel { + r: pixel.r, + g: pixel.g, + b: pixel.b, + a: pixel.a, + }); + } }