home *** CD-ROM | disk | FTP | other *** search
Unknown | 1992-07-29 | 2.2 KB |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was not able to be converted.
This format is not currently supported by dexvert.
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| file
| data
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 3b 00 3b 54 68 69 73 20 | 65 78 61 6d 70 6c 65 20 |;.;This |example |
|00000010| 64 65 6d 6f 6e 73 74 72 | 61 74 65 73 20 74 68 65 |demonstr|ates the|
|00000020| 20 70 72 69 6e 63 69 70 | 6c 65 20 62 65 68 69 6e | princip|le behin|
|00000030| 64 20 27 64 6f 75 62 6c | 65 20 62 75 66 66 65 72 |d 'doubl|e buffer|
|00000040| 69 6e 67 27 00 3b 00 3b | 44 6f 75 62 6c 65 20 62 |ing'.;.;|Double b|
|00000050| 75 66 66 65 72 69 6e 67 | 20 69 73 20 61 20 70 72 |uffering| is a pr|
|00000060| 6f 67 72 61 6d 6d 69 6e | 67 20 74 65 63 68 6e 69 |ogrammin|g techni|
|00000070| 71 75 65 20 61 6c 6c 6f | 77 69 6e 67 20 79 6f 75 |que allo|wing you|
|00000080| 00 3b 74 6f 20 67 65 74 | 20 72 69 64 20 6f 66 20 |.;to get| rid of |
|00000090| 27 66 6c 69 63 6b 65 72 | 27 20 66 72 6f 6d 20 67 |'flicker|' from g|
|000000a0| 72 61 70 68 69 63 20 61 | 6e 69 6d 61 74 69 6f 6e |raphic a|nimation|
|000000b0| 2e 00 3b 00 3b 44 6f 75 | 62 6c 65 20 62 75 66 66 |..;.;Dou|ble buff|
|000000c0| 65 72 69 6e 67 20 72 65 | 6c 69 65 73 20 6f 6e 20 |ering re|lies on |
|000000d0| 74 68 65 20 69 64 65 61 | 20 74 68 61 74 2c 20 61 |the idea| that, a|
|000000e0| 6c 74 68 6f 75 67 68 20 | 67 72 61 70 68 69 63 73 |lthough |graphics|
|000000f0| 00 3b 61 72 65 20 64 72 | 61 77 6e 20 74 6f 20 61 |.;are dr|awn to a|
|00000100| 20 70 61 72 74 69 63 75 | 6c 61 72 20 62 69 74 6d | particu|lar bitm|
|00000110| 61 70 2c 20 74 68 61 74 | 20 62 69 74 6d 61 70 20 |ap, that| bitmap |
|00000120| 6d 61 79 20 6e 6f 74 00 | 3b 6e 65 63 65 73 73 61 |may not.|;necessa|
|00000130| 72 69 6c 79 20 62 65 20 | 27 73 68 6f 77 6e 27 20 |rily be |'shown' |
|00000140| 6f 6e 20 74 68 65 20 64 | 69 73 70 6c 61 79 2e 00 |on the d|isplay..|
|00000150| 3b 00 3b 54 6f 20 61 63 | 68 69 65 76 65 20 64 6f |;.;To ac|hieve do|
|00000160| 75 62 6c 65 20 62 75 66 | 66 65 72 69 6e 67 2c 20 |uble buf|fering, |
|00000170| 79 6f 75 20 74 68 65 72 | 65 66 6f 72 65 20 6e 65 |you ther|efore ne|
|00000180| 65 64 20 61 74 20 6c 65 | 61 73 74 00 3b 32 20 62 |ed at le|ast.;2 b|
|00000190| 69 74 6d 61 70 73 2e 20 | 41 74 20 61 6e 79 20 6f |itmaps. |At any o|
|000001a0| 6e 65 20 70 6f 69 6e 74 | 20 69 6e 20 74 69 6d 65 |ne point| in time|
|000001b0| 2c 20 6f 6e 6c 79 20 31 | 20 6f 66 20 74 68 65 73 |, only 1| of thes|
|000001c0| 65 20 62 69 74 6d 61 70 | 73 00 3b 69 73 20 64 69 |e bitmap|s.;is di|
|000001d0| 73 70 6c 61 79 65 64 20 | 28 75 73 69 6e 67 20 6f |splayed |(using o|
|000001e0| 6e 65 20 6f 66 20 74 68 | 65 20 27 53 68 6f 77 27 |ne of th|e 'Show'|
|000001f0| 20 63 6f 6d 6d 61 6e 64 | 73 29 2c 20 77 68 69 6c | command|s), whil|
|00000200| 73 74 20 61 6e 79 00 3b | 67 72 61 70 68 69 63 20 |st any.;|graphic |
|00000210| 64 72 61 77 69 6e 67 20 | 69 73 20 70 65 72 66 6f |drawing |is perfo|
|00000220| 72 6d 65 64 20 6f 6e 20 | 54 48 45 20 4f 54 48 45 |rmed on |THE OTHE|
|00000230| 52 20 62 69 74 6d 61 70 | 2e 00 3b 44 75 72 69 6e |R bitmap|..;Durin|
|00000240| 67 20 74 68 65 20 76 65 | 72 74 69 63 61 6c 20 62 |g the ve|rtical b|
|00000250| 6c 61 6e 6b 20 70 65 72 | 69 6f 64 2c 20 74 68 65 |lank per|iod, the|
|00000260| 73 65 20 32 20 62 69 74 | 6d 61 70 73 20 61 72 65 |se 2 bit|maps are|
|00000270| 20 27 73 77 61 70 70 65 | 64 27 00 3b 69 65 20 2d | 'swappe|d'.;ie -|
|00000280| 20 74 68 65 20 6e 65 77 | 6c 79 20 75 70 64 61 74 | the new|ly updat|
|00000290| 65 64 20 62 69 74 6d 61 | 70 20 69 73 20 73 68 6f |ed bitma|p is sho|
|000002a0| 77 6e 2c 20 61 6e 64 20 | 74 68 65 20 70 72 65 76 |wn, and |the prev|
|000002b0| 69 6f 75 73 6c 79 00 3b | 73 68 6f 77 6e 20 62 69 |iously.;|shown bi|
|000002c0| 74 6d 61 70 20 69 73 20 | 75 73 65 64 20 66 6f 72 |tmap is |used for|
|000002d0| 20 74 68 65 20 6e 65 78 | 74 20 73 65 72 69 65 73 | the nex|t series|
|000002e0| 20 6f 66 20 75 70 64 61 | 74 65 73 21 00 00 00 3b | of upda|tes!...;|
|000002f0| 63 72 65 61 74 65 20 61 | 20 27 62 61 6c 6c 27 20 |create a| 'ball' |
|00000300| 74 79 70 65 20 76 61 72 | 69 61 62 6c 65 00 3b 00 |type var|iable.;.|
|00000310| 80 01 2e 62 61 6c 6c 00 | 78 2e 71 00 79 00 78 73 |...ball.|x.q.y.xs|
|00000320| 00 79 73 00 80 02 20 80 | 01 00 00 3b 64 69 6d 65 |.ys... .|...;dime|
|00000330| 6e 73 69 6f 6e 20 61 20 | 27 6c 69 73 74 27 20 6f |nsion a |'list' o|
|00000340| 66 20 27 62 61 6c 6c 73 | 27 00 3b 00 80 04 20 80 |f 'balls|'.;... .|
|00000350| b3 20 62 61 6c 6c 73 2e | 62 61 6c 6c 28 31 32 29 |. balls.|ball(12)|
|00000360| 00 00 3b 6c 6f 61 64 20 | 69 6e 20 61 20 73 68 61 |..;load |in a sha|
|00000370| 70 65 20 61 6e 64 20 69 | 74 27 73 20 70 61 6c 65 |pe and i|t's pale|
|00000380| 74 74 65 00 3b 00 cd 01 | 20 30 2c 22 64 61 74 61 |tte.;...| 0,"data|
|00000390| 2f 62 61 6c 6c 22 2c 30 | 00 00 3b 6b 65 65 70 20 |/ball",0|..;keep |
|000003a0| 61 64 64 69 6e 67 20 69 | 74 65 6d 73 20 74 6f 20 |adding i|tems to |
|000003b0| 6c 69 73 74 20 75 6e 74 | 69 6c 20 6c 69 73 74 20 |list unt|il list |
|000003c0| 66 75 6c 6c 00 3b 00 80 | 0c 20 c0 08 28 62 61 6c |full.;..|. ..(bal|
|000003d0| 6c 73 28 29 29 00 20 20 | 62 61 6c 6c 73 28 29 5c |ls()). |balls()\|
|000003e0| 78 3d bc 07 28 32 38 30 | 29 2b 31 30 2c bc 07 28 |x=..(280|)+10,..(|
|000003f0| 31 36 30 29 2b 31 30 2c | 28 bc 07 2d 2e 35 29 2a |160)+10,|(..-.5)*|
|00000400| 38 2c 28 bc 07 2d 2e 35 | 29 2a 38 00 80 c1 00 00 |8,(..-.5|)*8.....|
|00000410| 3b 6e 6f 77 2c 20 77 65 | 20 67 6f 20 69 6e 74 6f |;now, we| go into|
|00000420| 20 62 6c 69 74 7a 20 6d | 6f 64 65 00 3b 00 80 34 | blitz m|ode.;..4|
|00000430| 00 00 3b 69 6e 69 74 69 | 61 6c 69 7a 65 20 61 20 |..;initi|alize a |
|00000440| 6c 6f 72 2d 72 65 73 2c | 20 38 20 63 6f 6c 6f 75 |lor-res,| 8 colou|
|00000450| 72 20 62 69 74 6d 61 70 | 2e 2e 2e 00 3b 00 d0 01 |r bitmap|....;...|
|00000460| 20 30 2c 33 32 30 2c 32 | 30 30 2c 33 00 00 3b 77 | 0,320,2|00,3..;w|
|00000470| 65 20 61 6c 73 6f 20 6e | 65 65 64 20 61 6e 6f 74 |e also n|eed anot|
|00000480| 68 65 72 20 62 69 74 6d | 61 70 20 66 6f 72 20 74 |her bitm|ap for t|
|00000490| 68 65 20 64 6f 75 62 6c | 65 20 62 75 66 66 65 72 |he doubl|e buffer|
|000004a0| 69 6e 67 3a 00 3b 00 d0 | 01 20 31 2c 33 32 30 2c |ing:.;..|. 1,320,|
|000004b0| 32 30 30 2c 33 00 00 3b | 69 6e 69 74 69 61 6c 69 |200,3..;|initiali|
|000004c0| 7a 65 20 61 20 27 51 75 | 65 75 65 27 20 66 6f 72 |ze a 'Qu|eue' for|
|000004d0| 20 74 68 65 20 51 42 6c | 69 74 20 63 6f 6d 6d 61 | the QBl|it comma|
|000004e0| 6e 64 20 74 6f 20 6d 61 | 6b 65 20 75 73 65 20 6f |nd to ma|ke use o|
|000004f0| 66 3a 00 3b 00 ca 01 20 | 30 2c 35 30 00 00 3b 57 |f:.;... |0,50..;W|
|00000500| 65 20 77 69 6c 6c 20 61 | 6c 73 6f 20 64 6f 75 62 |e will a|lso doub|
|00000510| 6c 65 20 62 75 66 66 65 | 72 20 6f 75 72 20 71 75 |le buffe|r our qu|
|00000520| 65 75 65 27 73 2c 20 73 | 6f 20 77 65 20 6e 65 65 |eue's, s|o we nee|
|00000530| 64 20 61 6e 6f 74 68 65 | 72 00 3b 71 75 65 75 65 |d anothe|r.;queue|
|00000540| 3a 00 3b 00 ca 01 20 31 | 2c 35 30 00 00 3b 69 6e |:.;... 1|,50..;in|
|00000550| 69 74 69 61 6c 69 7a 65 | 20 61 20 73 6c 69 63 65 |itialize| a slice|
|00000560| 2c 20 61 6e 64 20 73 65 | 74 20 69 74 27 73 20 63 |, and se|t it's c|
|00000570| 6f 6c 6f 75 72 20 70 61 | 6c 65 74 74 65 00 3b 00 |olour pa|lette.;.|
|00000580| c8 01 20 30 2c 34 34 2c | 33 32 30 2c 32 30 30 2c |.. 0,44,|320,200,|
|00000590| 24 66 66 66 30 2c 33 2c | 38 2c 33 32 2c 33 32 30 |$fff0,3,|8,32,320|
|000005a0| 2c 33 32 30 00 80 2c 20 | ce 09 20 30 00 c8 04 20 |,320.., |.. 0... |
|000005b0| 30 00 00 3b 6e 6f 77 2c | 20 70 72 6f 63 65 73 73 |0..;now,| process|
|000005c0| 20 61 6c 6c 20 62 61 6c | 6c 73 73 2e 2e 2e 00 3b | all bal|lss....;|
|000005d0| 00 3b 77 68 69 6c 65 20 | 6d 6f 75 73 65 20 62 75 |.;while |mouse bu|
|000005e0| 74 74 6f 6e 20 6e 6f 74 | 20 68 69 74 2e 2e 00 3b |tton not| hit...;|
|000005f0| 00 80 0c 20 df 04 28 30 | 29 3d 30 00 00 20 20 3b |... ..(0|)=0.. ;|
|00000600| 73 74 61 72 74 20 61 74 | 20 66 69 72 73 74 20 69 |start at| first i|
|00000610| 74 65 6d 20 69 6e 20 6c | 69 73 74 00 20 20 3b 00 |tem in l|ist. ;.|
|00000620| 20 20 c0 04 20 62 61 6c | 6c 73 28 29 00 00 20 20 | .. bal|ls().. |
|00000630| 3b 77 61 69 74 20 66 6f | 72 20 76 65 72 74 69 63 |;wait fo|r vertic|
|00000640| 61 6c 20 62 6c 61 6e 6b | 00 20 20 3b 00 20 20 80 |al blank|. ;. .|
|00000650| 37 00 00 20 20 3b 74 68 | 69 73 20 62 69 74 20 64 |7.. ;th|is bit d|
|00000660| 6f 65 73 20 74 68 65 20 | 61 63 74 75 61 6c 20 64 |oes the |actual d|
|00000670| 6f 75 62 6c 65 20 62 75 | 66 66 65 72 69 6e 67 3a |ouble bu|ffering:|
|00000680| 00 20 20 3b 74 68 65 20 | 27 64 62 3d 31 2d 64 62 |. ;the |'db=1-db|
|00000690| 27 20 77 69 6c 6c 20 63 | 61 75 73 65 20 74 68 65 |' will c|ause the|
|000006a0| 20 27 64 62 27 20 76 61 | 72 69 61 62 6c 65 20 74 | 'db' va|riable t|
|000006b0| 6f 20 73 77 69 74 63 68 | 00 20 20 3b 62 65 74 77 |o switch|. ;betw|
|000006c0| 65 65 6e 20 30 2f 31 2f | 30 2f 31 2f 30 2f 31 2e |een 0/1/|0/1/0/1.|
|000006d0| 2e 2e 00 20 20 3b 00 20 | 20 c8 04 20 64 62 3a 64 |... ;. | .. db:d|
|000006e0| 62 3d 31 2d 64 62 3a 80 | 2c 20 d0 01 20 64 62 00 |b=1-db:.|, .. db.|
|000006f0| 00 20 20 3b 75 6e 71 75 | 65 75 65 20 69 74 65 6d |. ;unqu|eue item|
|00000700| 73 20 6f 6e 20 74 68 65 | 20 27 75 73 65 64 27 20 |s on the| 'used' |
|00000710| 62 69 74 6d 61 70 3a 00 | 20 20 3b 00 20 20 ca 03 |bitmap:.| ;. ..|
|00000720| 20 64 62 00 00 20 20 3b | 77 68 69 6c 65 20 6d 6f | db.. ;|while mo|
|00000730| 72 65 20 69 74 65 6d 73 | 20 74 6f 20 63 6f 6d 65 |re items| to come|
|00000740| 2e 2e 2e 00 20 20 3b 00 | 20 20 80 0c 20 c0 03 28 |.... ;.| .. ..(|
|00000750| 62 61 6c 6c 73 28 29 29 | 00 00 20 20 20 20 3b 75 |balls())|.. ;u|
|00000760| 70 64 61 74 65 20 62 61 | 6c 6c 73 27 20 70 6f 73 |pdate ba|lls' pos|
|00000770| 69 74 69 6f 6e 00 20 20 | 20 20 3b 00 20 20 20 20 |ition. | ;. |
|00000780| 62 61 6c 6c 73 28 29 5c | 78 2b 62 61 6c 6c 73 28 |balls()\|x+balls(|
|00000790| 29 5c 78 73 00 20 20 20 | 20 62 61 6c 6c 73 28 29 |)\xs. | balls()|
|000007a0| 5c 79 2b 62 61 6c 6c 73 | 28 29 5c 79 73 00 00 20 |\y+balls|()\ys.. |
|000007b0| 20 20 20 3b 72 65 76 65 | 72 73 65 20 64 69 72 65 | ;reve|rse dire|
|000007c0| 63 74 69 6f 6e 20 69 66 | 20 62 61 6c 6c 20 67 65 |ction if| ball ge|
|000007d0| 74 73 20 74 6f 20 65 64 | 67 65 20 6f 66 20 62 69 |ts to ed|ge of bi|
|000007e0| 74 6d 61 70 00 20 20 20 | 20 3b 00 20 20 20 20 80 |tmap. | ;. .|
|000007f0| 0b 20 62 61 6c 6c 73 28 | 29 5c 78 3c 31 30 20 80 |. balls(|)\x<10 .|
|00000800| 8a 20 62 61 6c 6c 73 28 | 29 5c 78 3e 32 39 30 20 |. balls(|)\x>290 |
|00000810| 80 21 20 62 61 6c 6c 73 | 28 29 5c 78 73 3d 2d 62 |.! balls|()\xs=-b|
|00000820| 61 6c 6c 73 28 29 5c 78 | 73 00 20 20 20 20 80 0b |alls()\x|s. ..|
|00000830| 20 62 61 6c 6c 73 28 29 | 5c 79 3c 31 30 20 80 8a | balls()|\y<10 ..|
|00000840| 20 62 61 6c 6c 73 28 29 | 5c 79 3e 31 37 30 20 80 | balls()|\y>170 .|
|00000850| 21 20 62 61 6c 6c 73 28 | 29 5c 79 73 3d 2d 62 61 |! balls(|)\ys=-ba|
|00000860| 6c 6c 73 28 29 5c 79 73 | 00 00 20 20 20 20 3b 64 |lls()\ys|.. ;d|
|00000870| 72 61 77 20 62 61 6c 6c | 73 20 69 6e 20 6e 65 77 |raw ball|s in new|
|00000880| 20 70 6f 73 69 74 69 6f | 6e 00 20 20 20 20 3b 00 | positio|n. ;.|
|00000890| 20 20 20 20 ca 02 20 64 | 62 2c 30 2c 62 61 6c 6c | .. d|b,0,ball|
|000008a0| 73 28 29 5c 78 2c 62 61 | 6c 6c 73 28 29 5c 79 00 |s()\x,ba|lls()\y.|
|000008b0| 00 20 20 80 c1 00 80 c1 | 00 00 |. .....|.. |
+--------+-------------------------+-------------------------+--------+--------+