fn load16(ctx: &mut impl CpuContext, dest: Operand16, source: Operand16) {
    let val = source.read(ctx);
    if (dest, source) == (Operand16::Sp, Operand16::HL) {
        // Most of the 16 bit loads are <Pair>,<Immediate> and take time based on number of memory
        // accesses. There are two exceptions. LD (u16),SP, which is also just timed based on the
        // number of memory accesses, and LD SP,HL, which is all registers but still takes an extra
        // 1m cycle, which isn't automatically provided by Operand16 register interactions, so we
        // insert it here.
        ctx.yield1m();
    }
    trace!("Evaluating LD {},{} (<- {})", dest, source, val);
    dest.write(ctx, val);
}
/// Implements 16 bit load operations.
Implements 16 bit load operations.
Implements 16 bit load operations .
fn load16(ctx: &mut impl CpuContext, dest: Operand16, source: Operand16) {
    let val = source.read(ctx);
    if (dest, source) == (Operand16::Sp, Operand16::HL) {
        // Most of the 16 bit loads are <Pair>,<Immediate> and take time based on number of memory
        // accesses. There are two exceptions. LD (u16),SP, which is also just timed based on the
        // number of memory accesses, and LD SP,HL, which is all registers but still takes an extra
        // 1m cycle, which isn't automatically provided by Operand16 register interactions, so we
        // insert it here.
        ctx.yield1m();
    }
    trace!("Evaluating LD {},{} (<- {})", dest, source, val);
    dest.write(ctx, val);
}
fn load16 ( ctx : & mut impl CpuContext , dest : Operand16 , source : Operand16 ) { let val = source . read ( ctx ) ; if ( dest , source ) == ( Operand16 :: Sp , Operand16 :: HL ) { // Most of the 16 bit loads are <Pair>,<Immediate> and take time based on number of memory // accesses. There are two exceptions. LD (u16),SP, which is also just timed based on the // number of memory accesses, and LD SP,HL, which is all registers but still takes an extra // 1m cycle, which isn't automatically provided by Operand16 register interactions, so we // insert it here. ctx . yield1m ( ) ; } trace ! ( " " dest source val ) ; dest . write ( ctx , val ) ; }
Implements 16 bit load operations.
Implements 16 bit load operations .
ctx
&mut impl CpuContext
dest
Operand16
source
Operand16
ctx
&mut impl CpuContext
dest
Operand16
source
Operand16