|
1 | 1 | <!DOCTYPE HTML>
|
2 |
| -<html lang="en" class="sidebar-visible no-js light"> |
| 2 | +<html lang="en" class="light" dir="ltr"> |
3 | 3 | <head>
|
4 | 4 | <!-- Book generated using mdBook -->
|
5 | 5 | <meta charset="UTF-8">
|
|
8 | 8 |
|
9 | 9 |
|
10 | 10 | <!-- Custom HTML head -->
|
11 |
| - |
12 |
| - <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> |
| 11 | + <!-- Matomo tracking code --> |
| 12 | + <script> |
| 13 | + var _paq = window._paq = window._paq || []; |
| 14 | + /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ |
| 15 | + _paq.push(['trackPageView']); |
| 16 | + _paq.push(['enableLinkTracking']); |
| 17 | + (function() { |
| 18 | + var u="//stats.gbdev.io/"; |
| 19 | + _paq.push(['setTrackerUrl', u+'matomo.php']); |
| 20 | + _paq.push(['setSiteId', '3']); |
| 21 | + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; |
| 22 | + g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); |
| 23 | + })(); |
| 24 | + </script> |
| 25 | + <!-- End Matomo Code --> |
| 26 | + |
13 | 27 | <meta name="description" content="Documents the workings of the Game Boy Advance hardware">
|
14 | 28 | <meta name="viewport" content="width=device-width, initial-scale=1">
|
15 |
| - <meta name="theme-color" content="#ffffff" /> |
| 29 | + <meta name="theme-color" content="#ffffff"> |
16 | 30 |
|
17 | 31 | <link rel="icon" href="favicon.svg">
|
18 | 32 | <link rel="shortcut icon" href="favicon.png">
|
|
33 | 47 | <!-- Custom theme stylesheets -->
|
34 | 48 |
|
35 | 49 | <!-- MathJax -->
|
36 |
| - <script async type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> |
| 50 | + <script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> |
37 | 51 | </head>
|
38 |
| - <body> |
| 52 | + <body class="sidebar-visible no-js"> |
| 53 | + <div id="body-container"> |
39 | 54 | <!-- Provide site root to javascript -->
|
40 |
| - <script type="text/javascript"> |
| 55 | + <script> |
41 | 56 | var path_to_root = "";
|
42 | 57 | var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
|
43 | 58 | </script>
|
44 | 59 |
|
45 | 60 | <!-- Work around some values being stored in localStorage wrapped in quotes -->
|
46 |
| - <script type="text/javascript"> |
| 61 | + <script> |
47 | 62 | try {
|
48 | 63 | var theme = localStorage.getItem('mdbook-theme');
|
49 | 64 | var sidebar = localStorage.getItem('mdbook-sidebar');
|
|
59 | 74 | </script>
|
60 | 75 |
|
61 | 76 | <!-- Set the theme before any content is loaded, prevents flash -->
|
62 |
| - <script type="text/javascript"> |
| 77 | + <script> |
63 | 78 | var theme;
|
64 | 79 | try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
|
65 | 80 | if (theme === null || theme === undefined) { theme = default_theme; }
|
66 | 81 | var html = document.querySelector('html');
|
67 |
| - html.classList.remove('no-js') |
68 | 82 | html.classList.remove('light')
|
69 | 83 | html.classList.add(theme);
|
70 |
| - html.classList.add('js'); |
| 84 | + var body = document.querySelector('body'); |
| 85 | + body.classList.remove('no-js') |
| 86 | + body.classList.add('js'); |
71 | 87 | </script>
|
72 | 88 |
|
| 89 | + <input type="checkbox" id="sidebar-toggle-anchor" class="hidden"> |
| 90 | + |
73 | 91 | <!-- Hide / unhide sidebar before it is displayed -->
|
74 |
| - <script type="text/javascript"> |
75 |
| - var html = document.querySelector('html'); |
76 |
| - var sidebar = 'hidden'; |
| 92 | + <script> |
| 93 | + var body = document.querySelector('body'); |
| 94 | + var sidebar = null; |
| 95 | + var sidebar_toggle = document.getElementById("sidebar-toggle-anchor"); |
77 | 96 | if (document.body.clientWidth >= 1080) {
|
78 | 97 | try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
|
79 | 98 | sidebar = sidebar || 'visible';
|
| 99 | + } else { |
| 100 | + sidebar = 'hidden'; |
80 | 101 | }
|
81 |
| - html.classList.remove('sidebar-visible'); |
82 |
| - html.classList.add("sidebar-" + sidebar); |
| 102 | + sidebar_toggle.checked = sidebar === 'visible'; |
| 103 | + body.classList.remove('sidebar-visible'); |
| 104 | + body.classList.add("sidebar-" + sidebar); |
83 | 105 | </script>
|
84 | 106 |
|
85 | 107 | <nav id="sidebar" class="sidebar" aria-label="Table of contents">
|
86 | 108 | <div class="sidebar-scrollbox">
|
87 | 109 | <ol class="chapter"><li class="chapter-item expanded "><a href="intro.html"><strong aria-hidden="true">1.</strong> Intro</a></li><li class="chapter-item expanded "><a href="cpu.html"><strong aria-hidden="true">2.</strong> CPU</a></li><li class="chapter-item expanded "><a href="memory.html"><strong aria-hidden="true">3.</strong> Memory</a></li><li class="chapter-item expanded "><a href="graphics.html"><strong aria-hidden="true">4.</strong> Graphics Hardware Overview</a></li><li class="chapter-item expanded "><a href="backgrounds.html"><strong aria-hidden="true">5.</strong> Backgrounds</a></li><li class="chapter-item expanded "><a href="sprites.html"><strong aria-hidden="true">6.</strong> OAM (Sprites)</a></li><li class="chapter-item expanded "><a href="windowing.html"><strong aria-hidden="true">7.</strong> Windowing</a></li><li class="chapter-item expanded "><a href="interrupts.html"><strong aria-hidden="true">8.</strong> Hardware Interrupts</a></li><li class="chapter-item expanded "><a href="bios.html"><strong aria-hidden="true">9.</strong> BIOS (Software Interrupts)</a></li><li class="chapter-item expanded "><a href="registers.html"><strong aria-hidden="true">10.</strong> Memory-Mapped Hardware Registers</a></li><li class="chapter-item expanded "><a href="audio/introduction.html"><strong aria-hidden="true">11.</strong> Audio</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="audio/directsound.html"><strong aria-hidden="true">11.1.</strong> Direct Sound</a></li><li class="chapter-item expanded "><a href="audio/sound1.html"><strong aria-hidden="true">11.2.</strong> Sound Channel 1</a></li><li class="chapter-item expanded "><a href="audio/sound2.html"><strong aria-hidden="true">11.3.</strong> Sound Channel 2</a></li><li class="chapter-item expanded "><a href="audio/sound3.html"><strong aria-hidden="true">11.4.</strong> Sound Channel 3</a></li><li class="chapter-item expanded "><a href="audio/sound4.html"><strong aria-hidden="true">11.5.</strong> Sound Channel 4</a></li><li class="chapter-item expanded "><a href="audio/registers.html"><strong aria-hidden="true">11.6.</strong> Sound Registers</a></li></ol></li><li class="chapter-item expanded "><a href="bootleg-carts/introduction.html"><strong aria-hidden="true">12.</strong> Bootleg Carts</a></li><li class="chapter-item expanded "><a href="ack.html"><strong aria-hidden="true">13.</strong> Acknowledgements</a></li></ol>
|
88 | 110 | </div>
|
89 |
| - <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> |
| 111 | + <div id="sidebar-resize-handle" class="sidebar-resize-handle"> |
| 112 | + <div class="sidebar-resize-indicator"></div> |
| 113 | + </div> |
90 | 114 | </nav>
|
91 | 115 |
|
| 116 | + <!-- Track and set sidebar scroll position --> |
| 117 | + <script> |
| 118 | + var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox'); |
| 119 | + sidebarScrollbox.addEventListener('click', function(e) { |
| 120 | + if (e.target.tagName === 'A') { |
| 121 | + sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop); |
| 122 | + } |
| 123 | + }, { passive: true }); |
| 124 | + var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll'); |
| 125 | + sessionStorage.removeItem('sidebar-scroll'); |
| 126 | + if (sidebarScrollTop) { |
| 127 | + // preserve sidebar scroll position when navigating via links within sidebar |
| 128 | + sidebarScrollbox.scrollTop = sidebarScrollTop; |
| 129 | + } else { |
| 130 | + // scroll sidebar to current active section when navigating via "next/previous chapter" buttons |
| 131 | + var activeSection = document.querySelector('#sidebar .active'); |
| 132 | + if (activeSection) { |
| 133 | + activeSection.scrollIntoView({ block: 'center' }); |
| 134 | + } |
| 135 | + } |
| 136 | + </script> |
| 137 | + |
92 | 138 | <div id="page-wrapper" class="page-wrapper">
|
93 | 139 |
|
94 | 140 | <div class="page">
|
95 | 141 | <div id="menu-bar-hover-placeholder"></div>
|
96 |
| - <div id="menu-bar" class="menu-bar sticky bordered"> |
| 142 | + <div id="menu-bar" class="menu-bar sticky"> |
97 | 143 | <div class="left-buttons">
|
98 |
| - <button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar"> |
| 144 | + <label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar"> |
99 | 145 | <i class="fa fa-bars"></i>
|
100 |
| - </button> |
| 146 | + </label> |
101 | 147 | <button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
|
102 | 148 | <i class="fa fa-paint-brush"></i>
|
103 | 149 | </button>
|
104 | 150 | <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
|
105 |
| - <li role="none"><button role="menuitem" class="theme" id="light">Light (default)</button></li> |
| 151 | + <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li> |
106 | 152 | <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
|
107 | 153 | <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
|
108 | 154 | <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
|
@@ -135,7 +181,7 @@ <h1 class="menu-title">gbadoc</h1>
|
135 | 181 | </div>
|
136 | 182 |
|
137 | 183 | <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
|
138 |
| - <script type="text/javascript"> |
| 184 | + <script> |
139 | 185 | document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
140 | 186 | document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
141 | 187 | Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
|
@@ -168,21 +214,22 @@ <h1 id="document-not-found-404"><a class="header" href="#document-not-found-404"
|
168 | 214 |
|
169 | 215 |
|
170 | 216 |
|
171 |
| - <script type="text/javascript"> |
| 217 | + <script> |
172 | 218 | window.playground_copyable = true;
|
173 | 219 | </script>
|
174 | 220 |
|
175 | 221 |
|
176 |
| - <script src="elasticlunr.min.js" type="text/javascript" charset="utf-8"></script> |
177 |
| - <script src="mark.min.js" type="text/javascript" charset="utf-8"></script> |
178 |
| - <script src="searcher.js" type="text/javascript" charset="utf-8"></script> |
| 222 | + <script src="elasticlunr.min.js"></script> |
| 223 | + <script src="mark.min.js"></script> |
| 224 | + <script src="searcher.js"></script> |
179 | 225 |
|
180 |
| - <script src="clipboard.min.js" type="text/javascript" charset="utf-8"></script> |
181 |
| - <script src="highlight.js" type="text/javascript" charset="utf-8"></script> |
182 |
| - <script src="book.js" type="text/javascript" charset="utf-8"></script> |
| 226 | + <script src="clipboard.min.js"></script> |
| 227 | + <script src="highlight.js"></script> |
| 228 | + <script src="book.js"></script> |
183 | 229 |
|
184 | 230 | <!-- Custom JS scripts -->
|
185 | 231 |
|
186 | 232 |
|
| 233 | + </div> |
187 | 234 | </body>
|
188 | 235 | </html>
|
0 commit comments