v1.19.3: More Windows 95-related updates
This commit is contained in:
parent
77b7ebc85c
commit
1a67c7acbd
33 changed files with 8907 additions and 1741 deletions
|
|
@ -89,10 +89,10 @@ modes commonly used on the IBM VGA. Here's that table:
|
|||
CRTC[0x11]: VRETRACE_END 0x8E 0x8E 0x8E 0x8E 0x8E 0x8E 0x8E 0x8E 0x8E 0x85 0x8C 0x8E
|
||||
CRTC[0x12]: VDISP_END 0x8F 0x8F 0x8F 0x8F 0x8F 0x8F 0x8F 0x8F 0x8F 0x5D 0xDF 0x8F
|
||||
CRTC[0x13]: OFFSET 0x14 0x14 0x28 0x28 0x14 0x14 0x28 0x14 0x28 0x28 0x28 0x28
|
||||
CRTC[0x14]: UNDERLINE 0x1F 0x1F 0x1F 0x1F 0x00 0x00 0x00 0x00 0x00 0x0F 0x00 0x40 (bit 6 selects double-word mode)
|
||||
CRTC[0x14]: UNDERLINE 0x1F 0x1F 0x1F 0x1F 0x00 0x00 0x00 0x00 0x00 0x0F 0x00 0x40
|
||||
CRTC[0x15]: VBLANK_START 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x63 0xE7 0x96
|
||||
CRTC[0x16]: VBLANK_END 0xB9 0xB9 0xB9 0xB9 0xB9 0xB9 0xB9 0xB9 0xB9 0xBA 0x04 0xB9
|
||||
CRTC[0x17]: MODE_CTRL 0xA3 0xA3 0xA3 0xA3 0xA2 0xA2 0xC2 0xE3 0xE3 0xE3 0xE3 0xA3 (bit 6 selects byte mode)
|
||||
CRTC[0x17]: MODE_CTRL 0xA3 0xA3 0xA3 0xA3 0xA2 0xA2 0xC2 0xE3 0xE3 0xE3 0xE3 0xA3
|
||||
CRTC[0x18]: LINE_COMPARE 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
|
||||
GRC[0x00]: SRESET 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||
GRC[0x01]: ESRESET 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="/versions/pcjs/1.19.2/machine.xsl"?>
|
||||
<?xml-stylesheet type="text/xsl" href="/versions/pcjs/1.19.3/machine.xsl"?>
|
||||
<machine id="deskpro386" class="pc" border="1" pos="center" background="#FAEBD7">
|
||||
<computer id="deskpro386-vga-4096k" name="Compaq DeskPro 386" buswidth="32"/>
|
||||
<computer id="deskpro386-vga-4096k" name="Compaq DeskPro 386" buswidth="32" state="/devices/pc/machine/compaq/deskpro386/vga/4096kb/state.json"/>
|
||||
<cpu id="cpu386" model="80386" autostart="false"/>
|
||||
<ram id="ramLow" addr="0x00000" test="false" size="0xa0000" comment="ROM BIOS memory test has been disabled"/>
|
||||
<ram id="ramCPQ" addr="0xfa0000" size="0x60000" comment="Compaq memory at 0xFA0000"/>
|
||||
|
|
@ -10,10 +10,10 @@
|
|||
<rom id="romBIOS" addr="0xf8000" size="0x8000" alias="[0xf0000,0xffff0000,0xffff8000]" file="/devices/pc/bios/compaq/deskpro386/1988-01-28/1988-01-28.json"/>
|
||||
<video ref="/devices/pc/video/ibm/vga/ibm-vga-lockfs.xml"/>
|
||||
<keyboard id="keyboard"/>
|
||||
<fdc ref="/disks/pc/library.xml" automount='{B: {name: "Windows 95 (Disk 1)", path: "/disks/pc/windows/win95/4.00.950/WIN95-DISK01.json"}}'/>
|
||||
<debugger id="debugger" messages="" commands=''/>
|
||||
<fdc ref="/disks/pc/library.xml" automount=''/>
|
||||
<debugger id="debugger" messages="" commands='m hdc off'/>
|
||||
<panel ref="/devices/pc/panel/wide386.xml"/>
|
||||
<hdc id="hdcAT" type="at" drives='[{name:"68Mb Hard Disk",type:4,path:"http://static.pcjs.org/devices/pc/machine/compaq/deskpro386/vga/4096kb/WDEB386-68Mb.json"}]'/>
|
||||
<hdc id="hdcAT" type="at" drives='[{name:"68Mb Hard Disk",type:4,path:"http://static.pcjs.org/devices/pc/machine/compaq/deskpro386/vga/4096kb/WIN95-FBOOT.json"}]'/>
|
||||
<chipset id="chipset" model="deskpro386" floppies="[1200,1200]" monitor="vga"/>
|
||||
<serial id="com1" adapter="1"/>
|
||||
<serial id="com2" adapter="2" binding="print"/>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -56,7 +56,7 @@ if (DEBUGGER) {
|
|||
* off offset, if any
|
||||
* sel selector, if any (if null, addr should be set to a linear address)
|
||||
* addr linear address, if any (if null, addr will be recomputed from sel:off)
|
||||
* fProt true if protected-mode address
|
||||
* type one of the Debugger.ADDR.* values
|
||||
* fData32 true if 32-bit operand size in effect
|
||||
* fAddr32 true if 32-bit address size in effect
|
||||
* cOverrides non-zero if any overrides were processed with this address
|
||||
|
|
@ -69,7 +69,7 @@ if (DEBUGGER) {
|
|||
* off:(number|null|undefined),
|
||||
* sel:(number|null|undefined),
|
||||
* addr:(number|null|undefined),
|
||||
* fProt:(boolean|undefined),
|
||||
* type:(number|undefined),
|
||||
* fData32:(boolean|undefined),
|
||||
* fAddr32:(boolean|undefined),
|
||||
* cOverrides:(number|undefined),
|
||||
|
|
@ -294,10 +294,27 @@ if (DEBUGGER) {
|
|||
};
|
||||
|
||||
/*
|
||||
* Address types for parseAddr(), to help choose between dbgAddrNextCode and dbgAddrNextData
|
||||
* Supported address types; the type field in a DbgAddr object may contain ONE of:
|
||||
*
|
||||
* NONE, REAL, PROT, V86, LINEAR or PHYSICAL
|
||||
*
|
||||
* along with ONE of:
|
||||
*
|
||||
* CODE or DATA
|
||||
*
|
||||
* REAL and V86 addresses are specifed with a '&' prefix, PROT addresses with a '#' prefix,
|
||||
* LINEAR addresses with '%', and PHYSICAL addresses with '%%'.
|
||||
*/
|
||||
Debugger.ADDR_CODE = 1;
|
||||
Debugger.ADDR_DATA = 2;
|
||||
Debugger.ADDR = {
|
||||
NONE: 0x00,
|
||||
REAL: 0x01,
|
||||
PROT: 0x02,
|
||||
V86: 0x03,
|
||||
LINEAR: 0x04,
|
||||
PHYSICAL: 0x05,
|
||||
CODE: 0x10,
|
||||
DATA: 0x20
|
||||
};
|
||||
|
||||
/*
|
||||
* Instruction ordinals
|
||||
|
|
@ -1247,9 +1264,10 @@ if (DEBUGGER) {
|
|||
this.messageDump(Messages.TSS, function onDumpTSS(s) { dbg.dumpTSS(s); });
|
||||
this.messageDump(Messages.DOS, function onDumpDOS(s) { dbg.dumpDOS(s); });
|
||||
|
||||
this.fWinDbg = this.dbgAddrWinDbg = null;
|
||||
this.cpu.addIntNotify(Interrupts.WINDBG.VECTOR, this.intWindowsDebugger.bind(this));
|
||||
|
||||
if (Interrupts.WINDBG.ENABLED) {
|
||||
this.fWinDbg = null;
|
||||
this.cpu.addIntNotify(Interrupts.WINDBG.VECTOR, this.intWindowsDebugger.bind(this));
|
||||
}
|
||||
if (Interrupts.WINDBGRM.ENABLED) {
|
||||
this.fWinDbgRM = null;
|
||||
this.cpu.addIntNotify(Interrupts.WINDBGRM.VECTOR, this.intWindowsDebuggerRM.bind(this));
|
||||
|
|
@ -1258,72 +1276,79 @@ if (DEBUGGER) {
|
|||
this.setReady();
|
||||
};
|
||||
|
||||
/**
|
||||
* intWindowsDebugger()
|
||||
*
|
||||
* This intercepts calls to the Windows Debugger protected-mode interface (INT 0x41).
|
||||
*
|
||||
* @this {Debugger}
|
||||
* @param {number} addr
|
||||
* @return {boolean} true to proceed with the INT 0x41 software interrupt, false to skip
|
||||
*/
|
||||
Debugger.prototype.intWindowsDebugger = function(addr)
|
||||
{
|
||||
if (this.fWinDbg === false) return true;
|
||||
if (Interrupts.WINDBG.ENABLED) {
|
||||
/**
|
||||
* intWindowsDebugger()
|
||||
*
|
||||
* This intercepts calls to the Windows Debugger protected-mode interface (INT 0x41).
|
||||
*
|
||||
* @this {Debugger}
|
||||
* @param {number} addr
|
||||
* @return {boolean} true to proceed with the INT 0x41 software interrupt, false to skip
|
||||
*/
|
||||
Debugger.prototype.intWindowsDebugger = function(addr)
|
||||
{
|
||||
var cpu = this.cpu;
|
||||
var AX = cpu.regEAX & 0xffff;
|
||||
var BX = cpu.regEBX & 0xffff;
|
||||
var CX = cpu.regECX & 0xffff;
|
||||
var DX = cpu.regEDX & 0xffff;
|
||||
var SI = cpu.regESI & 0xffff;
|
||||
var DI = cpu.regEDI & 0xffff;
|
||||
var ES = cpu.segES.sel;
|
||||
|
||||
var seg, limit;
|
||||
var cpu = this.cpu;
|
||||
var AX = cpu.regEAX & 0xffff;
|
||||
var BX = cpu.regEBX & 0xffff;
|
||||
var CX = cpu.regECX & 0xffff;
|
||||
var DX = cpu.regEDX & 0xffff;
|
||||
var SI = cpu.regESI & 0xffff;
|
||||
var DI = cpu.regEDI & 0xffff;
|
||||
var ES = cpu.segES.sel;
|
||||
var seg, limit, sModule;
|
||||
|
||||
if (!this.fWinDbg) {
|
||||
if (AX == Interrupts.WINDBG.IS_LOADED) {
|
||||
/*
|
||||
* We're only going to respond to this function if no one else did, in which case,
|
||||
* we'll set fWinDbg to true and handle additional notifications.
|
||||
*/
|
||||
cpu.addIntReturn(addr, function(dbg) {
|
||||
return function onInt41Return(nLevel) {
|
||||
if ((cpu.regEAX & 0xffff) != Interrupts.WINDBG.LOADED) {
|
||||
cpu.regEAX = (cpu.regEAX & ~0xffff) | Interrupts.WINDBG.LOADED;
|
||||
dbg.println("INT 0x41 processing enabled");
|
||||
dbg.dbgAddrWinDbg = dbg.newAddr();
|
||||
dbg.fWinDbg = true;
|
||||
} else {
|
||||
dbg.println("INT 0x41 processing disabled");
|
||||
dbg.fWinDbg = false;
|
||||
}
|
||||
};
|
||||
}(this));
|
||||
if (this.fWinDbg == null) {
|
||||
if (AX == Interrupts.WINDBG.IS_LOADED) {
|
||||
/*
|
||||
* We're only going to respond to this function if no one else did, in which case,
|
||||
* we'll set fWinDbg to true and handle additional notifications.
|
||||
*/
|
||||
cpu.addIntReturn(addr, function(dbg) {
|
||||
return function onInt41Return(nLevel) {
|
||||
if ((cpu.regEAX & 0xffff) != Interrupts.WINDBG.LOADED) {
|
||||
cpu.regEAX = (cpu.regEAX & ~0xffff) | Interrupts.WINDBG.LOADED;
|
||||
dbg.println("INT 0x41 handling enabled");
|
||||
dbg.fWinDbg = true;
|
||||
} else {
|
||||
dbg.println("INT 0x41 monitoring enabled");
|
||||
dbg.fWinDbg = false;
|
||||
}
|
||||
};
|
||||
}(this));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
switch(AX) {
|
||||
case Interrupts.WINDBG.IS_LOADED:
|
||||
if (this.fWinDbg) {
|
||||
cpu.regEAX = (cpu.regEAX & ~0xffff) | Interrupts.WINDBG.LOADED;
|
||||
}
|
||||
break;
|
||||
|
||||
case Interrupts.WINDBG.LOAD_SEG:
|
||||
/*
|
||||
* The following output should completely mimic WDEB386....
|
||||
*/
|
||||
sModule = this.getSZ(this.newAddr(DI, ES));
|
||||
limit = (seg = this.getSegment(CX))? seg.limit : 0;
|
||||
if (!this.fWinDbg) {
|
||||
this.println(sModule + "!undefined " + ((SI & 0x1)? "data" : "code") + '(' + str.toHex(BX+1, 4) + ")=#" + str.toHex(CX, 4) + " len " + str.toHex(limit+1));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (this.fWinDbg) {
|
||||
this.println("INT 0x41: " + str.toHexWord(AX));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
switch(AX) {
|
||||
case Interrupts.WINDBG.IS_LOADED:
|
||||
cpu.regEAX = (cpu.regEAX & ~0xffff) | Interrupts.WINDBG.LOADED;
|
||||
break;
|
||||
|
||||
case Interrupts.WINDBG.LOAD_SEG:
|
||||
/*
|
||||
* The following output should completely mimic WDEB386....
|
||||
*/
|
||||
limit = (seg = this.getSegment(CX))? seg.limit : 0;
|
||||
this.println(this.getSZ(this.setAddr(this.dbgAddrWinDbg, DI, ES)) + "!undefined " + ((SI & 0x1)? "data" : "code") + '(' + str.toHex(BX+1, 4) + ")=#" + str.toHex(CX, 4) + " len " + str.toHex(limit+1));
|
||||
break;
|
||||
|
||||
default:
|
||||
// this.println("INT 0x41: " + str.toHexWord(AX));
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
if (Interrupts.WINDBGRM.ENABLED) {
|
||||
/**
|
||||
|
|
@ -1337,12 +1362,14 @@ if (DEBUGGER) {
|
|||
*/
|
||||
Debugger.prototype.intWindowsDebuggerRM = function(addr)
|
||||
{
|
||||
if (this.fWinDbgRM === false) return true;
|
||||
|
||||
var dbgAddr;
|
||||
var cpu = this.cpu;
|
||||
var AH = this.cpu.regEAX & 0xff;
|
||||
var AL = cpu.regEAX & 0xff;
|
||||
var AH = (cpu.regEAX >> 8) & 0xff;
|
||||
var DI = cpu.regEDI & 0xffff;
|
||||
var ES = cpu.segES.sel;
|
||||
|
||||
if (!this.fWinDbgRM) {
|
||||
if (this.fWinDbgRM == null) {
|
||||
if (AH == Interrupts.WINDBGRM.IS_LOADED) {
|
||||
/*
|
||||
* We're only going to respond to this function if no one else did, in which case,
|
||||
|
|
@ -1352,10 +1379,10 @@ if (DEBUGGER) {
|
|||
return function onInt68Return(nLevel) {
|
||||
if ((cpu.regEAX & 0xffff) != Interrupts.WINDBGRM.LOADED) {
|
||||
cpu.regEAX = (cpu.regEAX & ~0xffff) | Interrupts.WINDBGRM.LOADED;
|
||||
dbg.println("INT 0x68 processing enabled");
|
||||
dbg.println("INT 0x68 handling enabled");
|
||||
dbg.fWinDbgRM = true;
|
||||
} else {
|
||||
dbg.println("INT 0x68 processing disabled");
|
||||
dbg.println("INT 0x68 monitoring enabled");
|
||||
dbg.fWinDbgRM = false;
|
||||
}
|
||||
};
|
||||
|
|
@ -1366,11 +1393,67 @@ if (DEBUGGER) {
|
|||
|
||||
switch(AH) {
|
||||
case Interrupts.WINDBGRM.IS_LOADED:
|
||||
cpu.regEAX = (cpu.regEAX & ~0xffff) | Interrupts.WINDBGRM.LOADED;
|
||||
if (this.fWinDbgRM) {
|
||||
cpu.regEAX = (cpu.regEAX & ~0xffff) | Interrupts.WINDBGRM.LOADED;
|
||||
}
|
||||
break;
|
||||
|
||||
case Interrupts.WINDBGRM.LOAD_SEG:
|
||||
if (AL == 0x20) {
|
||||
/*
|
||||
* Real-mode EXE
|
||||
* CX == paragraph
|
||||
* ES:DI -> module name
|
||||
*/
|
||||
}
|
||||
else if (AL < 0x80) {
|
||||
/*
|
||||
* AL == segment type:
|
||||
* 0x00 code selector
|
||||
* 0x01 data selector
|
||||
* 0x10 code segment
|
||||
* 0x11 data segment
|
||||
* 0x40 code segment & sel
|
||||
* 0x41 data segment & sel
|
||||
* BX == segment #
|
||||
* CX == actual segment/selector
|
||||
* DX == actual selector (if 0x40 or 0x41)
|
||||
* ES:DI -> module name
|
||||
*/
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* AL == segment type:
|
||||
* 0x80 device driver code seg
|
||||
* 0x81 device driver data seg
|
||||
* ES:DI -> D386_Device_Params structure:
|
||||
* DD_logical_seg dw ? ; logical segment # from map
|
||||
* DD_actual_sel dw ? ; actual selector value
|
||||
* DD_base dd ? ; linear address offset for start of segment
|
||||
* DD_length dd ? ; actual length of segment
|
||||
* DD_name df ? ; 16:32 ptr to null terminated device name
|
||||
* DD_sym_name df ? ; 16:32 ptr to null terminated symbolic module name (i.e. Win386)
|
||||
* DD_alias_sel dw ? ; alias selector value (0 = none)
|
||||
*/
|
||||
dbgAddr = this.newAddr(DI, ES);
|
||||
var nSeg = this.getShort(dbgAddr, 2);
|
||||
var sel = this.getShort(dbgAddr, 2);
|
||||
var off = this.getLong(dbgAddr, 4);
|
||||
var len = this.getLong(dbgAddr, 4);
|
||||
var dbgAddrDevice = this.newAddr(this.getLong(dbgAddr, 4), this.getShort(dbgAddr, 2));
|
||||
var dbgAddrModule = this.newAddr(this.getLong(dbgAddr, 4), this.getShort(dbgAddr, 2));
|
||||
var selAlias = this.getShort(dbgAddr, 2) || sel;
|
||||
if (!this.fWinDbgRM) {
|
||||
this.log(this.getSZ(dbgAddrModule) + '!' + this.getSZ(dbgAddrDevice) + "!undefined " + ((AL & 0x1)? "data" : "code") + '(' + str.toHex(nSeg, 4) + ")=" + str.toHex(selAlias, 4) + ':' + str.toHex(off) + " len " + str.toHex(len));
|
||||
}
|
||||
}
|
||||
cpu.regEAX = (cpu.regEAX & ~0xff) | 0x01;
|
||||
break;
|
||||
|
||||
default:
|
||||
// this.println("INT 0x68: " + str.toHexByte(AH));
|
||||
if (this.fWinDbgRM) {
|
||||
this.log("INT 0x68: " + str.toHexByte(AH));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1488,18 +1571,29 @@ if (DEBUGGER) {
|
|||
};
|
||||
|
||||
/**
|
||||
* getProtMode()
|
||||
* getCurrentMode()
|
||||
*
|
||||
* @this {Debugger}
|
||||
* @return {boolean}
|
||||
* @return {boolean} (true if protected mode, false if not)
|
||||
*/
|
||||
Debugger.prototype.getProtMode = function()
|
||||
Debugger.prototype.getCurrentMode = function()
|
||||
{
|
||||
return this.cpu && !!(this.cpu.regCR0 & X86.CR0.MSW.PE) && !(this.cpu.regPS & X86.PS.VM);
|
||||
};
|
||||
|
||||
/**
|
||||
* getSegment(sel, fProt)
|
||||
* getCurrentType()
|
||||
*
|
||||
* @this {Debugger}
|
||||
* @return {number}
|
||||
*/
|
||||
Debugger.prototype.getCurrentType = function()
|
||||
{
|
||||
return this.getCurrentMode()? Debugger.ADDR.PROT : Debugger.ADDR.REAL;
|
||||
};
|
||||
|
||||
/**
|
||||
* getSegment(sel, type)
|
||||
*
|
||||
* If the selector matches that of any of the CPU segment registers, then return the CPU's segment
|
||||
* register, instead of using our own segDebugger segment register. This makes it possible for us to
|
||||
|
|
@ -1509,15 +1603,16 @@ if (DEBUGGER) {
|
|||
*
|
||||
* @this {Debugger}
|
||||
* @param {number|null|undefined} sel
|
||||
* @param {boolean} [fProt]
|
||||
* @param {number} [type] (defaults to getCurrentType())
|
||||
* @return {X86Seg|null} seg
|
||||
*/
|
||||
Debugger.prototype.getSegment = function(sel, fProt)
|
||||
Debugger.prototype.getSegment = function(sel, type)
|
||||
{
|
||||
var fProtMode = this.getProtMode();
|
||||
if (fProt === undefined) fProt = fProtMode;
|
||||
var typeDefault = this.getCurrentType();
|
||||
|
||||
if (fProt == fProtMode) {
|
||||
if (!type) type = typeDefault;
|
||||
|
||||
if (type == typeDefault) {
|
||||
if (sel === this.cpu.getCS()) return this.cpu.segCS;
|
||||
if (sel === this.cpu.getDS()) return this.cpu.segDS;
|
||||
if (sel === this.cpu.getES()) return this.cpu.segES;
|
||||
|
|
@ -1530,10 +1625,10 @@ if (DEBUGGER) {
|
|||
* Even if nSuppressBreaks is set, we'll allow the call in real-mode,
|
||||
* because a loadReal() request using segDebugger should generally be safe.
|
||||
*/
|
||||
if (this.nSuppressBreaks && fProt || !this.segDebugger) return null;
|
||||
if (this.nSuppressBreaks && type == Debugger.ADDR.PROT || !this.segDebugger) return null;
|
||||
}
|
||||
var seg = this.segDebugger;
|
||||
if (!fProt) {
|
||||
if (type != Debugger.ADDR.PROT) {
|
||||
seg.loadReal(sel);
|
||||
seg.limit = 0xffff; // although an ACTUAL real-mode segment load would not modify the limit,
|
||||
seg.offMax = 0x10000; // proper segDebugger operation requires that we update the limit ourselves
|
||||
|
|
@ -1564,7 +1659,7 @@ if (DEBUGGER) {
|
|||
if (addr == null) {
|
||||
addr = X86.ADDR_INVALID;
|
||||
if (dbgAddr) {
|
||||
var seg = this.getSegment(dbgAddr.sel, dbgAddr.fProt);
|
||||
var seg = this.getSegment(dbgAddr.sel, dbgAddr.type);
|
||||
if (seg) {
|
||||
if (!fWrite) {
|
||||
addr = seg.checkReadDebugger(dbgAddr.off || 0, nb || 1);
|
||||
|
|
@ -1690,7 +1785,7 @@ if (DEBUGGER) {
|
|||
};
|
||||
|
||||
/**
|
||||
* newAddr(off, sel, addr, fProt, fData32, fAddr32)
|
||||
* newAddr(off, sel, addr, type, fData32, fAddr32)
|
||||
*
|
||||
* Returns a NEW DbgAddr object, initialized with specified values and/or defaults.
|
||||
*
|
||||
|
|
@ -1698,18 +1793,43 @@ if (DEBUGGER) {
|
|||
* @param {number|null|undefined} [off] (default is zero)
|
||||
* @param {number|null|undefined} [sel] (default is undefined)
|
||||
* @param {number|null|undefined} [addr] (default is undefined)
|
||||
* @param {boolean} [fProt] (default is the current CPU mode)
|
||||
* @param {number} [type] (default is based on current CPU mode)
|
||||
* @param {boolean} [fData32] (default is the current CPU operand size)
|
||||
* @param {boolean} [fAddr32] (default is the current CPU address size)
|
||||
* @return {DbgAddr}
|
||||
*/
|
||||
Debugger.prototype.newAddr = function(off, sel, addr, fProt, fData32, fAddr32)
|
||||
Debugger.prototype.newAddr = function(off, sel, addr, type, fData32, fAddr32)
|
||||
{
|
||||
return this.setAddr({}, off, sel, addr, fProt, fData32, fAddr32);
|
||||
return this.setAddr({}, off, sel, addr, type, fData32, fAddr32);
|
||||
};
|
||||
|
||||
/**
|
||||
* setAddr(dbgAddr, off, sel, addr, fProt, fData32, fAddr32)
|
||||
* getAddrPrefix(dbgAddr)
|
||||
*
|
||||
* @this {Debugger}
|
||||
* @param {DbgAddr} dbgAddr
|
||||
* @return {string}
|
||||
*/
|
||||
Debugger.prototype.getAddrPrefix = function(dbgAddr)
|
||||
{
|
||||
var ch = '';
|
||||
switch (dbgAddr.type) {
|
||||
case Debugger.ADDR.REAL:
|
||||
case Debugger.ADDR.V86:
|
||||
ch = '&';
|
||||
break;
|
||||
case Debugger.ADDR.PROT:
|
||||
ch = '#';
|
||||
break;
|
||||
case Debugger.ADDR.LINEAR:
|
||||
ch = '%';
|
||||
break;
|
||||
}
|
||||
return ch;
|
||||
};
|
||||
|
||||
/**
|
||||
* setAddr(dbgAddr, off, sel, addr, type, fData32, fAddr32)
|
||||
*
|
||||
* Updates an EXISTING DbgAddr object, initialized with specified values and/or defaults.
|
||||
*
|
||||
|
|
@ -1718,17 +1838,17 @@ if (DEBUGGER) {
|
|||
* @param {number|null|undefined} [off] (default is zero)
|
||||
* @param {number|null|undefined} [sel] (default is undefined)
|
||||
* @param {number|null|undefined} [addr] (default is undefined)
|
||||
* @param {boolean} [fProt] (default is the current CPU mode)
|
||||
* @param {number} [type] (default is based on current CPU mode)
|
||||
* @param {boolean} [fData32] (default is the current CPU operand size)
|
||||
* @param {boolean} [fAddr32] (default is the current CPU address size)
|
||||
* @return {DbgAddr}
|
||||
*/
|
||||
Debugger.prototype.setAddr = function(dbgAddr, off, sel, addr, fProt, fData32, fAddr32)
|
||||
Debugger.prototype.setAddr = function(dbgAddr, off, sel, addr, type, fData32, fAddr32)
|
||||
{
|
||||
dbgAddr.off = off || 0;
|
||||
dbgAddr.sel = sel;
|
||||
dbgAddr.addr = addr;
|
||||
dbgAddr.fProt = (fProt != null)? fProt : this.getProtMode();
|
||||
dbgAddr.type = type || this.getCurrentType();
|
||||
dbgAddr.fData32 = (fData32 != null)? fData32 : (this.cpu && this.cpu.segCS.sizeData == 4);
|
||||
dbgAddr.fAddr32 = (fAddr32 != null)? fAddr32 : (this.cpu && this.cpu.segCS.sizeAddr == 4);
|
||||
dbgAddr.fTempBreak = false;
|
||||
|
|
@ -1764,22 +1884,27 @@ if (DEBUGGER) {
|
|||
};
|
||||
|
||||
/**
|
||||
* checkLimit(dbgAddr)
|
||||
* checkLimit(dbgAddr, fUpdate)
|
||||
*
|
||||
* Used by incAddr() and parseAddr() to ensure that the (updated) dbgAddr offset is within segment bounds.
|
||||
*
|
||||
* @this {Debugger}
|
||||
* @param {DbgAddr} dbgAddr
|
||||
* @param {boolean} [fUpdate] (true to update segment info)
|
||||
* @return {boolean}
|
||||
*/
|
||||
Debugger.prototype.checkLimit = function(dbgAddr)
|
||||
Debugger.prototype.checkLimit = function(dbgAddr, fUpdate)
|
||||
{
|
||||
if (dbgAddr.sel != null) {
|
||||
var seg = this.getSegment(dbgAddr.sel, dbgAddr.fProt);
|
||||
var seg = this.getSegment(dbgAddr.sel, dbgAddr.type);
|
||||
if (seg) {
|
||||
var off = dbgAddr.off & seg.maskAddr;
|
||||
if ((off >>> 0) >= seg.offMax) return false;
|
||||
dbgAddr.off = off;
|
||||
if (fUpdate) {
|
||||
dbgAddr.off = off;
|
||||
dbgAddr.fData32 = (seg.sizeData == 4);
|
||||
dbgAddr.fAddr32 = (seg.sizeAddr == 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
@ -1833,7 +1958,8 @@ if (DEBUGGER) {
|
|||
*/
|
||||
Debugger.prototype.hexAddr = function(dbgAddr)
|
||||
{
|
||||
return dbgAddr.sel == null? ('%' + str.toHex(dbgAddr.addr)) : this.hexOffset(dbgAddr.off, dbgAddr.sel, dbgAddr.fAddr32);
|
||||
var ch = this.getAddrPrefix(dbgAddr);
|
||||
return dbgAddr.sel == null? ('%' + str.toHex(dbgAddr.addr)) : (ch + this.hexOffset(dbgAddr.off, dbgAddr.sel, dbgAddr.fAddr32));
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1947,7 +2073,7 @@ if (DEBUGGER) {
|
|||
{
|
||||
var sInfo = "no information";
|
||||
if (BACKTRACK) {
|
||||
var dbgAddr = this.parseAddr(sAddr, Debugger.ADDR_CODE, true, true);
|
||||
var dbgAddr = this.parseAddr(sAddr, Debugger.ADDR.CODE, true, true);
|
||||
if (dbgAddr) {
|
||||
var addr = this.getAddr(dbgAddr);
|
||||
sInfo = '%' + str.toHex(addr) + ": " + (this.bus.getSymbol(addr, true) || sInfo);
|
||||
|
|
@ -2024,7 +2150,7 @@ if (DEBUGGER) {
|
|||
return;
|
||||
}
|
||||
|
||||
var seg = this.getSegment(sel, true);
|
||||
var seg = this.getSegment(sel, Debugger.ADDR.PROT);
|
||||
this.println("dumpDesc(" + str.toHexWord(seg? seg.sel : sel) + "): %" + str.toHex(seg? seg.addrDesc : null, this.cchAddr));
|
||||
if (!seg) return;
|
||||
|
||||
|
|
@ -2135,8 +2261,6 @@ if (DEBUGGER) {
|
|||
*
|
||||
* If you re-enable this protection, be sure to re-enable the decrement below, too.
|
||||
*/
|
||||
var fData32 = null, fAddr32 = null;
|
||||
|
||||
while (nLines > 0 && iHistory != this.iOpcodeHistory) {
|
||||
|
||||
var dbgAddr = aHistory[iHistory++];
|
||||
|
|
@ -2146,7 +2270,8 @@ if (DEBUGGER) {
|
|||
* We must create a new dbgAddr from the address in aHistory, because dbgAddr was
|
||||
* a reference, not a copy, and we don't want getInstruction() modifying the original.
|
||||
*/
|
||||
dbgAddr = this.newAddr(dbgAddr.off, dbgAddr.sel, dbgAddr.addr, dbgAddr.fProt, fData32 == null? dbgAddr.fData32 : fData32, fAddr32 == null? dbgAddr.fAddr32 : fAddr32);
|
||||
dbgAddr = this.newAddr(dbgAddr.off, dbgAddr.sel, dbgAddr.addr, dbgAddr.type, dbgAddr.fData32, dbgAddr.fAddr32);
|
||||
|
||||
var sInstruction = this.getInstruction(dbgAddr, "history", nPrev--);
|
||||
if (!aFilters.length || sInstruction.indexOf(aFilters[0]) >= 0) {
|
||||
this.println(sInstruction);
|
||||
|
|
@ -2156,11 +2281,8 @@ if (DEBUGGER) {
|
|||
* If there were OPERAND or ADDRESS overrides on the previous instruction, getInstruction()
|
||||
* will have automatically disassembled additional bytes, so skip additional history entries.
|
||||
*/
|
||||
if (!dbgAddr.cOverrides) {
|
||||
fData32 = fAddr32 = null;
|
||||
} else {
|
||||
if (dbgAddr.cOverrides) {
|
||||
iHistory += dbgAddr.cOverrides; nLines -= dbgAddr.cOverrides; nPrev -= dbgAddr.cOverrides;
|
||||
fData32 = dbgAddr.fData32; fAddr32 = dbgAddr.fAddr32;
|
||||
}
|
||||
|
||||
if (iHistory >= aHistory.length) iHistory = 0;
|
||||
|
|
@ -2256,7 +2378,7 @@ if (DEBUGGER) {
|
|||
this.println("invalid task selector: " + s);
|
||||
return;
|
||||
}
|
||||
seg = this.getSegment(sel, true);
|
||||
seg = this.getSegment(sel, Debugger.ADDR.PROT);
|
||||
}
|
||||
|
||||
this.println("dumpTSS(" + str.toHexWord(seg? seg.sel : sel) + "): %" + str.toHex(seg? seg.base : null, this.cchAddr));
|
||||
|
|
@ -3712,30 +3834,33 @@ if (DEBUGGER) {
|
|||
*/
|
||||
Debugger.prototype.getInstruction = function(dbgAddr, sComment, nSequence)
|
||||
{
|
||||
var dbgAddrIns = this.newAddr(dbgAddr.off, dbgAddr.sel, dbgAddr.addr, dbgAddr.fProt);
|
||||
var dbgAddrIns = this.newAddr(dbgAddr.off, dbgAddr.sel, dbgAddr.addr, dbgAddr.type);
|
||||
|
||||
var bOpcode = this.getByte(dbgAddr, 1);
|
||||
|
||||
/*
|
||||
* Incorporate OS and AS prefixes into the current instruction.
|
||||
* Incorporate OPERAND and ADDRESS size prefixes into the current instruction.
|
||||
*
|
||||
* And the verdict is in: redundant OS and AS prefixes must be ignored;
|
||||
* see opOS() and opAS() for details. We limit the amount of redundancy
|
||||
* to something reasonable (ie, 4).
|
||||
* And the verdict is in: redundant OPERAND and ADDRESS prefixes must be ignored;
|
||||
* see opOS() and opAS() for details. We limit the amount of redundancy to something
|
||||
* reasonable (ie, 4).
|
||||
*/
|
||||
var cMax = 4;
|
||||
var cMaxOverrides = 4, cOverrides = 0;
|
||||
var fDataPrefix = false, fAddrPrefix = false;
|
||||
while ((bOpcode == X86.OPCODE.OS || bOpcode == X86.OPCODE.AS) && cMax--) {
|
||||
|
||||
while ((bOpcode == X86.OPCODE.OS || bOpcode == X86.OPCODE.AS) && cMaxOverrides--) {
|
||||
if (bOpcode == X86.OPCODE.OS) {
|
||||
if (!fDataPrefix) {
|
||||
dbgAddr.fData32 = !dbgAddr.fData32;
|
||||
fDataPrefix = true;
|
||||
}
|
||||
cOverrides++;
|
||||
} else {
|
||||
if (!fAddrPrefix) {
|
||||
dbgAddr.fAddr32 = !dbgAddr.fAddr32;
|
||||
fAddrPrefix = true;
|
||||
}
|
||||
cOverrides++;
|
||||
}
|
||||
bOpcode = this.getByte(dbgAddr, 1);
|
||||
}
|
||||
|
|
@ -3889,7 +4014,7 @@ if (DEBUGGER) {
|
|||
}
|
||||
}
|
||||
|
||||
this.initAddrSize(dbgAddr, fNonPrefix, (fDataPrefix? 1 : 0) + (fAddrPrefix? 1 : 0));
|
||||
this.initAddrSize(dbgAddr, fNonPrefix, cOverrides);
|
||||
return sLine;
|
||||
};
|
||||
|
||||
|
|
@ -3931,7 +4056,7 @@ if (DEBUGGER) {
|
|||
sOperand = str.toHex(this.getShort(dbgAddr, 2), 4);
|
||||
break;
|
||||
case Debugger.TYPE_FARP:
|
||||
dbgAddr = this.newAddr(this.getWord(dbgAddr, true), this.getShort(dbgAddr, 2), null, dbgAddr.fProt, dbgAddr.fData32, dbgAddr.fAddr32);
|
||||
dbgAddr = this.newAddr(this.getWord(dbgAddr, true), this.getShort(dbgAddr, 2), null, dbgAddr.type, dbgAddr.fData32, dbgAddr.fAddr32);
|
||||
sOperand = this.hexAddr(dbgAddr);
|
||||
var aSymbol = this.findSymbol(dbgAddr);
|
||||
if (aSymbol[0]) sOperand += " (" + aSymbol[0] + ")";
|
||||
|
|
@ -4263,7 +4388,8 @@ if (DEBUGGER) {
|
|||
Debugger.prototype.getRegDump = function(fProt)
|
||||
{
|
||||
var s;
|
||||
if (fProt === undefined) fProt = this.getProtMode();
|
||||
if (fProt === undefined) fProt = this.getCurrentMode();
|
||||
|
||||
s = this.getRegOutput(Debugger.REG_AX) +
|
||||
this.getRegOutput(Debugger.REG_BX) +
|
||||
this.getRegOutput(Debugger.REG_CX) +
|
||||
|
|
@ -4275,6 +4401,7 @@ if (DEBUGGER) {
|
|||
this.getSegOutput(this.cpu.segSS, fProt) + ' ' +
|
||||
this.getSegOutput(this.cpu.segDS, fProt) + ' ' +
|
||||
this.getSegOutput(this.cpu.segES, fProt) + ' ';
|
||||
|
||||
if (fProt) {
|
||||
var sTR = "TR=" + str.toHex(this.cpu.segTSS.sel, 4);
|
||||
var sA20 = "A20=" + (this.bus.getA20()? "ON " : "OFF ");
|
||||
|
|
@ -4302,9 +4429,11 @@ if (DEBUGGER) {
|
|||
this.getSegOutput(this.cpu.segGS, fProt) + ' ';
|
||||
}
|
||||
}
|
||||
|
||||
s += this.getRegOutput(Debugger.REG_PS) +
|
||||
this.getFlagOutput('V') + this.getFlagOutput('D') + this.getFlagOutput('I') + this.getFlagOutput('T') +
|
||||
this.getFlagOutput('S') + this.getFlagOutput('Z') + this.getFlagOutput('A') + this.getFlagOutput('P') + this.getFlagOutput('C');
|
||||
|
||||
return s;
|
||||
};
|
||||
|
||||
|
|
@ -4332,7 +4461,7 @@ if (DEBUGGER) {
|
|||
*
|
||||
* @this {Debugger}
|
||||
* @param {string|undefined} sAddr
|
||||
* @param {number|undefined} [type] is the address segment type, in case sAddr doesn't specify a segment
|
||||
* @param {number|undefined} [type] is either CODE or DATA, in case sAddr doesn't specify a segment
|
||||
* @param {boolean} [fNoChecks] (eg, true when setting breakpoints that may not be valid now, but will be later)
|
||||
* @param {boolean} [fQuiet]
|
||||
* @return {DbgAddr|null|undefined}
|
||||
|
|
@ -4340,24 +4469,45 @@ if (DEBUGGER) {
|
|||
Debugger.prototype.parseAddr = function(sAddr, type, fNoChecks, fQuiet)
|
||||
{
|
||||
var dbgAddr, fPrint;
|
||||
var dbgAddrNext = (type === Debugger.ADDR_CODE? this.dbgAddrNextCode : this.dbgAddrNextData);
|
||||
var dbgAddrNext = (type === Debugger.ADDR.CODE? this.dbgAddrNextCode : this.dbgAddrNextData);
|
||||
|
||||
var off = dbgAddrNext.off, sel = dbgAddrNext.sel, addr = dbgAddrNext.addr;
|
||||
|
||||
type = fNoChecks? Debugger.ADDR.NONE : dbgAddrNext.type;
|
||||
|
||||
if (fQuiet) fPrint = false;
|
||||
|
||||
if (sAddr !== undefined) {
|
||||
|
||||
if (sAddr.charAt(0) == '%') {
|
||||
var ch = sAddr.charAt(0);
|
||||
var iColon = sAddr.indexOf(':');
|
||||
|
||||
switch(ch) {
|
||||
case '&':
|
||||
type = Debugger.ADDR.REAL;
|
||||
break;
|
||||
case '#':
|
||||
type = Debugger.ADDR.PROT;
|
||||
break;
|
||||
case '%':
|
||||
type = Debugger.ADDR.LINEAR;
|
||||
off = addr = 0;
|
||||
sel = null; // we still have code that relies on this crutch, instead of the type field
|
||||
break;
|
||||
default:
|
||||
if (iColon >= 0) type = Debugger.ADDR.NONE;
|
||||
ch = '';
|
||||
break;
|
||||
}
|
||||
|
||||
if (ch) {
|
||||
sAddr = sAddr.substr(1);
|
||||
off = 0;
|
||||
sel = null;
|
||||
addr = 0;
|
||||
iColon--;
|
||||
}
|
||||
|
||||
dbgAddr = this.findSymbolAddr(sAddr);
|
||||
if (dbgAddr) return dbgAddr;
|
||||
|
||||
var iColon = sAddr.indexOf(':');
|
||||
if (iColon < 0) {
|
||||
if (sel != null) {
|
||||
off = this.parseExpression(sAddr, fPrint);
|
||||
|
|
@ -4375,8 +4525,8 @@ if (DEBUGGER) {
|
|||
}
|
||||
|
||||
if (off != null) {
|
||||
dbgAddr = this.newAddr(off, sel, addr);
|
||||
if (!fNoChecks && !this.checkLimit(dbgAddr)) {
|
||||
dbgAddr = this.newAddr(off, sel, addr, type);
|
||||
if (!fNoChecks && !this.checkLimit(dbgAddr, true)) {
|
||||
this.println("invalid offset: " + this.hexAddr(dbgAddr));
|
||||
dbgAddr = null;
|
||||
}
|
||||
|
|
@ -5045,7 +5195,7 @@ if (DEBUGGER) {
|
|||
*/
|
||||
Debugger.prototype.doAssemble = function(asArgs)
|
||||
{
|
||||
var dbgAddr = this.parseAddr(asArgs[1], Debugger.ADDR_CODE);
|
||||
var dbgAddr = this.parseAddr(asArgs[1], Debugger.ADDR.CODE);
|
||||
if (!dbgAddr) return;
|
||||
|
||||
this.dbgAddrAssemble = dbgAddr;
|
||||
|
|
@ -5124,17 +5274,10 @@ if (DEBUGGER) {
|
|||
}
|
||||
var dbgAddr = {};
|
||||
if (sAddr != '*') {
|
||||
dbgAddr = this.parseAddr(sAddr, Debugger.ADDR_CODE, true);
|
||||
dbgAddr = this.parseAddr(sAddr, Debugger.ADDR.CODE, true);
|
||||
if (!dbgAddr) return;
|
||||
}
|
||||
|
||||
/*
|
||||
* We want our breakpoints to be "mode-less"; ie, independent of the processor mode at the
|
||||
* time they're set. Therefore, it's critical that we erase the fProt setting that parseAddr(),
|
||||
* via newAddr(), initialized dbgAddr with.
|
||||
*/
|
||||
dbgAddr.fProt = undefined;
|
||||
|
||||
sAddr = (dbgAddr.off == null? sAddr : str.toHexWord(dbgAddr.off));
|
||||
|
||||
if (sParm == 'c') {
|
||||
|
|
@ -5310,7 +5453,7 @@ if (DEBUGGER) {
|
|||
return;
|
||||
}
|
||||
|
||||
var dbgAddr = this.parseAddr(sAddr, Debugger.ADDR_DATA);
|
||||
var dbgAddr = this.parseAddr(sAddr, Debugger.ADDR.DATA);
|
||||
if (!dbgAddr || dbgAddr.sel == null && dbgAddr.addr == null) return;
|
||||
|
||||
var cb = 0; // 0 is not a default; it triggers the appropriate default below
|
||||
|
|
@ -5375,7 +5518,7 @@ if (DEBUGGER) {
|
|||
return;
|
||||
}
|
||||
|
||||
var dbgAddr = this.parseAddr(sAddr, Debugger.ADDR_DATA);
|
||||
var dbgAddr = this.parseAddr(sAddr, Debugger.ADDR.DATA);
|
||||
if (!dbgAddr) return;
|
||||
|
||||
for (var i = 2; i < asArgs.length; i++) {
|
||||
|
|
@ -5629,7 +5772,7 @@ if (DEBUGGER) {
|
|||
*/
|
||||
Debugger.prototype.doList = function(sSymbol)
|
||||
{
|
||||
var dbgAddr = this.parseAddr(sSymbol, Debugger.ADDR_CODE);
|
||||
var dbgAddr = this.parseAddr(sSymbol, Debugger.ADDR.CODE);
|
||||
if (!dbgAddr) return;
|
||||
|
||||
var addr = this.getAddr(dbgAddr);
|
||||
|
|
@ -5690,7 +5833,7 @@ if (DEBUGGER) {
|
|||
var fJSON = (asArgs[1] == "json");
|
||||
var iDrive, iSector = 0, nSectors = 0;
|
||||
|
||||
var dbgAddr = (fJSON? {} : this.parseAddr(asArgs[1], Debugger.ADDR_DATA));
|
||||
var dbgAddr = (fJSON? {} : this.parseAddr(asArgs[1], Debugger.ADDR.DATA));
|
||||
if (!dbgAddr) return;
|
||||
|
||||
iDrive = this.parseValue(asArgs[2], "drive #");
|
||||
|
|
@ -6273,13 +6416,13 @@ if (DEBUGGER) {
|
|||
Debugger.prototype.doRun = function(sAddr, sOptions, fQuiet)
|
||||
{
|
||||
if (sAddr !== undefined) {
|
||||
var dbgAddr = this.parseAddr(this.parseReference(sAddr), Debugger.ADDR_CODE);
|
||||
var dbgAddr = this.parseAddr(this.parseReference(sAddr), Debugger.ADDR.CODE);
|
||||
if (!dbgAddr) return;
|
||||
this.parseAddrOptions(dbgAddr, sOptions);
|
||||
this.setTempBreakpoint(dbgAddr);
|
||||
}
|
||||
if (!fQuiet && !this.runCPU(true)) {
|
||||
this.println('cpu busy, "g" command ignored');
|
||||
this.println('cpu busy or unavailable, command ignored');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -6432,7 +6575,7 @@ if (DEBUGGER) {
|
|||
var sCall = null;
|
||||
var off = dbgAddr.off;
|
||||
var offOrig = off;
|
||||
for (var n = 1; n <= 6; n++) {
|
||||
for (var n = 1; n <= 6 && !!off; n++) {
|
||||
if (n > 2) {
|
||||
dbgAddr.off = off;
|
||||
dbgAddr.addr = null;
|
||||
|
|
@ -6442,7 +6585,7 @@ if (DEBUGGER) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (!--off) break;
|
||||
off--;
|
||||
}
|
||||
dbgAddr.off = offOrig;
|
||||
return sCall;
|
||||
|
|
@ -6537,7 +6680,7 @@ if (DEBUGGER) {
|
|||
/*
|
||||
* Use cOverrides to record whether we previously processed any OPERAND or ADDRESS overrides.
|
||||
*/
|
||||
dbgAddr.cOverrides = cOverrides;
|
||||
dbgAddr.cOverrides = cOverrides || 0;
|
||||
/*
|
||||
* For proper disassembly of instructions preceded by an OPERAND (0x66) size prefix, we set
|
||||
* dbgAddr.fData32 to true whenever the operand size is 32-bit; similarly, for an ADDRESS (0x67)
|
||||
|
|
@ -6545,8 +6688,10 @@ if (DEBUGGER) {
|
|||
* both fields must be set to match the size of the current code segment.
|
||||
*/
|
||||
if (fNonPrefix) {
|
||||
dbgAddr.fData32 = (this.cpu.segCS.sizeData == 4);
|
||||
dbgAddr.fAddr32 = (this.cpu.segCS.sizeAddr == 4);
|
||||
if (dbgAddr.fData32Orig != null) dbgAddr.fData32 = dbgAddr.fData32Orig;
|
||||
if (dbgAddr.fAddr32Orig != null) dbgAddr.fAddr32 = dbgAddr.fAddr32Orig;
|
||||
dbgAddr.fData32Orig = dbgAddr.fData32;
|
||||
dbgAddr.fAddr32Orig = dbgAddr.fAddr32;
|
||||
}
|
||||
/*
|
||||
* We also use dbgAddr.fComplete to record whether the caller (ie, getInstruction()) is reporting that
|
||||
|
|
@ -6577,16 +6722,15 @@ if (DEBUGGER) {
|
|||
*/
|
||||
Debugger.prototype.doUnassemble = function(sAddr, sAddrEnd, n)
|
||||
{
|
||||
var dbgAddr = this.parseAddr(sAddr, Debugger.ADDR_CODE);
|
||||
var dbgAddr = this.parseAddr(sAddr, Debugger.ADDR.CODE);
|
||||
if (!dbgAddr) return;
|
||||
|
||||
if (n === undefined) n = 1;
|
||||
var dbgAddrEnd = this.newAddr(this.maskReg, dbgAddr.sel, this.bus.nBusLimit);
|
||||
|
||||
var cb = 0x100;
|
||||
var dbgAddrEnd, cb = 0x100;
|
||||
if (sAddrEnd !== undefined) {
|
||||
|
||||
dbgAddrEnd = this.parseAddr(sAddrEnd, Debugger.ADDR_CODE);
|
||||
dbgAddrEnd = this.parseAddr(sAddrEnd, Debugger.ADDR.CODE);
|
||||
if (!dbgAddrEnd || dbgAddrEnd.off < dbgAddr.off) return;
|
||||
|
||||
cb = dbgAddrEnd.off - dbgAddr.off;
|
||||
|
|
@ -6601,6 +6745,9 @@ if (DEBUGGER) {
|
|||
}
|
||||
n = -1;
|
||||
}
|
||||
else {
|
||||
dbgAddrEnd = this.newAddr(this.maskReg, dbgAddr.sel, this.bus.nBusLimit, dbgAddr.type, dbgAddr.fData32, dbgAddr.fAddr32);
|
||||
}
|
||||
|
||||
var cLines = 0;
|
||||
this.initAddrSize(dbgAddr, true);
|
||||
|
|
@ -6629,7 +6776,7 @@ if (DEBUGGER) {
|
|||
var sInstruction = this.getInstruction(dbgAddr, sComment, nSequence);
|
||||
|
||||
/*
|
||||
* If getInstruction() reported that it did not yet process a complete instruction (via dbgAddr.fComplete),
|
||||
* If getInstruction() reported that it did not process a complete instruction (via dbgAddr.fComplete),
|
||||
* then bump the instruction count by one, so that we display one more line (and hopefully the complete
|
||||
* instruction).
|
||||
*/
|
||||
|
|
@ -6677,7 +6824,12 @@ if (DEBUGGER) {
|
|||
* for (var i = 0; i < a.length; i++) a[i] = str.trim(a[i]);
|
||||
*
|
||||
* We may now split on semi-colons ONLY if they are outside a quoted sequence.
|
||||
*
|
||||
* Also, to allow quoted strings *inside* breakpoint commands, we first replace all
|
||||
* DOUBLE double-quotes with single quotes.
|
||||
*/
|
||||
sCmd = sCmd.replace(/""/g, "'");
|
||||
|
||||
var iPrev = 0;
|
||||
var chQuote = null;
|
||||
chSep = chSep || ';';
|
||||
|
|
|
|||
|
|
@ -63,13 +63,18 @@ var Interrupts = {
|
|||
VECTOR: 0x41,
|
||||
IS_LOADED: 0x004F, // AX command
|
||||
LOADED: 0xF386, // returned in AX if Windows Debugger loaded
|
||||
LOAD_SEG: 0x0050 // SI==0 if code, 1 if data; BX==segnum-1; CX==selector; ES:[E]DI->module name
|
||||
LOAD_SEG: 0x0050, // SI==0 if code, 1 if data; BX==segnum-1; CX==selector; ES:[E]DI->module name
|
||||
ENABLED: true // support for WINDBGRM interrupts can be disabled
|
||||
},
|
||||
WINDBGRM: { // Windows Debugger real-mode interface
|
||||
VECTOR: 0x68,
|
||||
IS_LOADED: 0x43, // AH command
|
||||
LOADED: 0xF386, // returned in AX if Windows Debugger loaded
|
||||
ENABLED: false // support for WINDBGRM interrupts is NOT enabled by default
|
||||
LOAD_SEG: 0x50, // AL=segment type, ES:DI->D386_Device_Params
|
||||
/*
|
||||
* This must be disabled until we're able to respond intelligently to requests like D386_Prepare_PMode (0x44)
|
||||
*/
|
||||
ENABLED: false // support for WINDBGRM interrupts can be disabled
|
||||
},
|
||||
FUNCS: {} // filled in only if DEBUGGER is true
|
||||
};
|
||||
|
|
|
|||
|
|
@ -520,8 +520,18 @@ Video.MODE = {
|
|||
VGA_640X480_MONO: 0x11, // mapped at A000:0000, mono, 2bpp, planar
|
||||
VGA_640X480: 0x12, // mapped at A000:0000, color, 4bpp, planar
|
||||
VGA_320X200: 0x13, // mapped at A000:0000, color, 8bpp, linear
|
||||
VGA_320X240: 0x78, // mapped at A000:0000, color, 8bpp, planar ("Mode X")
|
||||
VGA_320X400: 0x7A, // mapped at A000:0000, color, 8bpp, planar
|
||||
/*
|
||||
* The remaining mode identifiers are for internal use only; there is no correlation with any
|
||||
* publicly defined BIOS modes, and overlap with any third-party mode numbers is purely coincidental.
|
||||
*/
|
||||
VGA_320X240: 0x14, // mapped at A000:0000, color, 8bpp, planar ("Mode X")
|
||||
VGA_320X400: 0x15, // mapped at A000:0000, color, 8bpp, planar
|
||||
/*
|
||||
* Here's where we might assign additional identifiers to certain unique combinations, like the
|
||||
* fTextGraphicsHybrid 320x400 mode that Windows 95 uses (ie, when the buffer is mapped to B800:0000
|
||||
* instead of A000:0000 and is configured for text mode access, but graphics are still being displayed
|
||||
* from the second half of video memory).
|
||||
*/
|
||||
UNKNOWN: 0xFF
|
||||
};
|
||||
|
||||
|
|
@ -733,8 +743,8 @@ Video.FONT = {
|
|||
* and it might not always be the best fit.
|
||||
*/
|
||||
Video.aModeParms = []; // Mode
|
||||
Video.aModeParms[Video.MODE.CGA_40X25] = [ 40, 25, 1, 0, Video.FONT.CGA]; // 0x00
|
||||
Video.aModeParms[Video.MODE.CGA_80X25] = [ 80, 25, 1, 0, Video.FONT.CGA]; // 0x02
|
||||
Video.aModeParms[Video.MODE.CGA_40X25] = [ 40, 25, 1, 0, Video.FONT.CGA]; // 0x01
|
||||
Video.aModeParms[Video.MODE.CGA_80X25] = [ 80, 25, 1, 0, Video.FONT.CGA]; // 0x03
|
||||
Video.aModeParms[Video.MODE.CGA_320X200] = [320, 200, 8, 192]; // 0x04
|
||||
Video.aModeParms[Video.MODE.CGA_640X200] = [640, 200, 16, 192]; // 0x06
|
||||
Video.aModeParms[Video.MODE.MDA_80X25] = [ 80, 25, 1, 0, Video.FONT.MDA]; // 0x07
|
||||
|
|
@ -745,11 +755,11 @@ Video.aModeParms[Video.MODE.EGA_640X350] = [640, 350, 8];
|
|||
Video.aModeParms[Video.MODE.VGA_640X480_MONO] = [640, 480, 8]; // 0x11
|
||||
Video.aModeParms[Video.MODE.VGA_640X480] = [640, 480, 8]; // 0x12
|
||||
Video.aModeParms[Video.MODE.VGA_320X200] = [320, 200, 1]; // 0x13
|
||||
Video.aModeParms[Video.MODE.VGA_320X240] = [320, 240, 4]; // 0x78
|
||||
Video.aModeParms[Video.MODE.VGA_320X400] = [320, 400, 4]; // 0x7A
|
||||
Video.aModeParms[Video.MODE.VGA_320X240] = [320, 240, 4]; // 0x14
|
||||
Video.aModeParms[Video.MODE.VGA_320X400] = [320, 400, 4]; // 0x15
|
||||
|
||||
Video.aModeParms[Video.MODE.CGA_40X25_BW] = Video.aModeParms[Video.MODE.CGA_40X25]; // 0x01
|
||||
Video.aModeParms[Video.MODE.CGA_80X25_BW] = Video.aModeParms[Video.MODE.CGA_80X25]; // 0x03
|
||||
Video.aModeParms[Video.MODE.CGA_40X25_BW] = Video.aModeParms[Video.MODE.CGA_40X25]; // 0x00
|
||||
Video.aModeParms[Video.MODE.CGA_80X25_BW] = Video.aModeParms[Video.MODE.CGA_80X25]; // 0x02
|
||||
Video.aModeParms[Video.MODE.CGA_320X200_BW] = Video.aModeParms[Video.MODE.CGA_320X200]; // 0x05
|
||||
|
||||
/*
|
||||
|
|
@ -3887,9 +3897,8 @@ Video.prototype.setFontData = function(abFontData, aFontOffsets, cxFontChar)
|
|||
* Calls to buildFonts() should not be expensive though: the underlying createFont() function rebuilds a font only
|
||||
* if its color has actually changed.
|
||||
*
|
||||
* TODO: We should avoid rebuilding fonts when palette registers change in graphics modes. More importantly, our
|
||||
* font code is still written with the assumption that, like the MDA/CGA, the underlying font data never changes.
|
||||
* The EGA, however, stores its fonts in plane 2, which means fonts are dynamic; this needs to be fixed.
|
||||
* TODO: Our font code is still written with the assumption that, like the MDA/CGA, the underlying font data never
|
||||
* changes. The EGA, however, stores its fonts in plane 2, which means fonts are dynamic; this needs to be fixed.
|
||||
*
|
||||
* Supporting dynamic EGA fonts should not be hard though. We can get rid of abFontData and simply build a
|
||||
* temporary snapshot of all the font bytes in plane 2 of the EGA's video buffer (adwMemory), and pass that on to
|
||||
|
|
@ -3901,16 +3910,21 @@ Video.prototype.setFontData = function(abFontData, aFontOffsets, cxFontChar)
|
|||
* for 43-line mode, and so on).
|
||||
*
|
||||
* @this {Video}
|
||||
* @param {boolean} [fRebuild] (true if this is a rebuild, not an initial build)
|
||||
* @return {boolean} true if any or all fonts were (re)built, false if nothing changed
|
||||
*/
|
||||
Video.prototype.buildFonts = function()
|
||||
Video.prototype.buildFonts = function(fRebuild)
|
||||
{
|
||||
var fChanges = false;
|
||||
|
||||
/*
|
||||
* There's no point building any fonts if this is a non-windowed (eg, command-line) environment OR no font data was loaded.
|
||||
* There's no point building fonts if this is a non-windowed (command-line) environment
|
||||
* OR no font data is available (OR this is a rebuild AND we're currently in a graphics mode).
|
||||
*
|
||||
* In other words, build fonts if this IS a windowed environment AND font data is available
|
||||
* AND this is not a rebuild, OR it IS a rebuild but we're in a graphics mode (ie, nFont is zero).
|
||||
*/
|
||||
if (window && this.abFontData) {
|
||||
if (window && this.abFontData && (!fRebuild || this.nFont)) {
|
||||
|
||||
var offSplit = 0x0000;
|
||||
var cxChar = this.cxFontChar? this.cxFontChar : 8;
|
||||
|
|
@ -4254,7 +4268,7 @@ Video.prototype.checkCursor = function()
|
|||
*/
|
||||
var iCellCursor = (this.cardActive.regCRTData[Card.CRTC.CURSOR_ADDR_LO] + ((this.cardActive.regCRTData[Card.CRTC.CURSOR_ADDR_HI] & Card.CRTC.ADDR_HI_MASK) << 8));
|
||||
if (this.iCellCursor != iCellCursor) {
|
||||
if (DEBUG && this.messageEnabled()) {
|
||||
if (MAXDEBUG && this.messageEnabled()) {
|
||||
this.printMessage("checkCursor(): cursor moved from " + this.iCellCursor + " to " + iCellCursor);
|
||||
}
|
||||
this.removeCursor();
|
||||
|
|
@ -4309,7 +4323,7 @@ Video.prototype.removeCursor = function()
|
|||
*/
|
||||
this.updateChar(col, row, data);
|
||||
}
|
||||
if (DEBUG && this.messageEnabled()) {
|
||||
if (MAXDEBUG && this.messageEnabled()) {
|
||||
this.printMessage("removeCursor(): removed from " + row + "," + col);
|
||||
}
|
||||
this.aCellCache[this.iCellCursor] = data;
|
||||
|
|
@ -4467,6 +4481,8 @@ Video.prototype.setCardAccess = function(nAccess)
|
|||
/**
|
||||
* setDimensions()
|
||||
*
|
||||
* This is the workhorse of setMode()
|
||||
*
|
||||
* @this {Video}
|
||||
*/
|
||||
Video.prototype.setDimensions = function()
|
||||
|
|
@ -4652,7 +4668,7 @@ Video.prototype.setDimensions = function()
|
|||
* checkMode(fForce)
|
||||
*
|
||||
* Called whenever the MDA/CGA's mode register (eg, Card.MDA.MODE.PORT, Card.CGA.MODE.PORT) is updated,
|
||||
* or whenever the EGA's GRC Misc register is updated, or when we've just finished a restore().
|
||||
* or whenever the EGA/VGA's GRC.MISC register is updated, or when we've just finished a restore().
|
||||
*
|
||||
* @this {Video}
|
||||
* @param {boolean} [fForce] is used to force a mode update, if we recognize the current mode
|
||||
|
|
@ -4723,55 +4739,81 @@ Video.prototype.checkMode = function(fForce)
|
|||
* so that as support is added for even more modes (eg, "Mode X" variations, monochrome modes, etc), it
|
||||
* doesn't get totally out of control.
|
||||
*/
|
||||
var fSEQDotClock = (card.regSEQData[Card.SEQ.CLOCKING.INDX] & Card.SEQ.CLOCKING.DOTCLOCK);
|
||||
var nCRTCVertTotal = card.regCRTData[Card.CRTC.EGA.VTOTAL];
|
||||
var fSEQDotClock, nCRTCVertTotal, nCRTCMaxScan;
|
||||
var regGRCMode = card.regGRCData[Card.GRC.MODE.INDX];
|
||||
|
||||
/*
|
||||
* This text/graphics hybrid test detects the way Windows 95 reprograms the VGA on boot (ie, switching
|
||||
* to graphics mode 0x13 (320x200) without disturbing the text buffer contents, then reprogramming it
|
||||
* to enable graphics mode 0x15 (320x400), then drawing a logo in the 2nd half of the video memory, and
|
||||
* finally reprogramming regGRCMode and regGRCMisc to move the frame buffer back to its original text mode
|
||||
* location.
|
||||
*/
|
||||
var fTextGraphicsHybrid = (regGRCMode & (Card.GRC.MODE.COLOR256 | Card.GRC.MODE.EVENODD)) == (Card.GRC.MODE.COLOR256 | Card.GRC.MODE.EVENODD);
|
||||
if (fTextGraphicsHybrid) {
|
||||
/*
|
||||
* When fTextGraphicsHybrid is true, we should be at the end of the above process, so addrBuffer
|
||||
* will have changed. Since we don't (yet) assign a special mode to that configuration, we must at
|
||||
* least set fForce to true, so that setMode() will notice the buffer address change and remap it.
|
||||
*/
|
||||
if (card.addrBuffer != this.addrBuffer || card.sizeBuffer != this.sizeBuffer) {
|
||||
fForce = true;
|
||||
}
|
||||
}
|
||||
|
||||
fSEQDotClock = (card.regSEQData[Card.SEQ.CLOCKING.INDX] & Card.SEQ.CLOCKING.DOTCLOCK);
|
||||
nCRTCVertTotal = card.regCRTData[Card.CRTC.EGA.VTOTAL];
|
||||
nCRTCVertTotal |= ((card.regCRTData[Card.CRTC.EGA.OVERFLOW.INDX] & Card.CRTC.EGA.OVERFLOW.VTOTAL_BIT8)? 0x100 : 0);
|
||||
if (card.nCard == Video.CARD.VGA) {
|
||||
nCRTCVertTotal |= ((card.regCRTData[Card.CRTC.EGA.OVERFLOW.INDX] & Card.CRTC.EGA.OVERFLOW.VTOTAL_BIT9)? 0x200 : 0);
|
||||
}
|
||||
var nCRTCMaxScan = card.regCRTData[Card.CRTC.EGA.MAX_SCAN.INDX];
|
||||
nCRTCMaxScan = card.regCRTData[Card.CRTC.EGA.MAX_SCAN.INDX];
|
||||
|
||||
if (nMode != Video.MODE.UNKNOWN) {
|
||||
if (!(regGRCMisc & Card.GRC.MISC.GRAPHICS)) {
|
||||
if (fSEQDotClock) nMode -= 2;
|
||||
/*
|
||||
* Here's where we handle text modes; since nMode will have been assigned a default
|
||||
* of either 0x02 or 0x03, convert that to either 0x05 or 0x04 if we're in a low-res
|
||||
* graphics mode, 0x06 otherwise.
|
||||
*/
|
||||
nMode -= (fSEQDotClock? 2 : 0);
|
||||
}
|
||||
else if (card.addrBuffer != 0xA0000 && !fTextGraphicsHybrid) {
|
||||
/*
|
||||
* Here's where we handle CGA graphics modes; since nMode will have been assigned a
|
||||
* default of either 0x02 or 0x03, convert that to either 0x05 or 0x04 if we're in a
|
||||
* low-res graphics mode, 0x06 otherwise.
|
||||
*/
|
||||
nMode = fSEQDotClock? (7 - nMode) : Video.MODE.CGA_640X200;
|
||||
} else {
|
||||
if (card.addrBuffer == 0xB8000) {
|
||||
/*
|
||||
* Since nMode will have been assigned a default of either 0x02 or 0x03, convert that to
|
||||
* either 0x05 or 0x04 if we're in a low-res graphics mode, 0x06 otherwise.
|
||||
*/
|
||||
nMode = fSEQDotClock? (7 - nMode) : Video.MODE.CGA_640X200;
|
||||
} else {
|
||||
/*
|
||||
* card.addrBuffer must be 0xA0000, so we need to discriminate among modes 0x0D and up;
|
||||
* we've already defaulted to either 0x0F or 0x10. If COLOR256 is set, then select mode
|
||||
* 0x13 (or greater), else if 200-to-400 scan-line conversion is in effect, select either
|
||||
* mode 0x0D or 0x0E, else if VGA resolution is set, select either mode 0x11 or 0x12.
|
||||
*/
|
||||
if (card.regGRCData[Card.GRC.MODE.INDX] & Card.GRC.MODE.COLOR256) {
|
||||
if (nCRTCMaxScan & Card.CRTC.EGA.MAX_SCAN.SCAN_LINE) {
|
||||
if (card.regCRTData[Card.CRTC.EGA.VDISP_END] <= 0x8F) {
|
||||
nMode = Video.MODE.VGA_320X200;
|
||||
}
|
||||
else { /* (card.regCRTData[Card.CRTC.EGA.VDISP_END] == 0xDF) */
|
||||
nMode = Video.MODE.VGA_320X240;
|
||||
}
|
||||
} else {
|
||||
nMode = Video.MODE.VGA_320X400;
|
||||
/*
|
||||
* Here's where we handle EGA/VGA graphics modes, discriminating among modes 0x0D and up;
|
||||
* we've already defaulted to either 0x0F or 0x10. If COLOR256 is set, then select mode
|
||||
* 0x13 (or greater), else if 200-to-400 scan-line conversion is in effect, select either
|
||||
* mode 0x0D or 0x0E, else if VGA resolution is set, select either mode 0x11 or 0x12.
|
||||
*/
|
||||
if (card.regGRCData[Card.GRC.MODE.INDX] & Card.GRC.MODE.COLOR256) {
|
||||
if (nCRTCMaxScan & Card.CRTC.EGA.MAX_SCAN.SCAN_LINE) {
|
||||
if (card.regCRTData[Card.CRTC.EGA.VDISP_END] <= 0x8F) {
|
||||
nMode = Video.MODE.VGA_320X200;
|
||||
}
|
||||
else { /* (card.regCRTData[Card.CRTC.EGA.VDISP_END] == 0xDF) */
|
||||
nMode = Video.MODE.VGA_320X240;
|
||||
}
|
||||
} else {
|
||||
nMode = Video.MODE.VGA_320X400;
|
||||
}
|
||||
else if (nCRTCMaxScan & Card.CRTC.EGA.MAX_SCAN.CONVERT400) {
|
||||
nMode = (fSEQDotClock? Video.MODE.EGA_320X200 : Video.MODE.EGA_640X200);
|
||||
} else if (nCRTCVertTotal > 500) {
|
||||
nMode = (this.nMonitorType == ChipSet.MONITOR.MONO? Video.MODE.VGA_640X480_MONO : Video.MODE.VGA_640X480);
|
||||
}
|
||||
if (DEBUG && this.messageEnabled()) {
|
||||
this.printMessage("checkMode(): nCRTCVertTotal=" + nCRTCVertTotal + ", mode=" + str.toHexByte(nMode));
|
||||
}
|
||||
}
|
||||
else if (nCRTCMaxScan & Card.CRTC.EGA.MAX_SCAN.CONVERT400) {
|
||||
nMode = (fSEQDotClock? Video.MODE.EGA_320X200 : Video.MODE.EGA_640X200);
|
||||
} else if (nCRTCVertTotal > 500) {
|
||||
nMode = (this.nMonitorType == ChipSet.MONITOR.MONO? Video.MODE.VGA_640X480_MONO : Video.MODE.VGA_640X480);
|
||||
}
|
||||
if (DEBUG && this.messageEnabled()) {
|
||||
this.printMessage("checkMode(): nCRTCVertTotal=" + nCRTCVertTotal + ", mode=" + str.toHexByte(nMode));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nAccess = this.getCardAccess();
|
||||
}
|
||||
}
|
||||
|
|
@ -4812,8 +4854,8 @@ Video.prototype.checkMode = function(fForce)
|
|||
/**
|
||||
* setMode(nMode, fForce)
|
||||
*
|
||||
* Set fForce to true to update the mode regardless of previous mode, or false to perform a normal update
|
||||
* that bypasses updateScreen() but still calls initCellCache().
|
||||
* Set fForce to true to update the mode regardless of previous mode, or false to perform
|
||||
* a normal update that bypasses updateScreen() but still calls initCellCache().
|
||||
*
|
||||
* @this {Video}
|
||||
* @param {number|null} nMode
|
||||
|
|
@ -4825,7 +4867,7 @@ Video.prototype.setMode = function(nMode, fForce)
|
|||
if (nMode != null && (nMode != this.nMode || fForce)) {
|
||||
|
||||
if (DEBUG && this.messageEnabled()) {
|
||||
this.printMessage("setMode(" + str.toHexByte(nMode) + (fForce? ",force" : "") + ")");
|
||||
this.printMessage("setMode(" + str.toHexByte(nMode) + (fForce? ",force" : "") + ")", true, true);
|
||||
}
|
||||
|
||||
this.cUpdates = 0; // count updateScreen() calls as a means of driving blink updates
|
||||
|
|
@ -5162,12 +5204,28 @@ Video.prototype.updateScreen = function(fForce)
|
|||
|
||||
/*
|
||||
* Calculate the VISIBLE start of screen memory (addrScreen), not merely the PHYSICAL start,
|
||||
* as well as the extent of it (cbScreen) and use those values for all addressing operations
|
||||
* to follow. FYI, in these calculations, offScreen does not refer to "off-screen" memory,
|
||||
* but rather the "offset" of the start of visible screen memory.
|
||||
* as well as the extent of it (cbScreen) and use those values for all addressing operations to follow.
|
||||
* FYI, in these calculations, offScreen does not refer to "off-screen" memory, but rather the "offset"
|
||||
* of the start of visible screen memory.
|
||||
*/
|
||||
var addrScreen = card.addrBuffer;
|
||||
var addrScreenLimit = addrScreen + card.sizeBuffer;
|
||||
var addrBuffer = this.addrBuffer;
|
||||
var addrScreen = addrBuffer;
|
||||
var addrScreenLimit = addrScreen + this.sizeBuffer;
|
||||
|
||||
/*
|
||||
* HACK: To deal with the fTextGraphicsHybrid 320x400 mode that Windows 95 uses (ie, when the buffer
|
||||
* is mapped to B800:0000 instead of A000:0000 and is configured for text mode access, but graphics are
|
||||
* still being displayed from the second half of video memory), we must ignore the programmed address.
|
||||
*
|
||||
* In that case, the hard-coded address range below isn't actually active either, but it doesn't matter;
|
||||
* we just have to get through the rest of this function and make it to the updateScreenGraphicsVGA() call,
|
||||
* which will draw from our video buffer (adwMemory) directly; these addresses are only used for bounds
|
||||
* checking.
|
||||
*/
|
||||
if (this.nMode >= Video.MODE.VGA_320X200) {
|
||||
addrBuffer = addrScreen = 0xA0000;
|
||||
addrScreenLimit = addrScreen + 0x10000;
|
||||
}
|
||||
|
||||
/*
|
||||
* HACK: The CRTC's START_ADDR_HI and START_ADDR_LO registers are supposed to be "latched" into
|
||||
|
|
@ -5190,7 +5248,6 @@ Video.prototype.updateScreen = function(fForce)
|
|||
|
||||
/*
|
||||
* Any screen (aka "page") offset must be doubled for text modes, due to the attribute bytes.
|
||||
*
|
||||
* TODO: Come up with a more robust method of deciding when any screen offset should be doubled.
|
||||
*/
|
||||
if (this.nFont) offScreen <<= 1;
|
||||
|
|
@ -5259,13 +5316,22 @@ Video.prototype.updateScreen = function(fForce)
|
|||
}
|
||||
}
|
||||
else if (this.cbSplit) {
|
||||
/*
|
||||
* All CGA graphics modes have the goofy split-buffer layout, hence the simple test above.
|
||||
*/
|
||||
this.updateScreenGraphicsCGA(addrScreen, addrScreenLimit);
|
||||
}
|
||||
else if (!this.fColor256) {
|
||||
this.updateScreenGraphicsEGA(addrScreen, addrScreenLimit);
|
||||
/*
|
||||
* All EGA graphics modes are taken care of here, including all 16-color VGA graphics modes.
|
||||
*/
|
||||
this.updateScreenGraphicsEGA(addrBuffer, addrScreen, addrScreenLimit);
|
||||
}
|
||||
else {
|
||||
this.updateScreenGraphicsVGA(addrScreen, addrScreenLimit);
|
||||
/*
|
||||
* Finally, all 256-color VGA modes are processed here.
|
||||
*/
|
||||
this.updateScreenGraphicsVGA(addrBuffer, addrScreen, addrScreenLimit);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -5422,14 +5488,15 @@ Video.prototype.updateScreenGraphicsCGA = function(addrScreen, addrScreenLimit)
|
|||
};
|
||||
|
||||
/**
|
||||
* updateScreenGraphicsEGA(addrScreen, addrScreenLimit)
|
||||
* updateScreenGraphicsEGA(addrBuffer, addrScreen, addrScreenLimit)
|
||||
*
|
||||
* TODO: Add support for blinking graphics (ATC.MODE.BLINK_ENABLE)
|
||||
*
|
||||
* @param addrScreen
|
||||
* @param addrScreenLimit
|
||||
* @param {number} addrBuffer
|
||||
* @param {number} addrScreen
|
||||
* @param {number} addrScreenLimit
|
||||
*/
|
||||
Video.prototype.updateScreenGraphicsEGA = function(addrScreen, addrScreenLimit)
|
||||
Video.prototype.updateScreenGraphicsEGA = function(addrBuffer, addrScreen, addrScreenLimit)
|
||||
{
|
||||
var addr, data;
|
||||
|
||||
|
|
@ -5450,7 +5517,7 @@ Video.prototype.updateScreenGraphicsEGA = function(addrScreen, addrScreenLimit)
|
|||
var nRowAdjust = (this.nColsLogical > this.nCols? ((this.nColsLogical - this.nCols - iPixelFirst) >> 3) : 0);
|
||||
|
||||
while (addr < addrScreenLimit) {
|
||||
var idw = addr++ - this.addrBuffer;
|
||||
var idw = addr++ - addrBuffer;
|
||||
this.assert(idw >= 0 && idw < adwMemory.length);
|
||||
data = adwMemory[idw];
|
||||
|
||||
|
|
@ -5541,7 +5608,7 @@ Video.prototype.updateScreenGraphicsEGA = function(addrScreen, addrScreenLimit)
|
|||
};
|
||||
|
||||
/**
|
||||
* updateScreenGraphicsVGA(addrScreen, addrScreenLimit)
|
||||
* updateScreenGraphicsVGA(addrBuffer, addrScreen, addrScreenLimit)
|
||||
*
|
||||
* This function name is a slight misnomer: updateScreenGraphicsEGA() takes care of all the 4bpp video modes
|
||||
* (first introduced by the EGA and later expanded by the VGA), where each pixel's bits are spread across the 4
|
||||
|
|
@ -5551,10 +5618,11 @@ Video.prototype.updateScreenGraphicsEGA = function(addrScreen, addrScreenLimit)
|
|||
*
|
||||
* TODO: Add support for blinking graphics (ATC.MODE.BLINK_ENABLE)
|
||||
*
|
||||
* @param addrScreen
|
||||
* @param addrScreenLimit
|
||||
* @param {number} addrBuffer
|
||||
* @param {number} addrScreen
|
||||
* @param {number} addrScreenLimit
|
||||
*/
|
||||
Video.prototype.updateScreenGraphicsVGA = function(addrScreen, addrScreenLimit)
|
||||
Video.prototype.updateScreenGraphicsVGA = function(addrBuffer, addrScreen, addrScreenLimit)
|
||||
{
|
||||
var addr, data;
|
||||
|
||||
|
|
@ -5576,7 +5644,7 @@ Video.prototype.updateScreenGraphicsVGA = function(addrScreen, addrScreenLimit)
|
|||
var nRowAdjust = (this.nColsLogical > this.nCols? ((this.nColsLogical - this.nCols - iPixelFirst) >> 3) : 0);
|
||||
|
||||
while (addr < addrScreenLimit) {
|
||||
var idw = addr - this.addrBuffer;
|
||||
var idw = addr - addrBuffer;
|
||||
this.assert(idw >= 0 && idw < adwMemory.length);
|
||||
data = adwMemory[idw];
|
||||
|
||||
|
|
@ -5849,7 +5917,7 @@ Video.prototype.outATC = function(port, bOut, addrFrom)
|
|||
this.printMessageIO(port, bOut, addrFrom, "ATC.INDX");
|
||||
card.fATCData = true;
|
||||
if ((bOut & Card.ATC.INDX_PAL_ENABLE) && !fPalEnabled) {
|
||||
if (!this.buildFonts()) {
|
||||
if (!this.buildFonts(true)) {
|
||||
if (DEBUG && (!addrFrom || this.messageEnabled())) {
|
||||
this.printMessage("outATC(" + str.toHexByte(bOut) + "): no font changes required");
|
||||
}
|
||||
|
|
@ -5860,9 +5928,31 @@ Video.prototype.outATC = function(port, bOut, addrFrom)
|
|||
this.updateScreen(true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* TODO: We need a screen blanking function, suitable for any mode, when INDX_PAL_ENABLE transitions off.
|
||||
* powerDown() might like to use such a function, too. updateScreen() already disables any further screen
|
||||
* updates while INDX_PAL_ENABLE is clear (except when fForce is true), but that's all we currently do.
|
||||
*
|
||||
* if (!(bOut & Card.ATC.INDX_PAL_ENABLE) && fPalEnabled) this.blankScreen();
|
||||
*
|
||||
* However, there also needs to be a delay, because when the IBM VGA BIOS changes the mode, it updates
|
||||
* the ATC palette registers in such a way that INDX_PAL_ENABLE is constantly toggled; here's one iteration:
|
||||
*
|
||||
* C000:2B39 EC IN AL,DX
|
||||
* C000:2B3A B2C0 MOV DL,C0
|
||||
* C000:2B3C 8BC3 MOV AX,BX
|
||||
* C000:2B3E 86C4 XCHG AL,AH
|
||||
* C000:2B40 EE OUT DX,AL <-- this ATC index value does NOT contain 0x20
|
||||
* C000:2B41 86C4 XCHG AL,AH
|
||||
* C000:2B43 EE OUT DX,AL
|
||||
* C000:2B44 B020 MOV AL,20
|
||||
* C000:2B46 EE OUT DX,AL <-- this ATC index value obviously DOES contain 0x20
|
||||
*/
|
||||
}
|
||||
/*
|
||||
* HACK: offStartAddr is supposed to be "latched" ONLY at the start of every VRETRACE interval,
|
||||
* but other "triggers" are helpful; see updateScreen() for details.
|
||||
* HACK: offStartAddr is supposed to be "latched" ONLY at the start of every VRETRACE interval, but
|
||||
* other "triggers" are helpful; see updateScreen() for details.
|
||||
*/
|
||||
card.offStartAddr = ((card.regCRTData[Card.CRTC.START_ADDR_HI] << 8) + card.regCRTData[Card.CRTC.START_ADDR_LO])|0;
|
||||
card.nVertPeriodsStartAddr = 0;
|
||||
|
|
|
|||
|
|
@ -1635,7 +1635,7 @@ X86CPU.prototype.checkIntNotify = function(nInt)
|
|||
var aNotify = this.aIntNotify[nInt];
|
||||
if (aNotify !== undefined) {
|
||||
for (var i = 0; i < aNotify.length; i++) {
|
||||
if (!aNotify[i](this.regLIP)) {
|
||||
if (!aNotify[i](aNotify[i][0], this.regLIP)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -3907,6 +3907,40 @@ X86CPU.prototype.popWord = function()
|
|||
return w;
|
||||
};
|
||||
|
||||
/**
|
||||
* pushData(d, size)
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} d is the data to push at current SP; SP decreased by size
|
||||
* @param {number} size is the size of the data to push (must be either 2 or 4)
|
||||
*/
|
||||
X86CPU.prototype.pushData = function(d, size)
|
||||
{
|
||||
this.regLSP = (this.regLSP - size)|0;
|
||||
/*
|
||||
* Properly comparing regLSP to regLSPLimitLow would normally require coercing both to unsigned
|
||||
* (ie, floating-point) values. But instead, we do a subtraction, (regLSP - regLSPLimitLow), and
|
||||
* if the result is negative, we need only be concerned if the signs of both numbers are the same
|
||||
* (ie, the sign of their XOR'ed union is positive).
|
||||
*/
|
||||
if (((this.regLSP - this.regLSPLimitLow)|0) < 0 && (this.regLSPLimitLow ^ this.regLSP) >= 0) {
|
||||
/*
|
||||
* There's no such thing as an SS fault on the 8086/8088, and I'm assuming that, on newer
|
||||
* processors, when the stack segment limit is set to the maximum, it's OK for the stack to wrap.
|
||||
*/
|
||||
if (this.model <= X86.MODEL_8088 || !this.segSS.fExpDown && this.segSS.limit == this.segSS.maskAddr || this.segSS.fExpDown && !this.segSS.limit) {
|
||||
this.setSP((this.regLSP - this.segSS.base) & this.segSS.maskAddr);
|
||||
} else {
|
||||
X86.fnFault.call(this, X86.EXCEPTION.SS_FAULT, 0);
|
||||
}
|
||||
}
|
||||
if (size == 2) {
|
||||
this.setShort(this.regLSP, d);
|
||||
} else {
|
||||
this.setLong(this.regLSP, d);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* pushWord(w)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -376,6 +376,15 @@ X86.fnCALLw = function CALLw(dst, src)
|
|||
* For protected-mode, this function must attempt to load the new code segment first, because if the new segment
|
||||
* requires a change in privilege level, the return address must be pushed on the NEW stack, not the current stack.
|
||||
*
|
||||
* Also, we rely on a new function, pushData(), instead of pushWord(), to accommodate the outgoing segment size,
|
||||
* which may differ from the incoming segment. For example, when a 32-bit code segment performs a 16:32 call to a
|
||||
* 16-bit code segment, we must push 32-bit segment and offset values.
|
||||
*
|
||||
* TODO: Since setCSIP() already informs the segCS load() function when it's making a call, the load() function
|
||||
* could automatically push the old CS and IP values *before* segCS is updated (which would be a better time to do
|
||||
* this); unfortunately, load() is also used by loadIDT(), and loadIDT() has different requirements (eg, pushing
|
||||
* flags first), so it's not a trivial change.
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} off
|
||||
* @param {number} sel
|
||||
|
|
@ -384,9 +393,10 @@ X86.fnCALLF = function CALLF(off, sel)
|
|||
{
|
||||
var oldCS = this.getCS();
|
||||
var oldIP = this.getIP();
|
||||
var oldSize = this.segCS.sizeData;
|
||||
if (this.setCSIP(off, sel, true) != null) {
|
||||
this.pushWord(oldCS);
|
||||
this.pushWord(oldIP);
|
||||
this.pushData(oldCS, oldSize);
|
||||
this.pushData(oldIP, oldSize);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1241,7 +1251,6 @@ X86.fnINT = function INT(nIDT, nError, nCycles)
|
|||
this.pushWord(oldIP);
|
||||
if (nError != null) this.pushWord(nError);
|
||||
this.nFault = -1;
|
||||
|
||||
/*
|
||||
* TODO: Should this code be factored into a setLIP() function? The other primary client would be setCSIP().
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -687,12 +687,12 @@ X86Seg.prototype.loadDesc8 = function(addrDesc, sel, fProbe)
|
|||
}
|
||||
else if (type == X86.DESC.ACC.TYPE.GATE286_INT || type == X86.DESC.ACC.TYPE.GATE386_INT) {
|
||||
fGate = true;
|
||||
regPSClear = (X86.PS.NT | X86.PS.TF | X86.PS.IF);
|
||||
regPSClear = (X86.PS.VM | X86.PS.NT | X86.PS.TF | X86.PS.IF);
|
||||
cpu.assert(!(acc & 0x1f));
|
||||
}
|
||||
else if (type == X86.DESC.ACC.TYPE.GATE286_TRAP || type == X86.DESC.ACC.TYPE.GATE386_TRAP) {
|
||||
fGate = true;
|
||||
regPSClear = (X86.PS.NT | X86.PS.TF);
|
||||
regPSClear = (X86.PS.VM | X86.PS.NT | X86.PS.TF);
|
||||
cpu.assert(!(acc & 0x1f));
|
||||
}
|
||||
else if (type == X86.DESC.ACC.TYPE.GATE_TASK) {
|
||||
|
|
@ -725,22 +725,6 @@ X86Seg.prototype.loadDesc8 = function(addrDesc, sel, fProbe)
|
|||
limit = limitOrig | (ext << 16);
|
||||
}
|
||||
|
||||
/*
|
||||
* At a minimum, we need to clear X86.PS.VM now, so that the following load will initialize the
|
||||
* new code segment properly.
|
||||
*/
|
||||
var regPS = cpu.regPS;
|
||||
cpu.regPS &= ~regPSClear;
|
||||
if (cpu.regPS & X86.PS.VM) {
|
||||
/*
|
||||
* TODO: This seems a bit suspect in retrospect (ie, altering CPU flags before we know whether
|
||||
* the load() will succeed or generate a fault). Take another look.
|
||||
*/
|
||||
cpu.assert(false);
|
||||
cpu.regPS &= ~X86.PS.VM;
|
||||
cpu.setProtMode(true, false);
|
||||
}
|
||||
|
||||
var cplNew = (selCode & X86.SEL.RPL), selStack = 0, offStack = 0;
|
||||
|
||||
/*
|
||||
|
|
@ -772,6 +756,15 @@ X86Seg.prototype.loadDesc8 = function(addrDesc, sel, fProbe)
|
|||
offStack = (lenSP == 2)? cpu.getShort(addrTSS + offSP) : cpu.getLong(addrTSS + offSP);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now that we're past all the probes, it should be safe to clear all flags that need clearing.
|
||||
*/
|
||||
var regPS = cpu.regPS;
|
||||
cpu.regPS &= ~regPSClear;
|
||||
if (regPS & X86.PS.VM) {
|
||||
cpu.setProtMode(true, false);
|
||||
}
|
||||
|
||||
if (this.loadProt(selCode) === X86.ADDR_INVALID) {
|
||||
return X86.ADDR_INVALID;
|
||||
}
|
||||
|
|
|
|||
165
versions/c1pjs/1.19.3/c1p-dbg.js
Normal file
165
versions/c1pjs/1.19.3/c1p-dbg.js
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
(function(){var f;function n(a,b){var c="";void 0===b?b=8:8<b&&(b=8);if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;){var d=a&15,d=d+(0<=d&&9>=d?48:55),c=String.fromCharCode(d)+c;a>>=4}return c}function p(a){return"0x"+n(a,2)}function q(a){return"0x"+n(a,4)}function aa(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}var ba={"&":"&","<":"<",">":">",'"':""","'":"'"};
|
||||
function ca(a){return a.replace(/[&<>"']/g,function(a){return ba[a]})}var t=Date.now||function(){return+new Date};
|
||||
function u(a,b,c){var d;d=!0;var e=0,g=null,h=aa(a),k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");d&&(k.onreadystatechange=function(){4===k.readyState&&(g=k.responseText,200==k.status||!k.status&&g.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),c&&(b?c.call(b,h,g,e,void 0):c(h,g,e,void 0)))});k.open("GET",a,d);k.send();d||(g=k.responseText,200!=k.status&&(e=k.status||-1),c&&(b?c.call(b,h,g,e,void 0):c(h,g,e,void 0)))}
|
||||
function v(a){window&&window.alert(a)}function w(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function da(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||
function ea(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,g=!1;a.onmousedown=function(){g||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);g=!0}}var x={init:[],show:[],exit:[]},fa=!1,ga=!0;function ha(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function y(a){x.init.push(a)}
|
||||
function ia(a){if(ga)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){v("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks.")}}function z(a){!ga&&a?(ga=!0,fa&&ja("init")):ga=a}function ja(a){x[a]&&ia(x[a])}ha("onload",function(){fa=!0;ia(x.init)});ha("onpageshow",function(){ia(x.show)});ha(w("Opera")||w("iOS")?"onunload":"onbeforeunload",function(){ia(x.exit)});
|
||||
function A(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id;this.name=b.name;void 0===this.id&&(this.id="");b=this.id.indexOf(".");0<b?(this.sb=this.id.substr(0,b),this.rb=this.id.substr(b+1)):this.rb=this.id;this[a]=c;this.C={$a:!1,Ca:!1,kb:!1,M:!1,Da:!1};this.eb=null;this.C.Da=!1;this.H={};this.u=null;this.ma=d||0;B[B.length]=this}var ka=void 0;
|
||||
if(window){ka||(ka=window.location.search.substr(1));for(var la,ma=/\+/g,na=/([^&=]+)=?([^&]*)/g;la=na.exec(ka);)la[1].replace(ma," "),la[2].replace(ma," ")}function oa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}function C(a){var b;b||(b=A);a.prototype=oa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}var B=[];
|
||||
function pa(a,b){if(void 0!==a){var c;b&&0<(c=b.indexOf("."))&&(a=b.substr(0,c+1)+a);for(c=0;c<B.length;c++)if(B[c].id===a)return B[c]}return null}function D(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("({"+a+"})")}catch(c){v(c.message+" ("+a+")")}return b}window&&!window.document.ELEMENT_NODE&&(window.document.ELEMENT_NODE=1);
|
||||
function E(a,b){for(var c=F(b.parentNode,"c1pjs-control"),d=0;d<c.length;d++)for(var e=c[d].childNodes,g=0;g<e.length;g++){var h=e[g];if(h.nodeType===window.document.ELEMENT_NODE){var k=h.getAttribute("class");if(k)for(var l=k.split(" "),m=0;m<l.length;m++)switch(k=l[m],k){case "c1pjs-binding":(k=D(h))&&k.binding&&a.T(k.type,k.binding,h),m=l.length}}}}
|
||||
function F(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
||||
A.prototype={constructor:A,parent:null,toString:function(){return this.name?this.name:this.id||this.type},T:function(a,b,c){switch(b){case "clear":return this.H[b]||(this.H[b]=c,c.onclick=function(a){return function(){a.H.print&&(a.H.print.value="")}}(this)),!0;case "print":return this.H[b]||(this.hb=this.H[b]=c,c.value="",this.l=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||
this.ab=function(a,b,c){this.l(a,"notice",c)}),!0;default:return!1}},log:function(){},l:function(){},status:function(a){this.l(this.rb+": "+a)},ab:function(a,b){b||v(a)},X:function(a){this.C.Da||(this.C.$a=!1!==a,this.C.$a&&(a=this.eb,this.eb=null,a&&a()))}};function G(a,b){if(a.u){a===a.u?b|=0:b=b||a.ma;var c=a.u.ma&b;return!!b&&c===b||!!(c&a.u.Se)}return!1}function H(a,b){if(a.C.kb)return a.C.Ca&&(a.C.Ca=!1),a.C.kb=!1;if(a.C.Da)return a.l(a.toString()+" error"),!1;a.C.Ca=b;return a.C.Ca}
|
||||
function J(a,b){a.C.Ca&&(b?a.C.kb=!0:void 0===b&&a.l(a.toString()+" busy"));return a.C.Ca}function K(a,b){b&&(a.C.$a?b():a.eb=b);return a.C.$a}function qa(a,b){a.C.Da=!0;a.ab(b)}function ra(a){A.call(this,"C1PPanel",a);this.C.M=!1}C(ra);ra.prototype.T=function(a,b,c){return this.J&&this.J.T(a,b,c)||this.s&&this.s.T(a,b,c)||this.b&&this.b.T(a,b,c)||this.u&&this.u.T(a,b,c)?!0:A.prototype.T.call(this,a,b,c)};
|
||||
ra.prototype.ia=function(a,b){a&&!this.C.M&&(this.C.M=!0,this.J=b,this.s=L(b,"cpu"),this.b=L(b,"keyboard"),this.u=L(b,"debugger"),sa())};function sa(){for(var a=!1,b=F(window.document,"c1pjs","panel"),c=0;c<b.length;c++){var d=b[c],e=D(d),g=pa(e.id);g||(a=!0,g=new ra(e));E(g,d);a&&g.X()}}y(sa);
|
||||
function ta(a){A.call(this,"C1PCPU",a);ua(this);this.C.M=!1;this.C.na=!1;this.Ua=a.autoStart;this.Sa=0;this.Pb=1;this.fb=2;this.speed=this.Sa;this.Ka=30;this.Ja=5;this.Na=8;this.Ta=["Slow","Fast","Max"];this.jb=["(1Mhz)","(up to "+this.Na+"Mhz)","(unlimited)"];this.P=[];this.K=[];this.pa=65536;this.qa=0;this.da=65536;this.ja=0;this.Ra=32;this.cb=2;this.Ob=1;this.o=[this.zc,this.Td,this.Ke,this.m,this.m,this.Vd,this.pc,this.m,this.Yd,this.Sd,this.oc,this.m,this.m,this.Pd,this.mc,this.m,this.yc,this.Ud,
|
||||
this.m,this.m,this.m,this.Wd,this.qc,this.m,this.Cc,this.Rd,this.m,this.m,this.m,this.Qd,this.nc,this.m,this.qd,this.ic,this.m,this.m,this.vc,this.kc,this.de,this.m,this.$d,this.hc,this.ce,this.m,this.uc,this.ec,this.ae,this.m,this.wc,this.jc,this.m,this.m,this.m,this.lc,this.ee,this.m,this.ue,this.gc,this.m,this.m,this.m,this.fc,this.be,this.m,this.ke,this.dd,this.m,this.m,this.m,this.fd,this.Md,this.m,this.Xd,this.cd,this.Ld,this.m,this.pd,this.$c,this.Jd,this.m,this.Ac,this.ed,this.m,this.m,this.m,
|
||||
this.gd,this.Nd,this.m,this.Ec,this.bd,this.m,this.m,this.m,this.ad,this.Kd,this.m,this.le,this.zb,this.m,this.m,this.m,this.Bb,this.ie,this.m,this.Zd,this.yb,this.he,this.m,this.od,this.vb,this.fe,this.m,this.Bc,this.Ab,this.m,this.m,this.m,this.Cb,this.je,this.m,this.we,this.xb,this.m,this.m,this.m,this.wb,this.ge,this.m,this.m,this.Ae,this.m,this.m,this.Ie,this.Ce,this.Fe,this.m,this.Zc,this.m,this.Oe,this.m,this.He,this.xe,this.Ee,this.m,this.rc,this.Be,this.m,this.m,this.Je,this.De,this.Ge,this.m,
|
||||
this.Qe,this.ze,this.Pe,this.m,this.m,this.ye,this.m,this.m,this.Gd,this.vd,this.Bd,this.m,this.Hd,this.xd,this.Cd,this.m,this.Me,this.ud,this.Le,this.m,this.Ed,this.rd,this.zd,this.m,this.sc,this.wd,this.m,this.m,this.Id,this.yd,this.Dd,this.m,this.Fc,this.td,this.Ne,this.m,this.Fd,this.sd,this.Ad,this.m,this.Sc,this.Kc,this.m,this.m,this.Tc,this.Mc,this.Wc,this.m,this.nd,this.Jc,this.Yc,this.m,this.Rc,this.Gc,this.Uc,this.m,this.xc,this.Lc,this.m,this.m,this.m,this.Nc,this.Xc,this.m,this.Dc,this.Ic,
|
||||
this.m,this.m,this.m,this.Hc,this.Vc,this.m,this.Pc,this.Hb,this.m,this.m,this.Qc,this.Jb,this.kd,this.m,this.md,this.Gb,this.Od,this.m,this.Oc,this.Db,this.hd,this.m,this.tc,this.Ib,this.m,this.m,this.m,this.Kb,this.ld,this.m,this.ve,this.Fb,this.m,this.m,this.m,this.Eb,this.jd,this.m];this.gb=[7,6,0,0,0,3,5,0,3,2,2,0,0,4,6,0,2,5,0,0,0,4,6,0,2,4,0,0,0,4,7,0,3,6,0,0,3,3,5,0,4,2,2,0,4,4,6,0,2,5,0,0,0,4,6,0,2,4,0,0,0,4,7,0,6,6,0,0,0,3,5,0,3,2,2,0,3,4,6,0,2,5,0,0,0,4,6,0,2,4,0,0,0,4,7,0,6,6,0,0,0,3,
|
||||
5,0,4,2,2,0,5,4,6,0,2,5,0,0,0,4,6,0,2,4,0,0,0,4,7,0,0,6,0,0,3,3,3,0,2,0,2,0,4,4,4,0,2,5,0,0,4,4,4,0,2,4,2,0,0,4,0,0,2,6,2,0,3,3,3,0,2,2,2,0,4,4,4,0,2,5,0,0,4,4,4,0,2,4,2,0,4,4,4,0,2,6,0,0,3,3,5,0,2,2,2,0,4,4,6,0,2,5,0,0,0,4,6,0,2,4,0,0,0,4,7,0,2,6,0,0,3,3,5,0,2,2,2,0,4,4,6,0,2,5,0,0,0,4,6,0,2,4,0,0,0,4,7,0]}C(ta);f=ta.prototype;
|
||||
f.reset=function(a){this.C.na&&this.aa();ua(this);this.f=this.a[65532]|this.a[65533]<<8;this.C.Da=!1;this.u?this.u.reset():a&&(!0===this.Ua||null===this.Ua&&!this.u&&void 0===this.H.run)&&this.wa()};
|
||||
f.T=function(a,b,c){a=!1;switch(b){case "run":this.H[b]=c;c.onclick=function(a){return function(){a.C.na?a.aa():a.wa()}}(this);a=!0;break;case "A":case "X":case "Y":case "S":case "PC":case "C":case "Z":case "I":case "D":case "B":case "V":case "N":case "speed":this.H[b]=c;a=!0;break;case "setSpeed":this.H[b]=c,c.onclick=function(a){return function(){M(a,2<=a.speed?a.Sa:a.speed+1,!0)}}(this),a=!0}return a};
|
||||
f.ba=function(a,b,c){this.a=a;this.O=b;this.ra=c-b+1;this.Ha=this.O+this.ra;this.O?v("unsupported CPU address buffer offset ("+this.O+")"):this.X()};f.ia=function(a,b){if(a&&!this.C.M){this.J=b;(this.u=L(b,"debugger"))&&this.u.Ub();var c=L(b,"video");c&&(this.ib=function(a){return function(){va(a)}}(c),this.ca=function(a){return function(){a.ca()}}(c));this.C.M=!0;this.reset(!0);this.update()}};function wa(a,b,c,d,e){0>xa(a.P,b,c,d,e)&&(a.pa>b&&(a.pa=b),a.qa<c&&(a.qa=c),a.P.push([b,c,d,e]))}
|
||||
function ya(a,b,c){for(var d=0;d<a.P.length;d++)b>=a.P[d][0]&&b<=a.P[d][1]&&a.P[d][3].call(a.P[d][2],b,c)}function N(a,b,c,d,e){0>xa(a.K,b,c,d,e)&&(a.da>b&&(a.da=b),a.ja<c&&(a.ja=c),a.K.push([b,c,d,e]))}function za(a,b,c){for(var d=0;d<a.K.length;d++)b>=a.K[d][0]&&b<=a.K[d][1]&&a.K[d][3].call(a.K[d][2],b,c)}function xa(a,b,c,d,e){for(var g=0;g<a.length;g++)if(a[g][0]==b&&a[g][1]==c&&a[g][2]==d&&a[g][3]==e)return g;return-1}
|
||||
function M(a,b,c){void 0!==b&&(a.speed=b,a.H.setSpeed&&(a.H.setSpeed.innerHTML=a.Ta[2<=b?0:b+1]),a.l("running at "+a.Ta[b].toLowerCase()+" speed "+a.jb[b]),c&&a.ca());a.U=0;a.Pa=t();Aa(a)}f.ib=function(){};f.ca=function(){};function O(a,b,c,d){void 0!==a.H[b]&&(void 0===d&&(d=1),c="0000"+c.toString(16),a.H[b].innerHTML=c.slice(c.length-d).toUpperCase())}
|
||||
function Ba(a){O(a,"A",a.h,2);O(a,"X",a.w,2);O(a,"Y",a.F,2);var b=Ca(a);O(a,"C",b&1?1:0);O(a,"Z",b&2?1:0);O(a,"I",b&4?1:0);O(a,"D",b&8?1:0);O(a,"B",b&16?1:0);O(a,"V",b&64?1:0);O(a,"N",b&128?1:0);O(a,"S",a.G,4);O(a,"PC",a.f,4);a.H.speed&&a.ua&&(a.H.speed.innerHTML=a.ua.toFixed(1)+"Mhz")}
|
||||
function Aa(a,b){var c=30;c<a.Ka&&(c=a.Ka);c<a.Ja&&(c=a.Ja);var d=1;b&&a.speed>a.Sa&&a.ua&&(d=a.ua);d>a.Na&&2>a.speed&&(d=a.Na);a.lb=Math.round(1E3/30);a.ka=Math.floor(1E6/c*d);a.sa=Math.floor(1E6/30*d);a.Ya=Math.floor(1E6/a.Ka*d);a.Xa=Math.floor(1E6/a.Ja*d);b||(a.R=a.sa,a.Z=a.Ya,a.V=a.Xa);a.Ba=0}
|
||||
function Da(a){var b=t(),c=a.lb;a.$&&(c=Math.round(c*a.$/a.sa));c=c-(b-a.mb);if(b=b-a.Pa)a.ua=Math.round(a.U/(100*b))/10,864E5<=b&&M(a);0>c?c=0:1==a.speed?a.ua<=a.Na&&(c=0):2==a.speed&&(c=0);a.Ba+=a.$;return c}
|
||||
f.wa=function(){if(H(this,!0)){this.C.na||(M(this),this.J&&this.J.start(),this.C.na=!0,this.H.run&&(this.H.run.innerHTML="Halt"),this.ca());1E6<=this.Ba&&Aa(this,!0);this.$=0;this.mb=t();try{do{this.step(this.ka);var a=this.L-this.D;this.U+=a;this.$+=a;this.L=this.D=0;this.Z-=this.ka;0>=this.Z&&(this.Z+=this.Ya,this.ib());this.V-=this.ka;0>=this.V&&(this.V+=this.Xa,Ba(this));this.R-=this.ka;if(0>=this.R){this.R+=this.sa;break}}while(this.C.na)}catch(b){this.aa();this.update();H(this,!1);qa(this,b.stack||
|
||||
b.message);return}setTimeout(function(a){return function(){a.wa()}}(this),Da(this))}else this.update(),this.J&&this.J.stop(this.Pa,this.U)};
|
||||
f.step=function(a){var b=!0;this.b=this.g=-1;var c;if(c=a&&this.u)c=this.u,c=0<c.ta.length||0<c.xa.length||0<c.za.length;this.L=this.D=a;do{a=this.a[this.f];var d;if(d=c){d=this.u;var e=a,g=!1;Ea(d,this.f,d.ta,"exec")?g=!0:(d.L++,d.B[e][1]++,d.ya[d.Ma++]=d.s.f,d.Ma>=d.ya.length&&(d.Ma=0));d=!!g}if(d){b=void 0;this.aa();break}this.f++;this.o[a].call(this);if(0<=this.b){this.b>=this.pa&&this.b<=this.qa&&ya(this,this.b,this.f);if(d=c)d=this.u,e=!1,Ea(d,this.b,d.xa,"read")&&(e=!0),d=!!e;if(d){b=!1;this.aa();
|
||||
break}this.b=-1}else if(0<=this.g){this.g>=this.da&&this.g<=this.ja&&za(this,this.g,this.f);if(d=c){d=this.u;var e=this.g,g=this.a[this.g],h=!1;(g&255)!=g&&(d.l("invalid value at "+q(e)+": "+g),h=!0);Ea(d,e,d.za,"write")&&(h=!0);d=!!h}if(d){b=!1;this.aa();break}this.g=-1}this.D-=this.gb[a]}while(0<this.D);return b};function Fa(a){a.R=0;a.L-=a.D;a.D=0}f.aa=function(){J(this,!0);this.L-=this.D;this.D=0;this.C.na&&(this.C.na=!1,this.H.run&&(this.H.run.innerHTML="Run"))};
|
||||
f.update=function(){this.ib();Ba(this)};function Ga(a){return a.C.na?a.U+a.L-a.D:0}f.S=function(a){return this.a[a]};f.W=function(a,b){this.a[a]=b};function Ca(a){var b=a.c&256?1:0,b=b|(a.j&255?0:2),b=b|((a.v&255^a.A^a.v>>1)&128?64:0),b=b|(a.i&128?128:0);return a.B&60|b}
|
||||
function Ha(a){a.B|=8;a.o[97]=a.ac;a.o[101]=a.cc;a.o[105]=a.$b;a.o[109]=a.Xb;a.o[113]=a.bc;a.o[117]=a.dc;a.o[121]=a.Zb;a.o[125]=a.Yb;a.o[225]=a.qe;a.o[229]=a.se;a.o[233]=a.pe;a.o[237]=a.me;a.o[241]=a.re;a.o[245]=a.te;a.o[249]=a.oe;a.o[253]=a.ne}function Ia(a){a.B&=-9;a.o[97]=a.zb;a.o[101]=a.Bb;a.o[105]=a.yb;a.o[109]=a.vb;a.o[113]=a.Ab;a.o[117]=a.Cb;a.o[121]=a.xb;a.o[125]=a.wb;a.o[225]=a.Hb;a.o[229]=a.Jb;a.o[233]=a.Gb;a.o[237]=a.Db;a.o[241]=a.Ib;a.o[245]=a.Kb;a.o[249]=a.Fb;a.o[253]=a.Eb}
|
||||
function P(a,b,c){var d=a.c&256?1:0,e=(b&15)+(c&15)+d;10<=e&&(e=e+6&15|16);e+=(b&240)+(c&240);a.A=b^c;a.v=e;a.i=e&255;160<=e&&(e+=96);512<=e&&(e-=256);a.c=e;a.j=b+c+d&255;a.D--;return e&255}function Q(a,b,c){var d=a.c&256?0:1,e=(b&15)-(c&15)-d;0>e&&(e=(e-6&15)-16);e+=(b&240)-(c&240);0>e&&(e-=96);a.i=a.j=(a.c=b-c-d)&255;a.A=b^c;a.v=a.c;a.c^=256;a.D--;return e&255}function ua(a){a.h=0;a.w=0;a.F=0;a.G=256;a.B=0;a.i=0;a.j=0;a.A=0;a.v=0;a.c=0;a.f=0;a.b=-1;a.g=-1;a.ua=0;a.U=a.L=a.D=0}
|
||||
f.zc=function(){this.f++;this.a[this.G--]=this.f>>8;this.G|=256;this.a[this.G--]=this.f&255;this.G|=256;this.B|=16;this.B=Ca(this);this.a[this.G--]=this.B;this.G|=256;this.B&=239;this.b=65534;this.f=this.a[this.b]|this.a[this.b+1]<<8};f.Td=function(){this.b=this.a[this.f++]+this.w&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.i=this.j=this.h|=this.a[this.b]};f.Vd=function(){this.b=this.a[this.f++];this.i=this.j=this.h|=this.a[this.b]};
|
||||
f.pc=function(){this.g=this.a[this.f++];this.c=this.a[this.g]<<1;this.i=this.j=this.a[this.g]=this.c&255};f.Yd=function(){this.B=Ca(this);this.a[this.G--]=this.B;this.G|=256};f.Sd=function(){this.b=this.f++;this.i=this.j=this.h|=this.a[this.b]};f.oc=function(){this.c=this.h<<1;this.i=this.j=this.h=this.c&255};f.Pd=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.i=this.j=this.h|=this.a[this.b]};
|
||||
f.mc=function(){this.g=this.a[this.f++]|this.a[this.f++]<<8;this.c=this.a[this.g]<<1;this.i=this.j=this.a[this.g]=this.c&255};f.yc=function(){this.f+=(this.i&128?0:(this.D--,this.a[this.f]<<24>>24))+1};f.Ud=function(){this.b=this.a[this.f++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.F;this.i=this.j=this.h|=this.a[this.b]};f.Wd=function(){this.b=this.a[this.f++]+this.w&255;this.i=this.j=this.h|=this.a[this.b]};
|
||||
f.qc=function(){this.g=this.a[this.f++]+this.w&255;this.c=this.a[this.g]<<1;this.i=this.j=this.a[this.g]=this.c&255};f.Cc=function(){this.c=0};f.Rd=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.F;this.i=this.j=this.h|=this.a[this.b]};f.Qd=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.i=this.j=this.h|=this.a[this.b]};f.nc=function(){this.g=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.c=this.a[this.g]<<1;this.i=this.j=this.a[this.g]=this.c&255};
|
||||
f.qd=function(){this.b=this.f++;this.a[this.G--]=this.f>>8;this.G|=256;this.a[this.G--]=this.f&255;this.G|=256;this.f=this.a[this.b]|this.a[this.b+1]<<8};f.ic=function(){this.b=this.a[this.f++]+this.w&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.i=this.j=this.h&=this.a[this.b]};f.vc=function(){this.b=this.a[this.f++];this.j=this.h&this.a[this.b];this.i=this.i&127|this.a[this.b]&128;this.v=0;this.A=this.a[this.b]&64?128:0};f.kc=function(){this.b=this.a[this.f++];this.i=this.j=this.h&=this.a[this.b]};
|
||||
f.de=function(){this.g=this.a[this.f++];this.c=this.c&65280|this.a[this.g];this.c<<=1;this.c=this.c&65534|(this.c&512?1:0);this.i=this.j=this.a[this.g]=this.c&255};f.$d=function(){this.G=this.G+1&255|256;this.B=this.a[this.G];this.c=this.B&1?256:0;this.j=this.B&2?0:1;this.i=this.B&128;this.v=0;this.A=this.B&64?128:0};f.hc=function(){this.b=this.f++;this.i=this.j=this.h&=this.a[this.b]};
|
||||
f.ce=function(){this.c=this.c&65280|this.h;this.c<<=1;this.c=this.c&65534|(this.c&512?1:0);this.i=this.j=this.h=this.c&255};f.uc=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.j=this.h&this.a[this.b];this.i=this.i&127|this.a[this.b]&128;this.v=0;this.A=this.a[this.b]&64?128:0};f.ec=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.i=this.j=this.h&=this.a[this.b]};
|
||||
f.ae=function(){this.g=this.a[this.f++]|this.a[this.f++]<<8;this.c=this.c&65280|this.a[this.g];this.c<<=1;this.c=this.c&65534|(this.c&512?1:0);this.i=this.j=this.a[this.g]=this.c&255};f.wc=function(){this.f+=(this.i&128?(this.D--,this.a[this.f]<<24>>24):0)+1};f.jc=function(){this.b=this.a[this.f++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.F;this.i=this.j=this.h&=this.a[this.b]};f.lc=function(){this.b=this.a[this.f++]+this.w&255;this.i=this.j=this.h&=this.a[this.b]};
|
||||
f.ee=function(){this.g=this.a[this.f++]+this.w&255;this.c=this.c&65280|this.a[this.g];this.c<<=1;this.c=this.c&65534|(this.c&512?1:0);this.i=this.j=this.a[this.g]=this.c&255};f.ue=function(){this.c=256};f.gc=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.F;this.i=this.j=this.h&=this.a[this.b]};f.fc=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.i=this.j=this.h&=this.a[this.b]};
|
||||
f.be=function(){this.g=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.c=this.c&65280|this.a[this.g];this.c<<=1;this.c=this.c&65534|(this.c&512?1:0);this.i=this.j=this.a[this.g]=this.c&255};f.ke=function(){this.G=this.G+1&255|256;this.B=this.a[this.G];this.c=this.B&1?256:0;this.j=this.B&2?0:1;this.i=this.B&128;this.v=0;this.A=this.B&64?128:0;this.G=this.G+2&255|256;this.f=this.a[this.G-1|256]|this.a[this.G]<<8};
|
||||
f.dd=function(){this.b=this.a[this.f++]+this.w&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.i=this.j=this.h^=this.a[this.b]};f.fd=function(){this.b=this.a[this.f++];this.i=this.j=this.h^=this.a[this.b]};f.Md=function(){this.g=this.a[this.f++];this.c=this.c&65279|(this.a[this.g]&1?256:0);this.a[this.g]=(this.c=this.c&65280|this.a[this.g]>>1)&255;this.i=this.j=this.c&255};f.Xd=function(){this.a[this.G--]=this.h;this.G|=256};f.cd=function(){this.b=this.f++;this.i=this.j=this.h^=this.a[this.b]};
|
||||
f.Ld=function(){this.c=this.c&65279|(this.h&1?256:0);this.h=(this.c=this.c&65280|this.h>>1)&255;this.i=this.j=this.c&255};f.pd=function(){this.b=this.f;this.f=this.a[this.b]|this.a[this.b+1]<<8};f.$c=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.i=this.j=this.h^=this.a[this.b]};f.Jd=function(){this.g=this.a[this.f++]|this.a[this.f++]<<8;this.c=this.c&65279|(this.a[this.g]&1?256:0);this.a[this.g]=(this.c=this.c&65280|this.a[this.g]>>1)&255;this.i=this.j=this.c&255};
|
||||
f.Ac=function(){this.f+=((this.v&255^this.A^this.v>>1)&128?0:(this.D--,this.a[this.f]<<24>>24))+1};f.ed=function(){this.b=this.a[this.f++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.F;this.i=this.j=this.h^=this.a[this.b]};f.gd=function(){this.b=this.a[this.f++]+this.w&255;this.i=this.j=this.h^=this.a[this.b]};f.Nd=function(){this.g=this.a[this.f++]+this.w&255;this.c=this.c&65279|(this.a[this.g]&1?256:0);this.a[this.g]=(this.c=this.c&65280|this.a[this.g]>>1)&255;this.i=this.j=this.c&255};
|
||||
f.Ec=function(){this.B&=251};f.bd=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.F;this.i=this.j=this.h^=this.a[this.b]};f.ad=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.i=this.j=this.h^=this.a[this.b]};f.Kd=function(){this.g=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.c=this.c&65279|(this.a[this.g]&1?256:0);this.a[this.g]=(this.c=this.c&65280|this.a[this.g]>>1)&255;this.i=this.j=this.c&255};
|
||||
f.le=function(){this.G=this.G+2&255|256;this.f=(this.a[this.G-1|256]|this.a[this.G]<<8)+1};f.zb=function(){this.b=this.a[this.f++]+this.w&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.c=this.h+this.a[this.b]+(this.c&256?1:0);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255};f.ac=function(){this.b=this.a[this.f++]+this.w&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.h=P(this,this.h,this.a[this.b])};
|
||||
f.Bb=function(){this.b=this.a[this.f++];this.c=this.h+this.a[this.b]+(this.c&256?1:0);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255};f.cc=function(){this.b=this.a[this.f++];this.h=P(this,this.h,this.a[this.b])};f.ie=function(){this.g=this.a[this.f++];this.c=this.c&65280|this.a[this.g];this.c=this.c&65023|(this.c&1?512:0);this.c>>=1;this.i=this.j=this.a[this.g]=this.c&255};f.Zd=function(){this.G=this.G+1&255|256;this.i=this.j=this.h=this.a[this.G]};
|
||||
f.yb=function(){this.b=this.f++;this.c=this.h+this.a[this.b]+(this.c&256?1:0);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255};f.$b=function(){this.b=this.f++;this.h=P(this,this.h,this.a[this.b])};f.he=function(){this.c=this.c&65280|this.h;this.c=this.c&65023|(this.c&1?512:0);this.c>>=1;this.i=this.j=this.h=this.c&255};f.od=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.f=this.a[this.b]|this.a[this.b+1]<<8};
|
||||
f.vb=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.c=this.h+this.a[this.b]+(this.c&256?1:0);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255};f.Xb=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.h=P(this,this.h,this.a[this.b])};f.fe=function(){this.g=this.a[this.f++]|this.a[this.f++]<<8;this.c=this.c&65280|this.a[this.g];this.c=this.c&65023|(this.c&1?512:0);this.c>>=1;this.i=this.j=this.a[this.g]=this.c&255};
|
||||
f.Bc=function(){this.f+=((this.v&255^this.A^this.v>>1)&128?(this.D--,this.a[this.f]<<24>>24):0)+1};f.Ab=function(){this.b=this.a[this.f++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.F;this.c=this.h+this.a[this.b]+(this.c&256?1:0);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255};f.bc=function(){this.b=this.a[this.f++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.F;this.h=P(this,this.h,this.a[this.b])};
|
||||
f.Cb=function(){this.b=this.a[this.f++]+this.w&255;this.c=this.h+this.a[this.b]+(this.c&256?1:0);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255};f.dc=function(){this.b=this.a[this.f++]+this.w&255;this.h=P(this,this.h,this.a[this.b])};f.je=function(){this.g=this.a[this.f++]+this.w&255;this.c=this.c&65280|this.a[this.g];this.c=this.c&65023|(this.c&1?512:0);this.c>>=1;this.i=this.j=this.a[this.g]=this.c&255};f.we=function(){this.B|=4};
|
||||
f.xb=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.F;this.c=this.h+this.a[this.b]+(this.c&256?1:0);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255};f.Zb=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.F;this.h=P(this,this.h,this.a[this.b])};f.wb=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.c=this.h+this.a[this.b]+(this.c&256?1:0);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255};
|
||||
f.Yb=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.h=P(this,this.h,this.a[this.b])};f.ge=function(){this.g=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.c=this.c&65280|this.a[this.g];this.c=this.c&65023|(this.c&1?512:0);this.c>>=1;this.i=this.j=this.a[this.g]=this.c&255};f.Ae=function(){this.g=this.a[this.f++]+this.w&255;this.g=this.a[this.g]|this.a[this.g+1]<<8;this.a[this.g]=this.h};f.Ie=function(){this.g=this.a[this.f++];this.a[this.g]=this.F};
|
||||
f.Ce=function(){this.g=this.a[this.f++];this.a[this.g]=this.h};f.Fe=function(){this.g=this.a[this.f++];this.a[this.g]=this.w};f.Zc=function(){this.i=this.j=this.F=this.F-1&255};f.Oe=function(){this.i=this.j=this.h=this.w};f.He=function(){this.g=this.a[this.f++]|this.a[this.f++]<<8;this.a[this.g]=this.F};f.xe=function(){this.g=this.a[this.f++]|this.a[this.f++]<<8;this.a[this.g]=this.h};f.Ee=function(){this.g=this.a[this.f++]|this.a[this.f++]<<8;this.a[this.g]=this.w};
|
||||
f.rc=function(){this.f+=(this.c&256?0:(this.D--,this.a[this.f]<<24>>24))+1};f.Be=function(){this.g=this.a[this.f++];this.g=(this.a[this.g]|this.a[this.g+1]<<8)+this.F;this.a[this.g]=this.h};f.Je=function(){this.g=this.a[this.f++]+this.w&255;this.a[this.g]=this.F};f.De=function(){this.g=this.a[this.f++]+this.w&255;this.a[this.g]=this.h};f.Ge=function(){this.g=this.a[this.f++]+this.F&255;this.a[this.g]=this.w};f.Qe=function(){this.i=this.j=this.h=this.F};
|
||||
f.ze=function(){this.g=(this.a[this.f++]|this.a[this.f++]<<8)+this.F;this.a[this.g]=this.h};f.Pe=function(){this.G=this.w|256};f.ye=function(){this.g=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.a[this.g]=this.h};f.Gd=function(){this.b=this.f++;this.i=this.j=this.F=this.a[this.b]};f.vd=function(){this.b=this.a[this.f++]+this.w&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.i=this.j=this.h=this.a[this.b]};f.Bd=function(){this.b=this.f++;this.i=this.j=this.w=this.a[this.b]};
|
||||
f.Hd=function(){this.b=this.a[this.f++];this.i=this.j=this.F=this.a[this.b]};f.xd=function(){this.b=this.a[this.f++];this.i=this.j=this.h=this.a[this.b]};f.Cd=function(){this.b=this.a[this.f++];this.i=this.j=this.w=this.a[this.b]};f.Me=function(){this.i=this.j=this.F=this.h};f.ud=function(){this.b=this.f++;this.i=this.j=this.h=this.a[this.b]};f.Le=function(){this.i=this.j=this.w=this.h};f.Ed=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.i=this.j=this.F=this.a[this.b]};
|
||||
f.rd=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.i=this.j=this.h=this.a[this.b]};f.zd=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.i=this.j=this.w=this.a[this.b]};f.sc=function(){this.f+=(this.c&256?(this.D--,this.a[this.f]<<24>>24):0)+1};f.wd=function(){this.b=this.a[this.f++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.F;this.i=this.j=this.h=this.a[this.b]};f.Id=function(){this.b=this.a[this.f++]+this.w&255;this.i=this.j=this.F=this.a[this.b]};
|
||||
f.yd=function(){this.b=this.a[this.f++]+this.w&255;this.i=this.j=this.h=this.a[this.b]};f.Dd=function(){this.b=this.a[this.f++]+this.F&255;this.i=this.j=this.w=this.a[this.b]};f.Fc=function(){this.A=this.v=0};f.td=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.F;this.i=this.j=this.h=this.a[this.b]};f.Ne=function(){this.i=this.j=this.w=this.G&255};f.Fd=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.i=this.j=this.F=this.a[this.b]};
|
||||
f.sd=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.i=this.j=this.h=this.a[this.b]};f.Ad=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.F;this.i=this.j=this.w=this.a[this.b]};f.Sc=function(){this.b=this.f++;this.i=this.j=this.c=this.F-this.a[this.b];this.c^=256};f.Kc=function(){this.b=this.a[this.f++]+this.w&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.i=this.j=this.c=this.h-this.a[this.b];this.c^=256};
|
||||
f.Tc=function(){this.b=this.a[this.f++];this.i=this.j=this.c=this.F-this.a[this.b];this.c^=256};f.Mc=function(){this.b=this.a[this.f++];this.i=this.j=this.c=this.h-this.a[this.b];this.c^=256};f.Wc=function(){this.g=this.a[this.f++];this.i=this.j=this.a[this.g]=this.a[this.g]-1&255};f.nd=function(){this.i=this.j=this.F=this.F+1&255};f.Jc=function(){this.b=this.f++;this.i=this.j=this.c=this.h-this.a[this.b];this.c^=256};f.Yc=function(){this.i=this.j=this.w=this.w-1&255};
|
||||
f.Rc=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.i=this.j=this.c=this.F-this.a[this.b];this.c^=256};f.Gc=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.i=this.j=this.c=this.h-this.a[this.b];this.c^=256};f.Uc=function(){this.g=this.a[this.f++]|this.a[this.f++]<<8;this.i=this.j=this.a[this.g]=this.a[this.g]-1&255};f.xc=function(){this.f+=(this.j&255?(this.D--,this.a[this.f]<<24>>24):0)+1};
|
||||
f.Lc=function(){this.b=this.a[this.f++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.F;this.i=this.j=this.c=this.h-this.a[this.b];this.c^=256};f.Nc=function(){this.b=this.a[this.f++]+this.w&255;this.i=this.j=this.c=this.h-this.a[this.b];this.c^=256};f.Xc=function(){this.g=this.a[this.f++]+this.w&255;this.i=this.j=this.a[this.g]=this.a[this.g]-1&255};f.Dc=function(){Ia(this)};
|
||||
f.Ic=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.F;this.i=this.j=this.c=this.h-this.a[this.b];this.c^=256};f.Hc=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.i=this.j=this.c=this.h-this.a[this.b];this.c^=256};f.Vc=function(){this.g=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.i=this.j=this.a[this.g]=this.a[this.g]-1&255};f.Pc=function(){this.b=this.f++;this.i=this.j=this.c=this.w-this.a[this.b];this.c^=256};
|
||||
f.Hb=function(){this.b=this.a[this.f++]+this.w&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.c=this.h-this.a[this.b]-(this.c&256?0:1);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255;this.c^=256};f.qe=function(){this.b=this.a[this.f++]+this.w&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.h=Q(this,this.h,this.a[this.b])};f.Qc=function(){this.b=this.a[this.f++];this.i=this.j=this.c=this.w-this.a[this.b];this.c^=256};
|
||||
f.Jb=function(){this.b=this.a[this.f++];this.c=this.h-this.a[this.b]-(this.c&256?0:1);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255;this.c^=256};f.se=function(){this.b=this.a[this.f++];this.h=Q(this,this.h,this.a[this.b])};f.kd=function(){this.g=this.a[this.f++];this.i=this.j=this.a[this.g]=this.a[this.g]+1&255};f.md=function(){this.i=this.j=this.w=this.w+1&255};
|
||||
f.Gb=function(){this.b=this.f++;this.c=this.h-this.a[this.b]-(this.c&256?0:1);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255;this.c^=256};f.pe=function(){this.b=this.f++;this.h=Q(this,this.h,this.a[this.b])};f.Od=function(){};f.Oc=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.i=this.j=this.c=this.w-this.a[this.b];this.c^=256};
|
||||
f.Db=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.c=this.h-this.a[this.b]-(this.c&256?0:1);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255;this.c^=256};f.me=function(){this.b=this.a[this.f++]|this.a[this.f++]<<8;this.h=Q(this,this.h,this.a[this.b])};f.hd=function(){this.g=this.a[this.f++]|this.a[this.f++]<<8;this.i=this.j=this.a[this.g]=this.a[this.g]+1&255};f.tc=function(){this.f+=(this.j&255?0:(this.D--,this.a[this.f]<<24>>24))+1};
|
||||
f.Ib=function(){this.b=this.a[this.f++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.F;this.c=this.h-this.a[this.b]-(this.c&256?0:1);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255;this.c^=256};f.re=function(){this.b=this.a[this.f++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.F;this.h=Q(this,this.h,this.a[this.b])};
|
||||
f.Kb=function(){this.b=this.a[this.f++]+this.w&255;this.c=this.h-this.a[this.b]-(this.c&256?0:1);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255;this.c^=256};f.te=function(){this.b=this.a[this.f++]+this.w&255;this.h=Q(this,this.h,this.a[this.b])};f.ld=function(){this.g=this.a[this.f++]+this.w&255;this.i=this.j=this.a[this.g]=this.a[this.g]+1&255};f.ve=function(){Ha(this)};
|
||||
f.Fb=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.F;this.c=this.h-this.a[this.b]-(this.c&256?0:1);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255;this.c^=256};f.oe=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.F;this.h=Q(this,this.h,this.a[this.b])};
|
||||
f.Eb=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.c=this.h-this.a[this.b]-(this.c&256?0:1);this.A=this.h^this.a[this.b];this.v=this.c;this.i=this.j=this.h=this.c&255;this.c^=256};f.ne=function(){this.b=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.h=Q(this,this.h,this.a[this.b])};f.jd=function(){this.g=(this.a[this.f++]|this.a[this.f++]<<8)+this.w;this.i=this.j=this.a[this.g]=this.a[this.g]+1&255};
|
||||
f.Ke=function(){var a;a=this.a[this.f++];switch(a){case 0:this.l("HALT");this.aa();break;case 1:a=this.f;for(var b="";a<this.a.length;){var c=this.a[a++];if(!c)break;b+=String.fromCharCode(c)}this.f=a;b=b.replace(/%A/g,n(this.h,2)).replace(/%X/g,n(this.w,2)).replace(/%Y/g,n(this.F,2));this.l(b);Fa(this);break;default:this.f-=2,this.l("undefined opSim: "+p(a)+" at "+q(this.f)),this.aa()}};f.m=function(){var a=this.a[--this.f];this.l("undefined opcode: "+p(a)+" at "+q(this.f));this.aa()};
|
||||
y(function(){for(var a=F(window.document,"c1pjs","cpu"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new ta(d);E(d,c)}});function R(a){A.call(this,"C1PROM",a);this.b=this.a=null;this.g=a.size;if(this.o=a.image){a=this.o;var b;b=this.o;var c="",d=b.lastIndexOf(".");0<=d&&(c=b.substr(d+1).toLowerCase());b=c;"json"!=b&&"hex"!=b&&(a="http://"+(window?window.location.host:"www.pcjs.org")+"/api/v1/dump?file="+this.o+"&format=bytes");u(a,this,this.A)}}C(R);
|
||||
R.prototype.ba=function(a,b,c,d){this.a=a;this.v=b;a=c-b+1;this.g||(this.g=a);a!=this.g?qa(this,"computer-specified ROM size ("+q(a)+") does not match component-specified size ("+q(this.g)+")"):(d&&(this.s=d,N(d,b,c,this,this.W)),Ja(this))};R.prototype.ia=function(a,b){a&&!this.C.M&&(this.C.M=!0,this.u=L(b,"debugger"))};R.prototype.W=function(a,b){if(void 0!==b){this.u&&S(this.u,this,a,b,this.u.qb,!0);var c=a-this.v;this.a[this.v+c]=this.b?this.b[c]:0}};
|
||||
R.prototype.A=function(a,b,c){if(c)this.l('Error loading ROM "'+a+'" ('+c+")");else{if("["==b.charAt(0)||"{"==b.charAt(0))try{var d=eval("("+b+")"),e=d.bytes;e?this.b=e:this.b=d}catch(g){this.l('Error processing ROM "'+a+'": '+g.message);return}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),this.b=Array(a.length),b=0;b<a.length;b++)this.b[b]=parseInt(a[b],16);Ja(this)}};
|
||||
function Ja(a){if(!K(a))if(!a.o)a.X();else if(a.b&&a.a){var b=a.b.length;if(b!=a.g)qa(a,"ROM image size ("+q(b)+") does not match component-specified size ("+q(a.g)+")");else{for(var c=0;c<b;c++)a.a[a.v+c]=a.b[c];a.X()}}}y(function(){for(var a=F(window.document,"c1pjs","rom"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new R(d);E(d,c)}});function Ka(a){A.call(this,"C1PRAM",a)}C(Ka);Ka.prototype.ba=function(a){this.a=a;this.X()};
|
||||
y(function(){for(var a=F(window.document,"c1pjs","ram"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Ka(d);E(d,c)}});
|
||||
function La(a){A.call(this,"C1PKeyboard",a);this.C.M=!1;this.Ja=a.model;this.da=8;this.gb=10;this.Ya=13;this.ja=27;this.Pa=this.da;this.Xa=this.gb;this.Ka=this.Ya;this.$=this.ja;this.L=241;this.Z=224;this.Ta=3;this.Ua=15;this.K=1;this.D=[];this.D["break"]=this.Z;this.D.esc=this.$;this.D["ctrl-c"]=this.Ta;this.D["ctrl-o"]=this.Ua;this.b=[];this.b[49]=30464;this.b[33]=30704;this.b[50]=30208;this.b[34]=30448;this.b[51]=29952;this.b[35]=30192;this.b[52]=29696;this.b[36]=29936;this.b[53]=29440;this.b[37]=
|
||||
29680;this.b[54]=29184;this.b[38]=29424;this.b[55]=28928;this.b[39]=29168;this.b[56]=26368;this.b[40]=26608;this.b[57]=26112;this.b[41]=26352;this.b[48]=25856;this.b[58]=25600;this.b[42]=25840;this.b[45]=25344;this.b[61]=25584;this.b[46]=22272;this.b[62]=22512;this.b[108]=22016;this.b[76]=22256;this.b[92]=22256;this.b[111]=21760;this.b[79]=22E3;this.b[this.Pa]=22E3;this.b[this.Xa]=21504;this.b[this.Ka]=21248;this.b[119]=18176;this.b[87]=18416;this.b[101]=17920;this.b[69]=18160;this.b[114]=17664;this.b[82]=
|
||||
17904;this.b[116]=17408;this.b[84]=17648;this.b[121]=17152;this.b[89]=17392;this.b[117]=16896;this.b[85]=17136;this.b[105]=16640;this.b[73]=16880;this.b[115]=14080;this.b[83]=14320;this.b[100]=13824;this.b[68]=14064;this.b[102]=13568;this.b[70]=13808;this.b[103]=13312;this.b[71]=13552;this.b[104]=13056;this.b[72]=13296;this.b[106]=12800;this.b[74]=13040;this.b[107]=12544;this.b[75]=12784;this.b[91]=12784;this.b[120]=9984;this.b[88]=10224;this.b[99]=9728;this.b[67]=9968;this.b[118]=9472;this.b[86]=
|
||||
9712;this.b[98]=9216;this.b[66]=9456;this.b[110]=8960;this.b[78]=9200;this.b[94]=9200;this.b[109]=8704;this.b[77]=8944;this.b[93]=8944;this.b[44]=8448;this.b[60]=8688;this.b[113]=5888;this.b[81]=6128;this.b[97]=5632;this.b[65]=5872;this.b[122]=5376;this.b[90]=5616;this.b[32]=5120;this.b[47]=4864;this.b[63]=5104;this.b[59]=4608;this.b[43]=4848;this.b[112]=4352;this.b[80]=4592;this.b[64]=4592;this.b[this.L]=1536;this.b[this.$]=1280;this.b[240]=512;this.b[242]=256;this.b[244]=0;this.reset()}C(La);
|
||||
f=La.prototype;f.reset=function(){this.Oa(this.Ja);this.g=this.K;this.pa=0;this.o=[this.K,0,0,0,0,0,0,0];this.P=[];if(this.v)for(var a in this.v)isNaN(a)||this.v[a]&&clearTimeout(this.v[a]);this.v=[];this.Ba=this.A=0;this.qa=-1;this.ka=this.o;this.ra=this.V=0;this.B=""};
|
||||
f.T=function(a,b,c){if(void 0===this.H[b])switch(b){case "keyDown":return this.H[b]=c,c.onkeydown=function(a){return function(b){return Ma(a,b,!0)}}(this),!0;case "keyPress":return this.H[b]=c,c.onkeypress=function(a){return function(b){var c=!0;b=b||window.event;b=b.which||b.keyCode;a.B="";a.g&8?a.g&=-9:c=!Na(a,b);a.u&&G(a.u,a.u.Aa)&&a.u.message("keyPress("+p(b)+"): "+(c?"pass":"consume"));return c}}(this),!0;case "keyUp":return this.H[b]=c,c.onkeyup=function(a){return function(b){return Ma(a,b,
|
||||
!1)}}(this),!0;case "break":return this.H[b]=c,c.onclick=function(a){return function(){a.J&&a.J.reset(!0)}}(this),!0;default:if(void 0!==this.D[b])return this.H[b]=c,c.onclick=function(a,b,c){return function(){a.s&&a.s.ca();return!Na(a,c)}}(this,b,this.D[b]),!0}return!1};f.ba=function(a,b,c,d){this.a=a;this.sa=b;this.jb=c-b+1;this.mb=this.sa+this.jb;d&&(this.s=d,N(d,b,c,this,this.W));this.X()};f.Oa=function(a){this.O=a;this.R=255;600!=this.O&&(this.R=0,this.l("updated keyboard model: "+this.O))};
|
||||
f.ia=function(a,b){a&&!this.C.M&&(this.C.M=!0,this.J=b,this.u=L(b,"debugger"))};f.X=function(){this.U=(this.lb=w("iOS"))||w("Android");this.u&&G(this.u,this.u.Aa)&&this.u.message("mobile keyboard support: "+(this.U?"true":"false")+" ("+window.navigator.userAgent+")");A.prototype.X.call(this)};function Oa(a,b){var c=b?100:250;a.s&&a.s.ua&&(c/=a.s.ua);return c}function Pa(a,b){!a.A||void 0!==b&&b==a.A||(a.u&&G(a.u,a.u.Aa)&&a.u.message("autoClear("+p(a.A)+")"),clearTimeout(a.v[a.A]),T(a,a.A,!1,4))}
|
||||
function U(a,b,c){a.B=b;Qa(a,c||300)}function Qa(a,b){if(0<a.B.length){var c=a.B.charCodeAt(0);10==c&&(c=13);65<=c&&90>=c&&(c+=32);a.B=a.B.substr(1);Na(a,c)}0<a.B.length&&setTimeout(function(a){return function(){Qa(a,b)}}(a),b)}
|
||||
function Ma(a,b,c){var d,e=!c;b=b.keyCode;c&&(a.Ba=b);16==b?(a.g&=-5,c&&(a.g|=4),b+=224,e=!1):18==b?(a.g&=-3,c&&(a.g|=2),b+=224,e=!1):b==a.L-224?(a.g&=-65,c&&(a.g|=64),b+=224,e=!1):20==b?(c=!c,a.g&=~a.K,c&&(a.g|=a.K),b+=224,e=!1):91==b?(a.g&=-9,c&&(a.g|=8),e=!1,d=!0):d=9==b?e=!1:b==a.ja||b==a.da?c?!Na(a,b):!1:!0;e&&(a.g&=-9,a.U||b!=a.Ba||Pa(a));void 0===d&&(d=!T(a,b,c,2));a.u&&G(a.u,a.u.Aa)&&a.u.message("key"+(c?"Down":"Up")+"("+p(b)+"): "+(d?"pass":"consume"));return d}
|
||||
function Na(a,b){var c=!1;b==a.Z?a.J&&(a.J.reset(!0),c=!0):(a.U&&65<=b&&90>=b&&(b+=32),Pa(a,b),T(a,b,!0,0)&&(a.s.speed==a.s.fb?T(a,b,!1,1):(c=!1,a.v[b]&&(clearTimeout(a.v[b]),c=!0),c=Oa(a,c),a.v[a.A=b]=setTimeout(function(a){return function(){T(a,b,!1,3)}}(a),c),a.u&&G(a.u,a.u.Aa)&&a.u.message("keyPressSimulate("+p(b)+"): setTimeout()")),c=!0));a.u&&G(a.u,a.u.Aa)&&a.u.message("keyPressSimulate("+p(b)+"): "+(c?"true":"false"));return c}
|
||||
function T(a,b,c,d){var e=!1;c||(a.v[b]=null,a.A==b&&(a.A=0));var g=0,h=a.b[b];void 0===h&&(1<=b&&26>=b&&(b+=64,g=a.L),h=a.b[b]);void 0!==h&&(b=h>>12,e=h>>8&15,g||(g=h&255),c?(a.o[b]|=1<<e,a.o[0]=g==a.L?a.o[0]|64:240==g?a.o[0]|4:242==g?a.o[0]|2:a.o[0]&-71):(a.o[b]&=~(1<<e),a.o[0]&=-71,a.o[0]|=a.g&70),c=0==d&&!a.P.length,a.P.push(a.o.slice()),Ra(a,c),e=!0);return e}f.S=function(){};f.W=function(a){this.pa=this.s.S(a)^this.R;this.V++;Ra(this,!1,a)};
|
||||
function Ra(a,b,c){var d=Ga(a.s);b||(a.s.speed==a.s.fb?b=void 0!==c&&32<=a.V:(b=d-a.ra,b=0>b||8192<=b));b&&(b=a.P.shift(),void 0!==b&&(a.ka=b),a.V=0,a.ra=d);for(b=d=0;8>b;b++)a.pa&1<<b&&(d|=a.ka[b]);d^=a.R;if(void 0!==c)a.a[c]=d;else if(c=a.sa,d!=a.qa)for(;c<a.mb;c++)a.a[c]=d;a.qa=d}y(function(){for(var a=F(window.document,"c1pjs","keyboard"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new La(d);E(d,c)}});
|
||||
function Sa(a,b,c,d){A.call(this,"C1PVideo",a);this.ka=a.model;this.Z=a.charCols;this.$=a.charRows;this.qa=a.screenWidth;this.ra=a.screenHeight;this.A=a.charWidth;this.B=a.charHeight;Ta(this);this.D=b;this.ja=c;this.o=d}C(Sa);f=Sa.prototype;f.reset=function(a){this.Oa(this.ka);if(this.a)for(var b=this.K;b<this.P;b++)this.a[b]=a?Math.floor(256*Math.random()):32};f.T=function(a,b,c){switch(b){case "refresh":return this.H[b]=c,c.onclick=function(a){return function(){Ua(a);va(a)}}(this),!0}return!1};
|
||||
f.ba=function(a,b,c,d){this.a=a;this.K=b;this.pa=c-b+1;this.P=this.K+this.pa;d&&(this.s=d,wa(d,56832,56832,this,this.S),N(d,56832,56832,this,this.W));this.reset(!0)};function Ta(a,b,c,d,e){a.J=void 0!==b?b:a.Z;a.sa=void 0!==c?c:a.$;a.g=a.J*a.sa;a.P=a.K+a.g;a.V=void 0!==d?d:0;a.da=void 0!==e?e:c;a.R=Math.floor(a.qa/a.J);a.U=Math.floor(a.ra/a.da)}f.ca=function(){this.D.focus()};
|
||||
f.Oa=function(a){this.O=a;600==this.O?(Ta(this,this.Z,this.$,3,25),1024==this.g&&this.s&&(this.v=this.P+this.g-1,N(this.s,this.v,this.v,this,this.Nb))):(this.l("updated video model: "+this.O),Ta(this,64,32));Ua(this);va(this)};f.ia=function(a,b){if(a&&!this.C.M&&K(this)){if(this.C.M=!0,this.u=L(b,"debugger"),this.b=L(b,"keyboard"))this.b.T("canvas","keyDown",this.D),this.b.T("canvas","keyPress",this.D),this.b.T("canvas","keyUp",this.D)}else!a&&this.C.M&&(this.C.M=!1)};
|
||||
f.X=function(){this.A||(this.A=Math.floor(this.o.width/16));this.B||(this.B=Math.floor(this.o.height/16));A.prototype.X.call(this)};f.S=function(a,b){var c=this.s.S(a);void 0!==b&&this.u&&S(this.u,this,a,b,this.u.bb);this.s.W(a,c&127|(Math.floor(Ga(this.s)/8333)&1?128:0))};f.W=function(a,b){void 0!==b&&this.u&&S(this.u,this,a,b,this.u.bb)};
|
||||
f.Nb=function(a,b){if(void 0!==b){this.u&&S(this.u,this,a,b,this.u.bb,!0);this.Oa(540);this.b&&this.b.Oa(542);var c=this.s,d=c.K,e=[],g=xa(d,this.v,this.v,this,this.Nb);if(0<=g){e.push(d[g][0]);e.push(d[g][1]);d.splice(g,1);for(var h=65536,k=0,g=0;g<d.length;g++)h>d[g][0]&&(h=d[g][0]),k<d[g][1]&&(k=d[g][1]);e.push(h);e.push(k)}4==e.length&&(c.da=e[2],c.ja=e[3])}};function Ua(a){a.L=Array(a.g);for(var b=0;b<=a.g;b++)a.L[b]=-1}
|
||||
function va(a){var b=0;if(a.C.M)for(;b<a.g;){var c=a.a[a.K+b];if(a.L[b]!=c){var d=Math.floor(b/a.J);if(d>=a.V&&(d-=a.V,d<a.da)){var e=c*a.A;a.ja.drawImage(a.o,e%a.o.width,Math.floor(e/a.o.width)*a.B,a.A,a.B,b%a.J*a.R,d*a.U,a.R,a.U)}a.L[b]=c}b++}}
|
||||
y(function(){for(var a=F(window.document,"c1pjs","video"),b=0;b<a.length;b++){var c=a[b],d=D(c),e=window.document.createElement("canvas");if(void 0===e||!e.getContext){c.innerHTML="<br/>Missing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","c1pjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.setAttribute("contenteditable","true");e.setAttribute("autocapitalize","off");e.setAttribute("autocorrect","off");e.style.backgroundColor=
|
||||
d.screenColor;e.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(e.style.height=(c.clientWidth*d.screenHeight/d.screenWidth|0)+"px",c.onresize=function(a,b,c,d){return function(){b.style.height=(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight));c.appendChild(e);var g=new Image,h=e.getContext("2d"),e=new Sa(d,e,h,g);g.onload=function(a){return function(){a.X()}}(e,d.charSet);g.src=d.charSet;E(e,c)}});
|
||||
function Va(a){A.call(this,"C1PSerialPort",a);this.C.M=!1;this.O=a.demo;this.reset()}C(Va);f=Va.prototype;f.reset=function(){if(2!=this.g){this.v=this.B=0;var a=1;if(this.sb){var b=this.sb.match(/\d+/);null!==b&&(a=parseInt(b[0],10))}this.o='10 PRINT "HELLO OSI #'+a+'"\n';this.g=this.A=0}};f.start=function(){this.b&&this.O&&(U(this.b," C\n\n",3E3),setTimeout(function(a){return function(){a.g=1;U(a.b,"LOAD\n")}}(this),12E3));this.O=!1};
|
||||
f.T=function(a,b,c){var d=this;switch(b){case "listSerial":return this.H[b]=c,!0;case "loadSerial":return this.H[b]=c,c.onclick=function(){d.H.listSerial&&u(d.H.listSerial.value,d,d.tb)},!0;case "mountSerial":return!w("Mobi")&&window&&"FileReader"in window?(this.H[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){var b=a.currentTarget[1].files[0],c=new FileReader;c.onload=function(){d.tb(b.name,c.result.toString(),
|
||||
0)};c.readAsText(b);return!1}):c.parentNode.removeChild(c),!0}return!1};f.ba=function(a,b,c,d){this.a=a;this.D=b;this.L=c-b+1;this.K=this.D+this.L;if(this.s=d)wa(d,b,c,this,this.S),N(d,b,c,this,this.W);this.X()};f.ia=function(a,b){a&&!this.C.M&&(this.C.M=!0,this.J=b,this.b=L(b,"keyboard"),this.u=L(b,"debugger"))};
|
||||
f.tb=function(a,b,c){b?(this.o=b,this.g=this.A=0,this.J&&this.b&&this.s.C.na?(this.l("auto-loading "+a),this.s.ca(),"."!=this.o.charAt(0)?(this.g=1,U(this.b,"NEW\nLOAD\n")):(this.g=2,this.J.reset(!0),U(this.b,"ML"))):this.l(a+" ready to load")):this.l(a+" load error ("+c+")")};f.S=function(a,b){void 0!==b&&(a&1?Wa(this):this.o&&!this.A&&Wa(this))};f.W=function(a,b){void 0!==b&&this.u&&S(this.u,this,a,b,this.u.Sb,!0)};
|
||||
function Wa(a){if(void 0!==a.o){a.B=0;a.v=0;if(a.A<a.o.length){var b=a.o.charCodeAt(a.A++);10==b&&(b=13);a.B=b;a.v=1}else 1==a.g&&a.b&&U(a.b," \nRUN\n"),a.g=0;for(b=a.D+0;b<a.K;b+=2)a.a[b]=a.v?1:0;for(b=a.D+1;b<a.K;b+=2)a.a[b]=a.v?a.B:0}}y(function(){for(var a=F(window.document,"c1pjs","serial"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Va(d);E(d,c)}});function Xa(a){A.call(this,"C1PDiskController",a);this.C.M=!1;this.reset(!0)}C(Xa);f=Xa.prototype;
|
||||
f.reset=function(a){Ya(this);this.b=-1;a&&(this.g=[],this.g[0]={Te:0,ub:40,Tb:!0,Ga:20,oa:0,Fa:-1,Wa:[]})};
|
||||
function Ya(a){a.K={I:64,ha:function(){},update:function(a){return function(c){void 0!==c&&(this.I=c);a.B.I&4||V(a,0,this)}}(a)};a.o={I:255,ha:function(){this.update()},update:function(a){return function(c){void 0===c?c=a.o.I:Za(a,c,a.A.I);c=(c|190)&-2;if(0<=a.b&&a.g[a.b].Wa.length){var d=a.g[a.b];d.Tb&&(c&=-33);d.oa||(c&=-3);10>=--d.Ga&&(0<d.Ga?(c&=-129,$a(a)):(d.Ga=100,0<=a.b&&(a.g[a.b].Fa=0,ab(a))))}this.I=c;a.B.I&4&&V(a,0,this)}}(a)};a.B={I:0,ha:function(){},update:function(a){return function(c){void 0!==
|
||||
c&&(this.I=c&-193);V(a,1,this);a.o.update();a.K.update()}}(a)};a.L={I:255,ha:function(){},update:function(a){return function(c){void 0!==c&&(this.I=c);a.D.I&4||V(a,2,this)}}(a)};a.A={I:255,ha:function(){},update:function(a){return function(c){void 0===c?c=a.A.I:Za(a,a.o.I,c);if(0<=a.b&&a.b<a.g.length){var d=a.g[a.b];d.Wa.length&&a.A.I&8&&!(c&8)&&(c&4?d.oa--:d.oa++,a.u&&G(a.u,a.u.Ia)&&a.u.message("stepping "+(c&4?"down":"up")+" to track "+d.oa),d.oa>=d.ub&&(d.oa=d.ub),0>d.oa&&(d.oa=0),d.Ga=20,a.o.update(a.o.I|
|
||||
128),$a(a))}this.I=c;a.D.I&4&&V(a,2,this)}}(a)};a.D={I:0,ha:function(){},update:function(a){return function(c){void 0!==c&&(this.I=c&-193);V(a,3,this);a.A.update();a.L.update()}}(a)};a.P={I:0,ha:function(){},update:function(a){return function(c){void 0!==c&&(3==(c&3)&&(a.v.I=14),this.I=c);a.v.update()}}(a)};a.v={I:14,ha:function(){},update:function(a){return function(c){void 0===c&&(c=a.v.I);c&=-2;0<=a.b&&0<=a.g[a.b].Fa&&(c|=1);this.I=c;V(a,16,this)}}(a)};a.O={I:0,ha:function(a){return function(){ab(a)}}(a),
|
||||
update:function(a){return function(c){void 0!==c&&(this.I=c);V(a,17,this)}}(a)};a.R={I:0,ha:function(){},update:function(){return function(){}}(a)}}f.T=function(a,b,c){switch(b){case "listDisk":return this.H[b]=c,!0;case "loadDisk":return this.H[b]=c,c.onclick=function(a){return function(){if(a.H.listDisk){var b=a.H.listDisk.value,c=b;".json"!=b.substr(b.length-5)&&(c="http://"+window.location.host+"/api/v1/dump?disk="+b);a.l("loading "+aa(b)+"...");u(c,a,a.Vb)}}}(this),!0}return!1};
|
||||
f.ba=function(a,b,c,d){this.a=a;this.J=b;if(this.s=d)wa(d,b,c,this,this.S),N(d,b,c,this,this.W);this.X()};f.ia=function(a,b){a&&!this.C.M&&(this.C.M=!0,this.u=L(b,"debugger"))};
|
||||
f.Vb=function(a,b,c){if(c)this.l("disk load error ("+c+")");else{c=[];this.l("mounting "+a+"...");try{if(c=eval("("+b+")"),c.length)if(c[0].length){var d=c[0];if(void 0===d[0].trackNum)this.l("data error: "+d[0]);else if(this.g[0]){for(b=0;b<d.length;b++){var e,g=d[b],h=g.sectors;if(void 0===(e=g.trackNum)||void 0===h)throw Error("track "+b+" missing data");e!=b&&v("track "+e+" out of order (expected "+b+")");c=[];var k,l,m;if(e){bb(c,g,"trackSig");cb(c,g);W(c,g,"trackType");for(var r=0;r<h.length;r++){k=
|
||||
h[r];l=k.sectorData;W(c,k,"sectorSig");W(c,k,"sectorNum");W(c,k,"sectorPages");for(m=0;m<l.length;m++)c.push(l[m]);bb(c,k,"sectorEndSig")}}else for(k=h[0],l=k.sectorData,W(c,g,"trackLoad",2),W(c,k,"sectorPages"),m=0;m<l.length;m++)c.push(l[m]);d[e].Mb=c;this.u&&G(this.u,this.u.Ia)&&this.u.message("track "+e+": "+c.length+" bytes")}this.g[0].Wa=d;this.l("mount of "+a+" complete")}else this.l("no available drives")}else this.l("no tracks: "+a);else this.l("no data: "+a)}catch(I){this.l("disk data error: "+
|
||||
I.message)}}};function cb(a,b){var c=b.trackNum;if(void 0===c)throw Error("missing bcd value: trackNum");a.push(Math.floor(c/10)<<4|c%10)}function W(a,b,c,d){b=b[c];if(void 0===b)throw Error("missing binary value: "+c);2==d&&a.push(b>>8&255);a.push(b&255)}function bb(a,b,c){b=b[c];if(void 0===b)throw Error("missing signature: "+c);for(c=0;c<b.length;c++)a.push(b.charCodeAt(c))}
|
||||
function db(a,b,c){b&=63;16>b?b&=3:32>b&&(b&=17);switch(b){case 0:a=a.B.I&4?a.o:a.K;break;case 1:a=a.B;break;case 2:a=a.D.I&4?a.A:a.L;break;case 3:a=a.D;break;case 16:a=c?a.P:a.v;break;case 17:a=a.O;break;default:a=a.R}return a}f.S=function(a,b){if(void 0!==b){var c=db(this,a-this.J,!1);this.u&&S(this.u,this,a,b,this.u.Ia,!1,c.Lb);c.ha()}};
|
||||
f.W=function(a,b){if(void 0!==b){var c=this.s.S(a),d=db(this,a-this.J,!0);if(this.u&&G(this.u,this.u.Ia|this.u.qb)&&(S(this.u,this,a,b,this.u.Ia,!0,d.Lb),d.Qb))for(var e=128,g=d.I^c;g&&e;)g&e&&this.u.message(" changed "+d.Lb+"."+d.Qb[e]+" to "+(c&e?"1":"0")),e>>=1;d.update(c)}};function Za(a,b,c){var d=-1;void 0!==b&&void 0!==c&&(d=0,c&32||(d|=2),a.o.I&64||(d|=1));a.b!=d&&(a.b=d,a.v.update())}function $a(a){0<=a.b&&(a.g[a.b].Fa=-1,a.O.update(255),a.v.update())}
|
||||
function ab(a){var b=null;if(0<=a.b){var b=a.g[a.b],c=b.Wa[b.oa];void 0!==c&&(0<=b.Fa&&b.Fa<c.Mb.length?(b.Ga=100,b=c.Mb[b.Fa++],a.O.update(b),a.v.update()):(b.Ga=10,$a(a)))}}function V(a,b,c){a.s.W(b+a.J,c.I)}y(function(){for(var a=F(window.document,"c1pjs","disk"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Xa(d);E(d,c)}});
|
||||
function eb(a){A.call(this,"C1PDebugger",a);this.u=this;this.L=-1;this.va=0;this.ob=null;this.Za=!1;this.ga=0;this.ta=[];this.xa=[];this.za=[];this.Ma=0;this.ya=[];this.B=[];this.qb=1;this.Aa=16;this.bb=32;this.Ia=64;this.Sb=128;this.ma=this.Z=0;this.Va={port:1,kbd:16,video:32,disk:64,serial:128};this.Ra=28;this.cb=56;this.La="ADC AND ASL BCC BCS BEQ BIT BMI BNE BPL BRK BVC BVS CLC CLD CLI CLV CMP CPX CPY DEC DEX DEY EOR INC INX INY JMP JSR LDA LDX LDY LSR NOP ORA PHA PHP PLA PLP ROL ROR RTI RTS SBC SEC SED SEI STA STX STY TAX TAY TSX TXA TXS TYA SIM .DB".split(" ");
|
||||
this.V=["HLT","MSG"];fb(this,!0);this.fa=[[10],[34,1,this.D],[this.cb,1],[],[],[34,1,this.b],[2,1,this.b],[],[36],[34,1,this.v],[2,0,this.P],[],[],[34,2,this.N],[2,2,this.N],[],[9,1,this.ea],[34,1,this.J],[],[],[],[34,1,this.g],[2,1,this.g],[],[13],[34,2,this.A],[],[],[],[34,2,this.o],[2,2,this.o],[],[this.Ra,2,this.Qa],[1,1,this.D],[],[],[6,1,this.b],[1,1,this.b],[39,1,this.b],[],[38],[1,1,this.v],[39,0,this.P],[],[6,2,this.N],[1,2,this.N],[39,2,this.N],[],[7,1,this.ea],[1,1,this.J],[],[],[],[1,
|
||||
1,this.g],[39,1,this.g],[],[44],[1,2,this.A],[],[],[],[1,2,this.o],[39,2,this.o],[],[41],[23,1,this.D],[],[],[],[23,1,this.b],[32,1,this.b],[],[35],[23,1,this.v],[32,0,this.P],[],[27,2,this.Qa],[23,2,this.N],[32,2,this.N],[],[11,1,this.ea],[23,1,this.J],[],[],[],[23,1,this.g],[32,1,this.g],[],[15],[23,2,this.A],[],[],[],[23,2,this.o],[32,2,this.o],[],[42],[0,1,this.D],[],[],[],[0,1,this.b],[40,1,this.b],[],[37],[0,1,this.v],[40,0,this.P],[],[27,2,this.pb],[0,2,this.N],[40,2,this.N],[],[12,1,this.ea],
|
||||
[0,1,this.J],[],[],[],[0,1,this.g],[40,1,this.g],[],[46],[0,2,this.A],[],[],[],[0,2,this.o],[40,2,this.o],[],[],[47,1,this.D],[],[],[49,1,this.b],[47,1,this.b],[48,1,this.b],[],[22],[],[53],[],[49,2,this.N],[47,2,this.N],[48,2,this.N],[],[3,1,this.ea],[47,1,this.J],[],[],[49,1,this.g],[47,1,this.g],[48,1,this.U],[],[55],[47,2,this.A],[54],[],[],[47,2,this.o],[],[],[31,1,this.v],[29,1,this.D],[30,1,this.v],[],[31,1,this.b],[29,1,this.b],[30,1,this.b],[],[51],[29,1,this.v],[50],[],[31,2,this.N],[29,
|
||||
2,this.N],[30,2,this.N],[],[4,1,this.ea],[29,1,this.J],[],[],[31,1,this.g],[29,1,this.g],[30,1,this.U],[],[16],[29,2,this.A],[52],[],[31,2,this.o],[29,2,this.o],[30,2,this.A],[],[19,1,this.v],[17,1,this.D],[],[],[19,1,this.b],[17,1,this.b],[20,1,this.b],[],[26],[17,1,this.v],[21],[],[19,2,this.N],[17,2,this.N],[20,2,this.N],[],[8,1,this.ea],[17,1,this.J],[],[],[],[17,1,this.g],[20,1,this.g],[],[14],[17,2,this.A],[],[],[],[17,2,this.o],[20,2,this.o],[],[18,1,this.v],[43,1,this.D],[],[],[18,1,this.b],
|
||||
[43,1,this.b],[24,1,this.b],[],[25],[43,1,this.v],[33],[],[18,2,this.N],[43,2,this.N],[24,2,this.N],[],[5,1,this.ea],[43,1,this.J],[],[],[],[43,1,this.g],[24,1,this.g],[],[45],[43,2,this.A],[],[],[],[43,2,this.o],[24,2,this.o],[]]}C(eb);f=eb.prototype;
|
||||
f.T=function(a,b,c){var d=this;switch(b){case "debugInput":return this.R=this.H[b]=c,this.R.focus(),c.onkeypress=function(a,c){return function(d){13==d.keyCode&&(b=c.value,c.value="",gb(a,b))}}(this,c),!0;case "debugEnter":return this.H[b]=c,ea(c,function(){return d.R?(b=d.R.value,gb(d,b),!0):!1}),!0;case "step":return this.H[b]=c,ea(c,function(a){var b=!1;J(d,!0)||(H(d,!0),b=d.step(a?1:0),H(d,!1));return b}),!0}return!1};
|
||||
f.ba=function(a,b,c){this.a=a;this.O=b;this.ra=c-b+1;this.Ha=this.O+this.ra;this.X()};f.ia=function(a,b){a&&!this.C.M&&(this.C.M=!0,this.s=L(b,"cpu"))};f.ca=function(){this.R.focus()};
|
||||
function fb(a,b){a.P=0;a.v=1;a.o=2;a.A=3;a.Qa=4;a.pb=5;a.g=6;a.U=7;a.D=8;a.J=9;a.N=10;a.b=11;a.ea=a.Qa;var c="",d,e;if(b)for(a.la="A #$nn $nnnn,X $nnnn,Y $nnnn ($nnnn) $nn,X $nn,Y ($nn,X) ($nn),Y $nnnn $nn".split(" "),d=0;d<a.la.length;d++)e=a.la[d],c+="("+e.replace(/\(/g,"\\(").replace(/\)/g,"\\)").replace(/nnnn/g,"[0-9A-F][0-9A-F][0-9A-F][0-9A-F]?").replace(/nn/g,"[0-9A-F][0-9A-F]?").replace(/\$/g,"\\$")+"|)";else for(a.la="A nn [nnnn+X] [nnnn+Y] nnnn [nnnn] [nn+X] [nn+Y] [[nn+X]] [[nn]+Y] [nnnn] [nn]".split(" "),
|
||||
d=0;d<a.la.length;d++)e=a.la[d],c+="("+e.replace(/\[/g,"\\[").replace(/]/g,"\\]").replace(/nnnn/g,"[0-9A-F][0-9A-F][0-9A-F][0-9A-F]?").replace(/nn/g,"[0-9A-F][0-9A-F]?").replace(/\+/g,"\\+")+"|)";a.Re=new RegExp(c);a.Rb=[27,a.Ra,9,7,11,12,3,4,8,5]}f.aa=function(){this.s.aa()};function S(a,b,c,d,e,g,h){(a.ma&e)==e&&(e=a.s.S(c),a.message(b.id+"."+(g?"setByte":"getByte")+"("+q(c)+")"+(void 0!==d?" @"+q(d):"")+": "+(h?h+"=":"")+p(e)))}f.message=function(a){this.l(a);Fa(this.s)};f.Ub=function(){this.l("Type ? for list of debugger commands\n")};
|
||||
f.wa=function(){if(!hb(this))return!1;this.s.wa();return!0};f.step=function(a){if(!hb(this))return!1;var b;try{b=this.s.step(a)}catch(c){b=void 0,qa(this.s,c.stack||c.message)}void 0!==b&&this.L++;this.s.update(!0);this.update(!0);return b};f.update=function(a){this.va=this.s.f;a||this.Ea?ib(this):jb(this)};function hb(a){a.s&&K(a.s)&&!J(a.s)?(a=a.s,a.C.Da?(a.l(a.toString()+" error"),a=!0):a=!1,a=!a):a=!1;return a}
|
||||
f.reset=function(){var a;this.ya.length||(this.ya=Array(1E3));for(a=0;a<this.ya.length;a++)this.ya[a]=-1;this.B.length||(this.B=Array(256));for(a=0;a<this.B.length;a++)this.B[a]=[a,0];this.L&&this.update();this.L=0};f.start=function(){this.Ea||this.l("running")};f.stop=function(a,b){if(!this.Ea&&(this.l("stopped"),b)){var c=t();this.l(c-a+"ms ("+b+" cycles)")}this.update();this.ca();this.Ea||(this.L=0);kb(this,this.s.f)};function lb(a,b){return a+(b<<24>>24)}
|
||||
f.S=function(a){var b;a>=this.O&&a<this.Ha&&(ya(this.s,a),b=this.a[this.O+a],b&=255);return b};f.W=function(a,b){a<this.O||a>=this.Ha?this.l("invalid address: "+q(a)):(this.a[this.O+a]=b&255,za(this.s,a),this.s.update())};function mb(a,b){X(a.ta,b,void 0)||a.ta.push(b);return!0}function X(a,b,c){for(var d=!1,e=0;e<a.length;e++)if(a[e]==b){c&&a.splice(e,1);d=!0;break}return d}function nb(a,b){void 0!==b&&(kb(a,a.K),mb(a,b)&&(a.K=b))}
|
||||
function kb(a,b){void 0!==a.K&&b==a.K&&X(a.ta,a.K,!0)&&(a.K=void 0);a.Ea=!1}function Ea(a,b,c,d){for(var e=!1,g=0;g<c.length;g++)if(c[g]==b){b!=a.K&&a.l("breakpoint hit: "+q(b)+" ("+d+")");e=!0;break}return e}
|
||||
function ob(a,b,c){var d=n(b,4),e=a.S(b++),g=a.fa[e],h=void 0===e?0:e,k=[],l=void 0===g[1]?0:g[1];do{d+=" "+n(h,2);if(!l--)break;h=a.S(b++);if(void 0===h)break;k.push(h)}while(1);void 0===g[0]&&(g=[57,1,a.v],k.push(e));var d=(d+" ").substr(0,15),d=d+a.La[g[0]],m=null;if(void 0!==g[2]){l=g[2];m=a.la[l];if(1==g[1]&&l==a.ea)m=m.replace(/nnnn/,n(lb(b,h=k.pop()),4));else for(;k.length;)m=m.replace(/nn/,n(h=k.pop(),2));l==a.v&&1==g[1]&&32<=h&&128>h&&(m+=" ;'"+String.fromCharCode(h)+"'")}if(e==a.s.cb&&
|
||||
(h<a.V.length&&(m=a.V[h]),h==a.s.Ob)){l=0;for(m='"';h=a.S(b++);)16>l?m+=String.fromCharCode(h):16==l&&(m+="\u2026"),l++;m+='"'}m&&(d+=" "+m);c&&(d=(d+" ").substr(0,30),d+=";"+c.toString());a.$=b;return d}
|
||||
function Y(a,b){var c=a.va;if(void 0!==b){var d=16;"$"==b.charAt(0)?b=b.substr(1):"0x"==b.substr(0,2)?b=b.substr(2):"."==b.charAt(b.length-1)&&(d=10,b=b.substr(0,b.length-1));c=parseInt(b,d);isNaN(c)&&(a.l("invalid base-"+d+" address: "+b),c=void 0)}void 0!==c&&(c<a.O||c>=a.Ha)&&(a.l("address out of range: "+n(c)),c=void 0);return c}
|
||||
function pb(a,b){if("?"==b)a.l("\nfrequency commands:"),a.l("clear\tclear all frequency counts");else{var c=0,d;if(a.B)if("clear"==b){for(d=0;d<a.B.length;d++)a.B[d]=[d,0];a.l("frequency data cleared");c++}else if(void 0!==b)a.l("unknown frequency command: "+b),c++;else{var e=a.B.slice();e.sort(function(a,b){return b[1]-a[1]});for(d=0;d<e.length;d++){var g=e[d][0],h=e[d][1];h&&(a.l(a.La[a.fa[g][0]]+" ("+p(g)+"): "+h+" times"),c++)}}c||a.l("no frequency data available")}}
|
||||
function ib(a,b,c,d){var e=Y(a,b);if(void 0!==e){void 0===d&&(d=1);b=a.Ha;if(void 0!==c){b=Y(a,c);if(void 0===b||b<e)return;if(256<b-e){a.l("range too large");return}b++;d=-1}for(e!=a.va&&a.l();d--&&e<b;)c=ob(a,e,J(a,!1)||a.Ea?a.L:0),a.l(c),a.va=e=a.$}}
|
||||
function jb(a,b){if(b&&"?"==b[1])a.l("\nregister commands:"),a.l("r to display all"),a.l("r [target=value] to modify"),a.l("supported targets:"),a.l("A,X,Y,S,PC and flags C,Z,D,V,N");else{var c=!0;if(void 0!==b&&1<b.length){var c=!1,d=b[1],e=null,g=d.indexOf("=");if(0<g)e=d.substr(g+1),d=d.substr(0,g);else if(2<b.length)e=b[2];else{a.l("missing value for "+b[1]);return}g=parseInt(e,16);if(isNaN(g)){a.l("invalid value: "+e);return}switch(d.toUpperCase()){case "A":a.s.h=g&255;break;case "X":a.s.w=g&
|
||||
255;break;case "Y":a.s.F=g&255;break;case "C":a.s.c=g?256:0;break;case "Z":a.s.j=g?0:1;break;case "D":g?Ha(a.s):Ia(a.s);break;case "V":g?(d=a.s,d.v=0,d.A=128):(d=a.s,d.v=0,d.A=0);break;case "N":a.s.i=g?128:0;break;case "S":if(256!=(g&-256)){a.l("invalid stack pointer: "+e);return}a.s.G=g;break;case "PC":c=!0;a.s.f=g&65535;a.va=a.s.f;break;default:a.l("unknown register: "+d);return}a.s.update()}a.l("A="+n(a.s.h,2)+" X="+n(a.s.w,2)+" Y="+n(a.s.F,2)+" P="+n(Ca(a.s),2)+" S="+n(a.s.G,4)+" PC="+n(a.s.f,
|
||||
4));c&&ib(a,n(a.va=a.s.f,4))}}function qb(a,b){var c=void 0===b?1:parseInt(b,10),d=1==c?0:1;da(c,function(a){return function(){return H(a,!0)&&a.step(d)}}(a),function(a){return function(){H(a,!1)}}(a))}
|
||||
function gb(a,b){b.length||(a.Za?(a.l("ended assemble @"+n(a.ga,4)),a.va=a.ga,a.Za=!1):a.ob&&(b=a.ob));if(K(a)&&!J(a,!0)&&0<b.length){a.Za?b="a "+n(a.ga,4)+" "+b:1<b.length&&1!=b.indexOf(" ")&&(b=b.charAt(0).toLowerCase()+" "+b.substr(1));var c=b.split(" ");a.ob=c[0];switch(c[0].toLowerCase()){case "a":var d=Y(a,c[1]);if(void 0!==d)if(a.ga=d,void 0===c[2])a.l("begin assemble @"+q(a.ga)),a.Za=!0,a.s.update();else{var e,g=c[2],h=c[3],c=a.ga,d=[];if(void 0!==g){var k,g=g.toUpperCase();"?"==g.charAt(g.length-
|
||||
1)&&(h="?",g=g.substr(0,g.length-1));for(k=0;k<a.La.length&&g!=a.La[k];k++);k==a.La.length&&(a.l("unknown operation: "+g),k=-1);var l="",m;if(0<=k&&void 0!==h)if(l=h.toUpperCase(),"?"==l){for(h=m=0;h<a.fa.length;h++)a.fa[h][0]===k&&(m||a.l("supported opcodes:"),a.l(" "+n(h,2)+": "+g+(void 0!==a.fa[h][2]?" "+a.la[a.fa[h][2]]:"")),m++);k=-1}else if(m=l.match(a.Re),null!==m&&m[0]==l){for(h=1;h<m.length;h++)if(m[h]==l)if(void 0===e)e=h-1;else{a.l("too many operand matches (both "+a.la[e]+" and "+
|
||||
a.la[h-1]+")");k=-1;break}e==a.Qa&&0>a.Rb.indexOf(k)&&(e=a.N);e==a.pb&&27!=k&&(e=a.N)}else a.l("unknown operand: "+l),k=-1;if(0<=k){m=-1;for(h=0;h<a.fa.length;h++)if(a.fa[h][0]===k&&a.fa[h][2]===e)if(0>m)m=h;else{a.l("too many instruction matches (both "+p(m)+" and "+p(h)+")");m=-2;break}if(0<=m){if(d.push(m),void 0!==e)if(g=a.fa[m][1],l=l.match(/[0-9A-F]+/),null!==l)for(l=parseInt(l[0],16),1==g&&e==a.ea&&(l-=c+2,-128>l||127<l)&&(a.l("branch out of range ("+l+")"),d=[],g=0),h=0;h<g;h++)d.push(l&255),
|
||||
l>>>=8;else g&&a.l("instruction missing "+g+" bytes")}else a.l("unknown instruction: "+g+" "+l+"")}}e=d;if(e.length){for(c=0;c<e.length;c++)a.W(a.ga+c,e[c]);a.l(ob(a,a.ga));a.ga+=e.length}}break;case "b":e=c[1];c=c[2];if(void 0===e||"?"==e)a.l("\nbreakpoint commands:"),a.l("bp [a]\tset exec breakpoint at [a]"),a.l("br [a]\tset read breakpoint at [a]"),a.l("bw [a]\tset write breakpoint at [a]"),a.l("bc [a]\tclear breakpoint at [a]"),a.l("bl\tlist all breakpoints");else if(void 0===c&&1<e.length&&(c=
|
||||
e.substr(1),e=e.substr(0,1)),"l"==e){e=0;d=a.ta;for(c=0;c<d.length;c++)a.l("breakpoint enabled: "+q(d[c])+" (exec)"),e++;d=a.xa;for(c=0;c<d.length;c++)a.l("breakpoint enabled: "+q(d[c])+" (read)"),e++;d=a.za;for(c=0;c<d.length;c++)a.l("breakpoint enabled: "+q(d[c])+" (write)"),e++;e||a.l("no breakpoints")}else void 0===c?a.l("missing breakpoint address"):"c"==e&&"*"==c?(a.ta=[],a.xa=[],a.za=[],a.l("all breakpoints cleared")):(c=Y(a,c),void 0!==c&&("p"==e?mb(a,c)?a.l("breakpoint enabled: "+q(c)+" (exec)"):
|
||||
a.l("breakpoint not set: "+q(c)):"c"==e?X(a.ta,c,!0)?a.l("breakpoint cleared: "+q(c)+" (exec)"):X(a.xa,c,!0)?a.l("breakpoint cleared: "+q(c)+" (read)"):X(a.za,c,!0)?a.l("breakpoint cleared: "+q(c)+" (write)"):a.l("breakpoint missing: "+q(c)):"r"==e?(X(a.xa,c,void 0)||a.xa.push(c),a.l("breakpoint enabled: "+q(c)+" (read)")):"w"==e?(X(a.za,c,void 0)||a.za.push(c),a.l("breakpoint enabled: "+q(c)+" (write)")):a.l("unknown breakpoint command: "+e)));break;case "d":e=c[1];d=c[2];if("?"==e)a.l("\ndump commands:"),
|
||||
a.l("d [a] [#] dump # lines of memory");else if(e=Y(a,e),void 0!==e){c=0;void 0!==d&&("l"==d.charAt(0)&&(d=d.substr(1)),c=parseInt(d,10));c||(c=1);for(d=0;d<c;d++){l=g="";h=e;for(k=0;8>k&&e<a.Ha;k++)m=a.S(e),void 0===m&&(m=0),g+=n(m,2)+" ",l+=32<=m&&128>m?String.fromCharCode(m):".",e++;a.l(n(h,4)+" "+g+l)}a.va=e}break;case "e":e=c[1];if(void 0===e)a.l("missing address");else if(e=Y(a,e),void 0!==e)for(d=2;d<c.length;d++)g=parseInt(c[d],16),a.W(e++,g);break;case "f":pb(a,c[1]);break;case "g":e=
|
||||
c[1];void 0!==e&&nb(a,Y(a,e));a.wa()||a.s.ca();break;case "h":a.aa();break;case "o":if(void 0===c[1]||"?"==c[1])a.l("\noption commands:"),a.l("max\trun at maximum speed"),a.l("fast\trun faster (up to "+a.s.Na+"Mhz)"),a.l("slow\trun at normal speed (1Mhz)"),a.l("classic\tuse classic operand syntax"),a.l("modern\tuse modern operand syntax"),a.l("msg\tenable message categories");else switch(e=c[1],e){case "slow":M(a.s,a.s.Sa);break;case "fast":M(a.s,a.s.Pb);break;case "max":M(a.s,a.s.fb);break;case "classic":fb(a,
|
||||
!0);a.l("classic syntax enabled");break;case "modern":fb(a,!1);a.l("modern syntax enabled");break;case "msg":e=0;void 0!==c[2]&&("all"==c[2]?e=255:void 0!==a.Va[c[2]]&&(e=a.Va[c[2]]),e&&("on"==c[3]?a.ma|=e:"off"==c[3]&&(a.ma&=~e)));for(d in a.Va)if(void 0===c[2]||"all"==c[2]||c[2]==d)e=a.Va[d],a.l(d+" messages: "+(a.ma&e?"on":"off"));break;default:a.l("unknown option: "+e)}break;case "p":l=c[1];e=10;c=a.Ma;d=a.ya;if(void 0!==d){g=void 0===l?a.Wb:parseInt(l,10);void 0===g&&(g=10);g>d.length&&(a.l("note: only "+
|
||||
d.length+" available"),g=d.length);void 0!==l&&(a.nb=0,a.l(g+" instructions earlier:"));l=a.nb?a.nb:1;c-=g;for(0>c&&(c=d.length-1);e&&c!=a.Ma;){h=d[c];if(0>h)break;a.l(ob(a,h,l++));++c==d.length&&(c=0);e--;g--}a.Wb=g;a.nb=l}10==e&&a.l("no history available");break;case "r":jb(a,c);break;case "s":a.S(a.s.f)==a.s.Ra?(nb(a,a.s.f+3),a.Ea=!0,a.wa()||a.s.ca()):qb(a);break;case "t":qb(a,c[1]);break;case "u":ib(a,c[1],c[2],8);break;case "?":case "help":a.l("\ncommands:\n?\thelp\na [#]\tassemble\nb [#]\tbreakpoint\nd [#]\tdump memory\ne [#]\tedit memory\nf\tdump frequencies\ng [#]\trun to [#]\nh\thalt\no\toptions\np [#]\tdump history\nr\tdump/edit registers\ns\tstep over instruction\nt [#]\tstep instruction(s)\nu [#]\tunassemble");
|
||||
a.l("note: frequency and history commands operate only when breakpoints are set");break;default:a.l("unknown command: "+b)}}}y(function(){for(var a=F(window.document,"c1pjs","debugger"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new eb(d);E(d,c)}});function Z(a,b){A.call(this,"C1PComputer",a);this.Y=b}C(Z);Z.prototype.reset=function(a){var b=null,c;for(c in this.Y)for(var d=0;d<this.Y[c].length;d++){var e=this.Y[c][d];e&&e.reset&&(e.reset(),"cpu"==c&&(b=e))}b&&(b.update(),a&&b.wa())};
|
||||
Z.prototype.start=function(){for(var a in this.Y)if("cpu"!=a)for(var b=0;b<this.Y[a].length;b++){var c=this.Y[a][b];c&&c.start&&c.start()}};Z.prototype.stop=function(a,b){for(var c in this.Y)if("cpu"!=c)for(var d=0;d<this.Y[c].length;d++){var e=this.Y[c][d];e&&e.stop&&e.stop(a,b)}};Z.prototype.T=function(a,b,c){switch(b){case "reset":return this.H[b]=c,c.onclick=function(a){return function(){a.reset()}}(this),!0}return!1};function L(a,b){return a.Y[b]?a.Y[b][0]:null}
|
||||
function rb(a){var b=null,c;for(c in a.Y)for(var d=0;d<a.Y[c].length;d++){var e=a.Y[c][d];if(e){if(!K(e)){K(e,function(a){return function(){rb(a)}}(a));return}"cpu"==c?b=e:e.ia&&e.ia(!0,a)}}a.X();a.l("C1Pjs v1.19.3\nCopyright \u00a9 2012-2015 Jeff Parsons <Jeff@pcjs.org>");b&&b.ia(!0,a)}
|
||||
y(function(){for(var a=F(window.document,"c1pjs","computer"),b=0;b<a.length;b++){for(var c=a[b],d=D(c),e,g={},h,k=0,l=0,m=0;m<d.modules.length;m++){var r=d.modules[m];if(!m){if("cpu"!=r.type)break;k=r.start;l=r.end;h=Array(l+1-k);for(e=k;e<h.length;e++)h[e]=0}if(e=pa(r.refID,d.id)){var I=r.type;void 0===g[I]&&(g[I]=[]);g[I].push(e);e.ba&&void 0!==r.start&&e.ba(h,r.start,r.end,g.cpu[0])}else{v('no component for <module refid="'+r.refID+'">');return}}if(void 0===h){v('<module type="cpu"> definition must appear first in the <computer> specification');
|
||||
break}if(e=pa("debugger",d.id))g["debugger"]=[e],e.ba&&e.ba(h,k,l,g.cpu[0]);k=new Z(d,g);if(l=pa("panel",d.id))if(g.panel=[l],l.hb){e=d.id;d=void 0;g=[];e&&(e=0<(d=e.indexOf("."))?e.substr(0,d+1):"");for(d=0;d<B.length;d++)m=B[d],e&&m.id.indexOf(e)||g.push(m);d=g;for(g=0;g<d.length;g++)e=d[g],e!=l&&(e.ab=l.ab,e.l=l.l,e.hb=l.hb)}E(k,c);rb(k)}});var sb=0;function tb(a,b,c,d,e,g){e("Loading "+a+"...");u(a,null,function(h,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),g(k,null)):ub(k,a,b,c,d,e,g)})}
|
||||
function ub(a,b,c,d,e,g,h){function k(a,g){if(g)h(g,null);else{if(c){var k=b;k&&0>k.indexOf("/")&&(k=window.location.pathname+k);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" state=$2"+d+"$2":"")+(k?" url=$2"+k+"$2":""))}k=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(k=new window.ActiveXObject("Microsoft.XMLDOM"),k.async=!1,k.loadXML(a)):k=(new window.DOMParser).parseFromString(a,"text/xml")}catch(I){k=
|
||||
null,a=I.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,k)}}a?e?vb(a,g,k):k(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function vb(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");u(e,null,function(g,h,k){if(k||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(g=d[3])if(k=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,r=/( [a-z]+=)(['"])(.*?)\2/g;m=r.exec(g);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(h=h.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],h);vb(a,b,c)}})}else c(a,null)}
|
||||
function wb(a,b,c){function d(a){if(void 0===h){var b=g&&F(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ca(a))}function e(a){d("Error: "+a);k&&(--sb||z(!0));k=!1}var g,h,k=!0;sb++;try{if(g=window.document.getElementById(a)){c||(c="/versions/c1pjs/1.19.3/components.xsl");var l=function(h,k){if(k){var l=function(h,l){if(l)if(l)if(d("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var m=k.transformNode(l);m?(g.outerHTML=m,--sb||z(!0)):e("transformNodeToObject failed")}else window.document.implementation&&
|
||||
window.document.implementation.createDocument?(m=new XSLTProcessor,m.importStylesheet(l),(m=m.transformToFragment(k,window.document))?g.parentNode?(g.parentNode.replaceChild(m,g),--sb||z(!0)):e("invalid machine element: "+a):e("transformToFragment failed")):e("unable to transform XML: unsupported browser");else e("failed to load XSL file: "+c);else e(h)};k?tb(c,null,null,!1,d,l):e("failed to load XML file: "+b)}else e(h)};"<"!=b.charAt(0)?tb(b,a,void 0,!0,d,l):ub(b,null,a,void 0,!1,d,l)}else e("missing machine element: "+
|
||||
a)}catch(m){e(m.message)}return k}window.embedC1P=function(a,b,c){z(!1);return wb(a,b,c)};window.enableEvents=z;window.sendEvent=ja;})();
|
||||
125
versions/c1pjs/1.19.3/c1p.js
Normal file
125
versions/c1pjs/1.19.3/c1p.js
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
(function(){var e;function n(a,b){var c="";void 0===b?b=8:8<b&&(b=8);if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;){var d=a&15,d=d+(0<=d&&9>=d?48:55),c=String.fromCharCode(d)+c;a>>=4}return c}function aa(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}var ba={"&":"&","<":"<",">":">",'"':""","'":"'"};function ca(a){return a.replace(/[&<>"']/g,function(a){return ba[a]})}var q=Date.now||function(){return+new Date};
|
||||
function r(a,b,c){var d;d=!0;var f=0,g=null,k=aa(a),h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");d&&(h.onreadystatechange=function(){4===h.readyState&&(g=h.responseText,200==h.status||!h.status&&g.length&&"file:"==(window?window.location.protocol:"file:")||(f=h.status||-1),c&&(b?c.call(b,k,g,f,void 0):c(k,g,f,void 0)))});h.open("GET",a,d);h.send();d||(g=h.responseText,200!=h.status&&(f=h.status||-1),c&&(b?c.call(b,k,g,f,void 0):c(k,g,f,void 0)))}
|
||||
function t(a){window&&window.alert(a)}function u(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var v={init:[],show:[],exit:[]},da=!1,w=!0;function x(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function y(a){v.init.push(a)}
|
||||
function z(a){if(w)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){t("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks.")}}function A(a){!w&&a?(w=!0,da&&ea("init")):w=a}function ea(a){v[a]&&z(v[a])}x("onload",function(){da=!0;z(v.init)});x("onpageshow",function(){z(v.show)});x(u("Opera")||u("iOS")?"onunload":"onbeforeunload",function(){z(v.exit)});
|
||||
function B(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id;this.name=b.name;void 0===this.id&&(this.id="");b=this.id.indexOf(".");0<b?(this.Ea=this.id.substr(0,b),this.Da=this.id.substr(b+1)):this.Da=this.id;this[a]=c;this.u={wa:!1,qa:!1,Ba:!1,H:!1,ra:!1};this.ya=null;this.u.ra=!1;this.A={};C[C.length]=this}var fa=void 0;if(window){fa||(fa=window.location.search.substr(1));for(var ga,ha=/\+/g,ia=/([^&=]+)=?([^&]*)/g;ga=ia.exec(fa);)ga[1].replace(ha," "),ga[2].replace(ha," ")}
|
||||
function ja(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}function E(a){var b;b||(b=B);a.prototype=ja(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}var C=[];function F(a,b){if(void 0!==a){var c;b&&0<(c=b.indexOf("."))&&(a=b.substr(0,c+1)+a);for(c=0;c<C.length;c++)if(C[c].id===a)return C[c]}return null}
|
||||
function G(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("({"+a+"})")}catch(c){t(c.message+" ("+a+")")}return b}window&&!window.document.ELEMENT_NODE&&(window.document.ELEMENT_NODE=1);
|
||||
function H(a,b){for(var c=I(b.parentNode,"c1pjs-control"),d=0;d<c.length;d++)for(var f=c[d].childNodes,g=0;g<f.length;g++){var k=f[g];if(k.nodeType===window.document.ELEMENT_NODE){var h=k.getAttribute("class");if(h)for(var l=h.split(" "),m=0;m<l.length;m++)switch(h=l[m],h){case "c1pjs-binding":(h=G(k))&&h.binding&&a.J(h.type,h.binding,k),m=l.length}}}}
|
||||
function I(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var f=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)f.test(a[b].className)&&c.push(a[b]);return c}
|
||||
B.prototype={constructor:B,parent:null,toString:function(){return this.name?this.name:this.id||this.type},J:function(a,b,c){switch(b){case "clear":return this.A[b]||(this.A[b]=c,c.onclick=function(a){return function(){a.A.print&&(a.A.print.value="")}}(this)),!0;case "print":return this.A[b]||(this.za=this.A[b]=c,c.value="",this.F=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||
this.xa=function(a,b,c){this.F(a,"notice",c)}),!0;default:return!1}},log:function(){},F:function(){},status:function(a){this.F(this.Da+": "+a)},xa:function(a,b){b||t(a)},N:function(a){this.u.ra||(this.u.wa=!1!==a,this.u.wa&&(a=this.ya,this.ya=null,a&&a()))}};function ka(a,b){if(a.u.Ba)return a.u.qa&&(a.u.qa=!1),a.u.Ba=!1;if(a.u.ra)return a.F(a.toString()+" error"),!1;a.u.qa=b;return a.u.qa}function J(a,b){b&&(a.u.wa?b():a.ya=b);return a.u.wa}function la(a,b){a.u.ra=!0;a.xa(b)}
|
||||
function K(a){B.call(this,"C1PPanel",a);this.u.H=!1}E(K);K.prototype.J=function(a,b,c){return this.I&&this.I.J(a,b,c)||this.f&&this.f.J(a,b,c)||this.b&&this.b.J(a,b,c)?!0:B.prototype.J.call(this,a,b,c)};K.prototype.aa=function(a,b){a&&!this.u.H&&(this.u.H=!0,this.I=b,this.f=L(b,"cpu"),this.b=L(b,"keyboard"),ma())};function ma(){for(var a=!1,b=I(window.document,"c1pjs","panel"),c=0;c<b.length;c++){var d=b[c],f=G(d),g=F(f.id);g||(a=!0,g=new K(f));H(g,d);a&&g.N()}}y(ma);
|
||||
function na(a){B.call(this,"C1PCPU",a);oa(this);this.u.H=!1;this.u.$=!1;this.ta=a.autoStart;this.ja=0;this.Ca=2;this.speed=this.ja;this.pa=30;this.oa=5;this.fa=8;this.ua=["Slow","Fast","Max"];this.fb=["(1Mhz)","(up to "+this.fa+"Mhz)","(unlimited)"];this.O=[];this.K=[];this.ka=65536;this.la=0;this.Z=65536;this.da=0;this.v=[this.Mb,this.ed,this.Xd,this.l,this.l,this.gd,this.Cb,this.l,this.kd,this.dd,this.Bb,this.l,this.l,this.ad,this.zb,this.l,this.Lb,this.fd,this.l,this.l,this.l,this.hd,this.Db,this.l,
|
||||
this.Pb,this.cd,this.l,this.l,this.l,this.bd,this.Ab,this.l,this.Cc,this.vb,this.l,this.l,this.Ib,this.xb,this.qd,this.l,this.md,this.ub,this.pd,this.l,this.Hb,this.rb,this.nd,this.l,this.Jb,this.wb,this.l,this.l,this.l,this.yb,this.rd,this.l,this.Hd,this.tb,this.l,this.l,this.l,this.sb,this.od,this.l,this.xd,this.qc,this.l,this.l,this.l,this.sc,this.Yc,this.l,this.jd,this.pc,this.Xc,this.l,this.Bc,this.mc,this.Vc,this.l,this.Nb,this.rc,this.l,this.l,this.l,this.tc,this.Zc,this.l,this.Rb,this.oc,
|
||||
this.l,this.l,this.l,this.nc,this.Wc,this.l,this.yd,this.Pa,this.l,this.l,this.l,this.Ra,this.vd,this.l,this.ld,this.Oa,this.ud,this.l,this.Ac,this.La,this.sd,this.l,this.Ob,this.Qa,this.l,this.l,this.l,this.Sa,this.wd,this.l,this.Jd,this.Na,this.l,this.l,this.l,this.Ma,this.td,this.l,this.l,this.Nd,this.l,this.l,this.Vd,this.Pd,this.Sd,this.l,this.lc,this.l,this.ae,this.l,this.Ud,this.Kd,this.Rd,this.l,this.Eb,this.Od,this.l,this.l,this.Wd,this.Qd,this.Td,this.l,this.ce,this.Md,this.be,this.l,this.l,
|
||||
this.Ld,this.l,this.l,this.Sc,this.Hc,this.Nc,this.l,this.Tc,this.Jc,this.Oc,this.l,this.Zd,this.Gc,this.Yd,this.l,this.Qc,this.Dc,this.Lc,this.l,this.Fb,this.Ic,this.l,this.l,this.Uc,this.Kc,this.Pc,this.l,this.Sb,this.Fc,this.$d,this.l,this.Rc,this.Ec,this.Mc,this.l,this.ec,this.Xb,this.l,this.l,this.fc,this.Zb,this.ic,this.l,this.zc,this.Wb,this.kc,this.l,this.dc,this.Tb,this.gc,this.l,this.Kb,this.Yb,this.l,this.l,this.l,this.$b,this.jc,this.l,this.Qb,this.Vb,this.l,this.l,this.l,this.Ub,this.hc,
|
||||
this.l,this.bc,this.Xa,this.l,this.l,this.cc,this.Za,this.wc,this.l,this.yc,this.Wa,this.$c,this.l,this.ac,this.Ta,this.uc,this.l,this.Gb,this.Ya,this.l,this.l,this.l,this.$a,this.xc,this.l,this.Id,this.Va,this.l,this.l,this.l,this.Ua,this.vc,this.l];this.eb=[7,6,0,0,0,3,5,0,3,2,2,0,0,4,6,0,2,5,0,0,0,4,6,0,2,4,0,0,0,4,7,0,3,6,0,0,3,3,5,0,4,2,2,0,4,4,6,0,2,5,0,0,0,4,6,0,2,4,0,0,0,4,7,0,6,6,0,0,0,3,5,0,3,2,2,0,3,4,6,0,2,5,0,0,0,4,6,0,2,4,0,0,0,4,7,0,6,6,0,0,0,3,5,0,4,2,2,0,5,4,6,0,2,5,0,0,0,4,6,0,2,
|
||||
4,0,0,0,4,7,0,0,6,0,0,3,3,3,0,2,0,2,0,4,4,4,0,2,5,0,0,4,4,4,0,2,4,2,0,0,4,0,0,2,6,2,0,3,3,3,0,2,2,2,0,4,4,4,0,2,5,0,0,4,4,4,0,2,4,2,0,4,4,4,0,2,6,0,0,3,3,5,0,2,2,2,0,4,4,6,0,2,5,0,0,0,4,6,0,2,4,0,0,0,4,7,0,2,6,0,0,3,3,5,0,2,2,2,0,4,4,6,0,2,5,0,0,0,4,6,0,2,4,0,0,0,4,7,0]}E(na);e=na.prototype;e.reset=function(a){this.u.$&&M(this);oa(this);this.c=this.a[65532]|this.a[65533]<<8;this.u.ra=!1;a&&(!0===this.ta||null===this.ta&&void 0===this.A.run)&&N(this)};
|
||||
e.J=function(a,b,c){a=!1;switch(b){case "run":this.A[b]=c;c.onclick=function(a){return function(){a.u.$?M(a):N(a)}}(this);a=!0;break;case "A":case "X":case "Y":case "S":case "PC":case "C":case "Z":case "I":case "D":case "B":case "V":case "N":case "speed":this.A[b]=c;a=!0;break;case "setSpeed":this.A[b]=c,c.onclick=function(a){return function(){pa(a,2<=a.speed?a.ja:a.speed+1,!0)}}(this),a=!0}return a};e.Y=function(a,b){this.a=a;(this.Ia=b)?t("unsupported CPU address buffer offset ("+this.Ia+")"):this.N()};
|
||||
e.aa=function(a,b){if(a&&!this.u.H){this.I=b;var c=L(b,"video");c&&(this.Aa=function(a){return function(){qa(a)}}(c),this.ea=function(a){return function(){a.ea()}}(c));this.u.H=!0;this.reset(!0);this.update()}};function ra(a,b,c,d,f){0>sa(a.O,b,c,d,f)&&(a.ka>b&&(a.ka=b),a.la<c&&(a.la=c),a.O.push([b,c,d,f]))}function O(a,b,c,d,f){0>sa(a.K,b,c,d,f)&&(a.Z>b&&(a.Z=b),a.da<c&&(a.da=c),a.K.push([b,c,d,f]))}
|
||||
function sa(a,b,c,d,f){for(var g=0;g<a.length;g++)if(a[g][0]==b&&a[g][1]==c&&a[g][2]==d&&a[g][3]==f)return g;return-1}function pa(a,b,c){void 0!==b&&(a.speed=b,a.A.setSpeed&&(a.A.setSpeed.innerHTML=a.ua[2<=b?0:b+1]),a.F("running at "+a.ua[b].toLowerCase()+" speed "+a.fb[b]),c&&a.ea());a.S=0;a.Fa=q();ta(a)}e.Aa=function(){};e.ea=function(){};function P(a,b,c,d){void 0!==a.A[b]&&(void 0===d&&(d=1),c="0000"+c.toString(16),a.A[b].innerHTML=c.slice(c.length-d).toUpperCase())}
|
||||
function ua(a){P(a,"A",a.g,2);P(a,"X",a.m,2);P(a,"Y",a.s,2);var b=va(a);P(a,"C",b&1?1:0);P(a,"Z",b&2?1:0);P(a,"I",b&4?1:0);P(a,"D",b&8?1:0);P(a,"B",b&16?1:0);P(a,"V",b&64?1:0);P(a,"N",b&128?1:0);P(a,"S",a.o,4);P(a,"PC",a.c,4);a.A.speed&&a.ca&&(a.A.speed.innerHTML=a.ca.toFixed(1)+"Mhz")}
|
||||
function ta(a,b){var c=30;c<a.pa&&(c=a.pa);c<a.oa&&(c=a.oa);var d=1;b&&a.speed>a.ja&&a.ca&&(d=a.ca);d>a.fa&&2>a.speed&&(d=a.fa);a.gb=Math.round(1E3/30);a.ga=Math.floor(1E6/c*d);a.ma=Math.floor(1E6/30*d);a.Ha=Math.floor(1E6/a.pa*d);a.Ga=Math.floor(1E6/a.oa*d);b||(a.R=a.ma,a.U=a.Ha,a.T=a.Ga);a.na=0}function wa(a){1E6<=a.na&&ta(a,!0);a.V=0;a.hb=q()}
|
||||
function xa(a){var b=q(),c=a.gb;a.V&&(c=Math.round(c*a.V/a.ma));c=c-(b-a.hb);if(b=b-a.Fa)a.ca=Math.round(a.S/(100*b))/10,864E5<=b&&pa(a);0>c?c=0:1==a.speed?a.ca<=a.fa&&(c=0):2==a.speed&&(c=0);a.na+=a.V;return c}
|
||||
function N(a){if(ka(a,!0)){a.u.$||(pa(a),a.I&&a.I.start(),a.u.$=!0,a.A.run&&(a.A.run.innerHTML="Halt"),a.ea());wa(a);try{do{a.step(a.ga);var b=a.L-a.G;a.S+=b;a.V+=b;a.L=a.G=0;a.U-=a.ga;0>=a.U&&(a.U+=a.Ha,a.Aa());a.T-=a.ga;0>=a.T&&(a.T+=a.Ga,ua(a));a.R-=a.ga;if(0>=a.R){a.R+=a.ma;break}}while(a.u.$)}catch(c){M(a);a.update();ka(a,!1);la(a,c.stack||c.message);return}setTimeout(function(a){return function(){N(a)}}(a),xa(a))}else a.update(),a.I&&a.I.stop(a.Fa,a.S)}
|
||||
e.step=function(a){this.b=this.j=-1;this.L=this.G=a;do{a=this.a[this.c];this.c++;this.v[a].call(this);if(0<=this.b){if(this.b>=this.ka&&this.b<=this.la)for(var b=this.b,c=this.c,d=0;d<this.O.length;d++)b>=this.O[d][0]&&b<=this.O[d][1]&&this.O[d][3].call(this.O[d][2],b,c);this.b=-1}else if(0<=this.j){if(this.j>=this.Z&&this.j<=this.da)for(b=this.j,c=this.c,d=0;d<this.K.length;d++)b>=this.K[d][0]&&b<=this.K[d][1]&&this.K[d][3].call(this.K[d][2],b,c);this.j=-1}this.G-=this.eb[a]}while(0<this.G);return!0};
|
||||
function M(a){a.u.qa&&(a.u.Ba=!0);a.L-=a.G;a.G=0;a.u.$&&(a.u.$=!1,a.A.run&&(a.A.run.innerHTML="Run"))}e.update=function(){this.Aa();ua(this)};function ya(a){return a.u.$?a.S+a.L-a.G:0}e.W=function(a){return this.a[a]};e.P=function(a,b){this.a[a]=b};function va(a){var b=a.f&256?1:0,b=b|(a.i&255?0:2),b=b|((a.w&255^a.C^a.w>>1)&128?64:0),b=b|(a.h&128?128:0);return a.B&60|b}
|
||||
function Q(a,b,c){var d=a.f&256?1:0,f=(b&15)+(c&15)+d;10<=f&&(f=f+6&15|16);f+=(b&240)+(c&240);a.C=b^c;a.w=f;a.h=f&255;160<=f&&(f+=96);512<=f&&(f-=256);a.f=f;a.i=b+c+d&255;a.G--;return f&255}function R(a,b,c){var d=a.f&256?0:1,f=(b&15)-(c&15)-d;0>f&&(f=(f-6&15)-16);f+=(b&240)-(c&240);0>f&&(f-=96);a.h=a.i=(a.f=b-c-d)&255;a.C=b^c;a.w=a.f;a.f^=256;a.G--;return f&255}function oa(a){a.g=0;a.m=0;a.s=0;a.o=256;a.B=0;a.h=0;a.i=0;a.C=0;a.w=0;a.f=0;a.c=0;a.b=-1;a.j=-1;a.ca=0;a.S=a.L=a.G=0}
|
||||
e.Mb=function(){this.c++;this.a[this.o--]=this.c>>8;this.o|=256;this.a[this.o--]=this.c&255;this.o|=256;this.B|=16;this.B=va(this);this.a[this.o--]=this.B;this.o|=256;this.B&=239;this.b=65534;this.c=this.a[this.b]|this.a[this.b+1]<<8};e.ed=function(){this.b=this.a[this.c++]+this.m&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.h=this.i=this.g|=this.a[this.b]};e.gd=function(){this.b=this.a[this.c++];this.h=this.i=this.g|=this.a[this.b]};
|
||||
e.Cb=function(){this.j=this.a[this.c++];this.f=this.a[this.j]<<1;this.h=this.i=this.a[this.j]=this.f&255};e.kd=function(){this.B=va(this);this.a[this.o--]=this.B;this.o|=256};e.dd=function(){this.b=this.c++;this.h=this.i=this.g|=this.a[this.b]};e.Bb=function(){this.f=this.g<<1;this.h=this.i=this.g=this.f&255};e.ad=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.h=this.i=this.g|=this.a[this.b]};
|
||||
e.zb=function(){this.j=this.a[this.c++]|this.a[this.c++]<<8;this.f=this.a[this.j]<<1;this.h=this.i=this.a[this.j]=this.f&255};e.Lb=function(){this.c+=(this.h&128?0:(this.G--,this.a[this.c]<<24>>24))+1};e.fd=function(){this.b=this.a[this.c++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.s;this.h=this.i=this.g|=this.a[this.b]};e.hd=function(){this.b=this.a[this.c++]+this.m&255;this.h=this.i=this.g|=this.a[this.b]};
|
||||
e.Db=function(){this.j=this.a[this.c++]+this.m&255;this.f=this.a[this.j]<<1;this.h=this.i=this.a[this.j]=this.f&255};e.Pb=function(){this.f=0};e.cd=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.s;this.h=this.i=this.g|=this.a[this.b]};e.bd=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.h=this.i=this.g|=this.a[this.b]};e.Ab=function(){this.j=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.f=this.a[this.j]<<1;this.h=this.i=this.a[this.j]=this.f&255};
|
||||
e.Cc=function(){this.b=this.c++;this.a[this.o--]=this.c>>8;this.o|=256;this.a[this.o--]=this.c&255;this.o|=256;this.c=this.a[this.b]|this.a[this.b+1]<<8};e.vb=function(){this.b=this.a[this.c++]+this.m&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.h=this.i=this.g&=this.a[this.b]};e.Ib=function(){this.b=this.a[this.c++];this.i=this.g&this.a[this.b];this.h=this.h&127|this.a[this.b]&128;this.w=0;this.C=this.a[this.b]&64?128:0};e.xb=function(){this.b=this.a[this.c++];this.h=this.i=this.g&=this.a[this.b]};
|
||||
e.qd=function(){this.j=this.a[this.c++];this.f=this.f&65280|this.a[this.j];this.f<<=1;this.f=this.f&65534|(this.f&512?1:0);this.h=this.i=this.a[this.j]=this.f&255};e.md=function(){this.o=this.o+1&255|256;this.B=this.a[this.o];this.f=this.B&1?256:0;this.i=this.B&2?0:1;this.h=this.B&128;this.w=0;this.C=this.B&64?128:0};e.ub=function(){this.b=this.c++;this.h=this.i=this.g&=this.a[this.b]};
|
||||
e.pd=function(){this.f=this.f&65280|this.g;this.f<<=1;this.f=this.f&65534|(this.f&512?1:0);this.h=this.i=this.g=this.f&255};e.Hb=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.i=this.g&this.a[this.b];this.h=this.h&127|this.a[this.b]&128;this.w=0;this.C=this.a[this.b]&64?128:0};e.rb=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.h=this.i=this.g&=this.a[this.b]};
|
||||
e.nd=function(){this.j=this.a[this.c++]|this.a[this.c++]<<8;this.f=this.f&65280|this.a[this.j];this.f<<=1;this.f=this.f&65534|(this.f&512?1:0);this.h=this.i=this.a[this.j]=this.f&255};e.Jb=function(){this.c+=(this.h&128?(this.G--,this.a[this.c]<<24>>24):0)+1};e.wb=function(){this.b=this.a[this.c++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.s;this.h=this.i=this.g&=this.a[this.b]};e.yb=function(){this.b=this.a[this.c++]+this.m&255;this.h=this.i=this.g&=this.a[this.b]};
|
||||
e.rd=function(){this.j=this.a[this.c++]+this.m&255;this.f=this.f&65280|this.a[this.j];this.f<<=1;this.f=this.f&65534|(this.f&512?1:0);this.h=this.i=this.a[this.j]=this.f&255};e.Hd=function(){this.f=256};e.tb=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.s;this.h=this.i=this.g&=this.a[this.b]};e.sb=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.h=this.i=this.g&=this.a[this.b]};
|
||||
e.od=function(){this.j=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.f=this.f&65280|this.a[this.j];this.f<<=1;this.f=this.f&65534|(this.f&512?1:0);this.h=this.i=this.a[this.j]=this.f&255};e.xd=function(){this.o=this.o+1&255|256;this.B=this.a[this.o];this.f=this.B&1?256:0;this.i=this.B&2?0:1;this.h=this.B&128;this.w=0;this.C=this.B&64?128:0;this.o=this.o+2&255|256;this.c=this.a[this.o-1|256]|this.a[this.o]<<8};
|
||||
e.qc=function(){this.b=this.a[this.c++]+this.m&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.h=this.i=this.g^=this.a[this.b]};e.sc=function(){this.b=this.a[this.c++];this.h=this.i=this.g^=this.a[this.b]};e.Yc=function(){this.j=this.a[this.c++];this.f=this.f&65279|(this.a[this.j]&1?256:0);this.a[this.j]=(this.f=this.f&65280|this.a[this.j]>>1)&255;this.h=this.i=this.f&255};e.jd=function(){this.a[this.o--]=this.g;this.o|=256};e.pc=function(){this.b=this.c++;this.h=this.i=this.g^=this.a[this.b]};
|
||||
e.Xc=function(){this.f=this.f&65279|(this.g&1?256:0);this.g=(this.f=this.f&65280|this.g>>1)&255;this.h=this.i=this.f&255};e.Bc=function(){this.b=this.c;this.c=this.a[this.b]|this.a[this.b+1]<<8};e.mc=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.h=this.i=this.g^=this.a[this.b]};e.Vc=function(){this.j=this.a[this.c++]|this.a[this.c++]<<8;this.f=this.f&65279|(this.a[this.j]&1?256:0);this.a[this.j]=(this.f=this.f&65280|this.a[this.j]>>1)&255;this.h=this.i=this.f&255};
|
||||
e.Nb=function(){this.c+=((this.w&255^this.C^this.w>>1)&128?0:(this.G--,this.a[this.c]<<24>>24))+1};e.rc=function(){this.b=this.a[this.c++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.s;this.h=this.i=this.g^=this.a[this.b]};e.tc=function(){this.b=this.a[this.c++]+this.m&255;this.h=this.i=this.g^=this.a[this.b]};e.Zc=function(){this.j=this.a[this.c++]+this.m&255;this.f=this.f&65279|(this.a[this.j]&1?256:0);this.a[this.j]=(this.f=this.f&65280|this.a[this.j]>>1)&255;this.h=this.i=this.f&255};
|
||||
e.Rb=function(){this.B&=251};e.oc=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.s;this.h=this.i=this.g^=this.a[this.b]};e.nc=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.h=this.i=this.g^=this.a[this.b]};e.Wc=function(){this.j=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.f=this.f&65279|(this.a[this.j]&1?256:0);this.a[this.j]=(this.f=this.f&65280|this.a[this.j]>>1)&255;this.h=this.i=this.f&255};
|
||||
e.yd=function(){this.o=this.o+2&255|256;this.c=(this.a[this.o-1|256]|this.a[this.o]<<8)+1};e.Pa=function(){this.b=this.a[this.c++]+this.m&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.f=this.g+this.a[this.b]+(this.f&256?1:0);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255};e.nb=function(){this.b=this.a[this.c++]+this.m&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.g=Q(this,this.g,this.a[this.b])};
|
||||
e.Ra=function(){this.b=this.a[this.c++];this.f=this.g+this.a[this.b]+(this.f&256?1:0);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255};e.pb=function(){this.b=this.a[this.c++];this.g=Q(this,this.g,this.a[this.b])};e.vd=function(){this.j=this.a[this.c++];this.f=this.f&65280|this.a[this.j];this.f=this.f&65023|(this.f&1?512:0);this.f>>=1;this.h=this.i=this.a[this.j]=this.f&255};e.ld=function(){this.o=this.o+1&255|256;this.h=this.i=this.g=this.a[this.o]};
|
||||
e.Oa=function(){this.b=this.c++;this.f=this.g+this.a[this.b]+(this.f&256?1:0);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255};e.mb=function(){this.b=this.c++;this.g=Q(this,this.g,this.a[this.b])};e.ud=function(){this.f=this.f&65280|this.g;this.f=this.f&65023|(this.f&1?512:0);this.f>>=1;this.h=this.i=this.g=this.f&255};e.Ac=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.c=this.a[this.b]|this.a[this.b+1]<<8};
|
||||
e.La=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.f=this.g+this.a[this.b]+(this.f&256?1:0);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255};e.jb=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.g=Q(this,this.g,this.a[this.b])};e.sd=function(){this.j=this.a[this.c++]|this.a[this.c++]<<8;this.f=this.f&65280|this.a[this.j];this.f=this.f&65023|(this.f&1?512:0);this.f>>=1;this.h=this.i=this.a[this.j]=this.f&255};
|
||||
e.Ob=function(){this.c+=((this.w&255^this.C^this.w>>1)&128?(this.G--,this.a[this.c]<<24>>24):0)+1};e.Qa=function(){this.b=this.a[this.c++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.s;this.f=this.g+this.a[this.b]+(this.f&256?1:0);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255};e.ob=function(){this.b=this.a[this.c++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.s;this.g=Q(this,this.g,this.a[this.b])};
|
||||
e.Sa=function(){this.b=this.a[this.c++]+this.m&255;this.f=this.g+this.a[this.b]+(this.f&256?1:0);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255};e.qb=function(){this.b=this.a[this.c++]+this.m&255;this.g=Q(this,this.g,this.a[this.b])};e.wd=function(){this.j=this.a[this.c++]+this.m&255;this.f=this.f&65280|this.a[this.j];this.f=this.f&65023|(this.f&1?512:0);this.f>>=1;this.h=this.i=this.a[this.j]=this.f&255};e.Jd=function(){this.B|=4};
|
||||
e.Na=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.s;this.f=this.g+this.a[this.b]+(this.f&256?1:0);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255};e.lb=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.s;this.g=Q(this,this.g,this.a[this.b])};e.Ma=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.f=this.g+this.a[this.b]+(this.f&256?1:0);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255};
|
||||
e.kb=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.g=Q(this,this.g,this.a[this.b])};e.td=function(){this.j=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.f=this.f&65280|this.a[this.j];this.f=this.f&65023|(this.f&1?512:0);this.f>>=1;this.h=this.i=this.a[this.j]=this.f&255};e.Nd=function(){this.j=this.a[this.c++]+this.m&255;this.j=this.a[this.j]|this.a[this.j+1]<<8;this.a[this.j]=this.g};e.Vd=function(){this.j=this.a[this.c++];this.a[this.j]=this.s};
|
||||
e.Pd=function(){this.j=this.a[this.c++];this.a[this.j]=this.g};e.Sd=function(){this.j=this.a[this.c++];this.a[this.j]=this.m};e.lc=function(){this.h=this.i=this.s=this.s-1&255};e.ae=function(){this.h=this.i=this.g=this.m};e.Ud=function(){this.j=this.a[this.c++]|this.a[this.c++]<<8;this.a[this.j]=this.s};e.Kd=function(){this.j=this.a[this.c++]|this.a[this.c++]<<8;this.a[this.j]=this.g};e.Rd=function(){this.j=this.a[this.c++]|this.a[this.c++]<<8;this.a[this.j]=this.m};
|
||||
e.Eb=function(){this.c+=(this.f&256?0:(this.G--,this.a[this.c]<<24>>24))+1};e.Od=function(){this.j=this.a[this.c++];this.j=(this.a[this.j]|this.a[this.j+1]<<8)+this.s;this.a[this.j]=this.g};e.Wd=function(){this.j=this.a[this.c++]+this.m&255;this.a[this.j]=this.s};e.Qd=function(){this.j=this.a[this.c++]+this.m&255;this.a[this.j]=this.g};e.Td=function(){this.j=this.a[this.c++]+this.s&255;this.a[this.j]=this.m};e.ce=function(){this.h=this.i=this.g=this.s};
|
||||
e.Md=function(){this.j=(this.a[this.c++]|this.a[this.c++]<<8)+this.s;this.a[this.j]=this.g};e.be=function(){this.o=this.m|256};e.Ld=function(){this.j=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.a[this.j]=this.g};e.Sc=function(){this.b=this.c++;this.h=this.i=this.s=this.a[this.b]};e.Hc=function(){this.b=this.a[this.c++]+this.m&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.h=this.i=this.g=this.a[this.b]};e.Nc=function(){this.b=this.c++;this.h=this.i=this.m=this.a[this.b]};
|
||||
e.Tc=function(){this.b=this.a[this.c++];this.h=this.i=this.s=this.a[this.b]};e.Jc=function(){this.b=this.a[this.c++];this.h=this.i=this.g=this.a[this.b]};e.Oc=function(){this.b=this.a[this.c++];this.h=this.i=this.m=this.a[this.b]};e.Zd=function(){this.h=this.i=this.s=this.g};e.Gc=function(){this.b=this.c++;this.h=this.i=this.g=this.a[this.b]};e.Yd=function(){this.h=this.i=this.m=this.g};e.Qc=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.h=this.i=this.s=this.a[this.b]};
|
||||
e.Dc=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.h=this.i=this.g=this.a[this.b]};e.Lc=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.h=this.i=this.m=this.a[this.b]};e.Fb=function(){this.c+=(this.f&256?(this.G--,this.a[this.c]<<24>>24):0)+1};e.Ic=function(){this.b=this.a[this.c++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.s;this.h=this.i=this.g=this.a[this.b]};e.Uc=function(){this.b=this.a[this.c++]+this.m&255;this.h=this.i=this.s=this.a[this.b]};
|
||||
e.Kc=function(){this.b=this.a[this.c++]+this.m&255;this.h=this.i=this.g=this.a[this.b]};e.Pc=function(){this.b=this.a[this.c++]+this.s&255;this.h=this.i=this.m=this.a[this.b]};e.Sb=function(){this.C=this.w=0};e.Fc=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.s;this.h=this.i=this.g=this.a[this.b]};e.$d=function(){this.h=this.i=this.m=this.o&255};e.Rc=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.h=this.i=this.s=this.a[this.b]};
|
||||
e.Ec=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.h=this.i=this.g=this.a[this.b]};e.Mc=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.s;this.h=this.i=this.m=this.a[this.b]};e.ec=function(){this.b=this.c++;this.h=this.i=this.f=this.s-this.a[this.b];this.f^=256};e.Xb=function(){this.b=this.a[this.c++]+this.m&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.h=this.i=this.f=this.g-this.a[this.b];this.f^=256};
|
||||
e.fc=function(){this.b=this.a[this.c++];this.h=this.i=this.f=this.s-this.a[this.b];this.f^=256};e.Zb=function(){this.b=this.a[this.c++];this.h=this.i=this.f=this.g-this.a[this.b];this.f^=256};e.ic=function(){this.j=this.a[this.c++];this.h=this.i=this.a[this.j]=this.a[this.j]-1&255};e.zc=function(){this.h=this.i=this.s=this.s+1&255};e.Wb=function(){this.b=this.c++;this.h=this.i=this.f=this.g-this.a[this.b];this.f^=256};e.kc=function(){this.h=this.i=this.m=this.m-1&255};
|
||||
e.dc=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.h=this.i=this.f=this.s-this.a[this.b];this.f^=256};e.Tb=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.h=this.i=this.f=this.g-this.a[this.b];this.f^=256};e.gc=function(){this.j=this.a[this.c++]|this.a[this.c++]<<8;this.h=this.i=this.a[this.j]=this.a[this.j]-1&255};e.Kb=function(){this.c+=(this.i&255?(this.G--,this.a[this.c]<<24>>24):0)+1};
|
||||
e.Yb=function(){this.b=this.a[this.c++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.s;this.h=this.i=this.f=this.g-this.a[this.b];this.f^=256};e.$b=function(){this.b=this.a[this.c++]+this.m&255;this.h=this.i=this.f=this.g-this.a[this.b];this.f^=256};e.jc=function(){this.j=this.a[this.c++]+this.m&255;this.h=this.i=this.a[this.j]=this.a[this.j]-1&255};
|
||||
e.Qb=function(){this.B&=-9;this.v[97]=this.Pa;this.v[101]=this.Ra;this.v[105]=this.Oa;this.v[109]=this.La;this.v[113]=this.Qa;this.v[117]=this.Sa;this.v[121]=this.Na;this.v[125]=this.Ma;this.v[225]=this.Xa;this.v[229]=this.Za;this.v[233]=this.Wa;this.v[237]=this.Ta;this.v[241]=this.Ya;this.v[245]=this.$a;this.v[249]=this.Va;this.v[253]=this.Ua};e.Vb=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.s;this.h=this.i=this.f=this.g-this.a[this.b];this.f^=256};
|
||||
e.Ub=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.h=this.i=this.f=this.g-this.a[this.b];this.f^=256};e.hc=function(){this.j=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.h=this.i=this.a[this.j]=this.a[this.j]-1&255};e.bc=function(){this.b=this.c++;this.h=this.i=this.f=this.m-this.a[this.b];this.f^=256};
|
||||
e.Xa=function(){this.b=this.a[this.c++]+this.m&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.f=this.g-this.a[this.b]-(this.f&256?0:1);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255;this.f^=256};e.Dd=function(){this.b=this.a[this.c++]+this.m&255;this.b=this.a[this.b]|this.a[this.b+1]<<8;this.g=R(this,this.g,this.a[this.b])};e.cc=function(){this.b=this.a[this.c++];this.h=this.i=this.f=this.m-this.a[this.b];this.f^=256};
|
||||
e.Za=function(){this.b=this.a[this.c++];this.f=this.g-this.a[this.b]-(this.f&256?0:1);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255;this.f^=256};e.Fd=function(){this.b=this.a[this.c++];this.g=R(this,this.g,this.a[this.b])};e.wc=function(){this.j=this.a[this.c++];this.h=this.i=this.a[this.j]=this.a[this.j]+1&255};e.yc=function(){this.h=this.i=this.m=this.m+1&255};
|
||||
e.Wa=function(){this.b=this.c++;this.f=this.g-this.a[this.b]-(this.f&256?0:1);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255;this.f^=256};e.Cd=function(){this.b=this.c++;this.g=R(this,this.g,this.a[this.b])};e.$c=function(){};e.ac=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.h=this.i=this.f=this.m-this.a[this.b];this.f^=256};
|
||||
e.Ta=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.f=this.g-this.a[this.b]-(this.f&256?0:1);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255;this.f^=256};e.zd=function(){this.b=this.a[this.c++]|this.a[this.c++]<<8;this.g=R(this,this.g,this.a[this.b])};e.uc=function(){this.j=this.a[this.c++]|this.a[this.c++]<<8;this.h=this.i=this.a[this.j]=this.a[this.j]+1&255};e.Gb=function(){this.c+=(this.i&255?0:(this.G--,this.a[this.c]<<24>>24))+1};
|
||||
e.Ya=function(){this.b=this.a[this.c++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.s;this.f=this.g-this.a[this.b]-(this.f&256?0:1);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255;this.f^=256};e.Ed=function(){this.b=this.a[this.c++];this.b=(this.a[this.b]|this.a[this.b+1]<<8)+this.s;this.g=R(this,this.g,this.a[this.b])};
|
||||
e.$a=function(){this.b=this.a[this.c++]+this.m&255;this.f=this.g-this.a[this.b]-(this.f&256?0:1);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255;this.f^=256};e.Gd=function(){this.b=this.a[this.c++]+this.m&255;this.g=R(this,this.g,this.a[this.b])};e.xc=function(){this.j=this.a[this.c++]+this.m&255;this.h=this.i=this.a[this.j]=this.a[this.j]+1&255};
|
||||
e.Id=function(){this.B|=8;this.v[97]=this.nb;this.v[101]=this.pb;this.v[105]=this.mb;this.v[109]=this.jb;this.v[113]=this.ob;this.v[117]=this.qb;this.v[121]=this.lb;this.v[125]=this.kb;this.v[225]=this.Dd;this.v[229]=this.Fd;this.v[233]=this.Cd;this.v[237]=this.zd;this.v[241]=this.Ed;this.v[245]=this.Gd;this.v[249]=this.Bd;this.v[253]=this.Ad};
|
||||
e.Va=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.s;this.f=this.g-this.a[this.b]-(this.f&256?0:1);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255;this.f^=256};e.Bd=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.s;this.g=R(this,this.g,this.a[this.b])};
|
||||
e.Ua=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.f=this.g-this.a[this.b]-(this.f&256?0:1);this.C=this.g^this.a[this.b];this.w=this.f;this.h=this.i=this.g=this.f&255;this.f^=256};e.Ad=function(){this.b=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.g=R(this,this.g,this.a[this.b])};e.vc=function(){this.j=(this.a[this.c++]|this.a[this.c++]<<8)+this.m;this.h=this.i=this.a[this.j]=this.a[this.j]+1&255};
|
||||
e.Xd=function(){var a;a=this.a[this.c++];switch(a){case 0:this.F("HALT");M(this);break;case 1:a=this.c;for(var b="";a<this.a.length;){var c=this.a[a++];if(!c)break;b+=String.fromCharCode(c)}this.c=a;b=b.replace(/%A/g,n(this.g,2)).replace(/%X/g,n(this.m,2)).replace(/%Y/g,n(this.s,2));this.F(b);this.R=0;this.L-=this.G;this.G=0;break;default:this.c-=2,this.F("undefined opSim: 0x"+n(a,2)+" at "+("0x"+n(this.c,4))),M(this)}};
|
||||
e.l=function(){var a=this.a[--this.c];this.F("undefined opcode: 0x"+n(a,2)+" at "+("0x"+n(this.c,4)));M(this)};y(function(){for(var a=I(window.document,"c1pjs","cpu"),b=0;b<a.length;b++){var c=a[b],d=G(c),d=new na(d);H(d,c)}});
|
||||
function S(a){B.call(this,"C1PROM",a);this.b=this.a=null;this.c=a.size;if(this.g=a.image){a=this.g;var b;b=this.g;var c="",d=b.lastIndexOf(".");0<=d&&(c=b.substr(d+1).toLowerCase());b=c;"json"!=b&&"hex"!=b&&(a="http://"+(window?window.location.host:"www.pcjs.org")+"/api/v1/dump?file="+this.g+"&format=bytes");r(a,this,this.i)}}E(S);
|
||||
S.prototype.Y=function(a,b,c,d){this.a=a;this.h=b;a=c-b+1;this.c||(this.c=a);a!=this.c?la(this,"computer-specified ROM size (0x"+n(a,4)+") does not match component-specified size ("+("0x"+n(this.c,4))+")"):(d&&(this.f=d,O(d,b,c,this,this.P)),za(this))};S.prototype.aa=function(a){a&&!this.u.H&&(this.u.H=!0)};S.prototype.P=function(a,b){if(void 0!==b){var c=a-this.h;this.a[this.h+c]=this.b?this.b[c]:0}};
|
||||
S.prototype.i=function(a,b,c){if(c)this.F('Error loading ROM "'+a+'" ('+c+")");else{if("["==b.charAt(0)||"{"==b.charAt(0))try{var d=eval("("+b+")"),f=d.bytes;f?this.b=f:this.b=d}catch(g){this.F('Error processing ROM "'+a+'": '+g.message);return}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),this.b=Array(a.length),b=0;b<a.length;b++)this.b[b]=parseInt(a[b],16);za(this)}};
|
||||
function za(a){if(!J(a))if(!a.g)a.N();else if(a.b&&a.a){var b=a.b.length;if(b!=a.c)la(a,"ROM image size (0x"+n(b,4)+") does not match component-specified size ("+("0x"+n(a.c,4))+")");else{for(var c=0;c<b;c++)a.a[a.h+c]=a.b[c];a.N()}}}y(function(){for(var a=I(window.document,"c1pjs","rom"),b=0;b<a.length;b++){var c=a[b],d=G(c),d=new S(d);H(d,c)}});function Aa(a){B.call(this,"C1PRAM",a)}E(Aa);Aa.prototype.Y=function(a){this.a=a;this.N()};
|
||||
y(function(){for(var a=I(window.document,"c1pjs","ram"),b=0;b<a.length;b++){var c=a[b],d=G(c),d=new Aa(d);H(d,c)}});
|
||||
function Ba(a){B.call(this,"C1PKeyboard",a);this.u.H=!1;this.fa=a.model;this.L=8;this.oa=10;this.na=13;this.O=27;this.la=this.L;this.ma=this.oa;this.ga=this.na;this.K=this.O;this.v=241;this.G=224;this.ja=3;this.ka=15;this.o=1;this.m=[];this.m["break"]=this.G;this.m.esc=this.K;this.m["ctrl-c"]=this.ja;this.m["ctrl-o"]=this.ka;this.b=[];this.b[49]=30464;this.b[33]=30704;this.b[50]=30208;this.b[34]=30448;this.b[51]=29952;this.b[35]=30192;this.b[52]=29696;this.b[36]=29936;this.b[53]=29440;this.b[37]=
|
||||
29680;this.b[54]=29184;this.b[38]=29424;this.b[55]=28928;this.b[39]=29168;this.b[56]=26368;this.b[40]=26608;this.b[57]=26112;this.b[41]=26352;this.b[48]=25856;this.b[58]=25600;this.b[42]=25840;this.b[45]=25344;this.b[61]=25584;this.b[46]=22272;this.b[62]=22512;this.b[108]=22016;this.b[76]=22256;this.b[92]=22256;this.b[111]=21760;this.b[79]=22E3;this.b[this.la]=22E3;this.b[this.ma]=21504;this.b[this.ga]=21248;this.b[119]=18176;this.b[87]=18416;this.b[101]=17920;this.b[69]=18160;this.b[114]=17664;this.b[82]=
|
||||
17904;this.b[116]=17408;this.b[84]=17648;this.b[121]=17152;this.b[89]=17392;this.b[117]=16896;this.b[85]=17136;this.b[105]=16640;this.b[73]=16880;this.b[115]=14080;this.b[83]=14320;this.b[100]=13824;this.b[68]=14064;this.b[102]=13568;this.b[70]=13808;this.b[103]=13312;this.b[71]=13552;this.b[104]=13056;this.b[72]=13296;this.b[106]=12800;this.b[74]=13040;this.b[107]=12544;this.b[75]=12784;this.b[91]=12784;this.b[120]=9984;this.b[88]=10224;this.b[99]=9728;this.b[67]=9968;this.b[118]=9472;this.b[86]=
|
||||
9712;this.b[98]=9216;this.b[66]=9456;this.b[110]=8960;this.b[78]=9200;this.b[94]=9200;this.b[109]=8704;this.b[77]=8944;this.b[93]=8944;this.b[44]=8448;this.b[60]=8688;this.b[113]=5888;this.b[81]=6128;this.b[97]=5632;this.b[65]=5872;this.b[122]=5376;this.b[90]=5616;this.b[32]=5120;this.b[47]=4864;this.b[63]=5104;this.b[59]=4608;this.b[43]=4848;this.b[112]=4352;this.b[80]=4592;this.b[64]=4592;this.b[this.v]=1536;this.b[this.K]=1280;this.b[240]=512;this.b[242]=256;this.b[244]=0;this.reset()}E(Ba);
|
||||
e=Ba.prototype;e.reset=function(){this.sa(this.fa);this.c=this.o;this.S=0;this.g=[this.o,0,0,0,0,0,0,0];this.w=[];if(this.h)for(var a in this.h)isNaN(a)||this.h[a]&&clearTimeout(this.h[a]);this.h=[];this.da=this.i=0;this.T=-1;this.R=this.g;this.V=this.C=0;this.j=""};
|
||||
e.J=function(a,b,c){if(void 0===this.A[b])switch(b){case "keyDown":return this.A[b]=c,c.onkeydown=function(a){return function(b){return Ca(a,b,!0)}}(this),!0;case "keyPress":return this.A[b]=c,c.onkeypress=function(a){return function(b){var c=!0;b=b||window.event;b=b.which||b.keyCode;a.j="";a.c&8?a.c&=-9:c=!T(a,b);return c}}(this),!0;case "keyUp":return this.A[b]=c,c.onkeyup=function(a){return function(b){return Ca(a,b,!1)}}(this),!0;case "break":return this.A[b]=c,c.onclick=function(a){return function(){a.I&&
|
||||
a.I.reset(!0)}}(this),!0;default:if(void 0!==this.m[b])return this.A[b]=c,c.onclick=function(a,b,c){return function(){a.f&&a.f.ea();return!T(a,c)}}(this,b,this.m[b]),!0}return!1};e.Y=function(a,b,c,d){this.a=a;this.Z=b;this.pa=c-b+1;this.ta=this.Z+this.pa;d&&(this.f=d,O(d,b,c,this,this.P));this.N()};e.sa=function(a){this.s=a;this.B=255;600!=this.s&&(this.B=0,this.F("updated keyboard model: "+this.s))};e.aa=function(a,b){a&&!this.u.H&&(this.u.H=!0,this.I=b)};
|
||||
e.N=function(){this.U=(this.ua=u("iOS"))||u("Android");B.prototype.N.call(this)};function Da(a,b){var c=b?100:250;a.f&&a.f.ca&&(c/=a.f.ca);return c}function Ea(a,b){!a.i||void 0!==b&&b==a.i||(clearTimeout(a.h[a.i]),U(a,a.i,!1,4))}function V(a,b,c){a.j=b;Fa(a,c||300)}function Fa(a,b){if(0<a.j.length){var c=a.j.charCodeAt(0);10==c&&(c=13);65<=c&&90>=c&&(c+=32);a.j=a.j.substr(1);T(a,c)}0<a.j.length&&setTimeout(function(a){return function(){Fa(a,b)}}(a),b)}
|
||||
function Ca(a,b,c){var d,f=!c;b=b.keyCode;c&&(a.da=b);16==b?(a.c&=-5,c&&(a.c|=4),b+=224,f=!1):18==b?(a.c&=-3,c&&(a.c|=2),b+=224,f=!1):b==a.v-224?(a.c&=-65,c&&(a.c|=64),b+=224,f=!1):20==b?(c=!c,a.c&=~a.o,c&&(a.c|=a.o),b+=224,f=!1):91==b?(a.c&=-9,c&&(a.c|=8),f=!1,d=!0):d=9==b?f=!1:b==a.O||b==a.L?c?!T(a,b):!1:!0;f&&(a.c&=-9,a.U||b!=a.da||Ea(a));void 0===d&&(d=!U(a,b,c,2));return d}
|
||||
function T(a,b){var c=!1;b==a.G?a.I&&(a.I.reset(!0),c=!0):(a.U&&65<=b&&90>=b&&(b+=32),Ea(a,b),U(a,b,!0,0)&&(a.f.speed==a.f.Ca?U(a,b,!1,1):(c=!1,a.h[b]&&(clearTimeout(a.h[b]),c=!0),c=Da(a,c),a.h[a.i=b]=setTimeout(function(a){return function(){U(a,b,!1,3)}}(a),c)),c=!0));return c}
|
||||
function U(a,b,c,d){var f=!1;c||(a.h[b]=null,a.i==b&&(a.i=0));var g=0,k=a.b[b];void 0===k&&(1<=b&&26>=b&&(b+=64,g=a.v),k=a.b[b]);void 0!==k&&(b=k>>12,f=k>>8&15,g||(g=k&255),c?(a.g[b]|=1<<f,a.g[0]=g==a.v?a.g[0]|64:240==g?a.g[0]|4:242==g?a.g[0]|2:a.g[0]&-71):(a.g[b]&=~(1<<f),a.g[0]&=-71,a.g[0]|=a.c&70),c=0==d&&!a.w.length,a.w.push(a.g.slice()),Ga(a,c),f=!0);return f}e.W=function(){};e.P=function(a){this.S=this.f.W(a)^this.B;this.C++;Ga(this,!1,a)};
|
||||
function Ga(a,b,c){var d=ya(a.f);b||(a.f.speed==a.f.Ca?b=void 0!==c&&32<=a.C:(b=d-a.V,b=0>b||8192<=b));b&&(b=a.w.shift(),void 0!==b&&(a.R=b),a.C=0,a.V=d);for(b=d=0;8>b;b++)a.S&1<<b&&(d|=a.R[b]);d^=a.B;if(void 0!==c)a.a[c]=d;else if(c=a.Z,d!=a.T)for(;c<a.ta;c++)a.a[c]=d;a.T=d}y(function(){for(var a=I(window.document,"c1pjs","keyboard"),b=0;b<a.length;b++){var c=a[b],d=G(c),d=new Ba(d);H(d,c)}});
|
||||
function Ha(a,b,c,d){B.call(this,"C1PVideo",a);this.S=a.model;this.K=a.charCols;this.L=a.charRows;this.U=a.screenWidth;this.V=a.screenHeight;this.i=a.charWidth;this.j=a.charHeight;Ia(this);this.m=b;this.R=c;this.g=d}E(Ha);e=Ha.prototype;e.reset=function(a){this.sa(this.S);if(this.a)for(var b=this.v;b<this.B;b++)this.a[b]=a?Math.floor(256*Math.random()):32};e.J=function(a,b,c){switch(b){case "refresh":return this.A[b]=c,c.onclick=function(a){return function(){Ja(a);qa(a)}}(this),!0}return!1};
|
||||
e.Y=function(a,b,c,d){this.a=a;this.v=b;this.T=c-b+1;this.B=this.v+this.T;d&&(this.f=d,ra(d,56832,56832,this,this.W),O(d,56832,56832,this,this.P));this.reset(!0)};function Ia(a,b,c,d,f){a.o=void 0!==b?b:a.K;a.Z=void 0!==c?c:a.L;a.c=a.o*a.Z;a.B=a.v+a.c;a.I=void 0!==d?d:0;a.O=void 0!==f?f:c;a.C=Math.floor(a.U/a.o);a.G=Math.floor(a.V/a.O)}e.ea=function(){this.m.focus()};
|
||||
e.sa=function(a){this.s=a;600==this.s?(Ia(this,this.K,this.L,3,25),1024==this.c&&this.f&&(this.h=this.B+this.c-1,O(this.f,this.h,this.h,this,this.bb))):(this.F("updated video model: "+this.s),Ia(this,64,32));Ja(this);qa(this)};e.aa=function(a,b){if(a&&!this.u.H&&J(this)){if(this.u.H=!0,this.b=L(b,"keyboard"))this.b.J("canvas","keyDown",this.m),this.b.J("canvas","keyPress",this.m),this.b.J("canvas","keyUp",this.m)}else!a&&this.u.H&&(this.u.H=!1)};
|
||||
e.N=function(){this.i||(this.i=Math.floor(this.g.width/16));this.j||(this.j=Math.floor(this.g.height/16));B.prototype.N.call(this)};e.W=function(a){var b=this.f.W(a);this.f.P(a,b&127|(Math.floor(ya(this.f)/8333)&1?128:0))};e.P=function(){};
|
||||
e.bb=function(a,b){if(void 0!==b){this.sa(540);this.b&&this.b.sa(542);var c=this.f,d=c.K,f=[],g=sa(d,this.h,this.h,this,this.bb);if(0<=g){f.push(d[g][0]);f.push(d[g][1]);d.splice(g,1);for(var k=65536,h=0,g=0;g<d.length;g++)k>d[g][0]&&(k=d[g][0]),h<d[g][1]&&(h=d[g][1]);f.push(k);f.push(h)}4==f.length&&(c.Z=f[2],c.da=f[3])}};function Ja(a){a.w=Array(a.c);for(var b=0;b<=a.c;b++)a.w[b]=-1}
|
||||
function qa(a){var b=0;if(a.u.H)for(;b<a.c;){var c=a.a[a.v+b];if(a.w[b]!=c){var d=Math.floor(b/a.o);if(d>=a.I&&(d-=a.I,d<a.O)){var f=c*a.i;a.R.drawImage(a.g,f%a.g.width,Math.floor(f/a.g.width)*a.j,a.i,a.j,b%a.o*a.C,d*a.G,a.C,a.G)}a.w[b]=c}b++}}
|
||||
y(function(){for(var a=I(window.document,"c1pjs","video"),b=0;b<a.length;b++){var c=a[b],d=G(c),f=window.document.createElement("canvas");if(void 0===f||!f.getContext){c.innerHTML="<br/>Missing <canvas> support. Please try a newer web browser.";break}f.setAttribute("class","c1pjs-canvas");f.setAttribute("width",d.screenWidth);f.setAttribute("height",d.screenHeight);f.setAttribute("contenteditable","true");f.setAttribute("autocapitalize","off");f.setAttribute("autocorrect","off");f.style.backgroundColor=
|
||||
d.screenColor;f.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(f.style.height=(c.clientWidth*d.screenHeight/d.screenWidth|0)+"px",c.onresize=function(a,b,c,d){return function(){b.style.height=(a.clientWidth*d/c|0)+"px"}}(c,f,d.screenWidth,d.screenHeight));c.appendChild(f);var g=new Image,k=f.getContext("2d"),f=new Ha(d,f,k,g);g.onload=function(a){return function(){a.N()}}(f,d.charSet);g.src=d.charSet;H(f,c)}});
|
||||
function Ka(a){B.call(this,"C1PSerialPort",a);this.u.H=!1;this.s=a.demo;this.reset()}E(Ka);e=Ka.prototype;e.reset=function(){if(2!=this.c){this.h=this.j=0;var a=1;if(this.Ea){var b=this.Ea.match(/\d+/);null!==b&&(a=parseInt(b[0],10))}this.g='10 PRINT "HELLO OSI #'+a+'"\n';this.c=this.i=0}};e.start=function(){this.b&&this.s&&(V(this.b," C\n\n",3E3),setTimeout(function(a){return function(){a.c=1;V(a.b,"LOAD\n")}}(this),12E3));this.s=!1};
|
||||
e.J=function(a,b,c){var d=this;switch(b){case "listSerial":return this.A[b]=c,!0;case "loadSerial":return this.A[b]=c,c.onclick=function(){d.A.listSerial&&r(d.A.listSerial.value,d,d.Ja)},!0;case "mountSerial":return!u("Mobi")&&window&&"FileReader"in window?(this.A[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){var b=a.currentTarget[1].files[0],c=new FileReader;c.onload=function(){d.Ja(b.name,c.result.toString(),
|
||||
0)};c.readAsText(b);return!1}):c.parentNode.removeChild(c),!0}return!1};e.Y=function(a,b,c,d){this.a=a;this.m=b;this.v=c-b+1;this.o=this.m+this.v;if(this.f=d)ra(d,b,c,this,this.W),O(d,b,c,this,this.P);this.N()};e.aa=function(a,b){a&&!this.u.H&&(this.u.H=!0,this.I=b,this.b=L(b,"keyboard"))};
|
||||
e.Ja=function(a,b,c){b?(this.g=b,this.c=this.i=0,this.I&&this.b&&this.f.u.$?(this.F("auto-loading "+a),this.f.ea(),"."!=this.g.charAt(0)?(this.c=1,V(this.b,"NEW\nLOAD\n")):(this.c=2,this.I.reset(!0),V(this.b,"ML"))):this.F(a+" ready to load")):this.F(a+" load error ("+c+")")};e.W=function(a,b){void 0!==b&&(a&1?La(this):this.g&&!this.i&&La(this))};e.P=function(){};
|
||||
function La(a){if(void 0!==a.g){a.j=0;a.h=0;if(a.i<a.g.length){var b=a.g.charCodeAt(a.i++);10==b&&(b=13);a.j=b;a.h=1}else 1==a.c&&a.b&&V(a.b," \nRUN\n"),a.c=0;for(b=a.m+0;b<a.o;b+=2)a.a[b]=a.h?1:0;for(b=a.m+1;b<a.o;b+=2)a.a[b]=a.h?a.j:0}}y(function(){for(var a=I(window.document,"c1pjs","serial"),b=0;b<a.length;b++){var c=a[b],d=G(c),d=new Ka(d);H(d,c)}});function Ma(a){B.call(this,"C1PDiskController",a);this.u.H=!1;this.reset(!0)}E(Ma);e=Ma.prototype;
|
||||
e.reset=function(a){Na(this);this.b=-1;a&&(this.c=[],this.c[0]={de:0,Ka:40,cb:!0,ia:20,ba:0,ha:-1,va:[]})};
|
||||
function Na(a){a.v={D:64,X:function(){},update:function(a){return function(c){void 0!==c&&(this.D=c);a.j.D&4||W(a,0,this)}}(a)};a.g={D:255,X:function(){this.update()},update:function(a){return function(c){void 0===c?c=a.g.D:Oa(a,c,a.i.D);c=(c|190)&-2;if(0<=a.b&&a.c[a.b].va.length){var d=a.c[a.b];d.cb&&(c&=-33);d.ba||(c&=-3);10>=--d.ia&&(0<d.ia?(c&=-129,Pa(a)):(d.ia=100,0<=a.b&&(a.c[a.b].ha=0,Qa(a))))}this.D=c;a.j.D&4&&W(a,0,this)}}(a)};a.j={D:0,X:function(){},update:function(a){return function(c){void 0!==
|
||||
c&&(this.D=c&-193);W(a,1,this);a.g.update();a.v.update()}}(a)};a.w={D:255,X:function(){},update:function(a){return function(c){void 0!==c&&(this.D=c);a.m.D&4||W(a,2,this)}}(a)};a.i={D:255,X:function(){},update:function(a){return function(c){void 0===c?c=a.i.D:Oa(a,a.g.D,c);if(0<=a.b&&a.b<a.c.length){var d=a.c[a.b];d.va.length&&a.i.D&8&&!(c&8)&&(c&4?d.ba--:d.ba++,d.ba>=d.Ka&&(d.ba=d.Ka),0>d.ba&&(d.ba=0),d.ia=20,a.g.update(a.g.D|128),Pa(a))}this.D=c;a.m.D&4&&W(a,2,this)}}(a)};a.m={D:0,X:function(){},
|
||||
update:function(a){return function(c){void 0!==c&&(this.D=c&-193);W(a,3,this);a.i.update();a.w.update()}}(a)};a.B={D:0,X:function(){},update:function(a){return function(c){void 0!==c&&(3==(c&3)&&(a.h.D=14),this.D=c);a.h.update()}}(a)};a.h={D:14,X:function(){},update:function(a){return function(c){void 0===c&&(c=a.h.D);c&=-2;0<=a.b&&0<=a.c[a.b].ha&&(c|=1);this.D=c;W(a,16,this)}}(a)};a.o={D:0,X:function(a){return function(){Qa(a)}}(a),update:function(a){return function(c){void 0!==c&&(this.D=c);W(a,
|
||||
17,this)}}(a)};a.C={D:0,X:function(){},update:function(){return function(){}}(a)}}e.J=function(a,b,c){switch(b){case "listDisk":return this.A[b]=c,!0;case "loadDisk":return this.A[b]=c,c.onclick=function(a){return function(){if(a.A.listDisk){var b=a.A.listDisk.value,c=b;".json"!=b.substr(b.length-5)&&(c="http://"+window.location.host+"/api/v1/dump?disk="+b);a.F("loading "+aa(b)+"...");r(c,a,a.ib)}}}(this),!0}return!1};
|
||||
e.Y=function(a,b,c,d){this.a=a;this.s=b;if(this.f=d)ra(d,b,c,this,this.W),O(d,b,c,this,this.P);this.N()};e.aa=function(a){a&&!this.u.H&&(this.u.H=!0)};
|
||||
e.ib=function(a,b,c){if(c)this.F("disk load error ("+c+")");else{c=[];this.F("mounting "+a+"...");try{if(c=eval("("+b+")"),c.length)if(c[0].length){var d=c[0];if(void 0===d[0].trackNum)this.F("data error: "+d[0]);else if(this.c[0]){for(b=0;b<d.length;b++){var f,g=d[b],k=g.sectors;if(void 0===(f=g.trackNum)||void 0===k)throw Error("track "+b+" missing data");f!=b&&t("track "+f+" out of order (expected "+b+")");c=[];var h,l,m;if(f){Ra(c,g,"trackSig");Sa(c,g);X(c,g,"trackType");for(var p=0;p<k.length;p++){h=
|
||||
k[p];l=h.sectorData;X(c,h,"sectorSig");X(c,h,"sectorNum");X(c,h,"sectorPages");for(m=0;m<l.length;m++)c.push(l[m]);Ra(c,h,"sectorEndSig")}}else for(h=k[0],l=h.sectorData,X(c,g,"trackLoad",2),X(c,h,"sectorPages"),m=0;m<l.length;m++)c.push(l[m]);d[f].ab=c}this.c[0].va=d;this.F("mount of "+a+" complete")}else this.F("no available drives")}else this.F("no tracks: "+a);else this.F("no data: "+a)}catch(D){this.F("disk data error: "+D.message)}}};
|
||||
function Sa(a,b){var c=b.trackNum;if(void 0===c)throw Error("missing bcd value: trackNum");a.push(Math.floor(c/10)<<4|c%10)}function X(a,b,c,d){b=b[c];if(void 0===b)throw Error("missing binary value: "+c);2==d&&a.push(b>>8&255);a.push(b&255)}function Ra(a,b,c){b=b[c];if(void 0===b)throw Error("missing signature: "+c);for(c=0;c<b.length;c++)a.push(b.charCodeAt(c))}
|
||||
function Ta(a,b,c){b&=63;16>b?b&=3:32>b&&(b&=17);switch(b){case 0:a=a.j.D&4?a.g:a.v;break;case 1:a=a.j;break;case 2:a=a.m.D&4?a.i:a.w;break;case 3:a=a.m;break;case 16:a=c?a.B:a.h;break;case 17:a=a.o;break;default:a=a.C}return a}e.W=function(a,b){void 0!==b&&Ta(this,a-this.s,!1).X()};e.P=function(a,b){if(void 0!==b){var c=this.f.W(a);Ta(this,a-this.s,!0).update(c)}};function Oa(a,b,c){var d=-1;void 0!==b&&void 0!==c&&(d=0,c&32||(d|=2),a.g.D&64||(d|=1));a.b!=d&&(a.b=d,a.h.update())}
|
||||
function Pa(a){0<=a.b&&(a.c[a.b].ha=-1,a.o.update(255),a.h.update())}function Qa(a){var b=null;if(0<=a.b){var b=a.c[a.b],c=b.va[b.ba];void 0!==c&&(0<=b.ha&&b.ha<c.ab.length?(b.ia=100,b=c.ab[b.ha++],a.o.update(b),a.h.update()):(b.ia=10,Pa(a)))}}function W(a,b,c){a.f.P(b+a.s,c.D)}y(function(){for(var a=I(window.document,"c1pjs","disk"),b=0;b<a.length;b++){var c=a[b],d=G(c),d=new Ma(d);H(d,c)}});function Y(a,b){B.call(this,"C1PComputer",a);this.M=b}E(Y);
|
||||
Y.prototype.reset=function(a){var b=null,c;for(c in this.M)for(var d=0;d<this.M[c].length;d++){var f=this.M[c][d];f&&f.reset&&(f.reset(),"cpu"==c&&(b=f))}b&&(b.update(),a&&N(b))};Y.prototype.start=function(){for(var a in this.M)if("cpu"!=a)for(var b=0;b<this.M[a].length;b++){var c=this.M[a][b];c&&c.start&&c.start()}};Y.prototype.stop=function(a,b){for(var c in this.M)if("cpu"!=c)for(var d=0;d<this.M[c].length;d++){var f=this.M[c][d];f&&f.stop&&f.stop(a,b)}};
|
||||
Y.prototype.J=function(a,b,c){switch(b){case "reset":return this.A[b]=c,c.onclick=function(a){return function(){a.reset()}}(this),!0}return!1};function L(a,b){return a.M[b]?a.M[b][0]:null}function Ua(a){var b=null,c;for(c in a.M)for(var d=0;d<a.M[c].length;d++){var f=a.M[c][d];if(f){if(!J(f)){J(f,function(a){return function(){Ua(a)}}(a));return}"cpu"==c?b=f:f.aa&&f.aa(!0,a)}}a.N();a.F("C1Pjs v1.19.3\nCopyright \u00a9 2012-2015 Jeff Parsons <Jeff@pcjs.org>");b&&b.aa(!0,a)}
|
||||
y(function(){for(var a=I(window.document,"c1pjs","computer"),b=0;b<a.length;b++){for(var c=a[b],d=G(c),f,g={},k,h=0,l=0,m=0;m<d.modules.length;m++){var p=d.modules[m];if(!m){if("cpu"!=p.type)break;h=p.start;l=p.end;k=Array(l+1-h);for(f=h;f<k.length;f++)k[f]=0}if(f=F(p.refID,d.id)){var D=p.type;void 0===g[D]&&(g[D]=[]);g[D].push(f);f.Y&&void 0!==p.start&&f.Y(k,p.start,p.end,g.cpu[0])}else{t('no component for <module refid="'+p.refID+'">');return}}if(void 0===k){t('<module type="cpu"> definition must appear first in the <computer> specification');
|
||||
break}if(f=F("debugger",d.id))g["debugger"]=[f],f.Y&&f.Y(k,h,l,g.cpu[0]);h=new Y(d,g);if(l=F("panel",d.id))if(g.panel=[l],l.za){f=d.id;d=void 0;g=[];f&&(f=0<(d=f.indexOf("."))?f.substr(0,d+1):"");for(d=0;d<C.length;d++)m=C[d],f&&m.id.indexOf(f)||g.push(m);d=g;for(g=0;g<d.length;g++)f=d[g],f!=l&&(f.xa=l.xa,f.F=l.F,f.za=l.za)}H(h,c);Ua(h)}});var Z=0;function Va(a,b,c,d,f,g){f("Loading "+a+"...");r(a,null,function(k,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),g(h,null)):Wa(h,a,b,c,d,f,g)})}
|
||||
function Wa(a,b,c,d,f,g,k){function h(a,g){if(g)k(g,null);else{if(c){var h=b;h&&0>h.indexOf("/")&&(h=window.location.pathname+h);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" state=$2"+d+"$2":"")+(h?" url=$2"+h+"$2":""))}h=null;if("<"==a.charAt(0))try{f||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(h=new window.ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(a)):h=(new window.DOMParser).parseFromString(a,"text/xml")}catch(D){h=
|
||||
null,a=D.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);k(a,h)}}a?f?Xa(a,g,h):h(a,null):k("no data"+(b?" for file: "+b:""),null)}
|
||||
function Xa(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var f=d[2];b("Loading "+f+"...");r(f,null,function(g,k,h){if(h||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(g=d[3])if(h=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(g);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(k=k.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+f);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],k);Xa(a,b,c)}})}else c(a,null)}
|
||||
function Ya(a,b,c){function d(a){if(void 0===k){var b=g&&I(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=ca(a))}function f(a){d("Error: "+a);h&&(--Z||A(!0));h=!1}var g,k,h=!0;Z++;try{if(g=window.document.getElementById(a)){c||(c="/versions/c1pjs/1.19.3/components.xsl");var l=function(h,k){if(k){var l=function(h,l){if(l)if(l)if(d("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var m=k.transformNode(l);m?(g.outerHTML=m,--Z||A(!0)):f("transformNodeToObject failed")}else window.document.implementation&&
|
||||
window.document.implementation.createDocument?(m=new XSLTProcessor,m.importStylesheet(l),(m=m.transformToFragment(k,window.document))?g.parentNode?(g.parentNode.replaceChild(m,g),--Z||A(!0)):f("invalid machine element: "+a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f("failed to load XSL file: "+c);else f(h)};k?Va(c,null,null,!1,d,l):f("failed to load XML file: "+b)}else f(h)};"<"!=b.charAt(0)?Va(b,a,void 0,!0,d,l):Wa(b,null,a,void 0,!1,d,l)}else f("missing machine element: "+
|
||||
a)}catch(m){f(m.message)}return h}window.embedC1P=function(a,b,c){A(!1);return Ya(a,b,c)};window.enableEvents=A;window.sendEvent=ea;})();
|
||||
262
versions/c1pjs/1.19.3/common.css
Normal file
262
versions/c1pjs/1.19.3/common.css
Normal file
|
|
@ -0,0 +1,262 @@
|
|||
@CHARSET "UTF-8";
|
||||
/**
|
||||
@author Jeff Parsons (@jeffpar)
|
||||
@website http://www.pcjs.org/
|
||||
@created 2013-05-05
|
||||
@modified 2014-02-23
|
||||
@license http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
body {
|
||||
margin: 0;
|
||||
background: #202020;
|
||||
}
|
||||
h1, h2 {
|
||||
margin-top: 0;
|
||||
color: #cccccc;
|
||||
}
|
||||
h1, h2, h3, h4 {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
h4 a {
|
||||
color: #cccccc !important;
|
||||
}
|
||||
p {
|
||||
line-height: 1.5em;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
a img {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
pre, code {
|
||||
color: #000000;
|
||||
background-color: #cccccc;
|
||||
font-family: Monaco, Consolas, "Lucida Console", monospace;
|
||||
font-size: 12px;
|
||||
}
|
||||
pre {
|
||||
margin: 1em 2em;
|
||||
padding: 1em;
|
||||
border-radius: 5px;
|
||||
overflow: auto;
|
||||
}
|
||||
code {
|
||||
padding: 1px;
|
||||
}
|
||||
pre a, code a {
|
||||
color: #006400 !important;
|
||||
}
|
||||
.common {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
color: #cccccc;
|
||||
}
|
||||
.common a {
|
||||
|
||||
color: #7fc07f;
|
||||
text-decoration: none;
|
||||
}
|
||||
.common hr {
|
||||
border-color: #808080;
|
||||
}
|
||||
.common a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.common, .machine {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
|
||||
font-size: 15px;
|
||||
}
|
||||
.machine {
|
||||
margin: 15px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.c1pjs {
|
||||
overflow: visible;
|
||||
}
|
||||
.machine-placeholder {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
.common-top {
|
||||
background: #202020;
|
||||
font-size: small;
|
||||
}
|
||||
.common-top-left {
|
||||
float: left;
|
||||
width: 60%;
|
||||
}
|
||||
.common-top-left ul {
|
||||
line-height: 1.5em;
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 1em 1em 1em 9px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.common-top-left ul li {
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
.common-top-left ul li a {
|
||||
border-right: 1px solid #6f6f6f;
|
||||
padding: 2px 6px 2px 6px;
|
||||
}
|
||||
.common-top-left ul li:last-child a {
|
||||
border-right: none;
|
||||
}
|
||||
.common-top-right {
|
||||
float: right;
|
||||
width: 40%;
|
||||
}
|
||||
.common-top-right p {
|
||||
float: right;
|
||||
margin: 0;
|
||||
padding: 1em;
|
||||
}
|
||||
.common-middle {
|
||||
clear: both;
|
||||
padding: 1px 1em 1px 1em;
|
||||
background: #404040;
|
||||
}
|
||||
.common-sidebar {
|
||||
float: left;
|
||||
font-size: small;
|
||||
width: 140px;
|
||||
padding-bottom: 20px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.common-list {
|
||||
list-style-type: none;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
.common-list li {
|
||||
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
.common-list-data {
|
||||
list-style-type: none;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
.common-list-data li {
|
||||
line-height: 1.5em;
|
||||
}
|
||||
.common-list-data-items, .common-list-data-subitems {
|
||||
font-size: x-small;
|
||||
list-style-type: none;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding-left: 2em;
|
||||
}
|
||||
.common-list-data-items li, .common-list-data-subitems li {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.common-main {
|
||||
margin-left: 150px;
|
||||
|
||||
}
|
||||
.common-image-gallery {
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
.common-image-gallery:after {
|
||||
content: '';
|
||||
display: block;
|
||||
}
|
||||
.common-image-frame {
|
||||
display: inline-block;
|
||||
margin: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
.common-image-link {
|
||||
padding: 5px;
|
||||
border: 1px solid black;
|
||||
border-radius: 5px;
|
||||
background-color: #FAEBD7;
|
||||
}
|
||||
.common-image-label {
|
||||
font-size: x-small;
|
||||
}
|
||||
.common-bottom {
|
||||
clear: both;
|
||||
padding-top: 1em;
|
||||
}
|
||||
.common-bottom:after {
|
||||
content: '';
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
.common-reference {
|
||||
float: left;
|
||||
font-size: x-small;
|
||||
}
|
||||
.common-reference a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.common-copyright {
|
||||
float: right;
|
||||
font-size: x-small;
|
||||
}
|
||||
.common-copyright a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.md-list {
|
||||
}
|
||||
.md-list li {
|
||||
line-height: 1.5em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.md-list li p {
|
||||
padding-left: 2em;
|
||||
}
|
||||
.md-list-compact {
|
||||
}
|
||||
.md-list-compact li {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.md-list-none {
|
||||
list-style-type: none;
|
||||
padding-left: 2em;
|
||||
}
|
||||
.md-list-none li {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
@media screen and (max-width: 900px) {
|
||||
|
||||
.common-sidebar {
|
||||
width: 100%;
|
||||
white-space: normal;
|
||||
}
|
||||
.common-list {
|
||||
padding-left: 0;
|
||||
}
|
||||
.common-list-data {
|
||||
padding-left: 0;
|
||||
}
|
||||
.common-sidebar h4, .common-list li, .common-list-data li, .common-list-data-items li {
|
||||
width: 130px;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
vertical-align: top;
|
||||
padding-right: 1em;
|
||||
margin-top: 0;
|
||||
}
|
||||
.common-list-data-subitems {
|
||||
display: none;
|
||||
}
|
||||
.common-main {
|
||||
clear: both;
|
||||
margin-left: 0;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
.md-list-none {
|
||||
padding-left: 1em;
|
||||
}
|
||||
}
|
||||
46
versions/c1pjs/1.19.3/common.xsl
Normal file
46
versions/c1pjs/1.19.3/common.xsl
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2014-02-23" license="http://www.gnu.org/licenses/gpl.html" -->
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
<!ENTITY nbsp " "> <!ENTITY ne "≠"> <!ENTITY le "≤"> <!ENTITY ge "≥">
|
||||
<!ENTITY times "×"> <!ENTITY sdot "⋅"> <!ENTITY divide "÷">
|
||||
<!ENTITY copy "©"> <!ENTITY Sigma "Σ"> <!ENTITY sigma "σ"> <!ENTITY sum "∑"> <!ENTITY lbrace "{">
|
||||
]>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:template name="commonStyles">
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="shortcut icon" href="/versions/images/current/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/versions/c1pjs/1.19.3/common.css"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="commonTop">
|
||||
<div class="common-top">
|
||||
<div class="common-top-left">
|
||||
<ul>
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/apps/pc/">Apps</a></li>
|
||||
<li><a href="/disks/pc/">Disks</a></li>
|
||||
<li><a href="/devices/pc/machine/">Machines</a></li>
|
||||
<li><a href="/docs/">Docs</a></li>
|
||||
<li><a href="/pubs/">Pubs</a></li>
|
||||
<li><a href="/blog/">Blog</a></li>
|
||||
<li><a href="/docs/about/">About</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="common-top-right">
|
||||
<p>Powered by <a href="http://nodejs.org" target="_blank">Node.js</a> and <a href="http://aws.amazon.com/elasticbeanstalk/" target="_blank">AWS</a> | <a href="http://github.com/jeffpar/pcjs" target="_blank">GitHub</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="commonBottom">
|
||||
<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> website © 2012-2015 by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
|
||||
<span class="common-copyright">PCjs and C1Pjs released under <a href="http://gnu.org/licenses/gpl.html">GPL version 3 or later</a></span>
|
||||
</p>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
106
versions/c1pjs/1.19.3/components.css
Normal file
106
versions/c1pjs/1.19.3/components.css
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
@CHARSET "UTF-8";
|
||||
|
||||
|
||||
*:not(input,textarea) {
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
.c1pjs-embed {
|
||||
}
|
||||
.c1pjs-embed:after {
|
||||
clear:both;
|
||||
}
|
||||
.c1pjs-name {
|
||||
clear: both;
|
||||
font-weight: bold;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
.c1pjs-canvas {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.c1pjs-container {
|
||||
color: #000000;
|
||||
position: relative;
|
||||
}
|
||||
.c1pjs-label {
|
||||
font-size: small;
|
||||
line-height: 19px;
|
||||
vertical-align: middle;
|
||||
float: left;
|
||||
font-family: "Lucida Console", monospace;
|
||||
}
|
||||
.c1pjs-control textarea {
|
||||
font-family: Monaco, monospace;
|
||||
font-size: x-small;
|
||||
}
|
||||
.c1pjs-fieldset {
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.c1pjs-flag {
|
||||
font-family: "Lucida Console", monospace;
|
||||
font-size: small;
|
||||
text-align: center;
|
||||
line-height: 19px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.c1pjs-register {
|
||||
font-family: "Lucida Console", monospace;
|
||||
font-size: small;
|
||||
text-align: center;
|
||||
line-height: 19px;
|
||||
vertical-align: middle;
|
||||
border: 1px solid black;
|
||||
}
|
||||
.c1pjs-switches {
|
||||
float: left;
|
||||
}
|
||||
.c1pjs-bitBucket {
|
||||
float: left;
|
||||
width: 19px;
|
||||
height: 38px;
|
||||
}
|
||||
.c1pjs-bitCell {
|
||||
float: left;
|
||||
width: 19px;
|
||||
height: 19px;
|
||||
margin-right: -1px;
|
||||
margin-bottom: -1px;
|
||||
border: 1px solid black;
|
||||
text-align: center;
|
||||
line-height: 19px;
|
||||
}
|
||||
.c1pjs-bitCellLeft {
|
||||
border-left: 1px solid black;
|
||||
}
|
||||
.c1pjs-bitLabel {
|
||||
font-size: xx-small;
|
||||
text-align: center;
|
||||
}
|
||||
.c1pjs-description, .c1pjs-status {
|
||||
font-size: small;
|
||||
line-height: 2em;
|
||||
}
|
||||
.c1pjs-key {
|
||||
border: 1px solid black;
|
||||
font-size: x-small;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.c1pjs-reference {
|
||||
float: left;
|
||||
font-size: x-small;
|
||||
}
|
||||
.c1pjs-reference a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.c1pjs-copyright {
|
||||
float: right;
|
||||
font-size: x-small;
|
||||
}
|
||||
.c1pjs-copyright a {
|
||||
text-decoration: none;
|
||||
}
|
||||
572
versions/c1pjs/1.19.3/components.xsl
Normal file
572
versions/c1pjs/1.19.3/components.xsl
Normal file
|
|
@ -0,0 +1,572 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2013-01-29" license="http://www.gnu.org/licenses/gpl.html" -->
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
]>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:param name="rootDir" select="''"/>
|
||||
<xsl:param name="generator" select="'client'"/>
|
||||
|
||||
<xsl:variable name="MACHINECLASS">c1p</xsl:variable>
|
||||
<xsl:variable name="APPCLASS">c1pjs</xsl:variable>
|
||||
<xsl:variable name="APPVERSION">1.19.3</xsl:variable>
|
||||
<xsl:variable name="SITEHOST">www.pcjs.org</xsl:variable>
|
||||
|
||||
<xsl:template name="componentStyles">
|
||||
<link rel="stylesheet" type="text/css" href="/versions/{$APPCLASS}/{$APPVERSION}/components.css"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="componentScripts">
|
||||
<xsl:param name="component"/>
|
||||
<script type="text/javascript" src="/versions/{$APPCLASS}/{$APPVERSION}/{$component}.js"></script>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="componentIncludes">
|
||||
<xsl:param name="component"/>
|
||||
<xsl:call-template name="componentScripts"><xsl:with-param name="component" select="$component"/></xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="machine[@ref]">
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/machine"><xsl:with-param name="machine" select="@id"/></xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="machine[not(@ref)]">
|
||||
<xsl:param name="machine"><xsl:value-of select="@id"/></xsl:param>
|
||||
<div id="{$machine}" class="machine {@class}js">
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="component" select="'machine'"/>
|
||||
<xsl:with-param name="class"><xsl:value-of select="@class"/>js</xsl:with-param>
|
||||
<xsl:with-param name="parms"><xsl:if test="@parms">,<xsl:value-of select="@parms"/></xsl:if></xsl:with-param>
|
||||
<xsl:with-param name="url"><xsl:value-of select="@url"/></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="component[@ref]">
|
||||
<xsl:param name="machine"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/component"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="component[not(@ref)]">
|
||||
<xsl:param name="machine"/>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class" select="@class"/>
|
||||
<xsl:with-param name="parms"><xsl:if test="@parms">,<xsl:value-of select="@parms"/></xsl:if></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="component">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:param name="component" select="name(.)"/>
|
||||
<xsl:param name="class" select="''"/>
|
||||
<xsl:param name="parms" select="''"/>
|
||||
<xsl:param name="url" select="''"/>
|
||||
<xsl:variable name="id">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$component = 'machine'"><xsl:value-of select="$machine"/>.machine</xsl:when>
|
||||
<xsl:when test="$machine != ''"><xsl:value-of select="$machine"/><xsl:if test="@id">.<xsl:value-of select="@id"/></xsl:if></xsl:when>
|
||||
<xsl:when test="@id"><xsl:value-of select="@id"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="name">
|
||||
<xsl:choose>
|
||||
<xsl:when test="name"><xsl:value-of select="name"/></xsl:when>
|
||||
<xsl:when test="@name"><xsl:value-of select="@name"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="border">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@border = '1'">border:1px solid black;border-radius:10px;</xsl:when>
|
||||
<xsl:when test="@border">border:<xsl:value-of select="@border"/>;</xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="left">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@left">left:<xsl:value-of select="@left"/>;</xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="top">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@top">top:<xsl:value-of select="@top"/>;</xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="width">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@width">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$left != '' or $top != ''">width:<xsl:value-of select="@width"/>;</xsl:when>
|
||||
<xsl:otherwise>width:auto;max-width:<xsl:value-of select="@width"/>;</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="height">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@height">height:<xsl:value-of select="@height"/>;</xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="padding">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@padding">padding:<xsl:value-of select="@padding"/>;</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="@padtop">padding-top:<xsl:value-of select="@padtop"/>;</xsl:if>
|
||||
<xsl:if test="@padright">padding-right:<xsl:value-of select="@padright"/>;</xsl:if>
|
||||
<xsl:if test="@padbottom">padding-bottom:<xsl:value-of select="@padbottom"/>;</xsl:if>
|
||||
<xsl:if test="@padleft">padding-left:<xsl:value-of select="@padleft"/>;</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="pos">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@pos = 'left'">float:left;</xsl:when>
|
||||
<xsl:when test="@pos = 'right'">float:right;</xsl:when>
|
||||
<xsl:when test="@pos = 'center'">margin:0 auto;</xsl:when>
|
||||
<xsl:when test="@pos">position:<xsl:value-of select="@pos"/>;</xsl:when>
|
||||
<xsl:when test="$left != '' or $top != ''">position:absolute;</xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="style">
|
||||
<xsl:if test="$component = 'machine'">overflow:auto;width:100%;</xsl:if>
|
||||
<xsl:if test="@background">background-color:<xsl:value-of select="@background"/>;</xsl:if>
|
||||
<xsl:if test="@style"><xsl:value-of select="@style"/></xsl:if>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="componentClass">
|
||||
<xsl:value-of select="$APPCLASS"/><xsl:text>-</xsl:text><xsl:value-of select="$component"/><xsl:text> </xsl:text><xsl:value-of select="$APPCLASS"/><xsl:text>-component</xsl:text>
|
||||
</xsl:variable>
|
||||
<div id="{$id}" class="{$componentClass}" style="{$width}{$height}{$pos}{$left}{$top}{$padding}">
|
||||
<xsl:if test="$component = 'machine'">
|
||||
<xsl:apply-templates select="name" mode="machine"/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$component != 'machine'">
|
||||
<xsl:apply-templates select="name" mode="component"/>
|
||||
</xsl:if>
|
||||
<div class="{$APPCLASS}-container" style="{$border}{$style}">
|
||||
<xsl:if test="$class != '' and $component != 'machine'">
|
||||
<div class="{$APPCLASS}-{$class}-object" data-value="id:'{$id}',name:'{$name}'{$parms}"></div>
|
||||
</xsl:if>
|
||||
<xsl:if test="control">
|
||||
<div class="{$APPCLASS}-controls">
|
||||
<xsl:apply-templates select="control" mode="component"/>
|
||||
</div>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
</div>
|
||||
<xsl:if test="$component = 'machine'">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$url != ''"><div class="{$APPCLASS}-reference">[<a href="{$url}">XML</a>]</div></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
<div class="{$APPCLASS}-copyright">
|
||||
<a href="http://{$SITEHOST}/{$APPCLASS}" target="_blank">C1Pjs</a> v<xsl:value-of select="$APPVERSION"/> © 2012-2015 by <a href="http://twitter.com/jeffpar" target="_blank">@jeffpar</a>
|
||||
</div>
|
||||
<div style="clear:both"></div>
|
||||
</xsl:if>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="name" mode="machine">
|
||||
<xsl:variable name="pos">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@pos = 'center'">text-align:center;</xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<h2 style="{$pos}"><xsl:apply-templates/></h2>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="name" mode="component">
|
||||
<div class="{$APPCLASS}-name"><xsl:apply-templates/></div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="control" mode="component">
|
||||
<xsl:variable name="type">
|
||||
type:'<xsl:value-of select="@type"/>'
|
||||
</xsl:variable>
|
||||
<xsl:variable name="binding">
|
||||
binding:'<xsl:value-of select="@binding"/>'
|
||||
</xsl:variable>
|
||||
<xsl:variable name="border">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@border = '1'">border:1px solid black;</xsl:when>
|
||||
<xsl:when test="@border">border:<xsl:value-of select="@border"/>;</xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="width">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@width">width:<xsl:value-of select="@width"/>;</xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="height">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@height">height:<xsl:value-of select="@height"/>;</xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="left">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@left">left:<xsl:value-of select="@left"/>;</xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="top">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@top">top:<xsl:value-of select="@top"/>;</xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="pos">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$left != '' or $top != ''">position:absolute;</xsl:when>
|
||||
<xsl:when test="@pos = 'left'">float:left;</xsl:when>
|
||||
<xsl:when test="@pos = 'right'">float:right;</xsl:when>
|
||||
<xsl:when test="@pos = 'center'">margin:0 auto;</xsl:when>
|
||||
<xsl:when test="@pos"><xsl:value-of select="@pos"/>;</xsl:when>
|
||||
<xsl:otherwise><xsl:if test="$left = ''">float:left;</xsl:if></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="style">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@style"><xsl:value-of select="@style"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<div class="{$APPCLASS}-control" style="{$pos}{$left}{$top}">
|
||||
<xsl:variable name="fontsize">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@size = 'large'">font-size:<xsl:value-of select="@size"/>;</xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="subclass">
|
||||
<xsl:if test="@label"><xsl:text> </xsl:text><xsl:value-of select="$APPCLASS"/><xsl:text>-label</xsl:text></xsl:if>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="labelwidth">
|
||||
<xsl:if test="@labelwidth">width:<xsl:value-of select="@labelwidth"/>;</xsl:if>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="labelstyle">
|
||||
<xsl:if test="@labelstyle"><xsl:value-of select="@labelstyle"/></xsl:if>
|
||||
</xsl:variable>
|
||||
<xsl:if test="@label">
|
||||
<xsl:if test="not(@labelpos) or @labelpos = 'left'">
|
||||
<div class="{$APPCLASS}-label" style="{$labelwidth}{$labelstyle}"><xsl:value-of select="@label"/></div>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@type = 'button'">
|
||||
<button class="{$APPCLASS}-binding" style="{$border}{$width}{$height}{$fontsize}{$style}" data-value="{$type},{$binding}"><xsl:apply-templates/></button>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'list'">
|
||||
<select class="{$APPCLASS}-binding" style="{$border}{$width}{$height}{$fontsize}{$style}" data-value="{$type},{$binding}">
|
||||
<xsl:apply-templates select="item" mode="component"/>
|
||||
</select>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'text'">
|
||||
<input class="{$APPCLASS}-binding" type="text" style="{$border}{$width}{$height}{$style}" data-value="{$type},{$binding}" value="" autocapitalize="off" autocorrect="off"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'submit'">
|
||||
<input class="{$APPCLASS}-binding" type="submit" style="{$border}{$fontsize}{$style}" data-value="{$type},{$binding}" value="{.}"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'textarea'">
|
||||
<textarea class="{$APPCLASS}-binding" style="{$border}{$width}{$height}{$style}" data-value="{$type},{$binding}" readonly="readonly"></textarea>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'heading'">
|
||||
<div><xsl:value-of select="."/></div>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'file'">
|
||||
<form class="{$APPCLASS}-binding" style="{$border}{$width}{$height}{$style}" data-value="{$type},{$binding}">
|
||||
<fieldset class="{$APPCLASS}-fieldset">
|
||||
<input type="file"/>
|
||||
<input type="submit" value="Mount" disabled="true"/>
|
||||
</fieldset>
|
||||
</form>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'separator'">
|
||||
<hr/>
|
||||
</xsl:when>
|
||||
<xsl:when test="not(@type)">
|
||||
<div style="clear:both"></div><br/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<div class="{$APPCLASS}-binding{$subclass}" style="{$border}{$width}{$height}{$style}" data-value="{$type},{$binding}"><xsl:apply-templates/></div>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="@label">
|
||||
<xsl:if test="@labelpos = 'right'">
|
||||
<div class="{$APPCLASS}-label" style="{$labelwidth}{$labelstyle}"><xsl:value-of select="@label"/></div>
|
||||
</xsl:if>
|
||||
<div style="clear:both"></div>
|
||||
</xsl:if>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="component">
|
||||
<option value="{@ref}"><xsl:value-of select="."/></option>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="name">
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="control">
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="cpu[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/cpu"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="cpu[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="autoStart">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@autostart"><xsl:value-of select="@autostart"/></xsl:when>
|
||||
<xsl:otherwise>null</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class" select="'cpu'"/>
|
||||
<xsl:with-param name="parms">,autoStart:<xsl:value-of select="$autoStart"/></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="keyboard[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/keyboard"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="keyboard[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="model">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@model"><xsl:value-of select="@model"/></xsl:when>
|
||||
<xsl:otherwise>600</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">keyboard</xsl:with-param>
|
||||
<xsl:with-param name="parms">,model:<xsl:value-of select="$model"/></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="serial[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/serial"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="serial[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="demo">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@demo"><xsl:value-of select="@demo"/></xsl:when>
|
||||
<xsl:otherwise>false</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">serial</xsl:with-param>
|
||||
<xsl:with-param name="parms">,demo:<xsl:value-of select="$demo"/></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="disk[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/disk"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="disk[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">disk</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="rom[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/rom"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="rom[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="size">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@size"><xsl:value-of select="@size"/></xsl:when>
|
||||
<xsl:otherwise>0</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="image">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@image"><xsl:value-of select="@image"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">rom</xsl:with-param>
|
||||
<xsl:with-param name="parms">,size:<xsl:value-of select="$size"/>,image:'<xsl:value-of select="$image"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ram[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/ram"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ram[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="size">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@size"><xsl:value-of select="@size"/></xsl:when>
|
||||
<xsl:otherwise>0</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">ram</xsl:with-param>
|
||||
<xsl:with-param name="parms">,size:<xsl:value-of select="$size"/></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="video[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/video"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="video[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="model">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@model"><xsl:value-of select="@model"/></xsl:when>
|
||||
<xsl:otherwise>600</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="screenWidth">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@screenwidth"><xsl:value-of select="@screenwidth"/></xsl:when>
|
||||
<xsl:otherwise>256</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="screenHeight">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@screenheight"><xsl:value-of select="@screenheight"/></xsl:when>
|
||||
<xsl:otherwise>224</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="charCols">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@cols"><xsl:value-of select="@cols"/></xsl:when>
|
||||
<xsl:otherwise>32</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="charRows">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@rows"><xsl:value-of select="@rows"/></xsl:when>
|
||||
<xsl:otherwise>32</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="charWidth">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@charwidth"><xsl:value-of select="@charwidth"/></xsl:when>
|
||||
<xsl:otherwise>0</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="charHeight">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@charheight"><xsl:value-of select="@charheight"/></xsl:when>
|
||||
<xsl:otherwise>0</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="charSet">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@charset"><xsl:value-of select="@charset"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="screenColor">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@screencolor"><xsl:value-of select="@screencolor"/></xsl:when>
|
||||
<xsl:otherwise>black</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">video</xsl:with-param>
|
||||
<xsl:with-param name="parms">,model:<xsl:value-of select="$model"/>,screenWidth:<xsl:value-of select="$screenWidth"/>,screenHeight:<xsl:value-of select="$screenHeight"/>,charCols:<xsl:value-of select="$charCols"/>,charRows:<xsl:value-of select="$charRows"/>,charWidth:<xsl:value-of select="$charWidth"/>,charHeight:<xsl:value-of select="$charHeight"/>,charSet:'<xsl:value-of select="$charSet"/>',screenColor:'<xsl:value-of select="$screenColor"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="debugger[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/debugger"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="debugger[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">debugger</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="panel[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/panel"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="panel[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">panel</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="computer[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/computer"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="computer[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="modules">
|
||||
[<xsl:for-each select="module">
|
||||
{<xsl:call-template name="module"/>}
|
||||
<xsl:if test="position() != last()">,</xsl:if>
|
||||
</xsl:for-each>]
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">computer</xsl:with-param>
|
||||
<xsl:with-param name="parms">,modules:<xsl:value-of select="$modules"/></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="module">
|
||||
type:'<xsl:value-of select="@type"/>',refID:'<xsl:value-of select="@refid"/>'<xsl:if test="@start">,start:<xsl:value-of select="@start"/>,end:<xsl:value-of select="@end"/></xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
162
versions/c1pjs/1.19.3/document.css
Normal file
162
versions/c1pjs/1.19.3/document.css
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
@CHARSET "UTF-8";
|
||||
|
||||
.page {
|
||||
margin: 2% 2%;
|
||||
padding: 2% 2%;
|
||||
min-width: 30em;
|
||||
overflow: auto;
|
||||
font-size: large;
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
background: #303030;
|
||||
color: #ccc;
|
||||
|
||||
}
|
||||
.page-header {
|
||||
}
|
||||
.page-header-title {
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
.page a {
|
||||
color: #7fc07f;
|
||||
text-decoration: none;
|
||||
}
|
||||
a.footlink, a.paralink {
|
||||
text-decoration: none;
|
||||
}
|
||||
a.footlink:link, a.paralink:link {
|
||||
color: blue;
|
||||
}
|
||||
a.footlink:visited, a.paralink:visited {
|
||||
color: blue;
|
||||
}
|
||||
.galleryitem {
|
||||
float: left;
|
||||
width: 200px;
|
||||
}
|
||||
.item {
|
||||
float: left;
|
||||
width: 2em;
|
||||
text-indent: 1em;
|
||||
}
|
||||
.list {
|
||||
margin-left: 3em;
|
||||
text-indent: 0;
|
||||
text-align: justify;
|
||||
}
|
||||
ul {
|
||||
list-style: none;
|
||||
}
|
||||
div.pnumber {
|
||||
float: left;
|
||||
width: 2em;
|
||||
text-indent: 1em;
|
||||
}
|
||||
div.pitem {
|
||||
margin-left: 10em;
|
||||
}
|
||||
p.indent, .justified p {
|
||||
text-indent: 2em;
|
||||
text-align: justify;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
p.noindent {
|
||||
text-indent: 0;
|
||||
text-align: justify;
|
||||
}
|
||||
p.center, .center {
|
||||
text-align: center;
|
||||
}
|
||||
li.para {
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.left {
|
||||
text-align: left;
|
||||
}
|
||||
.right {
|
||||
text-align: right;
|
||||
}
|
||||
blockquote.tag {
|
||||
font-size: small;
|
||||
font-family: Monaco, Fixed, monospace;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.blockquote {
|
||||
padding-left: 1em;
|
||||
text-indent: 0;
|
||||
text-align: justify;
|
||||
}
|
||||
.italics {
|
||||
font-style: italic;
|
||||
}
|
||||
.medium {
|
||||
font-size: medium;
|
||||
}
|
||||
.small {
|
||||
font-size: x-small;
|
||||
}
|
||||
.smallcaps {
|
||||
font-variant: small-caps;
|
||||
}
|
||||
.strike {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.summation, .bracelist {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
margin-bottom: 0.5ex;
|
||||
text-indent: 0;
|
||||
}
|
||||
.bracelist-symbol {
|
||||
font-size: 3em;
|
||||
vertical-align: -40%;
|
||||
}
|
||||
.summation .summation-lower, .summation .summation-upper, .bracelist-item {
|
||||
display: block;
|
||||
font-size: 75%;
|
||||
text-align: center;
|
||||
}
|
||||
.summation .summation-upper {
|
||||
margin-bottom: 0;
|
||||
margin-left: 0.8ex;
|
||||
font-style: italic;
|
||||
}
|
||||
.summation .summation-lower{
|
||||
margin-bottom: -0.6ex;
|
||||
font-style: italic;
|
||||
}
|
||||
.summation .summation-symbol {
|
||||
font-size: 2em;
|
||||
}
|
||||
p sup {
|
||||
vertical-align: baseline;
|
||||
position: relative;
|
||||
bottom: .5em;
|
||||
font-size: small;
|
||||
}
|
||||
p sub {
|
||||
vertical-align: baseline;
|
||||
position: relative;
|
||||
bottom: -.5em;
|
||||
font-size: small;
|
||||
}
|
||||
.footnote {
|
||||
font-size: medium;
|
||||
text-indent: 1em;
|
||||
text-align: justify;
|
||||
margin-top: .5em;
|
||||
}
|
||||
.image-right {
|
||||
float: right;
|
||||
margin-left: 1em;
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.image-caption {
|
||||
font-size: small;
|
||||
text-align: center;
|
||||
}
|
||||
450
versions/c1pjs/1.19.3/document.xsl
Normal file
450
versions/c1pjs/1.19.3/document.xsl
Normal file
|
|
@ -0,0 +1,450 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2014-02-23" license="http://www.gnu.org/licenses/gpl.html" -->
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
<!ENTITY nbsp " "> <!ENTITY ne "≠"> <!ENTITY le "≤"> <!ENTITY ge "≥">
|
||||
<!ENTITY times "×"> <!ENTITY sdot "⋅"> <!ENTITY divide "÷">
|
||||
<!ENTITY copy "©"> <!ENTITY Sigma "Σ"> <!ENTITY sigma "σ"> <!ENTITY sum "∑"> <!ENTITY lbrace "{">
|
||||
]>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:template name="documentStyles">
|
||||
<link rel="stylesheet" type="text/css" href="/versions/c1pjs/1.19.3/document.css"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="title">
|
||||
<h1><xsl:apply-templates/></h1>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="p">
|
||||
<xsl:if test="@id">
|
||||
<a name="{@id}"></a>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(@class)">
|
||||
<p><xsl:apply-templates/></p>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<p class="{@class}"><xsl:apply-templates/></p>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="p">
|
||||
<xsl:call-template name="p"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="br">
|
||||
<br/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="p[@number]">
|
||||
<div class="pnumber">
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(@number) or @number = ''"> </xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@number"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</div>
|
||||
<div class="pitem">
|
||||
<xsl:call-template name="p"/>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="span">
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(@class)">
|
||||
<span><xsl:apply-templates/></span>
|
||||
</xsl:when>
|
||||
<xsl:when test="@class = 'italics'">
|
||||
<em><xsl:apply-templates/></em>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<span class="{@class}"><xsl:apply-templates/></span>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h2">
|
||||
<h2><xsl:apply-templates/></h2>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h3">
|
||||
<h3><xsl:apply-templates/></h3>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h4">
|
||||
<h4><xsl:apply-templates/></h4>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h5">
|
||||
<h5><xsl:apply-templates/></h5>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h6">
|
||||
<h6><xsl:apply-templates/></h6>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="em">
|
||||
<em><xsl:apply-templates/></em>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="strong">
|
||||
<strong><xsl:apply-templates/></strong>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="a">
|
||||
<a href="{@href}" target="{@target}"><xsl:apply-templates/></a>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ol">
|
||||
<blockquote><ol><xsl:apply-templates/></ol></blockquote>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ul">
|
||||
<blockquote><ul><xsl:apply-templates/></ul></blockquote>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="li">
|
||||
<li><xsl:apply-templates/></li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="img">
|
||||
<div><img src="{@src}" alt="image"/></div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="pre">
|
||||
<pre><xsl:apply-templates/></pre>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="figure">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@pos">
|
||||
<div class="{@pos}"><img src="{@ref}" alt="{.}"/><br/><xsl:value-of select="."/></div>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<div><img src="{@ref}" alt="{.}"/><br/><xsl:value-of select="."/></div>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sub">
|
||||
<sub><xsl:apply-templates/></sub>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sup">
|
||||
<sup><xsl:apply-templates/></sup>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lt"><</xsl:template>
|
||||
<xsl:template match="gt">></xsl:template>
|
||||
<xsl:template match="ne">≠</xsl:template>
|
||||
<xsl:template match="le">≤</xsl:template>
|
||||
<xsl:template match="ge">≥</xsl:template>
|
||||
<xsl:template match="times">×</xsl:template>
|
||||
<xsl:template match="dot">⋅</xsl:template>
|
||||
<xsl:template match="divide">÷</xsl:template>
|
||||
<xsl:template match="sigma">σ</xsl:template>
|
||||
|
||||
<xsl:template match="summation">
|
||||
<span class="summation">
|
||||
<span class="summation-upper"><xsl:value-of select="@upper"/></span>
|
||||
<span class="summation-symbol">∑</span>
|
||||
<span class="summation-lower"><xsl:value-of select="@lower"/></span>
|
||||
</span>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bracelist">
|
||||
<span class="bracelist-symbol">{</span>
|
||||
<span class="bracelist">
|
||||
<xsl:for-each select="item">
|
||||
<span class="bracelist-item"><xsl:apply-templates/></span>
|
||||
</xsl:for-each>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="footlink">
|
||||
<xsl:variable name="docID" select="/document/@id"/>
|
||||
<a class="footlink" id="fn{$docID}_ref{@n}" href="#fn{$docID}_{@n}"><sup><xsl:if test="@quoted"><xsl:text>[</xsl:text></xsl:if><xsl:value-of select="@n"/><xsl:if test="@quoted"><xsl:text>]</xsl:text></xsl:if></sup></a>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="footnote">
|
||||
<xsl:variable name="docID" select="/document/@id"/>
|
||||
<div class="footnote"><a id="fn{$docID}_{@n}" href="#fn{$docID}_ref{@n}"><sup><xsl:value-of select="@n"/></sup></a><xsl:text> </xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="authors">
|
||||
<xsl:for-each select="author"><xsl:if test="position() != 1"><xsl:text>, </xsl:text></xsl:if><xsl:if test="position() != 1 and position() = last()"><xsl:text>and </xsl:text></xsl:if><xsl:value-of select="."/></xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="formatDate">
|
||||
<xsl:param name="date"/>
|
||||
<xsl:param name="format">MDY</xsl:param>
|
||||
<xsl:variable name="year">
|
||||
<xsl:value-of select="substring-before($date,'-')"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="mon-day">
|
||||
<xsl:value-of select="substring-after($date,'-')"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="mon">
|
||||
<xsl:value-of select="substring-before($mon-day,'-')"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="full-day">
|
||||
<xsl:value-of select="substring-after($mon-day,'-')"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="day">
|
||||
<xsl:choose>
|
||||
<xsl:when test="substring($full-day,1,1) = '0'"><xsl:value-of select="substring($full-day,2)"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$full-day"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mon = '01'">January </xsl:when>
|
||||
<xsl:when test="$mon = '02'">February </xsl:when>
|
||||
<xsl:when test="$mon = '03'">March </xsl:when>
|
||||
<xsl:when test="$mon = '04'">April </xsl:when>
|
||||
<xsl:when test="$mon = '05'">May </xsl:when>
|
||||
<xsl:when test="$mon = '06'">June </xsl:when>
|
||||
<xsl:when test="$mon = '07'">July </xsl:when>
|
||||
<xsl:when test="$mon = '08'">August </xsl:when>
|
||||
<xsl:when test="$mon = '09'">September </xsl:when>
|
||||
<xsl:when test="$mon = '10'">October </xsl:when>
|
||||
<xsl:when test="$mon = '11'">November </xsl:when>
|
||||
<xsl:when test="$mon = '12'">December </xsl:when>
|
||||
<xsl:when test="$mon = '00'"/> </xsl:choose>
|
||||
<xsl:if test="$day != '0' and $format = 'MDY'">
|
||||
<xsl:value-of select="$day"/><xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="$year"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="gallery">
|
||||
<h2><xsl:value-of select="description"/></h2>
|
||||
<div class="gallery">
|
||||
<xsl:apply-templates select="item" mode="gallery"/>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="gallery">
|
||||
<div class="galleryitem">
|
||||
<a href="{@ref}"><img src="/versions/images/current/pdf-192.jpg" alt="{.}"/></a><br/>
|
||||
<div style="font-size:small; text-align:center;"><xsl:value-of select="."/></div>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list[@type = 'timeline']">
|
||||
<xsl:if test="not(description)">
|
||||
<h2>Timeline</h2>
|
||||
</xsl:if>
|
||||
<xsl:if test="description">
|
||||
<h2><xsl:value-of select="description"/></h2>
|
||||
</xsl:if>
|
||||
<blockquote>
|
||||
<xsl:apply-templates select="item" mode="timeline"/>
|
||||
</blockquote>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="timeline">
|
||||
<xsl:if test="@ref">
|
||||
<xsl:variable name="documentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($documentFile)/document" mode="withDate">
|
||||
<xsl:with-param name="itemRef" select="@ref"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
<xsl:if test="not(@ref)">
|
||||
<h3><xsl:call-template name="formatDate"><xsl:with-param name="date" select="@date"/></xsl:call-template></h3>
|
||||
<blockquote>
|
||||
<xsl:value-of select="."/>
|
||||
</blockquote>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list[@type = 'people']">
|
||||
<xsl:if test="not(description)">
|
||||
<h2>People</h2>
|
||||
</xsl:if>
|
||||
<xsl:if test="description">
|
||||
<h2><xsl:value-of select="description"/></h2>
|
||||
</xsl:if>
|
||||
<blockquote>
|
||||
<xsl:apply-templates select="item" mode="people"/>
|
||||
</blockquote>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="people">
|
||||
<h3><xsl:value-of select="name"/></h3>
|
||||
<xsl:apply-templates select="list"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list[@type = 'documents']">
|
||||
<xsl:if test="description"><h2><xsl:value-of select="description"/></h2></xsl:if>
|
||||
<ul>
|
||||
<xsl:apply-templates select="item" mode="document"/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="document">
|
||||
<xsl:variable name="documentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($documentFile)/document">
|
||||
<xsl:with-param name="itemRef" select="@ref"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="document">
|
||||
<xsl:param name="itemRef"/>
|
||||
<li>
|
||||
<xsl:call-template name="documentSummary"><xsl:with-param name="itemRef" select="$itemRef"/></xsl:call-template>
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="document" mode="withDate">
|
||||
<xsl:param name="itemRef"/>
|
||||
<h3><xsl:call-template name="formatDate"><xsl:with-param name="date" select="date"/><xsl:with-param name="format" select="MY"/></xsl:call-template></h3>
|
||||
<blockquote>
|
||||
<p>
|
||||
<xsl:call-template name="documentSummary"><xsl:with-param name="itemRef" select="$itemRef"/><xsl:with-param name="multiLine" select="'true'"/></xsl:call-template>
|
||||
</p>
|
||||
</blockquote>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="documentSummary">
|
||||
<xsl:param name="itemRef"/>
|
||||
<xsl:param name="multiLine">false</xsl:param>
|
||||
<xsl:choose>
|
||||
<xsl:when test="content|include">
|
||||
<a href="{$itemRef}"><xsl:value-of select="title"/></a>
|
||||
<xsl:if test="@ref">
|
||||
<span class="small">
|
||||
<xsl:text> [</xsl:text><a href="{@ref}">Original</a><xsl:text>]</xsl:text>
|
||||
</span>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<a href="{$itemRef}"><xsl:value-of select="title"/></a>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="copy">
|
||||
<span class="small">
|
||||
<xsl:text> [</xsl:text><a href="{copy/@ref}"><xsl:value-of select="copy"/></a><xsl:text>]</xsl:text>
|
||||
</span>
|
||||
</xsl:if>
|
||||
<xsl:if test="author"><xsl:if test="$multiLine = 'true'"><br/></xsl:if><span class="medium"><xsl:text> by </xsl:text><xsl:call-template name="authors"/></span></xsl:if>
|
||||
<xsl:if test="source">
|
||||
<span class="small">
|
||||
<br/>
|
||||
<xsl:text>[Source: </xsl:text>
|
||||
<xsl:if test="site">
|
||||
<a href="{site/@url}"><xsl:value-of select="site"/></a>
|
||||
</xsl:if>
|
||||
<xsl:if test="not(site)">
|
||||
<a href="{source/@url}"><xsl:value-of select="source"/></a>
|
||||
</xsl:if>
|
||||
<xsl:text>]</xsl:text>
|
||||
</span>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list[@type = 'resources']">
|
||||
<xsl:if test="not(description)">
|
||||
<h2>Resources</h2>
|
||||
</xsl:if>
|
||||
<xsl:if test="description">
|
||||
<h2><xsl:value-of select="description"/></h2>
|
||||
</xsl:if>
|
||||
<blockquote>
|
||||
<xsl:apply-templates select="item" mode="resources"/>
|
||||
</blockquote>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="resources">
|
||||
<h3><xsl:value-of select="description"/></h3>
|
||||
<xsl:apply-templates select="list"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list[@type = 'links']">
|
||||
<xsl:if test="description">
|
||||
<h4><xsl:value-of select="description"/></h4>
|
||||
</xsl:if>
|
||||
<ul>
|
||||
<xsl:apply-templates select="item" mode="links"/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="links">
|
||||
<li><a href="{@ref}"><xsl:value-of select="."/></a></li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list[not(@type)]">
|
||||
<xsl:if test="description">
|
||||
<h2><xsl:value-of select="description"/></h2>
|
||||
</xsl:if>
|
||||
<blockquote>
|
||||
<xsl:apply-templates select="item|tag" mode="outer"/>
|
||||
</blockquote>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="outer">
|
||||
<xsl:if test="description">
|
||||
<h3><xsl:value-of select="description"/></h3>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="list|item|tag" mode="inner"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list" mode="inner">
|
||||
<xsl:if test="description">
|
||||
<h4><xsl:value-of select="description"/></h4>
|
||||
</xsl:if>
|
||||
<ul>
|
||||
<xsl:apply-templates select="list|item|para|tag" mode="inner"/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="innerlist">
|
||||
<xsl:if test="description">
|
||||
<xsl:value-of select="description"/>
|
||||
</xsl:if>
|
||||
<ul>
|
||||
<xsl:apply-templates select="list|item|para|tag" mode="inner"/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="inner">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@ref">
|
||||
<li><a href="{@ref}"><xsl:apply-templates/></a></li>
|
||||
</xsl:when>
|
||||
<xsl:when test="description">
|
||||
<li><xsl:call-template name="innerlist"/></li>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<li><xsl:apply-templates/></li>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="para" mode="inner">
|
||||
<li class="para"><xsl:apply-templates/></li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="tag" mode="outer">
|
||||
<xsl:call-template name="tag"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="tag" mode="inner">
|
||||
<xsl:call-template name="tag"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="tag">
|
||||
<blockquote class="tag">
|
||||
<xsl:text><</xsl:text><xsl:if test="@href"><a href="{@href}"><xsl:value-of select="@name"/></a></xsl:if><xsl:if test="not(@href)"><xsl:value-of select="@name"/></xsl:if><xsl:for-each select="attr"><xsl:text> </xsl:text><xsl:value-of select="@name"/><xsl:text>="</xsl:text><xsl:value-of select="@value"/><xsl:text>"</xsl:text></xsl:for-each>
|
||||
<xsl:choose>
|
||||
<xsl:when test="tag"><xsl:text>></xsl:text><xsl:apply-templates mode="inner"/><xsl:text></</xsl:text><xsl:value-of select="@name"/><xsl:text>></xsl:text></xsl:when>
|
||||
<xsl:when test="normalize-space(.) != ''"><xsl:text>></xsl:text><xsl:value-of select="."/><xsl:text></</xsl:text><xsl:value-of select="@name"/><xsl:text>></xsl:text></xsl:when>
|
||||
<xsl:otherwise><xsl:text>/></xsl:text></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</blockquote>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
49
versions/c1pjs/1.19.3/machine.xsl
Normal file
49
versions/c1pjs/1.19.3/machine.xsl
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2014-02-23" license="http://www.gnu.org/licenses/gpl.html" -->
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
<!ENTITY nbsp " "> <!ENTITY sect "§"> <!ENTITY copy "©"> <!ENTITY para "¶"> <!ENTITY ndash "–"> <!ENTITY mdash "—">
|
||||
<!ENTITY lsquo "‘"> <!ENTITY rsquo "’"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY dagger "†"> <!ENTITY Dagger "‡">
|
||||
]>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:output doctype-system="about:legacy-compat"/>
|
||||
|
||||
<xsl:include href="/versions/c1pjs/1.19.3/common.xsl"/>
|
||||
<xsl:include href="/versions/c1pjs/1.19.3/components.xsl"/>
|
||||
|
||||
<xsl:template match="/machine">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title><xsl:value-of select="$SITEHOST"/></title>
|
||||
<xsl:call-template name="commonStyles"/>
|
||||
<xsl:call-template name="componentStyles"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="common">
|
||||
<xsl:call-template name="commonTop"/>
|
||||
<div class="common-middle">
|
||||
<p></p>
|
||||
<div id="{@id}" class="machine {@class}js">
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="@id"/>
|
||||
<xsl:with-param name="component" select="'machine'"/>
|
||||
<xsl:with-param name="class"><xsl:value-of select="@class"/>js</xsl:with-param>
|
||||
<xsl:with-param name="parms"><xsl:if test="@parms">,<xsl:value-of select="@parms"/></xsl:if></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</div>
|
||||
</div>
|
||||
<xsl:call-template name="commonBottom"/>
|
||||
</div>
|
||||
<xsl:call-template name="componentScripts">
|
||||
<xsl:with-param name="component">
|
||||
<xsl:choose>
|
||||
<xsl:when test="debugger"><xsl:value-of select="@class"/>-dbg</xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@class"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
247
versions/c1pjs/1.19.3/manifest.xsl
Normal file
247
versions/c1pjs/1.19.3/manifest.xsl
Normal file
|
|
@ -0,0 +1,247 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2014-04-10" modified="2014-04-10" license="http://www.gnu.org/licenses/gpl.html" -->
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
<!ENTITY nbsp " "> <!ENTITY sect "§"> <!ENTITY copy "©"> <!ENTITY para "¶"> <!ENTITY ndash "–"> <!ENTITY mdash "—">
|
||||
<!ENTITY lsquo "‘"> <!ENTITY rsquo "’"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY dagger "†"> <!ENTITY Dagger "‡">
|
||||
]>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:output doctype-system="about:legacy-compat"/>
|
||||
|
||||
<xsl:include href="/versions/c1pjs/1.19.3/common.xsl"/>
|
||||
<xsl:include href="/versions/c1pjs/1.19.3/components.xsl"/>
|
||||
|
||||
<xsl:template match="/manifest[@type = 'document']">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title><xsl:value-of select="$SITEHOST"/></title>
|
||||
<xsl:call-template name="commonStyles"/>
|
||||
<xsl:call-template name="componentStyles"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="common">
|
||||
<xsl:call-template name="commonTop"/>
|
||||
<div class="common-middle">
|
||||
<h4>Document Manifest</h4>
|
||||
<div class="common-sidebar">
|
||||
<ul class="common-list-data">
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Title'"/>
|
||||
<xsl:with-param name="node" select="title"/>
|
||||
<xsl:with-param name="default">None</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Version'"/>
|
||||
<xsl:with-param name="node" select="version"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Source'"/>
|
||||
<xsl:with-param name="node" select="source"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Documents'"/>
|
||||
<xsl:with-param name="node" select="document"/>
|
||||
<xsl:with-param name="default"><xsl:value-of select="title"/> <xsl:if test="version != ''"><xsl:text> </xsl:text><xsl:value-of select="version"/></xsl:if></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="common-main">
|
||||
<p><xsl:value-of select="desc"/></p>
|
||||
<xsl:call-template name="commonBottom"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="/manifest[@type = 'software' or not(@type)]">
|
||||
<xsl:variable name="machineClass">
|
||||
<xsl:choose>
|
||||
<xsl:when test="machine/@class"><xsl:value-of select="machine/@class"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$MACHINECLASS"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title><xsl:value-of select="$SITEHOST"/></title>
|
||||
<xsl:call-template name="commonStyles"/>
|
||||
<xsl:call-template name="componentStyles"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="common">
|
||||
<xsl:call-template name="commonTop"/>
|
||||
<div class="common-middle">
|
||||
<h4>Software Manifest</h4>
|
||||
<div class="common-sidebar">
|
||||
<ul class="common-list-data">
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Title'"/>
|
||||
<xsl:with-param name="node" select="title"/>
|
||||
<xsl:with-param name="default">None</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Version'"/>
|
||||
<xsl:with-param name="node" select="version"/>
|
||||
<xsl:with-param name="default">Unknown</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Type'"/>
|
||||
<xsl:with-param name="node" select="type"/>
|
||||
<xsl:with-param name="default">None</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Category'"/>
|
||||
<xsl:with-param name="node" select="category"/>
|
||||
<xsl:with-param name="default">None</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Created'"/>
|
||||
<xsl:with-param name="node" select="creationDate"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Creators'"/>
|
||||
<xsl:with-param name="node" select="creator"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label"><xsl:if test="creationDate">Updated</xsl:if><xsl:if test="not(creationDate)">Released</xsl:if></xsl:with-param>
|
||||
<xsl:with-param name="node" select="releaseDate"/>
|
||||
<xsl:with-param name="default">Unknown</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Company'"/>
|
||||
<xsl:with-param name="node" select="company"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Authors'"/>
|
||||
<xsl:with-param name="node" select="author"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Contributors'"/>
|
||||
<xsl:with-param name="node" select="contributor"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Publisher'"/>
|
||||
<xsl:with-param name="node" select="publisher"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'License'"/>
|
||||
<xsl:with-param name="node" select="license"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Source'"/>
|
||||
<xsl:with-param name="node" select="source"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Disks'"/>
|
||||
<xsl:with-param name="node" select="disk"/>
|
||||
<xsl:with-param name="default"><xsl:value-of select="title"/> <xsl:if test="version != ''"><xsl:text> </xsl:text><xsl:value-of select="version"/></xsl:if></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="common-main">
|
||||
<xsl:for-each select="machine[not(@type) or @type = 'default']">
|
||||
<xsl:call-template name="machine">
|
||||
<xsl:with-param name="href" select="@href"/>
|
||||
<xsl:with-param name="state" select="@state"/>
|
||||
</xsl:call-template>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="not(machine[not(@type) or @type = 'default'])">
|
||||
<p>No default machine specified for '<xsl:value-of select="title"/>' in manifest.xml</p>
|
||||
</xsl:if>
|
||||
<xsl:call-template name="commonBottom"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<xsl:call-template name="componentScripts">
|
||||
<xsl:with-param name="component">
|
||||
<xsl:choose>
|
||||
<xsl:when test="machine/@debugger"><xsl:value-of select="$machineClass"/>-dbg</xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$machineClass"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="listItem">
|
||||
<xsl:param name="label"/>
|
||||
<xsl:param name="node"/>
|
||||
<xsl:param name="default">Unknown</xsl:param>
|
||||
<xsl:if test="$node != '' or $default != ''">
|
||||
<li><xsl:value-of select="$label"/>
|
||||
<ul class="common-list-data-items">
|
||||
<xsl:for-each select="$node">
|
||||
<xsl:variable name="desc">
|
||||
<xsl:choose>
|
||||
<xsl:when test="desc"><xsl:value-of select="desc"/></xsl:when>
|
||||
<xsl:when test="org"><xsl:value-of select="org"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<li title="{$desc}">
|
||||
<xsl:variable name="value">
|
||||
<xsl:choose>
|
||||
<xsl:when test="name">
|
||||
<xsl:value-of select="name"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="normalize-space(./text()) != ''">
|
||||
<xsl:value-of select="normalize-space(./text())"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$default"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="href">
|
||||
<xsl:if test="@href"><xsl:value-of select="@href"/></xsl:if>
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$href != ''">
|
||||
<a href="{$href}"><xsl:value-of select="$value"/></a>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$value"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="page">
|
||||
<ul class="common-list-data-subitems">
|
||||
<xsl:for-each select="page">
|
||||
<li>
|
||||
<xsl:if test="@href">
|
||||
<a href="{$href}{@href}"><xsl:value-of select="."/></a>
|
||||
</xsl:if>
|
||||
<xsl:if test="not(@href)">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:if>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
</xsl:if>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="not($node)">
|
||||
<xsl:if test="@href">
|
||||
<a href="{@href}"><xsl:value-of select="$default"/></a>
|
||||
</xsl:if>
|
||||
<xsl:if test="not(@href)">
|
||||
<xsl:value-of select="$default"/>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</ul>
|
||||
</li>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
47
versions/c1pjs/1.19.3/outline.xsl
Normal file
47
versions/c1pjs/1.19.3/outline.xsl
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2014-02-23" license="http://www.gnu.org/licenses/gpl.html" -->
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
<!ENTITY nbsp " "> <!ENTITY sect "§"> <!ENTITY copy "©"> <!ENTITY para "¶"> <!ENTITY ndash "–"> <!ENTITY mdash "—">
|
||||
<!ENTITY lsquo "‘"> <!ENTITY rsquo "’"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY dagger "†"> <!ENTITY Dagger "‡">
|
||||
]>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:output doctype-system="about:legacy-compat"/>
|
||||
|
||||
<xsl:include href="/versions/c1pjs/1.19.3/common.xsl"/>
|
||||
<xsl:include href="/versions/c1pjs/1.19.3/document.xsl"/>
|
||||
<xsl:include href="/versions/c1pjs/1.19.3/components.xsl"/>
|
||||
|
||||
<xsl:template match="/outline">
|
||||
<xsl:variable name="machineClass">
|
||||
<xsl:choose>
|
||||
<xsl:when test="machine/@class"><xsl:value-of select="machine/@class"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$MACHINECLASS"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title><xsl:value-of select="title"/><xsl:text> | </xsl:text><xsl:value-of select="$SITEHOST"/></title>
|
||||
<xsl:call-template name="commonStyles"/>
|
||||
<xsl:call-template name="documentStyles"/>
|
||||
<xsl:call-template name="componentStyles"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="common">
|
||||
<div class="page justified">
|
||||
<xsl:apply-templates/>
|
||||
</div>
|
||||
</div>
|
||||
<xsl:call-template name="componentScripts">
|
||||
<xsl:with-param name="component">
|
||||
<xsl:choose>
|
||||
<xsl:when test="debugger"><xsl:value-of select="$machineClass"/>-dbg</xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$machineClass"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
262
versions/pcjs/1.19.3/common.css
Normal file
262
versions/pcjs/1.19.3/common.css
Normal file
|
|
@ -0,0 +1,262 @@
|
|||
@CHARSET "UTF-8";
|
||||
/**
|
||||
@author Jeff Parsons (@jeffpar)
|
||||
@website http://www.pcjs.org/
|
||||
@created 2013-05-05
|
||||
@modified 2014-02-23
|
||||
@license http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
body {
|
||||
margin: 0;
|
||||
background: #202020;
|
||||
}
|
||||
h1, h2 {
|
||||
margin-top: 0;
|
||||
color: #cccccc;
|
||||
}
|
||||
h1, h2, h3, h4 {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
h4 a {
|
||||
color: #cccccc !important;
|
||||
}
|
||||
p {
|
||||
line-height: 1.5em;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
a img {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
pre, code {
|
||||
color: #000000;
|
||||
background-color: #cccccc;
|
||||
font-family: Monaco, Consolas, "Lucida Console", monospace;
|
||||
font-size: 12px;
|
||||
}
|
||||
pre {
|
||||
margin: 1em 2em;
|
||||
padding: 1em;
|
||||
border-radius: 5px;
|
||||
overflow: auto;
|
||||
}
|
||||
code {
|
||||
padding: 1px;
|
||||
}
|
||||
pre a, code a {
|
||||
color: #006400 !important;
|
||||
}
|
||||
.common {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
color: #cccccc;
|
||||
}
|
||||
.common a {
|
||||
|
||||
color: #7fc07f;
|
||||
text-decoration: none;
|
||||
}
|
||||
.common hr {
|
||||
border-color: #808080;
|
||||
}
|
||||
.common a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.common, .machine {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
|
||||
font-size: 15px;
|
||||
}
|
||||
.machine {
|
||||
margin: 15px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.c1pjs {
|
||||
overflow: visible;
|
||||
}
|
||||
.machine-placeholder {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
.common-top {
|
||||
background: #202020;
|
||||
font-size: small;
|
||||
}
|
||||
.common-top-left {
|
||||
float: left;
|
||||
width: 60%;
|
||||
}
|
||||
.common-top-left ul {
|
||||
line-height: 1.5em;
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 1em 1em 1em 9px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.common-top-left ul li {
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
.common-top-left ul li a {
|
||||
border-right: 1px solid #6f6f6f;
|
||||
padding: 2px 6px 2px 6px;
|
||||
}
|
||||
.common-top-left ul li:last-child a {
|
||||
border-right: none;
|
||||
}
|
||||
.common-top-right {
|
||||
float: right;
|
||||
width: 40%;
|
||||
}
|
||||
.common-top-right p {
|
||||
float: right;
|
||||
margin: 0;
|
||||
padding: 1em;
|
||||
}
|
||||
.common-middle {
|
||||
clear: both;
|
||||
padding: 1px 1em 1px 1em;
|
||||
background: #404040;
|
||||
}
|
||||
.common-sidebar {
|
||||
float: left;
|
||||
font-size: small;
|
||||
width: 140px;
|
||||
padding-bottom: 20px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.common-list {
|
||||
list-style-type: none;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
.common-list li {
|
||||
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
.common-list-data {
|
||||
list-style-type: none;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
.common-list-data li {
|
||||
line-height: 1.5em;
|
||||
}
|
||||
.common-list-data-items, .common-list-data-subitems {
|
||||
font-size: x-small;
|
||||
list-style-type: none;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding-left: 2em;
|
||||
}
|
||||
.common-list-data-items li, .common-list-data-subitems li {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.common-main {
|
||||
margin-left: 150px;
|
||||
|
||||
}
|
||||
.common-image-gallery {
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
.common-image-gallery:after {
|
||||
content: '';
|
||||
display: block;
|
||||
}
|
||||
.common-image-frame {
|
||||
display: inline-block;
|
||||
margin: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
.common-image-link {
|
||||
padding: 5px;
|
||||
border: 1px solid black;
|
||||
border-radius: 5px;
|
||||
background-color: #FAEBD7;
|
||||
}
|
||||
.common-image-label {
|
||||
font-size: x-small;
|
||||
}
|
||||
.common-bottom {
|
||||
clear: both;
|
||||
padding-top: 1em;
|
||||
}
|
||||
.common-bottom:after {
|
||||
content: '';
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
.common-reference {
|
||||
float: left;
|
||||
font-size: x-small;
|
||||
}
|
||||
.common-reference a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.common-copyright {
|
||||
float: right;
|
||||
font-size: x-small;
|
||||
}
|
||||
.common-copyright a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.md-list {
|
||||
}
|
||||
.md-list li {
|
||||
line-height: 1.5em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.md-list li p {
|
||||
padding-left: 2em;
|
||||
}
|
||||
.md-list-compact {
|
||||
}
|
||||
.md-list-compact li {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.md-list-none {
|
||||
list-style-type: none;
|
||||
padding-left: 2em;
|
||||
}
|
||||
.md-list-none li {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
@media screen and (max-width: 900px) {
|
||||
|
||||
.common-sidebar {
|
||||
width: 100%;
|
||||
white-space: normal;
|
||||
}
|
||||
.common-list {
|
||||
padding-left: 0;
|
||||
}
|
||||
.common-list-data {
|
||||
padding-left: 0;
|
||||
}
|
||||
.common-sidebar h4, .common-list li, .common-list-data li, .common-list-data-items li {
|
||||
width: 130px;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
vertical-align: top;
|
||||
padding-right: 1em;
|
||||
margin-top: 0;
|
||||
}
|
||||
.common-list-data-subitems {
|
||||
display: none;
|
||||
}
|
||||
.common-main {
|
||||
clear: both;
|
||||
margin-left: 0;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
.md-list-none {
|
||||
padding-left: 1em;
|
||||
}
|
||||
}
|
||||
46
versions/pcjs/1.19.3/common.xsl
Normal file
46
versions/pcjs/1.19.3/common.xsl
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2014-02-23" license="http://www.gnu.org/licenses/gpl.html" -->
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
<!ENTITY nbsp " "> <!ENTITY ne "≠"> <!ENTITY le "≤"> <!ENTITY ge "≥">
|
||||
<!ENTITY times "×"> <!ENTITY sdot "⋅"> <!ENTITY divide "÷">
|
||||
<!ENTITY copy "©"> <!ENTITY Sigma "Σ"> <!ENTITY sigma "σ"> <!ENTITY sum "∑"> <!ENTITY lbrace "{">
|
||||
]>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:template name="commonStyles">
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="shortcut icon" href="/versions/images/current/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/versions/pcjs/1.19.3/common.css"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="commonTop">
|
||||
<div class="common-top">
|
||||
<div class="common-top-left">
|
||||
<ul>
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/apps/pc/">Apps</a></li>
|
||||
<li><a href="/disks/pc/">Disks</a></li>
|
||||
<li><a href="/devices/pc/machine/">Machines</a></li>
|
||||
<li><a href="/docs/">Docs</a></li>
|
||||
<li><a href="/pubs/">Pubs</a></li>
|
||||
<li><a href="/blog/">Blog</a></li>
|
||||
<li><a href="/docs/about/">About</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="common-top-right">
|
||||
<p>Powered by <a href="http://nodejs.org" target="_blank">Node.js</a> and <a href="http://aws.amazon.com/elasticbeanstalk/" target="_blank">AWS</a> | <a href="http://github.com/jeffpar/pcjs" target="_blank">GitHub</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="commonBottom">
|
||||
<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> website © 2012-2015 by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
|
||||
<span class="common-copyright">PCjs and C1Pjs released under <a href="http://gnu.org/licenses/gpl.html">GPL version 3 or later</a></span>
|
||||
</p>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
146
versions/pcjs/1.19.3/components.css
Normal file
146
versions/pcjs/1.19.3/components.css
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
@CHARSET "UTF-8";
|
||||
|
||||
|
||||
*:not(input,textarea) {
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
.pcjs-embed {
|
||||
}
|
||||
.pcjs-embed:after {
|
||||
clear:both;
|
||||
}
|
||||
.pcjs-name, .pcjs-menu {
|
||||
clear: both;
|
||||
font-weight: bold;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
.pcjs-menu {
|
||||
float: left;
|
||||
}
|
||||
.pcjs-canvas {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.pcjs-container {
|
||||
color: #000000;
|
||||
position: relative;
|
||||
}
|
||||
.pcjs-label {
|
||||
font-size: small;
|
||||
line-height: 19px;
|
||||
vertical-align: middle;
|
||||
float: left;
|
||||
font-family: "Lucida Console", monospace;
|
||||
}
|
||||
.pcjs-control textarea {
|
||||
font-family: Monaco, monospace;
|
||||
font-size: x-small;
|
||||
}
|
||||
.pcjs-fieldset {
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.pcjs-flag {
|
||||
font-family: "Lucida Console", monospace;
|
||||
font-size: small;
|
||||
text-align: center;
|
||||
line-height: 19px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.pcjs-register {
|
||||
font-family: "Lucida Console", monospace;
|
||||
font-size: small;
|
||||
text-align: center;
|
||||
line-height: 19px;
|
||||
vertical-align: middle;
|
||||
border: 1px solid black;
|
||||
}
|
||||
.pcjs-switches {
|
||||
float: left;
|
||||
}
|
||||
.pcjs-bitBucket {
|
||||
float: left;
|
||||
width: 19px;
|
||||
height: 38px;
|
||||
}
|
||||
.pcjs-bitCell {
|
||||
float: left;
|
||||
width: 19px;
|
||||
height: 19px;
|
||||
margin-right: -1px;
|
||||
margin-bottom: -1px;
|
||||
border: 1px solid black;
|
||||
text-align: center;
|
||||
line-height: 19px;
|
||||
}
|
||||
.pcjs-bitCellLeft {
|
||||
border-left: 1px solid black;
|
||||
}
|
||||
.pcjs-bitLabel {
|
||||
font-size: xx-small;
|
||||
text-align: center;
|
||||
}
|
||||
.pcjs-description, .pcjs-status {
|
||||
font-size: x-small;
|
||||
line-height: 2em;
|
||||
}
|
||||
.pcjs-key {
|
||||
border: 1px solid black;
|
||||
font-size: x-small;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.pcjs-led {
|
||||
float: left;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
margin: 4px;
|
||||
border: 1px solid black;
|
||||
text-align: center;
|
||||
line-height: 19px;
|
||||
background-color: #000000;
|
||||
}
|
||||
.pcjs-video-object {
|
||||
clear: both;
|
||||
height: auto;
|
||||
position: relative;
|
||||
line-height: 0;
|
||||
}
|
||||
.pcjs-video-object textarea {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
line-height: 0;
|
||||
}
|
||||
.pcjs-reference {
|
||||
float: left;
|
||||
font-size: x-small;
|
||||
}
|
||||
.pcjs-reference a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.pcjs-copyright {
|
||||
float: right;
|
||||
font-size: x-small;
|
||||
}
|
||||
.pcjs-copyright a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 900px) {
|
||||
.pcjs-textarea {
|
||||
width: 100% !important;
|
||||
}
|
||||
.pcjs-registers {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
1002
versions/pcjs/1.19.3/components.xsl
Normal file
1002
versions/pcjs/1.19.3/components.xsl
Normal file
File diff suppressed because it is too large
Load diff
162
versions/pcjs/1.19.3/document.css
Normal file
162
versions/pcjs/1.19.3/document.css
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
@CHARSET "UTF-8";
|
||||
|
||||
.page {
|
||||
margin: 2% 2%;
|
||||
padding: 2% 2%;
|
||||
min-width: 30em;
|
||||
overflow: auto;
|
||||
font-size: large;
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
background: #303030;
|
||||
color: #ccc;
|
||||
|
||||
}
|
||||
.page-header {
|
||||
}
|
||||
.page-header-title {
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
.page a {
|
||||
color: #7fc07f;
|
||||
text-decoration: none;
|
||||
}
|
||||
a.footlink, a.paralink {
|
||||
text-decoration: none;
|
||||
}
|
||||
a.footlink:link, a.paralink:link {
|
||||
color: blue;
|
||||
}
|
||||
a.footlink:visited, a.paralink:visited {
|
||||
color: blue;
|
||||
}
|
||||
.galleryitem {
|
||||
float: left;
|
||||
width: 200px;
|
||||
}
|
||||
.item {
|
||||
float: left;
|
||||
width: 2em;
|
||||
text-indent: 1em;
|
||||
}
|
||||
.list {
|
||||
margin-left: 3em;
|
||||
text-indent: 0;
|
||||
text-align: justify;
|
||||
}
|
||||
ul {
|
||||
list-style: none;
|
||||
}
|
||||
div.pnumber {
|
||||
float: left;
|
||||
width: 2em;
|
||||
text-indent: 1em;
|
||||
}
|
||||
div.pitem {
|
||||
margin-left: 10em;
|
||||
}
|
||||
p.indent, .justified p {
|
||||
text-indent: 2em;
|
||||
text-align: justify;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
p.noindent {
|
||||
text-indent: 0;
|
||||
text-align: justify;
|
||||
}
|
||||
p.center, .center {
|
||||
text-align: center;
|
||||
}
|
||||
li.para {
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.left {
|
||||
text-align: left;
|
||||
}
|
||||
.right {
|
||||
text-align: right;
|
||||
}
|
||||
blockquote.tag {
|
||||
font-size: small;
|
||||
font-family: Monaco, Fixed, monospace;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.blockquote {
|
||||
padding-left: 1em;
|
||||
text-indent: 0;
|
||||
text-align: justify;
|
||||
}
|
||||
.italics {
|
||||
font-style: italic;
|
||||
}
|
||||
.medium {
|
||||
font-size: medium;
|
||||
}
|
||||
.small {
|
||||
font-size: x-small;
|
||||
}
|
||||
.smallcaps {
|
||||
font-variant: small-caps;
|
||||
}
|
||||
.strike {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.summation, .bracelist {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
margin-bottom: 0.5ex;
|
||||
text-indent: 0;
|
||||
}
|
||||
.bracelist-symbol {
|
||||
font-size: 3em;
|
||||
vertical-align: -40%;
|
||||
}
|
||||
.summation .summation-lower, .summation .summation-upper, .bracelist-item {
|
||||
display: block;
|
||||
font-size: 75%;
|
||||
text-align: center;
|
||||
}
|
||||
.summation .summation-upper {
|
||||
margin-bottom: 0;
|
||||
margin-left: 0.8ex;
|
||||
font-style: italic;
|
||||
}
|
||||
.summation .summation-lower{
|
||||
margin-bottom: -0.6ex;
|
||||
font-style: italic;
|
||||
}
|
||||
.summation .summation-symbol {
|
||||
font-size: 2em;
|
||||
}
|
||||
p sup {
|
||||
vertical-align: baseline;
|
||||
position: relative;
|
||||
bottom: .5em;
|
||||
font-size: small;
|
||||
}
|
||||
p sub {
|
||||
vertical-align: baseline;
|
||||
position: relative;
|
||||
bottom: -.5em;
|
||||
font-size: small;
|
||||
}
|
||||
.footnote {
|
||||
font-size: medium;
|
||||
text-indent: 1em;
|
||||
text-align: justify;
|
||||
margin-top: .5em;
|
||||
}
|
||||
.image-right {
|
||||
float: right;
|
||||
margin-left: 1em;
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.image-caption {
|
||||
font-size: small;
|
||||
text-align: center;
|
||||
}
|
||||
450
versions/pcjs/1.19.3/document.xsl
Normal file
450
versions/pcjs/1.19.3/document.xsl
Normal file
|
|
@ -0,0 +1,450 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2014-02-23" license="http://www.gnu.org/licenses/gpl.html" -->
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
<!ENTITY nbsp " "> <!ENTITY ne "≠"> <!ENTITY le "≤"> <!ENTITY ge "≥">
|
||||
<!ENTITY times "×"> <!ENTITY sdot "⋅"> <!ENTITY divide "÷">
|
||||
<!ENTITY copy "©"> <!ENTITY Sigma "Σ"> <!ENTITY sigma "σ"> <!ENTITY sum "∑"> <!ENTITY lbrace "{">
|
||||
]>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:template name="documentStyles">
|
||||
<link rel="stylesheet" type="text/css" href="/versions/pcjs/1.19.3/document.css"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="title">
|
||||
<h1><xsl:apply-templates/></h1>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="p">
|
||||
<xsl:if test="@id">
|
||||
<a name="{@id}"></a>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(@class)">
|
||||
<p><xsl:apply-templates/></p>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<p class="{@class}"><xsl:apply-templates/></p>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="p">
|
||||
<xsl:call-template name="p"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="br">
|
||||
<br/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="p[@number]">
|
||||
<div class="pnumber">
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(@number) or @number = ''"> </xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@number"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</div>
|
||||
<div class="pitem">
|
||||
<xsl:call-template name="p"/>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="span">
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(@class)">
|
||||
<span><xsl:apply-templates/></span>
|
||||
</xsl:when>
|
||||
<xsl:when test="@class = 'italics'">
|
||||
<em><xsl:apply-templates/></em>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<span class="{@class}"><xsl:apply-templates/></span>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h2">
|
||||
<h2><xsl:apply-templates/></h2>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h3">
|
||||
<h3><xsl:apply-templates/></h3>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h4">
|
||||
<h4><xsl:apply-templates/></h4>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h5">
|
||||
<h5><xsl:apply-templates/></h5>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h6">
|
||||
<h6><xsl:apply-templates/></h6>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="em">
|
||||
<em><xsl:apply-templates/></em>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="strong">
|
||||
<strong><xsl:apply-templates/></strong>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="a">
|
||||
<a href="{@href}" target="{@target}"><xsl:apply-templates/></a>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ol">
|
||||
<blockquote><ol><xsl:apply-templates/></ol></blockquote>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ul">
|
||||
<blockquote><ul><xsl:apply-templates/></ul></blockquote>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="li">
|
||||
<li><xsl:apply-templates/></li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="img">
|
||||
<div><img src="{@src}" alt="image"/></div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="pre">
|
||||
<pre><xsl:apply-templates/></pre>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="figure">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@pos">
|
||||
<div class="{@pos}"><img src="{@ref}" alt="{.}"/><br/><xsl:value-of select="."/></div>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<div><img src="{@ref}" alt="{.}"/><br/><xsl:value-of select="."/></div>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sub">
|
||||
<sub><xsl:apply-templates/></sub>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sup">
|
||||
<sup><xsl:apply-templates/></sup>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lt"><</xsl:template>
|
||||
<xsl:template match="gt">></xsl:template>
|
||||
<xsl:template match="ne">≠</xsl:template>
|
||||
<xsl:template match="le">≤</xsl:template>
|
||||
<xsl:template match="ge">≥</xsl:template>
|
||||
<xsl:template match="times">×</xsl:template>
|
||||
<xsl:template match="dot">⋅</xsl:template>
|
||||
<xsl:template match="divide">÷</xsl:template>
|
||||
<xsl:template match="sigma">σ</xsl:template>
|
||||
|
||||
<xsl:template match="summation">
|
||||
<span class="summation">
|
||||
<span class="summation-upper"><xsl:value-of select="@upper"/></span>
|
||||
<span class="summation-symbol">∑</span>
|
||||
<span class="summation-lower"><xsl:value-of select="@lower"/></span>
|
||||
</span>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bracelist">
|
||||
<span class="bracelist-symbol">{</span>
|
||||
<span class="bracelist">
|
||||
<xsl:for-each select="item">
|
||||
<span class="bracelist-item"><xsl:apply-templates/></span>
|
||||
</xsl:for-each>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="footlink">
|
||||
<xsl:variable name="docID" select="/document/@id"/>
|
||||
<a class="footlink" id="fn{$docID}_ref{@n}" href="#fn{$docID}_{@n}"><sup><xsl:if test="@quoted"><xsl:text>[</xsl:text></xsl:if><xsl:value-of select="@n"/><xsl:if test="@quoted"><xsl:text>]</xsl:text></xsl:if></sup></a>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="footnote">
|
||||
<xsl:variable name="docID" select="/document/@id"/>
|
||||
<div class="footnote"><a id="fn{$docID}_{@n}" href="#fn{$docID}_ref{@n}"><sup><xsl:value-of select="@n"/></sup></a><xsl:text> </xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="authors">
|
||||
<xsl:for-each select="author"><xsl:if test="position() != 1"><xsl:text>, </xsl:text></xsl:if><xsl:if test="position() != 1 and position() = last()"><xsl:text>and </xsl:text></xsl:if><xsl:value-of select="."/></xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="formatDate">
|
||||
<xsl:param name="date"/>
|
||||
<xsl:param name="format">MDY</xsl:param>
|
||||
<xsl:variable name="year">
|
||||
<xsl:value-of select="substring-before($date,'-')"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="mon-day">
|
||||
<xsl:value-of select="substring-after($date,'-')"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="mon">
|
||||
<xsl:value-of select="substring-before($mon-day,'-')"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="full-day">
|
||||
<xsl:value-of select="substring-after($mon-day,'-')"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="day">
|
||||
<xsl:choose>
|
||||
<xsl:when test="substring($full-day,1,1) = '0'"><xsl:value-of select="substring($full-day,2)"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$full-day"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mon = '01'">January </xsl:when>
|
||||
<xsl:when test="$mon = '02'">February </xsl:when>
|
||||
<xsl:when test="$mon = '03'">March </xsl:when>
|
||||
<xsl:when test="$mon = '04'">April </xsl:when>
|
||||
<xsl:when test="$mon = '05'">May </xsl:when>
|
||||
<xsl:when test="$mon = '06'">June </xsl:when>
|
||||
<xsl:when test="$mon = '07'">July </xsl:when>
|
||||
<xsl:when test="$mon = '08'">August </xsl:when>
|
||||
<xsl:when test="$mon = '09'">September </xsl:when>
|
||||
<xsl:when test="$mon = '10'">October </xsl:when>
|
||||
<xsl:when test="$mon = '11'">November </xsl:when>
|
||||
<xsl:when test="$mon = '12'">December </xsl:when>
|
||||
<xsl:when test="$mon = '00'"/> </xsl:choose>
|
||||
<xsl:if test="$day != '0' and $format = 'MDY'">
|
||||
<xsl:value-of select="$day"/><xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="$year"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="gallery">
|
||||
<h2><xsl:value-of select="description"/></h2>
|
||||
<div class="gallery">
|
||||
<xsl:apply-templates select="item" mode="gallery"/>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="gallery">
|
||||
<div class="galleryitem">
|
||||
<a href="{@ref}"><img src="/versions/images/current/pdf-192.jpg" alt="{.}"/></a><br/>
|
||||
<div style="font-size:small; text-align:center;"><xsl:value-of select="."/></div>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list[@type = 'timeline']">
|
||||
<xsl:if test="not(description)">
|
||||
<h2>Timeline</h2>
|
||||
</xsl:if>
|
||||
<xsl:if test="description">
|
||||
<h2><xsl:value-of select="description"/></h2>
|
||||
</xsl:if>
|
||||
<blockquote>
|
||||
<xsl:apply-templates select="item" mode="timeline"/>
|
||||
</blockquote>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="timeline">
|
||||
<xsl:if test="@ref">
|
||||
<xsl:variable name="documentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($documentFile)/document" mode="withDate">
|
||||
<xsl:with-param name="itemRef" select="@ref"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
<xsl:if test="not(@ref)">
|
||||
<h3><xsl:call-template name="formatDate"><xsl:with-param name="date" select="@date"/></xsl:call-template></h3>
|
||||
<blockquote>
|
||||
<xsl:value-of select="."/>
|
||||
</blockquote>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list[@type = 'people']">
|
||||
<xsl:if test="not(description)">
|
||||
<h2>People</h2>
|
||||
</xsl:if>
|
||||
<xsl:if test="description">
|
||||
<h2><xsl:value-of select="description"/></h2>
|
||||
</xsl:if>
|
||||
<blockquote>
|
||||
<xsl:apply-templates select="item" mode="people"/>
|
||||
</blockquote>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="people">
|
||||
<h3><xsl:value-of select="name"/></h3>
|
||||
<xsl:apply-templates select="list"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list[@type = 'documents']">
|
||||
<xsl:if test="description"><h2><xsl:value-of select="description"/></h2></xsl:if>
|
||||
<ul>
|
||||
<xsl:apply-templates select="item" mode="document"/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="document">
|
||||
<xsl:variable name="documentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($documentFile)/document">
|
||||
<xsl:with-param name="itemRef" select="@ref"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="document">
|
||||
<xsl:param name="itemRef"/>
|
||||
<li>
|
||||
<xsl:call-template name="documentSummary"><xsl:with-param name="itemRef" select="$itemRef"/></xsl:call-template>
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="document" mode="withDate">
|
||||
<xsl:param name="itemRef"/>
|
||||
<h3><xsl:call-template name="formatDate"><xsl:with-param name="date" select="date"/><xsl:with-param name="format" select="MY"/></xsl:call-template></h3>
|
||||
<blockquote>
|
||||
<p>
|
||||
<xsl:call-template name="documentSummary"><xsl:with-param name="itemRef" select="$itemRef"/><xsl:with-param name="multiLine" select="'true'"/></xsl:call-template>
|
||||
</p>
|
||||
</blockquote>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="documentSummary">
|
||||
<xsl:param name="itemRef"/>
|
||||
<xsl:param name="multiLine">false</xsl:param>
|
||||
<xsl:choose>
|
||||
<xsl:when test="content|include">
|
||||
<a href="{$itemRef}"><xsl:value-of select="title"/></a>
|
||||
<xsl:if test="@ref">
|
||||
<span class="small">
|
||||
<xsl:text> [</xsl:text><a href="{@ref}">Original</a><xsl:text>]</xsl:text>
|
||||
</span>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<a href="{$itemRef}"><xsl:value-of select="title"/></a>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="copy">
|
||||
<span class="small">
|
||||
<xsl:text> [</xsl:text><a href="{copy/@ref}"><xsl:value-of select="copy"/></a><xsl:text>]</xsl:text>
|
||||
</span>
|
||||
</xsl:if>
|
||||
<xsl:if test="author"><xsl:if test="$multiLine = 'true'"><br/></xsl:if><span class="medium"><xsl:text> by </xsl:text><xsl:call-template name="authors"/></span></xsl:if>
|
||||
<xsl:if test="source">
|
||||
<span class="small">
|
||||
<br/>
|
||||
<xsl:text>[Source: </xsl:text>
|
||||
<xsl:if test="site">
|
||||
<a href="{site/@url}"><xsl:value-of select="site"/></a>
|
||||
</xsl:if>
|
||||
<xsl:if test="not(site)">
|
||||
<a href="{source/@url}"><xsl:value-of select="source"/></a>
|
||||
</xsl:if>
|
||||
<xsl:text>]</xsl:text>
|
||||
</span>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list[@type = 'resources']">
|
||||
<xsl:if test="not(description)">
|
||||
<h2>Resources</h2>
|
||||
</xsl:if>
|
||||
<xsl:if test="description">
|
||||
<h2><xsl:value-of select="description"/></h2>
|
||||
</xsl:if>
|
||||
<blockquote>
|
||||
<xsl:apply-templates select="item" mode="resources"/>
|
||||
</blockquote>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="resources">
|
||||
<h3><xsl:value-of select="description"/></h3>
|
||||
<xsl:apply-templates select="list"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list[@type = 'links']">
|
||||
<xsl:if test="description">
|
||||
<h4><xsl:value-of select="description"/></h4>
|
||||
</xsl:if>
|
||||
<ul>
|
||||
<xsl:apply-templates select="item" mode="links"/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="links">
|
||||
<li><a href="{@ref}"><xsl:value-of select="."/></a></li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list[not(@type)]">
|
||||
<xsl:if test="description">
|
||||
<h2><xsl:value-of select="description"/></h2>
|
||||
</xsl:if>
|
||||
<blockquote>
|
||||
<xsl:apply-templates select="item|tag" mode="outer"/>
|
||||
</blockquote>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="outer">
|
||||
<xsl:if test="description">
|
||||
<h3><xsl:value-of select="description"/></h3>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="list|item|tag" mode="inner"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list" mode="inner">
|
||||
<xsl:if test="description">
|
||||
<h4><xsl:value-of select="description"/></h4>
|
||||
</xsl:if>
|
||||
<ul>
|
||||
<xsl:apply-templates select="list|item|para|tag" mode="inner"/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="innerlist">
|
||||
<xsl:if test="description">
|
||||
<xsl:value-of select="description"/>
|
||||
</xsl:if>
|
||||
<ul>
|
||||
<xsl:apply-templates select="list|item|para|tag" mode="inner"/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="inner">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@ref">
|
||||
<li><a href="{@ref}"><xsl:apply-templates/></a></li>
|
||||
</xsl:when>
|
||||
<xsl:when test="description">
|
||||
<li><xsl:call-template name="innerlist"/></li>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<li><xsl:apply-templates/></li>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="para" mode="inner">
|
||||
<li class="para"><xsl:apply-templates/></li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="tag" mode="outer">
|
||||
<xsl:call-template name="tag"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="tag" mode="inner">
|
||||
<xsl:call-template name="tag"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="tag">
|
||||
<blockquote class="tag">
|
||||
<xsl:text><</xsl:text><xsl:if test="@href"><a href="{@href}"><xsl:value-of select="@name"/></a></xsl:if><xsl:if test="not(@href)"><xsl:value-of select="@name"/></xsl:if><xsl:for-each select="attr"><xsl:text> </xsl:text><xsl:value-of select="@name"/><xsl:text>="</xsl:text><xsl:value-of select="@value"/><xsl:text>"</xsl:text></xsl:for-each>
|
||||
<xsl:choose>
|
||||
<xsl:when test="tag"><xsl:text>></xsl:text><xsl:apply-templates mode="inner"/><xsl:text></</xsl:text><xsl:value-of select="@name"/><xsl:text>></xsl:text></xsl:when>
|
||||
<xsl:when test="normalize-space(.) != ''"><xsl:text>></xsl:text><xsl:value-of select="."/><xsl:text></</xsl:text><xsl:value-of select="@name"/><xsl:text>></xsl:text></xsl:when>
|
||||
<xsl:otherwise><xsl:text>/></xsl:text></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</blockquote>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
49
versions/pcjs/1.19.3/machine.xsl
Normal file
49
versions/pcjs/1.19.3/machine.xsl
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2014-02-23" license="http://www.gnu.org/licenses/gpl.html" -->
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
<!ENTITY nbsp " "> <!ENTITY sect "§"> <!ENTITY copy "©"> <!ENTITY para "¶"> <!ENTITY ndash "–"> <!ENTITY mdash "—">
|
||||
<!ENTITY lsquo "‘"> <!ENTITY rsquo "’"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY dagger "†"> <!ENTITY Dagger "‡">
|
||||
]>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:output doctype-system="about:legacy-compat"/>
|
||||
|
||||
<xsl:include href="/versions/pcjs/1.19.3/common.xsl"/>
|
||||
<xsl:include href="/versions/pcjs/1.19.3/components.xsl"/>
|
||||
|
||||
<xsl:template match="/machine">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title><xsl:value-of select="$SITEHOST"/></title>
|
||||
<xsl:call-template name="commonStyles"/>
|
||||
<xsl:call-template name="componentStyles"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="common">
|
||||
<xsl:call-template name="commonTop"/>
|
||||
<div class="common-middle">
|
||||
<p></p>
|
||||
<div id="{@id}" class="machine {@class}js">
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="@id"/>
|
||||
<xsl:with-param name="component" select="'machine'"/>
|
||||
<xsl:with-param name="class"><xsl:value-of select="@class"/>js</xsl:with-param>
|
||||
<xsl:with-param name="parms"><xsl:if test="@parms">,<xsl:value-of select="@parms"/></xsl:if></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</div>
|
||||
</div>
|
||||
<xsl:call-template name="commonBottom"/>
|
||||
</div>
|
||||
<xsl:call-template name="componentScripts">
|
||||
<xsl:with-param name="component">
|
||||
<xsl:choose>
|
||||
<xsl:when test="debugger"><xsl:value-of select="@class"/>-dbg</xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@class"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
247
versions/pcjs/1.19.3/manifest.xsl
Normal file
247
versions/pcjs/1.19.3/manifest.xsl
Normal file
|
|
@ -0,0 +1,247 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2014-04-10" modified="2014-04-10" license="http://www.gnu.org/licenses/gpl.html" -->
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
<!ENTITY nbsp " "> <!ENTITY sect "§"> <!ENTITY copy "©"> <!ENTITY para "¶"> <!ENTITY ndash "–"> <!ENTITY mdash "—">
|
||||
<!ENTITY lsquo "‘"> <!ENTITY rsquo "’"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY dagger "†"> <!ENTITY Dagger "‡">
|
||||
]>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:output doctype-system="about:legacy-compat"/>
|
||||
|
||||
<xsl:include href="/versions/pcjs/1.19.3/common.xsl"/>
|
||||
<xsl:include href="/versions/pcjs/1.19.3/components.xsl"/>
|
||||
|
||||
<xsl:template match="/manifest[@type = 'document']">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title><xsl:value-of select="$SITEHOST"/></title>
|
||||
<xsl:call-template name="commonStyles"/>
|
||||
<xsl:call-template name="componentStyles"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="common">
|
||||
<xsl:call-template name="commonTop"/>
|
||||
<div class="common-middle">
|
||||
<h4>Document Manifest</h4>
|
||||
<div class="common-sidebar">
|
||||
<ul class="common-list-data">
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Title'"/>
|
||||
<xsl:with-param name="node" select="title"/>
|
||||
<xsl:with-param name="default">None</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Version'"/>
|
||||
<xsl:with-param name="node" select="version"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Source'"/>
|
||||
<xsl:with-param name="node" select="source"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Documents'"/>
|
||||
<xsl:with-param name="node" select="document"/>
|
||||
<xsl:with-param name="default"><xsl:value-of select="title"/> <xsl:if test="version != ''"><xsl:text> </xsl:text><xsl:value-of select="version"/></xsl:if></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="common-main">
|
||||
<p><xsl:value-of select="desc"/></p>
|
||||
<xsl:call-template name="commonBottom"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="/manifest[@type = 'software' or not(@type)]">
|
||||
<xsl:variable name="machineClass">
|
||||
<xsl:choose>
|
||||
<xsl:when test="machine/@class"><xsl:value-of select="machine/@class"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$MACHINECLASS"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title><xsl:value-of select="$SITEHOST"/></title>
|
||||
<xsl:call-template name="commonStyles"/>
|
||||
<xsl:call-template name="componentStyles"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="common">
|
||||
<xsl:call-template name="commonTop"/>
|
||||
<div class="common-middle">
|
||||
<h4>Software Manifest</h4>
|
||||
<div class="common-sidebar">
|
||||
<ul class="common-list-data">
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Title'"/>
|
||||
<xsl:with-param name="node" select="title"/>
|
||||
<xsl:with-param name="default">None</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Version'"/>
|
||||
<xsl:with-param name="node" select="version"/>
|
||||
<xsl:with-param name="default">Unknown</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Type'"/>
|
||||
<xsl:with-param name="node" select="type"/>
|
||||
<xsl:with-param name="default">None</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Category'"/>
|
||||
<xsl:with-param name="node" select="category"/>
|
||||
<xsl:with-param name="default">None</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Created'"/>
|
||||
<xsl:with-param name="node" select="creationDate"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Creators'"/>
|
||||
<xsl:with-param name="node" select="creator"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label"><xsl:if test="creationDate">Updated</xsl:if><xsl:if test="not(creationDate)">Released</xsl:if></xsl:with-param>
|
||||
<xsl:with-param name="node" select="releaseDate"/>
|
||||
<xsl:with-param name="default">Unknown</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Company'"/>
|
||||
<xsl:with-param name="node" select="company"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Authors'"/>
|
||||
<xsl:with-param name="node" select="author"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Contributors'"/>
|
||||
<xsl:with-param name="node" select="contributor"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Publisher'"/>
|
||||
<xsl:with-param name="node" select="publisher"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'License'"/>
|
||||
<xsl:with-param name="node" select="license"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Source'"/>
|
||||
<xsl:with-param name="node" select="source"/>
|
||||
<xsl:with-param name="default" select="''"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="listItem">
|
||||
<xsl:with-param name="label" select="'Disks'"/>
|
||||
<xsl:with-param name="node" select="disk"/>
|
||||
<xsl:with-param name="default"><xsl:value-of select="title"/> <xsl:if test="version != ''"><xsl:text> </xsl:text><xsl:value-of select="version"/></xsl:if></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="common-main">
|
||||
<xsl:for-each select="machine[not(@type) or @type = 'default']">
|
||||
<xsl:call-template name="machine">
|
||||
<xsl:with-param name="href" select="@href"/>
|
||||
<xsl:with-param name="state" select="@state"/>
|
||||
</xsl:call-template>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="not(machine[not(@type) or @type = 'default'])">
|
||||
<p>No default machine specified for '<xsl:value-of select="title"/>' in manifest.xml</p>
|
||||
</xsl:if>
|
||||
<xsl:call-template name="commonBottom"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<xsl:call-template name="componentScripts">
|
||||
<xsl:with-param name="component">
|
||||
<xsl:choose>
|
||||
<xsl:when test="machine/@debugger"><xsl:value-of select="$machineClass"/>-dbg</xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$machineClass"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="listItem">
|
||||
<xsl:param name="label"/>
|
||||
<xsl:param name="node"/>
|
||||
<xsl:param name="default">Unknown</xsl:param>
|
||||
<xsl:if test="$node != '' or $default != ''">
|
||||
<li><xsl:value-of select="$label"/>
|
||||
<ul class="common-list-data-items">
|
||||
<xsl:for-each select="$node">
|
||||
<xsl:variable name="desc">
|
||||
<xsl:choose>
|
||||
<xsl:when test="desc"><xsl:value-of select="desc"/></xsl:when>
|
||||
<xsl:when test="org"><xsl:value-of select="org"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<li title="{$desc}">
|
||||
<xsl:variable name="value">
|
||||
<xsl:choose>
|
||||
<xsl:when test="name">
|
||||
<xsl:value-of select="name"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="normalize-space(./text()) != ''">
|
||||
<xsl:value-of select="normalize-space(./text())"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$default"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="href">
|
||||
<xsl:if test="@href"><xsl:value-of select="@href"/></xsl:if>
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$href != ''">
|
||||
<a href="{$href}"><xsl:value-of select="$value"/></a>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$value"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="page">
|
||||
<ul class="common-list-data-subitems">
|
||||
<xsl:for-each select="page">
|
||||
<li>
|
||||
<xsl:if test="@href">
|
||||
<a href="{$href}{@href}"><xsl:value-of select="."/></a>
|
||||
</xsl:if>
|
||||
<xsl:if test="not(@href)">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:if>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
</xsl:if>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="not($node)">
|
||||
<xsl:if test="@href">
|
||||
<a href="{@href}"><xsl:value-of select="$default"/></a>
|
||||
</xsl:if>
|
||||
<xsl:if test="not(@href)">
|
||||
<xsl:value-of select="$default"/>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</ul>
|
||||
</li>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
47
versions/pcjs/1.19.3/outline.xsl
Normal file
47
versions/pcjs/1.19.3/outline.xsl
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2014-02-23" license="http://www.gnu.org/licenses/gpl.html" -->
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
<!ENTITY nbsp " "> <!ENTITY sect "§"> <!ENTITY copy "©"> <!ENTITY para "¶"> <!ENTITY ndash "–"> <!ENTITY mdash "—">
|
||||
<!ENTITY lsquo "‘"> <!ENTITY rsquo "’"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY dagger "†"> <!ENTITY Dagger "‡">
|
||||
]>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:output doctype-system="about:legacy-compat"/>
|
||||
|
||||
<xsl:include href="/versions/pcjs/1.19.3/common.xsl"/>
|
||||
<xsl:include href="/versions/pcjs/1.19.3/document.xsl"/>
|
||||
<xsl:include href="/versions/pcjs/1.19.3/components.xsl"/>
|
||||
|
||||
<xsl:template match="/outline">
|
||||
<xsl:variable name="machineClass">
|
||||
<xsl:choose>
|
||||
<xsl:when test="machine/@class"><xsl:value-of select="machine/@class"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$MACHINECLASS"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title><xsl:value-of select="title"/><xsl:text> | </xsl:text><xsl:value-of select="$SITEHOST"/></title>
|
||||
<xsl:call-template name="commonStyles"/>
|
||||
<xsl:call-template name="documentStyles"/>
|
||||
<xsl:call-template name="componentStyles"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="common">
|
||||
<div class="page justified">
|
||||
<xsl:apply-templates/>
|
||||
</div>
|
||||
</div>
|
||||
<xsl:call-template name="componentScripts">
|
||||
<xsl:with-param name="component">
|
||||
<xsl:choose>
|
||||
<xsl:when test="debugger"><xsl:value-of select="$machineClass"/>-dbg</xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$machineClass"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
1192
versions/pcjs/1.19.3/pc-dbg.js
Normal file
1192
versions/pcjs/1.19.3/pc-dbg.js
Normal file
File diff suppressed because it is too large
Load diff
1048
versions/pcjs/1.19.3/pc.js
Normal file
1048
versions/pcjs/1.19.3/pc.js
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue