diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9e5254d..4ace744 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -33,6 +33,11 @@ jobs: - uses: actions/checkout@v4 + - name: Format check + run: cargo fmt --all -- --check + - name: Clippy check + run: cargo clippy --all --all-targets --all-features -- -D warnings + # breaks for now since Cargo.lock is in a new version (4) # - uses: actions-rs/audit-check@v1 # with: @@ -52,7 +57,7 @@ jobs: RUSTC_WRAPPER: "sccache" # afterwards, upload the report to codecov - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} files: lcov.info diff --git a/plastic_core/src/cartridge/mappers/mapper10.rs b/plastic_core/src/cartridge/mappers/mapper10.rs index dab4bb9..ab3242b 100644 --- a/plastic_core/src/cartridge/mappers/mapper10.rs +++ b/plastic_core/src/cartridge/mappers/mapper10.rs @@ -65,10 +65,6 @@ pub struct Mapper10 { /// +- Nametable mirroring (0: vertical; 1: horizontal) mirroring_vertical: bool, - /// ($C000-$DFFE, even) - /// the value to reload `irq_counter` when it reaches zero or when asked - /// to be reloaded from `($C001-$DFFF, odd)` - /// is using CHR RAM? is_chr_ram: bool, diff --git a/plastic_core/src/cartridge/mappers/mapper9.rs b/plastic_core/src/cartridge/mappers/mapper9.rs index 8164a78..8cfcf47 100644 --- a/plastic_core/src/cartridge/mappers/mapper9.rs +++ b/plastic_core/src/cartridge/mappers/mapper9.rs @@ -65,10 +65,6 @@ pub struct Mapper9 { /// +- Nametable mirroring (0: vertical; 1: horizontal) mirroring_vertical: bool, - /// ($C000-$DFFE, even) - /// the value to reload `irq_counter` when it reaches zero or when asked - /// to be reloaded from `($C001-$DFFF, odd)` - /// is using CHR RAM? is_chr_ram: bool, diff --git a/plastic_core/src/cpu6502/mod.rs b/plastic_core/src/cpu6502/mod.rs index 8466491..fc9d741 100644 --- a/plastic_core/src/cpu6502/mod.rs +++ b/plastic_core/src/cpu6502/mod.rs @@ -1443,7 +1443,7 @@ struct WrapperReader<'a, R: Read> { pub inner: &'a mut R, } -impl<'a, R: Read> Read for WrapperReader<'a, R> { +impl Read for WrapperReader<'_, R> { fn read(&mut self, buf: &mut [u8]) -> std::io::Result { self.inner.read(buf) } diff --git a/plastic_core/src/misc.rs b/plastic_core/src/misc.rs index fd649ce..b283011 100644 --- a/plastic_core/src/misc.rs +++ b/plastic_core/src/misc.rs @@ -8,6 +8,12 @@ pub struct MovingAverage { sum: f64, } +impl Default for MovingAverage { + fn default() -> Self { + Self::new() + } +} + impl MovingAverage { pub fn new() -> Self { Self { diff --git a/plastic_core/src/ppu2c02/sprite.rs b/plastic_core/src/ppu2c02/sprite.rs index 59ea691..cc4d2c1 100644 --- a/plastic_core/src/ppu2c02/sprite.rs +++ b/plastic_core/src/ppu2c02/sprite.rs @@ -65,9 +65,8 @@ impl Sprite { /// for 8x8: /// use the byte normally as index into the pattern table - + /// /// for 8x16: - /// 76543210 /// |||||||| /// |||||||+- Bank ($0000 or $1000) of tiles