Byte-Mapped Scroll

Authors

Publication

Pub Details

Date

Pages

See all articles from T-S Horizons n15

Most printing to the screen involves just 22 lines and 32 columns. One line scrolling is quickly done with RANDOMIZE USR 2361. This program takes scrolling a bit further. It will scroll each scan-line row of any defined block of graphics or text on the screen. The block will wrap around or scroll off the screen as you desire.

Most printing to the screen involves just 22-lines and 32-columns. One line scrolling is quickly done with RANDOMIZE USR 2361 (TIMEX Tech Manual).

This program takes scrolling a bit further. It will scroll each scan-line row of any defined block of graphics or text on the screen. The block will wrap around or scroll off the screen as you desire.

Enter the program exactly as listed; enter CLEAR 65134 FREE and get 32171 bytes free, then RUN the program. Output is a block of code (232-bytes) to save to tape and the short program listing (on the screen) to access the code.

How It works: the line (scan-line row) addresses are unscrambled using the function dispatcher and stored as a table in the lower portion of the stack. The upper portion of the stack is actively used by the program’s machine code. Lines are alternately stored then sent to the display file in an order to produce the scrolling effect. The code is stored above 65134.

Products

 

Downloadable Media

 

Image Gallery

Source Code

    1 REM "BYTE-MAPPED SCROLL" by: C. Vernon Tidwell 1303 Whitehead st. Key West, Fl. 33040 
    8 CLEAR 65134: PRINT AT 10,11 ; "ONE MOMENT": RESTORE : GO SUB 1000: CLS 
   10 PRINT '''TAB 7; "BYTE-MAPPED SCROLL"'''TAB 4; "1) Demonstration Program"''TAB 4; "2) Develop Code; Test & Save"''TAB 4; "3) Save Program"'''TAB 6; "Press Number Desired": PAUSE 0: IF INKEYS<>"2" AND INKEYS<>"3" THEN GO SUB 9100: GO TO 10 
   12 IF INKEY$="3" THEN GO TO 9992 
   14 CLS : PRINT " Define The Block To Scroll"''"Enter the top line, bottom line, left column, and right column; then indicate whether this blockis to scroll up or down and alsoindicate whether it is to wrap- around for continuous scrolling."
   16 PRINT '"The lines are are numbered from 0 to175 (from bottom to d top). The columns are numbered from 0 10 31 (left to right)."'': GO SUB 100
   18 PRINT '''"YES or NO: INPUT y or n"
   20 LET Z$="": INPUT "SCROLL UP: ";Z$: IF CODE Z$=121 THEN LET S=65333: PRINT AT 18,0;"SCROLL UP": GO TO 24
   22 PRINT AT 18,0;"SCROLL DOWN": LET S=65350
   24 LET Z$="": INPUT "WRAP-AROUND: ";Z$: IF CODE Z$=121 THEN LET W=65138: LET Z=65203: PRINT AT 19,0;"WRAP-AROUND": GO TO 28
   26 PRINT AT 19,0;"NON-WRAP": LET W=65135: LET Z=0
   28 PRINT AT 21,0;"  PRESS ANY KEY TO TEST SCROLL": PRINT #0;"WHEN DONE WITH TEST, PRESS ENTER": PAUSE 0: GO SUB 9310
   30 PRINT "NOTE: Save CODE & Reload With      CLEAR 65134: LOAD """"CODE    Access this code with lines suchas the following or use examplesin the demonstration. The USR Values can vary; jot them down   for reference."
   32 PRINT : IF W=65138 THEN PRINT "9994 RANDOMIZE USR 65203"
   34 IF S=65333 THEN PRINT "9995 RANDOMIZE USR 65333"
   36 IF S=65350 THEN PRINT "9995 RANDOMIZE USR 65350"
   38 PRINT "9996 Your program to scroll goes here"
   40 IF W=65138 THEN PRINT "9997 RANDOMIZE USR 65138"
   42 IF W=65135 THEN PRINT "9997 RANDOMIZE USR 65135"
   44 PRINT "9998 IF INKEY$ = """" THEN GO TO 9997"
   46 PRINT AT 18,0;"1) SAVE ""CODE""CODE 65135,232"," 2) Return To Program Menu"
   48 PRINT #0;TAB 5;"PRESS 1 OR 2 AS DESIRED": PAUSE 0: IF CODE INKEY$=50 THEN CLS : GO TO 10
   50 RANDOMIZE USR 2217: SAVE "CODE"CODE 65135,232: BEEP .1,30: GO TO 48
  100 POKE 23617,236: INPUT "ENTER TOP LINE = ";Y: IF Y<=175 AND Y>=0 THEN PRINT "TOP LINE = ";Y: GO TO 102
  101 BEEP .2,10: GO TO 100
  102 INPUT "ENTER BOTTOM LINE = ";B: IF B<=Y AND B>=0 AND B<=175 THEN PRINT "BOTTOM LINE = ";B: GO TO 104
  103 BEEP .2,10: GO TO 102
  104 INPUT "ENTER LEFT COLUMN = ";X: IF X>=0 AND X<=31 THEN PRINT "LEFT COLUMN = ";X: GO TO 106
  105 BEEP .2,10: GO TO 104
  106 INPUT "ENTER RIGHT COLUMN = ";A: IF A>=X AND A>=0 AND A<=31 THEN PRINT "RIGHT COLUMN = ";A: GO TO 108
  107 BEEP .2,10: GO TO 106
  108 RESTORE 1016: LET X=X+8: LET A=A+1-(X/8): FOR N=1 TO 5: READ C: POKE C,B-1: NEXT N
  110 LET COLS=INT (A AND A<=(256-X)/8): POKE 65158,COLS: POKE 65187,COLS: POKE 65345,Y+1: POKE 65354,Y+1
  112 LET COORD=256*(Y+1)+X: LET C=COORD/256: POKE 65140,INT C: POKE 65288,INT C: LET C=(C-INT C)*256: POKE 65139,INT C: POKE 65287,INT C
  114 RETURN
 1000 REM POKE MC TO ABOVE RAMTOP
 1002 FOR N=65135 TO 65217: READ C: POKE N,C: NEXT N
 1004 FOR N=65218 TO 65281: POKE N,0: NEXT N
 1006 FOR N=65282 TO 65366: READ C: POKE N,C: NEXT N: RETURN
 1008 DATA 205,179,254,1,0,176,33,0,96,5,120,254,255,200,197,205,44,255,229,17,194,254,1,32,0,197,237,176,193,209,33,226,254,237,176,209,193,5,120,254,255,200,197,235
 1010 DATA 205,44,255,229,17,226,254,1,32,0,197,237,176,193,209,3,194,254,237,176,225,193,24,197,33,225,254,1,33,0,13,200,197,35,54,0,193,24,247
 1012 DATA 1,0,96,197,1,0,176,5,120,254,255,40,27,197,205,29,255,193,209,235,115,35,114,35,229,24,236,33,0,0,229,229,33,87,0,229,205,0,98,201,193,201,94,35,86,35,193,229,235,197,201
 1014 DATA 33,8,255,54,255,35,54,4,33,12,255,54,176,205,2,255,201,33,8,255,54,176,35,54,4,5,33,12,255,54,176,35,54,201
 1016 DATA 65147,65175,65292,65337,65362
 9100 REM Demonstration Program
 9101 CLS : PRINT AT 5,5;"DEMONSTRATION PROGRAMS"," #1 Scroll Up With Wraparound"," #2 Scroll Up & Down (Non-Wrap)"," #3 Scroll Down With Wraparound","Press ENTER To Exit Each Display": PAUSE 0: LET Y=140: LET X=12: LET A=20: LET B=20: GO SUB 108: PAPER 0: BORDER 0: INK 7: CLS
 9110 RANDOMIZE USR 65203: RANDOMIZE USR 65333
 9111 PLOT 100,142: DRAW 0,8: DRAW -40,20: DRAW 140,0: DRAW -40,-20: DRAW 0,-8: PLOT 100,19: DRAW 60,0: DRAW -30,-19: DRAW -30,19: FOR N=4 TO 14 STEP 2: PLOT 100,N*10: DRAW 60,-10: PLOT 110,(N*10)-10: DRAW 40,-10: NEXT N: PLOT 100,141: DRAW 60,0
 9112 PLOT 100,20: FOR n=1 TO 6: DRAW 10,10: DRAW -10,10: NEXT n: PLOT 150,20: FOR n=1 TO 6: DRAW 10,10: DRAW -10,10: NEXT n
 9113 RANDOMIZE USR 65138: IF INKEY$="" THEN GO TO 9113
 9200 CLS : FOR N=1 TO 50: PRINT "GOOD MORNING! ";: NEXT N: PRINT #0;TAB 9,"Use Arrow Keys"
 9202 IF INKEY$="6" THEN RANDOMIZE USR 65350: GO TO 9206
 9203 IF CODE INKEY$=13 THEN GO TO 9210
 9204 IF INKEY$="7" THEN RANDOMIZE USR 65333: GO TO 9208
 9205 GO TO 9202
 9206 IF INKEY$="6" THEN RANDOMIZE USR 65135: GO TO 9206
 9207 GO TO 9202
 9208 IF INKEY$="7" THEN RANDOMIZE USR 65135: GO TO 9208
 9209 GO TO 9202
 9300 LET Y=103: LET X=6: LET A=26: LET B=72: GO SUB 108: LET Z=65203: LET U=65138: LET S=65350
 9310 CLS : FOR n=1 TO 117: PRINT "HELLO ";: NEXT n: IF Z<>0 THEN RANDOMIZE USR Z
 9312 RANDOMIZE USR S
 9313 RANDOMIZE USR U: IF INKEY$="" THEN GO TO 9313
 9314 PAPER 7: BORDER 7: INK 0: CLS : RETURN
 9992 SAVE "BYTEMAP": BEEP .1,30
Scroll to Top