View Single Post
  #9   Spotlight this post!  
Unread 23-06-2002, 22:23
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Re: Here's a theory....

Posted by Jerry Eckert.

Engineer from Looking for a team in Raleigh, NC sponsored by .

Posted on 3/16/2000 8:26 AM MST


In Reply to: Here's a theory.... posted by Mike Gray on 3/16/2000 7:27 AM MST:




: For reverse: Assume that the filtered joystick value ranges from 127 to 255. You multiply by 3 and divide by 2, then clamp at 126, so the member never moves...UNTIL the joystick exceeds 170 counts. Since p1_yfilt is a single byte, it rolls over beyond 255 counts and its value then becomes 0. Full speed, turbo, wrong direction.

: Floating point math: 171*3/2=256.5

: Integer math: 171*3/2=0

Computations are performed using a 16-bit scratchpad and truncated, if necessary, when the final result is stored. In the example above, evaluation of the expression yields a result of 256. The MAX function then clamps the value at 126 before it is stored in the 8-bit destination.



__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.