thanks for the help !
now the code is like the original example
but the color of lines dont swap...its strange ?
Well, in your modified code:
IF A > RoadStripe1 THEN rsetobj(A,R_sprite_CLUT, 2 ) END IF IF A <= RoadStripe1 THEN rsetobj(A,R_sprite_CLUT, 1 ) END IFRoadStripe is always 66 so the if will always be false.
Just for fun I modified your code to
IF ((A+counter) band 15) > 7 THEN rsetobj(A,R_sprite_CLUT, 2 ) else rsetobj(A,R_sprite_CLUT, 1 ) END IFand added a variable counter which is increased per VBL. Yay, fake movement
IF mod ( ZMap[A] + TexOffset , 100 ) > 50 THEN
make the loop slow...
Yes it should. This makes the cpu perform floating point divisions and return the modulo. Division is very expensive on its own but then rb+ also has to call an external library to do this which is even slower. Do that 66 times per frame and you end up with very slow code!
Like I said in a previous post, you need to convert all this from floating point to fixed point to make it fast enough.