Beruflich Dokumente
Kultur Dokumente
The display controller simply reads each successive byte of data from the
frame buffer and converts its Os and Is into the corresponding video signal.
This signal is then fed to the TV monitor, producing a black-and-white
pattern on the screen, like the wheel shown in Figure 1-6. The display
controller repeats this operation 30 times a second and thus maintains a
steady picture on the TV screen.
Suppose we wish to change the displayed picture. All we need do is modify
the frame buffer’s contents to represent the new pattern of pixels. In this way
we can achieve such effects as a rotating wheel or a wheel that grows and
shrinks.
We can now see how the ping-pong game might be programmed. Each of
the sixteen possible positions of the right-hand paddle could be displayed by
a different set of bit patterns; some of these are shown in Figure 1-7. The
computer reads the position of the right-hand control lever and selects the
appropriate pattern, substituting it for the right-hand column of 16 bytes in
the frame buffer. It does the same for the left-hand lever and the left-hand
column of the frame buffer. The position of the “ball” is computed, and the
appropriate bits are set to 1 in the frame buffer. This entire process is
repeated over and over again; meanwhile the display controller continues to
pass the contents of the frame buffer to the TV monitor to maintain the
moving picture on the screen.
The display controller simply reads each successive byte of data from the
frame buffer and converts its Os and Is into the corresponding video signal.
This signal is then fed to the TV monitor, producing a black-and-white
pattern on the screen, like the wheel shown in Figure 1-6. The display
controller repeats this operation 30 times a second and thus maintains a
steady picture on the TV screen.
Suppose we wish to change the displayed picture. All we need do is modify
the frame buffer’s contents to represent the new pattern of pixels. In this way
we can achieve such effects as a rotating wheel or a wheel that grows and
shrinks.
We can now see how the ping-pong game might be programmed. Each of
the sixteen possible positions of the right-hand paddle could be displayed by
a different set of bit patterns; some of these are shown in Figure 1-7. The
computer reads the position of the right-hand control lever and selects the
appropriate pattern, substituting it for the right-hand column of 16 bytes in
the frame buffer. It does the same for the left-hand lever and the left-hand
column of the frame buffer. The position of the “ball” is computed, and the
appropriate bits are set to 1 in the frame buffer. This entire process is
repeated over and over again; meanwhile the display controller continues to
pass the contents of the frame buffer to the TV monitor to maintain the
moving picture on the screen.