Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
warycat committed Nov 13, 2024
1 parent 770a15b commit 0b7fabc
Show file tree
Hide file tree
Showing 19 changed files with 506 additions and 348 deletions.
436 changes: 295 additions & 141 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions nes/src/apu.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions nes/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
45 changes: 22 additions & 23 deletions nes/src/console.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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!()
}

Expand All @@ -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!()
}
Expand Down Expand Up @@ -130,23 +129,23 @@ 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!()
}

pub fn power_cycle(&mut self) {
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!()
}

Expand All @@ -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!()
}

Expand Down Expand Up @@ -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!()
}

Expand Down
4 changes: 1 addition & 3 deletions nes/src/control_manager.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
9 changes: 4 additions & 5 deletions nes/src/cpu.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::*;
use log::{debug, error, info};

macro_rules! iif {
($cond:expr, $iftrue:expr, $iffalse:expr) => {
Expand Down Expand Up @@ -1157,15 +1156,15 @@ impl Cpu {
Operand::Address(addr)
}

pub fn run_dma_transfer(&mut self, offset: u8) {
pub fn run_dma_transfer(&mut self, _offset: u8) {
todo!()
}

pub fn start_dmc_transfer(&mut self) {
todo!()
}

pub fn set_debug_pc(value: u16) {
pub fn set_debug_pc(_value: u16) {
todo!()
}

Expand Down Expand Up @@ -1212,7 +1211,7 @@ impl Cpu {
}
}

pub fn irq(console: &mut Console) {
pub fn irq(_console: &mut Console) {
todo!()
}

Expand Down Expand Up @@ -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];
Expand Down
Loading

0 comments on commit 0b7fabc

Please sign in to comment.