Skip to content

Commit

Permalink
v8.3.1 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
caiiiycuk committed Oct 3, 2024
1 parent 21fb689 commit 205e446
Show file tree
Hide file tree
Showing 46 changed files with 278 additions and 218 deletions.
6 changes: 3 additions & 3 deletions advanced-topics.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="built-on" content="2024-09-19T15:52:22.8498932"><script type="text/javascript" >
<html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="built-on" content="2024-10-03T11:04:49.3377742"><script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
Expand All @@ -11,7 +11,7 @@
trackLinks:true,
accurateTrackBounce:true
});
</script><title>Advanced Topics | js-dos</title><script type="application/json" id="virtual-toc-data">[]</script><script type="application/json" id="topic-shortcuts"></script><link href="https://resources.jetbrains.com/writerside/apidoc/6.10.0-b408/app.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="16x16" href="images/logo-16.png"><link rel="icon" type="image/png" sizes="32x32" href="images/logo-32.png"><link rel="icon" type="image/png" sizes="96x96" href="images/logo-192.png"><link rel="icon" type="image/png" sizes="300x300" href="images/logo-512.png"><meta name="image" content="https://js-dos.com/images/seo.jpg"><!-- Open Graph --><meta property="og:title" content="Advanced Topics | js-dos"><meta property="og:description" content=""><meta property="og:image" content="https://js-dos.com/images/seo.jpg"><meta property="og:site_name" content="js-dos Help"><meta property="og:type" content="website"><meta property="og:locale" content="en_US"><meta property="og:url" content="https://js-dos.com//8.xx/advanced-topics.html"><!-- End Open Graph --><!-- Twitter Card --><meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content="@caiiiycuk"><meta name="twitter:title" content="Advanced Topics | js-dos"><meta name="twitter:description" content=""><meta name="twitter:creator" content="@caiiiycuk"><meta name="twitter:image:src" content="https://js-dos.com/images/seo.jpg"><!-- End Twitter Card --><!-- Schema.org WebPage --><script type="application/ld+json">{
</script><title>Advanced Topics | js-dos</title><script type="application/json" id="virtual-toc-data">[]</script><script type="application/json" id="topic-shortcuts"></script><link href="https://resources.jetbrains.com/writerside/apidoc/6.10.0-b419/app.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="16x16" href="images/logo-16.png"><link rel="icon" type="image/png" sizes="32x32" href="images/logo-32.png"><link rel="icon" type="image/png" sizes="96x96" href="images/logo-192.png"><link rel="icon" type="image/png" sizes="300x300" href="images/logo-512.png"><meta name="image" content="https://js-dos.com/images/seo.jpg"><!-- Open Graph --><meta property="og:title" content="Advanced Topics | js-dos"><meta property="og:description" content=""><meta property="og:image" content="https://js-dos.com/images/seo.jpg"><meta property="og:site_name" content="js-dos Help"><meta property="og:type" content="website"><meta property="og:locale" content="en_US"><meta property="og:url" content="https://js-dos.com//8.xx/advanced-topics.html"><!-- End Open Graph --><!-- Twitter Card --><meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content="@caiiiycuk"><meta name="twitter:title" content="Advanced Topics | js-dos"><meta name="twitter:description" content=""><meta name="twitter:creator" content="@caiiiycuk"><meta name="twitter:image:src" content="https://js-dos.com/images/seo.jpg"><!-- End Twitter Card --><!-- Schema.org WebPage --><script type="application/ld+json">{
"@context": "http://schema.org",
"@type": "WebPage",
"@id": "https://js-dos.com//8.xx/advanced-topics.html#webpage",
Expand All @@ -26,4 +26,4 @@
"url": "https://js-dos.com/",
"name": "js-dos Help"
}</script><!-- End Schema.org --></head><body data-id="Advanced-Topics" data-main-title="Advanced Topics" data-article-props="{&quot;seeAlsoStyle&quot;:&quot;links&quot;}" data-template="article" data-breadcrumbs="Overview.md|js-dos"><noscript><div><img src="https://mc.yandex.ru/watch/27763311" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<div class="wrapper"><main class="panel _main"><header class="panel__header"><div class="container"><h3>js-dos 8.xx Help</h3><div class="panel-trigger"></div></div></header><section class="panel__content"><div class="container"><article class="article" data-shortcut-switcher="inactive"><h1 data-toc="Advanced-Topics" id="Advanced-Topics.md">Advanced Topics</h1><div class="last-modified">Last modified: 19 сентября 2024</div><div data-feedback-placeholder="true"></div><div class="navigation-links _bottom"><a href="mouse-locking.html" class="navigation-links__prev">Mouse locking</a><a href="working-with-fs.html" class="navigation-links__next">Working with File System</a></div></article><div id="disqus_thread"></div></div></section></main></div><script src="https://resources.jetbrains.com/writerside/apidoc/6.10.0-b408/app.js"></script></body></html>
<div class="wrapper"><main class="panel _main"><header class="panel__header"><div class="container"><h3>js-dos 8.xx Help</h3><div class="panel-trigger"></div></div></header><section class="panel__content"><div class="container"><article class="article" data-shortcut-switcher="inactive"><h1 data-toc="Advanced-Topics" id="Advanced-Topics.md">Advanced Topics</h1><div class="last-modified">Last modified: 03 октября 2024</div><div data-feedback-placeholder="true"></div><div class="navigation-links _bottom"><a href="mouse-locking.html" class="navigation-links__prev">Mouse locking</a><a href="working-with-fs.html" class="navigation-links__next">Working with File System</a></div></article><div id="disqus_thread"></div></div></section></main></div><script src="https://resources.jetbrains.com/writerside/apidoc/6.10.0-b419/app.js"></script></body></html>
20 changes: 10 additions & 10 deletions browser.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="built-on" content="2024-09-19T15:52:22.8508923"><script type="text/javascript" >
<html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="built-on" content="2024-10-03T11:04:49.3347546"><script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
Expand All @@ -11,7 +11,7 @@
trackLinks:true,
accurateTrackBounce:true
});
</script><title>Browser | js-dos</title><script type="application/json" id="virtual-toc-data">[]</script><script type="application/json" id="topic-shortcuts"></script><link href="https://resources.jetbrains.com/writerside/apidoc/6.10.0-b408/app.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="16x16" href="images/logo-16.png"><link rel="icon" type="image/png" sizes="32x32" href="images/logo-32.png"><link rel="icon" type="image/png" sizes="96x96" href="images/logo-192.png"><link rel="icon" type="image/png" sizes="300x300" href="images/logo-512.png"><meta name="image" content="https://js-dos.com/images/seo.jpg"><!-- Open Graph --><meta property="og:title" content="Browser | js-dos"><meta property="og:description" content=""><meta property="og:image" content="https://js-dos.com/images/seo.jpg"><meta property="og:site_name" content="js-dos Help"><meta property="og:type" content="website"><meta property="og:locale" content="en_US"><meta property="og:url" content="https://js-dos.com//8.xx/browser.html"><!-- End Open Graph --><!-- Twitter Card --><meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content="@caiiiycuk"><meta name="twitter:title" content="Browser | js-dos"><meta name="twitter:description" content=""><meta name="twitter:creator" content="@caiiiycuk"><meta name="twitter:image:src" content="https://js-dos.com/images/seo.jpg"><!-- End Twitter Card --><!-- Schema.org WebPage --><script type="application/ld+json">{
</script><title>Browser | js-dos</title><script type="application/json" id="virtual-toc-data">[]</script><script type="application/json" id="topic-shortcuts"></script><link href="https://resources.jetbrains.com/writerside/apidoc/6.10.0-b419/app.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="16x16" href="images/logo-16.png"><link rel="icon" type="image/png" sizes="32x32" href="images/logo-32.png"><link rel="icon" type="image/png" sizes="96x96" href="images/logo-192.png"><link rel="icon" type="image/png" sizes="300x300" href="images/logo-512.png"><meta name="image" content="https://js-dos.com/images/seo.jpg"><!-- Open Graph --><meta property="og:title" content="Browser | js-dos"><meta property="og:description" content=""><meta property="og:image" content="https://js-dos.com/images/seo.jpg"><meta property="og:site_name" content="js-dos Help"><meta property="og:type" content="website"><meta property="og:locale" content="en_US"><meta property="og:url" content="https://js-dos.com//8.xx/browser.html"><!-- End Open Graph --><!-- Twitter Card --><meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content="@caiiiycuk"><meta name="twitter:title" content="Browser | js-dos"><meta name="twitter:description" content=""><meta name="twitter:creator" content="@caiiiycuk"><meta name="twitter:image:src" content="https://js-dos.com/images/seo.jpg"><!-- End Twitter Card --><!-- Schema.org WebPage --><script type="application/ld+json">{
"@context": "http://schema.org",
"@type": "WebPage",
"@id": "https://js-dos.com//8.xx/browser.html#webpage",
Expand All @@ -26,21 +26,21 @@
"url": "https://js-dos.com/",
"name": "js-dos Help"
}</script><!-- End Schema.org --></head><body data-id="Browser" data-main-title="Browser" data-article-props="{&quot;seeAlsoStyle&quot;:&quot;links&quot;}" data-template="article" data-breadcrumbs="emulators.md|emulators///threejs.md|How-to use"><noscript><div><img src="https://mc.yandex.ru/watch/27763311" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<div class="wrapper"><main class="panel _main"><header class="panel__header"><div class="container"><h3>js-dos 8.xx Help</h3><div class="panel-trigger"></div></div></header><section class="panel__content"><div class="container"><article class="article" data-shortcut-switcher="inactive"><h1 data-toc="Browser" id="Browser.md">Browser</h1><p id="-2qm72s_3">In this example, you will learn how to use <code class="code" id="-2qm72s_15">emulators</code> with <code class="code" id="-2qm72s_16">three.js</code> renderer. We will create a rotating cube with a digger game.</p><figure id="-2qm72s_4"><img alt="threejs.jpg" src="images/threejs.jpg" title="threejs.jpg" width="545" height="545"></figure><p id="-2qm72s_5">First, you need to include <code class="code" id="-2qm72s_17">emulators.js</code>:</p><div class="tabs" id="-2qm72s_6" data-anchors="[-2qm72s_18,-2qm72s_19]"><div class="tabs__content" data-gtm="tab" id="-2qm72s_18" data-title="v8"><div class="code-block" data-lang="ts" data-title="Typescript">
<div class="wrapper"><main class="panel _main"><header class="panel__header"><div class="container"><h3>js-dos 8.xx Help</h3><div class="panel-trigger"></div></div></header><section class="panel__content"><div class="container"><article class="article" data-shortcut-switcher="inactive"><h1 data-toc="Browser" id="Browser.md">Browser</h1><p id="r5ejr5_3">In this example, you will learn how to use <code class="code" id="r5ejr5_15">emulators</code> with <code class="code" id="r5ejr5_16">three.js</code> renderer. We will create a rotating cube with a digger game.</p><figure id="r5ejr5_4"><img alt="threejs.jpg" src="images/threejs.jpg" title="threejs.jpg" width="545" height="545"></figure><p id="r5ejr5_5">First, you need to include <code class="code" id="r5ejr5_17">emulators.js</code>:</p><div class="tabs" id="r5ejr5_6" data-anchors="[r5ejr5_18,r5ejr5_19]"><div class="tabs__content" data-gtm="tab" id="r5ejr5_18" data-title="v8"><div class="code-block" data-lang="ts" data-title="Typescript">
&lt;script src=&quot;https://v8.js-dos.com/latest/emulators/emulators.js&quot;&gt;&lt;/script&gt;
</div></div><div class="tabs__content" data-gtm="tab" id="-2qm72s_19" data-title="v7"><div class="code-block" data-lang="ts" data-title="Typescript">
</div></div><div class="tabs__content" data-gtm="tab" id="r5ejr5_19" data-title="v7"><div class="code-block" data-lang="ts" data-title="Typescript">
&lt;script src=&quot;https://v8.js-dos.com/v7/emulators/emulators.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;https://v8.js-dos.com/v7/emulators-ui/emulators-ui.js&quot;&gt;&lt;/script&gt;
</div></div></div><p id="-2qm72s_7">Then set <code class="code" id="-2qm72s_22">emulators.pathPrefix</code> pointing to the correct location:</p><div class="tabs" id="-2qm72s_8" data-anchors="[-2qm72s_23,-2qm72s_24]"><div class="tabs__content" data-gtm="tab" id="-2qm72s_23" data-title="v8"><div class="code-block" data-lang="ts" data-title="Typescript">
</div></div></div><p id="r5ejr5_7">Then set <code class="code" id="r5ejr5_22">emulators.pathPrefix</code> pointing to the correct location:</p><div class="tabs" id="r5ejr5_8" data-anchors="[r5ejr5_23,r5ejr5_24]"><div class="tabs__content" data-gtm="tab" id="r5ejr5_23" data-title="v8"><div class="code-block" data-lang="ts" data-title="Typescript">
&lt;script type=&quot;module&quot;&gt;
emulators.pathPrefix = &quot;https://v8.js-dos.com/latest/emulators/&quot;;
</div></div><div class="tabs__content" data-gtm="tab" id="-2qm72s_24" data-title="v7"><div class="code-block" data-lang="ts" data-title="Typescript">
</div></div><div class="tabs__content" data-gtm="tab" id="r5ejr5_24" data-title="v7"><div class="code-block" data-lang="ts" data-title="Typescript">
&lt;script type=&quot;module&quot;&gt;
emulators.pathPrefix = &quot;https://v8.js-dos.com/v7/emulators/&quot;;
</div></div></div><p id="-2qm72s_9">Then you need to download js-dos bundle (for example, Digger game), and instantiate emulators:</p><div class="code-block" data-lang="ts">
</div></div></div><p id="r5ejr5_9">Then you need to download js-dos bundle (for example, Digger game), and instantiate emulators:</p><div class="code-block" data-lang="ts">
const bundle = await fetch(&quot;https://cdn.dos.zone/original/2X/9/9ed7eb9c2c441f56656692ed4dc7ab28f58503ce.jsdos&quot;);
const ci = await emulators.dosWorker(new Uint8Array(await bundle.arrayBuffer()));
</div><p id="-2qm72s_11">Now the DOS program is started in worker, and we need to render it on the screen. To do this, we need to subscribe to <code class="code" id="-2qm72s_27">frame</code> event and update texture:</p><div class="code-block" data-lang="ts">
</div><p id="r5ejr5_11">Now the DOS program is started in worker, and we need to render it on the screen. To do this, we need to subscribe to <code class="code" id="r5ejr5_27">frame</code> event and update texture:</p><div class="code-block" data-lang="ts">
const rgba = new Uint8ClampedArray(320 * 200 * 4);

ci.events().onFrame((rgb) =&gt; {
Expand All @@ -54,7 +54,7 @@
ctx?.putImageData(new ImageData(rgba, 320, 200), 0, 0);
// ...
}
</div><p id="-2qm72s_13">Where <code class="code" id="-2qm72s_28">rgb</code> is an actual DOS screen frame.</p><div class="code-collapse" data-lang="ts" data-is-expanded="false" data-synopsis="Source code" data-disable-link-processing="true">&lt;!doctype html&gt;
</div><p id="r5ejr5_13">Where <code class="code" id="r5ejr5_28">rgb</code> is an actual DOS screen frame.</p><div class="code-collapse" data-lang="ts" data-is-expanded="false" data-synopsis="Source code" data-disable-link-processing="true">&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
Expand Down Expand Up @@ -139,4 +139,4 @@
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</div><div class="last-modified">Last modified: 19 сентября 2024</div><div data-feedback-placeholder="true"></div><div class="navigation-links _bottom"><a href="threejs.html" class="navigation-links__prev">How-to use</a><a href="node.html" class="navigation-links__next">Node</a></div></article><div id="disqus_thread"></div></div></section></main></div><script src="https://resources.jetbrains.com/writerside/apidoc/6.10.0-b408/app.js"></script></body></html>
</div><div class="last-modified">Last modified: 03 октября 2024</div><div data-feedback-placeholder="true"></div><div class="navigation-links _bottom"><a href="threejs.html" class="navigation-links__prev">How-to use</a><a href="node.html" class="navigation-links__next">Node</a></div></article><div id="disqus_thread"></div></div></section></main></div><script src="https://resources.jetbrains.com/writerside/apidoc/6.10.0-b419/app.js"></script></body></html>
Loading

0 comments on commit 205e446

Please sign in to comment.