Re: A82: Side-Scrolling - some code


[Prev][Next][Index][Thread]

Re: A82: Side-Scrolling - some code




I tihnk I fixed some errors in the code (marked with !DCJ), but it is pretty
late so i could be wrong.

Dines

> Scroll_Left: ; the routine to call
>     ld  bc, 96
> Screen_Loop: ; the loop that scrolls the screen one pixel bc times
>     push    bc
>     ld  b, 64
> Scroll_Loop: ; scrolls the screen 1 pixel, line by line (first bc line)
>     push    bc
> APD_POS = &+1
>     ld  hl, APD_BUF+11 ; end of first line
>     ld  b, 12
>     or  a   ;clear carry flag !DCJ only clear carry first time
> Scroll_Line_APD: ; scrolls one line of the apd buffer left one bit
>     rl  (hl)
>     dec hl
>     djnz    Scroll_Line_APD
> GRAPH_POS = &+1
>     ld  hl, GRAPH_MEM+11
>     ld  b, 12
> Scroll_Line_Graph: ; Graph scrolls one line of the graph buffer left one
bit
>     rl  (hl)
>     dec hl
>     djnz    Scroll_Line_Graph
>     ld  hl, (APD_POS)
>     ld  de, 12
>     add hl, de
>     ld (APD_POS),hl ; !DCJ better save the result
>     ld  hl, (GRAPH_POS)
>     add hl, de
>     ld (GRAPH_POS),hl ; !DCj better save the result
>     pop bc
>     djnz    Scroll_Loop
>     call    DISP_GRAPH
>     pop bc
>     djnz    Screen_Loop
>     ret   ; !DCJ done so return



References: