Home » Archimedes archive » Archimedes World » AW-1996-12.adf » !AcornAns_AcornAns » December/!Balls/Tools/DataGen

December/!Balls/Tools/DataGen

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Archimedes World » AW-1996-12.adf » !AcornAns_AcornAns
Filename: December/!Balls/Tools/DataGen
Read OK:
File size: 0A3B bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >DataGen
   20REM Purpose: convert a specific sprite into a form suitable
   30REM for fast plotting.
   40REM
   50REM Format of new data is as follows:
   60REM Assume image 8bpp.
   70REM Scanning image across rows, top to bottom, store image as
   80REM pixel data block then mask block.
   90REM Require that data for pixels which are masked is stored as 0
  100REM & that mask bits are set to indicate solidity (ie the
  110REM standard sprite mask value),
  120REM so that we may write sprite to screen via:
  130REM screen_pixel = (screen_pixel BIC sprite_mask) OR sprite_pixel.
  140REM This requires width*height*2 bytes storage.
  150REM Follow this by 3 further copies of the same data, each
  160REM scrolled right by one additional pixel.
  170REM This permits the plotting code to use only word aligned read
  180REM & write operations for speed, whilst still being able to write
  190REM the image to screen at any pixel alignment.
  200:
  210areasize% = 1024
  220DIM area% areasize%
  230!area%    = areasize%
  240area%!4   = 0
  250area%!8   = 16
  260area%!12  = 16
  270spop%     = &2E
  280INPUT "Filename";name$
  290SYS "OS_SpriteOp", &10A, area%, "<Balls$Dir>.Tools."+name$
  300spr%      = area% + area%!8
  310REM We assume sprite is 8bpp, 20*16 pixels, with mask
  320REM & is left aligned leaving 3 blank (masked) columns
  330REM of pixels on its right.
  340:
  350sw% = (1+spr%!16)*4
  360sh% =  1+spr%!20
  370datasize% = sw%*sh%*2*4 :REM 2 bytes pixels/masks, 4 instances
  380DIM data% datasize%
  390:
  400PROCconvert(spr%, data%)
  410:
  420REM Now save our data
  430SYS "OS_File", 10, "<Balls$Dir>.Resources."+name$+"Data", &FFD,, data%, data%+datasize%
  440END
  450:
  460:
  470DEF PROCconvert(spr%, dataptr%)
  480:
  490LOCAL sw%, sh%, np%, spri%, sprm%, lastimageword%, lastmaskword%, loop%, imageword%, maskword%, offset%, iw%, mw%, instance%
  500sw% = (1+spr%!16)*4 :REM sprite width in pixels (assume 0 wastage)
  510sh% =  1+spr%!20    :REM sprite height
  520np% = sw%*sh%
  530spri% = spr%+spr%!32:REM sprite image pointer
  540sprm% = spr%+spr%!36:REM sprite mask ptr
  550lastimageword%= 0
  560lastmaskword% = 0
  570:
  580FOR loop% = 1 TO np%/4
  590 imageword% = !spri%: spri%+=4
  600 maskword%  = !sprm%: sprm%+=4
  610 REM Now ensure masked pixels are zeroed
  620 imageword% = imageword% AND maskword%
  630 offset%    = 0
  640 iw%        = imageword%
  650 mw%        = maskword%
  660 FOR instance% = 0 TO 3
  670  dataptr%!(offset%+0) = iw%
  680  dataptr%!(offset%+np%) = mw%
  690  iw% = (iw%<<8) OR (lastimageword%>>>24)
  700  lastimageword% = lastimageword%<<8
  710  mw% = (mw%<<8) OR (lastmaskword%>>>24)
  720  lastmaskword%  = lastmaskword%<<8
  730  offset%+=np%*2
  740 NEXT
  750 dataptr%+=4
  760 lastimageword% = imageword%
  770 lastmaskword%  = maskword%
  780NEXT
  790:
  800ENDPROC

� >DataGen
=� Purpose: convert a specific sprite into a form suitable
� for fast plotting.
(�
2'� Format of new data is as follows:
<� Assume image 8bpp.
F?� Scanning image across rows, top to bottom, store image as
P'� pixel data block then mask block.
ZB� Require that data for pixels which are masked is stored as 0
d;� & that mask bits are set to indicate solidity (ie the
n"� standard sprite mask value),
x0� so that we may write sprite to screen via:
�D� screen_pixel = (screen_pixel BIC sprite_mask) OR sprite_pixel.
�1� This requires width*height*2 bytes storage.
�<� Follow this by 3 further copies of the same data, each
�-� scrolled right by one additional pixel.
�B� This permits the plotting code to use only word aligned read
�D� & write operations for speed, whilst still being able to write
�1� the image to screen at any pixel alignment.
�:
�areasize% = 1024
�� area% areasize%
�!area%    = areasize%
�area%!4   = 0
�area%!8   = 16
area%!12  = 16
spop%     = &2E
� "Filename";name$
"=ș "OS_SpriteOp", &10A, area%, "<Balls$Dir>.Tools."+name$
,spr%      = area% + area%!8
67� We assume sprite is 8bpp, 20*16 pixels, with mask
@8� & is left aligned leaving 3 blank (masked) columns
J� of pixels on its right.
T:
^sw% = (1+spr%!16)*4
hsh% =  1+spr%!20
r@datasize% = sw%*sh%*2*4 :� 2 bytes pixels/masks, 4 instances
|� data% datasize%
�:
��convert(spr%, data%)
�:
�� Now save our data
�Zș "OS_File", 10, "<Balls$Dir>.Resources."+name$+"Data", &FFD,, data%, data%+datasize%
��
�:
�:
�� �convert(spr%, dataptr%)
�:
�|� sw%, sh%, np%, spri%, sprm%, lastimageword%, lastmaskword%, loop%, imageword%, maskword%, offset%, iw%, mw%, instance%
�Dsw% = (1+spr%!16)*4 :� sprite width in pixels (assume 0 wastage)
�(sh% =  1+spr%!20    :� sprite height
np% = sw%*sh%
/spri% = spr%+spr%!32:� sprite image pointer
*sprm% = spr%+spr%!36:� sprite mask ptr
&lastimageword%= 0
0lastmaskword% = 0
::
D� loop% = 1 � np%/4
N" imageword% = !spri%: spri%+=4
X" maskword%  = !sprm%: sprm%+=4
b* � Now ensure masked pixels are zeroed
l( imageword% = imageword% � maskword%
v offset%    = 0
� iw%        = imageword%
� mw%        = maskword%
� � instance% = 0 � 3
�   dataptr%!(offset%+0) = iw%
�"  dataptr%!(offset%+np%) = mw%
�,  iw% = (iw%<<8) � (lastimageword%>>>24)
�(  lastimageword% = lastimageword%<<8
�+  mw% = (mw%<<8) � (lastmaskword%>>>24)
�'  lastmaskword%  = lastmaskword%<<8
�  offset%+=np%*2
� �
� dataptr%+=4
�  lastimageword% = imageword%
 lastmaskword%  = maskword%
�
:
 �
�
00000000  0d 00 0a 0e f4 20 3e 44  61 74 61 47 65 6e 0d 00  |..... >DataGen..|
00000010  14 3d f4 20 50 75 72 70  6f 73 65 3a 20 63 6f 6e  |.=. Purpose: con|
00000020  76 65 72 74 20 61 20 73  70 65 63 69 66 69 63 20  |vert a specific |
00000030  73 70 72 69 74 65 20 69  6e 74 6f 20 61 20 66 6f  |sprite into a fo|
00000040  72 6d 20 73 75 69 74 61  62 6c 65 0d 00 1e 18 f4  |rm suitable.....|
00000050  20 66 6f 72 20 66 61 73  74 20 70 6c 6f 74 74 69  | for fast plotti|
00000060  6e 67 2e 0d 00 28 05 f4  0d 00 32 27 f4 20 46 6f  |ng...(....2'. Fo|
00000070  72 6d 61 74 20 6f 66 20  6e 65 77 20 64 61 74 61  |rmat of new data|
00000080  20 69 73 20 61 73 20 66  6f 6c 6c 6f 77 73 3a 0d  | is as follows:.|
00000090  00 3c 18 f4 20 41 73 73  75 6d 65 20 69 6d 61 67  |.<.. Assume imag|
000000a0  65 20 38 62 70 70 2e 0d  00 46 3f f4 20 53 63 61  |e 8bpp...F?. Sca|
000000b0  6e 6e 69 6e 67 20 69 6d  61 67 65 20 61 63 72 6f  |nning image acro|
000000c0  73 73 20 72 6f 77 73 2c  20 74 6f 70 20 74 6f 20  |ss rows, top to |
000000d0  62 6f 74 74 6f 6d 2c 20  73 74 6f 72 65 20 69 6d  |bottom, store im|
000000e0  61 67 65 20 61 73 0d 00  50 27 f4 20 70 69 78 65  |age as..P'. pixe|
000000f0  6c 20 64 61 74 61 20 62  6c 6f 63 6b 20 74 68 65  |l data block the|
00000100  6e 20 6d 61 73 6b 20 62  6c 6f 63 6b 2e 0d 00 5a  |n mask block...Z|
00000110  42 f4 20 52 65 71 75 69  72 65 20 74 68 61 74 20  |B. Require that |
00000120  64 61 74 61 20 66 6f 72  20 70 69 78 65 6c 73 20  |data for pixels |
00000130  77 68 69 63 68 20 61 72  65 20 6d 61 73 6b 65 64  |which are masked|
00000140  20 69 73 20 73 74 6f 72  65 64 20 61 73 20 30 0d  | is stored as 0.|
00000150  00 64 3b f4 20 26 20 74  68 61 74 20 6d 61 73 6b  |.d;. & that mask|
00000160  20 62 69 74 73 20 61 72  65 20 73 65 74 20 74 6f  | bits are set to|
00000170  20 69 6e 64 69 63 61 74  65 20 73 6f 6c 69 64 69  | indicate solidi|
00000180  74 79 20 28 69 65 20 74  68 65 0d 00 6e 22 f4 20  |ty (ie the..n". |
00000190  73 74 61 6e 64 61 72 64  20 73 70 72 69 74 65 20  |standard sprite |
000001a0  6d 61 73 6b 20 76 61 6c  75 65 29 2c 0d 00 78 30  |mask value),..x0|
000001b0  f4 20 73 6f 20 74 68 61  74 20 77 65 20 6d 61 79  |. so that we may|
000001c0  20 77 72 69 74 65 20 73  70 72 69 74 65 20 74 6f  | write sprite to|
000001d0  20 73 63 72 65 65 6e 20  76 69 61 3a 0d 00 82 44  | screen via:...D|
000001e0  f4 20 73 63 72 65 65 6e  5f 70 69 78 65 6c 20 3d  |. screen_pixel =|
000001f0  20 28 73 63 72 65 65 6e  5f 70 69 78 65 6c 20 42  | (screen_pixel B|
00000200  49 43 20 73 70 72 69 74  65 5f 6d 61 73 6b 29 20  |IC sprite_mask) |
00000210  4f 52 20 73 70 72 69 74  65 5f 70 69 78 65 6c 2e  |OR sprite_pixel.|
00000220  0d 00 8c 31 f4 20 54 68  69 73 20 72 65 71 75 69  |...1. This requi|
00000230  72 65 73 20 77 69 64 74  68 2a 68 65 69 67 68 74  |res width*height|
00000240  2a 32 20 62 79 74 65 73  20 73 74 6f 72 61 67 65  |*2 bytes storage|
00000250  2e 0d 00 96 3c f4 20 46  6f 6c 6c 6f 77 20 74 68  |....<. Follow th|
00000260  69 73 20 62 79 20 33 20  66 75 72 74 68 65 72 20  |is by 3 further |
00000270  63 6f 70 69 65 73 20 6f  66 20 74 68 65 20 73 61  |copies of the sa|
00000280  6d 65 20 64 61 74 61 2c  20 65 61 63 68 0d 00 a0  |me data, each...|
00000290  2d f4 20 73 63 72 6f 6c  6c 65 64 20 72 69 67 68  |-. scrolled righ|
000002a0  74 20 62 79 20 6f 6e 65  20 61 64 64 69 74 69 6f  |t by one additio|
000002b0  6e 61 6c 20 70 69 78 65  6c 2e 0d 00 aa 42 f4 20  |nal pixel....B. |
000002c0  54 68 69 73 20 70 65 72  6d 69 74 73 20 74 68 65  |This permits the|
000002d0  20 70 6c 6f 74 74 69 6e  67 20 63 6f 64 65 20 74  | plotting code t|
000002e0  6f 20 75 73 65 20 6f 6e  6c 79 20 77 6f 72 64 20  |o use only word |
000002f0  61 6c 69 67 6e 65 64 20  72 65 61 64 0d 00 b4 44  |aligned read...D|
00000300  f4 20 26 20 77 72 69 74  65 20 6f 70 65 72 61 74  |. & write operat|
00000310  69 6f 6e 73 20 66 6f 72  20 73 70 65 65 64 2c 20  |ions for speed, |
00000320  77 68 69 6c 73 74 20 73  74 69 6c 6c 20 62 65 69  |whilst still bei|
00000330  6e 67 20 61 62 6c 65 20  74 6f 20 77 72 69 74 65  |ng able to write|
00000340  0d 00 be 31 f4 20 74 68  65 20 69 6d 61 67 65 20  |...1. the image |
00000350  74 6f 20 73 63 72 65 65  6e 20 61 74 20 61 6e 79  |to screen at any|
00000360  20 70 69 78 65 6c 20 61  6c 69 67 6e 6d 65 6e 74  | pixel alignment|
00000370  2e 0d 00 c8 05 3a 0d 00  d2 14 61 72 65 61 73 69  |.....:....areasi|
00000380  7a 65 25 20 3d 20 31 30  32 34 0d 00 dc 15 de 20  |ze% = 1024..... |
00000390  61 72 65 61 25 20 61 72  65 61 73 69 7a 65 25 0d  |area% areasize%.|
000003a0  00 e6 19 21 61 72 65 61  25 20 20 20 20 3d 20 61  |...!area%    = a|
000003b0  72 65 61 73 69 7a 65 25  0d 00 f0 11 61 72 65 61  |reasize%....area|
000003c0  25 21 34 20 20 20 3d 20  30 0d 00 fa 12 61 72 65  |%!4   = 0....are|
000003d0  61 25 21 38 20 20 20 3d  20 31 36 0d 01 04 12 61  |a%!8   = 16....a|
000003e0  72 65 61 25 21 31 32 20  20 3d 20 31 36 0d 01 0e  |rea%!12  = 16...|
000003f0  13 73 70 6f 70 25 20 20  20 20 20 3d 20 26 32 45  |.spop%     = &2E|
00000400  0d 01 18 16 e8 20 22 46  69 6c 65 6e 61 6d 65 22  |..... "Filename"|
00000410  3b 6e 61 6d 65 24 0d 01  22 3d c8 99 20 22 4f 53  |;name$.."=.. "OS|
00000420  5f 53 70 72 69 74 65 4f  70 22 2c 20 26 31 30 41  |_SpriteOp", &10A|
00000430  2c 20 61 72 65 61 25 2c  20 22 3c 42 61 6c 6c 73  |, area%, "<Balls|
00000440  24 44 69 72 3e 2e 54 6f  6f 6c 73 2e 22 2b 6e 61  |$Dir>.Tools."+na|
00000450  6d 65 24 0d 01 2c 1f 73  70 72 25 20 20 20 20 20  |me$..,.spr%     |
00000460  20 3d 20 61 72 65 61 25  20 2b 20 61 72 65 61 25  | = area% + area%|
00000470  21 38 0d 01 36 37 f4 20  57 65 20 61 73 73 75 6d  |!8..67. We assum|
00000480  65 20 73 70 72 69 74 65  20 69 73 20 38 62 70 70  |e sprite is 8bpp|
00000490  2c 20 32 30 2a 31 36 20  70 69 78 65 6c 73 2c 20  |, 20*16 pixels, |
000004a0  77 69 74 68 20 6d 61 73  6b 0d 01 40 38 f4 20 26  |with mask..@8. &|
000004b0  20 69 73 20 6c 65 66 74  20 61 6c 69 67 6e 65 64  | is left aligned|
000004c0  20 6c 65 61 76 69 6e 67  20 33 20 62 6c 61 6e 6b  | leaving 3 blank|
000004d0  20 28 6d 61 73 6b 65 64  29 20 63 6f 6c 75 6d 6e  | (masked) column|
000004e0  73 0d 01 4a 1d f4 20 6f  66 20 70 69 78 65 6c 73  |s..J.. of pixels|
000004f0  20 6f 6e 20 69 74 73 20  72 69 67 68 74 2e 0d 01  | on its right...|
00000500  54 05 3a 0d 01 5e 17 73  77 25 20 3d 20 28 31 2b  |T.:..^.sw% = (1+|
00000510  73 70 72 25 21 31 36 29  2a 34 0d 01 68 14 73 68  |spr%!16)*4..h.sh|
00000520  25 20 3d 20 20 31 2b 73  70 72 25 21 32 30 0d 01  |% =  1+spr%!20..|
00000530  72 40 64 61 74 61 73 69  7a 65 25 20 3d 20 73 77  |r@datasize% = sw|
00000540  25 2a 73 68 25 2a 32 2a  34 20 3a f4 20 32 20 62  |%*sh%*2*4 :. 2 b|
00000550  79 74 65 73 20 70 69 78  65 6c 73 2f 6d 61 73 6b  |ytes pixels/mask|
00000560  73 2c 20 34 20 69 6e 73  74 61 6e 63 65 73 0d 01  |s, 4 instances..|
00000570  7c 15 de 20 64 61 74 61  25 20 64 61 74 61 73 69  ||.. data% datasi|
00000580  7a 65 25 0d 01 86 05 3a  0d 01 90 19 f2 63 6f 6e  |ze%....:.....con|
00000590  76 65 72 74 28 73 70 72  25 2c 20 64 61 74 61 25  |vert(spr%, data%|
000005a0  29 0d 01 9a 05 3a 0d 01  a4 17 f4 20 4e 6f 77 20  |)....:..... Now |
000005b0  73 61 76 65 20 6f 75 72  20 64 61 74 61 0d 01 ae  |save our data...|
000005c0  5a c8 99 20 22 4f 53 5f  46 69 6c 65 22 2c 20 31  |Z.. "OS_File", 1|
000005d0  30 2c 20 22 3c 42 61 6c  6c 73 24 44 69 72 3e 2e  |0, "<Balls$Dir>.|
000005e0  52 65 73 6f 75 72 63 65  73 2e 22 2b 6e 61 6d 65  |Resources."+name|
000005f0  24 2b 22 44 61 74 61 22  2c 20 26 46 46 44 2c 2c  |$+"Data", &FFD,,|
00000600  20 64 61 74 61 25 2c 20  64 61 74 61 25 2b 64 61  | data%, data%+da|
00000610  74 61 73 69 7a 65 25 0d  01 b8 05 e0 0d 01 c2 05  |tasize%.........|
00000620  3a 0d 01 cc 05 3a 0d 01  d6 1e dd 20 f2 63 6f 6e  |:....:..... .con|
00000630  76 65 72 74 28 73 70 72  25 2c 20 64 61 74 61 70  |vert(spr%, datap|
00000640  74 72 25 29 0d 01 e0 05  3a 0d 01 ea 7c ea 20 73  |tr%)....:...|. s|
00000650  77 25 2c 20 73 68 25 2c  20 6e 70 25 2c 20 73 70  |w%, sh%, np%, sp|
00000660  72 69 25 2c 20 73 70 72  6d 25 2c 20 6c 61 73 74  |ri%, sprm%, last|
00000670  69 6d 61 67 65 77 6f 72  64 25 2c 20 6c 61 73 74  |imageword%, last|
00000680  6d 61 73 6b 77 6f 72 64  25 2c 20 6c 6f 6f 70 25  |maskword%, loop%|
00000690  2c 20 69 6d 61 67 65 77  6f 72 64 25 2c 20 6d 61  |, imageword%, ma|
000006a0  73 6b 77 6f 72 64 25 2c  20 6f 66 66 73 65 74 25  |skword%, offset%|
000006b0  2c 20 69 77 25 2c 20 6d  77 25 2c 20 69 6e 73 74  |, iw%, mw%, inst|
000006c0  61 6e 63 65 25 0d 01 f4  44 73 77 25 20 3d 20 28  |ance%...Dsw% = (|
000006d0  31 2b 73 70 72 25 21 31  36 29 2a 34 20 3a f4 20  |1+spr%!16)*4 :. |
000006e0  73 70 72 69 74 65 20 77  69 64 74 68 20 69 6e 20  |sprite width in |
000006f0  70 69 78 65 6c 73 20 28  61 73 73 75 6d 65 20 30  |pixels (assume 0|
00000700  20 77 61 73 74 61 67 65  29 0d 01 fe 28 73 68 25  | wastage)...(sh%|
00000710  20 3d 20 20 31 2b 73 70  72 25 21 32 30 20 20 20  | =  1+spr%!20   |
00000720  20 3a f4 20 73 70 72 69  74 65 20 68 65 69 67 68  | :. sprite heigh|
00000730  74 0d 02 08 11 6e 70 25  20 3d 20 73 77 25 2a 73  |t....np% = sw%*s|
00000740  68 25 0d 02 12 2f 73 70  72 69 25 20 3d 20 73 70  |h%.../spri% = sp|
00000750  72 25 2b 73 70 72 25 21  33 32 3a f4 20 73 70 72  |r%+spr%!32:. spr|
00000760  69 74 65 20 69 6d 61 67  65 20 70 6f 69 6e 74 65  |ite image pointe|
00000770  72 0d 02 1c 2a 73 70 72  6d 25 20 3d 20 73 70 72  |r...*sprm% = spr|
00000780  25 2b 73 70 72 25 21 33  36 3a f4 20 73 70 72 69  |%+spr%!36:. spri|
00000790  74 65 20 6d 61 73 6b 20  70 74 72 0d 02 26 15 6c  |te mask ptr..&.l|
000007a0  61 73 74 69 6d 61 67 65  77 6f 72 64 25 3d 20 30  |astimageword%= 0|
000007b0  0d 02 30 15 6c 61 73 74  6d 61 73 6b 77 6f 72 64  |..0.lastmaskword|
000007c0  25 20 3d 20 30 0d 02 3a  05 3a 0d 02 44 17 e3 20  |% = 0..:.:..D.. |
000007d0  6c 6f 6f 70 25 20 3d 20  31 20 b8 20 6e 70 25 2f  |loop% = 1 . np%/|
000007e0  34 0d 02 4e 22 20 69 6d  61 67 65 77 6f 72 64 25  |4..N" imageword%|
000007f0  20 3d 20 21 73 70 72 69  25 3a 20 73 70 72 69 25  | = !spri%: spri%|
00000800  2b 3d 34 0d 02 58 22 20  6d 61 73 6b 77 6f 72 64  |+=4..X" maskword|
00000810  25 20 20 3d 20 21 73 70  72 6d 25 3a 20 73 70 72  |%  = !sprm%: spr|
00000820  6d 25 2b 3d 34 0d 02 62  2a 20 f4 20 4e 6f 77 20  |m%+=4..b* . Now |
00000830  65 6e 73 75 72 65 20 6d  61 73 6b 65 64 20 70 69  |ensure masked pi|
00000840  78 65 6c 73 20 61 72 65  20 7a 65 72 6f 65 64 0d  |xels are zeroed.|
00000850  02 6c 28 20 69 6d 61 67  65 77 6f 72 64 25 20 3d  |.l( imageword% =|
00000860  20 69 6d 61 67 65 77 6f  72 64 25 20 80 20 6d 61  | imageword% . ma|
00000870  73 6b 77 6f 72 64 25 0d  02 76 13 20 6f 66 66 73  |skword%..v. offs|
00000880  65 74 25 20 20 20 20 3d  20 30 0d 02 80 1c 20 69  |et%    = 0.... i|
00000890  77 25 20 20 20 20 20 20  20 20 3d 20 69 6d 61 67  |w%        = imag|
000008a0  65 77 6f 72 64 25 0d 02  8a 1b 20 6d 77 25 20 20  |eword%.... mw%  |
000008b0  20 20 20 20 20 20 3d 20  6d 61 73 6b 77 6f 72 64  |      = maskword|
000008c0  25 0d 02 94 18 20 e3 20  69 6e 73 74 61 6e 63 65  |%.... . instance|
000008d0  25 20 3d 20 30 20 b8 20  33 0d 02 9e 20 20 20 64  |% = 0 . 3...   d|
000008e0  61 74 61 70 74 72 25 21  28 6f 66 66 73 65 74 25  |ataptr%!(offset%|
000008f0  2b 30 29 20 3d 20 69 77  25 0d 02 a8 22 20 20 64  |+0) = iw%..."  d|
00000900  61 74 61 70 74 72 25 21  28 6f 66 66 73 65 74 25  |ataptr%!(offset%|
00000910  2b 6e 70 25 29 20 3d 20  6d 77 25 0d 02 b2 2c 20  |+np%) = mw%..., |
00000920  20 69 77 25 20 3d 20 28  69 77 25 3c 3c 38 29 20  | iw% = (iw%<<8) |
00000930  84 20 28 6c 61 73 74 69  6d 61 67 65 77 6f 72 64  |. (lastimageword|
00000940  25 3e 3e 3e 32 34 29 0d  02 bc 28 20 20 6c 61 73  |%>>>24)...(  las|
00000950  74 69 6d 61 67 65 77 6f  72 64 25 20 3d 20 6c 61  |timageword% = la|
00000960  73 74 69 6d 61 67 65 77  6f 72 64 25 3c 3c 38 0d  |stimageword%<<8.|
00000970  02 c6 2b 20 20 6d 77 25  20 3d 20 28 6d 77 25 3c  |..+  mw% = (mw%<|
00000980  3c 38 29 20 84 20 28 6c  61 73 74 6d 61 73 6b 77  |<8) . (lastmaskw|
00000990  6f 72 64 25 3e 3e 3e 32  34 29 0d 02 d0 27 20 20  |ord%>>>24)...'  |
000009a0  6c 61 73 74 6d 61 73 6b  77 6f 72 64 25 20 20 3d  |lastmaskword%  =|
000009b0  20 6c 61 73 74 6d 61 73  6b 77 6f 72 64 25 3c 3c  | lastmaskword%<<|
000009c0  38 0d 02 da 14 20 20 6f  66 66 73 65 74 25 2b 3d  |8....  offset%+=|
000009d0  6e 70 25 2a 32 0d 02 e4  06 20 ed 0d 02 ee 10 20  |np%*2.... ..... |
000009e0  64 61 74 61 70 74 72 25  2b 3d 34 0d 02 f8 20 20  |dataptr%+=4...  |
000009f0  6c 61 73 74 69 6d 61 67  65 77 6f 72 64 25 20 3d  |lastimageword% =|
00000a00  20 69 6d 61 67 65 77 6f  72 64 25 0d 03 02 1f 20  | imageword%.... |
00000a10  6c 61 73 74 6d 61 73 6b  77 6f 72 64 25 20 20 3d  |lastmaskword%  =|
00000a20  20 6d 61 73 6b 77 6f 72  64 25 0d 03 0c 05 ed 0d  | maskword%......|
00000a30  03 16 05 3a 0d 03 20 05  e1 0d ff                 |...:.. ....|
00000a3b