예제 #1
0
파일: CPU.cs 프로젝트: LesCol/Chip8
        private bool SKP(ushort instruction)
        {
            var value = ParserFunctions.GetValue(instruction);
            var x     = ParserFunctions.GetX(instruction);
            var key   = Register[x];

            switch (value)
            {
            case 0x9e:
                if (keyboard.GetValue(key))
                {
                    InstructionPointer += 2;
                }
                break;

            case 0xa1:
                if (!keyboard.GetValue(key))
                {
                    InstructionPointer += 2;
                    break;
                }
                break;

            default:
                throw new InvalidOperationException();
            }
            return(false);
        }