Minor changes

This commit is contained in:
Loïc Guégan 2023-12-25 09:22:19 +01:00
parent 16f7128a0c
commit 02574531db

View file

@ -20,14 +20,19 @@ void VCPUFetch(){
}
void VCPUDecode(){
State.X=(State.opcode<<4) & 0xF0;
State.Y=(State.opcode<<8) & 0xF0;
State.N=(State.opcode<<12) & 0xF0;
State.NN=(State.opcode<<8) & 0xFF;
State.NNN=(State.opcode<<4) & 0xFFF0;
State.X=(State.opcode>>8) & 0xF;
State.Y=(State.opcode>>4) & 0xF;
State.N=State.opcode & 0xF;
State.NN=State.Y;
State.NN=State.NN<<4;
State.NN=State.NN | State.N;
State.NNN=State.opcode&0x0FFF;
}
void VCPUExecute(){
// VCPUDump();
switch(State.opcode >> 12){
case 0x0:
ScreenClear();
@ -63,4 +68,9 @@ void VCPUExecute(){
void VCPUDump(){
printf("opcode: 0x%04x\n",State.opcode&0xFFFF);
printf("X: 0x%01x\n",State.X);
printf("Y: 0x%01x\n",State.Y);
printf("N: 0x%01x\n",State.N);
printf("NN: 0x%02x\n",State.NN);
printf("NNN: 0x%03x\n",State.NNN);
}