chibinz / GameBar

A Game Boy Advance emulator written in Rust
MIT License
3 stars 0 forks source link

Functions in alu.rs and barrel_shifter.rs impure #1

Closed chibinz closed 2 years ago

chibinz commented 3 years ago

Currently functions in alu.rs and barrel_shifter.rs require a mutable reference to the CPU struct. This complicates cpu state management. Ideally, state manipulation should only occur explicitly in the arm and thumb module. Yes the barrel shifter may set the carry bit, but returning a tuple of (value, carry) seems a better idea.

chibinz commented 2 years ago

Resolved in earlier commits...