DIRECTORY Buttons USING [Create, ReLabel], IO, ViewerTools USING [MakeNewTextViewer, SetContents, SetSelection], SoftcardOps, SoftcardToolPrivate; SoftcardToolPeekPokeImpl: CEDAR PROGRAM IMPORTS Buttons, IO, ViewerTools, SoftcardOps, SoftcardToolPrivate EXPORTS SoftcardToolPrivate = BEGIN OPEN IO, SoftcardToolPrivate; peekPokeAddrText: Viewer; peekPokeValText: Viewer; peekPokeShortLabel: Viewer; isShort: BOOL _ TRUE; dumpAddrText: Viewer; dumpNumText: Viewer; BuildPeekPokeButtons: PUBLIC PROC[topViewer, sibx: Viewer] RETURNS[Viewer] = { sib: Viewer _ sibx; sib _ Buttons.Create[ info: [ name: " Peek ", parent: topViewer, wx: 3, wy: sib.wy+sib.wh+2, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: PeekProc ]; sib _ Buttons.Create[ info: [ name: " Poke ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: PokeProc ]; sib _ peekPokeShortLabel _ Buttons.Create[ info: [ name: " short ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: ShortOrLongProc ]; sib _ Buttons.Create[ info: [ name: " Addr: ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: PeekPokeAddrProc ]; sib _ peekPokeAddrText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+6, wy: sib.wy, ww: 120, wh: entryHeight, border: FALSE, scrollable: FALSE]]; sib _ Buttons.Create[ info: [ name: " Val: ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: PeekPokeValProc ]; sib _ peekPokeValText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+6, wy: sib.wy, ww: 300, wh: entryHeight, border: FALSE, scrollable: FALSE]]; sib _ Buttons.Create[ info: [ name: " DumpShort ", parent: topViewer, wx: 3, wy: sib.wy+sib.wh+2, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: DumpShortProc ]; sib _ Buttons.Create[ info: [ name: " DumpLong ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: DumpLongProc ]; sib _ Buttons.Create[ info: [ name: " Addr: ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: DumpAddrProc ]; sib _ dumpAddrText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+6, wy: sib.wy, ww: 120, wh: entryHeight, border: FALSE, scrollable: FALSE]]; sib _ Buttons.Create[ info: [ name: " Num: ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: DumpNumProc ]; sib _ dumpNumText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+6, wy: sib.wy, ww: 300, wh: entryHeight, border: FALSE, scrollable: FALSE]]; RETURN[sib]; }; PeekProc: ClickProc = { addr: LONG CARDINAL = GetAsCard[peekPokeAddrText]; longVal: LONG CARDINAL; BEGIN ENABLE SoftcardOps.Error => { tsOut.PutF[explanation]; GOTO exit }; IF isShort THEN longVal _ SoftcardOps.ReadShort[addr] ELSE longVal _ SoftcardOps.ReadLong[addr]; EXITS exit => RETURN; END; tsOut.PutF[" The %g value of addr: %xH is %xH\n", IO.rope[IF isShort THEN "short" ELSE "long"], IO.card[addr], IO.card[longVal] ]; ViewerTools.SetContents[peekPokeValText, IO.PutFR["%xH", IO.card[longVal]] ]; }; PokeProc: ClickProc = { addr: LONG CARDINAL = GetAsCard[peekPokeAddrText]; longVal: LONG CARDINAL = GetAsCard[peekPokeValText]; BEGIN ENABLE SoftcardOps.Error => { tsOut.PutF[explanation]; GOTO exit }; IF isShort THEN { shortVal: CARDINAL _ longVal; SoftcardOps.WriteShort[addr, shortVal]; } ELSE SoftcardOps.WriteLong[addr, longVal]; EXITS exit => RETURN; END; tsOut.PutF[" The %g value of addr: %xH has bbe set to %xH\n", IO.rope[IF isShort THEN "short" ELSE "long"], IO.card[addr], IO.card[longVal] ]; }; ShortOrLongProc: ClickProc = { IF isShort THEN Buttons.ReLabel[peekPokeShortLabel, " long "] ELSE Buttons.ReLabel[peekPokeShortLabel, " short "]; isShort _ ~isShort; }; PeekPokeAddrProc: ClickProc = { ViewerTools.SetSelection[peekPokeAddrText, NIL] }; PeekPokeValProc: ClickProc = { ViewerTools.SetSelection[peekPokeValText, NIL] }; DumpShortProc: ClickProc = { addr: LONG CARDINAL = GetAsCard[dumpAddrText]; num: LONG CARDINAL = GetAsCard[dumpNumText]; shortNum: CARDINAL _ num; count: CARDINAL _ shortNum; index: CARDINAL _ 0; seq: SoftcardOps.SeqShort; format: ROPE = " %04x"; BEGIN ENABLE SoftcardOps.Error => { tsOut.PutF[explanation]; GOTO exit }; seq _ SoftcardOps.DumpShort[addr, shortNum]; EXITS exit => RETURN; END; tsOut.PutF["\n Dumping %g short numbers starting at addr: %xH\n", IO.card[num], IO.card[addr] ]; WHILE count >= 8 DO tsOut.PutF["%xH:", IO.card[addr+index] ]; FOR i: CARDINAL IN [0..8) DO tsOut.PutF[format, IO.card[seq[index+i]] ]; ENDLOOP; tsOut.PutChar['\n]; index _ index + 8; count _ count - 8; ENDLOOP; tsOut.PutF["%xH:", IO.card[addr+index] ]; FOR i: CARDINAL IN [0..count) DO tsOut.PutF[format, IO.card[seq[index+i]] ]; ENDLOOP; tsOut.PutChar['\n]; }; DumpLongProc: ClickProc = { }; DumpAddrProc: ClickProc = { ViewerTools.SetSelection[dumpAddrText, NIL] }; DumpNumProc: ClickProc = { ViewerTools.SetSelection[dumpNumText, NIL] }; ResetProc: ClickProc = { tsOut.PutRope[" Not yet implemented - ResetDragon\n"] }; ReadClockProc: ClickProc = { val: LONG CARDINAL = SoftcardOps.ReadClock[]; tsOut.PutF[" Current clock reading is: %xH\n", IO.card[val] ]; }; EUPBusDataProc: ClickProc = { val: LONG CARDINAL = SoftcardOps.ReadEUPBusData[]; tsOut.PutF[" EUPBusData: %xH\n", IO.card[val] ]; }; IFUPBusDataProc: ClickProc = { val: LONG CARDINAL = SoftcardOps.ReadIFUPBusData[]; tsOut.PutF[" IFUPBusData: %xH\n", IO.card[val] ]; }; EUPBusCmdProc: ClickProc = { val: SoftcardOps.EUPBusCmd = SoftcardOps.ReadEUCmd[]; tsOut.PutF[" EUPBusCmd: [userMode: %g, unspecifiedAsYet: %xH]\n", IO.bool[val.userMode], IO.int[val.unspecifiedAsYet] ]; }; IFUPBusCmdProc: ClickProc = { val: SoftcardOps.IFUPBusCmd = SoftcardOps.ReadIFUCmd[]; tsOut.PutF[" IFUPBusCmd: %g\n", IO.rope[IF val = noAccess THEN "noAccess" ELSE "access"] ]; }; ResetEUCacheStateProc: ClickProc = { SoftcardOps.ResetEUCacheStateMachine[]; tsOut.PutRope[" ResetEUCacheStateMachine has been done\n"]; }; ResetIFUCacheStateProc: ClickProc = { SoftcardOps.ResetIFUCacheStateMachine[]; tsOut.PutRope[" ResetIFUCacheStateMachine has been done\n"]; }; ResetCounterProc: ClickProc = { SoftcardOps.ResetCounter[]; tsOut.PutRope[" ResetCounter has been done\n"]; }; DisableEUCacheProc: ClickProc = { SoftcardOps.DisableEUCache[]; tsOut.PutRope[" DisableEUCache has been done\n"]; }; DisableIFUCacheProc: ClickProc = { SoftcardOps.DisableIFUCache[]; tsOut.PutRope[" DisableIFUCache has been done\n"]; }; FlushEUCacheProc: ClickProc = { SoftcardOps.FlushEUCache[]; tsOut.PutRope[" FlushEUCache has been done\n"]; }; FlushIFUCacheProc: ClickProc = { SoftcardOps.FlushIFUCache[]; tsOut.PutRope[" FlushIFUCache has been done\n"]; }; END. DSoftcardToolPeekPokeImpl.mesa Copyright Σ 1987 by Xerox Corporation. All rights reserved. Willie-Sue, February 18, 1987 8:53:49 pm PST * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * builds the miscellaneous buttons - sib is the last button created line 6 of Buttons line 7 of Buttons Κ~˜codešœ™Kšœ<™J˜—šœ˜šœ*˜*Jšœ7˜7Jšœ œœ˜"Jšœ˜—J™—šœ6˜6JšœA˜AJšœ#œœ˜>J˜——™šœ˜šœ/˜/Jšœ6œœ˜OJšœ˜—J˜—šœ˜šœ.˜.Jšœ7˜7Jšœ œœ˜"Jšœ˜—J™—šœ˜šœ+˜+Jšœ7˜7Jšœ œœ˜"Jšœ˜—J™—šœ3˜3JšœA˜AJšœ#œœ˜>J˜—šœ˜šœ*˜*Jšœ7˜7Jšœ œœ˜"Jšœ˜—J™—šœ2˜2JšœA˜AJšœ#œœ˜>J˜—Jšœ˜ —J˜J˜—šžœ˜Jšœœœ˜2Jšœ œœ˜šœœ˜#Jšœ˜Jšœ˜ J˜šœ œ&˜5Jšœ&˜*—Jšœ œ˜Jšœ˜—šœ1˜1Jš œœ œ œ œ œ˜P—Jšœ)œœ˜MJ˜J˜—šžœ˜Jšœœœ˜2Jšœ œœ˜4šœœ˜#Jšœ˜Jšœ˜ J˜šœ œ˜Jšœ œ ˜Jšœ(˜(J˜Jšœ&˜*—Jšœ œ˜Jšœ˜—šœ=˜=Jš œœ œ œ œ œ˜P—J˜J˜—šžœ˜šœ œ.˜=Jšœ0˜4—J˜J˜J˜—šžœ ˜Jšœ-œ˜4J˜—šžœ ˜Jšœ,œ˜3—J˜šž œ˜Jšœœœ˜.Jšœœœ˜,Jšœ œ˜Jšœœ ˜Jšœœ˜Jšœ˜Jšœœ ˜šœœ˜#Jšœ˜Jšœ˜ J˜Jšœ,˜,Jšœ œ˜Jšœ˜—šœA˜AJšœ œ˜—šœ ˜Jšœœ˜)šœœœ˜Jšœœ˜+Jšœ˜—J˜Jšœ˜Jšœ˜Jšœ˜—Jšœœ˜)šœœœ ˜ Jšœœ˜+Jšœ˜—J˜J˜J˜—šž œ˜J˜J˜J˜—šž œ ˜Jšœ)œ˜0J˜—šž œ ˜Jšœ(œ˜/J˜—šž œH˜QJ˜—šž œ˜Jšœœœ˜-Jšœ/œ ˜>J˜J˜—šžœ˜Jšœœœ ˜2Jšœ!œ ˜0J˜J˜—šžœ˜Jšœœœ!˜3Jšœ"œ ˜1J˜J˜—šž œ˜Jšœœ$˜5šœA˜AJšœœ˜6—J˜J˜—šžœ˜Jšœœ&˜7šœ˜Jšœœœ œ ˜;—J˜J˜—šžœ˜$Jšœ'˜'Jšœ;˜;J˜J˜—šžœ˜%Jšœ(˜(Jšœ<˜