From c1409b78cb98509d2bc031cc92a395f96886cb27 Mon Sep 17 00:00:00 2001 From: mmfoerster Date: Mon, 9 Oct 2017 17:49:53 -0400 Subject: [PATCH] busToString( 'TState' ) and busToString( 'TStateF' ) now call allTCStates(). 'TState' returns the string returned by allTCStates(). 'TStateF' returns the string returned by allTCStates() with phase indication appended: "F1" or "F2" for phase1 or phase2 respectively. 'F' is chosen since that's all that Phi really is: an "eff". Perhaps another enhancement could call out an actual phi glyph for the HTML (browser) context. allTCStates() is also enhanced by an optional boolean parameter to control the spacing of non-blank text within the string it returns. * A true parameter puts HTML non-breaking spaces between non-blank text, suitable for display on a browser page. This is always used by busToString(). * A false or absent parameter puts ASCII spaces between non-blank text, suitable for text logging. --- expert-allinone.js | 29 ++++++++++++++++++++++------- macros.js | 29 ++++++++++++++++++++++------- 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/expert-allinone.js b/expert-allinone.js index dc2db67..139dda1 100644 --- a/expert-allinone.js +++ b/expert-allinone.js @@ -14026,37 +14026,42 @@ function listActiveTCStates() { // Show all time code node states (active and inactive) in fixed format, // with T1/T6 indication in square brackets. ".." for a node indicates // inactive state, "T"* for a node indicates active state. -function allTCStates() +function allTCStates( useNBSP ) { var s = ""; + var _spc; + useNBSP = (typeof useNBSP === 'undefined') ? false : useNBSP; + // Use Non-Breaking Space for presentation in an HTML (browser) + // context, else use ASCII space for logging context + _spc = useNBSP ? ' ' : ' '; var allHigh, thisHigh; thisHigh = isNodeHigh( nodenames[ 'clock1' ] ); allHigh = thisHigh; if ( !thisHigh ) s += "T0"; else s += ".."; - s += " "; + s += _spc; // T+ in visual6502 is called T1x in // http://www.weihenstephan.org/~michaste/pagetable/6502/6502.jpg // Notated as T+ for compatibility with PLA node names thisHigh = isNodeHigh( nodenames[ 'clock2' ] ); allHigh = allHigh && thisHigh; if ( !thisHigh ) s += "T+"; else s += ".."; - s += " "; + s += _spc; thisHigh = isNodeHigh( nodenames[ 't2' ] ); allHigh = allHigh && thisHigh; if ( !thisHigh ) s += "T2"; else s += ".."; - s += " "; + s += _spc; thisHigh = isNodeHigh( nodenames[ 't3' ] ); allHigh = allHigh && thisHigh; if ( !thisHigh ) s += "T3"; else s += ".."; - s += " "; + s += _spc; thisHigh = isNodeHigh( nodenames[ 't4' ] ); allHigh = allHigh && thisHigh; if ( !thisHigh ) s += "T4"; else s += ".."; - s += " "; + s += _spc; thisHigh = isNodeHigh( nodenames[ 't5' ] ) allHigh = allHigh && thisHigh; if ( !thisHigh ) s += "T5"; else s += ".."; - s += " ["; + s += _spc + "["; // If all of the time code bits are high (inactive)... if ( allHigh ) { // ...distinguish T1 from T6 @@ -14102,6 +14107,16 @@ function busToString(busname){ return ['clock1','clock2','t2','t3','t4','t5'].map(busToHex).join(""); if(busname=='State') return listActiveTCStates(); + if(busname=='TState') + return allTCStates( true ); + if(busname=='TStateF') + // TState with phase indication tacked on: F1 or F2 + // Prefer latin 'F' because that's what Greek phi really is: + // a single glyph for the "eff" speech sound + // Capitalized because the 'T's in the time state are + // capitalized + return allTCStates( true ) + ' ' + 'F' + + (isNodeHigh( nodenames[ 'cp1' ] ) ? '1' : '2'); if(busname=='Execute') return dis6502toHTML(readBits('ir',8)); if(busname=='Fetch') diff --git a/macros.js b/macros.js index bb05e01..17e80d7 100644 --- a/macros.js +++ b/macros.js @@ -307,37 +307,42 @@ function listActiveTCStates() { // Show all time code node states (active and inactive) in fixed format, // with T1/T6 indication in square brackets. ".." for a node indicates // inactive state, "T"* for a node indicates active state. -function allTCStates() +function allTCStates( useNBSP ) { var s = ""; + var _spc; + useNBSP = (typeof useNBSP === 'undefined') ? false : useNBSP; + // Use Non-Breaking Space for presentation in an HTML (browser) + // context, else use ASCII space for logging context + _spc = useNBSP ? ' ' : ' '; var allHigh, thisHigh; thisHigh = isNodeHigh( nodenames[ 'clock1' ] ); allHigh = thisHigh; if ( !thisHigh ) s += "T0"; else s += ".."; - s += " "; + s += _spc; // T+ in visual6502 is called T1x in // http://www.weihenstephan.org/~michaste/pagetable/6502/6502.jpg // Notated as T+ for compatibility with PLA node names thisHigh = isNodeHigh( nodenames[ 'clock2' ] ); allHigh = allHigh && thisHigh; if ( !thisHigh ) s += "T+"; else s += ".."; - s += " "; + s += _spc; thisHigh = isNodeHigh( nodenames[ 't2' ] ); allHigh = allHigh && thisHigh; if ( !thisHigh ) s += "T2"; else s += ".."; - s += " "; + s += _spc; thisHigh = isNodeHigh( nodenames[ 't3' ] ); allHigh = allHigh && thisHigh; if ( !thisHigh ) s += "T3"; else s += ".."; - s += " "; + s += _spc; thisHigh = isNodeHigh( nodenames[ 't4' ] ); allHigh = allHigh && thisHigh; if ( !thisHigh ) s += "T4"; else s += ".."; - s += " "; + s += _spc; thisHigh = isNodeHigh( nodenames[ 't5' ] ) allHigh = allHigh && thisHigh; if ( !thisHigh ) s += "T5"; else s += ".."; - s += " ["; + s += _spc + "["; // If all of the time code bits are high (inactive)... if ( allHigh ) { // ...distinguish T1 from T6 @@ -383,6 +388,16 @@ function busToString(busname){ return ['clock1','clock2','t2','t3','t4','t5'].map(busToHex).join(""); if(busname=='State') return listActiveTCStates(); + if(busname=='TState') + return allTCStates( true ); + if(busname=='TStateF') + // TState with phase indication tacked on: F1 or F2 + // Prefer latin 'F' because that's what Greek phi really is: + // a single glyph for the "eff" speech sound + // Capitalized because the 'T's in the time state are + // capitalized + return allTCStates( true ) + ' ' + 'F' + + (isNodeHigh( nodenames[ 'cp1' ] ) ? '1' : '2'); if(busname=='Execute') return disassemblytoHTML(readBits('ir',8)); if(busname=='Fetch')