Fix build error and warnings

Former-commit-id: 122b21bd486ca25681b4462a44edb18f778bf8d6
Former-commit-id: 3dc7ff4285e781654526f15e8f5ee3745e197b03
This commit is contained in:
Michel Heily 2020-05-01 18:28:49 +03:00
parent ef3f39defc
commit 051d5e1235
4 changed files with 2 additions and 22 deletions

View file

@ -14,17 +14,6 @@ fn get_bs_op(shift_field: u32) -> BarrelShiftOpCode {
BarrelShiftOpCode::from_u8(shift_field.bit_range(5..7) as u8).unwrap() BarrelShiftOpCode::from_u8(shift_field.bit_range(5..7) as u8).unwrap()
} }
#[inline(always)]
fn get_shift_reg_by(shift_field: u32) -> ShiftRegisterBy {
if shift_field.bit(4) {
let rs = shift_field.bit_range(8..12) as usize;
ShiftRegisterBy::ByRegister(rs)
} else {
let amount = shift_field.bit_range(7..12) as u32;
ShiftRegisterBy::ByAmount(amount)
}
}
impl Core { impl Core {
pub fn exec_arm(&mut self, bus: &mut SysBus, insn: &ArmInstruction) -> CpuAction { pub fn exec_arm(&mut self, bus: &mut SysBus, insn: &ArmInstruction) -> CpuAction {
match insn.fmt { match insn.fmt {
@ -693,16 +682,9 @@ impl Core {
pub fn exec_arm_mull_mlal(&mut self, sb: &mut SysBus, insn: &ArmInstruction) -> CpuAction { pub fn exec_arm_mull_mlal(&mut self, sb: &mut SysBus, insn: &ArmInstruction) -> CpuAction {
let rd_hi = insn.rd_hi(); let rd_hi = insn.rd_hi();
let rd_lo = insn.rd_lo(); let rd_lo = insn.rd_lo();
let rn = insn.raw.bit_range(8..12) as usize;
let rs = insn.rs(); let rs = insn.rs();
let rm = insn.rm(); let rm = insn.rm();
// // check validity
// assert!(
// !(REG_PC == rd_hi || REG_PC == rd_lo || REG_PC == rn || REG_PC == rs || REG_PC == rm)
// );
// assert!(!(rd_hi != rd_hi && rd_hi != rm && rd_lo != rm));
let op1 = self.get_reg(rm); let op1 = self.get_reg(rm);
let op2 = self.get_reg(rs); let op2 = self.get_reg(rs);
let mut result: u64 = if insn.u_flag() { let mut result: u64 = if insn.u_flag() {

View file

@ -1,5 +1,4 @@
use std::path::Path; use std::path::Path;
use std::sync::atomic::Ordering;
use std::time; use std::time;
use crate::arm7tdmi::arm::ArmInstruction; use crate::arm7tdmi::arm::ArmInstruction;

View file

@ -80,7 +80,6 @@ pub trait InputInterface {
} }
} }
#[cfg(feature = "debugger")]
#[derive(Debug)] #[derive(Debug)]
pub enum GBAError { pub enum GBAError {
IO(::std::io::Error), IO(::std::io::Error),

View file

@ -32,8 +32,8 @@ use std::net::TcpListener;
use std::net::ToSocketAddrs; use std::net::ToSocketAddrs;
pub fn spawn_and_run_gdb_server<A: ToSocketAddrs + fmt::Display>( pub fn spawn_and_run_gdb_server<A: ToSocketAddrs + fmt::Display>(
target: &mut GameBoyAdvance, #[allow(unused)] target: &mut GameBoyAdvance,
addr: A, #[allow(unused)] addr: A,
) -> Result<(), Box<dyn std::error::Error>> { ) -> Result<(), Box<dyn std::error::Error>> {
#[cfg(feature = "gdb")] #[cfg(feature = "gdb")]
{ {