Hi all,
Been looking into the squidgeSnes code again, and noticed that the ticks stuff is constaint, or could be.
Fixed Point Divide Function
Add to the minlib
The accuracy is sacrifisted, but should be MUCH quicker =) Could someone give it ago and let me know how it goes?
Mike
Been looking into the squidgeSnes code again, and noticed that the ticks stuff is constaint, or could be.
Fixed Point Divide Function
Code:
#define div(a,b) (int) ( ((((2^32)+b-1) / b) * (a)) / (2^32) )
Add to the minlib
Code:
//predefined.. so no math done here =)
#define ticks_per_second (7372800 / 1000)
#define ticks_math (((2^32)+ticks_per_second-1) / ticks_per_second)
#define ticks_passed(a) (int) ( (ticks_math * (a)) / (2^32) )
...
unsigned long gp2x_timer_read(void) {
return ticks_passed(gp2x_memregl[0x0A00>>2]);
}
The accuracy is sacrifisted, but should be MUCH quicker =) Could someone give it ago and let me know how it goes?
Mike