Pro-SiMPLE * * * * * * * * * * * * * * BMP Data Player * * * * - by - * * * * Bob Bishop * * * * * * * * * * * * * * // INSTRUCTIONS: // // Store the "DATA.BMP" file on the // root directory of your "C:" drive. // Then run this program. ("Esc" quits) // Int z[]={0,4,2,6,1,5,3,7,8,12,10,14,9,13,11,15} open a ("read C:\\DATA.BMP") Do k=1,54 junk=fetch() //skip header Loop Do If !fetch() close a; quit Endif solid color (15) solid rectangle (0, 0, 639, 479) a=fetch(); b=fetch(); xsize=a+256*b a=fetch(); b=fetch(); ysize=a+256*b a=fetch(); b=fetch(); x=a+256*b a=fetch(); b=fetch(); y=a+256*b Do yy=ysize-1,0 Do xx=0,xsize-1,2 rgb=fetch() zz=z[rgb/16]; Put pixel (x+xx, y+yy, zz) If (xx=xsize-1) Break zz=z[rgb%16]; Put pixel (x+xx+1, y+yy, zz) Loop skip ((16384-(xsize+1)/2)%4) @ Loop Do x=fetch(); If !x Break tabxy (x, fetch()) Do chr=fetch(); If !chr Break cwrite (char(chr), 0, 15) Loop Loop Do tone=fetch(); If !tone Break If (tone>128) tone=tone-256 note (tone, 10*fetch()) @ Loop tabxy (33, 25); cwrite ("Press any key...", 0, 15) flush kbd; key=waitkey(); If (key=27) quit Loop Int fetch() Int data, eof read binary a (data, eof) If !eof Return data close a; quit Task skip (Int n) Int data Do k=1,n,1 read binary a (data, 0) Loop Task note (Int id, Int dur) Common Int tone [26] ={0,264,278,294,308,328,352,368,392,418,438,468,494,\ 526,554,590,616,658,702,742,788,834,882,932,986,1044} If (id>0 And id<26) sound (tone[id]) If id>-26 And id<0 delay (31); sound (tone[-id]) Endif If (id>0) delay (dur) Else delay (dur-31) nosound