next up previous
Next: Diagnosing Timing Problem Up: Problems Encountered Previous: Problems Encountered

Execution Time Too Long

The first algorithm for locating the ball that tried was the coordinate averaging algorithm, with zoom factor 1. This was not enough, so machine code insertion was tried. For example a 68020 LSR (Left Shift Routine) insertion ([4]) was used for division by 2, which was implemented with a divide instruction by the compiler.

It turned out to be impractical, since the routine which reads the video memory from the video processor took too long. The time required to just read video memory (262,144 pixels) is 0.425 x 1/8 = 53 milli-second (ms). Here, since the CPU reads from the FG-100-V in X-mode (8 pixels at once), 0.425 is divided by 8. Obviously, the whole execution time was over the deadline (33 ms). By the way there were two possible modes to access the pixels, Z-mode and X-mode. The Z-mode accesses single 12-bit pixels and the X-mode accesses eight horizontally-adjacent pixels from two specific memory planes. The X-mode was used, since it is eight times faster than Z-mode. The problem of not having enough time to read in 512x512 pixels could be solved by changing the zoom factor from 1 to 8 (i.e, from 512x480, or 245,760 pixels, to 64x60, or 3,840 pixels). In other words, reading pixels with zoom factor 8 is 64 times faster than with zoom factor 1.



Ted &
Wed Feb 5 10:50:20 EST 1997