It was most convenient to display images of flame, stirrer and the drop using the character gen-erator. The splash cannot be done conveniently in the same manner. The reason is that a character can be displayed only at one of the saeen locations defined by VTAB (0-23)* and HTAB (0-39) but the splash must appear to be at the surface of the pool and the Y-coordinate (LIQY)
can have values from Q-191. Splash is done by directly poking values into appropriate bytes of screen memory. The Y-coordinate and HT AB are used together to find the corresponding screen memory . address. There is a ·routine in CHEMUTIL-2 which does that using look-up tables. Into each of three screen memory bytes located verti .. cally above one another is poked
numerical values which result in the · splash representa1ion appearing on the monitor. The same three bytes are then set to zero and the splash representation is blanked out. These operations are very fast and a delay has to be introduced between draw-ing the splash and erasing it.
Every time the liquid pool inaeases by eight vertical bytes, the value of BOTDRP VTAB must be decreased by one or the bottom drop will blank. some of the liquid. This means that the distance be-tween the topmost drop and the liquid level decreases and so does the total.number of crop images to be displayed. When TOPDRP = BOTDRP only one or two drop im-ages will be shown. In our coding we cannot allow the liquid level to rise above TOPDRP or, if it does, the dropping routine must be by-passed at that time.
As in our earlier routines we allow for stopping the routine by pressing the S-key at the keyboard and the delay loops are introduced to control the speed of the anima-tion. The delays are inserted to .control how long a given image remains on the screen; in this. case, while the crop or splash representa-tion is on the screen. the delays are here because we expect that the flame and stirrer animations will have to be activated while drops are fall-ing in the full distillation animation. There is more than one delay be-cause we may need to have flame
and s1irrer alternate between falling drops or have. one appear while a drop is being displayed and the other appear while a drop is being blanked out.
With three places where the timing of the animation can be tuned it would seem that ample provision for adjustments has been made. If the program given below is exe-cuted you should see a series of falling drops which periodically cause the liquid level to rise. However, the apparent speed of the drop will in-crease as the eight lines of liquid are drawn. This occurs because fewer . drops are c.tawn as the distance be-tween TOPDRP and BOTDRP de-creases. There is proportionately less for each prgram loop 1o do between successive splashes and the animation speeds up. To allow for this effect one or more of the delay intervals would have to be adjusted every eighth time the liquid level is incremented. This adjust-ment is left as an exercise for the reader. Beca
Because of the way the coding was structured, it is easy to make min~ changes. For example, you may wish to simulate an appa-ratus at reflux by having the drop splash but not have the liquid pool increases. You need to eliminate the LIQDRAW routines by poke '• 31962 ($7CDA), 96. To eliminate the splash yo~ should poke 32042 ($D2A), 96.
*This statement is not quite correct since CHEMUTIL-2 easily allows super and subscripted characters which effectively doubles the number of vertical locations available. Indeed, more sophisticated CHEMUTIL-2 users can make the character generator access all the vertical coordinate locations.
(1) Bendall, V. "CHEMUTIL-2, A Chemistry Programming Utility,; Project SERAPHIM, NSF Science Education; Department of Chemistry, Eastern Michigan University, Ypsilanti, Ml 48197, 1985.
(2) Bendaii,V. "CHHARACTEA,; Project SERAPHIM, NSF Science Education; Department of Chemis-try, Eastern Michigan University, Yp-silanti, Ml 48197, 1985.