Home » Archimedes archive » Acorn User » Acorn User - Shareware Collection (1993).adf » Process » !Process/GenMap

!Process/GenMap

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 » Archimedes archive » Acorn User » Acorn User - Shareware Collection (1993).adf » Process
Filename: !Process/GenMap
Read OK:
File size: 053E bytes
Load address: 0000
Exec address: 0000
File contents
   10REM > <Process$Dir>.GenMap
   20REM
   30REM Custom map generator
   40REM
   50REM by Henrik Bjerregaard Pedersen
   60REM    1.00 (05-Dec-1992)
   70
   80*RMEnsure Process 1.00 RMLoad <Process$Dir>.Process
   90
  100DIM Map% 256,Word% 4
  110
  120FOR entry%=0 TO 255
  130 REM Translate the byte to RGB-values
  140 SYS"Process_ByteToRGB",entry% TO !Word%
  150 red%    = Word%?1
  160 green%  = Word%?2
  170 blue%   = Word%?3
  180
  190 REM The actual mapping is done by PROCMap
  200 PROCMap(red%,green%,blue%)
  210
  220
  230 REM Check range
  240 IF red%   < 0   THEN red%   = 0
  250 IF red%   > 255 THEN red%   = 255
  260 IF green% < 0   THEN green% = 0
  270 IF green% > 255 THEN green% = 255
  280 IF blue%  < 0   THEN blue%  = 0
  290 IF blue%  > 255 THEN blue%  = 255
  300
  310 REM Translate from RGB to byte
  320 Word%?0 = 0
  330 Word%?1 = red%
  340 Word%?2 = green%
  350 Word%?3 = blue%
  360 SYS"Process_RGBToByte",!Word% TO mapped%
  370
  380 REM Write the mapped value to the map
  390 Map%?entry% = mapped%
  400NEXT
  410
  420SYS"OS_File",10,"<Process$Dir>.^.MyMap",&FFD,,Map%,Map%+256
  430END
  440
  450REM PROCMap returns the new RGB values
  460DEFPROCMap(RETURN red%,RETURN green%,RETURN blue%)
  470 red%   = 255-red%
  480 green% = 255-green%
  490 blue%  = 255-blue%
  500ENDPROC
  510
  520
  530
  540DEFPROCRedFilter(RETURN red%,RETURN green%,RETURN blue%)
  550 green% = 0
  560 blue%  = 0
  570ENDPROC
  580
  590DEFPROCLighten(RETURN red%,RETURN green%,RETURN blue%)
  600 red%   = red% +16
  610 green% = green% +16
  620 blue%  = blue% +16
  630ENDPROC

� > <Process$Dir>.GenMap
�
� Custom map generator
(�
2$� by Henrik Bjerregaard Pedersen
<�    1.00 (05-Dec-1992)
F
P7*RMEnsure Process 1.00 RMLoad <Process$Dir>.Process
Z
d� Map% 256,Word% 4
n
x� entry%=0 � 255
�' � Translate the byte to RGB-values
�* ș"Process_ByteToRGB",entry% � !Word%
� red%    = Word%?1
� green%  = Word%?2
� blue%   = Word%?3
�
�, � The actual mapping is done by PROCMap
� �Map(red%,green%,blue%)
�
�
� � Check range
�  � red%   < 0   � red%   = 0
�" � red%   > 255 � red%   = 255
  � green% < 0   � green% = 0
" � green% > 255 � green% = 255
  � blue%  < 0   � blue%  = 0
"" � blue%  > 255 � blue%  = 255
,
6! � Translate from RGB to byte
@ Word%?0 = 0
J Word%?1 = red%
T Word%?2 = green%
^ Word%?3 = blue%
h+ ș"Process_RGBToByte",!Word% � mapped%
r
|( � Write the mapped value to the map
� Map%?entry% = mapped%
��
�
�>ș"OS_File",10,"<Process$Dir>.^.MyMap",&FFD,,Map%,Map%+256
��
�
�(� PROCMap returns the new RGB values
�"��Map(� red%,� green%,� blue%)
� red%   = 255-red%
� green% = 255-green%
� blue%  = 255-blue%
��
�


(��RedFilter(� red%,� green%,� blue%)
& green% = 0
0 blue%  = 0
:�
D
N&��Lighten(� red%,� green%,� blue%)
X red%   = red% +16
b green% = green% +16
l blue%  = blue% +16
v�
�
00000000  0d 00 0a 1c f4 20 3e 20  3c 50 72 6f 63 65 73 73  |..... > <Process|
00000010  24 44 69 72 3e 2e 47 65  6e 4d 61 70 0d 00 14 05  |$Dir>.GenMap....|
00000020  f4 0d 00 1e 1a f4 20 43  75 73 74 6f 6d 20 6d 61  |...... Custom ma|
00000030  70 20 67 65 6e 65 72 61  74 6f 72 0d 00 28 05 f4  |p generator..(..|
00000040  0d 00 32 24 f4 20 62 79  20 48 65 6e 72 69 6b 20  |..2$. by Henrik |
00000050  42 6a 65 72 72 65 67 61  61 72 64 20 50 65 64 65  |Bjerregaard Pede|
00000060  72 73 65 6e 0d 00 3c 1b  f4 20 20 20 20 31 2e 30  |rsen..<..    1.0|
00000070  30 20 28 30 35 2d 44 65  63 2d 31 39 39 32 29 0d  |0 (05-Dec-1992).|
00000080  00 46 04 0d 00 50 37 2a  52 4d 45 6e 73 75 72 65  |.F...P7*RMEnsure|
00000090  20 50 72 6f 63 65 73 73  20 31 2e 30 30 20 52 4d  | Process 1.00 RM|
000000a0  4c 6f 61 64 20 3c 50 72  6f 63 65 73 73 24 44 69  |Load <Process$Di|
000000b0  72 3e 2e 50 72 6f 63 65  73 73 0d 00 5a 04 0d 00  |r>.Process..Z...|
000000c0  64 16 de 20 4d 61 70 25  20 32 35 36 2c 57 6f 72  |d.. Map% 256,Wor|
000000d0  64 25 20 34 0d 00 6e 04  0d 00 78 14 e3 20 65 6e  |d% 4..n...x.. en|
000000e0  74 72 79 25 3d 30 20 b8  20 32 35 35 0d 00 82 27  |try%=0 . 255...'|
000000f0  20 f4 20 54 72 61 6e 73  6c 61 74 65 20 74 68 65  | . Translate the|
00000100  20 62 79 74 65 20 74 6f  20 52 47 42 2d 76 61 6c  | byte to RGB-val|
00000110  75 65 73 0d 00 8c 2a 20  c8 99 22 50 72 6f 63 65  |ues...* .."Proce|
00000120  73 73 5f 42 79 74 65 54  6f 52 47 42 22 2c 65 6e  |ss_ByteToRGB",en|
00000130  74 72 79 25 20 b8 20 21  57 6f 72 64 25 0d 00 96  |try% . !Word%...|
00000140  16 20 72 65 64 25 20 20  20 20 3d 20 57 6f 72 64  |. red%    = Word|
00000150  25 3f 31 0d 00 a0 16 20  67 72 65 65 6e 25 20 20  |%?1.... green%  |
00000160  3d 20 57 6f 72 64 25 3f  32 0d 00 aa 16 20 62 6c  |= Word%?2.... bl|
00000170  75 65 25 20 20 20 3d 20  57 6f 72 64 25 3f 33 0d  |ue%   = Word%?3.|
00000180  00 b4 04 0d 00 be 2c 20  f4 20 54 68 65 20 61 63  |......, . The ac|
00000190  74 75 61 6c 20 6d 61 70  70 69 6e 67 20 69 73 20  |tual mapping is |
000001a0  64 6f 6e 65 20 62 79 20  50 52 4f 43 4d 61 70 0d  |done by PROCMap.|
000001b0  00 c8 1c 20 f2 4d 61 70  28 72 65 64 25 2c 67 72  |... .Map(red%,gr|
000001c0  65 65 6e 25 2c 62 6c 75  65 25 29 0d 00 d2 04 0d  |een%,blue%).....|
000001d0  00 dc 04 0d 00 e6 12 20  f4 20 43 68 65 63 6b 20  |....... . Check |
000001e0  72 61 6e 67 65 0d 00 f0  20 20 e7 20 72 65 64 25  |range...  . red%|
000001f0  20 20 20 3c 20 30 20 20  20 8c 20 72 65 64 25 20  |   < 0   . red% |
00000200  20 20 3d 20 30 0d 00 fa  22 20 e7 20 72 65 64 25  |  = 0..." . red%|
00000210  20 20 20 3e 20 32 35 35  20 8c 20 72 65 64 25 20  |   > 255 . red% |
00000220  20 20 3d 20 32 35 35 0d  01 04 20 20 e7 20 67 72  |  = 255...  . gr|
00000230  65 65 6e 25 20 3c 20 30  20 20 20 8c 20 67 72 65  |een% < 0   . gre|
00000240  65 6e 25 20 3d 20 30 0d  01 0e 22 20 e7 20 67 72  |en% = 0..." . gr|
00000250  65 65 6e 25 20 3e 20 32  35 35 20 8c 20 67 72 65  |een% > 255 . gre|
00000260  65 6e 25 20 3d 20 32 35  35 0d 01 18 20 20 e7 20  |en% = 255...  . |
00000270  62 6c 75 65 25 20 20 3c  20 30 20 20 20 8c 20 62  |blue%  < 0   . b|
00000280  6c 75 65 25 20 20 3d 20  30 0d 01 22 22 20 e7 20  |lue%  = 0.."" . |
00000290  62 6c 75 65 25 20 20 3e  20 32 35 35 20 8c 20 62  |blue%  > 255 . b|
000002a0  6c 75 65 25 20 20 3d 20  32 35 35 0d 01 2c 04 0d  |lue%  = 255..,..|
000002b0  01 36 21 20 f4 20 54 72  61 6e 73 6c 61 74 65 20  |.6! . Translate |
000002c0  66 72 6f 6d 20 52 47 42  20 74 6f 20 62 79 74 65  |from RGB to byte|
000002d0  0d 01 40 10 20 57 6f 72  64 25 3f 30 20 3d 20 30  |..@. Word%?0 = 0|
000002e0  0d 01 4a 13 20 57 6f 72  64 25 3f 31 20 3d 20 72  |..J. Word%?1 = r|
000002f0  65 64 25 0d 01 54 15 20  57 6f 72 64 25 3f 32 20  |ed%..T. Word%?2 |
00000300  3d 20 67 72 65 65 6e 25  0d 01 5e 14 20 57 6f 72  |= green%..^. Wor|
00000310  64 25 3f 33 20 3d 20 62  6c 75 65 25 0d 01 68 2b  |d%?3 = blue%..h+|
00000320  20 c8 99 22 50 72 6f 63  65 73 73 5f 52 47 42 54  | .."Process_RGBT|
00000330  6f 42 79 74 65 22 2c 21  57 6f 72 64 25 20 b8 20  |oByte",!Word% . |
00000340  6d 61 70 70 65 64 25 0d  01 72 04 0d 01 7c 28 20  |mapped%..r...|( |
00000350  f4 20 57 72 69 74 65 20  74 68 65 20 6d 61 70 70  |. Write the mapp|
00000360  65 64 20 76 61 6c 75 65  20 74 6f 20 74 68 65 20  |ed value to the |
00000370  6d 61 70 0d 01 86 1a 20  4d 61 70 25 3f 65 6e 74  |map.... Map%?ent|
00000380  72 79 25 20 3d 20 6d 61  70 70 65 64 25 0d 01 90  |ry% = mapped%...|
00000390  05 ed 0d 01 9a 04 0d 01  a4 3e c8 99 22 4f 53 5f  |.........>.."OS_|
000003a0  46 69 6c 65 22 2c 31 30  2c 22 3c 50 72 6f 63 65  |File",10,"<Proce|
000003b0  73 73 24 44 69 72 3e 2e  5e 2e 4d 79 4d 61 70 22  |ss$Dir>.^.MyMap"|
000003c0  2c 26 46 46 44 2c 2c 4d  61 70 25 2c 4d 61 70 25  |,&FFD,,Map%,Map%|
000003d0  2b 32 35 36 0d 01 ae 05  e0 0d 01 b8 04 0d 01 c2  |+256............|
000003e0  28 f4 20 50 52 4f 43 4d  61 70 20 72 65 74 75 72  |(. PROCMap retur|
000003f0  6e 73 20 74 68 65 20 6e  65 77 20 52 47 42 20 76  |ns the new RGB v|
00000400  61 6c 75 65 73 0d 01 cc  22 dd f2 4d 61 70 28 f8  |alues..."..Map(.|
00000410  20 72 65 64 25 2c f8 20  67 72 65 65 6e 25 2c f8  | red%,. green%,.|
00000420  20 62 6c 75 65 25 29 0d  01 d6 16 20 72 65 64 25  | blue%).... red%|
00000430  20 20 20 3d 20 32 35 35  2d 72 65 64 25 0d 01 e0  |   = 255-red%...|
00000440  18 20 67 72 65 65 6e 25  20 3d 20 32 35 35 2d 67  |. green% = 255-g|
00000450  72 65 65 6e 25 0d 01 ea  17 20 62 6c 75 65 25 20  |reen%.... blue% |
00000460  20 3d 20 32 35 35 2d 62  6c 75 65 25 0d 01 f4 05  | = 255-blue%....|
00000470  e1 0d 01 fe 04 0d 02 08  04 0d 02 12 04 0d 02 1c  |................|
00000480  28 dd f2 52 65 64 46 69  6c 74 65 72 28 f8 20 72  |(..RedFilter(. r|
00000490  65 64 25 2c f8 20 67 72  65 65 6e 25 2c f8 20 62  |ed%,. green%,. b|
000004a0  6c 75 65 25 29 0d 02 26  0f 20 67 72 65 65 6e 25  |lue%)..&. green%|
000004b0  20 3d 20 30 0d 02 30 0f  20 62 6c 75 65 25 20 20  | = 0..0. blue%  |
000004c0  3d 20 30 0d 02 3a 05 e1  0d 02 44 04 0d 02 4e 26  |= 0..:....D...N&|
000004d0  dd f2 4c 69 67 68 74 65  6e 28 f8 20 72 65 64 25  |..Lighten(. red%|
000004e0  2c f8 20 67 72 65 65 6e  25 2c f8 20 62 6c 75 65  |,. green%,. blue|
000004f0  25 29 0d 02 58 16 20 72  65 64 25 20 20 20 3d 20  |%)..X. red%   = |
00000500  72 65 64 25 20 2b 31 36  0d 02 62 18 20 67 72 65  |red% +16..b. gre|
00000510  65 6e 25 20 3d 20 67 72  65 65 6e 25 20 2b 31 36  |en% = green% +16|
00000520  0d 02 6c 17 20 62 6c 75  65 25 20 20 3d 20 62 6c  |..l. blue%  = bl|
00000530  75 65 25 20 2b 31 36 0d  02 76 05 e1 0d ff        |ue% +16..v....|
0000053e