From 0b7fabc801c8e8fab00e60309efb1e9d55a6e97b Mon Sep 17 00:00:00 2001 From: Yinchu Xia Date: Wed, 13 Nov 2024 14:15:05 -0800 Subject: [PATCH] fix warning --- Cargo.lock | 436 ++++++++++++++++++--------- nes/src/apu.rs | 5 +- nes/src/base.rs | 8 +- nes/src/console.rs | 45 ++- nes/src/control_manager.rs | 4 +- nes/src/cpu.rs | 9 +- nes/src/debugger.rs | 127 ++++---- nes/src/device/standard_controler.rs | 6 +- nes/src/lib.rs | 3 +- nes/src/mapper/mod.rs | 92 +++--- nes/src/memory.rs | 4 +- nes/src/ppu.rs | 37 ++- nes/src/prg_rom.rs | 1 - nes/src/renderer/mod.rs | 47 +-- nes/src/renderer/webgl_renderer.rs | 8 +- nes/src/rewind_manager.rs | 4 +- nes/src/video_decoder.rs | 6 +- nes/src/video_filter/mod.rs | 6 +- util/src/lib.rs | 6 +- 19 files changed, 506 insertions(+), 348 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3cb5849..edece28 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "aho-corasick" -version = "0.7.15" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -41,23 +41,23 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "cfg-if" version = "1.0.0" @@ -66,13 +66,12 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "colored" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" dependencies = [ - "atty", "lazy_static", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -90,65 +89,46 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" -[[package]] -name = "crossbeam-channel" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.5" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" -dependencies = [ - "cfg-if", - "lazy_static", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "ctor" -version = "0.1.21" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "diff" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" [[package]] name = "difference" @@ -158,15 +138,15 @@ checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" [[package]] name = "either" -version = "1.6.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "env_logger" -version = "0.9.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" dependencies = [ "atty", "humantime", @@ -188,13 +168,13 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", - "wasi 0.10.0+wasi-snapshot-preview1", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -206,6 +186,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "humantime" version = "2.1.0" @@ -214,30 +200,27 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "itoa" -version = "0.4.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.106" +version = "0.2.162" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673" +checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" [[package]] name = "log" -version = "0.4.14" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if", -] +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "md5" @@ -247,18 +230,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.3.4" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" - -[[package]] -name = "memoffset" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" -dependencies = [ - "autocfg", -] +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "nes" @@ -270,39 +244,42 @@ dependencies = [ "env_logger", "log", "md5", - "rand 0.8.4", + "rand 0.8.5", ] [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] [[package]] name = "output_vt100" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9" +checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66" dependencies = [ "winapi", ] [[package]] name = "paste" -version = "1.0.5" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "ppv-lite86" -version = "0.2.15" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "pretty_assertions" @@ -330,18 +307,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.32" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.10" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -356,19 +333,18 @@ dependencies = [ "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", - "rand_hc 0.2.0", + "rand_hc", ] [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", - "rand_core 0.6.3", - "rand_hc 0.3.1", + "rand_core 0.6.4", ] [[package]] @@ -388,7 +364,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -402,11 +378,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.15", ] [[package]] @@ -418,45 +394,43 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core 0.6.3", -] - [[package]] name = "rayon" -version = "1.5.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "autocfg", - "crossbeam-deque", "either", "rayon-core", ] [[package]] name = "rayon-core" -version = "1.9.1" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "lazy_static", - "num_cpus", ] [[package]] name = "regex" -version = "1.4.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a26af418b574bd56588335b3a3659a65725d4e636eb1016c2f9e3b38c7cc759" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -465,9 +439,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustgym" @@ -522,49 +496,69 @@ version = "0.2.4" [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] -name = "scopeguard" -version = "1.1.0" +name = "serde" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +dependencies = [ + "serde_derive", +] [[package]] -name = "serde" -version = "1.0.130" +name = "serde_derive" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] [[package]] name = "serde_json" -version = "1.0.68" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "syn" -version = "1.0.81" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] name = "termcolor" -version = "1.1.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -579,10 +573,10 @@ dependencies = [ ] [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "unicode-ident" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "wasi" @@ -592,9 +586,9 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "winapi" @@ -614,11 +608,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -626,3 +620,163 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[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.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/nes/src/apu.rs b/nes/src/apu.rs index a6a0231..ce7f582 100644 --- a/nes/src/apu.rs +++ b/nes/src/apu.rs @@ -1,15 +1,14 @@ use crate::*; -use log::info; #[derive(Debug, Default)] pub struct Apu {} impl MemoryHandler for Apu { - fn read_byte(&mut self, addr: u16) -> u8 { + fn read_byte(&mut self, _addr: u16) -> u8 { 0 } - fn write_byte(&mut self, addr: u16, byte: u8) {} + fn write_byte(&mut self, _addr: u16, _byte: u8) {} } impl Apu { diff --git a/nes/src/base.rs b/nes/src/base.rs index 123d889..a1bf948 100644 --- a/nes/src/base.rs +++ b/nes/src/base.rs @@ -120,13 +120,13 @@ pub enum PpuAddressType { } pub struct CpuAddressInfo { - address: i32, - address_type: CpuAddressType, + _address: i32, + _address_type: CpuAddressType, } pub struct PpuAddressInfo { - address: i32, - address_type: PpuAddressType, + _address: i32, + _address_type: PpuAddressType, } pub enum EvalResultType { diff --git a/nes/src/console.rs b/nes/src/console.rs index 1e23492..254797a 100644 --- a/nes/src/console.rs +++ b/nes/src/console.rs @@ -1,17 +1,16 @@ use crate::*; -use std::any::{Any, TypeId}; #[derive(Default)] pub struct Console { - auto_save_manager: AutoSaveManager, - paused: bool, - stop: bool, - running: bool, - stop_code: i32, - pause_on_next_frame_requested: bool, - reset_run_timers: bool, - disable_oc_next_frame: bool, - initialized: bool, + _auto_save_manager: AutoSaveManager, + _paused: bool, + _stop: bool, + _running: bool, + _stop_code: i32, + _pause_on_next_frame_requested: bool, + _reset_run_timers: bool, + _disable_oc_next_frame: bool, + _initialized: bool, pub battery_manager: BatteryManager, pub save_state_manager: SaveStateManager, pub video_decoder: VideoDecoder, @@ -39,10 +38,10 @@ pub struct Console { } impl Console { - fn run_frame_with_run_ahead(&mut self, run_ahead_state: impl std::io::Write) { + fn run_frame_with_run_ahead(&mut self, _run_ahead_state: impl std::io::Write) { todo!() } - fn load_hd_pack(&mut self, rom_file: VirtualFile, patch: VirtualFile) { + fn load_hd_pack(&mut self, _rom_file: VirtualFile, _patch: VirtualFile) { todo!() } @@ -51,10 +50,10 @@ impl Console { } fn display_debug_information( &self, - last_frame: f64, - last_frame_min: &mut f64, - last_frame_max: &mut f64, - frame_durations: [f64; 60], + _last_frame: f64, + _last_frame_min: &mut f64, + _last_frame_max: &mut f64, + _frame_durations: [f64; 60], ) { todo!() } @@ -130,11 +129,11 @@ impl Console { todo!() } - pub fn input_barcode(&mut self, barcode: u64, digit_count: u64) { + pub fn input_barcode(&mut self, _barcode: u64, _digit_count: u64) { todo!() } - pub fn reset(&mut self, soft_reset: bool) { + pub fn reset(&mut self, _soft_reset: bool) { todo!() } @@ -142,11 +141,11 @@ impl Console { todo!() } - pub fn reload_rom(&mut self, for_power_cycle: bool) { + pub fn reload_rom(&mut self, _for_power_cycle: bool) { todo!() } - pub fn reset_components(&mut self, soft_reset: bool) { + pub fn reset_components(&mut self, _soft_reset: bool) { todo!() } @@ -162,11 +161,11 @@ impl Console { todo!() } - pub fn save_state(save_stream: impl std::io::Write) { + pub fn save_state(_save_stream: impl std::io::Write) { todo!() } - pub fn load_state(load_stream: impl std::io::Read) { + pub fn load_state(_load_stream: impl std::io::Read) { todo!() } @@ -194,7 +193,7 @@ impl Console { todo!() } - pub fn set_next_frame_overclock_status(&mut self, disabled: bool) { + pub fn set_next_frame_overclock_status(&mut self, _disabled: bool) { todo!() } diff --git a/nes/src/control_manager.rs b/nes/src/control_manager.rs index e4447ef..c7438e7 100644 --- a/nes/src/control_manager.rs +++ b/nes/src/control_manager.rs @@ -1,9 +1,7 @@ use crate::*; -use log::info; -use std::any::Any; use std::collections::HashMap; -const HOME: usize = 16; +// const HOME: usize = 16; pub enum ControllerType { None, StandardController, diff --git a/nes/src/cpu.rs b/nes/src/cpu.rs index 8149b8c..1268593 100644 --- a/nes/src/cpu.rs +++ b/nes/src/cpu.rs @@ -1,5 +1,4 @@ use crate::*; -use log::{debug, error, info}; macro_rules! iif { ($cond:expr, $iftrue:expr, $iffalse:expr) => { @@ -1157,7 +1156,7 @@ impl Cpu { Operand::Address(addr) } - pub fn run_dma_transfer(&mut self, offset: u8) { + pub fn run_dma_transfer(&mut self, _offset: u8) { todo!() } @@ -1165,7 +1164,7 @@ impl Cpu { todo!() } - pub fn set_debug_pc(value: u16) { + pub fn set_debug_pc(_value: u16) { todo!() } @@ -1212,7 +1211,7 @@ impl Cpu { } } - pub fn irq(console: &mut Console) { + pub fn irq(_console: &mut Console) { todo!() } @@ -1302,7 +1301,7 @@ fn test() { let rom = VirtualFile::new("Nes Test", NES_TEST); let mut console = Console::new(&rom, Box::new(BaseRenderer::default())); let testlog = include_str!("../test/nestest.log"); - debug!("{:02x?}", console.mapper.base_mapper().prg_rom); + log::debug!("{:02x?}", console.mapper.base_mapper().prg_rom); console.cpu.pc = 0xC000; for line in testlog.lines() { let pc = &line[0..4]; diff --git a/nes/src/debugger.rs b/nes/src/debugger.rs index 427a35c..b1a4729 100644 --- a/nes/src/debugger.rs +++ b/nes/src/debugger.rs @@ -58,38 +58,38 @@ pub struct Debugger { impl Debugger { fn process_breakpoints( &mut self, - breakpoint_type: BreakpointType, - operation_info: OperationInfo, - allow_break: bool, - allow_mark: bool, + _breakpoint_type: BreakpointType, + _operation_info: OperationInfo, + _allow_break: bool, + _allow_mark: bool, ) -> bool { todo!() } - fn process_all_break_breakpoints(&mut self, operation_info: &OperationInfo) { + fn process_all_break_breakpoints(&mut self, _operation_info: &OperationInfo) { todo!() } - fn add_callstack_frame(&mut self, source: u16, target: u16, flags: StackFrameFlags) { + fn add_callstack_frame(&mut self, _source: u16, _target: u16, _flags: StackFrameFlags) { todo!() } - fn update_callstack(&mut self, current_instruction: u8, addr: u32) { + fn update_callstack(&mut self, _current_instruction: u8, _addr: u32) { todo!() } - fn process_step_conditions(&mut self, addr: u16) { + fn process_step_conditions(&mut self, _addr: u16) { todo!() } fn sleep_until_resume( &mut self, - source: BreakSource, - breakpoint_id: u32, - breakpoint_type: BreakpointType, - breakpoint_address: u16, - breakpoint_value: u8, - memory_operation: MemoryOperation, + _source: BreakSource, + _breakpoint_id: u32, + _breakpoint_type: BreakpointType, + _breakpoint_address: u16, + _breakpoint_value: u8, + _memory_operation: MemoryOperation, ) { todo!() } @@ -122,15 +122,15 @@ impl Debugger { todo!() } - pub fn ppu_step(&mut self, count: u32) { + pub fn ppu_step(&mut self, _count: u32) { todo!() } - pub fn step(&mut self, count: u32, source: BreakSource) { + pub fn step(&mut self, _count: u32, _source: BreakSource) { todo!() } - pub fn step_cycles(&mut self, cycle_count: u32) { + pub fn step_cycles(&mut self, _cycle_count: u32) { todo!() } @@ -146,27 +146,32 @@ impl Debugger { todo!() } - pub fn break_immediately(&mut self, source: BreakSource) { + pub fn break_immediately(&mut self, _source: BreakSource) { todo!() } - pub fn break_on_scanline(&mut self, scanline: u16) { + pub fn break_on_scanline(&mut self, _scanline: u16) { todo!() } - pub fn is_mark_as_code(&self, relative_address: u16) -> bool { + pub fn is_mark_as_code(&self, _relative_address: u16) -> bool { todo!() } - pub fn set_next_statement(&mut self, addr: u16) { + pub fn set_next_statement(&mut self, _addr: u16) { todo!() } - pub fn set_ppu_viewer_scanline_cycle(&mut self, ppu_viewer_id: i32, scanline: i32, cycle: i32) { + pub fn set_ppu_viewer_scanline_cycle( + &mut self, + _ppu_viewer_id: i32, + _scanline: i32, + _cycle: i32, + ) { todo!() } - pub fn clear_ppu_viewer_settings(&mut self, ppu_viewer: i32) { + pub fn clear_ppu_viewer_settings(&mut self, _ppu_viewer: i32) { todo!() } @@ -194,34 +199,34 @@ impl Debugger { todo!() } - pub fn get_relative_cpu_address(addr: u32, cpu_address_type: CpuAddressType) -> i32 { + pub fn get_relative_cpu_address(_addr: u32, _cpu_address_type: CpuAddressType) -> i32 { todo!() } - pub fn get_relative_ppu_address(addr: u32, ppu_address_type: PpuAddressType) -> i32 { + pub fn get_relative_ppu_address(_addr: u32, _ppu_address_type: PpuAddressType) -> i32 { todo!() } - pub fn get_absolute_address(addr: u32) -> i32 { + pub fn get_absolute_address(_addr: u32) -> i32 { todo!() } - pub fn get_absolute_chr_address(addr: u32) -> i32 { + pub fn get_absolute_chr_address(_addr: u32) -> i32 { todo!() } - pub fn get_absolute_cpu_address_info(relative_addr: u32) -> CpuAddressInfo { + pub fn get_absolute_cpu_address_info(_relative_addr: u32) -> CpuAddressInfo { todo!() } - pub fn get_absolute_ppu_address_info(relative_addr: u32) -> PpuAddressInfo { + pub fn get_absolute_ppu_address_info(_relative_addr: u32) -> PpuAddressInfo { todo!() } pub fn evaluate_expression( - expression: String, - eval_result_type: EvalResultType, - use_cache: bool, + _expression: String, + _eval_result_type: EvalResultType, + _use_cache: bool, ) -> i32 { todo!() } @@ -236,43 +241,47 @@ impl Debugger { pub fn process_ram_operation( &mut self, - memory_operation: MemoryOperation, - addr: u16, - value: u8, + _memory_operation: MemoryOperation, + _addr: u16, + _value: u8, ) { todo!() } pub fn process_vram_operation( &mut self, - memory_operation: MemoryOperation, - addr: u16, - value: u8, + _memory_operation: MemoryOperation, + _addr: u16, + _value: u8, ) { todo!() } - pub fn set_last_frame_ppu_scool(addr: u16, x_scroll: u8, update_horizontal_scroll_only: bool) { + pub fn set_last_frame_ppu_scool( + _addr: u16, + _x_scroll: u8, + _update_horizontal_scroll_only: bool, + ) { todo!() } - pub fn process_interrupt(&mut self, cpu_addr: u16, dest_cpu_addr: u16, for_nmi: bool) { + pub fn process_interrupt(&mut self, _cpu_addr: u16, _dest_cpu_addr: u16, _for_nmi: bool) { todo!() } - pub fn add_trace(&mut self, log: &str) { + pub fn add_trace(&mut self, _log: &str) { todo!() } - pub fn set_free_state(&mut self, address: u32, frozen: bool) { + pub fn set_free_state(&mut self, _address: u32, _frozen: bool) { todo!() } - pub fn get_freeze_state(&self, length: u16) -> bool { + pub fn get_freeze_state(&self, _length: u16) -> bool { todo!() } - pub fn start_code_runner(&mut self, byte_code: &[u8]) { + pub fn start_code_runner(&mut self, _byte_code: &[u8]) { todo!() } @@ -288,23 +297,23 @@ impl Debugger { todo!() } - pub fn find_sub_entry_point(relative_address: u16) -> i32 { + pub fn find_sub_entry_point(_relative_address: u16) -> i32 { todo!() } - pub fn set_input_override(&mut self, port: u8, state: u32) { + pub fn set_input_override(&mut self, _port: u8, _state: u32) { todo!() } - pub fn load_script(&mut self, name: String, content: String, script_id: i32) -> i32 { + pub fn load_script(&mut self, _name: String, _content: String, _script_id: i32) -> i32 { todo!() } - pub fn remove_script(&mut self, script_id: i32) { + pub fn remove_script(&mut self, _script_id: i32) { todo!() } - pub fn get_script_log(&self, script_id: i32) -> &str { + pub fn get_script_log(&self, _script_id: i32) -> &str { todo!() } @@ -312,33 +321,33 @@ impl Debugger { todo!() } - pub fn process_script_save_state(&mut self, addr: u16, value: u8) { + pub fn process_script_save_state(&mut self, _addr: u16, _value: u8) { todo!() } pub fn process_cpu_operation( &mut self, - addr: u16, - value: u8, - memory_operation: MemoryOperation, + _addr: u16, + _value: u8, + _memory_operation: MemoryOperation, ) { todo!() } pub fn process_ppu_operation( &mut self, - addr: u16, - value: u8, - memory_operation: MemoryOperation, + _addr: u16, + _value: u8, + _memory_operation: MemoryOperation, ) { todo!() } - pub fn process_event(&mut self, event: Event) { + pub fn process_event(&mut self, _event: Event) { todo!() } - pub fn get_screen_pixel(x: u8, y: u8) -> u32 { + pub fn get_screen_pixel(_x: u8, _y: u8) -> u32 { todo!() } @@ -356,7 +365,7 @@ impl Debugger { } } - pub fn add_debug_event(&mut self, debug_event: DebugEvent) { + pub fn add_debug_event(&mut self, _debug_event: DebugEvent) { todo!() } } diff --git a/nes/src/device/standard_controler.rs b/nes/src/device/standard_controler.rs index 238d3e9..479bb40 100644 --- a/nes/src/device/standard_controler.rs +++ b/nes/src/device/standard_controler.rs @@ -1,7 +1,5 @@ use crate::*; -use bitflags::bitflags; use std::any::Any; -use std::convert::From; const STANDARD_MAPPING: [usize; 8] = [0, 1, 8, 9, 12, 13, 14, 15]; @@ -52,11 +50,11 @@ impl Device for StandardController { } impl MemoryHandler for StandardController { - fn read_byte(&mut self, addr: u16) -> u8 { + fn read_byte(&mut self, _addr: u16) -> u8 { todo!() } - fn write_byte(&mut self, addr: u16, byte: u8) { + fn write_byte(&mut self, _addr: u16, _byte: u8) { todo!() } } diff --git a/nes/src/lib.rs b/nes/src/lib.rs index 32e451c..59cbb22 100644 --- a/nes/src/lib.rs +++ b/nes/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(dead_code)] #![allow(clippy::collapsible_else_if)] #![allow(non_upper_case_globals)] use bitflags::bitflags; @@ -68,7 +69,6 @@ pub use auto_save_manager::*; pub use base::*; pub use battery_manager::*; pub use breakpoint::*; -pub use bus::*; pub use cheat_manager::*; pub use code_data_logger::*; pub use code_runner::*; @@ -105,7 +105,6 @@ pub use prg_rom::*; pub use profiler::*; pub use renderer::*; pub use rewind_manager::*; -pub use rewind_manager::*; pub use rom::*; pub use rotate_filter::*; pub use save_state_manager::*; diff --git a/nes/src/mapper/mod.rs b/nes/src/mapper/mod.rs index 274196b..e5817aa 100644 --- a/nes/src/mapper/mod.rs +++ b/nes/src/mapper/mod.rs @@ -90,15 +90,15 @@ pub trait Mapper { proto.prg_rom[addr as usize] = byte; } - fn read_vram(&mut self, addr: u16) -> u8 { + fn read_vram(&mut self, _addr: u16) -> u8 { todo!() } - fn write_vram(&mut self, addr: u16, byte: u8) { + fn write_vram(&mut self, _addr: u16, _byte: u8) { todo!() } - fn select_prg_page(&mut self, slot: u16, page: u16, prg_memory_type: PrgMemoryType) { + fn select_prg_page(&mut self, slot: u16, page: u16, _prg_memory_type: PrgMemoryType) { let start_addr = 0x8000 + slot * self.prg_page_size(); let end_addr = start_addr + (self.prg_page_size() - 1); debug!("prg start_addr 0x{:04X}", start_addr); @@ -115,7 +115,7 @@ pub trait Mapper { page_addr += 0x100; } } - fn select_chr_page(&mut self, slot: u16, page: u16, chr_memory_type: ChrMemoryType) { + fn select_chr_page(&mut self, slot: u16, page: u16, _chr_memory_type: ChrMemoryType) { let start_addr = slot * self.chr_page_size(); let end_addr = start_addr + (self.chr_page_size() - 1); debug!("chr start_addr {:04x}", start_addr); @@ -165,7 +165,7 @@ pub trait Mapper { } } - fn notify_vram_address_change(&mut self, addr: u16) {} + fn notify_vram_address_change(&mut self, _addr: u16) {} } impl dyn Mapper { @@ -230,7 +230,7 @@ impl BaseMapper { todo!() } - fn validate_address_range(&self, start_addr: u16, end_addr: u16) -> bool { + fn validate_address_range(&self, _start_addr: u16, _end_addr: u16) -> bool { todo!() } @@ -250,38 +250,38 @@ impl BaseMapper { todo!() } - fn write_register(&mut self, addr: usize, byte: u8) { + fn write_register(&mut self, _addr: usize, _byte: u8) { todo!() } - fn read_register(&mut self, addr: u16) -> u8 { + fn read_register(&mut self, _addr: u16) -> u8 { todo!() } fn set_cpu_memory_mapping( - start_addr: u16, - end_addr: u16, - page_number: u16, - prg_memory_type: PrgMemoryType, - access_type: i8, + _start_addr: u16, + _end_addr: u16, + _page_number: u16, + _prg_memory_type: PrgMemoryType, + _access_type: i8, ) { todo!() } - fn remove_cpu_memory_mapping(&mut self, start_addr: u16, end_addr: u16) { + fn remove_cpu_memory_mapping(&mut self, _start_addr: u16, _end_addr: u16) { todo!() } fn set_ppu_memory_mapping( - start_addr: u16, - end_addr: u16, - page_number: u16, - chr_memory_type: ChrMemoryType, + _start_addr: u16, + _end_addr: u16, + _page_number: u16, + _chr_memory_type: ChrMemoryType, ) { todo!() } - fn remove_ppu_memory_mapping(&mut self, start_addr: u16, end_addr: u16) { + fn remove_ppu_memory_mapping(&mut self, _start_addr: u16, _end_addr: u16) { todo!() } @@ -293,7 +293,7 @@ impl BaseMapper { todo!() } - fn get_power_on_byte(&self, default_value: u8) -> u8 { + fn get_power_on_byte(&self, _default_value: u8) -> u8 { todo!() } @@ -305,20 +305,20 @@ impl BaseMapper { todo!() } - fn initialize_chr_ram(&mut self, chr_ram_size: usize) { + fn initialize_chr_ram(&mut self, _chr_ram_size: usize) { todo!() } fn add_register_range( &mut self, - start_addr: u16, - end_addr: u16, - memory_operation: MemoryOperation, + _start_addr: u16, + _end_addr: u16, + _memory_operation: MemoryOperation, ) { todo!() } - fn remove_register_range(start_addr: u16, end_addr: u16, memory_operation: MemoryOperation) { + fn remove_register_range(_start_addr: u16, _end_addr: u16, _memory_operation: MemoryOperation) { todo!() } @@ -326,15 +326,15 @@ impl BaseMapper { todo!() } - fn get_nametable(&self, nametable_index: u8) -> &Vec { + fn get_nametable(&self, _nametable_index: u8) -> &Vec { todo!() } - fn set_nametable(&mut self, index: usize, nametable_index: u8) { + fn set_nametable(&mut self, _index: usize, _nametable_index: u8) { todo!() } - fn set_mirroring_type(&mut self, mirroring_type: MirroringType) { + fn set_mirroring_type(&mut self, _mirroring_type: MirroringType) { todo!() } @@ -368,7 +368,7 @@ impl BaseMapper { this } - pub fn reset(&mut self, soft_reset: bool) { + pub fn reset(&mut self, _soft_reset: bool) { todo!() } @@ -376,13 +376,13 @@ impl BaseMapper { todo!() } - pub fn set_nes_model(&mut self, model: NesModel) { + pub fn set_nes_model(&mut self, _model: NesModel) { todo!() } - pub fn process_cpu_clock(console: &mut Console) {} + pub fn process_cpu_clock(_console: &mut Console) {} - pub fn notify_vram_address_change(addr: u16) { + pub fn notify_vram_address_change(_addr: u16) { todo!() } @@ -390,31 +390,31 @@ impl BaseMapper { todo!() } - pub fn apply_samples(&mut self, buffer: Vec, volume: f64) { + pub fn apply_samples(&mut self, _buffer: Vec, _volume: f64) { todo!() } - pub fn read_ram(&mut self, addr: usize) { + pub fn read_ram(&mut self, _addr: usize) { todo!() } - pub fn write_ram(&mut self, addr: u16, byte: u8) { + pub fn write_ram(&mut self, _addr: u16, _byte: u8) { todo!() } - pub fn write_prg_ram(&mut self, addr: u16, byte: u8) { + pub fn write_prg_ram(&mut self, _addr: u16, _byte: u8) { todo!() } - pub fn read_vram(&mut self, addr: u16) -> u8 { + pub fn read_vram(&mut self, _addr: u16) -> u8 { todo!() } - pub fn write_vram(&mut self, addr: u16, byte: u8) { + pub fn write_vram(&mut self, _addr: u16, _byte: u8) { todo!() } - pub fn copy_chr_tile(&self, addr: u32, dest: &mut Vec) { + pub fn copy_chr_tile(&self, _addr: u32, _dest: &mut Vec) { todo!() } @@ -430,31 +430,31 @@ impl BaseMapper { todo!() } - pub fn get_memory_value(&mut self, memory_type: DebugMemoryType, addr: u16) -> u8 { + pub fn get_memory_value(&mut self, _memory_type: DebugMemoryType, _addr: u16) -> u8 { todo!() } - pub fn set_memory_value(&mut self, memory_type: DebugMemoryType, addr: u16, byte: u8) { + pub fn set_memory_value(&mut self, _memory_type: DebugMemoryType, _addr: u16, _byte: u8) { todo!() } - pub fn get_memory_size(&self, memory_type: DebugMemoryType) -> usize { + pub fn get_memory_size(&self, _memory_type: DebugMemoryType) -> usize { todo!() } - pub fn copy_memory(&self, debug_memory: DebugMemoryType, buffer: &mut Vec) { + pub fn copy_memory(&self, _debug_memory: DebugMemoryType, _buffer: &mut Vec) { todo!() } - pub fn get_cpu_absolute_address_and_type(&self, relative_addr: u32) -> CpuAddressInfo { + pub fn get_cpu_absolute_address_and_type(&self, _relative_addr: u32) -> CpuAddressInfo { todo!() } - pub fn get_ppu_absolute_address_and_type(&self, relative_addr: u32) -> PpuAddressInfo { + pub fn get_ppu_absolute_address_and_type(&self, _relative_addr: u32) -> PpuAddressInfo { todo!() } - pub fn to_absolute_address(&self, addr: u16) -> usize { + pub fn to_absolute_address(&self, _addr: u16) -> usize { todo!() } } diff --git a/nes/src/memory.rs b/nes/src/memory.rs index dc948ad..0e5a83b 100644 --- a/nes/src/memory.rs +++ b/nes/src/memory.rs @@ -1,6 +1,4 @@ use crate::*; -use log::info; -use std::cell::RefCell; pub trait MemoryHandler { fn read_byte(&mut self, addr: u16) -> u8; @@ -75,7 +73,7 @@ impl MemoryHandler for InternalRam { pub struct MemoryManager {} impl MemoryManager { - pub fn reset(&mut self, soft_reset: bool) { + pub fn reset(&mut self, _soft_reset: bool) { todo!() } } diff --git a/nes/src/ppu.rs b/nes/src/ppu.rs index cca6c7e..935a33d 100644 --- a/nes/src/ppu.rs +++ b/nes/src/ppu.rs @@ -1,5 +1,4 @@ use crate::*; -use log::{debug, info}; #[derive(Debug)] pub enum PpuRegister { @@ -208,11 +207,11 @@ impl Ppu { self.control_flags = PpuControlFlags::from_bits(byte).unwrap(); } - fn set_mask_register(&mut self, byte: u8) { + fn set_mask_register(&mut self, _byte: u8) { todo!() } - fn process_tmp_addr_scroll_glitch(normal_addr: u16, value: u16, mask: u16) { + fn process_tmp_addr_scroll_glitch(_normal_addr: u16, _value: u16, _mask: u16) { todo!() } @@ -549,11 +548,11 @@ impl Ppu { fn load_sprite( &mut self, - sprite_y: u8, - tile_index: u8, - attributes: u8, - sprite_x: u8, - extra_sprite: bool, + _sprite_y: u8, + _tile_index: u8, + _attributes: u8, + _sprite_x: u8, + _extra_sprite: bool, ) { todo!() } @@ -571,11 +570,11 @@ impl Ppu { self.high_bit_shift <<= 1; } - fn read_sprite_ram(&mut self, addr: u8) -> u8 { + fn read_sprite_ram(&mut self, _addr: u8) -> u8 { todo!() } - fn write_sprite_ram(&mut self, addr: u8, byte: u8) { + fn write_sprite_ram(&mut self, _addr: u8, _byte: u8) { todo!() } @@ -636,7 +635,7 @@ impl Ppu { if ppu.has_sprite[ppu.cycle as usize] && ppu.cycle > ppu.minimum_draw_sprite_cycle { for i in 0..ppu.sprite_count as usize { let shift = ppu.cycle - ppu.sprite_tiles[i].sprite_x as u32 - 1; - if shift >= 0 && shift < 8 { + if shift < 8 { let sprite_color = if ppu.sprite_tiles[i].horizontal_mirror { (ppu.sprite_tiles[i].low_byte >> shift) & 0x01 | ((ppu.sprite_tiles[i].high_byte >> shift) & 0x01) << 1 @@ -713,11 +712,11 @@ impl Ppu { console.mapper.notify_vram_address_change(addr); } - fn read_vram(&mut self, addr: u16) -> u8 { + fn read_vram(&mut self, _addr: u16) -> u8 { todo!() } - fn write_vram(&mut self, addr: u16, byte: u8) { + fn write_vram(&mut self, _addr: u16, _byte: u8) { todo!() } @@ -787,11 +786,11 @@ impl Ppu { todo!() } - pub fn get_screen_buffer(&self, previous_buffer: bool) -> &[u16] { + pub fn get_screen_buffer(&self, _previous_buffer: bool) -> &[u16] { todo!() } - pub fn debug_copy_output_buffer(&mut self, target: &[u16]) { + pub fn debug_copy_output_buffer(&mut self, _target: &[u16]) { todo!() } @@ -835,11 +834,11 @@ impl Ppu { } } - pub fn read_palette_ram(&mut self, addr: u16) -> u8 { + pub fn read_palette_ram(&mut self, _addr: u16) -> u8 { todo!() } - pub fn write_palette_ram(&mut self, addr: u16, byte: u8) { + pub fn write_palette_ram(&mut self, _addr: u16, _byte: u8) { todo!() } @@ -914,7 +913,7 @@ impl Ppu { todo!() } - pub fn get_pixel_brightness(&self, x: u8, y: u8) -> u32 { + pub fn get_pixel_brightness(&self, _x: u8, _y: u8) -> u32 { todo!() } @@ -922,7 +921,7 @@ impl Ppu { todo!() } - pub fn get_pixel(&self, x: u8, y: u8) -> u16 { + pub fn get_pixel(&self, _x: u8, _y: u8) -> u16 { todo!() } diff --git a/nes/src/prg_rom.rs b/nes/src/prg_rom.rs index d7cddd5..ef3c35a 100644 --- a/nes/src/prg_rom.rs +++ b/nes/src/prg_rom.rs @@ -1,4 +1,3 @@ -use crate::*; use std::fmt; pub struct PrgRom { diff --git a/nes/src/renderer/mod.rs b/nes/src/renderer/mod.rs index 4efc90a..ede0221 100644 --- a/nes/src/renderer/mod.rs +++ b/nes/src/renderer/mod.rs @@ -17,15 +17,15 @@ pub trait RenderingDevice { #[derive(Default)] pub struct BaseRenderer { - fps_timer: Timer, - last_frame_count: u32, - last_rendered_frame_count: u32, - current_fps: u32, - current_rendered_fps: u32, + _fps_timer: Timer, + _last_frame_count: u32, + _last_rendered_frame_count: u32, + _current_fps: u32, + _current_rendered_fps: u32, } impl RenderingDevice for BaseRenderer { - fn update_frame(&self, framebuffer: &mut [u8], width: usize, height: usize) { + fn update_frame(&self, _framebuffer: &mut [u8], _width: usize, _height: usize) { todo!(); } fn render(&self) { @@ -36,9 +36,9 @@ impl RenderingDevice for BaseRenderer { } fn set_fullscreen_mode( &mut self, - fullscreen: bool, - monitor_width: usize, - monitor_height: usize, + _fullscreen: bool, + _monitor_width: usize, + _monitor_height: usize, ) { todo!(); } @@ -49,15 +49,15 @@ impl BaseRenderer { todo!(); } - fn wrap_text(utf8_text: String, max_line_width: f64, line_count: u32) -> String { + fn wrap_text(_utf8_text: String, _max_line_width: f64, _line_count: u32) -> String { todo!() } - fn measure_string(&self, text: String) -> f64 { + fn measure_string(&self, _text: String) -> f64 { todo!() } - fn contains_character(&self, character: char) -> bool { + fn contains_character(&self, _character: char) -> bool { todo!() } @@ -65,7 +65,7 @@ impl BaseRenderer { todo!() } - fn display_message(&self, title: String, message: String) { + fn display_message(&self, _title: String, _message: String) { todo!() } @@ -73,27 +73,36 @@ impl BaseRenderer { todo!(); } - fn draw_string(&self, message: String, x: i32, y: i32, r: u8, g: u8, b: u8, opacity: u8) { + fn draw_string( + &self, + _message: String, + _x: i32, + _y: i32, + _r: u8, + _g: u8, + _b: u8, + _opacity: u8, + ) { todo!(); } - fn show_fps_counter(console: &mut Console, line_number: i32) { + fn show_fps_counter(_console: &mut Console, _line_number: i32) { todo!(); } - fn show_lag_counter(console: &mut Console, line_number: i32) { + fn show_lag_counter(_console: &mut Console, _line_number: i32) { todo!(); } - fn show_frame_counter(console: &mut Console, line_number: i32) { + fn show_frame_counter(_console: &mut Console, _line_number: i32) { todo!(); } - fn show_game_counter(console: &mut Console, line_number: i32) { + fn show_game_counter(_console: &mut Console, _line_number: i32) { todo!(); } - fn show_counters(console: &mut Console) { + fn show_counters(_console: &mut Console) { todo!(); } } diff --git a/nes/src/renderer/webgl_renderer.rs b/nes/src/renderer/webgl_renderer.rs index 510d30b..abe76da 100644 --- a/nes/src/renderer/webgl_renderer.rs +++ b/nes/src/renderer/webgl_renderer.rs @@ -10,7 +10,7 @@ impl WebGlRenderer { } impl RenderingDevice for WebGlRenderer { - fn update_frame(&self, framebuffer: &mut [u8], width: usize, height: usize) { + fn update_frame(&self, _framebuffer: &mut [u8], _width: usize, _height: usize) { todo!(); } fn render(&self) { @@ -21,9 +21,9 @@ impl RenderingDevice for WebGlRenderer { } fn set_fullscreen_mode( &mut self, - fullscreen: bool, - monitor_width: usize, - monitor_height: usize, + _fullscreen: bool, + _monitor_width: usize, + _monitor_height: usize, ) { todo!(); } diff --git a/nes/src/rewind_manager.rs b/nes/src/rewind_manager.rs index 35beaf2..93ba38e 100644 --- a/nes/src/rewind_manager.rs +++ b/nes/src/rewind_manager.rs @@ -1,5 +1,3 @@ -use crate::ControlManager; - #[derive(Default)] pub struct RewindManager {} @@ -9,7 +7,7 @@ impl RewindManager { this } - pub fn send_frame(&mut self, ppu_output_buffer: &mut Vec, synchronous: bool) { + pub fn send_frame(&mut self, _ppu_output_buffer: &mut Vec, _synchronous: bool) { todo!() } } diff --git a/nes/src/video_decoder.rs b/nes/src/video_decoder.rs index 40a5fba..4058303 100644 --- a/nes/src/video_decoder.rs +++ b/nes/src/video_decoder.rs @@ -46,7 +46,7 @@ impl VideoDecoder { console.video_decoder.frame_number, ); } - let screen_size = console.video_decoder.get_screen_size(true); + let _screen_size = console.video_decoder.get_screen_size(true); console .rewind_manager @@ -57,7 +57,7 @@ impl VideoDecoder { todo!() } - fn get_screen_size(&self, ignore_scale: bool) -> ScreenSize { + fn get_screen_size(&self, _ignore_scale: bool) -> ScreenSize { todo!() } @@ -70,7 +70,7 @@ impl VideoDecoder { console.video_decoder.frame_count += 1; } - fn update_frame(&self, ppu_output_buffer: &mut Vec) { + fn update_frame(&self, _ppu_output_buffer: &mut Vec) { todo!() } diff --git a/nes/src/video_filter/mod.rs b/nes/src/video_filter/mod.rs index 4d5d5b0..1c9ddb1 100644 --- a/nes/src/video_filter/mod.rs +++ b/nes/src/video_filter/mod.rs @@ -8,7 +8,7 @@ pub trait VideoFilter { fn base_video_filter_mut(&mut self) -> &mut BaseVideoFilter; fn base_video_filter(&self) -> &BaseVideoFilter; - fn apply_filter(&self, ppu_output_buffer: &mut Vec) { + fn apply_filter(&self, _ppu_output_buffer: &mut Vec) { todo!() } @@ -20,11 +20,11 @@ pub trait VideoFilter { todo!() } - fn send_frame(&self, ppu_output_buffer: &mut Vec, frame_number: u32) { + fn send_frame(&self, _ppu_output_buffer: &mut Vec, _frame_number: u32) { todo!() } - fn take_screenshot(&self, rom_name: String, filter_type: VideoFilterType) { + fn take_screenshot(&self, _rom_name: String, _filter_type: VideoFilterType) { todo!() } diff --git a/util/src/lib.rs b/util/src/lib.rs index e660a28..03158e7 100644 --- a/util/src/lib.rs +++ b/util/src/lib.rs @@ -8,12 +8,12 @@ mod test_gen; mod tree; mod unionfind; -pub use crate::adventofcode::*; -pub use crate::data::*; +// pub use crate::adventofcode::*; +// pub use crate::data::*; pub use crate::graph::*; pub use crate::list::*; pub use crate::nested_integer::*; pub use crate::read::*; -pub use crate::test_gen::*; +// pub use crate::test_gen::*; pub use crate::tree::*; pub use crate::unionfind::*;