mirror of
https://github.com/trebonian/visual6502.git
synced 2025-04-08 16:41:06 +00:00
Merge pull request #47 from mmfoerster/master
Added 6502 time code display as "TState" pseudo-bus - see wiki
This commit is contained in:
commit
bd45334147
@ -14023,6 +14023,66 @@ function listActiveTCStates() {
|
||||
return s.join("+");
|
||||
}
|
||||
|
||||
// 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.
|
||||
// For discussion of this reconstruction, see:
|
||||
// http://visual6502.org/wiki/index.php?title=6502_Timing_States
|
||||
function allTCStates( useHTML )
|
||||
{
|
||||
var s = "";
|
||||
var _spc;
|
||||
useHTML = (typeof useHTML === 'undefined') ? false : useHTML;
|
||||
// Use Non-Breaking Space for presentation in an HTML (browser)
|
||||
// context, else use ASCII space for logging context
|
||||
_spc = useHTML ? ' ' : ' ';
|
||||
var allHigh, thisHigh;
|
||||
thisHigh = isNodeHigh( nodenames[ 'clock1' ] );
|
||||
allHigh = thisHigh;
|
||||
if ( !thisHigh ) s += "T0"; else 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 += _spc;
|
||||
thisHigh = isNodeHigh( nodenames[ 't2' ] );
|
||||
allHigh = allHigh && thisHigh;
|
||||
if ( !thisHigh ) s += "T2"; else s += "..";
|
||||
s += _spc;
|
||||
thisHigh = isNodeHigh( nodenames[ 't3' ] );
|
||||
allHigh = allHigh && thisHigh;
|
||||
if ( !thisHigh ) s += "T3"; else s += "..";
|
||||
s += _spc;
|
||||
thisHigh = isNodeHigh( nodenames[ 't4' ] );
|
||||
allHigh = allHigh && thisHigh;
|
||||
if ( !thisHigh ) s += "T4"; else s += "..";
|
||||
s += _spc;
|
||||
thisHigh = isNodeHigh( nodenames[ 't5' ] )
|
||||
allHigh = allHigh && thisHigh;
|
||||
if ( !thisHigh ) s += "T5"; else s += "..";
|
||||
s += _spc + "[";
|
||||
// If all of the time code bits are high (inactive)...
|
||||
if ( allHigh ) {
|
||||
// ...distinguish T1 from T6
|
||||
// If bits T2 through T5 are actively being cleared...
|
||||
if ( isNodeHigh( 1357 ) ) {
|
||||
// ...then this is T1
|
||||
s += "T1";
|
||||
} else {
|
||||
// ...else T2 through T5 are clear because the bits ran off the end
|
||||
// of the T2 through T5 complex: this is T6
|
||||
s += "T6";
|
||||
}
|
||||
} else {
|
||||
s += "..";
|
||||
}
|
||||
s += "]";
|
||||
return s;
|
||||
}
|
||||
|
||||
function readBit(name){
|
||||
return isNodeHigh(nodenames[name])?1:0;
|
||||
}
|
||||
@ -14049,6 +14109,13 @@ 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=='Phi')
|
||||
// Pretty-printed phase indication based on the state of cp1,
|
||||
// the internal Phase 1 node
|
||||
return 'Φ' +
|
||||
(isNodeHigh( nodenames[ 'cp1' ] ) ? '1' : '2');
|
||||
if(busname=='Execute')
|
||||
return dis6502toHTML(readBits('ir',8));
|
||||
if(busname=='Fetch')
|
||||
|
67
macros.js
67
macros.js
@ -304,6 +304,66 @@ function listActiveTCStates() {
|
||||
return s.join("+");
|
||||
}
|
||||
|
||||
// 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.
|
||||
// For discussion of this reconstruction, see:
|
||||
// http://visual6502.org/wiki/index.php?title=6502_Timing_States
|
||||
function allTCStates( useHTML )
|
||||
{
|
||||
var s = "";
|
||||
var _spc;
|
||||
useHTML = (typeof useHTML === 'undefined') ? false : useHTML;
|
||||
// Use Non-Breaking Space for presentation in an HTML (browser)
|
||||
// context, else use ASCII space for logging context
|
||||
_spc = useHTML ? ' ' : ' ';
|
||||
var allHigh, thisHigh;
|
||||
thisHigh = isNodeHigh( nodenames[ 'clock1' ] );
|
||||
allHigh = thisHigh;
|
||||
if ( !thisHigh ) s += "T0"; else 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 += _spc;
|
||||
thisHigh = isNodeHigh( nodenames[ 't2' ] );
|
||||
allHigh = allHigh && thisHigh;
|
||||
if ( !thisHigh ) s += "T2"; else s += "..";
|
||||
s += _spc;
|
||||
thisHigh = isNodeHigh( nodenames[ 't3' ] );
|
||||
allHigh = allHigh && thisHigh;
|
||||
if ( !thisHigh ) s += "T3"; else s += "..";
|
||||
s += _spc;
|
||||
thisHigh = isNodeHigh( nodenames[ 't4' ] );
|
||||
allHigh = allHigh && thisHigh;
|
||||
if ( !thisHigh ) s += "T4"; else s += "..";
|
||||
s += _spc;
|
||||
thisHigh = isNodeHigh( nodenames[ 't5' ] )
|
||||
allHigh = allHigh && thisHigh;
|
||||
if ( !thisHigh ) s += "T5"; else s += "..";
|
||||
s += _spc + "[";
|
||||
// If all of the time code bits are high (inactive)...
|
||||
if ( allHigh ) {
|
||||
// ...distinguish T1 from T6
|
||||
// If bits T2 through T5 are actively being cleared...
|
||||
if ( isNodeHigh( 1357 ) ) {
|
||||
// ...then this is T1
|
||||
s += "T1";
|
||||
} else {
|
||||
// ...else T2 through T5 are clear because the bits ran off the end
|
||||
// of the T2 through T5 complex: this is T6
|
||||
s += "T6";
|
||||
}
|
||||
} else {
|
||||
s += "..";
|
||||
}
|
||||
s += "]";
|
||||
return s;
|
||||
}
|
||||
|
||||
function readBit(name){
|
||||
return isNodeHigh(nodenames[name])?1:0;
|
||||
}
|
||||
@ -330,6 +390,13 @@ 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=='Phi')
|
||||
// Pretty-printed phase indication based on the state of cp1,
|
||||
// the internal Phase 1 node
|
||||
return 'Φ' +
|
||||
(isNodeHigh( nodenames[ 'cp1' ] ) ? '1' : '2');
|
||||
if(busname=='Execute')
|
||||
return disassemblytoHTML(readBits('ir',8));
|
||||
if(busname=='Fetch')
|
||||
|
Loading…
x
Reference in New Issue
Block a user