LnSOS BOOT 1.1 SOS.KERNEL SOS KRNLI/O ERRORFILE 'SOS.KERNEL' NOT FOUND%INVALID KERNEL FILE: xةw,@  ȱlmi8#)!)&)bf` VMEMORYMARASTERCORASTERCORASTERFORASTERFO [TMAPIO.LINK0!+TMAPIO.TEXT ! )TMEM.CODE! TMEM.LIB'!ר)TMEM.TEXT ! +TOOLKIT.ERRo !! ,! .RASTERCORE.LIBg! ,SOS.ASM.CODE!",SOS.ASM.TEXT,!THANK.YOU= != +TMAPIO.CODE! TMAPIO.LIB'!III.GRX.05CS.05u' .ERR.CLASS.TEXT|!+MACROS.TEXT  ! +PMAPIO.TEXT$!.PRINT.ASM.CODE!).PRINT.ASM.TEXT !-PRINTMAP.TEXT >dLԡm#i㰼m#iЕOLԡȱfg hi !dLԡ憦  Ljmkm l y`2 Lԡ8(Je稽)ʈ@L/&'; Third Wave Raster Graphics ToolKit Version 1.0 24-Aug-84  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm6ڳAڳBسLA :/ۨڨ?Pá ɡPá ɡG VG----------------}  function Error_Flag: boolean; function Fatal_Error: boolean; procedure Set_Error ( Error: error_rec ); procedure Get_Error ( var Error: error_rec );  procedure Clear_Error;  {-------Version Control-------------------------} function Mem_Version: real;  implementation E ure Seg_FillByte ( Seg: handle; Offset, LenBytes: real; Value: m_byte );   {-------Consolidating Free Space----------------}   procedure Crunch;   {-------Error Handling--------------------------}  function Error_Flag: boolean; function Fatal_Error: boolean; procedure Set_Error ( Error: error_rec ); procedure Get_Error ( var Error: error_rec );  procedure Clear_Error;  {-------Version Control---------------------:Destin_Seg: handle; Destin_Offset, :LenBytes: real );  procedure Seg_FillByte ( Seg: handle; Offset, LenBytes: real; Value: m_byte );   {-------Consolidating Free Space----------------}   procedure Crunch;   {-------Error Handling---------- var Address: x_addr );  {-------Copying and Filling Memory--------------} procedure Gen_Copy ( Source, Destination: x_addr; LenBytes: real ); procedure Seg_Copy ( Source_Seg: handle; Source_Offset: real; : handle; var Info: seg_rec );  procedure Handle_x_addr ( Seg_Name: handle; var Address: x_addr );  function RootHandle: handle;  function NextHandle: handle;  function Get_p_addr ( var Name ): p_addr;  procedure Get_x_addr ( var Name;_Name: handle ); procedure Unlock_Seg ( Seg_Name: handle );   {-------Releasing Memory------------------------}  procedure Release_Seg ( Seg_Name: handle ); {-------Inquiries-------------------------------} procedure Seg_Info ( Seg_Nameprocedure Pascal_Seg ( Desir_Addr: p_addr; Len: real; Id: m_byte; :var Seg_Name: handle ); procedure Video_Seg ( Domain_Size: integer; var Seg_Name: handle );   {-------Locking Memory Segments-----------------}  procedure Lock_Seg ( Segure Alloc_Seg ( Desir_Len: real; Id: m_byte; var Return_Len: real; :var Seg_Name: handle ); :'')PBBINTEGER xxtREAL  S  {-------Initialization and Termination----------}  procedure Open_Memory ( NewOpen: boolean; Domain_Size, Segments: integer; :var Ret_Size, Ret_Segs: integer );  procedure Close_Memory;  {-------Memory Allocation-----------------------} proced Record :Address: x_addr; :Len: real; :Id: m_byte; :Relocation: m_byte 8end; ( (error_rec= packed Record :Unit_Number: m_byte; :Proc_Number: m_byte; :Err_Number: m_byte; :Severity: Warn..Fatal; 8end; 8 ( const Null_handle= 0; (Warn= 1; (Fatal= 127;   type handle= integer; (m_byte= 0..255; (p_addr= integer; ( (x_addr= Record 8 TwoByte: integer; :Extend: m_byte; 8end; ( (seg_rec= G X/? @ @ GGG G  C| /!/ !@ !GGG F ('*+'( 8 `> ? ! > ? 8c ( b '*+'( 8b c  `5 6 9 Lj e 1 e2 eEFL< = ! *< += L 8 w%   IJ !ȥȥȥ  LCd e LS KLȥL< w%L w%d e LS ȑ-H,H`> ? ! > ?  8;*+ 1 e2 eGȱHH G𶐴(L'LL$8'E'(F(   Lee 8逅Lee 8逅L68EF iLW8EF iLxyvsP h,h-hhhhhJhKhhhhhh U LL NHMH-H,H`FD JH;85/nh,h-hhhhhChDhhhh E Fd % J&L  w%L7 < = ! EF 8< *= +{xwtnod@?:*)ZY& CB;32)h,h-L % J&j d q  ~ ѭ21 2 7   w%-H,H`E`@`vutonmldME=-(~{xuspmjg^[ZYXWVSPK?9876543210/.-,+*)('&%$#"!   }gdaZYXWROHGFEDC?:,$  | w%%) %-H,H`A`C`B%`M  MLJLL`<:8642 ȩȩȩ  e 8mm 8逅Llmm 8逅LL$&&  w%L w%L   L8戭 138 L ; ;L     w%L w%L  w%L 8 ( )L&  8∭ 8  *p      %    ('ˡ ˡ*(ܟá!C#B[2" h,h-hhhhhhhhhhȑ% J& w%L w%L *L  w%~ *u  ~1GG [|) %      )>* G š % '۟˄á   ܢܢ ܢ áظ٢ ؚe $ š(ġ$#&%ˡ  &&' &(ۨڨ@GGG H ?! š( á   6 J#   ˄!7 22 ȥ!L`5 6 9  !  )I102ȱ022031" #! 8` ! 1 e02 e10$ "!#0213` "!#0213* +! ! 1 e02 e10$`$0`$`&&&`ffffff` @ & * 8f '8醅 8&&& &F fff   `  ` F fff 0 && & f j f`RPC@=%^hhhhhhhh U hh J&%L  w%LɁ)Lk欫L̫HH`zZROJ41.* h,h-hhh@"hA" J&Ɂ)LxeeɁ)L.Ү `meG/,){xG-*)$   w%L  w%LɁ)LɁ)L HH`ɀ Ɇ0L` LG&ڬLLeemjif^]\[ZYXUTSPONKID=60+&{+(.   W0-*)}|{%&&hhhhhh hhhh J&%L  w%L U >;:983-*)(&%$#"!~}|yxwtsronk_^]ZWVSP<930-*'$!{srqpo(mf( z'(  / LYzL^ee 8逅Lee 8逅Lxy zL^ee 8逅Lee 8逅L= L^+L*L w%L^ w%-H,H`]WKee 8逅Lxy LYL^+L*LLQoL^z< = !  &m$e'k%e(l8逍lmLmmke'kle(l8逍lmL<mmmtLClsLCkrLCge''he(( z'(n'me'8逍lmLmmmtLlsLkrono LYL^poLqnL= < < = ! nL &wL%vL$uL'e(fo /Lz'e(e z / LYzPee 8逅L8逍vwLwwumguvmhv8逍vwLwwJ K 8v  wpH tI 8 sqpL(w&L%v%L%u$nqL2j2i2kkmiklmjl8逍lmLommkmiklmjl ; !: LL; `h%"NL?.+*%jgbSh,h-h@"hA" J& %L  w%L^ "LQ  / B"LQ  /L^nopqrghtwrmgusmhvhh U hh J&%L  w%L) LL LȥL w%L w%ȑ-H,H`< = !  = +< *('L `: ; ! &+%#$]cd  w%L=  w%L=efLEefeȭf-H,H`\ZG&  tqnmjifb${Hh,h-hhhhhhh,h-hhhYhZ J&%L  w%L=< = ! < *= + w% = $%ߥ&ɀ٩cYdndnc(d'c w%L=$[8'c'(d($mc$%md% 8逅%&L&&$mc$%md% 8逅%&L&&  /  w%L=[\jb]OGB4/,)|ngf=:41#lhZ80P9LA98~}ytLI=:7\W 4t %L  w%LO " w%LO$ȥ%ȥ&-H,H`(PNMJ@;72rh,h-hhhh J& %L  w%L  w%L$ȥ%ȥ&ȩ)ȩ  L'(  ȥȥȥ )ȩL w%-H,H`> ? !  ('> *? +L``: ; !  &&%$: *; +L``   l%743.#}v]Xxh,h-hhhh> ? !  (H'H53 C_PixelMap: pixelmap; { Current PixelMap } C_Pen_Mode: pmode; { Current Pen Mode } C_Pen_Color: screencolor; { Current Pen Color } C_Fill_Color: screenco{ rectangular bounds of PixelMap } MapMode: gmode; { graphics mode } MapPage: gpage; { graphics page } end; rcore_state = record lmap = record MapPntr: handle; { pixelmap identifier (integer) } MaxSize: point; { MaxSize.h is the width } { MaxSize.v is the height } Bounds: rect; } y: real; { y pen position } end; rect = record BotLeft: point; TopRight: point end; pixe h: integer; { horizontal pixel position } v: integer { vertical pixel position } end; rpoint = record x: real; { x pen position egInvert, NegErase ); point = record :'')PBBINTEGER x mREAL moC gmode = ( BW280, CP280, BW560, COL140, BitMap, NibbleMap ); linearMap = BitMap..NibbleMap; gpage = integer; { 1..3 for Screen modes } pmode = ( Store, Overlay, Invert, Erase, :NegStore, NegOverlay, N 7; S_Brown= 8; S_Orange= 9; S_Grey2= 10; S_Pink= 11; S_Green= 12; S_Yellow= 13; S_Aqua= 14; S_White= 15; Type screencolor = integer; Uses {$u *memory/memory.man.code } Memory_Manager; const S_Black= 0; S_Magenta= 1; S_DarkBlue= 2; S_Lavender= 3; S_DarkGreen= 4; S_Grey1= 5; S_MediumBlue= 6; S_LightBlue= ( $020 (  ; ; Zero the head nodes first ; (ldy #1f ;Be sure to leave node 0 alone (lda #0  $005 sta @Xaddr0,y (dey (cpy #7 (bne $005 ( (ldy #0e ;Allocated segs (lda A"?<Ph,h-hh%)%-H,H`2%)%`  !!!!!""b$"%%xBL&#&B4#BP T#P$T%ztF :4>&f /*;No $010 lda GrafSeg,y (sta @Xaddr0,y (dey (bpl $010-H,H`64)%9Th,h-hhhhH%H-H,H`*h,h-hh) NN-H,H`NMOP Q`C?.-,)lh,h- J&% )<=8 ȑ) ȑ-H,H`% " w%L^  B"LY) e) L^ w%L^ w%-H,H`WD90)#pnhed_[VRQ@:4 h,h-h@"hA"=$ J&%L#2h,h-hhhh J&-H,H` h,h-hhh@hA J&@ȭA)ȥȩ64-H,H`9632Ph,h-hhhh> ? !  # d3  # d" (H'H #m# ##m##L]HH-H,H`? + > *``XI'wtqpoe^XMLKJIH94h,h-h@"hA"e J&%L  w%L^lor; { Current Fill Color } C_Mask_Select: screencolor; { Current Mask Selector } C_Fixed_Pattern: boolean; { Current Fixed Pattern } C_Align: point; { Current Pattern alignment } C_Grafix_On: boolean; { Current Video on/off } C_CharSize: point; { Current Character Size } end; var ScreenMap: pixelmap; Null_Map:  {-------Pixel Primitives----------------} procedure Set_Pixel ( X,Y: real; Color: screencolor ); function Get_Pixel ( X,Y: real): screencolor;  procedure Set_Row ( X,Y: real; Npixels: integer; var scan_row: bytestream ); procedure Get_RoxelMap; Width, Height: integer; MapKind: linearMap ); procedure Pascal_Map ( var NewMap: pixelMap; Address: p_addr; :Width, Height: integer; MapKind: linearMap ); procedure Release_Map ( var Map: pixelMap ); r R: rect; HCenter, VCenter: integer); procedure Offset_Rect ( var R: rect; dH, dV: integer ); procedure Size_Rect ( var R: rect; Width, Height: integer );  {-------PixelMap Memory Allocation------} procedure Alloc_XMap ( var NewMap: pit,Right,Bottom,Top: integer ); procedure Set_Center_Rect ( var R: rect; HCenter, VCenter, Width, Height: integer); procedure Sect_Rect ( SrcRectA,SrcRectB: rect; var DstRect: rect ); procedure Center_Rect ( va {-------Mask building-------------------} procedure Build_Mask ( Map, Mask: pixelMap; NumValues: integer; var Values: bytestream );  {-------Rectangle manipulation----------} procedure Set_Bounds_Rect ( var R: rect; Lefmap; Width,Height: integer); procedure Pattern_Mask ( Pixel_Pattern, Mask: pixelmap );  {-------Pattern Fill Attributes---------} procedure Mask_Select ( Selector: screenColor ); procedure Align_Pattern ( Fixed: boolean; dH, dV: integer ); ------------------}  procedure Invert_Rect ( Bounds: rect );   {-------Pattern Fill--------------------} procedure Solid_Mask ( Mask: pixelmap ); procedure Pattern_Rect ( Pixel_Pattern: pixelmap ); procedure Tile_Rect ( Pixel_Pattern: pixelct ( Bounds: rect ); procedure Fill_Row ( X,Y: real; Npixels: integer ); procedure Fill_Column ( X,Y: real; Npixels: integer );  {-------Solid Fill Attributes-----------} procedure Fill_Color ( Color: screencolor ); {-------Inverting----- {-------Text Primitives-----------------} procedure R_Char ( Ch: char ); procedure R_String ( TextString: string ); procedure R_LF ( Rows: real );  {-------Solid Fill Primitives-----------} procedure Fill_Vport; procedure Fill_Re-----Line Drawing Attributes---------} procedure Pen_Color ( Color: screencolor ); procedure Pen_Mode ( Mode: pmode );  {-------Pen Inquiries-------------------} function G_Pen_X: real; function G_Pen_Y: real; ( X,Y: real ); procedure R_Move_To ( dX,dY: real ); procedure R_Line_To ( dX,dY: real ); procedure R_Dot_At ( dX,dY: real ); procedure FrameRect ( Bounds: rect ); procedure P_Gon ( Nvertices: integer; var Vertices );  {--  {-------Setting the Viewport------------} procedure Max_Vport; procedure Vport ( Bounds: rect );  {-------Line Drawing Primitives---------} procedure Move_To ( X,Y: real ); procedure Line_To ( X,Y: real ); procedure Dot_At procedure Current_Map ( Map: pixelmap ); procedure Grafix_Mode ( Mode: gmode ); procedure Grafix_Page ( Page: gpage );  {-------Screen Video Control------------} procedure Grafix_On; procedure Text_On; procedure Screen_Off; procedure Screen_On; pixelmap; Cur_RState: rcore_state;  {-------Initialization and Termination--} procedure Open_RCore ( Mode: gmode; Pages: gpage ); procedure Close_RCore;  {-------Directing Graphical Output------} w ( X,Y: real; Npixels: integer; var scan_row: bytestream );  procedure Set_Column ( X,Y: real; Npixels: integer; var scan_column: bytestream ); procedure Get_Column ( X,Y: real; Npixels: integer; var scan_column: bytestream );  {-------Saving and Loading the Screen---} procedure Save_Screen ( FileName: string ); procedure Load_Screen ( FileName: string );  {-------State Records-------------------} procedure Initial_RState; procedure Save_RState ( var State: rcore_state ); procedur t LlXTlXNXnXXXXXΠX J XmXXXmXXXήXέXXXXX  t 8fX eX\yX\zX\{X\|X`zyrkjeb_\[ZYXWVUTSMFEDC>;:7521.$N'uX xAhhhhHHgXLOAmXLOA hX LOAfXfXlX~lXX.X XXLmXXXX .X  XXL8XXXX8XXXX T` XmX` eXȩȭfXȩmX ``$V>spaDA)&hhhHHnXLOAhXLv\ j\ LOAhXgXeXmX fXʊ eX.\X"\XF\X:\X . XX ^\X ~eX CXYXDXZX+XSX,XTX7XVX8XWX WWLLOAX LOAXeXmXgXXXXXX1/?==/ צ.ɡۚښښۚNڨ٨/ N N N Nɍ)N+ۨ ڨ (DHH@,6(FG&O4%/ۚݢٚݢښݢؚ  )*G&*L/ȡ1Lȡ2Lݢݢٕݢؕ B*/ەܕ-0,/قۢ؂ۢقۢ؂,-.G&.M/.ب "D H>"ب #D '  H' ' ?' 8#$G&$Kڨ $Dȡ1Kȡ2K'  H' )' ?' N$ ٨ ب %D HH ?,تP/.,+0+0ȡ+'$++., +^T/ȡM'&á#'&'//'$'%0'//JI'&"/FáGG^/'%ب/يڊ ۊڊۊ܊ي܊يڊ/F  /JG/ /ۚܚ&H/á @š//CA''' '3 FG'3TA'/ e Load_RState ( State: rcore_state );   {-------Version Control-----------------} function RCore_Version: real;  implementation E eam ); procedure Get_Column ( X,Y: real; Npixels: integer; var scan_column: bytestream );  {-------Savi~:~'uXgXLOAx) @eX)J,P,QJ,R,SfX,TLJ,U,W @(  `#ihcT9|'uXx) @)J,P,QJ,R,SJ,T,U,V( `Q\' uXx)ߍ)(`$' uXx  (`$' uX xA XX `.'uX xAhhhhHH0LOAwoiXjX = iX) WPXWQX _` wȑ`VT"g_LKJ2Y3Y4Y1YIY2YJY3YKY4YLY`iitX!LOA A _B5Y6Y7Y8Y A _B9Y:Y;Y'uX xAhhhhhhHHtXgXLOA LOA` A _B-Y.Y/Y0Y-YEY.YFY/YGY0YHY A _B1YyxutpolkhgdcBA>=tqhc\UNJ;`_JIHGFEDCBA@?>=<;:9876543210'uX xAhhhhhh A _B1Y2Y3Y4Yhhhh A _B-Y.Y/Y0YHHgXLOA()*+F'f&f%f$&(e$()e%)*e&*+e'+֥($)%*&+'`FNkjfea]TLKsml[ZWTQNA@=:74/*)!   0  K)Y+Y?Y%Y@Y&YCY'YDY(Y5Y-Y6Y.Y7Y/Y8Y0Y9Y1Y:Y2Y;Y3YY-/Y?Y.0Y@Y/DY4YCY3YBY2YAY1Y& (58CY3Y*DY4Y+8AY1Y0BY2Y1CY3Y2DY4Y3L83YCY*4YDY+81YAY02YBY13YCY24YDY3)+.(*((.)/*2+3.Y2Y-Y1Y-1,0&  (LX xAhhhhhh A _B9Y:Y;YYBY @Y0Y?Y/Y>Y.Y=Y-Y& (58?Y/Y(@Y0Y)8=Y-Y,>Y.Y-?Y/Y.@Y0A =mXLUXX UXLUX`yxidYXUPG>5 ' uX xAhhhhhh A _B1Y2Y3Y4Yhhhh A _B-Y.Y/Y0YHHgXLOA`ihWVSPMJ=<9630+&'uNMLKBA@?>'uX xAhhhhHHgXLOA =tXLOA LU` (J >"#'Y(Y%Y&Y C%Y&Y C`[wrda\ZEB?<;0-,'!uX xAhhhhHHgXLOA WtXLO`ZYJ/}lPC@='uX xAgXLOA RmXLRXX RXLRXXXX'YX(YX%YX&Y CX%YX&Y C`w`_\SRQPO\X aX q` [Xȑ`kjiheb^\YXUTSRQPONMLIDA' uX xAhhhhHHgXLOAk XXtX (J /LOAtXLOAks X ` mmX 䭾 IDCBA< 'uX xAhhhhHH0LOA\XL\X) }XXMjX^X)`X bX O` \Xȑ`cbIHGF>=;:63.+' uX xAhhhhHH0LOA[XL[X)]X:]X)_X}X ~XX) }XX[X[X\X}|{zv7'uX xAhhhhhh A1Ye1Y2Ye2Y3Ye3Y4Ye4Yhhhh A-Ye-Y.Ye.Y/Ye/Y0Ye0YHHgXLOA`}|kifeba^]ZMKHGDC@?<72'uX xAhhhhhh A1Ye9Y2Ye:Y3Ye;Y4Ye832/% l'"uX xAhhhXhXhXhXhhHHgXLOAX" Y*X,LOAtXLOA L' (J L" '( +YYYEC@?:410-'hhhhHH`'uX xAhhhXhXhXhXhhHHgXLOAX Y*X,LOAtXLOA`UTNLJH=83-,'$!x'&uX xAhhhhHHgXLOA0LOAkX ȩ`K````^XTI?4+  :'hhhhHH9uX xALOAeX.LOA  L  1 8fX eX    L + L`ed[ZSRONMLJutca^]ZYVUREC@?<;874/'hhhhHH8uX xALOAeX.LOA ; 68fX eX  -@"'%F H OA` @@@ @@@@ @``` ``Yjչ\r]\\Y` Y Y0Y1Y2Y3F3f2 e0e10&1m Ym Y,Y0eLy `$  ?% jvsO _\RJ|ZD> ~ { x g e @ = : 7 1 , ' $ #           ~}|l;}|{zyxwvurolhgdc_^[Z87430+ 32.-,('$#3H'uX xAhhh h hhhh A _B67hhhh A _B45HHgXLOA4?Y5@Y6CY7DY DOY1L38X6X78   X6X7 m6CY m7DY8 %Y&Y'Y(Y C`XbX^X  : )MjX^X)`X bX+Y)Y OX'Y(Y 2DL;`XbX^X`wt_\MIEA1,&UTPL~smZV?97hhhhh h hhhh A _Bhhhh A _BHHgXLOA?Y@YCYDY DOY>L8XX8   XXee mCY mDY8CYCYDYDY DOY8CYXDYX8   HgXLOA?Y@YCYDY DOYLXX %Y&Y'Y(Y C  $+Y XX 'Y(Y 2DL`yuqhd`\(  qpebaF'6uX xA%Y&Y C RX`~fbKGON76 )'7uX xAhhhhh h hhhh A _Bhhhh A _BH'uX xAhhh h hhhh A _B hhhh A _BHHgXLOA?Y@YCY DY DOY1L8XX8   XX m?Y m@Y8?Y!?Y@Y"@Y DOY X?YX@Y'Y (Y?Y%Y@Y&Y C^X)`X bX+Y)Y OX)Y)YͦX)Y+YL;`XbX^X`mj[WSO?:4! UTPL{hdMGEA@<;:6521  5ZOA?Y@YCYDY DOY>L8XX8   XXee m?Y m@Y8?Y?Y@Y@Y DOY8?YX@YX8    %Y&Y'Y(Y C`XbX^X  H )MjX  5+Y)Y XX )Y)YͦXЩ)Y+YL`}tplh#  yxwlkjedH'4uX xAhhhhh h hhhh A _Bhhhh A _BHHgXL~}{z[4321H'5uX xAhhhhh h hhhh A _Bhhhh A _BHHgXLOA?Y@YCYDY DOYL %Y&Y'Y(Y CLY YYY8XXYYYYY!YY"YY#Y$YL'8YYYYL'`8 ! !8"#"#`@Q7ON<:86.,*(  Y*tXLOAY ,LOA*LOA()&'*+$%8XXXX8XXXX  '( ( +YYY Y 9, RX RQ Y XYXYL'L*|yxuSLIF3)&# qpba\ZVSKID?=96,"0^ '(uX xAhhhhhhhXhXhXhXhhh Yh Yh Yh YhhHHnXLOAXXX)XtX Y*tXLOAX0 ~}zyvspkfeWTSPNKJGFEDC@=-,)&$CY8CYDY9DY DOY*8CYXDYX8   XCYXDY4%Y5&YCY'YDY(Y C   RX`^Za`IH10!   *'uX xA-Y.Y/Y0Y BLA#"!:'uX xA1Y2Y3Y4Y BLA#"!:'2uX xAhhhhhhhh A _Bhhhh A _BHHgXLOA?Y@YCYDY DOYQ%Y U U + + c c 7 }a ~x vqn&!fsgggggggggggggggg2C @ 5 2 / $    ywrmkg_UROL,'%%tX#tX 8 ! !8"#"#`'Y(Y Xʈ,Y`'Y(Y X ,Y`'Y(Y'YL 'Y(Y'YL3 Xʈ,Y OX`X ,Y OX`'Y(Y  OX`'Y(Y'Y  OX`G G  &'&%$$8f'f&f%f$$ %&'` tX$%&'()*+0 ͨXͧX8X(X)XX0'ͬXͫX8X*X+XX0 ͪXͩX8X&X'XX0'ͮXͭX8X$X%XX00 #8$%&'`#06" !  !"#F#f"f!f Lx !"#H#" ! ȥ !"#"! 8f#f"f!f !"#'06& %$$ %&'F'f&f%f$L$%&'H'& %$ȥ$%ͭX  д ЭLW0!ͬXIͫX> 0!ͮX$ͭX  Ь Х=Y>Y?Y@YAYBYCYDYL 3e e!e"e#e$e%e&e'` 38 !"8$$%%&&''#0'SL'0LLR0@ͨX;ͧX2 0#ͪXͩX  м еLW0!ͬXAͫX6 0#ͪXͩX  д ЭLW0HͨXCͧX: 0!ͮX$8Y#9Y$:Y%;Y&Y.Y?Y/Y@Y0YAY1YBY2YCY3YDY4YNY^OY5Y6Y7Y8Y9Y:Y;YY7Y?Y8Y@Y9YAY:YBY;YCYY7Y?Y8Y@Y9YAY:YBY;YCY'3uX xAhhhhhhhhhh A _B1Y2Y3Y4Yhh  ~{xurlfedcba`_^]\[ZYXWVSROLIFC@=:741.+(%    ulTM' ~{xu~vqnkJE d '``  ` ` 1` Q` H S =s h` 1` Q`   `]DLU]"f*n3w;"*3;DLU]fnw000((((((((( @@@ @@@ @@@@@@ @``` @@@@ @@@ @```@``` @@@@@PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP(((((( /?O_o~|xp`@??~|xp`@~|xp`@~|xp`@????~|xp`@~|xp`@??"3DUfw"3DUfw*;L]n"Df*Ln3Uw;(,048<@@@@@@@@ (08@HPX`hpxpqrstuvwxyz{|}~/?O_o/?O_o~~~~~~~~acegikmoqsuwy{}?_?_?_?_||||}}}}~~~~CGKOSW[_cgkosw{????????xxyyzz{{||}}~~'/7?GOW_gow @߿ 0@P`p  @~}{wo_? @ @~}{wo_?~}{wo_?  0@P`p 0@P`p  @` @` @` @`  $"//HPXlrD\(8HGmz YcvLLLLXx  2Dн` QLI=. Q Δ Γ 2D` > L =s S & > L =r R L Δ Γ 2DШФ`I I ILH I Δ Γ 2Dок` H 0:Hj \hȰIIȱIIڢHj \h Δ Γ  h ` 2DLz D& 16 1 Δ Γ 2Dн` =.  Δ =  =  Δ Γ 2DЩХ`& "Q QLII = Q = Q Δ Γ 2DШФ` H ,6Hj hȰ ȭ ޢHj h Δ Γ  h ` 2DL 1  Δ Γ 2Dзг` QLI= Q Δ Γ 2D` \! 1 1  1  1 Δ Γ 2DЩХ`!    1 1` 01ȱ23012F3f2F2f1F1f0F00)` D 1 1 Δ Γ 2Dн` =  Δ Γ 2Dн` 1 Li JJJJ`)` 1 1`HH 01ȱ23012F3f2F2f1F1f0F0hh0)`B 1`)`JJJJ`B 1M `) B `J 1`q )+5JLB 1`)`JJJJ` 1` 1JJJJ`)`u L{hh`] Lv] ]" Lv]2 Lv]B ȱ]R Lvȱ]b Lvȱ]r ] Lvȱ] Lv{ B ` ` J 1` B Q`H R =r h`H R h`H =r h`H ]R h`` 1` 1 " L^2 L^B ȱR L^ȱb L^ȱr  L^ȱ L^cm~H H NO Lhh`= L= = L= L= ȱ= Lȱ= Lȱ= =" Lȱ=2 L &1CH H tۭ ` 1 1` Q Q`H H 67 Lhh` = L = " = L2 = LB = ȱR = Lȱb = Lȱr =  =" Lȱ =2 L(H H \] Lchh` L^((((((((((((((((((((((((((                        ~wtsmga^YSOLGA>9+*)('&   ~}|tqn implementation E nd; { of Record }   var CurFontHandle: Handle; (CurFont: FontRec; %  procedure Open_Font ( FileName: string; var FontHandle: handle ); procedure Close_Font ( FontHandle: handle ); procedure Select_Font ( FontHandle: handle ); procedure Raster_String ( TextString: string ); procedure Raster_Char ( Ch: char );  procedure Raster_LF ( Rows: real ); procedure R_TextExtent ( TextString: string; var Width, Height: integer); function R_Font_Version: real; ecord of font bitmap } +end; { of Record }   var CurFontHandle: Handle; (CurFont: FontRec; %  procedure Open_Font ( FileName: string; var FontHandle: handle ); procedure Close_Font ( FontHandle: handle ); procedure Select_Font ( FontHan { Current character location in bitmap } .CharBBWidth: MByte; { Current character bounding box width } /CharOffset: MByte; { Current character offset } 0CharWidth: MByte; { Current character printing width } 2FontMap: PixelMap;{ map descriptor r1OWHandle: handle; { points to address of offset/width table } 0LocHandle: handle; { points to address of location table } 4OWTab: XAddr; { address of offset/width table } 1Location: XAddr; { address of location table } + CharLoc: integer; 2DOffset: MByte; { offset of dummy character } 3DWidth: MByte; { printing width of dummy character } :'')PBBINTEGER xnCREAL g: integer; { number of lines to leave blank between Flines of text } .BitMapWidth: integer; { total bitmap width of font map } 0DLocation: integer; { location of dummy character in bitmap } 1DBBWidth: MByte; { bounding box width of dummy character }MByte; { maximum character printing width } 2FHeight: MByte; { height of all characters in font } 1BaseLine: MByte; 2Version: MByte; 1FontName: string[19]; 0MinOffset: integer; { minimum offset for pen } 3Ascent: MByte; 2Descent: MByte; 2Leadin (  Uses {$u *memory/mem.unit.code } Memory_Manager, ({$u *rcore/rcore.unit.code } Raster_Core;  type #FontRec= packed Record 1FontKind: MByte; { raster (0) or vector (1) } 2Spacing: MByte; { monospaced (0) or proportional (1) } 1MaxWidth:  !"""""""##$$$$$$%%%%%%%%%<96'Z[]]"^^_aab!`!@@.1.>Z[[v\*AAP(&-L+!"JZnZ,[^v^^]^<_~]?V@h__ `H` ORt$)OdP`,a`$F$vSR`E`\CDD,GHN^Q2TfTTTUU"WL]aaY&R r'hhhhHHaȱaȱaaaaɁ)LJaaa`OKGFC@! x'hhhghHH `g`&&&mlmmijk   Ȅ ` jdbID l a ^ Z W @ 6 3 2 ( # "  m S N K J 7 .       XZ  . y z 9 ] ifc`]WTPMIDA=::::::::10/.-,$!   z 3    W J 0 + ( '  } | o b _ ; 4 / , +   dle: handle ); procedure Raster_String ( TextString: string ); procedure Raster_Char ( Ch: char );  procedure Raster_LF ( Rows: real ); procedure R_TextExtent ( TextString: string; var Width, Height: integer); function R_Font_Version: real; / ڳڳp(@ڳ@@ڳ ڳڳ@ **ٻ+ػ+*/* / /L/npqrstuvwxyz1 O^e7$(B-( MBYTE -+6(#iPADDR *)GeXADDR (ntTWOBYTE z(z(EXTEND 6(d(SEGREC L+,)wiADDRESS (((LEN (((ID 6((RELOCATI6((ERRORRECL**)$!)1 ȱ"ȱ#8" "#!#`8 "!#`("  ~}|{xwvuts+> V v: 4  jd E~_\XSOJGB=hhh)hHH ` p$(%#4ȭ687`4 ȭ!6"8$7%`) % Y`.+*'$#xhhhhHHV W ,X ȱY ȱZ X Y Z Ɂ)LTX Y Z 0[ ȱ\ ȱ] [ \ ] Ɂ)L[ \ ] "^ ȱ_ $` a &b %c `hhhhhhHHȱȱVW PȑXȑ`U`\,+*!thhhhhhHH+ %ȑ`*` :hhhhhhhhhhHHȱȱZ[\]^ Tȑ`%Please hit carriage return to exit...R\&=/Aצצ9RasterFont version not compatible with RasterCore versionhhhhšM"$&"/+ \  á  b/&(ڪP/-.-.ȡ---ا(VD/? تP&&  /)/ /[-ˡ[/ &1/ / ١ZL// ˡ[ ا .تP/.&,&+0+0ȡ+š &++.,& 3^^/4// >/ 2>33ˡ3 K@/>@1// 14// >/ @>1/.<-8B[L&// hB -_.`a8c<@>1/Li0B:/ 2:033ˡ3 `ȡǘLȡVNצYYYLšP[LɡQ[\ɡR^]ɡSL^ɡT]ö^ÄU٪P,-.2B L1/D4,// ,/,6/ 6233ˡ3 C2ˡ23ö3˄ 3 ,ˡ,/ ˡ:ˡ/ .ˡ./ -ˡ-/ BˡB&1 |C4// // 233ˡ 3 J3KˡWKɲKōZLErrNegMxWidth= 88; { Maximum character width<= 0 } ErrFontName= 89; { Font name is null } ErrSpacing= 90; { Spacing is not mono or proportional } ErrNotFont= 91; { Handle not associated with a font } ErrFontChar= 92; { Ch} ErrDWidth= 84; { Dummy's printing width exceeds maximum width } ErrNoDummy= 85; { Dummy character does not exist } ErrFHeight= 86; { Font height<= 0 } ErrNotRaster= 87; { Font is not a raster font } 80; { Ascent+ Descent<> Font Height } ErrMaxWidth= 81; { Maximum character width exceeds strike width } ErrDOutside= 82; { Dummy character outside strike } ErrDBBWidth= 83; { Dummy's bounding box width exceeds printing width is not a screen mode } ErrVport= 47; { Viewport boundaries do not intersect the screen }  ErrNoPixelMap= 48; { Pixelmap memory segment not found }  ErrNegWidth= 49; { Width <=0 }  ErrNegHeight= 50; { Height <=0 } ErrAorD= ErrMapMode= 42; { MapMode is out of range } ErrNotLinear= 43; { Mask is not a linear bitmap } ErrNullHandle= 44; { PixelMap has a null handle } ErrBothNull= 45; { Pattern and Mask have null handles } ErrScrnMode= 46; { Modem bounds > top bounds } ErrNegRight= 38; { Right bounds < 0 } ErrBigRight= 39; { Right bounds >= MaxSize.h } ErrNegTop= 40; { Top bounds < 0 } ErrBigTop= 41; { Top bounds >= MaxSize.v } tices= 32; { NPoints < 0 } ErrNVertices= 33; { NVertices too large } ErrNegLeft= 34; { Left bounds < 0 } ErrBigLeft= 35; { Left bounds > right bounds } ErrNegBottom= 36; { Bottom bounds < 0 } ErrBigBottom= 37; { Botto seg size } ErrDstFill= 21; { Destin_Offset+ Fill_Len > Destination segment size }  ErrLenBytes= 22; { LenBytes <= 0 }   ErrRCoreInit= 30; { RasterCore not initialized } ErrArgument= 31; { Argument is out of range } ErrNoVerErrSrcNotFound= 17; { Source segment not found } ErrSrcSize= 18; { Source_Offset+ Transfer_Len > Source segment size } ErrDstNotFound= 19; { Destination segment not found } ErrDstSize= 20; { Destin_Offset+ Transfer_Len > Destination 13; { Pascal memory segment cannot be locked or unlocked } ErrSegNotFound= 14; { Memory segment not found } ErrSrcAddr= 15; { Illegal Source Address } ErrDstAddr= 16; { Illegal Destination Address } Best fit made ( Return_Len < Desir_Len ) } ErrNoMemory= 10; { Not enough memory available } ErrMMSegs= 11; { Memory_Manager segment table full } ErrOverlap= 12; { Requested seg overlaps previously allocated segment } ErrPasLock= full } ErrNoGraphics= 6; { No memory available for graphics } ErrNoInternal= 7; { No memory available for internal data structures } ErrReturnLess= 8; { Warning: Returned value(s) < requested value(s) } ErrBestFit= 9; { Warning: ErrMemNotOpen= 1; { Memory manager not open } ErrDynamic= 2; { Dynamic_Pages < 0 } ErrSegments= 3; { Segments < 0 } ErrNoDynamic= 4; { No memory available for dynamic pages } ErrSOSFull= 5; { SOS memory segment table aracter's bounding box exceeds strike bounds }   ErrGrafOut= 100; { GrafOut initialization error } ErrSurface= 101; { Bounds exceed display surface size }  ErrNullDevice= 102; { Null device name } ErrDHeap= 103; { No room on heap for device descriptor record } ErrNoDevice= 104; { Device not found }   ErrDimension= 150; { Dimension out of range } ErrNegCPoints= 151; { Number of control points < 0 }  ErrNegMajor= 152; { MajorAxis <= 0 }  ErrNegMinor= en 7ErrClass:= ErrSystem 5else 7ErrClass:= ErrOtherIO; #end; { of ErrClass } 80, 88] then /ErrClass:= ErrAccess ,else /if SOS_Error in [65, 66, 72, 73, 85] then 2ErrClass:= ErrOutOfRoom /else 2if SOS_Error in [39, 43, 48..63, 74, 76, 83, 90] then 5ErrClass:= ErrOtherIO 2else 4if SOS_Error in [32,33,34,67,75,77,79,86,89] thfunction ErrClass (SOS_Error: integer): integer; #begin { ErrClass } &if SOS_Error= 64 then )ErrClass:= ErrPathname &else )if SOS_Error in [16, 17, 35, 37, 46, 68, 69, 70, 81, 82, 87] then ,ErrClass:= ErrNoFile )else ,if SOS_Error in [38, 71, 78, {}~O^hhname } ErrNoFile= 201; { Device or file not found } ErrAccess= 202; { Access or Protection error } ErrOutOfRoom= 203; { Out of room } ErrOtherIO= 204; { Other I/O error }  ErrSystem= 205; { System error } ke= 183; { Not a stroke font } ErrNotOpen= 184; { Stroke font is not open }  ErrNoSelect= 185; { No font is selected } ErrPascalHeap= 186; { Warning: Buffer space allocated from Pascal heap }  ErrPathname= 200; { Illegal Pathr plane } ErrBadRatio= 163; { Ratio <= 0 }  ErrNegView= 164; { ViewDistance <=0 for perspective projection }  ErrStart= 180; { Start <= 0 } ErrCount= 181; { Count <= 0 } ErrBlockSize= 182; { BlockSize < 2 } ErrNotStro ErrNegNorm= 159; { NormLength <= 0 } ErrParallel= 160; { ViewNormal and ViewOrient vectors are parallel }  ErrHither= 161; { HitherPlane is at or behind the Yon plane }  ErrYon= 162; { YonPlane is at or in front of Hithe 153; { MinorAxis <= 0 }  ErrTransform= 154; { Illegal transform }  ErrNegParts= 155; { Parts <= 0 } ErrBigParts= 156; { Parts > MaxParts } ErrNegRadius= 157; { Radius <= 0 } ErrNumPnts= 158; { NumPnts > PointMax } O^hب Begin " "ClearLines ( 6, 19 ); "writeln( "'Handle Address (TwoByte, Extend) Len (in words) Id Relocation'); "nextseg:= Root_Handle; "Repeat " dumpinfo ( nextseg ); $nextseg:= Next_Handle; "Until nextseg= Null_Handle; "  End; Procedure tion: 1); end;  Procedure DumpSegs;  Var nextseg: handle;   procedure dumpinfo ( seg: handle ); begin "SegInfo ( seg, s_info); "if ErrorFlag then %writeln('Handle: ',seg,' not found.') "else ShowInfo ( seg, s_info ); end; 'Severity= ',Severity:3); "end;  end;  procedure ShowInfo ( SegName: handle; info: seg_rec ); begin $with s_info, Address do 'writeln( '': 2, SegName:2, 0'': 16, TwoByte: 5, ', ', Extend: 2, 0'': 5, Len: 8:1, 0'': 8, Id: 3, 0'': 7, Relocaor( Message: string ); var Error: error_rec;  begin "GetError ( Error ); "With Error do begin " writeln(Message); $writeln('Unit_Number= ',Unit_Number:3,' ', ,'Proc_Number= ',Proc_Number:3); $writeln('Err_Number= ',Err_Number:3,' ', $  function Yes: boolean; begin $Yes:= ch in ['y','Y'];  end;   Procedure ClearLines ( Top,Bottom: Integer ); Var i:Integer; "Begin " for i:= Bottom DownTo Top do &begin " gotoxy(0,i); (write(chr(30)); &end; "End;  procedure ShowErrfree space'); $write (' S(egInfo (get segment information) about allocated memory '); $writeln('segments');  writeln(' Q(uit');  writeln; $write('Press to continue...');  readln; $write ( chr(28) );  end;  a new memory segment'); $writeln(' R(elease (deallocate) an existing memory segment'); $writeln(' L(ock an existing memory segment'); $writeln(' U(nlock an existing memory segment'); $writeln(' C(runch (compact) the heap to maximize contiguous seg_rec; (  procedure Intro; begin $write ( chr(28) ); { Clear screen first } $writeln('This demo program exercises some of the functions provided'); $writeln('by the MemoryManager unit.'); $writeln; $writeln('You can:'); $writeln(' A(llocate  Program TestMem; uses AppleStuff, ({$u *lib/rastercore.lib} (MemoryManager;  var Ch: Char; (DesirLen: Real; (Id: Integer; (RetDynamic: Integer; (RetSegs: Integer; (ReturnLen: Real; (SegName: Handle; (s_info: CheckRel; var Err: Error_Record; Begin "ClearLines(20,23); "Alloc_Seg ( DesirLen, Id, ReturnLen, SegName ); "if ErrorFlag then Get_Error ( Err ); "If (not ErrorFlag) or ( Err.ErrNumber=9) then $begin &SegInfo ( SegName, s_info ); &if ErrorFlag then )writeln('Handle: ', SegName,' not found.') &else )begin ,write('Handle Address (TwoByte, Extend) '); ,writeln('Len (in words) Id Relocation'); ,ShowInfo ( SegName, s_info ); )end; { if } $end  else ShowError('Relocatable allocatio:This demo program exercises some of the functions providedby the MemoryManager unit.You can:! A(llocate a new memory segmentצ3 R(elease (deallocate) an@nLg TESTMEM Answer the following question ''y'' if you''re not sure...)'); #write('Do you want to close the Memory Manager? '); read(ch); #writeln; #if Yes then Close_Memory; End. then ShowError ('Open_Memory error: '); # #writeln('RetDynamic (in pages) = ',RetDynamic ); #writeln ('RetSegs= ',RetSegs ); #if (not Yes) then DumpSegs; #writeln; #write ('Please press to continue... '); #readln; # #GetTest; # #writeln ('(False;   End;  Begin " #Intro; # #writeln ('Answer the following question ''y'' if you''re not sure...'); #write('Is this a new MemoryManager open? '); #read(ch); #writeln; #Open_Memory ( Yes, 300, 100, RetDynamic, RetSegs ); #if Error_Flag $read(ch); $writeln; $if ch in ['a'..'z'] then ch:= chr(ord(ch)- 32); ' $case ch of ''A': TestRelSeg; ''R': TestReleas; ''L': TestLock; $ 'U': TestUnlock; ''C': TestCrunch; ''S': DumpSegs; ''Q': Exit ( GetTest ); 'end; { case } $  Until ') $else write ('Crunch is successful.');  end;   Procedure GetTest;  Begin " "write(chr(28)); { Clear the screen initially } " "Repeat $ $ClearLines ( 0,5); $write('A(llocate, R(elease, L(ock, U(nlock, C(runch, S(egInfo, or Q(uit? '); _Seg ( SegName ); "ClearLines ( 20,23 ); "if Error_Flag then ShowError('UnLock_Seg failure') "else write ('UnLock_Seg successful.'); end;  procedure TestCrunch; begin $Crunch; $ClearLines ( 20,23 );  if Error_Flag then ShowError ('Crunch error "Lock_Seg ( SegName ); "ClearLines ( 20,23 ); "if ErrorFlag then ShowError('Lock_Seg failure') "else write ('Lock_Seg successful.');  end; Procedure TestUnLock; begin "ClearLines ( 1,5 );  write ( 'Segment Handle? ');readln ( SegName ); "UnLock"ReleaseSeg ( SegName ); " "ClearLines ( 20,23 ); "if Error_Flag then ShowError('Release_Seg failure') "else write ('Release_Seg successful.');  End; Procedure TestLock; begin "ClearLines ( 1,5 );  write ( 'Segment Handle? ');readln ( SegName );n not successful');  End;   Procedure TestRelSeg; Begin "ClearLines ( 1,5); "write ( 'DesirLen=? '); readln(DesirLen); "id:=1; "CheckRel;  End;   Procedure TestRelease; Begin "ClearLines ( 1,5); "write ( 'SegName=? '); readln( SegName ); existing memory segment# L(ock an existing memory segmentצ% U(nlock an existing memory segment? C(runch (compact) the heap to maximize contiguous free spaceצ= S(egInfo (get segment information) about allocated memory segments Q(uitPress to continue... ġ5 O^hبLIBRARY FILES: *lib/rastercore.lib $$ 9(Answer the following question 'y' if you're not sure...)צ)Do you want to close the Memory Manager? // /!(. rHlL 6 צ"Is this a new MemoryManager open? ,d//Open_Memory error: צRetDynamic (in pages) =  צ RetSegs=  צ!Please press to continue... r Q(uit?   L H D @<82AU*& 4 .D6(B /7Answer the following question 'y' if you're not sure...צ"I //UnLock_Seg failure"UnLock_Seg successful. //צ Crunch error !Crunch is successful.LBA(llocate, R(elease, L(ock, U(nlock, C(runch, S(egInfo, o/ /Release_Seg failure#צRelease_Seg successful. Segment Handle?  //Lock_Seg failure Lock_Seg successful. Segment Handle?  Address (TwoByte, Extend) צLen (in words) Id Relocation *%Relocatable allocation not successful-   DesirLen=?  :  SegName=?  andle Address (TwoByte, Extend) Len (in words) Id Relocation/ / á | //// Í / /?Handle:   not found.hצ$Handle  צ צ,  צצ צ  إ / /?צHandle:  צ not found.إ ZCH ,تP+/צ Unit_Number= +   Proc_Number= + צ Err_Number= ,   Severity= , Vبצ&begin )TextOn; )writeln('Unable to save ScreenMap'); &end #else &begin )FillVPort; )LoadPixelMap(Filename, ScreenMap); )write( chr(7) ); )if ErrorFlag then ,begin /TextOn; /writeln('Unable to load ScreenMap'); ,end )else ,begin /readln; 'patchSize.h:= h div 2; 'patchSize.v:= v div 2; #end; #clearRect:= ScreenMap.bounds; #with patchSize do SizeRect ( clearRect, h, v ); #VPort ( clearRect ); #Filename:= '.d1/eye.pic'; #Save_PixelMap( ScreenMap, FileName); #if Error_Flag then f} # #GrafixMode ( Col140 ); #PenColor ( S_White ); #FillColor ( S_Black ); % #{Clear the entire graphics screen and turn it on} #Max_VPort; #Fill_VPort; #Grafix_On; % #LoadScreen ('/rcore.disk2/magritte.pic'); #with ScreenMap.MaxSize do begin -begin 1{ 1writeln('Ret_Dynamic= ',Ret_Dynamic ); 1writeln('Ret_Segs= ',Ret_Segs ); 1} -end; &end; {if} # #OpenRCore ( col140, 2 ); #if ErrorFlag then &begin )writeln('Unable to open RasterCore'); )CloseMemory; )Exit ( Program ); &end; {i$readln; $write ( chr(28) ); end; Begin {tmapio} # #Intro; #OpenMemory ( true, 256, 100, Ret_Dynamic, Ret_Segs ); #if ErrorFlag then &begin )if FatalError then -begin 1writeln('Unable to open Memory Manager'); 1Exit ( Program ); -end )elsets'); $writeln('to an ImageWriter dot matrix printer.'); $writeln; $writeln('Make sure that you have the volume /RCORE.DISK2 mounted'); $writeln('in a disk drive and another disk mounted in drive .D1,'); $write ('then press to continue...'); n('and restores it using the LoadPixelMap procedure.'); $writeln; $writeln('At this point the program will ''beep'', and you should '); $writeln('press to continue.'); $writeln; $writeln('Finally, you have the option of printing the screen conten(EYE.PIC)'); $writeln('on disk drive .D1 using the SavePixelMap procedure. You should'); $writeln('have at least 10 free blocks available on the volume in .D1.'); $writeln; $writeln('Then the program clears the saved portion of the screen,'); $writel$writeln('and PrintMap procedures.'); $writeln; $writeln('First it loads a screen image from Disk 2 of the Raster Graphics'); $writeln('Toolkit (/RCORE.DISK2/MAGRITTE.PIC)'); $writeln; $writeln('Next, it saves the center part of the screen to a file um: integer; var RetCode: integer); #external; # {$i PMapIO.text} {$i PrintMap.text} procedure Intro; begin $write ( chr(28) ); {Clear screen first} $writeln('This demo program demonstrates the SavePixelMap, LoadPixelMap,'); procedure SOS_XRead(InRefNum: integer; BufXAddr: xaddr; ByteCount: integer; 4var RetCode: integer); #external; 4 procedure SOS_XWrite(RefNum: integer; DataArea: XAddr; 5ByteCount: integer; var RetCode: integer); #external; ' procedure SOS_Close(RefN integer; {$i Err.Class.text} procedure SOS_Open ( Pathname: string; var SOSBufAddr: XAddr; 4var RefNum, RetCode: integer ); #external; # procedure SOS_Create(Pathname: string; var SOSBufAddr: XAddr; 4var RefNum, RetCode: integer); #external; program tmapio; Uses ({$u *lib/rastercore.lib} (MemoryManager, (RasterCore; Const ({$i toolkit.err.} - Var (ch: char; (clearRect: rect; (filename: string; (patchSize: point; (Ret_Dynamic: integer; (Ret_Segs: /TextOn; /write('Print the screen on your dot matrix printer? '); /read (ch ); /if (ch in ['y','Y']) then begin 3GrafixOn; 3MaxVPort; 3PrintMap(ScreenMap, 10, 5, 1); /end; {if} ,end; {if} &end; {if} & #CloseRCore; #CloseMemory; End. {of tmapio} &-á,ɡ" š# ɡ& š' ɡ$  š% ɡ( š)jDB //  / áצ.Printerˡ K K n 0 ˡ D nɡ2 &#%&!š6!5/;+++;3ˡ K K ˡ  !ˡ!/ "ˡ"&1 ˡ / R&<ˡخdݨ٢ ڏ G٢ G F G  |á\K K FġK3A3;&/ `/a4//ˡ/D&1,/ b&<p P PQQP/< ڶ$خ ˡÄ/ ,5/ 54//ˡ/CO9-// -7/ 47//ˡ/M5/75&/-/ Mצ V1.0 PixelMap0^á0001\1..22YšY2DX2^&// D7/ ;ب YA?ɡ ?Ya`/<b&<ˡخ ?2AA3š3A472.//ˡ/LöA3Ä/ />?& D&#rض2ض3š &٪P/b&;DO9,/K٨ KPNLQOMNNO&-RR/R/S/.P.--18L1R&// 84/ 8&/ U/V A2/02TTˡT 0TTˡT 8&1,/ W&<H` `a 1ġ&#041-TTˡ T T ;<&   ض1š6 تP/W&;&&&&DO6,// ,2/ 20TTˡT Aצ V1.0 PixelMap@áڳp(@mڳ@@Sڳ 9ڳڳ@U UVVU/< W&<ˡخ ccgTMAPIO ˡ K K TK 1K 6ˡ K K >ˡ šHK  š7 š زˡ ؕAT R    á55K K g33ȡ633ȡ/33ġK 0 @B!// !3/ 35/"&// ""&`> p,"LGETROW RB5&X hB~BhBY ~BNPIXELS BBSCANROW LSETCOLUMB6&X BBBY BNPIXELS CC[`.+*'$#zhhhhhhhhhhHHȱȱ`a j r Zȑbȑ`_`fo`w`}RQPOJA83,&"  6 R:X x>lHH+ %ȑ`*` :hhhhhhhhhhHHȱȱ \]^_` Vȑ`[`,)(%"!xhhhhhhhhhhHHȱȱ \]^_` Vȑ`   Ɂ) L   LL @#^2M'$ RhhhhhhhhhhHHȱȱVW PȑXȑ`U`\,+*!thhhhhh`8Ɂ)L8Ɂ)LA`     (  LFf     Ɂ) L Z  `ȩ`6hhhhHH ve e iɁ)LC B ȥȭȥȭ`ȱȱȱȱȱȱȱȱȱȱȱȱȱȱ ȩ Ȣ(' /1&צUnable to load ScreenMaps&-Print the screen on your dot matrix printer? && ' &/&'/ /'&"d",hhhhhhHH&/4צUnable to open RasterCore/&&& & &&צ/rcore.disk2/magritte.pic&9'1'2'12&.& צ .d1/eye.picP'/1&צUnable to save ScreenMap&ume /RCORE.DISK2 mounted6in a disk drive and another disk mounted in drive .D1,then press to continue..."/&"d34//>/7Unable to open Memory Manageru should צpress to continue.This demo program demonstrates the SavePixelMap, LoadPixelMap,and PrintMap procedures.@First it loads a screen image from Disk 2 of the Raster Graphics#Toolk/ #1(%1+-('1.0"&& 2 2 33ȡ /7)1Rf    !"  K/R&; H!ۨ !ȍSCANCOLULGETCOLUMJC7&X `CvC`CY vCNPIXELS CCSCANCOLULSAVESCRE:DC8&FILENAME0LOADSCREtDD9&FILENAMELIBRARY FILES: *lib/rastercore.lib $$ # procedure SaveBounds; #var &SrcRow (: integer; &WorkSrc (: PixelMap; ' #procedure PatternBuffer; &begin { PatternBuffer } & ){ Set vertical bounds of map } )with WorkSrc, Bounds do ,begin /BotLeft.v:= SrcRow; /TopRight.v:= SrcRow+ NumRows-everity:= Fatal; )end; { with } &Set_Error(Err); #end; { of Set_Err } # procedure GetOut(ErrCode: integer); #begin { GetOut } &Load_RState(CurGrafState); &if ErrCode<> 0 then )Set_Err(Err_Proc, ErrCode); &exit(SavePixelMap); #end; { of GetOut } } &Result ): integer; ( &Err ): error_rec; + &CurGrafState ): rcorestate; ( # procedure Set_Err(Err_Proc, ErrCode: integer); #begin { Set_Err } &with Err do )begin ,Unit_Number:= Err_Unit; ,Proc_Number:= Err_Proc; ,Err_Number:= ErrCode; ,Sandle; &NumRows, &OutRefNum, &PixelSize, &PixelsPerByte, &RowLength (: integer; &BufXAddr, &WorkXAddr (: XAddr; &Return_Len (: real; &BufMap (: PixelMap; &FileHeader (: Record -Signature: string[19]; -Map: PixelMap; *end; { of FileHeader procedure Save_PixelMap ( var SrcMap: PixelMap; FileName: string ); #const & &Err_Proc= 1; & &BlockLength= 512; &MinBufLength= 512; &PixMapID= 79; # &Err_Unit= 10; { or some other number outside the ToolKit range } & #var &SOSBufHandle (: h1 yO^h%ltmapio print.asm sos.asm tmapio %%%% 1; /if TopRight.v>= MaxSize.v then 2TopRight.v:= MaxSize.v- 1; ,end; { with } ) )PatternRect (WorkSrc); ) )SOS_XWrite(OutRefNum, BufXAddr, NumRows* RowLength, Result); )if Result<> 0 then GetOut( ErrClass (Result)); &end; { of PatternBuffer } $ #begin { SaveBounds } &with BufMap.Bounds.BotLeft do )MoveTo(h, v); &with SrcMap.Bounds do )begin ,SrcRow:= BotLeft.v; ,WorkSrc:= SrcMap; ,Repeat /PatternBuffer; /SrcRow:= SrcRow+ NumRows; ,Until SrcRow> TopRight.v; )end; { if } #end; { of Sav/if TopRight.v> LastDstRow then 2TopRight.v:= LastDstRow; ,end; { with } & ){ Read the next group of rows } )SOS_XRead(InRefNum, BufXAddr, NumRows* RowLength, Result); )if Result<> 0 then ,if (Result= ErrEOF) and (WorkDst.Bounds.TopRight.v= LastDst LoadBounds; #var &DstRow (: integer; & #procedure PatternBuffer; &begin { PatternBuffer } ) ){ Set vertical bounds of map } )with WorkDst.Bounds do ,begin /BotLeft.v:= DstRow; /TopRight.v:= DstRow+ NumRows- 1; atal; )end; { with } &Set_Error(Err); #end; { of Set_Err } # procedure GetOut(ErrCode: integer); #begin { GetOut } &Load_RState(CurGrafState); &if ErrCode<> 0 then )Set_Err(Err_Proc, ErrCode); &exit(LoadPixelMap); #end; { of GetOut } # procedure of FileHeader } %Err (: error_rec; * %CurGrafState (: rcorestate; ( procedure Set_Err(Err_Proc, ErrCode: integer); #begin { Set_Err } &with Err do )begin ,Unit_Number:= Err_Unit; ,Proc_Number:= Err_Proc; ,Err_Number:= ErrCode; ,Severity:= F%LastDstRow, %NumRows, %PixelsPerByte, %PixelSize, %Result, %RowLength ': integer; %BufXAddr, %WorkXAddr ': XAddr; %Return_Len ': Real; %BufMap, %WorkDst ': PixelMap; %FileHeader ': Record ,Signature: string[19]; ,Map: PixelMap; )end; {ckLength= 512; %MinBufLength= 512; %PixMapID= 79; " %Err_Unit= 10; { or some other number outside the ToolKit range } % %Err_Proc= 2; %ErrEOF= 76; { SOS end of file error } " "var %BufHandle, %SOSBufHandle ': Handle; %InRefNum, Out ( ErrClass (Result) ); # #Release_Map(BufMap); #Release_Seg(SOSBufHandle); # #{ Restore Graphics state } #Load_RState(CurGrafState); end; { of SavePixelMap } procedure Load_PixelMap ( FileName: string; var DstMap: PixelMap ); "const % %Bloile header } #Get_XAddr(FileHeader, WorkXAddr); #SOS_XWrite(OutRefNum, WorkXAddr, BlockLength, Result); #if Result<> 0 then GetOut ( ErrClass(Result) ); # #{ write out the map } #SaveBounds; # #SOS_Close(OutRefNum, Result); #if Result<> 0 then Get,GetOut(ErrNoMemory); &end; { with } #Handle_XAddr(BufMap.MapPntr, BufXAddr); # #{ Initialize for drawing into buffer } #CurrentMap(BufMap); #if Error_Flag then &begin )Get_Error(Err); )GetOut(Err.Err_Number); &end; { if } & #{ write out the f){ Allocate buffer as a map } )PixelsPerByte:= 8 div PixelSize; )RowLength:= Bounds.TopRight.h div PixelsPerByte+ 1; )NumRows:= (MinBufLength- 1) div RowLength+ 1; )Alloc_XMap(BufMap, MaxSize.h, NumRows, MapMode); )if Error_Flag then + 1; ,end; { with } )with Bounds.BotLeft do OffsetRect ( Bounds, -h, -v ); )if MapMode in [BW280, BW560, Bitmap] then ,begin /MapMode:= BitMap; /PixelSize:= 1; ,end )else ,begin /MapMode:= NibbleMap; /PixelSize:= 4; ,end; { if } )MapPage:= 1; #{Initialize the file header} #FileHeader.Signature:= 'V1.0 PixelMap'; #FileHeader.Map:= SrcMap; #with FileHeader.Map do &begin )MapPntr:= NullHandle; )with Bounds do ,begin /MaxSize.h:= TopRight.h- BotLeft.h+ 1; /MaxSize.v:= TopRight.v- BotLeft.v#Alloc_Seg(512.0, PixMapID, Return_Len, SOSBufHandle); #if Error_Flag then &GetOut(ErrNoMemory) #else &Handle_XAddr(SOSBufHandle, WorkXAddr); #SOS_Create(Filename, WorkXAddr, OutRefNum, Result); #if Result<> 0 then GetOut ( ErrClass (Result) ); & eBounds } & begin { SavePixelMap } # #Clear_Error; # #{ Save current graphics state } #SaveRState(CurGrafState); # #PenColor(SWhite); #PenMode(Store); #MaskSelect(1); # #{ Create the output file } Row) then /Result:= 0 ,else GetOut ( ErrClass (Result) ); ) )with WorkDst.Bounds.BotLeft do ,MoveTo(h, v); )PatternRect(BufMap); & &end; { of PatternBuffer } #begin { LoadBounds } &with DstMap.Bounds do )begin ,DstRow:= BotLeft.v; ,Repeat /PatternBuffer; /DstRow:= DstRow+ NumRows; ,Until DstRow> LastDstRow; )end; { with } #end; { of LoadBounds } # begin { LoadPixelMap } # #Clear_Error; # #{ Save current graphics state } #SaveRState(CurGrafState); % #{ Open the map file } #Alloc_S1 5 O^بBufHandle); # #Load_RState(CurGrafState); end; { of LoadPixelMap } ); #if Error_Flag then &begin )Get_Error(Err); )GetOut(Err.Err_Number); &end; { if } ( #{ read in the map } #LoadBounds; # #SOS_Close(InRefNum, Result); #if Result<> 0 then GetOut ( ErrClass(Result) ); # #Release_Map(BufMap); #Release_Seg(SOS#{ Initialize for drawing into WorkDst } #WorkDst:= DstMap; #with WorkDst.Bounds do &if FileHeader.Map.MaxSize.v< TopRight.v- BotLeft.v+ 1 then )LastDstRow:= BotLeft.v+ FileHeader.Map.MaxSize.v- 1 &else )LastDstRow:= TopRight.v; #CurrentMap(WorkDstowLength+ 1; )if NumRows> MaxSize.v then ,NumRows:= MaxSize.v; )Alloc_XMap(BufMap, MaxSize.h, NumRows, MapMode); )if Error_Flag then ,GetOut(ErrNoMemory); ) &end; { with } #Handle_XAddr(BufMap.MapPntr, BufXAddr); % # #with FileHeader.Map do &begin ){ Allocate buffer as a map } )if MapMode= BitMap then ,PixelSize:= 1 )else ,PixelSize:= 4; )PixelsPerByte:= 8 div PixelSize; )RowLength:= Bounds.TopRight.h div PixelsPerByte+ 1; )NumRows:= (MinBufLength- 1) div RrClass (Result) ); # #{ Retrieve the signature from the buffer } #Get_XAddr(FileHeader, WorkXAddr); #GenCopy(BufXAddr, WorkXAddr, SizeOf(FileHeader)); #Release_Seg(BufHandle); #if FileHeader.Signature<> 'V1.0 PixelMap' then &GetOut(ErrNoPixelMap); #{ read in the first block } #Alloc_Seg(256.0, PixMapID, Return_Len, BufHandle); #if Error_Flag then &GetOut(ErrNoMemory) #else &Handle_XAddr(BufHandle, BufXAddr); #SOS_XRead(InRefNum, BufXAddr, BlockLength, Result); #if Result<> 0 then GetOut ( Ereg(512.0, PixMapID, Return_Len, SOSBufHandle); #if Error_Flag then &GetOut(ErrNoMemory); #Handle_XAddr(SOSBufHandle, WorkXAddr); #SOS_Open(Filename, WorkXAddr, InRefNum, Result); #if Result<> 0 then GetOut ( ErrClass (Result) ); # procedure PwrOfTwo(Power: integer; var Value: integer); #external; #  procedure FillBand(var BandData{: BandRec}); #external; #  procedure PrintMap(Map: pixelMap; dh, dv, PrinterNumber: integer); "const %BandID= 66; { Ascii 'B' } " Err_ite(OutRefNum, CommandXAddr, 6, Result); ) if Result<> 0 then ExitPrint ( ErrClass(Result) ); )end; { if } #end; { of Indent } $ procedure NextBand; #var &BitNumber, &Value (: integer; #Begin { NextBand } * &with BandData do )begin ) ,if Ro&if PrinterNumber= 1 then )begin ,CommandBuffer[0]:= ESC; ,CommandBuffer[1]:= 'F'; ,for ByteNumber:= 5 downto 2 do /begin 2CommandBuffer[ByteNumber]:= 5chr(ord('0')+ (IndentCount mod 10)); 2IndentCount:= IndentCount div 10; /end; { for } ,SOS_XWr)RealAddr:= RealAddr- 65536.0; &PixelByte.TwoByte:= Trunc(RealAddr); &BitNumber:= HPixel mod PixelsPerByte; #end; { of PixelAddr } . procedure Indent(IndentCount: integer); #{ $This procedure contains printer-dependent code. #} #begin { Indent } &RealAddr:= MapXAddr.TwoByte 4+(VPixel* RowLength)+ (HPixel div PixelsPerByte); &if RealAddr> 65535.0 then )begin ,PixelByte.Extend:= PixelByte.Extend+ 1; ,RealAddr:= RealAddr- 32768.0; )end; { if } &if RealAddr> 32767.0 then &exit(PrintMap); #end; { of ExitPrint } ' procedure PixelAddr(MapXAddr: XAddr; VPixel, HPixel, RowLength: integer; 4var PixelByte: XAddr; var BitNumber: integer); #var &RealAddr (: real; #begin { PixelAddr } &PixelByte.Extend:= MapXAddr.Extend;  &if Band<> NullHandle then )Release_Seg(Band); &if BandMap.MapPntr<> NullHandle then )Release_Map(BandMap); &if SOSBufHandle<> NullHandle then )Release_Seg(SOSBufHandle); & &LoadRState(CurGrafState); & &if ErrCode<> 0 then )PrintError(ErrCode);&Set_Err( Err_Proc, ErrCode); #end;  procedure ExitPrint(ErrCode: integer); #begin { ExitPrint } &if OutRefNum<> 0 then )begin ,SOS_Close(OutRefNum, Result); & if (Result<> 0) and (ErrCode= 0) then ErrCode:= ErrClass ( Result ); )end; { if }; # #begin { Gr_ESC_Typed } &if Gr_KeyPress then )begin ,Read(tmpchar); ,Gr_ESC_Typed:= (tmpchar= ESC); )end &else )Gr_ESC_Typed:= false; #end; { of Gr_ESC_Typed } procedure PrintError ( ErrCode: integer ); #begin Gr_KeyPress: Boolean; #var &CharCount (: integer; #begin { Gr_KeyPress } &CharCount:= 0; &UnitStatus(1, CharCount, 21); &Gr_KeyPress:= CharCount<> 0; #end; { of Gr_KeyPress } ) function Gr_ESC_Typed: Boolean; # #var tmpchar: chardure Set_Err(Err_Proc, ErrCode: integer); #begin { Set_Err } &with Err do )begin ) Unit_Number:= Err_Unit; ,Proc_Number:= Err_Proc; ,Err_Number:= ErrCode; ) Severity:= Fatal; )end; { with } # Set_Error(Err); #end; { of Set_Err } # function%BandData (: BandRec; % %CommandBuffer (: Packed Array[0..9] of Char; * *{ The First CommandLength bytes of Band contain the Printer /command } *{ Remaining bytes are the data } % %Err (: error_rec; * %CurGrafState (: rcorestate; (  proceandLength, { Printer-dependent } %ByteNumber, %DataBytes, %Result, %OutRefNum, %RowsLeft (: Integer; % %CommandXAddr, %MapXAddr, %SOSBufAddr (: XAddr; % %Band, %SOSBufHandle (: Handle; % %BandMap (: PixelMap; ( %HoldBandData, ger; 4LastRow: MByte; 4BandXAddr: XAddr; 4CommandLength: integer; 4InitBit: packed array[0..7] of BitSwitch; 4Mask: packed array[0..7] of MByte; 1end; - "var %CR, %ESC, %LF, %NULL, %space (: char; ( %BandDepth, { Printer-dependent } %BProc= 3; %PixelsPerByte= 8; %Err_Unit= 10; { or some other number outside the ToolKit range } ( " type % (BitSwitch= (Off, On); - (BandRec= Record 4MapLftAddr: XAddr; 4MapLftBit: MByte; 4MapRgtAddr: XAddr; 4MapRgtBit: MByte; 4RowLength: intewsLeft< BandDepth then /begin 2LastRow:= RowsLeft- 1; , Map.Bounds.BotLeft.v:= 0; /end; { if } ,PatternRect(Map); ,InvertRect ( BandMap.Bounds ); , ,if dh> 0 then /Indent(dh); # ,Value:= 0; ,moveleft(InitBit, Value, 1); ,Seg_FillByte(Band, CommandLength, DataBytes, Value); , ,HoldBandData:= BandData; ,FillBand ( BandData ); ,BandData:= HoldBandData; ,SOS_XWrite(OutRefNum, BandXAddr, BandLength, Result); ) if Result<> 0 then ExitPrint ( ErrClass(Result) ); ) ,Co'; 2 2{ Assign InitBit[0..7] here } 2for BitNumber:= 0 to 7 do 5InitBit[BitNumber]:= Off; 5 2{ Assign RowBit[0..7] here } 2for BitNumber:= 0 to 7 do 5RowBit[BitNumber]:= BitNumber; ) 2{for enhanced bit-image graphics} 2for ByteNumber:= 4 downto a do )begin ,if PrinterNumber=1 then /begin 2BandDepth:= 8; 2 2{for enhanced graphics thruput} 2CommandLength:= 5; 2DataLength:= (DataBytes- 1) div 8+ 1; 2BandLength:= CommandLength+ DataLength* 8; 2CommandBuffer[0]:= ESC; 2CommandBuffer[1]:= 'g#{ This section contains printer-dependent code. } # #Var BitNumber, .DataLength, .MaskValue: integer; .Return_Len: real; .tmpstrg: string; .RowBit: packed array[0..7] of MByte; #Begin { InitBand } & &with BandDat)begin ,DataBytes:= TopRight.h- BotLeft.h+ 1; ,RowsLeft:= TopRight.v- BotLeft.v+ 1; )end; { if } #end; { of InitMap } & procedure InitBand; #{ Initialize banding parameters for the specified printer } # ExitPrint ( ErrClass(Result) ); , 2dv:= dv- LFCount; /end; { while } # end; { if } # #end; { of SetUpPrinter }  procedure InitMap; #{ $Initialize banding parameters involving the map. #} #begin { InitMap } &with BandData, Map, Bounds do  )end; { if } ) &if dv> 0 then )begin ,FillChar(CommandBuffer, SizeOf(CommandBuffer), LF); ,while dv> 0 do /begin 2if dv> 10 then 5LFCount:= 10 2else 5LFCount:= dv; 2 2SOS_XWrite(OutRefNum, CommandXAddr, LFCount, Result); 2if Result<> 0 then ) if Result<> 0 then ExitPrint ( ErrClass(Result) ); , ,{ Set up unidirectional printing } ,CommandBuffer[0]:= ESC; ,CommandBuffer[1]:= '>'; ,SOS_XWrite(OutRefNum, CommandXAddr, 2, Result); ) if Result<> 0 then ExitPrint ( ErrClass(Result) ); ,tPrint ( ErrClass(Result) ); , ,{ Set up 16/144 inch Line Feed } ,CommandBuffer[0]:= ESC; ,CommandBuffer[1]:= 'T'; ,CommandBuffer[2]:= '1'; ,CommandBuffer[3]:= '6'; ,SOS_XWrite(OutRefNum, CommandXAddr, 4, Result); nter', SOS_BufAddr, OutRefNum, Result); ) if Result<> 0 then ExitPrint ( ErrClass(Result) ); , ,{ Set up 9 cpi printing } ,CommandBuffer[0]:= ESC; ,CommandBuffer[1]:= 'n'; ,SOS_XWrite(OutRefNum, CommandXAddr, 2, Result); ) if Result<> 0 then Exiteger; # Return_Len (: real; #begin { SetUpPrinter } & &Alloc_Seg( 512.0, BandID, Return_Len, SOSBufHandle); &if Error_Flag then )ExitPrint(ErrNoMemory); &Handle_XAddr(SOSBufHandle, SOSBufAddr); &if PrinterNumber= 1 then )begin ,SOS_Open('.Pri) if TopRight.v< 0 then /ExitPrint(ErrNegTop); ,if TopRight.v> MaxSize.v then /ExitPrint(ErrBigTop); )end; { with } #end; { of VerifyMap } #  procedure SetUpPrinter; #{ 'This procedure contains printer-dependent code. #} #var &LFCount (: inrrBigLeft); # if TopRight.h< 0 then /ExitPrint(ErrNegRight); ) if TopRight.h> MaxSize.v then /ExitPrint(ErrBigRight); ,if BotLeft.v< 0 then /ExitPrint(ErrNegBottom); ,if BotLeft.v> TopRight.v then /ExitPrint(ErrBigBottom); #End; { of NextBand } $ procedure VerifyMap; #begin { VerifyMap } # with Map, Bounds do )begin ,if Map.MapPntr= NullHandle then /ExitPrint(ErrNullHandle); ,if BotLeft.h< 0 then /ExitPrint(ErrNegLeft); ,if BotLeft.h> TopRight.h then /ExitPrint(EmmandBuffer[0]:= CR; ,CommandBuffer[1]:= LF; ,SOS_XWrite(OutRefNum, CommandXAddr, 2, Result); ) if Result<> 0 then ExitPrint ( ErrClass(Result) ); - ,RowsLeft:= RowsLeft- BandDepth; ) OffsetRect(Map.Bounds, 0, -BandDepth); ) )end; { with } # 2 do 5begin 8CommandBuffer[ByteNumber]:= ;chr(ord('0')+ (DataLength mod 10)); 8DataLength:= DataLength div 10; 5end; { for } / /end; { if } , ,{ patched below for length in words } ,Alloc_Seg(BandLength/2.0, BandID, Return_Len, Band); ,if Error_Flag then /ExitPrint(ErrNoMemory); ,Handle_XAddr(Band, BandXAddr); ,Gen_Copy(CommandXAddr, BandXAddr, CommandLength); 2 ,Alloc_XMap(BandMap, DataBytes, BandDepth, BitMap); ,if Error_Flag then /ExitPrint(ErrNoMemory); ,with BandMap, Bound; File: Print.Asm.text ; Contents: Support routines for Printer banding ; Last Modified on: 2/15/83 by Charlie Eckhaus ; (.include macros.text ( (.macro pullret (pla (tax (pla (tay (.endm (.macro pushret (tya (pha (txa (pha (.endm ( ;-----*O^hhState(CurGrafState); & &VerifyMap; &SetUpPrinter; &InitMap; &InitBand; ( #end; { of InitPrint } # begin { PrintMap } # #InitPrint; # #Repeat &NextBand; #Until Gr_ESC_Typed or (RowsLeft<= 0); #ExitPrint(0); end; { of PrintMap } &CR:= chr(13); &ESC:= chr(27); &LF:= chr(10); &NULL:= chr(0); &space:= chr(32); &OutRefNum:= 0; &Band:= NullHandle; &fillchar(BandMap, sizeof(BandMap), NullHandle); &SOSBufHandle:= NullHandle; &Get_x_addr(CommandBuffer, CommandXAddr); & &SaveRRowBit[BitNumber], MaskValue); 2Mask[BitNumber]:= MaskValue; /end; { if } ) )end; { with } ) #end; { of InitBand } procedure InitPrint; #{ %Initialize map printing. #} #begin { InitPrint } & &{ Needs to go in init somewhere } gtBit); . end; { with } ,CurrentMap(BandMap); ,MoveTo(0, 0); , ,LastRow:= BandDepth- 1; ,Map.Bounds.BotLeft.v:= Map.Bounds.TopRight.v- LastRow; , ,{ Convert RowBit[0..7] to corresponding mask values } ,for BitNumber:= 0 to 7 do /begin 2PwrOfTwo(s do /begin 2Handle_XAddr(MapPntr, MapXAddr); 2RowLength:= (MaxSize.h- 1) div PixelsPerByte+ 1; 2PixelAddr(MapXAddr, TopRight.v, BotLeft.h, RowLength, >MapLftAddr, MapLftBit); 2PixelAddr(MapXAddr, TopRight.v, TopRight.h, RowLength, >MapRgtAddr, MapR & MapLftAddr .equ 00 MapRgtAddr .equ 02 RowLength .equ 04 BandSave .equ 06 MapAddr .equ 08 BandXAddr .equ 0a CommandLength .equ 0c MapLftBit .equ 0e MapRgtBit .equ 0f MapBit .equ 10 MapEnd .equ 11 MapByte .equ 12 RowMask .equ 13 Shift1Bits .equ 14 InitBit .equ 15 LastRow .equ 16 MapRow .equ 17 Work2Addr .equ 0e0 *.proc PwrOfTwo,2NextByte incXAddr MapAddr ; Increment MapAddr )lda @MapAddr,y ; Load MapByte:= byte at MapAddr )sta MapByte )sty MapBit ; Set MapBit to 0 )cpxXAddr MapAddr,MapRgtAddr; If MapAddr= MapRgtp incXAddr BandXAddr (ldx MapBit ; If MapBit= MapEnd then (cpx MapEnd (bne IncMap (cpxXAddr MapAddr,MapRgtAddr ; if MapAddr= MapRgtAddr then (bne NextByte ( (rts ; exit(CopyRow) ; Repeat (ror MapByte ; Get next significant bit (bcc TestMap ; If Carry set then ( (lda @BandXAddr,y ; set appropriate bit at BandXAddr (ora RowMask (sta @BandXAddr,y ( TestMaMapRgtBit ; MapEnd:= MapRgtBit (stx MapEnd (jmp Shift D; else SetMap7 ldx #7 ; MapEnd:= 7; (stx MapEnd ( Shift ShiftRighty MapByte,MapBit ; ShiftRighty MapByte MapBit times & CopyRow GetMask lda MaskByte,x ; the entire row (sta RowMask ( (lda @MapAddr,y ; Load MapByte:= byte at MapAddr (sta MapByte ( (cpxXAddr MapAddr,MapRgtAddr ; If MapAddr= MapRgtAddr then (bne SetMap7 ; (ldx t MapBit to MapLftBit (setaXAddr MapLftAddr,MapAddr; Set MapAddr to MapLftAddr (setaXAddr BandSave,BandXAddr; Set BandXAddr to BandSave ( (ldx MapRow ; Set RowMask to appropriate mask for ts ;----- DownRow sbcXAddr MapLftAddr,RowLength,MapLftAddr D; MapLftAddr:= MapLftAddr+ RowLength *sbcXAddr MapRgtAddr,RowLength,MapRgtAddr D; MapRgtAddr:= MapRgtAddr+ RowLength *rts * ;----- l2r ldx MapLftBit (stx MapBit ; Seve * *lda @Work2Addr,y *sta CommandLength *iny *iny *lda #0 *sta CommandLength+1 * *lda @Work2Addr,y *sta InitBit *iny *iny @ *ldx #0 ; move Masks $1 lda @Work2Addr,y *sta MaskByte,x *iny *inx *cpx #8 *bne $1 * *rLoadParms ldy #0 *MoveAddr MapLftAddr * *lda @Work2Addr,y *sta MapLftBit *iny *iny * *MoveAddr MapRgtAddr * *lda @Work2Addr,y *sta MapRgtBit *iny *iny * *MoveWord RowLength * *lda @Work2Addr,y *sta LastRow *iny *iny * *MoveAddr BandSainy *lda MapLftAddr+1 *sta @Work2Addr,y *iny *lda MapLftAddr+1601 *sta @Work2Addr,y * *ldy #6 *lda MapRgtAddr *sta @Work2Addr,y *iny *lda MapRgtAddr+1 *sta @Work2Addr,y *iny *lda MapRgtAddr+1601 *sta @Work2Addr,y * *rts * ;----- astRow ; If MapRow= LastRow then *beq $1 ; exit & *inc MapRow *bne l2rt2b ; Until exit taken $1 ldy #0 ; update Pascal state record *lda MapLftAddr *sta @Work2Addr,y *ow to 0 * *adcXAddr BandSave,CommandLength,BandSave D; start filling the band D; at Band[CommandLength] * l2rt2b ; Repeat *jsr l2r ; traverse left-to-right Down1Row jsr DownRow *ldx MapRow *cpx L*sta @ValueAddr,y *iny *lda #0 *sta @ValueAddr,y * *rts * ;-----* *.proc FillBand,1 *;procedure FillBand(var BandData: BandRec); *; *pullret * *pop16 Work2Addr * *pushret # *jsr LoadParms # *ldy #0 *sty MapRow ; set MapR *;procedure PwrOfTwo(Power: integer; var Value: integer) *; Power .equ 0e0 ValueAddr .equ 0e2 Value .equ 0e4 *pullret * *pop16 ValueAddr *pop16 Power * *pushret * *lda #1 *sta Value *ShiftLefty Value,Power * *ldy #0 *lda Value Addr then )bne $1 )ldx MapRgtBit ; MapEnd:= MapRgtBit )stx MapEnd $1 jmp CopyRow D; else IncMap inc MapBit ; Increment MapBit ) )jmp CopyRow ; Until exit taken & ;----- MaskByte .byte 01 ; (initialized for Apple DMP) *.byte 02 *.byte 04 *.byte 08 *.byte 10 *.byte 20 *.byte 40 *.byte 80 * *.end O^hhPWROFTWO PWROFTWOFILLBAND FILLBAND Z  `   Ɂ) L   LL @#^2M'$ RZȱ ȩ Ȣ(`8Ɂ)L8Ɂ)LA`     (  LFf     Ɂ) L hhhhhhHHȩ`6hhhhHH ve e iɁ)LC B ȥȭȥȭ`ȱȱȱȱȱȱȱȱȱȱȱȱȱA3/1.1N7:6R PWROFTWO ByteCount .equ 0e8 RetCode .equ 0e6 BufAdr .equ 00 ExtByte .equ 1601 * *pullret * *pop16 RetCode *pop16 ByteCount *pop16 DataArea *pop16 RefNum * *pushret * *ldy #0 *lda @DataArea,y ; store DataArea at BufoseRef .byte ; RefNum 0 ;-----* *.proc SOS_XWrite,4 *;procedure SOS_XWrite(RefNum: integer; DataArea: XAddr; *; ByteCount: integer; var RetCode: integer); * RefNum .equ 0ec DataArea .equ 0ea m * *jsr Close *sta @RetCode,y ; set low-order byte of Return code *tya *iny *sta @RetCode,y ; clear high-order byte *rts ;-----* Close brk *.byte 0CC *.word ClosePrm *rts * ClosePrm .byte 1 ; 4 parameters Cl-* *.proc SOS_Close,2 *;procedure SOS_Close(RefNum: integer; var RetCode: integer); * RefNum .equ 0ec RetCode .equ 0ea * *pullret *pop16 RetCode *pop16 RefNum *pushret * *ldy #0 *lda RefNum *sta CloseRef ; supply RefNuOptionList .word OpList ; Option List ptr ListLength .byte 4 ; Option List length 0 OpList .byte 0 ; access is default +.byte 4 ; 4-page file buffer +.word ZPSOS_BufAddr; pointer to file buffer ;---- ; clear high-order byte * *rts ;-----* Open brk *.byte 0C8 *.word OpenPrm *rts * OpenPrm .byte 4 ; 4 parameters PathPtr .word ; Pathname ptr OpenRef .byte ; RefNum PathPtr+1 * *jsr Open *sta @RetCode,y ; set low-order byte of Return code *tya *iny *sta @RetCode,y ; clear high-order byte *ldy #0 *lda OpenRef ; set low-order byte of RefNum *sta @RefNum,y *tya *iny *sta @RefNum,y Pathname * *pushret * *ldy #0 *lda @SOS_BufAddr,y *sta ZPSOS_BufAddr *iny *lda @SOS_BufAddr,y *sta ZPSOS_BufAddr+1 *iny *lda @SOS_BufAddr,y *sta ZPSOS_BufAddr+1601 * *ldy #0 *lda #Pathname *sta PathPtr ; supply pathname ptr *sty *; var RefNum, RetCode: integer); * Pathname .equ 0ee SOS_BufAddr .equ 0ec RefNum .equ 0ea RetCode .equ 0e8 ZPSOS_BufAddr .equ 00 *pullret * *pop16 RetCode *pop16 RefNum *pop16 SOS_BufAddr *pop16 byte *iny *sta @DevNum,y * *rts ;-----* GetDevNum brk *.byte 84 *.word GetDevPrm *rts * GetDevPrm .byte 2 DevNamPtr .word 0 DevNumber .byte ;-----* *.proc SOS_Open,4 *;procedure SOS_Open(Pathname: string; var SOS_BufAddr: XAddr; r GetDevNum *sta @RetCode,y ; set low-order byte of Return code *tya *iny *sta @RetCode,y ; clear high-order byte *ldy #0 *lda DevNumber ; set low-order byte of DevNum *sta @DevNum,y *tya ; clear high-order er); * DeviceName .equ 0ec DevNum .equ 0ea RetCode .equ 0e8 * *pullret *pop16 RetCode *pop16 DevNum *pop16 DeviceName *pushret * *ldy #0 *lda #DeviceName *sta DevNamPtr *sty DevNamPtr+1 ; supply Device name ptr *js*.include macros.text * *.macro pullret *pla *tax *pla *tay *.endm * *.macro pushret *tya *pha *txa *pha *.endm * ;----- *.proc SOS_DevNum,3 *;procedure SOS_DevNum(DeviceName: string; *; var DevNum, RetCode: integAdr *sta BufAdr *iny *lda @DataArea,y *sta BufAdr+1 *iny *lda @DataArea,y *ora #80 *sta ExtByte ; set up extend byte for BufAdr * *ldy #0 *lda RefNum *sta WriteNum ; supply device number value * *lda #BufAdr *sta WriteBuf *sty WriteBuf+1 ; supply buffer ptr *set16a ByteCount,WriteSize ; supply byte count value *jsr Write *sta @RetCode,y ; set low-order byte of Return code *tya *iny *sta @RetCode,y ; clear high-order byte *rts ;-----* WriReadNum .byte ; SOS Reference number ReadAdr .word ReadBuffer ; Buffer ptr ReadSize .word 0 ; Number of bytes ReadRet .word ; Bytes read ( returned ) * ;-----* *.proc SOS_Mark,4 *;procedure SOS_ @BytesRead,y (dey (lda ReadRet (sta @BytesRead,y ( ( (rts ( Read brk ; Sos Read *.byte 0CA *.word ReadPrm *rts * ReadPrm .byte 4 ; 4 parameters read (pop16 Retcode ; Address of return code (pop16 ReadSize (pop16 ReadBuffer (pop8 ReadNum ( (pushret ( (jsr Read ( (ldy #0 (sta @RetCode,y ( (lda #0 (iny (sta @RetCode,y ( (lda ReadRet+1 (sta fNum: integer; var BufAdr; ByteCount: integer; ; var RetCode, BytesRead: integer ); * BytesRead .equ 0ec RetCode .equ 0ea ReadBuffer .equ 0e8 (pullret ( (pop16 BytesRead ; Address of bytesWritePrm .byte 3 ; 3 parameters WriteNum .byte ; SOS Reference number WriteBuf .word ; Buffer ptr WriteSize .word 0 ; Number of bytes + (.proc SOS_LRead,5 ; ; procedure SOS_LRead ( Ree ; supply byte count value *jsr Write *sta @RetCode,y ; set low-order byte of Return code *tya *iny *sta @RetCode,y ; clear high-order byte *rts ;-----* Write brk *.byte 0CB *.word WritePrm *rts * op16 RetCode *pop16 ByteCount *pop16 BufAdr *pop16 RefNum * *pushret * *ldy #0 *lda RefNum *sta WriteNum ; supply device number value * *lda #BufAdr *sta WriteBuf *sty WriteBuf+1 ; supply buffer ptr *set16a ByteCount,WriteSizOS_LWrite,4 *;procedure SOS_LWrite(RefNum: integer; var BufAdr; ByteCount: integer; *; var RetCode: integer); * RefNum .equ 0ec BufAdr .equ 0ea ByteCount .equ 0e8 RetCode .equ 0e6 * *pullret * *p*.word ReadPrm *rts * ReadPrm .byte 4 ; 4 parameters ReadNum .byte ; SOS Reference number ReadBuf .word ; Buffer ptr ReadSize .word 0 ; Number of bytes NumRead .word ;-----* *.proc Spply buffer ptr *set16a ByteCount,ReadSize ; supply byte count value * *jsr Read *sta @RetCode,y ; set low-order byte of Return code *tya *iny *sta @RetCode,y ; clear high-order byte *rts ;-----* Read brk *.byte 0CA a @DataArea,y *sta BufAdr+1 *iny *lda @DataArea,y *ora #80 *sta ExtByte ; set up extend byte for BufAdr * *ldy #0 *lda RefNum *sta ReadNum ; supply device number value * *lda #BufAdr *sta ReadBuf *sty ReadBuf+1 ; su RetCode .equ 0e6 BufAdr .equ 00 ExtByte .equ 1601 *pullret * *pop16 RetCode *pop16 ByteCount *pop16 DataArea *pop16 RefNum * *pushret * *ldy #0 *lda @DataArea,y ; store DataArea at BufAdr *sta BufAdr *iny *ld;-----* *.proc SOS_XRead,4 *;procedure SOS_XRead(RefNum: integer; DataArea: XAddr; *; ByteCount: integer; *; var RetCode: integer); * RefNum .equ 0ec DataArea .equ 0ea ByteCount .equ 0e8te brk *.byte 0CB *.word WritePrm *rts * WritePrm .byte 3 ; 3 parameters WriteNum .byte ; SOS Reference number WriteBuf .word ; Buffer ptr WriteSize .word 0 ; Number of bytes + Mark(RefNum, Base, Displacement: integer; *; var RetCode: integer); * RetCode .equ 0e0 *pullret * *pop16 RetCode *pop16 MarkDisp *pop8 MarkBase *pop8 MarkRef * *pushret * *jsr Mark * *ldy #0 *sta @RetCode,y ; set low-order byte of Return code *tya *iny *sta @RetCode,y ; clear high-order byte *rts * Mark brk *.byte 0CE *.word MarkPrm *rts * MarkPrm .byte 3 ; 4 parameters MarkRef .byte ; RefNum MarkBashhhhhhhhHH?@ 9ȑAȑ`>`%$#ThhhhhhhhhhHHȱȱVW PȑXȑ`U`\,+*!thhhhhhHH+ %ȑ`*` A3/1.1N7:6R SOSDEVNU tandard file 0.word 0 ;Pre-allocate only 1 block 0.word 0 (.end 0C0 ;Create a file 0.Word CreaParm 0Rts CreaParm .byte 3 ;Parm count=3 0.Word PathName 0.Word FileId ;Point to extra parms 0.Byte 8 FileId .Byte 8 ;Foto file 0.Word 0 ;Aux id 0.Byte 1 ;S4 ; 4-page file buffer +.word ZPSOS_BufAddr; pointer to file buffer DestroyFile Brk 0.byte 0C1 ;Destroy a file 0.Word DesParm 0Rts DesParm .byte 1 ;Parm count=1 0.Word PathName CreateFile Brk 0.byte PathPtr .word ; Pathname ptr OpenRef .byte ; RefNum OptionList .word OpList ; Option List ptr ListLength .byte 4 ; Option List length 0 OpList .byte 0 ; access is default +.byte ; set low-order byte of RefNum *sta @RefNum,y *tya *iny *sta @RefNum,y ; clear high-order byte * *rts ; Finished ;-----* Open brk *.byte 0C8 *.word OpenPrm *rts * OpenPrm .byte 4 ; 4 parameters le (pre-delete) * *Jsr CreateFile * *cmp #0 *Bne Ferror * *Jsr Open * FError sta @RetCode,y ; set low-order byte of Return code *tya *iny *sta @RetCode,y ; clear high-order byte *ldy #0 *lda OpenRef ta ZPSOS_BufAddr *iny *lda @SOS_BufAddr,y *sta ZPSOS_BufAddr+1 *iny *lda @SOS_BufAddr,y *sta ZPSOS_BufAddr+1601 * *ldy #0 *lda #Pathname *sta PathPtr ; supply pathname ptr *sty PathPtr+1 * *Jsr DestroyFile ; Destroy existing fiPathname .equ 0ee SOS_BufAddr .equ 0ec RefNum .equ 0ea RetCode .equ 0e8 ZPSOS_BufAddr .equ 00 *pullret * *pop16 RetCode *pop16 RefNum *pop16 SOS_BufAddr *pop16 Pathname * *pushret * *ldy #0 *lda @SOS_BufAddr,y *se .byte ; Base 0..3 MarkDisp .word 0 ; Displacement +.word 0 *.proc SOS_Create,4 *;procedure SOS_Create(Pathname: string; var SOS_BufAddr: XAddr; *; var RefNum, RetCode: integer); *  :hhhhhhhhhhHHȱȱ \]^_` Vȑ`[`,)(%"!xhhhhhhhhhhHHȱȱ \]^_` Vȑ`[`.+*'$#zhhhhhhhhhhHHIJKLM Cȑ`H`+('$! dhhhhhhhHhIhhhEhHH ?ȑK숭J`D`<:2,"bhhhhh4h5h3hh2hHH ,ȑ(iny (lda @Work2Addr,y (sta %1+1 (iny (.endm ( (.macro MoveAddr (MoveWord %1 (lda @Work2Addr,y (sta %1+1601 (iny (iny (.endm ( (.macro MoveLoc (; (MoveAddr %1 ; load LftAddr (lda @Work2Addr,y ; load Lft(lda %1+1 (sta %2+1 (.endm ( (.macro ShiftLefty (ldy %2 (beq $099 $010 asl %1 (dey (bne $010 $099 (.endm & (.macro ShiftRighty (ldy %2 (beq $099 $010 lsr %1 (dey (bne $010 $099 (.endm & (.macro MoveWord (lda @Work2Addr,y (sta %1 la (.endm & (.macro push16 (lda %1+1 (pha (lda %1 (pha (.endm & (.macro push8 (lda #0 (pha (lda %1 (pha (.endm ( (.macro sbc16 (sec (lda %1 (sbc %2 (sta %3 (lda %1+1 (sbc %2+1 (sta %3+1 (.endm ( (.macro set16a (lda %1 (sta %2 (ldx %1 (cpx %2 $099 (.endm & (.macro dec16a (lda %1 (bne $099 (dec %1+1 $099 dec %1 (.endm (.macro inc16 (inc %1 (bne $099 (inc %1+1 $099 (.endm & (.macro pop16 (pla (sta %1 (pla (sta %1+1 (.endm & (.macro pop8 (pla (sta %1 (p; File: Macros.text ; Contents: Support macros for general coding ; Last Modified on: 2/15/83 by Charlie Eckhaus ; (.macro adc16 (clc (lda %1 (adc %2 (sta %3 (lda %1+1 (adc %2+1 (sta %3+1 (.endm ( (.macro cpx16 (ldx %1+1 (cpx %2+1 (bne $099  O^hhSOSCREAT SOSCREAT SOSDEVNU SOSDEVNUSOSOPEN SOSOPEN SOSCLOSE SOSCLOSESOSXWRIT SOSXWRITSOSXREAD SOSXREADSOSLWRIT SOSLWRITSOSLREAD SOSLREADSOSMARK SOSMARK `1`.,*'!LhhhhhhhhhhHHȱȱ`a j r Zȑbȑ`_`fo`w`}RQPOJA83,&" fP tBit (sta %2 (iny (iny (MoveAddr %3 ; load RgtAddr (lda @Work2Addr,y ; load RgtBit (sta %4 (iny (iny (MoveWord %5 ; load RowLength (.endm ( (.macro ConvAddr (; (; Macro ConvAddr ZPAddr (; (; Converts extended zero-page addresses to the form 8n:0100..80ff, (; where n is a bank number. (; (; Restrictions: XAddr cannot be of the form 80:00xx, (; i.e., in the first page of bank 0. (; (lda %1+1 (beq A QUICK THANK YOU October, 1989 The Wap /// SIG wishes to thank member Tom Fisher, of Chardon, Ohio for donating copies of the Raster Graphics Toolkit and 3D Modelling Toolkit, as well as a copy of their manuals so they could be placed into the PD. We a(lda %1+1601 (sta %2+1601 ( (.endm ( (.macro cpxXAddr (; (; Macro cpxXAddr ZPXAddr1,ZPXAddr2 (; (; compares ZPXAddr2 and its extend byte to ZPXAddr1. (; (ldx 1601+%1 (cpx 1601+%2 (bne $1 (cpx16 %1,%2 $1 ( (.endm ( cXAddr ( (lda %1 (bne $1 (lda %1+1 (bne $2 (dec %1+1601 $2 (dec %1+1 $1 (dec %1 (ConvAddr %1 (.endm & (.macro SetaXAddr (; (; Macro SetaXAddr ZPXAddr1,ZPXAddr2 (; (; sets ZPXAddr2 and its extend byte to ZPXAddr1. (; (set16a %1,%2 1+1601 $001 (ConvAddr %1 (.endm & ; ; Macro DecXAddr ExtendAddr ; ; Decrement %1 ; ; %1 is an extended address of the form: ; 8n: 0100..80ff on the zero page; where 8n ; is the extend byte at %1+1601 ; (.macro decro IncXAddr ExtendAddr ; ; Increment %1 ; ; %1 is an extended address of the form: ; 8n: 0100..80ff on the zero page; where 8n ; is the extend byte at %1+1601 ; (.macro IncXAddr ( (inc16 %1 (bne $001 (inc %; is the extend byte at %x+1601 ; ; ; %2 is a 2 byte unsigned quantity ; ; (.macro sbcXAddr ( (sec (lda %1 (sbc %2 (sta %3 ( (lda %1+1 (sbc %2+1 (sta %3+1 ( (lda %1+1601 (sbc #0 (sta %3+1601 (ConvAddr %3 (.endm & ; ; Mandm & ; ; Macro sbcXAddr ExtendAddr,Len,ExtendAddr ; ; Subtract %2 from %1 (16 bits), difference in %3 ; ; %1 and %3 are extended addresses of the form: ; 8n: 0100..80ff on the zero page; where 8n 8n ; is the extend byte at %x+1601 ; ; ; %2 is a 2 byte unsigned quantity ; ; (.macro adcXAddr ( (clc (lda %1 (adc %2 (sta %3 ( (lda %1+1 (adc %2+1 (sta %3+1 ( (lda %1+1601 (adc #0 (sta %3+1601 ( (ConvAddr %3 (.e6 Work2Addr )LoadXAddr Work2Addr,%1 ) ).endm ) ; ; Macro adcXAddr ExtendAddr,Len,ExtendAddr ; ; Add %2 to %1 (16 bits), sum in %3 ; ; %1 and %3 are extended addresses of the form: ; 8n: 0100..80ff on the zero page; where); Load ZP XAddr from Pascal address Addr ); )ldy #0 )lda @%1,y )sta %2 )iny )lda @%1,y )sta %2+1 )iny )lda @%1,y )sta %2+1601 ) ).endm ) ) ).macro popZPXAddr ); ); Macro PopZPXAddr ZPAddr ); ); pop ZP XAddr from stack. ); )pop1 $001 (cmp #81 (bcc $002 (and #7f (sta %1+1 (inc %1+1601 (jmp $002 $001 (lda #80 (sta %1+1 (dec %1+1601 $002 ( (.endm ( ) ).macro LoadXAddr ); ); Macro LoadXAddr Addr,ZPAddr lso wish to thank THIRD WAVE GRAPHICS and especially Bruce Hodges for placing these fine Pascal graphics tools into the PD. The manuals for both Raster Graphics Toolkit and 3D Modelling Toolkit are in the WAP office.