A82: a pong paddle, logically


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

A82: a pong paddle, logically



Would the following alogarithm work for changing the pixels on the second and
third column.
It would look like this (without changing anything that already existed on
the display):
 || with 12 pixels down and 2 wide.
Basically what the program is supposed to do is first it sets the cursor to
go down after each byte is written. Then it loads the original position for
the paddle. Next it gets the byte above the paddle and turns the pixels off
there. Then it repeats twelve times, getting the pixels and turning the
pixels on for the paddle. Finally it turns the pixels below the paddle off.
Nothing should be changed (w/respect to the display), other than the pixels
for the paddle. This code is pretty much public domain, just give me a little
credit if you use it, eventhough it is no good for drawing anything other
than a pong paddle.
ANYWAY, what I wrote all this for was to ask somebody to see if it would work
like it is supposed to. Also, could you show me what display delays (if any)
can be eliminated.
Thanx
drawpaddle:
   ld a, 7
   call $7F3
   out (10h), a
   ld a,(paddlepos)
   call $7F3
   out (10h), a
   ld a, $20
   call $7F3
   out (10h), a
   call $7F3
   in a,(11h)
   and %10011111
   call $7F3
   out a,(11h)
   ld b, 12
repeat1:
   call $7F3
   in a,(11h)
   or %01100000
   call $7F3
   out (11h),a
   djnz repeat1
   call $7F3
   in a,(llh)
   and %10011111
   call$7F3
   out (11h),a
   ret