craigthomas / Chip8Java

A Super Chip 8 emulator written in Java
MIT License
27 stars 2 forks source link

Implement `shift_quirks` #33

Open craigthomas opened 2 months ago

craigthomas commented 2 months ago

In order to be compatible with a wide variety of Chip 8 ROMs, a change to the shift operation is required. In the original language specification two registers were required: the destination register x, and the source register y. The source register y value was shifted one bit left or right, and stored in x. For example, shift left was defined as:

Vx = Vy << 1

However, with the updated language specification, the source and destination register are assumed to always be the same, thus the y register is ignored and instead the value is sourced from x as such:

Vx = Vx << 1

Setting --shift_quirks will alter the shift operation to the latter behaviour.