mirror of
https://github.com/mist64/perfect6502.git
synced 2024-06-02 17:41:32 +00:00
seems to work!
This commit is contained in:
parent
61d13c1ee8
commit
cec8c325bc
|
@ -20,16 +20,16 @@
|
|||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
var ctrace = true;
|
||||
var ctrace = false;
|
||||
var loglevel = 3;
|
||||
|
||||
function recalcNodeList(list){
|
||||
console.log("recalcNodeList list=" + list);
|
||||
// console.log("recalcNodeList list=" + list);
|
||||
var n = list[0];
|
||||
var recalclist = new Array();
|
||||
for(var j=0;j<100;j++){ // loop limiter
|
||||
if(list.length==0) return;
|
||||
console.log("recalcNodeList iteration=" + j + ", list=" + list);
|
||||
// console.log("recalcNodeList iteration=" + j + ", list=" + list);
|
||||
if(ctrace) console.log(j, list);
|
||||
for(var i in list) recalcNode(list[i], recalclist);
|
||||
list = recalclist;
|
||||
|
@ -103,7 +103,7 @@ function getNodeGroup(i){
|
|||
}
|
||||
|
||||
function addNodeToGroup(i, group){
|
||||
console.log("addNodeToGroup " + i + ", group=", group);
|
||||
// console.log("addNodeToGroup " + i + ", group=", group);
|
||||
if(arrayContains(group, i)) return;
|
||||
group.push(i);
|
||||
if(i==ngnd) return;
|
||||
|
@ -112,7 +112,7 @@ function addNodeToGroup(i, group){
|
|||
}
|
||||
|
||||
function addNodeTransistor(node, t, group){
|
||||
console.log("addNodeTransistor n=" + node + ", t=" + t + ", group=" + group);
|
||||
// console.log("addNodeTransistor n=" + node + ", t=" + t + ", group=" + group);
|
||||
var tr = transistors[t];
|
||||
if(!tr.on) return;
|
||||
var other;
|
||||
|
@ -140,8 +140,8 @@ function getNodeValue(group){
|
|||
|
||||
|
||||
function isNodeHigh(nn){
|
||||
console.log("isNodeHigh nn=" + nn + " state=" + nodes[nn].state);
|
||||
console.log("isNodeHigh nn=" + nn + " res=" + arrayContains(['vcc','pu','fh'], nodes[nn].state));
|
||||
// console.log("isNodeHigh nn=" + nn + " state=" + nodes[nn].state);
|
||||
// console.log("isNodeHigh nn=" + nn + " res=" + arrayContains(['vcc','pu','fh'], nodes[nn].state));
|
||||
return arrayContains(['vcc','pu','fh'], nodes[nn].state);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ function initChip(){
|
|||
setLow('clk0');
|
||||
setHigh('rdy'); setLow('so');
|
||||
setHigh('irq'); setHigh('nmi');
|
||||
// recalcNodeList(allNodes());
|
||||
recalcNodeList(allNodes());
|
||||
|
||||
var string = '';
|
||||
for (var i in nodes) {
|
||||
|
@ -67,9 +67,9 @@ function initChip(){
|
|||
}
|
||||
console.log(string);
|
||||
|
||||
// for(var i=0;i<8;i++){setHigh('clk0'), setLow('clk0');}
|
||||
// setHigh('res');
|
||||
// for(var i=0;i<18;i++){halfStep();}
|
||||
for(var i=0;i<8;i++){setHigh('clk0'), setLow('clk0');}
|
||||
setHigh('res');
|
||||
for(var i=0;i<18;i++){halfStep();}
|
||||
cycle = 0;
|
||||
chipStatus();
|
||||
}
|
||||
|
|
|
@ -183,7 +183,7 @@ getNodeValue(int *group, int groupcount)
|
|||
return STATE_GND;
|
||||
if (arrayContains(group, groupcount, npwr))
|
||||
return STATE_VCC;
|
||||
int flstate;
|
||||
int flstate = STATE_UNDEFINED;
|
||||
int i;
|
||||
for (i = 0; i < groupcount; i++) {
|
||||
int nn = group[i];
|
||||
|
@ -490,6 +490,7 @@ readDataBus()
|
|||
void
|
||||
mWrite(uint16_t a, uint8_t d)
|
||||
{
|
||||
printf("POKE $0x%04X, $%02X\n", a, d);
|
||||
memory[a] = d;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user