lronaldo / cpctelera

Astonishingly fast Amstrad CPC game engine for C developers
http://lronaldo.github.io/cpctelera/
GNU Lesser General Public License v3.0
229 stars 54 forks source link

Optimize cpct_drawSpriteMasked replace use of IX #101

Closed Arnaud6128 closed 4 years ago

Arnaud6128 commented 4 years ago

Replace use of IX reg by self-modifing code to save Sprite Width

lronaldo commented 4 years ago

This optimization is actually too minor to justify a breaking change at this step. cpct_drawSpriteMasked is actualy safe to use from ROM, and your proposed change makes it not valid for that usage. Existing code using this function will break due to this change and actual benefit is of 7 microseconds in total (previous measurements were incorrect, I've made them new).

I think this change is not justified at this development stage for 1.5. Prefer to maintain previous version and not break existing code.

lronaldo commented 4 years ago

However, I will update new time calculations. Thanks to your proposal I have had change to review and fix them: they were incorrect.

Thanks @Arnaud6128 :)