Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02c7f10328 | ||
|
|
0d6a50641b | ||
|
|
cd4e08a2b8 | ||
|
|
a4974cdff4 | ||
|
|
97d5b294ef |
16 changed files with 3242 additions and 2408 deletions
127
apps/pcx86/1981/basic/music.bas
Normal file
127
apps/pcx86/1981/basic/music.bas
Normal file
|
|
@ -0,0 +1,127 @@
|
||||||
|
940 REM The IBM Personal Computer Music
|
||||||
|
950 REM Version 1.00 (C)Copyright IBM Corp 1981
|
||||||
|
960 REM Licensed Material - Program Property of IBM
|
||||||
|
975 DEF SEG: POKE 106,0
|
||||||
|
980 SAMPLES$ = "NO"
|
||||||
|
990 GOTO 1010
|
||||||
|
1000 SAMPLES$ = "YES"
|
||||||
|
1010 KEY OFF:SCREEN 0,1:COLOR 15,0,0:WIDTH 40:CLS:LOCATE 5,19:PRINT "IBM"
|
||||||
|
1020 LOCATE 7,12,0:PRINT "Personal Computer"
|
||||||
|
1030 COLOR 10,0:LOCATE 10,9,0:PRINT CHR$(213)+STRING$(21,205)+CHR$(184)
|
||||||
|
1040 LOCATE 11,9,0:PRINT CHR$(179)+" MUSIC "+CHR$(179)
|
||||||
|
1050 LOCATE 12,9,0:PRINT CHR$(179)+STRING$(21,32)+CHR$(179)
|
||||||
|
1060 LOCATE 13,9,0:PRINT CHR$(179)+" Version 1.00 "+CHR$(179)
|
||||||
|
1070 LOCATE 14,9,0:PRINT CHR$(212)+STRING$(21,205)+CHR$(190)
|
||||||
|
1080 COLOR 15,0:LOCATE 17,7,0:PRINT "(C) Copyright IBM Corp 1981"
|
||||||
|
1090 COLOR 14,0:LOCATE 23,7,0:PRINT "Press space bar to continue"
|
||||||
|
1100 IF INKEY$ <> "" THEN GOTO 1100
|
||||||
|
1110 CMD$ = INKEY$
|
||||||
|
1120 IF CMD$ = "" THEN GOTO 1110
|
||||||
|
1130 IF CMD$ = CHR$(27) THEN GOTO 1850
|
||||||
|
1140 IF CMD$ <> " " THEN GOTO 1110
|
||||||
|
1141 ON ERROR GOTO 1148
|
||||||
|
1142 PLAY "mf"
|
||||||
|
1143 GOTO 1149
|
||||||
|
1148 RESUME 1149
|
||||||
|
1149 ON ERROR GOTO 0
|
||||||
|
1150 SCREEN 0,1:WIDTH 40:COLOR 15,1,1:CLS
|
||||||
|
1160 LOCATE 15,7,0:PRINT " ------- selections -------"
|
||||||
|
1170 LOCATE 16,7,0:PRINT " A-MARCH E-HUMOR I-SAKURA"
|
||||||
|
1180 LOCATE 17,7,0:PRINT " B-STARS F-BUG J-BLUE "
|
||||||
|
1190 LOCATE 18,7,0:PRINT " C-FORTY G-POP K-SCALES"
|
||||||
|
1191 LOCATE 19,7,0:PRINT " D-HAT H-DANDY ESC KEY-EXIT"
|
||||||
|
1200 COLOR 15,0
|
||||||
|
1210 FOR I=0 TO 15:FOR J=0 TO 8
|
||||||
|
1220 LOCATE 5+J,5+I*2,0:PRINT CHR$(219);CHR$(221);
|
||||||
|
1230 NEXT J:NEXT I
|
||||||
|
1240 FOR I=0 TO 12:FOR J=0 TO 4
|
||||||
|
1250 IF I=2 OR I=6 OR I=9 OR I=13 THEN GOTO 1270
|
||||||
|
1260 LOCATE 5+J,8+I*2:PRINT CHR$(32);CHR$(222);
|
||||||
|
1270 NEXT J:NEXT I
|
||||||
|
1280 FOR J=0 TO 9
|
||||||
|
1290 LOCATE 4+J,4:COLOR 4,0:PRINT CHR$(221);:LOCATE 4+J,36:COLOR 15,0
|
||||||
|
1300 PRINT CHR$(221);:COLOR 4,1:PRINT CHR$(221);
|
||||||
|
1310 NEXT J
|
||||||
|
1320 COLOR 4,1:LOCATE 4,4
|
||||||
|
1330 FOR I=0 TO 32:PRINT CHR$(219);:NEXT I
|
||||||
|
1340 PRINT CHR$(221);:LOCATE 13,4
|
||||||
|
1350 FOR I=0 TO 32:PRINT CHR$(219);:NEXT I
|
||||||
|
1360 PRINT CHR$(221);:COLOR 0,7:DEFINT M,N,O,P:DIM M(88),O(70)
|
||||||
|
1370 FOR I=7 TO 88:M(I) = 36.8*(2^(1/12))^(I-6):NEXT I
|
||||||
|
1380 FOR I=0 TO 6:M(I) = 32767:NEXT I
|
||||||
|
1390 O(0) = 0
|
||||||
|
1400 O(39)=5:O(40)=7:O(41)=8:O(42)=9
|
||||||
|
1410 O(43)=10:O(44)=11:O(45)=13:O(46)=14
|
||||||
|
1420 O(47)=15:O(48)=16:O(49)=17:O(50)=18
|
||||||
|
1430 O(51)=19:O(52)=21:O(53)=22:O(54)=23
|
||||||
|
1440 O(55)=24:O(56)=25:O(57)=27:O(58)=28
|
||||||
|
1450 O(59)=29:O(60)=30:O(61)=31:O(62)=32
|
||||||
|
1460 O(63)=33:O(64)=35:O(65)=36:O(66)=37
|
||||||
|
1470 O(67)=38:O(68)=39:O(69)=40:O(70)=42
|
||||||
|
1480 GOTO 1630
|
||||||
|
1490 READ J,K
|
||||||
|
1500 CMD$ = INKEY$:IF CMD$="" THEN GOTO 1540
|
||||||
|
1510 IF CMD$=CHR$(27) THEN RETURN
|
||||||
|
1520 POKE 106,0
|
||||||
|
1530 REM
|
||||||
|
1540 IF J = -1 THEN RETURN
|
||||||
|
1550 Q = O(J)
|
||||||
|
1560 IF J>64 OR J<39 THEN GOTO 1590
|
||||||
|
1570 IF SCREEN(5,Q)<>32 THEN COLOR 0,7:LOCATE 11,Q:PRINT CHR$(14);:COLOR 15,0:GOTO 1590
|
||||||
|
1580 COLOR 15,0:LOCATE 7,Q:PRINT CHR$(14);:COLOR 0,7
|
||||||
|
1590 SOUND M(J),K:IF J=0 AND K=1 THEN GOTO 1600:'SKIP NEXT FOR STACCATTO
|
||||||
|
1595 SOUND 32767,1
|
||||||
|
1600 IF J>64 OR J<39 THEN GOTO 1490
|
||||||
|
1610 IF SCREEN(5,Q) = 32 THEN COLOR 15,0:LOCATE 7,Q:PRINT CHR$(32);:GOTO 1490
|
||||||
|
1620 COLOR 15,0:LOCATE 11,Q:PRINT CHR$(219);:GOTO 1490
|
||||||
|
1630 LOCATE 21,5:PRINT " ";
|
||||||
|
1640 LOCATE 21,5:PRINT "ENTER SELECTION ==>";
|
||||||
|
1650 IF INKEY$ <> "" THEN GOTO 1650
|
||||||
|
1660 CMD$=INKEY$:IF CMD$="" THEN GOTO 1660
|
||||||
|
1670 IF CMD$=CHR$(27) THEN GOTO 1850
|
||||||
|
1680 IF CMD$="A" THEN S$= "MARCH ":GOTO 1770
|
||||||
|
1681 IF CMD$="a" THEN S$= "MARCH ":GOTO 1770
|
||||||
|
1690 IF CMD$="B" THEN S$= "STARS ":GOTO 1770
|
||||||
|
1691 IF CMD$="b" THEN S$= "STARS ":GOTO 1770
|
||||||
|
1700 IF CMD$="C" THEN S$= "FORTY ":GOTO 1770
|
||||||
|
1701 IF CMD$="c" THEN S$= "FORTY ":GOTO 1770
|
||||||
|
1710 IF CMD$="D" THEN S$= "HAT ":GOTO 1770
|
||||||
|
1711 IF CMD$="d" THEN S$= "HAT ":GOTO 1770
|
||||||
|
1720 IF CMD$="E" THEN S$= "HUMOR ":GOTO 1770
|
||||||
|
1721 IF CMD$="e" THEN S$= "HUMOR ":GOTO 1770
|
||||||
|
1730 IF CMD$="F" THEN S$= "BUG ":GOTO 1770
|
||||||
|
1731 IF CMD$="f" THEN S$= "BUG ":GOTO 1770
|
||||||
|
1740 IF CMD$="G" THEN S$= "POP ":GOTO 1770
|
||||||
|
1741 IF CMD$="g" THEN S$= "POP ":GOTO 1770
|
||||||
|
1750 IF CMD$="H" THEN S$= "DANDY ":GOTO 1770
|
||||||
|
1751 IF CMD$="h" THEN S$= "DANDY ":GOTO 1770
|
||||||
|
1755 IF CMD$="I" THEN S$= "SAKURA":GOTO 1770
|
||||||
|
1756 IF CMD$="i" THEN S$= "SAKURA":GOTO 1770
|
||||||
|
1757 IF CMD$="J" THEN S$= "BLUE ":GOTO 1770
|
||||||
|
1758 IF CMD$="j" THEN S$= "BLUE ":GOTO 1770
|
||||||
|
1761 IF CMD$="K" THEN S$= "SCALES":GOTO 1770
|
||||||
|
1762 IF CMD$="k" THEN S$= "SCALES":GOTO 1770
|
||||||
|
1769 GOTO 1640
|
||||||
|
1770 PRINT " ";CMD$;"-";S$:CHAIN MERGE S$,1780,ALL
|
||||||
|
1780 RESTORE:READ D
|
||||||
|
1790 IF D<>-2 THEN RESTORE:GOTO 1810
|
||||||
|
1800 READ S$:LOCATE 23,1+(40.5-LEN(S$))/2
|
||||||
|
1805 COLOR 15,4:PRINT S$;:COLOR 0,7
|
||||||
|
1810 GOSUB 1490
|
||||||
|
1820 S$=STRING$(39," "):LOCATE 23,1:COLOR 4,1:PRINT S$:COLOR 0,7
|
||||||
|
1830 GOTO 1630
|
||||||
|
1840 END
|
||||||
|
1850 IF SAMPLES$="YES" THEN CHAIN "SAMPLES",1000
|
||||||
|
1860 SCREEN 0,1:COLOR 7,0,0:CLS:END
|
||||||
|
3000 REM The IBM Personal Computer Music Scroll
|
||||||
|
3010 REM Version 1.00 (C)Copyright IBM Corp 1981
|
||||||
|
3020 REM Licensed Material - Program Property of IBM
|
||||||
|
3030 DATA -2,"FUNERAL MARCH OF A MARIONETTE - GOUNOD"
|
||||||
|
3040 DATA 37,1,0,2,30,1,0,5,42,3,42,3,41,3,39,3,41,3,0,3,42,3,44,3,0,3,37,1,0,2
|
||||||
|
3050 DATA 30,1,0,5,42,3,42,3,41,3,39,3,41,3,0,3,42,3,44,3,0,3,37,3,42,3,0,3,45,3
|
||||||
|
3060 DATA 49,6,47,3,45,3,0,3,49,3,52,6,50,3,49,3,0,3,53,3,56,6,54,3,53,3,50,3
|
||||||
|
3070 DATA 49,3,47,3,45,3,44,3,30,1,0,5,42,3,42,3,41,3,39,3,41,3,0,3,42,3,44,3
|
||||||
|
3080 DATA 0,3,37,1,0,2,30,1,0,5,42,3,42,3,41,3,39,3,41,3,0,3,42,3,44,3,0,3
|
||||||
|
3090 DATA 37,3,45,3,0,3,49,3,52,6,50,3,49,3,47,3,45,3,43,3,47,3,50,3,42,3
|
||||||
|
3100 DATA 41,3,42,3,44,3,0,3,45,1,0,2,44,9,42,1
|
||||||
|
3110 DATA -1,-1
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
495
es6.html
Normal file
495
es6.html
Normal file
|
|
@ -0,0 +1,495 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html style="background-color: #1d1d1d">
|
||||||
|
<head>
|
||||||
|
<title>pcjs.org | PCjs Machines</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="initial-scale=1">
|
||||||
|
<link rel="apple-touch-icon" sizes="57x57" href="/versions/icons/current/pc-icon-57.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="72x72" href="/versions/icons/current/pc-icon-72.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="76x76" href="/versions/icons/current/pc-icon-76.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="114x114" href="/versions/icons/current/pc-icon-114.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="120x120" href="/versions/icons/current/pc-icon-120.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="144x144" href="/versions/icons/current/pc-icon-144.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="152x152" href="/versions/icons/current/pc-icon-152.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="/versions/icons/current/pc-icon-180.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="192x192" href="/versions/icons/current/pc-icon-192.png">
|
||||||
|
<link rel="apple-touch-icon" href="/versions/icons/current/apple-touch-icon.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="192x192" href="/versions/icons/current/pc-icon-192.png">
|
||||||
|
<link rel="shortcut icon" type="image/x-icon" href="/versions/icons/current/favicon.ico">
|
||||||
|
<link rel="stylesheet" type="text/css" href="/modules/shared/templates/common.css">
|
||||||
|
<link rel="stylesheet" type="text/css" href="/modules/shared/templates/components.css">
|
||||||
|
<link rel="stylesheet" type="text/css" href="/modules/c1pjs/templates/components.css">
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- index.html generated on Mon Sep 25 2017 15:28:59 GMT-0700 (PDT) -->
|
||||||
|
<div class="common">
|
||||||
|
<div class="common-top">
|
||||||
|
<div class="common-top-left">
|
||||||
|
<ul>
|
||||||
|
<li><a href="/">PCjs</a></li>
|
||||||
|
<li><a href="/blog/">Blog</a></li>
|
||||||
|
<li><a href="/apps/">Apps</a></li>
|
||||||
|
<li><a href="/devices/">Devices</a></li>
|
||||||
|
<li><a href="/disks/">Disks</a></li>
|
||||||
|
<li><a href="/pubs/docs/">Docs</a></li>
|
||||||
|
<li><a href="/pubs/docs/about/">About</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="common-top-right">
|
||||||
|
<p>Powered by <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">JavaScript</a>, <a href="http://vanilla-js.com/" target="_blank">Vanilla JS</a>, and <a href="http://github.com/jeffpar/pcjs" target="_blank">GitHub</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="common-middle">
|
||||||
|
<h4>Directory of C:\<a href="/">PCJS.ORG</a></h4>
|
||||||
|
<div class="common-sidebar">
|
||||||
|
<ul class="common-list">
|
||||||
|
<li><a href="/Gruntfile.js">\GRUNTFILE.JS</a></li>
|
||||||
|
<li><a href="/LICENSE">\LICENSE</a></li>
|
||||||
|
<li><a href="/README.md">\README.MD</a></li>
|
||||||
|
<li><a href="/_data/">\_DATA</a></li>
|
||||||
|
<li><a href="/_posts/">\_POSTS</a></li>
|
||||||
|
<li><a href="/api/">\API</a></li>
|
||||||
|
<li><a href="/apps/">\APPS</a></li>
|
||||||
|
<li><a href="/bin/">\BIN</a></li>
|
||||||
|
<li><a href="/blog/">\BLOG</a></li>
|
||||||
|
<li><a href="/devices/">\DEVICES</a></li>
|
||||||
|
<li><a href="/disks/">\DISKS</a></li>
|
||||||
|
<li><a href="/docs/">\DOCS</a></li>
|
||||||
|
<li><a href="/gulpfile.js">\GULPFILE.JS</a></li>
|
||||||
|
<li><a href="/logs/">\LOGS</a></li>
|
||||||
|
<li><a href="/modules/">\MODULES</a></li>
|
||||||
|
<li><a href="/node_modules/">\NODE_MODULES</a></li>
|
||||||
|
<li><a href="/notes.md">\NOTES.MD</a></li>
|
||||||
|
<li><a href="/package.json">\PACKAGE.JSON</a></li>
|
||||||
|
<li><a href="/projects/">\PROJECTS</a></li>
|
||||||
|
<li><a href="/pubs/">\PUBS</a></li>
|
||||||
|
<li><a href="/server.js">\SERVER.JS</a></li>
|
||||||
|
<li><a href="/src/">\SRC</a></li>
|
||||||
|
<li><a href="/tests/">\TESTS</a></li>
|
||||||
|
<li><a href="/tmp/">\TMP</a></li>
|
||||||
|
<li><a href="/versions/">\VERSIONS</a></li>
|
||||||
|
<li><a href="/videos/">\VIDEOS</a></li>
|
||||||
|
<li><a href="/web/">\WEB</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="common-main">
|
||||||
|
<h1 id="pcjs-machines">PCjs Machines</h1>
|
||||||
|
<p>Welcome to PCjs, home of <a href="/docs/pcx86/">PCx86</a>, the original IBM PC simulation that runs in your web browser. It is
|
||||||
|
one of several JavaScript Machines in the <a href="https://github.com/jeffpar/pcjs">PCjs Project</a>, an open-source project that
|
||||||
|
includes:</p>
|
||||||
|
<ul class="md-list md-list-none">
|
||||||
|
<li><a href="/docs/pcx86/">PCx86</a>, an x86-based emulator of the <a href="/devices/pcx86/machine/">IBM PC and PC-compatibles</a></li>
|
||||||
|
<li><a href="/modules/pc8080/">PC8080</a>, an 8080 machine emulator (see <a href="/devices/pc8080/machine/invaders/">Space Invaders</a> and the <a href="/devices/pc8080/machine/vt100/">VT100 Terminal</a>)</li>
|
||||||
|
<li><a href="/docs/c1pjs/">C1Pjs</a>, an emulation of the 6502-based <a href="/devices/c1p/">Ohio Scientific Challenger 1P</a></li>
|
||||||
|
<li><a href="/docs/pdpjs/">PDPjs</a>, a set of machine emulation modules supporting the DEC <a href="/devices/pdp10/machine/">PDP-10</a> and <a href="/devices/pdp11/machine/">PDP-11</a></li>
|
||||||
|
</ul>
|
||||||
|
<p>All PCjs machine simulations are written entirely in <a href="/modules/">JavaScript</a>. No Flash, Java or other plugins are
|
||||||
|
required. Supported browsers include modern versions of Chrome, Safari, Firefox, Internet Explorer (v9.0 and up), Edge,
|
||||||
|
and assorted mobile browsers.</p>
|
||||||
|
<div id="ibm5150" class="machine-placeholder"><p>"IBM PC (Model 5150) with Monochrome Display"</p><p class="machine-warning">Waiting for PCx86 to load</p></div>
|
||||||
|
|
||||||
|
<p>The <a href="/devices/pcx86/machine/5150/mda/64kb/">JavaScript Machine</a> above uses <a href="/docs/pcx86/">PCx86</a> configured with an Intel
|
||||||
|
8088 running at 4.77Mhz, with 64Kb of RAM and an IBM Monochrome Display Adapter. For more control, there are also
|
||||||
|
<a href="/devices/pcx86/machine/5150/mda/64kb/debugger/">Control Panel</a> and <a href="/devices/pcx86/machine/5150/mda/64kb/softkbd/">Soft Keyboard</a>
|
||||||
|
configurations, featuring the built-in PCx86 Debugger. For even greater control, build your own PC. The
|
||||||
|
<a href="/docs/pcx86/">PCx86 Documentation</a> will help you get started.</p>
|
||||||
|
<p>PCx86 has steadily evolved to support more classic x86-based machines, including the IBM PC XT, the 80286-based IBM PC AT,
|
||||||
|
and the 80386-based COMPAQ DeskPro 386. PCx86 fully supports the original machine ROMs, video cards, etc, and all
|
||||||
|
machines run at their original speeds.</p>
|
||||||
|
<p>The goals of the <a href="/docs/about/">PCjs Project</a> are to create fast, full-featured simulations of classic
|
||||||
|
computer hardware, help people understand how these early machines worked, make it easy to experiment with different
|
||||||
|
machine configurations, and provide a platform for running and analyzing old computer software.</p>
|
||||||
|
<h2 id="demos">Demos</h2>
|
||||||
|
<p>Some pre-configured machines are shown below, ready to run BASIC, DOS, Windows, OS/2, and other assorted software.</p>
|
||||||
|
<div class="common-image-gallery">
|
||||||
|
<div id="ibm-pc-running-visicalc" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/apps/pcx86/1981/visicalc/"><img src="/apps/pcx86/1981/visicalc/thumbnail.jpg" alt="IBM PC running VisiCalc" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">IBM PC running VisiCalc</span>
|
||||||
|
</div>
|
||||||
|
<div id="ibm-pc-running-donkeybas" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/apps/pcx86/1981/donkey/"><img src="/apps/pcx86/1981/donkey/thumbnail.jpg" alt="IBM PC running DONKEY.BAS" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">IBM PC running DONKEY.BAS</span>
|
||||||
|
</div>
|
||||||
|
<div id="ibm-pc-xt-wega-windows-10" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/disks/pcx86/windows/1.00/"><img src="/disks/pcx86/windows/1.00/thumbnail.jpg" alt="IBM PC XT w/EGA, Windows 1.0" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">IBM PC XT w/EGA, Windows 1.0</span>
|
||||||
|
</div>
|
||||||
|
<div id="ibm-pc-xt-wcga-windows-101" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/disks/pcx86/windows/1.01/cga/"><img src="/disks/pcx86/windows/1.01/cga/thumbnail.jpg" alt="IBM PC XT w/CGA, Windows 1.01" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">IBM PC XT w/CGA, Windows 1.01</span>
|
||||||
|
</div>
|
||||||
|
<div id="ibm-pc-xt-wega-windows-101" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/disks/pcx86/windows/1.01/"><img src="/disks/pcx86/windows/1.01/thumbnail.jpg" alt="IBM PC XT w/EGA, Windows 1.01" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">IBM PC XT w/EGA, Windows 1.01</span>
|
||||||
|
</div>
|
||||||
|
<div id="ibm-pc-at-wega-os2-10" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/disks/pcx86/os2/ibm/1.0/"><img src="/disks/pcx86/os2/ibm/1.0/thumbnail.jpg" alt="IBM PC AT w/EGA, OS/2 1.0" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">IBM PC AT w/EGA, OS/2 1.0</span>
|
||||||
|
</div>
|
||||||
|
<div id="compaq-deskpro-386-windows386" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/disks/pcx86/windows/2.0x/"><img src="/disks/pcx86/windows/2.0x/thumbnail.jpg" alt="COMPAQ DeskPro 386, Windows/386" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">COMPAQ DeskPro 386, Windows/386</span>
|
||||||
|
</div>
|
||||||
|
<div id="ibm-pc-at-wega-windows-30" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/disks/pcx86/windows/3.00/"><img src="/disks/pcx86/windows/3.00/thumbnail.jpg" alt="IBM PC AT w/EGA, Windows 3.0" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">IBM PC AT w/EGA, Windows 3.0</span>
|
||||||
|
</div>
|
||||||
|
<div id="ibm-pc-at-wvga-windows-31" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/disks/pcx86/windows/3.10/"><img src="/disks/pcx86/windows/3.10/thumbnail.jpg" alt="IBM PC AT w/VGA, Windows 3.1" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">IBM PC AT w/VGA, Windows 3.1</span>
|
||||||
|
</div>
|
||||||
|
<div id="compaq-deskpro-386-windows-95" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/disks/pcx86/windows/win95/4.00.950/"><img src="/disks/pcx86/windows/win95/4.00.950/thumbnail.jpg" alt="COMPAQ DeskPro 386, Windows 95" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">COMPAQ DeskPro 386, Windows 95</span>
|
||||||
|
</div>
|
||||||
|
<div id="ibm-pc-wmda-cpm-86" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/disks/pcx86/cpm/1.1b/"><img src="/disks/pcx86/cpm/1.1b/thumbnail.jpg" alt="IBM PC w/MDA, CP/M-86" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">IBM PC w/MDA, CP/M-86</span>
|
||||||
|
</div>
|
||||||
|
<div id="microsoft-adventure-1981" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/disks/pcx86/games/microsoft/adventure/"><img src="/disks/pcx86/games/microsoft/adventure/thumbnail.jpg" alt="Microsoft Adventure (1981)" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">Microsoft Adventure (1981)</span>
|
||||||
|
</div>
|
||||||
|
<div id="executive-suite-1982" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/apps/pcx86/1982/esuite/"><img src="/apps/pcx86/1982/esuite/thumbnail.jpg" alt="Executive Suite (1982)" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">Executive Suite (1982)</span>
|
||||||
|
</div>
|
||||||
|
<div id="zork-i-1982" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/disks/pcx86/games/infocom/zork1/"><img src="/disks/pcx86/games/infocom/zork1/thumbnail.jpg" alt="Zork I (1982)" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">Zork I (1982)</span>
|
||||||
|
</div>
|
||||||
|
<div id="adventures-in-math-1983" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/apps/pcx86/1983/adventmath/"><img src="/apps/pcx86/1983/adventmath/thumbnail.jpg" alt="Adventures in Math (1983)" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">Adventures in Math (1983)</span>
|
||||||
|
</div>
|
||||||
|
<div id="rogue-1985" class="common-image-frame">
|
||||||
|
<div class="common-image-link">
|
||||||
|
<a href="/apps/pcx86/1985/rogue/"><img src="/apps/pcx86/1985/rogue/thumbnail.jpg" alt="Rogue (1985)" width="200" height="120"/></a> </div>
|
||||||
|
<span class="common-image-label">Rogue (1985)</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p>There are many more <a href="/devices/pcx86/machine/#ready-to-run-app-demos">PCx86 Demos</a>, including an
|
||||||
|
<a href="/devices/pcx86/machine/5150/dual/64kb/">IBM PC with Dual Displays</a> demonstrating early multi-monitor support,
|
||||||
|
and multiple IBM PC XT machines running side-by-side with <a href="/devices/pcx86/machine/5160/cga/256kb/array/">CGA Displays</a>
|
||||||
|
and <a href="/devices/pcx86/machine/5160/ega/640kb/array/">EGA Displays</a>.</p>
|
||||||
|
<h2 id="c1pjs">C1Pjs</h2>
|
||||||
|
<p>Below is the <a href="/docs/c1pjs/">OSI Challenger C1P</a>, another simulation in the PCjs Project.
|
||||||
|
It simulates Ohio Scientific's 6502-based microcomputer, released in 1978. More details about this simulation
|
||||||
|
and the original machine are available in the <a href="/docs/c1pjs/">C1Pjs Documentation</a>.</p>
|
||||||
|
<div id="demoC1P" class="machine-placeholder"><p>Embedded PC</p><p class="machine-warning">Waiting for C1P to load</p></div>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
<h2 id="developer-notes">Developer Notes</h2>
|
||||||
|
<p>The <a href="https://github.com/jeffpar/pcjs">PCjs repository</a> on GitHub contains everything needed to run PCjs
|
||||||
|
computer simulations. All the PCjs emulators run in any modern web browser, with or without a web server,
|
||||||
|
and examples are provided for both <a href="/apps/pcx86/examples/">local</a> and <a href="http://www.pcjs.org/">remote</a> operation.</p>
|
||||||
|
<p>The project includes:</p>
|
||||||
|
<ul class="md-list md-list-compact">
|
||||||
|
<li>A simple Node-based web server (<a href="server.js">server.js</a>)</li>
|
||||||
|
<li>Custom Node modules used by the web server (<a href="modules/htmlout/">HTMLOut</a>, <a href="modules/markout/">MarkOut</a>, <a href="modules/diskdump/">DiskDump</a>, <a href="modules/filedump/">FileDump</a>)</li>
|
||||||
|
<li>A variety of IBM PC and C1P configuration and resource files (see <a href="apps/">/apps</a>, <a href="devices/">/devices</a> and <a href="disks/">/disks</a>)</li>
|
||||||
|
<li>The <a href="modules/pcx86/">PCx86</a>, <a href="modules/pc8080/">PC8080</a>, and <a href="modules/c1pjs/">C1Pjs</a> client applications, along with "compiled" <a href="/versions/">versions</a></li>
|
||||||
|
<li>A smattering of <a href="docs/pcx86/">PCx86</a> and <a href="docs/c1pjs/">C1Pjs</a> documentation, along with <a href="%5Fposts/">blog posts</a>, related <a href="pubs/">publications</a> and more</li>
|
||||||
|
</ul>
|
||||||
|
<p>The bundled web server is not strictly required. Any web server (Node, Apache, Nginx, etc) that can serve the necessary
|
||||||
|
JavaScript files to your browser will work. However, instructions for doing that are beyond the scope of this introduction.</p>
|
||||||
|
<p>In fact, you can run PCjs simulations without a web server at all, using the "file:" protocol instead of "http:".
|
||||||
|
However, most of the machine configurations require additional resource files (ROMs, disk images, etc), which are
|
||||||
|
included in the project, but unless all the resource files are moved into a single directory (as they are in these
|
||||||
|
<a href="/apps/pcx86/examples/">Examples</a>), your browser will probably be unable to load all of them, due to security restrictions.
|
||||||
|
Using the bundled web server is the preferred solution.</p>
|
||||||
|
<p>The project includes a large selection of disk images, and a powerful <a href="modules/diskdump/">DiskDump</a> utility that
|
||||||
|
runs on both the client and server, featuring a command-line interface (CLI) and web server API. Originally created to dump
|
||||||
|
existing disk images as JSON, <strong>DiskDump</strong> has evolved into a full-featured disk image generator, capable of creating PC-compatible
|
||||||
|
diskette <em>and</em> hard disk images from either lists <em>or</em> directories of files (including all subdirectories).</p>
|
||||||
|
<h3 id="installing-pcjs-with-node">Installing PCjs with Node</h3>
|
||||||
|
<p>The following instructions were originally written for OS X. However, users of other operating systems should have
|
||||||
|
no problem following along. There are some prerequisites:</p>
|
||||||
|
<ul class="md-list md-list-compact">
|
||||||
|
<li>Node with NPM (download an installation package for your OS from <a href="http://nodejs.org/download/">nodejs.org</a>)</li>
|
||||||
|
<li>Git (included with OS X Developer Tools; separate download required for <a href="http://git-scm.com/download/win">Windows</a>)</li>
|
||||||
|
</ul>
|
||||||
|
<p>Some additional (optional) tools are also recommended:</p>
|
||||||
|
<ul class="md-list md-list-compact">
|
||||||
|
<li>Python (included with OS X; separate download required for <a href="https://www.python.org/downloads/windows/">Windows</a>)</li>
|
||||||
|
<li>GitHub (useful for getting Git set up on <a href="https://windows.github.com/">Windows</a>; also available for
|
||||||
|
<a href="https://mac.github.com/">OS X</a>) </li>
|
||||||
|
</ul>
|
||||||
|
<p>Once you have the prerequisites, open a command-line window, <code>cd</code> to the directory where you'd like to install PCjs,
|
||||||
|
and type the following commands:</p>
|
||||||
|
<pre><code>git clone git@github.com:jeffpar/pcjs.git pcjs
|
||||||
|
cd pcjs
|
||||||
|
npm install --production
|
||||||
|
node server.js</code></pre>
|
||||||
|
<p>Now open a web browser and go to <code>http://localhost:8088/</code>. You're done!</p>
|
||||||
|
<p>The current version of Node (<a href="http://nodejs.org/dist/v0.10.32/node-v0.10.32.pkg">0.10.32</a> at the time of this
|
||||||
|
writing) should work fine, but version <a href="http://nodejs.org/dist/v0.10.26/node-v0.10.26.pkg">0.10.26</a>
|
||||||
|
is what's been used to develop and test PCjs so far.</p>
|
||||||
|
<p>Also, <a href="server.js">server.js</a> was originally written using <a href="http://expressjs.com/">Express</a> v3. Since then,
|
||||||
|
Express v4 has been released, but the <code>npm install</code> command above will make sure that v3 is installed locally.</p>
|
||||||
|
<p>The plan is to eventually move development to a newer version of Node, and migrate the PCjs server to a newer
|
||||||
|
version of Express; there's no desire to remain stuck in the past (well, ignoring the fact that PCjs is the
|
||||||
|
quintessential "stuck in the past" project), but there's also no urgency to update.</p>
|
||||||
|
<h3 id="installing-pcjs-with-jekyll">Installing PCjs with Jekyll</h3>
|
||||||
|
<p>PCjs can also be used with <a href="http://jekyllrb.com">Jekyll</a> and the Ruby WEBrick web server, now that a
|
||||||
|
<em><a href="https://github.com/jeffpar/pcjs/tree/jekyll">jekyll</a></em> branch has been created to work with
|
||||||
|
<a href="https://pages.github.com">GitHub Pages</a>. This is how the project is currently set up at <a href="http://www.pcjs.org/">pcjs.org</a>.</p>
|
||||||
|
<p>This isn't going to be a Jekyll "How To" guide, because that would unnecessarily repeat all the information available
|
||||||
|
at <a href="https://pages.github.com">GitHub Pages</a>. But we'll summarize the basic steps, which replace the <code>npm</code> and <code>node</code>
|
||||||
|
steps above.</p>
|
||||||
|
<p>To install Jekyll for use with PCjs:</p>
|
||||||
|
<ol class="md-list">
|
||||||
|
<li>Install Ruby (on OS X, it should already be installed)</li>
|
||||||
|
<li>Install Bundler (on OS X, run <code>sudo gem install bundler</code>)</li>
|
||||||
|
<li>Checkout the <em>jekyll</em> branch, since only that branch contains all the Jekyll-related files</li>
|
||||||
|
<li>Create a <strong>Gemfile</strong> containing <code>gem 'github-pages'</code> (this is already checked in)</li>
|
||||||
|
<li>Run <code>bundle install</code> (GitHub Pages alternatively suggests: <code>bundle exec jekyll build --safe</code>)</li>
|
||||||
|
<li>Run <code>bundle exec jekyll serve</code> to start the web server</li>
|
||||||
|
</ol>
|
||||||
|
<p>Now open a web browser and go to <code>http://localhost:4000/</code>. You're done!</p>
|
||||||
|
<p>Some useful Jekyll server options include:</p>
|
||||||
|
<pre><code>bundle exec jekyll serve --host=0.0.0.0 --config _config.yml,_developer.yml</code></pre>
|
||||||
|
<p>The <em>--host</em> option makes it possible to access the web server from other devices on your local network;
|
||||||
|
for example, you may want to run PCjs on your iPhone, iPad, or other wireless device. And by adding <strong>_developer.yml</strong>,
|
||||||
|
you can override the Jekyll configuration defaults in <strong>_config.yml</strong>. Using development (non-production) settings in
|
||||||
|
<strong>_developer.yml</strong> is analogous to running the Node web server with certain development options; see
|
||||||
|
<a href="#debugging-pcjs">Debugging PCjs</a>.</p>
|
||||||
|
<p>GitHub Pages says you can run <code>jekyll serve</code> instead of <code>bundle exec jekyll serve</code>, but with the addition of
|
||||||
|
more gems to <strong>Gemfile</strong> (eg, "jekyll-sitemap"), running <code>jekyll serve</code> may trigger dependency errors on some systems.
|
||||||
|
<code>bundle exec jekyll serve</code> should always work.</p>
|
||||||
|
<p>Don't see any YML files in the root of your project? You probably forgot to switch to the
|
||||||
|
<em><a href="https://github.com/jeffpar/pcjs/tree/jekyll">jekyll</a></em> branch:</p>
|
||||||
|
<pre><code>git checkout jekyll</code></pre>
|
||||||
|
<p>Last but not least, run <code>bundle update</code> periodically to keep Jekyll up-to-date.</p>
|
||||||
|
<h3 id="building-pcjs">Building PCjs</h3>
|
||||||
|
<p>Unlike a typical project, where you have to <em>build</em> or <em>configure</em> or <em>make</em> something, PCjs is "ready to run".
|
||||||
|
That's because both the compiled and uncompiled versions of PCjs emulation modules are checked into the project,
|
||||||
|
making deployment to a web server easy.</p>
|
||||||
|
<p>However, in order to build and test PCjs modifications, you'll want to use <a href="http://gruntjs.com/">Grunt</a> and the
|
||||||
|
Grunt tasks defined by <a href="Gruntfile.js">Gruntfile.js</a>.</p>
|
||||||
|
<p>Although Grunt was installed locally when you ran <code>npm install</code>, you'll also want to install the command-line
|
||||||
|
interface to Grunt. You can install that locally as well, but it's recommended you install it globally with <em>-g</em>;
|
||||||
|
OS X users may also need to preface this command with <code>sudo</code>:</p>
|
||||||
|
<pre><code>npm install grunt-cli -g</code></pre>
|
||||||
|
<p>Now you can run <code>grunt</code> anywhere within the PCjs project to build an updated version. If no command-line arguments
|
||||||
|
are specified, <code>grunt</code> runs the "default" task defined by the project's <a href="Gruntfile.js">Gruntfile</a>; that task runs
|
||||||
|
Google's <a href="https://developers.google.com/closure/compiler/">Closure Compiler</a> if any of the target files (eg, pcx86.js
|
||||||
|
or pcx86-dbg.js in the <a href="/versions/">versions</a> directory) are out-of date.</p>
|
||||||
|
<p>To ensure consistent compilation results, a copy of the Closure Compiler has been checked into the
|
||||||
|
<a href="bin/">/bin</a> folder. This version of Closure Compiler, in turn, requires Java v7 or later. Use the following
|
||||||
|
commands to confirm that everything is working properly:</p>
|
||||||
|
<pre><code>java -version</code></pre>
|
||||||
|
<p>which should report a version >= 1.7; eg:</p>
|
||||||
|
<pre><code>java version "1.7.0_67"
|
||||||
|
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
|
||||||
|
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)</code></pre>
|
||||||
|
<p>Then run:</p>
|
||||||
|
<pre><code>java -jar bin/compiler.jar --version</code></pre>
|
||||||
|
<p>which should report:</p>
|
||||||
|
<pre><code>Closure Compiler (http://github.com/google/closure-compiler)
|
||||||
|
Version: v20160911
|
||||||
|
Built on: 2016-09-13 16:51</code></pre>
|
||||||
|
<p>If you don't have Java installed, it's recommended that you install the JDK (<em>not</em> the JRE), because the JRE may not
|
||||||
|
update your command-line tools properly. Note that Java is used <em>only</em> by the Closure Compiler; none of the PCjs
|
||||||
|
client or server components use Java.</p>
|
||||||
|
<p>Newer versions of the Closure Compiler should work as well, and at some point, a newer version will be checked into the
|
||||||
|
project.</p>
|
||||||
|
<h3 id="building-with-gulp-and-the-javascript-based-closure-compiler">Building with Gulp (and the JavaScript-based Closure Compiler)</h3>
|
||||||
|
<p>I've started dabbling with <a href="http://gulpjs.com/">Gulp</a>, but the current <a href="gulpfile.js">gulpfile</a> has a long way to
|
||||||
|
go before it can replace the <a href="Gruntfile.js">Gruntfile</a>. At the moment, all Gulp builds is a single emulation module with
|
||||||
|
hard-coded settings, using Google's new <a href="https://github.com/google/closure-compiler-js">JavaScript-based Closure Compiler</a>.</p>
|
||||||
|
<p>Here's what I installed to get Gulp working:</p>
|
||||||
|
<pre><code>sudo npm install -g gulp
|
||||||
|
npm install --save-dev gulp gulp-concat gulp-rename gulp-replace gulp-header gulp-foreach gulp-wrapper run-sequence
|
||||||
|
npm install --save-dev google-closure-compiler-js</code></pre>
|
||||||
|
<p>Running <code>gulp</code> should build a new <strong>pcx86.js</strong> in the <a href="/versions/">versions</a> directory. However,
|
||||||
|
you should consider Gulp support (and anything built with Gulp) as <strong>experimental</strong> until further notice.
|
||||||
|
The <a href="https://github.com/google/closure-compiler-js">JavaScript-based Closure Compiler</a> is in a state of
|
||||||
|
flux as well; for example, <em>output_wrapper</em> support is documented in their
|
||||||
|
<a href="https://developers.googleblog.com/2016/08/closure-compiler-in-javascript.html">blog</a> but hasn't been implemented yet.</p>
|
||||||
|
<h2 id="using-pcjs">Using PCjs</h2>
|
||||||
|
<h3 id="from-the-browser">From The Browser</h3>
|
||||||
|
<p>The PCjs Node web server is little more than a file/directory browser for the PCjs project, plus a collection of APIs.</p>
|
||||||
|
<p>If a URL corresponds to a PCjs project folder and no "index.html" exists in that folder, the Node web server loads
|
||||||
|
an HTML template (<a href="modules/shared/templates/common.html">common.html</a>) and generates an "index.html" for that folder.</p>
|
||||||
|
<p>The contents of the "index.html" will vary depending on the contents of the folder; for example, if the folder
|
||||||
|
contains a README.md, then that Markdown file is converted to HTML and embedded in the "index.html". Similarly,
|
||||||
|
if the folder contains a machine XML file, that is embedded as well.</p>
|
||||||
|
<p>To work well with both the Node and Jekyll web servers, all Markdown files containing one or more embedded machines
|
||||||
|
should contain a Jekyll "Front Matter" header that describes the machines. For example, here's the header from the
|
||||||
|
pcjs.org home page (<a href="https://github.com/jeffpar/pcjs/blob/jekyll/index.md">index.md</a>):</p>
|
||||||
|
<pre><code>---
|
||||||
|
layout: page
|
||||||
|
permalink: /
|
||||||
|
machines:
|
||||||
|
- id: ibm5150
|
||||||
|
type: pcx86
|
||||||
|
resume: 1
|
||||||
|
name: "IBM PC (Model 5150) with Monochrome Display"
|
||||||
|
config: /devices/pcx86/machine/5150/mda/64kb/machine.xml
|
||||||
|
- id: demoC1P
|
||||||
|
type: c1p
|
||||||
|
config: /devices/c1p/machine/8kb/large/machine.xml
|
||||||
|
---</code></pre>
|
||||||
|
<p>Then the following lines are inserted at the points where the machines should appear:</p>
|
||||||
|
<pre><code>{% include machine.html id="ibm5150" %}
|
||||||
|
...
|
||||||
|
{% include machine.html id="demoC1P" %}</code></pre>
|
||||||
|
<p>For more information on all the machine options supported in a Markdown file, see the project's Jekyll include file
|
||||||
|
<a href="https://github.com/jeffpar/pcjs/blob/jekyll/%5Fincludes/machine-engines.html">machine-engines.html</a>.</p>
|
||||||
|
<h3 id="from-the-command-line">From The Command-Line</h3>
|
||||||
|
<p>The PCx86 client app can also be run from the command-line mode using Node, making it possible to script the application,
|
||||||
|
run a series of automated tests, etc:</p>
|
||||||
|
<pre><code>cd modules/pcx86/bin
|
||||||
|
node pcx86</code></pre>
|
||||||
|
<p>The <a href="modules/pcx86/bin/pcx86">pcx86</a> script in <a href="modules/pcx86/bin">modules/pcx86/bin</a> loads
|
||||||
|
all the PCx86 browser scripts listed in the root <a href="/package.json">package.json</a> and then starts a Node REPL
|
||||||
|
("read-eval-print loop"). The REPL handles a few special commands (eg, "load", "quit") and passes anything else
|
||||||
|
to the PCx86 Debugger component. If no Debugger component has been created yet, or if the Debugger didn't recognize
|
||||||
|
the command, then it's passed on to <em>eval()</em>, like a good little REPL.</p>
|
||||||
|
<p>Use the "load" command to load a JSON machine configuration file. A sample
|
||||||
|
<a href="modules/pcx86/bin/ibm5150.json">ibm5150.json</a> is provided in the <em>bin</em> directory, which is a "JSON-ified" version
|
||||||
|
of the <a href="devices/pcx86/machine/5150/mda/64kb/machine.xml">machine.xml</a> displayed on the <a href="http://www.pcjs.org/">pcjs.org</a>
|
||||||
|
home page.</p>
|
||||||
|
<p>The command-line loader creates all the JSON-defined machine components in the same order that the browser creates
|
||||||
|
XML-defined components. You can also issue the "load" command directly from the command-line:</p>
|
||||||
|
<pre><code>node pcx86 --cmd="load ibm5150.json"</code></pre>
|
||||||
|
<p>In fact, any number of "--cmd" arguments can be included on the command-line. A batch file syntax will eventually be
|
||||||
|
added, too.</p>
|
||||||
|
<p>When a PCjs machine runs in a browser, an XML machine configuration file is transformed into HTML with a set of DIVs
|
||||||
|
for each component: an "object" DIV whose <em>data-value</em> attribute provides the initialization parameters for the
|
||||||
|
corresponding component, along with a set of optional "control" DIVs that the component can bind to (eg, a <strong>Run</strong> button,
|
||||||
|
or a visual representation of DIP switches, or whatever).</p>
|
||||||
|
<p>When a PCjs machine is run from the command-line, there is no XML, HTML, or DIVs involved; this is basically a
|
||||||
|
"headless" version of the machine, so there is no simple way to view its video display or interact with its keyboard,
|
||||||
|
mouse, etc. You have to use Debugger commands to dump the machine's video buffer.</p>
|
||||||
|
<p>Since I was not inclined to add XML support to my Node environment, this has created some divergence between client
|
||||||
|
and server operation: PCjs machines on the client supports <em>only</em> XML machine configuration files, whereas PCjs machines
|
||||||
|
on the server supports <em>only</em> JSON machine configuration files.</p>
|
||||||
|
<p>I haven't decided whether I'll add support for JSON configuration files to the client, or add some XML-to-JSON conversion
|
||||||
|
to the server, or both.</p>
|
||||||
|
<h2 id="debugging-pcjs">Debugging PCjs</h2>
|
||||||
|
<p>NOTE: The following information assumes you're running Node as your local web server, not Jekyll. You can certainly
|
||||||
|
debug PCjs while running Jekyll (ideally with <code>--config _config.yml,_developer.yml</code>), using <code>http://localhost:4000/</code>
|
||||||
|
and your favorite web browser's Developer Tools, but none of the special server or client features discussed below
|
||||||
|
will be available.</p>
|
||||||
|
<h3 id="server-components">Server Components</h3>
|
||||||
|
<p>To help test/debug changes to PCjs server components (eg, <a href="modules/diskdump/">DiskDump</a>, <a href="modules/htmlout/">HTMLOut</a>),
|
||||||
|
you can start the server with some additional options; eg:</p>
|
||||||
|
<pre><code>node server.js --logging --console --debug</code></pre>
|
||||||
|
<p>The <em>--logging</em> option will create a <a href="/logs/">node.log</a> that records all the HTTP requests, <em>--debug</em>
|
||||||
|
will generate additional debug-only messages (which will also be logged if <em>--logging</em> is enabled), and <em>--console</em>
|
||||||
|
will replicate any messages to your console as well.</p>
|
||||||
|
<p>If you want server.js to use a different port (the default is 8088), set PORT in your environment before starting
|
||||||
|
the server:</p>
|
||||||
|
<pre><code>export PORT=80</code></pre>
|
||||||
|
<p>or add <em>--port</em> to your command-line:</p>
|
||||||
|
<pre><code>node server.js --logging --console --debug --port=80</code></pre>
|
||||||
|
<p>A complete list of command-line options can be found in <a href="server.js">server.js</a>.</p>
|
||||||
|
<h3 id="client-components">Client Components</h3>
|
||||||
|
<p>A special command parameter ("gort") can be appended to the URL to request uncompiled client source files, making the
|
||||||
|
PCjs emulators much easier to debug, albeit much slower:</p>
|
||||||
|
<pre><code>http://localhost:8088/?gort=debug</code></pre>
|
||||||
|
<p>The "gort=debug" command is unnecessary if the server is started with <em>--debug</em>; the server always serves uncompiled
|
||||||
|
files when running in debug mode.</p>
|
||||||
|
<p>Conversely, if the server is in debug mode but you want to test a compiled version of PCx86, use:</p>
|
||||||
|
<pre><code>http://localhost:8088/?gort=release</code></pre>
|
||||||
|
<p>and the server will serve compiled JavaScript files, regardless whether the server is running in debug mode or
|
||||||
|
release mode.</p>
|
||||||
|
<p>Another useful gort command is "gort=nodebug", which is like "gort=debug" in that it serves uncompiled files, but
|
||||||
|
it <em>also</em> sets the client-side <strong>DEBUG</strong> variable to <strong>false</strong>, disabling all debug-only runtime checks in the client
|
||||||
|
and allowing the simulation to run much faster (although not as fast as compiled code):</p>
|
||||||
|
<pre><code>http://localhost:8088/?gort=nodebug</code></pre>
|
||||||
|
<p>Regrettably, the gort command "Klaatu barada nikto" is not yet recognized. Fortunately, there are no (known) situations
|
||||||
|
where PCjs could run amok and destroy the planet.</p>
|
||||||
|
<p>Other parameters that can be passed via the URL:</p>
|
||||||
|
<ul class="md-list md-list-compact">
|
||||||
|
<li><em>autostart</em>: set it to "true" to allow all machines to start normally, "false" to prevent all machines from starting,
|
||||||
|
or "no" to prevent all machines from starting <em>unless</em> they have no <strong>Run</strong> button; e.g.:</li>
|
||||||
|
</ul>
|
||||||
|
<pre><code>http://localhost:8088/?gort=debug&autostart=false</code></pre>
|
||||||
|
<ul class="md-list md-list-compact">
|
||||||
|
<li><em>aspect</em>: set it to a numeric value >= 0.3 and <= 3.33 to modify the default aspect ratio of a machine's screen on the
|
||||||
|
specified page; e.g.:</li>
|
||||||
|
</ul>
|
||||||
|
<pre><code>http://localhost:8088/?aspect=2.0</code></pre>
|
||||||
|
<ul class="md-list md-list-compact">
|
||||||
|
<li><em>resume</em>: set it to a numeric value (0-3) to override a machine's <em>resume</em> setting; e.g.:</li>
|
||||||
|
</ul>
|
||||||
|
<pre><code>http://localhost:8088/?resume=0</code></pre>
|
||||||
|
<p>More information about the <em>resume</em> attribute is available in the <a href="/docs/pcx86/computer/#attributes">documentation</a>.</p>
|
||||||
|
<h2 id="updating-pcjs">Updating PCjs</h2>
|
||||||
|
<h3 id="developing">Developing</h3>
|
||||||
|
<p>To start developing features for a new version of PCjs, here are the recommended steps:</p>
|
||||||
|
<ol class="md-list">
|
||||||
|
<li>Change the version number in the root <a href="package.json">package.json</a>
|
||||||
|
(and <a href="https://github.com/jeffpar/pcjs/blob/jekyll/%5Fconfig.yml">_config.yml</a>)</li>
|
||||||
|
<li>Run the "grunt promote" task to bump the version in all the machine XML files</li>
|
||||||
|
<li>Make changes</li>
|
||||||
|
<li>Run "grunt" to build new versions of the apps (eg, "/versions/pcx86/1.x.x/pcx86.js")</li>
|
||||||
|
</ol>
|
||||||
|
<p>You might also want to check out the blog post on <a href="http://www.pcjs.org/blog/2014/09/30/">PCjs Coding Conventions</a>.</p>
|
||||||
|
<p>You may also want to skip step #2 until you're ready to start testing the new version. Depending on the nature
|
||||||
|
of your changes, it may be better to manually edit the version number in only a few machine XML files for testing,
|
||||||
|
leaving the rest of the XML files pointing to the previous version. Run "grunt promote" when the new version is much
|
||||||
|
closer to being released.</p>
|
||||||
|
<h3 id="testing">Testing</h3>
|
||||||
|
<p>In the course of testing PCjs, there may be stale "index.html" files that prevent you from seeing application
|
||||||
|
updates, changes to README.md files, etc. So before running Node, you may want to "touch" the default HTML template:</p>
|
||||||
|
<pre><code>touch modules/shared/templates/common.html</code></pre>
|
||||||
|
<p>The <a href="modules/htmlout/">HTMLOut</a> module compares the timestamp of that template file to the timestamp of any
|
||||||
|
"index.html" and will regenerate the latter if it's out-of-date.</p>
|
||||||
|
<p>There's a TODO to expand that check to include the timestamp of any local README.md file, but there are many other
|
||||||
|
factors that can contribute to stale "index.html" files, so usually the safest thing to do is "touch" the
|
||||||
|
<a href="modules/shared/templates/common.html">common.html</a> template, or delete all existing "index.html" files, either
|
||||||
|
manually or with the Grunt "clean" task:</p>
|
||||||
|
<pre><code>grunt clean</code></pre>
|
||||||
|
<h2 id="license">License</h2>
|
||||||
|
<p>The <a href="https://github.com/jeffpar/pcjs">PCjs Project</a> is now an open-source project on <a href="http://github.com/">GitHub</a>.
|
||||||
|
All published portions are free for redistribution and/or modification under the terms of the
|
||||||
|
<a href="/LICENSE">GNU General Public License</a> as published by the Free Software Foundation, either version 3 of the License,
|
||||||
|
or (at your option) any later version.</p>
|
||||||
|
<p>You are required to include the following copyright notice, with a link to <a href="http://www.pcjs.org/">pcjs.org</a>:</p>
|
||||||
|
<blockquote>
|
||||||
|
<p><a href="http://www.pcjs.org/">PCjs</a> © 2012-2017 by <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a> (<a href="http://twitter.com/jeffpar">@jeffpar</a>)</p>
|
||||||
|
</blockquote>
|
||||||
|
<p>in every source code file of every copy or modified version of this work, and to display that notice on every web page
|
||||||
|
or computer that runs any version of this software.</p>
|
||||||
|
<p>See <a href="/LICENSE">LICENSE</a> for details.</p>
|
||||||
|
<h2 id="more-information">More Information</h2>
|
||||||
|
<p>Learn more about the <a href="/docs/about/">PCjs Project</a> and <a href="/docs/about/pcx86/">PCx86</a>. To
|
||||||
|
create your own PCx86 machines, see the <a href="/docs/pcx86/">PCx86 Documentation</a> for details.</p>
|
||||||
|
<p>If you have questions or run into any problems, feel free to <a href="http://twitter.com/jeffpar">tweet</a> or
|
||||||
|
<a href="mailto:Jeff@pcjs.org">email</a>.</p>
|
||||||
|
<div class="common-bottom">
|
||||||
|
<p class="common-reference"></p>
|
||||||
|
<p class="common-copyright">
|
||||||
|
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> © 2012-2017 by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
|
||||||
|
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs Project</a> released under <a href="http://gnu.org/licenses/gpl.html">GPLv3</a></span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="module" src="/modules/shared/lib/globals.js"></script>
|
||||||
|
<script type="module" src="/modules/shared/lib/test.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -62,8 +62,12 @@ var pkg = require("../../../package.json");
|
||||||
/*
|
/*
|
||||||
* fCache controls "index.html" caching; it is true by default and can be overridden using the setOptions()
|
* fCache controls "index.html" caching; it is true by default and can be overridden using the setOptions()
|
||||||
* 'cache' property.
|
* 'cache' property.
|
||||||
|
*
|
||||||
|
* NOTE: Even though we don't explicitly set fCache to true, that's the default, because we disable caching
|
||||||
|
* only when fCache is explicitly false; this is so we can detect when it has been explicitly set to true,
|
||||||
|
* ensuring that we cache files even when other settings (like fServerDebug) might suggest we shouldn't cache.
|
||||||
*/
|
*/
|
||||||
var fCache = true;
|
var fCache;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* fConsole controls console messages; it is false by default and can be overridden using the setOptions()
|
* fConsole controls console messages; it is false by default and can be overridden using the setOptions()
|
||||||
|
|
@ -326,7 +330,7 @@ function HTMLOut(sPath, sFile, fRebuild, req, done)
|
||||||
* Check the global cache setting, as well as the presence of ANY special commands
|
* Check the global cache setting, as well as the presence of ANY special commands
|
||||||
* that we would never want to cache.
|
* that we would never want to cache.
|
||||||
*/
|
*/
|
||||||
if (!fCache || fServerDebug || net.hasParm(net.GORT_COMMAND, null, req) || net.hasParm(net.REVEAL_COMMAND, null, req)) {
|
if (fCache === false || fServerDebug && !fCache || net.hasParm(net.GORT_COMMAND, null, req) || net.hasParm(net.REVEAL_COMMAND, null, req)) {
|
||||||
this.loadFile(this.sTemplateFile, true);
|
this.loadFile(this.sTemplateFile, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -193,10 +193,10 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
initMemory()
|
initMemory()
|
||||||
{
|
{
|
||||||
var block = new Memory();
|
let block = new Memory();
|
||||||
block.copyBreakpoints(this.dbg);
|
block.copyBreakpoints(this.dbg);
|
||||||
this.aMemBlocks = new Array(this.nBlockTotal);
|
this.aMemBlocks = new Array(this.nBlockTotal);
|
||||||
for (var iBlock = 0; iBlock < this.nBlockTotal; iBlock++) {
|
for (let iBlock = 0; iBlock < this.nBlockTotal; iBlock++) {
|
||||||
this.aMemBlocks[iBlock] = block;
|
this.aMemBlocks[iBlock] = block;
|
||||||
}
|
}
|
||||||
this.cpu.initMemory(this.aMemBlocks, this.nBlockShift);
|
this.cpu.initMemory(this.aMemBlocks, this.nBlockShift);
|
||||||
|
|
@ -270,15 +270,15 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
addMemory(addr, size, type, controller)
|
addMemory(addr, size, type, controller)
|
||||||
{
|
{
|
||||||
var addrNext = addr;
|
let addrNext = addr;
|
||||||
var sizeLeft = size;
|
let sizeLeft = size;
|
||||||
var iBlock = addrNext >>> this.nBlockShift;
|
let iBlock = addrNext >>> this.nBlockShift;
|
||||||
|
|
||||||
while (sizeLeft > 0 && iBlock < this.aMemBlocks.length) {
|
while (sizeLeft > 0 && iBlock < this.aMemBlocks.length) {
|
||||||
|
|
||||||
var block = this.aMemBlocks[iBlock];
|
let block = this.aMemBlocks[iBlock];
|
||||||
var addrBlock = iBlock * this.nBlockSize;
|
let addrBlock = iBlock * this.nBlockSize;
|
||||||
var sizeBlock = this.nBlockSize - (addrNext - addrBlock);
|
let sizeBlock = this.nBlockSize - (addrNext - addrBlock);
|
||||||
if (sizeBlock > sizeLeft) sizeBlock = sizeLeft;
|
if (sizeBlock > sizeLeft) sizeBlock = sizeLeft;
|
||||||
|
|
||||||
if (block && block.size) {
|
if (block && block.size) {
|
||||||
|
|
@ -295,7 +295,7 @@ class Bus extends Component {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (addrNext >= block.addr + block.used) {
|
if (addrNext >= block.addr + block.used) {
|
||||||
var sizeAvail = block.size - (addrNext - addrBlock);
|
let sizeAvail = block.size - (addrNext - addrBlock);
|
||||||
if (sizeAvail > sizeLeft) sizeAvail = sizeLeft;
|
if (sizeAvail > sizeLeft) sizeAvail = sizeLeft;
|
||||||
block.used = addrNext - block.addr + sizeAvail;
|
block.used = addrNext - block.addr + sizeAvail;
|
||||||
addrNext = addrBlock + this.nBlockSize;
|
addrNext = addrBlock + this.nBlockSize;
|
||||||
|
|
@ -307,7 +307,7 @@ class Bus extends Component {
|
||||||
return this.reportError(Bus.ERROR.ADD_MEM_INUSE, addrNext, sizeLeft);
|
return this.reportError(Bus.ERROR.ADD_MEM_INUSE, addrNext, sizeLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
var blockNew = new Memory(addrNext, sizeBlock, this.nBlockSize, type, controller);
|
let blockNew = new Memory(addrNext, sizeBlock, this.nBlockSize, type, controller);
|
||||||
blockNew.copyBreakpoints(this.dbg, block);
|
blockNew.copyBreakpoints(this.dbg, block);
|
||||||
this.aMemBlocks[iBlock++] = blockNew;
|
this.aMemBlocks[iBlock++] = blockNew;
|
||||||
|
|
||||||
|
|
@ -326,8 +326,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
this.cpu.flushPageBlocks();
|
this.cpu.flushPageBlocks();
|
||||||
if (!this.cpu.isRunning()) { // allocation messages at "run time" are bit too much
|
if (!this.cpu.isRunning()) { // allocation messages at "run time" are bit too much
|
||||||
var kb = (size / 1024)|0;
|
let kb = (size / 1024)|0;
|
||||||
var sb = kb? (kb + "Kb ") : (size + " bytes ");
|
let sb = kb? (kb + "Kb ") : (size + " bytes ");
|
||||||
this.status(sb + Memory.TYPE.NAMES[type] + " at " + Str.toHex(addr));
|
this.status(sb + Memory.TYPE.NAMES[type] + " at " + Str.toHex(addr));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -345,9 +345,9 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
cleanMemory(addr, size)
|
cleanMemory(addr, size)
|
||||||
{
|
{
|
||||||
var fClean = true;
|
let fClean = true;
|
||||||
var iBlock = addr >>> this.nBlockShift;
|
let iBlock = addr >>> this.nBlockShift;
|
||||||
var sizeBlock = this.nBlockSize - (addr & this.nBlockLimit);
|
let sizeBlock = this.nBlockSize - (addr & this.nBlockLimit);
|
||||||
while (size > 0 && iBlock < this.aMemBlocks.length) {
|
while (size > 0 && iBlock < this.aMemBlocks.length) {
|
||||||
if (this.aMemBlocks[iBlock].fDirty) {
|
if (this.aMemBlocks[iBlock].fDirty) {
|
||||||
this.aMemBlocks[iBlock].fDirty = fClean = false;
|
this.aMemBlocks[iBlock].fDirty = fClean = false;
|
||||||
|
|
@ -377,16 +377,16 @@ class Bus extends Component {
|
||||||
if (size == null) size = (this.addrTotal - addr) | 0;
|
if (size == null) size = (this.addrTotal - addr) | 0;
|
||||||
if (info == null) info = {cbTotal: 0, cBlocks: 0, aBlocks: []};
|
if (info == null) info = {cbTotal: 0, cBlocks: 0, aBlocks: []};
|
||||||
|
|
||||||
var iBlock = addr >>> this.nBlockShift;
|
let iBlock = addr >>> this.nBlockShift;
|
||||||
var iBlockMax = ((addr + size - 1) >>> this.nBlockShift);
|
let iBlockMax = ((addr + size - 1) >>> this.nBlockShift);
|
||||||
|
|
||||||
info.cbTotal = 0;
|
info.cbTotal = 0;
|
||||||
info.cBlocks = 0;
|
info.cBlocks = 0;
|
||||||
while (iBlock <= iBlockMax) {
|
while (iBlock <= iBlockMax) {
|
||||||
var block = this.aMemBlocks[iBlock];
|
let block = this.aMemBlocks[iBlock];
|
||||||
info.cbTotal += block.size;
|
info.cbTotal += block.size;
|
||||||
if (block.size) {
|
if (block.size) {
|
||||||
var btmod = (BACKTRACK && block.modBackTrack(false)? 1 : 0);
|
let btmod = (BACKTRACK && block.modBackTrack(false)? 1 : 0);
|
||||||
info.aBlocks.push(Usr.initBitFields(Bus.BlockInfo, iBlock, 0, btmod, block.type));
|
info.aBlocks.push(Usr.initBitFields(Bus.BlockInfo, iBlock, 0, btmod, block.type));
|
||||||
info.cBlocks++
|
info.cBlocks++
|
||||||
}
|
}
|
||||||
|
|
@ -440,7 +440,7 @@ class Bus extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (this.nBusWidth > 20) {
|
else if (this.nBusWidth > 20) {
|
||||||
var addrMask = (this.nBusMask & ~0x100000) | (fEnable? 0x100000 : 0);
|
let addrMask = (this.nBusMask & ~0x100000) | (fEnable? 0x100000 : 0);
|
||||||
if (addrMask != this.nBusMask) {
|
if (addrMask != this.nBusMask) {
|
||||||
this.nBusMask = addrMask;
|
this.nBusMask = addrMask;
|
||||||
if (this.cpu) this.cpu.setAddressMask(addrMask);
|
if (this.cpu) this.cpu.setAddressMask(addrMask);
|
||||||
|
|
@ -476,9 +476,9 @@ class Bus extends Component {
|
||||||
setMemoryAccess(addr, size, afn, fQuiet)
|
setMemoryAccess(addr, size, afn, fQuiet)
|
||||||
{
|
{
|
||||||
if (!(addr & this.nBlockLimit) && size && !(size & this.nBlockLimit)) {
|
if (!(addr & this.nBlockLimit) && size && !(size & this.nBlockLimit)) {
|
||||||
var iBlock = addr >>> this.nBlockShift;
|
let iBlock = addr >>> this.nBlockShift;
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
var block = this.aMemBlocks[iBlock];
|
let block = this.aMemBlocks[iBlock];
|
||||||
if (!block.controller) {
|
if (!block.controller) {
|
||||||
return this.reportError(Bus.ERROR.SET_MEM_NOCTRL, addr, size, fQuiet);
|
return this.reportError(Bus.ERROR.SET_MEM_NOCTRL, addr, size, fQuiet);
|
||||||
}
|
}
|
||||||
|
|
@ -506,10 +506,10 @@ class Bus extends Component {
|
||||||
removeMemory(addr, size)
|
removeMemory(addr, size)
|
||||||
{
|
{
|
||||||
if (!(addr & this.nBlockLimit) && size && !(size & this.nBlockLimit)) {
|
if (!(addr & this.nBlockLimit) && size && !(size & this.nBlockLimit)) {
|
||||||
var iBlock = addr >>> this.nBlockShift;
|
let iBlock = addr >>> this.nBlockShift;
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
var blockOld = this.aMemBlocks[iBlock];
|
let blockOld = this.aMemBlocks[iBlock];
|
||||||
var blockNew = new Memory(addr);
|
let blockNew = new Memory(addr);
|
||||||
blockNew.copyBreakpoints(this.dbg, blockOld);
|
blockNew.copyBreakpoints(this.dbg, blockOld);
|
||||||
this.aMemBlocks[iBlock++] = blockNew;
|
this.aMemBlocks[iBlock++] = blockNew;
|
||||||
addr = iBlock * this.nBlockSize;
|
addr = iBlock * this.nBlockSize;
|
||||||
|
|
@ -540,8 +540,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
getMemoryBlocks(addr, size)
|
getMemoryBlocks(addr, size)
|
||||||
{
|
{
|
||||||
var aBlocks = [];
|
let aBlocks = [];
|
||||||
var iBlock = addr >>> this.nBlockShift;
|
let iBlock = addr >>> this.nBlockShift;
|
||||||
while (size > 0 && iBlock < this.aMemBlocks.length) {
|
while (size > 0 && iBlock < this.aMemBlocks.length) {
|
||||||
aBlocks.push(this.aMemBlocks[iBlock++]);
|
aBlocks.push(this.aMemBlocks[iBlock++]);
|
||||||
size -= this.nBlockSize;
|
size -= this.nBlockSize;
|
||||||
|
|
@ -566,14 +566,14 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
setMemoryBlocks(addr, size, aBlocks, type)
|
setMemoryBlocks(addr, size, aBlocks, type)
|
||||||
{
|
{
|
||||||
var i = 0;
|
let i = 0;
|
||||||
var iBlock = addr >>> this.nBlockShift;
|
let iBlock = addr >>> this.nBlockShift;
|
||||||
while (size > 0 && iBlock < this.aMemBlocks.length) {
|
while (size > 0 && iBlock < this.aMemBlocks.length) {
|
||||||
var block = aBlocks[i++];
|
let block = aBlocks[i++];
|
||||||
this.assert(block);
|
this.assert(block);
|
||||||
if (!block) break;
|
if (!block) break;
|
||||||
if (type !== undefined) {
|
if (type !== undefined) {
|
||||||
var blockNew = new Memory(addr);
|
let blockNew = new Memory(addr);
|
||||||
blockNew.clone(block, type, this.dbg);
|
blockNew.clone(block, type, this.dbg);
|
||||||
block = blockNew;
|
block = blockNew;
|
||||||
}
|
}
|
||||||
|
|
@ -621,8 +621,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
getShort(addr)
|
getShort(addr)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off != this.nBlockLimit) {
|
if (off != this.nBlockLimit) {
|
||||||
return this.aMemBlocks[iBlock].readShort(off, addr);
|
return this.aMemBlocks[iBlock].readShort(off, addr);
|
||||||
}
|
}
|
||||||
|
|
@ -640,8 +640,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
getShortDirect(addr)
|
getShortDirect(addr)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off != this.nBlockLimit) {
|
if (off != this.nBlockLimit) {
|
||||||
return this.aMemBlocks[iBlock].readShortDirect(off, addr);
|
return this.aMemBlocks[iBlock].readShortDirect(off, addr);
|
||||||
}
|
}
|
||||||
|
|
@ -659,8 +659,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
getLong(addr)
|
getLong(addr)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off < this.nBlockLimit - 2) {
|
if (off < this.nBlockLimit - 2) {
|
||||||
return this.aMemBlocks[iBlock].readLong(off, addr);
|
return this.aMemBlocks[iBlock].readLong(off, addr);
|
||||||
}
|
}
|
||||||
|
|
@ -670,9 +670,9 @@ class Bus extends Component {
|
||||||
* which may have also created some undesirable side-effects for custom memory controllers.
|
* which may have also created some undesirable side-effects for custom memory controllers.
|
||||||
* This simpler (and probably more reliable) approach is to simply read the long as individual bytes.
|
* This simpler (and probably more reliable) approach is to simply read the long as individual bytes.
|
||||||
*/
|
*/
|
||||||
var l = 0;
|
let l = 0;
|
||||||
var cb = 4, nShift = 0;
|
let cb = 4, nShift = 0;
|
||||||
var cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
let cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
||||||
while (cb--) {
|
while (cb--) {
|
||||||
l |= (this.aMemBlocks[iBlock].readByte(off++, addr++) << nShift);
|
l |= (this.aMemBlocks[iBlock].readByte(off++, addr++) << nShift);
|
||||||
if (!--cbBlock) {
|
if (!--cbBlock) {
|
||||||
|
|
@ -724,8 +724,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
setShort(addr, w)
|
setShort(addr, w)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off != this.nBlockLimit) {
|
if (off != this.nBlockLimit) {
|
||||||
this.aMemBlocks[iBlock].writeShort(off, w & 0xffff, addr);
|
this.aMemBlocks[iBlock].writeShort(off, w & 0xffff, addr);
|
||||||
return;
|
return;
|
||||||
|
|
@ -746,8 +746,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
setShortDirect(addr, w)
|
setShortDirect(addr, w)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off != this.nBlockLimit) {
|
if (off != this.nBlockLimit) {
|
||||||
this.aMemBlocks[iBlock].writeShortDirect(off, w & 0xffff, addr);
|
this.aMemBlocks[iBlock].writeShortDirect(off, w & 0xffff, addr);
|
||||||
return;
|
return;
|
||||||
|
|
@ -767,8 +767,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
setLong(addr, l)
|
setLong(addr, l)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off < this.nBlockLimit - 2) {
|
if (off < this.nBlockLimit - 2) {
|
||||||
this.aMemBlocks[iBlock].writeLong(off, l);
|
this.aMemBlocks[iBlock].writeLong(off, l);
|
||||||
return;
|
return;
|
||||||
|
|
@ -779,8 +779,8 @@ class Bus extends Component {
|
||||||
* block), which may have also created some undesirable side-effects for custom memory controllers.
|
* block), which may have also created some undesirable side-effects for custom memory controllers.
|
||||||
* This simpler (and probably more reliable) approach is to simply write the long as individual bytes.
|
* This simpler (and probably more reliable) approach is to simply write the long as individual bytes.
|
||||||
*/
|
*/
|
||||||
var cb = 4;
|
let cb = 4;
|
||||||
var cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
let cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
||||||
while (cb--) {
|
while (cb--) {
|
||||||
this.aMemBlocks[iBlock].writeByte(off++, l & 0xff, addr++);
|
this.aMemBlocks[iBlock].writeByte(off++, l & 0xff, addr++);
|
||||||
if (!--cbBlock) {
|
if (!--cbBlock) {
|
||||||
|
|
@ -808,7 +808,7 @@ class Bus extends Component {
|
||||||
addBackTrackObject(obj, bto, off)
|
addBackTrackObject(obj, bto, off)
|
||||||
{
|
{
|
||||||
if (BACKTRACK && obj) {
|
if (BACKTRACK && obj) {
|
||||||
var cbtObjects = this.abtObjects.length;
|
let cbtObjects = this.abtObjects.length;
|
||||||
if (!bto) {
|
if (!bto) {
|
||||||
/*
|
/*
|
||||||
* Try the most recently created bto, on the off-chance it's what the caller needs
|
* Try the most recently created bto, on the off-chance it's what the caller needs
|
||||||
|
|
@ -819,12 +819,12 @@ class Bus extends Component {
|
||||||
|
|
||||||
bto = {obj: obj, off: off, slot: 0, refs: 0};
|
bto = {obj: obj, off: off, slot: 0, refs: 0};
|
||||||
|
|
||||||
var slot;
|
let slot;
|
||||||
if (!this.cbtDeletions) {
|
if (!this.cbtDeletions) {
|
||||||
slot = cbtObjects;
|
slot = cbtObjects;
|
||||||
} else {
|
} else {
|
||||||
for (slot = this.ibtLastDelete; slot < cbtObjects; slot++) {
|
for (slot = this.ibtLastDelete; slot < cbtObjects; slot++) {
|
||||||
var btoTest = this.abtObjects[slot];
|
let btoTest = this.abtObjects[slot];
|
||||||
if (!btoTest || !btoTest.refs && !this.isBackTrackWeak(slot << Bus.BTINFO.SLOT_SHIFT)) {
|
if (!btoTest || !btoTest.refs && !this.isBackTrackWeak(slot << Bus.BTINFO.SLOT_SHIFT)) {
|
||||||
this.ibtLastDelete = slot + 1;
|
this.ibtLastDelete = slot + 1;
|
||||||
this.cbtDeletions--;
|
this.cbtDeletions--;
|
||||||
|
|
@ -881,7 +881,7 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
getBackTrackIndex(bto, off)
|
getBackTrackIndex(bto, off)
|
||||||
{
|
{
|
||||||
var bti = 0;
|
let bti = 0;
|
||||||
if (BACKTRACK && bto) {
|
if (BACKTRACK && bto) {
|
||||||
bti = (bto.slot << Bus.BTINFO.SLOT_SHIFT) | Bus.BTINFO.TYPE_DATA | (off - bto.off);
|
bti = (bto.slot << Bus.BTINFO.SLOT_SHIFT) | Bus.BTINFO.TYPE_DATA | (off - bto.off);
|
||||||
}
|
}
|
||||||
|
|
@ -900,7 +900,7 @@ class Bus extends Component {
|
||||||
{
|
{
|
||||||
if (BACKTRACK && bto) {
|
if (BACKTRACK && bto) {
|
||||||
this.assert(off - bto.off >= 0 && off - bto.off < Bus.BTINFO.OFF_MAX);
|
this.assert(off - bto.off >= 0 && off - bto.off < Bus.BTINFO.OFF_MAX);
|
||||||
var bti = (bto.slot << Bus.BTINFO.SLOT_SHIFT) | Bus.BTINFO.TYPE_DATA | (off - bto.off);
|
let bti = (bto.slot << Bus.BTINFO.SLOT_SHIFT) | Bus.BTINFO.TYPE_DATA | (off - bto.off);
|
||||||
this.writeBackTrack(addr, bti);
|
this.writeBackTrack(addr, bti);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -930,14 +930,14 @@ class Bus extends Component {
|
||||||
writeBackTrack(addr, bti)
|
writeBackTrack(addr, bti)
|
||||||
{
|
{
|
||||||
if (BACKTRACK) {
|
if (BACKTRACK) {
|
||||||
var slot = bti >>> Bus.BTINFO.SLOT_SHIFT;
|
let slot = bti >>> Bus.BTINFO.SLOT_SHIFT;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
var btiPrev = this.aMemBlocks[iBlock].writeBackTrack(addr & this.nBlockLimit, bti);
|
let btiPrev = this.aMemBlocks[iBlock].writeBackTrack(addr & this.nBlockLimit, bti);
|
||||||
var slotPrev = btiPrev >>> Bus.BTINFO.SLOT_SHIFT;
|
let slotPrev = btiPrev >>> Bus.BTINFO.SLOT_SHIFT;
|
||||||
if (slot != slotPrev) {
|
if (slot != slotPrev) {
|
||||||
this.aMemBlocks[iBlock].modBackTrack(true);
|
this.aMemBlocks[iBlock].modBackTrack(true);
|
||||||
if (btiPrev && slotPrev) {
|
if (btiPrev && slotPrev) {
|
||||||
var btoPrev = this.abtObjects[slotPrev-1];
|
let btoPrev = this.abtObjects[slotPrev-1];
|
||||||
if (!btoPrev) {
|
if (!btoPrev) {
|
||||||
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(Messages.WARN)) {
|
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(Messages.WARN)) {
|
||||||
this.dbg.message("writeBackTrack(%" + Str.toHex(addr) + ',' + Str.toHex(bti) + "): previous index (" + Str.toHex(btiPrev) + ") refers to empty slot (" + slotPrev + ")");
|
this.dbg.message("writeBackTrack(%" + Str.toHex(addr) + ',' + Str.toHex(bti) + "): previous index (" + Str.toHex(btiPrev) + ") refers to empty slot (" + slotPrev + ")");
|
||||||
|
|
@ -979,7 +979,7 @@ class Bus extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bti && slot) {
|
if (bti && slot) {
|
||||||
var bto = this.abtObjects[slot-1];
|
let bto = this.abtObjects[slot-1];
|
||||||
if (bto) {
|
if (bto) {
|
||||||
this.assert(slot == bto.slot);
|
this.assert(slot == bto.slot);
|
||||||
bto.refs++;
|
bto.refs++;
|
||||||
|
|
@ -997,8 +997,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
isBackTrackWeak(bti)
|
isBackTrackWeak(bti)
|
||||||
{
|
{
|
||||||
var bt = this.cpu.backTrack;
|
let bt = this.cpu.backTrack;
|
||||||
var slot = bti >> Bus.BTINFO.SLOT_SHIFT;
|
let slot = bti >> Bus.BTINFO.SLOT_SHIFT;
|
||||||
return (bt.btiAL >> Bus.BTINFO.SLOT_SHIFT == slot ||
|
return (bt.btiAL >> Bus.BTINFO.SLOT_SHIFT == slot ||
|
||||||
bt.btiAH >> Bus.BTINFO.SLOT_SHIFT == slot ||
|
bt.btiAH >> Bus.BTINFO.SLOT_SHIFT == slot ||
|
||||||
bt.btiBL >> Bus.BTINFO.SLOT_SHIFT == slot ||
|
bt.btiBL >> Bus.BTINFO.SLOT_SHIFT == slot ||
|
||||||
|
|
@ -1047,7 +1047,7 @@ class Bus extends Component {
|
||||||
getBackTrackObject(bti)
|
getBackTrackObject(bti)
|
||||||
{
|
{
|
||||||
if (BACKTRACK) {
|
if (BACKTRACK) {
|
||||||
var slot = bti >>> Bus.BTINFO.SLOT_SHIFT;
|
let slot = bti >>> Bus.BTINFO.SLOT_SHIFT;
|
||||||
if (slot) return this.abtObjects[slot-1];
|
if (slot) return this.abtObjects[slot-1];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -1065,10 +1065,10 @@ class Bus extends Component {
|
||||||
getBackTrackInfo(bti, fSymbol, fNearest)
|
getBackTrackInfo(bti, fSymbol, fNearest)
|
||||||
{
|
{
|
||||||
if (BACKTRACK) {
|
if (BACKTRACK) {
|
||||||
var bto = this.getBackTrackObject(bti);
|
let bto = this.getBackTrackObject(bti);
|
||||||
if (bto) {
|
if (bto) {
|
||||||
var off = bti & Bus.BTINFO.OFF_MASK;
|
let off = bti & Bus.BTINFO.OFF_MASK;
|
||||||
var file = bto.obj.file;
|
let file = bto.obj.file;
|
||||||
if (file) {
|
if (file) {
|
||||||
this.assert(!bto.off);
|
this.assert(!bto.off);
|
||||||
return file.getSymbol(bto.obj.offFile + off, fNearest);
|
return file.getSymbol(bto.obj.offFile + off, fNearest);
|
||||||
|
|
@ -1127,18 +1127,18 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
saveMemory(fAll)
|
saveMemory(fAll)
|
||||||
{
|
{
|
||||||
var i = 0;
|
let i = 0;
|
||||||
var a = [];
|
let a = [];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A quick-and-dirty work-around for 32-bit bus machines, to ensure that all blocks in the 2nd Mb are
|
* A quick-and-dirty work-around for 32-bit bus machines, to ensure that all blocks in the 2nd Mb are
|
||||||
* mapped in before we save. We do this by forcing A20 on, and then turning it off again before we leave.
|
* mapped in before we save. We do this by forcing A20 on, and then turning it off again before we leave.
|
||||||
*/
|
*/
|
||||||
var fA20 = this.getA20();
|
let fA20 = this.getA20();
|
||||||
if (!fA20) this.setA20(true);
|
if (!fA20) this.setA20(true);
|
||||||
|
|
||||||
for (var iBlock = 0; iBlock < this.nBlockTotal; iBlock++) {
|
for (let iBlock = 0; iBlock < this.nBlockTotal; iBlock++) {
|
||||||
var block = this.aMemBlocks[iBlock];
|
let block = this.aMemBlocks[iBlock];
|
||||||
/*
|
/*
|
||||||
* We have to check both fDirty and fDirtyEver, because we may have called cleanMemory() on some of
|
* We have to check both fDirty and fDirtyEver, because we may have called cleanMemory() on some of
|
||||||
* the memory blocks (eg, video memory), and while cleanMemory() will clear a dirty block's fDirty flag,
|
* the memory blocks (eg, video memory), and while cleanMemory() will clear a dirty block's fDirty flag,
|
||||||
|
|
@ -1175,14 +1175,14 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
restoreMemory(a)
|
restoreMemory(a)
|
||||||
{
|
{
|
||||||
var i;
|
let i;
|
||||||
for (i = 0; i < a.length - 1; i += 2) {
|
for (i = 0; i < a.length - 1; i += 2) {
|
||||||
var iBlock = a[i];
|
let iBlock = a[i];
|
||||||
var adw = a[i+1];
|
let adw = a[i+1];
|
||||||
if (adw && adw.length < this.nBlockLen) {
|
if (adw && adw.length < this.nBlockLen) {
|
||||||
adw = State.decompress(adw, this.nBlockLen);
|
adw = State.decompress(adw, this.nBlockLen);
|
||||||
}
|
}
|
||||||
var block = this.aMemBlocks[iBlock];
|
let block = this.aMemBlocks[iBlock];
|
||||||
if (!block || !block.restore(adw)) {
|
if (!block || !block.restore(adw)) {
|
||||||
/*
|
/*
|
||||||
* Either the block to restore hasn't been allocated, indicating a change in the machine
|
* Either the block to restore hasn't been allocated, indicating a change in the machine
|
||||||
|
|
@ -1230,7 +1230,7 @@ class Bus extends Component {
|
||||||
addPortInputNotify(start, end, fn)
|
addPortInputNotify(start, end, fn)
|
||||||
{
|
{
|
||||||
if (fn !== undefined) {
|
if (fn !== undefined) {
|
||||||
for (var port = start; port <= end; port++) {
|
for (let port = start; port <= end; port++) {
|
||||||
if (this.aPortInputNotify[port] !== undefined) {
|
if (this.aPortInputNotify[port] !== undefined) {
|
||||||
Component.warning("Input port " + Str.toHexWord(port) + " already registered");
|
Component.warning("Input port " + Str.toHexWord(port) + " already registered");
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -1254,7 +1254,7 @@ class Bus extends Component {
|
||||||
addPortInputTable(component, table, offset)
|
addPortInputTable(component, table, offset)
|
||||||
{
|
{
|
||||||
if (offset === undefined) offset = 0;
|
if (offset === undefined) offset = 0;
|
||||||
for (var port in table) {
|
for (let port in table) {
|
||||||
this.addPortInputNotify(+port + offset, +port + offset, table[port].bind(component));
|
this.addPortInputNotify(+port + offset, +port + offset, table[port].bind(component));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1287,14 +1287,14 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
checkPortInputNotify(port, size, addrLIP)
|
checkPortInputNotify(port, size, addrLIP)
|
||||||
{
|
{
|
||||||
var data = 0, shift = 0;
|
let data = 0, shift = 0;
|
||||||
|
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
|
|
||||||
var aNotify = this.aPortInputNotify[port];
|
let aNotify = this.aPortInputNotify[port];
|
||||||
var sizePort = this.aPortInputWidth[port] || 1;
|
let sizePort = this.aPortInputWidth[port] || 1;
|
||||||
var maskPort = (sizePort == 1? 0xff : (sizePort == 2? 0xffff : -1));
|
let maskPort = (sizePort == 1? 0xff : (sizePort == 2? 0xffff : -1));
|
||||||
var dataPort = maskPort;
|
let dataPort = maskPort;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO: We need to decide what to do about 8-bit I/O to a 16-bit port (ditto for 16-bit I/O
|
* TODO: We need to decide what to do about 8-bit I/O to a 16-bit port (ditto for 16-bit I/O
|
||||||
|
|
@ -1372,7 +1372,7 @@ class Bus extends Component {
|
||||||
addPortOutputNotify(start, end, fn)
|
addPortOutputNotify(start, end, fn)
|
||||||
{
|
{
|
||||||
if (fn !== undefined) {
|
if (fn !== undefined) {
|
||||||
for (var port = start; port <= end; port++) {
|
for (let port = start; port <= end; port++) {
|
||||||
if (this.aPortOutputNotify[port] !== undefined) {
|
if (this.aPortOutputNotify[port] !== undefined) {
|
||||||
Component.warning("Output port " + Str.toHexWord(port) + " already registered");
|
Component.warning("Output port " + Str.toHexWord(port) + " already registered");
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -1396,7 +1396,7 @@ class Bus extends Component {
|
||||||
addPortOutputTable(component, table, offset)
|
addPortOutputTable(component, table, offset)
|
||||||
{
|
{
|
||||||
if (offset === undefined) offset = 0;
|
if (offset === undefined) offset = 0;
|
||||||
for (var port in table) {
|
for (let port in table) {
|
||||||
this.addPortOutputNotify(+port + offset, +port + offset, table[port].bind(component));
|
this.addPortOutputNotify(+port + offset, +port + offset, table[port].bind(component));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1426,14 +1426,14 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
checkPortOutputNotify(port, size, data, addrLIP)
|
checkPortOutputNotify(port, size, data, addrLIP)
|
||||||
{
|
{
|
||||||
var shift = 0;
|
let shift = 0;
|
||||||
|
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
|
|
||||||
var aNotify = this.aPortOutputNotify[port];
|
let aNotify = this.aPortOutputNotify[port];
|
||||||
var sizePort = this.aPortOutputWidth[port] || 1;
|
let sizePort = this.aPortOutputWidth[port] || 1;
|
||||||
var maskPort = (sizePort == 1? 0xff : (sizePort == 2? 0xffff : -1));
|
let maskPort = (sizePort == 1? 0xff : (sizePort == 2? 0xffff : -1));
|
||||||
var dataPort = (data >>>= shift) & maskPort;
|
let dataPort = (data >>>= shift) & maskPort;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO: We need to decide what to do about 8-bit I/O to a 16-bit port (ditto for 16-bit I/O
|
* TODO: We need to decide what to do about 8-bit I/O to a 16-bit port (ditto for 16-bit I/O
|
||||||
|
|
@ -1478,7 +1478,7 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
reportError(op, addr, size, fQuiet)
|
reportError(op, addr, size, fQuiet)
|
||||||
{
|
{
|
||||||
var sError = "Memory block error (" + op + ": " + Str.toHex(addr) + "," + Str.toHex(size) + ")";
|
let sError = "Memory block error (" + op + ": " + Str.toHex(addr) + "," + Str.toHex(size) + ")";
|
||||||
if (fQuiet) {
|
if (fQuiet) {
|
||||||
if (this.dbg) {
|
if (this.dbg) {
|
||||||
this.dbg.message(sError);
|
this.dbg.message(sError);
|
||||||
|
|
@ -1502,8 +1502,8 @@ class Bus extends Component {
|
||||||
*
|
*
|
||||||
getLongDirect(addr)
|
getLongDirect(addr)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off < this.nBlockLimit - 2) {
|
if (off < this.nBlockLimit - 2) {
|
||||||
return this.aMemBlocks[iBlock].readLongDirect(off, addr);
|
return this.aMemBlocks[iBlock].readLongDirect(off, addr);
|
||||||
}
|
}
|
||||||
|
|
@ -1513,9 +1513,9 @@ class Bus extends Component {
|
||||||
// which may have also created some undesirable side-effects for custom memory controllers.
|
// which may have also created some undesirable side-effects for custom memory controllers.
|
||||||
// This simpler (and probably more reliable) approach is to simply read the long as individual bytes.
|
// This simpler (and probably more reliable) approach is to simply read the long as individual bytes.
|
||||||
//
|
//
|
||||||
var l = 0;
|
let l = 0;
|
||||||
var cb = 4, nShift = 0;
|
let cb = 4, nShift = 0;
|
||||||
var cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
let cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
||||||
while (cb--) {
|
while (cb--) {
|
||||||
l |= (this.aMemBlocks[iBlock].readByteDirect(off++, addr++) << nShift);
|
l |= (this.aMemBlocks[iBlock].readByteDirect(off++, addr++) << nShift);
|
||||||
if (!--cbBlock) {
|
if (!--cbBlock) {
|
||||||
|
|
@ -1540,8 +1540,8 @@ class Bus extends Component {
|
||||||
*
|
*
|
||||||
setLongDirect(addr, l)
|
setLongDirect(addr, l)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off < this.nBlockLimit - 2) {
|
if (off < this.nBlockLimit - 2) {
|
||||||
this.aMemBlocks[iBlock].writeLongDirect(off, l, addr);
|
this.aMemBlocks[iBlock].writeLongDirect(off, l, addr);
|
||||||
return;
|
return;
|
||||||
|
|
@ -1552,8 +1552,8 @@ class Bus extends Component {
|
||||||
// block), which may have also created some undesirable side-effects for custom memory controllers.
|
// block), which may have also created some undesirable side-effects for custom memory controllers.
|
||||||
// This simpler (and probably more reliable) approach is to simply write the long as individual bytes.
|
// This simpler (and probably more reliable) approach is to simply write the long as individual bytes.
|
||||||
//
|
//
|
||||||
var cb = 4;
|
let cb = 4;
|
||||||
var cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
let cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
||||||
while (cb--) {
|
while (cb--) {
|
||||||
this.aMemBlocks[iBlock].writeByteDirect(off++, l & 0xff, addr++);
|
this.aMemBlocks[iBlock].writeByteDirect(off++, l & 0xff, addr++);
|
||||||
if (!--cbBlock) {
|
if (!--cbBlock) {
|
||||||
|
|
@ -1602,7 +1602,7 @@ class Bus extends Component {
|
||||||
*
|
*
|
||||||
removePortInputNotify(start, end)
|
removePortInputNotify(start, end)
|
||||||
{
|
{
|
||||||
for (var port = start; port < end; port++) {
|
for (let port = start; port < end; port++) {
|
||||||
if (this.aPortInputNotify[port]) {
|
if (this.aPortInputNotify[port]) {
|
||||||
delete this.aPortInputNotify[port];
|
delete this.aPortInputNotify[port];
|
||||||
}
|
}
|
||||||
|
|
@ -1621,7 +1621,7 @@ class Bus extends Component {
|
||||||
*
|
*
|
||||||
removePortOutputNotify(start, end)
|
removePortOutputNotify(start, end)
|
||||||
{
|
{
|
||||||
for (var port = start; port < end; port++) {
|
for (let port = start; port < end; port++) {
|
||||||
if (this.aPortOutputNotify[port]) {
|
if (this.aPortOutputNotify[port]) {
|
||||||
delete this.aPortOutputNotify[port];
|
delete this.aPortOutputNotify[port];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1038,7 +1038,10 @@ class Keyboard extends Component {
|
||||||
* then a delay of 1500ms, then a reversion to the default delay (normally 150ms), followed
|
* then a delay of 1500ms, then a reversion to the default delay (normally 150ms), followed
|
||||||
* by "test;" and return.
|
* by "test;" and return.
|
||||||
*/
|
*/
|
||||||
if (charCode >= 0xF0) {
|
if (charCode <= 0x1A) {
|
||||||
|
charCode = charCode + Keys.KEYCODE.FAKE;
|
||||||
|
}
|
||||||
|
else if (charCode >= 0xF0) {
|
||||||
this.msInjectDelay = ((charCode - 0xF0) * 100) || this.msInjectDefault;
|
this.msInjectDelay = ((charCode - 0xF0) * 100) || this.msInjectDefault;
|
||||||
charCode = 0;
|
charCode = 0;
|
||||||
break;
|
break;
|
||||||
|
|
@ -1864,12 +1867,38 @@ Keyboard.SIMCODE = {
|
||||||
CMD: Keys.KEYCODE.CMD + Keys.KEYCODE.ONDOWN,
|
CMD: Keys.KEYCODE.CMD + Keys.KEYCODE.ONDOWN,
|
||||||
RCMD: Keys.KEYCODE.RCMD + Keys.KEYCODE.ONDOWN,
|
RCMD: Keys.KEYCODE.RCMD + Keys.KEYCODE.ONDOWN,
|
||||||
FF_CMD: Keys.KEYCODE.FF_CMD + Keys.KEYCODE.ONDOWN,
|
FF_CMD: Keys.KEYCODE.FF_CMD + Keys.KEYCODE.ONDOWN,
|
||||||
SYSREQ: Keys.KEYCODE.ESC + Keys.KEYCODE.FAKE,
|
CTRL_A: Keys.ASCII.CTRL_A + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_B: Keys.ASCII.CTRL_B + Keys.KEYCODE.FAKE,
|
||||||
CTRL_C: Keys.ASCII.CTRL_C + Keys.KEYCODE.FAKE,
|
CTRL_C: Keys.ASCII.CTRL_C + Keys.KEYCODE.FAKE,
|
||||||
CTRL_BREAK: Keys.KEYCODE.BS + Keys.KEYCODE.FAKE,
|
CTRL_D: Keys.ASCII.CTRL_D + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_E: Keys.ASCII.CTRL_E + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_F: Keys.ASCII.CTRL_F + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_G: Keys.ASCII.CTRL_G + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_H: Keys.ASCII.CTRL_H + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_I: Keys.ASCII.CTRL_I + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_J: Keys.ASCII.CTRL_J + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_K: Keys.ASCII.CTRL_K + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_L: Keys.ASCII.CTRL_L + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_M: Keys.ASCII.CTRL_M + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_N: Keys.ASCII.CTRL_N + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_O: Keys.ASCII.CTRL_O + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_P: Keys.ASCII.CTRL_P + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_Q: Keys.ASCII.CTRL_Q + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_R: Keys.ASCII.CTRL_R + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_S: Keys.ASCII.CTRL_S + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_T: Keys.ASCII.CTRL_T + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_U: Keys.ASCII.CTRL_U + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_V: Keys.ASCII.CTRL_V + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_W: Keys.ASCII.CTRL_W + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_X: Keys.ASCII.CTRL_X + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_Y: Keys.ASCII.CTRL_Y + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_Z: Keys.ASCII.CTRL_Z + Keys.KEYCODE.FAKE,
|
||||||
|
SYSREQ: Keys.KEYCODE.ESC + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_PAUSE: Keys.KEYCODE.NUM_LOCK + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_BREAK: Keys.KEYCODE.SCROLL_LOCK + Keys.KEYCODE.FAKE,
|
||||||
CTRL_ALT_DEL: Keys.KEYCODE.DEL + Keys.KEYCODE.FAKE,
|
CTRL_ALT_DEL: Keys.KEYCODE.DEL + Keys.KEYCODE.FAKE,
|
||||||
CTRL_ALT_INS: Keys.KEYCODE.INS + Keys.KEYCODE.FAKE,
|
CTRL_ALT_INS: Keys.KEYCODE.INS + Keys.KEYCODE.FAKE,
|
||||||
CTRL_ALT_ENTER: Keys.KEYCODE.CR + Keys.KEYCODE.FAKE
|
CTRL_ALT_ENTER: Keys.KEYCODE.NUM_CR + Keys.KEYCODE.FAKE
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -2402,7 +2431,32 @@ Keyboard.SIMCODES[Keyboard.SIMCODE.CMD] = Keyboard.SCANCODE.WIN;
|
||||||
Keyboard.SIMCODES[Keyboard.SIMCODE.RCMD] = Keyboard.SCANCODE.MENU;
|
Keyboard.SIMCODES[Keyboard.SIMCODE.RCMD] = Keyboard.SCANCODE.MENU;
|
||||||
Keyboard.SIMCODES[Keyboard.SIMCODE.FF_CMD] = Keyboard.SCANCODE.WIN;
|
Keyboard.SIMCODES[Keyboard.SIMCODE.FF_CMD] = Keyboard.SCANCODE.WIN;
|
||||||
|
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_A] = Keyboard.SCANCODE.A | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_B] = Keyboard.SCANCODE.B | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_C] = Keyboard.SCANCODE.C | (Keyboard.SCANCODE.CTRL << 8);
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_C] = Keyboard.SCANCODE.C | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_D] = Keyboard.SCANCODE.D | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_E] = Keyboard.SCANCODE.E | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_F] = Keyboard.SCANCODE.F | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_G] = Keyboard.SCANCODE.G | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_H] = Keyboard.SCANCODE.H | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_I] = Keyboard.SCANCODE.I | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_J] = Keyboard.SCANCODE.J | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_K] = Keyboard.SCANCODE.K | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_L] = Keyboard.SCANCODE.L | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_M] = Keyboard.SCANCODE.M | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_N] = Keyboard.SCANCODE.N | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_O] = Keyboard.SCANCODE.O | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_P] = Keyboard.SCANCODE.P | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_Q] = Keyboard.SCANCODE.Q | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_R] = Keyboard.SCANCODE.R | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_S] = Keyboard.SCANCODE.S | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_T] = Keyboard.SCANCODE.T | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_U] = Keyboard.SCANCODE.U | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_V] = Keyboard.SCANCODE.V | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_W] = Keyboard.SCANCODE.W | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_X] = Keyboard.SCANCODE.X | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_Y] = Keyboard.SCANCODE.Y | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_Z] = Keyboard.SCANCODE.Z | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_BREAK] = Keyboard.SCANCODE.SCROLL_LOCK | (Keyboard.SCANCODE.CTRL << 8);
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_BREAK] = Keyboard.SCANCODE.SCROLL_LOCK | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_ALT_DEL] = Keyboard.SCANCODE.NUM_DEL | (Keyboard.SCANCODE.CTRL << 8) | (Keyboard.SCANCODE.ALT << 16);
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_ALT_DEL] = Keyboard.SCANCODE.NUM_DEL | (Keyboard.SCANCODE.CTRL << 8) | (Keyboard.SCANCODE.ALT << 16);
|
||||||
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_ALT_INS] = Keyboard.SCANCODE.NUM_INS | (Keyboard.SCANCODE.CTRL << 8) | (Keyboard.SCANCODE.ALT << 16);
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_ALT_INS] = Keyboard.SCANCODE.NUM_INS | (Keyboard.SCANCODE.CTRL << 8) | (Keyboard.SCANCODE.ALT << 16);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* @fileoverview Compile-time definitions used by C1Pjs and PCjs.
|
* @fileoverview Compile-time definitions used by PCjs.
|
||||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||||
* @copyright © Jeff Parsons 2012-2017
|
* @copyright © Jeff Parsons 2012-2017
|
||||||
*
|
*
|
||||||
|
|
|
||||||
85
modules/shared/lib/globals.js
Normal file
85
modules/shared/lib/globals.js
Normal file
|
|
@ -0,0 +1,85 @@
|
||||||
|
/**
|
||||||
|
* @fileoverview Global definitions used by PCjs.
|
||||||
|
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||||
|
* @copyright © Jeff Parsons 2012-2017
|
||||||
|
*
|
||||||
|
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
||||||
|
*
|
||||||
|
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
|
||||||
|
* GNU General Public License as published by the Free Software Foundation, either version 3
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
||||||
|
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with PCjs. If not,
|
||||||
|
* see <http://www.gnu.org/licenses/gpl.html>.
|
||||||
|
*
|
||||||
|
* You are required to include the above copyright notice in every modified copy of this work
|
||||||
|
* and to display that copyright notice when the software starts running; see COPYRIGHT in
|
||||||
|
* <http://pcjs.org/modules/shared/lib/defines.js>.
|
||||||
|
*
|
||||||
|
* Some PCjs files also attempt to load external resource files, such as character-image files,
|
||||||
|
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
||||||
|
* for purposes of the GNU General Public License, and the author does not claim any copyright
|
||||||
|
* as to their contents.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const GLOBALS = {
|
||||||
|
APPVERSION: "1.x.x", // overridden by the Closure Compiler with the version in package.json
|
||||||
|
XMLVERSION: null, // set in non-COMPILED builds by embedMachine() if a version number was found in the machine XML
|
||||||
|
COPYRIGHT: "Copyright © 2012-2017 Jeff Parsons <Jeff@pcjs.org>",
|
||||||
|
LICENSE: "License: GPL version 3 or later <http://gnu.org/licenses/gpl.html>",
|
||||||
|
CSSCLASS: "pcjs",
|
||||||
|
SITEHOST: "localhost:8088", // overridden by the Closure Compiler with "www.pcjs.org"
|
||||||
|
COMPILED: false, // overridden by the Closure Compiler (to true)
|
||||||
|
DEBUG: true, // overridden by the Closure Compiler (to false) to remove DEBUG-only code
|
||||||
|
MAXDEBUG: false, // overridden by the Closure Compiler (to false) to remove MAXDEBUG-only code
|
||||||
|
PRIVATE: false // overridden by the Closure Compiler (to false) to enable PRIVATE code
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* RS-232 DB-25 Pin Definitions, mapped to bits 1-25 in a 32-bit status value.
|
||||||
|
*
|
||||||
|
* SerialPorts in PCjs machines are considered DTE (Data Terminal Equipment), which means they should be "virtually"
|
||||||
|
* connected to each other via a null-modem cable, which assumes the following cross-wiring:
|
||||||
|
*
|
||||||
|
* G 1 <-> 1 G (Ground)
|
||||||
|
* TD 2 <-> 3 RD (Received Data)
|
||||||
|
* RD 3 <-> 2 TD (Transmitted Data)
|
||||||
|
* RTS 4 <-> 5 CTS (Clear To Send)
|
||||||
|
* CTS 5 <-> 4 RTS (Request To Send)
|
||||||
|
* DSR 6+8 <-> 20 DTR (Data Terminal Ready)
|
||||||
|
* SG 7 <-> 7 SG (Signal Ground)
|
||||||
|
* DTR 20 <-> 6+8 DSR (Data Set Ready + Carrier Detect)
|
||||||
|
* RI 22 <-> 22 RI (Ring Indicator)
|
||||||
|
*
|
||||||
|
* TODO: Move these definitions to a more appropriate shared file at some point.
|
||||||
|
*/
|
||||||
|
export const RS232 = {
|
||||||
|
RTS: {
|
||||||
|
PIN: 4,
|
||||||
|
MASK: 0x00000010
|
||||||
|
},
|
||||||
|
CTS: {
|
||||||
|
PIN: 5,
|
||||||
|
MASK: 0x00000020
|
||||||
|
},
|
||||||
|
DSR: {
|
||||||
|
PIN: 6,
|
||||||
|
MASK: 0x00000040
|
||||||
|
},
|
||||||
|
CD: {
|
||||||
|
PIN: 8,
|
||||||
|
MASK: 0x00000100
|
||||||
|
},
|
||||||
|
DTR: {
|
||||||
|
PIN: 20,
|
||||||
|
MASK: 0x00100000
|
||||||
|
},
|
||||||
|
RI: {
|
||||||
|
PIN: 22,
|
||||||
|
MASK: 0x00400000
|
||||||
|
}
|
||||||
|
};
|
||||||
3
modules/shared/lib/test.js
Normal file
3
modules/shared/lib/test.js
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
import {GLOBALS} from './globals.js'
|
||||||
|
|
||||||
|
alert(GLOBALS.COPYRIGHT);
|
||||||
14
server.js
14
server.js
|
|
@ -51,13 +51,13 @@ var defines = require("./modules/shared/lib/defines");
|
||||||
var proclib = require("./modules/shared/lib/proclib");
|
var proclib = require("./modules/shared/lib/proclib");
|
||||||
var args = proclib.getArgs();
|
var args = proclib.getArgs();
|
||||||
|
|
||||||
var fCache = (args.argv['cache'] === undefined? true : args.argv['cache']);
|
var fCache = args.argv['cache'];
|
||||||
var fConsole = (args.argv['console'] === undefined? false : args.argv['console']);
|
var fConsole = args.argv['console'];
|
||||||
var fDebug = (args.argv['debug'] === undefined? false : args.argv['debug']);
|
var fDebug = args.argv['debug'];
|
||||||
var fLogging = (args.argv['logging'] === undefined? false : args.argv['logging']);
|
var fLogging = args.argv['logging'];
|
||||||
var fPrivate = (args.argv['private'] === undefined? false : args.argv['private']);
|
var fPrivate = args.argv['private'];
|
||||||
var fRebuild = (args.argv['rebuild'] === undefined? false : args.argv['rebuild']);
|
var fRebuild = args.argv['rebuild'];
|
||||||
var fSockets = (args.argv['sockets'] === undefined? false : args.argv['sockets']);
|
var fSockets = args.argv['sockets'];
|
||||||
|
|
||||||
var HTMLOut = require("./modules/htmlout");
|
var HTMLOut = require("./modules/htmlout");
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
|
@ -8587,10 +8587,10 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
initMemory()
|
initMemory()
|
||||||
{
|
{
|
||||||
var block = new Memory();
|
let block = new Memory();
|
||||||
block.copyBreakpoints(this.dbg);
|
block.copyBreakpoints(this.dbg);
|
||||||
this.aMemBlocks = new Array(this.nBlockTotal);
|
this.aMemBlocks = new Array(this.nBlockTotal);
|
||||||
for (var iBlock = 0; iBlock < this.nBlockTotal; iBlock++) {
|
for (let iBlock = 0; iBlock < this.nBlockTotal; iBlock++) {
|
||||||
this.aMemBlocks[iBlock] = block;
|
this.aMemBlocks[iBlock] = block;
|
||||||
}
|
}
|
||||||
this.cpu.initMemory(this.aMemBlocks, this.nBlockShift);
|
this.cpu.initMemory(this.aMemBlocks, this.nBlockShift);
|
||||||
|
|
@ -8664,15 +8664,15 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
addMemory(addr, size, type, controller)
|
addMemory(addr, size, type, controller)
|
||||||
{
|
{
|
||||||
var addrNext = addr;
|
let addrNext = addr;
|
||||||
var sizeLeft = size;
|
let sizeLeft = size;
|
||||||
var iBlock = addrNext >>> this.nBlockShift;
|
let iBlock = addrNext >>> this.nBlockShift;
|
||||||
|
|
||||||
while (sizeLeft > 0 && iBlock < this.aMemBlocks.length) {
|
while (sizeLeft > 0 && iBlock < this.aMemBlocks.length) {
|
||||||
|
|
||||||
var block = this.aMemBlocks[iBlock];
|
let block = this.aMemBlocks[iBlock];
|
||||||
var addrBlock = iBlock * this.nBlockSize;
|
let addrBlock = iBlock * this.nBlockSize;
|
||||||
var sizeBlock = this.nBlockSize - (addrNext - addrBlock);
|
let sizeBlock = this.nBlockSize - (addrNext - addrBlock);
|
||||||
if (sizeBlock > sizeLeft) sizeBlock = sizeLeft;
|
if (sizeBlock > sizeLeft) sizeBlock = sizeLeft;
|
||||||
|
|
||||||
if (block && block.size) {
|
if (block && block.size) {
|
||||||
|
|
@ -8689,7 +8689,7 @@ class Bus extends Component {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (addrNext >= block.addr + block.used) {
|
if (addrNext >= block.addr + block.used) {
|
||||||
var sizeAvail = block.size - (addrNext - addrBlock);
|
let sizeAvail = block.size - (addrNext - addrBlock);
|
||||||
if (sizeAvail > sizeLeft) sizeAvail = sizeLeft;
|
if (sizeAvail > sizeLeft) sizeAvail = sizeLeft;
|
||||||
block.used = addrNext - block.addr + sizeAvail;
|
block.used = addrNext - block.addr + sizeAvail;
|
||||||
addrNext = addrBlock + this.nBlockSize;
|
addrNext = addrBlock + this.nBlockSize;
|
||||||
|
|
@ -8701,7 +8701,7 @@ class Bus extends Component {
|
||||||
return this.reportError(Bus.ERROR.ADD_MEM_INUSE, addrNext, sizeLeft);
|
return this.reportError(Bus.ERROR.ADD_MEM_INUSE, addrNext, sizeLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
var blockNew = new Memory(addrNext, sizeBlock, this.nBlockSize, type, controller);
|
let blockNew = new Memory(addrNext, sizeBlock, this.nBlockSize, type, controller);
|
||||||
blockNew.copyBreakpoints(this.dbg, block);
|
blockNew.copyBreakpoints(this.dbg, block);
|
||||||
this.aMemBlocks[iBlock++] = blockNew;
|
this.aMemBlocks[iBlock++] = blockNew;
|
||||||
|
|
||||||
|
|
@ -8720,8 +8720,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
this.cpu.flushPageBlocks();
|
this.cpu.flushPageBlocks();
|
||||||
if (!this.cpu.isRunning()) { // allocation messages at "run time" are bit too much
|
if (!this.cpu.isRunning()) { // allocation messages at "run time" are bit too much
|
||||||
var kb = (size / 1024)|0;
|
let kb = (size / 1024)|0;
|
||||||
var sb = kb? (kb + "Kb ") : (size + " bytes ");
|
let sb = kb? (kb + "Kb ") : (size + " bytes ");
|
||||||
this.status(sb + Memory.TYPE.NAMES[type] + " at " + Str.toHex(addr));
|
this.status(sb + Memory.TYPE.NAMES[type] + " at " + Str.toHex(addr));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -8739,9 +8739,9 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
cleanMemory(addr, size)
|
cleanMemory(addr, size)
|
||||||
{
|
{
|
||||||
var fClean = true;
|
let fClean = true;
|
||||||
var iBlock = addr >>> this.nBlockShift;
|
let iBlock = addr >>> this.nBlockShift;
|
||||||
var sizeBlock = this.nBlockSize - (addr & this.nBlockLimit);
|
let sizeBlock = this.nBlockSize - (addr & this.nBlockLimit);
|
||||||
while (size > 0 && iBlock < this.aMemBlocks.length) {
|
while (size > 0 && iBlock < this.aMemBlocks.length) {
|
||||||
if (this.aMemBlocks[iBlock].fDirty) {
|
if (this.aMemBlocks[iBlock].fDirty) {
|
||||||
this.aMemBlocks[iBlock].fDirty = fClean = false;
|
this.aMemBlocks[iBlock].fDirty = fClean = false;
|
||||||
|
|
@ -8771,16 +8771,16 @@ class Bus extends Component {
|
||||||
if (size == null) size = (this.addrTotal - addr) | 0;
|
if (size == null) size = (this.addrTotal - addr) | 0;
|
||||||
if (info == null) info = {cbTotal: 0, cBlocks: 0, aBlocks: []};
|
if (info == null) info = {cbTotal: 0, cBlocks: 0, aBlocks: []};
|
||||||
|
|
||||||
var iBlock = addr >>> this.nBlockShift;
|
let iBlock = addr >>> this.nBlockShift;
|
||||||
var iBlockMax = ((addr + size - 1) >>> this.nBlockShift);
|
let iBlockMax = ((addr + size - 1) >>> this.nBlockShift);
|
||||||
|
|
||||||
info.cbTotal = 0;
|
info.cbTotal = 0;
|
||||||
info.cBlocks = 0;
|
info.cBlocks = 0;
|
||||||
while (iBlock <= iBlockMax) {
|
while (iBlock <= iBlockMax) {
|
||||||
var block = this.aMemBlocks[iBlock];
|
let block = this.aMemBlocks[iBlock];
|
||||||
info.cbTotal += block.size;
|
info.cbTotal += block.size;
|
||||||
if (block.size) {
|
if (block.size) {
|
||||||
var btmod = (BACKTRACK && block.modBackTrack(false)? 1 : 0);
|
let btmod = (BACKTRACK && block.modBackTrack(false)? 1 : 0);
|
||||||
info.aBlocks.push(Usr.initBitFields(Bus.BlockInfo, iBlock, 0, btmod, block.type));
|
info.aBlocks.push(Usr.initBitFields(Bus.BlockInfo, iBlock, 0, btmod, block.type));
|
||||||
info.cBlocks++
|
info.cBlocks++
|
||||||
}
|
}
|
||||||
|
|
@ -8834,7 +8834,7 @@ class Bus extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (this.nBusWidth > 20) {
|
else if (this.nBusWidth > 20) {
|
||||||
var addrMask = (this.nBusMask & ~0x100000) | (fEnable? 0x100000 : 0);
|
let addrMask = (this.nBusMask & ~0x100000) | (fEnable? 0x100000 : 0);
|
||||||
if (addrMask != this.nBusMask) {
|
if (addrMask != this.nBusMask) {
|
||||||
this.nBusMask = addrMask;
|
this.nBusMask = addrMask;
|
||||||
if (this.cpu) this.cpu.setAddressMask(addrMask);
|
if (this.cpu) this.cpu.setAddressMask(addrMask);
|
||||||
|
|
@ -8870,9 +8870,9 @@ class Bus extends Component {
|
||||||
setMemoryAccess(addr, size, afn, fQuiet)
|
setMemoryAccess(addr, size, afn, fQuiet)
|
||||||
{
|
{
|
||||||
if (!(addr & this.nBlockLimit) && size && !(size & this.nBlockLimit)) {
|
if (!(addr & this.nBlockLimit) && size && !(size & this.nBlockLimit)) {
|
||||||
var iBlock = addr >>> this.nBlockShift;
|
let iBlock = addr >>> this.nBlockShift;
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
var block = this.aMemBlocks[iBlock];
|
let block = this.aMemBlocks[iBlock];
|
||||||
if (!block.controller) {
|
if (!block.controller) {
|
||||||
return this.reportError(Bus.ERROR.SET_MEM_NOCTRL, addr, size, fQuiet);
|
return this.reportError(Bus.ERROR.SET_MEM_NOCTRL, addr, size, fQuiet);
|
||||||
}
|
}
|
||||||
|
|
@ -8900,10 +8900,10 @@ class Bus extends Component {
|
||||||
removeMemory(addr, size)
|
removeMemory(addr, size)
|
||||||
{
|
{
|
||||||
if (!(addr & this.nBlockLimit) && size && !(size & this.nBlockLimit)) {
|
if (!(addr & this.nBlockLimit) && size && !(size & this.nBlockLimit)) {
|
||||||
var iBlock = addr >>> this.nBlockShift;
|
let iBlock = addr >>> this.nBlockShift;
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
var blockOld = this.aMemBlocks[iBlock];
|
let blockOld = this.aMemBlocks[iBlock];
|
||||||
var blockNew = new Memory(addr);
|
let blockNew = new Memory(addr);
|
||||||
blockNew.copyBreakpoints(this.dbg, blockOld);
|
blockNew.copyBreakpoints(this.dbg, blockOld);
|
||||||
this.aMemBlocks[iBlock++] = blockNew;
|
this.aMemBlocks[iBlock++] = blockNew;
|
||||||
addr = iBlock * this.nBlockSize;
|
addr = iBlock * this.nBlockSize;
|
||||||
|
|
@ -8934,8 +8934,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
getMemoryBlocks(addr, size)
|
getMemoryBlocks(addr, size)
|
||||||
{
|
{
|
||||||
var aBlocks = [];
|
let aBlocks = [];
|
||||||
var iBlock = addr >>> this.nBlockShift;
|
let iBlock = addr >>> this.nBlockShift;
|
||||||
while (size > 0 && iBlock < this.aMemBlocks.length) {
|
while (size > 0 && iBlock < this.aMemBlocks.length) {
|
||||||
aBlocks.push(this.aMemBlocks[iBlock++]);
|
aBlocks.push(this.aMemBlocks[iBlock++]);
|
||||||
size -= this.nBlockSize;
|
size -= this.nBlockSize;
|
||||||
|
|
@ -8960,14 +8960,14 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
setMemoryBlocks(addr, size, aBlocks, type)
|
setMemoryBlocks(addr, size, aBlocks, type)
|
||||||
{
|
{
|
||||||
var i = 0;
|
let i = 0;
|
||||||
var iBlock = addr >>> this.nBlockShift;
|
let iBlock = addr >>> this.nBlockShift;
|
||||||
while (size > 0 && iBlock < this.aMemBlocks.length) {
|
while (size > 0 && iBlock < this.aMemBlocks.length) {
|
||||||
var block = aBlocks[i++];
|
let block = aBlocks[i++];
|
||||||
|
|
||||||
if (!block) break;
|
if (!block) break;
|
||||||
if (type !== undefined) {
|
if (type !== undefined) {
|
||||||
var blockNew = new Memory(addr);
|
let blockNew = new Memory(addr);
|
||||||
blockNew.clone(block, type, this.dbg);
|
blockNew.clone(block, type, this.dbg);
|
||||||
block = blockNew;
|
block = blockNew;
|
||||||
}
|
}
|
||||||
|
|
@ -9015,8 +9015,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
getShort(addr)
|
getShort(addr)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off != this.nBlockLimit) {
|
if (off != this.nBlockLimit) {
|
||||||
return this.aMemBlocks[iBlock].readShort(off, addr);
|
return this.aMemBlocks[iBlock].readShort(off, addr);
|
||||||
}
|
}
|
||||||
|
|
@ -9034,8 +9034,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
getShortDirect(addr)
|
getShortDirect(addr)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off != this.nBlockLimit) {
|
if (off != this.nBlockLimit) {
|
||||||
return this.aMemBlocks[iBlock].readShortDirect(off, addr);
|
return this.aMemBlocks[iBlock].readShortDirect(off, addr);
|
||||||
}
|
}
|
||||||
|
|
@ -9053,8 +9053,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
getLong(addr)
|
getLong(addr)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off < this.nBlockLimit - 2) {
|
if (off < this.nBlockLimit - 2) {
|
||||||
return this.aMemBlocks[iBlock].readLong(off, addr);
|
return this.aMemBlocks[iBlock].readLong(off, addr);
|
||||||
}
|
}
|
||||||
|
|
@ -9064,9 +9064,9 @@ class Bus extends Component {
|
||||||
* which may have also created some undesirable side-effects for custom memory controllers.
|
* which may have also created some undesirable side-effects for custom memory controllers.
|
||||||
* This simpler (and probably more reliable) approach is to simply read the long as individual bytes.
|
* This simpler (and probably more reliable) approach is to simply read the long as individual bytes.
|
||||||
*/
|
*/
|
||||||
var l = 0;
|
let l = 0;
|
||||||
var cb = 4, nShift = 0;
|
let cb = 4, nShift = 0;
|
||||||
var cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
let cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
||||||
while (cb--) {
|
while (cb--) {
|
||||||
l |= (this.aMemBlocks[iBlock].readByte(off++, addr++) << nShift);
|
l |= (this.aMemBlocks[iBlock].readByte(off++, addr++) << nShift);
|
||||||
if (!--cbBlock) {
|
if (!--cbBlock) {
|
||||||
|
|
@ -9118,8 +9118,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
setShort(addr, w)
|
setShort(addr, w)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off != this.nBlockLimit) {
|
if (off != this.nBlockLimit) {
|
||||||
this.aMemBlocks[iBlock].writeShort(off, w & 0xffff, addr);
|
this.aMemBlocks[iBlock].writeShort(off, w & 0xffff, addr);
|
||||||
return;
|
return;
|
||||||
|
|
@ -9140,8 +9140,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
setShortDirect(addr, w)
|
setShortDirect(addr, w)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off != this.nBlockLimit) {
|
if (off != this.nBlockLimit) {
|
||||||
this.aMemBlocks[iBlock].writeShortDirect(off, w & 0xffff, addr);
|
this.aMemBlocks[iBlock].writeShortDirect(off, w & 0xffff, addr);
|
||||||
return;
|
return;
|
||||||
|
|
@ -9161,8 +9161,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
setLong(addr, l)
|
setLong(addr, l)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off < this.nBlockLimit - 2) {
|
if (off < this.nBlockLimit - 2) {
|
||||||
this.aMemBlocks[iBlock].writeLong(off, l);
|
this.aMemBlocks[iBlock].writeLong(off, l);
|
||||||
return;
|
return;
|
||||||
|
|
@ -9173,8 +9173,8 @@ class Bus extends Component {
|
||||||
* block), which may have also created some undesirable side-effects for custom memory controllers.
|
* block), which may have also created some undesirable side-effects for custom memory controllers.
|
||||||
* This simpler (and probably more reliable) approach is to simply write the long as individual bytes.
|
* This simpler (and probably more reliable) approach is to simply write the long as individual bytes.
|
||||||
*/
|
*/
|
||||||
var cb = 4;
|
let cb = 4;
|
||||||
var cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
let cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
||||||
while (cb--) {
|
while (cb--) {
|
||||||
this.aMemBlocks[iBlock].writeByte(off++, l & 0xff, addr++);
|
this.aMemBlocks[iBlock].writeByte(off++, l & 0xff, addr++);
|
||||||
if (!--cbBlock) {
|
if (!--cbBlock) {
|
||||||
|
|
@ -9202,7 +9202,7 @@ class Bus extends Component {
|
||||||
addBackTrackObject(obj, bto, off)
|
addBackTrackObject(obj, bto, off)
|
||||||
{
|
{
|
||||||
if (BACKTRACK && obj) {
|
if (BACKTRACK && obj) {
|
||||||
var cbtObjects = this.abtObjects.length;
|
let cbtObjects = this.abtObjects.length;
|
||||||
if (!bto) {
|
if (!bto) {
|
||||||
/*
|
/*
|
||||||
* Try the most recently created bto, on the off-chance it's what the caller needs
|
* Try the most recently created bto, on the off-chance it's what the caller needs
|
||||||
|
|
@ -9213,12 +9213,12 @@ class Bus extends Component {
|
||||||
|
|
||||||
bto = {obj: obj, off: off, slot: 0, refs: 0};
|
bto = {obj: obj, off: off, slot: 0, refs: 0};
|
||||||
|
|
||||||
var slot;
|
let slot;
|
||||||
if (!this.cbtDeletions) {
|
if (!this.cbtDeletions) {
|
||||||
slot = cbtObjects;
|
slot = cbtObjects;
|
||||||
} else {
|
} else {
|
||||||
for (slot = this.ibtLastDelete; slot < cbtObjects; slot++) {
|
for (slot = this.ibtLastDelete; slot < cbtObjects; slot++) {
|
||||||
var btoTest = this.abtObjects[slot];
|
let btoTest = this.abtObjects[slot];
|
||||||
if (!btoTest || !btoTest.refs && !this.isBackTrackWeak(slot << Bus.BTINFO.SLOT_SHIFT)) {
|
if (!btoTest || !btoTest.refs && !this.isBackTrackWeak(slot << Bus.BTINFO.SLOT_SHIFT)) {
|
||||||
this.ibtLastDelete = slot + 1;
|
this.ibtLastDelete = slot + 1;
|
||||||
this.cbtDeletions--;
|
this.cbtDeletions--;
|
||||||
|
|
@ -9275,7 +9275,7 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
getBackTrackIndex(bto, off)
|
getBackTrackIndex(bto, off)
|
||||||
{
|
{
|
||||||
var bti = 0;
|
let bti = 0;
|
||||||
if (BACKTRACK && bto) {
|
if (BACKTRACK && bto) {
|
||||||
bti = (bto.slot << Bus.BTINFO.SLOT_SHIFT) | Bus.BTINFO.TYPE_DATA | (off - bto.off);
|
bti = (bto.slot << Bus.BTINFO.SLOT_SHIFT) | Bus.BTINFO.TYPE_DATA | (off - bto.off);
|
||||||
}
|
}
|
||||||
|
|
@ -9294,7 +9294,7 @@ class Bus extends Component {
|
||||||
{
|
{
|
||||||
if (BACKTRACK && bto) {
|
if (BACKTRACK && bto) {
|
||||||
|
|
||||||
var bti = (bto.slot << Bus.BTINFO.SLOT_SHIFT) | Bus.BTINFO.TYPE_DATA | (off - bto.off);
|
let bti = (bto.slot << Bus.BTINFO.SLOT_SHIFT) | Bus.BTINFO.TYPE_DATA | (off - bto.off);
|
||||||
this.writeBackTrack(addr, bti);
|
this.writeBackTrack(addr, bti);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -9324,14 +9324,14 @@ class Bus extends Component {
|
||||||
writeBackTrack(addr, bti)
|
writeBackTrack(addr, bti)
|
||||||
{
|
{
|
||||||
if (BACKTRACK) {
|
if (BACKTRACK) {
|
||||||
var slot = bti >>> Bus.BTINFO.SLOT_SHIFT;
|
let slot = bti >>> Bus.BTINFO.SLOT_SHIFT;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
var btiPrev = this.aMemBlocks[iBlock].writeBackTrack(addr & this.nBlockLimit, bti);
|
let btiPrev = this.aMemBlocks[iBlock].writeBackTrack(addr & this.nBlockLimit, bti);
|
||||||
var slotPrev = btiPrev >>> Bus.BTINFO.SLOT_SHIFT;
|
let slotPrev = btiPrev >>> Bus.BTINFO.SLOT_SHIFT;
|
||||||
if (slot != slotPrev) {
|
if (slot != slotPrev) {
|
||||||
this.aMemBlocks[iBlock].modBackTrack(true);
|
this.aMemBlocks[iBlock].modBackTrack(true);
|
||||||
if (btiPrev && slotPrev) {
|
if (btiPrev && slotPrev) {
|
||||||
var btoPrev = this.abtObjects[slotPrev-1];
|
let btoPrev = this.abtObjects[slotPrev-1];
|
||||||
if (!btoPrev) {
|
if (!btoPrev) {
|
||||||
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(Messages.WARN)) {
|
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(Messages.WARN)) {
|
||||||
this.dbg.message("writeBackTrack(%" + Str.toHex(addr) + ',' + Str.toHex(bti) + "): previous index (" + Str.toHex(btiPrev) + ") refers to empty slot (" + slotPrev + ")");
|
this.dbg.message("writeBackTrack(%" + Str.toHex(addr) + ',' + Str.toHex(bti) + "): previous index (" + Str.toHex(btiPrev) + ") refers to empty slot (" + slotPrev + ")");
|
||||||
|
|
@ -9373,7 +9373,7 @@ class Bus extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bti && slot) {
|
if (bti && slot) {
|
||||||
var bto = this.abtObjects[slot-1];
|
let bto = this.abtObjects[slot-1];
|
||||||
if (bto) {
|
if (bto) {
|
||||||
|
|
||||||
bto.refs++;
|
bto.refs++;
|
||||||
|
|
@ -9391,8 +9391,8 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
isBackTrackWeak(bti)
|
isBackTrackWeak(bti)
|
||||||
{
|
{
|
||||||
var bt = this.cpu.backTrack;
|
let bt = this.cpu.backTrack;
|
||||||
var slot = bti >> Bus.BTINFO.SLOT_SHIFT;
|
let slot = bti >> Bus.BTINFO.SLOT_SHIFT;
|
||||||
return (bt.btiAL >> Bus.BTINFO.SLOT_SHIFT == slot ||
|
return (bt.btiAL >> Bus.BTINFO.SLOT_SHIFT == slot ||
|
||||||
bt.btiAH >> Bus.BTINFO.SLOT_SHIFT == slot ||
|
bt.btiAH >> Bus.BTINFO.SLOT_SHIFT == slot ||
|
||||||
bt.btiBL >> Bus.BTINFO.SLOT_SHIFT == slot ||
|
bt.btiBL >> Bus.BTINFO.SLOT_SHIFT == slot ||
|
||||||
|
|
@ -9441,7 +9441,7 @@ class Bus extends Component {
|
||||||
getBackTrackObject(bti)
|
getBackTrackObject(bti)
|
||||||
{
|
{
|
||||||
if (BACKTRACK) {
|
if (BACKTRACK) {
|
||||||
var slot = bti >>> Bus.BTINFO.SLOT_SHIFT;
|
let slot = bti >>> Bus.BTINFO.SLOT_SHIFT;
|
||||||
if (slot) return this.abtObjects[slot-1];
|
if (slot) return this.abtObjects[slot-1];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -9459,10 +9459,10 @@ class Bus extends Component {
|
||||||
getBackTrackInfo(bti, fSymbol, fNearest)
|
getBackTrackInfo(bti, fSymbol, fNearest)
|
||||||
{
|
{
|
||||||
if (BACKTRACK) {
|
if (BACKTRACK) {
|
||||||
var bto = this.getBackTrackObject(bti);
|
let bto = this.getBackTrackObject(bti);
|
||||||
if (bto) {
|
if (bto) {
|
||||||
var off = bti & Bus.BTINFO.OFF_MASK;
|
let off = bti & Bus.BTINFO.OFF_MASK;
|
||||||
var file = bto.obj.file;
|
let file = bto.obj.file;
|
||||||
if (file) {
|
if (file) {
|
||||||
|
|
||||||
return file.getSymbol(bto.obj.offFile + off, fNearest);
|
return file.getSymbol(bto.obj.offFile + off, fNearest);
|
||||||
|
|
@ -9521,18 +9521,18 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
saveMemory(fAll)
|
saveMemory(fAll)
|
||||||
{
|
{
|
||||||
var i = 0;
|
let i = 0;
|
||||||
var a = [];
|
let a = [];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A quick-and-dirty work-around for 32-bit bus machines, to ensure that all blocks in the 2nd Mb are
|
* A quick-and-dirty work-around for 32-bit bus machines, to ensure that all blocks in the 2nd Mb are
|
||||||
* mapped in before we save. We do this by forcing A20 on, and then turning it off again before we leave.
|
* mapped in before we save. We do this by forcing A20 on, and then turning it off again before we leave.
|
||||||
*/
|
*/
|
||||||
var fA20 = this.getA20();
|
let fA20 = this.getA20();
|
||||||
if (!fA20) this.setA20(true);
|
if (!fA20) this.setA20(true);
|
||||||
|
|
||||||
for (var iBlock = 0; iBlock < this.nBlockTotal; iBlock++) {
|
for (let iBlock = 0; iBlock < this.nBlockTotal; iBlock++) {
|
||||||
var block = this.aMemBlocks[iBlock];
|
let block = this.aMemBlocks[iBlock];
|
||||||
/*
|
/*
|
||||||
* We have to check both fDirty and fDirtyEver, because we may have called cleanMemory() on some of
|
* We have to check both fDirty and fDirtyEver, because we may have called cleanMemory() on some of
|
||||||
* the memory blocks (eg, video memory), and while cleanMemory() will clear a dirty block's fDirty flag,
|
* the memory blocks (eg, video memory), and while cleanMemory() will clear a dirty block's fDirty flag,
|
||||||
|
|
@ -9569,14 +9569,14 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
restoreMemory(a)
|
restoreMemory(a)
|
||||||
{
|
{
|
||||||
var i;
|
let i;
|
||||||
for (i = 0; i < a.length - 1; i += 2) {
|
for (i = 0; i < a.length - 1; i += 2) {
|
||||||
var iBlock = a[i];
|
let iBlock = a[i];
|
||||||
var adw = a[i+1];
|
let adw = a[i+1];
|
||||||
if (adw && adw.length < this.nBlockLen) {
|
if (adw && adw.length < this.nBlockLen) {
|
||||||
adw = State.decompress(adw, this.nBlockLen);
|
adw = State.decompress(adw, this.nBlockLen);
|
||||||
}
|
}
|
||||||
var block = this.aMemBlocks[iBlock];
|
let block = this.aMemBlocks[iBlock];
|
||||||
if (!block || !block.restore(adw)) {
|
if (!block || !block.restore(adw)) {
|
||||||
/*
|
/*
|
||||||
* Either the block to restore hasn't been allocated, indicating a change in the machine
|
* Either the block to restore hasn't been allocated, indicating a change in the machine
|
||||||
|
|
@ -9624,7 +9624,7 @@ class Bus extends Component {
|
||||||
addPortInputNotify(start, end, fn)
|
addPortInputNotify(start, end, fn)
|
||||||
{
|
{
|
||||||
if (fn !== undefined) {
|
if (fn !== undefined) {
|
||||||
for (var port = start; port <= end; port++) {
|
for (let port = start; port <= end; port++) {
|
||||||
if (this.aPortInputNotify[port] !== undefined) {
|
if (this.aPortInputNotify[port] !== undefined) {
|
||||||
Component.warning("Input port " + Str.toHexWord(port) + " already registered");
|
Component.warning("Input port " + Str.toHexWord(port) + " already registered");
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -9648,7 +9648,7 @@ class Bus extends Component {
|
||||||
addPortInputTable(component, table, offset)
|
addPortInputTable(component, table, offset)
|
||||||
{
|
{
|
||||||
if (offset === undefined) offset = 0;
|
if (offset === undefined) offset = 0;
|
||||||
for (var port in table) {
|
for (let port in table) {
|
||||||
this.addPortInputNotify(+port + offset, +port + offset, table[port].bind(component));
|
this.addPortInputNotify(+port + offset, +port + offset, table[port].bind(component));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -9681,14 +9681,14 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
checkPortInputNotify(port, size, addrLIP)
|
checkPortInputNotify(port, size, addrLIP)
|
||||||
{
|
{
|
||||||
var data = 0, shift = 0;
|
let data = 0, shift = 0;
|
||||||
|
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
|
|
||||||
var aNotify = this.aPortInputNotify[port];
|
let aNotify = this.aPortInputNotify[port];
|
||||||
var sizePort = this.aPortInputWidth[port] || 1;
|
let sizePort = this.aPortInputWidth[port] || 1;
|
||||||
var maskPort = (sizePort == 1? 0xff : (sizePort == 2? 0xffff : -1));
|
let maskPort = (sizePort == 1? 0xff : (sizePort == 2? 0xffff : -1));
|
||||||
var dataPort = maskPort;
|
let dataPort = maskPort;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO: We need to decide what to do about 8-bit I/O to a 16-bit port (ditto for 16-bit I/O
|
* TODO: We need to decide what to do about 8-bit I/O to a 16-bit port (ditto for 16-bit I/O
|
||||||
|
|
@ -9766,7 +9766,7 @@ class Bus extends Component {
|
||||||
addPortOutputNotify(start, end, fn)
|
addPortOutputNotify(start, end, fn)
|
||||||
{
|
{
|
||||||
if (fn !== undefined) {
|
if (fn !== undefined) {
|
||||||
for (var port = start; port <= end; port++) {
|
for (let port = start; port <= end; port++) {
|
||||||
if (this.aPortOutputNotify[port] !== undefined) {
|
if (this.aPortOutputNotify[port] !== undefined) {
|
||||||
Component.warning("Output port " + Str.toHexWord(port) + " already registered");
|
Component.warning("Output port " + Str.toHexWord(port) + " already registered");
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -9790,7 +9790,7 @@ class Bus extends Component {
|
||||||
addPortOutputTable(component, table, offset)
|
addPortOutputTable(component, table, offset)
|
||||||
{
|
{
|
||||||
if (offset === undefined) offset = 0;
|
if (offset === undefined) offset = 0;
|
||||||
for (var port in table) {
|
for (let port in table) {
|
||||||
this.addPortOutputNotify(+port + offset, +port + offset, table[port].bind(component));
|
this.addPortOutputNotify(+port + offset, +port + offset, table[port].bind(component));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -9820,14 +9820,14 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
checkPortOutputNotify(port, size, data, addrLIP)
|
checkPortOutputNotify(port, size, data, addrLIP)
|
||||||
{
|
{
|
||||||
var shift = 0;
|
let shift = 0;
|
||||||
|
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
|
|
||||||
var aNotify = this.aPortOutputNotify[port];
|
let aNotify = this.aPortOutputNotify[port];
|
||||||
var sizePort = this.aPortOutputWidth[port] || 1;
|
let sizePort = this.aPortOutputWidth[port] || 1;
|
||||||
var maskPort = (sizePort == 1? 0xff : (sizePort == 2? 0xffff : -1));
|
let maskPort = (sizePort == 1? 0xff : (sizePort == 2? 0xffff : -1));
|
||||||
var dataPort = (data >>>= shift) & maskPort;
|
let dataPort = (data >>>= shift) & maskPort;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO: We need to decide what to do about 8-bit I/O to a 16-bit port (ditto for 16-bit I/O
|
* TODO: We need to decide what to do about 8-bit I/O to a 16-bit port (ditto for 16-bit I/O
|
||||||
|
|
@ -9872,7 +9872,7 @@ class Bus extends Component {
|
||||||
*/
|
*/
|
||||||
reportError(op, addr, size, fQuiet)
|
reportError(op, addr, size, fQuiet)
|
||||||
{
|
{
|
||||||
var sError = "Memory block error (" + op + ": " + Str.toHex(addr) + "," + Str.toHex(size) + ")";
|
let sError = "Memory block error (" + op + ": " + Str.toHex(addr) + "," + Str.toHex(size) + ")";
|
||||||
if (fQuiet) {
|
if (fQuiet) {
|
||||||
if (this.dbg) {
|
if (this.dbg) {
|
||||||
this.dbg.message(sError);
|
this.dbg.message(sError);
|
||||||
|
|
@ -9896,8 +9896,8 @@ class Bus extends Component {
|
||||||
*
|
*
|
||||||
getLongDirect(addr)
|
getLongDirect(addr)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off < this.nBlockLimit - 2) {
|
if (off < this.nBlockLimit - 2) {
|
||||||
return this.aMemBlocks[iBlock].readLongDirect(off, addr);
|
return this.aMemBlocks[iBlock].readLongDirect(off, addr);
|
||||||
}
|
}
|
||||||
|
|
@ -9907,9 +9907,9 @@ class Bus extends Component {
|
||||||
// which may have also created some undesirable side-effects for custom memory controllers.
|
// which may have also created some undesirable side-effects for custom memory controllers.
|
||||||
// This simpler (and probably more reliable) approach is to simply read the long as individual bytes.
|
// This simpler (and probably more reliable) approach is to simply read the long as individual bytes.
|
||||||
//
|
//
|
||||||
var l = 0;
|
let l = 0;
|
||||||
var cb = 4, nShift = 0;
|
let cb = 4, nShift = 0;
|
||||||
var cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
let cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
||||||
while (cb--) {
|
while (cb--) {
|
||||||
l |= (this.aMemBlocks[iBlock].readByteDirect(off++, addr++) << nShift);
|
l |= (this.aMemBlocks[iBlock].readByteDirect(off++, addr++) << nShift);
|
||||||
if (!--cbBlock) {
|
if (!--cbBlock) {
|
||||||
|
|
@ -9934,8 +9934,8 @@ class Bus extends Component {
|
||||||
*
|
*
|
||||||
setLongDirect(addr, l)
|
setLongDirect(addr, l)
|
||||||
{
|
{
|
||||||
var off = addr & this.nBlockLimit;
|
let off = addr & this.nBlockLimit;
|
||||||
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
let iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
|
||||||
if (off < this.nBlockLimit - 2) {
|
if (off < this.nBlockLimit - 2) {
|
||||||
this.aMemBlocks[iBlock].writeLongDirect(off, l, addr);
|
this.aMemBlocks[iBlock].writeLongDirect(off, l, addr);
|
||||||
return;
|
return;
|
||||||
|
|
@ -9946,8 +9946,8 @@ class Bus extends Component {
|
||||||
// block), which may have also created some undesirable side-effects for custom memory controllers.
|
// block), which may have also created some undesirable side-effects for custom memory controllers.
|
||||||
// This simpler (and probably more reliable) approach is to simply write the long as individual bytes.
|
// This simpler (and probably more reliable) approach is to simply write the long as individual bytes.
|
||||||
//
|
//
|
||||||
var cb = 4;
|
let cb = 4;
|
||||||
var cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
let cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
||||||
while (cb--) {
|
while (cb--) {
|
||||||
this.aMemBlocks[iBlock].writeByteDirect(off++, l & 0xff, addr++);
|
this.aMemBlocks[iBlock].writeByteDirect(off++, l & 0xff, addr++);
|
||||||
if (!--cbBlock) {
|
if (!--cbBlock) {
|
||||||
|
|
@ -9996,7 +9996,7 @@ class Bus extends Component {
|
||||||
*
|
*
|
||||||
removePortInputNotify(start, end)
|
removePortInputNotify(start, end)
|
||||||
{
|
{
|
||||||
for (var port = start; port < end; port++) {
|
for (let port = start; port < end; port++) {
|
||||||
if (this.aPortInputNotify[port]) {
|
if (this.aPortInputNotify[port]) {
|
||||||
delete this.aPortInputNotify[port];
|
delete this.aPortInputNotify[port];
|
||||||
}
|
}
|
||||||
|
|
@ -10015,7 +10015,7 @@ class Bus extends Component {
|
||||||
*
|
*
|
||||||
removePortOutputNotify(start, end)
|
removePortOutputNotify(start, end)
|
||||||
{
|
{
|
||||||
for (var port = start; port < end; port++) {
|
for (let port = start; port < end; port++) {
|
||||||
if (this.aPortOutputNotify[port]) {
|
if (this.aPortOutputNotify[port]) {
|
||||||
delete this.aPortOutputNotify[port];
|
delete this.aPortOutputNotify[port];
|
||||||
}
|
}
|
||||||
|
|
@ -45578,7 +45578,10 @@ class Keyboard extends Component {
|
||||||
* then a delay of 1500ms, then a reversion to the default delay (normally 150ms), followed
|
* then a delay of 1500ms, then a reversion to the default delay (normally 150ms), followed
|
||||||
* by "test;" and return.
|
* by "test;" and return.
|
||||||
*/
|
*/
|
||||||
if (charCode >= 0xF0) {
|
if (charCode <= 0x1A) {
|
||||||
|
charCode = charCode + Keys.KEYCODE.FAKE;
|
||||||
|
}
|
||||||
|
else if (charCode >= 0xF0) {
|
||||||
this.msInjectDelay = ((charCode - 0xF0) * 100) || this.msInjectDefault;
|
this.msInjectDelay = ((charCode - 0xF0) * 100) || this.msInjectDefault;
|
||||||
charCode = 0;
|
charCode = 0;
|
||||||
break;
|
break;
|
||||||
|
|
@ -46404,12 +46407,38 @@ Keyboard.SIMCODE = {
|
||||||
CMD: Keys.KEYCODE.CMD + Keys.KEYCODE.ONDOWN,
|
CMD: Keys.KEYCODE.CMD + Keys.KEYCODE.ONDOWN,
|
||||||
RCMD: Keys.KEYCODE.RCMD + Keys.KEYCODE.ONDOWN,
|
RCMD: Keys.KEYCODE.RCMD + Keys.KEYCODE.ONDOWN,
|
||||||
FF_CMD: Keys.KEYCODE.FF_CMD + Keys.KEYCODE.ONDOWN,
|
FF_CMD: Keys.KEYCODE.FF_CMD + Keys.KEYCODE.ONDOWN,
|
||||||
SYSREQ: Keys.KEYCODE.ESC + Keys.KEYCODE.FAKE,
|
CTRL_A: Keys.ASCII.CTRL_A + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_B: Keys.ASCII.CTRL_B + Keys.KEYCODE.FAKE,
|
||||||
CTRL_C: Keys.ASCII.CTRL_C + Keys.KEYCODE.FAKE,
|
CTRL_C: Keys.ASCII.CTRL_C + Keys.KEYCODE.FAKE,
|
||||||
CTRL_BREAK: Keys.KEYCODE.BS + Keys.KEYCODE.FAKE,
|
CTRL_D: Keys.ASCII.CTRL_D + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_E: Keys.ASCII.CTRL_E + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_F: Keys.ASCII.CTRL_F + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_G: Keys.ASCII.CTRL_G + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_H: Keys.ASCII.CTRL_H + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_I: Keys.ASCII.CTRL_I + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_J: Keys.ASCII.CTRL_J + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_K: Keys.ASCII.CTRL_K + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_L: Keys.ASCII.CTRL_L + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_M: Keys.ASCII.CTRL_M + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_N: Keys.ASCII.CTRL_N + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_O: Keys.ASCII.CTRL_O + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_P: Keys.ASCII.CTRL_P + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_Q: Keys.ASCII.CTRL_Q + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_R: Keys.ASCII.CTRL_R + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_S: Keys.ASCII.CTRL_S + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_T: Keys.ASCII.CTRL_T + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_U: Keys.ASCII.CTRL_U + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_V: Keys.ASCII.CTRL_V + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_W: Keys.ASCII.CTRL_W + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_X: Keys.ASCII.CTRL_X + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_Y: Keys.ASCII.CTRL_Y + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_Z: Keys.ASCII.CTRL_Z + Keys.KEYCODE.FAKE,
|
||||||
|
SYSREQ: Keys.KEYCODE.ESC + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_PAUSE: Keys.KEYCODE.NUM_LOCK + Keys.KEYCODE.FAKE,
|
||||||
|
CTRL_BREAK: Keys.KEYCODE.SCROLL_LOCK + Keys.KEYCODE.FAKE,
|
||||||
CTRL_ALT_DEL: Keys.KEYCODE.DEL + Keys.KEYCODE.FAKE,
|
CTRL_ALT_DEL: Keys.KEYCODE.DEL + Keys.KEYCODE.FAKE,
|
||||||
CTRL_ALT_INS: Keys.KEYCODE.INS + Keys.KEYCODE.FAKE,
|
CTRL_ALT_INS: Keys.KEYCODE.INS + Keys.KEYCODE.FAKE,
|
||||||
CTRL_ALT_ENTER: Keys.KEYCODE.CR + Keys.KEYCODE.FAKE
|
CTRL_ALT_ENTER: Keys.KEYCODE.NUM_CR + Keys.KEYCODE.FAKE
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -46942,7 +46971,32 @@ Keyboard.SIMCODES[Keyboard.SIMCODE.CMD] = Keyboard.SCANCODE.WIN;
|
||||||
Keyboard.SIMCODES[Keyboard.SIMCODE.RCMD] = Keyboard.SCANCODE.MENU;
|
Keyboard.SIMCODES[Keyboard.SIMCODE.RCMD] = Keyboard.SCANCODE.MENU;
|
||||||
Keyboard.SIMCODES[Keyboard.SIMCODE.FF_CMD] = Keyboard.SCANCODE.WIN;
|
Keyboard.SIMCODES[Keyboard.SIMCODE.FF_CMD] = Keyboard.SCANCODE.WIN;
|
||||||
|
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_A] = Keyboard.SCANCODE.A | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_B] = Keyboard.SCANCODE.B | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_C] = Keyboard.SCANCODE.C | (Keyboard.SCANCODE.CTRL << 8);
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_C] = Keyboard.SCANCODE.C | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_D] = Keyboard.SCANCODE.D | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_E] = Keyboard.SCANCODE.E | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_F] = Keyboard.SCANCODE.F | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_G] = Keyboard.SCANCODE.G | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_H] = Keyboard.SCANCODE.H | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_I] = Keyboard.SCANCODE.I | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_J] = Keyboard.SCANCODE.J | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_K] = Keyboard.SCANCODE.K | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_L] = Keyboard.SCANCODE.L | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_M] = Keyboard.SCANCODE.M | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_N] = Keyboard.SCANCODE.N | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_O] = Keyboard.SCANCODE.O | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_P] = Keyboard.SCANCODE.P | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_Q] = Keyboard.SCANCODE.Q | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_R] = Keyboard.SCANCODE.R | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_S] = Keyboard.SCANCODE.S | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_T] = Keyboard.SCANCODE.T | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_U] = Keyboard.SCANCODE.U | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_V] = Keyboard.SCANCODE.V | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_W] = Keyboard.SCANCODE.W | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_X] = Keyboard.SCANCODE.X | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_Y] = Keyboard.SCANCODE.Y | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_Z] = Keyboard.SCANCODE.Z | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_BREAK] = Keyboard.SCANCODE.SCROLL_LOCK | (Keyboard.SCANCODE.CTRL << 8);
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_BREAK] = Keyboard.SCANCODE.SCROLL_LOCK | (Keyboard.SCANCODE.CTRL << 8);
|
||||||
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_ALT_DEL] = Keyboard.SCANCODE.NUM_DEL | (Keyboard.SCANCODE.CTRL << 8) | (Keyboard.SCANCODE.ALT << 16);
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_ALT_DEL] = Keyboard.SCANCODE.NUM_DEL | (Keyboard.SCANCODE.CTRL << 8) | (Keyboard.SCANCODE.ALT << 16);
|
||||||
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_ALT_INS] = Keyboard.SCANCODE.NUM_INS | (Keyboard.SCANCODE.CTRL << 8) | (Keyboard.SCANCODE.ALT << 16);
|
Keyboard.SIMCODES[Keyboard.SIMCODE.CTRL_ALT_INS] = Keyboard.SCANCODE.NUM_INS | (Keyboard.SCANCODE.CTRL << 8) | (Keyboard.SCANCODE.ALT << 16);
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue