mirror of
https://github.com/trebonian/visual6502.git
synced 2025-07-09 05:24:02 +00:00
Compare commits
88 Commits
Author | SHA1 | Date | |
---|---|---|---|
d8ecc129b3 | |||
d14ade8be8 | |||
bc5da26ea2 | |||
15911b02b4 | |||
badcf8e40b | |||
8097137323 | |||
5b86a57c2c | |||
0d4cb75658 | |||
cb7815e1ad | |||
7ee143a906 | |||
52540e3c12 | |||
f33937cc92 | |||
deb6833f8a | |||
296cd01f84 | |||
8e799d6922 | |||
a4ed7a9178 | |||
9795b463ac | |||
b384fb552f | |||
bf63c33552 | |||
9760663cc1 | |||
3ae93282ba | |||
ab53a12b2e | |||
a92f443ac1 | |||
86e6e116d7 | |||
f360557572 | |||
5005774b1b | |||
924074e305 | |||
b0c40b9e7b | |||
74762264c1 | |||
6fcb3077eb | |||
cbebb0e11d | |||
2612132999 | |||
8327a36826 | |||
886efe1d5a | |||
d9c92ebdc3 | |||
651a1753b7 | |||
f5cada53f7 | |||
7d579fa4aa | |||
e33f40e60c | |||
379d2d1ea1 | |||
59792d75fc | |||
225b49a6d8 | |||
3de51801ea | |||
2f882d7d34 | |||
b9e235fac2 | |||
0e4c3e0ab0 | |||
767e2492be | |||
95f9d52306 | |||
646f22b79e | |||
2ff43fafb3 | |||
8a9fe6f57e | |||
3315f309a7 | |||
85058171b2 | |||
7a0cb72539 | |||
0a6866f10c | |||
5b15e2d6c9 | |||
e6e446a256 | |||
bd0356f2a0 | |||
096f6bbcf8 | |||
698312b98e | |||
bd45334147 | |||
7efe4fb8c7 | |||
ef0a714a29 | |||
e0547e6c35 | |||
76edc1186a | |||
c1409b78cb | |||
d39bab7302 | |||
587fa47d8a | |||
27d0eb8fb2 | |||
90f57631c0 | |||
cba0c7a6b5 | |||
c2348c5f63 | |||
4bb43bfd0e | |||
8d50388828 | |||
1f78e25b3a | |||
4364604b96 | |||
2147762ee4 | |||
651d8a44c5 | |||
51d6bb216b | |||
3b7fbe4385 | |||
f3cffeeed6 | |||
a2a4bc65c5 | |||
815e972d14 | |||
9f4f922e16 | |||
27bec1bfe5 | |||
976fe7e430 | |||
72ac2caf74 | |||
df33b88c56 |
182
3rdparty/jquery.cookie.js
vendored
182
3rdparty/jquery.cookie.js
vendored
@ -1,92 +1,92 @@
|
||||
/**
|
||||
* Cookie plugin
|
||||
*
|
||||
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a cookie with the given name and value and other optional parameters.
|
||||
*
|
||||
* @example $.cookie('the_cookie', 'the_value');
|
||||
* @desc Set the value of a cookie.
|
||||
* @example $.cookie('the_cookie', 'the_value', {expires: 7, path: '/', domain: 'jquery.com', secure: true});
|
||||
* @desc Create a cookie with all available options.
|
||||
* @example $.cookie('the_cookie', 'the_value');
|
||||
* @desc Create a session cookie.
|
||||
* @example $.cookie('the_cookie', null);
|
||||
* @desc Delete a cookie by passing null as value.
|
||||
*
|
||||
* @param String name The name of the cookie.
|
||||
* @param String value The value of the cookie.
|
||||
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
|
||||
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
|
||||
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
|
||||
* If set to null or omitted, the cookie will be a session cookie and will not be retained
|
||||
* when the the browser exits.
|
||||
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
|
||||
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
|
||||
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
|
||||
* require a secure protocol (like HTTPS).
|
||||
* @type undefined
|
||||
*
|
||||
* @name $.cookie
|
||||
* @cat Plugins/Cookie
|
||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get the value of a cookie with the given name.
|
||||
*
|
||||
* @example $.cookie('the_cookie');
|
||||
* @desc Get the value of a cookie.
|
||||
*
|
||||
* @param String name The name of the cookie.
|
||||
* @return The value of the cookie.
|
||||
* @type String
|
||||
*
|
||||
* @name $.cookie
|
||||
* @cat Plugins/Cookie
|
||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
||||
*/
|
||||
jQuery.cookie = function(name, value, options) {
|
||||
if (typeof value != 'undefined') { // name and value given, set cookie
|
||||
options = options || {};
|
||||
if (value === null) {
|
||||
value = '';
|
||||
options.expires = -1;
|
||||
}
|
||||
var expires = '';
|
||||
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
|
||||
var date;
|
||||
if (typeof options.expires == 'number') {
|
||||
date = new Date();
|
||||
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
|
||||
} else {
|
||||
date = options.expires;
|
||||
}
|
||||
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
|
||||
}
|
||||
var path = options.path ? '; path=' + options.path : '';
|
||||
var domain = options.domain ? '; domain=' + options.domain : '';
|
||||
var secure = options.secure ? '; secure' : '';
|
||||
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
|
||||
} else { // only name given, get cookie
|
||||
var cookieValue = null;
|
||||
if (document.cookie && document.cookie != '') {
|
||||
var cookies = document.cookie.split(';');
|
||||
for (var i = 0; i < cookies.length; i++) {
|
||||
var cookie = jQuery.trim(cookies[i]);
|
||||
// Does this cookie string begin with the name we want?
|
||||
if (cookie.substring(0, name.length + 1) == (name + '=')) {
|
||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cookieValue;
|
||||
}
|
||||
/**
|
||||
* Cookie plugin
|
||||
*
|
||||
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a cookie with the given name and value and other optional parameters.
|
||||
*
|
||||
* @example $.cookie('the_cookie', 'the_value');
|
||||
* @desc Set the value of a cookie.
|
||||
* @example $.cookie('the_cookie', 'the_value', {expires: 7, path: '/', domain: 'jquery.com', secure: true});
|
||||
* @desc Create a cookie with all available options.
|
||||
* @example $.cookie('the_cookie', 'the_value');
|
||||
* @desc Create a session cookie.
|
||||
* @example $.cookie('the_cookie', null);
|
||||
* @desc Delete a cookie by passing null as value.
|
||||
*
|
||||
* @param String name The name of the cookie.
|
||||
* @param String value The value of the cookie.
|
||||
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
|
||||
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
|
||||
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
|
||||
* If set to null or omitted, the cookie will be a session cookie and will not be retained
|
||||
* when the the browser exits.
|
||||
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
|
||||
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
|
||||
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
|
||||
* require a secure protocol (like HTTPS).
|
||||
* @type undefined
|
||||
*
|
||||
* @name $.cookie
|
||||
* @cat Plugins/Cookie
|
||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get the value of a cookie with the given name.
|
||||
*
|
||||
* @example $.cookie('the_cookie');
|
||||
* @desc Get the value of a cookie.
|
||||
*
|
||||
* @param String name The name of the cookie.
|
||||
* @return The value of the cookie.
|
||||
* @type String
|
||||
*
|
||||
* @name $.cookie
|
||||
* @cat Plugins/Cookie
|
||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
||||
*/
|
||||
jQuery.cookie = function(name, value, options) {
|
||||
if (typeof value != 'undefined') { // name and value given, set cookie
|
||||
options = options || {};
|
||||
if (value === null) {
|
||||
value = '';
|
||||
options.expires = -1;
|
||||
}
|
||||
var expires = '';
|
||||
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
|
||||
var date;
|
||||
if (typeof options.expires == 'number') {
|
||||
date = new Date();
|
||||
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
|
||||
} else {
|
||||
date = options.expires;
|
||||
}
|
||||
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
|
||||
}
|
||||
var path = options.path ? '; path=' + options.path : '';
|
||||
var domain = options.domain ? '; domain=' + options.domain : '';
|
||||
var secure = options.secure ? '; secure' : '';
|
||||
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
|
||||
} else { // only name given, get cookie
|
||||
var cookieValue = null;
|
||||
if (document.cookie && document.cookie != '') {
|
||||
var cookies = document.cookie.split(';');
|
||||
for (var i = 0; i < cookies.length; i++) {
|
||||
var cookie = jQuery.trim(cookies[i]);
|
||||
// Does this cookie string begin with the name we want?
|
||||
if (cookie.substring(0, name.length + 1) == (name + '=')) {
|
||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cookieValue;
|
||||
}
|
||||
};
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 2.6 MiB |
4
README
4
README
@ -1,10 +1,10 @@
|
||||
This is the JavaScript simulator from the visual5602.org project:
|
||||
This is the JavaScript simulator from the visual6502.org project:
|
||||
www.visual6502.org/JSSim
|
||||
|
||||
It includes a general purpose transistor-level simulator, layout browser,
|
||||
and the data from a 6502 revD chip.
|
||||
|
||||
Recently added: polygon data for the 6800 chip. The simulation is not yet working,
|
||||
It also includes a similar simulator for the 6800 chip.
|
||||
|
||||
Note the various licenses and Copyright associated with each file.
|
||||
|
||||
|
@ -4,7 +4,9 @@
|
||||
|
||||
chipname='6800';
|
||||
|
||||
grChipSize=7000;
|
||||
grChipSize=6600;
|
||||
grChipOffsetX=25
|
||||
grChipOffsetY=-200;
|
||||
|
||||
ngnd = nodenames['gnd'];
|
||||
npwr = nodenames['vcc'];
|
||||
|
@ -4,20 +4,26 @@ testprogramAddress=0x0000;
|
||||
// we want to auto-clear the console if any output is sent by the program
|
||||
var consoleboxStream="";
|
||||
|
||||
// for opcodes, see ftp://ftp.comlab.ox.ac.uk/pub/Cards/txt/6800.txt
|
||||
// demonstrate write hook
|
||||
writeTriggers[0x8000]="consoleboxStream += String.fromCharCode(d);"+
|
||||
"consolebox.innerHTML = consoleboxStream;";
|
||||
|
||||
// demonstrate read hook (not used by this test program)
|
||||
readTriggers[0x8004]="((consolegetc==undefined)?0:0xff)"; // return zero until we have a char
|
||||
readTriggers[0x8000]="var c=consolegetc; consolegetc=undefined; (c)";
|
||||
|
||||
// for opcodes, see http://www.textfiles.com/programming/CARDS/6800
|
||||
|
||||
testprogram = [
|
||||
0xce, 0x43, 0x21, // LDX #4321
|
||||
0x35, // TXS
|
||||
0xc6, 0xfb, // LDAB #$FB
|
||||
0xce, 0x80, 0x00, // LDX #8000
|
||||
0xc6, 0x40, // LDAB #$40
|
||||
0xbd, 0x00, 0x10, // JSR $0010
|
||||
0x7e, 0x00, 0x04, // JMP $0004
|
||||
0x7e, 0x00, 0x09, // JMP $0009
|
||||
0x01, // NOP
|
||||
0x01, // NOP
|
||||
0x01, // NOP
|
||||
0x01, // NOP
|
||||
0x08, // INX
|
||||
0x4a, // DECA
|
||||
0xe7, 0x00, // STAB 0, X
|
||||
0x7c, 0x00, 0x0f, // INC $0F
|
||||
0x0d, // SEC
|
||||
0xc9, 0x02, // ADCB #$02
|
||||
|
530
chip-z80/nodenames.js
Normal file
530
chip-z80/nodenames.js
Normal file
@ -0,0 +1,530 @@
|
||||
// ***********************************************************
|
||||
// * This file is automatically generated by Z80Simulator. *
|
||||
// * Please do not manually edit! Instead, find a transistor *
|
||||
// * that uses the new signal and use FindTransistor(x,y) in *
|
||||
// * Z80Simulator to cause that signal to be added. *
|
||||
// * This seems a pain, but it has two advantages: *
|
||||
// * - all signals are then available in Z80Simulator *
|
||||
// * - it avoids renumbering issues if/when the PNGs change *
|
||||
// ***********************************************************
|
||||
var nodenames ={
|
||||
// Pads
|
||||
vss: 1,
|
||||
vcc: 2,
|
||||
clk: 3,
|
||||
ab0: 5,
|
||||
ab1: 6,
|
||||
ab2: 7,
|
||||
ab3: 8,
|
||||
ab4: 9,
|
||||
ab5: 10,
|
||||
ab6: 11,
|
||||
ab7: 12,
|
||||
ab8: 13,
|
||||
ab9: 14,
|
||||
ab10: 15,
|
||||
ab11: 16,
|
||||
ab12: 17,
|
||||
ab13: 18,
|
||||
ab14: 19,
|
||||
ab15: 20,
|
||||
_reset: 21,
|
||||
_wait: 22,
|
||||
wait: 22,
|
||||
_int: 23,
|
||||
int: 23,
|
||||
_irq: 23,
|
||||
irq: 23,
|
||||
_nmi: 24,
|
||||
nmi: 24,
|
||||
_busrq: 25,
|
||||
busrq: 25,
|
||||
_m1: 26,
|
||||
_rd: 27,
|
||||
_wr: 28,
|
||||
_mreq: 29,
|
||||
_iorq: 30,
|
||||
_rfsh: 31,
|
||||
db0: 32,
|
||||
db1: 33,
|
||||
db2: 34,
|
||||
db3: 35,
|
||||
db4: 36,
|
||||
db5: 37,
|
||||
db6: 38,
|
||||
db7: 39,
|
||||
_halt: 40,
|
||||
_busak: 41,
|
||||
// T-States
|
||||
t1: 115,
|
||||
t2: 137,
|
||||
t3: 144,
|
||||
t4: 166,
|
||||
t5: 134,
|
||||
t6: 168,
|
||||
// Machine cycles
|
||||
m1: 155,
|
||||
m2: 173,
|
||||
m3: 163,
|
||||
m4: 159,
|
||||
m5: 209,
|
||||
m6: 210,
|
||||
// EXX latches
|
||||
ex_af: 631,
|
||||
ex_bcdehl: 1770,
|
||||
ex_dehl0: 625,
|
||||
ex_dehl1: 629,
|
||||
ex_dehl_combined: 626,
|
||||
// Registers
|
||||
reg_a0: 2245,
|
||||
reg_a1: 2319,
|
||||
reg_a2: 2357,
|
||||
reg_a3: 2442,
|
||||
reg_a4: 2463,
|
||||
reg_a5: 2552,
|
||||
reg_a6: 2586,
|
||||
reg_a7: 2656,
|
||||
reg_f0: 1827,
|
||||
reg_f1: 1903,
|
||||
reg_f2: 1928,
|
||||
reg_f3: 2009,
|
||||
reg_f4: 2032,
|
||||
reg_f5: 2107,
|
||||
reg_f6: 2132,
|
||||
reg_f7: 2209,
|
||||
reg_b0: 2242,
|
||||
reg_b1: 2316,
|
||||
reg_b2: 2354,
|
||||
reg_b3: 2439,
|
||||
reg_b4: 2460,
|
||||
reg_b5: 2549,
|
||||
reg_b6: 2583,
|
||||
reg_b7: 2653,
|
||||
reg_c0: 1824,
|
||||
reg_c1: 1900,
|
||||
reg_c2: 1925,
|
||||
reg_c3: 2006,
|
||||
reg_c4: 2029,
|
||||
reg_c5: 2104,
|
||||
reg_c6: 2129,
|
||||
reg_c7: 2206,
|
||||
reg_d0: 2238,
|
||||
reg_d1: 2312,
|
||||
reg_d2: 2350,
|
||||
reg_d3: 2435,
|
||||
reg_d4: 2456,
|
||||
reg_d5: 2545,
|
||||
reg_d6: 2579,
|
||||
reg_d7: 2649,
|
||||
reg_e0: 1820,
|
||||
reg_e1: 1896,
|
||||
reg_e2: 1921,
|
||||
reg_e3: 2002,
|
||||
reg_e4: 2025,
|
||||
reg_e5: 2100,
|
||||
reg_e6: 2125,
|
||||
reg_e7: 2202,
|
||||
reg_h0: 2240,
|
||||
reg_h1: 2314,
|
||||
reg_h2: 2352,
|
||||
reg_h3: 2437,
|
||||
reg_h4: 2458,
|
||||
reg_h5: 2547,
|
||||
reg_h6: 2581,
|
||||
reg_h7: 2651,
|
||||
reg_l0: 1822,
|
||||
reg_l1: 1898,
|
||||
reg_l2: 1923,
|
||||
reg_l3: 2004,
|
||||
reg_l4: 2027,
|
||||
reg_l5: 2102,
|
||||
reg_l6: 2127,
|
||||
reg_l7: 2204,
|
||||
reg_w0: 2234,
|
||||
reg_w1: 2308,
|
||||
reg_w2: 2346,
|
||||
reg_w3: 2431,
|
||||
reg_w4: 2452,
|
||||
reg_w5: 2541,
|
||||
reg_w6: 2575,
|
||||
reg_w7: 2645,
|
||||
reg_z0: 1816,
|
||||
reg_z1: 1892,
|
||||
reg_z2: 1917,
|
||||
reg_z3: 1998,
|
||||
reg_z4: 2021,
|
||||
reg_z5: 2096,
|
||||
reg_z6: 2121,
|
||||
reg_z7: 2198,
|
||||
reg_pch0: 2232,
|
||||
reg_pch1: 2306,
|
||||
reg_pch2: 2344,
|
||||
reg_pch3: 2429,
|
||||
reg_pch4: 2450,
|
||||
reg_pch5: 2539,
|
||||
reg_pch6: 2573,
|
||||
reg_pch7: 2643,
|
||||
reg_pcl0: 1814,
|
||||
reg_pcl1: 1890,
|
||||
reg_pcl2: 1915,
|
||||
reg_pcl3: 1996,
|
||||
reg_pcl4: 2019,
|
||||
reg_pcl5: 2094,
|
||||
reg_pcl6: 2119,
|
||||
reg_pcl7: 2196,
|
||||
reg_sph0: 2235,
|
||||
reg_sph1: 2309,
|
||||
reg_sph2: 2347,
|
||||
reg_sph3: 2432,
|
||||
reg_sph4: 2453,
|
||||
reg_sph5: 2542,
|
||||
reg_sph6: 2576,
|
||||
reg_sph7: 2646,
|
||||
reg_spl0: 1817,
|
||||
reg_spl1: 1893,
|
||||
reg_spl2: 1918,
|
||||
reg_spl3: 1999,
|
||||
reg_spl4: 2022,
|
||||
reg_spl5: 2097,
|
||||
reg_spl6: 2122,
|
||||
reg_spl7: 2199,
|
||||
reg_ixh0: 2237,
|
||||
reg_ixh1: 2311,
|
||||
reg_ixh2: 2349,
|
||||
reg_ixh3: 2434,
|
||||
reg_ixh4: 2455,
|
||||
reg_ixh5: 2544,
|
||||
reg_ixh6: 2578,
|
||||
reg_ixh7: 2648,
|
||||
reg_ixl0: 1819,
|
||||
reg_ixl1: 1895,
|
||||
reg_ixl2: 1920,
|
||||
reg_ixl3: 2001,
|
||||
reg_ixl4: 2024,
|
||||
reg_ixl5: 2099,
|
||||
reg_ixl6: 2124,
|
||||
reg_ixl7: 2201,
|
||||
reg_iyh0: 2236,
|
||||
reg_iyh1: 2310,
|
||||
reg_iyh2: 2348,
|
||||
reg_iyh3: 2433,
|
||||
reg_iyh4: 2454,
|
||||
reg_iyh5: 2543,
|
||||
reg_iyh6: 2577,
|
||||
reg_iyh7: 2647,
|
||||
reg_iyl0: 1818,
|
||||
reg_iyl1: 1894,
|
||||
reg_iyl2: 1919,
|
||||
reg_iyl3: 2000,
|
||||
reg_iyl4: 2023,
|
||||
reg_iyl5: 2098,
|
||||
reg_iyl6: 2123,
|
||||
reg_iyl7: 2200,
|
||||
reg_i0: 2233,
|
||||
reg_i1: 2307,
|
||||
reg_i2: 2345,
|
||||
reg_i3: 2430,
|
||||
reg_i4: 2451,
|
||||
reg_i5: 2540,
|
||||
reg_i6: 2574,
|
||||
reg_i7: 2644,
|
||||
reg_r0: 1815,
|
||||
reg_r1: 1891,
|
||||
reg_r2: 1916,
|
||||
reg_r3: 1997,
|
||||
reg_r4: 2020,
|
||||
reg_r5: 2095,
|
||||
reg_r6: 2120,
|
||||
reg_r7: 2197,
|
||||
reg_aa0: 2244,
|
||||
reg_aa1: 2318,
|
||||
reg_aa2: 2356,
|
||||
reg_aa3: 2441,
|
||||
reg_aa4: 2462,
|
||||
reg_aa5: 2551,
|
||||
reg_aa6: 2585,
|
||||
reg_aa7: 2655,
|
||||
reg_ff0: 1826,
|
||||
reg_ff1: 1902,
|
||||
reg_ff2: 1927,
|
||||
reg_ff3: 2008,
|
||||
reg_ff4: 2031,
|
||||
reg_ff5: 2106,
|
||||
reg_ff6: 2131,
|
||||
reg_ff7: 2208,
|
||||
reg_bb0: 2243,
|
||||
reg_bb1: 2317,
|
||||
reg_bb2: 2355,
|
||||
reg_bb3: 2440,
|
||||
reg_bb4: 2461,
|
||||
reg_bb5: 2550,
|
||||
reg_bb6: 2584,
|
||||
reg_bb7: 2654,
|
||||
reg_cc0: 1825,
|
||||
reg_cc1: 1901,
|
||||
reg_cc2: 1926,
|
||||
reg_cc3: 2007,
|
||||
reg_cc4: 2030,
|
||||
reg_cc5: 2105,
|
||||
reg_cc6: 2130,
|
||||
reg_cc7: 2207,
|
||||
reg_dd0: 2239,
|
||||
reg_dd1: 2313,
|
||||
reg_dd2: 2351,
|
||||
reg_dd3: 2436,
|
||||
reg_dd4: 2457,
|
||||
reg_dd5: 2546,
|
||||
reg_dd6: 2580,
|
||||
reg_dd7: 2650,
|
||||
reg_ee0: 1821,
|
||||
reg_ee1: 1897,
|
||||
reg_ee2: 1922,
|
||||
reg_ee3: 2003,
|
||||
reg_ee4: 2026,
|
||||
reg_ee5: 2101,
|
||||
reg_ee6: 2126,
|
||||
reg_ee7: 2203,
|
||||
reg_hh0: 2241,
|
||||
reg_hh1: 2315,
|
||||
reg_hh2: 2353,
|
||||
reg_hh3: 2438,
|
||||
reg_hh4: 2459,
|
||||
reg_hh5: 2548,
|
||||
reg_hh6: 2582,
|
||||
reg_hh7: 2652,
|
||||
reg_ll0: 1823,
|
||||
reg_ll1: 1899,
|
||||
reg_ll2: 1924,
|
||||
reg_ll3: 2005,
|
||||
reg_ll4: 2028,
|
||||
reg_ll5: 2103,
|
||||
reg_ll6: 2128,
|
||||
reg_ll7: 2205,
|
||||
// Data buses and control
|
||||
dp_dl: 82,
|
||||
dl_dp: 165,
|
||||
load_ir: 1354,
|
||||
dlatch0: 123,
|
||||
dlatch1: 195,
|
||||
dlatch2: 414,
|
||||
dlatch3: 930,
|
||||
dlatch4: 1000,
|
||||
dlatch5: 872,
|
||||
dlatch6: 751,
|
||||
dlatch7: 358,
|
||||
dl_d: 87,
|
||||
d_dl: 133,
|
||||
dbus0: 138,
|
||||
dbus1: 196,
|
||||
dbus2: 412,
|
||||
dbus3: 480,
|
||||
dbus4: 485,
|
||||
dbus5: 486,
|
||||
dbus6: 380,
|
||||
dbus7: 370,
|
||||
_instr0: 1350,
|
||||
_instr1: 1360,
|
||||
_instr2: 1366,
|
||||
_instr3: 1380,
|
||||
_instr4: 1388,
|
||||
_instr5: 1395,
|
||||
_instr6: 1370,
|
||||
_instr7: 1375,
|
||||
instr0: 1348,
|
||||
instr1: 1359,
|
||||
instr2: 1365,
|
||||
instr3: 1379,
|
||||
instr4: 1387,
|
||||
instr5: 1394,
|
||||
instr6: 1369,
|
||||
instr7: 1374,
|
||||
d_u: 546,
|
||||
ubus0: 545,
|
||||
ubus1: 528,
|
||||
ubus2: 526,
|
||||
ubus3: 770,
|
||||
ubus4: 779,
|
||||
ubus5: 790,
|
||||
ubus6: 716,
|
||||
ubus7: 525,
|
||||
u_v: 750,
|
||||
vbus0: 755,
|
||||
vbus1: 772,
|
||||
vbus2: 783,
|
||||
vbus3: 796,
|
||||
vbus4: 803,
|
||||
vbus5: 808,
|
||||
vbus6: 836,
|
||||
vbus7: 839,
|
||||
rl_wr: 678,
|
||||
rh_wr: 652,
|
||||
r_u: 692,
|
||||
r_v: 693,
|
||||
regbit0: 702,
|
||||
regbit1: 732,
|
||||
regbit2: 738,
|
||||
regbit3: 775,
|
||||
regbit4: 776,
|
||||
regbit5: 807,
|
||||
regbit6: 809,
|
||||
regbit7: 864,
|
||||
regbit8: 870,
|
||||
regbit9: 902,
|
||||
regbit10: 906,
|
||||
regbit11: 934,
|
||||
regbit12: 935,
|
||||
regbit13: 970,
|
||||
regbit14: 973,
|
||||
regbit15: 999,
|
||||
r_p: 1785,
|
||||
r_x1: 608,
|
||||
pcbit0: 703,
|
||||
pcbit1: 731,
|
||||
pcbit2: 739,
|
||||
pcbit3: 774,
|
||||
pcbit4: 777,
|
||||
pcbit5: 806,
|
||||
pcbit6: 810,
|
||||
pcbit7: 863,
|
||||
pcbit8: 871,
|
||||
pcbit9: 901,
|
||||
pcbit10: 907,
|
||||
pcbit11: 933,
|
||||
pcbit12: 936,
|
||||
pcbit13: 969,
|
||||
pcbit14: 974,
|
||||
pcbit15: 998,
|
||||
// ALU
|
||||
alubus0: 837,
|
||||
alubus1: 889,
|
||||
alubus2: 937,
|
||||
alubus3: 983,
|
||||
alubus4: 852,
|
||||
alubus5: 903,
|
||||
alubus6: 951,
|
||||
alubus7: 995,
|
||||
alua0: 850,
|
||||
alua1: 899,
|
||||
alua2: 947,
|
||||
alua3: 993,
|
||||
alua4: 868,
|
||||
alua5: 920,
|
||||
alua6: 968,
|
||||
alua7: 1007,
|
||||
alub0: 845,
|
||||
alub1: 897,
|
||||
alub2: 944,
|
||||
alub3: 988,
|
||||
alub4: 867,
|
||||
alub5: 918,
|
||||
alub6: 966,
|
||||
alub7: 1005,
|
||||
aluout0: 2211,
|
||||
aluout1: 2338,
|
||||
aluout2: 2504,
|
||||
aluout3: 816,
|
||||
alulat0: 865,
|
||||
alulat1: 912,
|
||||
alulat2: 960,
|
||||
alulat3: 1002,
|
||||
// PLA
|
||||
pla0: 287,
|
||||
pla1: 332,
|
||||
pla2: 314,
|
||||
pla3: 333,
|
||||
pla4: 315,
|
||||
pla5: 334,
|
||||
pla6: 316,
|
||||
pla7: 335,
|
||||
pla8: 317,
|
||||
pla9: 336,
|
||||
pla10: 318,
|
||||
pla11: 361,
|
||||
pla12: 261,
|
||||
pla13: 337,
|
||||
pla14: 319,
|
||||
pla15: 464,
|
||||
pla16: 288,
|
||||
pla17: 338,
|
||||
pla18: 320,
|
||||
pla19: 364,
|
||||
pla20: 325,
|
||||
pla21: 324,
|
||||
pla22: 308,
|
||||
pla23: 289,
|
||||
pla24: 339,
|
||||
pla25: 313,
|
||||
pla26: 340,
|
||||
pla27: 290,
|
||||
pla28: 341,
|
||||
pla29: 291,
|
||||
pla30: 342,
|
||||
pla31: 292,
|
||||
pla32: 365,
|
||||
pla33: 293,
|
||||
pla34: 362,
|
||||
pla35: 294,
|
||||
pla36: 331,
|
||||
pla37: 293,
|
||||
pla38: 343,
|
||||
pla39: 296,
|
||||
pla40: 297,
|
||||
pla41: 298,
|
||||
pla42: 344,
|
||||
pla43: 299,
|
||||
pla44: 269,
|
||||
pla45: 300,
|
||||
pla46: 237,
|
||||
pla47: 301,
|
||||
pla48: 345,
|
||||
pla49: 302,
|
||||
pla50: 346,
|
||||
pla51: 264,
|
||||
pla52: 266,
|
||||
pla53: 347,
|
||||
pla54: 303,
|
||||
pla55: 356,
|
||||
pla56: 227,
|
||||
pla57: 366,
|
||||
pla58: 304,
|
||||
pla59: 305,
|
||||
pla60: 271,
|
||||
pla61: 348,
|
||||
pla62: 306,
|
||||
pla63: 309,
|
||||
pla64: 311,
|
||||
pla65: 312,
|
||||
pla66: 307,
|
||||
pla67: 367,
|
||||
pla68: 272,
|
||||
pla69: 349,
|
||||
pla70: 273,
|
||||
pla71: 350,
|
||||
pla72: 274,
|
||||
pla73: 351,
|
||||
pla74: 275,
|
||||
pla75: 276,
|
||||
pla76: 268,
|
||||
pla77: 352,
|
||||
pla78: 277,
|
||||
pla79: 278,
|
||||
pla80: 279,
|
||||
pla81: 280,
|
||||
pla82: 368,
|
||||
pla83: 281,
|
||||
pla84: 282,
|
||||
pla85: 283,
|
||||
pla86: 284,
|
||||
pla87: 285,
|
||||
pla88: 286,
|
||||
pla89: 321,
|
||||
pla90: 353,
|
||||
pla91: 322,
|
||||
pla92: 354,
|
||||
pla93: 323,
|
||||
pla94: 369,
|
||||
pla95: 258,
|
||||
pla96: 249,
|
||||
pla97: 245,
|
||||
pla98: 355,
|
||||
}
|
14606
chip-z80/segdefs.js
Normal file
14606
chip-z80/segdefs.js
Normal file
File diff suppressed because one or more lines are too long
2570
chip-z80/support.js
Normal file
2570
chip-z80/support.js
Normal file
File diff suppressed because it is too large
Load Diff
73
chip-z80/testprogram.js
Normal file
73
chip-z80/testprogram.js
Normal file
@ -0,0 +1,73 @@
|
||||
// This file testprogram.js can be substituted by one of several tests
|
||||
testprogramAddress=0x0000;
|
||||
|
||||
// we want to auto-clear the console if any output is sent by the program
|
||||
var consoleboxStream="";
|
||||
|
||||
// demonstrate write hook
|
||||
writeTriggers[0x8000]="consoleboxStream += String.fromCharCode(d);"+
|
||||
"consolebox.innerHTML = consoleboxStream;";
|
||||
|
||||
// demonstrate read hook (not used by this test program)
|
||||
readTriggers[0x8004]="((consolegetc==undefined)?0:0xff)"; // return zero until we have a char
|
||||
readTriggers[0x8000]="var c=consolegetc; consolegetc=undefined; (c)";
|
||||
|
||||
// for opcodes, see http://www.textfiles.com/programming/CARDS/6800
|
||||
|
||||
testprogram = [
|
||||
0x00, // NOP
|
||||
0x31, 0x00, 0x01, // LD SP,0x0100
|
||||
0xCD, 0x0B, 0x00, // CALL $000B
|
||||
0x00, // NOP
|
||||
0x21, 0x78, 0x56, // LD HL,$5678
|
||||
0x21, 0x34, 0x12, // LD HL,$1234
|
||||
0xe5, // PUSH HL
|
||||
0x00, // NOP
|
||||
0x00, // NOP
|
||||
0x3C, // INC A
|
||||
0x04, // INC B
|
||||
0x15, // DEC D
|
||||
0x24, // INC H
|
||||
0xEB, // EXX DE,HL
|
||||
0x00, // NOP
|
||||
0x3C, // INC A
|
||||
0x04, // INC B
|
||||
0x15, // DEC D
|
||||
0x24, // INC H
|
||||
0xD9, // EXX
|
||||
0x00, // NOP
|
||||
0x3C, // INC A
|
||||
0x04, // INC B
|
||||
0x15, // DEC D
|
||||
0x24, // INC H
|
||||
0xEB, // EXX DE,HL
|
||||
0x00, // NOP
|
||||
0x3C, // INC A
|
||||
0x04, // INC B
|
||||
0x15, // DEC D
|
||||
0x24, // INC H
|
||||
0x08, // EXX AF,AF'
|
||||
0x00, // NOP
|
||||
0x3C, // INC A
|
||||
0x04, // INC B
|
||||
0x15, // DEC D
|
||||
0x24, // INC H
|
||||
0x00, // NOP
|
||||
0x00, // NOP
|
||||
0x00, // NOP
|
||||
0x21, 0x00, 0x01, // LD HL,$0100
|
||||
0x36, 0xCC, // LD (HL),$CC
|
||||
0x00, // NOP
|
||||
0x7E, // LD A, (HL)
|
||||
0x00, // NOP
|
||||
// Pavel's original test program
|
||||
0x21, 0x34, 0x12, // LD HL,$1234
|
||||
0x31, 0xfe, 0xdc, // LD SP,0xDCFE
|
||||
0xe5, // PUSH HL
|
||||
0x21, 0x78, 0x56, // LD HL,$5678
|
||||
0xe3, // EX (SP),HL
|
||||
0xdd, 0x21, 0xbc,0x9a, // LD IX, 0x9ABC
|
||||
0xdd, 0xe3, // EX (SP),IX
|
||||
0x76, // HALT
|
||||
0x00 // NOP
|
||||
]
|
6815
chip-z80/transdefs.js
Executable file
6815
chip-z80/transdefs.js
Executable file
File diff suppressed because it is too large
Load Diff
12
chipsim.js
12
chipsim.js
@ -143,14 +143,22 @@ function saveString(name, str){
|
||||
|
||||
function allNodes(){
|
||||
var res = new Array();
|
||||
for(var i in nodes) if((i!=npwr)&&(i!=ngnd)) res.push(i);
|
||||
var ii = 0;
|
||||
for(var i in nodes) {
|
||||
// Don't feed numeric strings to recalcNodeList(). Numeric
|
||||
// strings can cause a (data dependent) duplicate node number
|
||||
// hiccup when accumulating a node group's list, ie:
|
||||
// group => [ "49", 483, 49 ]
|
||||
ii = Number( i );
|
||||
if((ii!=npwr)&&(ii!=ngnd)) res.push(ii);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
function stateString(){
|
||||
var codes = ['l','h'];
|
||||
var res = '';
|
||||
for(var i=0;i<1725;i++){
|
||||
for(var i=0;i<nodes.length;i++){
|
||||
var n = nodes[i];
|
||||
if(n==undefined) res+='x';
|
||||
else if(i==ngnd) res+='g';
|
||||
|
@ -57,7 +57,7 @@ $().ready(function(){
|
||||
<a href="http://blog.visual6502.org">Blog</a>
|
||||
<a href="http://www.visual6502.org/links.html">Links</a>
|
||||
<a href="http://github.com/trebonian/visual6502">Source</a>
|
||||
<a href="ftp://ftp.comlab.ox.ac.uk/pub/Cards/txt/6800.txt">6800 instruction card</a>
|
||||
<a href="http://www.textfiles.com/programming/CARDS/6800">6800 instruction card</a>
|
||||
<a href="http://www.sbprojects.com/sbasm/6800.htm#model">programming model</a>
|
||||
</span>
|
||||
<div class="frame" id="frame">
|
||||
|
7306
expert-allinone.js
7306
expert-allinone.js
File diff suppressed because one or more lines are too long
151
expert-z80.html
Normal file
151
expert-z80.html
Normal file
@ -0,0 +1,151 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<head>
|
||||
<title>Visual Z80 in JavaScript</title>
|
||||
<style type="text/css">@import "expert.css";</style>
|
||||
<script src="chip-z80/segdefs.js"></script>
|
||||
<script src="chip-z80/transdefs.js"></script>
|
||||
<script src="chip-z80/nodenames.js"></script>
|
||||
<script src="wires.js"></script>
|
||||
<script src="expertWires.js"></script>
|
||||
<script src="chipsim.js"></script>
|
||||
<script src="memtable.js"></script>
|
||||
<script src="macros.js"></script>
|
||||
<script src="chip-z80/support.js"></script>
|
||||
<script src="chip-z80/testprogram.js"></script>
|
||||
<script src="3rdparty/jquery-1.3.2.min.js"></script>
|
||||
<script src="3rdparty/jquery.cookie.js"></script>
|
||||
<script src="3rdparty/splitter.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function handleOnload() {
|
||||
/MSIE (\d+\.\d+);/.test(navigator.appVersion);
|
||||
IEVersion=Number(RegExp.$1);
|
||||
if((navigator.appName == 'Microsoft Internet Explorer') && (IEVersion<9)){
|
||||
document.getElementById('browsertrouble').innerHTML=
|
||||
'<p>Sorry, '+navigator.appName+' not supported - showing you a picture instead!</p>';
|
||||
document.getElementById('frame').innerHTML='<a href="browsertrouble.html"><img src="images/jssim2.png" style="border:10px"></a>';
|
||||
}else{
|
||||
setTimeout(setup,200);
|
||||
}
|
||||
};
|
||||
|
||||
// initialise splitter (built on jquery)
|
||||
$().ready(function(){
|
||||
$("#frame").splitter({
|
||||
type: "v",
|
||||
outline: true,
|
||||
minLeft: 20,
|
||||
sizeLeft: 810,
|
||||
resizeToWidth: true,
|
||||
anchorToWindow: true,
|
||||
});
|
||||
$("#rightcolumn").splitter({
|
||||
type: "h",
|
||||
outline: true,
|
||||
sizeBottom: 180,
|
||||
minTop: 100,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="handleOnload();">
|
||||
<span id="plain">
|
||||
<a href="http://www.visual6502.org/faq.html">FAQ</a>
|
||||
<a href="http://blog.visual6502.org">Blog</a>
|
||||
<a href="http://www.visual6502.org/links.html">Links</a>
|
||||
<a href="http://github.com/trebonian/visual6502">Source</a>
|
||||
</span>
|
||||
<div class="frame" id="frame">
|
||||
<div class="leftcolumn" id="leftcolumn">
|
||||
<div id="chipsurround" tabindex="1">
|
||||
<div class="chip" id="chip">
|
||||
<span id="waiting">Please wait, graphics initialising...</span>
|
||||
<canvas class="chip" id="chipbg"></canvas>
|
||||
<canvas class="chip" id="overlay"></canvas>
|
||||
<canvas class="chip" id="hilite"></canvas>
|
||||
<canvas class="chip" id="hitbuffer"></canvas>
|
||||
</div>
|
||||
</div> <!-- chipsurround -->
|
||||
<div class="nochip" id="nochip">
|
||||
<form>
|
||||
<input type="button" value="Show chip layout" onclick="updateChipLayoutVisibility(true)" />
|
||||
</form>
|
||||
</div>
|
||||
<div id="layoutControlPanel">
|
||||
Use 'z' or '>' to zoom in, 'x' or '<' to zoom out, click to probe signals and drag to pan.
|
||||
<form id="updateShow"> Show:
|
||||
<input type="checkbox" name="1" id="updateShow1" onchange="updateShow(this.name,this.checked)" />(diffusion)
|
||||
<input type="checkbox" name="3" id="updateShow3" onchange="updateShow(this.name,this.checked)" />(grounded diffusion)
|
||||
<input type="checkbox" name="4" id="updateShow4" onchange="updateShow(this.name,this.checked)" />(powered diffusion)
|
||||
<input type="checkbox" name="5" id="updateShow5" onchange="updateShow(this.name,this.checked)" />(polysilicon)
|
||||
<input type="checkbox" name="0" id="updateShow0" onchange="updateShow(this.name,this.checked)" />(metal)
|
||||
<input type="checkbox" name="2" id="updateShow2" onchange="updateShow(this.name,this.checked)" />(protection)
|
||||
</form>
|
||||
<form action="javascript:hiliteNodeList();">
|
||||
<input type="button" value="Find:" onclick="hiliteNodeList();" />
|
||||
<input type="text" id="HighlightThese" name="HighlightThese" value="" />
|
||||
<input type="button" value="Clear Highlighting" onclick="clearHighlight();" />
|
||||
<span class="animatebox">
|
||||
Animate during simulation:
|
||||
<input type="checkbox" id="animateModeCheckbox" onchange="updateChipLayoutAnimation(this.checked)"
|
||||
/></span>
|
||||
</form>
|
||||
<form>
|
||||
<input type="button" value="Hide Chip Layout" onclick="updateChipLayoutVisibility(false)" />
|
||||
<a href="" id="linkHere" >Link to this location</a>
|
||||
</form>
|
||||
</div>
|
||||
</div> <!-- closing leftcolumn -->
|
||||
<div class="rightcolumn" id="rightcolumn">
|
||||
<div id="righttopdiv">
|
||||
<div class = "buttons">
|
||||
<div class="twobuttons">
|
||||
<a href ="javascript:stopChip()" id="stop"><img class="navstop" src="images/stop.png" title="stop"></a>
|
||||
<a href ="javascript:runChip()" id="start"><img class="navplay" src="images/play.png" title="run"></a>
|
||||
</div>
|
||||
<div class="morebuttons">
|
||||
<a href ="javascript:resetChip()"><img class="navbutton" src="images/up.png" title="reset"></a>
|
||||
<a href ="javascript:stepBack()"><img class="navbutton" src="images/prev.png" title="back"></a>
|
||||
<a href ="javascript:stepForward()"><img class="navbutton" src="images/next.png" title="forward"></a>
|
||||
<a href ="javascript:goUntilSyncOrWrite()"><img class="navbutton" src="images/singlestep.png" title="step"></a>
|
||||
<a href ="javascript:goFor()"><img class="navbutton" src="images/fastforward.png" title="fastforward"></a>
|
||||
</div>
|
||||
<div style="float:right;">
|
||||
<a href="http://visual6502.org/wiki/index.php?title=JssimUserHelp" target="_blank">User Guide</a>
|
||||
|
||||
</div>
|
||||
</div> <!-- buttons -->
|
||||
<div class="status" id="status"><p>x: 0<br>y: 0</p>
|
||||
</div> <!-- status -->
|
||||
|
||||
<div id="memtablediv">
|
||||
<table class="memtable" id="memtable" tabindex="2"></table>
|
||||
</div>
|
||||
</div> <!-- righttopdiv -->
|
||||
|
||||
<div id="tracingdiv">
|
||||
<textarea id="consolebox">
|
||||
click here and type if your program handles input
|
||||
</textarea>
|
||||
<div id="expertControlPanel" tabindex="3">
|
||||
<form action="javascript:updateLogList()">
|
||||
<input type="button" value="Trace more" onclick="updateLoglevel(++loglevel)" />
|
||||
<input type="button" value="Trace less" onclick="updateLoglevel(--loglevel)" />
|
||||
<input type="button" value="Trace these too:" onclick="updateLogList()" />
|
||||
<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)" />
|
||||
</form>
|
||||
<br />
|
||||
</div>
|
||||
<div id="logstreamscroller">
|
||||
<table class="logstream" id="logstream"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- closing rightcolumn -->
|
||||
</div> <!-- closing 'frame' div -->
|
||||
</body>
|
||||
</html>
|
20
expert.html
20
expert.html
@ -56,8 +56,8 @@ $().ready(function(){
|
||||
<a href="http://blog.visual6502.org">Blog</a>
|
||||
<a href="http://www.visual6502.org/links.html">Links</a>
|
||||
<a href="http://github.com/trebonian/visual6502">Source</a>
|
||||
<a href="http://skilldrick.github.com/easy6502/#first-program">easy6502 assembler</a>
|
||||
<a href="http://www.e-tradition.net/bytes/6502/disassembler.html">e-tradition disassembler</a>
|
||||
<a href="http://skilldrick.github.io/easy6502/#first-program">easy6502 assembler</a>
|
||||
<a href="http://www.masswerk.at/6502/disassembler.html">mass:werk disassembler</a>
|
||||
</span>
|
||||
<div class="frame" id="frame">
|
||||
<div class="leftcolumn" id="leftcolumn">
|
||||
@ -78,19 +78,19 @@ $().ready(function(){
|
||||
<div id="layoutControlPanel">
|
||||
Use 'z' or '>' to zoom in, 'x' or '<' to zoom out, click to probe signals and drag to pan.
|
||||
<form id="updateShow"> Show:
|
||||
<input type="checkbox" name="1" id="updateShow1" onchange="updateShow(this.name,this.checked)" />(diffusion)
|
||||
<input type="checkbox" name="3" id="updateShow3" onchange="updateShow(this.name,this.checked)" />(grounded diffusion)
|
||||
<input type="checkbox" name="4" id="updateShow4" onchange="updateShow(this.name,this.checked)" />(powered diffusion)
|
||||
<input type="checkbox" name="5" id="updateShow5" onchange="updateShow(this.name,this.checked)" />(polysilicon)
|
||||
<input type="checkbox" name="0" id="updateShow0" onchange="updateShow(this.name,this.checked)" />(metal)
|
||||
<input type="checkbox" name="2" id="updateShow2" onchange="updateShow(this.name,this.checked)" />(protection)
|
||||
<input type="checkbox" name="1" id="updateShow1" onchange="updateShow(this.name,this.checked)" /><label for="updateShow1">(diffusion)</label>
|
||||
<input type="checkbox" name="3" id="updateShow3" onchange="updateShow(this.name,this.checked)" /><label for="updateShow3">(grounded diffusion)</label>
|
||||
<input type="checkbox" name="4" id="updateShow4" onchange="updateShow(this.name,this.checked)" /><label for="updateShow4">(powered diffusion)</label>
|
||||
<input type="checkbox" name="5" id="updateShow5" onchange="updateShow(this.name,this.checked)" /><label for="updateShow5">(polysilicon)</label>
|
||||
<input type="checkbox" name="0" id="updateShow0" onchange="updateShow(this.name,this.checked)" /><label for="updateShow0">(metal)</label>
|
||||
<input type="checkbox" name="2" id="updateShow2" onchange="updateShow(this.name,this.checked)" /><label for="updateShow2">(protection)</label>
|
||||
</form>
|
||||
<form action="javascript:hiliteNodeList();">
|
||||
<input type="button" value="Find:" onclick="hiliteNodeList();" />
|
||||
<input type="text" id="HighlightThese" name="HighlightThese" value="" />
|
||||
<input type="button" value="Clear Highlighting" onclick="clearHighlight();" />
|
||||
<span class="animatebox">
|
||||
Animate during simulation:
|
||||
<label for="animateModeCheckbox">Animate during simulation:</label>
|
||||
<input type="checkbox" id="animateModeCheckbox" onchange="updateChipLayoutAnimation(this.checked)"
|
||||
/></span>
|
||||
</form>
|
||||
@ -115,7 +115,7 @@ $().ready(function(){
|
||||
<a href ="javascript:goFor()"><img class="navbutton" src="images/fastforward.png" title="fastforward"></a>
|
||||
</div>
|
||||
<div style="float:right;">
|
||||
<a href="http://visual6502.org/wiki/index.php?title=JssimUserHelp" target="_blank">User Guide</a>
|
||||
<a href="https://web.archive.org/web/20210608195625/http://visual6502.org/wiki/index.php?title=JssimUserHelp" target="_blank">User Guide</a>
|
||||
|
||||
</div>
|
||||
</div> <!-- buttons -->
|
||||
|
@ -37,12 +37,14 @@ var labelThese=[];
|
||||
// overlay - a red/white transparency to show logic high or low
|
||||
// hilite - to show the selected polygon
|
||||
// hitbuffer - abusing color values to return which polygon is under a point
|
||||
// we no longer use a scaling transform - we now scale the chip data at
|
||||
// we no longer use a scaling transform - we now scale the chip data at
|
||||
// the point of drawing line segments
|
||||
// if the canvas is any smaller than chip coordinates there will be
|
||||
// rounding artifacts, and at high zoom there will be anti-aliasing on edges.
|
||||
var grMaxZoom=12;
|
||||
var grChipSize=10000;
|
||||
var grChipOffsetX=400;
|
||||
var grChipOffsetY=0;
|
||||
var grCanvasSize=2000;
|
||||
var grLineWidth=1;
|
||||
|
||||
@ -51,7 +53,7 @@ var layernames = ['metal', 'switched diffusion', 'inputdiode', 'grounded diffusi
|
||||
var colors = ['rgba(128,128,192,0.4)','#FFFF00','#FF00FF','#4DFF4D',
|
||||
'#FF4D4D','#801AC0','rgba(128,0,255,0.75)'];
|
||||
var drawlayers = [true, true, true, true, true, true];
|
||||
|
||||
|
||||
// some modes and parameters which can be passed in from the URL query
|
||||
var moveHereFirst;
|
||||
var expertMode=true;
|
||||
@ -210,6 +212,24 @@ function setupParams(){
|
||||
clockTriggers[value]=[clockTriggers[value],"setLow('rdy');"].join("");
|
||||
} else if(name=="rdy1" && parseInt(value)!=NaN){
|
||||
clockTriggers[value]=[clockTriggers[value],"setHigh('rdy');"].join("");
|
||||
} else if(name=="so0" && parseInt(value)!=NaN){
|
||||
clockTriggers[value]=[clockTriggers[value],"setLow('so');"].join("");
|
||||
} else if(name=="so1" && parseInt(value)!=NaN){
|
||||
clockTriggers[value]=[clockTriggers[value],"setHigh('so');"].join("");
|
||||
// Some Z80 inputs - we can refactor if this becomes unwieldy
|
||||
} else if(name=="int0" && parseInt(value)!=NaN){
|
||||
clockTriggers[value]=[clockTriggers[value],"setLow('int');"].join("");
|
||||
} else if(name=="int1" && parseInt(value)!=NaN){
|
||||
clockTriggers[value]=[clockTriggers[value],"setHigh('int');"].join("");
|
||||
} else if(name=="wait0" && parseInt(value)!=NaN){
|
||||
clockTriggers[value]=[clockTriggers[value],"setLow('wait');"].join("");
|
||||
} else if(name=="wait1" && parseInt(value)!=NaN){
|
||||
clockTriggers[value]=[clockTriggers[value],"setHigh('wait');"].join("");
|
||||
} else if(name=="busrq0" && parseInt(value)!=NaN){
|
||||
clockTriggers[value]=[clockTriggers[value],"setLow('busrq');"].join("");
|
||||
} else if(name=="busrq1" && parseInt(value)!=NaN){
|
||||
clockTriggers[value]=[clockTriggers[value],"setHigh('busrq');"].join("");
|
||||
//
|
||||
} else if(name=="time" && parseInt(value)!=NaN){
|
||||
eventTime=value;
|
||||
} else if(name=="databus" && parseInt(value)!=NaN){
|
||||
@ -257,13 +277,22 @@ function handleKey(e){
|
||||
else if(c=='p') stepBack();
|
||||
}
|
||||
|
||||
// handler for zoom in/out using the mouse wheel
|
||||
function handleWheelZoom(e){
|
||||
chipsurround.focus();
|
||||
e.preventDefault();
|
||||
var n = e.deltaY / 100;
|
||||
if(n>0 && zoom>1) setZoom(zoom/1.2);
|
||||
if(n<0 && zoom<grMaxZoom) setZoom(zoom*1.2);
|
||||
}
|
||||
|
||||
// handler for mousedown events over chip display
|
||||
// must handle click-to-select (and focus), and drag to pan
|
||||
function mouseDown(e){
|
||||
chipsurround.focus();
|
||||
e.preventDefault();
|
||||
moved=false;
|
||||
dragMouseX = e.clientX;
|
||||
moved=false;
|
||||
dragMouseX = e.clientX;
|
||||
dragMouseY = e.clientY;
|
||||
chipsurround.onmousemove = function(e){mouseMove(e)};
|
||||
chipsurround.onmouseup = function(e){mouseUp(e)};
|
||||
@ -286,7 +315,7 @@ function mouseMove(e){
|
||||
}
|
||||
|
||||
function mouseUp(e){
|
||||
if(!moved) handleClick(e);
|
||||
if(!moved) handleClick(e);
|
||||
chipsurround.onmousemove = undefined;
|
||||
chipsurround.onmouseup = undefined;
|
||||
}
|
||||
@ -330,8 +359,8 @@ function updateLinkHere(){
|
||||
// boxLabel(['PD', 50, 8424, 3536, 9256, 2464])
|
||||
// boxLabel(['IR', 50, 8432, 2332, 9124, 984])
|
||||
// boxLabel(['PLA', 100, 1169, 2328, 8393, 934])
|
||||
// boxLabel(['Y', 50, 2143, 8820, 2317, 5689])
|
||||
// boxLabel(['X', 50, 2317, 8820, 2490, 5689])
|
||||
// boxLabel(['Y', 50, 2143, 8820, 2317, 5689])
|
||||
// boxLabel(['X', 50, 2317, 8820, 2490, 5689])
|
||||
// boxLabel(['S', 50, 2490, 8820, 2814, 5689])
|
||||
// boxLabel(['ALU', 50, 2814, 8820, 4525, 5689])
|
||||
// boxLabel(['DAdj', 40, 4525, 8820, 5040, 5689])
|
||||
@ -457,7 +486,7 @@ function hiliteNodeList(){
|
||||
// the localx and localy functions return canvas coordinate offsets from the canvas window top left corner
|
||||
// we divide the results by 'zoom' to get drawn coordinates useful in findNodeNumber
|
||||
// to convert to reported user chip coordinates we multiply by grChipSize/600
|
||||
// to compare to segdefs and transdefs coordinates we subtract 400 from x and subtract y from grChipSize
|
||||
// to compare to segdefs and transdefs coordinates we subtract grChipOffsetX from x and subtract y from grChipSize plus grChipOffsetY
|
||||
|
||||
function handleClick(e){
|
||||
var x = localx(hilite, e.clientX)/zoom;
|
||||
@ -467,7 +496,7 @@ function handleClick(e){
|
||||
var cx = Math.round(x*grChipSize/600);
|
||||
var cy = Math.round(y*grChipSize/600);
|
||||
// prepare two lines of status report
|
||||
var s1='x: ' + cx + ' y: ' + cy;
|
||||
var s1='x: ' + (cx - grChipOffsetX) + ' y: ' + (cy - grChipOffsetY);
|
||||
var s2='node: ' + w + ' ' + nodeName(w);
|
||||
if(w==-1) {
|
||||
setStatus(s1); // no node found, so report only coordinates
|
||||
@ -476,8 +505,8 @@ function handleClick(e){
|
||||
// we have a node, but maybe we clicked over a transistor
|
||||
var nodelist=[w];
|
||||
// match the coordinate against transistor gate bounding boxes
|
||||
x=cx-400;
|
||||
y=grChipSize-cy;
|
||||
x=cx-grChipOffsetX;
|
||||
y=grChipSize+grChipOffsetY-cy;
|
||||
for(var i=0;i<nodes[w].gates.length;i++){
|
||||
var xmin=nodes[w].gates[i].bb[0], xmax=nodes[w].gates[i].bb[1];
|
||||
var ymin=nodes[w].gates[i].bb[2], ymax=nodes[w].gates[i].bb[3];
|
||||
@ -579,8 +608,10 @@ function setupChipLayoutGraphics(){
|
||||
}
|
||||
// grant focus to the chip display to enable zoom keys
|
||||
chipsurround.focus();
|
||||
chipsurround.onwheel = function(e){handleWheelZoom(e);};
|
||||
chipsurround.onmousedown = function(e){mouseDown(e);};
|
||||
chipsurround.onkeypress = function(e){handleKey(e);};
|
||||
chipsurround.onmouseout = function(e){mouseLeave(e);};
|
||||
}
|
||||
|
||||
// utility function to save graphics pan and zoom
|
||||
|
@ -66,13 +66,13 @@ Keyboard controls: 'z' to zoom in, 'x' to zoom out, 'n' to step the simulation.
|
||||
<br />
|
||||
Mouse controls: Left-click and drag to scroll around (when you're zoomed in.)
|
||||
<br />
|
||||
More information in the <a href="http://visual6502.org/wiki/index.php?title=JssimUserHelp">User Guide</a>.
|
||||
More information in the <a href="https://web.archive.org/web/20210608195625/http://visual6502.org/wiki/index.php?title=JssimUserHelp">User Guide</a>.
|
||||
<br />
|
||||
<br />
|
||||
</span>
|
||||
<div class="frame" id="frame">
|
||||
<div class="chip" id="chip">
|
||||
<object data="6502N.svg" type="image/svg+xml" id="chipbg" style="position: absolute; width: 600px; height:600px;"></object>
|
||||
<canvas class="chip" id="chipbg"></canvas>
|
||||
<canvas class="chip" id="overlay"></canvas>
|
||||
<canvas class="chip" id="hilite"></canvas>
|
||||
<canvas class="chip" id="hitbuffer"></canvas>
|
||||
@ -97,8 +97,8 @@ More information in the <a href="http://visual6502.org/wiki/index.php?title=Jssi
|
||||
<br />
|
||||
<br />
|
||||
Source code is available on <a href="http://github.com/trebonian/visual6502">github visual6502</a>.
|
||||
Use the online <a href="http://skilldrick.github.com/easy6502/#first-program">emulator and assembler</a> from the easy6502 tutorial
|
||||
and <a href="http://www.e-tradition.net/bytes/6502/disassembler.html">disassembler</a> from e-tradition.net
|
||||
Use the online <a href="https://skilldrick.github.io/easy6502/#first-program">emulator and assembler</a> from the easy6502 tutorial
|
||||
and <a href="http://www.masswerk.at/6502/disassembler.html">disassembler</a> from mass:werk
|
||||
<br />
|
||||
For in-depth 6502 investigation and some more advanced features, try our <a href="expert.html">Advanced</a> page.
|
||||
<br />
|
||||
|
11
kiosk.css
11
kiosk.css
@ -50,13 +50,6 @@ canvas.chip {
|
||||
height: 600px;
|
||||
}
|
||||
|
||||
object.chipbg {
|
||||
position: absolute;
|
||||
width: 600px;
|
||||
height: 600px;
|
||||
}
|
||||
|
||||
|
||||
div.buttons{
|
||||
position: absolute;
|
||||
top: -5px;
|
||||
@ -96,6 +89,6 @@ table.memtable {
|
||||
}
|
||||
|
||||
#title {
|
||||
font-size:30px;
|
||||
font-size:30px;
|
||||
font-weight:bold;
|
||||
}
|
||||
}
|
@ -45,6 +45,8 @@ var userResetHigh;
|
||||
// rounding artifacts, and at high zoom there will be anti-aliasing on edges.
|
||||
var grMaxZoom=12;
|
||||
var grChipSize=10000;
|
||||
var grChipOffsetX=400;
|
||||
var grChipOffsetY=0;
|
||||
var grCanvasSize=2000;
|
||||
var grLineWidth=1;
|
||||
|
||||
@ -144,19 +146,12 @@ function mouseUp(e){
|
||||
}
|
||||
|
||||
function setZoom(n){
|
||||
var svg = chipbg.getSVGDocument();
|
||||
svg = svg.childNodes[0];
|
||||
|
||||
zoom = n;
|
||||
setChipStyle({
|
||||
width: 600*n+'px',
|
||||
height: 600*n+'px'
|
||||
});
|
||||
|
||||
svg.style.width = 600*n+'px';
|
||||
svg.style.height = 600*n+'px';
|
||||
recenter();
|
||||
|
||||
}
|
||||
|
||||
function recenter(){
|
||||
@ -200,7 +195,7 @@ function handleClick(e){
|
||||
function setChipStyle(props){
|
||||
for(var i in props){
|
||||
chipbg.style[i] = props[i];
|
||||
// overlay.style[i] = props[i];
|
||||
overlay.style[i] = props[i];
|
||||
hilite.style[i] = props[i];
|
||||
hitbuffer.style[i] = props[i];
|
||||
}
|
||||
|
76
macros.js
76
macros.js
@ -304,6 +304,71 @@ function listActiveTCStates() {
|
||||
return s.join("+");
|
||||
}
|
||||
|
||||
// Show all time code node states (active and inactive) in fixed format,
|
||||
// with non-PLA-controlling internal state indication in square
|
||||
// brackets, followed by RCL-resident timing state indication.
|
||||
// ".." for a PLA-controlling node indicates inactive state, "T"* for a
|
||||
// PLA-controlling node indicates active state.
|
||||
// Bracketed codes are one of T1/V0/T6/..
|
||||
// V0 indicates the VEC0 node, T6 is a synonym for the VEC1 node.
|
||||
// The RCL codes are one of SD1/SD2/...
|
||||
// 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 ? ' ' : ' ';
|
||||
if ( !isNodeHigh( nodenames[ 'clock1' ] ) ) 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
|
||||
if ( !isNodeHigh( nodenames[ 'clock2' ] ) ) s += "T+"; else s += "..";
|
||||
s += _spc;
|
||||
if ( !isNodeHigh( nodenames[ 't2' ] ) ) s += "T2"; else s += "..";
|
||||
s += _spc;
|
||||
if ( !isNodeHigh( nodenames[ 't3' ] ) ) s += "T3"; else s += "..";
|
||||
s += _spc;
|
||||
if ( !isNodeHigh( nodenames[ 't4' ] ) ) s += "T4"; else s += "..";
|
||||
s += _spc;
|
||||
if ( !isNodeHigh( nodenames[ 't5' ] ) ) s += "T5"; else s += "..";
|
||||
s += _spc + "[";
|
||||
// Check three confirmed exclusive states (three nodes)
|
||||
if ( isNodeHigh( 862 ) ) {
|
||||
s += "T1";
|
||||
// ...else if VEC0 is on...
|
||||
} else if ( isNodeHigh( nodenames[ 'VEC0' ] ) ) {
|
||||
// ...then tell the outside world
|
||||
s += "V0";
|
||||
// ...else if VEC1 is on...
|
||||
} else if ( isNodeHigh( nodenames[ 'VEC1' ] ) ) {
|
||||
// ...then this is the canonical T6. It is a synonym for VEC1
|
||||
s += "T6";
|
||||
} else {
|
||||
// ...else none of the "hidden" bits in the clock state is active
|
||||
s += "..";
|
||||
}
|
||||
s += "]" + _spc;
|
||||
// Check the RCL's two confirmed exclusive states (two nodes)
|
||||
// If this node is grounding ~WR...
|
||||
if ( isNodeHigh( 440 ) ) {
|
||||
// ...then we can regard this state as Store Data 1
|
||||
s += "SD1";
|
||||
// ...else if this node is grounding ~WR...
|
||||
} else if ( isNodeHigh( 1258 ) ) {
|
||||
// ...then we can regard this state as Store Data 2
|
||||
s += "SD2";
|
||||
} else {
|
||||
// ...else none of the RCL-resident timing bits is active
|
||||
s += "...";
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
function readBit(name){
|
||||
return isNodeHigh(nodenames[name])?1:0;
|
||||
}
|
||||
@ -330,6 +395,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')
|
||||
@ -339,7 +411,7 @@ function busToString(busname){
|
||||
// - we'll allow the x and xx prefix but ignore the #
|
||||
return listActiveSignals('^([x]?x-)?op-');
|
||||
if(busname=='DPControl')
|
||||
return listActiveSignals('^dpc[0-9]+_');
|
||||
return listActiveSignals('^dpc[-]?[0-9]+_');
|
||||
if(busname[0]=="-"){
|
||||
// invert the value of the bus for display
|
||||
var value=busToHex(busname.slice(1))
|
||||
@ -699,7 +771,7 @@ var disassembly={
|
||||
0x68:"PLA",
|
||||
0x69:"ADC #",
|
||||
0x6A:"ROR ",
|
||||
0x6C:"JMP zp",
|
||||
0x6C:"JMP (Abs)",
|
||||
0x6D:"ADC Abs",
|
||||
0x6E:"ROR Abs",
|
||||
0x70:"BVS ",
|
||||
|
15
nodenames.js
15
nodenames.js
@ -153,8 +153,8 @@ p2: 1553, // I bit of status register (storage node)
|
||||
p3: 348, // D bit of status register (storage node)
|
||||
p4: 1119, // there is no bit4 in the status register! (not a storage node)
|
||||
p5: -1, // there is no bit5 in the status register! (not a storage node)
|
||||
p6: 77, // V bit of status register (storage node)
|
||||
p7: 1370, // N bit of status register (storage node)
|
||||
p6: 1625, // V bit of status register (storage node)
|
||||
p7: 69, // N bit of status register (storage node)
|
||||
|
||||
// internal bus: status register outputs for push P
|
||||
Pout0: 687,
|
||||
@ -405,7 +405,7 @@ RnWstretched: 353, // internal signal: control datapad output drivers, aka TRIST
|
||||
"#DBE": 1035, // internal signal: formerly from DBE pad (6501)
|
||||
"~DBE": 1035, // automatic alias replacing hash with tilde
|
||||
cp1: 710, // internal signal: clock phase 1
|
||||
cclk: 943, // unbonded pad: internal non-overlappying phi2
|
||||
cclk: 943, // unbonded pad: internal non-overlapping phi2
|
||||
fetch: 879, // internal signal
|
||||
clearIR: 1077, // internal signal
|
||||
H1x1: 1042, // internal signal: drive status byte onto databus
|
||||
@ -590,8 +590,8 @@ H1x1: 1042, // internal signal: drive status byte onto databus
|
||||
|
||||
// internal signals: control signals
|
||||
nnT2BR: 967, // doubly inverted
|
||||
BRtaken: 1544, // aka #TAKEN
|
||||
BRtaken: 1544, // automatic alias replacing hash with tilde
|
||||
"#BRtaken": 1544, // aka #TAKEN
|
||||
"~BRtaken": 1544, // automatic alias replacing hash with tilde
|
||||
|
||||
// internal signals and state: interrupt and vector related
|
||||
// segher says:
|
||||
@ -863,7 +863,10 @@ AxB7: 1241,
|
||||
// internal signals: datapath control signals
|
||||
|
||||
"ADL/ABL": 639, // load ABL latches from ADL bus
|
||||
"dpc-1_ADL/ABL": 639,// alias for DPControl pseudo-bus
|
||||
|
||||
"ADH/ABH": 821, // load ABH latches from ADH bus
|
||||
"dpc-2_ADH/ABH": 821,// alias for DPControl pseudo-bus
|
||||
|
||||
dpc0_YSB: 801, // drive sb from y
|
||||
dpc1_SBY: 325, // load y from sb
|
||||
@ -923,7 +926,7 @@ dpc31_PCHPCH: 741, // load pch from pch incremented
|
||||
dpc32_PCHADH: 1235, // drive adh from pch incremented
|
||||
dpc33_PCHDB: 247, // drive idb from pch incremented
|
||||
dpc34_PCLC: 1704, // pch carry in and pcl FF detect?
|
||||
dpc35_PCHC: 1334, // pcl 0x?F detect - half-carry
|
||||
dpc35_PCHC: 1334, // pch 0x?F detect - half-carry
|
||||
"dpc36_#IPC": 379, // pcl carry in (inverted)
|
||||
"dpc36_~IPC": 379, // automatic alias replacing hash with tilde
|
||||
dpc37_PCLDB: 283, // drive idb from pcl incremented
|
||||
|
7024
transdefs.js
7024
transdefs.js
File diff suppressed because it is too large
Load Diff
103
wires.js
103
wires.js
@ -22,11 +22,6 @@
|
||||
|
||||
var frame, chipbg, overlay, hilite, hitbuffer, ctx;
|
||||
var nodes = new Array();
|
||||
var lastState = new Array();
|
||||
var polyAttr = new Array();
|
||||
var metalAttr = new Array();
|
||||
var polyOffFill;
|
||||
var metalOffFill;
|
||||
var transistors = {};
|
||||
var nodenamelist=[];
|
||||
|
||||
@ -45,7 +40,6 @@ function setupNodes(){
|
||||
state: false, gates: new Array(), c1c2s: new Array()};
|
||||
if(w==ngnd) continue;
|
||||
if(w==npwr) continue;
|
||||
lastState[i] = 0;
|
||||
nodes[w].segs.push(seg.slice(3));
|
||||
}
|
||||
}
|
||||
@ -79,20 +73,8 @@ function setupLayerVisibility(){
|
||||
|
||||
function setupBackground(){
|
||||
chipbg = document.getElementById('chipbg');
|
||||
chipbg.width = 4000;
|
||||
chipbg.height = 4000;
|
||||
var svg = chipbg.getSVGDocument();
|
||||
svg = svg.childNodes[0];
|
||||
var poly = svg.getElementById('poly');
|
||||
var metal = svg.getElementById('metal');
|
||||
polyOffFill = poly.getAttribute('fill');
|
||||
metalOffFill = metal.getAttribute('fill');
|
||||
for(var i in nodes){
|
||||
polyAttr[i] = poly.getElementsByClassName(i+'')[0];
|
||||
metalAttr[i] = metal.getElementsByClassName(i+'')[0];
|
||||
}
|
||||
return;
|
||||
|
||||
chipbg.width = grCanvasSize;
|
||||
chipbg.height = grCanvasSize;
|
||||
var ctx = chipbg.getContext('2d');
|
||||
ctx.fillStyle = '#000000';
|
||||
ctx.strokeStyle = 'rgba(255,255,255,0.5)';
|
||||
@ -111,10 +93,10 @@ function setupBackground(){
|
||||
}
|
||||
|
||||
function setupOverlay(){
|
||||
// overlay = document.getElementById('overlay');
|
||||
// overlay.width = grCanvasSize;
|
||||
// overlay.height = grCanvasSize;
|
||||
// ctx = overlay.getContext('2d');
|
||||
overlay = document.getElementById('overlay');
|
||||
overlay.width = grCanvasSize;
|
||||
overlay.height = grCanvasSize;
|
||||
ctx = overlay.getContext('2d');
|
||||
}
|
||||
|
||||
function setupHilite(){
|
||||
@ -155,44 +137,20 @@ function hexdigit(n){return '0123456789ABCDEF'.charAt(n);}
|
||||
|
||||
function refresh(){
|
||||
if(!chipLayoutIsVisible) return;
|
||||
// ctx.clearRect(0,0,grCanvasSize,grCanvasSize);
|
||||
// for(i in nodes){
|
||||
// if(isNodeHigh(i)) overlayNode(nodes[i].segs);
|
||||
// }
|
||||
ctx.clearRect(0,0,grCanvasSize,grCanvasSize);
|
||||
for(i in nodes){
|
||||
if(isNodeHigh(i)){
|
||||
if(lastState[i]==1)continue;
|
||||
|
||||
var n = polyAttr[i];
|
||||
var n2 = metalAttr[i];
|
||||
if(n!=undefined)
|
||||
n.setAttribute('fill', 'rgb(0,255,255)');
|
||||
if(n2!=undefined)
|
||||
n2.setAttribute('fill', 'rgb(0,255,255)');
|
||||
lastState[i] = 1;
|
||||
} else {
|
||||
if(lastState[i]==0)continue;
|
||||
|
||||
var n = polyAttr[i];
|
||||
var n2 = metalAttr[i];
|
||||
|
||||
if(n!=undefined)
|
||||
n.setAttribute('fill', polyOffFill);
|
||||
if(n2!=undefined)
|
||||
n2.setAttribute('fill', metalOffFill);
|
||||
lastState[i] = 0;
|
||||
}
|
||||
}
|
||||
if(isNodeHigh(i)) overlayNode(nodes[i].segs);
|
||||
}
|
||||
hiliteNode(hilited);
|
||||
}
|
||||
|
||||
//function overlayNode(w){
|
||||
// ctx.fillStyle = 'rgba(255,0,64,0.4)';
|
||||
// for(i in w) {
|
||||
// drawSeg(ctx, w[i]);
|
||||
// ctx.fill();
|
||||
// }
|
||||
//}
|
||||
function overlayNode(w){
|
||||
ctx.fillStyle = 'rgba(255,0,64,0.4)';
|
||||
for(i in w) {
|
||||
drawSeg(ctx, w[i]);
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
|
||||
// originally to highlight using a list of node numbers
|
||||
// but can now include transistor names
|
||||
@ -246,18 +204,33 @@ function ctxDrawBox(ctx, xMin, yMin, xMax, yMax){
|
||||
function zoomToBox(xmin,xmax,ymin,ymax){
|
||||
var xmid=(xmin+xmax)/2;
|
||||
var ymid=(ymin+ymax)/2;
|
||||
var x=(xmid+400)/grChipSize*600;
|
||||
var y=600-ymid/grChipSize*600;
|
||||
var zoom=5; // pending a more careful calculation
|
||||
var x=(xmid+grChipOffsetX)/grChipSize*600;
|
||||
var y=600-(ymid-grChipOffsetY)/grChipSize*600;
|
||||
// Zoom to fill 80% of the window with the selection
|
||||
var fillfactor=0.80;
|
||||
var dx=xmax-xmin;
|
||||
var dy=ymax-ymin;
|
||||
if (dx < 1) dx=1;
|
||||
if (dy < 1) dy=1;
|
||||
var zx=(800/600)*fillfactor*grChipSize/dx;
|
||||
var zy=fillfactor*grChipSize/dy;
|
||||
var zoom=Math.min(zx,zy);
|
||||
if (zoom < 1) {
|
||||
zoom = 1;
|
||||
}
|
||||
if (zoom > grMaxZoom) {
|
||||
zoom = grMaxZoom;
|
||||
}
|
||||
moveHere([x,y,zoom]);
|
||||
}
|
||||
|
||||
function drawSeg(ctx, seg){
|
||||
var dx = 400;
|
||||
var dx = grChipOffsetX;
|
||||
var dy = grChipOffsetY;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(grScale(seg[0]+dx), grScale(grChipSize-seg[1]));
|
||||
for(var i=2;i<seg.length;i+=2) ctx.lineTo(grScale(seg[i]+dx), grScale(grChipSize-seg[i+1]));
|
||||
ctx.lineTo(grScale(seg[0]+dx), grScale(grChipSize-seg[1]));
|
||||
ctx.moveTo(grScale(seg[0]+dx), grScale(grChipSize-seg[1]+dy));
|
||||
for(var i=2;i<seg.length;i+=2) ctx.lineTo(grScale(seg[i]+dx), grScale(grChipSize-seg[i+1]+dy));
|
||||
ctx.lineTo(grScale(seg[0]+dx), grScale(grChipSize-seg[1]+dy));
|
||||
}
|
||||
|
||||
function findNodeNumber(x,y){
|
||||
|
Reference in New Issue
Block a user