Skip to content

Commit

Permalink
Implement bios sqrt
Browse files Browse the repository at this point in the history
  • Loading branch information
Grarak committed Jan 18, 2025
1 parent 9e37d1e commit 32e3906
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/core/hle/bios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ pub fn runlen_uncomp<const CPU: CpuType>(emu: &mut Emu) {
}

pub fn square_root<const CPU: CpuType>(emu: &mut Emu) {
todo!()
let reg0 = get_regs_mut!(emu, CPU).get_reg_mut(Reg::R0);
*reg0 = reg0.isqrt();
}

pub fn unknown<const CPU: CpuType>(_: &mut Emu) {}
Expand Down
3 changes: 1 addition & 2 deletions src/jit/emitter/emit_transfer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::core::emu::{get_mem, get_mmu, get_regs};
use crate::core::memory::mmu;
use crate::core::emu::{get_mmu, get_regs};
use crate::core::thread_regs::ThreadRegs;
use crate::core::CpuType;
use crate::jit::assembler::block_asm::BlockAsm;
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::error::Error;
use std::fmt::{Debug, Display, Formatter};
use std::hash::{BuildHasher, Hasher};
use std::ops::{Deref, DerefMut};
use std::{cmp, slice};
use std::slice;

pub const fn align_up(n: usize, align: usize) -> usize {
(n + align - 1) & !(align - 1)
Expand Down

0 comments on commit 32e3906

Please sign in to comment.