I am writing my first wmulator and since there arent many good tutorials out there... I want to make sure Im on the right track.
My first question...
Is this the proper way of emulatiing the CPU?
Code:void CpuEmulation() { OpCode = (Memory[PC] << 8) + Memory[PC + 1]; switch(OpCode&0xF000) { case 0x0000: if(OpCode&0x00F0 == 0xE) ClearScreen(); PC+=2; break; case 0x1000: MemoryPosition = OpCode&0x0FFF; PC+=2; break; case 0x3000: if(V[OpCode&0x0F00] == OpCode&0x00FF) PC += 4; else PC += 2; break; case 0x5000: if(V[OpCode&0x0F00] == OpCode&0x00F0) PC += 4; else PC += 2; break; case 0x6000: V[OpCode&0x0F00] = OpCode&0x00FF; PC+=2; break; case 0x7000: V[OpCode&0x0F00] += OpCode&0x00FF; PC+=2; break; case 0x8000: if(OpCode&0x000F == 0) V[OpCode&0x0F00] = V[OpCode&0x00F0]; PC+=2; break; case 0xB000: MemoryPosition = OpCode&0x0FFF + V[0]; PC+=2; break; } }