Home » Personal collection » Acorn ADFS disks » Greaseweazled » dfs_box04_disk02b_eug_scripts.adf » SHIP64/CharEdit

SHIP64/CharEdit

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Greaseweazled » dfs_box04_disk02b_eug_scripts.adf
Filename: SHIP64/CharEdit
Read OK:
File size: 041B bytes
Load address: FFFF0E00
Exec address: FFFF802B
File contents
   10 *LO. BlocDat 2000
   20 MODE2:HIMEM=&2000:ch=0:xp=0:yp=0:DIMs%(15,15)
   30 REPEAT PROCgetsp
   40 REPEAT COLOUR -7*(s%(xp,yp)=0):COLOUR128+s%(xp,yp):PRINTTAB(xp+1,yp+1)"X";
   50 A$=GET$:IF A$="+" AND ch<>31 THEN ch=ch+1:UNTILTRUE:UNTILFALSE
   60 IF A$="-" AND ch<>0 THEN ch=ch-1:UNTILTRUE:UNTILFALSE
   70 IF A$="Z" AND xp<>0 THEN COLOUR128+s%(xp,yp):PRINTTAB(xp+1,yp+1)" ";:xp=xp-1:UNTIL FALSE
   80 IF A$="X" AND xp<>15 THEN COLOUR128+s%(xp,yp):PRINTTAB(xp+1,yp+1)" ";:xp=xp+1:UNTIL FALSE
   90 IF A$=":" AND yp<>0 THEN COLOUR128+s%(xp,yp):PRINTTAB(xp+1,yp+1)" ";:yp=yp-1:UNTIL FALSE
  100 IF A$="/" AND yp<>15 THEN COLOUR128+s%(xp,yp):PRINTTAB(xp+1,yp+1)" ";:yp=yp+1:UNTIL FALSE
  110 IF ASC(A$)>64 AND ASC(A$)<73 THEN PROCsetc
  120 IF A$="S" THEN OSCLI"SAVE BlocDat 2000 3000":UNTILTRUE:UNTILTRUE:END
  130 IF ASC(A$)>47 AND ASC(A$)<58 THENch=3*(ASC(A$)-48):UNTILTRUE:UNTILFALSE
  140 UNTIL FALSE
  150DEFPROCgetsp:FORy=0TO15:FORx=0TO15:ad=&2000+&80*ch+8*(x DIV 2)+(y MOD 8):IF y>7 THEN ad=ad+64
  160IF(x MOD 2)=1THENc=(?ad)AND21ELSEc=((?ad)AND42)/2
  170c=(c AND 1)+(c AND 4)/2+(c AND 16)/4:s%(x,y)=c:COLOUR 128+c:PRINTTAB(x+1,y+1)" ";:NEXT,
  180 COLOUR7:COLOUR128:PRINTTAB(0,30)"Character: ";~ch
  190ENDPROC
  200DEFPROCsetc:CS=ASC(A$)-65:CS=(CS AND 1)+2*(CS AND 2)+4*(CS AND 4):IF(xp MOD 2)=0 THEN CS=2*CS:ND=&D5 ELSE ND=&EA
  210ad=&2000+&80*ch+8*(xp DIV 2)+(yp MOD 8):IF yp>7 THEN ad=ad+64
  220 ?ad=((?ad) AND ND)+CS:s%(xp,yp)=ASC(A$)-65:ENDPROC

 *LO. BlocDat 2000
) �2:�=&2000:ch=0:xp=0:yp=0:�s%(15,15)

 � �getsp
(9 � � -7*(s%(xp,yp)=0):�128+s%(xp,yp):�xp+1,yp+1)"X";
2+ A$=�:� A$="+" � ch<>31 � ch=ch+1:��:��
<% � A$="-" � ch<>0 � ch=ch-1:��:��
FC � A$="Z" � xp<>0 � �128+s%(xp,yp):�xp+1,yp+1)" ";:xp=xp-1:� �
PD � A$="X" � xp<>15 � �128+s%(xp,yp):�xp+1,yp+1)" ";:xp=xp+1:� �
ZC � A$=":" � yp<>0 � �128+s%(xp,yp):�xp+1,yp+1)" ";:yp=yp-1:� �
dD � A$="/" � yp<>15 � �128+s%(xp,yp):�xp+1,yp+1)" ";:yp=yp+1:� �
n" � �(A$)>64 � �(A$)<73 � �setc
x1 � A$="S" � �"SAVE BlocDat 2000 3000":��:��:�
�1 � �(A$)>47 � �(A$)<58 �ch=3*(�(A$)-48):��:��
� � �
�N��getsp:�y=0�15:�x=0�15:ad=&2000+&80*ch+8*(x � 2)+(y � 8):� y>7 � ad=ad+64
�(�(x � 2)=1�c=(?ad)�21�c=((?ad)�42)/2
�Fc=(c � 1)+(c � 4)/2+(c � 16)/4:s%(x,y)=c:� 128+c:�x+1,y+1)" ";:�,
�% �7:�128:�0,30)"Character: ";~ch
��
�^��setc:CS=�(A$)-65:CS=(CS � 1)+2*(CS � 2)+4*(CS � 4):�(xp � 2)=0 � CS=2*CS:ND=&D5 � ND=&EA
�9ad=&2000+&80*ch+8*(xp � 2)+(yp � 8):� yp>7 � ad=ad+64
�- ?ad=((?ad) � ND)+CS:s%(xp,yp)=�(A$)-65:�
�
00000000  0d 00 0a 16 20 2a 4c 4f  2e 20 42 6c 6f 63 44 61  |.... *LO. BlocDa|
00000010  74 20 32 30 30 30 0d 00  14 29 20 eb 32 3a d3 3d  |t 2000...) .2:.=|
00000020  26 32 30 30 30 3a 63 68  3d 30 3a 78 70 3d 30 3a  |&2000:ch=0:xp=0:|
00000030  79 70 3d 30 3a de 73 25  28 31 35 2c 31 35 29 0d  |yp=0:.s%(15,15).|
00000040  00 1e 0d 20 f5 20 f2 67  65 74 73 70 0d 00 28 39  |... . .getsp..(9|
00000050  20 f5 20 fb 20 2d 37 2a  28 73 25 28 78 70 2c 79  | . . -7*(s%(xp,y|
00000060  70 29 3d 30 29 3a fb 31  32 38 2b 73 25 28 78 70  |p)=0):.128+s%(xp|
00000070  2c 79 70 29 3a f1 8a 78  70 2b 31 2c 79 70 2b 31  |,yp):..xp+1,yp+1|
00000080  29 22 58 22 3b 0d 00 32  2b 20 41 24 3d be 3a e7  |)"X";..2+ A$=.:.|
00000090  20 41 24 3d 22 2b 22 20  80 20 63 68 3c 3e 33 31  | A$="+" . ch<>31|
000000a0  20 8c 20 63 68 3d 63 68  2b 31 3a fd b9 3a fd a3  | . ch=ch+1:..:..|
000000b0  0d 00 3c 25 20 e7 20 41  24 3d 22 2d 22 20 80 20  |..<% . A$="-" . |
000000c0  63 68 3c 3e 30 20 8c 20  63 68 3d 63 68 2d 31 3a  |ch<>0 . ch=ch-1:|
000000d0  fd b9 3a fd a3 0d 00 46  43 20 e7 20 41 24 3d 22  |..:....FC . A$="|
000000e0  5a 22 20 80 20 78 70 3c  3e 30 20 8c 20 fb 31 32  |Z" . xp<>0 . .12|
000000f0  38 2b 73 25 28 78 70 2c  79 70 29 3a f1 8a 78 70  |8+s%(xp,yp):..xp|
00000100  2b 31 2c 79 70 2b 31 29  22 20 22 3b 3a 78 70 3d  |+1,yp+1)" ";:xp=|
00000110  78 70 2d 31 3a fd 20 a3  0d 00 50 44 20 e7 20 41  |xp-1:. ...PD . A|
00000120  24 3d 22 58 22 20 80 20  78 70 3c 3e 31 35 20 8c  |$="X" . xp<>15 .|
00000130  20 fb 31 32 38 2b 73 25  28 78 70 2c 79 70 29 3a  | .128+s%(xp,yp):|
00000140  f1 8a 78 70 2b 31 2c 79  70 2b 31 29 22 20 22 3b  |..xp+1,yp+1)" ";|
00000150  3a 78 70 3d 78 70 2b 31  3a fd 20 a3 0d 00 5a 43  |:xp=xp+1:. ...ZC|
00000160  20 e7 20 41 24 3d 22 3a  22 20 80 20 79 70 3c 3e  | . A$=":" . yp<>|
00000170  30 20 8c 20 fb 31 32 38  2b 73 25 28 78 70 2c 79  |0 . .128+s%(xp,y|
00000180  70 29 3a f1 8a 78 70 2b  31 2c 79 70 2b 31 29 22  |p):..xp+1,yp+1)"|
00000190  20 22 3b 3a 79 70 3d 79  70 2d 31 3a fd 20 a3 0d  | ";:yp=yp-1:. ..|
000001a0  00 64 44 20 e7 20 41 24  3d 22 2f 22 20 80 20 79  |.dD . A$="/" . y|
000001b0  70 3c 3e 31 35 20 8c 20  fb 31 32 38 2b 73 25 28  |p<>15 . .128+s%(|
000001c0  78 70 2c 79 70 29 3a f1  8a 78 70 2b 31 2c 79 70  |xp,yp):..xp+1,yp|
000001d0  2b 31 29 22 20 22 3b 3a  79 70 3d 79 70 2b 31 3a  |+1)" ";:yp=yp+1:|
000001e0  fd 20 a3 0d 00 6e 22 20  e7 20 97 28 41 24 29 3e  |. ...n" . .(A$)>|
000001f0  36 34 20 80 20 97 28 41  24 29 3c 37 33 20 8c 20  |64 . .(A$)<73 . |
00000200  f2 73 65 74 63 0d 00 78  31 20 e7 20 41 24 3d 22  |.setc..x1 . A$="|
00000210  53 22 20 8c 20 ff 22 53  41 56 45 20 42 6c 6f 63  |S" . ."SAVE Bloc|
00000220  44 61 74 20 32 30 30 30  20 33 30 30 30 22 3a fd  |Dat 2000 3000":.|
00000230  b9 3a fd b9 3a e0 0d 00  82 31 20 e7 20 97 28 41  |.:..:....1 . .(A|
00000240  24 29 3e 34 37 20 80 20  97 28 41 24 29 3c 35 38  |$)>47 . .(A$)<58|
00000250  20 8c 63 68 3d 33 2a 28  97 28 41 24 29 2d 34 38  | .ch=3*(.(A$)-48|
00000260  29 3a fd b9 3a fd a3 0d  00 8c 08 20 fd 20 a3 0d  |):..:...... . ..|
00000270  00 96 4e dd f2 67 65 74  73 70 3a e3 79 3d 30 b8  |..N..getsp:.y=0.|
00000280  31 35 3a e3 78 3d 30 b8  31 35 3a 61 64 3d 26 32  |15:.x=0.15:ad=&2|
00000290  30 30 30 2b 26 38 30 2a  63 68 2b 38 2a 28 78 20  |000+&80*ch+8*(x |
000002a0  81 20 32 29 2b 28 79 20  83 20 38 29 3a e7 20 79  |. 2)+(y . 8):. y|
000002b0  3e 37 20 8c 20 61 64 3d  61 64 2b 36 34 0d 00 a0  |>7 . ad=ad+64...|
000002c0  28 e7 28 78 20 83 20 32  29 3d 31 8c 63 3d 28 3f  |(.(x . 2)=1.c=(?|
000002d0  61 64 29 80 32 31 8b 63  3d 28 28 3f 61 64 29 80  |ad).21.c=((?ad).|
000002e0  34 32 29 2f 32 0d 00 aa  46 63 3d 28 63 20 80 20  |42)/2...Fc=(c . |
000002f0  31 29 2b 28 63 20 80 20  34 29 2f 32 2b 28 63 20  |1)+(c . 4)/2+(c |
00000300  80 20 31 36 29 2f 34 3a  73 25 28 78 2c 79 29 3d  |. 16)/4:s%(x,y)=|
00000310  63 3a fb 20 31 32 38 2b  63 3a f1 8a 78 2b 31 2c  |c:. 128+c:..x+1,|
00000320  79 2b 31 29 22 20 22 3b  3a ed 2c 0d 00 b4 25 20  |y+1)" ";:.,...% |
00000330  fb 37 3a fb 31 32 38 3a  f1 8a 30 2c 33 30 29 22  |.7:.128:..0,30)"|
00000340  43 68 61 72 61 63 74 65  72 3a 20 22 3b 7e 63 68  |Character: ";~ch|
00000350  0d 00 be 05 e1 0d 00 c8  5e dd f2 73 65 74 63 3a  |........^..setc:|
00000360  43 53 3d 97 28 41 24 29  2d 36 35 3a 43 53 3d 28  |CS=.(A$)-65:CS=(|
00000370  43 53 20 80 20 31 29 2b  32 2a 28 43 53 20 80 20  |CS . 1)+2*(CS . |
00000380  32 29 2b 34 2a 28 43 53  20 80 20 34 29 3a e7 28  |2)+4*(CS . 4):.(|
00000390  78 70 20 83 20 32 29 3d  30 20 8c 20 43 53 3d 32  |xp . 2)=0 . CS=2|
000003a0  2a 43 53 3a 4e 44 3d 26  44 35 20 8b 20 4e 44 3d  |*CS:ND=&D5 . ND=|
000003b0  26 45 41 0d 00 d2 39 61  64 3d 26 32 30 30 30 2b  |&EA...9ad=&2000+|
000003c0  26 38 30 2a 63 68 2b 38  2a 28 78 70 20 81 20 32  |&80*ch+8*(xp . 2|
000003d0  29 2b 28 79 70 20 83 20  38 29 3a e7 20 79 70 3e  |)+(yp . 8):. yp>|
000003e0  37 20 8c 20 61 64 3d 61  64 2b 36 34 0d 00 dc 2d  |7 . ad=ad+64...-|
000003f0  20 3f 61 64 3d 28 28 3f  61 64 29 20 80 20 4e 44  | ?ad=((?ad) . ND|
00000400  29 2b 43 53 3a 73 25 28  78 70 2c 79 70 29 3d 97  |)+CS:s%(xp,yp)=.|
00000410  28 41 24 29 2d 36 35 3a  e1 0d ff                 |(A$)-65:...|
0000041b
SHIP64/CharEdit.m0
SHIP64/CharEdit.m1
SHIP64/CharEdit.m2
SHIP64/CharEdit.m4
SHIP64/CharEdit.m5