@Override
    public int get_reg(int regnum) {
        switch( regnum )
    	{
    		case Z80_PC: return Z80.PC.D;
    		case Z80_SP: return Z80.SP.D;
    		case Z80_AF: return Z80.AF.D;
    		case Z80_BC: return Z80.BC.D;
    		case Z80_DE: return Z80.DE.D;
    		case Z80_HL: return Z80.HL.D;
    /*TODO*///		case Z80_IX: return Z80.IX.w.l;
    /*TODO*///		case Z80_IY: return Z80.IY.w.l;
    /*TODO*///        case Z80_R: return (Z80.R & 0x7f) | (Z80.R2 & 0x80);
    /*TODO*///		case Z80_I: return Z80.I;
    /*TODO*///		case Z80_AF2: return Z80.AF2.w.l;
    /*TODO*///		case Z80_BC2: return Z80.BC2.w.l;
    /*TODO*///		case Z80_DE2: return Z80.DE2.w.l;
    /*TODO*///		case Z80_HL2: return Z80.HL2.w.l;
    /*TODO*///		case Z80_IM: return Z80.IM;
    /*TODO*///		case Z80_IFF1: return Z80.IFF1;
    /*TODO*///		case Z80_IFF2: return Z80.IFF2;
    /*TODO*///		case Z80_HALT: return Z80.HALT;
    /*TODO*///		case Z80_NMI_STATE: return Z80.nmi_state;
    /*TODO*///		case Z80_IRQ_STATE: return Z80.irq_state;
    /*TODO*///		case Z80_DC0: return Z80.int_state[0];
    /*TODO*///		case Z80_DC1: return Z80.int_state[1];
    /*TODO*///		case Z80_DC2: return Z80.int_state[2];
    /*TODO*///		case Z80_DC3: return Z80.int_state[3];
            case REG_PREVIOUSPC: return Z80.PREPC.D;
    		default:
                    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    
    /*TODO*///			if( regnum <= REG_SP_CONTENTS )
    /*TODO*///			{
    /*TODO*///				unsigned offset = _SPD + 2 * (REG_SP_CONTENTS - regnum);
    /*TODO*///				if( offset < 0xffff )
    /*TODO*///					return RM( offset ) | ( RM( offset + 1) << 8 );
    /*TODO*///			}
   	}
    /*TODO*/// return 0;
    }
    /*TODO*///
    /*TODO*////****************************************************************************
    /*TODO*/// * Set a specific register
    /*TODO*/// ****************************************************************************/
    /*TODO*///void z80_set_reg (int regnum, unsigned val)
    /*TODO*///{
    /*TODO*///	switch( regnum )
    /*TODO*///	{
    /*TODO*///		case Z80_PC: Z80.PC.w.l = val; break;
    /*TODO*///		case Z80_SP: Z80.SP.w.l = val; break;
    /*TODO*///		case Z80_AF: Z80.AF.w.l = val; break;
    /*TODO*///		case Z80_BC: Z80.BC.w.l = val; break;
    /*TODO*///		case Z80_DE: Z80.DE.w.l = val; break;
    /*TODO*///		case Z80_HL: Z80.HL.w.l = val; break;
    /*TODO*///		case Z80_IX: Z80.IX.w.l = val; break;
    /*TODO*///		case Z80_IY: Z80.IY.w.l = val; break;
    /*TODO*///        case Z80_R: Z80.R = val; Z80.R2 = val & 0x80; break;
    /*TODO*///		case Z80_I: Z80.I = val; break;
    /*TODO*///		case Z80_AF2: Z80.AF2.w.l = val; break;
    /*TODO*///		case Z80_BC2: Z80.BC2.w.l = val; break;
    /*TODO*///		case Z80_DE2: Z80.DE2.w.l = val; break;
    /*TODO*///		case Z80_HL2: Z80.HL2.w.l = val; break;
    /*TODO*///		case Z80_IM: Z80.IM = val; break;
    /*TODO*///		case Z80_IFF1: Z80.IFF1 = val; break;
    /*TODO*///		case Z80_IFF2: Z80.IFF2 = val; break;
    /*TODO*///		case Z80_HALT: Z80.HALT = val; break;
    /*TODO*///		case Z80_NMI_STATE: z80_set_nmi_line(val); break;
    /*TODO*///		case Z80_IRQ_STATE: z80_set_irq_line(0,val); break;
    /*TODO*///		case Z80_DC0: Z80.int_state[0] = val; break;
    /*TODO*///		case Z80_DC1: Z80.int_state[1] = val; break;
    /*TODO*///		case Z80_DC2: Z80.int_state[2] = val; break;
    /*TODO*///		case Z80_DC3: Z80.int_state[3] = val; break;
    /*TODO*///        default:
    /*TODO*///			if( regnum <= REG_SP_CONTENTS )
    /*TODO*///			{
    /*TODO*///				unsigned offset = _SPD + 2 * (REG_SP_CONTENTS - regnum);
    /*TODO*///				if( offset < 0xffff )
    /*TODO*///				{
    /*TODO*///					WM( offset, val & 0xff );
    /*TODO*///					WM( offset+1, (val >> 8) & 0xff );
    /*TODO*///				}
    /*TODO*///			}
    /*TODO*///    }
    /*TODO*///}