Re: A82: Re: a pong paddle, logically


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

Re: A82: Re: a pong paddle, logically



 When you do a read from the display controller the first byte you read is
not the data you expect, so you have to do an extra read. If you look at the
rutines for graph lib (graph.inc) or splib which i send to the list you will
see how to do this. Basically it is just another in a,(11h) before you
start.

T-states is a way of telling how long an instruction takes. So if you know
the number of T-states you have to wiat you can see how many instrcutions
you have to execute between out/in's. The number of T-states is different
from instruction to instruction, the book Programming the Z80 by Rodney Zaks
includes a list of the number of T-states the instrcutions take (other books
might do this too).

I think his email adresse is sdavies@mail.trilogy.net

Dines

-----Original Message-----
From: GeradS711@aol.com <GeradS711@aol.com>
To: assembly-82@lists.ticalc.org <assembly-82@lists.ticalc.org>
Date: 25. oktober 1997 00:57
Subject: Re: A82: Re: a pong paddle, logically



>Thanks for looking over the routine. Just a couple quick questions about
your
>comments. . .
>In the first comment, (You have to do two reads the first time otherwise
this
>wont work.) what do you mean by this, ie how do I change the program, do I
do
>in a,(11h) again?
>And also, what are T-States? Also, what is sam davies's email adress
>
>
>In a message dated 97-10-24 10:12:11 EDT, you write:
>
>> I did not test the rutine, but i had a look at the source code and found
a
>>  few things which should be changed.
>>
>>  >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
>>  You have to do two reads the first time otherwise this wont work.
>>  >   call $7F3
>>  >   out a,(11h)
>>  >   ld b, 12
>>  >repeat1:
>>  >   call $7F3
>>  >   in a,(11h)
>>  >   or %01100000
>>  >   call $7F3
>>  >   out (11h),a
>>  >   djnz repeat1
>>  These two delays can be made a bit shorter. Sam Davies did some testing
on
>>  the delays need, have a look at that.
>>  >   call $7F3
>>  >   in a,(llh)
>>  >   and %10011111
>>  >   call$7F3
>>  >   out (11h),a
>>  >   ret
>>  >
>>  >
>>  Almost all the delays in the rutine can be made short since the call
$7F3
>>  takes longer that what is need by the display controller. I can not
>remember
>>  the exact number but i tkink you only need 20 T-states.
>>
>>  Dines
>>
>
>
>