• Aucun résultat trouvé

HORIZONTAL SMOOTH SCROLL

Dans le document Controller The Am8052 (Page 102-105)

./ ADDR CHARACTER FONT

5.2 HORIZONTAL SMOOTH SCROLL

Vertical screen scrolling on standard terminals is done by replacing the text line by line; the text replacing the scrolled line on a scan line basis. The text moves in steps of line partitions (scan lines).

This produce smaller jumps and is almost unnoticeable to the viewer; It appears to be a con-tinuous, 'smooth, upward or downward movement of the texr on screen. The'scrolling itself is exe-cuted without CPU interventions.

In applications that involve displaying text running off the screen horizontally requires scrolling the text accordingly. Once the user has experienced 'vertical smooth scroll, the demand for horizontal smooth scroll will come naturally. Similar to vertical smooth scroll, horizontal smooth scroll can be done by replacing characters on a pixel basis. Al-though the CRTC does not have a bUilt-in mechan-ism to control horizontal smooth scrolling, this appli-cation note provides some ideas for a practical im- , plementation. External MSllogic and CPU interven-tions are required to control the scrOlling process.

The basic idea behind this scrolling technique is to place a dummy character in front of the line. This character is made invisible by delaying the horizontal BLANK with external logiC. The enti.re line is then moved by modifying the width of this dummy character, utilizing the proportional character capability of the Am8152A Video System Controller (VSC). The blank delay covers the en-tire dummy character when it is programmed forfull width: By reducing the width of this character, the first visible character moves left and gets partially covered. Characters seem to enter the screen on the right side and leave on the left side. Figure 5-7 diagrams the process.

Figure 5-6 Character Code and Attribute sequence to load "An and "f"

5-5

Detailed Descriptipn:

Here it assumes a non-proportional spacing environment with a character width of 8 pixels, and a dummy character width 01.10 pixels; there is no restriction to these values. Extemallogic hides the dummy character and the first visible character by c;lelaying BLANK (10 pixels). The delayed BLANK ma~ks off the serial video stream,put out by the . VSC (Figure 5-8). '

By reducing the character' width of the dummy ch~racter from 10 to. 2 pixels in 8 steps, the leftmost character is mov(ld out. The dummy character has to be wider t~an the widest visible character in order to hide a dummy character (2 pixels minimul11" width) as well as the leftmost character in the blanked space (Step 9 of Figure 5-7) .. The width' of the dummy character can be controlled by using several methods described in the following paragraphs. Step 9 of Figure 5-7 is optional, it is shown to clarify the entire process.

The user can expand the dummy character to its

BI,ANKED PART

ful,1 size (10 pixels) when only one piicel of the leftmost character is left visible (Step 8 to Step 10).

Horizontal smooth-scrolling can be made frame-synchronous by incblporath1g the Vertical Interrupt of-the CRTC. ' This interrupt is issued once per frame. The scroll rate can range from as low as one pixel per several frames to several pixels per frame. ' This is similar to the programmable scroll rate for vertical smooth scrolling. For additionaLinformation refer to Section 2 of this handbook.

External Blanking

One of the criterion for this application is to find a simple way of delaying BLANK to the appropriate number of pixels (example 10) to hide the dummy character.

A practical approach is to delay BLANK by feeding it through two D~flip-f(ops clocked by the system clock CLK1. This requires CLK1 period to be

VISIBLE PART OF THE SCREEN

STEP 1: DUMMY 1ST

STEP 2:,

STEP 8:

STEP 9:

STEP 10:

STEP 11:

CHARACTER CH~R.

10 PIXEL$ 8 PIXELS

1ST 2ND.

CHAR. CHAR.

DUMMY 2ND

CHARACTER CHAR, 10 PIXELS 8 PIXELS

LEFT BORDER OF THE SCREEN

Figure 5-7

05098B 5-7

larger th~n the character clock period (CLK2) and that CLK1 has the appropriate pixel width (Figures 5-8 and 5-9).

Another approach is to use a counter to delay the BLANK for the appropriate. number of pixels. The counter is to be clocked by the DOT Clock and enabled by the first edge of CLK1 or CLK2. after BLANK active. The problem with this approach is that an external DOT Clock must be available. Most

BLANK

applications make use of the built-in PLL of the VSC and consequently an external DOT Clock in unavailable.

Width Control

The width of the dummy character can be modified by using the propOrtional character' display cap-abilities of the VSC. In propdrtional character

DELAYED BLANK

CLKli---+--~---;

Am8052

CLK1 BLANK (Am8052) DELAYED BLANK CLK2

CHARACTER ROW STEP 1

CLK2

CHARACTER ROW STEP 2

CLKl VIDli---f---'--I

" - - - 1 BLANK VID21 - - - I - - - I

Am8152

05098B 5-8

Figure 5-8 Delaying BLANK

05098B 5-9

Figure 5·9 Delayed BLANK Timing

5-,7

applications, where the character font generator already contains a set .of characters with widths between 2 and 10, no special hardware is neces-sary (Figure 5-10). The CPU-changes the dummy character for each scrolling step. The new char-acter has either a decreased or increased width, depending on the scrolling direction. Decreasing the width causes a left scroll; increasing the width causes a right scroll. The row data list has to be updated after scrolling an entire character.

. In proportional character applications, the user has to keep track of the width of the.character inserted or deleted when updating the row data list. The modification of the width of the dummy character is a function of the width of the inserted or deleted character.

In applications with a fixed character-width, it might be practical to add a character-font width generator to implement a character set of different widths for the dummy character.

Another approach in controlling the width of the dummy character is to include the bias of the row in the Row Attribute Word. This attribute word is put out during horizontal retrace, and can be latched by HSYNC (Figure 5-11). The character attribute AP9 is only activated during scanning the dummy character to switch the multiplexer. The multi-plexer normally guides the Character Font Gen,-erator output to the VSC CLK2-Divider inputs.

Only during scanning the dummy character the 4-bit width stored in the Row Attribute Word is used.

This approach is advantageous when the linked-list contains only one Row Redefinition Block common to all rows. In that case, the CPU only has to update one word to move the screen hori-zontally. In the other approaches the CPU has to

update one character per row.

5.3 BJT·MAPPED GRAPHICS WITH

Dans le document Controller The Am8052 (Page 102-105)