Home » Archimedes archive » Acorn User » AU 1996-12 B.adf » Regulars_2 » StarInfo/Wood/!Smudge256

StarInfo/Wood/!Smudge256

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 » Acorn User » AU 1996-12 B.adf » Regulars_2
Filename: StarInfo/Wood/!Smudge256
Read OK:
File size: 2A70 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >>> 256 colour pixel softnening routine
   20REM >>> by Keith T Wood
   30REM
   40REM     Use mouse to paint
   50REM     Use keys 1 to 6 to change brush
   60REM     Press 'P' to pause and 'S' to save area
   70
   80ON ERROR PROCerror
   90
  100MODE13: *POINTER
  110
  120PROCinit( 2, 64 ): REM change these paramameters to alter area size
  130PROCkick_code
  140
  150REPEAT
  160 CALL clear
  170 IF pause% THEN CALL verticle: CALL horizontal
  180 CALL encode
  190 CALL paint
  200 MOUSE x%, y%, b%: x%-=msx%: y%-=msy%
  210 key$=INKEY$(0)
  220 IF key$<>"" THEN PROCkeypress
  230 IF b% THEN PROCwrite
  240UNTIL FALSE
  250END
  260
  270DEFPROCkeypress
  280CASE key$ OF
  290 WHEN "p", "P"
  300  pause%=pause%EOR1
  310 WHEN "s", "S"
  320  VDU 24, msx%; msy%; msx%+((wi%-1)<<shx%); msy%+((hi%-1)<<shy%);
  330  SYS "OS_SpriteOp", 2,, "Smudge"+STR$(saves%), 0
  340  saves%=(saves%+1)AND15
  350 OTHERWISE
  360  IF ((VAL(key$)-1)AND15)<6 THEN brush%=VAL(key$)
  370ENDCASE
  380ENDPROC
  390
  400DEFPROCerror
  410SYS "OS_SpriteOp", 60+256, 0, 0, 0
  420MODEMODE: REPORT: PRINT " at line " ERL/10
  430END
  440
  450DEFPROCwrite
  460SYS "OS_SpriteOp", 60+256, sprt%, "victim", 0
  470IF brush%<4 THEN
  480 PROCgcol( 15 )
  490 strob%+=1: IF strob%>2 THEN strob%=0
  500 PROCview( strob% )
  510 CIRCLE FILL x%, y%+strob%*(hi%<<shy%), brush%*30
  520ENDIF
  530CASE brush% OF
  540 WHEN 4: PROCsmoke
  550 WHEN 5: PROCrings( 20, 0 )
  560 WHEN 6: PROCrings( 20, 3 )
  570ENDCASE
  580SYS "OS_SpriteOp", 60+256, 0, 0, 0
  590ENDPROC
  600
  610DEFPROCrings( r%, s% )
  620LOCAL J%, I%
  630PROCgcol( 15 )
  640 FOR J%=0 TO 2
  650  PROCview( J% )
  660  FOR I%=1 TO 5
  670   CIRCLE x%, y%+(J%*hi%<<shy%), (J%+I%)*(r%+I%*s%)
  680  NEXT
  690 NEXT
  700ENDPROC
  710
  720DEFPROCsmoke
  730LOCAL J%, K%, nx%, ny%
  740FOR J%=0 TO 2
  750 PROCgcol( RND(7)+8 )
  760 PROCview( J% )
  770 nx%=x%-50
  780 ny%=y%-50+((hi%*J%)<<shy%)
  790 FOR K%=1 TO 20
  800  CIRCLEFILL nx%+RND(100), ny%+RND(100), 8
  810 NEXT
  820NEXT
  830ENDPROC
  840
  850DEFPROCview( ys% )
  860VDU 24, 0; hi%*ys%<<shy%; (wi%-1)<<shx%; (hi%*(ys%+1)-1)<<shy%;
  870ENDPROC
  880
  890DEFPROCgcol( g% )
  900SYS "ColourTrans_ColourNumberToGCOL", g% TO g%
  910GCOL g%>>2 TINT (g%AND3)<<6
  920ENDPROC
  930
  940DEFPROCinit( ix%, iy% )
  950DIM mem% 7: !mem%=148: mem%!4=-1
  960SYS "OS_ReadModeVariable", -1,  4 TO ,, shx%
  970SYS "OS_ReadModeVariable", -1,  5 TO ,, shy%
  980SYS "OS_ReadModeVariable", -1,  6 TO ,, scrnx%
  990SYS "OS_ReadModeVariable", -1, 12 TO ,, scrny%
 1000SYS "OS_ReadModeVariable", -1,  9 TO ,, bpp%
 1010SYS "OS_ReadVduVariables", mem%, mem%
 1020IF bpp%<>3 THEN PRINT"Try a 256 Colour mode!": END
 1030wi%=(16*3*2)*ix%
 1040hi%=(3)*iy%
 1050IF wi%>scrnx% OR hi%>scrny% THEN PRINT"Bad parameters!": END
 1060msx%=((scrnx%-wi%)<<shx%)>>1
 1070msy%=(((scrny%-hi%+4)<<shy%)>>1)
 1080sprt_size%=wi%*hi%*4+4096
 1090DIM sprt% sprt_size%
 1100!sprt%=sprt_size%
 1110sprt%!8=16
 1120sprt%!16=0
 1130SYS "OS_SpriteOp",  9+256, sprt%
 1140SYS "OS_SpriteOp", 15+256, sprt%, "victim", 0, wi%, 4*hi%, MODE
 1150SYS "OS_SpriteOp", 24+256, sprt%, "victim" TO ,, addr%
 1160imag%=addr%!32+addr%
 1170pause%=1
 1180brush%=2
 1190saves%=1
 1200strob%=0
 1210SYS "OS_SpriteOp", 60+256, sprt%, "victim", 0: CLS
 1220SYS "OS_SpriteOp", 60+256, 0, 0, 0
 1230SYS "OS_RemoveCursors"
 1240MOUSE RECTANGLE msx%, msy%, (wi%-1)<<shx%, (hi%-1)<<shy%
 1250ENDPROC
 1260
 1270DEFPROCkick_code
 1280DIM code% 20000
 1290FOR pass=0 TO 2 STEP 2
 1300 P%=code%
 1310 PROCencode_code
 1320 PROCverticle_code
 1330 PROChorizontal_code
 1340 PROCclear_code
 1350 PROCpaint_code
 1360NEXT
 1370ENDPROC
 1380
 1390DEFPROCpaint_code: REM efficient sprite plotting
 1400
 1410Cnty = 8: Wide = 9: Ptr  =10: Scrn =11: Line =12
 1420
 1430[OPT    pass
 1440 
 1450 .vduvars EQUD 148: EQUD -1
 1460 .p_cntry EQUD hi%
 1470 .p_scrnw EQUD scrnx%
 1480 .p_image EQUD imag%
 1490 .p_scrnp EQUD !mem%+((scrnx%-wi%)>>1)+((scrny%-hi%)>>1)*scrnx%
 1500 
 1510 .paint
 1520 ADR    r0, p_cntry
 1530 LDMIA  r0, {Cnty, Wide, Ptr, Scrn}
 1540 MOV    Line, Scrn
 1550 
 1560 .p_outer
 1570 FNpaint_macro( wi%/8/4 )
 1580 ADD    Line, Line, Wide
 1590 MOV    Scrn, Line
 1600 SUBS   Cnty, Cnty, #1
 1610 BGT    p_outer
 1620 MOV    PC, r14
 1630]
 1640ENDPROC
 1650
 1660DEFFNpaint_macro( x% )
 1670LOCAL J%
 1680FOR J%=1 TO x%
 1690[OPT    pass
 1700 LDMIA  (Ptr)!, {r0-r7}
 1710 STMIA  (Scrn)!, {r0-r7}
 1720]
 1730NEXT
 1740=""
 1750
 1760DEFPROCclear_code: REM for inserting black borders
 1770
 1780Off  =10: Ptr  =11
 1790
 1800[OPT    pass
 1810 
 1820 .clear
 1830 ADR    r0, c_blank
 1840 LDMIA  r0, {r0-r7, Off, Ptr}
 1850 
 1860 .c_loop1
 1870 FNclear_macro( wi%/8/4 )
 1880 ADD    Ptr, Ptr, Off
 1890 FNclear_macro( wi%/8/2 )
 1900 ADD    Ptr, Ptr, Off
 1910 FNclear_macro( wi%/8/2 )
 1920 ADD    Ptr, Ptr, Off
 1930 FNclear_macro( wi%/8/4 )
 1940 MOV    PC, r14
 1950
 1960 .c_blank EQUD 0: EQUD 0: EQUD 0: EQUD 0: EQUD 0: EQUD 0: EQUD 0: EQUD 0
 1970 .c_offst EQUD wi%*(hi%-2)
 1980 .c_point EQUD imag%+(wi%*hi%)
 1990]
 2000ENDPROC
 2010
 2020DEFFNclear_macro( x% )
 2030LOCAL J%
 2040FOR J%=1 TO x%
 2050[OPT    pass
 2060 STMIA  (Ptr)!, {r0-r7}
 2070]
 2080NEXT
 2090=""
 2100
 2110DEFPROChorizontal_code: REM vertcle softning
 2120
 2130Ext  =10: Tmp  =11
 2140Cnt  =12: Msk  =13: Ptr  =14
 2150
 2160[OPT    pass
 2170
 2180 .horizontal
 2190 ADR    r0, h_stack
 2200 STMIA  r0!, {r13, r14}
 2210 LDMIA  r0, {Cnt, Msk, Ptr}
 2220
 2230 .h_loop_out
 2240 LDR    r0, h_overc
 2250 ORR    Cnt, Cnt, r0
 2260 MOV    Ext, #0
 2270 LDMIA  Ptr, {r0-r8}
 2280 
 2290 .h_loop_in
 2300 FNh_macro
 2310 STMIA  (Ptr)!, {r0-r7}
 2320 LDMIA  Ptr, {r0-r8}
 2330 SUBS   Cnt, Cnt, #&10000
 2340 BPL    h_loop_in
 2350 MOV    r8, #0
 2360 FNh_macro
 2370 STMIA  (Ptr)!, {r0-r7}
 2380 ADD    Cnt, Cnt, #&10000
 2390 SUBS   Cnt, Cnt, #1
 2400 BPL    h_loop_out
 2410 ADR    r0, h_stack
 2420 LDMIA  r0, {r13, PC}
 2430
 2440 .h_stack EQUD 0: EQUD 0
 2450 .h_count EQUD hi%*3
 2460 .h_masks EQUD &0F0F0F0F
 2470 .h_point EQUD imag%+(wi%*hi%)
 2480 .h_overc EQUD ((wi%)/(8*4)-2)<<16
 2490]
 2500ENDPROC
 2510
 2520DEFFNh_macro: REM row averaging routine
 2530LOCAL I
 2540FOR I=0 TO 7
 2550[OPT    pass
 2560 MOVS   Tmp, I, LSL #1            ; multiply middle by two
 2570 ADDNE  Tmp, Tmp, I, LSL #8       ; add right neighbours
 2580 ADDNE  Tmp, Tmp, I, LSR #8       ; add left neighbours
 2590 ADDS   Tmp, Tmp, Ext, LSR #24    ; add neighbours over word boundaries
 2600 MOVNE  Ext, I                    ; save overwritten reg to left
 2610 ADDS   Tmp, Tmp, (I+1), LSL #24  ; ditto but other way
 2620 ANDNE  I, Msk, Tmp, LSR #4       ; write new middle reg
 2630]
 2640NEXT
 2650=""
 2660
 2670DEFPROCverticle_code: REM verticle softening
 2680
 2690Cnt  =12: Wid  =13: Ptr  =14
 2700
 2710[OPT    pass
 2720 
 2730 .verticle
 2740 ADR    r0, v_stack
 2750 STMIA  r0!, {r13, r14}
 2760 LDMIA  r0, {Cnt, Wid, Ptr}
 2770 
 2780 .v_loop_out
 2790 ADR    r0, v_point
 2800 LDMIA  r0, {r0, r1}
 2810 ADD    Ptr, r0, Cnt, LSL #4
 2820 ORR    Cnt, Cnt, r1
 2830 LDMIA  Ptr, {r0-r3}
 2840 ADD    Ptr, Ptr, Wid
 2850 LDMIA  Ptr, {r4-r7}
 2860 ADD    Ptr, Ptr, Wid
 2870 
 2880 .v_loop_in
 2890 LDMIA  Ptr, {r8-r11}
 2900 FNv_macro( 0, 4, 8 )
 2910 LDMIA  Ptr, {r0-r3}
 2920 FNv_macro( 4, 8, 0 )
 2930 LDMIA  Ptr, {r4-r7}
 2940 FNv_macro( 8, 0, 4 )
 2950 SUBS   Cnt, Cnt, #&10000
 2960 BPL    v_loop_in
 2970 ADD    Cnt, Cnt, #&10000
 2980 SUBS   Cnt, Cnt, #1
 2990 BPL    v_loop_out
 3000 ADR    r0, v_stack
 3010 LDMIA  r0, {r13, PC}
 3020 
 3030 .v_stack EQUD 0: EQUD 0
 3040 .v_count EQUD wi%/(4*4)-1
 3050 .v_width EQUD wi%
 3060 .v_point EQUD imag%+(wi%*hi%)
 3070 .v_overc EQUD (hi%-1)<<16
 3080]
 3090ENDPROC
 3100
 3110DEFFNv_macro( Row1, Row2, Row3 ): REM column averaging routine
 3120LOCAL I
 3130FOR I=0 TO 3
 3140[OPT    pass
 3150 ADD    (Row1+I), (Row1+I), (Row2+I), LSL #1 ; average columns
 3160 ADD    (Row1+I), (Row1+I), (Row3+I)         ; ditto
 3170]
 3180NEXT
 3190[OPT    pass
 3200 SUB    Ptr, Ptr, Wid                        ; previous pointer
 3210 STMIA  Ptr, {(Row1)-(Row1+3)}               ; store results
 3220 ADD    Ptr, Ptr, Wid, LSL #1                ; new pointer
 3230]
 3240=""
 3250
 3260DEFPROCencode_code: REM r/g/b encoding routine (12 pixels per loop)
 3270
 3280Tmp1 = 0: Tmp2 = 0: Tmp3 = 0
 3290Tac1 = 0: Tac2 = 1: Tac3 = 2
 3300Pix1 = 3: Pix2 = 4: Pix3 = 5
 3310Gre1 = 6: Gre2 = 7: Gre3 = 8
 3320Blu1 = 6: Blu2 = 7: Blu3 = 8
 3330Cnt  = 9: Ptr  =10: Off  =11
 3340Msk1 =12: Msk3 =13: MskB =14
 3350
 3360[OPT    pass
 3370
 3380 .encode
 3390 ADR    r0, e_stack
 3400 STMIA  r0!, {r13, r14}
 3410 LDMIA  r0, {Cnt, Ptr, Off, Msk1, Msk3, MskB}
 3420 
 3430 .e_loop
 3440 ADD    Ptr, Ptr, Off; get red ptr.
 3450 LDMIA  Ptr, {Tac1, Tac2, Tac3}      ; get red in tint accumulator
 3460 ADD    Pix1, Tac1, Msk1, LSL #3     ; transform red bits
 3470 BIC    Pix1, Pix1, MskB             ; red encoded
 3480 ADD    Pix2, Tac2, Msk1, LSL #3     ; transform red bits
 3490 BIC    Pix2, Pix2, MskB             ; red encoded
 3500 ADD    Pix3, Tac3, Msk1, LSL #3     ; transform red bits
 3510 BIC    Pix3, Pix3, MskB             ; red encoded
 3520 BIC    Tac1, Tac1, Msk3, LSL #2     ; tint correction
 3530 BIC    Tac2, Tac2, Msk3, LSL #2
 3540 BIC    Tac3, Tac3, Msk3, LSL #2
 3550 ADD    Ptr, Ptr, Off                ; get green pointer
 3560 LDMIA  Ptr, {Gre1, Gre2, Gre3}      ; get green in Gre
 3570 ADDS   Tac1, Tac1, Gre1, LSL #1     ; tint accumulator
 3580 ANDNES Gre1, Gre1, Msk3, LSL #2     ; get green bits
 3590 SUBNE  Tac1, Tac1, Gre1, LSL #1     ; tint correction
 3600 ORRNE  Pix1, Pix1, Gre1, LSL #3     ; green encoded
 3610 ADDS   Tac2, Tac2, Gre2, LSL #1     ; tint accumulator
 3620 ANDNES Gre2, Gre2, Msk3, LSL #2     ; get green bits
 3630 SUBNE  Tac2, Tac2, Gre2, LSL #1     ; tint correction
 3640 ORRNE  Pix2, Pix2, Gre2, LSL #3     ; green encoded
 3650 ADDS   Tac3, Tac3, Gre3, LSL #1     ; tint accumulator
 3660 ANDNES Gre3, Gre3, Msk3, LSL #2     ; get green bits
 3670 SUBNE  Tac3, Tac3, Gre3, LSL #1     ; tint correction
 3680 ORRNE  Pix3, Pix3, Gre3, LSL #3     ; green encoded
 3690 ADD    Ptr, Ptr, Off                ; get blue pointer
 3700 LDMIA  Ptr, {Blu1, Blu2, Blu3}      ; get blue in Blu
 3710 ADDS   Tac1, Tac1, Blu1             ; tint accumulator
 3720 BICNE  Blu1, Blu1, Msk3             ; clear tints in blue
 3730 SUBNES Tac1, Tac1, Blu1             ; clear blue from tints
 3740 ANDNE  Tac1, Msk3, Tac1, LSR #2     ; get average tints
 3750 ORRNE  Pix1, Pix1, Tac1             ; store tints (now have a free reg.)
 3760 ANDS   Tmp1, Blu1, Msk1, LSL #2     ; get blue bit 2
 3770 ORRNE  Pix1, Pix1, Tmp1, LSL #1     ; store blue bit 2
 3780 ANDS   Tmp2, Blu2, Msk1, LSL #2     ; get blue bit 2
 3790 ORRNE  Pix2, Pix2, Tmp2, LSL #1     ; store blue bit 2
 3800 ANDS   Tmp3, Blu3, Msk1, LSL #2     ; get blue bit 2
 3810 ORRNE  Pix3, Pix3, Tmp3, LSL #1     ; store blue bit 2
 3820 ANDS   Tmp1, Blu1, Msk1, LSL #3     ; get blue bit 3
 3830 ORRNE  Pix1, Pix1, Tmp1, LSL #4     ; all encoded
 3840 ANDS   Tmp2, Blu2, Msk1, LSL #3     ; get blue bit 3
 3850 ORRNE  Pix2, Pix2, Tmp2, LSL #4     ; all encoded
 3860 ANDS   Tmp3, Blu3, Msk1, LSL #3     ; get blue bit 3
 3870 ORRNE  Pix3, Pix3, Tmp3, LSL #4     ; all encoded
 3880 ANDS   Blu2, Msk3, Blu2             ; get other blue tints
 3890 ADDNE  Tac2, Tac2, Blu2             ; tint accumulator
 3900 ANDS   Tac2, Msk3, Tac2, LSR #2     ; get average tint
 3910 ORRNE  Pix2, Pix2, Tac2             ; tints encoded
 3920 ANDS   Blu3, Msk3, Blu3             ; get other blue tints
 3930 ADDNE  Tac3, Tac3, Blu3             ; tint accumulator
 3940 ANDS   Tac3, Msk3, Tac3, LSR #2     ; get average tint
 3950 ORRNE  Pix3, Pix3, Tac3             ; all encoded
 3960 SUB    Ptr, Ptr, Off, LSL #1        ; correct pointer
 3970 SUB    Ptr, Ptr, Off
 3980 STMIA  (Ptr)!, {Pix1, Pix2, Pix3}   ; write pixels
 3990 SUBS   Cnt, Cnt, #1
 4000 BPL    e_loop
 4010 ADR    r0, e_stack
 4020 LDMIA  r0, {r13, PC}
 4030 
 4040 .e_stack EQUD 0: EQUD 0
 4050 .e_count EQUD (wi%*hi%)/(4*3)-1
 4060 .e_point EQUD imag%
 4070 .e_offst EQUD wi%*hi%
 4080 .e_masks EQUD &01010101: EQUD &03030303: EQUD &0B0B0B0B
 4090]
 4100ENDPROC

-� >>> 256 colour pixel softnening routine
� >>> by Keith T Wood
�
(�     Use mouse to paint
2)�     Use keys 1 to 6 to change brush
<1�     Press 'P' to pause and 'S' to save area
F
P� � �error
Z
d�13: *POINTER
n
xB�init( 2, 64 ): � change these paramameters to alter area size
��kick_code
�
��
� � clear
�( � pause% � � verticle: � horizontal
�
 � encode
� � paint
�& ȗ x%, y%, b%: x%-=msx%: y%-=msy%
� key$=�(0)
� � key$<>"" � �keypress
� � b% � �write
�� �
��

��keypress

Ȏ key$ �
" � "p", "P"
,  pause%=pause%�1
6 � "s", "S"
@C  � 24, msx%; msy%; msx%+((wi%-1)<<shx%); msy%+((hi%-1)<<shy%);
J1  ș "OS_SpriteOp", 2,, "Smudge"+�(saves%), 0
T  saves%=(saves%+1)�15
^ 
h+  � ((�(key$)-1)�15)<6 � brush%=�(key$)
r�
|�
�
���error
�%ș "OS_SpriteOp", 60+256, 0, 0, 0
���: �: � " at line " �/10
��
�
���write
�0ș "OS_SpriteOp", 60+256, sprt%, "victim", 0
�� brush%<4 �
� �gcol( 15 )
�% strob%+=1: � strob%>2 � strob%=0
� �view( strob% )
�/ ȏ Ȑ x%, y%+strob%*(hi%<<shy%), brush%*30
�
Ȏ brush% �
 � 4: �smoke
& � 5: �rings( 20, 0 )
0 � 6: �rings( 20, 3 )
:�
D%ș "OS_SpriteOp", 60+256, 0, 0, 0
N�
X
b��rings( r%, s% )
l� J%, I%
v�gcol( 15 )
� � J%=0 � 2
�  �view( J% )
�  � I%=1 � 5
�3   ȏ x%, y%+(J%*hi%<<shy%), (J%+I%)*(r%+I%*s%)
�  �
� �
��
�
���smoke
�� J%, K%, nx%, ny%
�� J%=0 � 2
� �gcol( �(7)+8 )
� �view( J% )
 nx%=x%-50
 ny%=y%-50+((hi%*J%)<<shy%)
 � K%=1 � 20
 $  ȏȐ nx%+�(100), ny%+�(100), 8
* �
4�
>�
H
R��view( ys% )
\A� 24, 0; hi%*ys%<<shy%; (wi%-1)<<shx%; (hi%*(ys%+1)-1)<<shy%;
f�
p
z��gcol( g% )
�0ș "ColourTrans_ColourNumberToGCOL", g% � g%
�� g%>>2 Ȝ (g%�3)<<6
��
�
���init( ix%, iy% )
�"� mem% 7: !mem%=148: mem%!4=-1
�.ș "OS_ReadModeVariable", -1,  4 � ,, shx%
�.ș "OS_ReadModeVariable", -1,  5 � ,, shy%
�0ș "OS_ReadModeVariable", -1,  6 � ,, scrnx%
�0ș "OS_ReadModeVariable", -1, 12 � ,, scrny%
�.ș "OS_ReadModeVariable", -1,  9 � ,, bpp%
�(ș "OS_ReadVduVariables", mem%, mem%
�,� bpp%<>3 � �"Try a 256 Colour mode!": �
wi%=(16*3*2)*ix%
hi%=(3)*iy%
5� wi%>scrnx% � hi%>scrny% � �"Bad parameters!": �
$ msx%=((scrnx%-wi%)<<shx%)>>1
.$msy%=(((scrny%-hi%+4)<<shy%)>>1)
8sprt_size%=wi%*hi%*4+4096
B� sprt% sprt_size%
L!sprt%=sprt_size%
Vsprt%!8=16
`sprt%!16=0
j#ș "OS_SpriteOp",  9+256, sprt%
t?ș "OS_SpriteOp", 15+256, sprt%, "victim", 0, wi%, 4*hi%, �
~8ș "OS_SpriteOp", 24+256, sprt%, "victim" � ,, addr%
�imag%=addr%!32+addr%
�pause%=1
�brush%=2
�saves%=1
�strob%=0
�3ș "OS_SpriteOp", 60+256, sprt%, "victim", 0: �
�%ș "OS_SpriteOp", 60+256, 0, 0, 0
�ș "OS_RemoveCursors"
�2ȗ ȓ msx%, msy%, (wi%-1)<<shx%, (hi%-1)<<shy%
��
�
���kick_code
� code% 20000

� pass=0 � 2 � 2

 P%=code%
 �encode_code
( �verticle_code
2 �horizontal_code
< �clear_code
F �paint_code
P�
Z�
d
n-��paint_code: � efficient sprite plotting
x
�4Cnty = 8: Wide = 9: Ptr  =10: Scrn =11: Line =12
�
�[OPT    pass
� 
� .vduvars EQUD 148: EQUD -1
� .p_cntry EQUD hi%
� .p_scrnw EQUD scrnx%
� .p_image EQUD imag%
�C .p_scrnp EQUD !mem%+((scrnx%-wi%)>>1)+((scrny%-hi%)>>1)*scrnx%
� 
� .paint
� ADR    r0, p_cntry
�' LDMIA  r0, {Cnty, Wide, Ptr, Scrn}
 MOV    Line, Scrn
 

 .p_outer
" �paint_macro( wi%/8/4 )
, ADD    Line, Line, Wide
6 MOV    Scrn, Line
@ SUBS   Cnty, Cnty, #1
J BGT    p_outer
T MOV    PC, r14
^]
h�
r
|ݤpaint_macro( x% )
�� J%
�� J%=1 � x%
�[OPT    pass
� LDMIA  (Ptr)!, {r0-r7}
� STMIA  (Scrn)!, {r0-r7}
�]
��
�=""
�
�/��clear_code: � for inserting black borders
�
�Off  =10: Ptr  =11
�
[OPT    pass
 
 .clear
& ADR    r0, c_blank
0! LDMIA  r0, {r0-r7, Off, Ptr}
: 
D
 .c_loop1
N �clear_macro( wi%/8/4 )
X ADD    Ptr, Ptr, Off
b �clear_macro( wi%/8/2 )
l ADD    Ptr, Ptr, Off
v �clear_macro( wi%/8/2 )
� ADD    Ptr, Ptr, Off
� �clear_macro( wi%/8/4 )
� MOV    PC, r14
�
�L .c_blank EQUD 0: EQUD 0: EQUD 0: EQUD 0: EQUD 0: EQUD 0: EQUD 0: EQUD 0
� .c_offst EQUD wi%*(hi%-2)
�" .c_point EQUD imag%+(wi%*hi%)
�]
��
�
�ݤclear_macro( x% )
�� J%
�� J%=1 � x%
[OPT    pass
 STMIA  (Ptr)!, {r0-r7}
]
 �
*=""
4
>)��horizontal_code: � vertcle softning
H
RExt  =10: Tmp  =11
\ Cnt  =12: Msk  =13: Ptr  =14
f
p[OPT    pass
z
� .horizontal
� ADR    r0, h_stack
� STMIA  r0!, {r13, r14}
� LDMIA  r0, {Cnt, Msk, Ptr}
�
� .h_loop_out
� LDR    r0, h_overc
� �R    Cnt, Cnt, r0
� MOV    Ext, #0
� LDMIA  Ptr, {r0-r8}
� 
� .h_loop_in
�
 �h_macro
	 STMIA  (Ptr)!, {r0-r7}
	 LDMIA  Ptr, {r0-r8}
	 SUBS   Cnt, Cnt, #&10000
	$ BPL    h_loop_in
	. MOV    r8, #0
	8
 �h_macro
	B STMIA  (Ptr)!, {r0-r7}
	L ADD    Cnt, Cnt, #&10000
	V SUBS   Cnt, Cnt, #1
	` BPL    h_loop_out
	j ADR    r0, h_stack
	t LDMIA  r0, {r13, PC}
	~
	� .h_stack EQUD 0: EQUD 0
	� .h_count EQUD hi%*3
	� .h_masks EQUD &0F0F0F0F
	�" .h_point EQUD imag%+(wi%*hi%)
	�& .h_overc EQUD ((wi%)/(8*4)-2)<<16
	�]
	��
	�
	�&ݤh_macro: � row averaging routine
	�� I
	�
� I=0 � 7
	�[OPT    pass
> MOVS   Tmp, I, LSL #1            ; multiply middle by two

< ADDNE  Tmp, Tmp, I, LSL #8       ; add right neighbours
; ADDNE  Tmp, Tmp, I, LSR #8       ; add left neighbours
K ADDS   Tmp, Tmp, Ext, LSR #24    ; add neighbours over word boundaries
(D MOVNE  Ext, I                    ; save overwritten reg to left
2; ADDS   Tmp, Tmp, (I+1), LSL #24  ; ditto but other way
<: �NE  I, Msk, Tmp, LSR #4       ; write new middle reg
F]
P�
Z=""
d
n)��verticle_code: � verticle softening
x
� Cnt  =12: Wid  =13: Ptr  =14
�
�[OPT    pass
� 
� .verticle
� ADR    r0, v_stack
� STMIA  r0!, {r13, r14}
� LDMIA  r0, {Cnt, Wid, Ptr}
� 
� .v_loop_out
� ADR    r0, v_point
� LDMIA  r0, {r0, r1}
�  ADD    Ptr, r0, Cnt, LSL #4
 �R    Cnt, Cnt, r1
 LDMIA  Ptr, {r0-r3}
 ADD    Ptr, Ptr, Wid
" LDMIA  Ptr, {r4-r7}
, ADD    Ptr, Ptr, Wid
6 
@ .v_loop_in
J LDMIA  Ptr, {r8-r11}
T �v_macro( 0, 4, 8 )
^ LDMIA  Ptr, {r0-r3}
h �v_macro( 4, 8, 0 )
r LDMIA  Ptr, {r4-r7}
| �v_macro( 8, 0, 4 )
� SUBS   Cnt, Cnt, #&10000
� BPL    v_loop_in
� ADD    Cnt, Cnt, #&10000
� SUBS   Cnt, Cnt, #1
� BPL    v_loop_out
� ADR    r0, v_stack
� LDMIA  r0, {r13, PC}
� 
� .v_stack EQUD 0: EQUD 0
� .v_count EQUD wi%/(4*4)-1
� .v_width EQUD wi%
�" .v_point EQUD imag%+(wi%*hi%)
� .v_overc EQUD (hi%-1)<<16
]
�

&=ݤv_macro( Row1, Row2, Row3 ): � column averaging routine
0� I
:
� I=0 � 3
D[OPT    pass
NB ADD    (Row1+I), (Row1+I), (Row2+I), LSL #1 ; average columns
X8 ADD    (Row1+I), (Row1+I), (Row3+I)         ; ditto
b]
l�
v[OPT    pass
�C SUB    Ptr, Ptr, Wid                        ; previous pointer
�@ STMIA  Ptr, {(Row1)-(Row1+3)}               ; store results
�> ADD    Ptr, Ptr, Wid, LSL #1                ; new pointer
�]
�=""
�
�@��encode_code: � r/g/b encoding routine (12 pixels per loop)
�
� Tmp1 = 0: Tmp2 = 0: Tmp3 = 0
� Tac1 = 0: Tac2 = 1: Tac3 = 2
� Pix1 = 3: Pix2 = 4: Pix3 = 5
� Gre1 = 6: Gre2 = 7: Gre3 = 8
� Blu1 = 6: Blu2 = 7: Blu3 = 8

 Cnt  = 9: Ptr  =10: Off  =11

 Msk1 =12: Msk3 =13: MskB =14



 [OPT    pass

*

4 .encode

> ADR    r0, e_stack

H STMIA  r0!, {r13, r14}

R1 LDMIA  r0, {Cnt, Ptr, Off, Msk1, Msk3, MskB}

\ 

f .e_loop

p' ADD    Ptr, Ptr, Off; get red ptr.

zF LDMIA  Ptr, {Tac1, Tac2, Tac3}      ; get red in tint accumulator

�= ADD    Pix1, Tac1, Msk1, LSL #3     ; transform red bits

�6 BIC    Pix1, Pix1, MskB             ; red encoded

�= ADD    Pix2, Tac2, Msk1, LSL #3     ; transform red bits

�6 BIC    Pix2, Pix2, MskB             ; red encoded

�= ADD    Pix3, Tac3, Msk1, LSL #3     ; transform red bits

�6 BIC    Pix3, Pix3, MskB             ; red encoded

�: BIC    Tac1, Tac1, Msk3, LSL #2     ; tint correction

�$ BIC    Tac2, Tac2, Msk3, LSL #2

�$ BIC    Tac3, Tac3, Msk3, LSL #2

�< ADD    Ptr, Ptr, Off                ; get green pointer

�; LDMIA  Ptr, {Gre1, Gre2, Gre3}      ; get green in Gre

�; ADDS   Tac1, Tac1, Gre1, LSL #1     ; tint accumulator

�7 �NES Gre1, Gre1, Msk3, LSL #2     ; get green bits
: SUBNE  Tac1, Tac1, Gre1, LSL #1     ; tint correction
7 �RNE  Pix1, Pix1, Gre1, LSL #3     ; green encoded
; ADDS   Tac2, Tac2, Gre2, LSL #1     ; tint accumulator
$7 �NES Gre2, Gre2, Msk3, LSL #2     ; get green bits
.: SUBNE  Tac2, Tac2, Gre2, LSL #1     ; tint correction
87 �RNE  Pix2, Pix2, Gre2, LSL #3     ; green encoded
B; ADDS   Tac3, Tac3, Gre3, LSL #1     ; tint accumulator
L7 �NES Gre3, Gre3, Msk3, LSL #2     ; get green bits
V: SUBNE  Tac3, Tac3, Gre3, LSL #1     ; tint correction
`7 �RNE  Pix3, Pix3, Gre3, LSL #3     ; green encoded
j; ADD    Ptr, Ptr, Off                ; get blue pointer
t: LDMIA  Ptr, {Blu1, Blu2, Blu3}      ; get blue in Blu
~; ADDS   Tac1, Tac1, Blu1             ; tint accumulator
�> BICNE  Blu1, Blu1, Msk3             ; clear tints in blue
�@ SUBNES Tac1, Tac1, Blu1             ; clear blue from tints
�: �NE  Tac1, Msk3, Tac1, LSR #2     ; get average tints
�L �RNE  Pix1, Pix1, Tac1             ; store tints (now have a free reg.)
�7 �S   Tmp1, Blu1, Msk1, LSL #2     ; get blue bit 2
�: �RNE  Pix1, Pix1, Tmp1, LSL #1     ; store blue bit 2
�7 �S   Tmp2, Blu2, Msk1, LSL #2     ; get blue bit 2
�: �RNE  Pix2, Pix2, Tmp2, LSL #1     ; store blue bit 2
�7 �S   Tmp3, Blu3, Msk1, LSL #2     ; get blue bit 2
�: �RNE  Pix3, Pix3, Tmp3, LSL #1     ; store blue bit 2
�7 �S   Tmp1, Blu1, Msk1, LSL #3     ; get blue bit 3
�5 �RNE  Pix1, Pix1, Tmp1, LSL #4     ; all encoded
7 �S   Tmp2, Blu2, Msk1, LSL #3     ; get blue bit 3

5 �RNE  Pix2, Pix2, Tmp2, LSL #4     ; all encoded
7 �S   Tmp3, Blu3, Msk1, LSL #3     ; get blue bit 3
5 �RNE  Pix3, Pix3, Tmp3, LSL #4     ; all encoded
(= �S   Blu2, Msk3, Blu2             ; get other blue tints
2; ADDNE  Tac2, Tac2, Blu2             ; tint accumulator
<9 �S   Tac2, Msk3, Tac2, LSR #2     ; get average tint
F7 �RNE  Pix2, Pix2, Tac2             ; tints encoded
P= �S   Blu3, Msk3, Blu3             ; get other blue tints
Z; ADDNE  Tac3, Tac3, Blu3             ; tint accumulator
d9 �S   Tac3, Msk3, Tac3, LSR #2     ; get average tint
n5 �RNE  Pix3, Pix3, Tac3             ; all encoded
x: SUB    Ptr, Ptr, Off, LSL #1        ; correct pointer
� SUB    Ptr, Ptr, Off
�7 STMIA  (Ptr)!, {Pix1, Pix2, Pix3}   ; write pixels
� SUBS   Cnt, Cnt, #1
� BPL    e_loop
� ADR    r0, e_stack
� LDMIA  r0, {r13, PC}
� 
� .e_stack EQUD 0: EQUD 0
�$ .e_count EQUD (wi%*hi%)/(4*3)-1
� .e_point EQUD imag%
� .e_offst EQUD wi%*hi%
�< .e_masks EQUD &01010101: EQUD &03030303: EQUD &0B0B0B0B
�]
�
�
00000000  0d 00 0a 2d f4 20 3e 3e  3e 20 32 35 36 20 63 6f  |...-. >>> 256 co|
00000010  6c 6f 75 72 20 70 69 78  65 6c 20 73 6f 66 74 6e  |lour pixel softn|
00000020  65 6e 69 6e 67 20 72 6f  75 74 69 6e 65 0d 00 14  |ening routine...|
00000030  19 f4 20 3e 3e 3e 20 62  79 20 4b 65 69 74 68 20  |.. >>> by Keith |
00000040  54 20 57 6f 6f 64 0d 00  1e 05 f4 0d 00 28 1c f4  |T Wood.......(..|
00000050  20 20 20 20 20 55 73 65  20 6d 6f 75 73 65 20 74  |     Use mouse t|
00000060  6f 20 70 61 69 6e 74 0d  00 32 29 f4 20 20 20 20  |o paint..2).    |
00000070  20 55 73 65 20 6b 65 79  73 20 31 20 74 6f 20 36  | Use keys 1 to 6|
00000080  20 74 6f 20 63 68 61 6e  67 65 20 62 72 75 73 68  | to change brush|
00000090  0d 00 3c 31 f4 20 20 20  20 20 50 72 65 73 73 20  |..<1.     Press |
000000a0  27 50 27 20 74 6f 20 70  61 75 73 65 20 61 6e 64  |'P' to pause and|
000000b0  20 27 53 27 20 74 6f 20  73 61 76 65 20 61 72 65  | 'S' to save are|
000000c0  61 0d 00 46 04 0d 00 50  0e ee 20 85 20 f2 65 72  |a..F...P.. . .er|
000000d0  72 6f 72 0d 00 5a 04 0d  00 64 11 eb 31 33 3a 20  |ror..Z...d..13: |
000000e0  2a 50 4f 49 4e 54 45 52  0d 00 6e 04 0d 00 78 42  |*POINTER..n...xB|
000000f0  f2 69 6e 69 74 28 20 32  2c 20 36 34 20 29 3a 20  |.init( 2, 64 ): |
00000100  f4 20 63 68 61 6e 67 65  20 74 68 65 73 65 20 70  |. change these p|
00000110  61 72 61 6d 61 6d 65 74  65 72 73 20 74 6f 20 61  |aramameters to a|
00000120  6c 74 65 72 20 61 72 65  61 20 73 69 7a 65 0d 00  |lter area size..|
00000130  82 0e f2 6b 69 63 6b 5f  63 6f 64 65 0d 00 8c 04  |...kick_code....|
00000140  0d 00 96 05 f5 0d 00 a0  0c 20 d6 20 63 6c 65 61  |......... . clea|
00000150  72 0d 00 aa 28 20 e7 20  70 61 75 73 65 25 20 8c  |r...( . pause% .|
00000160  20 d6 20 76 65 72 74 69  63 6c 65 3a 20 d6 20 68  | . verticle: . h|
00000170  6f 72 69 7a 6f 6e 74 61  6c 0d 00 b4 0d 20 d6 20  |orizontal.... . |
00000180  65 6e 63 6f 64 65 0d 00  be 0c 20 d6 20 70 61 69  |encode.... . pai|
00000190  6e 74 0d 00 c8 26 20 c8  97 20 78 25 2c 20 79 25  |nt...& .. x%, y%|
000001a0  2c 20 62 25 3a 20 78 25  2d 3d 6d 73 78 25 3a 20  |, b%: x%-=msx%: |
000001b0  79 25 2d 3d 6d 73 79 25  0d 00 d2 0e 20 6b 65 79  |y%-=msy%.... key|
000001c0  24 3d bf 28 30 29 0d 00  dc 1b 20 e7 20 6b 65 79  |$=.(0).... . key|
000001d0  24 3c 3e 22 22 20 8c 20  f2 6b 65 79 70 72 65 73  |$<>"" . .keypres|
000001e0  73 0d 00 e6 12 20 e7 20  62 25 20 8c 20 f2 77 72  |s.... . b% . .wr|
000001f0  69 74 65 0d 00 f0 07 fd  20 a3 0d 00 fa 05 e0 0d  |ite..... .......|
00000200  01 04 04 0d 01 0e 0e dd  f2 6b 65 79 70 72 65 73  |.........keypres|
00000210  73 0d 01 18 0d c8 8e 20  6b 65 79 24 20 ca 0d 01  |s...... key$ ...|
00000220  22 0f 20 c9 20 22 70 22  2c 20 22 50 22 0d 01 2c  |". . "p", "P"..,|
00000230  15 20 20 70 61 75 73 65  25 3d 70 61 75 73 65 25  |.  pause%=pause%|
00000240  82 31 0d 01 36 0f 20 c9  20 22 73 22 2c 20 22 53  |.1..6. . "s", "S|
00000250  22 0d 01 40 43 20 20 ef  20 32 34 2c 20 6d 73 78  |"..@C  . 24, msx|
00000260  25 3b 20 6d 73 79 25 3b  20 6d 73 78 25 2b 28 28  |%; msy%; msx%+((|
00000270  77 69 25 2d 31 29 3c 3c  73 68 78 25 29 3b 20 6d  |wi%-1)<<shx%); m|
00000280  73 79 25 2b 28 28 68 69  25 2d 31 29 3c 3c 73 68  |sy%+((hi%-1)<<sh|
00000290  79 25 29 3b 0d 01 4a 31  20 20 c8 99 20 22 4f 53  |y%);..J1  .. "OS|
000002a0  5f 53 70 72 69 74 65 4f  70 22 2c 20 32 2c 2c 20  |_SpriteOp", 2,, |
000002b0  22 53 6d 75 64 67 65 22  2b c3 28 73 61 76 65 73  |"Smudge"+.(saves|
000002c0  25 29 2c 20 30 0d 01 54  1a 20 20 73 61 76 65 73  |%), 0..T.  saves|
000002d0  25 3d 28 73 61 76 65 73  25 2b 31 29 80 31 35 0d  |%=(saves%+1).15.|
000002e0  01 5e 06 20 7f 0d 01 68  2b 20 20 e7 20 28 28 bb  |.^. ...h+  . ((.|
000002f0  28 6b 65 79 24 29 2d 31  29 80 31 35 29 3c 36 20  |(key$)-1).15)<6 |
00000300  8c 20 62 72 75 73 68 25  3d bb 28 6b 65 79 24 29  |. brush%=.(key$)|
00000310  0d 01 72 05 cb 0d 01 7c  05 e1 0d 01 86 04 0d 01  |..r....|........|
00000320  90 0b dd f2 65 72 72 6f  72 0d 01 9a 25 c8 99 20  |....error...%.. |
00000330  22 4f 53 5f 53 70 72 69  74 65 4f 70 22 2c 20 36  |"OS_SpriteOp", 6|
00000340  30 2b 32 35 36 2c 20 30  2c 20 30 2c 20 30 0d 01  |0+256, 0, 0, 0..|
00000350  a4 1d eb eb 3a 20 f6 3a  20 f1 20 22 20 61 74 20  |....: .: . " at |
00000360  6c 69 6e 65 20 22 20 9e  2f 31 30 0d 01 ae 05 e0  |line " ./10.....|
00000370  0d 01 b8 04 0d 01 c2 0b  dd f2 77 72 69 74 65 0d  |..........write.|
00000380  01 cc 30 c8 99 20 22 4f  53 5f 53 70 72 69 74 65  |..0.. "OS_Sprite|
00000390  4f 70 22 2c 20 36 30 2b  32 35 36 2c 20 73 70 72  |Op", 60+256, spr|
000003a0  74 25 2c 20 22 76 69 63  74 69 6d 22 2c 20 30 0d  |t%, "victim", 0.|
000003b0  01 d6 10 e7 20 62 72 75  73 68 25 3c 34 20 8c 0d  |.... brush%<4 ..|
000003c0  01 e0 10 20 f2 67 63 6f  6c 28 20 31 35 20 29 0d  |... .gcol( 15 ).|
000003d0  01 ea 25 20 73 74 72 6f  62 25 2b 3d 31 3a 20 e7  |..% strob%+=1: .|
000003e0  20 73 74 72 6f 62 25 3e  32 20 8c 20 73 74 72 6f  | strob%>2 . stro|
000003f0  62 25 3d 30 0d 01 f4 14  20 f2 76 69 65 77 28 20  |b%=0.... .view( |
00000400  73 74 72 6f 62 25 20 29  0d 01 fe 2f 20 c8 8f 20  |strob% ).../ .. |
00000410  c8 90 20 78 25 2c 20 79  25 2b 73 74 72 6f 62 25  |.. x%, y%+strob%|
00000420  2a 28 68 69 25 3c 3c 73  68 79 25 29 2c 20 62 72  |*(hi%<<shy%), br|
00000430  75 73 68 25 2a 33 30 0d  02 08 05 cd 0d 02 12 0f  |ush%*30.........|
00000440  c8 8e 20 62 72 75 73 68  25 20 ca 0d 02 1c 10 20  |.. brush% ..... |
00000450  c9 20 34 3a 20 f2 73 6d  6f 6b 65 0d 02 26 19 20  |. 4: .smoke..&. |
00000460  c9 20 35 3a 20 f2 72 69  6e 67 73 28 20 32 30 2c  |. 5: .rings( 20,|
00000470  20 30 20 29 0d 02 30 19  20 c9 20 36 3a 20 f2 72  | 0 )..0. . 6: .r|
00000480  69 6e 67 73 28 20 32 30  2c 20 33 20 29 0d 02 3a  |ings( 20, 3 )..:|
00000490  05 cb 0d 02 44 25 c8 99  20 22 4f 53 5f 53 70 72  |....D%.. "OS_Spr|
000004a0  69 74 65 4f 70 22 2c 20  36 30 2b 32 35 36 2c 20  |iteOp", 60+256, |
000004b0  30 2c 20 30 2c 20 30 0d  02 4e 05 e1 0d 02 58 04  |0, 0, 0..N....X.|
000004c0  0d 02 62 15 dd f2 72 69  6e 67 73 28 20 72 25 2c  |..b...rings( r%,|
000004d0  20 73 25 20 29 0d 02 6c  0c ea 20 4a 25 2c 20 49  | s% )..l.. J%, I|
000004e0  25 0d 02 76 0f f2 67 63  6f 6c 28 20 31 35 20 29  |%..v..gcol( 15 )|
000004f0  0d 02 80 0f 20 e3 20 4a  25 3d 30 20 b8 20 32 0d  |.... . J%=0 . 2.|
00000500  02 8a 11 20 20 f2 76 69  65 77 28 20 4a 25 20 29  |...  .view( J% )|
00000510  0d 02 94 10 20 20 e3 20  49 25 3d 31 20 b8 20 35  |....  . I%=1 . 5|
00000520  0d 02 9e 33 20 20 20 c8  8f 20 78 25 2c 20 79 25  |...3   .. x%, y%|
00000530  2b 28 4a 25 2a 68 69 25  3c 3c 73 68 79 25 29 2c  |+(J%*hi%<<shy%),|
00000540  20 28 4a 25 2b 49 25 29  2a 28 72 25 2b 49 25 2a  | (J%+I%)*(r%+I%*|
00000550  73 25 29 0d 02 a8 07 20  20 ed 0d 02 b2 06 20 ed  |s%)....  ..... .|
00000560  0d 02 bc 05 e1 0d 02 c6  04 0d 02 d0 0b dd f2 73  |...............s|
00000570  6d 6f 6b 65 0d 02 da 16  ea 20 4a 25 2c 20 4b 25  |moke..... J%, K%|
00000580  2c 20 6e 78 25 2c 20 6e  79 25 0d 02 e4 0e e3 20  |, nx%, ny%..... |
00000590  4a 25 3d 30 20 b8 20 32  0d 02 ee 14 20 f2 67 63  |J%=0 . 2.... .gc|
000005a0  6f 6c 28 20 b3 28 37 29  2b 38 20 29 0d 02 f8 10  |ol( .(7)+8 )....|
000005b0  20 f2 76 69 65 77 28 20  4a 25 20 29 0d 03 02 0e  | .view( J% )....|
000005c0  20 6e 78 25 3d 78 25 2d  35 30 0d 03 0c 1f 20 6e  | nx%=x%-50.... n|
000005d0  79 25 3d 79 25 2d 35 30  2b 28 28 68 69 25 2a 4a  |y%=y%-50+((hi%*J|
000005e0  25 29 3c 3c 73 68 79 25  29 0d 03 16 10 20 e3 20  |%)<<shy%).... . |
000005f0  4b 25 3d 31 20 b8 20 32  30 0d 03 20 24 20 20 c8  |K%=1 . 20.. $  .|
00000600  8f c8 90 20 6e 78 25 2b  b3 28 31 30 30 29 2c 20  |... nx%+.(100), |
00000610  6e 79 25 2b b3 28 31 30  30 29 2c 20 38 0d 03 2a  |ny%+.(100), 8..*|
00000620  06 20 ed 0d 03 34 05 ed  0d 03 3e 05 e1 0d 03 48  |. ...4....>....H|
00000630  04 0d 03 52 11 dd f2 76  69 65 77 28 20 79 73 25  |...R...view( ys%|
00000640  20 29 0d 03 5c 41 ef 20  32 34 2c 20 30 3b 20 68  | )..\A. 24, 0; h|
00000650  69 25 2a 79 73 25 3c 3c  73 68 79 25 3b 20 28 77  |i%*ys%<<shy%; (w|
00000660  69 25 2d 31 29 3c 3c 73  68 78 25 3b 20 28 68 69  |i%-1)<<shx%; (hi|
00000670  25 2a 28 79 73 25 2b 31  29 2d 31 29 3c 3c 73 68  |%*(ys%+1)-1)<<sh|
00000680  79 25 3b 0d 03 66 05 e1  0d 03 70 04 0d 03 7a 10  |y%;..f....p...z.|
00000690  dd f2 67 63 6f 6c 28 20  67 25 20 29 0d 03 84 30  |..gcol( g% )...0|
000006a0  c8 99 20 22 43 6f 6c 6f  75 72 54 72 61 6e 73 5f  |.. "ColourTrans_|
000006b0  43 6f 6c 6f 75 72 4e 75  6d 62 65 72 54 6f 47 43  |ColourNumberToGC|
000006c0  4f 4c 22 2c 20 67 25 20  b8 20 67 25 0d 03 8e 18  |OL", g% . g%....|
000006d0  e6 20 67 25 3e 3e 32 20  c8 9c 20 28 67 25 80 33  |. g%>>2 .. (g%.3|
000006e0  29 3c 3c 36 0d 03 98 05  e1 0d 03 a2 04 0d 03 ac  |)<<6............|
000006f0  16 dd f2 69 6e 69 74 28  20 69 78 25 2c 20 69 79  |...init( ix%, iy|
00000700  25 20 29 0d 03 b6 22 de  20 6d 65 6d 25 20 37 3a  |% )...". mem% 7:|
00000710  20 21 6d 65 6d 25 3d 31  34 38 3a 20 6d 65 6d 25  | !mem%=148: mem%|
00000720  21 34 3d 2d 31 0d 03 c0  2e c8 99 20 22 4f 53 5f  |!4=-1...... "OS_|
00000730  52 65 61 64 4d 6f 64 65  56 61 72 69 61 62 6c 65  |ReadModeVariable|
00000740  22 2c 20 2d 31 2c 20 20  34 20 b8 20 2c 2c 20 73  |", -1,  4 . ,, s|
00000750  68 78 25 0d 03 ca 2e c8  99 20 22 4f 53 5f 52 65  |hx%...... "OS_Re|
00000760  61 64 4d 6f 64 65 56 61  72 69 61 62 6c 65 22 2c  |adModeVariable",|
00000770  20 2d 31 2c 20 20 35 20  b8 20 2c 2c 20 73 68 79  | -1,  5 . ,, shy|
00000780  25 0d 03 d4 30 c8 99 20  22 4f 53 5f 52 65 61 64  |%...0.. "OS_Read|
00000790  4d 6f 64 65 56 61 72 69  61 62 6c 65 22 2c 20 2d  |ModeVariable", -|
000007a0  31 2c 20 20 36 20 b8 20  2c 2c 20 73 63 72 6e 78  |1,  6 . ,, scrnx|
000007b0  25 0d 03 de 30 c8 99 20  22 4f 53 5f 52 65 61 64  |%...0.. "OS_Read|
000007c0  4d 6f 64 65 56 61 72 69  61 62 6c 65 22 2c 20 2d  |ModeVariable", -|
000007d0  31 2c 20 31 32 20 b8 20  2c 2c 20 73 63 72 6e 79  |1, 12 . ,, scrny|
000007e0  25 0d 03 e8 2e c8 99 20  22 4f 53 5f 52 65 61 64  |%...... "OS_Read|
000007f0  4d 6f 64 65 56 61 72 69  61 62 6c 65 22 2c 20 2d  |ModeVariable", -|
00000800  31 2c 20 20 39 20 b8 20  2c 2c 20 62 70 70 25 0d  |1,  9 . ,, bpp%.|
00000810  03 f2 28 c8 99 20 22 4f  53 5f 52 65 61 64 56 64  |..(.. "OS_ReadVd|
00000820  75 56 61 72 69 61 62 6c  65 73 22 2c 20 6d 65 6d  |uVariables", mem|
00000830  25 2c 20 6d 65 6d 25 0d  03 fc 2c e7 20 62 70 70  |%, mem%...,. bpp|
00000840  25 3c 3e 33 20 8c 20 f1  22 54 72 79 20 61 20 32  |%<>3 . ."Try a 2|
00000850  35 36 20 43 6f 6c 6f 75  72 20 6d 6f 64 65 21 22  |56 Colour mode!"|
00000860  3a 20 e0 0d 04 06 14 77  69 25 3d 28 31 36 2a 33  |: .....wi%=(16*3|
00000870  2a 32 29 2a 69 78 25 0d  04 10 0f 68 69 25 3d 28  |*2)*ix%....hi%=(|
00000880  33 29 2a 69 79 25 0d 04  1a 35 e7 20 77 69 25 3e  |3)*iy%...5. wi%>|
00000890  73 63 72 6e 78 25 20 84  20 68 69 25 3e 73 63 72  |scrnx% . hi%>scr|
000008a0  6e 79 25 20 8c 20 f1 22  42 61 64 20 70 61 72 61  |ny% . ."Bad para|
000008b0  6d 65 74 65 72 73 21 22  3a 20 e0 0d 04 24 20 6d  |meters!": ...$ m|
000008c0  73 78 25 3d 28 28 73 63  72 6e 78 25 2d 77 69 25  |sx%=((scrnx%-wi%|
000008d0  29 3c 3c 73 68 78 25 29  3e 3e 31 0d 04 2e 24 6d  |)<<shx%)>>1...$m|
000008e0  73 79 25 3d 28 28 28 73  63 72 6e 79 25 2d 68 69  |sy%=(((scrny%-hi|
000008f0  25 2b 34 29 3c 3c 73 68  79 25 29 3e 3e 31 29 0d  |%+4)<<shy%)>>1).|
00000900  04 38 1d 73 70 72 74 5f  73 69 7a 65 25 3d 77 69  |.8.sprt_size%=wi|
00000910  25 2a 68 69 25 2a 34 2b  34 30 39 36 0d 04 42 16  |%*hi%*4+4096..B.|
00000920  de 20 73 70 72 74 25 20  73 70 72 74 5f 73 69 7a  |. sprt% sprt_siz|
00000930  65 25 0d 04 4c 15 21 73  70 72 74 25 3d 73 70 72  |e%..L.!sprt%=spr|
00000940  74 5f 73 69 7a 65 25 0d  04 56 0e 73 70 72 74 25  |t_size%..V.sprt%|
00000950  21 38 3d 31 36 0d 04 60  0e 73 70 72 74 25 21 31  |!8=16..`.sprt%!1|
00000960  36 3d 30 0d 04 6a 23 c8  99 20 22 4f 53 5f 53 70  |6=0..j#.. "OS_Sp|
00000970  72 69 74 65 4f 70 22 2c  20 20 39 2b 32 35 36 2c  |riteOp",  9+256,|
00000980  20 73 70 72 74 25 0d 04  74 3f c8 99 20 22 4f 53  | sprt%..t?.. "OS|
00000990  5f 53 70 72 69 74 65 4f  70 22 2c 20 31 35 2b 32  |_SpriteOp", 15+2|
000009a0  35 36 2c 20 73 70 72 74  25 2c 20 22 76 69 63 74  |56, sprt%, "vict|
000009b0  69 6d 22 2c 20 30 2c 20  77 69 25 2c 20 34 2a 68  |im", 0, wi%, 4*h|
000009c0  69 25 2c 20 eb 0d 04 7e  38 c8 99 20 22 4f 53 5f  |i%, ...~8.. "OS_|
000009d0  53 70 72 69 74 65 4f 70  22 2c 20 32 34 2b 32 35  |SpriteOp", 24+25|
000009e0  36 2c 20 73 70 72 74 25  2c 20 22 76 69 63 74 69  |6, sprt%, "victi|
000009f0  6d 22 20 b8 20 2c 2c 20  61 64 64 72 25 0d 04 88  |m" . ,, addr%...|
00000a00  18 69 6d 61 67 25 3d 61  64 64 72 25 21 33 32 2b  |.imag%=addr%!32+|
00000a10  61 64 64 72 25 0d 04 92  0c 70 61 75 73 65 25 3d  |addr%....pause%=|
00000a20  31 0d 04 9c 0c 62 72 75  73 68 25 3d 32 0d 04 a6  |1....brush%=2...|
00000a30  0c 73 61 76 65 73 25 3d  31 0d 04 b0 0c 73 74 72  |.saves%=1....str|
00000a40  6f 62 25 3d 30 0d 04 ba  33 c8 99 20 22 4f 53 5f  |ob%=0...3.. "OS_|
00000a50  53 70 72 69 74 65 4f 70  22 2c 20 36 30 2b 32 35  |SpriteOp", 60+25|
00000a60  36 2c 20 73 70 72 74 25  2c 20 22 76 69 63 74 69  |6, sprt%, "victi|
00000a70  6d 22 2c 20 30 3a 20 db  0d 04 c4 25 c8 99 20 22  |m", 0: ....%.. "|
00000a80  4f 53 5f 53 70 72 69 74  65 4f 70 22 2c 20 36 30  |OS_SpriteOp", 60|
00000a90  2b 32 35 36 2c 20 30 2c  20 30 2c 20 30 0d 04 ce  |+256, 0, 0, 0...|
00000aa0  19 c8 99 20 22 4f 53 5f  52 65 6d 6f 76 65 43 75  |... "OS_RemoveCu|
00000ab0  72 73 6f 72 73 22 0d 04  d8 32 c8 97 20 c8 93 20  |rsors"...2.. .. |
00000ac0  6d 73 78 25 2c 20 6d 73  79 25 2c 20 28 77 69 25  |msx%, msy%, (wi%|
00000ad0  2d 31 29 3c 3c 73 68 78  25 2c 20 28 68 69 25 2d  |-1)<<shx%, (hi%-|
00000ae0  31 29 3c 3c 73 68 79 25  0d 04 e2 05 e1 0d 04 ec  |1)<<shy%........|
00000af0  04 0d 04 f6 0f dd f2 6b  69 63 6b 5f 63 6f 64 65  |.......kick_code|
00000b00  0d 05 00 11 de 20 63 6f  64 65 25 20 32 30 30 30  |..... code% 2000|
00000b10  30 0d 05 0a 14 e3 20 70  61 73 73 3d 30 20 b8 20  |0..... pass=0 . |
00000b20  32 20 88 20 32 0d 05 14  0d 20 50 25 3d 63 6f 64  |2 . 2.... P%=cod|
00000b30  65 25 0d 05 1e 11 20 f2  65 6e 63 6f 64 65 5f 63  |e%.... .encode_c|
00000b40  6f 64 65 0d 05 28 13 20  f2 76 65 72 74 69 63 6c  |ode..(. .verticl|
00000b50  65 5f 63 6f 64 65 0d 05  32 15 20 f2 68 6f 72 69  |e_code..2. .hori|
00000b60  7a 6f 6e 74 61 6c 5f 63  6f 64 65 0d 05 3c 10 20  |zontal_code..<. |
00000b70  f2 63 6c 65 61 72 5f 63  6f 64 65 0d 05 46 10 20  |.clear_code..F. |
00000b80  f2 70 61 69 6e 74 5f 63  6f 64 65 0d 05 50 05 ed  |.paint_code..P..|
00000b90  0d 05 5a 05 e1 0d 05 64  04 0d 05 6e 2d dd f2 70  |..Z....d...n-..p|
00000ba0  61 69 6e 74 5f 63 6f 64  65 3a 20 f4 20 65 66 66  |aint_code: . eff|
00000bb0  69 63 69 65 6e 74 20 73  70 72 69 74 65 20 70 6c  |icient sprite pl|
00000bc0  6f 74 74 69 6e 67 0d 05  78 04 0d 05 82 34 43 6e  |otting..x....4Cn|
00000bd0  74 79 20 3d 20 38 3a 20  57 69 64 65 20 3d 20 39  |ty = 8: Wide = 9|
00000be0  3a 20 50 74 72 20 20 3d  31 30 3a 20 53 63 72 6e  |: Ptr  =10: Scrn|
00000bf0  20 3d 31 31 3a 20 4c 69  6e 65 20 3d 31 32 0d 05  | =11: Line =12..|
00000c00  8c 04 0d 05 96 10 5b 4f  50 54 20 20 20 20 70 61  |......[OPT    pa|
00000c10  73 73 0d 05 a0 05 20 0d  05 aa 1f 20 2e 76 64 75  |ss.... .... .vdu|
00000c20  76 61 72 73 20 45 51 55  44 20 31 34 38 3a 20 45  |vars EQUD 148: E|
00000c30  51 55 44 20 2d 31 0d 05  b4 16 20 2e 70 5f 63 6e  |QUD -1.... .p_cn|
00000c40  74 72 79 20 45 51 55 44  20 68 69 25 0d 05 be 19  |try EQUD hi%....|
00000c50  20 2e 70 5f 73 63 72 6e  77 20 45 51 55 44 20 73  | .p_scrnw EQUD s|
00000c60  63 72 6e 78 25 0d 05 c8  18 20 2e 70 5f 69 6d 61  |crnx%.... .p_ima|
00000c70  67 65 20 45 51 55 44 20  69 6d 61 67 25 0d 05 d2  |ge EQUD imag%...|
00000c80  43 20 2e 70 5f 73 63 72  6e 70 20 45 51 55 44 20  |C .p_scrnp EQUD |
00000c90  21 6d 65 6d 25 2b 28 28  73 63 72 6e 78 25 2d 77  |!mem%+((scrnx%-w|
00000ca0  69 25 29 3e 3e 31 29 2b  28 28 73 63 72 6e 79 25  |i%)>>1)+((scrny%|
00000cb0  2d 68 69 25 29 3e 3e 31  29 2a 73 63 72 6e 78 25  |-hi%)>>1)*scrnx%|
00000cc0  0d 05 dc 05 20 0d 05 e6  0b 20 2e 70 61 69 6e 74  |.... .... .paint|
00000cd0  0d 05 f0 17 20 41 44 52  20 20 20 20 72 30 2c 20  |.... ADR    r0, |
00000ce0  70 5f 63 6e 74 72 79 0d  05 fa 27 20 4c 44 4d 49  |p_cntry...' LDMI|
00000cf0  41 20 20 72 30 2c 20 7b  43 6e 74 79 2c 20 57 69  |A  r0, {Cnty, Wi|
00000d00  64 65 2c 20 50 74 72 2c  20 53 63 72 6e 7d 0d 06  |de, Ptr, Scrn}..|
00000d10  04 16 20 4d 4f 56 20 20  20 20 4c 69 6e 65 2c 20  |.. MOV    Line, |
00000d20  53 63 72 6e 0d 06 0e 05  20 0d 06 18 0d 20 2e 70  |Scrn.... .... .p|
00000d30  5f 6f 75 74 65 72 0d 06  22 1c 20 a4 70 61 69 6e  |_outer..". .pain|
00000d40  74 5f 6d 61 63 72 6f 28  20 77 69 25 2f 38 2f 34  |t_macro( wi%/8/4|
00000d50  20 29 0d 06 2c 1c 20 41  44 44 20 20 20 20 4c 69  | )..,. ADD    Li|
00000d60  6e 65 2c 20 4c 69 6e 65  2c 20 57 69 64 65 0d 06  |ne, Line, Wide..|
00000d70  36 16 20 4d 4f 56 20 20  20 20 53 63 72 6e 2c 20  |6. MOV    Scrn, |
00000d80  4c 69 6e 65 0d 06 40 1a  20 53 55 42 53 20 20 20  |Line..@. SUBS   |
00000d90  43 6e 74 79 2c 20 43 6e  74 79 2c 20 23 31 0d 06  |Cnty, Cnty, #1..|
00000da0  4a 13 20 42 47 54 20 20  20 20 70 5f 6f 75 74 65  |J. BGT    p_oute|
00000db0  72 0d 06 54 13 20 4d 4f  56 20 20 20 20 50 43 2c  |r..T. MOV    PC,|
00000dc0  20 72 31 34 0d 06 5e 05  5d 0d 06 68 05 e1 0d 06  | r14..^.]..h....|
00000dd0  72 04 0d 06 7c 17 dd a4  70 61 69 6e 74 5f 6d 61  |r...|...paint_ma|
00000de0  63 72 6f 28 20 78 25 20  29 0d 06 86 08 ea 20 4a  |cro( x% )..... J|
00000df0  25 0d 06 90 0f e3 20 4a  25 3d 31 20 b8 20 78 25  |%..... J%=1 . x%|
00000e00  0d 06 9a 10 5b 4f 50 54  20 20 20 20 70 61 73 73  |....[OPT    pass|
00000e10  0d 06 a4 1b 20 4c 44 4d  49 41 20 20 28 50 74 72  |.... LDMIA  (Ptr|
00000e20  29 21 2c 20 7b 72 30 2d  72 37 7d 0d 06 ae 1c 20  |)!, {r0-r7}.... |
00000e30  53 54 4d 49 41 20 20 28  53 63 72 6e 29 21 2c 20  |STMIA  (Scrn)!, |
00000e40  7b 72 30 2d 72 37 7d 0d  06 b8 05 5d 0d 06 c2 05  |{r0-r7}....]....|
00000e50  ed 0d 06 cc 07 3d 22 22  0d 06 d6 04 0d 06 e0 2f  |.....=""......./|
00000e60  dd f2 63 6c 65 61 72 5f  63 6f 64 65 3a 20 f4 20  |..clear_code: . |
00000e70  66 6f 72 20 69 6e 73 65  72 74 69 6e 67 20 62 6c  |for inserting bl|
00000e80  61 63 6b 20 62 6f 72 64  65 72 73 0d 06 ea 04 0d  |ack borders.....|
00000e90  06 f4 16 4f 66 66 20 20  3d 31 30 3a 20 50 74 72  |...Off  =10: Ptr|
00000ea0  20 20 3d 31 31 0d 06 fe  04 0d 07 08 10 5b 4f 50  |  =11........[OP|
00000eb0  54 20 20 20 20 70 61 73  73 0d 07 12 05 20 0d 07  |T    pass.... ..|
00000ec0  1c 0b 20 2e 63 6c 65 61  72 0d 07 26 17 20 41 44  |.. .clear..&. AD|
00000ed0  52 20 20 20 20 72 30 2c  20 63 5f 62 6c 61 6e 6b  |R    r0, c_blank|
00000ee0  0d 07 30 21 20 4c 44 4d  49 41 20 20 72 30 2c 20  |..0! LDMIA  r0, |
00000ef0  7b 72 30 2d 72 37 2c 20  4f 66 66 2c 20 50 74 72  |{r0-r7, Off, Ptr|
00000f00  7d 0d 07 3a 05 20 0d 07  44 0d 20 2e 63 5f 6c 6f  |}..:. ..D. .c_lo|
00000f10  6f 70 31 0d 07 4e 1c 20  a4 63 6c 65 61 72 5f 6d  |op1..N. .clear_m|
00000f20  61 63 72 6f 28 20 77 69  25 2f 38 2f 34 20 29 0d  |acro( wi%/8/4 ).|
00000f30  07 58 19 20 41 44 44 20  20 20 20 50 74 72 2c 20  |.X. ADD    Ptr, |
00000f40  50 74 72 2c 20 4f 66 66  0d 07 62 1c 20 a4 63 6c  |Ptr, Off..b. .cl|
00000f50  65 61 72 5f 6d 61 63 72  6f 28 20 77 69 25 2f 38  |ear_macro( wi%/8|
00000f60  2f 32 20 29 0d 07 6c 19  20 41 44 44 20 20 20 20  |/2 )..l. ADD    |
00000f70  50 74 72 2c 20 50 74 72  2c 20 4f 66 66 0d 07 76  |Ptr, Ptr, Off..v|
00000f80  1c 20 a4 63 6c 65 61 72  5f 6d 61 63 72 6f 28 20  |. .clear_macro( |
00000f90  77 69 25 2f 38 2f 32 20  29 0d 07 80 19 20 41 44  |wi%/8/2 ).... AD|
00000fa0  44 20 20 20 20 50 74 72  2c 20 50 74 72 2c 20 4f  |D    Ptr, Ptr, O|
00000fb0  66 66 0d 07 8a 1c 20 a4  63 6c 65 61 72 5f 6d 61  |ff.... .clear_ma|
00000fc0  63 72 6f 28 20 77 69 25  2f 38 2f 34 20 29 0d 07  |cro( wi%/8/4 )..|
00000fd0  94 13 20 4d 4f 56 20 20  20 20 50 43 2c 20 72 31  |.. MOV    PC, r1|
00000fe0  34 0d 07 9e 04 0d 07 a8  4c 20 2e 63 5f 62 6c 61  |4.......L .c_bla|
00000ff0  6e 6b 20 45 51 55 44 20  30 3a 20 45 51 55 44 20  |nk EQUD 0: EQUD |
00001000  30 3a 20 45 51 55 44 20  30 3a 20 45 51 55 44 20  |0: EQUD 0: EQUD |
*
00001030  30 0d 07 b2 1e 20 2e 63  5f 6f 66 66 73 74 20 45  |0.... .c_offst E|
00001040  51 55 44 20 77 69 25 2a  28 68 69 25 2d 32 29 0d  |QUD wi%*(hi%-2).|
00001050  07 bc 22 20 2e 63 5f 70  6f 69 6e 74 20 45 51 55  |.." .c_point EQU|
00001060  44 20 69 6d 61 67 25 2b  28 77 69 25 2a 68 69 25  |D imag%+(wi%*hi%|
00001070  29 0d 07 c6 05 5d 0d 07  d0 05 e1 0d 07 da 04 0d  |)....]..........|
00001080  07 e4 17 dd a4 63 6c 65  61 72 5f 6d 61 63 72 6f  |.....clear_macro|
00001090  28 20 78 25 20 29 0d 07  ee 08 ea 20 4a 25 0d 07  |( x% )..... J%..|
000010a0  f8 0f e3 20 4a 25 3d 31  20 b8 20 78 25 0d 08 02  |... J%=1 . x%...|
000010b0  10 5b 4f 50 54 20 20 20  20 70 61 73 73 0d 08 0c  |.[OPT    pass...|
000010c0  1b 20 53 54 4d 49 41 20  20 28 50 74 72 29 21 2c  |. STMIA  (Ptr)!,|
000010d0  20 7b 72 30 2d 72 37 7d  0d 08 16 05 5d 0d 08 20  | {r0-r7}....].. |
000010e0  05 ed 0d 08 2a 07 3d 22  22 0d 08 34 04 0d 08 3e  |....*.=""..4...>|
000010f0  29 dd f2 68 6f 72 69 7a  6f 6e 74 61 6c 5f 63 6f  |)..horizontal_co|
00001100  64 65 3a 20 f4 20 76 65  72 74 63 6c 65 20 73 6f  |de: . vertcle so|
00001110  66 74 6e 69 6e 67 0d 08  48 04 0d 08 52 16 45 78  |ftning..H...R.Ex|
00001120  74 20 20 3d 31 30 3a 20  54 6d 70 20 20 3d 31 31  |t  =10: Tmp  =11|
00001130  0d 08 5c 20 43 6e 74 20  20 3d 31 32 3a 20 4d 73  |..\ Cnt  =12: Ms|
00001140  6b 20 20 3d 31 33 3a 20  50 74 72 20 20 3d 31 34  |k  =13: Ptr  =14|
00001150  0d 08 66 04 0d 08 70 10  5b 4f 50 54 20 20 20 20  |..f...p.[OPT    |
00001160  70 61 73 73 0d 08 7a 04  0d 08 84 10 20 2e 68 6f  |pass..z..... .ho|
00001170  72 69 7a 6f 6e 74 61 6c  0d 08 8e 17 20 41 44 52  |rizontal.... ADR|
00001180  20 20 20 20 72 30 2c 20  68 5f 73 74 61 63 6b 0d  |    r0, h_stack.|
00001190  08 98 1b 20 53 54 4d 49  41 20 20 72 30 21 2c 20  |... STMIA  r0!, |
000011a0  7b 72 31 33 2c 20 72 31  34 7d 0d 08 a2 1f 20 4c  |{r13, r14}.... L|
000011b0  44 4d 49 41 20 20 72 30  2c 20 7b 43 6e 74 2c 20  |DMIA  r0, {Cnt, |
000011c0  4d 73 6b 2c 20 50 74 72  7d 0d 08 ac 04 0d 08 b6  |Msk, Ptr}.......|
000011d0  10 20 2e 68 5f 6c 6f 6f  70 5f 6f 75 74 0d 08 c0  |. .h_loop_out...|
000011e0  17 20 4c 44 52 20 20 20  20 72 30 2c 20 68 5f 6f  |. LDR    r0, h_o|
000011f0  76 65 72 63 0d 08 ca 17  20 84 52 20 20 20 20 43  |verc.... .R    C|
00001200  6e 74 2c 20 43 6e 74 2c  20 72 30 0d 08 d4 13 20  |nt, Cnt, r0.... |
00001210  4d 4f 56 20 20 20 20 45  78 74 2c 20 23 30 0d 08  |MOV    Ext, #0..|
00001220  de 18 20 4c 44 4d 49 41  20 20 50 74 72 2c 20 7b  |.. LDMIA  Ptr, {|
00001230  72 30 2d 72 38 7d 0d 08  e8 05 20 0d 08 f2 0f 20  |r0-r8}.... .... |
00001240  2e 68 5f 6c 6f 6f 70 5f  69 6e 0d 08 fc 0d 20 a4  |.h_loop_in.... .|
00001250  68 5f 6d 61 63 72 6f 0d  09 06 1b 20 53 54 4d 49  |h_macro.... STMI|
00001260  41 20 20 28 50 74 72 29  21 2c 20 7b 72 30 2d 72  |A  (Ptr)!, {r0-r|
00001270  37 7d 0d 09 10 18 20 4c  44 4d 49 41 20 20 50 74  |7}.... LDMIA  Pt|
00001280  72 2c 20 7b 72 30 2d 72  38 7d 0d 09 1a 1d 20 53  |r, {r0-r8}.... S|
00001290  55 42 53 20 20 20 43 6e  74 2c 20 43 6e 74 2c 20  |UBS   Cnt, Cnt, |
000012a0  23 26 31 30 30 30 30 0d  09 24 15 20 42 50 4c 20  |#&10000..$. BPL |
000012b0  20 20 20 68 5f 6c 6f 6f  70 5f 69 6e 0d 09 2e 12  |   h_loop_in....|
000012c0  20 4d 4f 56 20 20 20 20  72 38 2c 20 23 30 0d 09  | MOV    r8, #0..|
000012d0  38 0d 20 a4 68 5f 6d 61  63 72 6f 0d 09 42 1b 20  |8. .h_macro..B. |
000012e0  53 54 4d 49 41 20 20 28  50 74 72 29 21 2c 20 7b  |STMIA  (Ptr)!, {|
000012f0  72 30 2d 72 37 7d 0d 09  4c 1d 20 41 44 44 20 20  |r0-r7}..L. ADD  |
00001300  20 20 43 6e 74 2c 20 43  6e 74 2c 20 23 26 31 30  |  Cnt, Cnt, #&10|
00001310  30 30 30 0d 09 56 18 20  53 55 42 53 20 20 20 43  |000..V. SUBS   C|
00001320  6e 74 2c 20 43 6e 74 2c  20 23 31 0d 09 60 16 20  |nt, Cnt, #1..`. |
00001330  42 50 4c 20 20 20 20 68  5f 6c 6f 6f 70 5f 6f 75  |BPL    h_loop_ou|
00001340  74 0d 09 6a 17 20 41 44  52 20 20 20 20 72 30 2c  |t..j. ADR    r0,|
00001350  20 68 5f 73 74 61 63 6b  0d 09 74 19 20 4c 44 4d  | h_stack..t. LDM|
00001360  49 41 20 20 72 30 2c 20  7b 72 31 33 2c 20 50 43  |IA  r0, {r13, PC|
00001370  7d 0d 09 7e 04 0d 09 88  1c 20 2e 68 5f 73 74 61  |}..~..... .h_sta|
00001380  63 6b 20 45 51 55 44 20  30 3a 20 45 51 55 44 20  |ck EQUD 0: EQUD |
00001390  30 0d 09 92 18 20 2e 68  5f 63 6f 75 6e 74 20 45  |0.... .h_count E|
000013a0  51 55 44 20 68 69 25 2a  33 0d 09 9c 1c 20 2e 68  |QUD hi%*3.... .h|
000013b0  5f 6d 61 73 6b 73 20 45  51 55 44 20 26 30 46 30  |_masks EQUD &0F0|
000013c0  46 30 46 30 46 0d 09 a6  22 20 2e 68 5f 70 6f 69  |F0F0F..." .h_poi|
000013d0  6e 74 20 45 51 55 44 20  69 6d 61 67 25 2b 28 77  |nt EQUD imag%+(w|
000013e0  69 25 2a 68 69 25 29 0d  09 b0 26 20 2e 68 5f 6f  |i%*hi%)...& .h_o|
000013f0  76 65 72 63 20 45 51 55  44 20 28 28 77 69 25 29  |verc EQUD ((wi%)|
00001400  2f 28 38 2a 34 29 2d 32  29 3c 3c 31 36 0d 09 ba  |/(8*4)-2)<<16...|
00001410  05 5d 0d 09 c4 05 e1 0d  09 ce 04 0d 09 d8 26 dd  |.]............&.|
00001420  a4 68 5f 6d 61 63 72 6f  3a 20 f4 20 72 6f 77 20  |.h_macro: . row |
00001430  61 76 65 72 61 67 69 6e  67 20 72 6f 75 74 69 6e  |averaging routin|
00001440  65 0d 09 e2 07 ea 20 49  0d 09 ec 0d e3 20 49 3d  |e..... I..... I=|
00001450  30 20 b8 20 37 0d 09 f6  10 5b 4f 50 54 20 20 20  |0 . 7....[OPT   |
00001460  20 70 61 73 73 0d 0a 00  3e 20 4d 4f 56 53 20 20  | pass...> MOVS  |
00001470  20 54 6d 70 2c 20 49 2c  20 4c 53 4c 20 23 31 20  | Tmp, I, LSL #1 |
00001480  20 20 20 20 20 20 20 20  20 20 20 3b 20 6d 75 6c  |           ; mul|
00001490  74 69 70 6c 79 20 6d 69  64 64 6c 65 20 62 79 20  |tiply middle by |
000014a0  74 77 6f 0d 0a 0a 3c 20  41 44 44 4e 45 20 20 54  |two...< ADDNE  T|
000014b0  6d 70 2c 20 54 6d 70 2c  20 49 2c 20 4c 53 4c 20  |mp, Tmp, I, LSL |
000014c0  23 38 20 20 20 20 20 20  20 3b 20 61 64 64 20 72  |#8       ; add r|
000014d0  69 67 68 74 20 6e 65 69  67 68 62 6f 75 72 73 0d  |ight neighbours.|
000014e0  0a 14 3b 20 41 44 44 4e  45 20 20 54 6d 70 2c 20  |..; ADDNE  Tmp, |
000014f0  54 6d 70 2c 20 49 2c 20  4c 53 52 20 23 38 20 20  |Tmp, I, LSR #8  |
00001500  20 20 20 20 20 3b 20 61  64 64 20 6c 65 66 74 20  |     ; add left |
00001510  6e 65 69 67 68 62 6f 75  72 73 0d 0a 1e 4b 20 41  |neighbours...K A|
00001520  44 44 53 20 20 20 54 6d  70 2c 20 54 6d 70 2c 20  |DDS   Tmp, Tmp, |
00001530  45 78 74 2c 20 4c 53 52  20 23 32 34 20 20 20 20  |Ext, LSR #24    |
00001540  3b 20 61 64 64 20 6e 65  69 67 68 62 6f 75 72 73  |; add neighbours|
00001550  20 6f 76 65 72 20 77 6f  72 64 20 62 6f 75 6e 64  | over word bound|
00001560  61 72 69 65 73 0d 0a 28  44 20 4d 4f 56 4e 45 20  |aries..(D MOVNE |
00001570  20 45 78 74 2c 20 49 20  20 20 20 20 20 20 20 20  | Ext, I         |
00001580  20 20 20 20 20 20 20 20  20 20 20 3b 20 73 61 76  |           ; sav|
00001590  65 20 6f 76 65 72 77 72  69 74 74 65 6e 20 72 65  |e overwritten re|
000015a0  67 20 74 6f 20 6c 65 66  74 0d 0a 32 3b 20 41 44  |g to left..2; AD|
000015b0  44 53 20 20 20 54 6d 70  2c 20 54 6d 70 2c 20 28  |DS   Tmp, Tmp, (|
000015c0  49 2b 31 29 2c 20 4c 53  4c 20 23 32 34 20 20 3b  |I+1), LSL #24  ;|
000015d0  20 64 69 74 74 6f 20 62  75 74 20 6f 74 68 65 72  | ditto but other|
000015e0  20 77 61 79 0d 0a 3c 3a  20 80 4e 45 20 20 49 2c  | way..<: .NE  I,|
000015f0  20 4d 73 6b 2c 20 54 6d  70 2c 20 4c 53 52 20 23  | Msk, Tmp, LSR #|
00001600  34 20 20 20 20 20 20 20  3b 20 77 72 69 74 65 20  |4       ; write |
00001610  6e 65 77 20 6d 69 64 64  6c 65 20 72 65 67 0d 0a  |new middle reg..|
00001620  46 05 5d 0d 0a 50 05 ed  0d 0a 5a 07 3d 22 22 0d  |F.]..P....Z.="".|
00001630  0a 64 04 0d 0a 6e 29 dd  f2 76 65 72 74 69 63 6c  |.d...n)..verticl|
00001640  65 5f 63 6f 64 65 3a 20  f4 20 76 65 72 74 69 63  |e_code: . vertic|
00001650  6c 65 20 73 6f 66 74 65  6e 69 6e 67 0d 0a 78 04  |le softening..x.|
00001660  0d 0a 82 20 43 6e 74 20  20 3d 31 32 3a 20 57 69  |... Cnt  =12: Wi|
00001670  64 20 20 3d 31 33 3a 20  50 74 72 20 20 3d 31 34  |d  =13: Ptr  =14|
00001680  0d 0a 8c 04 0d 0a 96 10  5b 4f 50 54 20 20 20 20  |........[OPT    |
00001690  70 61 73 73 0d 0a a0 05  20 0d 0a aa 0e 20 2e 76  |pass.... .... .v|
000016a0  65 72 74 69 63 6c 65 0d  0a b4 17 20 41 44 52 20  |erticle.... ADR |
000016b0  20 20 20 72 30 2c 20 76  5f 73 74 61 63 6b 0d 0a  |   r0, v_stack..|
000016c0  be 1b 20 53 54 4d 49 41  20 20 72 30 21 2c 20 7b  |.. STMIA  r0!, {|
000016d0  72 31 33 2c 20 72 31 34  7d 0d 0a c8 1f 20 4c 44  |r13, r14}.... LD|
000016e0  4d 49 41 20 20 72 30 2c  20 7b 43 6e 74 2c 20 57  |MIA  r0, {Cnt, W|
000016f0  69 64 2c 20 50 74 72 7d  0d 0a d2 05 20 0d 0a dc  |id, Ptr}.... ...|
00001700  10 20 2e 76 5f 6c 6f 6f  70 5f 6f 75 74 0d 0a e6  |. .v_loop_out...|
00001710  17 20 41 44 52 20 20 20  20 72 30 2c 20 76 5f 70  |. ADR    r0, v_p|
00001720  6f 69 6e 74 0d 0a f0 18  20 4c 44 4d 49 41 20 20  |oint.... LDMIA  |
00001730  72 30 2c 20 7b 72 30 2c  20 72 31 7d 0d 0a fa 20  |r0, {r0, r1}... |
00001740  20 41 44 44 20 20 20 20  50 74 72 2c 20 72 30 2c  | ADD    Ptr, r0,|
00001750  20 43 6e 74 2c 20 4c 53  4c 20 23 34 0d 0b 04 17  | Cnt, LSL #4....|
00001760  20 84 52 20 20 20 20 43  6e 74 2c 20 43 6e 74 2c  | .R    Cnt, Cnt,|
00001770  20 72 31 0d 0b 0e 18 20  4c 44 4d 49 41 20 20 50  | r1.... LDMIA  P|
00001780  74 72 2c 20 7b 72 30 2d  72 33 7d 0d 0b 18 19 20  |tr, {r0-r3}.... |
00001790  41 44 44 20 20 20 20 50  74 72 2c 20 50 74 72 2c  |ADD    Ptr, Ptr,|
000017a0  20 57 69 64 0d 0b 22 18  20 4c 44 4d 49 41 20 20  | Wid..". LDMIA  |
000017b0  50 74 72 2c 20 7b 72 34  2d 72 37 7d 0d 0b 2c 19  |Ptr, {r4-r7}..,.|
000017c0  20 41 44 44 20 20 20 20  50 74 72 2c 20 50 74 72  | ADD    Ptr, Ptr|
000017d0  2c 20 57 69 64 0d 0b 36  05 20 0d 0b 40 0f 20 2e  |, Wid..6. ..@. .|
000017e0  76 5f 6c 6f 6f 70 5f 69  6e 0d 0b 4a 19 20 4c 44  |v_loop_in..J. LD|
000017f0  4d 49 41 20 20 50 74 72  2c 20 7b 72 38 2d 72 31  |MIA  Ptr, {r8-r1|
00001800  31 7d 0d 0b 54 18 20 a4  76 5f 6d 61 63 72 6f 28  |1}..T. .v_macro(|
00001810  20 30 2c 20 34 2c 20 38  20 29 0d 0b 5e 18 20 4c  | 0, 4, 8 )..^. L|
00001820  44 4d 49 41 20 20 50 74  72 2c 20 7b 72 30 2d 72  |DMIA  Ptr, {r0-r|
00001830  33 7d 0d 0b 68 18 20 a4  76 5f 6d 61 63 72 6f 28  |3}..h. .v_macro(|
00001840  20 34 2c 20 38 2c 20 30  20 29 0d 0b 72 18 20 4c  | 4, 8, 0 )..r. L|
00001850  44 4d 49 41 20 20 50 74  72 2c 20 7b 72 34 2d 72  |DMIA  Ptr, {r4-r|
00001860  37 7d 0d 0b 7c 18 20 a4  76 5f 6d 61 63 72 6f 28  |7}..|. .v_macro(|
00001870  20 38 2c 20 30 2c 20 34  20 29 0d 0b 86 1d 20 53  | 8, 0, 4 ).... S|
00001880  55 42 53 20 20 20 43 6e  74 2c 20 43 6e 74 2c 20  |UBS   Cnt, Cnt, |
00001890  23 26 31 30 30 30 30 0d  0b 90 15 20 42 50 4c 20  |#&10000.... BPL |
000018a0  20 20 20 76 5f 6c 6f 6f  70 5f 69 6e 0d 0b 9a 1d  |   v_loop_in....|
000018b0  20 41 44 44 20 20 20 20  43 6e 74 2c 20 43 6e 74  | ADD    Cnt, Cnt|
000018c0  2c 20 23 26 31 30 30 30  30 0d 0b a4 18 20 53 55  |, #&10000.... SU|
000018d0  42 53 20 20 20 43 6e 74  2c 20 43 6e 74 2c 20 23  |BS   Cnt, Cnt, #|
000018e0  31 0d 0b ae 16 20 42 50  4c 20 20 20 20 76 5f 6c  |1.... BPL    v_l|
000018f0  6f 6f 70 5f 6f 75 74 0d  0b b8 17 20 41 44 52 20  |oop_out.... ADR |
00001900  20 20 20 72 30 2c 20 76  5f 73 74 61 63 6b 0d 0b  |   r0, v_stack..|
00001910  c2 19 20 4c 44 4d 49 41  20 20 72 30 2c 20 7b 72  |.. LDMIA  r0, {r|
00001920  31 33 2c 20 50 43 7d 0d  0b cc 05 20 0d 0b d6 1c  |13, PC}.... ....|
00001930  20 2e 76 5f 73 74 61 63  6b 20 45 51 55 44 20 30  | .v_stack EQUD 0|
00001940  3a 20 45 51 55 44 20 30  0d 0b e0 1e 20 2e 76 5f  |: EQUD 0.... .v_|
00001950  63 6f 75 6e 74 20 45 51  55 44 20 77 69 25 2f 28  |count EQUD wi%/(|
00001960  34 2a 34 29 2d 31 0d 0b  ea 16 20 2e 76 5f 77 69  |4*4)-1.... .v_wi|
00001970  64 74 68 20 45 51 55 44  20 77 69 25 0d 0b f4 22  |dth EQUD wi%..."|
00001980  20 2e 76 5f 70 6f 69 6e  74 20 45 51 55 44 20 69  | .v_point EQUD i|
00001990  6d 61 67 25 2b 28 77 69  25 2a 68 69 25 29 0d 0b  |mag%+(wi%*hi%)..|
000019a0  fe 1e 20 2e 76 5f 6f 76  65 72 63 20 45 51 55 44  |.. .v_overc EQUD|
000019b0  20 28 68 69 25 2d 31 29  3c 3c 31 36 0d 0c 08 05  | (hi%-1)<<16....|
000019c0  5d 0d 0c 12 05 e1 0d 0c  1c 04 0d 0c 26 3d dd a4  |]...........&=..|
000019d0  76 5f 6d 61 63 72 6f 28  20 52 6f 77 31 2c 20 52  |v_macro( Row1, R|
000019e0  6f 77 32 2c 20 52 6f 77  33 20 29 3a 20 f4 20 63  |ow2, Row3 ): . c|
000019f0  6f 6c 75 6d 6e 20 61 76  65 72 61 67 69 6e 67 20  |olumn averaging |
00001a00  72 6f 75 74 69 6e 65 0d  0c 30 07 ea 20 49 0d 0c  |routine..0.. I..|
00001a10  3a 0d e3 20 49 3d 30 20  b8 20 33 0d 0c 44 10 5b  |:.. I=0 . 3..D.[|
00001a20  4f 50 54 20 20 20 20 70  61 73 73 0d 0c 4e 42 20  |OPT    pass..NB |
00001a30  41 44 44 20 20 20 20 28  52 6f 77 31 2b 49 29 2c  |ADD    (Row1+I),|
00001a40  20 28 52 6f 77 31 2b 49  29 2c 20 28 52 6f 77 32  | (Row1+I), (Row2|
00001a50  2b 49 29 2c 20 4c 53 4c  20 23 31 20 3b 20 61 76  |+I), LSL #1 ; av|
00001a60  65 72 61 67 65 20 63 6f  6c 75 6d 6e 73 0d 0c 58  |erage columns..X|
00001a70  38 20 41 44 44 20 20 20  20 28 52 6f 77 31 2b 49  |8 ADD    (Row1+I|
00001a80  29 2c 20 28 52 6f 77 31  2b 49 29 2c 20 28 52 6f  |), (Row1+I), (Ro|
00001a90  77 33 2b 49 29 20 20 20  20 20 20 20 20 20 3b 20  |w3+I)         ; |
00001aa0  64 69 74 74 6f 0d 0c 62  05 5d 0d 0c 6c 05 ed 0d  |ditto..b.]..l...|
00001ab0  0c 76 10 5b 4f 50 54 20  20 20 20 70 61 73 73 0d  |.v.[OPT    pass.|
00001ac0  0c 80 43 20 53 55 42 20  20 20 20 50 74 72 2c 20  |..C SUB    Ptr, |
00001ad0  50 74 72 2c 20 57 69 64  20 20 20 20 20 20 20 20  |Ptr, Wid        |
00001ae0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001af0  3b 20 70 72 65 76 69 6f  75 73 20 70 6f 69 6e 74  |; previous point|
00001b00  65 72 0d 0c 8a 40 20 53  54 4d 49 41 20 20 50 74  |er...@ STMIA  Pt|
00001b10  72 2c 20 7b 28 52 6f 77  31 29 2d 28 52 6f 77 31  |r, {(Row1)-(Row1|
00001b20  2b 33 29 7d 20 20 20 20  20 20 20 20 20 20 20 20  |+3)}            |
00001b30  20 20 20 3b 20 73 74 6f  72 65 20 72 65 73 75 6c  |   ; store resul|
00001b40  74 73 0d 0c 94 3e 20 41  44 44 20 20 20 20 50 74  |ts...> ADD    Pt|
00001b50  72 2c 20 50 74 72 2c 20  57 69 64 2c 20 4c 53 4c  |r, Ptr, Wid, LSL|
00001b60  20 23 31 20 20 20 20 20  20 20 20 20 20 20 20 20  | #1             |
00001b70  20 20 20 3b 20 6e 65 77  20 70 6f 69 6e 74 65 72  |   ; new pointer|
00001b80  0d 0c 9e 05 5d 0d 0c a8  07 3d 22 22 0d 0c b2 04  |....]....=""....|
00001b90  0d 0c bc 40 dd f2 65 6e  63 6f 64 65 5f 63 6f 64  |...@..encode_cod|
00001ba0  65 3a 20 f4 20 72 2f 67  2f 62 20 65 6e 63 6f 64  |e: . r/g/b encod|
00001bb0  69 6e 67 20 72 6f 75 74  69 6e 65 20 28 31 32 20  |ing routine (12 |
00001bc0  70 69 78 65 6c 73 20 70  65 72 20 6c 6f 6f 70 29  |pixels per loop)|
00001bd0  0d 0c c6 04 0d 0c d0 20  54 6d 70 31 20 3d 20 30  |....... Tmp1 = 0|
00001be0  3a 20 54 6d 70 32 20 3d  20 30 3a 20 54 6d 70 33  |: Tmp2 = 0: Tmp3|
00001bf0  20 3d 20 30 0d 0c da 20  54 61 63 31 20 3d 20 30  | = 0... Tac1 = 0|
00001c00  3a 20 54 61 63 32 20 3d  20 31 3a 20 54 61 63 33  |: Tac2 = 1: Tac3|
00001c10  20 3d 20 32 0d 0c e4 20  50 69 78 31 20 3d 20 33  | = 2... Pix1 = 3|
00001c20  3a 20 50 69 78 32 20 3d  20 34 3a 20 50 69 78 33  |: Pix2 = 4: Pix3|
00001c30  20 3d 20 35 0d 0c ee 20  47 72 65 31 20 3d 20 36  | = 5... Gre1 = 6|
00001c40  3a 20 47 72 65 32 20 3d  20 37 3a 20 47 72 65 33  |: Gre2 = 7: Gre3|
00001c50  20 3d 20 38 0d 0c f8 20  42 6c 75 31 20 3d 20 36  | = 8... Blu1 = 6|
00001c60  3a 20 42 6c 75 32 20 3d  20 37 3a 20 42 6c 75 33  |: Blu2 = 7: Blu3|
00001c70  20 3d 20 38 0d 0d 02 20  43 6e 74 20 20 3d 20 39  | = 8... Cnt  = 9|
00001c80  3a 20 50 74 72 20 20 3d  31 30 3a 20 4f 66 66 20  |: Ptr  =10: Off |
00001c90  20 3d 31 31 0d 0d 0c 20  4d 73 6b 31 20 3d 31 32  | =11... Msk1 =12|
00001ca0  3a 20 4d 73 6b 33 20 3d  31 33 3a 20 4d 73 6b 42  |: Msk3 =13: MskB|
00001cb0  20 3d 31 34 0d 0d 16 04  0d 0d 20 10 5b 4f 50 54  | =14...... .[OPT|
00001cc0  20 20 20 20 70 61 73 73  0d 0d 2a 04 0d 0d 34 0c  |    pass..*...4.|
00001cd0  20 2e 65 6e 63 6f 64 65  0d 0d 3e 17 20 41 44 52  | .encode..>. ADR|
00001ce0  20 20 20 20 72 30 2c 20  65 5f 73 74 61 63 6b 0d  |    r0, e_stack.|
00001cf0  0d 48 1b 20 53 54 4d 49  41 20 20 72 30 21 2c 20  |.H. STMIA  r0!, |
00001d00  7b 72 31 33 2c 20 72 31  34 7d 0d 0d 52 31 20 4c  |{r13, r14}..R1 L|
00001d10  44 4d 49 41 20 20 72 30  2c 20 7b 43 6e 74 2c 20  |DMIA  r0, {Cnt, |
00001d20  50 74 72 2c 20 4f 66 66  2c 20 4d 73 6b 31 2c 20  |Ptr, Off, Msk1, |
00001d30  4d 73 6b 33 2c 20 4d 73  6b 42 7d 0d 0d 5c 05 20  |Msk3, MskB}..\. |
00001d40  0d 0d 66 0c 20 2e 65 5f  6c 6f 6f 70 0d 0d 70 27  |..f. .e_loop..p'|
00001d50  20 41 44 44 20 20 20 20  50 74 72 2c 20 50 74 72  | ADD    Ptr, Ptr|
00001d60  2c 20 4f 66 66 3b 20 67  65 74 20 72 65 64 20 70  |, Off; get red p|
00001d70  74 72 2e 0d 0d 7a 46 20  4c 44 4d 49 41 20 20 50  |tr...zF LDMIA  P|
00001d80  74 72 2c 20 7b 54 61 63  31 2c 20 54 61 63 32 2c  |tr, {Tac1, Tac2,|
00001d90  20 54 61 63 33 7d 20 20  20 20 20 20 3b 20 67 65  | Tac3}      ; ge|
00001da0  74 20 72 65 64 20 69 6e  20 74 69 6e 74 20 61 63  |t red in tint ac|
00001db0  63 75 6d 75 6c 61 74 6f  72 0d 0d 84 3d 20 41 44  |cumulator...= AD|
00001dc0  44 20 20 20 20 50 69 78  31 2c 20 54 61 63 31 2c  |D    Pix1, Tac1,|
00001dd0  20 4d 73 6b 31 2c 20 4c  53 4c 20 23 33 20 20 20  | Msk1, LSL #3   |
00001de0  20 20 3b 20 74 72 61 6e  73 66 6f 72 6d 20 72 65  |  ; transform re|
00001df0  64 20 62 69 74 73 0d 0d  8e 36 20 42 49 43 20 20  |d bits...6 BIC  |
00001e00  20 20 50 69 78 31 2c 20  50 69 78 31 2c 20 4d 73  |  Pix1, Pix1, Ms|
00001e10  6b 42 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |kB             ;|
00001e20  20 72 65 64 20 65 6e 63  6f 64 65 64 0d 0d 98 3d  | red encoded...=|
00001e30  20 41 44 44 20 20 20 20  50 69 78 32 2c 20 54 61  | ADD    Pix2, Ta|
00001e40  63 32 2c 20 4d 73 6b 31  2c 20 4c 53 4c 20 23 33  |c2, Msk1, LSL #3|
00001e50  20 20 20 20 20 3b 20 74  72 61 6e 73 66 6f 72 6d  |     ; transform|
00001e60  20 72 65 64 20 62 69 74  73 0d 0d a2 36 20 42 49  | red bits...6 BI|
00001e70  43 20 20 20 20 50 69 78  32 2c 20 50 69 78 32 2c  |C    Pix2, Pix2,|
00001e80  20 4d 73 6b 42 20 20 20  20 20 20 20 20 20 20 20  | MskB           |
00001e90  20 20 3b 20 72 65 64 20  65 6e 63 6f 64 65 64 0d  |  ; red encoded.|
00001ea0  0d ac 3d 20 41 44 44 20  20 20 20 50 69 78 33 2c  |..= ADD    Pix3,|
00001eb0  20 54 61 63 33 2c 20 4d  73 6b 31 2c 20 4c 53 4c  | Tac3, Msk1, LSL|
00001ec0  20 23 33 20 20 20 20 20  3b 20 74 72 61 6e 73 66  | #3     ; transf|
00001ed0  6f 72 6d 20 72 65 64 20  62 69 74 73 0d 0d b6 36  |orm red bits...6|
00001ee0  20 42 49 43 20 20 20 20  50 69 78 33 2c 20 50 69  | BIC    Pix3, Pi|
00001ef0  78 33 2c 20 4d 73 6b 42  20 20 20 20 20 20 20 20  |x3, MskB        |
00001f00  20 20 20 20 20 3b 20 72  65 64 20 65 6e 63 6f 64  |     ; red encod|
00001f10  65 64 0d 0d c0 3a 20 42  49 43 20 20 20 20 54 61  |ed...: BIC    Ta|
00001f20  63 31 2c 20 54 61 63 31  2c 20 4d 73 6b 33 2c 20  |c1, Tac1, Msk3, |
00001f30  4c 53 4c 20 23 32 20 20  20 20 20 3b 20 74 69 6e  |LSL #2     ; tin|
00001f40  74 20 63 6f 72 72 65 63  74 69 6f 6e 0d 0d ca 24  |t correction...$|
00001f50  20 42 49 43 20 20 20 20  54 61 63 32 2c 20 54 61  | BIC    Tac2, Ta|
00001f60  63 32 2c 20 4d 73 6b 33  2c 20 4c 53 4c 20 23 32  |c2, Msk3, LSL #2|
00001f70  0d 0d d4 24 20 42 49 43  20 20 20 20 54 61 63 33  |...$ BIC    Tac3|
00001f80  2c 20 54 61 63 33 2c 20  4d 73 6b 33 2c 20 4c 53  |, Tac3, Msk3, LS|
00001f90  4c 20 23 32 0d 0d de 3c  20 41 44 44 20 20 20 20  |L #2...< ADD    |
00001fa0  50 74 72 2c 20 50 74 72  2c 20 4f 66 66 20 20 20  |Ptr, Ptr, Off   |
00001fb0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 67  |             ; g|
00001fc0  65 74 20 67 72 65 65 6e  20 70 6f 69 6e 74 65 72  |et green pointer|
00001fd0  0d 0d e8 3b 20 4c 44 4d  49 41 20 20 50 74 72 2c  |...; LDMIA  Ptr,|
00001fe0  20 7b 47 72 65 31 2c 20  47 72 65 32 2c 20 47 72  | {Gre1, Gre2, Gr|
00001ff0  65 33 7d 20 20 20 20 20  20 3b 20 67 65 74 20 67  |e3}      ; get g|
00002000  72 65 65 6e 20 69 6e 20  47 72 65 0d 0d f2 3b 20  |reen in Gre...; |
00002010  41 44 44 53 20 20 20 54  61 63 31 2c 20 54 61 63  |ADDS   Tac1, Tac|
00002020  31 2c 20 47 72 65 31 2c  20 4c 53 4c 20 23 31 20  |1, Gre1, LSL #1 |
00002030  20 20 20 20 3b 20 74 69  6e 74 20 61 63 63 75 6d  |    ; tint accum|
00002040  75 6c 61 74 6f 72 0d 0d  fc 37 20 80 4e 45 53 20  |ulator...7 .NES |
00002050  47 72 65 31 2c 20 47 72  65 31 2c 20 4d 73 6b 33  |Gre1, Gre1, Msk3|
00002060  2c 20 4c 53 4c 20 23 32  20 20 20 20 20 3b 20 67  |, LSL #2     ; g|
00002070  65 74 20 67 72 65 65 6e  20 62 69 74 73 0d 0e 06  |et green bits...|
00002080  3a 20 53 55 42 4e 45 20  20 54 61 63 31 2c 20 54  |: SUBNE  Tac1, T|
00002090  61 63 31 2c 20 47 72 65  31 2c 20 4c 53 4c 20 23  |ac1, Gre1, LSL #|
000020a0  31 20 20 20 20 20 3b 20  74 69 6e 74 20 63 6f 72  |1     ; tint cor|
000020b0  72 65 63 74 69 6f 6e 0d  0e 10 37 20 84 52 4e 45  |rection...7 .RNE|
000020c0  20 20 50 69 78 31 2c 20  50 69 78 31 2c 20 47 72  |  Pix1, Pix1, Gr|
000020d0  65 31 2c 20 4c 53 4c 20  23 33 20 20 20 20 20 3b  |e1, LSL #3     ;|
000020e0  20 67 72 65 65 6e 20 65  6e 63 6f 64 65 64 0d 0e  | green encoded..|
000020f0  1a 3b 20 41 44 44 53 20  20 20 54 61 63 32 2c 20  |.; ADDS   Tac2, |
00002100  54 61 63 32 2c 20 47 72  65 32 2c 20 4c 53 4c 20  |Tac2, Gre2, LSL |
00002110  23 31 20 20 20 20 20 3b  20 74 69 6e 74 20 61 63  |#1     ; tint ac|
00002120  63 75 6d 75 6c 61 74 6f  72 0d 0e 24 37 20 80 4e  |cumulator..$7 .N|
00002130  45 53 20 47 72 65 32 2c  20 47 72 65 32 2c 20 4d  |ES Gre2, Gre2, M|
00002140  73 6b 33 2c 20 4c 53 4c  20 23 32 20 20 20 20 20  |sk3, LSL #2     |
00002150  3b 20 67 65 74 20 67 72  65 65 6e 20 62 69 74 73  |; get green bits|
00002160  0d 0e 2e 3a 20 53 55 42  4e 45 20 20 54 61 63 32  |...: SUBNE  Tac2|
00002170  2c 20 54 61 63 32 2c 20  47 72 65 32 2c 20 4c 53  |, Tac2, Gre2, LS|
00002180  4c 20 23 31 20 20 20 20  20 3b 20 74 69 6e 74 20  |L #1     ; tint |
00002190  63 6f 72 72 65 63 74 69  6f 6e 0d 0e 38 37 20 84  |correction..87 .|
000021a0  52 4e 45 20 20 50 69 78  32 2c 20 50 69 78 32 2c  |RNE  Pix2, Pix2,|
000021b0  20 47 72 65 32 2c 20 4c  53 4c 20 23 33 20 20 20  | Gre2, LSL #3   |
000021c0  20 20 3b 20 67 72 65 65  6e 20 65 6e 63 6f 64 65  |  ; green encode|
000021d0  64 0d 0e 42 3b 20 41 44  44 53 20 20 20 54 61 63  |d..B; ADDS   Tac|
000021e0  33 2c 20 54 61 63 33 2c  20 47 72 65 33 2c 20 4c  |3, Tac3, Gre3, L|
000021f0  53 4c 20 23 31 20 20 20  20 20 3b 20 74 69 6e 74  |SL #1     ; tint|
00002200  20 61 63 63 75 6d 75 6c  61 74 6f 72 0d 0e 4c 37  | accumulator..L7|
00002210  20 80 4e 45 53 20 47 72  65 33 2c 20 47 72 65 33  | .NES Gre3, Gre3|
00002220  2c 20 4d 73 6b 33 2c 20  4c 53 4c 20 23 32 20 20  |, Msk3, LSL #2  |
00002230  20 20 20 3b 20 67 65 74  20 67 72 65 65 6e 20 62  |   ; get green b|
00002240  69 74 73 0d 0e 56 3a 20  53 55 42 4e 45 20 20 54  |its..V: SUBNE  T|
00002250  61 63 33 2c 20 54 61 63  33 2c 20 47 72 65 33 2c  |ac3, Tac3, Gre3,|
00002260  20 4c 53 4c 20 23 31 20  20 20 20 20 3b 20 74 69  | LSL #1     ; ti|
00002270  6e 74 20 63 6f 72 72 65  63 74 69 6f 6e 0d 0e 60  |nt correction..`|
00002280  37 20 84 52 4e 45 20 20  50 69 78 33 2c 20 50 69  |7 .RNE  Pix3, Pi|
00002290  78 33 2c 20 47 72 65 33  2c 20 4c 53 4c 20 23 33  |x3, Gre3, LSL #3|
000022a0  20 20 20 20 20 3b 20 67  72 65 65 6e 20 65 6e 63  |     ; green enc|
000022b0  6f 64 65 64 0d 0e 6a 3b  20 41 44 44 20 20 20 20  |oded..j; ADD    |
000022c0  50 74 72 2c 20 50 74 72  2c 20 4f 66 66 20 20 20  |Ptr, Ptr, Off   |
000022d0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 67  |             ; g|
000022e0  65 74 20 62 6c 75 65 20  70 6f 69 6e 74 65 72 0d  |et blue pointer.|
000022f0  0e 74 3a 20 4c 44 4d 49  41 20 20 50 74 72 2c 20  |.t: LDMIA  Ptr, |
00002300  7b 42 6c 75 31 2c 20 42  6c 75 32 2c 20 42 6c 75  |{Blu1, Blu2, Blu|
00002310  33 7d 20 20 20 20 20 20  3b 20 67 65 74 20 62 6c  |3}      ; get bl|
00002320  75 65 20 69 6e 20 42 6c  75 0d 0e 7e 3b 20 41 44  |ue in Blu..~; AD|
00002330  44 53 20 20 20 54 61 63  31 2c 20 54 61 63 31 2c  |DS   Tac1, Tac1,|
00002340  20 42 6c 75 31 20 20 20  20 20 20 20 20 20 20 20  | Blu1           |
00002350  20 20 3b 20 74 69 6e 74  20 61 63 63 75 6d 75 6c  |  ; tint accumul|
00002360  61 74 6f 72 0d 0e 88 3e  20 42 49 43 4e 45 20 20  |ator...> BICNE  |
00002370  42 6c 75 31 2c 20 42 6c  75 31 2c 20 4d 73 6b 33  |Blu1, Blu1, Msk3|
00002380  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 63  |             ; c|
00002390  6c 65 61 72 20 74 69 6e  74 73 20 69 6e 20 62 6c  |lear tints in bl|
000023a0  75 65 0d 0e 92 40 20 53  55 42 4e 45 53 20 54 61  |ue...@ SUBNES Ta|
000023b0  63 31 2c 20 54 61 63 31  2c 20 42 6c 75 31 20 20  |c1, Tac1, Blu1  |
000023c0  20 20 20 20 20 20 20 20  20 20 20 3b 20 63 6c 65  |           ; cle|
000023d0  61 72 20 62 6c 75 65 20  66 72 6f 6d 20 74 69 6e  |ar blue from tin|
000023e0  74 73 0d 0e 9c 3a 20 80  4e 45 20 20 54 61 63 31  |ts...: .NE  Tac1|
000023f0  2c 20 4d 73 6b 33 2c 20  54 61 63 31 2c 20 4c 53  |, Msk3, Tac1, LS|
00002400  52 20 23 32 20 20 20 20  20 3b 20 67 65 74 20 61  |R #2     ; get a|
00002410  76 65 72 61 67 65 20 74  69 6e 74 73 0d 0e a6 4c  |verage tints...L|
00002420  20 84 52 4e 45 20 20 50  69 78 31 2c 20 50 69 78  | .RNE  Pix1, Pix|
00002430  31 2c 20 54 61 63 31 20  20 20 20 20 20 20 20 20  |1, Tac1         |
00002440  20 20 20 20 3b 20 73 74  6f 72 65 20 74 69 6e 74  |    ; store tint|
00002450  73 20 28 6e 6f 77 20 68  61 76 65 20 61 20 66 72  |s (now have a fr|
00002460  65 65 20 72 65 67 2e 29  0d 0e b0 37 20 80 53 20  |ee reg.)...7 .S |
00002470  20 20 54 6d 70 31 2c 20  42 6c 75 31 2c 20 4d 73  |  Tmp1, Blu1, Ms|
00002480  6b 31 2c 20 4c 53 4c 20  23 32 20 20 20 20 20 3b  |k1, LSL #2     ;|
00002490  20 67 65 74 20 62 6c 75  65 20 62 69 74 20 32 0d  | get blue bit 2.|
000024a0  0e ba 3a 20 84 52 4e 45  20 20 50 69 78 31 2c 20  |..: .RNE  Pix1, |
000024b0  50 69 78 31 2c 20 54 6d  70 31 2c 20 4c 53 4c 20  |Pix1, Tmp1, LSL |
000024c0  23 31 20 20 20 20 20 3b  20 73 74 6f 72 65 20 62  |#1     ; store b|
000024d0  6c 75 65 20 62 69 74 20  32 0d 0e c4 37 20 80 53  |lue bit 2...7 .S|
000024e0  20 20 20 54 6d 70 32 2c  20 42 6c 75 32 2c 20 4d  |   Tmp2, Blu2, M|
000024f0  73 6b 31 2c 20 4c 53 4c  20 23 32 20 20 20 20 20  |sk1, LSL #2     |
00002500  3b 20 67 65 74 20 62 6c  75 65 20 62 69 74 20 32  |; get blue bit 2|
00002510  0d 0e ce 3a 20 84 52 4e  45 20 20 50 69 78 32 2c  |...: .RNE  Pix2,|
00002520  20 50 69 78 32 2c 20 54  6d 70 32 2c 20 4c 53 4c  | Pix2, Tmp2, LSL|
00002530  20 23 31 20 20 20 20 20  3b 20 73 74 6f 72 65 20  | #1     ; store |
00002540  62 6c 75 65 20 62 69 74  20 32 0d 0e d8 37 20 80  |blue bit 2...7 .|
00002550  53 20 20 20 54 6d 70 33  2c 20 42 6c 75 33 2c 20  |S   Tmp3, Blu3, |
00002560  4d 73 6b 31 2c 20 4c 53  4c 20 23 32 20 20 20 20  |Msk1, LSL #2    |
00002570  20 3b 20 67 65 74 20 62  6c 75 65 20 62 69 74 20  | ; get blue bit |
00002580  32 0d 0e e2 3a 20 84 52  4e 45 20 20 50 69 78 33  |2...: .RNE  Pix3|
00002590  2c 20 50 69 78 33 2c 20  54 6d 70 33 2c 20 4c 53  |, Pix3, Tmp3, LS|
000025a0  4c 20 23 31 20 20 20 20  20 3b 20 73 74 6f 72 65  |L #1     ; store|
000025b0  20 62 6c 75 65 20 62 69  74 20 32 0d 0e ec 37 20  | blue bit 2...7 |
000025c0  80 53 20 20 20 54 6d 70  31 2c 20 42 6c 75 31 2c  |.S   Tmp1, Blu1,|
000025d0  20 4d 73 6b 31 2c 20 4c  53 4c 20 23 33 20 20 20  | Msk1, LSL #3   |
000025e0  20 20 3b 20 67 65 74 20  62 6c 75 65 20 62 69 74  |  ; get blue bit|
000025f0  20 33 0d 0e f6 35 20 84  52 4e 45 20 20 50 69 78  | 3...5 .RNE  Pix|
00002600  31 2c 20 50 69 78 31 2c  20 54 6d 70 31 2c 20 4c  |1, Pix1, Tmp1, L|
00002610  53 4c 20 23 34 20 20 20  20 20 3b 20 61 6c 6c 20  |SL #4     ; all |
00002620  65 6e 63 6f 64 65 64 0d  0f 00 37 20 80 53 20 20  |encoded...7 .S  |
00002630  20 54 6d 70 32 2c 20 42  6c 75 32 2c 20 4d 73 6b  | Tmp2, Blu2, Msk|
00002640  31 2c 20 4c 53 4c 20 23  33 20 20 20 20 20 3b 20  |1, LSL #3     ; |
00002650  67 65 74 20 62 6c 75 65  20 62 69 74 20 33 0d 0f  |get blue bit 3..|
00002660  0a 35 20 84 52 4e 45 20  20 50 69 78 32 2c 20 50  |.5 .RNE  Pix2, P|
00002670  69 78 32 2c 20 54 6d 70  32 2c 20 4c 53 4c 20 23  |ix2, Tmp2, LSL #|
00002680  34 20 20 20 20 20 3b 20  61 6c 6c 20 65 6e 63 6f  |4     ; all enco|
00002690  64 65 64 0d 0f 14 37 20  80 53 20 20 20 54 6d 70  |ded...7 .S   Tmp|
000026a0  33 2c 20 42 6c 75 33 2c  20 4d 73 6b 31 2c 20 4c  |3, Blu3, Msk1, L|
000026b0  53 4c 20 23 33 20 20 20  20 20 3b 20 67 65 74 20  |SL #3     ; get |
000026c0  62 6c 75 65 20 62 69 74  20 33 0d 0f 1e 35 20 84  |blue bit 3...5 .|
000026d0  52 4e 45 20 20 50 69 78  33 2c 20 50 69 78 33 2c  |RNE  Pix3, Pix3,|
000026e0  20 54 6d 70 33 2c 20 4c  53 4c 20 23 34 20 20 20  | Tmp3, LSL #4   |
000026f0  20 20 3b 20 61 6c 6c 20  65 6e 63 6f 64 65 64 0d  |  ; all encoded.|
00002700  0f 28 3d 20 80 53 20 20  20 42 6c 75 32 2c 20 4d  |.(= .S   Blu2, M|
00002710  73 6b 33 2c 20 42 6c 75  32 20 20 20 20 20 20 20  |sk3, Blu2       |
00002720  20 20 20 20 20 20 3b 20  67 65 74 20 6f 74 68 65  |      ; get othe|
00002730  72 20 62 6c 75 65 20 74  69 6e 74 73 0d 0f 32 3b  |r blue tints..2;|
00002740  20 41 44 44 4e 45 20 20  54 61 63 32 2c 20 54 61  | ADDNE  Tac2, Ta|
00002750  63 32 2c 20 42 6c 75 32  20 20 20 20 20 20 20 20  |c2, Blu2        |
00002760  20 20 20 20 20 3b 20 74  69 6e 74 20 61 63 63 75  |     ; tint accu|
00002770  6d 75 6c 61 74 6f 72 0d  0f 3c 39 20 80 53 20 20  |mulator..<9 .S  |
00002780  20 54 61 63 32 2c 20 4d  73 6b 33 2c 20 54 61 63  | Tac2, Msk3, Tac|
00002790  32 2c 20 4c 53 52 20 23  32 20 20 20 20 20 3b 20  |2, LSR #2     ; |
000027a0  67 65 74 20 61 76 65 72  61 67 65 20 74 69 6e 74  |get average tint|
000027b0  0d 0f 46 37 20 84 52 4e  45 20 20 50 69 78 32 2c  |..F7 .RNE  Pix2,|
000027c0  20 50 69 78 32 2c 20 54  61 63 32 20 20 20 20 20  | Pix2, Tac2     |
000027d0  20 20 20 20 20 20 20 20  3b 20 74 69 6e 74 73 20  |        ; tints |
000027e0  65 6e 63 6f 64 65 64 0d  0f 50 3d 20 80 53 20 20  |encoded..P= .S  |
000027f0  20 42 6c 75 33 2c 20 4d  73 6b 33 2c 20 42 6c 75  | Blu3, Msk3, Blu|
00002800  33 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |3             ; |
00002810  67 65 74 20 6f 74 68 65  72 20 62 6c 75 65 20 74  |get other blue t|
00002820  69 6e 74 73 0d 0f 5a 3b  20 41 44 44 4e 45 20 20  |ints..Z; ADDNE  |
00002830  54 61 63 33 2c 20 54 61  63 33 2c 20 42 6c 75 33  |Tac3, Tac3, Blu3|
00002840  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 74  |             ; t|
00002850  69 6e 74 20 61 63 63 75  6d 75 6c 61 74 6f 72 0d  |int accumulator.|
00002860  0f 64 39 20 80 53 20 20  20 54 61 63 33 2c 20 4d  |.d9 .S   Tac3, M|
00002870  73 6b 33 2c 20 54 61 63  33 2c 20 4c 53 52 20 23  |sk3, Tac3, LSR #|
00002880  32 20 20 20 20 20 3b 20  67 65 74 20 61 76 65 72  |2     ; get aver|
00002890  61 67 65 20 74 69 6e 74  0d 0f 6e 35 20 84 52 4e  |age tint..n5 .RN|
000028a0  45 20 20 50 69 78 33 2c  20 50 69 78 33 2c 20 54  |E  Pix3, Pix3, T|
000028b0  61 63 33 20 20 20 20 20  20 20 20 20 20 20 20 20  |ac3             |
000028c0  3b 20 61 6c 6c 20 65 6e  63 6f 64 65 64 0d 0f 78  |; all encoded..x|
000028d0  3a 20 53 55 42 20 20 20  20 50 74 72 2c 20 50 74  |: SUB    Ptr, Pt|
000028e0  72 2c 20 4f 66 66 2c 20  4c 53 4c 20 23 31 20 20  |r, Off, LSL #1  |
000028f0  20 20 20 20 20 20 3b 20  63 6f 72 72 65 63 74 20  |      ; correct |
00002900  70 6f 69 6e 74 65 72 0d  0f 82 19 20 53 55 42 20  |pointer.... SUB |
00002910  20 20 20 50 74 72 2c 20  50 74 72 2c 20 4f 66 66  |   Ptr, Ptr, Off|
00002920  0d 0f 8c 37 20 53 54 4d  49 41 20 20 28 50 74 72  |...7 STMIA  (Ptr|
00002930  29 21 2c 20 7b 50 69 78  31 2c 20 50 69 78 32 2c  |)!, {Pix1, Pix2,|
00002940  20 50 69 78 33 7d 20 20  20 3b 20 77 72 69 74 65  | Pix3}   ; write|
00002950  20 70 69 78 65 6c 73 0d  0f 96 18 20 53 55 42 53  | pixels.... SUBS|
00002960  20 20 20 43 6e 74 2c 20  43 6e 74 2c 20 23 31 0d  |   Cnt, Cnt, #1.|
00002970  0f a0 12 20 42 50 4c 20  20 20 20 65 5f 6c 6f 6f  |... BPL    e_loo|
00002980  70 0d 0f aa 17 20 41 44  52 20 20 20 20 72 30 2c  |p.... ADR    r0,|
00002990  20 65 5f 73 74 61 63 6b  0d 0f b4 19 20 4c 44 4d  | e_stack.... LDM|
000029a0  49 41 20 20 72 30 2c 20  7b 72 31 33 2c 20 50 43  |IA  r0, {r13, PC|
000029b0  7d 0d 0f be 05 20 0d 0f  c8 1c 20 2e 65 5f 73 74  |}.... .... .e_st|
000029c0  61 63 6b 20 45 51 55 44  20 30 3a 20 45 51 55 44  |ack EQUD 0: EQUD|
000029d0  20 30 0d 0f d2 24 20 2e  65 5f 63 6f 75 6e 74 20  | 0...$ .e_count |
000029e0  45 51 55 44 20 28 77 69  25 2a 68 69 25 29 2f 28  |EQUD (wi%*hi%)/(|
000029f0  34 2a 33 29 2d 31 0d 0f  dc 18 20 2e 65 5f 70 6f  |4*3)-1.... .e_po|
00002a00  69 6e 74 20 45 51 55 44  20 69 6d 61 67 25 0d 0f  |int EQUD imag%..|
00002a10  e6 1a 20 2e 65 5f 6f 66  66 73 74 20 45 51 55 44  |.. .e_offst EQUD|
00002a20  20 77 69 25 2a 68 69 25  0d 0f f0 3c 20 2e 65 5f  | wi%*hi%...< .e_|
00002a30  6d 61 73 6b 73 20 45 51  55 44 20 26 30 31 30 31  |masks EQUD &0101|
00002a40  30 31 30 31 3a 20 45 51  55 44 20 26 30 33 30 33  |0101: EQUD &0303|
00002a50  30 33 30 33 3a 20 45 51  55 44 20 26 30 42 30 42  |0303: EQUD &0B0B|
00002a60  30 42 30 42 0d 0f fa 05  5d 0d 10 04 05 e1 0d ff  |0B0B....].......|
00002a70