[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NADA.PONG on YouTube!
aiiadict@gmail.com wrote:
On Oct 6, 11:17 pm, "Michael J. Mahon" <mjma...@aol.com> wrote:
Ken Gagne recently uploaded the NADA.PONG video demo to
Youtube:
Any chance of speeding up the transition of the "ball" to the
other computer?
The program is in Applesoft, so much of the time required to
"send" the ball to the receiving machine is BASIC time.
After the program determines that the ball should be handed
off, it does 5 POKEs and a GOTO, which I estimate require
about 20 milliseconds to execute at 1MHz. Then the actual
&POKE NadaNet operation requires about 1 millsecond to
arbitrate, then 4 packets are exchanged (request, ack, data,
data ack) at about 1 millisecond each, for a total of 25
milliseconds (less than two video fields).
If the program were written in assembly language, all the
POKE overhead would be unnecessary, and only the 5 millisecond
NadaNet communication overhead would remain, for about a 5x
speedup. Since the video generators of different machines are
randomly synchronized, the average latency between them is
half a field, or 8.3 milliseconds, so a 5 millisecond delay
in the handoff is probably not an issue.
Because of the way the receiving machine polls for the ball,
about 5%-10% of the time it is in Applesoft looping back to
the &SERVE statement, so there is a 5%-10% chance of "missing"
the sending machine's send attempt, which will cause the sender
to retry in 20 milliseconds, so taking another 20 milliseconds
to communicate.
In assembly language, the window for missing the transmission
is extremely small, and so the chance of incurring a retry is
almost nil (but not, of course, impossible).
-michael
NadaPong: Network game demo for Apple II computers!
Home page: http://members.aol.com/MJMahon/
"The wastebasket is our most important design
tool--and it's seriously underused."