Publication: Sinc-Link
Pub Details: Sinc-Link v9 n2 (Volume 9, Issue 2)
Date: March/April 1991
Pages: 34-35
5 REM Listing entered and modified for the Larken System by G. Chambers.
10 POKE 23658,0: CLS : PRINT AT 2,10;"IMAGE EDIT"''"Your Computer April 1985, p 135";'''TAB 6;"Menu:"''"1/2/3/4 Load Screen"''"S Start Editor"''"Q Quit"
15 PRINT '"6 Return to Basic"''"0 Clear Screen"''"8/9 OVER/OVERlap Black"
17 PRINT '"H Help"
20 IF INKEY$="q" THEN STOP
30 IF INKEY$="s" THEN GO TO 100
35 IF INKEY$="h" THEN GO TO 1000
41 LET c=CODE INKEY$: IF c>48 AND c<53 THEN LET sc=(CODE INKEY$)-49: INPUT "Input Full Screen Name ";n$: RANDOMIZE USR 100: LOAD n$CODE sc*6144+40000: GO TO 10
50 GO TO 20
100 CLS : RANDOMIZE USR 23296: PRINT #0;"Save Image Y/N ? "
110 IF INKEY$="y" THEN INPUT "Name ? ";n$: RANDOMIZE USR 100: SAVE n$SCREEN$ : GO TO 10
120 IF INKEY$="n" THEN GO TO 10
130 GO TO 110
1000 CLS : PRINT TAB 12;"IMAGE EDIT"
1010 PRINT '" Have you ever wished to combineindividual screen$. This is difficult in Basic as you cannotmerge two screens or load one with OVER on."
1020 PRINT '" This program, Image Edit, letsyou combine pictures."
1040 PRINT '" You will be presented with a menu. If you want to combine 2, 3, or 4 images, load them into different SCREEN$. Press keys 1 to 4 in turn to load the desiredscreens into memory. When you have loaded all the desired screens, press the S key to start the machine code program."
1050 PAUSE 0: CLS : PRINT " There are two different ways of combining images, using the m/c commands OR or XOR."
1060 PRINT '" 'XOR' puts the images together the same way as the Basic command OVER. Where there is an overlap, a space is made. 'OR' adds the images completely, leaving the overlap black. When using the m/c program, press 1, 2, 3, or 4 to put an image on the screen. It will be added to whatever is on the screen according to the mode XOR or OR."
1070 PRINT '" When returning to the program you will be given the opportuni-ty of Saving the composite or loading more images."
1080 PAUSE 0: CLS : PRINT ''" It is possible to create some other effects by combinations ofthe two modes. For example, you can subtract an image from what is already on the screen by adding it first in OR mode, thenin XOR mode."
1090 PRINT '" When combining pictures, colours are ignored as they would be jumbled when combined. The final image is Saved as black on white"
1100 PRINT 'TAB 6;"***************"
1110 PAUSE 0: GO TO 10
8999 STOP
9000 RANDOMIZE USR 100: SAVE "image.B1" LINE 9020
9010 STOP
9020 BORDER 7: PAPER 7: INK 0: CLEAR 39999: RANDOMIZE USR 100: LOAD "image.C1"CODE 23296: GO TO 10
image.C1
23296 5B00 LD B,247;
23298 5B02 LD C,254;
23300 5B04 LD A,B
23301 5B05 IN A,(C)
23303 5B07 AND 1;
23305 5B09 JR Z,23360
23307 5B0B LD A,B
23308 5B0C IN A,(C)
23310 5B0E AND 2;
23312 5B10 JR Z,23383
23314 5B12 LD A,B
23315 5B13 IN A,(C)
23317 5B15 AND 4;
23319 5B17 JR Z,23406
23321 5B19 LD A,B
23322 5B1A IN A,(C)
23324 5B1C AND 8;
23326 5B1E JR Z,23430
23328 5B20 LD B,239;
23330 5B22 LD A,B
23331 5B23 IN A,(C)
23333 5B25 AND 16;
23335 5B27 RET Z
23336 5B28 LD A,B
23337 5B29 IN A,(C)
23339 5B2B AND 4;
23341 5B2D JR Z,23468
23343 5B2F LD A,B
23344 5B30 IN A,(C)
23346 5B32 AND 2;
23348 5B34 JR Z,23476
23350 5B36 LD A,B
23351 5B37 IN A,(C)
23353 5B39 AND 1;
23355 5B3B CALL Z,2214
23358 5B3E JR 23296
23360 5B40 LD DE,16384
23363 5B43 LD HL,40000
23366 5B46 LD BC,6144
23369 5B49 LD A,(DE)
23370 5B4A CALL 23454
23373 5B4D LD (DE),A
23374 5B4E INC DE
23375 5B4F INC HL
23376 5B50 DEC BC
23377 5B51 LD A,B
23378 5B52 OR C
23379 5B53 JR NZ,23369
23381 5B55 JR 23296
23383 5B57 LD DE,16384
23386 5B5A LD HL,46144
23389 5B5D LD BC,6144
23392 5B60 LD A,(DE)
23393 5B61 CALL 23454
23396 5B64 LD (DE),A
23397 5B65 INC DE
23398 5B66 INC HL
23399 5B67 DEC BC
23400 5B68 LD A,B
23401 5B69 OR C
23402 5B6A JR NZ,23392
23404 5B6C JR 23296
23406 5B6E LD DE,16384
23409 5B71 LD HL,52288
23412 5B74 LD BC,6144
23415 5B77 LD A,(DE)
23416 5B78 CALL 23454
23419 5B7B LD (DE),A
23420 5B7C INC DE
23421 5B7D INC HL
23422 5B7E DEC BC
23423 5B7F LD A,B
23424 5B80 OR C
23425 5B81 JR NZ,23415
23427 5B83 JP 23296
23430 5B86 LD DE,16384
23433 5B89 LD HL,58432
23436 5B8C LD BC,6144
23439 5B8F LD A,(DE)
23440 5B90 CALL 23454
23443 5B93 LD (DE),A
23444 5B94 INC DE
23445 5B95 INC HL
23446 5B96 DEC BC
23447 5B97 LD A,B
23448 5B98 OR C
23449 5B99 JR NZ,23439
23451 5B9B JP 23296
23454 5B9E PUSH AF
23455 5B9F LD A,(23681)
23458 5BA2 BIT 0,A
23460 5BA4 JR Z,23465
23462 5BA6 POP AF
23463 5BA7 OR (HL)
23464 5BA8 RET
23465 5BA9 POP AF
23466 5BAA XOR (HL)
23467 5BAB RET
23468 5BAC LD A,0;
23470 5BAE LD (23681),A
23473 5BB1 JP 23296
23476 5BB4 LD A,1;
23478 5BB6 LD (23681),A
23481 5BB9 JP 23296
23484 5BBC NOP
23485 5BBD NOP
23296 – PRINTER BUFFER
23681 – UNUSED BYTE IN SYSTEM VARS
100 REM IMAGE EDIT The code for the Image Edit program
105 REM ** For the TS2068** To use on the Spectrum POKE 23356,107; POKE 23357,13
110 RESTORE 120: FOR n=23296 TO 23486: READ a: POKE n,a: NEXT n
120 DATA 6,247,14,254,120,237
121 DATA 120,230,1,40,53,120
122 DATA 237,120,230,2,40,69
123 DATA 120,237,120,230,4,40
124 DATA 85,120,237,120,230,8
125 DATA 40,102,6,239,120,237
126 DATA 120,230,16,200,120,237
127 DATA 120,230,4,40,125,120
128 DATA 237,120,230,2,40,126
129 DATA 120,237,120,230,1,204
130 DATA 166,8,24,192,17,0
131 DATA 64,33,64,156,1,0
132 DATA 24,26,205,158,91,18
133 DATA 19,35,11,120,177,32
134 DATA 244,24,169,17,0,64
135 DATA 33,64,180,1,0,24
136 DATA 26,205,158,91,18,19
137 DATA 35,11,120,177,32,244
138 DATA 24,146,17,0,64,33
139 DATA 64,204,1,0,24,26
140 DATA 205,158,91,18,19,35
141 DATA 11,120,177,32,244,195
142 DATA 0,91,17,0,64,33
143 DATA 64,228,1,0,24,26
144 DATA 205,158,91,18,19,35
145 DATA 11,120,177,32,244,195
146 DATA 0,91,245,58,129,92
147 DATA 203,71,40,3,241,182
148 DATA 201,241,174,201,62,0
149 DATA 50,129,92,195,0,91
150 DATA 62,1,50,129,92,195
151 DATA 0,91,0,0,0,0
310 PRINT AT 15,5;"Data has been entered"''" Press a key to select drive, and save to disk."
320 PAUSE 0: INPUT "Drive # ";drv: RANDOMIZE USR 100: GO TO drv: RANDOMIZE USR 100: SAVE "image.C1"CODE 23296,188
8990 STOP
9000 RANDOMIZE USR 100: SAVE "image.Bx"
Media
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.