mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-07-13 22:42:53 +03:00
83 lines
4.0 KiB
HTML
83 lines
4.0 KiB
HTML
<!DOCTYPE html>
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
|
|
<style>
|
|
:root {
|
|
--bg: #ffffff;
|
|
--text: #1f2937;
|
|
--code-bg: #f3f4f6;
|
|
--code-border: #e5e7eb;
|
|
}
|
|
html { font-size: 16px; background: var(--bg); }
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
|
|
font-size: 16px;
|
|
line-height: 1.7;
|
|
color: var(--text);
|
|
background: var(--bg);
|
|
max-width: 750px;
|
|
margin: 0 auto;
|
|
padding: 2rem 1.5rem 4rem;
|
|
}
|
|
code {
|
|
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
|
|
font-size: 0.875em;
|
|
background: var(--code-bg);
|
|
padding: 0.15em 0.35em;
|
|
border-radius: 4px;
|
|
}
|
|
pre {
|
|
background: var(--code-bg);
|
|
border: 1px solid var(--code-border);
|
|
border-radius: 6px;
|
|
padding: 1rem;
|
|
overflow-x: auto;
|
|
line-height: 1.5;
|
|
}
|
|
pre code span {
|
|
font-weight: normal !important;
|
|
font-style: normal !important;
|
|
}
|
|
pre code {
|
|
background: none;
|
|
padding: 0;
|
|
border-radius: 0;
|
|
font-size: 0.85em;
|
|
}
|
|
div.sourceCode {
|
|
background: var(--code-bg);
|
|
border: 1px solid var(--code-border);
|
|
border-radius: 6px;
|
|
margin: 1rem 0;
|
|
}
|
|
div.sourceCode pre {
|
|
border: none;
|
|
margin: 0;
|
|
}
|
|
code span.kw { color: #cf222e; }
|
|
code span.op { color: #cf222e; }
|
|
code span.dv, code span.fl { color: #0550ae; }
|
|
code span.co { color: #6e7781; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="sourceCode" id="cb1"><pre class="sourceCode fsharp"><code class="sourceCode fsharp"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="kw">let</span> stepper <span class="op">()</span> =</span>
|
|
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> //<span class="co"> Execute a single instruction</span></span>
|
|
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a> //<span class="co"> Each instruction uses a different amount of cycles</span></span>
|
|
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a> <span class="kw">let</span> mCycles = stepCpu cpu io</span>
|
|
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a> </span>
|
|
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a> <span class="kw">for</span> _ <span class="kw">in</span> <span class="fl">1.</span>.mCycles <span class="kw">do</span> </span>
|
|
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a> stepTimers timer io </span>
|
|
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a> stepSerial serial io</span>
|
|
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a> //<span class="co"> The APU technically runs at 4x CPU-cycles, but can be batched</span></span>
|
|
<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a> stepApu apu </span>
|
|
<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a> </span>
|
|
<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a> <span class="kw">let</span> tCycles = mCycles * <span class="dv">4</span> </span>
|
|
<span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a> </span>
|
|
<span id="cb1-14"><a href="#cb1-14" aria-hidden="true" tabindex="-1"></a> //<span class="co"> The PPU operates at 4x CPU-cycles. The APU should be here too</span></span>
|
|
<span id="cb1-15"><a href="#cb1-15" aria-hidden="true" tabindex="-1"></a> <span class="kw">for</span> _ <span class="kw">in</span> <span class="fl">1.</span>.tCycles <span class="kw">do</span> </span>
|
|
<span id="cb1-16"><a href="#cb1-16" aria-hidden="true" tabindex="-1"></a> stepPpu ppu </span>
|
|
<span id="cb1-17"><a href="#cb1-17" aria-hidden="true" tabindex="-1"></a> </span>
|
|
<span id="cb1-18"><a href="#cb1-18" aria-hidden="true" tabindex="-1"></a> //<span class="co"> Return cycles taken so the frontend runs the emulator at the right speed</span></span>
|
|
<span id="cb1-19"><a href="#cb1-19" aria-hidden="true" tabindex="-1"></a> mCycles </span></code></pre></div>
|
|
</body></html>
|