visrealm / pico-56

The HBC-56 (65C02/TMS9918A/AY-3-8910 retro computer) fully emulated on a Raspberry Pi Pico
https://youtube.com/@TroySchrapel
MIT License
120 stars 10 forks source link

Collapsed pio_set_x() and pio_set_y() into a single function #6

Closed sweetlilmre closed 4 months ago

sweetlilmre commented 5 months ago

Small tidy up of the pio_set_x and pio_set_y functions to remove duplication

visrealm commented 4 months ago

Hi Peter,

Eliminating duplicate code is always a worthy goal.

I like this change, but one suggestion: I think, instead of making pio_set_xy() public, it should be a static function. Leave pio_set_x() and pio_set_y() as actual functions (rather than macros for pio_set_xy()) which call static pio_set_xy() function. Then we can remove the sanity guard too.

If you can make those changes, I'll happily merge it in.

Thanks for your contributions to this project!

Cheers Troy

sweetlilmre commented 4 months ago

Hi, I've made the suggested changes, I prefer the #defines over the separate functions (2 calls per invocation over the sanity check), but it's much of a muchness :). Great project, hopefully I'll get around to getting a kit one day to play with.