pub fn tick<B, C>(mut ctx: B)
// Using BorrowMut here allows both `&mut (Gbz80State, M)` and `(&mut Gbz80State, &mut M)` to be
// passed as the argument.
where
    B: BorrowMut<C>,
    C: CpuContext,
{
    let ctx = ctx.borrow_mut();

    // TODO: check interrupt state.
    if ctx.cpustate().halted {
        return;
    }

    let previous_ime = ctx.cpustate().interrupt_master_enable;
    Opcode::load_and_execute(ctx);
    ctx.cpustate_mut()
        .interrupt_master_enable
        .tick(previous_ime);
}
/// Runs a single instruction on the CPU.
Runs a single instruction on the CPU.
Runs a single instruction on the CPU .
pub fn tick<B, C>(mut ctx: B)
// Using BorrowMut here allows both `&mut (Gbz80State, M)` and `(&mut Gbz80State, &mut M)` to be
// passed as the argument.
where
    B: BorrowMut<C>,
    C: CpuContext,
{
    let ctx = ctx.borrow_mut();
    // TODO: check interrupt state.
    if ctx.cpustate().halted {
        return;
    }
    let previous_ime = ctx.cpustate().interrupt_master_enable;
    Opcode::load_and_execute(ctx);
    ctx.cpustate_mut()
        .interrupt_master_enable
        .tick(previous_ime);
}
pub fn tick < B , C > ( mut ctx : B ) // Using BorrowMut here allows both `&mut (Gbz80State, M)` and `(&mut Gbz80State, &mut M)` to be // passed as the argument. where B : BorrowMut < C > , C : CpuContext , { let ctx = ctx . borrow_mut ( ) ; // TODO: check interrupt state. if ctx . cpustate ( ) . halted { return ; } let previous_ime = ctx . cpustate ( ) . interrupt_master_enable ; Opcode :: load_and_execute ( ctx ) ; ctx . cpustate_mut ( ) . interrupt_master_enable . tick ( previous_ime ) ; }
Runs a single instruction on the CPU.
Runs a single instruction on the CPU .
ctx
B
ctx
B