Chapter Ninety-One: The Moving Ball
"Xiaohong, this is the filter that Cook said?" Feng Wan looked at the matchbox-sized thing in her hand and asked in surprise.
Lin Hong nodded: "Yes." This is an adaptive signal filter. Even though it's only that big, it's still quite useful and can filter out background noise very well. ”
This little thing was designed by him after spending more than a month constantly testing and adjusting it to cope with the increasing noise of radio signals in the air.
Although he had never seen anything like it before, he never expected that Cook would have such a high regard for this thing. In his opinion, as long as this thing has figured out the principle, it should not be difficult.
That being said, this is wishful thinking on his part. If you don't have a deep understanding of these circuits, you won't be able to put them together. And those who can understand are restrained by the influence of some habitual thinking. According to conventional theory, several of these basic circuits cannot be connected in this way, otherwise the circuit will definitely be burned.
But subtly, when these basic circuits are combined, they will form a large circuit, and this overall circuit will produce a unique function, which will theoretically burn out the ground circuit well, and it will be natural.
One plus one does not necessarily equal two.
Feng Wan didn't understand these things, she had already been moved by Cook's words, but when she saw the final "product" in her hand, her confidence was a little shaken.
So, to be on the safe side, she started calling her friends and asking professionals about patents.
Lin Hong didn't pay much attention to this matter, this little thing was just made by him for his own use, and later he made a signal gainer to match it, which was not big, so he brought it here together, and let Cook take a look at this thing when he turned around.
While his mother was on the phone, he went back to his room and continued to read the red book in his hand.
He is now looking at the firmware part of the monitor.
The basic principle of the display in this period is to accelerate the electrons to bombard the phosphor screen to produce bright spots, so as to achieve the effect of displaying text or images.
The CRT is like a black box, with magnetic fields in all six directions, and electrons are accelerated or shifted under the action of magnetic fields. For example, if you want to display a horizontal line on a display, you can send a continuous beam of electrons from the cathode, pointing at the far left of the screen at first, and then adding a magnetic field in the left and right directions to "pull" the electron beam from left to right. It's like a guy with a machine gun shooting from the far left to the right, and finally blasting a bullet mark on the target (fluorescent display).
Controlling the electronics to form specific characters and patterns is a very delicate operation that cannot be done manually, and even sharpshooters cannot neatly write simple Chinese characters on the wall with a machine gun, let alone draw complex shapes.
So the engineers encapsulated these operations into simple instructions, treating the entire display as a black box, as long as you say "draw a horizontal line" to the black box, then the black box will automatically display a horizontal line on the display, as for how it is implemented, the user does not need to care about these details.
This black box is the firmware. When leaving the factory, the manufacturer will give a thick firmware technical manual, in which the instructions that can be supported in the display are detailed in detail, the drawing of points and lines is the most basic, and some even draw a variety of basic geometric shapes. Of course, some hardware engineers will even secretly bury an easter egg in it, such as a specific instruction that can display his name on the monitor by himself.
Although Lin Hong knew how to repair the TV before, he didn't know why the TV could display such a complex pattern, and after reading this chapter, he finally had a deeper understanding.
Before reading this chapter, he knew the basic "print" command, which could print characters on the monitor, but he was blind as to why this command could print characters.
And now he knows that this is because there is a place in the display hardware called the "display memory" (video memory), which is a very special area where anything in this area is mapped to the display. The principle is very similar to a shadow game he played as a child.
When a flashlight shines on his hand at night, a large image appears on the wall, and the pattern on the wall changes as his fingers make various movements.
The video memory is equivalent to his "hand", and the display screen is the "wall".
The action completed by the "print" command is to send the characters to be displayed to the video memory area, so that the firmware part will automatically complete the corresponding mapping of the content in the video memory and the content on the display.
Lin Hong's display storage area on this apple_ii is pitifully small, only 1kb in size, corresponding to the display area of 24 rows and 40 columns on this monitor.
Put a letter "a" into the video memory, and specify which row and which column, then the letter a will be displayed on the corresponding coordinates on the monitor, which is the basic display principle of the display characters on the monitor.
Lin Hong didn't continue to read this part, but started the Apple computer, planning to make a program to try it.
What's the best thing to make up?
He was a little undecided.
Beginners tend to be a little confused about what they've learned and don't know how to apply it to their own programs. I want to write a program, but I don't know what kind of program to write.
In fact, Lin Hong's biggest goal at the moment is to write a game by himself, but it seems that it is not easy, and with his current ability, it is a bit ambitious.
Eventually, he decided to start with the simplest and draw a small ball on the monitor first.
Basic has ready-made paint functions, and using the function of drawing a circle quickly draws a small circle on the monitor, and then fills it with white. It's as simple as calling the function directly.
Next, Lin Hong wanted to make the ball move, moving from one place to another.
There is no movement function in basic, so you have to do it yourself.
How can I move?
Lin Hong remembered the scene of watching movies in the countryside before. Film tape is made up of static films, and by moving the film to make the characters move. Sun Wu once got such a piece of film from the projectionist, and Lin Hong carefully observed that the adjacent films looked the same, but in fact they were different, and there were subtle movements between movements.
He felt that he could also use this way to make the ball move.
So, he drew another ball next to the ball, which was the second film, but the ball in front had to be erased if he wanted to be dynamic.
How to erase it? There is no instruction function to erase images in basic.
Lin Hong thought about it for a long time, and finally used a stupid method, he drew a black ball in the place of the previous ball, which just covered the original one, and the background color was also black, which was equivalent to erasing the ball.
The specific process is as follows: Lin Hong first draws a white ball, and after a second, draws another white ball five pixels to the left, and at the same time, uses a black ball to cover the original white ball, and so on, all the way to the far right end of the screen. By controlling the duration of each dwell and the length of the displacement, he can also adjust the speed at which the ball moves.
Looking at the fast-moving white ball in the monitor, Lin Hong showed a knowing smile on his face, although the functions completed now are relatively simple, but this is a good start.
Seek demons