avm2: Implement Op::Sxi1

This commit is contained in:
CUB3D 2021-04-07 18:19:50 +01:00 committed by Mike Welsh
parent 9ffa4f1f50
commit 99edb5ab2b
1 changed files with 14 additions and 0 deletions

View File

@ -706,6 +706,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
Op::Li32 => self.op_li32(),
Op::Lf32 => self.op_lf32(),
Op::Lf64 => self.op_lf64(),
Op::Sxi1 => self.op_sxi1(),
_ => self.unknown_op(op),
};
@ -2700,6 +2701,19 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
Ok(FrameControl::Continue)
}
/// Implements `Op::Sxi1`
fn op_sxi1(&mut self) -> Result<FrameControl<'gc>, Error> {
let val = self.context.avm2.pop().coerce_to_i32(self)?;
let val = val.wrapping_shl(31).wrapping_shr(31);
self.context
.avm2
.push(Value::Integer(val));
Ok(FrameControl::Continue)
}
#[allow(unused_variables)]
#[cfg(avm_debug)]
fn op_debug(