// DiExInit.bcpl // All the code that can be thrown away after using once // Last modified March 27, 1982 7:42 PM by Boggs get "Streams.d" //get "AltoFileSys.d" get "DiEx.defs" external [ CreateDisplayStream; ShowDisplayStream; GetScanLinePos; MyFrame ]// OS statics external [ InitializeZone; SetKeyboardProc; gacha10 ] manifest [ ParamLines = 10; BTsize = ((9*5*407)/8) - 1 EndCode = #335 ] static [ wbuff; rbuff; DAs; CAs; CbZone; CurrentPS; T MsgS; HintS; char; HeaderBuff; LabelBuff; TriexHandeling=0 errTable; ETsize=maxEntries*lET*8 FirstDr=0; LastDr=0; Mtable; maxEC=5; PackType=0 WriteEnable = 0; DiexPageId; DiexZone ] structure VERS [ eng bit 4; blank bit 12 ] structure DCB: // Display Control Block [ next word // -> next DCB; 0 if last parwd word = [ resolution bit 1 // 0 = high; 1 = low background bit 1 // 0 = white; 1 = black indwidth bit 14 = [ indentation bit 6 // indent 16*indentation bits on the left width bit 8 // in words; must be even; zero is OK ] ] bitmap word // -> bit map; must be even height word // scan lines = 2*height (height in each field) ] structure StreamCB [ fdcb word; ldcb word; @DCB ] manifest lStreamCB = size StreamCB/16 let InitFunction() be [ @EndCode = InitFunction wbuff = MyGetFixed(1000) //Dont zero this buffer yet, it is this code!!!!! rbuff = MyGetFixed(300*blks) //Same Here! if (table [ 61014b; 1401b ])()<>") ResetDisk(0) DiskStatus() ] and LF(lev) be [ if lev eq 0 then [ Msg("*n*n>> "); return ] Msg("*n"); for i = 0 to lev do Msg(" ") ] and MyGetFixed(words) = valof //replaces MyGetFixed that was in operating system [ let result = @EndCode; @EndCode = result+words+2; resultis result ] and InitPtable() be [ T!-1 = nHeads; T!-2 = nSectors; T!-3 = nTracks; T!-4 = 0; T!-5 = 0 Zero(T,5*TableSize) //now I only have to set non-zero parameters let Tx = nil for i = 1 to 5 do [ Tx = T + i*TableSize Tx>>P.MsgEnable = true Tx>>P.Repeats = 1 Tx>>P.CylInc = 1 Tx>>P.LastCyl = #7777 Tx>>P.LastHd = #77 Tx>>P.LastSec = #77 Tx>>P.ErrRes = 3 Tx>>P.maxEC = 5 Tx>>P.Chain = true ] CurrentPS = 0 Tx = T + 1*TableSize //set initial parameters for "Full Test" Tx>>P.nRandom = 100 Tx>>P.Waction.header = diskCheck Tx>>P.Waction.label = diskWrite Tx>>P.Waction.data = diskWrite Tx>>P.Raction.header = diskCheck Tx>>P.Raction.label = diskCheck Tx>>P.Raction.data = diskCheck Tx>>P.Repeats = 10 Tx>>P.PattR = 1 Tx = T + 2*TableSize //set initial parameters for "Init Labels" Tx>>P.Patt000 = 1 Tx>>P.Waction.header = diskWrite Tx>>P.Waction.label = diskWrite Tx>>P.Waction.data = diskWrite Tx>>P.Raction.header = diskCheck Tx>>P.Raction.label = diskRead Tx>>P.Raction.data = diskRead Tx = T + 3*TableSize //set initial parameters for "Verify disk" Tx>>P.Waction.header = diskSkip Tx>>P.Raction.header = diskCheck Tx>>P.Raction.label = diskRead Tx>>P.Raction.data = diskRead Tx = T + 4*TableSize //set initial parameters for "Custom Comm" Tx>>P.Waction.header = diskWrite Tx>>P.Waction.label = diskWrite Tx>>P.Waction.data = diskWrite Tx>>P.Raction.header = diskCheck Tx>>P.Raction.label = diskRead Tx>>P.Raction.data = diskRead Tx>>P.Chain = false Tx>>P.FirstSec = 100 Tx>>P.PattA = 1 test WriteEnable ifso MoveBlock(T,T+TableSize,TableSize) //set current parameters to Full Test ifnot MoveBlock(T,T+3*TableSize,TableSize) //set current parameters to Verify disk ] //The following proceedure is copied from "menu.bcpl" so it can be discarded after init and InitParam(lines,AboveStream,Font) = valof [ external [ SetLinePos; lMF ] let DCB = @#420 //let fontheight = 2*(DCB>>DCB.height)//get height of sysfont //if Font then fontheight = Font!-2 let stream,Mbuff = nil,nil if AboveStream then [ Mbuff = MyGetFixed(lMF*lines*6+2)+2;Zero(Mbuff,lMF*lines*6) let DispBuffLength = (38*FontHeight + 6)*lines let DispBuff = MyGetFixed(DispBuffLength) stream = CreateDisplayStream(lines, DispBuff, DispBuffLength, Font, 0, DSstopright+DSstopbottom,DiexZone) ShowDisplayStream(stream,DSbelow,AboveStream) let Dstream = CreatDisplayArea(0,2,0,1) ShowDisplayStream(Dstream,DSabove,stream) Mbuff!-1 = stream Mbuff!-2 = lines ] stream = Mbuff!-1 for i=1 to lines do //Send enough char's to fill each line in the stream [ for c=0 to 120 do Puts(stream,#40) if i ne lines do Puts(stream,$*n) ] SetLinePos(stream,0) resultis Mbuff ] and CreatDisplayArea(buff,nlines,width,background,indent,resolution; numargs nargs) = valof [ if nargs ls 5 then indent = 0 if nargs ls 4 then background = 0 if nargs ls 3 then width = 0 if nargs ls 4 then nlines = 2 if nargs ls 5 then resolution = 0 let stream = (MyGetFixed(lStreamCB+1) + 1) & #177776 Zero(stream,lStreamCB); Zero(buff,nlines*width) stream>>StreamCB.fdcb = lv stream>>StreamCB.next stream>>StreamCB.ldcb = lv stream>>StreamCB.next stream>>StreamCB.width = width stream>>StreamCB.indentation = indent stream>>StreamCB.background = background stream>>StreamCB.resolution = resolution stream>>StreamCB.bitmap = buff stream>>StreamCB.height = nlines/2 resultis stream ]