Skip to content

Commit 0b7fabc

Browse files
committed
fix warning
1 parent 770a15b commit 0b7fabc

19 files changed

+506
-348
lines changed

Diff for: Cargo.lock

+295-141
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: nes/src/apu.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
use crate::*;
2-
use log::info;
32

43
#[derive(Debug, Default)]
54
pub struct Apu {}
65

76
impl MemoryHandler for Apu {
8-
fn read_byte(&mut self, addr: u16) -> u8 {
7+
fn read_byte(&mut self, _addr: u16) -> u8 {
98
0
109
}
1110

12-
fn write_byte(&mut self, addr: u16, byte: u8) {}
11+
fn write_byte(&mut self, _addr: u16, _byte: u8) {}
1312
}
1413

1514
impl Apu {

Diff for: nes/src/base.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ pub enum PpuAddressType {
120120
}
121121

122122
pub struct CpuAddressInfo {
123-
address: i32,
124-
address_type: CpuAddressType,
123+
_address: i32,
124+
_address_type: CpuAddressType,
125125
}
126126

127127
pub struct PpuAddressInfo {
128-
address: i32,
129-
address_type: PpuAddressType,
128+
_address: i32,
129+
_address_type: PpuAddressType,
130130
}
131131

132132
pub enum EvalResultType {

Diff for: nes/src/console.rs

+22-23
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
use crate::*;
2-
use std::any::{Any, TypeId};
32

43
#[derive(Default)]
54
pub struct Console {
6-
auto_save_manager: AutoSaveManager,
7-
paused: bool,
8-
stop: bool,
9-
running: bool,
10-
stop_code: i32,
11-
pause_on_next_frame_requested: bool,
12-
reset_run_timers: bool,
13-
disable_oc_next_frame: bool,
14-
initialized: bool,
5+
_auto_save_manager: AutoSaveManager,
6+
_paused: bool,
7+
_stop: bool,
8+
_running: bool,
9+
_stop_code: i32,
10+
_pause_on_next_frame_requested: bool,
11+
_reset_run_timers: bool,
12+
_disable_oc_next_frame: bool,
13+
_initialized: bool,
1514
pub battery_manager: BatteryManager,
1615
pub save_state_manager: SaveStateManager,
1716
pub video_decoder: VideoDecoder,
@@ -39,10 +38,10 @@ pub struct Console {
3938
}
4039

4140
impl Console {
42-
fn run_frame_with_run_ahead(&mut self, run_ahead_state: impl std::io::Write) {
41+
fn run_frame_with_run_ahead(&mut self, _run_ahead_state: impl std::io::Write) {
4342
todo!()
4443
}
45-
fn load_hd_pack(&mut self, rom_file: VirtualFile, patch: VirtualFile) {
44+
fn load_hd_pack(&mut self, _rom_file: VirtualFile, _patch: VirtualFile) {
4645
todo!()
4746
}
4847

@@ -51,10 +50,10 @@ impl Console {
5150
}
5251
fn display_debug_information(
5352
&self,
54-
last_frame: f64,
55-
last_frame_min: &mut f64,
56-
last_frame_max: &mut f64,
57-
frame_durations: [f64; 60],
53+
_last_frame: f64,
54+
_last_frame_min: &mut f64,
55+
_last_frame_max: &mut f64,
56+
_frame_durations: [f64; 60],
5857
) {
5958
todo!()
6059
}
@@ -130,23 +129,23 @@ impl Console {
130129
todo!()
131130
}
132131

133-
pub fn input_barcode(&mut self, barcode: u64, digit_count: u64) {
132+
pub fn input_barcode(&mut self, _barcode: u64, _digit_count: u64) {
134133
todo!()
135134
}
136135

137-
pub fn reset(&mut self, soft_reset: bool) {
136+
pub fn reset(&mut self, _soft_reset: bool) {
138137
todo!()
139138
}
140139

141140
pub fn power_cycle(&mut self) {
142141
todo!()
143142
}
144143

145-
pub fn reload_rom(&mut self, for_power_cycle: bool) {
144+
pub fn reload_rom(&mut self, _for_power_cycle: bool) {
146145
todo!()
147146
}
148147

149-
pub fn reset_components(&mut self, soft_reset: bool) {
148+
pub fn reset_components(&mut self, _soft_reset: bool) {
150149
todo!()
151150
}
152151

@@ -162,11 +161,11 @@ impl Console {
162161
todo!()
163162
}
164163

165-
pub fn save_state(save_stream: impl std::io::Write) {
164+
pub fn save_state(_save_stream: impl std::io::Write) {
166165
todo!()
167166
}
168167

169-
pub fn load_state(load_stream: impl std::io::Read) {
168+
pub fn load_state(_load_stream: impl std::io::Read) {
170169
todo!()
171170
}
172171

@@ -194,7 +193,7 @@ impl Console {
194193
todo!()
195194
}
196195

197-
pub fn set_next_frame_overclock_status(&mut self, disabled: bool) {
196+
pub fn set_next_frame_overclock_status(&mut self, _disabled: bool) {
198197
todo!()
199198
}
200199

Diff for: nes/src/control_manager.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
use crate::*;
2-
use log::info;
3-
use std::any::Any;
42
use std::collections::HashMap;
53

6-
const HOME: usize = 16;
4+
// const HOME: usize = 16;
75
pub enum ControllerType {
86
None,
97
StandardController,

Diff for: nes/src/cpu.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::*;
2-
use log::{debug, error, info};
32

43
macro_rules! iif {
54
($cond:expr, $iftrue:expr, $iffalse:expr) => {
@@ -1157,15 +1156,15 @@ impl Cpu {
11571156
Operand::Address(addr)
11581157
}
11591158

1160-
pub fn run_dma_transfer(&mut self, offset: u8) {
1159+
pub fn run_dma_transfer(&mut self, _offset: u8) {
11611160
todo!()
11621161
}
11631162

11641163
pub fn start_dmc_transfer(&mut self) {
11651164
todo!()
11661165
}
11671166

1168-
pub fn set_debug_pc(value: u16) {
1167+
pub fn set_debug_pc(_value: u16) {
11691168
todo!()
11701169
}
11711170

@@ -1212,7 +1211,7 @@ impl Cpu {
12121211
}
12131212
}
12141213

1215-
pub fn irq(console: &mut Console) {
1214+
pub fn irq(_console: &mut Console) {
12161215
todo!()
12171216
}
12181217

@@ -1302,7 +1301,7 @@ fn test() {
13021301
let rom = VirtualFile::new("Nes Test", NES_TEST);
13031302
let mut console = Console::new(&rom, Box::new(BaseRenderer::default()));
13041303
let testlog = include_str!("../test/nestest.log");
1305-
debug!("{:02x?}", console.mapper.base_mapper().prg_rom);
1304+
log::debug!("{:02x?}", console.mapper.base_mapper().prg_rom);
13061305
console.cpu.pc = 0xC000;
13071306
for line in testlog.lines() {
13081307
let pc = &line[0..4];

0 commit comments

Comments
 (0)