-- file: MFTimeImpl2.mesa -- Pascal-to-Mesa translator output, translated at October 31, 1985 4:28:02 pm PST DIRECTORY PascalBasic, PascalWizardFiles, MFTypes, MFProcArray, MFMoves, MFTime; MFTimeImpl2: PROGRAM IMPORTS PascalBasic, MFProcArray, MFMoves, MFTime EXPORTS MFTime = PUBLIC BEGIN OPEN PascalBasic, PascalWizardFiles, MFTypes, MFProcArray, MFMoves, MFTime; CubicIntersection: PROCEDURE[P,Pp: Halfword] = BEGIN Q, Qq:Halfword;--558:-- CIInit1: PROCEDURE = BEGIN Q_Mem[P]^.Hh.Rh; Qq_Mem[Pp]^.Hh.Rh;BisectPtr_20; BisectStack^[BisectPtr-5]_Mem[ INT[P]+5]^.Int-Mem[ INT[P]+1]^.Int; BisectStack^[BisectPtr-4]_Mem[ INT[Q]+3]^.Int-Mem[ INT[P]+5]^.Int; BisectStack^[BisectPtr-3]_Mem[ INT[Q]+1]^.Int-Mem[ INT[Q]+3]^.Int; IF BisectStack^[BisectPtr-5]<0 THEN IF BisectStack^[BisectPtr-3]>=0 THEN BEGIN IF BisectStack^[BisectPtr-4]<0 THEN BisectStack^[BisectPtr -2]_BisectStack^[BisectPtr-5]+BisectStack^[BisectPtr-4] ELSE BisectStack^[BisectPtr-2]_BisectStack^[BisectPtr-5]; BisectStack^[BisectPtr-1]_BisectStack^[BisectPtr-5]+BisectStack^ [BisectPtr-4]+BisectStack^[BisectPtr-3]; IF BisectStack^[BisectPtr-1]<0 THEN BisectStack^[BisectPtr-1]_0; END ELSE BEGIN BisectStack^[BisectPtr-2]_ BisectStack^[BisectPtr-5]+BisectStack^[BisectPtr-4]+BisectStack^[BisectPtr-3]; IF BisectStack^[BisectPtr-2]>BisectStack^[BisectPtr-5] THEN BisectStack^[BisectPtr-2]_BisectStack^[BisectPtr-5]; BisectStack^[BisectPtr-1]_BisectStack^[BisectPtr-5]+BisectStack^ [BisectPtr-4]; IF BisectStack^[BisectPtr-1]<0 THEN BisectStack^[BisectPtr-1]_0; END ELSE IF BisectStack^[BisectPtr-3]<=0 THEN BEGIN IF BisectStack^ [BisectPtr-4]>0 THEN BisectStack^[BisectPtr-1]_BisectStack^[BisectPtr -5]+BisectStack^[BisectPtr-4] ELSE BisectStack^[BisectPtr-1]_ BisectStack^[BisectPtr-5]; BisectStack^[BisectPtr-2]_BisectStack^[BisectPtr-5]+BisectStack^ [BisectPtr-4]+BisectStack^[BisectPtr-3]; IF BisectStack^[BisectPtr-2]>0 THEN BisectStack^[BisectPtr-2]_0; END ELSE BEGIN BisectStack^[BisectPtr-1]_ BisectStack^[BisectPtr-5]+BisectStack^[BisectPtr-4]+BisectStack^[BisectPtr-3]; IF BisectStack^[BisectPtr-1]0 THEN BisectStack^[BisectPtr-2]_0; END; BisectStack^[BisectPtr-10]_Mem[ INT[P]+6]^.Int-Mem[ INT[P]+2]^.Int; BisectStack^[BisectPtr-9]_Mem[ INT[Q]+4]^.Int-Mem[ INT[P]+6]^.Int; BisectStack^[BisectPtr-8]_Mem[ INT[Q]+2]^.Int-Mem[ INT[Q]+4]^.Int; IF BisectStack^[BisectPtr-10]<0 THEN IF BisectStack^[BisectPtr-8]>=0 THEN BEGIN IF BisectStack^[BisectPtr-9]<0 THEN BisectStack^[BisectPtr -7]_BisectStack^[BisectPtr-10]+BisectStack^[BisectPtr-9] ELSE BisectStack^[BisectPtr-7]_BisectStack^[BisectPtr-10]; BisectStack^[BisectPtr-6]_BisectStack^[BisectPtr-10]+BisectStack^ [BisectPtr-9]+BisectStack^[BisectPtr-8]; IF BisectStack^[BisectPtr-6]<0 THEN BisectStack^[BisectPtr-6]_0; END ELSE BEGIN BisectStack^[BisectPtr-7]_ BisectStack^[BisectPtr-10]+BisectStack^[BisectPtr-9]+BisectStack^[BisectPtr-8]; IF BisectStack^[BisectPtr-7]>BisectStack^[BisectPtr-10] THEN BisectStack^[BisectPtr-7]_BisectStack^[BisectPtr-10]; BisectStack^[BisectPtr-6]_BisectStack^[BisectPtr-10]+BisectStack^ [BisectPtr-9]; IF BisectStack^[BisectPtr-6]<0 THEN BisectStack^[BisectPtr-6]_0; END ELSE IF BisectStack^[BisectPtr-8]<=0 THEN BEGIN IF BisectStack^ [BisectPtr-9]>0 THEN BisectStack^[BisectPtr-6]_BisectStack^[BisectPtr -10]+BisectStack^[BisectPtr-9] ELSE BisectStack^[BisectPtr-6]_ BisectStack^[BisectPtr-10]; BisectStack^[BisectPtr-7]_BisectStack^[BisectPtr-10]+BisectStack^ [BisectPtr-9]+BisectStack^[BisectPtr-8]; IF BisectStack^[BisectPtr-7]>0 THEN BisectStack^[BisectPtr-7]_0; END ELSE BEGIN BisectStack^[BisectPtr-6]_ BisectStack^[BisectPtr-10]+BisectStack^[BisectPtr-9]+BisectStack^[BisectPtr-8]; IF BisectStack^[BisectPtr-6]0 THEN BisectStack^[BisectPtr-7]_0; END; END; CIInit2: PROCEDURE = BEGIN BisectStack^[BisectPtr-15]_Mem[ INT[Pp]+5]^.Int-Mem[ INT[Pp]+1]^.Int; BisectStack^[BisectPtr-14]_Mem[ INT[Qq]+3]^.Int-Mem[ INT[Pp]+5]^.Int; BisectStack^[BisectPtr-13]_Mem[ INT[Qq]+1]^.Int-Mem[ INT[Qq]+3]^.Int; IF BisectStack^[BisectPtr-15]<0 THEN IF BisectStack^[BisectPtr-13]>=0 THEN BEGIN IF BisectStack^[BisectPtr-14]<0 THEN BisectStack^[BisectPtr -12]_BisectStack^[BisectPtr-15]+BisectStack^[BisectPtr-14] ELSE BisectStack^[BisectPtr-12]_BisectStack^[BisectPtr-15]; BisectStack^[BisectPtr-11]_BisectStack^[BisectPtr-15]+BisectStack^ [BisectPtr-14]+BisectStack^[BisectPtr-13]; IF BisectStack^[BisectPtr-11]<0 THEN BisectStack^[BisectPtr-11]_0; END ELSE BEGIN BisectStack^[BisectPtr-12]_ BisectStack^[BisectPtr-15]+BisectStack^[BisectPtr-14]+BisectStack^[BisectPtr-13]; IF BisectStack^[BisectPtr-12]>BisectStack^[BisectPtr-15] THEN BisectStack^[BisectPtr-12]_BisectStack^[BisectPtr-15]; BisectStack^[BisectPtr-11]_BisectStack^[BisectPtr-15]+BisectStack^ [BisectPtr-14]; IF BisectStack^[BisectPtr-11]<0 THEN BisectStack^[BisectPtr-11]_0; END ELSE IF BisectStack^[BisectPtr-13]<=0 THEN BEGIN IF BisectStack^ [BisectPtr-14]>0 THEN BisectStack^[BisectPtr-11]_BisectStack^ [BisectPtr-15]+BisectStack^[BisectPtr-14] ELSE BisectStack^[BisectPtr -11]_BisectStack^[BisectPtr-15]; BisectStack^[BisectPtr-12]_BisectStack^[BisectPtr-15]+BisectStack^ [BisectPtr-14]+BisectStack^[BisectPtr-13]; IF BisectStack^[BisectPtr-12]>0 THEN BisectStack^[BisectPtr-12]_0; END ELSE BEGIN BisectStack^[BisectPtr-11]_ BisectStack^[BisectPtr-15]+BisectStack^[BisectPtr-14]+BisectStack^[BisectPtr-13]; IF BisectStack^[BisectPtr-11]0 THEN BisectStack^[BisectPtr-12]_0; END;BisectStack^[BisectPtr-20]_Mem[ INT[Pp]+6]^.Int-Mem[ INT[Pp]+2]^.Int; BisectStack^[BisectPtr-19]_Mem[ INT[Qq]+4]^.Int-Mem[ INT[Pp]+6]^.Int; BisectStack^[BisectPtr-18]_Mem[ INT[Qq]+2]^.Int-Mem[ INT[Qq]+4]^.Int; IF BisectStack^[BisectPtr-20]<0 THEN IF BisectStack^[BisectPtr-18]>=0 THEN BEGIN IF BisectStack^[BisectPtr-19]<0 THEN BisectStack^[BisectPtr -17]_BisectStack^[BisectPtr-20]+BisectStack^[BisectPtr-19] ELSE BisectStack^[BisectPtr-17]_BisectStack^[BisectPtr-20]; BisectStack^[BisectPtr-16]_BisectStack^[BisectPtr-20]+BisectStack^ [BisectPtr-19]+BisectStack^[BisectPtr-18]; IF BisectStack^[BisectPtr-16]<0 THEN BisectStack^[BisectPtr-16]_0; END ELSE BEGIN BisectStack^[BisectPtr-17]_ BisectStack^[BisectPtr-20]+BisectStack^[BisectPtr-19]+BisectStack^[BisectPtr-18]; IF BisectStack^[BisectPtr-17]>BisectStack^[BisectPtr-20] THEN BisectStack^[BisectPtr-17]_BisectStack^[BisectPtr-20]; BisectStack^[BisectPtr-16]_BisectStack^[BisectPtr-20]+BisectStack^ [BisectPtr-19]; IF BisectStack^[BisectPtr-16]<0 THEN BisectStack^[BisectPtr-16]_0; END ELSE IF BisectStack^[BisectPtr-18]<=0 THEN BEGIN IF BisectStack^ [BisectPtr-19]>0 THEN BisectStack^[BisectPtr-16]_BisectStack^ [BisectPtr-20]+BisectStack^[BisectPtr-19] ELSE BisectStack^[BisectPtr -16]_BisectStack^[BisectPtr-20]; BisectStack^[BisectPtr-17]_BisectStack^[BisectPtr-20]+BisectStack^ [BisectPtr-19]+BisectStack^[BisectPtr-18]; IF BisectStack^[BisectPtr-17]>0 THEN BisectStack^[BisectPtr-17]_0; END ELSE BEGIN BisectStack^[BisectPtr-16]_ BisectStack^[BisectPtr-20]+BisectStack^[BisectPtr-19]+BisectStack^[BisectPtr-18]; IF BisectStack^[BisectPtr-16]0 THEN BisectStack^[BisectPtr-17]_0; END;Delx_Mem[ INT[P]+1]^.Int-Mem[ INT[Pp]+1]^.Int;Dely_Mem[ INT[P]+2]^.Int-Mem[ INT[Pp]+2]^.Int; Tol_0;Uv_BisectPtr;Xy_BisectPtr;ThreeL_0;CurT_1;CurTt_1 ; END; --:558-- TimeToGo_5000;CIInit1[];CIInit2[]; {WHILE TRUE DO BEGIN DO {--Label22:--IF Delx-Tol<=BisectStack^[Xy-11]-BisectStack^[Uv -2] THEN IF Delx+Tol>=BisectStack^[Xy-12]-BisectStack^[Uv-1] THEN IF Dely-Tol<=BisectStack^[Xy-16]-BisectStack^[Uv-7] THEN IF Dely+Tol>=BisectStack^[Xy-17]-BisectStack^[Uv-6] THEN BEGIN IF CurT>=131072 THEN BEGIN CurT_ PascalDIVPower2[(CurT+1),1];CurTt_ PascalDIVPower2[(CurTt+1),1]; GOTO Label10; END; InterSubdivide[]; GOTO Label22; END; IF TimeToGo>0 THEN TimeToGo_TimeToGo-1 ELSE BEGIN CurT_0; CurTt_0; GOTO Label10; END;--560: DO {--Label45:--IF PascalODD[CurTt] THEN IF PascalODD[CurT] THEN--561:--BEGIN CurT_ PascalDIVPower2[(CurT),1]; CurTt_ PascalDIVPower2[(CurTt),1];IF CurT=0 THEN GOTO Label10;BisectPtr_BisectPtr-45; Delx_BisectStack^[BisectPtr];Dely_BisectStack^[BisectPtr+1]; Tol_BisectStack^[BisectPtr+2];Uv_BisectStack^[BisectPtr+3]; Xy_BisectStack^[BisectPtr+4]; GOTO Label45; END--:561 ELSE BEGIN CurT_CurT+1; Delx_Delx+BisectStack^[Uv-5]+BisectStack^[Uv-4]+BisectStack^[Uv-3]; Dely_Dely+BisectStack^[Uv-10]+BisectStack^[Uv-9]+BisectStack^[Uv-8]; Uv_Uv+20;CurTt_CurTt-1;Xy_Xy-20; Delx_Delx+BisectStack^[Xy-15]+BisectStack^[Xy-14]+BisectStack^[Xy-13]; Dely_Dely+BisectStack^[Xy-20]+BisectStack^[Xy-19]+BisectStack^[Xy-18]; END ELSE BEGIN CurTt_CurTt+1;Tol_Tol+ThreeL; Delx_Delx-BisectStack^[Xy-15]-BisectStack^[Xy-14]-BisectStack^[Xy-13]; Dely_Dely-BisectStack^[Xy-20]-BisectStack^[Xy-19]-BisectStack^[Xy-18]; Xy_Xy+20; END--:560--;EXIT; EXITS Label45 => NULL} ENDLOOP;EXIT; EXITS Label22 => NULL} ENDLOOP; END ENDLOOP ;EXITS Label10 => NULL}; END;--:556----562: END.