// rninit.sr // Carol Hankins // March 26,1976 // Last modified October 25, 1979 6:54 PM by Taft get "bravo1.df" get "vm.df" get "rn1.df" get "doc.df" get "msg.df" get "com.df" //incoming procedures external [ createdoce array errhlt getvp VpaGetOne VpaGetMany VpaGetScratchBin DirtyBp PutSbScr array1 ] //incoming statics external [ vfb vbp cpscrt deltacp look1std look2std ] //outgoing procedures external [ Init1Rls Init2Rls AppendRegion ] //outgoing statics external [ rgrl vrlfsys vrldsys vrlwsys vcridpast2 vrgridpast2 ] static [ rgrl vrlfsys vrldsys vrlwsys vcridpast2 vrgridpast2 ] let RlCreate(krl,undocfn,rimax,fRes) = valof [ let trl = nil let tbimax = nil trl = array1(lrl,0) trl>>RL.krl = krl trl>>RL.doc = undocfn trl>>RL.rimac = 0 trl>>RL.rimax = rimax trl>>RL.fRes = fRes test fRes ifso [ trl>>RL.rb = array(lrx+Lrd(krl)*rimax) InitRb(trl>>RL.krl,trl>>RL.rb,0,0,rimax) ] ifnot [ tbimax = IntCeilingDiv(rimax,DriMax(trl)) trl>>RL.bimac = 0 trl>>RL.bphint = 0 trl>>RL.VpaGet = errhlt trl>>RL.mpbirifirst = array(tbimax + 1) trl>>RL.mpbivpa = array(tbimax) trl>>RL.mpbifcfirst = array(tbimax) ] resultis trl ] and IntCeilingDiv(int1,int2) = valof [ resultis ( (int1+int2-1)/int2 ) ] and DriMax(rl) = ( (256-lrx) / Lrd(rl>>RL.krl) ) and Lrd(krl) = ((krl eq krlw) ? 3,2) and AppendRegion(rl,unfccp,dunfccp,dfcmax) be [ let trb = nil test rl >> RL.fRes ifso trb = rl >> RL.rb ifnot [ let tbp = nil let tbimac = rl>>RL.bimac if tbimac gr 0 then trb = getvp((rl>>RL.mpbivpa) ! (tbimac-1) ) tbp = vbp if tbimac eq 0 % trb>>RX.dri ge DriMax(rl) then [ rl>>RL.mpbirifirst ! tbimac = rl>>RL.rimac rl>>RL.mpbifcfirst ! tbimac = unfccp rl>>RL.mpbivpa ! tbimac = VpaGetScratchBin() rl>>RL.bimac = rl>>RL.bimac + 1 rl>>RL.VpaGet = valof [ test rl>>RL.bimac eq 1 ifso resultis VpaGetOne ifnot resultis VpaGetMany ] trb = getvp( (rl>>RL.mpbivpa) ! (tbimac) ) tbp = vbp InitRb(rl>>RL.krl,trb,rl>>RL.rimac,tbimac,DriMax(rl)) ] DirtyBp(tbp) ] let trimac = rl>>RL.rimac let riFirst = trb>>RX.rifirst let fcFirst = 0 unless (rl >> RL.fRes) then [ let tbimac = rl>>RL.bimac fcFirst = rl>>RL.mpbifcfirst ! (tbimac-1) rl>>RL.mpbirifirst ! tbimac = trimac + 1 ] (trb+trb>>RX.brgdfcfirst) ! (trimac-riFirst ) = unfccp - fcFirst (trb+trb>>RX.brgdfc) ! (trimac-riFirst ) = dunfccp if rl>>RL.krl eq krlw then (trb+trb>>RX.brgdfcmax) ! (trimac-riFirst ) = dfcmax trb>>RX.dri = trb>>RX.dri + 1 rl>>RL.rimac = trimac + 1 ] and FcGetRegionW(dfc) = valof [ let tfc,asb = nil,nil tfc = cpscrt tfc = (tfc+1) logand #177776 dfc = (dfc logand #177776) + 1 if ( (tfc<>RX.rifirst = riFirst rb>>RX.dri = 0 rb>>RX.bi = bi rb>>RX.brgdfcfirst = lrx rb>>RX.brgdfc = lrx + driMax if krl eq krlw then rb>>RX.brgdfcmax = lrx + 2*driMax ]