Z80State.fromJson constructor

Z80State.fromJson(
  1. Map<String, dynamic> state
)

Loads CPU State from a Map

Implementation

factory Z80State.fromJson(Map<String, dynamic> state) {
  return Z80State(
    a: state['a'] as int,
    b: state['b'] as int,
    c: state['c'] as int,
    d: state['d'] as int,
    e: state['e'] as int,
    h: state['h'] as int,
    l: state['l'] as int,
    aPrime: state['a_prime'] as int,
    bPrime: state['b_prime'] as int,
    cPrime: state['c_prime'] as int,
    dPrime: state['d_prime'] as int,
    ePrime: state['e_prime'] as int,
    hPrime: state['h_prime'] as int,
    lPrime: state['l_prime'] as int,
    ix: state['ix'] as int,
    iy: state['iy'] as int,
    i: state['i'] as int,
    r: state['r'] as int,
    sp: state['sp'] as int,
    pc: state['pc'] as int,
    flags: Z80Flags.fromJson(state['flags']),
    flagsPrime: Z80Flags.fromJson(state['flags_prime']),
    interruptMode: state['imode'] as int,
    iff1: state['iff1'] as int,
    iff2: state['iff2'] as int,
    halted: state['halted'] as bool,
    doDelayedDi: state['do_delayed_di'] as bool,
    doDelayedEi: state['do_delayed_ei'] as bool,
    cycleCounter: state['cycle_counter'] as int,
  );
}