mirror of
https://github.com/encounter/decomp-toolkit.git
synced 2025-06-06 14:43:29 +00:00
parent
8d8d801b2f
commit
5c7560bcea
@ -56,6 +56,10 @@ impl SectionAddress {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_aligned(self, align: u32) -> bool { self.address & (align - 1) == 0 }
|
pub fn is_aligned(self, align: u32) -> bool { self.address & (align - 1) == 0 }
|
||||||
|
|
||||||
|
pub fn wrapping_add(self, rhs: u32) -> Self {
|
||||||
|
Self { section: self.section, address: self.address.wrapping_add(rhs) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Add<u32> for SectionAddress {
|
impl Add<u32> for SectionAddress {
|
||||||
|
@ -208,11 +208,11 @@ impl VM {
|
|||||||
(
|
(
|
||||||
GprValue::Address(RelocationTarget::Address(left)),
|
GprValue::Address(RelocationTarget::Address(left)),
|
||||||
GprValue::Constant(right),
|
GprValue::Constant(right),
|
||||||
) => GprValue::Address(RelocationTarget::Address(left + right)),
|
) => GprValue::Address(RelocationTarget::Address(left.wrapping_add(right))),
|
||||||
(
|
(
|
||||||
GprValue::Constant(left),
|
GprValue::Constant(left),
|
||||||
GprValue::Address(RelocationTarget::Address(right)),
|
GprValue::Address(RelocationTarget::Address(right)),
|
||||||
) => GprValue::Address(RelocationTarget::Address(right + left)),
|
) => GprValue::Address(RelocationTarget::Address(right.wrapping_add(left))),
|
||||||
_ => GprValue::Unknown,
|
_ => GprValue::Unknown,
|
||||||
};
|
};
|
||||||
self.gpr[ins.field_rd() as usize].set_direct(value);
|
self.gpr[ins.field_rd() as usize].set_direct(value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user