public override void set_context(object reg) { if (reg != null) { I = (nec_Regs)reg; I._base[CS] = (uint)(I.sregs[CS] << 4); I._base[DS] = (uint)(I.sregs[DS] << 4); I._base[ES] = (uint)(I.sregs[ES] << 4); I._base[SS] = (uint)(I.sregs[SS] << 4); if (cur_mrhard[((I._base[CS] + I.ip)) >> (8 + 0 + 0)] != ophw) Mame.cpu_setOPbase20((int)(I._base[CS] + I.ip), 0); } }
private int DefaultBase(int Seg, nec_Regs I) { return(((seg_prefix != 0) && (Seg == 3 || Seg == 2)) ? prefix_base : (int)(I.sregs[Seg] << 4)); }
public override void create_context(ref object reg) { reg = new nec_Regs(); }
void nec_reset(object param) { uint i, j, c; BREGS[] reg_name = { (BREGS)AL, (BREGS)CL, (BREGS)DL, (BREGS)BL, (BREGS)AH, (BREGS)CH, (BREGS)DH, (BREGS)BH }; I = new nec_Regs(); I.sregs[CS] = 0xffff; I._base[CS] = (uint)(I.sregs[CS] << 4); change_pc20((uint)(I._base[CS] + I.ip)); for (i = 0; i < 256; i++) { for (j = i, c = 0; j > 0; j >>= 1) if ((j & 1) != 0) c++; parity_table[i] = (byte)((c & 1) == 0 ? 1 : 0); } I.ZeroVal = I.ParityVal = 1; I.MF = 1; /* set the mode-flag = native mode */ for (i = 0; i < 256; i++) { Mod_RM.reg.b[i] = reg_name[(i & 0x38) >> 3]; Mod_RM.reg.w[i] = (WREGS)((i & 0x38) >> 3); } for (i = 0xc0; i < 0x100; i++) { Mod_RM.RM.w[i] = (WREGS)(i & 7); Mod_RM.RM.b[i] = (BREGS)reg_name[i & 7]; } }