Home » Archimedes archive » Acorn User » AU 1996-Xmas.adf » Regulars » StarInfo/Docking/!TexCube/!RunImage

StarInfo/Docking/!TexCube/!RunImage

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-Xmas.adf » Regulars
Filename: StarInfo/Docking/!TexCube/!RunImage
Read OK:
File size: 9D60 bytes
Load address: 0000
Exec address: 0000
File contents
  ��0O�����0�0� R��(�O��*�`�

)� Perpetual Motion  -  !RunImage file
� � Andrew Docking 1996

(
2Y� ------------------------- WHEN THINGS GO WRONG HANDLING CODE ----------------------
<`� � ș "Hourglass_Smash" : � 0 : � 0,(�$+" (internal error code "+�(�)+" at line "+�(�)+")")
F
P� "� Andrew Docking 1996"
Z� "Texture mapped cube."
d
n
x
�S� --------------------------- SETUP PROCEDURES --------------------------------
�
��setup_reference_lists
��initialise_edge_tables
��setup_textures
�
�S� --------------------------- 3D OBJECT SETUP PROCEDURES ----------------------
�
��setup_3d_crafts
�
�
�S� --------------------------- COMPILE MAIN CODE -------------------------------
��assemble_screen_handlers
�assemble_poly_renderers
�assemble_3d_handlers

"
,S� --------------------------- INITIALISE UNIVERSAL STACK ----------------------
6� init_stack
@
J
TS� --------------------------- SETUP GAME SCREEN -------------------------------
^�15
h�13
r�
|
�	zd%=1
�	ys%=0
�	kj%=1
�
��
��=0
�ȗ mx,my,b
�� screen_swap
�
� clr_scr
�
�aa%=!(craft_header_list%)
�
�
� zd%=1 : aa%!8+=2
� zd%=0 : aa%!8-=2
� !(aa%+8)>900 : zd%=0
&� !(aa%+8)<260 : zd%=1
0
:� kj% = 1 : ys%+=1
Dkj% = 3 - kj%
Naa%!4+=ys%
X
aa%!36+=2
b
aa%!40-=3
l
v,� !(aa%+4)>200 ys%=ys%*-1 : !(aa%+4)=200
�
�
�
�
�A%=0
�� craft_movement_handler
�� project_craft
��0
�
�
�
�
��



 _� ------------------------------------ SCREEN HANDLING CODE -------------------------------
*
4� �assemble_screen_handlers
>
H� pass%,link,sp,stack%
R
\len%=16384
f
plink=14
z	sp=11
�
�� stack% 8192
�� code% len%
�
�
�
�� pass%=8 � 10 � 2
�
P%= code%
�L%= code% + len%
�[ OPT pass%
�
� .screen_adr%          EQUD 0
�%.stack_base%          EQUD stack%


.init_stack
$LDR     sp,stack_base%
.MOV     PC,link
8
B
L.bank%     EQUD   1
VI.vduin%    EQUD   148            ; for use with "OS_ReadVduVariables"
`           EQUD   -1
j7.vduout%   EQUD   0                ; screen address
t
~
�.screen_swap
�&STMFA      (sp)!,{r0-r10,r12,link}
�:MOV        r0,#19               ; wait for vsync event
�SWI        "OS_Byte"
�
�3LDR        r4,bank%             ; load bank no.
�4RSB        r4,r4,#3             ; bank = 3 -bank
�4STR        r4,bank%             ; store bank no.
�
�MOV        r0,#112
�MOV        r1,r4
�SWI        "OS_Byte"
MOV        r0,#113

RSB        r1,r4,#3
SWI        "OS_Byte"

(?ADR        r0,vduin%            ; get new screen adr in r12
2ADR        r1,vduout%
<$SWI        "OS_ReadVduVariables"
FLDR        r12,vduout%
PSTR        r12,screen_adr%
Z&LDMFA      (sp)!,{r0-r10,r12,link}
dMOV        PC,link
n
x
�.clr_scr
�&STMFA      (sp)!,{r0-r10,r12,link}
�LDR        r12,screen_adr%
�MOV        r9,#256
�
�MOV        r0,#0
�MOV        r1,r0
�MOV        r2,r0
�MOV        r3,r0
�MOV        r4,r0
�MOV        r5,r0
�MOV        r6,r0
�MOV        r7,r0

.clrscr_loop
]
"� I%=1 � 10
,[ OPT pass%
6STMIA      r12!,{r0-r7}
@]
J�
T
^[ OPT pass%
hSUBS       r9,r9,#1
rBGT        clrscr_loop
|
�&LDMFA      (sp)!,{r0-r10,r12,link}
�
�(MOV        PC,link    ; exit routine
�
�
�
�
�[; ----------------------------------- Rendering routines ------------------------------
�
�
�
�
�


.plot_dot

; r6 is x
&
; r7 is y
0*STMFA          (sp)!,{r0-r10,r12,link}
:"LDR            r12,screen_adr%
DADD            r12,r12,r6
N
XMOV            r2,r7,ASL#8
bMOV            r3,r7,ASL#6
lADD            r2,r2,r3
vADD            r12,r12,r2
�
�MOV            r10,#255
�STRB           r10,[r12]
�
�*LDMFA          (sp)!,{r0-r10,r12,link}
�MOV            PC,link
�
�5.swm_rdiv_list_base%          EQUD swm_rdiv_list%
�
�
�
�
�
.tex_scan_line
 ; r0 is x coord of scan line
; r1 is y coord
 ; r2 is length
*; r3 is start u
4; r4 is start v * 256
>; r5 is end u
H; r6 is end v * 256
R
\*STMFA          (sp)!,{r0-r10,r12,link}
f"LDR            r12,screen_adr%
p2ADD            r12,r12,r0                ; + x
z6MOV            r7,r1,ASL#8               ; y * 256
�5MOV            r8,r1,ASL#6               ; y * 64
�GADD            r7,r7,r8                  ; (y*64) + (y*256) = y*320
�MADD            r12,r12,r7                ; r12 is final adr of line start
�
�-LDR            r9,polygon_workspace_base%
�>LDR            r10,[r9,#36]              ; base of texture
�:LDR            r0,[r9,#32]               ; render type
�$ADD            r10,r10,r0,ASL#10
�
�<SUB            r5,r5,r3                  ; r5 is x2 - x1
�CMOV            r3,r3,ASL#8              ; r3 is scaled up x pos
�E�swm_rdiv_sca8(5,2,7)                         ; r7 is x step size
�
	<SUB            r6,r6,r4                  ; r6 is y2 - y1
	CMOV            r4,r4,ASL#8               ; r4 is scale up y pos
	E�swm_rdiv_sca8(6,2,8)                         ; r8 is y step size
	$
	.
	8
	B.tex_scan_line_loop
	LMOV            r0,r3,ASR#16
	VMOV            r1,r4,ASR#16
	` �R            r0,r0,r1,LSL#5
	j
	tLDRB           r9,[r10,r0]
	~STRB           r9,[r12],#1
	�
	�
	�?ADD            r3,r3,r7                ; scaled x += x step
	�?ADD            r4,r4,r8                ; scaled y += y step
	�
	�SUBS           r2,r2,#1
	�%BGT            tex_scan_line_loop
	�
	�.end_tex_scan_line
	�*LDMFA          (sp)!,{r0-r10,r12,link}
	�MOV            PC,link
	�



7.polygon_workspace_base%    EQUD polygon_workspace%
.polygon_workspace%
(EQUD 20             ; p0
2EQUD 30
<
FEQUD 0            ; p1
PEQUD 180
Z
dEQUD 120            ; p2
nEQUD 220
x
�EQUD 90             ; p3
�EQUD 20
�
�$EQUD 0             ; render type
�)EQUD textures%     ; base of textures
�
�EQUD lhs_list%
�EQUD rhs_list%
�
�
�S; ----------------------- global list addresses -------------------------------
�
�8.swm_rdiv_list_base%             EQUD swm_rdiv_list%



"
,]
6� pass%
@
J�
T
^
h
rW� --------------------------- 3d object handlers ----------------------------------
|
���assemble_3d_handlers
�
�� adr%,pass%,link,sp
�
�link=14
�	sp=11
�
�"� continues on in code% memory
�
�adr%=P%
�
�
�
� pass%=8 � 10 � 2

P%=adr%
&L%=code% + len%
0
:[ OPT pass%
D
N]; Addresses already used ( in front of code so it it uses these instead of the previous )
X
b9.polygon_workspace_base%      EQUD polygon_workspace%
l5.swm_rdiv_list_base%          EQUD swm_rdiv_list%
v
�
�2.sine_table_base%             EQUD sine_table%
�4.cosine_table_base%           EQUD cosine_table%
�9.craft_header_list_base%      EQUD craft_header_list%
�
�*.screen_x_origin%             EQUD 160
�*.screen_y_origin%             EQUD 128
�
�
�
� ; r0 is craft no. to project
�.project_craft
�/STMFA               (sp)!,{r0-r10,r12,link}



;; rotate original data around z and put into trans data



 3LDR                 r10,craft_header_list_base%

*SLDR                 r12,[r10,r0,ASL#2]          ; r10 is header of craft no. r0

4SLDR                 r10,[r12,#52]               ; r10 is no. of points in craft

>

HMLDR                 r8,[r12,#60]                ; r8 is base of orig data

RNLDR                 r9,[r12,#64]                ; r9 is base of trans data

\

f-LDR                 r0,cosine_table_base%

p+LDR                 r1,sine_table_base%

z

�;LDR                 r5,[r12,#40]                ; z rot

�

�ILDR                 r6,[r0,r5,ASL#2]            ; r6 is c   ( * 256 )

�ILDR                 r7,[r1,r5,ASL#2]            ; r7 is s   ( * 256 )

�

�

�; X = ( x * c ) - ( y * s )

�; Y = ( y * c ) + ( x * s )

�!.rotate_craft_original_data_z

�7LDR                 r0,[r8],#4                  ; x

�7LDR                 r1,[r8],#4                  ; y

�

�7LDR                 r2,[r8],#4                  ; z
=STR                 r2,[r9,#8]                  ; store z

BMUL                 r2,r0,r6                    ; r2 = (x * c)
$BMUL                 r3,r1,r7                    ; r3 = (y * s)
.]SUB                 r4,r2,r3                    ; r4 = (x * c) - (y * s)  ( r4 is new x )
8BMOV                 r4,r4,ASR#8                 ; scale down x
B
LSSTR                 r4,[r9],#4                  ; store x and inc to y position
V
`DMUL                 r2,r1,r6                    ; r2 = ( y * c )
jDMUL                 r3,r0,r7                    ; r3 = ( x * s )
taADD                 r4,r2,r3                    ; r4 = ( y * c ) + ( x * s )  ( r4 is new y )
~BMOV                 r4,r4,ASR#8                 ; scale down y
�
�"STR                 r4,[r9],#8
�
�"SUBS                r10,r10,#1
�4BGT                 rotate_craft_original_data_z
�
�
�
�
�:; rotate trans data around y and store into trans data
�
�SLDR                 r10,[r12,#52]               ; r10 is no. of points in craft
NLDR                 r9,[r12,#64]                ; r9 is base of trans data


-LDR                 r0,cosine_table_base%
+LDR                 r1,sine_table_base%
(
2;LDR                 r5,[r12,#36]                ; y rot
<
FILDR                 r6,[r0,r5,ASL#2]            ; r6 is c   ( * 256 )
PILDR                 r7,[r1,r5,ASL#2]            ; r7 is s   ( * 256 )
Z
d; X = ( x * c ) - ( z * s )
n; Z = ( z * c ) + ( x * s )
x.rotate_craft_trans_data_y
�7LDR                 r0,[r9]                     ; x
�7LDR                 r1,[r9,#8]                  ; z
�
�DMUL                 r2,r0,r6                    ; r2 = ( x * c )
�DMUL                 r3,r1,r7                    ; r3 = ( z * s )
�[SUB                 r4,r2,r3                    ; r4 = ( x * c ) - ( z * s )    (  x  )
�IMOV                 r4,r4,ASR#8                 ; scale down x by 256
�
�"STR                 r4,[r9],#8
�
�DMUL                 r2,r1,r6                    ; r2 = ( z * c )
�DMUL                 r3,r0,r7                    ; r3 = ( x * s )
�ZADD                 r4,r2,r3                    ; r4 = ( z * c ) + ( x * s )   (  z  )
IMOV                 r4,r4,ASR#8                 ; scale down z by 256

"STR                 r4,[r9],#4
"
,"SUBS                r10,r10,#1
61BGT                 rotate_craft_trans_data_y
@
J
T
^
h
r4; project trans data and store in final x,y data
|
�SLDR                 r10,[r12,#52]               ; r10 is no. of points in craft
�
�OLDR                 r8,[r12,#64]                 ; r8 is base of trans data
�MLDR                 r9,[r12,#68]                 ; r9 is base of x,y data
�
�DLDR                 r3,[r12,#0]                 ; x pos of craft
�DLDR                 r4,[r12,#4]                 ; y pos of craft
�DLDR                 r5,[r12,#8]                 ; z pos of craft
�
�.project_craft_trans_data
�7LDR                 r0,[r8],#4                  ; x
�7LDR                 r1,[r8],#4                  ; y
�7LDR                 r2,[r8],#4                  ; z

>ADD                 r0,r0,r3                    ; offset x
>ADD                 r1,r1,r4                    ; offset y
&>ADD                 r2,r2,r5                    ; offset z
0
:MMOV                 r0,r0,ASL#8                 ; scale up x and y by 256
D#MOV                 r1,r1,ASL#8
N
X:�swm_rdiv_act(0,2,6)                           ; x / z
b:�swm_rdiv_act(1,2,7)                           ; y / z
l
v"ADD                 r6,r6,#160
�!ADD                 r7,r7,#20
�
�"STR                 r6,[r9],#4
�"STR                 r7,[r9],#4
�
�"SUBS                r10,r10,#1
�0BGT                 project_craft_trans_data
�
�
�; plot craft facets
�
�SLDR                 r10,[r12,#56]               ; r10 is no. of facets in craft
�RLDR                 r9,[r12,#72]                ; r9 is base of rendering data
LLDR                 r8,[r12,#68]                ; r8 is base of x,y data


 .plot_craft_facets
*2LDR                 r7,polygon_workspace_base%
4@LDR                 r0,[r9],#4                  ; r0 is type
>
H8LDR                 r5,[r9],#4                  ; p0
ROADD                 r6,r8,r5,ASL#3              ; r6 is adr of x,y point r5
\7LDR                 r1,[r6]                     ; x
f7LDR                 r2,[r6,#4]                  ; y
p=STR                 r1,[r7],#4                  ; store x
z=STR                 r2,[r7],#4                  ; store y
�MSTMFA               (sp)!,{r1,r2}               ; store x1,y1 coord pairs
�
�8LDR                 r5,[r9],#4                  ; p1
�OADD                 r6,r8,r5,ASL#3              ; r6 is adr of x,y point r5
�7LDR                 r1,[r6]                     ; x
�7LDR                 r2,[r6,#4]                  ; y
�=STR                 r1,[r7],#4                  ; store x
�=STR                 r2,[r7],#4                  ; store y
�MSTMFA               (sp)!,{r1,r2}               ; store x2,y2 coord pairs
�
�
�8LDR                 r5,[r9],#4                  ; p2
�OADD                 r6,r8,r5,ASL#3              ; r6 is adr of x,y point r5
7LDR                 r1,[r6]                     ; x
7LDR                 r2,[r6,#4]                  ; y
=STR                 r1,[r7],#4                  ; store x
$=STR                 r2,[r7],#4                  ; store y
.MSTMFA               (sp)!,{r1,r2}               ; store x3,y3 coord pairs
8
B
L8LDR                 r5,[r9],#4                  ; p3
VOADD                 r6,r8,r5,ASL#3              ; r6 is adr of x,y point r5
`7LDR                 r1,[r6]                     ; x
j7LDR                 r2,[r6,#4]                  ; y
t=STR                 r1,[r7],#4                  ; store x
~=STR                 r2,[r7],#4                  ; store y
�
�KADD                 r9,r9,#4                    ; intensity information
�ASTR                 r0,[r7]                     ; render type
�
�1LDMFA               (sp)!,{r6,r5,r4,r3,r2,r1}
�; r1,r2 is x1,y1
�; r3,r4 is x2,y2
�; r5,r6 is x3,y3
�
�5;           x1          y3          y1         x3
�4;           |           |           |          |
�9; vis = ( x1-x2 ) * ( y3-y2 ) - ( y1-y2 ) * ( x3-x2 )
/;                 |                       |

0;                 r3                      r4

FSUB                 r1,r1,r3                     ; r1 is ( x1-x2 )
(FSUB                 r6,r6,r4                     ; r6 is ( y3-y2 )
2FSUB                 r2,r2,r4                     ; r2 is ( y1-y2 )
<FSUB                 r5,r5,r3                     ; r5 is ( x3-x2 )
F
PQMUL                 r3,r1,r6                     ; r3 = ( x1-x2 ) * ( y3-y2 )
ZQMUL                 r4,r2,r5                     ; r4 = ( y1-y2 ) * ( x3-x2 )
d
n@SUBS                r1,r3,r4                     ; r1 is ans
x
�,BLGT                texturemap_quadragon
�
�"SUBS                r10,r10,#1
�)BGT                 plot_craft_facets
�
�/LDMFA               (sp)!,{r0-r10,r12,link}
�MOV                 PC,link
�
�
�
�
�
�%; r0 is no. of craft to calculate
.craft_movement_handler
/STMFA               (sp)!,{r0-r10,r12,link}

"3LDR                 r10,craft_header_list_base%
,SLDR                 r12,[r10,r0,ASL#2]          ; r12 is header of craft no. r0
6
@GLDR                 r0,[r12,#44]                ; r0 is y rot speed
JALDR                 r1,[r12,#36]                ; r1 is y rot
T
^NADD                 r1,r1,r0                    ; add y rot speed to y rot
h
rNCMP                 r1,#360                     ; ensure y rot is in range
|"SUBGE               r1,r1,#360
�MOVS                r1,r1
�"ADDLT               r1,r1,#360
�
�ASTR                 r1,[r12,#36]                ; store y rot
�$LDR                 r2,[r12,#40]
�NCMP                 r2,#360                     ; ensure y rot is in range
�"SUBGE               r2,r2,#360
�MOVS                r2,r2
�"ADDLT               r2,r2,#360
�$STR                 r2,[r12,#40]
�
�/LDMFA               (sp)!,{r0-r10,r12,link}
�MOV                 PC,link

]

&� pass%
0
:�
D
N
X
b
l��assemble_poly_renderers
vC� no routines in this section should access the screen directly
�G� all screen control is handled exclusively by screen handlers code
�
�� adr%,pass%,link,sp
�
�link=14
�	sp=11
�
�"� continues on in code% memory
�
�adr%=P%
�
�
�
� pass%=8 � 10 � 2

P%=adr%
 L%=code% + len%
*
4[ OPT pass%
>
H]; Addresses already used ( in front of code so it it uses these instead of the previous )
R
\5.swm_rdiv_list_base%          EQUD swm_rdiv_list%
f
p
z2.sine_table_base%             EQUD sine_table%
�4.cosine_table_base%           EQUD cosine_table%
�9.craft_header_list_base%      EQUD craft_header_list%
�
�
�.texturemap_quadragon
�E; r7 is used throughout for line counter is also side no. (0 - 3)
�
�!; edge list format as follows
�
�*; 0       4       8       12        16
�*; ____________________________________
�); |   x   |   u   |   v   |   obs   |
�*; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; adr = base + ( y * 16 )
; note v is scaled by 256
6; r12 is adr of polygon_workspace% throughout rtn.
$
..STMFA              (sp)!,{r0-r10,r12,link}
8MOV                r7,#3
B
L.tex_scconv
V2LDR                r12,polygon_workspace_base%
`9; load end point coords      r1,r2      and     r3,r4
jMADD                r10,r12,r7,ASL#3           ; r10 is base + side no * 8
t
~"LDR                r1,[r10],#4
�"LDR                r2,[r10],#4
�]CMP                r7,#3                      ; if side no = 3 put pointer back to start.
��Q              r10,r12
�"LDR                r3,[r10],#4
�"LDR                r4,[r10],#4
�
�
�%; if y1 > y2 swap the coords over
�CMP                r2,r4
�%BEQ                end_tex_scconv
�<LDRLT              r10,[r12,#40]              ; lhs_list
�<LDRGT              r10,[r12,#44]              ; rhs_list


MOVGT              r5,r1
MOVGT              r6,r2
MOVGT              r1,r3
(MOVGT              r2,r4
2MOVGT              r3,r5
<MOVGT              r4,r6
F
P
Z
d; find gradient of line
n<SUB                r3,r3,r1                    ; x2 - x1
x<SUB                r4,r4,r2                    ; y2 - y1
�@�swm_rdiv_sca8(3,4,5)                               ; r5 = m
�
�PMOV                r1,r1,ASL#8                 ; r1 = act x coord scaled up.
�
�3; r2 is y coord r4 is counter r0 is act x coord
�.tex_scconv_loop
�CMP                r2,#256
�%BGE                end_tex_scconv
�
�EMOV                r0,r1,ASR#8                 ; r0 = act x coord
�ZSTR                r0,[r10,r2,ASL#4]           ; store x coord in list at y coord * 16
�
�?ADD                r1,r1,r5                    ; inc x by m

ADD                r2,r2,#1
SUBS               r4,r4,#1
"&BGT                tex_scconv_loop
,
6
@.end_tex_scconv
JGSUBS               r7,r7,#1                   ; go and do next line
T!BGE                tex_scconv
^
h
r.tex_interpol_side0
|; interpolate side 0
�!; u coordinates stay constant
�; 0 , 0
�	;   |
�	;   |
�	;   |
�; 0 , 31
�
�%; load y coords of points 0 and 1
�5LDR                r0,[r12,#4]               ; y0
�5LDR                r1,[r12,#12]              ; y1
�
�CMP                r0,r1
�NLDRLT              r10,[r12,#40]        ; if y0 < y1 load base of lhs_list
NLDRGT              r10,[r12,#44]        ; if y0 > y1 load base of rhs_list
XBEQ                tex_interpol_side1        ; if y coords are equal go to next side

&5MOVLT              r2,#0                     ; v0
05MOVLT              r3,#31<<8                 ; v1
:
D\MOVGT              r2,#31<<8                 ; v1          if y0 > y1 reverse u,v coords
N5MOVGT              r3,#0                     ; v0
X
bKMOVGT              r9,r0                     ; if y0 > y1 swap y coords
lMOVGT              r0,r1
vMOVGT              r1,r9
�
�GSUB                r1,r1,r0                  ; r1 is y size of side
�=SUB                r3,r3,r2                  ; r3 = v2-v1
�JMOV                r2,r2,ASL#8               ; r2 is scaled v position
�
�I�swm_rdiv_sca8(3,1,4)                             ; r4 is v step size
�
�
�MOV                r8,#0
�.tex_interpol_side0_loop
�CMP                r0,#256
�)BGE                tex_interpol_side1
�
]MOV                r9,r0,ASL#4               ; r9 is adr offset of current scan line info
\ADD                r9,r9,r10                 ; r9 is actual adr of    "      "     "   "
GSTR                r8,[r9,#4]                ; store 0 into u space
 ?MOV                r5,r2,ASR#8               ; r5 = r2 >> 8
*!STR                r5,[r9,#8]
4
>ADD                r2,r2,r4
H
RGADD                r0,r0,#1                  ; increment y position
\SUBS               r1,r1,#1
f.BGE                tex_interpol_side0_loop
p
z
�.tex_interpol_side1
�; interpolate side 1
�; 0,31 ------------- 31,31
�; v coord stays constant
�
�%; load y coords of points 1 and 2
�6LDR                r0,[r12,#12]               ; y0
�6LDR                r1,[r12,#20]               ; y1
�
�CMP                r0,r1
�NLDRLT              r10,[r12,#40]        ; if y0 < y1 load base of lhs_list
�NLDRGT              r10,[r12,#44]        ; if y0 > y1 load base of rhs_list
�XBEQ                tex_interpol_side2        ; if y coords are equal go to next side

5MOVLT              r2,#0                     ; u0
8MOVLT              r3,#31<<8                    ; u1
$
._MOVGT              r2,#31<<8                    ; u1          if y0 > y1 reverse u,v coords
85MOVGT              r3,#0                     ; u0
B
LKMOVGT              r9,r0                     ; if y0 > y1 swap y coords
VMOVGT              r0,r1
`MOVGT              r1,r9
j
tGSUB                r1,r1,r0                  ; r1 is y size of side
~=SUB                r3,r3,r2                  ; r3 = u2-u1
�JMOV                r2,r2,ASL#8               ; r2 is scaled v position
�
�I�swm_rdiv_sca8(3,1,4)                             ; r4 is v step size
�
�
� MOV                r8,#31<<8
�.tex_interpol_side1_loop
�CMP                r0,#256
�)BGE                tex_interpol_side2
�
�]MOV                r9,r0,ASL#4               ; r9 is adr offset of current scan line info
�\ADD                r9,r9,r10                 ; r9 is actual adr of    "      "     "   "
KSTR                r8,[r9,#8]                ; store 16<<8 into v space

?MOV                r5,r2,ASR#8               ; r5 = r2 >> 8
!STR                r5,[r9,#4]

(ADD                r2,r2,r4
2
<GADD                r0,r0,#1                  ; increment y position
FSUBS               r1,r1,#1
P.BGE                tex_interpol_side1_loop
Z
d
n
x.tex_interpol_side2
�; interpolate side 2
�; 31,0             p3
�;     |
�;     |
�;     |
�;     |
�;     |
�; 31,31            p2
�"; u coord stays constant at 31
�
�
�
�%; load y coords of points 2 and 3
6LDR                r0,[r12,#20]               ; y0
6LDR                r1,[r12,#28]               ; y1

"CMP                r0,r1
,NLDRLT              r10,[r12,#40]        ; if y0 < y1 load base of lhs_list
6NLDRGT              r10,[r12,#44]        ; if y0 > y1 load base of rhs_list
@XBEQ                tex_interpol_side3        ; if y coords are equal go to next side
J
T5MOVLT              r2,#31<<8                 ; v0
^5MOVLT              r3,#0                     ; v1
h
r\MOVGT              r2,#0                     ; v1          if y0 > y1 reverse u,v coords
|5MOVGT              r3,#31<<8                 ; v0
�
�KMOVGT              r9,r0                     ; if y0 > y1 swap y coords
�MOVGT              r0,r1
�MOVGT              r1,r9
�
�GSUB                r1,r1,r0                  ; r1 is y size of side
�=SUB                r3,r3,r2                  ; r3 = v2-v1
�JMOV                r2,r2,ASL#8               ; r2 is scaled v position
�
�I�swm_rdiv_sca8(3,1,4)                             ; r4 is v step size
�
�
� MOV                r8,#31<<8
 .tex_interpol_side2_loop
 CMP                r0,#256
 )BGE                tex_interpol_side3
 &
 0]MOV                r9,r0,ASL#4               ; r9 is adr offset of current scan line info
 :\ADD                r9,r9,r10                 ; r9 is actual adr of    "      "     "   "
 DHSTR                r8,[r9,#4]                ; store 15 into u space
 N@MOV                r5,r2,ASR#8               ; r5 = r2 >> 16
 X!STR                r5,[r9,#8]
 b
 lADD                r2,r2,r4
 v
 �GADD                r0,r0,#1                  ; increment y position
 �SUBS               r1,r1,#1
 �.BGE                tex_interpol_side2_loop
 �
 �
 �.tex_interpol_side3
 �; interpolate side 3
 �@; p0           0,0 ---------------------- 31,0            p3
 �; v coord stays const
 �
 �
 �
 �%; load y coords of points 3 and 0
!6LDR                r0,[r12,#28]               ; y0
!5LDR                r1,[r12,#4]               ; y1
!
! CMP                r0,r1
!*NLDRLT              r10,[r12,#40]        ; if y0 < y1 load base of lhs_list
!4NLDRGT              r10,[r12,#44]        ; if y0 > y1 load base of rhs_list
!>XBEQ                tex_find_quad_extremes    ; if y coords are equal go to next side
!H
!R8MOVLT              r2,#31<<8                    ; u0
!\5MOVLT              r3,#0                     ; u1
!f
!p\MOVGT              r2,#0                     ; u1          if y0 > y1 reverse u,v coords
!z8MOVGT              r3,#31<<8                    ; u0
!�
!�KMOVGT              r9,r0                     ; if y0 > y1 swap y coords
!�MOVGT              r0,r1
!�MOVGT              r1,r9
!�
!�GSUB                r1,r1,r0                  ; r1 is y size of side
!�=SUB                r3,r3,r2                  ; r3 = u2-u1
!�JMOV                r2,r2,ASL#8               ; r2 is scaled u position
!�
!�I�swm_rdiv_sca8(3,1,4)                             ; r4 is u step size
!�
!�
!�MOV                r8,#0
".tex_interpol_side3_loop
"CMP                r0,#256
"-BGE                tex_find_quad_extremes
"$
".
"8]MOV                r9,r0,ASL#4               ; r9 is adr offset of current scan line info
"B\ADD                r9,r9,r10                 ; r9 is actual adr of    "      "     "   "
"LGSTR                r8,[r9,#8]                ; store 0 into v space
"V>MOV                r5,r2,ASR#8              ; r5 = r2 >> 8
"`!STR                r5,[r9,#4]
"j
"tADD                r2,r2,r4
"~
"�GADD                r0,r0,#1                  ; increment y position
"�SUBS               r1,r1,#1
"�.BGE                tex_interpol_side3_loop
"�
"�
"�
"�.tex_find_quad_extremes
"�<MOV                r1,#255                   ; y minimum
"�<MOV                r9,#0                     ; y maximum
"�
"�=LDR                r4,[r12,#4]               ; p0 y coord
"�LCMP                r4,r1                     ; if y coord < than minimum
#DMOVLT              r1,r4                     ; minimum = y coord
#
GCMP                r4,r9                     ; if y coord > maximum
#DMOVGT              r9,r4                     ; maximum = y coord
#
#(=LDR                r4,[r12,#12]              ; p1 y coord
#2LCMP                r4,r1                     ; if y coord < than minimum
#<DMOVLT              r1,r4                     ; minimum = y coord
#FGCMP                r4,r9                     ; if y coord > maximum
#PDMOVGT              r9,r4                     ; maximum = y coord
#Z
#d=LDR                r4,[r12,#20]              ; p2 y coord
#nLCMP                r4,r1                     ; if y coord < than minimum
#xDMOVLT              r1,r4                     ; minimum = y coord
#�GCMP                r4,r9                     ; if y coord > maximum
#�DMOVGT              r9,r4                     ; maximum = y coord
#�
#�=LDR                r4,[r12,#28]              ; p3 y coord
#�LCMP                r4,r1                     ; if y coord < than minimum
#�DMOVLT              r1,r4                     ; minimum = y coord
#�GCMP                r4,r9                     ; if y coord > maximum
#�DMOVGT              r9,r4                     ; maximum = y coord
#�
#�
#�CMP                r1,r9
#�NBEQ                end_tex_quad              ; if ymin = ymax exit routine
#�CMP                r9,#256
$MOVGE              r9,#255
$
$
$";LDR                r7,[r12,#40]              ; lhs_list
$,;LDR                r8,[r12,#44]              ; rhs_list
$6GSUB                r9,r9,r1                  ; r9 is y size of poly
$@; r1 is y pos
$J
$T.tex_render_poly
$^XADD                r10,r7,r1,ASL#4           ; r10 is lhs info for current scan line
$h?LDR                r0,[r10]                  ; load start x
$r@LDR                r3,[r10,#4]               ; r3 is start u
$|@LDR                r4,[r10,#8]               ; r4 is start v
$�XADD                r10,r8,r1,ASL#4           ; r10 is rhs info for current scan line
$�JLDR                r2,[r10]                  ; r2 is end coord of line
$�KSUB                r2,r2,r0                  ; r2 is now length of line
$�DLDR                r5,[r10,#4]               ; r5 is end u coord
$�DLDR                r6,[r10,#8]               ; r6 is end v coord
$�
$�
$�MOVS               r2,r2
$�MBLGT               tex_scan_line             ; only plot if line length>0
$�
$�ADD                r1,r1,#1
$�SUBS               r9,r9,#1
$�&BGT                tex_render_poly
%
%.end_tex_quad
%.LDMFA              (sp)!,{r0-r10,r12,link}
%&MOV                PC,link
%0
%:
%D
%N
%X
%b
%l]
%v� pass%
%�
%��
%�
%�8� --------------------------- SETUP 3D CRAFTS ------
%�
%�
%�� �setup_3d_crafts
%�
%�!� '"Setting up 3D craft data"
%�ș "Hourglass_On"
%�
%�1fh=�"<Perpetual_Motion$Dir>.Crafts.CraftData"
%�
&�#fh,no_of_craft%
&'� craft_header_list% no_of_craft%*4
&
& 5craft_3d_data_size%=8               : � size in K
&*-� craft_3d_data% craft_3d_data_size%*1024
&4
&>
&HP%=craft_3d_data%
&R0L%=craft_3d_data%+(craft_3d_data_size%*1024)
&\
&f$� craft_no%=0 � (no_of_craft%-1)
&p
&z�#fh,craft_points%
&��#fh,craft_facets%
&�
&�(craft_orig_dat%=�init_craft_orig_dat
&�*craft_trans_dat%=�init_craft_trans_dat
&�*craft_final_dat%=�init_craft_final_dat
&�,craft_render_dat%=�init_craft_render_dat
&�
&�$craft_header%=�init_craft_header
&�
&�2craft_header_list%!(craft_no%*4)=craft_header%
&�
&�
&�Y�PRINT "craft ";craft_no%;" initialised  -  adr ";!(craft_header_list%+(craft_no%*4))
'
'
'� craft_no%
'$
'.ș "Hourglass_Off"
'8�#fh
'B
'L�
'V
'`
'j� �init_craft_orig_dat
't� adr%,pno%,x%,y%,z%
'~
'�adr%=P%
'�
'� � pno%=0 � (craft_points%-1)
'�
'��#fh,x%
'��#fh,y%
'��#fh,z%
'�
'�
'�[ OPT 10
'�EQUD x%
'�EQUD y%
(EQUD z%
(
]
(
(
� pno%
((	=adr%
(2
(<
(F� �init_craft_trans_dat
(P� adr%,pno%
(Z
(dadr%=P%
(n
(x � pno%=0 � (craft_points%-1)
(�
(�[ OPT 10
(�%EQUD 0                        ; x
(�%EQUD 0                        ; y
(�%EQUD 0                        ; z
(�]
(�
(�
� pno%
(�	=adr%
(�
(�
(�� �init_craft_final_dat
(�� adr%,pno%
)
)adr%=P%
)
)" � pno%=0 � (craft_points%-1)
),
)6[ OPT 10
)@%EQUD 0                        ; x
)J%EQUD 0                        ; y
)T]
)^
)h
� pno%
)r	=adr%
)|
)�
)�� �init_craft_render_dat
)�=� adr%,fno%,type%,p0%,p1%,p2%,p3%,int0%,int1%,int2%,int3%
)�
)�adr%=P%
)�
)�
)�
)� � fno%=0 � (craft_facets%-1)
)�
)��#fh,type%
)��#fh,p0%
)��#fh,p1%
*�#fh,p2%
*�#fh,p3%
*
*&int0%=�#fh
*0int1%=�#fh
*:int2%=�#fh
*Dint3%=�#fh
*N
*X[ OPT 10
*b$EQUD type%                ; type
*l EQUD p0%                ; p0
*v EQUD p1%                ; p1
*� EQUD p2%                ; p2
*� EQUD p3%                ; p3
*�
*�&EQUB int0%                ; p0 int
*�&EQUB int1%                ; p1 int
*�&EQUB int2%                ; p2 int
*�&EQUB int3%                ; p3 int
*�]
*�
� fno%
*�	=adr%
*�
*�
*�� �init_craft_header
+
� adr%
+
+adr%=P%
+ 
+*[ OPT 10
+4>EQUD 0                        ; position vector components
+>EQUD 50
+HEQUD 900
+R
+\>EQUD 0                        ; velocity vector components
+f
EQUD 0
+p
EQUD 0
+z
+�BEQUD 0                        ; acceleration vector components
+�
EQUD 0
+�
EQUD 0
+�
+�)EQUD 0                        ; y rot
+�)EQUD 0                        ; z rot
+�/EQUD 0                        ; y rot speed
+�/EQUD 0                        ; z rot speed
+�
+�EQUD craft_points%
+�EQUD craft_facets%
+�EQUD craft_orig_dat%
+�EQUD craft_trans_dat%
,EQUD craft_final_dat%
,EQUD craft_render_dat%
,]
,$	=adr%
,.
,8
,B
,L
,V
,`
,j
,t��initialise_edge_tables
,~
,�� lhs_list% 256*16
,�� rhs_list% 256*16
,�
,��
,�
,�
,�
,���setup_textures
,�
,�no_of_textures%=1
,�
,�$� textures% no_of_textures%*1024
-
-
0fh=�"<Perpetual_Motion$Dir>.Texture.TexData"
-
-
-(%� I%=0 � (no_of_textures%*1024)-1
-2
-<  pix=�#fh
-F  textures%?I%=pix
-P
-Z� I%
-d�#fh
-n
-x�
-�
-�
-�
-�
-�
-�Q� --------------------------- DIVISION ROUTINES -----------------------------
-�
-�� �setup_reference_lists
-�
-�� swm_rdiv_list% 8192*4
-�
-�div_scale%=18
-�
.� I%
.
.� I%=1 � 8191
."
.,  no=(1/I%)*(2^div_scale%)
.6  swm_rdiv_list%!(I%<<2)=no
.@
.J�
.T
.^� sine_table% 360*4
.h� cosine_table% 360*4
.r
.|� I%=0 � 359
.�
.�)   sine_table%!(I%<<2)=(�(�(I%))*256)
.�+   cosine_table%!(I%<<2)=(�(�(I%))*256)
.�
.��
.�
.��
.�
.�
.�
.�ݤint_div(nu,div,qu)
.�
� mark%()
.�
/*� mark%(12)            : � regs 0 - 12
/
mark%()=0
/
/&@mark%(nu)=1              : � set marks for regs already used
/0mark%(div)=1
/:mark%(qu)=1
/Dmark%(11)=1
/N
/XI%=0
/b�
/l4� mark%(I%)=0 : rem = I% : mark%(I%) = 1 : I%=13
/v	I%+=1
/�� I%>=13
/�
/�I%=0
/��
/�3� mark%(I%)=0 : pl = I% : mark%(I%) = 1 : I%=13
/�	I%+=1
/�� I%>=13
/�
/�I%=0
/��
/�3� mark%(I%)=0 : ds = I% : mark%(I%) = 1 : I%=13
/�	I%+=1
/�� I%>=13
0
0I%=0
0�
0 3� mark%(I%)=0 : ms = I% : mark%(I%) = 1 : I%=13
0*	I%+=1
04� I%>=13
0>
0H[ OPT pass%
0R2STMFA              (sp)!,{nu,div,rem,pl,ds,ms}
0\!�S               ms,nu,#1<<31
0fRSBMI              nu,nu,#0
0p�                ds,ms,div
0zCMP                div,#0
0�!RSBMI              div,div,#0
0�
0�MOV                rem,#0
0�MOV                qu,#0
0� MOV                pl,#1<<31
0�
0�]
0�� I%=0 � 31
0�
0�[ OPT pass%
0�
0�"MOVS               nu,nu,ASL#1
0�"ADC                rem,rem,rem
1CMP                rem,div
1"SUBGE              rem,rem,div
1�RGE              qu,qu,pl
1$"MOVS               pl,pl,LSR#1
1.
18]
1B� I%
1L
1V[ OPT pass%
1`
1jCMP                ds,#0
1tRSBMI              qu,qu,#0
1~CMP                ms,#0
1�!RSBMI              rem,rem,#0
1�
1�2LDMFA              (sp)!,{nu,div,rem,pl,ds,ms}
1�]
1�=0
1�
1�
1�
1�
1�"� �swm_rdiv_act(no%,div%,ans%)
1�
1�
wk0%=0
2
wk1%=1
2

wk2%=2
2
2� wk0%,wk1%,wk2%,I%
2(
22� I%=0 � 14
2<
2F  � wk0%=no% : wk0%+=1
2P  � wk0%=div% : wk0%+=1
2Z  � wk0%=ans% : wk0%+=1
2d  � wk0%=wk1% : wk0%+=1
2n  � wk0%=wk2% : wk0%+=1
2x
2�� I%
2�
2�� I%=0 � 14
2�
2�  � wk1%=no% : wk1%+=1
2�  � wk1%=div% : wk1%+=1
2�  � wk1%=ans% : wk1%+=1
2�  � wk1%=wk0% : wk1%+=1
2�  � wk1%=wk2% : wk1%+=1
2�
2�� I%
2�
2�� I%=0 � 14
3
3  � wk2%=no% : wk2%+=1
3  � wk2%=div% : wk2%+=1
3"  � wk2%=ans% : wk2%+=1
3,  � wk2%=wk0% : wk2%+=1
36  � wk2%=wk1% : wk2%+=1
3@
3J� I%
3T
3^M� wk0%=wk1% : � 0,(" identical work registers in division macro... ") : �
3hM� wk1%=wk2% : � 0,(" identical work registers in division macro... ") : �
3rM� wk0%=wk2% : � 0,(" identical work registers in division macro... ") : �
3|
3�R� no%=div% : � 0,(" identical analytical registers in division macro... ") : �
3�S� div%=ans% : � 0,(" identical analytical registers in division macro... ") : �
3�R� no%=ans% : � 0,(" identical analytical registers in division macro... ") : �
3�
3�[ OPT pass%
3�"STMFA   (sp)!,{wk0%,wk1%,wk2%}
3�
3�&LDR       wk0%,swm_rdiv_list_base%
3�A�S      wk1%,div%,#1<<31                  ; check if negative
3�ERSBMI     div%,div%,#0                      ; if so make positive
3�ILDR       wk2%,[wk0%,div%,LSL#2]             ; load number from table
3�cMUL       ans%,wk2%,no%                      ; perfrom multiplication of number*(1/divisor)<<16
3�RMOV       ans%,ans%,ASR#div_scale%                  ; scale down to get result
4
4CMP       wk1%,#0
4RSBMI     ans%,ans%,#0
4&
40"LDMFA   (sp)!,{wk0%,wk1%,wk2%}
4:
4D]
4N=0
4X
4b
4l
4v
4�$� �swm_rdiv_sca16(no%,div%,ans%)
4�
wk0%=0
4�
wk1%=1
4�
wk2%=2
4�� wk0%,wk1%,wk2%,I%
4�� I%=0 � 14
4�  � wk0%=no% : wk0%+=1
4�  � wk0%=div% : wk0%+=1
4�  � wk0%=ans% : wk0%+=1
4�  � wk0%=wk1% : wk0%+=1
4�  � wk0%=wk2% : wk0%+=1
4�� I%
4�� I%=0 � 14
5  � wk1%=no% : wk1%+=1
5  � wk1%=div% : wk1%+=1
5  � wk1%=ans% : wk1%+=1
5   � wk1%=wk0% : wk1%+=1
5*  � wk1%=wk2% : wk1%+=1
54� I%
5>� I%=0 � 14
5H  � wk2%=no% : wk2%+=1
5R  � wk2%=div% : wk2%+=1
5\  � wk2%=ans% : wk2%+=1
5f  � wk2%=wk0% : wk2%+=1
5p  � wk2%=wk1% : wk2%+=1
5z� I%
5�M� wk0%=wk1% : � 0,(" identical work registers in division macro... ") : �
5�M� wk1%=wk2% : � 0,(" identical work registers in division macro... ") : �
5�M� wk0%=wk2% : � 0,(" identical work registers in division macro... ") : �
5�R� no%=div% : � 0,(" identical analytical registers in division macro... ") : �
5�S� div%=ans% : � 0,(" identical analytical registers in division macro... ") : �
5�R� no%=ans% : � 0,(" identical analytical registers in division macro... ") : �
5�[ OPT pass%
5�"STMFA   (sp)!,{wk0%,wk1%,wk2%}
5�&LDR       wk0%,swm_rdiv_list_base%
5�A�S      wk1%,div%,#1<<31                  ; check if negative
5�ERSBMI     div%,div%,#0                      ; if so make positive
5�ILDR       wk2%,[wk0%,div%,LSL#2]             ; load number from table
5�cMUL       ans%,wk2%,no%                      ; perfrom multiplication of number*(1/divisor)<<16
6CMP       wk1%,#0
6RSBMI     ans%,ans%,#0
6
6$"LDMFA   (sp)!,{wk0%,wk1%,wk2%}
6.
68]
6B=0
6L
6V
6`
6j
6t#� �swm_rdiv_sca8(no%,div%,ans%)
6~
wk0%=0
6�
wk1%=1
6�
wk2%=2
6�� wk0%,wk1%,wk2%,I%
6�� I%=0 � 14
6�  � wk0%=no% : wk0%+=1
6�  � wk0%=div% : wk0%+=1
6�  � wk0%=ans% : wk0%+=1
6�  � wk0%=wk1% : wk0%+=1
6�  � wk0%=wk2% : wk0%+=1
6�� I%
6�� I%=0 � 14
6�  � wk1%=no% : wk1%+=1
7  � wk1%=div% : wk1%+=1
7
  � wk1%=ans% : wk1%+=1
7  � wk1%=wk0% : wk1%+=1
7  � wk1%=wk2% : wk1%+=1
7(� I%
72� I%=0 � 14
7<  � wk2%=no% : wk2%+=1
7F  � wk2%=div% : wk2%+=1
7P  � wk2%=ans% : wk2%+=1
7Z  � wk2%=wk0% : wk2%+=1
7d  � wk2%=wk1% : wk2%+=1
7n� I%
7xM� wk0%=wk1% : � 0,(" identical work registers in division macro... ") : �
7�M� wk1%=wk2% : � 0,(" identical work registers in division macro... ") : �
7�M� wk0%=wk2% : � 0,(" identical work registers in division macro... ") : �
7�R� no%=div% : � 0,(" identical analytical registers in division macro... ") : �
7�S� div%=ans% : � 0,(" identical analytical registers in division macro... ") : �
7�R� no%=ans% : � 0,(" identical analytical registers in division macro... ") : �
7�[ OPT pass%
7�"STMFA   (sp)!,{wk0%,wk1%,wk2%}
7�&LDR       wk0%,swm_rdiv_list_base%
7�A�S      wk1%,div%,#1<<31                  ; check if negative
7�ERSBMI     div%,div%,#0                      ; if so make positive
7�ILDR       wk2%,[wk0%,div%,LSL#2]             ; load number from table
7�cMUL       ans%,wk2%,no%                      ; perfrom multiplication of number*(1/divisor)<<16
7�VMOV       ans%,ans%,ASR#(div_scale%-8)                  ; scale down to get result
8
8CMP       wk1%,#0
8RSBMI     ans%,ans%,#0
8"
8,"LDMFA   (sp)!,{wk0%,wk1%,wk2%}
86
8@]
8J=0
�,�����O�@-� �C��	 ����$��4���4��	 ����,��#�������豜*Basic -quit  @
00000000  20 20 9f e5 0c 30 4f e2  03 00 82 e0 0f 1c 80 e2  |  ...0O.........|
00000010  04 30 10 e4 04 30 01 e4  04 20 52 e2 fb ff ff 1a  |.0...0... R.....|
00000020  28 c0 4f e2 ef 2a 00 ea  60 9d 00 00 0d 00 0a 29  |(.O..*..`......)|
00000030  f4 20 50 65 72 70 65 74  75 61 6c 20 4d 6f 74 69  |. Perpetual Moti|
00000040  6f 6e 20 20 2d 20 20 21  52 75 6e 49 6d 61 67 65  |on  -  !RunImage|
00000050  20 66 69 6c 65 0d 00 14  1b f4 20 a9 20 41 6e 64  | file..... . And|
00000060  72 65 77 20 44 6f 63 6b  69 6e 67 20 31 39 39 36  |rew Docking 1996|
00000070  0d 00 1e 04 0d 00 28 04  0d 00 32 59 f4 20 2d 2d  |......(...2Y. --|
00000080  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000090  2d 2d 2d 2d 2d 2d 2d 20  57 48 45 4e 20 54 48 49  |------- WHEN THI|
000000a0  4e 47 53 20 47 4f 20 57  52 4f 4e 47 20 48 41 4e  |NGS GO WRONG HAN|
000000b0  44 4c 49 4e 47 20 43 4f  44 45 20 2d 2d 2d 2d 2d  |DLING CODE -----|
000000c0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000000d0  2d 0d 00 3c 60 ee 20 85  20 c8 99 20 22 48 6f 75  |-..<`. . .. "Hou|
000000e0  72 67 6c 61 73 73 5f 53  6d 61 73 68 22 20 3a 20  |rglass_Smash" : |
000000f0  eb 20 30 20 3a 20 85 20  30 2c 28 f6 24 2b 22 20  |. 0 : . 0,(.$+" |
00000100  28 69 6e 74 65 72 6e 61  6c 20 65 72 72 6f 72 20  |(internal error |
00000110  63 6f 64 65 20 22 2b c3  28 9f 29 2b 22 20 61 74  |code "+.(.)+" at|
00000120  20 6c 69 6e 65 20 22 2b  c3 28 9e 29 2b 22 29 22  | line "+.(.)+")"|
00000130  29 0d 00 46 04 0d 00 50  1d f1 20 22 a9 20 41 6e  |)..F...P.. ". An|
00000140  64 72 65 77 20 44 6f 63  6b 69 6e 67 20 31 39 39  |drew Docking 199|
00000150  36 22 0d 00 5a 1c f1 20  22 54 65 78 74 75 72 65  |6"..Z.. "Texture|
00000160  20 6d 61 70 70 65 64 20  63 75 62 65 2e 22 0d 00  | mapped cube."..|
00000170  64 04 0d 00 6e 04 0d 00  78 04 0d 00 82 53 f4 20  |d...n...x....S. |
00000180  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000190  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 20 53 45 54 55  |----------- SETU|
000001a0  50 20 50 52 4f 43 45 44  55 52 45 53 20 2d 2d 2d  |P PROCEDURES ---|
000001b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000001c0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d 00 8c  |-------------...|
000001d0  04 0d 00 96 1a f2 73 65  74 75 70 5f 72 65 66 65  |......setup_refe|
000001e0  72 65 6e 63 65 5f 6c 69  73 74 73 0d 00 a0 1b f2  |rence_lists.....|
000001f0  69 6e 69 74 69 61 6c 69  73 65 5f 65 64 67 65 5f  |initialise_edge_|
00000200  74 61 62 6c 65 73 0d 00  aa 13 f2 73 65 74 75 70  |tables.....setup|
00000210  5f 74 65 78 74 75 72 65  73 0d 00 b4 04 0d 00 be  |_textures.......|
00000220  53 f4 20 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |S. -------------|
00000230  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 20 33  |-------------- 3|
00000240  44 20 4f 42 4a 45 43 54  20 53 45 54 55 50 20 50  |D OBJECT SETUP P|
00000250  52 4f 43 45 44 55 52 45  53 20 2d 2d 2d 2d 2d 2d  |ROCEDURES ------|
00000260  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000270  0d 00 c8 04 0d 00 d2 14  f2 73 65 74 75 70 5f 33  |.........setup_3|
00000280  64 5f 63 72 61 66 74 73  0d 00 dc 04 0d 00 e6 04  |d_crafts........|
00000290  0d 00 f0 53 f4 20 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...S. ----------|
000002a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000002b0  2d 20 43 4f 4d 50 49 4c  45 20 4d 41 49 4e 20 43  |- COMPILE MAIN C|
000002c0  4f 44 45 20 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |ODE ------------|
000002d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000002e0  2d 2d 2d 0d 00 fa 1d f2  61 73 73 65 6d 62 6c 65  |---.....assemble|
000002f0  5f 73 63 72 65 65 6e 5f  68 61 6e 64 6c 65 72 73  |_screen_handlers|
00000300  0d 01 04 1c f2 61 73 73  65 6d 62 6c 65 5f 70 6f  |.....assemble_po|
00000310  6c 79 5f 72 65 6e 64 65  72 65 72 73 0d 01 0e 19  |ly_renderers....|
00000320  f2 61 73 73 65 6d 62 6c  65 5f 33 64 5f 68 61 6e  |.assemble_3d_han|
00000330  64 6c 65 72 73 0d 01 18  04 0d 01 22 04 0d 01 2c  |dlers......"...,|
00000340  53 f4 20 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |S. -------------|
00000350  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 20 49  |-------------- I|
00000360  4e 49 54 49 41 4c 49 53  45 20 55 4e 49 56 45 52  |NITIALISE UNIVER|
00000370  53 41 4c 20 53 54 41 43  4b 20 2d 2d 2d 2d 2d 2d  |SAL STACK ------|
00000380  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000390  0d 01 36 10 d6 20 69 6e  69 74 5f 73 74 61 63 6b  |..6.. init_stack|
000003a0  0d 01 40 04 0d 01 4a 04  0d 01 54 53 f4 20 2d 2d  |..@...J...TS. --|
000003b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000003c0  2d 2d 2d 2d 2d 2d 2d 2d  2d 20 53 45 54 55 50 20  |--------- SETUP |
000003d0  47 41 4d 45 20 53 43 52  45 45 4e 20 2d 2d 2d 2d  |GAME SCREEN ----|
000003e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000003f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 01 5e 07 eb  |-----------..^..|
00000400  31 35 0d 01 68 07 eb 31  33 0d 01 72 05 87 0d 01  |15..h..13..r....|
00000410  7c 04 0d 01 86 09 7a 64  25 3d 31 0d 01 90 09 79  ||.....zd%=1....y|
00000420  73 25 3d 30 0d 01 9a 09  6b 6a 25 3d 31 0d 01 a4  |s%=0....kj%=1...|
00000430  04 0d 01 ae 05 f5 0d 01  b8 07 d1 3d 30 0d 01 c2  |...........=0...|
00000440  0e c8 97 20 6d 78 2c 6d  79 2c 62 0d 01 cc 11 d6  |... mx,my,b.....|
00000450  20 73 63 72 65 65 6e 5f  73 77 61 70 0d 01 d6 0d  | screen_swap....|
00000460  d6 20 63 6c 72 5f 73 63  72 0d 01 e0 04 0d 01 ea  |. clr_scr.......|
00000470  1d 61 61 25 3d 21 28 63  72 61 66 74 5f 68 65 61  |.aa%=!(craft_hea|
00000480  64 65 72 5f 6c 69 73 74  25 29 0d 01 f4 04 0d 01  |der_list%)......|
00000490  fe 04 0d 02 08 16 e7 20  7a 64 25 3d 31 20 3a 20  |....... zd%=1 : |
000004a0  61 61 25 21 38 2b 3d 32  0d 02 12 16 e7 20 7a 64  |aa%!8+=2..... zd|
000004b0  25 3d 30 20 3a 20 61 61  25 21 38 2d 3d 32 0d 02  |%=0 : aa%!8-=2..|
000004c0  1c 1a e7 20 21 28 61 61  25 2b 38 29 3e 39 30 30  |... !(aa%+8)>900|
000004d0  20 3a 20 7a 64 25 3d 30  0d 02 26 1a e7 20 21 28  | : zd%=0..&.. !(|
000004e0  61 61 25 2b 38 29 3c 32  36 30 20 3a 20 7a 64 25  |aa%+8)<260 : zd%|
000004f0  3d 31 0d 02 30 04 0d 02  3a 16 e7 20 6b 6a 25 20  |=1..0...:.. kj% |
00000500  3d 20 31 20 3a 20 79 73  25 2b 3d 31 0d 02 44 11  |= 1 : ys%+=1..D.|
00000510  6b 6a 25 20 3d 20 33 20  2d 20 6b 6a 25 0d 02 4e  |kj% = 3 - kj%..N|
00000520  0e 61 61 25 21 34 2b 3d  79 73 25 0d 02 58 0d 61  |.aa%!4+=ys%..X.a|
00000530  61 25 21 33 36 2b 3d 32  0d 02 62 0d 61 61 25 21  |a%!36+=2..b.aa%!|
00000540  34 30 2d 3d 33 0d 02 6c  04 0d 02 76 2c e7 20 21  |40-=3..l...v,. !|
00000550  28 61 61 25 2b 34 29 3e  32 30 30 20 79 73 25 3d  |(aa%+4)>200 ys%=|
00000560  79 73 25 2a 2d 31 20 3a  20 21 28 61 61 25 2b 34  |ys%*-1 : !(aa%+4|
00000570  29 3d 32 30 30 0d 02 80  04 0d 02 8a 04 0d 02 94  |)=200...........|
00000580  04 0d 02 9e 04 0d 02 a8  08 41 25 3d 30 0d 02 b2  |.........A%=0...|
00000590  1c d6 20 63 72 61 66 74  5f 6d 6f 76 65 6d 65 6e  |.. craft_movemen|
000005a0  74 5f 68 61 6e 64 6c 65  72 0d 02 bc 13 d6 20 70  |t_handler..... p|
000005b0  72 6f 6a 65 63 74 5f 63  72 61 66 74 0d 02 c6 06  |roject_craft....|
000005c0  fd 30 0d 02 d0 04 0d 02  da 04 0d 02 e4 04 0d 02  |.0..............|
000005d0  ee 04 0d 02 f8 05 e0 0d  03 02 04 0d 03 0c 04 0d  |................|
000005e0  03 16 04 0d 03 20 5f f4  20 2d 2d 2d 2d 2d 2d 2d  |..... _. -------|
000005f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000600  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 20 53 43  |------------- SC|
00000610  52 45 45 4e 20 48 41 4e  44 4c 49 4e 47 20 43 4f  |REEN HANDLING CO|
00000620  44 45 20 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |DE -------------|
00000630  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000640  2d 2d 0d 03 2a 04 0d 03  34 1f dd 20 f2 61 73 73  |--..*...4.. .ass|
00000650  65 6d 62 6c 65 5f 73 63  72 65 65 6e 5f 68 61 6e  |emble_screen_han|
00000660  64 6c 65 72 73 0d 03 3e  04 0d 03 48 1a ea 20 70  |dlers..>...H.. p|
00000670  61 73 73 25 2c 6c 69 6e  6b 2c 73 70 2c 73 74 61  |ass%,link,sp,sta|
00000680  63 6b 25 0d 03 52 04 0d  03 5c 0e 6c 65 6e 25 3d  |ck%..R...\.len%=|
00000690  31 36 33 38 34 0d 03 66  04 0d 03 70 0b 6c 69 6e  |16384..f...p.lin|
000006a0  6b 3d 31 34 0d 03 7a 09  73 70 3d 31 31 0d 03 84  |k=14..z.sp=11...|
000006b0  04 0d 03 8e 11 de 20 73  74 61 63 6b 25 20 38 31  |...... stack% 81|
000006c0  39 32 0d 03 98 10 de 20  63 6f 64 65 25 20 6c 65  |92..... code% le|
000006d0  6e 25 0d 03 a2 04 0d 03  ac 04 0d 03 b6 04 0d 03  |n%..............|
000006e0  c0 16 e3 20 70 61 73 73  25 3d 38 20 b8 20 31 30  |... pass%=8 . 10|
000006f0  20 88 20 32 0d 03 ca 0d  50 25 3d 20 63 6f 64 65  | . 2....P%= code|
00000700  25 0d 03 d4 14 4c 25 3d  20 63 6f 64 65 25 20 2b  |%....L%= code% +|
00000710  20 6c 65 6e 25 0d 03 de  0f 5b 20 4f 50 54 20 70  | len%....[ OPT p|
00000720  61 73 73 25 0d 03 e8 04  0d 03 f2 20 2e 73 63 72  |ass%....... .scr|
00000730  65 65 6e 5f 61 64 72 25  20 20 20 20 20 20 20 20  |een_adr%        |
00000740  20 20 45 51 55 44 20 30  0d 03 fc 25 2e 73 74 61  |  EQUD 0...%.sta|
00000750  63 6b 5f 62 61 73 65 25  20 20 20 20 20 20 20 20  |ck_base%        |
00000760  20 20 45 51 55 44 20 73  74 61 63 6b 25 0d 04 06  |  EQUD stack%...|
00000770  04 0d 04 10 04 0d 04 1a  0f 2e 69 6e 69 74 5f 73  |..........init_s|
00000780  74 61 63 6b 0d 04 24 1a  4c 44 52 20 20 20 20 20  |tack..$.LDR     |
00000790  73 70 2c 73 74 61 63 6b  5f 62 61 73 65 25 0d 04  |sp,stack_base%..|
000007a0  2e 13 4d 4f 56 20 20 20  20 20 50 43 2c 6c 69 6e  |..MOV     PC,lin|
000007b0  6b 0d 04 38 04 0d 04 42  04 0d 04 4c 17 2e 62 61  |k..8...B...L..ba|
000007c0  6e 6b 25 20 20 20 20 20  45 51 55 44 20 20 20 31  |nk%     EQUD   1|
000007d0  0d 04 56 49 2e 76 64 75  69 6e 25 20 20 20 20 45  |..VI.vduin%    E|
000007e0  51 55 44 20 20 20 31 34  38 20 20 20 20 20 20 20  |QUD   148       |
000007f0  20 20 20 20 20 3b 20 66  6f 72 20 75 73 65 20 77  |     ; for use w|
00000800  69 74 68 20 22 4f 53 5f  52 65 61 64 56 64 75 56  |ith "OS_ReadVduV|
00000810  61 72 69 61 62 6c 65 73  22 0d 04 60 18 20 20 20  |ariables"..`.   |
00000820  20 20 20 20 20 20 20 20  45 51 55 44 20 20 20 2d  |        EQUD   -|
00000830  31 0d 04 6a 37 2e 76 64  75 6f 75 74 25 20 20 20  |1..j7.vduout%   |
00000840  45 51 55 44 20 20 20 30  20 20 20 20 20 20 20 20  |EQUD   0        |
00000850  20 20 20 20 20 20 20 20  3b 20 73 63 72 65 65 6e  |        ; screen|
00000860  20 61 64 64 72 65 73 73  0d 04 74 04 0d 04 7e 04  | address..t...~.|
00000870  0d 04 88 10 2e 73 63 72  65 65 6e 5f 73 77 61 70  |.....screen_swap|
00000880  0d 04 92 26 53 54 4d 46  41 20 20 20 20 20 20 28  |...&STMFA      (|
00000890  73 70 29 21 2c 7b 72 30  2d 72 31 30 2c 72 31 32  |sp)!,{r0-r10,r12|
000008a0  2c 6c 69 6e 6b 7d 0d 04  9c 3a 4d 4f 56 20 20 20  |,link}...:MOV   |
000008b0  20 20 20 20 20 72 30 2c  23 31 39 20 20 20 20 20  |     r0,#19     |
000008c0  20 20 20 20 20 20 20 20  20 20 3b 20 77 61 69 74  |          ; wait|
000008d0  20 66 6f 72 20 76 73 79  6e 63 20 65 76 65 6e 74  | for vsync event|
000008e0  0d 04 a6 18 53 57 49 20  20 20 20 20 20 20 20 22  |....SWI        "|
000008f0  4f 53 5f 42 79 74 65 22  0d 04 b0 04 0d 04 ba 33  |OS_Byte".......3|
00000900  4c 44 52 20 20 20 20 20  20 20 20 72 34 2c 62 61  |LDR        r4,ba|
00000910  6e 6b 25 20 20 20 20 20  20 20 20 20 20 20 20 20  |nk%             |
00000920  3b 20 6c 6f 61 64 20 62  61 6e 6b 20 6e 6f 2e 0d  |; load bank no..|
00000930  04 c4 34 52 53 42 20 20  20 20 20 20 20 20 72 34  |..4RSB        r4|
00000940  2c 72 34 2c 23 33 20 20  20 20 20 20 20 20 20 20  |,r4,#3          |
00000950  20 20 20 3b 20 62 61 6e  6b 20 3d 20 33 20 2d 62  |   ; bank = 3 -b|
00000960  61 6e 6b 0d 04 ce 34 53  54 52 20 20 20 20 20 20  |ank...4STR      |
00000970  20 20 72 34 2c 62 61 6e  6b 25 20 20 20 20 20 20  |  r4,bank%      |
00000980  20 20 20 20 20 20 20 3b  20 73 74 6f 72 65 20 62  |       ; store b|
00000990  61 6e 6b 20 6e 6f 2e 0d  04 d8 04 0d 04 e2 16 4d  |ank no.........M|
000009a0  4f 56 20 20 20 20 20 20  20 20 72 30 2c 23 31 31  |OV        r0,#11|
000009b0  32 0d 04 ec 14 4d 4f 56  20 20 20 20 20 20 20 20  |2....MOV        |
000009c0  72 31 2c 72 34 0d 04 f6  18 53 57 49 20 20 20 20  |r1,r4....SWI    |
000009d0  20 20 20 20 22 4f 53 5f  42 79 74 65 22 0d 05 00  |    "OS_Byte"...|
000009e0  16 4d 4f 56 20 20 20 20  20 20 20 20 72 30 2c 23  |.MOV        r0,#|
000009f0  31 31 33 0d 05 0a 17 52  53 42 20 20 20 20 20 20  |113....RSB      |
00000a00  20 20 72 31 2c 72 34 2c  23 33 0d 05 14 18 53 57  |  r1,r4,#3....SW|
00000a10  49 20 20 20 20 20 20 20  20 22 4f 53 5f 42 79 74  |I        "OS_Byt|
00000a20  65 22 0d 05 1e 04 0d 05  28 3f 41 44 52 20 20 20  |e"......(?ADR   |
00000a30  20 20 20 20 20 72 30 2c  76 64 75 69 6e 25 20 20  |     r0,vduin%  |
00000a40  20 20 20 20 20 20 20 20  20 20 3b 20 67 65 74 20  |          ; get |
00000a50  6e 65 77 20 73 63 72 65  65 6e 20 61 64 72 20 69  |new screen adr i|
00000a60  6e 20 72 31 32 0d 05 32  19 41 44 52 20 20 20 20  |n r12..2.ADR    |
00000a70  20 20 20 20 72 31 2c 76  64 75 6f 75 74 25 0d 05  |    r1,vduout%..|
00000a80  3c 24 53 57 49 20 20 20  20 20 20 20 20 22 4f 53  |<$SWI        "OS|
00000a90  5f 52 65 61 64 56 64 75  56 61 72 69 61 62 6c 65  |_ReadVduVariable|
00000aa0  73 22 0d 05 46 1a 4c 44  52 20 20 20 20 20 20 20  |s"..F.LDR       |
00000ab0  20 72 31 32 2c 76 64 75  6f 75 74 25 0d 05 50 1e  | r12,vduout%..P.|
00000ac0  53 54 52 20 20 20 20 20  20 20 20 72 31 32 2c 73  |STR        r12,s|
00000ad0  63 72 65 65 6e 5f 61 64  72 25 0d 05 5a 26 4c 44  |creen_adr%..Z&LD|
00000ae0  4d 46 41 20 20 20 20 20  20 28 73 70 29 21 2c 7b  |MFA      (sp)!,{|
00000af0  72 30 2d 72 31 30 2c 72  31 32 2c 6c 69 6e 6b 7d  |r0-r10,r12,link}|
00000b00  0d 05 64 16 4d 4f 56 20  20 20 20 20 20 20 20 50  |..d.MOV        P|
00000b10  43 2c 6c 69 6e 6b 0d 05  6e 04 0d 05 78 04 0d 05  |C,link..n...x...|
00000b20  82 0c 2e 63 6c 72 5f 73  63 72 0d 05 8c 26 53 54  |...clr_scr...&ST|
00000b30  4d 46 41 20 20 20 20 20  20 28 73 70 29 21 2c 7b  |MFA      (sp)!,{|
00000b40  72 30 2d 72 31 30 2c 72  31 32 2c 6c 69 6e 6b 7d  |r0-r10,r12,link}|
00000b50  0d 05 96 1e 4c 44 52 20  20 20 20 20 20 20 20 72  |....LDR        r|
00000b60  31 32 2c 73 63 72 65 65  6e 5f 61 64 72 25 0d 05  |12,screen_adr%..|
00000b70  a0 16 4d 4f 56 20 20 20  20 20 20 20 20 72 39 2c  |..MOV        r9,|
00000b80  23 32 35 36 0d 05 aa 04  0d 05 b4 14 4d 4f 56 20  |#256........MOV |
00000b90  20 20 20 20 20 20 20 72  30 2c 23 30 0d 05 be 14  |       r0,#0....|
00000ba0  4d 4f 56 20 20 20 20 20  20 20 20 72 31 2c 72 30  |MOV        r1,r0|
00000bb0  0d 05 c8 14 4d 4f 56 20  20 20 20 20 20 20 20 72  |....MOV        r|
00000bc0  32 2c 72 30 0d 05 d2 14  4d 4f 56 20 20 20 20 20  |2,r0....MOV     |
00000bd0  20 20 20 72 33 2c 72 30  0d 05 dc 14 4d 4f 56 20  |   r3,r0....MOV |
00000be0  20 20 20 20 20 20 20 72  34 2c 72 30 0d 05 e6 14  |       r4,r0....|
00000bf0  4d 4f 56 20 20 20 20 20  20 20 20 72 35 2c 72 30  |MOV        r5,r0|
00000c00  0d 05 f0 14 4d 4f 56 20  20 20 20 20 20 20 20 72  |....MOV        r|
00000c10  36 2c 72 30 0d 05 fa 14  4d 4f 56 20 20 20 20 20  |6,r0....MOV     |
00000c20  20 20 20 72 37 2c 72 30  0d 06 04 04 0d 06 0e 10  |   r7,r0........|
00000c30  2e 63 6c 72 73 63 72 5f  6c 6f 6f 70 0d 06 18 05  |.clrscr_loop....|
00000c40  5d 0d 06 22 0f e3 20 49  25 3d 31 20 b8 20 31 30  |]..".. I%=1 . 10|
00000c50  0d 06 2c 0f 5b 20 4f 50  54 20 70 61 73 73 25 0d  |..,.[ OPT pass%.|
00000c60  06 36 1b 53 54 4d 49 41  20 20 20 20 20 20 72 31  |.6.STMIA      r1|
00000c70  32 21 2c 7b 72 30 2d 72  37 7d 0d 06 40 05 5d 0d  |2!,{r0-r7}..@.].|
00000c80  06 4a 05 ed 0d 06 54 04  0d 06 5e 0f 5b 20 4f 50  |.J....T...^.[ OP|
00000c90  54 20 70 61 73 73 25 0d  06 68 17 53 55 42 53 20  |T pass%..h.SUBS |
00000ca0  20 20 20 20 20 20 72 39  2c 72 39 2c 23 31 0d 06  |      r9,r9,#1..|
00000cb0  72 1a 42 47 54 20 20 20  20 20 20 20 20 63 6c 72  |r.BGT        clr|
00000cc0  73 63 72 5f 6c 6f 6f 70  0d 06 7c 04 0d 06 86 26  |scr_loop..|....&|
00000cd0  4c 44 4d 46 41 20 20 20  20 20 20 28 73 70 29 21  |LDMFA      (sp)!|
00000ce0  2c 7b 72 30 2d 72 31 30  2c 72 31 32 2c 6c 69 6e  |,{r0-r10,r12,lin|
00000cf0  6b 7d 0d 06 90 04 0d 06  9a 28 4d 4f 56 20 20 20  |k}.......(MOV   |
00000d00  20 20 20 20 20 50 43 2c  6c 69 6e 6b 20 20 20 20  |     PC,link    |
00000d10  3b 20 65 78 69 74 20 72  6f 75 74 69 6e 65 0d 06  |; exit routine..|
00000d20  a4 04 0d 06 ae 04 0d 06  b8 04 0d 06 c2 04 0d 06  |................|
00000d30  cc 5b 3b 20 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.[; ------------|
00000d40  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000d50  2d 2d 2d 2d 2d 2d 2d 20  52 65 6e 64 65 72 69 6e  |------- Renderin|
00000d60  67 20 72 6f 75 74 69 6e  65 73 20 2d 2d 2d 2d 2d  |g routines -----|
00000d70  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000d80  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 06 d6 04 0d 06 e0  |---------.......|
00000d90  04 0d 06 ea 04 0d 06 f4  04 0d 06 fe 04 0d 07 08  |................|
00000da0  04 0d 07 12 0d 2e 70 6c  6f 74 5f 64 6f 74 0d 07  |......plot_dot..|
00000db0  1c 0d 3b 20 72 36 20 69  73 20 78 0d 07 26 0d 3b  |..; r6 is x..&.;|
00000dc0  20 72 37 20 69 73 20 79  0d 07 30 2a 53 54 4d 46  | r7 is y..0*STMF|
00000dd0  41 20 20 20 20 20 20 20  20 20 20 28 73 70 29 21  |A          (sp)!|
00000de0  2c 7b 72 30 2d 72 31 30  2c 72 31 32 2c 6c 69 6e  |,{r0-r10,r12,lin|
00000df0  6b 7d 0d 07 3a 22 4c 44  52 20 20 20 20 20 20 20  |k}..:"LDR       |
00000e00  20 20 20 20 20 72 31 32  2c 73 63 72 65 65 6e 5f  |     r12,screen_|
00000e10  61 64 72 25 0d 07 44 1d  41 44 44 20 20 20 20 20  |adr%..D.ADD     |
00000e20  20 20 20 20 20 20 20 72  31 32 2c 72 31 32 2c 72  |       r12,r12,r|
00000e30  36 0d 07 4e 04 0d 07 58  1e 4d 4f 56 20 20 20 20  |6..N...X.MOV    |
00000e40  20 20 20 20 20 20 20 20  72 32 2c 72 37 2c 41 53  |        r2,r7,AS|
00000e50  4c 23 38 0d 07 62 1e 4d  4f 56 20 20 20 20 20 20  |L#8..b.MOV      |
00000e60  20 20 20 20 20 20 72 33  2c 72 37 2c 41 53 4c 23  |      r3,r7,ASL#|
00000e70  36 0d 07 6c 1b 41 44 44  20 20 20 20 20 20 20 20  |6..l.ADD        |
00000e80  20 20 20 20 72 32 2c 72  32 2c 72 33 0d 07 76 1d  |    r2,r2,r3..v.|
00000e90  41 44 44 20 20 20 20 20  20 20 20 20 20 20 20 72  |ADD            r|
00000ea0  31 32 2c 72 31 32 2c 72  32 0d 07 80 04 0d 07 8a  |12,r12,r2.......|
00000eb0  1b 4d 4f 56 20 20 20 20  20 20 20 20 20 20 20 20  |.MOV            |
00000ec0  72 31 30 2c 23 32 35 35  0d 07 94 1c 53 54 52 42  |r10,#255....STRB|
00000ed0  20 20 20 20 20 20 20 20  20 20 20 72 31 30 2c 5b  |           r10,[|
00000ee0  72 31 32 5d 0d 07 9e 04  0d 07 a8 2a 4c 44 4d 46  |r12].......*LDMF|
00000ef0  41 20 20 20 20 20 20 20  20 20 20 28 73 70 29 21  |A          (sp)!|
00000f00  2c 7b 72 30 2d 72 31 30  2c 72 31 32 2c 6c 69 6e  |,{r0-r10,r12,lin|
00000f10  6b 7d 0d 07 b2 1a 4d 4f  56 20 20 20 20 20 20 20  |k}....MOV       |
00000f20  20 20 20 20 20 50 43 2c  6c 69 6e 6b 0d 07 bc 04  |     PC,link....|
00000f30  0d 07 c6 35 2e 73 77 6d  5f 72 64 69 76 5f 6c 69  |...5.swm_rdiv_li|
00000f40  73 74 5f 62 61 73 65 25  20 20 20 20 20 20 20 20  |st_base%        |
00000f50  20 20 45 51 55 44 20 73  77 6d 5f 72 64 69 76 5f  |  EQUD swm_rdiv_|
00000f60  6c 69 73 74 25 0d 07 d0  04 0d 07 da 04 0d 07 e4  |list%...........|
00000f70  04 0d 07 ee 04 0d 07 f8  04 0d 08 02 12 2e 74 65  |..............te|
00000f80  78 5f 73 63 61 6e 5f 6c  69 6e 65 0d 08 0c 20 3b  |x_scan_line... ;|
00000f90  20 72 30 20 69 73 20 78  20 63 6f 6f 72 64 20 6f  | r0 is x coord o|
00000fa0  66 20 73 63 61 6e 20 6c  69 6e 65 0d 08 16 13 3b  |f scan line....;|
00000fb0  20 72 31 20 69 73 20 79  20 63 6f 6f 72 64 0d 08  | r1 is y coord..|
00000fc0  20 12 3b 20 72 32 20 69  73 20 6c 65 6e 67 74 68  | .; r2 is length|
00000fd0  0d 08 2a 13 3b 20 72 33  20 69 73 20 73 74 61 72  |..*.; r3 is star|
00000fe0  74 20 75 0d 08 34 19 3b  20 72 34 20 69 73 20 73  |t u..4.; r4 is s|
00000ff0  74 61 72 74 20 76 20 2a  20 32 35 36 0d 08 3e 11  |tart v * 256..>.|
00001000  3b 20 72 35 20 69 73 20  65 6e 64 20 75 0d 08 48  |; r5 is end u..H|
00001010  17 3b 20 72 36 20 69 73  20 65 6e 64 20 76 20 2a  |.; r6 is end v *|
00001020  20 32 35 36 0d 08 52 04  0d 08 5c 2a 53 54 4d 46  | 256..R...\*STMF|
00001030  41 20 20 20 20 20 20 20  20 20 20 28 73 70 29 21  |A          (sp)!|
00001040  2c 7b 72 30 2d 72 31 30  2c 72 31 32 2c 6c 69 6e  |,{r0-r10,r12,lin|
00001050  6b 7d 0d 08 66 22 4c 44  52 20 20 20 20 20 20 20  |k}..f"LDR       |
00001060  20 20 20 20 20 72 31 32  2c 73 63 72 65 65 6e 5f  |     r12,screen_|
00001070  61 64 72 25 0d 08 70 32  41 44 44 20 20 20 20 20  |adr%..p2ADD     |
00001080  20 20 20 20 20 20 20 72  31 32 2c 72 31 32 2c 72  |       r12,r12,r|
00001090  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
000010a0  20 3b 20 2b 20 78 0d 08  7a 36 4d 4f 56 20 20 20  | ; + x..z6MOV   |
000010b0  20 20 20 20 20 20 20 20  20 72 37 2c 72 31 2c 41  |         r7,r1,A|
000010c0  53 4c 23 38 20 20 20 20  20 20 20 20 20 20 20 20  |SL#8            |
000010d0  20 20 20 3b 20 79 20 2a  20 32 35 36 0d 08 84 35  |   ; y * 256...5|
000010e0  4d 4f 56 20 20 20 20 20  20 20 20 20 20 20 20 72  |MOV            r|
000010f0  38 2c 72 31 2c 41 53 4c  23 36 20 20 20 20 20 20  |8,r1,ASL#6      |
00001100  20 20 20 20 20 20 20 20  20 3b 20 79 20 2a 20 36  |         ; y * 6|
00001110  34 0d 08 8e 47 41 44 44  20 20 20 20 20 20 20 20  |4...GADD        |
00001120  20 20 20 20 72 37 2c 72  37 2c 72 38 20 20 20 20  |    r7,r7,r8    |
00001130  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00001140  28 79 2a 36 34 29 20 2b  20 28 79 2a 32 35 36 29  |(y*64) + (y*256)|
00001150  20 3d 20 79 2a 33 32 30  0d 08 98 4d 41 44 44 20  | = y*320...MADD |
00001160  20 20 20 20 20 20 20 20  20 20 20 72 31 32 2c 72  |           r12,r|
00001170  31 32 2c 72 37 20 20 20  20 20 20 20 20 20 20 20  |12,r7           |
00001180  20 20 20 20 20 3b 20 72  31 32 20 69 73 20 66 69  |     ; r12 is fi|
00001190  6e 61 6c 20 61 64 72 20  6f 66 20 6c 69 6e 65 20  |nal adr of line |
000011a0  73 74 61 72 74 0d 08 a2  04 0d 08 ac 2d 4c 44 52  |start.......-LDR|
000011b0  20 20 20 20 20 20 20 20  20 20 20 20 72 39 2c 70  |            r9,p|
000011c0  6f 6c 79 67 6f 6e 5f 77  6f 72 6b 73 70 61 63 65  |olygon_workspace|
000011d0  5f 62 61 73 65 25 0d 08  b6 3e 4c 44 52 20 20 20  |_base%...>LDR   |
000011e0  20 20 20 20 20 20 20 20  20 72 31 30 2c 5b 72 39  |         r10,[r9|
000011f0  2c 23 33 36 5d 20 20 20  20 20 20 20 20 20 20 20  |,#36]           |
00001200  20 20 20 3b 20 62 61 73  65 20 6f 66 20 74 65 78  |   ; base of tex|
00001210  74 75 72 65 0d 08 c0 3a  4c 44 52 20 20 20 20 20  |ture...:LDR     |
00001220  20 20 20 20 20 20 20 72  30 2c 5b 72 39 2c 23 33  |       r0,[r9,#3|
00001230  32 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |2]              |
00001240  20 3b 20 72 65 6e 64 65  72 20 74 79 70 65 0d 08  | ; render type..|
00001250  ca 24 41 44 44 20 20 20  20 20 20 20 20 20 20 20  |.$ADD           |
00001260  20 72 31 30 2c 72 31 30  2c 72 30 2c 41 53 4c 23  | r10,r10,r0,ASL#|
00001270  31 30 0d 08 d4 04 0d 08  de 3c 53 55 42 20 20 20  |10.......<SUB   |
00001280  20 20 20 20 20 20 20 20  20 72 35 2c 72 35 2c 72  |         r5,r5,r|
00001290  33 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |3               |
000012a0  20 20 20 3b 20 72 35 20  69 73 20 78 32 20 2d 20  |   ; r5 is x2 - |
000012b0  78 31 0d 08 e8 43 4d 4f  56 20 20 20 20 20 20 20  |x1...CMOV       |
000012c0  20 20 20 20 20 72 33 2c  72 33 2c 41 53 4c 23 38  |     r3,r3,ASL#8|
000012d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
000012e0  72 33 20 69 73 20 73 63  61 6c 65 64 20 75 70 20  |r3 is scaled up |
000012f0  78 20 70 6f 73 0d 08 f2  45 a4 73 77 6d 5f 72 64  |x pos...E.swm_rd|
00001300  69 76 5f 73 63 61 38 28  35 2c 32 2c 37 29 20 20  |iv_sca8(5,2,7)  |
00001310  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001320  20 20 20 20 20 20 20 3b  20 72 37 20 69 73 20 78  |       ; r7 is x|
00001330  20 73 74 65 70 20 73 69  7a 65 0d 08 fc 04 0d 09  | step size......|
00001340  06 3c 53 55 42 20 20 20  20 20 20 20 20 20 20 20  |.<SUB           |
00001350  20 72 36 2c 72 36 2c 72  34 20 20 20 20 20 20 20  | r6,r6,r4       |
00001360  20 20 20 20 20 20 20 20  20 20 20 3b 20 72 36 20  |           ; r6 |
00001370  69 73 20 79 32 20 2d 20  79 31 0d 09 10 43 4d 4f  |is y2 - y1...CMO|
00001380  56 20 20 20 20 20 20 20  20 20 20 20 20 72 34 2c  |V            r4,|
00001390  72 34 2c 41 53 4c 23 38  20 20 20 20 20 20 20 20  |r4,ASL#8        |
000013a0  20 20 20 20 20 20 20 3b  20 72 34 20 69 73 20 73  |       ; r4 is s|
000013b0  63 61 6c 65 20 75 70 20  79 20 70 6f 73 0d 09 1a  |cale up y pos...|
000013c0  45 a4 73 77 6d 5f 72 64  69 76 5f 73 63 61 38 28  |E.swm_rdiv_sca8(|
000013d0  36 2c 32 2c 38 29 20 20  20 20 20 20 20 20 20 20  |6,2,8)          |
000013e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000013f0  20 72 38 20 69 73 20 79  20 73 74 65 70 20 73 69  | r8 is y step si|
00001400  7a 65 0d 09 24 04 0d 09  2e 04 0d 09 38 04 0d 09  |ze..$.......8...|
00001410  42 17 2e 74 65 78 5f 73  63 61 6e 5f 6c 69 6e 65  |B..tex_scan_line|
00001420  5f 6c 6f 6f 70 0d 09 4c  1f 4d 4f 56 20 20 20 20  |_loop..L.MOV    |
00001430  20 20 20 20 20 20 20 20  72 30 2c 72 33 2c 41 53  |        r0,r3,AS|
00001440  52 23 31 36 0d 09 56 1f  4d 4f 56 20 20 20 20 20  |R#16..V.MOV     |
00001450  20 20 20 20 20 20 20 72  31 2c 72 34 2c 41 53 52  |       r1,r4,ASR|
00001460  23 31 36 0d 09 60 20 84  52 20 20 20 20 20 20 20  |#16..` .R       |
00001470  20 20 20 20 20 72 30 2c  72 30 2c 72 31 2c 4c 53  |     r0,r0,r1,LS|
00001480  4c 23 35 0d 09 6a 04 0d  09 74 1e 4c 44 52 42 20  |L#5..j...t.LDRB |
00001490  20 20 20 20 20 20 20 20  20 20 72 39 2c 5b 72 31  |          r9,[r1|
000014a0  30 2c 72 30 5d 0d 09 7e  1e 53 54 52 42 20 20 20  |0,r0]..~.STRB   |
000014b0  20 20 20 20 20 20 20 20  72 39 2c 5b 72 31 32 5d  |        r9,[r12]|
000014c0  2c 23 31 0d 09 88 04 0d  09 92 04 0d 09 9c 3f 41  |,#1...........?A|
000014d0  44 44 20 20 20 20 20 20  20 20 20 20 20 20 72 33  |DD            r3|
000014e0  2c 72 33 2c 72 37 20 20  20 20 20 20 20 20 20 20  |,r3,r7          |
000014f0  20 20 20 20 20 20 3b 20  73 63 61 6c 65 64 20 78  |      ; scaled x|
00001500  20 2b 3d 20 78 20 73 74  65 70 0d 09 a6 3f 41 44  | += x step...?AD|
00001510  44 20 20 20 20 20 20 20  20 20 20 20 20 72 34 2c  |D            r4,|
00001520  72 34 2c 72 38 20 20 20  20 20 20 20 20 20 20 20  |r4,r8           |
00001530  20 20 20 20 20 3b 20 73  63 61 6c 65 64 20 79 20  |     ; scaled y |
00001540  2b 3d 20 79 20 73 74 65  70 0d 09 b0 04 0d 09 ba  |+= y step.......|
00001550  1b 53 55 42 53 20 20 20  20 20 20 20 20 20 20 20  |.SUBS           |
00001560  72 32 2c 72 32 2c 23 31  0d 09 c4 25 42 47 54 20  |r2,r2,#1...%BGT |
00001570  20 20 20 20 20 20 20 20  20 20 20 74 65 78 5f 73  |           tex_s|
00001580  63 61 6e 5f 6c 69 6e 65  5f 6c 6f 6f 70 0d 09 ce  |can_line_loop...|
00001590  04 0d 09 d8 16 2e 65 6e  64 5f 74 65 78 5f 73 63  |......end_tex_sc|
000015a0  61 6e 5f 6c 69 6e 65 0d  09 e2 2a 4c 44 4d 46 41  |an_line...*LDMFA|
000015b0  20 20 20 20 20 20 20 20  20 20 28 73 70 29 21 2c  |          (sp)!,|
000015c0  7b 72 30 2d 72 31 30 2c  72 31 32 2c 6c 69 6e 6b  |{r0-r10,r12,link|
000015d0  7d 0d 09 ec 1a 4d 4f 56  20 20 20 20 20 20 20 20  |}....MOV        |
000015e0  20 20 20 20 50 43 2c 6c  69 6e 6b 0d 09 f6 04 0d  |    PC,link.....|
000015f0  0a 00 04 0d 0a 0a 04 0d  0a 14 37 2e 70 6f 6c 79  |..........7.poly|
00001600  67 6f 6e 5f 77 6f 72 6b  73 70 61 63 65 5f 62 61  |gon_workspace_ba|
00001610  73 65 25 20 20 20 20 45  51 55 44 20 70 6f 6c 79  |se%    EQUD poly|
00001620  67 6f 6e 5f 77 6f 72 6b  73 70 61 63 65 25 0d 0a  |gon_workspace%..|
00001630  1e 17 2e 70 6f 6c 79 67  6f 6e 5f 77 6f 72 6b 73  |...polygon_works|
00001640  70 61 63 65 25 0d 0a 28  1c 45 51 55 44 20 32 30  |pace%..(.EQUD 20|
00001650  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 70  |             ; p|
00001660  30 0d 0a 32 0b 45 51 55  44 20 33 30 0d 0a 3c 04  |0..2.EQUD 30..<.|
00001670  0d 0a 46 1a 45 51 55 44  20 30 20 20 20 20 20 20  |..F.EQUD 0      |
00001680  20 20 20 20 20 20 3b 20  70 31 0d 0a 50 0c 45 51  |      ; p1..P.EQ|
00001690  55 44 20 31 38 30 0d 0a  5a 04 0d 0a 64 1c 45 51  |UD 180..Z...d.EQ|
000016a0  55 44 20 31 32 30 20 20  20 20 20 20 20 20 20 20  |UD 120          |
000016b0  20 20 3b 20 70 32 0d 0a  6e 0c 45 51 55 44 20 32  |  ; p2..n.EQUD 2|
000016c0  32 30 0d 0a 78 04 0d 0a  82 1c 45 51 55 44 20 39  |20..x.....EQUD 9|
000016d0  30 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |0             ; |
000016e0  70 33 0d 0a 8c 0b 45 51  55 44 20 32 30 0d 0a 96  |p3....EQUD 20...|
000016f0  04 0d 0a a0 24 45 51 55  44 20 30 20 20 20 20 20  |....$EQUD 0     |
00001700  20 20 20 20 20 20 20 20  3b 20 72 65 6e 64 65 72  |        ; render|
00001710  20 74 79 70 65 0d 0a aa  29 45 51 55 44 20 74 65  | type...)EQUD te|
00001720  78 74 75 72 65 73 25 20  20 20 20 20 3b 20 62 61  |xtures%     ; ba|
00001730  73 65 20 6f 66 20 74 65  78 74 75 72 65 73 0d 0a  |se of textures..|
00001740  b4 04 0d 0a be 12 45 51  55 44 20 6c 68 73 5f 6c  |......EQUD lhs_l|
00001750  69 73 74 25 0d 0a c8 12  45 51 55 44 20 72 68 73  |ist%....EQUD rhs|
00001760  5f 6c 69 73 74 25 0d 0a  d2 04 0d 0a dc 04 0d 0a  |_list%..........|
00001770  e6 53 3b 20 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.S; ------------|
00001780  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 20 67 6c 6f 62  |----------- glob|
00001790  61 6c 20 6c 69 73 74 20  61 64 64 72 65 73 73 65  |al list addresse|
000017a0  73 20 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |s --------------|
000017b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000017c0  2d 0d 0a f0 04 0d 0a fa  38 2e 73 77 6d 5f 72 64  |-.......8.swm_rd|
000017d0  69 76 5f 6c 69 73 74 5f  62 61 73 65 25 20 20 20  |iv_list_base%   |
000017e0  20 20 20 20 20 20 20 20  20 20 45 51 55 44 20 73  |          EQUD s|
000017f0  77 6d 5f 72 64 69 76 5f  6c 69 73 74 25 0d 0b 04  |wm_rdiv_list%...|
00001800  04 0d 0b 0e 04 0d 0b 18  04 0d 0b 22 04 0d 0b 2c  |..........."...,|
00001810  05 5d 0d 0b 36 0b ed 20  70 61 73 73 25 0d 0b 40  |.]..6.. pass%..@|
00001820  04 0d 0b 4a 05 e1 0d 0b  54 04 0d 0b 5e 04 0d 0b  |...J....T...^...|
00001830  68 04 0d 0b 72 57 f4 20  2d 2d 2d 2d 2d 2d 2d 2d  |h...rW. --------|
00001840  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001850  2d 2d 2d 20 33 64 20 6f  62 6a 65 63 74 20 68 61  |--- 3d object ha|
00001860  6e 64 6c 65 72 73 20 2d  2d 2d 2d 2d 2d 2d 2d 2d  |ndlers ---------|
00001870  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001880  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 0b 7c 04 0d 0b 86  |---------..|....|
00001890  1a dd f2 61 73 73 65 6d  62 6c 65 5f 33 64 5f 68  |...assemble_3d_h|
000018a0  61 6e 64 6c 65 72 73 0d  0b 90 04 0d 0b 9a 18 ea  |andlers.........|
000018b0  20 61 64 72 25 2c 70 61  73 73 25 2c 6c 69 6e 6b  | adr%,pass%,link|
000018c0  2c 73 70 0d 0b a4 04 0d  0b ae 0b 6c 69 6e 6b 3d  |,sp........link=|
000018d0  31 34 0d 0b b8 09 73 70  3d 31 31 0d 0b c2 04 0d  |14....sp=11.....|
000018e0  0b cc 22 f4 20 63 6f 6e  74 69 6e 75 65 73 20 6f  |..". continues o|
000018f0  6e 20 69 6e 20 63 6f 64  65 25 20 6d 65 6d 6f 72  |n in code% memor|
00001900  79 0d 0b d6 04 0d 0b e0  0b 61 64 72 25 3d 50 25  |y........adr%=P%|
00001910  0d 0b ea 04 0d 0b f4 04  0d 0b fe 04 0d 0c 08 16  |................|
00001920  e3 20 70 61 73 73 25 3d  38 20 b8 20 31 30 20 88  |. pass%=8 . 10 .|
00001930  20 32 0d 0c 12 04 0d 0c  1c 0b 50 25 3d 61 64 72  | 2........P%=adr|
00001940  25 0d 0c 26 13 4c 25 3d  63 6f 64 65 25 20 2b 20  |%..&.L%=code% + |
00001950  6c 65 6e 25 0d 0c 30 04  0d 0c 3a 0f 5b 20 4f 50  |len%..0...:.[ OP|
00001960  54 20 70 61 73 73 25 0d  0c 44 04 0d 0c 4e 5d 3b  |T pass%..D...N];|
00001970  20 41 64 64 72 65 73 73  65 73 20 61 6c 72 65 61  | Addresses alrea|
00001980  64 79 20 75 73 65 64 20  28 20 69 6e 20 66 72 6f  |dy used ( in fro|
00001990  6e 74 20 6f 66 20 63 6f  64 65 20 73 6f 20 69 74  |nt of code so it|
000019a0  20 69 74 20 75 73 65 73  20 74 68 65 73 65 20 69  | it uses these i|
000019b0  6e 73 74 65 61 64 20 6f  66 20 74 68 65 20 70 72  |nstead of the pr|
000019c0  65 76 69 6f 75 73 20 29  0d 0c 58 04 0d 0c 62 39  |evious )..X...b9|
000019d0  2e 70 6f 6c 79 67 6f 6e  5f 77 6f 72 6b 73 70 61  |.polygon_workspa|
000019e0  63 65 5f 62 61 73 65 25  20 20 20 20 20 20 45 51  |ce_base%      EQ|
000019f0  55 44 20 70 6f 6c 79 67  6f 6e 5f 77 6f 72 6b 73  |UD polygon_works|
00001a00  70 61 63 65 25 0d 0c 6c  35 2e 73 77 6d 5f 72 64  |pace%..l5.swm_rd|
00001a10  69 76 5f 6c 69 73 74 5f  62 61 73 65 25 20 20 20  |iv_list_base%   |
00001a20  20 20 20 20 20 20 20 45  51 55 44 20 73 77 6d 5f  |       EQUD swm_|
00001a30  72 64 69 76 5f 6c 69 73  74 25 0d 0c 76 04 0d 0c  |rdiv_list%..v...|
00001a40  80 04 0d 0c 8a 32 2e 73  69 6e 65 5f 74 61 62 6c  |.....2.sine_tabl|
00001a50  65 5f 62 61 73 65 25 20  20 20 20 20 20 20 20 20  |e_base%         |
00001a60  20 20 20 20 45 51 55 44  20 73 69 6e 65 5f 74 61  |    EQUD sine_ta|
00001a70  62 6c 65 25 0d 0c 94 34  2e 63 6f 73 69 6e 65 5f  |ble%...4.cosine_|
00001a80  74 61 62 6c 65 5f 62 61  73 65 25 20 20 20 20 20  |table_base%     |
00001a90  20 20 20 20 20 20 45 51  55 44 20 63 6f 73 69 6e  |      EQUD cosin|
00001aa0  65 5f 74 61 62 6c 65 25  0d 0c 9e 39 2e 63 72 61  |e_table%...9.cra|
00001ab0  66 74 5f 68 65 61 64 65  72 5f 6c 69 73 74 5f 62  |ft_header_list_b|
00001ac0  61 73 65 25 20 20 20 20  20 20 45 51 55 44 20 63  |ase%      EQUD c|
00001ad0  72 61 66 74 5f 68 65 61  64 65 72 5f 6c 69 73 74  |raft_header_list|
00001ae0  25 0d 0c a8 04 0d 0c b2  2a 2e 73 63 72 65 65 6e  |%.......*.screen|
00001af0  5f 78 5f 6f 72 69 67 69  6e 25 20 20 20 20 20 20  |_x_origin%      |
00001b00  20 20 20 20 20 20 20 45  51 55 44 20 31 36 30 0d  |       EQUD 160.|
00001b10  0c bc 2a 2e 73 63 72 65  65 6e 5f 79 5f 6f 72 69  |..*.screen_y_ori|
00001b20  67 69 6e 25 20 20 20 20  20 20 20 20 20 20 20 20  |gin%            |
00001b30  20 45 51 55 44 20 31 32  38 0d 0c c6 04 0d 0c d0  | EQUD 128.......|
00001b40  04 0d 0c da 04 0d 0c e4  20 3b 20 72 30 20 69 73  |........ ; r0 is|
00001b50  20 63 72 61 66 74 20 6e  6f 2e 20 74 6f 20 70 72  | craft no. to pr|
00001b60  6f 6a 65 63 74 0d 0c ee  12 2e 70 72 6f 6a 65 63  |oject.....projec|
00001b70  74 5f 63 72 61 66 74 0d  0c f8 2f 53 54 4d 46 41  |t_craft.../STMFA|
00001b80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 28  |               (|
00001b90  73 70 29 21 2c 7b 72 30  2d 72 31 30 2c 72 31 32  |sp)!,{r0-r10,r12|
00001ba0  2c 6c 69 6e 6b 7d 0d 0d  02 04 0d 0d 0c 3b 3b 20  |,link}.......;; |
00001bb0  72 6f 74 61 74 65 20 6f  72 69 67 69 6e 61 6c 20  |rotate original |
00001bc0  64 61 74 61 20 61 72 6f  75 6e 64 20 7a 20 61 6e  |data around z an|
00001bd0  64 20 70 75 74 20 69 6e  74 6f 20 74 72 61 6e 73  |d put into trans|
00001be0  20 64 61 74 61 0d 0d 16  04 0d 0d 20 33 4c 44 52  | data...... 3LDR|
00001bf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001c00  20 72 31 30 2c 63 72 61  66 74 5f 68 65 61 64 65  | r10,craft_heade|
00001c10  72 5f 6c 69 73 74 5f 62  61 73 65 25 0d 0d 2a 53  |r_list_base%..*S|
00001c20  4c 44 52 20 20 20 20 20  20 20 20 20 20 20 20 20  |LDR             |
00001c30  20 20 20 20 72 31 32 2c  5b 72 31 30 2c 72 30 2c  |    r12,[r10,r0,|
00001c40  41 53 4c 23 32 5d 20 20  20 20 20 20 20 20 20 20  |ASL#2]          |
00001c50  3b 20 72 31 30 20 69 73  20 68 65 61 64 65 72 20  |; r10 is header |
00001c60  6f 66 20 63 72 61 66 74  20 6e 6f 2e 20 72 30 0d  |of craft no. r0.|
00001c70  0d 34 53 4c 44 52 20 20  20 20 20 20 20 20 20 20  |.4SLDR          |
00001c80  20 20 20 20 20 20 20 72  31 30 2c 5b 72 31 32 2c  |       r10,[r12,|
00001c90  23 35 32 5d 20 20 20 20  20 20 20 20 20 20 20 20  |#52]            |
00001ca0  20 20 20 3b 20 72 31 30  20 69 73 20 6e 6f 2e 20  |   ; r10 is no. |
00001cb0  6f 66 20 70 6f 69 6e 74  73 20 69 6e 20 63 72 61  |of points in cra|
00001cc0  66 74 0d 0d 3e 04 0d 0d  48 4d 4c 44 52 20 20 20  |ft..>...HMLDR   |
00001cd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 38  |              r8|
00001ce0  2c 5b 72 31 32 2c 23 36  30 5d 20 20 20 20 20 20  |,[r12,#60]      |
00001cf0  20 20 20 20 20 20 20 20  20 20 3b 20 72 38 20 69  |          ; r8 i|
00001d00  73 20 62 61 73 65 20 6f  66 20 6f 72 69 67 20 64  |s base of orig d|
00001d10  61 74 61 0d 0d 52 4e 4c  44 52 20 20 20 20 20 20  |ata..RNLDR      |
00001d20  20 20 20 20 20 20 20 20  20 20 20 72 39 2c 5b 72  |           r9,[r|
00001d30  31 32 2c 23 36 34 5d 20  20 20 20 20 20 20 20 20  |12,#64]         |
00001d40  20 20 20 20 20 20 20 3b  20 72 39 20 69 73 20 62  |       ; r9 is b|
00001d50  61 73 65 20 6f 66 20 74  72 61 6e 73 20 64 61 74  |ase of trans dat|
00001d60  61 0d 0d 5c 04 0d 0d 66  2d 4c 44 52 20 20 20 20  |a..\...f-LDR    |
00001d70  20 20 20 20 20 20 20 20  20 20 20 20 20 72 30 2c  |             r0,|
00001d80  63 6f 73 69 6e 65 5f 74  61 62 6c 65 5f 62 61 73  |cosine_table_bas|
00001d90  65 25 0d 0d 70 2b 4c 44  52 20 20 20 20 20 20 20  |e%..p+LDR       |
00001da0  20 20 20 20 20 20 20 20  20 20 72 31 2c 73 69 6e  |          r1,sin|
00001db0  65 5f 74 61 62 6c 65 5f  62 61 73 65 25 0d 0d 7a  |e_table_base%..z|
00001dc0  04 0d 0d 84 3b 4c 44 52  20 20 20 20 20 20 20 20  |....;LDR        |
00001dd0  20 20 20 20 20 20 20 20  20 72 35 2c 5b 72 31 32  |         r5,[r12|
00001de0  2c 23 34 30 5d 20 20 20  20 20 20 20 20 20 20 20  |,#40]           |
00001df0  20 20 20 20 20 3b 20 7a  20 72 6f 74 0d 0d 8e 04  |     ; z rot....|
00001e00  0d 0d 98 49 4c 44 52 20  20 20 20 20 20 20 20 20  |...ILDR         |
00001e10  20 20 20 20 20 20 20 20  72 36 2c 5b 72 30 2c 72  |        r6,[r0,r|
00001e20  35 2c 41 53 4c 23 32 5d  20 20 20 20 20 20 20 20  |5,ASL#2]        |
00001e30  20 20 20 20 3b 20 72 36  20 69 73 20 63 20 20 20  |    ; r6 is c   |
00001e40  28 20 2a 20 32 35 36 20  29 0d 0d a2 49 4c 44 52  |( * 256 )...ILDR|
00001e50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001e60  20 72 37 2c 5b 72 31 2c  72 35 2c 41 53 4c 23 32  | r7,[r1,r5,ASL#2|
00001e70  5d 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 72  |]            ; r|
00001e80  37 20 69 73 20 73 20 20  20 28 20 2a 20 32 35 36  |7 is s   ( * 256|
00001e90  20 29 0d 0d ac 04 0d 0d  b6 04 0d 0d c0 1f 3b 20  | )............; |
00001ea0  58 20 3d 20 28 20 78 20  2a 20 63 20 29 20 2d 20  |X = ( x * c ) - |
00001eb0  28 20 79 20 2a 20 73 20  29 0d 0d ca 1f 3b 20 59  |( y * s )....; Y|
00001ec0  20 3d 20 28 20 79 20 2a  20 63 20 29 20 2b 20 28  | = ( y * c ) + (|
00001ed0  20 78 20 2a 20 73 20 29  0d 0d d4 21 2e 72 6f 74  | x * s )...!.rot|
00001ee0  61 74 65 5f 63 72 61 66  74 5f 6f 72 69 67 69 6e  |ate_craft_origin|
00001ef0  61 6c 5f 64 61 74 61 5f  7a 0d 0d de 37 4c 44 52  |al_data_z...7LDR|
00001f00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001f10  20 72 30 2c 5b 72 38 5d  2c 23 34 20 20 20 20 20  | r0,[r8],#4     |
00001f20  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 78  |             ; x|
00001f30  0d 0d e8 37 4c 44 52 20  20 20 20 20 20 20 20 20  |...7LDR         |
00001f40  20 20 20 20 20 20 20 20  72 31 2c 5b 72 38 5d 2c  |        r1,[r8],|
00001f50  23 34 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#4              |
00001f60  20 20 20 20 3b 20 79 0d  0d f2 04 0d 0d fc 37 4c  |    ; y.......7L|
00001f70  44 52 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |DR              |
00001f80  20 20 20 72 32 2c 5b 72  38 5d 2c 23 34 20 20 20  |   r2,[r8],#4   |
00001f90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00001fa0  20 7a 0d 0e 06 3d 53 54  52 20 20 20 20 20 20 20  | z...=STR       |
00001fb0  20 20 20 20 20 20 20 20  20 20 72 32 2c 5b 72 39  |          r2,[r9|
00001fc0  2c 23 38 5d 20 20 20 20  20 20 20 20 20 20 20 20  |,#8]            |
00001fd0  20 20 20 20 20 20 3b 20  73 74 6f 72 65 20 7a 0d  |      ; store z.|
00001fe0  0e 10 04 0d 0e 1a 42 4d  55 4c 20 20 20 20 20 20  |......BMUL      |
00001ff0  20 20 20 20 20 20 20 20  20 20 20 72 32 2c 72 30  |           r2,r0|
00002000  2c 72 36 20 20 20 20 20  20 20 20 20 20 20 20 20  |,r6             |
00002010  20 20 20 20 20 20 20 3b  20 72 32 20 3d 20 28 78  |       ; r2 = (x|
00002020  20 2a 20 63 29 0d 0e 24  42 4d 55 4c 20 20 20 20  | * c)..$BMUL    |
00002030  20 20 20 20 20 20 20 20  20 20 20 20 20 72 33 2c  |             r3,|
00002040  72 31 2c 72 37 20 20 20  20 20 20 20 20 20 20 20  |r1,r7           |
00002050  20 20 20 20 20 20 20 20  20 3b 20 72 33 20 3d 20  |         ; r3 = |
00002060  28 79 20 2a 20 73 29 0d  0e 2e 5d 53 55 42 20 20  |(y * s)...]SUB  |
00002070  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 72  |               r|
00002080  34 2c 72 32 2c 72 33 20  20 20 20 20 20 20 20 20  |4,r2,r3         |
00002090  20 20 20 20 20 20 20 20  20 20 20 3b 20 72 34 20  |           ; r4 |
000020a0  3d 20 28 78 20 2a 20 63  29 20 2d 20 28 79 20 2a  |= (x * c) - (y *|
000020b0  20 73 29 20 20 28 20 72  34 20 69 73 20 6e 65 77  | s)  ( r4 is new|
000020c0  20 78 20 29 0d 0e 38 42  4d 4f 56 20 20 20 20 20  | x )..8BMOV     |
000020d0  20 20 20 20 20 20 20 20  20 20 20 20 72 34 2c 72  |            r4,r|
000020e0  34 2c 41 53 52 23 38 20  20 20 20 20 20 20 20 20  |4,ASR#8         |
000020f0  20 20 20 20 20 20 20 20  3b 20 73 63 61 6c 65 20  |        ; scale |
00002100  64 6f 77 6e 20 78 0d 0e  42 04 0d 0e 4c 53 53 54  |down x..B...LSST|
00002110  52 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R               |
00002120  20 20 72 34 2c 5b 72 39  5d 2c 23 34 20 20 20 20  |  r4,[r9],#4    |
00002130  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00002140  73 74 6f 72 65 20 78 20  61 6e 64 20 69 6e 63 20  |store x and inc |
00002150  74 6f 20 79 20 70 6f 73  69 74 69 6f 6e 0d 0e 56  |to y position..V|
00002160  04 0d 0e 60 44 4d 55 4c  20 20 20 20 20 20 20 20  |...`DMUL        |
00002170  20 20 20 20 20 20 20 20  20 72 32 2c 72 31 2c 72  |         r2,r1,r|
00002180  36 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |6               |
00002190  20 20 20 20 20 3b 20 72  32 20 3d 20 28 20 79 20  |     ; r2 = ( y |
000021a0  2a 20 63 20 29 0d 0e 6a  44 4d 55 4c 20 20 20 20  |* c )..jDMUL    |
000021b0  20 20 20 20 20 20 20 20  20 20 20 20 20 72 33 2c  |             r3,|
000021c0  72 30 2c 72 37 20 20 20  20 20 20 20 20 20 20 20  |r0,r7           |
000021d0  20 20 20 20 20 20 20 20  20 3b 20 72 33 20 3d 20  |         ; r3 = |
000021e0  28 20 78 20 2a 20 73 20  29 0d 0e 74 61 41 44 44  |( x * s )..taADD|
000021f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002200  20 72 34 2c 72 32 2c 72  33 20 20 20 20 20 20 20  | r4,r2,r3       |
00002210  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 72  |             ; r|
00002220  34 20 3d 20 28 20 79 20  2a 20 63 20 29 20 2b 20  |4 = ( y * c ) + |
00002230  28 20 78 20 2a 20 73 20  29 20 20 28 20 72 34 20  |( x * s )  ( r4 |
00002240  69 73 20 6e 65 77 20 79  20 29 0d 0e 7e 42 4d 4f  |is new y )..~BMO|
00002250  56 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |V               |
00002260  20 20 72 34 2c 72 34 2c  41 53 52 23 38 20 20 20  |  r4,r4,ASR#8   |
00002270  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00002280  73 63 61 6c 65 20 64 6f  77 6e 20 79 0d 0e 88 04  |scale down y....|
00002290  0d 0e 92 22 53 54 52 20  20 20 20 20 20 20 20 20  |..."STR         |
000022a0  20 20 20 20 20 20 20 20  72 34 2c 5b 72 39 5d 2c  |        r4,[r9],|
000022b0  23 38 0d 0e 9c 04 0d 0e  a6 22 53 55 42 53 20 20  |#8......."SUBS  |
000022c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 31  |              r1|
000022d0  30 2c 72 31 30 2c 23 31  0d 0e b0 34 42 47 54 20  |0,r10,#1...4BGT |
000022e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000022f0  72 6f 74 61 74 65 5f 63  72 61 66 74 5f 6f 72 69  |rotate_craft_ori|
00002300  67 69 6e 61 6c 5f 64 61  74 61 5f 7a 0d 0e ba 04  |ginal_data_z....|
00002310  0d 0e c4 04 0d 0e ce 04  0d 0e d8 04 0d 0e e2 3a  |...............:|
00002320  3b 20 72 6f 74 61 74 65  20 74 72 61 6e 73 20 64  |; rotate trans d|
00002330  61 74 61 20 61 72 6f 75  6e 64 20 79 20 61 6e 64  |ata around y and|
00002340  20 73 74 6f 72 65 20 69  6e 74 6f 20 74 72 61 6e  | store into tran|
00002350  73 20 64 61 74 61 0d 0e  ec 04 0d 0e f6 53 4c 44  |s data.......SLD|
00002360  52 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R               |
00002370  20 20 72 31 30 2c 5b 72  31 32 2c 23 35 32 5d 20  |  r10,[r12,#52] |
00002380  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00002390  72 31 30 20 69 73 20 6e  6f 2e 20 6f 66 20 70 6f  |r10 is no. of po|
000023a0  69 6e 74 73 20 69 6e 20  63 72 61 66 74 0d 0f 00  |ints in craft...|
000023b0  4e 4c 44 52 20 20 20 20  20 20 20 20 20 20 20 20  |NLDR            |
000023c0  20 20 20 20 20 72 39 2c  5b 72 31 32 2c 23 36 34  |     r9,[r12,#64|
000023d0  5d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |]               |
000023e0  20 3b 20 72 39 20 69 73  20 62 61 73 65 20 6f 66  | ; r9 is base of|
000023f0  20 74 72 61 6e 73 20 64  61 74 61 0d 0f 0a 04 0d  | trans data.....|
00002400  0f 14 2d 4c 44 52 20 20  20 20 20 20 20 20 20 20  |..-LDR          |
00002410  20 20 20 20 20 20 20 72  30 2c 63 6f 73 69 6e 65  |       r0,cosine|
00002420  5f 74 61 62 6c 65 5f 62  61 73 65 25 0d 0f 1e 2b  |_table_base%...+|
00002430  4c 44 52 20 20 20 20 20  20 20 20 20 20 20 20 20  |LDR             |
00002440  20 20 20 20 72 31 2c 73  69 6e 65 5f 74 61 62 6c  |    r1,sine_tabl|
00002450  65 5f 62 61 73 65 25 0d  0f 28 04 0d 0f 32 3b 4c  |e_base%..(...2;L|
00002460  44 52 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |DR              |
00002470  20 20 20 72 35 2c 5b 72  31 32 2c 23 33 36 5d 20  |   r5,[r12,#36] |
00002480  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00002490  20 79 20 72 6f 74 0d 0f  3c 04 0d 0f 46 49 4c 44  | y rot..<...FILD|
000024a0  52 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R               |
000024b0  20 20 72 36 2c 5b 72 30  2c 72 35 2c 41 53 4c 23  |  r6,[r0,r5,ASL#|
000024c0  32 5d 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |2]            ; |
000024d0  72 36 20 69 73 20 63 20  20 20 28 20 2a 20 32 35  |r6 is c   ( * 25|
000024e0  36 20 29 0d 0f 50 49 4c  44 52 20 20 20 20 20 20  |6 )..PILDR      |
000024f0  20 20 20 20 20 20 20 20  20 20 20 72 37 2c 5b 72  |           r7,[r|
00002500  31 2c 72 35 2c 41 53 4c  23 32 5d 20 20 20 20 20  |1,r5,ASL#2]     |
00002510  20 20 20 20 20 20 20 3b  20 72 37 20 69 73 20 73  |       ; r7 is s|
00002520  20 20 20 28 20 2a 20 32  35 36 20 29 0d 0f 5a 04  |   ( * 256 )..Z.|
00002530  0d 0f 64 1f 3b 20 58 20  3d 20 28 20 78 20 2a 20  |..d.; X = ( x * |
00002540  63 20 29 20 2d 20 28 20  7a 20 2a 20 73 20 29 0d  |c ) - ( z * s ).|
00002550  0f 6e 1f 3b 20 5a 20 3d  20 28 20 7a 20 2a 20 63  |.n.; Z = ( z * c|
00002560  20 29 20 2b 20 28 20 78  20 2a 20 73 20 29 0d 0f  | ) + ( x * s )..|
00002570  78 1e 2e 72 6f 74 61 74  65 5f 63 72 61 66 74 5f  |x..rotate_craft_|
00002580  74 72 61 6e 73 5f 64 61  74 61 5f 79 0d 0f 82 37  |trans_data_y...7|
00002590  4c 44 52 20 20 20 20 20  20 20 20 20 20 20 20 20  |LDR             |
000025a0  20 20 20 20 72 30 2c 5b  72 39 5d 20 20 20 20 20  |    r0,[r9]     |
000025b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000025c0  3b 20 78 0d 0f 8c 37 4c  44 52 20 20 20 20 20 20  |; x...7LDR      |
000025d0  20 20 20 20 20 20 20 20  20 20 20 72 31 2c 5b 72  |           r1,[r|
000025e0  39 2c 23 38 5d 20 20 20  20 20 20 20 20 20 20 20  |9,#8]           |
000025f0  20 20 20 20 20 20 20 3b  20 7a 0d 0f 96 04 0d 0f  |       ; z......|
00002600  a0 44 4d 55 4c 20 20 20  20 20 20 20 20 20 20 20  |.DMUL           |
00002610  20 20 20 20 20 20 72 32  2c 72 30 2c 72 36 20 20  |      r2,r0,r6  |
00002620  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002630  20 20 3b 20 72 32 20 3d  20 28 20 78 20 2a 20 63  |  ; r2 = ( x * c|
00002640  20 29 0d 0f aa 44 4d 55  4c 20 20 20 20 20 20 20  | )...DMUL       |
00002650  20 20 20 20 20 20 20 20  20 20 72 33 2c 72 31 2c  |          r3,r1,|
00002660  72 37 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |r7              |
00002670  20 20 20 20 20 20 3b 20  72 33 20 3d 20 28 20 7a  |      ; r3 = ( z|
00002680  20 2a 20 73 20 29 0d 0f  b4 5b 53 55 42 20 20 20  | * s )...[SUB   |
00002690  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 34  |              r4|
000026a0  2c 72 32 2c 72 33 20 20  20 20 20 20 20 20 20 20  |,r2,r3          |
000026b0  20 20 20 20 20 20 20 20  20 20 3b 20 72 34 20 3d  |          ; r4 =|
000026c0  20 28 20 78 20 2a 20 63  20 29 20 2d 20 28 20 7a  | ( x * c ) - ( z|
000026d0  20 2a 20 73 20 29 20 20  20 20 28 20 20 78 20 20  | * s )    (  x  |
000026e0  29 0d 0f be 49 4d 4f 56  20 20 20 20 20 20 20 20  |)...IMOV        |
000026f0  20 20 20 20 20 20 20 20  20 72 34 2c 72 34 2c 41  |         r4,r4,A|
00002700  53 52 23 38 20 20 20 20  20 20 20 20 20 20 20 20  |SR#8            |
00002710  20 20 20 20 20 3b 20 73  63 61 6c 65 20 64 6f 77  |     ; scale dow|
00002720  6e 20 78 20 62 79 20 32  35 36 0d 0f c8 04 0d 0f  |n x by 256......|
00002730  d2 22 53 54 52 20 20 20  20 20 20 20 20 20 20 20  |."STR           |
00002740  20 20 20 20 20 20 72 34  2c 5b 72 39 5d 2c 23 38  |      r4,[r9],#8|
00002750  0d 0f dc 04 0d 0f e6 44  4d 55 4c 20 20 20 20 20  |.......DMUL     |
00002760  20 20 20 20 20 20 20 20  20 20 20 20 72 32 2c 72  |            r2,r|
00002770  31 2c 72 36 20 20 20 20  20 20 20 20 20 20 20 20  |1,r6            |
00002780  20 20 20 20 20 20 20 20  3b 20 72 32 20 3d 20 28  |        ; r2 = (|
00002790  20 7a 20 2a 20 63 20 29  0d 0f f0 44 4d 55 4c 20  | z * c )...DMUL |
000027a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000027b0  72 33 2c 72 30 2c 72 37  20 20 20 20 20 20 20 20  |r3,r0,r7        |
000027c0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 72 33  |            ; r3|
000027d0  20 3d 20 28 20 78 20 2a  20 73 20 29 0d 0f fa 5a  | = ( x * s )...Z|
000027e0  41 44 44 20 20 20 20 20  20 20 20 20 20 20 20 20  |ADD             |
000027f0  20 20 20 20 72 34 2c 72  32 2c 72 33 20 20 20 20  |    r4,r2,r3    |
00002800  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002810  3b 20 72 34 20 3d 20 28  20 7a 20 2a 20 63 20 29  |; r4 = ( z * c )|
00002820  20 2b 20 28 20 78 20 2a  20 73 20 29 20 20 20 28  | + ( x * s )   (|
00002830  20 20 7a 20 20 29 0d 10  04 49 4d 4f 56 20 20 20  |  z  )...IMOV   |
00002840  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 34  |              r4|
00002850  2c 72 34 2c 41 53 52 23  38 20 20 20 20 20 20 20  |,r4,ASR#8       |
00002860  20 20 20 20 20 20 20 20  20 20 3b 20 73 63 61 6c  |          ; scal|
00002870  65 20 64 6f 77 6e 20 7a  20 62 79 20 32 35 36 0d  |e down z by 256.|
00002880  10 0e 04 0d 10 18 22 53  54 52 20 20 20 20 20 20  |......"STR      |
00002890  20 20 20 20 20 20 20 20  20 20 20 72 34 2c 5b 72  |           r4,[r|
000028a0  39 5d 2c 23 34 0d 10 22  04 0d 10 2c 22 53 55 42  |9],#4.."...,"SUB|
000028b0  53 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |S               |
000028c0  20 72 31 30 2c 72 31 30  2c 23 31 0d 10 36 31 42  | r10,r10,#1..61B|
000028d0  47 54 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |GT              |
000028e0  20 20 20 72 6f 74 61 74  65 5f 63 72 61 66 74 5f  |   rotate_craft_|
000028f0  74 72 61 6e 73 5f 64 61  74 61 5f 79 0d 10 40 04  |trans_data_y..@.|
00002900  0d 10 4a 04 0d 10 54 04  0d 10 5e 04 0d 10 68 04  |..J...T...^...h.|
00002910  0d 10 72 34 3b 20 70 72  6f 6a 65 63 74 20 74 72  |..r4; project tr|
00002920  61 6e 73 20 64 61 74 61  20 61 6e 64 20 73 74 6f  |ans data and sto|
00002930  72 65 20 69 6e 20 66 69  6e 61 6c 20 78 2c 79 20  |re in final x,y |
00002940  64 61 74 61 0d 10 7c 04  0d 10 86 53 4c 44 52 20  |data..|....SLDR |
00002950  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002960  72 31 30 2c 5b 72 31 32  2c 23 35 32 5d 20 20 20  |r10,[r12,#52]   |
00002970  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 72 31  |            ; r1|
00002980  30 20 69 73 20 6e 6f 2e  20 6f 66 20 70 6f 69 6e  |0 is no. of poin|
00002990  74 73 20 69 6e 20 63 72  61 66 74 0d 10 90 04 0d  |ts in craft.....|
000029a0  10 9a 4f 4c 44 52 20 20  20 20 20 20 20 20 20 20  |..OLDR          |
000029b0  20 20 20 20 20 20 20 72  38 2c 5b 72 31 32 2c 23  |       r8,[r12,#|
000029c0  36 34 5d 20 20 20 20 20  20 20 20 20 20 20 20 20  |64]             |
000029d0  20 20 20 20 3b 20 72 38  20 69 73 20 62 61 73 65  |    ; r8 is base|
000029e0  20 6f 66 20 74 72 61 6e  73 20 64 61 74 61 0d 10  | of trans data..|
000029f0  a4 4d 4c 44 52 20 20 20  20 20 20 20 20 20 20 20  |.MLDR           |
00002a00  20 20 20 20 20 20 72 39  2c 5b 72 31 32 2c 23 36  |      r9,[r12,#6|
00002a10  38 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |8]              |
00002a20  20 20 20 3b 20 72 39 20  69 73 20 62 61 73 65 20  |   ; r9 is base |
00002a30  6f 66 20 78 2c 79 20 64  61 74 61 0d 10 ae 04 0d  |of x,y data.....|
00002a40  10 b8 44 4c 44 52 20 20  20 20 20 20 20 20 20 20  |..DLDR          |
00002a50  20 20 20 20 20 20 20 72  33 2c 5b 72 31 32 2c 23  |       r3,[r12,#|
00002a60  30 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0]              |
00002a70  20 20 20 3b 20 78 20 70  6f 73 20 6f 66 20 63 72  |   ; x pos of cr|
00002a80  61 66 74 0d 10 c2 44 4c  44 52 20 20 20 20 20 20  |aft...DLDR      |
00002a90  20 20 20 20 20 20 20 20  20 20 20 72 34 2c 5b 72  |           r4,[r|
00002aa0  31 32 2c 23 34 5d 20 20  20 20 20 20 20 20 20 20  |12,#4]          |
00002ab0  20 20 20 20 20 20 20 3b  20 79 20 70 6f 73 20 6f  |       ; y pos o|
00002ac0  66 20 63 72 61 66 74 0d  10 cc 44 4c 44 52 20 20  |f craft...DLDR  |
00002ad0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 72  |               r|
00002ae0  35 2c 5b 72 31 32 2c 23  38 5d 20 20 20 20 20 20  |5,[r12,#8]      |
00002af0  20 20 20 20 20 20 20 20  20 20 20 3b 20 7a 20 70  |           ; z p|
00002b00  6f 73 20 6f 66 20 63 72  61 66 74 0d 10 d6 04 0d  |os of craft.....|
00002b10  10 e0 1d 2e 70 72 6f 6a  65 63 74 5f 63 72 61 66  |....project_craf|
00002b20  74 5f 74 72 61 6e 73 5f  64 61 74 61 0d 10 ea 37  |t_trans_data...7|
00002b30  4c 44 52 20 20 20 20 20  20 20 20 20 20 20 20 20  |LDR             |
00002b40  20 20 20 20 72 30 2c 5b  72 38 5d 2c 23 34 20 20  |    r0,[r8],#4  |
00002b50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002b60  3b 20 78 0d 10 f4 37 4c  44 52 20 20 20 20 20 20  |; x...7LDR      |
00002b70  20 20 20 20 20 20 20 20  20 20 20 72 31 2c 5b 72  |           r1,[r|
00002b80  38 5d 2c 23 34 20 20 20  20 20 20 20 20 20 20 20  |8],#4           |
00002b90  20 20 20 20 20 20 20 3b  20 79 0d 10 fe 37 4c 44  |       ; y...7LD|
00002ba0  52 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R               |
00002bb0  20 20 72 32 2c 5b 72 38  5d 2c 23 34 20 20 20 20  |  r2,[r8],#4    |
00002bc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00002bd0  7a 0d 11 08 04 0d 11 12  3e 41 44 44 20 20 20 20  |z.......>ADD    |
00002be0  20 20 20 20 20 20 20 20  20 20 20 20 20 72 30 2c  |             r0,|
00002bf0  72 30 2c 72 33 20 20 20  20 20 20 20 20 20 20 20  |r0,r3           |
00002c00  20 20 20 20 20 20 20 20  20 3b 20 6f 66 66 73 65  |         ; offse|
00002c10  74 20 78 0d 11 1c 3e 41  44 44 20 20 20 20 20 20  |t x...>ADD      |
00002c20  20 20 20 20 20 20 20 20  20 20 20 72 31 2c 72 31  |           r1,r1|
00002c30  2c 72 34 20 20 20 20 20  20 20 20 20 20 20 20 20  |,r4             |
00002c40  20 20 20 20 20 20 20 3b  20 6f 66 66 73 65 74 20  |       ; offset |
00002c50  79 0d 11 26 3e 41 44 44  20 20 20 20 20 20 20 20  |y..&>ADD        |
00002c60  20 20 20 20 20 20 20 20  20 72 32 2c 72 32 2c 72  |         r2,r2,r|
00002c70  35 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |5               |
00002c80  20 20 20 20 20 3b 20 6f  66 66 73 65 74 20 7a 0d  |     ; offset z.|
00002c90  11 30 04 0d 11 3a 4d 4d  4f 56 20 20 20 20 20 20  |.0...:MMOV      |
00002ca0  20 20 20 20 20 20 20 20  20 20 20 72 30 2c 72 30  |           r0,r0|
00002cb0  2c 41 53 4c 23 38 20 20  20 20 20 20 20 20 20 20  |,ASL#8          |
00002cc0  20 20 20 20 20 20 20 3b  20 73 63 61 6c 65 20 75  |       ; scale u|
00002cd0  70 20 78 20 61 6e 64 20  79 20 62 79 20 32 35 36  |p x and y by 256|
00002ce0  0d 11 44 23 4d 4f 56 20  20 20 20 20 20 20 20 20  |..D#MOV         |
00002cf0  20 20 20 20 20 20 20 20  72 31 2c 72 31 2c 41 53  |        r1,r1,AS|
00002d00  4c 23 38 0d 11 4e 04 0d  11 58 3a a4 73 77 6d 5f  |L#8..N...X:.swm_|
00002d10  72 64 69 76 5f 61 63 74  28 30 2c 32 2c 36 29 20  |rdiv_act(0,2,6) |
00002d20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002d30  20 20 20 20 20 20 20 20  20 20 3b 20 78 20 2f 20  |          ; x / |
00002d40  7a 0d 11 62 3a a4 73 77  6d 5f 72 64 69 76 5f 61  |z..b:.swm_rdiv_a|
00002d50  63 74 28 31 2c 32 2c 37  29 20 20 20 20 20 20 20  |ct(1,2,7)       |
00002d60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002d70  20 20 20 20 3b 20 79 20  2f 20 7a 0d 11 6c 04 0d  |    ; y / z..l..|
00002d80  11 76 22 41 44 44 20 20  20 20 20 20 20 20 20 20  |.v"ADD          |
00002d90  20 20 20 20 20 20 20 72  36 2c 72 36 2c 23 31 36  |       r6,r6,#16|
00002da0  30 0d 11 80 21 41 44 44  20 20 20 20 20 20 20 20  |0...!ADD        |
00002db0  20 20 20 20 20 20 20 20  20 72 37 2c 72 37 2c 23  |         r7,r7,#|
00002dc0  32 30 0d 11 8a 04 0d 11  94 22 53 54 52 20 20 20  |20......."STR   |
00002dd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 36  |              r6|
00002de0  2c 5b 72 39 5d 2c 23 34  0d 11 9e 22 53 54 52 20  |,[r9],#4..."STR |
00002df0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002e00  72 37 2c 5b 72 39 5d 2c  23 34 0d 11 a8 04 0d 11  |r7,[r9],#4......|
00002e10  b2 22 53 55 42 53 20 20  20 20 20 20 20 20 20 20  |."SUBS          |
00002e20  20 20 20 20 20 20 72 31  30 2c 72 31 30 2c 23 31  |      r10,r10,#1|
00002e30  0d 11 bc 30 42 47 54 20  20 20 20 20 20 20 20 20  |...0BGT         |
00002e40  20 20 20 20 20 20 20 20  70 72 6f 6a 65 63 74 5f  |        project_|
00002e50  63 72 61 66 74 5f 74 72  61 6e 73 5f 64 61 74 61  |craft_trans_data|
00002e60  0d 11 c6 04 0d 11 d0 04  0d 11 da 17 3b 20 70 6c  |............; pl|
00002e70  6f 74 20 63 72 61 66 74  20 66 61 63 65 74 73 0d  |ot craft facets.|
00002e80  11 e4 04 0d 11 ee 53 4c  44 52 20 20 20 20 20 20  |......SLDR      |
00002e90  20 20 20 20 20 20 20 20  20 20 20 72 31 30 2c 5b  |           r10,[|
00002ea0  72 31 32 2c 23 35 36 5d  20 20 20 20 20 20 20 20  |r12,#56]        |
00002eb0  20 20 20 20 20 20 20 3b  20 72 31 30 20 69 73 20  |       ; r10 is |
00002ec0  6e 6f 2e 20 6f 66 20 66  61 63 65 74 73 20 69 6e  |no. of facets in|
00002ed0  20 63 72 61 66 74 0d 11  f8 52 4c 44 52 20 20 20  | craft...RLDR   |
00002ee0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 39  |              r9|
00002ef0  2c 5b 72 31 32 2c 23 37  32 5d 20 20 20 20 20 20  |,[r12,#72]      |
00002f00  20 20 20 20 20 20 20 20  20 20 3b 20 72 39 20 69  |          ; r9 i|
00002f10  73 20 62 61 73 65 20 6f  66 20 72 65 6e 64 65 72  |s base of render|
00002f20  69 6e 67 20 64 61 74 61  0d 12 02 4c 4c 44 52 20  |ing data...LLDR |
00002f30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002f40  72 38 2c 5b 72 31 32 2c  23 36 38 5d 20 20 20 20  |r8,[r12,#68]    |
00002f50  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 72 38  |            ; r8|
00002f60  20 69 73 20 62 61 73 65  20 6f 66 20 78 2c 79 20  | is base of x,y |
00002f70  64 61 74 61 0d 12 0c 04  0d 12 16 04 0d 12 20 16  |data.......... .|
00002f80  2e 70 6c 6f 74 5f 63 72  61 66 74 5f 66 61 63 65  |.plot_craft_face|
00002f90  74 73 0d 12 2a 32 4c 44  52 20 20 20 20 20 20 20  |ts..*2LDR       |
00002fa0  20 20 20 20 20 20 20 20  20 20 72 37 2c 70 6f 6c  |          r7,pol|
00002fb0  79 67 6f 6e 5f 77 6f 72  6b 73 70 61 63 65 5f 62  |ygon_workspace_b|
00002fc0  61 73 65 25 0d 12 34 40  4c 44 52 20 20 20 20 20  |ase%..4@LDR     |
00002fd0  20 20 20 20 20 20 20 20  20 20 20 20 72 30 2c 5b  |            r0,[|
00002fe0  72 39 5d 2c 23 34 20 20  20 20 20 20 20 20 20 20  |r9],#4          |
00002ff0  20 20 20 20 20 20 20 20  3b 20 72 30 20 69 73 20  |        ; r0 is |
00003000  74 79 70 65 0d 12 3e 04  0d 12 48 38 4c 44 52 20  |type..>...H8LDR |
00003010  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003020  72 35 2c 5b 72 39 5d 2c  23 34 20 20 20 20 20 20  |r5,[r9],#4      |
00003030  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 70 30  |            ; p0|
00003040  0d 12 52 4f 41 44 44 20  20 20 20 20 20 20 20 20  |..ROADD         |
00003050  20 20 20 20 20 20 20 20  72 36 2c 72 38 2c 72 35  |        r6,r8,r5|
00003060  2c 41 53 4c 23 33 20 20  20 20 20 20 20 20 20 20  |,ASL#3          |
00003070  20 20 20 20 3b 20 72 36  20 69 73 20 61 64 72 20  |    ; r6 is adr |
00003080  6f 66 20 78 2c 79 20 70  6f 69 6e 74 20 72 35 0d  |of x,y point r5.|
00003090  12 5c 37 4c 44 52 20 20  20 20 20 20 20 20 20 20  |.\7LDR          |
000030a0  20 20 20 20 20 20 20 72  31 2c 5b 72 36 5d 20 20  |       r1,[r6]  |
000030b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000030c0  20 20 20 3b 20 78 0d 12  66 37 4c 44 52 20 20 20  |   ; x..f7LDR   |
000030d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 32  |              r2|
000030e0  2c 5b 72 36 2c 23 34 5d  20 20 20 20 20 20 20 20  |,[r6,#4]        |
000030f0  20 20 20 20 20 20 20 20  20 20 3b 20 79 0d 12 70  |          ; y..p|
00003100  3d 53 54 52 20 20 20 20  20 20 20 20 20 20 20 20  |=STR            |
00003110  20 20 20 20 20 72 31 2c  5b 72 37 5d 2c 23 34 20  |     r1,[r7],#4 |
00003120  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003130  20 3b 20 73 74 6f 72 65  20 78 0d 12 7a 3d 53 54  | ; store x..z=ST|
00003140  52 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R               |
00003150  20 20 72 32 2c 5b 72 37  5d 2c 23 34 20 20 20 20  |  r2,[r7],#4    |
00003160  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00003170  73 74 6f 72 65 20 79 0d  12 84 4d 53 54 4d 46 41  |store y...MSTMFA|
00003180  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 28  |               (|
00003190  73 70 29 21 2c 7b 72 31  2c 72 32 7d 20 20 20 20  |sp)!,{r1,r2}    |
000031a0  20 20 20 20 20 20 20 20  20 20 20 3b 20 73 74 6f  |           ; sto|
000031b0  72 65 20 78 31 2c 79 31  20 63 6f 6f 72 64 20 70  |re x1,y1 coord p|
000031c0  61 69 72 73 0d 12 8e 04  0d 12 98 38 4c 44 52 20  |airs.......8LDR |
000031d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000031e0  72 35 2c 5b 72 39 5d 2c  23 34 20 20 20 20 20 20  |r5,[r9],#4      |
000031f0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 70 31  |            ; p1|
00003200  0d 12 a2 4f 41 44 44 20  20 20 20 20 20 20 20 20  |...OADD         |
00003210  20 20 20 20 20 20 20 20  72 36 2c 72 38 2c 72 35  |        r6,r8,r5|
00003220  2c 41 53 4c 23 33 20 20  20 20 20 20 20 20 20 20  |,ASL#3          |
00003230  20 20 20 20 3b 20 72 36  20 69 73 20 61 64 72 20  |    ; r6 is adr |
00003240  6f 66 20 78 2c 79 20 70  6f 69 6e 74 20 72 35 0d  |of x,y point r5.|
00003250  12 ac 37 4c 44 52 20 20  20 20 20 20 20 20 20 20  |..7LDR          |
00003260  20 20 20 20 20 20 20 72  31 2c 5b 72 36 5d 20 20  |       r1,[r6]  |
00003270  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003280  20 20 20 3b 20 78 0d 12  b6 37 4c 44 52 20 20 20  |   ; x...7LDR   |
00003290  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 32  |              r2|
000032a0  2c 5b 72 36 2c 23 34 5d  20 20 20 20 20 20 20 20  |,[r6,#4]        |
000032b0  20 20 20 20 20 20 20 20  20 20 3b 20 79 0d 12 c0  |          ; y...|
000032c0  3d 53 54 52 20 20 20 20  20 20 20 20 20 20 20 20  |=STR            |
000032d0  20 20 20 20 20 72 31 2c  5b 72 37 5d 2c 23 34 20  |     r1,[r7],#4 |
000032e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000032f0  20 3b 20 73 74 6f 72 65  20 78 0d 12 ca 3d 53 54  | ; store x...=ST|
00003300  52 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R               |
00003310  20 20 72 32 2c 5b 72 37  5d 2c 23 34 20 20 20 20  |  r2,[r7],#4    |
00003320  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00003330  73 74 6f 72 65 20 79 0d  12 d4 4d 53 54 4d 46 41  |store y...MSTMFA|
00003340  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 28  |               (|
00003350  73 70 29 21 2c 7b 72 31  2c 72 32 7d 20 20 20 20  |sp)!,{r1,r2}    |
00003360  20 20 20 20 20 20 20 20  20 20 20 3b 20 73 74 6f  |           ; sto|
00003370  72 65 20 78 32 2c 79 32  20 63 6f 6f 72 64 20 70  |re x2,y2 coord p|
00003380  61 69 72 73 0d 12 de 04  0d 12 e8 04 0d 12 f2 38  |airs...........8|
00003390  4c 44 52 20 20 20 20 20  20 20 20 20 20 20 20 20  |LDR             |
000033a0  20 20 20 20 72 35 2c 5b  72 39 5d 2c 23 34 20 20  |    r5,[r9],#4  |
000033b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000033c0  3b 20 70 32 0d 12 fc 4f  41 44 44 20 20 20 20 20  |; p2...OADD     |
000033d0  20 20 20 20 20 20 20 20  20 20 20 20 72 36 2c 72  |            r6,r|
000033e0  38 2c 72 35 2c 41 53 4c  23 33 20 20 20 20 20 20  |8,r5,ASL#3      |
000033f0  20 20 20 20 20 20 20 20  3b 20 72 36 20 69 73 20  |        ; r6 is |
00003400  61 64 72 20 6f 66 20 78  2c 79 20 70 6f 69 6e 74  |adr of x,y point|
00003410  20 72 35 0d 13 06 37 4c  44 52 20 20 20 20 20 20  | r5...7LDR      |
00003420  20 20 20 20 20 20 20 20  20 20 20 72 31 2c 5b 72  |           r1,[r|
00003430  36 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |6]              |
00003440  20 20 20 20 20 20 20 3b  20 78 0d 13 10 37 4c 44  |       ; x...7LD|
00003450  52 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R               |
00003460  20 20 72 32 2c 5b 72 36  2c 23 34 5d 20 20 20 20  |  r2,[r6,#4]    |
00003470  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00003480  79 0d 13 1a 3d 53 54 52  20 20 20 20 20 20 20 20  |y...=STR        |
00003490  20 20 20 20 20 20 20 20  20 72 31 2c 5b 72 37 5d  |         r1,[r7]|
000034a0  2c 23 34 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#4             |
000034b0  20 20 20 20 20 3b 20 73  74 6f 72 65 20 78 0d 13  |     ; store x..|
000034c0  24 3d 53 54 52 20 20 20  20 20 20 20 20 20 20 20  |$=STR           |
000034d0  20 20 20 20 20 20 72 32  2c 5b 72 37 5d 2c 23 34  |      r2,[r7],#4|
000034e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000034f0  20 20 3b 20 73 74 6f 72  65 20 79 0d 13 2e 4d 53  |  ; store y...MS|
00003500  54 4d 46 41 20 20 20 20  20 20 20 20 20 20 20 20  |TMFA            |
00003510  20 20 20 28 73 70 29 21  2c 7b 72 31 2c 72 32 7d  |   (sp)!,{r1,r2}|
00003520  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00003530  20 73 74 6f 72 65 20 78  33 2c 79 33 20 63 6f 6f  | store x3,y3 coo|
00003540  72 64 20 70 61 69 72 73  0d 13 38 04 0d 13 42 04  |rd pairs..8...B.|
00003550  0d 13 4c 38 4c 44 52 20  20 20 20 20 20 20 20 20  |..L8LDR         |
00003560  20 20 20 20 20 20 20 20  72 35 2c 5b 72 39 5d 2c  |        r5,[r9],|
00003570  23 34 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#4              |
00003580  20 20 20 20 3b 20 70 33  0d 13 56 4f 41 44 44 20  |    ; p3..VOADD |
00003590  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000035a0  72 36 2c 72 38 2c 72 35  2c 41 53 4c 23 33 20 20  |r6,r8,r5,ASL#3  |
000035b0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 72 36  |            ; r6|
000035c0  20 69 73 20 61 64 72 20  6f 66 20 78 2c 79 20 70  | is adr of x,y p|
000035d0  6f 69 6e 74 20 72 35 0d  13 60 37 4c 44 52 20 20  |oint r5..`7LDR  |
000035e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 72  |               r|
000035f0  31 2c 5b 72 36 5d 20 20  20 20 20 20 20 20 20 20  |1,[r6]          |
00003600  20 20 20 20 20 20 20 20  20 20 20 3b 20 78 0d 13  |           ; x..|
00003610  6a 37 4c 44 52 20 20 20  20 20 20 20 20 20 20 20  |j7LDR           |
00003620  20 20 20 20 20 20 72 32  2c 5b 72 36 2c 23 34 5d  |      r2,[r6,#4]|
00003630  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003640  20 20 3b 20 79 0d 13 74  3d 53 54 52 20 20 20 20  |  ; y..t=STR    |
00003650  20 20 20 20 20 20 20 20  20 20 20 20 20 72 31 2c  |             r1,|
00003660  5b 72 37 5d 2c 23 34 20  20 20 20 20 20 20 20 20  |[r7],#4         |
00003670  20 20 20 20 20 20 20 20  20 3b 20 73 74 6f 72 65  |         ; store|
00003680  20 78 0d 13 7e 3d 53 54  52 20 20 20 20 20 20 20  | x..~=STR       |
00003690  20 20 20 20 20 20 20 20  20 20 72 32 2c 5b 72 37  |          r2,[r7|
000036a0  5d 2c 23 34 20 20 20 20  20 20 20 20 20 20 20 20  |],#4            |
000036b0  20 20 20 20 20 20 3b 20  73 74 6f 72 65 20 79 0d  |      ; store y.|
000036c0  13 88 04 0d 13 92 4b 41  44 44 20 20 20 20 20 20  |......KADD      |
000036d0  20 20 20 20 20 20 20 20  20 20 20 72 39 2c 72 39  |           r9,r9|
000036e0  2c 23 34 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#4             |
000036f0  20 20 20 20 20 20 20 3b  20 69 6e 74 65 6e 73 69  |       ; intensi|
00003700  74 79 20 69 6e 66 6f 72  6d 61 74 69 6f 6e 0d 13  |ty information..|
00003710  9c 41 53 54 52 20 20 20  20 20 20 20 20 20 20 20  |.ASTR           |
00003720  20 20 20 20 20 20 72 30  2c 5b 72 37 5d 20 20 20  |      r0,[r7]   |
00003730  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003740  20 20 3b 20 72 65 6e 64  65 72 20 74 79 70 65 0d  |  ; render type.|
00003750  13 a6 04 0d 13 b0 31 4c  44 4d 46 41 20 20 20 20  |......1LDMFA    |
00003760  20 20 20 20 20 20 20 20  20 20 20 28 73 70 29 21  |           (sp)!|
00003770  2c 7b 72 36 2c 72 35 2c  72 34 2c 72 33 2c 72 32  |,{r6,r5,r4,r3,r2|
00003780  2c 72 31 7d 0d 13 ba 14  3b 20 72 31 2c 72 32 20  |,r1}....; r1,r2 |
00003790  69 73 20 78 31 2c 79 31  0d 13 c4 14 3b 20 72 33  |is x1,y1....; r3|
000037a0  2c 72 34 20 69 73 20 78  32 2c 79 32 0d 13 ce 14  |,r4 is x2,y2....|
000037b0  3b 20 72 35 2c 72 36 20  69 73 20 78 33 2c 79 33  |; r5,r6 is x3,y3|
000037c0  0d 13 d8 04 0d 13 e2 35  3b 20 20 20 20 20 20 20  |.......5;       |
000037d0  20 20 20 20 78 31 20 20  20 20 20 20 20 20 20 20  |    x1          |
000037e0  79 33 20 20 20 20 20 20  20 20 20 20 79 31 20 20  |y3          y1  |
000037f0  20 20 20 20 20 20 20 78  33 0d 13 ec 34 3b 20 20  |       x3...4;  |
00003800  20 20 20 20 20 20 20 20  20 7c 20 20 20 20 20 20  |         |      |
00003810  20 20 20 20 20 7c 20 20  20 20 20 20 20 20 20 20  |     |          |
00003820  20 7c 20 20 20 20 20 20  20 20 20 20 7c 0d 13 f6  | |          |...|
00003830  39 3b 20 76 69 73 20 3d  20 28 20 78 31 2d 78 32  |9; vis = ( x1-x2|
00003840  20 29 20 2a 20 28 20 79  33 2d 79 32 20 29 20 2d  | ) * ( y3-y2 ) -|
00003850  20 28 20 79 31 2d 79 32  20 29 20 2a 20 28 20 78  | ( y1-y2 ) * ( x|
00003860  33 2d 78 32 20 29 0d 14  00 2f 3b 20 20 20 20 20  |3-x2 ).../;     |
00003870  20 20 20 20 20 20 20 20  20 20 20 20 7c 20 20 20  |            |   |
00003880  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003890  20 20 20 20 7c 0d 14 0a  30 3b 20 20 20 20 20 20  |    |...0;      |
000038a0  20 20 20 20 20 20 20 20  20 20 20 72 33 20 20 20  |           r3   |
000038b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000038c0  20 20 20 72 34 0d 14 14  04 0d 14 1e 46 53 55 42  |   r4.......FSUB|
000038d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000038e0  20 72 31 2c 72 31 2c 72  33 20 20 20 20 20 20 20  | r1,r1,r3       |
000038f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00003900  72 31 20 69 73 20 28 20  78 31 2d 78 32 20 29 0d  |r1 is ( x1-x2 ).|
00003910  14 28 46 53 55 42 20 20  20 20 20 20 20 20 20 20  |.(FSUB          |
00003920  20 20 20 20 20 20 20 72  36 2c 72 36 2c 72 34 20  |       r6,r6,r4 |
00003930  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003940  20 20 20 20 3b 20 72 36  20 69 73 20 28 20 79 33  |    ; r6 is ( y3|
00003950  2d 79 32 20 29 0d 14 32  46 53 55 42 20 20 20 20  |-y2 )..2FSUB    |
00003960  20 20 20 20 20 20 20 20  20 20 20 20 20 72 32 2c  |             r2,|
00003970  72 32 2c 72 34 20 20 20  20 20 20 20 20 20 20 20  |r2,r4           |
00003980  20 20 20 20 20 20 20 20  20 20 3b 20 72 32 20 69  |          ; r2 i|
00003990  73 20 28 20 79 31 2d 79  32 20 29 0d 14 3c 46 53  |s ( y1-y2 )..<FS|
000039a0  55 42 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |UB              |
000039b0  20 20 20 72 35 2c 72 35  2c 72 33 20 20 20 20 20  |   r5,r5,r3     |
000039c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000039d0  3b 20 72 35 20 69 73 20  28 20 78 33 2d 78 32 20  |; r5 is ( x3-x2 |
000039e0  29 0d 14 46 04 0d 14 50  51 4d 55 4c 20 20 20 20  |)..F...PQMUL    |
000039f0  20 20 20 20 20 20 20 20  20 20 20 20 20 72 33 2c  |             r3,|
00003a00  72 31 2c 72 36 20 20 20  20 20 20 20 20 20 20 20  |r1,r6           |
00003a10  20 20 20 20 20 20 20 20  20 20 3b 20 72 33 20 3d  |          ; r3 =|
00003a20  20 28 20 78 31 2d 78 32  20 29 20 2a 20 28 20 79  | ( x1-x2 ) * ( y|
00003a30  33 2d 79 32 20 29 0d 14  5a 51 4d 55 4c 20 20 20  |3-y2 )..ZQMUL   |
00003a40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 34  |              r4|
00003a50  2c 72 32 2c 72 35 20 20  20 20 20 20 20 20 20 20  |,r2,r5          |
00003a60  20 20 20 20 20 20 20 20  20 20 20 3b 20 72 34 20  |           ; r4 |
00003a70  3d 20 28 20 79 31 2d 79  32 20 29 20 2a 20 28 20  |= ( y1-y2 ) * ( |
00003a80  78 33 2d 78 32 20 29 0d  14 64 04 0d 14 6e 40 53  |x3-x2 )..d...n@S|
00003a90  55 42 53 20 20 20 20 20  20 20 20 20 20 20 20 20  |UBS             |
00003aa0  20 20 20 72 31 2c 72 33  2c 72 34 20 20 20 20 20  |   r1,r3,r4     |
00003ab0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003ac0  3b 20 72 31 20 69 73 20  61 6e 73 0d 14 78 04 0d  |; r1 is ans..x..|
00003ad0  14 82 2c 42 4c 47 54 20  20 20 20 20 20 20 20 20  |..,BLGT         |
00003ae0  20 20 20 20 20 20 20 74  65 78 74 75 72 65 6d 61  |       texturema|
00003af0  70 5f 71 75 61 64 72 61  67 6f 6e 0d 14 8c 04 0d  |p_quadragon.....|
00003b00  14 96 22 53 55 42 53 20  20 20 20 20 20 20 20 20  |.."SUBS         |
00003b10  20 20 20 20 20 20 20 72  31 30 2c 72 31 30 2c 23  |       r10,r10,#|
00003b20  31 0d 14 a0 29 42 47 54  20 20 20 20 20 20 20 20  |1...)BGT        |
00003b30  20 20 20 20 20 20 20 20  20 70 6c 6f 74 5f 63 72  |         plot_cr|
00003b40  61 66 74 5f 66 61 63 65  74 73 0d 14 aa 04 0d 14  |aft_facets......|
00003b50  b4 2f 4c 44 4d 46 41 20  20 20 20 20 20 20 20 20  |./LDMFA         |
00003b60  20 20 20 20 20 20 28 73  70 29 21 2c 7b 72 30 2d  |      (sp)!,{r0-|
00003b70  72 31 30 2c 72 31 32 2c  6c 69 6e 6b 7d 0d 14 be  |r10,r12,link}...|
00003b80  1f 4d 4f 56 20 20 20 20  20 20 20 20 20 20 20 20  |.MOV            |
00003b90  20 20 20 20 20 50 43 2c  6c 69 6e 6b 0d 14 c8 04  |     PC,link....|
00003ba0  0d 14 d2 04 0d 14 dc 04  0d 14 e6 04 0d 14 f0 04  |................|
00003bb0  0d 14 fa 25 3b 20 72 30  20 69 73 20 6e 6f 2e 20  |...%; r0 is no. |
00003bc0  6f 66 20 63 72 61 66 74  20 74 6f 20 63 61 6c 63  |of craft to calc|
00003bd0  75 6c 61 74 65 0d 15 04  1b 2e 63 72 61 66 74 5f  |ulate.....craft_|
00003be0  6d 6f 76 65 6d 65 6e 74  5f 68 61 6e 64 6c 65 72  |movement_handler|
00003bf0  0d 15 0e 2f 53 54 4d 46  41 20 20 20 20 20 20 20  |.../STMFA       |
00003c00  20 20 20 20 20 20 20 20  28 73 70 29 21 2c 7b 72  |        (sp)!,{r|
00003c10  30 2d 72 31 30 2c 72 31  32 2c 6c 69 6e 6b 7d 0d  |0-r10,r12,link}.|
00003c20  15 18 04 0d 15 22 33 4c  44 52 20 20 20 20 20 20  |....."3LDR      |
00003c30  20 20 20 20 20 20 20 20  20 20 20 72 31 30 2c 63  |           r10,c|
00003c40  72 61 66 74 5f 68 65 61  64 65 72 5f 6c 69 73 74  |raft_header_list|
00003c50  5f 62 61 73 65 25 0d 15  2c 53 4c 44 52 20 20 20  |_base%..,SLDR   |
00003c60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 31  |              r1|
00003c70  32 2c 5b 72 31 30 2c 72  30 2c 41 53 4c 23 32 5d  |2,[r10,r0,ASL#2]|
00003c80  20 20 20 20 20 20 20 20  20 20 3b 20 72 31 32 20  |          ; r12 |
00003c90  69 73 20 68 65 61 64 65  72 20 6f 66 20 63 72 61  |is header of cra|
00003ca0  66 74 20 6e 6f 2e 20 72  30 0d 15 36 04 0d 15 40  |ft no. r0..6...@|
00003cb0  47 4c 44 52 20 20 20 20  20 20 20 20 20 20 20 20  |GLDR            |
00003cc0  20 20 20 20 20 72 30 2c  5b 72 31 32 2c 23 34 34  |     r0,[r12,#44|
00003cd0  5d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |]               |
00003ce0  20 3b 20 72 30 20 69 73  20 79 20 72 6f 74 20 73  | ; r0 is y rot s|
00003cf0  70 65 65 64 0d 15 4a 41  4c 44 52 20 20 20 20 20  |peed..JALDR     |
00003d00  20 20 20 20 20 20 20 20  20 20 20 20 72 31 2c 5b  |            r1,[|
00003d10  72 31 32 2c 23 33 36 5d  20 20 20 20 20 20 20 20  |r12,#36]        |
00003d20  20 20 20 20 20 20 20 20  3b 20 72 31 20 69 73 20  |        ; r1 is |
00003d30  79 20 72 6f 74 0d 15 54  04 0d 15 5e 4e 41 44 44  |y rot..T...^NADD|
00003d40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003d50  20 72 31 2c 72 31 2c 72  30 20 20 20 20 20 20 20  | r1,r1,r0       |
00003d60  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 61  |             ; a|
00003d70  64 64 20 79 20 72 6f 74  20 73 70 65 65 64 20 74  |dd y rot speed t|
00003d80  6f 20 79 20 72 6f 74 0d  15 68 04 0d 15 72 4e 43  |o y rot..h...rNC|
00003d90  4d 50 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |MP              |
00003da0  20 20 20 72 31 2c 23 33  36 30 20 20 20 20 20 20  |   r1,#360      |
00003db0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00003dc0  20 65 6e 73 75 72 65 20  79 20 72 6f 74 20 69 73  | ensure y rot is|
00003dd0  20 69 6e 20 72 61 6e 67  65 0d 15 7c 22 53 55 42  | in range..|"SUB|
00003de0  47 45 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |GE              |
00003df0  20 72 31 2c 72 31 2c 23  33 36 30 0d 15 86 1d 4d  | r1,r1,#360....M|
00003e00  4f 56 53 20 20 20 20 20  20 20 20 20 20 20 20 20  |OVS             |
00003e10  20 20 20 72 31 2c 72 31  0d 15 90 22 41 44 44 4c  |   r1,r1..."ADDL|
00003e20  54 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |T               |
00003e30  72 31 2c 72 31 2c 23 33  36 30 0d 15 9a 04 0d 15  |r1,r1,#360......|
00003e40  a4 41 53 54 52 20 20 20  20 20 20 20 20 20 20 20  |.ASTR           |
00003e50  20 20 20 20 20 20 72 31  2c 5b 72 31 32 2c 23 33  |      r1,[r12,#3|
00003e60  36 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |6]              |
00003e70  20 20 3b 20 73 74 6f 72  65 20 79 20 72 6f 74 0d  |  ; store y rot.|
00003e80  15 ae 24 4c 44 52 20 20  20 20 20 20 20 20 20 20  |..$LDR          |
00003e90  20 20 20 20 20 20 20 72  32 2c 5b 72 31 32 2c 23  |       r2,[r12,#|
00003ea0  34 30 5d 0d 15 b8 4e 43  4d 50 20 20 20 20 20 20  |40]...NCMP      |
00003eb0  20 20 20 20 20 20 20 20  20 20 20 72 32 2c 23 33  |           r2,#3|
00003ec0  36 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |60              |
00003ed0  20 20 20 20 20 20 20 3b  20 65 6e 73 75 72 65 20  |       ; ensure |
00003ee0  79 20 72 6f 74 20 69 73  20 69 6e 20 72 61 6e 67  |y rot is in rang|
00003ef0  65 0d 15 c2 22 53 55 42  47 45 20 20 20 20 20 20  |e..."SUBGE      |
00003f00  20 20 20 20 20 20 20 20  20 72 32 2c 72 32 2c 23  |         r2,r2,#|
00003f10  33 36 30 0d 15 cc 1d 4d  4f 56 53 20 20 20 20 20  |360....MOVS     |
00003f20  20 20 20 20 20 20 20 20  20 20 20 72 32 2c 72 32  |           r2,r2|
00003f30  0d 15 d6 22 41 44 44 4c  54 20 20 20 20 20 20 20  |..."ADDLT       |
00003f40  20 20 20 20 20 20 20 20  72 32 2c 72 32 2c 23 33  |        r2,r2,#3|
00003f50  36 30 0d 15 e0 24 53 54  52 20 20 20 20 20 20 20  |60...$STR       |
00003f60  20 20 20 20 20 20 20 20  20 20 72 32 2c 5b 72 31  |          r2,[r1|
00003f70  32 2c 23 34 30 5d 0d 15  ea 04 0d 15 f4 2f 4c 44  |2,#40]......./LD|
00003f80  4d 46 41 20 20 20 20 20  20 20 20 20 20 20 20 20  |MFA             |
00003f90  20 20 28 73 70 29 21 2c  7b 72 30 2d 72 31 30 2c  |  (sp)!,{r0-r10,|
00003fa0  72 31 32 2c 6c 69 6e 6b  7d 0d 15 fe 1f 4d 4f 56  |r12,link}....MOV|
00003fb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003fc0  20 50 43 2c 6c 69 6e 6b  0d 16 08 04 0d 16 12 05  | PC,link........|
00003fd0  5d 0d 16 1c 04 0d 16 26  0b ed 20 70 61 73 73 25  |]......&.. pass%|
00003fe0  0d 16 30 04 0d 16 3a 05  e1 0d 16 44 04 0d 16 4e  |..0...:....D...N|
00003ff0  04 0d 16 58 04 0d 16 62  04 0d 16 6c 1d dd f2 61  |...X...b...l...a|
00004000  73 73 65 6d 62 6c 65 5f  70 6f 6c 79 5f 72 65 6e  |ssemble_poly_ren|
00004010  64 65 72 65 72 73 0d 16  76 43 f4 20 6e 6f 20 72  |derers..vC. no r|
00004020  6f 75 74 69 6e 65 73 20  69 6e 20 74 68 69 73 20  |outines in this |
00004030  73 65 63 74 69 6f 6e 20  73 68 6f 75 6c 64 20 61  |section should a|
00004040  63 63 65 73 73 20 74 68  65 20 73 63 72 65 65 6e  |ccess the screen|
00004050  20 64 69 72 65 63 74 6c  79 0d 16 80 47 f4 20 61  | directly...G. a|
00004060  6c 6c 20 73 63 72 65 65  6e 20 63 6f 6e 74 72 6f  |ll screen contro|
00004070  6c 20 69 73 20 68 61 6e  64 6c 65 64 20 65 78 63  |l is handled exc|
00004080  6c 75 73 69 76 65 6c 79  20 62 79 20 73 63 72 65  |lusively by scre|
00004090  65 6e 20 68 61 6e 64 6c  65 72 73 20 63 6f 64 65  |en handlers code|
000040a0  0d 16 8a 04 0d 16 94 18  ea 20 61 64 72 25 2c 70  |......... adr%,p|
000040b0  61 73 73 25 2c 6c 69 6e  6b 2c 73 70 0d 16 9e 04  |ass%,link,sp....|
000040c0  0d 16 a8 0b 6c 69 6e 6b  3d 31 34 0d 16 b2 09 73  |....link=14....s|
000040d0  70 3d 31 31 0d 16 bc 04  0d 16 c6 22 f4 20 63 6f  |p=11.......". co|
000040e0  6e 74 69 6e 75 65 73 20  6f 6e 20 69 6e 20 63 6f  |ntinues on in co|
000040f0  64 65 25 20 6d 65 6d 6f  72 79 0d 16 d0 04 0d 16  |de% memory......|
00004100  da 0b 61 64 72 25 3d 50  25 0d 16 e4 04 0d 16 ee  |..adr%=P%.......|
00004110  04 0d 16 f8 04 0d 17 02  16 e3 20 70 61 73 73 25  |.......... pass%|
00004120  3d 38 20 b8 20 31 30 20  88 20 32 0d 17 0c 04 0d  |=8 . 10 . 2.....|
00004130  17 16 0b 50 25 3d 61 64  72 25 0d 17 20 13 4c 25  |...P%=adr%.. .L%|
00004140  3d 63 6f 64 65 25 20 2b  20 6c 65 6e 25 0d 17 2a  |=code% + len%..*|
00004150  04 0d 17 34 0f 5b 20 4f  50 54 20 70 61 73 73 25  |...4.[ OPT pass%|
00004160  0d 17 3e 04 0d 17 48 5d  3b 20 41 64 64 72 65 73  |..>...H]; Addres|
00004170  73 65 73 20 61 6c 72 65  61 64 79 20 75 73 65 64  |ses already used|
00004180  20 28 20 69 6e 20 66 72  6f 6e 74 20 6f 66 20 63  | ( in front of c|
00004190  6f 64 65 20 73 6f 20 69  74 20 69 74 20 75 73 65  |ode so it it use|
000041a0  73 20 74 68 65 73 65 20  69 6e 73 74 65 61 64 20  |s these instead |
000041b0  6f 66 20 74 68 65 20 70  72 65 76 69 6f 75 73 20  |of the previous |
000041c0  29 0d 17 52 04 0d 17 5c  35 2e 73 77 6d 5f 72 64  |)..R...\5.swm_rd|
000041d0  69 76 5f 6c 69 73 74 5f  62 61 73 65 25 20 20 20  |iv_list_base%   |
000041e0  20 20 20 20 20 20 20 45  51 55 44 20 73 77 6d 5f  |       EQUD swm_|
000041f0  72 64 69 76 5f 6c 69 73  74 25 0d 17 66 04 0d 17  |rdiv_list%..f...|
00004200  70 04 0d 17 7a 32 2e 73  69 6e 65 5f 74 61 62 6c  |p...z2.sine_tabl|
00004210  65 5f 62 61 73 65 25 20  20 20 20 20 20 20 20 20  |e_base%         |
00004220  20 20 20 20 45 51 55 44  20 73 69 6e 65 5f 74 61  |    EQUD sine_ta|
00004230  62 6c 65 25 0d 17 84 34  2e 63 6f 73 69 6e 65 5f  |ble%...4.cosine_|
00004240  74 61 62 6c 65 5f 62 61  73 65 25 20 20 20 20 20  |table_base%     |
00004250  20 20 20 20 20 20 45 51  55 44 20 63 6f 73 69 6e  |      EQUD cosin|
00004260  65 5f 74 61 62 6c 65 25  0d 17 8e 39 2e 63 72 61  |e_table%...9.cra|
00004270  66 74 5f 68 65 61 64 65  72 5f 6c 69 73 74 5f 62  |ft_header_list_b|
00004280  61 73 65 25 20 20 20 20  20 20 45 51 55 44 20 63  |ase%      EQUD c|
00004290  72 61 66 74 5f 68 65 61  64 65 72 5f 6c 69 73 74  |raft_header_list|
000042a0  25 0d 17 98 04 0d 17 a2  04 0d 17 ac 19 2e 74 65  |%.............te|
000042b0  78 74 75 72 65 6d 61 70  5f 71 75 61 64 72 61 67  |xturemap_quadrag|
000042c0  6f 6e 0d 17 b6 45 3b 20  72 37 20 69 73 20 75 73  |on...E; r7 is us|
000042d0  65 64 20 74 68 72 6f 75  67 68 6f 75 74 20 66 6f  |ed throughout fo|
000042e0  72 20 6c 69 6e 65 20 63  6f 75 6e 74 65 72 20 69  |r line counter i|
000042f0  73 20 61 6c 73 6f 20 73  69 64 65 20 6e 6f 2e 20  |s also side no. |
00004300  28 30 20 2d 20 33 29 0d  17 c0 04 0d 17 ca 21 3b  |(0 - 3).......!;|
00004310  20 65 64 67 65 20 6c 69  73 74 20 66 6f 72 6d 61  | edge list forma|
00004320  74 20 61 73 20 66 6f 6c  6c 6f 77 73 0d 17 d4 04  |t as follows....|
00004330  0d 17 de 2a 3b 20 30 20  20 20 20 20 20 20 34 20  |...*; 0       4 |
00004340  20 20 20 20 20 20 38 20  20 20 20 20 20 20 31 32  |      8       12|
00004350  20 20 20 20 20 20 20 20  31 36 0d 17 e8 2a 3b 20  |        16...*; |
00004360  5f 5f 5f 5f 5f 5f 5f 5f  5f 5f 5f 5f 5f 5f 5f 5f  |________________|
*
00004380  5f 5f 5f 5f 0d 17 f2 29  3b 20 7c 20 20 20 78 20  |____...); |   x |
00004390  20 20 7c 20 20 20 75 20  20 20 7c 20 20 20 76 20  |  |   u   |   v |
000043a0  20 20 7c 20 20 20 6f 62  73 20 20 20 7c 0d 17 fc  |  |   obs   |...|
000043b0  2a 3b 20 7e 7e 7e 7e 7e  7e 7e 7e 7e 7e 7e 7e 7e  |*; ~~~~~~~~~~~~~|
000043c0  7e 7e 7e 7e 7e 7e 7e 7e  7e 7e 7e 7e 7e 7e 7e 7e  |~~~~~~~~~~~~~~~~|
000043d0  7e 7e 7e 7e 7e 7e 7e 0d  18 06 1d 3b 20 61 64 72  |~~~~~~~....; adr|
000043e0  20 3d 20 62 61 73 65 20  2b 20 28 20 79 20 2a 20  | = base + ( y * |
000043f0  31 36 20 29 0d 18 10 1d  3b 20 6e 6f 74 65 20 76  |16 )....; note v|
00004400  20 69 73 20 73 63 61 6c  65 64 20 62 79 20 32 35  | is scaled by 25|
00004410  36 0d 18 1a 36 3b 20 72  31 32 20 69 73 20 61 64  |6...6; r12 is ad|
00004420  72 20 6f 66 20 70 6f 6c  79 67 6f 6e 5f 77 6f 72  |r of polygon_wor|
00004430  6b 73 70 61 63 65 25 20  74 68 72 6f 75 67 68 6f  |kspace% througho|
00004440  75 74 20 72 74 6e 2e 0d  18 24 04 0d 18 2e 2e 53  |ut rtn...$.....S|
00004450  54 4d 46 41 20 20 20 20  20 20 20 20 20 20 20 20  |TMFA            |
00004460  20 20 28 73 70 29 21 2c  7b 72 30 2d 72 31 30 2c  |  (sp)!,{r0-r10,|
00004470  72 31 32 2c 6c 69 6e 6b  7d 0d 18 38 1c 4d 4f 56  |r12,link}..8.MOV|
00004480  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004490  72 37 2c 23 33 0d 18 42  04 0d 18 4c 0f 2e 74 65  |r7,#3..B...L..te|
000044a0  78 5f 73 63 63 6f 6e 76  0d 18 56 32 4c 44 52 20  |x_scconv..V2LDR |
000044b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 72  |               r|
000044c0  31 32 2c 70 6f 6c 79 67  6f 6e 5f 77 6f 72 6b 73  |12,polygon_works|
000044d0  70 61 63 65 5f 62 61 73  65 25 0d 18 60 39 3b 20  |pace_base%..`9; |
000044e0  6c 6f 61 64 20 65 6e 64  20 70 6f 69 6e 74 20 63  |load end point c|
000044f0  6f 6f 72 64 73 20 20 20  20 20 20 72 31 2c 72 32  |oords      r1,r2|
00004500  20 20 20 20 20 20 61 6e  64 20 20 20 20 20 72 33  |      and     r3|
00004510  2c 72 34 0d 18 6a 4d 41  44 44 20 20 20 20 20 20  |,r4..jMADD      |
00004520  20 20 20 20 20 20 20 20  20 20 72 31 30 2c 72 31  |          r10,r1|
00004530  32 2c 72 37 2c 41 53 4c  23 33 20 20 20 20 20 20  |2,r7,ASL#3      |
00004540  20 20 20 20 20 3b 20 72  31 30 20 69 73 20 62 61  |     ; r10 is ba|
00004550  73 65 20 2b 20 73 69 64  65 20 6e 6f 20 2a 20 38  |se + side no * 8|
00004560  0d 18 74 04 0d 18 7e 22  4c 44 52 20 20 20 20 20  |..t...~"LDR     |
00004570  20 20 20 20 20 20 20 20  20 20 20 72 31 2c 5b 72  |           r1,[r|
00004580  31 30 5d 2c 23 34 0d 18  88 22 4c 44 52 20 20 20  |10],#4..."LDR   |
00004590  20 20 20 20 20 20 20 20  20 20 20 20 20 72 32 2c  |             r2,|
000045a0  5b 72 31 30 5d 2c 23 34  0d 18 92 5d 43 4d 50 20  |[r10],#4...]CMP |
000045b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 72  |               r|
000045c0  37 2c 23 33 20 20 20 20  20 20 20 20 20 20 20 20  |7,#3            |
000045d0  20 20 20 20 20 20 20 20  20 20 3b 20 69 66 20 73  |          ; if s|
000045e0  69 64 65 20 6e 6f 20 3d  20 33 20 70 75 74 20 70  |ide no = 3 put p|
000045f0  6f 69 6e 74 65 72 20 62  61 63 6b 20 74 6f 20 73  |ointer back to s|
00004600  74 61 72 74 2e 0d 18 9c  1b ec 51 20 20 20 20 20  |tart......Q     |
00004610  20 20 20 20 20 20 20 20  20 72 31 30 2c 72 31 32  |         r10,r12|
00004620  0d 18 a6 22 4c 44 52 20  20 20 20 20 20 20 20 20  |..."LDR         |
00004630  20 20 20 20 20 20 20 72  33 2c 5b 72 31 30 5d 2c  |       r3,[r10],|
00004640  23 34 0d 18 b0 22 4c 44  52 20 20 20 20 20 20 20  |#4..."LDR       |
00004650  20 20 20 20 20 20 20 20  20 72 34 2c 5b 72 31 30  |         r4,[r10|
00004660  5d 2c 23 34 0d 18 ba 04  0d 18 c4 04 0d 18 ce 25  |],#4...........%|
00004670  3b 20 69 66 20 79 31 20  3e 20 79 32 20 73 77 61  |; if y1 > y2 swa|
00004680  70 20 74 68 65 20 63 6f  6f 72 64 73 20 6f 76 65  |p the coords ove|
00004690  72 0d 18 d8 1c 43 4d 50  20 20 20 20 20 20 20 20  |r....CMP        |
000046a0  20 20 20 20 20 20 20 20  72 32 2c 72 34 0d 18 e2  |        r2,r4...|
000046b0  25 42 45 51 20 20 20 20  20 20 20 20 20 20 20 20  |%BEQ            |
000046c0  20 20 20 20 65 6e 64 5f  74 65 78 5f 73 63 63 6f  |    end_tex_scco|
000046d0  6e 76 0d 18 ec 3c 4c 44  52 4c 54 20 20 20 20 20  |nv...<LDRLT     |
000046e0  20 20 20 20 20 20 20 20  20 72 31 30 2c 5b 72 31  |         r10,[r1|
000046f0  32 2c 23 34 30 5d 20 20  20 20 20 20 20 20 20 20  |2,#40]          |
00004700  20 20 20 20 3b 20 6c 68  73 5f 6c 69 73 74 0d 18  |    ; lhs_list..|
00004710  f6 3c 4c 44 52 47 54 20  20 20 20 20 20 20 20 20  |.<LDRGT         |
00004720  20 20 20 20 20 72 31 30  2c 5b 72 31 32 2c 23 34  |     r10,[r12,#4|
00004730  34 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4]              |
00004740  3b 20 72 68 73 5f 6c 69  73 74 0d 19 00 04 0d 19  |; rhs_list......|
00004750  0a 1c 4d 4f 56 47 54 20  20 20 20 20 20 20 20 20  |..MOVGT         |
00004760  20 20 20 20 20 72 35 2c  72 31 0d 19 14 1c 4d 4f  |     r5,r1....MO|
00004770  56 47 54 20 20 20 20 20  20 20 20 20 20 20 20 20  |VGT             |
00004780  20 72 36 2c 72 32 0d 19  1e 1c 4d 4f 56 47 54 20  | r6,r2....MOVGT |
00004790  20 20 20 20 20 20 20 20  20 20 20 20 20 72 31 2c  |             r1,|
000047a0  72 33 0d 19 28 1c 4d 4f  56 47 54 20 20 20 20 20  |r3..(.MOVGT     |
000047b0  20 20 20 20 20 20 20 20  20 72 32 2c 72 34 0d 19  |         r2,r4..|
000047c0  32 1c 4d 4f 56 47 54 20  20 20 20 20 20 20 20 20  |2.MOVGT         |
000047d0  20 20 20 20 20 72 33 2c  72 35 0d 19 3c 1c 4d 4f  |     r3,r5..<.MO|
000047e0  56 47 54 20 20 20 20 20  20 20 20 20 20 20 20 20  |VGT             |
000047f0  20 72 34 2c 72 36 0d 19  46 04 0d 19 50 04 0d 19  | r4,r6..F...P...|
00004800  5a 04 0d 19 64 1b 3b 20  66 69 6e 64 20 67 72 61  |Z...d.; find gra|
00004810  64 69 65 6e 74 20 6f 66  20 6c 69 6e 65 0d 19 6e  |dient of line..n|
00004820  3c 53 55 42 20 20 20 20  20 20 20 20 20 20 20 20  |<SUB            |
00004830  20 20 20 20 72 33 2c 72  33 2c 72 31 20 20 20 20  |    r3,r3,r1    |
00004840  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004850  3b 20 78 32 20 2d 20 78  31 0d 19 78 3c 53 55 42  |; x2 - x1..x<SUB|
00004860  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004870  72 34 2c 72 34 2c 72 32  20 20 20 20 20 20 20 20  |r4,r4,r2        |
00004880  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 79 32  |            ; y2|
00004890  20 2d 20 79 31 0d 19 82  40 a4 73 77 6d 5f 72 64  | - y1...@.swm_rd|
000048a0  69 76 5f 73 63 61 38 28  33 2c 34 2c 35 29 20 20  |iv_sca8(3,4,5)  |
000048b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000048c0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 72  |             ; r|
000048d0  35 20 3d 20 6d 0d 19 8c  04 0d 19 96 50 4d 4f 56  |5 = m.......PMOV|
000048e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000048f0  72 31 2c 72 31 2c 41 53  4c 23 38 20 20 20 20 20  |r1,r1,ASL#8     |
00004900  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 72 31  |            ; r1|
00004910  20 3d 20 61 63 74 20 78  20 63 6f 6f 72 64 20 73  | = act x coord s|
00004920  63 61 6c 65 64 20 75 70  2e 0d 19 a0 04 0d 19 aa  |caled up........|
00004930  33 3b 20 72 32 20 69 73  20 79 20 63 6f 6f 72 64  |3; r2 is y coord|
00004940  20 72 34 20 69 73 20 63  6f 75 6e 74 65 72 20 72  | r4 is counter r|
00004950  30 20 69 73 20 61 63 74  20 78 20 63 6f 6f 72 64  |0 is act x coord|
00004960  0d 19 b4 14 2e 74 65 78  5f 73 63 63 6f 6e 76 5f  |.....tex_scconv_|
00004970  6c 6f 6f 70 0d 19 be 1e  43 4d 50 20 20 20 20 20  |loop....CMP     |
00004980  20 20 20 20 20 20 20 20  20 20 20 72 32 2c 23 32  |           r2,#2|
00004990  35 36 0d 19 c8 25 42 47  45 20 20 20 20 20 20 20  |56...%BGE       |
000049a0  20 20 20 20 20 20 20 20  20 65 6e 64 5f 74 65 78  |         end_tex|
000049b0  5f 73 63 63 6f 6e 76 0d  19 d2 04 0d 19 dc 45 4d  |_scconv.......EM|
000049c0  4f 56 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |OV              |
000049d0  20 20 72 30 2c 72 31 2c  41 53 52 23 38 20 20 20  |  r0,r1,ASR#8   |
000049e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
000049f0  72 30 20 3d 20 61 63 74  20 78 20 63 6f 6f 72 64  |r0 = act x coord|
00004a00  0d 19 e6 5a 53 54 52 20  20 20 20 20 20 20 20 20  |...ZSTR         |
00004a10  20 20 20 20 20 20 20 72  30 2c 5b 72 31 30 2c 72  |       r0,[r10,r|
00004a20  32 2c 41 53 4c 23 34 5d  20 20 20 20 20 20 20 20  |2,ASL#4]        |
00004a30  20 20 20 3b 20 73 74 6f  72 65 20 78 20 63 6f 6f  |   ; store x coo|
00004a40  72 64 20 69 6e 20 6c 69  73 74 20 61 74 20 79 20  |rd in list at y |
00004a50  63 6f 6f 72 64 20 2a 20  31 36 0d 19 f0 04 0d 19  |coord * 16......|
00004a60  fa 3f 41 44 44 20 20 20  20 20 20 20 20 20 20 20  |.?ADD           |
00004a70  20 20 20 20 20 72 31 2c  72 31 2c 72 35 20 20 20  |     r1,r1,r5   |
00004a80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004a90  20 3b 20 69 6e 63 20 78  20 62 79 20 6d 0d 1a 04  | ; inc x by m...|
00004aa0  04 0d 1a 0e 1f 41 44 44  20 20 20 20 20 20 20 20  |.....ADD        |
00004ab0  20 20 20 20 20 20 20 20  72 32 2c 72 32 2c 23 31  |        r2,r2,#1|
00004ac0  0d 1a 18 1f 53 55 42 53  20 20 20 20 20 20 20 20  |....SUBS        |
00004ad0  20 20 20 20 20 20 20 72  34 2c 72 34 2c 23 31 0d  |       r4,r4,#1.|
00004ae0  1a 22 26 42 47 54 20 20  20 20 20 20 20 20 20 20  |."&BGT          |
00004af0  20 20 20 20 20 20 74 65  78 5f 73 63 63 6f 6e 76  |      tex_scconv|
00004b00  5f 6c 6f 6f 70 0d 1a 2c  04 0d 1a 36 04 0d 1a 40  |_loop..,...6...@|
00004b10  13 2e 65 6e 64 5f 74 65  78 5f 73 63 63 6f 6e 76  |..end_tex_scconv|
00004b20  0d 1a 4a 47 53 55 42 53  20 20 20 20 20 20 20 20  |..JGSUBS        |
00004b30  20 20 20 20 20 20 20 72  37 2c 72 37 2c 23 31 20  |       r7,r7,#1 |
00004b40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004b50  20 20 3b 20 67 6f 20 61  6e 64 20 64 6f 20 6e 65  |  ; go and do ne|
00004b60  78 74 20 6c 69 6e 65 0d  1a 54 21 42 47 45 20 20  |xt line..T!BGE  |
00004b70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 74 65  |              te|
00004b80  78 5f 73 63 63 6f 6e 76  0d 1a 5e 04 0d 1a 68 04  |x_scconv..^...h.|
00004b90  0d 1a 72 17 2e 74 65 78  5f 69 6e 74 65 72 70 6f  |..r..tex_interpo|
00004ba0  6c 5f 73 69 64 65 30 0d  1a 7c 18 3b 20 69 6e 74  |l_side0..|.; int|
00004bb0  65 72 70 6f 6c 61 74 65  20 73 69 64 65 20 30 0d  |erpolate side 0.|
00004bc0  1a 86 21 3b 20 75 20 63  6f 6f 72 64 69 6e 61 74  |..!; u coordinat|
00004bd0  65 73 20 73 74 61 79 20  63 6f 6e 73 74 61 6e 74  |es stay constant|
00004be0  0d 1a 90 0b 3b 20 30 20  2c 20 30 0d 1a 9a 09 3b  |....; 0 , 0....;|
00004bf0  20 20 20 7c 0d 1a a4 09  3b 20 20 20 7c 0d 1a ae  |   |....;   |...|
00004c00  09 3b 20 20 20 7c 0d 1a  b8 0c 3b 20 30 20 2c 20  |.;   |....; 0 , |
00004c10  33 31 0d 1a c2 04 0d 1a  cc 25 3b 20 6c 6f 61 64  |31.......%; load|
00004c20  20 79 20 63 6f 6f 72 64  73 20 6f 66 20 70 6f 69  | y coords of poi|
00004c30  6e 74 73 20 30 20 61 6e  64 20 31 0d 1a d6 35 4c  |nts 0 and 1...5L|
00004c40  44 52 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |DR              |
00004c50  20 20 72 30 2c 5b 72 31  32 2c 23 34 5d 20 20 20  |  r0,[r12,#4]   |
00004c60  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 79 30  |            ; y0|
00004c70  0d 1a e0 35 4c 44 52 20  20 20 20 20 20 20 20 20  |...5LDR         |
00004c80  20 20 20 20 20 20 20 72  31 2c 5b 72 31 32 2c 23  |       r1,[r12,#|
00004c90  31 32 5d 20 20 20 20 20  20 20 20 20 20 20 20 20  |12]             |
00004ca0  20 3b 20 79 31 0d 1a ea  04 0d 1a f4 1c 43 4d 50  | ; y1........CMP|
00004cb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004cc0  72 30 2c 72 31 0d 1a fe  4e 4c 44 52 4c 54 20 20  |r0,r1...NLDRLT  |
00004cd0  20 20 20 20 20 20 20 20  20 20 20 20 72 31 30 2c  |            r10,|
00004ce0  5b 72 31 32 2c 23 34 30  5d 20 20 20 20 20 20 20  |[r12,#40]       |
00004cf0  20 3b 20 69 66 20 79 30  20 3c 20 79 31 20 6c 6f  | ; if y0 < y1 lo|
00004d00  61 64 20 62 61 73 65 20  6f 66 20 6c 68 73 5f 6c  |ad base of lhs_l|
00004d10  69 73 74 0d 1b 08 4e 4c  44 52 47 54 20 20 20 20  |ist...NLDRGT    |
00004d20  20 20 20 20 20 20 20 20  20 20 72 31 30 2c 5b 72  |          r10,[r|
00004d30  31 32 2c 23 34 34 5d 20  20 20 20 20 20 20 20 3b  |12,#44]        ;|
00004d40  20 69 66 20 79 30 20 3e  20 79 31 20 6c 6f 61 64  | if y0 > y1 load|
00004d50  20 62 61 73 65 20 6f 66  20 72 68 73 5f 6c 69 73  | base of rhs_lis|
00004d60  74 0d 1b 12 58 42 45 51  20 20 20 20 20 20 20 20  |t...XBEQ        |
00004d70  20 20 20 20 20 20 20 20  74 65 78 5f 69 6e 74 65  |        tex_inte|
00004d80  72 70 6f 6c 5f 73 69 64  65 31 20 20 20 20 20 20  |rpol_side1      |
00004d90  20 20 3b 20 69 66 20 79  20 63 6f 6f 72 64 73 20  |  ; if y coords |
00004da0  61 72 65 20 65 71 75 61  6c 20 67 6f 20 74 6f 20  |are equal go to |
00004db0  6e 65 78 74 20 73 69 64  65 0d 1b 1c 04 0d 1b 26  |next side......&|
00004dc0  35 4d 4f 56 4c 54 20 20  20 20 20 20 20 20 20 20  |5MOVLT          |
00004dd0  20 20 20 20 72 32 2c 23  30 20 20 20 20 20 20 20  |    r2,#0       |
00004de0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00004df0  76 30 0d 1b 30 35 4d 4f  56 4c 54 20 20 20 20 20  |v0..05MOVLT     |
00004e00  20 20 20 20 20 20 20 20  20 72 33 2c 23 33 31 3c  |         r3,#31<|
00004e10  3c 38 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |<8              |
00004e20  20 20 20 3b 20 76 31 0d  1b 3a 04 0d 1b 44 5c 4d  |   ; v1..:...D\M|
00004e30  4f 56 47 54 20 20 20 20  20 20 20 20 20 20 20 20  |OVGT            |
00004e40  20 20 72 32 2c 23 33 31  3c 3c 38 20 20 20 20 20  |  r2,#31<<8     |
00004e50  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 76 31  |            ; v1|
00004e60  20 20 20 20 20 20 20 20  20 20 69 66 20 79 30 20  |          if y0 |
00004e70  3e 20 79 31 20 72 65 76  65 72 73 65 20 75 2c 76  |> y1 reverse u,v|
00004e80  20 63 6f 6f 72 64 73 0d  1b 4e 35 4d 4f 56 47 54  | coords..N5MOVGT|
00004e90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 33  |              r3|
00004ea0  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#0             |
00004eb0  20 20 20 20 20 20 20 20  3b 20 76 30 0d 1b 58 04  |        ; v0..X.|
00004ec0  0d 1b 62 4b 4d 4f 56 47  54 20 20 20 20 20 20 20  |..bKMOVGT       |
00004ed0  20 20 20 20 20 20 20 72  39 2c 72 30 20 20 20 20  |       r9,r0    |
00004ee0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004ef0  20 3b 20 69 66 20 79 30  20 3e 20 79 31 20 73 77  | ; if y0 > y1 sw|
00004f00  61 70 20 79 20 63 6f 6f  72 64 73 0d 1b 6c 1c 4d  |ap y coords..l.M|
00004f10  4f 56 47 54 20 20 20 20  20 20 20 20 20 20 20 20  |OVGT            |
00004f20  20 20 72 30 2c 72 31 0d  1b 76 1c 4d 4f 56 47 54  |  r0,r1..v.MOVGT|
00004f30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 31  |              r1|
00004f40  2c 72 39 0d 1b 80 04 0d  1b 8a 47 53 55 42 20 20  |,r9.......GSUB  |
00004f50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 31  |              r1|
00004f60  2c 72 31 2c 72 30 20 20  20 20 20 20 20 20 20 20  |,r1,r0          |
00004f70  20 20 20 20 20 20 20 20  3b 20 72 31 20 69 73 20  |        ; r1 is |
00004f80  79 20 73 69 7a 65 20 6f  66 20 73 69 64 65 0d 1b  |y size of side..|
00004f90  94 3d 53 55 42 20 20 20  20 20 20 20 20 20 20 20  |.=SUB           |
00004fa0  20 20 20 20 20 72 33 2c  72 33 2c 72 32 20 20 20  |     r3,r3,r2   |
00004fb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00004fc0  20 72 33 20 3d 20 76 32  2d 76 31 0d 1b 9e 4a 4d  | r3 = v2-v1...JM|
00004fd0  4f 56 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |OV              |
00004fe0  20 20 72 32 2c 72 32 2c  41 53 4c 23 38 20 20 20  |  r2,r2,ASL#8   |
00004ff0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 72 32  |            ; r2|
00005000  20 69 73 20 73 63 61 6c  65 64 20 76 20 70 6f 73  | is scaled v pos|
00005010  69 74 69 6f 6e 0d 1b a8  04 0d 1b b2 49 a4 73 77  |ition.......I.sw|
00005020  6d 5f 72 64 69 76 5f 73  63 61 38 28 33 2c 31 2c  |m_rdiv_sca8(3,1,|
00005030  34 29 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4)              |
00005040  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00005050  20 72 34 20 69 73 20 76  20 73 74 65 70 20 73 69  | r4 is v step si|
00005060  7a 65 0d 1b bc 04 0d 1b  c6 04 0d 1b d0 1c 4d 4f  |ze............MO|
00005070  56 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |V               |
00005080  20 72 38 2c 23 30 0d 1b  da 1c 2e 74 65 78 5f 69  | r8,#0.....tex_i|
00005090  6e 74 65 72 70 6f 6c 5f  73 69 64 65 30 5f 6c 6f  |nterpol_side0_lo|
000050a0  6f 70 0d 1b e4 1e 43 4d  50 20 20 20 20 20 20 20  |op....CMP       |
000050b0  20 20 20 20 20 20 20 20  20 72 30 2c 23 32 35 36  |         r0,#256|
000050c0  0d 1b ee 29 42 47 45 20  20 20 20 20 20 20 20 20  |...)BGE         |
000050d0  20 20 20 20 20 20 20 74  65 78 5f 69 6e 74 65 72  |       tex_inter|
000050e0  70 6f 6c 5f 73 69 64 65  31 0d 1b f8 04 0d 1c 02  |pol_side1.......|
000050f0  5d 4d 4f 56 20 20 20 20  20 20 20 20 20 20 20 20  |]MOV            |
00005100  20 20 20 20 72 39 2c 72  30 2c 41 53 4c 23 34 20  |    r9,r0,ASL#4 |
00005110  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00005120  72 39 20 69 73 20 61 64  72 20 6f 66 66 73 65 74  |r9 is adr offset|
00005130  20 6f 66 20 63 75 72 72  65 6e 74 20 73 63 61 6e  | of current scan|
00005140  20 6c 69 6e 65 20 69 6e  66 6f 0d 1c 0c 5c 41 44  | line info...\AD|
00005150  44 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |D               |
00005160  20 72 39 2c 72 39 2c 72  31 30 20 20 20 20 20 20  | r9,r9,r10      |
00005170  20 20 20 20 20 20 20 20  20 20 20 3b 20 72 39 20  |           ; r9 |
00005180  69 73 20 61 63 74 75 61  6c 20 61 64 72 20 6f 66  |is actual adr of|
00005190  20 20 20 20 22 20 20 20  20 20 20 22 20 20 20 20  |    "      "    |
000051a0  20 22 20 20 20 22 0d 1c  16 47 53 54 52 20 20 20  | "   "...GSTR   |
000051b0  20 20 20 20 20 20 20 20  20 20 20 20 20 72 38 2c  |             r8,|
000051c0  5b 72 39 2c 23 34 5d 20  20 20 20 20 20 20 20 20  |[r9,#4]         |
000051d0  20 20 20 20 20 20 20 3b  20 73 74 6f 72 65 20 30  |       ; store 0|
000051e0  20 69 6e 74 6f 20 75 20  73 70 61 63 65 0d 1c 20  | into u space.. |
000051f0  3f 4d 4f 56 20 20 20 20  20 20 20 20 20 20 20 20  |?MOV            |
00005200  20 20 20 20 72 35 2c 72  32 2c 41 53 52 23 38 20  |    r5,r2,ASR#8 |
00005210  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00005220  72 35 20 3d 20 72 32 20  3e 3e 20 38 0d 1c 2a 21  |r5 = r2 >> 8..*!|
00005230  53 54 52 20 20 20 20 20  20 20 20 20 20 20 20 20  |STR             |
00005240  20 20 20 72 35 2c 5b 72  39 2c 23 38 5d 0d 1c 34  |   r5,[r9,#8]..4|
00005250  04 0d 1c 3e 1f 41 44 44  20 20 20 20 20 20 20 20  |...>.ADD        |
00005260  20 20 20 20 20 20 20 20  72 32 2c 72 32 2c 72 34  |        r2,r2,r4|
00005270  0d 1c 48 04 0d 1c 52 47  41 44 44 20 20 20 20 20  |..H...RGADD     |
00005280  20 20 20 20 20 20 20 20  20 20 20 72 30 2c 72 30  |           r0,r0|
00005290  2c 23 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#1             |
000052a0  20 20 20 20 20 3b 20 69  6e 63 72 65 6d 65 6e 74  |     ; increment|
000052b0  20 79 20 70 6f 73 69 74  69 6f 6e 0d 1c 5c 1f 53  | y position..\.S|
000052c0  55 42 53 20 20 20 20 20  20 20 20 20 20 20 20 20  |UBS             |
000052d0  20 20 72 31 2c 72 31 2c  23 31 0d 1c 66 2e 42 47  |  r1,r1,#1..f.BG|
000052e0  45 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |E               |
000052f0  20 74 65 78 5f 69 6e 74  65 72 70 6f 6c 5f 73 69  | tex_interpol_si|
00005300  64 65 30 5f 6c 6f 6f 70  0d 1c 70 04 0d 1c 7a 04  |de0_loop..p...z.|
00005310  0d 1c 84 17 2e 74 65 78  5f 69 6e 74 65 72 70 6f  |.....tex_interpo|
00005320  6c 5f 73 69 64 65 31 0d  1c 8e 18 3b 20 69 6e 74  |l_side1....; int|
00005330  65 72 70 6f 6c 61 74 65  20 73 69 64 65 20 31 0d  |erpolate side 1.|
00005340  1c 98 1e 3b 20 30 2c 33  31 20 2d 2d 2d 2d 2d 2d  |...; 0,31 ------|
00005350  2d 2d 2d 2d 2d 2d 2d 20  33 31 2c 33 31 0d 1c a2  |------- 31,31...|
00005360  1c 3b 20 76 20 63 6f 6f  72 64 20 73 74 61 79 73  |.; v coord stays|
00005370  20 63 6f 6e 73 74 61 6e  74 0d 1c ac 04 0d 1c b6  | constant.......|
00005380  25 3b 20 6c 6f 61 64 20  79 20 63 6f 6f 72 64 73  |%; load y coords|
00005390  20 6f 66 20 70 6f 69 6e  74 73 20 31 20 61 6e 64  | of points 1 and|
000053a0  20 32 0d 1c c0 36 4c 44  52 20 20 20 20 20 20 20  | 2...6LDR       |
000053b0  20 20 20 20 20 20 20 20  20 72 30 2c 5b 72 31 32  |         r0,[r12|
000053c0  2c 23 31 32 5d 20 20 20  20 20 20 20 20 20 20 20  |,#12]           |
000053d0  20 20 20 20 3b 20 79 30  0d 1c ca 36 4c 44 52 20  |    ; y0...6LDR |
000053e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 72  |               r|
000053f0  31 2c 5b 72 31 32 2c 23  32 30 5d 20 20 20 20 20  |1,[r12,#20]     |
00005400  20 20 20 20 20 20 20 20  20 20 3b 20 79 31 0d 1c  |          ; y1..|
00005410  d4 04 0d 1c de 1c 43 4d  50 20 20 20 20 20 20 20  |......CMP       |
00005420  20 20 20 20 20 20 20 20  20 72 30 2c 72 31 0d 1c  |         r0,r1..|
00005430  e8 4e 4c 44 52 4c 54 20  20 20 20 20 20 20 20 20  |.NLDRLT         |
00005440  20 20 20 20 20 72 31 30  2c 5b 72 31 32 2c 23 34  |     r10,[r12,#4|
00005450  30 5d 20 20 20 20 20 20  20 20 3b 20 69 66 20 79  |0]        ; if y|
00005460  30 20 3c 20 79 31 20 6c  6f 61 64 20 62 61 73 65  |0 < y1 load base|
00005470  20 6f 66 20 6c 68 73 5f  6c 69 73 74 0d 1c f2 4e  | of lhs_list...N|
00005480  4c 44 52 47 54 20 20 20  20 20 20 20 20 20 20 20  |LDRGT           |
00005490  20 20 20 72 31 30 2c 5b  72 31 32 2c 23 34 34 5d  |   r10,[r12,#44]|
000054a0  20 20 20 20 20 20 20 20  3b 20 69 66 20 79 30 20  |        ; if y0 |
000054b0  3e 20 79 31 20 6c 6f 61  64 20 62 61 73 65 20 6f  |> y1 load base o|
000054c0  66 20 72 68 73 5f 6c 69  73 74 0d 1c fc 58 42 45  |f rhs_list...XBE|
000054d0  51 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |Q               |
000054e0  20 74 65 78 5f 69 6e 74  65 72 70 6f 6c 5f 73 69  | tex_interpol_si|
000054f0  64 65 32 20 20 20 20 20  20 20 20 3b 20 69 66 20  |de2        ; if |
00005500  79 20 63 6f 6f 72 64 73  20 61 72 65 20 65 71 75  |y coords are equ|
00005510  61 6c 20 67 6f 20 74 6f  20 6e 65 78 74 20 73 69  |al go to next si|
00005520  64 65 0d 1d 06 04 0d 1d  10 35 4d 4f 56 4c 54 20  |de.......5MOVLT |
00005530  20 20 20 20 20 20 20 20  20 20 20 20 20 72 32 2c  |             r2,|
00005540  23 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#0              |
00005550  20 20 20 20 20 20 20 3b  20 75 30 0d 1d 1a 38 4d  |       ; u0...8M|
00005560  4f 56 4c 54 20 20 20 20  20 20 20 20 20 20 20 20  |OVLT            |
00005570  20 20 72 33 2c 23 33 31  3c 3c 38 20 20 20 20 20  |  r3,#31<<8     |
00005580  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00005590  20 75 31 0d 1d 24 04 0d  1d 2e 5f 4d 4f 56 47 54  | u1..$...._MOVGT|
000055a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 32  |              r2|
000055b0  2c 23 33 31 3c 3c 38 20  20 20 20 20 20 20 20 20  |,#31<<8         |
000055c0  20 20 20 20 20 20 20 20  20 20 20 3b 20 75 31 20  |           ; u1 |
000055d0  20 20 20 20 20 20 20 20  20 69 66 20 79 30 20 3e  |         if y0 >|
000055e0  20 79 31 20 72 65 76 65  72 73 65 20 75 2c 76 20  | y1 reverse u,v |
000055f0  63 6f 6f 72 64 73 0d 1d  38 35 4d 4f 56 47 54 20  |coords..85MOVGT |
00005600  20 20 20 20 20 20 20 20  20 20 20 20 20 72 33 2c  |             r3,|
00005610  23 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#0              |
00005620  20 20 20 20 20 20 20 3b  20 75 30 0d 1d 42 04 0d  |       ; u0..B..|
00005630  1d 4c 4b 4d 4f 56 47 54  20 20 20 20 20 20 20 20  |.LKMOVGT        |
00005640  20 20 20 20 20 20 72 39  2c 72 30 20 20 20 20 20  |      r9,r0     |
00005650  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005660  3b 20 69 66 20 79 30 20  3e 20 79 31 20 73 77 61  |; if y0 > y1 swa|
00005670  70 20 79 20 63 6f 6f 72  64 73 0d 1d 56 1c 4d 4f  |p y coords..V.MO|
00005680  56 47 54 20 20 20 20 20  20 20 20 20 20 20 20 20  |VGT             |
00005690  20 72 30 2c 72 31 0d 1d  60 1c 4d 4f 56 47 54 20  | r0,r1..`.MOVGT |
000056a0  20 20 20 20 20 20 20 20  20 20 20 20 20 72 31 2c  |             r1,|
000056b0  72 39 0d 1d 6a 04 0d 1d  74 47 53 55 42 20 20 20  |r9..j...tGSUB   |
000056c0  20 20 20 20 20 20 20 20  20 20 20 20 20 72 31 2c  |             r1,|
000056d0  72 31 2c 72 30 20 20 20  20 20 20 20 20 20 20 20  |r1,r0           |
000056e0  20 20 20 20 20 20 20 3b  20 72 31 20 69 73 20 79  |       ; r1 is y|
000056f0  20 73 69 7a 65 20 6f 66  20 73 69 64 65 0d 1d 7e  | size of side..~|
00005700  3d 53 55 42 20 20 20 20  20 20 20 20 20 20 20 20  |=SUB            |
00005710  20 20 20 20 72 33 2c 72  33 2c 72 32 20 20 20 20  |    r3,r3,r2    |
00005720  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00005730  72 33 20 3d 20 75 32 2d  75 31 0d 1d 88 4a 4d 4f  |r3 = u2-u1...JMO|
00005740  56 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |V               |
00005750  20 72 32 2c 72 32 2c 41  53 4c 23 38 20 20 20 20  | r2,r2,ASL#8    |
00005760  20 20 20 20 20 20 20 20  20 20 20 3b 20 72 32 20  |           ; r2 |
00005770  69 73 20 73 63 61 6c 65  64 20 76 20 70 6f 73 69  |is scaled v posi|
00005780  74 69 6f 6e 0d 1d 92 04  0d 1d 9c 49 a4 73 77 6d  |tion.......I.swm|
00005790  5f 72 64 69 76 5f 73 63  61 38 28 33 2c 31 2c 34  |_rdiv_sca8(3,1,4|
000057a0  29 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |)               |
000057b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
000057c0  72 34 20 69 73 20 76 20  73 74 65 70 20 73 69 7a  |r4 is v step siz|
000057d0  65 0d 1d a6 04 0d 1d b0  04 0d 1d ba 20 4d 4f 56  |e........... MOV|
000057e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000057f0  72 38 2c 23 33 31 3c 3c  38 0d 1d c4 1c 2e 74 65  |r8,#31<<8.....te|
00005800  78 5f 69 6e 74 65 72 70  6f 6c 5f 73 69 64 65 31  |x_interpol_side1|
00005810  5f 6c 6f 6f 70 0d 1d ce  1e 43 4d 50 20 20 20 20  |_loop....CMP    |
00005820  20 20 20 20 20 20 20 20  20 20 20 20 72 30 2c 23  |            r0,#|
00005830  32 35 36 0d 1d d8 29 42  47 45 20 20 20 20 20 20  |256...)BGE      |
00005840  20 20 20 20 20 20 20 20  20 20 74 65 78 5f 69 6e  |          tex_in|
00005850  74 65 72 70 6f 6c 5f 73  69 64 65 32 0d 1d e2 04  |terpol_side2....|
00005860  0d 1d ec 5d 4d 4f 56 20  20 20 20 20 20 20 20 20  |...]MOV         |
00005870  20 20 20 20 20 20 20 72  39 2c 72 30 2c 41 53 4c  |       r9,r0,ASL|
00005880  23 34 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#4              |
00005890  20 3b 20 72 39 20 69 73  20 61 64 72 20 6f 66 66  | ; r9 is adr off|
000058a0  73 65 74 20 6f 66 20 63  75 72 72 65 6e 74 20 73  |set of current s|
000058b0  63 61 6e 20 6c 69 6e 65  20 69 6e 66 6f 0d 1d f6  |can line info...|
000058c0  5c 41 44 44 20 20 20 20  20 20 20 20 20 20 20 20  |\ADD            |
000058d0  20 20 20 20 72 39 2c 72  39 2c 72 31 30 20 20 20  |    r9,r9,r10   |
000058e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
000058f0  72 39 20 69 73 20 61 63  74 75 61 6c 20 61 64 72  |r9 is actual adr|
00005900  20 6f 66 20 20 20 20 22  20 20 20 20 20 20 22 20  | of    "      " |
00005910  20 20 20 20 22 20 20 20  22 0d 1e 00 4b 53 54 52  |    "   "...KSTR|
00005920  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005930  72 38 2c 5b 72 39 2c 23  38 5d 20 20 20 20 20 20  |r8,[r9,#8]      |
00005940  20 20 20 20 20 20 20 20  20 20 3b 20 73 74 6f 72  |          ; stor|
00005950  65 20 31 36 3c 3c 38 20  69 6e 74 6f 20 76 20 73  |e 16<<8 into v s|
00005960  70 61 63 65 0d 1e 0a 3f  4d 4f 56 20 20 20 20 20  |pace...?MOV     |
00005970  20 20 20 20 20 20 20 20  20 20 20 72 35 2c 72 32  |           r5,r2|
00005980  2c 41 53 52 23 38 20 20  20 20 20 20 20 20 20 20  |,ASR#8          |
00005990  20 20 20 20 20 3b 20 72  35 20 3d 20 72 32 20 3e  |     ; r5 = r2 >|
000059a0  3e 20 38 0d 1e 14 21 53  54 52 20 20 20 20 20 20  |> 8...!STR      |
000059b0  20 20 20 20 20 20 20 20  20 20 72 35 2c 5b 72 39  |          r5,[r9|
000059c0  2c 23 34 5d 0d 1e 1e 04  0d 1e 28 1f 41 44 44 20  |,#4]......(.ADD |
000059d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 72  |               r|
000059e0  32 2c 72 32 2c 72 34 0d  1e 32 04 0d 1e 3c 47 41  |2,r2,r4..2...<GA|
000059f0  44 44 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |DD              |
00005a00  20 20 72 30 2c 72 30 2c  23 31 20 20 20 20 20 20  |  r0,r0,#1      |
00005a10  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 69 6e  |            ; in|
00005a20  63 72 65 6d 65 6e 74 20  79 20 70 6f 73 69 74 69  |crement y positi|
00005a30  6f 6e 0d 1e 46 1f 53 55  42 53 20 20 20 20 20 20  |on..F.SUBS      |
00005a40  20 20 20 20 20 20 20 20  20 72 31 2c 72 31 2c 23  |         r1,r1,#|
00005a50  31 0d 1e 50 2e 42 47 45  20 20 20 20 20 20 20 20  |1..P.BGE        |
00005a60  20 20 20 20 20 20 20 20  74 65 78 5f 69 6e 74 65  |        tex_inte|
00005a70  72 70 6f 6c 5f 73 69 64  65 31 5f 6c 6f 6f 70 0d  |rpol_side1_loop.|
00005a80  1e 5a 04 0d 1e 64 04 0d  1e 6e 04 0d 1e 78 17 2e  |.Z...d...n...x..|
00005a90  74 65 78 5f 69 6e 74 65  72 70 6f 6c 5f 73 69 64  |tex_interpol_sid|
00005aa0  65 32 0d 1e 82 18 3b 20  69 6e 74 65 72 70 6f 6c  |e2....; interpol|
00005ab0  61 74 65 20 73 69 64 65  20 32 0d 1e 8c 19 3b 20  |ate side 2....; |
00005ac0  33 31 2c 30 20 20 20 20  20 20 20 20 20 20 20 20  |31,0            |
00005ad0  20 70 33 0d 1e 96 0b 3b  20 20 20 20 20 7c 0d 1e  | p3....;     |..|
00005ae0  a0 0b 3b 20 20 20 20 20  7c 0d 1e aa 0b 3b 20 20  |..;     |....;  |
00005af0  20 20 20 7c 0d 1e b4 0b  3b 20 20 20 20 20 7c 0d  |   |....;     |.|
00005b00  1e be 0b 3b 20 20 20 20  20 7c 0d 1e c8 19 3b 20  |...;     |....; |
00005b10  33 31 2c 33 31 20 20 20  20 20 20 20 20 20 20 20  |31,31           |
00005b20  20 70 32 0d 1e d2 22 3b  20 75 20 63 6f 6f 72 64  | p2..."; u coord|
00005b30  20 73 74 61 79 73 20 63  6f 6e 73 74 61 6e 74 20  | stays constant |
00005b40  61 74 20 33 31 0d 1e dc  04 0d 1e e6 04 0d 1e f0  |at 31...........|
00005b50  04 0d 1e fa 25 3b 20 6c  6f 61 64 20 79 20 63 6f  |....%; load y co|
00005b60  6f 72 64 73 20 6f 66 20  70 6f 69 6e 74 73 20 32  |ords of points 2|
00005b70  20 61 6e 64 20 33 0d 1f  04 36 4c 44 52 20 20 20  | and 3...6LDR   |
00005b80  20 20 20 20 20 20 20 20  20 20 20 20 20 72 30 2c  |             r0,|
00005b90  5b 72 31 32 2c 23 32 30  5d 20 20 20 20 20 20 20  |[r12,#20]       |
00005ba0  20 20 20 20 20 20 20 20  3b 20 79 30 0d 1f 0e 36  |        ; y0...6|
00005bb0  4c 44 52 20 20 20 20 20  20 20 20 20 20 20 20 20  |LDR             |
00005bc0  20 20 20 72 31 2c 5b 72  31 32 2c 23 32 38 5d 20  |   r1,[r12,#28] |
00005bd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00005be0  79 31 0d 1f 18 04 0d 1f  22 1c 43 4d 50 20 20 20  |y1......".CMP   |
00005bf0  20 20 20 20 20 20 20 20  20 20 20 20 20 72 30 2c  |             r0,|
00005c00  72 31 0d 1f 2c 4e 4c 44  52 4c 54 20 20 20 20 20  |r1..,NLDRLT     |
00005c10  20 20 20 20 20 20 20 20  20 72 31 30 2c 5b 72 31  |         r10,[r1|
00005c20  32 2c 23 34 30 5d 20 20  20 20 20 20 20 20 3b 20  |2,#40]        ; |
00005c30  69 66 20 79 30 20 3c 20  79 31 20 6c 6f 61 64 20  |if y0 < y1 load |
00005c40  62 61 73 65 20 6f 66 20  6c 68 73 5f 6c 69 73 74  |base of lhs_list|
00005c50  0d 1f 36 4e 4c 44 52 47  54 20 20 20 20 20 20 20  |..6NLDRGT       |
00005c60  20 20 20 20 20 20 20 72  31 30 2c 5b 72 31 32 2c  |       r10,[r12,|
00005c70  23 34 34 5d 20 20 20 20  20 20 20 20 3b 20 69 66  |#44]        ; if|
00005c80  20 79 30 20 3e 20 79 31  20 6c 6f 61 64 20 62 61  | y0 > y1 load ba|
00005c90  73 65 20 6f 66 20 72 68  73 5f 6c 69 73 74 0d 1f  |se of rhs_list..|
00005ca0  40 58 42 45 51 20 20 20  20 20 20 20 20 20 20 20  |@XBEQ           |
00005cb0  20 20 20 20 20 74 65 78  5f 69 6e 74 65 72 70 6f  |     tex_interpo|
00005cc0  6c 5f 73 69 64 65 33 20  20 20 20 20 20 20 20 3b  |l_side3        ;|
00005cd0  20 69 66 20 79 20 63 6f  6f 72 64 73 20 61 72 65  | if y coords are|
00005ce0  20 65 71 75 61 6c 20 67  6f 20 74 6f 20 6e 65 78  | equal go to nex|
00005cf0  74 20 73 69 64 65 0d 1f  4a 04 0d 1f 54 35 4d 4f  |t side..J...T5MO|
00005d00  56 4c 54 20 20 20 20 20  20 20 20 20 20 20 20 20  |VLT             |
00005d10  20 72 32 2c 23 33 31 3c  3c 38 20 20 20 20 20 20  | r2,#31<<8      |
00005d20  20 20 20 20 20 20 20 20  20 20 20 3b 20 76 30 0d  |           ; v0.|
00005d30  1f 5e 35 4d 4f 56 4c 54  20 20 20 20 20 20 20 20  |.^5MOVLT        |
00005d40  20 20 20 20 20 20 72 33  2c 23 30 20 20 20 20 20  |      r3,#0     |
00005d50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005d60  3b 20 76 31 0d 1f 68 04  0d 1f 72 5c 4d 4f 56 47  |; v1..h...r\MOVG|
00005d70  54 20 20 20 20 20 20 20  20 20 20 20 20 20 20 72  |T              r|
00005d80  32 2c 23 30 20 20 20 20  20 20 20 20 20 20 20 20  |2,#0            |
00005d90  20 20 20 20 20 20 20 20  20 3b 20 76 31 20 20 20  |         ; v1   |
00005da0  20 20 20 20 20 20 20 69  66 20 79 30 20 3e 20 79  |       if y0 > y|
00005db0  31 20 72 65 76 65 72 73  65 20 75 2c 76 20 63 6f  |1 reverse u,v co|
00005dc0  6f 72 64 73 0d 1f 7c 35  4d 4f 56 47 54 20 20 20  |ords..|5MOVGT   |
00005dd0  20 20 20 20 20 20 20 20  20 20 20 72 33 2c 23 33  |           r3,#3|
00005de0  31 3c 3c 38 20 20 20 20  20 20 20 20 20 20 20 20  |1<<8            |
00005df0  20 20 20 20 20 3b 20 76  30 0d 1f 86 04 0d 1f 90  |     ; v0.......|
00005e00  4b 4d 4f 56 47 54 20 20  20 20 20 20 20 20 20 20  |KMOVGT          |
00005e10  20 20 20 20 72 39 2c 72  30 20 20 20 20 20 20 20  |    r9,r0       |
00005e20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00005e30  69 66 20 79 30 20 3e 20  79 31 20 73 77 61 70 20  |if y0 > y1 swap |
00005e40  79 20 63 6f 6f 72 64 73  0d 1f 9a 1c 4d 4f 56 47  |y coords....MOVG|
00005e50  54 20 20 20 20 20 20 20  20 20 20 20 20 20 20 72  |T              r|
00005e60  30 2c 72 31 0d 1f a4 1c  4d 4f 56 47 54 20 20 20  |0,r1....MOVGT   |
00005e70  20 20 20 20 20 20 20 20  20 20 20 72 31 2c 72 39  |           r1,r9|
00005e80  0d 1f ae 04 0d 1f b8 47  53 55 42 20 20 20 20 20  |.......GSUB     |
00005e90  20 20 20 20 20 20 20 20  20 20 20 72 31 2c 72 31  |           r1,r1|
00005ea0  2c 72 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,r0             |
00005eb0  20 20 20 20 20 3b 20 72  31 20 69 73 20 79 20 73  |     ; r1 is y s|
00005ec0  69 7a 65 20 6f 66 20 73  69 64 65 0d 1f c2 3d 53  |ize of side...=S|
00005ed0  55 42 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |UB              |
00005ee0  20 20 72 33 2c 72 33 2c  72 32 20 20 20 20 20 20  |  r3,r3,r2      |
00005ef0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 72 33  |            ; r3|
00005f00  20 3d 20 76 32 2d 76 31  0d 1f cc 4a 4d 4f 56 20  | = v2-v1...JMOV |
00005f10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 72  |               r|
00005f20  32 2c 72 32 2c 41 53 4c  23 38 20 20 20 20 20 20  |2,r2,ASL#8      |
00005f30  20 20 20 20 20 20 20 20  20 3b 20 72 32 20 69 73  |         ; r2 is|
00005f40  20 73 63 61 6c 65 64 20  76 20 70 6f 73 69 74 69  | scaled v positi|
00005f50  6f 6e 0d 1f d6 04 0d 1f  e0 49 a4 73 77 6d 5f 72  |on.......I.swm_r|
00005f60  64 69 76 5f 73 63 61 38  28 33 2c 31 2c 34 29 20  |div_sca8(3,1,4) |
00005f70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005f80  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 72 34  |            ; r4|
00005f90  20 69 73 20 76 20 73 74  65 70 20 73 69 7a 65 0d  | is v step size.|
00005fa0  1f ea 04 0d 1f f4 04 0d  1f fe 20 4d 4f 56 20 20  |.......... MOV  |
00005fb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 38  |              r8|
00005fc0  2c 23 33 31 3c 3c 38 0d  20 08 1c 2e 74 65 78 5f  |,#31<<8. ...tex_|
00005fd0  69 6e 74 65 72 70 6f 6c  5f 73 69 64 65 32 5f 6c  |interpol_side2_l|
00005fe0  6f 6f 70 0d 20 12 1e 43  4d 50 20 20 20 20 20 20  |oop. ..CMP      |
00005ff0  20 20 20 20 20 20 20 20  20 20 72 30 2c 23 32 35  |          r0,#25|
00006000  36 0d 20 1c 29 42 47 45  20 20 20 20 20 20 20 20  |6. .)BGE        |
00006010  20 20 20 20 20 20 20 20  74 65 78 5f 69 6e 74 65  |        tex_inte|
00006020  72 70 6f 6c 5f 73 69 64  65 33 0d 20 26 04 0d 20  |rpol_side3. &.. |
00006030  30 5d 4d 4f 56 20 20 20  20 20 20 20 20 20 20 20  |0]MOV           |
00006040  20 20 20 20 20 72 39 2c  72 30 2c 41 53 4c 23 34  |     r9,r0,ASL#4|
00006050  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00006060  20 72 39 20 69 73 20 61  64 72 20 6f 66 66 73 65  | r9 is adr offse|
00006070  74 20 6f 66 20 63 75 72  72 65 6e 74 20 73 63 61  |t of current sca|
00006080  6e 20 6c 69 6e 65 20 69  6e 66 6f 0d 20 3a 5c 41  |n line info. :\A|
00006090  44 44 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |DD              |
000060a0  20 20 72 39 2c 72 39 2c  72 31 30 20 20 20 20 20  |  r9,r9,r10     |
000060b0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 72 39  |            ; r9|
000060c0  20 69 73 20 61 63 74 75  61 6c 20 61 64 72 20 6f  | is actual adr o|
000060d0  66 20 20 20 20 22 20 20  20 20 20 20 22 20 20 20  |f    "      "   |
000060e0  20 20 22 20 20 20 22 0d  20 44 48 53 54 52 20 20  |  "   ". DHSTR  |
000060f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 38  |              r8|
00006100  2c 5b 72 39 2c 23 34 5d  20 20 20 20 20 20 20 20  |,[r9,#4]        |
00006110  20 20 20 20 20 20 20 20  3b 20 73 74 6f 72 65 20  |        ; store |
00006120  31 35 20 69 6e 74 6f 20  75 20 73 70 61 63 65 0d  |15 into u space.|
00006130  20 4e 40 4d 4f 56 20 20  20 20 20 20 20 20 20 20  | N@MOV          |
00006140  20 20 20 20 20 20 72 35  2c 72 32 2c 41 53 52 23  |      r5,r2,ASR#|
00006150  38 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |8               |
00006160  3b 20 72 35 20 3d 20 72  32 20 3e 3e 20 31 36 0d  |; r5 = r2 >> 16.|
00006170  20 58 21 53 54 52 20 20  20 20 20 20 20 20 20 20  | X!STR          |
00006180  20 20 20 20 20 20 72 35  2c 5b 72 39 2c 23 38 5d  |      r5,[r9,#8]|
00006190  0d 20 62 04 0d 20 6c 1f  41 44 44 20 20 20 20 20  |. b.. l.ADD     |
000061a0  20 20 20 20 20 20 20 20  20 20 20 72 32 2c 72 32  |           r2,r2|
000061b0  2c 72 34 0d 20 76 04 0d  20 80 47 41 44 44 20 20  |,r4. v.. .GADD  |
000061c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 30  |              r0|
000061d0  2c 72 30 2c 23 31 20 20  20 20 20 20 20 20 20 20  |,r0,#1          |
000061e0  20 20 20 20 20 20 20 20  3b 20 69 6e 63 72 65 6d  |        ; increm|
000061f0  65 6e 74 20 79 20 70 6f  73 69 74 69 6f 6e 0d 20  |ent y position. |
00006200  8a 1f 53 55 42 53 20 20  20 20 20 20 20 20 20 20  |..SUBS          |
00006210  20 20 20 20 20 72 31 2c  72 31 2c 23 31 0d 20 94  |     r1,r1,#1. .|
00006220  2e 42 47 45 20 20 20 20  20 20 20 20 20 20 20 20  |.BGE            |
00006230  20 20 20 20 74 65 78 5f  69 6e 74 65 72 70 6f 6c  |    tex_interpol|
00006240  5f 73 69 64 65 32 5f 6c  6f 6f 70 0d 20 9e 04 0d  |_side2_loop. ...|
00006250  20 a8 04 0d 20 b2 17 2e  74 65 78 5f 69 6e 74 65  | ... ...tex_inte|
00006260  72 70 6f 6c 5f 73 69 64  65 33 0d 20 bc 18 3b 20  |rpol_side3. ..; |
00006270  69 6e 74 65 72 70 6f 6c  61 74 65 20 73 69 64 65  |interpolate side|
00006280  20 33 0d 20 c6 40 3b 20  70 30 20 20 20 20 20 20  | 3. .@; p0      |
00006290  20 20 20 20 20 30 2c 30  20 2d 2d 2d 2d 2d 2d 2d  |     0,0 -------|
000062a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 20  |--------------- |
000062b0  33 31 2c 30 20 20 20 20  20 20 20 20 20 20 20 20  |31,0            |
000062c0  70 33 0d 20 d0 19 3b 20  76 20 63 6f 6f 72 64 20  |p3. ..; v coord |
000062d0  73 74 61 79 73 20 63 6f  6e 73 74 0d 20 da 04 0d  |stays const. ...|
000062e0  20 e4 04 0d 20 ee 04 0d  20 f8 25 3b 20 6c 6f 61  | ... ... .%; loa|
000062f0  64 20 79 20 63 6f 6f 72  64 73 20 6f 66 20 70 6f  |d y coords of po|
00006300  69 6e 74 73 20 33 20 61  6e 64 20 30 0d 21 02 36  |ints 3 and 0.!.6|
00006310  4c 44 52 20 20 20 20 20  20 20 20 20 20 20 20 20  |LDR             |
00006320  20 20 20 72 30 2c 5b 72  31 32 2c 23 32 38 5d 20  |   r0,[r12,#28] |
00006330  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00006340  79 30 0d 21 0c 35 4c 44  52 20 20 20 20 20 20 20  |y0.!.5LDR       |
00006350  20 20 20 20 20 20 20 20  20 72 31 2c 5b 72 31 32  |         r1,[r12|
00006360  2c 23 34 5d 20 20 20 20  20 20 20 20 20 20 20 20  |,#4]            |
00006370  20 20 20 3b 20 79 31 0d  21 16 04 0d 21 20 1c 43  |   ; y1.!...! .C|
00006380  4d 50 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |MP              |
00006390  20 20 72 30 2c 72 31 0d  21 2a 4e 4c 44 52 4c 54  |  r0,r1.!*NLDRLT|
000063a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 31  |              r1|
000063b0  30 2c 5b 72 31 32 2c 23  34 30 5d 20 20 20 20 20  |0,[r12,#40]     |
000063c0  20 20 20 3b 20 69 66 20  79 30 20 3c 20 79 31 20  |   ; if y0 < y1 |
000063d0  6c 6f 61 64 20 62 61 73  65 20 6f 66 20 6c 68 73  |load base of lhs|
000063e0  5f 6c 69 73 74 0d 21 34  4e 4c 44 52 47 54 20 20  |_list.!4NLDRGT  |
000063f0  20 20 20 20 20 20 20 20  20 20 20 20 72 31 30 2c  |            r10,|
00006400  5b 72 31 32 2c 23 34 34  5d 20 20 20 20 20 20 20  |[r12,#44]       |
00006410  20 3b 20 69 66 20 79 30  20 3e 20 79 31 20 6c 6f  | ; if y0 > y1 lo|
00006420  61 64 20 62 61 73 65 20  6f 66 20 72 68 73 5f 6c  |ad base of rhs_l|
00006430  69 73 74 0d 21 3e 58 42  45 51 20 20 20 20 20 20  |ist.!>XBEQ      |
00006440  20 20 20 20 20 20 20 20  20 20 74 65 78 5f 66 69  |          tex_fi|
00006450  6e 64 5f 71 75 61 64 5f  65 78 74 72 65 6d 65 73  |nd_quad_extremes|
00006460  20 20 20 20 3b 20 69 66  20 79 20 63 6f 6f 72 64  |    ; if y coord|
00006470  73 20 61 72 65 20 65 71  75 61 6c 20 67 6f 20 74  |s are equal go t|
00006480  6f 20 6e 65 78 74 20 73  69 64 65 0d 21 48 04 0d  |o next side.!H..|
00006490  21 52 38 4d 4f 56 4c 54  20 20 20 20 20 20 20 20  |!R8MOVLT        |
000064a0  20 20 20 20 20 20 72 32  2c 23 33 31 3c 3c 38 20  |      r2,#31<<8 |
000064b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000064c0  20 20 20 3b 20 75 30 0d  21 5c 35 4d 4f 56 4c 54  |   ; u0.!\5MOVLT|
000064d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 33  |              r3|
000064e0  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#0             |
000064f0  20 20 20 20 20 20 20 20  3b 20 75 31 0d 21 66 04  |        ; u1.!f.|
00006500  0d 21 70 5c 4d 4f 56 47  54 20 20 20 20 20 20 20  |.!p\MOVGT       |
00006510  20 20 20 20 20 20 20 72  32 2c 23 30 20 20 20 20  |       r2,#0    |
00006520  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006530  20 3b 20 75 31 20 20 20  20 20 20 20 20 20 20 69  | ; u1          i|
00006540  66 20 79 30 20 3e 20 79  31 20 72 65 76 65 72 73  |f y0 > y1 revers|
00006550  65 20 75 2c 76 20 63 6f  6f 72 64 73 0d 21 7a 38  |e u,v coords.!z8|
00006560  4d 4f 56 47 54 20 20 20  20 20 20 20 20 20 20 20  |MOVGT           |
00006570  20 20 20 72 33 2c 23 33  31 3c 3c 38 20 20 20 20  |   r3,#31<<8    |
00006580  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006590  3b 20 75 30 0d 21 84 04  0d 21 8e 4b 4d 4f 56 47  |; u0.!...!.KMOVG|
000065a0  54 20 20 20 20 20 20 20  20 20 20 20 20 20 20 72  |T              r|
000065b0  39 2c 72 30 20 20 20 20  20 20 20 20 20 20 20 20  |9,r0            |
000065c0  20 20 20 20 20 20 20 20  20 3b 20 69 66 20 79 30  |         ; if y0|
000065d0  20 3e 20 79 31 20 73 77  61 70 20 79 20 63 6f 6f  | > y1 swap y coo|
000065e0  72 64 73 0d 21 98 1c 4d  4f 56 47 54 20 20 20 20  |rds.!..MOVGT    |
000065f0  20 20 20 20 20 20 20 20  20 20 72 30 2c 72 31 0d  |          r0,r1.|
00006600  21 a2 1c 4d 4f 56 47 54  20 20 20 20 20 20 20 20  |!..MOVGT        |
00006610  20 20 20 20 20 20 72 31  2c 72 39 0d 21 ac 04 0d  |      r1,r9.!...|
00006620  21 b6 47 53 55 42 20 20  20 20 20 20 20 20 20 20  |!.GSUB          |
00006630  20 20 20 20 20 20 72 31  2c 72 31 2c 72 30 20 20  |      r1,r1,r0  |
00006640  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006650  3b 20 72 31 20 69 73 20  79 20 73 69 7a 65 20 6f  |; r1 is y size o|
00006660  66 20 73 69 64 65 0d 21  c0 3d 53 55 42 20 20 20  |f side.!.=SUB   |
00006670  20 20 20 20 20 20 20 20  20 20 20 20 20 72 33 2c  |             r3,|
00006680  72 33 2c 72 32 20 20 20  20 20 20 20 20 20 20 20  |r3,r2           |
00006690  20 20 20 20 20 20 20 3b  20 72 33 20 3d 20 75 32  |       ; r3 = u2|
000066a0  2d 75 31 0d 21 ca 4a 4d  4f 56 20 20 20 20 20 20  |-u1.!.JMOV      |
000066b0  20 20 20 20 20 20 20 20  20 20 72 32 2c 72 32 2c  |          r2,r2,|
000066c0  41 53 4c 23 38 20 20 20  20 20 20 20 20 20 20 20  |ASL#8           |
000066d0  20 20 20 20 3b 20 72 32  20 69 73 20 73 63 61 6c  |    ; r2 is scal|
000066e0  65 64 20 75 20 70 6f 73  69 74 69 6f 6e 0d 21 d4  |ed u position.!.|
000066f0  04 0d 21 de 49 a4 73 77  6d 5f 72 64 69 76 5f 73  |..!.I.swm_rdiv_s|
00006700  63 61 38 28 33 2c 31 2c  34 29 20 20 20 20 20 20  |ca8(3,1,4)      |
00006710  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006720  20 20 20 20 20 20 20 3b  20 72 34 20 69 73 20 75  |       ; r4 is u|
00006730  20 73 74 65 70 20 73 69  7a 65 0d 21 e8 04 0d 21  | step size.!...!|
00006740  f2 04 0d 21 fc 1c 4d 4f  56 20 20 20 20 20 20 20  |...!..MOV       |
00006750  20 20 20 20 20 20 20 20  20 72 38 2c 23 30 0d 22  |         r8,#0."|
00006760  06 1c 2e 74 65 78 5f 69  6e 74 65 72 70 6f 6c 5f  |...tex_interpol_|
00006770  73 69 64 65 33 5f 6c 6f  6f 70 0d 22 10 1e 43 4d  |side3_loop."..CM|
00006780  50 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |P               |
00006790  20 72 30 2c 23 32 35 36  0d 22 1a 2d 42 47 45 20  | r0,#256.".-BGE |
000067a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 74  |               t|
000067b0  65 78 5f 66 69 6e 64 5f  71 75 61 64 5f 65 78 74  |ex_find_quad_ext|
000067c0  72 65 6d 65 73 0d 22 24  04 0d 22 2e 04 0d 22 38  |remes."$.."..."8|
000067d0  5d 4d 4f 56 20 20 20 20  20 20 20 20 20 20 20 20  |]MOV            |
000067e0  20 20 20 20 72 39 2c 72  30 2c 41 53 4c 23 34 20  |    r9,r0,ASL#4 |
000067f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00006800  72 39 20 69 73 20 61 64  72 20 6f 66 66 73 65 74  |r9 is adr offset|
00006810  20 6f 66 20 63 75 72 72  65 6e 74 20 73 63 61 6e  | of current scan|
00006820  20 6c 69 6e 65 20 69 6e  66 6f 0d 22 42 5c 41 44  | line info."B\AD|
00006830  44 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |D               |
00006840  20 72 39 2c 72 39 2c 72  31 30 20 20 20 20 20 20  | r9,r9,r10      |
00006850  20 20 20 20 20 20 20 20  20 20 20 3b 20 72 39 20  |           ; r9 |
00006860  69 73 20 61 63 74 75 61  6c 20 61 64 72 20 6f 66  |is actual adr of|
00006870  20 20 20 20 22 20 20 20  20 20 20 22 20 20 20 20  |    "      "    |
00006880  20 22 20 20 20 22 0d 22  4c 47 53 54 52 20 20 20  | "   "."LGSTR   |
00006890  20 20 20 20 20 20 20 20  20 20 20 20 20 72 38 2c  |             r8,|
000068a0  5b 72 39 2c 23 38 5d 20  20 20 20 20 20 20 20 20  |[r9,#8]         |
000068b0  20 20 20 20 20 20 20 3b  20 73 74 6f 72 65 20 30  |       ; store 0|
000068c0  20 69 6e 74 6f 20 76 20  73 70 61 63 65 0d 22 56  | into v space."V|
000068d0  3e 4d 4f 56 20 20 20 20  20 20 20 20 20 20 20 20  |>MOV            |
000068e0  20 20 20 20 72 35 2c 72  32 2c 41 53 52 23 38 20  |    r5,r2,ASR#8 |
000068f0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 72  |             ; r|
00006900  35 20 3d 20 72 32 20 3e  3e 20 38 0d 22 60 21 53  |5 = r2 >> 8."`!S|
00006910  54 52 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |TR              |
00006920  20 20 72 35 2c 5b 72 39  2c 23 34 5d 0d 22 6a 04  |  r5,[r9,#4]."j.|
00006930  0d 22 74 1f 41 44 44 20  20 20 20 20 20 20 20 20  |."t.ADD         |
00006940  20 20 20 20 20 20 20 72  32 2c 72 32 2c 72 34 0d  |       r2,r2,r4.|
00006950  22 7e 04 0d 22 88 47 41  44 44 20 20 20 20 20 20  |"~..".GADD      |
00006960  20 20 20 20 20 20 20 20  20 20 72 30 2c 72 30 2c  |          r0,r0,|
00006970  23 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#1              |
00006980  20 20 20 20 3b 20 69 6e  63 72 65 6d 65 6e 74 20  |    ; increment |
00006990  79 20 70 6f 73 69 74 69  6f 6e 0d 22 92 1f 53 55  |y position."..SU|
000069a0  42 53 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |BS              |
000069b0  20 72 31 2c 72 31 2c 23  31 0d 22 9c 2e 42 47 45  | r1,r1,#1."..BGE|
000069c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000069d0  74 65 78 5f 69 6e 74 65  72 70 6f 6c 5f 73 69 64  |tex_interpol_sid|
000069e0  65 33 5f 6c 6f 6f 70 0d  22 a6 04 0d 22 b0 04 0d  |e3_loop."..."...|
000069f0  22 ba 04 0d 22 c4 1b 2e  74 65 78 5f 66 69 6e 64  |"..."...tex_find|
00006a00  5f 71 75 61 64 5f 65 78  74 72 65 6d 65 73 0d 22  |_quad_extremes."|
00006a10  ce 3c 4d 4f 56 20 20 20  20 20 20 20 20 20 20 20  |.<MOV           |
00006a20  20 20 20 20 20 72 31 2c  23 32 35 35 20 20 20 20  |     r1,#255    |
00006a30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00006a40  20 79 20 6d 69 6e 69 6d  75 6d 0d 22 d8 3c 4d 4f  | y minimum.".<MO|
00006a50  56 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |V               |
00006a60  20 72 39 2c 23 30 20 20  20 20 20 20 20 20 20 20  | r9,#0          |
00006a70  20 20 20 20 20 20 20 20  20 20 20 3b 20 79 20 6d  |           ; y m|
00006a80  61 78 69 6d 75 6d 0d 22  e2 04 0d 22 ec 3d 4c 44  |aximum."...".=LD|
00006a90  52 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R               |
00006aa0  20 72 34 2c 5b 72 31 32  2c 23 34 5d 20 20 20 20  | r4,[r12,#4]    |
00006ab0  20 20 20 20 20 20 20 20  20 20 20 3b 20 70 30 20  |           ; p0 |
00006ac0  79 20 63 6f 6f 72 64 0d  22 f6 4c 43 4d 50 20 20  |y coord.".LCMP  |
00006ad0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 34  |              r4|
00006ae0  2c 72 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,r1             |
00006af0  20 20 20 20 20 20 20 20  3b 20 69 66 20 79 20 63  |        ; if y c|
00006b00  6f 6f 72 64 20 3c 20 74  68 61 6e 20 6d 69 6e 69  |oord < than mini|
00006b10  6d 75 6d 0d 23 00 44 4d  4f 56 4c 54 20 20 20 20  |mum.#.DMOVLT    |
00006b20  20 20 20 20 20 20 20 20  20 20 72 31 2c 72 34 20  |          r1,r4 |
00006b30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006b40  20 20 20 20 3b 20 6d 69  6e 69 6d 75 6d 20 3d 20  |    ; minimum = |
00006b50  79 20 63 6f 6f 72 64 0d  23 0a 47 43 4d 50 20 20  |y coord.#.GCMP  |
00006b60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 34  |              r4|
00006b70  2c 72 39 20 20 20 20 20  20 20 20 20 20 20 20 20  |,r9             |
00006b80  20 20 20 20 20 20 20 20  3b 20 69 66 20 79 20 63  |        ; if y c|
00006b90  6f 6f 72 64 20 3e 20 6d  61 78 69 6d 75 6d 0d 23  |oord > maximum.#|
00006ba0  14 44 4d 4f 56 47 54 20  20 20 20 20 20 20 20 20  |.DMOVGT         |
00006bb0  20 20 20 20 20 72 39 2c  72 34 20 20 20 20 20 20  |     r9,r4      |
00006bc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00006bd0  20 6d 61 78 69 6d 75 6d  20 3d 20 79 20 63 6f 6f  | maximum = y coo|
00006be0  72 64 0d 23 1e 04 0d 23  28 3d 4c 44 52 20 20 20  |rd.#...#(=LDR   |
00006bf0  20 20 20 20 20 20 20 20  20 20 20 20 20 72 34 2c  |             r4,|
00006c00  5b 72 31 32 2c 23 31 32  5d 20 20 20 20 20 20 20  |[r12,#12]       |
00006c10  20 20 20 20 20 20 20 3b  20 70 31 20 79 20 63 6f  |       ; p1 y co|
00006c20  6f 72 64 0d 23 32 4c 43  4d 50 20 20 20 20 20 20  |ord.#2LCMP      |
00006c30  20 20 20 20 20 20 20 20  20 20 72 34 2c 72 31 20  |          r4,r1 |
00006c40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006c50  20 20 20 20 3b 20 69 66  20 79 20 63 6f 6f 72 64  |    ; if y coord|
00006c60  20 3c 20 74 68 61 6e 20  6d 69 6e 69 6d 75 6d 0d  | < than minimum.|
00006c70  23 3c 44 4d 4f 56 4c 54  20 20 20 20 20 20 20 20  |#<DMOVLT        |
00006c80  20 20 20 20 20 20 72 31  2c 72 34 20 20 20 20 20  |      r1,r4     |
00006c90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006ca0  3b 20 6d 69 6e 69 6d 75  6d 20 3d 20 79 20 63 6f  |; minimum = y co|
00006cb0  6f 72 64 0d 23 46 47 43  4d 50 20 20 20 20 20 20  |ord.#FGCMP      |
00006cc0  20 20 20 20 20 20 20 20  20 20 72 34 2c 72 39 20  |          r4,r9 |
00006cd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006ce0  20 20 20 20 3b 20 69 66  20 79 20 63 6f 6f 72 64  |    ; if y coord|
00006cf0  20 3e 20 6d 61 78 69 6d  75 6d 0d 23 50 44 4d 4f  | > maximum.#PDMO|
00006d00  56 47 54 20 20 20 20 20  20 20 20 20 20 20 20 20  |VGT             |
00006d10  20 72 39 2c 72 34 20 20  20 20 20 20 20 20 20 20  | r9,r4          |
00006d20  20 20 20 20 20 20 20 20  20 20 20 3b 20 6d 61 78  |           ; max|
00006d30  69 6d 75 6d 20 3d 20 79  20 63 6f 6f 72 64 0d 23  |imum = y coord.#|
00006d40  5a 04 0d 23 64 3d 4c 44  52 20 20 20 20 20 20 20  |Z..#d=LDR       |
00006d50  20 20 20 20 20 20 20 20  20 72 34 2c 5b 72 31 32  |         r4,[r12|
00006d60  2c 23 32 30 5d 20 20 20  20 20 20 20 20 20 20 20  |,#20]           |
00006d70  20 20 20 3b 20 70 32 20  79 20 63 6f 6f 72 64 0d  |   ; p2 y coord.|
00006d80  23 6e 4c 43 4d 50 20 20  20 20 20 20 20 20 20 20  |#nLCMP          |
00006d90  20 20 20 20 20 20 72 34  2c 72 31 20 20 20 20 20  |      r4,r1     |
00006da0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006db0  3b 20 69 66 20 79 20 63  6f 6f 72 64 20 3c 20 74  |; if y coord < t|
00006dc0  68 61 6e 20 6d 69 6e 69  6d 75 6d 0d 23 78 44 4d  |han minimum.#xDM|
00006dd0  4f 56 4c 54 20 20 20 20  20 20 20 20 20 20 20 20  |OVLT            |
00006de0  20 20 72 31 2c 72 34 20  20 20 20 20 20 20 20 20  |  r1,r4         |
00006df0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 6d 69  |            ; mi|
00006e00  6e 69 6d 75 6d 20 3d 20  79 20 63 6f 6f 72 64 0d  |nimum = y coord.|
00006e10  23 82 47 43 4d 50 20 20  20 20 20 20 20 20 20 20  |#.GCMP          |
00006e20  20 20 20 20 20 20 72 34  2c 72 39 20 20 20 20 20  |      r4,r9     |
00006e30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006e40  3b 20 69 66 20 79 20 63  6f 6f 72 64 20 3e 20 6d  |; if y coord > m|
00006e50  61 78 69 6d 75 6d 0d 23  8c 44 4d 4f 56 47 54 20  |aximum.#.DMOVGT |
00006e60  20 20 20 20 20 20 20 20  20 20 20 20 20 72 39 2c  |             r9,|
00006e70  72 34 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |r4              |
00006e80  20 20 20 20 20 20 20 3b  20 6d 61 78 69 6d 75 6d  |       ; maximum|
00006e90  20 3d 20 79 20 63 6f 6f  72 64 0d 23 96 04 0d 23  | = y coord.#...#|
00006ea0  a0 3d 4c 44 52 20 20 20  20 20 20 20 20 20 20 20  |.=LDR           |
00006eb0  20 20 20 20 20 72 34 2c  5b 72 31 32 2c 23 32 38  |     r4,[r12,#28|
00006ec0  5d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |]              ;|
00006ed0  20 70 33 20 79 20 63 6f  6f 72 64 0d 23 aa 4c 43  | p3 y coord.#.LC|
00006ee0  4d 50 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |MP              |
00006ef0  20 20 72 34 2c 72 31 20  20 20 20 20 20 20 20 20  |  r4,r1         |
00006f00  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 69 66  |            ; if|
00006f10  20 79 20 63 6f 6f 72 64  20 3c 20 74 68 61 6e 20  | y coord < than |
00006f20  6d 69 6e 69 6d 75 6d 0d  23 b4 44 4d 4f 56 4c 54  |minimum.#.DMOVLT|
00006f30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 31  |              r1|
00006f40  2c 72 34 20 20 20 20 20  20 20 20 20 20 20 20 20  |,r4             |
00006f50  20 20 20 20 20 20 20 20  3b 20 6d 69 6e 69 6d 75  |        ; minimu|
00006f60  6d 20 3d 20 79 20 63 6f  6f 72 64 0d 23 be 47 43  |m = y coord.#.GC|
00006f70  4d 50 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |MP              |
00006f80  20 20 72 34 2c 72 39 20  20 20 20 20 20 20 20 20  |  r4,r9         |
00006f90  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 69 66  |            ; if|
00006fa0  20 79 20 63 6f 6f 72 64  20 3e 20 6d 61 78 69 6d  | y coord > maxim|
00006fb0  75 6d 0d 23 c8 44 4d 4f  56 47 54 20 20 20 20 20  |um.#.DMOVGT     |
00006fc0  20 20 20 20 20 20 20 20  20 72 39 2c 72 34 20 20  |         r9,r4  |
00006fd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006fe0  20 20 20 3b 20 6d 61 78  69 6d 75 6d 20 3d 20 79  |   ; maximum = y|
00006ff0  20 63 6f 6f 72 64 0d 23  d2 04 0d 23 dc 04 0d 23  | coord.#...#...#|
00007000  e6 1c 43 4d 50 20 20 20  20 20 20 20 20 20 20 20  |..CMP           |
00007010  20 20 20 20 20 72 31 2c  72 39 0d 23 f0 4e 42 45  |     r1,r9.#.NBE|
00007020  51 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |Q               |
00007030  20 65 6e 64 5f 74 65 78  5f 71 75 61 64 20 20 20  | end_tex_quad   |
00007040  20 20 20 20 20 20 20 20  20 20 20 3b 20 69 66 20  |           ; if |
00007050  79 6d 69 6e 20 3d 20 79  6d 61 78 20 65 78 69 74  |ymin = ymax exit|
00007060  20 72 6f 75 74 69 6e 65  0d 23 fa 1e 43 4d 50 20  | routine.#..CMP |
00007070  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 72  |               r|
00007080  39 2c 23 32 35 36 0d 24  04 1e 4d 4f 56 47 45 20  |9,#256.$..MOVGE |
00007090  20 20 20 20 20 20 20 20  20 20 20 20 20 72 39 2c  |             r9,|
000070a0  23 32 35 35 0d 24 0e 04  0d 24 18 04 0d 24 22 3b  |#255.$...$...$";|
000070b0  4c 44 52 20 20 20 20 20  20 20 20 20 20 20 20 20  |LDR             |
000070c0  20 20 20 72 37 2c 5b 72  31 32 2c 23 34 30 5d 20  |   r7,[r12,#40] |
000070d0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 6c  |             ; l|
000070e0  68 73 5f 6c 69 73 74 0d  24 2c 3b 4c 44 52 20 20  |hs_list.$,;LDR  |
000070f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 38  |              r8|
00007100  2c 5b 72 31 32 2c 23 34  34 5d 20 20 20 20 20 20  |,[r12,#44]      |
00007110  20 20 20 20 20 20 20 20  3b 20 72 68 73 5f 6c 69  |        ; rhs_li|
00007120  73 74 0d 24 36 47 53 55  42 20 20 20 20 20 20 20  |st.$6GSUB       |
00007130  20 20 20 20 20 20 20 20  20 72 39 2c 72 39 2c 72  |         r9,r9,r|
00007140  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1               |
00007150  20 20 20 3b 20 72 39 20  69 73 20 79 20 73 69 7a  |   ; r9 is y siz|
00007160  65 20 6f 66 20 70 6f 6c  79 0d 24 40 11 3b 20 72  |e of poly.$@.; r|
00007170  31 20 69 73 20 79 20 70  6f 73 0d 24 4a 04 0d 24  |1 is y pos.$J..$|
00007180  54 14 2e 74 65 78 5f 72  65 6e 64 65 72 5f 70 6f  |T..tex_render_po|
00007190  6c 79 0d 24 5e 58 41 44  44 20 20 20 20 20 20 20  |ly.$^XADD       |
000071a0  20 20 20 20 20 20 20 20  20 72 31 30 2c 72 37 2c  |         r10,r7,|
000071b0  72 31 2c 41 53 4c 23 34  20 20 20 20 20 20 20 20  |r1,ASL#4        |
000071c0  20 20 20 3b 20 72 31 30  20 69 73 20 6c 68 73 20  |   ; r10 is lhs |
000071d0  69 6e 66 6f 20 66 6f 72  20 63 75 72 72 65 6e 74  |info for current|
000071e0  20 73 63 61 6e 20 6c 69  6e 65 0d 24 68 3f 4c 44  | scan line.$h?LD|
000071f0  52 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R               |
00007200  20 72 30 2c 5b 72 31 30  5d 20 20 20 20 20 20 20  | r0,[r10]       |
00007210  20 20 20 20 20 20 20 20  20 20 20 3b 20 6c 6f 61  |           ; loa|
00007220  64 20 73 74 61 72 74 20  78 0d 24 72 40 4c 44 52  |d start x.$r@LDR|
00007230  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007240  72 33 2c 5b 72 31 30 2c  23 34 5d 20 20 20 20 20  |r3,[r10,#4]     |
00007250  20 20 20 20 20 20 20 20  20 20 3b 20 72 33 20 69  |          ; r3 i|
00007260  73 20 73 74 61 72 74 20  75 0d 24 7c 40 4c 44 52  |s start u.$|@LDR|
00007270  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007280  72 34 2c 5b 72 31 30 2c  23 38 5d 20 20 20 20 20  |r4,[r10,#8]     |
00007290  20 20 20 20 20 20 20 20  20 20 3b 20 72 34 20 69  |          ; r4 i|
000072a0  73 20 73 74 61 72 74 20  76 0d 24 86 58 41 44 44  |s start v.$.XADD|
000072b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000072c0  72 31 30 2c 72 38 2c 72  31 2c 41 53 4c 23 34 20  |r10,r8,r1,ASL#4 |
000072d0  20 20 20 20 20 20 20 20  20 20 3b 20 72 31 30 20  |          ; r10 |
000072e0  69 73 20 72 68 73 20 69  6e 66 6f 20 66 6f 72 20  |is rhs info for |
000072f0  63 75 72 72 65 6e 74 20  73 63 61 6e 20 6c 69 6e  |current scan lin|
00007300  65 0d 24 90 4a 4c 44 52  20 20 20 20 20 20 20 20  |e.$.JLDR        |
00007310  20 20 20 20 20 20 20 20  72 32 2c 5b 72 31 30 5d  |        r2,[r10]|
00007320  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007330  20 20 3b 20 72 32 20 69  73 20 65 6e 64 20 63 6f  |  ; r2 is end co|
00007340  6f 72 64 20 6f 66 20 6c  69 6e 65 0d 24 9a 4b 53  |ord of line.$.KS|
00007350  55 42 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |UB              |
00007360  20 20 72 32 2c 72 32 2c  72 30 20 20 20 20 20 20  |  r2,r2,r0      |
00007370  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 72 32  |            ; r2|
00007380  20 69 73 20 6e 6f 77 20  6c 65 6e 67 74 68 20 6f  | is now length o|
00007390  66 20 6c 69 6e 65 0d 24  a4 44 4c 44 52 20 20 20  |f line.$.DLDR   |
000073a0  20 20 20 20 20 20 20 20  20 20 20 20 20 72 35 2c  |             r5,|
000073b0  5b 72 31 30 2c 23 34 5d  20 20 20 20 20 20 20 20  |[r10,#4]        |
000073c0  20 20 20 20 20 20 20 3b  20 72 35 20 69 73 20 65  |       ; r5 is e|
000073d0  6e 64 20 75 20 63 6f 6f  72 64 0d 24 ae 44 4c 44  |nd u coord.$.DLD|
000073e0  52 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R               |
000073f0  20 72 36 2c 5b 72 31 30  2c 23 38 5d 20 20 20 20  | r6,[r10,#8]    |
00007400  20 20 20 20 20 20 20 20  20 20 20 3b 20 72 36 20  |           ; r6 |
00007410  69 73 20 65 6e 64 20 76  20 63 6f 6f 72 64 0d 24  |is end v coord.$|
00007420  b8 04 0d 24 c2 04 0d 24  cc 1c 4d 4f 56 53 20 20  |...$...$..MOVS  |
00007430  20 20 20 20 20 20 20 20  20 20 20 20 20 72 32 2c  |             r2,|
00007440  72 32 0d 24 d6 4d 42 4c  47 54 20 20 20 20 20 20  |r2.$.MBLGT      |
00007450  20 20 20 20 20 20 20 20  20 74 65 78 5f 73 63 61  |         tex_sca|
00007460  6e 5f 6c 69 6e 65 20 20  20 20 20 20 20 20 20 20  |n_line          |
00007470  20 20 20 3b 20 6f 6e 6c  79 20 70 6c 6f 74 20 69  |   ; only plot i|
00007480  66 20 6c 69 6e 65 20 6c  65 6e 67 74 68 3e 30 0d  |f line length>0.|
00007490  24 e0 04 0d 24 ea 1f 41  44 44 20 20 20 20 20 20  |$...$..ADD      |
000074a0  20 20 20 20 20 20 20 20  20 20 72 31 2c 72 31 2c  |          r1,r1,|
000074b0  23 31 0d 24 f4 1f 53 55  42 53 20 20 20 20 20 20  |#1.$..SUBS      |
000074c0  20 20 20 20 20 20 20 20  20 72 39 2c 72 39 2c 23  |         r9,r9,#|
000074d0  31 0d 24 fe 26 42 47 54  20 20 20 20 20 20 20 20  |1.$.&BGT        |
000074e0  20 20 20 20 20 20 20 20  74 65 78 5f 72 65 6e 64  |        tex_rend|
000074f0  65 72 5f 70 6f 6c 79 0d  25 08 04 0d 25 12 11 2e  |er_poly.%...%...|
00007500  65 6e 64 5f 74 65 78 5f  71 75 61 64 0d 25 1c 2e  |end_tex_quad.%..|
00007510  4c 44 4d 46 41 20 20 20  20 20 20 20 20 20 20 20  |LDMFA           |
00007520  20 20 20 28 73 70 29 21  2c 7b 72 30 2d 72 31 30  |   (sp)!,{r0-r10|
00007530  2c 72 31 32 2c 6c 69 6e  6b 7d 0d 25 26 1e 4d 4f  |,r12,link}.%&.MO|
00007540  56 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |V               |
00007550  20 50 43 2c 6c 69 6e 6b  0d 25 30 04 0d 25 3a 04  | PC,link.%0..%:.|
00007560  0d 25 44 04 0d 25 4e 04  0d 25 58 04 0d 25 62 04  |.%D..%N..%X..%b.|
00007570  0d 25 6c 05 5d 0d 25 76  0b ed 20 70 61 73 73 25  |.%l.].%v.. pass%|
00007580  0d 25 80 04 0d 25 8a 05  e1 0d 25 94 04 0d 25 9e  |.%...%....%...%.|
00007590  38 f4 20 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |8. -------------|
000075a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 20 53  |-------------- S|
000075b0  45 54 55 50 20 33 44 20  43 52 41 46 54 53 20 2d  |ETUP 3D CRAFTS -|
000075c0  2d 2d 2d 2d 2d 0d 25 a8  04 0d 25 b2 04 0d 25 bc  |-----.%...%...%.|
000075d0  16 dd 20 f2 73 65 74 75  70 5f 33 64 5f 63 72 61  |.. .setup_3d_cra|
000075e0  66 74 73 0d 25 c6 04 0d  25 d0 21 f1 20 27 22 53  |fts.%...%.!. '"S|
000075f0  65 74 74 69 6e 67 20 75  70 20 33 44 20 63 72 61  |etting up 3D cra|
00007600  66 74 20 64 61 74 61 22  0d 25 da 15 c8 99 20 22  |ft data".%.... "|
00007610  48 6f 75 72 67 6c 61 73  73 5f 4f 6e 22 0d 25 e4  |Hourglass_On".%.|
00007620  04 0d 25 ee 31 66 68 3d  8e 22 3c 50 65 72 70 65  |..%.1fh=."<Perpe|
00007630  74 75 61 6c 5f 4d 6f 74  69 6f 6e 24 44 69 72 3e  |tual_Motion$Dir>|
00007640  2e 43 72 61 66 74 73 2e  43 72 61 66 74 44 61 74  |.Crafts.CraftDat|
00007650  61 22 0d 25 f8 04 0d 26  02 15 e8 23 66 68 2c 6e  |a".%...&...#fh,n|
00007660  6f 5f 6f 66 5f 63 72 61  66 74 25 0d 26 0c 27 de  |o_of_craft%.&.'.|
00007670  20 63 72 61 66 74 5f 68  65 61 64 65 72 5f 6c 69  | craft_header_li|
00007680  73 74 25 20 6e 6f 5f 6f  66 5f 63 72 61 66 74 25  |st% no_of_craft%|
00007690  2a 34 0d 26 16 04 0d 26  20 35 63 72 61 66 74 5f  |*4.&...& 5craft_|
000076a0  33 64 5f 64 61 74 61 5f  73 69 7a 65 25 3d 38 20  |3d_data_size%=8 |
000076b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3a 20  |              : |
000076c0  f4 20 73 69 7a 65 20 69  6e 20 4b 0d 26 2a 2d de  |. size in K.&*-.|
000076d0  20 63 72 61 66 74 5f 33  64 5f 64 61 74 61 25 20  | craft_3d_data% |
000076e0  63 72 61 66 74 5f 33 64  5f 64 61 74 61 5f 73 69  |craft_3d_data_si|
000076f0  7a 65 25 2a 31 30 32 34  0d 26 34 04 0d 26 3e 04  |ze%*1024.&4..&>.|
00007700  0d 26 48 15 50 25 3d 63  72 61 66 74 5f 33 64 5f  |.&H.P%=craft_3d_|
00007710  64 61 74 61 25 0d 26 52  30 4c 25 3d 63 72 61 66  |data%.&R0L%=craf|
00007720  74 5f 33 64 5f 64 61 74  61 25 2b 28 63 72 61 66  |t_3d_data%+(craf|
00007730  74 5f 33 64 5f 64 61 74  61 5f 73 69 7a 65 25 2a  |t_3d_data_size%*|
00007740  31 30 32 34 29 0d 26 5c  04 0d 26 66 24 e3 20 63  |1024).&\..&f$. c|
00007750  72 61 66 74 5f 6e 6f 25  3d 30 20 b8 20 28 6e 6f  |raft_no%=0 . (no|
00007760  5f 6f 66 5f 63 72 61 66  74 25 2d 31 29 0d 26 70  |_of_craft%-1).&p|
00007770  04 0d 26 7a 16 e8 23 66  68 2c 63 72 61 66 74 5f  |..&z..#fh,craft_|
00007780  70 6f 69 6e 74 73 25 0d  26 84 16 e8 23 66 68 2c  |points%.&...#fh,|
00007790  63 72 61 66 74 5f 66 61  63 65 74 73 25 0d 26 8e  |craft_facets%.&.|
000077a0  04 0d 26 98 28 63 72 61  66 74 5f 6f 72 69 67 5f  |..&.(craft_orig_|
000077b0  64 61 74 25 3d a4 69 6e  69 74 5f 63 72 61 66 74  |dat%=.init_craft|
000077c0  5f 6f 72 69 67 5f 64 61  74 0d 26 a2 2a 63 72 61  |_orig_dat.&.*cra|
000077d0  66 74 5f 74 72 61 6e 73  5f 64 61 74 25 3d a4 69  |ft_trans_dat%=.i|
000077e0  6e 69 74 5f 63 72 61 66  74 5f 74 72 61 6e 73 5f  |nit_craft_trans_|
000077f0  64 61 74 0d 26 ac 2a 63  72 61 66 74 5f 66 69 6e  |dat.&.*craft_fin|
00007800  61 6c 5f 64 61 74 25 3d  a4 69 6e 69 74 5f 63 72  |al_dat%=.init_cr|
00007810  61 66 74 5f 66 69 6e 61  6c 5f 64 61 74 0d 26 b6  |aft_final_dat.&.|
00007820  2c 63 72 61 66 74 5f 72  65 6e 64 65 72 5f 64 61  |,craft_render_da|
00007830  74 25 3d a4 69 6e 69 74  5f 63 72 61 66 74 5f 72  |t%=.init_craft_r|
00007840  65 6e 64 65 72 5f 64 61  74 0d 26 c0 04 0d 26 ca  |ender_dat.&...&.|
00007850  24 63 72 61 66 74 5f 68  65 61 64 65 72 25 3d a4  |$craft_header%=.|
00007860  69 6e 69 74 5f 63 72 61  66 74 5f 68 65 61 64 65  |init_craft_heade|
00007870  72 0d 26 d4 04 0d 26 de  32 63 72 61 66 74 5f 68  |r.&...&.2craft_h|
00007880  65 61 64 65 72 5f 6c 69  73 74 25 21 28 63 72 61  |eader_list%!(cra|
00007890  66 74 5f 6e 6f 25 2a 34  29 3d 63 72 61 66 74 5f  |ft_no%*4)=craft_|
000078a0  68 65 61 64 65 72 25 0d  26 e8 04 0d 26 f2 04 0d  |header%.&...&...|
000078b0  26 fc 59 f4 50 52 49 4e  54 20 22 63 72 61 66 74  |&.Y.PRINT "craft|
000078c0  20 22 3b 63 72 61 66 74  5f 6e 6f 25 3b 22 20 69  | ";craft_no%;" i|
000078d0  6e 69 74 69 61 6c 69 73  65 64 20 20 2d 20 20 61  |nitialised  -  a|
000078e0  64 72 20 22 3b 21 28 63  72 61 66 74 5f 68 65 61  |dr ";!(craft_hea|
000078f0  64 65 72 5f 6c 69 73 74  25 2b 28 63 72 61 66 74  |der_list%+(craft|
00007900  5f 6e 6f 25 2a 34 29 29  0d 27 06 04 0d 27 10 04  |_no%*4)).'...'..|
00007910  0d 27 1a 0f ed 20 63 72  61 66 74 5f 6e 6f 25 0d  |.'... craft_no%.|
00007920  27 24 04 0d 27 2e 16 c8  99 20 22 48 6f 75 72 67  |'$..'.... "Hourg|
00007930  6c 61 73 73 5f 4f 66 66  22 0d 27 38 08 d9 23 66  |lass_Off".'8..#f|
00007940  68 0d 27 42 04 0d 27 4c  05 e1 0d 27 56 04 0d 27  |h.'B..'L...'V..'|
00007950  60 04 0d 27 6a 1a dd 20  a4 69 6e 69 74 5f 63 72  |`..'j.. .init_cr|
00007960  61 66 74 5f 6f 72 69 67  5f 64 61 74 0d 27 74 18  |aft_orig_dat.'t.|
00007970  ea 20 61 64 72 25 2c 70  6e 6f 25 2c 78 25 2c 79  |. adr%,pno%,x%,y|
00007980  25 2c 7a 25 0d 27 7e 04  0d 27 88 0b 61 64 72 25  |%,z%.'~..'..adr%|
00007990  3d 50 25 0d 27 92 04 0d  27 9c 20 e3 20 70 6e 6f  |=P%.'...'. . pno|
000079a0  25 3d 30 20 b8 20 28 63  72 61 66 74 5f 70 6f 69  |%=0 . (craft_poi|
000079b0  6e 74 73 25 2d 31 29 0d  27 a6 04 0d 27 b0 0b e8  |nts%-1).'...'...|
000079c0  23 66 68 2c 78 25 0d 27  ba 0b e8 23 66 68 2c 79  |#fh,x%.'...#fh,y|
000079d0  25 0d 27 c4 0b e8 23 66  68 2c 7a 25 0d 27 ce 04  |%.'...#fh,z%.'..|
000079e0  0d 27 d8 04 0d 27 e2 0c  5b 20 4f 50 54 20 31 30  |.'...'..[ OPT 10|
000079f0  0d 27 ec 0b 45 51 55 44  20 78 25 0d 27 f6 0b 45  |.'..EQUD x%.'..E|
00007a00  51 55 44 20 79 25 0d 28  00 0b 45 51 55 44 20 7a  |QUD y%.(..EQUD z|
00007a10  25 0d 28 0a 05 5d 0d 28  14 04 0d 28 1e 0a ed 20  |%.(..].(...(... |
00007a20  70 6e 6f 25 0d 28 28 09  3d 61 64 72 25 0d 28 32  |pno%.((.=adr%.(2|
00007a30  04 0d 28 3c 04 0d 28 46  1b dd 20 a4 69 6e 69 74  |..(<..(F.. .init|
00007a40  5f 63 72 61 66 74 5f 74  72 61 6e 73 5f 64 61 74  |_craft_trans_dat|
00007a50  0d 28 50 0f ea 20 61 64  72 25 2c 70 6e 6f 25 0d  |.(P.. adr%,pno%.|
00007a60  28 5a 04 0d 28 64 0b 61  64 72 25 3d 50 25 0d 28  |(Z..(d.adr%=P%.(|
00007a70  6e 04 0d 28 78 20 e3 20  70 6e 6f 25 3d 30 20 b8  |n..(x . pno%=0 .|
00007a80  20 28 63 72 61 66 74 5f  70 6f 69 6e 74 73 25 2d  | (craft_points%-|
00007a90  31 29 0d 28 82 04 0d 28  8c 0c 5b 20 4f 50 54 20  |1).(...(..[ OPT |
00007aa0  31 30 0d 28 96 25 45 51  55 44 20 30 20 20 20 20  |10.(.%EQUD 0    |
00007ab0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007ac0  20 20 20 20 3b 20 78 0d  28 a0 25 45 51 55 44 20  |    ; x.(.%EQUD |
00007ad0  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00007ae0  20 20 20 20 20 20 20 20  20 3b 20 79 0d 28 aa 25  |         ; y.(.%|
00007af0  45 51 55 44 20 30 20 20  20 20 20 20 20 20 20 20  |EQUD 0          |
00007b00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00007b10  7a 0d 28 b4 05 5d 0d 28  be 04 0d 28 c8 0a ed 20  |z.(..].(...(... |
00007b20  70 6e 6f 25 0d 28 d2 09  3d 61 64 72 25 0d 28 dc  |pno%.(..=adr%.(.|
00007b30  04 0d 28 e6 04 0d 28 f0  1b dd 20 a4 69 6e 69 74  |..(...(... .init|
00007b40  5f 63 72 61 66 74 5f 66  69 6e 61 6c 5f 64 61 74  |_craft_final_dat|
00007b50  0d 28 fa 0f ea 20 61 64  72 25 2c 70 6e 6f 25 0d  |.(... adr%,pno%.|
00007b60  29 04 04 0d 29 0e 0b 61  64 72 25 3d 50 25 0d 29  |)...)..adr%=P%.)|
00007b70  18 04 0d 29 22 20 e3 20  70 6e 6f 25 3d 30 20 b8  |...)" . pno%=0 .|
00007b80  20 28 63 72 61 66 74 5f  70 6f 69 6e 74 73 25 2d  | (craft_points%-|
00007b90  31 29 0d 29 2c 04 0d 29  36 0c 5b 20 4f 50 54 20  |1).),..)6.[ OPT |
00007ba0  31 30 0d 29 40 25 45 51  55 44 20 30 20 20 20 20  |10.)@%EQUD 0    |
00007bb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007bc0  20 20 20 20 3b 20 78 0d  29 4a 25 45 51 55 44 20  |    ; x.)J%EQUD |
00007bd0  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00007be0  20 20 20 20 20 20 20 20  20 3b 20 79 0d 29 54 05  |         ; y.)T.|
00007bf0  5d 0d 29 5e 04 0d 29 68  0a ed 20 70 6e 6f 25 0d  |].)^..)h.. pno%.|
00007c00  29 72 09 3d 61 64 72 25  0d 29 7c 04 0d 29 86 04  |)r.=adr%.)|..)..|
00007c10  0d 29 90 1c dd 20 a4 69  6e 69 74 5f 63 72 61 66  |.)... .init_craf|
00007c20  74 5f 72 65 6e 64 65 72  5f 64 61 74 0d 29 9a 3d  |t_render_dat.).=|
00007c30  ea 20 61 64 72 25 2c 66  6e 6f 25 2c 74 79 70 65  |. adr%,fno%,type|
00007c40  25 2c 70 30 25 2c 70 31  25 2c 70 32 25 2c 70 33  |%,p0%,p1%,p2%,p3|
00007c50  25 2c 69 6e 74 30 25 2c  69 6e 74 31 25 2c 69 6e  |%,int0%,int1%,in|
00007c60  74 32 25 2c 69 6e 74 33  25 0d 29 a4 04 0d 29 ae  |t2%,int3%.)...).|
00007c70  0b 61 64 72 25 3d 50 25  0d 29 b8 04 0d 29 c2 04  |.adr%=P%.)...)..|
00007c80  0d 29 cc 04 0d 29 d6 20  e3 20 66 6e 6f 25 3d 30  |.)...). . fno%=0|
00007c90  20 b8 20 28 63 72 61 66  74 5f 66 61 63 65 74 73  | . (craft_facets|
00007ca0  25 2d 31 29 0d 29 e0 04  0d 29 ea 0e e8 23 66 68  |%-1).)...)...#fh|
00007cb0  2c 74 79 70 65 25 0d 29  f4 0c e8 23 66 68 2c 70  |,type%.)...#fh,p|
00007cc0  30 25 0d 29 fe 0c e8 23  66 68 2c 70 31 25 0d 2a  |0%.)...#fh,p1%.*|
00007cd0  08 0c e8 23 66 68 2c 70  32 25 0d 2a 12 0c e8 23  |...#fh,p2%.*...#|
00007ce0  66 68 2c 70 33 25 0d 2a  1c 04 0d 2a 26 0e 69 6e  |fh,p3%.*...*&.in|
00007cf0  74 30 25 3d 9a 23 66 68  0d 2a 30 0e 69 6e 74 31  |t0%=.#fh.*0.int1|
00007d00  25 3d 9a 23 66 68 0d 2a  3a 0e 69 6e 74 32 25 3d  |%=.#fh.*:.int2%=|
00007d10  9a 23 66 68 0d 2a 44 0e  69 6e 74 33 25 3d 9a 23  |.#fh.*D.int3%=.#|
00007d20  66 68 0d 2a 4e 04 0d 2a  58 0c 5b 20 4f 50 54 20  |fh.*N..*X.[ OPT |
00007d30  31 30 0d 2a 62 24 45 51  55 44 20 74 79 70 65 25  |10.*b$EQUD type%|
00007d40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007d50  3b 20 74 79 70 65 0d 2a  6c 20 45 51 55 44 20 70  |; type.*l EQUD p|
00007d60  30 25 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0%              |
00007d70  20 20 3b 20 70 30 0d 2a  76 20 45 51 55 44 20 70  |  ; p0.*v EQUD p|
00007d80  31 25 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1%              |
00007d90  20 20 3b 20 70 31 0d 2a  80 20 45 51 55 44 20 70  |  ; p1.*. EQUD p|
00007da0  32 25 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |2%              |
00007db0  20 20 3b 20 70 32 0d 2a  8a 20 45 51 55 44 20 70  |  ; p2.*. EQUD p|
00007dc0  33 25 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |3%              |
00007dd0  20 20 3b 20 70 33 0d 2a  94 04 0d 2a 9e 26 45 51  |  ; p3.*...*.&EQ|
00007de0  55 42 20 69 6e 74 30 25  20 20 20 20 20 20 20 20  |UB int0%        |
00007df0  20 20 20 20 20 20 20 20  3b 20 70 30 20 69 6e 74  |        ; p0 int|
00007e00  0d 2a a8 26 45 51 55 42  20 69 6e 74 31 25 20 20  |.*.&EQUB int1%  |
00007e10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00007e20  70 31 20 69 6e 74 0d 2a  b2 26 45 51 55 42 20 69  |p1 int.*.&EQUB i|
00007e30  6e 74 32 25 20 20 20 20  20 20 20 20 20 20 20 20  |nt2%            |
00007e40  20 20 20 20 3b 20 70 32  20 69 6e 74 0d 2a bc 26  |    ; p2 int.*.&|
00007e50  45 51 55 42 20 69 6e 74  33 25 20 20 20 20 20 20  |EQUB int3%      |
00007e60  20 20 20 20 20 20 20 20  20 20 3b 20 70 33 20 69  |          ; p3 i|
00007e70  6e 74 0d 2a c6 05 5d 0d  2a d0 0a ed 20 66 6e 6f  |nt.*..].*... fno|
00007e80  25 0d 2a da 09 3d 61 64  72 25 0d 2a e4 04 0d 2a  |%.*..=adr%.*...*|
00007e90  ee 04 0d 2a f8 18 dd 20  a4 69 6e 69 74 5f 63 72  |...*... .init_cr|
00007ea0  61 66 74 5f 68 65 61 64  65 72 0d 2b 02 0a ea 20  |aft_header.+... |
00007eb0  61 64 72 25 0d 2b 0c 04  0d 2b 16 0b 61 64 72 25  |adr%.+...+..adr%|
00007ec0  3d 50 25 0d 2b 20 04 0d  2b 2a 0c 5b 20 4f 50 54  |=P%.+ ..+*.[ OPT|
00007ed0  20 31 30 0d 2b 34 3e 45  51 55 44 20 30 20 20 20  | 10.+4>EQUD 0   |
00007ee0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007ef0  20 20 20 20 20 3b 20 70  6f 73 69 74 69 6f 6e 20  |     ; position |
00007f00  76 65 63 74 6f 72 20 63  6f 6d 70 6f 6e 65 6e 74  |vector component|
00007f10  73 0d 2b 3e 0b 45 51 55  44 20 35 30 0d 2b 48 0c  |s.+>.EQUD 50.+H.|
00007f20  45 51 55 44 20 39 30 30  0d 2b 52 04 0d 2b 5c 3e  |EQUD 900.+R..+\>|
00007f30  45 51 55 44 20 30 20 20  20 20 20 20 20 20 20 20  |EQUD 0          |
00007f40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00007f50  76 65 6c 6f 63 69 74 79  20 76 65 63 74 6f 72 20  |velocity vector |
00007f60  63 6f 6d 70 6f 6e 65 6e  74 73 0d 2b 66 0a 45 51  |components.+f.EQ|
00007f70  55 44 20 30 0d 2b 70 0a  45 51 55 44 20 30 0d 2b  |UD 0.+p.EQUD 0.+|
00007f80  7a 04 0d 2b 84 42 45 51  55 44 20 30 20 20 20 20  |z..+.BEQUD 0    |
00007f90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007fa0  20 20 20 20 3b 20 61 63  63 65 6c 65 72 61 74 69  |    ; accelerati|
00007fb0  6f 6e 20 76 65 63 74 6f  72 20 63 6f 6d 70 6f 6e  |on vector compon|
00007fc0  65 6e 74 73 0d 2b 8e 0a  45 51 55 44 20 30 0d 2b  |ents.+..EQUD 0.+|
00007fd0  98 0a 45 51 55 44 20 30  0d 2b a2 04 0d 2b ac 29  |..EQUD 0.+...+.)|
00007fe0  45 51 55 44 20 30 20 20  20 20 20 20 20 20 20 20  |EQUD 0          |
00007ff0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00008000  79 20 72 6f 74 0d 2b b6  29 45 51 55 44 20 30 20  |y rot.+.)EQUD 0 |
00008010  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008020  20 20 20 20 20 20 20 3b  20 7a 20 72 6f 74 0d 2b  |       ; z rot.+|
00008030  c0 2f 45 51 55 44 20 30  20 20 20 20 20 20 20 20  |./EQUD 0        |
00008040  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008050  3b 20 79 20 72 6f 74 20  73 70 65 65 64 0d 2b ca  |; y rot speed.+.|
00008060  2f 45 51 55 44 20 30 20  20 20 20 20 20 20 20 20  |/EQUD 0         |
00008070  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00008080  20 7a 20 72 6f 74 20 73  70 65 65 64 0d 2b d4 04  | z rot speed.+..|
00008090  0d 2b de 16 45 51 55 44  20 63 72 61 66 74 5f 70  |.+..EQUD craft_p|
000080a0  6f 69 6e 74 73 25 0d 2b  e8 16 45 51 55 44 20 63  |oints%.+..EQUD c|
000080b0  72 61 66 74 5f 66 61 63  65 74 73 25 0d 2b f2 18  |raft_facets%.+..|
000080c0  45 51 55 44 20 63 72 61  66 74 5f 6f 72 69 67 5f  |EQUD craft_orig_|
000080d0  64 61 74 25 0d 2b fc 19  45 51 55 44 20 63 72 61  |dat%.+..EQUD cra|
000080e0  66 74 5f 74 72 61 6e 73  5f 64 61 74 25 0d 2c 06  |ft_trans_dat%.,.|
000080f0  19 45 51 55 44 20 63 72  61 66 74 5f 66 69 6e 61  |.EQUD craft_fina|
00008100  6c 5f 64 61 74 25 0d 2c  10 1a 45 51 55 44 20 63  |l_dat%.,..EQUD c|
00008110  72 61 66 74 5f 72 65 6e  64 65 72 5f 64 61 74 25  |raft_render_dat%|
00008120  0d 2c 1a 05 5d 0d 2c 24  09 3d 61 64 72 25 0d 2c  |.,..].,$.=adr%.,|
00008130  2e 04 0d 2c 38 04 0d 2c  42 04 0d 2c 4c 04 0d 2c  |...,8..,B..,L..,|
00008140  56 04 0d 2c 60 04 0d 2c  6a 04 0d 2c 74 1c dd f2  |V..,`..,j..,t...|
00008150  69 6e 69 74 69 61 6c 69  73 65 5f 65 64 67 65 5f  |initialise_edge_|
00008160  74 61 62 6c 65 73 0d 2c  7e 04 0d 2c 88 16 de 20  |tables.,~..,... |
00008170  6c 68 73 5f 6c 69 73 74  25 20 32 35 36 2a 31 36  |lhs_list% 256*16|
00008180  0d 2c 92 16 de 20 72 68  73 5f 6c 69 73 74 25 20  |.,... rhs_list% |
00008190  32 35 36 2a 31 36 0d 2c  9c 04 0d 2c a6 05 e1 0d  |256*16.,...,....|
000081a0  2c b0 04 0d 2c ba 04 0d  2c c4 04 0d 2c ce 14 dd  |,...,...,...,...|
000081b0  f2 73 65 74 75 70 5f 74  65 78 74 75 72 65 73 0d  |.setup_textures.|
000081c0  2c d8 04 0d 2c e2 15 6e  6f 5f 6f 66 5f 74 65 78  |,...,..no_of_tex|
000081d0  74 75 72 65 73 25 3d 31  0d 2c ec 04 0d 2c f6 24  |tures%=1.,...,.$|
000081e0  de 20 74 65 78 74 75 72  65 73 25 20 6e 6f 5f 6f  |. textures% no_o|
000081f0  66 5f 74 65 78 74 75 72  65 73 25 2a 31 30 32 34  |f_textures%*1024|
00008200  0d 2d 00 04 0d 2d 0a 30  66 68 3d 8e 22 3c 50 65  |.-...-.0fh=."<Pe|
00008210  72 70 65 74 75 61 6c 5f  4d 6f 74 69 6f 6e 24 44  |rpetual_Motion$D|
00008220  69 72 3e 2e 54 65 78 74  75 72 65 2e 54 65 78 44  |ir>.Texture.TexD|
00008230  61 74 61 22 0d 2d 14 04  0d 2d 1e 04 0d 2d 28 25  |ata".-...-...-(%|
00008240  e3 20 49 25 3d 30 20 b8  20 28 6e 6f 5f 6f 66 5f  |. I%=0 . (no_of_|
00008250  74 65 78 74 75 72 65 73  25 2a 31 30 32 34 29 2d  |textures%*1024)-|
00008260  31 0d 2d 32 04 0d 2d 3c  0e 20 20 70 69 78 3d 9a  |1.-2..-<.  pix=.|
00008270  23 66 68 0d 2d 46 16 20  20 74 65 78 74 75 72 65  |#fh.-F.  texture|
00008280  73 25 3f 49 25 3d 70 69  78 0d 2d 50 04 0d 2d 5a  |s%?I%=pix.-P..-Z|
00008290  08 ed 20 49 25 0d 2d 64  08 d9 23 66 68 0d 2d 6e  |.. I%.-d..#fh.-n|
000082a0  04 0d 2d 78 05 e1 0d 2d  82 04 0d 2d 8c 04 0d 2d  |..-x...-...-...-|
000082b0  96 04 0d 2d a0 04 0d 2d  aa 04 0d 2d b4 51 f4 20  |...-...-...-.Q. |
000082c0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000082d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 20 44 49 56 49  |----------- DIVI|
000082e0  53 49 4f 4e 20 52 4f 55  54 49 4e 45 53 20 2d 2d  |SION ROUTINES --|
000082f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00008300  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 2d be 04 0d  |-----------.-...|
00008310  2d c8 1c dd 20 f2 73 65  74 75 70 5f 72 65 66 65  |-... .setup_refe|
00008320  72 65 6e 63 65 5f 6c 69  73 74 73 0d 2d d2 04 0d  |rence_lists.-...|
00008330  2d dc 1b de 20 73 77 6d  5f 72 64 69 76 5f 6c 69  |-... swm_rdiv_li|
00008340  73 74 25 20 38 31 39 32  2a 34 0d 2d e6 04 0d 2d  |st% 8192*4.-...-|
00008350  f0 11 64 69 76 5f 73 63  61 6c 65 25 3d 31 38 0d  |..div_scale%=18.|
00008360  2d fa 04 0d 2e 04 08 ea  20 49 25 0d 2e 0e 04 0d  |-....... I%.....|
00008370  2e 18 11 e3 20 49 25 3d  31 20 b8 20 38 31 39 31  |.... I%=1 . 8191|
00008380  0d 2e 22 04 0d 2e 2c 1e  20 20 6e 6f 3d 28 31 2f  |.."...,.  no=(1/|
00008390  49 25 29 2a 28 32 5e 64  69 76 5f 73 63 61 6c 65  |I%)*(2^div_scale|
000083a0  25 29 0d 2e 36 1f 20 20  73 77 6d 5f 72 64 69 76  |%)..6.  swm_rdiv|
000083b0  5f 6c 69 73 74 25 21 28  49 25 3c 3c 32 29 3d 6e  |_list%!(I%<<2)=n|
000083c0  6f 0d 2e 40 04 0d 2e 4a  05 ed 0d 2e 54 04 0d 2e  |o..@...J....T...|
000083d0  5e 17 de 20 73 69 6e 65  5f 74 61 62 6c 65 25 20  |^.. sine_table% |
000083e0  33 36 30 2a 34 0d 2e 68  19 de 20 63 6f 73 69 6e  |360*4..h.. cosin|
000083f0  65 5f 74 61 62 6c 65 25  20 33 36 30 2a 34 0d 2e  |e_table% 360*4..|
00008400  72 04 0d 2e 7c 10 e3 20  49 25 3d 30 20 b8 20 33  |r...|.. I%=0 . 3|
00008410  35 39 0d 2e 86 04 0d 2e  90 29 20 20 20 73 69 6e  |59.......)   sin|
00008420  65 5f 74 61 62 6c 65 25  21 28 49 25 3c 3c 32 29  |e_table%!(I%<<2)|
00008430  3d 28 b5 28 b2 28 49 25  29 29 2a 32 35 36 29 0d  |=(.(.(I%))*256).|
00008440  2e 9a 2b 20 20 20 63 6f  73 69 6e 65 5f 74 61 62  |..+   cosine_tab|
00008450  6c 65 25 21 28 49 25 3c  3c 32 29 3d 28 9b 28 b2  |le%!(I%<<2)=(.(.|
00008460  28 49 25 29 29 2a 32 35  36 29 0d 2e a4 04 0d 2e  |(I%))*256)......|
00008470  ae 05 ed 0d 2e b8 04 0d  2e c2 05 e1 0d 2e cc 04  |................|
00008480  0d 2e d6 04 0d 2e e0 04  0d 2e ea 18 dd a4 69 6e  |..............in|
00008490  74 5f 64 69 76 28 6e 75  2c 64 69 76 2c 71 75 29  |t_div(nu,div,qu)|
000084a0  0d 2e f4 0d ea 20 6d 61  72 6b 25 28 29 0d 2e fe  |..... mark%()...|
000084b0  04 0d 2f 08 2a de 20 6d  61 72 6b 25 28 31 32 29  |../.*. mark%(12)|
000084c0  20 20 20 20 20 20 20 20  20 20 20 20 3a 20 f4 20  |            : . |
000084d0  72 65 67 73 20 30 20 2d  20 31 32 0d 2f 12 0d 6d  |regs 0 - 12./..m|
000084e0  61 72 6b 25 28 29 3d 30  0d 2f 1c 04 0d 2f 26 40  |ark%()=0./.../&@|
000084f0  6d 61 72 6b 25 28 6e 75  29 3d 31 20 20 20 20 20  |mark%(nu)=1     |
00008500  20 20 20 20 20 20 20 20  20 3a 20 f4 20 73 65 74  |         : . set|
00008510  20 6d 61 72 6b 73 20 66  6f 72 20 72 65 67 73 20  | marks for regs |
00008520  61 6c 72 65 61 64 79 20  75 73 65 64 0d 2f 30 10  |already used./0.|
00008530  6d 61 72 6b 25 28 64 69  76 29 3d 31 0d 2f 3a 0f  |mark%(div)=1./:.|
00008540  6d 61 72 6b 25 28 71 75  29 3d 31 0d 2f 44 0f 6d  |mark%(qu)=1./D.m|
00008550  61 72 6b 25 28 31 31 29  3d 31 0d 2f 4e 04 0d 2f  |ark%(11)=1./N../|
00008560  58 08 49 25 3d 30 0d 2f  62 05 f5 0d 2f 6c 34 e7  |X.I%=0./b.../l4.|
00008570  20 6d 61 72 6b 25 28 49  25 29 3d 30 20 3a 20 72  | mark%(I%)=0 : r|
00008580  65 6d 20 3d 20 49 25 20  3a 20 6d 61 72 6b 25 28  |em = I% : mark%(|
00008590  49 25 29 20 3d 20 31 20  3a 20 49 25 3d 31 33 0d  |I%) = 1 : I%=13.|
000085a0  2f 76 09 49 25 2b 3d 31  0d 2f 80 0c fd 20 49 25  |/v.I%+=1./... I%|
000085b0  3e 3d 31 33 0d 2f 8a 04  0d 2f 94 08 49 25 3d 30  |>=13./.../..I%=0|
000085c0  0d 2f 9e 05 f5 0d 2f a8  33 e7 20 6d 61 72 6b 25  |./..../.3. mark%|
000085d0  28 49 25 29 3d 30 20 3a  20 70 6c 20 3d 20 49 25  |(I%)=0 : pl = I%|
000085e0  20 3a 20 6d 61 72 6b 25  28 49 25 29 20 3d 20 31  | : mark%(I%) = 1|
000085f0  20 3a 20 49 25 3d 31 33  0d 2f b2 09 49 25 2b 3d  | : I%=13./..I%+=|
00008600  31 0d 2f bc 0c fd 20 49  25 3e 3d 31 33 0d 2f c6  |1./... I%>=13./.|
00008610  04 0d 2f d0 08 49 25 3d  30 0d 2f da 05 f5 0d 2f  |../..I%=0./..../|
00008620  e4 33 e7 20 6d 61 72 6b  25 28 49 25 29 3d 30 20  |.3. mark%(I%)=0 |
00008630  3a 20 64 73 20 3d 20 49  25 20 3a 20 6d 61 72 6b  |: ds = I% : mark|
00008640  25 28 49 25 29 20 3d 20  31 20 3a 20 49 25 3d 31  |%(I%) = 1 : I%=1|
00008650  33 0d 2f ee 09 49 25 2b  3d 31 0d 2f f8 0c fd 20  |3./..I%+=1./... |
00008660  49 25 3e 3d 31 33 0d 30  02 04 0d 30 0c 08 49 25  |I%>=13.0...0..I%|
00008670  3d 30 0d 30 16 05 f5 0d  30 20 33 e7 20 6d 61 72  |=0.0....0 3. mar|
00008680  6b 25 28 49 25 29 3d 30  20 3a 20 6d 73 20 3d 20  |k%(I%)=0 : ms = |
00008690  49 25 20 3a 20 6d 61 72  6b 25 28 49 25 29 20 3d  |I% : mark%(I%) =|
000086a0  20 31 20 3a 20 49 25 3d  31 33 0d 30 2a 09 49 25  | 1 : I%=13.0*.I%|
000086b0  2b 3d 31 0d 30 34 0c fd  20 49 25 3e 3d 31 33 0d  |+=1.04.. I%>=13.|
000086c0  30 3e 04 0d 30 48 0f 5b  20 4f 50 54 20 70 61 73  |0>..0H.[ OPT pas|
000086d0  73 25 0d 30 52 32 53 54  4d 46 41 20 20 20 20 20  |s%.0R2STMFA     |
000086e0  20 20 20 20 20 20 20 20  20 28 73 70 29 21 2c 7b  |         (sp)!,{|
000086f0  6e 75 2c 64 69 76 2c 72  65 6d 2c 70 6c 2c 64 73  |nu,div,rem,pl,ds|
00008700  2c 6d 73 7d 0d 30 5c 21  80 53 20 20 20 20 20 20  |,ms}.0\!.S      |
00008710  20 20 20 20 20 20 20 20  20 6d 73 2c 6e 75 2c 23  |         ms,nu,#|
00008720  31 3c 3c 33 31 0d 30 66  1f 52 53 42 4d 49 20 20  |1<<31.0f.RSBMI  |
00008730  20 20 20 20 20 20 20 20  20 20 20 20 6e 75 2c 6e  |            nu,n|
00008740  75 2c 23 30 0d 30 70 1e  82 20 20 20 20 20 20 20  |u,#0.0p..       |
00008750  20 20 20 20 20 20 20 20  20 64 73 2c 6d 73 2c 64  |         ds,ms,d|
00008760  69 76 0d 30 7a 1d 43 4d  50 20 20 20 20 20 20 20  |iv.0z.CMP       |
00008770  20 20 20 20 20 20 20 20  20 64 69 76 2c 23 30 0d  |         div,#0.|
00008780  30 84 21 52 53 42 4d 49  20 20 20 20 20 20 20 20  |0.!RSBMI        |
00008790  20 20 20 20 20 20 64 69  76 2c 64 69 76 2c 23 30  |      div,div,#0|
000087a0  0d 30 8e 04 0d 30 98 1d  4d 4f 56 20 20 20 20 20  |.0...0..MOV     |
000087b0  20 20 20 20 20 20 20 20  20 20 20 72 65 6d 2c 23  |           rem,#|
000087c0  30 0d 30 a2 1c 4d 4f 56  20 20 20 20 20 20 20 20  |0.0..MOV        |
000087d0  20 20 20 20 20 20 20 20  71 75 2c 23 30 0d 30 ac  |        qu,#0.0.|
000087e0  20 4d 4f 56 20 20 20 20  20 20 20 20 20 20 20 20  | MOV            |
000087f0  20 20 20 20 70 6c 2c 23  31 3c 3c 33 31 0d 30 b6  |    pl,#1<<31.0.|
00008800  04 0d 30 c0 05 5d 0d 30  ca 0f e3 20 49 25 3d 30  |..0..].0... I%=0|
00008810  20 b8 20 33 31 0d 30 d4  04 0d 30 de 0f 5b 20 4f  | . 31.0...0..[ O|
00008820  50 54 20 70 61 73 73 25  0d 30 e8 04 0d 30 f2 22  |PT pass%.0...0."|
00008830  4d 4f 56 53 20 20 20 20  20 20 20 20 20 20 20 20  |MOVS            |
00008840  20 20 20 6e 75 2c 6e 75  2c 41 53 4c 23 31 0d 30  |   nu,nu,ASL#1.0|
00008850  fc 22 41 44 43 20 20 20  20 20 20 20 20 20 20 20  |."ADC           |
00008860  20 20 20 20 20 72 65 6d  2c 72 65 6d 2c 72 65 6d  |     rem,rem,rem|
00008870  0d 31 06 1e 43 4d 50 20  20 20 20 20 20 20 20 20  |.1..CMP         |
00008880  20 20 20 20 20 20 20 72  65 6d 2c 64 69 76 0d 31  |       rem,div.1|
00008890  10 22 53 55 42 47 45 20  20 20 20 20 20 20 20 20  |."SUBGE         |
000088a0  20 20 20 20 20 72 65 6d  2c 72 65 6d 2c 64 69 76  |     rem,rem,div|
000088b0  0d 31 1a 1e 84 52 47 45  20 20 20 20 20 20 20 20  |.1...RGE        |
000088c0  20 20 20 20 20 20 71 75  2c 71 75 2c 70 6c 0d 31  |      qu,qu,pl.1|
000088d0  24 22 4d 4f 56 53 20 20  20 20 20 20 20 20 20 20  |$"MOVS          |
000088e0  20 20 20 20 20 70 6c 2c  70 6c 2c 4c 53 52 23 31  |     pl,pl,LSR#1|
000088f0  0d 31 2e 04 0d 31 38 05  5d 0d 31 42 08 ed 20 49  |.1...18.].1B.. I|
00008900  25 0d 31 4c 04 0d 31 56  0f 5b 20 4f 50 54 20 70  |%.1L..1V.[ OPT p|
00008910  61 73 73 25 0d 31 60 04  0d 31 6a 1c 43 4d 50 20  |ass%.1`..1j.CMP |
00008920  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 64  |               d|
00008930  73 2c 23 30 0d 31 74 1f  52 53 42 4d 49 20 20 20  |s,#0.1t.RSBMI   |
00008940  20 20 20 20 20 20 20 20  20 20 20 71 75 2c 71 75  |           qu,qu|
00008950  2c 23 30 0d 31 7e 1c 43  4d 50 20 20 20 20 20 20  |,#0.1~.CMP      |
00008960  20 20 20 20 20 20 20 20  20 20 6d 73 2c 23 30 0d  |          ms,#0.|
00008970  31 88 21 52 53 42 4d 49  20 20 20 20 20 20 20 20  |1.!RSBMI        |
00008980  20 20 20 20 20 20 72 65  6d 2c 72 65 6d 2c 23 30  |      rem,rem,#0|
00008990  0d 31 92 04 0d 31 9c 32  4c 44 4d 46 41 20 20 20  |.1...1.2LDMFA   |
000089a0  20 20 20 20 20 20 20 20  20 20 20 28 73 70 29 21  |           (sp)!|
000089b0  2c 7b 6e 75 2c 64 69 76  2c 72 65 6d 2c 70 6c 2c  |,{nu,div,rem,pl,|
000089c0  64 73 2c 6d 73 7d 0d 31  a6 05 5d 0d 31 b0 06 3d  |ds,ms}.1..].1..=|
000089d0  30 0d 31 ba 04 0d 31 c4  04 0d 31 ce 04 0d 31 d8  |0.1...1...1...1.|
000089e0  04 0d 31 e2 22 dd 20 a4  73 77 6d 5f 72 64 69 76  |..1.". .swm_rdiv|
000089f0  5f 61 63 74 28 6e 6f 25  2c 64 69 76 25 2c 61 6e  |_act(no%,div%,an|
00008a00  73 25 29 0d 31 ec 04 0d  31 f6 0a 77 6b 30 25 3d  |s%).1...1..wk0%=|
00008a10  30 0d 32 00 0a 77 6b 31  25 3d 31 0d 32 0a 0a 77  |0.2..wk1%=1.2..w|
00008a20  6b 32 25 3d 32 0d 32 14  04 0d 32 1e 17 ea 20 77  |k2%=2.2...2... w|
00008a30  6b 30 25 2c 77 6b 31 25  2c 77 6b 32 25 2c 49 25  |k0%,wk1%,wk2%,I%|
00008a40  0d 32 28 04 0d 32 32 0f  e3 20 49 25 3d 30 20 b8  |.2(..22.. I%=0 .|
00008a50  20 31 34 0d 32 3c 04 0d  32 46 1a 20 20 e7 20 77  | 14.2<..2F.  . w|
00008a60  6b 30 25 3d 6e 6f 25 20  3a 20 77 6b 30 25 2b 3d  |k0%=no% : wk0%+=|
00008a70  31 0d 32 50 1b 20 20 e7  20 77 6b 30 25 3d 64 69  |1.2P.  . wk0%=di|
00008a80  76 25 20 3a 20 77 6b 30  25 2b 3d 31 0d 32 5a 1b  |v% : wk0%+=1.2Z.|
00008a90  20 20 e7 20 77 6b 30 25  3d 61 6e 73 25 20 3a 20  |  . wk0%=ans% : |
00008aa0  77 6b 30 25 2b 3d 31 0d  32 64 1b 20 20 e7 20 77  |wk0%+=1.2d.  . w|
00008ab0  6b 30 25 3d 77 6b 31 25  20 3a 20 77 6b 30 25 2b  |k0%=wk1% : wk0%+|
00008ac0  3d 31 0d 32 6e 1b 20 20  e7 20 77 6b 30 25 3d 77  |=1.2n.  . wk0%=w|
00008ad0  6b 32 25 20 3a 20 77 6b  30 25 2b 3d 31 0d 32 78  |k2% : wk0%+=1.2x|
00008ae0  04 0d 32 82 08 ed 20 49  25 0d 32 8c 04 0d 32 96  |..2... I%.2...2.|
00008af0  0f e3 20 49 25 3d 30 20  b8 20 31 34 0d 32 a0 04  |.. I%=0 . 14.2..|
00008b00  0d 32 aa 1a 20 20 e7 20  77 6b 31 25 3d 6e 6f 25  |.2..  . wk1%=no%|
00008b10  20 3a 20 77 6b 31 25 2b  3d 31 0d 32 b4 1b 20 20  | : wk1%+=1.2..  |
00008b20  e7 20 77 6b 31 25 3d 64  69 76 25 20 3a 20 77 6b  |. wk1%=div% : wk|
00008b30  31 25 2b 3d 31 0d 32 be  1b 20 20 e7 20 77 6b 31  |1%+=1.2..  . wk1|
00008b40  25 3d 61 6e 73 25 20 3a  20 77 6b 31 25 2b 3d 31  |%=ans% : wk1%+=1|
00008b50  0d 32 c8 1b 20 20 e7 20  77 6b 31 25 3d 77 6b 30  |.2..  . wk1%=wk0|
00008b60  25 20 3a 20 77 6b 31 25  2b 3d 31 0d 32 d2 1b 20  |% : wk1%+=1.2.. |
00008b70  20 e7 20 77 6b 31 25 3d  77 6b 32 25 20 3a 20 77  | . wk1%=wk2% : w|
00008b80  6b 31 25 2b 3d 31 0d 32  dc 04 0d 32 e6 08 ed 20  |k1%+=1.2...2... |
00008b90  49 25 0d 32 f0 04 0d 32  fa 0f e3 20 49 25 3d 30  |I%.2...2... I%=0|
00008ba0  20 b8 20 31 34 0d 33 04  04 0d 33 0e 1a 20 20 e7  | . 14.3...3..  .|
00008bb0  20 77 6b 32 25 3d 6e 6f  25 20 3a 20 77 6b 32 25  | wk2%=no% : wk2%|
00008bc0  2b 3d 31 0d 33 18 1b 20  20 e7 20 77 6b 32 25 3d  |+=1.3..  . wk2%=|
00008bd0  64 69 76 25 20 3a 20 77  6b 32 25 2b 3d 31 0d 33  |div% : wk2%+=1.3|
00008be0  22 1b 20 20 e7 20 77 6b  32 25 3d 61 6e 73 25 20  |".  . wk2%=ans% |
00008bf0  3a 20 77 6b 32 25 2b 3d  31 0d 33 2c 1b 20 20 e7  |: wk2%+=1.3,.  .|
00008c00  20 77 6b 32 25 3d 77 6b  30 25 20 3a 20 77 6b 32  | wk2%=wk0% : wk2|
00008c10  25 2b 3d 31 0d 33 36 1b  20 20 e7 20 77 6b 32 25  |%+=1.36.  . wk2%|
00008c20  3d 77 6b 31 25 20 3a 20  77 6b 32 25 2b 3d 31 0d  |=wk1% : wk2%+=1.|
00008c30  33 40 04 0d 33 4a 08 ed  20 49 25 0d 33 54 04 0d  |3@..3J.. I%.3T..|
00008c40  33 5e 4d e7 20 77 6b 30  25 3d 77 6b 31 25 20 3a  |3^M. wk0%=wk1% :|
00008c50  20 85 20 30 2c 28 22 20  69 64 65 6e 74 69 63 61  | . 0,(" identica|
00008c60  6c 20 77 6f 72 6b 20 72  65 67 69 73 74 65 72 73  |l work registers|
00008c70  20 69 6e 20 64 69 76 69  73 69 6f 6e 20 6d 61 63  | in division mac|
00008c80  72 6f 2e 2e 2e 20 22 29  20 3a 20 e0 0d 33 68 4d  |ro... ") : ..3hM|
00008c90  e7 20 77 6b 31 25 3d 77  6b 32 25 20 3a 20 85 20  |. wk1%=wk2% : . |
00008ca0  30 2c 28 22 20 69 64 65  6e 74 69 63 61 6c 20 77  |0,(" identical w|
00008cb0  6f 72 6b 20 72 65 67 69  73 74 65 72 73 20 69 6e  |ork registers in|
00008cc0  20 64 69 76 69 73 69 6f  6e 20 6d 61 63 72 6f 2e  | division macro.|
00008cd0  2e 2e 20 22 29 20 3a 20  e0 0d 33 72 4d e7 20 77  |.. ") : ..3rM. w|
00008ce0  6b 30 25 3d 77 6b 32 25  20 3a 20 85 20 30 2c 28  |k0%=wk2% : . 0,(|
00008cf0  22 20 69 64 65 6e 74 69  63 61 6c 20 77 6f 72 6b  |" identical work|
00008d00  20 72 65 67 69 73 74 65  72 73 20 69 6e 20 64 69  | registers in di|
00008d10  76 69 73 69 6f 6e 20 6d  61 63 72 6f 2e 2e 2e 20  |vision macro... |
00008d20  22 29 20 3a 20 e0 0d 33  7c 04 0d 33 86 52 e7 20  |") : ..3|..3.R. |
00008d30  6e 6f 25 3d 64 69 76 25  20 3a 20 85 20 30 2c 28  |no%=div% : . 0,(|
00008d40  22 20 69 64 65 6e 74 69  63 61 6c 20 61 6e 61 6c  |" identical anal|
00008d50  79 74 69 63 61 6c 20 72  65 67 69 73 74 65 72 73  |ytical registers|
00008d60  20 69 6e 20 64 69 76 69  73 69 6f 6e 20 6d 61 63  | in division mac|
00008d70  72 6f 2e 2e 2e 20 22 29  20 3a 20 e0 0d 33 90 53  |ro... ") : ..3.S|
00008d80  e7 20 64 69 76 25 3d 61  6e 73 25 20 3a 20 85 20  |. div%=ans% : . |
00008d90  30 2c 28 22 20 69 64 65  6e 74 69 63 61 6c 20 61  |0,(" identical a|
00008da0  6e 61 6c 79 74 69 63 61  6c 20 72 65 67 69 73 74  |nalytical regist|
00008db0  65 72 73 20 69 6e 20 64  69 76 69 73 69 6f 6e 20  |ers in division |
00008dc0  6d 61 63 72 6f 2e 2e 2e  20 22 29 20 3a 20 e0 0d  |macro... ") : ..|
00008dd0  33 9a 52 e7 20 6e 6f 25  3d 61 6e 73 25 20 3a 20  |3.R. no%=ans% : |
00008de0  85 20 30 2c 28 22 20 69  64 65 6e 74 69 63 61 6c  |. 0,(" identical|
00008df0  20 61 6e 61 6c 79 74 69  63 61 6c 20 72 65 67 69  | analytical regi|
00008e00  73 74 65 72 73 20 69 6e  20 64 69 76 69 73 69 6f  |sters in divisio|
00008e10  6e 20 6d 61 63 72 6f 2e  2e 2e 20 22 29 20 3a 20  |n macro... ") : |
00008e20  e0 0d 33 a4 04 0d 33 ae  0f 5b 20 4f 50 54 20 70  |..3...3..[ OPT p|
00008e30  61 73 73 25 0d 33 b8 22  53 54 4d 46 41 20 20 20  |ass%.3."STMFA   |
00008e40  28 73 70 29 21 2c 7b 77  6b 30 25 2c 77 6b 31 25  |(sp)!,{wk0%,wk1%|
00008e50  2c 77 6b 32 25 7d 0d 33  c2 04 0d 33 cc 26 4c 44  |,wk2%}.3...3.&LD|
00008e60  52 20 20 20 20 20 20 20  77 6b 30 25 2c 73 77 6d  |R       wk0%,swm|
00008e70  5f 72 64 69 76 5f 6c 69  73 74 5f 62 61 73 65 25  |_rdiv_list_base%|
00008e80  0d 33 d6 41 80 53 20 20  20 20 20 20 77 6b 31 25  |.3.A.S      wk1%|
00008e90  2c 64 69 76 25 2c 23 31  3c 3c 33 31 20 20 20 20  |,div%,#1<<31    |
00008ea0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00008eb0  63 68 65 63 6b 20 69 66  20 6e 65 67 61 74 69 76  |check if negativ|
00008ec0  65 0d 33 e0 45 52 53 42  4d 49 20 20 20 20 20 64  |e.3.ERSBMI     d|
00008ed0  69 76 25 2c 64 69 76 25  2c 23 30 20 20 20 20 20  |iv%,div%,#0     |
00008ee0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008ef0  20 3b 20 69 66 20 73 6f  20 6d 61 6b 65 20 70 6f  | ; if so make po|
00008f00  73 69 74 69 76 65 0d 33  ea 49 4c 44 52 20 20 20  |sitive.3.ILDR   |
00008f10  20 20 20 20 77 6b 32 25  2c 5b 77 6b 30 25 2c 64  |    wk2%,[wk0%,d|
00008f20  69 76 25 2c 4c 53 4c 23  32 5d 20 20 20 20 20 20  |iv%,LSL#2]      |
00008f30  20 20 20 20 20 20 20 3b  20 6c 6f 61 64 20 6e 75  |       ; load nu|
00008f40  6d 62 65 72 20 66 72 6f  6d 20 74 61 62 6c 65 0d  |mber from table.|
00008f50  33 f4 63 4d 55 4c 20 20  20 20 20 20 20 61 6e 73  |3.cMUL       ans|
00008f60  25 2c 77 6b 32 25 2c 6e  6f 25 20 20 20 20 20 20  |%,wk2%,no%      |
00008f70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008f80  3b 20 70 65 72 66 72 6f  6d 20 6d 75 6c 74 69 70  |; perfrom multip|
00008f90  6c 69 63 61 74 69 6f 6e  20 6f 66 20 6e 75 6d 62  |lication of numb|
00008fa0  65 72 2a 28 31 2f 64 69  76 69 73 6f 72 29 3c 3c  |er*(1/divisor)<<|
00008fb0  31 36 0d 33 fe 52 4d 4f  56 20 20 20 20 20 20 20  |16.3.RMOV       |
00008fc0  61 6e 73 25 2c 61 6e 73  25 2c 41 53 52 23 64 69  |ans%,ans%,ASR#di|
00008fd0  76 5f 73 63 61 6c 65 25  20 20 20 20 20 20 20 20  |v_scale%        |
00008fe0  20 20 20 20 20 20 20 20  20 20 3b 20 73 63 61 6c  |          ; scal|
00008ff0  65 20 64 6f 77 6e 20 74  6f 20 67 65 74 20 72 65  |e down to get re|
00009000  73 75 6c 74 0d 34 08 04  0d 34 12 15 43 4d 50 20  |sult.4...4..CMP |
00009010  20 20 20 20 20 20 77 6b  31 25 2c 23 30 0d 34 1c  |      wk1%,#0.4.|
00009020  1a 52 53 42 4d 49 20 20  20 20 20 61 6e 73 25 2c  |.RSBMI     ans%,|
00009030  61 6e 73 25 2c 23 30 0d  34 26 04 0d 34 30 22 4c  |ans%,#0.4&..40"L|
00009040  44 4d 46 41 20 20 20 28  73 70 29 21 2c 7b 77 6b  |DMFA   (sp)!,{wk|
00009050  30 25 2c 77 6b 31 25 2c  77 6b 32 25 7d 0d 34 3a  |0%,wk1%,wk2%}.4:|
00009060  04 0d 34 44 05 5d 0d 34  4e 06 3d 30 0d 34 58 04  |..4D.].4N.=0.4X.|
00009070  0d 34 62 04 0d 34 6c 04  0d 34 76 04 0d 34 80 24  |.4b..4l..4v..4.$|
00009080  dd 20 a4 73 77 6d 5f 72  64 69 76 5f 73 63 61 31  |. .swm_rdiv_sca1|
00009090  36 28 6e 6f 25 2c 64 69  76 25 2c 61 6e 73 25 29  |6(no%,div%,ans%)|
000090a0  0d 34 8a 0a 77 6b 30 25  3d 30 0d 34 94 0a 77 6b  |.4..wk0%=0.4..wk|
000090b0  31 25 3d 31 0d 34 9e 0a  77 6b 32 25 3d 32 0d 34  |1%=1.4..wk2%=2.4|
000090c0  a8 17 ea 20 77 6b 30 25  2c 77 6b 31 25 2c 77 6b  |... wk0%,wk1%,wk|
000090d0  32 25 2c 49 25 0d 34 b2  0f e3 20 49 25 3d 30 20  |2%,I%.4... I%=0 |
000090e0  b8 20 31 34 0d 34 bc 1a  20 20 e7 20 77 6b 30 25  |. 14.4..  . wk0%|
000090f0  3d 6e 6f 25 20 3a 20 77  6b 30 25 2b 3d 31 0d 34  |=no% : wk0%+=1.4|
00009100  c6 1b 20 20 e7 20 77 6b  30 25 3d 64 69 76 25 20  |..  . wk0%=div% |
00009110  3a 20 77 6b 30 25 2b 3d  31 0d 34 d0 1b 20 20 e7  |: wk0%+=1.4..  .|
00009120  20 77 6b 30 25 3d 61 6e  73 25 20 3a 20 77 6b 30  | wk0%=ans% : wk0|
00009130  25 2b 3d 31 0d 34 da 1b  20 20 e7 20 77 6b 30 25  |%+=1.4..  . wk0%|
00009140  3d 77 6b 31 25 20 3a 20  77 6b 30 25 2b 3d 31 0d  |=wk1% : wk0%+=1.|
00009150  34 e4 1b 20 20 e7 20 77  6b 30 25 3d 77 6b 32 25  |4..  . wk0%=wk2%|
00009160  20 3a 20 77 6b 30 25 2b  3d 31 0d 34 ee 08 ed 20  | : wk0%+=1.4... |
00009170  49 25 0d 34 f8 0f e3 20  49 25 3d 30 20 b8 20 31  |I%.4... I%=0 . 1|
00009180  34 0d 35 02 1a 20 20 e7  20 77 6b 31 25 3d 6e 6f  |4.5..  . wk1%=no|
00009190  25 20 3a 20 77 6b 31 25  2b 3d 31 0d 35 0c 1b 20  |% : wk1%+=1.5.. |
000091a0  20 e7 20 77 6b 31 25 3d  64 69 76 25 20 3a 20 77  | . wk1%=div% : w|
000091b0  6b 31 25 2b 3d 31 0d 35  16 1b 20 20 e7 20 77 6b  |k1%+=1.5..  . wk|
000091c0  31 25 3d 61 6e 73 25 20  3a 20 77 6b 31 25 2b 3d  |1%=ans% : wk1%+=|
000091d0  31 0d 35 20 1b 20 20 e7  20 77 6b 31 25 3d 77 6b  |1.5 .  . wk1%=wk|
000091e0  30 25 20 3a 20 77 6b 31  25 2b 3d 31 0d 35 2a 1b  |0% : wk1%+=1.5*.|
000091f0  20 20 e7 20 77 6b 31 25  3d 77 6b 32 25 20 3a 20  |  . wk1%=wk2% : |
00009200  77 6b 31 25 2b 3d 31 0d  35 34 08 ed 20 49 25 0d  |wk1%+=1.54.. I%.|
00009210  35 3e 0f e3 20 49 25 3d  30 20 b8 20 31 34 0d 35  |5>.. I%=0 . 14.5|
00009220  48 1a 20 20 e7 20 77 6b  32 25 3d 6e 6f 25 20 3a  |H.  . wk2%=no% :|
00009230  20 77 6b 32 25 2b 3d 31  0d 35 52 1b 20 20 e7 20  | wk2%+=1.5R.  . |
00009240  77 6b 32 25 3d 64 69 76  25 20 3a 20 77 6b 32 25  |wk2%=div% : wk2%|
00009250  2b 3d 31 0d 35 5c 1b 20  20 e7 20 77 6b 32 25 3d  |+=1.5\.  . wk2%=|
00009260  61 6e 73 25 20 3a 20 77  6b 32 25 2b 3d 31 0d 35  |ans% : wk2%+=1.5|
00009270  66 1b 20 20 e7 20 77 6b  32 25 3d 77 6b 30 25 20  |f.  . wk2%=wk0% |
00009280  3a 20 77 6b 32 25 2b 3d  31 0d 35 70 1b 20 20 e7  |: wk2%+=1.5p.  .|
00009290  20 77 6b 32 25 3d 77 6b  31 25 20 3a 20 77 6b 32  | wk2%=wk1% : wk2|
000092a0  25 2b 3d 31 0d 35 7a 08  ed 20 49 25 0d 35 84 4d  |%+=1.5z.. I%.5.M|
000092b0  e7 20 77 6b 30 25 3d 77  6b 31 25 20 3a 20 85 20  |. wk0%=wk1% : . |
000092c0  30 2c 28 22 20 69 64 65  6e 74 69 63 61 6c 20 77  |0,(" identical w|
000092d0  6f 72 6b 20 72 65 67 69  73 74 65 72 73 20 69 6e  |ork registers in|
000092e0  20 64 69 76 69 73 69 6f  6e 20 6d 61 63 72 6f 2e  | division macro.|
000092f0  2e 2e 20 22 29 20 3a 20  e0 0d 35 8e 4d e7 20 77  |.. ") : ..5.M. w|
00009300  6b 31 25 3d 77 6b 32 25  20 3a 20 85 20 30 2c 28  |k1%=wk2% : . 0,(|
00009310  22 20 69 64 65 6e 74 69  63 61 6c 20 77 6f 72 6b  |" identical work|
00009320  20 72 65 67 69 73 74 65  72 73 20 69 6e 20 64 69  | registers in di|
00009330  76 69 73 69 6f 6e 20 6d  61 63 72 6f 2e 2e 2e 20  |vision macro... |
00009340  22 29 20 3a 20 e0 0d 35  98 4d e7 20 77 6b 30 25  |") : ..5.M. wk0%|
00009350  3d 77 6b 32 25 20 3a 20  85 20 30 2c 28 22 20 69  |=wk2% : . 0,(" i|
00009360  64 65 6e 74 69 63 61 6c  20 77 6f 72 6b 20 72 65  |dentical work re|
00009370  67 69 73 74 65 72 73 20  69 6e 20 64 69 76 69 73  |gisters in divis|
00009380  69 6f 6e 20 6d 61 63 72  6f 2e 2e 2e 20 22 29 20  |ion macro... ") |
00009390  3a 20 e0 0d 35 a2 52 e7  20 6e 6f 25 3d 64 69 76  |: ..5.R. no%=div|
000093a0  25 20 3a 20 85 20 30 2c  28 22 20 69 64 65 6e 74  |% : . 0,(" ident|
000093b0  69 63 61 6c 20 61 6e 61  6c 79 74 69 63 61 6c 20  |ical analytical |
000093c0  72 65 67 69 73 74 65 72  73 20 69 6e 20 64 69 76  |registers in div|
000093d0  69 73 69 6f 6e 20 6d 61  63 72 6f 2e 2e 2e 20 22  |ision macro... "|
000093e0  29 20 3a 20 e0 0d 35 ac  53 e7 20 64 69 76 25 3d  |) : ..5.S. div%=|
000093f0  61 6e 73 25 20 3a 20 85  20 30 2c 28 22 20 69 64  |ans% : . 0,(" id|
00009400  65 6e 74 69 63 61 6c 20  61 6e 61 6c 79 74 69 63  |entical analytic|
00009410  61 6c 20 72 65 67 69 73  74 65 72 73 20 69 6e 20  |al registers in |
00009420  64 69 76 69 73 69 6f 6e  20 6d 61 63 72 6f 2e 2e  |division macro..|
00009430  2e 20 22 29 20 3a 20 e0  0d 35 b6 52 e7 20 6e 6f  |. ") : ..5.R. no|
00009440  25 3d 61 6e 73 25 20 3a  20 85 20 30 2c 28 22 20  |%=ans% : . 0,(" |
00009450  69 64 65 6e 74 69 63 61  6c 20 61 6e 61 6c 79 74  |identical analyt|
00009460  69 63 61 6c 20 72 65 67  69 73 74 65 72 73 20 69  |ical registers i|
00009470  6e 20 64 69 76 69 73 69  6f 6e 20 6d 61 63 72 6f  |n division macro|
00009480  2e 2e 2e 20 22 29 20 3a  20 e0 0d 35 c0 0f 5b 20  |... ") : ..5..[ |
00009490  4f 50 54 20 70 61 73 73  25 0d 35 ca 22 53 54 4d  |OPT pass%.5."STM|
000094a0  46 41 20 20 20 28 73 70  29 21 2c 7b 77 6b 30 25  |FA   (sp)!,{wk0%|
000094b0  2c 77 6b 31 25 2c 77 6b  32 25 7d 0d 35 d4 26 4c  |,wk1%,wk2%}.5.&L|
000094c0  44 52 20 20 20 20 20 20  20 77 6b 30 25 2c 73 77  |DR       wk0%,sw|
000094d0  6d 5f 72 64 69 76 5f 6c  69 73 74 5f 62 61 73 65  |m_rdiv_list_base|
000094e0  25 0d 35 de 41 80 53 20  20 20 20 20 20 77 6b 31  |%.5.A.S      wk1|
000094f0  25 2c 64 69 76 25 2c 23  31 3c 3c 33 31 20 20 20  |%,div%,#1<<31   |
00009500  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00009510  20 63 68 65 63 6b 20 69  66 20 6e 65 67 61 74 69  | check if negati|
00009520  76 65 0d 35 e8 45 52 53  42 4d 49 20 20 20 20 20  |ve.5.ERSBMI     |
00009530  64 69 76 25 2c 64 69 76  25 2c 23 30 20 20 20 20  |div%,div%,#0    |
00009540  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00009550  20 20 3b 20 69 66 20 73  6f 20 6d 61 6b 65 20 70  |  ; if so make p|
00009560  6f 73 69 74 69 76 65 0d  35 f2 49 4c 44 52 20 20  |ositive.5.ILDR  |
00009570  20 20 20 20 20 77 6b 32  25 2c 5b 77 6b 30 25 2c  |     wk2%,[wk0%,|
00009580  64 69 76 25 2c 4c 53 4c  23 32 5d 20 20 20 20 20  |div%,LSL#2]     |
00009590  20 20 20 20 20 20 20 20  3b 20 6c 6f 61 64 20 6e  |        ; load n|
000095a0  75 6d 62 65 72 20 66 72  6f 6d 20 74 61 62 6c 65  |umber from table|
000095b0  0d 35 fc 63 4d 55 4c 20  20 20 20 20 20 20 61 6e  |.5.cMUL       an|
000095c0  73 25 2c 77 6b 32 25 2c  6e 6f 25 20 20 20 20 20  |s%,wk2%,no%     |
000095d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000095e0  20 3b 20 70 65 72 66 72  6f 6d 20 6d 75 6c 74 69  | ; perfrom multi|
000095f0  70 6c 69 63 61 74 69 6f  6e 20 6f 66 20 6e 75 6d  |plication of num|
00009600  62 65 72 2a 28 31 2f 64  69 76 69 73 6f 72 29 3c  |ber*(1/divisor)<|
00009610  3c 31 36 0d 36 06 15 43  4d 50 20 20 20 20 20 20  |<16.6..CMP      |
00009620  20 77 6b 31 25 2c 23 30  0d 36 10 1a 52 53 42 4d  | wk1%,#0.6..RSBM|
00009630  49 20 20 20 20 20 61 6e  73 25 2c 61 6e 73 25 2c  |I     ans%,ans%,|
00009640  23 30 0d 36 1a 04 0d 36  24 22 4c 44 4d 46 41 20  |#0.6...6$"LDMFA |
00009650  20 20 28 73 70 29 21 2c  7b 77 6b 30 25 2c 77 6b  |  (sp)!,{wk0%,wk|
00009660  31 25 2c 77 6b 32 25 7d  0d 36 2e 04 0d 36 38 05  |1%,wk2%}.6...68.|
00009670  5d 0d 36 42 06 3d 30 0d  36 4c 04 0d 36 56 04 0d  |].6B.=0.6L..6V..|
00009680  36 60 04 0d 36 6a 04 0d  36 74 23 dd 20 a4 73 77  |6`..6j..6t#. .sw|
00009690  6d 5f 72 64 69 76 5f 73  63 61 38 28 6e 6f 25 2c  |m_rdiv_sca8(no%,|
000096a0  64 69 76 25 2c 61 6e 73  25 29 0d 36 7e 0a 77 6b  |div%,ans%).6~.wk|
000096b0  30 25 3d 30 0d 36 88 0a  77 6b 31 25 3d 31 0d 36  |0%=0.6..wk1%=1.6|
000096c0  92 0a 77 6b 32 25 3d 32  0d 36 9c 17 ea 20 77 6b  |..wk2%=2.6... wk|
000096d0  30 25 2c 77 6b 31 25 2c  77 6b 32 25 2c 49 25 0d  |0%,wk1%,wk2%,I%.|
000096e0  36 a6 0f e3 20 49 25 3d  30 20 b8 20 31 34 0d 36  |6... I%=0 . 14.6|
000096f0  b0 1a 20 20 e7 20 77 6b  30 25 3d 6e 6f 25 20 3a  |..  . wk0%=no% :|
00009700  20 77 6b 30 25 2b 3d 31  0d 36 ba 1b 20 20 e7 20  | wk0%+=1.6..  . |
00009710  77 6b 30 25 3d 64 69 76  25 20 3a 20 77 6b 30 25  |wk0%=div% : wk0%|
00009720  2b 3d 31 0d 36 c4 1b 20  20 e7 20 77 6b 30 25 3d  |+=1.6..  . wk0%=|
00009730  61 6e 73 25 20 3a 20 77  6b 30 25 2b 3d 31 0d 36  |ans% : wk0%+=1.6|
00009740  ce 1b 20 20 e7 20 77 6b  30 25 3d 77 6b 31 25 20  |..  . wk0%=wk1% |
00009750  3a 20 77 6b 30 25 2b 3d  31 0d 36 d8 1b 20 20 e7  |: wk0%+=1.6..  .|
00009760  20 77 6b 30 25 3d 77 6b  32 25 20 3a 20 77 6b 30  | wk0%=wk2% : wk0|
00009770  25 2b 3d 31 0d 36 e2 08  ed 20 49 25 0d 36 ec 0f  |%+=1.6... I%.6..|
00009780  e3 20 49 25 3d 30 20 b8  20 31 34 0d 36 f6 1a 20  |. I%=0 . 14.6.. |
00009790  20 e7 20 77 6b 31 25 3d  6e 6f 25 20 3a 20 77 6b  | . wk1%=no% : wk|
000097a0  31 25 2b 3d 31 0d 37 00  1b 20 20 e7 20 77 6b 31  |1%+=1.7..  . wk1|
000097b0  25 3d 64 69 76 25 20 3a  20 77 6b 31 25 2b 3d 31  |%=div% : wk1%+=1|
000097c0  0d 37 0a 1b 20 20 e7 20  77 6b 31 25 3d 61 6e 73  |.7..  . wk1%=ans|
000097d0  25 20 3a 20 77 6b 31 25  2b 3d 31 0d 37 14 1b 20  |% : wk1%+=1.7.. |
000097e0  20 e7 20 77 6b 31 25 3d  77 6b 30 25 20 3a 20 77  | . wk1%=wk0% : w|
000097f0  6b 31 25 2b 3d 31 0d 37  1e 1b 20 20 e7 20 77 6b  |k1%+=1.7..  . wk|
00009800  31 25 3d 77 6b 32 25 20  3a 20 77 6b 31 25 2b 3d  |1%=wk2% : wk1%+=|
00009810  31 0d 37 28 08 ed 20 49  25 0d 37 32 0f e3 20 49  |1.7(.. I%.72.. I|
00009820  25 3d 30 20 b8 20 31 34  0d 37 3c 1a 20 20 e7 20  |%=0 . 14.7<.  . |
00009830  77 6b 32 25 3d 6e 6f 25  20 3a 20 77 6b 32 25 2b  |wk2%=no% : wk2%+|
00009840  3d 31 0d 37 46 1b 20 20  e7 20 77 6b 32 25 3d 64  |=1.7F.  . wk2%=d|
00009850  69 76 25 20 3a 20 77 6b  32 25 2b 3d 31 0d 37 50  |iv% : wk2%+=1.7P|
00009860  1b 20 20 e7 20 77 6b 32  25 3d 61 6e 73 25 20 3a  |.  . wk2%=ans% :|
00009870  20 77 6b 32 25 2b 3d 31  0d 37 5a 1b 20 20 e7 20  | wk2%+=1.7Z.  . |
00009880  77 6b 32 25 3d 77 6b 30  25 20 3a 20 77 6b 32 25  |wk2%=wk0% : wk2%|
00009890  2b 3d 31 0d 37 64 1b 20  20 e7 20 77 6b 32 25 3d  |+=1.7d.  . wk2%=|
000098a0  77 6b 31 25 20 3a 20 77  6b 32 25 2b 3d 31 0d 37  |wk1% : wk2%+=1.7|
000098b0  6e 08 ed 20 49 25 0d 37  78 4d e7 20 77 6b 30 25  |n.. I%.7xM. wk0%|
000098c0  3d 77 6b 31 25 20 3a 20  85 20 30 2c 28 22 20 69  |=wk1% : . 0,(" i|
000098d0  64 65 6e 74 69 63 61 6c  20 77 6f 72 6b 20 72 65  |dentical work re|
000098e0  67 69 73 74 65 72 73 20  69 6e 20 64 69 76 69 73  |gisters in divis|
000098f0  69 6f 6e 20 6d 61 63 72  6f 2e 2e 2e 20 22 29 20  |ion macro... ") |
00009900  3a 20 e0 0d 37 82 4d e7  20 77 6b 31 25 3d 77 6b  |: ..7.M. wk1%=wk|
00009910  32 25 20 3a 20 85 20 30  2c 28 22 20 69 64 65 6e  |2% : . 0,(" iden|
00009920  74 69 63 61 6c 20 77 6f  72 6b 20 72 65 67 69 73  |tical work regis|
00009930  74 65 72 73 20 69 6e 20  64 69 76 69 73 69 6f 6e  |ters in division|
00009940  20 6d 61 63 72 6f 2e 2e  2e 20 22 29 20 3a 20 e0  | macro... ") : .|
00009950  0d 37 8c 4d e7 20 77 6b  30 25 3d 77 6b 32 25 20  |.7.M. wk0%=wk2% |
00009960  3a 20 85 20 30 2c 28 22  20 69 64 65 6e 74 69 63  |: . 0,(" identic|
00009970  61 6c 20 77 6f 72 6b 20  72 65 67 69 73 74 65 72  |al work register|
00009980  73 20 69 6e 20 64 69 76  69 73 69 6f 6e 20 6d 61  |s in division ma|
00009990  63 72 6f 2e 2e 2e 20 22  29 20 3a 20 e0 0d 37 96  |cro... ") : ..7.|
000099a0  52 e7 20 6e 6f 25 3d 64  69 76 25 20 3a 20 85 20  |R. no%=div% : . |
000099b0  30 2c 28 22 20 69 64 65  6e 74 69 63 61 6c 20 61  |0,(" identical a|
000099c0  6e 61 6c 79 74 69 63 61  6c 20 72 65 67 69 73 74  |nalytical regist|
000099d0  65 72 73 20 69 6e 20 64  69 76 69 73 69 6f 6e 20  |ers in division |
000099e0  6d 61 63 72 6f 2e 2e 2e  20 22 29 20 3a 20 e0 0d  |macro... ") : ..|
000099f0  37 a0 53 e7 20 64 69 76  25 3d 61 6e 73 25 20 3a  |7.S. div%=ans% :|
00009a00  20 85 20 30 2c 28 22 20  69 64 65 6e 74 69 63 61  | . 0,(" identica|
00009a10  6c 20 61 6e 61 6c 79 74  69 63 61 6c 20 72 65 67  |l analytical reg|
00009a20  69 73 74 65 72 73 20 69  6e 20 64 69 76 69 73 69  |isters in divisi|
00009a30  6f 6e 20 6d 61 63 72 6f  2e 2e 2e 20 22 29 20 3a  |on macro... ") :|
00009a40  20 e0 0d 37 aa 52 e7 20  6e 6f 25 3d 61 6e 73 25  | ..7.R. no%=ans%|
00009a50  20 3a 20 85 20 30 2c 28  22 20 69 64 65 6e 74 69  | : . 0,(" identi|
00009a60  63 61 6c 20 61 6e 61 6c  79 74 69 63 61 6c 20 72  |cal analytical r|
00009a70  65 67 69 73 74 65 72 73  20 69 6e 20 64 69 76 69  |egisters in divi|
00009a80  73 69 6f 6e 20 6d 61 63  72 6f 2e 2e 2e 20 22 29  |sion macro... ")|
00009a90  20 3a 20 e0 0d 37 b4 0f  5b 20 4f 50 54 20 70 61  | : ..7..[ OPT pa|
00009aa0  73 73 25 0d 37 be 22 53  54 4d 46 41 20 20 20 28  |ss%.7."STMFA   (|
00009ab0  73 70 29 21 2c 7b 77 6b  30 25 2c 77 6b 31 25 2c  |sp)!,{wk0%,wk1%,|
00009ac0  77 6b 32 25 7d 0d 37 c8  26 4c 44 52 20 20 20 20  |wk2%}.7.&LDR    |
00009ad0  20 20 20 77 6b 30 25 2c  73 77 6d 5f 72 64 69 76  |   wk0%,swm_rdiv|
00009ae0  5f 6c 69 73 74 5f 62 61  73 65 25 0d 37 d2 41 80  |_list_base%.7.A.|
00009af0  53 20 20 20 20 20 20 77  6b 31 25 2c 64 69 76 25  |S      wk1%,div%|
00009b00  2c 23 31 3c 3c 33 31 20  20 20 20 20 20 20 20 20  |,#1<<31         |
00009b10  20 20 20 20 20 20 20 20  20 3b 20 63 68 65 63 6b  |         ; check|
00009b20  20 69 66 20 6e 65 67 61  74 69 76 65 0d 37 dc 45  | if negative.7.E|
00009b30  52 53 42 4d 49 20 20 20  20 20 64 69 76 25 2c 64  |RSBMI     div%,d|
00009b40  69 76 25 2c 23 30 20 20  20 20 20 20 20 20 20 20  |iv%,#0          |
00009b50  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 69 66  |            ; if|
00009b60  20 73 6f 20 6d 61 6b 65  20 70 6f 73 69 74 69 76  | so make positiv|
00009b70  65 0d 37 e6 49 4c 44 52  20 20 20 20 20 20 20 77  |e.7.ILDR       w|
00009b80  6b 32 25 2c 5b 77 6b 30  25 2c 64 69 76 25 2c 4c  |k2%,[wk0%,div%,L|
00009b90  53 4c 23 32 5d 20 20 20  20 20 20 20 20 20 20 20  |SL#2]           |
00009ba0  20 20 3b 20 6c 6f 61 64  20 6e 75 6d 62 65 72 20  |  ; load number |
00009bb0  66 72 6f 6d 20 74 61 62  6c 65 0d 37 f0 63 4d 55  |from table.7.cMU|
00009bc0  4c 20 20 20 20 20 20 20  61 6e 73 25 2c 77 6b 32  |L       ans%,wk2|
00009bd0  25 2c 6e 6f 25 20 20 20  20 20 20 20 20 20 20 20  |%,no%           |
00009be0  20 20 20 20 20 20 20 20  20 20 20 3b 20 70 65 72  |           ; per|
00009bf0  66 72 6f 6d 20 6d 75 6c  74 69 70 6c 69 63 61 74  |from multiplicat|
00009c00  69 6f 6e 20 6f 66 20 6e  75 6d 62 65 72 2a 28 31  |ion of number*(1|
00009c10  2f 64 69 76 69 73 6f 72  29 3c 3c 31 36 0d 37 fa  |/divisor)<<16.7.|
00009c20  56 4d 4f 56 20 20 20 20  20 20 20 61 6e 73 25 2c  |VMOV       ans%,|
00009c30  61 6e 73 25 2c 41 53 52  23 28 64 69 76 5f 73 63  |ans%,ASR#(div_sc|
00009c40  61 6c 65 25 2d 38 29 20  20 20 20 20 20 20 20 20  |ale%-8)         |
00009c50  20 20 20 20 20 20 20 20  20 3b 20 73 63 61 6c 65  |         ; scale|
00009c60  20 64 6f 77 6e 20 74 6f  20 67 65 74 20 72 65 73  | down to get res|
00009c70  75 6c 74 0d 38 04 04 0d  38 0e 15 43 4d 50 20 20  |ult.8...8..CMP  |
00009c80  20 20 20 20 20 77 6b 31  25 2c 23 30 0d 38 18 1a  |     wk1%,#0.8..|
00009c90  52 53 42 4d 49 20 20 20  20 20 61 6e 73 25 2c 61  |RSBMI     ans%,a|
00009ca0  6e 73 25 2c 23 30 0d 38  22 04 0d 38 2c 22 4c 44  |ns%,#0.8"..8,"LD|
00009cb0  4d 46 41 20 20 20 28 73  70 29 21 2c 7b 77 6b 30  |MFA   (sp)!,{wk0|
00009cc0  25 2c 77 6b 31 25 2c 77  6b 32 25 7d 0d 38 36 04  |%,wk1%,wk2%}.86.|
00009cd0  0d 38 40 05 5d 0d 38 4a  06 3d 30 0d ff 00 00 00  |.8@.].8J.=0.....|
00009ce0  00 00 00 00 2c 0f 00 00  0c 10 1f e5 0c 10 81 e0  |....,...........|
00009cf0  14 10 0f e5 18 d0 4f e2  00 40 2d e9 20 00 1f e5  |......O..@-. ...|
00009d00  43 10 8f e2 09 20 a0 e3  d4 00 00 ef 24 00 9f e5  |C.... ......$...|
00009d10  34 10 1f e5 01 00 80 e0  34 10 8f e2 09 20 a0 e3  |4.......4.... ..|
00009d20  d4 00 00 ef 2c 00 a0 e3  23 00 cf e5 08 00 8f e2  |....,...#.......|
00009d30  05 00 00 ef 00 80 bd e8  b1 9c 00 00 2a 42 61 73  |............*Bas|
00009d40  69 63 20 2d 71 75 69 74  20 20 40 00 00 00 00 00  |ic -quit  @.....|
00009d50  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00009d60