Home » Personal collection » Acorn tapes » Electron_User » Electron_User_tape10b_acorn_eu_1990_april.wav » CPROG3

CPROG3

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 tapes » Electron_User » Electron_User_tape10b_acorn_eu_1990_april.wav
Filename: CPROG3
Read OK:
File size: 069B bytes
Load address: 2000
Exec address: 1900
Duplicates

There are 3 duplicate copies of this file in the archive:

File contents
   10REM Colour Compactor
   20REM By R.Henderson
   30REM (c) Electron User
   40MODE 0
   50MODE 6
   60A$="Compaction failed"
   70FOR i%=0 TO 2 STEP 2
   80P%=&900
   90[ OPT i%
  100.scrunch
  110LDA #&58
  120STA &73
  130LDA #&30
  140STA &71
  150LDA #0
  160STA &70
  170STA &72
  180LDA #1
  190STA &78
  200LDY #0
  210.main
  220INC &70
  230BEQ inc
  240JMP out
  250.inc
  260INC &71
  270.out
  280LDA (&72),Y
  290STA &77
  300STA (&70),Y
  310INC &70
  320BEQ in2
  330JMP out2
  340.in2
  350INC &71
  360.out2
  370LDA &78
  380STA (&70),Y
  390INC &72
  400BEQ in3
  410JMP check
  420.in3
  430INC &73
  440LDA &73
  450BPL check
  460RTS
  470.check
  480LDA (&72),Y
  490CMP &77
  500BEQ put
  510JMP main
  520.put
  530LDA (&70),Y
  540CLC
  550ADC #1
  560STA (&70),Y
  570STA &79
  580INC &72
  590BEQ in4
  600JMP check2
  610.in4
  620INC &73
  630LDA &73
  640BPL check2
  650RTS
  660.check2
  670LDA &79
  680CMP #&FF
  690BNE chk
  700JMP main
  710.chk
  720LDA (&72),Y
  730CMP &77
  740BNE main
  750BEQ put
  760\ Redraw original screen
  770\ From compacted data...
  780.decomp
  790LDA #&30
  800STA &71
  810LDA #&58
  820STA &73
  830LDA #1
  840STA &70
  850LDA #0
  860STA &72
  870TAY
  880.rest
  890LDA (&70),Y
  900STA &75
  910INY
  920LDA (&70),Y
  930STA &76
  940STY &74
  950LDY #0
  960.redraw
  970LDA &75
  980STA (&72),Y
  990INC &72
 1000BEQ cp
 1010JMP dec
 1020.cp
 1030INC &73
 1040LDA &73
 1050BPL dec
 1060RTS
 1070.dec
 1080DEC &76
 1090BNE redraw
 1100LDY &74
 1110INY
 1120BNE rest
 1130INC &71
 1140JMP rest
 1150]
 1160NEXT
 1170MODE 5
 1180HIMEM=&3000
 1190VDU 23,1,0;0;0;0;
 1200PROCtri_draw
 1210CALL scrunch
 1220PROCgive_size
 1230CLS
 1240CALL decomp
 1250END
 1260 
 1270DEF PROCtri_draw
 1280FOR x%=1 TO 20
 1290GCOL 3,RND(3)
 1300MOVE RND(1278),RND(1024)
 1310MOVE RND(1278),RND(1024)
 1320PLOT 85,RND(1278),RND(1024)
 1330NEXT
 1340ENDPROC
 1350 
 1360DEF PROCgive_size 
 1370start%=&3000
 1380end%=(?&71*&100)+?&70
 1390IF end%>&57FF CLS:PRINT''A$:END
 1400PRINT "Size = ";end%-start%
 1410G=GET
 1420ENDPROC

� Colour Compactor
� By R.Henderson
� (c) Electron User
(� 0
2� 6
<A$="Compaction failed"
F� i%=0 � 2 � 2
PP%=&900
Z[ OPT i%
d.scrunch
nLDA #&58
xSTA &73
�LDA #&30
�STA &71
�
LDA #0
�STA &70
�STA &72
�
LDA #1
�STA &78
�
LDY #0
�	.main
�INC &70
�BEQ inc
�JMP out
�.inc
INC &71
.out
LDA (&72),Y
"STA &77
,STA (&70),Y
6INC &70
@BEQ in2
JJMP out2
T.in2
^INC &71
h	.out2
rLDA &78
|STA (&70),Y
�INC &72
�BEQ in3
�
JMP check
�.in3
�INC &73
�LDA &73
�
BPL check
�RTS
�
.check
�LDA (&72),Y
�CMP &77
�BEQ put
�JMP main
.put
LDA (&70),Y
CLC
&
ADC #1
0STA (&70),Y
:STA &79
DINC &72
NBEQ in4
XJMP check2
b.in4
lINC &73
vLDA &73
�BPL check2
�RTS
�.check2
�LDA &79
�CMP #&FF
�BNE chk
�JMP main
�.chk
�LDA (&72),Y
�CMP &77
�BNE main
�BEQ put
�\ Redraw original screen
\ From compacted data...
.decomp
LDA #&30
 STA &71
*LDA #&58
4STA &73
>
LDA #1
HSTA &70
R
LDA #0
\STA &72
fTAY
p	.rest
zLDA (&70),Y
�STA &75
�INY
�LDA (&70),Y
�STA &76
�STY &74
�
LDY #0
�.redraw
�LDA &75
�STA (&72),Y
�INC &72
�
BEQ cp
�JMP dec
�.cp
INC &73
LDA &73
BPL dec
$RTS
..dec
8DEC &76
BBNE redraw
LLDY &74
VINY
`BNE rest
jINC &71
tJMP rest
~]
��
�� 5
��=&3000
�� 23,1,0;0;0;0;
�
�tri_draw
�
� scrunch
��give_size
��
�� decomp
��
� 
�� �tri_draw
� x%=1 � 20

� 3,�(3)
� �(1278),�(1024)
� �(1278),�(1024)
(� 85,�(1278),�(1024)
2�
<�
F 
P� �give_size 
Zstart%=&3000
dend%=(?&71*&100)+?&70
n� end%>&57FF �:�''A$:�
x� "Size = ";end%-start%
�G=�
��
�
00000000  0d 00 0a 16 f4 20 43 6f  6c 6f 75 72 20 43 6f 6d  |..... Colour Com|
00000010  70 61 63 74 6f 72 0d 00  14 14 f4 20 42 79 20 52  |pactor..... By R|
00000020  2e 48 65 6e 64 65 72 73  6f 6e 0d 00 1e 17 f4 20  |.Henderson..... |
00000030  28 63 29 20 45 6c 65 63  74 72 6f 6e 20 55 73 65  |(c) Electron Use|
00000040  72 0d 00 28 07 eb 20 30  0d 00 32 07 eb 20 36 0d  |r..(.. 0..2.. 6.|
00000050  00 3c 1a 41 24 3d 22 43  6f 6d 70 61 63 74 69 6f  |.<.A$="Compactio|
00000060  6e 20 66 61 69 6c 65 64  22 0d 00 46 12 e3 20 69  |n failed"..F.. i|
00000070  25 3d 30 20 b8 20 32 20  88 20 32 0d 00 50 0b 50  |%=0 . 2 . 2..P.P|
00000080  25 3d 26 39 30 30 0d 00  5a 0c 5b 20 4f 50 54 20  |%=&900..Z.[ OPT |
00000090  69 25 0d 00 64 0c 2e 73  63 72 75 6e 63 68 0d 00  |i%..d..scrunch..|
000000a0  6e 0c 4c 44 41 20 23 26  35 38 0d 00 78 0b 53 54  |n.LDA #&58..x.ST|
000000b0  41 20 26 37 33 0d 00 82  0c 4c 44 41 20 23 26 33  |A &73....LDA #&3|
000000c0  30 0d 00 8c 0b 53 54 41  20 26 37 31 0d 00 96 0a  |0....STA &71....|
000000d0  4c 44 41 20 23 30 0d 00  a0 0b 53 54 41 20 26 37  |LDA #0....STA &7|
000000e0  30 0d 00 aa 0b 53 54 41  20 26 37 32 0d 00 b4 0a  |0....STA &72....|
000000f0  4c 44 41 20 23 31 0d 00  be 0b 53 54 41 20 26 37  |LDA #1....STA &7|
00000100  38 0d 00 c8 0a 4c 44 59  20 23 30 0d 00 d2 09 2e  |8....LDY #0.....|
00000110  6d 61 69 6e 0d 00 dc 0b  49 4e 43 20 26 37 30 0d  |main....INC &70.|
00000120  00 e6 0b 42 45 51 20 69  6e 63 0d 00 f0 0b 4a 4d  |...BEQ inc....JM|
00000130  50 20 6f 75 74 0d 00 fa  08 2e 69 6e 63 0d 01 04  |P out.....inc...|
00000140  0b 49 4e 43 20 26 37 31  0d 01 0e 08 2e 6f 75 74  |.INC &71.....out|
00000150  0d 01 18 0f 4c 44 41 20  28 26 37 32 29 2c 59 0d  |....LDA (&72),Y.|
00000160  01 22 0b 53 54 41 20 26  37 37 0d 01 2c 0f 53 54  |.".STA &77..,.ST|
00000170  41 20 28 26 37 30 29 2c  59 0d 01 36 0b 49 4e 43  |A (&70),Y..6.INC|
00000180  20 26 37 30 0d 01 40 0b  42 45 51 20 69 6e 32 0d  | &70..@.BEQ in2.|
00000190  01 4a 0c 4a 4d 50 20 6f  75 74 32 0d 01 54 08 2e  |.J.JMP out2..T..|
000001a0  69 6e 32 0d 01 5e 0b 49  4e 43 20 26 37 31 0d 01  |in2..^.INC &71..|
000001b0  68 09 2e 6f 75 74 32 0d  01 72 0b 4c 44 41 20 26  |h..out2..r.LDA &|
000001c0  37 38 0d 01 7c 0f 53 54  41 20 28 26 37 30 29 2c  |78..|.STA (&70),|
000001d0  59 0d 01 86 0b 49 4e 43  20 26 37 32 0d 01 90 0b  |Y....INC &72....|
000001e0  42 45 51 20 69 6e 33 0d  01 9a 0d 4a 4d 50 20 63  |BEQ in3....JMP c|
000001f0  68 65 63 6b 0d 01 a4 08  2e 69 6e 33 0d 01 ae 0b  |heck.....in3....|
00000200  49 4e 43 20 26 37 33 0d  01 b8 0b 4c 44 41 20 26  |INC &73....LDA &|
00000210  37 33 0d 01 c2 0d 42 50  4c 20 63 68 65 63 6b 0d  |73....BPL check.|
00000220  01 cc 07 52 54 53 0d 01  d6 0a 2e 63 68 65 63 6b  |...RTS.....check|
00000230  0d 01 e0 0f 4c 44 41 20  28 26 37 32 29 2c 59 0d  |....LDA (&72),Y.|
00000240  01 ea 0b 43 4d 50 20 26  37 37 0d 01 f4 0b 42 45  |...CMP &77....BE|
00000250  51 20 70 75 74 0d 01 fe  0c 4a 4d 50 20 6d 61 69  |Q put....JMP mai|
00000260  6e 0d 02 08 08 2e 70 75  74 0d 02 12 0f 4c 44 41  |n.....put....LDA|
00000270  20 28 26 37 30 29 2c 59  0d 02 1c 07 43 4c 43 0d  | (&70),Y....CLC.|
00000280  02 26 0a 41 44 43 20 23  31 0d 02 30 0f 53 54 41  |.&.ADC #1..0.STA|
00000290  20 28 26 37 30 29 2c 59  0d 02 3a 0b 53 54 41 20  | (&70),Y..:.STA |
000002a0  26 37 39 0d 02 44 0b 49  4e 43 20 26 37 32 0d 02  |&79..D.INC &72..|
000002b0  4e 0b 42 45 51 20 69 6e  34 0d 02 58 0e 4a 4d 50  |N.BEQ in4..X.JMP|
000002c0  20 63 68 65 63 6b 32 0d  02 62 08 2e 69 6e 34 0d  | check2..b..in4.|
000002d0  02 6c 0b 49 4e 43 20 26  37 33 0d 02 76 0b 4c 44  |.l.INC &73..v.LD|
000002e0  41 20 26 37 33 0d 02 80  0e 42 50 4c 20 63 68 65  |A &73....BPL che|
000002f0  63 6b 32 0d 02 8a 07 52  54 53 0d 02 94 0b 2e 63  |ck2....RTS.....c|
00000300  68 65 63 6b 32 0d 02 9e  0b 4c 44 41 20 26 37 39  |heck2....LDA &79|
00000310  0d 02 a8 0c 43 4d 50 20  23 26 46 46 0d 02 b2 0b  |....CMP #&FF....|
00000320  42 4e 45 20 63 68 6b 0d  02 bc 0c 4a 4d 50 20 6d  |BNE chk....JMP m|
00000330  61 69 6e 0d 02 c6 08 2e  63 68 6b 0d 02 d0 0f 4c  |ain.....chk....L|
00000340  44 41 20 28 26 37 32 29  2c 59 0d 02 da 0b 43 4d  |DA (&72),Y....CM|
00000350  50 20 26 37 37 0d 02 e4  0c 42 4e 45 20 6d 61 69  |P &77....BNE mai|
00000360  6e 0d 02 ee 0b 42 45 51  20 70 75 74 0d 02 f8 1c  |n....BEQ put....|
00000370  5c 20 52 65 64 72 61 77  20 6f 72 69 67 69 6e 61  |\ Redraw origina|
00000380  6c 20 73 63 72 65 65 6e  0d 03 02 1c 5c 20 46 72  |l screen....\ Fr|
00000390  6f 6d 20 63 6f 6d 70 61  63 74 65 64 20 64 61 74  |om compacted dat|
000003a0  61 2e 2e 2e 0d 03 0c 0b  2e 64 65 63 6f 6d 70 0d  |a........decomp.|
000003b0  03 16 0c 4c 44 41 20 23  26 33 30 0d 03 20 0b 53  |...LDA #&30.. .S|
000003c0  54 41 20 26 37 31 0d 03  2a 0c 4c 44 41 20 23 26  |TA &71..*.LDA #&|
000003d0  35 38 0d 03 34 0b 53 54  41 20 26 37 33 0d 03 3e  |58..4.STA &73..>|
000003e0  0a 4c 44 41 20 23 31 0d  03 48 0b 53 54 41 20 26  |.LDA #1..H.STA &|
000003f0  37 30 0d 03 52 0a 4c 44  41 20 23 30 0d 03 5c 0b  |70..R.LDA #0..\.|
00000400  53 54 41 20 26 37 32 0d  03 66 07 54 41 59 0d 03  |STA &72..f.TAY..|
00000410  70 09 2e 72 65 73 74 0d  03 7a 0f 4c 44 41 20 28  |p..rest..z.LDA (|
00000420  26 37 30 29 2c 59 0d 03  84 0b 53 54 41 20 26 37  |&70),Y....STA &7|
00000430  35 0d 03 8e 07 49 4e 59  0d 03 98 0f 4c 44 41 20  |5....INY....LDA |
00000440  28 26 37 30 29 2c 59 0d  03 a2 0b 53 54 41 20 26  |(&70),Y....STA &|
00000450  37 36 0d 03 ac 0b 53 54  59 20 26 37 34 0d 03 b6  |76....STY &74...|
00000460  0a 4c 44 59 20 23 30 0d  03 c0 0b 2e 72 65 64 72  |.LDY #0.....redr|
00000470  61 77 0d 03 ca 0b 4c 44  41 20 26 37 35 0d 03 d4  |aw....LDA &75...|
00000480  0f 53 54 41 20 28 26 37  32 29 2c 59 0d 03 de 0b  |.STA (&72),Y....|
00000490  49 4e 43 20 26 37 32 0d  03 e8 0a 42 45 51 20 63  |INC &72....BEQ c|
000004a0  70 0d 03 f2 0b 4a 4d 50  20 64 65 63 0d 03 fc 07  |p....JMP dec....|
000004b0  2e 63 70 0d 04 06 0b 49  4e 43 20 26 37 33 0d 04  |.cp....INC &73..|
000004c0  10 0b 4c 44 41 20 26 37  33 0d 04 1a 0b 42 50 4c  |..LDA &73....BPL|
000004d0  20 64 65 63 0d 04 24 07  52 54 53 0d 04 2e 08 2e  | dec..$.RTS.....|
000004e0  64 65 63 0d 04 38 0b 44  45 43 20 26 37 36 0d 04  |dec..8.DEC &76..|
000004f0  42 0e 42 4e 45 20 72 65  64 72 61 77 0d 04 4c 0b  |B.BNE redraw..L.|
00000500  4c 44 59 20 26 37 34 0d  04 56 07 49 4e 59 0d 04  |LDY &74..V.INY..|
00000510  60 0c 42 4e 45 20 72 65  73 74 0d 04 6a 0b 49 4e  |`.BNE rest..j.IN|
00000520  43 20 26 37 31 0d 04 74  0c 4a 4d 50 20 72 65 73  |C &71..t.JMP res|
00000530  74 0d 04 7e 05 5d 0d 04  88 05 ed 0d 04 92 07 eb  |t..~.]..........|
00000540  20 35 0d 04 9c 0b d3 3d  26 33 30 30 30 0d 04 a6  | 5.....=&3000...|
00000550  13 ef 20 32 33 2c 31 2c  30 3b 30 3b 30 3b 30 3b  |.. 23,1,0;0;0;0;|
00000560  0d 04 b0 0d f2 74 72 69  5f 64 72 61 77 0d 04 ba  |.....tri_draw...|
00000570  0d d6 20 73 63 72 75 6e  63 68 0d 04 c4 0e f2 67  |.. scrunch.....g|
00000580  69 76 65 5f 73 69 7a 65  0d 04 ce 05 db 0d 04 d8  |ive_size........|
00000590  0c d6 20 64 65 63 6f 6d  70 0d 04 e2 05 e0 0d 04  |.. decomp.......|
000005a0  ec 05 20 0d 04 f6 0f dd  20 f2 74 72 69 5f 64 72  |.. ..... .tri_dr|
000005b0  61 77 0d 05 00 0f e3 20  78 25 3d 31 20 b8 20 32  |aw..... x%=1 . 2|
000005c0  30 0d 05 0a 0c e6 20 33  2c b3 28 33 29 0d 05 14  |0..... 3,.(3)...|
000005d0  15 ec 20 b3 28 31 32 37  38 29 2c b3 28 31 30 32  |.. .(1278),.(102|
000005e0  34 29 0d 05 1e 15 ec 20  b3 28 31 32 37 38 29 2c  |4)..... .(1278),|
000005f0  b3 28 31 30 32 34 29 0d  05 28 18 f0 20 38 35 2c  |.(1024)..(.. 85,|
00000600  b3 28 31 32 37 38 29 2c  b3 28 31 30 32 34 29 0d  |.(1278),.(1024).|
00000610  05 32 05 ed 0d 05 3c 05  e1 0d 05 46 05 20 0d 05  |.2....<....F. ..|
00000620  50 11 dd 20 f2 67 69 76  65 5f 73 69 7a 65 20 0d  |P.. .give_size .|
00000630  05 5a 10 73 74 61 72 74  25 3d 26 33 30 30 30 0d  |.Z.start%=&3000.|
00000640  05 64 19 65 6e 64 25 3d  28 3f 26 37 31 2a 26 31  |.d.end%=(?&71*&1|
00000650  30 30 29 2b 3f 26 37 30  0d 05 6e 1a e7 20 65 6e  |00)+?&70..n.. en|
00000660  64 25 3e 26 35 37 46 46  20 db 3a f1 27 27 41 24  |d%>&57FF .:.''A$|
00000670  3a e0 0d 05 78 1b f1 20  22 53 69 7a 65 20 3d 20  |:...x.. "Size = |
00000680  22 3b 65 6e 64 25 2d 73  74 61 72 74 25 0d 05 82  |";end%-start%...|
00000690  07 47 3d a5 0d 05 8c 05  e1 0d ff                 |.G=........|
0000069b
CPROG3.m0
CPROG3.m1
CPROG3.m2
CPROG3.m4
CPROG3.m5