Skip to content
Snippets Groups Projects
Commit 3b9e8769 authored by Vivian Roest's avatar Vivian Roest :gay_pride_flag:
Browse files

Merge branch 'pub_rom' into 'main'

make roms public

See merge request software-fundamentals/nes-emulator-testing!1
parents e827f664 0b301983
Branches
No related tags found
1 merge request!1make roms public
...@@ -446,9 +446,9 @@ dependencies = [ ...@@ -446,9 +446,9 @@ dependencies = [
[[package]] [[package]]
name = "inplace_it" name = "inplace_it"
version = "0.3.4" version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67f0347836f3f6362c1e7efdadde2b1c4b4556d211310b70631bae7eb692070b" checksum = "e567468c50f3d4bc7397702e09b380139f9b9288b4e909b070571007f8b5bf78"
[[package]] [[package]]
name = "instant" name = "instant"
...@@ -464,9 +464,9 @@ dependencies = [ ...@@ -464,9 +464,9 @@ dependencies = [
[[package]] [[package]]
name = "itertools" name = "itertools"
version = "0.10.3" version = "0.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
dependencies = [ dependencies = [
"either", "either",
] ]
...@@ -479,9 +479,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" ...@@ -479,9 +479,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.59" version = "0.3.60"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47"
dependencies = [ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
...@@ -504,9 +504,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" ...@@ -504,9 +504,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.132" version = "0.2.135"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c"
[[package]] [[package]]
name = "libloading" name = "libloading"
...@@ -520,9 +520,9 @@ dependencies = [ ...@@ -520,9 +520,9 @@ dependencies = [
[[package]] [[package]]
name = "lock_api" name = "lock_api"
version = "0.4.8" version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390" checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"scopeguard", "scopeguard",
...@@ -759,9 +759,9 @@ dependencies = [ ...@@ -759,9 +759,9 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.13.1" version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1"
[[package]] [[package]]
name = "parking_lot" name = "parking_lot"
...@@ -790,9 +790,9 @@ dependencies = [ ...@@ -790,9 +790,9 @@ dependencies = [
[[package]] [[package]]
name = "percent-encoding" name = "percent-encoding"
version = "2.1.0" version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
[[package]] [[package]]
name = "pixels" name = "pixels"
...@@ -833,18 +833,18 @@ dependencies = [ ...@@ -833,18 +833,18 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.43" version = "1.0.46"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "profiling" name = "profiling"
version = "1.0.6" version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f61dcf0b917cd75d4521d7343d1ffff3d1583054133c9b5cbea3375c703c40d" checksum = "74605f360ce573babfe43964cbe520294dcb081afbf8c108fc6e23036b4da2df"
[[package]] [[package]]
name = "quote" name = "quote"
...@@ -914,9 +914,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" ...@@ -914,9 +914,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.144" version = "1.0.145"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b"
[[package]] [[package]]
name = "slotmap" name = "slotmap"
...@@ -929,9 +929,9 @@ dependencies = [ ...@@ -929,9 +929,9 @@ dependencies = [
[[package]] [[package]]
name = "smallvec" name = "smallvec"
version = "1.9.0" version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
[[package]] [[package]]
name = "smithay-client-toolkit" name = "smithay-client-toolkit"
...@@ -970,9 +970,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" ...@@ -970,9 +970,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.99" version = "1.0.102"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
...@@ -990,18 +990,18 @@ dependencies = [ ...@@ -990,18 +990,18 @@ dependencies = [
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.32" version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.32" version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
...@@ -1031,7 +1031,7 @@ dependencies = [ ...@@ -1031,7 +1031,7 @@ dependencies = [
[[package]] [[package]]
name = "tudelft-nes-test" name = "tudelft-nes-test"
version = "1.1.4" version = "1.1.5"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"log", "log",
...@@ -1050,15 +1050,15 @@ dependencies = [ ...@@ -1050,15 +1050,15 @@ dependencies = [
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.3" version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
[[package]] [[package]]
name = "unicode-width" name = "unicode-width"
version = "0.1.9" version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
[[package]] [[package]]
name = "version_check" name = "version_check"
...@@ -1074,9 +1074,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" ...@@ -1074,9 +1074,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]] [[package]]
name = "wasm-bindgen" name = "wasm-bindgen"
version = "0.2.82" version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"wasm-bindgen-macro", "wasm-bindgen-macro",
...@@ -1084,9 +1084,9 @@ dependencies = [ ...@@ -1084,9 +1084,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-backend" name = "wasm-bindgen-backend"
version = "0.2.82" version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142"
dependencies = [ dependencies = [
"bumpalo", "bumpalo",
"log", "log",
...@@ -1099,9 +1099,9 @@ dependencies = [ ...@@ -1099,9 +1099,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-futures" name = "wasm-bindgen-futures"
version = "0.4.32" version = "0.4.33"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"js-sys", "js-sys",
...@@ -1111,9 +1111,9 @@ dependencies = [ ...@@ -1111,9 +1111,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.82" version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810"
dependencies = [ dependencies = [
"quote", "quote",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
...@@ -1121,9 +1121,9 @@ dependencies = [ ...@@ -1121,9 +1121,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro-support" name = "wasm-bindgen-macro-support"
version = "0.2.82" version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
...@@ -1134,9 +1134,9 @@ dependencies = [ ...@@ -1134,9 +1134,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-shared" name = "wasm-bindgen-shared"
version = "0.2.82" version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f"
[[package]] [[package]]
name = "wayland-client" name = "wayland-client"
......
[package] [package]
name = "tudelft-nes-test" name = "tudelft-nes-test"
version = "1.1.4" version = "1.1.5"
edition = "2021" edition = "2021"
authors = [ authors = [
"Victor Roest <victor@xirion.net>", "Victor Roest <victor@xirion.net>",
...@@ -15,7 +15,7 @@ license = "MIT" ...@@ -15,7 +15,7 @@ license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
tudelft-nes-ppu = "1.0.4" tudelft-nes-ppu = "1.0"
thiserror = "1.0.32" thiserror = "1.0"
bitflags = "1.3.2" bitflags = "1.3"
log = "0.4.17" log = "0.4"
...@@ -13,6 +13,15 @@ mod nestest; ...@@ -13,6 +13,15 @@ mod nestest;
use crate::nestest::nestest_status_code; use crate::nestest::nestest_status_code;
/// Raw bytes for the all_instr rom
pub const ROM_ALL_INSTR: &[u8] = include_bytes!("roms/all_instrs.nes");
/// Raw bytes for the nestest rom
pub const ROM_NESTEST: &[u8] = include_bytes!("roms/nestest.nes");
/// Raw bytes for the nrom rom
pub const ROM_NROM_TEST: &[u8] = include_bytes!("roms/nrom-test.nes");
/// Raw bytes for the official_only rom
pub const ROM_OFFICIAL_ONLY: &[u8] = include_bytes!("roms/official_only.nes");
/// Implement this trait to run our test on our CPU via the [`run_tests`] function. /// Implement this trait to run our test on our CPU via the [`run_tests`] function.
pub trait TestableCpu: Cpu + Sized + 'static { pub trait TestableCpu: Cpu + Sized + 'static {
/// This function is used by the test suite to get a handle on your CPU /// This function is used by the test suite to get a handle on your CPU
...@@ -86,9 +95,9 @@ pub fn run_tests<T: TestableCpu>(selector: TestSelector) -> Result<(), String> { ...@@ -86,9 +95,9 @@ pub fn run_tests<T: TestableCpu>(selector: TestSelector) -> Result<(), String> {
/// https://github.com/christopherpow/nes-test-roms/tree/master/instr_test-v5 /// https://github.com/christopherpow/nes-test-roms/tree/master/instr_test-v5
fn all_instrs<T: TestableCpu + 'static>(only_official: bool) -> Result<(), String> { fn all_instrs<T: TestableCpu + 'static>(only_official: bool) -> Result<(), String> {
let (rom, limit) = if only_official { let (rom, limit) = if only_official {
(include_bytes!("roms/official_only.nes"), 350) (ROM_OFFICIAL_ONLY, 350)
} else { } else {
(include_bytes!("roms/all_instrs.nes"), 500) (ROM_ALL_INSTR, 500)
}; };
let handle = thread::spawn(move || { let handle = thread::spawn(move || {
...@@ -152,7 +161,7 @@ fn all_instrs<T: TestableCpu + 'static>(only_official: bool) -> Result<(), Strin ...@@ -152,7 +161,7 @@ fn all_instrs<T: TestableCpu + 'static>(only_official: bool) -> Result<(), Strin
/// Runs the nestest rom: /// Runs the nestest rom:
/// https://github.com/christopherpow/nes-test-roms/blob/master/other/nestest.nes /// https://github.com/christopherpow/nes-test-roms/blob/master/other/nestest.nes
fn nestest<T: TestableCpu + 'static>() -> Result<(), String> { fn nestest<T: TestableCpu + 'static>() -> Result<(), String> {
let rom = include_bytes!("roms/nestest.nes"); let rom = ROM_NESTEST;
let handle = thread::spawn(|| { let handle = thread::spawn(|| {
// TODO: make initial program counter obsolete by modifying nestest // TODO: make initial program counter obsolete by modifying nestest
...@@ -182,7 +191,7 @@ fn nestest<T: TestableCpu + 'static>() -> Result<(), String> { ...@@ -182,7 +191,7 @@ fn nestest<T: TestableCpu + 'static>() -> Result<(), String> {
/// runs our own nrom test rom /// runs our own nrom test rom
/// https://gitlab.ewi.tudelft.nl/software-fundamentals/nes-nrom-test /// https://gitlab.ewi.tudelft.nl/software-fundamentals/nes-nrom-test
fn nrom_test<T: TestableCpu + 'static>() -> Result<(), String> { fn nrom_test<T: TestableCpu + 'static>() -> Result<(), String> {
let rom = include_bytes!("roms/nrom-test.nes"); let rom = ROM_NROM_TEST;
let handle = thread::spawn(|| { let handle = thread::spawn(|| {
let mut cpu = T::get_cpu(rom).map_err(|i| TestError::Custom(i.to_string()))?; let mut cpu = T::get_cpu(rom).map_err(|i| TestError::Custom(i.to_string()))?;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment