cj1128 / chip8-emulator

🎉 A simple CHIP-8 emulator written with C and SDL2
50 stars 4 forks source link

提交bug #2

Closed OrionUR closed 4 years ago

OrionUR commented 4 years ago

在chip8.c里的指令集,比如250和251行,应该先比较写入VF后,再相减 因为VF是标记有没有借位,先相减后再比较,意义就完全错了

cj1128 commented 4 years ago
  case 7: {
    u8 vx = vm->v[x];
    u8 vy = vm->v[y];
    vm->v[x] = vy - vx;
    vm->v[0xf] = vy < vx ? 0x00 : 0x01;
  } break;

比较用的是 vxvy 两个 local variable,值不会改变的。

OrionUR commented 4 years ago

噢噢,抱歉,是我菜了