├── js ├── prefix.js ├── master │ ├── master.js │ ├── utils.js │ ├── messagehandler.js │ └── dev │ │ ├── ethernet.js │ │ ├── framebuffer.js │ │ ├── sound.js │ │ └── filesystem.js ├── worker │ ├── worker.js │ ├── imul.js │ ├── dev │ │ ├── virtio │ │ │ ├── dummy.js │ │ │ ├── console.js │ │ │ ├── block.js │ │ │ └── net.js │ │ ├── timer.js │ │ ├── rom.js │ │ ├── framebuffer.js │ │ ├── clint.js │ │ ├── plic.js │ │ ├── rtc.js │ │ └── irq.js │ ├── messagehandler.js │ └── filesystem │ │ ├── fsloader.js │ │ └── lazyUint8Array.js ├── plugins │ ├── terminal-linux.js │ └── terminal-termjs.js └── lib │ ├── utf8.js │ └── download.js ├── demos ├── ace-editor-src-min-noconflict │ ├── mode-text.js │ ├── ext-error_marker.js │ ├── snippets │ │ ├── text.js │ │ ├── plain_text.js │ │ ├── snippets.js │ │ └── c_cpp.js │ ├── mode-plain_text.js │ ├── ext-linking.js │ ├── ext-prompt.js │ ├── ext-statusbar.js │ ├── ext-themelist.js │ ├── ext-spellcheck.js │ ├── theme-xcode.js │ ├── theme-clouds.js │ ├── theme-eclipse.js │ ├── theme-kuroir.js │ ├── theme-vibrant_ink.js │ ├── theme-dawn.js │ ├── theme-merbivore.js │ ├── theme-idle_fingers.js │ ├── theme-kr.js │ ├── theme-github.js │ ├── theme-solarized_dark.js │ ├── theme-cobalt.js │ ├── theme-solarized_light.js │ ├── theme-monokai.js │ ├── ext-whitespace.js │ ├── theme-clouds_midnight.js │ ├── theme-merbivore_soft.js │ ├── theme-twilight.js │ ├── theme-tomorrow.js │ ├── ext-static_highlight.js │ ├── theme-textmate.js │ ├── theme-pastel_on_dark.js │ ├── theme-chrome.js │ ├── theme-crimson_editor.js │ ├── theme-mono_industrial.js │ ├── theme-chaos.js │ ├── theme-tomorrow_night.js │ ├── theme-cloud9_day.js │ ├── theme-terminal.js │ ├── ext-modelist.js │ ├── theme-tomorrow_night_blue.js │ ├── theme-cloud9_night.js │ ├── theme-dreamweaver.js │ ├── theme-katzenmilch.js │ ├── theme-cloud9_night_low_color.js │ ├── theme-tomorrow_night_eighties.js │ ├── theme-tomorrow_night_bright.js │ ├── ext-keybinding_menu.js │ ├── mode-snippets.js │ ├── ext-beautify.js │ ├── ext-elastic_tabstops_lite.js │ ├── ext-split.js │ └── mode-python.js ├── images │ ├── globe.png │ ├── sync.png │ ├── tar.png │ ├── upload.png │ ├── fullscreen.png │ └── riscv_logo.png ├── bootstrap │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ └── js │ │ └── npm.js ├── simple.html ├── rtems.html ├── watch.html ├── css │ └── default.css └── riscv.html ├── .travis.yml ├── index.html ├── test ├── cpu-tests.js ├── cpu.html ├── cpu-facade.js └── 4KBsource.c ├── .gitmodules ├── .gitignore ├── .jshintrc ├── compile ├── package.json ├── LICENSE.md ├── README.md └── utils └── buildfs /js/prefix.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/mode-text.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 -------------------------------------------------------------------------------- /demos/images/globe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-macke/jor1k/HEAD/demos/images/globe.png -------------------------------------------------------------------------------- /demos/images/sync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-macke/jor1k/HEAD/demos/images/sync.png -------------------------------------------------------------------------------- /demos/images/tar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-macke/jor1k/HEAD/demos/images/tar.png -------------------------------------------------------------------------------- /js/master/master.js: -------------------------------------------------------------------------------- 1 | var Jor1k = require('./system'); 2 | 3 | module.exports = Jor1k; 4 | -------------------------------------------------------------------------------- /demos/images/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-macke/jor1k/HEAD/demos/images/upload.png -------------------------------------------------------------------------------- /demos/images/fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-macke/jor1k/HEAD/demos/images/fullscreen.png -------------------------------------------------------------------------------- /demos/images/riscv_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-macke/jor1k/HEAD/demos/images/riscv_logo.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/ext-error_marker.js: -------------------------------------------------------------------------------- 1 | (function(){ace.require(["ace/ext/error_marker"],function(){})})() -------------------------------------------------------------------------------- /test/cpu-tests.js: -------------------------------------------------------------------------------- 1 | var cpu = new CPU(); 2 | 3 | test('Processor flags', function() { 4 | equal(cpu.GetFlags(), 0x8001, 'Initial flags'); 5 | }); -------------------------------------------------------------------------------- /demos/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-macke/jor1k/HEAD/demos/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /demos/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-macke/jor1k/HEAD/demos/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/snippets/text.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/text",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="text"}) -------------------------------------------------------------------------------- /demos/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-macke/jor1k/HEAD/demos/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /demos/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-macke/jor1k/HEAD/demos/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/snippets/plain_text.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/plain_text",["require","exports","module"],function(e,t,n){t.snippetText="",t.scope="plain_text"}) -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "riscv-sys"] 2 | path = riscv-sys 3 | url = https://github.com/s-macke/riscv-sysroot.git 4 | [submodule "openrisc-sys"] 5 | path = openrisc-sys 6 | url = https://github.com/s-macke/jor1k-sysroot 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .DS_Store? 3 | ._* 4 | .Spotlight-V100 5 | .Trashes 6 | ehthumbs.db 7 | Thumbs.db 8 | .idea/ 9 | node_modules 10 | utils/fs.json 11 | utils/fs.xml 12 | utils/fs 13 | utils/fs2xml 14 | utils/packages 15 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/snippets/snippets.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/snippets",["require","exports","module"],function(e,t,n){t.snippetText="# snippets for making snippets :)\nsnippet snip\n snippet ${1:trigger}\n ${2}\nsnippet msnip\n snippet ${1:trigger} ${2:description}\n ${3}\nsnippet v\n {VISUAL}\n",t.scope="snippets"}) -------------------------------------------------------------------------------- /js/worker/worker.js: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------- 2 | // -------------------- Worker --------------------- 3 | // ------------------------------------------------- 4 | 5 | var message = require('./messagehandler'); 6 | var System = require('./system'); 7 | 8 | new System(); 9 | message.Send("WorkerReady", 0); 10 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "globals" : { 3 | "setTimeout": false, 4 | "clearTimeout": false, 5 | "require" : false, 6 | "ArrayBuffer": false, 7 | "Uint8Array": false, 8 | "Int8Array": false, 9 | "Uint16Array": false, 10 | "Int16Array": false, 11 | "Uint32Array": false, 12 | "Int32Array": false, 13 | "Float32Array": false, 14 | "module": false 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/cpu.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | QUnit Test Suite 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/mode-plain_text.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/plain_text",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/behaviour"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("./text_highlight_rules").TextHighlightRules,o=e("./behaviour").Behaviour,u=function(){this.HighlightRules=s,this.$behaviour=new o};r.inherits(u,i),function(){this.type="text",this.getNextLineIndent=function(e,t,n){return""},this.$id="ace/mode/plain_text"}.call(u.prototype),t.Mode=u}) -------------------------------------------------------------------------------- /js/worker/imul.js: -------------------------------------------------------------------------------- 1 | // In case math.imul doesn't exists: 2 | // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul 3 | 4 | module.exports = Math.imul || function(a, b) { 5 | var ah = (a >>> 16) & 0xffff; 6 | var al = a & 0xffff; 7 | var bh = (b >>> 16) & 0xffff; 8 | var bl = b & 0xffff; 9 | // the shift by 0 fixes the sign on the high part 10 | // the final |0 converts the unsigned value into a signed value 11 | return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0); 12 | }; 13 | -------------------------------------------------------------------------------- /demos/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /js/worker/dev/virtio/dummy.js: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------- 2 | // ------------- Dummy Virtio Device --------------- 3 | // ------------------------------------------------- 4 | 5 | "use strict"; 6 | 7 | var message = require('../../messagehandler'); 8 | var utils = require('../../utils'); 9 | 10 | function VirtioDummy(ramdev) { 11 | this.configspace = [0x0]; 12 | this.deviceid = 0x0; 13 | this.hostfeature = 0x0; 14 | this.Reset(); 15 | } 16 | 17 | VirtioDummy.prototype.Reset = function() { 18 | } 19 | 20 | VirtioDummy.prototype.ReceiveRequest = function (index, GetByte) { 21 | } 22 | 23 | module.exports = VirtioDummy; 24 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/ext-linking.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"],function(e,t,n){function i(e){var t=e.editor,n=e.getAccelKey();if(n){var t=e.editor,r=e.getDocumentPosition(),i=t.session,s=i.getTokenAt(r.row,r.column);t._emit("linkHover",{position:r,token:s})}}function s(e){var t=e.getAccelKey(),n=e.getButton();if(n==0&&t){var r=e.editor,i=e.getDocumentPosition(),s=r.session,o=s.getTokenAt(i.row,i.column);r._emit("linkClick",{position:i,token:o})}}var r=e("ace/editor").Editor;e("../config").defineOptions(r.prototype,"editor",{enableLinking:{set:function(e){e?(this.on("click",s),this.on("mousemove",i)):(this.off("click",s),this.off("mousemove",i))},value:!1}})}),function(){ace.require(["ace/ext/linking"],function(){})}() -------------------------------------------------------------------------------- /js/worker/dev/timer.js: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------- 2 | // -------------------- Timer ---------------------- 3 | // ------------------------------------------------- 4 | // Simple Timer running with the CPU frequency (20MHz) used to synchronize the cpu timers 5 | // the syncing is done directly in the cpu, so we can return zero here. 6 | 7 | "use strict"; 8 | 9 | var message = require('../messagehandler'); 10 | 11 | function TimerDev() { 12 | this.Reset(); 13 | } 14 | 15 | TimerDev.prototype.Reset = function() { 16 | this.sync = 0x0; 17 | } 18 | 19 | TimerDev.prototype.ReadReg32 = function (addr) { 20 | //message.Debug("Timer: Read reg " + addr); 21 | return this.sync; 22 | } 23 | 24 | TimerDev.prototype.WriteReg32 = function (addr, value) { 25 | message.Debug("Error in Timer: Write reg " + addr + " : " + value); 26 | } 27 | 28 | module.exports = TimerDev; 29 | -------------------------------------------------------------------------------- /demos/simple.html: -------------------------------------------------------------------------------- 1 | # 2 | 3 | 13 | 14 | 15 |

jor1k simple demo

16 | 17 | 18 |
19 | 20 | 21 | 22 | 40 | 41 | -------------------------------------------------------------------------------- /js/worker/dev/rom.js: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------- 2 | // --------------------- ROM ----------------------- 3 | // ------------------------------------------------- 4 | 5 | /* Basic Read Only Memory (ROM) device */ 6 | 7 | var utils = require('../utils'); 8 | var message = require('../messagehandler'); 9 | 10 | // constructor 11 | function ROMDev(rom) { 12 | this.rom = rom; 13 | this.buffer32view = new Int32Array(this.rom); 14 | this.buffer16view = new Int16Array(this.rom); 15 | this.buffer8view = new Int8Array(this.rom); 16 | } 17 | 18 | ROMDev.prototype.Reset = function () { 19 | }; 20 | 21 | ROMDev.prototype.ReadReg32 = function (addr) { 22 | return this.buffer32view[addr >> 2]; 23 | }; 24 | 25 | ROMDev.prototype.ReadReg16 = function (addr) { 26 | return this.buffer16view[addr >> 1]; 27 | }; 28 | 29 | ROMDev.prototype.ReadReg8 = function (addr) { 30 | return this.buffer8view[addr]; 31 | }; 32 | 33 | 34 | 35 | module.exports = ROMDev; 36 | 37 | 38 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/ext-prompt.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/prompt",["require","exports","module","ace/lib/lang","ace/lib/dom","ace/lib/event","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/editor","ace/multi_select"],function(e,t,n){function c(e,t){var n=this.pixelToScreenCoordinates(e,t);return this.session.screenToDocumentPosition(Math.min(this.session.getScreenLength()-1,Math.max(n.row,0)),Math.max(n.column,0))}var r=e("../lib/lang"),i=e("ace/lib/dom"),s=e("ace/lib/event"),o=e("ace/edit_session").EditSession,u=e("ace/undomanager").UndoManager,a=e("ace/virtual_renderer").VirtualRenderer,f=e("ace/editor").Editor,l=e("ace/multi_select").MultiSelect;t.singleLineEditor=function(e){var t=new a;t.container.style.overflow="hidden",t.screenToTextCoordinates=c,t.setStyle("ace_one-line");var n=new f(t);return n.session.setUndoManager(new u),n.setOptions({showPrintMargin:!1,showGutter:!1,highlightGutterLine:!1,focusWaitTimout:0,maxLines:4}),n}}),function(){ace.require(["ace/ext/prompt"],function(){})}() -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/ext-statusbar.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t,n){var r=e("ace/lib/dom"),i=e("ace/lib/lang"),s=function(e,t){this.element=r.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var n=i.delayedCall(function(){this.updateStatus(e)}.bind(this));e.on("changeStatus",function(){n.schedule(100)}),e.on("changeSelection",function(){n.schedule(100)})};(function(){this.updateStatus=function(e){function n(e,n){e&&t.push(e,n||"|")}var t=[];e.$vimModeHandler?n(e.$vimModeHandler.getStatusText()):e.commands.recording&&n("REC");var r=e.selection.lead;n(r.row+":"+r.column," ");if(!e.selection.isEmpty()){var i=e.getSelectionRange();n("("+(i.end.row-i.start.row)+":"+(i.end.column-i.start.column)+")")}t.pop(),this.element.textContent=t.join("")}}).call(s.prototype),t.StatusBar=s}),function(){ace.require(["ace/ext/statusbar"],function(){})}() -------------------------------------------------------------------------------- /compile: -------------------------------------------------------------------------------- 1 | set -e 2 | 3 | clang -Os --target=wasm32 -fno-delete-null-pointer-checks -c js/wasm/or1k.c -o or1k.o 4 | clang -Os --target=wasm32 -fno-delete-null-pointer-checks -c js/wasm/riscv.c -o riscv.o 5 | wasm-ld --global-base=0 --no-entry --strip-all --import-memory --export-all --allow-undefined or1k.o -o demos/or1k.wasm 6 | wasm-ld --global-base=0 --no-entry --strip-all --import-memory --export-all --allow-undefined riscv.o -o demos/riscv.wasm 7 | 8 | #emcc -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s TOTAL_MEMORY=32MB -s BINARYEN_IGNORE_IMPLICIT_TRAPS=1 -Os js/wasm/or1k.c -o demos/or1k.wasm 9 | #emcc -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s TOTAL_MEMORY=32MB -s BINARYEN_IGNORE_IMPLICIT_TRAPS=1 -Os js/wasm/riscv.c -o demos/riscv.wasm 10 | 11 | browserify -r ./js/plugins/terminal-linux.js:LinuxTerm -r ./js/master/master.js:Jor1k -o demos/jor1k-master-min.js 12 | browserify js/worker/worker.js -o demos/jor1k-worker-min.js 13 | 14 | #browserify -r ./js/plugins/terminal-linux.js:LinuxTerm -r ./js/plugins/terminal-termjs.js:TermJSTerm -r ./js/master/master.js:Jor1k -o demos/jor1k-master-min.js 15 | -------------------------------------------------------------------------------- /js/plugins/terminal-linux.js: -------------------------------------------------------------------------------- 1 | var Terminal = require("../master/dev/terminal"); 2 | 3 | function LinuxTerm(termElementId) { 4 | this.termElementId = termElementId; 5 | } 6 | 7 | LinuxTerm.prototype.Init = function(jor1kGUI, tty) { 8 | this.term = new Terminal(24, 80, this.termElementId); 9 | jor1kGUI.message.Register(tty, function(d) { 10 | d.forEach(function(c) { 11 | this.term.PutChar(c&0xFF); 12 | }.bind(this)); 13 | }.bind(this)); 14 | 15 | this.terminalcanvas = document.getElementById(this.termElementId); 16 | this.terminalcanvas.onmousedown = function(event) { 17 | if (!jor1kGUI.framebuffer) return; 18 | jor1kGUI.framebuffer.fbcanvas.style.border = "2px solid #000000"; 19 | }.bind(this); 20 | } 21 | 22 | LinuxTerm.prototype.WasHitByEvent = function(evt) { 23 | return this.terminalcanvas.contains(evt.target); 24 | } 25 | 26 | LinuxTerm.prototype.PauseBlink = function(pause) { 27 | this.term.PauseBlink(pause); 28 | } 29 | 30 | LinuxTerm.prototype.SetCharReceiveListener = function (callback) { 31 | this.term.OnCharReceived = callback; 32 | } 33 | 34 | LinuxTerm.prototype.RemoveCharReceiveListener = function () { 35 | this.term.OnCharReceived = function (){}; 36 | } 37 | 38 | module.exports = LinuxTerm; 39 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/ext-themelist.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"],function(e,t,n){e("ace/lib/fixoldbrowsers");var r=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["Solarized Light"],["TextMate"],["Tomorrow"],["XCode"],["Kuroir"],["KatzenMilch"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Cobalt","cobalt","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];t.themesByName={},t.themes=r.map(function(e){var n=e[1]||e[0].replace(/ /g,"_").toLowerCase(),r={caption:e[0],theme:"ace/theme/"+n,isDark:e[2]=="dark",name:n};return t.themesByName[n]=r,r})}),function(){ace.require(["ace/ext/themelist"],function(){})}() -------------------------------------------------------------------------------- /demos/rtems.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

jor1k RTEMS demo

4 | 5 | 10 | 11 |
12 | 13 | 14 | Terminal uses canvas 15 | 16 | 17 | 18 | 19 | 50 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/ext-spellcheck.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"],function(e,t,n){var r=e("../lib/event");t.contextMenuHandler=function(e){var t=e.target,n=t.textInput.getElement();if(!t.selection.isEmpty())return;var i=t.getCursorPosition(),s=t.session.getWordRange(i.row,i.column),o=t.session.getTextRange(s);t.session.tokenRe.lastIndex=0;if(!t.session.tokenRe.test(o))return;var u="\x01\x01",a=o+" "+u;n.value=a,n.setSelectionRange(o.length,o.length+1),n.setSelectionRange(0,0),n.setSelectionRange(0,o.length);var f=!1;r.addListener(n,"keydown",function l(){r.removeListener(n,"keydown",l),f=!0}),t.textInput.setInputHandler(function(e){console.log(e,a,n.selectionStart,n.selectionEnd);if(e==a)return"";if(e.lastIndexOf(a,0)===0)return e.slice(a.length);if(e.substr(n.selectionEnd)==a)return e.slice(0,-a.length);if(e.slice(-2)==u){var r=e.slice(0,-2);if(r.slice(-1)==" ")return f?r.substring(0,n.selectionEnd):(r=r.slice(0,-1),t.session.replace(s,r),"")}return e})};var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{spellcheck:{set:function(e){var n=this.textInput.getElement();n.spellcheck=!!e,e?this.on("nativecontextmenu",t.contextMenuHandler):this.removeListener("nativecontextmenu",t.contextMenuHandler)},value:!0}})}),function(){ace.require(["ace/ext/spellcheck"],function(){})}() -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jor1k", 3 | "version": "1.0.0", 4 | "description": "jor1k: OR1000 Javascript Emulator Running Linux", 5 | "contributors": [ 6 | { 7 | "name": "Sebastian Macke", 8 | "email": "sebastian@macke.de" 9 | }, 10 | { 11 | "name": "Gerard Braad", 12 | "email": "me@gbraad.nl" 13 | }, 14 | { 15 | "name": "Benjamin Burns", 16 | "email": "benjamin.c.burns@gmail.com" 17 | }, 18 | { 19 | "name": "Lawrence Angrave", 20 | "email": "root@localhost" 21 | }, 22 | { 23 | "name": "Neelabh Gupta", 24 | "email": "nsgupta2@illinois.edu" 25 | } 26 | ], 27 | "keywords": [ 28 | "or1k", 29 | "emulation" 30 | ], 31 | "author": "Sebastian Macke", 32 | "license": "simplified BSD", 33 | "bugs": { 34 | "url": "https://github.com/s-macke/jor1k/issues" 35 | }, 36 | "repository": { 37 | "type": "git", 38 | "url": "git://github.com/s-macke/jor1k.git" 39 | }, 40 | "main": "index.html", 41 | "dependencies": {}, 42 | "devDependencies": { 43 | "browserify": "^8.1.3", 44 | "expect": "^1.3.0", 45 | "jshint": "latest", 46 | "lab": "^5.2.0" 47 | }, 48 | "scripts": { 49 | "test": "lab --ignore onmessage -v test/cpu-facade.js", 50 | "postinstall": "./compile" 51 | }, 52 | "engines": { 53 | "node": ">= 0.8.0" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Sebastian Macke 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | -------------------------------------------------------------------------------- /js/worker/dev/framebuffer.js: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------- 2 | // ---------------- Framebuffer -------------------- 3 | // ------------------------------------------------- 4 | 5 | "use strict"; 6 | 7 | var utils = require('../utils'); 8 | var message = require('../messagehandler'); 9 | 10 | // constructor 11 | function FBDev(ram) { 12 | this.ram = ram; 13 | this.width = 640; 14 | this.height = 400; 15 | this.addr = 16000000; 16 | this.n = (this.width * this.height)>>1; 17 | this.buffer = new Int32Array(this.n); 18 | message.Register("GetFB", this.OnGetFB.bind(this) ); 19 | //this.buffer = new Uint8Array(0); 20 | } 21 | 22 | FBDev.prototype.Reset = function () { 23 | }; 24 | 25 | 26 | FBDev.prototype.ReadReg32 = function (addr) { 27 | return 0x0; 28 | }; 29 | 30 | FBDev.prototype.WriteReg32 = function (addr, value) { 31 | 32 | switch (addr) { 33 | case 0x14: 34 | this.addr = utils.Swap32(value); 35 | //this.buffer = new Uint8Array(this.ram.mem, this.addr, this.n); 36 | break; 37 | default: 38 | return; 39 | } 40 | }; 41 | 42 | FBDev.prototype.OnGetFB = function() { 43 | message.Send("GetFB", this.GetBuffer() ); 44 | } 45 | 46 | FBDev.prototype.GetBuffer = function () { 47 | //return this.buffer; 48 | var i=0, n = this.buffer.length; 49 | var data = this.buffer; 50 | var mem = this.ram.int32mem; 51 | var addr = this.addr>>2; 52 | for (i = 0; i < n; ++i) { 53 | data[i] = mem[addr+i]; 54 | } 55 | return this.buffer; 56 | } 57 | 58 | module.exports = FBDev; 59 | -------------------------------------------------------------------------------- /js/worker/dev/clint.js: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------- 2 | // --------------------- CLINT --------------------- 3 | // ------------------------------------------------- 4 | // CLINT (clock interrupt?) device for RISC-V 5 | 6 | // Actually this is mainly a dummy device as the timer 7 | // logic is managed directly by the CPU 8 | 9 | "use strict"; 10 | var message = require('../messagehandler'); 11 | var utils = require('../utils'); 12 | 13 | /* 14 | * 0000 msip hart 0 15 | * 0004 msip hart 1 16 | * ... 17 | * 4000 mtimecmp hart 0 lo 18 | * 4004 mtimecmp hart 0 hi 19 | * 4008 mtimecmp hart 1 lo 20 | * 400c mtimecmp hart 1 hi 21 | * ... 22 | * bff8 mtime lo 23 | * bffc mtime hi 24 | */ 25 | 26 | var CSR_TIMECMP = 0xC41; 27 | var CSR_TIME = 0xC01; 28 | 29 | function CLINTDev(csr) { 30 | this.csr = csr; 31 | this.Reset(); 32 | } 33 | 34 | CLINTDev.prototype.Reset = function() { 35 | // 64-Bit registers 36 | this.regs = new Uint32Array(0x3000); 37 | } 38 | 39 | CLINTDev.prototype.ReadReg32 = function (addr) { 40 | // no one ever read it 41 | message.Debug("CLINT: unknown ReadReg32: " + utils.ToHex(addr)); 42 | message.Abort(); 43 | return 0x0; 44 | } 45 | 46 | 47 | CLINTDev.prototype.WriteReg32 = function (addr, value) { 48 | addr = addr | 0; 49 | //message.Debug("CLINT: unknown WriteReg32: " + utils.ToHex(addr) + ": " + utils.ToHex(value)); 50 | this.regs[addr >> 2] = value; 51 | if (addr == 0x4000) { 52 | this.csr[CSR_TIMECMP] = value; 53 | //message.Debug("delta: " + (this.csr[CSR_TIMECMP] - this.csr[CSR_TIME])); 54 | } 55 | } 56 | 57 | module.exports = CLINTDev; 58 | -------------------------------------------------------------------------------- /js/master/utils.js: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------- 2 | // --------------------- Utils --------------------- 3 | // ------------------------------------------------- 4 | 5 | "use strict"; 6 | 7 | function UploadBinaryResource(url, filename, data, OnSuccess, OnError) { 8 | 9 | var boundary = "xxxxxxxxx"; 10 | 11 | var xhr = new XMLHttpRequest(); 12 | xhr.open('post', url, true); 13 | xhr.setRequestHeader("Content-Type", "multipart/form-data, boundary=" + boundary); 14 | //xhr.setRequestHeader("Content-Length", data.length); 15 | xhr.onreadystatechange = function () { 16 | if (xhr.readyState != 4) { 17 | return; 18 | } 19 | if ((xhr.status != 200) && (xhr.status != 0)) { 20 | OnError("Error: Could not upload file " + filename); 21 | return; 22 | } 23 | OnSuccess(this.responseText); 24 | }; 25 | 26 | var bodyheader = "--" + boundary + "\r\n"; 27 | bodyheader += 'Content-Disposition: form-data; name="uploaded"; filename="' + filename + '"\r\n'; 28 | bodyheader += "Content-Type: application/octet-stream\r\n\r\n"; 29 | 30 | var bodyfooter = "\r\n"; 31 | bodyfooter += "--" + boundary + "--"; 32 | 33 | var newdata = new Uint8Array(data.length + bodyheader.length + bodyfooter.length); 34 | var offset = 0; 35 | for(var i=0; i 2 | 3 |

jor1k file watch demo

4 | 5 | 6 | 7 | Terminal uses canvas 8 | 9 | 10 |

Shell History of ~/.ash_history

11 | 13 | 14 | 15 | 16 | 17 | 62 | 63 | -------------------------------------------------------------------------------- /test/cpu-facade.js: -------------------------------------------------------------------------------- 1 | // this needs to bre present in the global scope 2 | // for the message module 3 | global.onmessage = null; 4 | /*global.postMessage = function() { 5 | console.log(arguments); 6 | }*/ 7 | var RAM = require('../js/worker/ram'); 8 | var CPU = require('../js/worker/cpu'); 9 | 10 | var Lab = require('lab'); 11 | var lab = exports.lab = Lab.script(); 12 | var expect = require('expect'); 13 | 14 | ['safe','smp','asm'].forEach(function(cpuname) { 15 | 16 | lab.test(cpuname + ' CPU can add two 32 bit registers', function (done) { 17 | var memorySize = 2; // MB 18 | var ramOffset = 0x100000; 19 | 20 | var heap = new ArrayBuffer(memorySize * 0x100000); 21 | var h = new Uint32Array(heap); 22 | 23 | var registers = new Uint32Array(heap); 24 | var ram = new RAM(heap, ramOffset); 25 | //console.log('creating ' + cpuname + ' CPU'); 26 | var cpu = new CPU(cpuname, ram, heap, 1); // 1 core 27 | //console.log('done'); 28 | //console.log('reset'); 29 | cpu.Reset(); 30 | //console.log('done'); 31 | 32 | registers[0] = 0x00100000; 33 | registers[1] = 0x000AAAA0; 34 | //console.log(cpu.toString()); 35 | 36 | var add = 0x3 << 30 | 0x8 << 26 | 37 | 0x2 << 21 | // rD 38 | 0x0 << 16 | // rA 39 | 0x1 << 11; // rB 40 | 41 | var nop = 0x5 << 26 | 0x1 << 24; 42 | var initialPC = 0x40040; 43 | h[initialPC] = add; 44 | for(var i=0; i<20000; i++) { 45 | h[initialPC + i+1] = nop; 46 | } 47 | //console.log(cpu.toString()); 48 | //console.log('adding'); 49 | cpu.Step(64, 0); 50 | //console.log('done'); 51 | //console.log(cpu.toString()); 52 | 53 | expect(registers[2]).toEqual(0x001AAAA0); 54 | done(); 55 | }); 56 | }); 57 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-xcode.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/xcode",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-xcode",t.cssText="/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: EE3AD170-2B7F-4DE1-B724-C75F13FE0085) */.ace-xcode .ace_gutter {background: #e8e8e8;color: #333}.ace-xcode .ace_print-margin {width: 1px;background: #e8e8e8}.ace-xcode {background-color: #FFFFFF;color: #000000}.ace-xcode .ace_cursor {color: #000000}.ace-xcode .ace_marker-layer .ace_selection {background: #B5D5FF}.ace-xcode.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;border-radius: 2px}.ace-xcode .ace_marker-layer .ace_step {background: rgb(198, 219, 174)}.ace-xcode .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #BFBFBF}.ace-xcode .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.071)}.ace-xcode .ace_gutter-active-line {background-color: rgba(0, 0, 0, 0.071)}.ace-xcode .ace_marker-layer .ace_selected-word {border: 1px solid #B5D5FF}.ace-xcode .ace_constant.ace_language,.ace-xcode .ace_keyword,.ace-xcode .ace_meta,.ace-xcode .ace_variable.ace_language {color: #C800A4}.ace-xcode .ace_invisible {color: #BFBFBF}.ace-xcode .ace_constant.ace_character,.ace-xcode .ace_constant.ace_other {color: #275A5E}.ace-xcode .ace_constant.ace_numeric {color: #3A00DC}.ace-xcode .ace_entity.ace_other.ace_attribute-name,.ace-xcode .ace_support.ace_constant,.ace-xcode .ace_support.ace_function {color: #450084}.ace-xcode .ace_fold {background-color: #C800A4;border-color: #000000}.ace-xcode .ace_entity.ace_name.ace_tag,.ace-xcode .ace_support.ace_class,.ace-xcode .ace_support.ace_type {color: #790EAD}.ace-xcode .ace_storage {color: #C900A4}.ace-xcode .ace_string {color: #DF0002}.ace-xcode .ace_comment {color: #008E00}.ace-xcode .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/worker/dev/plic.js: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------- 2 | // ---------------------- PLIC --------------------- 3 | // ------------------------------------------------- 4 | // PLIC (Platform-Level Interrupt Controller) device for RISC-V 5 | 6 | "use strict"; 7 | var message = require('../messagehandler'); 8 | var utils = require('../utils'); 9 | 10 | /* 11 | * 0x0000 Priority Device 0 12 | * 0x0004 Priority Device 1 13 | * .... 14 | * 0x2000 enable bitmask 32-bit * 32 entries for handler 0 15 | * 0x2080 enable for handler 1 16 | * 0x200000 hart threshold 17 | * 0x200004 hart claim 18 | * 0x201000 hart threshold 19 | * ... 20 | */ 21 | 22 | var IRQ_S_EXT = 9; 23 | 24 | function PLICDev(cpuirqhandler) { 25 | this.cpuirqhandler = cpuirqhandler 26 | this.Reset(); 27 | } 28 | 29 | PLICDev.prototype.Reset = function() { 30 | // 32-Bit registers 31 | this.regs = new Uint32Array(0x3000); 32 | this.mask = 0x0; 33 | } 34 | 35 | PLICDev.prototype.ReadReg32 = function (addr) { 36 | //message.Debug("PLIC: unknown ReadReg32: " + utils.ToHex(addr)); 37 | var i = 0; 38 | if (addr == 0x00200004) { 39 | for(i=0; i<32; i++) 40 | if (this.mask & (1< span {font-weight: normal !important;}.ace-github .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-github .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-github .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-github .ace_gutter-active-line {background-color : rgba(0, 0, 0, 0.07);}.ace-github .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-github .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-github .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/master/messagehandler.js: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------- 2 | // ------------- MessageHandler -------------------- 3 | // ------------------------------------------------- 4 | 5 | "use strict"; 6 | 7 | var worker; 8 | 9 | var run = true; 10 | 11 | function Send(command, data) { 12 | worker.postMessage( 13 | { 14 | "command" : command, 15 | "data" : data 16 | } 17 | ); 18 | } 19 | 20 | function Debug(message) { 21 | console.log(message); 22 | } 23 | 24 | function Abort() { 25 | Debug("Master: Abort execution."); 26 | run = false; 27 | Send("Abort", {}); 28 | throw new Error('Kill master'); 29 | } 30 | 31 | function DoError(message) { 32 | Send("Debug", "Error: " + message); 33 | Abort(); 34 | } 35 | 36 | function Warning(message) { 37 | Send("Debug", "Warning: " + message); 38 | } 39 | 40 | var messagemap = new Object(); 41 | function Register(message, OnReceive) { 42 | messagemap[message] = OnReceive; 43 | } 44 | 45 | // this is a global object of the worker 46 | function OnMessage(e) { 47 | var command = e.data.command; 48 | 49 | // Debug Messages are always allowed 50 | if (command == "Debug") { 51 | messagemap[command](e.data.data); 52 | return; 53 | } 54 | 55 | if (!run) return; 56 | if (typeof messagemap[command] == 'function') { 57 | try { 58 | messagemap[command](e.data.data); 59 | } catch (error) { 60 | Debug("Master: Unhandled exception in command \"" + command + "\": " + error.message); 61 | run = false; 62 | } 63 | } 64 | } 65 | 66 | function SetWorker(_worker) { 67 | worker = _worker; 68 | worker.onmessage = OnMessage; 69 | worker.onerror = function(e) { 70 | Debug("Error at " + e.filename + ":" + e.lineno + ": " + e.message); 71 | Abort(); 72 | } 73 | Register("Abort", function(){Debug("Master: Received abort signal from worker"); run=false;}); 74 | Register("Debug", function(d){Debug(d);}); 75 | } 76 | 77 | module.exports.SetWorker = SetWorker; 78 | module.exports.Register = Register; 79 | module.exports.Debug = Debug; 80 | module.exports.Warning = Warning; 81 | module.exports.Error = DoError; 82 | module.exports.Abort = Abort; 83 | module.exports.Send = Send; 84 | 85 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-solarized_dark.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/solarized_dark",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-solarized-dark",t.cssText=".ace-solarized-dark .ace_gutter {background: #01313f;color: #d0edf7}.ace-solarized-dark .ace_print-margin {width: 1px;background: #33555E}.ace-solarized-dark {background-color: #002B36;color: #93A1A1}.ace-solarized-dark .ace_entity.ace_other.ace_attribute-name,.ace-solarized-dark .ace_storage {color: #93A1A1}.ace-solarized-dark .ace_cursor,.ace-solarized-dark .ace_string.ace_regexp {color: #D30102}.ace-solarized-dark .ace_marker-layer .ace_active-line,.ace-solarized-dark .ace_marker-layer .ace_selection {background: rgba(255, 255, 255, 0.1)}.ace-solarized-dark.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #002B36;border-radius: 2px}.ace-solarized-dark .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-solarized-dark .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(147, 161, 161, 0.50)}.ace-solarized-dark .ace_gutter-active-line {background-color: #0d3440}.ace-solarized-dark .ace_marker-layer .ace_selected-word {border: 1px solid #073642}.ace-solarized-dark .ace_invisible {color: rgba(147, 161, 161, 0.50)}.ace-solarized-dark .ace_keyword,.ace-solarized-dark .ace_meta,.ace-solarized-dark .ace_support.ace_class,.ace-solarized-dark .ace_support.ace_type {color: #859900}.ace-solarized-dark .ace_constant.ace_character,.ace-solarized-dark .ace_constant.ace_other {color: #CB4B16}.ace-solarized-dark .ace_constant.ace_language {color: #B58900}.ace-solarized-dark .ace_constant.ace_numeric {color: #D33682}.ace-solarized-dark .ace_fold {background-color: #268BD2;border-color: #93A1A1}.ace-solarized-dark .ace_entity.ace_name.ace_function,.ace-solarized-dark .ace_entity.ace_name.ace_tag,.ace-solarized-dark .ace_support.ace_function,.ace-solarized-dark .ace_variable,.ace-solarized-dark .ace_variable.ace_language {color: #268BD2}.ace-solarized-dark .ace_string {color: #2AA198}.ace-solarized-dark .ace_comment {font-style: italic;color: #657B83}.ace-solarized-dark .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNg0Db1ZVCxc/sPAAd4AlUHlLenAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-cobalt.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/cobalt",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-cobalt",t.cssText=".ace-cobalt .ace_gutter {background: #011e3a;color: #fff}.ace-cobalt .ace_print-margin {width: 1px;background: #011e3a}.ace-cobalt {background-color: #002240;color: #FFFFFF}.ace-cobalt .ace_cursor {color: #FFFFFF}.ace-cobalt .ace_marker-layer .ace_selection {background: rgba(179, 101, 57, 0.75)}.ace-cobalt.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #002240;border-radius: 2px}.ace-cobalt .ace_marker-layer .ace_step {background: rgb(127, 111, 19)}.ace-cobalt .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.15)}.ace-cobalt .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.35)}.ace-cobalt .ace_gutter-active-line {background-color: rgba(0, 0, 0, 0.35)}.ace-cobalt .ace_marker-layer .ace_selected-word {border: 1px solid rgba(179, 101, 57, 0.75)}.ace-cobalt .ace_invisible {color: rgba(255, 255, 255, 0.15)}.ace-cobalt .ace_keyword,.ace-cobalt .ace_meta {color: #FF9D00}.ace-cobalt .ace_constant,.ace-cobalt .ace_constant.ace_character,.ace-cobalt .ace_constant.ace_character.ace_escape,.ace-cobalt .ace_constant.ace_other {color: #FF628C}.ace-cobalt .ace_invalid {color: #F8F8F8;background-color: #800F00}.ace-cobalt .ace_support {color: #80FFBB}.ace-cobalt .ace_support.ace_constant {color: #EB939A}.ace-cobalt .ace_fold {background-color: #FF9D00;border-color: #FFFFFF}.ace-cobalt .ace_support.ace_function {color: #FFB054}.ace-cobalt .ace_storage {color: #FFEE80}.ace-cobalt .ace_entity {color: #FFDD00}.ace-cobalt .ace_string {color: #3AD900}.ace-cobalt .ace_string.ace_regexp {color: #80FFC2}.ace-cobalt .ace_comment {font-style: italic;color: #0088FF}.ace-cobalt .ace_heading,.ace-cobalt .ace_markup.ace_heading {color: #C8E4FD;background-color: #001221}.ace-cobalt .ace_list,.ace-cobalt .ace_markup.ace_list {background-color: #130D26}.ace-cobalt .ace_variable {color: #CCCCCC}.ace-cobalt .ace_variable.ace_language {color: #FF80E1}.ace-cobalt .ace_meta.ace_tag {color: #9EFFFF}.ace-cobalt .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHCLSvkPAAP3AgSDTRd4AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jor1k 2 | 3 | ![jor1k](https://jor1k.com/images/jor1k2.gif) 4 | 5 | jor1k is a OpenRISC 1000 emulator written in JavaScript running Linux. It runs in almost any modern web browser. 6 | Have a try and see if it runs in your browser by opening the [demo][project demo]. 7 | More information can be found on the [Wiki][project wiki] pages. 8 | 9 | ### Demos 10 | 11 | * Main [demo][project demo] page 12 | * [Edit, compile and run](https://s-macke.github.io/jor1k/demos/compile.html) C code in your browser 13 | * [Edit, compile and run](https://cs-education.github.io/sys/#VM) C code from the University of Illinois 14 | * Symmetric multiprocessing with [2 cores](https://s-macke.github.io/jor1k/demos/main.html?cpu=smp&n=2), [4 cores](https://s-macke.github.io/jor1k/demos/main.html?cpu=smp&n=4), [8 cores](https://s-macke.github.io/jor1k/demos/main.html?cpu=smp&n=8), [16 cores](https://s-macke.github.io/jor1k/demos/main.html?cpu=smp&n=16) (unstable with inreasing cores) 15 | * Simple [demo](https://s-macke.github.io/jor1k/demos/simple.html) 16 | * RTEMS (real time operating system) [demo](https://s-macke.github.io/jor1k/demos/rtems.html) 17 | * Simple [demo](https://s-macke.github.io/jor1k/demos/riscv.html) of the RISC-V CPU implementation. Wait until the first message appear in the terminal, then choose bbl in the dropdown menu. 18 | 19 | 20 | ### Project Links 21 | 22 | 23 | * [Bugtracker][project issues] to report any issues or feature requests 24 | * [Wiki][project wiki] containing more detailed descriptions 25 | 26 | ### LICENSE 27 | * The program is distributed under the terms of the Simplified BSD License. The license details can be found in the file "LICENSE.md" 28 | * The ACE editor is BSD licensed. 29 | 30 | ### Developer 31 | Sebastian Macke [simulationcorner.net](https://simulationcorner.net) 32 | 33 | ### Contributors 34 | Gerard Braad [github.com/gbraad](https://github.com/gbraad) 35 | Ben Burns [github.com/benjamincburns](https://github.com/benjamincburns) 36 | Lawrence Angrave [github.com/angrave](https://github.com/angrave) 37 | Neelabh Gupta [github.com/neelabhg](https://github.com/neelabhg) 38 | 39 | 40 | [openrisc website]: https://openrisc.io 41 | [project demo]: https://s-macke.github.io/jor1k/demos/main.html 42 | [project issues]: https://github.com/s-macke/jor1k/issues 43 | [project wiki]: https://github.com/s-macke/jor1k/wiki 44 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-solarized_light.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/solarized_light",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-solarized-light",t.cssText=".ace-solarized-light .ace_gutter {background: #fbf1d3;color: #333}.ace-solarized-light .ace_print-margin {width: 1px;background: #e8e8e8}.ace-solarized-light {background-color: #FDF6E3;color: #586E75}.ace-solarized-light .ace_cursor {color: #000000}.ace-solarized-light .ace_marker-layer .ace_selection {background: rgba(7, 54, 67, 0.09)}.ace-solarized-light.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FDF6E3;border-radius: 2px}.ace-solarized-light .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-solarized-light .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(147, 161, 161, 0.50)}.ace-solarized-light .ace_marker-layer .ace_active-line {background: #EEE8D5}.ace-solarized-light .ace_gutter-active-line {background-color : #EDE5C1}.ace-solarized-light .ace_marker-layer .ace_selected-word {border: 1px solid #073642}.ace-solarized-light .ace_invisible {color: rgba(147, 161, 161, 0.50)}.ace-solarized-light .ace_keyword,.ace-solarized-light .ace_meta,.ace-solarized-light .ace_support.ace_class,.ace-solarized-light .ace_support.ace_type {color: #859900}.ace-solarized-light .ace_constant.ace_character,.ace-solarized-light .ace_constant.ace_other {color: #CB4B16}.ace-solarized-light .ace_constant.ace_language {color: #B58900}.ace-solarized-light .ace_constant.ace_numeric {color: #D33682}.ace-solarized-light .ace_fold {background-color: #268BD2;border-color: #586E75}.ace-solarized-light .ace_entity.ace_name.ace_function,.ace-solarized-light .ace_entity.ace_name.ace_tag,.ace-solarized-light .ace_support.ace_function,.ace-solarized-light .ace_variable,.ace-solarized-light .ace_variable.ace_language {color: #268BD2}.ace-solarized-light .ace_storage {color: #073642}.ace-solarized-light .ace_string {color: #2AA198}.ace-solarized-light .ace_string.ace_regexp {color: #D30102}.ace-solarized-light .ace_comment,.ace-solarized-light .ace_entity.ace_other.ace_attribute-name {color: #93A1A1}.ace-solarized-light .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHjy8NJ/AAjgA5fzQUmBAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-monokai.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;border-radius: 2px}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/ext-whitespace.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t,n){var r=e("../lib/lang");t.$detectIndentation=function(e,t){function h(e){var t=0;for(var r=e;r0&&!(s%c)&&!(l%c)&&(r[c]=(r[c]||0)+1),n[l]=(n[l]||0)+1}s=l;while(ud.score&&(d={score:m,length:u})}if(d.score&&d.score>1.4)var g=d.length;if(i>v+1)return{ch:" ",length:g};if(v+1>i)return{ch:" ",length:g}},t.detectIndentation=function(e){var n=e.getLines(0,1e3),r=t.$detectIndentation(n)||{};return r.ch&&e.setUseSoftTabs(r.ch==" "),r.length&&e.setTabSize(r.length),r},t.trimTrailingSpace=function(e,t){var n=e.getDocument(),r=n.getAllLines(),i=t?-1:0;for(var s=0,o=r.length;si&&n.removeInLine(s,a,u.length)}},t.convertIndentation=function(e,t,n){var i=e.getTabString()[0],s=e.getTabSize();n||(n=s),t||(t=i);var o=t==" "?t:r.stringRepeat(t,n),u=e.doc,a=u.getAllLines(),f={},l={};for(var c=0,h=a.length;c 3) { 34 | message.Debug("Websocket error: Connection failed"); 35 | return; 36 | } 37 | this.ntries++; 38 | message.Debug("Websocket closed. Reopening."); 39 | this.OpenSocket(); 40 | } 41 | 42 | function EthernetErrorHandler(e) { 43 | // just report the error to console, close event 44 | // will handle reopening if possible 45 | message.Debug("Websocket error:"); 46 | message.Debug(e); 47 | } 48 | 49 | Ethernet.prototype.OpenSocket = function() { 50 | try { 51 | this.socket = new WebSocket(this.url); 52 | } catch(err) { 53 | delete this.socket; 54 | EthernetErrorHandler(err); 55 | return; 56 | } 57 | this.socket.binaryType = 'arraybuffer'; 58 | this.socket.onmessage = EthernetMessageHandler.bind(this); 59 | this.socket.onclose = EthernetCloseHandler.bind(this); 60 | this.socket.onopen = EthernetOpenHandler.bind(this); 61 | this.socket.onerror = EthernetErrorHandler.bind(this); 62 | } 63 | 64 | Ethernet.prototype.SendFrame = function(data) { 65 | if (typeof this.socket == "undefined") return; 66 | try { 67 | this.socket.send(data); 68 | } catch (err) { 69 | // this is unusual error, object exists, but send does not work 70 | EthernetErrorHandler(err); 71 | } 72 | } 73 | 74 | Ethernet.prototype.Close = function() { 75 | this.socket.onclose = undefined; 76 | this.socket.close(); 77 | } 78 | 79 | module.exports = Ethernet; 80 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-tomorrow.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/tomorrow",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-tomorrow",t.cssText=".ace-tomorrow .ace_gutter {background: #f6f6f6;color: #4D4D4C}.ace-tomorrow .ace_print-margin {width: 1px;background: #f6f6f6}.ace-tomorrow {background-color: #FFFFFF;color: #4D4D4C}.ace-tomorrow .ace_cursor {color: #AEAFAD}.ace-tomorrow .ace_marker-layer .ace_selection {background: #D6D6D6}.ace-tomorrow.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;border-radius: 2px}.ace-tomorrow .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-tomorrow .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #D1D1D1}.ace-tomorrow .ace_marker-layer .ace_active-line {background: #EFEFEF}.ace-tomorrow .ace_gutter-active-line {background-color : #dcdcdc}.ace-tomorrow .ace_marker-layer .ace_selected-word {border: 1px solid #D6D6D6}.ace-tomorrow .ace_invisible {color: #D1D1D1}.ace-tomorrow .ace_keyword,.ace-tomorrow .ace_meta,.ace-tomorrow .ace_storage,.ace-tomorrow .ace_storage.ace_type,.ace-tomorrow .ace_support.ace_type {color: #8959A8}.ace-tomorrow .ace_keyword.ace_operator {color: #3E999F}.ace-tomorrow .ace_constant.ace_character,.ace-tomorrow .ace_constant.ace_language,.ace-tomorrow .ace_constant.ace_numeric,.ace-tomorrow .ace_keyword.ace_other.ace_unit,.ace-tomorrow .ace_support.ace_constant,.ace-tomorrow .ace_variable.ace_parameter {color: #F5871F}.ace-tomorrow .ace_constant.ace_other {color: #666969}.ace-tomorrow .ace_invalid {color: #FFFFFF;background-color: #C82829}.ace-tomorrow .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #8959A8}.ace-tomorrow .ace_fold {background-color: #4271AE;border-color: #4D4D4C}.ace-tomorrow .ace_entity.ace_name.ace_function,.ace-tomorrow .ace_support.ace_function,.ace-tomorrow .ace_variable {color: #4271AE}.ace-tomorrow .ace_support.ace_class,.ace-tomorrow .ace_support.ace_type {color: #C99E00}.ace-tomorrow .ace_heading,.ace-tomorrow .ace_markup.ace_heading,.ace-tomorrow .ace_string {color: #718C00}.ace-tomorrow .ace_entity.ace_name.ace_tag,.ace-tomorrow .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow .ace_meta.ace_tag,.ace-tomorrow .ace_string.ace_regexp,.ace-tomorrow .ace_variable {color: #C82829}.ace-tomorrow .ace_comment {color: #8E908C}.ace-tomorrow .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/ext-static_highlight.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom"],function(e,t,n){var r=e("../edit_session").EditSession,i=e("../layer/text").Text,s=".ace_static_highlight {font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;font-size: 12px;}.ace_static_highlight .ace_gutter {width: 25px !important;display: block;float: left;text-align: right;padding: 0 3px 0 0;margin-right: 3px;position: static !important;}.ace_static_highlight .ace_line { clear: both; }.ace_static_highlight .ace_gutter-cell {-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;user-select: none;}.ace_static_highlight .ace_gutter-cell:before {content: counter(ace_line, decimal);counter-increment: ace_line;}.ace_static_highlight {counter-reset: ace_line;}",o=e("../config"),u=e("../lib/dom"),a=function(e,t,n){var r=e.className.match(/lang-(\w+)/),i=t.mode||r&&"ace/mode/"+r[1];if(!i)return!1;var s=t.theme||"ace/theme/textmate",o="",f=[];if(e.firstElementChild){var l=0;for(var c=0;c"),u||l.push(""),f.$renderLine(l,h,!0,!1),l.push("\n");var p="
"+"
"+l.join("")+"
"+"
";return f.destroy(),{css:s+n.cssText,html:p,session:a}},n.exports=a,n.exports.highlight=a}),function(){ace.require(["ace/ext/static_highlight"],function(){})}() -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-textmate.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;border-radius: 2px;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/snippets/c_cpp.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/c_cpp",["require","exports","module"],function(e,t,n){t.snippetText="## STL Collections\n# std::array\nsnippet array\n std::array<${1:T}, ${2:N}> ${3};${4}\n# std::vector\nsnippet vector\n std::vector<${1:T}> ${2};${3}\n# std::deque\nsnippet deque\n std::deque<${1:T}> ${2};${3}\n# std::forward_list\nsnippet flist\n std::forward_list<${1:T}> ${2};${3}\n# std::list\nsnippet list\n std::list<${1:T}> ${2};${3}\n# std::set\nsnippet set\n std::set<${1:T}> ${2};${3}\n# std::map\nsnippet map\n std::map<${1:Key}, ${2:T}> ${3};${4}\n# std::multiset\nsnippet mset\n std::multiset<${1:T}> ${2};${3}\n# std::multimap\nsnippet mmap\n std::multimap<${1:Key}, ${2:T}> ${3};${4}\n# std::unordered_set\nsnippet uset\n std::unordered_set<${1:T}> ${2};${3}\n# std::unordered_map\nsnippet umap\n std::unordered_map<${1:Key}, ${2:T}> ${3};${4}\n# std::unordered_multiset\nsnippet umset\n std::unordered_multiset<${1:T}> ${2};${3}\n# std::unordered_multimap\nsnippet ummap\n std::unordered_multimap<${1:Key}, ${2:T}> ${3};${4}\n# std::stack\nsnippet stack\n std::stack<${1:T}> ${2};${3}\n# std::queue\nsnippet queue\n std::queue<${1:T}> ${2};${3}\n# std::priority_queue\nsnippet pqueue\n std::priority_queue<${1:T}> ${2};${3}\n##\n## Access Modifiers\n# private\nsnippet pri\n private\n# protected\nsnippet pro\n protected\n# public\nsnippet pub\n public\n# friend\nsnippet fr\n friend\n# mutable\nsnippet mu\n mutable\n## \n## Class\n# class\nsnippet cl\n class ${1:`Filename('$1', 'name')`} \n {\n public:\n $1(${2});\n ~$1();\n\n private:\n ${3:/* data */}\n };\n# member function implementation\nsnippet mfun\n ${4:void} ${1:`Filename('$1', 'ClassName')`}::${2:memberFunction}(${3}) {\n ${5:/* code */}\n }\n# namespace\nsnippet ns\n namespace ${1:`Filename('', 'my')`} {\n ${2}\n } /* namespace $1 */\n##\n## Input/Output\n# std::cout\nsnippet cout\n std::cout << ${1} << std::endl;${2}\n# std::cin\nsnippet cin\n std::cin >> ${1};${2}\n##\n## Iteration\n# for i \nsnippet fori\n for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) {\n ${4:/* code */}\n }${5}\n\n# foreach\nsnippet fore\n for (${1:auto} ${2:i} : ${3:container}) {\n ${4:/* code */}\n }${5}\n# iterator\nsnippet iter\n for (${1:std::vector}<${2:type}>::${3:const_iterator} ${4:i} = ${5:container}.begin(); $4 != $5.end(); ++$4) {\n ${6}\n }${7}\n\n# auto iterator\nsnippet itera\n for (auto ${1:i} = $1.begin(); $1 != $1.end(); ++$1) {\n ${2:std::cout << *$1 << std::endl;}\n }${3}\n##\n## Lambdas\n# lamda (one line)\nsnippet ld\n [${1}](${2}){${3:/* code */}}${4}\n# lambda (multi-line)\nsnippet lld\n [${1}](${2}){\n ${3:/* code */}\n }${4}\n",t.scope="c_cpp"}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-pastel_on_dark.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/pastel_on_dark",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-pastel-on-dark",t.cssText=".ace-pastel-on-dark .ace_gutter {background: #353030;color: #8F938F}.ace-pastel-on-dark .ace_print-margin {width: 1px;background: #353030}.ace-pastel-on-dark {background-color: #2C2828;color: #8F938F}.ace-pastel-on-dark .ace_cursor {color: #A7A7A7}.ace-pastel-on-dark .ace_marker-layer .ace_selection {background: rgba(221, 240, 255, 0.20)}.ace-pastel-on-dark.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #2C2828;border-radius: 2px}.ace-pastel-on-dark .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-pastel-on-dark .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.25)}.ace-pastel-on-dark .ace_marker-layer .ace_active-line {background: rgba(255, 255, 255, 0.031)}.ace-pastel-on-dark .ace_gutter-active-line {background-color: rgba(255, 255, 255, 0.031)}.ace-pastel-on-dark .ace_marker-layer .ace_selected-word {border: 1px solid rgba(221, 240, 255, 0.20)}.ace-pastel-on-dark .ace_invisible {color: rgba(255, 255, 255, 0.25)}.ace-pastel-on-dark .ace_keyword,.ace-pastel-on-dark .ace_meta {color: #757aD8}.ace-pastel-on-dark .ace_constant,.ace-pastel-on-dark .ace_constant.ace_character,.ace-pastel-on-dark .ace_constant.ace_character.ace_escape,.ace-pastel-on-dark .ace_constant.ace_other {color: #4FB7C5}.ace-pastel-on-dark .ace_keyword.ace_operator {color: #797878}.ace-pastel-on-dark .ace_constant.ace_character {color: #AFA472}.ace-pastel-on-dark .ace_constant.ace_language {color: #DE8E30}.ace-pastel-on-dark .ace_constant.ace_numeric {color: #CCCCCC}.ace-pastel-on-dark .ace_invalid,.ace-pastel-on-dark .ace_invalid.ace_illegal {color: #F8F8F8;background-color: rgba(86, 45, 86, 0.75)}.ace-pastel-on-dark .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #D2A8A1}.ace-pastel-on-dark .ace_fold {background-color: #757aD8;border-color: #8F938F}.ace-pastel-on-dark .ace_support.ace_function {color: #AEB2F8}.ace-pastel-on-dark .ace_string {color: #66A968}.ace-pastel-on-dark .ace_string.ace_regexp {color: #E9C062}.ace-pastel-on-dark .ace_comment {color: #A6C6FF}.ace-pastel-on-dark .ace_variable {color: #BEBF55}.ace-pastel-on-dark .ace_variable.ace_language {color: #C1C144}.ace-pastel-on-dark .ace_xml-pe {color: #494949}.ace-pastel-on-dark .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYIiPj/8PAARgAh2NTMh8AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/css/default.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html, body { 7 | color: #333; 8 | } 9 | 10 | body { 11 | font: 13.34px helvetica,arial,freesans,clean,sans-serif; 12 | line-height: 1.4; 13 | margin: 30px; 14 | background: #F0F0F0; 15 | } 16 | 17 | h1, h2, h3, h4, h5, h6 { 18 | margin: 30px 0 10px 0; 19 | padding: 0; 20 | font-weight: bold; 21 | cursor: text; 22 | position: relative; 23 | color:#E0E0E0; 24 | text-indent: 10px; 25 | } 26 | 27 | h1 { 28 | margin-left: 30px; 29 | margin-right: 30px; 30 | display: block; 31 | /*vertical-align:middle*/ 32 | bottom: 20px; 33 | } 34 | 35 | .heading, .windows, .infobox { 36 | margin-top: 0px; 37 | margin-bottom: 0px; 38 | } 39 | 40 | .heading { 41 | overflow:auto; 42 | background: #2C458D; 43 | border-bottom-left-radius: 0px; 44 | border-bottom-right-radius: 0px; 45 | border-top-left-radius: 30px; 46 | border-top-right-radius: 30px; 47 | } 48 | 49 | .windows { 50 | overflow:auto; 51 | border-color: #2C458D; 52 | border-style: solid; 53 | } 54 | 55 | .infobox { 56 | overflow:auto; 57 | background: #2C458D; 58 | border-bottom-left-radius: 30px; 59 | border-bottom-right-radius: 30px; 60 | border-top-left-radius: 0px; 61 | border-top-right-radius: 0px; 62 | } 63 | 64 | li, ul { 65 | list-style: none; 66 | padding-left: 14px; 67 | color:#B0B0B0; 68 | } 69 | 70 | a:link, a:visited { 71 | color:#FF9000;; 72 | } 73 | 74 | img { 75 | border-style: none; 76 | } 77 | 78 | iframe { 79 | position: relative; 80 | top: 6px; 81 | } 82 | 83 | .terminal { 84 | border: 2px solid black; 85 | font-family: monospace,courier,fixed,swiss,sans-serif; 86 | font-variant-ligatures: none; 87 | font-weight: normal; 88 | font-size: 13px; 89 | color: #bbbbbb; 90 | background: #000000; 91 | border-collapse: collapse; 92 | line-height: normal; 93 | white-space: nowrap; 94 | } 95 | 96 | .screen { 97 | border: 0px solid black; 98 | } 99 | 100 | .contributor ul { 101 | padding: 0px; 102 | margin: 0px; 103 | } 104 | .contributor li { 105 | display: inline; 106 | padding: 0px; 107 | margin: 0px; 108 | height: 25px !important; 109 | line-height: 25px; 110 | } 111 | 112 | .contributor-info { 113 | width: 350px; 114 | } 115 | 116 | .donate { 117 | margin-top: 20px; 118 | } 119 | 120 | 121 | #infobox { 122 | margin-left: 20px; 123 | padding-bottom: 10px; 124 | } 125 | -------------------------------------------------------------------------------- /utils/buildfs: -------------------------------------------------------------------------------- 1 | 2 | set -e 3 | 4 | mkdir -p packages 5 | mkdir -p fs 6 | 7 | #-------------------------------- 8 | 9 | packages=( 10 | "DirectFB-examples.tar.bz2" 11 | "gcc.tar.bz2" 12 | "nbench.tar.bz2" 13 | "Frodo.tar.bz2" 14 | "joe.tar.bz2" 15 | "ncurses-dev.tar.bz2" 16 | "SDL-dev.tar.bz2" 17 | "ncurses.tar.bz2" 18 | "alsa.tar.bz2" 19 | "SDL.tar.bz2" 20 | "libjpeg-turbo.tar.bz2" 21 | "nmap.tar.bz2" 22 | "openssh.tar.bz2" 23 | "libpng.tar.bz2" 24 | "bc.tar.bz2" 25 | "links.tar.bz2" 26 | "openssl.tar.bz2" 27 | "certs.tar.bz2" 28 | "binutils.tar.bz2" 29 | "prboom.tar.bz2" 30 | "lua.tar.bz2" 31 | "scummvm.tar.bz2" 32 | "lynx.tar.bz2" 33 | "strace.tar.bz2" 34 | "directfb.tar.bz2" 35 | "make.tar.bz2" 36 | "dosbox.tar.bz2" 37 | "monkey.tar.bz2" 38 | "tslib.tar.bz2" 39 | "freetype.tar.bz2" 40 | "fontconfig.tar.bz2" 41 | "pixman.tar.bz2" 42 | "musl-dev.tar.bz2" 43 | "zlib.tar.bz2" 44 | "zlib-dev.tar.bz2" 45 | "frotz.tar.bz2" 46 | "musl.tar.bz2" 47 | "gcc-libs.tar.bz2" 48 | "nano.tar.bz2" 49 | "libX11.tar.bz2" 50 | "xkbcomp.tar.bz2" 51 | "font.tar.bz2" 52 | "mesa.tar.bz2" 53 | "xorg-server.tar.bz2" 54 | "glxgears.tar.bz2" 55 | "xinit.tar.bz2" 56 | "xclock.tar.bz2" 57 | "xterm.tar.bz2" 58 | "twm.tar.bz2" 59 | "xeyes.tar.bz2" 60 | "xcalc.tar.bz2" 61 | "expat.tar.bz2" 62 | "libffi.tar.bz2" 63 | "cairo.tar.bz2" 64 | "wayland.tar.bz2" 65 | "libdrm.tar.bz2" 66 | "mtdev.tar.bz2" 67 | "eudev.tar.bz2" 68 | "libxkbcommon.tar.bz2" 69 | "weston.tar.bz2" 70 | "xsetroot.tar.bz2" 71 | "curl.tar.bz2" 72 | "fltk.tar.bz2" 73 | "dillo.tar.bz2" 74 | "toppler.tar.bz2" 75 | "mplayer.tar.bz2" 76 | "frontier.tar.bz2" 77 | "alsa-utils.tar.bz2" 78 | "ltrace.tar.bz2" 79 | "htop.tar.bz2" 80 | "libevdev.tar.bz2" 81 | "libinput.tar.bz2" 82 | "compilepackages.tar.bz2" 83 | "autoconf.tar.bz2" 84 | "vim.tar.bz2" 85 | "git.tar.bz2" 86 | "file.tar.bz2" 87 | "screen.tar.bz2" 88 | "aalib.tar.bz2" 89 | "bb.tar.bz2" 90 | "libevent.tar.bz2" 91 | "libevent-dev.tar.bz2" 92 | "automake.tar.bz2" 93 | "m4.tar.bz2" 94 | "perl.tar.bz2" 95 | "ruby.tar.bz2" 96 | "php.tar.bz2" 97 | "flisp.tar.bz2" 98 | "python.tar.bz2" 99 | "tcl.tar.bz2" 100 | "tmux.tar.bz2" 101 | "mikmod.tar.bz2" 102 | ) 103 | 104 | list="" 105 | 106 | for i in "${packages[@]}" 107 | do 108 | if [ ! -f packages/$i ] ; then 109 | echo Download $i 110 | wget --quiet --directory-prefix=packages/ "http://jor1k.com/packages/$i" 111 | fi 112 | echo Testing $i 113 | tar -tjf packages/$i &> /dev/null 114 | list+=packages/$i" " 115 | done 116 | echo All files downloaded 117 | 118 | echo Compile converter 119 | gcc -O2 fs2xml.c -lbz2 -o fs2xml 120 | 121 | ./fs2xml $list 122 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-chrome.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/chrome",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-chrome",t.cssText='.ace-chrome .ace_gutter {background: #ebebeb;color: #333;overflow : hidden;}.ace-chrome .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-chrome {background-color: #FFFFFF;color: black;}.ace-chrome .ace_cursor {color: black;}.ace-chrome .ace_invisible {color: rgb(191, 191, 191);}.ace-chrome .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-chrome .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-chrome .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-chrome .ace_invalid {background-color: rgb(153, 0, 0);color: white;}.ace-chrome .ace_fold {}.ace-chrome .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-chrome .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-chrome .ace_support.ace_type,.ace-chrome .ace_support.ace_class.ace-chrome .ace_support.ace_other {color: rgb(109, 121, 222);}.ace-chrome .ace_variable.ace_parameter {font-style:italic;color:#FD971F;}.ace-chrome .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-chrome .ace_comment {color: #236e24;}.ace-chrome .ace_comment.ace_doc {color: #236e24;}.ace-chrome .ace_comment.ace_doc.ace_tag {color: #236e24;}.ace-chrome .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-chrome .ace_variable {color: rgb(49, 132, 149);}.ace-chrome .ace_xml-pe {color: rgb(104, 104, 91);}.ace-chrome .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-chrome .ace_heading {color: rgb(12, 7, 255);}.ace-chrome .ace_list {color:rgb(185, 6, 144);}.ace-chrome .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-chrome .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-chrome .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-chrome .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-chrome .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-chrome .ace_gutter-active-line {background-color : #dcdcdc;}.ace-chrome .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-chrome .ace_storage,.ace-chrome .ace_keyword,.ace-chrome .ace_meta.ace_tag {color: rgb(147, 15, 128);}.ace-chrome .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-chrome .ace_string {color: #1A1AA6;}.ace-chrome .ace_entity.ace_other.ace_attribute-name {color: #994409;}.ace-chrome .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-crimson_editor.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/crimson_editor",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssText='.ace-crimson-editor .ace_gutter {background: #ebebeb;color: #333;overflow : hidden;}.ace-crimson-editor .ace_gutter-layer {width: 100%;text-align: right;}.ace-crimson-editor .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-crimson-editor {background-color: #FFFFFF;color: rgb(64, 64, 64);}.ace-crimson-editor .ace_cursor {color: black;}.ace-crimson-editor .ace_invisible {color: rgb(191, 191, 191);}.ace-crimson-editor .ace_identifier {color: black;}.ace-crimson-editor .ace_keyword {color: blue;}.ace-crimson-editor .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-crimson-editor .ace_constant.ace_language {color: rgb(255, 156, 0);}.ace-crimson-editor .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-crimson-editor .ace_invalid {text-decoration: line-through;color: rgb(224, 0, 0);}.ace-crimson-editor .ace_fold {}.ace-crimson-editor .ace_support.ace_function {color: rgb(192, 0, 0);}.ace-crimson-editor .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-crimson-editor .ace_support.ace_type,.ace-crimson-editor .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-crimson-editor .ace_keyword.ace_operator {color: rgb(49, 132, 149);}.ace-crimson-editor .ace_string {color: rgb(128, 0, 128);}.ace-crimson-editor .ace_comment {color: rgb(76, 136, 107);}.ace-crimson-editor .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-crimson-editor .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-crimson-editor .ace_constant.ace_numeric {color: rgb(0, 0, 64);}.ace-crimson-editor .ace_variable {color: rgb(0, 64, 128);}.ace-crimson-editor .ace_xml-pe {color: rgb(104, 104, 91);}.ace-crimson-editor .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-crimson-editor .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-crimson-editor .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-crimson-editor .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-crimson-editor .ace_marker-layer .ace_active-line {background: rgb(232, 242, 254);}.ace-crimson-editor .ace_gutter-active-line {background-color : #dcdcdc;}.ace-crimson-editor .ace_meta.ace_tag {color:rgb(28, 2, 255);}.ace-crimson-editor .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-crimson-editor .ace_string.ace_regex {color: rgb(192, 0, 192);}.ace-crimson-editor .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.cssClass="ace-crimson-editor";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-mono_industrial.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/mono_industrial",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-mono-industrial",t.cssText=".ace-mono-industrial .ace_gutter {background: #1d2521;color: #C5C9C9}.ace-mono-industrial .ace_print-margin {width: 1px;background: #555651}.ace-mono-industrial {background-color: #222C28;color: #FFFFFF}.ace-mono-industrial .ace_cursor {color: #FFFFFF}.ace-mono-industrial .ace_marker-layer .ace_selection {background: rgba(145, 153, 148, 0.40)}.ace-mono-industrial.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #222C28;border-radius: 2px}.ace-mono-industrial .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-mono-industrial .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(102, 108, 104, 0.50)}.ace-mono-industrial .ace_marker-layer .ace_active-line {background: rgba(12, 13, 12, 0.25)}.ace-mono-industrial .ace_gutter-active-line {background-color: rgba(12, 13, 12, 0.25)}.ace-mono-industrial .ace_marker-layer .ace_selected-word {border: 1px solid rgba(145, 153, 148, 0.40)}.ace-mono-industrial .ace_invisible {color: rgba(102, 108, 104, 0.50)}.ace-mono-industrial .ace_string {background-color: #151C19;color: #FFFFFF}.ace-mono-industrial .ace_keyword,.ace-mono-industrial .ace_meta {color: #A39E64}.ace-mono-industrial .ace_constant,.ace-mono-industrial .ace_constant.ace_character,.ace-mono-industrial .ace_constant.ace_character.ace_escape,.ace-mono-industrial .ace_constant.ace_numeric,.ace-mono-industrial .ace_constant.ace_other {color: #E98800}.ace-mono-industrial .ace_entity.ace_name.ace_function,.ace-mono-industrial .ace_keyword.ace_operator,.ace-mono-industrial .ace_variable {color: #A8B3AB}.ace-mono-industrial .ace_invalid {color: #FFFFFF;background-color: rgba(153, 0, 0, 0.68)}.ace-mono-industrial .ace_support.ace_constant {color: #C87500}.ace-mono-industrial .ace_fold {background-color: #A8B3AB;border-color: #FFFFFF}.ace-mono-industrial .ace_support.ace_function {color: #588E60}.ace-mono-industrial .ace_entity.ace_name,.ace-mono-industrial .ace_support.ace_class,.ace-mono-industrial .ace_support.ace_type {color: #5778B6}.ace-mono-industrial .ace_storage {color: #C23B00}.ace-mono-industrial .ace_variable.ace_language,.ace-mono-industrial .ace_variable.ace_parameter {color: #648BD2}.ace-mono-industrial .ace_comment {color: #666C68;background-color: #151C19}.ace-mono-industrial .ace_entity.ace_other.ace_attribute-name {color: #909993}.ace-mono-industrial .ace_entity.ace_name.ace_tag {color: #A65EFF}.ace-mono-industrial .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ1NbwZfALD/4PAAlTArlEC4r/AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-chaos.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/chaos",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-chaos",t.cssText=".ace-chaos .ace_gutter {background: #141414;color: #595959;border-right: 1px solid #282828;}.ace-chaos .ace_gutter-cell.ace_warning {background-image: none;background: #FC0;border-left: none;padding-left: 0;color: #000;}.ace-chaos .ace_gutter-cell.ace_error {background-position: -6px center;background-image: none;background: #F10;border-left: none;padding-left: 0;color: #000;}.ace-chaos .ace_print-margin {border-left: 1px solid #555;right: 0;background: #1D1D1D;}.ace-chaos {background-color: #161616;color: #E6E1DC;}.ace-chaos .ace_cursor {border-left: 2px solid #FFFFFF;}.ace-chaos .ace_cursor.ace_overwrite {border-left: 0px;border-bottom: 1px solid #FFFFFF;}.ace-chaos .ace_marker-layer .ace_selection {background: #494836;}.ace-chaos .ace_marker-layer .ace_step {background: rgb(198, 219, 174);}.ace-chaos .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #FCE94F;}.ace-chaos .ace_marker-layer .ace_active-line {background: #333;}.ace-chaos .ace_gutter-active-line {background-color: #222;}.ace-chaos .ace_invisible {color: #404040;}.ace-chaos .ace_keyword {color:#00698F;}.ace-chaos .ace_keyword.ace_operator {color:#FF308F;}.ace-chaos .ace_constant {color:#1EDAFB;}.ace-chaos .ace_constant.ace_language {color:#FDC251;}.ace-chaos .ace_constant.ace_library {color:#8DFF0A;}.ace-chaos .ace_constant.ace_numeric {color:#58C554;}.ace-chaos .ace_invalid {color:#FFFFFF;background-color:#990000;}.ace-chaos .ace_invalid.ace_deprecated {color:#FFFFFF;background-color:#990000;}.ace-chaos .ace_support {color: #999;}.ace-chaos .ace_support.ace_function {color:#00AEEF;}.ace-chaos .ace_function {color:#00AEEF;}.ace-chaos .ace_string {color:#58C554;}.ace-chaos .ace_comment {color:#555;font-style:italic;padding-bottom: 0px;}.ace-chaos .ace_variable {color:#997744;}.ace-chaos .ace_meta.ace_tag {color:#BE53E6;}.ace-chaos .ace_entity.ace_other.ace_attribute-name {color:#FFFF89;}.ace-chaos .ace_markup.ace_underline {text-decoration: underline;}.ace-chaos .ace_fold-widget {text-align: center;}.ace-chaos .ace_fold-widget:hover {color: #777;}.ace-chaos .ace_fold-widget.ace_start,.ace-chaos .ace_fold-widget.ace_end,.ace-chaos .ace_fold-widget.ace_closed{background: none;border: none;box-shadow: none;}.ace-chaos .ace_fold-widget.ace_start:after {content: '\u25be'}.ace-chaos .ace_fold-widget.ace_end:after {content: '\u25b4'}.ace-chaos .ace_fold-widget.ace_closed:after {content: '\u2023'}.ace-chaos .ace_indent-guide {border-right:1px dotted #333;margin-right:-1px;}.ace-chaos .ace_fold { background: #222; border-radius: 3px; color: #7AF; border: none; }.ace-chaos .ace_fold:hover {background: #CCC; color: #000;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-tomorrow_night.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/tomorrow_night",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night",t.cssText=".ace-tomorrow-night .ace_gutter {background: #25282c;color: #C5C8C6}.ace-tomorrow-night .ace_print-margin {width: 1px;background: #25282c}.ace-tomorrow-night {background-color: #1D1F21;color: #C5C8C6}.ace-tomorrow-night .ace_cursor {color: #AEAFAD}.ace-tomorrow-night .ace_marker-layer .ace_selection {background: #373B41}.ace-tomorrow-night.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #1D1F21;border-radius: 2px}.ace-tomorrow-night .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-tomorrow-night .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #4B4E55}.ace-tomorrow-night .ace_marker-layer .ace_active-line {background: #282A2E}.ace-tomorrow-night .ace_gutter-active-line {background-color: #282A2E}.ace-tomorrow-night .ace_marker-layer .ace_selected-word {border: 1px solid #373B41}.ace-tomorrow-night .ace_invisible {color: #4B4E55}.ace-tomorrow-night .ace_keyword,.ace-tomorrow-night .ace_meta,.ace-tomorrow-night .ace_storage,.ace-tomorrow-night .ace_storage.ace_type,.ace-tomorrow-night .ace_support.ace_type {color: #B294BB}.ace-tomorrow-night .ace_keyword.ace_operator {color: #8ABEB7}.ace-tomorrow-night .ace_constant.ace_character,.ace-tomorrow-night .ace_constant.ace_language,.ace-tomorrow-night .ace_constant.ace_numeric,.ace-tomorrow-night .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night .ace_support.ace_constant,.ace-tomorrow-night .ace_variable.ace_parameter {color: #DE935F}.ace-tomorrow-night .ace_constant.ace_other {color: #CED1CF}.ace-tomorrow-night .ace_invalid {color: #CED2CF;background-color: #DF5F5F}.ace-tomorrow-night .ace_invalid.ace_deprecated {color: #CED2CF;background-color: #B798BF}.ace-tomorrow-night .ace_fold {background-color: #81A2BE;border-color: #C5C8C6}.ace-tomorrow-night .ace_entity.ace_name.ace_function,.ace-tomorrow-night .ace_support.ace_function,.ace-tomorrow-night .ace_variable {color: #81A2BE}.ace-tomorrow-night .ace_support.ace_class,.ace-tomorrow-night .ace_support.ace_type {color: #F0C674}.ace-tomorrow-night .ace_heading,.ace-tomorrow-night .ace_markup.ace_heading,.ace-tomorrow-night .ace_string {color: #B5BD68}.ace-tomorrow-night .ace_entity.ace_name.ace_tag,.ace-tomorrow-night .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night .ace_meta.ace_tag,.ace-tomorrow-night .ace_string.ace_regexp,.ace-tomorrow-night .ace_variable {color: #CC6666}.ace-tomorrow-night .ace_comment {color: #969896}.ace-tomorrow-night .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-cloud9_day.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/cloud9_day",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-cloud9-day",t.cssText='.ace-cloud9-day .ace_gutter {background: #ECECEC;color: #333;}.ace-cloud9-day .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-cloud9-day .ace_fold {background-color: #6B72E6;}.ace-cloud9-day {background-color: #F8F8F8;color: black;}.ace-cloud9-day .ace_cursor {color: black;}.ace-cloud9-day .ace_invisible {color: rgb(191, 191, 191);}.ace-cloud9-day .ace_storage,.ace-cloud9-day .ace_keyword {color: blue;}.ace-cloud9-day .ace_constant {color: rgb(197, 6, 11);}.ace-cloud9-day .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-cloud9-day .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-cloud9-day .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-cloud9-day .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-cloud9-day .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-cloud9-day .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-cloud9-day .ace_support.ace_type,.ace-cloud9-day .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-cloud9-day .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-cloud9-day .ace_string {color: rgb(3, 106, 7);}.ace-cloud9-day .ace_comment {color: rgb(76, 136, 107);}.ace-cloud9-day .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-cloud9-day .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-cloud9-day .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-cloud9-day .ace_variable {color: rgb(49, 132, 149);}.ace-cloud9-day .ace_xml-pe {color: rgb(104, 104, 91);}.ace-cloud9-day .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-cloud9-day .ace_heading {color: rgb(12, 7, 255);}.ace-cloud9-day .ace_list {color:rgb(185, 6, 144);}.ace-cloud9-day .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-cloud9-day .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-cloud9-day .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-cloud9-day.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;border-radius: 2px;}.ace-cloud9-day .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-cloud9-day .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-cloud9-day .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-cloud9-day .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-cloud9-day .ace_gutter-active-line {background-color : #dcdcdc;}.ace-cloud9-day .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-cloud9-day .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/worker/dev/virtio/console.js: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------- 2 | // ------------ Console Virtio Device -------------- 3 | // ------------------------------------------------- 4 | // http://docs.oasis-open.org/virtio/virtio/v1.0/csprd01/virtio-v1.0-csprd01.html#x1-1230003 5 | 6 | "use strict"; 7 | 8 | var message = require('../../messagehandler'); 9 | var utils = require('../../utils'); 10 | var marshall = require('./marshall'); 11 | 12 | var VIRTIO_CONSOLE_DEVICE_READY = 0; 13 | var VIRTIO_CONSOLE_PORT_ADD = 1; 14 | var VIRTIO_CONSOLE_PORT_REMOVE = 2; 15 | var VIRTIO_CONSOLE_PORT_READY = 3; 16 | var VIRTIO_CONSOLE_CONSOLE_PORT = 4; 17 | var VIRTIO_CONSOLE_RESIZE = 5; 18 | var VIRTIO_CONSOLE_PORT_OPEN = 6; 19 | var VIRTIO_CONSOLE_PORT_NAME = 7; 20 | 21 | function VirtioConsole(ramdev) { 22 | this.configspace = [80, 0, 24, 0, 1, 0, 0, 0]; // cols, rows, max_nr_ports 23 | this.deviceid = 0x3; 24 | this.hostfeature = 0x0; 25 | //this.hostfeature = 3; // VIRTIO_CONSOLE_F_MULTIPORT and VIRTIO_CONSOLE_F_SIZE 26 | //this.hostfeature = 2; // VIRTIO_CONSOLE_F_MULTIPORT 27 | 28 | this.replybuffersize = 0; 29 | this.replybuffer = new Uint8Array(8); 30 | 31 | //message.Register("virtio.tty" + id + ".transfer", this.ReceiveChar.bind(this) ); 32 | 33 | this.Reset(); 34 | } 35 | 36 | VirtioConsole.prototype.Receive = function(chars) { 37 | 38 | } 39 | 40 | VirtioConsole.prototype.Reset = function() { 41 | } 42 | 43 | VirtioConsole.prototype.ReceiveRequest = function (queueidx, index, GetByte, size) { 44 | message.Debug("Virtio console request of ringbuffer " + queueidx + " " + index + " " + size.read + " " + size.write) 45 | 46 | if (queueidx == 1) { 47 | var s = ""; 48 | for(var i=0; i> 0)&0xFF, 24 | (this.blocks >> 8)&0xFF, 25 | (this.blocks >> 16)&0xFF, 26 | 0x0, 0x0, 0x0, 0x0, 0x0]; // the size in little endian 27 | 28 | this.deviceid = 0x2; 29 | this.hostfeature = 0x0; 30 | this.replybuffer = new Uint8Array(0x10000); // there is no size limit 31 | this.replybuffersize = 0; 32 | this.buffer = new Uint8Array(this.blocks*512); 33 | this.Reset(); 34 | } 35 | 36 | VirtioBlock.prototype.Reset = function() { 37 | } 38 | 39 | VirtioBlock.prototype.ReceiveRequest = function (queueidx, index, GetByte, size) { 40 | //message.Debug("block device request: " + queueidx + " " + index + " " + size.read + " " + size.write); 41 | var request = marshall.Unmarshall2(["w", "w", "d"], GetByte); 42 | var type = request[0]; 43 | var sector = request[2]; 44 | //message.Debug("type: " + type + " sector: " + sector); 45 | 46 | switch(type) { 47 | case VIRTIO_BLK_T_IN: 48 | if (size.write > 0x10000) { 49 | message.Debug("Error in virtioblock: replybuffer too small"); 50 | message.Abort(); 51 | } 52 | for(var i=0; i> 24) & 0xF8; 73 | data[offset++] = (x >> 19) & 0xFC; 74 | data[offset++] = (x >> 13) & 0xF8; 75 | data[offset++] = 0xFF; 76 | data[offset++] = (x >> 8) & 0xF8; 77 | data[offset++] = (x >> 3) & 0xFC; 78 | data[offset++] = (x << 3) & 0xF8; 79 | data[offset++] = 0xFF; 80 | } 81 | 82 | //data.set(buffer); 83 | this.fbctx.putImageData(this.fbimageData, 0, 0); // at coords 0,0 84 | } 85 | 86 | 87 | module.exports = Framebuffer; 88 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-tomorrow_night_blue.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/tomorrow_night_blue",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night-blue",t.cssText=".ace-tomorrow-night-blue .ace_gutter {background: #00204b;color: #7388b5}.ace-tomorrow-night-blue .ace_print-margin {width: 1px;background: #00204b}.ace-tomorrow-night-blue {background-color: #002451;color: #FFFFFF}.ace-tomorrow-night-blue .ace_constant.ace_other,.ace-tomorrow-night-blue .ace_cursor {color: #FFFFFF}.ace-tomorrow-night-blue .ace_marker-layer .ace_selection {background: #003F8E}.ace-tomorrow-night-blue.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #002451;border-radius: 2px}.ace-tomorrow-night-blue .ace_marker-layer .ace_step {background: rgb(127, 111, 19)}.ace-tomorrow-night-blue .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404F7D}.ace-tomorrow-night-blue .ace_marker-layer .ace_active-line {background: #00346E}.ace-tomorrow-night-blue .ace_gutter-active-line {background-color: #022040}.ace-tomorrow-night-blue .ace_marker-layer .ace_selected-word {border: 1px solid #003F8E}.ace-tomorrow-night-blue .ace_invisible {color: #404F7D}.ace-tomorrow-night-blue .ace_keyword,.ace-tomorrow-night-blue .ace_meta,.ace-tomorrow-night-blue .ace_storage,.ace-tomorrow-night-blue .ace_storage.ace_type,.ace-tomorrow-night-blue .ace_support.ace_type {color: #EBBBFF}.ace-tomorrow-night-blue .ace_keyword.ace_operator {color: #99FFFF}.ace-tomorrow-night-blue .ace_constant.ace_character,.ace-tomorrow-night-blue .ace_constant.ace_language,.ace-tomorrow-night-blue .ace_constant.ace_numeric,.ace-tomorrow-night-blue .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night-blue .ace_support.ace_constant,.ace-tomorrow-night-blue .ace_variable.ace_parameter {color: #FFC58F}.ace-tomorrow-night-blue .ace_invalid {color: #FFFFFF;background-color: #F99DA5}.ace-tomorrow-night-blue .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #EBBBFF}.ace-tomorrow-night-blue .ace_fold {background-color: #BBDAFF;border-color: #FFFFFF}.ace-tomorrow-night-blue .ace_entity.ace_name.ace_function,.ace-tomorrow-night-blue .ace_support.ace_function,.ace-tomorrow-night-blue .ace_variable {color: #BBDAFF}.ace-tomorrow-night-blue .ace_support.ace_class,.ace-tomorrow-night-blue .ace_support.ace_type {color: #FFEEAD}.ace-tomorrow-night-blue .ace_heading,.ace-tomorrow-night-blue .ace_markup.ace_heading,.ace-tomorrow-night-blue .ace_string {color: #D1F1A9}.ace-tomorrow-night-blue .ace_entity.ace_name.ace_tag,.ace-tomorrow-night-blue .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night-blue .ace_meta.ace_tag,.ace-tomorrow-night-blue .ace_string.ace_regexp,.ace-tomorrow-night-blue .ace_variable {color: #FF9DA4}.ace-tomorrow-night-blue .ace_comment {color: #7285B7}.ace-tomorrow-night-blue .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYJDzqfwPAANXAeNsiA+ZAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-cloud9_night.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/cloud9_night",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-cloud9-night",t.cssText=".ace-cloud9-night .ace_gutter {background: #303130;color: #eee}.ace-cloud9-night .ace_print-margin {width: 1px;background: #222}.ace-cloud9-night {background-color: #181818;color: #EBEBEB}.ace-cloud9-night .ace_cursor {color: #9F9F9F}.ace-cloud9-night .ace_marker-layer .ace_selection {background: #424242}.ace-cloud9-night.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #000000;border-radius: 2px}.ace-cloud9-night .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-cloud9-night .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #888888}.ace-cloud9-night .ace_marker-layer .ace_highlight {border: 1px solid rgb(110, 119, 0);border-bottom: 0;box-shadow: inset 0 -1px rgb(110, 119, 0);margin: -1px 0 0 -1px;background: rgba(255, 235, 0, 0.1);}.ace-cloud9-night .ace_marker-layer .ace_active-line {background: #292929}.ace-cloud9-night .ace_gutter-active-line {background-color: #3D3D3D}.ace-cloud9-night .ace_stack {background-color: rgb(66, 90, 44)}.ace-cloud9-night .ace_marker-layer .ace_selected-word {border: 1px solid #888888}.ace-cloud9-night .ace_invisible {color: #343434}.ace-cloud9-night .ace_keyword,.ace-cloud9-night .ace_meta,.ace-cloud9-night .ace_storage,.ace-cloud9-night .ace_storage.ace_type,.ace-cloud9-night .ace_support.ace_type {color: #C397D8}.ace-cloud9-night .ace_keyword.ace_operator {color: #70C0B1}.ace-cloud9-night .ace_constant.ace_character,.ace-cloud9-night .ace_constant.ace_language,.ace-cloud9-night .ace_constant.ace_numeric,.ace-cloud9-night .ace_keyword.ace_other.ace_unit,.ace-cloud9-night .ace_support.ace_constant,.ace-cloud9-night .ace_variable.ace_parameter {color: #E78C45}.ace-cloud9-night .ace_constant.ace_other {color: #EEEEEE}.ace-cloud9-night .ace_invalid {color: #CED2CF;background-color: #DF5F5F}.ace-cloud9-night .ace_invalid.ace_deprecated {color: #CED2CF;background-color: #B798BF}.ace-cloud9-night .ace_fold {background-color: #7AA6DA;border-color: #DEDEDE}.ace-cloud9-night .ace_entity.ace_name.ace_function,.ace-cloud9-night .ace_support.ace_function,.ace-cloud9-night .ace_variable {color: #7AA6DA}.ace-cloud9-night .ace_support.ace_class,.ace-cloud9-night .ace_support.ace_type {color: #E7C547}.ace-cloud9-night .ace_heading,.ace-cloud9-night .ace_markup.ace_heading,.ace-cloud9-night .ace_string {color: #B9CA4A}.ace-cloud9-night .ace_entity.ace_name.ace_tag,.ace-cloud9-night .ace_entity.ace_other.ace_attribute-name,.ace-cloud9-night .ace_meta.ace_tag,.ace-cloud9-night .ace_string.ace_regexp,.ace-cloud9-night .ace_variable {color: #D54E53}.ace-cloud9-night .ace_comment {color: #969896}.ace-cloud9-night .ace_c9searchresults.ace_keyword {color: #C2C280;}.ace-cloud9-night .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-dreamweaver.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/dreamweaver",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-dreamweaver",t.cssText='.ace-dreamweaver .ace_gutter {background: #e8e8e8;color: #333;}.ace-dreamweaver .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-dreamweaver {background-color: #FFFFFF;color: black;}.ace-dreamweaver .ace_fold {background-color: #757AD8;}.ace-dreamweaver .ace_cursor {color: black;}.ace-dreamweaver .ace_invisible {color: rgb(191, 191, 191);}.ace-dreamweaver .ace_storage,.ace-dreamweaver .ace_keyword {color: blue;}.ace-dreamweaver .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-dreamweaver .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-dreamweaver .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-dreamweaver .ace_invalid {background-color: rgb(153, 0, 0);color: white;}.ace-dreamweaver .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-dreamweaver .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-dreamweaver .ace_support.ace_type,.ace-dreamweaver .ace_support.ace_class {color: #009;}.ace-dreamweaver .ace_support.ace_php_tag {color: #f00;}.ace-dreamweaver .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-dreamweaver .ace_string {color: #00F;}.ace-dreamweaver .ace_comment {color: rgb(76, 136, 107);}.ace-dreamweaver .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-dreamweaver .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-dreamweaver .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-dreamweaver .ace_variable {color: #06F}.ace-dreamweaver .ace_xml-pe {color: rgb(104, 104, 91);}.ace-dreamweaver .ace_entity.ace_name.ace_function {color: #00F;}.ace-dreamweaver .ace_heading {color: rgb(12, 7, 255);}.ace-dreamweaver .ace_list {color:rgb(185, 6, 144);}.ace-dreamweaver .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-dreamweaver .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-dreamweaver .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-dreamweaver .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-dreamweaver .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-dreamweaver .ace_gutter-active-line {background-color : #DCDCDC;}.ace-dreamweaver .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-dreamweaver .ace_meta.ace_tag {color:#009;}.ace-dreamweaver .ace_meta.ace_tag.ace_anchor {color:#060;}.ace-dreamweaver .ace_meta.ace_tag.ace_form {color:#F90;}.ace-dreamweaver .ace_meta.ace_tag.ace_image {color:#909;}.ace-dreamweaver .ace_meta.ace_tag.ace_script {color:#900;}.ace-dreamweaver .ace_meta.ace_tag.ace_style {color:#909;}.ace-dreamweaver .ace_meta.ace_tag.ace_table {color:#099;}.ace-dreamweaver .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-dreamweaver .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-katzenmilch.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/katzenmilch",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-katzenmilch",t.cssText=".ace-katzenmilch .ace_gutter,/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: ) */.ace-katzenmilch .ace_gutter {background: #e8e8e8;color: #333}.ace-katzenmilch .ace_print-margin {width: 1px;background: #e8e8e8}.ace-katzenmilch {background-color: #f3f2f3;color: rgba(15, 0, 9, 1.0)}.ace-katzenmilch .ace_cursor {border-left: 2px solid #100011}.ace-katzenmilch .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #100011}.ace-katzenmilch .ace_marker-layer .ace_selection {background: rgba(100, 5, 208, 0.27)}.ace-katzenmilch.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #f3f2f3;border-radius: 2px}.ace-katzenmilch .ace_marker-layer .ace_step {background: rgb(198, 219, 174)}.ace-katzenmilch .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #000000}.ace-katzenmilch .ace_marker-layer .ace_active-line {background: rgb(232, 242, 254)}.ace-katzenmilch .ace_gutter-active-line {background-color: rgb(232, 242, 254)}.ace-katzenmilch .ace_marker-layer .ace_selected-word {border: 1px solid rgba(100, 5, 208, 0.27)}.ace-katzenmilch .ace_fold {background-color: rgba(2, 95, 73, 0.97);border-color: rgba(15, 0, 9, 1.0)}.ace-katzenmilch .ace_keyword {color: #674Aa8;rbackground-color: rgba(163, 170, 216, 0.055)}.ace-katzenmilch .ace_constant.ace_language {color: #7D7e52;rbackground-color: rgba(189, 190, 130, 0.059)}.ace-katzenmilch .ace_constant.ace_numeric {color: rgba(79, 130, 123, 0.93);rbackground-color: rgba(119, 194, 187, 0.059)}.ace-katzenmilch .ace_constant.ace_character,.ace-katzenmilch .ace_constant.ace_other {color: rgba(2, 95, 105, 1.0);rbackground-color: rgba(127, 34, 153, 0.063)}.ace-katzenmilch .ace_support.ace_function {color: #9D7e62;rbackground-color: rgba(189, 190, 130, 0.039)}.ace-katzenmilch .ace_support.ace_class {color: rgba(239, 106, 167, 1.0);rbackground-color: rgba(239, 106, 167, 0.063)}.ace-katzenmilch .ace_storage {color: rgba(123, 92, 191, 1.0);rbackground-color: rgba(139, 93, 223, 0.051)}.ace-katzenmilch .ace_invalid {color: #DFDFD5;rbackground-color: #CC1B27}.ace-katzenmilch .ace_string {color: #5a5f9b;rbackground-color: rgba(170, 175, 219, 0.035)}.ace-katzenmilch .ace_comment {font-style: italic;color: rgba(64, 79, 80, 0.67);rbackground-color: rgba(95, 15, 255, 0.0078)}.ace-katzenmilch .ace_entity.ace_name.ace_function,.ace-katzenmilch .ace_variable {color: rgba(2, 95, 73, 0.97);rbackground-color: rgba(34, 255, 73, 0.12)}.ace-katzenmilch .ace_variable.ace_language {color: #316fcf;rbackground-color: rgba(58, 175, 255, 0.039)}.ace-katzenmilch .ace_variable.ace_parameter {font-style: italic;color: rgba(51, 150, 159, 0.87);rbackground-color: rgba(5, 214, 249, 0.043)}.ace-katzenmilch .ace_entity.ace_other.ace_attribute-name {color: rgba(73, 70, 194, 0.93);rbackground-color: rgba(73, 134, 194, 0.035)}.ace-katzenmilch .ace_entity.ace_name.ace_tag {color: #3976a2;rbackground-color: rgba(73, 166, 210, 0.039)}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-cloud9_night_low_color.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/cloud9_night_low_color",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-cloud9-night-low-color",t.cssText=".ace-cloud9-night-low-color .ace_gutter {background: #303130;color: #eee}.ace-cloud9-night-low-color .ace_print-margin {width: 1px;background: #222}.ace-cloud9-night-low-color {background-color: #181818;color: #EBEBEB}.ace-cloud9-night-low-color .ace_cursor {color: #9F9F9F}.ace-cloud9-night-low-color .ace_marker-layer .ace_selection {background: #424242}.ace-cloud9-night-low-color.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #000000;border-radius: 2px}.ace-cloud9-night-low-color .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-cloud9-night-low-color .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #888888}.ace-cloud9-night-low-color .ace_marker-layer .ace_highlight {border: 1px solid rgb(110, 119, 0);border-bottom: 0;box-shadow: inset 0 -1px rgb(110, 119, 0);margin: -1px 0 0 -1px;background: rgba(255, 235, 0, 0.1);}.ace-cloud9-night-low-color .ace_marker-layer .ace_active-line {background: #292929}.ace-cloud9-night-low-color .ace_gutter-active-line {background-color: #3D3D3D}.ace-cloud9-night-low-color .ace_stack {background-color: rgb(66, 90, 44)}.ace-cloud9-night-low-color .ace_marker-layer .ace_selected-word {border: 1px solid #888888}.ace-cloud9-night-low-color .ace_invisible {color: #343434}.ace-cloud9-night-low-color .ace_keyword,.ace-cloud9-night-low-color .ace_meta,.ace-cloud9-night-low-color .ace_storage {color: #C397D8}.ace-cloud9-night-low-color .ace_keyword.ace_operator {color: #70C0B1}.ace-cloud9-night-low-color .ace_constant.ace_character,.ace-cloud9-night-low-color .ace_constant.ace_language,.ace-cloud9-night-low-color .ace_constant.ace_numeric,.ace-cloud9-night-low-color .ace_keyword.ace_other.ace_unit {color: #B9CA4A}.ace-cloud9-night-low-color .ace_constant.ace_other {color: #EEEEEE}.ace-cloud9-night-low-color .ace_invalid {color: #CED2CF;background-color: #DF5F5F}.ace-cloud9-night-low-color .ace_invalid.ace_deprecated {color: #CED2CF;background-color: #B798BF}.ace-cloud9-night-low-color .ace_fold {background-color: #7AA6DA;border-color: #DEDEDE}.ace-cloud9-night-low-color .ace_entity.ace_name.ace_function,.ace-cloud9-night-low-color .ace_support.ace_function,.ace-cloud9-night-low-color .ace_variable:not(.ace_parameter),.ace-cloud9-night-low-color .ace_constant:not(.ace_numeric) {color: #7AA6DA}.ace-cloud9-night-low-color .ace_support.ace_class,.ace-cloud9-night-low-color .ace_support.ace_type {color: #E7C547}.ace-cloud9-night-low-color .ace_heading,.ace-cloud9-night-low-color .ace_markup.ace_heading,.ace-cloud9-night-low-color .ace_string {color: #B9CA4A}.ace-cloud9-night-low-color .ace_comment {color: #969896}.ace-cloud9-night-low-color .ace_c9searchresults.ace_keyword {color: #C2C280;}.ace-cloud9-night-low-color .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/theme-tomorrow_night_eighties.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/tomorrow_night_eighties",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night-eighties",t.cssText=".ace-tomorrow-night-eighties .ace_gutter {background: #272727;color: #CCC}.ace-tomorrow-night-eighties .ace_print-margin {width: 1px;background: #272727}.ace-tomorrow-night-eighties {background-color: #2D2D2D;color: #CCCCCC}.ace-tomorrow-night-eighties .ace_constant.ace_other,.ace-tomorrow-night-eighties .ace_cursor {color: #CCCCCC}.ace-tomorrow-night-eighties .ace_marker-layer .ace_selection {background: #515151}.ace-tomorrow-night-eighties.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #2D2D2D;border-radius: 2px}.ace-tomorrow-night-eighties .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-tomorrow-night-eighties .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #6A6A6A}.ace-tomorrow-night-bright .ace_stack {background: rgb(66, 90, 44)}.ace-tomorrow-night-eighties .ace_marker-layer .ace_active-line {background: #393939}.ace-tomorrow-night-eighties .ace_gutter-active-line {background-color: #393939}.ace-tomorrow-night-eighties .ace_marker-layer .ace_selected-word {border: 1px solid #515151}.ace-tomorrow-night-eighties .ace_invisible {color: #6A6A6A}.ace-tomorrow-night-eighties .ace_keyword,.ace-tomorrow-night-eighties .ace_meta,.ace-tomorrow-night-eighties .ace_storage,.ace-tomorrow-night-eighties .ace_storage.ace_type,.ace-tomorrow-night-eighties .ace_support.ace_type {color: #CC99CC}.ace-tomorrow-night-eighties .ace_keyword.ace_operator {color: #66CCCC}.ace-tomorrow-night-eighties .ace_constant.ace_character,.ace-tomorrow-night-eighties .ace_constant.ace_language,.ace-tomorrow-night-eighties .ace_constant.ace_numeric,.ace-tomorrow-night-eighties .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night-eighties .ace_support.ace_constant,.ace-tomorrow-night-eighties .ace_variable.ace_parameter {color: #F99157}.ace-tomorrow-night-eighties .ace_invalid {color: #CDCDCD;background-color: #F2777A}.ace-tomorrow-night-eighties .ace_invalid.ace_deprecated {color: #CDCDCD;background-color: #CC99CC}.ace-tomorrow-night-eighties .ace_fold {background-color: #6699CC;border-color: #CCCCCC}.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_function,.ace-tomorrow-night-eighties .ace_support.ace_function,.ace-tomorrow-night-eighties .ace_variable {color: #6699CC}.ace-tomorrow-night-eighties .ace_support.ace_class,.ace-tomorrow-night-eighties .ace_support.ace_type {color: #FFCC66}.ace-tomorrow-night-eighties .ace_heading,.ace-tomorrow-night-eighties .ace_markup.ace_heading,.ace-tomorrow-night-eighties .ace_string {color: #99CC99}.ace-tomorrow-night-eighties .ace_comment {color: #999999}.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_tag,.ace-tomorrow-night-eighties .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night-eighties .ace_meta.ace_tag,.ace-tomorrow-night-eighties .ace_variable {color: #F2777A}.ace-tomorrow-night-eighties .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ09NrYAgMjP4PAAtGAwchHMyAAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/master/dev/sound.js: -------------------------------------------------------------------------------- 1 | // Provides a loop sound buffer. 2 | 3 | var message = require('../messagehandler'); 4 | 5 | "use strict"; 6 | 7 | function LoopSoundBuffer(samplerate) { 8 | this.enabled = false; 9 | this.nperiods = 8; // number of periods 10 | 11 | this.source = new Array(this.nperiods); 12 | this.soundbuffer = new Array(this.nperiods); 13 | 14 | this.period = 0; 15 | this.periodsize = 0; 16 | this.bufferpos = 0; 17 | 18 | if (typeof AudioContext == "undefined") return; 19 | 20 | this.context = new AudioContext(); 21 | this.SetRate(samplerate); 22 | } 23 | 24 | LoopSoundBuffer.prototype.SetRate = function(rate) { 25 | if (this.samplerate == rate) return; 26 | if (typeof this.context === "undefined") return; 27 | this.samplerate = rate; 28 | this.periodsize = Math.floor(this.samplerate/4); // 250ms 29 | this.sampleslen = this.periodsize*this.nperiods; 30 | this.buffer = new Float32Array(this.sampleslen); 31 | 32 | for(var i=0; i (this.period+5)) { 87 | this.bufferpos = this.periodsize*(this.period+4); 88 | //message.Debug("Warning: Sound buffer overrun, resetting"); 89 | } 90 | 91 | for(var i=0; i'+t.command+" : "+''+t.key+""},"");s.id="kbshortcutmenu",s.innerHTML="

Keyboard Shortcuts

"+o+"",n(t,s,"0","0","0",null)}}var r=e("ace/editor").Editor;n.exports.init=function(e){r.prototype.showKeyboardShortcuts=function(){i(this)},e.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e,t){e.showKeyboardShortcuts()}}])}}),ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){var r=e("../../lib/dom"),i="#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);-webkit-transition: all 0.5s;transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 1000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}";r.importCssString(i),n.exports.overlayPage=function(t,n,i,s,o,u){function l(e){e.keyCode===27&&a.click()}i=i?"top: "+i+";":"",o=o?"bottom: "+o+";":"",s=s?"right: "+s+";":"",u=u?"left: "+u+";":"";var a=document.createElement("div"),f=document.createElement("div");a.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; background-color: rgba(0, 0, 0, 0.3);",a.addEventListener("click",function(){document.removeEventListener("keydown",l),a.parentNode.removeChild(a),t.focus(),a=null}),document.addEventListener("keydown",l),f.style.cssText=i+s+o+u,f.addEventListener("click",function(e){e.stopPropagation()});var c=r.createElement("div");c.style.position="relative";var h=r.createElement("div");h.className="ace_closeButton",h.addEventListener("click",function(){a.click()}),c.appendChild(h),f.appendChild(c),f.appendChild(n),a.appendChild(f),document.body.appendChild(a),t.blur()}}),ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(e,t,n){var r=e("../../lib/keys");n.exports.getEditorKeybordShortcuts=function(e){var t=r.KEY_MODS,n=[],i={};return e.keyBinding.$handlers.forEach(function(e){var r=e.commandKeyBinding;for(var s in r){var o=parseInt(s);o==-1?o="":isNaN(o)?o=s:o=""+(o&t.command?"Cmd-":"")+(o&t.ctrl?"Ctrl-":"")+(o&t.alt?"Alt-":"")+(o&t.shift?"Shift-":"");for(var u in r[s]){var a=r[s][u];typeof a!="string"&&(a=a.name),i[a]?i[a].key+="|"+o+u:(i[a]={key:o+u,command:a},n.push(i[a]))}}}),n}}),function(){ace.require(["ace/ext/keybinding_menu"],function(){})}() -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/mode-snippets.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/snippets",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/folding/coffee"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("./text_highlight_rules").TextHighlightRules,o=function(){var e="SELECTION|CURRENT_WORD|SELECTED_TEXT|CURRENT_LINE|LINE_INDEX|LINE_NUMBER|SOFT_TABS|TAB_SIZE|FILENAME|FILEPATH|FULLNAME";this.$rules={start:[{token:"constant.language.escape",regex:/\\[\$}`\\]/},{token:"keyword",regex:"\\$(?:TM_)?(?:"+e+")\\b"},{token:"variable",regex:"\\$\\w+"},{onMatch:function(e,t,n){return n[1]?n[1]++:n.unshift(t,1),this.tokenName},tokenName:"markup.list",regex:"\\${",next:"varDecl"},{onMatch:function(e,t,n){return n[1]?(n[1]--,n[1]||n.splice(0,2),this.tokenName):"text"},tokenName:"markup.list",regex:"}"},{token:"doc.comment",regex:/^\${2}-{5,}$/}],varDecl:[{regex:/\d+\b/,token:"constant.numeric"},{token:"keyword",regex:"(?:TM_)?(?:"+e+")\\b"},{token:"variable",regex:"\\w+"},{regex:/:/,token:"punctuation.operator",next:"start"},{regex:/\//,token:"string.regex",next:"regexp"},{regex:"",next:"start"}],regexp:[{regex:/\\./,token:"escape"},{regex:/\[/,token:"regex.start",next:"charClass"},{regex:"/",token:"string.regex",next:"format"},{token:"string.regex",regex:"."}],charClass:[{regex:"\\.",token:"escape"},{regex:"\\]",token:"regex.end",next:"regexp"},{token:"string.regex",regex:"."}],format:[{regex:/\\[ulULE]/,token:"keyword"},{regex:/\$\d+/,token:"variable"},{regex:"/[gim]*:?",token:"string.regex",next:"start"},{token:"string",regex:"."}]}};r.inherits(o,s),t.SnippetHighlightRules=o;var u=function(){this.$rules={start:[{token:"text",regex:"^\\t",next:"sn-start"},{token:"invalid",regex:/^ \s*/},{token:"comment",regex:/^#.*/},{token:"constant.language.escape",regex:"^regex ",next:"regex"},{token:"constant.language.escape",regex:"^(trigger|endTrigger|name|snippet|guard|endGuard|tabTrigger|key)\\b"}],regex:[{token:"text",regex:"\\."},{token:"keyword",regex:"/"},{token:"empty",regex:"$",next:"start"}]},this.embedRules(o,"sn-",[{token:"text",regex:"^\\t",next:"sn-start"},{onMatch:function(e,t,n){return n.splice(n.length),this.tokenName},tokenName:"text",regex:"^(?! )",next:"start"}])};r.inherits(u,s),t.SnippetGroupHighlightRules=u;var a=e("./folding/coffee").FoldMode,f=function(){this.HighlightRules=u,this.foldingRules=new a};r.inherits(f,i),function(){this.$indentWithTabs=!0,this.$id="ace/mode/snippets"}.call(f.prototype),t.Mode=f}),ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=this.indentationBlock(e,n);if(r)return r;var i=/\S/,o=e.getLine(n),u=o.search(i);if(u==-1||o[u]!="#")return;var a=o.length,f=e.getLength(),l=n,c=n;while(++nl){var p=e.getLine(c).length;return new s(l,a,c,p)}},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),i=r.search(/\S/),s=e.getLine(n+1),o=e.getLine(n-1),u=o.search(/\S/),a=s.search(/\S/);if(i==-1)return e.foldWidgets[n-1]=u!=-1&&u"},{type:"paren.lparen",value:"{",indent:!0},{type:"paren.rparen",breakBefore:!0,value:"}",indent:!1},{type:"paren.rparen",breakBefore:!0,value:"})",indent:!1,dontBreak:!0},{type:"comment"},{type:"text",value:";"},{type:"text",value:":",context:"php"},{type:"keyword",value:"case",indent:!0,dontBreak:!0},{type:"keyword",value:"default",indent:!0,dontBreak:!0},{type:"keyword",value:"break",indent:!1,dontBreak:!0},{type:"punctuation.doctype.end",value:">"},{type:"meta.tag.punctuation.end",value:">"},{type:"meta.tag.punctuation.begin",value:"<",blockTag:!0,indent:!0,dontBreak:!0},{type:"meta.tag.punctuation.begin",value:""?r="php":i.type=="support.php_tag"&&i.value=="?>"?r="html":i.type=="meta.tag.name.style"&&r!="css"?r="css":i.type=="meta.tag.name.style"&&r=="css"?r="html":i.type=="meta.tag.name.script"&&r!="js"?r="js":i.type=="meta.tag.name.script"&&r=="js"&&(r="html"),v=e.stepForward(),v&&v.type.indexOf("meta.tag.name")==0&&(d=v.value),p.type=="support.php_tag"&&p.value==""&&(l=!1),h=c,p=i,i=v;if(i===null)break}return a}}),function(){ace.require(["ace/ext/beautify"],function(){})}() -------------------------------------------------------------------------------- /js/worker/filesystem/fsloader.js: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------- 2 | // ------------- FILESYSTEM LOADER ----------------- 3 | // ------------------------------------------------- 4 | 5 | "use strict"; 6 | 7 | var message = require('../messagehandler'); 8 | var utils = require('../utils'); 9 | 10 | var S_IRWXUGO = 0x1FF; 11 | var S_IFMT = 0xF000; 12 | var S_IFSOCK = 0xC000; 13 | var S_IFLNK = 0xA000; 14 | var S_IFREG = 0x8000; 15 | var S_IFBLK = 0x6000; 16 | var S_IFDIR = 0x4000; 17 | var S_IFCHR = 0x2000; 18 | 19 | var STATUS_INVALID = -0x1; 20 | var STATUS_OK = 0x0; 21 | var STATUS_OPEN = 0x1; 22 | var STATUS_ON_SERVER = 0x2; 23 | var STATUS_LOADING = 0x3; 24 | var STATUS_UNLINKED = 0x4; 25 | 26 | function FSLoader(filesystem) { 27 | this.fs = filesystem; 28 | } 29 | 30 | FSLoader.prototype.HandleDirContents = function(list, parentid) { 31 | for (var i in list) { 32 | var tag = list[i]; 33 | 34 | var id = this.fs.Search(parentid, tag.name); 35 | if (id != -1) { 36 | if (!tag.path && !tag.size) { 37 | if (tag.child) this.HandleDirContents(tag.child, id); 38 | continue; 39 | } else { 40 | message.Debug("Overwriting non-directory!"); 41 | } 42 | } 43 | 44 | var inode = this.fs.CreateInode(); 45 | inode.name = tag.name; 46 | inode.uid = tag.uid|0; 47 | inode.gid = tag.gid|0; 48 | inode.parentid = parentid; 49 | this.fs.inodes[inode.parentid].nlinks++; 50 | inode.mode = parseInt(tag.mode, 8); 51 | 52 | if (tag.path) { // link 53 | inode.mode = S_IFLNK | S_IRWXUGO; 54 | inode.symlink = tag.path; 55 | this.fs.PushInode(inode); 56 | } else if (typeof tag.size === "undefined") { // dir 57 | inode.mode |= S_IFDIR; 58 | inode.updatedir = true; 59 | inode.nlinks = 2; // . and .. 60 | this.fs.PushInode(inode); 61 | if (tag.child) 62 | this.HandleDirContents(tag.child, id != -1 ? id : this.fs.inodes.length-1); 63 | } else { // file 64 | if (tag.lazy) inode.lazy = tag.lazy; 65 | inode.mode |= S_IFREG; 66 | var idx = this.fs.inodes.length; 67 | inode.status = STATUS_ON_SERVER; 68 | inode.compressed = !!tag.c; 69 | inode.size = tag.size|0; 70 | this.fs.PushInode(inode); 71 | var url = this.sysrootdir + (!tag.src?this.fs.GetFullPath(idx):tag.src); 72 | inode.url = url; 73 | //message.Debug("Load id=" + (idx) + " " + url); 74 | if (tag.load || this.fs.CheckEarlyload(this.fs.GetFullPath(idx)) ) { 75 | this.fs.LoadFile(idx); 76 | } 77 | } 78 | } 79 | } 80 | 81 | FSLoader.prototype.OnJSONLoaded = function(fsxml) 82 | { 83 | var t = JSON.parse(fsxml); 84 | 85 | this.sysrootdir = t.src; 86 | if (String(this.sysrootdir) !== this.sysrootdir) message.Debug("No sysroot (src tag)!"); 87 | this.sysrootdir = this.fs.userinfo.path + this.sysrootdir + "/"; 88 | 89 | this.HandleDirContents(t.fs, 0); 90 | 91 | message.Debug("processed " + this.fs.inodes.length + " inodes"); 92 | this.fs.Check(); 93 | } 94 | 95 | FSLoader.prototype.LoadJSON = function(url) 96 | { 97 | message.Debug("Load filesystem information from " + url); 98 | utils.LoadTextResource(url, this.OnJSONLoaded.bind(this), function(error){throw error;}); 99 | } 100 | 101 | module.exports = FSLoader; 102 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/ext-elastic_tabstops_lite.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t,n){var r=function(e){this.$editor=e;var t=this,n=[],r=!1;this.onAfterExec=function(){r=!1,t.processRows(n),n=[]},this.onExec=function(){r=!0},this.onChange=function(e){var t=e.data.range;r&&(n.indexOf(t.start.row)==-1&&n.push(t.start.row),t.end.row!=t.start.row&&n.push(t.end.row))}};(function(){this.processRows=function(e){this.$inChange=!0;var t=[];for(var n=0,r=e.length;n-1)continue;var s=this.$findCellWidthsForBlock(i),o=this.$setBlockCellWidthsToMax(s.cellWidths),u=s.firstRow;for(var a=0,f=o.length;a=0){n=this.$cellWidthsForRow(r);if(n.length==0)break;t.unshift(n),r--}var i=r+1;r=e;var s=this.$editor.session.getLength();while(r0&&(this.$editor.session.getDocument().insertInLine({row:e,column:f+1},Array(l+1).join(" ")+" "),this.$editor.session.getDocument().removeInLine(e,f,f+1),r+=l),l<0&&p>=-l&&(this.$editor.session.getDocument().removeInLine(e,f+l,f),r+=l)}},this.$izip_longest=function(e){if(!e[0])return[];var t=e[0].length,n=e.length;for(var r=1;rt&&(t=i)}var s=[];for(var o=0;o=t.length?t.length:e.length,r=[];for(var i=0;i this.length-1 || idx < 0) { 31 | return undefined; 32 | } 33 | this.overlay[idx] = data; 34 | } 35 | 36 | LazyUint8Array.prototype.Get = function LazyUint8Array_Get(idx) { 37 | if (idx > this.length-1 || idx < 0) { 38 | return undefined; 39 | } 40 | if (typeof(this.overlay[idx]) !== "undefined") return this.overlay[idx]; 41 | var chunkOffset = idx % this.chunkSize; 42 | var chunkNum = (idx / this.chunkSize)|0; 43 | return this.GetChunk(chunkNum)[chunkOffset]; 44 | } 45 | 46 | LazyUint8Array.prototype.DoXHR = function LazyUint8Array_DoXHR(from, to) { 47 | if (from > to) message.Error("Invalid range (" + from + ", " + to + ") or no bytes requested!"); 48 | if (to > this._length-1) message.Error("Only " + this._length + " bytes available! programmer error!"); 49 | 50 | var xhr = new XMLHttpRequest(); 51 | xhr.open('GET', this.url, false); 52 | if (this._length !== this._chunkSize) xhr.setRequestHeader("Range", "bytes=" + from + "-" + to); 53 | 54 | xhr.responseType = 'arraybuffer'; 55 | 56 | xhr.send(null); 57 | if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + this.url + ". Status: " + xhr.status); 58 | return new Uint8Array(xhr.response || []); 59 | } 60 | 61 | LazyUint8Array.prototype.GetChunk = function LazyUint8Array_GetChunk(chunkNum) { 62 | var start = chunkNum * this._chunkSize; 63 | var end = (chunkNum+1) * this._chunkSize - 1; // including this byte 64 | end = Math.min(end, this._length-1); // if length-1 is selected, this is the last block 65 | if (typeof(this.chunks[chunkNum]) === "undefined") { 66 | this.chunks[chunkNum] = this.DoXHR(start, end); 67 | } 68 | return this.chunks[chunkNum]; 69 | } 70 | 71 | LazyUint8Array.prototype.CacheLength = function LazyUint8Array_CacheLength() { 72 | // Find length 73 | var xhr = new XMLHttpRequest(); 74 | xhr.open('HEAD', this.url + "?" + new Date().getTime(), false); 75 | xhr.send(null); 76 | 77 | if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + this.url + ". Status: " + xhr.status); 78 | this._length = Number(xhr.getResponseHeader("Content-length")); 79 | if (this._length === 0) { 80 | message.Warning("Server doesn't return Content-length, even though we have a cache defeating URL query-string appended"); 81 | this._length = this.fallbackLength; 82 | } 83 | 84 | this._chunkSize = 1024*1024; // Chunk size in bytes 85 | 86 | var header; 87 | var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes"; 88 | if (!hasByteServing) this._chunkSize = this._length; 89 | 90 | this.lengthKnown = true; 91 | } 92 | 93 | module.exports = LazyUint8Array; 94 | -------------------------------------------------------------------------------- /js/worker/dev/virtio/net.js: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------- 2 | // ------------ Network Virtio Device -------------- 3 | // ------------------------------------------------- 4 | 5 | "use strict"; 6 | 7 | var message = require('../../messagehandler'); 8 | var utils = require('../../utils'); 9 | var marshall = require('./marshall'); 10 | 11 | function VirtioNET(ramdev) { 12 | this.configspace = [0x00, 0x0, 0x0, 0x0, 0x0, 0x0]; // mac address 13 | this.deviceid = 1; 14 | this.hostfeature = (1<<5); // Device has given MAC address 15 | 16 | this.replybuffer = new Uint8Array(65550); // the maximum size of a TCP or UDP packet, plus the 14 byte ethernet header 17 | this.replybuffersize = 0; 18 | 19 | // TODO: not all networks addresses are valid 20 | for(var i=1; i<6; i++) { 21 | this.configspace[i] = Math.floor(Math.random()*256); 22 | } 23 | 24 | message.Register("ethmac", this.Receive.bind(this) ); 25 | 26 | this.Reset(); 27 | } 28 | 29 | VirtioNET.prototype.Reset = function() { 30 | this.receivebufferdesc = new Array(); 31 | this.receivebuffer = new Array(); 32 | } 33 | 34 | 35 | VirtioNET.prototype.Receive = function(buffer) { 36 | //message.Debug("Received packet of size " + buffer.byteLength); 37 | this.receivebuffer.push(buffer); 38 | this.HandleReceive(); 39 | } 40 | 41 | VirtioNET.prototype.HandleReceive = function() { 42 | 43 | if (this.receivebuffer.length == 0) { 44 | return; 45 | } 46 | 47 | if (this.receivebufferdesc.length == 0) { 48 | return; 49 | } 50 | 51 | var buffer = new Uint8Array(this.receivebuffer[0]); 52 | var desc = this.receivebufferdesc[0]; 53 | 54 | if (buffer.length > desc.size.write) { 55 | message.Debug("Error in VirtioNET: Received packet is larger than the next receive buffer"); 56 | message.Abort(); 57 | } 58 | 59 | this.receivebuffer.shift(); 60 | this.receivebufferdesc.shift(); 61 | 62 | // both buffers are valid so copy 63 | 64 | this.replybuffersize = buffer.length + 12; 65 | marshall.Marshall(["b", "b", "h", "h", "h", "h", "h"], [0, 0, 0, 0, 0, 0, 0], this.replybuffer, 0); 66 | for(var i=0; i 1) { 80 | message.Debug("Error in VirtioNET: Unsupported ringbuffer"); 81 | message.Abort(); 82 | } 83 | 84 | if (queueidx == 0) { 85 | // for some reason, some descriptors are sent multiple times. So check and return. 86 | for(var i=0; i 2 | 3 | 4 | RISC-V Emulator 5 | 6 | 7 | 8 | 20 | 21 | 22 | 23 | 24 | 31 | 32 |
33 |
34 |
35 |

RISC-V Simple Demo

36 |
37 |
38 |
39 | 44 |
45 |
46 |
47 |
48 | 49 |
50 |
51 |
52 |
53 | 54 |
55 |
56 |
57 |
58 |
59 | 60 | 61 | 62 | 63 | 64 | 65 | 118 | -------------------------------------------------------------------------------- /demos/ace-editor-src-min-noconflict/ext-split.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/split",["require","exports","module","ace/split"],function(e,t,n){n.exports=e("../split")}),ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(e,t,n){function l(e,t){this.$u=e,this.$doc=t}var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./editor").Editor,u=e("./virtual_renderer").VirtualRenderer,a=e("./edit_session").EditSession,f=function(e,t,n){this.BELOW=1,this.BESIDE=0,this.$container=e,this.$theme=t,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(n||1),this.$cEditor=this.$editors[0],this.on("focus",function(e){this.$cEditor=e}.bind(this))};(function(){r.implement(this,s),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new o(new u(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e==this.$splits)return;if(e>this.$splits){while(this.$splitse)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach(function(t){t.setTheme(e)})},this.setKeyboardHandler=function(e){this.$editors.forEach(function(t){t.setKeyboardHandler(e)})},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach(function(t){t.setFontSize(e)})},this.$cloneSession=function(e){var t=new a(e.getDocument(),e.getMode()),n=e.getUndoManager();if(n){var r=new l(n,t);t.setUndoManager(r)}return t.$informUndoManager=i.delayedCall(function(){t.$deltas=[]}),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;t==null?n=this.$cEditor:n=this.$editors[t];var r=this.$editors.some(function(t){return t.session===e});return r&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){if(this.$orientation==e)return;this.$orientation=e,this.resize()},this.resize=function(){var e=this.$container.clientWidth,t=this.$container.clientHeight,n;if(this.$orientation==this.BESIDE){var r=e/this.$splits;for(var i=0;i> 6) | 0xC0, 76 | (key & 0x3F) | 0x80 77 | ]; 78 | } else 79 | if (key <= 0xFFFF) { 80 | return [ 81 | (key >> 12) | 0xE0, 82 | ((key >> 6) & 0x3F) | 0x80, 83 | (key & 0x3F) | 0x80 84 | ]; 85 | } else 86 | if (key <= 0x10FFFF) { 87 | return [ 88 | (key >> 18) | 0xF0, 89 | ((key >> 12) & 0x3F) | 0x80, 90 | ((key >> 6) & 0x3F) | 0x80, 91 | (key & 0x3F) | 0x80 92 | ]; 93 | } else { 94 | //message.Debug("Error in utf-8 encoding: Invalid key"); 95 | } 96 | return []; 97 | } 98 | 99 | function UTF8Length(s) 100 | { 101 | var length = 0; 102 | for(var i=0; i>= 2; 44 | if (addr > 32*2) { 45 | message.Debug("IRQDev: Unknown ReadReg32: " + utils.ToHex(addr)); 46 | return 0x0; 47 | } 48 | /* 49 | var cpuid = addr >> 1; 50 | if (addr&1) { 51 | message.Debug("IRQDev: Read STAT of CPU " + cpuid); 52 | } else { 53 | message.Debug("IRQDev: Read CTRL of CPU " + cpuid); 54 | } 55 | */ 56 | return this.regs[addr]; 57 | } 58 | 59 | IRQDev.prototype.WriteReg32 = function (addr, value) { 60 | addr >>= 2; 61 | if (addr > 32*2) { 62 | message.Debug("IRQDev: unknown WriteReg32: " + utils.ToHex(addr) + ": " + utils.ToHex(value)); 63 | return; 64 | } 65 | 66 | var cpuid = addr >> 1; 67 | if (addr&1) { 68 | message.Debug("Error in IRQDev: Write STAT of CPU " + cpuid +" : " + utils.ToHex(value)); 69 | } else { 70 | this.regs[addr] = value; 71 | var irqno = value & 0xFFFF; 72 | var dstcpu = (value >> 16) & 0x3fff; 73 | var flags = (value >> 30) & 3; 74 | /* 75 | message.Debug("IRQDev: Write CTRL of CPU " + cpuid + " : " + 76 | " dstcpu=" + dstcpu + 77 | " irqno=" + irqno + 78 | " flags=" + flags 79 | ); 80 | */ 81 | 82 | if (flags & 1) { // irq gen 83 | if (dstcpu == cpuid) { 84 | message.Debug("Warning in IRQDev: Try to raise its own IRQ"); 85 | } 86 | if (this.regs[(dstcpu<<1)+1] & OMPIC_IPI_STAT_IRQ_PENDING) { 87 | message.Debug("Warning in IRQDev: CPU " + cpuid + " raised irq on cpu " + dstcpu + " without previous acknowledge"); 88 | var h = new Int32Array(this.intdev.heap); 89 | message.Debug("The pc of cpu " + dstcpu + " is " + utils.ToHex(h[(dstcpu<<15) + 0x124 >> 2])); 90 | message.Debug("The IEE flag of cpu " + dstcpu + " is " + ( h[(dstcpu<<15) + 0x120 >> 2] & (1<<2)) ); 91 | message.Debug("r9 of cpu " + dstcpu + " is " + utils.ToHex(h[(dstcpu<<15) + (0x9<<2) >> 2])); 92 | } 93 | this.regs[(dstcpu<<1)+1] = OMPIC_IPI_STAT_IRQ_PENDING | ((cpuid & 0x3fff) << 16) | irqno; 94 | this.intdev.RaiseSoftInterrupt(0x1, dstcpu); 95 | } 96 | if (flags & 2) { // irq ack 97 | this.regs[addr+1] &= ~OMPIC_IPI_STAT_IRQ_PENDING; 98 | this.intdev.ClearSoftInterrupt(0x1, cpuid); 99 | } 100 | 101 | } 102 | } 103 | 104 | module.exports = IRQDev; 105 | -------------------------------------------------------------------------------- /test/4KBsource.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() { 3 | char mesg[] = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"; 4 | 5 | printf("4141=%d %d\n",sizeof(mesg),sizeof(mesg)==4141); 6 | return 0; 7 | } -------------------------------------------------------------------------------- /js/lib/download.js: -------------------------------------------------------------------------------- 1 | //download.js v3.1, by dandavis; 2008-2014. [CCBY2] see http://danml.com/download.html for tests/usage 2 | // v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime 3 | // v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs 4 | // v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support. 3.1 improved safari handling. 5 | 6 | // https://github.com/rndme/download 7 | 8 | // data can be a string, Blob, File, or dataURL 9 | function download(data, strFileName, strMimeType) { 10 | 11 | var self = window, // this script is only for browsers anyway... 12 | u = "application/octet-stream", // this default mime also triggers iframe downloads 13 | m = strMimeType || u, 14 | x = data, 15 | D = document, 16 | a = D.createElement("a"), 17 | z = function(a){return String(a);}, 18 | B = (self.Blob || self.MozBlob || self.WebKitBlob || z); 19 | B=B.call ? B.bind(self) : Blob ; 20 | var fn = strFileName || "download", 21 | blob, 22 | fr; 23 | 24 | 25 | if(String(this)==="true"){ //reverse arguments, allowing download.bind(true, "text/xml", "export.xml") to act as a callback 26 | x=[x, m]; 27 | m=x[0]; 28 | x=x[1]; 29 | } 30 | 31 | 32 | 33 | 34 | //go ahead and download dataURLs right away 35 | if(String(x).match(/^data\:[\w+\-]+\/[\w+\-]+[,;]/)){ 36 | return navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs: 37 | navigator.msSaveBlob(d2b(x), fn) : 38 | saver(x) ; // everyone else can save dataURLs un-processed 39 | }//end if dataURL passed? 40 | 41 | blob = x instanceof B ? 42 | x : 43 | new B([x], {type: m}) ; 44 | 45 | 46 | function d2b(u) { 47 | var p= u.split(/[:;,]/), 48 | t= p[1], 49 | dec= p[2] == "base64" ? atob : decodeURIComponent, 50 | bin= dec(p.pop()), 51 | mx= bin.length, 52 | i= 0, 53 | uia= new Uint8Array(mx); 54 | 55 | for(i;i>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring3:[{token:"constant.language.escape",regex:m},{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],qstring3:[{token:"constant.language.escape",regex:m},{token:"string",regex:"'{3}",next:"start"},{defaultToken:"string"}],qqstring:[{token:"constant.language.escape",regex:m},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:m},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}]}};r.inherits(s,i),t.PythonHighlightRules=s}),ace.define("ace/mode/folding/pythonic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e){this.foldingStartMarker=new RegExp("([\\[{])(?:\\s*)$|("+e+")(?:\\s*)(?:#.*)?$")};r.inherits(s,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i=r.match(this.foldingStartMarker);if(i)return i[1]?this.openingBracketBlock(e,i[1],n,i.index):i[2]?this.indentationBlock(e,n,i.index+i[2].length):this.indentationBlock(e,n)}}.call(s.prototype)}),ace.define("ace/mode/python",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/python_highlight_rules","ace/mode/folding/pythonic","ace/range"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./python_highlight_rules").PythonHighlightRules,o=e("./folding/pythonic").FoldMode,u=e("../range").Range,a=function(){this.HighlightRules=s,this.foldingRules=new o("\\:")};r.inherits(a,i),function(){this.lineCommentStart="#",this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var o=t.match(/^.*[\{\(\[\:]\s*$/);o&&(r+=n)}return r};var e={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(t,n,r){if(r!=="\r\n"&&r!=="\r"&&r!=="\n")return!1;var i=this.getTokenizer().getLineTokens(n.trim(),t).tokens;if(!i)return!1;do var s=i.pop();while(s&&(s.type=="comment"||s.type=="text"&&s.value.match(/^\s+$/)));return s?s.type=="keyword"&&e[s.value]:!1},this.autoOutdent=function(e,t,n){n+=1;var r=this.$getIndent(t.getLine(n)),i=t.getTabString();r.slice(-i.length)==i&&t.remove(new u(n,r.length-i.length,n,r.length))},this.$id="ace/mode/python"}.call(a.prototype),t.Mode=a}) --------------------------------------------------------------------------------