RIP-Comm / clementine

Gameboy Advance emulator.
MIT License
49 stars 13 forks source link

Refactor shift operation #57

Closed AlessandroGrassi99 closed 2 years ago

AlessandroGrassi99 commented 2 years ago

Since the shift operation is used by several instructions, I preferred to separate it from Data Processing (ALU).

I made two methods, shift and shift_immediate, the first one performs special operations in case the shift_amount is 0, the second one performs the shift operation directly.

FedericoBruzzone commented 2 years ago

Looks good.

Have you thought about passing op2 by reference? By doing so could we avoid reassignement?

AlessandroGrassi99 commented 2 years ago

Looks good.

Have you thought about passing op2 by reference? By doing so could we avoid reassignement?

I thought about it, but u32 implements Copy, so it doesn't seem a noteworthy advantage to me.