10    dword=alloc(4):pokew dword,020    cls :bitmap on :bitmap clear 030    input "bitmap filename (.bmp will be added):";a$40    print "Loading bitmap..."50    try bload a$+".bmp",$30000 to ec60    if ec<>0 then cls :print "Error: File does not exist!":end 70    wpeek($3000E):hl=dwval:rem "DIB Header length"75    wpeek($30012):xs=dwval:rem "X size"80    wpeek($30016):ys=dwval:rem "Y size"85    wpeek($3001C):bits=dwval:rem "Color Bits"90    wpeek($3000A):rem "Offset to Pixel data start"95    print "bitmap size x:";xs,"y:";ys,bits;" bit color"100   orig=$30000+dwval:dest=$10000110   for y=ys-1 downto 0120   memcopy orig,xs to dest+(y*320)130   orig=orig+xs140   next 145   if option$<>"m"150   ?1=1160   for a=0 to 255165   wpeek($3000E+hl+(a*4))170   poke $D000+(a*4),peek(dword):poke $D001+(a*4),peek(dword+1)175   poke $D002+(a*4),peek(dword+2)180   next 185   bitmap off 190   ?1=1:for c=0 to 1023:?($7800+c)=?($D000+c):next :?1=0195   b$=a$+".pal":print "."197   print "saving palette.. please wait.."200   try bsave b$,$7800,1024 to ec210   if ec<>0220   print "Palette Save error, check device or media":end 225   else 227   print "Palette saved as ";b$230   endif 240   endif 245   b$=a$+".fbmp"247   print "saving bitmap (320x240) please wait this takes a while..."250   try bsave b$,$10000,320*240 to ec260   if ec<>0270   print "Bitmap Save error, check device or media":end 275   else 276   print "Bitmap saved as ";b$280   endif 290   ?1=0300   end 10100 proc wpeek(a)10110 memcopy a,4 to dword10120 dwval=peekw(dword)10130 endproc 