Hi everyone,
I am making a 1px bidirectional scroll, in a small SCREEN2 window. It's done quite simply by loading a new charset for every 1px move. To do that, I have prepared 8 charsets, each being a 1px right shift of the previous one.
I have some trouble making it work correctly, and I cannot get my head around what's going wrong. It seems to work fine except that it jumps briefly every 8 pixels to an incorrect position.
I load the charset like this:
ld a,(x_pos) and 7 jr z,$+5 dec a ; needed because of the xor 7 ; right shifted charsets call load_charset
Initially, I loaded a new map each time the x_pos reached zero. But that transition actually varies depending on the scroll direction. When going right, a new map is needed between +0 and +7. When going left, it's between +7 and +0. So I bluntly tested loading a new map at each step, but the problem is still there:
- going left: at some point the map jumps left 8 px, then jumps back at the correct position
- going right: at some point the map jumps right 8 px, then jumps back at the correct position
I cannot get my head around this problem.
Could someone point me in the right direction ?
Thanks.