mirror of
https://github.com/trebonian/visual6502.git
synced 2025-01-13 20:32:07 +00:00
allow forward or reverse log order
This commit is contained in:
parent
0c6a90a558
commit
18e1946488
@ -127,6 +127,7 @@ $().ready(function(){
|
|||||||
<input type="button" value="Trace less" onclick="updateLoglevel(--loglevel)" />
|
<input type="button" value="Trace less" onclick="updateLoglevel(--loglevel)" />
|
||||||
<input type="button" value="Trace these too:" onclick="updateLogList()" />
|
<input type="button" value="Trace these too:" onclick="updateLogList()" />
|
||||||
<input type="text" id="LogThese" name="LogThese" value="" />
|
<input type="text" id="LogThese" name="LogThese" value="" />
|
||||||
|
<input type="button" value="Log Up/Down" onclick="updateLogDirection();" />
|
||||||
<input type="button" value="Clear Log" onclick="updateLoglevel(loglevel)" />
|
<input type="button" value="Clear Log" onclick="updateLoglevel(loglevel)" />
|
||||||
</form>
|
</form>
|
||||||
<br />
|
<br />
|
||||||
|
23
macros.js
23
macros.js
@ -451,6 +451,24 @@ function initLogbox(names){
|
|||||||
logbox.innerHTML = "<tr>"+logStream.join("</tr><tr>")+"</tr>";
|
logbox.innerHTML = "<tr>"+logStream.join("</tr><tr>")+"</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var logboxAppend=true;
|
||||||
|
|
||||||
|
// can append or prepend new states to the log table
|
||||||
|
// when we reverse direction we need to reorder the log stream
|
||||||
|
function updateLogDirection(){
|
||||||
|
logboxAppend=!logboxAppend;
|
||||||
|
var logbox=document.getElementById('logstream');
|
||||||
|
var loglines=[];
|
||||||
|
// the first element is the header so we can't reverse()
|
||||||
|
for (var i=1;i<logStream.length;i++) {
|
||||||
|
loglines.unshift(logStream[i]);
|
||||||
|
}
|
||||||
|
loglines.unshift(logStream[0]);
|
||||||
|
logStream=loglines;
|
||||||
|
logbox.innerHTML = "<tr>"+logStream.join("</tr><tr>")+"</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
// update the table of signal values, by prepending or appending
|
||||||
function updateLogbox(names){
|
function updateLogbox(names){
|
||||||
var logbox=document.getElementById('logstream');
|
var logbox=document.getElementById('logstream');
|
||||||
var signals=[];
|
var signals=[];
|
||||||
@ -458,7 +476,10 @@ function updateLogbox(names){
|
|||||||
for(i in names){
|
for(i in names){
|
||||||
signals.push(busToString(names[i]));
|
signals.push(busToString(names[i]));
|
||||||
}
|
}
|
||||||
logStream.push("<td>" + signals.join("</td><td>") + "</td>");
|
if(logboxAppend)
|
||||||
|
logStream.push("<td>" + signals.join("</td><td>") + "</td>");
|
||||||
|
else
|
||||||
|
logStream.splice(1,0,"<td>" + signals.join("</td><td>") + "</td>");
|
||||||
|
|
||||||
logbox.innerHTML = "<tr>"+logStream.join("</tr><tr>")+"</tr>";
|
logbox.innerHTML = "<tr>"+logStream.join("</tr><tr>")+"</tr>";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user