>Ssaver2 = Compress sprites using BudgieSoft compression algorithm  (type 2). ( 2# by Richard Murray Winter 1997 < F: Downloaded from: http://www.heyrick.co.uk/assembler/ P Z: d $+" at "+(/10) : n: x< Open output file (put your own path here, or read from  command line). @x%=("IDEFS::Willow.$.WWW.WWWsite.assembler.sw.screen2/raw") : , Write out the identification header... %#x%, "BudgieScrn (compressed 2)" : $ ...and the current screenmode. #x%, : . Build up palette entries, and write out.  loop% = 0 15 / ș "OS_ReadPalette", loop%, 16 ,,f%, s% 7 r1% = (f% >> 8) 255 : First flash colour 4 red component 7 g1% = (f% >> 16) 255 : First flash colour 6 green component "7 b1% = (f% >> 24) 255 : First flash colour ,5 blue component 68 r2% = (s% >> 8) 255 : Second flash colour @4 red component J8 g2% = (s% >> 16) 255 : Second flash colour T6 green component ^8 b2% = (s% >> 24) 255 : Second flash colour h5 blue component r' #x%, r1% : #x%, g1% : #x%, b1% |' #x%, r2% : #x%, g2% : #x%, b2%  : < Get our screen sizes. This is not written to file. The @ loader will have to figure out it's own screen dimensions. ! Then switch off the cursor.  b% 19 b%!0=149 : b%!4=7 : b%!8=-1 'ș "OS_ReadVduVariables", b%, b%+12 3base%=b%!12 : length%=b%!16 :end%=base%+length% ș "XOS_RemoveCursors" : : = Now read from base% to end% (via posn%) calculating the 0 data, writing it out to file as necessary. : posn% = base% & 0/ Read four pixels (two bytes) at a time. :$ If they match, begin a loop. D col1% = posn%?0 N col2% = posn%?1 X col1% = col2% b They match, so... l #x%, 255 v #x%, col1%  counter% = 0   col1% = posn%?0  col1% = col2%  counter%+=1  posn%+=1  = counter% = 255 (col1% <> col2%) (posn% >= end%)  #x%, counter%  % Otherwise write out pixels.  #x%, col1%  col1% = 255 < A little hack for colour 15 double (byte = 255).   #x%, col1%  #x%, 0  * posn% += 1 4 > Until end. H posn% >=end% R: \ Close file and exit. f#x% p