home *** CD-ROM | disk | FTP | other *** search
Unknown | 1995-10-19 | 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| 20 3b 20 74 61 6b 65 20 | 72 75 6e 74 69 6d 65 20 | ; take |runtime |
|00000370| 65 72 72 6f 72 73 20 6f | 66 66 20 61 6e 64 20 62 |errors o|ff and b|
|00000380| 6f 6f 73 74 20 74 68 69 | 73 20 76 61 6c 75 65 00 |oost thi|s value.|
|00000390| 00 3b 6c 6f 61 64 20 69 | 6e 20 61 20 73 68 61 70 |.;load i|n a shap|
|000003a0| 65 20 61 6e 64 20 69 74 | 27 73 20 70 61 6c 65 74 |e and it|'s palet|
|000003b0| 74 65 00 3b 00 cd 01 20 | 30 2c 22 64 61 74 61 2f |te.;... |0,"data/|
|000003c0| 62 61 6c 6c 22 2c 30 00 | 00 3b 6b 65 65 70 20 61 |ball",0.|.;keep a|
|000003d0| 64 64 69 6e 67 20 69 74 | 65 6d 73 20 74 6f 20 6c |dding it|ems to l|
|000003e0| 69 73 74 20 75 6e 74 69 | 6c 20 6c 69 73 74 20 66 |ist unti|l list f|
|000003f0| 75 6c 6c 00 3b 00 80 0c | 20 c0 08 28 62 61 6c 6c |ull.;...| ..(ball|
|00000400| 73 28 29 29 00 20 20 62 | 61 6c 6c 73 28 29 5c 78 |s()). b|alls()\x|
|00000410| 3d bc 07 28 32 38 30 29 | 2b 31 30 2c bc 07 28 31 |=..(280)|+10,..(1|
|00000420| 36 30 29 2b 31 30 2c 28 | bc 07 2d 2e 35 29 2a 38 |60)+10,(|..-.5)*8|
|00000430| 2c 28 bc 07 2d 2e 35 29 | 2a 38 00 80 c1 00 00 3b |,(..-.5)|*8.....;|
|00000440| 6e 6f 77 2c 20 77 65 20 | 67 6f 20 69 6e 74 6f 20 |now, we |go into |
|00000450| 62 6c 69 74 7a 20 6d 6f | 64 65 00 3b 00 80 34 00 |blitz mo|de.;..4.|
|00000460| 00 3b 69 6e 69 74 69 61 | 6c 69 7a 65 20 61 20 6c |.;initia|lize a l|
|00000470| 6f 72 2d 72 65 73 2c 20 | 38 20 63 6f 6c 6f 75 72 |or-res, |8 colour|
|00000480| 20 62 69 74 6d 61 70 2e | 2e 2e 00 3b 00 d0 01 20 | bitmap.|...;... |
|00000490| 30 2c 33 32 30 2c 32 30 | 30 2c 33 00 00 3b 77 65 |0,320,20|0,3..;we|
|000004a0| 20 61 6c 73 6f 20 6e 65 | 65 64 20 61 6e 6f 74 68 | also ne|ed anoth|
|000004b0| 65 72 20 62 69 74 6d 61 | 70 20 66 6f 72 20 74 68 |er bitma|p for th|
|000004c0| 65 20 64 6f 75 62 6c 65 | 20 62 75 66 66 65 72 69 |e double| bufferi|
|000004d0| 6e 67 3a 00 3b 00 d0 01 | 20 31 2c 33 32 30 2c 32 |ng:.;...| 1,320,2|
|000004e0| 30 30 2c 33 00 00 3b 69 | 6e 69 74 69 61 6c 69 7a |00,3..;i|nitializ|
|000004f0| 65 20 61 20 27 51 75 65 | 75 65 27 20 66 6f 72 20 |e a 'Que|ue' for |
|00000500| 74 68 65 20 51 42 6c 69 | 74 20 63 6f 6d 6d 61 6e |the QBli|t comman|
|00000510| 64 20 74 6f 20 6d 61 6b | 65 20 75 73 65 20 6f 66 |d to mak|e use of|
|00000520| 3a 00 3b 00 ca 01 20 30 | 2c 35 30 00 00 3b 57 65 |:.;... 0|,50..;We|
|00000530| 20 77 69 6c 6c 20 61 6c | 73 6f 20 64 6f 75 62 6c | will al|so doubl|
|00000540| 65 20 62 75 66 66 65 72 | 20 6f 75 72 20 71 75 65 |e buffer| our que|
|00000550| 75 65 27 73 2c 20 73 6f | 20 77 65 20 6e 65 65 64 |ue's, so| we need|
|00000560| 20 61 6e 6f 74 68 65 72 | 00 3b 71 75 65 75 65 3a | another|.;queue:|
|00000570| 00 3b 00 ca 01 20 31 2c | 35 30 00 00 3b 69 6e 69 |.;... 1,|50..;ini|
|00000580| 74 69 61 6c 69 7a 65 20 | 61 20 73 6c 69 63 65 2c |tialize |a slice,|
|00000590| 20 61 6e 64 20 73 65 74 | 20 69 74 27 73 20 63 6f | and set| it's co|
|000005a0| 6c 6f 75 72 20 70 61 6c | 65 74 74 65 00 3b 00 c7 |lour pal|ette.;..|
|000005b0| 82 20 30 2c 34 34 2c 32 | 30 30 2c 33 2c 38 2c 38 |. 0,44,2|00,3,8,8|
|000005c0| 2c 30 00 c7 86 20 30 2c | 30 00 c7 84 20 30 2c 30 |,0... 0,|0... 0,0|
|000005d0| 00 c7 83 20 30 00 00 3b | 6e 6f 77 2c 20 70 72 6f |... 0..;|now, pro|
|000005e0| 63 65 73 73 20 61 6c 6c | 20 62 61 6c 6c 73 73 2e |cess all| ballss.|
|000005f0| 2e 2e 00 3b 00 3b 77 68 | 69 6c 65 20 6d 6f 75 73 |...;.;wh|ile mous|
|00000600| 65 20 62 75 74 74 6f 6e | 20 6e 6f 74 20 68 69 74 |e button| not hit|
|00000610| 2e 2e 00 3b 00 80 0c 20 | df 04 28 30 29 3d 30 00 |...;... |..(0)=0.|
|00000620| 00 20 20 3b 73 74 61 72 | 74 20 61 74 20 66 69 72 |. ;star|t at fir|
|00000630| 73 74 20 69 74 65 6d 20 | 69 6e 20 6c 69 73 74 00 |st item |in list.|
|00000640| 20 20 3b 00 20 20 c0 04 | 20 62 61 6c 6c 73 28 29 | ;. ..| balls()|
|00000650| 00 00 20 20 3b 77 61 69 | 74 20 66 6f 72 20 76 65 |.. ;wai|t for ve|
|00000660| 72 74 69 63 61 6c 20 62 | 6c 61 6e 6b 00 20 20 3b |rtical b|lank. ;|
|00000670| 00 20 20 80 37 00 00 20 | 20 3b 74 68 69 73 20 62 |. .7.. | ;this b|
|00000680| 69 74 20 64 6f 65 73 20 | 74 68 65 20 61 63 74 75 |it does |the actu|
|00000690| 61 6c 20 64 6f 75 62 6c | 65 20 62 75 66 66 65 72 |al doubl|e buffer|
|000006a0| 69 6e 67 3a 00 20 20 3b | 74 68 65 20 27 64 62 3d |ing:. ;|the 'db=|
|000006b0| 31 2d 64 62 27 20 77 69 | 6c 6c 20 63 61 75 73 65 |1-db' wi|ll cause|
|000006c0| 20 74 68 65 20 27 64 62 | 27 20 76 61 72 69 61 62 | the 'db|' variab|
|000006d0| 6c 65 20 74 6f 20 73 77 | 69 74 63 68 00 20 20 3b |le to sw|itch. ;|
|000006e0| 62 65 74 77 65 65 6e 20 | 30 2f 31 2f 30 2f 31 2f |between |0/1/0/1/|
|000006f0| 30 2f 31 2e 2e 2e 00 20 | 20 3b 00 20 20 c7 84 20 |0/1.... | ;. .. |
|00000700| 30 2c 64 62 3a 64 62 3d | 31 2d 64 62 3a 80 2c 20 |0,db:db=|1-db:., |
|00000710| d0 01 20 64 62 00 00 20 | 20 3b 75 6e 71 75 65 75 |.. db.. | ;unqueu|
|00000720| 65 20 69 74 65 6d 73 20 | 6f 6e 20 74 68 65 20 27 |e items |on the '|
|00000730| 75 73 65 64 27 20 62 69 | 74 6d 61 70 3a 00 20 20 |used' bi|tmap:. |
|00000740| 3b 00 20 20 ca 03 20 64 | 62 00 00 20 20 3b 77 68 |;. .. d|b.. ;wh|
|00000750| 69 6c 65 20 6d 6f 72 65 | 20 69 74 65 6d 73 20 74 |ile more| items t|
|00000760| 6f 20 63 6f 6d 65 2e 2e | 2e 00 20 20 3b 00 20 20 |o come..|.. ;. |
|00000770| 80 0c 20 c0 03 28 62 61 | 6c 6c 73 28 29 29 00 00 |.. ..(ba|lls())..|
|00000780| 20 20 20 20 3b 75 70 64 | 61 74 65 20 62 61 6c 6c | ;upd|ate ball|
|00000790| 73 27 20 70 6f 73 69 74 | 69 6f 6e 00 20 20 20 20 |s' posit|ion. |
|000007a0| 3b 00 20 20 20 20 62 61 | 6c 6c 73 28 29 5c 78 2b |;. ba|lls()\x+|
|000007b0| 62 61 6c 6c 73 28 29 5c | 78 73 00 20 20 20 20 62 |balls()\|xs. b|
|000007c0| 61 6c 6c 73 28 29 5c 79 | 2b 62 61 6c 6c 73 28 29 |alls()\y|+balls()|
|000007d0| 5c 79 73 00 00 20 20 20 | 20 3b 72 65 76 65 72 73 |\ys.. | ;revers|
|000007e0| 65 20 64 69 72 65 63 74 | 69 6f 6e 20 69 66 20 62 |e direct|ion if b|
|000007f0| 61 6c 6c 20 67 65 74 73 | 20 74 6f 20 65 64 67 65 |all gets| to edge|
|00000800| 20 6f 66 20 62 69 74 6d | 61 70 00 20 20 20 20 3b | of bitm|ap. ;|
|00000810| 00 20 20 20 20 80 0b 20 | 62 61 6c 6c 73 28 29 5c |. .. |balls()\|
|00000820| 78 3c 31 30 20 80 8a 20 | 62 61 6c 6c 73 28 29 5c |x<10 .. |balls()\|
|00000830| 78 3e 32 39 30 20 80 21 | 20 62 61 6c 6c 73 28 29 |x>290 .!| balls()|
|00000840| 5c 78 73 3d 2d 62 61 6c | 6c 73 28 29 5c 78 73 00 |\xs=-bal|ls()\xs.|
|00000850| 20 20 20 20 80 0b 20 62 | 61 6c 6c 73 28 29 5c 79 | .. b|alls()\y|
|00000860| 3c 31 30 20 80 8a 20 62 | 61 6c 6c 73 28 29 5c 79 |<10 .. b|alls()\y|
|00000870| 3e 31 37 30 20 80 21 20 | 62 61 6c 6c 73 28 29 5c |>170 .! |balls()\|
|00000880| 79 73 3d 2d 62 61 6c 6c | 73 28 29 5c 79 73 00 00 |ys=-ball|s()\ys..|
|00000890| 20 20 20 20 3b 64 72 61 | 77 20 62 61 6c 6c 73 20 | ;dra|w balls |
|000008a0| 69 6e 20 6e 65 77 20 70 | 6f 73 69 74 69 6f 6e 00 |in new p|osition.|
|000008b0| 20 20 20 20 3b 00 20 20 | 20 20 ca 02 20 64 62 2c | ;. | .. db,|
|000008c0| 30 2c 62 61 6c 6c 73 28 | 29 5c 78 2c 62 61 6c 6c |0,balls(|)\x,ball|
|000008d0| 73 28 29 5c 79 00 00 20 | 20 80 c1 00 80 c1 00 00 |s()\y.. | .......|
|000008e0| 80 02 00 | |... | |
+--------+-------------------------+-------------------------+--------+--------+