jeffpar / pcjs

The original IBM PC and other machine emulations in JavaScript
https://www.pcjs.org
Other
822 stars 124 forks source link

Emulator #4

Closed shavedchaff5106 closed 3 years ago

shavedchaff5106 commented 4 years ago

its not really a issue but how do i apply the emulator to my page i used this but it still wont work .-. i even added the extra command but it still doesnt work :(

(function(){var resources={"machine.xml":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?xml-stylesheet type=\"text/xsl\" href=\"/configs/pcx86/xsl/machine.xsl\"?>\n<machine id=\"deskpro386\" type=\"pcx86\" border=\"1\" pos=\"center\" background=\"default\" debugger=\"available\">\n\t<name pos=\"center\">COMPAQ DeskPro 386, 2Mb RAM, IBM VGA\n\t<computer id=\"deskpro386-vga-2048k\" name=\"COMPAQ DeskPro 386\" buswidth=\"32\"/>\n\t<cpu id=\"cpu386\" model=\"80386\"/>\n\t<ram id=\"ramLow\" addr=\"0x00000\" test=\"false\" size=\"0xa0000\" comment=\"ROM BIOS memory test has been disabled\"/>\n\t<ram id=\"ramCPQ\" addr=\"0xfa0000\" size=\"0x60000\" comment=\"COMPAQ memory at 0xFA0000\"/>\n\t<ram id=\"ramExt\" addr=\"0x100000\" size=\"0x100000\" comment=\"Extended memory at 0x100000\"/>\n\t<rom id=\"romBIOS\" addr=\"0xf8000\" size=\"0x8000\" alias=\"[0xf0000,0xffff0000,0xffff8000]\" file=\"/machines/pcx86/compaq/deskpro386/rom/1988-01-28/1988-01-28.json\"/>\n\t<video id=\"videoVGA\" model=\"vga\" screenWidth=\"1280\" screenHeight=\"960\" touchScreen=\"mouse\" autoLock=\"true\" pos=\"center\" padding=\"8px\">\n\t

\n\t\tVGA Color Display\n\t\t<control type=\"container\" pos=\"right\">\n\t\t\t<control type=\"led\" label=\"Caps\" binding=\"caps-lock\" padLeft=\"8px\"/>\n\t\t\t<control type=\"led\" label=\"Num\" binding=\"num-lock\" padLeft=\"8px\"/>\n\t\t\t<control type=\"led\" label=\"Scroll\" binding=\"scroll-lock\" padLeft=\"8px\"/>\n\t\t\t<control type=\"button\" binding=\"fullScreen\" padLeft=\"8px;line-height:1em\">Full Screen\n\t\t\n\t\n\t<rom id=\"romVGA\" addr=\"0xc0000\" size=\"0x6000\" file=\"/machines/pcx86/ibm/video/vga/1986-10-27/IBM-VGA.json\" notify=\"videoVGA[0x378d,0x3f8d,0x4eba]\"/>\n\n\n\t<fdc id=\"fdcNEC\" autoMount='{A: {name: \"COMPAQ MS-DOS 3.31 (Disk 2)\"}, B: {name: \"COMPAQ MS-DOS 3.31 (Disk 3)\"}}' diskettes=\"/configs/pcx86/diskettes.json,/configs/pcx86/private.json\" server=\"/diskettes\" sortBy=\"name\" pos=\"left\" padLeft=\"8px\" padBottom=\"8px\">\n\t<control type=\"list\" binding=\"listDrives\"/>\n\t<control type=\"list\" binding=\"listDisks\">\n\t\n\t<control type=\"button\" binding=\"loadDisk\">Load\n\t<control type=\"button\" binding=\"saveDisk\" padRight=\"8px\">Save\n\t<control type=\"description\" binding=\"descDisk\" padRight=\"8px\"/>\n\t<control type=\"file\" binding=\"mountDisk\"/>\n\n\n\t<hdc id=\"hdcAT\" type=\"ATAPI1\" drives='[{name:\"47Mb Hard Disk\",type:5}]'>\n\t<control type=\"button\" binding=\"saveHD0\" padLeft=\"8px\" padBottom=\"8px\" padRight=\"8px\">Save HD\n\t<control type=\"list\" binding=\"listDisks\" style=\"display:none\">\n\t\n\n\n\t<keyboard id=\"keyboard\" model=\"us84\" style=\"pointer-events:none;\">\n\t<control type=\"container\" style=\"pointer-events:auto;\">\n\t\t<control type=\"button\" binding=\"ctrl-alt-del\" padLeft=\"8px\" padBottom=\"8px\">Ctrl-Alt-Del\n\t\t<control type=\"button\" binding=\"keyboard\" padLeft=\"8px\" padBottom=\"8px\">Keys\n\t\n\t<control class=\"soft-keyboard\" type=\"container\" height=\"210px\" pos=\"center\" style=\"max-width:900px;display:none;pointer-events:auto;\" padding=\"8px\">\n\t\t<control type=\"key\" binding=\"f1\" top=\"0\" left=\"0\" width=\"3.78%\">F1\n\t\t<control type=\"key\" binding=\"f2\" top=\"0\" left=\"4.67%\" width=\"3.78%\">F2\n\t\t<control type=\"key\" binding=\"f3\" top=\"42px\" left=\"0\" width=\"3.78%\">F3\n\t\t<control type=\"key\" binding=\"f4\" top=\"42px\" left=\"4.67%\" width=\"3.78%\">F4\n\t\t<control type=\"key\" binding=\"f5\" top=\"84px\" left=\"0\" width=\"3.78%\">F5\n\t\t<control type=\"key\" binding=\"f6\" top=\"84px\" left=\"4.67%\" width=\"3.78%\">F6\n\t\t<control type=\"key\" binding=\"f7\" top=\"126px\" left=\"0\" width=\"3.78%\">F7\n\t\t<control type=\"key\" binding=\"f8\" top=\"126px\" left=\"4.67%\" width=\"3.78%\">F8\n\t\t<control type=\"key\" binding=\"f9\" top=\"168px\" left=\"0\" width=\"3.78%\">F9\n\t\t<control type=\"key\" binding=\"f10\" top=\"168px\" left=\"4.67%\" width=\"3.78%\">F10\n\t\t<control type=\"key\" binding=\"\" top=\"0\" left=\"10.67%\" width=\"3.78%\"> ~\n\t\t<control type=\"key\" binding=\"1\" top=\"0\" left=\"15.33%\" width=\"3.78%\">1 !\n\t\t<control type=\"key\" binding=\"2\" top=\"0\" left=\"20.00%\" width=\"3.78%\">2 @\n\t\t<control type=\"key\" binding=\"3\" top=\"0\" left=\"24.67%\" width=\"3.78%\">3

soulthunk commented 4 years ago

How are you applying it, and wherein this context?

shavedchaff5106 commented 4 years ago

what do you mean?

shavedchaff5106 commented 4 years ago

im trying to put it on my website but it wont work

jeffpar commented 3 years ago

This problem should be resolved in v2.06 (make sure the web page indicates "PCx86 v2.06"). The .js file created by the "Save Machine" request needed to be encoded with encodeURIComponent() rather than encodeURI(). This was already being done for Firefox, it wasn't necessary for Safari, and at some point, Chrome's behavior changed to match, so the browser-specific check has been removed.