Tom ,if i use your hsync routine ,in first time for make a background x_scroll, the scrolling is flicking !!
But a background y_scroll is normal ..
Bug removed, it turn more faster in C LOOL , :-"
this
temp=map_x+scroll_x1;
#asm
lda _temp+1 ;// This is over a hunderd times faster
ldy _temp
lsr a
say
ror a
cly
sta _hs_x_l,y
sta _hs_x_h,y
#endasm
replaced by
temp=map_x+scroll_x1;
hs_x_l[0]=temp>>1; /* A little fixed/float point variable */
hs_x_h[0]=temp>>9;
temp=map_y+scroll_y1;
hs_y_l[0]=temp>>1;
hs_y_h[0]=temp>>9;
finaly i have replaced by
#asm
cly
lda _temp
sta _hs_x_l,y
lda _temp+1
sta _hs_x_h,y
#endasm
it seems that your code is a 2 divider .
For exemple, if i have 10 in temp,both hs_x_h and hs_x_l have 5 ..
probably not the best way, but it works.