![Shocked :shock:](./images/smilies/icon_eek.gif)
That VERY MUCH interests me!
![Very Happy :D](./images/smilies/icon_biggrin.gif)
![Very Happy :D](./images/smilies/icon_biggrin.gif)
![Very Happy :D](./images/smilies/icon_biggrin.gif)
![Cool 8)](./images/smilies/icon_cool.gif)
Moderator: Stef
Good ideaKanedaFr wrote:I take the liberty to mod this post as an annoucement, so it will be easier to find it and new users will see it too...
do you think I must move it on "Tools"?
Code: Select all
x=(x+1)%40;
ptr=(ptr+1)%mwdt;
Code: Select all
x=((x+1)%40);
ptr=((ptr+1)%mwdt);
Code: Select all
x++;
x%=40;
ptr++
ptr%=mwdt;
Not works.KanedaFr wrote:could you test if this work :Code: Select all
x=((x+1)%40); ptr=((ptr+1)%mwdt);
This works. But.. I also noticed one place where code hangs on:KanedaFr wrote:at least, I assume this works :Code: Select all
x++; x%=40; ptr++ ptr%=mwdt;
Code: Select all
ssy=sy%mhgt;
Code: Select all
ssy=sy;
ssy%=mhgt;
It can sound stupid but are you not simply doing division by 0 exception (%0) ?Shiru wrote:Not works.KanedaFr wrote:could you test if this work :Code: Select all
x=((x+1)%40); ptr=((ptr+1)%mwdt);
This works. But.. I also noticed one place where code hangs on:KanedaFr wrote:at least, I assume this works :Code: Select all
x++; x%=40; ptr++ ptr%=mwdt;
I.e., where result goes not same variable. In this case code like:Code: Select all
ssy=sy%mhgt;
..does not helps.Code: Select all
ssy=sy; ssy%=mhgt;
This was first that I check. Of course not, especially in case %40 in code above.Stef wrote:It can sound stupid but are you not simply doing division by 0 exception (%0) ?
I use sega.s from devkit with only one modification - I replaced jump to 'start' to direct jump to 'main' (only one line).Stef wrote:If not, do you checked the i_ldiv function in sega.s file ? as you don't have the base library you need manual implementation of 32 bits multiplication and division for GCC. Maybe the division code (used by modulo function) is buggy but i'm surprised as i never meet any problems. Did you modified it ?
I realised i never replied your last post.Shiru wrote:This was first that I check. Of course not, especially in case %40 in code above.Stef wrote:It can sound stupid but are you not simply doing division by 0 exception (%0) ?
I use sega.s from devkit with only one modification - I replaced jump to 'start' to direct jump to 'main' (only one line).Stef wrote:If not, do you checked the i_ldiv function in sega.s file ? as you don't have the base library you need manual implementation of 32 bits multiplication and division for GCC. Maybe the division code (used by modulo function) is buggy but i'm surprised as i never meet any problems. Did you modified it ?