Home » Archimedes archive » Acorn User » AU 1995-11.adf » !Regulars » Regulars/StarInfo/Ord/!OrdFSI/Pal-Grey

Regulars/StarInfo/Ord/!OrdFSI/Pal-Grey

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 » AU 1995-11.adf » !Regulars
Filename: Regulars/StarInfo/Ord/!OrdFSI/Pal-Grey
Read OK:
File size: 01F0 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM Create Palette Lookup Table
   20REM By Andrew Ord
   21
   31file$="Palettes.GreyScale"
   40
   50REM Memory required to store palette and lookup table
   60DIM pal% 1024+32768
   70
   81REM routine to make a 256grey scale palette
   91FOR I%=0 TO 255
   92pal%!(4*I%)=(I%<<24)+(I%<<16)+(I%<<8)
   93NEXT I%
  100
  130REM Create the lookup table
  140SYS"Hourglass_On"
  150SYS"IPC_CreateTables",pal%,pal%+1024,256
  160SYS"Hourglass_Smash"
  170
  180REM Save the definition to disk
  190SYS"OS_File",10,file$,&00F,,pal%,pal%+(1024+32768)
  200END

!� Create Palette Lookup Table
� By Andrew Ord

file$="Palettes.GreyScale"
(
27� Memory required to store palette and lookup table
<� pal% 1024+32768
F
Q-� routine to make a 256grey scale palette
[� I%=0 � 255
\)pal%!(4*I%)=(I%<<24)+(I%<<16)+(I%<<8)
]� I%
d
�� Create the lookup table
�ș"Hourglass_On"
�+ș"IPC_CreateTables",pal%,pal%+1024,256
�ș"Hourglass_Smash"
�
�!� Save the definition to disk
�5ș"OS_File",10,file$,&00F,,pal%,pal%+(1024+32768)
��
�
00000000  0d 00 0a 21 f4 20 43 72  65 61 74 65 20 50 61 6c  |...!. Create Pal|
00000010  65 74 74 65 20 4c 6f 6f  6b 75 70 20 54 61 62 6c  |ette Lookup Tabl|
00000020  65 0d 00 14 13 f4 20 42  79 20 41 6e 64 72 65 77  |e..... By Andrew|
00000030  20 4f 72 64 0d 00 15 04  0d 00 1f 1e 66 69 6c 65  | Ord........file|
00000040  24 3d 22 50 61 6c 65 74  74 65 73 2e 47 72 65 79  |$="Palettes.Grey|
00000050  53 63 61 6c 65 22 0d 00  28 04 0d 00 32 37 f4 20  |Scale"..(...27. |
00000060  4d 65 6d 6f 72 79 20 72  65 71 75 69 72 65 64 20  |Memory required |
00000070  74 6f 20 73 74 6f 72 65  20 70 61 6c 65 74 74 65  |to store palette|
00000080  20 61 6e 64 20 6c 6f 6f  6b 75 70 20 74 61 62 6c  | and lookup tabl|
00000090  65 0d 00 3c 15 de 20 70  61 6c 25 20 31 30 32 34  |e..<.. pal% 1024|
000000a0  2b 33 32 37 36 38 0d 00  46 04 0d 00 51 2d f4 20  |+32768..F...Q-. |
000000b0  72 6f 75 74 69 6e 65 20  74 6f 20 6d 61 6b 65 20  |routine to make |
000000c0  61 20 32 35 36 67 72 65  79 20 73 63 61 6c 65 20  |a 256grey scale |
000000d0  70 61 6c 65 74 74 65 0d  00 5b 10 e3 20 49 25 3d  |palette..[.. I%=|
000000e0  30 20 b8 20 32 35 35 0d  00 5c 29 70 61 6c 25 21  |0 . 255..\)pal%!|
000000f0  28 34 2a 49 25 29 3d 28  49 25 3c 3c 32 34 29 2b  |(4*I%)=(I%<<24)+|
00000100  28 49 25 3c 3c 31 36 29  2b 28 49 25 3c 3c 38 29  |(I%<<16)+(I%<<8)|
00000110  0d 00 5d 08 ed 20 49 25  0d 00 64 04 0d 00 82 1d  |..].. I%..d.....|
00000120  f4 20 43 72 65 61 74 65  20 74 68 65 20 6c 6f 6f  |. Create the loo|
00000130  6b 75 70 20 74 61 62 6c  65 0d 00 8c 14 c8 99 22  |kup table......"|
00000140  48 6f 75 72 67 6c 61 73  73 5f 4f 6e 22 0d 00 96  |Hourglass_On"...|
00000150  2b c8 99 22 49 50 43 5f  43 72 65 61 74 65 54 61  |+.."IPC_CreateTa|
00000160  62 6c 65 73 22 2c 70 61  6c 25 2c 70 61 6c 25 2b  |bles",pal%,pal%+|
00000170  31 30 32 34 2c 32 35 36  0d 00 a0 17 c8 99 22 48  |1024,256......"H|
00000180  6f 75 72 67 6c 61 73 73  5f 53 6d 61 73 68 22 0d  |ourglass_Smash".|
00000190  00 aa 04 0d 00 b4 21 f4  20 53 61 76 65 20 74 68  |......!. Save th|
000001a0  65 20 64 65 66 69 6e 69  74 69 6f 6e 20 74 6f 20  |e definition to |
000001b0  64 69 73 6b 0d 00 be 35  c8 99 22 4f 53 5f 46 69  |disk...5.."OS_Fi|
000001c0  6c 65 22 2c 31 30 2c 66  69 6c 65 24 2c 26 30 30  |le",10,file$,&00|
000001d0  46 2c 2c 70 61 6c 25 2c  70 61 6c 25 2b 28 31 30  |F,,pal%,pal%+(10|
000001e0  32 34 2b 33 32 37 36 38  29 0d 00 c8 05 e0 0d ff  |24+32768).......|
000001f0