2068 Display Block Moves

Authors

Publication

Publication Details

Date

Pages

See all articles from Update October 1993

In the Z80 microprocessor used in the 2068 is a command called LDIR that may be used to quickly move defined blocks of data from one RAM location to another. The routine listed below moves all or portions of the screen display (DFILE1) to RAM address 30000, from which it may then be moved back to the display file.

Because of the manner in which pixels and attributes are addressed in DFILE1, the simplest way to define a block to be moved is either the whole DFILE1 file, or the top, middle, or bottom third of the file. A pixel-by-pixel or line-by-line block-move requires much more complex definitions.

Some uses for this technique might be to insert text or graphics into a menu or to do animated displays. While the number of such displays stored in RAM is limited, many more may be saved to disk. This is a revision of an original article I wrote for the May-June 1985 SyncWare News.

1 CLEAR 29999
10 PRINT "0 - Load SCRN display file"'"1 - Full-screen store"'"2 - Top screen store"'"3 - Middle screen store"'"4 - Bottom screen store"
20 PAUSE 0: LET k$=INKEY$: IF k$="" THEN GO TO 20
30 IF k$="0" THEN CLS : LOAD "SCRN" CODE : PRINT "Any key to continue": PAUSE 0: RUN
40 IF k$="1" THEN LET STP=16384: LET INS=INT (STP/256) : LET NOB=6192: LET INB=INT (NOB/256): GO TO 80
50 IF k$="2" THEN LET STP=16384: LET INS=INT (STP/256): LET NOB=204S: LET INB=INT (NOB/256): GO TO 80
60 IF k$="3" THEN LET STP=163S4+2048: LET INS=INT (STP/256): LET NOB=2048: LET INB=INT (NOB/256) : GO TO 80
70 IF k$="4" THEN LET STP=16384+4096: LET INS=INT (STP/256): LET NOB=2096: LET INB=INT (NOB/256)
80 CLS : REM Create screen-fill
90 FOR n=1 TO 704: PRINT "\`.";:NEXT n
100 FOR n=0 TO 21: PRINT AT n,0;n: NEXT n
110 REM Defines selected lines/cols and copies from DFILEl to RAM
120 POKE 65356,1: REM LD BC,no. of bytes to move
130 POKE 65357,NOB-(256*INB) : REM n LSB
140 POKE 65358,INB: REM n MSB
150 POKE 65359,17: REM LD DE,destination address 30000
160 POKE 65360,48: REM n LSB
170 POKE 65361,117: REM n MSB
180 POKE 65362,33: REM LD HL,source address
190 POKE 65363,STP-(256*INS) : REM n LSB
200 POKE 65364, INS: REM n MSB
210 POKE 65365,237: REM ED prefix
220 POKE 65366,176: REM LDIR block-move
230 POKE 65367,201: REM RETurn
240 RANDOMIZE USR 65356: REM Call block-move routine
250 PRINT #0;AT 1,0; "Any key to continue": PAUSE 0
260 REM Moves RAM data to DFILE1
270 CLS
280 POKE 65357, NOB-(INB*256) : REM LSB no. bytes
290 POKE 65358, INB: REM MSB nobytes
300 POKE 65360,STP-(256*INS) : REM LSB dest
310 POKE 65361, INS: REM MSB dest
320 POKE 65363,48: REM LSB source in RAM (30000)
330 POKE 65364,117: REM MSB sou rce in RAM (30000)
340 RANDOMIZE USR 65356
350 PRINT #0;"Key 5 to save or m for menu"
360 PAUSE 0: IF INKEY*="5" THEN PRINT #0;AT 0,0,,,,: GO TO 9998
370 RUN
9997 SAVE "SCRNmove" LINE 1: STOP
9998 SAVE "SCRN "CODE STP,NOB
9999 RUN

Products

 
Scroll to Top