Minor changes

This commit is contained in:
Loïc Guégan 2023-12-25 10:24:29 +01:00
parent 3b9170b54b
commit 8d56e4a953

View file

@ -35,14 +35,41 @@ void VCPUDecode(){
void VCPUExecute(){
// VCPUDump();
switch(State.opcode >> 12){
case 0x0: // Clear screen
ScreenClear();
case 0x0: // Clear screen or return from subroutine
if(State.N == 0){ // Clear screen
ScreenClear();
}
else { // Return from subroutine
State.PC=State.stack[State.S];
State.S--;
}
break
;;
case 0x1: // Jump
State.PC=State.NNN;
break
;;
case 0x2: // Call
State.S++;
State.stack[State.S]=State.PC;
State.PC=State.NNN;
break
;;
case 0x3: // SE: VX, byte
if(State.V[State.X]==State.NN)
State.PC+=2;
break;
;;
case 0x4: // SNE: VX, byte
if(State.V[State.X]!=State.NN)
State.PC+=2;
break;
;;
case 0x5: // SNE: VX, VY
if(State.V[State.X]==State.V[State.Y])
State.PC+=2;
break;
;;
case 0x6:
State.V[State.X]=State.NN;
break