示例#1
0
        public INC16(Gameboy parent, byte opcode) : base(parent)
        {
            target = OpcodeUtils.BitsToRegister16((opcode & 0b1110000) >> 4);

            Cycles      = 8;
            Disassembly = "inc " + OpcodeUtils.Register16ToString(target);
        }
示例#2
0
        public ADD16(Gameboy parent, byte opcode) : base(parent)
        {
            source = OpcodeUtils.BitsToRegister16((opcode & 0b110000) >> 4);

            Disassembly = "add hl, " + OpcodeUtils.Register16ToString(source);
            Cycles      = 8;
        }
示例#3
0
        public LDA(Gameboy parent, byte opcode) : base(parent)
        {
            load    = (opcode & 0b1000) > 0;
            regpair = (opcode & 0b10000) > 0 ? Register16.DE : Register16.BC;

            Cycles       = 8;
            TickAccurate = true;

            Disassembly = load ? "ld a, [" + OpcodeUtils.Register16ToString(regpair) + "]" : "ld [" + OpcodeUtils.Register16ToString(regpair) + "], a";
        }
示例#4
0
        public PUSH(Gameboy parent, byte opcode) : base(parent)
        {
            source = OpcodeUtils.BitsToRegister16((opcode & 0b110000) >> 4);
            if (source == Register16.SP)
            {
                source = Register16.AF;
            }

            Cycles = 16;

            Disassembly = "push " + OpcodeUtils.Register16ToString(source);
        }
示例#5
0
        public POP(Gameboy parent, byte opcode) : base(parent)
        {
            target = OpcodeUtils.BitsToRegister16((opcode & 0b110000) >> 4);
            if (target == Register16.SP)
            {
                target = Register16.AF;
            }

            Cycles = 12;

            Disassembly = "pop " + OpcodeUtils.Register16ToString(target);
        }
示例#6
0
文件: LD16.cs 项目: Hacktix/ChromaBoy
        public LD16(Gameboy parent, byte opcode) : base(parent)
        {
            target     = OpcodeUtils.BitsToRegister16((opcode & 0b110000) >> 4);
            targetLow  = target == Register16.BC ? Register.C : target == Register16.DE ? Register.E : Register.L;
            targetHigh = target == Register16.BC ? Register.B : target == Register16.DE ? Register.D : Register.H;

            Cycles       = 12;
            Length       = 3;
            TickAccurate = true;

            Disassembly = "ld " + OpcodeUtils.Register16ToString(target) + ", $" + (parent.Memory[parent.PC + 1] + (parent.Memory[parent.PC + 2] << 8)).ToString("X2");
        }