X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=drivers%2Fgp2x%2Fasmutils.s;h=3db4e303e352270eec9b3a052ea44fd8ec3d6d97;hp=a7f123f745c90a0ac2829bf71ef690e8a5adcba9;hb=b2b95d2e0d1fd5e52d03c2152605b09b024c1d0e;hpb=e1591a12a775a600572ffccb2d6f8f4d6343b7dd diff --git a/drivers/gp2x/asmutils.s b/drivers/gp2x/asmutils.s index a7f123f..3db4e30 100644 --- a/drivers/gp2x/asmutils.s +++ b/drivers/gp2x/asmutils.s @@ -54,6 +54,18 @@ block_loop_andor: bx lr +.global spend_cycles @ c + +spend_cycles: + mov r0, r0, lsr #2 @ 4 cycles/iteration + sub r0, r0, #2 @ entry/exit/init +.sc_loop: + subs r0, r0, #1 + bpl .sc_loop + + bx lr + + /* buggy and slow, probably because function call overhead @ renderer helper, based on bitbank's method