thanks for the quick reply, you explanation helped a lot but i dont understand why the app always freezes when emulating.
EDIT: now i have another problem in my CPU - i dont exactly get how you can tell what the opcode is
for example if the opcode is 0xE0 ( clear the screen ), then why is it written like
how do you tell how to sort the opcodes under 0x0, 0x1, 0x2 ....
and if the opcode is 1nnn how would you convert that to hex
thanks
EDIT: now i have another problem in my CPU - i dont exactly get how you can tell what the opcode is
for example if the opcode is 0xE0 ( clear the screen ), then why is it written like
Code:
opcode = (memory[pc]<<8 + memory[pc+1]);
pc+=2;
switch ((opcode&0xF000)>>12)
{
case 0x0:
{
if ((opcode& 0x00FF) == 0xE0)
{
// Clear the screen
memset(chip8.display, 0, 64*32);
}
break;
}
}how do you tell how to sort the opcodes under 0x0, 0x1, 0x2 ....
and if the opcode is 1nnn how would you convert that to hex
thanks